@readmagic/workmate 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-BSLHrjbt.js → AddWorkspaceDirectory-mANiG0xj.js} +1 -1
- package/dist/chunks/{App-DY5O6IKw.js → App-aUVaOLeo.js} +1 -1
- package/dist/chunks/{ApproveApiKey-BEzfC6r3.js → ApproveApiKey-36iUE5CW.js} +1 -1
- package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-Ce3PraaD.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-B68V1bCq.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CTWhpIm8.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
- package/dist/chunks/{DesktopHandoff-BRbU4is4.js → DesktopHandoff-Blg1TVut.js} +1 -1
- package/dist/chunks/{DiffDialog-CBluIK-x.js → DiffDialog-CUEpuocY.js} +2 -2
- package/dist/chunks/Doctor-B540I-gq.js +1 -0
- package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
- package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
- package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
- package/dist/chunks/{Grove--kttLxvs.js → Grove-D9lSG_Lh.js} +1 -1
- package/dist/chunks/Grove-DLYXL8hv.js +1 -0
- package/dist/chunks/{HybridTransport-BgV5_7Az.js → HybridTransport-8j0AviF6.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-DCGwXW_p.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-jTwsdXWr.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
- package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
- package/dist/chunks/{McpParsingWarnings-WQrWJeWP.js → McpParsingWarnings-D0XvLirX.js} +1 -1
- package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
- package/dist/chunks/Messages-Dv2VrytX.js +11 -0
- package/dist/chunks/{Onboarding-BoIVNCgc.js → Onboarding-B1WRpoBI.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-1FCN8bH3.js → OverageCreditUpsell-BSmgq089.js} +1 -1
- package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-CrGST0Cq.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-B2TDpbpw.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
- package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
- package/dist/chunks/REPL-B3RbzeV7.js +1 -0
- package/dist/chunks/{REPL-BV4WyYMg.js → REPL-CA8FEO7J.js} +44 -44
- package/dist/chunks/{RemoteCallout-DS_EV6Fh.js → RemoteCallout-BFzCx_Pn.js} +1 -1
- package/dist/chunks/RemoteSessionManager-BhUrtejX.js +2 -0
- package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
- package/dist/chunks/{SSETransport-BXiEBMpb.js → SSETransport-DGIytG74.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
- package/dist/chunks/Settings-BvhG1XoW.js +2 -0
- package/dist/chunks/{TeleportProgress-CcDzMC5L.js → TeleportProgress-Bens06DU.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DZbxl4sD.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-EowJO5nm.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
- package/dist/chunks/{ThemePicker-BYbChJpu.js → ThemePicker-BTfuZZ7E.js} +1 -1
- package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
- package/dist/chunks/{ValidationErrorsList-Cx-hoRwG.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
- package/dist/chunks/WelcomeV2-C93xQYAF.js +1 -0
- package/dist/chunks/{add-dir-CWt69NAZ.js → add-dir-C3IhJYVH.js} +1 -1
- package/dist/chunks/{agentDisplay-CQ4mZWFH.js → agentDisplay-Cju-aXCx.js} +1 -1
- package/dist/chunks/{agents-D4clhuCl.js → agents-Bhg0CtXR.js} +7 -7
- package/dist/chunks/{agents-C6jzKOit.js → agents-Du3FQ82k.js} +1 -1
- package/dist/chunks/{allErrors-HMPqE0jK.js → allErrors-DJYCAtab.js} +1 -1
- package/dist/chunks/{ant-9Z5bppVC.js → ant-CVvy4SuO.js} +1 -1
- package/dist/chunks/api-CI8HXREw.js +1 -0
- package/dist/chunks/api-gJBnC8z3.js +1 -0
- package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
- package/dist/chunks/{asciicast-n-BBfgDq.js → asciicast-CbAjUHT_.js} +4 -4
- package/dist/chunks/{assistant-BA9_Mo9U.js → assistant-C83quuNj.js} +1 -1
- package/dist/chunks/{assistant-BiNOSla3.js → assistant-C_SkUDk_.js} +1 -1
- package/dist/chunks/assistant-z2o4-UJe.js +1 -0
- package/dist/chunks/auth-B9V3i5oZ.js +1 -0
- package/dist/chunks/auth-CgEABs3i.js +15 -0
- package/dist/chunks/auth-fSFfSKy_.js +1 -0
- package/dist/chunks/{autoMode-Db4QrgFr.js → autoMode-CZyb-mMY.js} +7 -7
- package/dist/chunks/{autonomy-BkAMA7du.js → autonomy-BpINX4jw.js} +1 -1
- package/dist/chunks/{autonomy-D4Vy-RPQ.js → autonomy-DJZ25xZp.js} +7 -7
- package/dist/chunks/{autonomyPanel-EjfO8jvg.js → autonomyPanel-ssoiIOx5.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-hDDE8mJC.js → backgroundHousekeeping-BHncba6e.js} +3 -3
- package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +1 -0
- package/dist/chunks/{banner-hD6wZygx.js → banner-CWkrK10u.js} +1 -1
- package/dist/chunks/bg-B0iMGM9C.js +1 -0
- package/dist/chunks/{bg-DQ0Q3Qv-.js → bg-WnYN5ifx.js} +2 -2
- package/dist/chunks/{branch-CeQ9IyZk.js → branch-BXo5z2al.js} +1 -1
- package/dist/chunks/{break-cache-Bd0clV2N.js → break-cache-BQfgkNAo.js} +2 -2
- package/dist/chunks/{bridge-yerAiaK2.js → bridge-CbKc1HeD.js} +2 -2
- package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
- package/dist/chunks/{bridgeConfig-CCtXe8ak.js → bridgeConfig-DbqUHe0H.js} +1 -1
- package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
- package/dist/chunks/{bridgeEnabled--F-6TUi4.js → bridgeEnabled-CM3SaumJ.js} +1 -1
- package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
- package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
- package/dist/chunks/bridgeMessaging-lfa_v3oi.js +1 -0
- package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
- package/dist/chunks/{browser-Bd7GeBH1.js → browser-BmZuQom6.js} +1 -1
- package/dist/chunks/{btw-CVGRmL9a.js → btw-Cp0whJaJ.js} +1 -1
- package/dist/chunks/{caches-BtmAri4e.js → caches-CmW7idg5.js} +2 -2
- package/dist/chunks/caches-CpqTC0Lb.js +1 -0
- package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
- package/dist/chunks/{claudeDesktop-aUMx06RK.js → claudeDesktop-Cx31Ugjp.js} +1 -1
- package/dist/chunks/{clear-C6nRzIQE.js → clear-DjGPxX7T.js} +1 -1
- package/dist/chunks/{cliLaunch-2AUoMnqx.js → cliLaunch-BkPAatcs.js} +1 -1
- package/dist/chunks/client-DPUvQ6Rf.js +1 -0
- package/dist/chunks/{color-DXI_4ibU.js → color-DYYBN52b.js} +1 -1
- package/dist/chunks/commands-D7l3P1k9.js +1 -0
- package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
- package/dist/chunks/{commitAttribution-Cm40fdNU.js → commitAttribution-Bmzgtqc6.js} +2 -2
- package/dist/chunks/compact-D6xqZN4Q.js +2 -0
- package/dist/chunks/{completionCache-BQaLkB4d.js → completionCache-MN3_MqK8.js} +2 -2
- package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
- package/dist/chunks/config-DiT2Z8dY.js +3 -0
- package/dist/chunks/config-huQaTcNb.js +1 -0
- package/dist/chunks/config-qLaiAn7z.js +1 -0
- package/dist/chunks/{context-C_cKrBUn.js → context-Bh_iUj76.js} +1 -1
- package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
- package/dist/chunks/{context-noninteractive-DnH6Q9Lu.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
- package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
- package/dist/chunks/conversation-CvCQta8e.js +1 -0
- package/dist/chunks/{createSSHSession--bWmmIk9.js → createSSHSession-B0s839mX.js} +5 -5
- package/dist/chunks/createSession-GNSNbUbN.js +1 -0
- package/dist/chunks/{createSession-DIr4sUp6.js → createSession-VMTMXOHu.js} +1 -1
- package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
- package/dist/chunks/cwd--nvsx73T.js +1 -0
- package/dist/chunks/{cwd-BuJhkTrc.js → cwd-CYmmnQVS.js} +1 -1
- package/dist/chunks/{daemon-B9lBPdBJ.js → daemon-YtZbMQtn.js} +1 -1
- package/dist/chunks/datadog-D9rlcN12.js +1 -0
- package/dist/chunks/{debug-IKW-jE7K.js → debug-BrXObCdR.js} +2 -2
- package/dist/chunks/{debugUtils-D2981c0Z.js → debugUtils-NO5KtXqi.js} +1 -1
- package/dist/chunks/{desktop-B5cvrcOQ.js → desktop-DidI-4N5.js} +1 -1
- package/dist/chunks/{detached-rfIUyc-B.js → detached-TYk4hMFj.js} +1 -1
- package/dist/chunks/{detectRepository-ReZ0Fz8Z.js → detectRepository-BPr0VWNO.js} +1 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
- package/dist/chunks/{diff-cXAp9cNN.js → diff-CZg5qL2n.js} +1 -1
- package/dist/chunks/{directoryCompletion-DBM2o5kx.js → directoryCompletion-CW2ckkQg.js} +1 -1
- package/dist/chunks/doctor-CKUXGCri.js +1 -0
- package/dist/chunks/{effort-Br8KKHdx.js → effort-BcvNemuq.js} +2 -2
- package/dist/chunks/entry-dA1UCfC0.js +14 -0
- package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
- package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
- package/dist/chunks/esm-DjGYYlQe.js +1 -0
- package/dist/chunks/{execFileNoThrow-COKYqVQj.js → execFileNoThrow-D244NytW.js} +1 -1
- package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
- package/dist/chunks/exit-COMnVxzw.js +1 -0
- package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
- package/dist/chunks/extra-usage-By33zGLT.js +1 -0
- package/dist/chunks/{extra-usage-core-CdL1ltqq.js → extra-usage-core-RZMzaH0L.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-DxxRI0Yx.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
- package/dist/chunks/{extraUsage-BYZdi44Y.js → extraUsage-CTn9FWSk.js} +1 -1
- package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
- package/dist/chunks/fast-BXzdzzXU.js +1 -0
- package/dist/chunks/{fast-DKqiojzf.js → fast-CNXgsvnE.js} +1 -1
- package/dist/chunks/{feedback-yB19xph5.js → feedback-DeJ2gvw2.js} +1 -1
- package/dist/chunks/{file-D1cN3LMK.js → file-DcZWPH2V.js} +5 -5
- package/dist/chunks/{files-DAzGtmzz.js → files-Cz1-PK3r.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
- package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
- package/dist/chunks/{flushGate-ZFr8yv7F.js → flushGate-CJ73xcaK.js} +1 -1
- package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
- package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
- package/dist/chunks/{generateSessionName-48veu5dv.js → generateSessionName-CGpL6ATy.js} +1 -1
- package/dist/chunks/{genericProcessUtils-F1Qcb1sO.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-BlR0BphY.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
- package/dist/chunks/{goal-Bn8Kz2Dp.js → goal-C8Qzl7_i.js} +3 -3
- package/dist/chunks/{grok-DhnO_KDC.js → grok-CDT9P_BL.js} +1 -1
- package/dist/chunks/{grove-DotW04-v.js → grove-BGXzEyH9.js} +2 -2
- package/dist/chunks/{heapdump-DkZSKNbp.js → heapdump-CFHvdSZv.js} +5 -5
- package/dist/chunks/{help-DU_BcZtU.js → help-DUZ7Y7Em.js} +1 -1
- package/dist/chunks/{hooks-BTMWE5Qx.js → hooks-RHwUCXcT.js} +2 -2
- package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
- package/dist/chunks/{hostGuard-Dh296c6q.js → hostGuard-C5xydXZI.js} +1 -1
- package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
- package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
- package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
- package/dist/chunks/install-OkuNmjmB.js +1 -0
- package/dist/chunks/{instrumentation-H0XRS1yG.js → instrumentation-hrXeo-G4.js} +6 -6
- package/dist/chunks/{job-DKtLkF8V.js → job-DjmIpwJl.js} +1 -1
- package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
- package/dist/chunks/keybindings-B8U17bhs.js +2 -0
- package/dist/chunks/{language-BuRSO2sR.js → language-BA5WprZv.js} +1 -1
- package/dist/chunks/language-BbaOTWm3.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-BQyPdrHp.js → launchAgentsPlatform-DnxH2SAn.js} +1 -1
- package/dist/chunks/{launchLocalMemory-CWHAj7CX.js → launchLocalMemory-CgXtGng1.js} +2 -2
- package/dist/chunks/{launchLocalVault-D8iJdtsP.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
- package/dist/chunks/{launchMemoryStores-W7jWG2uH.js → launchMemoryStores-DxVAIJuB.js} +1 -1
- package/dist/chunks/{launchOnboarding-q__LaLy1.js → launchOnboarding-Cn0t_o2k.js} +1 -1
- package/dist/chunks/{launchSchedule-BWi9F5vh.js → launchSchedule-Chwr3Nzd.js} +1 -1
- package/dist/chunks/{launchSkillStore-4wd4MQBc.js → launchSkillStore-6zxJfWVU.js} +1 -1
- package/dist/chunks/{launchTeleport-BlCf2QM_.js → launchTeleport-Ba_Hj13c.js} +1 -1
- package/dist/chunks/{launchVault-C7u7LZV7.js → launchVault-hGVrHy33.js} +1 -1
- package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
- package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
- package/dist/chunks/{loadAgentsDir-nzr38hai.js → loadAgentsDir-DrDu5yYy.js} +691 -689
- package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
- package/dist/chunks/localSearch-CebU5BA9.js +1 -0
- package/dist/chunks/{localSearch-B-L_ldos.js → localSearch-_bQhk9W6.js} +1 -1
- package/dist/chunks/{log-B3eB4EFv.js → log-BMCygSzM.js} +1 -1
- package/dist/chunks/{logoV2Utils-RQ160dI2.js → logoV2Utils-CoC4nheD.js} +1 -1
- package/dist/chunks/{magicDocs-BqZ0GewA.js → magicDocs-kMjYpjCA.js} +3 -3
- package/dist/chunks/main-C_rVSWfm.js +859 -0
- package/dist/chunks/{main-DeFMhaFE.js → main-D862LI_d.js} +3 -3
- package/dist/chunks/{mappers-CWykjGfP.js → mappers-D0CNXG32.js} +1 -1
- package/dist/chunks/mcp-1ZuFesM9.js +2 -0
- package/dist/chunks/mcp-CKvGBEjz.js +1 -0
- package/dist/chunks/mcp-DtxIl6aN.js +6 -0
- package/dist/chunks/{memoize-BO31Ws9Q.js → memoize-B0zhbT8Z.js} +1 -1
- package/dist/chunks/{memory-DcpPpYN0.js → memory-DE2jtkd_.js} +1 -1
- package/dist/chunks/{mode-BkViT_0o.js → mode-B4WIxCMW.js} +2 -2
- package/dist/chunks/model-C4RHNhDQ.js +1 -0
- package/dist/chunks/model-fi472PRc.js +1 -0
- package/dist/chunks/{model-CZktWw6o.js → model-j9GNZDFr.js} +1 -1
- package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
- package/dist/chunks/{onChangeAppState-DwGVi-BC.js → onChangeAppState-CGVeNkt7.js} +1 -1
- package/dist/chunks/{openai-B2wxZDQx.js → openai-BSVjSJiF.js} +3 -3
- package/dist/chunks/{overageCreditGrant-CjK49axw.js → overageCreditGrant-BVxlYgeU.js} +1 -1
- package/dist/chunks/{panel-R4ue6pSW.js → panel-Be-OxtqL.js} +1 -1
- package/dist/chunks/{panel-B-nrcHpm.js → panel-CrTPqXCv.js} +1 -1
- package/dist/chunks/{panelCall-I_fbgub5.js → panelCall-Cp6fpQeL.js} +1 -1
- package/dist/chunks/parser-Bf6iasPV.js +1 -0
- package/dist/chunks/{parser-CQrasoUB.js → parser-DFwaTGf7.js} +1 -1
- package/dist/chunks/{partition-CxRF7T-f.js → partition-RjCtgt9J.js} +1 -1
- package/dist/chunks/{passes-U_h-hNu-.js → passes-ByTLy6pj.js} +1 -1
- package/dist/chunks/{path-BCSE0S-c.js → path-D5U-tm91.js} +1 -1
- package/dist/chunks/permissions-B3df_htx.js +3 -0
- package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
- package/dist/chunks/{pipeTransport-D3Qx9v1V.js → pipeTransport-CqCnc-Ys.js} +1 -1
- package/dist/chunks/{plan-BAhStVci.js → plan-BxTA-b4l.js} +1 -1
- package/dist/chunks/{platform-EtecGacO.js → platform-BrYefG_2.js} +1 -1
- package/dist/chunks/{plugin-D9huNnv6.js → plugin-DOpl5e1t.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-BfmyxR5g.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
- package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
- package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
- package/dist/chunks/{pluginFlagging-BVy7Xv_0.js → pluginFlagging-3FQGvIfq.js} +1 -1
- package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
- package/dist/chunks/{pluginStartupCheck-w24D-wwk.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
- package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
- package/dist/chunks/plugins-CcDG95Bs.js +4 -0
- package/dist/chunks/policyLimits-Bwi9VqDF.js +1 -0
- package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
- package/dist/chunks/{poor-CfbMKZNJ.js → poor-DekfGNT7.js} +1 -1
- package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
- package/dist/chunks/{poorMode-Bsw2V-V_.js → poorMode-CtcqaiwD.js} +1 -1
- package/dist/chunks/print-Cc_QOSPF.js +23 -0
- package/dist/chunks/{privacy-settings-DeGoBRrZ.js → privacy-settings-ChNsgGUs.js} +1 -1
- package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
- package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
- package/dist/chunks/prompt-C0nU0VK3.js +139 -0
- package/dist/chunks/prompt-CYx145pp.js +1 -0
- package/dist/chunks/prompt-DH3lKFag.js +1 -0
- package/dist/chunks/{promptEditor-foiayhdY.js → promptEditor-Cumef6hJ.js} +2 -2
- package/dist/chunks/{protocolHandler-BsiB1oW_.js → protocolHandler-z2zxAtB1.js} +4 -4
- package/dist/chunks/{proxy-Cn2YwITp.js → proxy-CRN7jYIi.js} +3 -3
- package/dist/chunks/{rate-limit-options-DTJPDcTr.js → rate-limit-options-VL7S3SCx.js} +1 -1
- package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
- package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
- package/dist/chunks/{referral-DP_GshTS.js → referral-DrebVwqx.js} +1 -1
- package/dist/chunks/refresh-pFezssA8.js +1 -0
- package/dist/chunks/{registerProtocol-CjxlFsKw.js → registerProtocol-CukLQuxJ.js} +5 -5
- package/dist/chunks/{release-notes-BxgK8zWO.js → release-notes-D7vrFNXp.js} +1 -1
- package/dist/chunks/{releaseNotes-CbSktIJW.js → releaseNotes-CDx2P0fb.js} +2 -2
- package/dist/chunks/{reload-plugins-CDu6yU5-.js → reload-plugins-CltHfg-l.js} +1 -1
- package/dist/chunks/{remote-env-B4HnhISc.js → remote-env-SvvSuP0J.js} +1 -1
- package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
- package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
- package/dist/chunks/{rename-DlbMb24l.js → rename-CbqrCCBO.js} +1 -1
- package/dist/chunks/{renderOptions-5kWQpVr2.js → renderOptions-BUJB9nAm.js} +1 -1
- package/dist/chunks/{resume-BB5iBogS.js → resume-DockJaY9.js} +2 -2
- package/dist/chunks/{ripgrep-BvDwiKJ3.js → ripgrep-BXmXjAzA.js} +1 -1
- package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
- package/dist/chunks/{runtimeObserver-BNH2WGE3.js → runtimeObserver-DSUuYKfs.js} +1 -1
- package/dist/chunks/{runtimeObserver-Ci-5gvYg.js → runtimeObserver-XufSllVw.js} +4 -4
- package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
- package/dist/chunks/{sandbox-toggle-B2Yk4y2V.js → sandbox-toggle-CZI5fuK3.js} +1 -1
- package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
- package/dist/chunks/{session-Bmx7L3Mt.js → session-B-Z3DU9o.js} +2 -2
- package/dist/chunks/{sessionDiscovery-DcEAr5vJ.js → sessionDiscovery-C3pMZkBM.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
- package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
- package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
- package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
- package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
- package/dist/chunks/{sessionObserver-DQwHsDrM.js → sessionObserver-B_09FQKV.js} +1 -1
- package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
- package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
- package/dist/chunks/{sessionTracing-BuLsL6qA.js → sessionTracing-lArOaj9u.js} +3 -3
- package/dist/chunks/settings-DfWP5y6X.js +19 -0
- package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
- package/dist/chunks/setup-DdbmxSZh.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-7Z8ezTKF.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
- package/dist/chunks/{shellQuote-fB02N16J.js → shellQuote-DkSy9MYE.js} +1 -1
- package/dist/chunks/{sideQuestion-CYdNATPW.js → sideQuestion-BjHCLSR9.js} +1 -1
- package/dist/chunks/sinks-Cb--pqr-.js +2 -0
- package/dist/chunks/sinks-DbwDBd-E.js +1 -0
- package/dist/chunks/{skill-learning-E8tQed-Q.js → skill-learning-B0dyBT1_.js} +1 -1
- package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
- package/dist/chunks/{skillGapStore-CjJrxxjk.js → skillGapStore-75ZYlfwi.js} +2 -2
- package/dist/chunks/{skillGapStore-B5rl12bV.js → skillGapStore-D2fqmnKx.js} +1 -1
- package/dist/chunks/{skillGenerator-BDR_z3-X.js → skillGenerator-CwXUfM4Y.js} +2 -2
- package/dist/chunks/{skillLearning-BQtfFE0g.js → skillLearning-CB-5fdMl.js} +1 -1
- package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
- package/dist/chunks/{skillPanel-yR8Oi-mO.js → skillPanel-Bum7xpgo.js} +3 -3
- package/dist/chunks/{skillSearchPanel-DUQQUCUS.js → skillSearchPanel-LSPwZIOw.js} +6 -6
- package/dist/chunks/{skills-NAZQ3j-t.js → skills-G8WBeffd.js} +1 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
- package/dist/chunks/{startupProfiler-DxRQteII.js → startupProfiler-xa3NmN7Z.js} +2 -2
- package/dist/chunks/state-BOa-3Av3.js +1 -0
- package/dist/chunks/{state-4KQ3kaqz.js → state-ix0xIunV.js} +1 -1
- package/dist/chunks/{stats-h4yu84Q-.js → stats-DmFubHpI.js} +1 -1
- package/dist/chunks/{status-is_Bg_IB.js → status-ClSsvm1N.js} +2 -2
- package/dist/chunks/{status-BbdeubJG.js → status-i5beKggW.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-CQ7CUugR.js → statusNoticeHelpers-BK-54uGY.js} +1 -1
- package/dist/chunks/{stickers-qJoNhPk4.js → stickers-D5teCKMN.js} +1 -1
- package/dist/chunks/{stringUtils-CvXbHQRH.js → stringUtils-DGLPkqJ4.js} +1 -1
- package/dist/chunks/systemPromptSections-CR_AoPIX.js +1 -0
- package/dist/chunks/{systemPromptSections-CgpggIYX.js → systemPromptSections-DN0HGVye.js} +1 -1
- package/dist/chunks/{tag-i3HZ4lhj.js → tag-DYYq4H_i.js} +2 -2
- package/dist/chunks/{tasks-HzsYNTZ1.js → tasks-BySzm_YJ.js} +1 -1
- package/dist/chunks/teleport-dxtBcM01.js +1 -0
- package/dist/chunks/{templateJobs-CIv_ysje.js → templateJobs-CT5VxeRr.js} +1 -1
- package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
- package/dist/chunks/{terminalSetup-CxniwSF-.js → terminalSetup-RDKg8dVa.js} +1 -1
- package/dist/chunks/{theme-BKIHX_Dx.js → theme-CVTVsRwt.js} +1 -1
- package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
- package/dist/chunks/thinkback-CXsRbDYN.js +1 -0
- package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
- package/dist/chunks/{tmux-CbsW-VDJ.js → tmux-BY7IdQ1f.js} +1 -1
- package/dist/chunks/{toolEventObserver-B1xvyKdE.js → toolEventObserver--4fqXxQZ.js} +1 -1
- package/dist/chunks/{toolEventObserver-8FQtxeVv.js → toolEventObserver-DdhPsAs1.js} +1 -1
- package/dist/chunks/toolPool-DvHECcbN.js +1 -0
- package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
- package/dist/chunks/trustedDevice-e6iF1X7C.js +1 -0
- package/dist/chunks/{tui-fTa_pzdA.js → tui-C2yuCuOU.js} +3 -3
- package/dist/chunks/{types-a7X-tJpJ.js → types-C-MRCL8J.js} +3 -3
- package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
- package/dist/chunks/{ultrareviewCommand-DCFRZsKp.js → ultrareviewCommand-i3PfFKly.js} +2 -2
- package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
- package/dist/chunks/{undercover-CsLPQb-a.js → undercover-Q24TWRw0.js} +3 -3
- package/dist/chunks/{up-dO5BcPaq.js → up-BHkC97_C.js} +1 -1
- package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
- package/dist/chunks/{upgrade-kpttjebY.js → upgrade-7OrBbrzS.js} +1 -1
- package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
- package/dist/chunks/upload-B-lNHpWe.js +1 -0
- package/dist/chunks/{upstreamproxy-CvcjNY7J.js → upstreamproxy-DyR_eXO8.js} +4 -4
- package/dist/chunks/usage-7jOeIVv9.js +1 -0
- package/dist/chunks/{usage-CJ5w0907.js → usage-CZdPfUqP.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-yAroCqu4.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
- package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
- package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
- package/dist/chunks/{useMergedTools-CZJffsmf.js → useMergedTools-DMGRA1ga.js} +1 -1
- package/dist/chunks/{useSearchInput-C-CqUK6w.js → useSearchInput-D5VU9IDU.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BWlJCgYF.js → useSettingsErrors-B5PSF1va.js} +1 -1
- package/dist/chunks/{util-DJV0joAW.js → util-CNa1ib_4.js} +1 -1
- package/dist/chunks/validatePlugin-Dw-RGCrm.js +1 -0
- package/dist/chunks/{vim-n8-UT5w-.js → vim-C0KTnJJs.js} +1 -1
- package/dist/chunks/{which-BBCjXfI2.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-C_lv0dRh.js → workSecret-CNWiR2uQ.js} +1 -1
- package/dist/chunks/{workerRegistry-BdHi7_sN.js → workerRegistry-B2QD2sKq.js} +1 -1
- package/dist/chunks/worktree-D38cJ23W.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +4 -5
- package/dist/chunks/ApproveApiKey-DfAPwDix.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +0 -1
- package/dist/chunks/Doctor-B0CRtxi2.js +0 -1
- package/dist/chunks/Doctor-WxNv49HC.js +0 -3
- package/dist/chunks/ExitFlow-CRPgptCN.js +0 -2
- package/dist/chunks/Feedback-CEtzaLr3.js +0 -2
- package/dist/chunks/Grove-CelgLWH4.js +0 -1
- package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +0 -1
- package/dist/chunks/MessageSelector-_UZB8cGb.js +0 -3
- package/dist/chunks/Messages-jCoW_1Rr.js +0 -11
- package/dist/chunks/PluginSettings-BD9JLV9-.js +0 -17
- package/dist/chunks/QueryEngine-D2HUnwmU.js +0 -1
- package/dist/chunks/REPL-DcpN3MRC.js +0 -1
- package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +0 -2
- package/dist/chunks/ResumeConversation-Cw3vP4G8.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +0 -1
- package/dist/chunks/Settings-ns6mRsDc.js +0 -2
- package/dist/chunks/TrustDialog-DA3YTk_k.js +0 -1
- package/dist/chunks/WelcomeV2-BTfttGcv.js +0 -1
- package/dist/chunks/ajv-5vMo9UcX.js +0 -8
- package/dist/chunks/api-L2IgleTV.js +0 -1
- package/dist/chunks/api-TgV7fl9V.js +0 -1
- package/dist/chunks/asciicast-DYbkzGCN.js +0 -1
- package/dist/chunks/assistant-YvbVKjVh.js +0 -1
- package/dist/chunks/auth-CEig4Gxp.js +0 -1
- package/dist/chunks/auth-CbGDlhyO.js +0 -1
- package/dist/chunks/auth-DHyCIxCk.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +0 -1
- package/dist/chunks/bg-BzG63WOm.js +0 -1
- package/dist/chunks/bridgeConfig-D5dB38xD.js +0 -1
- package/dist/chunks/bridgeEnabled-DKX8-T_H.js +0 -1
- package/dist/chunks/bridgeMain--R1HFbOv.js +0 -68
- package/dist/chunks/bridgeMain-d06JByZn.js +0 -1
- package/dist/chunks/bridgeMessaging-CqbLTDcx.js +0 -1
- package/dist/chunks/bridgePointer-W_jdQ8zf.js +0 -1
- package/dist/chunks/caches-BuTIAOtY.js +0 -1
- package/dist/chunks/ccrClient-HqMi5Kfu.js +0 -1
- package/dist/chunks/client-BeET1hnC.js +0 -1
- package/dist/chunks/commands-VjcG4qFq.js +0 -1
- package/dist/chunks/commitAttribution-Lb3qUlAR.js +0 -1
- package/dist/chunks/compact-DPTVpJ4D.js +0 -2
- package/dist/chunks/completionCache-CW8lKIgy.js +0 -1
- package/dist/chunks/config-0cRberzR.js +0 -1
- package/dist/chunks/config-BrxKpHpR.js +0 -1
- package/dist/chunks/config-C7YHKCPV.js +0 -3
- package/dist/chunks/config-CLmFk-5V.js +0 -1
- package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +0 -1
- package/dist/chunks/conversation-GJxfkr6M.js +0 -1
- package/dist/chunks/conversation-oK3aFzqO.js +0 -1
- package/dist/chunks/createSession-DM4acqaC.js +0 -1
- package/dist/chunks/crossProjectResume-DKrtjTpm.js +0 -40
- package/dist/chunks/cwd-D-tY2NKc.js +0 -1
- package/dist/chunks/datadog-ByS7LGGa.js +0 -1
- package/dist/chunks/datadog-DNCsyfSO.js +0 -1
- package/dist/chunks/debug-DzZUT2Wv.js +0 -1
- package/dist/chunks/detectRepository-6nw-Aw3v.js +0 -1
- package/dist/chunks/doctor-CTMHXZvQ.js +0 -1
- package/dist/chunks/entry-4lIRMrLI.js +0 -14
- package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +0 -1
- package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +0 -1
- package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
- package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +0 -1
- package/dist/chunks/exit-Z9oWrqE4.js +0 -1
- package/dist/chunks/extra-usage-BS4aVOt5.js +0 -1
- package/dist/chunks/extra-usage-DtAIhW74.js +0 -1
- package/dist/chunks/extractMemories-C4f9JWuI.js +0 -1
- package/dist/chunks/fast-B0OB4x7K.js +0 -1
- package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +0 -1
- package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +0 -5
- package/dist/chunks/gemini-DqAv8_GY.js +0 -1
- package/dist/chunks/generateRecap-lO2PDlx8.js +0 -1
- package/dist/chunks/git-BE_FiJZp.js +0 -1
- package/dist/chunks/git-tyaWOgRL.js +0 -6
- package/dist/chunks/hooks-DONAb_nq.js +0 -1
- package/dist/chunks/inboundAttachments-BcEgi49j.js +0 -1
- package/dist/chunks/inboundAttachments-DVs3_m48.js +0 -1
- package/dist/chunks/initReplBridge-D0Xec8S-.js +0 -1
- package/dist/chunks/install-BkfXeXpv.js +0 -1
- package/dist/chunks/jwtUtils-C-ojmb8W.js +0 -1
- package/dist/chunks/keybindings-ez51eHHp.js +0 -2
- package/dist/chunks/language-Da4KNbjm.js +0 -1
- package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
- package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +0 -1
- package/dist/chunks/loadPluginHooks-z1-zvBLw.js +0 -1
- package/dist/chunks/localSearch-D-FprOMr.js +0 -1
- package/dist/chunks/main-y7LJ5qUc.js +0 -1243
- package/dist/chunks/mcp-CSFPAfaW.js +0 -2
- package/dist/chunks/mcp-DBwT4pa9.js +0 -6
- package/dist/chunks/mcp-DvZTaHZE.js +0 -1
- package/dist/chunks/metadata-BRLJvh61.js +0 -1
- package/dist/chunks/model--z4Di9QO.js +0 -1
- package/dist/chunks/model-DfFA3qMO.js +0 -1
- package/dist/chunks/nativeInstaller-GcIk7G2Y.js +0 -1
- package/dist/chunks/parser-BlM_Fk4J.js +0 -1
- package/dist/chunks/permissions-B8epy16o.js +0 -3
- package/dist/chunks/pidLock-CBJDnBG_.js +0 -3
- package/dist/chunks/pluginBlocklist-03sZaZa6.js +0 -1
- package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +0 -1
- package/dist/chunks/pluginOperations-Cz37qcjF.js +0 -2
- package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +0 -1
- package/dist/chunks/plugins-B0hiIN4q.js +0 -4
- package/dist/chunks/policyLimits-Dem-XJ_h.js +0 -1
- package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
- package/dist/chunks/poorMode-jvImnkty.js +0 -1
- package/dist/chunks/print-ozjC0Mhg.js +0 -23
- package/dist/chunks/processBashCommand-loWZ8MSE.js +0 -1
- package/dist/chunks/processSlashCommand-BdouajZb.js +0 -5
- package/dist/chunks/prompt-Bef63FhB.js +0 -132
- package/dist/chunks/prompt-C7wd1H_i.js +0 -1
- package/dist/chunks/prompt-DIoNqZvO.js +0 -1
- package/dist/chunks/rcDebugLog-BUuD-X1D.js +0 -11
- package/dist/chunks/reconciler-DqXTmV3J.js +0 -4
- package/dist/chunks/refresh-CNzXPAFw.js +0 -1
- package/dist/chunks/remoteBridgeCore-D-wG5jau.js +0 -1
- package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +0 -1
- package/dist/chunks/ripgrep-BQgJ02F9.js +0 -1
- package/dist/chunks/sandbox-adapter-Coe1GDAE.js +0 -1
- package/dist/chunks/searchExtraTools-BnWZ9roi.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +0 -1
- package/dist/chunks/sessionMemory-Bsg2unYX.js +0 -1
- package/dist/chunks/sessionMemory-CIbCojm-.js +0 -1
- package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +0 -1
- package/dist/chunks/sessionObserver-CRU1qWnP.js +0 -1
- package/dist/chunks/sessionStorage-BxDN8qRc.js +0 -1
- package/dist/chunks/sessionTitle-B8jcexkQ.js +0 -14
- package/dist/chunks/settings-5PQdphqC.js +0 -19
- package/dist/chunks/settingsSync-BDeuErb5.js +0 -1
- package/dist/chunks/setup-BKEnSLR9.js +0 -3
- package/dist/chunks/sink-DjKoYMsA.js +0 -1
- package/dist/chunks/sink-iYxWapbU.js +0 -1
- package/dist/chunks/sinks-GryGVRT8.js +0 -2
- package/dist/chunks/sinks-jfaIjsRJ.js +0 -1
- package/dist/chunks/skillChangeDetector-A8SAuyo9.js +0 -1
- package/dist/chunks/skillLearning-C8ihdryM.js +0 -1
- package/dist/chunks/src-xRRBgNzF.js +0 -25
- package/dist/chunks/startupProfiler-B0m6crkd.js +0 -1
- package/dist/chunks/state-53JDbNQM.js +0 -1
- package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
- package/dist/chunks/stdio-W_Kokrkh.js +0 -3
- package/dist/chunks/systemPromptSections-IePG5K8r.js +0 -1
- package/dist/chunks/teleport-hN3cAbYC.js +0 -1
- package/dist/chunks/terminalSetup-C0PF87iu.js +0 -33
- package/dist/chunks/thinkback-BA4cMz4D.js +0 -1
- package/dist/chunks/thinkback-mT-8FIT-.js +0 -1
- package/dist/chunks/thinkback-play-Cfk49mvF.js +0 -1
- package/dist/chunks/toolPool-CHVDZqh7.js +0 -1
- package/dist/chunks/trustedDevice-BYCh1ff7.js +0 -1
- package/dist/chunks/trustedDevice-DnIWErCt.js +0 -1
- package/dist/chunks/udsClient-Cg9bBD0p.js +0 -1
- package/dist/chunks/undercover-B-kKUWtK.js +0 -1
- package/dist/chunks/updateCCB-CfUnkOLT.js +0 -11
- package/dist/chunks/upgrade-CngUwvY4.js +0 -1
- package/dist/chunks/upload-DDhQqV8n.js +0 -1
- package/dist/chunks/usage-eZRwLa77.js +0 -1
- package/dist/chunks/useMainLoopModel-BNFW-g8E.js +0 -1
- package/dist/chunks/useManagePlugins-CTtPaQRP.js +0 -1
- package/dist/chunks/validatePlugin-CRmpIGLV.js +0 -1
- package/dist/chunks/windowsPaths-D6T_3XaU.js +0 -1
- package/dist/chunks/windowsPaths-DUKTzBck.js +0 -1
- package/dist/chunks/worktree-YDeHMlHZ.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
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{F as h,H as re,S as g,W as ie,a as _,l as v,w as y,z as ae}from"./debug-BrXObCdR.js";import{Xt as oe,Zt as se}from"./settings-DfWP5y6X.js";import{c as ce,f as le,g as b,n as ue}from"./config-DiT2Z8dY.js";import{c as de,o as fe}from"./execFileNoThrow-D244NytW.js";import{d as pe,o as x,p as S,s as C}from"./log-BMCygSzM.js";import{a as me,i as he,o as ge}from"./platform-BrYefG_2.js";import{l as _e,s as ve}from"./types-C-MRCL8J.js";import{a as ye,n as be}from"./analytics-BotDBGh0.js";import{i as w,n as xe}from"./startupProfiler-xa3NmN7Z.js";import{Bt as Se,It as Ce,Kt as we,Mt as T,Pt as Te,Ur as Ee,Vt as E,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-fi472PRc.js";import{Z as Fe,_ as Ie,c as Le,et as D,it as Re,n as ze,o as Be,t as Ve,v as He,w as O}from"./esm-DjGYYlQe.js";import*as k from"path";import{randomUUID as Ue}from"crypto";import{appendFile as We,mkdir as A,readdir as Ge,unlink as Ke,writeFile as qe}from"fs/promises";function j(){return r(process.env.CLAUDE_CODE_USE_BEDROCK)||r(process.env.CLAUDE_CODE_USE_VERTEX)||r(process.env.CLAUDE_CODE_USE_FOUNDRY)||S()}function Je(){return S()}var M=e((()=>{a(),pe()}));async function Ye(){N===null&&!P&&(P=Qe(),N=await P,P=null,F.cache.clear?.())}function Xe(){N=null,P=null,F.cache.clear?.(),I.cache.clear?.()}function Ze(){if(N!==null)return N;let e=T();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 Qe(){let e=T();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`)return process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:I()}var N,P,F,I,$e=e((()=>{de(),n(),p(),E(),b(),te(),se(),a(),N=null,P=null,F=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=T(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.3`,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}}}}),I=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 et(){return{seconds:0,nanos:0}}function tt(e){return e!=null}var L,nt=e((()=>{L={fromJSON(e){return{seconds:tt(e.seconds)?globalThis.Number(e.seconds):0,nanos:tt(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=et();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function rt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,it=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=rt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function at(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function ot(){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 st(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ct(){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 lt(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):lt(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ut=e((()=>{nt(),it(),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=at();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=ot();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=st();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=ct();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 k.join(i(),`telemetry`)}function dt(e){if(!d.isAxiosError(e))return h(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,ft=e((()=>{He(),f(),p(),ut(),E(),b(),_(),a(),ae(),ke(),ve(),x(),Ne(),g(),Me(),Ee(),be(),D(),o(),q=Ue(),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 k.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 Ke(e)}catch{}else await A(K(),{recursive:!0}),await qe(e,t.map(e=>y(e)).join(`
|
|
2
|
+
`)+`
|
|
3
|
+
`,`utf8`)}catch(e){C(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await A(K(),{recursive:!0}),await We(e,t.map(e=>y(e)).join(`
|
|
4
|
+
`)+`
|
|
5
|
+
`,`utf8`)}catch(e){C(e)}}async deleteFile(e){try{await Ke(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ge(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(re(e))return;throw e}for(let e of t){let t=k.join(K(),e);this.retryFileInBackground(t)}}catch(e){C(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:O.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:O.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:O.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:O.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:O.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:O.SUCCESS})}catch(e){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: ${h(e)}`),C(e),t({code:O.FAILED,error:ie(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=dt(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}`;C(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: ${y(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(y({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Re(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(y(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 pt(e){return!1}var mt=e((()=>{}));function ht(){return{}}function gt(e){let t=ht()[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 _t(){if($)try{await $.shutdown(),process.env.USER_TYPE===`ant`&&v(`1P event logging: final shutdown complete`)}catch{}}function X(){return!j()}async function vt(e,t,n={}){try{let r=await Fe({model:n.model,betas:n.betas}),i={event_name:t,event_id:Ue(),core_metadata:r,user_metadata:F(!0),event_metadata:n},a=le();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&v(`[ANT-ONLY] 1P event: ${t} ${y(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&C(e)}}function yt(e,t={}){X()&&(!Q||pt(`firstParty`)||vt(Q,e,t))}function bt(){if(w(`1p_event_logging_start`),!X()){process.env.USER_TYPE===`ant`&&v(`1P event logging not enabled`);return}w(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10),t=xt,n=St,r=he(),i={[l]:`claude-code`,[c]:`0.0.3`};if(r===`wsl`){let e=me();e&&(i[`wsl.version`]=e)}$=new Be({resource:Ie(i),processors:[new ze(new Y({maxBatchSize:t,isKilled:()=>pt(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.3`)}var Z,xt,St,Q,$,Ct=e((()=>{Le(),Ve(),u(),b(),_(),x(),ge(),g(),xe(),$e(),M(),ft(),D(),mt(),Z=1e4,xt=200,St=8192,Q=null,$=null}));export{yt as a,I as c,Xe as d,M as f,X as i,Ye as l,Je as m,Ct as n,gt as o,j as p,bt as r,_t as s,ht as t,$e as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./firstPartyEventLogger-CQdJn3LV.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{F as n,a as r,l as i,z as a}from"./debug-BrXObCdR.js";import{O as o,k as s}from"./rcDebugLog-2-1XSyFV.js";import{i as c}from"./workSecret-CNWiR2uQ.js";import{t as l}from"./ccrClient-BPXmxWHw.js";import{n as u,t as d}from"./SSETransport-DGIytG74.js";u(),r(),a(),o();function f(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function p(e){let{sessionUrl:t,ingressToken:r,sessionId:a,initialSequenceNum:o,getAuthToken:u}=e,f;u?f=()=>{let e=u();return e?{Authorization:`Bearer ${e}`}:{}}:s(r);let p=e.epoch??await c(t,r);i(`[bridge:repl] CCR v2: worker sessionId=${a} epoch=${p}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let m=new URL(t);m.pathname=m.pathname.replace(/\/$/,``)+`/worker/events/stream`;let h=new d(m,{},a,void 0,o,f),g,_=new l(h,new URL(t),{getAuthHeaders:f,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{i(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{_.close(),h.close(),g?.(4090)}catch(e){i(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${n(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});h.setOnEvent(e=>{_.reportDelivery(e.event_id,`received`),_.reportDelivery(e.event_id,`processed`)});let v,y=!1,b=!1;return{write(e){return _.writeEvent(e)},async writeBatch(e){for(let t of e){if(b)break;await _.writeEvent(t)}},close(){b=!0,_.close(),h.close()},isConnectedStatus(){return y},getStateLabel(){return h.isClosedStatus()?`closed`:h.isConnectedStatus()?y?`connected`:`init`:`connecting`},setOnData(e){h.setOnData(e)},setOnClose(e){g=e,h.setOnClose(t=>{_.close(),e(t??4092)})},setOnConnect(e){v=e},getLastSequenceNum(){return h.getLastSequenceNum()},droppedBatchCount:0,reportState(e){_.reportState(e)},reportMetadata(e){_.reportMetadata(e)},reportDelivery(e,t){_.reportDelivery(e,t)},flush(){return _.flush()},connect(){e.outboundOnly||h.connect(),_.initialize(p).then(()=>{y=!0,i(`[bridge:repl] v2 transport ready for writes (epoch=${p}, sse=${h.isConnectedStatus()?`open`:`opening`})`),v?.()},e=>{i(`[bridge:repl] CCR v2 initialize failed: ${n(e)}`,{level:`error`}),_.close(),h.close(),g?.(4091)})}}}e();var m=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{f as n,p as r,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
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-DrDu5yYy.js";import{F as s,a as c,l,z as u}from"./debug-BrXObCdR.js";import{a as d,l as f}from"./proxy-CRN7jYIi.js";import{$ as p,J as m,K as h,P as g,Y as _,Z as v,nt as y}from"./rcDebugLog-2-1XSyFV.js";import{n as b,r as x}from"./SSETransport-DGIytG74.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: ${s(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: ${s(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),u(),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};
|
|
@@ -0,0 +1 @@
|
|
|
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-DrDu5yYy.js";import{G as s,Q as c,a as l,l as u}from"./debug-BrXObCdR.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-BbaOTWm3.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 c||e.aborted||o.signal.aborted?{kind:`aborted`}:(u(`[recap] generation failed: ${t}`),{kind:`failed`})}}var p,m;e((()=>{s(),l(),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 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{To as t,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{To as t,YT as n,et as r,tt as i,zo as a}from"./loadAgentsDir-DrDu5yYy.js";import{F as o,a as s,l as c,z as l}from"./debug-BrXObCdR.js";import{s as u,u as d}from"./types-C-MRCL8J.js";import{st as f}from"./rcDebugLog-2-1XSyFV.js";import{r as p,t as m}from"./sessionTitle-CmLWNFuX.js";async function h(e,n){let r=m(e);if(!r)return null;try{let e=await i({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:r,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),a=d(Array.isArray(e.message.content)?t(e.message.content):e.message.content);return a&&typeof a==`object`&&`name`in a&&typeof a.name==`string`?a.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{r(),s(),l(),u(),a(),p(),n()}));export{g as n,h as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-D244NytW.js";function i(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}async function a(e,t=10){if(process.platform===`win32`){let r=await n(`powershell.exe`,[`-NoProfile`,`-Command`,`
|
|
2
2
|
$pid = ${String(e)}
|
|
3
3
|
$ancestors = @()
|
|
4
4
|
for ($i = 0; $i -lt ${t}; $i++) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,i as n,p as r,r as i}from"./git-Do0wJvux.js";e();export{i as findGitRoot,n as getBranch,t as getDefaultBranch,r as getRemoteUrl};
|
|
@@ -0,0 +1,6 @@
|
|
|
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{S as ee,a as te,d as l,nt as ne,p as re,rt as ie,w as ae}from"./debug-BrXObCdR.js";import{r as oe,t as u}from"./execFileNoThrow-D244NytW.js";import{o as se}from"./log-BMCygSzM.js";import{n as d,t as ce}from"./memoize-B0zhbT8Z.js";import{r as le,t as ue}from"./which-CKQnSouy.js";import{basename as de,dirname as f,join as p,resolve as m,sep as fe}from"path";import{readFileSync as h,realpathSync as g,statSync as _,unwatchFile as v,watchFile as pe}from"fs";import{createHash as me}from"crypto";import{readFile as y,readdir as he,stat as ge}from"fs/promises";function b(e,t,n){let r=_e();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=l(),o=ae(i)+`
|
|
2
|
+
`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(f(r)),a.appendFileSync(r,o)}catch{}}}function _e(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function ve(e,t,n){let r=Date.now();b(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return b(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw b(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var x=e((()=>{re(),ee()}));async function S(e,t,n,r){try{return ye(await y(p(e,`config`),`utf-8`),t,n,r)}catch{return null}}function ye(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=Ce(t,a,n);continue}if(!s)continue;let r=be(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function be(e){let t=0;for(;t<e.length&&we(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:xe(e,t)}}function xe(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=Se(n)),n}function Se(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function Ce(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 we(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var C=e((()=>{}));function Te(){j.clear()}async function w(e){let t=m(e??c()),n=j.get(t);if(n!==void 0)return n;let r=z(t);if(!r)return j.set(t,null),null;let i=p(r,`.git`);try{if((await ge(i)).isFile()){let e=(await y(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=m(r,e.slice(7).trim());return j.set(t,n),n}}return j.set(t,i),i}catch{return j.set(t,null),null}}function T(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function E(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function D(e){try{let t=(await y(p(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 T(e)?{type:`branch`,name:e}:null}if(!T(n))return null;let r=await O(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return E(t)?{type:`detached`,sha:t}:null}catch{return null}}async function O(e,t){let n=await k(e,t);if(n)return n;let r=await A(e);return r&&r!==e?k(r,t):null}async function k(e,t){try{let n=(await y(p(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return T(t)?O(e,t):null}return E(n)?n:null}catch{}try{let n=await y(p(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 E(t)?t:null}}}catch{}return null}async function A(e){try{return m(e,(await y(p(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function Ee(e,t,n){try{let r=(await y(p(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 T(t)?t:null}}}catch{}return null}async function De(){let e=await w();if(!e)return`HEAD`;let t=await D(e);return t&&t.type===`branch`?t.name:`HEAD`}async function Oe(){let e=await w();if(!e)return``;let t=await D(e);return t?t.type===`branch`?await O(e,`refs/heads/${t.name}`)??``:t.sha:``}async function ke(){let e=await w();if(!e)return null;let t=await S(e,`remote`,`origin`,`url`);if(t)return t;let n=await A(e);return n&&n!==e?S(n,`remote`,`origin`,`url`):null}async function Ae(){let e=await w();if(!e)return`main`;let t=await A(e)??e,n=await Ee(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await O(t,`refs/remotes/origin/${e}`))return e;return`main`}function je(){return P.get(`branch`,De)}function Me(){return P.get(`head`,Oe)}function Ne(){return P.get(`remoteUrl`,ke)}function Pe(){return P.get(`defaultBranch`,Ae)}async function Fe(e){let t=await w(e);if(!t)return null;let n=await D(t);return n?n.type===`branch`?O(t,`refs/heads/${n.name}`):n.sha:null}async function Ie(e){let t;try{let n=(await y(p(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=m(e,n.slice(7).trim())}catch{return null}let n=await D(t);return n?n.type===`branch`?O(t,`refs/heads/${n.name}`):n.sha:null}async function Le(e){let t=await w(e);if(!t)return null;let n=await S(t,`remote`,`origin`,`url`);if(n)return n;let r=await A(t);return r&&r!==t?S(r,`remote`,`origin`,`url`):null}async function Re(){try{let e=await w();return e?(await he(p(await A(e)??e,`worktrees`))).length+1:0}catch{return 1}}var j,M,N,P,F=e((()=>{o(),ne(),s(),$(),C(),r(),j=new Map,M=1e3,N=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 w(),this.initialized=!0,this.gitDir&&(this.commonDir=await A(this.gitDir),this.watchPath(p(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(p(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ie(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),pe(e,{interval:M},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await D(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?p(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(v(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)v(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}},P=new N}));function ze(){function e(e){let t=R(e);return t===L?null:t}return e.cache=R.cache,e}function Be(){function e(e){let t=z(e);return t?B(t):null}return e.cache=B.cache,e}function Ve(e){return w(e)}function I(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(We(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 He(){let e=await J();if(!e)return null;let t=I(e);return t?me(`sha256`).update(t).digest(`hex`).substring(0,16):null}async function Ue(){try{let[e,t,n,r,i,a]=await Promise.all([G(),K(),J(),Y(),X(),Q()]);return{commitHash:e,branchName:t,remoteUrl:n,isHeadOnRemote:r,isClean:i,worktreeCount:a}}catch{return null}}function We(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Ge(){let e=l(),t=c(),n=p(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=p(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(p(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(p(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(p(t,`refs`)).isDirectory())return!0}catch{}return!1}var L,R,z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q,Ke,$=e((()=>{n(),s(),te(),x(),oe(),re(),F(),se(),ce(),ue(),L=Symbol(`git-root-not-found`),R=d(e=>{let t=Date.now();b(`info`,`find_git_root_started`);let n=m(e),r=n.substring(0,n.indexOf(fe)+1)||fe,i=0;for(;n!==r;){try{let e=p(n,`.git`);i++;let r=_(e);if(r.isDirectory()||r.isFile())return b(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=f(n);if(e===n)break;n=e}try{let e=p(r,`.git`);i++;let n=_(e);if(n.isDirectory()||n.isFile())return b(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return b(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),L},e=>e,50),z=ze(),B=d(e=>{try{let t=h(p(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=m(e,t.slice(7).trim()),r=m(n,h(p(n,`commondir`),`utf-8`).trim());return m(f(n))!==p(r,`worktrees`)||g(h(p(n,`gitdir`),`utf-8`).trim())!==p(g(e),`.git`)?e:de(r)===`.git`?f(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),V=Be(),H=t(()=>le(`git`)||`git`),U=t(async()=>{let e=Date.now();b(`info`,`is_git_check_started`);let t=z(c())!==null;return b(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),W=async e=>z(e)!==null,G=async()=>Me(),K=async()=>je(),q=async()=>Pe(),J=async()=>Ne(),Y=async()=>{let{code:e}=await u(H(),[`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 u(H(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await u(H(),[`--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()=>Re(),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 u(H(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await u(H(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{S as A,Fe as C,w as D,Ie as E,b as M,ve as N,O,A as S,F as T,$ as _,q as a,Ke as b,Ue as c,U as d,Y as f,H as g,Q as h,K as i,x as j,C as k,G as l,He as m,V as n,Z as o,J as p,z as r,Ve as s,W as t,X as u,Ge as v,Le as w,Te as x,I as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{en as e,nt as t}from"./state-
|
|
1
|
+
import{en as e,nt as t}from"./state-ix0xIunV.js";import{a as n,l as r}from"./debug-BrXObCdR.js";import{b as i,c as a,g as o}from"./config-DiT2Z8dY.js";import{T as s,_ as c,r as l,w as u}from"./git-Do0wJvux.js";import{_ as d,f}from"./file-DcZWPH2V.js";import{a as p,i as m,n as h}from"./detectRepository-BPr0VWNO.js";import{realpath as g}from"fs/promises";e(),o(),n(),m(),f(),s(),c();async function _(){try{let e=await h();if(!e){r(`Not in a GitHub repository, skipping path mapping update`);return}let n=t(),o=l(n)??n,s;try{s=(await g(o)).normalize(`NFC`)}catch{s=o}let c=e.toLowerCase(),u=a().githubRepoPaths?.[c]??[];if(u[0]===s){r(`Path ${s} already tracked for repo ${c}`);return}let d=u.filter(e=>e!==s),f=[s,...d];i(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[c]:f}})),r(`Added ${s} to tracked paths for repo ${c}`)}catch(e){r(`Error updating repo path mapping: ${e}`)}}function v(e){let t=a(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(d));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await u(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let n=a(),o=e.toLowerCase(),s=n.githubRepoPaths?.[o]??[],c=s.filter(e=>e!==t);if(c.length===s.length)return;let l={...n.githubRepoPaths};c.length===0?delete l[o]:l[o]=c,i(e=>({...e,githubRepoPaths:l})),r(`Removed ${t} from tracked paths for repo ${o}`)}export{b as a,_ as i,v as n,x as r,y as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
2
|
-
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){o(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=v();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${y(e.status)}`,`Time: ${
|
|
3
|
-
`)}function M(e){return S(e),
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{LT as o,MT as s,_p as c,_x as l,ad as u,bp as d,dp as f,fp as p,gp as m,gx as h,id as g,lp as _,mp as v,pp as y,rd as b,up as x,xp as S,yp as C}from"./loadAgentsDir-DrDu5yYy.js";import{n as w,t as T}from"./PermissionDialog-0ya1CU5k.js";function E({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),y(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),p(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:r})]}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(l,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{r(),i(),h(),w(),c(),D=a()}));function k(e){let t=e.split(`
|
|
2
|
+
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){o(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=v();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${y(e.status)}`,`Time: ${p(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
|
|
3
|
+
`)}function M(e){return S(e),m(),g(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=_();return t&&(u(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=C();return t&&(g(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(v()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=d();return t&&g(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=f();return t&&g(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=x();return t&&(g(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=v();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{r(),c(),b(),s(),O(),P=a(),F=4e3,I=80}))();export{N as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ih as t,Jo as n,Ko as r,Lh as i,at as a,ct as o,fo as s,np as c,op as l,zo as u}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ih as t,Jo as n,Ko as r,Lh as i,at as a,ct as o,fo as s,np as c,op as l,zo as u}from"./loadAgentsDir-DrDu5yYy.js";import{a as d,l as f}from"./debug-BrXObCdR.js";import{G as p,H as m}from"./model-fi472PRc.js";import{B as h,F as g,L as _,P as v,R as y,it as b}from"./rcDebugLog-2-1XSyFV.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,i,a,l,u){try{let s=b(u.model),d=n(e,a),p=(await Promise.all(a.map(e=>o(e,{getToolPermissionContext:u.getToolPermissionContext,tools:a,agents:u.agents,allowedAgentTypes:u.allowedAgentTypes,model:u.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),v=h(d,i),S=y(p),w=_(u.toolChoice),T=t({maxRetries:0,fetchOverride:u.fetchOverride,source:u.querySource});f(`[Grok] Calling model=${s}, messages=${v.length}, tools=${S.length}`);let E=g(await T.chat.completions.create({model:s,messages:v,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...u.temperatureOverride!==void 0&&{temperature:u.temperatureOverride}},{signal:l}),s),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));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.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:r([t],a,u.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&c(m(s,k),k,u.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);f(`[Grok] Error: ${t}`,{level:`error`}),yield s({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{i(),S(),v(),u(),a(),d(),l(),p()}))();export{w as queryModelGrok};
|
|
@@ -1,7 +1,7 @@
|
|
|
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{
|
|
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{fC as a,uC as o}from"./loadAgentsDir-DrDu5yYy.js";import{a as s,l as c}from"./debug-BrXObCdR.js";import{b as l,c as u,g as d}from"./config-DiT2Z8dY.js";import{a as f,n as p}from"./process-gEbdy6uY.js";import{d as m,f as h,o as g,s as _}from"./log-BMCygSzM.js";import{n as v,r as y}from"./analytics-BotDBGh0.js";import{l as b,u as x}from"./oauth-BqJqV-2M.js";import{Mt as S,Vt as C,ar as w,er as T,ir as E,lr as D,nr as O,qt as k,ur as A}from"./model-fi472PRc.js";async function j(){try{await w(()=>{let e=T();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.post(`${b().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...e.headers,"User-Agent":D()}})}),R.cache.clear?.()}catch(e){_(e)}}async function M(e){try{await w(()=>{let t=T();if(t.error)throw Error(`Failed to get auth headers: ${t.error}`);return r.patch(`${b().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:e},{headers:{...t.headers,"User-Agent":D()}})}),R.cache.clear?.()}catch(e){_(e)}}async function N(){if(!k())return!1;let e=S()?.accountUuid;if(!e)return!1;let t=u().groveConfigCache?.[e];return t?Date.now()-t.timestamp>L?(c(`Grove: Cache stale, returning cached data and refreshing in background`),P(e),t.grove_enabled):(c(`Grove: Using fresh cached config`),t.grove_enabled):(c(`Grove: No cache, fetching config in background (dialog skipped this session)`),P(e),!1)}async function P(e){try{let t=await z();if(!t.success)return;let n=t.data.grove_enabled,r=u().groveConfigCache?.[e];if(r?.grove_enabled===n&&Date.now()-r.timestamp<=L)return;l(t=>({...t,groveConfigCache:{...t.groveConfigCache,[e]:{grove_enabled:n,timestamp:Date.now()}}}))}catch(e){c(`Grove: Failed to fetch and store config: ${e}`)}}function F(e,t,n){if(!e.success||!t.success)return!1;let r=e.data,i=t.data;if(r.grove_enabled!==null)return!1;if(n||!i.notice_is_grace_period)return!0;let a=i.notice_reminder_frequency;return a!==null&&r.grove_notice_viewed_at?Math.floor((Date.now()-new Date(r.grove_notice_viewed_at).getTime())/(1e3*60*60*24))>=a:r.grove_notice_viewed_at==null}async function I(){let[e,t]=await Promise.all([R(),z()]);if(F(e,t,!1)){let e=t.success?t.data:null;y(`tengu_grove_print_viewed`,{dismissable:e?.notice_is_grace_period}),e===null||e.notice_is_grace_period?(f(`
|
|
2
2
|
An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms.
|
|
3
3
|
|
|
4
4
|
`),await j()):(f(`
|
|
5
5
|
[ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run \`claude\` to review the updated terms.
|
|
6
6
|
|
|
7
|
-
`),await
|
|
7
|
+
`),await o(1))}}var L,R,z,B=e((()=>{i(),n(),v(),C(),s(),a(),m(),p(),x(),d(),E(),g(),A(),L=1440*60*1e3,R=t(async()=>{if(h())return{success:!1};try{return{success:!0,data:(await w(()=>{let e=T();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.get(`${b().BASE_API_URL}/api/oauth/account/settings`,{headers:{...e.headers,"User-Agent":D()}})})).data}}catch(e){return _(e),R.cache.clear?.(),{success:!1}}}),z=t(async()=>{if(h())return{success:!1};try{let{grove_enabled:e,domain_excluded:t,notice_is_grace_period:n,notice_reminder_frequency:i}=(await w(()=>{let e=T();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.get(`${b().BASE_API_URL}/api/claude_code_grove`,{headers:{...e.headers,"User-Agent":O()},timeout:3e3})})).data;return{success:!0,data:{grove_enabled:e,domain_excluded:t??!1,notice_is_grace_period:n??!0,notice_reminder_frequency:i}}}catch(e){return c(`Failed to fetch Grove notice config: ${e}`),{success:!1}}})}));export{B as a,M as c,R as i,I as n,N as o,z as r,j as s,F as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{en as t,ht as n}from"./state-
|
|
2
|
-
heapUsed: ${
|
|
3
|
-
external: ${
|
|
4
|
-
rss: ${
|
|
5
|
-
${i.analysis.recommendation}`);let
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{en as t,ht as n}from"./state-ix0xIunV.js";import{S as r,W as i,a,d as o,l as s,p as c,w as l,z as u}from"./debug-BrXObCdR.js";import{o as d,s as f}from"./log-BMCygSzM.js";import{c as p,f as m}from"./file-DcZWPH2V.js";import{n as h,r as g}from"./analytics-BotDBGh0.js";import{join as _}from"path";import{createWriteStream as v,writeFileSync as y}from"fs";import{readFile as b,readdir as x,writeFile as S}from"fs/promises";import{pipeline as C}from"stream/promises";import{getHeapSnapshot as w,getHeapSpaceStatistics as T,getHeapStatistics as E}from"v8";async function D(e,t=0){let r=process.memoryUsage(),i=E(),a=process.resourceUsage(),o=process.uptime(),s;try{s=T()}catch{}let c=process._getActiveHandles().length,l=process._getActiveRequests().length,u;try{u=(await x(`/proc/self/fd`)).length}catch{}let d;try{d=await b(`/proc/self/smaps_rollup`,`utf8`)}catch{}let f=r.rss-r.heapUsed,p=o>0?r.rss/o:0,m=p*3600/(1024*1024),h=[];return i.number_of_detached_contexts>0&&h.push(`${i.number_of_detached_contexts} detached context(s) - possible iframe/context leak`),c>100&&h.push(`${c} active handles - possible timer/socket leak`),f>r.heapUsed&&h.push(`Native memory > heap - leak may be in native addons (node-pty, sharp, etc.)`),m>100&&h.push(`High memory growth rate: ${m.toFixed(1)} MB/hour`),u&&u>500&&h.push(`${u} open file descriptors - possible file/socket leak`),{timestamp:new Date().toISOString(),sessionId:n(),trigger:e,dumpNumber:t,uptimeSeconds:o,memoryUsage:{heapUsed:r.heapUsed,heapTotal:r.heapTotal,external:r.external,arrayBuffers:r.arrayBuffers,rss:r.rss},memoryGrowthRate:{bytesPerSecond:p,mbPerHour:m},v8HeapStats:{heapSizeLimit:i.heap_size_limit,mallocedMemory:i.malloced_memory,peakMallocedMemory:i.peak_malloced_memory,detachedContexts:i.number_of_detached_contexts,nativeContexts:i.number_of_native_contexts},v8HeapSpaces:s?.map(e=>({name:e.space_name,size:e.space_size,used:e.space_used_size,available:e.space_available_size})),resourceUsage:{maxRSS:a.maxRSS*1024,userCPUTime:a.userCPUTime,systemCPUTime:a.systemCPUTime},activeHandles:c,activeRequests:l,openFileDescriptors:u,analysis:{potentialLeaks:h,recommendation:h.length>0?`WARNING: ${h.length} potential leak indicator(s) found. See potentialLeaks array.`:`No obvious leak indicators. Check heap snapshot for retained objects.`},smapsRollup:d,platform:process.platform,nodeVersion:process.version,ccVersion:`0.0.3`}}async function O(e=`manual`,t=0){try{let r=n(),i=await D(e,t),a=e=>(e/1024/1024/1024).toFixed(3);s(`[HeapDump] Memory state:
|
|
2
|
+
heapUsed: ${a(i.memoryUsage.heapUsed)} GB (in snapshot)
|
|
3
|
+
external: ${a(i.memoryUsage.external)} GB (NOT in snapshot)
|
|
4
|
+
rss: ${a(i.memoryUsage.rss)} GB (total process)
|
|
5
|
+
${i.analysis.recommendation}`);let c=p();await o().mkdir(c);let u=t>0?`-dump${t}`:``,d=`${r}${u}.heapsnapshot`,f=`${r}${u}-diagnostics.json`,m=_(c,d),h=_(c,f);return await S(h,l(i,null,2),{mode:384}),s(`[HeapDump] Diagnostics written to ${h}`),await k(m),s(`[HeapDump] Heap dump written to ${m}`),g(`tengu_heap_dump`,{triggerManual:e===`manual`,triggerAuto15GB:e===`auto-1.5GB`,dumpNumber:t,success:!0}),{success:!0,heapPath:m,diagPath:h}}catch(n){let r=i(n);return f(r),g(`tengu_heap_dump`,{triggerManual:e===`manual`,triggerAuto15GB:e===`auto-1.5GB`,dumpNumber:t,success:!1}),{success:!1,error:r.message}}}async function k(e){if(typeof Bun<`u`){y(e,Bun.generateHeapSnapshot(`v8`,`arraybuffer`),{mode:384}),Bun.gc(!0);return}let t=v(e,{mode:384});await C(w(),t)}var A=e((()=>{t(),h(),a(),u(),m(),c(),d(),r()}));async function j(){let e=await O();return e.success?{type:`text`,value:`${e.heapPath}\n${e.diagPath}`}:{type:`text`,value:`Failed to create heap dump: ${e.error}`}}e((()=>{A()}))();export{j as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,fi as s,n as c,ot as l,r as u,t as d,x as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,fi as s,n as c,ot as l,r as u,t as d,x as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Dx as m,Li as h,Ox as g,Qi as _,Wi as v,_x as y,lC as b,vx as x,zi as S}from"./loadAgentsDir-DrDu5yYy.js";import{S as C,x as w}from"./startupProfiler-xa3NmN7Z.js";import{u as T}from"./referral-DrebVwqx.js";import{n as E,t as D}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{n as O,r as k}from"./modalContext-DFjKLCB6.js";import{n as A,t as j}from"./PromptInputHelpMenu-DgDJHZqC.js";function M({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,N.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:C(v(e),d,!0)}))},[e,d]);return(0,P.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,P.jsx)(i,{dimColor:!0,children:c}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(i,{children:a}),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(y,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var N,P,F=e((()=>{s(),N=t(s(),1),_(),w(),d(),x(),P=p()}));function I(){return(0,L.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,L.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,L.jsx)(i,{bold:!0,children:`Getting started`}),(0,L.jsxs)(n,{flexDirection:`column`,children:[(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`1. `}),(0,L.jsx)(i,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`2. `}),(0,L.jsx)(i,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`3. `}),(0,L.jsx)(i,{children:`Type `}),(0,L.jsx)(i,{bold:!0,children:`/commit`}),(0,L.jsx)(i,{children:` to commit changes, `}),(0,L.jsx)(i,{bold:!0,children:`/help`}),(0,L.jsx)(i,{children:` for commands, or `}),(0,L.jsx)(i,{bold:!0,children:`?`}),(0,L.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,L.jsxs)(n,{flexDirection:`column`,children:[(0,L.jsx)(n,{children:(0,L.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,L.jsx)(j,{gap:2,fixedWidth:!0})]})]})}var L,R=e((()=>{s(),d(),A(),L=p()}));function z({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=k(),m=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,m,{context:`Help`});let _=E(m),v=g(`help:dismiss`,`Help`,`esc`),y=S(),b=t.filter(e=>y.has(e.name)&&!e.isHidden),x=[];if(process.env.USER_TYPE===`ant`){let e=new Set(h.map(e=>e.name));b=b.filter(t=>!e.has(t.name)),x=t.filter(t=>e.has(t.name)&&!t.isHidden)}let C=t.filter(e=>!y.has(e.name)&&!e.isHidden),w=[(0,B.jsx)(c,{title:`general`,children:(0,B.jsx)(I,{})},`general`)];return w.push((0,B.jsx)(c,{title:`commands`,children:(0,B.jsx)(M,{commands:b,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:m})},`commands`)),w.push((0,B.jsx)(c,{title:`custom-commands`,children:(0,B.jsx)(M,{commands:C,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:m})},`custom`)),process.env.USER_TYPE===`ant`&&x.length>0&&w.push((0,B.jsx)(c,{title:`[ant-only]`,children:(0,B.jsx)(M,{commands:x,maxHeight:d,columns:s,title:`Browse ant-only commands:`,onCancel:m})},`ant-only`)),(0,B.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,B.jsxs)(f,{color:`professionalBlue`,children:[(0,B.jsx)(u,{title:process.env.USER_TYPE===`ant`?`/help`:`Work Mate v0.0.3`,color:`professionalBlue`,defaultTab:`general`,children:w}),(0,B.jsx)(n,{marginTop:1,children:(0,B.jsxs)(i,{children:[`For more help: `,(0,B.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,B.jsx)(n,{marginTop:1,children:(0,B.jsx)(i,{dimColor:!0,children:_.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,_.keyName,` again to exit`]}):(0,B.jsxs)(i,{italic:!0,children:[v,` to cancel`]})})})]})})}var B,V=e((()=>{s(),D(),m(),_(),O(),b(),d(),T(),F(),R(),B=p()})),H,U;e((()=>{V(),H=p(),U=async(e,{options:{commands:t}})=>(0,H.jsx)(z,{commands:t,onClose:e})}))();export{U as call};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,fi as u,t as d,y as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{dt as m,en as h}from"./state-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,fi as u,t as d,y as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{dt as m,en as h}from"./state-ix0xIunV.js";import{$h as g,JS as _,Jh as v,Qh as y,Xh as b,Xu as x,YS as S,Yh as C,Yu as w,Zh as T,_x as E,aC as D,oC as O,qS as ee,qh as te,vx as k}from"./loadAgentsDir-DrDu5yYy.js";import{c as A,f as j,g as M}from"./settings-DfWP5y6X.js";import{n as N,r as ne}from"./analytics-BotDBGh0.js";import{l as P,o as F}from"./stringUtils-DGLPkqJ4.js";import{u as re}from"./referral-DrebVwqx.js";function ie(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);te(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=m();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}else if(process.env.USER_TYPE===`ant`){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:{type:`command`,command:`[ANT-ONLY] Built-in Hook`},matcher:e.matcher,source:`builtinHook`})}}}return n}function ae(e,t){return g(Object.keys(e[t]||{}),e,t)}function oe(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),h(),y(),L=n(function(e){return{PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
|
|
2
2
|
Exit code 0 - stdout/stderr not shown
|
|
3
3
|
Exit code 2 - show stderr to model and block tool call
|
|
4
4
|
Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
|
|
@@ -76,4 +76,4 @@ CLAUDE_ENV_FILE is set — write bash exports there to apply env to subsequent B
|
|
|
76
76
|
The matcher field specifies filenames to watch in the current directory (e.g. ".envrc|.env").
|
|
77
77
|
Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to dynamically update the watch list.
|
|
78
78
|
Exit code 0 - command completes successfully
|
|
79
|
-
Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:l}){return(0,B.jsx)(f,{title:`Hooks`,subtitle:`${n} ${
|
|
79
|
+
Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:l}){return(0,B.jsx)(f,{title:`Hooks`,subtitle:`${n} ${P(n,`hook`)} configured`,onCancel:l,children:(0,B.jsxs)(o,{flexDirection:`column`,gap:1,children:[r&&(0,B.jsxs)(o,{flexDirection:`column`,children:[(0,B.jsxs)(c,{color:`suggestion`,children:[a.info,` Hooks Restricted by Policy`]}),(0,B.jsx)(c,{dimColor:!0,children:`Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.`})]}),(0,B.jsx)(o,{flexDirection:`column`,children:(0,B.jsxs)(c,{dimColor:!0,children:[a.info,` This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.`,` `,(0,B.jsx)(s,{url:`https://code.claude.com/docs/en/hooks`,children:`Learn more`})]})}),(0,B.jsx)(o,{flexDirection:`column`,children:(0,B.jsx)(E,{onChange:e=>{i(e)},onCancel:l,options:Object.entries(e).map(([e,n])=>{let r=t[e]||0;return{label:r>0?(0,B.jsxs)(c,{children:[e,` `,(0,B.jsxs)(c,{color:`suggestion`,children:[`(`,r,`)`]})]}):e,value:e,description:n.summary}})})})]})})}var B,V=e((()=>{i(),u(),d(),F(),k(),B=p()}));function H({selectedEvent:e,selectedMatcher:t,hooksForSelectedMatcher:n,hookEventMetadata:r,onSelect:i,onCancel:a}){let s=r.matcherMetadata===void 0?e:`${e} - Matcher: ${t||`(all)`}`;return n.length===0?(0,U.jsx)(f,{title:s,subtitle:r.description,onCancel:a,inputGuide:()=>(0,U.jsx)(c,{children:`Esc to go back`}),children:(0,U.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,U.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,U.jsx)(f,{title:s,subtitle:r.description,onCancel:a,children:(0,U.jsx)(o,{flexDirection:`column`,children:(0,U.jsx)(E,{options:n.map((e,t)=>({label:`[${e.config.type}] ${v(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${b(e.source)} (${e.pluginName})`:b(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{u(),d(),y(),k(),U=p()}));function G({selectedEvent:e,matchersForSelectedEvent:t,hooksByEventAndMatcher:n,eventDescription:r,onSelect:i,onCancel:a}){let s=K.useMemo(()=>t.map(t=>{let r=n[e]?.[t]||[];return{matcher:t,sources:Array.from(new Set(r.map(e=>e.source))),hookCount:r.length}}),[t,n,e]);return t.length===0?(0,q.jsx)(f,{title:`${e} - Matchers`,subtitle:r,onCancel:a,inputGuide:()=>(0,q.jsx)(c,{children:`Esc to go back`}),children:(0,q.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,q.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,q.jsx)(f,{title:`${e} - Matchers`,subtitle:r,onCancel:a,children:(0,q.jsx)(o,{flexDirection:`column`,children:(0,q.jsx)(E,{options:s.map(e=>({label:`[${e.sources.map(T).join(`, `)}] ${e.matcher||`(all)`}`,value:e.matcher,description:`${e.hookCount} ${P(e.hookCount,`hook`)}`})),onChange:e=>{i(e)},onCancel:a})})})}var K,q,se=e((()=>{K=t(u(),1),d(),y(),F(),k(),q=p()}));function ce({selectedHook:e,eventSupportsMatcher:t,onCancel:n}){return(0,J.jsx)(f,{title:`Hook details`,onCancel:n,inputGuide:()=>(0,J.jsx)(c,{children:`Esc to go back`}),children:(0,J.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(c,{children:[`Event: `,(0,J.jsx)(c,{bold:!0,children:e.event})]}),t&&(0,J.jsxs)(c,{children:[`Matcher: `,(0,J.jsx)(c,{bold:!0,children:e.matcher||`(all)`})]}),(0,J.jsxs)(c,{children:[`Type: `,(0,J.jsx)(c,{bold:!0,children:e.config.type})]}),(0,J.jsxs)(c,{children:[`Source: `,(0,J.jsx)(c,{dimColor:!0,children:C(e.source)})]}),e.pluginName&&(0,J.jsxs)(c,{children:[`Plugin: `,(0,J.jsx)(c,{dimColor:!0,children:e.pluginName})]})]}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(c,{dimColor:!0,children:[le(e.config),`:`]}),(0,J.jsx)(o,{borderStyle:`round`,borderDimColor:!0,paddingLeft:1,paddingRight:1,children:(0,J.jsx)(c,{children:ue(e.config)})})]}),`statusMessage`in e.config&&e.config.statusMessage&&(0,J.jsxs)(c,{children:[`Status message: `,(0,J.jsx)(c,{dimColor:!0,children:e.config.statusMessage})]}),(0,J.jsx)(c,{dimColor:!0,children:`To modify or remove this hook, edit settings.json directly or ask Claude to help.`})]})})}function le(e){switch(e.type){case`command`:return`Command`;case`prompt`:return`Prompt`;case`agent`:return`Prompt`;case`http`:return`URL`}}function ue(e){switch(e.type){case`command`:return e.command;case`prompt`:return e.prompt;case`agent`:return e.prompt;case`http`:return e.url}}var J,Y=e((()=>{u(),d(),y(),J=p()}));function de({toolNames:e,onExit:t}){let[n,r]=(0,X.useState)({mode:`select-event`}),[i,a]=(0,X.useState)(()=>j()?.disableAllHooks===!0&&A(`policySettings`)?.disableAllHooks===!0),[s,u]=(0,X.useState)(()=>A(`policySettings`)?.allowManagedHooksOnly===!0);O(e=>{if(e===`policySettings`){let e=j()?.disableAllHooks===!0;a(e&&A(`policySettings`)?.disableAllHooks===!0),u(A(`policySettings`)?.allowManagedHooksOnly===!0)}});let d=n.mode,p=`event`in n?n.event:`PreToolUse`,m=`matcher`in n?n.matcher:null,h=_(e=>e.mcp),g=S(),v=(0,X.useMemo)(()=>[...e,...h.tools.map(e=>e.name)],[e,h.tools]),y=(0,X.useMemo)(()=>ie(g.getState(),v),[v,g]),b=(0,X.useMemo)(()=>ae(y,p),[y,p]),x=(0,X.useMemo)(()=>oe(y,p,m),[y,p,m]),C=(0,X.useCallback)(()=>{t(`Hooks dialog dismissed`,{display:`system`})},[t]);l(`confirm:no`,C,{context:`Confirmation`,isActive:d===`select-event`}),l(`confirm:no`,()=>{r({mode:`select-event`})},{context:`Confirmation`,isActive:d===`select-matcher`}),l(`confirm:no`,()=>{`event`in n&&(I(n.event,v)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event}))},{context:`Confirmation`,isActive:d===`select-hook`}),l(`confirm:no`,()=>{if(n.mode===`view-hook`){let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}},{context:`Confirmation`,isActive:d===`view-hook`});let w=L(v),T=j()?.disableAllHooks===!0,{hooksByEvent:E,totalHooksCount:D}=(0,X.useMemo)(()=>{let e={},t=0;for(let[n,r]of Object.entries(y)){let i=Object.values(r).reduce((e,t)=>e+t.length,0);e[n]=i,t+=i}return{hooksByEvent:e,totalHooksCount:t}},[y]);if(T)return(0,Z.jsx)(f,{title:`Hook Configuration - Disabled`,onCancel:C,inputGuide:()=>(0,Z.jsx)(c,{children:`Esc to close`}),children:(0,Z.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,Z.jsxs)(o,{flexDirection:`column`,children:[(0,Z.jsxs)(c,{children:[`All hooks are currently `,(0,Z.jsx)(c,{bold:!0,children:`disabled`}),i&&` by a managed settings file`,`. You have `,(0,Z.jsx)(c,{bold:!0,children:D}),` `,`configured `,P(D,`hook`),` that `,P(D,`is`,`are`),` not running.`]}),(0,Z.jsx)(o,{marginTop:1,children:(0,Z.jsx)(c,{dimColor:!0,children:`When hooks are disabled:`})}),(0,Z.jsx)(c,{dimColor:!0,children:`· No hook commands will execute`}),(0,Z.jsx)(c,{dimColor:!0,children:`· StatusLine will not be displayed`}),(0,Z.jsx)(c,{dimColor:!0,children:`· Tool operations will proceed without hook validation`})]}),!i&&(0,Z.jsx)(c,{dimColor:!0,children:`To re-enable hooks, remove "disableAllHooks" from settings.json or ask Claude.`})]})});switch(n.mode){case`select-event`:return(0,Z.jsx)(z,{hookEventMetadata:w,hooksByEvent:E,totalHooksCount:D,restrictedByPolicy:s,onSelectEvent:e=>{I(e,v)===void 0?r({mode:`select-hook`,event:e,matcher:``}):r({mode:`select-matcher`,event:e})},onCancel:C});case`select-matcher`:return(0,Z.jsx)(G,{selectedEvent:n.event,matchersForSelectedEvent:b,hooksByEventAndMatcher:y,eventDescription:w[n.event].description,onSelect:e=>{r({mode:`select-hook`,event:n.event,matcher:e})},onCancel:()=>{r({mode:`select-event`})}});case`select-hook`:return(0,Z.jsx)(H,{selectedEvent:n.event,selectedMatcher:n.matcher,hooksForSelectedMatcher:x,hookEventMetadata:w[n.event],onSelect:e=>{r({mode:`view-hook`,event:n.event,hook:e})},onCancel:()=>{I(n.event,v)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event})}});case`view-hook`:return(0,Z.jsx)(ce,{selectedHook:n.hook,eventSupportsMatcher:I(n.event,v)!==void 0,onCancel:()=>{let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}})}}var X,Z,fe=e((()=>{u(),X=t(u(),1),ee(),D(),d(),re(),R(),M(),F(),V(),W(),se(),Y(),Z=p()})),Q,$;e((()=>{fe(),N(),x(),Q=p(),$=async(e,t)=>{ne(`tengu_hooks_command`,{});let n=t.getAppState().toolPermissionContext;return(0,Q.jsx)(de,{toolNames:w(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Zt as e,dn as t,vn as n,yn as r}from"./loadAgentsDir-DrDu5yYy.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{o as t}from"./log-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{o as t}from"./log-BMCygSzM.js";function n(e){let t;try{t=new URL(e).hostname}catch{throw Error(`assertWorkspaceHost: invalid URL "${e}". Workspace API key requests must target ${i}.`)}if(t!==i)throw Error(`assertWorkspaceHost: refusing to send workspace API key to non-Anthropic host "${t}". Workspace API key requests must target ${i}. If you are using a custom base URL, workspace endpoints are only available on the Anthropic API.`)}function r(e){let t;try{t=new URL(e).hostname}catch{throw Error(`assertSubscriptionBaseUrl: invalid URL "${e}". Subscription OAuth requests must target ${i}.`)}if(t!==i)throw Error(`assertSubscriptionBaseUrl: refusing subscription OAuth request to non-Anthropic host "${t}". Subscription OAuth requests must target ${i}.`)}var i,a=e((()=>{t(),i=`api.anthropic.com`}));export{n,a as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{E as i,M as a,h as o,n as s,r as c,t as l}from"./lazySchema-DcIJE_0i.js";import{en as u,ht as d}from"./state-ix0xIunV.js";import{a as f,l as p}from"./debug-BrXObCdR.js";import{a as m,n as h,t as g}from"./bridgeConfig-DbqUHe0H.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(),c(),u(),f(),t(),l(),m();var S=3e4;function C(e){p(`[bridge:inbound-attach] ${e}`)}var w=s(()=>i({file_uuid:a(),file_name:a()})),T=s(()=>o(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`,d())}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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./inboundAttachments-Cfl4_n0S.js";export{e as resolveAndPrepend};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,u as r}from"./envUtils-DSxRz_kt.js";import{en as i,ht as a,nt as o}from"./state-ix0xIunV.js";import{Aa as s,Ao as c,Bl as l,Da as u,Ea as d,Fa as f,Il as p,Ma as m,Na as h,Oa as g,Oo as _,Pa as ee,Ta as v,Ua as y,Uo as b,Va as x,Ya as S,ja as C,jr as w,ka as te,mr as ne,vb as re,yb as T,zo as E}from"./loadAgentsDir-DrDu5yYy.js";import{F as D,a as O,l as k,nt as ie,rt as ae,z as A}from"./debug-BrXObCdR.js";import{b as oe,c as se,g as ce}from"./config-DiT2Z8dY.js";import{M as j,_ as le,i as M,j as ue,p as de}from"./git-Do0wJvux.js";import{g as fe,m as N}from"./log-BMCygSzM.js";import{n as pe,r as P}from"./analytics-BotDBGh0.js";import{Hr as F,Lt as I,Ur as L,Vt as R,ht as me,kt as he,vn as z,yn as B}from"./model-fi472PRc.js";import{O as V,_ as ge,d as _e,k as ve,n as ye,t as H}from"./rcDebugLog-2-1XSyFV.js";import{a as U,c as W,d as be,f as xe,o as G,r as K,s as q,u as J}from"./debugUtils-NO5KtXqi.js";import{a as Se,i as Y,n as Ce,o as X,t as Z}from"./bridgeConfig-DbqUHe0H.js";import{a as Q,o as $,r as we,s as Te,t as Ee}from"./bridgeEnabled-CM3SaumJ.js";import{i as De,t as Oe}from"./assistant-C83quuNj.js";import{t as ke}from"./capacityWake-CV_x9H8j.js";import{n as Ae,t as je}from"./pollConfig-DH2oCtFS.js";import{i as Me}from"./trustedDevice-DvpN4J1F.js";import{a as Ne,n as Pe,r as Fe,t as Ie}from"./workSecret-CNWiR2uQ.js";import{a as Le,i as Re,n as ze,t as Be}from"./createSession-VMTMXOHu.js";import{i as Ve,n as He}from"./envLessBridgeConfig-BFjJ8Kt4.js";import{n as Ue,o as We}from"./mappers-D0CNXG32.js";import{n as Ge,r as Ke,t as qe}from"./sessionTitle-CmLWNFuX.js";import{a as Je,i as Ye,n as Xe,o as Ze,r as Qe,t as $e}from"./bridgeMessaging-lfa_v3oi.js";import{t as et}from"./HybridTransport-8j0AviF6.js";import{n as tt,r as nt,t as rt}from"./flushGate-CJ73xcaK.js";import{hostname as it}from"os";import{randomUUID as at}from"crypto";i(),N(),le(),ce(),L(),R(),Se(),T(),we(),E(),x(),w(),Re(),Ve(),Ue(),Ke(),m(),O(),H(),ue(),pe(),ie(),W(),p(),V(),_e(),n(),G(),A(),z(),d();var ot=2e3,st=6e4,ct=900*1e3,lt=0;async function ut(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:d,workerType:f,getAccessToken:p,createSession:m,archiveSession:h,getCurrentTitle:_=()=>s,toSDKMessages:ee=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:y,getPollIntervalConfig:b=()=>Ae,initialHistoryCap:x=200,initialMessages:S,previouslyFlushedUUIDs:w,onInboundMessage:ne,onPermissionResponse:re,onInterrupt:T,onSetModel:E,onSetMaxThinkingTokens:O,onSetPermissionMode:ie,onStateChange:A,onUserMessage:oe,perpetual:se,initialSSESequenceNum:ce=0}=e,le=++lt,{writeBridgePointer:M,clearBridgePointer:ue,readBridgePointer:de}=await import(`./bridgePointer-MqLe5Asm.js`),fe=se?await de(n):null,N=fe?.source===`repl`?fe:null;k(`[bridge:repl] initBridgeCore #${le} starting (initialMessages=${S?.length??0}${N?` perpetual prior=env:${N.environmentId}`:``})`);let pe=C({baseUrl:c,getAccessToken:p,runnerVersion:`0.0.3`,onDebug:k,onAuth401:y,getTrustedDeviceToken:Me}),F=process.env.USER_TYPE===`ant`?te(pe):pe,I={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:at(),workerType:f,environmentId:at(),reuseEnvironmentId:N?.environmentId,apiBaseUrl:c,sessionIngressUrl:d},L,R;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return q(`registration_failed`,`[bridge:repl] Environment registration failed: ${D(e)}`),N&&await ue(n),A?.(`failed`,D(e)),null}k(`[bridge:repl] Environment registered: ${L}`),j(`info`,`bridge_repl_env_registered`),P(`tengu_bridge_repl_env_registered`,{});async function me(e,t){if(L!==e)return k(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=xe(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),k(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){k(`[bridge:repl] reconnectSession(${e}) failed: ${D(t)}`)}return k(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let he=N?await me(N.environmentId,N.sessionId):!1;N&&!he&&await ue(n);let z;if(he&&N){if(z=N.sessionId,k(`[bridge:repl] Perpetual session reused: ${z}`),S&&w)for(let e of S)w.add(e.uuid)}else{let e=await m({environmentId:L,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return k(`[bridge:repl] Session creation failed, deregistering environment`),P(`tengu_bridge_repl_session_failed`,{}),await F.deregisterEnvironment(L).catch(()=>{}),A?.(`failed`,`Session creation failed`),null;z=e,k(`[bridge:repl] Session created: ${z}`)}await M(n,{sessionId:z,environmentId:L,source:`repl`}),j(`info`,`bridge_repl_session_created`),P(`tengu_bridge_repl_started`,{has_initial_messages:!!(S&&S.length>0),inProtectedNamespace:r()});let B=new Set;if(S)for(let e of S)B.add(e.uuid);let V=new $e(2e3);for(let e of B)V.add(e);let _e=new $e(2e3),H=new AbortController,U=null;ge(e=>{H.signal.aborted||U?.reportMetadata(e)},{replayCurrent:!0});let W=0,G=he?ce:0,K=null,J=null,Se=ke(H.signal),Y=Se.wake,Ce=Se.signal,X=new rt,Z=!oe,Q=0,$=null;async function we(){if($)return $;$=Te();try{return await $}finally{$=null}}async function Te(){if(Q++,ye(`doReconnect: attempt=${Q}/3 envId=${L} sessionId=${z} workId=${K}`),W++,k(`[bridge:repl] Reconnecting after env lost (attempt ${Q}/3)`),Q>3)return k(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}if(Y(),X.drop(),K){let e=K;if(await F.stopWork(L,e,!1).catch(()=>{}),K!==e)return k(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Q=0,!0;K=null,J=null}if(H.signal.aborted)return k(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,k(`[bridge:repl] Environment re-registration failed: ${D(e)}`),!1}if(I.reuseEnvironmentId=void 0,k(`[bridge:repl] Re-registered: requested=${e} got=${L}`),H.signal.aborted)return k(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(U!==null)return k(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Q=0,!0;if(await me(e,z))return P(`tengu_bridge_repl_reconnected_in_place`,{}),Q=0,!0;if(L!==e&&P(`tengu_bridge_repl_env_expired_fresh_session`,{}),await h(z),H.signal.aborted)return k(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=_(),r=await m({environmentId:L,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?H.signal.aborted?(k(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await h(r),!1):(z=r,l(be(r)).catch(()=>{}),G=0,_e.clear(),Z=!oe,k(`[bridge:repl] Re-created session: ${z}`),await M(n,{sessionId:z,environmentId:L,source:`repl`}),w?.clear(),Q=0,!0):(k(`[bridge:repl] Session creation failed during reconnection`),!1)}function Ee(){return p()}function De(){let e=X.end();if(e.length===0)return;if(!U){k(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)V.add(t.uuid);let t=ee(e).map(e=>({...e,session_id:z}));k(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),U.writeBatch(t)}let Oe=null;function je(){Oe?.()}function Fe(e){if(ye(`handleTransportPermanentClose: code=${e} transport=${U?`exists`:`null`} pollAborted=${H.signal.aborted}`),k(`[bridge:repl] Transport permanently closed: code=${e}`),P(`tengu_bridge_repl_ws_closed`,{code:e}),U){let e=U.getLastSequenceNum();e>G&&(G=e),U=null}Y();let t=X.drop();if(t>0&&k(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){A?.(`failed`,`session ended`),H.abort(),je();return}A?.(`reconnecting`,`Remote Control connection lost (code ${e})`),k(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),we().then(t=>{t||H.signal.aborted||(k(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),P(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),A?.(`failed`,`reconnection failed`),je())})}let Le;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Le=()=>{k(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),we()},process.on(`SIGUSR2`,Le));let Re=null;process.env.USER_TYPE===`ant`&&g({fireClose:e=>{if(!Re){k(`[bridge:debug] fireClose: no transport wired yet`);return}k(`[bridge:debug] fireClose(${e}) — injecting`),Re(e)},forceReconnect:()=>{k(`[bridge:debug] forceReconnect — injecting`),we()},injectFault:u,wakePollLoop:Y,describe:()=>`env=${L} session=${z} transport=${U?.getStateLabel()??`null`} workId=${K??`null`}`}),dt({api:F,getCredentials:()=>({environmentId:L,environmentSecret:R}),signal:H.signal,getPollIntervalConfig:b,onStateChange:A,getWsState:()=>U?.getStateLabel()??`null`,isAtCapacity:()=>U!==null,capacitySignal:Ce,onFatalError:je,getHeartbeatInfo:()=>!K||!J?null:{environmentId:L,workId:K,sessionToken:J},onHeartbeatFatal:e=>{if(k(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}X.drop(),K&&F.stopWork(L,K,!1).catch(e=>{k(`[bridge:repl] stopWork after heartbeat fatal: ${D(e)}`)}),K=null,J=null,Y(),A?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await we()?{environmentId:L,environmentSecret:R}:null},onWorkReceived:(e,r,i,a)=>{if(U?.isConnectedStatus()&&k(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),k(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${z} match=${Ne(e,z)}`),M(n,{sessionId:z,environmentId:L,source:`repl`}),!Ne(e,z)){k(`[bridge:repl] Rejecting foreign session: expected=${z} got=${e}`);return}K=i,J=r;let o=a||t(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=Ee(),!s){k(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ve(s)}if(P(`tengu_bridge_repl_work_received`,{}),U){let e=U;U=null;let t=e.getLastSequenceNum();t>G&&(G=t),e.close()}X.deactivate();let l=e=>Ye(e,{transport:U,sessionId:z,onInterrupt:T,onSetModel:E,onSetMaxThinkingTokens:O,onSetPermissionMode:ie}),u=!1,f=e=>{U=e,e.setOnConnect(()=>{if(U===e){if(k(`[bridge:repl] Ingress transport connected`),P(`tengu_bridge_repl_ws_connected`,{}),!o){let e=Ee();e&&ve(e)}if(He=!1,!u&&S&&S.length>0){u=!0;let t=x,n=S.filter(e=>Je(e)&&!w?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(k(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),P(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=ee(r);if(i.length>0){k(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:z})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){k(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(w)for(let e of i)e.uuid&&w.add(e.uuid)}).catch(e=>k(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{U===e&&(De(),A?.(`connected`))})}else De(),A?.(`connected`)}else X.active||A?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);ye(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{ye(`ingress (non-JSON): ${String(e).slice(0,200)}`)}Qe(e,V,_e,ne,re,l)}),Re=Fe,e.setOnClose(t=>{U===e&&(ye(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Fe(t))}),!u&&S&&S.length>0&&X.start(),e.connect()};if(W++,o){let t=Ie(c,e),n=W;k(`[bridge:repl] CCR v2: sessionUrl=${t} session=${e} gen=${n}`),nt({sessionUrl:t,ingressToken:r,sessionId:e,initialSequenceNum:G}).then(e=>{if(H.signal.aborted){e.close();return}if(n!==W){k(`[bridge:repl] CCR v2: discarding stale handshake gen=${n} current=${W}`),e.close();return}f(e)},e=>{k(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${D(e)}`,{level:`error`}),P(`tengu_bridge_repl_ccr_v2_init_failed`,{}),n===W&&(K&&(F.stopWork(L,K,!1).catch(e=>{k(`[bridge:repl] stopWork after v2 init failure: ${D(e)}`)}),K=null,J=null),Y())})}else{let t=Pe(d,e);k(`[bridge:repl] Ingress URL: ${t}`),k(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;f(tt(new et(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${Ee()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{A?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),Y()}})))}}});let ze=se?setInterval(()=>{$||M(n,{sessionId:z,environmentId:L,source:`repl`})},60*6e4):null;ze?.unref?.();let Be=b().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{U&&(k(`[bridge:repl] keep_alive sent`),U.write({type:`keep_alive`}).catch(e=>{k(`[bridge:repl] keep_alive write failed: ${D(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;Oe=async()=>{if(He){k(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${z}`);return}He=!0;let e=Date.now();if(k(`[bridge:repl] Teardown starting: env=${L} session=${z} workId=${K??`none`} transportState=${U?.getStateLabel()??`null`}`),ze!==null&&clearInterval(ze),Ve!==null&&clearInterval(Ve),Le&&process.off(`SIGUSR2`,Le),process.env.USER_TYPE===`ant`&&(v(),Re=null),H.abort(),k(`[bridge:repl] Teardown: poll loop aborted`),U){let e=U.getLastSequenceNum();e>G&&(G=e)}if(se){U=null,X.drop(),await M(n,{sessionId:z,environmentId:L,source:`repl`}),k(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${z} alive on server, duration=${Date.now()-e}ms`);return}let t=U;if(U=null,X.drop(),t){let e={...Ze(z),session_id:z};t.write(e)}let r=K?F.stopWork(L,K,!0).then(()=>{k(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{k(`[bridge:repl] Teardown stopWork failed: ${D(e)}`)}):Promise.resolve();await Promise.all([r,h(z)]),t?.close(),k(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{k(`[bridge:repl] Teardown deregister failed: ${D(e)}`)}),await ue(n),k(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let Ue=ae(()=>Oe?.());return k(`[bridge:repl] Ready: env=${L} session=${z}`),A?.(`ready`),{get bridgeSessionId(){return z},get environmentId(){return L},getSSESequenceNum(){let e=U?.getLastSequenceNum()??0;return Math.max(G,e)},sessionIngressUrl:d,writeMessages(e){let t=e.filter(e=>Je(e)&&!B.has(e.uuid)&&!V.has(e.uuid));if(t.length===0)return;if(!Z)for(let e of t){let t=Xe(e);if(t!==void 0&&oe?.(t,z)){Z=!0;break}}if(X.enqueue(...t)){k(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!U){let e=t.map(e=>e.type).join(`,`);k(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${z}`,{level:`warn`});return}for(let e of t)V.add(e.uuid);k(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=ee(t).map(e=>({...e,session_id:z}));U.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!V.has(e.uuid));if(t.length===0)return;if(!U){k(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${z}`,{level:`warn`});return}for(let e of t)e.uuid&&V.add(e.uuid);let n=t.map(e=>({...e,session_id:z}));U.writeBatch(n)},sendControlRequest(e){if(!U){k(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:z};U.write(t),k(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!U){k(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:z};U.write(t),k(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!U){k(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:z};U.write(t),k(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!U){k(`[bridge:repl] sendResult: skipping, transport not configured session=${z}`);return}U.reportState(`idle`);let e={...Ze(z),session_id:z};U.write(e),k(`[bridge:repl] Sent result for session=${z}`)},async teardown(){Ue(),await Oe?.(),k(`[bridge:repl] Torn down`),P(`tengu_bridge_repl_teardown`,{})}}}async function dt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:c,capacitySignal:l,onFatalError:u,getPollIntervalConfig:d=()=>Ae,getHeartbeatInfo:p,onHeartbeatFatal:m}){k(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let g=0,_=null,v=null,y=0,b=!1;for(;!n.aborted;){let{environmentId:x,environmentSecret:S}=t(),C=d();try{let t=await e.pollForWork(x,S,n,C.reclaim_older_than_ms);if(y=0,g>0&&(k(`[bridge:repl] Poll recovered after ${g} consecutive error(s)`),g=0,_=null,v=null,r?.(`ready`)),!t){let t=b;if(b=!1,c?.()&&l&&!t){let t=C.poll_interval_ms_at_capacity;if(C.non_exclusive_heartbeat_interval_ms>0&&p){P(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:C.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&c()&&(r===null||Date.now()<r);){let t=d();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=p();if(!n)break;let r=l();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(k(`[bridge:repl:heartbeat] Failed: ${D(e)}`),e instanceof s){r.cleanup(),P(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),m?(m(e),k(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await B(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:c()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(P(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&k(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:C.non_exclusive_heartbeat_interval_ms;if(r>0){let e=l(),t=Date.now();await B(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(k(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),P(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),b=!0)}}else await B(C.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Fe(t.secret)}catch(n){k(`[bridge:repl] Failed to decode work secret: ${D(n)}`),P(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(x,t.id,!1).catch(()=>{});continue}k(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(x,t.id,a.session_ingress_token)}catch(e){k(`[bridge:repl] Acknowledge failed workId=${t.id}: ${D(e)}`)}if(t.data.type===`healthcheck`){k(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{f(e,`session_id`)}catch{k(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),k(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof s&&i.status===404&&a){let e=t().environmentId;if(x!==e){k(`[bridge:repl] Stale poll error for old env=${x}, current env=${e} — skipping onEnvironmentLost`),g=0,_=null;continue}if(y++,k(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${y}/3)`),P(`tengu_bridge_repl_env_lost`,{attempt:y}),y>3){k(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),u?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){g=0,_=null,r?.(`ready`),k(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),u?.();break}if(i instanceof s){let e=h(i.errorType),t=ee(i);k(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),P(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),j(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),u?.();break}let c=Date.now();v!==null&&c-v>6e4*2&&(k(`[bridge:repl] Detected system sleep (${Math.round((c-v)/1e3)}s gap), resetting poll error budget`),j(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:c-v}),g=0,_=null),v=c,g++,_===null&&(_=c);let l=c-_,f=U(i),m=K(i),b=o?.()??`unknown`;if(k(`[bridge:repl] Poll error (attempt ${g}, elapsed ${Math.round(l/1e3)}s, ws=${b}): ${m}`),P(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:g,elapsedMs:l}),g===1&&r?.(`reconnecting`,m),l>=9e5){k(`[bridge:repl] Poll failures exceeded ${ct/1e3}s (${g} errors), giving up`),j(`info`,`bridge_repl_poll_give_up`),P(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:g,elapsedMs:l,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let S=Math.min(ot*2**(g-1),st);if(d().non_exclusive_heartbeat_interval_ms>0){let t=p?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await B(S,n)}}k(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}O(),A(),G(),W();async function ft(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:d,initialMessages:f,getMessages:p,previouslyFlushedUUIDs:m,initialName:h,perpetual:g,outboundOnly:ee,tags:v}=t??{};if(J($),!await Q())return q(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!Z())return q(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),d?.(`failed`,`/login`),null;if(await S(),!y(`allow_remote_control`))return q(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),d?.(`failed`,`disabled by your organization's policy`),null;if(!Y()){let e=se();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&he()?.expiresAt===e.bridgeOauthDeadExpiresAt)return k(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await me();let t=he();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){q(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),d?.(`failed`,`/login`);let e=t.expiresAt;return oe(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let x=Ce(),C=`remote-control-${re()}`,w=!1,te=!1;if(h)C=h,w=!0,te=!0;else{let e=a(),t=e?ne(e):void 0;if(t)C=t,w=!0,te=!0;else if(f&&f.length>0)for(let e=f.length-1;e>=0;e--){let t=f[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||b(t))continue;let n=_(t.message.content);if(!n)continue;let r=mt(n);if(r){C=r,w=!0;break}}}let T=0,E,O=0,ie=(e,t,n)=>{w=!0,C=e,k(`[bridge:repl] derived title from message ${n}: ${e}`),Le(t,e,{baseUrl:x,getAccessToken:Z}).catch(()=>{})},ae=(e,t)=>{let n=++O,r=T;Ge(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===O&&E===t&&!ne(a())&&ie(e,t,r)})},A=(e,t)=>{if(te||ne(a()))return!0;if(E!==void 0&&E!==t&&(T=0),E=t,T++,T===1&&!w){let n=mt(e);n&&ie(n,t,T),ae(e,t)}else if(T===3){let n=p?.(),r=n?qe(c(n)):e;ae(r,t)}return T>=3},ce=X()?`self-hosted`:await F();if(!ce)return q(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),d?.(`failed`,`/login`),null;if(Te()&&!g){let e=await He();if(e)return q(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),d?.(`failed`,"run `claude update` to upgrade"),null;k(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-BOeljn2c.js`);return t({baseUrl:x,orgUUID:ce,title:C,getAccessToken:Z,onAuth401:I,toSDKMessages:We,initialHistoryCap:200,initialMessages:f,onInboundMessage:n,onUserMessage:A,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:d,outboundOnly:ee,tags:v})}let j=Ee();if(j)return q(`version_too_old`,`[bridge:repl] Skipping: ${j}`),d?.(`failed`,"run `claude update` to upgrade"),null;let le=await M(),ue=await de(),fe=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||x,N=`claude_code`;{let{isAssistantMode:t}=(De(),e(Oe));t()&&(N=`claude_code_assistant`)}return ut({dir:o(),machineName:it(),branch:le,gitRepoUrl:ue,title:C,baseUrl:x,sessionIngressUrl:fe,workerType:N,getAccessToken:Z,createSession:e=>ze({...e,events:[],baseUrl:x,getAccessToken:Z}),archiveSession:e=>Be(e,{baseUrl:x,getAccessToken:Z,timeoutMs:1500}).catch(e=>{k(`[bridge:repl] archiveBridgeSession threw: ${D(e)}`,{level:`error`})}),getCurrentTitle:()=>ne(a())??C,onUserMessage:A,toSDKMessages:We,onAuth401:I,getPollIntervalConfig:je,initialHistoryCap:200,initialMessages:f,previouslyFlushedUUIDs:m,onInboundMessage:n,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:u,onStateChange:d,perpetual:g})}var pt=50;function mt(e){let t=fe(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>pt?n.slice(0,pt-1)+`…`:n}export{ft as initReplBridge};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,kn as i,s as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{F as c,a as l,l as u,z as d}from"./debug-BrXObCdR.js";import{Jt as f,Zt as p,g as m,n as h,y as g}from"./settings-DfWP5y6X.js";import{n as _,r as v}from"./analytics-BotDBGh0.js";import{a as y,n as b,r as x,s as S,t as C}from"./nativeInstaller-DktvrWRd.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(r(),1);_(),o(),l(),p(),d(),C(),m();var D=s();function O(){let e=f.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(t,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{color:`warning`,children:[(0,D.jsx)(a,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,r)=>(0,D.jsx)(t,{marginLeft:2,children:(0,D.jsxs)(n,{dimColor:!0,children:[`• `,e]})},r))]})}function A({onDone:e,force:r,target:i}){let[o,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{u(`Install: Starting installation process (force=${r}, target=${i})`);let e=i||h()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),u(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${r})`);let t=await S(e,r);if(u(`Install: installLatest returned version=${t.latestVersion}, wasUpdated=${t.wasUpdated}, lockFailed=${t.lockFailed}`),t.lockFailed)throw Error(`Could not install - another process is currently installing Claude. Please try again in a moment.`);t.latestVersion||u(`Install: Failed to retrieve version information during install`,{level:`error`}),t.wasUpdated||u(`Install: Already up to date`),s({type:`setting-up`});let n=await b(!0);u(`Install: Setup launcher completed with ${n.length} messages`),n.length>0&&n.forEach(e=>u(`Install: Setup message: ${e.message}`)),u(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:c}=await x();a>0&&u(`Cleaned up ${a} npm installation(s)`),o.length>0&&u(`Cleanup errors: ${o.join(`, `)}`);let l=await y();l.length>0&&u(`Shell alias cleanup: ${l.map(e=>e.message).join(`; `)}`),v(`tengu_claude_install_command`,{has_version:+!!t.latestVersion,forced:+!!r}),(i===`latest`||i===`stable`)&&(g(`userSettings`,{autoUpdatesChannel:i}),u(`Install: Saved autoUpdatesChannel=${i} to user settings`));let d=[...c,...l.map(e=>e.message)];n.length>0?(s({type:`set-up`,messages:n.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:t.latestVersion||`current`,setupMessages:[...n.map(e=>e.message),...d]})):(u(`Install: Shell PATH already configured`),s({type:`success`,version:t.latestVersion||`current`,setupMessages:d.length>0?d:void 0}))}catch(e){u(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:c(e)})}}e()},[r,i]),(0,E.useEffect)(()=>{o.type===`success`?setTimeout(e,2e3,`Work Mate installation completed successfully`,{display:`system`}):o.type===`error`&&setTimeout(e,3e3,`Work Mate installation failed`,{display:`system`})},[o,e]),(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,children:[o.type===`checking`&&(0,D.jsx)(n,{color:`claude`,children:`Checking installation status...`}),o.type===`cleaning-npm`&&(0,D.jsx)(n,{color:`warning`,children:`Cleaning up old npm installations...`}),o.type===`installing`&&(0,D.jsxs)(n,{color:`claude`,children:[`Installing Work Mate native build `,o.version,`...`]}),o.type===`setting-up`&&(0,D.jsx)(n,{color:`claude`,children:`Setting up launcher and shell integration...`}),o.type===`set-up`&&(0,D.jsx)(k,{messages:o.messages}),o.type===`success`&&(0,D.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(t,{children:[(0,D.jsx)(a,{status:`success`,withSpace:!0}),(0,D.jsx)(n,{color:`success`,bold:!0,children:`Work Mate successfully installed!`})]}),(0,D.jsxs)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:[o.version!==`current`&&(0,D.jsxs)(t,{children:[(0,D.jsx)(n,{dimColor:!0,children:`Version: `}),(0,D.jsx)(n,{color:`claude`,children:o.version})]}),(0,D.jsxs)(t,{children:[(0,D.jsx)(n,{dimColor:!0,children:`Location: `}),(0,D.jsx)(n,{color:`text`,children:O()})]})]}),(0,D.jsx)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(t,{marginTop:1,children:[(0,D.jsx)(n,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(n,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(n,{dimColor:!0,children:` to get started`})]})}),o.setupMessages&&(0,D.jsx)(k,{messages:o.setupMessages})]}),o.type===`error`&&(0,D.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(t,{children:[(0,D.jsx)(a,{status:`error`,withSpace:!0}),(0,D.jsx)(n,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(n,{color:`error`,children:o.message}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(n,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`Install Work Mate native build`,argumentHint:`[options]`,async call(e,t,n){let r=n.includes(`--force`),a=n.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await i((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:r,target:a}))}};export{j as install};
|