@readmagic/workmate 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AddWorkspaceDirectory-qFZy3FOD.js +1 -0
- package/dist/chunks/App-DW4elk6E.js +1 -0
- package/dist/chunks/ApproveApiKey-D05WywHU.js +1 -0
- package/dist/chunks/ApproveApiKey-DHAbdwkC.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BuRFF1fQ.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CDrArsSX.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +1 -0
- package/dist/chunks/DiffDialog-BIcwpgSr.js +6 -0
- package/dist/chunks/Doctor-D160J8Ad.js +3 -0
- package/dist/chunks/Doctor-VhJi2cmL.js +1 -0
- package/dist/chunks/ExitFlow-CoWHhKHJ.js +2 -0
- package/dist/chunks/Grove-BmirUB6V.js +11 -0
- package/dist/chunks/{HybridTransport-rK83Qijz.js → HybridTransport-BVmSUHf0.js} +3 -3
- package/dist/chunks/InvalidConfigDialog-WRywkKeS.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-C4n3A72C.js +1 -0
- package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +1 -0
- package/dist/chunks/MCPToolListView-BPmE0C2o.js +1 -0
- package/dist/chunks/McpParsingWarnings-CH4yyMAL.js +1 -0
- package/dist/chunks/MessageSelector-kOn2GaU-.js +3 -0
- package/dist/chunks/Messages-4EnHFeh1.js +11 -0
- package/dist/chunks/Onboarding-BboWs1pp.js +1 -0
- package/dist/chunks/{PermissionDialog-0ya1CU5k.js → PermissionDialog-Cb3z8OUP.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-Dl9Hg9Mf.js → PressEnterToContinue-Dq0Imo9c.js} +1 -1
- package/dist/chunks/PromptInputFooterSuggestions-BpC9COmh.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +1 -0
- package/dist/chunks/QueryEngine-J6ElcO16.js +1 -0
- package/dist/chunks/REPL-DBjbAJsm.js +133 -0
- package/dist/chunks/REPL-oBemMXvp.js +1 -0
- package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +2 -0
- package/dist/chunks/ResumeConversation-wBG8OD9P.js +1 -0
- package/dist/chunks/{SSETransport-5VK5okFv.js → SSETransport-1KBBUikF.js} +3 -3
- package/dist/chunks/{Dialog-vfLXEPed.js → SearchBox-C9vUA4IM.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +1 -0
- package/dist/chunks/Settings-DptKuJE7.js +2 -0
- package/dist/chunks/TeleportProgress-BmgPAZAi.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-sgxNOeM_.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-GptvrUdv.js +1 -0
- package/dist/chunks/ThemePicker-gAMqqD1P.js +1 -0
- package/dist/chunks/TrustDialog-CWt-4Evl.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BYsDtAvX.js → ValidationErrorsList-De3kzHtz.js} +1 -1
- package/dist/chunks/{WelcomeV2-C1BfrqC5.js → WelcomeV2-BWF-cJOu.js} +1 -1
- package/dist/chunks/add-dir-DBVT1cEK.js +1 -0
- package/dist/chunks/{agentDisplay-CMmHIl86.js → agentDisplay-5gnCQwUY.js} +1 -1
- package/dist/chunks/{agents-DE_4mAHG.js → agents-Bz1MLp4A.js} +1 -1
- package/dist/chunks/agents-CnwTOlqO.js +103 -0
- package/dist/chunks/allErrors-DYw_q14e.js +1 -0
- package/dist/chunks/analytics-DJobLaWP.js +1 -0
- package/dist/chunks/api-DXDXTFGa.js +1 -0
- package/dist/chunks/api-DzccRM_z.js +1 -0
- package/dist/chunks/auth-Cjnyy10u.js +15 -0
- package/dist/chunks/auth-CnLb6RWc.js +1 -0
- package/dist/chunks/auth-D-SGHS0K.js +1 -0
- package/dist/chunks/{autoMode-ZW70mpr0.js → autoMode-CQ5nqP9c.js} +5 -5
- package/dist/chunks/{autonomy-CwbWsCnv.js → autonomy-CPUCe-YU.js} +1 -1
- package/dist/chunks/autonomy-dSJl0hN1.js +15 -0
- package/dist/chunks/{autonomyPanel-Mq50H7iM.js → autonomyPanel-Ccr9ilei.js} +1 -1
- package/dist/chunks/backgroundHousekeeping--cs5crp7.js +17 -0
- package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +1 -0
- package/dist/chunks/{banner-CWkrK10u.js → banner-BJZNMppT.js} +2 -2
- package/dist/chunks/bg-DWloqGwk.js +1 -0
- package/dist/chunks/{bg-WnYN5ifx.js → bg-w3Vlsm3Y.js} +2 -2
- package/dist/chunks/branch-CG0AKS1J.js +3 -0
- package/dist/chunks/{break-cache-C_p7Kmx2.js → break-cache-DXV0brco.js} +2 -2
- package/dist/chunks/bridgeConfig-Dmc1ZDev.js +1 -0
- package/dist/chunks/{bridgeConfig-CE6dMsiJ.js → bridgeConfig-vORehbGG.js} +1 -1
- package/dist/chunks/bridgeMessaging-DlczTV9X.js +1 -0
- package/dist/chunks/bridgePointer-D4W9GpWw.js +1 -0
- package/dist/chunks/btw-DDUC_t0w.js +1 -0
- package/dist/chunks/caches-1IFb6_M_.js +1 -0
- package/dist/chunks/caches-CB8MHqy2.js +1 -0
- package/dist/chunks/capacityWake-L7b1mMft.js +3 -0
- package/dist/chunks/ccrClient-CG6HTv_n.js +1 -0
- package/dist/chunks/{claudeDesktop-Fe-QL-sN.js → claudeDesktop-CAmnheYx.js} +1 -1
- package/dist/chunks/{clear-D8m2utXW.js → clear-DdWexxbM.js} +1 -1
- package/dist/chunks/{cliLaunch-BkPAatcs.js → cliLaunch-BWWOgBFh.js} +1 -1
- package/dist/chunks/{client-C6MbjvOB.js → client-CoXtVRzi.js} +1 -1
- package/dist/chunks/client-Crrwkw7g.js +1 -0
- package/dist/chunks/client-D8hKghba.js +1 -0
- package/dist/chunks/color-Cuq0c6xy.js +1 -0
- package/dist/chunks/commands-D3sESsTp.js +1 -0
- package/dist/chunks/compact-DIpwuBDq.js +2 -0
- package/dist/chunks/config-CVvUNkj2.js +1 -0
- package/dist/chunks/config-D4G8_MqJ.js +3 -0
- package/dist/chunks/config-q9D4hFiK.js +1 -0
- package/dist/chunks/context-BWcfhhDj.js +1 -0
- package/dist/chunks/context-noninteractive-Bwt9A3XD.js +1 -0
- package/dist/chunks/context-noninteractive-c7jGVWHQ.js +29 -0
- package/dist/chunks/conversation-Bjo_8kia.js +1 -0
- package/dist/chunks/conversation-DrHZIQX2.js +1 -0
- package/dist/chunks/{createSSHSession-BOdTAX3N.js → createSSHSession-DP7B8yvb.js} +1 -1
- package/dist/chunks/createSession-CPo6GBSb.js +1 -0
- package/dist/chunks/createSession-DnykRoia.js +1 -0
- package/dist/chunks/crossProjectResume-D2A-qjgP.js +40 -0
- package/dist/chunks/cwd--q1ONL7P.js +1 -0
- package/dist/chunks/cwd-L4wygFqJ.js +1 -0
- package/dist/chunks/{daemon-YtZbMQtn.js → daemon-D2vFIVOz.js} +1 -1
- package/dist/chunks/datadog-DrmHyl3_.js +1 -0
- package/dist/chunks/{debug-BrXObCdR.js → debug-BdqxZ7rV.js} +4 -4
- package/dist/chunks/debugUtils-CezNYZ-4.js +1 -0
- package/dist/chunks/{detached-TYk4hMFj.js → detached-CkPpYMJj.js} +1 -1
- package/dist/chunks/detectRepository-DA1Q_Skc.js +1 -0
- package/dist/chunks/{detectRepository-BPr0VWNO.js → detectRepository-DvxoaPlk.js} +1 -1
- package/dist/chunks/{diff-CJEKvOA5.js → diff-DHzz9WAp.js} +1 -1
- package/dist/chunks/directoryCompletion-D5AvL7TF.js +1 -0
- package/dist/chunks/doctor-PWqB46xd.js +1 -0
- package/dist/chunks/entry-4JtoJONR.js +14 -0
- package/dist/chunks/envUtils-BDhHQY0-.js +1 -0
- package/dist/chunks/esm-DcIr7tVd.js +1 -0
- package/dist/chunks/{execFileNoThrow-D244NytW.js → execFileNoThrow-5SylUnAI.js} +1 -1
- package/dist/chunks/{execSyncWrapper-CCMQShK-.js → execSyncWrapper-DKuxVTaf.js} +1 -1
- package/dist/chunks/exit-OW9g7b9A.js +1 -0
- package/dist/chunks/{lazySchema-DULtBUCI.js → external-CEp-aPkt.js} +1 -1
- package/dist/chunks/extraUsage-Dt5mw35U.js +1 -0
- package/dist/chunks/extractMemories-1VlmCGwa.js +1 -0
- package/dist/chunks/fast-ClYQcEv5.js +1 -0
- package/dist/chunks/fast-CrvLdpy3.js +1 -0
- package/dist/chunks/fileSuggestions-fNxREjpe.js +3 -0
- package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +1 -0
- package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +5 -0
- package/dist/chunks/flushGate-ch-Tvwjj.js +1 -0
- package/dist/chunks/{fpsMetrics-Cf_hdtiJ.js → fpsMetrics-DffAomdg.js} +1 -1
- package/dist/chunks/gemini-fZ0VPU2A.js +1 -0
- package/dist/chunks/generateRecap-BIBVlB__.js +1 -0
- package/dist/chunks/generateSessionName-nZj_VvKZ.js +1 -0
- package/dist/chunks/{genericProcessUtils-CdQTApYX.js → genericProcessUtils-BmDSLcMf.js} +1 -1
- package/dist/chunks/git-B9uvt96d.js +6 -0
- package/dist/chunks/git-BfS5Hk4S.js +1 -0
- package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +1 -0
- package/dist/chunks/goal-IasZVqKh.js +3 -0
- package/dist/chunks/grok-Dk3LyzMa.js +1 -0
- package/dist/chunks/grove-BE4fQ6tG.js +7 -0
- package/dist/chunks/help-D2-v9Ug9.js +1 -0
- package/dist/chunks/{hooks-CkA9bhHl.js → hooks-BrKy5XWQ.js} +2 -2
- package/dist/chunks/hooks-DGd02IKF.js +1 -0
- package/dist/chunks/initReplBridge-RhCAlmHE.js +1 -0
- package/dist/chunks/{install-Dzlm4u58.js → install-CVGZ55wV.js} +1 -1
- package/dist/chunks/{instrumentation-Yt31gxWN.js → instrumentation-BmWotlxR.js} +4 -4
- package/dist/chunks/{job-BXujwZNa.js → job-DEXxW_Zo.js} +1 -1
- package/dist/chunks/{jwtUtils-DE2GPUcx.js → jwtUtils-C9sdGhvT.js} +1 -1
- package/dist/chunks/keybindings-BRdSOSUD.js +2 -0
- package/dist/chunks/language-C0cIpKE2.js +1 -0
- package/dist/chunks/{language-Ca4B018X.js → language-CxThoWRC.js} +1 -1
- package/dist/chunks/launchLocalMemory-CLSSVFoj.js +3 -0
- package/dist/chunks/launchOnboarding-BkJfKviO.js +8 -0
- package/dist/chunks/lazySchema-B4D4qJVE.js +1 -0
- package/dist/chunks/loadAgentsDir-8UprzS4w.js +1 -0
- package/dist/chunks/{loadAgentsDir-x3rlgED4.js → loadAgentsDir-CKSb56Gp.js} +1651 -2004
- package/dist/chunks/loadPluginHooks-LbaURHVH.js +1 -0
- package/dist/chunks/{localSearch-DtplGF-l.js → localSearch-CPOnyi8I.js} +1 -1
- package/dist/chunks/localSearch-DNjbr4S9.js +1 -0
- package/dist/chunks/log-CTFl4qpD.js +1 -0
- package/dist/chunks/logoV2Utils-we1sfJvf.js +1 -0
- package/dist/chunks/{magicDocs-qdDB_mKb.js → magicDocs-DmKlTQvK.js} +3 -3
- package/dist/chunks/main-BIiwW4mM.js +605 -0
- package/dist/chunks/{main-D862LI_d.js → main-ClXu1ilx.js} +2 -2
- package/dist/chunks/{managedEnv-Aq5BXfY7.js → managedEnv-Cl7YbYzf.js} +1 -1
- package/dist/chunks/managedEnv-CpiiQx_v.js +1 -0
- package/dist/chunks/{mappers-04gNXJ3w.js → mappers-xQC-Z4-h.js} +1 -1
- package/dist/chunks/mcp-B_m1XBDt.js +6 -0
- package/dist/chunks/mcp-BiyfH9Sd.js +1 -0
- package/dist/chunks/mcp-BjlaPUWX.js +2 -0
- package/dist/chunks/memoize-FJv2HV1u.js +1 -0
- package/dist/chunks/memory-LN8f_p2b.js +1 -0
- package/dist/chunks/{modalContext-DFjKLCB6.js → modalContext-CUThy6Ph.js} +1 -1
- package/dist/chunks/mode-lYTs0XHs.js +2 -0
- package/dist/chunks/model-C2e73CJD.js +1 -0
- package/dist/chunks/model-CvmS-Esk.js +1 -0
- package/dist/chunks/model-DJ8mFfuR.js +1 -0
- package/dist/chunks/modelOptions-efCGKnXT.js +1 -0
- package/dist/chunks/nativeInstaller-DQIFwdat.js +1 -0
- package/dist/chunks/oauth-BN2I0_jl.js +1 -0
- package/dist/chunks/oauth-C9VBDB0Y.js +1 -0
- package/dist/chunks/observationStore-BpjlK0pG.js +3 -0
- package/dist/chunks/omit-CLPZGevl.js +1 -0
- package/dist/chunks/onChangeAppState-DhBO34OK.js +1 -0
- package/dist/chunks/{openai-EYRnUsco.js → openai-DJLYqiRl.js} +3 -3
- package/dist/chunks/{panel-BSZGX6jN.js → panel-q0_iT9cg.js} +1 -1
- package/dist/chunks/panelCall-sum-3zvi.js +1 -0
- package/dist/chunks/parser-BcdhBGx0.js +1 -0
- package/dist/chunks/{parser-DFwaTGf7.js → parser-BdCj2GrE.js} +1 -1
- package/dist/chunks/partition-CpfoVrg1.js +1 -0
- package/dist/chunks/permissions-DTb9wkAP.js +3 -0
- package/dist/chunks/pidLock-BR5M6RQw.js +3 -0
- package/dist/chunks/{pipeTransport-CqCnc-Ys.js → pipeTransport-B3TIkTAp.js} +1 -1
- package/dist/chunks/plan-BeoIjNPv.js +1 -0
- package/dist/chunks/{platform-BrYefG_2.js → platform-D6IMiyqT.js} +1 -1
- package/dist/chunks/plugin-D_dHjTud.js +17 -0
- package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +1 -0
- package/dist/chunks/pluginBlocklist-D93Hd1GF.js +1 -0
- package/dist/chunks/pluginCliCommands-vv0wNt4O.js +1 -0
- package/dist/chunks/pluginFlagging-CxuRF2Vc.js +1 -0
- package/dist/chunks/pluginOperations-BTq4AjYB.js +2 -0
- package/dist/chunks/pluginStartupCheck-B6leNWq9.js +1 -0
- package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +1 -0
- package/dist/chunks/plugins-pmipe7kE.js +4 -0
- package/dist/chunks/pollConfig-BgpfHQPJ.js +1 -0
- package/dist/chunks/{poorMode-CBOtooa0.js → poorMode-BxsyllUK.js} +1 -1
- package/dist/chunks/poorMode-iV1NwC5L.js +1 -0
- package/dist/chunks/print-CAUvczBM.js +23 -0
- package/dist/chunks/processBashCommand-CdeQg_c6.js +1 -0
- package/dist/chunks/processSlashCommand-CbkshIC6.js +5 -0
- package/dist/chunks/{projectContext-D9MDwJUF.js → projectContext-CIxul6vA.js} +1 -1
- package/dist/chunks/{projectContext-BaDZBAoK.js → projectContext-RUMJB798.js} +1 -1
- package/dist/chunks/prompt-CybUvG8G.js +139 -0
- package/dist/chunks/prompt-RBn4JdEg.js +1 -0
- package/dist/chunks/prompt-Rb8zXlDo.js +1 -0
- package/dist/chunks/promptEditor-0Ug93P2I.js +4 -0
- package/dist/chunks/{protocolHandler-JR8pASdH.js → protocolHandler-ClfbHTjI.js} +1 -1
- package/dist/chunks/{proxy-CRN7jYIi.js → proxy-Blq4W6Ox.js} +1 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +1 -0
- package/dist/chunks/reconciler-Drq3HSkj.js +4 -0
- package/dist/chunks/refresh-D8TLHO_T.js +1 -0
- package/dist/chunks/registerProtocol-3_ozAuDK.js +36 -0
- package/dist/chunks/reload-plugins-Dn1ibOiI.js +1 -0
- package/dist/chunks/remoteBridgeCore-Dpg6Se9C.js +1 -0
- package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +1 -0
- package/dist/chunks/rename-CKsSc7Z3.js +1 -0
- package/dist/chunks/{renderOptions-BUJB9nAm.js → renderOptions-CLcco6fc.js} +1 -1
- package/dist/chunks/replBridgeHandle-DNC797_T.js +1 -0
- package/dist/chunks/resume-B1a5gLVR.js +2 -0
- package/dist/chunks/ripgrep-BisRODQ2.js +1 -0
- package/dist/chunks/{ripgrep-BXmXjAzA.js → ripgrep-DkL2S7-I.js} +1 -1
- package/dist/chunks/{runtimeObserver-CiwnPFjK.js → runtimeObserver-B0xfyLiA.js} +1 -1
- package/dist/chunks/runtimeObserver-DonWCJOx.js +10 -0
- package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +1 -0
- package/dist/chunks/sandbox-toggle-CSdnHWp-.js +1 -0
- package/dist/chunks/searchExtraTools-DbgfnQkH.js +1 -0
- package/dist/chunks/session-BbQlh2S5.js +2 -0
- package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +1 -0
- package/dist/chunks/sessionIdCompat-DMayYBrf.js +1 -0
- package/dist/chunks/sessionMemory-7UOFdp29.js +1 -0
- package/dist/chunks/sessionMemory-fAzgAS7Q.js +1 -0
- package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +1 -0
- package/dist/chunks/sessionObserver-Cl26OdaW.js +1 -0
- package/dist/chunks/sessionObserver-XV6N0XER.js +20 -0
- package/dist/chunks/sessionState-BvECKycx.js +11 -0
- package/dist/chunks/sessionStorage-DSj9yZkl.js +1 -0
- package/dist/chunks/{sessionStoragePortable-Cx6JQ5Ye.js → sessionStoragePortable-JZnGwqUM.js} +1 -1
- package/dist/chunks/sessionTitle-E1FvsKM9.js +14 -0
- package/dist/chunks/sessionTracing-ClGQ08jM.js +11 -0
- package/dist/chunks/settings-B-R9ZJNY.js +1 -0
- package/dist/chunks/settings-Xbq6AaD-.js +20 -0
- package/dist/chunks/settingsSync-NCN0a4sc.js +1 -0
- package/dist/chunks/setup-uZ0dSekt.js +3 -0
- package/dist/chunks/shadowedRuleDetection-B9iSx6mB.js +1 -0
- package/dist/chunks/{shellQuote-DkSy9MYE.js → shellQuote-Bth6IZgX.js} +1 -1
- package/dist/chunks/{sideQuestion-hUhxls9r.js → sideQuestion-D2dPToW8.js} +3 -3
- package/dist/chunks/sinks-C7q46rvE.js +2 -0
- package/dist/chunks/sinks-D3bXeHlQ.js +1 -0
- package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +1 -0
- package/dist/chunks/skillGapStore-DylpOKJ6.js +5 -0
- package/dist/chunks/skillLifecycle-GK-8eyyn.js +8 -0
- package/dist/chunks/{skillSearchPanel-Cll9ccA5.js → skillSearchPanel-mpaC62y4.js} +4 -4
- package/dist/chunks/skills-t6krW8GZ.js +1 -0
- package/dist/chunks/{src-D06Xyj4g.js → src-BN7QRYLl.js} +1 -1
- package/dist/chunks/{src-CDCSSo0U2.js → src-P_wYS_NJ2.js} +1 -1
- package/dist/chunks/{src-CST_jFnT.js → src-r6ZFgWPx2.js} +1 -1
- package/dist/chunks/startupProfiler-BaiXZ9tr.js +1 -0
- package/dist/chunks/startupProfiler-jeId9f2i.js +3 -0
- package/dist/chunks/state-B4HwLt8i.js +1 -0
- package/dist/chunks/{state-Cn_m2NOf.js → state-BAGmpVBn.js} +1 -1
- package/dist/chunks/state-Bs5xweDL.js +1 -0
- package/dist/chunks/{staticRender-BIxpgNUq.js → staticRender-DrU6eWoq.js} +1 -1
- package/dist/chunks/{stats-CqfF4Axp.js → stats-BJBhl-Lc.js} +1 -1
- package/dist/chunks/{status-CC9Q-2Yn.js → status-BtsnKNVY.js} +1 -1
- package/dist/chunks/status-nZQEar7T.js +2 -0
- package/dist/chunks/statusNoticeHelpers-DMqRGFOh.js +1 -0
- package/dist/chunks/{stringUtils-DGLPkqJ4.js → stringUtils-CbS6OkmE.js} +1 -1
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +1 -0
- package/dist/chunks/{subprocessEnv-vrwzMgKn.js → subprocessEnv-Ci8VV_bi.js} +1 -1
- package/dist/chunks/switcher-77h2J5HC.js +1 -0
- package/dist/chunks/switcher-B2CYzCC_.js +1 -0
- package/dist/chunks/syncCache-By_-buUC.js +1 -0
- package/dist/chunks/tasks-BNrdmF9p.js +1 -0
- package/dist/chunks/teleport-mdnhIZBj.js +1 -0
- package/dist/chunks/{templateJobs-D1BdhZsv.js → templateJobs-Dkv4I9c1.js} +1 -1
- package/dist/chunks/{terminalSetup-Cn6jeYw1.js → terminalSetup-DQopnSPR.js} +1 -1
- package/dist/chunks/terminalSetup-DTGm1Eo2.js +33 -0
- package/dist/chunks/{theme-Cg4GNOoQ.js → theme-BjpBVRf5.js} +1 -1
- package/dist/chunks/{tmux-BY7IdQ1f.js → tmux-CMRiI6CD.js} +1 -1
- package/dist/chunks/{toolEventObserver-SFwURL5F.js → toolEventObserver-D-sNBvOe.js} +1 -1
- package/dist/chunks/toolPool-Di30gn_Y.js +1 -0
- package/dist/chunks/trustedDevice-CupLMpO8.js +1 -0
- package/dist/chunks/{trustedDevice-CKedohmT.js → trustedDevice-j1u2TG5U.js} +1 -1
- package/dist/chunks/{types-Dut4311z.js → types-DWRxAH0E.js} +2 -2
- package/dist/chunks/{udsClient-BuCtv7dN.js → udsClient-Cm3HqYUu.js} +1 -1
- package/dist/chunks/{updateCCB-C2G-U-qA.js → updateCCB-BlUAU2Vp.js} +8 -8
- package/dist/chunks/{upstreamproxy-DyR_eXO8.js → upstreamproxy-DDVMwoRi.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-D2FvHieH.js +1 -0
- package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +1 -0
- package/dist/chunks/useManagePlugins-BbWJNLe8.js +1 -0
- package/dist/chunks/useMergedTools-B-Z9XQ6U.js +1 -0
- package/dist/chunks/useSearchInput-C6d6nt9S.js +1 -0
- package/dist/chunks/useSettingsErrors-DKh4rkGi.js +1 -0
- package/dist/chunks/userAgent-Ng_TTjWr.js +1 -0
- package/dist/chunks/util-D-X8i5Z2.js +1 -0
- package/dist/chunks/validatePlugin-DSw08u76.js +1 -0
- package/dist/chunks/vim-3mUqsEJm.js +1 -0
- package/dist/chunks/{which-CKQnSouy.js → which-DznMOwny.js} +1 -1
- package/dist/chunks/windowsPaths-1mgenSWa.js +1 -0
- package/dist/chunks/{windowsPaths-DtapVxOo.js → windowsPaths-BVztIhXM.js} +1 -1
- package/dist/chunks/{workSecret-CNWiR2uQ.js → workSecret-DtiFreRl.js} +1 -1
- package/dist/chunks/workerRegistry-DdOYjLm3.js +6 -0
- package/dist/chunks/worktree-BX1ULzrw.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-CFrrXnt9.js +0 -1
- package/dist/chunks/App-Buad9Llp.js +0 -1
- package/dist/chunks/ApproveApiKey-B2HJUD7h.js +0 -1
- package/dist/chunks/ApproveApiKey-BQbHdvc3.js +0 -1
- package/dist/chunks/AssistantSessionChooser-4lm4eXQ8.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-D4qA0M5O.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-DllL8dxU.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog--ywODh81.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BZSyRqeq.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Wkfw7Ts-.js +0 -1
- package/dist/chunks/DesktopHandoff-DaP4Riar.js +0 -1
- package/dist/chunks/DiffDialog-B7hx8i_Y.js +0 -6
- package/dist/chunks/Doctor-89OgoAUA.js +0 -1
- package/dist/chunks/Doctor-CuKJ-nGt.js +0 -3
- package/dist/chunks/ExitFlow-DnPydE17.js +0 -2
- package/dist/chunks/Feedback-SmGiR3mf.js +0 -2
- package/dist/chunks/Grove-CjN9DO47.js +0 -11
- package/dist/chunks/Grove-Cq88VBmM.js +0 -1
- package/dist/chunks/InvalidConfigDialog-DdO0AxyF.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-s1G0DwXF.js +0 -1
- package/dist/chunks/ListItem-vfLXEPed.js +0 -1
- package/dist/chunks/MCPConnectionManager-NRfIjdlj.js +0 -1
- package/dist/chunks/McpParsingWarnings-Du5IxZos.js +0 -1
- package/dist/chunks/MessageSelector-iIroHvXo.js +0 -3
- package/dist/chunks/Messages-D4Hm4gaY.js +0 -11
- package/dist/chunks/Onboarding-BiZByBK-.js +0 -1
- package/dist/chunks/OverageCreditUpsell-BM7szLgm.js +0 -1
- package/dist/chunks/PluginSettings-uY5KTCtK.js +0 -17
- package/dist/chunks/PromptInputFooterSuggestions-BmsFdOu9.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-DX-0wEDo.js +0 -1
- package/dist/chunks/QueryEngine-CGYaShXD.js +0 -1
- package/dist/chunks/REPL-CRJB2t2z.js +0 -142
- package/dist/chunks/REPL-u4Yq29Du.js +0 -1
- package/dist/chunks/RemoteCallout-B-tyvQOe.js +0 -1
- package/dist/chunks/RemoteSessionManager-DCd0O5_l.js +0 -2
- package/dist/chunks/ResumeConversation-DAAXlOCd.js +0 -1
- package/dist/chunks/SearchBox-vfLXEPed.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-B-7Bworf.js +0 -1
- package/dist/chunks/Settings-CUjWlncb.js +0 -2
- package/dist/chunks/TeleportProgress-DxN0bQL2.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-A5Ss0kuk.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-Bz14mUqR.js +0 -1
- package/dist/chunks/ThemePicker-CVSRqTzW.js +0 -1
- package/dist/chunks/TrustDialog-CY8an_Tg.js +0 -1
- package/dist/chunks/TungstenTool-Cb7gJvq4.js +0 -1
- package/dist/chunks/TungstenTool-CxMQVCuF.js +0 -1
- package/dist/chunks/add-dir-DfLYgwox.js +0 -1
- package/dist/chunks/agents-DJtPfvnL.js +0 -103
- package/dist/chunks/allErrors-CQE2k0zO.js +0 -1
- package/dist/chunks/analytics-BotDBGh0.js +0 -1
- package/dist/chunks/ant-ClQkuQjZ.js +0 -1
- package/dist/chunks/api-2cdIPaeq.js +0 -1
- package/dist/chunks/api-CG-lhKe-.js +0 -1
- package/dist/chunks/asciicast-BsWpcxrc.js +0 -1
- package/dist/chunks/asciicast-CbAjUHT_.js +0 -4
- package/dist/chunks/assistant-Bje16tQx.js +0 -1
- package/dist/chunks/assistant-C83quuNj.js +0 -1
- package/dist/chunks/assistant-z2o4-UJe.js +0 -1
- package/dist/chunks/auth-DMfEiQrC.js +0 -1
- package/dist/chunks/auth-D_cGl8WD.js +0 -1
- package/dist/chunks/auth-DqcKPbw8.js +0 -15
- package/dist/chunks/autonomy-Oui8yK8G.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BpLtI45r.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DtJNx4Ja.js +0 -17
- package/dist/chunks/bg-B0iMGM9C.js +0 -1
- package/dist/chunks/branch-DU5O9KZ0.js +0 -3
- package/dist/chunks/bridge-DNNxtPlz.js +0 -2
- package/dist/chunks/bridgeConfig-DP9dD1Cv.js +0 -1
- package/dist/chunks/bridgeEnabled-Cc0mGlTb.js +0 -1
- package/dist/chunks/bridgeEnabled-D8wP3DWQ.js +0 -1
- package/dist/chunks/bridgeMain-CwxMa_pd.js +0 -1
- package/dist/chunks/bridgeMain-D11t1BYQ.js +0 -68
- package/dist/chunks/bridgeMessaging-DdvApEqW.js +0 -1
- package/dist/chunks/bridgePointer-DqHMHa2B.js +0 -1
- package/dist/chunks/browser-BmZuQom6.js +0 -1
- package/dist/chunks/btw-CejSEdNl.js +0 -1
- package/dist/chunks/caches-5HVQSevy.js +0 -3
- package/dist/chunks/caches-B-nJoHLM.js +0 -1
- package/dist/chunks/capacityWake-CV_x9H8j.js +0 -1
- package/dist/chunks/ccrClient-BFyfO67b.js +0 -1
- package/dist/chunks/client-DKXCfdde.js +0 -1
- package/dist/chunks/client-xxikkAoZ.js +0 -1
- package/dist/chunks/color-DWhgZH7A.js +0 -1
- package/dist/chunks/commands-CxJpmEKF.js +0 -1
- package/dist/chunks/commitAttribution-DM6SBMwl.js +0 -1
- package/dist/chunks/commitAttribution-DPnHHKSA.js +0 -2
- package/dist/chunks/compact-CblM7306.js +0 -2
- package/dist/chunks/completionCache-MN3_MqK8.js +0 -4
- package/dist/chunks/completionCache-c4aiyZ_f.js +0 -1
- package/dist/chunks/config-BLVBFi5v.js +0 -1
- package/dist/chunks/config-CMnqm6Se.js +0 -1
- package/dist/chunks/config-DRDuVyzE.js +0 -3
- package/dist/chunks/context-CdSMMM-0.js +0 -1
- package/dist/chunks/context-noninteractive-CPkf2vB9.js +0 -1
- package/dist/chunks/context-noninteractive-DNury4JI.js +0 -54
- package/dist/chunks/conversation-DCMw_rsE.js +0 -1
- package/dist/chunks/conversation-pUtvc-cE.js +0 -1
- package/dist/chunks/createSession-8Ei-Lj7V.js +0 -1
- package/dist/chunks/createSession-CjqxVh_Q.js +0 -1
- package/dist/chunks/cron-3LntnnhJ.js +0 -1
- package/dist/chunks/crossProjectResume-Bj_Pe8oe.js +0 -40
- package/dist/chunks/cwd--nvsx73T.js +0 -1
- package/dist/chunks/cwd-CYmmnQVS.js +0 -1
- package/dist/chunks/datadog-DqHxqiwY.js +0 -1
- package/dist/chunks/debugUtils-NO5KtXqi.js +0 -1
- package/dist/chunks/desktop-Z5FAfunZ.js +0 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +0 -1
- package/dist/chunks/directoryCompletion-CW2ckkQg.js +0 -1
- package/dist/chunks/doctor-BA2ZLDTl.js +0 -1
- package/dist/chunks/entry-DE0uMIf0.js +0 -14
- package/dist/chunks/envLessBridgeConfig-B-LKYNvv.js +0 -1
- package/dist/chunks/envLessBridgeConfig-DyD9XCda.js +0 -1
- package/dist/chunks/envUtils-DSxRz_kt.js +0 -1
- package/dist/chunks/esm-5w3xFBnt.js +0 -1
- package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +0 -1
- package/dist/chunks/exit-Dt9kHtJO.js +0 -1
- package/dist/chunks/extra-usage-C7E2Z1p1.js +0 -1
- package/dist/chunks/extra-usage-D0Kkjp-2.js +0 -1
- package/dist/chunks/extra-usage-core-DjdaD1qO.js +0 -1
- package/dist/chunks/extra-usage-noninteractive-BnD1RhKK.js +0 -1
- package/dist/chunks/extraUsage-CpgRTcMk.js +0 -1
- package/dist/chunks/extractMemories-DhUprYa7.js +0 -1
- package/dist/chunks/fast-C4ZevUNL.js +0 -1
- package/dist/chunks/fast-CChxlAAF.js +0 -1
- package/dist/chunks/feedback-BIhBhV6n.js +0 -1
- package/dist/chunks/file-DcZWPH2V.js +0 -12
- package/dist/chunks/fileStateCache-DDW5toIs.js +0 -1
- package/dist/chunks/files-Cz1-PK3r.js +0 -2
- package/dist/chunks/firstPartyEventLogger-BXY1IJ2D.js +0 -5
- package/dist/chunks/firstPartyEventLogger-CnkGSojw.js +0 -1
- package/dist/chunks/flushGate-CgHq81Gw.js +0 -1
- package/dist/chunks/gemini-C1J-x1g7.js +0 -1
- package/dist/chunks/generateRecap-C0jjCg0Z.js +0 -1
- package/dist/chunks/generateSessionName-w0BMtwS7.js +0 -1
- package/dist/chunks/git-CbcnOf0E.js +0 -1
- package/dist/chunks/git-Do0wJvux.js +0 -6
- package/dist/chunks/githubRepoPathMapping-8D0kpsif.js +0 -1
- package/dist/chunks/goal-B4GsR54_.js +0 -3
- package/dist/chunks/grok-ffNyU3Lt.js +0 -1
- package/dist/chunks/grove-BQisE2JM.js +0 -7
- package/dist/chunks/heapdump-DiCjAPR3.js +0 -5
- package/dist/chunks/help-2hn8VK2-.js +0 -1
- package/dist/chunks/hooks-CBmrBO-J.js +0 -1
- package/dist/chunks/hostGuard-BHI6Q8Mt.js +0 -1
- package/dist/chunks/inboundAttachments-C5K3XPTC.js +0 -1
- package/dist/chunks/inboundAttachments-IH-g95jo.js +0 -1
- package/dist/chunks/index.min-D75yiGLN.js +0 -1
- package/dist/chunks/initReplBridge-C-P4dgAG.js +0 -1
- package/dist/chunks/keybindings-D8FXoO89.js +0 -2
- package/dist/chunks/language-Baosud0X.js +0 -1
- package/dist/chunks/launchAgentsPlatform-D6DmNuDt.js +0 -1
- package/dist/chunks/launchCommand-1qkTCKpf.js +0 -1
- package/dist/chunks/launchLocalMemory-C0FzUq7x.js +0 -3
- package/dist/chunks/launchLocalVault-DkYAre4O.js +0 -3
- package/dist/chunks/launchMemoryStores-D2rKWAPs.js +0 -1
- package/dist/chunks/launchOnboarding-gOVAFEFp.js +0 -8
- package/dist/chunks/launchSchedule-IZdFstT_.js +0 -1
- package/dist/chunks/launchSkillStore-B7LamM1d.js +0 -1
- package/dist/chunks/launchTeleport-C2BQMfYP.js +0 -3
- package/dist/chunks/launchVault-C60WUcCI.js +0 -1
- package/dist/chunks/lib-rQZENxQg.js +0 -8
- package/dist/chunks/loadAgentsDir-B9c3Emvg.js +0 -1
- package/dist/chunks/loadPluginHooks-BhNdAjeY.js +0 -1
- package/dist/chunks/localSearch-BLCGsdyM.js +0 -1
- package/dist/chunks/log-BMCygSzM.js +0 -1
- package/dist/chunks/logoV2Utils-gGK9gErT.js +0 -1
- package/dist/chunks/main-OWFSddRx.js +0 -859
- package/dist/chunks/managedEnv-BHoeDjpS.js +0 -1
- package/dist/chunks/mcp-BSNdwbxR.js +0 -1
- package/dist/chunks/mcp-CMnDNI-4.js +0 -6
- package/dist/chunks/mcp-D1yA9E56.js +0 -2
- package/dist/chunks/memoize-B0zhbT8Z.js +0 -1
- package/dist/chunks/memory-D1zbyjxN.js +0 -1
- package/dist/chunks/mode-DY087x_x.js +0 -2
- package/dist/chunks/model-CZViyZnE.js +0 -1
- package/dist/chunks/model-D0EfJBuw.js +0 -1
- package/dist/chunks/model-DLLkVV6S.js +0 -1
- package/dist/chunks/nativeInstaller-yj81F75v.js +0 -1
- package/dist/chunks/oauth-BqJqV-2M.js +0 -1
- package/dist/chunks/oauth-C8X_p8Gc.js +0 -1
- package/dist/chunks/observationStore-DzCdXq8U.js +0 -4
- package/dist/chunks/onChangeAppState-DhGKPG9g.js +0 -1
- package/dist/chunks/output-style-BM3qAHLA.js +0 -1
- package/dist/chunks/overageCreditGrant-Du3dOYVu.js +0 -1
- package/dist/chunks/p-map-B1EeBuI8.js +0 -1
- package/dist/chunks/p-map-HKDr3iDo.js +0 -1
- package/dist/chunks/panel-Be-OxtqL.js +0 -1
- package/dist/chunks/panelCall-dMvRPAGE.js +0 -1
- package/dist/chunks/parser-Bf6iasPV.js +0 -1
- package/dist/chunks/partition-C4FWzYVm.js +0 -1
- package/dist/chunks/passes-Daz-ARWD.js +0 -1
- package/dist/chunks/path-D5U-tm91.js +0 -1
- package/dist/chunks/permissions-CeYKbtSC.js +0 -1
- package/dist/chunks/permissions-Cn_6f8CB.js +0 -1
- package/dist/chunks/permissions-DF8tAmDF.js +0 -3
- package/dist/chunks/pidLock-CbC_il6r.js +0 -3
- package/dist/chunks/plan-rsb_83Fo.js +0 -1
- package/dist/chunks/plugin-Cm31-nej.js +0 -1
- package/dist/chunks/pluginAutoupdate-0k03PVff.js +0 -1
- package/dist/chunks/pluginBlocklist-wPFCUPdm.js +0 -1
- package/dist/chunks/pluginCliCommands-DhL9LbH0.js +0 -1
- package/dist/chunks/pluginFlagging-CAdaFV_D.js +0 -1
- package/dist/chunks/pluginOperations-Cs_Z4C6O.js +0 -2
- package/dist/chunks/pluginStartupCheck-BRXGKGjG.js +0 -1
- package/dist/chunks/pluginStartupCheck-KeU0efTj.js +0 -1
- package/dist/chunks/plugins-CQNKZmjP.js +0 -4
- package/dist/chunks/policyLimits-D2s8M8P2.js +0 -1
- package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
- package/dist/chunks/poor-DXumVTR4.js +0 -1
- package/dist/chunks/poorMode-yNZL5uYf.js +0 -1
- package/dist/chunks/print-uxCF5ka5.js +0 -23
- package/dist/chunks/privacy-settings-BncbJCV0.js +0 -1
- package/dist/chunks/processBashCommand-CGdwvPmD.js +0 -1
- package/dist/chunks/processSlashCommand-DQarepEb.js +0 -5
- package/dist/chunks/prompt-BgOdcHkd.js +0 -1
- package/dist/chunks/prompt-CE3sFmZV.js +0 -139
- package/dist/chunks/prompt-CLJKFebn.js +0 -1
- package/dist/chunks/promptEditor-CyTzyjwG.js +0 -4
- package/dist/chunks/rate-limit-options-C-EqWjeI.js +0 -1
- package/dist/chunks/rcDebugLog-DBB9r8aw.js +0 -11
- package/dist/chunks/reconciler-CYD_XpG4.js +0 -4
- package/dist/chunks/referral-CKmHHxj_.js +0 -1
- package/dist/chunks/refresh-ZqZdmLK5.js +0 -1
- package/dist/chunks/registerProtocol-wZv2uiW_.js +0 -36
- package/dist/chunks/release-notes-B5K7wVqZ.js +0 -4
- package/dist/chunks/releaseNotes-B8gbyFFJ.js +0 -2
- package/dist/chunks/reload-plugins-B9ApSp2m.js +0 -1
- package/dist/chunks/remote-env-CAt1dHIS.js +0 -1
- package/dist/chunks/remoteBridgeCore-Bk3UdSLJ.js +0 -1
- package/dist/chunks/remoteManagedSettings-bswzAB6W.js +0 -1
- package/dist/chunks/rename-CE_U6KE6.js +0 -1
- package/dist/chunks/resume-BicEjsPd.js +0 -2
- package/dist/chunks/ripgrep-BfIpz5uC.js +0 -1
- package/dist/chunks/rollback-BPWRKlIZ.js +0 -11
- package/dist/chunks/runtimeObserver-BrGF5QWX.js +0 -10
- package/dist/chunks/sandbox-adapter-BtMiHImm.js +0 -1
- package/dist/chunks/sandbox-toggle-D8eebdyI.js +0 -1
- package/dist/chunks/sanitization-DV-94a9Z.js +0 -1
- package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +0 -1
- package/dist/chunks/searchExtraTools-hLLPuh7c.js +0 -1
- package/dist/chunks/semver-BMRJYn3q.js +0 -1
- package/dist/chunks/session-BZIlR9Gc.js +0 -2
- package/dist/chunks/sessionDataUploader-CaCjwsA2.js +0 -1
- package/dist/chunks/sessionDiscovery-DfDqTrF1.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Bm8wiqwe.js +0 -1
- package/dist/chunks/sessionMemory-D37S0-jX.js +0 -1
- package/dist/chunks/sessionMemory-DmlAG3jq.js +0 -1
- package/dist/chunks/sessionMemoryUtils-6EWDHSGU.js +0 -1
- package/dist/chunks/sessionObserver-BUw2rzKl.js +0 -1
- package/dist/chunks/sessionObserver-KgquhGWw.js +0 -20
- package/dist/chunks/sessionStorage-CucBSK5Q.js +0 -1
- package/dist/chunks/sessionTitle-DAnM73S0.js +0 -14
- package/dist/chunks/sessionTracing-_Hh5VXxt.js +0 -11
- package/dist/chunks/settings-BeLFUeie.js +0 -19
- package/dist/chunks/settings-Cl16Haug.js +0 -1
- package/dist/chunks/settingsSync-BNvFYH3c.js +0 -1
- package/dist/chunks/setup-D8kXv3ts.js +0 -3
- package/dist/chunks/shadowedRuleDetection-C6R5zOUe.js +0 -1
- package/dist/chunks/sinks-BuE17DeZ.js +0 -2
- package/dist/chunks/sinks-FevoYQqP.js +0 -1
- package/dist/chunks/skill-learning-CMdxGtxr.js +0 -5
- package/dist/chunks/skillChangeDetector-C65ZLSYV.js +0 -1
- package/dist/chunks/skillGapStore-D18LRJAM.js +0 -5
- package/dist/chunks/skillGapStore-Ep62R-2_.js +0 -1
- package/dist/chunks/skillGenerator-Bc7WwNT8.js +0 -8
- package/dist/chunks/skillLearning-Cs9fJgkV.js +0 -1
- package/dist/chunks/skillLearning-duPZl69A.js +0 -1
- package/dist/chunks/skillPanel-Cyzby746.js +0 -28
- package/dist/chunks/skills-BPPeYBy7.js +0 -1
- package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +0 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +0 -1
- package/dist/chunks/startupProfiler-xa3NmN7Z.js +0 -3
- package/dist/chunks/state-BOa-3Av3.js +0 -1
- package/dist/chunks/state-ix0xIunV.js +0 -1
- package/dist/chunks/status-D4IQpsNK.js +0 -2
- package/dist/chunks/statusNoticeHelpers-CEGvdm5d.js +0 -1
- package/dist/chunks/stickers-D5teCKMN.js +0 -1
- package/dist/chunks/subprocessEnv-BSQSomcK.js +0 -1
- package/dist/chunks/syncCache-CANQZ9mQ.js +0 -1
- package/dist/chunks/systemPromptSections-CR_AoPIX.js +0 -1
- package/dist/chunks/systemPromptSections-DN0HGVye.js +0 -1
- package/dist/chunks/tag-DDbNqBMu.js +0 -11
- package/dist/chunks/tasks-CZvWJYGr.js +0 -1
- package/dist/chunks/teleport-Dk5j03Ix.js +0 -1
- package/dist/chunks/terminalSetup-3JNy6i_J.js +0 -33
- package/dist/chunks/thinkback-p-vKIRW_.js +0 -1
- package/dist/chunks/thinkback-play-DnPTDE8B.js +0 -1
- package/dist/chunks/thinkback-rFA1do6F.js +0 -1
- package/dist/chunks/toolEventObserver-CzsCuUMc.js +0 -1
- package/dist/chunks/toolPool-BR27AMJO.js +0 -1
- package/dist/chunks/trustedDevice-BYt39fui.js +0 -1
- package/dist/chunks/tui-C2yuCuOU.js +0 -6
- package/dist/chunks/types-Bh9S_JG5.js +0 -3
- package/dist/chunks/types-DHkZVzJe.js +0 -1
- package/dist/chunks/ultrareviewCommand-C_4OSBTW.js +0 -3
- package/dist/chunks/undercover-D30rKimg.js +0 -31
- package/dist/chunks/undercover-DRSwLozU.js +0 -1
- package/dist/chunks/up-BHkC97_C.js +0 -12
- package/dist/chunks/upgrade-Bi-bIz7R.js +0 -1
- package/dist/chunks/upgrade-Chs-OQFd.js +0 -1
- package/dist/chunks/upload-D8FWMSQx.js +0 -1
- package/dist/chunks/usage-BxVeUt60.js +0 -1
- package/dist/chunks/usage-DUO7Yy1f.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js +0 -1
- package/dist/chunks/useMainLoopModel-Gy1Vv4Qr.js +0 -1
- package/dist/chunks/useManagePlugins-B11_87VN.js +0 -1
- package/dist/chunks/useMergedTools-CR56my9t.js +0 -1
- package/dist/chunks/useSearchInput-C5OzQnX6.js +0 -1
- package/dist/chunks/useSettingsErrors-B9vOZL41.js +0 -1
- package/dist/chunks/util-8EHwfg4A.js +0 -1
- package/dist/chunks/validatePlugin-6q1qmnAC.js +0 -1
- package/dist/chunks/vim-CNDzwoTd.js +0 -1
- package/dist/chunks/windowsPaths-9pEkw0oV.js +0 -1
- package/dist/chunks/workerRegistry-CvyHvwx-.js +0 -1
- package/dist/chunks/worktree-ogmNCIpz.js +0 -1
|
@@ -1,859 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-DaDcL9Zw.js";import{n as o,t as s}from"./memoize-BK3gG5ob.js";import{a as c,d as l,f as u,l as d,o as f,s as p,u as m}from"./envUtils-DSxRz_kt.js";import{n as ee,t as h}from"./defineProperty-C-QyHrDq.js";import{n as te,t as ne}from"./axios-DaWTGg7G.js";import{B as re,D as ie,I as ae,Lt as oe,P as se,R as ce,T as g,di as _,fi as le,rr as ue,t as de,ui as v,xr as fe,y as pe}from"./src-CDCSSo0U2.js";import{t as me}from"./jsx-runtime-Bb4Xn-E0.js";import{D as he,F as ge,N as y,P as _e,f as ve,g as ye,j as be,n as xe,p as Se,r as b,t as Ce}from"./lazySchema-DULtBUCI.js";import{An as we,En as Te,F as Ee,Gn as De,Mn as Oe,Nn as ke,Or as Ae,Pn as je,Sn as Me,Un as Ne,Wn as Pe,X as Fe,Zn as Ie,ar as Le,cr as Re,dr as x,en as S,gn as C,gr as ze,ht as Be,jn as Ve,kr as He,lr as Ue,mn as We,mt as Ge,nt as Ke,or as qe,pr as Je,pt as Ye,qt as Xe,rr as w,ur as Ze,vr as Qe,xn as $e,yn as et,z as tt}from"./state-ix0xIunV.js";import{$C as nt,$E as rt,$S as it,$g as at,$v as ot,AC as st,AD as T,AE as ct,AS as lt,A_ as ut,Ac as dt,At as ft,Ay as pt,C as mt,CE as ht,C_ as gt,Co as _t,Cr as vt,DS as yt,Dt as bt,Dy as xt,ES as St,E_ as Ct,Et as wt,Ey as Tt,FT as Et,F_ as Dt,Fa as Ot,Fi as kt,Gl as At,Ha as jt,Hi as Mt,Hu as Nt,I as Pt,Ia as Ft,JC as It,Jg as Lt,Jo as Rt,Ju as zt,Kg as Bt,LT as Vt,La as Ht,Ld as Ut,Ln as E,Lp as Wt,Ly as Gt,ME as Kt,M_ as D,Mo as O,N as qt,NS as k,Nn as A,Ny as Jt,O as Yt,OE as Xt,O_ as Zt,Oc as Qt,Ol as $t,Oy as en,PE as tn,PS as nn,P_ as rn,Pa as an,Pi as on,Pl as sn,Py as cn,QS as ln,Qd as un,Qg as dn,Qi as fn,Qv as pn,Ra as mn,Rd as hn,Rn as gn,Rp as _n,Ry as vn,SE as yn,SS as bn,S_ as j,Sf as xn,T as Sn,TC as Cn,TD as wn,TS as Tn,T_ as En,Ti as Dn,Ty as On,UE as kn,Uu as An,V_ as jn,WE as Mn,Wg as Nn,Wl as Pn,XC as Fn,Xg as In,Xn as Ln,Xr as Rn,YC as zn,Yg as Bn,Yh as Vn,Yi as Hn,Yo as Un,Yx as Wn,ZS as M,Zd as Gn,Zg as Kn,_D as qn,__ as Jn,_a as Yn,_l as Xn,_s as Zn,_y as Qn,aC as $n,aE as er,a_ as tr,as as nr,at as rr,bb as ir,bs as ar,by as or,cD as sr,c_ as cr,cy as lr,dC as ur,d_ as dr,dh as fr,dm as pr,e_ as mr,f as hr,fC as gr,fh as _r,fo as vr,fx as yr,gO as br,ga as N,gh as xr,gi as Sr,hO as Cr,ha as P,hh as wr,ho as Tr,i as Er,iC as Dr,i_ as Or,iw as kr,ix as Ar,j as jr,jD as Mr,j_ as Nr,jl as Pr,jr as Fr,jy as Ir,k as Lr,kC as Rr,kS as zr,kl as Br,ky as Vr,l_ as Hr,lf as Ur,mh as Wr,nC as Gr,n_ as Kr,nd as qr,ng as Jr,nw as Yr,o as Xr,oC as Zr,oD as Qr,ot as $r,ox as ei,oy as ti,pD as ni,pm as ri,px as ii,qi as ai,qu as oi,r as si,rC as ci,rD as li,r_ as ui,rc as di,rg as fi,rx as pi,s as mi,s_ as hi,sf as gi,ss as _i,sw as vi,sx as yi,sy as bi,tC as xi,tE as Si,tS as Ci,t_ as wi,tc as Ti,td as Ei,tg as Di,ts as Oi,uD as ki,u_ as Ai,uh as ji,um as Mi,v as Ni,vD as Pi,vl as Fi,vs as Ii,vy as Li,w as Ri,wC as zi,wD as Bi,wE as Vi,wS as Hi,w_ as Ui,wi as Wi,wt as Gi,wy as Ki,xS as qi,x_ as Ji,xf as Yi,y as Xi,yC as Zi,y_ as Qi,yb as $i,yr as ea,ys as ta,z_ as na,za as ra,zy as ia}from"./loadAgentsDir-x3rlgED4.js";import{n as aa,t as oa}from"./cwd-CYmmnQVS.js";import{C as sa,E as ca,F,I as la,N as ua,S as da,V as fa,W as pa,_ as ma,a as ha,d as ga,k as _a,l as I,n as va,nt as ya,p as ba,r as xa,rt as Sa,u as Ca,w as wa,z as Ta}from"./debug-BrXObCdR.js";import{J as Ea,Lt as Da,O as Oa,S as ka,T as Aa,c as ja,et as Ma,f as Na,g as L,h as Pa,hn as Fa,i as Ia,it as La,k as Ra,n as za,pn as Ba,q as Va,s as Ha,u as Ua,vn as Wa,x as R,xn as Ga,yn as Ka}from"./settings-BeLFUeie.js";import{D as qa,E as Ja,I as Ya,P as Xa,_ as Za,b as z,c as B,g as V,j as Qa,m as $a,n as eo,o as to,r as no,s as ro,v as io,y as ao}from"./config-DRDuVyzE.js";import{a as oo,n as so,r as co}from"./process-gEbdy6uY.js";import{M as H,_ as lo,d as uo,h as fo,i as po,j as mo,p as ho,r as go}from"./git-Do0wJvux.js";import{c as _o,o as vo}from"./execFileNoThrow-D244NytW.js";import{d as yo,f as bo,o as xo,s as U}from"./log-BMCygSzM.js";import{n as So,t as Co}from"./which-CKQnSouy.js";import{i as wo,o as To}from"./platform-BrYefG_2.js";import{i as Eo,o as Do}from"./windowsPaths-DtapVxOo.js";import{s as Oo,u as ko}from"./types-Dut4311z.js";import{n as W,r as G}from"./analytics-BotDBGh0.js";import{a as Ao,b as jo,d as Mo,i as K,n as No}from"./startupProfiler-xa3NmN7Z.js";import{l as Po,s as Fo,u as Io}from"./oauth-BqJqV-2M.js";import{n as Lo,t as Ro}from"./bundledMode--fG1S62b.js";import{l as zo,o as Bo}from"./stringUtils-DGLPkqJ4.js";import{r as Vo}from"./permissions-Cn_6f8CB.js";import{$t as Ho,Bt as Uo,C as Wo,Dn as Go,Ft as Ko,Jn as qo,Kn as Jo,Ot as Yo,Rr as Xo,S as Zo,Si as Qo,Tr as $o,Vn as es,Vr as ts,Xt as ns,Yn as rs,Z as is,_ as as,an as os,ar as ss,b as cs,bn as ls,cr as us,en as ds,et as fs,g as ps,ii as ms,in as hs,ir as gs,jn as _s,lt as vs,o as ys,oi as bs,or as xs,pn as Ss,rr as Cs,rt as ws,sr as Ts,ut as Es,v as Ds,wi as Os,wr as ks,xn as As,xt as js,yn as Ms,zt as Ns}from"./model-CZViyZnE.js";import{Bt as Ps,Et as Fs,Pt as Is,Rt as Ls,Tt as Rs,Ut as zs,Vt as Bs,dt as Vs,ft as Hs,ut as Us,zt as Ws}from"./prompt-CE3sFmZV.js";import{f as Gs,h as Ks,l as qs,n as Js}from"./proxy-CRN7jYIi.js";import{dt as Ys,ft as Xs}from"./esm-5w3xFBnt.js";import{n as Zs,t as Qs}from"./partition-C4FWzYVm.js";import{a as $s,n as ec}from"./ripgrep-BXmXjAzA.js";import{C as tc,D as nc,O as rc,y as ic}from"./rcDebugLog-DBB9r8aw.js";import{D as ac,O as oc,_ as sc,v as cc}from"./sessionTracing-_Hh5VXxt.js";import{l as lc,r as uc}from"./commitAttribution-DPnHHKSA.js";import{i as dc,n as fc,o as pc,r as mc}from"./detectRepository-BPr0VWNO.js";import{l as hc,o as gc,r as _c}from"./api-2cdIPaeq.js";import{d as vc,f as yc,l as bc,p as xc,u as Sc}from"./firstPartyEventLogger-BXY1IJ2D.js";import{c as Cc,s as wc}from"./referral-CKmHHxj_.js";import{n as Tc,t as Ec}from"./worktreeModeEnabled-BFOYTTTr.js";import{i as Dc,t as Oc}from"./assistant-C83quuNj.js";import{c as kc,l as Ac}from"./releaseNotes-B8gbyFFJ.js";import{a as jc,o as Mc}from"./grove-BQisE2JM.js";import{a as Nc,i as Pc,n as Fc,o as Ic,r as Lc}from"./remoteManagedSettings-bswzAB6W.js";import{n as Rc,t as zc}from"./allErrors-CQE2k0zO.js";import{n as Bc,t as q}from"./exit-BOhGfSlm.js";import{n as Vc,s as Hc,t as Uc}from"./pluginOperations-Cs_Z4C6O.js";import"./pluginCliCommands-DhL9LbH0.js";import{n as Wc,r as Gc,t as Kc}from"./managedEnv-Aq5BXfY7.js";import{n as qc}from"./onChangeAppState-DhGKPG9g.js";import{n as Jc}from"./asciicast-CbAjUHT_.js";import{i as Yc,t as Xc}from"./skillChangeDetector-C65ZLSYV.js";import{n as Zc}from"./stats-CqfF4Axp.js";import{t as Qc}from"./renderOptions-BUJB9nAm.js";import{i as $c,n as el,t as tl}from"./githubRepoPathMapping-8D0kpsif.js";import{i as nl,n as rl}from"./earlyInput-BTC_Wucv.js";import{t as il}from"./banner-CWkrK10u.js";import{c as al,n as ol,r as sl,u as cl}from"./RemoteSessionManager-DCd0O5_l.js";import{posix as ll,relative as ul,resolve as dl,win32 as fl}from"path";import{appendFileSync as pl,readFileSync as ml}from"fs";import{open as hl,stat as gl}from"fs/promises";var _l=a((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),vl=a((e=>{var{InvalidArgumentError:t}=_l(),n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),yl=a((e=>{var{humanReadableArgName:t}=vl(),n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
|
-
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
|
-
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
|
-
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),bl=a((e=>{var{InvalidArgumentError:t}=_l(),n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
5
|
-
- a short flag is a single dash and a single character
|
|
6
|
-
- either use a single dash and a single character (for a short flag)
|
|
7
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
|
|
8
|
-
- too many short flags`):i.test(t)?Error(`${n}
|
|
9
|
-
- too many long flags`):Error(`${n}
|
|
10
|
-
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),xl=a((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),Sl=a((e=>{var n=t(`node:events`).EventEmitter,r=t(`node:child_process`),i=t(`node:path`),a=t(`node:fs`),o=t(`node:process`),{Argument:s,humanReadableArgName:c}=vl(),{CommanderError:l}=_l(),{Help:u,stripColor:d}=yl(),{Option:f,DualOptions:p}=bl(),{suggestSimilar:m}=xl(),ee=class e extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>o.stdout.write(e),writeErr:e=>o.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>te()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>te()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:e=>d(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i=i||{};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
|
|
11
|
-
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new s(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
|
|
12
|
-
Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new l(e,t,n)),o.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new f(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
13
|
-
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0||e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??(t=e.negate?!1:e.isBoolean()||e.optional?!0:``),this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof f)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t=t||{},e===void 0&&t.from===void 0){o.versions?.electron&&(t.from=`electron`);let e=o.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=o.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:o.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
14
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(a.existsSync(e))return;let r=`'${e}' does not exist
|
|
15
|
-
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
16
|
-
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
17
|
-
- ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=i.resolve(e,t);if(a.existsSync(n))return n;if(s.includes(i.extname(t)))return;let r=s.find(e=>a.existsSync(`${n}${e}`));if(r)return`${n}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=i.resolve(i.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=i.basename(this._scriptPath,i.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}n=s.includes(i.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=h(o.execArgv).concat(t),f=r.spawn(o.argv[0],t,{stdio:`inherit`})):f=r.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e=e??1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
18
|
-
`),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in o.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=m(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=m(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||`-V, --version`,n=n||`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>c(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(o.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
|
|
19
|
-
Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function te(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=ee,e.useColor=te})),Cl=a((e=>{var{Argument:t}=vl(),{Command:n}=Sl(),{CommanderError:r,InvalidArgumentError:i}=_l(),{Help:a}=yl(),{Option:o}=bl();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})),wl=a(((e,t)=>{var n=Cl();e=t.exports={},e.program=new n.Command,e.Argument=n.Argument,e.Command=n.Command,e.CommanderError=n.CommanderError,e.Help=n.Help,e.InvalidArgumentError=n.InvalidArgumentError,e.InvalidOptionArgumentError=n.InvalidArgumentError,e.Option=n.Option,e.createCommand=e=>new n.Command(e),e.createOption=(e,t)=>new n.Option(e,t),e.createArgument=(e,t)=>new n.Argument(e,t)}));s(),f(),ee(),Ae(),S(),ya(),Ta(),da(),ba(),so(),ha(),W(),No(),Oa(),ls();var{program:Tl,createCommand:El,createArgument:Dl,createOption:Ol,CommanderError:kl,InvalidArgumentError:Al,InvalidOptionArgumentError:jl,Command:Ml,Argument:Nl,Option:J,Help:Pl}=r(wl(),1).default;ne();var Fl=r(le(),1);_();var Y=me();de(),b(),aa(),mo(),_o(),xo(),Co(),lo(),To(),Eo(),Ka(),Oo(),jo(),Ba(),Ce(),Ro(),La(),Bo(),Aa(),L(),Xa(),Cr(),Os(),Ja(),V(),Ks(),qs(),bs(),Xo(),ks(),Ts(),xs(),Cs(),qo(),Jo(),_s(),Uo(),as(),T(),Bi(),$s(),sr(),zs(),Ls(),Vs(),Kt(),Vi(),st(),Cn(),Zi(),yc(),it(),rc(),pn(),jn(),D(),Qi(),wi(),Nn(),Jr(),_r(),Mi(),Ec(),An(),Br(),ta(),Ii(),nr(),O(),an(),P(),fn(),kt(),Fr(),E(),rr(),Io(),yo();var Il=!1;function Ll(){if(Il||(Il=!0,bo())||d(process.env.CLAUDE_CODE_USE_BEDROCK)||d(process.env.CLAUDE_CODE_USE_VERTEX)||d(process.env.CLAUDE_CODE_USE_FOUNDRY)||process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||process.env.ANTHROPIC_UNIX_SOCKET||process.env.CLAUDE_CODE_CLIENT_CERT||process.env.CLAUDE_CODE_CLIENT_KEY)return;let e=process.env.ANTHROPIC_BASE_URL||Po().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Rl(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=zl();e&&(process.env.NODE_EXTRA_CA_CERTS=e,I(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function zl(){try{let e=B()?.env,t=ja(`userSettings`)?.env;I(`CA certs: Config fallback - globalEnv keys: ${e?Object.keys(e).join(`,`):`none`}, settingsEnv keys: ${t?Object.keys(t).join(`,`):`none`}`);let n=t?.NODE_EXTRA_CA_CERTS||e?.NODE_EXTRA_CA_CERTS;return n&&I(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){I(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}V(),ha(),dc(),Xs(),f(),Gc(),sc(),oc(),Sc();var Bl=!1,Vl=o(async()=>{let e=Date.now();H(`info`,`init_started`),K(`init_function_start`);try{let t=Date.now();no(),re({loadTheme:()=>B().theme,saveTheme:e=>z(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),K(`init_configs_enabled`);let n=Date.now();Wc(),Rl(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),K(`init_safe_env_vars_applied`),xi(),K(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-CnkGSojw.js`).then(e=>{e.initialize1PEventLogging()}),K(`init_after_1p_event_logging`),import(`./poller-CpLBoB-N.js`).then(e=>e.startBalancePolling()),K(`init_after_balance_polling`),ts(),K(`init_after_oauth_populate`),Ys(),K(`init_after_jetbrains_detection`),fc(),Lc()&&Fc(),Ht()&&Ot(),K(`init_after_remote_settings_check`),io();let r=Date.now();I(`[init] configureGlobalMTLS starting`),Gs(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),I(`[init] configureGlobalMTLS complete`);let i=Date.now();if(I(`[init] configureGlobalAgents starting`),Js(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),I(`[init] configureGlobalAgents complete`),K(`init_network_configured`),await bc(),Ll(),d(process.env.CLAUDE_CODE_REMOTE))try{let{initUpstreamProxy:e,getUpstreamProxyEnv:t}=await import(`./upstreamproxy-DyR_eXO8.js`),{registerUpstreamProxyEnvFn:n}=await import(`./subprocessEnv-BSQSomcK.js`);n(t),await e()}catch(e){I(`[init] upstreamproxy init failed: ${e instanceof Error?e.message:String(e)}; continuing without proxy`,{level:`warn`})}if(Do(),Sa(ri),gn()){let e=Date.now();await A(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-BfIpz5uC.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{I(`[init] ripgrep status check skipped`)}H(`info`,`init_completed`,{duration_ms:Date.now()-e}),K(`init_function_end`)}catch(e){if(e instanceof _a){if(tt()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),ln(1);return}return import(`./InvalidConfigDialog-DdO0AxyF.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Hl(){Lc()?(tt()&&cc()&&Ul().catch(e=>{I(`[3P telemetry] Eager telemetry init failed (beta tracing): ${F(e)}`,{level:`error`})}),I(`[3P telemetry] Waiting for remote managed settings before telemetry init`),Ic().then(async()=>{I(`[3P telemetry] Remote managed settings loaded, initializing telemetry`),Kc(),await Ul()}).catch(e=>{I(`[3P telemetry] Telemetry init failed (remote settings path): ${F(e)}`,{level:`error`})})):Ul().catch(e=>{I(`[3P telemetry] Telemetry init failed: ${F(e)}`,{level:`error`})})}async function Ul(){if(!Bl){if(!d(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){Bl=!0,I(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}Bl=!0;try{await Wl()}catch(e){throw Bl=!1,e}}}async function Wl(){let{initializeTelemetry:e}=await import(`./instrumentation-Yt31gxWN.js`),t=await e();t&&(De(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...ac(),...t};r?.add(e,n)}}}),Ge()?.add(1))}Ci();async function Gl(e,t,n,r){let{App:i}=await import(`./App-Buad9Llp.js`),{REPL:a}=await import(`./REPL-u4Yq29Du.js`);await r(e,(0,Y.jsx)(i,{...t,children:(0,Y.jsx)(a,{...n})}))}Yn(),Io(),V(),ha(),yo();var Kl=xe(()=>he({client_data:be(y(),ge()).nullish(),additional_model_options:ye(he({model:y(),name:y(),description:y()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function ql(){if(bo())return I(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(Qo()!==`firstParty`)return I(`[Bootstrap] Skipped: 3P provider`),null;let e=js();if(!(Yo()?.accessToken&&Ns())&&!e)return I(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${Po().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await gs(async()=>{let n=Yo()?.accessToken,r;if(n&&Ns())r={Authorization:`Bearer ${n}`,"anthropic-beta":Fo};else if(e)r={"x-api-key":e};else return I(`[Bootstrap] No auth available on retry, aborting`),null;I(`[Bootstrap] Fetching`);let i=await te.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ss(),...r},timeout:5e3}),a=Kl().safeParse(i.data);return a.success?(I(`[Bootstrap] Fetch ok`),a.data):(I(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw I(`[Bootstrap] Fetch failed: ${te.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function Jl(){try{let e=await ql();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=B();if(us(r.clientDataCache,t)&&us(r.additionalModelOptionsCache,n)){I(`[Bootstrap] Cache unchanged, skipping write`);return}I(`[Bootstrap] Cache updated, persisting to disk`),z(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){U(e)}}fs(),qn(),gc(),pt(),wc(),ha(),f();var Yl=new Map;function Xl(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;wo()===`windows`&&(e=e.split(fl.sep).join(ll.sep),t=t.split(fl.sep).join(ll.sep));let n=[e,t],r=[`/build-ant/`,`/build-external/`,`/build-external-native/`,`/build-ant-native/`];return n.some(e=>r.some(t=>e.includes(t)))}var Zl=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Ql(e){let t=`${e.name}: ${e.message}`;return Zl.some(e=>e.test(t))}var $l=null;function eu(){let e=process.listeners(`warning`);$l&&e.includes($l)||(Xl()||process.removeAllListeners(`warning`),$l=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Yl.get(t)||0;(Yl.has(t)||Yl.size<1e3)&&Yl.set(t,n+1);let r=Ql(e);G(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name,...process.env.USER_TYPE===`ant`&&{message:e.message}}),d(process.env.CLAUDE_DEBUG)&&I(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,$l))}lt(),qi(),yi(),pi(),ir(),jc(),de();function tu(){return(0,Y.jsxs)(se,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,Y.jsx)(oe,{url:`https://code.claude.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}W(),L(),de();function nu({serverName:e,onDone:t}){function n(n){switch(G(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(Na()||{}).enabledMcpjsonServers||[];r.includes(e)||R(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&R(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(Na()||{}).disabledMcpjsonServers||[];n.includes(e)||R(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,Y.jsxs)(pe,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,Y.jsx)(tu,{}),(0,Y.jsx)(Ar,{options:[{label:`Use this and all future MCP servers in this project`,value:`yes_all`},{label:`Use this MCP server`,value:`yes`},{label:`Continue without using this MCP server`,value:`no`}],onChange:e=>n(e),onCancel:()=>n(`no`)})]})}Qs(),W(),de(),L(),ii();function ru({serverNames:e,onDone:t}){function n(n){let r=Na()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=Zs(e,e=>n.includes(e));G(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&R(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&R(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Fl.useCallback)(()=>{let n=(Na()||{}).disabledMcpjsonServers||[];R(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(pe,{title:`${e.length} new MCP servers found in .mcp.json`,subtitle:`Select any you wish to enable.`,color:`warning`,onCancel:r,hideInputGuide:!0,children:[(0,Y.jsx)(tu,{}),(0,Y.jsx)(ei,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,Y.jsx)(ae,{paddingX:1,children:(0,Y.jsx)(se,{dimColor:!0,italic:!0,children:(0,Y.jsxs)(g,{children:[(0,Y.jsx)(ie,{shortcut:`Space`,action:`select`}),(0,Y.jsx)(ie,{shortcut:`Enter`,action:`confirm`}),(0,Y.jsx)(yr,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}nn();async function iu(e){let{servers:t}=ut(`project`),n=Object.keys(t).filter(e=>Jn(e)===`pending`);n.length!==0&&await new Promise(t=>{let r=()=>void t();if(n.length===1&&n[0]!==void 0){let t=n[0];e.render((0,Y.jsx)(k,{children:(0,Y.jsx)($i,{children:(0,Y.jsx)(nu,{serverName:t,onDone:r})})}))}else e.render((0,Y.jsx)(k,{children:(0,Y.jsx)($i,{children:(0,Y.jsx)(ru,{serverNames:n,onDone:r})})}))})}Da(),Mn(),Vt(),kr(),lc(),nt(),Fn(),mt(),V(),ha();var au={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function ou(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=au[e.toLowerCase()];t&&B().deepLinkTerminal!==t&&(z(e=>({...e,deepLinkTerminal:t})),I(`Stored deep link terminal preference: ${t}`))}var su=class{constructor(){h(this,`frameDurations`,[]),h(this,`firstRenderTime`,void 0),h(this,`lastRenderTime`,void 0)}record(e){let t=performance.now();this.firstRenderTime===void 0&&(this.firstRenderTime=t),this.lastRenderTime=t,this.frameDurations.push(e)}getMetrics(){if(this.frameDurations.length===0||this.firstRenderTime===void 0||this.lastRenderTime===void 0)return;let e=this.lastRenderTime-this.firstRenderTime;if(e<=0)return;let t=this.frameDurations.length/(e/1e3),n=this.frameDurations.slice().sort((e,t)=>t-e),r=n[Math.max(0,Math.ceil(n.length*.01)-1)],i=r>0?1e3/r:0;return{averageFps:Math.round(t*100)/100,low1PctFps:Math.round(i*100)/100}}};W(),it(),S(),de(),ir(),nn(),V(),f(),Gc(),Rc(),L();function cu(){z(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.7`}))}function lu(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function X(e,t,n){return uu(e,t,{color:`error`,beforeExit:n})}async function uu(e,t,n){let{Text:r}=await import(`./src-CST_jFnT.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,Y.jsx)(r,{color:i,children:t}):(0,Y.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function Z(e,t,n){return lu(e,e=>(0,Y.jsx)(ce,{initialState:B().theme,onThemeSave:e=>z(t=>({...t,theme:e})),children:(0,Y.jsx)(k,{onChangeAppState:n?.onChangeAppState,children:(0,Y.jsx)($i,{children:t(e)})})}))}async function du(e,t){e.render(t),pf(),await e.waitUntilExit(),await M(0)}async function fu(e,t,n,r){if(d(!1)||process.env.IS_DEMO)return!1;let i=B(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-BiZByBK-.js`);await Z(e,e=>(0,Y.jsx)(t,{onDone:()=>{cu(),e()}}),{onChangeAppState:qc})}if(!d(process.env.CLAUBBIT)){if(!eo()){let{TrustDialog:t}=await import(`./TrustDialog-CY8an_Tg.js`);await Z(e,e=>(0,Y.jsx)(t,{commands:r,onDone:e}))}Ze(!0),yn();let{errors:t}=zc();if(t.length===0&&await iu(e),await tn()){let t=Xt(await ct(!0)),{ClaudeMdExternalIncludesDialog:n}=await import(`./ClaudeMdExternalIncludesDialog--ywODh81.js`);await Z(e,e=>(0,Y.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if($c(),ou(),Kc(),setImmediate(()=>Hl()),await Mc()){let{GroveDialog:t}=await import(`./Grove-Cq88VBmM.js`);if(await Z(e,e=>(0,Y.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return G(`tengu_grove_policy_exited`,{}),ln(0),!1}if(process.env.ANTHROPIC_API_KEY&&!l()){let t=$o(process.env.ANTHROPIC_API_KEY);if(ro(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-BQbHdvc3.js`);await Z(e,e=>(0,Y.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:qc})}}if((t===`bypassPermissions`||n)&&!Pa()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-DllL8dxU.js`);await Z(e,e=>(0,Y.jsx)(t,{onAccept:e}))}return a}function pu(e){let t=0,n=Qc(e);n.stdin&&G(`tengu_stdin_interactive`,{});let r=new su,i=Zc();x(i);let a=process.env.CLAUDE_CODE_FRAME_TIMING_LOG;return{getFpsMetrics:()=>r.getMetrics(),stats:i,renderOptions:{...n,onFrame:e=>{if(r.record(e.durationMs),i.observe(`frame_duration_ms`,e.durationMs),a&&e.phases){let t=JSON.stringify({total:e.durationMs,...e.phases,rss:process.memoryUsage.rss(),cpu:process.cpuUsage()})+`
|
|
20
|
-
`;pl(a,t)}if(!ue())for(let n of e.flickers){if(n.reason===`resize`)continue;let e=Date.now();e-t<1e3&&G(`tengu_flicker`,{desiredHeight:n.desiredHeight,actualHeight:n.availableHeight,reason:n.reason}),t=e}}}}}ir();async function mu(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-s1G0DwXF.js`);return Z(e,e=>(0,Y.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function hu(e,t){let{AssistantSessionChooser:n}=await import(`./AssistantSessionChooser-4lm4eXQ8.js`);return Z(e,e=>(0,Y.jsx)(n,{sessions:t.sessions,onSelect:t=>e(t),onCancel:()=>e(null)}))}async function gu(e){let{NewInstallWizard:t,computeDefaultInstallDir:n}=await import(`./assistant-Bje16tQx.js`),r=await n(),i,a=new Promise((e,t)=>{i=t}),o=Z(e,e=>(0,Y.jsx)(t,{defaultDir:r,onInstalled:t=>e(t),onCancel:()=>e(null),onError:e=>i(Error(`Installation failed: ${e}`))}));return Promise.race([o,a])}async function _u(e){let{TeleportResumeWrapper:t}=await import(`./TeleportResumeWrapper-Bz14mUqR.js`);return Z(e,e=>(0,Y.jsx)(t,{onComplete:e,onCancel:()=>e(null),source:`cliArg`}))}async function vu(e,t){let{TeleportRepoMismatchDialog:n}=await import(`./TeleportRepoMismatchDialog-A5Ss0kuk.js`);return Z(e,e=>(0,Y.jsx)(n,{targetRepo:t.targetRepo,initialPaths:t.initialPaths,onSelectPath:e,onCancel:()=>e(null)}))}async function yu(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-DAAXlOCd.js`),import(`./App-Buad9Llp.js`)]);await du(e,(0,Y.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,Y.jsx)($i,{children:(0,Y.jsx)(a,{...r,worktreePaths:i})})}))}Ps(),Fs();var bu=5,xu=30,Su=`After you finish implementing the change:
|
|
21
|
-
1. **Simplify** — Invoke the \`${Rs}\` tool with \`skill: "simplify"\` to review and clean up your changes.
|
|
22
|
-
2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
|
|
23
|
-
3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
|
|
24
|
-
4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
|
|
25
|
-
5. **Report** — End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none — <reason>\`.`;function Cu(e){return`# Batch: Parallel Work Orchestration
|
|
26
|
-
|
|
27
|
-
You are orchestrating a large, parallelizable change across this codebase.
|
|
28
|
-
|
|
29
|
-
## User Instruction
|
|
30
|
-
|
|
31
|
-
${e}
|
|
32
|
-
|
|
33
|
-
## Phase 1: Research and Plan (Plan Mode)
|
|
34
|
-
|
|
35
|
-
Call the \`${Ws}\` tool now to enter plan mode, then:
|
|
36
|
-
|
|
37
|
-
1. **Understand the scope.** Launch one or more subagents (in the foreground — you need their results) to deeply research what this instruction touches. Find all the files, patterns, and call sites that need to change. Understand the existing conventions so the migration is consistent.
|
|
38
|
-
|
|
39
|
-
2. **Decompose into independent units.** Break the work into ${bu}–${xu} self-contained units. Each unit must:
|
|
40
|
-
- Be independently implementable in an isolated git worktree (no shared state with sibling units)
|
|
41
|
-
- Be mergeable on its own without depending on another unit's PR landing first
|
|
42
|
-
- Be roughly uniform in size (split large units, merge trivial ones)
|
|
43
|
-
|
|
44
|
-
Scale the count to the actual work: few files → closer to ${bu}; hundreds of files → closer to ${xu}. Prefer per-directory or per-module slicing over arbitrary file lists.
|
|
45
|
-
|
|
46
|
-
3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
|
|
47
|
-
- A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
|
|
48
|
-
- A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
|
|
49
|
-
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
|
50
|
-
- An existing e2e/integration test suite the worker can run
|
|
51
|
-
|
|
52
|
-
If you cannot find a concrete e2e path, use the \`${Is}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
|
|
53
|
-
|
|
54
|
-
Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
|
|
55
|
-
|
|
56
|
-
4. **Write the plan.** In your plan file, include:
|
|
57
|
-
- A summary of what you found during research
|
|
58
|
-
- A numbered list of work units — for each: a short title, the list of files/directories it covers, and a one-line description of the change
|
|
59
|
-
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
|
60
|
-
- The exact worker instructions you will give each agent (the shared template)
|
|
61
|
-
|
|
62
|
-
5. Call \`${Bs}\` to present the plan for approval.
|
|
63
|
-
|
|
64
|
-
## Phase 2: Spawn Workers (After Plan Approval)
|
|
65
|
-
|
|
66
|
-
Once the plan is approved, spawn one background agent per work unit using the \`${Ma}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
|
|
67
|
-
|
|
68
|
-
For each agent, the prompt must be fully self-contained. Include:
|
|
69
|
-
- The overall goal (the user's instruction)
|
|
70
|
-
- This unit's specific task (title, file list, change description — copied verbatim from your plan)
|
|
71
|
-
- Any codebase conventions you discovered that the worker needs to follow
|
|
72
|
-
- The e2e test recipe from your plan (or "skip e2e because …")
|
|
73
|
-
- The worker instructions below, copied verbatim:
|
|
74
|
-
|
|
75
|
-
\`\`\`
|
|
76
|
-
${Su}
|
|
77
|
-
\`\`\`
|
|
78
|
-
|
|
79
|
-
Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
|
|
80
|
-
|
|
81
|
-
## Phase 3: Track Progress
|
|
82
|
-
|
|
83
|
-
After launching all workers, render an initial status table:
|
|
84
|
-
|
|
85
|
-
| # | Unit | Status | PR |
|
|
86
|
-
|---|------|--------|----|
|
|
87
|
-
| 1 | <title> | running | — |
|
|
88
|
-
| 2 | <title> | running | — |
|
|
89
|
-
|
|
90
|
-
As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
|
|
91
|
-
|
|
92
|
-
When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
|
|
93
|
-
`}var wu="This is not a git repository. The `/batch` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.",Tu=`Provide an instruction describing the batch change you want to make.
|
|
94
|
-
|
|
95
|
-
Examples:
|
|
96
|
-
/batch migrate from react to vue
|
|
97
|
-
/batch replace all uses of lodash with native equivalents
|
|
98
|
-
/batch add type annotations to all untyped function parameters`;function Eu(){N({name:`batch`,description:`Research and plan a large-scale change, then execute it in parallel across 5–30 isolated worktree agents that each open a PR.`,whenToUse:`Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.`,argumentHint:`<instruction>`,userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(e){let t=e.trim();return t?await uo()?[{type:`text`,text:Cu(t)}]:[{type:`text`,text:wu}]:[{type:`text`,text:Tu}]}})}Un(),L(),ha(),Ta(),P();var Du=20,Ou=64*1024;function ku(){N({name:`debug`,description:process.env.USER_TYPE===`ant`?`Debug your current Work Mate session by reading the session debug log. Includes all event logging`:`Enable debug logging for this session and help diagnose issues`,allowedTools:[`Read`,`Grep`,`Glob`],argumentHint:`[issue description]`,disableModelInvocation:!0,userInvocable:!0,async getPromptForCommand(e){let t=va(),n=xa(),r;try{let e=await gl(n),t=Math.min(e.size,Ou),i=e.size-t,a=await hl(n,`r`);try{let{buffer:n,bytesRead:o}=await a.read({buffer:Buffer.alloc(t),position:i}),s=n.toString(`utf-8`,0,o).split(`
|
|
99
|
-
`).slice(-20).join(`
|
|
100
|
-
`);r=`Log size: ${Mo(e.size)}\n\n### Last ${Du} lines\n\n\`\`\`\n${s}\n\`\`\``}finally{await a.close()}}catch(e){r=fa(e)?`No debug log exists yet — logging was just enabled.`:`Failed to read last ${Du} lines of debug log: ${F(e)}`}return[{type:`text`,text:`# Debug Skill
|
|
101
|
-
|
|
102
|
-
Help the user debug an issue they're encountering in this current Work Mate session.
|
|
103
|
-
${t?``:`
|
|
104
|
-
## Debug Logging Just Enabled
|
|
105
|
-
|
|
106
|
-
Debug logging was OFF for this session until now. Nothing prior to this /debug invocation was captured.
|
|
107
|
-
|
|
108
|
-
Tell the user that debug logging is now active at \`${n}\`, ask them to reproduce the issue, then re-read the log. If they can't reproduce, they can also restart with \`claude --debug\` to capture logs from startup.
|
|
109
|
-
`}
|
|
110
|
-
## Session Debug Log
|
|
111
|
-
|
|
112
|
-
The debug log for the current session is at: \`${n}\`
|
|
113
|
-
|
|
114
|
-
${r}
|
|
115
|
-
|
|
116
|
-
For additional context, grep for [ERROR] and [WARN] lines across the full file.
|
|
117
|
-
|
|
118
|
-
## Issue Description
|
|
119
|
-
|
|
120
|
-
${e||`The user did not describe a specific issue. Read the debug log and summarize any errors, warnings, or notable issues.`}
|
|
121
|
-
|
|
122
|
-
## Settings
|
|
123
|
-
|
|
124
|
-
Remember that settings are in:
|
|
125
|
-
* user - ${Ha(`userSettings`)}
|
|
126
|
-
* project - ${Ha(`projectSettings`)}
|
|
127
|
-
* local - ${Ha(`localSettings`)}
|
|
128
|
-
|
|
129
|
-
## Instructions
|
|
130
|
-
|
|
131
|
-
1. Review the user's issue description
|
|
132
|
-
2. The last ${Du} lines show the debug file format. Look for [ERROR] and [WARN] entries, stack traces, and failure patterns across the file
|
|
133
|
-
3. Consider launching the ${Rt} subagent to understand the relevant Work Mate features
|
|
134
|
-
4. Explain what you found in plain language
|
|
135
|
-
5. Suggest concrete fixes or next steps
|
|
136
|
-
`}]}})}yt(),Ce();var Au=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],ju={Global:`Active everywhere, regardless of focus`,Chat:`When the chat input is focused`,Autocomplete:`When autocomplete menu is visible`,Confirmation:`When a confirmation/permission dialog is shown`,Help:`When the help overlay is open`,Transcript:`When viewing the transcript`,HistorySearch:`When searching command history (ctrl+r)`,Task:`When a task/agent is running in the foreground`,ThemePicker:`When the theme picker is open`,Settings:`When the settings menu is open`,Tabs:`When tab navigation is active`,Attachments:`When navigating image attachments in a select dialog`,Footer:`When footer indicators are focused`,MessageSelector:`When the message selector (rewind) is open`,DiffDialog:`When the diff dialog is open`,ModelPicker:`When the model picker is open`,Select:`When a select/list component is focused`,Plugin:`When the plugin dialog is open`},Mu=`app:interrupt.app:exit.app:toggleTodos.app:toggleTranscript.app:toggleBrief.app:toggleTeammatePreview.app:toggleTerminal.app:redraw.app:globalSearch.app:quickOpen.history:search.history:previous.history:next.chat:cancel.chat:killAgents.chat:cycleMode.chat:modelPicker.chat:fastMode.chat:thinkingToggle.chat:submit.chat:newline.chat:undo.chat:externalEditor.chat:stash.chat:imagePaste.chat:messageActions.autocomplete:accept.autocomplete:dismiss.autocomplete:previous.autocomplete:next.confirm:yes.confirm:no.confirm:previous.confirm:next.confirm:nextField.confirm:previousField.confirm:cycleMode.confirm:toggle.confirm:toggleExplanation.tabs:next.tabs:previous.transcript:toggleShowAll.transcript:exit.historySearch:next.historySearch:accept.historySearch:cancel.historySearch:execute.task:background.theme:toggleSyntaxHighlighting.help:dismiss.attachments:next.attachments:previous.attachments:remove.attachments:exit.footer:up.footer:down.footer:next.footer:previous.footer:openSelected.footer:clearSelection.footer:close.messageSelector:up.messageSelector:down.messageSelector:top.messageSelector:bottom.messageSelector:select.diff:dismiss.diff:previousSource.diff:nextSource.diff:back.diff:viewDetails.diff:previousFile.diff:nextFile.modelPicker:toggle1M.select:next.select:previous.select:accept.select:cancel.plugin:toggle.plugin:install.permission:toggleDebug.settings:search.settings:retry.settings:close.select:previousValue.select:nextValue`.split(`.`),Nu=xe(()=>he({context:ve(Au).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:be(y().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),_e([ve(Mu),y().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe(`Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.`),Se().describe(`Set to null to unbind a default shortcut`)]).describe(`Action to trigger, command to invoke, or null to unbind`)).describe(`Map of keystroke patterns to actions`)}).describe(`A block of keybindings for a specific context`));xe(()=>he({$schema:y().optional().describe(`JSON Schema URL for editor validation`),$docs:y().optional().describe(`Documentation URL`),bindings:ye(Nu()).describe(`Array of keybinding blocks by context`)}).describe(`Work Mate keybindings configuration. Customize keyboard shortcuts by context.`)),P();function Pu(){return Zu([`Context`,`Description`],Au.map(e=>[`\`${e}\``,ju[e]]))}function Fu(){let e={};for(let t of zr)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return Zu([`Action`,`Default Key(s)`,`Context`],Mu.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:Iu(t);return[`\`${t}\``,r,i]}))}function Iu(e){return{app:`Global`,history:`Global or Chat`,chat:`Chat`,autocomplete:`Autocomplete`,confirm:`Confirmation`,tabs:`Tabs`,transcript:`Transcript`,historySearch:`HistorySearch`,task:`Task`,theme:`ThemePicker`,help:`Help`,attachments:`Attachments`,footer:`Footer`,messageSelector:`MessageSelector`,diff:`DiffDialog`,modelPicker:`ModelPicker`,select:`Select`,permission:`Confirmation`}[e.split(`:`)[0]??``]??`Unknown`}function Lu(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of Tn)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of St)e.push(`- \`${t.key}\` — ${t.reason} (${t.severity===`error`?`will not work`:`may conflict`})`);e.push(``),e.push(`### macOS reserved (errors)`);for(let t of Hi)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
|
|
137
|
-
`)}var Ru={$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:[{context:`Chat`,bindings:{"ctrl+e":`chat:externalEditor`}}]},zu={context:`Chat`,bindings:{"ctrl+s":null}},Bu={context:`Chat`,bindings:{"ctrl+g":null,"ctrl+e":`chat:externalEditor`}},Vu={context:`Global`,bindings:{"ctrl+k ctrl+t":`app:toggleTodos`}},Hu=[`# Keybindings Skill`,``,"Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.",``,`## CRITICAL: Read Before Write`,``,"**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings — never replace the entire file.",``,`- Use **Edit** tool for modifications to existing files`,`- Use **Write** tool only if the file does not exist yet`].join(`
|
|
138
|
-
`),Uu=[`## File Format`,``,"```json",wa(Ru,null,2),"```",``,"Always include the `$schema` and `$docs` fields."].join(`
|
|
139
|
-
`),Wu=[`## Keystroke Syntax`,``,"**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) — note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)",``,"**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`",``,"**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)",``,"**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
|
|
140
|
-
`),Gu=[`## Unbinding Default Shortcuts`,``,"Set a key to `null` to remove its default binding:",``,"```json",wa(zu,null,2),"```"].join(`
|
|
141
|
-
`),Ku=[`## How User Bindings Interact with Defaults`,``,`- User bindings are **additive** — they are appended after the default bindings`,"- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding",`- A context only needs to appear in the user's file if they want to change something in that context`].join(`
|
|
142
|
-
`),qu=[`## Common Patterns`,``,`### Rebind a key`,"To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",wa(Bu,null,2),"```",``,`### Add a chord binding`,"```json",wa(Vu,null,2),"```"].join(`
|
|
143
|
-
`),Ju=[`## Behavioral Rules`,``,`1. Only include contexts the user wants to change (minimal overrides)`,`2. Validate that actions and contexts are from the known lists below`,"3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)",`4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)`,`5. To fully replace a default binding, unbind the old key AND add the new one`].join(`
|
|
144
|
-
`),Yu=[`## Validation with /doctor`,``,'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',``,`### Common Issues and Fixes`,``,Zu([`Issue`,`Cause`,`Fix`],[['`keybindings.json must have a "bindings" array`',`Missing wrapper object`,'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',`Typo or invalid context name`,`Use exact context names from the Available Contexts table`],['`Duplicate key "X" in Y bindings`',`Same key defined twice in one context`,`Remove the duplicate; JSON uses only the last value`],['`"X" may not work: ...`',`Key conflicts with terminal/OS reserved shortcut`,`Choose a different key (see Reserved Shortcuts section)`],['`Could not parse keystroke "X"`',`Invalid key syntax`,"Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',`Action value is not a string or null`,'Actions must be strings like `"app:help"` or `null` to unbind']]),``,`### Example /doctor Output`,``,"```",`Keybinding Configuration Issues`,`Location: ~/.claude/keybindings.json`,` └ [Error] Unknown context "chat"`,` → Valid contexts: Global, Chat, Autocomplete, ...`,` └ [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)`,"```",``,`**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work.`].join(`
|
|
145
|
-
`);function Xu(){N({name:`keybindings-help`,description:`Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".`,allowedTools:[`Read`],userInvocable:!1,isEnabled:bn,async getPromptForCommand(e){let t=Pu(),n=Fu(),r=[Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,`## Reserved Shortcuts\n\n${Lu()}`,`## Available Contexts\n\n${t}`,`## Available Actions\n\n${n}`];return e&&r.push(`## User Request\n\n${e}`),[{type:`text`,text:r.join(`
|
|
146
|
-
|
|
147
|
-
`)}]}})}function Zu(e,t){let n=e.map(()=>`---`);return[`| ${e.join(` | `)} |`,`| ${n.join(` | `)} |`,...t.map(e=>`| ${e.join(` | `)} |`)].join(`
|
|
148
|
-
`)}P();var Qu=`the.a.an.I.you.he.she.it.we.they.me.him.her.us.them.my.your.his.its.our.this.that.what.who.is.are.was.were.be.been.have.has.had.do.does.did.will.would.can.could.may.might.must.shall.should.make.made.get.got.go.went.come.came.see.saw.know.take.think.look.want.use.find.give.tell.work.call.try.ask.need.feel.seem.leave.put.time.year.day.way.man.thing.life.hand.part.place.case.point.fact.good.new.first.last.long.great.little.own.other.old.right.big.high.small.large.next.early.young.few.public.bad.same.able.in.on.at.to.for.of.with.from.by.about.like.through.over.before.between.under.since.without.and.or.but.if.than.because.as.until.while.so.though.both.each.when.where.why.how.not.now.just.more.also.here.there.then.only.very.well.back.still.even.much.too.such.never.again.most.once.off.away.down.out.up.test.code.data.file.line.text.word.number.system.program.set.run.value.name.type.state.end.start`.split(`.`);function $u(e){let t=0,n=``;for(;t<e;){let r=10+Math.floor(Math.random()*11),i=0;for(let a=0;a<r&&t<e;a++){let o=Qu[Math.floor(Math.random()*Qu.length)];n+=o,t++,i++,a===r-1||t>=e?n+=`. `:n+=` `}i>0&&Math.random()<.2&&t<e&&(n+=`
|
|
149
|
-
|
|
150
|
-
`)}return n.trim()}function ed(){process.env.USER_TYPE===`ant`&&N({name:`lorem-ipsum`,description:`Generate filler text for long context testing. Specify token count as argument (e.g., /lorem-ipsum 50000). Outputs approximately the requested number of tokens. Ant-only.`,argumentHint:`[token_count]`,userInvocable:!0,async getPromptForCommand(e){let t=parseInt(e,10);if(e&&(isNaN(t)||t<=0))return[{type:`text`,text:`Invalid token count. Please provide a positive number (e.g., /lorem-ipsum 10000).`}];let n=t||1e4,r=Math.min(n,5e5);return r<n?[{type:`text`,text:`Requested ${n} tokens, but capped at 500,000 for safety.\n\n${$u(r)}`}]:[{type:`text`,text:$u(r)}]}})}P();function td(){process.env.USER_TYPE===`ant`&&N({name:`remember`,description:`Review auto-memory entries and propose promotions to CLAUDE.md, CLAUDE.local.md, or shared memory. Also detects outdated, conflicting, and duplicate entries across memory layers.`,whenToUse:`Use when the user wants to review, organize, or promote their auto-memory entries. Also useful for cleaning up outdated or conflicting entries across CLAUDE.md, CLAUDE.local.md, and auto-memory.`,userInvocable:!0,isEnabled:()=>Ya(),async getPromptForCommand(e){let t=`# Memory Review
|
|
151
|
-
|
|
152
|
-
## Goal
|
|
153
|
-
Review the user's memory landscape and produce a clear report of proposed changes, grouped by action type. Do NOT apply changes — present proposals for user approval.
|
|
154
|
-
|
|
155
|
-
## Steps
|
|
156
|
-
|
|
157
|
-
### 1. Gather all memory layers
|
|
158
|
-
Read CLAUDE.md and CLAUDE.local.md from the project root (if they exist). Your auto-memory content is already in your system prompt — review it there. Note which team memory sections exist, if any.
|
|
159
|
-
|
|
160
|
-
**Success criteria**: You have the contents of all memory layers and can compare them.
|
|
161
|
-
|
|
162
|
-
### 2. Classify each auto-memory entry
|
|
163
|
-
For each substantive entry in auto-memory, determine the best destination:
|
|
164
|
-
|
|
165
|
-
| Destination | What belongs there | Examples |
|
|
166
|
-
|---|---|---|
|
|
167
|
-
| **CLAUDE.md** | Project conventions and instructions for Claude that all contributors should follow | "use bun not npm", "API routes use kebab-case", "test command is bun test", "prefer functional style" |
|
|
168
|
-
| **CLAUDE.local.md** | Personal instructions for Claude specific to this user, not applicable to other contributors | "I prefer concise responses", "always explain trade-offs", "don't auto-commit", "run tests before committing" |
|
|
169
|
-
| **Team memory** | Org-wide knowledge that applies across repositories (only if team memory is configured) | "deploy PRs go through #deploy-queue", "staging is at staging.internal", "platform team owns infra" |
|
|
170
|
-
| **Stay in auto-memory** | Working notes, temporary context, or entries that don't clearly fit elsewhere | Session-specific observations, uncertain patterns |
|
|
171
|
-
|
|
172
|
-
**Important distinctions:**
|
|
173
|
-
- CLAUDE.md and CLAUDE.local.md contain instructions for Claude, not user preferences for external tools (editor theme, IDE keybindings, etc. don't belong in either)
|
|
174
|
-
- Workflow practices (PR conventions, merge strategies, branch naming) are ambiguous — ask the user whether they're personal or team-wide
|
|
175
|
-
- When unsure, ask rather than guess
|
|
176
|
-
|
|
177
|
-
**Success criteria**: Each entry has a proposed destination or is flagged as ambiguous.
|
|
178
|
-
|
|
179
|
-
### 3. Identify cleanup opportunities
|
|
180
|
-
Scan across all layers for:
|
|
181
|
-
- **Duplicates**: Auto-memory entries already captured in CLAUDE.md or CLAUDE.local.md → propose removing from auto-memory
|
|
182
|
-
- **Outdated**: CLAUDE.md or CLAUDE.local.md entries contradicted by newer auto-memory entries → propose updating the older layer
|
|
183
|
-
- **Conflicts**: Contradictions between any two layers → propose resolution, noting which is more recent
|
|
184
|
-
|
|
185
|
-
**Success criteria**: All cross-layer issues identified.
|
|
186
|
-
|
|
187
|
-
### 4. Present the report
|
|
188
|
-
Output a structured report grouped by action type:
|
|
189
|
-
1. **Promotions** — entries to move, with destination and rationale
|
|
190
|
-
2. **Cleanup** — duplicates, outdated entries, conflicts to resolve
|
|
191
|
-
3. **Ambiguous** — entries where you need the user's input on destination
|
|
192
|
-
4. **No action needed** — brief note on entries that should stay put
|
|
193
|
-
|
|
194
|
-
If auto-memory is empty, say so and offer to review CLAUDE.md for cleanup.
|
|
195
|
-
|
|
196
|
-
**Success criteria**: User can review and approve/reject each proposal individually.
|
|
197
|
-
|
|
198
|
-
## Rules
|
|
199
|
-
- Present ALL proposals before making any changes
|
|
200
|
-
- Do NOT modify files without explicit user approval
|
|
201
|
-
- Do NOT create new files unless the target doesn't exist yet
|
|
202
|
-
- Ask about ambiguous entries — don't guess
|
|
203
|
-
`;return e&&(t+=`\n## Additional context from user\n\n${e}`),[{type:`text`,text:t}]}})}La(),P();var nd=`# Simplify: Code Review and Cleanup
|
|
204
|
-
|
|
205
|
-
Review all changed files for reuse, quality, and efficiency. Fix any issues found.
|
|
206
|
-
|
|
207
|
-
## Phase 1: Identify Changes
|
|
208
|
-
|
|
209
|
-
Run \`git diff\` (or \`git diff HEAD\` if there are staged changes) to see what changed. If there are no git changes, review the most recently modified files that the user mentioned or that you edited earlier in this conversation.
|
|
210
|
-
|
|
211
|
-
## Phase 2: Launch Three Review Agents in Parallel
|
|
212
|
-
|
|
213
|
-
Use the ${Ma} tool to launch all three agents concurrently in a single message. Pass each agent the full diff so it has the complete context.
|
|
214
|
-
|
|
215
|
-
### Agent 1: Code Reuse Review
|
|
216
|
-
|
|
217
|
-
For each change:
|
|
218
|
-
|
|
219
|
-
1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones.
|
|
220
|
-
2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead.
|
|
221
|
-
3. **Flag any inline logic that could use an existing utility** — hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
|
|
222
|
-
|
|
223
|
-
### Agent 2: Code Quality Review
|
|
224
|
-
|
|
225
|
-
Review the same changes for hacky patterns:
|
|
226
|
-
|
|
227
|
-
1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
|
|
228
|
-
2. **Parameter sprawl**: adding new parameters to a function instead of generalizing or restructuring existing ones
|
|
229
|
-
3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction
|
|
230
|
-
4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
|
|
231
|
-
5. **Stringly-typed code**: using raw strings where constants, enums (string unions), or branded types already exist in the codebase
|
|
232
|
-
6. **Unnecessary JSX nesting**: wrapper Boxes/elements that add no layout value — check if inner component props (flexShrink, alignItems, etc.) already provide the needed behavior
|
|
233
|
-
7. **Unnecessary comments**: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller — delete; keep only non-obvious WHY (hidden constraints, subtle invariants, workarounds)
|
|
234
|
-
|
|
235
|
-
### Agent 3: Efficiency Review
|
|
236
|
-
|
|
237
|
-
Review the same changes for efficiency:
|
|
238
|
-
|
|
239
|
-
1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
|
|
240
|
-
2. **Missed concurrency**: independent operations run sequentially when they could run in parallel
|
|
241
|
-
3. **Hot-path bloat**: new blocking work added to startup or per-request/per-render hot paths
|
|
242
|
-
4. **Recurring no-op updates**: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally — add a change-detection guard so downstream consumers aren't notified when nothing changed. Also: if a wrapper function takes an updater/reducer callback, verify it honors same-reference returns (or whatever the "no change" signal is) — otherwise callers' early-return no-ops are silently defeated
|
|
243
|
-
5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern) — operate directly and handle the error
|
|
244
|
-
6. **Memory**: unbounded data structures, missing cleanup, event listener leaks
|
|
245
|
-
7. **Overly broad operations**: reading entire files when only a portion is needed, loading all items when filtering for one
|
|
246
|
-
|
|
247
|
-
## Phase 3: Fix Issues
|
|
248
|
-
|
|
249
|
-
Wait for all three agents to complete. Aggregate their findings and fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on — do not argue with the finding, just skip it.
|
|
250
|
-
|
|
251
|
-
When done, briefly summarize what was fixed (or confirm the code was already clean).
|
|
252
|
-
`;function rd(){N({name:`simplify`,description:`Review changed code for reuse, quality, and efficiency, then fix any issues found.`,userInvocable:!0,async getPromptForCommand(e){let t=nd;return e&&(t+=`\n\n## Additional Focus\n\n${e}`),[{type:`text`,text:t}]}})}er(),P();function id(e){return e.filter(e=>e.type===`user`).map(e=>{let t=e.message?.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
253
|
-
`):``}).filter(e=>e.trim().length>0)}var ad=`# Skillify {{userDescriptionBlock}}
|
|
254
|
-
|
|
255
|
-
You are capturing this session's repeatable process as a reusable skill.
|
|
256
|
-
|
|
257
|
-
## Your Session Context
|
|
258
|
-
|
|
259
|
-
Here is the session memory summary:
|
|
260
|
-
<session_memory>
|
|
261
|
-
{{sessionMemory}}
|
|
262
|
-
</session_memory>
|
|
263
|
-
|
|
264
|
-
Here are the user's messages during this session. Pay attention to how they steered the process, to help capture their detailed preferences in the skill:
|
|
265
|
-
<user_messages>
|
|
266
|
-
{{userMessages}}
|
|
267
|
-
</user_messages>
|
|
268
|
-
|
|
269
|
-
## Your Task
|
|
270
|
-
|
|
271
|
-
### Step 1: Analyze the Session
|
|
272
|
-
|
|
273
|
-
Before asking any questions, analyze the session to identify:
|
|
274
|
-
- What repeatable process was performed
|
|
275
|
-
- What the inputs/parameters were
|
|
276
|
-
- The distinct steps (in order)
|
|
277
|
-
- The success artifacts/criteria (e.g. not just "writing code," but "an open PR with CI fully passing") for each step
|
|
278
|
-
- Where the user corrected or steered you
|
|
279
|
-
- What tools and permissions were needed
|
|
280
|
-
- What agents were used
|
|
281
|
-
- What the goals and success artifacts were
|
|
282
|
-
|
|
283
|
-
### Step 2: Interview the User
|
|
284
|
-
|
|
285
|
-
You will use the AskUserQuestion to understand what the user wants to automate. Important notes:
|
|
286
|
-
- Use AskUserQuestion for ALL questions! Never ask questions via plain text.
|
|
287
|
-
- For each round, iterate as much as needed until the user is happy.
|
|
288
|
-
- The user always has a freeform "Other" option to type edits or feedback -- do NOT add your own "Needs tweaking" or "I'll provide edits" option. Just offer the substantive choices.
|
|
289
|
-
|
|
290
|
-
**Round 1: High level confirmation**
|
|
291
|
-
- Suggest a name and description for the skill based on your analysis. Ask the user to confirm or rename.
|
|
292
|
-
- Suggest high-level goal(s) and specific success criteria for the skill.
|
|
293
|
-
|
|
294
|
-
**Round 2: More details**
|
|
295
|
-
- Present the high-level steps you identified as a numbered list. Tell the user you will dig into the detail in the next round.
|
|
296
|
-
- If you think the skill will require arguments, suggest arguments based on what you observed. Make sure you understand what someone would need to provide.
|
|
297
|
-
- If it's not clear, ask if this skill should run inline (in the current conversation) or forked (as a sub-agent with its own context). Forked is better for self-contained tasks that don't need mid-process user input; inline is better when the user wants to steer mid-process.
|
|
298
|
-
- Ask where the skill should be saved. Suggest a default based on context (repo-specific workflows → repo, cross-repo personal workflows → user). Options:
|
|
299
|
-
- **This repo** (\`.claude/skills/<name>/SKILL.md\`) — for workflows specific to this project
|
|
300
|
-
- **Personal** (\`~/.claude/skills/<name>/SKILL.md\`) — follows you across all repos
|
|
301
|
-
|
|
302
|
-
**Round 3: Breaking down each step**
|
|
303
|
-
For each major step, if it's not glaringly obvious, ask:
|
|
304
|
-
- What does this step produce that later steps need? (data, artifacts, IDs)
|
|
305
|
-
- What proves that this step succeeded, and that we can move on?
|
|
306
|
-
- Should the user be asked to confirm before proceeding? (especially for irreversible actions like merging, sending messages, or destructive operations)
|
|
307
|
-
- Are any steps independent and could run in parallel? (e.g., posting to Slack and monitoring CI at the same time)
|
|
308
|
-
- How should the skill be executed? (e.g. always use a Task agent to conduct code review, or invoke an agent team for a set of concurrent steps)
|
|
309
|
-
- What are the hard constraints or hard preferences? Things that must or must not happen?
|
|
310
|
-
|
|
311
|
-
You may do multiple rounds of AskUserQuestion here, one round per step, especially if there are more than 3 steps or many clarification questions. Iterate as much as needed.
|
|
312
|
-
|
|
313
|
-
IMPORTANT: Pay special attention to places where the user corrected you during the session, to help inform your design.
|
|
314
|
-
|
|
315
|
-
**Round 4: Final questions**
|
|
316
|
-
- Confirm when this skill should be invoked, and suggest/confirm trigger phrases too. (e.g. For a cherrypick workflow you could say: Use when the user wants to cherry-pick a PR to a release branch. Examples: 'cherry-pick to release', 'CP this PR', 'hotfix.')
|
|
317
|
-
- You can also ask for any other gotchas or things to watch out for, if it's still unclear.
|
|
318
|
-
|
|
319
|
-
Stop interviewing once you have enough information. IMPORTANT: Don't over-ask for simple processes!
|
|
320
|
-
|
|
321
|
-
### Step 3: Write the SKILL.md
|
|
322
|
-
|
|
323
|
-
Create the skill directory and file at the location the user chose in Round 2.
|
|
324
|
-
|
|
325
|
-
Use this format:
|
|
326
|
-
|
|
327
|
-
\`\`\`markdown
|
|
328
|
-
---
|
|
329
|
-
name: {{skill-name}}
|
|
330
|
-
description: {{one-line description}}
|
|
331
|
-
allowed-tools:
|
|
332
|
-
{{list of tool permission patterns observed during session}}
|
|
333
|
-
when_to_use: {{detailed description of when Claude should automatically invoke this skill, including trigger phrases and example user messages}}
|
|
334
|
-
argument-hint: "{{hint showing argument placeholders}}"
|
|
335
|
-
arguments:
|
|
336
|
-
{{list of argument names}}
|
|
337
|
-
context: {{inline or fork -- omit for inline}}
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
# {{Skill Title}}
|
|
341
|
-
Description of skill
|
|
342
|
-
|
|
343
|
-
## Inputs
|
|
344
|
-
- \`$arg_name\`: Description of this input
|
|
345
|
-
|
|
346
|
-
## Goal
|
|
347
|
-
Clearly stated goal for this workflow. Best if you have clearly defined artifacts or criteria for completion.
|
|
348
|
-
|
|
349
|
-
## Steps
|
|
350
|
-
|
|
351
|
-
### 1. Step Name
|
|
352
|
-
What to do in this step. Be specific and actionable. Include commands when appropriate.
|
|
353
|
-
|
|
354
|
-
**Success criteria**: ALWAYS include this! This shows that the step is done and we can move on. Can be a list.
|
|
355
|
-
|
|
356
|
-
IMPORTANT: see the next section below for the per-step annotations you can optionally include for each step.
|
|
357
|
-
|
|
358
|
-
...
|
|
359
|
-
\`\`\`
|
|
360
|
-
|
|
361
|
-
**Per-step annotations**:
|
|
362
|
-
- **Success criteria** is REQUIRED on every step. This helps the model understand what the user expects from their workflow, and when it should have the confidence to move on.
|
|
363
|
-
- **Execution**: \`Direct\` (default), \`Task agent\` (straightforward subagents), \`Teammate\` (agent with true parallelism and inter-agent communication), or \`[human]\` (user does it). Only needs specifying if not Direct.
|
|
364
|
-
- **Artifacts**: Data this step produces that later steps need (e.g., PR number, commit SHA). Only include if later steps depend on it.
|
|
365
|
-
- **Human checkpoint**: When to pause and ask the user before proceeding. Include for irreversible actions (merging, sending messages), error judgment (merge conflicts), or output review.
|
|
366
|
-
- **Rules**: Hard rules for the workflow. User corrections during the reference session can be especially useful here.
|
|
367
|
-
|
|
368
|
-
**Step structure tips:**
|
|
369
|
-
- Steps that can run concurrently use sub-numbers: 3a, 3b
|
|
370
|
-
- Steps requiring the user to act get \`[human]\` in the title
|
|
371
|
-
- Keep simple skills simple -- a 2-step skill doesn't need annotations on every step
|
|
372
|
-
|
|
373
|
-
**Frontmatter rules:**
|
|
374
|
-
- \`allowed-tools\`: Minimum permissions needed (use patterns like \`Bash(gh:*)\` not \`Bash\`)
|
|
375
|
-
- \`context\`: Only set \`context: fork\` for self-contained skills that don't need mid-process user input.
|
|
376
|
-
- \`when_to_use\` is CRITICAL -- tells the model when to auto-invoke. Start with "Use when..." and include trigger phrases. Example: "Use when the user wants to cherry-pick a PR to a release branch. Examples: 'cherry-pick to release', 'CP this PR', 'hotfix'."
|
|
377
|
-
- \`arguments\` and \`argument-hint\`: Only include if the skill takes parameters. Use \`$name\` in the body for substitution.
|
|
378
|
-
|
|
379
|
-
### Step 4: Confirm and Save
|
|
380
|
-
|
|
381
|
-
Before writing the file, output the complete SKILL.md content as a yaml code block in your response so the user can review it with proper syntax highlighting. Then ask for confirmation using AskUserQuestion with a simple question like "Does this SKILL.md look good to save?" — do NOT use the body field, keep the question concise.
|
|
382
|
-
|
|
383
|
-
After writing, tell the user:
|
|
384
|
-
- Where the skill was saved
|
|
385
|
-
- How to invoke it: \`/{{skill-name}} [arguments]\`
|
|
386
|
-
- That they can edit the SKILL.md directly to refine it
|
|
387
|
-
`;function od(){process.env.USER_TYPE===`ant`&&N({name:`skillify`,description:`Capture this session's repeatable process into a skill. Call at end of the process you want to capture with an optional description.`,allowedTools:[`Read`,`Write`,`Edit`,`Glob`,`Grep`,`AskUserQuestion`,`Bash(mkdir:*)`],userInvocable:!0,disableModelInvocation:!0,argumentHint:`[description of the process you want to capture]`,async getPromptForCommand(e,t){let n=await Si()??`No session memory available.`,r=id(_t(t.messages)),i=e?`The user described this process as: "${e}"`:``;return[{type:`text`,text:ad.replace(`{{sessionMemory}}`,n).replace(`{{userMessages}}`,r.join(`
|
|
388
|
-
|
|
389
|
-
---
|
|
390
|
-
|
|
391
|
-
`)).replace(`{{userDescriptionBlock}}`,i)}]}})}P();var sd=`# /stuck — diagnose frozen/slow Work Mate sessions
|
|
392
|
-
|
|
393
|
-
The user thinks another Work Mate session on this machine is frozen, stuck, or very slow. Investigate and post a report to #claude-code-feedback.
|
|
394
|
-
|
|
395
|
-
## What to look for
|
|
396
|
-
|
|
397
|
-
Scan for other Work Mate processes (excluding the current one — PID is in \`process.pid\` but for shell commands just exclude the PID you see running this prompt). Process names are typically \`claude\` (installed) or \`cli\` (native dev build).
|
|
398
|
-
|
|
399
|
-
Signs of a stuck session:
|
|
400
|
-
- **High CPU (≥90%) sustained** — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.
|
|
401
|
-
- **Process state \`D\` (uninterruptible sleep)** — often an I/O hang. The \`state\` column in \`ps\` output; first character matters (ignore modifiers like \`+\`, \`s\`, \`<\`).
|
|
402
|
-
- **Process state \`T\` (stopped)** — user probably hit Ctrl+Z by accident.
|
|
403
|
-
- **Process state \`Z\` (zombie)** — parent isn't reaping.
|
|
404
|
-
- **Very high RSS (≥4GB)** — possible memory leak making the session sluggish.
|
|
405
|
-
- **Stuck child process** — a hung \`git\`, \`node\`, or shell subprocess can freeze the parent. Check \`pgrep -lP <pid>\` for each session.
|
|
406
|
-
|
|
407
|
-
## Investigation steps
|
|
408
|
-
|
|
409
|
-
1. **List all Work Mate processes** (macOS/Linux):
|
|
410
|
-
\`\`\`
|
|
411
|
-
ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(claude|cli)' | grep -v grep
|
|
412
|
-
\`\`\`
|
|
413
|
-
Filter to rows where \`comm\` is \`claude\` or (\`cli\` AND the command path contains "claude").
|
|
414
|
-
|
|
415
|
-
2. **For anything suspicious**, gather more context:
|
|
416
|
-
- Child processes: \`pgrep -lP <pid>\`
|
|
417
|
-
- If high CPU: sample again after 1-2s to confirm it's sustained
|
|
418
|
-
- If a child looks hung (e.g., a git command), note its full command line with \`ps -p <child_pid> -o command=\`
|
|
419
|
-
- Check the session's debug log if you can infer the session ID: \`~/.claude/debug/<session-id>.txt\` (the last few hundred lines often show what it was doing before hanging)
|
|
420
|
-
|
|
421
|
-
3. **Consider a stack dump** for a truly frozen process (advanced, optional):
|
|
422
|
-
- macOS: \`sample <pid> 3\` gives a 3-second native stack sample
|
|
423
|
-
- This is big — only grab it if the process is clearly hung and you want to know *why*
|
|
424
|
-
|
|
425
|
-
## Report
|
|
426
|
-
|
|
427
|
-
**Only post to Slack if you actually found something stuck.** If every session looks healthy, tell the user that directly — do not post an all-clear to the channel.
|
|
428
|
-
|
|
429
|
-
If you did find a stuck/slow session, post to **#claude-code-feedback** (channel ID: \`C07VBSHV7EV\`) using the Slack MCP tool. Use SearchExtraTools to find \`slack_send_message\` if it's not already loaded.
|
|
430
|
-
|
|
431
|
-
**Use a two-message structure** to keep the channel scannable:
|
|
432
|
-
|
|
433
|
-
1. **Top-level message** — one short line: hostname, Work Mate version, and a terse symptom (e.g. "session PID 12345 pegged at 100% CPU for 10min" or "git subprocess hung in D state"). No code blocks, no details.
|
|
434
|
-
2. **Thread reply** — the full diagnostic dump. Pass the top-level message's \`ts\` as \`thread_ts\`. Include:
|
|
435
|
-
- PID, CPU%, RSS, state, uptime, command line, child processes
|
|
436
|
-
- Your diagnosis of what's likely wrong
|
|
437
|
-
- Relevant debug log tail or \`sample\` output if you captured it
|
|
438
|
-
|
|
439
|
-
If Slack MCP isn't available, format the report as a message the user can copy-paste into #claude-code-feedback (and let them know to thread the details themselves).
|
|
440
|
-
|
|
441
|
-
## Notes
|
|
442
|
-
- Don't kill or signal any processes — this is diagnostic only.
|
|
443
|
-
- If the user gave an argument (e.g., a specific PID or symptom), focus there first.
|
|
444
|
-
`;function cd(){process.env.USER_TYPE===`ant`&&N({name:`stuck`,description:`[ANT-ONLY] Investigate frozen/stuck/slow Work Mate sessions on this machine and post a diagnostic report to #claude-code-feedback.`,userInvocable:!0,async getPromptForCommand(e){let t=sd;return e&&(t+=`\n## User-provided context\n\n${e}\n`),[{type:`text`,text:t}]}})}P();var ld=`# /ultracode — Workflow Orchestration Playbook
|
|
445
|
-
|
|
446
|
-
Execute a workflow script that orchestrates multiple subagents deterministically. Workflows run in the background — this tool returns immediately with a task ID, and a \`<task-notification>\` arrives when the workflow completes. Use \`/workflows\` to watch live progress.
|
|
447
|
-
|
|
448
|
-
A workflow structures work across many agents — to be comprehensive (decompose and cover in parallel), to be confident (independent perspectives and adversarial checks before committing), or to take on scale one context can't hold (migrations, audits, broad sweeps). The script is where you encode that structure: what fans out, what verifies, what synthesizes.
|
|
449
|
-
|
|
450
|
-
ONLY call this tool when the user has explicitly opted into multi-agent orchestration. Workflows can spawn dozens of agents and consume a large amount of tokens; the user must request that scale, not have it inferred. Explicit opt-in means one of:
|
|
451
|
-
|
|
452
|
-
- The user included the keyword "ultracode" in their prompt (you'll see a system-reminder confirming it).
|
|
453
|
-
- Ultracode is on for the session (a system-reminder confirms it) — see **Ultracode** below.
|
|
454
|
-
- The user directly asked you to run a workflow or use multi-agent orchestration in their own words ("use a workflow", "run a workflow", "fan out agents", "orchestrate this with subagents"). The ask must be in the user's words — a task that would merely benefit from a workflow does not count.
|
|
455
|
-
- The user invoked a skill or slash command whose instructions tell you to call Workflow.
|
|
456
|
-
- The user asked you to run a specific named or saved workflow.
|
|
457
|
-
|
|
458
|
-
For any other task — even one that would clearly benefit from parallelism — do NOT call this tool. Use the Agent tool for individual subagents, or briefly describe what a multi-agent workflow could do and how much it would roughly cost, and ask the user whether to run it. Mention they can ask for one with "use a workflow" in a future message to skip the ask.
|
|
459
|
-
|
|
460
|
-
When you do call it, the right move is often **hybrid**: scout inline first (list the files, find the channels, scope the diff) to discover the work-list, then call Workflow to pipeline over it. You don't need to know the shape before the *task* — only before the *orchestration step*.
|
|
461
|
-
|
|
462
|
-
Common single-phase workflows you can chain across turns:
|
|
463
|
-
|
|
464
|
-
- **Understand** — parallel readers over relevant subsystems → structured map
|
|
465
|
-
- **Design** — judge panel of N independent approaches → scored synthesis
|
|
466
|
-
- **Review** — dimensions → find → adversarially verify (example below)
|
|
467
|
-
- **Research** — multi-modal sweep → deep-read → synthesize
|
|
468
|
-
- **Migrate** — discover sites → transform each (worktree isolation) → verify
|
|
469
|
-
|
|
470
|
-
For larger work, run several in sequence — read each result before deciding the next phase. You stay in the loop; each workflow is one well-scoped fan-out.
|
|
471
|
-
|
|
472
|
-
**Opt-in is harness-injected, not repo-controlled.** The "ultracode is on for the session" system-reminder is produced by the harness (claude.ai/client), not by this skill or any repo state. This skill is knowledge-only — it injects the playbook and toggles nothing. There is no in-repo feature flag, env var, or effort level for ultracode; do not add one. The Workflow tool is compiled in via the build-time WORKFLOW_SCRIPTS feature flag and exposes no per-session runtime gate.
|
|
473
|
-
|
|
474
|
-
**Ultracode.** When a system-reminder confirms ultracode is on, that opt-in is standing: author and run a workflow for every substantive task by default. The goal is the most exhaustive, correct answer you can produce — token cost is not a constraint. For multi-phase work (understand → design → implement → review), that often means several workflows in sequence — one per phase — so you stay in the loop between them. The quality patterns below (adversarial verify, multi-modal sweep, completeness critic, loop-until-dry) are the tools; pick what fits the task. Lean toward orchestrating with workflows and adversarially verifying your findings — unless the work is trivial or already verified. Solo only on conversational turns or trivial mechanical edits. When a reminder says ultracode is off, revert to the opt-in rule above.
|
|
475
|
-
|
|
476
|
-
Pass the script inline via \`script\` — do not Write it to a file first. Every invocation automatically persists its script to a file under the session directory and returns the path in the tool result. To iterate on a workflow, edit that file with Write/Edit and re-invoke Workflow with \`{scriptPath: "<path>"}\` instead of resending the full script.
|
|
477
|
-
|
|
478
|
-
Every script must begin with \`export const meta = {...}\`:
|
|
479
|
-
|
|
480
|
-
\`\`\`js
|
|
481
|
-
export const meta = {
|
|
482
|
-
name: 'find-flaky-tests',
|
|
483
|
-
description: 'Find flaky tests and propose fixes', // one-line, shown in permission dialog
|
|
484
|
-
phases: [ // one entry per phase() call
|
|
485
|
-
{ title: 'Scan', detail: 'grep test logs for retries' },
|
|
486
|
-
{ title: 'Fix', detail: 'one agent per flaky test' },
|
|
487
|
-
],
|
|
488
|
-
}
|
|
489
|
-
// script body starts here — use agent()/parallel()/pipeline()/phase()/log()
|
|
490
|
-
phase('Scan')
|
|
491
|
-
const flaky = await agent('grep CI logs for retry markers', {schema: FLAKY_SCHEMA})
|
|
492
|
-
...
|
|
493
|
-
\`\`\`
|
|
494
|
-
|
|
495
|
-
The \`meta\` object must be a PURE LITERAL — no variables, function calls, spreads, or template interpolation. Required fields: \`name\`, \`description\`. Optional: \`whenToUse\` (shown in the workflow list), \`phases\`. Use the SAME phase titles in meta.phases as in phase() calls — titles are matched exactly; a phase() call with no matching meta entry just gets its own progress group. Add \`model\` to a phase entry when that phase uses a specific model override.
|
|
496
|
-
|
|
497
|
-
Script body hooks:
|
|
498
|
-
|
|
499
|
-
- \`agent(prompt: string, opts?: {label?: string, phase?: string, schema?: object, model?: string, isolation?: 'worktree', agentType?: string}): Promise<any>\` — spawn a subagent. Without schema, returns its final text as a string. With schema (a JSON Schema), the subagent is forced to call a StructuredOutput tool and agent() returns the validated object — no parsing needed. Returns null if the user skips the agent mid-run or the subagent dies on a terminal API error after retries (filter with .filter(Boolean)). opts.label overrides the display label. opts.phase explicitly assigns this agent to a progress group (use this inside pipeline()/parallel() stages to avoid races on the global phase() state — same phase string → same group box). opts.model overrides the model for this agent call. Default to omitting it — the agent inherits the main-loop model (the resolved session model), which is almost always correct. Only set it when you're highly confident a different tier fits the task; when unsure, omit. opts.isolation: 'worktree' runs the agent in a fresh git worktree — EXPENSIVE (~200-500ms setup + disk per agent), use ONLY when agents mutate files in parallel and would otherwise conflict; the worktree is auto-removed if unchanged. opts.agentType uses a custom subagent type (e.g. 'Explore', 'code-reviewer') instead of the default workflow subagent — resolved from the same registry as the Agent tool; composes with schema (the custom agent's system prompt gets a StructuredOutput instruction appended).
|
|
500
|
-
- \`pipeline(items, stage1, stage2, ...): Promise<any[]>\` — run each item through all stages independently, NO barrier between stages. Item A can be in stage 3 while item B is still in stage 1. This is the DEFAULT for multi-stage work. Wall-clock = slowest single-item chain, not sum-of-slowest-per-stage. Every stage callback receives (prevResult, originalItem, index) — use originalItem/index in later stages to label work without threading context through stage 1's return value. A stage that throws drops that item to \`null\` and skips its remaining stages.
|
|
501
|
-
- \`parallel(thunks: Array<() => Promise<any>>): Promise<any[]>\` — run tasks concurrently. This is a BARRIER: awaits all thunks before returning. A thunk that throws (or whose agent errors) resolves to \`null\` in the result array — the call itself never rejects, so \`.filter(Boolean)\` before using the results. Use ONLY when you genuinely need all results together.
|
|
502
|
-
- \`log(message: string): void\` — emit a progress message to the user (shown as a narrator line above the progress tree)
|
|
503
|
-
- \`phase(title: string): void\` — start a new phase; subsequent agent() calls are grouped under this title in the progress display
|
|
504
|
-
- \`args: any\` — the value passed as Workflow's \`args\` input, verbatim (undefined if not provided). Pass arrays/objects as actual JSON values in the tool call, NOT as a JSON-encoded string — \`args: ["a.ts", "b.ts"]\`, not \`args: "[\\"a.ts\\", ...]"\` (a stringified list reaches the script as one string, so \`args.filter\`/\`args.map\` throw). Use this to parameterize named workflows — e.g. pass a research question, target path, or config object directly instead of via a side-channel file.
|
|
505
|
-
- \`budget: {total: number|null, spent(): number, remaining(): number}\` — the turn's token target from the user's "+500k"-style directive. \`budget.total\` is null if no target was set. \`budget.spent()\` returns output tokens spent this turn across the main loop and all workflows — the pool is shared, not per-workflow. \`budget.remaining()\` returns \`max(0, total - spent())\`, or \`Infinity\` if no target. The target is a HARD ceiling, not advisory: once \`spent()\` reaches \`total\`, further \`agent()\` calls throw. Use for dynamic loops: \`while (budget.total && budget.remaining() > 50_000) { ... }\`, or static scaling: \`const FLEET = budget.total ? Math.floor(budget.total / 100_000) : 5\`.
|
|
506
|
-
- \`workflow(nameOrRef: string | {scriptPath: string}, args?: any): Promise<any>\` — run another workflow inline as a sub-step and return whatever it returns. Pass a name to invoke a saved workflow (same registry as {name: "..."}), or {scriptPath} to run a script file you Wrote earlier. The child shares this run's concurrency cap, agent counter, abort signal, and token budget — its agents appear under a "▸ name" group in /workflows and its tokens count toward budget.spent(). The args param becomes the child's \`args\` global. Nesting is one level only: workflow() inside a child throws. Throws on unknown name / unreadable scriptPath / child syntax error; catch to handle gracefully.
|
|
507
|
-
|
|
508
|
-
Concurrent agent() calls are capped at 3 by default per workflow — excess calls queue and run as slots free up. The Workflow tool accepts an optional \`maxConcurrency\` input (1–16) to override per-run. OMIT it to use 3. To set maxConcurrency to ANY value other than 3, you MUST first ask the user via AskUserQuestion (offer 3 / 6 / 9 with 3 marked "(Recommended)") — the ONLY exception is when the user has already specified a number this session ("use 6", "maxConcurrency 9"). Never silently raise concurrency above 3 just because the workflow fans out; 3 is the recommended default. You can still pass 100 items to parallel()/pipeline() and they all complete; only the configured number run at any moment. Total agent count across a workflow's lifetime is capped at 1000 — a runaway-loop backstop set far above any real workflow. A single parallel()/pipeline() call accepts at most 4096 items; passing more is an explicit error, not a silent truncation.
|
|
509
|
-
|
|
510
|
-
Model tier per task — when you DO override opts.model. Valid aliases: 'haiku' | 'sonnet' | 'opus' | 'best' | 'sonnet[1m]' | 'opus[1m]' | 'opusplan'. The main loop already runs on the user's chosen tier (usually sonnet), so omit model for most agents. Override only when the task clearly fits a different tier:
|
|
511
|
-
|
|
512
|
-
- 'haiku' — fast and cheap (~5x cheaper/faster than sonnet). Use for: classification, extraction, labeling, regex-like pattern matching, "does this match X?" gating, simple format conversions. Wrong choice for anything reasoning over multiple concepts or producing code.
|
|
513
|
-
- 'sonnet' — the workhorse. Most code edits, multi-file reading, tool-use chains, schema/structured output, code review, refactoring, debugging. When in doubt, OMIT model and let the agent inherit this.
|
|
514
|
-
- 'opus' — strongest reasoning, slowest and most expensive (~5x sonnet cost). Use for: architecture decisions, deep root-causing across modules, novel algorithm design, adversarial verification of sonnet's findings, security review. Reserve for the 1-2 agents per workflow where reasoning actually matters.
|
|
515
|
-
- 'best' — provider's "best available" (currently opus-tier). Use when you want max intelligence and don't care about cost or pinning a tier.
|
|
516
|
-
|
|
517
|
-
Rule of thumb: if you can't articulate WHY this agent needs a different tier, omit model. A workflow that mixes tiers deliberately (haiku to triage → sonnet for the work → opus to verify) usually beats uniform opus-everywhere on cost AND quality. Don't put opus on every dimension of a 9-dimension review — sonnet finds the bugs, opus verifies the few that matter.
|
|
518
|
-
|
|
519
|
-
Subagents are told their final text IS the return value (not a human-facing message), so they return raw data. For structured output, use the schema option — validation happens at the tool-call layer so the model retries on mismatch.
|
|
520
|
-
|
|
521
|
-
Workflow agents can reach all session-connected MCP tools via ToolSearch — schemas load on demand per agent. Caveat: interactively-authenticated MCP servers (e.g. claude.ai) may be absent in headless/cron runs.
|
|
522
|
-
|
|
523
|
-
Scripts are plain JavaScript, NOT TypeScript — type annotations (\`: string[]\`), interfaces, and generics fail to parse. The script body runs in an async context — use \`await\` directly. Standard JS built-ins (JSON, Math, Array, etc.) are available — EXCEPT \`Date.now()\`/\`Math.random()\`/argless \`new Date()\`, which throw (they would break resume); pass timestamps in via \`args\`, stamp results after the workflow returns, and for randomness vary the agent prompt/label by index. No filesystem or Node.js API access.
|
|
524
|
-
|
|
525
|
-
DEFAULT TO pipeline(). Only reach for a barrier (parallel between stages) when you genuinely need ALL prior-stage results together.
|
|
526
|
-
|
|
527
|
-
A barrier is correct ONLY when stage N needs cross-item context from all of stage N-1:
|
|
528
|
-
|
|
529
|
-
- Dedup/merge across the full result set before expensive downstream work
|
|
530
|
-
- Early-exit if the total count is zero ("0 bugs found → skip verification entirely")
|
|
531
|
-
- Stage N's prompt references "the other findings" for comparison
|
|
532
|
-
|
|
533
|
-
A barrier is NOT justified by:
|
|
534
|
-
|
|
535
|
-
- "I need to flatten/map/filter first" — do it inside a pipeline stage: \`pipeline(items, stageA, r => transform([r]).flat(), stageB)\`
|
|
536
|
-
- "The stages are conceptually separate" — that's what pipeline() models. Separate stages ≠ synchronized stages.
|
|
537
|
-
- "It's cleaner code" — barrier latency is real. If 5 finders run and the slowest takes 3× the fastest, a barrier wastes 2/3 of the fast finders' idle time.
|
|
538
|
-
|
|
539
|
-
Smell test: if you wrote
|
|
540
|
-
|
|
541
|
-
\`\`\`js
|
|
542
|
-
const a = await parallel(...)
|
|
543
|
-
const b = transform(a) // flatten, map, filter — no cross-item dependency
|
|
544
|
-
const c = await parallel(b.map(...))
|
|
545
|
-
\`\`\`
|
|
546
|
-
|
|
547
|
-
that middle transform doesn't need the barrier. Rewrite as a pipeline with the transform inside a stage. When in doubt: pipeline.
|
|
548
|
-
|
|
549
|
-
The canonical multi-stage pattern — pipeline by default, each dimension verifies as soon as its review completes:
|
|
550
|
-
|
|
551
|
-
\`\`\`js
|
|
552
|
-
export const meta = {
|
|
553
|
-
name: 'review-changes',
|
|
554
|
-
description: 'Review changed files across dimensions, verify each finding',
|
|
555
|
-
phases: [{ title: 'Review' }, { title: 'Verify' }],
|
|
556
|
-
}
|
|
557
|
-
const DIMENSIONS = [{key: 'bugs', prompt: '...'}, {key: 'perf', prompt: '...'}]
|
|
558
|
-
const results = await pipeline(
|
|
559
|
-
DIMENSIONS,
|
|
560
|
-
d => agent(d.prompt, {label: \`review:\${d.key}\`, phase: 'Review', schema: FINDINGS_SCHEMA}),
|
|
561
|
-
review => parallel(review.findings.map(f => () =>
|
|
562
|
-
agent(\`Adversarially verify: \${f.title}\`, {label: \`verify:\${f.file}\`, phase: 'Verify', schema: VERDICT_SCHEMA})
|
|
563
|
-
.then(v => ({...f, verdict: v}))
|
|
564
|
-
))
|
|
565
|
-
)
|
|
566
|
-
const confirmed = results.flat().filter(Boolean).filter(f => f.verdict?.isReal)
|
|
567
|
-
return { confirmed }
|
|
568
|
-
// Dimension 'bugs' findings verify while dimension 'perf' is still reviewing. No wasted wall-clock.
|
|
569
|
-
\`\`\`
|
|
570
|
-
|
|
571
|
-
When a barrier IS correct — dedup across all findings before expensive verification:
|
|
572
|
-
|
|
573
|
-
\`\`\`js
|
|
574
|
-
const all = await parallel(DIMENSIONS.map(d => () => agent(d.prompt, {schema: FINDINGS_SCHEMA})))
|
|
575
|
-
const deduped = dedupeByFileAndLine(all.filter(Boolean).flatMap(r => r.findings)) // <-- genuinely needs ALL at once
|
|
576
|
-
const verified = await parallel(deduped.map(f => () => agent(verifyPrompt(f), {schema: VERDICT_SCHEMA})))
|
|
577
|
-
\`\`\`
|
|
578
|
-
|
|
579
|
-
Loop-until-count pattern — accumulate to a target:
|
|
580
|
-
|
|
581
|
-
\`\`\`js
|
|
582
|
-
const bugs = []
|
|
583
|
-
while (bugs.length < 10) {
|
|
584
|
-
const result = await agent("Find bugs in this codebase.", {schema: BUGS_SCHEMA})
|
|
585
|
-
bugs.push(...result.bugs)
|
|
586
|
-
log(\`\${bugs.length}/10 found\`)
|
|
587
|
-
}
|
|
588
|
-
\`\`\`
|
|
589
|
-
|
|
590
|
-
Loop-until-budget pattern — scale depth to the user's "+500k" directive. Guard on budget.total: with no target set, remaining() is Infinity and the loop would run straight to the 1000-agent cap.
|
|
591
|
-
|
|
592
|
-
\`\`\`js
|
|
593
|
-
const bugs = []
|
|
594
|
-
while (budget.total && budget.remaining() > 50_000) {
|
|
595
|
-
const result = await agent("Find bugs in this codebase.", {schema: BUGS_SCHEMA})
|
|
596
|
-
bugs.push(...result.bugs)
|
|
597
|
-
log(\`\${bugs.length} found, \${Math.round(budget.remaining()/1000)}k remaining\`)
|
|
598
|
-
}
|
|
599
|
-
\`\`\`
|
|
600
|
-
|
|
601
|
-
Composing patterns — exhaustive review (find → dedup vs seen → diverse-lens panel → loop-until-dry):
|
|
602
|
-
|
|
603
|
-
\`\`\`js
|
|
604
|
-
const seen = new Set(), confirmed = []
|
|
605
|
-
let dry = 0
|
|
606
|
-
while (dry < 2) { // loop-until-dry
|
|
607
|
-
const found = (await parallel(FINDERS.map(f => () => // barrier: collect all finders this round
|
|
608
|
-
agent(f.prompt, {phase: 'Find', schema: BUGS})))).filter(Boolean).flatMap(r => r.bugs)
|
|
609
|
-
const fresh = found.filter(b => !seen.has(key(b))) // dedup vs ALL seen — plain code, not an agent
|
|
610
|
-
if (!fresh.length) { dry++; continue }
|
|
611
|
-
dry = 0; fresh.forEach(b => seen.add(key(b)))
|
|
612
|
-
const judged = await parallel(fresh.map(b => () => // every fresh bug judged concurrently...
|
|
613
|
-
parallel(['correctness','security','repro'].map(lens => () => // ...each by 3 distinct lenses
|
|
614
|
-
agent(\`Judge "\${b.desc}" via the \${lens} lens — real?\`, {phase: 'Verify', schema: VERDICT})))
|
|
615
|
-
.then(vs => ({ b, real: vs.filter(Boolean).filter(v => v.real).length >= 2 }))))
|
|
616
|
-
confirmed.push(...judged.filter(v => v.real).map(v => v.b))
|
|
617
|
-
}
|
|
618
|
-
return confirmed
|
|
619
|
-
// dedup vs \`seen\`, NOT \`confirmed\` — else judge-rejected findings reappear every round and it never converges.
|
|
620
|
-
\`\`\`
|
|
621
|
-
|
|
622
|
-
Quality patterns — common shapes; pick by task and compose freely:
|
|
623
|
-
|
|
624
|
-
- Adversarial verify: spawn N independent skeptics per finding, each prompted to REFUTE. Kill if ≥majority refute. Prevents plausible-but-wrong findings from surviving.
|
|
625
|
-
|
|
626
|
-
\`\`\`js
|
|
627
|
-
const votes = await parallel(Array.from({length: 3}, () => () =>
|
|
628
|
-
agent(\`Try to refute: \${claim}. Default to refuted=true if uncertain.\`, {schema: VERDICT})))
|
|
629
|
-
const survives = votes.filter(Boolean).filter(v => !v.refuted).length >= 2
|
|
630
|
-
\`\`\`
|
|
631
|
-
|
|
632
|
-
- Perspective-diverse verify: when a finding can fail in more than one way, give each verifier a distinct lens (correctness, security, perf, does-it-reproduce) instead of N identical refuters — diversity catches failure modes redundancy can't.
|
|
633
|
-
- Judge panel: generate N independent attempts from different angles (e.g. MVP-first, risk-first, user-first), score with parallel judges, synthesize from the winner while grafting the best ideas from runners-up. Beats one-attempt-iterated when the solution space is wide.
|
|
634
|
-
- Loop-until-dry: for unknown-size discovery (bugs, issues, edge cases), keep spawning finders until K consecutive rounds return nothing new. Simple counters (while count < N) miss the tail.
|
|
635
|
-
- Multi-modal sweep: parallel agents each searching a different way (by-container, by-content, by-entity, by-time). Each is blind to what the others surface; useful when one search angle won't find everything.
|
|
636
|
-
- Completeness critic: a final agent that asks "what's missing — modality not run, claim unverified, source unread?" What it finds becomes the next round of work.
|
|
637
|
-
- No silent caps: if a workflow bounds coverage (top-N, no-retry, sampling), \`log()\` what was dropped — silent truncation reads as "covered everything" when it didn't.
|
|
638
|
-
|
|
639
|
-
Scale to what the user asked for. "find any bugs" → a few finders, single-vote verify. "thoroughly audit this" or "be comprehensive" → larger finder pool, 3–5 vote adversarial pass, synthesis stage. When unsure, lean toward thoroughness for research/review/audit requests and toward brevity for quick checks.
|
|
640
|
-
|
|
641
|
-
These patterns aren't exhaustive — compose novel harnesses when the task calls for it (tournament brackets, self-repair loops, staged escalation, whatever fits).
|
|
642
|
-
|
|
643
|
-
Use this tool for multi-step orchestration where control flow should be deterministic (loops, conditionals, fan-out) rather than model-driven.
|
|
644
|
-
|
|
645
|
-
## Resume
|
|
646
|
-
|
|
647
|
-
The tool result includes a runId. To resume after a pause, kill, or script edit, relaunch with \`Workflow({scriptPath, resumeFromRunId})\` — the longest unchanged prefix of agent() calls returns cached results instantly; the first edited/new call and everything after it runs live. Same script + same args → 100% cache hit. Date.now()/Math.random()/new Date() are unavailable in scripts (they would break this) — stamp results after the workflow returns, or pass timestamps via args. Fallback when no journal is available: Read agent-<id>.jsonl files in the transcript directory and hand-author a continuation script.
|
|
648
|
-
`;function ud(){N({name:`ultracode`,description:`Enter multi-agent workflow orchestration mode: when to use the Workflow tool, script primitives, quality patterns, determinism constraints, resume/budget, and files/commands.`,whenToUse:`When a task can be decomposed or parallelized, needs multi-perspective confidence (e.g. find then adversarially verify), exceeds a single context (large migrations, broad audits, long-tail enumeration), or needs resume/auditability — orchestrate multiple subagents with the Workflow tool.`,userInvocable:!0,async getPromptForCommand(e){let t=ld;return e&&(t+=`\n## User input\n\n${e}\n`),[{type:`text`,text:t}]}})}P();function dd(){N({name:`loop`,description:`Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo, defaults to 10m)`,whenToUse:`When the user wants to set up a recurring task, poll for status, or run something repeatedly on an interval (e.g. "check the deploy every 5 minutes", "keep running /babysit-prs"). Do NOT invoke for one-off tasks.`,argumentHint:`[interval] <prompt>`,userInvocable:!1,isEnabled:()=>!1,async getPromptForCommand(){return[{type:`text`,text:`The /loop command is no longer available.`}]}})}Xa(),At(),gi(),S(),P();var fd=`# Dream: Memory Consolidation (manual run)
|
|
649
|
-
|
|
650
|
-
You are performing a manual dream — a reflective pass over your memory files. Unlike the automatic background dream, this run has full tool permissions and the user is watching. Synthesize what you've learned recently into durable, well-organized memories so that future sessions can orient quickly.
|
|
651
|
-
|
|
652
|
-
`;function pd(){N({name:`dream`,description:`Manually trigger memory consolidation — review, organize, and prune your auto-memory files.`,whenToUse:`Use when the user says /dream or wants to manually consolidate memories, organize memory files, or clean up stale entries.`,userInvocable:!0,isEnabled:()=>Ya(),async getPromptForCommand(e){let t=Qa(),n=ea(Ke());await Ur();let r=fd+Pn(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}var md=`# CLI
|
|
653
|
-
`,hd=`# Server
|
|
654
|
-
`,gd=`# Skill
|
|
655
|
-
`,_d={"examples/cli.md":md,"examples/server.md":hd};P();var{frontmatter:vd,content:yd}=br(gd),bd=typeof vd.description==`string`?vd.description:`Verify a code change does what it should by running the app.`;function xd(){process.env.USER_TYPE===`ant`&&N({name:`verify`,description:bd,userInvocable:!0,files:_d,async getPromptForCommand(e){let t=[yd.trimStart()];return e&&t.push(`## User Request\n\n${e}`),[{type:`text`,text:t.join(`
|
|
656
|
-
|
|
657
|
-
`)}]}})}var Sd=i({registerScheduleRemoteAgentsSkill:()=>Ad});function Cd(e){if(!e.startsWith(`mcpsrv_`))return null;let t=e.slice(7).slice(2),n=0n;for(let e of t){let t=jd.indexOf(e);if(t===-1)return null;n=n*58n+BigInt(t)}let r=n.toString(16).padStart(32,`0`);return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20,32)}`}function wd(e){let t=[];for(let n of e){if(n.type!==`connected`||n.config.type!==`claudeai-proxy`)continue;let e=Cd(n.config.id);e&&t.push({uuid:e,name:n.name,url:n.config.url})}return t}function Td(e){return e.replace(/^claude[.\s-]ai[.\s-]/i,``).replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function Ed(e){if(e.length===0)return`No connected MCP connectors found. The user may need to connect servers at https://claude.ai/settings/connectors`;let t=[`Connected connectors (available for triggers):`];for(let n of e){let e=Td(n.name);t.push(`- ${n.name} (connector_uuid: ${n.uuid}, name: ${e}, url: ${n.url})`)}return t.join(`
|
|
658
|
-
`)}function Dd(e){return`⚠ Heads-up:\n${e.map(e=>`- ${e}`).join(`
|
|
659
|
-
`)}`}async function Od(){let e=await ho();if(!e)return null;let t=pc(e);return t?`https://${t.host}/${t.owner}/${t.name}`:null}function kd(e){let{userTimezone:t,connectorsInfo:n,gitRepoUrl:r,environmentsInfo:i,createdEnvironment:a,setupNotes:o,needsGitHubAccessReminder:s,userArgs:c}=e,l=c&&o.length>0?`\n## Setup Notes\n\n${Dd(o)}\n`:``,u=o.length>0?`${Dd(o)}\n\n${Md}`:Md;return`# Schedule Remote Agents
|
|
660
|
-
|
|
661
|
-
You are helping the user schedule, update, list, or run **remote** Work Mate agents. These are NOT local cron jobs — each trigger spawns a fully isolated remote session (CCR) in cloud infrastructure on a cron schedule. The agent runs in a sandboxed environment with its own git checkout, tools, and optional MCP connections.
|
|
662
|
-
|
|
663
|
-
## First Step
|
|
664
|
-
|
|
665
|
-
${c?`The user has already told you what they want (see User Request at the bottom). Skip the initial question and go directly to the matching workflow.`:`Your FIRST action must be a single ${Is} tool call (no preamble). Use this EXACT string for the \`question\` field — do not paraphrase or shorten it:
|
|
666
|
-
|
|
667
|
-
${wa(u)}
|
|
668
|
-
|
|
669
|
-
Set \`header: "Action"\` and offer the four actions (create/list/update/run) as options. After the user picks, follow the matching workflow below.`}
|
|
670
|
-
${l}
|
|
671
|
-
|
|
672
|
-
## What You Can Do
|
|
673
|
-
|
|
674
|
-
Use the \`${Ei}\` tool (load it first with \`SearchExtraTools select:${Ei}\`; auth is handled in-process — do not use curl):
|
|
675
|
-
|
|
676
|
-
- \`{action: "list"}\` — list all triggers
|
|
677
|
-
- \`{action: "get", trigger_id: "..."}\` — fetch one trigger
|
|
678
|
-
- \`{action: "create", body: {...}}\` — create a trigger
|
|
679
|
-
- \`{action: "update", trigger_id: "...", body: {...}}\` — partial update
|
|
680
|
-
- \`{action: "run", trigger_id: "..."}\` — run a trigger now
|
|
681
|
-
|
|
682
|
-
You CANNOT delete triggers. If the user asks to delete, direct them to: https://claude.ai/code/scheduled
|
|
683
|
-
|
|
684
|
-
## Create body shape
|
|
685
|
-
|
|
686
|
-
\`\`\`json
|
|
687
|
-
{
|
|
688
|
-
"name": "AGENT_NAME",
|
|
689
|
-
"cron_expression": "CRON_EXPR",
|
|
690
|
-
"enabled": true,
|
|
691
|
-
"job_config": {
|
|
692
|
-
"ccr": {
|
|
693
|
-
"environment_id": "ENVIRONMENT_ID",
|
|
694
|
-
"session_context": {
|
|
695
|
-
"model": "claude-sonnet-4-6",
|
|
696
|
-
"sources": [
|
|
697
|
-
{"git_repository": {"url": "${r||`https://github.com/ORG/REPO`}"}}
|
|
698
|
-
],
|
|
699
|
-
"allowed_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep"]
|
|
700
|
-
},
|
|
701
|
-
"events": [
|
|
702
|
-
{"data": {
|
|
703
|
-
"uuid": "<lowercase v4 uuid>",
|
|
704
|
-
"session_id": "",
|
|
705
|
-
"type": "user",
|
|
706
|
-
"parent_tool_use_id": null,
|
|
707
|
-
"message": {"content": "PROMPT_HERE", "role": "user"}
|
|
708
|
-
}}
|
|
709
|
-
]
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
\`\`\`
|
|
714
|
-
|
|
715
|
-
Generate a fresh lowercase UUID for \`events[].data.uuid\` yourself.
|
|
716
|
-
|
|
717
|
-
## Available MCP Connectors
|
|
718
|
-
|
|
719
|
-
These are the user's currently connected claude.ai MCP connectors:
|
|
720
|
-
|
|
721
|
-
${n}
|
|
722
|
-
|
|
723
|
-
When attaching connectors to a trigger, use the \`connector_uuid\` and \`name\` shown above (the name is already sanitized to only contain letters, numbers, hyphens, and underscores), and the connector's URL. The \`name\` field in \`mcp_connections\` must only contain \`[a-zA-Z0-9_-]\` — dots and spaces are NOT allowed.
|
|
724
|
-
|
|
725
|
-
**Important:** Infer what services the agent needs from the user's description. For example, if they say "check Datadog and Slack me errors," the agent needs both Datadog and Slack connectors. Cross-reference against the list above and warn if any required service isn't connected. If a needed connector is missing, direct the user to https://claude.ai/settings/connectors to connect it first.
|
|
726
|
-
|
|
727
|
-
## Environments
|
|
728
|
-
|
|
729
|
-
Every trigger requires an \`environment_id\` in the job config. This determines where the remote agent runs. Ask the user which environment to use.
|
|
730
|
-
|
|
731
|
-
${i}
|
|
732
|
-
|
|
733
|
-
Use the \`id\` value as the \`environment_id\` in \`job_config.ccr.environment_id\`.
|
|
734
|
-
${a?`\n**Note:** A new environment \`${a.name}\` (id: \`${a.environment_id}\`) was just created for the user because they had none. Use this id for \`job_config.ccr.environment_id\` and mention the creation when you confirm the trigger config.\n`:``}
|
|
735
|
-
|
|
736
|
-
## API Field Reference
|
|
737
|
-
|
|
738
|
-
### Create Trigger — Required Fields
|
|
739
|
-
- \`name\` (string) — A descriptive name
|
|
740
|
-
- \`cron_expression\` (string) — 5-field cron. **Minimum interval is 1 hour.**
|
|
741
|
-
- \`job_config\` (object) — Session configuration (see structure above)
|
|
742
|
-
|
|
743
|
-
### Create Trigger — Optional Fields
|
|
744
|
-
- \`enabled\` (boolean, default: true)
|
|
745
|
-
- \`mcp_connections\` (array) — MCP servers to attach:
|
|
746
|
-
\`\`\`json
|
|
747
|
-
[{"connector_uuid": "uuid", "name": "server-name", "url": "https://..."}]
|
|
748
|
-
\`\`\`
|
|
749
|
-
|
|
750
|
-
### Update Trigger — Optional Fields
|
|
751
|
-
All fields optional (partial update):
|
|
752
|
-
- \`name\`, \`cron_expression\`, \`enabled\`, \`job_config\`
|
|
753
|
-
- \`mcp_connections\` — Replace MCP connections
|
|
754
|
-
- \`clear_mcp_connections\` (boolean) — Remove all MCP connections
|
|
755
|
-
|
|
756
|
-
### Cron Expression Examples
|
|
757
|
-
|
|
758
|
-
The user's local timezone is **${t}**. Cron expressions are always in UTC. When the user says a local time, convert it to UTC for the cron expression but confirm with them: "9am ${t} = Xam UTC, so the cron would be \`0 X * * 1-5\`."
|
|
759
|
-
|
|
760
|
-
- \`0 9 * * 1-5\` — Every weekday at 9am **UTC**
|
|
761
|
-
- \`0 */2 * * *\` — Every 2 hours
|
|
762
|
-
- \`0 0 * * *\` — Daily at midnight **UTC**
|
|
763
|
-
- \`30 14 * * 1\` — Every Monday at 2:30pm **UTC**
|
|
764
|
-
- \`0 8 1 * *\` — First of every month at 8am **UTC**
|
|
765
|
-
|
|
766
|
-
Minimum interval is 1 hour. \`*/30 * * * *\` will be rejected.
|
|
767
|
-
|
|
768
|
-
## Workflow
|
|
769
|
-
|
|
770
|
-
### CREATE a new trigger:
|
|
771
|
-
|
|
772
|
-
1. **Understand the goal** — Ask what they want the remote agent to do. What repo(s)? What task? Remind them that the agent runs remotely — it won't have access to their local machine, local files, or local environment variables.
|
|
773
|
-
2. **Craft the prompt** — Help them write an effective agent prompt. Good prompts are:
|
|
774
|
-
- Specific about what to do and what success looks like
|
|
775
|
-
- Clear about which files/areas to focus on
|
|
776
|
-
- Explicit about what actions to take (open PRs, commit, just analyze, etc.)
|
|
777
|
-
3. **Set the schedule** — Ask when and how often. The user's timezone is ${t}. When they say a time (e.g., "every morning at 9am"), assume they mean their local time and convert to UTC for the cron expression. Always confirm the conversion: "9am ${t} = Xam UTC."
|
|
778
|
-
4. **Choose the model** — Default to \`claude-sonnet-4-6\`. Tell the user which model you're defaulting to and ask if they want a different one.
|
|
779
|
-
5. **Validate connections** — Infer what services the agent will need from the user's description. For example, if they say "check Datadog and Slack me errors," the agent needs both Datadog and Slack MCP connectors. Cross-reference with the connectors list above. If any are missing, warn the user and link them to https://claude.ai/settings/connectors to connect first.${r?` The default git repo is already set to \`${r}\`. Ask the user if this is the right repo or if they need a different one.`:` Ask which git repos the remote agent needs cloned into its environment.`}
|
|
780
|
-
6. **Review and confirm** — Show the full configuration before creating. Let them adjust.
|
|
781
|
-
7. **Create it** \u2014 Call \`${Ei}\` with \`action: "create"\` and show the result. The response includes the trigger ID. Always output a link at the end: \`https://claude.ai/code/scheduled/{TRIGGER_ID}\`
|
|
782
|
-
|
|
783
|
-
### UPDATE a trigger:
|
|
784
|
-
|
|
785
|
-
1. List triggers first so they can pick one
|
|
786
|
-
2. Ask what they want to change
|
|
787
|
-
3. Show current vs proposed value
|
|
788
|
-
4. Confirm and update
|
|
789
|
-
|
|
790
|
-
### LIST triggers:
|
|
791
|
-
|
|
792
|
-
1. Fetch and display in a readable format
|
|
793
|
-
2. Show: name, schedule (human-readable), enabled/disabled, next run, repo(s)
|
|
794
|
-
|
|
795
|
-
### RUN NOW:
|
|
796
|
-
|
|
797
|
-
1. List triggers if they haven't specified which one
|
|
798
|
-
2. Confirm which trigger
|
|
799
|
-
3. Execute and confirm
|
|
800
|
-
|
|
801
|
-
## Important Notes
|
|
802
|
-
|
|
803
|
-
- These are REMOTE agents — they run in the cloud, not on the user's machine. They cannot access local files, local services, or local environment variables.
|
|
804
|
-
- Always convert cron to human-readable when displaying
|
|
805
|
-
- Default to \`enabled: true\` unless user says otherwise
|
|
806
|
-
- Accept GitHub URLs in any format (https://github.com/org/repo, org/repo, etc.) and normalize to the full HTTPS URL (without .git suffix)
|
|
807
|
-
- The prompt is the most important part — spend time getting it right. The remote agent starts with zero context, so the prompt must be self-contained.
|
|
808
|
-
- To delete a trigger, direct users to https://claude.ai/code/scheduled
|
|
809
|
-
${s?`- If the user's request seems to require GitHub repo access (e.g. cloning a repo, opening PRs, reading code), remind them that they need the Claude GitHub App installed on the repo — otherwise the remote agent won't be able to access it.`:``}
|
|
810
|
-
${c?`\n## User Request\n\nThe user said: "${c}"\n\nStart by understanding their intent and working through the appropriate workflow above.`:``}`}function Ad(){N({name:`schedule`,description:`Create, update, list, or run scheduled remote agents (triggers) that execute on a cron schedule.`,whenToUse:`When the user wants to schedule a recurring remote agent, set up automated tasks, create a cron job for Work Mate, or manage their scheduled agents/triggers.`,userInvocable:!0,isEnabled:()=>!1,allowedTools:[Ei,Is],async getPromptForCommand(e,t){if(!Yo()?.accessToken)return[{type:`text`,text:`You need to authenticate with a claude.ai account first. API accounts are not supported.`}];let n;try{n=await $n()}catch(e){return I(`[schedule] Failed to fetch environments: ${e}`,{level:`warn`}),[{type:`text`,text:`We're having trouble connecting with your remote claude.ai account to set up a scheduled task. Please try /schedule again in a few minutes.`}]}let r=null;if(n.length===0)try{r=await Dr(`claude-code-default`),n=[r]}catch(e){return I(`[schedule] Failed to create environment: ${e}`,{level:`warn`}),[{type:`text`,text:`No remote environments found, and we could not create one automatically. Visit https://claude.ai/code to set one up, then run /schedule again.`}]}let i=[],a=!1,o=await mc();if(o===null)i.push(`Not in a git repo — you'll need to specify a repo URL manually (or skip repos entirely).`);else if(o.host===`github.com`){let{hasAccess:e}=await Gr(o.owner,o.name);if(!e){a=!0;let e=`Claude GitHub App not installed on ${o.owner}/${o.name} \u2014 install at https://claude.ai/code/onboarding?magic=github-app-setup if your trigger needs this repo.`;i.push(e)}}let s=wd(t.options.mcpClients);s.length===0&&i.push(`No MCP connectors — connect at https://claude.ai/settings/connectors if needed.`);let c=Intl.DateTimeFormat().resolvedOptions().timeZone,l=Ed(s),u=await Od(),d=[`Available environments:`];for(let e of n)d.push(`- ${e.name} (id: ${e.environment_id}, kind: ${e.kind})`);return[{type:`text`,text:kd({userTimezone:c,connectorsInfo:l,gitRepoUrl:u,environmentsInfo:d.join(`
|
|
811
|
-
`),createdEnvironment:r,setupNotes:i,needsGitHubAccessReminder:a,userArgs:e})}]}})}var jd,Md,Nd=n((()=>{an(),Ls(),qr(),Uo(),ci(),ha(),dc(),lo(),da(),Zr(),P(),jd=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,Md=`What would you like to do with scheduled remote agents?`}));function Pd(){Xu(),xd(),ku(),ed(),od(),td(),rd(),Eu(),cd(),ud(),dd(),pd();{let{registerScheduleRemoteAgentsSkill:t}=(Nd(),e(Sd));t()}}Gt(),Jt(),Xr();async function Fd(){if(!await So(`gh`))return`not_installed`;let{exitCode:e}=await vo(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}ti(),xn(),di(),W(),li();async function Id(e,t){let n=await Hn(e),r=rt(t);for(let e of n)e.type===`prompt`&&G(`tengu_skill_loaded`,{_PROTO_skill_name:e.name,skill_source:e.source,skill_loaded_from:e.loadedFrom,skill_budget:r,...e.kind&&{skill_kind:e.kind}})}en(),W(),D(),Qi(),f(),da();function Ld(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Work Mate.
|
|
812
|
-
|
|
813
|
-
Examples:
|
|
814
|
-
# Add HTTP server:
|
|
815
|
-
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
|
|
816
|
-
|
|
817
|
-
# Add HTTP server with headers:
|
|
818
|
-
claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..."
|
|
819
|
-
|
|
820
|
-
# Add stdio server with environment variables:
|
|
821
|
-
claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
|
|
822
|
-
|
|
823
|
-
# Add stdio server with subprocess flags:
|
|
824
|
-
claude mcp add my-server -- my-command --some-flag arg1`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).option(`-t, --transport <transport>`,`Transport type (stdio, sse, http). Defaults to stdio if not specified.`).option(`-e, --env <env...>`,`Set environment variables (e.g. -e KEY=value)`).option(`-H, --header <header...>`,`Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")`).option(`--client-id <clientId>`,`OAuth client ID for HTTP/SSE servers`).option(`--client-secret`,`Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)`).option(`--callback-port <port>`,`Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)`).helpOption(`-h, --help`,`Display help for command`).addOption(new J(`--xaa`,`Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).`).hideHelp(!Kr())).action(async(e,t,n,r)=>{let i=t,a=n;e?i||q(`Error: Command is required when server name is provided.
|
|
825
|
-
Usage: claude mcp add <name> <command> [args...]`):q(`Error: Server name is required.
|
|
826
|
-
Usage: claude mcp add <name> <command> [args...]`);try{let t=cr(r.scope),n=Hr(r.transport);r.xaa&&!Kr()&&q(`Error: --xaa requires CLAUDE_CODE_ENABLE_XAA=1 in your environment`);let o=!!r.xaa;if(o){let e=[];r.clientId||e.push(`--client-id`),r.clientSecret||e.push(`--client-secret`),mr()||e.push(`'claude mcp xaa setup' (settings.xaaIdp not configured)`),e.length&&q(`Error: --xaa requires: ${e.join(`, `)}`)}let s=r.transport!==void 0,c=i.startsWith(`http://`)||i.startsWith(`https://`)||i.startsWith(`localhost`)||i.endsWith(`/sse`)||i.endsWith(`/mcp`);if(G(`tengu_mcp_add`,{type:n,scope:t,source:`command`,transport:n,transportExplicit:s,looksLikeUrl:c}),n===`sse`){i||q(`Error: URL is required for SSE transport.`);let n=r.header?Ji(r.header):void 0,a=r.callbackPort?parseInt(r.callbackPort,10):void 0,s=r.clientId||a||o?{...r.clientId?{clientId:r.clientId}:{},...a?{callbackPort:a}:{},...o?{xaa:!0}:{}}:void 0,c=r.clientSecret&&r.clientId?await Bt():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await j(e,l,t),c&&Lt(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${wa(n,null,2)}\n`)}else if(n===`http`){i||q(`Error: URL is required for HTTP transport.`);let n=r.header?Ji(r.header):void 0,a=r.callbackPort?parseInt(r.callbackPort,10):void 0,s=r.clientId||a||o?{...r.clientId?{clientId:r.clientId}:{},...a?{callbackPort:a}:{},...o?{xaa:!0}:{}}:void 0,c=r.clientSecret&&r.clientId?await Bt():void 0,l={type:`http`,url:i,headers:n,oauth:s};await j(e,l,t),c&&Lt(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${wa(n,null,2)}\n`)}else(r.clientId||r.clientSecret||r.callbackPort||r.xaa)&&process.stderr.write(`Warning: --client-id, --client-secret, --callback-port, and --xaa are only supported for HTTP/SSE transports and will be ignored for stdio.
|
|
827
|
-
`),!s&&c&&(process.stderr.write(`\nWarning: The command "${i}" looks like a URL, but is being interpreted as a stdio server as --transport was not specified.\n`),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${e} ${i}\n`),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${e} ${i}\n`)),await j(e,{type:`stdio`,command:i,args:a,env:u(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);Bc(`File modified: ${hi(t)}`)}catch(e){q(e.message)}})}wi(),Ta(),L();function Rd(e){let t=e.command(`xaa`).description(`Manage the XAA (SEP-990) IdP connection`);t.command(`setup`).description(`Configure the IdP connection (one-time setup for all XAA-enabled servers)`).requiredOption(`--issuer <url>`,`IdP issuer URL (OIDC discovery)`).requiredOption(`--client-id <id>`,`Work Mate's client_id at the IdP`).option(`--client-secret`,`Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var`).option(`--callback-port <port>`,`Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)`).action(e=>{let t;try{t=new URL(e.issuer)}catch{return q(`Error: --issuer must be a valid URL (got "${e.issuer}")`)}if(t.protocol!==`https:`&&!(t.protocol===`http:`&&(t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`)))return q(`Error: --issuer must use https:// (got "${t.protocol}//${t.host}")`);let n=e.callbackPort?parseInt(e.callbackPort,10):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<=0))return q(`Error: --callback-port must be a positive integer`);let r=e.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(e.clientSecret&&!r)return q(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=mr(),a=i?.issuer,o=i?.clientId,{error:s}=R(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return q(`Error writing settings: ${s.message}`);if(a&&(ui(a)===ui(e.issuer)?o!==e.clientId&&(Kn(a),In(a)):(Kn(a),In(a))),r){let{success:t,warning:n}=Or(e.issuer,r);if(!t)return q(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}Bc(`XAA IdP connection configured for ${e.issuer}`)}),t.command(`login`).description(`Cache an IdP id_token so XAA-enabled MCP servers authenticate silently. Default: run the OIDC browser login. With --id-token: write a pre-obtained JWT directly (used by conformance/e2e tests where the mock IdP does not serve /authorize).`).option(`--force`,`Ignore any cached id_token and re-login (useful after IdP-side revocation)`).option(`--id-token <jwt>`,`Write this pre-obtained id_token directly to cache, skipping the OIDC browser login`).action(async e=>{let t=mr();if(!t)return q(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=tr(t.issuer,e.idToken);return Bc(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&Kn(t.issuer),dn(t.issuer)!==void 0)return Bc(`Already logged in to ${t.issuer} (cached id_token still valid). Use --force to re-login.`);process.stdout.write(`Opening browser for IdP login at ${t.issuer}…\n`);try{await Bn({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:at(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),Bc(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){q(`IdP login failed: ${F(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=mr();if(!e)return Bc(`No XAA IdP connection configured.`);let t=at(e.issuer)!==void 0,n=dn(e.issuer)!==void 0;process.stdout.write(`Issuer: ${e.issuer}\n`),process.stdout.write(`Client ID: ${e.clientId}\n`),e.callbackPort!==void 0&&process.stdout.write(`Callback port: ${e.callbackPort}\n`),process.stdout.write(`Client secret: ${t?`(stored in keychain)`:`(not set — PKCE-only)`}\n`),process.stdout.write(`Logged in: ${n?`yes (id_token cached)`:`no — run 'claude mcp xaa login'`}\n`),Bc()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=mr(),{error:t}=R(`userSettings`,{xaaIdp:void 0});if(t)return q(`Error writing settings: ${t.message}`);e&&(Kn(e.issuer),In(e.issuer)),Bc(`XAA IdP connection cleared`)})}Xn();function zd(e,t=process.argv){for(let n=0;n<t.length;n++){let r=t[n];if(r?.startsWith(`${e}=`))return r.slice(e.length+1);if(r===e&&n+1<t.length)return t[n+1]}}ni(),Wt(),Qt(),W(),V(),xo(),L();function Bd(){if(B().bypassPermissionsModeAccepted)try{Pa()||R(`userSettings`,{skipDangerousModePermissionPrompt:!0}),G(`tengu_migrate_bypass_permissions_accepted`,{}),z(e=>{if(!(`bypassPermissionsModeAccepted`in e))return e;let{bypassPermissionsModeAccepted:t,...n}=e;return n})}catch(e){U(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}W(),V(),xo(),L();function Vd(){let e=to(),t=e.enableAllProjectMcpServers!==void 0,n=e.enabledMcpjsonServers&&e.enabledMcpjsonServers.length>0,r=e.disabledMcpjsonServers&&e.disabledMcpjsonServers.length>0;if(!(!t&&!n&&!r))try{let i=ja(`localSettings`)||{},a={},o=[];if(t&&i.enableAllProjectMcpServers===void 0?(a.enableAllProjectMcpServers=e.enableAllProjectMcpServers,o.push(`enableAllProjectMcpServers`)):t&&o.push(`enableAllProjectMcpServers`),n&&e.enabledMcpjsonServers){let t=i.enabledMcpjsonServers||[];a.enabledMcpjsonServers=[...new Set([...t,...e.enabledMcpjsonServers])],o.push(`enabledMcpjsonServers`)}if(r&&e.disabledMcpjsonServers){let t=i.disabledMcpjsonServers||[];a.disabledMcpjsonServers=[...new Set([...t,...e.disabledMcpjsonServers])],o.push(`disabledMcpjsonServers`)}Object.keys(a).length>0&&R(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&ao(e=>{let{enableAllProjectMcpServers:t,enabledMcpjsonServers:n,disabledMcpjsonServers:r,...i}=e;return i}),G(`tengu_migrate_mcp_approval_fields_success`,{migratedCount:o.length})}catch(e){U(e),G(`tengu_migrate_mcp_approval_fields_error`,{})}}L();function Hd(){if(process.env.USER_TYPE!==`ant`)return;let e=ja(`userSettings`)?.model;typeof e==`string`&&(e.startsWith(`fennec-latest[1m]`)?R(`userSettings`,{model:`opus[1m]`}):e.startsWith(`fennec-latest`)?R(`userSettings`,{model:`opus`}):(e.startsWith(`fennec-fast-latest`)||e.startsWith(`opus-4-5-fast`))&&R(`userSettings`,{model:`opus[1m]`,fastMode:!0}))}W(),V(),Os(),L();function Ud(){if(Qo()!==`firstParty`||!Ds())return;let e=ja(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(R(`userSettings`,{model:`opus`}),z(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),G(`tengu_legacy_opus_migration`,{from_model:e}))}W(),as();function Wd(){cs()&&G(`tengu_opus_to_opus1m_migration`,{skipped:!0})}V();function Gd(){z(e=>{let t=e.replBridgeEnabled;if(t===void 0||e.remoteControlAtStartup!==void 0)return e;let n={...e,remoteControlAtStartup:!!t};return delete n.replBridgeEnabled,n})}S(),V(),L();function Kd(){B().sonnet1m45MigrationComplete||(ja(`userSettings`)?.model===`sonnet[1m]`&&R(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),Fe()===`sonnet[1m]`&&Ne(`sonnet-4-5-20250929[1m]`),z(e=>({...e,sonnet1m45MigrationComplete:!0})))}W(),Uo(),V(),Os(),L();function qd(){if(Qo()!==`firstParty`||!Ho()&&!ns()&&!ds())return;let e=ja(`userSettings`)?.model;if(e!==`claude-sonnet-4-5-20250929`&&e!==`claude-sonnet-4-5-20250929[1m]`&&e!==`sonnet-4-5-20250929`&&e!==`sonnet-4-5-20250929[1m]`)return;let t=e.endsWith(`[1m]`);R(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),B().numStartups>1&&z(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),G(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}W(),V(),xo(),L();function Jd(){if(!B().hasResetAutoModeOptInForDefaultOffer&&Ni()===`enabled`)try{let e=ja(`userSettings`);e?.skipAutoPermissionPrompt&&e?.permissions?.defaultMode!==`auto`&&(R(`userSettings`,{skipAutoPermissionPrompt:void 0}),G(`tengu_migrate_reset_auto_opt_in_for_default_offer`,{})),z(e=>e.hasResetAutoModeOptInForDefaultOffer?e:{...e,hasResetAutoModeOptInForDefaultOffer:!0})}catch(e){U(Error(`Failed to reset auto mode opt-in: ${e}`))}}W(),Uo(),V(),Os(),L();function Yd(){if(!B().opusProMigrationComplete){if(Qo()!==`firstParty`||!Ho()){z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(Na()?.model===void 0){let e=Date.now();z(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else z(e=>({...e,opusProMigrationComplete:!0})),G(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}b(),Ce();var Xd=xe(()=>he({session_id:y(),ws_url:y(),work_dir:y().optional()}));Ta(),da();var Zd=class extends Error{constructor(e){super(e),this.name=`DirectConnectError`}};async function Qd({serverUrl:e,authToken:t,cwd:n,dangerouslySkipPermissions:r}){let i={"content-type":`application/json`};t&&(i.authorization=`Bearer ${t}`);let a;try{a=await fetch(`${e}/sessions`,{method:`POST`,headers:i,body:wa({cwd:n,...r&&{dangerously_skip_permissions:!0}})})}catch(t){throw new Zd(`Failed to connect to server at ${e}: ${F(t)}`)}if(!a.ok)throw new Zd(`Failed to create session: ${a.status} ${a.statusText}`);let o=Xd().safeParse(await a.json());if(!o.success)throw new Zd(`Invalid session response: ${o.error.message}`);let s=o.data;return{config:{serverUrl:e,sessionId:s.session_id,wsUrl:s.ws_url,authToken:t},workDir:s.work_dir}}var $d=i({isKairosEnabled:()=>ef});async function ef(){return!1}var tf=n((()=>{}));No(),Io(),Vi(),an(),Uo(),V(),Gc(),O(),To(),da(),W(),S(),fn(),de(),Hc(),f(),lo(),xo(),as(),mt(),Fr(),L(),D(),Qi(),wi(),ya(),ha(),Ta(),it(),Mi(),mo(),kc(),Li(),Sc(),wt(),K(`main_tsx_entry`),Ra(),As();var nf=(Dc(),e(Oc)),rf=(tf(),e($d)),af=(hn(),e(Ut));K(`main_tsx_imports_loaded`);function of(){try{let e=ja(`policySettings`);if(e){let t=Ia(e);G(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function sf(){let e=Wo(Ee()??ys());Id(oa(),es(e,Ye())),_i().then(({enabled:e,errors:t})=>{let n=Zn();lr(e,n,Qr()),bi(t,n)}).catch(e=>U(e))}function cf(){let e={};return process.env.NODE_EXTRA_CA_CERTS&&(e.has_node_extra_ca_certs=!0),process.env.CLAUDE_CODE_CLIENT_CERT&&(e.has_client_cert=!0),c(`--use-system-ca`)&&(e.has_use_system_ca=!0),c(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function lf(){if(xc())return;let[e,t,n]=await Promise.all([uo(),fo(),Fd()]);G(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:ki.isSandboxingEnabled(),are_unsandboxed_commands_allowed:ki.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:ki.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:Za(),prefers_reduced_motion:za().prefersReducedMotion??!1,...cf()})}var uf=11;function df(){B().migrationVersion!==uf&&(Bd(),Vd(),Yd(),Kd(),Ud(),qd(),Wd(),Gd(),Jd(),process.env.USER_TYPE===`ant`&&Hd(),z(e=>e.migrationVersion===uf?e:{...e,migrationVersion:uf})),Ac().catch(()=>{})}function ff(){if(tt()){H(`info`,`prefetch_system_context_non_interactive`),yn();return}eo()?(H(`info`,`prefetch_system_context_has_trust`),yn()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function pf(){d(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||p()||(bc(),ht(),ff(),sl(),d(process.env.CLAUDE_CODE_USE_BEDROCK)&&!d(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&hs(),d(process.env.CLAUDE_CODE_USE_VERTEX)&&!d(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&os(),ec(oa(),AbortSignal.timeout(3e3),[]),rs(),Pi.initialize(),p()||Xc.initialize(),process.env.USER_TYPE===`ant`&&import(`./eventLoopStallDetector-Cg_RXU1q.js`).then(e=>e.startEventLoopStallDetector()))}function mf(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)ko(t)||(process.stderr.write(v.red(`Error: Invalid JSON provided to --settings
|
|
828
|
-
`)),process.exit(1)),r=xt(`claude-settings`,`.json`,{contentHash:t}),ca(r,t,`utf8`);else{let{resolvedPath:t}=ma(ga(),e);try{ml(t,`utf8`)}catch(e){throw fa(e)&&(process.stderr.write(v.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}Te(r),He()}catch(e){e instanceof Error&&U(e),process.stderr.write(v.red(`Error processing settings: ${F(e)}\n`)),process.exit(1)}}function hf(e){try{C(Fa(e)),He()}catch(e){e instanceof Error&&U(e),process.stderr.write(v.red(`Error processing --setting-sources: ${F(e)}\n`)),process.exit(1)}}function gf(){K(`eagerLoadSettings_start`);let e=zd(`--settings`);e&&mf(e);let t=zd(`--setting-sources`);t!==void 0&&hf(t),K(`eagerLoadSettings_end`)}function _f(e){if(process.env.CLAUDE_CODE_ENTRYPOINT)return;let t=process.argv.slice(2),n=t.indexOf(`mcp`);if(n!==-1&&t[n+1]===`serve`){process.env.CLAUDE_CODE_ENTRYPOINT=`mcp`;return}if(d(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT=`claude-code-github-action`;return}process.env.CLAUDE_CODE_ENTRYPOINT=e?`sdk-cli`:`cli`}var Q={url:void 0,authToken:void 0,dangerouslySkipPermissions:!1},vf={sessionId:void 0,discover:!1},$={host:void 0,cwd:void 0,permissionMode:void 0,dangerouslySkipPermissions:!1,local:!1,extraCliArgs:[],remoteBin:void 0};async function yf(){K(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,eu(),process.on(`exit`,()=>{Tf();try{let{peekWorkflowService:t}=(oi(),e(zt));t()?.shutdown()}catch{}}),process.on(`SIGINT`,()=>{process.argv.includes(`-p`)||process.argv.includes(`--print`)||process.exit(0)}),K(`main_warning_handler_initialized`);{let e=process.argv.slice(2),t=e.findIndex(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(t!==-1&&Q){let n=e[t],{parseConnectUrl:r}=await import(`./parseConnectUrl-BiyKR5-x.js`),i=r(n);if(Q.dangerouslySkipPermissions=e.includes(`--dangerously-skip-permissions`),e.includes(`-p`)||e.includes(`--print`)){let r=e.filter((e,n)=>n!==t),i=r.indexOf(`--dangerously-skip-permissions`);i!==-1&&r.splice(i,1),process.argv=[process.argv[0],process.argv[1],`open`,n,...r]}else{Q.url=i.serverUrl,Q.authToken=i.authToken;let n=e.filter((e,n)=>n!==t),r=n.indexOf(`--dangerously-skip-permissions`);r!==-1&&n.splice(r,1),process.argv=[process.argv[0],process.argv[1],...n]}}}{let e=process.argv.indexOf(`--handle-uri`);if(e!==-1&&process.argv[e+1]){let{enableConfigs:t}=await import(`./config-CMnqm6Se.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-JR8pASdH.js`),i=await r(n);process.exit(i)}if(process.platform===`darwin`&&process.env.__CFBundleIdentifier===`com.anthropic.claude-code-url-handler`){let{enableConfigs:e}=await import(`./config-CMnqm6Se.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-JR8pASdH.js`),n=await t();process.exit(n??1)}}if(vf){let e=process.argv.slice(2);if(e[0]===`assistant`){let t=e[1];t&&!t.startsWith(`-`)?(vf.sessionId=t,e.splice(0,2),process.argv=[process.argv[0],process.argv[1],...e]):t||(vf.discover=!0,e.splice(0,1),process.argv=[process.argv[0],process.argv[1],...e])}}if($){let e=process.argv.slice(2);if(e[0]===`ssh`){let t=e.indexOf(`--local`);t!==-1&&($.local=!0,e.splice(t,1));let n=e.indexOf(`--dangerously-skip-permissions`);n!==-1&&($.dangerouslySkipPermissions=!0,e.splice(n,1));let r=e.indexOf(`--permission-mode`);r!==-1&&e[r+1]&&!e[r+1].startsWith(`-`)&&($.permissionMode=e[r+1],e.splice(r,2));let i=e.findIndex(e=>e.startsWith(`--permission-mode=`));i!==-1&&($.permissionMode=e[i].split(`=`)[1],e.splice(i,1));let a=(t,n={})=>{let r=e.indexOf(t);if(r!==-1){$.extraCliArgs.push(n.as??t);let i=e[r+1];n.hasValue&&i&&!i.startsWith(`-`)?($.extraCliArgs.push(i),e.splice(r,2)):e.splice(r,1)}let i=e.findIndex(e=>e.startsWith(`${t}=`));i!==-1&&($.extraCliArgs.push(n.as??t,e[i].slice(t.length+1)),e.splice(i,1))},o=e.indexOf(`--remote-bin`);o!==-1&&e[o+1]&&!e[o+1].startsWith(`-`)&&($.remoteBin=e[o+1],e.splice(o,2));let s=e.findIndex(e=>e.startsWith(`--remote-bin=`));s!==-1&&($.remoteBin=e[s].split(`=`).slice(1).join(`=`),e.splice(s,1)),a(`-c`,{as:`--continue`}),a(`--continue`),a(`--resume`,{hasValue:!0}),a(`--model`,{hasValue:!0})}if(e[0]===`ssh`&&e[1]&&!e[1].startsWith(`-`)){$.host=e[1];let t=2;e[2]&&!e[2].startsWith(`-`)&&($.cwd=e[2],t=3);let n=e.slice(t);if(n.includes(`-p`)||n.includes(`--print`)){process.stderr.write(`Error: headless (-p/--print) mode is not supported with claude ssh
|
|
829
|
-
`),ln(1);return}process.argv=[process.argv[0],process.argv[1],...n]}}let t=process.argv.slice(2),n=t.includes(`-p`)||t.includes(`--print`),r=t.includes(`--init-only`),i=t.some(e=>e.startsWith(`--sdk-url`)),a=d(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&nl(),Oe(!o),_f(o);let s=(()=>{if(d(process.env.GITHUB_ACTIONS))return`github-action`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-ts`)return`sdk-typescript`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-py`)return`sdk-python`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-cli`)return`sdk-cli`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`claude-vscode`)return`claude-vscode`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return`local-agent`;if(process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`)return`claude-desktop`;let e=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;return process.env.CLAUDE_CODE_ENTRYPOINT===`remote`||e?`remote`:`cli`})();et(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?w(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&s!==`remote`&&w(`markdown`),process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`&&Ue(`remote-control`),K(`main_client_type_determined`),gf(),K(`main_before_run`),await xf(),K(`main_after_run`)}async function bf(e,t){if(!process.stdin.isTTY&&!process.argv.includes(`mcp`)){if(t===`stream-json`)return process.stdin;process.stdin.setEncoding(`utf8`);let n=``,r=e=>{n+=e};process.stdin.on(`data`,r);let i=await co(process.stdin,3e3);return process.stdin.off(`data`,r),i&&process.stderr.write(`Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.
|
|
830
|
-
`),[e,n].filter(Boolean).join(`
|
|
831
|
-
`)}return e}async function xf(){K(`run_function_start`);function t(){let e=e=>e.long?.replace(/^--/,``)??e.short?.replace(/^-/,``)??``;return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(t,n)=>e(t).localeCompare(e(n))})}let n=new Ml().configureHelp(t()).enablePositionalOptions();K(`run_commander_initialized`),n.hook(`preAction`,async e=>{K(`preAction_start`),await Promise.all([ka(),Ms()]),K(`preAction_after_mdm`),await Vl(),K(`preAction_after_init`),d(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`claude`);let{initSinks:t}=await import(`./sinks-FevoYQqP.js`);t(),K(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(Ve(n),Oi(`preAction: --plugin-dir inline plugins`)),df(),K(`preAction_after_migrations`),Pc(),mn(),K(`preAction_after_remote_settings`),K(`preAction_after_settings_sync`)}),n.name(`claude`).description(`Work Mate - starts an interactive session by default, use -p/--print for non-interactive output`).argument(`[prompt]`,`Your prompt`,String).helpOption(`-h, --help`,`Display help for command`).option(`-d, --debug [filter]`,`Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")`,e=>!0).addOption(new J(`--debug-to-stderr`,`Enable debug mode (to stderr)`).argParser(Boolean).hideHelp()).option(`--debug-file <path>`,`Write debug logs to a specific file path (implicitly enables debug mode)`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).option(`-p, --print`,`Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.`,()=>!0).option(`--bare`,`Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new J(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new J(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new J(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new J(`--output-format <format>`,`Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)`).choices([`text`,`json`,`stream-json`])).addOption(new J(`--json-schema <schema>`,`JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}`).argParser(String)).option(`--include-hook-events`,`Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)`,()=>!0).option(`--include-partial-messages`,`Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)`,()=>!0).addOption(new J(`--input-format <format>`,`Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)`).choices([`text`,`stream-json`])).option(`--mcp-debug`,`[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)`,()=>!0).option(`--dangerously-skip-permissions`,`Bypass all permission checks. Recommended only for sandboxes with no internet access.`,()=>!0).option(`--allow-dangerously-skip-permissions`,`Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.`,()=>!0).addOption(new J(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new J(`--max-thinking-tokens <tokens>`,`[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-turns <turns>`,`Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)`).argParser(Number).hideHelp()).addOption(new J(`--max-budget-usd <amount>`,`Maximum dollar amount to spend on API calls (only works with --print)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0)throw Error(`--max-budget-usd must be a positive number greater than 0`);return t})).addOption(new J(`--task-budget <tokens>`,`API-side task budget in tokens (output_config.task_budget)`).argParser(e=>{let t=Number(e);if(isNaN(t)||t<=0||!Number.isInteger(t))throw Error(`--task-budget must be a positive integer`);return t}).hideHelp()).option(`--replay-user-messages`,`Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)`,()=>!0).addOption(new J(`--enable-auth-status`,`Enable auth status messages in SDK mode`).default(!1).hideHelp()).option(`--allowedTools, --allowed-tools <tools...>`,`Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")`).option(`--tools <tools...>`,`Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").`).option(`--disallowedTools, --disallowed-tools <tools...>`,`Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")`).option(`--mcp-config <configs...>`,`Load MCP servers from JSON files or strings (space-separated)`).addOption(new J(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new J(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new J(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new J(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new J(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new J(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Vo)).option(`-c, --continue`,`Continue the most recent conversation in the current directory`,()=>!0).option(`-r, --resume [value]`,`Resume a conversation by session ID, or open interactive picker with optional search term`,e=>e||!0).option(`--fork-session`,`When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)`,()=>!0).addOption(new J(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new J(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new J(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new J(`--deep-link-last-fetch <ms>`,`FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline`).argParser(e=>{let t=Number(e);return Number.isFinite(t)?t:void 0}).hideHelp()).option(`--from-pr [value]`,`Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term`,e=>e||!0).option(`--no-session-persistence`,`Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)`).addOption(new J(`--resume-session-at <message id>`,`When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)`).argParser(String).hideHelp()).addOption(new J(`--rewind-files <user-message-id>`,`Restore files to state at the specified user message and exit (requires --resume)`).hideHelp()).option(`--model <model>`,`Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).option(`--agent <agent>`,`Agent for the current session. Overrides the 'agent' setting.`).option(`--betas <betas...>`,`Beta headers to include in API requests (API key users only)`).option(`--fallback-model <model>`,`Enable automatic fallback to specified model when default model is overloaded (only works with --print)`).addOption(new J(`--workload <tag>`,`Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)`).hideHelp()).option(`--settings <file-or-json>`,`Path to a settings JSON file or a JSON string to load additional settings from`).option(`--add-dir <directories...>`,`Additional directories to allow tool access to`).option(`--ide`,`Automatically connect to IDE on startup if exactly one valid IDE is available`,()=>!0).option(`--strict-mcp-config`,`Only use MCP servers from --mcp-config, ignoring all other MCP configurations`,()=>!0).option(`--session-id <uuid>`,`Use a specific session ID for the conversation (must be a valid UUID)`).option(`-n, --name <name>`,`Set a display name for this session (shown in /resume and terminal title)`).option(`--agents <json>`,`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).option(`--plugin-dir <path>`,`Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)`,(e,t)=>[...t,e],[]).option(`--disable-slash-commands`,`Disable all skills`,()=>!0).option(`--chrome`,`Enable Claude in Chrome integration`).option(`--no-chrome`,`Disable Claude in Chrome integration`).option(`--file <specs...>`,`File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)`).action(async(t,n)=>{K(`action_handler_start`),n.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),t===`code`&&(G(`tengu_code_prompt_ignored`,{}),console.warn(v.yellow("Tip: You can launch Work Mate with just `claude`")),t=void 0),t&&typeof t==`string`&&!/\s/.test(t)&&t.length>0&&G(`tengu_single_word_prompt`,{length:t.length});let r=!1;if(n.assistant&&nf&&nf.markAssistantForced(),nf&&(nf.isAssistantForced()||n.assistant===!0)&&rf){if(!eo())console.warn(v.yellow(`Assistant mode disabled: directory is not trusted. Accept the trust dialog and restart.`));else if(r=nf.isAssistantForced()||await rf.isKairosEnabled(),r){let e=n;e.brief=!0,je(!0)}}let{debug:i=!1,debugToStderr:a=!1,dangerouslySkipPermissions:o,allowDangerouslySkipPermissions:s=!1,tools:c=[],allowedTools:l=[],disallowedTools:u=[],mcpConfig:f=[],permissionMode:m,addDir:ee=[],fallbackModel:h,betas:te=[],ide:ne=!1,sessionId:re,includeHookEvents:ie,includePartialMessages:ae}=n;n.prefill&&rl(n.prefill);let oe,se=n.agents,ce=n.agent;ce&&(process.env.CLAUDE_CODE_AGENT=ce);let g=n.outputFormat,_=n.inputFormat,le=n.verbose??B().verbose,ue=n.print,de=n.init??!1,fe=n.initOnly??!1,pe=n.maintenance??!1,me=n.disableSlashCommands||!1,he=process.env.USER_TYPE===`ant`&&n.tasks,ge=he?typeof he==`string`?he:ur:void 0;process.env.USER_TYPE===`ant`&&ge&&(process.env.CLAUDE_CODE_TASK_LIST_ID=ge);let y=Tc()?n.worktree:void 0,_e=typeof y==`string`?y:void 0,ve=y!==void 0,ye;if(_e){let e=ft(_e);e!==null&&(ye=e,_e=void 0)}let be=Tc()&&n.tmux===!0;be&&(ve||(process.stderr.write(v.red(`Error: --tmux requires --worktree
|
|
832
|
-
`)),process.exit(1)),wo()===`windows`&&(process.stderr.write(v.red(`Error: --tmux is not supported on Windows
|
|
833
|
-
`)),process.exit(1)),await bt()||(process.stderr.write(v.red(`Error: tmux is not installed.\n${Gi()}\n`)),process.exit(1)));let xe=n.sdkUrl??void 0,Se=ae||d(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);(ie||d(process.env.CLAUDE_CODE_REMOTE))&&dt(!0),xe&&(_||(_=`stream-json`),g||(g=`stream-json`),n.verbose===void 0&&(le=!0),n.print||(ue=!0));let b=n.teleport??null,Ce=n.remote,Te=Ce===!0?``:Ce??null,De=n.remoteControl??n.rc,Oe=!1,Ae=typeof De==`string`&&De.length>0?De:void 0;if(re&&((n.continue||n.resume)&&!n.forkSession&&(process.stderr.write(v.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
834
|
-
`)),process.exit(1)),!xe)){let e=ot(re);e||(process.stderr.write(v.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
835
|
-
`)),process.exit(1)),Dn(e)&&(process.stderr.write(v.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let Fe=n.file;if(Fe&&Fe.length>0){let e=nc();e||(process.stderr.write(v.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
|
|
836
|
-
`)),process.exit(1));let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||Be(),n=Ir(Fe);n.length>0&&(oe=Vr(n,{baseUrl:process.env.ANTHROPIC_BASE_URL||Po().BASE_API_URL,oauthToken:e,sessionId:t}))}let x=tt();h&&n.model&&h===n.model&&(process.stderr.write(v.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
|
|
837
|
-
`)),process.exit(1));let S=n.systemPrompt;if(n.systemPromptFile){n.systemPrompt&&(process.stderr.write(v.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
838
|
-
`)),process.exit(1));try{S=ml(dl(n.systemPromptFile),`utf8`)}catch(e){la(e)===`ENOENT`&&(process.stderr.write(v.red(`Error: System prompt file not found: ${dl(n.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(v.red(`Error reading system prompt file: ${F(e)}\n`)),process.exit(1)}}let C=n.appendSystemPrompt;if(n.appendSystemPromptFile){n.appendSystemPrompt&&(process.stderr.write(v.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
839
|
-
`)),process.exit(1));try{C=ml(dl(n.appendSystemPromptFile),`utf8`)}catch(e){la(e)===`ENOENT`&&(process.stderr.write(v.red(`Error: Append system prompt file not found: ${dl(n.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(v.red(`Error reading append system prompt file: ${F(e)}\n`)),process.exit(1)}}let{mode:Ve,notification:He}=Ri({permissionModeCli:m,dangerouslySkipPermissions:o});qe(Ve===`bypassPermissions`),(n.enableAutoMode||m===`auto`||Ve===`auto`||!m&&Yt())&&af?.setAutoModeFlagCli(!0);let Ue={};if(f&&f.length>0){let e=f.map(e=>e.trim()).filter(e=>e.length>0),t={},n=[];for(let r of e){let e=null,i=[],a=ko(r);if(a){let t=rn({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=Dt({filePath:dl(r),expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}i.length>0?n.push(...i):e&&(t={...t,...e})}if(n.length>0){let e=n.map(e=>`${e.path?e.path+`: `:``}${e.message}`).join(`
|
|
840
|
-
`);I(`--mcp-config validation failed (${n.length} errors): ${e}`,{level:`error`}),process.stderr.write(`Error: Invalid MCP configuration:\n${e}\n`),process.exit(1)}if(Object.keys(t).length>0){let{allowed:e,blocked:n}=Ct(Mr(t,e=>({...e,scope:`dynamic`})));n.length>0&&process.stderr.write(`Warning: MCP ${zo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),Ue={...Ue,...e}}}let Ge=n.strictMcpConfig||!1;if(En()&&(Ge&&(process.stderr.write(v.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),Ue&&!gt(Ue)&&(process.stderr.write(v.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),We(ee),c.length>0){let{BRIEF_TOOL_NAME:t,LEGACY_BRIEF_TOOL_NAME:n}=(Va(),e(Ea)),{isBriefEntitled:r}=(un(),e(Gn)),i=Lr(c);(i.includes(t)||i.includes(n))&&r()&&ze(!0)}let Ye=await Sn({allowedToolsCli:l,disallowedToolsCli:u,baseToolsCli:c,permissionMode:Ve,allowDangerouslySkipPermissions:s,addDirs:ee}),w=Ye.toolPermissionContext,{warnings:Ze,dangerousPermissions:et,overlyBroadBashPermissions:nt}=Ye;if(process.env.USER_TYPE===`ant`&&nt.length>0){for(let e of nt)I(`Ignoring overly broad shell permission ${e.ruleDisplay} from ${e.sourceDisplay}`);w=jr(w,nt)}et.length>0&&(w=qt(w)),Ze.forEach(e=>{console.error(e)});let rt=x&&!Ge&&!En()&&!p()?na().then(e=>{let{allowed:t,blocked:n}=Ct(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${zo(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});I(`[STARTUP] Loading MCP configs...`);let it=Date.now(),at,st=(Ge||p()?Promise.resolve({servers:{}}):Zt(Ue)).then(e=>(at=Date.now()-it,e));_&&_!==`text`&&_!==`stream-json`&&(console.error(`Error: Invalid input format "${_}".`),process.exit(1)),_===`stream-json`&&g!==`stream-json`&&(console.error(`Error: --input-format=stream-json requires output-format=stream-json.`),process.exit(1)),xe&&(_!==`stream-json`||g!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),n.replayUserMessages&&(_!==`stream-json`||g!==`stream-json`)&&(console.error(`Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),Se&&(!x||g!==`stream-json`)&&(oo(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),n.sessionPersistence===!1&&!x&&(oo(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let T=await bf(t||``,_??`text`);K(`action_after_input_prompt`),Cf(n);let ct=Nt(w);K(`action_tools_loaded`);let lt;if(Hs({isNonInteractiveSession:x})&&n.jsonSchema&&(lt=sa(n.jsonSchema)),lt){let e=Us(lt);`tool`in e?(ct=[...ct,e.tool],G(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(lt.properties||{}).length,has_required_fields:!!lt.required})):G(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}K(`action_before_setup`),I(`[STARTUP] Running setup()...`);let ut=Date.now(),{setup:pt}=await import(`./setup-D8kXv3ts.js`),mt=oa();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&Pd();let _t=pt(mt,Ve,s,ve,_e,be,re?ot(re):void 0,ye,void 0),yt=ve?null:ai(mt),xt=ve?null:Er(mt);yt?.catch(()=>{}),xt?.catch(()=>{}),await _t,I(`[STARTUP] setup() completed in ${Date.now()-ut}ms`),K(`action_after_setup`);let St=!!n.replayUserMessages;tt()&&(Kc(),yn(),ht(),ms());let wt=n.name?.trim();wt&&Ln(wt);let Ot=n.model==="default"?ys():n.model,kt=h==="default"?ys():h,At=ve?oa():mt;I(`[STARTUP] Loading commands and agents...`);let Lt=Date.now(),[Rt,zt]=await Promise.all([yt??ai(At),xt??Er(At)]);I(`[STARTUP] Commands and agents loaded in ${Date.now()-Lt}ms`),K(`action_commands_loaded`);let Bt=[];if(se)try{let e=ko(se);e&&(Bt=hr(e,`flagSettings`))}catch(e){U(e)}let Vt=[...zt.allAgents,...Bt],Ht={...zt,allAgents:Vt,activeAgents:si(Vt)},Ut=ce??za().agent,E;if(Ut&&(E=Ht.activeAgents.find(e=>e.agentType===Ut),E||I(`Warning: agent "${Ut}" not found. Available agents: ${Ht.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Pe(E?.agentType),E&&G(`tengu_agent_flag`,{agentType:mi(E)?E.agentType:`custom`,...ce&&{source:`cli`}}),E?.agentType&&Sr(E.agentType),x&&E&&!S&&!mi(E)){let e=E.getSystemPrompt();e&&(S=e)}E?.initialPrompt&&(typeof T==`string`?T=T?`${E.initialPrompt}\n\n${T}`:E.initialPrompt:T||(T=E.initialPrompt));let Wt=Ot;!Wt&&E?.model&&E.model!==`inherit`&&(Wt=Wo(E.model)),Ne(Wt),we(ps()||null);let Gt=Ee(),Kt=Wo(Gt??ys()),D;if(Wr()){let e=ji()?n.advisor:void 0;e&&(I(`[AdvisorTool] --advisor ${e}`),xr(Kt)||(process.stderr.write(v.red(`Error: The model "${Kt}" does not support the advisor tool.\n`)),process.exit(1)),wr(Zo(Wo(e)))||(process.stderr.write(v.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),D=ji()?e??fr():e,D&&I(`[AdvisorTool] Advisor model: ${D}`)}if(wf(n),!tt()&&!Xe()&&za().defaultView===`chat`){let{isBriefEntitled:t}=(un(),e(Gn));t()&&ze(!0)}if(n.proactive||d(process.env.CLAUDE_CODE_PROACTIVE)){let t=`\n# Proactive Mode\n\nYou are in proactive mode. Take initiative — explore, act, and make progress without waiting for instructions.\n\nStart by briefly greeting the user.\n\nYou will receive periodic <tick> prompts. These are check-ins. Do whatever seems most useful, or call Sleep if there's nothing to do. ${(un(),e(Gn)).isBriefEnabled()?`Call SendUserMessage at checkpoints to mark where things stand.`:`The user will see any text you output.`}`;C=C?`${C}\n\n${t}`:t}if(r&&nf){let e=nf.getAssistantSystemPromptAddendum();C=C?`${C}\n\n${e}`:e}let O,k,A;if(!x){let e=pu(!1);k=e.getFpsMetrics,A=e.stats,process.env.USER_TYPE===`ant`&&Jc();let{createRoot:n}=await import(`./src-CST_jFnT.js`);O=await n(e.renderOptions),G(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),I(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await fu(O,Ve,s,Rt);if(I(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),De!==void 0){let{getBridgeDisabledReason:e}=await import(`./bridgeEnabled-D8wP3DWQ.js`),t=await e();Oe=t===null,t&&process.stderr.write(v.yellow(`${t}\n--rc flag ignored.\n`))}i&&t?.trim().toLowerCase()===`/login`&&(t=``),i&&(Nc(),ra(),vc(),import(`./trustedDevice-BYt39fui.js`).then(e=>(e.clearTrustedDeviceToken(),e.enrollTrustedDevice())));let a=await Ss();a.valid||await X(O,a.message)}if(process.exitCode!==void 0){I(`Graceful shutdown initiated, skipping further initialization`);return}if(pr(),!x){let{errors:e}=Ua(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await mu(O,{settingsErrors:t,onExit:()=>ln(1)})}let Jt=B().startupPrefetchedAt??0;p()?(I(`Skipping startup prefetches, last ran ${Math.round((Date.now()-Jt)/1e3)}s ago`),Es()):(I(`Starting background startup prefetches${Jt>0?` last ran ${Math.round((Date.now()-Jt)/1e3)}s ago`:``}`),Et().catch(e=>U(e)),Jl(),Cc(),vs()),x||cl();let{servers:Xt}=await st;I(`[STARTUP] MCP configs resolved in ${at}ms (awaited at +${Date.now()-it}ms)`);let Qt={...Xt,...Ue},en={},tn={};for(let[e,t]of Object.entries(Qt)){let n=t;n.type===`sdk`?en[e]=n:tn[e]=n}K(`action_mcp_configs_loaded`);let nn=x?Promise.resolve({clients:[],tools:[],commands:[]}):fi(tn),an=x?Promise.resolve({clients:[],tools:[],commands:[]}):rt.then(e=>Object.keys(e).length>0?fi(e):{clients:[],tools:[],commands:[]}),dn=Promise.all([nn,an]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:wn([...e.tools,...t.tools],`name`),commands:wn([...e.commands,...t.commands],`name`)})),fn=fe||de||pe||x||n.continue||n.resume?null:vn(`startup`,{agentType:E?.agentType,model:Kt}),pn=[];dn.catch(()=>{});let mn=[],hn=[],gn=[],bn=Yr(),j=bn===!1?{type:`disabled`}:{type:`adaptive`};if(n.thinking===`adaptive`||n.thinking===`enabled`)bn=!0,j={type:`adaptive`};else if(n.thinking===`disabled`)bn=!1,j={type:`disabled`};else{let e=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):n.maxThinkingTokens;e!==void 0&&(e>0?(bn=!0,j={type:`enabled`,budgetTokens:e}):e===0&&(bn=!1,j={type:`disabled`}))}H(`info`,`started`,{version:`0.0.7`,is_native_binary:Lo()}),Sa(async()=>{H(`info`,`exited`)}),Sf({hasInitialPrompt:!!t,hasStdin:!!T,verbose:le,debug:i,debugToStderr:a,print:ue??!1,outputFormat:g??`text`,inputFormat:_??`text`,numAllowedTools:l.length,numDisallowedTools:u.length,mcpClientCount:Object.keys(Qt).length,worktreeEnabled:ve,skipWebFetchPreflight:za().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:o??!1,permissionMode:Ve,modeIsBypass:Ve===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:s,systemPromptFlag:S?n.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:C?n.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:j,assistantActivationPath:r?nf?.getAssistantActivationPath():void 0}),$r(tn,w),Fi(null,`initialization`),of(),Pr().then(e=>{e&&(wt&&sn(wt),$t().then(e=>{e>=2&&G(`tengu_concurrent_sessions`,{num_sessions:e})}))}),p()||(x?(await ar(),K(`action_after_plugins_init`),Ti().then(()=>Yi())):ar().then(async()=>{K(`action_after_plugins_init`),await Ti(),Yi()}));let xn=fe||de?`init`:pe?`maintenance`:null;if(fe){Kc(),await ia(`init`,{forceSyncExecution:!0}),await vn(`startup`,{forceSyncExecution:!0}),ln(0);return}if(x){(g===`stream-json`||g===`json`)&&Ca(!0),Kc(),Hl();let e=n.continue||n.resume||b||xn?void 0:vn(`startup`);e?.catch(()=>{}),K(`before_validateForceLoginOrg`);let t=await Ss();t.valid||(process.stderr.write(t.message+`
|
|
841
|
-
`),process.exit(1));let i=me?[]:Rt.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),a=zn(),o=kn({...a,mcp:{...a.mcp,clients:mn,commands:gn,tools:hn},toolPermissionContext:w,...ws()&&{fastMode:is(Wt??null)},...Wr()&&D&&{advisorModel:D},kairosEnabled:r},qc);Pt(w,o.getState().fastMode).then(({updateContext:e})=>{o.setState(t=>{let n=e(t.toolPermissionContext);return n===t.toolPermissionContext?t:{...t,toolPermissionContext:n}})}),n.sessionPersistence===!1&&Re(!0),Le(Go(te));let s=(e,t)=>Object.keys(e).length===0?Promise.resolve():(o.setState(t=>({...t,mcp:{...t.mcp,clients:[...t.mcp.clients,...Object.entries(e).map(([e,t])=>({name:e,type:`pending`,config:t}))]}})),Di(({client:e,tools:t,commands:n})=>{o.setState(r=>({...r,mcp:{...r.mcp,clients:r.mcp.clients.some(t=>t.name===e.name)?r.mcp.clients.map(t=>t.name===e.name?e:t):[...r.mcp.clients,e],tools:wn([...r.mcp.tools,...t],`name`),commands:wn([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>I(`[MCP] ${t} connect error: ${e}`)));K(`before_connectMcp`),await s(tn,`regular`),K(`after_connectMcp`);let c=5e3,u=rt.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=Nr(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(tn)){if(!e.startsWith(`plugin:`))continue;let i=Nr(r);i&&t.has(i)&&n.add(e)}if(n.size>0){I(`[MCP] Lazy dedup: suppressing ${n.size} plugin server(s) that duplicate claude.ai connectors: ${[...n].join(`, `)}`);for(let e of o.getState().mcp.clients)!n.has(e.name)||e.type!==`connected`||(e.client.onclose=void 0,Vn(e.name,e.config).catch(()=>{}));o.setState(e=>{let{clients:t,tools:r,commands:i,resources:a}=e.mcp;t=t.filter(e=>!n.has(e.name)),r=r.filter(e=>!e.mcpInfo||!n.has(e.mcpInfo.serverName));for(let e of n)i=Ai(i,e),a=dr(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=Ui(e,qa(tn,(e,t)=>!t.startsWith(`plugin:`)));return s(t,`claudeai`)}),d,f=await Promise.race([u.then(()=>!1),new Promise(e=>{d=setTimeout(e=>e(!0),c,e)})]);d&&clearTimeout(d),f&&I(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),K(`after_connectMcp_claudeai`),p()||(pf(),import(`./backgroundHousekeeping-BpLtI45r.js`).then(e=>e.startBackgroundHousekeeping()),process.env.USER_TYPE===`ant`&&import(`./sdkHeapDumpMonitor-WdXUV7DV.js`).then(e=>e.startSdkMemoryMonitor())),sf(),K(`before_print_import`);let{runHeadless:m}=await import(`./print-uxCF5ka5.js`);K(`after_print_import`),m(T,()=>o.getState(),o.setState,i,ct,en,Ht.activeAgents,{continue:n.continue,resume:n.resume,verbose:le,outputFormat:g,jsonSchema:lt,permissionPromptToolName:n.permissionPromptTool,allowedTools:l,thinkingConfig:j,maxTurns:n.maxTurns,maxBudgetUsd:n.maxBudgetUsd,taskBudget:n.taskBudget?{total:n.taskBudget}:void 0,systemPrompt:S,appendSystemPrompt:C,userSpecifiedModel:Wt,fallbackModel:kt,teleport:b,sdkUrl:xe,replayUserMessages:St,includePartialMessages:Se,forkSession:n.forkSession||!1,resumeSessionAt:n.resumeSessionAt||void 0,rewindFiles:n.rewindFiles,enableAuthStatus:n.enableAuthStatus,agent:ce,workload:n.workload,setupTrigger:xn??void 0,sessionStartHooksPromise:e});return}G(`tengu_startup_manual_model_config`,{cli_flag:n.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:(za()||{}).model,subscriptionType:Ko(),agent:Ut});let Cn=al(Kt),Tn=[];if(He&&Tn.push({key:`permission-mode-notification`,text:He,priority:`high`}),Cn&&Tn.push({key:`model-deprecation-warning`,text:Cn,color:`warning`,priority:`high`}),nt.length>0){let e=Ga(nt.map(e=>e.ruleDisplay)),t=e.join(`, `),n=Ga(nt.map(e=>e.sourceDisplay)).join(`, `),r=e.length;Tn.push({key:`overly-broad-bash-notification`,text:`${t} allow ${zo(r,`rule`)} from ${n} ${zo(r,`was`,`were`)} ignored \u2014 not available for Ants, please use auto-mode instead`,color:`warning`,priority:`high`})}let An={...w},jn=Xe(),Mn=Oe||$a()||r,Nn={settings:za(),tasks:{},agentNameRegistry:new Map,verbose:le??B().verbose??!1,mainLoopModel:Gt,mainLoopModelForSession:null,isBriefOnly:jn,expandedView:B().showExpandedTodos?`tasks`:`none`,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:An,agent:E?.agentType,agentDefinitions:Ht,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,kairosEnabled:r,remoteSessionUrl:void 0,remoteConnectionStatus:`connecting`,remoteBackgroundTaskCount:0,replBridgeEnabled:Mn||!1,replBridgeExplicit:Oe,replBridgeOutboundOnly:!1,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:Ae,showRemoteCallout:!1,notifications:{current:null,queue:Tn},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:uc(),thinkingEnabled:bn,promptSuggestionEnabled:vi(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:It,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},authVersion:0,initialMessage:T?{message:Tr({content:String(T)})}:null,activeOverlays:new Set,fastMode:is(Kt),...Wr()&&D&&{advisorModel:D}};T&&Wn(String(T));let Pn=hn;z(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{lf(),sf()});let Fn=process.env.USER_TYPE===`ant`?import(`./sessionDataUploader-CaCjwsA2.js`):null,In=Fn?Fn.then(e=>e.createSessionTurnUploader()).catch(()=>null):null,Bn={debug:i||a,commands:[...Rt,...gn],initialTools:Pn,mcpClients:mn,autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,dynamicMcpConfig:Ue,strictMcpConfig:Ge,systemPrompt:S,appendSystemPrompt:C,taskListId:ge,thinkingConfig:j,...In&&{onTurnComplete:e=>{In.then(t=>t?.(e))}}},Hn={mainThreadAgentDefinition:E,agentDefinitions:Ht,currentCwd:At,cliAgents:Bt,initialState:Nn};if(n.continue){let e=!1;try{let t=performance.now(),{clearSessionCaches:r}=await import(`./caches-B-nJoHLM.js`);r();let i=await cn(void 0,void 0);if(!i)return G(`tengu_continue`,{success:!1}),await X(O,`No conversation found to continue`);let a=await Yc(i,{forkSession:!!n.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},Hn);a.restoredAgentDef&&(E=a.restoredAgentDef),Cf(n),wf(n),G(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-t)}),e=!0,await Gl(O,{getFpsMetrics:k,stats:A,initialState:a.initialState},{...Bn,mainThreadAgentDefinition:a.restoredAgentDef??E,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},du)}catch(t){e||G(`tengu_continue`,{success:!1}),U(t),process.exit(1)}}else if(Q?.url){let e;try{let t=await Qd({serverUrl:Q.url,authToken:Q.authToken,cwd:Ke(),dangerouslySkipPermissions:Q.dangerouslySkipPermissions});t.workDir&&(Ie(t.workDir),$e(t.workDir)),Me(Q.url),e=t.config}catch(e){return await X(O,e instanceof Zd?e.message:String(e),()=>M(1))}let t=vr(`Connected to server at ${Q.url}\nSession: ${e.sessionId}`,`info`);await Gl(O,{getFpsMetrics:k,stats:A,initialState:Nn},{debug:i||a,commands:Rt,initialTools:[],initialMessages:[t],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,directConnectConfig:e,thinkingConfig:j},du);return}else if($?.host){let{createSSHSession:e,createLocalSSHSession:t,SSHSessionError:n}=await import(`./createSSHSession-BOdTAX3N.js`),r;try{if($.local)process.stderr.write(`Starting local ssh-proxy test session...
|
|
842
|
-
`),r=await t({cwd:$.cwd,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions});else{process.stderr.write(`Connecting to ${$.host}…\n`);let t=process.stderr.isTTY,n=!1;r=await e({host:$.host,cwd:$.cwd,localVersion:`0.0.7`,permissionMode:$.permissionMode,dangerouslySkipPermissions:$.dangerouslySkipPermissions,extraCliArgs:$.extraCliArgs,remoteBin:$.remoteBin},t?{onProgress:e=>{n=!0,process.stderr.write(`\r ${e}\x1b[K`)}}:{}),n&&process.stderr.write(`
|
|
843
|
-
`)}Ie(r.remoteCwd),$e(r.remoteCwd),Me($.local?`local`:$.host)}catch(e){return await X(O,e instanceof n?e.message:String(e),()=>M(1))}let o=vr($.local?`Local ssh-proxy test session\ncwd: ${r.remoteCwd}\nAuth: unix socket → local proxy`:`SSH session to ${$.host}\nRemote cwd: ${r.remoteCwd}\nAuth: unix socket -R → local proxy`,`info`);await Gl(O,{getFpsMetrics:k,stats:A,initialState:Nn},{debug:i||a,commands:Rt,initialTools:[],initialMessages:[o],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,sshSession:r,thinkingConfig:j},du);return}else if(vf&&(vf.sessionId||vf.discover)){let{discoverAssistantSessions:e}=await import(`./sessionDiscovery-DfDqTrF1.js`),t=vf.sessionId;if(!t){let n;try{n=await e()}catch(e){return await X(O,`Failed to discover sessions: ${e instanceof Error?e.message:e}`,()=>M(1))}if(n.length===0){let e;try{e=await gu(O)}catch(e){return await X(O,`Assistant installation failed: ${e instanceof Error?e.message:e}`,()=>M(1))}return e===null&&(await M(0),process.exit(0)),await uu(O,`Assistant installed in ${e}. The daemon is starting up — run \`claude assistant\` again in a few seconds to connect.`,{exitCode:0,beforeExit:()=>M(0)})}if(n.length===1)t=n[0].id;else{let e=await hu(O,{sessions:n});e||(await M(0),process.exit(0)),t=e}}let{checkAndRefreshOAuthTokenIfNeeded:n,getClaudeAIOAuthTokens:r}=await import(`./auth-D_cGl8WD.js`);await n();let o;try{o=await hc()}catch(e){return await X(O,`Error: ${e instanceof Error?e.message:`Failed to authenticate`}`,()=>M(1))}let s=()=>r()?.accessToken??o.accessToken;je(!0),ze(!0),ke(!0);let c=ol(t,s,o.orgUUID,!1,!0),l=vr(`Attached to assistant session ${t.slice(0,8)}…`,`info`),u={...Nn,isBriefOnly:!0,kairosEnabled:!1,replBridgeEnabled:!1},d=Mt(Rt);await Gl(O,{getFpsMetrics:k,stats:A,initialState:u},{debug:i||a,commands:d,initialTools:[],initialMessages:[l],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,remoteSessionConfig:c,thinkingConfig:j},du);return}else if(n.resume||n.fromPr||b||Te!==null){let{clearSessionCaches:e}=await import(`./caches-B-nJoHLM.js`);e();let t=null,r,o=ot(n.resume),s,c=null,l;if(n.fromPr&&(n.fromPr===!0?l=!0:typeof n.fromPr==`string`&&(l=n.fromPr)),n.resume&&typeof n.resume==`string`&&!o){let e=n.resume.trim();if(e){let t=await Wi(e,{exact:!0});t.length===1?(c=t[0],o=vt(c)??null):s=e}}if((Te!==null||b)&&(await jt(),!Ft(`allow_remote_sessions`)))return await X(O,`Error: Remote sessions are disabled by your organization's policy.`,()=>M(1));if(Te!==null){let e=Te.length>0;if(!e)return await X(O,`Error: --remote requires a description.
|
|
844
|
-
Usage: claude --remote "your task description"`,()=>M(1));G(`tengu_remote_create_session`,{has_initial_prompt:String(e)});let t=await po(),n=await Ki(O,e?Te:null,new AbortController().signal,t||void 0);if(!n)return G(`tengu_remote_create_session_error`,{error:`unable_to_create_session`}),await X(O,`Error: Unable to create remote session`,()=>M(1));G(`tengu_remote_create_session_success`,{session_id:n.id}),process.stdout.write(`Created remote session: ${n.title}\n`),process.stdout.write(`View: ${zi(n.id)}?m=0\n`),process.stdout.write(`Resume with: claude --teleport ${n.id}\n`),await M(0),process.exit(0),ke(!0),Qe(Rr(n.id));let r;try{r=await hc()}catch(e){return U(pa(e)),await X(O,`Error: ${F(e)||`Failed to authenticate`}`,()=>M(1))}let{getClaudeAIOAuthTokens:o}=await import(`./auth-D_cGl8WD.js`),s=ol(n.id,()=>o()?.accessToken??r.accessToken,r.orgUUID,e),c=`${zi(n.id)}?m=0`,l=vr(`/remote-control is active. Code in CLI or at ${c}`,`info`),u=e?Tr({content:Te}):null,d={...Nn,remoteSessionUrl:c},f=Mt(Rt);await Gl(O,{getFpsMetrics:k,stats:A,initialState:d},{debug:i||a,commands:f,initialTools:[],initialMessages:u?[l,u]:[l],mcpClients:[],autoConnectIdeFlag:ne,mainThreadAgentDefinition:E,disableSlashCommands:me,remoteSessionConfig:s,thinkingConfig:j},du);return}else if(b){if(b===!0||b===``){G(`tengu_teleport_interactive_mode`,{}),I(`selectAndResumeTeleportTask: Starting teleport flow...`);let e=await _u(O);e||(await M(0),process.exit(0));let{branchError:n}=await Qn(e.branch);t=or(e.log,n)}else if(typeof b==`string`){G(`tengu_teleport_resume_session`,{mode:`direct`});try{let e=await Tt(await _c(b));if(e.status===`mismatch`||e.status===`not_in_repo`){let t=e.sessionRepo;if(t){let e=await tl(el(t));if(e.length>0){let n=await vu(O,{targetRepo:t,initialPaths:e});n?(process.chdir(n),_n(n),Ie(n)):await M(0)}else throw new ua(`You must run claude --teleport ${b} from a checkout of ${t}.`,v.red(`You must run claude --teleport ${b} from a checkout of ${v.bold(t)}.\n`))}}else if(e.status===`error`)throw new ua(e.errorMessage||`Failed to validate session`,v.red(`Error: ${e.errorMessage||`Failed to validate session`}\n`));await On();let{teleportWithProgress:n}=await import(`./TeleportProgress-DxN0bQL2.js`),r=await n(O,b);Je({sessionId:b}),t=r.messages}catch(e){e instanceof ua?process.stderr.write(e.formattedMessage+`
|
|
845
|
-
`):(U(e),process.stderr.write(v.red(`Error: ${F(e)}\n`))),await M(1)}}}if(process.env.USER_TYPE===`ant`&&n.resume&&typeof n.resume==`string`&&!o){let e=dl(n.resume);try{let t=performance.now(),i;try{i=await Rn(e)}catch(e){if(!fa(e))throw e}if(i){let e=await cn(i,void 0);e?(r=await Yc(e,{forkSession:!!n.forkSession,transcriptPath:e.fullPath},Hn),r.restoredAgentDef&&(E=r.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`file`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})):G(`tengu_session_resumed`,{entrypoint:`file`,success:!1})}}catch(e){G(`tengu_session_resumed`,{entrypoint:`file`,success:!1}),U(e),await X(O,`Unable to load transcript from file: ${n.resume}`,()=>M(1))}}if(o){let e=o;try{let t=performance.now(),i=await cn(c??e,void 0);if(!i)return G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await X(O,`No conversation found with session ID: ${e}`);let a=c?.fullPath??i.fullPath;r=await Yc(i,{forkSession:!!n.forkSession,sessionIdOverride:e,transcriptPath:a},Hn),r.restoredAgentDef&&(E=r.restoredAgentDef),G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!0,resume_duration_ms:Math.round(performance.now()-t)})}catch(t){G(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),U(t),await X(O,`Failed to resume session ${e}`)}}if(oe)try{let e=await oe,t=Wa(e,e=>!e.success);t>0&&process.stderr.write(v.yellow(`Warning: ${t}/${e.length} file(s) failed to download.\n`))}catch(e){return await X(O,`Error downloading files: ${F(e)}`)}let u=r??(Array.isArray(t)?{messages:t,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:E,initialState:Nn,contentReplacements:void 0}:void 0);u?(Cf(n),wf(n),await Gl(O,{getFpsMetrics:k,stats:A,initialState:u.initialState},{...Bn,mainThreadAgentDefinition:u.restoredAgentDef??E,initialMessages:u.messages,initialFileHistorySnapshots:u.fileHistorySnapshots,initialContentReplacements:u.contentReplacements,initialAgentName:u.agentName,initialAgentColor:u.agentColor},du)):await yu(O,{getFpsMetrics:k,stats:A,initialState:Nn},on(Ke()),{...Bn,initialSearchQuery:s,forkSession:n.forkSession,filterByPr:l})}else{let e=fn&&pn.length===0?fn:void 0;K(`action_after_hooks`),Cf(n),wf(n);let t=null;n.deepLinkOrigin?(G(`tengu_deep_link_opened`,{has_prefill:!!n.prefill,has_repo:!!n.deepLinkRepo}),t=vr(il({cwd:oa(),prefillLength:n.prefill?.length,repo:n.deepLinkRepo,lastFetch:n.deepLinkLastFetch===void 0?void 0:new Date(n.deepLinkLastFetch)}),`warning`)):n.prefill&&(t=vr(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=t?[t,...pn]:pn.length>0?pn:void 0;await Gl(O,{getFpsMetrics:k,stats:A,initialState:Nn},{...Bn,initialMessages:r,pendingHookMessages:e},du)}}).version(`0.0.7 (Work Mate)`,`-v, --version`,`Output the version number`),n.option(`-w, --worktree [name]`,`Create a new git worktree for this session (optionally specify a name)`),n.option(`--tmux`,`Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.`),ji()&&n.addOption(new J(`--advisor <model>`,`Enable the server-side advisor tool with the specified model (alias or full ID).`).hideHelp()),process.env.USER_TYPE===`ant`&&(n.addOption(new J(`--delegate-permissions`,`[ANT-ONLY] Alias for --permission-mode auto.`).implies({permissionMode:`auto`})),n.addOption(new J(`--dangerously-skip-permissions-with-classifiers`,`[ANT-ONLY] Deprecated alias for --permission-mode auto.`).hideHelp().implies({permissionMode:`auto`})),n.addOption(new J(`--afk`,`[ANT-ONLY] Deprecated alias for --permission-mode auto.`).hideHelp().implies({permissionMode:`auto`})),n.addOption(new J(`--tasks [id]`,`[ANT-ONLY] Tasks mode: watch for tasks and auto-process them. Optional id is used as both the task list ID and agent ID (defaults to "tasklist").`).argParser(String).hideHelp()),n.option(`--agent-teams`,`[ANT-ONLY] Force Claude to use multi-agent mode for solving problems`,()=>!0)),n.addOption(new J(`--enable-auto-mode`,`Opt in to auto mode`).hideHelp()),n.addOption(new J(`--proactive`,`Start in proactive autonomous mode`)),n.addOption(new J(`--brief`,`Enable SendUserMessage tool for agent-to-user communication`)),n.addOption(new J(`--assistant`,`Force assistant mode (Agent SDK daemon use)`).hideHelp()),n.addOption(new J(`--sdk-url <url>`,`Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)`).hideHelp()),n.addOption(new J(`--teleport [session]`,`Resume a teleport session, optionally specify session ID`).hideHelp()),n.addOption(new J(`--remote [description]`,`Create a remote session with the given description`).hideHelp()),n.addOption(new J(`--remote-control [name]`,`Start an interactive session with Remote Control enabled (optionally named)`).argParser(e=>e||!0).hideHelp()),n.addOption(new J(`--rc [name]`,`Alias for --remote-control`).argParser(e=>e||!0).hideHelp()),K(`run_main_options_built`);let r=process.argv.includes(`-p`)||process.argv.includes(`--print`),i=process.argv.some(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(r&&!i)return K(`run_before_parse`),await n.parseAsync(process.argv),K(`run_after_parse`),n;let a=n.command(`mcp`).description(`Configure and manage MCP servers`).configureHelp(t()).enablePositionalOptions();a.command(`serve`).description(`Start the Work Mate MCP server`).option(`-d, --debug`,`Enable debug mode`,()=>!0).option(`--verbose`,`Override verbose mode setting from config`,()=>!0).action(async({debug:e,verbose:t})=>{let{mcpServeHandler:n}=await import(`./mcp-CMnDNI-4.js`);await n({debug:e,verbose:t})}),Ld(a),Kr()&&Rd(a),a.command(`remove <name>`).description(`Remove an MCP server`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in`).action(async(e,t)=>{let{mcpRemoveHandler:n}=await import(`./mcp-CMnDNI-4.js`);await n(e,t)}),a.command(`list`).description(`List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let{mcpListHandler:e}=await import(`./mcp-CMnDNI-4.js`);await e()}),a.command(`get <name>`).description(`Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async e=>{let{mcpGetHandler:t}=await import(`./mcp-CMnDNI-4.js`);await t(e)}),a.command(`add-json <name> <json>`).description(`Add an MCP server (stdio or SSE) with a JSON string`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).option(`--client-secret`,`Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)`).action(async(e,t,n)=>{let{mcpAddJsonHandler:r}=await import(`./mcp-CMnDNI-4.js`);await r(e,t,n)}),a.command(`add-from-claude-desktop`).description(`Import MCP servers from Claude Desktop (Mac and WSL only)`).option(`-s, --scope <scope>`,`Configuration scope (local, user, or project)`,`local`).action(async e=>{let{mcpAddFromDesktopHandler:t}=await import(`./mcp-CMnDNI-4.js`);await t(e)}),a.command(`reset-project-choices`).description(`Reset all approved and rejected project-scoped (.mcp.json) servers within this project`).action(async()=>{let{mcpResetChoicesHandler:e}=await import(`./mcp-CMnDNI-4.js`);await e()}),n.command(`server`).description(`Start a Work Mate session server`).option(`--port <number>`,`HTTP port`,`0`).option(`--host <string>`,`Bind address`,`0.0.0.0`).option(`--auth-token <token>`,`Bearer token for auth`).option(`--unix <path>`,`Listen on a unix domain socket`).option(`--workspace <dir>`,`Default working directory for sessions that do not specify cwd`).option(`--idle-timeout <ms>`,`Idle timeout for detached sessions in ms (0 = never expire)`,`600000`).option(`--max-sessions <n>`,`Maximum concurrent sessions (0 = unlimited)`,`32`).action(async e=>{let{randomBytes:t}=await import(`crypto`),{startServer:n}=await import(`./server-LdbAb0sV.js`),{SessionManager:r}=await import(`./sessionManager-CPa049BO.js`),{DangerousBackend:i}=await import(`./dangerousBackend-DwcP0P08.js`),{printBanner:a}=await import(`./serverBanner-BdExKFHT.js`),{createServerLogger:o}=await import(`./serverLog-BFmvyJ93.js`),{writeServerLock:s,removeServerLock:c,probeRunningServer:l}=await import(`./lockfile-D5-j7HOZ.js`),u=await l();u&&(process.stderr.write(`A claude server is already running (pid ${u.pid}) at ${u.httpUrl}\n`),process.exit(1));let d=e.authToken??`sk-ant-cc-${t(16).toString(`base64url`)}`,f={port:parseInt(e.port,10),host:e.host,authToken:d,unix:e.unix,workspace:e.workspace,idleTimeoutMs:parseInt(e.idleTimeout,10),maxSessions:parseInt(e.maxSessions,10)},p=new r(new i,{idleTimeoutMs:f.idleTimeoutMs,maxSessions:f.maxSessions}),m=n(f,p,o()),ee=m.port??f.port;a(f,d,ee),await s({pid:process.pid,port:ee,host:f.host,httpUrl:f.unix?`unix:${f.unix}`:`http://${f.host}:${ee}`,startedAt:Date.now()});let h=!1,te=async()=>{h||(h=!0,m.stop(!0),await p.destroyAll(),await c(),process.exit(0))};process.once(`SIGINT`,()=>void te()),process.once(`SIGTERM`,()=>void te())}),n.command(`ssh <host> [dir]`).description(`Run Work Mate on a remote host over SSH. Deploys the binary and tunnels API auth back through your local machine — no remote setup needed.`).option(`--permission-mode <mode>`,`Permission mode for the remote session`).option(`--dangerously-skip-permissions`,`Skip all permission prompts on the remote (dangerous)`).option(`--remote-bin <command>`,`Custom remote binary command (skips probe/deploy). Example: --remote-bin 'bun /path/to/project/dist/cli.js'`).option(`--local`,`e2e test mode — spawn the child CLI locally (skip ssh/deploy). Exercises the auth proxy and unix-socket plumbing without a remote host.`).action(async()=>{process.stderr.write(`Usage: claude ssh <user@host | ssh-config-alias> [dir]
|
|
846
|
-
|
|
847
|
-
Runs Work Mate on a remote Linux host. You don't need to install
|
|
848
|
-
anything on the remote — the binary is
|
|
849
|
-
deployed over SSH and API auth tunnels back through your local machine.
|
|
850
|
-
`),process.exit(1)}),n.command(`open <cc-url>`).description(`Connect to a Work Mate server (internal — use cc:// URLs)`).option(`-p, --print [prompt]`,`Print mode (headless)`).option(`--output-format <format>`,`Output format: text, json, stream-json`,`text`).action(async(e,t)=>{let{parseConnectUrl:n}=await import(`./parseConnectUrl-BiyKR5-x.js`),{serverUrl:r,authToken:i}=n(e),a;try{let e=await Qd({serverUrl:r,authToken:i,cwd:Ke(),dangerouslySkipPermissions:Q?.dangerouslySkipPermissions});e.workDir&&(Ie(e.workDir),$e(e.workDir)),Me(r),a=e.config}catch(e){console.error(e instanceof Zd?e.message:String(e)),process.exit(1)}let{runConnectHeadless:o}=await import(`./connectHeadless-CqRoEtrg.js`),s=typeof t.print==`string`?t.print:``,c=t.print===!0;await o(a,s,t.outputFormat,c)});let o=n.command(`auth`).description(`Manage authentication`).configureHelp(t());o.command(`login`).description(`Sign in`).option(`--email <email>`,`Pre-populate email address on the login page`).option(`--sso`,`Force SSO login flow`).option(`--console`,`Use Console (API usage billing) instead of Claude subscription`).option(`--claudeai`,`Use Claude subscription (default)`).action(async({email:e,sso:t,console:n,claudeai:r})=>{let{authLogin:i}=await import(`./auth-DMfEiQrC.js`);await i({email:e,sso:t,console:n,claudeai:r})}),o.command(`status`).description(`Show authentication status`).option(`--json`,`Output as JSON (default)`).option(`--text`,`Output as human-readable text`).action(async e=>{let{authStatus:t}=await import(`./auth-DMfEiQrC.js`);await t(e)});let s=()=>new J(`--cowork`,`Use cowork_plugins directory`).hideHelp(),c=n.command(`plugin`).alias(`plugins`).description(`Manage Work Mate plugins`).configureHelp(t());c.command(`validate <path>`).description(`Validate a plugin or marketplace manifest`).addOption(s()).action(async(e,t)=>{let{pluginValidateHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),c.command(`list`).description(`List installed plugins`).option(`--json`,`Output as JSON`).option(`--available`,`Include available plugins from marketplaces (requires --json)`).addOption(s()).action(async e=>{let{pluginListHandler:t}=await import(`./plugins-CQNKZmjP.js`);await t(e)});let l=c.command(`marketplace`).description(`Manage Work Mate marketplaces`).configureHelp(t());if(l.command(`add <source>`).description(`Add a marketplace from a URL, path, or GitHub repo`).addOption(s()).option(`--sparse <paths...>`,`Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins`).option(`--scope <scope>`,`Where to declare the marketplace: user (default), project, or local`).action(async(e,t)=>{let{marketplaceAddHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),l.command(`list`).description(`List all configured marketplaces`).option(`--json`,`Output as JSON`).addOption(s()).action(async e=>{let{marketplaceListHandler:t}=await import(`./plugins-CQNKZmjP.js`);await t(e)}),l.command(`remove <name>`).alias(`rm`).description(`Remove a configured marketplace`).addOption(s()).action(async(e,t)=>{let{marketplaceRemoveHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),l.command(`update [name]`).description(`Update marketplace(s) from their source - updates all if no name specified`).addOption(s()).action(async(e,t)=>{let{marketplaceUpdateHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),c.command(`install <plugin>`).alias(`i`).description(`Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)`).option(`-s, --scope <scope>`,`Installation scope: user, project, or local`,`user`).addOption(s()).action(async(e,t)=>{let{pluginInstallHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),c.command(`uninstall <plugin>`).alias(`remove`).alias(`rm`).description(`Uninstall an installed plugin`).option(`-s, --scope <scope>`,`Uninstall from scope: user, project, or local`,`user`).option(`--keep-data`,`Preserve the plugin's persistent data directory (~/.claude/plugins/data/{id}/)`).addOption(s()).action(async(e,t)=>{let{pluginUninstallHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),c.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${Uc.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),c.command(`disable [plugin]`).description(`Disable an enabled plugin`).option(`-a, --all`,`Disable all enabled plugins`).option(`-s, --scope <scope>`,`Installation scope: ${Uc.join(`, `)} (default: auto-detect)`).addOption(s()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),c.command(`update <plugin>`).description(`Update a plugin to the latest version (restart required to apply)`).option(`-s, --scope <scope>`,`Installation scope: ${Vc.join(`, `)} (default: user)`).addOption(s()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-CQNKZmjP.js`);await n(e,t)}),n.command(`setup-token`).description(`Set up a long-lived authentication token (requires Claude subscription)`).action(async()=>{let[{setupTokenHandler:e},{createRoot:t}]=await Promise.all([import(`./util-8EHwfg4A.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Qc(!1)))}),n.command(`agents`).description(`List configured agents`).option(`--setting-sources <sources>`,`Comma-separated list of setting sources to load (user, project, local).`).action(async()=>{let{agentsHandler:e}=await import(`./agents-DE_4mAHG.js`);await e(),process.exit(0)}),Xi()!==`disabled`){let e=n.command(`auto-mode`).description(`Inspect auto mode classifier configuration`);e.command(`defaults`).description(`Print the default auto mode environment, allow, and deny rules as JSON`).action(async()=>{let{autoModeDefaultsHandler:e}=await import(`./autoMode-ZW70mpr0.js`);e(),process.exit(0)}),e.command(`config`).description(`Print the effective auto mode config as JSON: your settings where set, defaults otherwise`).action(async()=>{let{autoModeConfigHandler:e}=await import(`./autoMode-ZW70mpr0.js`);e(),process.exit(0)}),e.command(`critique`).description(`Get AI feedback on your custom auto mode rules`).option(`--model <model>`,`Override which model is used`).action(async e=>{let{autoModeCritiqueHandler:t}=await import(`./autoMode-ZW70mpr0.js`);await t(e),process.exit()})}{let e=n.command(`autonomy`).description(`Inspect and manage automatic autonomy runs and flows`);e.command(`status`).description(`Print autonomy run, flow, team, pipe, and remote-control status`).option(`--deep`,`Include teams, pipes, daemon, and remote-control sections`).action(async e=>{let{autonomyStatusHandler:t}=await import(`./autonomy-CwbWsCnv.js`);await t(e),process.exit(0)}),e.command(`runs [limit]`).description(`List recent autonomy runs`).action(async e=>{let{autonomyRunsHandler:t}=await import(`./autonomy-CwbWsCnv.js`);await t(e),process.exit(0)}),e.command(`flows [limit]`).description(`List recent autonomy flows`).action(async e=>{let{autonomyFlowsHandler:t}=await import(`./autonomy-CwbWsCnv.js`);await t(e),process.exit(0)});let t=e.command(`flow <flowId>`).description(`Inspect a single autonomy flow`).action(async e=>{let{autonomyFlowHandler:t}=await import(`./autonomy-CwbWsCnv.js`);await t(e),process.exit(0)});t.command(`cancel <flowId>`).description(`Cancel a queued, waiting, or running autonomy flow`).action(async e=>{let{autonomyFlowCancelHandler:t}=await import(`./autonomy-CwbWsCnv.js`);await t(e),process.exit(0)}),t.command(`resume <flowId>`).description(`Resume a waiting autonomy flow`).action(async e=>{let{autonomyFlowResumeHandler:t}=await import(`./autonomy-CwbWsCnv.js`);await t(e),process.exit(0)})}if(n.command(`remote-control`,{hidden:!0}).alias(`rc`).description(`Connect your local environment for remote-control sessions via claude.ai/code`).action(async()=>{let{bridgeMain:e}=await import(`./bridgeMain-CwxMa_pd.js`);await e(process.argv.slice(3))}),n.command(`assistant [sessionId]`).description(`Attach the REPL as a client to a running bridge session. Discovers sessions via API if no sessionId given.`).action(()=>{process.stderr.write(`Usage: claude assistant [sessionId]
|
|
851
|
-
|
|
852
|
-
Attach the REPL as a viewer client to a running bridge session.
|
|
853
|
-
Omit sessionId to discover and pick from available sessions.
|
|
854
|
-
`),process.exit(1)}),n.command(`doctor`).description(`Check the health of your Work Mate auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.`).action(async()=>{let[{doctorHandler:e},{createRoot:t}]=await Promise.all([import(`./util-8EHwfg4A.js`),import(`./src-CST_jFnT.js`)]);await e(await t(Qc(!1)))}),process.env.USER_TYPE===`ant`&&n.command(`up`).description(`[ANT-ONLY] Initialize or upgrade the local dev environment using the "# claude up" section of the nearest CLAUDE.md`).action(async()=>{let{up:e}=await import(`./up-BHkC97_C.js`);await e()}),process.env.USER_TYPE===`ant`&&n.command(`rollback [target]`).description(`[ANT-ONLY] Roll back to a previous release
|
|
855
|
-
|
|
856
|
-
Examples:
|
|
857
|
-
claude rollback Go 1 version back from current
|
|
858
|
-
claude rollback 3 Go 3 versions back from current
|
|
859
|
-
claude rollback 2.0.73-dev.20251217.t190658 Roll back to a specific version`).option(`-l, --list`,`List recent published versions with ages`).option(`--dry-run`,`Show what would be installed without installing`).option(`--safe`,`Roll back to the server-pinned safe version (set by oncall during incidents)`).action(async(e,t)=>{let{rollback:n}=await import(`./rollback-BPWRKlIZ.js`);await n(e,t)}),n.command(`install [target]`).description(`Install Work Mate native build. Use [target] to specify version (stable, latest, or specific version)`).option(`--force`,`Force installation even if already installed`).action(async(e,t)=>{let{installHandler:n}=await import(`./util-8EHwfg4A.js`);await n(e,t)}),n.command(`update`).description(`Update workmate (ccb) to the latest version`).action(async()=>{let{updateCCB:e}=await import(`./updateCCB-C2G-U-qA.js`);await e()}),process.env.USER_TYPE===`ant`){if(n.command(`log`).description(`[ANT-ONLY] Manage conversation logs.`).argument(`[number|sessionId]`,`A number (0, 1, 2, etc.) to display a specific log, or the sesssion ID (uuid) of a log`,e=>ot(e)||Number(e)).action(async e=>{let{logHandler:t}=await import(`./ant-ClQkuQjZ.js`);await t(e)}),n.command(`error`).description(`[ANT-ONLY] View error logs. Optionally provide a number (0, -1, -2, etc.) to display a specific log.`).argument(`[number]`,`A number (0, 1, 2, etc.) to display a specific log`,parseInt).action(async e=>{let{errorHandler:t}=await import(`./ant-ClQkuQjZ.js`);await t(e)}),process.env.USER_TYPE===`ant`){let e=n.command(`task`).description(`[ANT-ONLY] Manage task list tasks`);e.command(`create <subject>`).description(`Create a new task`).option(`-d, --description <text>`,`Task description`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async(e,t)=>{let{taskCreateHandler:n}=await import(`./ant-ClQkuQjZ.js`);await n(e,t)}),e.command(`list`).description(`List all tasks`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).option(`--pending`,`Show only pending tasks`).option(`--json`,`Output as JSON`).action(async e=>{let{taskListHandler:t}=await import(`./ant-ClQkuQjZ.js`);await t(e)}),e.command(`get <id>`).description(`Get details of a task`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async(e,t)=>{let{taskGetHandler:n}=await import(`./ant-ClQkuQjZ.js`);await n(e,t)}),e.command(`update <id>`).description(`Update a task`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).option(`-s, --status <status>`,`Set status (${gr.join(`, `)})`).option(`--subject <text>`,`Update subject`).option(`-d, --description <text>`,`Update description`).option(`--owner <agentId>`,`Set owner`).option(`--clear-owner`,`Clear owner`).action(async(e,t)=>{let{taskUpdateHandler:n}=await import(`./ant-ClQkuQjZ.js`);await n(e,t)}),e.command(`dir`).description(`Show the tasks directory path`).option(`-l, --list <id>`,`Task list ID (defaults to "tasklist")`).action(async e=>{let{taskDirHandler:t}=await import(`./ant-ClQkuQjZ.js`);await t(e)})}n.command(`completion <shell>`,{hidden:!0}).description(`Generate shell completion script (bash, zsh, or fish)`).option(`--output <file>`,`Write completion script directly to a file instead of stdout`).action(async(e,t)=>{let{completionHandler:r}=await import(`./ant-ClQkuQjZ.js`);await r(e,t,n)})}return K(`run_before_parse`),await n.parseAsync(process.argv),K(`run_after_parse`),K(`main_after_run`),Ao(),n}async function Sf({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktreeEnabled:d,skipWebFetchPreflight:f,githubActionInputs:ee,dangerouslySkipPermissionsPassed:h,permissionMode:te,modeIsBypass:ne,allowDangerouslySkipPermissionsPassed:re,systemPromptFlag:ie,appendSystemPromptFlag:ae,thinkingConfig:oe,assistantActivationPath:se}){try{G(`tengu_init`,{entrypoint:`claude`,hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktree:d,skipWebFetchPreflight:f,...ee&&{githubActionInputs:ee},dangerouslySkipPermissionsPassed:h,permissionMode:te,modeIsBypass:ne,inProtectedNamespace:m(),allowDangerouslySkipPermissionsPassed:re,thinkingType:oe.type,...oe.type===`enabled`&&{thinkingBudgetTokens:oe.budgetTokens},...ie&&{systemPromptFlag:ie},...ae&&{appendSystemPromptFlag:ae},is_simple:p()||void 0,...se&&{assistantActivationPath:se},autoUpdatesChannel:za().autoUpdatesChannel??`latest`,...process.env.USER_TYPE===`ant`?(()=>{let e=oa(),t=go(e),n=t?ul(t,e)||`.`:void 0;return n?{relativeProjectPath:n}:{}})():{}})}catch(e){U(e)}}function Cf(t){if(t.proactive||d(process.env.CLAUDE_CODE_PROACTIVE)){let t=(ic(),e(tc));t.isProactiveActive()||t.activateProactive(`command`)}}function wf(t){let n=t.brief,r=d(process.env.CLAUDE_CODE_BRIEF);if(!n&&!r)return;let{isBriefEntitled:i}=(un(),e(Gn)),a=i();a&&ze(!0),G(`tengu_brief_mode_enabled`,{enabled:a,gated:!a,source:r?`env`:`flag`})}function Tf(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(fe)}export{yf as main};
|