claude-code-best 2.6.11 → 2.6.12
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-CGKtPsTK.js → AddWorkspaceDirectory-LhW1QZFL.js} +1 -1
- package/dist/chunks/{App-DF28Bpg9.js → App-DYMNbl0d.js} +1 -1
- package/dist/chunks/ApproveApiKey-B1XCQNW6.js +1 -0
- package/dist/chunks/{ApproveApiKey-D21kbmQj.js → ApproveApiKey-Bi2Iq_gN.js} +1 -1
- package/dist/chunks/{AssistantSessionChooser-CDfwNVi5.js → AssistantSessionChooser-Dv6yYR3s.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-qS15If6H.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-BDWFw61G.js → BypassPermissionsModeDialog-Bhjd2F2o.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-CpN0yIU_.js → ClaudeInChromeOnboarding-CxBS5xZY.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CWRHpy22.js → ClaudeMdExternalIncludesDialog-CiANFiNV.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-nuKXhM2t.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-C8FzG3uF.js +1 -0
- package/dist/chunks/{DesktopHandoff-CKHLXiwc.js → DesktopHandoff-BSpzQF0U.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-BwMFW7Wt.js → DevChannelsDialog-B2xqlZtS.js} +1 -1
- package/dist/chunks/{DiffDialog-oA1v0BMo.js → DiffDialog-XmOsaUeN.js} +2 -2
- package/dist/chunks/Doctor-C6FXh99k.js +1 -0
- package/dist/chunks/Doctor-DLx7Z_sA.js +3 -0
- package/dist/chunks/{ExitFlow-DJLYN-Bd.js → ExitFlow-CHDj7fv7.js} +2 -2
- package/dist/chunks/{Feedback-CpfhqIEv.js → Feedback-CUjTJbIh.js} +2 -2
- package/dist/chunks/Grove-B8ZQOflC.js +1 -0
- package/dist/chunks/{Grove-BugC6ssx.js → Grove-fenDMHVw.js} +1 -1
- package/dist/chunks/{HybridTransport-PeXWuYfl.js → HybridTransport-CP63usH9.js} +1 -1
- package/dist/chunks/{ITermBackend-dcs68DGS.js → ITermBackend-Bp_3qpix.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-DdB9_Ve0.js → InvalidConfigDialog-CgD7HSg0.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-BL8nxwWQ.js → InvalidSettingsDialog-pYMa5Fp4.js} +1 -1
- package/dist/chunks/MCPConnectionManager-ip1xShU_.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BYPXpmte.js → McpParsingWarnings-DhobExFM.js} +1 -1
- package/dist/chunks/MessageSelector-B2X6zrsb.js +3 -0
- package/dist/chunks/Messages-CmsZIA66.js +11 -0
- package/dist/chunks/{Onboarding-ByLnHSnW.js → Onboarding-BaoLhLiT.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-CVNfTSKG.js → OverageCreditUpsell-DnLMobAh.js} +1 -1
- package/dist/chunks/{PluginSettings-h9Lj0vW6.js → PluginSettings-BetzicTb.js} +3 -3
- package/dist/chunks/{PromptInputFooterSuggestions-CYWSLCgA.js → PromptInputFooterSuggestions-D-1hRFAD.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-BsYNhZCw.js → PromptInputHelpMenu-DnQj3Hpq.js} +1 -1
- package/dist/chunks/QueryEngine-BwvqdZVN.js +1 -0
- package/dist/chunks/REPL-CCgaPc2g.js +1 -0
- package/dist/chunks/{REPL-CV12-ns7.js → REPL-zS2s1JnV.js} +34 -34
- package/dist/chunks/{RemoteCallout-WWO84za-.js → RemoteCallout-B9hClSYj.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-Dx2skKnM.js → RemoteSessionManager-BgLIvi8Z.js} +2 -2
- package/dist/chunks/ResumeConversation-DAMMGHGc.js +1 -0
- package/dist/chunks/{SSETransport-BHdzk1HO.js → SSETransport-CD7R7FfS.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-CP6G9xhL.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-CmewX8Dv.js → SentryErrorBoundary-6dQQW6kh.js} +1 -1
- package/dist/chunks/SentryErrorBoundary-B2e3QmqR.js +1 -0
- package/dist/chunks/Settings-DgW58gbY.js +2 -0
- package/dist/chunks/{TeleportProgress-BmbhZlOg.js → TeleportProgress-D_USKi0I.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-C1-iWmRP.js +1 -0
- package/dist/chunks/{TeleportResumeWrapper-BlkvOdYn.js → TeleportResumeWrapper-BX9nUVsC.js} +1 -1
- package/dist/chunks/{ThemePicker-v_3lh136.js → ThemePicker-C0JghXSS.js} +1 -1
- package/dist/chunks/{TmuxBackend-B7Nabc5t.js → TmuxBackend-BxPiis2l.js} +1 -1
- package/dist/chunks/{TrustDialog-CHu5eoeR.js → TrustDialog-BZD-KGrA.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-BSMetgqr.js → ValidationErrorsList-CTFdkGiH.js} +1 -1
- package/dist/chunks/{WelcomeV2-DZfBSTu5.js → WelcomeV2-C7F1y8zh.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-CeSoQ_Nk.js → WindowsTerminalBackend-DLxmmXo4.js} +2 -2
- package/dist/chunks/{add-dir-7UeFZkdv.js → add-dir-Dhv9aEca.js} +1 -1
- package/dist/chunks/{agentDisplay-DJgsfIlm.js → agentDisplay-BoBFMmGh.js} +1 -1
- package/dist/chunks/{agents-DD7gQVZD.js → agents-Bt9kYpgi.js} +1 -1
- package/dist/chunks/{agents-DK0y9jId.js → agents-CdsfzK3E.js} +7 -7
- package/dist/chunks/{ant-PhgMZT08.js → ant-Bo6XJuE9.js} +1 -1
- package/dist/chunks/api-CRPzfBL5.js +1 -0
- package/dist/chunks/{api-nHsRf03G.js → api-CslgFoHj.js} +1 -1
- package/dist/chunks/{assistant-DO7RAhd3.js → assistant--L1Ll62G.js} +1 -1
- package/dist/chunks/assistant-DypEudjI.js +1 -0
- package/dist/chunks/{assistant-BJbeizyH.js → assistant-od6Nf6EJ.js} +1 -1
- package/dist/chunks/auth-BaaTtn3M.js +1 -0
- package/dist/chunks/{auth-DxRiJwZ-.js → auth-yKNn60lZ.js} +1 -1
- package/dist/chunks/{autoMode-BswSpjo5.js → autoMode-C4b9u7WQ.js} +6 -6
- package/dist/chunks/{autonomy-Lc78acHX.js → autonomy-7nZpCyNC.js} +12 -12
- package/dist/chunks/{autonomy-CNJQwoAQ.js → autonomy-rMsykUYN.js} +1 -1
- package/dist/chunks/{autonomyPanel-DxcumRp-.js → autonomyPanel-j0q1dMDj.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-DGAYPsK9.js +1 -0
- package/dist/chunks/backgroundHousekeeping-KCpR7i2h.js +17 -0
- package/dist/chunks/{branch-BPsUW1dk.js → branch-GL4WvvLa.js} +2 -2
- package/dist/chunks/{bridge-DcOGvDbb.js → bridge-BVzpVEsr.js} +2 -2
- package/dist/chunks/bridgeConfig-B1OTOi0O.js +1 -0
- package/dist/chunks/{bridgeConfig-CvKdNJOg.js → bridgeConfig-C110hgnb.js} +1 -1
- package/dist/chunks/{bridgeEnabled-D01faWms.js → bridgeEnabled-DrW-kkAr.js} +1 -1
- package/dist/chunks/bridgeEnabled-Zk2slA-p.js +1 -0
- package/dist/chunks/bridgeMain-C-MUVlCX.js +68 -0
- package/dist/chunks/bridgeMain-L1ScqrgM.js +1 -0
- package/dist/chunks/{bridgeMessaging-BZMDSZAN.js → bridgeMessaging-DobCpZGY.js} +1 -1
- package/dist/chunks/{btw-B8s-X_cm.js → btw-CSDRs-n8.js} +1 -1
- package/dist/chunks/{buddy-DkB1xU1o.js → buddy-D3Owb2U5.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-B9Qz9zKO.js → bypassPermissionsKillswitch-B_5qku-e.js} +1 -1
- package/dist/chunks/caches-CpgRh__l.js +1 -0
- package/dist/chunks/{caches-BuSzLvN9.js → caches-Di_WVMtD.js} +2 -2
- package/dist/chunks/{ccrClient-CMZXfu9P.js → ccrClient-CWH1f8Nk.js} +1 -1
- package/dist/chunks/changeDetector-DEStinxa.js +1 -0
- package/dist/chunks/channelNotification-DxAS15nL.js +1 -0
- package/dist/chunks/{channelNotification-t6Kgu-vX.js → channelNotification-Y5fNpq-B.js} +1 -1
- package/dist/chunks/{chrome-Cvkozg2F.js → chrome-Cgl-Sq1y.js} +1 -1
- package/dist/chunks/clear-Dja0RB_p.js +1 -0
- package/dist/chunks/client-DuWXRBa0.js +1 -0
- package/dist/chunks/color-tvVGbuuv.js +1 -0
- package/dist/chunks/commands-ElmJnxRE.js +1 -0
- package/dist/chunks/{commitAttribution-CUqUEjsh.js → commitAttribution-CedoNRL0.js} +1 -1
- package/dist/chunks/commitAttribution-D6vYpAMS.js +1 -0
- package/dist/chunks/compact-BwsLImWZ.js +3 -0
- package/dist/chunks/{companion-Cf_kYtOD.js → companion-C3hWMSgF.js} +1 -1
- package/dist/chunks/{config-45GLd-lt.js → config-BHCIawwx.js} +1 -1
- package/dist/chunks/{config-JGm0O-ZQ.js → config-Dh0QGc4B.js} +1 -1
- package/dist/chunks/{context-Bl5VUX5M.js → context-CSHiU4LG.js} +1 -1
- package/dist/chunks/{context-noninteractive-DdPFYYO9.js → context-noninteractive-CKFY_j1P.js} +2 -2
- package/dist/chunks/context-noninteractive-DirFwn0d.js +1 -0
- package/dist/chunks/conversation-DfIv8Jzc.js +1 -0
- package/dist/chunks/conversation-Dyb5kfil.js +1 -0
- package/dist/chunks/{copy-CbhxPqw4.js → copy-BSyDpOx5.js} +2 -2
- package/dist/chunks/{createSSHSession-Dq2nMChz.js → createSSHSession-PfzB7zZR.js} +1 -1
- package/dist/chunks/{createSession-DTHPUie-.js → createSession-Bk6r39b1.js} +1 -1
- package/dist/chunks/createSession-DdsaDZoq.js +1 -0
- package/dist/chunks/{cronJitterConfig-IGWCRDrv.js → cronJitterConfig-BFVNIkjD.js} +3 -3
- package/dist/chunks/crossProjectResume-CdoH1cwH.js +40 -0
- package/dist/chunks/{daemon-VYRit6Aq.js → daemon-CCtZ9wY3.js} +1 -1
- package/dist/chunks/{datadog-FKvRNyFi.js → datadog-By0GhDXI.js} +1 -1
- package/dist/chunks/datadog-CTRRIaBJ.js +1 -0
- package/dist/chunks/{desktop-ZASE3YWy.js → desktop-BV6CI329.js} +1 -1
- package/dist/chunks/{diff-QP-TbxuD.js → diff-qDuBFv-P.js} +1 -1
- package/dist/chunks/{doctor-DVkgmkRb.js → doctor-BtTsew-G.js} +1 -1
- package/dist/chunks/earlyInput-RoVleNEN.js +1 -0
- package/dist/chunks/{effort-DbryQCua.js → effort-DSpAOBeU.js} +2 -2
- package/dist/chunks/{entry-D8y42iuM.js → entry-CYCQJU7M.js} +8 -8
- package/dist/chunks/envLessBridgeConfig-B3o52JMX.js +1 -0
- package/dist/chunks/{envLessBridgeConfig-D4bSwf7w.js → envLessBridgeConfig-BKs6Mk4e.js} +1 -1
- package/dist/chunks/exit-BgaIlRuS.js +1 -0
- package/dist/chunks/{export-C9A9nOA1.js → export-BOQCWSMm.js} +1 -1
- package/dist/chunks/{exportRenderer-CyTuZFFF.js → exportRenderer-B-2J3ocI.js} +1 -1
- package/dist/chunks/extra-usage-BLVbAE1O.js +1 -0
- package/dist/chunks/{extra-usage-C6s5mXW0.js → extra-usage-S4WYpDn5.js} +1 -1
- package/dist/chunks/{extra-usage-core-BFCwz3XM.js → extra-usage-core-Sq4JALS7.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-IHq7s6wm.js → extra-usage-noninteractive-BlJVTTwe.js} +1 -1
- package/dist/chunks/{extraUsage-CIrG_Lbw.js → extraUsage-CMJ1LEPS.js} +1 -1
- package/dist/chunks/extractMemories-BpN0fQF-.js +1 -0
- package/dist/chunks/fast-B8a-zz4X.js +1 -0
- package/dist/chunks/{fast-NEKXVZqQ.js → fast-OzVowRYW.js} +1 -1
- package/dist/chunks/{feedback-D5iWO16P.js → feedback-BZet1Qu_.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-Dr3TK3IU.js → firstPartyEventLogger-DeytNcUC.js} +1 -1
- package/dist/chunks/{flushGate-DygHyqmB.js → flushGate-CeFJrqgK.js} +1 -1
- package/dist/chunks/{gates-Dyz_t5zJ.js → gates-Be4ovdxj.js} +1 -1
- package/dist/chunks/gates-WmmZ-8JT.js +1 -0
- package/dist/chunks/gemini-DExthrur.js +1 -0
- package/dist/chunks/{generateRecap-DZiXeYWn.js → generateRecap-BIFrnTIe.js} +1 -1
- package/dist/chunks/{generateSessionName-EbB2vl9t.js → generateSessionName-DlC0lhSv.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-dky2fPeU.js → githubRepoPathMapping-BKB2G52c.js} +1 -1
- package/dist/chunks/grok-BNxCseLh.js +1 -0
- package/dist/chunks/{growthbook-JD-WW3yV.js → growthbook-B3_MJJ45.js} +1 -1
- package/dist/chunks/{heapdump-8vyFTWly.js → heapdump-sPWpCjXq.js} +1 -1
- package/dist/chunks/{help-C2DM0p8U.js → help-BuUi6cM0.js} +1 -1
- package/dist/chunks/{hooks-CMh0a2pT.js → hooks-5vDlGpNp.js} +2 -2
- package/dist/chunks/hooks-CVJA4uQu.js +1 -0
- package/dist/chunks/{hostAdapter-CmbGfgNV.js → hostAdapter-BfBHV5nj.js} +1 -1
- package/dist/chunks/{ide-Bn8R7397.js → ide-DvUftvRn.js} +2 -2
- package/dist/chunks/inboundAttachments-CQyeysIk.js +1 -0
- package/dist/chunks/{inboundAttachments-BweY9sYo.js → inboundAttachments-CiF42Eku.js} +1 -1
- package/dist/chunks/initReplBridge-Bzg5Gx97.js +1 -0
- package/dist/chunks/{insights-NOl_PxhN.js → insights-CvwFcRQt.js} +64 -64
- package/dist/chunks/{install-github-app-SD4PvrTR.js → install-github-app-DxxG2VlZ.js} +2 -2
- package/dist/chunks/{install-slack-app-DLQXpOCt.js → install-slack-app-Bc5m1UFG.js} +1 -1
- package/dist/chunks/{install-BoT2GIcz.js → install-tclc0QHM.js} +1 -1
- package/dist/chunks/{instrumentation-BXJk0mxI.js → instrumentation-Dn_FDn6G.js} +3 -3
- package/dist/chunks/{job-CnlMlm3t.js → job-ssZ2ESAX.js} +1 -1
- package/dist/chunks/{keybindings-BjaRqcbD.js → keybindings-DVZlobLM.js} +2 -2
- package/dist/chunks/{lang-BI8CzjL6.js → lang-BQ--zwb1.js} +1 -1
- package/dist/chunks/language-BM5numKK.js +1 -0
- package/dist/chunks/{language-CRIdgj2F.js → language-CcxtaVJA.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-Bg9guiqy.js → launchAgentsPlatform-CLwlpK5C.js} +1 -1
- package/dist/chunks/{launchAutofixPr-BMfXGXwN.js → launchAutofixPr-vGLlC4Jm.js} +3 -3
- package/dist/chunks/{launchLocalMemory-lgnXOi6U.js → launchLocalMemory-DJ4pR8a2.js} +2 -2
- package/dist/chunks/{launchLocalVault-C0Oz-lto.js → launchLocalVault-Cl7Dds3W.js} +3 -3
- package/dist/chunks/{launchMemoryStores-Bw11ruRi.js → launchMemoryStores-Czk-a1P6.js} +1 -1
- package/dist/chunks/{launchOnboarding-WEW34cnl.js → launchOnboarding-66gN_781.js} +1 -1
- package/dist/chunks/{launchSchedule-X0rcM_kM.js → launchSchedule-Tx5efcfv.js} +1 -1
- package/dist/chunks/{launchSkillStore-DpxSlMCU.js → launchSkillStore-BGPd1KCD.js} +1 -1
- package/dist/chunks/{launchTeleport-uOtMsYcI.js → launchTeleport-DzXrNn2h.js} +2 -2
- package/dist/chunks/{launchVault-CJyJaPqH.js → launchVault-C5djf6XO.js} +1 -1
- package/dist/chunks/{loadAgentsDir-D-xcJ22-.js → loadAgentsDir-DaApSWNv.js} +807 -764
- package/dist/chunks/loadAgentsDir-_BePoo3r.js +1 -0
- package/dist/chunks/loadPluginHooks-GENkKqO8.js +1 -0
- package/dist/chunks/{localSearch-B6Ho7Vfj.js → localSearch-BQuH38SB.js} +1 -1
- package/dist/chunks/localSearch-BSR9byCr.js +1 -0
- package/dist/chunks/{login-uOvq1xN_.js → login-C64M5OdJ.js} +1 -1
- package/dist/chunks/login-dkrrvdEl.js +1 -0
- package/dist/chunks/{logoV2Utils-C2cdcgtp.js → logoV2Utils-D6ceZmK0.js} +1 -1
- package/dist/chunks/logout-BITK5qkB.js +1 -0
- package/dist/chunks/{magicDocs-BBjAhGN1.js → magicDocs-KPodA4bi.js} +2 -2
- package/dist/chunks/{main-DGsAUuG_.js → main-wb2H0Xbt.js} +48 -48
- package/dist/chunks/{mappers-CO6koWDa.js → mappers-D54WYYhL.js} +1 -1
- package/dist/chunks/mcp-Bgeq8jbd.js +6 -0
- package/dist/chunks/mcp-CJvRg7ft.js +2 -0
- package/dist/chunks/mcp-Ddvz5we7.js +1 -0
- package/dist/chunks/{mcpServer-C-0K3Azg.js → mcpServer-VYXTzAFl.js} +1 -1
- package/dist/chunks/{mcpServer-C_aDoLMg.js → mcpServer-d0863d94.js} +1 -1
- package/dist/chunks/memory-BNyVCuw9.js +1 -0
- package/dist/chunks/mode-D_L3DNsz.js +2 -0
- package/dist/chunks/model-DevOJk2A.js +1 -0
- package/dist/chunks/{model-CrAPXYZA.js → model-Dy_oUo2C.js} +1 -1
- package/dist/chunks/{onChangeAppState-C6ZIU1SD.js → onChangeAppState-GPs10FBm.js} +1 -1
- package/dist/chunks/{openai-Cm4gozk8.js → openai-C0CrRENO.js} +3 -3
- package/dist/chunks/{overageCreditGrant-Pe7C_4Qi.js → overageCreditGrant-DCiIf_SF.js} +1 -1
- package/dist/chunks/{panel-Bz_8td5D.js → panel-s9fbCKfl.js} +1 -1
- package/dist/chunks/{passes-BpI6azLG.js → passes-C9oR06Fa.js} +1 -1
- package/dist/chunks/{paths-D9CVAtXU.js → paths-BZbIj1Z1.js} +3 -3
- package/dist/chunks/permissions-DNb8DG22.js +3 -0
- package/dist/chunks/{pipeTransport-wjeyTgon.js → pipeTransport-Cx55TUNu.js} +1 -1
- package/dist/chunks/{plan-DA8IRpHQ.js → plan-D-RJTUxb.js} +1 -1
- package/dist/chunks/{plugin-N2pTkzOz.js → plugin-BV-DabiK.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-DCc5qDvo.js → pluginAutoupdate-DPciQRLz.js} +1 -1
- package/dist/chunks/pluginBlocklist-CtSUf3sp.js +1 -0
- package/dist/chunks/{pluginCliCommands-BN7loc5T.js → pluginCliCommands-Cbcc-AQq.js} +1 -1
- package/dist/chunks/{pluginFlagging-Dpu1cvMo.js → pluginFlagging-D2d7jd4v.js} +1 -1
- package/dist/chunks/pluginOperations-rU56uptC.js +2 -0
- package/dist/chunks/{pluginStartupCheck-DvWHwNnD.js → pluginStartupCheck-DuhCLRbp.js} +1 -1
- package/dist/chunks/pluginStartupCheck-DwY7j_Cg.js +1 -0
- package/dist/chunks/plugins-LbLpZOhz.js +4 -0
- package/dist/chunks/policyLimits-Dl863Z85.js +1 -0
- package/dist/chunks/{pollConfig-xYxAmuXi.js → pollConfig-orFqIbGd.js} +1 -1
- package/dist/chunks/{poor-C0KwfFF0.js → poor-2u_yWIRG.js} +1 -1
- package/dist/chunks/poorMode-BBr7GGQ3.js +1 -0
- package/dist/chunks/{poorMode-D7WXWZtJ.js → poorMode-DtQVZvON.js} +1 -1
- package/dist/chunks/print-BgLbepaC.js +39 -0
- package/dist/chunks/{privacy-settings-DT3LGgsH.js → privacy-settings-CC_FyvjV.js} +1 -1
- package/dist/chunks/processBashCommand-DnekNzlT.js +1 -0
- package/dist/chunks/processSlashCommand-sLL0pyIW.js +6 -0
- package/dist/chunks/{projectContext-0fpRKUeH.js → projectContext-D5FgyE-d.js} +1 -1
- package/dist/chunks/{prompt-C69iv9cI.js → prompt-DHHypkUR.js} +1 -1
- package/dist/chunks/prompt-Dexwn9YP.js +1 -0
- package/dist/chunks/prompt-DhaPVt1T.js +1 -0
- package/dist/chunks/{promptEditor-BZqpLrcZ.js → promptEditor-I8ZpszKv.js} +2 -2
- package/dist/chunks/{protocolHandler-CfmBTg36.js → protocolHandler-CEsrhel_.js} +1 -1
- package/dist/chunks/rate-limit-options-B0Iyzr4x.js +1 -0
- package/dist/chunks/{rcDebugLog-CTOZ2K3E.js → rcDebugLog-CF73Wofq.js} +1 -1
- package/dist/chunks/{referral-D26orIXE.js → referral-Nz20w4pB.js} +1 -1
- package/dist/chunks/refresh-DecpoOX1.js +1 -0
- package/dist/chunks/{registerProtocol-DSQh-I21.js → registerProtocol-CAoaYyt8.js} +1 -1
- package/dist/chunks/registry-BQdQRu-K.js +1 -0
- package/dist/chunks/{release-notes-Cg85UVo8.js → release-notes-C0HeOmQY.js} +1 -1
- package/dist/chunks/{releaseNotes-Dps4SeVh.js → releaseNotes-BDzfbUAu.js} +2 -2
- package/dist/chunks/{reload-plugins-Bo-R1CF3.js → reload-plugins-BZ4LTYY3.js} +1 -1
- package/dist/chunks/{remote-env-ChQuV3rO.js → remote-env-CPalv-BL.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-BXtygJA-.js → remoteBridgeCore-B2yFfG6S.js} +1 -1
- package/dist/chunks/{remoteControlServer-sqW_JLwC.js → remoteControlServer-CsnLedUv.js} +2 -2
- package/dist/chunks/rename-CQPtjj_Q.js +1 -0
- package/dist/chunks/{resume-CtOI2pOJ.js → resume-Ycuezjv2.js} +2 -2
- package/dist/chunks/{runtimeObserver-DojpbVgU.js → runtimeObserver-CW0_wm1t.js} +1 -1
- package/dist/chunks/{runtimeObserver-CJ955XSo.js → runtimeObserver-DnhLm9O1.js} +3 -3
- package/dist/chunks/sandbox-adapter-BOsa-en7.js +1 -0
- package/dist/chunks/{sandbox-toggle-B9dn09gt.js → sandbox-toggle-Bl5Drxeo.js} +1 -1
- package/dist/chunks/searchExtraTools-CgdrY8XO.js +1 -0
- package/dist/chunks/{sentry-B6tWUNGj.js → sentry-BN3GTgYM.js} +1 -1
- package/dist/chunks/{session-C5yIf_zV.js → session-ULekTZVn.js} +2 -2
- package/dist/chunks/{sessionDiscovery-CQ3iMN4s.js → sessionDiscovery-DAmbR6o-.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-C-o5001P.js +1 -0
- package/dist/chunks/sessionMemory-Bg458voj.js +1 -0
- package/dist/chunks/sessionMemory-DR-esdhZ.js +1 -0
- package/dist/chunks/sessionMemoryUtils-DgVGiwjB.js +1 -0
- package/dist/chunks/sessionObserver-C5cujEe6.js +1 -0
- package/dist/chunks/{sessionObserver-MQA9_wZw.js → sessionObserver-CQ3PQWgU.js} +1 -1
- package/dist/chunks/sessionStorage-BIDUQ8wo.js +1 -0
- package/dist/chunks/{sessionTitle-BafqFHLc.js → sessionTitle-DyexSH43.js} +1 -1
- package/dist/chunks/{sessionTracing-_obALZbi.js → sessionTracing-gKle2qzF.js} +1 -1
- package/dist/chunks/{settingsSync-DBWi-NXU.js → settingsSync-BWW4FOMm.js} +1 -1
- package/dist/chunks/{setup-DIxsjw17.js → setup-DX6984LY.js} +1 -1
- package/dist/chunks/setup-OvlOCIFL.js +2 -0
- package/dist/chunks/{setup-C_GrS0Rd.js → setup-n91rSYO2.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-CwMwv9uM.js → shadowedRuleDetection-uYIZBoii.js} +1 -1
- package/dist/chunks/{sideQuestion-CI5pyoQF.js → sideQuestion-DIMsNoEc.js} +2 -2
- package/dist/chunks/sink-BBn0HwoH.js +1 -0
- package/dist/chunks/{sink-BSTUubjl.js → sink-DLRpC2qX.js} +1 -1
- package/dist/chunks/{sinks-B9EsWFeb.js → sinks-BI1hGD9c.js} +2 -2
- package/dist/chunks/sinks-DKGE2sSC.js +1 -0
- package/dist/chunks/{skill-learning-DThetLpo.js → skill-learning-Dz-Zq-xT.js} +1 -1
- package/dist/chunks/skillChangeDetector-C2Te20cK.js +1 -0
- package/dist/chunks/{skillGapStore-BmjCK9ZR.js → skillGapStore-BFpryJIe.js} +2 -2
- package/dist/chunks/{skillGapStore-ax0GuSmd.js → skillGapStore-CxPjoWci.js} +1 -1
- package/dist/chunks/{skillGenerator-Dj3xInwG.js → skillGenerator-BGOIb5p-.js} +2 -2
- package/dist/chunks/skillLearning-BRvWwB8E.js +1 -0
- package/dist/chunks/skillLearning-DTo7lCKd.js +1 -0
- package/dist/chunks/{skillPanel-CJ4tvX7A.js → skillPanel-DzYZLnuH.js} +3 -3
- package/dist/chunks/{skillSearchPanel-hwZvXKZ4.js → skillSearchPanel-DrysL5R-.js} +3 -3
- package/dist/chunks/{skills-BVWDDcD9.js → skills-CTfNqisc.js} +1 -1
- package/dist/chunks/{sprites-B-V9otkt.js → sprites-CHzZCAGE.js} +1 -1
- package/dist/chunks/{stats-DcS6ZnsX.js → stats-D2s-hIY8.js} +1 -1
- package/dist/chunks/{status-DZKjK9CE.js → status-XxrX2kHw.js} +1 -1
- package/dist/chunks/statusNoticeHelpers-CUm1pflC.js +1 -0
- package/dist/chunks/{tag-B5b-waIf.js → tag-FV031rKW.js} +2 -2
- package/dist/chunks/{tasks-vXM-vULI.js → tasks-aK2rp8CW.js} +1 -1
- package/dist/chunks/{teamHelpers-CbFFdvPw.js → teamHelpers-2m66Mr8w.js} +1 -1
- package/dist/chunks/teamHelpers-Bg3nHlWr.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-DkkMv2-b.js → teammateModeSnapshot-BtdUJBKp.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-VojvAMbR.js +1 -0
- package/dist/chunks/teleport-4x9eIl8c.js +1 -0
- package/dist/chunks/{templateJobs-BLQqrGjb.js → templateJobs-fEz4DGWh.js} +1 -1
- package/dist/chunks/{terminalSetup-BLU99dau.js → terminalSetup-Cjdlcznm.js} +1 -1
- package/dist/chunks/{terminalSetup-BKfVYk3w.js → terminalSetup-EirH-l0a.js} +1 -1
- package/dist/chunks/{theme-BM2CXWYE.js → theme-BjdEyakL.js} +1 -1
- package/dist/chunks/thinkback-CrW3VlCR.js +1 -0
- package/dist/chunks/thinkback-DHyz-lmU.js +1 -0
- package/dist/chunks/thinkback-play-B46ystVF.js +1 -0
- package/dist/chunks/{toolEventObserver-nxcfjaur.js → toolEventObserver-CJ68x4wM.js} +1 -1
- package/dist/chunks/{toolEventObserver-71WYUega.js → toolEventObserver-Dak6ETA6.js} +1 -1
- package/dist/chunks/toolPool-3CMCh3QU.js +1 -0
- package/dist/chunks/toolPool-BHdCDihh.js +1 -0
- package/dist/chunks/{trustedDevice-C0KJ0qiK.js → trustedDevice-QhApqKq4.js} +1 -1
- package/dist/chunks/{trustedDevice-Brc9B8cZ.js → trustedDevice-oDn6E85N.js} +1 -1
- package/dist/chunks/{tui-BVc2q4Xv.js → tui-geoc3zxu.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-BY0T8Pzl.js → ultrareviewCommand-Ar9zzqz4.js} +2 -2
- package/dist/chunks/undercover-D1ieJ54D.js +1 -0
- package/dist/chunks/{undercover-j27F8p49.js → undercover-DZq2Tf-o.js} +1 -1
- package/dist/chunks/{updateCCB-Dgb2ed9v.js → updateCCB-Db3CfFcn.js} +1 -1
- package/dist/chunks/upgrade-B28O0zeQ.js +1 -0
- package/dist/chunks/{upgrade-zs7K9UkG.js → upgrade-BZvNOhEJ.js} +1 -1
- package/dist/chunks/{upload-Df84yCBz.js → upload-DAmbsBq4.js} +1 -1
- package/dist/chunks/{usage-DKENFl_k.js → usage-COv9UCxX.js} +1 -1
- package/dist/chunks/{usage-lTILrQJV.js → usage-Dtv3YQf8.js} +1 -1
- package/dist/chunks/useMainLoopModel-BpM3dlzJ.js +1 -0
- package/dist/chunks/{useManagePlugins-DDKeDfIv.js → useManagePlugins-DZ-_Ll9E.js} +1 -1
- package/dist/chunks/useMergedTools-INKnp2ij.js +1 -0
- package/dist/chunks/{useSearchInput-DNpNG36H.js → useSearchInput-DobM3JKI.js} +1 -1
- package/dist/chunks/useSettingsErrors-DjvaCC5-.js +1 -0
- package/dist/chunks/{useVoice-DmObXoAh.js → useVoice-exDfbv1t.js} +1 -1
- package/dist/chunks/{util-9vJ9WIeZ.js → util-CDzNDmax.js} +1 -1
- package/dist/chunks/utils-B0iiiW_p.js +1 -0
- package/dist/chunks/validatePlugin-DaLnfLSC.js +1 -0
- package/dist/chunks/{vim-CK7lReJi.js → vim-CPKu15l_.js} +1 -1
- package/dist/chunks/{voice-BLVF7E3Q.js → voice-gNxUce-I.js} +2 -2
- package/dist/chunks/voiceModeEnabled-CwPbMJ9C.js +1 -0
- package/dist/chunks/{voiceModeEnabled-BpLBjY2-.js → voiceModeEnabled-DEwGjUP6.js} +1 -1
- package/dist/chunks/voiceStreamSTT-6b3Oslnl.js +1 -0
- package/dist/chunks/{voiceStreamSTT-i4tUq3Hu.js → voiceStreamSTT-BjX-mTB_.js} +1 -1
- package/dist/chunks/{workerRegistry-Bg7dWLHf.js → workerRegistry-Bc6t6VlK.js} +1 -1
- package/dist/chunks/worktree-NnuvJmoP.js +1 -0
- package/dist/chunks/{xml-K_hNNh2b.js → xml-Dg8-vY8G.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-BtiWOryM.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-5RpkAbJz.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Dje7A0F2.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-DQf3dmj6.js +0 -1
- package/dist/chunks/Doctor-ButdpAkf.js +0 -1
- package/dist/chunks/Doctor-QVMo0fIh.js +0 -3
- package/dist/chunks/Grove-CmdRVv9F.js +0 -1
- package/dist/chunks/MCPConnectionManager-D2eAGUME.js +0 -1
- package/dist/chunks/MessageSelector-Bzq8CYAH.js +0 -3
- package/dist/chunks/Messages-uRxxAMW-.js +0 -11
- package/dist/chunks/QueryEngine-CxP2S3qi.js +0 -1
- package/dist/chunks/REPL-h1bwm8ee.js +0 -1
- package/dist/chunks/ResumeConversation-CagiCg7-.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BJ2d8mtx.js +0 -1
- package/dist/chunks/SentryErrorBoundary-CYiFofRZ.js +0 -1
- package/dist/chunks/Settings-BcgtW60l.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-BAwtgUhR.js +0 -1
- package/dist/chunks/api-D4aCzJS-.js +0 -1
- package/dist/chunks/assistant-Dvx-UrTi.js +0 -1
- package/dist/chunks/auth-Cp7Nt0ik.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BkfWgzIP.js +0 -17
- package/dist/chunks/backgroundHousekeeping-BxBI2KkX.js +0 -1
- package/dist/chunks/bridgeConfig-Dkn5GGec.js +0 -1
- package/dist/chunks/bridgeEnabled-CjaYKTo5.js +0 -1
- package/dist/chunks/bridgeMain-Bu2oOX31.js +0 -68
- package/dist/chunks/bridgeMain-CEpOBx8Z.js +0 -1
- package/dist/chunks/caches-Bvl2jdxF.js +0 -1
- package/dist/chunks/changeDetector-DTXMv7gH.js +0 -1
- package/dist/chunks/channelNotification-B7s1OoRK.js +0 -1
- package/dist/chunks/clear-C9pufI6F.js +0 -1
- package/dist/chunks/client-CqJ5gRGj.js +0 -1
- package/dist/chunks/color-AYeAYKyq.js +0 -1
- package/dist/chunks/commands-LcLR5Vgx.js +0 -1
- package/dist/chunks/commitAttribution-BZupnGMc.js +0 -1
- package/dist/chunks/compact-BF0-0_qh.js +0 -3
- package/dist/chunks/context-noninteractive-BtzPsJ8k.js +0 -1
- package/dist/chunks/conversation-C3NWyOB3.js +0 -1
- package/dist/chunks/conversation-oX932vBQ.js +0 -1
- package/dist/chunks/createSession-1ewHG3eq.js +0 -1
- package/dist/chunks/crossProjectResume-WmabPBTO.js +0 -40
- package/dist/chunks/datadog-Da7KYZNF.js +0 -1
- package/dist/chunks/earlyInput-JGJo1zcC.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CpW0G4Eh.js +0 -1
- package/dist/chunks/exit-BsNW67F9.js +0 -1
- package/dist/chunks/extra-usage-DL2C0_BM.js +0 -1
- package/dist/chunks/extractMemories-CA2eJwHy.js +0 -1
- package/dist/chunks/fast-B01NO2uA.js +0 -1
- package/dist/chunks/gates-BSpXbh9s.js +0 -1
- package/dist/chunks/gemini-BEmbnRQR.js +0 -1
- package/dist/chunks/grok-BM6ZJ4w2.js +0 -1
- package/dist/chunks/hooks-QXGwOfWj.js +0 -1
- package/dist/chunks/inboundAttachments-N5DKbZSl.js +0 -1
- package/dist/chunks/initReplBridge-3CfmzjJL.js +0 -1
- package/dist/chunks/language-DmbRGIs8.js +0 -1
- package/dist/chunks/loadAgentsDir-ILQxk_4G.js +0 -1
- package/dist/chunks/loadPluginHooks-BC1Ea7_D.js +0 -1
- package/dist/chunks/localSearch-COyJeP9E.js +0 -1
- package/dist/chunks/login-Cf89biEK.js +0 -1
- package/dist/chunks/logout-CEXwTlEX.js +0 -1
- package/dist/chunks/mcp-BrN_Tbq5.js +0 -6
- package/dist/chunks/mcp-CZltNml5.js +0 -1
- package/dist/chunks/mcp-D6JOqdT8.js +0 -2
- package/dist/chunks/memory-BYYOgo4e.js +0 -1
- package/dist/chunks/model-CHgqwg6N.js +0 -1
- package/dist/chunks/permissions-C7wcAYOc.js +0 -3
- package/dist/chunks/pluginBlocklist-C_Veew3p.js +0 -1
- package/dist/chunks/pluginOperations-CP6NFNog.js +0 -2
- package/dist/chunks/pluginStartupCheck-BF0xUEJG.js +0 -1
- package/dist/chunks/plugins-BHoniP5f.js +0 -4
- package/dist/chunks/policyLimits-sh7ywop0.js +0 -1
- package/dist/chunks/poorMode-DZQXZ_zu.js +0 -1
- package/dist/chunks/print-BcRG8gkQ.js +0 -39
- package/dist/chunks/processBashCommand-DPfJ9lrj.js +0 -1
- package/dist/chunks/processSlashCommand-DyPCeZux.js +0 -6
- package/dist/chunks/prompt-DaIJzI1P.js +0 -1
- package/dist/chunks/prompt-DnLsyywj.js +0 -1
- package/dist/chunks/rate-limit-options-P7oQuwrl.js +0 -1
- package/dist/chunks/refresh-BeSXaVya.js +0 -1
- package/dist/chunks/registry-Dp5W2V8B.js +0 -1
- package/dist/chunks/rename-Bigaipiq.js +0 -1
- package/dist/chunks/sandbox-adapter-BbrJOJNZ.js +0 -1
- package/dist/chunks/searchExtraTools-Denn1c1E.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-1IAwziOQ.js +0 -1
- package/dist/chunks/sessionMemory-3TAJyNuJ.js +0 -1
- package/dist/chunks/sessionMemory-HZNzEOLd.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BAkA4sGG.js +0 -1
- package/dist/chunks/sessionObserver-DqLMFMLM.js +0 -1
- package/dist/chunks/sessionStorage-CFfMypMQ.js +0 -1
- package/dist/chunks/setup-D1sQnli9.js +0 -2
- package/dist/chunks/sink-fGBOXJab.js +0 -1
- package/dist/chunks/sinks-BCl9slVM.js +0 -1
- package/dist/chunks/skillChangeDetector-BOH-fyEn.js +0 -1
- package/dist/chunks/skillLearning-BDsjN-u-.js +0 -1
- package/dist/chunks/skillLearning-CXUsWxdi.js +0 -1
- package/dist/chunks/statusNoticeHelpers-reCcymMR.js +0 -1
- package/dist/chunks/teamHelpers-BBhol4dD.js +0 -1
- package/dist/chunks/teammateModeSnapshot-W5G22rwQ.js +0 -1
- package/dist/chunks/teleport-Da0rKwCo.js +0 -1
- package/dist/chunks/thinkback-Cd1g_2A9.js +0 -1
- package/dist/chunks/thinkback-ChP6pvCS.js +0 -1
- package/dist/chunks/thinkback-play-Cg8Ys2dq.js +0 -1
- package/dist/chunks/toolPool-CN1cPGQz.js +0 -1
- package/dist/chunks/toolPool-CygNb5cr.js +0 -1
- package/dist/chunks/undercover-bx8TwG9W.js +0 -1
- package/dist/chunks/upgrade-BkHztwGA.js +0 -1
- package/dist/chunks/useMainLoopModel-X1PW9z5A.js +0 -1
- package/dist/chunks/useMergedTools-CC3XwtOR.js +0 -1
- package/dist/chunks/useSettingsErrors-vGzCYpIA.js +0 -1
- package/dist/chunks/utils-Dg0S2Vfn.js +0 -1
- package/dist/chunks/validatePlugin-_Z4zhjSx.js +0 -1
- package/dist/chunks/voiceModeEnabled-BqFYzoXw.js +0 -1
- package/dist/chunks/voiceStreamSTT-C0pkuXGm.js +0 -1
- package/dist/chunks/worktree-Cg4p1J__.js +0 -1
- /package/dist/chunks/{InProcessTransport-DB52dh4f.js → InProcessTransport-gJLr5CIx.js} +0 -0
- /package/dist/chunks/{attributionHooks-PygdohOh.js → attributionHooks-Br5LZ6bk.js} +0 -0
- /package/dist/chunks/{attributionTrailer-BpvhXgRP.js → attributionTrailer-BMTuK4Ax.js} +0 -0
- /package/dist/chunks/{autoModeDenials-Cp6VFdsm.js → autoModeDenials-D8eQ1CoM.js} +0 -0
- /package/dist/chunks/{banner-CVXH2xts.js → banner-32EBTKI7.js} +0 -0
- /package/dist/chunks/{bedrockClient-qi1-JCOK.js → bedrockClient-Ci523Btx.js} +0 -0
- /package/dist/chunks/{ccshareResume-DWLjTF22.js → ccshareResume-CqNm2k-J.js} +0 -0
- /package/dist/chunks/{chromeNativeHost-4U39yLtd.js → chromeNativeHost-DX8f9Y2L.js} +0 -0
- /package/dist/chunks/{claudeDesktop-D0S1eq1F.js → claudeDesktop-C1qQs6os.js} +0 -0
- /package/dist/chunks/{cleanup-Bg_gFgcj.js → cleanup-Pv6U3HiI.js} +0 -0
- /package/dist/chunks/{connectHeadless-CwsFt-Mh.js → connectHeadless-DFCrE6O4.js} +0 -0
- /package/dist/chunks/{dangerousBackend-BU_PHGR2.js → dangerousBackend-Du0K4q5Z.js} +0 -0
- /package/dist/chunks/{earlyInput-tRkbxFv2.js → earlyInput-feVuZGzR.js} +0 -0
- /package/dist/chunks/{eventLoopStallDetector-Dnh1fc31.js → eventLoopStallDetector-XfubcyMN.js} +0 -0
- /package/dist/chunks/{fpsMetrics-DeezdcwV.js → fpsMetrics-CEQt6Tk1.js} +0 -0
- /package/dist/chunks/{fuse-Ch_OAlm3.js → fuse-TM-TeOo_.js} +0 -0
- /package/dist/chunks/{instinctParser-DHMa8xa0.js → instinctParser-CJPM8VjX.js} +0 -0
- /package/dist/chunks/{lockfile-DBwdlC3K.js → lockfile-Y1hwdHrQ.js} +0 -0
- /package/dist/chunks/{main-C6be1KFk.js → main-D9fUXJiD.js} +0 -0
- /package/dist/chunks/{observationStore-tvkldXUo.js → observationStore-gFvWXJmc.js} +0 -0
- /package/dist/chunks/{openaiShared-Bjrci9n8.js → openaiShared-Dy78YERG.js} +0 -0
- /package/dist/chunks/{output-style-XDb9-2Kk.js → output-style-BmEQscMd.js} +0 -0
- /package/dist/chunks/{parseConnectUrl-BS6i9JPo.js → parseConnectUrl-C6cvMkkH.js} +0 -0
- /package/dist/chunks/{poller-Ds0Y6Cir.js → poller-Dbo07OEA.js} +0 -0
- /package/dist/chunks/{postCommitAttribution-Ehmwzzuq.js → postCommitAttribution-DhFkZMxJ.js} +0 -0
- /package/dist/chunks/{projectContext-eXMSfgdZ.js → projectContext-iWPqcl0Z.js} +0 -0
- /package/dist/chunks/{renderOptions-BiyC2rj1.js → renderOptions-rmj4Mkls.js} +0 -0
- /package/dist/chunks/{rewind-CXplHgh_.js → rewind-DAn-nNs-.js} +0 -0
- /package/dist/chunks/{sanitization-CYp-9DbE.js → sanitization-JYRkZFrK.js} +0 -0
- /package/dist/chunks/{sdkHeapDumpMonitor--fevrC5z.js → sdkHeapDumpMonitor-DKtfJW5o.js} +0 -0
- /package/dist/chunks/{server-C5XZSlto.js → server-CswFAYwN.js} +0 -0
- /package/dist/chunks/{serverBanner-WlSYP-f8.js → serverBanner-CImTYGhY.js} +0 -0
- /package/dist/chunks/{serverLog-DtsUvDiY.js → serverLog-Bwt7XEmk.js} +0 -0
- /package/dist/chunks/{sessionDataUploader-Ctjo1bgR.js → sessionDataUploader-CKRXCBxI.js} +0 -0
- /package/dist/chunks/{sessionManager-Dw72ZUTg.js → sessionManager-Ca2O821f.js} +0 -0
- /package/dist/chunks/{stickers-2K05wjSp.js → stickers-BMh2qjgF.js} +0 -0
- /package/dist/chunks/{udsClient-BvG_Jip0.js → udsClient-BdPOrL1H.js} +0 -0
- /package/dist/chunks/{upstreamproxy-DcLeL2XX.js → upstreamproxy-Ci5T_JCo.js} +0 -0
- /package/dist/chunks/{voice-DXiiy8HX.js → voice-BcA5h8ya.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as ee,kt as v,nn as y,un as b,vt as te,wn as x}from"./schemas-BGAvj1T4.js";import{t as ne}from"./v4-f1i_CNUT.js";import{Tt as re,cn as ie,jr as S,lr as C}from"./state-sIHsFpDu.js";import{Ac as ae,Dr as oe,Pr as se,_c as ce,no as le,oo as ue}from"./paths-D9CVAtXU.js";import{l as de,p as fe}from"./sessionStoragePortable-DJZ_6cL8.js";import{Ar as pe,Cv as me,G as he,Gi as ge,JE as _e,K as ve,Ku as ye,Of as be,Xi as xe,YE as Se,_r as Ce,fp as we,i as Te,kf as Ee,o as De,pp as Oe,qu as ke,va as Ae,wv as je,ya as Me}from"./loadAgentsDir-D-xcJ22-.js";import{Bn as Ne,Vn as Pe}from"./prompt-C69iv9cI.js";import{o as Fe,t as Ie}from"./fileStateCache-C7-TxF8G.js";import{t as Le}from"./QueryEngine-CxP2S3qi.js";import*as w from"node:path";import{dirname as Re}from"node:path";import{randomUUID as ze}from"node:crypto";import{Readable as Be,Writable as Ve}from"node:stream";ne();var T={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`},E={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`},He=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ue=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),We=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ge=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ue)}),Ke=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),qe=_([Ge.and(x({type:b(`env_var`)})),Ke.and(x({type:b(`terminal`)})),We]),Je=x({_meta:m(p(),g()).nullish(),methodId:p()}),Ye=x({_meta:m(p(),g()).nullish()}),Xe=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ze=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),Qe=x({_meta:m(p(),g()).nullish()}),$e=x({_meta:m(p(),g()).nullish()}),et=x({amount:f(),currency:p()}),tt=x({_meta:m(p(),g()).nullish(),terminalId:p()}),nt=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),rt=_([p(),f(),f(),v(),h(p())]),it=y(_([x({content:m(p(),rt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),at=x({_meta:m(p(),g()).nullish()}),ot=p(),st=x({_meta:m(p(),g()).nullish(),elicitationId:ot}),ct=b(`object`),lt=b(`string`),ut=x({_meta:m(p(),g()).nullish()}),dt=x({_meta:m(p(),g()).nullish(),form:at.nullish(),url:ut.nullish()}),ft=x({const:p(),title:p()}),pt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),mt=x({code:_([b(-32700),b(-32600),b(-32601),b(-32602),b(-32603),b(-32800),b(-32e3),b(-32002),b(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),ht=g(),gt=g(),_t=g(),vt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),xt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),St=x({_meta:m(p(),g()).nullish()}),Ct=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),wt=x({_meta:m(p(),g()).nullish()}),Tt=x({_meta:m(p(),g()).nullish(),logout:wt.nullish()}),Et=x({_meta:m(p(),g()).nullish()}),Dt=x({_meta:m(p(),g()).nullish()}),Ot=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),kt=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),At=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),jt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(pt),name:p()}),D=_([kt.and(x({type:b(`http`)})),At.and(x({type:b(`sse`)})),jt]),O=p(),Mt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:O,name:p()}),Nt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Pt=x({_meta:m(p(),g()).nullish()}),Ft=x({_meta:m(p(),g()).nullish()}),It=x({_meta:m(p(),g()).nullish()}),Lt=x({_meta:m(p(),g()).nullish()}),Rt=x({_meta:m(p(),g()).nullish()}),zt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=x({diff:p(),uri:p()}),Vt=x({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({languageId:p(),text:p(),uri:p()}),Gt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),qt=x({excerpts:h(Vt),uri:p()}),Jt=x({_meta:m(p(),g()).nullish()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({name:p(),owner:p(),remoteUrl:p()}),Zt=x({_meta:m(p(),g()).nullish()}),Qt=x({_meta:m(p(),g()).nullish(),jump:Ht.nullish(),rename:Yt.nullish(),searchAndReplace:Zt.nullish()}),$t=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),en=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),tn=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),nn=x({_meta:m(p(),g()).nullish(),diagnostics:Pt.nullish(),editHistory:zt.nullish(),openFiles:Ut.nullish(),recentFiles:Gt.nullish(),relatedSnippets:Jt.nullish(),userActions:tn.nullish()}),rn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),an=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),on=p(),sn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),cn=x({_meta:m(p(),g()).nullish(),kind:sn,name:p(),optionId:on}),ln=_([b(`high`),b(`medium`),b(`low`)]),un=_([b(`pending`),b(`in_progress`),b(`completed`)]),dn=x({_meta:m(p(),g()).nullish(),content:p(),priority:ln,status:un}),fn=x({_meta:m(p(),g()).nullish(),entries:h(dn)}),k=x({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),pn=x({id:p(),position:k,uri:p()}),mn=x({id:p(),newName:p(),position:k,uri:p()}),hn=x({action:p(),position:k,timestampMs:f(),uri:p()}),gn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),_n=x({_meta:m(p(),g()).nullish(),auth:He.optional().default({terminal:!1}),elicitation:dt.nullish(),fs:vt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Qt.nullish(),positionEncodings:h(gn).optional(),terminal:v().optional().default(!1)}),vn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),yn=f().int().gte(0).lte(65535),bn=x({_meta:m(p(),g()).nullish(),clientCapabilities:_n.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:bt.nullish(),protocolVersion:yn}),A=x({end:k,start:k}),xn=x({message:p(),range:A,severity:Nt,uri:p()}),Sn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),Cn=x({_meta:m(p(),g()).nullish(),diagnostics:h(xn).nullish(),editHistory:h(Bt).nullish(),openFiles:h(Sn).nullish(),recentFiles:h(Wt).nullish(),relatedSnippets:h(qt).nullish(),userActions:h(hn).nullish()}),wn=x({newText:p(),range:A}),Tn=_([x({cursorPosition:k.nullish(),edits:h(wn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),pn.and(x({kind:b(`jump`)})),mn.and(x({kind:b(`rename`)})),$t.and(x({kind:b(`searchAndReplace`)}))]),En=x({_meta:m(p(),g()).nullish(),content:p()}),Dn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var On=x({requestId:j}),kn=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(kn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),An=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),jn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),Mn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Nn=x({_meta:m(p(),g()).nullish(),optionId:on}),Pn=_([x({outcome:b(`cancelled`)}),Nn.and(x({outcome:b(`selected`)}))]),Fn=x({_meta:m(p(),g()).nullish(),outcome:Pn}),In=x({_meta:m(p(),g()).nullish()}),Ln=x({_meta:m(p(),g()).nullish()}),Rn=x({currentValue:v()}),zn=p(),Bn=p(),Vn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),N=p(),Hn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:N}),Un=x({_meta:m(p(),g()).nullish(),group:zn,name:p(),options:h(Hn)}),P=y(_([x({currentValue:N,options:_([h(Hn),h(Un)])}).and(x({type:b(`select`)})),Rn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Vn.nullish(),description:p().nullish(),id:Bn,name:p()})),Wn=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Gn=x({_meta:m(p(),g()).nullish()}),F=p(),Kn=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:F}),qn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Jn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Yn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Xn=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(pt).optional(),outputByteLimit:f().nullish(),sessionId:F}),Zn=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),Qn=x({_meta:m(p(),g()).nullish(),position:k,sessionId:F,uri:p(),version:f(),visibleRange:A}),$n=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:F,text:p(),uri:p(),version:f()}),er=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),tr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),nr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),rr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:F}),ir=x({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:F}),ar=x({_meta:m(p(),g()).nullish(),id:p(),reason:Kt.nullish(),sessionId:F}),or=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),sr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),cr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:F,title:p().nullish(),updatedAt:p().nullish()}),lr=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=x({_meta:m(p(),g()).nullish()}),I=p(),fr=x({_meta:m(p(),g()).nullish(),currentModeId:I}),pr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:I,name:p()}),L=x({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:I}),R=x({_meta:m(p(),g()).nullish(),availableModels:h(Mt),currentModelId:O}),mr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),hr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),gr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),_r=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),vr=x({_meta:m(p(),g()).nullish()}),yr=x({_meta:m(p(),g()).nullish(),additionalDirectories:In.nullish(),close:Ln.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=y(_([x({type:b(`boolean`),value:v()}),x({value:N})]),x({_meta:m(p(),g()).nullish(),configId:Bn,sessionId:F})),xr=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Sr=x({_meta:m(p(),g()).nullish(),modeId:I,sessionId:F}),Cr=x({_meta:m(p(),g()).nullish()}),wr=x({_meta:m(p(),g()).nullish(),modelId:O,sessionId:F}),Tr=x({_meta:m(p(),g()).nullish()}),Er=x({_meta:m(p(),g()).nullish(),sessionId:F}),Dr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Or=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),kr=x({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:Or.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(ft).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=x({_meta:m(p(),g()).nullish(),context:Cn.nullish(),position:k,selection:A.nullish(),sessionId:F,triggerKind:en,uri:p(),version:f()}),jr=x({_meta:m(p(),g()).nullish(),suggestions:h(Tn)}),Mr=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Pr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),Fr=x({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:v()}),Ir=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Lr=x({range:A.nullish(),text:p()}),Rr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:F,uri:p(),version:f()});x({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,ht]).nullish()});var zr=_([b(`full`),b(`incremental`)]),Br=x({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=x({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Ft.nullish(),didFocus:It.nullish(),didOpen:Lt.nullish(),didSave:Rt.nullish()}),Hr=x({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=x({_meta:m(p(),g()).nullish(),context:nn.nullish(),events:Hr.nullish()}),Wr=x({_meta:m(p(),g()).nullish(),auth:Tt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Ot.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:gn.nullish(),promptCapabilities:vn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=x({_meta:m(p(),g()).nullish(),agentCapabilities:Wr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:bt.nullish(),authMethods:h(qe).optional().default([]),protocolVersion:yn}),Kr=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Xe]),qr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:Kr}),z=_([Ir.and(x({type:b(`text`)})),jn.and(x({type:b(`image`)})),An.and(x({type:b(`audio`)})),Mn.and(x({type:b(`resource_link`)})),qr.and(x({type:b(`resource`)}))]),Jr=x({_meta:m(p(),g()).nullish(),content:z}),B=x({_meta:m(p(),g()).nullish(),content:z,messageId:p().nullish()}),Yr=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(z),sessionId:F}),Xr=x({anyOf:h(ft)}),Zr=_([Jr.and(x({type:b(`content`)})),nt.and(x({type:b(`diff`)})),Mr.and(x({type:b(`terminal`)}))]),V=p(),Qr=x({sessionId:F,toolCallId:V.nullish()}),$r=y(_([Qr,On]),x({elicitationId:ot,url:p().url()})),ei=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),ni=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),ri=x({_meta:m(p(),g()).nullish(),content:h(Zr).optional(),kind:ni.optional(),locations:h(ei).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.optional(),title:p(),toolCallId:V}),ii=x({_meta:m(p(),g()).nullish(),content:h(Zr).nullish(),kind:ni.nullish(),locations:h(ei).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.nullish(),title:p().nullish(),toolCallId:V}),ai=x({_meta:m(p(),g()).nullish(),options:h(cn),sessionId:F,toolCall:ii}),oi=x({_meta:m(p(),g()).nullish(),hint:p()}),si=x({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=x({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([x({enum:h(p()),type:lt}),Xr]),ui=x({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(x({type:b(`string`)})),an.and(x({type:b(`number`)})),xt.and(x({type:b(`integer`)})),Ze.and(x({type:b(`boolean`)})),ui.and(x({type:b(`array`)}))]),fi=x({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ct.optional().default(`object`)}),pi=y(_([y(_([Qr,On]),x({requestedSchema:fi})).and(x({mode:b(`form`)})),$r.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),mi=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([Gr,Ye,Dt,gr,hr,lr,mr,_r,$e,Cr,xr,x({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Qe,_t])}),x({error:mt,id:j})]);var hi=x({_meta:m(p(),g()).nullish(),cost:et.nullish(),size:f(),used:f()}),gi=_([B.and(x({sessionUpdate:b(`user_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_thought_chunk`)})),ri.and(x({sessionUpdate:b(`tool_call`)})),ii.and(x({sessionUpdate:b(`tool_call_update`)})),fn.and(x({sessionUpdate:b(`plan`)})),ci.and(x({sessionUpdate:b(`available_commands_update`)})),fr.and(x({sessionUpdate:b(`current_mode_update`)})),Wn.and(x({sessionUpdate:b(`config_option_update`)})),ur.and(x({sessionUpdate:b(`session_info_update`)})),hi.and(x({sessionUpdate:b(`usage_update`)}))]),_i=x({_meta:m(p(),g()).nullish(),sessionId:F,update:gi});x({method:p(),params:_([_i,st,ht]).nullish()});var vi=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),yi=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),bi=x({name:p(),uri:p()}),xi=x({_meta:m(p(),g()).nullish(),repository:Xt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([bn,Je,Et,rn,rr,Ct,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,gt]).nullish()});var Si=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:F});x({id:j,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,gt]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),En,Fn,tt,Fr,Dn,yi,St,it,_t])}),x({error:mt,id:j})]),e(),d(),r(),s(),i(),o();function Ci(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)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
1
|
+
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as ee,kt as v,nn as y,un as b,vt as te,wn as x}from"./schemas-BGAvj1T4.js";import{t as ne}from"./v4-f1i_CNUT.js";import{Tt as re,cn as ie,jr as S,lr as C}from"./state-sIHsFpDu.js";import{Ac as ae,Dr as oe,Pr as se,_c as ce,no as le,oo as ue}from"./paths-BZbIj1Z1.js";import{l as de,p as fe}from"./sessionStoragePortable-DJZ_6cL8.js";import{$E as pe,Ca as me,Dv as he,G as ge,K as _e,Mf as ve,Nf as ye,Ov as be,Pr as xe,QE as Se,Sa as Ce,Xu as we,Yi as Te,Zu as Ee,_p as De,ea as Oe,gp as ke,i as Ae,o as je,xr as Me}from"./loadAgentsDir-DaApSWNv.js";import{Bn as Ne,Vn as Pe}from"./prompt-DHHypkUR.js";import{o as Fe,t as Ie}from"./fileStateCache-C7-TxF8G.js";import{t as Le}from"./QueryEngine-BwvqdZVN.js";import*as w from"node:path";import{dirname as Re}from"node:path";import{randomUUID as ze}from"node:crypto";import{Readable as Be,Writable as Ve}from"node:stream";ne();var T={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`},E={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`},He=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ue=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),We=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ge=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ue)}),Ke=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),qe=_([Ge.and(x({type:b(`env_var`)})),Ke.and(x({type:b(`terminal`)})),We]),Je=x({_meta:m(p(),g()).nullish(),methodId:p()}),Ye=x({_meta:m(p(),g()).nullish()}),Xe=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ze=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),Qe=x({_meta:m(p(),g()).nullish()}),$e=x({_meta:m(p(),g()).nullish()}),et=x({amount:f(),currency:p()}),tt=x({_meta:m(p(),g()).nullish(),terminalId:p()}),nt=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),rt=_([p(),f(),f(),v(),h(p())]),it=y(_([x({content:m(p(),rt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),at=x({_meta:m(p(),g()).nullish()}),ot=p(),st=x({_meta:m(p(),g()).nullish(),elicitationId:ot}),ct=b(`object`),lt=b(`string`),ut=x({_meta:m(p(),g()).nullish()}),dt=x({_meta:m(p(),g()).nullish(),form:at.nullish(),url:ut.nullish()}),ft=x({const:p(),title:p()}),pt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),mt=x({code:_([b(-32700),b(-32600),b(-32601),b(-32602),b(-32603),b(-32800),b(-32e3),b(-32002),b(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),ht=g(),gt=g(),_t=g(),vt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),xt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),St=x({_meta:m(p(),g()).nullish()}),Ct=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),wt=x({_meta:m(p(),g()).nullish()}),Tt=x({_meta:m(p(),g()).nullish(),logout:wt.nullish()}),Et=x({_meta:m(p(),g()).nullish()}),Dt=x({_meta:m(p(),g()).nullish()}),Ot=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),kt=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),At=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),jt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(pt),name:p()}),D=_([kt.and(x({type:b(`http`)})),At.and(x({type:b(`sse`)})),jt]),O=p(),Mt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:O,name:p()}),Nt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Pt=x({_meta:m(p(),g()).nullish()}),Ft=x({_meta:m(p(),g()).nullish()}),It=x({_meta:m(p(),g()).nullish()}),Lt=x({_meta:m(p(),g()).nullish()}),Rt=x({_meta:m(p(),g()).nullish()}),zt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=x({diff:p(),uri:p()}),Vt=x({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({languageId:p(),text:p(),uri:p()}),Gt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),qt=x({excerpts:h(Vt),uri:p()}),Jt=x({_meta:m(p(),g()).nullish()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({name:p(),owner:p(),remoteUrl:p()}),Zt=x({_meta:m(p(),g()).nullish()}),Qt=x({_meta:m(p(),g()).nullish(),jump:Ht.nullish(),rename:Yt.nullish(),searchAndReplace:Zt.nullish()}),$t=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),en=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),tn=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),nn=x({_meta:m(p(),g()).nullish(),diagnostics:Pt.nullish(),editHistory:zt.nullish(),openFiles:Ut.nullish(),recentFiles:Gt.nullish(),relatedSnippets:Jt.nullish(),userActions:tn.nullish()}),rn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),an=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),on=p(),sn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),cn=x({_meta:m(p(),g()).nullish(),kind:sn,name:p(),optionId:on}),ln=_([b(`high`),b(`medium`),b(`low`)]),un=_([b(`pending`),b(`in_progress`),b(`completed`)]),dn=x({_meta:m(p(),g()).nullish(),content:p(),priority:ln,status:un}),fn=x({_meta:m(p(),g()).nullish(),entries:h(dn)}),k=x({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),pn=x({id:p(),position:k,uri:p()}),mn=x({id:p(),newName:p(),position:k,uri:p()}),hn=x({action:p(),position:k,timestampMs:f(),uri:p()}),gn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),_n=x({_meta:m(p(),g()).nullish(),auth:He.optional().default({terminal:!1}),elicitation:dt.nullish(),fs:vt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Qt.nullish(),positionEncodings:h(gn).optional(),terminal:v().optional().default(!1)}),vn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),yn=f().int().gte(0).lte(65535),bn=x({_meta:m(p(),g()).nullish(),clientCapabilities:_n.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:bt.nullish(),protocolVersion:yn}),A=x({end:k,start:k}),xn=x({message:p(),range:A,severity:Nt,uri:p()}),Sn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),Cn=x({_meta:m(p(),g()).nullish(),diagnostics:h(xn).nullish(),editHistory:h(Bt).nullish(),openFiles:h(Sn).nullish(),recentFiles:h(Wt).nullish(),relatedSnippets:h(qt).nullish(),userActions:h(hn).nullish()}),wn=x({newText:p(),range:A}),Tn=_([x({cursorPosition:k.nullish(),edits:h(wn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),pn.and(x({kind:b(`jump`)})),mn.and(x({kind:b(`rename`)})),$t.and(x({kind:b(`searchAndReplace`)}))]),En=x({_meta:m(p(),g()).nullish(),content:p()}),Dn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var On=x({requestId:j}),kn=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(kn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),An=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),jn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),Mn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Nn=x({_meta:m(p(),g()).nullish(),optionId:on}),Pn=_([x({outcome:b(`cancelled`)}),Nn.and(x({outcome:b(`selected`)}))]),Fn=x({_meta:m(p(),g()).nullish(),outcome:Pn}),In=x({_meta:m(p(),g()).nullish()}),Ln=x({_meta:m(p(),g()).nullish()}),Rn=x({currentValue:v()}),zn=p(),Bn=p(),Vn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),N=p(),Hn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:N}),Un=x({_meta:m(p(),g()).nullish(),group:zn,name:p(),options:h(Hn)}),P=y(_([x({currentValue:N,options:_([h(Hn),h(Un)])}).and(x({type:b(`select`)})),Rn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Vn.nullish(),description:p().nullish(),id:Bn,name:p()})),Wn=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Gn=x({_meta:m(p(),g()).nullish()}),F=p(),Kn=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:F}),qn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Jn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Yn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Xn=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(pt).optional(),outputByteLimit:f().nullish(),sessionId:F}),Zn=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),Qn=x({_meta:m(p(),g()).nullish(),position:k,sessionId:F,uri:p(),version:f(),visibleRange:A}),$n=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:F,text:p(),uri:p(),version:f()}),er=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),tr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),nr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),rr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:F}),ir=x({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:F}),ar=x({_meta:m(p(),g()).nullish(),id:p(),reason:Kt.nullish(),sessionId:F}),or=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),sr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),cr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:F,title:p().nullish(),updatedAt:p().nullish()}),lr=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=x({_meta:m(p(),g()).nullish()}),I=p(),fr=x({_meta:m(p(),g()).nullish(),currentModeId:I}),pr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:I,name:p()}),L=x({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:I}),R=x({_meta:m(p(),g()).nullish(),availableModels:h(Mt),currentModelId:O}),mr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),hr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),gr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),_r=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),vr=x({_meta:m(p(),g()).nullish()}),yr=x({_meta:m(p(),g()).nullish(),additionalDirectories:In.nullish(),close:Ln.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=y(_([x({type:b(`boolean`),value:v()}),x({value:N})]),x({_meta:m(p(),g()).nullish(),configId:Bn,sessionId:F})),xr=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Sr=x({_meta:m(p(),g()).nullish(),modeId:I,sessionId:F}),Cr=x({_meta:m(p(),g()).nullish()}),wr=x({_meta:m(p(),g()).nullish(),modelId:O,sessionId:F}),Tr=x({_meta:m(p(),g()).nullish()}),Er=x({_meta:m(p(),g()).nullish(),sessionId:F}),Dr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Or=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),kr=x({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:Or.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(ft).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=x({_meta:m(p(),g()).nullish(),context:Cn.nullish(),position:k,selection:A.nullish(),sessionId:F,triggerKind:en,uri:p(),version:f()}),jr=x({_meta:m(p(),g()).nullish(),suggestions:h(Tn)}),Mr=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Pr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),Fr=x({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:v()}),Ir=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Lr=x({range:A.nullish(),text:p()}),Rr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:F,uri:p(),version:f()});x({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,ht]).nullish()});var zr=_([b(`full`),b(`incremental`)]),Br=x({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=x({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Ft.nullish(),didFocus:It.nullish(),didOpen:Lt.nullish(),didSave:Rt.nullish()}),Hr=x({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=x({_meta:m(p(),g()).nullish(),context:nn.nullish(),events:Hr.nullish()}),Wr=x({_meta:m(p(),g()).nullish(),auth:Tt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Ot.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:gn.nullish(),promptCapabilities:vn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=x({_meta:m(p(),g()).nullish(),agentCapabilities:Wr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:bt.nullish(),authMethods:h(qe).optional().default([]),protocolVersion:yn}),Kr=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Xe]),qr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:Kr}),z=_([Ir.and(x({type:b(`text`)})),jn.and(x({type:b(`image`)})),An.and(x({type:b(`audio`)})),Mn.and(x({type:b(`resource_link`)})),qr.and(x({type:b(`resource`)}))]),Jr=x({_meta:m(p(),g()).nullish(),content:z}),B=x({_meta:m(p(),g()).nullish(),content:z,messageId:p().nullish()}),Yr=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(z),sessionId:F}),Xr=x({anyOf:h(ft)}),Zr=_([Jr.and(x({type:b(`content`)})),nt.and(x({type:b(`diff`)})),Mr.and(x({type:b(`terminal`)}))]),V=p(),Qr=x({sessionId:F,toolCallId:V.nullish()}),$r=y(_([Qr,On]),x({elicitationId:ot,url:p().url()})),ei=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),ni=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),ri=x({_meta:m(p(),g()).nullish(),content:h(Zr).optional(),kind:ni.optional(),locations:h(ei).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.optional(),title:p(),toolCallId:V}),ii=x({_meta:m(p(),g()).nullish(),content:h(Zr).nullish(),kind:ni.nullish(),locations:h(ei).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.nullish(),title:p().nullish(),toolCallId:V}),ai=x({_meta:m(p(),g()).nullish(),options:h(cn),sessionId:F,toolCall:ii}),oi=x({_meta:m(p(),g()).nullish(),hint:p()}),si=x({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=x({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([x({enum:h(p()),type:lt}),Xr]),ui=x({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(x({type:b(`string`)})),an.and(x({type:b(`number`)})),xt.and(x({type:b(`integer`)})),Ze.and(x({type:b(`boolean`)})),ui.and(x({type:b(`array`)}))]),fi=x({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ct.optional().default(`object`)}),pi=y(_([y(_([Qr,On]),x({requestedSchema:fi})).and(x({mode:b(`form`)})),$r.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),mi=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([Gr,Ye,Dt,gr,hr,lr,mr,_r,$e,Cr,xr,x({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Qe,_t])}),x({error:mt,id:j})]);var hi=x({_meta:m(p(),g()).nullish(),cost:et.nullish(),size:f(),used:f()}),gi=_([B.and(x({sessionUpdate:b(`user_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_thought_chunk`)})),ri.and(x({sessionUpdate:b(`tool_call`)})),ii.and(x({sessionUpdate:b(`tool_call_update`)})),fn.and(x({sessionUpdate:b(`plan`)})),ci.and(x({sessionUpdate:b(`available_commands_update`)})),fr.and(x({sessionUpdate:b(`current_mode_update`)})),Wn.and(x({sessionUpdate:b(`config_option_update`)})),ur.and(x({sessionUpdate:b(`session_info_update`)})),hi.and(x({sessionUpdate:b(`usage_update`)}))]),_i=x({_meta:m(p(),g()).nullish(),sessionId:F,update:gi});x({method:p(),params:_([_i,st,ht]).nullish()});var vi=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),yi=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),bi=x({name:p(),uri:p()}),xi=x({_meta:m(p(),g()).nullish(),repository:Xt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([bn,Je,Et,rn,rr,Ct,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,gt]).nullish()});var Si=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:F});x({id:j,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,gt]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),En,Fn,tt,Fr,Dn,yi,St,it,_t])}),x({error:mt,id:j})]),e(),d(),r(),s(),i(),o();function Ci(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)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
2
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)}}}}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()}}})}}ne();var wi,H=new WeakMap,Ti=class{constructor(e,t){l(this,H,void 0);let n=e(this);u(H,this,new ji(async(e,t)=>{switch(e){case T.initialize:{let e=bn.parse(t);return n.initialize(e)}case T.session_new:{let e=rn.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=Ct.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=tr.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=sr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Yn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=Sr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Je.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=Et.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Yr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=wr.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=br.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=xi.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Ar.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Jn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=qn.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=$n.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Rr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=Zn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=er.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Qn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Kn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=ar.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(H,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(H,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(H,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(H,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(H,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(H,this))}async unstable_createElicitation(e){return await c(H,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(H,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(H,this).sendRequest(e,t)}async extNotification(e,t){return await c(H,this).sendNotification(e,t)}get signal(){return c(H,this).signal}get closed(){return c(H,this).closed}},U=new WeakMap,W=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,U,void 0),l(this,W,void 0),this.id=e,u(U,this,n),u(W,this,r)}async currentOutput(){return await c(W,this).sendRequest(E.terminal_output,{sessionId:c(U,this),terminalId:this.id})}async waitForExit(){return await c(W,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(U,this),terminalId:this.id})}async kill(){return await c(W,this).sendRequest(E.terminal_kill,{sessionId:c(U,this),terminalId:this.id})??{}}async release(){return await c(W,this).sendRequest(E.terminal_release,{sessionId:c(U,this),terminalId:this.id})??{}}async[wi](){await this.release()}},G=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ai=new WeakMap,Y=new WeakSet,ji=class{constructor(e,t,r){a(this,Y),l(this,G,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,ki,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ai,void 0),u(Oi,this,e),u(ki,this,t),u(K,this,r),u(Ai,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Mi).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ai,this)}async sendRequest(e,t){var r,i;n(Y,this,Ri).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(G,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ri).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Mi(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Pi).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,Ni).call(this,e)}}function Ni(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(G,this).values())e.reject(t);c(G,this).clear(),c(J,this).abort(t)}async function Pi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Fi).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,Ii).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Li).call(this,e):console.error(`Invalid message`,{message:e})}async function Fi(e,t){try{return{result:await c(Oi,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.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 Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function Ii(e,t){try{return await c(ki,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.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 Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Li(e){let t=c(G,this).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 Z(n,r,i))}c(G,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ri(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Ni).call(this,e)})),c(q,this)}var Z=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}}};ie(),de(),ae(),ue(),Pe(),Fe(),Se(),je(),ke(),xe(),pe(),ve(),De();var zi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Vi(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=Bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!zi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Hi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ui=256;function Wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ui?t:t.slice(0,Ui-1)+`…`}function Gi(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Ki(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
3
|
+
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}ne();var wi,H=new WeakMap,Ti=class{constructor(e,t){l(this,H,void 0);let n=e(this);u(H,this,new ji(async(e,t)=>{switch(e){case T.initialize:{let e=bn.parse(t);return n.initialize(e)}case T.session_new:{let e=rn.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=Ct.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=tr.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=sr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Yn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=Sr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Je.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=Et.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Yr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=wr.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=br.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=xi.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Ar.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Jn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=qn.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=$n.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Rr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=Zn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=er.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Qn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Kn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=ar.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(H,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(H,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(H,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(H,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(H,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(H,this))}async unstable_createElicitation(e){return await c(H,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(H,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(H,this).sendRequest(e,t)}async extNotification(e,t){return await c(H,this).sendNotification(e,t)}get signal(){return c(H,this).signal}get closed(){return c(H,this).closed}},U=new WeakMap,W=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,U,void 0),l(this,W,void 0),this.id=e,u(U,this,n),u(W,this,r)}async currentOutput(){return await c(W,this).sendRequest(E.terminal_output,{sessionId:c(U,this),terminalId:this.id})}async waitForExit(){return await c(W,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(U,this),terminalId:this.id})}async kill(){return await c(W,this).sendRequest(E.terminal_kill,{sessionId:c(U,this),terminalId:this.id})??{}}async release(){return await c(W,this).sendRequest(E.terminal_release,{sessionId:c(U,this),terminalId:this.id})??{}}async[wi](){await this.release()}},G=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ai=new WeakMap,Y=new WeakSet,ji=class{constructor(e,t,r){a(this,Y),l(this,G,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,ki,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ai,void 0),u(Oi,this,e),u(ki,this,t),u(K,this,r),u(Ai,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Mi).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ai,this)}async sendRequest(e,t){var r,i;n(Y,this,Ri).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(G,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ri).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Mi(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Pi).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,Ni).call(this,e)}}function Ni(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(G,this).values())e.reject(t);c(G,this).clear(),c(J,this).abort(t)}async function Pi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Fi).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,Ii).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Li).call(this,e):console.error(`Invalid message`,{message:e})}async function Fi(e,t){try{return{result:await c(Oi,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.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 Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function Ii(e,t){try{return await c(ki,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.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 Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Li(e){let t=c(G,this).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 Z(n,r,i))}c(G,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ri(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Ni).call(this,e)})),c(q,this)}var Z=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}}};ie(),de(),ae(),ue(),Pe(),Fe(),pe(),be(),Ee(),Oe(),xe(),_e(),je();var zi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Vi(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=Bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!zi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Hi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ui=256;function Wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ui?t:t.slice(0,Ui-1)+`…`}function Gi(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Ki(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
4
4
|
`+e+(e.endsWith(`
|
|
5
5
|
`)?``:`
|
|
6
|
-
`)+t}function Q(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 n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Gi(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Gi(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Gi(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}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`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,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
|
|
6
|
+
`)+t}var qi=console;function Q(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 n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Gi(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Gi(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Gi(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}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`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,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 Ji(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Yi(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Ki(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Ki(e.text)}:Xi(e,!1)}))}:{};case`Bash`:{let e=``,a=+!!r,o=String(t.id);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(`
|
|
7
7
|
`),a=t.return_code??+!!r}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
8
|
-
`));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}: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
|
|
9
|
-
`)||``)}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
|
|
8
|
+
`));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}: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 Yi(i??``,r)}}function Yi(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Xi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Xi(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`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_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);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(`
|
|
9
|
+
`)||``)}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 Zi(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 Qi(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;try{for(;!r.aborted;){let s=await Zi(t,r);if(s.done||r.aborted)break;let m=s.value;if(m==null)continue;let h=m;switch(h.type){case`system`:h.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
10
|
|
|
11
|
-
Compacting completed.`}}}));break;case`result`:{let t=
|
|
11
|
+
Compacting completed.`}}}));break;case`result`:{let t=h.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=h.modelUsage;if(i&&d){let e=ia(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=h.total_cost_usd;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:a,size:f,cost:o==null?void 0:{amount:o,currency:`USD`}}});let s=h.subtype,p=h.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:h.stop_reason===`max_tokens`&&(c=`max_tokens`),p&&(c=`end_turn`);break;case`error_during_execution`:c=h.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=ea(h,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=h.message,r=h.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=$i(h,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=h.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:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
12
|
|
|
13
|
-
Compacting completed.`}}});break;default: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}}function
|
|
14
|
-
`)}function ca(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`}we(),se(),Ee(),e();var la=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,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}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);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await Oe({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Wi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=sa(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=ze();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),S(e.sessionId,re());let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Zi(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=xa(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}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.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 setSessionConfigOption(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)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){ce();let n=t.sessionId??ze(),r=e.cwd;S(n,re()),C(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=Ne(),a=ye(i),o=e._meta,s=ha(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=fa(c,s,l),d=ia(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=ga(l),p={..._e(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([ge(r),Te(r)]);p.agentDefinitions=h;let g=new Le({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 Ie(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:u,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`}]},ee=be(),v=oe(),y={availableModels:ee.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};g.setModel(v);let b=Ca(_,y),te={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Hi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,models:y,modes:_,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Hi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return S(e.sessionId,n?Re(n.filePath):null),C(e.cwd),await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions}}await this.teardownSession(e.sessionId)}let n=await fe(e.sessionId,e.cwd),r=n?Re(n.filePath):null;S(e.sessionId,r),C(e.cwd);let i;if(n)try{let t=await Ce(e.sessionId);t&&t.messages.length>0&&(i=me(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let a=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:i});if(i&&i.length>0){let t=this.sessions.get(e.sessionId);t&&await ta(e.sessionId,i,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:a.sessionId,modes:a.modes,models:a.models,configOptions:a.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async replaySessionHistory(e){try{let t=await Ce(e.sessionId);if(!t||t.messages.length===0)return;let n=me(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await ta(e.sessionId,n,this.conn,r.toolUseCache,this.clientCapabilities,r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}applySessionMode(e,t){if(!da(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 updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}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)}getSetting(e){let t=le();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},ua=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function da(e){return ua.includes(e)}function fa(e,t,n){if(t){let t=pa(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!ga(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return ma(n)??`default`}function pa(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Vi(e,t)}function ma(e){if(e!=null)try{return Vi(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 ha(e,t){return!!e&&Object.hasOwn(e,t)}function ga(e){return _a()&&(va()||ya(e))}function _a(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function va(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||ba(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ya(e){try{return Vi(e)===`bypassPermissions`}catch{return!1}}function ba(e){return e===`1`||e?.toLowerCase()===`true`}function xa(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),Sa(e),n}Sa(e)}function Sa(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)}}function Ca(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}))}]}ae(),Me();function wa(e,t){let n=Be.toWeb(e);return Ci(Ve.toWeb(t),n)}async function Ta(){ce(),Ae();let e=wa(process.stdin,process.stdout),t,n=new Ti(e=>(t=new la(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{Ta as runAcpAgent};
|
|
13
|
+
Compacting completed.`}}});break;default:qi.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}}function $i(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`,content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:$(s,`assistant`,t,n,r,void 0,i)}function ea(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?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`content_block_delta`:{let o=a.delta;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function $(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`,content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:a={sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:i.thinking??``}};break;case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,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:ta(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,rawInput:e,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Q({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 ta(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function na(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){qi.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;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=$(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a});for(let e of t)await n.sessionUpdate(e)}}}function ra(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function ia(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=ra(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function aa(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=sa(r);if(n.name===`ExitPlanMode`)return oa(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await ge(n,s,c,l,u);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:u}}let p=Q({name:n.name,id:u,input:s},f,i),m={toolCallId:u,title:p.title,kind:p.kind,status:`pending`,rawInput:s},h=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`}];try{let n=await e.requestPermission({sessionId:t,toolCall:m,options:h});if(n.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`}};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:s}}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 oa(e,t,n,r,i,a,o,s){let c=[{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&&c.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let l=Q({name:`ExitPlanMode`,id:n,input:r},i,a),u={toolCallId:n,title:l.title,kind:l.kind,status:`pending`,rawInput:r},d=await e.requestPermission({sessionId:t,toolCall:u,options:c});if(d.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(d.outcome.outcome===`selected`&&`optionId`in d.outcome&&d.outcome.optionId!==void 0){let n=d.outcome.optionId;if(c.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 sa(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}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;n&&typeof n.text==`string`&&t.push(n.text)}}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`}ke(),se(),ye(),e();var ua=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,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}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);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await De({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Wi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=ca(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=ze();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),S(e.sessionId,re());let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Qi(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=Sa(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}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.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 setSessionConfigOption(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)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){ce();let n=t.sessionId??ze(),r=e.cwd;S(n,re()),C(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=Ne(),a=we(i),o=e._meta,s=ga(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=pa(c,s,l),d=aa(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=_a(l),p={...Se(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([Te(r),Ae(r)]);p.agentDefinitions=h;let g=new Le({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 Ie(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:u,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`}]},ee=ve(),v=oe(),y={availableModels:ee.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};g.setModel(v);let b=wa(_,y),te={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Hi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,models:y,modes:_,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Hi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return S(e.sessionId,n?Re(n.filePath):null),C(e.cwd),await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions}}await this.teardownSession(e.sessionId)}let n=await fe(e.sessionId,e.cwd),r=n?Re(n.filePath):null;S(e.sessionId,r),C(e.cwd);let i;if(n)try{let t=await Me(e.sessionId);t&&t.messages.length>0&&(i=he(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let a=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:i});if(i&&i.length>0){let t=this.sessions.get(e.sessionId);t&&await na(e.sessionId,i,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:a.sessionId,modes:a.modes,models:a.models,configOptions:a.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async replaySessionHistory(e){try{let t=await Me(e.sessionId);if(!t||t.messages.length===0)return;let n=he(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await na(e.sessionId,n,this.conn,r.toolUseCache,this.clientCapabilities,r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}applySessionMode(e,t){if(!fa(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 updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}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)}getSetting(e){let t=le();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},da=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function fa(e){return da.includes(e)}function pa(e,t,n){if(t){let t=ma(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!_a(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return ha(n)??`default`}function ma(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Vi(e,t)}function ha(e){if(e!=null)try{return Vi(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 ga(e,t){return!!e&&Object.hasOwn(e,t)}function _a(e){return va()&&(ya()||ba(e))}function va(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function ya(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||xa(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ba(e){try{return Vi(e)===`bypassPermissions`}catch{return!1}}function xa(e){return e===`1`||e?.toLowerCase()===`true`}function Sa(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),Ca(e),n}Ca(e)}function Ca(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)}}function wa(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}))}]}ae(),me();function Ta(e,t){let n=Be.toWeb(e);return Ci(Ve.toWeb(t),n)}async function Ea(){ce(),Ce();let e=Ta(process.stdin,process.stdout),t,n=new Ti(e=>(t=new ua(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{Ea as runAcpAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t}from"./envLessBridgeConfig-BKs6Mk4e.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{S as o,y as s}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{S as o,y as s}from"./paths-BZbIj1Z1.js";import{n as c,t as l}from"./lazySchema-2sOku3cX.js";import{i as u,r as d}from"./semver-Tw0AFar5.js";import{r as f,s as p}from"./bridgeEnabled-DrW-kkAr.js";async function m(){let e=await s(`tengu_bridge_repl_v2_config`,_),t=v().safeParse(e);return t.success?t.data:_}async function h(){let e=await m();return e.min_version&&u(`2.6.12`,e.min_version)?`Your version of Claude Code (2.6.12) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function g(){return p()?(await m()).should_show_app_upgrade_message:!1}var _,v,y=e((()=>{a(),o(),l(),d(),f(),_={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},v=c(()=>i({init_retry_max_attempts:t().int().min(1).max(10).default(3),init_retry_base_delay_ms:t().int().min(100).default(500),init_retry_jitter_fraction:t().min(0).max(1).default(.25),init_retry_max_delay_ms:t().int().min(500).default(4e3),http_timeout_ms:t().int().min(2e3).default(1e4),uuid_dedup_buffer_size:t().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:t().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:t().min(0).max(.5).default(.1),token_refresh_buffer_ms:t().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:t().int().min(500).max(2e3).default(1500),connect_timeout_ms:t().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return u(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{g as a,y as i,h as n,m as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{Cl as r,wl as i}from"./paths-BZbIj1Z1.js";import{Ot as a,Tt as o,fd as s,pd as c,rE as l,tE as u}from"./loadAgentsDir-DaApSWNv.js";import{n as d,t as f}from"./ExitFlow-CHDj7fv7.js";import{spawnSync as p}from"child_process";function m(){return i(_)??`Goodbye!`}async function h(e){if(c())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=o()!==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((()=>{r(),t(),d(),s(),l(),a(),g=n(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,f as a,g as o,h as s,t as c,tn as l,tt as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{O as p,w as m}from"./debug-UI3T040K.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,f as a,g as o,h as s,t as c,tn as l,tt as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{O as p,w as m}from"./debug-UI3T040K.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{Lx as _,Rx as v,Ux as y,Wx as b,aC as x,iC as S,qw as C}from"./loadAgentsDir-DaApSWNv.js";import{t as w}from"./useKeybinding-FsOnjW6T.js";import{n as T,t as E}from"./exportRenderer-B-2J3ocI.js";import{join as D}from"path";function O({content:e,defaultFilename:t,onDone:r}){let[,c]=(0,k.useState)(null),[f,m]=(0,k.useState)(t),[h,v]=(0,k.useState)(t.length),[b,x]=(0,k.useState)(!1),{columns:C}=n(),w=(0,k.useCallback)(()=>{x(!1),c(null)},[]),T=async t=>{if(t===`clipboard`){let t=await l(e);t&&process.stdout.write(t),r({success:!0,message:`Conversation copied to clipboard`})}else t===`file`&&(c(`file`),x(!0))},E=()=>{let t=f.endsWith(`.txt`)?f:f.replace(/\.[^.]+$/,``)+`.txt`,n=D(g(),t);try{p(n,e,{encoding:`utf-8`,flush:!0}),r({success:!0,message:`Conversation exported to: ${n}`})}catch(e){r({success:!1,message:`Failed to export conversation: ${e instanceof Error?e.message:`Unknown error`}`})}},O=(0,k.useCallback)(()=>{b?w():r({success:!1,message:`Export cancelled`})},[b,w,r]),j=[{label:`Copy to clipboard`,value:`clipboard`,description:`Copy the conversation to your system clipboard`},{label:`Save to file`,value:`file`,description:`Save the conversation to a file in the current directory`}];function M(e){return b?(0,A.jsxs)(s,{children:[(0,A.jsx)(o,{shortcut:`Enter`,action:`save`}),(0,A.jsx)(S,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}):e.pending?(0,A.jsxs)(i,{children:[`Press `,e.keyName,` again to exit`]}):(0,A.jsx)(S,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})}return u(`confirm:no`,O,{context:`Settings`,isActive:b}),(0,A.jsx)(a,{title:`Export Conversation`,subtitle:`Select export method:`,color:`permission`,onCancel:O,inputGuide:M,isCancelActive:!b,children:b?(0,A.jsxs)(d,{flexDirection:`column`,children:[(0,A.jsx)(i,{children:`Enter filename:`}),(0,A.jsxs)(d,{flexDirection:`row`,gap:1,marginTop:1,children:[(0,A.jsx)(i,{children:`>`}),(0,A.jsx)(y,{value:f,onChange:m,onSubmit:E,focus:!0,showCursor:!0,columns:C,cursorOffset:h,onChangeCursorOffset:v})]})]}):(0,A.jsx)(_,{options:j,onChange:T,onCancel:O})})}var k,A,j=e((()=>{k=t(r(),1),C(),c(),w(),h(),m(),x(),v(),b(),A=f()}));function M(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}-${String(e.getHours()).padStart(2,`0`)}${String(e.getMinutes()).padStart(2,`0`)}${String(e.getSeconds()).padStart(2,`0`)}`}function N(e){let t=e.find(e=>e.type===`user`);if(!t||t.type!==`user`)return``;let n=t.message?.content,r=``;if(typeof n==`string`)r=n.trim();else if(Array.isArray(n)){let e=n.find(e=>e.type===`text`);e&&`text`in e&&(r=e.text.trim())}return r=r.split(`
|
|
2
2
|
`)[0]||``,r.length>50&&(r=r.substring(0,49)+`…`),r}function P(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``)}async function F(e){let t=e.options.tools||[];return T(e.messages,t)}async function I(e,t,n){let r=await F(t),i=n.trim();if(i){let t=i.endsWith(`.txt`)?i:i.replace(/\.[^.]+$/,``)+`.txt`,n=D(g(),t);try{return p(n,r,{encoding:`utf-8`,flush:!0}),e(`Conversation exported to: ${n}`),null}catch(t){return e(`Failed to export conversation: ${t instanceof Error?t.message:`Unknown error`}`),null}}let a=N(t.messages),o=M(new Date),s;if(a){let e=P(a);s=e?`${o}-${e}.txt`:`conversation-${o}.txt`}else s=`conversation-${o}.txt`;return(0,L.jsx)(O,{content:r,defaultFilename:s,onDone:t=>{e(t.message)}})}var L;e((()=>{r(),j(),h(),E(),m(),L=f()}))();export{I as call,N as extractFirstPrompt,P as sanitizeFilename};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,Tn as r,rt as i,wn as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,Tn as r,rt as i,wn as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{BS as s,VS as c,cT as l,gT as u,mT as d}from"./loadAgentsDir-DaApSWNv.js";import{n as f,t as p}from"./staticRender-Br64h1E1.js";import{n as m,t as h}from"./Messages-CmsZIA66.js";function g({children:e}){let{bindings:t}=u(),n=(0,b.useRef)(null),r=(0,b.useRef)(new Map),a=(0,b.useRef)(new Set).current;return(0,x.jsx)(i,{bindings:t,pendingChordRef:n,pendingChord:null,setPendingChord:()=>{},activeContexts:a,registerActiveContext:()=>{},unregisterActiveContext:()=>{},handlerRegistryRef:r,children:e})}function _(e){if(!(`message`in e))return 1;let t=e.message.content;return Array.isArray(t)?t.length:1}async function v(e,t,n,{columns:i,verbose:a=!1,chunkSize:o=40,onProgress:c}={}){let l=n=>f((0,x.jsx)(s,{children:(0,x.jsx)(g,{children:(0,x.jsx)(h,{messages:e,tools:t,commands:[],verbose:a,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:`export`,screen:`prompt`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1,renderRange:n})})}),i),u=o;for(let t of e)u+=_(t);for(let e=0;e<u;e+=o){let t=await l([e,e+o]);if(r(t).trim()===``)break;await n(t),c?.(e+o)}}async function y(e,t=[],n){let i=[];return await v(e,t,e=>void i.push(r(e)),{columns:n}),i.join(``)}var b,x,S=e((()=>{b=t(n(),1),a(),m(),l(),d(),c(),p(),x=o()}));export{y as n,S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./extra-usage-S4WYpDn5.js";e();export{t as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./extra-usage-core-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./extra-usage-core-Sq4JALS7.js";import{r as a,t as o}from"./login-C64M5OdJ.js";async function s(e,t){let n=await r();return n.type===`message`?(e(n.value),null):(0,c.jsx)(o,{startingMessage:`Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.`,onDone:n=>{t.onChangeAPIKey(),e(n?`Login successful`:`Login interrupted`)}})}var c,l=e((()=>{t(),a(),i(),c=n()}));export{l as n,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Ac as r,Da as i,Pc as a,Sc as o,ka as s,on as c,tn as l}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Ac as r,Da as i,Pc as a,Sc as o,ka as s,on as c,tn as l}from"./paths-BZbIj1Z1.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,s as p}from"./log-CzsijfHZ.js";import{a as m,l as h,o as g}from"./api-CslgFoHj.js";import{n as _,t as v}from"./browser-fLRXxIsQ.js";import{n as y,t as b}from"./usage-COv9UCxX.js";import{i as x,r as S}from"./overageCreditGrant-DCiIf_SF.js";async function C(e){let{accessToken:n,orgUUID:r}=await h(),i={...m(n),"x-organization-uuid":r},a=`${u().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=`${u().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=`${u().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(),d(),g()}));async function D(){o().hasVisitedExtraUsage||a(e=>({...e,hasVisitedExtraUsage:!0})),x();let e=l(),t=e===`team`||e===`enterprise`;if(!i()&&t){let e;try{e=(await b())?.extra_usage}catch(e){p(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){p(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){p(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){p(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 p(e),{type:`message`,value:`Failed to open browser. Please visit ${n} to manage extra usage.`}}}var O=e((()=>{E(),S(),y(),c(),s(),v(),r(),f()}));export{D as n,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./extra-usage-core-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./extra-usage-core-Sq4JALS7.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"./chunk-DR8-3Aex.js";import{Rn as n,b as r,g as i,h as a,nt as o,p as ee,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Bl as u,Br as d,Cr as f,Gs as p,Pr as m,Qa as te,Rr as h,bi as ne,dn as g,dr as _,li as v,lo as re,on as y,oo as b,ur as x,vi as S,xi as C,yi as ie,zl as ae}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,g as i,h as a,nt as o,p as ee,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Bl as u,Br as d,Cr as f,Gs as p,Pr as m,Qa as te,Rr as h,bi as ne,dn as g,dr as _,li as v,lo as re,on as y,oo as b,ur as x,vi as S,xi as C,yi as ie,zl as ae}from"./paths-BZbIj1Z1.js";import{n as w,r as oe}from"./analytics-DqMQntaB.js";import{$A as T,HS as E,Lx as se,Mf as ce,Nf as D,VS as O,WS as le,aC as k,dj as ue,ej as A,hj as de,iC as fe,lj as j,mj as pe,sj as M,tj as N,uj as me,vy as P}from"./loadAgentsDir-DaApSWNv.js";import{t as F}from"./useKeybinding-FsOnjW6T.js";import{l as I,u as he}from"./referral-Nz20w4pB.js";function L(e,t){if(!j(t))return;let n=N(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((()=>{p(),M()}));function B({initial:e,sessionModel:t,onSelect:n,onCancel:s,isStandaloneCommand:l,showFastModeNotice:u,headerText:d,skipSettingsWrite:f}){let p=le(),m=he(),g=e===null?K:e,[_,y]=(0,W.useState)(g),b=E(e=>C()?e.fastMode:!1),[S,w]=(0,W.useState)(()=>new Set(x(g)?[g.replace(/\[1m\]/i,``)]:[])),D=(0,W.useCallback)(()=>{if(!_||_===K)return;let e=_.replace(/\[1m\]/i,``);w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[_]),[O,k]=(0,W.useState)(!1),A=E(e=>e.effortValue),[M,N]=(0,W.useState)(A===void 0?void 0:T(A)),P=(0,W.useMemo)(()=>ce(b??!1),[b]),F=(0,W.useMemo)(()=>e!==null&&!P.some(t=>t.value===e)?[...P,{value:e,label:h(e),description:`Current model`}]:P,[P,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===g)?g:I[0]?.value??void 0,[I,g]),R=Math.min(10,I.length),z=Math.max(0,I.length-R),B=I.find(e=>e.value===_)?.label,q=V(_),J=_!==void 0&&_!==K&&S.has(_.replace(/\[1m\]/i,``)),Y=q?j(q):!1,X=q?ue(q):!1,Z=q?me(q):!1,Q=U(_),$=M===`max`&&!Z?X?`xhigh`:`high`:M===`xhigh`&&!X?`high`:M,_e=(0,W.useCallback)(e=>{y(e),!O&&A===void 0&&N(U(e))},[O,A]),ve=(0,W.useCallback)(e=>{Y&&(N(t=>ge(t??Q,e,X,Z)),k(!0))},[Y,X,Z,Q]);o({"modelPicker:decreaseEffort":()=>ve(`left`),"modelPicker:increaseEffort":()=>ve(`right`),"modelPicker:toggle1M":()=>D()},{context:`ModelPicker`});function ye(e){if(oe(`tengu_model_command_menu_effort`,{effort:M}),!f){let t=pe(M,U(e),te(`userSettings`)?.effortLevel,O),n=de(t);n!==void 0&&re(`userSettings`,{effortLevel:n}),p(e=>({...e,effortValue:t}))}let t=V(e),r=O&&t&&j(t)?M:void 0;if(e===K){n(null,r);return}let i=e.replace(/\[1m\]/i,``);n(S.has(i)?`${i}[1m]`:i,r)}let be=(0,G.jsxs)(c,{flexDirection:`column`,children:[(0,G.jsxs)(c,{flexDirection:`column`,children:[(0,G.jsxs)(c,{marginBottom:1,flexDirection:`column`,children:[(0,G.jsx)(r,{color:`remember`,bold:!0,children:`Select model`}),(0,G.jsx)(r,{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)(r,{dimColor:!0,children:[`Currently using `,h(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,G.jsxs)(c,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(c,{flexDirection:`column`,children:(0,G.jsx)(se,{defaultValue:g,defaultFocusValue:L,options:I,onChange:ye,onFocus:_e,onCancel:s??(()=>{}),visibleOptionCount:R})}),z>0&&(0,G.jsx)(c,{paddingLeft:3,children:(0,G.jsxs)(r,{dimColor:!0,children:[`and `,z,` more…`]})})]}),(0,G.jsxs)(c,{marginBottom:1,flexDirection:`column`,children:[Y?(0,G.jsxs)(r,{dimColor:!0,children:[(0,G.jsx)(H,{effort:$}),` `,ae($),` effort`,$===Q?` (default)`:``,` `,(0,G.jsx)(r,{color:`subtle`,children:`← → to adjust`})]}):(0,G.jsxs)(r,{color:`subtle`,children:[(0,G.jsx)(H,{effort:void 0}),` Effort not supported`,B?` for ${B}`:``]}),J?(0,G.jsxs)(r,{dimColor:!0,children:[(0,G.jsx)(H,{effort:`high`}),` 1M context on`,(0,G.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]}):(0,G.jsxs)(r,{color:`subtle`,children:[(0,G.jsx)(H,{effort:void 0}),` 1M context off`,B?` for ${B}`:``,(0,G.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]})]}),C()?u?(0,G.jsx)(c,{marginBottom:1,children:(0,G.jsxs)(r,{dimColor:!0,children:[`Fast mode is `,(0,G.jsx)(r,{bold:!0,children:`ON`}),` and available with `,v,` only (/fast). Switching to other models turn off fast mode.`]})}):ie()&&!ne()?(0,G.jsx)(c,{marginBottom:1,children:(0,G.jsxs)(r,{dimColor:!0,children:[`Use `,(0,G.jsx)(r,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,v,` only).`]})}):null:null]}),l&&(0,G.jsx)(r,{dimColor:!0,italic:!0,children:m.pending?(0,G.jsxs)(G.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,G.jsxs)(a,{children:[(0,G.jsx)(i,{shortcut:`Enter`,action:`confirm`}),(0,G.jsx)(fe,{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?f():d(e)}function H({effort:e}){return(0,G.jsx)(r,{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=A(V(e)??f());return t===void 0?`high`:T(t)}var W,G,K,q=e((()=>{u(),n(),W=t(n(),1),_(),I(),w(),S(),s(),F(),O(),M(),m(),D(),b(),k(),P(),z(),G=l(),K=`__NO_PREFERENCE__`}));function J(e,t,n){if(!g())return!1;if(t)return!0;if(e===null||!x(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((()=>{y(),_()}));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{$l as e,eu as t,nu as n,tu as r}from"./loadAgentsDir-DaApSWNv.js";n();export{e as drainPendingExtraction,t as executeExtractMemories,r as initExtractMemories};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./fast-OzVowRYW.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Q as i,Rn as a,b as o,f as s,nt as c,t as l,v as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Ac as p,Di as m,Gs as h,Sc as g,Si as _,ci as v,di as y,fi as b,li as x,lo as S,mi as C,oi as w,oo as T,si as E,ui as D,vi as O,xi as k}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Q as i,Rn as a,b as o,f as s,nt as c,t as l,v as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Ac as p,Di as m,Gs as h,Sc as g,Si as _,ci as v,di as y,fi as b,li as x,lo as S,mi as C,oi as w,oo as T,si as E,ui as D,vi as O,xi as k}from"./paths-BZbIj1Z1.js";import{n as A,r as j}from"./analytics-DqMQntaB.js";import{d as M,x as N}from"./startupProfiler-DnXZaX4A.js";import{HS as P,VS as F,WS as I}from"./loadAgentsDir-DaApSWNv.js";import{t as L}from"./useKeybinding-FsOnjW6T.js";import{n as R,t as z}from"./systemTheme-dDbitcxB.js";function B({cooldown:e}){return e?(0,H.jsx)(o,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(o,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let r=R(g().theme);return t?n.dim(u(`promptBorder`,r)(`↯`)):u(`fastMode`,r)(`↯`)}var H,U=e((()=>{r(),a(),h(),l(),p(),z(),H=f()}));function W(e,t){D(),S(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!_(e.mainLoopModel);return{...e,...t?{mainLoopModel:y(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=P(e=>e.mainLoopModel),r=P(e=>e.fastMode),a=I(),[l,u]=(0,J.useState)(r??!1),f=b(),p=f.status===`cooldown`,m=t!==null,h=w(E(!0));function g(){m||(W(l,a),j(`tengu_fast_mode_toggled`,{enabled:l,source:`picker`}),l?e(`${V(l)} Fast mode ON${_(n)?``:` · model set to ${x}`} · ${h}`):(a(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function v(){if(m){r&&W(!1,a),e(`Fast mode OFF`,{display:`system`});return}e(r?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function y(){m||u(e=>!e)}return c({"confirm:yes":g,"confirm:nextField":y,"confirm:next":y,"confirm:previous":y,"confirm:cycleMode":y,"confirm:toggle":y},{context:`Confirmation`}),(0,Y.jsxs)(s,{title:(0,Y.jsxs)(o,{children:[(0,Y.jsx)(B,{cooldown:p}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${x}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:v,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):m?(0,Y.jsx)(o,{children:`Esc to cancel`}):(0,Y.jsx)(o,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(d,{marginLeft:2,children:(0,Y.jsx)(o,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(d,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(d,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(o,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(o,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,Y.jsx)(o,{dimColor:!0,children:h})]})}),p&&f.status===`cooldown`&&(0,Y.jsx)(d,{marginLeft:2,children:(0,Y.jsxs)(o,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,M(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(o,{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=C();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),j(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${_(i)?``:` · model set to ${x}`} · ${w(E(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!k())return null;await m();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=C();return j(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{a(),J=t(a(),1),l(),U(),L(),A(),F(),O(),N(),v(),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"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./Feedback-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./Feedback-CUjTJbIh.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 +1 @@
|
|
|
1
|
-
import{F as e,I as t,L as n,M as r,N as i,P as a,R as o,j as s,z as c}from"./paths-
|
|
1
|
+
import{F as e,I as t,L as n,M as r,N as i,P as a,R as o,j as s,z as c}from"./paths-BZbIj1Z1.js";r();export{s as getEventSamplingConfig,i as initialize1PEventLogging,a as is1PEventLoggingEnabled,e as logEventTo1P,t as logGrowthBookExperimentTo1P,n as reinitialize1PEventLoggingIfConfigChanged,o as shouldSampleEvent,c as shutdown1PEventLogging};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{L as n,V as r,d as i,s as a}from"./debug-UI3T040K.js";import{O as o,k as s}from"./rcDebugLog-
|
|
1
|
+
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{L as n,V as r,d as i,s as a}from"./debug-UI3T040K.js";import{O as o,k as s}from"./rcDebugLog-CF73Wofq.js";import{i as c}from"./workSecret-mS2OrpxF.js";import{t as l}from"./ccrClient-CWH1f8Nk.js";import{n as u,t as d}from"./SSETransport-CD7R7FfS.js";u(),a(),r(),o();function f(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function p(e){let{sessionUrl:t,ingressToken:r,sessionId:a,initialSequenceNum:o,getAuthToken:u}=e,f;u?f=()=>{let e=u();return e?{Authorization:`Bearer ${e}`}:{}}:s(r);let p=e.epoch??await c(t,r);i(`[bridge:repl] CCR v2: worker sessionId=${a} epoch=${p}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let m=new URL(t);m.pathname=m.pathname.replace(/\/$/,``)+`/worker/events/stream`;let h=new d(m,{},a,void 0,o,f),g,_=new l(h,new URL(t),{getAuthHeaders:f,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{i(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{_.close(),h.close(),g?.(4090)}catch(e){i(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${n(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});h.setOnEvent(e=>{_.reportDelivery(e.event_id,`received`),_.reportDelivery(e.event_id,`processed`)});let v,y=!1,b=!1;return{write(e){return _.writeEvent(e)},async writeBatch(e){for(let t of e){if(b)break;await _.writeEvent(t)}},close(){b=!0,_.close(),h.close()},isConnectedStatus(){return y},getStateLabel(){return h.isClosedStatus()?`closed`:h.isConnectedStatus()?y?`connected`:`init`:`connecting`},setOnData(e){h.setOnData(e)},setOnClose(e){g=e,h.setOnClose(t=>{_.close(),e(t??4092)})},setOnConnect(e){v=e},getLastSequenceNum(){return h.getLastSequenceNum()},droppedBatchCount:0,reportState(e){_.reportState(e)},reportMetadata(e){_.reportMetadata(e)},reportDelivery(e,t){_.reportDelivery(e,t)},flush(){return _.flush()},connect(){e.outboundOnly||h.connect(),_.initialize(p).then(()=>{y=!0,i(`[bridge:repl] v2 transport ready for writes (epoch=${p}, sse=${h.isConnectedStatus()?`open`:`opening`})`),v?.()},e=>{i(`[bridge:repl] CCR v2 initialize failed: ${n(e)}`,{level:`error`}),_.close(),h.close(),g?.(4091)})}}}e();var m=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{f as n,p as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{S as r,g as i}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{S as r,g as i}from"./paths-BZbIj1Z1.js";function a(){return{...u,...i(`tengu_malort_pedway`,u)}}function o(){return!0}function s(){return process.env.USER_TYPE===`ant`&&process.env.MONOREPO_ROOT_DIR&&!n(process.env.ALLOW_ANT_COMPUTER_USE_MCP)?!1:o()&&a().enabled}function c(){let{enabled:e,coordinateMode:t,...n}=a();return n}function l(){return d??(d=a().coordinateMode),d}var u,d,f=e((()=>{r(),t(),u={enabled:!0,pixelValidation:!1,clipboardPasteMultiline:!0,mouseAnimation:!0,hideBeforeAction:!0,autoTargetDisplay:!0,clipboardGuard:!0,coordinateMode:`pixels`}}));export{f as i,s as n,c as r,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./gates-Be4ovdxj.js";e();export{t as getChicagoEnabled};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{L as t,V as n,d as r,s as i}from"./debug-UI3T040K.js";import{o as a,u as o}from"./proxy-CfZp-wce.js";import{C_ as s,Jo as c,S_ as l,T_ as u,UE as d,Vo as f,WE as p,Xo as m,fo as h,st as g,ut as _,w_ as v}from"./loadAgentsDir-DaApSWNv.js";import{G as y,H as b,K as x,P as S,U as C,W as w,q as T}from"./rcDebugLog-CF73Wofq.js";import{n as E,r as D}from"./SSETransport-CD7R7FfS.js";import{randomUUID as O}from"crypto";function k(){return(process.env.GEMINI_BASE_URL||M).replace(/\/+$/,``)}function A(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*j(e){let n=await(e.fetchOverride??fetch)(`${k()}/${A(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...a({forAnthropicAPI:!1})});if(!n.ok){let e=await n.text();throw Error(`Gemini API request failed (${n.status} ${n.statusText}): ${e||`empty response body`}`)}if(!n.body)throw Error(`Gemini API returned no response body`);let r=n.body.getReader(),i=new TextDecoder,o=``;try{for(;;){let{done:e,value:n}=await r.read();if(e)break;o+=i.decode(n,N);let{frames:a,remaining:s}=D(o);o=s;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${t(e)}`)}}o+=i.decode();let{frames:e}=D(o);for(let n of e)if(!(!n.data||n.data===`[DONE]`))try{yield JSON.parse(n.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${t(e)}`)}}finally{r.releaseLock()}}var M,N,P=e((()=>{E(),n(),o(),M=`https://generativelanguage.googleapis.com/v1beta`,N={stream:!0}}));async function*F(e,t,n,i,a,o){try{let u=T(a.model),d=m(e,n),f=await Promise.all(n.map(e=>_(e,{getToolPermissionContext:a.getToolPermissionContext,tools:n,agents:a.agents,allowedAgentTypes:a.allowedAgentTypes,model:a.model}))),h=f.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:g,systemInstruction:S}=y(d,t),E=w(h),D=C(a.toolChoice),k=j({model:u,signal:i,fetchOverride:a.fetchOverride,body:{contents:g,...S&&{systemInstruction:S},...E.length>0&&{tools:E},...D&&{toolConfig:{functionCallingConfig:D}},generationConfig:{...a.temperatureOverride!==void 0&&{temperature:a.temperatureOverride},...o.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...o.type===`enabled`&&{thinkingBudget:o.budgetTokens}}}}}});r(`[Gemini] Calling model=${u}, messages=${g.length}, tools=${E.length}`);let A=b(k,u),M={},N=[],P=null,F=0,I=Date.now();for await(let e of A){switch(e.type){case`message_start`:P=e.message,F=Date.now()-I;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?M[t]={...n,input:``}:n.type===`text`?M[t]={...n,text:``}:n.type===`thinking`?M[t]={...n,thinking:``,signature:``}:M[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=M[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[x]=n.signature);break}case`content_block_stop`:{let t=M[e.index];if(!t||!P)break;let r={message:{...P,content:c([t],n,a.agentId)},requestId:void 0,type:`assistant`,uuid:O(),timestamp:new Date().toISOString()};N.push(r),yield r;break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:F}:void 0}}p(a.langfuseTrace??null,{model:u,provider:`gemini`,input:l(d,t),output:s(N),usage:{input_tokens:0,output_tokens:0},startTime:new Date(I),endTime:new Date,completionStartTime:F>0?new Date(I+F):void 0,tools:v(f),thinking:o.type===`disabled`?void 0:{type:o.type,...o.type===`enabled`&&{budgetTokens:o.budgetTokens}}})}catch(e){let t=e instanceof Error?e.message:String(e);r(`[Gemini] Error: ${t}`,{level:`error`}),yield h({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{g(),i(),f(),d(),u(),P(),S()}))();export{F as queryModelGemini};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{g as t}from"./client-_sjL0I7A.js";import{d as n,s as r}from"./debug-UI3T040K.js";import{t as i}from"./sdk-DEtgRZvI.js";import{
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{g as t}from"./client-_sjL0I7A.js";import{d as n,s as r}from"./debug-UI3T040K.js";import{t as i}from"./sdk-DEtgRZvI.js";import{Fl as a,Il as o,Rl as s,Vo as c,ko as l,wo as u}from"./loadAgentsDir-DaApSWNv.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-BM5numKK.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let r=a();if(!r)return n(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let i=new AbortController;e.addEventListener(`abort`,()=>i.abort(),{once:!0});try{let{messages:t}=await s({promptMessages:[u({content:await d()})],cacheSafeParams:r,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:i},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let n=t.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(n)return{kind:`api-error`,text:l(n)??``};let a=t.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!a)return{kind:`failed`};let o=l(a);return!o||o.trim().length===0?{kind:`failed`}:{kind:`ok`,text:o.trim()}}catch(r){return r instanceof t||e.aborted||i.signal.aborted?{kind:`aborted`}:(n(`[recap] generation failed: ${r}`),{kind:`failed`})}}var p,m;e((()=>{i(),r(),o(),c(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{L as t,V as n,d as r,s as i}from"./debug-UI3T040K.js";import{s as a,u as o}from"./types-Csi32ZXh.js";import{
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{L as t,V as n,d as r,s as i}from"./debug-UI3T040K.js";import{s as a,u as o}from"./types-Csi32ZXh.js";import{Do as s,VO as c,Vo as l,nt as u,tt as d}from"./loadAgentsDir-DaApSWNv.js";import{X as f}from"./rcDebugLog-CF73Wofq.js";import{r as p,t as m}from"./sessionTitle-DyexSH43.js";async function h(e,n){let i=m(e);if(!i)return null;try{let e=await u({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:i,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),t=o(Array.isArray(e.message.content)?s(e.message.content):e.message.content);return t&&typeof t==`object`&&`name`in t&&typeof t.name==`string`?t.name:null}catch(e){return r(`generateSessionName failed: ${t(e)}`,{level:`error`}),null}}var g=e((()=>{d(),i(),n(),a(),l(),p(),c()}));export{g as n,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as e,ot as t}from"./state-sIHsFpDu.js";import{Ac as n,Pc as r,Sc as i,al as a,el as o}from"./paths-
|
|
1
|
+
import{cn as e,ot as t}from"./state-sIHsFpDu.js";import{Ac as n,Pc as r,Sc as i,al as a,el as o}from"./paths-BZbIj1Z1.js";import{d as s,s as c}from"./debug-UI3T040K.js";import{E as l,T as u,r as d,v as f}from"./git-CN3qtTb_.js";import{a as p,n as m,o as h}from"./detectRepository-CBk3S2zv.js";import{realpath as g}from"fs/promises";e(),n(),c(),p(),o(),l(),f();async function _(){try{let e=await m();if(!e){s(`Not in a GitHub repository, skipping path mapping update`);return}let n=t(),a=d(n)??n,o;try{o=(await g(a)).normalize(`NFC`)}catch{o=a}let c=e.toLowerCase(),l=i().githubRepoPaths?.[c]??[];if(l[0]===o){s(`Path ${o} already tracked for repo ${c}`);return}let u=l.filter(e=>e!==o),f=[o,...u];r(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[c]:f}})),s(`Added ${o} to tracked paths for repo ${c}`)}catch(e){s(`Error updating repo path mapping: ${e}`)}}function v(e){let t=i(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(a));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await u(e);if(!n)return!1;let r=h(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let n=i(),a=e.toLowerCase(),o=n.githubRepoPaths?.[a]??[],c=o.filter(e=>e!==t);if(c.length===o.length)return;let l={...n.githubRepoPaths};c.length===0?delete l[a]:l[a]=c,r(e=>({...e,githubRepoPaths:l})),s(`Removed ${t} from tracked paths for repo ${a}`)}export{b as a,_ as i,v as n,x as r,y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{ai as t,ci as n}from"./paths-BZbIj1Z1.js";import{d as r,s as i}from"./debug-UI3T040K.js";import{C_ as a,Jo as o,S_ as s,T_ as c,UE as l,Vo as u,WE as d,Xo as f,bm as p,fo as m,gm as h,st as g,ut as _,v_ as v,w_ as y,y_ as b}from"./loadAgentsDir-DaApSWNv.js";import{F as x,I as S,J as C,L as w,P as T,R as E}from"./rcDebugLog-CF73Wofq.js";import{n as D,t as O}from"./openaiShared-Dy78YERG.js";import{randomUUID as k}from"crypto";async function*A(e,n,i,c,l){try{let u=C(l.model),p=f(e,i),m=await Promise.all(i.map(e=>_(e,{getToolPermissionContext:l.getToolPermissionContext,tools:i,agents:l.agents,allowedAgentTypes:l.allowedAgentTypes,model:l.model}))),g=m.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),b=E(p,n),T=w(g),O=S(l.toolChoice),A=v({maxRetries:0,fetchOverride:l.fetchOverride,source:l.querySource});r(`[Grok] Calling model=${u}, messages=${b.length}, tools=${T.length}`);let j=x(await A.chat.completions.create({model:u,messages:b,...T.length>0&&{tools:T,...O&&{tool_choice:O}},stream:!0,stream_options:{include_usage:!0},...l.temperatureOverride!==void 0&&{temperature:l.temperatureOverride}},{signal:c}),u),M={},N=[],P=null,F={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},I=0,L=Date.now();for await(let e of j){switch(e.type){case`message_start`:P=e.message,I=Date.now()-L,e.message.usage&&(F=D(F,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?M[t]={...n,input:``}:n.type===`text`?M[t]={...n,text:``}:n.type===`thinking`?M[t]={...n,thinking:``,signature:``}:M[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=M[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=M[e.index];if(!t||!P)break;let n={message:{...P,content:o([t],i,l.agentId)},requestId:void 0,type:`assistant`,uuid:k(),timestamp:new Date().toISOString()};N.push(n),yield n;break}case`message_delta`:{let t=e.usage;t&&(F=D(F,t));break}case`message_stop`:break}e.type===`message_stop`&&F.input_tokens+F.output_tokens>0&&h(t(u,F),F,l.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:I}:void 0}}d(l.langfuseTrace??null,{model:u,provider:`grok`,input:s(p,n),output:a(N),usage:{input_tokens:F.input_tokens,output_tokens:F.output_tokens,cache_creation_input_tokens:F.cache_creation_input_tokens,cache_read_input_tokens:F.cache_read_input_tokens},startTime:new Date(L),endTime:new Date,completionStartTime:I>0?new Date(L+I):void 0,tools:y(m)})}catch(e){let t=e instanceof Error?e.message:String(e);r(`[Grok] Error: ${t}`,{level:`error`}),yield m({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{b(),O(),T(),u(),g(),i(),p(),n(),l(),c()}))();export{A as queryModelGrok};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,O as i,S as a,T as o,_ as s,b as c,d as l,f as u,g as d,h as f,k as p,l as m,m as h,p as g,u as _,v,w as y,x as b,y as x}from"./paths-
|
|
1
|
+
import{A as e,C as t,D as n,E as r,O as i,S as a,T as o,_ as s,b as c,d as l,f as u,g as d,h as f,k as p,l as m,m as h,p as g,u as _,v,w as y,x as b,y as x}from"./paths-BZbIj1Z1.js";a();export{m as checkGate_CACHED_OR_BLOCKING,_ as checkSecurityRestrictionGate,l as checkStatsigFeatureGate_CACHED_MAY_BE_STALE,u as clearGrowthBookConfigOverrides,g as getAllGrowthBookFeatures,h as getApiBaseUrlHost,f as getDynamicConfig_BLOCKS_ON_INIT,d as getDynamicConfig_CACHED_MAY_BE_STALE,s as getFeatureValue_CACHED_MAY_BE_STALE,v as getFeatureValue_CACHED_WITH_REFRESH,x as getFeatureValue_DEPRECATED,c as getGrowthBookConfigOverrides,b as hasGrowthBookEnvOverride,t as initializeGrowthBook,y as onGrowthBookRefresh,o as refreshGrowthBookAfterAuthChange,r as refreshGrowthBookFeatures,n as resetGrowthBook,i as setGrowthBookConfigOverride,p as setupPeriodicGrowthBookRefresh,e as stopPeriodicGrowthBookRefresh};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{Xc as r,el as i}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{Xc as r,el as i}from"./paths-BZbIj1Z1.js";import{E as a,K as o,V as s,d as c,h as l,p as u,s as d,w as f}from"./debug-UI3T040K.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{o as h,s as g}from"./log-CzsijfHZ.js";import{join as _}from"path";import{createWriteStream as v,writeFileSync as y}from"fs";import{readFile as b,readdir as x,writeFile as S}from"fs/promises";import{pipeline as C}from"stream/promises";import{getHeapSnapshot as w,getHeapSpaceStatistics as T,getHeapStatistics as E}from"v8";async function D(e,n=0){let r=process.memoryUsage(),i=E(),a=process.resourceUsage(),o=process.uptime(),s;try{s=T()}catch{}let c=process._getActiveHandles().length,l=process._getActiveRequests().length,u;try{u=(await x(`/proc/self/fd`)).length}catch{}let d;try{d=await b(`/proc/self/smaps_rollup`,`utf8`)}catch{}let f=r.rss-r.heapUsed,p=o>0?r.rss/o:0,m=p*3600/(1024*1024),h=[];return i.number_of_detached_contexts>0&&h.push(`${i.number_of_detached_contexts} detached context(s) - possible iframe/context leak`),c>100&&h.push(`${c} active handles - possible timer/socket leak`),f>r.heapUsed&&h.push(`Native memory > heap - leak may be in native addons (node-pty, sharp, etc.)`),m>100&&h.push(`High memory growth rate: ${m.toFixed(1)} MB/hour`),u&&u>500&&h.push(`${u} open file descriptors - possible file/socket leak`),{timestamp:new Date().toISOString(),sessionId:t(),trigger:e,dumpNumber:n,uptimeSeconds:o,memoryUsage:{heapUsed:r.heapUsed,heapTotal:r.heapTotal,external:r.external,arrayBuffers:r.arrayBuffers,rss:r.rss},memoryGrowthRate:{bytesPerSecond:p,mbPerHour:m},v8HeapStats:{heapSizeLimit:i.heap_size_limit,mallocedMemory:i.malloced_memory,peakMallocedMemory:i.peak_malloced_memory,detachedContexts:i.number_of_detached_contexts,nativeContexts:i.number_of_native_contexts},v8HeapSpaces:s?.map(e=>({name:e.space_name,size:e.space_size,used:e.space_used_size,available:e.space_available_size})),resourceUsage:{maxRSS:a.maxRSS*1024,userCPUTime:a.userCPUTime,systemCPUTime:a.systemCPUTime},activeHandles:c,activeRequests:l,openFileDescriptors:u,analysis:{potentialLeaks:h,recommendation:h.length>0?`WARNING: ${h.length} potential leak indicator(s) found. See potentialLeaks array.`:`No obvious leak indicators. Check heap snapshot for retained objects.`},smapsRollup:d,platform:process.platform,nodeVersion:process.version,ccVersion:`2.6.12`}}async function O(e=`manual`,n=0){try{let i=t(),o=await D(e,n),s=e=>(e/1024/1024/1024).toFixed(3);c(`[HeapDump] Memory state:
|
|
2
2
|
heapUsed: ${s(o.memoryUsage.heapUsed)} GB (in snapshot)
|
|
3
3
|
external: ${s(o.memoryUsage.external)} GB (NOT in snapshot)
|
|
4
4
|
rss: ${s(o.memoryUsage.rss)} GB (total process)
|