@readmagic/workmate 0.0.2 → 0.0.4
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-BgNp7glC.js → AddWorkspaceDirectory-BTC7FPqM.js} +1 -1
- package/dist/chunks/{App-Coboqa8H.js → App-DOm71vtY.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CYpBbj0k.js → ApproveApiKey-9YQzwrrC.js} +1 -1
- package/dist/chunks/ApproveApiKey-LPrZMlgU.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DxKsTdqj.js → AssistantSessionChooser-CnYfFWrx.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-D_UHm7xo.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-Cx3QGFz-.js → BypassPermissionsModeDialog-DAq-qbqC.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog--w2zWWEn.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BAK9fxwg.js → ClaudeMdExternalIncludesDialog-CyvidoR3.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BXdC6j3_.js +1 -0
- package/dist/chunks/{DesktopHandoff-BsHgLlTy.js → DesktopHandoff-gRvy-WlW.js} +1 -1
- package/dist/chunks/{DiffDialog-BgTW2Znv.js → DiffDialog-CdfVTgOx.js} +2 -2
- package/dist/chunks/Doctor-BuiYwjAS.js +1 -0
- package/dist/chunks/Doctor-DKlHJBXq.js +3 -0
- package/dist/chunks/ExitFlow-rExuBL3w.js +2 -0
- package/dist/chunks/Feedback-gGpjUC_F.js +2 -0
- package/dist/chunks/{Grove-Dsi4yU08.js → Grove-CD769Wvw.js} +1 -1
- package/dist/chunks/Grove-ENfM8hC6.js +1 -0
- package/dist/chunks/{HybridTransport-8qA64lCx.js → HybridTransport-kN1jmg26.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-CAZ1z5WG.js → InvalidConfigDialog-BpJub73a.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-D82Qk_MR.js → InvalidSettingsDialog-DzOp3Ihx.js} +1 -1
- package/dist/chunks/MCPConnectionManager-CaBvO7NB.js +1 -0
- package/dist/chunks/{McpParsingWarnings-8ZueNqAd.js → McpParsingWarnings-Cc6FWyU4.js} +1 -1
- package/dist/chunks/MessageSelector-DOB1S2-O.js +3 -0
- package/dist/chunks/Messages-Clihwd2F.js +11 -0
- package/dist/chunks/{Onboarding-CUztnbbv.js → Onboarding-D00lTweB.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-DSgrZvMv.js → OverageCreditUpsell-B-Bf_-UX.js} +1 -1
- package/dist/chunks/PluginSettings-DUxj_oAg.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-IaihWay3.js → PromptInputFooterSuggestions-MwS_cExV.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-okS2rQ4k.js → PromptInputHelpMenu-V2dEpzhC.js} +1 -1
- package/dist/chunks/QueryEngine-BLcPQYq_.js +1 -0
- package/dist/chunks/{REPL-Dto012J0.js → REPL-B_E07dnf.js} +44 -44
- package/dist/chunks/REPL-BhURgntS.js +1 -0
- package/dist/chunks/{RemoteCallout-C_UIYnuT.js → RemoteCallout-ChCjmgw1.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-CuSSHAXN.js → RemoteSessionManager-B43isWQs.js} +2 -2
- package/dist/chunks/ResumeConversation-DaQ9n8_C.js +1 -0
- package/dist/chunks/{SSETransport-Chj_yfPv.js → SSETransport-h43pQVlJ.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-DSq7beKs.js +1 -0
- package/dist/chunks/Settings-CNsaWv8g.js +2 -0
- package/dist/chunks/{TeleportProgress-DP1a8jit.js → TeleportProgress-QtJrXSCX.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B6sTwXuZ.js → TeleportRepoMismatchDialog-D-HVj-A6.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-CKUuRQSG.js → TeleportResumeWrapper-C6sbzJsJ.js} +1 -1
- package/dist/chunks/{ThemePicker-Dyq1YVhb.js → ThemePicker-CqPCp5Hs.js} +1 -1
- package/dist/chunks/TrustDialog-CeVwxDlZ.js +1 -0
- package/dist/chunks/{ValidationErrorsList-DUNh4BNa.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
- package/dist/chunks/{WelcomeV2-TPbOXGrO.js → WelcomeV2-DNiXQ5ES.js} +1 -1
- package/dist/chunks/{add-dir-Bf_5tCeR.js → add-dir-V3xjklnJ.js} +1 -1
- package/dist/chunks/{agentDisplay-CCeYiAta.js → agentDisplay-BuiwcrQi.js} +1 -1
- package/dist/chunks/{agents-Bt72Gz1v.js → agents-D7um1IXM.js} +7 -7
- package/dist/chunks/{agents-T8xHY5Wk.js → agents-ZY6IaVE7.js} +1 -1
- package/dist/chunks/{allErrors-CDWTJcMw.js → allErrors-CHVdQ3fT.js} +1 -1
- package/dist/chunks/{ant-DRF-v5bA.js → ant-D66LZCap.js} +1 -1
- package/dist/chunks/api-C-rOQY-l.js +1 -0
- package/dist/chunks/api-Dmn7DUgU.js +1 -0
- package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
- package/dist/chunks/{asciicast-CQJlNTae.js → asciicast-CbAjUHT_.js} +4 -4
- package/dist/chunks/{assistant-z1ojxEET.js → assistant-CYF7ch7C.js} +1 -1
- package/dist/chunks/auth-C4Rvit2q.js +1 -0
- package/dist/chunks/auth-Cj7EX1eG.js +1 -0
- package/dist/chunks/auth-DAxGNCIR.js +15 -0
- package/dist/chunks/{autoMode-DW_H3i37.js → autoMode-TysBQkU_.js} +5 -5
- package/dist/chunks/{autonomy-OxhciwYa.js → autonomy-CNEbT-t_.js} +7 -7
- package/dist/chunks/{autonomy-46hnmyAi.js → autonomy-k3QPea5z.js} +1 -1
- package/dist/chunks/{autonomyPanel-CTEjq0Bd.js → autonomyPanel-DiztRblF.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-Cpxq4krt.js → backgroundHousekeeping-C9m4tiFi.js} +3 -3
- package/dist/chunks/backgroundHousekeeping-DQjzXBe0.js +1 -0
- package/dist/chunks/{banner-BVkLvJiB.js → banner-CWkrK10u.js} +1 -1
- package/dist/chunks/bg-B0iMGM9C.js +1 -0
- package/dist/chunks/{bg-zWGqkcST.js → bg-WnYN5ifx.js} +2 -2
- package/dist/chunks/{branch-DJzijRGm.js → branch-_NBgDfrK.js} +1 -1
- package/dist/chunks/{bridge-Dpr2AWpc.js → bridge-DpmFl8p8.js} +2 -2
- package/dist/chunks/{bridgeConfig-DDF3teRE.js → bridgeConfig-DMBOO3gW.js} +1 -1
- package/dist/chunks/bridgeConfig-DsI5d0s7.js +1 -0
- package/dist/chunks/bridgeEnabled-DZzlF2d8.js +1 -0
- package/dist/chunks/{bridgeEnabled-D4JDZd0y.js → bridgeEnabled-FjPuA7zx.js} +1 -1
- package/dist/chunks/bridgeMain-BppY0KW3.js +68 -0
- package/dist/chunks/bridgeMain-BrY4tkF6.js +1 -0
- package/dist/chunks/bridgeMessaging-N5zlzCCr.js +1 -0
- package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
- package/dist/chunks/{browser-BKiu1max.js → browser-BmZuQom6.js} +1 -1
- package/dist/chunks/{btw-DG9CCeq4.js → btw-BFRje_Zi.js} +1 -1
- package/dist/chunks/caches-BBLH8G1I.js +1 -0
- package/dist/chunks/{caches-BB5_91gU.js → caches-CcfPJ4_A.js} +2 -2
- package/dist/chunks/ccrClient-q2JCVCU2.js +1 -0
- package/dist/chunks/{claudeDesktop-9xfIgkzE.js → claudeDesktop-Cx31Ugjp.js} +1 -1
- package/dist/chunks/{clear-ueMvDelv.js → clear-CxY7W5Wt.js} +1 -1
- package/dist/chunks/{cliLaunch-BJ9o-rIV.js → cliLaunch-BkPAatcs.js} +1 -1
- package/dist/chunks/client-CtVu3BLD.js +1 -0
- package/dist/chunks/{color-B0-MIfsq.js → color-DOWhfjnA.js} +1 -1
- package/dist/chunks/commands-BWw1sQeH.js +1 -0
- package/dist/chunks/{commitAttribution-DKun9CeU.js → commitAttribution-CLbEIaRJ.js} +2 -2
- package/dist/chunks/commitAttribution-DIT_s0vY.js +1 -0
- package/dist/chunks/compact-CaOnQVkH.js +2 -0
- package/dist/chunks/{completionCache-CdHCuiqq.js → completionCache-MN3_MqK8.js} +2 -2
- package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
- package/dist/chunks/config-DiT2Z8dY.js +3 -0
- package/dist/chunks/config-DmPGzNmi.js +1 -0
- package/dist/chunks/config-HHTwEsWp.js +1 -0
- package/dist/chunks/{context-DBswG0EY.js → context-B2OvKo2t.js} +1 -1
- package/dist/chunks/context-noninteractive-BilCSCV1.js +1 -0
- package/dist/chunks/{context-noninteractive-CTvyNimw.js → context-noninteractive-BuGxX3YL.js} +2 -2
- package/dist/chunks/conversation-BWXf3un9.js +1 -0
- package/dist/chunks/conversation-awh8AwwL.js +1 -0
- package/dist/chunks/{createSSHSession-BdO35H6o.js → createSSHSession-C-c7I5iJ.js} +5 -5
- package/dist/chunks/{createSession-Br1g8qSD.js → createSession-D_fIDqgc.js} +1 -1
- package/dist/chunks/createSession-Hvpx3Le7.js +1 -0
- package/dist/chunks/crossProjectResume-_XjvSXA3.js +40 -0
- package/dist/chunks/{daemon-BQiSFjc-.js → daemon-YtZbMQtn.js} +1 -1
- package/dist/chunks/datadog-Ed8emSFA.js +1 -0
- package/dist/chunks/{debug-DiuXEmUq.js → debug-BrXObCdR.js} +1 -1
- package/dist/chunks/{debugUtils-3YYWvb3H.js → debugUtils-NO5KtXqi.js} +1 -1
- package/dist/chunks/{desktop-W7SA8BFk.js → desktop-D_ofPlyi.js} +1 -1
- package/dist/chunks/{detached-Cv9gAylK.js → detached-TYk4hMFj.js} +1 -1
- package/dist/chunks/{detectRepository-B1PMTLAU.js → detectRepository-BPr0VWNO.js} +1 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
- package/dist/chunks/{diff-CMtRjFUb.js → diff-CUAgBDu1.js} +1 -1
- package/dist/chunks/{directoryCompletion-CeV63gvu.js → directoryCompletion-CW2ckkQg.js} +1 -1
- package/dist/chunks/doctor-CkdQ7Fv7.js +1 -0
- package/dist/chunks/{effort-BAlVDBHq.js → effort-DCgooYMY.js} +2 -2
- package/dist/chunks/{entry-DLqeVq5C.js → entry-Bh0gPOAo.js} +4 -4
- package/dist/chunks/envLessBridgeConfig-DJHZAlU-.js +1 -0
- package/dist/chunks/envLessBridgeConfig-sxodu0xO.js +1 -0
- package/dist/chunks/esm-B62dCLgf.js +1 -0
- package/dist/chunks/{execFileNoThrow-DResQRvR.js → execFileNoThrow-D244NytW.js} +1 -1
- package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
- package/dist/chunks/exit-CFJR3NfE.js +1 -0
- package/dist/chunks/extra-usage-CjaHpu8y.js +1 -0
- package/dist/chunks/extra-usage-D1Y-3OWQ.js +1 -0
- package/dist/chunks/{extra-usage-core-Dh4rVUI-.js → extra-usage-core-B6ga8Rni.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-D4Ya5KPm.js → extra-usage-noninteractive-Dc9AndId.js} +1 -1
- package/dist/chunks/{extraUsage-DtWi8E78.js → extraUsage-2DwLEr26.js} +1 -1
- package/dist/chunks/extractMemories-C3qrwpu2.js +1 -0
- package/dist/chunks/{fast-DkUxqWhE.js → fast-CW_NsL0x.js} +1 -1
- package/dist/chunks/fast-D3CPmUX4.js +1 -0
- package/dist/chunks/{feedback-Cn7Sbqxa.js → feedback-BpRorTAC.js} +1 -1
- package/dist/chunks/{file-BZriE-XU.js → file-DcZWPH2V.js} +5 -5
- package/dist/chunks/firstPartyEventLogger-CuUiNdj8.js +5 -0
- package/dist/chunks/firstPartyEventLogger-DPUQnc6J.js +1 -0
- package/dist/chunks/{flushGate-ebqQZF1t.js → flushGate-BltVae97.js} +1 -1
- package/dist/chunks/gemini-YyIxfveQ.js +1 -0
- package/dist/chunks/generateRecap-tx4wLIkI.js +1 -0
- package/dist/chunks/{generateSessionName-DEAw5x_h.js → generateSessionName-BkDigIN8.js} +1 -1
- package/dist/chunks/{genericProcessUtils-DO7Fy0RJ.js → genericProcessUtils-CdQTApYX.js} +1 -1
- package/dist/chunks/git-CbcnOf0E.js +1 -0
- package/dist/chunks/git-Do0wJvux.js +6 -0
- package/dist/chunks/{githubRepoPathMapping-Tt-LdYFZ.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
- package/dist/chunks/{goal-DCaI1NPN.js → goal-DZrD4puM.js} +3 -3
- package/dist/chunks/{grok-CKlngG3b.js → grok-BZf7W_hL.js} +1 -1
- package/dist/chunks/{grove-DSWe6psK.js → grove-CFBPplP6.js} +2 -2
- package/dist/chunks/{heapdump-OVbV05On.js → heapdump-DWc3Z2NO.js} +5 -5
- package/dist/chunks/{help-CRtX5VX9.js → help-pap9jNUJ.js} +1 -1
- package/dist/chunks/{hooks-tpf90xd5.js → hooks-Bmat0L6A.js} +2 -2
- package/dist/chunks/hooks-cCAzfabs.js +1 -0
- package/dist/chunks/{hostGuard-t7QfbijF.js → hostGuard-C5xydXZI.js} +1 -1
- package/dist/chunks/inboundAttachments-DZgSqDwY.js +1 -0
- package/dist/chunks/inboundAttachments-DkfNHtF9.js +1 -0
- package/dist/chunks/initReplBridge-myzllvlk.js +1 -0
- package/dist/chunks/install-D4jmHjmk.js +1 -0
- package/dist/chunks/{instrumentation--Sx0y1Gk.js → instrumentation-Nqgm1SMw.js} +6 -6
- package/dist/chunks/{job-D7B35Usp.js → job-CT9bcgPb.js} +1 -1
- package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
- package/dist/chunks/keybindings-DETOn3qJ.js +2 -0
- package/dist/chunks/{language-8Rnu_qxl.js → language-BA5WprZv.js} +1 -1
- package/dist/chunks/language-BbaOTWm3.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-CNPkOVzu.js → launchAgentsPlatform-CuRQgd2Q.js} +1 -1
- package/dist/chunks/{launchLocalMemory-BxmDhENs.js → launchLocalMemory-CRMqifzn.js} +2 -2
- package/dist/chunks/{launchLocalVault-DQlTGA-g.js → launchLocalVault-DlKX_oDE.js} +3 -3
- package/dist/chunks/{launchMemoryStores-EYAwxI8i.js → launchMemoryStores-CN0ecWpP.js} +1 -1
- package/dist/chunks/{launchOnboarding-CTu5Zf4E.js → launchOnboarding-DTdUA_wE.js} +1 -1
- package/dist/chunks/{launchSchedule-CeHHSvO7.js → launchSchedule-psiSLmTA.js} +1 -1
- package/dist/chunks/{launchSkillStore-Bqh2Fru2.js → launchSkillStore-CQQ00Ads.js} +1 -1
- package/dist/chunks/{launchTeleport-Crc3XVZX.js → launchTeleport-CXFRPVMR.js} +1 -1
- package/dist/chunks/{launchVault-BHLgpth_.js → launchVault-Dn6jq0Rc.js} +1 -1
- package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
- package/dist/chunks/{loadAgentsDir-ZQwvbURI.js → loadAgentsDir-BURvZNN6.js} +685 -683
- package/dist/chunks/loadAgentsDir-Db9UTm45.js +1 -0
- package/dist/chunks/loadPluginHooks-C9A9oS-w.js +1 -0
- package/dist/chunks/{localSearch-H0LchlTi.js → localSearch-D2Rs8wQP.js} +1 -1
- package/dist/chunks/localSearch-hBh1ATr2.js +1 -0
- package/dist/chunks/{log-Duzb4o6h.js → log-BMCygSzM.js} +1 -1
- package/dist/chunks/{logoV2Utils-5lcUu53m.js → logoV2Utils-DN9nzdX-.js} +1 -1
- package/dist/chunks/{magicDocs-D1FIPmYg.js → magicDocs-DIeTcwAA.js} +3 -3
- package/dist/chunks/{main-B8XtFN2P.js → main-CI54PZrG.js} +78 -78
- package/dist/chunks/{main-CR7cXdgy.js → main-D862LI_d.js} +2 -2
- package/dist/chunks/{mappers-DKU4RgE3.js → mappers-Q_Z3Kjo-.js} +1 -1
- package/dist/chunks/mcp-CtbhGaLC.js +2 -0
- package/dist/chunks/mcp-DMacvhqZ.js +1 -0
- package/dist/chunks/mcp-RvwPC7FB.js +6 -0
- package/dist/chunks/{memoize-DgMjqLtn.js → memoize-B0zhbT8Z.js} +1 -1
- package/dist/chunks/{memory-D-Q62bJ7.js → memory-BPN8gW7n.js} +1 -1
- package/dist/chunks/{mode-DFZgqKBd.js → mode-Jl_Boaym.js} +2 -2
- package/dist/chunks/model-BIVmcl_N.js +1 -0
- package/dist/chunks/{model-fDWtIRVr.js → model-CWBwPvTH.js} +1 -1
- package/dist/chunks/model-DlVpqR0P.js +1 -0
- package/dist/chunks/nativeInstaller-8arnRiUO.js +1 -0
- package/dist/chunks/{onChangeAppState-DaQ0R9Tw.js → onChangeAppState-DBantDJ6.js} +1 -1
- package/dist/chunks/{openai-DNS0-ivj.js → openai-yin1iDG8.js} +3 -3
- package/dist/chunks/{overageCreditGrant-qHN3tnp2.js → overageCreditGrant-CN_sVURL.js} +1 -1
- package/dist/chunks/{panelCall-BvKpHquo.js → panelCall-CPKC6VR5.js} +1 -1
- package/dist/chunks/parser-Bf6iasPV.js +1 -0
- package/dist/chunks/{parser-TYEkLFgh.js → parser-DFwaTGf7.js} +1 -1
- package/dist/chunks/{partition-Cv11dD5P.js → partition-CW0BJ881.js} +1 -1
- package/dist/chunks/{passes-DQdM2Ssq.js → passes-DOm9ukdK.js} +1 -1
- package/dist/chunks/{path-Cu_AKqg6.js → path-D5U-tm91.js} +1 -1
- package/dist/chunks/permissions-CxDJ__l6.js +3 -0
- package/dist/chunks/pidLock-C69HNTTb.js +3 -0
- package/dist/chunks/{pipeTransport-7GIO6GCA.js → pipeTransport-CqCnc-Ys.js} +1 -1
- package/dist/chunks/{plan-D8dQDl8W.js → plan-B0rEs32a.js} +1 -1
- package/dist/chunks/{platform-B5dCGT8t.js → platform-BrYefG_2.js} +1 -1
- package/dist/chunks/{plugin-w8MqsKHn.js → plugin-BSEMgcGu.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-7FFHzSRz.js → pluginAutoupdate-CTByPD8J.js} +1 -1
- package/dist/chunks/pluginBlocklist-mogKaK0p.js +1 -0
- package/dist/chunks/pluginCliCommands-DQQ7C7kk.js +1 -0
- package/dist/chunks/{pluginFlagging-_WUQP3Lq.js → pluginFlagging-mHNff1t9.js} +1 -1
- package/dist/chunks/pluginOperations-JEedVzfS.js +2 -0
- package/dist/chunks/pluginStartupCheck-D7ts2V3p.js +1 -0
- package/dist/chunks/{pluginStartupCheck-BelpzwZI.js → pluginStartupCheck-RscVZDi4.js} +1 -1
- package/dist/chunks/plugins-Cr03lISA.js +4 -0
- package/dist/chunks/policyLimits-DWtLyJ4n.js +1 -0
- package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
- package/dist/chunks/{poor-D3T_8wwf.js → poor-DekfGNT7.js} +1 -1
- package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
- package/dist/chunks/{poorMode-BqyVuBu-.js → poorMode-CtcqaiwD.js} +1 -1
- package/dist/chunks/print-CZUmAzmt.js +23 -0
- package/dist/chunks/{privacy-settings-D5zxu4Aa.js → privacy-settings-CwJ1H8Ua.js} +1 -1
- package/dist/chunks/processBashCommand-aKNneP2u.js +1 -0
- package/dist/chunks/processSlashCommand-BcPnWNxZ.js +5 -0
- package/dist/chunks/prompt-CIyhCdkE.js +1 -0
- package/dist/chunks/prompt-DNDgGM9q.js +139 -0
- package/dist/chunks/prompt-DRhjinu2.js +1 -0
- package/dist/chunks/{promptEditor-D6HzjcMS.js → promptEditor-DMJyosKj.js} +2 -2
- package/dist/chunks/{protocolHandler-BXlx1N7v.js → protocolHandler-z2zxAtB1.js} +4 -4
- package/dist/chunks/{proxy-CHnxhNZI.js → proxy-CRN7jYIi.js} +3 -3
- package/dist/chunks/{rate-limit-options-1hc-RyNR.js → rate-limit-options--Y3oF1g0.js} +1 -1
- package/dist/chunks/rcDebugLog-DoL1FpGJ.js +11 -0
- package/dist/chunks/reconciler-CJcSh6xo.js +4 -0
- package/dist/chunks/{referral-Cu9bEOFE.js → referral-UKJv23_5.js} +1 -1
- package/dist/chunks/{refresh-vJbxW4a1.js → refresh-ul_i5R1a.js} +1 -1
- package/dist/chunks/{registerProtocol-B_XbLDQO.js → registerProtocol-CukLQuxJ.js} +3 -3
- package/dist/chunks/{release-notes-CavWoMQR.js → release-notes-CGv_6MMt.js} +1 -1
- package/dist/chunks/{releaseNotes-Di6OaHF7.js → releaseNotes-BKZNuDLD.js} +2 -2
- package/dist/chunks/{reload-plugins-ofeLn07p.js → reload-plugins-2W11dpLQ.js} +1 -1
- package/dist/chunks/{remote-env-dXzHAuD6.js → remote-env-D9xsoBfx.js} +1 -1
- package/dist/chunks/remoteBridgeCore-asY9JAXU.js +1 -0
- package/dist/chunks/remoteManagedSettings-Bxo3bv1U.js +1 -0
- package/dist/chunks/{rename-CtjP0lop.js → rename-CHsHMWpO.js} +1 -1
- package/dist/chunks/{renderOptions-DOXmueQV.js → renderOptions-BUJB9nAm.js} +1 -1
- package/dist/chunks/{resume-C5h5JvY1.js → resume-NduOaghx.js} +2 -2
- package/dist/chunks/{ripgrep-BN_g-F7X.js → ripgrep-BXmXjAzA.js} +1 -1
- package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
- package/dist/chunks/{runtimeObserver-B93v1AxE.js → runtimeObserver-BXbjibFk.js} +4 -4
- package/dist/chunks/{runtimeObserver-DOZFrqJu.js → runtimeObserver-Bo80nWQf.js} +1 -1
- package/dist/chunks/sandbox-adapter-DDfVl_2V.js +1 -0
- package/dist/chunks/{sandbox-toggle-TiLGFwaZ.js → sandbox-toggle-C-WCDRN4.js} +1 -1
- package/dist/chunks/searchExtraTools-BHWzsbNO.js +1 -0
- package/dist/chunks/{session-v9tKHhU9.js → session-pDd13-wE.js} +2 -2
- package/dist/chunks/{sessionDiscovery-4byQKOnc.js → sessionDiscovery-CSUnpsCy.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BZvxeufx.js +1 -0
- package/dist/chunks/sessionMemory-CAmpw2yb.js +1 -0
- package/dist/chunks/sessionMemory-DT0IkiA1.js +1 -0
- package/dist/chunks/sessionMemoryUtils-B4kGNH4j.js +1 -0
- package/dist/chunks/{sessionObserver-OgY9BUP4.js → sessionObserver-Ur7PqKl_.js} +1 -1
- package/dist/chunks/sessionObserver-oIkwTidC.js +1 -0
- package/dist/chunks/sessionStorage-DqARUj0K.js +1 -0
- package/dist/chunks/sessionTitle-pWMaI79N.js +14 -0
- package/dist/chunks/{sessionTracing-BBxhPccY.js → sessionTracing-CCPRzOvy.js} +3 -3
- package/dist/chunks/settings-DfWP5y6X.js +19 -0
- package/dist/chunks/settingsSync-D_4P3Esd.js +1 -0
- package/dist/chunks/setup-JHvhWKh9.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DDSOFi1W.js → shadowedRuleDetection-Chi3afMR.js} +1 -1
- package/dist/chunks/{shellQuote-yXoC_y5m.js → shellQuote-DkSy9MYE.js} +1 -1
- package/dist/chunks/{sideQuestion-CAiA6jAf.js → sideQuestion-D03MXdE2.js} +1 -1
- package/dist/chunks/sinks-B4_pw0Gb.js +2 -0
- package/dist/chunks/sinks-Cro1Y8C2.js +1 -0
- package/dist/chunks/{skill-learning-Dx1o4mMo.js → skill-learning-7ZQF5JvA.js} +1 -1
- package/dist/chunks/skillChangeDetector-uCaYrerZ.js +1 -0
- package/dist/chunks/{skillGapStore-BV_6qzxU.js → skillGapStore-BND2Lq0Z.js} +1 -1
- package/dist/chunks/{skillGapStore-Zvqiyxds.js → skillGapStore-z3LP64O-.js} +2 -2
- package/dist/chunks/{skillGenerator-jJQDphQ8.js → skillGenerator-DaNb-yKH.js} +2 -2
- package/dist/chunks/skillLearning-GZxYPlyl.js +1 -0
- package/dist/chunks/{skillLearning-BTT3_yGc.js → skillLearning-rMX1bSBa.js} +1 -1
- package/dist/chunks/{skillPanel-OW2M6SZr.js → skillPanel-q7GPSQ6_.js} +3 -3
- package/dist/chunks/{skillSearchPanel-C0Y56c5N.js → skillSearchPanel-oj8gy1ZL.js} +4 -4
- package/dist/chunks/{skills-BFsyLP33.js → skills-QqbeFP0s.js} +1 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
- package/dist/chunks/{startupProfiler-BquH_Yqm.js → startupProfiler-xa3NmN7Z.js} +2 -2
- package/dist/chunks/{stats-CrPmPT8f.js → stats-DmFubHpI.js} +1 -1
- package/dist/chunks/{status-BO5J2MAe.js → status-BEIsLmfj.js} +1 -1
- package/dist/chunks/{status-DHJbK4pV.js → status-DW3Z_7xa.js} +2 -2
- package/dist/chunks/{statusNoticeHelpers-CqeUBySi.js → statusNoticeHelpers-CaHS8xig.js} +1 -1
- package/dist/chunks/{stickers-BLFmyHZV.js → stickers-D5teCKMN.js} +1 -1
- package/dist/chunks/{stringUtils-D_g2L6A4.js → stringUtils-DGLPkqJ4.js} +1 -1
- package/dist/chunks/{tag-M2AEtXjW.js → tag-CRg93Die.js} +2 -2
- package/dist/chunks/{tasks-CoOs_Qkj.js → tasks-BEohK1ij.js} +1 -1
- package/dist/chunks/teleport-4Srg5vcP.js +1 -0
- package/dist/chunks/{templateJobs-Cl50Qw0s.js → templateJobs-DYP1fjYU.js} +1 -1
- package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
- package/dist/chunks/{terminalSetup-Bdh9K31U.js → terminalSetup-RDKg8dVa.js} +1 -1
- package/dist/chunks/{theme-DgCIr0jU.js → theme-kNL4kl_3.js} +1 -1
- package/dist/chunks/{thinkback-ERCQ86CR.js → thinkback-gV-sKkMM.js} +1 -1
- package/dist/chunks/thinkback-hc5eJ9ul.js +1 -0
- package/dist/chunks/thinkback-play-BpWMqbgJ.js +1 -0
- package/dist/chunks/{tmux-ZZk68JBq.js → tmux-BY7IdQ1f.js} +1 -1
- package/dist/chunks/{toolEventObserver-9-5Ne25Z.js → toolEventObserver-C98uraqD.js} +1 -1
- package/dist/chunks/{toolEventObserver-9XCQXiMx.js → toolEventObserver-ar5NDa0M.js} +1 -1
- package/dist/chunks/toolPool-CNYKDRq5.js +1 -0
- package/dist/chunks/trustedDevice-0dehm9qz.js +1 -0
- package/dist/chunks/trustedDevice-BBKUhCCL.js +1 -0
- package/dist/chunks/{types-Cnorfsss.js → types-C-MRCL8J.js} +3 -3
- package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
- package/dist/chunks/{ultrareviewCommand-BMBHepdu.js → ultrareviewCommand-yXlFsMnv.js} +2 -2
- package/dist/chunks/{undercover-DDgIKbO5.js → undercover-BTIRVF1t.js} +1 -1
- package/dist/chunks/undercover-CG_269xD.js +1 -0
- package/dist/chunks/{up-D6bNw_tT.js → up-BHkC97_C.js} +1 -1
- package/dist/chunks/updateCCB-B2xAJ4Nr.js +11 -0
- package/dist/chunks/upgrade-J7lKLkD2.js +1 -0
- package/dist/chunks/{upgrade-BN20nsCH.js → upgrade-yNl7EO4e.js} +1 -1
- package/dist/chunks/upload-BWVIHmMB.js +1 -0
- package/dist/chunks/{upstreamproxy-os5rw0Vg.js → upstreamproxy-DyR_eXO8.js} +4 -4
- package/dist/chunks/{usage-D_sqm8us.js → usage-B2PbCUMi.js} +1 -1
- package/dist/chunks/usage-Ck8Cu45g.js +1 -0
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-vzUoPY51.js → useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js} +1 -1
- package/dist/chunks/useMainLoopModel-CO4yBjRM.js +1 -0
- package/dist/chunks/useManagePlugins-BzFKIDrD.js +1 -0
- package/dist/chunks/{useMergedTools-Bb4XbC9d.js → useMergedTools-CRLWSGDl.js} +1 -1
- package/dist/chunks/{useSearchInput-B1UOjxAI.js → useSearchInput-BzGq4t7t.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BLbvu4--.js → useSettingsErrors-CSemUjj1.js} +1 -1
- package/dist/chunks/{util-CxlfALM4.js → util-BnReK81E.js} +1 -1
- package/dist/chunks/validatePlugin-D6sPqea1.js +1 -0
- package/dist/chunks/{vim-DLWBHwVM.js → vim-C0KTnJJs.js} +1 -1
- package/dist/chunks/{which-sEFQXpaX.js → which-CKQnSouy.js} +1 -1
- package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
- package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
- package/dist/chunks/{workSecret-DvniZR71.js → workSecret-CNWiR2uQ.js} +1 -1
- package/dist/chunks/{workerRegistry-CFnGtb3L.js → workerRegistry-CUXbNyL9.js} +1 -1
- package/dist/chunks/worktree-89ttIVxH.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +5 -10
- package/dist/chunks/ApproveApiKey-CQsQdQBC.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-AiVi-1pI.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DUu6iRJk.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-DVTPwR5I.js +0 -1
- package/dist/chunks/Doctor-BXhz8eUa.js +0 -3
- package/dist/chunks/Doctor-D75dsEyb.js +0 -1
- package/dist/chunks/ExitFlow-B1XNACQP.js +0 -2
- package/dist/chunks/Feedback-Cvz80lAn.js +0 -2
- package/dist/chunks/Grove-B7hhBvFw.js +0 -1
- package/dist/chunks/MCPConnectionManager-BLfKm4H2.js +0 -1
- package/dist/chunks/MessageSelector-DmKtBYX9.js +0 -3
- package/dist/chunks/Messages-CaFdI1kk.js +0 -11
- package/dist/chunks/PluginSettings-0FSNch8O.js +0 -17
- package/dist/chunks/QueryEngine-WYDWzQuY.js +0 -1
- package/dist/chunks/REPL-vV_jzAVx.js +0 -1
- package/dist/chunks/ResumeConversation-g_JyOWbl.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-Daedym7_.js +0 -1
- package/dist/chunks/Settings-DUXA-qac.js +0 -2
- package/dist/chunks/TrustDialog-CdZS9t-T.js +0 -1
- package/dist/chunks/ajv-5vMo9UcX.js +0 -8
- package/dist/chunks/api-CLLIHLpn.js +0 -1
- package/dist/chunks/api-DMpNA1s8.js +0 -1
- package/dist/chunks/asciicast-BIr75_x9.js +0 -1
- package/dist/chunks/auth-Ce0jllLf.js +0 -1
- package/dist/chunks/auth-DV3P8Qup.js +0 -1
- package/dist/chunks/auth-DpFfHy1W.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BycL9lOe.js +0 -1
- package/dist/chunks/bg-H849G7Sc.js +0 -1
- package/dist/chunks/bridgeConfig-CcANVX0P.js +0 -1
- package/dist/chunks/bridgeEnabled-Cn-u7P4_.js +0 -1
- package/dist/chunks/bridgeMain-CtgVyLjI.js +0 -68
- package/dist/chunks/bridgeMain-Dh0gWRVo.js +0 -1
- package/dist/chunks/bridgeMessaging-CRG6HqUb.js +0 -1
- package/dist/chunks/bridgePointer-Cug5fQ3e.js +0 -1
- package/dist/chunks/caches-C3NINY3K.js +0 -1
- package/dist/chunks/ccrClient-CRXGlUCe.js +0 -1
- package/dist/chunks/client-AnWHs0gW.js +0 -1
- package/dist/chunks/commands-DsKH3ogN.js +0 -1
- package/dist/chunks/commitAttribution-D7NrwLhc.js +0 -1
- package/dist/chunks/compact-BhWCO-oD.js +0 -2
- package/dist/chunks/completionCache-C9zlWBRz.js +0 -1
- package/dist/chunks/config-662VDD70.js +0 -3
- package/dist/chunks/config-CUN8YbOa.js +0 -1
- package/dist/chunks/config-DklnhNx1.js +0 -1
- package/dist/chunks/config-Wk3svGdH.js +0 -1
- package/dist/chunks/context-noninteractive-C3dICmA9.js +0 -1
- package/dist/chunks/conversation-CooSju3g.js +0 -1
- package/dist/chunks/conversation-DLLIOKYV.js +0 -1
- package/dist/chunks/createSession-CVG8SiEm.js +0 -1
- package/dist/chunks/crossProjectResume-DiKJb83I.js +0 -40
- package/dist/chunks/datadog-BE6D_6m0.js +0 -1
- package/dist/chunks/datadog-C69i7cfI.js +0 -1
- package/dist/chunks/debug-8kgDrUfj.js +0 -1
- package/dist/chunks/detectRepository-_Kj817Vi.js +0 -1
- package/dist/chunks/doctor-DEz8BHAz.js +0 -1
- package/dist/chunks/envLessBridgeConfig-3kCrKZl7.js +0 -1
- package/dist/chunks/envLessBridgeConfig-BfgXw47_.js +0 -1
- package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
- package/dist/chunks/execSyncWrapper-CWxMek26.js +0 -1
- package/dist/chunks/exit-cyepwuyy.js +0 -1
- package/dist/chunks/extra-usage-DlFeNGQD.js +0 -1
- package/dist/chunks/extra-usage-nRFfBiXh.js +0 -1
- package/dist/chunks/extractMemories-BqN8fWZ5.js +0 -1
- package/dist/chunks/fast-NvqW2-t1.js +0 -1
- package/dist/chunks/firstPartyEventLogger-AhXYSrkP.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BQYrBdvD.js +0 -5
- package/dist/chunks/gemini-Sr_00TsL.js +0 -1
- package/dist/chunks/generateRecap-5d4l_ODy.js +0 -1
- package/dist/chunks/git-Cc1jAz6r.js +0 -1
- package/dist/chunks/git-Cgc8X5l2.js +0 -6
- package/dist/chunks/hooks-DvtnNoYE.js +0 -1
- package/dist/chunks/inboundAttachments-BZ6MKpxd.js +0 -1
- package/dist/chunks/inboundAttachments-D5Ux2kCl.js +0 -1
- package/dist/chunks/initReplBridge-CjuO6in6.js +0 -1
- package/dist/chunks/install-DqpM2brU.js +0 -1
- package/dist/chunks/jwtUtils-CqXPjf-a.js +0 -1
- package/dist/chunks/keybindings-JvAmBpLt.js +0 -2
- package/dist/chunks/language-DaxZe0Xw.js +0 -1
- package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
- package/dist/chunks/loadAgentsDir-D7npVvsj.js +0 -1
- package/dist/chunks/loadPluginHooks-CaKvZVZI.js +0 -1
- package/dist/chunks/localSearch-BU5oulbF.js +0 -1
- package/dist/chunks/mcp-B06Mqsur.js +0 -6
- package/dist/chunks/mcp-C0AjA07u.js +0 -1
- package/dist/chunks/mcp-ghioDl7W.js +0 -2
- package/dist/chunks/metadata-CIx5CsoY.js +0 -1
- package/dist/chunks/model-BgrLt7P7.js +0 -1
- package/dist/chunks/model-aVc5c3Lz.js +0 -1
- package/dist/chunks/nativeInstaller-DKe1pWoL.js +0 -1
- package/dist/chunks/parser-Bj3gOqFv.js +0 -1
- package/dist/chunks/permissions-DB_2mmCl.js +0 -3
- package/dist/chunks/pidLock-DchmaAK6.js +0 -3
- package/dist/chunks/pluginBlocklist-Cw_l-yal.js +0 -1
- package/dist/chunks/pluginCliCommands-BtYWRxhS.js +0 -1
- package/dist/chunks/pluginOperations-BOkST1qE.js +0 -2
- package/dist/chunks/pluginStartupCheck-XBLJZZys.js +0 -1
- package/dist/chunks/plugins-6px6K1fh.js +0 -4
- package/dist/chunks/policyLimits-C07tQ0Wr.js +0 -1
- package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
- package/dist/chunks/poorMode-BdBDiOFD.js +0 -1
- package/dist/chunks/print-DcQSuK0v.js +0 -23
- package/dist/chunks/processBashCommand-CEqA4QZi.js +0 -1
- package/dist/chunks/processSlashCommand-DMpFk59M.js +0 -5
- package/dist/chunks/prompt-CKvoqUC3.js +0 -1
- package/dist/chunks/prompt-aXZPR3q8.js +0 -1
- package/dist/chunks/prompt-wys9CwDo.js +0 -132
- package/dist/chunks/rcDebugLog-CivJaJ3V.js +0 -11
- package/dist/chunks/reconciler-BKX4jh34.js +0 -4
- package/dist/chunks/remoteBridgeCore-CmwkjiTK.js +0 -1
- package/dist/chunks/remoteManagedSettings-Co-CxR67.js +0 -1
- package/dist/chunks/ripgrep-hOjrgpMp.js +0 -1
- package/dist/chunks/sandbox-adapter-CO5GuywY.js +0 -1
- package/dist/chunks/searchExtraTools-CXZJU2Kv.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BUyIQVzL.js +0 -1
- package/dist/chunks/sessionMemory-ZsxCLHYd.js +0 -1
- package/dist/chunks/sessionMemory-e6YpTUhW.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BD_dqyYB.js +0 -1
- package/dist/chunks/sessionObserver-DNItJztR.js +0 -1
- package/dist/chunks/sessionStorage-xvxpRETp.js +0 -1
- package/dist/chunks/sessionTitle-Bph6GO4F.js +0 -14
- package/dist/chunks/settings-BhvhCpVh.js +0 -19
- package/dist/chunks/settingsSync-D2B5K4BT.js +0 -1
- package/dist/chunks/setup-CEnNEK6Z.js +0 -3
- package/dist/chunks/sink-CyKOf5TT.js +0 -1
- package/dist/chunks/sink-DxPJ4khU.js +0 -1
- package/dist/chunks/sinks-BNo3DvxO.js +0 -2
- package/dist/chunks/sinks-CHgtwDha.js +0 -1
- package/dist/chunks/skillChangeDetector-BRBCwQ2w.js +0 -1
- package/dist/chunks/skillLearning-BH7EAU1m.js +0 -1
- package/dist/chunks/src-xRRBgNzF.js +0 -25
- package/dist/chunks/startupProfiler-CYCH-qos.js +0 -1
- package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
- package/dist/chunks/stdio-W_Kokrkh.js +0 -3
- package/dist/chunks/teleport-DjIgQeBB.js +0 -1
- package/dist/chunks/terminalSetup-nvS3KCDG.js +0 -33
- package/dist/chunks/thinkback-BSv_fvbV.js +0 -1
- package/dist/chunks/thinkback-play-DNB0IWYt.js +0 -1
- package/dist/chunks/toolPool-uQKZRMKg.js +0 -1
- package/dist/chunks/trustedDevice-0ej6e3nx.js +0 -1
- package/dist/chunks/trustedDevice-nqhuw4tp.js +0 -1
- package/dist/chunks/udsClient-CiFj4M_h.js +0 -1
- package/dist/chunks/undercover-6UUO38fQ.js +0 -1
- package/dist/chunks/updateCCB-B-OlpLjA.js +0 -11
- package/dist/chunks/upgrade-DYqlCH80.js +0 -1
- package/dist/chunks/upload-BQGByiXE.js +0 -1
- package/dist/chunks/usage-DolSCKGi.js +0 -1
- package/dist/chunks/useMainLoopModel-cZd8EKo5.js +0 -1
- package/dist/chunks/useManagePlugins-DgGZBvXV.js +0 -1
- package/dist/chunks/validatePlugin-n8a4W_jI.js +0 -1
- package/dist/chunks/windowsPaths-BLevJOlm.js +0 -1
- package/dist/chunks/windowsPaths-N_YmYY6k.js +0 -1
- package/dist/chunks/worktree-Dr_WzlXs.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,mt as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{$u as u,ed as d}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,mt as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{$u as u,ed as d}from"./loadAgentsDir-BURvZNN6.js";function f(e){return e.status===`running`?{mark:`●`,color:`warning`}:e.resultKind===`dead`?{mark:`✗`,color:`error`}:{mark:`✓`,color:`success`}}function p(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):`0`}function m(e){let t=[];return e.model&&t.push(e.model),t.push(`${p(e.tokenCount)} tok`),t.push(`${e.toolCount??0} tool`),t.join(` · `)}var h,g,_,v,y,b=e((()=>{h={running:`●`,completed:`✓`,failed:`✗`,killed:`■`},g={running:`warning`,completed:`success`,failed:`error`,killed:`subtle`},_={running:`running`,completed:`done`,failed:`failed`,killed:`killed`},v={running:`●`,done:`✓`,pending:`○`},y={running:`warning`,done:`success`,pending:`subtle`}}));function x(e,t){if(e.length<=t)return e;let n=e.match(/#\d+$/);if(!n)return e.slice(0,t);let r=n[0],i=e.slice(0,e.length-r.length),a=t-r.length-1;return`${i.slice(0,a)}…${r}`}function S({agents:e,selectedIndex:t,focused:i}){let[a,s]=o(T),c=w[Math.floor(s/T)%w.length];return e.length===0?(0,C.jsx)(r,{color:`subtle`,children:`(no agents in this phase)`}):(0,C.jsx)(n,{ref:a,flexDirection:`column`,children:e.map((e,a)=>{let o=f(e),s=a===t&&i,l=e.status===`running`?c:o.mark,u=x(e.label??`agent-${e.id}`,E);return(0,C.jsxs)(n,{backgroundColor:s?`selectionBg`:void 0,justifyContent:`space-between`,children:[(0,C.jsxs)(n,{children:[(0,C.jsx)(r,{color:o.color,children:l}),(0,C.jsxs)(r,{children:[` `,u]})]}),(0,C.jsx)(r,{color:`subtle`,children:m(e)})]},e.id)})})}var C,w,T,E,D=e((()=>{i(),s(),b(),C=l(),w=[`·`,`✢`,`✱`,`✶`,`✻`,`✽`],T=120,E=18}));function O(e,t){return e?.status===`done`?`done`:t.length>0?t.every(e=>e.status===`done`)?`done`:`running`:e?.status===`running`?`running`:`pending`}function k(e){let t=new Map(e.phases.map(e=>[e.title,e])),n=new Set,r=[],i=i=>{if(n.has(i))return;n.add(i);let a=t.get(i),o=e.agents.filter(e=>e.phase===i);r.push({title:i,status:O(a,o),done:o.filter(e=>e.status===`done`).length,total:o.length})};for(let t of e.declaredPhases)i(t);for(let t of e.phases)i(t.title);for(let t of e.agents)t.phase&&i(t.phase);return r}function A(e,t){return t===void 0||t===`All`?e:e.filter(e=>e.phase===t)}function j(e){return e.filter(e=>e.status===`running`)}function M(e,t){let n=Math.max(0,Math.trunc(t)),r=e.slice(0,n);return{runs:r,overflow:Math.max(0,e.length-r.length)}}function N(e,t){return`${e}#${t.slice(-4)}`}function P(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?`${n}m${String(r).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}var F=e((()=>{}));function I({phases:e,agents:t,selectedIndex:i,focused:a}){let[s,c]=o(z),l=R[Math.floor(c/z)%R.length],u=t.length;return(0,L.jsx)(n,{ref:s,flexDirection:`column`,children:[{title:`All`,done:t.filter(e=>e.status===`done`).length,total:u},...e].map((e,t)=>{let o=t===i,s=o&&a,c=e.status===`running`?l:e.status?v[e.status]:` `,u=e.status?y[e.status]:`subtle`;return(0,L.jsxs)(n,{backgroundColor:s?`selectionBg`:void 0,justifyContent:`space-between`,children:[(0,L.jsxs)(n,{children:[(0,L.jsx)(r,{color:o?`claude`:void 0,children:s?`>`:` `}),(0,L.jsx)(r,{children:` `}),(0,L.jsx)(r,{color:u,children:c}),(0,L.jsxs)(r,{children:[` `,e.title]})]}),(0,L.jsxs)(r,{color:`subtle`,children:[e.done,`/`,e.total]})]},e.title)})})}var L,R,z,B=e((()=>{i(),s(),b(),F(),L=l(),R=[`·`,`✢`,`✱`,`✶`,`✻`,`✽`],z=120}));function V({runs:e,activeRunId:t}){if(e.length===0)return(0,H.jsx)(r,{color:`subtle`,children:`(no runs)`});let{runs:i,overflow:a}=M(e,W);return(0,H.jsxs)(n,{children:[i.map(e=>{let i=e.runId===t,a=x(N(e.workflowName,e.runId),U),o=`═`.repeat(a.length+2);return(0,H.jsxs)(n,{flexDirection:`column`,marginRight:2,children:[(0,H.jsxs)(n,{children:[(0,H.jsx)(r,{color:g[e.status],children:h[e.status]}),(0,H.jsx)(r,{children:` `}),(0,H.jsx)(r,{color:i?`claude`:void 0,bold:i,children:a})]}),(0,H.jsx)(r,{color:i?`claude`:void 0,children:i?o:``})]},e.runId)}),a>0?(0,H.jsxs)(n,{flexDirection:`column`,marginRight:2,children:[(0,H.jsxs)(r,{color:`subtle`,children:[`+`,a]}),(0,H.jsx)(r,{children:` `})]}):null]})}var H,U,W,G=e((()=>{i(),s(),b(),F(),D(),H=l(),U=18,W=6}));function K(e,t,n=`normal`){return n===`confirm`?e===`y`||e===`Y`||t.return?`confirmYes`:e===`n`||e===`N`||t.escape||e===`q`?`confirmNo`:null:t.tab||e===` `?t.shift?`prevTab`:`nextTab`:t.escape||e===`q`?`quit`:e===`K`?`killWorkflow`:e===`x`?`killAgent`:e===`r`?`resume`:e===`n`?`newRun`:t.leftArrow?`focusLeft`:t.rightArrow?`focusRight`:t.upArrow?`moveUp`:t.downArrow?`moveDown`:null}function q(e,t=`normal`){a((n,r)=>{let i=K(n,r,t);if(i!==null)switch(i){case`nextTab`:e.nextTab();break;case`prevTab`:e.prevTab();break;case`focusLeft`:e.focusLeft();break;case`focusRight`:e.focusRight();break;case`moveUp`:e.moveUp();break;case`moveDown`:e.moveDown();break;case`killAgent`:e.killAgent();break;case`killWorkflow`:e.killWorkflow();break;case`resume`:e.resumeFocused();break;case`newRun`:e.newRun();break;case`quit`:e.quit();break;case`confirmYes`:e.confirmYes();break;case`confirmNo`:e.confirmNo();break}})}var J=e((()=>{s()}));function Y(e,t){if(t===0)return 0;let n=Math.trunc(e);return Number.isNaN(n)||n<0?0:Math.min(n,t-1)}function ee(e,t){return!e||!t||e.runId!==t.runId||e.status!==`running`?!1:t.status===`completed`||t.status===`failed`||t.status===`killed`}function te({onDone:e,context:t}){let i=u(),a=(0,X.useSyncExternalStore)(i.subscribe,()=>i.listRuns(),()=>[]),s=j(a),[l,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(`phases`),[m,h]=(0,X.useState)(0),[v,y]=(0,X.useState)(0),[b,x]=(0,X.useState)(null);(0,X.useEffect)(()=>{i.loadPersistedRuns()},[i]),(0,X.useEffect)(()=>{if(s.length===0){l!==null&&d(null);return}s.some(e=>e.runId===l)||d(s[0].runId)},[s,l]);let C=s.find(e=>e.runId===l),w=C?k(C):[],T=w.length+1,E=Y(m,T),D=(0,X.useRef)(null);(0,X.useEffect)(()=>{let t=C?{runId:C.runId,status:C.status}:null,n=D.current;if(D.current=t,!ee(n,t))return;let r=setTimeout(()=>e(),800);return()=>{clearTimeout(r)}},[C?.runId,C?.status,e]);let O=E===0?void 0:w[E-1]?.title,M=C?A(C.agents,O):[],N=Y(v,M.length),F=e=>{d(e),p(`phases`),h(0),y(0)};q({nextTab:()=>{if(s.length===0)return;let e=s.findIndex(e=>e.runId===l),t=s[(e+1)%s.length];F(t.runId)},prevTab:()=>{if(s.length===0)return;let e=s.findIndex(e=>e.runId===l),t=s[(e-1+s.length)%s.length];F(t.runId)},focusLeft:()=>p(`phases`),focusRight:()=>p(`agents`),moveUp:()=>{f===`phases`?h(e=>Y(e-1,T)):y(e=>Y(e-1,M.length))},moveDown:()=>{f===`phases`?h(e=>Y(e+1,T)):y(e=>Y(e+1,M.length))},killAgent:()=>{f!==`agents`||!C||M[N]&&x(`agent`)},killWorkflow:()=>{C&&x(`workflow`)},resumeFocused:()=>{if(!C)return;let n=t.canUseTool;if(!n){e(`resume needs canUseTool context; run /<name> resume from the main session.`);return}i.launch({resumeFromRunId:C.runId,name:C.workflowName},t,n).catch(t=>e(`resume failed: ${t.message}`))},newRun:()=>e(`Tip: start a named workflow with /<name>, or pass name via the Workflow tool.`),quit:()=>{if(b!==null){x(null);return}e()},confirmYes:()=>{if(b===`workflow`&&C){i.kill(C.runId),x(null),e();return}else if(b===`agent`&&C){let e=M[N];e&&i.killAgent(C.runId,e.id)}x(null)},confirmNo:()=>x(null)},b===null?`normal`:`confirm`);let L=a.filter(e=>e.status===`running`).length,R=a.length-L,z=O??`All`,B=C?C.agents.filter(e=>e.status===`done`).length:0,[H]=o(1e3),U=C?Date.now()-C.startedAt:0;return(0,Z.jsxs)(n,{ref:H,flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,paddingX:1,children:[(0,Z.jsxs)(n,{justifyContent:`space-between`,children:[(0,Z.jsx)(r,{bold:!0,children:C?.workflowName??`Workflows`}),C?(0,Z.jsxs)(r,{color:`subtle`,children:[B,`/`,C.agentCount,` agents · `,P(U),` ·`,` `,(0,Z.jsx)(r,{color:g[C.status],children:_[C.status]})]}):(0,Z.jsxs)(r,{color:`subtle`,children:[L,` running · `,R,` done`]})]}),C?.description?(0,Z.jsx)(r,{color:`subtle`,children:C.description}):null,s.length>1?(0,Z.jsx)(n,{marginTop:1,children:(0,Z.jsx)(V,{runs:s,activeRunId:l})}):null,(0,Z.jsxs)(n,{flexDirection:`row`,marginTop:1,children:[(0,Z.jsxs)(n,{width:`25%`,flexDirection:`column`,children:[(0,Z.jsx)(r,{color:f===`phases`?`claude`:`subtle`,bold:!0,children:`Phases`}),(0,Z.jsx)(I,{phases:w,agents:C?.agents??[],selectedIndex:E,focused:f===`phases`})]}),(0,Z.jsx)(r,{color:`subtle`,children:`│`}),(0,Z.jsxs)(n,{flexGrow:1,flexDirection:`column`,children:[(0,Z.jsxs)(r,{color:f===`agents`?`claude`:`subtle`,bold:!0,children:[z,` · `,M.length,` agents`]}),(0,Z.jsx)(S,{agents:M,selectedIndex:N,focused:f===`agents`})]})]}),(0,Z.jsx)(n,{marginTop:1,children:(0,Z.jsx)(r,{color:`subtle`,children:b===null?`Tab switch run · ←/→ focus · ↑/↓ move · x kill agent · K kill workflow · r resume · q quit`:`Confirm: y kill · n/Esc cancel`})}),b===null?null:(0,Z.jsx)(c,{title:b===`workflow`?`Kill workflow "${C?.workflowName??``}"?`:`Kill agent "${M[N]?.label??``}"?`,subtitle:b===`workflow`?`All in-flight agents will be aborted. Resume will replay from journal.`:`Only this agent aborts; other agents in the workflow keep running.`,onCancel:()=>x(null),color:`warning`,children:(0,Z.jsx)(r,{color:`subtle`,children:`Press y to confirm, or n/Esc to cancel.`})})]})}var X,Z,ne=e((()=>{X=t(i(),1),s(),d(),D(),B(),G(),b(),J(),F(),Z=l()})),Q,$;e((()=>{ne(),Q=l(),$=async(e,t,n)=>(0,Q.jsx)(te,{onDone:e,context:t})}))();export{$ as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./parser-DFwaTGf7.js";t();export{e as parseCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t}from"./debug-BrXObCdR.js";var n,r=e((()=>{Promise.resolve(),n=new Set([`if`,`then`,`elif`,`else`,`fi`,`while`,`until`,`for`,`in`,`do`,`done`,`case`,`esac`,`function`,`select`])}));async function i(e){return!e||e.length,null}async function a(e){return!e||e.length,null}function o(e){if(e.type===`declaration_command`){let t=e.children[0];return t&&c.has(t.text)?[t.text]:[]}let t=[],n=!1;for(let r of e.children)if(r.type!==`variable_assignment`){if(r.type===`command_name`||!n&&r.type===`word`){n=!0,t.push(r.text);continue}if(l.has(r.type))t.push(s(r.text));else if(u.has(r.type))break}return t}function s(e){return e.length>=2&&(e[0]===`"`&&e.at(-1)===`"`||e[0]===`'`&&e.at(-1)===`'`)?e.slice(1,-1):e}var c,l,u,d,f=e((()=>{t(),r(),c=new Set([`export`,`declare`,`typeset`,`readonly`,`local`,`unset`,`unsetenv`]),l=new Set([`word`,`string`,`raw_string`,`number`]),u=new Set([`command_substitution`,`process_substitution`]),d=Symbol(`parse-aborted`)}));export{a,i,o as n,n as o,f as r,r as s,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fr as t,Mi as n,Ni as r,Pr as i}from"./state-ix0xIunV.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fr as t,Mi as n,Ni as r,Pr as i}from"./state-ix0xIunV.js";import{BD as a,zD as o}from"./loadAgentsDir-BURvZNN6.js";function s(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}var c=e((()=>{}));function l(e,t,n,r){return o(e,function(e,i,a){t(r,e,n(e),a)}),r}var u=e((()=>{a()}));function d(e,t){return function(n,a){var o=r(n)?s:l,c=t?t():{};return o(n,e,i(a,2),c)}}var f=e((()=>{c(),u(),t(),n()})),p,m=e((()=>{f(),p=d(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]})}));export{p as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,dr as o,fi as s,hn as c,t as l,x as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as f,_n as p,gn as m}from"./settings-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,dr as o,fi as s,hn as c,t as l,x as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as f,_n as p,gn as m}from"./settings-DfWP5y6X.js";import{b as h,c as g,g as _}from"./config-DiT2Z8dY.js";import{o as v,s as y}from"./log-BMCygSzM.js";import{n as b,r as x}from"./analytics-BotDBGh0.js";import{i as S,n as C,o as w,r as T,s as E,u as D}from"./referral-UKJv23_5.js";import{n as O,t as k}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";function A({onDone:e}){let[t,s]=(0,j.useState)(!0),[l,d]=(0,j.useState)([]),[f,p]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null),[_,v]=(0,j.useState)(void 0),b=O(()=>e(`Guest passes dialog dismissed`,{display:`system`}));if(a(`confirm:no`,(0,j.useCallback)(()=>{e(`Guest passes dialog dismissed`,{display:`system`})},[e]),{context:`Confirmation`}),c((t,n)=>{n.return&&h&&o(h).then(t=>{t&&process.stdout.write(t),x(`tengu_guest_passes_link_copied`,{}),e(`Referral link copied to clipboard!`)})}),(0,j.useEffect)(()=>{async function e(){try{let e=await S();if(!e||!e.eligible){p(!1),s(!1);return}p(!0),e.referral_code_details?.referral_link&&g(e.referral_code_details.referral_link),v(e.referrer_reward);let t=e.referral_code_details?.campaign??`claude_code_guest_pass`,n;try{n=await C(t)}catch(e){y(e),p(!1),s(!1);return}let r=n.redemptions||[],i=n.limit||3,a=[];for(let e=0;e<i;e++){let t=r[e];a.push({passNumber:e+1,isAvailable:!t})}d(a),s(!1)}catch(e){y(e),p(!1),s(!1)}}e()},[]),t)return(0,M.jsx)(u,{children:(0,M.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,M.jsx)(i,{dimColor:!0,children:`Loading guest pass information…`}),(0,M.jsx)(i,{dimColor:!0,italic:!0,children:b.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Esc to cancel`})})]})});if(!f)return(0,M.jsx)(u,{children:(0,M.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,M.jsx)(i,{children:`Guest passes are not currently available.`}),(0,M.jsx)(i,{dimColor:!0,italic:!0,children:b.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Esc to cancel`})})]})});let w=m(l,e=>e.isAvailable),E=[...l].sort((e,t)=>t.isAvailable-+e.isAvailable),D=e=>e.isAvailable?(0,M.jsxs)(n,{flexDirection:`column`,marginRight:1,children:[(0,M.jsx)(i,{children:`┌──────────┐`}),(0,M.jsxs)(i,{children:[` ) CC `,(0,M.jsx)(i,{color:`claude`,children:`✻`}),` ┊ ( `]}),(0,M.jsx)(i,{children:`└──────────┘`})]},e.passNumber):(0,M.jsxs)(n,{flexDirection:`column`,marginRight:1,children:[(0,M.jsx)(i,{dimColor:!0,children:`┌─────────╱`}),(0,M.jsx)(i,{dimColor:!0,children:` ) CC ✻ ┊╱`}),(0,M.jsx)(i,{dimColor:!0,children:`└───────╱`})]},e.passNumber);return(0,M.jsx)(u,{children:(0,M.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,M.jsxs)(i,{color:`permission`,children:[`Guest passes · `,w,` left`]}),(0,M.jsx)(n,{flexDirection:`row`,marginLeft:2,children:E.slice(0,3).map(e=>D(e))}),h&&(0,M.jsx)(n,{marginLeft:2,children:(0,M.jsx)(i,{children:h})}),(0,M.jsx)(n,{flexDirection:`column`,marginLeft:2,children:(0,M.jsxs)(i,{dimColor:!0,children:[_?`Share a free week of Claude Code with friends. If they love it and subscribe, you'll get ${T(_)} of extra usage to keep building. `:`Share a free week of Claude Code with friends. `,(0,M.jsx)(r,{url:_?`https://support.claude.com/en/articles/13456702-claude-code-guest-passes`:`https://support.claude.com/en/articles/12875061-claude-code-guest-passes`,children:`Terms apply.`})]})}),(0,M.jsx)(n,{children:(0,M.jsx)(i,{dimColor:!0,italic:!0,children:b.pending?(0,M.jsxs)(M.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,M.jsx)(M.Fragment,{children:`Enter to copy link · Esc to cancel`})})})]})})}var j,M,N=e((()=>{s(),j=t(s(),1),f(),k(),l(),D(),b(),E(),p(),v(),M=d()}));async function P(e){let t=!g().hasVisitedPasses;if(t){let e=w();h(t=>({...t,hasVisitedPasses:!0,passesLastSeenRemaining:e??t.passesLastSeenRemaining}))}return x(`tengu_guest_passes_visited`,{is_first_visit:t}),(0,F.jsx)(A,{onDone:e})}var F;e((()=>{s(),N(),b(),E(),_(),F=d()}))();export{P as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-CYmmnQVS.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-CYmmnQVS.js";import{d as r,p as i}from"./debug-BrXObCdR.js";import{i as a,o}from"./platform-BrYefG_2.js";import{a as s,i as c}from"./windowsPaths-DtapVxOo.js";import{l}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{homedir as u}from"os";import{dirname as d,isAbsolute as f,join as p,normalize as m,posix as h,relative as g,resolve as _}from"path";function v(e,t){let i=t??n()??r().cwd();if(typeof e!=`string`)throw TypeError(`Path must be a string, received ${typeof e}`);if(typeof i!=`string`)throw TypeError(`Base directory must be a string, received ${typeof i}`);if(e.includes(`\0`)||i.includes(`\0`))throw Error(`Path contains null bytes`);let o=e=>e.includes(`/`)&&!e.includes(`\\`)&&!/^[A-Za-z]:/.test(e),c=e.trim();if(!c)return a()===`windows`&&o(i)?h.normalize(i).normalize(`NFC`):m(i).normalize(`NFC`);if(c===`~`)return u().normalize(`NFC`);if(c.startsWith(`~/`))return p(u(),c.slice(2)).normalize(`NFC`);let l=c;if(a()===`windows`&&c.match(/^\/[a-z]\//i))try{l=s(c)}catch{l=c}return f(l)?a()===`windows`&&o(l)?h.normalize(l).normalize(`NFC`):m(l).normalize(`NFC`):a()===`windows`&&o(i)&&!/^[A-Za-z]:/.test(l)&&!l.startsWith(`\\\\`)?h.resolve(i,l).normalize(`NFC`):_(i,l).normalize(`NFC`)}function y(e){let t=g(n(),e);return t.startsWith(`..`)?e:t}function b(e){let t=v(e);if(t.startsWith(`\\\\`)||t.startsWith(`//`))return d(t);try{if(r().statSync(t).isDirectory())return t}catch{}return d(t)}function x(e){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(e)}function S(e){return m(e).replace(/\\/g,`/`)}var C=e((()=>{t(),i(),o(),c(),l()}));export{S as a,C as i,v as n,y as o,b as r,x as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{I as i,P as a,Wt as o,Xn as s,a as c,di as l,fi as u,hn as d,k as f,kt as p,n as m,o as h,ot as g,r as _,s as ee,t as v,ui as y,x as te,y as b}from"./src-CDCSSo0U2.js";import{t as x}from"./jsx-runtime-Bb4Xn-E0.js";import{en as ne,nt as S}from"./state-ix0xIunV.js";import{B as re,G as C,H as ie,JS as ae,K as w,Rx as T,Tw as oe,U as se,V as ce,XS as le,_D as E,_o as D,_u as O,_x as k,bD as A,bw as ue,lC as j,qS as de,vu as fe,vx as M,ww as N,zo as pe,zx as me}from"./loadAgentsDir-BURvZNN6.js";import{S as P,w as F}from"./debug-BrXObCdR.js";import{B as I,L,an as R,dn as he,g as z,o as B,z as ge}from"./settings-DfWP5y6X.js";import{l as _e,o as ve}from"./stringUtils-DGLPkqJ4.js";import{u as V}from"./referral-UKJv23_5.js";import{n as H,t as ye}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";import{n as be,t as xe}from"./AddWorkspaceDirectory-BTC7FPqM.js";import{t as Se}from"./SearchBox-vfLXEPed.js";import{n as Ce,t as we}from"./useSearchInput-BzGq4t7t.js";import{n as Te,t as Ee}from"./shadowedRuleDetection-Chi3afMR.js";import{n as U,t as De}from"./autoModeDenials-BxNzGJdR.js";function Oe({ruleValue:e}){switch(e.toolName){case O.name:return e.ruleContent?e.ruleContent.endsWith(`:*`)?(0,W.jsxs)(a,{dimColor:!0,children:[`Any Bash command starting with `,(0,W.jsx)(a,{bold:!0,children:e.ruleContent.slice(0,-2)})]}):(0,W.jsxs)(a,{dimColor:!0,children:[`The Bash command `,(0,W.jsx)(a,{bold:!0,children:e.ruleContent})]}):(0,W.jsx)(a,{dimColor:!0,children:`Any Bash command`});default:return e.ruleContent?null:(0,W.jsxs)(a,{dimColor:!0,children:[`Any use of the `,(0,W.jsx)(a,{bold:!0,children:e.toolName}),` tool`]})}}var W,ke=e((()=>{u(),v(),fe(),W=x()}));function Ae(e){switch(e){case`localSettings`:return{label:`Project settings (local)`,description:`Saved in ${B(`localSettings`)}`,value:e};case`projectSettings`:return{label:`Project settings`,description:`Checked in at ${B(`projectSettings`)}`,value:e};case`userSettings`:return{label:`User settings`,description:`Saved in at ~/.claude/settings.json`,value:e}}}function je({onAddRules:e,onCancel:t,ruleValues:n,ruleBehavior:r,initialContext:o,setToolPermissionContext:s}){let c=R.map(Ae),l=(0,Me.useCallback)(i=>{if(i===`cancel`){t();return}else if(R.includes(i)){let t=i,a=ue(o,{type:`addRules`,rules:n,behavior:r,destination:t});oe({type:`addRules`,rules:n,behavior:r,destination:t}),s(a);let c=n.map(e=>({ruleValue:e,ruleBehavior:r,source:t})),l=Ee(a,{sandboxAutoAllowEnabled:E.isSandboxingEnabled()&&E.isAutoAllowBashIfSandboxedEnabled()}).filter(e=>n.some(t=>t.toolName===e.rule.ruleValue.toolName&&t.ruleContent===e.rule.ruleValue.ruleContent));e(c,l.length>0?l:void 0)}},[e,t,n,r,o,s]);return(0,G.jsxs)(b,{title:`Add ${r} permission ${_e(n.length,`rule`)}`,onCancel:t,color:`permission`,children:[(0,G.jsx)(i,{flexDirection:`column`,paddingX:2,children:n.map(e=>(0,G.jsxs)(i,{flexDirection:`column`,children:[(0,G.jsx)(a,{bold:!0,children:I(e)}),(0,G.jsx)(Oe,{ruleValue:e})]},I(e)))}),(0,G.jsxs)(i,{flexDirection:`column`,marginY:1,children:[(0,G.jsx)(a,{children:n.length===1?`Where should this rule be saved?`:`Where should these rules be saved?`}),(0,G.jsx)(k,{options:c,onChange:l})]})]})}var Me,G,Ne=e((()=>{u(),Me=t(u(),1),M(),v(),N(),L(),Te(),A(),he(),z(),ve(),ke(),G=x()}));function Pe({onCancel:e,onSubmit:t,ruleBehavior:n}){let[s,c]=(0,Fe.useState)(``),[l,u]=(0,Fe.useState)(0),d=H();o(`confirm:no`,e,{context:`Settings`});let{columns:f}=g(),m=f-6;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(i,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,K.jsxs)(a,{bold:!0,color:`permission`,children:[`Add `,n,` permission rule`]}),(0,K.jsxs)(i,{flexDirection:`column`,children:[(0,K.jsxs)(a,{children:[`Permission rules are a tool name, optionally followed by a specifier in parentheses.`,(0,K.jsx)(p,{}),`e.g., `,(0,K.jsx)(a,{bold:!0,children:I({toolName:O.name})}),(0,K.jsx)(a,{bold:!1,children:` or `}),(0,K.jsx)(a,{bold:!0,children:I({toolName:O.name,ruleContent:`ls:*`})})]}),(0,K.jsx)(i,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,K.jsx)(T,{showCursor:!0,value:s,onChange:c,onSubmit:e=>{let r=e.trim();r.length!==0&&t(ge(r),n)},placeholder:`Enter permission rule${r.ellipsis}`,columns:m,cursorOffset:l,onChangeCursorOffset:u})})]})]}),(0,K.jsx)(i,{marginLeft:3,children:d.pending?(0,K.jsxs)(a,{dimColor:!0,children:[`Press `,d.keyName,` again to exit`]}):(0,K.jsx)(a,{dimColor:!0,children:`Enter to submit · Esc to cancel`})})]})}var Fe,K,Ie=e((()=>{n(),u(),Fe=t(u(),1),me(),ye(),j(),v(),V(),fe(),L(),K=x()}));function Le({onHeaderFocusChange:e,onStateChange:t}){let{headerFocused:n,focusHeader:r}=c();(0,q.useEffect)(()=>{e?.(n)},[n,e]);let[o]=(0,q.useState)(()=>De()),[s,l]=(0,q.useState)(()=>new Set),[u,f]=(0,q.useState)(()=>new Set),[p,m]=(0,q.useState)(0);(0,q.useEffect)(()=>{t({approved:s,retry:u,denials:o})},[s,u,o,t]);let h=(0,q.useCallback)(e=>{let t=Number(e);l(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),g=(0,q.useCallback)(e=>{m(Number(e))},[]);if(d((e,t)=>{e===`r`&&(f(e=>{let t=new Set(e);return t.has(p)?t.delete(p):t.add(p),t}),l(e=>{if(e.has(p))return e;let t=new Set(e);return t.add(p),t}))},{isActive:o.length>0}),o.length===0)return(0,J.jsx)(a,{dimColor:!0,children:`No recent denials. Commands denied by the auto mode classifier will appear here.`});let _=o.map((e,t)=>{let n=s.has(t),r=u.has(t)?` (retry)`:``;return{label:(0,J.jsxs)(a,{children:[(0,J.jsx)(ee,{status:n?`success`:`error`,withSpace:!0}),e.display,(0,J.jsx)(a,{dimColor:!0,children:r})]}),value:String(t)}});return(0,J.jsxs)(i,{flexDirection:`column`,children:[(0,J.jsx)(a,{children:`Commands recently denied by the auto mode classifier.`}),(0,J.jsx)(i,{marginTop:1,children:(0,J.jsx)(k,{options:_,onChange:h,onFocus:g,visibleOptionCount:Math.min(10,_.length),isDisabled:n,onUpFromFirstItem:r})})]})}var q,J,Re=e((()=>{u(),q=t(u(),1),v(),U(),M(),J=x()}));function ze({directoryPath:e,onRemove:t,onCancel:n,permissionContext:r,setPermissionContext:o}){let s=(0,Be.useCallback)(()=>{o(ue(r,{type:`removeDirectories`,directories:[e],destination:`session`})),t()},[e,r,o,t]),c=(0,Be.useCallback)(e=>{e===`yes`?s():n()},[s,n]);return(0,Y.jsxs)(b,{title:`Remove directory from workspace?`,onCancel:n,color:`error`,children:[(0,Y.jsx)(i,{marginX:2,flexDirection:`column`,children:(0,Y.jsx)(a,{bold:!0,children:e})}),(0,Y.jsx)(a,{children:`Claude Code will no longer have access to files in this directory.`}),(0,Y.jsx)(k,{onChange:c,onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]})}var Be,Y,Ve=e((()=>{u(),Be=t(u(),1),M(),v(),N(),Y=x()}));function He({onExit:e,toolPermissionContext:t,onRequestAddDirectory:n,onRequestRemoveDirectory:o,onHeaderFocusChange:s}){let{headerFocused:l,focusHeader:u}=c();(0,X.useEffect)(()=>{s?.(l)},[l,s]);let d=Ue.useMemo(()=>Array.from(t.additionalWorkingDirectories.keys()).map(e=>({path:e,isCurrent:!1,isDeletable:!0})),[t.additionalWorkingDirectories]),f=(0,X.useCallback)(e=>{if(e===`add-directory`){n();return}let t=d.find(t=>t.path===e);t&&t.isDeletable&&o(t.path)},[d,n,o]),p=(0,X.useCallback)(()=>e(`Workspace dialog dismissed`,{display:`system`}),[e]),m=Ue.useMemo(()=>{let e=d.map(e=>({label:e.path,value:e.path}));return e.push({label:`Add directory${r.ellipsis}`,value:`add-directory`}),e},[d]);return(0,Z.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(i,{flexDirection:`row`,marginTop:1,marginLeft:2,gap:1,children:[(0,Z.jsx)(a,{children:`- ${S()}`}),(0,Z.jsx)(a,{dimColor:!0,children:`(Original working directory)`})]}),(0,Z.jsx)(k,{options:m,onChange:f,onCancel:p,visibleOptionCount:Math.min(10,m.length),onUpFromFirstItem:u,isDisabled:l})]})}var Ue,X,Z,We=e((()=>{n(),Ue=t(u(),1),X=t(u(),1),ne(),M(),v(),Z=x()}));function Ge({rule:e}){return(0,$.jsx)(a,{dimColor:!0,children:`From ${w(e.source)}`})}function Ke(e){switch(e){case`allow`:return`allowed`;case`deny`:return`denied`;case`ask`:return`ask`}}function qe({rule:e,onDelete:t,onCancel:n}){let r=H();o(`confirm:no`,n,{context:`Confirmation`});let s=(0,$.jsxs)(i,{flexDirection:`column`,marginX:2,children:[(0,$.jsx)(a,{bold:!0,children:I(e.ruleValue)}),(0,$.jsx)(Oe,{ruleValue:e.ruleValue}),(0,$.jsx)(Ge,{rule:e})]}),c=(0,$.jsx)(i,{marginLeft:3,children:r.pending?(0,$.jsxs)(a,{dimColor:!0,children:[`Press `,r.keyName,` again to exit`]}):(0,$.jsx)(a,{dimColor:!0,children:`Esc to cancel`})});return e.source===`policySettings`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(i,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,$.jsx)(a,{bold:!0,color:`permission`,children:`Rule details`}),s,(0,$.jsxs)(a,{italic:!0,children:[`This rule is configured by managed settings and cannot be modified.`,`
|
|
2
|
+
`,`Contact your system administrator for more information.`]})]}),c]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(i,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`error`,children:[(0,$.jsxs)(a,{bold:!0,color:`error`,children:[`Delete `,Ke(e.ruleBehavior),` tool?`]}),s,(0,$.jsx)(a,{children:`Are you sure you want to delete this permission rule?`}),(0,$.jsx)(k,{onChange:e=>e===`yes`?t():n(),onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]}),c]})}function Je(e){let{options:t,searchQuery:n,isSearchMode:r,isFocused:a,onSelect:o,onCancel:s,lastFocusedRuleKey:l,cursorOffset:u,onHeaderFocusChange:d}=e,p=h(),{headerFocused:m,focusHeader:g,blurHeader:_}=c();return(0,Q.useEffect)(()=>{r&&m&&_()},[r,m,_]),(0,Q.useEffect)(()=>{d?.(m)},[m,d]),(0,$.jsxs)(i,{flexDirection:`column`,children:[(0,$.jsx)(i,{marginBottom:1,flexDirection:`column`,children:(0,$.jsx)(f,{query:n,isFocused:r&&!m,isTerminalFocused:a,width:p,cursorOffset:u})}),(0,$.jsx)(k,{options:t,onChange:o,onCancel:s,visibleOptionCount:Math.min(10,t.length),isDisabled:r||m,defaultFocusValue:l,onUpFromFirstItem:g})]})}function Ye({tab:e,getRulesOptions:t,handleToolSelect:n,...r}){return(0,$.jsxs)(i,{flexDirection:`column`,flexShrink:e===`allow`?0:void 0,children:[(0,$.jsx)(a,{children:{allow:`Claude Code won't ask before using allowed tools.`,ask:`Claude Code will always ask for confirmation before using these tools.`,deny:`Claude Code will always reject requests to use denied tools.`}[e]}),(0,$.jsx)(Je,{options:t(e,r.searchQuery).options,onSelect:t=>n(t,e),...r})]})}function Xe({onExit:e,initialTab:t,onRetryDenials:n}){let c=De().length>0,l=t??(c?`recent`:`allow`),[u,d]=(0,Q.useState)([]),f=ae(e=>e.toolPermissionContext),p=le(),h=s(),g=(0,Q.useRef)({approved:new Set,retry:new Set,denials:[]}),ee=(0,Q.useCallback)(e=>{g.current=e},[]),[v,b]=(0,Q.useState)(),[x,ne]=(0,Q.useState)(),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),[de,fe]=(0,Q.useState)(!0),M=(0,Q.useCallback)(e=>{fe(e)},[]),N=(0,Q.useMemo)(()=>{let e=new Map;return ce(f).forEach(t=>{e.set(F(t),t)}),e},[f]),pe=(0,Q.useMemo)(()=>{let e=new Map;return se(f).forEach(t=>{e.set(F(t),t)}),e},[f]),me=(0,Q.useMemo)(()=>{let e=new Map;return ie(f).forEach(t=>{e.set(F(t),t)}),e},[f]),P=(0,Q.useCallback)((e,t=``)=>{let n=(()=>{switch(e){case`allow`:return N;case`deny`:return pe;case`ask`:return me;case`workspace`:case`recent`:return new Map}})(),i=[];e!==`workspace`&&e!==`recent`&&!t&&i.push({label:`Add a new rule${r.ellipsis}`,value:`add-new-rule`});let a=Array.from(n.keys()).sort((e,t)=>{let r=n.get(e),i=n.get(t);if(r&&i){let e=I(r.ruleValue).toLowerCase(),t=I(i.ruleValue).toLowerCase();return e.localeCompare(t)}return 0}),o=t.toLowerCase();for(let e of a){let r=n.get(e);if(r){let n=I(r.ruleValue);if(t&&!n.toLowerCase().includes(o))continue;i.push({label:n,value:e})}}return{options:i,rulesByKey:n}},[N,pe,me]),L=H(),R=!v&&!S&&!w&&!E&&!O,{query:he,setQuery:z,cursorOffset:B}=Ce({isActive:R&&A,onExit:()=>{j(!1)}}),ge=(0,Q.useCallback)(e=>{R&&(A||e.ctrl||e.meta||(e.key===`/`?(e.preventDefault(),j(!0),z(``)):e.key.length===1&&e.key!==`j`&&e.key!==`k`&&e.key!==`m`&&e.key!==`i`&&e.key!==`r`&&e.key!==` `&&(e.preventDefault(),j(!0),z(e.key))))},[R,A,z]),_e=(0,Q.useCallback)((e,t)=>{let{rulesByKey:n}=P(t);if(e===`add-new-rule`){C(t);return}else{b(n.get(e));return}},[P]),ve=(0,Q.useCallback)(()=>{C(null)},[]),V=(0,Q.useCallback)((e,t)=>{T({ruleValue:e,ruleBehavior:t}),C(null)},[]),ye=(0,Q.useCallback)((e,t)=>{T(null);for(let t of e)d(e=>[...e,`Added ${t.ruleBehavior} rule ${y.bold(I(t.ruleValue))}`]);if(t&&t.length>0)for(let e of t){let t=e.shadowType===`deny`?`blocked`:`shadowed`;d(n=>[...n,y.yellow(`${r.warning} Warning: ${I(e.rule.ruleValue)} is ${t}`),y.dim(` ${e.reason}`),y.dim(` Fix: ${e.fix}`)])}},[]),be=(0,Q.useCallback)(()=>{T(null)},[]),Se=(0,Q.useCallback)(()=>D(!0),[]),we=(0,Q.useCallback)(e=>k(e),[]),Te=(0,Q.useCallback)(()=>{let t=g.current,r=e=>Array.from(e).map(e=>t.denials[e]).filter(e=>e!==void 0),i=r(t.retry);if(i.length>0){let t=i.map(e=>e.display);n?.(t),e(void 0,{shouldQuery:!0,metaMessages:[`Permission granted for: ${t.join(`, `)}. You may now retry ${t.length===1?`this command`:`these commands`} if you would like.`]});return}let a=r(t.approved);a.length>0||u.length>0?e([...a.length>0?[`Approved ${a.map(e=>y.bold(e.display)).join(`, `)}`]:[],...u].join(`
|
|
3
|
+
`)):e(`Permissions dialog dismissed`,{display:`system`})},[u,e,n]);o(`confirm:no`,Te,{context:`Settings`,isActive:R&&!A});let Ee=()=>{if(!v)return;let{options:e}=P(v.ruleBehavior),t=F(v),n=e.filter(e=>e.value!==`add-new-rule`).map(e=>e.value),r=n.indexOf(t),i;r!==-1&&(r<n.length-1?i=n[r+1]:r>0&&(i=n[r-1])),ne(i),re({rule:v,initialContext:f,setToolPermissionContext(e){p(t=>({...t,toolPermissionContext:e}))}}),d(e=>[...e,`Deleted ${v.ruleBehavior} rule ${y.bold(I(v.ruleValue))}`]),b(void 0)};if(v)return(0,$.jsx)(qe,{rule:v,onDelete:Ee,onCancel:()=>b(void 0)});if(S&&S!==`workspace`&&S!==`recent`)return(0,$.jsx)(Pe,{onCancel:ve,onSubmit:V,ruleBehavior:S});if(w)return(0,$.jsx)(je,{onAddRules:ye,onCancel:be,ruleValues:[w.ruleValue],ruleBehavior:w.ruleBehavior,initialContext:f,setToolPermissionContext:e=>{p(t=>({...t,toolPermissionContext:e}))}});if(E)return(0,$.jsx)(xe,{onAddDirectory:(e,t)=>{let n={type:`addDirectories`,directories:[e],destination:t?`localSettings`:`session`},r=ue(f,n);p(e=>({...e,toolPermissionContext:r})),t&&oe(n),d(n=>[...n,`Added directory ${y.bold(e)} to workspace${t?` and saved to local settings`:` for this session`}`]),D(!1)},onCancel:()=>D(!1),permissionContext:f});if(O)return(0,$.jsx)(ze,{directoryPath:O,onRemove:()=>{d(e=>[...e,`Removed directory ${y.bold(O)} from workspace`]),k(null)},onCancel:()=>k(null),permissionContext:f,setPermissionContext:e=>{p(t=>({...t,toolPermissionContext:e}))}});let U={searchQuery:he,isSearchMode:A,isFocused:h,onCancel:Te,lastFocusedRuleKey:x,cursorOffset:B,getRulesOptions:P,handleToolSelect:_e,onHeaderFocusChange:M};return(0,$.jsx)(i,{flexDirection:`column`,onKeyDown:ge,children:(0,$.jsxs)(te,{color:`permission`,children:[(0,$.jsxs)(_,{title:`Permissions:`,color:`permission`,defaultTab:l,hidden:!!v||!!S||!!w||E||!!O,initialHeaderFocused:!c,navFromContent:!A,children:[(0,$.jsx)(m,{id:`recent`,title:`Recently denied`,children:(0,$.jsx)(Le,{onHeaderFocusChange:M,onStateChange:ee})}),(0,$.jsx)(m,{id:`allow`,title:`Allow`,children:(0,$.jsx)(Ye,{tab:`allow`,...U})}),(0,$.jsx)(m,{id:`ask`,title:`Ask`,children:(0,$.jsx)(Ye,{tab:`ask`,...U})}),(0,$.jsx)(m,{id:`deny`,title:`Deny`,children:(0,$.jsx)(Ye,{tab:`deny`,...U})}),(0,$.jsx)(m,{id:`workspace`,title:`Workspace`,children:(0,$.jsxs)(i,{flexDirection:`column`,children:[(0,$.jsx)(a,{children:`Work Mate can read files in the workspace, and make edits when auto-accept edits is on.`}),(0,$.jsx)(He,{onExit:e,toolPermissionContext:f,onRequestAddDirectory:Se,onRequestRemoveDirectory:we,onHeaderFocusChange:M})]})})]}),(0,$.jsx)(i,{marginTop:1,paddingLeft:1,children:(0,$.jsx)(a,{dimColor:!0,children:L.pending?(0,$.jsxs)($.Fragment,{children:[`Press `,L.keyName,` again to exit`]}):de?(0,$.jsx)($.Fragment,{children:`←/→ tab switch · ↓ return · Esc cancel`}):A?(0,$.jsx)($.Fragment,{children:`Type to filter · Enter/↓ select · ↑ tabs · Esc clear`}):c&&l===`recent`?(0,$.jsx)($.Fragment,{children:`Enter approve · r retry · ↑↓ navigate · ←/→ switch · Esc cancel`}):(0,$.jsx)($.Fragment,{children:`↑↓ navigate · Enter select · Type to search · ←/→ switch · Esc cancel`})})})]})})}var Q,$,Ze=e((()=>{l(),n(),u(),Q=t(u(),1),de(),N(),M(),ye(),we(),v(),V(),U(),L(),C(),P(),Se(),Ne(),be(),ke(),Ie(),Re(),Ve(),We(),$=x()})),Qe,$e;e((()=>{Ze(),pe(),Qe=x(),$e=async(e,t)=>(0,Qe.jsx)(Xe,{onExit:e,onRetryDenials:e=>{t.setMessages(t=>[...t,D(e)])}})}))();export{$e as call};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{c as r,l as i,n as a,o}from"./envUtils-DSxRz_kt.js";import{n as s,t as c}from"./axios-DaWTGg7G.js";import{_D as ee,bD as te,fC as ne}from"./loadAgentsDir-BURvZNN6.js";import{n as re}from"./cwd-CYmmnQVS.js";import{C as l,E as ie,H as ae,O as oe,S as u,V as se,W as ce,a as d,d as f,l as p,p as m,w as le,z as h}from"./debug-BrXObCdR.js";import{A as g,Jt as ue,M as de,Qt as fe,Zt as pe,en as me,g as he,n as ge}from"./settings-DfWP5y6X.js";import{a as _e,c as _,g as v,i as ve}from"./config-DiT2Z8dY.js";import{c as ye,n as y,o as be,r as b,t as x}from"./execFileNoThrow-D244NytW.js";import{o as S,s as C}from"./log-BMCygSzM.js";import{n as xe,t as Se}from"./which-CKQnSouy.js";import{i as w,o as T}from"./platform-BrYefG_2.js";import{n as E,t as Ce}from"./bundledMode--fG1S62b.js";import{i as we,r as Te}from"./genericProcessUtils-CdQTApYX.js";import{a as Ee,i as De}from"./ripgrep-BXmXjAzA.js";import{n as Oe,r as ke}from"./semver-BMRJYn3q.js";import{homedir as D}from"os";import{basename as Ae,delimiter as je,join as O,posix as k,win32 as A}from"path";import{constants as Me}from"fs";import{access as j,open as Ne,readFile as M,realpath as N,stat as Pe}from"fs/promises";function P(){return O(a(),`local`)}function Fe(){return O(P(),`claude`)}function Ie(){return(process.argv[1]||``).includes(`/.claude/local/node_modules/`)}async function F(){try{return await j(O(P(),`node_modules`,`.bin`,`claude`)),!0}catch{return!1}}function I(){let e=process.env.SHELL||``;return e.includes(`zsh`)?`zsh`:e.includes(`bash`)?`bash`:e.includes(`fish`)?`fish`:`unknown`}var L=e((()=>{v(),o(),h(),b(),m(),S(),u()}));function R(e){let t=e?.homedir??D();return{zsh:O((e?.env??process.env).ZDOTDIR||t,`.zshrc`),bash:O(t,`.bashrc`),fish:O(t,`.config/fish/config.fish`)}}function Le(e){let t=!1;return{filtered:e.filter(e=>{if(V.test(e)){let n=e.match(/alias\s+claude\s*=\s*["']([^"']+)["']/);if(n||(n=e.match(/alias\s+claude\s*=\s*([^#\n]+)/)),n&&n[1]&&n[1].trim()===Fe())return t=!0,!1}return!0}),hadAlias:t}}async function z(e){try{return(await M(e,{encoding:`utf8`})).split(`
|
|
2
|
+
`)}catch(e){if(ae(e))return null;throw e}}async function Re(e,t){let n=await Ne(e,`w`);try{await n.writeFile(t.join(`
|
|
3
|
+
`),{encoding:`utf8`}),await n.datasync()}finally{await n.close()}}async function B(e){let t=R(e);for(let e of Object.values(t)){let t=await z(e);if(t){for(let e of t)if(V.test(e)){let t=e.match(/alias\s+claude=["']?([^"'\s]+)/);if(t&&t[1])return t[1]}}}return null}async function ze(e){let t=await B(e);if(!t)return null;let n=e?.homedir??D(),r=t.startsWith(`~`)?t.replace(`~`,n):t;try{let e=await Pe(r);if(e.isFile()||e.isSymbolicLink())return t}catch{}return null}var V,H=e((()=>{h(),L(),V=/^\s*alias\s+claude\s*=/}));async function Be(){let e=await Ve();return process.env.USER_TYPE===`ant`?e.ant||void 0:e.external||void 0}async function Ve(){try{return{}}catch(e){return C(e),{}}}function He(e){let t=ge()?.minimumVersion;if(!t)return!1;let n=!Oe(e,t);return n&&p(`Skipping update to ${e} - below minimumVersion ${t}`),n}async function Ue(){let e=ue.isRunningWithBun(),t=null;return t=e?await y(`bun`,[`pm`,`bin`,`-g`],{cwd:D()}):await y(`npm`,[`-g`,`config`,`get`,`prefix`],{cwd:D()}),t.code===0?t.stdout.trim():(C(Error(`Failed to check ${e?`bun`:`npm`} permissions`)),null)}async function We(){try{let e=await Ue();if(!e)return{hasPermissions:!1,npmPrefix:null};try{return await j(e,Me.W_OK),{hasPermissions:!0,npmPrefix:e}}catch{return C(new Ye(`Insufficient permissions for global npm install.`)),{hasPermissions:!1,npmPrefix:e}}}catch(e){return C(e),{hasPermissions:!1,npmPrefix:null}}}async function Ge(){let e=await y(`npm`,[`view`,``,`dist-tags`,`--json`,`--prefer-online`],{abortSignal:AbortSignal.timeout(5e3),cwd:D()});if(e.code!==0)return p(`npm view dist-tags failed with code ${e.code}`),{latest:null,stable:null};try{let t=l(e.stdout.trim());return{latest:typeof t.latest==`string`?t.latest:null,stable:typeof t.stable==`string`?t.stable:null}}catch(e){return p(`Failed to parse dist-tags: ${e}`),{latest:null,stable:null}}}async function Ke(e){try{return(await s.get(`${Je}/${e}`,{timeout:5e3,responseType:`text`})).data.trim()}catch(t){return p(`Failed to fetch ${e} from GCS: ${t}`),null}}async function qe(){let[e,t]=await Promise.all([Ke(`latest`),Ke(`stable`)]);return{latest:e,stable:t}}var Je,Ye,Xe=e((()=>{c(),v(),d(),pe(),o(),h(),b(),m(),ne(),S(),ke(),he(),H(),u(),Je=`https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases`,Ye=class extends oe{}}));function U(e,t){return t.includes(e.id)||e.idLike.some(e=>t.includes(e))}function Ze(){let e=process.execPath||process.argv[0]||``;return/[/\\]mise[/\\]installs[/\\]/i.test(e)?(p(`Detected mise installation: ${e}`),!0):!1}function Qe(){let e=process.execPath||process.argv[0]||``;return/[/\\]\.?asdf[/\\]installs[/\\]/i.test(e)?(p(`Detected asdf installation: ${e}`),!0):!1}function W(){let e=w();if(e!==`macos`&&e!==`linux`&&e!==`wsl`)return!1;let t=process.execPath||process.argv[0]||``;return t.includes(`/Caskroom/`)?(p(`Detected Homebrew cask installation: ${t}`),!0):!1}function $e(){if(w()!==`windows`)return!1;let e=process.execPath||process.argv[0]||``;for(let t of[/Microsoft[/\\]WinGet[/\\]Packages/i,/Microsoft[/\\]WinGet[/\\]Links/i])if(t.test(e))return p(`Detected winget installation: ${e}`),!0;return!1}var G,K,q,J,Y,et,tt=e((()=>{n(),d(),b(),T(),G=t(async()=>{try{let e=await M(`/etc/os-release`,`utf8`),t=e.match(/^ID=["']?(\S+?)["']?\s*$/m),n=e.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m);return{id:t?.[1]??``,idLike:n?.[1]?.split(` `)??[]}}catch{return null}}),K=t(async()=>{if(w()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`arch`]))return!1;let t=await x(`pacman`,[`-Qo`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(p(`Detected pacman installation: ${t.stdout.trim()}`),!0):!1}),q=t(async()=>{if(w()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`debian`]))return!1;let t=await x(`dpkg`,[`-S`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(p(`Detected deb installation: ${t.stdout.trim()}`),!0):!1}),J=t(async()=>{if(w()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`fedora`,`rhel`,`suse`]))return!1;let t=await x(`rpm`,[`-qf`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(p(`Detected rpm installation: ${t.stdout.trim()}`),!0):!1}),Y=t(async()=>{if(w()!==`linux`)return!1;let e=await G();if(e&&!U(e,[`alpine`]))return!1;let t=await x(`apk`,[`info`,`--who-owns`,process.execPath||process.argv[0]||``],{timeout:5e3,useCwd:!1});return t.code===0&&t.stdout?(p(`Detected apk installation: ${t.stdout.trim()}`),!0):!1}),et=t(async()=>W()?`homebrew`:$e()?`winget`:Ze()?`mise`:Qe()?`asdf`:await K()?`pacman`:await Y()?`apk`:await q()?`deb`:await J()?`rpm`:`unknown`)}));function nt(){let e=process.argv[1]||``,t=process.execPath||process.argv[0]||``;return w()===`windows`&&(e=e.split(A.sep).join(k.sep),t=t.split(A.sep).join(k.sep)),[e,t]}async function rt(){let[e]=nt();if(E())return W()||$e()||Ze()||Qe()||await K()||await q()||await J()||await Y()?`package-manager`:`native`;if(Ie())return`npm-local`;if([`/usr/local/lib/node_modules`,`/usr/lib/node_modules`,`/opt/homebrew/lib/node_modules`,`/opt/homebrew/bin`,`/usr/local/bin`,`/.nvm/versions/node/`].some(t=>e.includes(t))||e.includes(`/npm/`)||e.includes(`/nvm/`))return`npm-global`;let t=await be(`npm config get prefix`,{shell:!0,reject:!1}),n=t.exitCode===0?t.stdout.trim():null;return n&&e.startsWith(n)?`npm-global`:`unknown`}async function it(){if(E()){try{return await N(process.execPath)}catch{}try{let e=await xe(`claude`);if(e)return e}catch{}try{return await f().stat(O(D(),`.local/bin/claude`)),O(D(),`.local/bin/claude`)}catch{}return`native`}try{return process.argv[0]||`unknown`}catch{return`unknown`}}function at(){try{return E()?process.execPath||`unknown`:process.argv[1]||`unknown`}catch{return`unknown`}}async function ot(){let e=f(),t=[],n=O(D(),`.claude`,`local`);await F()&&t.push({type:`npm-local`,path:n});let r=[`@anthropic-ai/claude-code`],i=await x(`npm`,[`-g`,`config`,`get`,`prefix`]);if(i.code===0&&i.stdout){let n=i.stdout.trim(),a=w()===`windows`,o=a?O(n,`claude`):O(n,`bin`,`claude`),s=!1;try{await e.stat(o),s=!0}catch{}if(s){let e=!1;try{(await N(o)).includes(`/Caskroom/`)&&(e=W())}catch{}e||t.push({type:`npm-global`,path:o})}else for(let i of r){let r=a?O(n,`node_modules`,i):O(n,`lib`,`node_modules`,i);try{await e.stat(r),t.push({type:`npm-global-orphan`,path:r})}catch{}}}let a=O(D(),`.local`,`bin`,`claude`);try{await e.stat(a),t.push({type:`native`,path:a})}catch{}if(_().installMethod===`native`){let n=O(D(),`.local`,`share`,`claude`);try{await e.stat(n),t.some(e=>e.type===`native`)||t.push({type:`native`,path:n})}catch{}}return t}async function st(e){let t=[];try{let e=l(await M(O(fe(),`managed-settings.json`),`utf-8`)),n=e&&typeof e==`object`?e.strictPluginOnlyCustomization:void 0;if(n!==void 0&&typeof n!=`boolean`)if(!Array.isArray(n))t.push({issue:`managed-settings.json: strictPluginOnlyCustomization has an invalid value (expected true or an array, got ${typeof n})`,fix:`The field is silently ignored (schema .catch rescues it). Set it to true, or an array of: ${g.join(`, `)}.`});else{let e=n.filter(e=>typeof e==`string`&&!g.includes(e));e.length>0&&t.push({issue:`managed-settings.json: strictPluginOnlyCustomization has ${e.length} value(s) this client doesn't recognize: ${e.map(String).join(`, `)}`,fix:`These are silently ignored (forwards-compat). Known surfaces for this version: ${g.join(`, `)}. Either remove them, or this client is older than the managed-settings intended.`})}}catch{}let n=_();if(e===`development`)return t;if(e===`native`){let e=(process.env.PATH||``).split(je),n=O(D(),`.local`,`bin`),r=n;if(w()===`windows`&&(r=n.split(A.sep).join(k.sep)),!e.some(e=>{let t=e;w()===`windows`&&(t=e.split(A.sep).join(k.sep));let n=t.replace(/\/+$/,``),i=e.replace(/[/\\]+$/,``);return n===r||i===`~/.local/bin`||i===`$HOME/.local/bin`}))if(w()===`windows`){let e=n.split(k.sep).join(A.sep);t.push({issue:`Native installation exists but ${e} is not in your PATH`,fix:`Add it by opening: System Properties → Environment Variables → Edit User PATH → New → Add the path above. Then restart your terminal.`})}else{let e=I(),n=R()[e],r=n?n.replace(D(),`~`):`your shell config file`;t.push({issue:`Native installation exists but ~/.local/bin is not in your PATH`,fix:`Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${r} then open a new terminal or run: source ${r}`})}}i(process.env.DISABLE_INSTALLATION_CHECKS)||(e===`npm-local`&&n.installMethod!==`local`&&t.push({issue:`Running from local installation but config install method is '${n.installMethod}'`,fix:`Consider using native installation: claude install`}),e===`native`&&n.installMethod!==`native`&&t.push({issue:`Running native installation but config install method is '${n.installMethod}'`,fix:`Run claude install to update configuration`})),e===`npm-global`&&await F()&&t.push({issue:`Local installation exists but not being used`,fix:`Consider using native installation: claude install`});let r=await B(),a=await ze();return e===`npm-local`&&!await xe(`claude`)&&!a&&(r?t.push({issue:`Local installation not accessible`,fix:`Alias exists but points to invalid target: ${r}. Update alias: alias claude="~/.claude/local/claude"`}):t.push({issue:`Local installation not accessible`,fix:`Create alias: alias claude="~/.claude/local/claude"`})),t}function ct(){if(w()!==`linux`)return[];let e=[],t=ee.getLinuxGlobPatternWarnings();if(t.length>0){let n=t.slice(0,3).join(`, `),r=t.length-3,i=r>0?`${n} (${r} more)`:n;e.push({issue:`Glob patterns in sandbox permission rules are not fully supported on Linux`,fix:`Found ${t.length} pattern(s): ${i}. On Linux, glob patterns in Edit/Read rules will be ignored.`})}return e}async function lt(){let e=await rt(),t=typeof MACRO<`u`?`0.0.4`:`unknown`,n=await it(),r=at(),i=await ot(),a=await st(e);if(a.push(...ct()),e===`native`){let e=i.filter(e=>e.type===`npm-global`||e.type===`npm-global-orphan`||e.type===`npm-local`),t=w()===`windows`;for(let n of e)n.type===`npm-global`?a.push({issue:`Leftover npm global installation at ${n.path}`,fix:`Run: npm -g uninstall @anthropic-ai/claude-code`}):n.type===`npm-global-orphan`?a.push({issue:`Orphaned npm global package at ${n.path}`,fix:t?`Run: rmdir /s /q "${n.path}"`:`Run: rm -rf ${n.path}`}):n.type===`npm-local`&&a.push({issue:`Leftover npm local installation at ${n.path}`,fix:t?`Run: rmdir /s /q "${n.path}"`:`Run: rm -rf ${n.path}`})}let o=_().installMethod||`not set`,s=null;e===`npm-global`&&(s=(await We()).hasPermissions,!s&&!_e()&&a.push({issue:`Insufficient permissions for auto-updates`,fix:"Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation"}));let c=De(),ee={working:c.working??!0,mode:c.mode,systemPath:c.mode===`system`?c.path:null,note:c.note??null},te=e===`package-manager`?await et():void 0;return{installationType:e,version:t,installationPath:n,invokedBinary:r,configInstallMethod:o,autoUpdates:(()=>{let e=_e();return e?`disabled (${ve(e)})`:`enabled`})(),hasUpdatePermissions:s,multipleInstallations:i,warnings:a,packageManager:te,ripgrepStatus:ee}}var ut=e((()=>{ye(),Xe(),Ce(),v(),re(),o(),b(),m(),L(),tt(),T(),Ee(),te(),me(),de(),H(),u(),Se()}));function dt(){let e=process.env.ENABLE_PID_BASED_VERSION_LOCKING;return i(e)?!0:(r(e),!1)}function X(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}function ft(e,t){if(!X(e))return!1;if(e===process.pid)return!0;try{let n=Te(e);if(!n)return!0;let r=n.toLowerCase(),i=t.toLowerCase();return r.includes(`claude`)||r.includes(i)}catch{return!0}}function Z(e){let t=f();try{let n=t.readFileSync(e,{encoding:`utf8`});if(!n||n.trim()===``)return null;let r=l(n);return typeof r.pid!=`number`||!r.version||!r.execPath?null:r}catch{return null}}function Q(e){let t=Z(e);if(!t)return!1;let{pid:n,execPath:r}=t;if(!X(n))return!1;if(!ft(n,r))return p(`Lock PID ${n} is running but does not appear to be Claude - treating as stale`),!1;let i=f();try{let t=i.statSync(e);if(Date.now()-t.mtimeMs>$&&!X(n))return!1}catch{}return!0}function pt(e,t){let n=f(),r=`${e}.tmp.${process.pid}.${Date.now()}`;try{ie(r,le(t,null,2),{encoding:`utf8`,flush:!0}),n.renameSync(r,e)}catch(e){try{n.unlinkSync(r)}catch{}throw e}}async function mt(e,t){let n=f(),r=Ae(e);if(Q(t))return p(`Cannot acquire lock for ${r} - held by PID ${Z(t)?.pid}`),null;let i={pid:process.pid,version:r,execPath:process.execPath,acquiredAt:Date.now()};try{return pt(t,i),Z(t)?.pid===process.pid?(p(`Acquired PID lock for ${r} (PID ${process.pid})`),()=>{try{Z(t)?.pid===process.pid&&(n.unlinkSync(t),p(`Released PID lock for ${r}`))}catch(e){p(`Failed to release lock for ${r}: ${e}`)}}):null}catch(e){return p(`Failed to acquire lock for ${r}: ${e}`),null}}async function ht(e,t){let n=await mt(e,t);if(!n)return!1;let r=()=>{try{n()}catch{}};return process.on(`exit`,r),process.on(`SIGINT`,r),process.on(`SIGTERM`,r),!0}async function gt(e,t,n){let r=await mt(e,t);if(!r)return!1;try{return await n(),!0}finally{r()}}function _t(e){let t=f(),n=[];try{let r=t.readdirStringSync(e).filter(e=>e.endsWith(`.lock`));for(let t of r){let r=O(e,t),i=Z(r);i&&n.push({version:i.version,pid:i.pid,isProcessRunning:X(i.pid),execPath:i.execPath,acquiredAt:new Date(i.acquiredAt),lockFilePath:r})}}catch(e){if(se(e))return n;C(ce(e))}return n}function vt(e){let t=f(),n=0;try{let r=t.readdirStringSync(e).filter(e=>e.endsWith(`.lock`));for(let i of r){let r=O(e,i);try{t.lstatSync(r).isDirectory()?(t.rmSync(r,{recursive:!0,force:!0}),n++,p(`Cleaned up legacy directory lock: ${i}`)):Q(r)||(t.unlinkSync(r),n++,p(`Cleaned up stale lock: ${i}`))}catch{}}}catch(e){if(se(e))return 0;C(ce(e))}return n}var $,yt=e((()=>{d(),o(),h(),m(),we(),S(),u(),$=7200*1e3}));export{L as C,I as S,Le as _,Q as a,z as b,gt as c,ut as d,qe as f,He as g,Xe as h,yt as i,rt as l,Ge as m,vt as n,dt as o,Be as p,_t as r,Z as s,ht as t,lt as u,R as v,Re as x,H as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{o as r}from"./log-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-DSxRz_kt.js";import{o as r}from"./log-BMCygSzM.js";import{join as i}from"path";import"fs/promises";import"net";import"events";function a(){return i(t(),`pipes`)}function o(e){return e?.pipeIpc??s}var s,c=e((()=>{n(),r(),s={role:`main`,subIndex:null,displayRole:`main`,serverName:null,attachedBy:null,localIp:null,hostname:null,machineId:null,mac:null,statusVisible:!1,selectorOpen:!1,selectedPipes:[],routeMode:`selected`,slaves:{},discoveredPipes:[]}}));export{a as n,c as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Yt as o,en as s}from"./state-ix0xIunV.js";import{A as c,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Yt as o,en as s}from"./state-ix0xIunV.js";import{A as c,C as l,Lg as u,Og as d,bw as f,fb as p,gb as m,pb as h,ww as g}from"./loadAgentsDir-BURvZNN6.js";import{a as _,i as v,r as y,t as b}from"./promptEditor-DMJyosKj.js";import{r as x,t as S}from"./staticRender-BIxpgNUq.js";function C({planContent:e,planPath:r,editorName:i}){return(0,T.jsxs)(t,{flexDirection:`column`,children:[(0,T.jsx)(n,{bold:!0,children:`Current Plan`}),(0,T.jsx)(n,{dimColor:!0,children:r}),(0,T.jsx)(t,{marginTop:1,children:(0,T.jsx)(n,{children:e})}),i&&(0,T.jsxs)(t,{marginTop:1,children:[(0,T.jsx)(n,{dimColor:!0,children:`"/plan open"`}),(0,T.jsx)(n,{dimColor:!0,children:` to edit this plan in `}),(0,T.jsx)(n,{bold:!0,dimColor:!0,children:i})]})]})}async function w(e,t,n){let{getAppState:r,setAppState:i}=t,a=r().toolPermissionContext.mode;if(a!==`plan`){o(a,`plan`),i(e=>({...e,toolPermissionContext:f(c(e.toolPermissionContext),{type:`setMode`,mode:`plan`,destination:`session`})}));let t=n.trim();return t&&t!==`open`?e(`Enabled plan mode`,{shouldQuery:!0}):e(`Enabled plan mode`),null}let s=p(),l=h();if(!s)return e(`Already in plan mode. No plan written yet.`),null;if(n.trim().split(/\s+/)[0]===`open`){let t=await b(l);return t.error?e(`Failed to open plan in editor: ${t.error}`):e(`Opened plan in editor: ${l}`),null}let d=v();return e(await x((0,T.jsx)(C,{planContent:s,planPath:l,editorName:d?u(d):void 0}))),null}var T;e((()=>{r(),s(),i(),_(),d(),g(),l(),m(),y(),S(),T=a()}))();export{w as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{d as r,p as i}from"./debug-BrXObCdR.js";import{o as a,s as o}from"./log-BMCygSzM.js";import{release as s}from"os";import{readFile as c,readdir as l}from"fs/promises";async function u(e){let t=new Set;process.env.P4PORT&&t.add(`perforce`);try{let n=e??r().cwd(),i=new Set(await l(n));for(let[e,n]of h)i.has(e)&&t.add(n)}catch{}return[...t]}var d,f,p,m,h,g=e((()=>{n(),i(),a(),d=[`macos`,`wsl`],f=t(()=>{try{if(process.platform===`darwin`)return`macos`;if(process.platform===`win32`)return`windows`;if(process.platform===`linux`){try{let e=r().readFileSync(`/proc/version`,{encoding:`utf8`});if(e.toLowerCase().includes(`microsoft`)||e.toLowerCase().includes(`wsl`))return`wsl`}catch(e){o(e)}return`linux`}return`unknown`}catch(e){return o(e),`unknown`}}),p=t(()=>{if(process.platform===`linux`)try{let e=r().readFileSync(`/proc/version`,{encoding:`utf8`}),t=e.match(/WSL(\d+)/i);return t&&t[1]?t[1]:e.toLowerCase().includes(`microsoft`)?`1`:void 0}catch(e){o(e);return}}),m=t(async()=>{if(process.platform!==`linux`)return;let e={linuxKernel:s()};try{let t=await c(`/etc/os-release`,`utf8`);for(let n of t.split(`
|
|
2
2
|
`)){let t=n.match(/^(ID|VERSION_ID)=(.*)$/);if(t&&t[1]&&t[2]){let n=t[2].replace(/^"|"$/g,``);t[1]===`ID`?e.linuxDistroId=n:e.linuxDistroVersion=n}}}catch{}return e}),h=[[`.git`,`git`],[`.hg`,`mercurial`],[`.svn`,`svn`],[`.p4config`,`perforce`],[`$tf`,`tfs`],[`.tfvc`,`tfs`],[`.jj`,`jujutsu`],[`.sl`,`sapling`]]}));export{p as a,f as i,u as n,g as o,m as r,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./PluginSettings-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./PluginSettings-DUxj_oAg.js";async function a(e,t,n){return(0,o.jsx)(i,{onComplete:e,args:n})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Es as t,Gs as n,Hs as r,Ls as i,Os as a,Vs as o,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Es as t,Gs as n,Hs as r,Ls as i,Os as a,Vs as o,aO as s,js as c,rO as l}from"./loadAgentsDir-BURvZNN6.js";import{F as u,a as d,l as f,z as p}from"./debug-BrXObCdR.js";import{St as m,Tt as h}from"./settings-DfWP5y6X.js";import{g,x as _}from"./config-DiT2Z8dY.js";import{o as v,s as y}from"./log-BMCygSzM.js";import{f as b,s as x}from"./pluginOperations-JEedVzfS.js";function S(e){return O=e,k!==null&&k.length>0&&(e(k),k=null),()=>{O=null}}async function C(){let e=await r(),t=i(),n=new Set;for(let[r,i]of Object.entries(e)){let e=t[r]?.autoUpdate;(e===void 0?h(r,i):e)&&n.add(r.toLowerCase())}return n}async function w(e,t){let n=!1;for(let{scope:r}of t)try{let t=await b(e,r);t.success&&!t.alreadyUpToDate?(n=!0,f(`Plugin autoupdate: updated ${e} from ${t.oldVersion} to ${t.newVersion}`)):t.alreadyUpToDate||f(`Plugin autoupdate: failed to update ${e}: ${t.message}`,{level:`warn`})}catch(t){f(`Plugin autoupdate: error updating ${e}: ${u(t)}`,{level:`warn`})}return n?e:null}async function T(e){let t=c(),n=Object.keys(t.plugins);return n.length===0?[]:(await Promise.allSettled(n.map(async n=>{let{marketplace:r}=s(n);if(!r||!e.has(r.toLowerCase()))return null;let i=t.plugins[n];if(!i||i.length===0)return null;let o=i.filter(a);return o.length===0?null:w(n,o)}))).filter(e=>e.status===`fulfilled`&&e.value!==null).map(e=>e.value)}async function E(e){return T(e)}function D(){(async()=>{if(_()){f(`Plugin autoupdate: skipped (auto-updater disabled)`);return}try{let e=await C();if(e.size===0)return;let t=(await Promise.allSettled(Array.from(e).map(async e=>{try{await n(e,void 0,{disableCredentialHelper:!0})}catch(t){f(`Plugin autoupdate: failed to refresh marketplace ${e}: ${u(t)}`,{level:`warn`})}}))).filter(e=>e.status===`rejected`);t.length>0&&f(`Plugin autoupdate: ${t.length} marketplace refresh(es) failed`,{level:`warn`}),f(`Plugin autoupdate: checking installed plugins`);let r=await E(e);r.length>0&&(O?O(r):k=r)}catch(e){y(e)}})()}var O,k,A=e((()=>{x(),g(),d(),p(),v(),t(),o(),l(),m(),O=null,k=null}));export{T as i,A as n,S as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Es as e,Ms as t,Rs as n,Us as r,Vs as i}from"./loadAgentsDir-BURvZNN6.js";import{F as a,a as o,l as s,z as c}from"./debug-BrXObCdR.js";import{i as l,n as u,r as d,t as f}from"./pluginFlagging-mHNff1t9.js";import{d as p,s as m}from"./pluginOperations-JEedVzfS.js";m(),o(),c(),e(),i(),d();function h(e,t,n){let r=new Set(t.plugins.map(e=>e.name)),i=`@${n}`,a=[];for(let t of Object.keys(e.plugins)){if(!t.endsWith(i))continue;let e=t.slice(0,-i.length);r.has(e)||a.push(t)}return a}async function g(){await l();let e=t(),i=u(),o=await r(),c=[];for(let t of Object.keys(o))try{let r=await n(t);if(!r.forceRemoveDeletedPlugins)continue;let o=h(e,r,t);for(let t of o){if(t in i)continue;let n=e.plugins[t]??[];if(n.some(e=>e.scope===`user`||e.scope===`project`||e.scope===`local`)){for(let e of n){let{scope:n}=e;if(!(n!==`user`&&n!==`project`&&n!==`local`))try{await p(t,n)}catch(e){s(`Failed to auto-uninstall delisted plugin ${t} from ${n}: ${a(e)}`,{level:`error`})}}await f(t),c.push(t)}}}catch(e){s(`Failed to check for delisted plugins in "${t}": ${a(e)}`,{level:`warn`})}return c}export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{Ts as n,_y as r,aO as i,fC as a,rO as o,uC as s,vy as c,ws as l,yy as u}from"./loadAgentsDir-BURvZNN6.js";import{F as d,z as f}from"./debug-BrXObCdR.js";import{n as p,o as m}from"./process-gEbdy6uY.js";import{o as h,s as g}from"./log-BMCygSzM.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{a as y,c as b,d as x,f as S,i as C,r as w,s as T}from"./pluginOperations-JEedVzfS.js";e(),f(),a(),h(),n(),o(),p(),u(),_(),T();function E(e,n,a){g(e);let o=a?`${n} plugin "${a}"`:n===`disable-all`?`disable all plugins`:`${n} plugins`;console.error(`${t.cross} Failed to ${o}: ${d(e)}`);let s=a?(()=>{let{name:e,marketplace:t}=i(a);return{_PROTO_plugin_name:e,...t&&{_PROTO_marketplace_name:t},...r(e,t,l())}})():{};v(`tengu_plugin_command_failed`,{command:n,error_category:c(e),...s}),process.exit(1)}async function D(e,n=`user`){try{console.log(`Installing plugin "${e}"...`);let a=await b(e,n);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=i(a.pluginId||e);v(`tengu_plugin_installed_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope||n,install_source:`cli-explicit`,...r(o,s,l())}),process.exit(0)}catch(t){E(t,`install`,e)}}async function O(e,n=`user`,a=!1){try{let o=await x(e,n,!a);if(!o.success)throw Error(o.message);console.log(`${t.tick} ${o.message}`);let{name:s,marketplace:c}=i(o.pluginId||e);v(`tengu_plugin_uninstalled_cli`,{_PROTO_plugin_name:s,...c&&{_PROTO_marketplace_name:c},scope:o.scope||n,...r(s,c,l())}),process.exit(0)}catch(t){E(t,`uninstall`,e)}}async function k(e,n){try{let a=await y(e,n);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=i(a.pluginId||e);v(`tengu_plugin_enabled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope,...r(o,s,l())}),process.exit(0)}catch(t){E(t,`enable`,e)}}async function A(e,n){try{let a=await C(e,n);if(!a.success)throw Error(a.message);console.log(`${t.tick} ${a.message}`);let{name:o,marketplace:s}=i(a.pluginId||e);v(`tengu_plugin_disabled_cli`,{_PROTO_plugin_name:o,...s&&{_PROTO_marketplace_name:s},scope:a.scope,...r(o,s,l())}),process.exit(0)}catch(t){E(t,`disable`,e)}}async function j(){try{let e=await w();if(!e.success)throw Error(e.message);console.log(`${t.tick} ${e.message}`),v(`tengu_plugin_disabled_all_cli`,{}),process.exit(0)}catch(e){E(e,`disable-all`)}}async function M(e,n){try{m(`Checking for updates for plugin "${e}" at ${n} scope…\n`);let a=await S(e,n);if(!a.success)throw Error(a.message);if(m(`${t.tick} ${a.message}\n`),!a.alreadyUpToDate){let{name:t,marketplace:n}=i(a.pluginId||e);v(`tengu_plugin_updated_cli`,{_PROTO_plugin_name:t,...n&&{_PROTO_marketplace_name:n},old_version:a.oldVersion||`unknown`,new_version:a.newVersion||`unknown`,...r(t,n,l())})}await s(0)}catch(t){E(t,`update`,e)}}export{O as a,D as i,A as n,M as o,k as r,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,o as n}from"./isObject-C6qM3WEW.js";import{Br as r,Ci as i,Fi as a,Hr as o,Kr as s,Mi as ee,Ni as te,Pi as ne,Rr as c,Si as re,Ur as l,Vr as u,qr as ie,zr as ae}from"./state-ix0xIunV.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,o as n}from"./isObject-C6qM3WEW.js";import{Br as r,Ci as i,Fi as a,Hr as o,Kr as s,Mi as ee,Ni as te,Pi as ne,Rr as c,Si as re,Ur as l,Vr as u,qr as ie,zr as ae}from"./state-ix0xIunV.js";import{UD as oe,WD as se,XO as ce,ZO as le,_O as ue,gO as de,hD as fe,mD as d}from"./loadAgentsDir-BURvZNN6.js";import{C as f,S as p,a as m,d as h,l as g,p as _,w as v}from"./debug-BrXObCdR.js";import{An as y,Dn as b,En as x,Jn as S,On as C,Yn as w,jn as T,kn as E}from"./settings-DfWP5y6X.js";import{R as D,z as O}from"./config-DiT2Z8dY.js";import{o as k,s as A}from"./log-BMCygSzM.js";import{join as j}from"path";import{randomBytes as M}from"crypto";import{readFile as N,rename as P,unlink as F,writeFile as I}from"fs/promises";function L(e){return te(e)||i(e)||!!(R&&e&&e[R])}var R,z=e((()=>{n(),re(),ee(),R=t?t.isConcatSpreadable:void 0}));function B(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=L),i||(i=[]);++a<o;){var s=e[a];t>0&&n(s)?t>1?B(s,t-1,n,r,i):ne(i,s):r||(i[i.length]=s)}return i}var V=e((()=>{a(),z()}));function pe(e){return e!=null&&e.length?B(e,1):[]}var me=e((()=>{V()}));function he(e){return b(E(e,void 0,pe),e+``)}var ge=e((()=>{me(),C(),x()}));function _e(e,t){return t.length<2?e:c(e,oe(t,0,-1))}var ve=e((()=>{ae(),se()}));function ye(e,t){t=o(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=u(t[n]);if(i===`__proto__`&&!H.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=_e(e,t);return a==null||delete a[u(ue(t))]}var H,be=e((()=>{l(),de(),ve(),r(),H=Object.prototype.hasOwnProperty}));function xe(e){return T(e)?void 0:e}var Se=e((()=>{y()})),U,W,G,K,Ce=e((()=>{ie(),le(),be(),l(),w(),Se(),ge(),O(),U=1,W=2,G=4,K=he(function(e,t){var n={};if(e==null)return n;var r=!1;t=s(t,function(t){return t=o(t,e),r||(r=t.length>1),t}),S(e,D(e),n),r&&(n=ce(n,U|W|G,xe));for(var i=t.length;i--;)ye(n,t[i]);return n})}));function q(){return j(d(),Z)}function we(e){let t=f(e);if(typeof t!=`object`||!t||!(`plugins`in t)||typeof t.plugins!=`object`||t.plugins===null)return{};let n=t.plugins,r={};for(let[e,t]of Object.entries(n))if(t&&typeof t==`object`&&`flaggedAt`in t&&typeof t.flaggedAt==`string`){let n={flaggedAt:t.flaggedAt};`seenAt`in t&&typeof t.seenAt==`string`&&(n.seenAt=t.seenAt),r[e]=n}return r}async function J(){try{return we(await N(q(),{encoding:`utf-8`}))}catch{return{}}}async function Y(e){let t=q(),n=`${t}.${M(8).toString(`hex`)}.tmp`;try{await h().mkdir(d()),await I(n,v({plugins:e},null,2),{encoding:`utf-8`,mode:384}),await P(n,t),$=e}catch(e){A(e);try{await F(n)}catch{}}}async function Te(){let e=await J(),t=Date.now(),n=!1;for(let[r,i]of Object.entries(e))i.seenAt&&t-new Date(i.seenAt).getTime()>=Q&&(delete e[r],n=!0);$=e,n&&await Y(e)}function Ee(){return $??{}}async function X(e){$===null&&($=await J()),await Y({...$,[e]:{flaggedAt:new Date().toISOString()}}),g(`Flagged plugin: ${e}`)}async function De(e){$===null&&($=await J());let t=new Date().toISOString(),n=!1,r={...$};for(let i of e){let e=r[i];e&&!e.seenAt&&(r[i]={...e,seenAt:t},n=!0)}n&&await Y(r)}async function Oe(e){if($===null&&($=await J()),!(e in $))return;let{[e]:t,...n}=$;$=n,await Y(n)}var Z,Q,$,ke=e((()=>{m(),_(),k(),p(),fe(),Z=`flagged-plugins.json`,Q=2880*60*1e3,$=null}));export{De as a,K as c,Te as i,Ee as n,Oe as o,ke as r,Ce as s,X as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{en as t,nt as n}from"./state-ix0xIunV.js";import{Bs as r,Cs as i,Es as a,Hs as o,Ms as s,Ns as c,Ps as l,Rs as u,Ss as d,Vs as f,_s as p,aO as m,am as h,bs as g,dD as ee,dO as _,dc as v,ds as y,eO as b,fs as x,hD as S,hs as C,iv as w,js as T,lc as E,ls as te,nO as ne,oO as D,om as O,ov as k,ps as A,rO as j,ss as re,tO as M,uO as ie,uc as ae,us as N,vs as oe}from"./loadAgentsDir-BURvZNN6.js";import{V as P,W as se,d as ce,p as F,z as I}from"./debug-BrXObCdR.js";import{c as L,g as R,y as z}from"./settings-DfWP5y6X.js";import{o as B,s as V}from"./log-BMCygSzM.js";import{l as H,o as U}from"./stringUtils-DGLPkqJ4.js";import{n as W,t as G}from"./pluginStartupCheck-RscVZDi4.js";import{dirname as le,join as K}from"path";function q(e){if(!Q.includes(e))throw Error(`Invalid scope "${e}". Must be one of: ${Q.join(`, `)}`)}function ue(e){return Q.includes(e)}function J(e){return e===`project`||e===`local`?n():void 0}function de(e){return L(`projectSettings`)?.enabledPlugins?.[e]===!0}function fe(e){let t=e.includes(`@`);for(let n of[`local`,`project`,`user`]){let r=L(D(n))?.enabledPlugins;if(r){for(let i of Object.keys(r))if(t?i===e:i.startsWith(`${e}@`))return{pluginId:i,scope:n}}}return null}function pe(e,t){let{name:n,marketplace:r}=m(e);return t.find(t=>t.name===e||t.name===n?!0:r&&t.source?t.name===n&&t.source.includes(`@${r}`):!1)}function me(e){let{name:t}=m(e),n=s();if(n.plugins[e]?.length)return{pluginId:e,pluginName:t};let r=Object.keys(n.plugins).find(e=>{let{name:r}=m(e);return r===t&&(n.plugins[e]?.length??0)>0});return r?{pluginId:r,pluginName:t}:null}function Y(e){let t=s().plugins[e];if(!t||t.length===0)return{scope:`user`};let r=n(),i=t.find(e=>e.scope===`local`&&e.projectPath===r);if(i)return{scope:i.scope,projectPath:i.projectPath};let a=t.find(e=>e.scope===`project`&&e.projectPath===r);if(a)return{scope:a.scope,projectPath:a.projectPath};let o=t.find(e=>e.scope===`user`);return o?{scope:o.scope}:{scope:t[0].scope,projectPath:t[0].projectPath}}async function he(e,t=`user`){q(t);let{name:n,marketplace:i}=m(e),a,s,c;if(i){let t=await r(e);t&&(a=t.entry,s=i,c=t.marketplaceInstallLocation)}else{let e=await o();for(let[t,r]of Object.entries(e))try{let e=(await u(t)).plugins.find(e=>e.name===n);if(e){a=e,s=t,c=r.installLocation;break}}catch(e){V(se(e))}}if(!a||!s)return{success:!1,message:`Plugin "${n}" not found in ${i?`marketplace "${i}"`:`any configured marketplace`}`};let l=a,d=`${l.name}@${s}`,f=await g({pluginId:d,entry:l,scope:t,marketplaceInstallLocation:c});if(!f.ok){let e=f;switch(e.reason){case`local-source-no-location`:return{success:!1,message:`Cannot install local plugin "${e.pluginName}" without marketplace install location`};case`settings-write-failed`:return{success:!1,message:`Failed to update settings: ${e.message}`};case`resolution-failed`:return{success:!1,message:p(e.resolution)};case`blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" is blocked by your organization's policy and cannot be installed`};case`dependency-blocked-by-policy`:return{success:!1,message:`Plugin "${e.pluginName}" depends on "${e.blockedDependency}", which is blocked by your organization's policy`}}}return{success:!0,message:`Successfully installed plugin: ${d} (scope: ${t})${f.depNote}`,pluginId:d,pluginName:l.name,scope:t}}async function ge(e,t=`user`,n=!0){q(t);let{enabled:r,disabled:i}=await A(),a=[...r,...i],o=pe(e,a),l=D(t),u=L(l),d,f;if(o)d=Object.keys(u?.enabledPlugins??{}).find(t=>t===e||t===o.name||t.startsWith(`${o.name}@`))??(e.includes(`@`)?e:o.name),f=o.name;else{let t=me(e);if(!t)return{success:!1,message:`Plugin "${e}" not found in installed plugins`};d=t.pluginId,f=t.pluginName}let p=J(t),m=s().plugins[d],h=m?.find(e=>e.scope===t&&e.projectPath===p);if(!h){let{scope:n}=Y(d);return n!==t&&m&&m.length>0?n===`project`?{success:!1,message:`Plugin "${e}" is enabled at project scope (.claude/settings.json, shared with your team). To disable just for you: claude plugin disable ${e} --scope local`}:{success:!1,message:`Plugin "${e}" is installed in ${n} scope, not ${t}. Use --scope ${n} to uninstall.`}:{success:!1,message:`Plugin "${e}" is not installed in ${t} scope. Use --scope to specify the correct scope.`}}let g=h.installPath,_={...u?.enabledPlugins};_[d]=void 0,z(l,{enabledPlugins:_}),E(),c(d,t,p);let y=s().plugins[d],x=!y||y.length===0;x&&g&&await v(g),x&&(w(d),n&&await ee(d));let S=b(d,a),C=M(S);return{success:!0,message:`Successfully uninstalled plugin: ${f} (scope: ${t})${C}`,pluginId:d,pluginName:f,scope:t,reverseDependents:S.length>0?S:void 0}}async function X(e,t,n){let r=t?`enable`:`disable`;if(_(e)){let{error:n}=z(`userSettings`,{enabledPlugins:{...L(`userSettings`)?.enabledPlugins,[e]:t}});if(n)return{success:!1,message:`Failed to ${r} built-in plugin: ${n.message}`};E();let{name:i}=m(e);return{success:!0,message:`Successfully ${r}d built-in plugin: ${i}`,pluginId:e,pluginName:i,scope:`user`}}n&&q(n);let i,a,o=fe(e);if(n)if(a=n,o)i=o.pluginId;else if(e.includes(`@`))i=e;else return{success:!1,message:`Plugin "${e}" not found in settings. Use plugin@marketplace format.`};else if(o)i=o.pluginId,a=o.scope;else if(e.includes(`@`))i=e,a=`user`;else return{success:!1,message:`Plugin "${e}" not found in any editable settings scope. Use plugin@marketplace format.`};if(t&&O(i))return{success:!1,message:`Plugin "${i}" is blocked by your organization's policy and cannot be enabled`};let s=D(a),c=L(s)?.enabledPlugins?.[i],l={user:0,project:1,local:2},u=n&&o&&l[n]>l[o.scope];if(n&&c===void 0&&o&&o.scope!==n&&!u)return{success:!1,message:`Plugin "${e}" is installed at ${o.scope} scope, not ${n}. Use --scope ${o.scope} or omit --scope to auto-detect.`};if(t===(n&&!u?c===!0:G().has(i)))return{success:!1,message:`Plugin "${e}" is already ${t?`enabled`:`disabled`}${n?` at ${n} scope`:``}`};let d;if(!t){let{enabled:e,disabled:t}=await A(),n=b(i,[...e,...t]);n.length>0&&(d=n)}let{error:f}=z(s,{enabledPlugins:{...L(s)?.enabledPlugins,[i]:t}});if(f)return{success:!1,message:`Failed to ${r} plugin: ${f.message}`};E();let{name:p}=m(i),h=M(d);return{success:!0,message:`Successfully ${r}d plugin: ${p} (scope: ${a})${h}`,pluginId:i,pluginName:p,scope:a,reverseDependents:d}}async function _e(e,t){return X(e,!0,t)}async function ve(e,t){return X(e,!1,t)}async function Z(){let e=G();if(e.size===0)return{success:!0,message:`No enabled plugins to disable`};let t=[],n=[];for(let[r]of e){let e=await X(r,!1);e.success?t.push(r):n.push(`${r}: ${e.message}`)}return n.length>0?{success:!1,message:`Disabled ${t.length} ${H(t.length,`plugin`)}, ${n.length} failed:\n${n.join(`
|
|
2
|
+
`)}`}:{success:!0,message:`Disabled ${t.length} ${H(t.length,`plugin`)}`}}async function ye(e,t){let{name:n,marketplace:i}=m(e),a=i?`${n}@${i}`:e,o=await r(e);if(!o)return{success:!1,message:`Plugin "${n}" not found`,pluginId:a,scope:t};let{entry:s,marketplaceInstallLocation:c}=o,l=T().plugins[a];if(!l||l.length===0)return{success:!1,message:`Plugin "${n}" is not installed`,pluginId:a,scope:t};let u=J(t),d=l.find(e=>e.scope===t&&e.projectPath===u);return d?be({pluginId:a,pluginName:n,entry:s,marketplaceInstallLocation:c,installation:d,scope:t,projectPath:u}):{success:!1,message:`Plugin "${n}" is not installed at scope ${u?`${t} (${u})`:t}`,pluginId:a,scope:t}}async function be({pluginId:e,pluginName:t,entry:n,marketplaceInstallLocation:r,installation:i,scope:a,projectPath:o}){let s=ce(),c=i.version,u,f,p=!1,m;if(typeof n.source!=`string`){let t=await re(n.source,{manifest:{name:n.name}});u=t.path,p=!0,m=t.gitCommitSha,f=await d(e,n.source,t.manifest,t.path,n.version,t.gitCommitSha)}else{let t;try{t=await s.stat(r)}catch(t){if(P(t))return{success:!1,message:`Marketplace directory not found at ${r}`,pluginId:e,scope:a};throw t}u=K(t.isDirectory()?r:le(r),n.source);try{await s.stat(u)}catch(t){if(P(t))return{success:!1,message:`Plugin source not found at ${u}`,pluginId:e,scope:a};throw t}let i,o=K(u,`.claude-plugin`,`plugin.json`);try{i=await C(o,n.name,n.source)}catch{}f=await d(e,n.source,i,u,n.version)}try{let r=N(e,f),s=y(e,f);if(i.version===f||i.installPath===r||i.installPath===s)return{success:!0,message:`${t} is already at the latest version (${f}).`,pluginId:e,newVersion:f,oldVersion:c,alreadyUpToDate:!0,scope:a};r=await te(u,e,f,n);let d=i.installPath;if(l(e,a,o,r,f,m),d&&d!==r){let e=T();Object.values(e.plugins).some(e=>e.some(e=>e.installPath===d))||await v(d)}let p=o?`${a} (${o})`:a;return{success:!0,message:`Plugin "${t}" updated from ${c||`unknown`} to ${f} for scope ${p}. Restart to apply changes.`,pluginId:e,newVersion:f,oldVersion:c,scope:a}}finally{p&&u!==N(e,f)&&await s.rm(u,{recursive:!0,force:!0})}}var Q,$,xe=e((()=>{t(),ie(),I(),F(),B(),ae(),ne(),a(),f(),S(),j(),oe(),x(),k(),h(),W(),i(),R(),U(),Q=[`user`,`project`,`local`],$=[`user`,`project`,`local`,`managed`]}));export{_e as a,he as c,ge as d,ye as f,ve as i,ue as l,$ as n,Y as o,Z as r,xe as s,Q as t,de as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./pluginStartupCheck-RscVZDi4.js";e();export{t as getPluginEditableScopes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bs as t,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bs as t,Es as n,Vs as r,cO as i,gs as a,oO as o,rO as s,sO as c,vs as l,xs as u}from"./loadAgentsDir-BURvZNN6.js";import{n as d,t as f}from"./cwd-CYmmnQVS.js";import{a as p,l as m}from"./debug-BrXObCdR.js";import{St as h,c as g,g as _,wt as v,y}from"./settings-DfWP5y6X.js";import{o as b,s as x}from"./log-BMCygSzM.js";import{join as S}from"path";function C(){let e=new Map,t=c();for(let[n,r]of Object.entries(t))n.includes(`@`)&&(r===!0?e.set(n,`flag`):r===!1&&e.delete(n));for(let{scope:n,source:r}of[{scope:`managed`,source:`policySettings`},{scope:`user`,source:`userSettings`},{scope:`project`,source:`projectSettings`},{scope:`local`,source:`localSettings`},{scope:`flag`,source:`flagSettings`}]){let i=g(r);if(i?.enabledPlugins)for(let[a,o]of Object.entries(i.enabledPlugins))a.includes(`@`)&&(a in t&&t[a]!==o&&m(`Plugin ${a} from --add-dir (${t[a]}) overridden by ${r} (${o})`),o===!0?e.set(a,n):o===!1&&e.delete(a))}return m(`Found ${e.size} enabled plugins with scopes: ${Array.from(e.entries()).map(([e,t])=>`${e}(${t})`).join(`, `)}`),e}async function w(e,n,r=`user`){let i=r===`user`?void 0:f(),s=o(r),c=g(s),l={...c?.enabledPlugins},d=[],p=[];for(let o=0;o<e.length;o++){let s=e[o];if(s){n&&n(s,o+1,e.length);try{let e=await t(s);if(!e){p.push({name:s,error:`Plugin not found in any marketplace`});continue}let{entry:n,marketplaceInstallLocation:o}=e;v(n.source)?u({pluginId:s,installPath:S(o,n.source),version:n.version},r,i):await a(s,n,r,i),l[s]=!0,d.push(s)}catch(e){let t=e instanceof Error?e.message:String(e);p.push({name:s,error:t}),x(e)}}}return y(s,{...c,enabledPlugins:l}),{installed:d,failed:p}}var T=e((()=>{d(),p(),b(),_(),i(),n(),r(),s(),l(),h()}));export{T as n,w as r,C as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e,t}from"./figures-5ThXQEtq.js";import{en as n,hr as r}from"./state-ix0xIunV.js";import{$s as i,As as a,Es as o,Fs as s,Gs as c,Hs as l,Ms as u,Vs as d,Ws as f,Ys as p,aO as m,ac as h,fO as g,fs as _,lc as v,nv as y,oO as b,pO as x,ps as S,qs as ee,rO as C,rv as w,sc as T,uc as E}from"./loadAgentsDir-BURvZNN6.js";import{F as D,S as O,w as k,z as te}from"./debug-BrXObCdR.js";import{o as ne,s as A}from"./log-BMCygSzM.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{l as N,o as P}from"./stringUtils-DGLPkqJ4.js";import{n as F,t as I}from"./exit-BOhGfSlm.js";import{n as L,s as R,t as z}from"./pluginOperations-JEedVzfS.js";import{a as B,i as V,n as H,o as U,r as W,t as G}from"./pluginCliCommands-DQQ7C7kk.js";import{a as re,c as K,i as q,n as J,r as Y,s as X,t as ie}from"./validatePlugin-D6sPqea1.js";import{basename as ae,dirname as Z}from"path";e(),n(),j(),R(),x(),te(),ne(),E(),K(),o(),h(),d(),y(),q(),C(),_(),ie(),O(),P();function Q(e,n){A(e),I(`${t.cross} Failed to ${n}: ${D(e)}`)}function $(e){e.errors.length>0&&(console.log(`${t.cross} Found ${e.errors.length} ${N(e.errors.length,`error`)}:\n`),e.errors.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``)),e.warnings.length>0&&(console.log(`${t.warning} Found ${e.warnings.length} ${N(e.warnings.length,`warning`)}:\n`),e.warnings.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``))}async function oe(e,n){n.cowork&&r(!0);try{let n=await J(e);console.log(`Validating ${n.fileType} manifest: ${n.filePath}\n`),$(n);let r=[];if(n.fileType===`plugin`){let e=Z(n.filePath);if(ae(e)===`.claude-plugin`){r=await Y(Z(e));for(let e of r)console.log(`Validating ${e.fileType}: ${e.filePath}\n`),$(e)}}let i=n.success&&r.every(e=>e.success),a=n.warnings.length>0||r.some(e=>e.warnings.length>0);i?F(a?`${t.tick} Validation passed with warnings`:`${t.tick} Validation passed`):(console.log(`${t.cross} Validation failed`),process.exit(1))}catch(e){A(e),console.error(`${t.cross} Unexpected error during validation: ${D(e)}`),process.exit(2)}}async function se(e){e.cowork&&r(!0),M(`tengu_plugin_list_command`,{});let n=u(),{getPluginEditableScopes:o}=await import(`./pluginStartupCheck-D7ts2V3p.js`),s=o(),c=Object.keys(n.plugins),{enabled:d,disabled:f,errors:p}=await S(),h=[...d,...f],_=h.filter(e=>e.source.endsWith(`@inline`)),v=p.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(h.map(e=>[e.source,e])),r=[];for(let e of c.sort()){let i=n.plugins[e];if(!i||i.length===0)continue;let a=m(e).name,o=p.filter(t=>t.source===e||`plugin`in t&&t.plugin===a).map(g);for(let n of i){let i=t.get(e),a;if(i){let e=i.mcpServers||await w(i);e&&Object.keys(e).length>0&&(a=e)}r.push({id:e,version:n.version||`unknown`,scope:n.scope,enabled:s.has(e),installPath:n.installPath,installedAt:n.installedAt,lastUpdated:n.lastUpdated,projectPath:n.projectPath,mcpServers:a,errors:o.length>0?o:void 0})}}for(let e of _){let t=e.mcpServers||await w(e),n=v.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(g);r.push({id:e.source,version:e.manifest.version??`unknown`,scope:`session`,enabled:e.enabled!==!1,installPath:e.path,mcpServers:t&&Object.keys(t).length>0?t:void 0,errors:n.length>0?n:void 0})}for(let e of v.filter(e=>e.source.startsWith(`inline[`)))r.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[g(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([l(),X()]),{marketplaces:r}=await T(t);for(let{name:t,data:o}of r)if(o)for(let r of o.plugins){let o=i(r.name,t);a(o)||e.push({pluginId:o,name:r.name,description:r.description,marketplaceName:t,version:r.version,source:r.source,installCount:n?.get(o)})}}catch{}F(k({installed:r,available:e},null,2))}else F(k(r,null,2))}c.length===0&&_.length===0&&v.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),c.length>0&&console.log(`Installed plugins:
|
|
2
|
+
`);for(let e of c.sort()){let r=n.plugins[e];if(!r||r.length===0)continue;let i=m(e).name,a=p.filter(t=>t.source===e||`plugin`in t&&t.plugin===i);for(let n of r){let r=s.has(e),i=a.length>0?`${t.cross} failed to load`:r?`${t.tick} enabled`:`${t.cross} disabled`,o=n.version||`unknown`,c=n.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${o}`),console.log(` Scope: ${c}`),console.log(` Status: ${i}`);for(let e of a)console.log(` Error: ${g(e)}`);console.log(``)}}if(_.length>0||v.length>0){console.log(`Session-only plugins (--plugin-dir):
|
|
3
|
+
`);for(let e of _){let n=v.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),r=n.length>0?`${t.cross} loaded with errors`:`${t.tick} loaded`;console.log(` ${t.pointer} ${e.source}`),console.log(` Version: ${e.manifest.version??`unknown`}`),console.log(` Path: ${e.path}`),console.log(` Status: ${r}`);for(let e of n)console.log(` Error: ${g(e)}`);console.log(``)}for(let e of v.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${g(e)}\n`)}F()}async function ce(e,n){n.cowork&&r(!0);try{let r=await re(e);r||I(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in r&&I(`${t.cross} ${r.error}`);let i=n.scope??`user`;i!==`user`&&i!==`project`&&i!==`local`&&I(`${t.cross} Invalid scope '${i}'. Use: user, project, or local`);let a=b(i),o=r;n.sparse&&n.sparse.length>0&&(o.source===`github`||o.source===`git`?o={...o,sparsePaths:n.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${o.source})`)),console.log(`Adding marketplace...`);let{name:c,alreadyMaterialized:l,resolvedSource:u}=await s(o,e=>{console.log(e)});p(c,{source:u},a),v();let d=o.source;o.source===`github`&&(d=o.repo),M(`tengu_marketplace_added`,{source_type:d}),F(l?`${t.tick} Marketplace '${c}' already on disk — declared in ${i} settings`:`${t.tick} Successfully added marketplace: ${c} (declared in ${i} settings)`)}catch(e){Q(e,`add marketplace`)}}async function le(e){e.cowork&&r(!0);try{let n=await l(),r=Object.keys(n);e.json&&F(k(r.sort().map(e=>{let t=n[e],r=t?.source;return{name:e,source:r?.source,...r?.source===`github`&&{repo:r.repo},...r?.source===`git`&&{url:r.url},...r?.source===`url`&&{url:r.url},...r?.source===`directory`&&{path:r.path},...r?.source===`file`&&{path:r.path},installLocation:t?.installLocation}}),null,2)),r.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
|
|
4
|
+
`),r.forEach(e=>{let r=n[e];if(console.log(` ${t.pointer} ${e}`),r?.source){let e=r.source;e.source===`github`?console.log(` Source: GitHub (${e.repo})`):e.source===`git`?console.log(` Source: Git (${e.url})`):e.source===`url`?console.log(` Source: URL (${e.url})`):e.source===`directory`?console.log(` Source: Directory (${e.path})`):e.source===`file`&&console.log(` Source: File (${e.path})`)}console.log(``)}),F()}catch(e){Q(e,`list marketplaces`)}}async function ue(e,n){n.cowork&&r(!0);try{await ee(e),v(),M(`tengu_marketplace_removed`,{marketplace_name:e}),F(`${t.tick} Successfully removed marketplace: ${e}`)}catch(e){Q(e,`remove marketplace`)}}async function de(e,n){n.cowork&&r(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await c(e,e=>{console.log(e)}),v(),M(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await l(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await f(),v(),M(`tengu_marketplace_updated_all`,{count:n.length}),F(`${t.tick} Successfully updated ${n.length} marketplace(s)`)}}catch(e){Q(e,`update marketplace(s)`)}}async function fe(e,t){t.cowork&&r(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&I(`--cowork can only be used with user scope`),z.includes(n)||I(`Invalid scope: ${n}. Must be one of: ${z.join(`, `)}.`);let{name:i,marketplace:a}=m(e);M(`tengu_plugin_install_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:n}),await V(e,n)}async function pe(e,t){t.cowork&&r(!0);let n=t.scope||`user`;t.cowork&&n!==`user`&&I(`--cowork can only be used with user scope`),z.includes(n)||I(`Invalid scope: ${n}. Must be one of: ${z.join(`, `)}.`);let{name:i,marketplace:a}=m(e);M(`tengu_plugin_uninstall_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:n}),await B(e,n,t.keepData)}async function me(e,t){t.cowork&&r(!0);let n;t.scope&&(z.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${z.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:i,marketplace:a}=m(e);M(`tengu_plugin_enable_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:n??`auto`}),await W(e,n)}async function he(e,t){if(t.all&&e&&I(`Cannot use --all with a specific plugin`),!t.all&&!e&&I(`Please specify a plugin name or use --all to disable all plugins`),t.cowork&&r(!0),t.all){t.scope&&I(`Cannot use --scope with --all`),M(`tengu_plugin_disable_command`,{}),await G();return}let n;t.scope&&(z.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${z.join(`, `)}`),n=t.scope),t.cowork&&n!==void 0&&n!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&n===void 0&&(n=`user`);let{name:i,marketplace:a}=m(e);M(`tengu_plugin_disable_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:n??`auto`}),await H(e,n)}async function ge(e,t){t.cowork&&r(!0);let{name:n,marketplace:i}=m(e);M(`tengu_plugin_update_command`,{_PROTO_plugin_name:n,...i&&{_PROTO_marketplace_name:i}});let a=`user`;t.scope&&(L.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${L.join(`, `)}`),a=t.scope),t.cowork&&a!==`user`&&I(`--cowork can only be used with user scope`),await U(e,a)}export{ce as marketplaceAddHandler,le as marketplaceListHandler,ue as marketplaceRemoveHandler,de as marketplaceUpdateHandler,he as pluginDisableHandler,me as pluginEnableHandler,fe as pluginInstallHandler,se as pluginListHandler,pe as pluginUninstallHandler,ge as pluginUpdateHandler,oe as pluginValidateHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ua as e,Va as t,Ya as n}from"./loadAgentsDir-BURvZNN6.js";t();export{e as isPolicyAllowed,n as waitForPolicyLimitsToLoad};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,T as t,n,r,t as i}from"./lazySchema-DcIJE_0i.js";r(),i();var a=2e3,o=6e5,s={poll_interval_ms_not_at_capacity:a,poll_interval_ms_at_capacity:o,non_exclusive_heartbeat_interval_ms:0,multisession_poll_interval_ms_not_at_capacity:a,multisession_poll_interval_ms_partial_capacity:a,multisession_poll_interval_ms_at_capacity:o,reclaim_older_than_ms:5e3,session_keepalive_interval_v2_ms:12e4},c={message:`must be 0 (disabled) or ≥100ms`},l=n(()=>e({poll_interval_ms_not_at_capacity:t().int().min(100),poll_interval_ms_at_capacity:t().int().refine(e=>e===0||e>=100,c),non_exclusive_heartbeat_interval_ms:t().int().min(0).default(0),multisession_poll_interval_ms_not_at_capacity:t().int().min(100).default(s.multisession_poll_interval_ms_not_at_capacity),multisession_poll_interval_ms_partial_capacity:t().int().min(100).default(s.multisession_poll_interval_ms_partial_capacity),multisession_poll_interval_ms_at_capacity:t().int().refine(e=>e===0||e>=100,c).default(s.multisession_poll_interval_ms_at_capacity),reclaim_older_than_ms:t().int().min(1).default(5e3),session_keepalive_interval_v2_ms:t().int().min(0).default(12e4)}).refine(e=>e.non_exclusive_heartbeat_interval_ms>0||e.poll_interval_ms_at_capacity>0,{message:`at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or poll_interval_ms_at_capacity > 0`}).refine(e=>e.non_exclusive_heartbeat_interval_ms>0||e.multisession_poll_interval_ms_at_capacity>0,{message:`at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or multisession_poll_interval_ms_at_capacity > 0`}));function u(){let e=s,t=l().safeParse(e);return t.success?t.data:s}export{s as n,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,t as r}from"./poorMode-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,t as r}from"./poorMode-CtcqaiwD.js";var i;e((()=>{r(),i=async(e,r)=>{let i=!n();return t(i),i?r.setAppState(e=>({...e,promptSuggestionEnabled:!1})):r.setAppState(e=>({...e,promptSuggestionEnabled:!0})),{type:`text`,value:`Poor mode ${i?`ON`:`OFF`} — ${i?`extract_memories and prompt_suggestion are disabled`:`extract_memories and prompt_suggestion are restored`}`}}}))();export{i as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./poorMode-CtcqaiwD.js";t();export{e as isPoorModeActive};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{g as n,n as r,y as i}from"./settings-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{g as n,n as r,y as i}from"./settings-DfWP5y6X.js";var a=t({isPoorModeActive:()=>o,setPoorMode:()=>s});function o(){return c===null&&(c=r().poorMode===!0),c}function s(e){c=e,i(`userSettings`,{poorMode:e||void 0})}var c,l=e((()=>{n(),c=null}));export{s as i,o as n,a as r,l as t};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,l as n,o as r,s as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{M as s,P as c,Tn as l,Un as u,Wn as d,Z as f,en as p,ht as m,ir as h,kn as g,ln as _,tn as ee,vr as v}from"./state-ix0xIunV.js";import{$C as te,$w as y,$y as b,AT as ne,Al as x,Ar as S,B_ as C,Bb as w,C as T,CO as re,CT as ie,Cb as E,Cn as D,D as ae,E as oe,FD as O,FO as se,FT as ce,Fc as k,G as le,GO as ue,GT as de,G_ as fe,HC as pe,H_ as me,Hv as he,Hw as ge,ID as A,Ic as _e,Is as ve,KC as ye,K_ as be,Ks as j,Ku as xe,Ky as Se,LC as Ce,Ls as we,MD as Te,MO as Ee,MT as De,M_ as M,Md as Oe,Nc as ke,Ob as N,Oi as Ae,P as je,PO as Me,Pc as Ne,QS as Pe,Qi as Fe,Qw as Ie,Qy as Le,RC as Re,RO as ze,RT as Be,Sb as Ve,TD as He,TT as Ue,UC as P,UO as F,Ua as We,Us as Ge,Ut as Ke,Uw as qe,Uy as Je,Va as I,Vb as Ye,Vi as Xe,Vs as L,W as R,WT as Ze,Wi as Qe,Wv as $e,X_ as et,Xu as tt,Xw as nt,Xy as rt,Yw as z,ZS as it,Zw as at,Zy as B,_D as ot,_c as st,_g as ct,_i as lt,_w as ut,aT as dt,ag as ft,as as pt,aw as mt,ay as ht,b as gt,bD as _t,bb as vt,bc as yt,ca as bt,cf as xt,cg as St,cr as Ct,cs as wt,cu as Tt,dC as V,dT as Et,dg as Dt,dw as Ot,dy as kt,eT as At,ei as jt,f as Mt,fC as Nt,fc as Pt,fi as Ft,fs as It,fw as Lt,fy as Rt,gc as zt,gi as Bt,go as Vt,gw as Ht,hc as Ut,hg as Wt,hw as Gt,iT as Kt,i_ as qt,ig as Jt,ir as Yt,iw as Xt,jD as Zt,jT as Qt,jd as $t,jr as en,k_ as tn,kb as nn,ki as rn,kl as an,kr as on,lf as sn,lx as cn,mc as ln,mg as un,ms as dn,nT as fn,ng as pn,o as mn,oT as hn,o_ as gn,os as _n,pC as vn,pc as yn,pg as bn,pi as xn,pw as Sn,px as Cn,qC as wn,qi as Tn,qu as En,qy as Dn,rT as On,r_ as kn,s as An,su as jn,tT as Mn,tw as Nn,uC as Pn,uu as Fn,vc as In,vg as Ln,wD as Rn,wT as zn,wb as Bn,wn as Vn,x as Hn,xc as Un,y_ as Wn,yc as Gn,yn as Kn,z_ as qn,zo as Jn}from"./loadAgentsDir-BURvZNN6.js";import{n as Yn,t as Xn}from"./cwd-CYmmnQVS.js";import{C as Zn,F as H,S as Qn,W as $n,a as er,d as tr,l as U,nt as nr,o as rr,p as ir,rt as ar,w as W,z as or}from"./debug-BrXObCdR.js";import{St as sr,Y as cr,_n as lr,ct as ur,d as dr,f as fr,g as pr,ht as mr,ot as G,yn as hr}from"./settings-DfWP5y6X.js";import{L as gr,P as _r}from"./config-DiT2Z8dY.js";import{i as vr,n as yr,o as K}from"./process-gEbdy6uY.js";import{M as br,N as xr,j as Sr}from"./git-Do0wJvux.js";import{U as Cr,Y as wr,c as Tr,i as Er,o as Dr,s as q}from"./log-BMCygSzM.js";import{i as Or,n as kr}from"./path-D5U-tm91.js";import{s as Ar,u as jr}from"./types-C-MRCL8J.js";import{n as Mr,r as J}from"./analytics-BotDBGh0.js";import{C as Nr,Er as Pr,Mn as Fr,Nn as Ir,Tr as Lr,Vt as Rr,X as zr,_ as Br,at as Vr,cr as Hr,di as Ur,fi as Wr,it as Gr,li as Kr,mi as qr,nt as Jr,o as Yr,sr as Xr,tt as Zr,u as Qr,vn as $r,x as ei,xt as ti,yn as ni}from"./model-BIVmcl_N.js";import{Dt as ri,En as ii,Ot as ai,Tn as oi,Zt as si,an as ci,dt as li,ut as ui}from"./prompt-DNDgGM9q.js";import{c as di,s as fi}from"./pluginFlagging-mHNff1t9.js";import{a as pi,o as mi,s as hi}from"./fileStateCache-DDW5toIs.js";import{A as gi,C as _i,D as vi,N as yi,O as bi,P as xi,_ as Si,d as Ci,g as wi,h as Ti,lt as Ei,m as Di,u as Oi,v as ki,y as Ai}from"./rcDebugLog-DoL1FpGJ.js";import{c as ji,l as Mi}from"./commitAttribution-CLbEIaRJ.js";import{t as Ni}from"./pollConfig-DH2oCtFS.js";import{r as Pi}from"./inboundAttachments-DkfNHtF9.js";import{i as Fi,n as Ii,s as Li}from"./mappers-Q_Z3Kjo-.js";import{n as Ri,r as zi}from"./sessionTitle-pWMaI79N.js";import{n as Bi,t as Vi}from"./ccrClient-q2JCVCU2.js";import{n as Hi,t as Ui}from"./HybridTransport-kN1jmg26.js";import{n as Wi,t as Gi}from"./SSETransport-h43pQVlJ.js";import{a as Ki,n as qi,o as Ji}from"./grove-CFBPplP6.js";import{o as Yi}from"./remoteManagedSettings-Bxo3bv1U.js";import{i as Xi,r as Zi}from"./auth-DAxGNCIR.js";import{t as Qi}from"./pluginBlocklist-mogKaK0p.js";import{t as $i}from"./onChangeAppState-DBantDJ6.js";import{t as ea}from"./settingsSync-D_4P3Esd.js";import{a as ta,c as na,n as ra,o as ia,r as aa,s as oa}from"./reconciler-CJcSh6xo.js";import{n as sa,t as ca}from"./toolPool-CNYKDRq5.js";import{n as la,r as ua}from"./QueryEngine-BLcPQYq_.js";import{n as da,r as fa}from"./sideQuestion-D03MXdE2.js";import{n as pa,r as ma}from"./context-noninteractive-BuGxX3YL.js";import{a as ha,o as ga,t as _a}from"./skillChangeDetector-uCaYrerZ.js";import{n as va,t as ya}from"./refresh-ul_i5R1a.js";import{dirname as ba,join as xa}from"path";import{PassThrough as Sa}from"stream";import{randomUUID as Y}from"crypto";import{readFile as Ca,stat as wa}from"fs/promises";import{URL as Ta}from"url";import{cwd as X}from"process";a(),p(),Yn(),nr(),or(),Qn(),ir(),yr(),er(),Sr(),wr(),Dr(),Or(),lr(),Ar(),pr(),qr(),Ur(),Pr(),Fr(),$r(),Rr(),Br(),oi(),ci(),y(),yi(),P(),Nt(),bi(),kt(),Ci(),_n(),Jn(),Fe(),en(),ea(),r(),Wi();function Ea(e,t={},r,i){if(n(process.env.CLAUDE_CODE_USE_CCR_V2)){let n=new Ta(e.href);return n.protocol===`wss:`?n.protocol=`https:`:n.protocol===`ws:`&&(n.protocol=`http:`),n.pathname=n.pathname.replace(/\/$/,``)+`/worker/events/stream`,new Gi(n,t,r,i)}if(e.protocol===`ws:`||e.protocol===`wss:`)return n(process.env.CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2)?new Ui(e,t,r,i):new Hi(e,t,r,i);throw Error(`Unsupported protocol: ${e.protocol}`)}r(),Wi();var Da=class extends ta{constructor(e,t,r){let i=new Sa({encoding:`utf8`});super(i,r),o(this,`url`,void 0),o(this,`transport`,void 0),o(this,`inputStream`,void 0),o(this,`isBridge`,!1),o(this,`isDebug`,!1),o(this,`ccrClient`,null),o(this,`keepAliveTimer`,null),this.inputStream=i,this.url=new Ta(e);let a={},s=vi();s?a.Authorization=`Bearer ${s}`:U(`[remote-io] No session ingress token available`,{level:`error`});let c=process.env.CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION;c&&(a[`x-environment-runner-version`]=c);let l=()=>{let e={},t=vi();t&&(e.Authorization=`Bearer ${t}`);let n=process.env.CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION;return n&&(e[`x-environment-runner-version`]=n),e};if(this.transport=Ea(this.url,a,m(),l),this.isBridge=process.env.CLAUDE_CODE_ENVIRONMENT_KIND===`bridge`,this.isDebug=rr(),this.transport.setOnData(e=>{this.inputStream.write(e),this.isBridge&&this.isDebug&&K(e.endsWith(`
|
|
2
|
+
`)?e:e+`
|
|
3
|
+
`)}),this.transport.setOnClose(()=>{this.inputStream.end()}),n(process.env.CLAUDE_CODE_USE_CCR_V2)){if(!(this.transport instanceof Gi))throw Error(`CCR v2 requires SSETransport; check getTransportForUrl`);this.ccrClient=new Vi(this.transport,this.url);let e=this.ccrClient.initialize();this.restoredWorkerState=e.catch(()=>null),e.catch(e=>{br(`error`,`cli_worker_lifecycle_init_failed`,{reason:e instanceof Bi?e.reason:`unknown`}),q(Error(`CCRClient initialization failed: ${H(e)}`)),Pn(1,`other`)}),ar(async()=>this.ccrClient?.close()),rn((e,t,n)=>this.ccrClient.writeInternalEvent(e,t,n)),Ae(()=>this.ccrClient.readInternalEvents(),()=>this.ccrClient.readSubagentInternalEvents());let t={started:`processing`,completed:`processed`};Mn((e,n)=>{this.ccrClient?.reportDelivery(e,t[n])}),ki((e,t)=>{this.ccrClient?.reportState(e,t)}),Si(e=>{this.ccrClient?.reportMetadata(e)},{replayCurrent:!0})}this.transport.connect();let u=Ni().session_keepalive_interval_v2_ms;if(this.isBridge&&u>0&&(this.keepAliveTimer=setInterval(()=>{U(`[remote-io] keep_alive sent`),this.write({type:`keep_alive`}).catch(e=>{U(`[remote-io] keep_alive write failed: ${H(e)}`)})},u),this.keepAliveTimer.unref?.()),ar(async()=>this.close()),t){let e=this.inputStream;(async()=>{for await(let n of t)e.write(String(n).replace(/\n$/,``)+`
|
|
4
|
+
`)})()}}flushInternalEvents(){return this.ccrClient?.flushInternalEvents()??Promise.resolve()}get internalEventsPending(){return this.ccrClient?.internalEventsPending??0}async write(e){this.ccrClient?await this.ccrClient.writeEvent(e):await this.transport.write(e),this.isBridge&&(e.type===`control_request`||this.isDebug)&&K(ia(e)+`
|
|
5
|
+
`)}close(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=null),this.transport.close(),this.inputStream.end()}};si(),cr(),ai(),[...ri],nr(),er();var Oa=`[stdout-guard]`,ka=!1,Z=``,Q=null;function Aa(e){if(e.length===0)return!0;try{return JSON.parse(e),!0}catch{return!1}}function ja(){ka||(ka=!0,Q=process.stdout.write.bind(process.stdout),process.stdout.write=function(e,t,n){let r=typeof e==`string`?e:Buffer.from(e).toString(`utf-8`);Z+=r;let i,a=!0;for(;(i=Z.indexOf(`
|
|
6
|
+
`))!==-1;){let e=Z.slice(0,i);Z=Z.slice(i+1),Aa(e)?a=Q(e+`
|
|
7
|
+
`):(process.stderr.write(`${Oa} ${e}\n`),U(`streamJsonStdoutGuard diverted non-JSON stdout line: ${e.slice(0,200)}`))}let o=typeof t==`function`?t:n;return o&&queueMicrotask(()=>o()),a},ar(async()=>{Z.length>0&&(Q&&Aa(Z)?Q(Z+`
|
|
8
|
+
`):process.stderr.write(`${Oa} ${Z}\n`),Z=``),Q&&(process.stdout.write=Q,Q=null),ka=!1}))}sr(),ur(),_r(),F(),Ee(),Zt(),Rn(),_t(),li(),mi(),xi(),De(),qe(),Ht(),mt(),Nn(),nn(),rt(),Se(),fe(),M(),tt(),k(),Ne(),Gn(),L(),It(),Vn(),Kn(),le(),mn(),ca(),Je(),or(),Dr(),bi(),vt(),er(),Nt();function Ma(e){let t=process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY,n=t?parseInt(t,10):null,r=n&&!isNaN(n)&&n>0,i=null,a=0;return{start(){i&&(clearTimeout(i),i=null),r&&(a=Date.now(),i=setTimeout(()=>{let t=Date.now()-a;e()&&t>=n&&(U(`Exiting after ${n}ms of idle time`),V())},n))},stop(){i&&(clearTimeout(i),i=null)}}}Zr(),fi(),O(),Ze(),Ot(),Re(),Pe(),Cn(),x(),I(),T(),zi(),da();function Na(e){if(e.toLowerCase().endsWith(`.jsonl`))return{sessionId:Y(),ingressUrl:null,isUrl:!1,jsonlFile:e,isJsonlFile:!0};if(Rt(e))return{sessionId:e,ingressUrl:null,isUrl:!1,jsonlFile:null,isJsonlFile:!1};try{let t=new URL(e);return{sessionId:Y(),ingressUrl:t.href,isUrl:!0,jsonlFile:null,isJsonlFile:!1}}catch{}return null}Xr(),Et(),dt(),at(),Mi(),ht(),kn(),Wt(),Dt(),Oe(),jn(),Ii(),Ki(),ma(),er();async function Pa(){try{let e=await Ca(zt(),`utf-8`),t=mr().safeParse(Zn(e));return t.success?t.data:(U(`Invalid known_marketplaces.json in zip cache: ${t.error.message}`,{level:`error`}),{})}catch{return{}}}async function Fa(e){await Pt(zt(),W(e,null,2))}async function Ia(e,t){let n=Ut();if(!n)return;let r=await La(t);r!==null&&await Pt(xa(n,ln(e)),r)}async function La(e){let t=[xa(e,`.claude-plugin`,`marketplace.json`),xa(e,`marketplace.json`),e];for(let e of t)try{return await Ca(e,`utf-8`)}catch{}return null}async function Ra(){let e=await Ge();for(let[t,n]of Object.entries(e))if(n.installLocation)try{await Ia(t,n.installLocation)}catch(e){U(`Failed to save marketplace JSON for ${t}: ${e}`)}await Fa({...await Pa(),...e})}Mr(),nr(),er(),Sr(),Dr(),L(),Gn();async function za(){let e=Un();U(`installPluginsForHeadless: starting${e?` (zip cache mode)`:``}`);let t=await j();t&&(ve(),wt(`headlessPluginInstall: seed marketplaces registered`)),e&&(await tr().mkdir(st()),await tr().mkdir(In()));let n=Object.keys(we()).length,r={marketplaces_installed:0,delisted_count:0},i=t;try{if(n===0)U(`installPluginsForHeadless: no marketplaces declared`);else{let t=await xr(`headless_marketplace_reconcile`,()=>ra({skip:e?(e,t)=>!yt(t):void 0,onProgress:e=>{e.type===`installed`?U(`installPluginsForHeadless: installed marketplace ${e.name}`):e.type===`failed`&&U(`installPluginsForHeadless: failed to install marketplace ${e.name}: ${e.error}`)}}),e=>({installed_count:e.installed.length,updated_count:e.updated.length,failed_count:e.failed.length,skipped_count:e.skipped.length}));t.skipped.length>0&&U(`installPluginsForHeadless: skipped ${t.skipped.length} marketplace(s) unsupported by zip cache: ${t.skipped.join(`, `)}`);let n=t.installed.length+t.updated.length;n>0&&(ve(),wt(`headlessPluginInstall: marketplaces reconciled`),i=!0),r.marketplaces_installed=n}e&&await Ra();let t=await Qi();return r.delisted_count=t.length,t.length>0&&(i=!0),i&&wt(`headlessPluginInstall: plugins changed`),e&&ar(yn),i}catch(e){return q(e),!1}finally{J(`tengu_headless_plugin_install`,r)}}Mr(),er(),Sr(),y(),Ci(),Dr(),yr(),kt(),Nt(),nr(),Yn(),p(),en(),Jn(),Qn(),r(),ya(),It(),wn(),w(),xt(),or();var $=(Ai(),e(_i)),Ba=1e4,Va=new Set,Ha=[];function Ua(e){if(Va.has(e))return!1;if(Va.add(e),Ha.push(e),Ha.length>Ba){let e=Ha.splice(0,Ha.length-Ba);for(let t of e)Va.delete(t)}return!0}function Wa(e){return typeof e==`string`?[{type:`text`,text:e}]:e}function Ga(e){return e.length===1?e[0]:e.every(e=>typeof e==`string`)?e.join(`
|
|
9
|
+
`):e.flatMap(Wa)}function Ka(e,t){return t!==void 0&&t.mode===`prompt`&&t.workload===e.workload&&t.isMeta===e.isMeta}async function qa(e,t,r,i,a,o,s,c){if(process.env.USER_TYPE===`ant`&&n(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)&&(process.stderr.write(`\nStartup time: ${Math.round(process.uptime()*1e3)}ms\n`),process.exit(0)),He.subscribe(e=>{it(e,r),Gr()&&r(e=>{let t=e.settings,n=t.fastMode===!0&&!t.fastModePerSessionOptIn;return{...e,fastMode:n}})}),$&&!$.isProactiveActive()&&n(process.env.CLAUDE_CODE_PROACTIVE)&&$.activateProactive(`command`),typeof Bun<`u`&&setInterval(()=>{process.memoryUsage.rss()>350*1024*1024?Bun.gc(!0):Bun.gc(!1)},1e3).unref(),nt(),z(`runHeadless_entry`),await Ji()&&await qi(),z(`after_grove_check`),c.resumeSessionAt&&!c.resume){process.stderr.write(`Error: --resume-session-at requires --resume
|
|
10
|
+
`),V(1);return}if(c.rewindFiles&&!c.resume){process.stderr.write(`Error: --rewind-files requires --resume
|
|
11
|
+
`),V(1);return}if(c.rewindFiles&&e){process.stderr.write(`Error: --rewind-files is a standalone operation and cannot be used with a prompt
|
|
12
|
+
`),V(1);return}let l=ro(e,c);c.outputFormat===`stream-json`&&ja();let u=ot.getSandboxUnavailableReason();if(u){if(ot.isSandboxRequired()){process.stderr.write(`\nError: sandbox required but unavailable: ${u}\n sandbox.failIfUnavailable is set — refusing to start without a working sandbox.\n\n`),V(1);return}process.stderr.write(`\n⚠ Sandbox disabled: ${u}\n Commands will run WITHOUT sandboxing. Network and filesystem restrictions will NOT be enforced.\n\n`)}else if(ot.isSandboxingEnabled())try{await ot.initialize(l.createSandboxAskCallback())}catch(e){process.stderr.write(`\n❌ Sandbox Error: ${H(e)}\n`),V(1,`other`);return}c.outputFormat===`stream-json`&&c.verbose&&_e(e=>{let t=(()=>{switch(e.type){case`started`:return{type:`system`,subtype:`hook_started`,hook_id:e.hookId,hook_name:e.hookName,hook_event:e.hookEvent,uuid:Y(),session_id:m()};case`progress`:return{type:`system`,subtype:`hook_progress`,hook_id:e.hookId,hook_name:e.hookName,hook_event:e.hookEvent,stdout:e.stdout,stderr:e.stderr,output:e.output,uuid:Y(),session_id:m()};case`response`:return{type:`system`,subtype:`hook_response`,hook_id:e.hookId,hook_name:e.hookName,hook_event:e.hookEvent,output:e.output,stdout:e.stdout,stderr:e.stderr,exit_code:e.exitCode,outcome:e.outcome,uuid:Y(),session_id:m()}}})();l.write(t)}),c.setupTrigger&&await Le(c.setupTrigger),z(`before_loadInitialMessages`);let d=t(),{messages:p,turnInterruptionState:h,agentSetting:g}=await no(r,{continue:c.continue,teleport:c.teleport,resume:c.resume,resumeSessionAt:c.resumeSessionAt,forkSession:c.forkSession,outputFormat:c.outputFormat,sessionStartHooksPromise:c.sessionStartHooksPromise,restoredWorkerState:l.restoredWorkerState}),_=b();if(_&&l.prependUserMessage(_),!c.agent&&!f()&&g){let{agentDefinition:e}=ha(g,void 0,{activeAgents:s,allAgents:s});if(e){if(r(t=>({...t,agent:e.agentType})),!c.systemPrompt&&!An(e)){let t=e.getSystemPrompt();t&&(c.systemPrompt=t)}Bt(e.agentType)}}if(p.length===0&&process.exitCode!==void 0)return;if(c.rewindFiles){let e=p.find(e=>e.uuid===c.rewindFiles);if(!e||e.type!==`user`){process.stderr.write(`Error: --rewind-files requires a user message UUID, but ${c.rewindFiles} is not a user message in this session\n`),V(1);return}let n=t(),i=await Qa(c.rewindFiles,n,r,!1);if(!i.canRewind){process.stderr.write(`Error: ${i.error||`Unexpected error`}\n`),V(1);return}process.stdout.write(`Files rewound to state at message ${c.rewindFiles}\n`),V(0);return}let ee=typeof c.resume==`string`&&(!!Rt(c.resume)||c.resume.endsWith(`.jsonl`)),v=!!c.sdkUrl;if(!e&&!ee&&!v){process.stderr.write(`Error: Input must be provided either through stdin or as a prompt argument when using --print
|
|
13
|
+
`),V(1);return}if(c.outputFormat===`stream-json`&&!c.verbose){process.stderr.write(`Error: When using --print, --output-format=stream-json requires --verbose
|
|
14
|
+
`),V(1);return}let te=En(d.mcp.tools,d.toolPermissionContext),y=[...a,...te],ne=Xa(c.sdkUrl?`stdio`:c.permissionPromptToolName,l,()=>t().mcp.tools,e=>{r(e=>({...e,attribution:{...e.attribution,permissionPromptCount:e.attribution.permissionPromptCount+1}})),Ti(`requires_action`,e)});c.permissionPromptToolName&&(y=y.filter(e=>!ii(e,c.permissionPromptToolName))),vr(),z(`after_loadInitialMessages`),await Kr(),z(`after_modelStrings`);let x=c.outputFormat===`json`&&c.verbose,S=[],C;z(`before_runHeadlessStreaming`);for await(let e of Ja(l,d.mcp.clients,[...i,...d.mcp.commands],y,p,ne,o,t,r,s,c,h))c.outputFormat===`stream-json`&&c.verbose&&await l.write(e),e.type!==`control_response`&&e.type!==`control_request`&&e.type!==`control_cancel_request`&&!(e.type===`system`&&(e.subtype===`session_state_changed`||e.subtype===`task_notification`||e.subtype===`task_started`||e.subtype===`task_progress`||e.subtype===`post_turn_summary`))&&e.type!==`stream_event`&&e.type!==`keep_alive`&&e.type!==`streamlined_text`&&e.type!==`streamlined_tool_use_summary`&&e.type!==`prompt_suggestion`&&(x&&S.push(e),C=e);switch(c.outputFormat){case`json`:if(!C||C.type!==`result`)throw Error(`No messages returned`);if(c.verbose){K(W(S)+`
|
|
15
|
+
`);break}K(W(C)+`
|
|
16
|
+
`);break;case`stream-json`:break;default:if(!C||C.type!==`result`)throw Error(`No messages returned`);switch(C.subtype){case`success`:K(C.result.endsWith(`
|
|
17
|
+
`)?C.result:C.result+`
|
|
18
|
+
`);break;case`error_during_execution`:K(`Execution error`);break;case`error_max_turns`:K(`Error: Reached max turns (${c.maxTurns}).\nTip: Increase the limit with --max-turns or continue in a new session.`);break;case`error_max_budget_usd`:K(`Error: Exceeded USD budget ($${c.maxBudgetUsd}).\nTip: Increase the limit with --max-budget-usd or start a new session to continue.`);break;case`error_max_structured_output_retries`:K(`Error: Failed to provide valid structured output after maximum retries.
|
|
19
|
+
Tip: Simplify your schema or check if the output format matches the expected structure.`)}}if(Ie(),gr())try{let{drainPendingExtraction:e}=await import(`./extractMemories-C3qrwpu2.js`);await e()}catch{}V(C?.type===`result`&&C?.is_error?1:0)}function Ja(e,r,a,o,d,f,p,g,_,ee,v,y){let b=!1,x,S=!1,w=null,T,E=e.outbound;process.on(`SIGINT`,()=>{br(`info`,`shutdown_signal`,{signal:`SIGINT`}),T&&!T.signal.aborted&&T.abort(),Pn(0)}),ar(async()=>{let t={};for(let e of ye(g()))Ye(e)&&(t[e.type]=(t[e.type]??0)+1);br(`info`,`run_state_at_shutdown`,{run_active:b,run_phase:x,worker_status:Oi(),internal_events_pending:e.internalEventsPending,bg_tasks:t})}),wi(e=>{(e==="default"||e===`acceptEdits`||e===`bypassPermissions`||e===`plan`||e===`auto`||e===`dontAsk`)&&E.enqueue({type:`system`,subtype:`status`,status:null,permissionMode:e,uuid:Y(),session_id:m()})});let D={abortController:null,inflightPromise:null,lastEmitted:null,pendingSuggestion:null,pendingLastEmittedEntry:null},ae;v.enableAuthStatus&&(ae=Lr.getInstance().subscribe(e=>{E.enqueue({type:`auth_status`,isAuthenticating:e.isAuthenticating,output:e.output,error:e.error,uuid:Y(),session_id:m()})}));let oe=e=>{let t=Li(e);t&&E.enqueue({type:`rate_limit_event`,rate_limit_info:t,uuid:Y(),session_id:m()})};de.add(oe);let O=d,k=te(d,X(),100),le=pi(100),fe=process.env.CLAUDE_CODE_RESUME_INTERRUPTED_TURN;y&&y.kind!==`none`&&fe&&(U(`[print.ts] Auto-resuming interrupted turn (kind: ${y.kind})`),to(O,y.message),Ue({mode:`prompt`,value:y.message.message.content,uuid:Y()}));let pe=$t().map(e=>{let t=e.value===null?`default`:e.value,n=t==="default"?Yr():Nr(t),r=Me(n),i=ue(n),a=Vr(e.value),o=Ir(n);return{name:t,value:t,displayName:e.label,description:e.description,...r&&{supportsEffort:!0,supportedEffortLevels:se(n)?[...re]:re.filter(e=>e!==`max`)},...i&&{supportsAdaptiveThinking:!0},...a&&{supportsFastMode:!0},...o&&{supportsAutoMode:!0}}}),_e=v.userSpecifiedModel;function ve(e,t){let n=Vt(e,ei(t));O.push(...n);for(let e of n)typeof e.message.content==`string`&&e.message.content.includes(`<local-command-stdout>`)&&E.enqueue({type:`user`,content:e.message.content,message:e.message,session_id:m(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}let j=[],Se=[],we=new Set;function Ee(t){for(let n of t){if(n.type!==`connected`||we.has(n.name)||n.config.type===`sdk`)continue;let t=n.name;try{n.client.setRequestHandler(he,async(n,r)=>{Tr(t,`Elicitation request received in print mode: ${W(n)}`);let i=n.params.mode===`url`?`url`:`form`;J(`tengu_mcp_elicitation_shown`,{mode:i});let a=await ct(t,n.params,r.signal);if(a)return Tr(t,`Elicitation resolved by hook: ${W(a)}`),J(`tengu_mcp_elicitation_response`,{mode:i,action:a.action}),a;let o=`url`in n.params?n.params.url:void 0,s=`requestedSchema`in n.params?n.params.requestedSchema:void 0,c=`elicitationId`in n.params?n.params.elicitationId:void 0,l=await e.handleElicitation(t,n.params.message,s,r.signal,i,o,c),u=await Ln(t,l,r.signal,i,c);return J(`tengu_mcp_elicitation_response`,{mode:i,action:u.action}),u}),n.client.setNotificationHandler($e,e=>{let{elicitationId:n}=e.params;Tr(t,`Elicitation completion notification: ${n}`),Ke({message:`MCP server "${t}" confirmed elicitation ${n} complete`,notificationType:`elicitation_complete`}),E.enqueue({type:`system`,subtype:`elicitation_complete`,mcp_server_name:t,elicitation_id:n,uuid:Y(),session_id:m()})}),we.add(t)}catch{}}}async function De(){let t=new Set(Object.keys(p)),n=new Set(j.map(e=>e.name)),r=Array.from(t).some(e=>!n.has(e)),i=Array.from(n).some(e=>!t.has(e)),a=j.some(e=>e.type===`pending`),o=j.some(e=>e.type===`failed`);if(r||i||a||o){for(let e of j)t.has(e.name)||e.type===`connected`&&await e.cleanup();let r=await un(p,(t,n)=>e.sendMcpMessage(t,n));j=r.clients,Se=r.tools;let i=hr([...n,...t]);_(e=>({...e,mcp:{...e.mcp,tools:[...e.mcp.tools.filter(e=>!i.some(t=>e.name.startsWith(G(t)))),...Se]}})),ut(j)}}De();let M={clients:[],tools:[],configs:{}},Oe=e=>{let t=xe(e.toolPermissionContext,e.mcp.tools),n=Te(sa([...o,...Se,...M.tools],t,e.toolPermissionContext.mode),`name`);v.permissionPromptToolName&&(n=n.filter(e=>!ii(e,v.permissionPromptToolName)));let r=c();if(r&&!v.jsonSchema){let e=ui(r);`tool`in e&&(n=[...n,e.tool])}return n},N=null,Ae=0;function je(){if(!N)return;let e=Math.min(Ae,O.length),t=O.slice(e).filter(e=>e.type===`user`||e.type===`assistant`);Ae=O.length,t.length>0&&N.writeMessages(t)}let Ne=Promise.resolve({response:{added:[],removed:[],errors:{}},sdkServersChanged:!1});function Pe(e){let t=async()=>{let t=new Set(j.map(e=>e.name)),n=await oo(e,{configs:p,clients:j,tools:Se},M,_);for(let e of Object.keys(p))delete p[e];if(Object.assign(p,n.newSdkState.configs),j=n.newSdkState.clients,Se=n.newSdkState.tools,M=n.newDynamicState,n.sdkServersChanged){let e=new Set(j.map(e=>e.name)),n=hr([...t,...e]);_(e=>({...e,mcp:{...e.mcp,tools:[...e.mcp.tools.filter(e=>!n.some(t=>e.name.startsWith(G(t)))),...Se]}}))}return{response:n.response,sdkServersChanged:n.sdkServersChanged}};return Ne=Ne.then(t,t),Ne}function Fe(){let e=g(),t=e.mcp.clients,n=Te([...e.mcp.tools,...M.tools],`name`),r=new Set([...t.map(e=>e.name),...j.map(e=>e.name)]);return[...t,...j,...M.clients.filter(e=>!r.has(e.name))].map(e=>{let t;if(e.config.type===`sse`||e.config.type===`http`)t={type:e.config.type,url:e.config.url,headers:e.config.headers,oauth:e.config.oauth};else if(e.config.type===`claudeai-proxy`)t={type:`claudeai-proxy`,url:e.config.url,id:e.config.id};else if(e.config.type===`stdio`||e.config.type===void 0){let n=e.config;t={type:`stdio`,command:n.command,args:n.args}}let r=e.type===`connected`?tn(n,e.name).map(e=>({name:e.mcpInfo?.toolName??e.name,annotations:{readOnly:e.isReadOnly({})||void 0,destructive:e.isDestructive?.({})||void 0,openWorld:e.isOpenWorld?.({})||void 0}})):void 0;return{name:e.name,status:e.type,serverInfo:e.type===`connected`?e.serverInfo:void 0,error:e.type===`failed`?e.error:void 0,config:t,scope:e.config.scope,tools:r}})}async function Le(){try{await Promise.all([Promise.resolve(),xr(`headless_managed_settings_wait`,()=>Yi())]),await za()&&await Ge()}catch(e){q(e)}}let Re=null;i()||(n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)?Re=Le():Le());let Ve=Ma(()=>!b),P=a,F=ee;async function We(){let{agentDefinitions:e}=await va(_);P=await Tn(X());let t=F.filter(e=>e.source===`flagSettings`);F=[...e.allAgents,...t]}async function Ge(){let{servers:e}=await C(),t={};for(let[n,r]of Object.entries(e)){let e=r.type;(e===void 0||e===`stdio`||e===`sse`||e===`http`||e===`sdk`)&&(t[n]=r)}for(let[e,n]of Object.entries(p))n.type===`sdk`&&!(e in t)&&(t[e]=n);let{response:n,sdkServersChanged:r}=await Pe(t);r&&De(),U(`Headless MCP refresh: added=${n.added.length}, removed=${n.removed.length}`)}let qe=_a.subscribe(()=>{Xe(),Tn(X()).then(e=>{P=e})}),Je=()=>{setTimeout(()=>{!$?.isProactiveActive()||$.isProactivePaused()||S||(async()=>{let e=await hn({basePrompt:`<${Cr}>${new Date().toLocaleTimeString()}</${Cr}>`,currentDir:X(),shouldCreate:()=>!S});if(S){await fn({commands:e});return}for(let t of e)Ue({...t,uuid:Y()});I()})().catch(e=>{q(e),U(`[Proactive] failed to create headless tick: ${e}`,{level:`error`})})},0)};Be(()=>{T&&ne(`now`).length>0&&T.abort(`interrupt`)});let I=async()=>{if(b)return;if(b=!0,x=void 0,Ti(`running`),Ve.stop(),z(`run_entry`),await De(),z(`after_updateSdkMcp`),Re){let e=parseInt(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS||``,10);if(e>0){let t=ni(e).then(()=>`timeout`);await Promise.race([Re,t])===`timeout`&&(q(Error(`CLAUDE_CODE_SYNC_PLUGIN_INSTALL: plugin installation timed out after ${e}ms`)),J(`tengu_sync_plugin_install_timeout`,{timeout_ms:e}))}else await Re;Re=null,await We();let{setupPluginHookHotReload:t}=await import(`./loadPluginHooks-C9A9oS-w.js`);t()}let n=e=>e.agentId===void 0;try{let r,i=!1,a=async()=>{for(;r=ie(n);){if(r.mode!==`prompt`&&r.mode!==`orphaned-permission`&&r.mode!==`task-notification`)throw Error(`only prompt commands are supported in streaming mode`);let i=[r];if(r.mode===`prompt`)for(;Ka(r,ce(n));)i.push(ie(n));let a=await On(i);if(i=a.attachmentCommands,i.length===0)continue;r=i[0],r.mode===`prompt`&&i.length>1&&(r={...r,value:Ga(i.map(e=>e.value)),uuid:i.findLast(e=>e.uuid)?.uuid??r.uuid});let o=i.map(e=>e.uuid).filter(e=>e!==void 0);if(v.replayUserMessages&&i.length>1)for(let e of i)e.uuid&&e.uuid!==r.uuid&&E.enqueue({type:`user`,content:e.value,message:{role:`user`,content:e.value},session_id:m(),parent_tool_use_id:null,uuid:e.uuid,isReplay:!0});let s=g(),l=[...s.mcp.clients,...j,...M.clients];Ee(l);let u=Oe(s);for(let e of o)At(e,`started`);if(r.mode===`task-notification`){let e=typeof r.value==`string`?r.value:``,t=e.match(/<task-id>([^<]+)<\/task-id>/),n=e.match(/<tool-use-id>([^<]+)<\/tool-use-id>/),i=e.match(/<output-file>([^<]+)<\/output-file>/),a=e.match(/<status>([^<]+)<\/status>/),o=e.match(/<summary>([^<]+)<\/summary>/),s=e=>e===`completed`||e===`failed`||e===`stopped`||e===`killed`,c=a?.[1],l=s(c)?c===`killed`?`stopped`:c:`completed`,u=e.match(/<usage>([\s\S]*?)<\/usage>/)?.[1]??``,d=u.match(/<total_tokens>(\d+)<\/total_tokens>/),f=u.match(/<tool_uses>(\d+)<\/tool_uses>/),p=u.match(/<duration_ms>(\d+)<\/duration_ms>/);a&&E.enqueue({type:`system`,subtype:`task_notification`,task_id:t?.[1]??``,tool_use_id:n?.[1],status:l,output_file:i?.[1]??``,summary:o?.[1]??``,usage:d&&f?{total_tokens:parseInt(d[1],10),tool_uses:parseInt(f[1],10),duration_ms:p?parseInt(p[1],10):0}:void 0,session_id:m(),uuid:Y()})}let d=r.value,p=a.claimedCommands;if(e instanceof Da&&r.mode===`prompt`&&J(`tengu_bridge_message_received`,{is_repl:!1}),D.abortController?.abort(),D.abortController=null,D.pendingSuggestion=null,D.pendingLastEmittedEntry=null,D.lastEmitted&&r.mode===`prompt`){let e=typeof d==`string`?d:d.find(e=>e.type===`text`)?.text;typeof e==`string`&&Lt(D.lastEmitted.text,e,D.lastEmitted.emittedAt,D.lastEmitted.promptId,D.lastEmitted.generationRequestId),D.lastEmitted=null}T=ge(),z(`before_ask`),Fn();let h=r,ee=!1;try{if(await Hr(h.workload??v.workload,async()=>{for await(let t of la({commands:Te([...P,...s.mcp.commands],`name`),prompt:d,promptUuid:h.uuid,isMeta:h.isMeta,cwd:X(),tools:u,verbose:v.verbose,mcpClients:l,thinkingConfig:v.thinkingConfig,maxTurns:v.maxTurns,maxBudgetUsd:v.maxBudgetUsd,taskBudget:v.taskBudget,canUseTool:f,userSpecifiedModel:_e,fallbackModel:v.fallbackModel,jsonSchema:c()??v.jsonSchema,mutableMessages:O,getReadFileCache:()=>le.size===0?k:hi(k,le),setReadFileCache:e=>{k=e;for(let[e,t]of le.entries()){let n=k.get(e);(!n||t.timestamp>n.timestamp)&&k.set(e,t)}le.clear()},customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt,getAppState:g,setAppState:_,abortController:T,replayUserMessages:v.replayUserMessages,includePartialMessages:v.includePartialMessages,handleElicitation:(t,n,r)=>e.handleElicitation(t,n.message,void 0,r,n.mode,n.url,`elicitationId`in n?n.elicitationId:void 0),agents:F,orphanedPermission:h.orphanedPermission,setSDKStatus:e=>{E.enqueue({type:`system`,subtype:`status`,status:e,session_id:m(),uuid:Y()})}}))if(je(),t.type===`result`){ee=!!t.is_error;for(let e of gi())E.enqueue(e);ye(g()).some(e=>(e.type===`local_agent`||e.type===`local_workflow`)&&Ye(e))?w=t:(w=null,E.enqueue(t))}else{for(let e of gi())E.enqueue(e);E.enqueue(t)}}),ee)await Kt({commands:p,outcome:{type:`failed`,message:`ask() returned an error result`},currentDir:X(),priority:`later`,workload:h.workload??v.workload});else{let e=await Kt({commands:p,outcome:{type:`completed`},currentDir:X(),priority:`later`,workload:h.workload??v.workload});for(let t of e)Ue({...t,uuid:Y()})}}catch(e){throw await Kt({commands:p,outcome:{type:`failed`,error:e},currentDir:X(),priority:`later`,workload:h.workload??v.workload}),e}for(let e of o)At(e,`completed`);if(je(),N?.sendResult(),v.promptSuggestions&&!t(process.env.CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION)){D.abortController?.abort();let e=new AbortController;D.abortController=e;let t=an();if(!t)Sn(`sdk_no_params`,void 0,void 0,`sdk`);else{let n={promise:null};n.promise=(async()=>{try{let n=await Gt(e,O,g,t,`sdk`);if(!n||e.signal.aborted)return;let r={type:`prompt_suggestion`,suggestion:n.suggestion,uuid:Y(),session_id:m()},i={text:n.suggestion,emittedAt:Date.now(),promptId:n.promptId,generationRequestId:n.generationRequestId};w?(D.pendingSuggestion=r,D.pendingLastEmittedEntry={text:i.text,promptId:i.promptId,generationRequestId:i.generationRequestId}):(D.lastEmitted=i,E.enqueue(r))}catch(e){if(e instanceof Error&&(e.name===`AbortError`||e.name===`APIUserAbortError`)){Sn(`aborted`,void 0,void 0,`sdk`);return}q($n(e))}finally{D.inflightPromise===n.promise&&(D.inflightPromise=null)}})(),D.inflightPromise=n.promise}}Ie(),Tt(),nt()}};do{for(let e of gi())E.enqueue(e);x=`draining_commands`,await a(),i=!1;{let e=ye(g()).some(e=>Ye(e)),t=ce(n)!==void 0;(e||t)&&(i=!0,t||(x=`waiting_for_agents`,await ni(100)))}}while(i);w&&(E.enqueue(w),w=null,D.pendingSuggestion&&(E.enqueue(D.pendingSuggestion),D.pendingLastEmittedEntry&&(D.lastEmitted={...D.pendingLastEmittedEntry,emittedAt:Date.now()},D.pendingLastEmittedEntry=null),D.pendingSuggestion=null))}catch(t){try{await e.write({type:`result`,subtype:`error_during_execution`,duration_ms:0,duration_api_ms:0,is_error:!0,num_turns:0,stop_reason:null,session_id:m(),total_cost_usd:0,usage:Ei,modelUsage:{},permission_denials:[],uuid:Y(),errors:[H(t),...Er().map(e=>e.error)]})}catch{}D.abortController?.abort(),V(1);return}finally{if(x=`finally_flush`,await e.flushInternalEvents(),x=`finally_post_flush`,!vn()){Ti(`idle`);for(let e of gi())E.enqueue(e)}b=!1,Ve.start()}if($?.isProactiveActive()&&!$.isProactivePaused()&&ce(n)===void 0&&!S){Je();return}if(ce(n)!==void 0){I();return}S&&(D.inflightPromise&&await Promise.race([D.inflightPromise,ni(5e3)]),D.abortController?.abort(),D.abortController=null,await ke(),qe(),ae?.(),de.delete(oe),E.done())},L=function(e,t){E.enqueue({type:`control_response`,response:{subtype:`success`,request_id:e.request_id,response:t}})},R=function(e,t){E.enqueue({type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:t}})},Ze=new Set;e.setUnexpectedResponseCallback(async e=>{await io({message:e,setAppState:_,handledToolUseIds:Ze,onEnqueued:()=>{I()}})});let tt=new Map,rt=new Map,it=new Set,at=new Map,B=null;return(async()=>{let t=!1;br(`info`,`cli_message_loop_started`);for await(let n of e.structuredInput){let i=`uuid`in n?n.uuid:void 0;if(i&&n.type!==`user`&&n.type!==`control_response`&&At(i,`completed`),n.type===`control_request`){let i=n,o=i.request;if(i.request.subtype===`interrupt`)_(e=>({...e,attribution:{...e.attribution,escapeCount:e.attribution.escapeCount+1}})),T&&T.abort(),D.abortController?.abort(),D.abortController=null,D.lastEmitted=null,D.pendingSuggestion=null,L(i);else if(o.subtype===`end_session`){U(`[print.ts] end_session received, reason=${o.reason??`unspecified`}`),T&&T.abort(),D.abortController?.abort(),D.abortController=null,D.lastEmitted=null,D.pendingSuggestion=null,L(i);break}else if(i.request.subtype===`initialize`){if(i.request.sdkMcpServers&&i.request.sdkMcpServers.length>0)for(let e of i.request.sdkMcpServers)p[e]={type:`sdk`,name:e};await Za(i.request,i.request_id,t,E,a,pe,e,!!v.enableAuthStatus,v,ee,g),i.request.promptSuggestions&&_(e=>e.promptSuggestionEnabled?e:{...e,promptSuggestionEnabled:!0}),i.request.agentProgressSummaries&&h(!0),t=!0,Qt()&&I()}else if(i.request.subtype===`set_permission_mode`){let e=i.request;_(t=>({...t,toolPermissionContext:$a(e,i.request_id,t.toolPermissionContext,E),isUltraplanMode:e.ultraplan??t.isUltraplanMode}))}else if(i.request.subtype===`set_model`){let e=i.request.model??`default`,t=e==="default"?Yr():e;_e=t,u(t),Di({model:t}),ve(e,t),L(i)}else if(i.request.subtype===`set_max_thinking_tokens`)i.request.max_thinking_tokens===null?v.thinkingConfig=void 0:i.request.max_thinking_tokens===0?v.thinkingConfig={type:`disabled`}:v.thinkingConfig={type:`enabled`,budgetTokens:i.request.max_thinking_tokens},L(i);else if(i.request.subtype===`mcp_status`)L(i,{mcpServers:Fe()});else if(i.request.subtype===`get_context_usage`)try{let e=g(),t=await pa({messages:O,getAppState:g,options:{mainLoopModel:Qr(),tools:Oe(e),agentDefinitions:e.agentDefinitions,customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt}});L(i,{...t})}catch(e){R(i,H(e))}else if(i.request.subtype===`mcp_message`){let e=i.request,t=j.find(t=>t.name===e.server_name);t&&t.type===`connected`&&t.client?.transport?.onmessage&&t.client.transport.onmessage(e.message),L(i)}else if(i.request.subtype===`rewind_files`){let e=g(),t=await Qa(i.request.user_message_id,e,_,i.request.dry_run??!1);t.canRewind||i.request.dry_run?L(i,t):R(i,t.error??`Unexpected error`)}else if(i.request.subtype===`cancel_async_message`){let e=i.request.message_uuid,t=zn(t=>t.uuid===e);L(i,{cancelled:t.length>0})}else if(i.request.subtype===`seed_read_state`){try{let e=kr(i.request.path),t=Math.floor((await wa(e)).mtimeMs);if(t<=i.request.mtime){let n=await Ca(e,`utf-8`),r=(n.charCodeAt(0)===65279?n.slice(1):n).replaceAll(`\r
|
|
20
|
+
`,`
|
|
21
|
+
`);le.set(e,{content:r,timestamp:t,offset:void 0,limit:void 0})}}catch{}L(i)}else if(i.request.subtype===`mcp_set_servers`){let{response:e,sdkServersChanged:t}=await Pe(i.request.servers);L(i,e),t&&De()}else if(i.request.subtype===`reload_plugins`)try{let e=await va(_),t=F.filter(e=>e.source===`flagSettings`);F=[...e.agentDefinitions.allAgents,...t];let n=[],[r,a,o]=await Promise.allSettled([Tn(X()),Ge(),dn()]);r.status===`fulfilled`?P=r.value:q(r.reason),a.status===`rejected`&&q(a.reason),o.status===`fulfilled`?n=o.value.enabled.map(e=>({name:e.name,path:e.path,source:e.source})):q(o.reason),L(i,{commands:P.filter(e=>e.userInvocable!==!1).map(e=>({name:bt(e),description:Qe(e),argumentHint:e.argumentHint||``})),agents:F.map(e=>({name:e.agentType,description:e.whenToUse,model:e.model===`inherit`?void 0:e.model})),plugins:n,mcpServers:Fe(),error_count:e.error_count})}catch(e){R(i,H(e))}else if(i.request.subtype===`mcp_reconnect`){let e=g(),{serverName:t}=i.request;we.delete(t);let n=me(t)??r.find(e=>e.name===t)?.config??j.find(e=>e.name===t)?.config??M.clients.find(e=>e.name===t)?.config??e.mcp.clients.find(e=>e.name===t)?.config??null;if(!n)R(i,`Server not found: ${t}`);else{let e=await bn(t,n),r=G(t);if(_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===t?e.client:n),tools:[...A(n.mcp.tools,e=>e.name?.startsWith(r)),...e.tools],commands:[...A(n.mcp.commands,e=>Wn(e,t)),...e.commands],resources:e.resources&&e.resources.length>0?{...n.mcp.resources,[t]:e.resources}:di(n.mcp.resources,t)}})),M={...M,clients:[...M.clients.filter(e=>e.name!==t),e.client],tools:[...M.tools.filter(e=>!e.name?.startsWith(r)),...e.tools]},e.client.type===`connected`)Ee([e.client]),L(i);else{let t=e.client.type===`failed`?e.client.error??`Connection failed`:`Server status: ${e.client.type}`;R(i,t)}}}else if(i.request.subtype===`mcp_toggle`){let e=g(),{serverName:t,enabled:n}=i.request;we.delete(t);let a=me(t)??r.find(e=>e.name===t)?.config??j.find(e=>e.name===t)?.config??M.clients.find(e=>e.name===t)?.config??e.mcp.clients.find(e=>e.name===t)?.config??null;if(!a)R(i,`Server not found: ${t}`);else if(n){et(t,!0);let e=await bn(t,a),n=G(t);if(_(r=>({...r,mcp:{...r.mcp,clients:r.mcp.clients.map(n=>n.name===t?e.client:n),tools:[...A(r.mcp.tools,e=>e.name?.startsWith(n)),...e.tools],commands:[...A(r.mcp.commands,e=>Wn(e,t)),...e.commands],resources:e.resources&&e.resources.length>0?{...r.mcp.resources,[t]:e.resources}:di(r.mcp.resources,t)}})),e.client.type===`connected`)Ee([e.client]),L(i);else{let t=e.client.type===`failed`?e.client.error??`Connection failed`:`Server status: ${e.client.type}`;R(i,t)}}else{et(t,!1);let n=[...r,...j,...M.clients,...e.mcp.clients].find(e=>e.name===t);n&&n.type===`connected`&&await Jt(t,a);let o=G(t);_(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.map(e=>e.name===t?{name:t,type:`disabled`,config:a}:e),tools:A(e.mcp.tools,e=>e.name?.startsWith(o)),commands:A(e.mcp.commands,e=>Wn(e,t)),resources:di(e.mcp.resources,t)}})),L(i)}}else if(o.subtype===`mcp_authenticate`){let e=o.serverName,t=g(),n=me(e)??r.find(t=>t.name===e)?.config??t.mcp.clients.find(t=>t.name===e)?.config??null;if(!n)R(i,`Server not found: ${e}`);else if(n.type!==`sse`&&n.type!==`http`)R(i,`Server type "${n.type}" does not support OAuth authentication`);else try{tt.get(e)?.abort();let t=new AbortController;tt.set(e,t);let r,a=new Promise(e=>{r=e}),o=qt(e,n,e=>r(e),t.signal,{skipBrowserOpen:!0,onWaitingForCallback:t=>{rt.set(e,t)}}),s=await Promise.race([a,o.then(()=>null)]);s?L(i,{authUrl:s,requiresUserAction:!0}):L(i,{requiresUserAction:!1}),at.set(e,o),o.then(async()=>{if(be(e)||it.has(e))return;let t=await bn(e,n),r=G(e);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===e?t.client:n),tools:[...A(n.mcp.tools,e=>e.name?.startsWith(r)),...t.tools],commands:[...A(n.mcp.commands,t=>Wn(t,e)),...t.commands],resources:t.resources&&t.resources.length>0?{...n.mcp.resources,[e]:t.resources}:di(n.mcp.resources,e)}})),M={...M,clients:[...M.clients.filter(t=>t.name!==e),t.client],tools:[...M.tools.filter(e=>!e.name?.startsWith(r)),...t.tools]}}).catch(t=>{U(`MCP OAuth failed for ${e}: ${t}`,{level:`error`})}).finally(()=>{tt.get(e)===t&&(tt.delete(e),rt.delete(e),it.delete(e),at.delete(e))})}catch(e){R(i,H(e))}}else if(o.subtype===`mcp_oauth_callback_url`){let e=o.serverName,t=o.callbackUrl,n=rt.get(e);if(n){let r=!1;try{let e=new URL(t);r=e.searchParams.has(`code`)||e.searchParams.has(`error`)}catch{}if(!r)R(i,`Invalid callback URL: missing authorization code. Please paste the full redirect URL including the code parameter.`);else{it.add(e),n(t);let r=at.get(e);if(r)try{await r,L(i)}catch(e){R(i,e instanceof Error?e.message:`OAuth authentication failed`)}else L(i)}}else R(i,`No active OAuth flow for server: ${e}`)}else if(o.subtype===`claude_authenticate`){let e=o.loginWithClaudeAi;B?.service.cleanup(),J(`tengu_oauth_flow_start`,{loginWithClaudeAi:e??!0});let t=new Xi,n,r=new Promise(e=>{n=e}),a=t.startOAuthFlow(async(e,t)=>{n({manualUrl:e,automaticUrl:t})},{loginWithClaudeAi:e??!0,skipBrowserOpen:!0}).then(async t=>{await Zi(t),J(`tengu_oauth_success`,{loginWithClaudeAi:e??!0})}).finally(()=>{t.cleanup(),B?.service===t&&(B=null)});B={service:t,flow:a},a.catch(e=>U(`claude_authenticate flow ended: ${e}`,{level:`info`}));try{let{manualUrl:e,automaticUrl:t}=await Promise.race([r,a.then(()=>{throw Error(`OAuth flow completed without producing auth URLs`)})]);L(i,{manualUrl:e,automaticUrl:t})}catch(e){R(i,H(e))}}else if(o.subtype===`claude_oauth_callback`||o.subtype===`claude_oauth_wait_for_completion`)if(!B)R(i,`No active claude_authenticate flow`);else{o.subtype===`claude_oauth_callback`&&B.service.handleManualAuthCodeInput({authorizationCode:o.authorizationCode,state:o.state});let{flow:e}=B;e.then(()=>{let e=ti();L(i,{account:{email:e?.email,organization:e?.organization,subscriptionType:e?.subscription,tokenSource:e?.tokenSource,apiKeySource:e?.apiKeySource,apiProvider:Wr()}})},e=>R(i,H(e)))}else if(o.subtype===`mcp_clear_auth`){let e=o.serverName,t=g(),n=me(e)??r.find(t=>t.name===e)?.config??t.mcp.clients.find(t=>t.name===e)?.config??null;if(!n)R(i,`Server not found: ${e}`);else if(n.type!==`sse`&&n.type!==`http`)R(i,`Cannot clear auth for server type "${n.type}"`);else{await gn(e,n);let t=await bn(e,n),r=G(e);_(n=>({...n,mcp:{...n.mcp,clients:n.mcp.clients.map(n=>n.name===e?t.client:n),tools:[...A(n.mcp.tools,e=>e.name?.startsWith(r)),...t.tools],commands:[...A(n.mcp.commands,t=>Wn(t,e)),...t.commands],resources:t.resources&&t.resources.length>0?{...n.mcp.resources,[e]:t.resources}:di(n.mcp.resources,e)}})),L(i,{})}}else if(i.request.subtype===`apply_flag_settings`){let e=Qr(),t=s()??{},n=i.request.settings,r={...t,...n};for(let e of Object.keys(r))r[e]===null&&delete r[e];l(r),He.notifyChange(`flagSettings`),`model`in n&&(n.model==null?u(void 0):u(String(n.model)));let a=Qr();if(a!==e){_e=a;let e=n.model?String(n.model):`default`;Di({model:a}),ve(e,a)}L(i)}else if(i.request.subtype===`get_settings`){let e=g(),t=Qr(),n=Me(t)?ze(t,e.effortValue):void 0;L(i,{...dr(),applied:{model:t,effort:typeof n==`string`?n:null}})}else if(i.request.subtype===`stop_task`){let{task_id:e}=i.request;try{await sn(e,{getAppState:g,setAppState:_}),L(i,{})}catch(e){R(i,H(e))}}else if(o.subtype===`generate_session_title`){let e=o.description,t=o.persist,n=(T&&!T.signal.aborted?T:ge()).signal;(async()=>{try{let r=await Ri(e,n);if(r&&t)try{lt(m(),r)}catch(e){q(e)}L(i,{title:r})}catch(e){R(i,H(e))}})()}else if(o.subtype===`side_question`){let e=o.question;(async()=>{try{let t=an(),n=t?{...t,toolUseContext:{...t.toolUseContext,abortController:ge()}}:await ua({tools:Oe(g()),commands:P,mcpClients:[...g().mcp.clients,...j,...M.clients],messages:O,readFileState:k,getAppState:g,setAppState:_,customSystemPrompt:v.systemPrompt,appendSystemPrompt:v.appendSystemPrompt,thinkingConfig:v.thinkingConfig,agents:F}),r=await fa({question:e,cacheSafeParams:n});L(i,{response:r.response})}catch(e){R(i,H(e))}})()}else if(i.request.subtype===`set_proactive`)i.request.enabled?$.isProactiveActive()||($.activateProactive(`command`),Je()):$.deactivateProactive(),L(i);else if(o.subtype===`remote_control`)if(o.enabled)if(N)L(i,{session_url:Ce(N.bridgeSessionId,N.sessionIngressUrl),connect_url:cn(N.environmentId,N.sessionIngressUrl),environment_id:N.environmentId});else{let t;try{let{initReplBridge:n}=await import(`./initReplBridge-myzllvlk.js`),r=await n({onInboundMessage(e){let t=aa(e);if(!t)return;let{content:n,uuid:r}=t;Ue({value:n,mode:`prompt`,uuid:r,skipSlashCommands:!0}),I()},onPermissionResponse(t){e.injectControlResponse(t)},onInterrupt(){T?.abort()},onSetModel(e){let t=e==="default"?Yr():e;_e=t,u(t)},onSetMaxThinkingTokens(e){e===null?v.thinkingConfig=void 0:e===0?v.thinkingConfig={type:`disabled`}:v.thinkingConfig={type:`enabled`,budgetTokens:e}},onStateChange(e,n){e===`failed`&&(t=n),U(`[bridge:sdk] State change: ${e}${n?` — ${n}`:``}`),E.enqueue({type:`system`,subtype:`bridge_state`,state:e,detail:n,uuid:Y(),session_id:m()})},initialMessages:O.length>0?O:void 0});r?(N=r,Ae=O.length,e.setOnControlRequestSent(e=>{r.sendControlRequest(e)}),e.setOnControlRequestResolved(e=>{r.sendControlCancelRequest(e)}),L(i,{session_url:Ce(r.bridgeSessionId,r.sessionIngressUrl),connect_url:cn(r.environmentId,r.sessionIngressUrl),environment_id:r.environmentId})):R(i,t??`Remote Control initialization failed`)}catch(e){R(i,H(e))}}else N&&(e.setOnControlRequestSent(void 0),e.setOnControlRequestResolved(void 0),await N.teardown(),N=null),L(i);else R(i,`Unsupported control request subtype: ${i.request.subtype}`);continue}else if(n.type===`control_response`){v.replayUserMessages&&E.enqueue(n);continue}else if(n.type===`keep_alive`)continue;else if(n.type===`update_environment_variables`)continue;else if(n.type===`assistant`||n.type===`system`){let e=Fi([n]);O.push(...e),n.type===`assistant`&&v.replayUserMessages&&E.enqueue(n);continue}if(n.type!==`user`)continue;let o=n;if(t=!0,o.uuid){let e=m(),t=await Yt(e,o.uuid);if(t||Va.has(o.uuid)){U(`Skipping duplicate user message: ${o.uuid}`),v.replayUserMessages&&(U(`Sending acknowledgment for duplicate user message: ${o.uuid}`),E.enqueue({type:`user`,content:o.message?.content??``,message:o.message,session_id:e,parent_tool_use_id:null,uuid:o.uuid,timestamp:o.timestamp,isReplay:!0})),t&&At(o.uuid,`completed`);continue}Ua(o.uuid)}Ue({mode:`prompt`,value:await Pi(o,o.message.content),uuid:o.uuid,priority:o.priority}),_(e=>({...e,attribution:ji(e.attribution,e=>{jt(e).catch(e=>{U(`Attribution: Failed to save snapshot: ${e}`)})})})),I()}S=!0,b||(D.inflightPromise&&await Promise.race([D.inflightPromise,ni(5e3)]),D.abortController?.abort(),D.abortController=null,await ke(),qe(),ae?.(),de.delete(oe),E.done())})(),E}function Ya(e){let t=async(n,r,i,a,o,s)=>{let c=s??await R(n,r,i,a,o);if(c.behavior===`allow`||c.behavior===`deny`)return c;let{signal:l,cleanup:u}=D(i.abortController.signal);if(l.aborted)return u(),{behavior:`deny`,message:`Permission prompt was aborted.`,decisionReason:{type:`permissionPromptTool`,permissionPromptToolName:n.name,toolResult:void 0}};let d=new Promise(e=>{l.addEventListener(`abort`,()=>e(`aborted`),{once:!0})}),f=e.call({tool_name:n.name,input:r,tool_use_id:o},i,t,a),p=await Promise.race([f,d]);if(u(),p===`aborted`||l.aborted)return{behavior:`deny`,message:`Permission prompt was aborted.`,decisionReason:{type:`permissionPromptTool`,permissionPromptToolName:n.name,toolResult:void 0}};let m=p,h=e.mapToolResultToToolResultBlockParam(m.data,`1`);if(!h.content||!Array.isArray(h.content)||!h.content[0]||h.content[0].type!==`text`||typeof h.content[0].text!=`string`)throw Error(`Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.`);return na(oa().parse(jr(h.content[0].text)),e,r,i)};return t}function Xa(e,t,n,r){if(e===`stdio`)return t.createCanUseTool(r);if(!e)return async(e,t,n,r,i,a)=>a??await R(e,t,n,r,i);let i=null;return async(t,r,a,o,s,c)=>{if(!i){let t=n(),r=t.find(t=>ii(t,e));if(!r){let n=`Error: MCP tool ${e} (passed via --permission-prompt-tool) not found. Available MCP tools: ${t.map(e=>e.name).join(`, `)||`none`}`;throw process.stderr.write(`${n}\n`),V(1),Error(n)}if(!r.inputJSONSchema){let t=`Error: tool ${e} (passed via --permission-prompt-tool) must be an MCP tool`;throw process.stderr.write(`${t}\n`),V(1),Error(t)}i=Ya(r)}return i(t,r,a,o,s,c)}}async function Za(e,t,n,r,i,a,o,s,c,l,p){if(n){r.enqueue({type:`control_response`,response:{subtype:`error`,error:`Already initialized`,request_id:t,pending_permission_requests:o.getPendingPermissionRequests()}});return}if(e.systemPrompt!==void 0&&(c.systemPrompt=e.systemPrompt),e.appendSystemPrompt!==void 0&&(c.appendSystemPrompt=e.appendSystemPrompt),e.promptSuggestions!==void 0&&(c.promptSuggestions=e.promptSuggestions),e.agents){let t=Mt(e.agents,`flagSettings`);l.push(...t)}if(c.agent){let e=f()===c.agent,t=l.find(e=>e.agentType===c.agent);if(t&&!e){if(d(t.agentType),!c.systemPrompt&&!An(t)){let e=t.getSystemPrompt();e&&(c.systemPrompt=e)}!c.userSpecifiedModel&&t.model&&t.model!==`inherit`&&u(Nr(t.model)),t.initialPrompt&&o.prependUserMessage(t.initialPrompt)}else t?.initialPrompt&&o.prependUserMessage(t.initialPrompt)}let h=fr()?.outputStyle||`default`,ee=await pt(Xn()),v=ti();if(e.hooks){let t={};for(let[n,r]of Object.entries(e.hooks))t[n]=r.map(e=>{let t=e.hookCallbackIds.map(t=>o.createHookCallback(t,e.timeout));return{matcher:e.matcher,hooks:t}});_(t)}e.jsonSchema&&g(e.jsonSchema);let te={commands:i.filter(e=>e.userInvocable!==!1).map(e=>({name:bt(e),description:Qe(e),argumentHint:e.argumentHint||``})),agents:l.map(e=>({name:e.agentType,description:e.whenToUse,model:e.model===`inherit`?void 0:e.model})),output_style:h,available_output_styles:Object.keys(ee),models:a,account:{email:v?.email,organization:v?.organization,subscriptionType:v?.subscription,tokenSource:v?.tokenSource,apiKeySource:v?.apiKeySource,apiProvider:Wr()},pid:process.pid};if(Gr()&&Jr()){let e=p();te.fast_mode_state=zr(c.userSpecifiedModel??null,e.fastMode)}if(r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:t,response:te}}),s){let e=Lr.getInstance().getStatus();e&&r.enqueue({type:`auth_status`,isAuthenticating:e.isAuthenticating,output:e.output,error:e.error,uuid:Y(),session_id:m()})}}async function Qa(e,t,n,r){if(!E())return{canRewind:!1,error:`File rewinding is not enabled.`,filesChanged:[]};if(!Ve(t.fileHistory,e))return{canRewind:!1,error:`No file checkpoint found for this message.`,filesChanged:[]};if(r){let n=await Bn(t.fileHistory,e);return{canRewind:!0,filesChanged:n?.filesChanged??[],insertions:n?.insertions,deletions:n?.deletions}}try{await N(e=>n(t=>({...t,fileHistory:e(t.fileHistory)})),e)}catch(e){return{canRewind:!1,error:`Failed to rewind: ${H(e)}`,filesChanged:[]}}return{canRewind:!0,filesChanged:[]}}function $a(e,t,n,r){if(e.mode===`bypassPermissions`){if(ae())return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:`Cannot set permission mode to bypassPermissions because it is disabled by settings or configuration`}}),n;if(!n.isBypassPermissionsModeAvailable)return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:`Cannot set permission mode to bypassPermissions because the session was not launched with --dangerously-skip-permissions`}}),n}if(e.mode===`auto`&&!oe()){let e=Hn();return r.enqueue({type:`control_response`,response:{subtype:`error`,request_id:t,error:e?`Cannot set permission mode to auto: ${gt(e)}`:`Cannot set permission mode to auto`}}),n}return r.enqueue({type:`control_response`,response:{subtype:`success`,request_id:t,response:{mode:e.mode}}}),{...je(n.mode,e.mode,n),mode:e.mode}}function eo(e,t){if(t===`stream-json`){let t={type:`result`,subtype:`error_during_execution`,duration_ms:0,duration_api_ms:0,is_error:!0,num_turns:0,stop_reason:null,session_id:m(),total_cost_usd:0,usage:Ei,modelUsage:{},permission_denials:[],uuid:Y(),errors:[e]};process.stdout.write(W(t)+`
|
|
22
|
+
`)}else process.stderr.write(e+`
|
|
23
|
+
`)}function to(e,t){let n=e.findIndex(e=>e.uuid===t.uuid);n!==-1&&e.splice(n,2)}async function no(e,t){let r=!ee();if(t.continue)try{J(`tengu_continue_print`,{});let n=await Dn(void 0,void 0);if(n)return t.forkSession||n.sessionId&&(v(pe(n.sessionId),n.fullPath?ba(n.fullPath):null),r&&await Ft()),ga(n,e),xn(t.forkSession?{...n,worktreeSession:void 0}:n),{messages:n.messages,turnInterruptionState:n.turnInterruptionState,agentSetting:n.agentSetting}}catch(e){return q(e),V(1),{messages:[]}}if(t.teleport)try{if(!We(`allow_remote_sessions`))throw Error(`Remote sessions are disabled by your organization's policy.`);if(J(`tengu_teleport_print`,{}),typeof t.teleport!=`string`)throw Error(`No session ID provided for teleport`);let{checkOutTeleportedSessionBranch:e,processMessagesForTeleportResume:n,teleportResumeCodeSession:r,validateGitState:i}=await import(`./teleport-4Srg5vcP.js`);await i();let a=await r(t.teleport),{branchError:o}=await e(a.branch);return{messages:n(a.log,o)}}catch(e){return q(e),V(1),{messages:[]}}if(t.resume)try{J(`tengu_resume_print`,{});let i=Na(typeof t.resume==`string`?t.resume:``);if(!i){let e=`Error: --resume requires a valid session ID when used with --print. Usage: claude -p --resume <session-id>`;return typeof t.resume==`string`&&(e+=`. Session IDs must be in UUID format (e.g., 550e8400-e29b-41d4-a716-446655440000). Provided value "${t.resume}" is not a valid UUID`),eo(e,t.outputFormat),V(1),{messages:[]}}if(n(process.env.CLAUDE_CODE_USE_CCR_V2)){let[,n]=await Promise.all([on(i.sessionId),t.restoredWorkerState]);n&&(e($i(n)),typeof n.model==`string`&&u(n.model))}else i.isUrl&&i.ingressUrl&&n(process.env.ENABLE_SESSION_PERSISTENCE)&&await S(i.sessionId,i.ingressUrl);let a=await Dn(i.sessionId,i.jsonlFile||void 0);if(!a||a.messages.length===0)return i.isUrl||n(process.env.CLAUDE_CODE_USE_CCR_V2)?{messages:await(t.sessionStartHooksPromise??B(`startup`))}:(eo(`No conversation found with session ID: ${i.sessionId}`,t.outputFormat),V(1),{messages:[]});if(t.resumeSessionAt){let e=a.messages.findIndex(e=>e.uuid===t.resumeSessionAt);if(e<0)return eo(`No message found with message.uuid of: ${t.resumeSessionAt}`,t.outputFormat),V(1),{messages:[]};a.messages=e>=0?a.messages.slice(0,e+1):[]}return!t.forkSession&&a.sessionId&&(v(pe(a.sessionId),a.fullPath?ba(a.fullPath):null),r&&await Ft()),ga(a,e),xn(t.forkSession?{...a,worktreeSession:void 0}:a),{messages:a.messages,turnInterruptionState:a.turnInterruptionState,agentSetting:a.agentSetting}}catch(e){return q(e),eo(e instanceof Error?`Failed to resume session: ${e.message}`:`Failed to resume session with --print mode`,t.outputFormat),V(1),{messages:[]}}return{messages:await(t.sessionStartHooksPromise??B(`startup`))}}function ro(e,t){let n;return n=typeof e==`string`?e.trim()===``?Xt([]):Xt([W({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})]):e,t.sdkUrl?new Da(t.sdkUrl,n,t.replayUserMessages):new ta(n,t.replayUserMessages)}async function io({message:e,setAppState:t,onEnqueued:n,handledToolUseIds:r}){let i=e.response;if(i?.subtype===`success`&&i.response?.toolUseID&&typeof i.response.toolUseID==`string`){let e=i.response,t=e.toolUseID;if(!t)return!1;if(U(`handleOrphanedPermissionResponse: received orphaned control_response for toolUseID=${t} request_id=${i.request_id}`),r.has(t))return U(`handleOrphanedPermissionResponse: skipping duplicate orphaned permission for toolUseID=${t} (already handled)`),!1;let a=await Ct(t);return a?(r.add(t),U(`handleOrphanedPermissionResponse: enqueuing orphaned permission for toolUseID=${t} messageID=${a.message.id}`),Ue({mode:`orphaned-permission`,value:[],orphanedPermission:{permissionResult:e,assistantMessage:a}}),n?.(),!0):(U(`handleOrphanedPermissionResponse: no unresolved tool_use found for toolUseID=${t} (already resolved in transcript)`),!1)}return!1}function ao(e){return{...e,scope:`dynamic`}}async function oo(e,t,n,r){let{allowed:i,blocked:a}=qn(e),o={};for(let e of a)o[e]=`Blocked by enterprise policy (allowedMcpServers/deniedMcpServers)`;let s={},c={};for(let[e,t]of Object.entries(i))t.type===`sdk`?s[e]=t:c[e]=t;let l=new Set(Object.keys(t.configs)),u=new Set(Object.keys(s)),d=[],f=[],p={...t.configs},m=[...t.clients],h=[...t.tools];for(let e of l)if(!u.has(e)){let t=m.find(t=>t.name===e);t&&t.type===`connected`&&await t.cleanup(),m=m.filter(t=>t.name!==e);let n=`mcp__${e}__`;h=h.filter(e=>!e.name.startsWith(n)),delete p[e],f.push(e)}for(let[e,t]of Object.entries(s))if(!l.has(e)){p[e]=t;let n={type:`pending`,name:e,config:{...t,scope:`dynamic`}};m=[...m,n],d.push(e)}let g=await so(c,n,r);return{response:{added:[...d,...g.response.added],removed:[...f,...g.response.removed],errors:{...o,...g.response.errors}},newSdkState:{configs:p,clients:m,tools:h},newDynamicState:g.newState,sdkServersChanged:d.length>0||f.length>0}}async function so(e,t,n){let r=new Set(Object.keys(t.configs)),i=new Set(Object.keys(e)),a=[...r].filter(e=>!i.has(e)),o=[...i].filter(e=>!r.has(e)),s=[...r].filter(e=>i.has(e)).filter(n=>{let r=t.configs[n],i=e[n];return!r||!i||!pn(r,ao(i))}),c=[],l=[],u={},d=[...t.clients],f=[...t.tools];for(let e of[...a,...s]){let n=d.find(t=>t.name===e),r=t.configs[e];if(n&&r){if(n.type===`connected`)try{await n.cleanup()}catch(e){q(e)}await Jt(e,r)}let i=`mcp__${e}__`;f=f.filter(e=>!e.name.startsWith(i)),d=d.filter(t=>t.name!==e),a.includes(e)&&c.push(e)}for(let t of[...o,...s]){let n=e[t];if(!n)continue;let r=ao(n);if(n.type===`sdk`){l.push(t);continue}try{let e=await ft(t,r);if(d.push(e),e.type===`connected`){let t=await St(e);f.push(...t)}else e.type===`failed`&&(u[t]=e.error||`Connection failed`);l.push(t)}catch(e){let n=$n(e);u[t]=n.message,q(n)}}let p={};for(let t of i){let n=e[t];n&&(p[t]=ao(n))}let m={clients:d,tools:f,configs:p};return n(e=>{let n=new Set([...Object.keys(t.configs),...Object.keys(p)]),r=e.mcp.tools.filter(e=>{for(let t of n)if(e.name.startsWith(`mcp__${t}__`))return!1;return!0}),i=e.mcp.clients.filter(e=>!n.has(e.name));return{...e,mcp:{...e.mcp,tools:[...r,...f],clients:[...i,...d]}}}),{response:{added:l,removed:c,errors:u},newState:m}}export{qa as runHeadless};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,r as i}from"./analytics-BotDBGh0.js";import{a,i as o,o as s,r as c}from"./grove-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,r as i}from"./analytics-BotDBGh0.js";import{a,i as o,o as s,r as c}from"./grove-CFBPplP6.js";import{n as l,r as u,t as d}from"./Grove-CD769Wvw.js";async function f(e){if(!await s())return e(m),null;let[t,n]=await Promise.all([o(),c()]);if(!t.success)return e(m),null;let r=t.data,a=n.success?n.data:null;async function u(t){if(t===`escape`||t===`defer`){e(`Privacy settings dialog dismissed`,{display:`system`});return}await f()}async function f(){let t=await o();if(!t.success){e(`Unable to retrieve updated privacy settings`,{display:`system`});return}let n=t.data;e(`"Help improve Claude" set to ${n.grove_enabled?`true`:`false`}.`),r.grove_enabled!==null&&r.grove_enabled!==n.grove_enabled&&i(`tengu_grove_policy_toggled`,{state:n.grove_enabled,location:`settings`})}return r.grove_enabled===null?(0,p.jsx)(d,{showIfAlreadyViewed:!0,onDone:u,location:`settings`}):(0,p.jsx)(l,{settings:r,domainExcluded:a?.domain_excluded,onDone:f})}var p,m;e((()=>{t(),u(),r(),a(),p=n(),m=`Review and manage your privacy settings at https://claude.ai/settings/data-privacy-controls`}))();export{f as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,fi as n,t as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Ap as a,GC as o,Hp as s,Jg as c,Jm as l,So as u,Vp as d,WC as f,Yg as p,Ym as m,Yo as h,_u as g,kp as _,vo as v,vu as y,xo as b,zo as x}from"./loadAgentsDir-BURvZNN6.js";import{F as S,j as C,z as w}from"./debug-BrXObCdR.js";import{g as T,n as E}from"./settings-DfWP5y6X.js";import{n as D,r as O}from"./analytics-BotDBGh0.js";import{Ot as k,kt as A}from"./prompt-DNDgGM9q.js";import{randomUUID as j}from"crypto";n(),r(),y(),m(),s();var M=i();function N({input:e,progress:n,verbose:r}){return(0,M.jsxs)(t,{flexDirection:`column`,marginTop:1,children:[(0,M.jsx)(l,{addMargin:!1,param:{text:`<bash-input>${e}</bash-input>`,type:`text`}}),n?(0,M.jsx)(d,{fullOutput:n.fullOutput,output:n.output,elapsedTimeSeconds:n.elapsedTimeSeconds,totalLines:n.totalLines,verbose:r}):g.renderToolUseProgressMessage?.([],{verbose:r,tools:[],terminalSize:void 0})]})}w(),D(),c(),x(),T();function P(){return E().defaultShell??`bash`}y(),k(),o();async function F(t,n,r,i,o){let s=A()&&P()===`powershell`;O(`tengu_input_bash`,{powershell:s});let c=u({content:h({inputString:`<bash-input>${t}</bash-input>`,precedingInputBlocks:n})}),l;o({jsx:(0,M.jsx)(N,{input:t,progress:null,verbose:i.options.verbose}),shouldHidePromptInput:!1});try{let n={...i,setToolJSX:e=>{l=e?.jsx}},d=e=>{o({jsx:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{input:t,progress:e.data,verbose:i.options.verbose}),l]}),shouldHidePromptInput:!1,showSpinner:!1})},m=null;s&&(m=(a(),e(_)).PowerShellTool);let h=m??g,y=(m?await m.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,d):await g.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,d)).data;if(!y)throw Error(`No result received from shell command`);let b=y.stderr,x=await p(h,{...y,stderr:``},j()),S=typeof x.content==`string`?x.content:f(y.stdout);return{messages:[v(),c,...r,u({content:`<bash-stdout>${S}</bash-stdout><bash-stderr>${f(b)}</bash-stderr>`})],shouldQuery:!1}}catch(e){return e instanceof C?e.interrupted?{messages:[v(),c,b({toolUse:!1}),...r],shouldQuery:!1}:{messages:[v(),c,...r,u({content:`<bash-stdout>${f(e.stdout)}</bash-stdout><bash-stderr>${f(e.stderr)}</bash-stderr>`})],shouldQuery:!1}:{messages:[v(),c,...r,u({content:`<bash-stderr>Command failed: ${f(S(e))}</bash-stderr>`})],shouldQuery:!1}}finally{o(null)}}export{F as processBashCommand};
|