@readmagic/workmate 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-BgNp7glC.js → AddWorkspaceDirectory-BTC7FPqM.js} +1 -1
- package/dist/chunks/{App-Coboqa8H.js → App-DOm71vtY.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CYpBbj0k.js → ApproveApiKey-9YQzwrrC.js} +1 -1
- package/dist/chunks/ApproveApiKey-LPrZMlgU.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DxKsTdqj.js → AssistantSessionChooser-CnYfFWrx.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-D_UHm7xo.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-Cx3QGFz-.js → BypassPermissionsModeDialog-DAq-qbqC.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog--w2zWWEn.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BAK9fxwg.js → ClaudeMdExternalIncludesDialog-CyvidoR3.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BXdC6j3_.js +1 -0
- package/dist/chunks/{DesktopHandoff-BsHgLlTy.js → DesktopHandoff-gRvy-WlW.js} +1 -1
- package/dist/chunks/{DiffDialog-BgTW2Znv.js → DiffDialog-CdfVTgOx.js} +2 -2
- package/dist/chunks/Doctor-BuiYwjAS.js +1 -0
- package/dist/chunks/Doctor-DKlHJBXq.js +3 -0
- package/dist/chunks/ExitFlow-rExuBL3w.js +2 -0
- package/dist/chunks/Feedback-gGpjUC_F.js +2 -0
- package/dist/chunks/{Grove-Dsi4yU08.js → Grove-CD769Wvw.js} +1 -1
- package/dist/chunks/Grove-ENfM8hC6.js +1 -0
- package/dist/chunks/{HybridTransport-8qA64lCx.js → HybridTransport-kN1jmg26.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-CAZ1z5WG.js → InvalidConfigDialog-BpJub73a.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-D82Qk_MR.js → InvalidSettingsDialog-DzOp3Ihx.js} +1 -1
- package/dist/chunks/MCPConnectionManager-CaBvO7NB.js +1 -0
- package/dist/chunks/{McpParsingWarnings-8ZueNqAd.js → McpParsingWarnings-Cc6FWyU4.js} +1 -1
- package/dist/chunks/MessageSelector-DOB1S2-O.js +3 -0
- package/dist/chunks/Messages-Clihwd2F.js +11 -0
- package/dist/chunks/{Onboarding-CUztnbbv.js → Onboarding-D00lTweB.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-DSgrZvMv.js → OverageCreditUpsell-B-Bf_-UX.js} +1 -1
- package/dist/chunks/PluginSettings-DUxj_oAg.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-IaihWay3.js → PromptInputFooterSuggestions-MwS_cExV.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-okS2rQ4k.js → PromptInputHelpMenu-V2dEpzhC.js} +1 -1
- package/dist/chunks/QueryEngine-BLcPQYq_.js +1 -0
- package/dist/chunks/{REPL-Dto012J0.js → REPL-B_E07dnf.js} +44 -44
- package/dist/chunks/REPL-BhURgntS.js +1 -0
- package/dist/chunks/{RemoteCallout-C_UIYnuT.js → RemoteCallout-ChCjmgw1.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-CuSSHAXN.js → RemoteSessionManager-B43isWQs.js} +2 -2
- package/dist/chunks/ResumeConversation-DaQ9n8_C.js +1 -0
- package/dist/chunks/{SSETransport-Chj_yfPv.js → SSETransport-h43pQVlJ.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-DSq7beKs.js +1 -0
- package/dist/chunks/Settings-CNsaWv8g.js +2 -0
- package/dist/chunks/{TeleportProgress-DP1a8jit.js → TeleportProgress-QtJrXSCX.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B6sTwXuZ.js → TeleportRepoMismatchDialog-D-HVj-A6.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-CKUuRQSG.js → TeleportResumeWrapper-C6sbzJsJ.js} +1 -1
- package/dist/chunks/{ThemePicker-Dyq1YVhb.js → ThemePicker-CqPCp5Hs.js} +1 -1
- package/dist/chunks/TrustDialog-CeVwxDlZ.js +1 -0
- package/dist/chunks/{ValidationErrorsList-DUNh4BNa.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
- package/dist/chunks/{WelcomeV2-TPbOXGrO.js → WelcomeV2-DNiXQ5ES.js} +1 -1
- package/dist/chunks/{add-dir-Bf_5tCeR.js → add-dir-V3xjklnJ.js} +1 -1
- package/dist/chunks/{agentDisplay-CCeYiAta.js → agentDisplay-BuiwcrQi.js} +1 -1
- package/dist/chunks/{agents-Bt72Gz1v.js → agents-D7um1IXM.js} +7 -7
- package/dist/chunks/{agents-T8xHY5Wk.js → agents-ZY6IaVE7.js} +1 -1
- package/dist/chunks/{allErrors-CDWTJcMw.js → allErrors-CHVdQ3fT.js} +1 -1
- package/dist/chunks/{ant-DRF-v5bA.js → ant-D66LZCap.js} +1 -1
- package/dist/chunks/api-C-rOQY-l.js +1 -0
- package/dist/chunks/api-Dmn7DUgU.js +1 -0
- package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
- package/dist/chunks/{asciicast-CQJlNTae.js → asciicast-CbAjUHT_.js} +4 -4
- package/dist/chunks/{assistant-z1ojxEET.js → assistant-CYF7ch7C.js} +1 -1
- package/dist/chunks/auth-C4Rvit2q.js +1 -0
- package/dist/chunks/auth-Cj7EX1eG.js +1 -0
- package/dist/chunks/auth-DAxGNCIR.js +15 -0
- package/dist/chunks/{autoMode-DW_H3i37.js → autoMode-TysBQkU_.js} +5 -5
- package/dist/chunks/{autonomy-OxhciwYa.js → autonomy-CNEbT-t_.js} +7 -7
- package/dist/chunks/{autonomy-46hnmyAi.js → autonomy-k3QPea5z.js} +1 -1
- package/dist/chunks/{autonomyPanel-CTEjq0Bd.js → autonomyPanel-DiztRblF.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-Cpxq4krt.js → backgroundHousekeeping-C9m4tiFi.js} +3 -3
- package/dist/chunks/backgroundHousekeeping-DQjzXBe0.js +1 -0
- package/dist/chunks/{banner-BVkLvJiB.js → banner-CWkrK10u.js} +1 -1
- package/dist/chunks/bg-B0iMGM9C.js +1 -0
- package/dist/chunks/{bg-zWGqkcST.js → bg-WnYN5ifx.js} +2 -2
- package/dist/chunks/{branch-DJzijRGm.js → branch-_NBgDfrK.js} +1 -1
- package/dist/chunks/{bridge-Dpr2AWpc.js → bridge-DpmFl8p8.js} +2 -2
- package/dist/chunks/{bridgeConfig-DDF3teRE.js → bridgeConfig-DMBOO3gW.js} +1 -1
- package/dist/chunks/bridgeConfig-DsI5d0s7.js +1 -0
- package/dist/chunks/bridgeEnabled-DZzlF2d8.js +1 -0
- package/dist/chunks/{bridgeEnabled-D4JDZd0y.js → bridgeEnabled-FjPuA7zx.js} +1 -1
- package/dist/chunks/bridgeMain-BppY0KW3.js +68 -0
- package/dist/chunks/bridgeMain-BrY4tkF6.js +1 -0
- package/dist/chunks/bridgeMessaging-N5zlzCCr.js +1 -0
- package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
- package/dist/chunks/{browser-BKiu1max.js → browser-BmZuQom6.js} +1 -1
- package/dist/chunks/{btw-DG9CCeq4.js → btw-BFRje_Zi.js} +1 -1
- package/dist/chunks/caches-BBLH8G1I.js +1 -0
- package/dist/chunks/{caches-BB5_91gU.js → caches-CcfPJ4_A.js} +2 -2
- package/dist/chunks/ccrClient-q2JCVCU2.js +1 -0
- package/dist/chunks/{claudeDesktop-9xfIgkzE.js → claudeDesktop-Cx31Ugjp.js} +1 -1
- package/dist/chunks/{clear-ueMvDelv.js → clear-CxY7W5Wt.js} +1 -1
- package/dist/chunks/{cliLaunch-BJ9o-rIV.js → cliLaunch-BkPAatcs.js} +1 -1
- package/dist/chunks/client-CtVu3BLD.js +1 -0
- package/dist/chunks/{color-B0-MIfsq.js → color-DOWhfjnA.js} +1 -1
- package/dist/chunks/commands-BWw1sQeH.js +1 -0
- package/dist/chunks/{commitAttribution-DKun9CeU.js → commitAttribution-CLbEIaRJ.js} +2 -2
- package/dist/chunks/commitAttribution-DIT_s0vY.js +1 -0
- package/dist/chunks/compact-CaOnQVkH.js +2 -0
- package/dist/chunks/{completionCache-CdHCuiqq.js → completionCache-MN3_MqK8.js} +2 -2
- package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
- package/dist/chunks/config-DiT2Z8dY.js +3 -0
- package/dist/chunks/config-DmPGzNmi.js +1 -0
- package/dist/chunks/config-HHTwEsWp.js +1 -0
- package/dist/chunks/{context-DBswG0EY.js → context-B2OvKo2t.js} +1 -1
- package/dist/chunks/context-noninteractive-BilCSCV1.js +1 -0
- package/dist/chunks/{context-noninteractive-CTvyNimw.js → context-noninteractive-BuGxX3YL.js} +2 -2
- package/dist/chunks/conversation-BWXf3un9.js +1 -0
- package/dist/chunks/conversation-awh8AwwL.js +1 -0
- package/dist/chunks/{createSSHSession-BdO35H6o.js → createSSHSession-C-c7I5iJ.js} +5 -5
- package/dist/chunks/{createSession-Br1g8qSD.js → createSession-D_fIDqgc.js} +1 -1
- package/dist/chunks/createSession-Hvpx3Le7.js +1 -0
- package/dist/chunks/crossProjectResume-_XjvSXA3.js +40 -0
- package/dist/chunks/{daemon-BQiSFjc-.js → daemon-YtZbMQtn.js} +1 -1
- package/dist/chunks/datadog-Ed8emSFA.js +1 -0
- package/dist/chunks/{debug-DiuXEmUq.js → debug-BrXObCdR.js} +1 -1
- package/dist/chunks/{debugUtils-3YYWvb3H.js → debugUtils-NO5KtXqi.js} +1 -1
- package/dist/chunks/{desktop-W7SA8BFk.js → desktop-D_ofPlyi.js} +1 -1
- package/dist/chunks/{detached-Cv9gAylK.js → detached-TYk4hMFj.js} +1 -1
- package/dist/chunks/{detectRepository-B1PMTLAU.js → detectRepository-BPr0VWNO.js} +1 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
- package/dist/chunks/{diff-CMtRjFUb.js → diff-CUAgBDu1.js} +1 -1
- package/dist/chunks/{directoryCompletion-CeV63gvu.js → directoryCompletion-CW2ckkQg.js} +1 -1
- package/dist/chunks/doctor-CkdQ7Fv7.js +1 -0
- package/dist/chunks/{effort-BAlVDBHq.js → effort-DCgooYMY.js} +2 -2
- package/dist/chunks/{entry-DLqeVq5C.js → entry-Bh0gPOAo.js} +4 -4
- package/dist/chunks/envLessBridgeConfig-DJHZAlU-.js +1 -0
- package/dist/chunks/envLessBridgeConfig-sxodu0xO.js +1 -0
- package/dist/chunks/esm-B62dCLgf.js +1 -0
- package/dist/chunks/{execFileNoThrow-DResQRvR.js → execFileNoThrow-D244NytW.js} +1 -1
- package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
- package/dist/chunks/exit-CFJR3NfE.js +1 -0
- package/dist/chunks/extra-usage-CjaHpu8y.js +1 -0
- package/dist/chunks/extra-usage-D1Y-3OWQ.js +1 -0
- package/dist/chunks/{extra-usage-core-Dh4rVUI-.js → extra-usage-core-B6ga8Rni.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-D4Ya5KPm.js → extra-usage-noninteractive-Dc9AndId.js} +1 -1
- package/dist/chunks/{extraUsage-DtWi8E78.js → extraUsage-2DwLEr26.js} +1 -1
- package/dist/chunks/extractMemories-C3qrwpu2.js +1 -0
- package/dist/chunks/{fast-DkUxqWhE.js → fast-CW_NsL0x.js} +1 -1
- package/dist/chunks/fast-D3CPmUX4.js +1 -0
- package/dist/chunks/{feedback-Cn7Sbqxa.js → feedback-BpRorTAC.js} +1 -1
- package/dist/chunks/{file-BZriE-XU.js → file-DcZWPH2V.js} +5 -5
- package/dist/chunks/firstPartyEventLogger-CuUiNdj8.js +5 -0
- package/dist/chunks/firstPartyEventLogger-DPUQnc6J.js +1 -0
- package/dist/chunks/{flushGate-ebqQZF1t.js → flushGate-BltVae97.js} +1 -1
- package/dist/chunks/gemini-YyIxfveQ.js +1 -0
- package/dist/chunks/generateRecap-tx4wLIkI.js +1 -0
- package/dist/chunks/{generateSessionName-DEAw5x_h.js → generateSessionName-BkDigIN8.js} +1 -1
- package/dist/chunks/{genericProcessUtils-DO7Fy0RJ.js → genericProcessUtils-CdQTApYX.js} +1 -1
- package/dist/chunks/git-CbcnOf0E.js +1 -0
- package/dist/chunks/git-Do0wJvux.js +6 -0
- package/dist/chunks/{githubRepoPathMapping-Tt-LdYFZ.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
- package/dist/chunks/{goal-DCaI1NPN.js → goal-DZrD4puM.js} +3 -3
- package/dist/chunks/{grok-CKlngG3b.js → grok-BZf7W_hL.js} +1 -1
- package/dist/chunks/{grove-DSWe6psK.js → grove-CFBPplP6.js} +2 -2
- package/dist/chunks/{heapdump-OVbV05On.js → heapdump-DWc3Z2NO.js} +5 -5
- package/dist/chunks/{help-CRtX5VX9.js → help-pap9jNUJ.js} +1 -1
- package/dist/chunks/{hooks-tpf90xd5.js → hooks-Bmat0L6A.js} +2 -2
- package/dist/chunks/hooks-cCAzfabs.js +1 -0
- package/dist/chunks/{hostGuard-t7QfbijF.js → hostGuard-C5xydXZI.js} +1 -1
- package/dist/chunks/inboundAttachments-DZgSqDwY.js +1 -0
- package/dist/chunks/inboundAttachments-DkfNHtF9.js +1 -0
- package/dist/chunks/initReplBridge-myzllvlk.js +1 -0
- package/dist/chunks/install-D4jmHjmk.js +1 -0
- package/dist/chunks/{instrumentation--Sx0y1Gk.js → instrumentation-Nqgm1SMw.js} +6 -6
- package/dist/chunks/{job-D7B35Usp.js → job-CT9bcgPb.js} +1 -1
- package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
- package/dist/chunks/keybindings-DETOn3qJ.js +2 -0
- package/dist/chunks/{language-8Rnu_qxl.js → language-BA5WprZv.js} +1 -1
- package/dist/chunks/language-BbaOTWm3.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-CNPkOVzu.js → launchAgentsPlatform-CuRQgd2Q.js} +1 -1
- package/dist/chunks/{launchLocalMemory-BxmDhENs.js → launchLocalMemory-CRMqifzn.js} +2 -2
- package/dist/chunks/{launchLocalVault-DQlTGA-g.js → launchLocalVault-DlKX_oDE.js} +3 -3
- package/dist/chunks/{launchMemoryStores-EYAwxI8i.js → launchMemoryStores-CN0ecWpP.js} +1 -1
- package/dist/chunks/{launchOnboarding-CTu5Zf4E.js → launchOnboarding-DTdUA_wE.js} +1 -1
- package/dist/chunks/{launchSchedule-CeHHSvO7.js → launchSchedule-psiSLmTA.js} +1 -1
- package/dist/chunks/{launchSkillStore-Bqh2Fru2.js → launchSkillStore-CQQ00Ads.js} +1 -1
- package/dist/chunks/{launchTeleport-Crc3XVZX.js → launchTeleport-CXFRPVMR.js} +1 -1
- package/dist/chunks/{launchVault-BHLgpth_.js → launchVault-Dn6jq0Rc.js} +1 -1
- package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
- package/dist/chunks/{loadAgentsDir-ZQwvbURI.js → loadAgentsDir-BURvZNN6.js} +685 -683
- package/dist/chunks/loadAgentsDir-Db9UTm45.js +1 -0
- package/dist/chunks/loadPluginHooks-C9A9oS-w.js +1 -0
- package/dist/chunks/{localSearch-H0LchlTi.js → localSearch-D2Rs8wQP.js} +1 -1
- package/dist/chunks/localSearch-hBh1ATr2.js +1 -0
- package/dist/chunks/{log-Duzb4o6h.js → log-BMCygSzM.js} +1 -1
- package/dist/chunks/{logoV2Utils-5lcUu53m.js → logoV2Utils-DN9nzdX-.js} +1 -1
- package/dist/chunks/{magicDocs-D1FIPmYg.js → magicDocs-DIeTcwAA.js} +3 -3
- package/dist/chunks/{main-B8XtFN2P.js → main-CI54PZrG.js} +78 -78
- package/dist/chunks/{main-CR7cXdgy.js → main-D862LI_d.js} +2 -2
- package/dist/chunks/{mappers-DKU4RgE3.js → mappers-Q_Z3Kjo-.js} +1 -1
- package/dist/chunks/mcp-CtbhGaLC.js +2 -0
- package/dist/chunks/mcp-DMacvhqZ.js +1 -0
- package/dist/chunks/mcp-RvwPC7FB.js +6 -0
- package/dist/chunks/{memoize-DgMjqLtn.js → memoize-B0zhbT8Z.js} +1 -1
- package/dist/chunks/{memory-D-Q62bJ7.js → memory-BPN8gW7n.js} +1 -1
- package/dist/chunks/{mode-DFZgqKBd.js → mode-Jl_Boaym.js} +2 -2
- package/dist/chunks/model-BIVmcl_N.js +1 -0
- package/dist/chunks/{model-fDWtIRVr.js → model-CWBwPvTH.js} +1 -1
- package/dist/chunks/model-DlVpqR0P.js +1 -0
- package/dist/chunks/nativeInstaller-8arnRiUO.js +1 -0
- package/dist/chunks/{onChangeAppState-DaQ0R9Tw.js → onChangeAppState-DBantDJ6.js} +1 -1
- package/dist/chunks/{openai-DNS0-ivj.js → openai-yin1iDG8.js} +3 -3
- package/dist/chunks/{overageCreditGrant-qHN3tnp2.js → overageCreditGrant-CN_sVURL.js} +1 -1
- package/dist/chunks/{panelCall-BvKpHquo.js → panelCall-CPKC6VR5.js} +1 -1
- package/dist/chunks/parser-Bf6iasPV.js +1 -0
- package/dist/chunks/{parser-TYEkLFgh.js → parser-DFwaTGf7.js} +1 -1
- package/dist/chunks/{partition-Cv11dD5P.js → partition-CW0BJ881.js} +1 -1
- package/dist/chunks/{passes-DQdM2Ssq.js → passes-DOm9ukdK.js} +1 -1
- package/dist/chunks/{path-Cu_AKqg6.js → path-D5U-tm91.js} +1 -1
- package/dist/chunks/permissions-CxDJ__l6.js +3 -0
- package/dist/chunks/pidLock-C69HNTTb.js +3 -0
- package/dist/chunks/{pipeTransport-7GIO6GCA.js → pipeTransport-CqCnc-Ys.js} +1 -1
- package/dist/chunks/{plan-D8dQDl8W.js → plan-B0rEs32a.js} +1 -1
- package/dist/chunks/{platform-B5dCGT8t.js → platform-BrYefG_2.js} +1 -1
- package/dist/chunks/{plugin-w8MqsKHn.js → plugin-BSEMgcGu.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-7FFHzSRz.js → pluginAutoupdate-CTByPD8J.js} +1 -1
- package/dist/chunks/pluginBlocklist-mogKaK0p.js +1 -0
- package/dist/chunks/pluginCliCommands-DQQ7C7kk.js +1 -0
- package/dist/chunks/{pluginFlagging-_WUQP3Lq.js → pluginFlagging-mHNff1t9.js} +1 -1
- package/dist/chunks/pluginOperations-JEedVzfS.js +2 -0
- package/dist/chunks/pluginStartupCheck-D7ts2V3p.js +1 -0
- package/dist/chunks/{pluginStartupCheck-BelpzwZI.js → pluginStartupCheck-RscVZDi4.js} +1 -1
- package/dist/chunks/plugins-Cr03lISA.js +4 -0
- package/dist/chunks/policyLimits-DWtLyJ4n.js +1 -0
- package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
- package/dist/chunks/{poor-D3T_8wwf.js → poor-DekfGNT7.js} +1 -1
- package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
- package/dist/chunks/{poorMode-BqyVuBu-.js → poorMode-CtcqaiwD.js} +1 -1
- package/dist/chunks/print-CZUmAzmt.js +23 -0
- package/dist/chunks/{privacy-settings-D5zxu4Aa.js → privacy-settings-CwJ1H8Ua.js} +1 -1
- package/dist/chunks/processBashCommand-aKNneP2u.js +1 -0
- package/dist/chunks/processSlashCommand-BcPnWNxZ.js +5 -0
- package/dist/chunks/prompt-CIyhCdkE.js +1 -0
- package/dist/chunks/prompt-DNDgGM9q.js +139 -0
- package/dist/chunks/prompt-DRhjinu2.js +1 -0
- package/dist/chunks/{promptEditor-D6HzjcMS.js → promptEditor-DMJyosKj.js} +2 -2
- package/dist/chunks/{protocolHandler-BXlx1N7v.js → protocolHandler-z2zxAtB1.js} +4 -4
- package/dist/chunks/{proxy-CHnxhNZI.js → proxy-CRN7jYIi.js} +3 -3
- package/dist/chunks/{rate-limit-options-1hc-RyNR.js → rate-limit-options--Y3oF1g0.js} +1 -1
- package/dist/chunks/rcDebugLog-DoL1FpGJ.js +11 -0
- package/dist/chunks/reconciler-CJcSh6xo.js +4 -0
- package/dist/chunks/{referral-Cu9bEOFE.js → referral-UKJv23_5.js} +1 -1
- package/dist/chunks/{refresh-vJbxW4a1.js → refresh-ul_i5R1a.js} +1 -1
- package/dist/chunks/{registerProtocol-B_XbLDQO.js → registerProtocol-CukLQuxJ.js} +3 -3
- package/dist/chunks/{release-notes-CavWoMQR.js → release-notes-CGv_6MMt.js} +1 -1
- package/dist/chunks/{releaseNotes-Di6OaHF7.js → releaseNotes-BKZNuDLD.js} +2 -2
- package/dist/chunks/{reload-plugins-ofeLn07p.js → reload-plugins-2W11dpLQ.js} +1 -1
- package/dist/chunks/{remote-env-dXzHAuD6.js → remote-env-D9xsoBfx.js} +1 -1
- package/dist/chunks/remoteBridgeCore-asY9JAXU.js +1 -0
- package/dist/chunks/remoteManagedSettings-Bxo3bv1U.js +1 -0
- package/dist/chunks/{rename-CtjP0lop.js → rename-CHsHMWpO.js} +1 -1
- package/dist/chunks/{renderOptions-DOXmueQV.js → renderOptions-BUJB9nAm.js} +1 -1
- package/dist/chunks/{resume-C5h5JvY1.js → resume-NduOaghx.js} +2 -2
- package/dist/chunks/{ripgrep-BN_g-F7X.js → ripgrep-BXmXjAzA.js} +1 -1
- package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
- package/dist/chunks/{runtimeObserver-B93v1AxE.js → runtimeObserver-BXbjibFk.js} +4 -4
- package/dist/chunks/{runtimeObserver-DOZFrqJu.js → runtimeObserver-Bo80nWQf.js} +1 -1
- package/dist/chunks/sandbox-adapter-DDfVl_2V.js +1 -0
- package/dist/chunks/{sandbox-toggle-TiLGFwaZ.js → sandbox-toggle-C-WCDRN4.js} +1 -1
- package/dist/chunks/searchExtraTools-BHWzsbNO.js +1 -0
- package/dist/chunks/{session-v9tKHhU9.js → session-pDd13-wE.js} +2 -2
- package/dist/chunks/{sessionDiscovery-4byQKOnc.js → sessionDiscovery-CSUnpsCy.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BZvxeufx.js +1 -0
- package/dist/chunks/sessionMemory-CAmpw2yb.js +1 -0
- package/dist/chunks/sessionMemory-DT0IkiA1.js +1 -0
- package/dist/chunks/sessionMemoryUtils-B4kGNH4j.js +1 -0
- package/dist/chunks/{sessionObserver-OgY9BUP4.js → sessionObserver-Ur7PqKl_.js} +1 -1
- package/dist/chunks/sessionObserver-oIkwTidC.js +1 -0
- package/dist/chunks/sessionStorage-DqARUj0K.js +1 -0
- package/dist/chunks/sessionTitle-pWMaI79N.js +14 -0
- package/dist/chunks/{sessionTracing-BBxhPccY.js → sessionTracing-CCPRzOvy.js} +3 -3
- package/dist/chunks/settings-DfWP5y6X.js +19 -0
- package/dist/chunks/settingsSync-D_4P3Esd.js +1 -0
- package/dist/chunks/setup-JHvhWKh9.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DDSOFi1W.js → shadowedRuleDetection-Chi3afMR.js} +1 -1
- package/dist/chunks/{shellQuote-yXoC_y5m.js → shellQuote-DkSy9MYE.js} +1 -1
- package/dist/chunks/{sideQuestion-CAiA6jAf.js → sideQuestion-D03MXdE2.js} +1 -1
- package/dist/chunks/sinks-B4_pw0Gb.js +2 -0
- package/dist/chunks/sinks-Cro1Y8C2.js +1 -0
- package/dist/chunks/{skill-learning-Dx1o4mMo.js → skill-learning-7ZQF5JvA.js} +1 -1
- package/dist/chunks/skillChangeDetector-uCaYrerZ.js +1 -0
- package/dist/chunks/{skillGapStore-BV_6qzxU.js → skillGapStore-BND2Lq0Z.js} +1 -1
- package/dist/chunks/{skillGapStore-Zvqiyxds.js → skillGapStore-z3LP64O-.js} +2 -2
- package/dist/chunks/{skillGenerator-jJQDphQ8.js → skillGenerator-DaNb-yKH.js} +2 -2
- package/dist/chunks/skillLearning-GZxYPlyl.js +1 -0
- package/dist/chunks/{skillLearning-BTT3_yGc.js → skillLearning-rMX1bSBa.js} +1 -1
- package/dist/chunks/{skillPanel-OW2M6SZr.js → skillPanel-q7GPSQ6_.js} +3 -3
- package/dist/chunks/{skillSearchPanel-C0Y56c5N.js → skillSearchPanel-oj8gy1ZL.js} +4 -4
- package/dist/chunks/{skills-BFsyLP33.js → skills-QqbeFP0s.js} +1 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
- package/dist/chunks/{startupProfiler-BquH_Yqm.js → startupProfiler-xa3NmN7Z.js} +2 -2
- package/dist/chunks/{stats-CrPmPT8f.js → stats-DmFubHpI.js} +1 -1
- package/dist/chunks/{status-BO5J2MAe.js → status-BEIsLmfj.js} +1 -1
- package/dist/chunks/{status-DHJbK4pV.js → status-DW3Z_7xa.js} +2 -2
- package/dist/chunks/{statusNoticeHelpers-CqeUBySi.js → statusNoticeHelpers-CaHS8xig.js} +1 -1
- package/dist/chunks/{stickers-BLFmyHZV.js → stickers-D5teCKMN.js} +1 -1
- package/dist/chunks/{stringUtils-D_g2L6A4.js → stringUtils-DGLPkqJ4.js} +1 -1
- package/dist/chunks/{tag-M2AEtXjW.js → tag-CRg93Die.js} +2 -2
- package/dist/chunks/{tasks-CoOs_Qkj.js → tasks-BEohK1ij.js} +1 -1
- package/dist/chunks/teleport-4Srg5vcP.js +1 -0
- package/dist/chunks/{templateJobs-Cl50Qw0s.js → templateJobs-DYP1fjYU.js} +1 -1
- package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
- package/dist/chunks/{terminalSetup-Bdh9K31U.js → terminalSetup-RDKg8dVa.js} +1 -1
- package/dist/chunks/{theme-DgCIr0jU.js → theme-kNL4kl_3.js} +1 -1
- package/dist/chunks/{thinkback-ERCQ86CR.js → thinkback-gV-sKkMM.js} +1 -1
- package/dist/chunks/thinkback-hc5eJ9ul.js +1 -0
- package/dist/chunks/thinkback-play-BpWMqbgJ.js +1 -0
- package/dist/chunks/{tmux-ZZk68JBq.js → tmux-BY7IdQ1f.js} +1 -1
- package/dist/chunks/{toolEventObserver-9-5Ne25Z.js → toolEventObserver-C98uraqD.js} +1 -1
- package/dist/chunks/{toolEventObserver-9XCQXiMx.js → toolEventObserver-ar5NDa0M.js} +1 -1
- package/dist/chunks/toolPool-CNYKDRq5.js +1 -0
- package/dist/chunks/trustedDevice-0dehm9qz.js +1 -0
- package/dist/chunks/trustedDevice-BBKUhCCL.js +1 -0
- package/dist/chunks/{types-Cnorfsss.js → types-C-MRCL8J.js} +3 -3
- package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
- package/dist/chunks/{ultrareviewCommand-BMBHepdu.js → ultrareviewCommand-yXlFsMnv.js} +2 -2
- package/dist/chunks/{undercover-DDgIKbO5.js → undercover-BTIRVF1t.js} +1 -1
- package/dist/chunks/undercover-CG_269xD.js +1 -0
- package/dist/chunks/{up-D6bNw_tT.js → up-BHkC97_C.js} +1 -1
- package/dist/chunks/updateCCB-B2xAJ4Nr.js +11 -0
- package/dist/chunks/upgrade-J7lKLkD2.js +1 -0
- package/dist/chunks/{upgrade-BN20nsCH.js → upgrade-yNl7EO4e.js} +1 -1
- package/dist/chunks/upload-BWVIHmMB.js +1 -0
- package/dist/chunks/{upstreamproxy-os5rw0Vg.js → upstreamproxy-DyR_eXO8.js} +4 -4
- package/dist/chunks/{usage-D_sqm8us.js → usage-B2PbCUMi.js} +1 -1
- package/dist/chunks/usage-Ck8Cu45g.js +1 -0
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-vzUoPY51.js → useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js} +1 -1
- package/dist/chunks/useMainLoopModel-CO4yBjRM.js +1 -0
- package/dist/chunks/useManagePlugins-BzFKIDrD.js +1 -0
- package/dist/chunks/{useMergedTools-Bb4XbC9d.js → useMergedTools-CRLWSGDl.js} +1 -1
- package/dist/chunks/{useSearchInput-B1UOjxAI.js → useSearchInput-BzGq4t7t.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BLbvu4--.js → useSettingsErrors-CSemUjj1.js} +1 -1
- package/dist/chunks/{util-CxlfALM4.js → util-BnReK81E.js} +1 -1
- package/dist/chunks/validatePlugin-D6sPqea1.js +1 -0
- package/dist/chunks/{vim-DLWBHwVM.js → vim-C0KTnJJs.js} +1 -1
- package/dist/chunks/{which-sEFQXpaX.js → which-CKQnSouy.js} +1 -1
- package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
- package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
- package/dist/chunks/{workSecret-DvniZR71.js → workSecret-CNWiR2uQ.js} +1 -1
- package/dist/chunks/{workerRegistry-CFnGtb3L.js → workerRegistry-CUXbNyL9.js} +1 -1
- package/dist/chunks/worktree-89ttIVxH.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +5 -10
- package/dist/chunks/ApproveApiKey-CQsQdQBC.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-AiVi-1pI.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DUu6iRJk.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-DVTPwR5I.js +0 -1
- package/dist/chunks/Doctor-BXhz8eUa.js +0 -3
- package/dist/chunks/Doctor-D75dsEyb.js +0 -1
- package/dist/chunks/ExitFlow-B1XNACQP.js +0 -2
- package/dist/chunks/Feedback-Cvz80lAn.js +0 -2
- package/dist/chunks/Grove-B7hhBvFw.js +0 -1
- package/dist/chunks/MCPConnectionManager-BLfKm4H2.js +0 -1
- package/dist/chunks/MessageSelector-DmKtBYX9.js +0 -3
- package/dist/chunks/Messages-CaFdI1kk.js +0 -11
- package/dist/chunks/PluginSettings-0FSNch8O.js +0 -17
- package/dist/chunks/QueryEngine-WYDWzQuY.js +0 -1
- package/dist/chunks/REPL-vV_jzAVx.js +0 -1
- package/dist/chunks/ResumeConversation-g_JyOWbl.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-Daedym7_.js +0 -1
- package/dist/chunks/Settings-DUXA-qac.js +0 -2
- package/dist/chunks/TrustDialog-CdZS9t-T.js +0 -1
- package/dist/chunks/ajv-5vMo9UcX.js +0 -8
- package/dist/chunks/api-CLLIHLpn.js +0 -1
- package/dist/chunks/api-DMpNA1s8.js +0 -1
- package/dist/chunks/asciicast-BIr75_x9.js +0 -1
- package/dist/chunks/auth-Ce0jllLf.js +0 -1
- package/dist/chunks/auth-DV3P8Qup.js +0 -1
- package/dist/chunks/auth-DpFfHy1W.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BycL9lOe.js +0 -1
- package/dist/chunks/bg-H849G7Sc.js +0 -1
- package/dist/chunks/bridgeConfig-CcANVX0P.js +0 -1
- package/dist/chunks/bridgeEnabled-Cn-u7P4_.js +0 -1
- package/dist/chunks/bridgeMain-CtgVyLjI.js +0 -68
- package/dist/chunks/bridgeMain-Dh0gWRVo.js +0 -1
- package/dist/chunks/bridgeMessaging-CRG6HqUb.js +0 -1
- package/dist/chunks/bridgePointer-Cug5fQ3e.js +0 -1
- package/dist/chunks/caches-C3NINY3K.js +0 -1
- package/dist/chunks/ccrClient-CRXGlUCe.js +0 -1
- package/dist/chunks/client-AnWHs0gW.js +0 -1
- package/dist/chunks/commands-DsKH3ogN.js +0 -1
- package/dist/chunks/commitAttribution-D7NrwLhc.js +0 -1
- package/dist/chunks/compact-BhWCO-oD.js +0 -2
- package/dist/chunks/completionCache-C9zlWBRz.js +0 -1
- package/dist/chunks/config-662VDD70.js +0 -3
- package/dist/chunks/config-CUN8YbOa.js +0 -1
- package/dist/chunks/config-DklnhNx1.js +0 -1
- package/dist/chunks/config-Wk3svGdH.js +0 -1
- package/dist/chunks/context-noninteractive-C3dICmA9.js +0 -1
- package/dist/chunks/conversation-CooSju3g.js +0 -1
- package/dist/chunks/conversation-DLLIOKYV.js +0 -1
- package/dist/chunks/createSession-CVG8SiEm.js +0 -1
- package/dist/chunks/crossProjectResume-DiKJb83I.js +0 -40
- package/dist/chunks/datadog-BE6D_6m0.js +0 -1
- package/dist/chunks/datadog-C69i7cfI.js +0 -1
- package/dist/chunks/debug-8kgDrUfj.js +0 -1
- package/dist/chunks/detectRepository-_Kj817Vi.js +0 -1
- package/dist/chunks/doctor-DEz8BHAz.js +0 -1
- package/dist/chunks/envLessBridgeConfig-3kCrKZl7.js +0 -1
- package/dist/chunks/envLessBridgeConfig-BfgXw47_.js +0 -1
- package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
- package/dist/chunks/execSyncWrapper-CWxMek26.js +0 -1
- package/dist/chunks/exit-cyepwuyy.js +0 -1
- package/dist/chunks/extra-usage-DlFeNGQD.js +0 -1
- package/dist/chunks/extra-usage-nRFfBiXh.js +0 -1
- package/dist/chunks/extractMemories-BqN8fWZ5.js +0 -1
- package/dist/chunks/fast-NvqW2-t1.js +0 -1
- package/dist/chunks/firstPartyEventLogger-AhXYSrkP.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BQYrBdvD.js +0 -5
- package/dist/chunks/gemini-Sr_00TsL.js +0 -1
- package/dist/chunks/generateRecap-5d4l_ODy.js +0 -1
- package/dist/chunks/git-Cc1jAz6r.js +0 -1
- package/dist/chunks/git-Cgc8X5l2.js +0 -6
- package/dist/chunks/hooks-DvtnNoYE.js +0 -1
- package/dist/chunks/inboundAttachments-BZ6MKpxd.js +0 -1
- package/dist/chunks/inboundAttachments-D5Ux2kCl.js +0 -1
- package/dist/chunks/initReplBridge-CjuO6in6.js +0 -1
- package/dist/chunks/install-DqpM2brU.js +0 -1
- package/dist/chunks/jwtUtils-CqXPjf-a.js +0 -1
- package/dist/chunks/keybindings-JvAmBpLt.js +0 -2
- package/dist/chunks/language-DaxZe0Xw.js +0 -1
- package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
- package/dist/chunks/loadAgentsDir-D7npVvsj.js +0 -1
- package/dist/chunks/loadPluginHooks-CaKvZVZI.js +0 -1
- package/dist/chunks/localSearch-BU5oulbF.js +0 -1
- package/dist/chunks/mcp-B06Mqsur.js +0 -6
- package/dist/chunks/mcp-C0AjA07u.js +0 -1
- package/dist/chunks/mcp-ghioDl7W.js +0 -2
- package/dist/chunks/metadata-CIx5CsoY.js +0 -1
- package/dist/chunks/model-BgrLt7P7.js +0 -1
- package/dist/chunks/model-aVc5c3Lz.js +0 -1
- package/dist/chunks/nativeInstaller-DKe1pWoL.js +0 -1
- package/dist/chunks/parser-Bj3gOqFv.js +0 -1
- package/dist/chunks/permissions-DB_2mmCl.js +0 -3
- package/dist/chunks/pidLock-DchmaAK6.js +0 -3
- package/dist/chunks/pluginBlocklist-Cw_l-yal.js +0 -1
- package/dist/chunks/pluginCliCommands-BtYWRxhS.js +0 -1
- package/dist/chunks/pluginOperations-BOkST1qE.js +0 -2
- package/dist/chunks/pluginStartupCheck-XBLJZZys.js +0 -1
- package/dist/chunks/plugins-6px6K1fh.js +0 -4
- package/dist/chunks/policyLimits-C07tQ0Wr.js +0 -1
- package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
- package/dist/chunks/poorMode-BdBDiOFD.js +0 -1
- package/dist/chunks/print-DcQSuK0v.js +0 -23
- package/dist/chunks/processBashCommand-CEqA4QZi.js +0 -1
- package/dist/chunks/processSlashCommand-DMpFk59M.js +0 -5
- package/dist/chunks/prompt-CKvoqUC3.js +0 -1
- package/dist/chunks/prompt-aXZPR3q8.js +0 -1
- package/dist/chunks/prompt-wys9CwDo.js +0 -132
- package/dist/chunks/rcDebugLog-CivJaJ3V.js +0 -11
- package/dist/chunks/reconciler-BKX4jh34.js +0 -4
- package/dist/chunks/remoteBridgeCore-CmwkjiTK.js +0 -1
- package/dist/chunks/remoteManagedSettings-Co-CxR67.js +0 -1
- package/dist/chunks/ripgrep-hOjrgpMp.js +0 -1
- package/dist/chunks/sandbox-adapter-CO5GuywY.js +0 -1
- package/dist/chunks/searchExtraTools-CXZJU2Kv.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BUyIQVzL.js +0 -1
- package/dist/chunks/sessionMemory-ZsxCLHYd.js +0 -1
- package/dist/chunks/sessionMemory-e6YpTUhW.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BD_dqyYB.js +0 -1
- package/dist/chunks/sessionObserver-DNItJztR.js +0 -1
- package/dist/chunks/sessionStorage-xvxpRETp.js +0 -1
- package/dist/chunks/sessionTitle-Bph6GO4F.js +0 -14
- package/dist/chunks/settings-BhvhCpVh.js +0 -19
- package/dist/chunks/settingsSync-D2B5K4BT.js +0 -1
- package/dist/chunks/setup-CEnNEK6Z.js +0 -3
- package/dist/chunks/sink-CyKOf5TT.js +0 -1
- package/dist/chunks/sink-DxPJ4khU.js +0 -1
- package/dist/chunks/sinks-BNo3DvxO.js +0 -2
- package/dist/chunks/sinks-CHgtwDha.js +0 -1
- package/dist/chunks/skillChangeDetector-BRBCwQ2w.js +0 -1
- package/dist/chunks/skillLearning-BH7EAU1m.js +0 -1
- package/dist/chunks/src-xRRBgNzF.js +0 -25
- package/dist/chunks/startupProfiler-CYCH-qos.js +0 -1
- package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
- package/dist/chunks/stdio-W_Kokrkh.js +0 -3
- package/dist/chunks/teleport-DjIgQeBB.js +0 -1
- package/dist/chunks/terminalSetup-nvS3KCDG.js +0 -33
- package/dist/chunks/thinkback-BSv_fvbV.js +0 -1
- package/dist/chunks/thinkback-play-DNB0IWYt.js +0 -1
- package/dist/chunks/toolPool-uQKZRMKg.js +0 -1
- package/dist/chunks/trustedDevice-0ej6e3nx.js +0 -1
- package/dist/chunks/trustedDevice-nqhuw4tp.js +0 -1
- package/dist/chunks/udsClient-CiFj4M_h.js +0 -1
- package/dist/chunks/undercover-6UUO38fQ.js +0 -1
- package/dist/chunks/updateCCB-B-OlpLjA.js +0 -11
- package/dist/chunks/upgrade-DYqlCH80.js +0 -1
- package/dist/chunks/upload-BQGByiXE.js +0 -1
- package/dist/chunks/usage-DolSCKGi.js +0 -1
- package/dist/chunks/useMainLoopModel-cZd8EKo5.js +0 -1
- package/dist/chunks/useManagePlugins-DgGZBvXV.js +0 -1
- package/dist/chunks/validatePlugin-n8a4W_jI.js +0 -1
- package/dist/chunks/windowsPaths-BLevJOlm.js +0 -1
- package/dist/chunks/windowsPaths-N_YmYY6k.js +0 -1
- package/dist/chunks/worktree-Dr_WzlXs.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{B as n,E as r,O as i,U as a,l as o,p as s,z as c}from"./debug-DiuXEmUq.js";import{M as l,j as u}from"./git-Cgc8X5l2.js";import{lr as d,ur as f,vn as p,yn as m}from"./model-BgrLt7P7.js";import{l as h,r as g}from"./proxy-CHnxhNZI.js";import{D as _,E as v,O as y,a as b,l as x,r as S}from"./rcDebugLog-CivJaJ3V.js";import{n as C}from"./jwtUtils-CqXPjf-a.js";import{randomUUID as w}from"crypto";a(),o(),u(),h(),f(),p(),y(),S(),r(),e();var T=class extends Error{constructor(e,n){super(e),t(this,`retryAfterMs`,void 0),this.retryAfterMs=n}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let n=0,r=0;for(;r<this.pending.length&&r<e;){let e;try{e=Buffer.byteLength(i(this.pending[r]))}catch{this.pending.splice(r,1);continue}if(r>0&&n+e>t)break;n+=e,r++}return this.pending.splice(0,r)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await m(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}p(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),t(this,`reason`,void 0),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,g({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??v,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),b(()=>{this.writeEvent({type:`keep_alive`})}),s(`CCRClient: initialized, epoch=${this.workerEpoch}`),l(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||l(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,r,i,{timeout:a=1e4}={}){let o=this.getAuthHeaders();if(Object.keys(o).length===0)return{ok:!1};try{let n=await this.http[e](`${this.sessionBaseUrl}${t}`,r,{headers:{...o,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":d()},validateStatus:j,timeout:a});if(n.status>=200&&n.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(n.status===409&&this.handleEpochMismatch(),n.status===401||n.status===403){let e=_(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(s(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),l(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(s(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),l(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(s(`CCRClient: ${i} returned ${n.status}`,{level:`warn`}),l(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:n.status}),n.status===429){let e=n.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(r){return s(`CCRClient: ${i} failed: ${c(r)}`,{level:`warn`}),l(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:n(r)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){s(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),l(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&s(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return s(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,n){for(let n=1;n<=10;n++){let r;try{r=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":d()},validateStatus:j,timeout:3e4})}catch(t){s(`CCRClient: GET ${e} failed (attempt ${n}/10): ${c(t)}`,{level:`warn`}),n<10&&await m(Math.min(500*2**(n-1),3e4)+Math.random()*500);continue}if(r.status>=200&&r.status<300)return r.data;r.status===409&&this.handleEpochMismatch(),s(`CCRClient: GET ${e} returned ${r.status} (attempt ${n}/10)`,{level:`warn`}),n<10&&await m(Math.min(500*2**(n-1),3e4)+Math.random()*500)}return s(`CCRClient: GET retries exhausted`,{level:`error`}),l(`error`,`cli_worker_get_retries_exhausted`,{context:n}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),x(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hr as e,Ur as t}from"./model-BgrLt7P7.js";t();export{e as getOrganizationUUID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Qi as e,Vi as t,qi as n}from"./loadAgentsDir-ZQwvbURI.js";e();export{t as clearCommandsCache,n as getCommands};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,l as t}from"./commitAttribution-DKun9CeU.js";t();export{e as isInternalModelRepo};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{di as t,ui as n}from"./src-CDCSSo0U2.js";import{en as r,rn as i}from"./state-ix0xIunV.js";import{Ao as a,GT as o,Gu as s,KT as c,Kx as l,OT as u,PT as d,Sl as f,Wu as p,_l as m,dE as h,dl as g,fh as _,hE as v,hl as y,ll as b,lt as x,mE as S,oE as C,ph as w,qT as T,qx as E,sE as D,uE as O,ut as k,vl as A,xl as j,yl as M,yn as N,zo as P}from"./loadAgentsDir-ZQwvbURI.js";import{H as F,U as I}from"./debug-DiuXEmUq.js";import{o as L,s as R}from"./log-Duzb4o6h.js";function z(e,t){let r=_(`tip`),i=l(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...t?[t]:[],...r?[r]:[]];return n.dim(`Compacted `+a.join(`
|
|
2
|
-
`))}async function B(e,t){let n=e.getAppState(),r=await x(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=p({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,s]=await Promise.all([c(),o()]);return{systemPrompt:i,userContext:a,systemContext:s,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{t(),r(),k(),T(),E(),S(),f(),O(),C(),y(),b(),u(),I(),N(),L(),P(),w(),s(),V=async(e,t)=>{let{abortController:n}=t,{messages:r}=t;if(r=a(r),r.length===0)throw Error(`No messages to compact`);let o=e.trim();try{if(!o){let e=await g(r,t.agentId);if(e)return c.cache.clear?.(),m(),v(t.options.querySource??`compact`,t.agentId),i(),h(),{type:`compact`,compactionResult:e,displayText:z(t)}}let e=(await D(r,t)).messages,n=await j(e,t,await B(t,e),!1,o,!1);return d(void 0),h(),c.cache.clear?.(),m(),{type:`compact`,compactionResult:n,displayText:z(t,n.userDisplayMessage)}}catch(e){throw n.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(M):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(A):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./completionCache-CdHCuiqq.js";t();export{e as regenerateCompletionCache};
|
|
@@ -1,3 +0,0 @@
|
|
|
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 ue,qr as de,vi as fe,vt as pe,wi as me,yi as he,zr as ge}from"./state-ix0xIunV.js";import{n as _e,t as ve}from"./cwd-CYmmnQVS.js";import{B as y,D as ye,E as be,N as b,O as x,U as xe,_ as Se,h as S,l as Ce,ot as we,p as C,st as Te}from"./debug-DiuXEmUq.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-BhvhCpVh.js";import{M as Le,_ as Re,j as ze,n as Be}from"./git-Cgc8X5l2.js";import{d as Ve,o as He,s as Ue,u as We}from"./log-Duzb4o6h.js";import{m as Ge}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{a as E,i as Ke}from"./path-Cu_AKqg6.js";import{C as qe,f as Je}from"./file-BZriE-XU.js";import{f as Ye,p as Xe,s as Ze,u as Qe}from"./types-Cnorfsss.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,me(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(ue())??ue()}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`),()=>ue())}));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:he(t[a+1])?[]:{})}Ae(c,l,u),c=c[l]}return e}var Tt=t((()=>{je(),ae(),fe(),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((()=>{ge(),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((()=>{de(),_(),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(pe())return!0;let e=B(),t=$();if(e.projects?.[t]?.hasTrustDialogAccepted)return!0;let n=E(ve());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){C(`Failed to save config with lock: ${n}`,{level:`error`});let r=V(w(),I);if(L(r)){C(`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||S().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(()=>{})}),Te(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=S().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);S().mkdirSync(r),qe(e,x(N(t,(e,t)=>x(e)!==x(n[t])),null,2),{encoding:`utf-8`,mode:384}),e===w()&&X++}function $t(e,t,n){let r=t(),i=k(e),a=S();a.mkdirSync(i);let o;try{let i=`${e}.lock`,s=Date.now();o=zt(e,{lockfilePath:i,onCompromised:e=>{C(`Config lock compromised: ${e}`,{level:`error`})}});let c=Date.now()-s;if(c>100&&(C(`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(y(e)!==`ENOENT`)throw e}let l=V(e,t);if(e===w()&&L(l))return C(`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)=>x(e)!==x(r[t]));try{let t=O(e),n=tn();try{a.mkdirSync(n)}catch(e){if(y(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){y(e)!==`ENOENT`&&C(`Failed to backup config: ${e}`,{level:`error`})}return qe(e,x(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=S(),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=S();try{let n=r.readFileSync(e,{encoding:`utf-8`});try{let e=ye(Xe(n));return{...t(),...e}}catch(n){throw new b(n instanceof Error?n.message:String(n),e,t())}}catch(i){if(y(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 b&&n)throw i;if(i instanceof b){if(C(`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(y(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),C(`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){C(`Failed to save config with lock: ${r}`,{level:`error`});let i=V(w(),I);if(L(i)){C(`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(),_e(),we(),Ce(),ze(),Me(),u(),xe(),Je(),Se(),Re(),Ze(),Ye(),Ht(),He(),Ke(),Ve(),Ne(),be(),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,Te(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};
|
|
@@ -1 +0,0 @@
|
|
|
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-DUXA-qac.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 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DSxRz_kt.js";import{d as r,p as i}from"./log-Duzb4o6h.js";function a(){return t(process.env.CLAUDE_CODE_USE_BEDROCK)||t(process.env.CLAUDE_CODE_USE_VERTEX)||t(process.env.CLAUDE_CODE_USE_FOUNDRY)||i()}function o(){return i()}var s=e((()=>{n(),r()}));export{a as n,o as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./loadAgentsDir-ZQwvbURI.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-662VDD70.js";n();export{r as checkHasTrustDialogAccepted,a as enableConfigs,i as getCurrentProjectConfig,t as getGlobalConfig,o as saveCurrentProjectConfig,e as saveGlobalConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./context-noninteractive-CTvyNimw.js";t();export{n as call,e as collectContextData};
|
|
@@ -1 +0,0 @@
|
|
|
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 ee,en as a,ht as o,nt as s,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,My as y,Ty as b,Wp as x,Zt as te,aC as S,dn as C,dr as w,eg as T,fi as E,fy as D,jn as O,jr as k,ju as A,kn as j,nr as M,py as N,rC as P,tg as F,yn as I}from"./loadAgentsDir-ZQwvbURI.js";import{o as L,s as ne}from"./log-Duzb4o6h.js";import{n as R,r as z}from"./analytics-BotDBGh0.js";import{C as B,y as V}from"./rcDebugLog-CivJaJ3V.js";import{l as H,r as U}from"./commitAttribution-DKun9CeU.js";import{c as W,d as G}from"./debugUtils-3YYWvb3H.js";import{n as K,t as q}from"./caches-BB5_91gU.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:a,discoveredSkillNames:u,loadedNestedMemoryPaths:d,getAppState:h,setAppState:_,setConversationId:v}){let y=C();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,T=[],D=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(h)for(let e of Object.values(h().tasks))D(e)||A(e)&&(S.add(e.agentId),T.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(s()),a.clear(),u?.clear(),d?.clear(),_&&_(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!D(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)}j(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}}}),b(),M(),ee({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=o()),await E();for(let e of T)e.status===`running`&&O(e.id,w(P(e.agentId)));let{saveMode:I}=(k(),e(m));I(`normal`);let L=p();L&&f(L);let R=await N(`clear`);R.length>0&&t(()=>R)}var ae=t((()=>{$(),a(),R(),u(),T(),S(),H(),I(),L(),y(),x(),D(),k(),v(),h(),K()}));export{Y as i,ae as n,$ as r,ie as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./conversation-CooSju3g.js";e();export{t as clearConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r}from"./createSession-Br1g8qSD.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1,40 +0,0 @@
|
|
|
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{$y as oe,Cr as b,Fh as x,Fi as S,Fr as C,Hb as se,Ju as w,Nb as ce,Nr as le,Pb as T,Ph as ue,Pi as de,TS as fe,Vb as E,Wr as D,Xu as pe,db as me,ex as he,fb as O,hr as ge,jr as _e,tb as k,tx as ve,vi as ye}from"./loadAgentsDir-ZQwvbURI.js";import{D as be,E as xe,l as Se,p as A}from"./debug-DiuXEmUq.js";import{_n as Ce,gn as j}from"./settings-BhvhCpVh.js";import{_ as we,i as Te}from"./git-Cgc8X5l2.js";import{a as Ee,o as De,s as Oe}from"./log-Duzb4o6h.js";import{n as ke,r as M}from"./analytics-BotDBGh0.js";import{T as Ae,b as je,f as Me,h as Ne}from"./startupProfiler-BquH_Yqm.js";import{_ as Pe,h as Fe}from"./model-BgrLt7P7.js";import{i as N,r as P}from"./shellQuote-yXoC_y5m.js";import{u as Ie}from"./referral-Cu9bEOFE.js";import{n as Le,t as Re}from"./useExitOnCtrlCDWithKeybindings-vzUoPY51.js";import{t as ze}from"./SearchBox-vfLXEPed.js";import{n as Be,t as Ve}from"./useSearchInput-B1UOjxAI.js";import{d as He,n as F,t as Ue,u as We}from"./Messages-CaFdI1kk.js";import{sep as I}from"path";function Ge({log:e,onExit:t,onSelect:n}){let[r,i]=L.useState(null);L.useEffect(()=>{i(null),C(e)&&D(e).then(i)},[e]);let o=C(e)&&r===null,s=r??e,f=b(s)||``,p=w();return d(`confirm:no`,t,{context:`Confirmation`}),d(`confirm:yes`,(0,L.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),o?(0,R.jsxs)(c,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(re,{message:`Loading session…`}),(0,R.jsx)(l,{dimColor:!0,children:(0,R.jsx)(u,{children:(0,R.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(c,{flexDirection:`column`,children:[(0,R.jsx)(Ue,{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,R.jsxs)(c,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(l,{children:[Ne(s.modified),` · `,s.messageCount,` messages`,s.gitBranch?` · ${s.gitBranch}`:``]}),(0,R.jsx)(l,{dimColor:!0,children:(0,R.jsxs)(u,{children:[(0,R.jsx)(a,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,z=e((()=>{L=t(h(),1),g(),Ie(),pe(),je(),_e(),se(),F(),R=v()}));function Ke(e,t){if(e===V)return 5;let n=o(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function qe(e,t){let n=t-H-U;return o(e)<=n?e:n<=1?e.charAt(0):Ae(e,n)}function Je({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(et,W),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=>Ke(e,d)),p=0,m=e.length;if(f.reduce((e,t,n)=>e+t+ +(n<f.length-1),0)>s){let t=s-$e,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,B.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(l,{color:`suggestion`,children:i}),h>0&&(0,B.jsxs)(l,{dimColor:!0,children:[Ye,h]}),te.map((e,t)=>{let n=ne[t]===u,r=e===V?e:`#${qe(e,d-H)}`;return(0,B.jsxs)(l,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),ee>0?(0,B.jsxs)(l,{dimColor:!0,children:[Xe,ee,Ze]}):(0,B.jsx)(l,{dimColor:!0,children:Qe})]})}var B,V,H,U,Ye,Xe,Ze,Qe,$e,et,W,G=e((()=>{h(),g(),je(),B=v(),V=`All`,H=2,U=1,Ye=`← `,Xe=`→`,Ze=` (tab to cycle)`,Qe=`(tab to cycle)`,$e=5,et=18,W=14}));function tt({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]=K.useState(new Set),ne=K.useRef(!1),re=K.useRef(null),g=K.useCallback(e=>u?u(e):ee.has(e),[u,ee]),_=K.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=K.useCallback(e=>e?`▼ `:`▶ `,[]),y=K.useCallback(e=>` ▸ `,[]),ie=p??v,ae=m??y,oe=K.useCallback(e=>{let t=``;return e.hasChildren?t=ie(e.isExpanded):e.depth>0&&(t=ae(e.depth)),t+e.node.label},[ie,ae]),b=K.useMemo(()=>_.map(e=>({label:oe(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[_,oe]),x=K.useMemo(()=>{let e=new Map;return _.forEach(t=>e.set(t.node.id,t.node)),e},[_]),S=K.useCallback(e=>_.find(t=>t.node.id===e),[_]),C=K.useCallback((e,t)=>{let n=S(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}))},[S,d,f]);return(0,nt.jsx)(c,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=S(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),C(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),C(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),ne.current=!0,C(t.parentId,!1),r)){let e=x.get(t.parentId);e&&r(e)}}}},children:(0,nt.jsx)(ce,{options:b,onChange:K.useCallback(e=>{let n=x.get(e);n&&t(n)},[x,t]),onFocus:K.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 K,nt,rt=e((()=>{K=t(h(),1),g(),T(),nt=v()}));function it(e,t){return Ae(e.replace(/\s+/g,` `).trim(),t)}function at({before:e,match:t,after:n},r){return _.dim(e)+r(t)+_.dim(n)}function ot(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 st(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?mt:i?ht:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${it(Ee(e),l)}${c}${s}`}function ct(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=Me(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function lt({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 x=ne(),S=n===void 0?x.columns:n,C=Le(o),se=f(),w=le(),T=process.env.USER_TYPE===`ant`,[ue]=s(),fe=me(ue),D=q.useMemo(()=>e=>p(e,fe.warning),[fe.warning]),pe=process.env.USER_TYPE===`ant`,[O,_e]=q.useState(null),[k,ve]=q.useState(!1),[be,xe]=q.useState(!1),[Se,A]=q.useState(!1),Ce=q.useMemo(()=>ae(),[]),[j,we]=q.useState(``),[De,Oe]=q.useState(0),[ke,Ae]=q.useState(new Set),[je,Ne]=q.useState(null),[Pe,Fe]=q.useState(1),[N,P]=q.useState(`list`),[Ie,Re]=q.useState(null),ze=q.useRef(null),[Ve,He]=q.useState(0),[F,Ue]=q.useState({status:`idle`}),[I,L]=q.useState(!1),R=q.useRef(null),{query:z,setQuery:Ke,cursorOffset:qe}=Be({isActive:N===`search`&&F.status!==`searching`,onExit:()=>{P(`list`),M(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{P(`list`),M(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:g||``}),B=q.useDeferredValue(z),[V,H]=q.useState(``);q.useEffect(()=>{if(!B){H(``);return}let e=setTimeout(H,300,B);return()=>clearTimeout(e)},[B]);let[U,Ye]=q.useState(null),[Xe,Ze]=q.useState(!1);q.useEffect(()=>{Te().then(e=>_e(e)),de(Ce).then(e=>{A(e.length>1)})},[Ce]);let Qe=q.useMemo(()=>new Map(e.map(e=>[e,dt(e)])),[e]),$e=q.useMemo(()=>T?new We(e.map(e=>({log:e,searchableText:Qe.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Qe,T]),et=q.useMemo(()=>pt(e),[e]),W=et.length>0,G=q.useMemo(()=>W?[`All`,...et]:[],[W,et]),K=G.length>0&&Ve<G.length?Ve:0,nt=G[K],rt=nt===`All`?void 0:nt,lt=+!!W,ut=q.useMemo(()=>{let t=e;return w&&(t=e.filter(e=>{let t=ie(),n=b(e);return!!(t&&n===t||e.customTitle||ge(e.messages)||e.firstPrompt||e.customTitle)})),rt!==void 0&&(t=t.filter(e=>e.tag===rt)),k&&O&&(t=t.filter(e=>e.gitBranch===O)),Se&&!be&&(t=t.filter(e=>e.projectPath===Ce)),t},[e,w,rt,k,O,Se,be,Ce]),mt=q.useMemo(()=>{if(!z)return ut;let e=z.toLowerCase();return ut.filter(t=>{let n=Ee(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)})},[ut,z]);q.useEffect(()=>{T&&B&&B!==V&&Ze(!0)},[B,V,T]),q.useEffect(()=>{if(!T||!V||!$e){Ye(null),Ze(!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)>_t?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,$e,V,Ye,Ze);return()=>{clearTimeout(e)}},[V,$e,T]);let{filteredLogs:ht,snippets:Y}=q.useMemo(()=>{let e=new Map,t=mt;if(U&&V&&U.query===V){for(let t of U.results)if(t.searchableText){let n=ot(t.searchableText,V,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=U.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[mt,U,V]),X=q.useMemo(()=>F.status===`results`&&F.results.length>0?F.results:ht,[F,ht]),Z=Math.max(30,S-4),yt=q.useMemo(()=>{if(!w)return[];let e=ft(X);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=X.indexOf(n),i=Y.get(n),a=i?at(i,D):null;if(t.length===1){let t=ct(n,{showProjectPath:_});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:st(n,Z),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=X.indexOf(t),i=Y.get(t),a=i?at(i,D):null,o=ct(t,{isChild:!0,showProjectPath:_});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:st(t,Z,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=ct(n,{showProjectPath:_});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:st(n,Z,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[w,X,Z,_,Y,D]),bt=q.useMemo(()=>w?[]:X.map((e,t)=>{let n=it(Ee(e)+(e.isSidechain?` (sidechain)`:``),Z),r=Me(e),i=_&&e.projectPath?` · ${e.projectPath}`:``,a=Y.get(e),o=a?at(a,D):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[w,X,D,Z,_,Y]),Q=je?.value.log??null,xt=()=>{if(!w||!Q)return``;let e=b(Q);if(!e)return``;let t=X.filter(t=>b(t)===e);if(!(t.length>1))return``;let n=ke.has(e);return t.indexOf(Q)>0||n?`← to collapse`:`→ to expand`},St=q.useCallback(async()=>{let e=Q?b(Q):void 0;if(!Q||!e){P(`list`),we(``);return}j.trim()&&(await ye(e,j.trim(),Q.fullPath),w&&h&&h()),P(`list`),we(``)},[Q,j,h,w]),Ct=q.useCallback(()=>{P(`list`),M(`tengu_session_search_toggled`,{enabled:!1})},[]),wt=q.useCallback(()=>{P(`search`),M(`tengu_session_search_toggled`,{enabled:!0})},[]),Tt=q.useCallback(async()=>{if(!z.trim()||!y||!pe)return;R.current?.abort();let t=new AbortController;R.current=t,Ue({status:`searching`}),M(`tengu_agentic_search_started`,{query_length:z.length});try{let n=await y(z,e,t.signal);if(t.signal.aborted)return;Ue({status:`results`,results:n,query:z}),M(`tengu_agentic_search_completed`,{query_length:z.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;Ue({status:`error`,message:e instanceof Error?e.message:`Search failed`}),M(`tengu_agentic_search_error`,{query_length:z.length})}},[z,y,pe,e]);q.useEffect(()=>{F.status!==`idle`&&F.status!==`searching`&&(F.status===`results`&&F.query!==z||F.status===`error`)&&Ue({status:`idle`})},[z,F]),q.useEffect(()=>()=>{R.current?.abort()},[]);let Et=q.useRef(F.status);q.useEffect(()=>{let e=Et.current;if(Et.current=F.status,e===`searching`&&F.status===`results`){if(w&&yt.length>0)Ne(yt[0]);else if(!w&&X.length>0){let e=X[0];Ne({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[F.status,w,yt,X]);let Dt=q.useCallback(e=>{let t=parseInt(e,10),n=X[t];!n||ze.current===t.toString()||(ze.current=t.toString(),Ne({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Fe(t+1))},[X]),Ot=q.useCallback(e=>{Ne(e);let t=X.findIndex(t=>b(t)===b(e.value.log));t>=0&&Fe(t+1)},[X]);d(`confirm:no`,()=>{R.current?.abort(),Ue({status:`idle`}),M(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:N!==`preview`&&F.status===`searching`}),d(`confirm:no`,()=>{P(`list`),we(``)},{context:`Settings`,isActive:N===`rename`&&F.status!==`searching`}),d(`confirm:no`,()=>{Ke(``),L(!1),o?.()},{context:`Confirmation`,isActive:N!==`preview`&&N!==`rename`&&N!==`search`&&I&&F.status!==`searching`}),ee((e,t)=>{if(N!==`preview`&&F.status!==`searching`&&N!==`rename`)if(N===`search`)e.toLowerCase()===`n`&&t.ctrl?Ct():(t.return||t.downArrow)&&z.trim()&&y&&pe&&F.status!==`results`&&L(!0);else{if(I){if(t.return){Tt(),L(!1);return}else if(t.downArrow){L(!1);return}else if(t.upArrow){P(`search`),L(!1);return}}if(W&&t.tab){let e=t.shift?-1:1;He(t=>{let n=((t<G.length?t:0)+G.length+e)%G.length,r=G[n];return M(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:et.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&v)v(),M(`tengu_session_all_projects_toggled`,{enabled:!_});else if(r===`b`&&t.ctrl){let e=!k;ve(e),M(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&Se){let e=!be;xe(e),M(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(P(`search`),M(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&Q?(P(`rename`),we(``),M(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&Q?(Re(Q),P(`preview`),M(`tengu_session_preview_opened`,{messageCount:Q.messageCount})):Q&&n&&e.length>0&&!/^\s+$/.test(e)&&(P(`search`),Ke(e),M(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let kt=[];k&&O&&kt.push(O),Se&&!be&&kt.push(`current worktree`);let At=8+ +(kt.length>0&&N!==`search`)+lt,$=Math.max(1,Math.floor((t-At-2)/3));return q.useEffect(()=>{if(!re)return;let e=$*2;Pe+e>=X.length&&re($*3)},[Pe,$,X.length,re]),e.length===0?null:N===`preview`&&Ie&&w?(0,J.jsx)(Ge,{log:Ie,onExit:()=>{P(`list`),Re(null)},onSelect:m}):(0,J.jsxs)(c,{flexDirection:`column`,height:t-1,children:[(0,J.jsx)(c,{flexShrink:0,children:(0,J.jsx)(i,{color:`suggestion`})}),(0,J.jsx)(c,{flexShrink:0,children:(0,J.jsx)(l,{children:` `})}),W?(0,J.jsx)(Je,{tabs:G,selectedIndex:K,availableWidth:S,showAllProjects:_}):(0,J.jsx)(c,{flexShrink:0,children:(0,J.jsxs)(l,{bold:!0,color:`suggestion`,children:[`Resume Session`,N===`list`&&X.length>$&&(0,J.jsxs)(l,{dimColor:!0,children:[` `,`(`,Pe,` of `,X.length,`)`]})]})}),(0,J.jsx)(te,{query:z,isFocused:N===`search`,isTerminalFocused:se,cursorOffset:qe}),kt.length>0&&N!==`search`&&(0,J.jsx)(c,{flexShrink:0,paddingLeft:2,children:(0,J.jsx)(l,{dimColor:!0,children:(0,J.jsx)(u,{children:kt})})}),(0,J.jsx)(c,{flexShrink:0,children:(0,J.jsx)(l,{children:` `})}),F.status===`searching`&&(0,J.jsxs)(c,{paddingLeft:1,flexShrink:0,children:[(0,J.jsx)(oe,{}),(0,J.jsx)(l,{children:` Searching…`})]}),F.status===`results`&&F.results.length>0&&(0,J.jsx)(c,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(l,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),F.status===`results`&&F.results.length===0&&ht.length===0&&(0,J.jsx)(c,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(l,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),F.status===`error`&&ht.length===0&&(0,J.jsx)(c,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(l,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&y&&pe&&F.status!==`searching`&&F.status!==`results`&&F.status!==`error`&&(0,J.jsxs)(c,{flexShrink:0,flexDirection:`column`,children:[(0,J.jsxs)(c,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(l,{color:I?`suggestion`:void 0,children:I?r.pointer:` `}),(0,J.jsx)(l,{color:I?`suggestion`:void 0,bold:I,children:`Search deeply using Claude →`})]}),(0,J.jsx)(c,{height:1})]}),F.status===`searching`?null:N===`rename`&&Q?(0,J.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,J.jsx)(l,{bold:!0,children:`Rename session:`}),(0,J.jsx)(c,{paddingTop:1,children:(0,J.jsx)(he,{value:j,onChange:we,onSubmit:St,placeholder:Ee(Q,`Enter new session name`),columns:S,cursorOffset:De,onChangeCursorOffset:Oe,showCursor:!0})})]}):w?(0,J.jsx)(tt,{nodes:yt,onSelect:e=>{m(e.value.log)},onFocus:Ot,onCancel:o,focusNodeId:je?.id,visibleOptionCount:$,layout:`expanded`,isDisabled:N===`search`||I,hideIndexes:!1,isNodeExpanded:e=>{if(N===`search`||k)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?ke.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(Ae(e=>new Set(e).add(t)),M(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Ae(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:wt}):(0,J.jsx)(ce,{options:bt,onChange:e=>{let t=X[parseInt(e,10)];t&&m(t)},visibleOptionCount:$,onCancel:o,onFocus:Dt,defaultFocusValue:je?.id.toString(),layout:`expanded`,isDisabled:N===`search`||I,onUpFromFirstItem:wt}),(0,J.jsx)(c,{paddingLeft:2,children:C.pending?(0,J.jsxs)(l,{dimColor:!0,children:[`Press `,C.keyName,` again to exit`]}):N===`rename`?(0,J.jsx)(l,{dimColor:!0,children:(0,J.jsxs)(u,{children:[(0,J.jsx)(a,{shortcut:`Enter`,action:`save`}),(0,J.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F.status===`searching`?(0,J.jsx)(l,{dimColor:!0,children:(0,J.jsxs)(u,{children:[(0,J.jsx)(l,{children:`Searching with Claude…`}),(0,J.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I?(0,J.jsx)(l,{dimColor:!0,children:(0,J.jsxs)(u,{children:[(0,J.jsx)(a,{shortcut:`Enter`,action:`search`}),(0,J.jsx)(a,{shortcut:`↓`,action:`skip`}),(0,J.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):N===`search`?(0,J.jsx)(l,{dimColor:!0,children:(0,J.jsxs)(u,{children:[(0,J.jsx)(l,{children:Xe&&T?`Searching…`:`Type to Search`}),(0,J.jsx)(a,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,J.jsx)(l,{dimColor:!0,children:(0,J.jsxs)(u,{children:[v&&(0,J.jsx)(a,{shortcut:`Ctrl+A`,action:`show ${_?`current dir`:`all projects`}`}),O&&(0,J.jsx)(a,{shortcut:`Ctrl+B`,action:`toggle branch`}),Se&&(0,J.jsx)(a,{shortcut:`Ctrl+W`,action:`show ${be?`current worktree`:`all worktrees`}`}),(0,J.jsx)(a,{shortcut:`Ctrl+V`,action:`preview`}),(0,J.jsx)(a,{shortcut:`Ctrl+R`,action:`rename`}),(0,J.jsx)(l,{children:`Type to search`}),(0,J.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),xt()&&(0,J.jsx)(l,{children:xt()})]})})})]})}function ut(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 dt(e){let t=(e.messages.length<=Y?e.messages:[...e.messages.slice(0,X),...e.messages.slice(-1e3)]).map(ut).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>Z?n.slice(0,Z):n}function ft(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 pt(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 q,J,mt,ht,Y,X,Z,gt,_t,vt,yt=e((()=>{m(),n(),He(),q=t(h(),1),y(),Re(),Ve(),fe(),g(),Ie(),ke(),je(),S(),we(),De(),_e(),O(),se(),T(),ze(),z(),k(),G(),ve(),rt(),J=v(),mt=2,ht=4,Y=2e3,X=1e3,Z=5e4,gt=.3,_t=60*1e3,vt=50}));function bt(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 Q(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-100/2)]).map(bt).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(e,t){return!!(Ee(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&&Q(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-i.length;a=[...i,...e.slice(0,n)]}A(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${j(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(C(e))try{return await D(e)}catch(t){return Oe(t),e}return e}),s=await Promise.all(o);A(`Agentic search: loaded ${j(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
-
${s.map((e,t)=>{let n=[`${t}:`],r=Ee(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=Q(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.`;A(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=Fe();A(`Agentic search using model: ${e}`);let t=(await x({model:e,system:Et,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return A(`No text content in agentic search response`),[];A(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return A(`Could not find JSON in agentic search response`),[];let i=(be(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return A(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return Oe(e),A(`Agentic search error: ${e}`),[]}}var Ct,wt,Tt,Et,Dt=e((()=>{Ce(),Se(),De(),Pe(),_e(),ue(),xe(),Ct=2e3,wt=100,Tt=100,Et=`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 Ot(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 ${N([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+I)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=b(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${N([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{y(),P(),_e()}));export{lt as a,Dt as i,kt as n,yt as o,St as r,Ot as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-662VDD70.js";import{o as s,s as c}from"./log-Duzb4o6h.js";import{B as l,G as u,_ as d,fi as f,mi as p,r as m}from"./model-BgrLt7P7.js";import{i as h,s as g}from"./metadata-CIx5CsoY.js";import{n as _,t as v}from"./config-DklnhNx1.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(),v(),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(_()||!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{w as i,I as n,C as r,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./datadog-BE6D_6m0.js";t();export{e as shutdownDatadog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as e,p as t}from"./debug-DiuXEmUq.js";e();export{t as logForDebugging};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,o as n}from"./detectRepository-B1PMTLAU.js";t();export{e as parseGitHubRepository,n as parseGitRemote};
|
|
@@ -1 +0,0 @@
|
|
|
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-BXhz8eUa.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 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,m as r,t as i,w as a}from"./v4-jw6qOKwQ.js";import{n as o,t as s}from"./lazySchema-uxlVVNM1.js";import{i as c,r as l}from"./semver-BMRJYn3q.js";import{r as u,s as d}from"./bridgeEnabled-D4JDZd0y.js";async function f(){let e=h,t=g().safeParse(e);return t.success?t.data:h}async function p(){let e=await f();return e.min_version&&c(`0.0.2`,e.min_version)?`Your version of Work Mate (0.0.2) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function m(){return d()?(await f()).should_show_app_upgrade_message:!1}var h,g,_=e((()=>{i(),s(),l(),u(),h={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},g=o(()=>a({init_retry_max_attempts:n().int().min(1).max(10).default(3),init_retry_base_delay_ms:n().int().min(100).default(500),init_retry_jitter_fraction:n().min(0).max(1).default(.25),init_retry_max_delay_ms:n().int().min(500).default(4e3),http_timeout_ms:n().int().min(2e3).default(1e4),uuid_dedup_buffer_size:n().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:n().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:n().min(0).max(.5).default(.1),token_refresh_buffer_ms:n().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:n().int().min(500).max(2e3).default(1500),connect_timeout_ms:n().int().min(5e3).max(6e4).default(15e3),min_version:t().refine(e=>{try{return c(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{m as a,_ as i,p as n,f as r,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t}from"./envLessBridgeConfig-3kCrKZl7.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{E as r,O as i,S as a,i as o,l as s,n as c,s as l,v as u}from"./esm-lWlUmoUA.js";import{C as d,D as f,E as p,I as m,O as h,S as ee,V as te,_ as ne,a as g,d as re,k as ie,l as ae,n as oe,p as se,s as ce,t as le,w as ue,x as de,y as _}from"./esm-Cb-L4oAk.js";import{a as v,r as fe,t as y}from"./esm-Bx6rTxIs.js";import{arch as pe,hostname as me,platform as he,release as ge}from"os";import{inspect as _e}from"util";import*as ve from"process";function ye(e){return e.setValue(b,!0)}function be(e){return e.getValue(b)===!0}var b,x=e((()=>{c(),b=i(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function xe(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Se(n)){l.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ce(r)){l.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Se(e){return typeof e==`string`&&e!==``}function Ce(e){return e==null?!0:Array.isArray(e)?we(e):Te(typeof e)}function we(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Te(e)){t=e;continue}return!1}return!1}}return!0}function Te(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var S=e((()=>{c()}));function Ee(){return e=>{l.error(De(e))}}function De(e){return typeof e==`string`?e:JSON.stringify(Oe(e))}function Oe(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var C=e((()=>{c()}));function ke(e){try{w(e)}catch{}}var w,T=e((()=>{C(),w=Ee()}));function Ae(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){l.warn(`Unknown value ${_e(t)} for ${e}, expected a number, using defaults`);return}return n}function E(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var D=e((()=>{c()})),O,je=e((()=>{O=`2.9.0`})),k,Me=e((()=>{k=`process.runtime.name`})),A,Ne=e((()=>{je(),_(),Me(),A={[f]:`opentelemetry`,[k]:`node`,[p]:ie,[h]:O}})),j,M=e((()=>{D(),Ne(),j=performance})),Pe=e((()=>{M()}));function N(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Ue)]}function Fe(e){return Ve(N(j.timeOrigin),N(typeof e==`number`?e:j.now()))}function Ie(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=P),[n,r]}function Le(e){return e[0]*1e6+e[1]/1e3}function Re(e){return e[0]+e[1]/P}function ze(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Be(e){return ze(e)||typeof e==`number`||e instanceof Date}function Ve(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=P&&(n[1]-=P,n[0]+=1),n}var He,Ue,P,We=e((()=>{Pe(),He=9,Ue=10**6,P=10**He})),F,Ge=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(F||(F={}))}));function Ke(e){if(!qe(e)||Je(e)!==Ze)return!1;let t=tt(e);if(t===null)return!0;let n=R.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&I.call(n)===et}function qe(e){return typeof e==`object`&&!!e}function Je(e){return e==null?e===void 0?$e:Qe:z&&z in Object(e)?Ye(e):Xe(e)}function Ye(e){let t=R.call(e,z),n=e[z],r=!1;try{e[z]=void 0,r=!0}catch{}let i=B.call(e);return r&&(t?e[z]=n:delete e[z]),i}function Xe(e){return B.call(e)}var Ze,Qe,$e,I,et,tt,L,R,z,B,nt=e((()=>{Ze=`[object Object]`,Qe=`[object Null]`,$e=`[object Undefined]`,I=Function.prototype.toString,et=I.call(Object),tt=Object.getPrototypeOf,L=Object.prototype,R=L.hasOwnProperty,z=Symbol?Symbol.toStringTag:void 0,B=L.toString}));function rt(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=it(t,e.shift(),0,n);return t}function V(e){return H(e)?e.slice():e}function it(e,t,n=0,r){let i;if(!(n>ct)){if(n++,W(e)||W(t)||ot(t))i=V(t);else if(H(e)){if(i=e.slice(),H(t))for(let e=0,n=t.length;e<n;e++)i.push(V(t[e]));else if(U(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=V(t[r]))}}}else if(U(e))if(U(t)){if(!st(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(W(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(at(e,s,r)||at(t,s,r))delete i[s];else{if(U(a)&&U(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=it(i[s],c,n,r)}}}}else i=t;return i}}function at(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function H(e){return Array.isArray(e)}function ot(e){return typeof e==`function`}function U(e){return!W(e)&&!H(e)&&!ot(e)&&typeof e==`object`}function W(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function st(e,t){return!(!Ke(e)||!Ke(t))}var ct,lt=e((()=>{nt(),ct=20})),ut,dt=e((()=>{t(),ut=class{constructor(){n(this,`_promise`,void 0),n(this,`_resolve`,void 0),n(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),ft,pt=e((()=>{dt(),t(),ft=class{constructor(e,t){n(this,`_isCalled`,!1),n(this,`_deferred`,new ut),n(this,`_callback`,void 0),n(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function mt(e,t){return new Promise(n=>{s.with(ye(s.active()),()=>{e.export(t,n)})})}var ht=e((()=>{c(),x()})),gt,G=e((()=>{x(),S(),T(),C(),We(),Ge(),Pe(),lt(),pt(),ht(),gt={_export:mt}}));function _t(){if(K===void 0)try{let e=globalThis.process.argv0;K=e?`unknown_service:${e}`:`unknown_service`}catch{K=`unknown_service`}return K}var K,vt=e((()=>{})),q,yt=e((()=>{q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function bt(e,t){return Tt.FromAttributeList(Object.entries(e),t)}function xt(){return bt({[ue]:_t(),[p]:A[p],[f]:A[f],[h]:A[h]})}function St(e){return e.map(([e,t])=>q(t)?[e,t.catch(t=>{l.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Ct(e){if(typeof e==`string`||e===void 0)return e;l.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function wt(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;l.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Tt,Et=e((()=>{c(),G(),_(),vt(),yt(),t(),Tt=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=St(t),r._asyncAttributesPending=t.filter(([e,t])=>q(t)).length>0,r}constructor(e,t){n(this,`_rawAttributes`,void 0),n(this,`_asyncAttributesPending`,!1),n(this,`_schemaUrl`,void 0),n(this,`_memoizedAttributes`,void 0);let r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([e,t])=>(q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=St(this._rawAttributes),this._schemaUrl=Ct(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&l.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(q(n)){l.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=wt(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),Dt,Ot,kt=e((()=>{c(),_(),G(),t(),Dt=class{constructor(){n(this,`_MAX_LENGTH`,255),n(this,`_COMMA_SEPARATOR`,`,`),n(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=E(`OTEL_RESOURCE_ATTRIBUTES`),r=E(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){l.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[ue]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},Ot=new Dt})),At,jt,Mt,Nt,Pt,J=e((()=>{At=`host.arch`,jt=`host.id`,Mt=`host.name`,Nt=`os.type`,Pt=`os.version`}));async function Ft(){if(!Y)switch(ve.platform){case`darwin`:Y=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:Y=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:Y=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:Y=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:Y=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return Y()}var Y,It=e((()=>{})),Lt,Rt,zt=e((()=>{Lt=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},Rt=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),Bt,Vt,Ht=e((()=>{J(),It(),zt(),Bt=class{detect(e){return{attributes:{[Mt]:me(),[At]:Lt(pe()),[jt]:Ft()}}}},Vt=new Bt})),Ut,Wt,Gt=e((()=>{J(),zt(),Ut=class{detect(e){return{attributes:{[Nt]:Rt(he()),[Pt]:ge()}}}},Wt=new Ut})),Kt=e((()=>{Ht(),Gt(),J()})),qt=e((()=>{Kt()})),Jt=e((()=>{kt(),qt()})),Yt=e((()=>{Et(),Jt(),vt()}));function Xt(e){return X(e,new WeakSet)}function X(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>X(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>X(e,t))}return!1}var Zt=e((()=>{})),Qt,$t=e((()=>{c(),g(),_(),Zt(),t(),Qt=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,r){n(this,`hrTime`,void 0),n(this,`hrTimeObserved`,void 0),n(this,`spanContext`,void 0),n(this,`resource`,void 0),n(this,`instrumentationScope`,void 0),n(this,`attributes`,{}),n(this,`_severityText`,void 0),n(this,`_severityNumber`,void 0),n(this,`_body`,void 0),n(this,`_eventName`,void 0),n(this,`_attributesCount`,0),n(this,`_droppedAttributesCount`,0),n(this,`_isReadonly`,!1),n(this,`_logRecordLimits`,void 0);let{timestamp:i,observedTimestamp:a,eventName:s,severityNumber:c,severityText:l,body:d,attributes:f={},exception:p,context:m}=r,h=Date.now();if(this.hrTime=ne(i??h),this.hrTimeObserved=ne(a??h),m){let e=o.getSpanContext(m);e&&u(e)&&(this.spanContext=e)}this.severityNumber=c,this.severityText=l,this.body=d,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=s,this.setAttributes(f),p!=null&&this._setException(p)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return l.warn(`Invalid attribute key: ${e}`),this;if(!Xt(t))return l.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&l.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return l.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(de,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(d,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(d,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(de,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(ee,n.stack),t=!0)}t||l.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&l.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),en,tn=e((()=>{y(),c(),$t(),t(),en=class{constructor(e,t){n(this,`instrumentationScope`,void 0),n(this,`_sharedState`,void 0),n(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||s.active(),r=e.severityNumber??v.UNSPECIFIED;if(r!==v.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=o.getSpanContext(n);if(e&&u(e)&&(e.traceFlags&a.SAMPLED)!==a.SAMPLED)return}let i=new Qt(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==v.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||s.active();if(t.traceBased){let e=o.getSpanContext(r);if(e&&u(e)&&(e.traceFlags&a.SAMPLED)!==a.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),nn,rn=e((()=>{nn=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),an,on=e((()=>{g(),t(),an=class{constructor(e,t){n(this,`processors`,void 0),n(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>ae(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function sn(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var cn=e((()=>{})),ln,un=e((()=>{ln=`otel.sdk.log.created`})),Z,dn=e((()=>{un(),t(),Z=class{constructor(e){n(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(ln,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),fn,pn=e((()=>{fn=`0.215.0`})),mn,Q,hn,gn=e((()=>{c(),y(),rn(),on(),cn(),dn(),pn(),t(),mn={disabled:!1,minimumSeverity:v.UNSPECIFIED,traceBased:!1},Q=()=>({...mn}),hn=class{constructor(e,t,i,a,o,s){n(this,`loggers`,new Map),n(this,`activeProcessor`,void 0),n(this,`registeredLogRecordProcessors`,[]),n(this,`resource`,void 0),n(this,`forceFlushTimeoutMillis`,void 0),n(this,`logRecordLimits`,void 0),n(this,`processors`,void 0),n(this,`loggerMetrics`,void 0),n(this,`_loggerConfigurator`,void 0),n(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=i,this.processors=a,a.length>0?(this.registeredLogRecordProcessors=a,this.activeProcessor=new an(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new nn,this._loggerConfigurator=o??Q;let c=s?s.getMeter(`@opentelemetry/sdk-logs`,fn):r();this.loggerMetrics=new Z(c)}getLoggerConfig(e){let t=sn(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),_n,vn=e((()=>{c(),y(),le(),g(),tn(),gn(),t(),_n=class{constructor(e={}){n(this,`_shutdownOnce`,void 0),n(this,`_sharedState`,void 0);let t={resource:e.resource??oe(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Q,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new hn(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new ce(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return l.warn(`A shutdown LoggerProvider cannot provide a Logger`),fe;e||l.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new en({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(l.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(l.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),yn,bn=e((()=>{g(),yn=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:se(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:re.SUCCESS})}}}));async function xn(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var $,Sn,Cn=e((()=>{c(),g(),t(),$=class{constructor(e,t,r){n(this,`_exportCompleted`,void 0),n(this,`_exportScheduledPromise`,void 0),n(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,r)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await xn(t),await s.with(te(s.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){m(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===re.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},Sn=class{constructor(e,t){n(this,`_maxExportBatchSize`,void 0),n(this,`_maxQueueSize`,void 0),n(this,`_scheduledDelayMillis`,void 0),n(this,`_exportTimeoutMillis`,void 0),n(this,`_exporter`,void 0),n(this,`_currentExport`,null),n(this,`_finishedLogRecords`,[]),n(this,`_timer`,void 0),n(this,`_shutdownOnce`,void 0),n(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new ce(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(l.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new $(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){m(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new $(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,m(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),wn,Tn=e((()=>{Cn(),wn=class extends Sn{onShutdown(){}}})),En=e((()=>{Tn()})),Dn=e((()=>{En()})),On=e((()=>{vn(),bn(),Dn()}));export{Re as A,ke as B,rt as C,Fe as D,Ve as E,M as F,x as G,S as H,j as I,be as K,Ae as L,Be as M,ze as N,Ie as O,N as P,E as R,lt as S,Ge as T,Ce as U,T as V,xe as W,bt as _,bn as a,ft as b,Yt as c,Vt as d,Ht as f,Et as g,xt as h,yn as i,We as j,Le as k,Gt as l,kt as m,wn as n,_n as o,Ot as p,ye as q,Tn as r,vn as s,On as t,Wt as u,G as v,F as w,pt as x,gt as y,D as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{E as t,k as n}from"./debug-DiuXEmUq.js";import{execSync as r}from"child_process";function i(e,t){return n`execSync: ${e.slice(0,100)}`,r(e,t)}var a=e((()=>{t()}));export{a as n,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
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{Ct as r,ES as i,Et as a,Il as o,Ll as s,OS as c,XE as l,YE as u}from"./loadAgentsDir-ZQwvbURI.js";import{n as d,t as f}from"./ExitFlow-B1XNACQP.js";import{spawnSync as p}from"child_process";function m(){return l(_)??`Goodbye!`}async function h(e){if(s())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=r()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await i(0,`prompt_input_exit`),null)}var g,_;e((()=>{u(),t(),d(),o(),c(),a(),g=n(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./extra-usage-nRFfBiXh.js";e();export{t as call};
|
|
@@ -1 +0,0 @@
|
|
|
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{$b as r,Qb as i}from"./loadAgentsDir-ZQwvbURI.js";import{n as a,t as o}from"./extra-usage-core-Dh4rVUI-.js";async function s(e,t){let n=await a();return n.type===`message`?(e(n.value),null):(0,c.jsx)(i,{onDone:()=>{t.onChangeAPIKey(),e(`Login successful`)}})}var c,l=e((()=>{t(),r(),o(),c=n()}));export{l as n,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{eu as e,nu as t,ru as n,tu as r}from"./loadAgentsDir-ZQwvbURI.js";n();export{e as drainPendingExtraction,r as executeExtractMemories,t as initExtractMemories};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./fast-DkUxqWhE.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,s as n}from"./firstPartyEventLogger-BQYrBdvD.js";e();export{t as initialize1PEventLogging,n as shutdown1PEventLogging};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,n as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{en as p,ht as m,z as ee}from"./state-ix0xIunV.js";import{n as te,t as ne}from"./cwd-CYmmnQVS.js";import{E as h,J as re,K as ie,O as g,U as ae,l as _,p as v,z as y}from"./debug-DiuXEmUq.js";import{Xt as oe,Zt as se}from"./settings-BhvhCpVh.js";import{c as ce,f as le,g as b,n as ue}from"./config-662VDD70.js";import{c as de,o as fe}from"./execFileNoThrow-DResQRvR.js";import{o as pe,s as x}from"./log-Duzb4o6h.js";import{a as me,i as he,o as ge}from"./platform-B5dCGT8t.js";import{l as _e,s as ve}from"./types-Cnorfsss.js";import{a as ye,n as be}from"./analytics-BotDBGh0.js";import{i as S,n as xe}from"./startupProfiler-BquH_Yqm.js";import{Bt as Se,It as Ce,Kt as we,Mt as C,Pt as Te,Ur as Ee,Vt as w,Wr as De,er as Oe,ir as ke,kt as Ae,lr as je,ur as Me,vn as Ne,yn as Pe}from"./model-BgrLt7P7.js";import{d as Fe,i as Ie,s as T}from"./metadata-CIx5CsoY.js";import{n as Le,t as Re}from"./config-DklnhNx1.js";import{_ as ze,c as Be,n as Ve,o as He,t as Ue,v as We,w as E}from"./esm-C8Zkk1Ux.js";import*as D from"path";import{randomUUID as O}from"crypto";import{appendFile as Ge,mkdir as k,readdir as Ke,unlink as A,writeFile as qe}from"fs/promises";async function Je(){j===null&&!M&&(M=Ze(),j=await M,M=null,N.cache.clear?.())}function Ye(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Xe(){if(j!==null)return j;let e=C();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`&&process.env.COO_CREATOR)return`${process.env.COO_CREATOR}@anthropic.com`}async function Ze(){let e=C();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`)return process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:P()}var j,M,N,P,F=e((()=>{de(),n(),p(),w(),b(),te(),se(),a(),j=null,M=null,N=t(e=>{let t=le(),n=ce(),i,a,o;if(e&&(i=Ce()??void 0,a=Te()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=C(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Xe(),appVersion:`0.0.2`,platform:oe(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:i,rateLimitTier:a,firstTokenTime:o,...r(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),P=t(async()=>{let e=await fe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function Qe(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,$e=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=Qe();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function et(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,tt=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=et();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function nt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function rt(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function it(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function at(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function ot(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):ot(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,st=e((()=>{$e(),tt(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=nt();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=rt();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=it();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=at();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return D.join(i(),`telemetry`)}function ct(e){if(!d.isAxiosError(e))return y(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,lt=e((()=>{We(),f(),p(),st(),w(),b(),_(),a(),ae(),ke(),ve(),pe(),Ne(),h(),Me(),Ee(),be(),T(),o(),q=O(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return D.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await _e(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await A(e)}catch{}else await k(K(),{recursive:!0}),await qe(e,t.map(e=>g(e)).join(`
|
|
2
|
-
`)+`
|
|
3
|
-
`,`utf8`)}catch(e){x(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await k(K(),{recursive:!0}),await Ge(e,t.map(e=>g(e)).join(`
|
|
4
|
-
`)+`
|
|
5
|
-
`,`utf8`)}catch(e){x(e)}}async deleteFile(e){try{await A(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(ie(e))return;throw e}for(let e of t){let t=D.join(K(),e);this.retryFileInBackground(t)}}catch(e){x(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}process.env.USER_TYPE===`ant`&&v(`1P event logging: retrying ${t.length} events from previous batch`);let n=await this.sendEventsInBatches(t);n.length===0?(await this.deleteFile(e),process.env.USER_TYPE===`ant`&&v(`1P event logging: previous batch retry succeeded`)):(await this.saveEventsToFile(e,n),process.env.USER_TYPE===`ant`&&v(`1P event logging: previous batch retry failed, ${n.length} events remain`))}async export(e,t){if(this.isShutdown){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: Exporter has been shutdown`),t({code:E.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:E.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:E.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:E.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:E.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:E.SUCCESS})}catch(e){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: ${y(e)}`),x(e),t({code:E.FAILED,error:re(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));process.env.USER_TYPE===`ant`&&v(`1P event logging: exporting ${e.length} events in ${t.length} batch(es)`);let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=ct(i);for(let r=e;r<t.length;r++)n.push(...t[r]);if(process.env.USER_TYPE===`ant`){let n=t.length-1-e;v(`1P event logging: batch ${e+1}/${t.length} failed (${r}); short-circuiting ${n} remaining batch(es)`)}break}e<t.length-1&&this.batchDelayMs>0&&await Pe(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;x(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);process.env.USER_TYPE===`ant`&&v(`1P event logging: scheduling backoff retry in ${e}ms (attempt ${this.attempts})`),this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){process.env.USER_TYPE===`ant`&&v(`1P event logging: max attempts (${this.maxAttempts}) reached, dropping ${t.length} events`),await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e),process.env.USER_TYPE===`ant`&&v(`1P event logging: retrying ${t.length} failed events (attempt ${this.attempts+1})`);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff(),process.env.USER_TYPE===`ant`&&v(`1P event logging: backoff retry succeeded`)}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":je(),"x-service-name":`claude-code`},n=ue()||ee();process.env.USER_TYPE===`ant`&&!n&&v(`1P event logging: Trust not accepted`);let r=this.skipAuth||!n;if(!r&&we()){let e=Ae();Se()?e&&De(e.expiresAt)&&(r=!0,process.env.USER_TYPE===`ant`&&v(`1P event logging: OAuth token expired, skipping auth to avoid 401`)):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:Oe(),a=!i.error;!a&&process.env.USER_TYPE===`ant`&&v(`1P event logging: auth not available, sending without auth`);let o=a?{...t,...i.headers}:t;try{let t=await d.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&d.isAxiosError(n)&&n.response?.status===401){process.env.USER_TYPE===`ant`&&v(`1P event logging: 401 auth error, retrying without auth`);let n=await d.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){process.env.USER_TYPE===`ant`&&(v(`1P event logging: ${e} events exported successfully${t?` (with auth)`:` (without auth)`}`),v(`API Response: ${g(n,null,2)}`))}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{},r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){process.env.USER_TYPE===`ant`&&v(`1P event logging: core_metadata missing for event ${r}`),t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:m(),additional_metadata:Buffer.from(g({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Fe(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=ye(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(g(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush(),process.env.USER_TYPE===`ant`&&v(`1P event logging exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),process.env.USER_TYPE===`ant`&&v(`1P event logging exporter flush complete`)}}}));function ut(e){return!1}var dt=e((()=>{}));function ft(){return{}}function pt(e){let t=ft()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}async function mt(){if($)try{await $.shutdown(),process.env.USER_TYPE===`ant`&&v(`1P event logging: final shutdown complete`)}catch{}}function X(){return!Le()}async function ht(e,t,n={}){try{let r=await Ie({model:n.model,betas:n.betas}),i={event_name:t,event_id:O(),core_metadata:r,user_metadata:N(!0),event_metadata:n},a=le();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&v(`[ANT-ONLY] 1P event: ${t} ${g(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&x(e)}}function gt(e,t={}){X()&&(!Q||ut(`firstParty`)||ht(Q,e,t))}function _t(){if(S(`1p_event_logging_start`),!X()){process.env.USER_TYPE===`ant`&&v(`1P event logging not enabled`);return}S(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||vt.toString(),10),t=yt,n=Z,r=he(),i={[l]:`claude-code`,[c]:`0.0.2`};if(r===`wsl`){let e=me();e&&(i[`wsl.version`]=e)}$=new He({resource:ze(i),processors:[new Ve(new Y({maxBatchSize:t,isKilled:()=>ut(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.2`)}var vt,yt,Z,Q,$,bt=e((()=>{Be(),Ue(),u(),b(),_(),pe(),ge(),h(),xe(),F(),Re(),lt(),T(),dt(),vt=1e4,yt=200,Z=8192,Q=null,$=null}));export{gt as a,P as c,Ye as d,X as i,Je as l,bt as n,pt as o,_t as r,mt as s,ft as t,F as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jo as t,Ko as n,at as r,ct as i,fo as a,zo as o}from"./loadAgentsDir-ZQwvbURI.js";import{U as s,l as c,p as l,z as u}from"./debug-DiuXEmUq.js";import{a as d,l as f}from"./proxy-CHnxhNZI.js";import{$ as p,J as m,K as h,P as g,Y as _,Z as v,nt as y}from"./rcDebugLog-CivJaJ3V.js";import{n as b,r as x}from"./SSETransport-Chj_yfPv.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${u(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${u(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),s(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,r,o,s,c,u){try{let a=y(c.model),d=t(e,o),f=(await Promise.all(o.map(e=>i(e,{getToolPermissionContext:c.getToolPermissionContext,tools:o,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:g,systemInstruction:b}=v(d,r),x=_(f),C=m(c.toolChoice),w=T({model:a,signal:s,fetchOverride:c.fetchOverride,body:{contents:g,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${a}, messages=${g.length}, tools=${x.length}`);let E=h(w,a),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[p]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:n([t],o,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield a({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{r(),c(),o(),O(),g()}))();export{k as queryModelGemini};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Do as n,Ml as r,So as i,kl as a,zo as o}from"./loadAgentsDir-ZQwvbURI.js";import{Y as s,l as c,nt as l,p as u}from"./debug-DiuXEmUq.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-DaxZe0Xw.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let t=a();if(!t)return u(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let o=new AbortController;e.addEventListener(`abort`,()=>o.abort(),{once:!0});try{let{messages:a}=await r({promptMessages:[i({content:await d()})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:o},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let s=a.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(s)return{kind:`api-error`,text:n(s)??``};let c=a.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!c)return{kind:`failed`};let l=n(c);return!l||l.trim().length===0?{kind:`failed`}:{kind:`ok`,text:l.trim()}}catch(t){return t instanceof l||e.aborted||o.signal.aborted?{kind:`aborted`}:(u(`[recap] generation failed: ${t}`),{kind:`failed`})}}var p,m;e((()=>{s(),c(),t(),o(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t,i as n,p as r,r as i}from"./git-Cgc8X5l2.js";e();export{i as findGitRoot,n as getBranch,t as getDefaultBranch,r as getRemoteUrl};
|
|
@@ -1,6 +0,0 @@
|
|
|
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"./defineProperty-C-QyHrDq.js";import{br as a,en as o}from"./state-ix0xIunV.js";import{n as s,t as c}from"./cwd-CYmmnQVS.js";import{E as ee,O as te,_ as l,h as u,l as ne,ot as re,st as ie}from"./debug-DiuXEmUq.js";import{r as ae,t as d}from"./execFileNoThrow-DResQRvR.js";import{o as oe}from"./log-Duzb4o6h.js";import{n as f,t as se}from"./memoize-DgMjqLtn.js";import{r as ce,t as le}from"./which-sEFQXpaX.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as de}from"path";import{readFileSync as g,realpathSync as _,statSync as v,unwatchFile as y,watchFile as fe}from"fs";import{createHash as pe}from"crypto";import{readFile as b,readdir as me,stat as he}from"fs/promises";function x(e,t,n){let r=ge();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=u(),o=te(i)+`
|
|
2
|
-
`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function ge(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function _e(e,t,n){let r=Date.now();x(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return x(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw x(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var S=e((()=>{l(),ee()}));async function C(e,t,n,r){try{return ve(await b(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function ve(e,t,n,r){let i=e.split(`
|
|
3
|
-
`),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=Se(t,a,n);continue}if(!s)continue;let r=ye(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ye(e){let t=0;for(;t<e.length&&Ce(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:be(e,t)}}function be(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
|
|
4
|
-
`;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=xe(n)),n}function xe(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function Se(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function Ce(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var w=e((()=>{}));function we(){M.clear()}async function T(e){let t=h(e??c()),n=M.get(t);if(n!==void 0)return n;let r=B(t);if(!r)return M.set(t,null),null;let i=m(r,`.git`);try{if((await he(i)).isFile()){let e=(await b(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return M.set(t,n),n}}return M.set(t,i),i}catch{return M.set(t,null),null}}function E(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function D(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function O(e){try{let t=(await b(m(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return E(e)?{type:`branch`,name:e}:null}if(!E(n))return null;let r=await k(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return D(t)?{type:`detached`,sha:t}:null}catch{return null}}async function k(e,t){let n=await A(e,t);if(n)return n;let r=await j(e);return r&&r!==e?A(r,t):null}async function A(e,t){try{let n=(await b(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return E(t)?k(e,t):null}return D(n)?n:null}catch{}try{let n=await b(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
|
|
5
|
-
`)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return D(t)?t:null}}}catch{}return null}async function j(e){try{return h(e,(await b(m(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function Te(e,t,n){try{let r=(await b(m(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return E(t)?t:null}}}catch{}return null}async function Ee(){let e=await T();if(!e)return`HEAD`;let t=await O(e);return t&&t.type===`branch`?t.name:`HEAD`}async function De(){let e=await T();if(!e)return``;let t=await O(e);return t?t.type===`branch`?await k(e,`refs/heads/${t.name}`)??``:t.sha:``}async function Oe(){let e=await T();if(!e)return null;let t=await C(e,`remote`,`origin`,`url`);if(t)return t;let n=await j(e);return n&&n!==e?C(n,`remote`,`origin`,`url`):null}async function ke(){let e=await T();if(!e)return`main`;let t=await j(e)??e,n=await Te(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await k(t,`refs/remotes/origin/${e}`))return e;return`main`}function Ae(){return F.get(`branch`,Ee)}function je(){return F.get(`head`,De)}function Me(){return F.get(`remoteUrl`,Oe)}function Ne(){return F.get(`defaultBranch`,ke)}async function Pe(e){let t=await T(e);if(!t)return null;let n=await O(t);return n?n.type===`branch`?k(t,`refs/heads/${n.name}`):n.sha:null}async function Fe(e){let t;try{let n=(await b(m(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=h(e,n.slice(7).trim())}catch{return null}let n=await O(t);return n?n.type===`branch`?k(t,`refs/heads/${n.name}`):n.sha:null}async function Ie(e){let t=await T(e);if(!t)return null;let n=await C(t,`remote`,`origin`,`url`);if(n)return n;let r=await j(t);return r&&r!==t?C(r,`remote`,`origin`,`url`):null}async function Le(){try{let e=await T();return e?(await me(m(await j(e)??e,`worktrees`))).length+1:0}catch{return 1}}var M,N,P,F,I=e((()=>{o(),re(),s(),$(),w(),r(),M=new Map,N=1e3,P=class{constructor(){i(this,`gitDir`,null),i(this,`commonDir`,null),i(this,`initialized`,!1),i(this,`initPromise`,null),i(this,`watchedPaths`,[]),i(this,`branchRefPath`,null),i(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await T(),this.initialized=!0,this.gitDir&&(this.commonDir=await j(this.gitDir),this.watchPath(m(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(m(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ie(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),fe(e,{interval:N},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await O(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?m(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(y(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await a(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)y(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},F=new P}));function Re(){function e(e){let t=z(e);return t===R?null:t}return e.cache=z.cache,e}function ze(){function e(e){let t=B(e);return t?V(t):null}return e.cache=V.cache,e}function Be(e){return T(e)}function L(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n&&n[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r&&r[1]&&r[2]){let e=r[1],t=r[2];if(Ue(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function Ve(){let e=await J();if(!e)return null;let t=L(e);return t?pe(`sha256`).update(t).digest(`hex`).substring(0,16):null}async function He(){try{let[e,t,n,r,i,a]=await Promise.all([K(),q(),J(),Y(),X(),Q()]);return{commitHash:e,branchName:t,remoteUrl:n,isHeadOnRemote:r,isClean:i,worktreeCount:a}}catch{return null}}function Ue(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function We(){let e=u(),t=c(),n=m(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=m(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(m(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(m(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(m(t,`refs`)).isDirectory())return!0}catch{}return!1}var R,z,B,V,H,U,W,G,K,q,Ge,J,Y,X,Z,Q,Ke,$=e((()=>{n(),s(),ne(),S(),ae(),l(),I(),oe(),se(),le(),R=Symbol(`git-root-not-found`),z=f(e=>{let t=Date.now();x(`info`,`find_git_root_started`);let n=h(e),r=n.substring(0,n.indexOf(de)+1)||de,i=0;for(;n!==r;){try{let e=m(n,`.git`);i++;let r=v(e);if(r.isDirectory()||r.isFile())return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=p(n);if(e===n)break;n=e}try{let e=m(r,`.git`);i++;let n=v(e);if(n.isDirectory()||n.isFile())return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),R},e=>e,50),B=Re(),V=f(e=>{try{let t=g(m(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=h(e,t.slice(7).trim()),r=h(n,g(m(n,`commondir`),`utf-8`).trim());return h(p(n))!==m(r,`worktrees`)||_(g(m(n,`gitdir`),`utf-8`).trim())!==m(_(e),`.git`)?e:ue(r)===`.git`?p(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),H=ze(),U=t(()=>ce(`git`)||`git`),W=t(async()=>{let e=Date.now();x(`info`,`is_git_check_started`);let t=B(c())!==null;return x(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),G=async e=>B(e)!==null,K=async()=>je(),q=async()=>Ae(),Ge=async()=>Ne(),J=async()=>Me(),Y=async()=>{let{code:e}=await d(U(),[`rev-parse`,`@{u}`],{preserveOutputOnError:!1});return e===0},X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await d(U(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await d(U(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
|
|
6
|
-
`).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Le(),Ke=async e=>{try{let t=e||`Work Mate auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await d(U(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await d(U(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{C as A,Pe as C,T as D,Fe as E,x as M,_e as N,k as O,j as S,I as T,$ as _,Ge as a,Ke as b,He as c,W as d,Y as f,U as g,Q as h,q as i,S as j,w as k,K as l,Ve as m,H as n,Z as o,J as p,B as r,Be as s,G as t,X as u,We as v,Ie as w,we as x,L as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Zt as e,dn as t,vn as n,yn as r}from"./loadAgentsDir-ZQwvbURI.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{A as i,p as a,t as o,w as s}from"./v4-jw6qOKwQ.js";import{en as c,ht as l}from"./state-ix0xIunV.js";import{l as u,p as d}from"./debug-DiuXEmUq.js";import{n as f,t as p}from"./lazySchema-uxlVVNM1.js";import{a as m,n as h,t as g}from"./bridgeConfig-DDF3teRE.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),o(),c(),u(),t(),p(),m();var S=3e4;function C(e){d(`[bridge:inbound-attach] ${e}`)}var w=f(()=>s({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,l())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./inboundAttachments-BZ6MKpxd.js";export{e as resolveAndPrepend};
|