@readmagic/workmate 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-DWgTWJ7R.js → AddWorkspaceDirectory-Ch8IcWXO.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-s0Orgord.js → AgentsMdExternalIncludesDialog-LjI_H_Au.js} +1 -1
- package/dist/chunks/App-BOqh_1tN.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CSEuuoq9.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-D2Gesf-u.js → BypassPermissionsModeDialog-CwfCwUr9.js} +1 -1
- package/dist/chunks/CustomSelect-wmZ9jz0W.js +1 -0
- package/dist/chunks/{DiffDialog-v2IiYyi3.js → DiffDialog-BpXIEWiE.js} +5 -5
- package/dist/chunks/Doctor-CMpr7tdf.js +1 -0
- package/dist/chunks/Doctor-DqW6j3_B.js +3 -0
- package/dist/chunks/{ExitFlow-BasHk1mk.js → ExitFlow-DacaBTlk.js} +2 -2
- package/dist/chunks/Grove-CNqYPWI6.js +11 -0
- package/dist/chunks/{InvalidConfigDialog-DYVQK5js.js → InvalidConfigDialog-0TMJItCC.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-Dg6OiStR.js → InvalidSettingsDialog-iwh8H52b.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-Bn1jzN5F.js → KeybindingProviderSetup-D49HHTXD.js} +1 -1
- package/dist/chunks/MCPConnectionManager-Cie77ZAK.js +1 -0
- package/dist/chunks/MCPToolListView-B4ehtkXd.js +1 -0
- package/dist/chunks/{McpParsingWarnings-DZejAh8b.js → McpParsingWarnings-Bff66RtJ.js} +1 -1
- package/dist/chunks/MessageSelector-Dpd6Iywp.js +3 -0
- package/dist/chunks/Messages-DN7M3oS_.js +10 -0
- package/dist/chunks/Onboarding-CQmE3rUf.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-lkr_A5jQ.js → PromptInputFooterSuggestions-HI6HH3TP.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DaQKKyM5.js → PromptInputHelpMenu-3QNUC2Cg.js} +1 -1
- package/dist/chunks/ProviderSetup-BCSPsvfv.js +1 -0
- package/dist/chunks/QueryEngine-DdLWvJv6.js +1 -0
- package/dist/chunks/REPL-BqO9KcK_.js +124 -0
- package/dist/chunks/REPL-CmZmypfF.js +1 -0
- package/dist/chunks/ResumeConversation-DBqX7gva.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +1 -0
- package/dist/chunks/{SelectMulti-CNE06VAN.js → SelectMulti-BQRHed-d.js} +1 -1
- package/dist/chunks/Settings-B-7yBewS.js +3 -0
- package/dist/chunks/Spinner-ByQXTvAA.js +1 -0
- package/dist/chunks/{SpinnerGlyph-A6G-gloN.js → SpinnerGlyph-CmkRUvHe.js} +1 -1
- package/dist/chunks/{TextInput-7uqPhq9T.js → TextInput-B8ruWRf2.js} +5 -5
- package/dist/chunks/{ThemePicker-DT9zVy-0.js → ThemePicker-BQErFFW1.js} +1 -1
- package/dist/chunks/TrustDialog-BIhz6AZE.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BLtP647v.js → ValidationErrorsList-DgNzJQUP.js} +1 -1
- package/dist/chunks/_baseEach-CsIRoaTH.js +1 -0
- package/dist/chunks/add-dir-CrUDs19x.js +1 -0
- package/dist/chunks/{agentDisplay-vLQHFrmq.js → agentDisplay-M4pfwbMC.js} +1 -1
- package/dist/chunks/agents-CGaCQeLw.js +101 -0
- package/dist/chunks/{agents-DLz0kfsr.js → agents-DddX7lLX.js} +1 -1
- package/dist/chunks/allErrors-BF73lon8.js +1 -0
- package/dist/chunks/{appleTerminalBackup-BYKdf3of.js → appleTerminalBackup-BArZWB21.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-Bq3LMsVR.js +17 -0
- package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +1 -0
- package/dist/chunks/banner-Cu2-XUek.js +2 -0
- package/dist/chunks/{bedrockClient-DxE_mHFI.js → bedrockClient-CfiDN-kF.js} +2 -2
- package/dist/chunks/branch-Yg_taNlT.js +2 -0
- package/dist/chunks/{break-cache-BL2gnDLX.js → break-cache-BMXqFTeS.js} +2 -2
- package/dist/chunks/btw-udbprVvu.js +1 -0
- package/dist/chunks/caches-ChjIEcdd.js +1 -0
- package/dist/chunks/caches-DLJ6urv-.js +1 -0
- package/dist/chunks/{claudeDesktop-D3PEgx3U.js → claudeDesktop-D8ml2767.js} +1 -1
- package/dist/chunks/{clear-CXfhVRp8.js → clear-B8ZtFPOK.js} +1 -1
- package/dist/chunks/{client-DdenNfkQ.js → client-4iqhC8xq.js} +1 -1
- package/dist/chunks/client-BiqbIkwr.js +1 -0
- package/dist/chunks/client-CZ8nyVh5.js +1 -0
- package/dist/chunks/{client-DvhWKIOx.js → client-CpTCeWba.js} +1 -1
- package/dist/chunks/commands-CVCpJo7M.js +1 -0
- package/dist/chunks/compact-izk6RKHQ.js +2 -0
- package/dist/chunks/config-C-Y2qtB2.js +3 -0
- package/dist/chunks/config-CFqpXMFX.js +1 -0
- package/dist/chunks/config-DD8fCYXn.js +1 -0
- package/dist/chunks/{context-3s9wtn4L.js → context-BbVm4SWK.js} +1 -1
- package/dist/chunks/{context-noninteractive-CJhUu_4y.js → context-noninteractive-C7wrRZnM.js} +5 -5
- package/dist/chunks/context-noninteractive-x0HAzWhc.js +1 -0
- package/dist/chunks/conversation-DouVzO0K.js +1 -0
- package/dist/chunks/conversation-DrVkifKy.js +1 -0
- package/dist/chunks/conversationRecovery-DliPBo_z.js +1 -0
- package/dist/chunks/crossProjectResume-DxMy05_P.js +40 -0
- package/dist/chunks/cwd-Dc3NV7s8.js +1 -0
- package/dist/chunks/cwd-Pa83R95t.js +1 -0
- package/dist/chunks/{datadog-v_mXWncN.js → datadog-Cu3s7P48.js} +1 -1
- package/dist/chunks/{debug-8DCufdSp.js → debug-Bglx1aTu.js} +5 -5
- package/dist/chunks/{detectRepository-DfX8xXw2.js → detectRepository-CfX8Lc0A.js} +1 -1
- package/dist/chunks/{diff-DJSt7QO6.js → diff-DdpHThJ7.js} +1 -1
- package/dist/chunks/{directoryCompletion-CT6YVeg7.js → directoryCompletion-D_Rtg-4j.js} +1 -1
- package/dist/chunks/dist-es-B3-7VFf2.js +1 -0
- package/dist/chunks/dist-es-B7j_mv242.js +1 -0
- package/dist/chunks/dist-es-BSKD_hOQ.js +1 -0
- package/dist/chunks/dist-es-BSRN-2nA.js +9 -0
- package/dist/chunks/{dist-es-yHGBqhBe.js → dist-es-BXXmyhQ2.js} +1 -1
- package/dist/chunks/{dist-es-C3reqy7X.js → dist-es-BaQndfvh2.js} +1 -1
- package/dist/chunks/dist-es-CzTYn7xo.js +1 -0
- package/dist/chunks/dist-es-DSkyibcN.js +1 -0
- package/dist/chunks/{dist-es-BOPBJQo3.js → dist-es-_UNJQniz.js} +1 -1
- package/dist/chunks/dist-es-hwK6468D.js +1 -0
- package/dist/chunks/dist-es-ovsdbtwh.js +1 -0
- package/dist/chunks/doctor-D_kV_D_l.js +1 -0
- package/dist/chunks/{entry-ex0-RyYV.js → entry-Bxseqbi_.js} +4 -4
- package/dist/chunks/{envUtils-DcaKZlRU.js → envUtils-DfkgIdYf.js} +1 -1
- package/dist/chunks/esm-BXTZz3av.js +1 -0
- package/dist/chunks/{execFileNoThrow-BsfuytkN.js → execFileNoThrow-BTachNBI.js} +1 -1
- package/dist/chunks/exit-C_R_FgzR.js +1 -0
- package/dist/chunks/extraUsage-xMuDiNKh.js +1 -0
- package/dist/chunks/extractMemories-D4Dl1itt.js +1 -0
- package/dist/chunks/fast-DH-C5IZs.js +1 -0
- package/dist/chunks/fast-bopOPrtf.js +1 -0
- package/dist/chunks/fetchModelList-DC4VQpqa.js +1 -0
- package/dist/chunks/fetchModelList-FE8tzTDc.js +1 -0
- package/dist/chunks/{fileSuggestions-B-SLfb-o.js → fileSuggestions-C-9unnoJ.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-QmjjQmgt.js +3 -0
- package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +1 -0
- package/dist/chunks/{gemini-BC9kHhwe.js → gemini-C_ApXgwc.js} +2 -2
- package/dist/chunks/generateSessionName-CQ03xlYI.js +1 -0
- package/dist/chunks/{genericProcessUtils-BYi0OefF.js → genericProcessUtils-DwQFuna9.js} +1 -1
- package/dist/chunks/goal-CdL29Y8C.js +3 -0
- package/dist/chunks/grok-C6WAslUT.js +1 -0
- package/dist/chunks/grove-O6qp7ITR.js +1 -0
- package/dist/chunks/{help-CK90i4hE.js → help-DxanITNN.js} +1 -1
- package/dist/chunks/history-BMycjPTT.js +1 -0
- package/dist/chunks/hooks-D9ApLkBp.js +1 -0
- package/dist/chunks/{hooks-BRFDg9DV.js → hooks-DR3IYPJ3.js} +3 -3
- package/dist/chunks/{install-ZMll-dAa.js → install-0D9u2dZw.js} +1 -1
- package/dist/chunks/instrumentation-BFiGwntt.js +21 -0
- package/dist/chunks/{job-G_ukhLc4.js → job-YhJQWgE0.js} +1 -1
- package/dist/chunks/keybindings-DZrF9iNd.js +1 -0
- package/dist/chunks/{launchLocalMemory-BcRlXLm6.js → launchLocalMemory-DhJ56KDc.js} +2 -2
- package/dist/chunks/launchOnboarding-DmMoZwv5.js +8 -0
- package/dist/chunks/{loadAgentsDir-C1LkW7gl.js → loadAgentsDir-B0Anodo0.js} +540 -543
- package/dist/chunks/loadAgentsDir-BbUR6pqH.js +1 -0
- package/dist/chunks/loadPluginHooks-BSwCtQ6T.js +1 -0
- package/dist/chunks/{loader-C61fB6vU.js → loader-CICGtLp2.js} +1 -1
- package/dist/chunks/{localSearch-DFo_WTMm.js → localSearch-BxLYi6w_.js} +1 -1
- package/dist/chunks/localSearch-zfn7jgrh.js +1 -0
- package/dist/chunks/{log-DaILwWJa.js → log-D2TIwHBV.js} +1 -1
- package/dist/chunks/logoUtils-CRxTutvr.js +1 -0
- package/dist/chunks/{magicDocs-DYc9TFmI.js → magicDocs-Bkz7ZcmL.js} +3 -3
- package/dist/chunks/main-9ksgUUY_.js +345 -0
- package/dist/chunks/managedEnv-BEqrGqn1.js +1 -0
- package/dist/chunks/managedEnv-OPlzUPbJ.js +1 -0
- package/dist/chunks/mcp-ChF12reQ.js +1 -0
- package/dist/chunks/mcp-DoEl5uah.js +2 -0
- package/dist/chunks/mcp-hp9qqjAy.js +6 -0
- package/dist/chunks/memory-Qv-wGNQ5.js +1 -0
- package/dist/chunks/{mode-Pan-Q2c4.js → mode-bFXPCR2P.js} +2 -2
- package/dist/chunks/model-6lkW4o2c.js +1 -0
- package/dist/chunks/model-BvQFFOf8.js +1 -0
- package/dist/chunks/modelOptions-BBvF3wHK.js +1 -0
- package/dist/chunks/nativeInstaller-CdjmE9Zy.js +1 -0
- package/dist/chunks/notifications-Bc6k-Ozy.js +1 -0
- package/dist/chunks/onChangeAppState-DLjZ1x95.js +1 -0
- package/dist/chunks/openai-D46QvESE.js +2 -0
- package/dist/chunks/{overlayContext-CMV7nYR9.js → overlayContext-8--_fbvY.js} +1 -1
- package/dist/chunks/{panel-D9fGQgln.js → panel-CVS4SK_E.js} +1 -1
- package/dist/chunks/parser-CG5RuOCK.js +1 -0
- package/dist/chunks/{parser-D8slvrJP.js → parser-Cg6hSCmn.js} +1 -1
- package/dist/chunks/partition-DznN4XZH.js +1 -0
- package/dist/chunks/{pasteStore-DNV1M5Xd.js → pasteStore-P0zP-ch0.js} +1 -1
- package/dist/chunks/permissions-DmGFViHI.js +3 -0
- package/dist/chunks/pidLock-Cm4sW35f.js +3 -0
- package/dist/chunks/{plan-CQLnPLuE.js → plan-CzGBz_87.js} +1 -1
- package/dist/chunks/{platform-Dzff1WWw.js → platform-BacQ6ACS.js} +1 -1
- package/dist/chunks/plugin-CluR79xX.js +17 -0
- package/dist/chunks/{pluginAutoupdate-BJaAqwTH.js → pluginAutoupdate-ennb9k8_.js} +1 -1
- package/dist/chunks/pluginBlocklist-9OrNEh--.js +1 -0
- package/dist/chunks/pluginCliCommands-CJv5uhOG.js +1 -0
- package/dist/chunks/{pluginFlagging-DQP8tBi2.js → pluginFlagging-js_-WmYj.js} +1 -1
- package/dist/chunks/pluginOperations-CcUSHAIa.js +2 -0
- package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +1 -0
- package/dist/chunks/{pluginStartupCheck-CfRvCrFg.js → pluginStartupCheck-SRXOyqr7.js} +1 -1
- package/dist/chunks/plugins-IwwaCDba.js +4 -0
- package/dist/chunks/{poorMode-J5SYJvoY.js → poorMode-B0QGV6Ci.js} +1 -1
- package/dist/chunks/poorMode-G-pnu6NM.js +1 -0
- package/dist/chunks/print-CgszM1ea.js +13 -0
- package/dist/chunks/processBashCommand-D098WsqY.js +1 -0
- package/dist/chunks/processSlashCommand-DOQFjJ88.js +5 -0
- package/dist/chunks/{projectContext-Bw3o5BrN.js → projectContext-5fmRr6Sd.js} +1 -1
- package/dist/chunks/{projectContext-BN2ZWzOG.js → projectContext-DhtjLv3k.js} +1 -1
- package/dist/chunks/{projectOnboardingState-CJycxw5P.js → projectOnboardingState-B5YATuc6.js} +1 -1
- package/dist/chunks/prompt-BKPmDAuL.js +1 -0
- package/dist/chunks/{prompt-BGqgPgCU.js → prompt-CJ1l3XXk.js} +1 -1
- package/dist/chunks/prompt-CgOklk7z.js +1 -0
- package/dist/chunks/{promptEditor-CmQ9p4oe.js → promptEditor-DoGHJN_W.js} +1 -1
- package/dist/chunks/{protocolHandler-CJo9-PfZ.js → protocolHandler-DjQALaU2.js} +1 -1
- package/dist/chunks/{proxy-CB17QimU.js → proxy-CDBfZjO7.js} +2 -2
- package/dist/chunks/reconciler-ykkSPR-i.js +1 -0
- package/dist/chunks/refresh-Dn_I1R4v.js +1 -0
- package/dist/chunks/{registerProtocol-CLIpzVwF.js → registerProtocol-CAsDme_E.js} +1 -1
- package/dist/chunks/reject-DtcCfuZV.js +1 -0
- package/dist/chunks/{reload-plugins-DjugL8jH.js → reload-plugins-CQZFQLWP.js} +1 -1
- package/dist/chunks/rename-DyEfsZiq.js +1 -0
- package/dist/chunks/{renderOptions-Zqfm2U1y.js → renderOptions-DV0dn0IW.js} +1 -1
- package/dist/chunks/resume-BcXEDUqZ.js +2 -0
- package/dist/chunks/ripgrep-DLs8MraF.js +1 -0
- package/dist/chunks/{ripgrep-BuzOTf1S.js → ripgrep-Dl3y5r4m.js} +1 -1
- package/dist/chunks/{runtimeObserver-CK_iZ6OB.js → runtimeObserver-DEuR8z0f.js} +1 -1
- package/dist/chunks/{runtimeObserver-CpP0L9T9.js → runtimeObserver-PJ1o8GRA.js} +4 -4
- package/dist/chunks/sandbox-adapter-DfB9kgQD.js +1 -0
- package/dist/chunks/{sandbox-toggle-KOHYvbQT.js → sandbox-toggle-D9GDUsTl.js} +1 -1
- package/dist/chunks/searchExtraTools-D4gMMQv0.js +1 -0
- package/dist/chunks/{select-C_KXmqbI.js → select-DIxfl_VN.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +1 -0
- package/dist/chunks/{sessionObserver-WOYv2n7C.js → sessionObserver-BtKjvteq.js} +2 -2
- package/dist/chunks/sessionObserver-D6qzEdGJ.js +1 -0
- package/dist/chunks/sessionStorage-C_7gow_z.js +1 -0
- package/dist/chunks/sessionTracing-CtbeAD0s.js +11 -0
- package/dist/chunks/settings-B2jvL8Dp.js +24 -0
- package/dist/chunks/settings-CisDe8DB.js +1 -0
- package/dist/chunks/setup-qecdf-ES.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-Df-kZ_pK.js → shadowedRuleDetection-Bg_aIc5Z.js} +1 -1
- package/dist/chunks/{sideQuestion-CMB8hfgX.js → sideQuestion-D49GsfH7.js} +3 -3
- package/dist/chunks/sinks-C-lP7uyO.js +1 -0
- package/dist/chunks/sinks-De-B1lPQ.js +1 -0
- package/dist/chunks/skillChangeDetector-DkOJoNhT.js +1 -0
- package/dist/chunks/{skillGapStore-CfmlO6pb.js → skillGapStore-CcFoHNLl.js} +2 -2
- package/dist/chunks/{skillLifecycle-BQ2LMfMx.js → skillLifecycle-Bnz_4wE5.js} +2 -2
- package/dist/chunks/{skillSearchPanel-BwYuwLFs.js → skillSearchPanel-C_5yUhqn.js} +2 -2
- package/dist/chunks/{skills-BVHPQma0.js → skills-BE5scC-g.js} +1 -1
- package/dist/chunks/startupProfiler-BH0FoI66.js +1 -0
- package/dist/chunks/{startupProfiler-DTs9w9EN.js → startupProfiler-CJdr3SxP.js} +2 -2
- package/dist/chunks/state-B4jiUise.js +1 -0
- package/dist/chunks/state-BhOKSFi5.js +1 -0
- package/dist/chunks/status-Dw09WZLd.js +1 -0
- package/dist/chunks/statusNoticeHelpers-BRQpUIlH.js +1 -0
- package/dist/chunks/{stringUtils-BQm3OfeJ.js → stringUtils-C718f5ey.js} +1 -1
- package/dist/chunks/sts-ei3CGBNu.js +1 -0
- package/dist/chunks/switcher-CgZVah7U.js +1 -0
- package/dist/chunks/{switcher-Bq1Ct_Sn.js → switcher-DZwUo5Ed.js} +1 -1
- package/dist/chunks/{tasks-0c8Uy04D.js → tasks-DdcUQEeD.js} +1 -1
- package/dist/chunks/{templateJobs-BdFzE9XG.js → templateJobs-C8qsPrLj.js} +1 -1
- package/dist/chunks/{terminalSetup-Cf_r6pwK.js → terminalSetup-B_10N_gE.js} +3 -3
- package/dist/chunks/{terminalSetup-D7J6bxcn.js → terminalSetup-qc2PlvOm.js} +1 -1
- package/dist/chunks/{theme-Bby4fssR.js → theme-f1h2QI8J.js} +1 -1
- package/dist/chunks/tipRegistry-B71o4qWr.js +2 -0
- package/dist/chunks/{toolEventObserver-CzFZUIsM.js → toolEventObserver-7QP38x4t.js} +1 -1
- package/dist/chunks/toolPool-V-7Yv0GA.js +1 -0
- package/dist/chunks/{types-zk5Ltv5q.js → types-Dx7P7JLQ.js} +2 -2
- package/dist/chunks/udsClient-cQz6nJ_T.js +1 -0
- package/dist/chunks/{use-select-navigation-DMaC_3iw.js → use-select-navigation-hWL5VHnL.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CjW3gUOt.js → useExitOnCtrlCDWithKeybindings-BKwzUpgb.js} +1 -1
- package/dist/chunks/useMainLoopModel-DxvV70Ru.js +1 -0
- package/dist/chunks/useManagePlugins-BXLXazrR.js +1 -0
- package/dist/chunks/useMergedTools-CCgnBJzO.js +1 -0
- package/dist/chunks/{useSearchInput-C2JuUW3g.js → useSearchInput-CzopttqC.js} +1 -1
- package/dist/chunks/useSettingsErrors-SFPWfxsA.js +1 -0
- package/dist/chunks/{util-Bq5l7FF5.js → util-Cbb3S6SX.js} +1 -1
- package/dist/chunks/validatePlugin-BMSoeb_b.js +1 -0
- package/dist/chunks/vim-CoRp9lY1.js +1 -0
- package/dist/chunks/worktree-Vm-SNY5x.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -5
- package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +0 -1
- package/dist/chunks/App-BcEI6U5j.js +0 -1
- package/dist/chunks/ApproveApiKey-DegdTXZl.js +0 -1
- package/dist/chunks/ApproveApiKey-_VXIMSwY.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +0 -2
- package/dist/chunks/CustomSelect-B46Eh0gU.js +0 -1
- package/dist/chunks/Doctor-BP0Rqraa.js +0 -1
- package/dist/chunks/Doctor-By_y3C2V.js +0 -3
- package/dist/chunks/Grove-C3mhgshv.js +0 -11
- package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +0 -1
- package/dist/chunks/MCPToolListView-DLSrQHDc.js +0 -1
- package/dist/chunks/MessageSelector-CdDlJE48.js +0 -3
- package/dist/chunks/Messages-DuL_r1Or.js +0 -10
- package/dist/chunks/Onboarding-CE2GNA-h.js +0 -1
- package/dist/chunks/QueryEngine-DNNy1UCD.js +0 -1
- package/dist/chunks/REPL-CEhW-C41.js +0 -1
- package/dist/chunks/REPL-CkSL4C_8.js +0 -124
- package/dist/chunks/ResumeConversation-BMCO_3X7.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +0 -1
- package/dist/chunks/Settings-mDykHLok.js +0 -2
- package/dist/chunks/Spinner-DwsJJUtn.js +0 -1
- package/dist/chunks/TrustDialog-G4jM9IfM.js +0 -1
- package/dist/chunks/add-dir-7RfQAC3h.js +0 -1
- package/dist/chunks/agents-BNg_skSm.js +0 -101
- package/dist/chunks/allErrors-DaztSMrw.js +0 -1
- package/dist/chunks/auth-BTB00dq5.js +0 -10
- package/dist/chunks/auth-Bbc0Ny8i.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +0 -1
- package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +0 -17
- package/dist/chunks/banner-mqZEluky.js +0 -2
- package/dist/chunks/branch-exFKkymg.js +0 -2
- package/dist/chunks/btw-3l78DYET.js +0 -1
- package/dist/chunks/caches-6Nx6tsk9.js +0 -1
- package/dist/chunks/caches-ouaWB9bY.js +0 -1
- package/dist/chunks/client-C01Bnxxv.js +0 -1
- package/dist/chunks/client-DYRgRQsr.js +0 -1
- package/dist/chunks/commands-BoxOw75F.js +0 -1
- package/dist/chunks/compact-BOYr105K.js +0 -2
- package/dist/chunks/config-BddEvZZl.js +0 -3
- package/dist/chunks/config-GEv9hUzz.js +0 -1
- package/dist/chunks/config-kw4xg7Nk.js +0 -1
- package/dist/chunks/context-noninteractive-DFvoZ2L9.js +0 -1
- package/dist/chunks/conversation-CoGharlH.js +0 -1
- package/dist/chunks/conversation-MxEVm54C.js +0 -1
- package/dist/chunks/conversationRecovery-Da_8uldZ.js +0 -1
- package/dist/chunks/crossProjectResume-CzPCHq_K.js +0 -40
- package/dist/chunks/cwd-BcO6WHKo.js +0 -1
- package/dist/chunks/cwd-CDUelriw.js +0 -1
- package/dist/chunks/dist-es-5t7v8oaj.js +0 -1
- package/dist/chunks/dist-es-BIjDeceU.js +0 -1
- package/dist/chunks/dist-es-C-OjW2Ao.js +0 -1
- package/dist/chunks/dist-es-CEk66gUu.js +0 -1
- package/dist/chunks/dist-es-CIULjvtA2.js +0 -1
- package/dist/chunks/dist-es-CMtO44xC.js +0 -1
- package/dist/chunks/dist-es-CYPVg66r.js +0 -9
- package/dist/chunks/dist-es-D1Y8zSMI.js +0 -1
- package/dist/chunks/dist-es-Gt_DpXlP.js +0 -1
- package/dist/chunks/dist-es-kj-F5A132.js +0 -1
- package/dist/chunks/doctor-DWvioSU9.js +0 -1
- package/dist/chunks/esm-BQY8jJNR.js +0 -1
- package/dist/chunks/exit-BxC_ZEtO.js +0 -1
- package/dist/chunks/extraUsage-DYm33Occ.js +0 -1
- package/dist/chunks/extractMemories-CzN3Ax2B.js +0 -1
- package/dist/chunks/fast-DqUpl_Lr.js +0 -1
- package/dist/chunks/fast-NUdUyAaM.js +0 -1
- package/dist/chunks/fetchModelList-CqsTAWEN.js +0 -1
- package/dist/chunks/fetchModelList-DBMHE6Ng.js +0 -1
- package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +0 -3
- package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +0 -1
- package/dist/chunks/generateSessionName-ChvKBVxB.js +0 -1
- package/dist/chunks/goal-ByyimpVU.js +0 -3
- package/dist/chunks/grok-DenjixMl.js +0 -1
- package/dist/chunks/grove-Dq8QbQ9o.js +0 -7
- package/dist/chunks/history-CNQNd6hT.js +0 -1
- package/dist/chunks/hooks-BaYwmkxD.js +0 -1
- package/dist/chunks/instrumentation-BwVyvRfY.js +0 -21
- package/dist/chunks/keybindings-wNxBzDVQ.js +0 -1
- package/dist/chunks/launchOnboarding-CDjQ64RO.js +0 -8
- package/dist/chunks/loadAgentsDir-DKXap_Om.js +0 -1
- package/dist/chunks/loadPluginHooks-DtmHtEiS.js +0 -1
- package/dist/chunks/localSearch-BB9x5C2N.js +0 -1
- package/dist/chunks/logoUtils-Dj_2SWmO.js +0 -1
- package/dist/chunks/main-BRg8L_aw.js +0 -346
- package/dist/chunks/managedEnv-DsqAYOJ4.js +0 -1
- package/dist/chunks/managedEnv-lybrMred.js +0 -1
- package/dist/chunks/mcp-Bsw3cMiJ.js +0 -6
- package/dist/chunks/mcp-DDdud6Y7.js +0 -1
- package/dist/chunks/mcp-DbgTDUt7.js +0 -2
- package/dist/chunks/memory-CzwTzihf.js +0 -1
- package/dist/chunks/model-BYfmXKHf.js +0 -1
- package/dist/chunks/model-BwBE0Pt5.js +0 -1
- package/dist/chunks/modelOptions-DvNBapgG.js +0 -1
- package/dist/chunks/nativeInstaller-DnSNJWIi.js +0 -1
- package/dist/chunks/notifications-B0DTaYoy.js +0 -1
- package/dist/chunks/omit-Dl1Us_PY.js +0 -1
- package/dist/chunks/onChangeAppState-4KOJMN82.js +0 -1
- package/dist/chunks/openai-C_6C1_0N.js +0 -10
- package/dist/chunks/parser-BKAVMTyD.js +0 -1
- package/dist/chunks/partition-B504IgAa.js +0 -1
- package/dist/chunks/permissions-CLFMhdRk.js +0 -3
- package/dist/chunks/pidLock-D9do1Afy.js +0 -3
- package/dist/chunks/plugin-BYdF7uob.js +0 -17
- package/dist/chunks/pluginBlocklist-DKKmOnWM.js +0 -1
- package/dist/chunks/pluginCliCommands-z8TtJMKH.js +0 -1
- package/dist/chunks/pluginOperations-BcfJCDco.js +0 -2
- package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +0 -1
- package/dist/chunks/plugins-CTM8jpOw.js +0 -4
- package/dist/chunks/policyLimits-a7ix6GnU.js +0 -1
- package/dist/chunks/poorMode-C11JEH3d.js +0 -1
- package/dist/chunks/print-u6MzL5Cr.js +0 -13
- package/dist/chunks/processBashCommand-DIwrI2QC.js +0 -1
- package/dist/chunks/processSlashCommand-B-Gujpxm.js +0 -5
- package/dist/chunks/prompt-BPJDGlx5.js +0 -1
- package/dist/chunks/prompt-DEdZzkEz.js +0 -1
- package/dist/chunks/reconciler-DSKLuOS7.js +0 -1
- package/dist/chunks/refresh-BbZFCNpn.js +0 -1
- package/dist/chunks/rename-DOtCOtEr.js +0 -1
- package/dist/chunks/resume-BB4T4WIV.js +0 -2
- package/dist/chunks/ripgrep-CZ2CqaHb.js +0 -1
- package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +0 -1
- package/dist/chunks/searchExtraTools-CdJghGkj.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +0 -1
- package/dist/chunks/sessionObserver-DB-sLv-X.js +0 -1
- package/dist/chunks/sessionStorage-sgOAbDn7.js +0 -1
- package/dist/chunks/sessionTracing-yBre24PH.js +0 -11
- package/dist/chunks/settings-C-KNkvsM.js +0 -1
- package/dist/chunks/settings-DKN4xSpQ.js +0 -24
- package/dist/chunks/setup-CN_Pk7AR.js +0 -3
- package/dist/chunks/sinks-BS17vtN0.js +0 -1
- package/dist/chunks/sinks-D1EjkHb4.js +0 -1
- package/dist/chunks/skillChangeDetector-CBKuGuEi.js +0 -1
- package/dist/chunks/startupProfiler-B_U4QDtf.js +0 -1
- package/dist/chunks/state-BowF111d.js +0 -1
- package/dist/chunks/state-CGuyDES7.js +0 -1
- package/dist/chunks/status-BurdTfyz.js +0 -2
- package/dist/chunks/status-DMq1An5h.js +0 -1
- package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +0 -1
- package/dist/chunks/sts-C2Gf2WYN.js +0 -1
- package/dist/chunks/switcher-DGD4ORVf.js +0 -1
- package/dist/chunks/tipRegistry-CyRXWWTz.js +0 -2
- package/dist/chunks/toolPool-CnrZcprA.js +0 -1
- package/dist/chunks/udsClient-ftP0yIpe.js +0 -1
- package/dist/chunks/useMainLoopModel-DWscpA9I.js +0 -1
- package/dist/chunks/useManagePlugins-CYXVcql2.js +0 -1
- package/dist/chunks/useMergedTools-DarmnCEw.js +0 -1
- package/dist/chunks/useSettingsErrors-DutJBiKZ.js +0 -1
- package/dist/chunks/validatePlugin-DIdEydz_.js +0 -1
- package/dist/chunks/vim-D8prM2IH.js +0 -1
- package/dist/chunks/worktree-Caqt2WRZ.js +0 -1
- /package/dist/chunks/{dist-es-Cgsa8pb82.js → dist-es-Cgsa8pb8.js} +0 -0
- /package/dist/chunks/{dist-es-Cwru7c2B2.js → dist-es-Cwru7c2B.js} +0 -0
- /package/dist/chunks/{dist-es-DXIR5NLi2.js → dist-es-DXIR5NLi.js} +0 -0
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./memoize-BK3gG5ob.js";import{a as o,d as s,f as c,l,o as u,s as d,u as f}from"./envUtils-DcaKZlRU.js";import{n as p,t as m}from"./defineProperty-C-QyHrDq.js";import{dt as ee,ft as te,mt as h,pt as ne}from"./esm-BQY8jJNR.js";import{n as re,t as ie}from"./axios-DaWTGg7G.js";import{$C as g,$f as ae,$v as oe,Av as _,Aw as v,BC as se,Bf as ce,Bn as le,Bv as ue,Bw as de,C_ as fe,Cc as pe,Ch as me,Ct as he,Dd as ge,Dp as _e,Ds as ve,Dv as ye,Et as be,Ev as y,Fh as b,Fv as xe,GC as Se,Gf as Ce,Gm as we,Gs as Te,Gw as Ee,HS as De,Hi as Oe,Hl as x,Ic as ke,Ja as S,Jf as C,Js as Ae,Jw as je,KC as w,Kf as Me,Kg as Ne,Ks as Pe,Kw as Fe,La as T,Lc as Ie,Lv as Le,M as Re,Mo as ze,Mv as Be,Na as Ve,Nn as He,Nv as Ue,Od as We,Os as Ge,Ov as E,Ph as Ke,Pi as qe,Pn as D,Po as Je,Ps as Ye,Pv as Xe,Qv as O,Qx as Ze,Ru as Qe,Rv as $e,Rw as et,S as tt,Sc as nt,Sh as rt,Si as it,St as at,Sv as ot,T as st,T_ as ct,Tp as lt,Tv as ut,Tw as dt,UC as ft,Ug as pt,Um as mt,Uw as ht,Ux as gt,VC as k,Vi as A,Vm as _t,Vu as vt,Vv as yt,WC as bt,Wl as xt,Wm as St,Ww as j,X_ as Ct,Xa as M,Xs as wt,Xx as Tt,YC as Et,Ya as Dt,Yv as Ot,Yw as kt,Za as At,Zi as jt,Zv as N,_i as Mt,_y as Nt,ad as Pt,aw as Ft,ay as It,b as Lt,bi as Rt,bt as zt,bv as Bt,ci as Vt,cy as Ht,dr as Ut,dw as Wt,dy as Gt,ei as Kt,ew as qt,ey as Jt,f as Yt,fg as P,fs as Xt,gi as F,hy as Zt,i as Qt,id as $t,iv as en,iw as tn,ji as nn,js as rn,jv as I,k as an,ki as on,kn as sn,ks as cn,kv as ln,lg as un,li as dn,nc as fn,nt as pn,nu as mn,nv as hn,ny as gn,o as _n,oy as vn,qv as yn,qx as bn,r as xn,ru as Sn,rv as Cn,s as wn,sr as Tn,sy as En,tc as Dn,tp as On,tt as kn,tu as An,ty as jn,us as Mn,uw as Nn,uy as Pn,vi as Fn,vr as In,wh as Ln,wv as Rn,x as zn,x_ as Bn,xi as Vn,y_ as Hn,zC as Un,zS as Wn,za as Gn,zf as Kn,zv as qn}from"./loadAgentsDir-C1LkW7gl.js";import{B as Jn,D as Yn,I as Xn,Lt as Zn,P as Qn,R as $n,T as er,ai as tr,di as L,fi as nr,rr,t as ir,xr as ar,y as or}from"./src-DL3w8VPk.js";import{t as sr}from"./jsx-runtime-Bb4Xn-E0.js";import{$ as cr,A as lr,G as ur,P as dr,Q as fr,Y as pr,Z as R,f as mr,j as hr,l as gr,o as _r,s as vr,x as yr}from"./types-zk5Ltv5q.js";import{Bn as br,En as xr,G as Sr,Hn as Cr,L as wr,N as Tr,Qt as Er,Rn as Dr,Tn as Or,Un as kr,Vn as Ar,Wn as jr,Z as Mr,ar as Nr,ct as Pr,en as Fr,hn as Ir,ln as Lr,lt as Rr,mn as zr,or as Br,pn as Vr,rn as Hr,wn as Ur,zt as Wr}from"./state-BowF111d.js";import{n as Gr,t as Kr}from"./cwd-BcO6WHKo.js";import{C as qr,L as Jr,N as Yr,O as Xr,P as Zr,S as Qr,T as $r,c as z,et as ei,f as ti,g as ni,i as ri,l as ii,tt as ai,u as oi,x as si,z as ci}from"./debug-8DCufdSp.js";import{$t as li,D as ui,O as di,Rr as fi,Ur as pi,Vr as mi,Z as hi,_n as gi,b as B,d as _i,en as vi,h as V,hn as yi,jr as bi,jt as xi,kr as Si,l as Ci,m as wi,ni as H,q as Ti,r as Ei,s as Di,t as Oi,ti as ki,tn as Ai,w as ji,x as Mi,zt as Ni}from"./settings-DKN4xSpQ.js";import{C as Pi,N as Fi,O as Ii,_ as Li,c as U,g as Ri,h as zi,j as Bi,m as W,n as Vi,o as Hi,r as Ui,s as Wi,v as G,w as Gi}from"./config-BddEvZZl.js";import{a as Ki,n as qi,r as Ji}from"./process-gEbdy6uY.js";import{a as Yi,s as Xi}from"./execFileNoThrow-BsfuytkN.js";import{d as Zi,f as Qi,o as $i,s as K}from"./log-DaILwWJa.js";import{_ as ea,h as ta,l as na,m as ra,o as ia,v as aa}from"./stringUtils-BQm3OfeJ.js";import{i as oa,o as sa}from"./platform-Dzff1WWw.js";import{n as q,r as J}from"./analytics-DJobLaWP.js";import{i as ca,n as la,r as Y}from"./startupProfiler-DTs9w9EN.js";import{$ as ua,$n as da,At as fa,B as pa,Dn as ma,En as ha,Er as ga,Gn as _a,Gt as va,K as ya,Lt as ba,Nt as xa,On as Sa,Ot as Ca,Pt as wa,Q as Ta,St as Ea,U as Da,Ut as Oa,Wn as ka,Wt as Aa,Zt as ja,_ as Ma,d as Na,dn as Pa,dr as Fa,f as Ia,gn as La,h as Ra,kn as za,kt as Ba,lr as Va,nr as Ha,p as Ua,pt as Wa,r as Ga,st as Ka,tn as qa,v as Ja,vn as Ya,wr as Xa,xt as Za,yn as Qa,yt as $a}from"./model-BwBE0Pt5.js";import{Ft as eo,Kt as to,Nt as no,Pt as ro,at as io,it as ao,kt as oo,ot as so,qt as co}from"./prompt-BGqgPgCU.js";import{c as lo,d as uo,m as fo,n as po}from"./proxy-CB17QimU.js";import{n as mo,t as ho}from"./partition-B504IgAa.js";import{a as go,n as _o}from"./ripgrep-BuzOTf1S.js";import{a as vo}from"./loader-C61fB6vU.js";import{D as yo,O as bo}from"./sessionTracing-yBre24PH.js";import{n as xo,t as So}from"./worktreeModeEnabled-BFOYTTTr.js";import{d as Co,f as wo,l as To,p as Eo,u as Do}from"./firstPartyEventLogger-C0q45h_4.js";import{a as Oo}from"./grove-Dq8QbQ9o.js";import{a as ko,i as Ao,n as jo,o as Mo}from"./policyLimits-a7ix6GnU.js";import{n as No,t as Po}from"./allErrors-DaztSMrw.js";import{s as Fo,t as Io}from"./history-CNQNd6hT.js";import{n as Lo,t as Ro}from"./SelectMulti-CNE06VAN.js";import{t as zo}from"./KeybindingProviderSetup-Bn1jzN5F.js";import{n as X,t as Z}from"./exit-s9XGerrH.js";import{n as Bo,s as Vo,t as Ho}from"./pluginOperations-BcfJCDco.js";import"./pluginCliCommands-z8TtJMKH.js";import{n as Uo}from"./conversationRecovery-Da_8uldZ.js";import{t as Wo}from"./select-C_KXmqbI.js";import{i as Go,t as Ko}from"./skillChangeDetector-CBKuGuEi.js";import{n as qo,t as Jo}from"./tempfile-CHO5wXsV.js";import{n as Yo,r as Xo}from"./detectRepository-DfX8xXw2.js";import{t as Zo}from"./CustomSelect-B46Eh0gU.js";import{r as Qo,t as $o}from"./onChangeAppState-4KOJMN82.js";import{n as es,r as ts,t as ns}from"./managedEnv-lybrMred.js";import{t as rs}from"./renderOptions-Zqfm2U1y.js";import{i as is,n as as}from"./earlyInput-IghoCjG5.js";import{a as os,t as ss}from"./banner-mqZEluky.js";import{i as cs,o as ls,t as us}from"./tipRegistry-CyRXWWTz.js";import{posix as ds,resolve as fs,win32 as ps}from"path";import{appendFileSync as ms,readFileSync as hs}from"fs";var gs=r((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})),_s=r((e=>{var{InvalidArgumentError:t}=gs(),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})),vs=r((e=>{var{humanReadableArgName:t}=_s(),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})),ys=r((e=>{var{InvalidArgumentError:t}=gs(),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})),bs=r((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})),xs=r((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}=_s(),{CommanderError:l}=gs(),{Help:u,stripColor:d}=vs(),{Option:f,DualOptions:p}=ys(),{suggestSimilar:m}=bs(),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:()=>h()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>h()??(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=te(o.execArgv).concat(t),f=r.spawn(o.execPath,t,{stdio:`inherit`})):n?(t.unshift(u),t=te(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 te(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 h(){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=h})),Ss=r((e=>{var{Argument:t}=_s(),{Command:n}=xs(),{CommanderError:r,InvalidArgumentError:i}=gs(),{Help:a}=vs(),{Option:o}=ys();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})),Cs=r(((e,t)=>{var n=Ss();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)}));a(),u(),p(),Nr(),Wr(),ei(),Jr(),si(),ti(),qi(),ri(),q(),la(),ui(),Aa();var{program:ws,createCommand:Ts,createArgument:Es,createOption:Ds,CommanderError:Os,InvalidArgumentError:ks,InvalidOptionArgumentError:As,Command:js,Argument:Ms,Option:Q,Help:Ns}=n(Cs(),1).default;ie(),nr();var Ps=n(tr(),1),$=sr();ir(),yr(),Gr(),ki(),Xi(),$i(),ea(),pi(),sa(),Si(),gr(),yi(),_r(),ia(),ji(),V(),Bi(),ga(),Pi(),W(),Fa(),da(),ka(),Sa(),Ya(),La(),qa(),Ea(),Ia(),Nn(),tn(),fe(),Ln(),Ce(),ge(),Pe(),jt(),A(),qe(),it(),Fn(),In(),He(),Ai(),Zi();var Fs=!1;function Is(){if(Fs||(Fs=!0,Qi())||l(process.env.CLAUDE_CODE_USE_BEDROCK)||l(process.env.CLAUDE_CODE_USE_VERTEX)||l(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||vi().BASE_API_URL;fetch(e,{method:`HEAD`,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}function Ls(){if(process.env.NODE_EXTRA_CA_CERTS)return;let e=Rs();e&&(process.env.NODE_EXTRA_CA_CERTS=e,z(`CA certs: Applied NODE_EXTRA_CA_CERTS from config to process.env: ${e}`))}function Rs(){try{let e=U()?.env,t=Di(`userSettings`)?.env;z(`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&&z(`CA certs: Found NODE_EXTRA_CA_CERTS in config/settings: ${n}`),n}catch(e){z(`CA certs: Config fallback failed: ${e}`,{level:`error`});return}}W(),ri(),Xo(),te(),u(),ts(),fo(),lo(),bo(),Do();var zs=!1,Bs=i(async()=>{let e=Date.now();H(`info`,`init_started`),Y(`init_function_start`);try{let t=Date.now();Ui(),Jn({loadTheme:()=>U().theme,saveTheme:e=>G(t=>({...t,theme:e}))}),H(`info`,`init_configs_enabled`,{duration_ms:Date.now()-t}),Y(`init_configs_enabled`);let n=Date.now();es();try{let{restoreActiveProvider:e}=await import(`./switcher-DGD4ORVf.js`),t=await e();if(t?.warnings.length)for(let e of t.warnings)z(`[init] ${e}`)}catch(e){z(`[init] restoreActiveProvider failed: ${e instanceof Error?e.message:String(e)}`,{level:`warn`})}Ls(),H(`info`,`init_safe_env_vars_applied`,{duration_ms:Date.now()-n}),Y(`init_safe_env_vars_applied`),Rt(),Y(`init_after_graceful_shutdown`),import(`./firstPartyEventLogger-CP8hCBDj.js`).then(e=>{e.initialize1PEventLogging()}),Y(`init_after_1p_event_logging`),import(`./poller-CpLBoB-N.js`).then(e=>e.startBalancePolling()),Y(`init_after_balance_polling`),Ha(),Y(`init_after_oauth_populate`),ee(),Y(`init_after_jetbrains_detection`),Yo(),Ao()&&jo(),Y(`init_after_remote_settings_check`),Ri();let r=Date.now();z(`[init] configureGlobalMTLS starting`),uo(),H(`info`,`init_mtls_configured`,{duration_ms:Date.now()-r}),z(`[init] configureGlobalMTLS complete`);let i=Date.now();if(z(`[init] configureGlobalAgents starting`),po(),H(`info`,`init_proxy_configured`,{duration_ms:Date.now()-i}),z(`[init] configureGlobalAgents complete`),Y(`init_network_configured`),await To(),Is(),bi(),ai(C),D()){let e=Date.now();await sn(),H(`info`,`init_scratchpad_created`,{duration_ms:Date.now()-e})}try{let{getRipgrepStatus:e}=await import(`./ripgrep-CZ2CqaHb.js`),t=e();t.note&&process.stderr.write(`[ripgrep] ${t.note}\n`)}catch{z(`[init] ripgrep status check skipped`)}H(`info`,`init_completed`,{duration_ms:Date.now()-e}),Y(`init_function_end`)}catch(e){if(e instanceof Xr){if(wr()){process.stderr.write(`Configuration error in ${e.filePath}: ${e.message}\n`),Mt(1);return}return import(`./InvalidConfigDialog-DYVQK5js.js`).then(t=>t.showInvalidConfigDialog({error:e}))}else throw e}});function Vs(){Hs().catch(e=>{z(`[3P telemetry] Telemetry init failed: ${Yr(e)}`,{level:`error`})})}async function Hs(){if(!zs){if(!l(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)){zs=!0,z(`[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set`);return}zs=!0;try{await Us()}catch(e){throw zs=!1,e}}}async function Us(){let{initializeTelemetry:e}=await import(`./instrumentation-BwVyvRfY.js`),t=await e();t&&(xr(t,(e,n)=>{let r=t?.createCounter(e,n);return{add(e,t={}){let n={...yo(),...t};r?.add(e,n)}}}),Rr()?.add(1))}Fo();async function Ws(e,t,n,r){let{App:i}=await import(`./App-BcEI6U5j.js`),{REPL:a}=await import(`./REPL-CEhW-C41.js`);await r(e,(0,$.jsx)(i,{...t,children:(0,$.jsx)(a,{...n})}))}vo(),Ai(),W(),ri(),ha(),Zi(),h();var Gs=vr(()=>ur({client_data:pr(R(),cr()).nullish(),additional_model_options:dr(ur({model:R(),name:R(),description:R()}).transform(({model:e,name:t,description:n})=>({value:e,label:t,description:n}))).nullish()}));async function Ks(){if(Qi())return z(`[Bootstrap] Skipped: Nonessential traffic disabled`),null;if(Xa()!==`firstParty`)return z(`[Bootstrap] Skipped: 3P provider`),null;let e=Ka();if(!(Wa()?.accessToken&&Za())&&!e)return z(`[Bootstrap] Skipped: no usable OAuth or API key`),null;let t=`${vi().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await ma(async()=>{let n=Wa()?.accessToken,r;if(n&&Za())r={Authorization:`Bearer ${n}`,"anthropic-beta":li};else if(e)r={"x-api-key":e};else return z(`[Bootstrap] No auth available on retry, aborting`),null;z(`[Bootstrap] Fetching`);let i=await re.get(t,{headers:{"Content-Type":`application/json`,"User-Agent":ne(),...r},timeout:5e3}),a=Gs().safeParse(i.data);return a.success?(z(`[Bootstrap] Fetch ok`),a.data):(z(`[Bootstrap] Response failed validation: ${a.error.message}`),null)})}catch(e){throw z(`[Bootstrap] Fetch failed: ${re.isAxiosError(e)?e.response?.status??e.code:`unknown`}`),e}}async function qs(){try{let e=await Ks();if(!e)return;let t=e.client_data??null,n=e.additional_model_options??[],r=U();if(za(r.clientDataCache,t)&&za(r.additionalModelOptionsCache,n)){z(`[Bootstrap] Cache unchanged, skipping write`);return}z(`[Bootstrap] Cache updated, persisting to disk`),G(e=>({...e,clientDataCache:t,additionalModelOptionsCache:n}))}catch(e){K(e)}}ra(),Da(),g(),k(),io(),So(),pe(),ri(),u();var Js=new Map;function Ys(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;oa()===`windows`&&(e=e.split(ps.sep).join(ds.sep),t=t.split(ps.sep).join(ds.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 Xs=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function Zs(e){let t=`${e.name}: ${e.message}`;return Xs.some(e=>e.test(t))}var Qs=null;function $s(){let e=process.listeners(`warning`);Qs&&e.includes(Qs)||(Ys()||process.removeAllListeners(`warning`),Qs=e=>{try{let t=`${e.name}: ${e.message.slice(0,50)}`,n=Js.get(t)||0;(Js.has(t)||Js.size<1e3)&&Js.set(t,n+1);let r=Zs(e);J(`tengu_node_warning`,{is_internal:+!!r,occurrence_count:n+1,classname:e.name}),l(process.env.CLAUDE_DEBUG)&&z(`${r?`[Internal Warning]`:`[Warning]`} ${e.toString()}`,{level:`warn`})}catch{}},process.on(`warning`,Qs))}wo(),Lo(),Zo(),ir();function ec(){return(0,$.jsxs)(Qn,{children:[`MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the`,` `,(0,$.jsx)(Zn,{url:`https://code.workmate.com/docs/en/mcp`,children:`MCP documentation`}),`.`]})}q(),V(),ir();function tc({serverName:e,onDone:t}){function n(n){switch(J(`tengu_mcp_dialog_choice`,{choice:n}),n){case`yes`:case`yes_all`:{let r=(_i()||{}).enabledMcpjsonServers||[];r.includes(e)||B(`localSettings`,{enabledMcpjsonServers:[...r,e]}),n===`yes_all`&&B(`localSettings`,{enableAllProjectMcpServers:!0}),t();break}case`no`:{let n=(_i()||{}).disabledMcpjsonServers||[];n.includes(e)||B(`localSettings`,{disabledMcpjsonServers:[...n,e]}),t();break}}}return(0,$.jsxs)(or,{title:`New MCP server found in .mcp.json: ${e}`,color:`warning`,onCancel:()=>n(`no`),children:[(0,$.jsx)(ec,{}),(0,$.jsx)(Wo,{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`)})]})}ho(),q(),ir(),V(),Pt();function nc({serverNames:e,onDone:t}){function n(n){let r=_i()||{},i=r.enabledMcpjsonServers||[],a=r.disabledMcpjsonServers||[],[o,s]=mo(e,e=>n.includes(e));J(`tengu_mcp_multidialog_choice`,{approved:o.length,rejected:s.length}),o.length>0&&B(`localSettings`,{enabledMcpjsonServers:[...new Set([...i,...o])]}),s.length>0&&B(`localSettings`,{disabledMcpjsonServers:[...new Set([...a,...s])]}),t()}let r=(0,Ps.useCallback)(()=>{let n=(_i()||{}).disabledMcpjsonServers||[];B(`localSettings`,{disabledMcpjsonServers:[...new Set([...n,...e])]}),t()},[e,t]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(or,{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,$.jsx)(ec,{}),(0,$.jsx)(Ro,{options:e.map(e=>({label:e,value:e})),defaultValue:e,onSubmit:n,onCancel:r,hideIndexes:!0})]}),(0,$.jsx)(Xn,{paddingX:1,children:(0,$.jsx)(Qn,{dimColor:!0,italic:!0,children:(0,$.jsxs)(er,{children:[(0,$.jsx)(Yn,{shortcut:`Space`,action:`select`}),(0,$.jsx)(Yn,{shortcut:`Enter`,action:`confirm`}),(0,$.jsx)($t,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`reject all`})]})})})]})}_e(),Ht(),Ot();async function rc(e){let{servers:t}=It(`project`),n=Object.keys(t).filter(e=>yn(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,$.jsx)(lt,{children:(0,$.jsx)(zo,{children:(0,$.jsx)(tc,{serverName:t,onDone:r})})}))}else e.render((0,$.jsx)(lt,{children:(0,$.jsx)(zo,{children:(0,$.jsx)(nc,{serverNames:n,onDone:r})})}))})}xi(),hi(),Ze(),Nt(),I(),Bt(),Cn(),pt(),P(),b(),On(),Qe(),rn(),cn(),M(),Dt(),T(),Lt(),W(),ri();var ic={iterm:`iTerm`,"iterm.app":`iTerm`,ghostty:`Ghostty`,kitty:`kitty`,alacritty:`Alacritty`,wezterm:`WezTerm`,apple_terminal:`Terminal`};function ac(){if(process.platform!==`darwin`)return;let e=process.env.TERM_PROGRAM;if(!e)return;let t=ic[e.toLowerCase()];t&&U().deepLinkTerminal!==t&&(G(e=>({...e,deepLinkTerminal:t})),z(`Stored deep link terminal preference: ${t}`))}var oc=class{constructor(){m(this,`frameDurations`,[]),m(this,`firstRenderTime`,void 0),m(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}}};q(),Fn(),Wr(),ir(),_e(),W(),u(),ts(),No(),V();function sc(){G(e=>({...e,hasCompletedOnboarding:!0,lastOnboardingVersion:`0.0.22`}))}function cc(e,t){return new Promise(n=>{e.render(t(e=>void n(e)))})}async function lc(e,t,n){return uc(e,t,{color:`error`,beforeExit:n})}async function uc(e,t,n){let{Text:r}=await import(`./src-9vmGsuSI.js`),i=n?.color,a=n?.exitCode??1;e.render(i?(0,$.jsx)(r,{color:i,children:t}):(0,$.jsx)(r,{children:t})),e.unmount(),await n?.beforeExit?.(),process.exit(a)}function dc(e,t,n){return cc(e,e=>(0,$.jsx)($n,{initialState:U().theme,onThemeSave:e=>G(t=>({...t,theme:e})),children:(0,$.jsx)(lt,{onChangeAppState:n?.onChangeAppState,children:(0,$.jsx)(zo,{children:t(e)})})}))}async function fc(e,t){e.render(t),_l(),await e.waitUntilExit(),await F(0)}async function pc(e,t,n,r){if(l(!1)||process.env.IS_DEMO)return!1;let i=U(),a=!1;if(!i.theme||!i.hasCompletedOnboarding){a=!0;let{Onboarding:t}=await import(`./Onboarding-CE2GNA-h.js`);await dc(e,e=>(0,$.jsx)(t,{onDone:()=>{sc(),e()}}),{onChangeAppState:$o})}if(!l(process.env.CLAUBBIT)){if(!Vi()){let{TrustDialog:t}=await import(`./TrustDialog-G4jM9IfM.js`);await dc(e,e=>(0,$.jsx)(t,{commands:r,onDone:e}))}kr(!0),rt();let{errors:t}=Po();if(t.length===0&&await rc(e),await ct()){let t=Hn(await Bn(!0)),{AgentsMdExternalIncludesDialog:n}=await import(`./AgentsMdExternalIncludesDialog-DCvgQ6n3.js`);await dc(e,e=>(0,$.jsx)(n,{onDone:e,isStandaloneDialog:!0,externalIncludes:t}))}}if(os(),ac(),ns(),setImmediate(()=>Vs()),await Oo()){let{GroveDialog:t}=await import(`./Grove-C3mhgshv.js`);if(await dc(e,e=>(0,$.jsx)(t,{showIfAlreadyViewed:!1,location:a?`onboarding`:`policy_update_modal`,onDone:e}))===`escape`)return J(`tengu_grove_policy_exited`,{}),Mt(0),!1}if(process.env.ANTHROPIC_API_KEY&&!s()){let t=_a(process.env.ANTHROPIC_API_KEY);if(Wi(t)===`new`){let{ApproveApiKey:n}=await import(`./ApproveApiKey-DegdTXZl.js`);await dc(e,e=>(0,$.jsx)(n,{customApiKeyTruncated:t,onDone:e}),{onChangeAppState:$o})}}if((t===`bypassPermissions`||n)&&!wi()){let{BypassPermissionsModeDialog:t}=await import(`./BypassPermissionsModeDialog-D2Gesf-u.js`);await dc(e,e=>(0,$.jsx)(t,{onAccept:e}))}return a}function mc(e){let t=0,n=rs(e);n.stdin&&J(`tengu_stdin_interactive`,{});let r=new oc,i=Qo();jr(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()})}\n`;ms(a,t)}if(!rr())for(let n of e.flickers){if(n.reason===`resize`)continue;let e=Date.now();e-t<1e3&&J(`tengu_flicker`,{desiredHeight:n.desiredHeight,actualHeight:n.availableHeight,reason:n.reason}),t=e}}}}}async function hc(e,t){let{InvalidSettingsDialog:n}=await import(`./InvalidSettingsDialog-Dg6OiStR.js`);return dc(e,e=>(0,$.jsx)(n,{settingsErrors:t.settingsErrors,onContinue:e,onExit:t.onExit}))}async function gc(e,t,n,r){let[i,{ResumeConversation:a},{App:o}]=await Promise.all([n,import(`./ResumeConversation-BMCO_3X7.js`),import(`./App-BcEI6U5j.js`)]);await fc(e,(0,$.jsx)(o,{getFpsMetrics:t.getFpsMetrics,stats:t.stats,initialState:t.initialState,children:(0,$.jsx)(zo,{children:(0,$.jsx)(a,{...r,worktreePaths:i})})}))}no(),eo(),co();var _c=5,vc=30,yc="After you finish implementing the change:\n1. **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.\n2. **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.\n3. **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.\n4. **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 bc(e){return`# Batch: Parallel Work Orchestration
|
|
20
|
-
|
|
21
|
-
You are orchestrating a large, parallelizable change across this codebase.
|
|
22
|
-
|
|
23
|
-
## User Instruction
|
|
24
|
-
|
|
25
|
-
${e}
|
|
26
|
-
|
|
27
|
-
## Phase 1: Research and Plan (Plan Mode)
|
|
28
|
-
|
|
29
|
-
Call the \`${ro}\` tool now to enter plan mode, then:
|
|
30
|
-
|
|
31
|
-
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.
|
|
32
|
-
|
|
33
|
-
2. **Decompose into independent units.** Break the work into ${_c}–${vc} self-contained units. Each unit must:
|
|
34
|
-
- Be independently implementable in an isolated git worktree (no shared state with sibling units)
|
|
35
|
-
- Be mergeable on its own without depending on another unit's PR landing first
|
|
36
|
-
- Be roughly uniform in size (split large units, merge trivial ones)
|
|
37
|
-
|
|
38
|
-
Scale the count to the actual work: few files → closer to ${_c}; hundreds of files → closer to ${vc}. Prefer per-directory or per-module slicing over arbitrary file lists.
|
|
39
|
-
|
|
40
|
-
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:
|
|
41
|
-
- A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
|
|
42
|
-
- A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
|
|
43
|
-
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
|
44
|
-
- An existing e2e/integration test suite the worker can run
|
|
45
|
-
|
|
46
|
-
If you cannot find a concrete e2e path, use the \`${oo}\` 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.
|
|
47
|
-
|
|
48
|
-
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.
|
|
49
|
-
|
|
50
|
-
4. **Write the plan.** In your plan file, include:
|
|
51
|
-
- A summary of what you found during research
|
|
52
|
-
- 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
|
|
53
|
-
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
|
54
|
-
- The exact worker instructions you will give each agent (the shared template)
|
|
55
|
-
|
|
56
|
-
5. Call \`${to}\` to present the plan for approval.
|
|
57
|
-
|
|
58
|
-
## Phase 2: Spawn Workers (After Plan Approval)
|
|
59
|
-
|
|
60
|
-
Once the plan is approved, spawn one background agent per work unit using the \`${Ti}\` 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.
|
|
61
|
-
|
|
62
|
-
For each agent, the prompt must be fully self-contained. Include:
|
|
63
|
-
- The overall goal (the user's instruction)
|
|
64
|
-
- This unit's specific task (title, file list, change description — copied verbatim from your plan)
|
|
65
|
-
- Any codebase conventions you discovered that the worker needs to follow
|
|
66
|
-
- The e2e test recipe from your plan (or "skip e2e because …")
|
|
67
|
-
- The worker instructions below, copied verbatim:
|
|
68
|
-
|
|
69
|
-
\`\`\`
|
|
70
|
-
${yc}
|
|
71
|
-
\`\`\`
|
|
72
|
-
|
|
73
|
-
Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
|
|
74
|
-
|
|
75
|
-
## Phase 3: Track Progress
|
|
76
|
-
|
|
77
|
-
After launching all workers, render an initial status table:
|
|
78
|
-
|
|
79
|
-
| # | Unit | Status | PR |
|
|
80
|
-
|---|------|--------|----|
|
|
81
|
-
| 1 | <title> | running | — |
|
|
82
|
-
| 2 | <title> | running | — |
|
|
83
|
-
|
|
84
|
-
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.
|
|
85
|
-
|
|
86
|
-
When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
|
|
87
|
-
`}var xc="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.",Sc=`Provide an instruction describing the batch change you want to make.
|
|
88
|
-
|
|
89
|
-
Examples:
|
|
90
|
-
/batch migrate from react to vue
|
|
91
|
-
/batch replace all uses of lodash with native equivalents
|
|
92
|
-
/batch add type annotations to all untyped function parameters`;function Cc(){Oe({name:`batch`,description:`调研并规划一次大规模改动,然后并行投放到 5–30 个相互隔离的 worktree 智能体中执行,每个智能体各自开一个 PR。`,whenToUse:`当用户想对大量文件做横向的机械式改动(迁移、重构、批量改名),且这些改动可拆解为互不依赖的并行单元时使用。`,argumentHint:`<instruction>`,userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(e){let t=e.trim();return t?await fi()?[{type:`text`,text:bc(t)}]:[{type:`text`,text:xc}]:[{type:`text`,text:Sc}]}})}kt(),Fe(),et(),_r();var wc=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Select`,`Plugin`],Tc={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`},Ec=`app:interrupt.app:exit.app:toggleTodos.app:toggleTranscript.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(`.`),Dc=vr(()=>ur({context:lr(wc).describe(`UI context where these bindings apply. Global bindings work everywhere.`),bindings:pr(R().describe(`Keystroke pattern (e.g., "ctrl+k", "shift+tab")`),fr([lr(Ec),R().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe(`Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.`),hr().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`));vr(()=>ur({$schema:R().optional().describe(`JSON Schema URL for editor validation`),$docs:R().optional().describe(`Documentation URL`),bindings:dr(Dc()).describe(`Array of keybinding blocks by context`)}).describe(`Work Mate keybindings configuration. Customize keyboard shortcuts by context.`)),A();function Oc(){return Gc([`Context`,`Description`],wc.map(e=>[`\`${e}\``,Tc[e]]))}function kc(){let e={};for(let t of je)for(let[n,r]of Object.entries(t.bindings))r&&(e[r]||(e[r]={keys:[],context:t.context}),e[r].keys.push(n));return Gc([`Action`,`Default Key(s)`,`Context`],Ec.map(t=>{let n=e[t],r=n?n.keys.map(e=>`\`${e}\``).join(`, `):`(none)`,i=n?n.context:Ac(t);return[`\`${t}\``,r,i]}))}function Ac(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 jc(){let e=[];e.push(`### Non-rebindable (errors)`);for(let t of j)e.push(`- \`${t.key}\` — ${t.reason}`);e.push(``),e.push(`### Terminal reserved (errors/warnings)`);for(let t of Ee)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 ht)e.push(`- \`${t.key}\` — ${t.reason}`);return e.join(`
|
|
93
|
-
`)}var Mc={$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.workmate.com/docs/en/keybindings`,bindings:[{context:`Chat`,bindings:{"ctrl+e":`chat:externalEditor`}}]},Nc={context:`Chat`,bindings:{"ctrl+s":null}},Pc={context:`Chat`,bindings:{"ctrl+g":null,"ctrl+e":`chat:externalEditor`}},Fc={context:`Global`,bindings:{"ctrl+k ctrl+t":`app:toggleTodos`}},Ic=[`# Keybindings Skill`,``,"Create or modify `~/.workmate/keybindings.json` to customize keyboard shortcuts.",``,`## CRITICAL: Read Before Write`,``,"**Always read `~/.workmate/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(`
|
|
94
|
-
`),Lc=[`## File Format`,``,"```json",qr(Mc,null,2),"```",``,"Always include the `$schema` and `$docs` fields."].join(`
|
|
95
|
-
`),Rc=[`## 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(`
|
|
96
|
-
`),zc=[`## Unbinding Default Shortcuts`,``,"Set a key to `null` to remove its default binding:",``,"```json",qr(Nc,null,2),"```"].join(`
|
|
97
|
-
`),Bc=[`## 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(`
|
|
98
|
-
`),Vc=[`## Common Patterns`,``,`### Rebind a key`,"To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",qr(Pc,null,2),"```",``,`### Add a chord binding`,"```json",qr(Fc,null,2),"```"].join(`
|
|
99
|
-
`),Hc=[`## 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(`
|
|
100
|
-
`),Uc=[`## Validation with /doctor`,``,'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.workmate/keybindings.json`.',``,`### Common Issues and Fixes`,``,Gc([`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: ~/.workmate/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(`
|
|
101
|
-
`);function Wc(){Oe({name:`keybindings-help`,description:`当用户想自定义键盘快捷键、重新绑定按键、添加组合键(chord),或修改 ~/.workmate/keybindings.json 时使用。例如:"rebind ctrl+s"、"add a chord shortcut"、"change the submit key"、"customize keybindings"。`,allowedTools:[`Read`],userInvocable:!1,isEnabled:de,async getPromptForCommand(e){let t=Oc(),n=kc(),r=[Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,`## Reserved Shortcuts\n\n${jc()}`,`## Available Contexts\n\n${t}`,`## Available Actions\n\n${n}`];return e&&r.push(`## User Request\n\n${e}`),[{type:`text`,text:r.join(`
|
|
102
|
-
|
|
103
|
-
`)}]}})}function Gc(e,t){let n=e.map(()=>`---`);return[`| ${e.join(` | `)} |`,`| ${n.join(` | `)} |`,...t.map(e=>`| ${e.join(` | `)} |`)].join(`
|
|
104
|
-
`)}A();var Kc=`# /ultracode — Workflow Orchestration Playbook
|
|
105
|
-
|
|
106
|
-
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.
|
|
107
|
-
|
|
108
|
-
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.
|
|
109
|
-
|
|
110
|
-
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:
|
|
111
|
-
|
|
112
|
-
- The user included the keyword "ultracode" in their prompt (you'll see a system-reminder confirming it).
|
|
113
|
-
- Ultracode is on for the session (a system-reminder confirms it) — see **Ultracode** below.
|
|
114
|
-
- 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.
|
|
115
|
-
- The user invoked a skill or slash command whose instructions tell you to call Workflow.
|
|
116
|
-
- The user asked you to run a specific named or saved workflow.
|
|
117
|
-
|
|
118
|
-
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.
|
|
119
|
-
|
|
120
|
-
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*.
|
|
121
|
-
|
|
122
|
-
Common single-phase workflows you can chain across turns:
|
|
123
|
-
|
|
124
|
-
- **Understand** — parallel readers over relevant subsystems → structured map
|
|
125
|
-
- **Design** — judge panel of N independent approaches → scored synthesis
|
|
126
|
-
- **Review** — dimensions → find → adversarially verify (example below)
|
|
127
|
-
- **Research** — multi-modal sweep → deep-read → synthesize
|
|
128
|
-
- **Migrate** — discover sites → transform each (worktree isolation) → verify
|
|
129
|
-
|
|
130
|
-
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.
|
|
131
|
-
|
|
132
|
-
**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.
|
|
133
|
-
|
|
134
|
-
**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.
|
|
135
|
-
|
|
136
|
-
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.
|
|
137
|
-
|
|
138
|
-
Every script must begin with \`export const meta = {...}\`:
|
|
139
|
-
|
|
140
|
-
\`\`\`js
|
|
141
|
-
export const meta = {
|
|
142
|
-
name: 'find-flaky-tests',
|
|
143
|
-
description: 'Find flaky tests and propose fixes', // one-line, shown in permission dialog
|
|
144
|
-
phases: [ // one entry per phase() call
|
|
145
|
-
{ title: 'Scan', detail: 'grep test logs for retries' },
|
|
146
|
-
{ title: 'Fix', detail: 'one agent per flaky test' },
|
|
147
|
-
],
|
|
148
|
-
}
|
|
149
|
-
// script body starts here — use agent()/parallel()/pipeline()/phase()/log()
|
|
150
|
-
phase('Scan')
|
|
151
|
-
const flaky = await agent('grep CI logs for retry markers', {schema: FLAKY_SCHEMA})
|
|
152
|
-
...
|
|
153
|
-
\`\`\`
|
|
154
|
-
|
|
155
|
-
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.
|
|
156
|
-
|
|
157
|
-
Script body hooks:
|
|
158
|
-
|
|
159
|
-
- \`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).
|
|
160
|
-
- \`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.
|
|
161
|
-
- \`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.
|
|
162
|
-
- \`log(message: string): void\` — emit a progress message to the user (shown as a narrator line above the progress tree)
|
|
163
|
-
- \`phase(title: string): void\` — start a new phase; subsequent agent() calls are grouped under this title in the progress display
|
|
164
|
-
- \`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.
|
|
165
|
-
- \`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\`.
|
|
166
|
-
- \`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 the progress tree 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.
|
|
167
|
-
|
|
168
|
-
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.
|
|
169
|
-
|
|
170
|
-
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:
|
|
171
|
-
|
|
172
|
-
- '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.
|
|
173
|
-
- '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.
|
|
174
|
-
- '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.
|
|
175
|
-
- 'best' — provider's "best available" (currently opus-tier). Use when you want max intelligence and don't care about cost or pinning a tier.
|
|
176
|
-
|
|
177
|
-
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.
|
|
178
|
-
|
|
179
|
-
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.
|
|
180
|
-
|
|
181
|
-
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.
|
|
182
|
-
|
|
183
|
-
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.
|
|
184
|
-
|
|
185
|
-
DEFAULT TO pipeline(). Only reach for a barrier (parallel between stages) when you genuinely need ALL prior-stage results together.
|
|
186
|
-
|
|
187
|
-
A barrier is correct ONLY when stage N needs cross-item context from all of stage N-1:
|
|
188
|
-
|
|
189
|
-
- Dedup/merge across the full result set before expensive downstream work
|
|
190
|
-
- Early-exit if the total count is zero ("0 bugs found → skip verification entirely")
|
|
191
|
-
- Stage N's prompt references "the other findings" for comparison
|
|
192
|
-
|
|
193
|
-
A barrier is NOT justified by:
|
|
194
|
-
|
|
195
|
-
- "I need to flatten/map/filter first" — do it inside a pipeline stage: \`pipeline(items, stageA, r => transform([r]).flat(), stageB)\`
|
|
196
|
-
- "The stages are conceptually separate" — that's what pipeline() models. Separate stages ≠ synchronized stages.
|
|
197
|
-
- "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.
|
|
198
|
-
|
|
199
|
-
Smell test: if you wrote
|
|
200
|
-
|
|
201
|
-
\`\`\`js
|
|
202
|
-
const a = await parallel(...)
|
|
203
|
-
const b = transform(a) // flatten, map, filter — no cross-item dependency
|
|
204
|
-
const c = await parallel(b.map(...))
|
|
205
|
-
\`\`\`
|
|
206
|
-
|
|
207
|
-
that middle transform doesn't need the barrier. Rewrite as a pipeline with the transform inside a stage. When in doubt: pipeline.
|
|
208
|
-
|
|
209
|
-
The canonical multi-stage pattern — pipeline by default, each dimension verifies as soon as its review completes:
|
|
210
|
-
|
|
211
|
-
\`\`\`js
|
|
212
|
-
export const meta = {
|
|
213
|
-
name: 'review-changes',
|
|
214
|
-
description: 'Review changed files across dimensions, verify each finding',
|
|
215
|
-
phases: [{ title: 'Review' }, { title: 'Verify' }],
|
|
216
|
-
}
|
|
217
|
-
const DIMENSIONS = [{key: 'bugs', prompt: '...'}, {key: 'perf', prompt: '...'}]
|
|
218
|
-
const results = await pipeline(
|
|
219
|
-
DIMENSIONS,
|
|
220
|
-
d => agent(d.prompt, {label: \`review:\${d.key}\`, phase: 'Review', schema: FINDINGS_SCHEMA}),
|
|
221
|
-
review => parallel(review.findings.map(f => () =>
|
|
222
|
-
agent(\`Adversarially verify: \${f.title}\`, {label: \`verify:\${f.file}\`, phase: 'Verify', schema: VERDICT_SCHEMA})
|
|
223
|
-
.then(v => ({...f, verdict: v}))
|
|
224
|
-
))
|
|
225
|
-
)
|
|
226
|
-
const confirmed = results.flat().filter(Boolean).filter(f => f.verdict?.isReal)
|
|
227
|
-
return { confirmed }
|
|
228
|
-
// Dimension 'bugs' findings verify while dimension 'perf' is still reviewing. No wasted wall-clock.
|
|
229
|
-
\`\`\`
|
|
230
|
-
|
|
231
|
-
When a barrier IS correct — dedup across all findings before expensive verification:
|
|
232
|
-
|
|
233
|
-
\`\`\`js
|
|
234
|
-
const all = await parallel(DIMENSIONS.map(d => () => agent(d.prompt, {schema: FINDINGS_SCHEMA})))
|
|
235
|
-
const deduped = dedupeByFileAndLine(all.filter(Boolean).flatMap(r => r.findings)) // <-- genuinely needs ALL at once
|
|
236
|
-
const verified = await parallel(deduped.map(f => () => agent(verifyPrompt(f), {schema: VERDICT_SCHEMA})))
|
|
237
|
-
\`\`\`
|
|
238
|
-
|
|
239
|
-
Loop-until-count pattern — accumulate to a target:
|
|
240
|
-
|
|
241
|
-
\`\`\`js
|
|
242
|
-
const bugs = []
|
|
243
|
-
while (bugs.length < 10) {
|
|
244
|
-
const result = await agent("Find bugs in this codebase.", {schema: BUGS_SCHEMA})
|
|
245
|
-
bugs.push(...result.bugs)
|
|
246
|
-
log(\`\${bugs.length}/10 found\`)
|
|
247
|
-
}
|
|
248
|
-
\`\`\`
|
|
249
|
-
|
|
250
|
-
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.
|
|
251
|
-
|
|
252
|
-
\`\`\`js
|
|
253
|
-
const bugs = []
|
|
254
|
-
while (budget.total && budget.remaining() > 50_000) {
|
|
255
|
-
const result = await agent("Find bugs in this codebase.", {schema: BUGS_SCHEMA})
|
|
256
|
-
bugs.push(...result.bugs)
|
|
257
|
-
log(\`\${bugs.length} found, \${Math.round(budget.remaining()/1000)}k remaining\`)
|
|
258
|
-
}
|
|
259
|
-
\`\`\`
|
|
260
|
-
|
|
261
|
-
Composing patterns — exhaustive review (find → dedup vs seen → diverse-lens panel → loop-until-dry):
|
|
262
|
-
|
|
263
|
-
\`\`\`js
|
|
264
|
-
const seen = new Set(), confirmed = []
|
|
265
|
-
let dry = 0
|
|
266
|
-
while (dry < 2) { // loop-until-dry
|
|
267
|
-
const found = (await parallel(FINDERS.map(f => () => // barrier: collect all finders this round
|
|
268
|
-
agent(f.prompt, {phase: 'Find', schema: BUGS})))).filter(Boolean).flatMap(r => r.bugs)
|
|
269
|
-
const fresh = found.filter(b => !seen.has(key(b))) // dedup vs ALL seen — plain code, not an agent
|
|
270
|
-
if (!fresh.length) { dry++; continue }
|
|
271
|
-
dry = 0; fresh.forEach(b => seen.add(key(b)))
|
|
272
|
-
const judged = await parallel(fresh.map(b => () => // every fresh bug judged concurrently...
|
|
273
|
-
parallel(['correctness','security','repro'].map(lens => () => // ...each by 3 distinct lenses
|
|
274
|
-
agent(\`Judge "\${b.desc}" via the \${lens} lens — real?\`, {phase: 'Verify', schema: VERDICT})))
|
|
275
|
-
.then(vs => ({ b, real: vs.filter(Boolean).filter(v => v.real).length >= 2 }))))
|
|
276
|
-
confirmed.push(...judged.filter(v => v.real).map(v => v.b))
|
|
277
|
-
}
|
|
278
|
-
return confirmed
|
|
279
|
-
// dedup vs \`seen\`, NOT \`confirmed\` — else judge-rejected findings reappear every round and it never converges.
|
|
280
|
-
\`\`\`
|
|
281
|
-
|
|
282
|
-
Quality patterns — common shapes; pick by task and compose freely:
|
|
283
|
-
|
|
284
|
-
- Adversarial verify: spawn N independent skeptics per finding, each prompted to REFUTE. Kill if ≥majority refute. Prevents plausible-but-wrong findings from surviving.
|
|
285
|
-
|
|
286
|
-
\`\`\`js
|
|
287
|
-
const votes = await parallel(Array.from({length: 3}, () => () =>
|
|
288
|
-
agent(\`Try to refute: \${claim}. Default to refuted=true if uncertain.\`, {schema: VERDICT})))
|
|
289
|
-
const survives = votes.filter(Boolean).filter(v => !v.refuted).length >= 2
|
|
290
|
-
\`\`\`
|
|
291
|
-
|
|
292
|
-
- 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.
|
|
293
|
-
- 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.
|
|
294
|
-
- 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.
|
|
295
|
-
- 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.
|
|
296
|
-
- 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.
|
|
297
|
-
- 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.
|
|
298
|
-
|
|
299
|
-
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.
|
|
300
|
-
|
|
301
|
-
These patterns aren't exhaustive — compose novel harnesses when the task calls for it (tournament brackets, self-repair loops, staged escalation, whatever fits).
|
|
302
|
-
|
|
303
|
-
Use this tool for multi-step orchestration where control flow should be deterministic (loops, conditionals, fan-out) rather than model-driven.
|
|
304
|
-
|
|
305
|
-
## Resume
|
|
306
|
-
|
|
307
|
-
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.
|
|
308
|
-
`;function qc(){Oe({name:`ultracode`,description:`进入多智能体 workflow 编排模式:何时使用 Workflow 工具、脚本原语、质量模式、确定性约束、resume/预算、以及文件和命令。`,whenToUse:`当任务可拆解或可并行、需要多视角置信度(如先查找再对抗式验证)、超出单一上下文容量(大迁移、广审计、长尾枚举)或需要可恢复/可审计时——用 Workflow 工具编排多个子智能体。`,userInvocable:!0,async getPromptForCommand(e){let t=Kc;return e&&(t+=`\n## User input\n\n${e}\n`),[{type:`text`,text:t}]}})}A();function Jc(){Oe({name:`loop`,description:`在固定时间间隔循环运行某条 prompt 或 slash command(例如 /loop 5m /foo,默认 10m)`,whenToUse:`当用户想设置一个周期性任务、轮询状态,或按固定间隔重复运行某个内容时使用(例如"每 5 分钟检查一次部署状态"、"持续运行 /babysit-prs")。一次性任务不要用本命令。`,argumentHint:`[interval] <prompt>`,userInvocable:!1,isEnabled:()=>!1,async getPromptForCommand(){return[{type:`text`,text:`The /loop command is no longer available.`}]}})}fn(),x(),Wr(),A();var Yc=`# Dream: Memory Consolidation (manual run)
|
|
309
|
-
|
|
310
|
-
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.
|
|
311
|
-
|
|
312
|
-
`;function Xc(){Oe({name:`dream`,description:`手动触发记忆整合——回顾、整理并修剪自动记忆文件。`,whenToUse:`当用户输入 /dream 或想手动整合记忆、整理记忆文件、清理过期条目时使用。`,userInvocable:!0,isEnabled:()=>Fi(),async getPromptForCommand(e){let t=Ii(),n=Tn(Mr());await xt();let r=Yc+Dn(t,n,``);return e&&(r+=`\n\n## Additional context from user\n\n${e}`),[{type:`text`,text:r}]}})}function Zc(){Wc(),Cc(),qc(),Jc(),Xc()}_n();async function Qc(){if(!await aa(`gh`))return`not_installed`;let{exitCode:e}=await Yi(`gh`,[`auth`,`token`],{stdout:`ignore`,stderr:`ignore`,timeout:5e3,reject:!1});return e===0?`authenticated`:`not_authenticated`}go(),mt(),ce(),An(),Je(),q(),bn();async function $c(e,t){let n=await nn(e),r=gt(t);for(let e of n)e.type===`prompt`&&J(`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}})}qo(),q(),Ht(),Ot(),u(),si();function el(e){e.command(`add <name> <commandOrUrl> [args...]`).description(`Add an MCP server to Work Mate.
|
|
313
|
-
|
|
314
|
-
Examples:
|
|
315
|
-
# Add HTTP server:
|
|
316
|
-
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
|
|
317
|
-
|
|
318
|
-
# Add HTTP server with headers:
|
|
319
|
-
claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..."
|
|
320
|
-
|
|
321
|
-
# Add stdio server with environment variables:
|
|
322
|
-
claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
|
|
323
|
-
|
|
324
|
-
# Add stdio server with subprocess flags:
|
|
325
|
-
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 Q(`--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(!Be())).action(async(e,t,n,r)=>{let i=t,a=n;e?i||Z(`Error: Command is required when server name is provided.
|
|
326
|
-
Usage: claude mcp add <name> <command> [args...]`):Z(`Error: Server name is required.
|
|
327
|
-
Usage: claude mcp add <name> <command> [args...]`);try{let t=$e(r.scope),n=qn(r.transport);r.xaa&&!Be()&&Z(`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`),_()||e.push(`'claude mcp xaa setup' (settings.xaaIdp not configured)`),e.length&&Z(`Error: --xaa requires: ${e.join(`, `)}`)}let s=r.transport!==void 0,l=i.startsWith(`http://`)||i.startsWith(`https://`)||i.startsWith(`localhost`)||i.endsWith(`/sse`)||i.endsWith(`/mcp`);if(J(`tengu_mcp_add`,{type:n,scope:t,source:`command`,transport:n,transportExplicit:s,looksLikeUrl:l}),n===`sse`){i||Z(`Error: URL is required for SSE transport.`);let n=r.header?N(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 ot():void 0,l={type:`sse`,url:i,headers:n,oauth:s};await O(e,l,t),c&&Rn(e,l,c),process.stdout.write(`Added SSE MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${qr(n,null,2)}\n`)}else if(n===`http`){i||Z(`Error: URL is required for HTTP transport.`);let n=r.header?N(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 ot():void 0,l={type:`http`,url:i,headers:n,oauth:s};await O(e,l,t),c&&Rn(e,l,c),process.stdout.write(`Added HTTP MCP server ${e} with URL: ${i} to ${t} config\n`),n&&process.stdout.write(`Headers: ${qr(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.
|
|
328
|
-
`),!s&&l&&(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 O(e,{type:`stdio`,command:i,args:a,env:c(r.env)},t),process.stdout.write(`Added stdio MCP server ${e} with command: ${i} ${a.join(` `)} to ${t} config\n`);X(`File modified: ${Le(t)}`)}catch(e){Z(e.message)}})}I(),Jr(),V();function tl(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 Z(`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 Z(`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 Z(`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 Z(`Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var`);let i=_(),a=i?.issuer,o=i?.clientId,{error:s}=B(`userSettings`,{xaaIdp:{issuer:e.issuer,clientId:e.clientId,callbackPort:n}});if(s)return Z(`Error writing settings: ${s.message}`);if(a&&(Ue(a)===Ue(e.issuer)?o!==e.clientId&&(ye(a),y(a)):(ye(a),y(a))),r){let{success:t,warning:n}=Xe(e.issuer,r);if(!t)return Z(`Error: settings written but keychain save failed${n?` — ${n}`:``}. Re-run with --client-secret once keychain is available.`)}X(`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=_();if(!t)return Z(`Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.`);if(e.idToken){let n=xe(t.issuer,e.idToken);return X(`id_token cached for ${t.issuer} (expires ${new Date(n).toISOString()})`)}if(e.force&&ye(t.issuer),E(t.issuer)!==void 0)return X(`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 ut({idpIssuer:t.issuer,idpClientId:t.clientId,idpClientSecret:ln(t.issuer),callbackPort:t.callbackPort,onAuthorizationUrl:e=>{process.stdout.write(`If the browser did not open, visit:\n ${e}\n`)}}),X(`Logged in. MCP servers with --xaa will now authenticate silently.`)}catch(e){Z(`IdP login failed: ${Yr(e)}`)}}),t.command(`show`).description(`Show the current IdP connection config`).action(()=>{let e=_();if(!e)return X(`No XAA IdP connection configured.`);let t=ln(e.issuer)!==void 0,n=E(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`),X()}),t.command(`clear`).description(`Clear the IdP connection config and cached id_token`).action(()=>{let e=_(),{error:t}=B(`userSettings`,{xaaIdp:void 0});if(t)return Z(`Error writing settings: ${t.message}`);e&&(ye(e.issuer),y(e.issuer)),X(`XAA IdP connection cleared`)})}_t(),kn();function nl(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]}}Mn(),q(),W(),$i(),V();function rl(){if(U().bypassPermissionsModeAccepted)try{wi()||B(`userSettings`,{skipDangerousModePermissionPrompt:!0}),J(`tengu_migrate_bypass_permissions_accepted`,{}),G(e=>{if(!(`bypassPermissionsModeAccepted`in e))return e;let{bypassPermissionsModeAccepted:t,...n}=e;return n})}catch(e){K(Error(`Failed to migrate bypass permissions accepted: ${e}`))}}q(),W(),$i(),V();function il(){let e=Hi(),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=Di(`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&&B(`localSettings`,a),(o.includes(`enableAllProjectMcpServers`)||o.includes(`enabledMcpjsonServers`)||o.includes(`disabledMcpjsonServers`))&&Li(e=>{let{enableAllProjectMcpServers:t,enabledMcpjsonServers:n,disabledMcpjsonServers:r,...i}=e;return i}),J(`tengu_migrate_mcp_approval_fields_success`,{migratedCount:o.length})}catch(e){K(e),J(`tengu_migrate_mcp_approval_fields_error`,{})}}q(),W(),ga(),V();function al(){if(Xa()!==`firstParty`||!Ua())return;let e=Di(`userSettings`)?.model;e!==`claude-opus-4-20250514`&&e!==`claude-opus-4-1-20250805`&&e!==`claude-opus-4-0`&&e!==`claude-opus-4-1`||(B(`userSettings`,{model:`opus`}),G(e=>({...e,legacyOpusMigrationTimestamp:Date.now()})),J(`tengu_legacy_opus_migration`,{from_model:e}))}q(),Ia();function ol(){Ra()&&J(`tengu_opus_to_opus1m_migration`,{skipped:!0})}Wr(),W(),V();function sl(){U().sonnet1m45MigrationComplete||(Di(`userSettings`)?.model===`sonnet[1m]`&&B(`userSettings`,{model:`sonnet-4-5-20250929[1m]`}),Sr()===`sonnet[1m]`&&Ur(`sonnet-4-5-20250929[1m]`),G(e=>({...e,sonnet1m45MigrationComplete:!0})))}q(),Ea(),W(),ga(),V();function cl(){if(Xa()!==`firstParty`||!Ba()&&!Ca()&&!fa())return;let e=Di(`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]`);B(`userSettings`,{model:t?`sonnet[1m]`:`sonnet`}),U().numStartups>1&&G(e=>({...e,sonnet45To46MigrationTimestamp:Date.now()})),J(`tengu_sonnet45_to_46_migration`,{from_model:e,has_1m:t})}W(),$i(),V(),q(),Ea(),W(),ga(),V();function ll(){if(!U().opusProMigrationComplete){if(Xa()!==`firstParty`||!Ba()){G(e=>({...e,opusProMigrationComplete:!0})),J(`tengu_reset_pro_to_opus_default`,{skipped:!0});return}if(_i()?.model===void 0){let e=Date.now();G(t=>({...t,opusProMigrationComplete:!0,opusProMigrationTimestamp:e})),J(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!1})}else G(e=>({...e,opusProMigrationComplete:!0})),J(`tengu_reset_pro_to_opus_default`,{skipped:!1,had_custom_model:!0})}}la(),Ln(),Ea(),W(),ts(),sa(),si(),q(),Wr(),qe(),ir(),Vo(),u(),pi(),$i(),Ia(),Lt(),In(),V(),Ht(),Ot(),I(),ei(),ri(),Jr(),Fn(),Ce(),ki(),Et(),Do(),at(),Y(`main_tsx_entry`),di(),va(),Y(`main_tsx_imports_loaded`);function ul(){try{let e=Di(`policySettings`);if(e){let t=Ei(e);J(`tengu_managed_settings_loaded`,{keyCount:t.length,keys:t.join(`,`)})}}catch{}}function dl(){let e=Ja(Tr()??Ga());$c(Kr(),Pa(e,Pr())),Gn().then(({enabled:e,errors:t})=>{let n=S();Sn(e,n,Tt()),mn(t,n)}).catch(e=>K(e))}function fl(){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),o(`--use-system-ca`)&&(e.has_use_system_ca=!0),o(`--use-openssl-ca`)&&(e.has_use_openssl_ca=!0),e}async function pl(){if(Eo())return;let[e,t,n]=await Promise.all([fi(),mi(),Qc()]);J(`tengu_startup_telemetry`,{is_git:e,worktree_count:t,gh_auth_status:n,sandbox_enabled:w.isSandboxingEnabled(),are_unsandboxed_commands_allowed:w.areUnsandboxedCommandsAllowed(),is_auto_bash_allowed_if_sandbox_enabled:w.isAutoAllowBashIfSandboxedEnabled(),auto_updater_disabled:zi(),prefers_reduced_motion:Oi().prefersReducedMotion??!1,...fl()})}var ml=11;function hl(){U().migrationVersion!==ml&&(rl(),il(),ll(),sl(),al(),cl(),ol(),G(e=>e.migrationVersion===ml?e:{...e,migrationVersion:ml}))}function gl(){if(wr()){H(`info`,`prefetch_system_context_non_interactive`),rt();return}Vi()?(H(`info`,`prefetch_system_context_has_trust`),rt()):H(`info`,`prefetch_system_context_skipped_no_trust`)}function _l(){l(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||d()||(To(),me(),gl(),us(),l(process.env.CLAUDE_CODE_USE_BEDROCK)&&!l(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&xa(),l(process.env.CLAUDE_CODE_USE_VERTEX)&&!l(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&wa(),_o(Kr(),AbortSignal.timeout(3e3),[]),Qa(),qt.initialize(),d()||Ko.initialize())}function vl(e){try{let t=e.trim(),n=t.startsWith(`{`)&&t.endsWith(`}`),r;if(n)mr(t)||(process.stderr.write(L.red(`Error: Invalid JSON provided to --settings
|
|
329
|
-
`)),process.exit(1)),r=Jo(`claude-settings`,`.json`,{contentHash:t}),$r(r,t,`utf8`);else{let{resolvedPath:t}=ni(oi(),e);try{hs(t,`utf8`)}catch(e){throw ci(e)&&(process.stderr.write(L.red(`Error: Settings file not found: ${t}\n`)),process.exit(1)),e}r=t}Lr(r),Br()}catch(e){e instanceof Error&&K(e),process.stderr.write(L.red(`Error processing settings: ${Yr(e)}\n`)),process.exit(1)}}function yl(e){try{Fr(gi(e)),Br()}catch(e){e instanceof Error&&K(e),process.stderr.write(L.red(`Error processing --setting-sources: ${Yr(e)}\n`)),process.exit(1)}}function bl(){Y(`eagerLoadSettings_start`);let e=nl(`--settings`);e&&vl(e);let t=nl(`--setting-sources`);t!==void 0&&yl(t),Y(`eagerLoadSettings_end`)}function xl(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(l(process.env.CLAUDE_CODE_ACTION)){process.env.CLAUDE_CODE_ENTRYPOINT=`claude-code-github-action`;return}process.env.CLAUDE_CODE_ENTRYPOINT=e?`sdk-cli`:`cli`}async function Sl(){Y(`main_function_start`),process.env.NoDefaultCurrentDirectoryInExePath=`1`,$s(),process.on(`exit`,()=>{Dl();try{let{peekWorkflowService:t}=(ke(),e(Ie));t()?.shutdown()}catch{}}),process.on(`SIGINT`,()=>{process.argv.includes(`-p`)||process.argv.includes(`--print`)||process.exit(0)}),Y(`main_warning_handler_initialized`);{let e=process.argv.indexOf(`--handle-uri`);if(e!==-1&&process.argv[e+1]){let{enableConfigs:t}=await import(`./config-kw4xg7Nk.js`);t();let n=process.argv[e+1],{handleDeepLinkUri:r}=await import(`./protocolHandler-CJo9-PfZ.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-kw4xg7Nk.js`);e();let{handleUrlSchemeLaunch:t}=await import(`./protocolHandler-CJo9-PfZ.js`),n=await t();process.exit(n??1)}}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=l(process.env.CLAUDE_CODE_FORCE_INTERACTIVE),o=n||r||i||!a&&!process.stdout.isTTY;o&&is(),Ir(!o),xl(o);let s=l(process.env.GITHUB_ACTIONS)?`github-action`:process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-ts`?`sdk-typescript`:process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-py`?`sdk-python`:process.env.CLAUDE_CODE_ENTRYPOINT===`sdk-cli`?`sdk-cli`:process.env.CLAUDE_CODE_ENTRYPOINT===`claude-vscode`?`claude-vscode`:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`?`local-agent`:process.env.CLAUDE_CODE_ENTRYPOINT===`claude-desktop`?`claude-desktop`:`cli`;Hr(s);let c=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;c===`markdown`||c===`html`?Dr(c):!s.startsWith(`sdk-`)&&s!==`claude-desktop`&&s!==`local-agent`&&Dr(`markdown`),Y(`main_client_type_determined`),bl(),Y(`main_before_run`),await wl(),Y(`main_after_run`)}async function Cl(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 Ji(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.
|
|
330
|
-
`),[e,n].filter(Boolean).join(`
|
|
331
|
-
`)}return e}async function wl(){Y(`run_function_start`);function e(){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 t=new js().configureHelp(e()).enablePositionalOptions();Y(`run_commander_initialized`),t.hook(`preAction`,async e=>{Y(`preAction_start`),await Promise.all([Mi(),Oa()]),Y(`preAction_after_mdm`),await Bs(),Y(`preAction_after_init`),l(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE)||(process.title=`workMate`);let{initSinks:t}=await import(`./sinks-BS17vtN0.js`);t(),Y(`preAction_after_sinks`);let n=e.getOptionValue(`pluginDir`);Array.isArray(n)&&n.length>0&&n.every(e=>typeof e==`string`)&&(zr(n),Ve(`preAction: --plugin-dir inline plugins`)),hl(),Y(`preAction_after_migrations`),ko(),Y(`preAction_after_policy_limits`)}),t.name(`wm`).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 Q(`--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 Work Mate 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 AGENTS.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 (AGENTS.md dirs), --mcp-config, --settings, --agents, --plugin-dir.`,()=>!0).addOption(new Q(`--init`,`Run Setup hooks with init trigger, then continue`).hideHelp()).addOption(new Q(`--init-only`,`Run Setup and SessionStart:startup hooks, then exit`).hideHelp()).addOption(new Q(`--maintenance`,`Run Setup hooks with maintenance trigger, then continue`).hideHelp()).addOption(new Q(`--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 Q(`--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 Q(`--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 Q(`--thinking <mode>`,`Thinking mode: enabled (equivalent to adaptive), disabled`).choices([`enabled`,`adaptive`,`disabled`]).hideHelp()).addOption(new Q(`--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 Q(`--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 Q(`--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 Q(`--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 Q(`--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 Q(`--permission-prompt-tool <tool>`,`MCP tool to use for permission prompts (only works with --print)`).argParser(String).hideHelp()).addOption(new Q(`--system-prompt <prompt>`,`System prompt to use for the session`).argParser(String)).addOption(new Q(`--system-prompt-file <file>`,`Read system prompt from a file`).argParser(String).hideHelp()).addOption(new Q(`--append-system-prompt <prompt>`,`Append a system prompt to the default system prompt`).argParser(String)).addOption(new Q(`--append-system-prompt-file <file>`,`Read system prompt from a file and append to the default system prompt`).argParser(String).hideHelp()).addOption(new Q(`--permission-mode <mode>`,`Permission mode to use for the session`).argParser(String).choices(Ni)).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 Q(`--prefill <text>`,`Pre-fill the prompt input with text without submitting it`).hideHelp()).addOption(new Q(`--deep-link-origin`,`Signal that this session was launched from a deep link`).hideHelp()).addOption(new Q(`--deep-link-repo <slug>`,`Repo slug the deep link ?repo= parameter resolved to the current cwd`).hideHelp()).addOption(new Q(`--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 Q(`--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 Q(`--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 Q(`--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(`--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(e,t)=>{Y(`action_handler_start`),t.bare&&(process.env.CLAUDE_CODE_SIMPLE=`1`),e===`code`&&(J(`tengu_code_prompt_ignored`,{}),console.warn(L.yellow("Tip: You can launch Work Mate with just `claude`")),e=void 0),e&&typeof e==`string`&&!/\s/.test(e)&&e.length>0&&J(`tengu_single_word_prompt`,{length:e.length});let{debug:n=!1,debugToStderr:r=!1,dangerouslySkipPermissions:i,allowDangerouslySkipPermissions:a=!1,tools:o=[],allowedTools:s=[],disallowedTools:c=[],mcpConfig:u=[],permissionMode:f,addDir:p=[],fallbackModel:m,betas:ee=[],ide:te=!1,sessionId:h,includeHookEvents:ne,includePartialMessages:re}=t;t.prefill&&as(t.prefill);let ie=t.agents,g=t.agent;g&&(process.env.CLAUDE_CODE_AGENT=g);let _=t.outputFormat,v=t.inputFormat,ce=t.verbose??U().verbose,de=t.print,fe=t.init??!1,pe=t.initOnly??!1,ge=t.maintenance??!1,_e=t.disableSlashCommands||!1,ye=xo()?t.worktree:void 0,y=typeof ye==`string`?ye:void 0,b=ye!==void 0,xe;if(y){let e=be(y);e!==null&&(xe=e,y=void 0)}let Ce=xo()&&t.tmux===!0;Ce&&(b||(process.stderr.write(L.red(`Error: --tmux requires --worktree
|
|
332
|
-
`)),process.exit(1)),oa()===`windows`&&(process.stderr.write(L.red(`Error: --tmux is not supported on Windows
|
|
333
|
-
`)),process.exit(1)),await he()||(process.stderr.write(L.red(`Error: tmux is not installed.\n${zt()}\n`)),process.exit(1)));let Ee=t.sdkUrl??void 0,Oe=re||l(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES);if(ne&&Xt(!0),Ee&&(v||(v=`stream-json`),_||(_=`stream-json`),t.verbose===void 0&&(ce=!0),t.print||(de=!0)),h&&((t.continue||t.resume)&&!t.forkSession&&(process.stderr.write(L.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
334
|
-
`)),process.exit(1)),!Ee)){let e=We(h);e||(process.stderr.write(L.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
335
|
-
`)),process.exit(1)),dn(e)&&(process.stderr.write(L.red(`Error: Session ID ${e} is already in use.\n`)),process.exit(1))}let x=wr();m&&t.model&&m===t.model&&(process.stderr.write(L.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
|
|
336
|
-
`)),process.exit(1));let ke=t.systemPrompt;if(t.systemPromptFile){t.systemPrompt&&(process.stderr.write(L.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
337
|
-
`)),process.exit(1));try{ke=hs(fs(t.systemPromptFile),`utf8`)}catch(e){Zr(e)===`ENOENT`&&(process.stderr.write(L.red(`Error: System prompt file not found: ${fs(t.systemPromptFile)}\n`)),process.exit(1)),process.stderr.write(L.red(`Error reading system prompt file: ${Yr(e)}\n`)),process.exit(1)}}let S=t.appendSystemPrompt;if(t.appendSystemPromptFile){t.appendSystemPrompt&&(process.stderr.write(L.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
338
|
-
`)),process.exit(1));try{S=hs(fs(t.appendSystemPromptFile),`utf8`)}catch(e){Zr(e)===`ENOENT`&&(process.stderr.write(L.red(`Error: Append system prompt file not found: ${fs(t.appendSystemPromptFile)}\n`)),process.exit(1)),process.stderr.write(L.red(`Error reading append system prompt file: ${Yr(e)}\n`)),process.exit(1)}}let{mode:C,notification:je}=zn({permissionModeCli:f,dangerouslySkipPermissions:i});Ar(C===`bypassPermissions`),(t.enableAutoMode||f===`auto`||C===`auto`||!f&&st())&&Ne(!0);let w={};if(u&&u.length>0){let e=u.map(e=>e.trim()).filter(e=>e.length>0),t={},n=[];for(let r of e){let e=null,i=[],a=mr(r);if(a){let t=Pn({configObject:a,filePath:`command line`,expandVars:!0,scope:`dynamic`});t.config?e=t.config.mcpServers:i=t.errors}else{let t=Gt({filePath:fs(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(`
|
|
339
|
-
`);z(`--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}=gn(Wt(t,e=>({...e,scope:`dynamic`})));n.length>0&&process.stderr.write(`Warning: MCP ${na(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),w={...w,...e}}}let Pe=t.strictMcpConfig||!1;jn()&&(Pe&&(process.stderr.write(L.red(`You cannot use --strict-mcp-config when an enterprise MCP config is present`)),process.exit(1)),w&&!oe(w)&&(process.stderr.write(L.red(`You cannot dynamically configure MCP servers when an enterprise MCP config is present`)),process.exit(1))),Er(p);let Fe=await tt({allowedToolsCli:s,disallowedToolsCli:c,baseToolsCli:o,permissionMode:C,allowDangerouslySkipPermissions:a,addDirs:p}),T=Fe.toolPermissionContext,{warnings:Ie,dangerousPermissions:Le}=Fe;Le.length>0&&(T=an(T)),Ie.forEach(e=>{console.error(e)});let Be=x&&!Pe&&!jn()&&!d()?Zt().then(e=>{let{allowed:t,blocked:n}=gn(e);return n.length>0&&process.stderr.write(`Warning: claude.ai MCP ${na(n.length,`server`)} blocked by enterprise policy: ${n.join(`, `)}\n`),t}):Promise.resolve({});z(`[STARTUP] Loading MCP configs...`);let Ve=Date.now(),He,Ue=(Pe||d()?Promise.resolve({servers:{}}):En(w)).then(e=>(He=Date.now()-Ve,e));v&&v!==`text`&&v!==`stream-json`&&(console.error(`Error: Invalid input format "${v}".`),process.exit(1)),v===`stream-json`&&_!==`stream-json`&&(console.error(`Error: --input-format=stream-json requires output-format=stream-json.`),process.exit(1)),Ee&&(v!==`stream-json`||_!==`stream-json`)&&(console.error(`Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),t.replayUserMessages&&(v!==`stream-json`||_!==`stream-json`)&&(console.error(`Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json.`),process.exit(1)),Oe&&(!x||_!==`stream-json`)&&(Ki(`Error: --include-partial-messages requires --print and --output-format=stream-json.`),process.exit(1)),t.sessionPersistence===!1&&!x&&(Ki(`Error: --no-session-persistence can only be used with --print mode.`),process.exit(1));let E=await Cl(e||``,v??`text`);Y(`action_after_input_prompt`),El(t);let qe=nt(T);Y(`action_tools_loaded`);let D;if(so({isNonInteractiveSession:x})&&t.jsonSchema&&(D=Qr(t.jsonSchema)),D){let e=ao(D);`tool`in e?(qe=[...qe,e.tool],J(`tengu_structured_output_enabled`,{schema_property_count:Object.keys(D.properties||{}).length,has_required_fields:!!D.required})):J(`tengu_structured_output_failure`,{error:`Invalid JSON schema`})}Y(`action_before_setup`),z(`[STARTUP] Running setup()...`);let Je=Date.now(),{setup:Xe}=await import(`./setup-CN_Pk7AR.js`),O=Kr();process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&Zc();let Ze=Xe(O,C,a,b,y,Ce,h?We(h):void 0,xe),Qe=b?null:on(O),$e=b?null:Qt(O);Qe?.catch(()=>{}),$e?.catch(()=>{}),await Ze,z(`[STARTUP] setup() completed in ${Date.now()-Je}ms`),Y(`action_after_setup`);let et=!!t.replayUserMessages;wr()&&(ns(),rt(),me(),Va());let it=t.name?.trim();it&&le(it);let at=t.model==="default"?Ga():t.model,ot=m==="default"?Ga():m,ct=b?Kr():O;z(`[STARTUP] Loading commands and agents...`);let lt=Date.now(),[ut,dt]=await Promise.all([Qe??on(ct),$e??Qt(ct)]);z(`[STARTUP] Commands and agents loaded in ${Date.now()-lt}ms`),Y(`action_commands_loaded`);let pt=[];if(ie)try{let e=mr(ie);e&&(pt=Yt(e,`flagSettings`))}catch(e){K(e)}let mt=[...dt.allAgents,...pt],ht={...dt,allAgents:mt,activeAgents:xn(mt)},gt=g??Oi().agent,k;if(gt&&(k=ht.activeAgents.find(e=>e.agentType===gt),k||z(`Warning: agent "${gt}" not found. Available agents: ${ht.activeAgents.map(e=>e.agentType).join(`, `)}. Using default behavior.`)),Or(k?.agentType),k&&J(`tengu_agent_flag`,{agentType:wn(k)?k.agentType:`custom`,...g&&{source:`cli`}}),k?.agentType&&Kt(k.agentType),x&&k&&!ke&&!wn(k)){let e=k.getSystemPrompt();e&&(ke=e)}k?.initialPrompt&&(typeof E==`string`?E=E?`${k.initialPrompt}\n\n${E}`:k.initialPrompt:E||(E=k.initialPrompt));let A=at;!A&&k?.model&&k.model!==`inherit`&&(A=Ja(k.model)),Ur(A),Vr(Na()||null);let _t=Tr(),xt=Ja(_t??Ga()),j;if(ft()){let e=Un()?t.advisor:void 0;e&&(z(`[AdvisorTool] --advisor ${e}`),Se(xt)||(process.stderr.write(L.red(`Error: The model "${xt}" does not support the advisor tool.\n`)),process.exit(1)),bt(Ma(Ja(e)))||(process.stderr.write(L.red(`Error: The model "${e}" cannot be used as an advisor.\n`)),process.exit(1))),j=Un()?e??se():e,j&&z(`[AdvisorTool] Advisor model: ${j}`)}if(t.proactive||l(process.env.CLAUDE_CODE_PROACTIVE)){let e=`
|
|
340
|
-
# Proactive Mode
|
|
341
|
-
|
|
342
|
-
You are in proactive mode. Take initiative — explore, act, and make progress without waiting for instructions.
|
|
343
|
-
|
|
344
|
-
Start by briefly greeting the user.
|
|
345
|
-
|
|
346
|
-
You will receive periodic <tick> prompts. These are check-ins. Do whatever seems most useful, or call Sleep if there's nothing to do. The user will see any text you output.`;S=S?`${S}\n\n${e}`:e}let M,Tt,Et;if(!x){let t=mc(!1);Tt=t.getFpsMetrics,Et=t.stats;let{createRoot:n}=await import(`./src-9vmGsuSI.js`);M=await n(t.renderOptions),J(`tengu_timer`,{event:`startup`,durationMs:Math.round(process.uptime()*1e3)}),z(`[STARTUP] Running showSetupScreens()...`);let r=Date.now(),i=await pc(M,C,a,ut);z(`[STARTUP] showSetupScreens() completed in ${Date.now()-r}ms`),i&&e?.trim().toLowerCase()===`/login`&&(e=``),i&&(Mo(),Co());let o=await ba();o.valid||await lc(M,o.message)}if(process.exitCode!==void 0){z(`Graceful shutdown initiated, skipping further initialization`);return}if(Me(),!x){let{errors:e}=Ci(),t=e.filter(e=>!e.mcpErrorMetadata);t.length>0&&await hc(M,{settingsErrors:t,onExit:()=>Mt(1)})}let Dt=U().startupPrefetchedAt??0;d()?(z(`Skipping startup prefetches, last ran ${Math.round((Date.now()-Dt)/1e3)}s ago`),ua()):(z(`Starting background startup prefetches${Dt>0?` last ran ${Math.round((Date.now()-Dt)/1e3)}s ago`:``}`),un().catch(e=>K(e)),qs(),Ta()),x||ls();let{servers:Ot}=await Ue;z(`[STARTUP] MCP configs resolved in ${He}ms (awaited at +${Date.now()-Ve}ms)`);let kt={...Ot,...w},jt={},N={};for(let[e,t]of Object.entries(kt)){let n=t;n.type===`sdk`?jt[e]=n:N[e]=n}Y(`action_mcp_configs_loaded`);let Nt=x?Promise.resolve({clients:[],tools:[],commands:[]}):en(N),Pt=x?Promise.resolve({clients:[],tools:[],commands:[]}):Be.then(e=>Object.keys(e).length>0?en(e):{clients:[],tools:[],commands:[]}),It=Promise.all([Nt,Pt]).then(([e,t])=>({clients:[...e.clients,...t.clients],tools:Ft([...e.tools,...t.tools],`name`),commands:Ft([...e.commands,...t.commands],`name`)})),Lt=pe||fe||ge||x||t.continue||t.resume?null:St(`startup`,{agentType:k?.agentType,model:xt}),Rt=[];It.catch(()=>{});let Bt=[],Ht=[],qt=[],P=vt(),F=P===!1?{type:`disabled`}:{type:`adaptive`};if(t.thinking===`adaptive`||t.thinking===`enabled`)P=!0,F={type:`adaptive`};else if(t.thinking===`disabled`)P=!1,F={type:`disabled`};else{let e=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):t.maxThinkingTokens;e!==void 0&&(e>0?(P=!0,F={type:`enabled`,budgetTokens:e}):e===0&&(P=!1,F={type:`disabled`}))}H(`info`,`started`,{version:`0.0.22`,is_native_binary:ta()}),ai(async()=>{H(`info`,`exited`)}),Tl({hasInitialPrompt:!!e,hasStdin:!!E,verbose:ce,debug:n,debugToStderr:r,print:de??!1,outputFormat:_??`text`,inputFormat:v??`text`,numAllowedTools:s.length,numDisallowedTools:c.length,mcpClientCount:Object.keys(kt).length,worktreeEnabled:b,skipWebFetchPreflight:Oi().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:i??!1,permissionMode:C,modeIsBypass:C===`bypassPermissions`,allowDangerouslySkipPermissionsPassed:a,systemPromptFlag:ke?t.systemPromptFile?`file`:`flag`:void 0,appendSystemPromptFlag:S?t.appendSystemPromptFile?`file`:`flag`:void 0,thinkingConfig:F,assistantActivationPath:void 0}),pn(N,T),ul(),Ae().then(e=>{e&&(it&&wt(it),Te().then(e=>{e>=2&&J(`tengu_concurrent_sessions`,{num_sessions:e})}))}),d()||(x?(await At(),Y(`action_after_plugins_init`),ze().then(()=>Kn())):At().then(async()=>{Y(`action_after_plugins_init`),await ze(),Kn()}));let $t=pe||fe?`init`:ge?`maintenance`:null;if(pe){ns(),await we(`init`,{forceSyncExecution:!0}),await St(`startup`,{forceSyncExecution:!0}),Mt(0);return}if(x){(_===`stream-json`||_===`json`)&&ii(!0),ns(),Vs();let e=t.continue||t.resume||$t?void 0:St(`startup`);e?.catch(()=>{}),Y(`before_validateForceLoginOrg`);let n=await ba();n.valid||(process.stderr.write(`${n.message}\n`),process.exit(1));let r=_e?[]:ut.filter(e=>e.type===`prompt`&&!e.disableNonInteractive||e.type===`local`&&e.supportsNonInteractive),i=Ge(),a=Ke({...i,mcp:{...i.mcp,clients:Bt,commands:qt,tools:Ht},toolPermissionContext:T,...ya()&&{fastMode:pa(A??null)},...ft()&&j&&{advisorModel:j}},$o);Re(T,a.getState().fastMode).then(({updateContext:e})=>{a.setState(t=>{let n=e(t.toolPermissionContext);return n===t.toolPermissionContext?t:{...t,toolPermissionContext:n}})}),t.sessionPersistence===!1&&Cr(!0),br(ja(ee));let o=(e,t)=>Object.keys(e).length===0?Promise.resolve():(a.setState(t=>({...t,mcp:{...t.mcp,clients:[...t.mcp.clients,...Object.entries(e).map(([e,t])=>({name:e,type:`pending`,config:t}))]}})),hn(({client:e,tools:t,commands:n})=>{a.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:Ft([...r.mcp.tools,...t],`name`),commands:Ft([...r.mcp.commands,...n],`name`)}}))},e).catch(e=>z(`[MCP] ${t} connect error: ${e}`)));Y(`before_connectMcp`),await o(N,`regular`),Y(`after_connectMcp`);let c=5e3,l=Be.then(e=>{if(Object.keys(e).length>0){let t=new Set;for(let n of Object.values(e)){let e=vn(n);e&&t.add(e)}let n=new Set;for(let[e,r]of Object.entries(N)){if(!e.startsWith(`plugin:`))continue;let i=vn(r);i&&t.has(i)&&n.add(e)}if(n.size>0){z(`[MCP] Lazy dedup: suppressing ${n.size} plugin server(s) that duplicate claude.ai connectors: ${[...n].join(`, `)}`);for(let e of a.getState().mcp.clients)!n.has(e.name)||e.type!==`connected`||(e.client.onclose=void 0,Ct(e.name,e.config).catch(()=>{}));a.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=ue(i,e),a=yt(a,e);return{...e,mcp:{...e.mcp,clients:t,tools:r,commands:i,resources:a}}})}}let{servers:t}=Jt(e,Gi(N,(e,t)=>!t.startsWith(`plugin:`)));return o(t,`claudeai`)}),u,f=await Promise.race([l.then(()=>!1),new Promise(e=>{u=setTimeout(e=>e(!0),c,e)})]);u&&clearTimeout(u),f&&z(`[MCP] claude.ai connectors not ready after ${c}ms — proceeding; background connection continues`),Y(`after_connectMcp_claudeai`),d()||(_l(),import(`./backgroundHousekeeping-DYz83_8C.js`).then(e=>e.startBackgroundHousekeeping())),dl(),Y(`before_print_import`);let{runHeadless:p}=await import(`./print-u6MzL5Cr.js`);Y(`after_print_import`),p(E,()=>a.getState(),a.setState,r,qe,jt,ht.activeAgents,{continue:t.continue,resume:t.resume,verbose:ce,outputFormat:_,jsonSchema:D,permissionPromptToolName:t.permissionPromptTool,allowedTools:s,thinkingConfig:F,maxTurns:t.maxTurns,maxBudgetUsd:t.maxBudgetUsd,taskBudget:t.taskBudget?{total:t.taskBudget}:void 0,systemPrompt:ke,appendSystemPrompt:S,userSpecifiedModel:A,fallbackModel:ot,sdkUrl:Ee,replayUserMessages:et,includePartialMessages:Oe,forkSession:t.forkSession||!1,resumeSessionAt:t.resumeSessionAt||void 0,rewindFiles:t.rewindFiles,enableAuthStatus:t.enableAuthStatus,agent:g,workload:t.workload,setupTrigger:$t??void 0,sessionStartHooksPromise:e});return}J(`tengu_startup_manual_model_config`,{cli_flag:t.model,env_var:process.env.ANTHROPIC_MODEL,settings_file:Oi()?.model,subscriptionType:$a(),agent:gt});let tn=cs(xt),nn=[];je&&nn.push({key:`permission-mode-notification`,text:je,priority:`high`}),tn&&nn.push({key:`model-deprecation-warning`,text:tn,color:`warning`,priority:`high`});let rn={...T},I={settings:Oi(),tasks:{},agentNameRegistry:new Map,verbose:ce??U().verbose??!1,mainLoopModel:_t,mainLoopModelForSession:null,expandedView:U().showExpandedTodos?`tasks`:`none`,selectedIPAgentIndex:-1,selectedBgAgentIndex:-1,viewSelectionMode:`none`,footerSelection:null,toolPermissionContext:rn,agent:k?.agentType,agentDefinitions:ht,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,notifications:{current:null,queue:nn},elicitation:{queue:[]},todos:{},fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:ae(),thinkingEnabled:P,promptSuggestionEnabled:Ye(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:ve,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},authVersion:0,initialMessage:E?{message:De({content:String(E)})}:null,activeOverlays:new Set,fastMode:pa(xt),...ft()&&j&&{advisorModel:j}};E&&Io(String(E));let sn=Ht;G(e=>({...e,numStartups:(e.numStartups??0)+1})),setImmediate(()=>{pl(),dl()});let cn={debug:n||r,commands:[...ut,...qt],initialTools:sn,mcpClients:Bt,autoConnectIdeFlag:te,mainThreadAgentDefinition:k,disableSlashCommands:_e,dynamicMcpConfig:w,strictMcpConfig:Pe,systemPrompt:ke,appendSystemPrompt:S,thinkingConfig:F},ln={mainThreadAgentDefinition:k,agentDefinitions:ht,currentCwd:ct,cliAgents:pt,initialState:I};if(t.continue){let e=!1;try{let n=performance.now(),{clearSessionCaches:r}=await import(`./caches-6Nx6tsk9.js`);r();let i=await Uo(void 0,void 0);if(!i)return J(`tengu_continue`,{success:!1}),await lc(M,`No conversation found to continue`);let a=await Go(i,{forkSession:!!t.forkSession,includeAttribution:!0,transcriptPath:i.fullPath},ln);a.restoredAgentDef&&(k=a.restoredAgentDef),El(t),J(`tengu_continue`,{success:!0,resume_duration_ms:Math.round(performance.now()-n)}),e=!0,await Ws(M,{getFpsMetrics:Tt,stats:Et,initialState:a.initialState},{...cn,mainThreadAgentDefinition:a.restoredAgentDef??k,initialMessages:a.messages,initialFileHistorySnapshots:a.fileHistorySnapshots,initialContentReplacements:a.contentReplacements,initialAgentName:a.agentName,initialAgentColor:a.agentColor},fc)}catch(t){e||J(`tengu_continue`,{success:!1}),K(t),process.exit(1)}}else if(t.resume||t.fromPr){let{clearSessionCaches:e}=await import(`./caches-6Nx6tsk9.js`);e();let n,r=We(t.resume),i,a=null,o;if(t.fromPr&&(t.fromPr===!0?o=!0:typeof t.fromPr==`string`&&(o=t.fromPr)),t.resume&&typeof t.resume==`string`&&!r){let e=t.resume.trim();if(e){let t=await Vt(e,{exact:!0});t.length===1?(a=t[0],r=Ut(a)??null):i=e}}if(r){let e=r;try{let r=performance.now(),i=await Uo(a??e,void 0);if(!i)return J(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),await lc(M,`No conversation found with session ID: ${e}`);let o=a?.fullPath??i.fullPath;n=await Go(i,{forkSession:!!t.forkSession,sessionIdOverride:e,transcriptPath:o},ln),n.restoredAgentDef&&(k=n.restoredAgentDef),J(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!0,resume_duration_ms:Math.round(performance.now()-r)})}catch(t){J(`tengu_session_resumed`,{entrypoint:`cli_flag`,success:!1}),K(t),await lc(M,`Failed to resume session ${e}`)}}let s=n??(Array.isArray(null)?{messages:null,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:k,initialState:I,contentReplacements:void 0}:void 0);s?(El(t),await Ws(M,{getFpsMetrics:Tt,stats:Et,initialState:s.initialState},{...cn,mainThreadAgentDefinition:s.restoredAgentDef??k,initialMessages:s.messages,initialFileHistorySnapshots:s.fileHistorySnapshots,initialContentReplacements:s.contentReplacements,initialAgentName:s.agentName,initialAgentColor:s.agentColor},fc)):await gc(M,{getFpsMetrics:Tt,stats:Et,initialState:I},Vn(Mr()),{...cn,initialSearchQuery:i,forkSession:t.forkSession,filterByPr:o})}else{let e=Lt&&Rt.length===0?Lt:void 0;Y(`action_after_hooks`),El(t);let n=null;t.deepLinkOrigin?(J(`tengu_deep_link_opened`,{has_prefill:!!t.prefill,has_repo:!!t.deepLinkRepo}),n=Wn(ss({cwd:Kr(),prefillLength:t.prefill?.length,repo:t.deepLinkRepo,lastFetch:t.deepLinkLastFetch===void 0?void 0:new Date(t.deepLinkLastFetch)}),`warning`)):t.prefill&&(n=Wn(`Launched with a pre-filled prompt — review it before pressing Enter.`,`warning`));let r=n?[n,...Rt]:Rt.length>0?Rt:void 0;await Ws(M,{getFpsMetrics:Tt,stats:Et,initialState:I},{...cn,initialMessages:r,pendingHookMessages:e},fc)}}).version(`0.0.22 (Work Mate)`,`-v, --version`,`Output the version number`),t.option(`-w, --worktree [name]`,`Create a new git worktree for this session (optionally specify a name)`),t.option(`--tmux`,`Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.`),Un()&&t.addOption(new Q(`--advisor <model>`,`Enable the server-side advisor tool with the specified model (alias or full ID).`).hideHelp()),t.addOption(new Q(`--enable-auto-mode`,`Opt in to auto mode`).hideHelp()),t.addOption(new Q(`--proactive`,`Start in proactive autonomous mode`)),Y(`run_main_options_built`);let n=process.argv.includes(`-p`)||process.argv.includes(`--print`),r=process.argv.some(e=>e.startsWith(`cc://`)||e.startsWith(`cc+unix://`));if(n&&!r)return Y(`run_before_parse`),await t.parseAsync(process.argv),Y(`run_after_parse`),t;let i=t.command(`mcp`).description(`Configure and manage MCP servers`).configureHelp(e()).enablePositionalOptions();i.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-Bsw3cMiJ.js`);await n({debug:e,verbose:t})}),el(i),Be()&&tl(i),i.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-Bsw3cMiJ.js`);await n(e,t)}),i.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-Bsw3cMiJ.js`);await e()}),i.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-Bsw3cMiJ.js`);await t(e)}),i.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-Bsw3cMiJ.js`);await r(e,t,n)}),i.command(`add-from-claude-desktop`).description(`Import MCP servers from Work Mate 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-Bsw3cMiJ.js`);await t(e)}),i.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-Bsw3cMiJ.js`);await e()});let a=t.command(`auth`).description(`Manage authentication`).configureHelp(e());a.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 Work Mate subscription`).option(`--claudeai`,`Use Work Mate subscription (default)`).action(async({email:e,sso:t,console:n,claudeai:r})=>{let{authLogin:i}=await import(`./auth-Bbc0Ny8i.js`);await i({email:e,sso:t,console:n,claudeai:r})}),a.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-Bbc0Ny8i.js`);await t(e)});let o=()=>new Q(`--cowork`,`Use cowork_plugins directory`).hideHelp(),s=t.command(`plugin`).alias(`plugins`).description(`Manage Work Mate plugins`).configureHelp(e());s.command(`validate <path>`).description(`Validate a plugin or marketplace manifest`).addOption(o()).action(async(e,t)=>{let{pluginValidateHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),s.command(`list`).description(`List installed plugins`).option(`--json`,`Output as JSON`).option(`--available`,`Include available plugins from marketplaces (requires --json)`).addOption(o()).action(async e=>{let{pluginListHandler:t}=await import(`./plugins-CTM8jpOw.js`);await t(e)});let c=s.command(`marketplace`).description(`Manage Work Mate marketplaces`).configureHelp(e());return c.command(`add <source>`).description(`Add a marketplace from a URL, path, or GitHub repo`).addOption(o()).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-CTM8jpOw.js`);await n(e,t)}),c.command(`list`).description(`List all configured marketplaces`).option(`--json`,`Output as JSON`).addOption(o()).action(async e=>{let{marketplaceListHandler:t}=await import(`./plugins-CTM8jpOw.js`);await t(e)}),c.command(`remove <name>`).alias(`rm`).description(`Remove a configured marketplace`).addOption(o()).action(async(e,t)=>{let{marketplaceRemoveHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),c.command(`update [name]`).description(`Update marketplace(s) from their source - updates all if no name specified`).addOption(o()).action(async(e,t)=>{let{marketplaceUpdateHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),s.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(o()).action(async(e,t)=>{let{pluginInstallHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),s.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 (~/.workmate/plugins/data/{id}/)`).addOption(o()).action(async(e,t)=>{let{pluginUninstallHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),s.command(`enable <plugin>`).description(`Enable a disabled plugin`).option(`-s, --scope <scope>`,`Installation scope: ${Ho.join(`, `)} (default: auto-detect)`).addOption(o()).action(async(e,t)=>{let{pluginEnableHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),s.command(`disable [plugin]`).description(`Disable an enabled plugin`).option(`-a, --all`,`Disable all enabled plugins`).option(`-s, --scope <scope>`,`Installation scope: ${Ho.join(`, `)} (default: auto-detect)`).addOption(o()).action(async(e,t)=>{let{pluginDisableHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),s.command(`update <plugin>`).description(`Update a plugin to the latest version (restart required to apply)`).option(`-s, --scope <scope>`,`Installation scope: ${Bo.join(`, `)} (default: user)`).addOption(o()).action(async(e,t)=>{let{pluginUpdateHandler:n}=await import(`./plugins-CTM8jpOw.js`);await n(e,t)}),t.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-DLz0kfsr.js`);await e(),process.exit(0)}),t.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-Bq5l7FF5.js`),import(`./src-9vmGsuSI.js`)]);await e(await t(rs(!1)))}),t.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-Bq5l7FF5.js`);await n(e,t)}),Y(`run_before_parse`),await t.parseAsync(process.argv),Y(`run_after_parse`),Y(`main_after_run`),ca(),t}async function Tl({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:i,print:a,outputFormat:o,inputFormat:s,numAllowedTools:c,numDisallowedTools:l,mcpClientCount:u,worktreeEnabled:p,skipWebFetchPreflight:m,githubActionInputs:ee,dangerouslySkipPermissionsPassed:te,permissionMode:h,modeIsBypass:ne,allowDangerouslySkipPermissionsPassed:re,systemPromptFlag:ie,appendSystemPromptFlag:g,thinkingConfig:ae,assistantActivationPath:oe}){try{J(`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:p,skipWebFetchPreflight:m,...ee&&{githubActionInputs:ee},dangerouslySkipPermissionsPassed:te,permissionMode:h,modeIsBypass:ne,inProtectedNamespace:f(),allowDangerouslySkipPermissionsPassed:re,thinkingType:ae.type,...ae.type===`enabled`&&{thinkingBudgetTokens:ae.budgetTokens},...ie&&{systemPromptFlag:ie},...g&&{appendSystemPromptFlag:g},is_simple:d()||void 0,...oe&&{assistantActivationPath:oe},autoUpdatesChannel:Oi().autoUpdatesChannel??`latest`})}catch(e){K(e)}}function El(t){if(t.proactive||l(process.env.CLAUDE_CODE_PROACTIVE)){let t=(dt(),e(v));t.isProactiveActive()||t.activateProactive(`command`)}}function Dl(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(ar)}export{Sl as main};
|