@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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-CYmmnQVS.js";import{d as r,p as i}from"./debug-BrXObCdR.js";import{o as a,s as o}from"./log-BMCygSzM.js";import{n as s,t as c}from"./index.min-D75yiGLN.js";import{i as l,n as u}from"./path-D5U-tm91.js";import{basename as d,dirname as f,join as p,sep as m}from"path";function h(e,t){if(!e)return{directory:t||n(),prefix:``};let r=u(e,t);return e.endsWith(`/`)||e.endsWith(m)?{directory:r,prefix:``}:{directory:f(r),prefix:d(e)}}async function g(e){let t=C.get(e);if(t)return t;try{let t=(await r().readdir(e)).filter(e=>e.isDirectory()&&!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:`directory`})).slice(0,100);return C.set(e,t),t}catch(e){return o(e),[]}}async function _(e,t={}){let{basePath:r=n(),maxResults:i=10}=t,{directory:a,prefix:o}=h(e,r),s=await g(a),c=o.toLowerCase();return s.filter(e=>e.name.toLowerCase().startsWith(c)).slice(0,i).map(e=>({id:e.path,displayText:e.name+`/`,description:`directory`,metadata:{type:`directory`}}))}function v(e){return e.startsWith(`~/`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`)||e===`~`||e===`.`||e===`..`}async function y(e,t=!1){let n=`${e}:${t}`,i=w.get(n);if(i)return i;try{let i=(await r().readdir(e)).filter(e=>t||!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:t.isDirectory()?`directory`:`file`})).sort((e,t)=>e.type===`directory`&&t.type!==`directory`?-1:e.type!==`directory`&&t.type===`directory`?1:e.name.localeCompare(t.name)).slice(0,100);return w.set(n,i),i}catch(e){return o(e),[]}}async function b(e,t={}){let{basePath:r=n(),maxResults:i=10,includeFiles:a=!0,includeHidden:o=!1}=t,{directory:s,prefix:c}=h(e,r),l=await y(s,o),u=c.toLowerCase(),d=l.filter(e=>!a&&e.type===`file`?!1:e.name.toLowerCase().startsWith(u)).slice(0,i),f=e.includes(`/`)||e.includes(m),p=``;if(f){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(m),r=Math.max(t,n);p=e.substring(0,r+1)}return(p.startsWith(`./`)||p.startsWith(`.`+m))&&(p=p.slice(2)),d.map(e=>{let t=p+e.name;return{id:t,displayText:e.type===`directory`?t+`/`:t,metadata:{type:e.type}}})}var x,S,C,w,T=e((()=>{s(),t(),i(),a(),l(),x=500,S=300*1e3,C=new c({max:x,ttl:S}),w=new c({max:x,ttl:S})}));export{v as i,b as n,T as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Doctor-DlE1Mbb9.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gn as n,Gt as r,I as i,P as a,fi as o,mt as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gn as n,Gt as r,I as i,P as a,fi as o,mt as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{BO as d,DO as f,EO as p,JS as m,MO as h,NO as g,XS as _,kO as v,qS as y}from"./loadAgentsDir-DrDu5yYy.js";import{g as b,y as x}from"./settings-DfWP5y6X.js";import{n as S,r as C}from"./analytics-BotDBGh0.js";import{u as w}from"./referral-DrebVwqx.js";import{n as T,t as E}from"./useMainLoopModel-DegH12LZ.js";function D(e){return typeof e==`string`&&e!==`ultracode`&&A.includes(e)}function O(e){if(e!=null&&typeof e!=`number`&&D(e))return e}function ee(e){let t=A.indexOf(e);return t<=0?A[0]:A[t-1]}function te(e){let t=A.indexOf(e);return t===-1||t>=A.length-1?A[A.length-1]:A[t+1]}function k(e){return e===`ultracode`}function ne(e){let t=O(e.envOverride);return t===void 0?e.displayed:t}function re(e,t){if(k(e))return{kind:`ultracode-hint`,message:j};let n=t(e);return{kind:`apply`,message:n.message,effortUpdate:n.effortUpdate}}var A,j,M,ie=e((()=>{A=[`low`,`medium`,`high`,`xhigh`,`max`,`ultracode`],j=`ultracode is not an effort level. Use /ultracode <context> to start a multi-agent workflow.`,M=`Effort unchanged.`}));function ae(e){let[t,n]=s(e?N:null);return[t,e?n:0]}var N,oe=e((()=>{l(),N=60}));function se(e){if(!/^#[0-9a-fA-F]{6}$/.test(e))return{h:0,s:0,l:0};let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(1-Math.abs(2*o-1)),l;return l=i===t?60*((n-r)/s%6):i===n?60*((r-t)/s+2):60*((t-n)/s+4),l<0&&(l+=360),{h:l,s:c,l:o}}function ce(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=r/60,o=i*(1-Math.abs(a%2-1)),s=0,c=0,l=0;a<1?(s=i,c=o):a<2?(s=o,c=i):a<3?(c=i,l=o):a<4?(c=o,l=i):a<5?(s=o,l=i):(s=i,l=o);let u=n-i/2,d=e=>Math.round((e+u)*255).toString(16).padStart(2,`0`);return`#${d(s)}${d(c)}${d(l)}`}function P(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e)||t===0)return e;let{h:n,s:r,l:i}=se(e);return ce(n+t,r,i)}function le(e){return e*I%360}function ue(e,t=0){let n=e<0?0:e>1?1:e,r=Math.min(F.length-1,Math.floor(n*F.length)),i=F[r];return t===0?i:P(i,t)}function de(e){let{y:t,width:n,time:r,sourceX:i,sourceY:a}=e;if(n<=0)return[];let o=le(r),s=Array(n);for(let e=0;e<n;e++){let n=e-i,c=(t-a)*1.5,l=Math.sqrt(n*n+c*c),u=l*.35-r*.004,d=(Math.sin(u)+1)/2*Math.max(0,1-l/90);s[e]={char:R,color:ue(d,o)}}return s}function fe(e,t){let n=e.map(e=>({...e}));for(let e of t){let t=e.x;if(!(t>=n.length))for(let r=0;r<e.text.length;r++){let i=t+r;if(!(i<0)){if(i>=n.length)break;n[i]={char:e.text[r],color:e.color??n[i].color}}}}return n}function pe(e){if(e.length===0)return[];let t=[],n={text:e[0].char,color:e[0].color};for(let r=1;r<e.length;r++){let i=e[r];i.color===n.color?n.text+=i.char:(t.push(n),n={text:i.char,color:i.color})}return t.push(n),t}function me(e,t){if(e===`transparent`)return L;let n=t<0?0:t>1?1:t;if(n<=.01)return L;if(!/^#[0-9a-fA-F]{6}$/.test(e))return e;let r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return`#${Math.round(r*n).toString(16).padStart(2,`0`)}${Math.round(i*n).toString(16).padStart(2,`0`)}${Math.round(a*n).toString(16).padStart(2,`0`)}`}function he(e,t){return e.map(e=>({char:e.char,color:me(e.color,t)}))}var F,I,L,R,ge=e((()=>{F=[`#1a1f3a`,`#1f2543`,`#252c55`,`#2e3870`,`#3a4582`,`#4a5bb0`,`#5769F7`],I=.03,L=`transparent`,R=` `}));function _e(e){let t=e-2;return t<=U*A.length?U:Math.floor(t/A.length)}function ve(e){let t=Math.max(0,Math.floor((e-9)/2));return e*(A.length-1)+t+4}function z(e,t,n){return n*e+Math.max(0,Math.floor((n-t)/2))}function ye({appStateEffort:e,onDone:t}){let n=_(),o=T(),{columns:s}=c(),l=V.useMemo(()=>_e(s),[s]),u=l*A.length,d=V.useMemo(()=>ve(l),[l]),m=f(),h=ne({envOverride:m,appStateEffort:e,displayed:p(o,e)}),[g,v]=V.useState(h),[y,b]=V.useState(!1),x=g===`ultracode`,[S,C]=V.useState(0),w=x||S>.001,[E,D]=ae(w);V.useEffect(()=>{if(!w)return;let e=+!!x;C(t=>{if(t===e)return t;let n=e>t?t+J:t-J;return e>t?Math.min(e,n):Math.max(e,n)})},[D,x,w]),r({"effortPanel:decrease":()=>v(e=>ee(e)),"effortPanel:increase":()=>v(e=>te(e)),"effortPanel:home":()=>v(`low`),"effortPanel:end":()=>v(`ultracode`),"effortPanel:confirm":V.useCallback(()=>{if(y)return;b(!0);let e=re(g,Z);e.kind===`apply`&&e.effortUpdate&&n(t=>({...t,effortValue:e.effortUpdate.value})),t(e.message)},[g,y,t,n]),"effortPanel:cancel":V.useCallback(()=>{y||(b(!0),t(M))},[y,t])},{context:`EffortPanel`});let O=m!=null,k=process.env.CLAUDE_CODE_EFFORT_LEVEL,j=V.useCallback((e,t)=>pe(he(fe(de({y:e+Y,width:u,time:D,sourceX:d,sourceY:Y}),t),S)),[D,S,u,d]);return(0,H.jsxs)(i,{ref:E,flexDirection:`column`,paddingX:1,width:u+2,children:[(0,H.jsx)(a,{bold:!0,color:`suggestion`,children:`Effort`}),O&&(0,H.jsx)(a,{color:`warning`,children:`⚠ CLAUDE_CODE_EFFORT_LEVEL=${k} overrides this session`}),w?(0,H.jsx)(xe,{renderRow:j,cursor:g,fade:S,segment:l,panelWidth:u,time:D}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(be,{cursor:g,segment:l,panelWidth:u}),(0,H.jsx)(i,{marginTop:1,children:(0,H.jsx)(a,{color:`subtle`,children:`←/→ adjust · Enter confirm · Esc cancel`})})]})]})}function be({cursor:e,segment:t,panelWidth:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(i,{marginTop:1,flexDirection:`row`,justifyContent:`space-between`,children:[(0,H.jsx)(a,{color:`suggestion`,children:`Faster`}),(0,H.jsx)(a,{color:`suggestion`,children:`Smarter`})]}),(0,H.jsx)(a,{color:`subtle`,children:`─`.repeat(n)}),(0,H.jsx)(i,{flexDirection:`row`,children:A.map(n=>(0,H.jsx)(i,{width:t,justifyContent:`center`,children:(0,H.jsx)(a,{bold:!0,color:e===n?`suggestion`:`subtle`,children:e===n?`▲`:` `})},`cursor-${n}`))}),(0,H.jsx)(i,{flexDirection:`row`,children:A.map(n=>(0,H.jsx)(i,{width:t,justifyContent:`center`,children:(0,H.jsx)(a,{bold:e===n,color:e===n?`suggestion`:`subtle`,children:n})},`label-${n}`))}),(0,H.jsxs)(i,{flexDirection:`row`,children:[(0,H.jsx)(i,{width:t*(A.length-1)}),(0,H.jsx)(i,{width:t,justifyContent:`center`,children:(0,H.jsx)(a,{color:`subtle`,children:W})})]})]})}function xe({renderRow:e,cursor:t,segment:n,panelWidth:r,time:i}){let o=A.indexOf(t),s=A.length-1,c=le(i),l=P(q,c),u=P(G,c),d=P(K,c),f={text:`Faster`,x:0,color:l},p={text:`Smarter`,x:r-7,color:l},m={text:`─`.repeat(r),x:0,color:d},h={text:`▲`,x:z(o,1,n),color:l},g=A.map((e,r)=>({text:e,x:z(r,e.length,n),color:e===t?u:d})),_={text:W,x:z(s,17,n),color:d};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(B,{segments:e(-4,[])}),(0,H.jsx)(B,{segments:e(-3,[f,p])}),(0,H.jsx)(B,{segments:e(-2,[m])}),(0,H.jsx)(B,{segments:e(-1,[h])}),(0,H.jsx)(B,{segments:e(0,g)}),(0,H.jsx)(B,{segments:e(1,[_])}),(0,H.jsx)(B,{segments:e(2,[])}),(0,H.jsx)(a,{color:K,children:`←/→ adjust · Enter confirm · Esc cancel`})]})}function B({segments:e}){let t=[];for(let n of e){let e=``,r=null,i=()=>{e===``||r===null||(t.push({text:e,kind:r?`space`:`text`,color:n.color}),e=``,r=null)};for(let t of n.text){let n=t===` `;r===null?(e=t,r=n):n===r?e+=t:(i(),e=t,r=n)}i()}return(0,H.jsx)(i,{flexDirection:`row`,children:t.map((e,t)=>e.kind===`space`?e.color===`transparent`?(0,H.jsx)(n,{children:e.text},t):(0,H.jsx)(n,{backgroundColor:e.color,children:e.text},t):(0,H.jsx)(a,{color:e.color,bold:!0,children:e.text},t))})}var V,H,U,W,G,K,q,J,Y,Se=e((()=>{V=t(o(),1),l(),w(),h(),ie(),$(),E(),y(),oe(),ge(),H=u(),U=12,W=`xhigh + workflows`,G=`#5769F7`,K=`#7a8eff`,q=`#5769F7`,J=.2,Y=0}));function Ce(e){let t=d(e);if(t!==void 0){let e=x(`userSettings`,{effortLevel:t});if(e.error)return{message:`Failed to set effort level: ${e.error.message}`}}C(`tengu_effort_command`,{effort:e});let n=f();if(n!==void 0&&n!==e){let n=process.env.CLAUDE_CODE_EFFORT_LEVEL;return t===void 0?{message:`Not applied: CLAUDE_CODE_EFFORT_LEVEL=${n} overrides effort this session, and ${e} is session-only (nothing saved)`,effortUpdate:{value:e}}:{message:`CLAUDE_CODE_EFFORT_LEVEL=${n} overrides this session — clear it and ${e} takes over`,effortUpdate:{value:e}}}let r=v(e);return{message:`Set effort level to ${e}${t===void 0?` (this session only)`:``}: ${r}`,effortUpdate:{value:e}}}function X(e,t){let n=f(),r=n===null?void 0:n??e;return r===void 0?{message:`Effort level: auto (currently ${p(t,e)})`}:{message:`Current effort level: ${r} (${v(r)})`}}function we(){let e=x(`userSettings`,{effortLevel:void 0});return e.error?{message:`Failed to set effort level: ${e.error.message}`}:(C(`tengu_effort_command`,{effort:`auto`}),f()==null?{message:`Effort level set to auto`,effortUpdate:{value:void 0}}:{message:`Cleared effort from settings, but CLAUDE_CODE_EFFORT_LEVEL=${process.env.CLAUDE_CODE_EFFORT_LEVEL} still controls this session`,effortUpdate:{value:void 0}})}function Z(e){let t=e.toLowerCase();return t===`auto`||t===`unset`?we():g(t)?Ce(t):{message:`Invalid argument: ${e}. Valid options are: low, medium, high, max, auto`}}function Te({onDone:e}){let{message:t}=X(m(e=>e.effortValue),T());return e(t),null}function Ee({result:e,onDone:t}){let n=_(),{effortUpdate:r,message:i}=e;return ke.useEffect(()=>{r&&n(e=>({...e,effortValue:r.value})),t(i)},[n,r,i,t]),null}async function De(e,t,n){if(n=n?.trim()||``,Ae.includes(n)){e(`Usage: /effort [low|medium|high|xhigh|max|auto]
|
|
2
2
|
|
|
3
3
|
Effort levels:
|
|
4
4
|
- low: Quick, straightforward implementation
|
|
@@ -6,4 +6,4 @@ Effort levels:
|
|
|
6
6
|
- high: Comprehensive implementation with extensive testing
|
|
7
7
|
- xhigh: Extended reasoning beyond high, short of max; including ChatGPT Codex models
|
|
8
8
|
- max: Maximum capability with deepest reasoning; maps to xhigh for ChatGPT Codex models
|
|
9
|
-
- auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?n===`current`||n===`status`?(0,Q.jsx)(Te,{onDone:e}):(0,Q.jsx)(Oe,{onDone:e}):(0,Q.jsx)(Ee,{result:Z(n),onDone:e})}function Oe({onDone:e}){return(0,Q.jsx)(ye,{appStateEffort:
|
|
9
|
+
- auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?n===`current`||n===`status`?(0,Q.jsx)(Te,{onDone:e}):(0,Q.jsx)(Oe,{onDone:e}):(0,Q.jsx)(Ee,{result:Z(n),onDone:e})}function Oe({onDone:e}){return(0,Q.jsx)(ye,{appStateEffort:m(e=>e.effortValue),onDone:e})}var ke,Q,Ae,$=e((()=>{ke=t(o(),1),Se(),E(),S(),y(),h(),b(),Q=u(),Ae=[`help`,`-h`,`--help`]}));$();export{De as call,Z as executeEffort,X as showCurrentEffort};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{A as n,E as r,I as i,M as a,N as o,P as s,S as c,T as l,b as u,d,g as f,h as p,r as m}from"./lazySchema-DcIJE_0i.js";import{Or as h,Zn as g,_t as _,en as v,kr as y,nt as b,vr as x}from"./state-ix0xIunV.js";import{G as ee,Gy as S,Ky as te,Md as ne,Qi as re,W as ie,Xu as ae,Yu as oe,_f as se,cw as ce,gr as C,i as le,jd as ue,jr as de,lw as fe,o as pe,qi as me,va as he,vf as ge,ya as _e}from"./loadAgentsDir-DrDu5yYy.js";import{f as ve,g as ye}from"./settings-DfWP5y6X.js";import{g as be,r as xe}from"./config-DiT2Z8dY.js";import{l as w,p as T,r as Se}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{_ as Ce,u as we}from"./model-fi472PRc.js";import{Tn as Te,wn as Ee}from"./prompt-C0nU0VK3.js";import{o as De,t as Oe}from"./fileStateCache-DDW5toIs.js";import{t as ke}from"./QueryEngine-BnaHDZVZ.js";import{dirname as Ae}from"node:path";import{randomUUID as E}from"node:crypto";import{Readable as je,Writable as Me}from"node:stream";import{unlink as Ne}from"node:fs/promises";import*as D from"node:path/posix";import{isAbsolute as Pe,resolve as Fe}from"node:path/posix";m();var O={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},k={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},Ie=r({_meta:n(a(),s()).nullish(),terminal:f().optional().default(!1)}),Le=r({_meta:n(a(),s()).nullish(),label:a().nullish(),name:a(),optional:f().optional().default(!1),secret:f().optional().default(!0)}),Re=r({_meta:n(a(),s()).nullish(),description:a().nullish(),id:a(),name:a()}),ze=r({_meta:n(a(),s()).nullish(),description:a().nullish(),id:a(),link:a().nullish(),name:a(),vars:p(Le)}),Be=r({_meta:n(a(),s()).nullish(),args:p(a()).optional(),description:a().nullish(),env:n(a(),a()).optional(),id:a(),name:a()}),Ve=o([ze.and(r({type:c(`env_var`)})),Be.and(r({type:c(`terminal`)})),Re]),He=r({_meta:n(a(),s()).nullish(),methodId:a()}),Ue=r({_meta:n(a(),s()).nullish()}),We=r({_meta:n(a(),s()).nullish(),blob:a(),mimeType:a().nullish(),uri:a()}),Ge=r({default:f().nullish(),description:a().nullish(),title:a().nullish()}),Ke=r({_meta:n(a(),s()).nullish()}),qe=r({_meta:n(a(),s()).nullish()}),Je=r({amount:l(),currency:a()}),Ye=r({_meta:n(a(),s()).nullish(),terminalId:a()}),Xe=r({_meta:n(a(),s()).nullish(),newText:a(),oldText:a().nullish(),path:a()}),Ze=o([a(),l(),l(),f(),p(a())]),Qe=u(o([r({content:n(a(),Ze).nullish()}).and(r({action:c(`accept`)})),r({action:c(`decline`)}),r({action:c(`cancel`)})]),r({_meta:n(a(),s()).nullish()})),$e=r({_meta:n(a(),s()).nullish()}),et=a(),tt=r({_meta:n(a(),s()).nullish(),elicitationId:et}),nt=c(`object`),rt=c(`string`),it=r({_meta:n(a(),s()).nullish()}),at=r({_meta:n(a(),s()).nullish(),form:$e.nullish(),url:it.nullish()}),ot=r({const:a(),title:a()}),st=r({_meta:n(a(),s()).nullish(),name:a(),value:a()}),ct=r({code:o([c(-32700),c(-32600),c(-32601),c(-32602),c(-32603),c(-32800),c(-32e3),c(-32002),c(-32042),l().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:s().optional(),message:a()}),lt=s(),ut=s(),dt=s(),ft=r({_meta:n(a(),s()).nullish(),readTextFile:f().optional().default(!1),writeTextFile:f().optional().default(!1)}),pt=r({_meta:n(a(),s()).nullish(),name:a(),value:a()}),mt=r({_meta:n(a(),s()).nullish(),name:a(),title:a().nullish(),version:a()}),ht=r({default:l().nullish(),description:a().nullish(),maximum:l().nullish(),minimum:l().nullish(),title:a().nullish()}),gt=r({_meta:n(a(),s()).nullish()}),_t=r({_meta:n(a(),s()).nullish(),additionalDirectories:p(a()).optional(),cursor:a().nullish(),cwd:a().nullish()}),vt=r({_meta:n(a(),s()).nullish()}),yt=r({_meta:n(a(),s()).nullish(),logout:vt.nullish()}),bt=r({_meta:n(a(),s()).nullish()}),xt=r({_meta:n(a(),s()).nullish()}),St=r({_meta:n(a(),s()).nullish(),http:f().optional().default(!1),sse:f().optional().default(!1)}),Ct=r({_meta:n(a(),s()).nullish(),headers:p(pt),name:a(),url:a()}),wt=r({_meta:n(a(),s()).nullish(),headers:p(pt),name:a(),url:a()}),Tt=r({_meta:n(a(),s()).nullish(),args:p(a()),command:a(),env:p(st),name:a()}),A=o([Ct.and(r({type:c(`http`)})),wt.and(r({type:c(`sse`)})),Tt]),j=a(),Et=r({_meta:n(a(),s()).nullish(),description:a().nullish(),modelId:j,name:a()}),Dt=o([c(`error`),c(`warning`),c(`information`),c(`hint`)]),Ot=r({_meta:n(a(),s()).nullish()}),kt=r({_meta:n(a(),s()).nullish()}),At=r({_meta:n(a(),s()).nullish()}),jt=r({_meta:n(a(),s()).nullish()}),Mt=r({_meta:n(a(),s()).nullish()}),Nt=r({_meta:n(a(),s()).nullish(),maxCount:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Pt=r({diff:a(),uri:a()}),Ft=r({endLine:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:a()}),It=r({_meta:n(a(),s()).nullish()}),Lt=r({_meta:n(a(),s()).nullish()}),Rt=r({languageId:a(),text:a(),uri:a()}),zt=r({_meta:n(a(),s()).nullish(),maxCount:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=o([c(`rejected`),c(`ignored`),c(`replaced`),c(`cancelled`)]),Vt=r({excerpts:p(Ft),uri:a()}),Ht=r({_meta:n(a(),s()).nullish()}),Ut=r({_meta:n(a(),s()).nullish()}),Wt=r({name:a(),owner:a(),remoteUrl:a()}),Gt=r({_meta:n(a(),s()).nullish()}),Kt=r({_meta:n(a(),s()).nullish(),jump:It.nullish(),rename:Ut.nullish(),searchAndReplace:Gt.nullish()}),qt=r({id:a(),isRegex:f().nullish(),replace:a(),search:a(),uri:a()}),Jt=o([c(`automatic`),c(`diagnostic`),c(`manual`)]),Yt=r({_meta:n(a(),s()).nullish(),maxCount:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Xt=r({_meta:n(a(),s()).nullish(),diagnostics:Ot.nullish(),editHistory:Nt.nullish(),openFiles:Lt.nullish(),recentFiles:zt.nullish(),relatedSnippets:Ht.nullish(),userActions:Yt.nullish()}),Zt=r({_meta:n(a(),s()).nullish(),additionalDirectories:p(a()).optional(),cwd:a(),mcpServers:p(A)}),Qt=r({default:l().nullish(),description:a().nullish(),maximum:l().nullish(),minimum:l().nullish(),title:a().nullish()}),$t=a(),en=o([c(`allow_once`),c(`allow_always`),c(`reject_once`),c(`reject_always`)]),tn=r({_meta:n(a(),s()).nullish(),kind:en,name:a(),optionId:$t}),nn=o([c(`high`),c(`medium`),c(`low`)]),rn=o([c(`pending`),c(`in_progress`),c(`completed`)]),an=r({_meta:n(a(),s()).nullish(),content:a(),priority:nn,status:rn}),on=r({_meta:n(a(),s()).nullish(),entries:p(an)}),M=r({character:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),sn=r({id:a(),position:M,uri:a()}),cn=r({id:a(),newName:a(),position:M,uri:a()}),ln=r({action:a(),position:M,timestampMs:l(),uri:a()}),un=o([c(`utf-16`),c(`utf-32`),c(`utf-8`)]),dn=r({_meta:n(a(),s()).nullish(),auth:Ie.optional().default({terminal:!1}),elicitation:at.nullish(),fs:ft.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Kt.nullish(),positionEncodings:p(un).optional(),terminal:f().optional().default(!1)}),fn=r({_meta:n(a(),s()).nullish(),audio:f().optional().default(!1),embeddedContext:f().optional().default(!1),image:f().optional().default(!1)}),pn=l().int().gte(0).lte(65535),mn=r({_meta:n(a(),s()).nullish(),clientCapabilities:dn.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:mt.nullish(),protocolVersion:pn}),N=r({end:M,start:M}),hn=r({message:a(),range:N,severity:Dt,uri:a()}),gn=r({languageId:a(),lastFocusedMs:l().nullish(),uri:a(),visibleRange:N.nullish()}),_n=r({_meta:n(a(),s()).nullish(),diagnostics:p(hn).nullish(),editHistory:p(Pt).nullish(),openFiles:p(gn).nullish(),recentFiles:p(Rt).nullish(),relatedSnippets:p(Vt).nullish(),userActions:p(ln).nullish()}),vn=r({newText:a(),range:N}),yn=o([r({cursorPosition:M.nullish(),edits:p(vn),id:a(),uri:a()}).and(r({kind:c(`edit`)})),sn.and(r({kind:c(`jump`)})),cn.and(r({kind:c(`rename`)})),qt.and(r({kind:c(`searchAndReplace`)}))]),bn=r({_meta:n(a(),s()).nullish(),content:a()}),xn=r({_meta:n(a(),s()).nullish()}),P=o([l(),a()]).nullable();r({_meta:n(a(),s()).nullish(),requestId:P});var Sn=r({requestId:P}),Cn=d([`assistant`,`user`]),F=r({_meta:n(a(),s()).nullish(),audience:p(Cn).nullish(),lastModified:a().nullish(),priority:l().nullish()}),wn=r({_meta:n(a(),s()).nullish(),annotations:F.nullish(),data:a(),mimeType:a()}),Tn=r({_meta:n(a(),s()).nullish(),annotations:F.nullish(),data:a(),mimeType:a(),uri:a().nullish()}),En=r({_meta:n(a(),s()).nullish(),annotations:F.nullish(),description:a().nullish(),mimeType:a().nullish(),name:a(),size:l().nullish(),title:a().nullish(),uri:a()}),Dn=r({_meta:n(a(),s()).nullish(),optionId:$t}),On=o([r({outcome:c(`cancelled`)}),Dn.and(r({outcome:c(`selected`)}))]),kn=r({_meta:n(a(),s()).nullish(),outcome:On}),An=r({_meta:n(a(),s()).nullish()}),jn=r({_meta:n(a(),s()).nullish()}),Mn=r({currentValue:f()}),Nn=a(),Pn=a(),Fn=o([c(`mode`),c(`model`),c(`thought_level`),a()]),I=a(),In=r({_meta:n(a(),s()).nullish(),description:a().nullish(),name:a(),value:I}),Ln=r({_meta:n(a(),s()).nullish(),group:Nn,name:a(),options:p(In)}),L=u(o([r({currentValue:I,options:o([p(In),p(Ln)])}).and(r({type:c(`select`)})),Mn.and(r({type:c(`boolean`)}))]),r({_meta:n(a(),s()).nullish(),category:Fn.nullish(),description:a().nullish(),id:Pn,name:a()})),Rn=r({_meta:n(a(),s()).nullish(),configOptions:p(L)}),zn=r({_meta:n(a(),s()).nullish()}),R=a(),Bn=r({_meta:n(a(),s()).nullish(),id:a(),sessionId:R}),Vn=r({_meta:n(a(),s()).nullish(),sessionId:R}),Hn=r({_meta:n(a(),s()).nullish(),sessionId:R}),Un=r({_meta:n(a(),s()).nullish(),sessionId:R}),Wn=r({_meta:n(a(),s()).nullish(),args:p(a()).optional(),command:a(),cwd:a().nullish(),env:p(st).optional(),outputByteLimit:l().nullish(),sessionId:R}),Gn=r({_meta:n(a(),s()).nullish(),sessionId:R,uri:a()}),Kn=r({_meta:n(a(),s()).nullish(),position:M,sessionId:R,uri:a(),version:l(),visibleRange:N}),qn=r({_meta:n(a(),s()).nullish(),languageId:a(),sessionId:R,text:a(),uri:a(),version:l()}),Jn=r({_meta:n(a(),s()).nullish(),sessionId:R,uri:a()}),Yn=r({_meta:n(a(),s()).nullish(),additionalDirectories:p(a()).optional(),cwd:a(),mcpServers:p(A).optional(),sessionId:R}),Xn=r({_meta:n(a(),s()).nullish(),sessionId:R,terminalId:a()}),Zn=r({_meta:n(a(),s()).nullish(),additionalDirectories:p(a()).optional(),cwd:a(),mcpServers:p(A),sessionId:R}),Qn=r({_meta:n(a(),s()).nullish(),limit:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:a(),sessionId:R}),$n=r({_meta:n(a(),s()).nullish(),id:a(),reason:Bt.nullish(),sessionId:R}),er=r({_meta:n(a(),s()).nullish(),sessionId:R,terminalId:a()}),tr=r({_meta:n(a(),s()).nullish(),additionalDirectories:p(a()).optional(),cwd:a(),mcpServers:p(A).optional(),sessionId:R}),nr=r({_meta:n(a(),s()).nullish(),additionalDirectories:p(a()).optional(),cwd:a(),sessionId:R,title:a().nullish(),updatedAt:a().nullish()}),rr=r({_meta:n(a(),s()).nullish(),nextCursor:a().nullish(),sessions:p(nr)}),ir=r({_meta:n(a(),s()).nullish(),title:a().nullish(),updatedAt:a().nullish()}),ar=r({_meta:n(a(),s()).nullish()}),z=a(),or=r({_meta:n(a(),s()).nullish(),currentModeId:z}),sr=r({_meta:n(a(),s()).nullish(),description:a().nullish(),id:z,name:a()}),B=r({_meta:n(a(),s()).nullish(),availableModes:p(sr),currentModeId:z}),V=r({_meta:n(a(),s()).nullish(),availableModels:p(Et),currentModelId:j}),cr=r({_meta:n(a(),s()).nullish(),configOptions:p(L).nullish(),models:V.nullish(),modes:B.nullish(),sessionId:R}),lr=r({_meta:n(a(),s()).nullish(),configOptions:p(L).nullish(),models:V.nullish(),modes:B.nullish()}),ur=r({_meta:n(a(),s()).nullish(),configOptions:p(L).nullish(),models:V.nullish(),modes:B.nullish(),sessionId:R}),dr=r({_meta:n(a(),s()).nullish(),configOptions:p(L).nullish(),models:V.nullish(),modes:B.nullish()}),fr=r({_meta:n(a(),s()).nullish()}),pr=r({_meta:n(a(),s()).nullish(),additionalDirectories:An.nullish(),close:jn.nullish(),fork:zn.nullish(),list:ar.nullish(),resume:fr.nullish()}),mr=u(o([r({type:c(`boolean`),value:f()}),r({value:I})]),r({_meta:n(a(),s()).nullish(),configId:Pn,sessionId:R})),hr=r({_meta:n(a(),s()).nullish(),configOptions:p(L)}),gr=r({_meta:n(a(),s()).nullish(),modeId:z,sessionId:R}),_r=r({_meta:n(a(),s()).nullish()}),vr=r({_meta:n(a(),s()).nullish(),modelId:j,sessionId:R}),yr=r({_meta:n(a(),s()).nullish()}),br=r({_meta:n(a(),s()).nullish(),sessionId:R}),xr=o([c(`end_turn`),c(`max_tokens`),c(`max_turn_requests`),c(`refusal`),c(`cancelled`)]),Sr=o([c(`email`),c(`uri`),c(`date`),c(`date-time`)]),Cr=r({default:a().nullish(),description:a().nullish(),enum:p(a()).nullish(),format:Sr.nullish(),maxLength:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:p(ot).nullish(),pattern:a().nullish(),title:a().nullish()}),wr=r({_meta:n(a(),s()).nullish(),context:_n.nullish(),position:M,selection:N.nullish(),sessionId:R,triggerKind:Jt,uri:a(),version:l()}),Tr=r({_meta:n(a(),s()).nullish(),suggestions:p(yn)}),Er=r({_meta:n(a(),s()).nullish(),terminalId:a()}),Dr=r({_meta:n(a(),s()).nullish(),exitCode:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:a().nullish()}),Or=r({_meta:n(a(),s()).nullish(),sessionId:R,terminalId:a()}),kr=r({_meta:n(a(),s()).nullish(),exitStatus:Dr.nullish(),output:a(),truncated:f()}),Ar=r({_meta:n(a(),s()).nullish(),annotations:F.nullish(),text:a()}),jr=r({range:N.nullish(),text:a()}),Mr=r({_meta:n(a(),s()).nullish(),contentChanges:p(jr),sessionId:R,uri:a(),version:l()});r({method:a(),params:o([Vn,qn,Mr,Gn,Jn,Kn,Bn,$n,lt]).nullish()});var Nr=o([c(`full`),c(`incremental`)]),Pr=r({_meta:n(a(),s()).nullish(),syncKind:Nr}),Fr=r({_meta:n(a(),s()).nullish(),didChange:Pr.nullish(),didClose:kt.nullish(),didFocus:At.nullish(),didOpen:jt.nullish(),didSave:Mt.nullish()}),Ir=r({_meta:n(a(),s()).nullish(),document:Fr.nullish()}),Lr=r({_meta:n(a(),s()).nullish(),context:Xt.nullish(),events:Ir.nullish()}),Rr=r({_meta:n(a(),s()).nullish(),auth:yt.optional().default({}),loadSession:f().optional().default(!1),mcpCapabilities:St.optional().default({http:!1,sse:!1}),nes:Lr.nullish(),positionEncoding:un.nullish(),promptCapabilities:fn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:pr.optional().default({})}),zr=r({_meta:n(a(),s()).nullish(),agentCapabilities:Rr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:mt.nullish(),authMethods:p(Ve).optional().default([]),protocolVersion:pn}),Br=o([r({_meta:n(a(),s()).nullish(),mimeType:a().nullish(),text:a(),uri:a()}),We]),Vr=r({_meta:n(a(),s()).nullish(),annotations:F.nullish(),resource:Br}),H=o([Ar.and(r({type:c(`text`)})),Tn.and(r({type:c(`image`)})),wn.and(r({type:c(`audio`)})),En.and(r({type:c(`resource_link`)})),Vr.and(r({type:c(`resource`)}))]),Hr=r({_meta:n(a(),s()).nullish(),content:H}),U=r({_meta:n(a(),s()).nullish(),content:H,messageId:a().nullish()}),Ur=r({_meta:n(a(),s()).nullish(),messageId:a().nullish(),prompt:p(H),sessionId:R}),Wr=r({anyOf:p(ot)}),Gr=o([Hr.and(r({type:c(`content`)})),Xe.and(r({type:c(`diff`)})),Er.and(r({type:c(`terminal`)}))]),W=a(),Kr=r({sessionId:R,toolCallId:W.nullish()}),qr=u(o([Kr,Sn]),r({elicitationId:et,url:a().url()})),Jr=r({_meta:n(a(),s()).nullish(),line:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:a()}),Yr=o([c(`pending`),c(`in_progress`),c(`completed`),c(`failed`)]),Xr=o([c(`read`),c(`edit`),c(`delete`),c(`move`),c(`search`),c(`execute`),c(`think`),c(`fetch`),c(`switch_mode`),c(`other`)]),Zr=r({_meta:n(a(),s()).nullish(),content:p(Gr).optional(),kind:Xr.optional(),locations:p(Jr).optional(),rawInput:s().optional(),rawOutput:s().optional(),status:Yr.optional(),title:a(),toolCallId:W}),Qr=r({_meta:n(a(),s()).nullish(),content:p(Gr).nullish(),kind:Xr.nullish(),locations:p(Jr).nullish(),rawInput:s().optional(),rawOutput:s().optional(),status:Yr.nullish(),title:a().nullish(),toolCallId:W}),$r=r({_meta:n(a(),s()).nullish(),options:p(tn),sessionId:R,toolCall:Qr}),ei=r({_meta:n(a(),s()).nullish(),hint:a()}),ti=r({_meta:n(a(),s()).nullish(),description:a(),input:ei.nullish(),name:a()}),ni=r({_meta:n(a(),s()).nullish(),availableCommands:p(ti)}),ri=o([r({enum:p(a()),type:rt}),Wr]),ii=r({default:p(a()).nullish(),description:a().nullish(),items:ri,maxItems:l().nullish(),minItems:l().nullish(),title:a().nullish()}),ai=o([Cr.and(r({type:c(`string`)})),Qt.and(r({type:c(`number`)})),ht.and(r({type:c(`integer`)})),Ge.and(r({type:c(`boolean`)})),ii.and(r({type:c(`array`)}))]),oi=r({description:a().nullish(),properties:n(a(),ai).optional().default({}),required:p(a()).nullish(),title:a().nullish(),type:nt.optional().default(`object`)}),si=u(o([u(o([Kr,Sn]),r({requestedSchema:oi})).and(r({mode:c(`form`)})),qr.and(r({mode:c(`url`)}))]),r({_meta:n(a(),s()).nullish(),message:a()})),ci=r({cachedReadTokens:l().nullish(),cachedWriteTokens:l().nullish(),inputTokens:l(),outputTokens:l(),thoughtTokens:l().nullish(),totalTokens:l()});o([r({id:P,result:o([zr,Ue,xt,ur,lr,rr,cr,dr,qe,_r,hr,r({_meta:n(a(),s()).nullish(),stopReason:xr,usage:ci.nullish(),userMessageId:a().nullish()}),yr,br,Tr,Ke,dt])}),r({error:ct,id:P})]);var li=r({_meta:n(a(),s()).nullish(),cost:Je.nullish(),size:l(),used:l()}),ui=o([U.and(r({sessionUpdate:c(`user_message_chunk`)})),U.and(r({sessionUpdate:c(`agent_message_chunk`)})),U.and(r({sessionUpdate:c(`agent_thought_chunk`)})),Zr.and(r({sessionUpdate:c(`tool_call`)})),Qr.and(r({sessionUpdate:c(`tool_call_update`)})),on.and(r({sessionUpdate:c(`plan`)})),ni.and(r({sessionUpdate:c(`available_commands_update`)})),or.and(r({sessionUpdate:c(`current_mode_update`)})),Rn.and(r({sessionUpdate:c(`config_option_update`)})),ir.and(r({sessionUpdate:c(`session_info_update`)})),li.and(r({sessionUpdate:c(`usage_update`)}))]),di=r({_meta:n(a(),s()).nullish(),sessionId:R,update:ui});r({method:a(),params:o([di,tt,lt]).nullish()});var fi=r({_meta:n(a(),s()).nullish(),sessionId:R,terminalId:a()}),pi=r({_meta:n(a(),s()).nullish(),exitCode:l().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:a().nullish()}),mi=r({name:a(),uri:a()}),hi=r({_meta:n(a(),s()).nullish(),repository:Wt.nullish(),workspaceFolders:p(mi).nullish(),workspaceUri:a().nullish()});r({id:P,method:a(),params:o([mn,He,bt,Zt,Zn,_t,Yn,tr,Un,gr,mr,Ur,vr,hi,wr,Hn,ut]).nullish()});var gi=r({_meta:n(a(),s()).nullish(),content:a(),path:a(),sessionId:R});r({id:P,method:a(),params:o([gi,Qn,$r,Wn,Or,er,fi,Xn,si,ut]).nullish()}),o([r({id:P,result:o([r({_meta:n(a(),s()).nullish()}),bn,kn,Ye,kr,xn,pi,gt,Qe,dt])}),r({error:ct,id:P})]),e();function _i(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a){n+=r.decode();break}if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
2
|
+
`);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}let t=n.trim();if(t)try{let n=JSON.parse(t);e.enqueue(n)}catch(e){console.error(`Failed to parse JSON message:`,t,e)}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
|
|
3
|
+
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}m();var vi,yi=class{constructor(e,n){t(this,`connection`,void 0);let r=e(this),i=async(e,t)=>{switch(e){case O.initialize:{let e=mn.parse(t);return r.initialize(e)}case O.session_new:{let e=Zt.parse(t);return r.newSession(e)}case O.session_load:{if(!r.loadSession)throw G.methodNotFound(e);let n=Zn.parse(t);return r.loadSession(n)}case O.session_list:{if(!r.listSessions)throw G.methodNotFound(e);let n=_t.parse(t);return r.listSessions(n)}case O.session_fork:{if(!r.unstable_forkSession)throw G.methodNotFound(e);let n=Yn.parse(t);return r.unstable_forkSession(n)}case O.session_resume:{if(!r.unstable_resumeSession)throw G.methodNotFound(e);let n=tr.parse(t);return r.unstable_resumeSession(n)}case O.session_close:{if(!r.unstable_closeSession)throw G.methodNotFound(e);let n=Un.parse(t);return r.unstable_closeSession(n)}case O.session_set_mode:{if(!r.setSessionMode)throw G.methodNotFound(e);let n=gr.parse(t);return await r.setSessionMode(n)??{}}case O.authenticate:{let e=He.parse(t);return await r.authenticate(e)??{}}case O.logout:{if(!r.unstable_logout)throw G.methodNotFound(e);let n=bt.parse(t);return await r.unstable_logout(n)??{}}case O.session_prompt:{let e=Ur.parse(t);return r.prompt(e)}case O.session_set_model:{if(!r.unstable_setSessionModel)throw G.methodNotFound(e);let n=vr.parse(t);return await r.unstable_setSessionModel(n)??{}}case O.session_set_config_option:{if(!r.setSessionConfigOption)throw G.methodNotFound(e);let n=mr.parse(t);return r.setSessionConfigOption(n)}case O.nes_start:{if(!r.unstable_startNes)throw G.methodNotFound(e);let n=hi.parse(t);return r.unstable_startNes(n)}case O.nes_suggest:{if(!r.unstable_suggestNes)throw G.methodNotFound(e);let n=wr.parse(t);return r.unstable_suggestNes(n)}case O.nes_close:{if(!r.unstable_closeNes)throw G.methodNotFound(e);let n=Hn.parse(t);return await r.unstable_closeNes(n)??{}}default:if(r.extMethod)return r.extMethod(e,t);throw G.methodNotFound(e)}},a=async(e,t)=>{switch(e){case O.session_cancel:{let e=Vn.parse(t);return r.cancel(e)}case O.document_did_open:{if(!r.unstable_didOpenDocument)return;let e=qn.parse(t);return r.unstable_didOpenDocument(e)}case O.document_did_change:{if(!r.unstable_didChangeDocument)return;let e=Mr.parse(t);return r.unstable_didChangeDocument(e)}case O.document_did_close:{if(!r.unstable_didCloseDocument)return;let e=Gn.parse(t);return r.unstable_didCloseDocument(e)}case O.document_did_save:{if(!r.unstable_didSaveDocument)return;let e=Jn.parse(t);return r.unstable_didSaveDocument(e)}case O.document_did_focus:{if(!r.unstable_didFocusDocument)return;let e=Kn.parse(t);return r.unstable_didFocusDocument(e)}case O.nes_accept:{if(!r.unstable_acceptNes)return;let e=Bn.parse(t);return r.unstable_acceptNes(e)}case O.nes_reject:{if(!r.unstable_rejectNes)return;let e=$n.parse(t);return r.unstable_rejectNes(e)}default:if(r.extNotification)return r.extNotification(e,t);throw G.methodNotFound(e)}};this.connection=new xi(i,a,n)}async sessionUpdate(e){return await this.connection.sendNotification(k.session_update,e)}async requestPermission(e){return await this.connection.sendRequest(k.session_request_permission,e)}async readTextFile(e){return await this.connection.sendRequest(k.fs_read_text_file,e)}async writeTextFile(e){return await this.connection.sendRequest(k.fs_write_text_file,e)??{}}async createTerminal(e){return new bi((await this.connection.sendRequest(k.terminal_create,e)).terminalId,e.sessionId,this.connection)}async unstable_createElicitation(e){return await this.connection.sendRequest(k.elicitation_create,e)}async unstable_completeElicitation(e){return await this.connection.sendNotification(k.elicitation_complete,e)}async extMethod(e,t){return await this.connection.sendRequest(e,t)}async extNotification(e,t){return await this.connection.sendNotification(e,t)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}};vi=Symbol.asyncDispose;var bi=class{constructor(e,n,r){t(this,`id`,void 0),t(this,`sessionId`,void 0),t(this,`connection`,void 0),this.id=e,this.sessionId=n,this.connection=r}async currentOutput(){return await this.connection.sendRequest(k.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}async waitForExit(){return await this.connection.sendRequest(k.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}async kill(){return await this.connection.sendRequest(k.terminal_kill,{sessionId:this.sessionId,terminalId:this.id})??{}}async release(){return await this.connection.sendRequest(k.terminal_release,{sessionId:this.sessionId,terminalId:this.id})??{}}async[vi](){await this.release()}},xi=class{constructor(e,n,r){t(this,`pendingResponses`,new Map),t(this,`nextRequestId`,0),t(this,`requestHandler`,void 0),t(this,`notificationHandler`,void 0),t(this,`stream`,void 0),t(this,`writeQueue`,Promise.resolve()),t(this,`abortController`,new AbortController),t(this,`closedPromise`,void 0),this.requestHandler=e,this.notificationHandler=n,this.stream=r,this.closedPromise=new Promise(e=>{this.abortController.signal.addEventListener(`abort`,()=>e())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let e=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{this.processMessage(t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&this.sendMessage({jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of this.pendingResponses.values())e.reject(t);this.pendingResponses.clear(),this.abortController.abort(t)}async processMessage(e){if(`method`in e&&`id`in e){let t=await this.tryCallRequestHandler(e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await this.sendMessage({jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await this.tryCallNotificationHandler(e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else`id`in e?this.handleResponse(e):console.error(`Invalid message`,{message:e})}async tryCallRequestHandler(e,t){try{return{result:await this.requestHandler(e,t)??null}}catch(e){if(e instanceof G)return e.toResult();if(e instanceof i)return G.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return G.internalError(t?JSON.parse(t):{}).toResult()}catch{return G.internalError({details:t}).toResult()}}}async tryCallNotificationHandler(e,t){try{return await this.notificationHandler(e,t),{result:null}}catch(e){if(e instanceof G)return e.toResult();if(e instanceof i)return G.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return G.internalError(t?JSON.parse(t):{}).toResult()}catch{return G.internalError({details:t}).toResult()}}}handleResponse(e){let t=this.pendingResponses.get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new G(n,r,i))}this.pendingResponses.delete(e.id)}else console.error(`Got response to unknown request`,e.id)}sendRequest(e,t){this.throwIfClosed();let n=this.nextRequestId++,r=new Promise((e,t)=>{this.pendingResponses.set(n,{resolve:e,reject:t})});return r.catch(()=>{}),this.sendMessage({jsonrpc:`2.0`,id:n,method:e,params:t}),r}async sendNotification(e,t){this.throwIfClosed(),await this.sendMessage({jsonrpc:`2.0`,method:e,params:t})}throwIfClosed(){if(this.abortController.signal.aborted)throw this.abortController.signal.reason??Error(`ACP connection closed`)}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let t=this.stream.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{this.close(e)}),this.writeQueue}},G=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};h(),v(),ye(),be(),Te(),De(),fe(),ae(),_e(),re(),ee(),pe();function K(e,t){if(e)return t?Pe(e)?e:Fe(t,e):e}var Si=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Ci={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function wi(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=Ci[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!Si)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Ti(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ei=256;function Di(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ei?t:t.slice(0,Ei-1)+`…`}function q(e,t){if(!t)return e;let n=D.resolve(t),r=D.resolve(e);return r.startsWith(n+D.sep)||r===n?D.relative(n,r):e}function Oi(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
4
|
+
`+e+(e.endsWith(`
|
|
5
|
+
`)?``:`
|
|
6
|
+
`)+t}function J(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let e=i?.command??`Terminal`,t=i?.description;return{title:e,kind:`execute`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Read`:{let e=i?.file_path,t=e??`File`,r=i?.offset,a=i?.limit,o=``;a&&a>0?o=` (${r??1} - ${(r??1)+a-1})`:r&&(o=` (from line ${r})`);let s=t?q(t,n):`File`,c=K(e,n);return{title:`Read ${s}${o}`,kind:`read`,locations:c?[{path:c,line:r??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?q(e,n):void 0,a=K(e,n);return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:a?[{type:`diff`,path:a,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:a?[{path:a}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?q(e,n):void 0,o=K(e,n);return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:o?[{type:`diff`,path:o,oldText:t||null,newText:r}]:[],locations:o?[{path:o}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,r=K(e,n),a=`Find`;return e&&(a+=` \`${e}\``),t&&(a+=` \`${t}\``),{title:a,kind:`search`,content:[],locations:r?[{path:r}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function ki(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Ai(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Ai(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`resource_link`:{let t=e.uri;return{type:`resource_link`,uri:t,name:e.name??t,mimeType:e.mimeType}}case`resource`:{let t=e.resource;return{type:`resource`,resource:{uri:t?.uri??``,mimeType:t?.mimeType,...typeof t?.text==`string`?{text:t.text}:{},...typeof t?.blob==`string`?{blob:t.blob}:{}}}}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
|
|
7
|
+
`)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function ji(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return ki(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Oi(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Oi(e.text)}:Ai(e,!1)}))}:{};case`Bash`:{let e=``;if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
|
|
8
|
+
`)}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
9
|
+
`));return e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return ki(i??``,r)}}function Mi(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}function Y(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:{let e=i.thinking??``;a={sessionUpdate:`agent_thought_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Mi(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,status:`in_progress`,rawInput:e,...J({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...J({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=ji(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function Ni(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,...i?.messageId?{messageId:i.messageId}:{},content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:Y(s,`assistant`,t,n,r,void 0,i)}function Pi(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?Y([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`content_block_delta`:{let o=a.delta;return o?Y([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function Fi(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Ii(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Fi(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}var Li=console;function Ri(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function zi(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1,m=null;try{for(;!r.aborted;){let s=await Ri(t,r);if(s.done||r.aborted)break;let h=s.value;if(h==null)continue;let g=h;switch(g.type){case`system`:g.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
|
+
|
|
11
|
+
Compacting completed.`}}}));break;case`result`:{let t=g.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=g.modelUsage;if(i&&d){let e=Ii(i,d);e?.contextWindow&&(f=e.contextWindow)}u!==null&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:u,size:f}});let a=g.subtype,o=g.is_error;if(r.aborted){c=`cancelled`;break}switch(a){case`success`:{let e=g.stop_reason;c=e===`max_tokens`?`max_tokens`:e===`refusal`?`refusal`:`end_turn`,o&&(c=`end_turn`);break}case`error_during_execution`:c=g.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=g.parent_tool_use_id;t===null&&m===null&&(m=E());let r=Pi(g,e,i,n,{clientCapabilities:a,cwd:o,messageId:t===null?m??void 0:void 0});for(let e of r)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=g.message,r=g.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s;r===null&&(m===null&&(m=E()),s=m);let c=Ni(g,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p,messageId:s});for(let e of c)await n.sessionUpdate(e);r===null&&(m=null);break}case`user`:break;case`progress`:{let t=g.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
|
+
|
|
13
|
+
Compacting completed.`}}});break;default:Li.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}async function X(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){Li.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;let t=E();await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,...t?{messageId:t}:{},content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=Y(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a,messageId:E()});for(let e of t)await n.sessionUpdate(e)}}}function Bi(e,t,n,r,i,a,o,s){return async(n,c,l,u,d,f)=>{let p=Hi(r);if(n.name===`ExitPlanMode`)return Vi(e,t,d,c,p,i,a,o,s);if(f!==void 0)return f;try{let e=await ie(n,c,l,u,d);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:d}}let m=J({name:n.name,id:d,input:c},p,i),h={toolCallId:d,title:m.title,kind:m.kind,status:`pending`,rawInput:c},g=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`},{kind:`reject_always`,name:`Always Reject`,optionId:`reject_always`}];try{let n=await e.requestPermission({sessionId:t,toolCall:h,options:g});if(n.outcome.outcome===`cancelled`)return s?.(),{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`},toolUseID:d};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:c}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function Vi(e,t,n,r,i,a,o,s,c){let l=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&l.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let u=J({name:`ExitPlanMode`,id:n,input:r},i,a),d={toolCallId:n,title:u.title,kind:u.kind,status:`pending`,rawInput:r},f=await e.requestPermission({sessionId:t,toolCall:d,options:l});if(f.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(f.outcome.outcome===`selected`&&`optionId`in f.outcome&&f.outcome.optionId!==void 0){let n=f.outcome.optionId;if(l.some(e=>e.optionId===n)&&(n==="default"||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function Hi(e){if(!e)return!1;if(e.terminal===!0)return!0;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}Ce(),ne(),se(),w(),e(),te(),de();var Z=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,authMethods:[],agentInfo:{name:`claude-code`,title:`Work Mate`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0,forkSession:!0}},promptCapabilities:{image:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{list:{},resume:{},close:{},delete:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession({...e,replay:!1});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){if(e.cursor!==void 0&&e.cursor!==null)throw Error(`Pagination cursor not supported: listSessions returns all results in a single page.`);let t=e.cwd||b(),n=await Se(t),r=await ge({dir:t}),i=[];for(let e of r){if(!e.cwd||await Se(e.cwd)!==n)continue;let t=Di(e.summary??``);i.push({sessionId:e.sessionId,cwd:e.cwd,...t?{title:t}:{},updatedAt:new Date(e.lastModified).toISOString()})}return{sessions:i}}async unstable_forkSession(e){let{initialMessages:t}=await Ui(e.sessionId),n=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{initialMessages:t});return this.scheduleAvailableCommandsUpdate(n.sessionId),n}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async unstable_deleteSession(e){let t=await T(e.sessionId);if(t)try{await Ne(t.filePath)}catch(e){if(e.code!==`ENOENT`)throw e}return this.sessions.has(e.sessionId)&&await this.teardownSession(e.sessionId),{}}async extMethod(e,t){if(e===`session/delete`){let e=t.sessionId;if(typeof e!=`string`||e.length===0)throw Error(`session/delete requires a non-empty sessionId`);return this.unstable_deleteSession({sessionId:e})}throw G.methodNotFound(e)}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:e.modeId}}),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}};async function Ui(e){let t;try{let n=await C(e);n&&n.messages.length>0&&(t=S(n.messages))}catch(e){console.error(`[ACP] fork source load failed:`,e)}return{initialMessages:t}}var Wi=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function Gi(e){return Wi.includes(e)}function Ki(e,t,n){if(t){let t=qi(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!Xi())throw Error(`Mode not available: bypassPermissions cannot run as root (start the agent as a non-root user, or set IS_SANDBOX=1).`);return t}return Ji(n)??`default`}function qi(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return wi(e,t)}function Ji(e){if(e!=null)try{return wi(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function Yi(e,t){return!!e&&Object.hasOwn(e,t)}function Xi(){return Zi()}function Zi(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid!=`function`||process.getuid()!==0}function Qi(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}function $i(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(Array.isArray(e.options))for(let n of e.options)n&&typeof n==`object`&&typeof n.value==`string`&&t.push(n.value);else typeof n.value==`string`&&t.push(n.value)}return t}function Q(e){return e.conn}function $(e){return e.clientCapabilities}function ea(e,t,n,r){n===`mode`?t.modes={...t.modes,currentModeId:r}:n===`model`&&(t.models={...t.models,currentModelId:r})}v();function ta(){return ve().permissions?.defaultMode}async function na(e,t={}){xe();let n=t.sessionId??E(),r=e.cwd;x(n,_()),g(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}y(),he();try{let i=Ee(),a=oe(i),o=e._meta,s=Yi(o,`permissionMode`),c=Ki(s?o?.permissionMode:void 0,s,ta()),l=$(this),u=this.conn,d=Bi(u,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,l,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=Xi(),p={...ce(),toolPermissionContext:{...i,mode:c,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([me(r),le(r)]);p.agentDefinitions=h;let g=new ke({cwd:r,tools:a,commands:m,mcpClients:[],agents:h.activeAgents,canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Oe(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:c,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},v=ue(),y=we(),b={availableModels:v.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:y};g.setModel(y);let x=Qi(_,b),ee={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:b,configOptions:x,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:l,appState:p,commands:m,sessionFingerprint:Ti({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,ee),{sessionId:n,modes:_,models:b,configOptions:x}}finally{a&&process.chdir(i)}}Object.assign(Z.prototype,{createSession:na}),te(),de(),v(),w();async function ra(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if(Ti({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await T(e.sessionId,e.cwd);return x(e.sessionId,r?Ae(r.filePath):null),g(e.cwd),t&&await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:n.modes,models:n.models,configOptions:n.configOptions}}await this.teardownSession(e.sessionId)}let r=await T(e.sessionId,e.cwd),i=r?Ae(r.filePath):null;x(e.sessionId,i),g(e.cwd);let a;if(r)try{let t=await C(e.sessionId);t&&t.messages.length>0&&(a=S(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let o=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:a});if(t&&a&&a.length>0){let t=this.sessions.get(e.sessionId);t&&await X(e.sessionId,a,Q(this),t.toolUseCache,$(this),t.cwd)}return{sessionId:o.sessionId,modes:o.modes,models:o.models,configOptions:o.configOptions}}async function ia(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async function aa(e){try{let t=await C(e.sessionId);if(!t||t.messages.length===0)return;let n=S(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await X(e.sessionId,n,Q(this),r.toolUseCache,$(this),r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}function oa(e,t){if(!Gi(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async function sa(e,t,n){let r=this.sessions.get(e);r&&(ea(this,r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await Q(this).sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}Object.assign(Z.prototype,{getOrCreateSession:ra,teardownSession:ia,replaySessionHistory:aa,applySessionMode:oa,updateConfigOption:sa});function ca(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(la(n,r))}else if(e.type===`resource`){let n=e.resource;if(n&&typeof n.text==`string`)t.push(n.text);else if(n&&typeof n.blob==`string`){let e=typeof n.mimeType==`string`?n.mimeType:`application/octet-stream`,r=typeof n.uri==`string`?n.uri:`(unknown uri)`;t.push(`Embedded resource: ${r} (${e}, base64 blob, ${n.blob.length} chars)`)}}}return t.filter(e=>e.length>0).join(`
|
|
14
|
+
`)}function la(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}function ua(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),da(e),n}da(e)}function da(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}v();async function fa(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=e.messageId??void 0,r=ca(e.prompt);if(!r.trim())throw Error(`Prompt content is empty`);let i=t.cancelGeneration;if(t.promptRunning){let e=E();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==i)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),x(e.sessionId,_());let i=t.queryEngine.submitMessage(r),{stopReason:a,usage:o}=await zi(e.sessionId,i,Q(this),t.queryEngine.getAbortSignal(),t.toolUseCache,$(this),t.cwd,()=>t.cancelled);if(t.cancelled)return{stopReason:`cancelled`};if(await ma(this,e.sessionId,r),o){let e={inputTokens:o.inputTokens,outputTokens:o.outputTokens,cachedReadTokens:o.cachedReadTokens,cachedWriteTokens:o.cachedWriteTokens,thoughtTokens:0,totalTokens:o.inputTokens+o.outputTokens+o.cachedReadTokens+o.cachedWriteTokens+0};return{stopReason:a,usage:e,...n?{userMessageId:n}:{},_meta:{claudeCode:{usage:e}}}}return{stopReason:a,...n?{userMessageId:n}:{}}}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||/abort|cancelled|interrupt/i.test(n.message));if(t.cancelled||r)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(await this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=ua(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async function pa(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);let n=t.configOptions.find(t=>t.id===e.configId);if(!n)throw Error(`Unknown config option: ${e.configId}`);if(n.type===`select`){let t=$i(n.options);if(!t.includes(e.value))throw Error(`Invalid value '${e.value}' for config option ${e.configId}; must be one of: ${t.join(`, `)}`)}let r=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,r),await Q(this).sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:r}})):e.configId===`model`&&t.queryEngine.setModel(r),ea(this,t,e.configId,r),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:r}:t),{configOptions:t.configOptions}}async function ma(e,t,n){let r=e.sessions.get(t);if(!r)return;let i=r.toolUseCache;if(i.__sessionInfoTitleSent)return;i.__sessionInfoTitleSent=!0;let a=Di(n).slice(0,100);try{await Q(e).sessionUpdate({sessionId:t,update:{sessionUpdate:`session_info_update`,...a?{title:a}:{},updatedAt:new Date().toISOString()}})}catch(e){console.error(`[ACP] Failed to send session_info_update:`,e)}}Object.assign(Z.prototype,{prompt:fa,setSessionConfigOption:pa}),be(),_e();function ha(e,t){let n=je.toWeb(e);return _i(Me.toWeb(t),n)}async function ga(){xe(),he();let e=ha(process.stdin,process.stdout),t,n=new yi(e=>(t=new Z(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{ga as runAcpAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{E as t,M as n,T as r,g as i,n as a,r as o,t as s}from"./lazySchema-DcIJE_0i.js";import{i as c,r as l}from"./semver-BMRJYn3q.js";import{r as u,s as d}from"./bridgeEnabled-CM3SaumJ.js";async function f(){let e=h,t=g().safeParse(e);return t.success?t.data:h}async function p(){let e=await f();return e.min_version&&c(`0.0.3`,e.min_version)?`Your version of Work Mate (0.0.3) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function m(){return d()?(await f()).should_show_app_upgrade_message:!1}var h,g,_=e((()=>{o(),s(),l(),u(),h={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},g=a(()=>t({init_retry_max_attempts:r().int().min(1).max(10).default(3),init_retry_base_delay_ms:r().int().min(100).default(500),init_retry_jitter_fraction:r().min(0).max(1).default(.25),init_retry_max_delay_ms:r().int().min(500).default(4e3),http_timeout_ms:r().int().min(2e3).default(1e4),uuid_dedup_buffer_size:r().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:r().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:r().min(0).max(.5).default(.1),token_refresh_buffer_ms:r().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:r().int().min(500).max(2e3).default(1500),connect_timeout_ms:r().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return c(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:i().default(!1)}))}));export{m as a,_ as i,p as n,f as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t}from"./envLessBridgeConfig-BFjJ8Kt4.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,o as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as m}from"./esm-lWlUmoUA.js";import{C as h,D as g,E as _,I as ee,O as v,S as te,V as ne,_ as re,a as y,d as ie,k as ae,l as oe,n as se,p as ce,s as le,t as ue,w as de,x as fe,y as b}from"./esm-Cb-L4oAk.js";import{a as x,r as pe,t as me}from"./esm-Bx6rTxIs.js";import{C as he,H as ge,R as _e,en as ve,ht as ye,rt as be}from"./state-ix0xIunV.js";import{S as xe,a as Se,w as Ce,z as we}from"./debug-BrXObCdR.js";import{Jt as S,Xt as Te,Zt as Ee,qt as De}from"./settings-DfWP5y6X.js";import{_ as Oe,m as ke}from"./git-Do0wJvux.js";import{r as Ae,t as je}from"./execFileNoThrow-D244NytW.js";import{a as Me,n as Ne,o as Pe,r as Fe}from"./platform-BrYefG_2.js";import{It as Ie,Kt as Le,Mn as Re,Vt as ze,_ as Be,jn as Ve,u as He}from"./model-fi472PRc.js";import{i as Ue,t as We}from"./genericProcessUtils-CdQTApYX.js";import{arch as Ge,hostname as Ke,platform as qe,release as Je}from"os";import{extname as Ye}from"path";import{stat as Xe}from"fs/promises";import{inspect as Ze}from"util";import*as Qe from"process";import{AsyncLocalStorage as $e}from"async_hooks";function et(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function tt(){return process.platform===`linux`?C??!1:!1}async function nt(){if(w!==void 0)return w;if(process.platform===`darwin`)return w=null,null;try{let e=await We(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of De)if(e.includes(t))return w=t,t}}catch{}return w=null,null}async function rt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&S.platform!==`darwin`?await nt()||`pycharm`:S.terminal}function it(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&S.platform!==`darwin`?w===void 0?`pycharm`:w||`pycharm`:S.terminal}async function at(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await nt()}var ot,C,w,T,st=e((()=>{n(),Ee(),i(),Ae(),Ue(),ot=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await je(`test`,[`-f`,`/.dockerenv`]);return e===0}),C=null,process.platform===`linux`&&Xe(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{C=!0},()=>{C=!1}),T={...S,terminal:it(),getIsDocker:ot,getIsBubblewrapSandbox:et,isMuslEnvironment:tt,getTerminalWithJetBrainsDetectionAsync:rt,initJetBrainsDetection:at}}));function ct(e){return lt?.has(e)??!1}var lt,ut=e((()=>{Se(),we()}));function E(){return D.getStore()}function dt(e,t){return D.run(e,t)}function ft(e){return e?.agentType===`subagent`}function pt(){let e=E();if(!(!ft(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function mt(){let e=E();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var D,ht=e((()=>{D=new $e}));function gt(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function _t(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function vt(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&ct(t))}function yt(e,t,n){let r=bt(e);return!r||!Ot.has(r.serverName)&&!vt(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function bt(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function xt(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function O(e,t=0){if(typeof e==`string`)return e.length>kt?`${e.slice(0,At)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=jt)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,j).map(e=>O(e,t+1));return e.length>j&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,j).map(([e,n])=>[e,O(n,t+1)]);return n.length>j&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function St(e){if(!_t())return;let t=Ce(O(e));return t.length>A&&(t=t.slice(0,A)+`…[truncated]`),t}function k(e){let t=Ye(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>Mt?`other`:n}function Ct(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=k(t);e&&(r.add(e),n=e)}for(let t of e.split(Pt)){if(!t)continue;let e=t.split(Ft);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(Nt.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=k(i);a&&!r.has(a)&&(r.add(a),n=n?n+`,`+a:a)}}if(n)return n}function wt(){let e=E();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=be();return i?{parentSessionId:i}:{}}function Tt(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(M&&N){let e=n-N;e>0&&(r=(t.user-M.user+(t.system-M.system))/(e*1e3)*100)}return M=t,N=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function Et(e={}){let t=e.model?String(e.model):He(),n=typeof e.betas==`string`?e.betas:Ve(t).join(`,`),[r,i]=await Promise.all([Lt(),ke()]),a=Tt();return{model:t,sessionId:ye(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(_e()),clientType:he(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...wt(),...Ie()&&{subscriptionType:Ie()},...ge()?{kairosActive:!0}:{},...i&&{rh:i}}}function Dt(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,kairosActive:o,skillMode:s,observerMode:c,...l}=e,u={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,is_claude_ai_auth:r.isClaudeAiAuth,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(u.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(u.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(u.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(u.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(u.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(u.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(u.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(u.github_action_ref=r.githubActionRef),r.wslVersion&&(u.wsl_version=r.wslVersion),r.linuxDistroId&&(u.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(u.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(u.linux_kernel=r.linuxKernel),r.vcs&&(u.vcs=r.vcs),r.versionBase&&(u.version_base=r.versionBase);let d={session_id:l.sessionId,model:l.model,user_type:l.userType,is_interactive:l.isInteractive===`true`,client_type:l.clientType};if(l.betas&&(d.betas=l.betas),l.entrypoint&&(d.entrypoint=l.entrypoint),l.agentSdkVersion&&(d.agent_sdk_version=l.agentSdkVersion),l.sweBenchRunId&&(d.swe_bench_run_id=l.sweBenchRunId),l.sweBenchInstanceId&&(d.swe_bench_instance_id=l.sweBenchInstanceId),l.sweBenchTaskId&&(d.swe_bench_task_id=l.sweBenchTaskId),l.agentId&&(d.agent_id=l.agentId),l.parentSessionId&&(d.parent_session_id=l.parentSessionId),l.agentType&&(d.agent_type=l.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;u.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let f;return(t.accountUuid||t.organizationUuid)&&(f={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:u,...i&&{process:Buffer.from(Ce(i)).toString(`base64`)},...f&&{auth:f},core:d,additional:{...a&&{rh:a},...o&&{is_assistant_mode:!0},...s&&{skill_mode:s},...c&&{observer_mode:c},...n}}}var Ot,kt,At,A,j,jt,Mt,Nt,Pt,Ft,It,Lt,M,N,Rt=e((()=>{n(),Ee(),st(),Re(),Be(),ve(),i(),ut(),ze(),Oe(),Pe(),ht(),xe(),Ot=new Set,kt=512,At=128,A=4*1024,j=20,jt=2,Mt=10,Nt=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Pt=/\s*(?:&&|\|\||[;|])\s*/,Ft=/\s+/,It=t(()=>{let e=`0.0.3`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),Lt=t(async()=>{let[e,t,n,i]=await Promise.all([S.getPackageManagers(),S.getRuntimes(),Fe(),Ne()]);return{platform:Te(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:S.arch,nodeVersion:S.nodeVersion,terminal:T.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:S.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:S.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),isClaudeAiAuth:Le(),version:`0.0.3`,versionBase:It(),buildTime:`2026-07-12T16:17:42.577Z`,deploymentEnvironment:S.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Me()&&{wslVersion:Me()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),M=null,N=null}));function zt(e){return e.setValue(Vt,!0)}function Bt(e){return e.getValue(Vt)===!0}var Vt,P=e((()=>{f(),Vt=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Ht(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ut(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Wt(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ut(e){return typeof e==`string`&&e!==``}function Wt(e){return e==null?!0:Array.isArray(e)?Gt(e):Kt(typeof e)}function Gt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Kt(e)){t=e;continue}return!1}return!1}}return!0}function Kt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var qt=e((()=>{f()}));function Jt(){return e=>{p.error(Yt(e))}}function Yt(e){return typeof e==`string`?e:JSON.stringify(Xt(e))}function Xt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Zt=e((()=>{f()}));function Qt(e){try{$t(e)}catch{}}var $t,en=e((()=>{Zt(),$t=Jt()}));function tn(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${Ze(t)} for ${e}, expected a number, using defaults`);return}return n}function F(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var nn=e((()=>{f()})),rn,an=e((()=>{rn=`2.9.0`})),on,sn=e((()=>{on=`process.runtime.name`})),I,cn=e((()=>{an(),b(),sn(),I={[g]:`opentelemetry`,[on]:`node`,[_]:ae,[v]:rn}})),L,ln=e((()=>{nn(),cn(),L=performance})),un=e((()=>{ln()}));function R(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*yn)]}function dn(e){return _n(R(L.timeOrigin),R(typeof e==`number`?e:L.now()))}function fn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=z),[n,r]}function pn(e){return e[0]*1e6+e[1]/1e3}function mn(e){return e[0]+e[1]/z}function hn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function gn(e){return hn(e)||typeof e==`number`||e instanceof Date}function _n(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=z&&(n[1]-=z,n[0]+=1),n}var vn,yn,z,bn=e((()=>{un(),vn=9,yn=10**6,z=10**vn})),B,xn=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(B||(B={}))}));function Sn(e){if(!Cn(e)||wn(e)!==Dn)return!1;let t=jn(e);if(t===null)return!0;let n=U.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&V.call(n)===An}function Cn(e){return typeof e==`object`&&!!e}function wn(e){return e==null?e===void 0?kn:On:W&&W in Object(e)?Tn(e):En(e)}function Tn(e){let t=U.call(e,W),n=e[W],r=!1;try{e[W]=void 0,r=!0}catch{}let i=G.call(e);return r&&(t?e[W]=n:delete e[W]),i}function En(e){return G.call(e)}var Dn,On,kn,V,An,jn,H,U,W,G,Mn=e((()=>{Dn=`[object Object]`,On=`[object Null]`,kn=`[object Undefined]`,V=Function.prototype.toString,An=V.call(Object),jn=Object.getPrototypeOf,H=Object.prototype,U=H.hasOwnProperty,W=Symbol?Symbol.toStringTag:void 0,G=H.toString}));function Nn(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Pn(t,e.shift(),0,n);return t}function K(e){return q(e)?e.slice():e}function Pn(e,t,n=0,r){let i;if(!(n>Rn)){if(n++,Y(e)||Y(t)||In(t))i=K(t);else if(q(e)){if(i=e.slice(),q(t))for(let e=0,n=t.length;e<n;e++)i.push(K(t[e]));else if(J(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=K(t[r]))}}}else if(J(e))if(J(t)){if(!Ln(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(Y(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Fn(e,s,r)||Fn(t,s,r))delete i[s];else{if(J(a)&&J(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Pn(i[s],c,n,r)}}}}else i=t;return i}}function Fn(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function q(e){return Array.isArray(e)}function In(e){return typeof e==`function`}function J(e){return!Y(e)&&!q(e)&&!In(e)&&typeof e==`object`}function Y(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Ln(e,t){return!(!Sn(e)||!Sn(t))}var Rn,zn=e((()=>{Mn(),Rn=20})),Bn,Vn=e((()=>{a(),Bn=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Hn,Un=e((()=>{Vn(),a(),Hn=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new Bn),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Wn(e,t){return new Promise(n=>{d.with(zt(d.active()),()=>{e.export(t,n)})})}var Gn=e((()=>{f(),P()})),Kn,X=e((()=>{P(),qt(),en(),Zt(),bn(),xn(),un(),zn(),Un(),Gn(),Kn={_export:Wn}}));function qn(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,Jn=e((()=>{})),Q,Yn=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Xn(e,t){return tr.FromAttributeList(Object.entries(e),t)}function Zn(){return Xn({[de]:qn(),[_]:I[_],[g]:I[g],[v]:I[v]})}function Qn(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function $n(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function er(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var tr,nr=e((()=>{f(),X(),b(),Jn(),Yn(),a(),tr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Qn(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Qn(this._rawAttributes),this._schemaUrl=$n(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=er(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),rr,ir,ar=e((()=>{f(),b(),X(),a(),rr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=F(`OTEL_RESOURCE_ATTRIBUTES`),r=F(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[de]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},ir=new rr})),or,sr,cr,lr,ur,dr=e((()=>{or=`host.arch`,sr=`host.id`,cr=`host.name`,lr=`os.type`,ur=`os.version`}));async function fr(){if(!$)switch(Qe.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,pr=e((()=>{})),mr,hr,gr=e((()=>{mr=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},hr=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),_r,vr,yr=e((()=>{dr(),pr(),gr(),_r=class{detect(e){return{attributes:{[cr]:Ke(),[or]:mr(Ge()),[sr]:fr()}}}},vr=new _r})),br,xr,Sr=e((()=>{dr(),gr(),br=class{detect(e){return{attributes:{[lr]:hr(qe()),[ur]:Je()}}}},xr=new br})),Cr=e((()=>{yr(),Sr(),dr()})),wr=e((()=>{Cr()})),Tr=e((()=>{ar(),wr()})),Er=e((()=>{nr(),Tr(),Jn()}));function Dr(e){return Or(e,new WeakSet)}function Or(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Or(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Or(e,t))}return!1}var kr=e((()=>{})),Ar,jr=e((()=>{f(),y(),b(),kr(),a(),Ar=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,h=Date.now();if(this.hrTime=re(r??h),this.hrTimeObserved=re(i??h),p){let e=u.getSpanContext(p);e&&m(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Dr(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(fe,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(h,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(h,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(fe,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(te,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),Mr,Nr=e((()=>{me(),f(),jr(),a(),Mr=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??x.UNSPECIFIED;if(r!==x.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&m(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new Ar(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==x.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&m(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),Pr,Fr=e((()=>{Pr=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),Ir,Lr=e((()=>{y(),a(),Ir=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>oe(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Rr(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var zr=e((()=>{})),Br,Vr=e((()=>{Br=`otel.sdk.log.created`})),Hr,Ur=e((()=>{Vr(),a(),Hr=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(Br,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),Wr,Gr=e((()=>{Wr=`0.215.0`})),Kr,qr,Jr,Yr=e((()=>{f(),me(),Fr(),Lr(),zr(),Ur(),Gr(),a(),Kr={disabled:!1,minimumSeverity:x.UNSPECIFIED,traceBased:!1},qr=()=>({...Kr}),Jr=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new Ir(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Pr,this._loggerConfigurator=i??qr;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,Wr):s();this.loggerMetrics=new Hr(c)}getLoggerConfig(e){let t=Rr(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Xr,Zr=e((()=>{f(),me(),ue(),y(),Nr(),Yr(),a(),Xr=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??se(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??qr,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new Jr(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new le(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),pe;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Mr({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),Qr,$r=e((()=>{y(),Qr=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:ce(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:ie.SUCCESS})}}}));async function ei(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var ti,ni,ri=e((()=>{f(),y(),a(),ti=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await ei(t),await d.with(ne(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){ee(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===ie.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},ni=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new le(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new ti(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){ee(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new ti(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,ee(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),ii,ai=e((()=>{ri(),ii=class extends ni{onShutdown(){}}})),oi=e((()=>{ai()})),si=e((()=>{oi()})),ci=e((()=>{Zr(),$r(),si()}));export{Ct as $,mn as A,Qt as B,Nn as C,dn as D,_n as E,ln as F,P as G,qt as H,L as I,bt as J,Bt as K,tn as L,gn as M,hn as N,fn as O,R as P,k as Q,F as R,zn as S,xn as T,Wt as U,en as V,Ht as W,St as X,xt as Y,Et as Z,Xn as _,$r as a,mt as at,Hn as b,Er as c,ht as ct,vr as d,at as dt,Rt as et,yr as f,st as ft,nr as g,Zn as h,Qr as i,Dt as it,bn as j,pn as k,Sr as l,dt as lt,ar as m,ii as n,yt as nt,Xr as o,E as ot,ir as p,zt as q,ai as r,gt as rt,Zr as s,pt as st,ci as t,_t as tt,xr as u,T as ut,X as v,B as w,Un as x,Kn as y,nn as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as m,t as h}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as g,n as _,r as v,t as y}from"./figures-5ThXQEtq.js";import{n as b,t as x}from"./cwd-
|
|
1
|
+
import{i as e,n as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as m,t as h}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as g,n as _,r as v,t as y}from"./figures-5ThXQEtq.js";import{n as b,t as x}from"./cwd-CYmmnQVS.js";import{S as ee,T as te}from"./debug-BrXObCdR.js";import{o as ne,s as re}from"./log-BMCygSzM.js";import{aborted as ie,callbackify as S,debuglog as ae,inspect as oe,promisify as se,stripVTControlCharacters as ce}from"node:util";import C,{execArgv as le,execPath as ue,hrtime as de,platform as fe}from"node:process";import w from"node:path";import{ChildProcess as pe,execFile as me,spawn as he,spawnSync as ge}from"node:child_process";import{appendFileSync as _e,createReadStream as ve,createWriteStream as ye,readFileSync as be,statSync as xe,writeFileSync as Se}from"node:fs";import{constants as T}from"node:os";import Ce from"node:tty";import{EventEmitter as we,addAbortListener as Te,on as Ee,once as E,setMaxListeners as De}from"node:events";import{Duplex as Oe,PassThrough as ke,Readable as D,Transform as Ae,Writable as je,getDefaultHighWaterMark as Me}from"node:stream";import{StringDecoder as Ne}from"node:string_decoder";import{fileURLToPath as Pe}from"node:url";import{Buffer as Fe}from"node:buffer";import{scheduler as Ie,setImmediate as Le,setTimeout as Re}from"node:timers/promises";import{serialize as ze}from"node:v8";import{finished as O}from"node:stream/promises";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var A=t((()=>{})),Be,Ve,He,Ue,We=t((()=>{Be=(e,t)=>{let n=Ue(Ve(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},Ve=e=>He(e)?e.toString():e,He=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Ue=e=>e instanceof URL?Pe(e):e})),Ge,Ke=t((()=>{A(),We(),Ge=(e,t=[],n={})=>{let r=Be(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]}})),qe,Je,j,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,M=t((()=>{({toString:qe}=Object.prototype),Je=e=>qe.call(e)===`[object ArrayBuffer]`,j=e=>qe.call(e)===`[object Uint8Array]`,Ye=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Xe=new TextEncoder,Ze=e=>Xe.encode(e),Qe=new TextDecoder,$e=e=>Qe.decode(e),et=(e,t)=>tt(e,t).join(``),tt=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new Ne(t),r=e.map(e=>typeof e==`string`?Ze(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},nt=e=>e.length===1&&j(e[0])?e[0]:it(rt(e)),rt=e=>e.map(e=>typeof e==`string`?Ze(e):e),it=e=>{let t=new Uint8Array(at(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},at=e=>{let t=0;for(let n of e)t+=n.length;return t}})),ot,st,ct,lt,ut,dt,ft,pt,mt,ht=t((()=>{A(),M(),ot=e=>Array.isArray(e)&&Array.isArray(e.raw),st=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=ct({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},ct=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=lt(i,e.raw[r]),c=ft(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>pt(e)):[pt(l)];return ft(c,u,s)},lt=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=ut.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(ut.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
|
|
2
2
|
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=dt[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},ut=new Set([` `,` `,`\r`,`
|
|
3
3
|
`]),dt={x:3,u:5},ft=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],pt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return mt(e);throw e instanceof pe||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},mt=({stdout:e})=>{if(typeof e==`string`)return e;if(j(e))return $e(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)}})),N,gt,P,_t,F=t((()=>{N=e=>gt.includes(e),gt=[C.stdin,C.stdout,C.stderr],P=[`stdin`,`stdout`,`stderr`],_t=e=>P[e]??`stdio[${e}]`})),vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,I=t((()=>{A(),F(),vt=e=>{let t={...e};for(let n of At)t[n]=yt(e,n);return t},yt=(e,t)=>{let n=Array.from({length:bt(e)+1}),r=xt(e[t],n,t);return Ot(r,t)},bt=({stdio:e})=>Array.isArray(e)?Math.max(e.length,P.length):P.length,xt=(e,t,n)=>k(e)?St(e,t,n):t.fill(e),St=(e,t,n)=>{for(let r of Object.keys(e).sort(Ct))for(let i of Tt(r,n,t))t[i]=e[r];return t},Ct=(e,t)=>wt(e)<wt(t)?1:-1,wt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,Tt=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=Et(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
|
|
4
4
|
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{S as t,T as n}from"./debug-BrXObCdR.js";import{execSync as r}from"child_process";function i(e,t){return n`execSync: ${e.slice(0,100)}`,r(e,t)}var a=e((()=>{t()}));export{a as n,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Ct as r,Et as i,Il as a,Ll as o,ND as s,PD as c,fC as l,uC as u}from"./loadAgentsDir-DrDu5yYy.js";import{n as d,t as f}from"./ExitFlow-DCIhnP5h.js";import{spawnSync as p}from"child_process";function m(){return c(_)??`Goodbye!`}async function h(e){if(o())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=r()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await u(0,`prompt_input_exit`),null)}var g,_;e((()=>{s(),t(),d(),a(),l(),i(),g=n(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Ix as r,Lx as i}from"./loadAgentsDir-DrDu5yYy.js";import{n as a,t as o}from"./extra-usage-core-RZMzaH0L.js";async function s(e,t){let n=await a();return n.type===`message`?(e(n.value),null):(0,c.jsx)(r,{onDone:()=>{t.onChangeAPIKey(),e(`Login successful`)}})}var c,l=e((()=>{t(),i(),o(),c=n()}));export{l as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./extra-usage-BTv_OwGN.js";e();export{t as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{b as r,c as i,g as a}from"./config-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{b as r,c as i,g as a}from"./config-DiT2Z8dY.js";import{o,s}from"./log-BMCygSzM.js";import{l as c,u as l}from"./oauth-BqJqV-2M.js";import{It as u,Vt as d,ci as f,oi as p}from"./model-fi472PRc.js";import{a as m,l as h,o as g}from"./api-gJBnC8z3.js";import{n as _,t as v}from"./browser-BmZuQom6.js";import{n as y,t as b}from"./usage-CZdPfUqP.js";import{i as x,r as S}from"./overageCreditGrant-BVxlYgeU.js";async function C(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${c().BASE_API_URL}/api/oauth/organizations/${r}/admin_requests`;return(await t.post(a,e,{headers:i})).data}async function w(e,n){let{accessToken:r,orgUUID:i}=await h(),a={...m(r),"x-organization-uuid":i},o=`${c().BASE_API_URL}/api/oauth/organizations/${i}/admin_requests/me?request_type=${e}`;for(let e of n)o+=`&statuses=${e}`;return(await t.get(o,{headers:a})).data}async function T(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${c().BASE_API_URL}/api/oauth/organizations/${r}/admin_requests/eligibility?request_type=${e}`;return(await t.get(a,{headers:i})).data}var E=e((()=>{n(),l(),g()}));async function D(){i().hasVisitedExtraUsage||r(e=>({...e,hasVisitedExtraUsage:!0})),x();let e=u(),t=e===`team`||e===`enterprise`;if(!p()&&t){let e;try{e=(await b())?.extra_usage}catch(e){s(e)}if(e?.is_enabled&&e.monthly_limit===null)return{type:`message`,value:`Your organization already has unlimited extra usage. No request needed.`};try{if((await T(`limit_increase`))?.is_allowed===!1)return{type:`message`,value:`Please contact your admin to manage extra usage settings.`}}catch(e){s(e)}try{let e=await w(`limit_increase`,[`pending`,`dismissed`]);if(e&&e.length>0)return{type:`message`,value:`You have already submitted a request for extra usage to your admin.`}}catch(e){s(e)}try{return await C({request_type:`limit_increase`,details:null}),{type:`message`,value:e?.is_enabled?`Request sent to your admin to increase extra usage.`:`Request sent to your admin to enable extra usage.`}}catch(e){s(e)}return{type:`message`,value:`Please contact your admin to manage extra usage settings.`}}let n=t?`https://claude.ai/admin-settings/usage`:`https://claude.ai/settings/usage`;try{return{type:`browser-opened`,url:n,opened:await _(n)}}catch(e){return s(e),{type:`message`,value:`Failed to open browser. Please visit ${n} to manage extra usage.`}}}var O=e((()=>{E(),S(),y(),d(),f(),v(),a(),o()}));export{D as n,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./extra-usage-core-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./extra-usage-core-RZMzaH0L.js";async function r(){let e=await t();return e.type===`message`?{type:`text`,value:e.value}:{type:`text`,value:e.opened?`Browser opened to manage extra usage. If it didn't open, visit: ${e.url}`:`Please visit ${e.url} to manage extra usage.`}}e((()=>{n()}))();export{r as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,Gt as r,I as i,P as a,T as o,fi as s,t as c,x as ee}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,Gt as r,I as i,P as a,T as o,fi as s,t as c,x as ee}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{BO as te,EO as u,Ex as d,FO as ne,HD as f,IO as re,JS as p,MO as m,Md as h,PO as g,TO as _,Tx as ie,VD as ae,XS as oe,_x as se,gx as v,jd as ce,qS as y,wO as b,zO as le}from"./loadAgentsDir-DrDu5yYy.js";import{Kt as x,c as ue,g as S,y as de}from"./settings-DfWP5y6X.js";import{n as C,r as fe}from"./analytics-BotDBGh0.js";import{C as w,K as T,Kn as E,Kt as D,Vt as O,_ as k,it as A,nt as pe,o as j,qn as M,rt as me,tt as N,x as P}from"./model-fi472PRc.js";import{u as F}from"./referral-DrebVwqx.js";import{n as he,t as I}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";function L(e,t){if(!g(t))return;let n=u(t,e);return`${R(n)} ${n} · /effort`}function R(e){switch(e){case`low`:return`○`;case`medium`:return`◐`;case`high`:return`●`;case`xhigh`:return`⦿`;case`max`:return`◉`;default:return`●`}}var z=e((()=>{x(),m()}));function B({initial:e,sessionModel:t,onSelect:s,onCancel:c,isStandaloneCommand:l,showFastModeNotice:u,headerText:d,skipSettingsWrite:f}){let m=oe(),h=he(),_=e===null?K:e,[v,y]=(0,W.useState)(_),x=p(e=>A()?e.fastMode:!1),[S,C]=(0,W.useState)(()=>new Set(E(_)?[_.replace(/\[1m\]/i,``)]:[])),w=(0,W.useCallback)(()=>{if(!v||v===K)return;let e=v.replace(/\[1m\]/i,``);C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[v]),[D,O]=(0,W.useState)(!1),k=p(e=>e.effortValue),[j,M]=(0,W.useState)(k===void 0?void 0:b(k)),N=(0,W.useMemo)(()=>ce(x??!1),[x]),F=(0,W.useMemo)(()=>e!==null&&!N.some(t=>t.value===e)?[...N,{value:e,label:P(e),description:`Current model`}]:N,[N,e]),I=(0,W.useMemo)(()=>F.map(e=>({...e,value:e.value===null?K:e.value})),[F]),L=(0,W.useMemo)(()=>I.some(e=>e.value===_)?_:I[0]?.value??void 0,[I,_]),R=Math.min(10,I.length),z=Math.max(0,I.length-R),B=I.find(e=>e.value===v)?.label,q=V(v),J=v!==void 0&&v!==K&&S.has(v.replace(/\[1m\]/i,``)),Y=q?g(q):!1,X=q?re(q):!1,Z=q?ne(q):!1,Q=U(v),$=j===`max`&&!Z?X?`xhigh`:`high`:j===`xhigh`&&!X?`high`:j,_e=(0,W.useCallback)(e=>{y(e),!D&&k===void 0&&M(U(e))},[D,k]),ve=(0,W.useCallback)(e=>{Y&&(M(t=>ge(t??Q,e,X,Z)),O(!0))},[Y,X,Z,Q]);r({"modelPicker:decreaseEffort":()=>ve(`left`),"modelPicker:increaseEffort":()=>ve(`right`),"modelPicker:toggle1M":()=>w()},{context:`ModelPicker`});function ye(e){if(fe(`tengu_model_command_menu_effort`,{effort:j}),!f){let t=le(j,U(e),ue(`userSettings`)?.effortLevel,D),n=te(t);n!==void 0&&de(`userSettings`,{effortLevel:n}),m(e=>({...e,effortValue:t}))}let t=V(e),n=D&&t&&g(t)?j:void 0;if(e===K){s(null,n);return}let r=e.replace(/\[1m\]/i,``);s(S.has(r)?`${r}[1m]`:r,n)}let be=(0,G.jsxs)(i,{flexDirection:`column`,children:[(0,G.jsxs)(i,{flexDirection:`column`,children:[(0,G.jsxs)(i,{marginBottom:1,flexDirection:`column`,children:[(0,G.jsx)(a,{color:`remember`,bold:!0,children:`Select model`}),(0,G.jsx)(a,{dimColor:!0,children:d??`Choose a model for this and future sessions. Use ← → to adjust effort, Space to toggle 1M context.`}),t&&(0,G.jsxs)(a,{dimColor:!0,children:[`Currently using `,P(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,G.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(i,{flexDirection:`column`,children:(0,G.jsx)(se,{defaultValue:_,defaultFocusValue:L,options:I,onChange:ye,onFocus:_e,onCancel:c??(()=>{}),visibleOptionCount:R})}),z>0&&(0,G.jsx)(i,{paddingLeft:3,children:(0,G.jsxs)(a,{dimColor:!0,children:[`and `,z,` more…`]})})]}),(0,G.jsxs)(i,{marginBottom:1,flexDirection:`column`,children:[Y?(0,G.jsxs)(a,{dimColor:!0,children:[(0,G.jsx)(H,{effort:$}),` `,ae($),` effort`,$===Q?` (default)`:``,` `,(0,G.jsx)(a,{color:`subtle`,children:`← → to adjust`})]}):(0,G.jsxs)(a,{color:`subtle`,children:[(0,G.jsx)(H,{effort:void 0}),` Effort not supported`,B?` for ${B}`:``]}),J?(0,G.jsxs)(a,{dimColor:!0,children:[(0,G.jsx)(H,{effort:`high`}),` 1M context on`,(0,G.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]}):(0,G.jsxs)(a,{color:`subtle`,children:[(0,G.jsx)(H,{effort:void 0}),` 1M context off`,B?` for ${B}`:``,(0,G.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]})]}),A()?u?(0,G.jsx)(i,{marginBottom:1,children:(0,G.jsxs)(a,{dimColor:!0,children:[`Fast mode is `,(0,G.jsx)(a,{bold:!0,children:`ON`}),` and available with `,T,` only (/fast). Switching to other models turn off fast mode.`]})}):pe()&&!me()?(0,G.jsx)(i,{marginBottom:1,children:(0,G.jsxs)(a,{dimColor:!0,children:[`Use `,(0,G.jsx)(a,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,T,` only).`]})}):null:null]}),l&&(0,G.jsx)(a,{dimColor:!0,italic:!0,children:h.pending?(0,G.jsxs)(G.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,G.jsxs)(o,{children:[(0,G.jsx)(n,{shortcut:`Enter`,action:`confirm`}),(0,G.jsx)(ie,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return l?(0,G.jsx)(ee,{color:`permission`,children:be}):be}function V(e){if(e)return e===K?j():w(e)}function H({effort:e}){return(0,G.jsx)(a,{color:e?`claude`:`subtle`,children:R(e??`low`)})}function ge(e,t,n,r){let i=[`low`,`medium`,`high`,...n?[`xhigh`]:[],...r?[`max`]:[]],a=i.indexOf(e),o=a===-1?i.indexOf(`high`):a;return t===`right`?i[(o+1)%i.length]:i[(o-1+i.length)%i.length]}function U(e){let t=_(V(e)??j());return t===void 0?`high`:b(t)}var W,G,K,q=e((()=>{f(),s(),W=t(s(),1),M(),I(),C(),N(),c(),F(),y(),m(),k(),h(),S(),d(),v(),z(),G=l(),K=`__NO_PREFERENCE__`}));function J(e,t,n){if(!D())return!1;if(t)return!0;if(e===null||!E(e))return!1;let r=e.toLowerCase().replace(/\[1m\]$/,``).trim(),i=r===`opus`||r.includes(`opus-4-6`)||r.includes(`opus-4-7`),a=r===`sonnet`||r.includes(`sonnet-4-6`);return i&&n?!1:i||a}var Y=e((()=>{O(),M()}));export{R as a,q as i,J as n,L as o,B as r,z as s,Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eu as e,nu as t,ru as n,tu as r}from"./loadAgentsDir-DrDu5yYy.js";n();export{e as drainPendingExtraction,r as executeExtractMemories,t as initExtractMemories};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./fast-CNXgsvnE.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,I as r,Lt as i,P as a,di as o,fi as s,j as c,t as l,ui as u,y as d}from"./src-CDCSSo0U2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,I as r,Lt as i,P as a,di as o,fi as s,j as c,t as l,ui as u,y as d}from"./src-CDCSSo0U2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{JS as p,XS as m,qS as h}from"./loadAgentsDir-DrDu5yYy.js";import{Kt as g,g as _,y as v}from"./settings-DfWP5y6X.js";import{c as y,g as b}from"./config-DiT2Z8dY.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{b as C,u as w}from"./startupProfiler-xa3NmN7Z.js";import{G as T,J as E,K as D,U as O,W as k,Y as A,Z as j,at as M,it as N,q as P,tt as F,ut as I}from"./model-fi472PRc.js";import{u as L}from"./referral-DrebVwqx.js";import{n as R,t as z}from"./systemTheme-Ceakddth.js";function B({cooldown:e}){return e?(0,H.jsx)(a,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(a,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let n=R(y().theme);return t?u.dim(c(`promptBorder`,n)(`↯`)):c(`fastMode`,n)(`↯`)}var H,U=e((()=>{o(),s(),g(),l(),b(),z(),H=f()}));function W(e,t){P(),v(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!M(e.mainLoopModel);return{...e,...t?{mainLoopModel:E(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let o=p(e=>e.mainLoopModel),s=p(e=>e.fastMode),c=m(),[l,u]=(0,J.useState)(s??!1),f=A(),h=f.status===`cooldown`,g=t!==null,_=O(k(!0));function v(){g||(W(l,c),S(`tengu_fast_mode_toggled`,{enabled:l,source:`picker`}),l?e(`${V(l)} Fast mode ON${M(o)?``:` · model set to ${D}`} · ${_}`):(c(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function y(){if(g){s&&W(!1,c),e(`Fast mode OFF`,{display:`system`});return}e(s?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function b(){g||u(e=>!e)}return n({"confirm:yes":v,"confirm:nextField":b,"confirm:next":b,"confirm:previous":b,"confirm:cycleMode":b,"confirm:toggle":b},{context:`Confirmation`}),(0,Y.jsxs)(d,{title:(0,Y.jsxs)(a,{children:[(0,Y.jsx)(B,{cooldown:h}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${D}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:y,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(a,{children:[`Press `,e.keyName,` again to exit`]}):g?(0,Y.jsx)(a,{children:`Esc to cancel`}):(0,Y.jsx)(a,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(r,{marginLeft:2,children:(0,Y.jsx)(a,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(r,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(r,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(a,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(a,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,Y.jsx)(a,{dimColor:!0,children:_})]})}),h&&f.status===`cooldown`&&(0,Y.jsx)(r,{marginLeft:2,children:(0,Y.jsxs)(a,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,w(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(a,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(i,{url:`https://code.claude.com/docs/en/fast-mode`,children:`https://code.claude.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=j();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),S(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${M(i)?``:` · model set to ${D}`} · ${O(k(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!N())return null;await I();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=j();return S(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{s(),J=t(s(),1),l(),U(),L(),x(),h(),F(),C(),T(),_(),Y=f()}));export{U as a,V as i,q as n,X as r,G as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./Feedback-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as t}from"./src-CDCSSo0U2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{n as r,t as i}from"./Feedback-CDTqPqsM.js";function a(e,t,n,r=``,a={}){return(0,s.jsx)(i,{abortSignal:t,messages:n,initialDescription:r,onDone:e,backgroundTasks:a})}async function o(e,t,n){let r=n||``;return a(e,t.abortController.signal,t.messages,r)}var s;e((()=>{t(),r(),s=n()}))();export{o as call,a as renderFeedbackComponent};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./cwd-
|
|
2
|
-
`&&(r>0&&e[r-1]===`\r`?t++:n++);return t>n?`CRLF`:`LF`}function j(e){let t=l(),{resolvedPath:n,isSymlink:r}=
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./cwd-CYmmnQVS.js";import{H as a,V as o,_ as s,a as c,d as l,l as u,p as d,z as f}from"./debug-BrXObCdR.js";import{o as p,s as m}from"./log-BMCygSzM.js";import{i as h,o as g}from"./platform-BrYefG_2.js";import{i as ee,n as te}from"./path-D5U-tm91.js";import{n as ne,r as re}from"./analytics-BotDBGh0.js";import{homedir as _}from"os";import{basename as v,dirname as y,extname as b,isAbsolute as ie,join as x,normalize as ae,relative as S,resolve as C,sep as w}from"path";import{chmodSync as T,writeFileSync as E}from"fs";import{realpath as D,stat as O}from"fs/promises";function k(e){let{buffer:t,bytesRead:n}=l().readSync(e,{length:4096});return n===0?`utf8`:n>=2&&t[0]===255&&t[1]===254?`utf16le`:(n>=3&&t[0]===239&&t[1]===187&&t[2],`utf8`)}function A(e){let t=0,n=0;for(let r=0;r<e.length;r++)e[r]===`
|
|
2
|
+
`&&(r>0&&e[r-1]===`\r`?t++:n++);return t>n?`CRLF`:`LF`}function j(e){let t=l(),{resolvedPath:n,isSymlink:r}=s(t,e);r&&u(`Reading through symlink: ${e} -> ${n}`);let i=k(n),a=t.readFileSync(n,{encoding:i}),o=A(a.slice(0,4096));return{content:a.replaceAll(`\r
|
|
3
3
|
`,`
|
|
4
|
-
`),encoding:i,lineEndings:o}}function M(e){return j(e).content}var N=e((()=>{
|
|
4
|
+
`),encoding:i,lineEndings:o}}function M(e){return j(e).content}var N=e((()=>{c(),d()})),P,F,I=e((()=>{$(),d(),t(),P=class{constructor(){n(this,`cache`,new Map),n(this,`maxCacheSize`,1e3)}readFile(e){let t=l(),n;try{n=t.statSync(e)}catch(t){throw this.cache.delete(e),t}let r=e,i=this.cache.get(r);if(i&&i.mtime===n.mtimeMs)return{content:i.content,encoding:i.encoding};let a=H(e),o=t.readFileSync(e,{encoding:a}).replaceAll(`\r
|
|
5
5
|
`,`
|
|
6
6
|
`);if(this.cache.set(r,{content:o,encoding:a,mtime:n.mtimeMs}),this.cache.size>this.maxCacheSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}return{content:o,encoding:a}}clear(){this.cache.clear()}invalidate(e){this.cache.delete(e)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}},F=new P}));async function L(e){try{return await O(e),!0}catch{return!1}}function R(e){try{return l().readFileSync(e,{encoding:`utf8`})}catch(e){return m(e),null}}function z(e){let t=l();return Math.floor(t.statSync(e).mtimeMs)}async function B(e){let t=await l().stat(e);return Math.floor(t.mtimeMs)}function V(e,t,n,r){let i=t;r===`CRLF`&&(i=t.replaceAll(`\r
|
|
7
7
|
`,`
|
|
8
8
|
`).split(`
|
|
9
9
|
`).join(`\r
|
|
10
|
-
`)),Y(e,i,{encoding:n})}function H(e){try{let{resolvedPath:t}=
|
|
10
|
+
`)),Y(e,i,{encoding:n})}function H(e){try{let{resolvedPath:t}=s(l(),e);return k(t)}catch(e){return a(e)?u(`detectFileEncoding failed for expected reason: ${e.code}`,{level:`debug`}):m(e),`utf8`}}function U(e,t=`utf8`){try{let n=l(),{resolvedPath:r}=s(n,e),{buffer:i,bytesRead:a}=n.readSync(r,{length:4096});return A(i.toString(t,0,a))}catch(e){return m(e),`LF`}}function W(e){return e.includes(` `)?e.replace(/^\t+/gm,e=>` `.repeat(e.length)):e}function G(e){let t=e?te(e):void 0;return{absolutePath:t,relativePath:t?S(i(),t):void 0}}function K(e){let{relativePath:t}=G(e);if(t&&!t.startsWith(`..`))return t;let n=_();return e.startsWith(n+w)?`~`+e.slice(n.length):e}function q(e){let t=l();try{let n=y(e),r=v(e,b(e)),i=t.readdirSync(n).filter(t=>v(t.name,b(t.name))===r&&x(n,t.name)!==e)[0];return i?i.name:void 0}catch(e){o(e)||m(e);return}}async function oe(e){let t=i(),n=y(t),r=e;try{r=x(await D(y(e)),v(e))}catch{}let a=n===w?w:n+w;if(!r.startsWith(a)||r.startsWith(t+w)||r===t)return;let o=x(t,S(n,r));try{return await O(o),o}catch{return}}function J(){return!0}function se({content:e,startLine:t}){if(!e)return``;let n=e.split(/\r?\n/);return J()?n.map((e,n)=>`${n+t}\t${e}`).join(`
|
|
11
11
|
`):n.map((e,n)=>{let r=String(n+t);return r.length>=6?`${r}→${e}`:`${r.padStart(6,` `)}→${e}`}).join(`
|
|
12
|
-
`)}function ce(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function le(e){try{return l().isDirEmptySync(e)}catch(e){return
|
|
12
|
+
`)}function ce(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function le(e){try{return l().isDirEmptySync(e)}catch(e){return o(e)}}function ue(e){let{content:t}=F.readFile(e);return t}function Y(e,t,n={encoding:`utf-8`}){let r=l(),i=e;try{let t=r.readlinkSync(e);i=ie(t)?t:C(y(e),t),u(`Writing through symlink: ${e} -> ${i}`)}catch{}let a=`${i}.tmp.${process.pid}.${Date.now()}`,s,c=!1;try{s=r.statSync(i).mode,c=!0,u(`Preserving file permissions: ${s.toString(8)}`)}catch(e){if(!o(e))throw e;n.mode!==void 0&&(s=n.mode,u(`Setting permissions for new file: ${s.toString(8)}`))}try{u(`Writing to temp file: ${a}`);let e={encoding:n.encoding,flush:!0};!c&&n.mode!==void 0&&(e.mode=n.mode),E(a,t,e),u(`Temp file written successfully, size: ${t.length} bytes`),c&&s!==void 0&&(T(a,s),u(`Applied original permissions to temp file`)),u(`Renaming ${a} to ${i}`),r.renameSync(a,i),u(`File ${i} written atomically`)}catch(e){u(`Failed to write file atomically: ${e}`,{level:`error`}),re(`tengu_atomic_write_error`,{});try{u(`Cleaning up temp file: ${a}`),r.unlinkSync(a)}catch(e){u(`Failed to clean up temp file: ${e}`)}u(`Falling back to non-atomic write for ${i}`);try{let e={encoding:n.encoding,flush:!0};!c&&n.mode!==void 0&&(e.mode=n.mode),E(i,t,e),u(`File ${i} written successfully with non-atomic fallback`)}catch(e){throw u(`Non-atomic write also failed: ${e}`),e}}}function de(){let e=h(),t=_();if(e===`macos`)return x(t,`Desktop`);if(e===`windows`){let e=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,`/`):null;if(e){let t=`/mnt/c${e.replace(/^[A-Z]:/,``)}/Desktop`;if(l().existsSync(t))return t}try{let e=`/mnt/c/Users`,t=l().readdirSync(e);for(let n of t){if(n.name===`Public`||n.name===`Default`||n.name===`Default User`||n.name===`All Users`)continue;let t=x(e,n.name,`Desktop`);if(l().existsSync(t))return t}}catch(e){m(e)}}let n=x(t,`Desktop`);return l().existsSync(n)?n:t}function fe(e,t=Z){try{return l().statSync(e).size<=t}catch{return!1}}function X(e){let t=ae(e);return t=t.replace(/\\/g,`/`),h()===`windows`&&(t=t.toLowerCase()),t}function pe(e,t){return X(e)===X(t)}var Z,Q,$=e((()=>{ne(),r(),c(),f(),N(),I(),d(),p(),ee(),g(),Z=.25*1024*1024,Q=`Note: your current working directory is`}));export{Y as C,M as D,N as E,j as O,oe as S,k as T,L as _,H as a,ue as b,de as c,B as d,$ as f,X as g,fe as h,W as i,K as l,le as m,Z as n,U as o,J as p,se as r,q as s,Q as t,z as u,pe as v,V as w,ce as x,R as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-CYmmnQVS.js";import{n as r,o as i}from"./fileStateCache-DDW5toIs.js";import{relative as a}from"path";async function o(e,t){let i=t.readFileState?r(t.readFileState):[];return i.length===0?{type:`text`,value:`No files in context`}:{type:`text`,value:`Files in context:\n${i.map(e=>a(n(),e)).join(`
|
|
2
2
|
`)}`}}e((()=>{t(),i()}))();export{o as call};
|