claude-code-best 2.7.2 → 2.8.1
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/README.md +3 -0
- package/dist/chunks/{AddWorkspaceDirectory-V2tF7iCY.js → AddWorkspaceDirectory-CNyPaerF.js} +1 -1
- package/dist/chunks/{App-DLdRpU7c.js → App-hiKxO6UA.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DPws3jax.js → ApproveApiKey-Cd43j9Wa.js} +1 -1
- package/dist/chunks/ApproveApiKey-DUoUTxFp.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-D6rS0OVe.js → AssistantSessionChooser-C8OxwSGM.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-hGlbm5z5.js → BackgroundTasksDialog-VKhuyQLe.js} +2 -2
- package/dist/chunks/{BypassPermissionsModeDialog-CuEpdRVd.js → BypassPermissionsModeDialog-Ddjzluka.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-CTTKMRbt.js → ClaudeInChromeOnboarding-BhvrEJlm.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-COO2W0ij.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-B-GkVoA_.js → ClaudeMdExternalIncludesDialog-DoNd72PS.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-CPWq7O57.js +1 -0
- package/dist/chunks/{DesktopHandoff-BjPylhOT.js → DesktopHandoff-DVUOZjb0.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-c4YVqBX9.js → DevChannelsDialog-DJbRHAIy.js} +1 -1
- package/dist/chunks/{DiffDialog-I5wuXw2C.js → DiffDialog-D0RK4t-9.js} +2 -2
- package/dist/chunks/{Doctor-Cr_MlSPc.js → Doctor-0Nv3L1Oy.js} +1 -1
- package/dist/chunks/Doctor-Ba9zhV0V.js +1 -0
- package/dist/chunks/{ExitFlow-Bz5grDWv.js → ExitFlow-BPbtGcEg.js} +1 -1
- package/dist/chunks/{Feedback-COgMI5tY.js → Feedback-BSagYjmf.js} +1 -1
- package/dist/chunks/{Grove-m57x4tY1.js → Grove-BrP9JNpK.js} +1 -1
- package/dist/chunks/Grove-DyvIToPa.js +1 -0
- package/dist/chunks/{HybridTransport-Bok4-Ptt.js → HybridTransport-DLaxmXCR.js} +1 -1
- package/dist/chunks/{ITermBackend-BBSP-NNa.js → ITermBackend-tXN55G2D.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-uTSuSBvO.js → InvalidConfigDialog-BzFQdfwu.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-B-Os12-H.js → InvalidSettingsDialog-KFg61s41.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-y97Inszc.js → MCPConnectionManager-N-oJu3qn.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-DMFUZw92.js → McpParsingWarnings-DsHSSgsx.js} +1 -1
- package/dist/chunks/{MessageSelector-DwdAC2io.js → MessageSelector-D10JMnsc.js} +1 -1
- package/dist/chunks/Messages-CQdQJ2AA.js +11 -0
- package/dist/chunks/{Onboarding-B8qMJaBh.js → Onboarding-DBJX6Cnf.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-DnFv5z-z.js → OverageCreditUpsell-B4beCEX2.js} +1 -1
- package/dist/chunks/{PluginSettings-B_xVgTTp.js → PluginSettings-BBrFCSpQ.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-DhIQ0Nge.js → PromptInputFooterSuggestions-DAFZfAT0.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-CoMkWchC.js → PromptInputHelpMenu-Bjjr3tYl.js} +1 -1
- package/dist/chunks/{QueryEngine-C7r7O-hH.js → QueryEngine-BSk8-8vB.js} +1 -1
- package/dist/chunks/{REPL-CmJdJrGO.js → REPL-CXcCBQuz.js} +13 -13
- package/dist/chunks/REPL-D-akKdFc.js +1 -0
- package/dist/chunks/{RemoteCallout-4JOZROfT.js → RemoteCallout-CuxqarhC.js} +1 -1
- package/dist/chunks/RemoteSessionManager-BhPF41Wn.js +2 -0
- package/dist/chunks/{ResumeConversation-CZ2Uedkf.js → ResumeConversation-hmIOkZ2U.js} +1 -1
- package/dist/chunks/{SSETransport-kEH_p4Yq.js → SSETransport-8yaTbdSK.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-wDSdfnRo.js +1 -0
- package/dist/chunks/SentryErrorBoundary-Duyg6HeT.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-97iY7Nb7.js → SentryErrorBoundary-ydwbrVTx.js} +1 -1
- package/dist/chunks/{Settings-CuljH0mu.js → Settings-BSbzT25q.js} +2 -2
- package/dist/chunks/{TeleportProgress-Ctdqi7iS.js → TeleportProgress-CNcl_DxR.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DyTBg1YD.js → TeleportRepoMismatchDialog-DJc8_mjE.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-B66clYsG.js → TeleportResumeWrapper-Cw438s-J.js} +1 -1
- package/dist/chunks/{ThemePicker-WKmYvrqz.js → ThemePicker-8X6yAwuQ.js} +1 -1
- package/dist/chunks/{TmuxBackend-OKX2NP14.js → TmuxBackend-CqAnVFoI.js} +1 -1
- package/dist/chunks/{TrustDialog-0anSIf-G.js → TrustDialog-Ch1FJzxi.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-CfgC1KJb.js → ValidationErrorsList-sgfvJPWZ.js} +1 -1
- package/dist/chunks/{WelcomeV2-BMHXiNt3.js → WelcomeV2-Bu8l3w90.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-fCSGVe4W.js → WindowsTerminalBackend-Bvq7nHOp.js} +1 -1
- package/dist/chunks/{add-dir-CMtuW667.js → add-dir-DqrRNnxe.js} +1 -1
- package/dist/chunks/{agentDisplay-CgYKW3G7.js → agentDisplay-DcxzWi1v.js} +1 -1
- package/dist/chunks/{agents-CdqcGm9o.js → agents-Do1ynqiW.js} +1 -1
- package/dist/chunks/{agents-D90TsYOf.js → agents-QqLm1wcM.js} +1 -1
- package/dist/chunks/{ant-DZjimiuz.js → ant-D5gD6O-r.js} +1 -1
- package/dist/chunks/api-VMfJpk1G.js +1 -0
- package/dist/chunks/{api-CQWbpxLP.js → api-hcsOinLV.js} +1 -1
- package/dist/chunks/artifacts-DH8c2yG0.js +1 -0
- package/dist/chunks/{assistant-CEmC_DlU.js → assistant-CemNvrYr.js} +1 -1
- package/dist/chunks/assistant-D7D1sqTB.js +1 -0
- package/dist/chunks/{assistant-CyVcFPIR.js → assistant-DkECAILU.js} +1 -1
- package/dist/chunks/auth-CGdLe3rq.js +1 -0
- package/dist/chunks/{auth-DsQEVs9W.js → auth-Dm8aWPRh.js} +1 -1
- package/dist/chunks/{autoMode-DEbM9UaE.js → autoMode-dygqoN_C.js} +1 -1
- package/dist/chunks/{autonomy-Clap6Swl.js → autonomy-BdxnxJnk.js} +1 -1
- package/dist/chunks/{autonomy-lNpGnyiu.js → autonomy-DPeEmb00.js} +1 -1
- package/dist/chunks/{autonomyPanel-BqEvfI0e.js → autonomyPanel-Bocl2taZ.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-4H6yTjsj.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-KvOpP_4M.js → backgroundHousekeeping-zf-tDimg.js} +2 -2
- package/dist/chunks/{banner-D9Cq292T.js → banner-DUL-7A0b.js} +1 -1
- package/dist/chunks/{branch-CSYB04xC.js → branch-DwdVgun5.js} +1 -1
- package/dist/chunks/{break-cache-DrIa8RdW.js → break-cache-DjCRzxDv.js} +1 -1
- package/dist/chunks/{bridge-DDgASypO.js → bridge-DkkMogD_.js} +2 -2
- package/dist/chunks/bridgeConfig-CTJBoASk.js +1 -0
- package/dist/chunks/{bridgeConfig-DjC4oig1.js → bridgeConfig-l6Ldi_hk.js} +1 -1
- package/dist/chunks/{bridgeEnabled-Csn6Ym3k.js → bridgeEnabled-DYclTb9d.js} +1 -1
- package/dist/chunks/bridgeEnabled-SMuWz3Is.js +1 -0
- package/dist/chunks/{bridgeMain-B5wsmwkN.js → bridgeMain-Ct5oDosG.js} +11 -11
- package/dist/chunks/bridgeMain-UqwOi37W.js +1 -0
- package/dist/chunks/{bridgeMessaging-ChOzzVWj.js → bridgeMessaging-CYe1Cixl.js} +1 -1
- package/dist/chunks/{btw-BgjcOoeo.js → btw-CyOlY5R-.js} +1 -1
- package/dist/chunks/{buddy-C1wE3noR.js → buddy-q-utA1_5.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-C0diGLRB.js → bypassPermissionsKillswitch-CTrRxzdz.js} +1 -1
- package/dist/chunks/{caches-CIoVGP24.js → caches-Bz4yVQyE.js} +2 -2
- package/dist/chunks/caches-DKMoKTAZ.js +1 -0
- package/dist/chunks/{ccrClient-C1msT1E3.js → ccrClient-DXiEw9xU.js} +1 -1
- package/dist/chunks/changeDetector--KPj2maX.js +1 -0
- package/dist/chunks/{channelNotification-CWlu9ZWs.js → channelNotification-CLPdvxGZ.js} +1 -1
- package/dist/chunks/channelNotification-fJgjqRMx.js +1 -0
- package/dist/chunks/{chrome-Bo9uNZ7s.js → chrome-DxbhLWDW.js} +1 -1
- package/dist/chunks/clear-CYVCwiwu.js +1 -0
- package/dist/chunks/client-DvWRsIpi.js +1 -0
- package/dist/chunks/{color-CkzktPHt.js → color-DiLtK8_L.js} +1 -1
- package/dist/chunks/commands-BT2_ICaW.js +1 -0
- package/dist/chunks/commitAttribution-Bpbro1a4.js +1 -0
- package/dist/chunks/{commitAttribution-csu3NO7Y.js → commitAttribution-CJXF8wMs.js} +1 -1
- package/dist/chunks/{compact-DNGIVZRN.js → compact-C6xm1N5a.js} +1 -1
- package/dist/chunks/{companion-Diuav3lA.js → companion-rXSt0nmz.js} +1 -1
- package/dist/chunks/{config-B25IrkTA.js → config-BE3jrcr-.js} +1 -1
- package/dist/chunks/{config-ODoYZY8i.js → config-CzC08IjE.js} +1 -1
- package/dist/chunks/{context-CZ5enuPE.js → context-BHE99SMA.js} +1 -1
- package/dist/chunks/context-noninteractive-BQDOgVUW.js +1 -0
- package/dist/chunks/{context-noninteractive-62P5EnN5.js → context-noninteractive-BZQIUH_y.js} +13 -13
- package/dist/chunks/conversation-Bt6QdGd-.js +1 -0
- package/dist/chunks/{conversation-DyhWeHw2.js → conversation-CBPRFDod.js} +1 -1
- package/dist/chunks/{copy-9JLr2-Xs.js → copy-TgphIVzy.js} +1 -1
- package/dist/chunks/{createSSHSession-B1hTuDpB.js → createSSHSession-CSKEZ4ic.js} +1 -1
- package/dist/chunks/createSession-BaHXBnfG.js +1 -0
- package/dist/chunks/{createSession-fzjzy0aS.js → createSession-Ce218tQj.js} +1 -1
- package/dist/chunks/{cronJitterConfig-9OmmYmIT.js → cronJitterConfig-CnKed5Gi.js} +1 -1
- package/dist/chunks/crossProjectResume-BFlsTYOq.js +40 -0
- package/dist/chunks/{daemon-BRKR4D1D.js → daemon-Bu0Uy-qG.js} +1 -1
- package/dist/chunks/{datadog-SSxsxcC-.js → datadog-D5jSRybW.js} +1 -1
- package/dist/chunks/datadog-DgYqUGa-.js +1 -0
- package/dist/chunks/{desktop-CQnMcbex.js → desktop-cjA0tGOa.js} +1 -1
- package/dist/chunks/{diff-uAwKYa51.js → diff-DMd61IjE.js} +1 -1
- package/dist/chunks/{doctor-CBF0fkBF.js → doctor-ueUYyjyL.js} +1 -1
- package/dist/chunks/earlyInput-DEZaWwKF.js +1 -0
- package/dist/chunks/{effort-F-bhAM2u.js → effort-B9IvAstG.js} +1 -1
- package/dist/chunks/entry-Bq_KRMWs.js +14 -0
- package/dist/chunks/{envLessBridgeConfig-Dg0hNsdi.js → envLessBridgeConfig-CpjlwmvF.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-D_GCqhTu.js +1 -0
- package/dist/chunks/{exit-CqcvZJwI.js → exit-DtjFIrvJ.js} +1 -1
- package/dist/chunks/{export-c6WoGlsG.js → export-CP638-TO.js} +1 -1
- package/dist/chunks/{exportRenderer-CaegIP5N.js → exportRenderer-B5emJDvn.js} +1 -1
- package/dist/chunks/extra-usage-C4dUWLhg.js +1 -0
- package/dist/chunks/{extra-usage-Cj8fokgc.js → extra-usage-DIm8nrKj.js} +1 -1
- package/dist/chunks/{extra-usage-core-sHzc4eE1.js → extra-usage-core-DERKSEe1.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-D0kqrqsg.js → extra-usage-noninteractive-Dq5dog_-.js} +1 -1
- package/dist/chunks/{extraUsage-CbkqfG1U.js → extraUsage-BMvDY0Sk.js} +1 -1
- package/dist/chunks/extractMemories-DS7XXeEo.js +1 -0
- package/dist/chunks/{fast-DS3iQ1CH.js → fast-BP2t1xDM.js} +1 -1
- package/dist/chunks/fast-D1xIHYaN.js +1 -0
- package/dist/chunks/{feedback-QJynmG5q.js → feedback-C-mR6zJr.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-DlW8BUXq.js → firstPartyEventLogger-sMmHdYjg.js} +1 -1
- package/dist/chunks/{flushGate-CK5B9-Zn.js → flushGate-C18XwNsa.js} +1 -1
- package/dist/chunks/{gates-vlrMjO-X.js → gates-Be5r2kKS.js} +1 -1
- package/dist/chunks/gates-CUAwAhPL.js +1 -0
- package/dist/chunks/{gemini-B5ZRjDrh.js → gemini-BberPcp1.js} +1 -1
- package/dist/chunks/{generateRecap-SgRMdsyN.js → generateRecap-B76UcVUS.js} +1 -1
- package/dist/chunks/{generateSessionName-sZFzpwsq.js → generateSessionName-BwtXd8TC.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-DUGvTwPB.js → githubRepoPathMapping-5IlVgR2l.js} +1 -1
- package/dist/chunks/{goal-Dy-GGn9r.js → goal-DQ0jNcLO.js} +1 -1
- package/dist/chunks/{grok-BG4_buNt.js → grok-Dh_thT2_.js} +1 -1
- package/dist/chunks/{growthbook-Br1dDRtd.js → growthbook-4ADV3CAt.js} +1 -1
- package/dist/chunks/{heapdump-B9PVKMxa.js → heapdump-Dwqmh4SX.js} +1 -1
- package/dist/chunks/{help-BfWF7xij.js → help-Bznaywoi.js} +1 -1
- package/dist/chunks/hooks-DynUngv2.js +1 -0
- package/dist/chunks/{hooks-KK32pxq3.js → hooks-F-82cg6M.js} +1 -1
- package/dist/chunks/{hostAdapter-TBJav3vX.js → hostAdapter-DpfLr3hX.js} +1 -1
- package/dist/chunks/{ide-BU1A79BE.js → ide-BfAKWufQ.js} +1 -1
- package/dist/chunks/{inboundAttachments-D4tBPCB8.js → inboundAttachments-CFV_eqMu.js} +1 -1
- package/dist/chunks/inboundAttachments-Cug-8Xdy.js +1 -0
- package/dist/chunks/{initReplBridge-99sUBVEk.js → initReplBridge-DV9KhSic.js} +1 -1
- package/dist/chunks/{insights-lDHodCMG.js → insights-BNsCwNYa.js} +1 -1
- package/dist/chunks/{install-Bg4ZgW81.js → install-Bszzs98N.js} +1 -1
- package/dist/chunks/{install-github-app-RLbUq5EL.js → install-github-app-DVxGR2rp.js} +1 -1
- package/dist/chunks/{install-slack-app-CHmIwsbm.js → install-slack-app-CjlRL19o.js} +1 -1
- package/dist/chunks/{instrumentation-BCiV3SKX.js → instrumentation-BOYPOtyu.js} +3 -3
- package/dist/chunks/{job-xOGf0j5Q.js → job-BvD5_lGz.js} +1 -1
- package/dist/chunks/{keybindings-DMbReZ4p.js → keybindings-RPmPPGhp.js} +1 -1
- package/dist/chunks/{lang-A6LUGP_7.js → lang-9VNaOJMz.js} +1 -1
- package/dist/chunks/language-CjFs6_la.js +1 -0
- package/dist/chunks/{language-CGfURU2y.js → language-Ct5Nkqm6.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-Dbpm7Jyo.js → launchAgentsPlatform-CnoxFIXV.js} +1 -1
- package/dist/chunks/{launchAutofixPr-RZfqx5eM.js → launchAutofixPr-ChaDUtvx.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DIntbsvg.js → launchLocalMemory-MwZfEJxz.js} +1 -1
- package/dist/chunks/{launchLocalVault-CCUw0ayu.js → launchLocalVault-B6Ib5WXx.js} +1 -1
- package/dist/chunks/{launchMemoryStores-QJTh8KSP.js → launchMemoryStores-D6xyGwQ1.js} +1 -1
- package/dist/chunks/{launchOnboarding--Pe30AYd.js → launchOnboarding-BtdAOO3p.js} +1 -1
- package/dist/chunks/{launchSchedule-DjN1RbRX.js → launchSchedule-XVljzNKg.js} +1 -1
- package/dist/chunks/{launchSkillStore-CcKmVDz1.js → launchSkillStore-QT8Qcc5N.js} +1 -1
- package/dist/chunks/{launchTeleport-BKlEo0yF.js → launchTeleport-DwxPesKQ.js} +1 -1
- package/dist/chunks/{launchVault-C7UHA-IG.js → launchVault-Dbti6pph.js} +1 -1
- package/dist/chunks/{loadAgentsDir-ClTeo0nk.js → loadAgentsDir-BYWykYwn.js} +727 -727
- package/dist/chunks/loadAgentsDir-tPgCg0WD.js +1 -0
- package/dist/chunks/{loadPluginHooks-DVZmzYLl.js → loadPluginHooks-2U3UO__Q.js} +1 -1
- package/dist/chunks/localSearch-CxwxzM8W.js +1 -0
- package/dist/chunks/{localSearch-Koc8naSr.js → localSearch-eWjZxMc8.js} +1 -1
- package/dist/chunks/login-CVVFklZw.js +1 -0
- package/dist/chunks/{login-C3MZQTDL.js → login-D1aQCqp0.js} +1 -1
- package/dist/chunks/{logoV2Utils-DAIIwt5R.js → logoV2Utils-CPNvLtol.js} +1 -1
- package/dist/chunks/logout-BYsszpXx.js +1 -0
- package/dist/chunks/{magicDocs-C_inI3JJ.js → magicDocs-DAvjAbAJ.js} +1 -1
- package/dist/chunks/{main-qqcmncHA.js → main-BKlQiSuc.js} +130 -51
- package/dist/chunks/{mappers-7BSMbYvH.js → mappers-BBkM1aA5.js} +1 -1
- package/dist/chunks/{mcp-HQ8-nEZ1.js → mcp-C3jlClk0.js} +2 -2
- package/dist/chunks/{mcp-DV8Prhgi.js → mcp-Cmw8ecKk.js} +1 -1
- package/dist/chunks/{mcp-DRBiobrN.js → mcp-ya96irNP.js} +1 -1
- package/dist/chunks/{mcpServer-CLIYAgGs.js → mcpServer-B1q9blAc.js} +1 -1
- package/dist/chunks/{mcpServer-DS0yRfcu.js → mcpServer-BJB5g6j2.js} +1 -1
- package/dist/chunks/{memory-Cz_JaFLF.js → memory-CxiukAGg.js} +1 -1
- package/dist/chunks/{mode-Kx0kSZkr.js → mode-DqAJ2y6R.js} +1 -1
- package/dist/chunks/{model-CNXtfiLg.js → model-C8TW-qjl.js} +1 -1
- package/dist/chunks/model-VB4ItNVB.js +1 -0
- package/dist/chunks/{onChangeAppState-C4ic-Mib.js → onChangeAppState-BG1pF7ht.js} +1 -1
- package/dist/chunks/{openai-CGGSfpPh.js → openai-CHoRhRtf.js} +1 -1
- package/dist/chunks/{overageCreditGrant-BqW_6R5v.js → overageCreditGrant-DYMg1lV4.js} +1 -1
- package/dist/chunks/{panel-D3wvAEFE.js → panel-BY6q16am.js} +1 -1
- package/dist/chunks/{panel-BYfvo_mR.js → panel-BdRBXAv3.js} +1 -1
- package/dist/chunks/panelCall-SYrmrKt9.js +1 -0
- package/dist/chunks/{passes-sYE91Vtr.js → passes-CSV-SZJc.js} +1 -1
- package/dist/chunks/{paths-DO4WOQtD.js → paths-BZjPDxMm.js} +3 -3
- package/dist/chunks/{permissions-BPerbf1I.js → permissions-DBddT2NP.js} +1 -1
- package/dist/chunks/{pipeTransport-CW9zF_UN.js → pipeTransport-uK7GxbSG.js} +1 -1
- package/dist/chunks/{plan-CDKBVRw6.js → plan-DEbo-Adi.js} +1 -1
- package/dist/chunks/{plugin-C6US4b8W.js → plugin-Cops24hg.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-BQKtcAhC.js → pluginAutoupdate-Bg7JMOHN.js} +1 -1
- package/dist/chunks/{pluginBlocklist-B8DKXi0i.js → pluginBlocklist-DEM_RWc2.js} +1 -1
- package/dist/chunks/{pluginCliCommands-DWCeXYTl.js → pluginCliCommands-DyYEg7Cv.js} +1 -1
- package/dist/chunks/{pluginFlagging-DFMlWw2P.js → pluginFlagging-DwChUZMJ.js} +1 -1
- package/dist/chunks/{pluginOperations-CKmwDC3G.js → pluginOperations-COyT4tHs.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-D6IbyWKe.js → pluginStartupCheck-DCxJJkYs.js} +1 -1
- package/dist/chunks/pluginStartupCheck-DjfIaOch.js +1 -0
- package/dist/chunks/{plugins-BwZIRMh_.js → plugins-BanQjHmw.js} +1 -1
- package/dist/chunks/policyLimits-D-Y_soHx.js +1 -0
- package/dist/chunks/{pollConfig-C3NjXYFc.js → pollConfig-DBNHhvHf.js} +1 -1
- package/dist/chunks/{poor-BHhbua95.js → poor-aPQce502.js} +1 -1
- package/dist/chunks/{poorMode-mtlnXU-z.js → poorMode-CFRuV-nB.js} +1 -1
- package/dist/chunks/poorMode-DQagHYWe.js +1 -0
- package/dist/chunks/{print-kxnXkqGc.js → print-Cf2tY__0.js} +4 -4
- package/dist/chunks/{privacy-settings-DjY1annR.js → privacy-settings-CYkM3Aem.js} +1 -1
- package/dist/chunks/{processBashCommand-BrqLqSva.js → processBashCommand-BLSC8o8M.js} +1 -1
- package/dist/chunks/{processSlashCommand-DJGdVGbK.js → processSlashCommand-Ch9B-6nh.js} +1 -1
- package/dist/chunks/projectContext-2CzYVggO.js +1 -0
- package/dist/chunks/projectContext-CVk2Ix1r.js +1 -0
- package/dist/chunks/{prompt-CfM_xGPc.js → prompt-BGNhFY1n.js} +1 -1
- package/dist/chunks/prompt-CrNwH5kr.js +1 -0
- package/dist/chunks/prompt-dH0MMivt.js +1 -0
- package/dist/chunks/{promptEditor-FI_ewCpV.js → promptEditor-U03qQWbq.js} +1 -1
- package/dist/chunks/{protocolHandler-B7ybKpgJ.js → protocolHandler-3yBj9w5N.js} +1 -1
- package/dist/chunks/{rate-limit-options-DPJMNNou.js → rate-limit-options-D-xl_9PO.js} +1 -1
- package/dist/chunks/{rcDebugLog-CwU_wJBE.js → rcDebugLog-ClX1msJX.js} +1 -1
- package/dist/chunks/{referral-Da4mpbd3.js → referral-qe-yqXJE.js} +1 -1
- package/dist/chunks/{refresh-B6X4xb9r.js → refresh-CO_P3WKA.js} +1 -1
- package/dist/chunks/{registerProtocol-D8fFnceq.js → registerProtocol-CClQph00.js} +1 -1
- package/dist/chunks/{registry-y_z3pTg3.js → registry-C0zdU2Hb.js} +1 -1
- package/dist/chunks/{release-notes--tnd4K56.js → release-notes-CyZHxWTF.js} +1 -1
- package/dist/chunks/{releaseNotes-BPA229-J.js → releaseNotes-BtxL5R5Q.js} +2 -2
- package/dist/chunks/{reload-plugins-yQ7tEUVh.js → reload-plugins-B0eR8JHH.js} +1 -1
- package/dist/chunks/{remote-env-CER5UxTX.js → remote-env-B_sIjY87.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Bi31i8gt.js → remoteBridgeCore-C3WRaLpU.js} +1 -1
- package/dist/chunks/{remoteControlServer-oUAcWB4i.js → remoteControlServer-BOj9qmgH.js} +1 -1
- package/dist/chunks/{rename-BTngRRZU.js → rename-BFAC3WLD.js} +1 -1
- package/dist/chunks/{resume-DZHKfBmm.js → resume-CpivBr9S.js} +1 -1
- package/dist/chunks/{runtimeObserver-B4KekIF0.js → runtimeObserver-C2_7Vsnd.js} +1 -1
- package/dist/chunks/{runtimeObserver-BUOcYxiK.js → runtimeObserver-sOnfVR7t.js} +2 -2
- package/dist/chunks/sandbox-adapter-jX_WzvnK.js +1 -0
- package/dist/chunks/{sandbox-toggle-DLBL7myN.js → sandbox-toggle-Bv68-Ca7.js} +1 -1
- package/dist/chunks/searchExtraTools-xPuOKDpi.js +1 -0
- package/dist/chunks/{sentry-B7ZBc8fA.js → sentry-BBCn6RGP.js} +1 -1
- package/dist/chunks/{session-DWYQk9YN.js → session-DfvxYP8o.js} +1 -1
- package/dist/chunks/{sessionDiscovery-BP0nv36F.js → sessionDiscovery-CyuRBTAm.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DiKsr7H7.js +1 -0
- package/dist/chunks/sessionMemory-C34-eFnJ.js +1 -0
- package/dist/chunks/{sessionMemory-pT4lc1C-.js → sessionMemory-kYQnpcyG.js} +1 -1
- package/dist/chunks/sessionMemoryUtils-CcJcgftx.js +1 -0
- package/dist/chunks/sessionObserver-B73s6yu8.js +1 -0
- package/dist/chunks/{sessionObserver-D4SV0Ar3.js → sessionObserver-CTkIYplM.js} +1 -1
- package/dist/chunks/sessionStorage-BHi7PKs-.js +1 -0
- package/dist/chunks/{sessionTitle-CkrnWEW1.js → sessionTitle-ePQRpeV2.js} +1 -1
- package/dist/chunks/{sessionTracing-Caw-kvQr.js → sessionTracing-81-RIJBo.js} +1 -1
- package/dist/chunks/{settingsSync-Dn_lGonC.js → settingsSync-DEFWnE1o.js} +1 -1
- package/dist/chunks/{setup-II1titXI.js → setup-2611vmGJ.js} +1 -1
- package/dist/chunks/{setup-DGkOT4DX.js → setup-BJSk1czd.js} +3 -2
- package/dist/chunks/{setup-Dihjl7jo.js → setup-CTfYsKsz.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-DASW3j9H.js → shadowedRuleDetection-CGD7Nx03.js} +1 -1
- package/dist/chunks/{sideQuestion-C1qbLTAL.js → sideQuestion-BcP9Mm-5.js} +1 -1
- package/dist/chunks/{sink-CqOAfFlL.js → sink-D_t1TIt9.js} +1 -1
- package/dist/chunks/sink-i8NmYch9.js +1 -0
- package/dist/chunks/sinks-3w0mLszx.js +1 -0
- package/dist/chunks/{sinks-BT_lBY6T.js → sinks-DXsozhmS.js} +2 -2
- package/dist/chunks/{skill-learning-kh0HKn6u.js → skill-learning-CZm2iMik.js} +2 -2
- package/dist/chunks/{skillChangeDetector-DQuNepIV.js → skillChangeDetector-1aFn40GC.js} +1 -1
- package/dist/chunks/{skillGapStore-CFmLJlYm.js → skillGapStore-DzHv8v-D.js} +1 -1
- package/dist/chunks/{skillGapStore-B1gUQXhE.js → skillGapStore-cWo6Ra90.js} +2 -2
- package/dist/chunks/{skillGenerator-DIAwRpPg.js → skillGenerator-D_W1IeP3.js} +2 -2
- package/dist/chunks/skillLearning-Bddmbx8E.js +1 -0
- package/dist/chunks/skillLearning-C-uI_jZB.js +1 -0
- package/dist/chunks/{skillPanel-B9zJLHKV.js → skillPanel-ChmOZu4F.js} +3 -3
- package/dist/chunks/{skillSearchPanel-C1O9sxYS.js → skillSearchPanel-CVx2b4Pr.js} +2 -2
- package/dist/chunks/{skills-C6_3snFY.js → skills-CWX1SydA.js} +1 -1
- package/dist/chunks/{sprites-59l7vF4l.js → sprites-BuvEFwW6.js} +1 -1
- package/dist/chunks/startupProfiler-CBcN1Chw.js +3 -0
- package/dist/chunks/startupProfiler-DtTgsdnI.js +1 -0
- package/dist/chunks/{stats-BmGdg4nj.js → stats-wjMQA-CA.js} +1 -1
- package/dist/chunks/{status-KLPT7uYP.js → status-CyU7IQhO.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-DuqyBY-N.js → statusNoticeHelpers-JNibsI_v.js} +1 -1
- package/dist/chunks/{tag-0vahEnrx.js → tag-opEEZI5B.js} +1 -1
- package/dist/chunks/{tasks-zVPemGv7.js → tasks-CCtnU5u1.js} +1 -1
- package/dist/chunks/{teamHelpers-CXAmvFco.js → teamHelpers-BJJs8taN.js} +1 -1
- package/dist/chunks/teamHelpers-D41zdxpl.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-CdiglTzv.js → teammateModeSnapshot-CLiiOCkO.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-q-bARbLL.js +1 -0
- package/dist/chunks/{teleport-D6PvdjPy.js → teleport-ClxQigSQ.js} +1 -1
- package/dist/chunks/{templateJobs-Ox5ZTKjW.js → templateJobs-C6D7GC-Q.js} +1 -1
- package/dist/chunks/{terminalSetup-hLCi-2uB.js → terminalSetup-2ioFcRAA.js} +1 -1
- package/dist/chunks/{terminalSetup-Dh70ynBX.js → terminalSetup-B3bN4Cj8.js} +1 -1
- package/dist/chunks/{theme-DxgUVq9C.js → theme-Dgq_Og2P.js} +1 -1
- package/dist/chunks/thinkback-BE8NNmAo.js +1 -0
- package/dist/chunks/{thinkback-DWgU7Qhr.js → thinkback-C43WBHis.js} +1 -1
- package/dist/chunks/{thinkback-play-CDzY6Ux4.js → thinkback-play-D2_n_aoQ.js} +1 -1
- package/dist/chunks/{toolEventObserver-jO6-mlFU.js → toolEventObserver-B7EA-nNa.js} +1 -1
- package/dist/chunks/{toolEventObserver-DPoMAJwr.js → toolEventObserver-BG_3sGCL.js} +1 -1
- package/dist/chunks/toolPool-BLshLuvo.js +1 -0
- package/dist/chunks/{toolPool-Dgn1Clq8.js → toolPool-HYKCHxDA.js} +1 -1
- package/dist/chunks/{trustedDevice-D35gYkBT.js → trustedDevice-DeNxe6bl.js} +1 -1
- package/dist/chunks/{trustedDevice-CYR5AgSB.js → trustedDevice-S34i6Jc9.js} +1 -1
- package/dist/chunks/{tui-DoOiz2RW.js → tui-DcXIK0fP.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-o4GjzoXK.js → ultrareviewCommand-C45bmZqN.js} +1 -1
- package/dist/chunks/undercover-B4sdXe12.js +1 -0
- package/dist/chunks/{undercover-B4xr62Ux.js → undercover-DoUSM8d6.js} +1 -1
- package/dist/chunks/{updateCCB-Cthn50OV.js → updateCCB-BuAm25MX.js} +1 -1
- package/dist/chunks/{upgrade-D4Id4ebd.js → upgrade-BDKg286g.js} +1 -1
- package/dist/chunks/upgrade-BiWGhm2d.js +1 -0
- package/dist/chunks/{upload-BFDXvdfb.js → upload-CMptZXZs.js} +1 -1
- package/dist/chunks/{usage-DxudeFLL.js → usage-Bw_LK9YI.js} +1 -1
- package/dist/chunks/{usage-Csbso5mD.js → usage-DEWsKPXj.js} +1 -1
- package/dist/chunks/{useMainLoopModel-CEqP4HOc.js → useMainLoopModel-D0PmGDuy.js} +1 -1
- package/dist/chunks/{useManagePlugins-BmS3Adja.js → useManagePlugins-B-ejJsXy.js} +1 -1
- package/dist/chunks/{useMergedTools-wR6Bglqq.js → useMergedTools-B6x9qtfj.js} +1 -1
- package/dist/chunks/{useSearchInput-BhKAGgEN.js → useSearchInput-BpMLsxaS.js} +1 -1
- package/dist/chunks/{useSettingsErrors-CjK3P-Ki.js → useSettingsErrors-DUe4k_RK.js} +1 -1
- package/dist/chunks/{useVoice-DP1hHBWA.js → useVoice-C3ryR2HE.js} +1 -1
- package/dist/chunks/{util-CMSErQoz.js → util-DWl5gjmI.js} +1 -1
- package/dist/chunks/utils-DP3EtI6F.js +1 -0
- package/dist/chunks/{validatePlugin-_g0AqWZG.js → validatePlugin-8EMSASvV.js} +1 -1
- package/dist/chunks/{vim-8y-2Q09k.js → vim-CaZ20SrQ.js} +1 -1
- package/dist/chunks/{voice-BJAsr0K-.js → voice-BrnKguEV.js} +1 -1
- package/dist/chunks/{voiceModeEnabled-BD9GZhQ3.js → voiceModeEnabled-3eg8vSqy.js} +1 -1
- package/dist/chunks/voiceModeEnabled-B1ARFTcz.js +1 -0
- package/dist/chunks/voiceStreamSTT-CONK4g-B.js +1 -0
- package/dist/chunks/{voiceStreamSTT-B1T-8adN.js → voiceStreamSTT-D7jWIYwz.js} +1 -1
- package/dist/chunks/{web-tools-DVIvcP41.js → web-tools-BT3TbzG5.js} +1 -1
- package/dist/chunks/{workerRegistry-60_UCyc3.js → workerRegistry-C_i5wwjL.js} +1 -1
- package/dist/chunks/worktree-CFNQKVGn.js +1 -0
- package/dist/chunks/{xml-CTdKuU6f.js → xml-DOXio8vw.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-B7_TCGwt.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +0 -1
- package/dist/chunks/Doctor-hgf3dMAW.js +0 -1
- package/dist/chunks/Grove-Bwmghb-e.js +0 -1
- package/dist/chunks/Messages-FEBcX-cT.js +0 -11
- package/dist/chunks/REPL-nP7H_-qa.js +0 -1
- package/dist/chunks/RemoteSessionManager-jcPnywfY.js +0 -2
- package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +0 -1
- package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +0 -1
- package/dist/chunks/api-quOYYOhi.js +0 -1
- package/dist/chunks/assistant-B5_xx00q.js +0 -1
- package/dist/chunks/auth-CjtaiRtF.js +0 -1
- package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +0 -1
- package/dist/chunks/bridgeConfig-BdZVEqhx.js +0 -1
- package/dist/chunks/bridgeEnabled-DLRIH243.js +0 -1
- package/dist/chunks/bridgeMain-BN0Sag35.js +0 -1
- package/dist/chunks/caches-DMYdTEAr.js +0 -1
- package/dist/chunks/ccshareResume-DKwcd0Vc.js +0 -1
- package/dist/chunks/changeDetector-DoOBZOt1.js +0 -1
- package/dist/chunks/channelNotification-oZ6vG5R5.js +0 -1
- package/dist/chunks/clear-BxdX_MUP.js +0 -1
- package/dist/chunks/client-BSoJ_vaA.js +0 -1
- package/dist/chunks/commands-hyVX9-Lh.js +0 -1
- package/dist/chunks/commitAttribution-BwT0TbYF.js +0 -1
- package/dist/chunks/context-noninteractive-CjuzL9q5.js +0 -1
- package/dist/chunks/conversation-uY-V0SNK.js +0 -1
- package/dist/chunks/createSession-Qurw-N4x.js +0 -1
- package/dist/chunks/crossProjectResume-B6efoIur.js +0 -40
- package/dist/chunks/datadog-C-llbwzP.js +0 -1
- package/dist/chunks/earlyInput-D3OhUZ4G.js +0 -1
- package/dist/chunks/entry-DHN_Gr1b.js +0 -14
- package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +0 -1
- package/dist/chunks/extra-usage-Dk-wcvAu.js +0 -1
- package/dist/chunks/extractMemories-BP8Opsbp.js +0 -1
- package/dist/chunks/fast-DklfqySb.js +0 -1
- package/dist/chunks/gates-6amRNsYl.js +0 -1
- package/dist/chunks/hooks-BVrhxysz.js +0 -1
- package/dist/chunks/inboundAttachments-DWJplT9p.js +0 -1
- package/dist/chunks/language-Bzp5KDCE.js +0 -1
- package/dist/chunks/loadAgentsDir-CshktEpX.js +0 -1
- package/dist/chunks/localSearch-BtLNJRij.js +0 -1
- package/dist/chunks/login-BngE89_j.js +0 -1
- package/dist/chunks/logout-CXZBaUen.js +0 -1
- package/dist/chunks/model-Bwvn_acH.js +0 -1
- package/dist/chunks/panelCall-DgPjuhQf.js +0 -1
- package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +0 -1
- package/dist/chunks/policyLimits-CFLBtFh3.js +0 -1
- package/dist/chunks/poorMode-CCK7Ek5w.js +0 -1
- package/dist/chunks/projectContext-Cd7V9pES.js +0 -1
- package/dist/chunks/projectContext-Dn7umMp6.js +0 -1
- package/dist/chunks/prompt-BZjXpviP.js +0 -1
- package/dist/chunks/prompt-CusKF4-p.js +0 -1
- package/dist/chunks/sandbox-adapter-C--j-c76.js +0 -1
- package/dist/chunks/searchExtraTools-CBYp5XeI.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +0 -1
- package/dist/chunks/sessionMemory-cMgcTxtP.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +0 -1
- package/dist/chunks/sessionObserver-CzyEF7mg.js +0 -1
- package/dist/chunks/sessionStorage-CXBgVAx-.js +0 -1
- package/dist/chunks/sink-BSPyC453.js +0 -1
- package/dist/chunks/sinks-CpuRIC3H.js +0 -1
- package/dist/chunks/skillLearning-Bxu1Uzl-.js +0 -1
- package/dist/chunks/skillLearning-CxAbHYEk.js +0 -1
- package/dist/chunks/startupProfiler-CAntGAbs.js +0 -3
- package/dist/chunks/startupProfiler-WtUzkMKV.js +0 -1
- package/dist/chunks/teamHelpers-B83RwCCC.js +0 -1
- package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +0 -1
- package/dist/chunks/thinkback-C5vFU8dM.js +0 -1
- package/dist/chunks/toolPool-BmA-BnAq.js +0 -1
- package/dist/chunks/undercover-nakrQDLh.js +0 -1
- package/dist/chunks/upgrade-DJTCV8sr.js +0 -1
- package/dist/chunks/utils-CAQfwbv8.js +0 -1
- package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +0 -1
- package/dist/chunks/voiceStreamSTT-B39XaGOU.js +0 -1
- package/dist/chunks/worktree-DNK8NprA.js +0 -1
- /package/dist/chunks/{InProcessTransport-B9II3BiO.js → InProcessTransport-DW2ed2Hs.js} +0 -0
- /package/dist/chunks/{PermissionDialog-_WQPRYHQ.js → PermissionDialog-R-Vl4Tk-.js} +0 -0
- /package/dist/chunks/{PressEnterToContinue-BJ58eCFC.js → PressEnterToContinue-BYdiZwYD.js} +0 -0
- /package/dist/chunks/{SearchBox-CkO4rQ-9.js → SearchBox-Bu4gYF0J.js} +0 -0
- /package/dist/chunks/{attributionHooks-VGSpz4mk.js → attributionHooks-COqmxGy1.js} +0 -0
- /package/dist/chunks/{attributionTrailer-C8uqiLIb.js → attributionTrailer-Nx8I_ZRK.js} +0 -0
- /package/dist/chunks/{autoModeDenials-DlO5g6E9.js → autoModeDenials-BDpcFLb7.js} +0 -0
- /package/dist/chunks/{bedrockClient-BUmO2U-X.js → bedrockClient-BfPpXPI0.js} +0 -0
- /package/dist/chunks/{connectHeadless-ByewVfOb.js → connectHeadless-DutPm1RT.js} +0 -0
- /package/dist/chunks/{dangerousBackend-Dkjtndh1.js → dangerousBackend-BDKHrF6i.js} +0 -0
- /package/dist/chunks/{earlyInput-CFYRGxau.js → earlyInput-B3U01GAm.js} +0 -0
- /package/dist/chunks/{files-Bdr_PQyV.js → files-BGuNpYgH.js} +0 -0
- /package/dist/chunks/{fpsMetrics-DKWp7vng.js → fpsMetrics-DH78PzGr.js} +0 -0
- /package/dist/chunks/{fuse-D3B-UE5Y.js → fuse-D7icKomM.js} +0 -0
- /package/dist/chunks/{instinctParser-DOtj1Kni.js → instinctParser-BMtAMLSx.js} +0 -0
- /package/dist/chunks/{lockfile-C3JsqLpb.js → lockfile-DEaq0BaL.js} +0 -0
- /package/dist/chunks/{main-CfkIGrBF.js → main-SFdnVz-G.js} +0 -0
- /package/dist/chunks/{mobile-BMglW1NB.js → mobile-DLGq6g08.js} +0 -0
- /package/dist/chunks/{modalContext-c5Yqx_CQ.js → modalContext-CuTwi_eD.js} +0 -0
- /package/dist/chunks/{observationStore-rLlDwRtG.js → observationStore-Bi1rRKcD.js} +0 -0
- /package/dist/chunks/{openaiShared-C-AuktRP.js → openaiShared-BkVgd2rZ.js} +0 -0
- /package/dist/chunks/{output-style-B64-Zum6.js → output-style-F8fBWFZo.js} +0 -0
- /package/dist/chunks/{parseConnectUrl-DL390ePs.js → parseConnectUrl-CVT_db9n.js} +0 -0
- /package/dist/chunks/{poller-BA1jhG3F.js → poller-DhLgWNxJ.js} +0 -0
- /package/dist/chunks/{renderOptions-Caca3bCd.js → renderOptions-4HxIPoDZ.js} +0 -0
- /package/dist/chunks/{rewind-Djt1zU_3.js → rewind-FKh7loMA.js} +0 -0
- /package/dist/chunks/{sanitization-Ds6zRQyx.js → sanitization-B-JlvWcf.js} +0 -0
- /package/dist/chunks/{server-DONKdvGc.js → server-BsxW1FVq.js} +0 -0
- /package/dist/chunks/{serverBanner-DIyjgIM-.js → serverBanner-DR3GYXpH.js} +0 -0
- /package/dist/chunks/{serverLog-D1N5yx8A.js → serverLog-CH1fCGsD.js} +0 -0
- /package/dist/chunks/{sessionManager-BOmgJd1l.js → sessionManager-mesT4zIQ.js} +0 -0
- /package/dist/chunks/{staticRender-C5v46np_.js → staticRender-DKFIRhkH.js} +0 -0
- /package/dist/chunks/{stickers-DDAm--86.js → stickers-B0P4weWp.js} +0 -0
- /package/dist/chunks/{upstreamproxy-CLf1UaJv.js → upstreamproxy-D-6vdoIJ.js} +0 -0
- /package/dist/chunks/{voice-YtzCcIoM.js → voice-BXg-kzte.js} +0 -0
|
@@ -0,0 +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{Hr as re,Tt as ie,Vr as ae,cn as S,jr as C,lr as oe,ot as se}from"./state-sIHsFpDu.js";import{Dr as ce,Pr as le,no as ue,oc as de,oo as fe,yc as pe}from"./paths-BZjPDxMm.js";import{l as me,p as he,r as ge}from"./sessionStoragePortable-CJUZrbIq.js";import{Bf as _e,Ep as ve,Fr as ye,G as be,Jv as xe,K as Se,Sr as Ce,Ta as we,Tp as Te,Xu as Ee,Zi as De,Zu as Oe,bD as ke,i as Ae,na as je,o as Me,qv as Ne,wa as Pe,yD as Fe,zf as Ie}from"./loadAgentsDir-BYWykYwn.js";import{Qn as Le,Zn as Re}from"./prompt-BGNhFY1n.js";import{o as ze,t as Be}from"./fileStateCache-BhVfo23e.js";import{t as Ve}from"./QueryEngine-BSk8-8vB.js";import*as w from"node:path";import{dirname as He,isAbsolute as Ue,resolve as We}from"node:path";import{randomUUID as T}from"node:crypto";import{Readable as Ge,Writable as Ke}from"node:stream";import{unlink as qe}from"node:fs/promises";ne();var E={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`},D={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`},Je=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ye=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),Xe=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ze=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ye)}),Qe=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),$e=_([Ze.and(x({type:b(`env_var`)})),Qe.and(x({type:b(`terminal`)})),Xe]),et=x({_meta:m(p(),g()).nullish(),methodId:p()}),tt=x({_meta:m(p(),g()).nullish()}),nt=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),rt=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),it=x({_meta:m(p(),g()).nullish()}),at=x({_meta:m(p(),g()).nullish()}),ot=x({amount:f(),currency:p()}),st=x({_meta:m(p(),g()).nullish(),terminalId:p()}),ct=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),lt=_([p(),f(),f(),v(),h(p())]),ut=y(_([x({content:m(p(),lt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),dt=x({_meta:m(p(),g()).nullish()}),ft=p(),pt=x({_meta:m(p(),g()).nullish(),elicitationId:ft}),mt=b(`object`),ht=b(`string`),gt=x({_meta:m(p(),g()).nullish()}),_t=x({_meta:m(p(),g()).nullish(),form:dt.nullish(),url:gt.nullish()}),vt=x({const:p(),title:p()}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=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()}),xt=g(),St=g(),Ct=g(),wt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),Tt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),Et=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),Dt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),Ot=x({_meta:m(p(),g()).nullish()}),kt=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),At=x({_meta:m(p(),g()).nullish()}),jt=x({_meta:m(p(),g()).nullish(),logout:At.nullish()}),Mt=x({_meta:m(p(),g()).nullish()}),Nt=x({_meta:m(p(),g()).nullish()}),Pt=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),Ft=x({_meta:m(p(),g()).nullish(),headers:h(Tt),name:p(),url:p()}),It=x({_meta:m(p(),g()).nullish(),headers:h(Tt),name:p(),url:p()}),Lt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(yt),name:p()}),O=_([Ft.and(x({type:b(`http`)})),It.and(x({type:b(`sse`)})),Lt]),Rt=p(),zt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:Rt,name:p()}),Bt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Vt=x({_meta:m(p(),g()).nullish()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({_meta:m(p(),g()).nullish()}),Gt=x({_meta:m(p(),g()).nullish()}),Kt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),qt=x({diff:p(),uri:p()}),Jt=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()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({_meta:m(p(),g()).nullish()}),Zt=x({languageId:p(),text:p(),uri:p()}),Qt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),$t=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),en=x({excerpts:h(Jt),uri:p()}),tn=x({_meta:m(p(),g()).nullish()}),nn=x({_meta:m(p(),g()).nullish()}),rn=x({name:p(),owner:p(),remoteUrl:p()}),an=x({_meta:m(p(),g()).nullish()}),on=x({_meta:m(p(),g()).nullish(),jump:Yt.nullish(),rename:nn.nullish(),searchAndReplace:an.nullish()}),sn=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),cn=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),ln=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),un=x({_meta:m(p(),g()).nullish(),diagnostics:Vt.nullish(),editHistory:Kt.nullish(),openFiles:Xt.nullish(),recentFiles:Qt.nullish(),relatedSnippets:tn.nullish(),userActions:ln.nullish()}),dn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(O)}),fn=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),pn=p(),mn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),hn=x({_meta:m(p(),g()).nullish(),kind:mn,name:p(),optionId:pn}),gn=_([b(`high`),b(`medium`),b(`low`)]),_n=_([b(`pending`),b(`in_progress`),b(`completed`)]),vn=x({_meta:m(p(),g()).nullish(),content:p(),priority:gn,status:_n}),yn=x({_meta:m(p(),g()).nullish(),entries:h(vn)}),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`})}),bn=x({id:p(),position:k,uri:p()}),xn=x({id:p(),newName:p(),position:k,uri:p()}),Sn=x({action:p(),position:k,timestampMs:f(),uri:p()}),Cn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),wn=x({_meta:m(p(),g()).nullish(),auth:Je.optional().default({terminal:!1}),elicitation:_t.nullish(),fs:wt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:on.nullish(),positionEncodings:h(Cn).optional(),terminal:v().optional().default(!1)}),Tn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),En=f().int().gte(0).lte(65535),Dn=x({_meta:m(p(),g()).nullish(),clientCapabilities:wn.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:Et.nullish(),protocolVersion:En}),A=x({end:k,start:k}),On=x({message:p(),range:A,severity:Bt,uri:p()}),kn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),An=x({_meta:m(p(),g()).nullish(),diagnostics:h(On).nullish(),editHistory:h(qt).nullish(),openFiles:h(kn).nullish(),recentFiles:h(Zt).nullish(),relatedSnippets:h(en).nullish(),userActions:h(Sn).nullish()}),jn=x({newText:p(),range:A}),Mn=_([x({cursorPosition:k.nullish(),edits:h(jn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),bn.and(x({kind:b(`jump`)})),xn.and(x({kind:b(`rename`)})),sn.and(x({kind:b(`searchAndReplace`)}))]),Nn=x({_meta:m(p(),g()).nullish(),content:p()}),Pn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var Fn=x({requestId:j}),In=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(In).nullish(),lastModified:p().nullish(),priority:f().nullish()}),Ln=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),Rn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),zn=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()}),Bn=x({_meta:m(p(),g()).nullish(),optionId:pn}),Vn=_([x({outcome:b(`cancelled`)}),Bn.and(x({outcome:b(`selected`)}))]),Hn=x({_meta:m(p(),g()).nullish(),outcome:Vn}),Un=x({_meta:m(p(),g()).nullish()}),Wn=x({_meta:m(p(),g()).nullish()}),Gn=x({currentValue:v()}),Kn=p(),qn=p(),Jn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),Yn=p(),Xn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:Yn}),Zn=x({_meta:m(p(),g()).nullish(),group:Kn,name:p(),options:h(Xn)}),N=y(_([x({currentValue:Yn,options:_([h(Xn),h(Zn)])}).and(x({type:b(`select`)})),Gn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Jn.nullish(),description:p().nullish(),id:qn,name:p()})),Qn=x({_meta:m(p(),g()).nullish(),configOptions:h(N)}),$n=x({_meta:m(p(),g()).nullish()}),P=p(),er=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:P}),tr=x({_meta:m(p(),g()).nullish(),sessionId:P}),nr=x({_meta:m(p(),g()).nullish(),sessionId:P}),rr=x({_meta:m(p(),g()).nullish(),sessionId:P}),ir=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(yt).optional(),outputByteLimit:f().nullish(),sessionId:P}),ar=x({_meta:m(p(),g()).nullish(),sessionId:P,uri:p()}),or=x({_meta:m(p(),g()).nullish(),position:k,sessionId:P,uri:p(),version:f(),visibleRange:A}),sr=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:P,text:p(),uri:p(),version:f()}),cr=x({_meta:m(p(),g()).nullish(),sessionId:P,uri:p()}),lr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(O).optional(),sessionId:P}),ur=x({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),dr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(O),sessionId:P}),fr=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:P}),pr=x({_meta:m(p(),g()).nullish(),id:p(),reason:$t.nullish(),sessionId:P}),mr=x({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),hr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(O).optional(),sessionId:P}),gr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:P,title:p().nullish(),updatedAt:p().nullish()}),_r=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(gr)}),vr=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),yr=x({_meta:m(p(),g()).nullish()}),F=p(),br=x({_meta:m(p(),g()).nullish(),currentModeId:F}),xr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:F,name:p()}),I=x({_meta:m(p(),g()).nullish(),availableModes:h(xr),currentModeId:F}),L=x({_meta:m(p(),g()).nullish(),availableModels:h(zt),currentModelId:Rt}),Sr=x({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish(),sessionId:P}),Cr=x({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish()}),wr=x({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish(),sessionId:P}),Tr=x({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish()}),Er=x({_meta:m(p(),g()).nullish()}),Dr=x({_meta:m(p(),g()).nullish(),additionalDirectories:Un.nullish(),close:Wn.nullish(),fork:$n.nullish(),list:yr.nullish(),resume:Er.nullish()}),Or=y(_([x({type:b(`boolean`),value:v()}),x({value:Yn})]),x({_meta:m(p(),g()).nullish(),configId:qn,sessionId:P})),kr=x({_meta:m(p(),g()).nullish(),configOptions:h(N)}),Ar=x({_meta:m(p(),g()).nullish(),modeId:F,sessionId:P}),jr=x({_meta:m(p(),g()).nullish()}),Mr=x({_meta:m(p(),g()).nullish(),modelId:Rt,sessionId:P}),Nr=x({_meta:m(p(),g()).nullish()}),Pr=x({_meta:m(p(),g()).nullish(),sessionId:P}),Fr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Ir=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),Lr=x({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:Ir.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(vt).nullish(),pattern:p().nullish(),title:p().nullish()}),Rr=x({_meta:m(p(),g()).nullish(),context:An.nullish(),position:k,selection:A.nullish(),sessionId:P,triggerKind:cn,uri:p(),version:f()}),zr=x({_meta:m(p(),g()).nullish(),suggestions:h(Mn)}),Br=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Vr=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()}),Hr=x({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),Ur=x({_meta:m(p(),g()).nullish(),exitStatus:Vr.nullish(),output:p(),truncated:v()}),Wr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Gr=x({range:A.nullish(),text:p()}),Kr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Gr),sessionId:P,uri:p(),version:f()});x({method:p(),params:_([tr,sr,Kr,ar,cr,or,er,pr,xt]).nullish()});var qr=_([b(`full`),b(`incremental`)]),Jr=x({_meta:m(p(),g()).nullish(),syncKind:qr}),Yr=x({_meta:m(p(),g()).nullish(),didChange:Jr.nullish(),didClose:Ht.nullish(),didFocus:Ut.nullish(),didOpen:Wt.nullish(),didSave:Gt.nullish()}),Xr=x({_meta:m(p(),g()).nullish(),document:Yr.nullish()}),Zr=x({_meta:m(p(),g()).nullish(),context:un.nullish(),events:Xr.nullish()}),Qr=x({_meta:m(p(),g()).nullish(),auth:jt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Pt.optional().default({http:!1,sse:!1}),nes:Zr.nullish(),positionEncoding:Cn.nullish(),promptCapabilities:Tn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:Dr.optional().default({})}),$r=x({_meta:m(p(),g()).nullish(),agentCapabilities:Qr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:Et.nullish(),authMethods:h($e).optional().default([]),protocolVersion:En}),ei=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),nt]),ti=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:ei}),ni=_([Wr.and(x({type:b(`text`)})),Rn.and(x({type:b(`image`)})),Ln.and(x({type:b(`audio`)})),zn.and(x({type:b(`resource_link`)})),ti.and(x({type:b(`resource`)}))]),ri=x({_meta:m(p(),g()).nullish(),content:ni}),ii=x({_meta:m(p(),g()).nullish(),content:ni,messageId:p().nullish()}),ai=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(ni),sessionId:P}),oi=x({anyOf:h(vt)}),si=_([ri.and(x({type:b(`content`)})),ct.and(x({type:b(`diff`)})),Br.and(x({type:b(`terminal`)}))]),ci=p(),li=x({sessionId:P,toolCallId:ci.nullish()}),ui=y(_([li,Fn]),x({elicitationId:ft,url:p().url()})),di=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),fi=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),pi=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),mi=x({_meta:m(p(),g()).nullish(),content:h(si).optional(),kind:pi.optional(),locations:h(di).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:fi.optional(),title:p(),toolCallId:ci}),hi=x({_meta:m(p(),g()).nullish(),content:h(si).nullish(),kind:pi.nullish(),locations:h(di).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:fi.nullish(),title:p().nullish(),toolCallId:ci}),gi=x({_meta:m(p(),g()).nullish(),options:h(hn),sessionId:P,toolCall:hi}),_i=x({_meta:m(p(),g()).nullish(),hint:p()}),vi=x({_meta:m(p(),g()).nullish(),description:p(),input:_i.nullish(),name:p()}),yi=x({_meta:m(p(),g()).nullish(),availableCommands:h(vi)}),bi=_([x({enum:h(p()),type:ht}),oi]),xi=x({default:h(p()).nullish(),description:p().nullish(),items:bi,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),Si=_([Lr.and(x({type:b(`string`)})),fn.and(x({type:b(`number`)})),Dt.and(x({type:b(`integer`)})),rt.and(x({type:b(`boolean`)})),xi.and(x({type:b(`array`)}))]),Ci=x({description:p().nullish(),properties:m(p(),Si).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:mt.optional().default(`object`)}),wi=y(_([y(_([li,Fn]),x({requestedSchema:Ci})).and(x({mode:b(`form`)})),ui.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),Ti=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([$r,tt,Nt,wr,Cr,_r,Sr,Tr,at,jr,kr,x({_meta:m(p(),g()).nullish(),stopReason:Fr,usage:Ti.nullish(),userMessageId:p().nullish()}),Nr,Pr,zr,it,Ct])}),x({error:bt,id:j})]);var Ei=x({_meta:m(p(),g()).nullish(),cost:ot.nullish(),size:f(),used:f()}),Di=_([ii.and(x({sessionUpdate:b(`user_message_chunk`)})),ii.and(x({sessionUpdate:b(`agent_message_chunk`)})),ii.and(x({sessionUpdate:b(`agent_thought_chunk`)})),mi.and(x({sessionUpdate:b(`tool_call`)})),hi.and(x({sessionUpdate:b(`tool_call_update`)})),yn.and(x({sessionUpdate:b(`plan`)})),yi.and(x({sessionUpdate:b(`available_commands_update`)})),br.and(x({sessionUpdate:b(`current_mode_update`)})),Qn.and(x({sessionUpdate:b(`config_option_update`)})),vr.and(x({sessionUpdate:b(`session_info_update`)})),Ei.and(x({sessionUpdate:b(`usage_update`)}))]),Oi=x({_meta:m(p(),g()).nullish(),sessionId:P,update:Di});x({method:p(),params:_([Oi,pt,xt]).nullish()});var ki=x({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),Ai=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()}),ji=x({name:p(),uri:p()}),Mi=x({_meta:m(p(),g()).nullish(),repository:rn.nullish(),workspaceFolders:h(ji).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([Dn,et,Mt,dn,dr,kt,lr,hr,rr,Ar,Or,ai,Mr,Mi,Rr,nr,St]).nullish()});var Ni=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:P});x({id:j,method:p(),params:_([Ni,fr,gi,ir,Hr,mr,ki,ur,wi,St]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),Nn,Hn,st,Ur,Pn,Ai,Ot,ut,Ct])}),x({error:bt,id:j})]),e(),d(),r(),s(),i(),o();function Pi(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
|
+
`);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 Fi,R=new WeakMap,Ii=class{constructor(e,t){l(this,R,void 0);let n=e(this);u(R,this,new Hi(async(e,t)=>{switch(e){case E.initialize:{let e=Dn.parse(t);return n.initialize(e)}case E.session_new:{let e=dn.parse(t);return n.newSession(e)}case E.session_load:{if(!n.loadSession)throw q.methodNotFound(e);let r=dr.parse(t);return n.loadSession(r)}case E.session_list:{if(!n.listSessions)throw q.methodNotFound(e);let r=kt.parse(t);return n.listSessions(r)}case E.session_fork:{if(!n.unstable_forkSession)throw q.methodNotFound(e);let r=lr.parse(t);return n.unstable_forkSession(r)}case E.session_resume:{if(!n.unstable_resumeSession)throw q.methodNotFound(e);let r=hr.parse(t);return n.unstable_resumeSession(r)}case E.session_close:{if(!n.unstable_closeSession)throw q.methodNotFound(e);let r=rr.parse(t);return n.unstable_closeSession(r)}case E.session_set_mode:{if(!n.setSessionMode)throw q.methodNotFound(e);let r=Ar.parse(t);return await n.setSessionMode(r)??{}}case E.authenticate:{let e=et.parse(t);return await n.authenticate(e)??{}}case E.logout:{if(!n.unstable_logout)throw q.methodNotFound(e);let r=Mt.parse(t);return await n.unstable_logout(r)??{}}case E.session_prompt:{let e=ai.parse(t);return n.prompt(e)}case E.session_set_model:{if(!n.unstable_setSessionModel)throw q.methodNotFound(e);let r=Mr.parse(t);return await n.unstable_setSessionModel(r)??{}}case E.session_set_config_option:{if(!n.setSessionConfigOption)throw q.methodNotFound(e);let r=Or.parse(t);return n.setSessionConfigOption(r)}case E.nes_start:{if(!n.unstable_startNes)throw q.methodNotFound(e);let r=Mi.parse(t);return n.unstable_startNes(r)}case E.nes_suggest:{if(!n.unstable_suggestNes)throw q.methodNotFound(e);let r=Rr.parse(t);return n.unstable_suggestNes(r)}case E.nes_close:{if(!n.unstable_closeNes)throw q.methodNotFound(e);let r=nr.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw q.methodNotFound(e)}},async(e,t)=>{switch(e){case E.session_cancel:{let e=tr.parse(t);return n.cancel(e)}case E.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=sr.parse(t);return n.unstable_didOpenDocument(e)}case E.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Kr.parse(t);return n.unstable_didChangeDocument(e)}case E.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=ar.parse(t);return n.unstable_didCloseDocument(e)}case E.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=cr.parse(t);return n.unstable_didSaveDocument(e)}case E.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=or.parse(t);return n.unstable_didFocusDocument(e)}case E.nes_accept:{if(!n.unstable_acceptNes)return;let e=er.parse(t);return n.unstable_acceptNes(e)}case E.nes_reject:{if(!n.unstable_rejectNes)return;let e=pr.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw q.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(R,this).sendNotification(D.session_update,e)}async requestPermission(e){return await c(R,this).sendRequest(D.session_request_permission,e)}async readTextFile(e){return await c(R,this).sendRequest(D.fs_read_text_file,e)}async writeTextFile(e){return await c(R,this).sendRequest(D.fs_write_text_file,e)??{}}async createTerminal(e){return new Li((await c(R,this).sendRequest(D.terminal_create,e)).terminalId,e.sessionId,c(R,this))}async unstable_createElicitation(e){return await c(R,this).sendRequest(D.elicitation_create,e)}async unstable_completeElicitation(e){return await c(R,this).sendNotification(D.elicitation_complete,e)}async extMethod(e,t){return await c(R,this).sendRequest(e,t)}async extNotification(e,t){return await c(R,this).sendNotification(e,t)}get signal(){return c(R,this).signal}get closed(){return c(R,this).closed}},z=new WeakMap,B=new WeakMap;Fi=Symbol.asyncDispose;var Li=class{constructor(e,n,r){t(this,`id`,void 0),l(this,z,void 0),l(this,B,void 0),this.id=e,u(z,this,n),u(B,this,r)}async currentOutput(){return await c(B,this).sendRequest(D.terminal_output,{sessionId:c(z,this),terminalId:this.id})}async waitForExit(){return await c(B,this).sendRequest(D.terminal_wait_for_exit,{sessionId:c(z,this),terminalId:this.id})}async kill(){return await c(B,this).sendRequest(D.terminal_kill,{sessionId:c(z,this),terminalId:this.id})??{}}async release(){return await c(B,this).sendRequest(D.terminal_release,{sessionId:c(z,this),terminalId:this.id})??{}}async[Fi](){await this.release()}},V=new WeakMap,Ri=new WeakMap,zi=new WeakMap,Bi=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,Vi=new WeakMap,G=new WeakSet,Hi=class{constructor(e,t,r){a(this,G),l(this,V,new Map),l(this,Ri,0),l(this,zi,void 0),l(this,Bi,void 0),l(this,H,void 0),l(this,U,Promise.resolve()),l(this,W,new AbortController),l(this,Vi,void 0),u(zi,this,e),u(Bi,this,t),u(H,this,r),u(Vi,this,new Promise(e=>{c(W,this).signal.addEventListener(`abort`,()=>e())})),n(G,this,Ui).call(this)}get signal(){return c(W,this).signal}get closed(){return c(Vi,this)}async sendRequest(e,t){var r,i;n(G,this,Yi).call(this);let a=(u(Ri,this,(r=c(Ri,this),i=r++,r)),i),o=new Promise((e,t)=>{c(V,this).set(a,{resolve:e,reject:t})});return await n(G,this,K).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(G,this,Yi).call(this),await n(G,this,K).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Ui(){let e;try{let e=c(H,this).readable.getReader();try{for(;!c(W,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(G,this,Gi).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(G,this,K).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(G,this,Wi).call(this,e)}}function Wi(e){if(c(W,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(V,this).values())e.reject(t);c(V,this).clear(),c(W,this).abort(t)}async function Gi(e){if(`method`in e&&`id`in e){let t=await n(G,this,Ki).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(G,this,K).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(G,this,qi).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(G,this,Ji).call(this,e):console.error(`Invalid message`,{message:e})}async function Ki(e,t){try{return{result:await c(zi,this).call(this,e,t)??null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof ee)return q.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 q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}async function qi(e,t){try{return await c(Bi,this).call(this,e,t),{result:null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof ee)return q.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 q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}function Ji(e){let t=c(V,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 q(n,r,i))}c(V,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Yi(){if(c(W,this).signal.aborted)throw c(W,this).signal.reason??Error(`ACP connection closed`)}async function K(e){return u(U,this,c(U,this).then(async()=>{let t=c(H,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(G,this,Wi).call(this,e)})),c(U,this)}var q=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}}};ae(),S(),pe(),fe(),Le(),ze(),ke(),Oe(),we(),je(),Se(),Me();function J(e,t){if(e)return t?Ue(e)?e:We(t,e):e}var Xi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Zi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Qi(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=Zi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!Xi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function $i(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var ea=256;function ta(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=ea?t:t.slice(0,ea-1)+`…`}function na(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 ra(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
4
|
+
`+e+(e.endsWith(`
|
|
5
|
+
`)?``:`
|
|
6
|
+
`)+t}function Y(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let e=i?.command??`Terminal`,t=i?.description;return{title:e,kind:`execute`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Read`:{let e=i?.file_path,t=e??`File`,r=i?.offset,a=i?.limit,o=``;a&&a>0?o=` (${r??1} - ${(r??1)+a-1})`:r&&(o=` (from line ${r})`);let s=t?na(t,n):`File`,c=J(e,n);return{title:`Read ${s}${o}`,kind:`read`,locations:c?[{path:c,line:r??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?na(e,n):void 0,a=J(e,n);return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:a?[{type:`diff`,path:a,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:a?[{path:a}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?na(e,n):void 0,o=J(e,n);return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:o?[{type:`diff`,path:o,oldText:t||null,newText:r}]:[],locations:o?[{path:o}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,r=J(e,n),a=`Find`;return e&&(a+=` \`${e}\``),t&&(a+=` \`${t}\``),{title:a,kind:`search`,content:[],locations:r?[{path:r}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`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 ia(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:aa(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function aa(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`resource_link`:{let t=e.uri;return{type:`resource_link`,uri:t,name:e.name??t,mimeType:e.mimeType}}case`resource`:{let t=e.resource;return{type:`resource`,resource:{uri:t?.uri??``,mimeType:t?.mimeType,...typeof t?.text==`string`?{text:t.text}:{},...typeof t?.blob==`string`?{blob:t.blob}:{}}}}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_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(`
|
|
7
|
+
`)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function oa(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return ia(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:ra(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:ra(e.text)}:aa(e,!1)}))}:{};case`Bash`:{let e=``;if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
|
|
8
|
+
`)}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
9
|
+
`));return e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return ia(i??``,r)}}function sa(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}function X(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:{let e=i.thinking??``;a={sessionUpdate:`agent_thought_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:sa(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,status:`in_progress`,rawInput:e,...Y({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Y({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=oa(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 ca(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,...i?.messageId?{messageId:i.messageId}:{},content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:X(s,`assistant`,t,n,r,void 0,i)}function la(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?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`content_block_delta`:{let o=a.delta;return o?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function ua(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function da(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=ua(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}var fa=console;function pa(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 ma(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1,m=null;try{for(;!r.aborted;){let s=await pa(t,r);if(s.done||r.aborted)break;let h=s.value;if(h==null)continue;let g=h;switch(g.type){case`system`:g.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
|
+
|
|
11
|
+
Compacting completed.`}}}));break;case`result`:{let t=g.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=g.modelUsage;if(i&&d){let e=da(i,d);e?.contextWindow&&(f=e.contextWindow)}u!==null&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:u,size:f}});let a=g.subtype,o=g.is_error;if(r.aborted){c=`cancelled`;break}switch(a){case`success`:{let e=g.stop_reason;c=e===`max_tokens`?`max_tokens`:e===`refusal`?`refusal`:`end_turn`,o&&(c=`end_turn`);break}case`error_during_execution`:c=g.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=g.parent_tool_use_id;t===null&&m===null&&(m=T());let r=la(g,e,i,n,{clientCapabilities:a,cwd:o,messageId:t===null?m??void 0:void 0});for(let e of r)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=g.message,r=g.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s;r===null&&(m===null&&(m=T()),s=m);let c=ca(g,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p,messageId:s});for(let e of c)await n.sessionUpdate(e);r===null&&(m=null);break}case`user`:break;case`progress`:{let t=g.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
|
+
|
|
13
|
+
Compacting completed.`}}});break;default:fa.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}async function ha(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){fa.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;let t=T();await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,...t?{messageId:t}:{},content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=X(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a,messageId:T()});for(let e of t)await n.sessionUpdate(e)}}}function ga(e,t,n,r,i,a,o,s){return async(n,c,l,u,d,f)=>{let p=va(r);if(n.name===`ExitPlanMode`)return _a(e,t,d,c,p,i,a,o,s);if(f!==void 0)return f;try{let e=await be(n,c,l,u,d);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:d}}let m=Y({name:n.name,id:d,input:c},p,i),h={toolCallId:d,title:m.title,kind:m.kind,status:`pending`,rawInput:c},g=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`},{kind:`reject_always`,name:`Always Reject`,optionId:`reject_always`}];try{let n=await e.requestPermission({sessionId:t,toolCall:h,options:g});if(n.outcome.outcome===`cancelled`)return s?.(),{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`},toolUseID:d};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:c}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function _a(e,t,n,r,i,a,o,s,c){let l=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&l.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let u=Y({name:`ExitPlanMode`,id:n,input:r},i,a),d={toolCallId:n,title:u.title,kind:u.kind,status:`pending`,rawInput:r},f=await e.requestPermission({sessionId:t,toolCall:d,options:l});if(f.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(f.outcome.outcome===`selected`&&`optionId`in f.outcome&&f.outcome.optionId!==void 0){let n=f.outcome.optionId;if(l.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function va(e){if(!e)return!1;if(e.terminal===!0)return!0;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}le(),_e(),Te(),me(),e(),xe(),ye();var Z=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,authMethods:[],agentInfo:{name:`claude-code`,title:`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,forkSession:!0}},promptCapabilities:{image:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{list:{},resume:{},close:{},delete:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession({...e,replay:!1});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){if(e.cursor!==void 0&&e.cursor!==null)throw Error(`Pagination cursor not supported: listSessions returns all results in a single page.`);let t=e.cwd||se(),n=await ge(t),r=await ve({dir:t}),i=[];for(let e of r){if(!e.cwd||await ge(e.cwd)!==n)continue;let t=ta(e.summary??``);i.push({sessionId:e.sessionId,cwd:e.cwd,...t?{title:t}:{},updatedAt:new Date(e.lastModified).toISOString()})}return{sessions:i}}async unstable_forkSession(e){let{initialMessages:t}=await ya(e.sessionId),n=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{initialMessages:t});return this.scheduleAvailableCommandsUpdate(n.sessionId),n}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async unstable_deleteSession(e){let t=await he(e.sessionId);if(t)try{await qe(t.filePath)}catch(e){if(e.code!==`ENOENT`)throw e}return this.sessions.has(e.sessionId)&&await this.teardownSession(e.sessionId),{}}async extMethod(e,t){if(e===`session/delete`){let e=t.sessionId;if(typeof e!=`string`||e.length===0)throw Error(`session/delete requires a non-empty sessionId`);return this.unstable_deleteSession({sessionId:e})}throw q.methodNotFound(e)}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:e.modeId}}),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}};async function ya(e){let t;try{let n=await Ce(e);n&&n.messages.length>0&&(t=Ne(n.messages))}catch(e){console.error(`[ACP] fork source load failed:`,e)}return{initialMessages:t}}var ba=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function xa(e){return ba.includes(e)}function Sa(e,t,n){if(t){let t=Ca(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!Ea())throw Error(`Mode not available: bypassPermissions cannot run as root (start the agent as a non-root user, or set IS_SANDBOX=1).`);return t}return wa(n)??`default`}function Ca(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Qi(e,t)}function wa(e){if(e!=null)try{return Qi(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 Ta(e,t){return!!e&&Object.hasOwn(e,t)}function Ea(){return Da()}function Da(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function Oa(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}function ka(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(Array.isArray(e.options))for(let n of e.options)n&&typeof n==`object`&&typeof n.value==`string`&&t.push(n.value);else typeof n.value==`string`&&t.push(n.value)}return t}function Q(e){return e.conn}function $(e){return e.clientCapabilities}function Aa(e,t,n,r){n===`mode`?t.modes={...t.modes,currentModeId:r}:n===`model`&&(t.models={...t.models,currentModelId:r})}S();function ja(){return ue().permissions?.defaultMode}async function Ma(e,t={}){de();let n=t.sessionId??T(),r=e.cwd;C(n,ie()),oe(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}re(),Pe();try{let i=Re(),a=Ee(i),o=e._meta,s=Ta(o,`permissionMode`),c=Sa(s?o?.permissionMode:void 0,s,ja()),l=$(this),u=this.conn,d=ga(u,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,l,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=Ea(),p={...Fe(),toolPermissionContext:{...i,mode:c,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([De(r),Ae(r)]);p.agentDefinitions=h;let g=new Ve({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 Be(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:c,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},ee=Ie(),v=ce(),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=Oa(_,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:l,appState:p,commands:m,sessionFingerprint:$i({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,modes:_,models:y,configOptions:b}}finally{a&&process.chdir(i)}}Object.assign(Z.prototype,{createSession:Ma}),xe(),ye(),S(),me();async function Na(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if($i({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await he(e.sessionId,e.cwd);return C(e.sessionId,r?He(r.filePath):null),oe(e.cwd),t&&await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:n.modes,models:n.models,configOptions:n.configOptions}}await this.teardownSession(e.sessionId)}let r=await he(e.sessionId,e.cwd),i=r?He(r.filePath):null;C(e.sessionId,i),oe(e.cwd);let a;if(r)try{let t=await Ce(e.sessionId);t&&t.messages.length>0&&(a=Ne(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let o=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:a});if(t&&a&&a.length>0){let t=this.sessions.get(e.sessionId);t&&await ha(e.sessionId,a,Q(this),t.toolUseCache,$(this),t.cwd)}return{sessionId:o.sessionId,modes:o.modes,models:o.models,configOptions:o.configOptions}}async function Pa(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async function Fa(e){try{let t=await Ce(e.sessionId);if(!t||t.messages.length===0)return;let n=Ne(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await ha(e.sessionId,n,Q(this),r.toolUseCache,$(this),r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}function Ia(e,t){if(!xa(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async function La(e,t,n){let r=this.sessions.get(e);r&&(Aa(this,r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await Q(this).sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}Object.assign(Z.prototype,{getOrCreateSession:Na,teardownSession:Pa,replaySessionHistory:Fa,applySessionMode:Ia,updateConfigOption:La});function Ra(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(za(n,r))}else if(e.type===`resource`){let n=e.resource;if(n&&typeof n.text==`string`)t.push(n.text);else if(n&&typeof n.blob==`string`){let e=typeof n.mimeType==`string`?n.mimeType:`application/octet-stream`,r=typeof n.uri==`string`?n.uri:`(unknown uri)`;t.push(`Embedded resource: ${r} (${e}, base64 blob, ${n.blob.length} chars)`)}}}return t.filter(e=>e.length>0).join(`
|
|
14
|
+
`)}function za(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}function Ba(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),Va(e),n}Va(e)}function Va(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)}}S();async function Ha(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=e.messageId??void 0,r=Ra(e.prompt);if(!r.trim())throw Error(`Prompt content is empty`);let i=t.cancelGeneration;if(t.promptRunning){let e=T();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==i)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),C(e.sessionId,ie());let i=t.queryEngine.submitMessage(r),{stopReason:a,usage:o}=await ma(e.sessionId,i,Q(this),t.queryEngine.getAbortSignal(),t.toolUseCache,$(this),t.cwd,()=>t.cancelled);if(t.cancelled)return{stopReason:`cancelled`};if(await Wa(this,e.sessionId,r),o){let e={inputTokens:o.inputTokens,outputTokens:o.outputTokens,cachedReadTokens:o.cachedReadTokens,cachedWriteTokens:o.cachedWriteTokens,thoughtTokens:0,totalTokens:o.inputTokens+o.outputTokens+o.cachedReadTokens+o.cachedWriteTokens+0};return{stopReason:a,usage:e,...n?{userMessageId:n}:{},_meta:{claudeCode:{usage:e}}}}return{stopReason:a,...n?{userMessageId:n}:{}}}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||/abort|cancelled|interrupt/i.test(n.message));if(t.cancelled||r)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(await this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=Ba(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async function Ua(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);let n=t.configOptions.find(t=>t.id===e.configId);if(!n)throw Error(`Unknown config option: ${e.configId}`);if(n.type===`select`){let t=ka(n.options);if(!t.includes(e.value))throw Error(`Invalid value '${e.value}' for config option ${e.configId}; must be one of: ${t.join(`, `)}`)}let r=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,r),await Q(this).sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:r}})):e.configId===`model`&&t.queryEngine.setModel(r),Aa(this,t,e.configId,r),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:r}:t),{configOptions:t.configOptions}}async function Wa(e,t,n){let r=e.sessions.get(t);if(!r)return;let i=r.toolUseCache;if(i.__sessionInfoTitleSent)return;i.__sessionInfoTitleSent=!0;let a=ta(n).slice(0,100);try{await Q(e).sessionUpdate({sessionId:t,update:{sessionUpdate:`session_info_update`,...a?{title:a}:{},updatedAt:new Date().toISOString()}})}catch(e){console.error(`[ACP] Failed to send session_info_update:`,e)}}Object.assign(Z.prototype,{prompt:Ha,setSessionConfigOption:Ua}),pe(),we();function Ga(e,t){let n=Ge.toWeb(e);return Pi(Ke.toWeb(t),n)}async function Ka(){de(),Pe();let e=Ga(process.stdin,process.stdout),t,n=new Ii(e=>(t=new Z(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{Ka as runAcpAgent};
|
|
@@ -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-BZjPDxMm.js";import{n as c,t as l}from"./lazySchema-B0QShMaQ.js";import{i as u,r as d}from"./semver-Di5OaTd5.js";import{r as f,s as p}from"./bridgeEnabled-DYclTb9d.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.8.1`,e.min_version)?`Your version of Claude Code (2.8.1) 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{a as e,i as t}from"./envLessBridgeConfig-CpjlwmvF.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -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{fl as r,pl as i}from"./paths-
|
|
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{fl as r,pl as i}from"./paths-BZjPDxMm.js";import{Ot as a,SE as o,Tt as s,bd as c,wE as l,yd as u}from"./loadAgentsDir-BYWykYwn.js";import{n as d,t as f}from"./ExitFlow-BPbtGcEg.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=s()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await o(0,`prompt_input_exit`),null)}var g,_;e((()=>{r(),t(),d(),u(),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{A as p,E as m}from"./debug-otxXY3j-.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{DC as _,EC as v,aS as y,dS as b,fS as x,oS as S}from"./loadAgentsDir-
|
|
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{A as p,E as m}from"./debug-otxXY3j-.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{DC as _,EC as v,aS as y,dS as b,fS as x,oS as S}from"./loadAgentsDir-BYWykYwn.js";import{t as C}from"./useKeybinding-DPOUuymz.js";import{t as w}from"./useTerminalSize-Du-EamDN.js";import{n as T,t as E}from"./exportRenderer-B5emJDvn.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,_]=(0,k.useState)(t.length),[x,S]=(0,k.useState)(!1),{columns:C}=n(),w=(0,k.useCallback)(()=>{S(!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`),S(!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)(()=>{x?w():r({success:!1,message:`Export cancelled`})},[x,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 x?(0,A.jsxs)(s,{children:[(0,A.jsx)(o,{shortcut:`Enter`,action:`save`}),(0,A.jsx)(v,{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)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})}return u(`confirm:no`,O,{context:`Settings`,isActive:x}),(0,A.jsx)(a,{title:`Export Conversation`,subtitle:`Select export method:`,color:`permission`,onCancel:O,inputGuide:M,isCancelActive:!x,children:x?(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)(b,{value:f,onChange:m,onSubmit:E,focus:!0,showCursor:!0,columns:C,cursorOffset:h,onChangeCursorOffset:_})]})]}):(0,A.jsx)(y,{options:j,onChange:T,onCancel:O})})}var k,A,j=e((()=>{k=t(r(),1),w(),c(),C(),h(),m(),_(),S(),x(),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{FT as s,LT as c,cC as l,kT as u,lC as d}from"./loadAgentsDir-
|
|
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{FT as s,LT as c,cC as l,kT as u,lC as d}from"./loadAgentsDir-BYWykYwn.js";import{n as f,t as p}from"./staticRender-DKFIRhkH.js";import{n as m,t as h}from"./Messages-CQdQJ2AA.js";function g({children:e}){let{bindings:t}=c(),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:s}={}){let c=n=>f((0,x.jsx)(l,{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 c([e,e+o]);if(r(t).trim()===``)break;await n(t),s?.(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(),u(),s(),d(),p(),x=o()}));export{y as n,S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./extra-usage-DIm8nrKj.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-DERKSEe1.js";import{r as a,t as o}from"./login-D1aQCqp0.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{Cc as r,Da as i,dc as a,ka as o,on as s,tn as c,yc 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{Cc as r,Da as i,dc as a,ka as o,on as s,tn as c,yc as l}from"./paths-BZjPDxMm.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,s as p}from"./log-DSV4Ht5l.js";import{a as m,l as h,o as g}from"./api-hcsOinLV.js";import{n as _,t as v}from"./browser-Bt-ckCaU.js";import{n as y,t as b}from"./usage-Bw_LK9YI.js";import{i as x,r as S}from"./overageCreditGrant-DYMg1lV4.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(){a().hasVisitedExtraUsage||r(e=>({...e,hasVisitedExtraUsage:!0})),x();let e=c(),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(),s(),o(),v(),l(),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-DERKSEe1.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 te,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Br as l,Cr as u,Ol as ne,Pr as d,Ps as f,Qa as re,Rr as p,bi as ie,dn as m,dr as h,kl as g,li as _,lo as ae,on as v,oo as y,ur as b,vi as x,xi as S,yi as oe}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 te,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Br as l,Cr as u,Ol as ne,Pr as d,Ps as f,Qa as re,Rr as p,bi as ie,dn as m,dr as h,kl as g,li as _,lo as ae,on as v,oo as y,ur as b,vi as x,xi as S,yi as oe}from"./paths-BZjPDxMm.js";import{n as C,r as se}from"./analytics-DqMQntaB.js";import{Bf as w,DC as T,Dj as E,EC as ce,Mj as le,Nj as ue,Oj as de,Ry as D,Tj as O,_j as k,aS as fe,fC as pe,kj as me,lC as A,uC as j,vj as M,yj as N,zf as he}from"./loadAgentsDir-BYWykYwn.js";import{t as P}from"./useKeybinding-DPOUuymz.js";import{n as ge,t as F}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";function I(e,t){if(!E(t))return;let n=N(t,e);return`${L(n)} ${n} · /effort`}function L(e){switch(e){case`low`:return`○`;case`medium`:return`◐`;case`high`:return`●`;case`xhigh`:return`⦿`;case`max`:return`◉`;default:return`●`}}var R=e((()=>{f(),O()}));function z({initial:e,sessionModel:t,onSelect:n,onCancel:te,isStandaloneCommand:c,showFastModeNotice:l,headerText:u,skipSettingsWrite:d}){let f=pe(),m=ge(),h=e===null?G:e,[g,v]=(0,U.useState)(h),y=j(e=>S()?e.fastMode:!1),[x,C]=(0,U.useState)(()=>new Set(b(h)?[h.replace(/\[1m\]/i,``)]:[])),w=(0,U.useCallback)(()=>{if(!g||g===G)return;let e=g.replace(/\[1m\]/i,``);C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[g]),[T,D]=(0,U.useState)(!1),O=j(e=>e.effortValue),[A,M]=(0,U.useState)(O===void 0?void 0:k(O)),N=(0,U.useMemo)(()=>he(y??!1),[y]),P=(0,U.useMemo)(()=>e!==null&&!N.some(t=>t.value===e)?[...N,{value:e,label:p(e),description:`Current model`}]:N,[N,e]),F=(0,U.useMemo)(()=>P.map(e=>({...e,value:e.value===null?G:e.value})),[P]),I=(0,U.useMemo)(()=>F.some(e=>e.value===h)?h:F[0]?.value??void 0,[F,h]),L=Math.min(10,F.length),R=Math.max(0,F.length-L),z=F.find(e=>e.value===g)?.label,K=B(g),q=g!==void 0&&g!==G&&x.has(g.replace(/\[1m\]/i,``)),J=K?E(K):!1,Y=K?me(K):!1,X=K?de(K):!1,Z=H(g),Q=A===`max`&&!X?Y?`xhigh`:`high`:A===`xhigh`&&!Y?`high`:A,ve=(0,U.useCallback)(e=>{v(e),!T&&O===void 0&&M(H(e))},[T,O]),ye=(0,U.useCallback)(e=>{J&&(M(t=>_e(t??Z,e,Y,X)),D(!0))},[J,Y,X,Z]);o({"modelPicker:decreaseEffort":()=>ye(`left`),"modelPicker:increaseEffort":()=>ye(`right`),"modelPicker:toggle1M":()=>w()},{context:`ModelPicker`});function be(e){if(se(`tengu_model_command_menu_effort`,{effort:A}),!d){let t=le(A,H(e),re(`userSettings`)?.effortLevel,T),n=ue(t);n!==void 0&&ae(`userSettings`,{effortLevel:n}),f(e=>({...e,effortValue:t}))}let t=B(e),r=T&&t&&E(t)?A:void 0;if(e===G){n(null,r);return}let i=e.replace(/\[1m\]/i,``);n(x.has(i)?`${i}[1m]`:i,r)}let $=(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsxs)(s,{flexDirection:`column`,children:[(0,W.jsxs)(s,{marginBottom:1,flexDirection:`column`,children:[(0,W.jsx)(r,{color:`remember`,bold:!0,children:`Select model`}),(0,W.jsx)(r,{dimColor:!0,children:u??`Choose a model for this and future sessions. Use ← → to adjust effort, Space to toggle 1M context.`}),t&&(0,W.jsxs)(r,{dimColor:!0,children:[`Currently using `,p(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,W.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(s,{flexDirection:`column`,children:(0,W.jsx)(fe,{defaultValue:h,defaultFocusValue:I,options:F,onChange:be,onFocus:ve,onCancel:te??(()=>{}),visibleOptionCount:L})}),R>0&&(0,W.jsx)(s,{paddingLeft:3,children:(0,W.jsxs)(r,{dimColor:!0,children:[`and `,R,` more…`]})})]}),(0,W.jsxs)(s,{marginBottom:1,flexDirection:`column`,children:[J?(0,W.jsxs)(r,{dimColor:!0,children:[(0,W.jsx)(V,{effort:Q}),` `,ne(Q),` effort`,Q===Z?` (default)`:``,` `,(0,W.jsx)(r,{color:`subtle`,children:`← → to adjust`})]}):(0,W.jsxs)(r,{color:`subtle`,children:[(0,W.jsx)(V,{effort:void 0}),` Effort not supported`,z?` for ${z}`:``]}),q?(0,W.jsxs)(r,{dimColor:!0,children:[(0,W.jsx)(V,{effort:`high`}),` 1M context on`,(0,W.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]}):(0,W.jsxs)(r,{color:`subtle`,children:[(0,W.jsx)(V,{effort:void 0}),` 1M context off`,z?` for ${z}`:``,(0,W.jsx)(r,{color:`subtle`,children:` · Space to toggle`})]})]}),S()?l?(0,W.jsx)(s,{marginBottom:1,children:(0,W.jsxs)(r,{dimColor:!0,children:[`Fast mode is `,(0,W.jsx)(r,{bold:!0,children:`ON`}),` and available with `,_,` only (/fast). Switching to other models turn off fast mode.`]})}):oe()&&!ie()?(0,W.jsx)(s,{marginBottom:1,children:(0,W.jsxs)(r,{dimColor:!0,children:[`Use `,(0,W.jsx)(r,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,_,` only).`]})}):null:null]}),c&&(0,W.jsx)(r,{dimColor:!0,italic:!0,children:m.pending?(0,W.jsxs)(W.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,W.jsxs)(a,{children:[(0,W.jsx)(i,{shortcut:`Enter`,action:`confirm`}),(0,W.jsx)(ce,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return c?(0,W.jsx)(ee,{color:`permission`,children:$}):$}function B(e){if(e)return e===G?u():l(e)}function V({effort:e}){return(0,W.jsx)(r,{color:e?`claude`:`subtle`,children:L(e??`low`)})}function _e(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 H(e){let t=M(B(e)??u());return t===void 0?`high`:k(t)}var U,W,G,K=e((()=>{g(),n(),U=t(n(),1),h(),F(),C(),x(),te(),P(),A(),O(),d(),w(),y(),T(),D(),R(),W=c(),G=`__NO_PREFERENCE__`}));function q(e,t,n){if(!m())return!1;if(t)return!0;if(e===null||!b(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 J=e((()=>{v(),h()}));export{L as a,K as i,q as n,I as o,z as r,R as s,J as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{iu as e,nu as t,ru as n,tu as r}from"./loadAgentsDir-BYWykYwn.js";e();export{r as drainPendingExtraction,t as executeExtractMemories,n as initExtractMemories};
|
|
@@ -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{Di as p,Ps as m,Si as h,ci as g,dc as _,di as v,fi as y,li as b,lo as x,mi as S,oi as C,oo as w,si as T,ui as E,vi as D,xi as O,yc 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{Di as p,Ps as m,Si as h,ci as g,dc as _,di as v,fi as y,li as b,lo as x,mi as S,oi as C,oo as w,si as T,ui as E,vi as D,xi as O,yc as k}from"./paths-BZjPDxMm.js";import{n as A,r as j}from"./analytics-DqMQntaB.js";import{b as M,u as N}from"./startupProfiler-CBcN1Chw.js";import{fC as P,lC as F,uC as I}from"./loadAgentsDir-BYWykYwn.js";import{t as L}from"./useKeybinding-DPOUuymz.js";import{n as R,t as z}from"./systemTheme-eRWGHYSL.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(_().theme);return t?n.dim(u(`promptBorder`,r)(`↯`)):u(`fastMode`,r)(`↯`)}var H,U=e((()=>{r(),a(),m(),l(),k(),z(),H=f()}));function W(e,t){E(),x(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!h(e.mainLoopModel);return{...e,...t?{mainLoopModel:v(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=I(e=>e.mainLoopModel),r=I(e=>e.fastMode),a=P(),[l,u]=(0,J.useState)(r??!1),f=y(),p=f.status===`cooldown`,m=t!==null,g=C(T(!0));function _(){m||(W(l,a),j(`tengu_fast_mode_toggled`,{enabled:l,source:`picker`}),l?e(`${V(l)} Fast mode ON${h(n)?``:` · model set to ${b}`} · ${g}`):(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 x(){m||u(e=>!e)}return c({"confirm:yes":_,"confirm:nextField":x,"confirm:next":x,"confirm:previous":x,"confirm:cycleMode":x,"confirm:toggle":x},{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 ${b}. 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:g})]})}),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 `,N(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=S();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${h(i)?``:` · model set to ${b}`} · ${C(T(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!O())return null;await p();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=S();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(),D(),M(),g(),w(),Y=f()}));export{U as a,V as i,q as n,X as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./fast-BP2t1xDM.js";t();export{n as FastModePicker,e 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"./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-BSagYjmf.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-BZjPDxMm.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{U as n,l as r,p as i,z as a}from"./debug-otxXY3j-.js";import{O as o,k as s}from"./rcDebugLog-
|
|
1
|
+
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{U as n,l as r,p as i,z as a}from"./debug-otxXY3j-.js";import{O as o,k as s}from"./rcDebugLog-ClX1msJX.js";import{i as c}from"./workSecret-DJu7k30X.js";import{t as l}from"./ccrClient-DXiEw9xU.js";import{n as u,t as d}from"./SSETransport-8yaTbdSK.js";u(),r(),n(),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:n,sessionId:r,initialSequenceNum:o,getAuthToken:u}=e,f;u?f=()=>{let e=u();return e?{Authorization:`Bearer ${e}`}:{}}:s(n);let p=e.epoch??await c(t,n);i(`[bridge:repl] CCR v2: worker sessionId=${r} 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,{},r,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: ${a(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: ${a(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-BZjPDxMm.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-Be5r2kKS.js";e();export{t as getChicagoEnabled};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{o as a,u as o}from"./proxy-CF7ZDxaW.js";import{G_ as s,H_ as c,Qo as l,U_ as u,Uo as d,W_ as f,Xo as p,dD as m,mo as h,st as g,uD as _,ut as v}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{o as a,u as o}from"./proxy-CF7ZDxaW.js";import{G_ as s,H_ as c,Qo as l,U_ as u,Uo as d,W_ as f,Xo as p,dD as m,mo as h,st as g,uD as _,ut as v}from"./loadAgentsDir-BYWykYwn.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-ClX1msJX.js";import{n as E,r as D}from"./SSETransport-8yaTbdSK.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 t=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(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,o=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;o+=r.decode(t,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: ${i(e)}`)}}o+=r.decode();let{frames:e}=D(o);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${i(e)}`)}}finally{n.releaseLock()}}var M,N,P=e((()=>{E(),t(),o(),M=`https://generativelanguage.googleapis.com/v1beta`,N={stream:!0}}));async function*F(e,t,n,i,a,o){try{let s=T(a.model),d=l(e,n),h=await Promise.all(n.map(e=>v(e,{getToolPermissionContext:a.getToolPermissionContext,tools:n,agents:a.agents,allowedAgentTypes:a.allowedAgentTypes,model:a.model}))),g=h.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:_,systemInstruction:S}=y(d,t),E=w(g),D=C(a.toolChoice),k=j({model:s,signal:i,fetchOverride:a.fetchOverride,body:{contents:_,...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=${s}, messages=${_.length}, tools=${E.length}`);let A=b(k,s),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:p([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}}m(a.langfuseTrace??null,{model:s,provider:`gemini`,input:c(d,t),output:u(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:f(h),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(),n(),d(),_(),s(),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{l as n,p as r}from"./debug-otxXY3j-.js";import{t as i}from"./sdk-DEtgRZvI.js";import{Bl as a,Eo as o,Ll as s,Rl as c,Uo as l,jo as u}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{g as t}from"./client-_sjL0I7A.js";import{l as n,p as r}from"./debug-otxXY3j-.js";import{t as i}from"./sdk-DEtgRZvI.js";import{Bl as a,Eo as o,Ll as s,Rl as c,Uo as l,jo as u}from"./loadAgentsDir-BYWykYwn.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-CjFs6_la.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let n=s();if(!n)return r(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let i=new AbortController;e.addEventListener(`abort`,()=>i.abort(),{once:!0});try{let{messages:t}=await a({promptMessages:[o({content:await d()})],cacheSafeParams:n,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 r=t.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(r)return{kind:`api-error`,text:u(r)??``};let s=t.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!s)return{kind:`failed`};let c=u(s);return!c||c.trim().length===0?{kind:`failed`}:{kind:`ok`,text:c.trim()}}catch(n){return n instanceof t||e.aborted||i.signal.aborted?{kind:`aborted`}:(r(`[recap] generation failed: ${n}`),{kind:`failed`})}}var p,m;e((()=>{i(),n(),c(),l(),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{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{s as a,u as o}from"./types-KeqFPzY5.js";import{Uo as s,ck as c,ko as l,nt as u,tt as d}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{s as a,u as o}from"./types-KeqFPzY5.js";import{Uo as s,ck as c,ko as l,nt as u,tt as d}from"./loadAgentsDir-BYWykYwn.js";import{X as f}from"./rcDebugLog-ClX1msJX.js";import{r as p,t as m}from"./sessionTitle-ePQRpeV2.js";async function h(e,t){let n=m(e);if(!n)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:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),r=o(Array.isArray(e.message.content)?l(e.message.content):e.message.content);return r&&typeof r==`object`&&`name`in r&&typeof r.name==`string`?r.name:null}catch(e){return r(`generateSessionName failed: ${i(e)}`,{level:`error`}),null}}var g=e((()=>{d(),n(),t(),a(),s(),p(),c()}));export{g as n,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as e,ot as t}from"./state-sIHsFpDu.js";import{Cc as n,Jc as r,Uc as i,dc as a,yc as o}from"./paths-
|
|
1
|
+
import{cn as e,ot as t}from"./state-sIHsFpDu.js";import{Cc as n,Jc as r,Uc as i,dc as a,yc as o}from"./paths-BZjPDxMm.js";import{l as s,p as c}from"./debug-otxXY3j-.js";import{E as l,T as u,r as d,v as f}from"./git-C0IuvuIy.js";import{a as p,n as m,o as h}from"./detectRepository-2ICvGD0U.js";import{realpath as g}from"fs/promises";e(),o(),s(),p(),i(),l(),f();async function _(){try{let e=await m();if(!e){c(`Not in a GitHub repository, skipping path mapping update`);return}let r=t(),i=d(r)??r,o;try{o=(await g(i)).normalize(`NFC`)}catch{o=i}let s=e.toLowerCase(),l=a().githubRepoPaths?.[s]??[];if(l[0]===o){c(`Path ${o} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==o),f=[o,...u];n(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),c(`Added ${o} to tracked paths for repo ${s}`)}catch(e){c(`Error updating repo path mapping: ${e}`)}}function v(e){let t=a(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(r));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 r=a(),i=e.toLowerCase(),o=r.githubRepoPaths?.[i]??[],s=o.filter(e=>e!==t);if(s.length===o.length)return;let l={...r.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,n(e=>({...e,githubRepoPaths:l})),c(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Bm as o,Fm as s,Hm as c,Im as l,KO as u,Lm as d,Mm as f,Nm as p,Pm as m,Ry as h,Um as g,Wm as _,ZO as v,aS as y,ad as b,id as x,od as S,zm as C}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Bm as o,Fm as s,Hm as c,Im as l,KO as u,Lm as d,Mm as f,Nm as p,Pm as m,Ry as h,Um as g,Wm as _,ZO as v,aS as y,ad as b,id as x,od as S,zm as C}from"./loadAgentsDir-BYWykYwn.js";import{n as w,t as T}from"./PermissionDialog-R-Vl4Tk-.js";function E({currentGoal:e,newObjective:t,onConfirm:r,onCancel:a}){function o(e){e===`yes`?r():a()}let c=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(i,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(i,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),l(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),s(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),c]})]}),(0,D.jsxs)(i,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:t})]}),(0,D.jsx)(i,{marginTop:1,children:(0,D.jsx)(y,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{t(),r(),h(),w(),o(),D=a()}));function k(e){let t=e.split(`
|
|
2
2
|
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){v(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=d();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${l(e.status)}`,`Time: ${s(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
|
|
3
3
|
`)}function M(e){return _(e),C(),b(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=f();return t&&(S(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=c();return t&&(b(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(d()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=g();return t&&b(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=m();return t&&b(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=p();return t&&(b(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=d();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{t(),o(),x(),u(),O(),P=a(),F=4e3,I=80}))();export{N as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{ai as t,ci as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{ai as t,ci as n}from"./paths-BZjPDxMm.js";import{l as r,p as i}from"./debug-otxXY3j-.js";import{B_ as a,G_ as o,H_ as s,Qo as c,Tm as l,U_ as u,Uo as d,V_ as f,W_ as p,Xo as m,dD as h,km as g,mo as _,st as v,uD as y,ut as b}from"./loadAgentsDir-BYWykYwn.js";import{F as x,I as S,J as C,L as w,P as T,R as E}from"./rcDebugLog-ClX1msJX.js";import{n as D,t as O}from"./openaiShared-BkVgd2rZ.js";import{randomUUID as k}from"crypto";async function*A(e,n,r,o,d){try{let f=C(d.model),g=c(e,r),_=await Promise.all(r.map(e=>b(e,{getToolPermissionContext:d.getToolPermissionContext,tools:r,agents:d.agents,allowedAgentTypes:d.allowedAgentTypes,model:d.model}))),v=_.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=E(g,n),T=w(v),O=S(d.toolChoice),A=a({maxRetries:0,fetchOverride:d.fetchOverride,source:d.querySource});i(`[Grok] Calling model=${f}, messages=${y.length}, tools=${T.length}`);let j=x(await A.chat.completions.create({model:f,messages:y,...T.length>0&&{tools:T,...O&&{tool_choice:O}},stream:!0,stream_options:{include_usage:!0},...d.temperatureOverride!==void 0&&{temperature:d.temperatureOverride}},{signal:o}),f),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:m([t],r,d.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&&l(t(f,F),F,d.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:I}:void 0}}h(d.langfuseTrace??null,{model:f,provider:`grok`,input:s(g,n),output:u(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:p(_)})}catch(e){let t=e instanceof Error?e.message:String(e);i(`[Grok] Error: ${t}`,{level:`error`}),yield _({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{f(),O(),T(),d(),v(),r(),g(),n(),y(),o()}))();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-BZjPDxMm.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{Uc as r,zc 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{Uc as r,zc as i}from"./paths-BZjPDxMm.js";import{E as a,J as o,O as s,U as c,_ as l,h as u,l as d,p as f}from"./debug-otxXY3j-.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{o as h,s as g}from"./log-DSV4Ht5l.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.8.1`}}async function O(e=`manual`,n=0){try{let r=t(),a=await D(e,n),o=e=>(e/1024/1024/1024).toFixed(3);f(`[HeapDump] Memory state:
|
|
2
2
|
heapUsed: ${o(a.memoryUsage.heapUsed)} GB (in snapshot)
|
|
3
3
|
external: ${o(a.memoryUsage.external)} GB (NOT in snapshot)
|
|
4
4
|
rss: ${o(a.memoryUsage.rss)} GB (total process)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Q as r,Rn as i,b as a,i as o,n as s,p as c,r as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Q as r,Rn as i,b as a,i as o,n as s,p as c,r as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{S as m,x as h}from"./startupProfiler-CBcN1Chw.js";import{DT as g,Ji as _,OT as v,Ui as y,Vi as b,aS as x,na as S,oS as C}from"./loadAgentsDir-BYWykYwn.js";import{t as w}from"./useKeybinding-DPOUuymz.js";import{t as T}from"./useTerminalSize-Du-EamDN.js";import{n as E,t as D}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{n as O,r as k}from"./modalContext-CuTwi_eD.js";import{n as A,t as j}from"./PromptInputHelpMenu-Bjjr3tYl.js";function M({commands:e,maxHeight:t,columns:n,title:r,onCancel:i,emptyMessage:s}){let{headerFocused:c,focusHeader:l}=o(),u=Math.max(1,n-10),d=Math.max(1,Math.floor((t-10)/2)),p=(0,N.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:m(_(e),u,!0)}))},[e,u]);return(0,P.jsx)(f,{flexDirection:`column`,paddingY:1,children:e.length===0&&s?(0,P.jsx)(a,{dimColor:!0,children:s}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{children:r}),(0,P.jsx)(f,{marginTop:1,children:(0,P.jsx)(x,{options:p,visibleOptionCount:d,onCancel:i,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:l,isDisabled:c})})]})})}var N,P,F=e((()=>{i(),N=t(i(),1),S(),h(),u(),C(),P=p()}));function I(){return(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,L.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,L.jsx)(a,{bold:!0,children:`Getting started`}),(0,L.jsxs)(f,{flexDirection:`column`,children:[(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`1. `}),(0,L.jsx)(a,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`2. `}),(0,L.jsx)(a,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`3. `}),(0,L.jsx)(a,{children:`Type `}),(0,L.jsx)(a,{bold:!0,children:`/commit`}),(0,L.jsx)(a,{children:` to commit changes, `}),(0,L.jsx)(a,{bold:!0,children:`/help`}),(0,L.jsx)(a,{children:` for commands, or `}),(0,L.jsx)(a,{bold:!0,children:`?`}),(0,L.jsx)(a,{children:` for shortcuts.`})]})]})]}),(0,L.jsxs)(f,{flexDirection:`column`,children:[(0,L.jsx)(f,{children:(0,L.jsx)(a,{bold:!0,children:`Shortcuts`})}),(0,L.jsx)(j,{gap:2,fixedWidth:!0})]})]})}var L,R=e((()=>{i(),u(),A(),L=p()}));function z({onClose:e,commands:t}){let{rows:i,columns:o}=n(),u=Math.floor(i/2),p=k(),m=()=>e(`Help dialog dismissed`,{display:`system`});d(`help:dismiss`,m,{context:`Help`});let h=E(m),g=v(`help:dismiss`,`Help`,`esc`),_=y(),x=t.filter(e=>_.has(e.name)&&!e.isHidden),S=[];if(process.env.USER_TYPE===`ant`){let e=new Set(b.map(e=>e.name));x=x.filter(t=>!e.has(t.name)),S=t.filter(t=>e.has(t.name)&&!t.isHidden)}let C=t.filter(e=>!_.has(e.name)&&!e.isHidden),w=[(0,B.jsx)(s,{title:`general`,children:(0,B.jsx)(I,{})},`general`)];return w.push((0,B.jsx)(s,{title:`commands`,children:(0,B.jsx)(M,{commands:x,maxHeight:u,columns:o,title:`Browse default commands:`,onCancel:m})},`commands`)),w.push((0,B.jsx)(s,{title:`custom-commands`,children:(0,B.jsx)(M,{commands:C,maxHeight:u,columns:o,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:m})},`custom`)),process.env.USER_TYPE===`ant`&&S.length>0&&w.push((0,B.jsx)(s,{title:`[ant-only]`,children:(0,B.jsx)(M,{commands:S,maxHeight:u,columns:o,title:`Browse ant-only commands:`,onCancel:m})},`ant-only`)),(0,B.jsx)(f,{flexDirection:`column`,height:p?void 0:u,children:(0,B.jsxs)(c,{color:`professionalBlue`,children:[(0,B.jsx)(l,{title:process.env.USER_TYPE===`ant`?`/help`:`Claude Code v2.8.1`,color:`professionalBlue`,defaultTab:`general`,children:w}),(0,B.jsx)(f,{marginTop:1,children:(0,B.jsxs)(a,{children:[`For more help: `,(0,B.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,B.jsx)(f,{marginTop:1,children:(0,B.jsx)(a,{dimColor:!0,children:h.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,B.jsxs)(a,{italic:!0,children:[g,` to cancel`]})})})]})})}var B,V=e((()=>{i(),D(),g(),S(),O(),T(),u(),w(),F(),R(),B=p()})),H,U;e((()=>{V(),H=p(),U=async(e,{options:{commands:t}})=>(0,H.jsx)(z,{commands:t,onClose:e})}))();export{U as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as e,Cn as t,Sn as n,mn as r}from"./loadAgentsDir-BYWykYwn.js";t();export{e as executeSessionEndHooks,r as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Q as o,Rn as s,b as c,f as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,ht as h}from"./state-sIHsFpDu.js";import{Qa as g,no as _,oo as v}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Q as o,Rn as s,b as c,f as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,ht as h}from"./state-sIHsFpDu.js";import{Qa as g,no as _,oo as v}from"./paths-BZjPDxMm.js";import{n as y,r as b}from"./analytics-DqMQntaB.js";import{l as x,o as S}from"./stringUtils-KZoO4GUd.js";import{Xu as C,Zu as w,aS as T,av as E,dC as D,ev as O,iv as k,lC as A,nv as j,oS as M,ov as N,rv as P,tv as F,uC as ee,vC as te,yC as ne}from"./loadAgentsDir-BYWykYwn.js";import{t as re}from"./useKeybinding-DPOUuymz.js";function ie(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);O(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=h();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}else if(process.env.USER_TYPE===`ant`){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:{type:`command`,command:`[ANT-ONLY] Built-in Hook`},matcher:e.matcher,source:`builtinHook`})}}}return n}function ae(e,t){return N(Object.keys(e[t]||{}),e,t)}function oe(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),m(),E(),L=n(function(e){return{PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
|
|
2
2
|
Exit code 0 - stdout/stderr not shown
|
|
3
3
|
Exit code 2 - show stderr to model and block tool call
|
|
4
4
|
Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,p as n}from"./debug-otxXY3j-.js";import{o as r,r as i}from"./common-NEOWMwtB.js";import{c as a,s as o}from"./escHotkey-D8WgbSyj.js";import{i as s,n as c,r as l}from"./gates-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,p as n}from"./debug-otxXY3j-.js";import{o as r,r as i}from"./common-NEOWMwtB.js";import{c as a,s as o}from"./escHotkey-D8WgbSyj.js";import{i as s,n as c,r as l}from"./gates-Be5r2kKS.js";import{n as u,t as d}from"./executor-BVh1PTF-.js";import{format as f}from"util";function p(){try{return Bun.spawnSync({cmd:[`osascript`,`-e`,`tell application "System Events" to get name of every process whose background only is false`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function m(){try{return Bun.spawnSync({cmd:[`screencapture`,`-x`,`-R`,`0,0,1,1`,`/dev/null`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function h(){return _||(_={serverName:i,logger:new g,executor:d({getMouseAnimationEnabled:()=>l().mouseAnimation,getHideBeforeActionEnabled:()=>l().hideBeforeAction}),ensureOsPermissions:async()=>{if(process.platform!==`darwin`)return{granted:!0};let e=a().tcc;if(e){let t=e.checkAccessibility(),n=e.checkScreenRecording();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}}let t=p(),n=m();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}},isDisabled:()=>!c(),getSubGates:l,getAutoUnhideEnabled:()=>!0,cropRawPatch:()=>null},_)}var g,_,v=e((()=>{t(),r(),u(),s(),o(),g=class{silly(e,t){n(f(e,t??``),{level:`debug`})}debug(e,t){n(f(e,t??``),{level:`debug`})}info(e,t){n(f(e,t??``),{level:`info`})}warn(e,t){n(f(e,t??``),{level:`warn`})}error(e,t){n(f(e,t??``),{level:`error`})}}}));export{v as n,h as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Cc as u,dc as d,yc as f}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Cc as u,dc as d,yc as f}from"./paths-BZjPDxMm.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{r as _,t as v}from"./execFileNoThrow-azCkYhmF.js";import{Ax as y,Cx as b,Fx as x,Jx as S,Nx as C,Ot as w,Px as T,Ry as E,Sx as D,Tt as O,aS as k,fC as A,lC as j,tS as M,uC as N,zx as P}from"./loadAgentsDir-BYWykYwn.js";import*as F from"path";function I({onComplete:e}){return(0,V.jsxs)(o,{title:`Do you wish to enable auto-connect to IDE?`,color:`ide`,onCancel:e,children:[(0,V.jsx)(k,{options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}],onChange:(0,B.useCallback)(async t=>{let n=t===`yes`;u(e=>({...e,autoConnectIde:n,hasIdeAutoConnectDialogBeenShown:!0})),e()},[e]),defaultValue:`yes`}),(0,V.jsx)(a,{dimColor:!0,children:`You can also configure this in /config or with the --ide flag`})]})}function L(){let e=d();return!x()&&e.autoConnectIde!==!0&&e.hasIdeAutoConnectDialogBeenShown!==!0}function R({onComplete:e}){let t=(0,B.useCallback)(t=>{let n=t===`yes`;n&&u(e=>({...e,autoConnectIde:!1})),e(n)},[e]);return(0,V.jsx)(o,{title:`Do you wish to disable auto-connect to IDE?`,subtitle:`You can also configure this in /config`,onCancel:(0,B.useCallback)(()=>{e(!1)},[e]),color:`ide`,children:(0,V.jsx)(k,{options:[{label:`No`,value:`no`},{label:`Yes`,value:`yes`}],onChange:t,defaultValue:`no`})})}function z(){let e=d();return!x()&&e.autoConnectIde===!0}var B,V,H=e((()=>{B=t(i(),1),s(),f(),y(),E(),V=l()}));function U({availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:r,onSelect:i}){let[s,l]=(0,Z.useState)(n?.port?.toString()??`None`),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=(0,Z.useCallback)(t=>{t!==`None`&&L()?d(!0):t===`None`&&z()?p(!0):i(e.find(e=>e.port===parseInt(t,10)))},[e,i]),h=e.reduce((e,t)=>(e[t.name]=(e[t.name]||0)+1,e),{}),g=e.map(e=>{let t=(h[e.name]||0)>1&&e.workspaceFolders.length>0;return{label:e.name,value:e.port.toString(),description:t?X(e.workspaceFolders):void 0}}).concat([{label:`None`,value:`None`,description:void 0}]);return u?(0,Q.jsx)(I,{onComplete:()=>m(s)}):f?(0,Q.jsx)(R,{onComplete:()=>{i(void 0)}}):(0,Q.jsx)(o,{title:`Select IDE`,subtitle:`Connect to an IDE for integrated development features.`,onCancel:r,color:`ide`,children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[e.length===0&&(0,Q.jsx)(a,{dimColor:!0,children:T()?`No available IDEs detected. Please install the plugin and restart your IDE:
|
|
2
2
|
https://docs.claude.com/s/claude-code-jetbrains`:`No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.`}),e.length!==0&&(0,Q.jsx)(k,{defaultValue:s,defaultFocusValue:s,options:g,onChange:e=>{l(e),m(e)}}),e.length!==0&&e.some(e=>e.name===`VS Code`||e.name===`Visual Studio Code`)&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{color:`warning`,children:`Note: Only one Claude Code instance can be connected to VS Code at a time.`})}),e.length!==0&&!x()&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{dimColor:!0,children:`Tip: You can enable auto-connect to IDE in /config or with the --ide flag`})}),t.length>0&&(0,Q.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,Q.jsxs)(a,{dimColor:!0,children:[`Found `,t.length,` other running IDE(s). However, their workspace/project directories do not match the current cwd.`]}),(0,Q.jsx)(c,{marginTop:1,flexDirection:`column`,children:t.map((e,t)=>(0,Q.jsx)(c,{paddingLeft:3,children:(0,Q.jsxs)(a,{dimColor:!0,children:[`• `,e.name,`: `,X(e.workspaceFolders)]})},t))})]})]})})}async function W(e,t){let n=t?.ide;if(!n||n.type!==`sse-ide`&&n.type!==`ws-ide`)return null;for(let t of e)if(t.url===n.url)return t;return null}function G({availableIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]?.port?.toString()??``),a=(0,Z.useCallback)(n=>{t(e.find(e=>e.port===parseInt(n,10)))},[e,t]),s=e.map(e=>({label:e.name,value:e.port.toString()}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select an IDE to open the project`,onCancel:c,color:`ide`,children:(0,Q.jsx)(k,{defaultValue:r,defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function K({runningIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]??``),a=(0,Z.useCallback)(e=>{t(e)},[t]),s=e.map(e=>({label:P(e),value:e}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select IDE to install extension`,onCancel:c,color:`ide`,children:(0,Q.jsx)(k,{defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function q({ide:e,onInstall:t}){return(0,Z.useEffect)(()=>{t(e)},[e,t]),null}async function J(e,t,r){m(`tengu_ext_ide_command`,{});let{options:{dynamicMcpConfig:i},onChangeDynamicMcpConfig:a}=t;if(r?.trim()===`open`){let t=O(),r=t?t.worktreePath:g(),i=(await D(!0)).filter(e=>e.isValid);return i.length===0?(e(`No IDEs with Claude Code extension detected.`),null):(0,Q.jsx)(G,{availableIDEs:i,onSelectIDE:async i=>{if(!i){e(`No IDE selected.`);return}if(i.name.toLowerCase().includes(`vscode`)||i.name.toLowerCase().includes(`cursor`)||i.name.toLowerCase().includes(`windsurf`)){let{code:a}=await v(`code`,[r]);e(a===0?`Opened ${t?`worktree`:`project`} in ${n.bold(i.name)}`:`Failed to open in ${i.name}. Try opening manually: ${r}`)}else T(),e(`Please open the ${t?`worktree`:`project`} manually in ${n.bold(i.name)}: ${r}`)},onDone:()=>{e(`Exited without opening IDE`,{display:`system`})}})}let o=await D(!0);if(o.length===0&&t.onInstallIDEExtension&&!x()){let r=await b(),i=r=>{t.onInstallIDEExtension&&(t.onInstallIDEExtension(r),C(r)?e(`Installed plugin to ${n.bold(P(r))}\nPlease ${n.bold(`restart your IDE`)} completely for it to take effect`):e(`Installed extension to ${n.bold(P(r))}`))};if(r.length>1)return(0,Q.jsx)(K,{runningIDEs:r,onSelectIDE:i,onDone:()=>{e(`No IDE selected.`,{display:`system`})}});if(r.length===1)return(0,Q.jsx)(q,{ide:r[0],onInstall:i})}let s=o.filter(e=>e.isValid);return(0,Q.jsx)(Y,{availableIDEs:s,unavailableIDEs:o.filter(e=>!e.isValid),currentIDE:await W(s,i),dynamicMcpConfig:i,onChangeDynamicMcpConfig:a,onDone:e})}function Y({availableIDEs:e,unavailableIDEs:t,currentIDE:n,dynamicMcpConfig:r,onChangeDynamicMcpConfig:i,onDone:o}){let[s,c]=(0,Z.useState)(null),l=N(e=>e.mcp.clients.find(e=>e.name===`ide`)),u=A(),d=(0,Z.useRef)(!0);(0,Z.useEffect)(()=>{if(s){if(d.current){d.current=!1;return}!l||l.type===`pending`||(l.type===`connected`?o(`Connected to ${s.name}.`):l.type===`failed`&&o(`Failed to connect to ${s.name}.`))}},[l,s,o]),(0,Z.useEffect)(()=>{if(!s)return;let e=setTimeout(o,$,`Connection to ${s.name} timed out.`);return()=>clearTimeout(e)},[s,o]);let f=(0,Z.useCallback)(e=>{if(!i){o(`Error connecting to IDE.`);return}let t={...r||{}};if(n&&delete t.ide,!e){l&&l.type===`connected`&&n&&(l.client.onclose=()=>{},S(`ide`,l.config),u(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.filter(e=>e.name!==`ide`),tools:e.mcp.tools.filter(e=>!e.name?.startsWith(`mcp__ide__`)),commands:e.mcp.commands.filter(e=>!e.name?.startsWith(`mcp__ide__`))}}))),i(t),o(n?`Disconnected from ${n.name}.`:`No IDE selected.`);return}let a=e.url;t.ide={type:a.startsWith(`ws:`)?`ws-ide`:`sse-ide`,url:a,ideName:e.name,authToken:e.authToken,ideRunningInWindows:e.ideRunningInWindows,scope:`dynamic`},d.current=!0,c(e),i(t)},[r,n,l,u,i,o]);return s?(0,Q.jsxs)(a,{dimColor:!0,children:[`Connecting to `,s.name,`…`]}):(0,Q.jsx)(U,{availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:()=>o(`IDE selection cancelled`,{display:`system`}),onSelect:f})}function X(e,t=100){if(e.length===0)return``;let n=g(),r=e.slice(0,2),i=e.length>2,a=i?3:0,o=t-(r.length-1)*2-a,s=Math.floor(o/r.length),c=n.normalize(`NFC`),l=r.map(e=>{let t=e.normalize(`NFC`);return t.startsWith(c+F.sep)&&(e=t.slice(c.length+1)),e.length<=s?e:`…`+e.slice(-(s-1))}).join(`, `);return i&&(l+=`, …`),l}var Z,Q,$;e((()=>{r(),Z=t(i(),1),p(),E(),s(),H(),M(),j(),h(),_(),y(),w(),Q=l(),$=35e3}))();export{J as call,X as formatWorkspaceFolders};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Ln as i,Tt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{Ct as c,cn as l}from"./state-sIHsFpDu.js";import{l as u,p as d}from"./debug-otxXY3j-.js";import{n as f,t as p}from"./lazySchema-B0QShMaQ.js";import{a as m,n as h,t as g}from"./bridgeConfig-
|
|
1
|
+
import{n as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Ln as i,Tt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{Ct as c,cn as l}from"./state-sIHsFpDu.js";import{l as u,p as d}from"./debug-otxXY3j-.js";import{n as f,t as p}from"./lazySchema-B0QShMaQ.js";import{a as m,n as h,t as g}from"./bridgeConfig-l6Ldi_hk.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),s(),l(),u(),t(),p(),m();var S=3e4;function C(e){d(`[bridge:inbound-attach] ${e}`)}var w=f(()=>o({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,c())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./inboundAttachments-CFV_eqMu.js";export{e as resolveAndPrepend};
|