@readmagic/workmate 0.0.28 → 0.0.30
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-Bmgh8VS3.js → AddWorkspaceDirectory-B03NZZuQ.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-45Ize2zR.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-BJfHqScU.js → AgentsMdExternalIncludesDialog-CIyefOzT.js} +1 -1
- package/dist/chunks/App-WBysAL0_.js +1 -0
- package/dist/chunks/{BackgroundTasksDialog-WkoL4g5Q.js → BackgroundTasksDialog-CvvrjBoq.js} +2 -2
- package/dist/chunks/{BypassPermissionsModeDialog-BT9yl0Qt.js → BypassPermissionsModeDialog-DdVbMyla.js} +1 -1
- package/dist/chunks/{CustomSelect-t4wXuXWH.js → CustomSelect-iSG1rbWU.js} +1 -1
- package/dist/chunks/{DiffDialog-CXZxnb7Y.js → DiffDialog-DSb46fzB.js} +5 -5
- package/dist/chunks/Doctor--yF3SBsD.js +1 -0
- package/dist/chunks/Doctor-dR71Dg_D.js +3 -0
- package/dist/chunks/ExitFlow-BiBi5Sqk.js +2 -0
- package/dist/chunks/{InvalidConfigDialog-riLYEaUP.js → InvalidConfigDialog-7MkDSXXj.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-BGXl3V1A.js → InvalidSettingsDialog-D8Ves3Th.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-syiDgtpB.js → KeybindingProviderSetup-DJSFdVYv.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BZxRMdGO.js +1 -0
- package/dist/chunks/MCPToolListView-H_Kvvelz.js +1 -0
- package/dist/chunks/{McpParsingWarnings-Czze2JPd.js → McpParsingWarnings-D2xvaog9.js} +1 -1
- package/dist/chunks/MessageSelector-DQgIgPij.js +3 -0
- package/dist/chunks/Messages-DyQCr-od.js +10 -0
- package/dist/chunks/{Onboarding-CD_Uv5h9.js → Onboarding-DFufTPIY.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-CHXJsTtQ.js → PromptInputFooterSuggestions-B9JRcHHE.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-BZIVCV7V.js → PromptInputHelpMenu-DcGXK5lt.js} +1 -1
- package/dist/chunks/{ProviderSetup-CwMvjmjh.js → ProviderSetup-DJ_Z1BSe.js} +1 -1
- package/dist/chunks/QueryEngine-BQ5PSqKV.js +1 -0
- package/dist/chunks/{REPL-CtFtb35A.js → REPL-CjoJCy0g.js} +24 -24
- package/dist/chunks/REPL-DGieTVDl.js +1 -0
- package/dist/chunks/ResumeConversation-exTLviBY.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-BBhWAuoA.js +1 -0
- package/dist/chunks/Settings-nM6-cXh0.js +2 -0
- package/dist/chunks/Spinner-ChT4lOOg.js +1 -0
- package/dist/chunks/{SpinnerGlyph-BR_SiV9L.js → SpinnerGlyph-4aVLQdJf.js} +1 -1
- package/dist/chunks/{TextInput-ou7ZhpVY.js → TextInput-CanSwT9J.js} +5 -5
- package/dist/chunks/{ThemePicker-CVFWqSc7.js → ThemePicker-CXzPiSy0.js} +1 -1
- package/dist/chunks/{TrustDialog-CGXv_LF4.js → TrustDialog-D0fJ-YIw.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-CKeHoN2Z.js → ValidationErrorsList-29bQ0l-Q.js} +1 -1
- package/dist/chunks/{_baseEach-BYhqv77g.js → _baseEach-DPcnudh_.js} +1 -1
- package/dist/chunks/{add-dir-BSizpuef.js → add-dir-DbNz1SeY.js} +1 -1
- package/dist/chunks/{agentDisplay-JKfYFD1m.js → agentDisplay-Bif3eE1e.js} +1 -1
- package/dist/chunks/{agents-BDTCH6YB.js → agents-CbsNbPbp.js} +1 -1
- package/dist/chunks/{agents-MEaV8P2G.js → agents-yvC-VikU.js} +6 -6
- package/dist/chunks/allErrors-Bv1e8fra.js +1 -0
- package/dist/chunks/{appleTerminalBackup-CN8kS74J.js → appleTerminalBackup-Ct9hf1QQ.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-CsXlkIg3.js → backgroundHousekeeping-C75FgxW1.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-d0qpqWHe.js +1 -0
- package/dist/chunks/banner-D5m9LUjl.js +2 -0
- package/dist/chunks/{branch-BllXcYwS.js → branch-DOQ3yNds.js} +2 -2
- package/dist/chunks/bridgeControl-DMUu37uO.js +2 -0
- package/dist/chunks/{btw-DzaRBa6o.js → btw-DUjuwyMH.js} +1 -1
- package/dist/chunks/{bundledMode-D9omqD3L.js → bundledMode-Dqe4pz0a.js} +1 -1
- package/dist/chunks/caches-BKAPMXp9.js +1 -0
- package/dist/chunks/caches-he4NeZSK.js +1 -0
- package/dist/chunks/channel-C8JmEI06.js +2 -0
- package/dist/chunks/{channel-Gw6skpUh.js → channel-TEYwDITo.js} +1 -1
- package/dist/chunks/{clear-CDQs9_5P.js → clear-BFlTcvMt.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-BoGtXPAA.js +1 -0
- package/dist/chunks/compact-CyR7Sbo1.js +2 -0
- package/dist/chunks/config-B-hDBSL8.js +1 -0
- package/dist/chunks/config-Bjwat4P6.js +3 -0
- package/dist/chunks/config-DubkVeOw.js +1 -0
- package/dist/chunks/{context-TkdzCK3Y.js → context-Cm_gyngQ.js} +1 -1
- package/dist/chunks/{context-noninteractive-BcBo64vo.js → context-noninteractive-BDmFfPRt.js} +2 -2
- package/dist/chunks/context-noninteractive-CmOFpwwP.js +1 -0
- package/dist/chunks/conversation-B7YCvyCD.js +1 -0
- package/dist/chunks/conversation-CYZKYlWc.js +1 -0
- package/dist/chunks/{conversationRecovery-_hWC7JBO.js → conversationRecovery-BUqpxLl-.js} +1 -1
- package/dist/chunks/crossProjectResume-BCa2l0KZ.js +40 -0
- 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-BzVUPO4Z.js → diff-BEvpLh_b.js} +1 -1
- package/dist/chunks/{directoryCompletion-BC0qRmrz.js → directoryCompletion-CwKPuwrS.js} +1 -1
- package/dist/chunks/doctor-DYKr9Reu.js +1 -0
- package/dist/chunks/{entry-333L52Lo.js → entry-JGyBs1p5.js} +3 -3
- package/dist/chunks/{execFileNoThrow-DXSEj8ZO.js → execFileNoThrow-7Ys9mO27.js} +1 -1
- package/dist/chunks/exit-DU2KGyDk.js +1 -0
- package/dist/chunks/{extraUsage-CmgRR-zH.js → extraUsage-cZx2XLx4.js} +1 -1
- package/dist/chunks/extractMemories-4wbv-mTc.js +1 -0
- package/dist/chunks/fast-BALHWqpd.js +1 -0
- package/dist/chunks/{fast-D7oNjaZ3.js → fast-DUJq6-QE.js} +1 -1
- package/dist/chunks/{fetchModelList-Cv1vWIpC.js → fetchModelList-Dn8OahtV.js} +1 -1
- package/dist/chunks/fetchModelList-OZ2sLDEx.js +1 -0
- package/dist/chunks/{fileSuggestions-DF3HTRKr.js → fileSuggestions-XLnnVLwx.js} +3 -3
- package/dist/chunks/{gemini-ou7_YyXc.js → gemini-qzPNGqOX.js} +2 -2
- package/dist/chunks/{generateSessionName-CeN9EZNY.js → generateSessionName-CA-cc58H.js} +1 -1
- package/dist/chunks/{genericProcessUtils-GqURdVAv.js → genericProcessUtils-XwqvFxyn.js} +1 -1
- package/dist/chunks/{goal-CCxo4Wyf.js → goal-x9Pkx5nv.js} +3 -3
- package/dist/chunks/{grok-BMmUcNbI.js → grok-36CpLjsq.js} +1 -1
- package/dist/chunks/{help-CYtogTZk.js → help-DwfAEV0X.js} +1 -1
- package/dist/chunks/{history-CUrqO9rV.js → history-PZLMYab7.js} +1 -1
- package/dist/chunks/hooks-BofA8GeO.js +1 -0
- package/dist/chunks/{hooks-ByVkvodY.js → hooks-DBmA-DWx.js} +2 -2
- package/dist/chunks/{install-DIxyfdXG.js → install-DF4ep6nb.js} +1 -1
- package/dist/chunks/{instrumentation-BmHivmxs.js → instrumentation-BAbhrE3f.js} +3 -3
- package/dist/chunks/{job-D534P26R.js → job-CFWKIjNl.js} +1 -1
- package/dist/chunks/{keybindings-CxgQqQJe.js → keybindings-CkiE_uBG.js} +1 -1
- package/dist/chunks/{launchLocalMemory-CWXLb3KF.js → launchLocalMemory-Cf8l-1fz.js} +2 -2
- package/dist/chunks/{launchOnboarding-CocPmwzz.js → launchOnboarding-8CDef-v1.js} +1 -1
- package/dist/chunks/loadAgentsDir-C-qRJlXH.js +1 -0
- package/dist/chunks/{loadAgentsDir-bmpKLPdG.js → loadAgentsDir-DnHL_5cU.js} +358 -358
- package/dist/chunks/loadPluginHooks-BuunKr9m.js +1 -0
- package/dist/chunks/{loader-BMAtuwRa.js → loader-DsEdsMHv.js} +1 -1
- package/dist/chunks/localSearch-BulDBrBk.js +1 -0
- package/dist/chunks/{localSearch-Da8cVYoI.js → localSearch-LFCzV7VE.js} +1 -1
- package/dist/chunks/{log-L1kqxa_P.js → log-D98mO6yJ.js} +1 -1
- package/dist/chunks/{logoUtils-qNuBc2nI.js → logoUtils-B8MIA7c5.js} +1 -1
- package/dist/chunks/{magicDocs-BsEiBLQl.js → magicDocs-BoxJusTI.js} +2 -2
- package/dist/chunks/{main-B31aPMPP.js → main-B9ciFYnO.js} +22 -22
- package/dist/chunks/{managedEnv-EZ2IirNa.js → managedEnv-B0mj-wgE.js} +1 -1
- package/dist/chunks/managedEnv-BFpXdDI8.js +1 -0
- package/dist/chunks/mcp-B3Ewo-_h.js +1 -0
- package/dist/chunks/mcp-CHlAZvpV.js +2 -0
- package/dist/chunks/{mcp-Dd8TBfQQ.js → mcp-DVKuOqvY.js} +3 -3
- package/dist/chunks/memory-Cr0d-s7U.js +1 -0
- package/dist/chunks/{mode-SM8doWgC.js → mode-DBNBDbVP.js} +2 -2
- package/dist/chunks/model-B2r1Ms0g.js +1 -0
- package/dist/chunks/model-C9ANf1-R.js +1 -0
- package/dist/chunks/{modelOptions-BQL4gbNk.js → modelOptions-B4BWYms0.js} +1 -1
- package/dist/chunks/{nativeInstaller-DMkZdsof.js → nativeInstaller-BDJxBAPV.js} +1 -1
- package/dist/chunks/{notifications-BwS1XsnZ.js → notifications-BV-VeXyJ.js} +1 -1
- package/dist/chunks/{onChangeAppState-C9cYQJPF.js → onChangeAppState-BGWWkhBg.js} +1 -1
- package/dist/chunks/openai-BL_IWBTr.js +2 -0
- package/dist/chunks/{overlayContext-C5WPACKC.js → overlayContext-DGUFuee9.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-CKgWl7p4.js → partition-B2VCm4vu.js} +1 -1
- package/dist/chunks/{pasteStore-njJCBMKr.js → pasteStore-2RafnH7M.js} +1 -1
- package/dist/chunks/permissions-Bkj1UB1h.js +3 -0
- package/dist/chunks/{pidLock-CqkC3-nD.js → pidLock-CawSx6hb.js} +2 -2
- package/dist/chunks/{plan-Ce6wfjjI.js → plan-D7Ki5ADu.js} +1 -1
- package/dist/chunks/plugin-D7I6VZjh.js +17 -0
- package/dist/chunks/{pluginAutoupdate-ByokIVEs.js → pluginAutoupdate-Cr3jw-ky.js} +1 -1
- package/dist/chunks/pluginBlocklist-JG_kJSSK.js +1 -0
- package/dist/chunks/pluginCliCommands-BWIBBFJf.js +1 -0
- package/dist/chunks/{pluginFlagging-B2ZX5_oB.js → pluginFlagging-yFcXMVin.js} +1 -1
- package/dist/chunks/pluginOperations-6QXjdPOb.js +2 -0
- package/dist/chunks/pluginStartupCheck-B-nYb61N.js +1 -0
- package/dist/chunks/{pluginStartupCheck-QG0d95dE.js → pluginStartupCheck-CkjyJ4RS.js} +1 -1
- package/dist/chunks/plugins-CMDfjFp-.js +4 -0
- package/dist/chunks/{poorMode-CG2JNTD0.js → poorMode-BvypUTur.js} +1 -1
- package/dist/chunks/poorMode-CP6359Sz.js +1 -0
- package/dist/chunks/print-B6x_8O9w.js +13 -0
- package/dist/chunks/process-CewWh77C.js +1 -0
- package/dist/chunks/process-De2crvt4.js +1 -0
- package/dist/chunks/processBashCommand-D0BBcBHY.js +1 -0
- package/dist/chunks/processSlashCommand-BvjNuNyP.js +5 -0
- package/dist/chunks/{projectOnboardingState-D-_ijZnG.js → projectOnboardingState-ofkjp9FJ.js} +1 -1
- package/dist/chunks/prompt-Cpu4meqR.js +1 -0
- package/dist/chunks/{prompt-BnDapYGL.js → prompt-DDlkyIzV.js} +3 -3
- package/dist/chunks/prompt-HO8Docca.js +1 -0
- package/dist/chunks/{promptEditor-14TB3MYt.js → promptEditor-CyMqa_av.js} +1 -1
- package/dist/chunks/{protocolHandler-CJO3CRYW.js → protocolHandler-Bjmx7OmF.js} +1 -1
- package/dist/chunks/{proxy--_NfbJhm.js → proxy-MzIsnPd7.js} +1 -1
- package/dist/chunks/{reconciler-C_HKsocm.js → reconciler-CHbint0C.js} +1 -1
- package/dist/chunks/refresh-yut9uEfd.js +1 -0
- package/dist/chunks/{reject-Tug1RmkE.js → reject-CrNfit3M.js} +1 -1
- package/dist/chunks/{reload-plugins-CL9LWzpq.js → reload-plugins-labKy5Eh.js} +1 -1
- package/dist/chunks/rename-c8tElppw.js +1 -0
- package/dist/chunks/{renderOptions-B0RFpjRI.js → renderOptions-B3DyIbF6.js} +1 -1
- package/dist/chunks/{resume-BZ42SpS2.js → resume-C8xif2lo.js} +2 -2
- package/dist/chunks/ripgrep-CIIzTaSI.js +1 -0
- package/dist/chunks/{ripgrep-67m14ImZ.js → ripgrep-CnK9qx1e.js} +1 -1
- package/dist/chunks/{runtimeObserver-DT5P2_XL.js → runtimeObserver-DuJ8mRfr.js} +4 -4
- package/dist/chunks/{runtimeObserver-BLq2guVy.js → runtimeObserver-vmPplAGH.js} +1 -1
- package/dist/chunks/sandbox-adapter-BKnsdtVj.js +1 -0
- package/dist/chunks/{sandbox-toggle-DghmaJhK.js → sandbox-toggle-USHaZHD7.js} +1 -1
- package/dist/chunks/searchExtraTools-DV5iZPdw.js +1 -0
- package/dist/chunks/{select-CaxQ-BVq.js → select-BpiKdirZ.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-nq8C34WL.js +1 -0
- package/dist/chunks/sessionObserver-CKp3uqPg.js +1 -0
- package/dist/chunks/{sessionObserver-DBoZUvWL.js → sessionObserver-sO6PF7mV.js} +1 -1
- package/dist/chunks/sessionStorage-CuQf4d1y.js +1 -0
- package/dist/chunks/{sessionTracing-5a7HDF4e.js → sessionTracing-Bz89tYh5.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-B-FejaeH.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-L3tnySui.js → shadowedRuleDetection-BI6Xz0pY.js} +1 -1
- package/dist/chunks/{sideQuestion-BJTVma-5.js → sideQuestion-BEpCuv_7.js} +3 -3
- package/dist/chunks/{sinks-CV0SWuZW.js → sinks-BvOPODnl.js} +1 -1
- package/dist/chunks/sinks-DLALCllz.js +1 -0
- package/dist/chunks/skillChangeDetector-D-fxaAMH.js +1 -0
- package/dist/chunks/{skillGapStore-Cposc03e.js → skillGapStore-A1FCr8Mf.js} +2 -2
- package/dist/chunks/{skillLifecycle-RXQp0JU7.js → skillLifecycle-CTVa34xO.js} +2 -2
- package/dist/chunks/{skillSearchPanel-B2pjskqk.js → skillSearchPanel-CjekGkrw.js} +4 -4
- package/dist/chunks/{skills-D2ZjMtv4.js → skills-110JHHbj.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-D_b3UMke.js +1 -0
- package/dist/chunks/statusNoticeHelpers-C5BRU3lw.js +1 -0
- package/dist/chunks/{stringUtils-Cs6E5f-B.js → stringUtils-CtJhTszO.js} +1 -1
- package/dist/chunks/switcher-BFzvv7KT.js +1 -0
- package/dist/chunks/{switcher-rep86o4_.js → switcher-nLHGsxLw.js} +1 -1
- package/dist/chunks/{tasks-B4coTfrq.js → tasks-CjYr59Ak.js} +1 -1
- package/dist/chunks/{templateJobs-C5ukh6H3.js → templateJobs-ECX0rRRp.js} +1 -1
- package/dist/chunks/{terminalSetup-CaGbEVjB.js → terminalSetup-AptBNs_i.js} +1 -1
- package/dist/chunks/{terminalSetup-xe_P98fY.js → terminalSetup-CKO6eWhS.js} +1 -1
- package/dist/chunks/{theme-7RmvErYJ.js → theme-BCSx9irC.js} +1 -1
- package/dist/chunks/tipRegistry-CnQB3TaA.js +2 -0
- package/dist/chunks/{toolEventObserver-Dzwzi5Vi.js → toolEventObserver-Bqtypnkk.js} +1 -1
- package/dist/chunks/toolPool-B1sXN7SK.js +1 -0
- package/dist/chunks/{udsClient-CWeoNrm3.js → udsClient-COYqIvvr.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BT0nexZw.js → useExitOnCtrlCDWithKeybindings-DegJrysj.js} +1 -1
- package/dist/chunks/useMainLoopModel-CPnigpM1.js +1 -0
- package/dist/chunks/useManagePlugins-BW2Zj_jf.js +1 -0
- package/dist/chunks/useMergedTools-CTm1AU9b.js +1 -0
- package/dist/chunks/{useSearchInput-j12K4wEo.js → useSearchInput-DrY4BZKy.js} +1 -1
- package/dist/chunks/useSettingsErrors-2uIAF6H8.js +1 -0
- package/dist/chunks/{util-CCEK8oze.js → util-BUgUtaUV.js} +1 -1
- package/dist/chunks/validatePlugin-BGB8T9Mb.js +1 -0
- package/dist/chunks/{vim-BlO9V5_5.js → vim-DdxGarvY.js} +1 -1
- package/dist/chunks/worktree-DBZ7f9Lk.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BjbUilCE.js +0 -1
- package/dist/chunks/App-COdpsR2w.js +0 -1
- package/dist/chunks/Doctor-B6isid5K.js +0 -1
- package/dist/chunks/Doctor-COj-tZBc.js +0 -3
- package/dist/chunks/ExitFlow-CcMYH5iI.js +0 -2
- package/dist/chunks/MCPConnectionManager-C7RmKzJh.js +0 -1
- package/dist/chunks/MCPToolListView-CewNLJus.js +0 -1
- package/dist/chunks/MessageSelector-Kc6JlnDX.js +0 -3
- package/dist/chunks/Messages-BvFYO4Zn.js +0 -10
- package/dist/chunks/QueryEngine-DAwfp_ht.js +0 -1
- package/dist/chunks/REPL-tFT1FGQF.js +0 -1
- package/dist/chunks/ResumeConversation-CERzSBvg.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-ndh4aEwQ.js +0 -1
- package/dist/chunks/Settings-CPaqWNdP.js +0 -2
- package/dist/chunks/Spinner-C0qHjfIY.js +0 -1
- package/dist/chunks/allErrors-Dhnf6rqg.js +0 -1
- package/dist/chunks/backgroundHousekeeping-Bu-zRFCx.js +0 -1
- package/dist/chunks/banner-BKOzHotb.js +0 -2
- package/dist/chunks/bridgeControl-aDnUrYZR.js +0 -2
- package/dist/chunks/caches-CMF-MmR-.js +0 -1
- package/dist/chunks/caches-CW5YnYNS.js +0 -1
- package/dist/chunks/channel-DVx21qde.js +0 -1
- package/dist/chunks/client-B0ngS4Uu.js +0 -1
- package/dist/chunks/client-BP4DOH3K.js +0 -1
- package/dist/chunks/commands-CfYMwgP7.js +0 -1
- package/dist/chunks/compact-6F2tuItE.js +0 -2
- package/dist/chunks/config-BDkzWBnL.js +0 -1
- package/dist/chunks/config-Bio2EjUK.js +0 -3
- package/dist/chunks/config-C_AEhZrn.js +0 -1
- package/dist/chunks/context-noninteractive-oFcnY1Er.js +0 -1
- package/dist/chunks/conversation-CYZyg1U1.js +0 -1
- package/dist/chunks/conversation-DXzlRhNw.js +0 -1
- package/dist/chunks/crossProjectResume-CCo3iZrB.js +0 -40
- package/dist/chunks/doctor-B4jQbGQr.js +0 -1
- package/dist/chunks/exit-D5DYnRvR.js +0 -1
- package/dist/chunks/extractMemories-CVUrBFMj.js +0 -1
- package/dist/chunks/fast-CRhW9zha.js +0 -1
- package/dist/chunks/fetchModelList-DIa1HwAJ.js +0 -1
- package/dist/chunks/hooks-CBGUcyCs.js +0 -1
- package/dist/chunks/loadAgentsDir-Zw648oQO.js +0 -1
- package/dist/chunks/loadPluginHooks-BIfM53-_.js +0 -1
- package/dist/chunks/localSearch-Dbj8cXyO.js +0 -1
- package/dist/chunks/managedEnv-DCGLDTP_.js +0 -1
- package/dist/chunks/mcp-BMeWtYCx.js +0 -2
- package/dist/chunks/mcp-CYbesbfl.js +0 -1
- package/dist/chunks/memory-DtQQGyPS.js +0 -1
- package/dist/chunks/model-C2r-PaR4.js +0 -1
- package/dist/chunks/model-Dd3x121y.js +0 -1
- package/dist/chunks/openai-Bea4I2Od.js +0 -2
- package/dist/chunks/parser-Diihup2V.js +0 -1
- package/dist/chunks/permissions-Dv_PCfY0.js +0 -3
- package/dist/chunks/plugin-aK4tDrVg.js +0 -17
- package/dist/chunks/pluginBlocklist-ByRQaVPu.js +0 -1
- package/dist/chunks/pluginCliCommands-Dyk4HYHs.js +0 -1
- package/dist/chunks/pluginOperations-BCvJvfOC.js +0 -2
- package/dist/chunks/pluginStartupCheck-o_TC7wIt.js +0 -1
- package/dist/chunks/plugins-DzsTDNWJ.js +0 -4
- package/dist/chunks/poorMode-eMIFCAC_.js +0 -1
- package/dist/chunks/print-dUT7E1g9.js +0 -13
- package/dist/chunks/process-CNfq37LF.js +0 -1
- package/dist/chunks/process-gEbdy6uY.js +0 -1
- package/dist/chunks/processBashCommand-DtGCgTkF.js +0 -1
- package/dist/chunks/processSlashCommand-wXblpK2C.js +0 -5
- package/dist/chunks/prompt-BdH2zk0S.js +0 -1
- package/dist/chunks/prompt-D0TFER0A.js +0 -1
- package/dist/chunks/refresh-Cm4jZzLa.js +0 -1
- package/dist/chunks/rename-OfKJSazJ.js +0 -1
- package/dist/chunks/ripgrep-DB7KB8RZ.js +0 -1
- package/dist/chunks/sandbox-adapter-982rx2cm.js +0 -1
- package/dist/chunks/searchExtraTools-B4N1bpy0.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BqQ58T7e.js +0 -1
- package/dist/chunks/sessionObserver-qYpA90El.js +0 -1
- package/dist/chunks/sessionStorage-CC0v4zMs.js +0 -1
- package/dist/chunks/settings-Dfit5gGT.js +0 -1
- package/dist/chunks/setup-DVLnIlse.js +0 -3
- package/dist/chunks/sinks-C9NdbjLo.js +0 -1
- package/dist/chunks/skillChangeDetector-DlodgOyC.js +0 -1
- package/dist/chunks/startupProfiler-DWcM4QBl.js +0 -1
- package/dist/chunks/status-BcSkj9nE.js +0 -1
- package/dist/chunks/statusNoticeHelpers-DsrqBOQt.js +0 -1
- package/dist/chunks/switcher-BietN6il.js +0 -1
- package/dist/chunks/tipRegistry-BYpJZIjR.js +0 -2
- package/dist/chunks/toolPool-BGfiNj6h.js +0 -1
- package/dist/chunks/useMainLoopModel-QuE7VkgX.js +0 -1
- package/dist/chunks/useManagePlugins-pGaGzsEg.js +0 -1
- package/dist/chunks/useMergedTools-BLsIT3R_.js +0 -1
- package/dist/chunks/useSettingsErrors-C8VIzdws.js +0 -1
- package/dist/chunks/validatePlugin-CTVnWx9H.js +0 -1
- package/dist/chunks/worktree-BWL0vR4o.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{c as n,i as r,n as i,r as a,s as o,t as s}from"./isObject-C6qM3WEW.js";import{d as c,f as l,g as u,h as d,l as f,n as p,t as m,u as ee}from"./memoize-BK3gG5ob.js";import{i as h,l as g,o as te}from"./envUtils-QyzA_cFM.js";import{n as ne,t as _}from"./defineProperty-C-QyHrDq.js";import{a as v,c as re,i as y,n as ie,o as ae,r as b,s as x,t as S}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as oe,t as se}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as ce,r as le}from"./isSymbol-BO6cdPI7.js";import{$n as ue,Ar as de,Dt as fe,Fr as pe,Gr as me,Hr as he,Ir as ge,Jn as _e,Kr as ve,Lr as ye,Mr as be,Nr as xe,O as Se,Or as Ce,Pr as we,Pt as Te,Qn as Ee,Ur as De,Wn as Oe,Wr as ke,Xn as Ae,Yn as je,Zn as Me,ci as Ne,er as Pe,hi as Fe,jr as Ie,k as Le,kr as Re,li as ze,mi as Be,ni as Ve,or as He,q as Ue,qr as We,ri as Ge,rr as Ke,sr as qe,tr as Je,v as Ye}from"./state-CXY-q5gr.js";import{n as Xe,t as Ze}from"./cwd-DrEEb4f5.js";import{$ as Qe,C as $e,I as et,N as tt,R as nt,S as rt,b as it,c as C,et as at,f as ot,g as st,i as ct,u as w,x as lt,z as ut}from"./debug-2pVES-2G.js";import{S as dt,o as ft,s as pt,y as mt}from"./log-L1kqxa_P.js";import{i as ht,n as gt}from"./execFileNoThrow-DXSEj8ZO.js";import{c as _t,d as vt,i as yt,l as bt,o as xt,r as St,s as Ct,t as wt,u as Tt}from"./bundledMode-D9omqD3L.js";import{n as Et}from"./analytics-COpjZpvd.js";import{n as Dt,r as Ot}from"./startupProfiler-B9Qv2QGH.js";import{f as kt,l as At,n as jt,o as Mt,p as Nt}from"./stringUtils-Cs6E5f-B.js";import{homedir as Pt,userInfo as Ft}from"os";import{basename as It,dirname as Lt,extname as Rt,isAbsolute as zt,join as T,normalize as Bt,posix as Vt,relative as Ht,resolve as Ut,sep as Wt}from"path";import{chmodSync as Gt,existsSync as Kt,readFileSync as qt,realpathSync as Jt,statSync as Yt,unwatchFile as Xt,watchFile as Zt,writeFileSync as Qt}from"fs";import"crypto";import{appendFile as $t,mkdir as en,open as tn,readFile as nn,readdir as rn,realpath as an,stat as on,writeFile as sn}from"fs/promises";import{promisify as cn}from"util";import{execFile as ln}from"child_process";import{channel as un,tracingChannel as dn}from"node:diagnostics_channel";import*as fn from"path/win32";function E(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function pn(e){return e&&Object.assign(yn,e),yn}var mn,hn,gn,_n,vn,yn,bn=e((()=>{hn=Object.freeze({status:`aborted`}),gn=Symbol(`zod_brand`),_n=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},vn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(mn=globalThis).__zod_globalConfig??(mn.__zod_globalConfig={}),yn=globalThis.__zod_globalConfig})),xn=t({BIGINT_FORMAT_RANGES:()=>Tr,Class:()=>Er,NUMBER_FORMAT_RANGES:()=>wr,aborted:()=>rr,allowsEval:()=>br,assert:()=>En,assertEqual:()=>Sn,assertIs:()=>wn,assertNever:()=>Tn,assertNotEqual:()=>Cn,assignProp:()=>Pn,base64ToUint8Array:()=>fr,base64urlToUint8Array:()=>mr,cached:()=>kn,captureStackTrace:()=>yr,cleanEnum:()=>dr,cleanRegex:()=>jn,clone:()=>qn,cloneDef:()=>In,createTransparentProxy:()=>Jn,defineLazy:()=>O,esc:()=>Bn,escapeRegex:()=>Kn,explicitlyAborted:()=>ir,extend:()=>Qn,finalizeIssue:()=>sr,floatSafeRemainder:()=>Mn,getElementAtPath:()=>Ln,getEnumValues:()=>Dn,getLengthableOrigin:()=>lr,getParsedType:()=>xr,getSizableOrigin:()=>cr,hexToUint8Array:()=>gr,isObject:()=>Hn,isPlainObject:()=>Un,issue:()=>ur,joinValues:()=>D,jsonStringifyReplacer:()=>On,merge:()=>er,mergeDefs:()=>Fn,normalizeParams:()=>k,nullish:()=>An,numKeys:()=>Gn,objectClone:()=>Nn,omit:()=>Zn,optionalKeys:()=>Yn,parsedType:()=>j,partial:()=>tr,pick:()=>Xn,prefixIssues:()=>ar,primitiveTypes:()=>Cr,promiseAllObject:()=>Rn,propertyKeyTypes:()=>Sr,randomString:()=>zn,required:()=>nr,safeExtend:()=>$n,shallowClone:()=>Wn,slugify:()=>Vn,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>pr,uint8ArrayToBase64url:()=>hr,uint8ArrayToHex:()=>_r,unwrapMessage:()=>or});function Sn(e){return e}function Cn(e){return e}function wn(e){}function Tn(e){throw Error(`Unexpected value in exhaustive check`)}function En(e){}function Dn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function D(e,t=`|`){return e.map(e=>A(e)).join(t)}function On(e,t){return typeof t==`bigint`?t.toString():t}function kn(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function An(e){return e==null}function jn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Mn(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function O(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==vr)return r===void 0&&(r=vr,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Nn(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fn(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function In(e){return Fn(e._zod.def)}function Ln(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Rn(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function zn(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Bn(e){return JSON.stringify(e)}function Vn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Hn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Un(e){if(Hn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Hn(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Wn(e){return Un(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Gn(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Kn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function qn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function k(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Jn(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function A(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Yn(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Xn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return qn(e,Fn(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Pn(this,`shape`,e),e},checks:[]}))}function Zn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return qn(e,Fn(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Pn(this,`shape`,r),r},checks:[]}))}function Qn(e,t){if(!Un(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return qn(e,Fn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Pn(this,`shape`,n),n}}))}function $n(e,t){if(!Un(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return qn(e,Fn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Pn(this,`shape`,n),n}}))}function er(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return qn(e,Fn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Pn(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function tr(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return qn(t,Fn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Pn(this,`shape`,i),i},checks:[]}))}function nr(e,t,n){return qn(t,Fn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Pn(this,`shape`,i),i}}))}function rr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ir(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ar(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function or(e){return typeof e==`string`?e:e?.message}function sr(e,t,n){let r=e.message?e.message:or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(n.customError?.(e))??or(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=r,t?.reportInput&&(s.input=o),s}function cr(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function lr(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function j(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function ur(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function dr(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function fr(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function pr(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function mr(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return fr(t+`=`.repeat((4-t.length%4)%4))}function hr(e){return pr(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function gr(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function _r(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var vr,yr,br,xr,Sr,Cr,wr,Tr,Er,M=e((()=>{bn(),vr=Symbol(`evaluating`),yr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},br=kn(()=>{if(yn.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),xr=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Sr=new Set([`string`,`number`,`symbol`]),Cr=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),wr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Tr={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Er=class{constructor(...e){}}}));function Dr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Or(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function kr(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??(r.items=[]),(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function Ar(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function jr(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Ar(e.path)}`);return t.join(`
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{c as n,i as r,n as i,r as a,s as o,t as s}from"./isObject-C6qM3WEW.js";import{d as c,f as l,g as u,h as d,l as f,n as p,t as m,u as ee}from"./memoize-BK3gG5ob.js";import{i as h,l as g,o as te}from"./envUtils-QyzA_cFM.js";import{n as ne,t as _}from"./defineProperty-C-QyHrDq.js";import{a as v,c as re,i as y,n as ie,o as ae,r as b,s as x,t as S}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as oe,t as se}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as ce,r as le}from"./isSymbol-BO6cdPI7.js";import{$n as ue,Ar as de,Dt as fe,Fr as pe,Gr as me,Hr as he,Ir as ge,Jn as _e,Kr as ve,Lr as ye,Mr as be,Nr as xe,O as Se,Or as Ce,Pr as we,Pt as Te,Qn as Ee,Ur as De,Wn as Oe,Wr as ke,Xn as Ae,Yn as je,Zn as Me,ci as Ne,er as Pe,hi as Fe,jr as Ie,k as Le,kr as Re,li as ze,mi as Be,ni as Ve,or as He,q as Ue,qr as We,ri as Ge,rr as Ke,sr as qe,tr as Je,v as Ye}from"./state-CXY-q5gr.js";import{n as Xe,t as Ze}from"./cwd-DrEEb4f5.js";import{$ as Qe,C as $e,I as et,N as tt,R as nt,S as rt,b as it,c as C,et as at,f as ot,g as st,i as ct,u as w,x as lt,z as ut}from"./debug-NBJH_NxR.js";import{S as dt,o as ft,s as pt,y as mt}from"./log-D98mO6yJ.js";import{i as ht,n as gt}from"./execFileNoThrow-7Ys9mO27.js";import{c as _t,d as vt,i as yt,l as bt,o as xt,r as St,s as Ct,t as wt,u as Tt}from"./bundledMode-Dqe4pz0a.js";import{n as Et}from"./analytics-COpjZpvd.js";import{n as Dt,r as Ot}from"./startupProfiler-C_xcIvEA.js";import{f as kt,l as At,n as jt,o as Mt,p as Nt}from"./stringUtils-CtJhTszO.js";import{homedir as Pt,userInfo as Ft}from"os";import{basename as It,dirname as Lt,extname as Rt,isAbsolute as zt,join as T,normalize as Bt,posix as Vt,relative as Ht,resolve as Ut,sep as Wt}from"path";import{chmodSync as Gt,existsSync as Kt,readFileSync as qt,realpathSync as Jt,statSync as Yt,unwatchFile as Xt,watchFile as Zt,writeFileSync as Qt}from"fs";import"crypto";import{appendFile as $t,mkdir as en,open as tn,readFile as nn,readdir as rn,realpath as an,stat as on,writeFile as sn}from"fs/promises";import{promisify as cn}from"util";import{execFile as ln}from"child_process";import{channel as un,tracingChannel as dn}from"node:diagnostics_channel";import*as fn from"path/win32";function E(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function pn(e){return e&&Object.assign(yn,e),yn}var mn,hn,gn,_n,vn,yn,bn=e((()=>{hn=Object.freeze({status:`aborted`}),gn=Symbol(`zod_brand`),_n=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},vn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(mn=globalThis).__zod_globalConfig??(mn.__zod_globalConfig={}),yn=globalThis.__zod_globalConfig})),xn=t({BIGINT_FORMAT_RANGES:()=>Tr,Class:()=>Er,NUMBER_FORMAT_RANGES:()=>wr,aborted:()=>rr,allowsEval:()=>br,assert:()=>En,assertEqual:()=>Sn,assertIs:()=>wn,assertNever:()=>Tn,assertNotEqual:()=>Cn,assignProp:()=>Pn,base64ToUint8Array:()=>fr,base64urlToUint8Array:()=>mr,cached:()=>kn,captureStackTrace:()=>yr,cleanEnum:()=>dr,cleanRegex:()=>jn,clone:()=>qn,cloneDef:()=>In,createTransparentProxy:()=>Jn,defineLazy:()=>O,esc:()=>Bn,escapeRegex:()=>Kn,explicitlyAborted:()=>ir,extend:()=>Qn,finalizeIssue:()=>sr,floatSafeRemainder:()=>Mn,getElementAtPath:()=>Ln,getEnumValues:()=>Dn,getLengthableOrigin:()=>lr,getParsedType:()=>xr,getSizableOrigin:()=>cr,hexToUint8Array:()=>gr,isObject:()=>Hn,isPlainObject:()=>Un,issue:()=>ur,joinValues:()=>D,jsonStringifyReplacer:()=>On,merge:()=>er,mergeDefs:()=>Fn,normalizeParams:()=>k,nullish:()=>An,numKeys:()=>Gn,objectClone:()=>Nn,omit:()=>Zn,optionalKeys:()=>Yn,parsedType:()=>j,partial:()=>tr,pick:()=>Xn,prefixIssues:()=>ar,primitiveTypes:()=>Cr,promiseAllObject:()=>Rn,propertyKeyTypes:()=>Sr,randomString:()=>zn,required:()=>nr,safeExtend:()=>$n,shallowClone:()=>Wn,slugify:()=>Vn,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>pr,uint8ArrayToBase64url:()=>hr,uint8ArrayToHex:()=>_r,unwrapMessage:()=>or});function Sn(e){return e}function Cn(e){return e}function wn(e){}function Tn(e){throw Error(`Unexpected value in exhaustive check`)}function En(e){}function Dn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function D(e,t=`|`){return e.map(e=>A(e)).join(t)}function On(e,t){return typeof t==`bigint`?t.toString():t}function kn(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function An(e){return e==null}function jn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Mn(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function O(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==vr)return r===void 0&&(r=vr,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Nn(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fn(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function In(e){return Fn(e._zod.def)}function Ln(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Rn(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function zn(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Bn(e){return JSON.stringify(e)}function Vn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Hn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Un(e){if(Hn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Hn(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Wn(e){return Un(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Gn(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Kn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function qn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function k(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Jn(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function A(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Yn(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Xn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return qn(e,Fn(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Pn(this,`shape`,e),e},checks:[]}))}function Zn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return qn(e,Fn(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Pn(this,`shape`,r),r},checks:[]}))}function Qn(e,t){if(!Un(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return qn(e,Fn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Pn(this,`shape`,n),n}}))}function $n(e,t){if(!Un(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return qn(e,Fn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Pn(this,`shape`,n),n}}))}function er(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return qn(e,Fn(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Pn(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function tr(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return qn(t,Fn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Pn(this,`shape`,i),i},checks:[]}))}function nr(e,t,n){return qn(t,Fn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Pn(this,`shape`,i),i}}))}function rr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ir(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ar(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function or(e){return typeof e==`string`?e:e?.message}function sr(e,t,n){let r=e.message?e.message:or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(n.customError?.(e))??or(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=r,t?.reportInput&&(s.input=o),s}function cr(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function lr(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function j(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function ur(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function dr(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function fr(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function pr(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function mr(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return fr(t+`=`.repeat((4-t.length%4)%4))}function hr(e){return pr(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function gr(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function _r(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var vr,yr,br,xr,Sr,Cr,wr,Tr,Er,M=e((()=>{bn(),vr=Symbol(`evaluating`),yr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},br=kn(()=>{if(yn.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),xr=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Sr=new Set([`string`,`number`,`symbol`]),Cr=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),wr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Tr={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Er=class{constructor(...e){}}}));function Dr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Or(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function kr(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??(r.items=[]),(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function Ar(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function jr(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Ar(e.path)}`);return t.join(`
|
|
2
2
|
`)}var Mr,Nr,Pr,Fr=e((()=>{bn(),M(),Mr=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,On,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Nr=E(`$ZodError`,Mr),Pr=E(`$ZodError`,Mr,{Parent:Error})})),Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi=e((()=>{bn(),Fr(),M(),Ir=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new _n;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>sr(e,a,pn())));throw yr(t,i?.callee),t}return o.value},Lr=Ir(Pr),Rr=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>sr(e,a,pn())));throw yr(t,i?.callee),t}return o.value},zr=Rr(Pr),Br=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new _n;return a.issues.length?{success:!1,error:new(e??Nr)(a.issues.map(e=>sr(e,i,pn())))}:{success:!0,data:a.value}},Vr=Br(Pr),Hr=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>sr(e,i,pn())))}:{success:!0,data:a.value}},Ur=Hr(Pr),Wr=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ir(e)(t,n,i)},Gr=Wr(Pr),Kr=e=>(t,n,r)=>Ir(e)(t,n,r),qr=Kr(Pr),Jr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Rr(e)(t,n,i)},Yr=Jr(Pr),Xr=e=>async(t,n,r)=>Rr(e)(t,n,r),Zr=Xr(Pr),Qr=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Br(e)(t,n,i)},$r=Qr(Pr),ei=e=>(t,n,r)=>Br(e)(t,n,r),ti=ei(Pr),ni=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hr(e)(t,n,i)},ri=ni(Pr),ii=e=>async(t,n,r)=>Hr(e)(t,n,r),ai=ii(Pr)})),si=t({base64:()=>zi,base64url:()=>Bi,bigint:()=>Ji,boolean:()=>Zi,browserEmail:()=>Mi,cidrv4:()=>Li,cidrv6:()=>Ri,cuid:()=>mi,cuid2:()=>hi,date:()=>Ki,datetime:()=>di,domain:()=>Hi,duration:()=>bi,e164:()=>Wi,email:()=>Di,emoji:()=>ci,extendedDuration:()=>xi,guid:()=>Si,hex:()=>na,hostname:()=>Vi,html5Email:()=>Oi,httpProtocol:()=>Ui,idnEmail:()=>ji,integer:()=>Yi,ipv4:()=>Pi,ipv6:()=>Fi,ksuid:()=>vi,lowercase:()=>ea,mac:()=>Ii,md5_base64:()=>ia,md5_base64url:()=>aa,md5_hex:()=>ra,nanoid:()=>yi,null:()=>Qi,number:()=>Xi,rfc5322Email:()=>ki,sha1_base64:()=>sa,sha1_base64url:()=>ca,sha1_hex:()=>oa,sha256_base64:()=>ua,sha256_base64url:()=>da,sha256_hex:()=>la,sha384_base64:()=>pa,sha384_base64url:()=>ma,sha384_hex:()=>fa,sha512_base64:()=>ga,sha512_base64url:()=>_a,sha512_hex:()=>ha,string:()=>qi,time:()=>ui,ulid:()=>gi,undefined:()=>$i,unicodeEmail:()=>Ai,uppercase:()=>ta,uuid:()=>Ci,uuid4:()=>wi,uuid6:()=>Ti,uuid7:()=>Ei,xid:()=>_i});function ci(){return new RegExp(Ni,`u`)}function li(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ui(e){return RegExp(`^${li(e)}$`)}function di(e){let t=li({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Gi}T(?:${r})$`)}function fi(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function pi(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va=e((()=>{M(),mi=/^[cC][0-9a-z]{6,}$/,hi=/^[0-9a-z]+$/,gi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_i=/^[0-9a-vA-V]{20}$/,vi=/^[A-Za-z0-9]{27}$/,yi=/^[a-zA-Z0-9_-]{21}$/,bi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xi=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Si=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ci=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,wi=Ci(4),Ti=Ci(6),Ei=Ci(7),Di=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Oi=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ki=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ai=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ji=Ai,Mi=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ni=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Pi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Fi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ii=e=>{let t=Kn(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Li=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ri=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bi=/^[A-Za-z0-9_-]*$/,Vi=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Hi=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ui=/^https?$/,Wi=/^\+[1-9]\d{6,14}$/,Gi=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Ki=RegExp(`^${Gi}$`),qi=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ji=/^-?\d+n?$/,Yi=/^-?\d+$/,Xi=/^-?\d+(?:\.\d+)?$/,Zi=/^(?:true|false)$/i,Qi=/^null$/i,$i=/^undefined$/i,ea=/^[^A-Z]*$/,ta=/^[^a-z]*$/,na=/^[0-9a-fA-F]*$/,ra=/^[0-9a-fA-F]{32}$/,ia=fi(22,`==`),aa=pi(22),oa=/^[0-9a-fA-F]{40}$/,sa=fi(27,`=`),ca=pi(27),la=/^[0-9a-fA-F]{64}$/,ua=fi(43,`=`),da=pi(43),fa=/^[0-9a-fA-F]{96}$/,pa=fi(64,``),ma=pi(64),ha=/^[0-9a-fA-F]{128}$/,ga=fi(86,`==`),_a=pi(86)}));function ya(e,t,n){e.issues.length&&t.issues.push(...ar(n,e.issues))}var N,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha=e((()=>{bn(),va(),M(),N=E(`$ZodCheck`,(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ba={number:`number`,bigint:`bigint`,object:`date`},xa=E(`$ZodCheckLessThan`,(e,t)=>{N.init(e,t);let n=ba[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sa=E(`$ZodCheckGreaterThan`,(e,t)=>{N.init(e,t);let n=ba[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ca=E(`$ZodCheckMultipleOf`,(e,t)=>{N.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Mn(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),wa=E(`$ZodCheckNumberFormat`,(e,t)=>{N.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=wr[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yi)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ta=E(`$ZodCheckBigIntFormat`,(e,t)=>{N.init(e,t);let[n,r]=Tr[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Ea=E(`$ZodCheckMaxSize`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!An(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:cr(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Da=E(`$ZodCheckMinSize`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!An(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:cr(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Oa=E(`$ZodCheckSizeEquals`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!An(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:cr(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ka=E(`$ZodCheckMaxLength`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!An(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=lr(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Aa=E(`$ZodCheckMinLength`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!An(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=lr(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ja=E(`$ZodCheckLengthEquals`,(e,t)=>{var n;N.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!An(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=lr(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ma=E(`$ZodCheckStringFormat`,(e,t)=>{var n,r;N.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Na=E(`$ZodCheckRegex`,(e,t)=>{Ma.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pa=E(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??(t.pattern=ea),Ma.init(e,t)}),Fa=E(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??(t.pattern=ta),Ma.init(e,t)}),Ia=E(`$ZodCheckIncludes`,(e,t)=>{N.init(e,t);let n=Kn(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),La=E(`$ZodCheckStartsWith`,(e,t)=>{N.init(e,t);let n=RegExp(`^${Kn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ra=E(`$ZodCheckEndsWith`,(e,t)=>{N.init(e,t);let n=RegExp(`.*${Kn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),za=E(`$ZodCheckProperty`,(e,t)=>{N.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>ya(n,e,t.property));ya(n,e,t.property)}}),Ba=E(`$ZodCheckMimeType`,(e,t)=>{N.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Va=E(`$ZodCheckOverwrite`,(e,t)=>{N.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),Ua,Wa=e((()=>{Ua=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
3
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
4
|
`))}}})),Ga,Ka=e((()=>{Ga={major:4,minor:4,patch:3}}));function qa(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function Ja(e){if(!Bi.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return qa(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function Ya(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function Xa(e,t,n){e.issues.length&&t.issues.push(...ar(n,e.issues)),t.value[n]=e.value}function Za(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...ar(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Qa(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Yn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $a(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Za(e,n,i,t,u,d))):Za(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function eo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!rr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>sr(e,r,pn())))}),t)}function to(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>sr(e,r,pn())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}function no(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Un(e)&&Un(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=no(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=no(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ro(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??(i=n);for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),rr(e))return e;let o=no(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function io(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function ao(e,t,n){e.issues.length&&t.issues.push(...ar(n,e.issues)),t.value[n]=e.value}function oo(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...ar(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}function so(e,t,n,r,i,a,o){e.issues.length&&(Sr.has(typeof r)?n.issues.push(...ar(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>sr(e,o,pn()))})),t.issues.length&&(Sr.has(typeof r)?n.issues.push(...ar(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>sr(e,o,pn()))})),n.value.set(e.value,t.value)}function co(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function lo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function uo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function fo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function po(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}function mo(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>ho(e,r,t.out,n)):ho(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>ho(e,r,t.in,n)):ho(e,r,t.in,n)}}function ho(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function go(e){return e.value=Object.freeze(e.value),e}function _o(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ur(e))}}var P,vo,F,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is=e((()=>{Ha(),bn(),Wa(),oi(),va(),M(),Ka(),P=E(`$ZodType`,(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ga;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=rr(e),i;for(let a of t){if(a._zod.def.when){if(ir(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new _n;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||(r=rr(e,t)))});else{if(e.issues.length===t)continue;r||(r=rr(e,t))}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(rr(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new _n;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new _n;return o.then(e=>t(e,r,a))}return t(o,r,a)}}O(e,`~standard`,()=>({validate:t=>{try{let n=Vr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ur(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),vo=E(`$ZodString`,(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??qi(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),F=E(`$ZodStringFormat`,(e,t)=>{Ma.init(e,t),vo.init(e,t)}),yo=E(`$ZodGUID`,(e,t)=>{t.pattern??(t.pattern=Si),F.init(e,t)}),bo=E(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ci(e))}else t.pattern??(t.pattern=Ci());F.init(e,t)}),xo=E(`$ZodEmail`,(e,t)=>{t.pattern??(t.pattern=Di),F.init(e,t)}),So=E(`$ZodURL`,(e,t)=>{F.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Ui.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Co=E(`$ZodEmoji`,(e,t)=>{t.pattern??(t.pattern=ci()),F.init(e,t)}),wo=E(`$ZodNanoID`,(e,t)=>{t.pattern??(t.pattern=yi),F.init(e,t)}),To=E(`$ZodCUID`,(e,t)=>{t.pattern??(t.pattern=mi),F.init(e,t)}),Eo=E(`$ZodCUID2`,(e,t)=>{t.pattern??(t.pattern=hi),F.init(e,t)}),Do=E(`$ZodULID`,(e,t)=>{t.pattern??(t.pattern=gi),F.init(e,t)}),Oo=E(`$ZodXID`,(e,t)=>{t.pattern??(t.pattern=_i),F.init(e,t)}),ko=E(`$ZodKSUID`,(e,t)=>{t.pattern??(t.pattern=vi),F.init(e,t)}),Ao=E(`$ZodISODateTime`,(e,t)=>{t.pattern??(t.pattern=di(t)),F.init(e,t)}),jo=E(`$ZodISODate`,(e,t)=>{t.pattern??(t.pattern=Ki),F.init(e,t)}),Mo=E(`$ZodISOTime`,(e,t)=>{t.pattern??(t.pattern=ui(t)),F.init(e,t)}),No=E(`$ZodISODuration`,(e,t)=>{t.pattern??(t.pattern=bi),F.init(e,t)}),Po=E(`$ZodIPv4`,(e,t)=>{t.pattern??(t.pattern=Pi),F.init(e,t),e._zod.bag.format=`ipv4`}),Fo=E(`$ZodIPv6`,(e,t)=>{t.pattern??(t.pattern=Fi),F.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Io=E(`$ZodMAC`,(e,t)=>{t.pattern??(t.pattern=Ii(t.delimiter)),F.init(e,t),e._zod.bag.format=`mac`}),Lo=E(`$ZodCIDRv4`,(e,t)=>{t.pattern??(t.pattern=Li),F.init(e,t)}),Ro=E(`$ZodCIDRv6`,(e,t)=>{t.pattern??(t.pattern=Ri),F.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),zo=E(`$ZodBase64`,(e,t)=>{t.pattern??(t.pattern=zi),F.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{qa(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Bo=E(`$ZodBase64URL`,(e,t)=>{t.pattern??(t.pattern=Bi),F.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Ja(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Vo=E(`$ZodE164`,(e,t)=>{t.pattern??(t.pattern=Wi),F.init(e,t)}),Ho=E(`$ZodJWT`,(e,t)=>{F.init(e,t),e._zod.check=n=>{Ya(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Uo=E(`$ZodCustomStringFormat`,(e,t)=>{F.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Wo=E(`$ZodNumber`,(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Go=E(`$ZodNumberFormat`,(e,t)=>{wa.init(e,t),Wo.init(e,t)}),Ko=E(`$ZodBoolean`,(e,t)=>{P.init(e,t),e._zod.pattern=Zi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),qo=E(`$ZodBigInt`,(e,t)=>{P.init(e,t),e._zod.pattern=Ji,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Jo=E(`$ZodBigIntFormat`,(e,t)=>{Ta.init(e,t),qo.init(e,t)}),Yo=E(`$ZodSymbol`,(e,t)=>{P.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Xo=E(`$ZodUndefined`,(e,t)=>{P.init(e,t),e._zod.pattern=$i,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Zo=E(`$ZodNull`,(e,t)=>{P.init(e,t),e._zod.pattern=Qi,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Qo=E(`$ZodAny`,(e,t)=>{P.init(e,t),e._zod.parse=e=>e}),$o=E(`$ZodUnknown`,(e,t)=>{P.init(e,t),e._zod.parse=e=>e}),es=E(`$ZodNever`,(e,t)=>{P.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),ts=E(`$ZodVoid`,(e,t)=>{P.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),ns=E(`$ZodDate`,(e,t)=>{P.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),rs=E(`$ZodArray`,(e,t)=>{P.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Xa(t,n,e))):Xa(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),is=E(`$ZodObject`,(e,t)=>{if(P.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=kn(()=>Qa(t));O(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Hn,i=t.catchall,a;e._zod.parse=(t,o)=>{a??(a=n.value);let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Za(n,t,e,s,r,i))):Za(a,t,e,s,r,i)}return i?$a(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),as=E(`$ZodObjectJIT`,(e,t)=>{is.init(e,t);let n=e._zod.parse,r=kn(()=>Qa(t)),i=e=>{let t=new Ua([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Bn(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Bn(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
@@ -101,4 +101,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
101
101
|
- Use this tool when you need to terminate a long-running task
|
|
102
102
|
`}));function DD(e){return FD[e]??e}function OD(e){let t=[];for(let[n,r]of Object.entries(FD))r===e&&t.push(n);return t}function kD(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)}function AD(e){return e.replace(/\\\(/g,`(`).replace(/\\\)/g,`)`).replace(/\\\\/g,`\\`)}function jD(e){let t=ND(e,`(`);if(t===-1)return{toolName:DD(e)};let n=PD(e,`)`);if(n===-1||n<=t||n!==e.length-1)return{toolName:DD(e)};let r=e.substring(0,t),i=e.substring(t+1,n);if(!r)return{toolName:DD(e)};if(i===``||i===`*`)return{toolName:DD(r)};let a=AD(i);return{toolName:DD(r),ruleContent:a}}function MD(e){if(!e.ruleContent)return e.toolName;let t=kD(e.ruleContent);return`${e.toolName}(${t})`}function ND(e,t){for(let n=0;n<e.length;n++)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}function PD(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t){let t=0,r=n-1;for(;r>=0&&e[r]===`\\`;)t++,r--;if(t%2==0)return n}return-1}var FD,ID=e((()=>{xD(),CD(),ED(),FD={Task:_D,KillShell:wD,AgentOutputTool:SD,BashOutputTool:SD}}));function LD(e){return BD.filePatternTools.includes(e)}function RD(e){return BD.bashPrefixTools.includes(e)}function zD(e){return BD.customValidation[e]}var BD,VD=e((()=>{BD={filePatternTools:[`Read`,`Write`,`Edit`,`Glob`,`NotebookRead`,`NotebookEdit`],bashPrefixTools:[`Bash`],customValidation:{WebSearch:e=>e.includes(`*`)||e.includes(`?`)?{valid:!1,error:`WebSearch does not support wildcards`,suggestion:`Use exact search terms without * or ?`,examples:[`WebSearch(claude ai)`,`WebSearch(typescript tutorial)`]}:{valid:!0},WebFetch:e=>e.includes(`://`)||e.startsWith(`http`)?{valid:!1,error:`WebFetch permissions use domain format, not URLs`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:github.com)`]}:e.startsWith(`domain:`)?{valid:!0}:{valid:!1,error:`WebFetch permissions must use "domain:" prefix`,suggestion:`Use "domain:hostname" format`,examples:[`WebFetch(domain:example.com)`,`WebFetch(domain:*.google.com)`]}}}}));function HD(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n++,r--;return n%2!=0}function UD(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&!HD(e,r)&&n++;return n}function WD(e){for(let t=0;t<e.length-1;t++)if(e[t]===`(`&&e[t+1]===`)`&&!HD(e,t))return!0;return!1}function GD(e,t){if(!e||e.trim()===``)return{valid:!1,error:`Permission rule cannot be empty`};if(UD(e,`(`)!==UD(e,`)`))return{valid:!1,error:`Mismatched parentheses`,suggestion:`Ensure all opening parentheses have matching closing parentheses`};if(WD(e)){let t=e.substring(0,e.indexOf(`(`));return t?{valid:!1,error:`Empty parentheses`,suggestion:`Either specify a pattern or use just "${t}" without parentheses`,examples:[`${t}`,`${t}(some-pattern)`]}:{valid:!1,error:`Empty parentheses with no tool name`,suggestion:`Specify a tool name before the parentheses`}}let n=jD(e),r=uD(n.toolName);if(r)return n.ruleContent!==void 0||UD(e,`(`)>0?{valid:!1,error:`MCP rules do not support patterns in parentheses`,suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${r.serverName}__*" for all tools`,examples:[`mcp__${r.serverName}`,`mcp__${r.serverName}__*`,r.toolName&&r.toolName!==`*`?`mcp__${r.serverName}__${r.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:`Tool name cannot be empty`};if(n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:`Tool names must start with uppercase`,suggestion:`Use "${jt(String(n.toolName))}"`};let i=zD(n.toolName);if(i&&n.ruleContent!==void 0){let e=i(n.ruleContent);if(!e.valid)return e}if(RD(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`)&&!e.endsWith(`:*`))return{valid:!1,error:`The :* pattern must be at the end`,suggestion:`Move :* to the end for prefix matching, or use * for wildcard matching`,examples:[`Bash(npm run:*) - prefix matching (legacy)`,`Bash(npm run *) - wildcard matching`]};if(e===`:*`)return{valid:!1,error:`Prefix cannot be empty before :*`,suggestion:`Specify a command prefix before :*`,examples:[`Bash(npm:*)`,`Bash(git:*)`]}}if(LD(n.toolName)&&n.ruleContent!==void 0){let e=n.ruleContent;if(e.includes(`:*`))return{valid:!1,error:`The ":*" syntax is only for Bash prefix rules`,suggestion:`Use glob patterns like "*" or "**" for file matching`,examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(e.includes(`*`)&&!e.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!e.includes(`**`))return{valid:!1,error:`Wildcard placement might be incorrect`,suggestion:`Wildcards are typically used at path boundaries`,examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var KD,qD=e((()=>{X_(),gD(),qw(),ID(),Mt(),VD(),KD=$(()=>L().superRefine((e,t)=>{let n=GD(e);if(!n.valid){let r=n.error;n.suggestion&&(r+=`. ${n.suggestion}`),n.examples&&n.examples.length>0&&(r+=`. Examples: ${n.examples.join(`, `)}`),t.addIssue({code:O_.custom,message:r,params:{received:e}})}}))}));function JD(e){return $(()=>V({serverName:L().regex(/^[a-zA-Z0-9_-]+$/,`Server name can only contain letters, numbers, hyphens, and underscores`).optional().describe(e.serverName),serverCommand:B(L()).min(1,`Server command must have at least one element (the command)`).optional().describe(e.serverCommand),serverUrl:L().optional().describe(e.serverUrl)}).refine(e=>GS([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:`Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"`}))}function YD(e){return`serverName`in e&&e.serverName!==void 0}function XD(e){return`serverCommand`in e&&e.serverCommand!==void 0}function ZD(e){return`serverUrl`in e&&e.serverUrl!==void 0}var QD,$D,eO,tO,nO,rO,iO,aO=e((()=>{X_(),Zw(),qw(),PT(),oD(),qD(),YT(),qS(),QD=$(()=>U(L(),z_())),$D=$(()=>V({allow:B(KD()).optional().describe(`List of permission rules for allowed operations`),deny:B(KD()).optional().describe(`List of permission rules for denied operations`),ask:B(KD()).optional().describe(`List of permission rules that should always prompt for confirmation`),defaultMode:W(xT).optional().describe(`Default permission mode when Work Mate needs access`),disableBypassPermissionsMode:W([`disable`]).optional().describe(`Disable the ability to bypass permission prompts`),disableAutoMode:W([`disable`]).optional().describe(`Disable auto mode`),additionalDirectories:B(L()).optional().describe(`Additional directories to include in the permission scope`)}).passthrough()),eO=$(()=>V({source:WE().describe(`Where to fetch the marketplace from`),installLocation:L().optional().describe(`Local cache path where marketplace manifest is stored (auto-generated if not provided)`),autoUpdate:z().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),tO=JD({serverName:`Name of the MCP server that users are allowed to configure`,serverCommand:`Command array [command, ...args] to match exactly for allowed stdio servers`,serverUrl:`URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers`}),nO=JD({serverName:`Name of the MCP server that is explicitly blocked`,serverCommand:`Command array [command, ...args] to match exactly for blocked stdio servers`,serverUrl:`URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers`}),rO=[`skills`,`agents`,`hooks`,`mcp`],iO=$(()=>V({$schema:L().optional().describe(`JSON Schema URL for editor validation`),fileSuggestion:V({type:G(`command`),command:L()}).optional().describe(`Custom file suggestion configuration for @ mentions`),respectGitignore:z().optional().describe(`Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected.`),cleanupPeriodDays:R().nonnegative().int().optional().describe(`Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`),env:QD().optional().describe(`Environment variables to set for Work Mate sessions`),attribution:V({commit:L().optional().describe(`Attribution text for git commits, including any trailers. Empty string hides attribution.`),pr:L().optional().describe(`Attribution text for pull request descriptions. Empty string hides attribution.`)}).optional().describe(`Customize attribution text for commits and PRs. Each field defaults to the standard Work Mate attribution if not set.`),includeCoAuthoredBy:z().optional().describe(`Deprecated: Use attribution instead. Whether to include Work Mate's co-authored by attribution in commits and PRs (defaults to true)`),includeGitInstructions:z().optional().describe(`Include built-in commit and PR workflow instructions in Work Mate's system prompt (default: true)`),permissions:$D().optional().describe(`Tool usage permissions configuration`),modelType:W([`anthropic`,`openai`,`gemini`,`grok`]).optional().describe(`API provider type. "anthropic" uses the first-party API (default), "openai" uses the OpenAI Chat Completions API, "gemini" uses the Gemini API, and "grok" uses the xAI Grok API (OpenAI-compatible). When set to "openai", configure OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL. When set to "gemini", configure GEMINI_API_KEY and optional GEMINI_BASE_URL. When set to "grok", configure GROK_API_KEY (or XAI_API_KEY), optional GROK_BASE_URL, GROK_MODEL, and GROK_MODEL_MAP.`),activeProviderId:L().optional().describe(`Currently active API provider id (set by /provider use <id>). Authoritative source for the active-provider marker in /provider list.`),model:L().optional().describe(`Override the default model used by Work Mate`),availableModels:B(L()).optional().describe(`Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.`),modelOverrides:U(L(),L()).optional().describe(`Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.`),enableAllProjectMcpServers:z().optional().describe(`Whether to automatically approve all MCP servers in the project`),enabledMcpjsonServers:B(L()).optional().describe(`List of approved MCP servers from .mcp.json`),disabledMcpjsonServers:B(L()).optional().describe(`List of rejected MCP servers from .mcp.json`),allowedMcpServers:B(tO()).optional().describe(`Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied.`),deniedMcpServers:B(nO()).optional().describe(`Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied.`),hooks:JT().optional().describe(`Custom commands to run before/after tool executions`),worktree:V({symlinkDirectories:B(L()).optional().describe(`Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"`),sparsePaths:B(L()).optional().describe(`Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos — only the listed paths are written to disk.`)}).optional().describe(`Git worktree configuration for --worktree flag.`),disableAllHooks:z().optional().describe(`Disable all hooks and statusLine execution`),defaultShell:W([`bash`,`powershell`]).optional().describe(`Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip).`),allowManagedHooksOnly:z().optional().describe(`When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored.`),allowedHttpHookUrls:B(L()).optional().describe(`Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).`),httpHookAllowedEnvVars:B(L()).optional().describe(`Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers).`),allowManagedPermissionRulesOnly:z().optional().describe(`When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored.`),allowManagedMcpServersOnly:z().optional().describe(`When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies.`),strictPluginOnlyCustomization:og(e=>Array.isArray(e)?e.filter(e=>rO.includes(e)):e,H([z(),B(W(rO))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.workmate/{surface}/, .workmate/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:V({type:G(`command`),command:L(),padding:R().optional(),refreshInterval:R().optional()}).optional().describe(`Custom status line display configuration`),statusLineEnabled:z().optional().describe(`Whether to render the fork built-in status line (model + ctx + 5h/7d limits + cost + cache pill). Toggled with /statusline.`),enabledPlugins:U(L(),H([B(L()),z(),hh()])).optional().describe(`Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.`),extraKnownMarketplaces:U(L(),eO()).check(e=>{for(let[t,n]of Object.entries(e.value))n.source.source===`settings`&&n.source.name!==t&&e.issues.push({code:`custom`,input:n.source.name,path:[t,`source`,`name`],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${t}" but source.name "${n.source.name}")`})}).optional().describe(`Additional marketplaces to make available for this repository. Typically used in repository .workmate/settings.json to ensure team members have required plugin sources.`),strictKnownMarketplaces:B(WE()).optional().describe(`Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only — it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.`),blockedMarketplaces:B(WE()).optional().describe(`Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem.`),outputStyle:L().optional().describe(`Controls the output style for assistant responses`),language:L().optional().describe(`Preferred language for Work Mate responses (e.g., "japanese", "spanish")`),skipWebFetchPreflight:z().optional().describe(`Skip the WebFetch blocklist check for enterprise environments with restrictive security policies`),webSearchAdapter:W([`api`,`bing`,`brave`,`exa`,`tavily`]).optional().describe(`Web search backend adapter. "tavily" uses Tavily Search API (default), "api" uses Anthropic server-side search, "bing" scrapes Bing HTML, "brave" uses Brave Search API, "exa" uses Exa AI.`),webFetchAdapter:W([`tavily`,`http`]).optional().describe(`Web fetch backend. "tavily" uses Tavily Extract API which returns Markdown directly (default), "http" fetches the URL directly via HTTP.`),tavilyEndpointUrl:L().optional().describe(`Custom Tavily API endpoint URL. Defaults to https://tavily.readmagic.workmate.win. Used by both WebSearch and WebFetch when tavily adapter is selected.`),braveApiKey:L().optional().describe(`Brave Search API key. Required when using the brave web search adapter.`),webFetchHttpTimeoutMs:R().int().positive().optional().describe(`HTTP timeout in milliseconds for the HTTP direct web fetch backend. Defaults to 60000 (60s).`),exaApiKey:L().optional().describe(`Exa AI API key. Required when using the exa web search adapter.`),exaEndpointUrl:L().optional().describe(`Custom Exa AI MCP endpoint URL. Defaults to https://mcp.exa.ai/mcp.`),sandbox:Xw().optional(),feedbackSurveyRate:R().min(0).max(1).optional().describe(`Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point.`),spinnerTipsEnabled:z().optional().describe(`Whether to show tips in the spinner`),spinnerVerbs:V({mode:W([`append`,`replace`]),verbs:B(L())}).optional().describe(`Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.`),spinnerTipsOverride:V({excludeDefault:z().optional(),tips:B(L())}).optional().describe(`Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false).`),syntaxHighlightingDisabled:z().optional().describe(`Whether to disable syntax highlighting in diffs`),terminalTitleFromRename:z().optional().describe(`Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles.`),alwaysThinkingEnabled:z().optional().describe(`When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models.`),advisorModel:L().optional().describe(`Advisor model for the server-side advisor tool.`),fastMode:z().optional().describe(`When true, fast mode is enabled. When absent or false, fast mode is off.`),fastModePerSessionOptIn:z().optional().describe(`When true, fast mode does not persist across sessions. Each session starts with fast mode off.`),promptSuggestionEnabled:z().optional().describe(`When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled.`),poorMode:z().optional().describe(`When true, poor mode is active — extract_memories and prompt_suggestion are disabled to save tokens.`),showClearContextOnPlanAccept:z().optional().describe(`When true, the plan-approval dialog offers a "clear context" option. Defaults to false.`),agent:L().optional().describe(`Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model.`),companyAnnouncements:B(L()).optional().describe(`Company announcements to display at startup (one will be randomly selected if multiple are provided)`),pluginConfigs:U(L(),V({mcpServers:U(L(),U(L(),H([L(),R(),z(),B(L())]))).optional().describe(`User configuration values for MCP servers keyed by server name`),options:U(L(),H([L(),R(),z(),B(L())])).optional().describe(`Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.`)})).optional().describe(`Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)`),autoUpdatesChannel:W([`latest`,`stable`]).optional().describe(`Release channel for auto-updates (latest or stable)`),disableDeepLinkRegistration:W([`disable`]).optional().describe(`Prevent claude-cli:// protocol handler registration with the OS`),minimumVersion:L().optional().describe(`Minimum version to stay on - prevents downgrades when switching to stable channel`),plansDirectory:L().optional().describe(`Custom directory for plan files, relative to project root. If not set, defaults to ~/.workmate/plans/`),minSleepDurationMs:R().nonnegative().int().optional().describe(`Minimum duration in milliseconds that the Sleep tool must sleep for. Useful for throttling proactive tick frequency.`),maxSleepDurationMs:R().int().min(-1).optional().describe(`Maximum duration in milliseconds that the Sleep tool can sleep for. Set to -1 for indefinite sleep (waits for user input). Useful for limiting idle time in remote/managed environments.`),channelsEnabled:z().optional().describe(`Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels.`),allowedChannelPlugins:B(V({marketplace:L(),plugin:L()})).optional().describe(`Teams/Enterprise allowlist of channel plugins. When set, replaces the default allowlist — admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true.`),prefersReducedMotion:z().optional().describe(`Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)`),autoMemoryEnabled:z().optional().describe(`Enable auto-memory for this project. When false, Work Mate will not read from or write to the auto-memory directory.`),autoMemoryDirectory:L().optional().describe(`Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .workmate/settings.json) for security. When unset, defaults to ~/.workmate/projects/<sanitized-cwd>/memory/.`),autoDreamEnabled:z().optional().describe(`Enable background memory consolidation (auto-dream). When set, overrides the server-side default.`),showThinkingSummaries:z().optional().describe(`Show thinking summaries in the transcript view (ctrl+o). Default: false.`),skipDangerousModePermissionPrompt:z().optional().describe(`Whether the user has accepted the bypass permissions mode dialog`),skipAutoPermissionPrompt:z().optional().describe(`Whether the user has accepted the auto mode opt-in dialog`),useAutoModeDuringPlan:z().optional().describe(`Whether plan mode uses auto mode semantics when auto mode is available (default: true)`),autoMode:V({allow:B(L()).optional().describe(`Rules for the auto mode classifier allow section`),soft_deny:B(L()).optional().describe(`Rules for the auto mode classifier deny section`),environment:B(L()).optional().describe(`Entries for the auto mode classifier environment section`)}).optional().describe(`Auto mode classifier prompt customization`),disableAutoMode:W([`disable`]).optional().describe(`Disable auto mode`),agentsMdExcludes:B(L()).optional().describe(`Glob patterns or absolute paths of AGENTS.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/AGENTS.md", "**/code/AGENTS.md", "**/some-dir/.workmate/rules/**"`),cacheThreshold:R().int().min(0).max(100).optional().describe(`Prompt cache hit rate threshold (0-100). Warnings shown when cache hit rate falls below this percentage. Default: 80.`),cacheWarningEnabled:z().optional().describe(`Whether to show cache hit rate warnings in the message flow when the rate falls below cacheThreshold. Default: true.`),pluginTrustMessage:L().optional().describe(`Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").`)}).passthrough())}));function oO(){return $e(op(iO(),{unrepresentable:`any`}),null,2)}var sO=e((()=>{X_(),lt(),aO()}));function cO(e){let t=uO.find(t=>t.matches(e));if(!t)return null;let n={...t.tip};if(e.code===`invalid_value`&&e.enumValues&&!n.suggestion&&(n.suggestion=`Valid values: ${e.enumValues.map(e=>`"${e}"`).join(`, `)}`),!n.docLink&&e.path){let t=e.path.split(`.`)[0];t&&(n.docLink=dO[t])}return n}var lO,uO,dO,fO=e((()=>{lO=`https://code.workmate.com/docs/en`,uO=[{matches:e=>e.path===`permissions.defaultMode`&&e.code===`invalid_value`,tip:{suggestion:`Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)`,docLink:`${lO}/iam#permission-modes`}},{matches:e=>e.path===`cleanupPeriodDays`&&e.code===`too_small`&&e.expected===`0`,tip:{suggestion:`Must be 0 or greater. Set a positive number for days to retain transcripts (default is 30). Setting 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup.`}},{matches:e=>e.path.startsWith(`env.`)&&e.code===`invalid_type`,tip:{suggestion:`Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"`,docLink:`${lO}/settings#environment-variables`}},{matches:e=>(e.path===`permissions.allow`||e.path===`permissions.deny`)&&e.code===`invalid_type`&&e.expected===`array`,tip:{suggestion:`Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.`}},{matches:e=>e.path.includes(`hooks`)&&e.code===`invalid_type`,tip:{suggestion:`Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}`}},{matches:e=>e.code===`invalid_type`&&e.expected===`boolean`,tip:{suggestion:`Use true or false without quotes. Example: "includeCoAuthoredBy": true`}},{matches:e=>e.code===`unrecognized_keys`,tip:{suggestion:`Check for typos or refer to the documentation for valid fields`,docLink:`${lO}/settings`}},{matches:e=>e.code===`invalid_value`&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:e=>e.code===`invalid_type`&&e.expected===`object`&&e.received===null&&e.path===``,tip:{suggestion:`Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error.`}},{matches:e=>e.path===`permissions.additionalDirectories`&&e.code===`invalid_type`,tip:{suggestion:`Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command`,docLink:`${lO}/iam#working-directories`}}],dO={permissions:`${lO}/iam#configuring-permissions`,env:`${lO}/settings#environment-variables`,hooks:`${lO}/hooks`}}));function pO(e){return e.code===`invalid_type`}function mO(e){return e.code===`invalid_value`}function hO(e){return e.code===`unrecognized_keys`}function gO(e){return e.code===`too_small`}function _O(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:typeof e}function vO(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function yO(e,t){return e.issues.map(e=>{let n=e.path.map(String).join(`.`),r=e.message,i,a,o,s,c;if(mO(e))a=e.values.map(e=>String(e)),o=a.join(` | `),s=void 0,c=void 0;else if(pO(e)){o=e.expected;let t=vO(e.message);s=t??_O(e.input),c=t??_O(e.input)}else gO(e)?o=String(e.minimum):e.code===`custom`&&`params`in e&&(s=e.params.received,c=s);let l=cO({path:n,code:e.code,expected:o,received:s,enumValues:a,message:e.message,value:s});if(mO(e))i=a?.map(e=>`"${e}"`).join(`, `),r=`Invalid value. Expected one of: ${i}`;else if(pO(e)){let t=vO(e.message)??_O(e.input);r=e.expected===`object`&&t===`null`&&n===``?`Invalid or malformed JSON`:`Expected ${e.expected}, but received ${t}`}else if(hO(e)){let t=e.keys.join(`, `);r=`Unrecognized ${At(e.keys.length,`field`)}: ${t}`}else gO(e)&&(r=`Number must be greater than or equal to ${e.minimum}`,i=String(e.minimum));return{file:t,path:n,message:r,expected:i,invalidValue:c,suggestion:l?.suggestion,docLink:l?.docLink}})}function bO(e){try{let t=rt(e),n=iO().strict().safeParse(t);return n.success?{isValid:!0}:{isValid:!1,error:`Settings validation failed:
|
|
103
103
|
`+yO(n.error,`settings`).map(e=>`- ${e.path}: ${e.message}`).join(`
|
|
104
|
-
`),fullSchema:oO()}}catch(e){return{isValid:!1,error:`Invalid JSON: ${e instanceof Error?e.message:`Unknown parsing error`}`,fullSchema:oO()}}}function xO(e,t){if(!e||typeof e!=`object`)return[];let n=e;if(!n.permissions||typeof n.permissions!=`object`)return[];let r=n.permissions,i=[];for(let e of[`allow`,`deny`,`ask`]){let n=r[e];Array.isArray(n)&&(r[e]=n.filter(n=>{if(typeof n!=`string`)return i.push({file:t,path:`permissions.${e}`,message:`Non-string value in ${e} array was removed`,invalidValue:n}),!1;let r=GD(n,e);if(!r.valid){let a=`Invalid permission rule "${n}" was skipped`;return r.error&&(a+=`: ${r.error}`),r.suggestion&&(a+=`. ${r.suggestion}`),i.push({file:t,path:`permissions.${e}`,message:a,invalidValue:n}),!1}return!0}))}return i}var SO=e((()=>{lt(),Mt(),qD(),sO(),aO(),fO()}));function CO(){let e=``;try{e=Ft().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${wO}.plist`,label:`per-user managed preferences`}),t.push({path:`/Library/Managed Preferences/${wO}.plist`,label:`device-level managed preferences`}),t}var wO,TO,EO,DO,OO,kO,AO,jO=e((()=>{wO=`com.workmate`,TO=`HKLM\\SOFTWARE\\Policies\\WorkMate`,EO=`HKCU\\SOFTWARE\\Policies\\WorkMate`,DO=`Settings`,OO=`/usr/bin/plutil`,kO=[`-convert`,`json`,`-o`,`-`,`--`],AO=5e3}));function MO(e,t){return new Promise(n=>{ln(e,t,{encoding:`utf-8`,timeout:AO},(e,t)=>{n({stdout:t??``,code:+!!e})})})}function NO(){return(async()=>{if(process.platform===`darwin`){let e=CO(),t=(await Promise.all(e.map(async({path:e,label:t})=>{if(!Kt(e))return{stdout:``,label:t,ok:!1};let{stdout:n,code:r}=await MO(OO,[...kO,e]);return{stdout:n,label:t,ok:r===0&&!!n}}))).find(e=>e.ok);return{plistStdouts:t?[{stdout:t.stdout,label:t.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform===`win32`){let[e,t]=await Promise.all([MO(`reg`,[`query`,TO,`/v`,DO]),MO(`reg`,[`query`,EO,`/v`,DO])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function PO(){IO||(IO=NO())}function FO(){return IO}var IO,LO=e((()=>{jO(),IO=null}));function RO(){ZO||(ZO=(async()=>{Ot(`mdm_load_start`);let e=Date.now(),{mdm:t,hkcu:n}=KO(await(FO()??NO()));YO=t,XO=n,Ot(`mdm_load_end`);let r=Date.now()-e;if(C(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){C(`MDM settings found: ${Object.keys(t.settings).join(`, `)}`);try{Mv(`info`,`mdm_settings_loaded`,{duration_ms:r,key_count:Object.keys(t.settings).length,error_count:t.errors.length})}catch{}}})())}async function zO(){ZO||RO(),await ZO}function BO(){return YO??JO}function VO(){return XO??JO}function HO(e,t){YO=e,XO=t}async function UO(){return KO(await NO())}function WO(e,t){let n=Sw(e,!1);if(!n||typeof n!=`object`)return{settings:{},errors:[]};let r=xO(n,t),i=iO().safeParse(n);if(!i.success){let e=yO(i.error,t);return{settings:{},errors:[...r,...e]}}return{settings:i.data,errors:r}}function GO(e,t=`Settings`){let n=e.split(/\r?\n/),r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`^\\s+${r}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,`i`);for(let e of n){let t=e.match(i);if(t?.[1])return t[1].trimEnd()}return null}function KO(e){if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:t,label:n}=e.plistStdouts[0],r=WO(t,n);if(Object.keys(r.settings).length>0)return{mdm:r,hkcu:JO}}if(e.hklmStdout){let t=GO(e.hklmStdout);if(t){let e=WO(t,`Registry: ${TO}\\${DO}`);if(Object.keys(e.settings).length>0)return{mdm:e,hkcu:JO}}}if(qO())return{mdm:JO,hkcu:JO};if(e.hkcuStdout){let t=GO(e.hkcuStdout);if(t){let e=WO(t,`Registry: ${EO}\\${DO}`);return{mdm:JO,hkcu:e}}}return{mdm:JO,hkcu:JO}}function qO(){try{let e=Sw(ZS(T(Ww(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=Gw(),t=w().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=Sw(ZS(T(e,n.name)),!1);if(t&&typeof t==`object`&&Object.keys(t).length>0)return!0}catch{}}catch{}return!1}var JO,YO,XO,ZO,QO=e((()=>{ct(),Fv(),QS(),ot(),ww(),Dt(),Kw(),aO(),SO(),jO(),LO(),JO=Object.freeze({settings:{},errors:[]}),YO=null,XO=null,ZO=null}));function $O(){return T(Ww(),`managed-settings.json`)}function ek(){let e=[],t={},n=!1,{settings:r,errors:i}=rk($O());e.push(...i),r&&Object.keys(r).length>0&&(t=HS(t,r,mk),n=!0);let a=Gw();try{let r=w().readdirSync(a).filter(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`)).map(e=>e.name).sort();for(let i of r){let{settings:r,errors:o}=rk(T(a,i));e.push(...o),r&&Object.keys(r).length>0&&(t=HS(t,r,mk),n=!0)}}catch(e){let t=tt(e);t!==`ENOENT`&&t!==`ENOTDIR`&&pt(e)}return{settings:n?t:null,errors:e}}function tk(){let{settings:e}=rk($O()),t=!!e&&Object.keys(e).length>0,n=!1,r=Gw();try{n=w().readdirSync(r).some(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`))}catch{}return{hasBase:t,hasDropIns:n}}function nk(e,t){typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`?C(`Broken symlink or missing file encountered for settings.json at path: ${t}`):pt(e)}function rk(e){let t=_e(e);if(t)return{settings:t.settings?it(t.settings):null,errors:t.errors};let n=ik(e);return Pe(e,n),{settings:n.settings?it(n.settings):null,errors:n.errors}}function ik(e){try{let{resolvedPath:t}=st(w(),e),n=ZS(t);if(n.trim()===``)return{settings:{},errors:[]};let r=Sw(n,!1),i=xO(r,e),a=iO().safeParse(r);if(!a.success){let t=yO(a.error,e);return{settings:null,errors:[...i,...t]}}return{settings:a.data,errors:i}}catch(t){return nk(t,e),{settings:null,errors:[]}}}function ak(e){switch(e){case`userSettings`:return Ut(h());case`policySettings`:case`projectSettings`:case`localSettings`:return Ut(Ue());case`flagSettings`:{let e=Le();return e?Lt(Ut(e)):Ut(Ue())}}}function ok(){return fe()||g(process.env.WORKMATE_USE_COWORK_PLUGINS)?`cowork_settings.json`:`settings.json`}function sk(e){switch(e){case`userSettings`:return T(ak(e),ok());case`projectSettings`:case`localSettings`:return T(ak(e),ck(e));case`policySettings`:return $O();case`flagSettings`:return Le()}}function ck(e){switch(e){case`projectSettings`:return T(`.workmate`,`settings.json`);case`localSettings`:return T(`.workmate`,`settings.local.json`)}}function lk(e){let t=je(e);if(t!==void 0)return t;let n=uk(e);return Je(e,n),n}function uk(e){if(e===`policySettings`){let e=BO();if(Object.keys(e.settings).length>0)return e.settings;let{settings:t}=ek();if(t)return t;let n=VO();return Object.keys(n.settings).length>0?n.settings:null}let t=sk(e),{settings:n}=t?rk(t):{settings:null};if(e===`flagSettings`){let e=Se();if(e){let t=iO().safeParse(e);if(t.success)return HS(n||{},t.data,mk)}}return n}function dk(){let e=BO();if(Object.keys(e.settings).length>0)return yt()===`macos`?`plist`:`hklm`;let{settings:t}=ek();if(t)return`file`;let n=VO();return Object.keys(n.settings).length>0?`hkcu`:null}function fk(e,t){if(e===`policySettings`||e===`flagSettings`)return{error:null};let n=sk(e);if(!n)return{error:null};try{w().mkdirSync(Lt(n));let r=uk(e);if(!r){let e=null;try{e=ZS(n)}catch(e){if(!nt(e))throw e}if(e!==null){let t=Sw(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,C(`Using raw settings from ${n} due to validation failure`))}}let i=HS(r||{},t,(e,t,n,r)=>{if(t===void 0&&r&&typeof n==`string`){delete r[n];return}if(Array.isArray(t))return t});zw(n),yC(n,`${$e(i,null,2)}\n`),ue(),e===`localSettings`&&DC(ck(`localSettings`),Ue())}catch(e){let t=Error(`Failed to read raw settings from ${n}: ${e}`);return pt(t),{error:t}}return{error:null}}function pk(e,t){return KS([...e,...t])}function mk(e,t){if(Array.isArray(e)&&Array.isArray(t))return pk(e,t)}function hk(e){let t=iO().strip().parse(e),n=[`permissions`,`sandbox`,`hooks`],r=[],i={permissions:new Set([`allow`,`deny`,`ask`,`defaultMode`,`disableBypassPermissionsMode`,`disableAutoMode`,`additionalDirectories`]),sandbox:new Set([`enabled`,`failIfUnavailable`,`allowUnsandboxedCommands`,`network`,`filesystem`,`ignoreViolations`,`excludedCommands`,`autoAllowBashIfSandboxed`,`enableWeakerNestedSandbox`,`enableWeakerNetworkIsolation`,`ripgrep`]),hooks:new Set([`PreToolUse`,`PostToolUse`,`Notification`,`UserPromptSubmit`,`SessionStart`,`SessionEnd`,`Stop`,`SubagentStop`,`PreCompact`,`PostCompact`,`TeammateIdle`,`TaskCreated`,`TaskCompleted`])};for(let e of Object.keys(t))if(n.includes(e)&&t[e]&&typeof t[e]==`object`){let n=t[e],a=i[e];if(a)for(let t of Object.keys(n))a.has(t)&&r.push(`${e}.${t}`)}else r.push(e);return r.sort()}function gk(){if(Ck)return{settings:{},errors:[]};let e=Date.now();Ot(`loadSettingsFromDisk_start`),Mv(`info`,`settings_load_started`),Ck=!0;try{let t=Ae(),n={};t&&(n=HS(n,t,mk));let r=[],i=new Set,a=new Set;for(let e of Aw()){if(e===`policySettings`){let e=null,t=[];{let n=BO();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}if(!e){let{settings:n,errors:r}=ek();n&&(e=n),t.push(...r)}if(!e){let n=VO();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}e&&(n=HS(n,e,mk));for(let e of t){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}continue}let t=sk(e);if(t){let e=Ut(t);if(!a.has(e)){a.add(e);let{settings:o,errors:s}=rk(t);for(let e of s){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}o&&(n=HS(n,o,mk))}}if(e===`flagSettings`){let e=Se();if(e){let t=iO().safeParse(e);t.success&&(n=HS(n,t.data,mk))}}}return Mv(`info`,`settings_load_completed`,{duration_ms:Date.now()-e,source_count:a.size,error_count:r.length}),{settings:n,errors:r}}finally{Ck=!1}}function _k(){let{settings:e}=yk();return e||{}}function vk(){ue();let e=[];for(let t of Aw()){let n=lk(t);n&&Object.keys(n).length>0&&e.push({source:t,settings:n})}return{effective:_k(),sources:e}}function yk(){let e=Me();if(e!==null)return e;let t=gk();return Ot(`loadSettingsFromDisk_end`),Ke(t),t}function bk(){return!!(lk(`userSettings`)?.skipDangerousModePermissionPrompt||lk(`localSettings`)?.skipDangerousModePermissionPrompt||lk(`flagSettings`)?.skipDangerousModePermissionPrompt||lk(`policySettings`)?.skipDangerousModePermissionPrompt)}function xk(){return lk(`policySettings`)?.useAutoModeDuringPlan!==!1&&lk(`flagSettings`)?.useAutoModeDuringPlan!==!1&&lk(`userSettings`)?.useAutoModeDuringPlan!==!1&&lk(`localSettings`)?.useAutoModeDuringPlan!==!1}function Sk(e){for(let t of Aw()){if(t===`policySettings`)continue;let n=sk(t);if(n)try{let{resolvedPath:t}=st(w(),n),r=ZS(t);if(!r.trim())continue;let i=Sw(r,!1);if(i&&typeof i==`object`&&e in i)return!0}catch(e){nk(e,n)}}return!1}var Ck,wk,Tk=e((()=>{US(),Te(),qS(),ct(),Fv(),te(),et(),wC(),QS(),ot(),OC(),ww(),ft(),xt(),lt(),Dt(),Rw(),Uw(),Kw(),QO(),Ee(),aO(),SO(),Ck=!1,wk=_k}));export{mD as $,yh as $i,qS as $n,Db as $r,qw as $t,rO as A,rv as Ai,sC as An,sx as Ar,IT as At,MD as B,A_ as Bi,xC as Bn,Ub as Br,DT as Bt,QO as C,pv as Ci,uw as Cn,gx as Cr,aE as Ct,PO as D,iv as Di,SC as Dn,Ax as Dr,HT as Dt,LO as E,dv as Ei,CC as En,px as Er,YT as Et,ZD as F,K_ as Fi,aC as Fn,nx as Fr,OT as Ft,CD as G,z as Gi,pC as Gn,Kb as Gr,vT as Gt,wD as H,gh as Hi,rC as Hn,Nb as Hr,xT as Ht,OD as I,V_ as Ii,wC as In,Jb as Ir,CT as It,bD as J,T_ as Ji,JS as Jn,Pb as Jr,oT as Jt,_D as K,tg as Ki,yC as Kn,Bb as Kr,pT as Kt,ID as L,W_ as Li,mC as Ln,tx as Lr,ET as Lt,aO as M,ev as Mi,fC as Mn,ox as Mr,MT as Mt,XD as N,X_ as Ni,dC as Nn,Qb as Nr,jT as Nt,SO as O,av as Oi,hC as On,bx as Or,UT as Ot,YD as P,Y_ as Pi,iC as Pn,rx as Pr,PT as Pt,hD as Q,wh as Qi,GS as Qn,Eb as Qr,tT as Qt,DD as R,B_ as Ri,_C as Rn,zb as Rr,kT as Rt,BO as S,bv as Si,fw as Sn,yx as Sr,oE as St,HO as T,fv as Ti,TC as Tn,fx as Tr,JT as Tt,ED as U,_h as Ui,vC as Un,Vb as Ur,ST as Ut,TD as V,W as Vi,nC as Vn,Wb as Vr,TT as Vt,SD as W,B as Wi,gC as Wn,Gb as Wr,_T as Wt,xD as X,Zh as Xi,ZS as Xn,kb as Xr,gT as Xt,yD as Y,Dh as Yi,QS as Yn,Ab as Yr,sT as Yt,fD as Z,G as Zi,XS as Zn,Ob as Zr,Qw as Zt,Sk as _,oi as _a,Cv as _i,yw as _n,Ix as _r,fE as _t,ck as a,Ch as aa,oy as ai,Bw as an,SS as ar,sD as at,zO as b,bn as ba,Sv as bi,Sw as bn,lx as br,uE as bt,ak as c,vh as ca,Uv as ci,Lw as cn,eS as cr,rD as ct,wk as d,gm as da,Mv as di,Dw as dn,Wx as dr,EE as dt,R as ea,Wv as ei,$ as en,WS as er,dD as et,xk as f,im as fa,Pv as fi,Tw as fn,Kx as fr,XE as ft,rk as g,op as ga,Ev as gi,kw as gn,jx as gr,oD as gt,ek as h,Jp as ha,Tv as hi,jw as hn,Gx as hr,YE as ht,dk as i,U as ia,py as ii,Vw as in,wS as ir,lD as it,iO as j,$_ as ji,cC as jn,ix as jr,LT as jt,bO as k,tv as ki,lC as kn,hx as kr,BT as kt,yk as l,Rm as la,Iv as li,Aw as ln,tS as lr,aD as lt,Tk as m,em as ma,jv as mi,Rw as mn,Jx as mr,JE as mt,tk as n,Ih as na,ay as ni,Gw as nn,FS as nr,gD as nt,sk as o,L as oa,Gv as oi,Uw as on,dS as or,pE as ot,bk as p,fm as pa,Av as pi,Ew as pn,Yx as pr,UE as pt,vD as q,Eh as qi,oC as qn,qb as qr,hT as qt,hk as r,og as ra,sy as ri,Kw as rn,PS as rr,uD as rt,lk as s,H as sa,Yv as si,Mw as sn,iS as sr,eD as st,_k as t,V as ta,Zv as ti,Ww as tn,KS as tr,pD as tt,vk as u,mm as ua,Fv as ui,Ow as un,qx as ur,zE as ut,mk as v,Vr as va,wv as vi,ww as vn,vx as vr,dE as vt,UO as w,vv as wi,OC as wn,Ux as wr,sE as wt,VO as x,yv as xi,mw as xn,ux as xr,XT as xt,fk as y,hn as ya,xv as yi,vw as yn,dx as yr,cE as yt,jD as z,O_ as zi,bC as zn,Lb as zr,AT as zt};
|
|
104
|
+
`),fullSchema:oO()}}catch(e){return{isValid:!1,error:`Invalid JSON: ${e instanceof Error?e.message:`Unknown parsing error`}`,fullSchema:oO()}}}function xO(e,t){if(!e||typeof e!=`object`)return[];let n=e;if(!n.permissions||typeof n.permissions!=`object`)return[];let r=n.permissions,i=[];for(let e of[`allow`,`deny`,`ask`]){let n=r[e];Array.isArray(n)&&(r[e]=n.filter(n=>{if(typeof n!=`string`)return i.push({file:t,path:`permissions.${e}`,message:`Non-string value in ${e} array was removed`,invalidValue:n}),!1;let r=GD(n,e);if(!r.valid){let a=`Invalid permission rule "${n}" was skipped`;return r.error&&(a+=`: ${r.error}`),r.suggestion&&(a+=`. ${r.suggestion}`),i.push({file:t,path:`permissions.${e}`,message:a,invalidValue:n}),!1}return!0}))}return i}var SO=e((()=>{lt(),Mt(),qD(),sO(),aO(),fO()}));function CO(){let e=``;try{e=Ft().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${wO}.plist`,label:`per-user managed preferences`}),t.push({path:`/Library/Managed Preferences/${wO}.plist`,label:`device-level managed preferences`}),t}var wO,TO,EO,DO,OO,kO,AO,jO=e((()=>{wO=`com.workmate`,TO=`HKLM\\SOFTWARE\\Policies\\WorkMate`,EO=`HKCU\\SOFTWARE\\Policies\\WorkMate`,DO=`Settings`,OO=`/usr/bin/plutil`,kO=[`-convert`,`json`,`-o`,`-`,`--`],AO=5e3}));function MO(e,t){return new Promise(n=>{ln(e,t,{encoding:`utf-8`,timeout:AO},(e,t)=>{n({stdout:t??``,code:+!!e})})})}function NO(){return(async()=>{if(process.platform===`darwin`){let e=CO(),t=(await Promise.all(e.map(async({path:e,label:t})=>{if(!Kt(e))return{stdout:``,label:t,ok:!1};let{stdout:n,code:r}=await MO(OO,[...kO,e]);return{stdout:n,label:t,ok:r===0&&!!n}}))).find(e=>e.ok);return{plistStdouts:t?[{stdout:t.stdout,label:t.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform===`win32`){let[e,t]=await Promise.all([MO(`reg`,[`query`,TO,`/v`,DO]),MO(`reg`,[`query`,EO,`/v`,DO])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function PO(){IO||(IO=NO())}function FO(){return IO}var IO,LO=e((()=>{jO(),IO=null}));function RO(){ZO||(ZO=(async()=>{Ot(`mdm_load_start`);let e=Date.now(),{mdm:t,hkcu:n}=KO(await(FO()??NO()));YO=t,XO=n,Ot(`mdm_load_end`);let r=Date.now()-e;if(C(`MDM settings load completed in ${r}ms`),Object.keys(t.settings).length>0){C(`MDM settings found: ${Object.keys(t.settings).join(`, `)}`);try{Mv(`info`,`mdm_settings_loaded`,{duration_ms:r,key_count:Object.keys(t.settings).length,error_count:t.errors.length})}catch{}}})())}async function zO(){ZO||RO(),await ZO}function BO(){return YO??JO}function VO(){return XO??JO}function HO(e,t){YO=e,XO=t}async function UO(){return KO(await NO())}function WO(e,t){let n=Sw(e,!1);if(!n||typeof n!=`object`)return{settings:{},errors:[]};let r=xO(n,t),i=iO().safeParse(n);if(!i.success){let e=yO(i.error,t);return{settings:{},errors:[...r,...e]}}return{settings:i.data,errors:r}}function GO(e,t=`Settings`){let n=e.split(/\r?\n/),r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`^\\s+${r}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,`i`);for(let e of n){let t=e.match(i);if(t?.[1])return t[1].trimEnd()}return null}function KO(e){if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:t,label:n}=e.plistStdouts[0],r=WO(t,n);if(Object.keys(r.settings).length>0)return{mdm:r,hkcu:JO}}if(e.hklmStdout){let t=GO(e.hklmStdout);if(t){let e=WO(t,`Registry: ${TO}\\${DO}`);if(Object.keys(e.settings).length>0)return{mdm:e,hkcu:JO}}}if(qO())return{mdm:JO,hkcu:JO};if(e.hkcuStdout){let t=GO(e.hkcuStdout);if(t){let e=WO(t,`Registry: ${EO}\\${DO}`);return{mdm:JO,hkcu:e}}}return{mdm:JO,hkcu:JO}}function qO(){try{let e=Sw(ZS(T(Ww(),`managed-settings.json`)),!1);if(e&&typeof e==`object`&&Object.keys(e).length>0)return!0}catch{}try{let e=Gw(),t=w().readdirSync(e);for(let n of t)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(`.json`)||n.name.startsWith(`.`)))try{let t=Sw(ZS(T(e,n.name)),!1);if(t&&typeof t==`object`&&Object.keys(t).length>0)return!0}catch{}}catch{}return!1}var JO,YO,XO,ZO,QO=e((()=>{ct(),Fv(),QS(),ot(),ww(),Dt(),Kw(),aO(),SO(),jO(),LO(),JO=Object.freeze({settings:{},errors:[]}),YO=null,XO=null,ZO=null}));function $O(){return T(Ww(),`managed-settings.json`)}function ek(){let e=[],t={},n=!1,{settings:r,errors:i}=rk($O());e.push(...i),r&&Object.keys(r).length>0&&(t=HS(t,r,mk),n=!0);let a=Gw();try{let r=w().readdirSync(a).filter(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`)).map(e=>e.name).sort();for(let i of r){let{settings:r,errors:o}=rk(T(a,i));e.push(...o),r&&Object.keys(r).length>0&&(t=HS(t,r,mk),n=!0)}}catch(e){let t=tt(e);t!==`ENOENT`&&t!==`ENOTDIR`&&pt(e)}return{settings:n?t:null,errors:e}}function tk(){let{settings:e}=rk($O()),t=!!e&&Object.keys(e).length>0,n=!1,r=Gw();try{n=w().readdirSync(r).some(e=>(e.isFile()||e.isSymbolicLink())&&e.name.endsWith(`.json`)&&!e.name.startsWith(`.`))}catch{}return{hasBase:t,hasDropIns:n}}function nk(e,t){typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`?C(`Broken symlink or missing file encountered for settings.json at path: ${t}`):pt(e)}function rk(e){let t=_e(e);if(t)return{settings:t.settings?it(t.settings):null,errors:t.errors};let n=ik(e);return Pe(e,n),{settings:n.settings?it(n.settings):null,errors:n.errors}}function ik(e){try{let{resolvedPath:t}=st(w(),e),n=ZS(t);if(n.trim()===``)return{settings:{},errors:[]};let r=Sw(n,!1),i=xO(r,e),a=iO().safeParse(r);if(!a.success){let t=yO(a.error,e);return{settings:null,errors:[...i,...t]}}return{settings:a.data,errors:i}}catch(t){return nk(t,e),{settings:null,errors:[]}}}function ak(e){switch(e){case`userSettings`:return Ut(h());case`policySettings`:case`projectSettings`:case`localSettings`:return Ut(Ue());case`flagSettings`:{let e=Le();return e?Lt(Ut(e)):Ut(Ue())}}}function ok(){return fe()||g(process.env.WORKMATE_USE_COWORK_PLUGINS)?`cowork_settings.json`:`settings.json`}function sk(e){switch(e){case`userSettings`:return T(ak(e),ok());case`projectSettings`:case`localSettings`:return T(ak(e),ck(e));case`policySettings`:return $O();case`flagSettings`:return Le()}}function ck(e){switch(e){case`projectSettings`:return T(`.workmate`,`settings.json`);case`localSettings`:return T(`.workmate`,`settings.local.json`)}}function lk(e){let t=je(e);if(t!==void 0)return t;let n=uk(e);return Je(e,n),n}function uk(e){if(e===`policySettings`){let e=BO();if(Object.keys(e.settings).length>0)return e.settings;let{settings:t}=ek();if(t)return t;let n=VO();return Object.keys(n.settings).length>0?n.settings:null}let t=sk(e),{settings:n}=t?rk(t):{settings:null};if(e===`flagSettings`){let e=Se();if(e){let t=iO().safeParse(e);if(t.success)return HS(n||{},t.data,mk)}}return n}function dk(){let e=BO();if(Object.keys(e.settings).length>0)return yt()===`macos`?`plist`:`hklm`;let{settings:t}=ek();if(t)return`file`;let n=VO();return Object.keys(n.settings).length>0?`hkcu`:null}function fk(e,t){if(e===`policySettings`||e===`flagSettings`)return{error:null};let n=sk(e);if(!n)return{error:null};try{w().mkdirSync(Lt(n));let r=uk(e);if(!r){let e=null;try{e=ZS(n)}catch(e){if(!nt(e))throw e}if(e!==null){let t=Sw(e);if(t===null)return{error:Error(`Invalid JSON syntax in settings file at ${n}`)};t&&typeof t==`object`&&(r=t,C(`Using raw settings from ${n} due to validation failure`))}}let i=HS(r||{},t,(e,t,n,r)=>{if(t===void 0&&r&&typeof n==`string`){delete r[n];return}if(Array.isArray(t))return t});zw(n),yC(n,`${$e(i,null,2)}\n`),ue(),e===`localSettings`&&DC(ck(`localSettings`),Ue())}catch(e){let t=Error(`Failed to read raw settings from ${n}: ${e}`);return pt(t),{error:t}}return{error:null}}function pk(e,t){return KS([...e,...t])}function mk(e,t){if(Array.isArray(e)&&Array.isArray(t))return pk(e,t)}function hk(e){let t=iO().strip().parse(e),n=[`permissions`,`sandbox`,`hooks`],r=[],i={permissions:new Set([`allow`,`deny`,`ask`,`defaultMode`,`disableBypassPermissionsMode`,`disableAutoMode`,`additionalDirectories`]),sandbox:new Set([`enabled`,`failIfUnavailable`,`allowUnsandboxedCommands`,`network`,`filesystem`,`ignoreViolations`,`excludedCommands`,`autoAllowBashIfSandboxed`,`enableWeakerNestedSandbox`,`enableWeakerNetworkIsolation`,`ripgrep`]),hooks:new Set([`PreToolUse`,`PostToolUse`,`Notification`,`UserPromptSubmit`,`SessionStart`,`SessionEnd`,`Stop`,`SubagentStop`,`PreCompact`,`PostCompact`,`TeammateIdle`,`TaskCreated`,`TaskCompleted`])};for(let e of Object.keys(t))if(n.includes(e)&&t[e]&&typeof t[e]==`object`){let n=t[e],a=i[e];if(a)for(let t of Object.keys(n))a.has(t)&&r.push(`${e}.${t}`)}else r.push(e);return r.sort()}function gk(){if(Ck)return{settings:{},errors:[]};let e=Date.now();Ot(`loadSettingsFromDisk_start`),Mv(`info`,`settings_load_started`),Ck=!0;try{let t=Ae(),n={};t&&(n=HS(n,t,mk));let r=[],i=new Set,a=new Set;for(let e of Aw()){if(e===`policySettings`){let e=null,t=[];{let n=BO();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}if(!e){let{settings:n,errors:r}=ek();n&&(e=n),t.push(...r)}if(!e){let n=VO();Object.keys(n.settings).length>0&&(e=n.settings),t.push(...n.errors)}e&&(n=HS(n,e,mk));for(let e of t){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}continue}let t=sk(e);if(t){let e=Ut(t);if(!a.has(e)){a.add(e);let{settings:o,errors:s}=rk(t);for(let e of s){let t=`${e.file}:${e.path}:${e.message}`;i.has(t)||(i.add(t),r.push(e))}o&&(n=HS(n,o,mk))}}if(e===`flagSettings`){let e=Se();if(e){let t=iO().safeParse(e);t.success&&(n=HS(n,t.data,mk))}}}return Mv(`info`,`settings_load_completed`,{duration_ms:Date.now()-e,source_count:a.size,error_count:r.length}),{settings:n,errors:r}}finally{Ck=!1}}function _k(){let{settings:e}=yk();return e||{}}function vk(){ue();let e=[];for(let t of Aw()){let n=lk(t);n&&Object.keys(n).length>0&&e.push({source:t,settings:n})}return{effective:_k(),sources:e}}function yk(){let e=Me();if(e!==null)return e;let t=gk();return Ot(`loadSettingsFromDisk_end`),Ke(t),t}function bk(){return!!(lk(`userSettings`)?.skipDangerousModePermissionPrompt||lk(`localSettings`)?.skipDangerousModePermissionPrompt||lk(`flagSettings`)?.skipDangerousModePermissionPrompt||lk(`policySettings`)?.skipDangerousModePermissionPrompt)}function xk(){return lk(`policySettings`)?.useAutoModeDuringPlan!==!1&&lk(`flagSettings`)?.useAutoModeDuringPlan!==!1&&lk(`userSettings`)?.useAutoModeDuringPlan!==!1&&lk(`localSettings`)?.useAutoModeDuringPlan!==!1}function Sk(e){for(let t of Aw()){if(t===`policySettings`)continue;let n=sk(t);if(n)try{let{resolvedPath:t}=st(w(),n),r=ZS(t);if(!r.trim())continue;let i=Sw(r,!1);if(i&&typeof i==`object`&&e in i)return!0}catch(e){nk(e,n)}}return!1}var Ck,wk,Tk=e((()=>{US(),Te(),qS(),ct(),Fv(),te(),et(),wC(),QS(),ot(),OC(),ww(),ft(),xt(),lt(),Dt(),Rw(),Uw(),Kw(),QO(),Ee(),aO(),SO(),Ck=!1,wk=_k}));export{mD as $,wh as $i,qS as $n,Eb as $r,qw as $t,rO as A,tv as Ai,sC as An,hx as Ar,IT as At,MD as B,O_ as Bi,xC as Bn,Lb as Br,DT as Bt,QO as C,bv as Ci,uw as Cn,_x as Cr,aE as Ct,PO as D,dv as Di,SC as Dn,px as Dr,HT as Dt,LO as E,fv as Ei,CC as En,fx as Er,YT as Et,ZD as F,Y_ as Fi,aC as Fn,rx as Fr,OT as Ft,CD as G,B as Gi,pC as Gn,Gb as Gr,vT as Gt,wD as H,W as Hi,rC as Hn,Wb as Hr,xT as Ht,OD as I,K_ as Ii,wC as In,nx as Ir,CT as It,bD as J,Eh as Ji,JS as Jn,qb as Jr,oT as Jt,_D as K,z as Ki,yC as Kn,Kb as Kr,pT as Kt,ID as L,V_ as Li,mC as Ln,Jb as Lr,ET as Lt,aO as M,$_ as Mi,fC as Mn,ix as Mr,MT as Mt,XD as N,ev as Ni,dC as Nn,ox as Nr,jT as Nt,SO as O,iv as Oi,hC as On,Ax as Or,UT as Ot,YD as P,X_ as Pi,iC as Pn,Qb as Pr,PT as Pt,hD as Q,G as Qi,GS as Qn,Ob as Qr,tT as Qt,DD as R,W_ as Ri,_C as Rn,tx as Rr,kT as Rt,BO as S,yv as Si,fw as Sn,yx as Sr,oE as St,HO as T,vv as Ti,TC as Tn,Ux as Tr,JT as Tt,ED as U,gh as Ui,vC as Un,Nb as Ur,ST as Ut,TD as V,A_ as Vi,nC as Vn,Ub as Vr,TT as Vt,SD as W,_h as Wi,gC as Wn,Vb as Wr,_T as Wt,xD as X,Dh as Xi,ZS as Xn,Ab as Xr,gT as Xt,yD as Y,T_ as Yi,QS as Yn,Pb as Yr,sT as Yt,fD as Z,Zh as Zi,XS as Zn,kb as Zr,Qw as Zt,Sk as _,op as _a,Ev as _i,yw as _n,Ix as _r,fE as _t,ck as a,U as aa,py as ai,Bw as an,SS as ar,sD as at,zO as b,hn as ba,xv as bi,Sw as bn,lx as br,uE as bt,ak as c,H as ca,Yv as ci,Lw as cn,eS as cr,rD as ct,wk as d,mm as da,Fv as di,Dw as dn,Wx as dr,EE as dt,yh as ea,Db as ei,$ as en,WS as er,dD as et,xk as f,gm as fa,Mv as fi,Tw as fn,Kx as fr,XE as ft,rk as g,Jp as ga,Tv as gi,kw as gn,jx as gr,oD as gt,ek as h,em as ha,jv as hi,jw as hn,Gx as hr,YE as ht,dk as i,og as ia,sy as ii,Vw as in,wS as ir,lD as it,iO as j,rv as ji,cC as jn,sx as jr,LT as jt,bO as k,av as ki,lC as kn,bx as kr,BT as kt,yk as l,vh as la,Uv as li,Aw as ln,tS as lr,aD as lt,Tk as m,fm as ma,Av as mi,Rw as mn,Jx as mr,JE as mt,tk as n,V as na,Zv as ni,Gw as nn,FS as nr,gD as nt,sk as o,Ch as oa,oy as oi,Uw as on,dS as or,pE as ot,bk as p,im as pa,Pv as pi,Ew as pn,Yx as pr,UE as pt,vD as q,tg as qi,oC as qn,Bb as qr,hT as qt,hk as r,Ih as ra,ay as ri,Kw as rn,PS as rr,uD as rt,lk as s,L as sa,Gv as si,Mw as sn,iS as sr,eD as st,_k as t,R as ta,Wv as ti,Ww as tn,KS as tr,pD as tt,vk as u,Rm as ua,Iv as ui,Ow as un,qx as ur,zE as ut,mk as v,oi as va,Cv as vi,ww as vn,vx as vr,dE as vt,UO as w,pv as wi,OC as wn,gx as wr,sE as wt,VO as x,bn as xa,Sv as xi,mw as xn,ux as xr,XT as xt,fk as y,Vr as ya,wv as yi,vw as yn,dx as yr,cE as yt,jD as z,B_ as zi,bC as zn,zb as zr,AT as zt};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r,s as i}from"./envUtils-QyzA_cFM.js";import{di as a,fi as o}from"./src-BX54x08P.js";import{$n as s,Br as c,Jr as l,Qn as u,Wr as ee,Xt as d,di as f,fi as p,qt as m,zr as te}from"./settings-CA-5Px85.js";import{Dn as ne,F as h,Hn as g,Pt as _,Tn as v,X as re,at as ie}from"./state-CXY-q5gr.js";import{$_ as y,Ab as ae,Bp as b,Cb as x,Eg as oe,Ey as se,Hs as ce,Hy as le,Js as ue,Ks as de,Mb as S,Mn as C,Mt as w,Nb as T,Nn as E,Pb as D,Pi as O,Q_ as k,Sb as A,Tg as j,Us as M,Vy as N,X_ as P,Xi as F,Z_ as I,_t as L,av as R,bt as z,cm as B,cv as V,cw as H,ev as fe,fv as pe,gn as me,hn as he,hv as U,iv as ge,jn as _e,jy as ve,kb as ye,ki as be,nm as xe,nv as Se,om as Ce,ov as we,pv as Te,rm as Ee,rv as De,si as Oe,sm as ke,sv as Ae,tS as je,tv as Me,uw as Ne,vr as Pe,vt as Fe,wt as Ie,xa as W,zp as Le}from"./loadAgentsDir-DnHL_5cU.js";import{n as Re,t as G}from"./cwd-DrEEb4f5.js";import{I as K,M as ze,N as Be,f as Ve,u as He}from"./debug-NBJH_NxR.js";import{a as Ue,d as We}from"./config-Bjwat4P6.js";import{o as Ge,s as Ke}from"./log-D98mO6yJ.js";import{n as q}from"./analytics-COpjZpvd.js";import{n as qe,r as J}from"./startupProfiler-C_xcIvEA.js";import{X as Je,Y as Ye}from"./model-C9ANf1-R.js";import{ln as Y,pn as Xe}from"./prompt-DDlkyIzV.js";import{a as Ze,r as Qe}from"./projectOnboardingState-ofkjp9FJ.js";import{j as $e,k as X}from"./sessionTracing-Bz89tYh5.js";import{i as et,n as tt}from"./appleTerminalBackup-Ct9hf1QQ.js";import{c as nt,t as rt}from"./nativeInstaller-BDJxBAPV.js";import{l as Z,s as it}from"./logoUtils-B8MIA7c5.js";import{i as at,r as ot}from"./runtimeObserver-DuJ8mRfr.js";import{t as st}from"./sinks-BvOPODnl.js";import{writeFile as Q}from"fs/promises";r(),o(),_(),Re(),f(),Ge(),l(),d(),We(),Ne(),T(),ye(),A(),oe(),O(),Pe(),me(),t(),Xe(),le(),s(),de(),Ve(),Le(),F(),E(),Ye(),Te(),q(),xe(),ke(),Me(),K();function ct(){return!1}function lt(){return{}}var $;function ut(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=u(e,e=>e.type===`tool_use`))}}return n}function dt(e){let t=U(e);if(!Se()){if(!y(t))return!1;R()}let n=fe(t),r=ut(e,$)>=k(),i=W(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&($=t.uuid),!0}return!1}async function ft(e){let t=He(),n=_e();await t.mkdir(n,{mode:448});let r=C();try{await Q(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await Q(r,await B(),{encoding:`utf-8`,mode:384})}catch(e){if(Be(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await N.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),a.length,{memoryPath:r,currentMemory:a}}var pt=e(()=>{let e=lt();V({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:P.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:P.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:P.toolCallsBetweenUpdates})}),mt=Je(async e=>{let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`||!ct()||(pt(),!dt(t)))return;ge();let i=M(n),{memoryPath:a,currentMemory:o}=await ft(i);await ue({promptMessages:[je({content:await Ce(o,a)})],cacheSafeParams:ce(e),canUseTool:gt(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?pe(s):void 0,l=I();c?.input_tokens,c?.output_tokens,c?.cache_read_input_tokens,c?.cache_creation_input_tokens,l.minimumMessageTokensToInit,l.minimumTokensBetweenUpdate,l.toolCallsBetweenUpdates,we(U(t)),_t(t),De()});function ht(){Ee()&&b(mt)}function gt(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${Y} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${Y} on ${e} is allowed`}}}}function _t(e){if(!W(e)){let t=e[e.length-1];t?.uuid&&Ae(t.uuid)}}q(),at(),et(),ve(),$e(),K(),Z(),rt(),Qe(),qe(),Ie();async function vt(e,t,r,o,s,l,u,d){p(`info`,`setup_started`);let f=process.version.match(/^v(\d+)\./)?.[1];if((!f||parseInt(f,10)<18)&&(console.error(a.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),u&&g(j(u)),!h())try{let e=await tt();e.status===`restored`?console.log(a.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(a.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){Ke(e)}x(e);let _=Date.now();if(S(),p(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-_}),ae(e),o){let t=he(),n=await ee();!t&&!n&&(process.stderr.write(a.red(`Error: Can only use --worktree in a git repository, but ${a.bold(e)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=d?`pr-${d}`:s??H(),i;if(n){let e=te(G());e||(process.stderr.write(a.red(`Error: Could not determine the main git repository root.
|
|
2
|
+
`)),process.exit(1)),e!==(c(G())??G())&&(p(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),x(e)),i=l?z(e,w(r)):void 0}else i=l?z(G(),w(r)):void 0;let o;try{o=await Fe(ie(),r,i,d?{prNumber:d}:void 0)}catch(e){process.stderr.write(a.red(`Error creating worktree: ${ze(e)}\n`)),process.exit(1)}if(l&&i){let e=await L(i,o.worktreePath);e.created?console.log(a.green(`Created tmux session: ${a.bold(i)}\nTo attach: ${a.bold(`tmux attach -t ${i}`)}`)):console.error(a.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(o.worktreePath),x(o.worktreePath),v(G()),ne(G()),Oe(o),se(),D()}p(`info`,`setup_background_jobs_starting`),i()||(ht(),ot()),nt(),p(`info`,`setup_background_jobs_launched`),J(`setup_before_prefetch`),p(`info`,`setup_prefetch_starting`);let y=h()&&n(process.env.WORKMATE_SYNC_PLUGIN_INSTALL)||i();if(y||be(re()),import(`./loadPluginHooks-BuunKr9m.js`).then(e=>{y||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),i()||import(`./sessionFileAccessHooks-nq8C34WL.js`).then(e=>e.registerSessionFileAccessHooks()),st(),J(`setup_after_prefetch`),!i()&&Ze()&&await it(),t===`bypassPermissions`||r){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.WORKMATE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(a.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(a.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
|
|
3
|
+
I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.WORKMATE_ENTRYPOINT!==`local-agent`&&process.env.WORKMATE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([X.getIsDocker(),m.hasInternetAccess()]),n=X.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}}let b=Ue();b.lastCost!==void 0&&b.lastDuration!==void 0&&(b.lastCost,b.lastAPIDuration,b.lastToolDuration,b.lastDuration,b.lastLinesAdded,b.lastLinesRemoved,b.lastTotalInputTokens,b.lastTotalOutputTokens,b.lastTotalCacheCreationInputTokens,b.lastTotalCacheReadInputTokens,b.lastFpsAverage,b.lastFpsLow1Pct,b.lastSessionId,{...b.lastSessionMetrics})}export{vt as setup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-DnHL_5cU.js";import{in as o}from"./prompt-DDlkyIzV.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return t(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,t){let i=[],o=n(e),s=r(e),f=a(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let r=u(e,s,t);if(r.shadowed){let t=c(r.shadowedBy.source);i.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return i}var p=e((()=>{o(),i()}));export{p as n,f as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AS as t,Js as n,Ks as r,Lx as i,SS as a,Xi as o,tS as s}from"./loadAgentsDir-DnHL_5cU.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:t}){let r=await n({promptMessages:[s({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
|
|
2
2
|
|
|
3
3
|
IMPORTANT CONTEXT:
|
|
4
4
|
- You are a separate, lightweight agent spawned to answer this one question
|
|
@@ -15,6 +15,6 @@ CRITICAL CONSTRAINTS:
|
|
|
15
15
|
|
|
16
16
|
Simply answer the question with the information you have.</system-reminder>
|
|
17
17
|
|
|
18
|
-
${e}`})],cacheSafeParams:
|
|
18
|
+
${e}`})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Side questions cannot use tools`,decisionReason:{type:`other`,reason:`side_question`}}),querySource:`side_question`,forkLabel:`side_question`,maxTurns:1,skipCacheWrite:!0});return{response:u(r.messages),usage:r.totalUsage}}function u(e){let n=e.flatMap(e=>e.type===`assistant`?e.message.content:[]);if(n.length>0){let e=i(n,`
|
|
19
19
|
|
|
20
|
-
`).trim();if(e)return e;let
|
|
20
|
+
`).trim();if(e)return e;let t=n.find(e=>e.type===`tool_use`);if(t)return`(The model tried to call ${`name`in t?t.name:`a tool`} instead of answering directly. Try rephrasing or ask in the main conversation.)`}let r=e.find(e=>e.type===`system`&&`subtype`in e&&e.subtype===`api_error`);return r?`(API error: ${t(r.error)})`:null}var d,f=e((()=>{a(),r(),o(),d=/^\/btw\b/gi}));export{f as n,l as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./axios-DaWTGg7G.js";import{Pt as n,at as r}from"./state-CXY-q5gr.js";import{$ as i,C as a,c as o,et as s,f as c,i as l,nt as u,rt as d,u as f,x as p}from"./debug-
|
|
1
|
+
import{n as e,t}from"./axios-DaWTGg7G.js";import{Pt as n,at as r}from"./state-CXY-q5gr.js";import{$ as i,C as a,c as o,et as s,f as c,i as l,nt as u,rt as d,u as f,x as p}from"./debug-NBJH_NxR.js";import{_ as m,o as h,r as g,t as _,v}from"./log-D98mO6yJ.js";import{n as y}from"./analytics-COpjZpvd.js";import{dirname as b,join as x}from"path";t(),n(),d(),v(),i(),l(),c(),h(),p();var S=g(new Date);function C(){return x(m.errors(),`${S}.jsonl`)}function w(e){return x(m.mcpLogs(e),`${S}.jsonl`)}function T(e){let t=u(e);return{write(e){t.write(`${a(e)}\n`)},flush:t.flush,dispose:t.dispose}}var E=new Map;function D(e){let t=E.get(e);if(!t){let n=b(e);t=T({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),E.set(e,t),s(async()=>t?.dispose())}return t}function O(e,t){let n={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.30`};D(e).write(n)}function k(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function A(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=k(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}o(`${t.name}: ${r}${n}`,{level:`error`}),O(C(),{error:`${r}${n}`})}function j(e,t){o(`MCP server "${e}" ${t}`,{level:`error`});let n=w(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};D(n).write(i)}function M(e,t){o(`MCP server "${e}": ${t}`);let n=w(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};D(n).write(i)}function N(){_({logError:A,logMCPError:j,logMCPDebug:M,getErrorsPath:C,getMCPLogsPath:w}),o(`Error log sink initialized`)}y();function P(){N()}export{P as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./sinks-BvOPODnl.js";export{e as initSinks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gn as e,Hn as t,Kn as n,Pt as r,Tn as i,U as a,at as o,h as s,vn as ee,yn as c}from"./state-CXY-q5gr.js";import{Am as te,At as l,Br as ne,Cb as u,Eg as re,Ey as d,Ft as ie,Gi as f,Iy as ae,Jg as oe,Ki as p,Ly as m,Pi as h,Qr as g,Qs as _,Rn as se,Sb as ce,Tg as le,Ti as ue,Ui as de,Zr as fe,ag as pe,gn as me,hh as he,ii as ge,is as _e,jy as v,km as y,lw as b,my as x,nc as S,pn as C,py as w,qg as T,qi as E,rs as D,sg as O,si as k,uw as A,vr as j,wi as M,wt as N,xt as P}from"./loadAgentsDir-DnHL_5cU.js";import{n as F,t as I}from"./cwd-DrEEb4f5.js";import{$ as ve,c as L,et as ye,f as be,i as R,u as xe}from"./debug-NBJH_NxR.js";import{n as z}from"./analytics-COpjZpvd.js";import{f as Se,v as Ce}from"./model-C9ANf1-R.js";import{Gt as we}from"./prompt-DDlkyIzV.js";import{S as Te,x as Ee}from"./sleep-BGewNhNx.js";import*as B from"path";import{dirname as De}from"path";r(),oe(),w(),we(),re(),v(),he(),_(),F(),R(),O(),Se(),A(),ce(),j(),ae(),te(),N();function Oe(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(r?.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=y().safeParse(i.todos);return a.success?a.data:[]}return[]}function ke(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&pe(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),!m()&&e.messages&&e.messages.length>0){let n=Oe(e.messages);if(n.length>0){let e=o();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function V(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function H(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return c(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(c(r.agentType),!a()&&r.model&&r.model!==`inherit`&&ee(Ce(r.model)),{agentDefinition:r,agentType:r.agentType}):(L(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),c(void 0),{agentDefinition:void 0,agentType:void 0})}function U(e){let t=P();if(t){k(t);return}if(e){try{process.chdir(e.worktreePath)}catch{k(null);return}u(e.worktreePath),i(I()),l(e),d(),T(),b.cache.clear?.()}}function Ae(){let e=P();if(e){l(null),d(),T(),b.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}u(e.originalCwd),i(I())}}async function je(e,n,r){if(n.forkSession)e.contentReplacements?.length&&await ne(e.contentReplacements);else{let r=n.sessionIdOverride??e.sessionId;r&&(t(le(r),n.transcriptPath?De(n.transcriptPath):null),await fe(),x(r))}g(n.forkSession?{...e,worktreeSession:void 0}:e),n.forkSession||(U(e.worktreeSession),se());let{agentDefinition:i,agentType:a}=H(e.agentSetting,r.mainThreadAgentDefinition,r.agentDefinitions);ge(`normal`),n.includeAttribution;let o=V(e.agentName,e.agentColor);S(e.agentName);let s=r.agentDefinitions;return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor==="default"?void 0:e.agentColor,restoredAgentDef:i,initialState:{...r.initialState,...a&&{agent:a},...o&&{standaloneAgentContext:o},agentDefinitions:s}}}Te(),r(),h(),z(),p(),D(),ve(),R(),be(),me(),n();var Me=1e3,Ne=500,Pe=300,Fe=2e3,Ie=typeof Bun<`u`,W=null,G=null,K=new Set,q=!1,J=!1,Y=!1,X=null,Z=e();async function Le(){if(q||J)return;q=!0,Y||(Y=!0,E(()=>{M(),Z.emit()}));let e=await ze();e.length!==0&&(L(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),W=Ee.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Me,pollInterval:Ne},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(B.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ie,interval:Fe,atomic:!0}),W.on(`add`,$),W.on(`change`,$),W.on(`unlink`,$),X=ye(async()=>{await Q()}))}function Q(){J=!0,X&&(X(),X=null);let e=Promise.resolve();return W&&(e=W.close(),W=null),G&&(clearTimeout(G),G=null),K.clear(),Z.clear(),e}var Re=Z.subscribe;async function ze(){let e=xe(),t=[],n=f(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=f(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=f(`projectSettings`,`skills`);if(i)try{let n=B.resolve(i);await e.stat(n),t.push(n)}catch{}let a=f(`projectSettings`,`commands`);if(a)try{let n=B.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=B.join(n,`.workmate`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){L(`Detected skill change: ${e}`),Be(e)}function Be(e){K.add(e),G&&clearTimeout(G),G=setTimeout(async()=>{G=null;let e=[...K];if(K.clear(),C(await ie(`skills`,e[0]))){L(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}de(),ue(),_e(),Z.emit()},Pe)}var Ve={initialize:Le,dispose:Q,subscribe:Re};export{H as a,je as i,V as n,ke as o,Ae as r,U as s,Ve as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BFfHgAMh.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BFfHgAMh.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-CTVa34xO.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??r(e.cwd),i=await A(n,e.rootDir),a=F(t),o=new Date().toISOString(),s=i.gaps[a],c={key:a,prompt:t,count:(s?.count??0)+1,draftHits:s?.draftHits??0,draftHitSessions:s?.draftHitSessions??[],status:s?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:s?.createdAt??o,updatedAt:o,draft:s?.draft,active:s?.active};return c.status===`rejected`?(i.gaps[a]=c,await N(n,i,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),i.gaps[a]=c,await N(n,i,e.rootDir),c)}async function v(e=r(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=r(),n){let i=await A(t,n);for(let t of Object.values(i.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=r(),n,i=`unknown-session`){let a=await A(t,n),o=a.gaps[e];if(!o?.draft||o.active)return o;let s=o.draftHitSessions??[];if(s.includes(i))return o;let c=new Date().toISOString(),l={...o,draftHits:o.draftHits+1,draftHitSessions:[...s,i],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),a.gaps[e]=l,await N(t,a,n),l}async function x(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;if(a.status===`rejected`||a.draft)return a;let o={...a,draft:await T(a,t),status:`draft`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),await z(),o}async function S(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;let o={...a,status:`rejected`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),o}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),r=u(t.projectRoot??t.cwd,`.workmate`,`skills`,`.drafts`),i=s([n],{cwd:t.projectRoot??t.cwd,outputRoot:r,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),a=u(i.outputPath,`SKILL.md`);return d(a)||await o({...i,content:i.content+`
|
|
2
2
|
## Promotion Rule
|
|
3
3
|
|
|
4
4
|
Do not move this draft into active skills until the same gap repeats or the user explicitly confirms this should become reusable.
|
|
5
|
-
`}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-
|
|
5
|
+
`}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-BoGtXPAA.js`);e()}catch{}}var B,V,H;e((()=>{i(),t(),c(),B=2,V=4,H=2}))();export{y as findGapKeyByDraftPath,x as promoteGapToDraft,v as readSkillGaps,b as recordDraftHit,_ as recordSkillGap,S as rejectSkillGap,w as shouldPromoteToActive,C as shouldPromoteToDraft};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{o as r,t as i}from"./localSearch-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{o as r,t as i}from"./localSearch-LFCzV7VE.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as m,rm as ee,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function te(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(y(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=_([n,...r].join(`-`));return v(i)?`${n}-learned-pattern`:i}function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function v(e){return x.has(e)}function y(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));function C(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?_(t.name):E(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??D(e),o=re(r,n,t),s=O({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function w(e,t,n){let r=C(e,t),i=await P(`skill`,r,n);for(let t of i){let n=ie(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await ne(t,e)}}return{action:`create`,draft:r}}async function ne(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=M)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,A);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
|
|
2
2
|
`),s=n.endsWith(`
|
|
3
|
-
`)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-
|
|
3
|
+
`)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-BoGtXPAA.js`);e()}catch{}return t}function re(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.workmate`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function E(e){return te(e)}function D(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function O(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${k(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
4
4
|
`),``,`## Action`,``,i.map(e=>`- ${e.action}`).join(`
|
|
5
5
|
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,j).join(`
|
|
6
6
|
`),``].join(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,hn as a,t as o,y as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
2
|
-
`)}async function m(){if(
|
|
3
|
-
`)}async function h(){return
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,hn as a,t as o,y as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{CC as l,wC as u}from"./loadAgentsDir-DnHL_5cU.js";import{i as d,t as f}from"./overlayContext-DGUFuee9.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${u()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
|
|
2
|
+
`)}async function m(){if(u()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-BulDBrBk.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
|
|
3
|
+
`)}async function h(){return u()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){d(`skill-search-panel`);let[t,i]=(0,v.useState)(0),o=(0,v.useMemo)(()=>[{label:`Status`,description:`显示自动 skill 匹配是否已启用`,run:()=>Promise.resolve(p())},{label:`Start`,description:`为本次会话启用自动 skill 匹配`,run:m},{label:`Stop`,description:`为本次会话禁用自动 skill 匹配`,run:h},{label:`About`,description:`自动 skill 匹配的工作原理`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=o[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return a((e,t)=>{if(t.upArrow){i(e=>Math.max(0,e-1));return}if(t.downArrow){i(e=>Math.min(o.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(s,{title:`Skill Search`,subtitle:`${o.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(n,{flexDirection:`column`,children:[o.map((e,i)=>(0,y.jsxs)(n,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${i===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(i(),1),o(),f(),l(),y=c(),b=28,x=`# Skill Search (自动技能匹配)
|
|
4
4
|
|
|
5
5
|
Skill Search 控制对话中的自动技能匹配功能。
|
|
6
6
|
|
|
@@ -17,5 +17,5 @@ Skill Search 控制对话中的自动技能匹配功能。
|
|
|
17
17
|
- /skill-search stop — 禁用自动匹配
|
|
18
18
|
- /skill-search status — 查看当前状态
|
|
19
19
|
|
|
20
|
-
当前状态: ${
|
|
20
|
+
当前状态: ${u()?`已启用`:`未启用`}
|
|
21
21
|
`}))();export{_ as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,h as a,t as o,y as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{fn as l,mn as u}from"./settings-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,ai as i,h as a,t as o,y as s}from"./src-BX54x08P.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{fn as l,mn as u}from"./settings-CA-5Px85.js";import{Fi as d,Ki as f,Pi as p,Wi as m,_d as h,gd as g}from"./loadAgentsDir-DnHL_5cU.js";import{_,g as v}from"./startupProfiler-C_xcIvEA.js";import{l as y,o as b}from"./stringUtils-CtJhTszO.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:l(e)}function w({onExit:e,commands:t}){let[i,o]=(0,T.useState)(``),c=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),l=(0,T.useMemo)(()=>x(c.map(e=>({...e,name:d(e),description:e.description??``})),i),[c,i]),u=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of l){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>d(e).localeCompare(d(t)));return e},[l]),f=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(c.length===0)return(0,E.jsxs)(s,{title:`Skills`,subtitle:`No skills found`,onCancel:f,hideInputGuide:!0,children:[(0,E.jsx)(r,{dimColor:!0,children:`Create skills in .workmate/skills/ or ~/.workmate/skills/`}),(0,E.jsx)(r,{dimColor:!0,italic:!0,children:(0,E.jsx)(g,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let p=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},h=(e,t)=>{let i=`~${v(m(e))}`,a=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,o=p(e.source);return(0,E.jsxs)(n,{children:[(0,E.jsx)(r,{color:t?`suggestion`:void 0,children:d(e)}),o&&(0,E.jsxs)(r,{color:o.color,children:[` [`,o.label,`]`]}),(0,E.jsxs)(r,{dimColor:!0,children:[a?` · ${a}`:``,` · `,C(e.source),` · `,i,` tokens`]})]})};return(0,E.jsx)(a,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>u[e]),[u]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:o,onSelect:t=>{e(`/${d(t)}`,{display:`user`})},onCancel:f,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:i.trim()===``?`${c.length} ${y(c.length,`skill`)}`:`${l.length}/${c.length} ${y(c.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>h(e,t)})}var T,E,D,O=e((()=>{T=t(i(),1),p(),o(),f(),_(),u(),b(),h(),S(),E=c(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{O(),A=c()}))();export{k as call};
|