@readmagic/workmate 0.0.2 → 0.0.3
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-mANiG0xj.js} +1 -1
- package/dist/chunks/{App-Coboqa8H.js → App-aUVaOLeo.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CYpBbj0k.js → ApproveApiKey-36iUE5CW.js} +1 -1
- package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DxKsTdqj.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-Cx3QGFz-.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BAK9fxwg.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
- package/dist/chunks/{DesktopHandoff-BsHgLlTy.js → DesktopHandoff-Blg1TVut.js} +1 -1
- package/dist/chunks/{DiffDialog-BgTW2Znv.js → DiffDialog-CUEpuocY.js} +2 -2
- package/dist/chunks/Doctor-B540I-gq.js +1 -0
- package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
- package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
- package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
- package/dist/chunks/{Grove-Dsi4yU08.js → Grove-D9lSG_Lh.js} +1 -1
- package/dist/chunks/Grove-DLYXL8hv.js +1 -0
- package/dist/chunks/{HybridTransport-8qA64lCx.js → HybridTransport-8j0AviF6.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-CAZ1z5WG.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-D82Qk_MR.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
- package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
- package/dist/chunks/{McpParsingWarnings-8ZueNqAd.js → McpParsingWarnings-D0XvLirX.js} +1 -1
- package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
- package/dist/chunks/Messages-Dv2VrytX.js +11 -0
- package/dist/chunks/{Onboarding-CUztnbbv.js → Onboarding-B1WRpoBI.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-DSgrZvMv.js → OverageCreditUpsell-BSmgq089.js} +1 -1
- package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-IaihWay3.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-okS2rQ4k.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
- package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
- package/dist/chunks/REPL-B3RbzeV7.js +1 -0
- package/dist/chunks/{REPL-Dto012J0.js → REPL-CA8FEO7J.js} +44 -44
- package/dist/chunks/{RemoteCallout-C_UIYnuT.js → RemoteCallout-BFzCx_Pn.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-CuSSHAXN.js → RemoteSessionManager-BhUrtejX.js} +2 -2
- package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
- package/dist/chunks/{SSETransport-Chj_yfPv.js → SSETransport-DGIytG74.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
- package/dist/chunks/Settings-BvhG1XoW.js +2 -0
- package/dist/chunks/{TeleportProgress-DP1a8jit.js → TeleportProgress-Bens06DU.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B6sTwXuZ.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-CKUuRQSG.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
- package/dist/chunks/{ThemePicker-Dyq1YVhb.js → ThemePicker-BTfuZZ7E.js} +1 -1
- package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
- package/dist/chunks/{ValidationErrorsList-DUNh4BNa.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
- package/dist/chunks/{WelcomeV2-TPbOXGrO.js → WelcomeV2-C93xQYAF.js} +1 -1
- package/dist/chunks/{add-dir-Bf_5tCeR.js → add-dir-C3IhJYVH.js} +1 -1
- package/dist/chunks/{agentDisplay-CCeYiAta.js → agentDisplay-Cju-aXCx.js} +1 -1
- package/dist/chunks/{agents-Bt72Gz1v.js → agents-Bhg0CtXR.js} +7 -7
- package/dist/chunks/{agents-T8xHY5Wk.js → agents-Du3FQ82k.js} +1 -1
- package/dist/chunks/{allErrors-CDWTJcMw.js → allErrors-DJYCAtab.js} +1 -1
- package/dist/chunks/{ant-DRF-v5bA.js → ant-CVvy4SuO.js} +1 -1
- package/dist/chunks/api-CI8HXREw.js +1 -0
- package/dist/chunks/api-gJBnC8z3.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-C_SkUDk_.js} +1 -1
- package/dist/chunks/auth-B9V3i5oZ.js +1 -0
- package/dist/chunks/auth-CgEABs3i.js +15 -0
- package/dist/chunks/auth-fSFfSKy_.js +1 -0
- package/dist/chunks/{autoMode-DW_H3i37.js → autoMode-CZyb-mMY.js} +5 -5
- package/dist/chunks/{autonomy-46hnmyAi.js → autonomy-BpINX4jw.js} +1 -1
- package/dist/chunks/{autonomy-OxhciwYa.js → autonomy-DJZ25xZp.js} +7 -7
- package/dist/chunks/{autonomyPanel-CTEjq0Bd.js → autonomyPanel-ssoiIOx5.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-Cpxq4krt.js → backgroundHousekeeping-BHncba6e.js} +3 -3
- package/dist/chunks/backgroundHousekeeping-QK8iEXoI.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-BXo5z2al.js} +1 -1
- package/dist/chunks/{bridge-Dpr2AWpc.js → bridge-CbKc1HeD.js} +2 -2
- package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
- package/dist/chunks/{bridgeConfig-DDF3teRE.js → bridgeConfig-DbqUHe0H.js} +1 -1
- package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
- package/dist/chunks/{bridgeEnabled-D4JDZd0y.js → bridgeEnabled-CM3SaumJ.js} +1 -1
- package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
- package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
- package/dist/chunks/bridgeMessaging-lfa_v3oi.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-Cp0whJaJ.js} +1 -1
- package/dist/chunks/{caches-BB5_91gU.js → caches-CmW7idg5.js} +2 -2
- package/dist/chunks/caches-CpqTC0Lb.js +1 -0
- package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
- package/dist/chunks/{claudeDesktop-9xfIgkzE.js → claudeDesktop-Cx31Ugjp.js} +1 -1
- package/dist/chunks/{clear-ueMvDelv.js → clear-DjGPxX7T.js} +1 -1
- package/dist/chunks/{cliLaunch-BJ9o-rIV.js → cliLaunch-BkPAatcs.js} +1 -1
- package/dist/chunks/client-DPUvQ6Rf.js +1 -0
- package/dist/chunks/{color-B0-MIfsq.js → color-DYYBN52b.js} +1 -1
- package/dist/chunks/commands-D7l3P1k9.js +1 -0
- package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
- package/dist/chunks/{commitAttribution-DKun9CeU.js → commitAttribution-Bmzgtqc6.js} +2 -2
- package/dist/chunks/compact-D6xqZN4Q.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-huQaTcNb.js +1 -0
- package/dist/chunks/config-qLaiAn7z.js +1 -0
- package/dist/chunks/{context-DBswG0EY.js → context-Bh_iUj76.js} +1 -1
- package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
- package/dist/chunks/{context-noninteractive-CTvyNimw.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
- package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
- package/dist/chunks/conversation-CvCQta8e.js +1 -0
- package/dist/chunks/{createSSHSession-BdO35H6o.js → createSSHSession-B0s839mX.js} +5 -5
- package/dist/chunks/createSession-GNSNbUbN.js +1 -0
- package/dist/chunks/{createSession-Br1g8qSD.js → createSession-VMTMXOHu.js} +1 -1
- package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
- package/dist/chunks/{daemon-BQiSFjc-.js → daemon-YtZbMQtn.js} +1 -1
- package/dist/chunks/datadog-D9rlcN12.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-DidI-4N5.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-CZg5qL2n.js} +1 -1
- package/dist/chunks/{directoryCompletion-CeV63gvu.js → directoryCompletion-CW2ckkQg.js} +1 -1
- package/dist/chunks/doctor-CKUXGCri.js +1 -0
- package/dist/chunks/{effort-BAlVDBHq.js → effort-BcvNemuq.js} +2 -2
- package/dist/chunks/{entry-DLqeVq5C.js → entry-dA1UCfC0.js} +4 -4
- package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
- package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
- package/dist/chunks/esm-DjGYYlQe.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-COMnVxzw.js +1 -0
- package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
- package/dist/chunks/extra-usage-By33zGLT.js +1 -0
- package/dist/chunks/{extra-usage-core-Dh4rVUI-.js → extra-usage-core-RZMzaH0L.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-D4Ya5KPm.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
- package/dist/chunks/{extraUsage-DtWi8E78.js → extraUsage-CTn9FWSk.js} +1 -1
- package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
- package/dist/chunks/fast-BXzdzzXU.js +1 -0
- package/dist/chunks/{fast-DkUxqWhE.js → fast-CNXgsvnE.js} +1 -1
- package/dist/chunks/{feedback-Cn7Sbqxa.js → feedback-DeJ2gvw2.js} +1 -1
- package/dist/chunks/{file-BZriE-XU.js → file-DcZWPH2V.js} +5 -5
- package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
- package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
- package/dist/chunks/{flushGate-ebqQZF1t.js → flushGate-CJ73xcaK.js} +1 -1
- package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
- package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
- package/dist/chunks/{generateSessionName-DEAw5x_h.js → generateSessionName-CGpL6ATy.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-C8Qzl7_i.js} +3 -3
- package/dist/chunks/{grok-CKlngG3b.js → grok-CDT9P_BL.js} +1 -1
- package/dist/chunks/{grove-DSWe6psK.js → grove-BGXzEyH9.js} +2 -2
- package/dist/chunks/{heapdump-OVbV05On.js → heapdump-CFHvdSZv.js} +5 -5
- package/dist/chunks/{help-CRtX5VX9.js → help-DUZ7Y7Em.js} +1 -1
- package/dist/chunks/{hooks-tpf90xd5.js → hooks-RHwUCXcT.js} +2 -2
- package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
- package/dist/chunks/{hostGuard-t7QfbijF.js → hostGuard-C5xydXZI.js} +1 -1
- package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
- package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
- package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
- package/dist/chunks/install-OkuNmjmB.js +1 -0
- package/dist/chunks/{instrumentation--Sx0y1Gk.js → instrumentation-hrXeo-G4.js} +6 -6
- package/dist/chunks/{job-D7B35Usp.js → job-DjmIpwJl.js} +1 -1
- package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
- package/dist/chunks/keybindings-B8U17bhs.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-DnxH2SAn.js} +1 -1
- package/dist/chunks/{launchLocalMemory-BxmDhENs.js → launchLocalMemory-CgXtGng1.js} +2 -2
- package/dist/chunks/{launchLocalVault-DQlTGA-g.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
- package/dist/chunks/{launchMemoryStores-EYAwxI8i.js → launchMemoryStores-DxVAIJuB.js} +1 -1
- package/dist/chunks/{launchOnboarding-CTu5Zf4E.js → launchOnboarding-Cn0t_o2k.js} +1 -1
- package/dist/chunks/{launchSchedule-CeHHSvO7.js → launchSchedule-Chwr3Nzd.js} +1 -1
- package/dist/chunks/{launchSkillStore-Bqh2Fru2.js → launchSkillStore-6zxJfWVU.js} +1 -1
- package/dist/chunks/{launchTeleport-Crc3XVZX.js → launchTeleport-Ba_Hj13c.js} +1 -1
- package/dist/chunks/{launchVault-BHLgpth_.js → launchVault-hGVrHy33.js} +1 -1
- package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
- package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
- package/dist/chunks/{loadAgentsDir-ZQwvbURI.js → loadAgentsDir-DrDu5yYy.js} +685 -683
- package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
- package/dist/chunks/localSearch-CebU5BA9.js +1 -0
- package/dist/chunks/{localSearch-H0LchlTi.js → localSearch-_bQhk9W6.js} +1 -1
- package/dist/chunks/{log-Duzb4o6h.js → log-BMCygSzM.js} +1 -1
- package/dist/chunks/{logoV2Utils-5lcUu53m.js → logoV2Utils-CoC4nheD.js} +1 -1
- package/dist/chunks/{magicDocs-D1FIPmYg.js → magicDocs-kMjYpjCA.js} +3 -3
- package/dist/chunks/{main-B8XtFN2P.js → main-C_rVSWfm.js} +78 -78
- package/dist/chunks/{main-CR7cXdgy.js → main-D862LI_d.js} +2 -2
- package/dist/chunks/{mappers-DKU4RgE3.js → mappers-D0CNXG32.js} +1 -1
- package/dist/chunks/mcp-1ZuFesM9.js +2 -0
- package/dist/chunks/mcp-CKvGBEjz.js +1 -0
- package/dist/chunks/mcp-DtxIl6aN.js +6 -0
- package/dist/chunks/{memoize-DgMjqLtn.js → memoize-B0zhbT8Z.js} +1 -1
- package/dist/chunks/{memory-D-Q62bJ7.js → memory-DE2jtkd_.js} +1 -1
- package/dist/chunks/{mode-DFZgqKBd.js → mode-B4WIxCMW.js} +2 -2
- package/dist/chunks/model-C4RHNhDQ.js +1 -0
- package/dist/chunks/model-fi472PRc.js +1 -0
- package/dist/chunks/{model-fDWtIRVr.js → model-j9GNZDFr.js} +1 -1
- package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
- package/dist/chunks/{onChangeAppState-DaQ0R9Tw.js → onChangeAppState-CGVeNkt7.js} +1 -1
- package/dist/chunks/{openai-DNS0-ivj.js → openai-BSVjSJiF.js} +3 -3
- package/dist/chunks/{overageCreditGrant-qHN3tnp2.js → overageCreditGrant-BVxlYgeU.js} +1 -1
- package/dist/chunks/{panelCall-BvKpHquo.js → panelCall-Cp6fpQeL.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-RjCtgt9J.js} +1 -1
- package/dist/chunks/{passes-DQdM2Ssq.js → passes-ByTLy6pj.js} +1 -1
- package/dist/chunks/{path-Cu_AKqg6.js → path-D5U-tm91.js} +1 -1
- package/dist/chunks/permissions-B3df_htx.js +3 -0
- package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
- package/dist/chunks/{pipeTransport-7GIO6GCA.js → pipeTransport-CqCnc-Ys.js} +1 -1
- package/dist/chunks/{plan-D8dQDl8W.js → plan-BxTA-b4l.js} +1 -1
- package/dist/chunks/{platform-B5dCGT8t.js → platform-BrYefG_2.js} +1 -1
- package/dist/chunks/{plugin-w8MqsKHn.js → plugin-DOpl5e1t.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-7FFHzSRz.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
- package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
- package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
- package/dist/chunks/{pluginFlagging-_WUQP3Lq.js → pluginFlagging-3FQGvIfq.js} +1 -1
- package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
- package/dist/chunks/{pluginStartupCheck-BelpzwZI.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
- package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
- package/dist/chunks/plugins-CcDG95Bs.js +4 -0
- package/dist/chunks/policyLimits-Bwi9VqDF.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-Cc_QOSPF.js +23 -0
- package/dist/chunks/{privacy-settings-D5zxu4Aa.js → privacy-settings-ChNsgGUs.js} +1 -1
- package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
- package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
- package/dist/chunks/prompt-C0nU0VK3.js +139 -0
- package/dist/chunks/prompt-CYx145pp.js +1 -0
- package/dist/chunks/prompt-DH3lKFag.js +1 -0
- package/dist/chunks/{promptEditor-D6HzjcMS.js → promptEditor-Cumef6hJ.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-VL7S3SCx.js} +1 -1
- package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
- package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
- package/dist/chunks/{referral-Cu9bEOFE.js → referral-DrebVwqx.js} +1 -1
- package/dist/chunks/{refresh-vJbxW4a1.js → refresh-pFezssA8.js} +1 -1
- package/dist/chunks/{registerProtocol-B_XbLDQO.js → registerProtocol-CukLQuxJ.js} +3 -3
- package/dist/chunks/{release-notes-CavWoMQR.js → release-notes-D7vrFNXp.js} +1 -1
- package/dist/chunks/{releaseNotes-Di6OaHF7.js → releaseNotes-CDx2P0fb.js} +2 -2
- package/dist/chunks/{reload-plugins-ofeLn07p.js → reload-plugins-CltHfg-l.js} +1 -1
- package/dist/chunks/{remote-env-dXzHAuD6.js → remote-env-SvvSuP0J.js} +1 -1
- package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
- package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
- package/dist/chunks/{rename-CtjP0lop.js → rename-CbqrCCBO.js} +1 -1
- package/dist/chunks/{renderOptions-DOXmueQV.js → renderOptions-BUJB9nAm.js} +1 -1
- package/dist/chunks/{resume-C5h5JvY1.js → resume-DockJaY9.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-DOZFrqJu.js → runtimeObserver-DSUuYKfs.js} +1 -1
- package/dist/chunks/{runtimeObserver-B93v1AxE.js → runtimeObserver-XufSllVw.js} +4 -4
- package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
- package/dist/chunks/{sandbox-toggle-TiLGFwaZ.js → sandbox-toggle-CZI5fuK3.js} +1 -1
- package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
- package/dist/chunks/{session-v9tKHhU9.js → session-B-Z3DU9o.js} +2 -2
- package/dist/chunks/{sessionDiscovery-4byQKOnc.js → sessionDiscovery-C3pMZkBM.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
- package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
- package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
- package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
- package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
- package/dist/chunks/{sessionObserver-OgY9BUP4.js → sessionObserver-B_09FQKV.js} +1 -1
- package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
- package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
- package/dist/chunks/{sessionTracing-BBxhPccY.js → sessionTracing-lArOaj9u.js} +3 -3
- package/dist/chunks/settings-DfWP5y6X.js +19 -0
- package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
- package/dist/chunks/setup-DdbmxSZh.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DDSOFi1W.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
- package/dist/chunks/{shellQuote-yXoC_y5m.js → shellQuote-DkSy9MYE.js} +1 -1
- package/dist/chunks/{sideQuestion-CAiA6jAf.js → sideQuestion-BjHCLSR9.js} +1 -1
- package/dist/chunks/sinks-Cb--pqr-.js +2 -0
- package/dist/chunks/sinks-DbwDBd-E.js +1 -0
- package/dist/chunks/{skill-learning-Dx1o4mMo.js → skill-learning-B0dyBT1_.js} +1 -1
- package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
- package/dist/chunks/{skillGapStore-Zvqiyxds.js → skillGapStore-75ZYlfwi.js} +2 -2
- package/dist/chunks/{skillGapStore-BV_6qzxU.js → skillGapStore-D2fqmnKx.js} +1 -1
- package/dist/chunks/{skillGenerator-jJQDphQ8.js → skillGenerator-CwXUfM4Y.js} +2 -2
- package/dist/chunks/{skillLearning-BTT3_yGc.js → skillLearning-CB-5fdMl.js} +1 -1
- package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
- package/dist/chunks/{skillPanel-OW2M6SZr.js → skillPanel-Bum7xpgo.js} +3 -3
- package/dist/chunks/{skillSearchPanel-C0Y56c5N.js → skillSearchPanel-LSPwZIOw.js} +4 -4
- package/dist/chunks/{skills-BFsyLP33.js → skills-G8WBeffd.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-DHJbK4pV.js → status-ClSsvm1N.js} +2 -2
- package/dist/chunks/{status-BO5J2MAe.js → status-i5beKggW.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-CqeUBySi.js → statusNoticeHelpers-BK-54uGY.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-DYYq4H_i.js} +2 -2
- package/dist/chunks/{tasks-CoOs_Qkj.js → tasks-BySzm_YJ.js} +1 -1
- package/dist/chunks/teleport-dxtBcM01.js +1 -0
- package/dist/chunks/{templateJobs-Cl50Qw0s.js → templateJobs-CT5VxeRr.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-CVTVsRwt.js} +1 -1
- package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
- package/dist/chunks/{thinkback-ERCQ86CR.js → thinkback-CXsRbDYN.js} +1 -1
- package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
- package/dist/chunks/{tmux-ZZk68JBq.js → tmux-BY7IdQ1f.js} +1 -1
- package/dist/chunks/{toolEventObserver-9XCQXiMx.js → toolEventObserver--4fqXxQZ.js} +1 -1
- package/dist/chunks/{toolEventObserver-9-5Ne25Z.js → toolEventObserver-DdhPsAs1.js} +1 -1
- package/dist/chunks/toolPool-DvHECcbN.js +1 -0
- package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
- package/dist/chunks/trustedDevice-e6iF1X7C.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-i3PfFKly.js} +2 -2
- package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
- package/dist/chunks/{undercover-DDgIKbO5.js → undercover-Q24TWRw0.js} +1 -1
- package/dist/chunks/{up-D6bNw_tT.js → up-BHkC97_C.js} +1 -1
- package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
- package/dist/chunks/{upgrade-BN20nsCH.js → upgrade-7OrBbrzS.js} +1 -1
- package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
- package/dist/chunks/upload-B-lNHpWe.js +1 -0
- package/dist/chunks/{upstreamproxy-os5rw0Vg.js → upstreamproxy-DyR_eXO8.js} +4 -4
- package/dist/chunks/usage-7jOeIVv9.js +1 -0
- package/dist/chunks/{usage-D_sqm8us.js → usage-CZdPfUqP.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-vzUoPY51.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
- package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
- package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
- package/dist/chunks/{useMergedTools-Bb4XbC9d.js → useMergedTools-DMGRA1ga.js} +1 -1
- package/dist/chunks/{useSearchInput-B1UOjxAI.js → useSearchInput-D5VU9IDU.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BLbvu4--.js → useSettingsErrors-B5PSF1va.js} +1 -1
- package/dist/chunks/{util-CxlfALM4.js → util-CNa1ib_4.js} +1 -1
- package/dist/chunks/validatePlugin-Dw-RGCrm.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-B2QD2sKq.js} +1 -1
- package/dist/chunks/worktree-D38cJ23W.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +4 -5
- 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
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./isObject-C6qM3WEW.js";import{n as a,t as o}from"./memoize-BK3gG5ob.js";import{c as s,l as c,n as l,o as u}from"./envUtils-DSxRz_kt.js";import{t as d}from"./graceful-fs-DDVg0cja.js";import{Ai as f,Br as p,Di as m,Ei as h,Fi as g,Fr as _,Hr as v,Kr as ee,Pi as te,Pr as ne,Rr as re,Ti as ie,Ur as ae,Vr as oe,en as se,ji as ce,nt as le,ot as y,qr as ue,vi as de,vt as fe,wi as pe,yi as me,zr as he}from"./state-ix0xIunV.js";import{n as ge,t as _e}from"./cwd-CYmmnQVS.js";import{C as ve,I as b,S as ye,a as be,d as x,k as xe,l as S,nt as Se,p as Ce,rt as we,w as C,z as Te}from"./debug-BrXObCdR.js";import{Bn as Ee,Kn as De,Qt as Oe,Vn as ke,Xn as Ae,Yt as w,Zn as je,Zt as Me,c as T,en as Ne,g as Pe,n as Fe,qn as Ie}from"./settings-DfWP5y6X.js";import{M as Le,_ as Re,j as ze,n as Be}from"./git-Do0wJvux.js";import{d as Ve,o as He,s as Ue,u as We}from"./log-BMCygSzM.js";import{m as Ge}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{a as E,i as Ke}from"./path-D5U-tm91.js";import{C as qe,f as Je}from"./file-DcZWPH2V.js";import{f as Ye,p as Xe,s as Ze,u as Qe}from"./types-C-MRCL8J.js";import{n as $e,r as D}from"./analytics-BotDBGh0.js";import{homedir as et}from"os";import{basename as O,dirname as k,isAbsolute as tt,join as A,normalize as nt,resolve as rt,sep as it}from"path";import{unwatchFile as at,watchFile as ot}from"fs";import{randomBytes as st}from"crypto";var j,ct=t((()=>{g(),ke(),ie(),h(),j=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)te(t,pe(e)),e=Ee(e);return t}:m}));function lt(e){return f(e,Ie,j)}var ut=t((()=>{ce(),ct(),De()}));function dt(){let e=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(c(e))return!1;if(s(e))return!0;if(c(process.env.CLAUDE_CODE_SIMPLE)||c(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let t=Fe();return t.autoMemoryEnabled===void 0||t.autoMemoryEnabled}function ft(){return!1}function pt(){return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR?process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR:l()}function mt(e,t){if(!e)return;let n=e;if(t&&(n.startsWith(`~/`)||n.startsWith(`~\\`))){let e=n.slice(2),t=nt(e||`.`);if(t===`.`||t===`..`)return;n=A(et(),e)}let r=nt(n).replace(/[/\\]+$/,``);if(!(!tt(r)||r.length<3||/^[A-Za-z]:$/.test(r)||r.startsWith(`\\\\`)||r.startsWith(`//`)||r.includes(`\0`)))return(r+it).normalize(`NFC`)}function ht(){return mt(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function gt(){return mt(T(`policySettings`)?.autoMemoryDirectory??T(`flagSettings`)?.autoMemoryDirectory??T(`localSettings`)?.autoMemoryDirectory??T(`userSettings`)?.autoMemoryDirectory,!0)}function _t(){return ht()!==void 0}function vt(){return Be(y())??y()}function yt(){return A(M(),St)}function bt(e){return nt(e).startsWith(M())}var xt,St,M,Ct=t((()=>{o(),se(),u(),Re(),Ke(),Pe(),xt=`memory`,St=`MEMORY.md`,M=a(()=>(ht()??gt())||(A(A(pt(),`projects`),Ge(vt()),xt)+it).normalize(`NFC`),()=>y())}));function wt(e,t,n,i){if(!r(e))return e;t=v(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=oe(t[a]),u=n;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):void 0,u===void 0&&(u=r(d)?d:me(t[a+1])?[]:{})}Ae(c,l,u),c=c[l]}return e}var Tt=t((()=>{je(),ae(),de(),i(),p()}));function Et(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=re(e,o);n(s,o)&&wt(a,v(o,e),s)}return a}var Dt=t((()=>{he(),Tt(),ae()}));function N(e,t){if(e==null)return{};var n=ee(lt(e),function(e){return[e]});return t=ne(t),Et(e,n,function(e,n){return t(e,n[0])})}var Ot=t((()=>{ue(),_(),Dt(),ut()})),kt=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n);return this._options.unref&&i.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),At=n((e=>{var t=kt();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&n.forever,unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*t.minTimeout*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),jt=n(((e,t)=>{t.exports=At()})),Mt=n(((e,t)=>{t.exports=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`],process.platform!==`win32`&&t.exports.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.exports.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`)})),Nt=n(((t,n)=>{var r=global.process,i=function(e){return e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`};if(!i(r))n.exports=function(){return function(){}};else{var a=e(`assert`),o=Mt(),s=/^win/i.test(r.platform),c=e(`events`);typeof c!=`function`&&(c=c.EventEmitter);var l;r.__signal_exit_emitter__?l=r.__signal_exit_emitter__:(l=r.__signal_exit_emitter__=new c,l.count=0,l.emitted={}),l.infinite||(l.setMaxListeners(1/0),l.infinite=!0),n.exports=function(e,t){if(!i(global.process))return function(){};a.equal(typeof e,`function`,`a callback must be provided for exit handler`),p===!1&&m();var n=`exit`;return t&&t.alwaysLast&&(n=`afterexit`),l.on(n,e),function(){l.removeListener(n,e),l.listeners(`exit`).length===0&&l.listeners(`afterexit`).length===0&&u()}};var u=function(){!p||!i(global.process)||(p=!1,o.forEach(function(e){try{r.removeListener(e,f[e])}catch{}}),r.emit=_,r.reallyExit=h,--l.count)};n.exports.unload=u;var d=function(e,t,n){l.emitted[e]||(l.emitted[e]=!0,l.emit(e,t,n))},f={};o.forEach(function(e){f[e]=function(){i(global.process)&&r.listeners(e).length===l.count&&(u(),d(`exit`,null,e),d(`afterexit`,null,e),s&&e===`SIGHUP`&&(e=`SIGINT`),r.kill(r.pid,e))}}),n.exports.signals=function(){return o};var p=!1,m=function(){p||!i(global.process)||(p=!0,l.count+=1,o=o.filter(function(e){try{return r.on(e,f[e]),!0}catch{return!1}}),r.emit=v,r.reallyExit=g)};n.exports.load=m;var h=r.reallyExit,g=function(e){i(global.process)&&(r.exitCode=e||0,d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),h.call(r,r.exitCode))},_=r.emit,v=function(e,t){if(e===`exit`&&i(global.process)){t!==void 0&&(r.exitCode=t);var n=_.apply(this,arguments);return d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),n}else return _.apply(this,arguments)}}})),Pt=n(((e,t)=>{var n=Symbol();function r(e,t,r){let i=t[n];if(i)return t.stat(e,(e,t)=>{if(e)return r(e);r(null,t.mtime,i)});let a=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,a,a,i=>{if(i)return r(i);t.stat(e,(e,i)=>{if(e)return r(e);let a=i.mtime.getTime()%1e3==0?`s`:`ms`;Object.defineProperty(t,n,{value:a}),r(null,i.mtime,a)})})}function i(e){let t=Date.now();return e===`s`&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}t.exports.probe=r,t.exports.getMtime=i})),Ft=n(((t,n)=>{var r=e(`path`),i=d(),a=jt(),o=Nt(),s=Pt(),c={};function l(e,t){return t.lockfilePath||`${e}.lock`}function u(e,t,n){if(!t.realpath)return n(null,r.resolve(e));t.fs.realpath(e,n)}function f(e,t,n){let r=l(e,t);t.fs.mkdir(r,i=>{if(!i)return s.probe(r,t.fs,(e,i,a)=>{if(e)return t.fs.rmdir(r,()=>{}),n(e);n(null,i,a)});if(i.code!==`EEXIST`)return n(i);if(t.stale<=0)return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));t.fs.stat(r,(r,i)=>{if(r)return r.code===`ENOENT`?f(e,{...t,stale:0},n):n(r);if(!p(i,t))return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));m(e,t,r=>{if(r)return n(r);f(e,{...t,stale:0},n)})})})}function p(e,t){return e.mtime.getTime()<Date.now()-t.stale}function m(e,t,n){t.fs.rmdir(l(e,t),e=>{if(e&&e.code!==`ENOENT`)return n(e);n()})}function h(e,t){let n=c[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(r,i)=>{let a=n.lastUpdate+t.stale<Date.now();if(r)return r.code===`ENOENT`||a?g(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,h(e,t));if(n.mtime.getTime()!==i.mtime.getTime())return g(e,n,Object.assign(Error(`Unable to update lock within the stale threshold`),{code:`ECOMPROMISED`}));let o=s.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,o,o,r=>{let i=n.lastUpdate+t.stale<Date.now();if(!n.released){if(r)return r.code===`ENOENT`||i?g(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,h(e,t));n.mtime=o,n.lastUpdate=Date.now(),n.updateDelay=null,h(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function g(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),c[e]===t&&delete c[e],t.options.onCompromised(n)}function _(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:i,onCompromised:e=>{throw e},...t},t.retries=t.retries||0,t.retries=typeof t.retries==`number`?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),u(e,t,(e,r)=>{if(e)return n(e);let i=a.operation(t.retries);i.attempt(()=>{f(r,t,(e,a,o)=>{if(i.retry(e))return;if(e)return n(i.mainError());let s=c[r]={lockfilePath:l(r,t),mtime:a,mtimePrecision:o,options:t,lastUpdate:Date.now()};h(r,t),n(null,e=>{if(s.released)return e&&e(Object.assign(Error(`Lock is already released`),{code:`ERELEASED`}));v(r,{...t,realpath:!1},e)})})})})}function v(e,t,n){t={fs:i,realpath:!0,...t},u(e,t,(e,r)=>{if(e)return n(e);let i=c[r];if(!i)return n(Object.assign(Error(`Lock is not acquired/owned by you`),{code:`ENOTACQUIRED`}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete c[r],m(r,t,n)})}function ee(e,t,n){t={stale:1e4,realpath:!0,fs:i,...t},t.stale=Math.max(t.stale||0,2e3),u(e,t,(e,r)=>{if(e)return n(e);t.fs.stat(l(r,t),(e,r)=>e?e.code===`ENOENT`?n(null,!1):n(e):n(null,!p(r,t)))})}function te(){return c}o(()=>{for(let e in c){let t=c[e].options;try{t.fs.rmdirSync(l(e,t))}catch{}}}),n.exports.lock=_,n.exports.unlock=v,n.exports.check=ee,n.exports.getLocks=te})),It=n(((e,t)=>{var n=d();function r(e){let t=[`mkdir`,`realpath`,`stat`,`rmdir`,`utimes`],n={...e};return t.forEach(t=>{n[t]=(...n)=>{let r=n.pop(),i;try{i=e[`${t}Sync`](...n)}catch(e){return r(e)}r(null,i)}}),n}function i(e){return(...t)=>new Promise((n,r)=>{t.push((e,t)=>{e?r(e):n(t)}),e(...t)})}function a(e){return(...t)=>{let n,r;if(t.push((e,t)=>{n=e,r=t}),e(...t),n)throw n;return r}}function o(e){if(e={...e},e.fs=r(e.fs||n),typeof e.retries==`number`&&e.retries>0||e.retries&&typeof e.retries.retries==`number`&&e.retries.retries>0)throw Object.assign(Error(`Cannot use retries with the sync api`),{code:`ESYNC`});return e}t.exports={toPromise:i,toSync:a,toSyncOptions:o}})),Lt=n(((e,t)=>{var n=Ft(),{toPromise:r,toSync:i,toSyncOptions:a}=It();async function o(e,t){return r(await r(n.lock)(e,t))}function s(e,t){return i(i(n.lock)(e,a(t)))}function c(e,t){return r(n.unlock)(e,t)}function l(e,t){return i(n.unlock)(e,a(t))}function u(e,t){return r(n.check)(e,t)}function d(e,t){return i(n.check)(e,a(t))}t.exports=o,t.exports.lock=o,t.exports.unlock=c,t.exports.lockSync=s,t.exports.unlockSync=l,t.exports.check=u,t.exports.checkSync=d}));function P(){return F||(F=Lt()),F}function Rt(e,t){return P().lock(e,t)}function zt(e,t){return P().lockSync(e,t)}function Bt(e,t){return P().unlock(e,t)}function Vt(e,t){return P().check(e,t)}var F,Ht=t((()=>{}));function I(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:`dark`,preferredNotifChannel:`auto`,verbose:!1,editorMode:`normal`,autoCompactEnabled:!0,showTurnDuration:!0,hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:`auto`,customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:6e4,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},respectGitignore:!0}}function Ut(){return G||(G=Wt())}function Wt(){if(fe())return!0;let e=B(),t=$();if(e.projects?.[t]?.hasTrustDialogAccepted)return!0;let n=E(_e());for(;;){if(e.projects?.[n]?.hasTrustDialogAccepted)return!0;let t=E(rt(n,`..`));if(t===n)break;n=t}return!1}function L(e){let t=K.config;if(!t)return!1;let n=t.oauthAccount!==void 0&&e.oauthAccount===void 0,r=t.hasCompletedOnboarding===!0&&e.hasCompletedOnboarding!==!0;return n||r}function R(e){let t=null;try{$t(w(),I,n=>{let r=e(n);return r===n?n:(t={...r,projects:Jt(n.projects)},t)})&&t&&z(t)}catch(n){S(`Failed to save config with lock: ${n}`,{level:`error`});let r=V(w(),I);if(L(r)){S(`saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`}),D(`tengu_config_auth_loss_prevented`,{});return}let i=e(r);if(i===r)return;t={...i,projects:Jt(r.projects)},Qt(w(),t,W),z(t)}}function Gt(){return X}function Kt(){let e=J+Y;e>0&&D(`tengu_config_cache_stats`,{cache_hits:J,cache_misses:Y,hit_rate:J/e}),J=0,Y=0}function qt(e){if(e.installMethod!==void 0)return e;let t=e,n=`unknown`,r=e.autoUpdates??!0;switch(t.autoUpdaterStatus){case`migrated`:n=`local`;break;case`installed`:n=`native`;break;case`disabled`:r=!1;break;case`enabled`:case`no_permissions`:case`not_configured`:n=`global`;break;case void 0:break}return{...e,installMethod:n,autoUpdates:r}}function Jt(e){if(!e)return e;let t={},n=!1;for(let[r,i]of Object.entries(e)){let e=i;if(e.history!==void 0){n=!0;let{history:i,...a}=e;t[r]=a}else t[r]=i}return n?t:e}function Yt(){if(Z)return;Z=!0;let e=w();ot(e,{interval:hn,persistent:!1},t=>{t.mtimeMs<=K.mtime||x().readFile(e,{encoding:`utf-8`}).then(e=>{if(t.mtimeMs<=K.mtime)return;let n=Qe(Xe(e));typeof n!=`object`||!n||(K={config:qt({...I(),...n}),mtime:t.mtimeMs},q={mtime:t.mtimeMs,size:t.size})}).catch(()=>{})}),we(async()=>{at(e),Z=!1})}function z(e){K={config:e,mtime:Date.now()},q=null}function B(){if(K.config)return J++,K.config;Y++;try{let e=null;try{e=x().statSync(w())}catch{}let t=qt(V(w(),I));return K={config:t,mtime:e?.mtimeMs??Date.now()},q=e?{mtime:e.mtimeMs,size:e.size}:null,Yt(),t}catch{return qt(V(w(),I))}}function Xt(){let e=B().remoteControlAtStartup;return e!==void 0&&e}function Zt(e){let t=B();return t.customApiKeyResponses?.approved?.includes(e)?`approved`:t.customApiKeyResponses?.rejected?.includes(e)?`rejected`:`new`}function Qt(e,t,n){let r=k(e);x().mkdirSync(r),qe(e,C(N(t,(e,t)=>C(e)!==C(n[t])),null,2),{encoding:`utf-8`,mode:384}),e===w()&&X++}function $t(e,t,n){let r=t(),i=k(e),a=x();a.mkdirSync(i);let o;try{let i=`${e}.lock`,s=Date.now();o=zt(e,{lockfilePath:i,onCompromised:e=>{S(`Config lock compromised: ${e}`,{level:`error`})}});let c=Date.now()-s;if(c>100&&(S(`Lock acquisition took longer than expected - another Claude instance may be running`),D(`tengu_config_lock_contention`,{lock_time_ms:c})),q&&e===w())try{let t=a.statSync(e);(t.mtimeMs!==q.mtime||t.size!==q.size)&&D(`tengu_config_stale_write`,{read_mtime:q.mtime,write_mtime:t.mtimeMs,read_size:q.size,write_size:t.size})}catch(e){if(b(e)!==`ENOENT`)throw e}let l=V(e,t);if(e===w()&&L(l))return S(`saveConfigWithLock: re-read config is missing auth that cache has; refusing to write to avoid wiping ~/.claude.json. See GH #3117.`,{level:`error`}),D(`tengu_config_auth_loss_prevented`,{}),!1;let u=n(l);if(u===l)return!1;let d=N(u,(e,t)=>C(e)!==C(r[t]));try{let t=O(e),n=tn();try{a.mkdirSync(n)}catch(e){if(b(e)!==`EEXIST`)throw e}let r=a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse(),i=r[0],o=i?Number(i.split(`.backup.`).pop()):0,s=Number.isNaN(o)||Date.now()-o>=6e4;if(s){let r=A(n,`${t}.backup.${Date.now()}`);a.copyFileSync(e,r)}let c=s?a.readdirStringSync(n).filter(e=>e.startsWith(`${t}.backup.`)).sort().reverse():r;for(let e of c.slice(5))try{a.unlinkSync(A(n,e))}catch{}}catch(e){b(e)!==`ENOENT`&&S(`Failed to backup config: ${e}`,{level:`error`})}return qe(e,C(d,null,2),{encoding:`utf-8`,mode:384}),e===w()&&X++,!0}finally{o&&o()}}function en(){if(Q)return;let e=Date.now();Le(`info`,`enable_configs_started`),Q=!0,V(w(),I,!0),Le(`info`,`enable_configs_completed`,{duration_ms:Date.now()-e})}function tn(){return A(l(),`backups`)}function nn(e){let t=x(),n=O(e),r=tn();try{let e=t.readdirStringSync(r).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(e)return A(r,e)}catch{}let i=k(e);try{let r=t.readdirStringSync(i).filter(e=>e.startsWith(`${n}.backup.`)).sort().at(-1);if(r)return A(i,r);let a=`${e}.backup`;try{return t.statSync(a),a}catch{}}catch{}return null}function V(e,t,n){if(!Q)throw Error(`Config accessed before allowed.`);let r=x();try{let n=r.readFileSync(e,{encoding:`utf-8`});try{let e=ve(Xe(n));return{...t(),...e}}catch(n){throw new xe(n instanceof Error?n.message:String(n),e,t())}}catch(i){if(b(i)===`ENOENT`){let n=nn(e);return n&&process.stderr.write(`\nClaude configuration file not found at: ${e}\nA backup file exists at: ${n}\nYou can manually restore it by running: cp "${n}" "${e}"\n\n`),t()}if(i instanceof xe&&n)throw i;if(i instanceof xe){if(S(`Config file corrupted, resetting to defaults: ${i.message}`,{level:`error`}),!H){H=!0;try{Ue(i);let t=!1;try{r.statSync(`${e}.backup`),t=!0}catch{}D(`tengu_config_parse_error`,{has_backup:t})}finally{H=!1}}process.stderr.write(`\nClaude configuration file at ${e} is corrupted: ${i.message}\n`);let t=O(e),n=tn();try{r.mkdirSync(n)}catch(e){if(b(e)!==`EEXIST`)throw e}let a=r.readdirStringSync(n).filter(e=>e.startsWith(`${t}.corrupted.`)),o,s=!1,c=r.readFileSync(e,{encoding:`utf-8`});for(let e of a)try{if(c===r.readFileSync(A(n,e),{encoding:`utf-8`})){s=!0;break}}catch{}if(!s){o=A(n,`${t}.corrupted.${Date.now()}`);try{r.copyFileSync(e,o),S(`Corrupted config backed up to: ${o}`,{level:`error`})}catch{}}let l=nn(e);o?process.stderr.write(`The corrupted file has been backed up to: ${o}\n`):s&&process.stderr.write(`The corrupted file has already been backed up.
|
|
2
|
+
`),l?process.stderr.write(`A backup file exists at: ${l}\nYou can manually restore it by running: cp "${l}" "${e}"\n\n`):process.stderr.write(`
|
|
3
|
+
`)}return t()}}function rn(){let e=$(),t=B();if(!t.projects)return U;let n=t.projects[e]??U;return typeof n.allowedTools==`string`&&(n.allowedTools=Qe(n.allowedTools)??[]),n}function an(e){let t=$(),n=null;try{$t(w(),I,r=>{let i=r.projects?.[t]??U,a=e(i);return a===i?r:(n={...r,projects:{...r.projects,[t]:a}},n)})&&n&&z(n)}catch(r){S(`Failed to save config with lock: ${r}`,{level:`error`});let i=V(w(),I);if(L(i)){S(`saveCurrentProjectConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.`,{level:`error`}),D(`tengu_config_auth_loss_prevented`,{});return}let a=i.projects?.[t]??U,o=e(a);if(o===a)return;n={...i,projects:{...i.projects,[t]:o}},Qt(w(),n,W),z(n)}}function on(){return ln()!==null}function sn(){return on()&&!c(process.env.FORCE_AUTOUPDATE_PLUGINS)}function cn(e){switch(e.type){case`development`:return`development build`;case`env`:return`${e.envVar} set`;case`config`:return`config`}}function ln(){if(!c(process.env.ENABLE_AUTOUPDATER))return{type:`config`};if(c(process.env.DISABLE_AUTOUPDATER))return{type:`env`,envVar:`DISABLE_AUTOUPDATER`};let e=We();if(e)return{type:`env`,envVar:e};let t=B();return t.autoUpdates===!1&&(t.installMethod!==`native`||t.autoUpdatesProtectedForNative!==!0)?{type:`config`}:null}function un(){let e=B();if(e.userID)return e.userID;let t=st(32).toString(`hex`);return R(e=>({...e,userID:t})),t}function dn(){if(!B().firstStartTime){let e=new Date().toISOString();R(t=>({...t,firstStartTime:t.firstStartTime??e}))}}function fn(e){let t=le();switch(e){case`User`:return A(l(),`CLAUDE.md`);case`Local`:return A(t,`CLAUDE.local.md`);case`Project`:return A(t,`CLAUDE.md`);case`Managed`:return A(Oe(),`CLAUDE.md`);case`AutoMem`:return yt();default:return A(l(),`CLAUDE.md`)}}function pn(){return A(Oe(),`.claude`,`rules`)}function mn(){return A(l(),`rules`)}var H,U,W,G,K,q,J,Y,X,hn,Z,Q,$,gn=t((()=>{o(),Ot(),se(),Ct(),$e(),ge(),Se(),be(),ze(),Me(),u(),Te(),Je(),Ce(),Re(),Ze(),Ye(),Ht(),He(),Ke(),Ve(),Ne(),ye(),H=!1,U={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},W=I(),G=!1,{...W},{...U},K={config:null,mtime:0},q=null,J=0,Y=0,X=0,we(async()=>{Kt()}),hn=1e3,Z=!1,Q=!1,$=a(()=>{let e=le();return E(Be(e)||rt(e))})}));export{yt as A,j as B,Ht as C,N as D,Ot as E,bt as F,dt as I,ft as L,pt as M,_t as N,wt as O,Ct as P,lt as R,Vt as S,Bt as T,ct as V,on as _,ln as a,R as b,B as c,fn as d,un as f,gn as g,mn as h,cn as i,M as j,Tt as k,Gt as l,Xt as m,Ut as n,rn as o,$ as p,en as r,Zt as s,W as t,pn as u,dn as v,Rt as w,sn as x,an as y,ut as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./loadAgentsDir-DrDu5yYy.js";import{b as e,c as t,g as n,n as r,o as i,r as a,y as o}from"./config-DiT2Z8dY.js";n();export{r as checkHasTrustDialogAccepted,a as enableConfigs,i as getCurrentProjectConfig,t as getGlobalConfig,o as saveCurrentProjectConfig,e as saveGlobalConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-BvhG1XoW.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{I as r,P as i,fi as a,s as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ao as l,al as u,oE as d,rl as f,sE as p,zo as m}from"./loadAgentsDir-ZQwvbURI.js";import{dn as h,un as g}from"./settings-BhvhCpVh.js";import{f as _,l as v}from"./file-BZriE-XU.js";import{b as y,y as b}from"./startupProfiler-BquH_Yqm.js";import{Zt as x,_n as S,gn as C,mn as w,rn as T,vn as ee}from"./prompt-wys9CwDo.js";import{n as E,t as D}from"./staticRender-BIxpgNUq.js";function O(e){let t=[];return k(e,t),A(e,t),M(e,t),N(e,t),P(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function k(e,t){e.percentage>=R&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function A(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<F||r<I)continue;let a=j(n.name,r,i);a&&t.push(a)}}function j(e,t,n){let r=b(t);switch(e){case S:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case x:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case w:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function M(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===x);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=F&&r>=I||a>=L&&n.resultTokens>=I&&t.push({severity:`info`,title:`File reads using ${b(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function N(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=z&&n>=B){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${v(e.path)} (${b(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${b(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function P(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<R&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var F,I,L,R,z,B,V=e((()=>{ee(),T(),C(),_(),y(),F=15,I=1e4,L=5,R=80,z=5,B=5e3}));function H({suggestions:e}){return e.length===0?null:(0,U.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(i,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,U.jsxs)(r,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,U.jsxs)(r,{children:[(0,U.jsx)(o,{status:e.severity,withSpace:!0}),(0,U.jsx)(i,{bold:!0,children:e.title}),e.savingsTokens?(0,U.jsxs)(i,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,b(e.savingsTokens)]}):null]}),(0,U.jsx)(r,{marginLeft:2,children:(0,U.jsx)(i,{dimColor:!0,children:e.detail})})]},t))]})}var U,W=e((()=>{t(),a(),s(),y(),U=c()}));function G(){return null}function K(e){let t=new Map;for(let n of e){let e=g(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of X){let r=t.get(e);r&&n.set(e,r)}return n}function q({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:a,percentage:o,gridRows:s,model:c,memoryFiles:l,mcpTools:u,deferredBuiltinTools:d=[],systemTools:f,systemPromptSections:p,agents:m,skills:h,messageBreakdown:g,cacheHitRate:_,cacheThreshold:y}=e,x=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==Y&&!e.isDeferred),S=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),C=d.length>0,w=t.find(e=>e.name===Y);return(0,J.jsxs)(r,{flexDirection:`column`,paddingLeft:1,children:[(0,J.jsx)(i,{bold:!0,children:`Context Usage`}),(0,J.jsxs)(r,{flexDirection:`row`,gap:2,children:[(0,J.jsx)(r,{flexDirection:`column`,flexShrink:0,children:s.map((e,t)=>(0,J.jsx)(r,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,J.jsx)(i,{dimColor:!0,children:`⛶ `},t):e.categoryName===Y?(0,J.jsx)(i,{color:e.color,children:`⛝ `},t):(0,J.jsx)(i,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,J.jsxs)(r,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,J.jsxs)(i,{dimColor:!0,children:[c,` · `,b(n),`/`,b(a),` tokens (`,o,`%)`]}),(0,J.jsx)(G,{}),_!==void 0&&y!==void 0&&(0,J.jsxs)(i,{color:_<y?`warning`:void 0,children:[`Cache hit rate: `,_.toFixed(0),`%`,_<y?` (below ${y}% threshold)`:``]}),(0,J.jsx)(i,{children:` `}),(0,J.jsx)(i,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),x.map((e,t)=>{let n=b(e.tokens),o=e.isDeferred?`N/A`:`${(e.tokens/a*100).toFixed(1)}%`,s=e.name===Y,c=e.name,l=e.isDeferred?` `:s?`⛝`:`⛁`;return(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{color:e.color,children:l}),(0,J.jsxs)(i,{children:[` `,c,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[n,` tokens (`,o,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{dimColor:!0,children:`⛶`}),(0,J.jsx)(i,{children:` Free space: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/a*100).toFixed(1),`%)`]})]}),w&&w.tokens>0&&(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{color:w.color,children:`⛝`}),(0,J.jsxs)(i,{dimColor:!0,children:[` `,w.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(w.tokens),` tokens (`,(w.tokens/a*100).toFixed(1),`%)`]})]})]})]}),(0,J.jsxs)(r,{flexDirection:`column`,marginLeft:-1,children:[u.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`MCP tools`}),(0,J.jsxs)(i,{dimColor:!0,children:[` · /mcp`,S?` (loaded on-demand)`:``]})]}),u.some(e=>e.isLoaded)&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Loaded`}),u.filter(e=>e.isLoaded).map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),S&&u.some(e=>!e.isLoaded)&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Available`}),u.filter(e=>!e.isLoaded).map((e,t)=>(0,J.jsx)(r,{children:(0,J.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!S&&u.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),(f&&f.length>0||C)&&process.env.USER_TYPE===`ant`&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] System tools`}),C&&(0,J.jsx)(i,{dimColor:!0,children:` (some loaded on-demand)`})]}),(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Loaded`}),f?.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},`sys-${t}`)),d.filter(e=>e.isLoaded).map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},`def-${t}`))]}),C&&d.some(e=>!e.isLoaded)&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Available`}),d.filter(e=>!e.isLoaded).map((e,t)=>(0,J.jsx)(r,{children:(0,J.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]})]}),p&&p.length>0&&process.env.USER_TYPE===`ant`&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] System prompt sections`}),p.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),m.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`Custom agents`}),(0,J.jsx)(i,{dimColor:!0,children:` · /agents`})]}),Array.from(K(m).entries()).map(([e,t])=>(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.agentType,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]},e))]}),l.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`Memory files`}),(0,J.jsx)(i,{dimColor:!0,children:` · /memory`})]}),l.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,v(e.path),`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),h&&h.tokens>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`Skills`}),(0,J.jsx)(i,{dimColor:!0,children:` · /skills`})]}),Array.from(K(h.skillFrontmatter).entries()).map(([e,t])=>(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]},e))]}),g&&process.env.USER_TYPE===`ant`&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] Message breakdown`}),(0,J.jsxs)(r,{flexDirection:`column`,marginLeft:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Tool calls: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.toolCallTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Tool results: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.toolResultTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Attachments: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.attachmentTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Assistant messages (non-tool): `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.assistantMessageTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`User messages (non-tool-result): `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.userMessageTokens),` tokens`]})]})]}),g.toolCallsByType.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top tools`}),g.toolCallsByType.slice(0,5).map((e,t)=>(0,J.jsxs)(r,{marginLeft:1,children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[`calls `,b(e.callTokens),`, results `,b(e.resultTokens)]})]},t))]}),g.attachmentsByType.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top attachments`}),g.attachmentsByType.slice(0,5).map((e,t)=>(0,J.jsxs)(r,{marginLeft:1,children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]})]})]}),(0,J.jsx)(H,{suggestions:O(e)})]})}var J,Y,X,Z=e((()=>{a(),s(),V(),_(),y(),h(),W(),J=c(),Y=`Autocompact buffer`,X=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function Q(e){return l(e)}async function te(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=Q(n),{messages:s}=await p(o),c=process.stdout.columns||80,l=r();return e(await E((0,$.jsx)(q,{data:await f(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{a(),Z(),d(),u(),m(),D(),$=c()}))();export{te as call};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{I as r,P as i,fi as a,s as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ao as l,GE as u,WE as d,al as f,rl as p,zo as m}from"./loadAgentsDir-DrDu5yYy.js";import{dn as h,un as g}from"./settings-DfWP5y6X.js";import{f as _,l as v}from"./file-DcZWPH2V.js";import{b as y,y as b}from"./startupProfiler-xa3NmN7Z.js";import{$t as x,an as S,bn as C,gn as w,vn as T,yn as ee}from"./prompt-C0nU0VK3.js";import{n as E,t as D}from"./staticRender-BIxpgNUq.js";function O(e){let t=[];return k(e,t),A(e,t),M(e,t),N(e,t),P(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function k(e,t){e.percentage>=R&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function A(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<F||r<I)continue;let a=j(n.name,r,i);a&&t.push(a)}}function j(e,t,n){let r=b(t);switch(e){case ee:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case x:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case w:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function M(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===x);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=F&&r>=I||a>=L&&n.resultTokens>=I&&t.push({severity:`info`,title:`File reads using ${b(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function N(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=z&&n>=B){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${v(e.path)} (${b(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${b(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function P(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<R&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var F,I,L,R,z,B,V=e((()=>{C(),S(),T(),_(),y(),F=15,I=1e4,L=5,R=80,z=5,B=5e3}));function H({suggestions:e}){return e.length===0?null:(0,U.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(i,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,U.jsxs)(r,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,U.jsxs)(r,{children:[(0,U.jsx)(o,{status:e.severity,withSpace:!0}),(0,U.jsx)(i,{bold:!0,children:e.title}),e.savingsTokens?(0,U.jsxs)(i,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,b(e.savingsTokens)]}):null]}),(0,U.jsx)(r,{marginLeft:2,children:(0,U.jsx)(i,{dimColor:!0,children:e.detail})})]},t))]})}var U,W=e((()=>{t(),a(),s(),y(),U=c()}));function G(){return null}function K(e){let t=new Map;for(let n of e){let e=g(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of X){let r=t.get(e);r&&n.set(e,r)}return n}function q({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:a,percentage:o,gridRows:s,model:c,memoryFiles:l,mcpTools:u,deferredBuiltinTools:d=[],systemTools:f,systemPromptSections:p,agents:m,skills:h,messageBreakdown:g,cacheHitRate:_,cacheThreshold:y}=e,x=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==Y&&!e.isDeferred),S=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),C=d.length>0,w=t.find(e=>e.name===Y);return(0,J.jsxs)(r,{flexDirection:`column`,paddingLeft:1,children:[(0,J.jsx)(i,{bold:!0,children:`Context Usage`}),(0,J.jsxs)(r,{flexDirection:`row`,gap:2,children:[(0,J.jsx)(r,{flexDirection:`column`,flexShrink:0,children:s.map((e,t)=>(0,J.jsx)(r,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,J.jsx)(i,{dimColor:!0,children:`⛶ `},t):e.categoryName===Y?(0,J.jsx)(i,{color:e.color,children:`⛝ `},t):(0,J.jsx)(i,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,J.jsxs)(r,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,J.jsxs)(i,{dimColor:!0,children:[c,` · `,b(n),`/`,b(a),` tokens (`,o,`%)`]}),(0,J.jsx)(G,{}),_!==void 0&&y!==void 0&&(0,J.jsxs)(i,{color:_<y?`warning`:void 0,children:[`Cache hit rate: `,_.toFixed(0),`%`,_<y?` (below ${y}% threshold)`:``]}),(0,J.jsx)(i,{children:` `}),(0,J.jsx)(i,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),x.map((e,t)=>{let n=b(e.tokens),o=e.isDeferred?`N/A`:`${(e.tokens/a*100).toFixed(1)}%`,s=e.name===Y,c=e.name,l=e.isDeferred?` `:s?`⛝`:`⛁`;return(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{color:e.color,children:l}),(0,J.jsxs)(i,{children:[` `,c,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[n,` tokens (`,o,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{dimColor:!0,children:`⛶`}),(0,J.jsx)(i,{children:` Free space: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/a*100).toFixed(1),`%)`]})]}),w&&w.tokens>0&&(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{color:w.color,children:`⛝`}),(0,J.jsxs)(i,{dimColor:!0,children:[` `,w.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(w.tokens),` tokens (`,(w.tokens/a*100).toFixed(1),`%)`]})]})]})]}),(0,J.jsxs)(r,{flexDirection:`column`,marginLeft:-1,children:[u.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`MCP tools`}),(0,J.jsxs)(i,{dimColor:!0,children:[` · /mcp`,S?` (loaded on-demand)`:``]})]}),u.some(e=>e.isLoaded)&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Loaded`}),u.filter(e=>e.isLoaded).map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),S&&u.some(e=>!e.isLoaded)&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Available`}),u.filter(e=>!e.isLoaded).map((e,t)=>(0,J.jsx)(r,{children:(0,J.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!S&&u.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),(f&&f.length>0||C)&&process.env.USER_TYPE===`ant`&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] System tools`}),C&&(0,J.jsx)(i,{dimColor:!0,children:` (some loaded on-demand)`})]}),(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Loaded`}),f?.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},`sys-${t}`)),d.filter(e=>e.isLoaded).map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},`def-${t}`))]}),C&&d.some(e=>!e.isLoaded)&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:`Available`}),d.filter(e=>!e.isLoaded).map((e,t)=>(0,J.jsx)(r,{children:(0,J.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]})]}),p&&p.length>0&&process.env.USER_TYPE===`ant`&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] System prompt sections`}),p.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),m.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`Custom agents`}),(0,J.jsx)(i,{dimColor:!0,children:` · /agents`})]}),Array.from(K(m).entries()).map(([e,t])=>(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.agentType,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]},e))]}),l.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`Memory files`}),(0,J.jsx)(i,{dimColor:!0,children:` · /memory`})]}),l.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,v(e.path),`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]}),h&&h.tokens>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{bold:!0,children:`Skills`}),(0,J.jsx)(i,{dimColor:!0,children:` · /skills`})]}),Array.from(K(h.skillFrontmatter).entries()).map(([e,t])=>(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,J.jsxs)(r,{children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]},e))]}),g&&process.env.USER_TYPE===`ant`&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] Message breakdown`}),(0,J.jsxs)(r,{flexDirection:`column`,marginLeft:1,children:[(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Tool calls: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.toolCallTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Tool results: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.toolResultTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Attachments: `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.attachmentTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`Assistant messages (non-tool): `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.assistantMessageTokens),` tokens`]})]}),(0,J.jsxs)(r,{children:[(0,J.jsx)(i,{children:`User messages (non-tool-result): `}),(0,J.jsxs)(i,{dimColor:!0,children:[b(g.userMessageTokens),` tokens`]})]})]}),g.toolCallsByType.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top tools`}),g.toolCallsByType.slice(0,5).map((e,t)=>(0,J.jsxs)(r,{marginLeft:1,children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[`calls `,b(e.callTokens),`, results `,b(e.resultTokens)]})]},t))]}),g.attachmentsByType.length>0&&(0,J.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,J.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top attachments`}),g.attachmentsByType.slice(0,5).map((e,t)=>(0,J.jsxs)(r,{marginLeft:1,children:[(0,J.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,J.jsxs)(i,{dimColor:!0,children:[b(e.tokens),` tokens`]})]},t))]})]})]}),(0,J.jsx)(H,{suggestions:O(e)})]})}var J,Y,X,Z=e((()=>{a(),s(),V(),_(),y(),h(),W(),J=c(),Y=`Autocompact buffer`,X=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function Q(e){return l(e)}async function te(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=Q(n),{messages:s}=await u(o),c=process.stdout.columns||80,l=r();return e(await E((0,$.jsx)(q,{data:await p(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{a(),Z(),d(),f(),m(),D(),$=c()}))();export{te as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./context-noninteractive-Cb3EM2Oz.js";t();export{n as call,e as collectContextData};
|
package/dist/chunks/{context-noninteractive-CTvyNimw.js → context-noninteractive-Cb3EM2Oz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ao as t,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ao as t,GE as n,WE as r,al as i,rl as a,zo as o}from"./loadAgentsDir-DrDu5yYy.js";import{dn as s,un as c}from"./settings-DfWP5y6X.js";import{b as l,y as u}from"./startupProfiler-xa3NmN7Z.js";async function d(e){let{messages:r,getAppState:i,options:{mainLoopModel:o,tools:s,agentDefinitions:c,customSystemPrompt:l,appendSystemPrompt:u}}=e,d=t(r),{messages:f}=await n(d),p=i();return a(f,o,async()=>p.toolPermissionContext,s,c,void 0,{options:{customSystemPrompt:l,appendSystemPrompt:u}},void 0,d)}async function f(e,t){return{type:`text`,value:p(await d(t))}}function p(e){let{categories:t,totalTokens:n,rawMaxTokens:r,percentage:i,model:a,memoryFiles:o,mcpTools:s,agents:l,skills:d,messageBreakdown:f,systemTools:p,systemPromptSections:m}=e,h=`## Context Usage
|
|
2
2
|
|
|
3
3
|
`;h+=`**Model:** ${a} \n`,h+=`**Tokens:** ${u(n)} / ${u(r)} (${i}%)\n`,h+=`
|
|
4
4
|
`;let g=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==`Autocompact buffer`);if(g.length>0){h+=`### Estimated usage by category
|
|
@@ -51,4 +51,4 @@ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ao as t,al as n,oE as
|
|
|
51
51
|
`,h+=`| Attachment | Tokens |
|
|
52
52
|
`,h+=`|------------|--------|
|
|
53
53
|
`;for(let e of f.attachmentsByType)h+=`| ${e.name} | ${u(e.tokens)} |\n`;h+=`
|
|
54
|
-
`}}return h}var m=e((()=>{r(),
|
|
54
|
+
`}}return h}var m=e((()=>{r(),i(),l(),o(),s()}));export{d as n,m as r,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./conversation-CvCQta8e.js";e();export{t as clearConversation};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Fn as n,In as r,Rn as i,cn as a,en as o,ht as s,nt as ee,q as c,un as l}from"./state-ix0xIunV.js";import{Au as u,Bl as d,Ci as f,Ct as p,Ei as m,Et as h,Gp as g,Il as _,Mn as v,UC as y,VC as b,Wp as x,Xy as S,Zt as te,Zy as C,dn as w,dr as T,eg as E,fi as D,gb as O,jn as k,jr as A,ju as j,kn as M,lb as N,nr as P,tg as F,yn as I}from"./loadAgentsDir-DrDu5yYy.js";import{o as L,s as ne}from"./log-BMCygSzM.js";import{n as R,r as z}from"./analytics-BotDBGh0.js";import{C as B,y as V}from"./rcDebugLog-2-1XSyFV.js";import{l as H,r as U}from"./commitAttribution-Bmzgtqc6.js";import{c as W,d as G}from"./debugUtils-NO5KtXqi.js";import{n as K,t as q}from"./caches-CmW7idg5.js";import{randomUUID as J}from"crypto";function Y(e){Q=e,d(Z()??null).catch(()=>{})}function X(){return Q}function Z(){let e=X();return e?G(e.bridgeSessionId):void 0}var Q,$=t((()=>{_(),W(),Q=null}));function re(){let e=X();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:J()};e.writeSdkMessages([t])}async function ie({setMessages:t,readFileState:o,discoveredSkillNames:u,loadedNestedMemoryPaths:d,getAppState:h,setAppState:_,setConversationId:v}){let y=w();await te(`clear`,{getAppState:h,setAppState:_,signal:AbortSignal.timeout(y),timeoutMs:y});let x=c();x&&z(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:x});let S=new Set,E=[],O=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(h)for(let e of Object.values(h().tasks))O(e)||j(e)&&(S.add(e.agentId),E.push(e));t(()=>[]),re();{let{setContextBlocked:t}=(V(),e(B));t(!1)}v&&v(J()),q(S),n(null),r(null),i(null),l(),g(ee()),o.clear(),u?.clear(),d?.clear(),_&&_(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!O(r)){t[n]=r;continue}try{r.status===`running`&&(F(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){ne(e)}M(n)}return{...e,tasks:t,attribution:U(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),N(),P(),a({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=s()),await D();for(let e of E)e.status===`running`&&k(e.id,T(b(e.agentId)));let{saveMode:I}=(A(),e(m));I(`normal`);let L=p();L&&f(L);let R=await C(`clear`);R.length>0&&t(()=>R)}var ae=t((()=>{$(),o(),R(),u(),E(),y(),H(),I(),L(),O(),x(),S(),A(),v(),h(),K()}));export{Y as i,ae as n,$ as r,ie as t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{
|
|
2
|
-
`);r=a.pop()??``;for(let e of a){let t=e.trim();t&&this.processLine(t)}}}catch(e){this.disconnected||this.options.onError(e instanceof Error?e:Error(String(e)))}finally{t.releaseLock(),!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}}monitorExit(){if(this.proc.exitCode!==null){this.userInitiatedDisconnect||this.handleProcessExit();return}this.proc.exited.then(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}).catch(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()})}async handleProcessExit(){if(!(this.disconnected||this.reconnecting)){if(this.connected=!1,!this.options.reconnect){this.disconnected=!0,this.options.onDisconnected();return}if(this.reconnectAttempt>=this.maxReconnectAttempts){this.disconnected=!0,this.options.onDisconnected();return}this.reconnecting=!0;try{await this.attemptReconnect()}finally{this.reconnecting=!1}}}async attemptReconnect(){let e=this.options.reconnect;for(;this.reconnectAttempt<this.maxReconnectAttempts;){this.reconnectAttempt++,this.options.onReconnecting(this.reconnectAttempt,this.maxReconnectAttempts);let t=Math.min(v*2**(this.reconnectAttempt-1),y);if(await new Promise(e=>setTimeout(e,t)),this.userInitiatedDisconnect)return;try{let t=await e();this.proc=t,this.reconnectAttempt=0,this.connected=!0,this.startReadLoop(),this.monitorExit(),this.options.onConnected();return}catch(e){
|
|
3
|
-
`);return t.write(n),t.flush?.(),!0}catch{return!1}}async sendMessage(e){let t=
|
|
4
|
-
`).map(e=>e.trim()).filter(Boolean);
|
|
5
|
-
`));if(m.exitCode!==0)throw Error(`Failed to install wrapper script: ${m.stderr}`);
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{C as n,S as r,a as i,l as a,w as o}from"./debug-BrXObCdR.js";import{l as s,u as c}from"./oauth-BqJqV-2M.js";import{Vt as l,kt as u}from"./model-fi472PRc.js";import{i as d,t as f}from"./cliLaunch-BkPAatcs.js";import{resolve as p}from"path";import{existsSync as m,unlinkSync as h}from"fs";import{randomUUID as g}from"crypto";i(),r(),e();function _(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}var v=2e3,y=15e3,b=3,x=class{constructor(e,n){t(this,`proc`,void 0),t(this,`options`,void 0),t(this,`connected`,!1),t(this,`disconnected`,!1),t(this,`readLoopAbort`,null),t(this,`reconnectAttempt`,0),t(this,`maxReconnectAttempts`,void 0),t(this,`userInitiatedDisconnect`,!1),t(this,`reconnecting`,!1),this.proc=e,this.options=n,this.maxReconnectAttempts=n.maxReconnectAttempts??b}connect(){this.connected||(this.readLoopAbort=new AbortController,this.startReadLoop(),this.monitorExit(),this.connected=!0,this.options.onConnected())}async startReadLoop(){let e=this.proc.stdout;if(!e){this.options.onError(Error(`SSH process stdout is not available`));return}let t=e.getReader(),n=new TextDecoder,r=``;try{for(;!this.disconnected;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.split(`
|
|
2
|
+
`);r=a.pop()??``;for(let e of a){let t=e.trim();t&&this.processLine(t)}}}catch(e){this.disconnected||this.options.onError(e instanceof Error?e:Error(String(e)))}finally{t.releaseLock(),!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}}monitorExit(){if(this.proc.exitCode!==null){this.userInitiatedDisconnect||this.handleProcessExit();return}this.proc.exited.then(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}).catch(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()})}async handleProcessExit(){if(!(this.disconnected||this.reconnecting)){if(this.connected=!1,!this.options.reconnect){this.disconnected=!0,this.options.onDisconnected();return}if(this.reconnectAttempt>=this.maxReconnectAttempts){this.disconnected=!0,this.options.onDisconnected();return}this.reconnecting=!0;try{await this.attemptReconnect()}finally{this.reconnecting=!1}}}async attemptReconnect(){let e=this.options.reconnect;for(;this.reconnectAttempt<this.maxReconnectAttempts;){this.reconnectAttempt++,this.options.onReconnecting(this.reconnectAttempt,this.maxReconnectAttempts);let t=Math.min(v*2**(this.reconnectAttempt-1),y);if(await new Promise(e=>setTimeout(e,t)),this.userInitiatedDisconnect)return;try{let t=await e();this.proc=t,this.reconnectAttempt=0,this.connected=!0,this.startReadLoop(),this.monitorExit(),this.options.onConnected();return}catch(e){a(`[SSH] reconnect attempt ${this.reconnectAttempt} failed: ${e instanceof Error?e.message:String(e)}`)}}this.disconnected=!0,this.options.onDisconnected()}processLine(e){let t;try{t=n(e)}catch{return}if(!_(t))return;let r=t;if(r.type===`control_request`){let e=r;e.request.subtype===`can_use_tool`?this.options.onPermissionRequest(e.request,e.request_id):(a(`[SSH] Unsupported control request subtype: ${e.request.subtype}`),this.sendErrorResponse(e.request_id,`Unsupported control request subtype: ${e.request.subtype}`));return}r.type!==`control_response`&&r.type!==`keep_alive`&&r.type!==`control_cancel_request`&&r.type!==`streamlined_text`&&r.type!==`streamlined_tool_use_summary`&&!(r.type===`system`&&r.subtype===`post_turn_summary`)&&this.options.onMessage(r)}writeToStdin(e){try{let t=this.proc.stdin;if(!t||typeof t==`number`||this.disconnected)return!1;let n=new TextEncoder().encode(e+`
|
|
3
|
+
`);return t.write(n),t.flush?.(),!0}catch{return!1}}async sendMessage(e){let t=o({type:`user`,message:{role:`user`,content:e},parent_tool_use_id:null,session_id:``});return this.writeToStdin(t)}sendInterrupt(){let e=o({type:`control_request`,request_id:crypto.randomUUID(),request:{subtype:`interrupt`}});this.writeToStdin(e)}respondToPermissionRequest(e,t){let n=o({type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}});this.writeToStdin(n)}sendErrorResponse(e,t){let n=o({type:`control_response`,response:{subtype:`error`,request_id:e,error:t}});this.writeToStdin(n)}disconnect(){if(!this.disconnected){this.userInitiatedDisconnect=!0,this.disconnected=!0,this.connected=!1,this.readLoopAbort?.abort();try{let e=this.proc.stdin;e&&typeof e!=`number`&&e.end?.()}catch{}try{this.proc.kill()}catch{}}}isConnected(){return this.connected&&!this.disconnected}};l(),c(),i();var S=process.platform===`win32`;function C(){let e=process.env.ANTHROPIC_API_KEY;if(e)return{"x-api-key":e};let t=u();return t?.accessToken?{Authorization:`Bearer ${t.accessToken}`}:{}}function w(){return process.env.ANTHROPIC_BASE_URL||s().BASE_API_URL}async function T(e,t){if(t&&e.headers.get(`x-auth-nonce`)!==t)return new Response(`Forbidden`,{status:403});let n=w(),r=new URL(e.url),i=`${n}${r.pathname}${r.search}`,o=C();if(Object.keys(o).length===0)return new Response(JSON.stringify({error:`No API credentials available on local machine`}),{status:401,headers:{"content-type":`application/json`}});let s=new Headers(e.headers);for(let[e,t]of Object.entries(o))s.set(e,t);s.delete(`host`),s.delete(`x-auth-nonce`),a(`[SSHAuthProxy] ${e.method} ${r.pathname} -> ${i}`);try{let t=await fetch(i,{method:e.method,headers:s,body:e.body,duplex:`half`}),n=new Headers(t.headers);return n.delete(`content-encoding`),n.delete(`content-length`),new Response(t.body,{status:t.status,statusText:t.statusText,headers:n})}catch(e){let t=e instanceof Error?e.message:String(e);return a(`[SSHAuthProxy] upstream error: ${t}`),new Response(JSON.stringify({error:`Proxy upstream error: ${t}`}),{status:502,headers:{"content-type":`application/json`}})}}async function E(){let e=g();return S?O(e):D(e)}async function D(e){let t=`/tmp/claude-ssh-auth-${e}.sock`,n=Bun.serve({unix:t,fetch:e=>T(e,null)});return a(`[SSHAuthProxy] listening on unix:${t}`),{proxy:{stop(){n.stop(!0);try{h(t)}catch{}}},localAddress:t,authEnv:{ANTHROPIC_AUTH_SOCKET:t}}}async function O(e){let t=g(),n=Bun.serve({port:0,hostname:`127.0.0.1`,fetch:e=>T(e,t)}),r=n.port;return a(`[SSHAuthProxy] listening on TCP 127.0.0.1:${r} (nonce-protected)`),{proxy:{stop(){n.stop(!0)}},localAddress:`127.0.0.1:${r}`,authEnv:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${r}`,ANTHROPIC_AUTH_NONCE:t}}}i();var k=15e3,A=class extends Error{constructor(e){super(e),this.name=`SSHProbeError`}};async function j(e,t){t?.(`Probing remote host…`);let n=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=10`,e,`CLAUDE_BIN=$(test -x "$HOME/.local/bin/claude" && echo "$HOME/.local/bin/claude" || command -v claude 2>/dev/null); echo "$CLAUDE_BIN"; $CLAUDE_BIN --version 2>/dev/null; uname -sm; pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`pipe`}),r=await Promise.race([n.exited,new Promise((e,t)=>setTimeout(()=>t(new A(`SSH probe timed out after ${k/1e3}s`)),k))]),i=await new Response(n.stdout).text(),o=await new Response(n.stderr).text();if(r!==0)throw new A(`SSH probe failed: ${o.trim()||`exit code ${r}`}`);let s=i.split(`
|
|
4
|
+
`).map(e=>e.trim()).filter(Boolean);a(`[SSHProbe] raw lines: ${JSON.stringify(s)}`);let c=s.findIndex(e=>/^(Linux|Darwin)\s/.test(e));if(c===-1)throw new A(`Could not detect remote platform (uname output missing)`);let l=c>=2&&s[c-2]||null,u=c>=1&&s[c-1]||null,d=u&&/^\d+\.\d+/.test(u)?u:null,f=l!==null&&l.startsWith(`/`),p=s[c+1]||`/`,[m,h]=s[c].split(/\s+/),g=m===`Darwin`?`darwin`:`linux`,_=h===`aarch64`||h===`arm64`?`arm64`:`x64`;return t?.(`Detected ${g}/${_}`),{hasBinary:f&&d!==null,remoteVersion:d,remotePlatform:g,remoteArch:_,defaultCwd:p,binaryPath:f?l:null}}i();var M=6e4,N=`~/.local/bin`,P=`claude-code-cli.js`,F=`claude`;async function I(e,t,n=M){let r=Bun.spawn([`ssh`,`-o`,`ConnectTimeout=10`,e,t],{stdout:`pipe`,stderr:`pipe`}),i=setTimeout(()=>r.kill(),n);try{let[e,t]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]),n=await r.exited;return{stdout:e.trim(),stderr:t.trim(),exitCode:n}}finally{clearTimeout(i)}}function L(){let e=p(import.meta.dir,`../..`),t=p(e,`dist/cli.js`);if(m(t))return t;let n=p(e,`src/entrypoints/cli.tsx`);if(m(n))return n;throw Error("Cannot find local CLI binary to deploy. Run `bun run build` first.")}async function R(e){let{host:t,remotePlatform:n,remoteArch:r,localVersion:i,onProgress:o}=e;if(n!==`linux`&&n!==`darwin`)throw Error(`Remote platform "${n}" is not supported. Only linux and darwin are supported.`);a(`[SSHDeploy] deploying to ${t} (${n}/${r}, v${i})`);let s=L();a(`[SSHDeploy] local binary: ${s}`),o?.(`Creating remote directory...`);let c=await I(t,`mkdir -p ${N}`);if(c.exitCode!==0)throw Error(`Failed to create remote directory: ${c.stderr}`);o?.(`Uploading binary...`);let l=`${N}/${P}`,u=Bun.spawn([`scp`,`-o`,`ConnectTimeout=10`,s,`${t}:${l}`],{stdout:`pipe`,stderr:`pipe`}),d=setTimeout(()=>u.kill(),M),f=await new Response(u.stderr).text(),p=await u.exited;if(clearTimeout(d),p!==0)throw Error(`SCP upload failed (exit ${p}): ${f.trim()}`);o?.(`Installing wrapper script...`);let m=await I(t,[`cat > ${N}/${F} << 'WRAPPER'`,`#!/bin/sh`,`exec bun ${N}/${P} "$@"`,`WRAPPER`,`chmod +x ${N}/${F}`].join(`
|
|
5
|
+
`));if(m.exitCode!==0)throw Error(`Failed to install wrapper script: ${m.stderr}`);o?.(`Verifying installation...`);let h=await I(t,`${N}/${F} --version`);if(h.exitCode!==0)throw Error(`Binary deployed but verification failed (exit ${h.exitCode}): ${h.stderr}`);return a(`[SSHDeploy] deployed successfully, remote version: ${h.stdout}`),o?.(`Deployed v${h.stdout}`),`${N}/${F}`}d(),i(),r();var z=3e4,B=20,V=class extends Error{constructor(e){super(e),this.name=`SSHSessionError`}};async function H(e,t){let{host:n,localVersion:r,extraCliArgs:i,remoteBin:o}=e,s=t?.onProgress,c,l=`/`;if(o){s?.(`Using custom remote binary, skipping probe/deploy…`),c=o,a(`[SSH] custom remoteBin: ${o}`);try{let e=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=5`,n,`pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`ignore`});await e.exited;let t=(await new Response(e.stdout).text()).trim();t.startsWith(`/`)&&(l=t)}catch{}}else{let e=await j(n,s);a(`[SSH] probe result: ${JSON.stringify(e)}`),l=e.defaultCwd,c=e.binaryPath??`~/.local/bin/claude`,(!e.hasBinary||e.remoteVersion!==r)&&(s?.(e.hasBinary?`Updating remote binary (${e.remoteVersion} → ${r})…`:`Deploying binary to remote…`),c=await R({host:n,remotePlatform:e.remotePlatform,remoteArch:e.remoteArch,localVersion:r,onProgress:s}))}let{proxy:u,localAddress:d,authEnv:f}=await E();a(`[SSH] auth proxy listening on ${d}`);let p=g().slice(0,8),m=process.platform===`win32`,h=[];for(let[e,t]of Object.entries(f))h.push(`${e}=${t}`);h.push(c,`--output-format`,`stream-json`,`--input-format`,`stream-json`,`--verbose`,`-p`),e.cwd&&h.push(`--cwd`,e.cwd),e.permissionMode&&h.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&h.push(`--dangerously-skip-permissions`),h.push(...i);let _=[`ssh`];if(m){let e=d.split(`:`)[1],t=1e4+Math.floor(Math.random()*5e4);_.push(`-R`,`${t}:127.0.0.1:${e}`);let n=h.findIndex(e=>e.startsWith(`ANTHROPIC_BASE_URL=`));n!==-1&&(h[n]=`ANTHROPIC_BASE_URL=http://127.0.0.1:${t}`)}else{let e=`/tmp/claude-ssh-auth-${p}.sock`;_.push(`-R`,`${e}:${d}`),_.push(`-o`,`StreamLocalBindUnlink=yes`);let t=h.indexOf(`ANTHROPIC_AUTH_SOCKET=${f.ANTHROPIC_AUTH_SOCKET}`);t!==-1&&(h[t]=`ANTHROPIC_AUTH_SOCKET=${e}`)}_.push(n,h.join(` `)),s?.(`Starting remote session…`),a(`[SSH] spawning: ${_.join(` `)}`);let v;try{v=Bun.spawn(_,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`})}catch(e){throw u.stop(),new V(`Failed to spawn SSH process: ${e instanceof Error?e.message:String(e)}`)}let y=[];G(v,y);let b;if(o){let t=await Promise.race([v.exited.then(e=>e),new Promise(e=>setTimeout(()=>e(null),3e3))]);if(t!==null){u.stop();let e=y.join(``).trim();throw new V(`Remote process exited immediately (code ${t})${e?`: ${e}`:``}`)}b=e.cwd||l||`/`}else try{b=await W(v,e.cwd||l)}catch(e){throw u.stop(),v.kill(),e}a(`[SSH] remote session initialized, remoteCwd=${b}`);let S=v,C=async()=>{a(`[SSH] reconnect: re-spawning SSH process with --continue`);let e=[..._],t=e.length-1,n=e[t];n.includes(`--continue`)||(e[t]=n.replace(/ -p(?:\s|$)/,` -p --continue `));let r=Bun.spawn(e,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`}),i=[];return G(r,i),await W(r,b),S=r,y.length=0,y.push(...i),r};return{remoteCwd:b,get proc(){return S},proxy:u,createManager(e){return new x(S,{...e,reconnect:C})},getStderrTail(){return y.slice(-20).join(``)}}}async function U(e){let{proxy:t,authEnv:n}=await E(),r=[`--output-format`,`stream-json`,`--input-format`,`stream-json`,`-p`];e.cwd&&r.push(`--cwd`,e.cwd),e.permissionMode&&r.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&r.push(`--dangerously-skip-permissions`);let i=f(r),o;try{o=Bun.spawn([i.execPath,...i.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...i.env,...n}})}catch(e){throw t.stop(),new V(`Failed to spawn local CLI process: ${e instanceof Error?e.message:String(e)}`)}a(`[SSH] local session spawned, waiting for init message...`);let s=[];G(o,s);let c;try{c=await W(o,e.cwd)}catch(e){throw t.stop(),o.kill(),e}a(`[SSH] local session initialized, remoteCwd=${c}`);let l=o,u=async()=>{a(`[SSH] local reconnect: re-spawning CLI with --continue`);let e=[...r];e.includes(`--continue`)||e.push(`--continue`);let t=f(e),i=Bun.spawn([t.execPath,...t.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...t.env,...n}}),o=[];return G(i,o),await W(i,c),l=i,s.length=0,s.push(...o),i};return{remoteCwd:c,get proc(){return l},proxy:t,createManager(e){return new x(l,{...e,reconnect:u})},getStderrTail(){return s.slice(-20).join(``)}}}async function W(e,t){let r=e.stdout;if(!r)throw new V(`Child process stdout is not readable`);let i=r.getReader(),a=new TextDecoder,o=``,s=Date.now()+z;try{for(;Date.now()<s;){let e=s-Date.now(),r=await Promise.race([i.read(),new Promise((t,n)=>setTimeout(()=>n(new V(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)),e))]);if(r.done)throw new V(`Child process exited before sending init message`);o+=a.decode(r.value,{stream:!0});let c=o.split(`
|
|
6
6
|
`);o=c.pop()??``;for(let e of c){let r=e.trim();if(r)try{let e=n(r);if(e.type===`system`&&e.subtype===`init`)return i.releaseLock(),e.cwd||t||process.cwd()}catch{}}}}catch(e){throw i.releaseLock(),e instanceof V?e:new V(`Error reading init message: ${e instanceof Error?e.message:String(e)}`)}throw i.releaseLock(),new V(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)}function G(e,t){let n=e.stderr;if(!n)return;let r=n.getReader(),i=new TextDecoder;(async()=>{try{for(;;){let{done:e,value:n}=await r.read();if(e)break;t.push(i.decode(n,{stream:!0})),t.length>B*2&&t.splice(0,t.length-B)}}catch{}})()}export{V as SSHSessionError,U as createLocalSSHSession,H as createSSHSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,r}from"./createSession-VMTMXOHu.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{F as t,a as n,l as r,z as i}from"./debug-BrXObCdR.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-NO5KtXqi.js";async function l({environmentId:e,title:n,events:i,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-B9V3i5oZ.js`),{getOrganizationUUID:p}=await import(`./client-DPUvQ6Rf.js`),{getOauthConfig:m}=await import(`./oauth-C8X_p8Gc.js`),{getOAuthHeaders:h}=await import(`./api-CI8HXREw.js`),{parseGitHubRepository:g}=await import(`./detectRepository-BTPgN89l.js`),{getDefaultBranch:_}=await import(`./git-CbcnOf0E.js`),{getMainLoopModel:v}=await import(`./model-C4RHNhDQ.js`),{default:y}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-CLHy-BiF.js`),x=u?.()??f()?.accessToken;if(!x)return r(`[bridge] No access token for session creation`),null;let S=b()?`self-hosted`:await p();if(!S)return r(`[bridge] No org UUID for session creation`),null;let C=null,w=null;if(a){let{parseGitRemote:e}=await import(`./detectRepository-BTPgN89l.js`),t=e(a);if(t){let{host:e,owner:n,name:r}=t,i=o||await _()||void 0;C={type:`git_repository`,url:`https://${e}/${n}/${r}`,revision:i},w={type:`git_repository`,git_info:{type:`github`,repo:`${n}/${r}`,branches:[`claude/${o||`task`}`]}}}else{let e=g(a);if(e){let[t,n]=e.split(`/`);if(t&&n){let e=o||await _()||void 0;C={type:`git_repository`,url:`https://github.com/${t}/${n}`,revision:e},w={type:`git_repository`,git_info:{type:`github`,repo:`${t}/${n}`,branches:[`claude/${o||`task`}`]}}}}}}let T={...n!==void 0&&{title:n},events:i,session_context:{sources:C?[C]:[],outcomes:w?[w]:[],model:v()},environment_id:e,source:`remote-control`,...d&&{permission_mode:d}},E={...h(x),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":S},D=`${l??m().BASE_API_URL}/v1/sessions`,O;try{O=await y.post(D,T,{headers:E,signal:c,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session creation request failed: ${t(e)}`),null}if(!(O.status===200||O.status===201)){let e=s(O.data);return r(`[bridge] Session creation failed with status ${O.status}${e?`: ${e}`:``}`),null}let k=O.data;return!k||typeof k!=`object`||!(`id`in k)||typeof k.id!=`string`?(r(`[bridge] No session ID in response`),null):k.id}async function u(e,n){let{getClaudeAIOAuthTokens:i}=await import(`./auth-B9V3i5oZ.js`),{getOrganizationUUID:a}=await import(`./client-DPUvQ6Rf.js`),{getOauthConfig:o}=await import(`./oauth-C8X_p8Gc.js`),{getOAuthHeaders:c}=await import(`./api-CI8HXREw.js`),{default:l}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-CLHy-BiF.js`),d=n?.getAccessToken?.()??i()?.accessToken;if(!d)return r(`[bridge] No access token for session fetch`),null;let f=u()?`self-hosted`:await a();if(!f)return r(`[bridge] No org UUID for session fetch`),null;let p={...c(d),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":f},m=`${n?.baseUrl??o().BASE_API_URL}/v1/sessions/${e}`;r(`[bridge] Fetching session ${e}`);let h;try{h=await l.get(m,{headers:p,timeout:1e4,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session fetch request failed: ${t(e)}`),null}if(h.status!==200){let e=s(h.data);return r(`[bridge] Session fetch failed with status ${h.status}${e?`: ${e}`:``}`),null}return h.data}async function d(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-B9V3i5oZ.js`),{getOrganizationUUID:i}=await import(`./client-DPUvQ6Rf.js`),{getOauthConfig:a}=await import(`./oauth-C8X_p8Gc.js`),{getOAuthHeaders:o}=await import(`./api-CI8HXREw.js`),{default:c}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-CLHy-BiF.js`),u=t?.getAccessToken?.()??n()?.accessToken;if(!u){r(`[bridge] No access token for session archive`);return}let d=l()?`self-hosted`:await i();if(!d){r(`[bridge] No org UUID for session archive`);return}let f={...o(u),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":d},p=`${t?.baseUrl??a().BASE_API_URL}/v1/sessions/${e}/archive`;r(`[bridge] Archiving session ${e}`);let m=await c.post(p,{},{headers:f,timeout:t?.timeoutMs??1e4,validateStatus:e=>e<500});if(m.status===200)r(`[bridge] Session ${e} archived successfully`);else{let e=s(m.data);r(`[bridge] Session archive failed with status ${m.status}${e?`: ${e}`:``}`)}}async function f(e,n,i){let{getClaudeAIOAuthTokens:a}=await import(`./auth-B9V3i5oZ.js`),{getOrganizationUUID:c}=await import(`./client-DPUvQ6Rf.js`),{getOauthConfig:l}=await import(`./oauth-C8X_p8Gc.js`),{getOAuthHeaders:u}=await import(`./api-CI8HXREw.js`),{default:d}=await import(`./axios-BHBm_hhU.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-CLHy-BiF.js`),p=i?.getAccessToken?.()??a()?.accessToken;if(!p){r(`[bridge] No access token for session title update`);return}let m=f()?`self-hosted`:await c();if(!m){r(`[bridge] No org UUID for session title update`);return}let h={...u(p),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":m},g=o(e),_=`${i?.baseUrl??l().BASE_API_URL}/v1/sessions/${g}`;r(`[bridge] Updating session title: ${g} → ${n}`);try{let e=await d.patch(_,{title:n},{headers:h,timeout:1e4,validateStatus:e=>e<500});if(e.status===200)r(`[bridge] Session title updated successfully`);else{let t=s(e.data);r(`[bridge] Session title update failed with status ${e.status}${t?`: ${t}`:``}`)}}catch(e){r(`[bridge] Session title update request failed: ${t(e)}`)}}var p=e((()=>{n(),i(),c(),a()}));export{f as a,p as i,l as n,u as r,d as t};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{C as i,D as a,Gr as o,H as s,I as c,P as l,T as u,Wt as d,Xn as f,ai as p,di as m,fi as h,hn as ee,k as te,ot as ne,p as re,t as g,ui as _}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{en as y,ht as ie,nt as ae}from"./state-ix0xIunV.js";import{Cr as b,Ex as oe,Fh as x,Fi as se,Fr as S,Ju as C,Lb as ce,Nr as le,Ph as w,Pi as ue,Rx as de,Tx as T,Wr as fe,Xb as pe,Xu as me,Yb as he,_x as ge,hr as _e,jr as E,lC as D,vi as ve,vx as ye,zb as O,zx as be}from"./loadAgentsDir-DrDu5yYy.js";import{C as k,S as xe,a as A,l as j}from"./debug-BrXObCdR.js";import{_n as Se,gn as M}from"./settings-DfWP5y6X.js";import{_ as Ce,i as we}from"./git-Do0wJvux.js";import{a as Te,o as Ee,s as De}from"./log-BMCygSzM.js";import{n as Oe,r as N}from"./analytics-BotDBGh0.js";import{T as ke,b as Ae,f as je,h as Me}from"./startupProfiler-xa3NmN7Z.js";import{_ as Ne,h as Pe}from"./model-fi472PRc.js";import{i as P,r as F}from"./shellQuote-DkSy9MYE.js";import{u as Fe}from"./referral-DrebVwqx.js";import{n as Ie,t as Le}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{t as Re}from"./SearchBox-vfLXEPed.js";import{n as ze,t as Be}from"./useSearchInput-D5VU9IDU.js";import{d as Ve,n as I,t as He,u as Ue}from"./Messages-Dv2VrytX.js";import{sep as L}from"path";function We({log:e,onExit:t,onSelect:n}){let[r,i]=R.useState(null);R.useEffect(()=>{i(null),S(e)&&fe(e).then(i)},[e]);let o=S(e)&&r===null,s=r??e,f=b(s)||``,p=C();return d(`confirm:no`,t,{context:`Confirmation`}),d(`confirm:yes`,(0,R.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),o?(0,z.jsxs)(c,{flexDirection:`column`,padding:1,children:[(0,z.jsx)(re,{message:`Loading session…`}),(0,z.jsx)(l,{dimColor:!0,children:(0,z.jsx)(u,{children:(0,z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,z.jsxs)(c,{flexDirection:`column`,children:[(0,z.jsx)(He,{messages:s.messages,tools:p,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:f,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,z.jsxs)(c,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,z.jsxs)(l,{children:[Me(s.modified),` · `,s.messageCount,` messages`,s.gitBranch?` · ${s.gitBranch}`:``]}),(0,z.jsx)(l,{dimColor:!0,children:(0,z.jsxs)(u,{children:[(0,z.jsx)(a,{shortcut:`Enter`,action:`resume`}),(0,z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var R,z,B=e((()=>{R=t(h(),1),g(),Fe(),me(),Ae(),E(),oe(),I(),z=v()}));function Ge(e,t){if(e===H)return 5;let n=o(e),r=t?Math.min(n,t-U-W):n;return Math.max(0,r)+U+W}function Ke(e,t){let n=t-U-W;return o(e)<=n?e:n<=1?e.charAt(0):ke(e,n)}function qe({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max($e,G),s=n-a-o-2,u=Math.max(0,Math.min(t,e.length-1)),d=Math.max(20,Math.floor(s/2)),f=e.map(e=>Ge(e,d)),p=0,m=e.length;if(f.reduce((e,t,n)=>e+t+ +(n<f.length-1),0)>s){let t=s-Qe,n=f[u]??0;for(p=u,m=u+1;p>0||m<e.length;){let r=p>0,i=m<e.length;if(r){let e=(f[p-1]??0)+1;if(n+e<=t){p--,n+=e;continue}}if(i){let e=(f[m]??0)+1;if(n+e<=t){m++,n+=e;continue}}break}}let h=p,ee=e.length-m,te=e.slice(p,m),ne=te.map((e,t)=>p+t);return(0,V.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,V.jsx)(l,{color:`suggestion`,children:i}),h>0&&(0,V.jsxs)(l,{dimColor:!0,children:[Je,h]}),te.map((e,t)=>{let n=ne[t]===u,r=e===H?e:`#${Ke(e,d-U)}`;return(0,V.jsxs)(l,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),ee>0?(0,V.jsxs)(l,{dimColor:!0,children:[Ye,ee,Xe]}):(0,V.jsx)(l,{dimColor:!0,children:Ze})]})}var V,H,U,W,Je,Ye,Xe,Ze,Qe,$e,G,K=e((()=>{h(),g(),Ae(),V=v(),H=`All`,U=2,W=1,Je=`← `,Ye=`→`,Xe=` (tab to cycle)`,Ze=`(tab to cycle)`,Qe=5,$e=18,G=14}));function et({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:o=`expanded`,isDisabled:s=!1,hideIndexes:l=!1,isNodeExpanded:u,onExpand:d,onCollapse:f,getParentPrefix:p,getChildPrefix:m,onUpFromFirstItem:h}){let[ee,te]=q.useState(new Set),ne=q.useRef(!1),re=q.useRef(null),g=q.useCallback(e=>u?u(e):ee.has(e),[u,ee]),_=q.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=g(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,g]),v=q.useCallback(e=>e?`▼ `:`▶ `,[]),y=q.useCallback(e=>` ▸ `,[]),ie=p??v,ae=m??y,b=q.useCallback(e=>{let t=``;return e.hasChildren?t=ie(e.isExpanded):e.depth>0&&(t=ae(e.depth)),t+e.node.label},[ie,ae]),oe=q.useMemo(()=>_.map(e=>({label:b(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[_,b]),x=q.useMemo(()=>{let e=new Map;return _.forEach(t=>e.set(t.node.id,t.node)),e},[_]),se=q.useCallback(e=>_.find(t=>t.node.id===e),[_]),S=q.useCallback((e,t)=>{let n=se(e);!n||!n.hasChildren||(t?d?d(e):te(t=>new Set(t).add(e)):f?f(e):te(t=>{let n=new Set(t);return n.delete(e),n}))},[se,d,f]);return(0,tt.jsx)(c,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=se(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),S(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),S(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),ne.current=!0,S(t.parentId,!1),r)){let e=x.get(t.parentId);e&&r(e)}}}},children:(0,tt.jsx)(ge,{options:oe,onChange:q.useCallback(e=>{let n=x.get(e);n&&t(n)},[x,t]),onFocus:q.useCallback(e=>{if(ne.current){ne.current=!1;return}if(re.current!==e&&(re.current=e,r)){let t=x.get(e);t&&r(t)}},[r,x]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:o,isDisabled:s,hideIndexes:l,onUpFromFirstItem:h})})}var q,tt,nt=e((()=>{q=t(h(),1),g(),ye(),tt=v()}));function rt(e,t){return ke(e.replace(/\s+/g,` `).trim(),t)}function it({before:e,match:t,after:n},r){return _.dim(e)+r(t)+_.dim(n)}function at(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function ot(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?pt:i?mt:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${rt(Te(e),l)}${c}${s}`}function st(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=je(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function ct({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:o,onSelect:m,onLogsChanged:h,onLoadMore:re,initialSearchQuery:g,showAllProjects:_=!1,onToggleAllProjects:v,onAgenticSearch:y}){let oe=ne(),x=n===void 0?oe.columns:n,se=Ie(o),S=f(),C=le(),w=process.env.USER_TYPE===`ant`,[fe]=s(),pe=he(fe),me=J.useMemo(()=>e=>p(e,pe.warning),[pe.warning]),E=process.env.USER_TYPE===`ant`,[D,ye]=J.useState(null),[O,be]=J.useState(!1),[k,xe]=J.useState(!1),[A,j]=J.useState(!1),Se=J.useMemo(()=>ae(),[]),[M,Ce]=J.useState(``),[Ee,De]=J.useState(0),[Oe,ke]=J.useState(new Set),[Ae,Me]=J.useState(null),[Ne,Pe]=J.useState(1),[P,F]=J.useState(`list`),[Fe,Le]=J.useState(null),Re=J.useRef(null),[Be,Ve]=J.useState(0),[I,He]=J.useState({status:`idle`}),[L,R]=J.useState(!1),z=J.useRef(null),{query:B,setQuery:Ge,cursorOffset:Ke}=ze({isActive:P===`search`&&I.status!==`searching`,onExit:()=>{F(`list`),N(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{F(`list`),N(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:g||``}),V=J.useDeferredValue(B),[H,U]=J.useState(``);J.useEffect(()=>{if(!V){U(``);return}let e=setTimeout(U,300,V);return()=>clearTimeout(e)},[V]);let[W,Je]=J.useState(null),[Ye,Xe]=J.useState(!1);J.useEffect(()=>{we().then(e=>ye(e)),ue(Se).then(e=>{j(e.length>1)})},[Se]);let Ze=J.useMemo(()=>new Map(e.map(e=>[e,ut(e)])),[e]),Qe=J.useMemo(()=>w?new Ue(e.map(e=>({log:e,searchableText:Ze.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:ht,ignoreLocation:!0,includeScore:!0}):null,[e,Ze,w]),$e=J.useMemo(()=>ft(e),[e]),G=$e.length>0,K=J.useMemo(()=>G?[`All`,...$e]:[],[G,$e]),q=K.length>0&&Be<K.length?Be:0,tt=K[q],nt=tt===`All`?void 0:tt,ct=+!!G,lt=J.useMemo(()=>{let t=e;return C&&(t=e.filter(e=>{let t=ie(),n=b(e);return!!(t&&n===t||e.customTitle||_e(e.messages)||e.firstPrompt||e.customTitle)})),nt!==void 0&&(t=t.filter(e=>e.tag===nt)),O&&D&&(t=t.filter(e=>e.gitBranch===D)),A&&!k&&(t=t.filter(e=>e.projectPath===Se)),t},[e,C,nt,O,D,A,k,Se]),pt=J.useMemo(()=>{if(!B)return lt;let e=B.toLowerCase();return lt.filter(t=>{let n=Te(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[lt,B]);J.useEffect(()=>{w&&V&&V!==H&&Xe(!0)},[V,H,w]),J.useEffect(()=>{if(!w||!H||!Qe){Je(null),Xe(!1);return}let e=setTimeout((e,t,n,r)=>{let i=e.search(t);i.sort((e,t)=>{let n=new Date(e.item.log.modified).getTime(),r=new Date(t.item.log.modified).getTime()-n;return Math.abs(r)>gt?r:(e.score??1)-(t.score??1)}),n({results:i.map(e=>({log:e.item.log,score:e.score,searchableText:e.item.searchableText})),query:t}),r(!1)},0,Qe,H,Je,Xe);return()=>{clearTimeout(e)}},[H,Qe,w]);let{filteredLogs:mt,snippets:X}=J.useMemo(()=>{let e=new Map,t=pt;if(W&&H&&W.query===H){for(let t of W.results)if(t.searchableText){let n=at(t.searchableText,H,_t);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=W.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[pt,W,H]),Z=J.useMemo(()=>I.status===`results`&&I.results.length>0?I.results:mt,[I,mt]),Q=Math.max(30,x-4),vt=J.useMemo(()=>{if(!C)return[];let e=dt(Z);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Z.indexOf(n),i=X.get(n),a=i?it(i,me):null;if(t.length===1){let t=st(n,{showProjectPath:_});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:ot(n,Q),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Z.indexOf(t),i=X.get(t),a=i?it(i,me):null,o=st(t,{isChild:!0,showProjectPath:_});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:ot(t,Q,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=st(n,{showProjectPath:_});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:ot(n,Q,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[C,Z,Q,_,X,me]),yt=J.useMemo(()=>C?[]:Z.map((e,t)=>{let n=rt(Te(e)+(e.isSidechain?` (sidechain)`:``),Q),r=je(e),i=_&&e.projectPath?` · ${e.projectPath}`:``,a=X.get(e),o=a?it(a,me):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[C,Z,me,Q,_,X]),$=Ae?.value.log??null,bt=()=>{if(!C||!$)return``;let e=b($);if(!e)return``;let t=Z.filter(t=>b(t)===e);if(!(t.length>1))return``;let n=Oe.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=J.useCallback(async()=>{let e=$?b($):void 0;if(!$||!e){F(`list`),Ce(``);return}M.trim()&&(await ve(e,M.trim(),$.fullPath),C&&h&&h()),F(`list`),Ce(``)},[$,M,h,C]),St=J.useCallback(()=>{F(`list`),N(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=J.useCallback(()=>{F(`search`),N(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=J.useCallback(async()=>{if(!B.trim()||!y||!E)return;z.current?.abort();let t=new AbortController;z.current=t,He({status:`searching`}),N(`tengu_agentic_search_started`,{query_length:B.length});try{let n=await y(B,e,t.signal);if(t.signal.aborted)return;He({status:`results`,results:n,query:B}),N(`tengu_agentic_search_completed`,{query_length:B.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;He({status:`error`,message:e instanceof Error?e.message:`Search failed`}),N(`tengu_agentic_search_error`,{query_length:B.length})}},[B,y,E,e]);J.useEffect(()=>{I.status!==`idle`&&I.status!==`searching`&&(I.status===`results`&&I.query!==B||I.status===`error`)&&He({status:`idle`})},[B,I]),J.useEffect(()=>()=>{z.current?.abort()},[]);let Tt=J.useRef(I.status);J.useEffect(()=>{let e=Tt.current;if(Tt.current=I.status,e===`searching`&&I.status===`results`){if(C&&vt.length>0)Me(vt[0]);else if(!C&&Z.length>0){let e=Z[0];Me({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[I.status,C,vt,Z]);let Et=J.useCallback(e=>{let t=parseInt(e,10),n=Z[t];!n||Re.current===t.toString()||(Re.current=t.toString(),Me({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Pe(t+1))},[Z]),Dt=J.useCallback(e=>{Me(e);let t=Z.findIndex(t=>b(t)===b(e.value.log));t>=0&&Pe(t+1)},[Z]);d(`confirm:no`,()=>{z.current?.abort(),He({status:`idle`}),N(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:P!==`preview`&&I.status===`searching`}),d(`confirm:no`,()=>{F(`list`),Ce(``)},{context:`Settings`,isActive:P===`rename`&&I.status!==`searching`}),d(`confirm:no`,()=>{Ge(``),R(!1),o?.()},{context:`Confirmation`,isActive:P!==`preview`&&P!==`rename`&&P!==`search`&&L&&I.status!==`searching`}),ee((e,t)=>{if(P!==`preview`&&I.status!==`searching`&&P!==`rename`)if(P===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&B.trim()&&y&&E&&I.status!==`results`&&R(!0);else{if(L){if(t.return){wt(),R(!1);return}else if(t.downArrow){R(!1);return}else if(t.upArrow){F(`search`),R(!1);return}}if(G&&t.tab){let e=t.shift?-1:1;Ve(t=>{let n=((t<K.length?t:0)+K.length+e)%K.length,r=K[n];return N(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:$e.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&v)v(),N(`tengu_session_all_projects_toggled`,{enabled:!_});else if(r===`b`&&t.ctrl){let e=!O;be(e),N(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&A){let e=!k;xe(e),N(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(F(`search`),N(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(F(`rename`),Ce(``),N(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Le($),F(`preview`),N(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(F(`search`),Ge(e),N(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];O&&D&&Ot.push(D),A&&!k&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&P!==`search`)+ct,At=Math.max(1,Math.floor((t-kt-2)/3));return J.useEffect(()=>{if(!re)return;let e=At*2;Ne+e>=Z.length&&re(At*3)},[Ne,At,Z.length,re]),e.length===0?null:P===`preview`&&Fe&&C?(0,Y.jsx)(We,{log:Fe,onExit:()=>{F(`list`),Le(null)},onSelect:m}):(0,Y.jsxs)(c,{flexDirection:`column`,height:t-1,children:[(0,Y.jsx)(c,{flexShrink:0,children:(0,Y.jsx)(i,{color:`suggestion`})}),(0,Y.jsx)(c,{flexShrink:0,children:(0,Y.jsx)(l,{children:` `})}),G?(0,Y.jsx)(qe,{tabs:K,selectedIndex:q,availableWidth:x,showAllProjects:_}):(0,Y.jsx)(c,{flexShrink:0,children:(0,Y.jsxs)(l,{bold:!0,color:`suggestion`,children:[`Resume Session`,P===`list`&&Z.length>At&&(0,Y.jsxs)(l,{dimColor:!0,children:[` `,`(`,Ne,` of `,Z.length,`)`]})]})}),(0,Y.jsx)(te,{query:B,isFocused:P===`search`,isTerminalFocused:S,cursorOffset:Ke}),Ot.length>0&&P!==`search`&&(0,Y.jsx)(c,{flexShrink:0,paddingLeft:2,children:(0,Y.jsx)(l,{dimColor:!0,children:(0,Y.jsx)(u,{children:Ot})})}),(0,Y.jsx)(c,{flexShrink:0,children:(0,Y.jsx)(l,{children:` `})}),I.status===`searching`&&(0,Y.jsxs)(c,{paddingLeft:1,flexShrink:0,children:[(0,Y.jsx)(ce,{}),(0,Y.jsx)(l,{children:` Searching…`})]}),I.status===`results`&&I.results.length>0&&(0,Y.jsx)(c,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(l,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),I.status===`results`&&I.results.length===0&&mt.length===0&&(0,Y.jsx)(c,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(l,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),I.status===`error`&&mt.length===0&&(0,Y.jsx)(c,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(l,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!B.trim()&&y&&E&&I.status!==`searching`&&I.status!==`results`&&I.status!==`error`&&(0,Y.jsxs)(c,{flexShrink:0,flexDirection:`column`,children:[(0,Y.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,Y.jsx)(l,{color:L?`suggestion`:void 0,children:L?r.pointer:` `}),(0,Y.jsx)(l,{color:L?`suggestion`:void 0,bold:L,children:`Search deeply using Claude →`})]}),(0,Y.jsx)(c,{height:1})]}),I.status===`searching`?null:P===`rename`&&$?(0,Y.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,Y.jsx)(l,{bold:!0,children:`Rename session:`}),(0,Y.jsx)(c,{paddingTop:1,children:(0,Y.jsx)(de,{value:M,onChange:Ce,onSubmit:xt,placeholder:Te($,`Enter new session name`),columns:x,cursorOffset:Ee,onChangeCursorOffset:De,showCursor:!0})})]}):C?(0,Y.jsx)(et,{nodes:vt,onSelect:e=>{m(e.value.log)},onFocus:Dt,onCancel:o,focusNodeId:Ae?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:P===`search`||L,hideIndexes:!1,isNodeExpanded:e=>{if(P===`search`||O)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Oe.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(ke(e=>new Set(e).add(t)),N(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&ke(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,Y.jsx)(ge,{options:yt,onChange:e=>{let t=Z[parseInt(e,10)];t&&m(t)},visibleOptionCount:At,onCancel:o,onFocus:Et,defaultFocusValue:Ae?.id.toString(),layout:`expanded`,isDisabled:P===`search`||L,onUpFromFirstItem:Ct}),(0,Y.jsx)(c,{paddingLeft:2,children:se.pending?(0,Y.jsxs)(l,{dimColor:!0,children:[`Press `,se.keyName,` again to exit`]}):P===`rename`?(0,Y.jsx)(l,{dimColor:!0,children:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(a,{shortcut:`Enter`,action:`save`}),(0,Y.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I.status===`searching`?(0,Y.jsx)(l,{dimColor:!0,children:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(l,{children:`Searching with Claude…`}),(0,Y.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):L?(0,Y.jsx)(l,{dimColor:!0,children:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(a,{shortcut:`Enter`,action:`search`}),(0,Y.jsx)(a,{shortcut:`↓`,action:`skip`}),(0,Y.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):P===`search`?(0,Y.jsx)(l,{dimColor:!0,children:(0,Y.jsxs)(u,{children:[(0,Y.jsx)(l,{children:Ye&&w?`Searching…`:`Type to Search`}),(0,Y.jsx)(a,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,Y.jsx)(l,{dimColor:!0,children:(0,Y.jsxs)(u,{children:[v&&(0,Y.jsx)(a,{shortcut:`Ctrl+A`,action:`show ${_?`current dir`:`all projects`}`}),D&&(0,Y.jsx)(a,{shortcut:`Ctrl+B`,action:`toggle branch`}),A&&(0,Y.jsx)(a,{shortcut:`Ctrl+W`,action:`show ${k?`current worktree`:`all worktrees`}`}),(0,Y.jsx)(a,{shortcut:`Ctrl+V`,action:`preview`}),(0,Y.jsx)(a,{shortcut:`Ctrl+R`,action:`rename`}),(0,Y.jsx)(l,{children:`Type to search`}),(0,Y.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,Y.jsx)(l,{children:bt()})]})})})]})}function lt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function ut(e){let t=(e.messages.length<=X?e.messages:[...e.messages.slice(0,Z),...e.messages.slice(-1e3)]).map(lt).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Q?n.slice(0,Q):n}function dt(e){let t=new Map;for(let n of e){let e=b(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function ft(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var J,Y,pt,mt,X,Z,Q,ht,gt,_t,vt=e((()=>{m(),n(),Ve(),J=t(h(),1),y(),Le(),Be(),D(),g(),Fe(),Oe(),Ae(),se(),Ce(),Ee(),E(),pe(),oe(),ye(),Re(),B(),O(),K(),be(),nt(),Y=v(),pt=2,mt=4,X=2e3,Z=1e3,Q=5e4,ht=.3,gt=60*1e3,_t=50}));function yt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function $(e){if(e.length===0)return``;let t=(e.length<=Ct?e:[...e.slice(0,Ct/2),...e.slice(-100/2)]).map(yt).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>St?t.slice(0,St)+`…`:t}function bt(e,t){return!!(Te(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&$(e.messages).toLowerCase().includes(t))}async function xt(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>bt(e,r)),a;if(i.length>=wt)a=i.slice(0,wt);else{let e=t.filter(e=>!bt(e,r)),n=wt-i.length;a=[...i,...e.slice(0,n)]}j(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${M(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(S(e))try{return await fe(e)}catch(t){return De(t),e}return e}),s=await Promise.all(o);j(`Agentic search: loaded ${M(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
+
${s.map((e,t)=>{let n=[`${t}:`],r=Te(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=$(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
|
+
`)}
|
|
4
|
+
|
|
5
|
+
Search query: "${e}"
|
|
6
|
+
|
|
7
|
+
Find the sessions that are most relevant to this query.`;j(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=Pe();j(`Agentic search using model: ${e}`);let t=(await x({model:e,system:Tt,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return j(`No text content in agentic search response`),[];j(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return j(`Could not find JSON in agentic search response`),[];let i=(k(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return j(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return De(e),j(`Agentic search error: ${e}`),[]}}var St,Ct,wt,Tt,Et=e((()=>{Se(),A(),Ee(),Ne(),E(),w(),xe(),St=2e3,Ct=100,wt=100,Tt=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
|
+
|
|
9
|
+
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
10
|
+
|
|
11
|
+
Each session may include:
|
|
12
|
+
- Title (display name or custom title)
|
|
13
|
+
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
14
|
+
- Branch (git branch name, shown as [branch: name])
|
|
15
|
+
- Summary (AI-generated summary)
|
|
16
|
+
- First message (beginning of the conversation)
|
|
17
|
+
- Transcript (excerpt of conversation content)
|
|
18
|
+
|
|
19
|
+
IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
|
|
20
|
+
|
|
21
|
+
For each session, consider (in order of priority):
|
|
22
|
+
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
23
|
+
2. Partial tag matches or tag-related terms
|
|
24
|
+
3. Title matches (custom titles or first message content)
|
|
25
|
+
4. Branch name matches
|
|
26
|
+
5. Summary and transcript content matches
|
|
27
|
+
6. Semantic similarity and related concepts
|
|
28
|
+
|
|
29
|
+
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
30
|
+
- Contain the query term anywhere in any field
|
|
31
|
+
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
32
|
+
- Discuss topics that could be related to the query
|
|
33
|
+
- Have transcripts that mention the concept even in passing
|
|
34
|
+
|
|
35
|
+
When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
|
|
36
|
+
|
|
37
|
+
Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
|
|
38
|
+
|
|
39
|
+
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
+
{"relevant_indices": [2, 5, 0]}`}));function Dt(e,t,n){let r=ae();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=b(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${P([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+L)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=b(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${P([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var Ot=e((()=>{y(),F(),E()}));export{ct as a,Et as i,Ot as n,vt as o,xt as r,Dt as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";async function t(e,t,r){let i=r?r.trim().split(/\s+/):[],a=i[0]||`status`;return a===`attach`?(e("Use `claude daemon attach` from the CLI. Attach is not available inside the REPL.",{display:`system`}),null):(e((await n(async()=>{if(a===`bg`)await(await import(`./bg-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";async function t(e,t,r){let i=r?r.trim().split(/\s+/):[],a=i[0]||`status`;return a===`attach`?(e("Use `claude daemon attach` from the CLI. Attach is not available inside the REPL.",{display:`system`}),null):(e((await n(async()=>{if(a===`bg`)await(await import(`./bg-B0iMGM9C.js`)).handleBgStart(i.slice(1));else{let{daemonMain:e}=await import(`./main-D862LI_d.js`);await e([a,...i.slice(1)])}})).join(`
|
|
2
2
|
`)||`Done.`,{display:`system`}),null)}async function n(e){let t=[],n=console.log,r=console.error;console.log=(...e)=>t.push(e.map(String).join(` `)),console.error=(...e)=>t.push(e.map(String).join(` `));try{await e()}finally{console.log=n,console.error=r}return t}e((()=>{}))();export{t as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{f as a,g as o}from"./config-DiT2Z8dY.js";import{o as s,s as c}from"./log-BMCygSzM.js";import{B as l,G as u,_ as d,fi as f,mi as p,r as m}from"./model-fi472PRc.js";import{Z as h,et as g}from"./esm-DjGYYlQe.js";import{f as _,p as v}from"./firstPartyEventLogger-CQdJn3LV.js";import{createHash as y}from"crypto";function b(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}async function x(){if(N.length===0)return;let e=N;N=[];try{await r.post(E,e,{headers:{"Content-Type":`application/json`,"DD-API-KEY":D},timeout:A})}catch(e){c(e)}}function S(){P||(P=setTimeout(()=>{P=null,x()},T()).unref())}async function C(){P&&(clearTimeout(P),P=null),await x()}async function w(e,t){if(f()!==`firstParty`)return;let n=F;if(n===null&&(n=await I()),!(!n||!j.has(e)))try{let{envContext:n,...r}=await h({model:t.model,betas:t.betas}),i={...r,...n,...t,userBucket:R()};if(typeof i.toolName==`string`&&i.toolName.startsWith(`mcp__`)&&(i.toolName=`mcp`),process.env.USER_TYPE!==`ant`&&typeof i.model==`string`){let e=m(i.model.replace(/\[1m]$/i,``));i.model=e in l?e:`other`}if(typeof i.version==`string`&&(i.version=i.version.replace(/^(\d+\.\d+\.\d+-dev\.\d{8})\.t\d+\.sha[a-f0-9]+$/,`$1`)),i.status!==void 0&&i.status!==null){let e=String(i.status);i.http_status=e;let t=e.charAt(0);t>=`1`&&t<=`5`&&(i.http_status_range=`${t}xx`),delete i.status}let a=i,o={ddsource:`nodejs`,ddtags:[`event:${e}`,...M.filter(e=>a[e]!==void 0&&a[e]!==null).map(e=>`${b(e)}:${a[e]}`)].join(`,`),message:e,service:`claude-code`,hostname:`claude-code`,env:process.env.USER_TYPE};for(let[e,t]of Object.entries(i))t!=null&&(o[b(e)]=t);N.push(o),N.length>=k?(P&&(clearTimeout(P),P=null),x()):S()}catch(e){c(e)}}function T(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||``,10)||O}var E,D,O,k,A,j,M,N,P,F,I,L,R,z=e((()=>{i(),n(),o(),s(),d(),p(),u(),_(),g(),E=process.env.DATADOG_LOGS_ENDPOINT??``,D=process.env.DATADOG_API_KEY??``,O=15e3,k=100,A=5e3,j=new Set(`tengu_api_error.tengu_api_success.tengu_brief_mode_enabled.tengu_brief_mode_toggled.tengu_brief_send.tengu_cancel.tengu_compact_failed.tengu_exit.tengu_flicker.tengu_init.tengu_model_fallback_triggered.tengu_oauth_error.tengu_oauth_success.tengu_oauth_token_refresh_failure.tengu_oauth_token_refresh_success.tengu_oauth_token_refresh_lock_acquiring.tengu_oauth_token_refresh_lock_acquired.tengu_oauth_token_refresh_starting.tengu_oauth_token_refresh_completed.tengu_oauth_token_refresh_lock_releasing.tengu_oauth_token_refresh_lock_released.tengu_query_error.tengu_session_file_read.tengu_started.tengu_tool_use_error.tengu_tool_use_granted_in_prompt_permanent.tengu_tool_use_granted_in_prompt_temporary.tengu_tool_use_rejected_in_prompt.tengu_tool_use_success.tengu_uncaught_exception.tengu_unhandled_rejection.tengu_voice_recording_started.tengu_voice_toggled.tengu_team_mem_sync_pull.tengu_team_mem_sync_push.tengu_team_mem_sync_started.tengu_team_mem_entries_capped`.split(`.`)),M=[`arch`,`clientType`,`errorType`,`http_status_range`,`http_status`,`kairosActive`,`model`,`platform`,`provider`,`skillMode`,`subscriptionType`,`toolName`,`userBucket`,`userType`,`version`,`versionBase`],N=[],P=null,F=null,I=t(async()=>{if(v()||!E||!D)return F=!1,!1;try{return F=!0,!0}catch(e){return c(e),F=!1,!1}}),L=30,R=t(()=>{let e=a(),t=y(`sha256`).update(e).digest(`hex`);return parseInt(t.slice(0,8),16)%L})}));export{C as n,w as r,z as t};
|
|
@@ -36,4 +36,4 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
|
36
36
|
`),r=n[0]??e.message,i=n.slice(1).filter(e=>e.trim().startsWith(`at `));return i.length<=t?e.stack:[r,...i.slice(0,t)].join(`
|
|
37
37
|
`)}function na(e){let t=Qi(e);return t===`ENOENT`||t===`EACCES`||t===`EPERM`||t===`ENOTDIR`||t===`ELOOP`}function ra(e){let t=Zi(e);if(!e||typeof e!=`object`||!(`isAxiosError`in e)||!e.isAxiosError)return{kind:`other`,message:t};let n=e,r=n.response?.status;return r===401||r===403?{kind:`auth`,status:r,message:t}:n.code===`ECONNABORTED`?{kind:`timeout`,status:r,message:t}:n.code===`ECONNREFUSED`||n.code===`ENOTFOUND`?{kind:`network`,status:r,message:t}:{kind:`http`,status:r,message:t}}var ia,aa,oa,sa,ca,la,ua,da=e((()=>{qi(),s(),ia=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},aa=class extends Error{},oa=class extends Error{constructor(e){super(e),this.name=`AbortError`}},sa=class extends Error{constructor(e,t,n){super(e),c(this,`filePath`,void 0),c(this,`defaultConfig`,void 0),this.name=`ConfigParseError`,this.filePath=t,this.defaultConfig=n}},ca=class extends Error{constructor(e,t,n,r){super(`Shell command failed`),c(this,`stdout`,void 0),c(this,`stderr`,void 0),c(this,`code`,void 0),c(this,`interrupted`,void 0),this.stdout=e,this.stderr=t,this.code=n,this.interrupted=r,this.name=`ShellError`}},la=class extends Error{constructor(e,t){super(e),c(this,`formattedMessage`,void 0),this.formattedMessage=t,this.name=`TeleportOperationError`}},ua=class extends Error{constructor(e,t){super(e),c(this,`telemetryMessage`,void 0),this.name=`TelemetrySafeError`,this.telemetryMessage=t??e}}}));function fa(){return ga}function pa(e,t,n){return Z`JSON.stringify(${e})`,JSON.stringify(e,t,n)}function ma(e,t){return Z`structuredClone(${e})`,structuredClone(e,t)}function ha(e,t,n){if(Z`fs.writeFileSync(${e}, ${t})`,typeof n==`object`&&n&&`flush`in n&&n.flush===!0){let r=typeof n==`object`&&`encoding`in n?n.encoding:void 0,i=typeof n==`object`&&`mode`in n?n.mode:void 0,a;try{a=oe(e,`w`,i),se(a,t,{encoding:r??void 0}),ae(a)}finally{a!==void 0&&ie(a)}}else se(e,t,n)}var ga,Z,_a,va=e((()=>{l(),$a(),(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return process.env.USER_TYPE===`ant`?300:1/0})(),ga={[Symbol.dispose](){}},Z=fa,_a=(e,t)=>(Z`JSON.parse(${e})`,t===void 0?JSON.parse(e):JSON.parse(e,t))}));function ya(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}var ba=e((()=>{}));function xa(e,t){if(t.startsWith(`//`)||t.startsWith(`\\\\`))return{resolvedPath:t,isSymlink:!1,isCanonical:!1};try{let n=e.lstatSync(t);if(n.isFIFO()||n.isSocket()||n.isCharacterDevice()||n.isBlockDevice())return{resolvedPath:t,isSymlink:!1,isCanonical:!1};let r=e.realpathSync(t);return{resolvedPath:r,isSymlink:r!==t,isCanonical:!0}}catch{return{resolvedPath:t,isSymlink:!1,isCanonical:!1}}}function Sa(e,t,n){let{resolvedPath:r}=xa(e,t);return n.has(r)?!0:(n.add(r),!1)}function Ca(e,t){let n=t,r=[];for(;n!==p.dirname(n);){let t;try{t=e.lstatSync(n)}catch{r.unshift(p.basename(n)),n=p.dirname(n);continue}if(t.isSymbolicLink())try{let t=e.realpathSync(n);return r.length===0?t:p.join(t,...r)}catch{let t=e.readlinkSync(n),i=p.isAbsolute(t)?t:p.resolve(p.dirname(n),t);return r.length===0?i:p.join(i,...r)}try{let t=e.realpathSync(n);if(t!==n)return r.length===0?t:p.join(t,...r)}catch{}return}}function wa(e){let t=e;t===`~`?t=f().normalize(`NFC`):t.startsWith(`~/`)&&(t=p.join(f().normalize(`NFC`),t.slice(2)));let n=new Set,r=Ta();if(n.add(t),t.startsWith(`//`)||t.startsWith(`\\\\`))return Array.from(n);try{let e=t,i=new Set;for(let a=0;a<40&&!i.has(e);a++){if(i.add(e),!r.existsSync(e)){if(e===t){let e=Ca(r,t);e!==void 0&&n.add(e)}break}let a=r.lstatSync(e);if(a.isFIFO()||a.isSocket()||a.isCharacterDevice()||a.isBlockDevice()||!a.isSymbolicLink())break;let o=r.readlinkSync(e),s=p.isAbsolute(o)?o:p.resolve(p.dirname(e),o);n.add(s),e=s}}catch{}let{resolvedPath:i,isSymlink:a}=xa(r,t);return a&&i!==t&&n.add(i),Array.from(n)}function Ta(){return Aa}async function Ea(e,t,n){try{var r=ya();let i=r.a(await ue(e,`r`)),a=(await i.stat()).size;if(a<=t)return null;let o=Math.min(a-t,n),s=Buffer.allocUnsafe(o),c=0;for(;c<o;){let{bytesRead:e}=await i.read(s,c,o-c,t+c);if(e===0)break;c+=e}return{content:s.toString(`utf8`,0,c),bytesRead:c,bytesTotal:a}}catch(e){r.e=e}finally{await r.d()}}async function Da(e,t){try{var n=ya();let r=n.a(await ue(e,`r`)),i=(await r.stat()).size;if(i===0)return{content:``,bytesRead:0,bytesTotal:0};let a=Math.max(0,i-t),o=i-a,s=Buffer.allocUnsafe(o),c=0;for(;c<o;){let{bytesRead:e}=await r.read(s,c,o-c,a+c);if(e===0)break;c+=e}return{content:s.toString(`utf8`,0,c),bytesRead:c,bytesTotal:i}}catch(e){n.e=e}finally{await n.d()}}async function*Oa(e){let t=1024*4,n=await ue(e,`r`);try{let e=(await n.stat()).size,r=Buffer.alloc(0),i=Buffer.alloc(t);for(;e>0;){let a=Math.min(t,e);e-=a,await n.read(i,0,a,e);let o=Buffer.concat([i.subarray(0,a),r]),s=o.indexOf(10);if(s===-1){r=o;continue}r=Buffer.from(o.subarray(0,s));let c=o.toString(`utf8`,s+1).split(`
|
|
38
38
|
`);for(let e=c.length-1;e>=0;e--){let t=c[e];t&&(yield t)}}r.length>0&&(yield r.toString(`utf8`))}finally{await n.close()}}var ka,Aa,ja=e((()=>{da(),va(),ba(),ka={cwd(){return process.cwd()},existsSync(e){return Z`fs.existsSync(${e})`,m.existsSync(e)},async stat(e){return ge(e)},async readdir(e){return fe(e,{withFileTypes:!0})},async unlink(e){return ve(e)},async rmdir(e){return he(e)},async rm(e,t){return me(e,t)},async mkdir(e,t){try{await le(e,{recursive:!0,...t})}catch(e){if(Qi(e)!==`EEXIST`)throw e}},async readFile(e,t){return de(e,{encoding:t.encoding})},async rename(e,t){return pe(e,t)},statSync(e){return Z`fs.statSync(${e})`,m.statSync(e)},lstatSync(e){return Z`fs.lstatSync(${e})`,m.lstatSync(e)},readFileSync(e,t){return Z`fs.readFileSync(${e})`,m.readFileSync(e,{encoding:t.encoding})},readFileBytesSync(e){return Z`fs.readFileBytesSync(${e})`,m.readFileSync(e)},readSync(e,t){Z`fs.readSync(${e}, ${t.length} bytes)`;let n;try{n=m.openSync(e,`r`);let r=Buffer.alloc(t.length);return{buffer:r,bytesRead:m.readSync(n,r,0,t.length,0)}}finally{n&&m.closeSync(n)}},appendFileSync(e,t,n){if(Z`fs.appendFileSync(${e}, ${t.length} chars)`,n?.mode!==void 0)try{let r=m.openSync(e,`ax`,n.mode);try{m.appendFileSync(r,t)}finally{m.closeSync(r)}return}catch(e){if(Qi(e)!==`EEXIST`)throw e}m.appendFileSync(e,t)},copyFileSync(e,t){Z`fs.copyFileSync(${e} → ${t})`,m.copyFileSync(e,t)},unlinkSync(e){Z`fs.unlinkSync(${e})`,m.unlinkSync(e)},renameSync(e,t){Z`fs.renameSync(${e} → ${t})`,m.renameSync(e,t)},linkSync(e,t){Z`fs.linkSync(${e} → ${t})`,m.linkSync(e,t)},symlinkSync(e,t,n){Z`fs.symlinkSync(${e} → ${t})`,m.symlinkSync(e,t,n)},readlinkSync(e){return Z`fs.readlinkSync(${e})`,m.readlinkSync(e)},realpathSync(e){return Z`fs.realpathSync(${e})`,m.realpathSync(e).normalize(`NFC`)},mkdirSync(e,t){Z`fs.mkdirSync(${e})`;let n={recursive:!0};t?.mode!==void 0&&(n.mode=t.mode);try{m.mkdirSync(e,n)}catch(e){if(Qi(e)!==`EEXIST`)throw e}},readdirSync(e){return Z`fs.readdirSync(${e})`,m.readdirSync(e,{withFileTypes:!0})},readdirStringSync(e){return Z`fs.readdirStringSync(${e})`,m.readdirSync(e)},isDirEmptySync(e){return Z`fs.isDirEmptySync(${e})`,this.readdirSync(e).length===0},rmdirSync(e){Z`fs.rmdirSync(${e})`,m.rmdirSync(e)},rmSync(e,t){Z`fs.rmSync(${e})`,m.rmSync(e,t)},createWriteStream(e){return m.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return de(e);let n=await ue(e,`r`);try{let{size:e}=await n.stat(),r=Math.min(e,t),i=Buffer.allocUnsafe(r),a=0;for(;a<r;){let{bytesRead:e}=await n.read(i,a,r-a,a);if(e===0)break;a+=e}return a<r?i.subarray(0,a):i}finally{await n.close()}}},Aa=ka})),Ma=t({enableDebugLogging:()=>Na,flushDebugLogs:()=>Ba,getDebugFilePath:()=>Ya,getDebugFilter:()=>qa,getDebugLogPath:()=>Ha,getHasFormattedOutput:()=>Ia,getMinDebugLogLevel:()=>Ga,isDebugMode:()=>Q,isDebugToStdErr:()=>Ja,logAntError:()=>Ua,logForDebugging:()=>Va,setHasFormattedOutput:()=>Fa});function Na(){let e=Q()||process.env.USER_TYPE===`ant`;return Ka=!0,Q.cache.clear?.(),e}function Pa(e){return process.env.USER_TYPE!==`ant`&&!Q()||typeof process>`u`||process.versions===void 0||process.versions.node===void 0?!1:De(e,qa())}function Fa(e){Xa=e}function Ia(){return Xa}async function La(e,t,n,r){e&&await le(t,{recursive:!0}).catch(()=>{}),await ce(n,r),Qa()}function Ra(){}function za(){if(!$){let e=null;$=ye({writeFn:t=>{let n=Ha(),r=te(n),i=e!==r;if(e=r,Q()){if(i)try{Ta().mkdirSync(r)}catch{}try{Ta().appendFileSync(n,t)}catch{try{Ta().mkdirSync(r),Ta().appendFileSync(n,t)}catch{}}Qa();return}Za=Za.then(La.bind(null,i,r,n,t)).catch(Ra)},flushIntervalMs:1e3,maxBufferSize:100,immediateMode:Q()}),xe(async()=>{$?.dispose(),await Za})}return $}async function Ba(){$?.flush(),await Za}function Va(e,{level:t}={level:`debug`}){if(Wa[t]<Wa[Ga()]||!Pa(e))return;Xa&&e.includes(`
|
|
39
|
-
`)&&(e=pa(e));let n=`${new Date().toISOString()} [${t.toUpperCase()}] ${e.trim()}\n`;if(Ja()){ee(n);return}za().write(n)}function Ha(){return Ya()??(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR?re(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR):null)??ne(a(),`debug`,`${u()}.txt`)}function Ua(e,t){process.env.USER_TYPE===`ant`&&t instanceof Error&&t.stack&&Va(`[ANT-ONLY] ${e} stack trace:\n${t.stack}`,{level:`error`})}var Wa,Ga,Ka,Q,qa,Ja,Ya,Xa,$,Za,Qa,$a=e((()=>{r(),l(),be(),we(),ke(),o(),ja(),d(),va(),Wa={verbose:0,debug:1,info:2,warn:3,error:4},Ga=n(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return e&&Object.hasOwn(Wa,e)?e:`debug`}),Ka=!1,Q=n(()=>Ka||i(process.env.DEBUG)||i(process.env.DEBUG_SDK)||process.argv.includes(`--debug`)||process.argv.includes(`-d`)||Ja()||process.argv.some(e=>e.startsWith(`--debug=`))||Ya()!==null),qa=n(()=>{let e=process.argv.find(e=>e.startsWith(`--debug=`));return e?Oe(e.substring(8)):null}),Ja=n(()=>process.argv.includes(`--debug-to-stderr`)),Ya=n(()=>{for(let e=0;e<process.argv.length;e++){let t=process.argv[e];if(t.startsWith(`--debug-file=`))return re(t.substring(13));if(t===`--debug-file`&&e+1<process.argv.length)return re(process.argv[e+1])}return null}),Xa=!1,$=null,Za=Promise.resolve(),Qa=n(async()=>{try{let e=Ha(),t=ne(te(e),`latest`);await ve(t).catch(()=>{}),await _e(e,t)}catch{}})}));export{
|
|
39
|
+
`)&&(e=pa(e));let n=`${new Date().toISOString()} [${t.toUpperCase()}] ${e.trim()}\n`;if(Ja()){ee(n);return}za().write(n)}function Ha(){return Ya()??(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR?re(process.env.CLAUDE_CODE_DEBUG_LOGS_DIR):null)??ne(a(),`debug`,`${u()}.txt`)}function Ua(e,t){process.env.USER_TYPE===`ant`&&t instanceof Error&&t.stack&&Va(`[ANT-ONLY] ${e} stack trace:\n${t.stack}`,{level:`error`})}var Wa,Ga,Ka,Q,qa,Ja,Ya,Xa,$,Za,Qa,$a=e((()=>{r(),l(),be(),we(),ke(),o(),ja(),d(),va(),Wa={verbose:0,debug:1,info:2,warn:3,error:4},Ga=n(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return e&&Object.hasOwn(Wa,e)?e:`debug`}),Ka=!1,Q=n(()=>Ka||i(process.env.DEBUG)||i(process.env.DEBUG_SDK)||process.argv.includes(`--debug`)||process.argv.includes(`-d`)||Ja()||process.argv.some(e=>e.startsWith(`--debug=`))||Ya()!==null),qa=n(()=>{let e=process.argv.find(e=>e.startsWith(`--debug=`));return e?Oe(e.substring(8)):null}),Ja=n(()=>process.argv.includes(`--debug-to-stderr`)),Ya=n(()=>{for(let e=0;e<process.argv.length;e++){let t=process.argv[e];if(t.startsWith(`--debug-file=`))return re(t.substring(13));if(t===`--debug-file`&&e+1<process.argv.length)return re(process.argv[e+1])}return null}),Xa=!1,$=null,Za=Promise.resolve(),Qa=n(async()=>{try{let e=Ha(),t=ne(te(e),`latest`);await ve(t).catch(()=>{}),await _e(e,t)}catch{}})}));export{Re as $,aa as A,Ji as B,_a as C,oa as D,ha as E,Zi as F,qi as G,na as H,Qi as I,Rn as J,Gi as K,ea as L,ua as M,la as N,ia as O,ra as P,b as Q,Yi as R,va as S,Z as T,ta as U,$i as V,Xi as W,Ie as X,Fe as Y,y as Z,xa as _,$a as a,ye as at,ba as b,Ua as c,Ta as d,Be as et,wa as f,Oa as g,Ea as h,Ia as i,Se as it,ca as j,sa as k,Va as l,Sa as m,Na as n,we as nt,Q as o,be as ot,ja as p,Ki as q,Ha as r,xe as rt,Ja as s,Ma as t,x as tt,Fa as u,Da as v,pa as w,ma as x,ya as y,da as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{F as n,S as r,a as i,l as a,w as o,z as s}from"./debug-BrXObCdR.js";import{n as c,r as l}from"./analytics-BotDBGh0.js";var u=t({setCseShimGate:()=>d,toCompatSessionId:()=>f,toInfraSessionId:()=>p});function d(e){m=e}function f(e){return!e.startsWith(`cse_`)||m&&!m()?e:`session_`+e.slice(4)}function p(e){return e.startsWith(`session_`)?`cse_`+e.slice(8):e}var m,h=e((()=>{}));function g(e){return e.replace(w,(e,t,n)=>n.length<T?`"${t}":"[REDACTED]"`:`"${t}":"${`${n.slice(0,8)}...${n.slice(-4)}`}"`)}function _(e){let t=e.replace(/\n/g,`\\n`);return t.length<=C?t:t.slice(0,C)+`... (${t.length} chars)`}function v(e){let t=g(typeof e==`string`?e:o(e));return t.length<=C?t:t.slice(0,C)+`... (${t.length} chars)`}function y(e){let t=n(e);if(e&&typeof e==`object`&&`response`in e){let n=e.response;if(n?.data&&typeof n.data==`object`){let e=n.data,r=typeof e.message==`string`?e.message:typeof e.error==`object`&&e.error&&`message`in e.error&&typeof e.error.message==`string`?e.error.message:void 0;if(r)return`${t}: ${r}`}}return t}function b(e){if(e&&typeof e==`object`&&`response`in e&&e.response&&typeof e.response.status==`number`)return e.response.status}function x(e){if(!(!e||typeof e!=`object`)){if(`message`in e&&typeof e.message==`string`)return e.message;if(`error`in e&&e.error!==null&&typeof e.error==`object`&&`message`in e.error&&typeof e.error.message==`string`)return e.error.message}}function S(e,t,n){t&&a(t),l(`tengu_bridge_repl_skipped`,{reason:e,...n!==void 0&&{v2:n}})}var C,w,T,E=e((()=>{c(),i(),s(),r(),C=2e3,w=RegExp(`"(${[`session_ingress_token`,`environment_secret`,`access_token`,`secret`,`token`].join(`|`)})"\\s*:\\s*"([^"]*)"`,`g`),T=16}));export{b as a,h as c,f as d,p as f,x as i,u as l,_ as n,E as o,y as r,S as s,v as t,d as u};
|
|
@@ -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"./DesktopHandoff-
|
|
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"./DesktopHandoff-Blg1TVut.js";async function a(e){return(0,o.jsx)(i,{onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{i as r,o as i,t as a}from"./cliLaunch-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{i as r,o as i,t as a}from"./cliLaunch-BkPAatcs.js";import{dirname as o}from"path";import{closeSync as s,createReadStream as c,mkdirSync as l,openSync as u,readSync as d,statSync as f,unwatchFile as p,watchFile as m}from"fs";import{createInterface as h}from"readline";async function g(e){let t=0;try{if(t=f(e).size,t>0){let n=h({input:c(e,{start:0,end:t-1})});for await(let e of n)process.stdout.write(e+`
|
|
2
2
|
`)}}catch{}return console.log(`
|
|
3
3
|
[tail] Watching for new output... (Ctrl+C to detach)
|
|
4
4
|
`),new Promise(n=>{let r=()=>{p(e),process.removeListener(`SIGINT`,r),console.log(`
|
|
@@ -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{a as r,l as i}from"./debug-BrXObCdR.js";import{_ as a,p as o}from"./git-Do0wJvux.js";function s(){p.clear()}async function c(){let e=await l();return!e||e.host!==`github.com`?null:`${e.owner}/${e.name}`}async function l(){let e=n();if(p.has(e))return p.get(e)??null;try{let t=await o();if(i(`Git remote URL: ${t}`),!t)return i(`No git remote URL found`),p.set(e,null),null;let n=u(t);return i(`Parsed repository: ${n?`${n.host}/${n.owner}/${n.name}`:null} from URL: ${t}`),p.set(e,n),n}catch(t){return i(`Error detecting repository: ${t}`),p.set(e,null),null}}function u(e){let t=e.trim(),n=t.match(/^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/);if(n?.[1]&&n[2]&&n[3])return f(n[1])?{host:n[1],owner:n[2],name:n[3]}:null;let r=t.match(/^(https?|ssh|git):\/\/(?:[^@]+@)?([^/:]+(?::\d+)?)\/([^/]+)\/([^/]+?)(?:\.git)?$/);if(r?.[1]&&r[2]&&r[3]&&r[4]){let e=r[1],t=r[2],n=t.split(`:`)[0]??``;return f(n)?{host:e===`https`||e===`http`?t:n,owner:r[3],name:r[4]}:null}return null}function d(e){let t=e.trim(),n=u(t);if(n)return n.host===`github.com`?`${n.owner}/${n.name}`:null;if(!t.includes(`://`)&&!t.includes(`@`)&&t.includes(`/`)){let e=t.split(`/`);if(e.length===2&&e[0]&&e[1]){let t=e[1].replace(/\.git$/,``);return`${e[0]}/${t}`}}return i(`Could not parse repository from: ${t}`),null}function f(e){if(!e.includes(`.`))return!1;let t=e.split(`.`).pop();return t?/^[a-zA-Z]+$/.test(t):!1}var p,m=e((()=>{t(),r(),a(),p=new Map}));export{d as a,m as i,c as n,u as o,l as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,o as n}from"./detectRepository-BPr0VWNO.js";t();export{e as parseGitHubRepository,n as parseGitRemote};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";var n,r;e((()=>{n=t(),r=async(e,t)=>{let{DiffDialog:r}=await import(`./DiffDialog-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";var n,r;e((()=>{n=t(),r=async(e,t)=>{let{DiffDialog:r}=await import(`./DiffDialog-CUEpuocY.js`);return(0,n.jsx)(r,{messages:t.messages,onDone:e})}}))();export{r 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{o as a,s as o}from"./log-BMCygSzM.js";import{n as s,t as c}from"./index.min-D75yiGLN.js";import{i as l,n as u}from"./path-D5U-tm91.js";import{basename as d,dirname as f,join as p,sep as m}from"path";function h(e,t){if(!e)return{directory:t||n(),prefix:``};let r=u(e,t);return e.endsWith(`/`)||e.endsWith(m)?{directory:r,prefix:``}:{directory:f(r),prefix:d(e)}}async function g(e){let t=C.get(e);if(t)return t;try{let t=(await r().readdir(e)).filter(e=>e.isDirectory()&&!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:`directory`})).slice(0,100);return C.set(e,t),t}catch(e){return o(e),[]}}async function _(e,t={}){let{basePath:r=n(),maxResults:i=10}=t,{directory:a,prefix:o}=h(e,r),s=await g(a),c=o.toLowerCase();return s.filter(e=>e.name.toLowerCase().startsWith(c)).slice(0,i).map(e=>({id:e.path,displayText:e.name+`/`,description:`directory`,metadata:{type:`directory`}}))}function v(e){return e.startsWith(`~/`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`)||e===`~`||e===`.`||e===`..`}async function y(e,t=!1){let n=`${e}:${t}`,i=w.get(n);if(i)return i;try{let i=(await r().readdir(e)).filter(e=>t||!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:t.isDirectory()?`directory`:`file`})).sort((e,t)=>e.type===`directory`&&t.type!==`directory`?-1:e.type!==`directory`&&t.type===`directory`?1:e.name.localeCompare(t.name)).slice(0,100);return w.set(n,i),i}catch(e){return o(e),[]}}async function b(e,t={}){let{basePath:r=n(),maxResults:i=10,includeFiles:a=!0,includeHidden:o=!1}=t,{directory:s,prefix:c}=h(e,r),l=await y(s,o),u=c.toLowerCase(),d=l.filter(e=>!a&&e.type===`file`?!1:e.name.toLowerCase().startsWith(u)).slice(0,i),f=e.includes(`/`)||e.includes(m),p=``;if(f){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(m),r=Math.max(t,n);p=e.substring(0,r+1)}return(p.startsWith(`./`)||p.startsWith(`.`+m))&&(p=p.slice(2)),d.map(e=>{let t=p+e.name;return{id:t,displayText:e.type===`directory`?t+`/`:t,metadata:{type:e.type}}})}var x,S,C,w,T=e((()=>{s(),t(),i(),a(),l(),x=500,S=300*1e3,C=new c({max:x,ttl:S}),w=new c({max:x,ttl:S})}));export{v as i,b as n,T as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Doctor-DlE1Mbb9.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gn as n,Gt as r,I as i,P as a,fi as o,mt as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gn as n,Gt as r,I as i,P as a,fi as o,mt as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{BO as d,DO as f,EO as p,JS as m,MO as h,NO as g,XS as _,kO as v,qS as y}from"./loadAgentsDir-DrDu5yYy.js";import{g as b,y as x}from"./settings-DfWP5y6X.js";import{n as S,r as C}from"./analytics-BotDBGh0.js";import{u as w}from"./referral-DrebVwqx.js";import{n as T,t as E}from"./useMainLoopModel-DegH12LZ.js";function D(e){return typeof e==`string`&&e!==`ultracode`&&A.includes(e)}function O(e){if(e!=null&&typeof e!=`number`&&D(e))return e}function ee(e){let t=A.indexOf(e);return t<=0?A[0]:A[t-1]}function te(e){let t=A.indexOf(e);return t===-1||t>=A.length-1?A[A.length-1]:A[t+1]}function k(e){return e===`ultracode`}function ne(e){let t=O(e.envOverride);return t===void 0?e.displayed:t}function re(e,t){if(k(e))return{kind:`ultracode-hint`,message:j};let n=t(e);return{kind:`apply`,message:n.message,effortUpdate:n.effortUpdate}}var A,j,M,ie=e((()=>{A=[`low`,`medium`,`high`,`xhigh`,`max`,`ultracode`],j=`ultracode is not an effort level. Use /ultracode <context> to start a multi-agent workflow.`,M=`Effort unchanged.`}));function ae(e){let[t,n]=s(e?N:null);return[t,e?n:0]}var N,oe=e((()=>{l(),N=60}));function se(e){if(!/^#[0-9a-fA-F]{6}$/.test(e))return{h:0,s:0,l:0};let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(1-Math.abs(2*o-1)),l;return l=i===t?60*((n-r)/s%6):i===n?60*((r-t)/s+2):60*((t-n)/s+4),l<0&&(l+=360),{h:l,s:c,l:o}}function ce(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=r/60,o=i*(1-Math.abs(a%2-1)),s=0,c=0,l=0;a<1?(s=i,c=o):a<2?(s=o,c=i):a<3?(c=i,l=o):a<4?(c=o,l=i):a<5?(s=o,l=i):(s=i,l=o);let u=n-i/2,d=e=>Math.round((e+u)*255).toString(16).padStart(2,`0`);return`#${d(s)}${d(c)}${d(l)}`}function P(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e)||t===0)return e;let{h:n,s:r,l:i}=se(e);return ce(n+t,r,i)}function le(e){return e*I%360}function ue(e,t=0){let n=e<0?0:e>1?1:e,r=Math.min(F.length-1,Math.floor(n*F.length)),i=F[r];return t===0?i:P(i,t)}function de(e){let{y:t,width:n,time:r,sourceX:i,sourceY:a}=e;if(n<=0)return[];let o=le(r),s=Array(n);for(let e=0;e<n;e++){let n=e-i,c=(t-a)*1.5,l=Math.sqrt(n*n+c*c),u=l*.35-r*.004,d=(Math.sin(u)+1)/2*Math.max(0,1-l/90);s[e]={char:R,color:ue(d,o)}}return s}function fe(e,t){let n=e.map(e=>({...e}));for(let e of t){let t=e.x;if(!(t>=n.length))for(let r=0;r<e.text.length;r++){let i=t+r;if(!(i<0)){if(i>=n.length)break;n[i]={char:e.text[r],color:e.color??n[i].color}}}}return n}function pe(e){if(e.length===0)return[];let t=[],n={text:e[0].char,color:e[0].color};for(let r=1;r<e.length;r++){let i=e[r];i.color===n.color?n.text+=i.char:(t.push(n),n={text:i.char,color:i.color})}return t.push(n),t}function me(e,t){if(e===`transparent`)return L;let n=t<0?0:t>1?1:t;if(n<=.01)return L;if(!/^#[0-9a-fA-F]{6}$/.test(e))return e;let r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return`#${Math.round(r*n).toString(16).padStart(2,`0`)}${Math.round(i*n).toString(16).padStart(2,`0`)}${Math.round(a*n).toString(16).padStart(2,`0`)}`}function he(e,t){return e.map(e=>({char:e.char,color:me(e.color,t)}))}var F,I,L,R,ge=e((()=>{F=[`#1a1f3a`,`#1f2543`,`#252c55`,`#2e3870`,`#3a4582`,`#4a5bb0`,`#5769F7`],I=.03,L=`transparent`,R=` `}));function _e(e){let t=e-2;return t<=U*A.length?U:Math.floor(t/A.length)}function ve(e){let t=Math.max(0,Math.floor((e-9)/2));return e*(A.length-1)+t+4}function z(e,t,n){return n*e+Math.max(0,Math.floor((n-t)/2))}function ye({appStateEffort:e,onDone:t}){let n=_(),o=T(),{columns:s}=c(),l=V.useMemo(()=>_e(s),[s]),u=l*A.length,d=V.useMemo(()=>ve(l),[l]),m=f(),h=ne({envOverride:m,appStateEffort:e,displayed:p(o,e)}),[g,v]=V.useState(h),[y,b]=V.useState(!1),x=g===`ultracode`,[S,C]=V.useState(0),w=x||S>.001,[E,D]=ae(w);V.useEffect(()=>{if(!w)return;let e=+!!x;C(t=>{if(t===e)return t;let n=e>t?t+J:t-J;return e>t?Math.min(e,n):Math.max(e,n)})},[D,x,w]),r({"effortPanel:decrease":()=>v(e=>ee(e)),"effortPanel:increase":()=>v(e=>te(e)),"effortPanel:home":()=>v(`low`),"effortPanel:end":()=>v(`ultracode`),"effortPanel:confirm":V.useCallback(()=>{if(y)return;b(!0);let e=re(g,Z);e.kind===`apply`&&e.effortUpdate&&n(t=>({...t,effortValue:e.effortUpdate.value})),t(e.message)},[g,y,t,n]),"effortPanel:cancel":V.useCallback(()=>{y||(b(!0),t(M))},[y,t])},{context:`EffortPanel`});let O=m!=null,k=process.env.CLAUDE_CODE_EFFORT_LEVEL,j=V.useCallback((e,t)=>pe(he(fe(de({y:e+Y,width:u,time:D,sourceX:d,sourceY:Y}),t),S)),[D,S,u,d]);return(0,H.jsxs)(i,{ref:E,flexDirection:`column`,paddingX:1,width:u+2,children:[(0,H.jsx)(a,{bold:!0,color:`suggestion`,children:`Effort`}),O&&(0,H.jsx)(a,{color:`warning`,children:`⚠ CLAUDE_CODE_EFFORT_LEVEL=${k} overrides this session`}),w?(0,H.jsx)(xe,{renderRow:j,cursor:g,fade:S,segment:l,panelWidth:u,time:D}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(be,{cursor:g,segment:l,panelWidth:u}),(0,H.jsx)(i,{marginTop:1,children:(0,H.jsx)(a,{color:`subtle`,children:`←/→ adjust · Enter confirm · Esc cancel`})})]})]})}function be({cursor:e,segment:t,panelWidth:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(i,{marginTop:1,flexDirection:`row`,justifyContent:`space-between`,children:[(0,H.jsx)(a,{color:`suggestion`,children:`Faster`}),(0,H.jsx)(a,{color:`suggestion`,children:`Smarter`})]}),(0,H.jsx)(a,{color:`subtle`,children:`─`.repeat(n)}),(0,H.jsx)(i,{flexDirection:`row`,children:A.map(n=>(0,H.jsx)(i,{width:t,justifyContent:`center`,children:(0,H.jsx)(a,{bold:!0,color:e===n?`suggestion`:`subtle`,children:e===n?`▲`:` `})},`cursor-${n}`))}),(0,H.jsx)(i,{flexDirection:`row`,children:A.map(n=>(0,H.jsx)(i,{width:t,justifyContent:`center`,children:(0,H.jsx)(a,{bold:e===n,color:e===n?`suggestion`:`subtle`,children:n})},`label-${n}`))}),(0,H.jsxs)(i,{flexDirection:`row`,children:[(0,H.jsx)(i,{width:t*(A.length-1)}),(0,H.jsx)(i,{width:t,justifyContent:`center`,children:(0,H.jsx)(a,{color:`subtle`,children:W})})]})]})}function xe({renderRow:e,cursor:t,segment:n,panelWidth:r,time:i}){let o=A.indexOf(t),s=A.length-1,c=le(i),l=P(q,c),u=P(G,c),d=P(K,c),f={text:`Faster`,x:0,color:l},p={text:`Smarter`,x:r-7,color:l},m={text:`─`.repeat(r),x:0,color:d},h={text:`▲`,x:z(o,1,n),color:l},g=A.map((e,r)=>({text:e,x:z(r,e.length,n),color:e===t?u:d})),_={text:W,x:z(s,17,n),color:d};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(B,{segments:e(-4,[])}),(0,H.jsx)(B,{segments:e(-3,[f,p])}),(0,H.jsx)(B,{segments:e(-2,[m])}),(0,H.jsx)(B,{segments:e(-1,[h])}),(0,H.jsx)(B,{segments:e(0,g)}),(0,H.jsx)(B,{segments:e(1,[_])}),(0,H.jsx)(B,{segments:e(2,[])}),(0,H.jsx)(a,{color:K,children:`←/→ adjust · Enter confirm · Esc cancel`})]})}function B({segments:e}){let t=[];for(let n of e){let e=``,r=null,i=()=>{e===``||r===null||(t.push({text:e,kind:r?`space`:`text`,color:n.color}),e=``,r=null)};for(let t of n.text){let n=t===` `;r===null?(e=t,r=n):n===r?e+=t:(i(),e=t,r=n)}i()}return(0,H.jsx)(i,{flexDirection:`row`,children:t.map((e,t)=>e.kind===`space`?e.color===`transparent`?(0,H.jsx)(n,{children:e.text},t):(0,H.jsx)(n,{backgroundColor:e.color,children:e.text},t):(0,H.jsx)(a,{color:e.color,bold:!0,children:e.text},t))})}var V,H,U,W,G,K,q,J,Y,Se=e((()=>{V=t(o(),1),l(),w(),h(),ie(),$(),E(),y(),oe(),ge(),H=u(),U=12,W=`xhigh + workflows`,G=`#5769F7`,K=`#7a8eff`,q=`#5769F7`,J=.2,Y=0}));function Ce(e){let t=d(e);if(t!==void 0){let e=x(`userSettings`,{effortLevel:t});if(e.error)return{message:`Failed to set effort level: ${e.error.message}`}}C(`tengu_effort_command`,{effort:e});let n=f();if(n!==void 0&&n!==e){let n=process.env.CLAUDE_CODE_EFFORT_LEVEL;return t===void 0?{message:`Not applied: CLAUDE_CODE_EFFORT_LEVEL=${n} overrides effort this session, and ${e} is session-only (nothing saved)`,effortUpdate:{value:e}}:{message:`CLAUDE_CODE_EFFORT_LEVEL=${n} overrides this session — clear it and ${e} takes over`,effortUpdate:{value:e}}}let r=v(e);return{message:`Set effort level to ${e}${t===void 0?` (this session only)`:``}: ${r}`,effortUpdate:{value:e}}}function X(e,t){let n=f(),r=n===null?void 0:n??e;return r===void 0?{message:`Effort level: auto (currently ${p(t,e)})`}:{message:`Current effort level: ${r} (${v(r)})`}}function we(){let e=x(`userSettings`,{effortLevel:void 0});return e.error?{message:`Failed to set effort level: ${e.error.message}`}:(C(`tengu_effort_command`,{effort:`auto`}),f()==null?{message:`Effort level set to auto`,effortUpdate:{value:void 0}}:{message:`Cleared effort from settings, but CLAUDE_CODE_EFFORT_LEVEL=${process.env.CLAUDE_CODE_EFFORT_LEVEL} still controls this session`,effortUpdate:{value:void 0}})}function Z(e){let t=e.toLowerCase();return t===`auto`||t===`unset`?we():g(t)?Ce(t):{message:`Invalid argument: ${e}. Valid options are: low, medium, high, max, auto`}}function Te({onDone:e}){let{message:t}=X(m(e=>e.effortValue),T());return e(t),null}function Ee({result:e,onDone:t}){let n=_(),{effortUpdate:r,message:i}=e;return ke.useEffect(()=>{r&&n(e=>({...e,effortValue:r.value})),t(i)},[n,r,i,t]),null}async function De(e,t,n){if(n=n?.trim()||``,Ae.includes(n)){e(`Usage: /effort [low|medium|high|xhigh|max|auto]
|
|
2
2
|
|
|
3
3
|
Effort levels:
|
|
4
4
|
- low: Quick, straightforward implementation
|
|
@@ -6,4 +6,4 @@ Effort levels:
|
|
|
6
6
|
- high: Comprehensive implementation with extensive testing
|
|
7
7
|
- xhigh: Extended reasoning beyond high, short of max; including ChatGPT Codex models
|
|
8
8
|
- max: Maximum capability with deepest reasoning; maps to xhigh for ChatGPT Codex models
|
|
9
|
-
- auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?n===`current`||n===`status`?(0,Q.jsx)(Te,{onDone:e}):(0,Q.jsx)(Oe,{onDone:e}):(0,Q.jsx)(Ee,{result:Z(n),onDone:e})}function Oe({onDone:e}){return(0,Q.jsx)(ye,{appStateEffort:
|
|
9
|
+
- auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?n===`current`||n===`status`?(0,Q.jsx)(Te,{onDone:e}):(0,Q.jsx)(Oe,{onDone:e}):(0,Q.jsx)(Ee,{result:Z(n),onDone:e})}function Oe({onDone:e}){return(0,Q.jsx)(ye,{appStateEffort:m(e=>e.effortValue),onDone:e})}var ke,Q,Ae,$=e((()=>{ke=t(o(),1),Se(),E(),S(),y(),h(),b(),Q=u(),Ae=[`help`,`-h`,`--help`]}));$();export{De as call,Z as executeEffort,X as showCurrentEffort};
|