claude-code-best 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-C7od6sFQ.js → AddWorkspaceDirectory-DRO4tbYd.js} +1 -1
- package/dist/chunks/{App-EfHjElWP.js → App-DJyiiVKi.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CSz0291w.js → ApproveApiKey-DygOEAkM.js} +1 -1
- package/dist/chunks/ApproveApiKey-oTZKoMvB.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-mLIhDlxW.js → AssistantSessionChooser-C67mOxVi.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-Bqk_Cn3j.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-BCdft-m_.js → BypassPermissionsModeDialog-C4z7RkFV.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-BPlrCIo-.js → ClaudeInChromeOnboarding-CyVFdjBe.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-5FCT81WS.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-D8fk-Ib5.js → ClaudeMdExternalIncludesDialog-IpqqBuJs.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BmGziW64.js +1 -0
- package/dist/chunks/{DesktopHandoff-BQwx7qWA.js → DesktopHandoff-CJpa8Xy-.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-CujM8Ivu.js → DevChannelsDialog-CfAuHVRL.js} +1 -1
- package/dist/chunks/Dialog-C8eGKH-e.js +1 -0
- package/dist/chunks/{DiffDialog-Byv1UJvS.js → DiffDialog-CV3brWsG.js} +1 -1
- package/dist/chunks/{Doctor-Cv7wbi6C.js → Doctor-D3GysagF.js} +1 -1
- package/dist/chunks/Doctor-DohPtIKu.js +1 -0
- package/dist/chunks/{ExitFlow-DKusdm_v.js → ExitFlow-L2sh80sm.js} +2 -2
- package/dist/chunks/{Feedback-Diw8XUr-.js → Feedback-DfkBCvva.js} +1 -1
- package/dist/chunks/{Grove-CAi037VV.js → Grove-Bo74aZx-.js} +1 -1
- package/dist/chunks/Grove-C_ocvHd3.js +1 -0
- package/dist/chunks/{HybridTransport-CP0RopXu.js → HybridTransport-BItIDJyC.js} +1 -1
- package/dist/chunks/{ITermBackend-RvD4VX7c.js → ITermBackend-3iS8Bvmo.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Bhlgysxl.js → InvalidConfigDialog-6lPGcuOX.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-dGStgJZN.js → InvalidSettingsDialog-D8DwHiys.js} +1 -1
- package/dist/chunks/ListItem-DDMe4CJ3.js +1 -0
- package/dist/chunks/{MCPConnectionManager-D5a9ysw2.js → MCPConnectionManager-CsPizxTx.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-B_z9pZ_8.js → McpParsingWarnings-Cepe7RPZ.js} +1 -1
- package/dist/chunks/MessageSelector-BzUQUeDn.js +3 -0
- package/dist/chunks/{Messages-DTmFVhRG.js → Messages-KmeXIJqL.js} +3 -3
- package/dist/chunks/{Onboarding-BoAtphYb.js → Onboarding-BZUXID6q.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-DA7Ne7Mj.js → OverageCreditUpsell-Dhm7HBuD.js} +1 -1
- package/dist/chunks/{PermissionDialog-_WQPRYHQ.js → PermissionDialog-BrRBxx5o.js} +1 -1
- package/dist/chunks/PluginSettings-BZ-PX9Tg.js +17 -0
- package/dist/chunks/{PressEnterToContinue-BJ58eCFC.js → PressEnterToContinue-DtA_p3X6.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-DhIQ0Nge.js → PromptInputFooterSuggestions-Da8Fty6P.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-B__j9zE6.js → PromptInputHelpMenu-Bz7EPzzq.js} +1 -1
- package/dist/chunks/QueryEngine-CmJK27jU.js +1 -0
- package/dist/chunks/REPL-BBmn_itf.js +1 -0
- package/dist/chunks/{REPL-B1BS9jwx.js → REPL-DxEJZpIp.js} +36 -36
- package/dist/chunks/{RemoteCallout-Bwe1ESr9.js → RemoteCallout-DONJj8l2.js} +1 -1
- package/dist/chunks/RemoteSessionManager-BvvNspY8.js +2 -0
- package/dist/chunks/ResumeConversation-EpjJdFHu.js +1 -0
- package/dist/chunks/{SSETransport-D3e5KNL3.js → SSETransport-D51Jfdaj.js} +1 -1
- package/dist/chunks/SearchBox-CciJ8giD.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-kjVFsFkT.js +1 -0
- package/dist/chunks/SentryErrorBoundary-DsrmgmKF.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-D-YZTGQG.js → SentryErrorBoundary-nYTimi4l.js} +1 -1
- package/dist/chunks/Settings-C2vEJjLx.js +2 -0
- package/dist/chunks/{TeleportProgress-C3Ubx1Se.js → TeleportProgress--jgrqIfW.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-D_ax3xQy.js → TeleportRepoMismatchDialog-BKDaFT_L.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-DeVKIXQp.js → TeleportResumeWrapper-CxlpiHIz.js} +1 -1
- package/dist/chunks/{ThemePicker-DKmIL5Ku.js → ThemePicker-CYL4C-F-.js} +1 -1
- package/dist/chunks/{TmuxBackend-Bm_cRJ2x.js → TmuxBackend-C_N4ww8i.js} +2 -2
- package/dist/chunks/{TrustDialog-ClXFMKj6.js → TrustDialog-CYdftZ1M.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-SdQADfvA.js → ValidationErrorsList-CaTwOP3f.js} +1 -1
- package/dist/chunks/{WelcomeV2-BijS6i2Z.js → WelcomeV2-5rgKm4Mz.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-CGEQ5ClB.js → WindowsTerminalBackend-BzoSs0VA.js} +2 -2
- package/dist/chunks/{add-dir-B7kleB6k.js → add-dir-RNzFR3XZ.js} +1 -1
- package/dist/chunks/{agentDisplay-Dr1XbOAu.js → agentDisplay-DgeOQY1E.js} +1 -1
- package/dist/chunks/{agents-CpLvvWpO.js → agents-D7cgzb3f.js} +7 -7
- package/dist/chunks/{agents-Dy5YOJC9.js → agents-iMtFurok.js} +1 -1
- package/dist/chunks/{ant-gwf-4eGN.js → ant-CF1iRpXD.js} +1 -1
- package/dist/chunks/{api-CDmgYrwN.js → api-DMbWqJlK.js} +1 -1
- package/dist/chunks/api-DkgaFAzq.js +1 -0
- package/dist/chunks/artifacts-D2kY_AMp.js +1 -0
- package/dist/chunks/{assistant-1usDIXtk.js → assistant-CZ4VXgzH.js} +1 -1
- package/dist/chunks/assistant-CiNV3Q0f.js +1 -0
- package/dist/chunks/{assistant-BULedprW.js → assistant-JAqAZqaE.js} +1 -1
- package/dist/chunks/{auth-CvHVr2A5.js → auth-BemPA3ot.js} +1 -1
- package/dist/chunks/auth-CbQCc9vz.js +1 -0
- package/dist/chunks/{autoMode-DSMM2seL.js → autoMode-CGovMAzJ.js} +1 -1
- package/dist/chunks/{autonomy-TtBO2TAe.js → autonomy-BVXyNEj0.js} +1 -1
- package/dist/chunks/{autonomy-Dj6Nzxus.js → autonomy-BnAHLZWH.js} +3 -3
- package/dist/chunks/{autonomyPanel-CbmU7lPg.js → autonomyPanel-COMI2iR0.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-Cp2RvmEN.js → backgroundHousekeeping-BRtG20l2.js} +2 -2
- package/dist/chunks/backgroundHousekeeping-LYpOamcN.js +1 -0
- package/dist/chunks/{banner-D9Cq292T.js → banner-D_rqe2XQ.js} +1 -1
- package/dist/chunks/{branch-Cj5TGroO.js → branch-BnKwIQtC.js} +1 -1
- package/dist/chunks/{break-cache-DrIa8RdW.js → break-cache-CDzQDHwY.js} +1 -1
- package/dist/chunks/{bridge-CsqJAoEg.js → bridge-ChVjEHVq.js} +2 -2
- package/dist/chunks/bridgeConfig-Budgp2Go.js +1 -0
- package/dist/chunks/{bridgeConfig-pjDV5Z2l.js → bridgeConfig-e0MGfed6.js} +1 -1
- package/dist/chunks/{bridgeEnabled-D9jI6X-w.js → bridgeEnabled-DR-v8AXw.js} +1 -1
- package/dist/chunks/bridgeEnabled-DmvmwuUY.js +1 -0
- package/dist/chunks/bridgeMain-KYR5iq6H.js +1 -0
- package/dist/chunks/{bridgeMain-CNmR9iDD.js → bridgeMain-OsR-_PRp.js} +11 -11
- package/dist/chunks/{bridgeMessaging-DN0X35NX.js → bridgeMessaging-BvBnxgD4.js} +1 -1
- package/dist/chunks/{btw-BOg0RTKl.js → btw-_b16RGoh.js} +1 -1
- package/dist/chunks/{buddy-BFuPeIxM.js → buddy-DJ3QSQyd.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-kxVnIVRs.js → bypassPermissionsKillswitch-OhGSWZrB.js} +1 -1
- package/dist/chunks/{caches-BumkMuGA.js → caches-Bp4F7tZ5.js} +2 -2
- package/dist/chunks/caches-CkH9F-Fd.js +1 -0
- package/dist/chunks/{ccrClient-BI1QPLmN.js → ccrClient-D7pEGzQa.js} +1 -1
- package/dist/chunks/changeDetector-IFbty4jj.js +1 -0
- package/dist/chunks/{channelNotification-CoZSFUlb.js → channelNotification-BZFMAWln.js} +1 -1
- package/dist/chunks/channelNotification-CIyWY0hs.js +1 -0
- package/dist/chunks/{chrome-C_5EZcdc.js → chrome-B5IxDA16.js} +1 -1
- package/dist/chunks/clear-BVjSQsUL.js +1 -0
- package/dist/chunks/client-BUUsZdSe.js +1 -0
- package/dist/chunks/color-BYVWpzI8.js +1 -0
- package/dist/chunks/commands-pTQdOvN6.js +1 -0
- package/dist/chunks/{commitAttribution-iKd8bTOI.js → commitAttribution-ClSlXMPG.js} +1 -1
- package/dist/chunks/commitAttribution-QPrKt_BF.js +1 -0
- package/dist/chunks/{compact-B6Muofhz.js → compact-B9c12JXf.js} +3 -3
- package/dist/chunks/{companion-B_LrjSk5.js → companion-C8e7dVlu.js} +1 -1
- package/dist/chunks/completionCache-BB7-y2BX.js +1 -0
- package/dist/chunks/{completionCache-C7hDqIDL.js → completionCache-Br6OwASx.js} +1 -1
- package/dist/chunks/{config-CJd9kJ57.js → config-Bxgfx_nO.js} +1 -1
- package/dist/chunks/{config-CQd4IkXo.js → config-C-yz-f4W.js} +1 -1
- package/dist/chunks/{context-qAHTuazZ.js → context-Bf5t6C-a.js} +1 -1
- package/dist/chunks/{context-noninteractive-DZsSp-ES.js → context-noninteractive-CJu7hZCM.js} +1 -1
- package/dist/chunks/context-noninteractive-OUTZ6BKj.js +1 -0
- package/dist/chunks/conversation-BYMS5Hqa.js +1 -0
- package/dist/chunks/conversation-Bs8l0KNl.js +1 -0
- package/dist/chunks/{copy-B2jhZndZ.js → copy-C0BZ7Gm0.js} +1 -1
- package/dist/chunks/{createSSHSession-CKdoEmAg.js → createSSHSession-DNXCWneI.js} +1 -1
- package/dist/chunks/{createSession-WkBw7wdn.js → createSession-DjM6Ev45.js} +1 -1
- package/dist/chunks/createSession-DpqtD4ML.js +1 -0
- package/dist/chunks/cron-DwR6OJuW.js +1 -0
- package/dist/chunks/{cronJitterConfig-2u6WAlti.js → cronJitterConfig-CaFkPXKB.js} +1 -1
- package/dist/chunks/{crossProjectResume-CjJISRBQ.js → crossProjectResume-BCr6jfGz.js} +3 -3
- package/dist/chunks/{daemon-BRKR4D1D.js → daemon-Bu0Uy-qG.js} +1 -1
- package/dist/chunks/{datadog-YsyhnDmr.js → datadog-ClZjR-jM.js} +1 -1
- package/dist/chunks/datadog-DlzPb5oG.js +1 -0
- package/dist/chunks/desktop-WH8s-9-6.js +1 -0
- package/dist/chunks/{diff-BTtUFuf-.js → diff-D9hjPq4W.js} +1 -1
- package/dist/chunks/{doctor-BKBb426q.js → doctor-4-im_J_h.js} +1 -1
- package/dist/chunks/earlyInput-DEZaWwKF.js +1 -0
- package/dist/chunks/{effort-ClhxMqY6.js → effort-Bz-9GIpe.js} +1 -1
- package/dist/chunks/entry-CEBaLwEG.js +14 -0
- package/dist/chunks/{envLessBridgeConfig-C9UUbQCo.js → envLessBridgeConfig-DW4-nPbZ.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-izoVnE8s.js +1 -0
- package/dist/chunks/exit-DBNDTR4b.js +1 -0
- package/dist/chunks/{export-DS2esu8D.js → export-CQHUM_Nv.js} +1 -1
- package/dist/chunks/{exportRenderer-DX2L5fQ7.js → exportRenderer-CuIDQBLH.js} +1 -1
- package/dist/chunks/{extra-usage-XJxfHsbe.js → extra-usage-DTr6gExD.js} +1 -1
- package/dist/chunks/extra-usage-VSASGlte.js +1 -0
- package/dist/chunks/{extra-usage-core-D84ifgBo.js → extra-usage-core-D3CwYO_8.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-fxqxHnIt.js → extra-usage-noninteractive-d-QVg1D5.js} +1 -1
- package/dist/chunks/{extraUsage-P_NGI1-I.js → extraUsage-BNRQOkgU.js} +1 -1
- package/dist/chunks/extractMemories-hQlhiVOD.js +1 -0
- package/dist/chunks/fast-2gWrhEFZ.js +1 -0
- package/dist/chunks/{fast-CpN8lLnE.js → fast-bkGXbuHX.js} +1 -1
- package/dist/chunks/{feedback-CqRsOG3c.js → feedback-BvFgE_FF.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-CM0V7Uev.js → firstPartyEventLogger-D-ifHvWu.js} +1 -1
- package/dist/chunks/{flushGate-DNutWuOE.js → flushGate-BA24vFBg.js} +1 -1
- package/dist/chunks/{fpsMetrics-DKWp7vng.js → fpsMetrics-CBFlAGTS.js} +1 -1
- package/dist/chunks/{gates-C4JvRq4i.js → gates-C66Nz9b2.js} +1 -1
- package/dist/chunks/gates-dO6m4Hdp.js +1 -0
- package/dist/chunks/{gemini-B0M6SQSG.js → gemini-DuQl4hTA.js} +1 -1
- package/dist/chunks/{generateRecap-DhDOgXn3.js → generateRecap-CwBU76xi.js} +1 -1
- package/dist/chunks/{generateSessionName-CoFR2wgK.js → generateSessionName-LnmjE9jh.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-DGiSNykv.js → githubRepoPathMapping-DrreQj47.js} +1 -1
- package/dist/chunks/{goal-DRb6pPAp.js → goal-BIvjF6B7.js} +3 -3
- package/dist/chunks/{grok-emDua_hT.js → grok-KNLYSRBQ.js} +1 -1
- package/dist/chunks/{growthbook-COAneL48.js → growthbook-ksjGAskq.js} +1 -1
- package/dist/chunks/{heapdump-CA6DHA8G.js → heapdump-Cz8vkcOr.js} +1 -1
- package/dist/chunks/{help-XXY7deZm.js → help-Cx9OordP.js} +1 -1
- package/dist/chunks/{hooks-C6zZYnDi.js → hooks-BW-d9Bdu.js} +2 -2
- package/dist/chunks/hooks-BWoN0nQP.js +1 -0
- package/dist/chunks/{hostAdapter-DZbdeXCV.js → hostAdapter-DLmaB6eN.js} +1 -1
- package/dist/chunks/{ide-BLRNkzVx.js → ide-CECrIg1r.js} +2 -2
- package/dist/chunks/{inboundAttachments-60kD5Qt_.js → inboundAttachments-B0sGIu79.js} +1 -1
- package/dist/chunks/inboundAttachments-D8vq1NQO.js +1 -0
- package/dist/chunks/initReplBridge-BAEMZEcg.js +1 -0
- package/dist/chunks/{insights-BBugI3tW.js → insights-DeWggLxC.js} +1 -1
- package/dist/chunks/{install-github-app-ByyzrlM9.js → install-github-app-DqKEiHQ1.js} +2 -2
- package/dist/chunks/{install-CuVHbwyW.js → install-pxH_HR1p.js} +1 -1
- package/dist/chunks/{install-slack-app-CJGtmacz.js → install-slack-app-P1L9x-YI.js} +1 -1
- package/dist/chunks/{instrumentation-C8zvzMg1.js → instrumentation-Dx0s2jzr.js} +3 -3
- package/dist/chunks/{job-DBf6aPQX.js → job-CbxxkPgE.js} +1 -1
- package/dist/chunks/{keybindings-Bi7SMp5-.js → keybindings-BBPC7FAc.js} +1 -1
- package/dist/chunks/{lang-CVDkUhjk.js → lang-CKp0Tn76.js} +1 -1
- package/dist/chunks/language-CSDpzbTz.js +1 -0
- package/dist/chunks/{language-BYeqMX74.js → language-iERMuOEu.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-BKqxMFFn.js → launchAgentsPlatform-DQvKVtl2.js} +1 -1
- package/dist/chunks/{launchAutofixPr-CauX6gOB.js → launchAutofixPr-B7hu9C8h.js} +3 -3
- package/dist/chunks/{launchCommand-9eYsPG7W.js → launchCommand-CJsikSlW.js} +1 -1
- package/dist/chunks/{launchLocalMemory-Brrd_BJC.js → launchLocalMemory-Cpz7L5j5.js} +2 -2
- package/dist/chunks/{launchLocalVault-DtAn656A.js → launchLocalVault-XLfOQtP7.js} +3 -3
- package/dist/chunks/{launchMemoryStores-x7_Id7Yr.js → launchMemoryStores-Cz04PaDE.js} +1 -1
- package/dist/chunks/{launchOnboarding-DkamFByn.js → launchOnboarding-XPbUNdHS.js} +1 -1
- package/dist/chunks/{launchSchedule-DjNQNxW4.js → launchSchedule-B1VEe3o-.js} +1 -1
- package/dist/chunks/{launchSkillStore-D2GUGhDD.js → launchSkillStore-Cy59z5xx.js} +1 -1
- package/dist/chunks/{launchTeleport-DTfhiZkf.js → launchTeleport-ZPM_DvzK.js} +3 -3
- package/dist/chunks/{launchVault-BZ2Po4r8.js → launchVault-BhnTOZq8.js} +1 -1
- package/dist/chunks/loadAgentsDir-B-4D2dVE.js +1 -0
- package/dist/chunks/{loadAgentsDir-C_wFhytF.js → loadAgentsDir-CQF8qhne.js} +778 -778
- package/dist/chunks/loadPluginHooks-TyULD8KH.js +1 -0
- package/dist/chunks/{localSearch-B0p0_bjP.js → localSearch-BNYypHsK.js} +1 -1
- package/dist/chunks/localSearch-DsFH9yls.js +1 -0
- package/dist/chunks/login-CEJEl2mW.js +1 -0
- package/dist/chunks/{login-C1uE6Pg9.js → login-CxbcJk9_.js} +1 -1
- package/dist/chunks/{logoV2Utils-BJHvwGup.js → logoV2Utils-Br_w1z39.js} +1 -1
- package/dist/chunks/logout-BXr4jzNY.js +1 -0
- package/dist/chunks/{magicDocs-DPZzG7Z2.js → magicDocs-DnxdS9yV.js} +1 -1
- package/dist/chunks/{main-CNwSLti2.js → main-FBmdv32j.js} +145 -66
- package/dist/chunks/{mappers-Dxs_kNJH.js → mappers-BNI_df3v.js} +1 -1
- package/dist/chunks/mcp-BhAGhDQE.js +1 -0
- package/dist/chunks/{mcp-CbDDqdzF.js → mcp-DbqUZ1Cf.js} +1 -1
- package/dist/chunks/mcp-esqdO_lV.js +6 -0
- package/dist/chunks/{mcpServer-Py4Iz9Hx.js → mcpServer-Ct-GVL-y.js} +1 -1
- package/dist/chunks/{mcpServer-BJNjQXsU.js → mcpServer-DeL2ADSF.js} +1 -1
- package/dist/chunks/memory-DwapBEsD.js +1 -0
- package/dist/chunks/{mobile-BMglW1NB.js → mobile-D7MSmMhc.js} +1 -1
- package/dist/chunks/{modalContext-c5Yqx_CQ.js → modalContext-DxfeT_3m.js} +1 -1
- package/dist/chunks/{mode-CqGusjoT.js → mode-B5cmHCvz.js} +1 -1
- package/dist/chunks/{model-BBULcn7y.js → model-BePO0VaC.js} +1 -1
- package/dist/chunks/model-CgH43-hO.js +1 -0
- package/dist/chunks/{onChangeAppState-BkRihYau.js → onChangeAppState-B3d5iy6T.js} +1 -1
- package/dist/chunks/{openai-yNI_zoao.js → openai-fRhGOIQq.js} +3 -3
- package/dist/chunks/{overageCreditGrant-Cbh0_fbM.js → overageCreditGrant-B6sx7IFi.js} +1 -1
- package/dist/chunks/{panel-D3wvAEFE.js → panel-CAVG5BOM.js} +1 -1
- package/dist/chunks/{panel-BYfvo_mR.js → panel-DU8y_jcf.js} +1 -1
- package/dist/chunks/{panelCall-t10Sud9A.js → panelCall-DUQdjDee.js} +1 -1
- package/dist/chunks/{passes-D_iS6DaC.js → passes-CWPPUigp.js} +1 -1
- package/dist/chunks/{paths-Ci1iwL5Y.js → paths-4ZWdjPP4.js} +3 -3
- package/dist/chunks/{permissions-CHvu4-yX.js → permissions-DW8CRuJp.js} +3 -3
- package/dist/chunks/{pipeTransport-EAYXsubu.js → pipeTransport-CUeYRWJn.js} +1 -1
- package/dist/chunks/{plan-CP5nq_EB.js → plan-Cf-tHvGq.js} +1 -1
- package/dist/chunks/plugin-DXhCgoNC.js +1 -0
- package/dist/chunks/{pluginAutoupdate-ClrgF5b3.js → pluginAutoupdate-CdmKzIRf.js} +1 -1
- package/dist/chunks/{pluginBlocklist-B1LVo0j_.js → pluginBlocklist-C9XwbFSo.js} +1 -1
- package/dist/chunks/{pluginCliCommands-eqyMBWcP.js → pluginCliCommands-CmY_maYg.js} +1 -1
- package/dist/chunks/{pluginFlagging-BiTDVP10.js → pluginFlagging-DyzxZolj.js} +1 -1
- package/dist/chunks/{pluginOperations-gZ-iCmhu.js → pluginOperations-mr4I7Jw9.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-DCDWHam6.js → pluginStartupCheck-B6OdK29Z.js} +1 -1
- package/dist/chunks/pluginStartupCheck-BFuZqpnX.js +1 -0
- package/dist/chunks/{plugins-BAIVqfi8.js → plugins-rdPgpjF8.js} +1 -1
- package/dist/chunks/policyLimits-B3dtp_Fe.js +1 -0
- package/dist/chunks/{pollConfig-_2W7bHoW.js → pollConfig-DLbuHBse.js} +1 -1
- package/dist/chunks/{poor-Dii0mpOW.js → poor-pmz2b7zu.js} +1 -1
- package/dist/chunks/poorMode-BPIUnFFi.js +1 -0
- package/dist/chunks/{poorMode-aDmmvJ_e.js → poorMode-DD-q_w6Z.js} +1 -1
- package/dist/chunks/{print-BwSmcUQu.js → print-luaON-Cg.js} +12 -12
- package/dist/chunks/{privacy-settings-DaAgSLKw.js → privacy-settings-BpigC4oX.js} +1 -1
- package/dist/chunks/{processBashCommand-BZ1_JKu4.js → processBashCommand-f_84bSlP.js} +1 -1
- package/dist/chunks/processSlashCommand-BkBqV3Jd.js +6 -0
- package/dist/chunks/{projectContext-Cd7V9pES.js → projectContext-fS1t-xRh.js} +1 -1
- package/dist/chunks/{prompt-6ZKyqv6z.js → prompt-CogZQuTN.js} +1 -1
- package/dist/chunks/prompt-CriAIdkT.js +1 -0
- package/dist/chunks/prompt-TGc_H1cL.js +1 -0
- package/dist/chunks/{promptEditor-Dz41P-3I.js → promptEditor-C___2FFs.js} +2 -2
- package/dist/chunks/{protocolHandler-CHGHjfdf.js → protocolHandler-qwll5gSY.js} +1 -1
- package/dist/chunks/{rate-limit-options-BlU9av7g.js → rate-limit-options-nQcTipEp.js} +1 -1
- package/dist/chunks/{rcDebugLog-C42A0pX1.js → rcDebugLog-DOXxIr8l.js} +1 -1
- package/dist/chunks/{referral-IIcY3jkp.js → referral-CMPZjf3I.js} +1 -1
- package/dist/chunks/{refresh-DTGEx7X_.js → refresh-CP7Dnjp4.js} +1 -1
- package/dist/chunks/{registerProtocol-BkNncGMI.js → registerProtocol-DCNuqdCC.js} +1 -1
- package/dist/chunks/registry-DLqZJleQ.js +1 -0
- package/dist/chunks/{release-notes-BxzOD-zP.js → release-notes-BsDW6T9f.js} +1 -1
- package/dist/chunks/{releaseNotes-C8KQGZHq.js → releaseNotes-Tbd018Qz.js} +2 -2
- package/dist/chunks/{reload-plugins-gYyC6_g8.js → reload-plugins-iG9ZE9wF.js} +1 -1
- package/dist/chunks/{remote-env-CEJH5aJh.js → remote-env-BFntnltf.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Dte7ZUAN.js → remoteBridgeCore-Dpko9c-J.js} +1 -1
- package/dist/chunks/{remoteControlServer-GN-eDbEz.js → remoteControlServer-D3P82kVF.js} +1 -1
- package/dist/chunks/{rename-BEU6BNRp.js → rename-Codm2nfB.js} +1 -1
- package/dist/chunks/{resume-D36S2rXg.js → resume-BB1ceL_x.js} +2 -2
- package/dist/chunks/{runtimeObserver-CDMCeww2.js → runtimeObserver-BpRn0RiL.js} +1 -1
- package/dist/chunks/{runtimeObserver-DaKaKNVW.js → runtimeObserver-D6aF77Dq.js} +2 -2
- package/dist/chunks/sandbox-adapter-DrHD1mch.js +1 -0
- package/dist/chunks/{sandbox-toggle-BPO26t48.js → sandbox-toggle-DZ-8qXDS.js} +1 -1
- package/dist/chunks/searchExtraTools-Dwg6ZafS.js +1 -0
- package/dist/chunks/{sentry-9EbPa1Xu.js → sentry-CVdHlmNQ.js} +1 -1
- package/dist/chunks/{session-D18B22u4.js → session-B4j1ViVc.js} +1 -1
- package/dist/chunks/{sessionDiscovery-B-OTvXJf.js → sessionDiscovery-DkIIFsWX.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-n7HcOfZ7.js +1 -0
- package/dist/chunks/{sessionMemory-Ctauybzs.js → sessionMemory-CnT3-Mj7.js} +1 -1
- package/dist/chunks/sessionMemory-DVq43VXP.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BjkdLRvh.js +1 -0
- package/dist/chunks/sessionObserver-CrfmnMzL.js +1 -0
- package/dist/chunks/{sessionObserver-ardnTJ37.js → sessionObserver-gjdJ91cv.js} +1 -1
- package/dist/chunks/sessionStorage-BTbr9wkZ.js +1 -0
- package/dist/chunks/{sessionTitle-DEKvIVCK.js → sessionTitle-CSU5-VK9.js} +1 -1
- package/dist/chunks/{sessionTracing-CJUUEWZ4.js → sessionTracing-BDN64fWh.js} +1 -1
- package/dist/chunks/{settingsSync-BWt3oUR7.js → settingsSync-Nixbcaox.js} +1 -1
- package/dist/chunks/{setup-BECFDOT9.js → setup-9nXlu56r.js} +1 -1
- package/dist/chunks/{setup-CmCTB2T_.js → setup-CZxLEcQh.js} +1 -1
- package/dist/chunks/setup-n3Ixr_gs.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-BbALfdxE.js → shadowedRuleDetection-CCS7R7F1.js} +1 -1
- package/dist/chunks/{sideQuestion-BHK6dd1q.js → sideQuestion-MzExGTvn.js} +1 -1
- package/dist/chunks/{sink-Do5fWbUC.js → sink-BL75jACh.js} +1 -1
- package/dist/chunks/sink-CoUVbLFs.js +1 -0
- package/dist/chunks/{sinks-Dc9V7k6a.js → sinks-C-gxj_Eu.js} +2 -2
- package/dist/chunks/sinks-wuo1yQ_m.js +1 -0
- package/dist/chunks/{skill-learning-BHW9G3Dn.js → skill-learning-B9Msm4jG.js} +1 -1
- package/dist/chunks/skillChangeDetector-DlWPJTny.js +1 -0
- package/dist/chunks/{skillGapStore-DVMbI2yy.js → skillGapStore-Cpmbwyo3.js} +1 -1
- package/dist/chunks/{skillGapStore-Wa7s6orv.js → skillGapStore-CsADiV5a.js} +2 -2
- package/dist/chunks/{skillGenerator-CBuoIFsH.js → skillGenerator-_khb-Gmc.js} +2 -2
- package/dist/chunks/skillLearning-CFnZiM5J.js +1 -0
- package/dist/chunks/skillLearning-D6mvGN90.js +1 -0
- package/dist/chunks/{skillPanel-2w82nkOl.js → skillPanel-DQmj3Yh1.js} +3 -3
- package/dist/chunks/{skillSearchPanel-7BhCBkdh.js → skillSearchPanel-6w_zzoI3.js} +2 -2
- package/dist/chunks/{skills-D5rMEo2w.js → skills-B3LN9tp9.js} +1 -1
- package/dist/chunks/{sprites-uNWgVZT6.js → sprites-8JVWnXzp.js} +1 -1
- package/dist/chunks/{src-poaoYkuc.js → src-BJM0zMNO.js} +1 -1
- package/dist/chunks/{src-Di342QoJ.js → src-KjMLauwe.js} +1 -1
- package/dist/chunks/startupProfiler-BmnoJtfF.js +1 -0
- package/dist/chunks/{startupProfiler-CAntGAbs.js → startupProfiler-rCtNuhXz.js} +1 -1
- package/dist/chunks/{staticRender-C5v46np_.js → staticRender-DboURbK0.js} +1 -1
- package/dist/chunks/{stats-D0CJB2HV.js → stats-BDlygx5X.js} +1 -1
- package/dist/chunks/status-DlT1tUmc.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-Lqf99003.js → statusNoticeHelpers-Cd_LDPvn.js} +1 -1
- package/dist/chunks/{tag-BnvWS9HE.js → tag-BLPgXlQZ.js} +1 -1
- package/dist/chunks/tasks-Bf1Nf3WX.js +1 -0
- package/dist/chunks/{teamHelpers-D8R_gGLb.js → teamHelpers-B-poMJeE.js} +1 -1
- package/dist/chunks/teamHelpers-DeQCfdgu.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-Bdra3VIJ.js → teammateModeSnapshot-B1_3D1CQ.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-BRuKcJNr.js +1 -0
- package/dist/chunks/teleport-CSo3PT05.js +1 -0
- package/dist/chunks/{templateJobs-BDKGtmr3.js → templateJobs-BVebX2BK.js} +1 -1
- package/dist/chunks/{terminalSetup-C1X-sXwp.js → terminalSetup-DHWL0gnz.js} +1 -1
- package/dist/chunks/{terminalSetup-Bbvq-9Xl.js → terminalSetup-DZTEKKne.js} +1 -1
- package/dist/chunks/{theme-DXv6bV7f.js → theme-BHQSNwSe.js} +1 -1
- package/dist/chunks/thinkback-CVYpxAyO.js +1 -0
- package/dist/chunks/{thinkback-CMsW7mvG.js → thinkback-DOzxcgMy.js} +1 -1
- package/dist/chunks/{thinkback-play-CFdkpzlj.js → thinkback-play-CK1C_F7G.js} +1 -1
- package/dist/chunks/{toolEventObserver-DDJV8cvW.js → toolEventObserver-BIjUIh4k.js} +1 -1
- package/dist/chunks/{toolEventObserver-CF7T7FBH.js → toolEventObserver-XPorjjtG.js} +1 -1
- package/dist/chunks/toolPool-CDEeuQd2.js +1 -0
- package/dist/chunks/{toolPool-BJv0sBnR.js → toolPool-hQlvQn-j.js} +1 -1
- package/dist/chunks/{trustedDevice-C9nJhhyZ.js → trustedDevice-CyfQd_GU.js} +1 -1
- package/dist/chunks/{trustedDevice-C5s2au0k.js → trustedDevice-D-L5uAor.js} +1 -1
- package/dist/chunks/{tui-DoOiz2RW.js → tui-C7aBeORE.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-BEv1_AS1.js → ultrareviewCommand-rnMsUWTn.js} +2 -2
- package/dist/chunks/undercover-BviGW-bQ.js +1 -0
- package/dist/chunks/{undercover-DPVt2WN7.js → undercover-ClLYK52H.js} +1 -1
- package/dist/chunks/{updateCCB-D-4naIUu.js → updateCCB-pqkACWbs.js} +1 -1
- package/dist/chunks/upgrade-DAuhXFVI.js +1 -0
- package/dist/chunks/{upgrade-CSld83v7.js → upgrade-DpfZlPyC.js} +1 -1
- package/dist/chunks/{upload-DVlE8SRp.js → upload-D98tqZnO.js} +1 -1
- package/dist/chunks/{usage-D4Ubnttz.js → usage-BWd5R6DU.js} +1 -1
- package/dist/chunks/{usage-B_bY46ep.js → usage-CRquq5_O.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BHi41Ku_.js → useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js} +1 -1
- package/dist/chunks/useKeybinding-DOjEx42R.js +1 -0
- package/dist/chunks/useMainLoopModel-BZoZdEdj.js +1 -0
- package/dist/chunks/{useManagePlugins-B4kcqcyY.js → useManagePlugins-DMY74XAk.js} +1 -1
- package/dist/chunks/{useMergedTools-CTQl4cdV.js → useMergedTools-NN58Kguw.js} +1 -1
- package/dist/chunks/{useSearchInput-JPayBRPC.js → useSearchInput-CodP_5SB.js} +1 -1
- package/dist/chunks/{useSettingsErrors-YTgPxnRZ.js → useSettingsErrors-BRxaYl6B.js} +1 -1
- package/dist/chunks/useTerminalSize-mqo2Swmk.js +1 -0
- package/dist/chunks/{useVoice-CaBv3G13.js → useVoice-ByU-q_w4.js} +1 -1
- package/dist/chunks/{util-Q70qdjeS.js → util-SpgBY5_I.js} +1 -1
- package/dist/chunks/utils-CM5oEyAY.js +1 -0
- package/dist/chunks/{validatePlugin-6lg9B564.js → validatePlugin-CxCXNV8o.js} +1 -1
- package/dist/chunks/{vim-zOsQBIp4.js → vim-ByXlYzf9.js} +1 -1
- package/dist/chunks/{voice-DBQevAhk.js → voice-BnLS_SdQ.js} +1 -1
- package/dist/chunks/voiceModeEnabled-B3njLfhA.js +1 -0
- package/dist/chunks/{voiceModeEnabled-CjBjjeNR.js → voiceModeEnabled-D070o6QK.js} +1 -1
- package/dist/chunks/voiceStreamSTT-BkeyhhFJ.js +1 -0
- package/dist/chunks/{voiceStreamSTT-B8CTbb_6.js → voiceStreamSTT-vkQ-Aop7.js} +1 -1
- package/dist/chunks/{web-tools-CGqBqo07.js → web-tools-1yM0ZBfA.js} +1 -1
- package/dist/chunks/{workerRegistry-Bx6FvTZF.js → workerRegistry-7xGv_sNB.js} +1 -1
- package/dist/chunks/worktree-UA9gKCwL.js +1 -0
- package/dist/chunks/{xml-CVF7dWfi.js → xml-BUaEXGXx.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-Cc5SaLqs.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-OkUSMj0I.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BbPaorIs.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Dyv4mI_o.js +0 -1
- package/dist/chunks/Dialog-91X6ZGg9.js +0 -1
- package/dist/chunks/Doctor-CRrE5Sf4.js +0 -1
- package/dist/chunks/Grove-CgX5Fdeh.js +0 -1
- package/dist/chunks/ListItem-DCQhApdJ.js +0 -1
- package/dist/chunks/MessageSelector-CEvbAZGv.js +0 -3
- package/dist/chunks/PluginSettings-D3bQRsge.js +0 -17
- package/dist/chunks/QueryEngine-CMcQGyql.js +0 -1
- package/dist/chunks/REPL-C9f3ToGu.js +0 -1
- package/dist/chunks/RemoteSessionManager-BKD4YmzY.js +0 -2
- package/dist/chunks/ResumeConversation-DxqbAKA4.js +0 -1
- package/dist/chunks/SearchBox-CkO4rQ-9.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BVAhywUI.js +0 -1
- package/dist/chunks/SentryErrorBoundary-M1ipwe1n.js +0 -1
- package/dist/chunks/Settings-D5EWYL40.js +0 -2
- package/dist/chunks/api-BdbBnz5c.js +0 -1
- package/dist/chunks/assistant-BMviqf0l.js +0 -1
- package/dist/chunks/auth-ORBmEqnH.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BAvSPaZ5.js +0 -1
- package/dist/chunks/bridgeConfig-B49H_B9L.js +0 -1
- package/dist/chunks/bridgeEnabled-DsG2JvIr.js +0 -1
- package/dist/chunks/bridgeMain-DYCShrcV.js +0 -1
- package/dist/chunks/caches-BsYvQnWV.js +0 -1
- package/dist/chunks/changeDetector-By54zja0.js +0 -1
- package/dist/chunks/channelNotification-Cx82K1CD.js +0 -1
- package/dist/chunks/clear-BQr2zTyP.js +0 -1
- package/dist/chunks/client-BbavFXJZ.js +0 -1
- package/dist/chunks/color-DOsgZO2n.js +0 -1
- package/dist/chunks/commands-CfwfGt3T.js +0 -1
- package/dist/chunks/commitAttribution-CH9C_hoL.js +0 -1
- package/dist/chunks/completionCache-BQgiR45Q.js +0 -1
- package/dist/chunks/context-noninteractive-DCYvLxWx.js +0 -1
- package/dist/chunks/conversation-DYUVAAQt.js +0 -1
- package/dist/chunks/conversation-NrAy2em3.js +0 -1
- package/dist/chunks/createSession-Czx7_nf6.js +0 -1
- package/dist/chunks/cron-g_P3I5uT.js +0 -1
- package/dist/chunks/datadog-QSR9B7CZ.js +0 -1
- package/dist/chunks/desktop-BN9pHpK_.js +0 -1
- package/dist/chunks/earlyInput-D3OhUZ4G.js +0 -1
- package/dist/chunks/entry-CJlJ47nP.js +0 -14
- package/dist/chunks/envLessBridgeConfig-DSJqg3Ox.js +0 -1
- package/dist/chunks/exit-DxY3yJrp.js +0 -1
- package/dist/chunks/extra-usage-DaxUQk9I.js +0 -1
- package/dist/chunks/extractMemories-B3cTWsph.js +0 -1
- package/dist/chunks/fast-CHiQGMBE.js +0 -1
- package/dist/chunks/gates-DvjyKZVA.js +0 -1
- package/dist/chunks/hooks-DOej0jqp.js +0 -1
- package/dist/chunks/inboundAttachments-BBYxcnvj.js +0 -1
- package/dist/chunks/initReplBridge-Dt2aQBia.js +0 -1
- package/dist/chunks/language-BoKr5ylY.js +0 -1
- package/dist/chunks/loadAgentsDir-whRB0phu.js +0 -1
- package/dist/chunks/loadPluginHooks-CYZjzxyO.js +0 -1
- package/dist/chunks/localSearch-DAwFmV2Y.js +0 -1
- package/dist/chunks/login-DOyB64Rv.js +0 -1
- package/dist/chunks/logout-DTPo3Myl.js +0 -1
- package/dist/chunks/mcp-CVnFM6nR.js +0 -6
- package/dist/chunks/mcp-CzfQB8BT.js +0 -1
- package/dist/chunks/memory-BdUqEKio.js +0 -1
- package/dist/chunks/model-BOc_-7m0.js +0 -1
- package/dist/chunks/plugin-8apy_RBT.js +0 -1
- package/dist/chunks/pluginStartupCheck-EjLvCXru.js +0 -1
- package/dist/chunks/policyLimits-Cdp3QwZ1.js +0 -1
- package/dist/chunks/poorMode-DzEL0cu0.js +0 -1
- package/dist/chunks/processSlashCommand-v1Rvzxwn.js +0 -6
- package/dist/chunks/prompt-DPqKtC0b.js +0 -1
- package/dist/chunks/prompt-WjMHPk90.js +0 -1
- package/dist/chunks/registry-CBqb7wbi.js +0 -1
- package/dist/chunks/sandbox-adapter-DqTuhgud.js +0 -1
- package/dist/chunks/searchExtraTools-Brae4wmG.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BXsK8Dwf.js +0 -1
- package/dist/chunks/sessionMemory-Bv-AYifm.js +0 -1
- package/dist/chunks/sessionMemoryUtils-D-bzdsAT.js +0 -1
- package/dist/chunks/sessionObserver-j8D9hidw.js +0 -1
- package/dist/chunks/sessionStorage-Cw5ibYWA.js +0 -1
- package/dist/chunks/setup-CDxkPTCq.js +0 -2
- package/dist/chunks/sink-DFWgcGHX.js +0 -1
- package/dist/chunks/sinks-BnkxTOU9.js +0 -1
- package/dist/chunks/skillChangeDetector-DwAvG835.js +0 -1
- package/dist/chunks/skillLearning-BI2YDG3K.js +0 -1
- package/dist/chunks/skillLearning-BZMJRJPp.js +0 -1
- package/dist/chunks/startupProfiler-WtUzkMKV.js +0 -1
- package/dist/chunks/status-nte1Arzy.js +0 -1
- package/dist/chunks/tasks-CEs-pxkC.js +0 -1
- package/dist/chunks/teamHelpers-D4vCj2hP.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BDJ1JTcl.js +0 -1
- package/dist/chunks/teleport-RxTr4aCi.js +0 -1
- package/dist/chunks/thinkback-DRJBz3Is.js +0 -1
- package/dist/chunks/toolPool-0zCdXfEu.js +0 -1
- package/dist/chunks/undercover-DYa00dVv.js +0 -1
- package/dist/chunks/upgrade-BHj8ALep.js +0 -1
- package/dist/chunks/useKeybinding-DPOUuymz.js +0 -1
- package/dist/chunks/useMainLoopModel-D3tJJC3y.js +0 -1
- package/dist/chunks/useTerminalSize-Du-EamDN.js +0 -1
- package/dist/chunks/utils-Cr-x1Oyd.js +0 -1
- package/dist/chunks/voiceModeEnabled-DK6u8Aaj.js +0 -1
- package/dist/chunks/voiceStreamSTT-CCkOfmdI.js +0 -1
- package/dist/chunks/worktree-DPpgPLLG.js +0 -1
- /package/dist/chunks/{InProcessTransport-B9II3BiO.js → InProcessTransport-DW2ed2Hs.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/{ccshareResume-DKwcd0Vc.js → ccshareResume-DPP1blaU.js} +0 -0
- /package/dist/chunks/{chromeNativeHost-BldB1Zzi.js → chromeNativeHost-DfYuJafI.js} +0 -0
- /package/dist/chunks/{claudeDesktop-BqTW_pbB.js → claudeDesktop-CEQCLZmG.js} +0 -0
- /package/dist/chunks/{cleanup-rCLlo4w8.js → cleanup-DUVwlFl7.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/{eventLoopStallDetector-bYy0fesH.js → eventLoopStallDetector-MNrFR4OH.js} +0 -0
- /package/dist/chunks/{files-Bdr_PQyV.js → files-BGuNpYgH.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/{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/{postCommitAttribution-D8MoHFoz.js → postCommitAttribution-Br4g4R6h.js} +0 -0
- /package/dist/chunks/{projectContext-Dn7umMp6.js → projectContext-2Z2w8AI8.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/{sdkHeapDumpMonitor-DLMMNeqo.js → sdkHeapDumpMonitor-DTHI5WbD.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/{sessionDataUploader-CsNePsOb.js → sessionDataUploader-BgmJTXQr.js} +0 -0
- /package/dist/chunks/{sessionManager-BOmgJd1l.js → sessionManager-mesT4zIQ.js} +0 -0
- /package/dist/chunks/{stickers-DDAm--86.js → stickers-B0P4weWp.js} +0 -0
- /package/dist/chunks/{udsClient-CBF_cZFW.js → udsClient-B85rNglp.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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-CbskW5G9.js";import{Ar as a,Fr as o,Ob as s,Tb as c,vi as l}from"./loadAgentsDir-C_wFhytF.js";async function u(e,n,i){if(r())return e(`Cannot set color: This session is a swarm teammate. Teammate colors are assigned by the team leader.`,{display:`system`}),null;if(!i||i.trim()===``)return e(`Please provide a color. Available colors: ${c.join(`, `)}, default`,{display:`system`}),null;let o=i.trim().toLowerCase();return d.includes(o)?(await l(t(),`default`,a()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:void 0}})),e(`Session color reset to default`,{display:`system`}),null):c.includes(o)?(await l(t(),o,a()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:o}})),e(`Session color set to: ${o}`,{display:`system`}),null):(e(`Invalid color "${o}". Available colors: ${c.join(`, `)}, default`,{display:`system`}),null)}var d;e((()=>{n(),s(),o(),i(),d=[`default`,`reset`,`none`,`gray`,`grey`]}))();export{u as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Gi as e,Zi as t,na as n}from"./loadAgentsDir-C_wFhytF.js";n();export{e as clearCommandsCache,t as getCommands};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,l as t}from"./commitAttribution-iKd8bTOI.js";t();export{e as isInternalModelRepo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./completionCache-C7hDqIDL.js";t();export{e as regenerateCompletionCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./context-noninteractive-DZsSp-ES.js";t();export{n as call,e as collectContextData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Ct as n,Jn as r,Xn as i,Z as a,cn as o,gn as ee,ot as s,qn as c,yn as l}from"./state-sIHsFpDu.js";import{n as u,r as d}from"./analytics-DqMQntaB.js";import{o as f,s as p}from"./log-DSV4Ht5l.js";import{$t as m,Ab as h,Ai as g,Cn as _,Di as v,Fn as y,Fr as b,GE as x,In as S,Mu as C,Nn as w,Nu as T,Ot as E,RE as D,Tt as O,_d as k,_r as A,by as j,ey as M,gi as N,jb as P,lv as F,mh as I,mn as L,ph as R,py as z,qE as B,sr as V,ty as H,uv as U,vd as W,zE as G}from"./loadAgentsDir-C_wFhytF.js";import{C as K,y as q}from"./rcDebugLog-C42A0pX1.js";import{l as J,r as Y}from"./commitAttribution-iKd8bTOI.js";import{n as X,t as Z}from"./caches-BumkMuGA.js";import{randomUUID as Q}from"crypto";function $(){let e=k();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:Q()};e.writeSdkMessages([t])}async function te({setMessages:t,readFileState:o,discoveredSkillNames:u,loadedNestedMemoryPaths:f,getAppState:h,setAppState:_,setConversationId:S}){let C=L();await m(`clear`,{getAppState:h,setAppState:_,signal:AbortSignal.timeout(C),timeoutMs:C});let E=a();E&&d(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:E});let k=new Set,j=[],M=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(h)for(let e of Object.values(h().tasks))M(e)||(T(e)?(k.add(e.agentId),j.push(e)):P(e)&&k.add(e.identity.agentId));t(()=>[]),$();{let{setContextBlocked:t}=(q(),e(K));t(!1)}S&&S(Q()),Z(k),c(null),r(null),i(null),l(),I(s()),o.clear(),u?.clear(),f?.clear(),_&&_(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!M(r)){t[n]=r;continue}try{r.status===`running`&&(U(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){p(e)}w(n)}return{...e,tasks:t,attribution:Y(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),z(),V(),ee({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=n()),await N();for(let e of j)e.status===`running`&&y(e.id,A(x(e.agentId)));{let{saveMode:t}=(b(),e(g)),{isCoordinatorMode:n}=(G(),e(D));t(n()?`coordinator`:`normal`)}let F=O();F&&v(F);let R=await H(`clear`);R.length>0&&t(()=>R)}var ne=t((()=>{W(),o(),u(),h(),C(),F(),B(),J(),_(),f(),j(),R(),M(),b(),S(),E(),X()}));export{ne as n,te as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./conversation-DYUVAAQt.js";e();export{t as clearConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r}from"./createSession-WkBw7wdn.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";function t(e,t){let{min:n,max:r}=t,i=new Set;for(let t of e.split(`,`)){let e=t.match(/^\*(?:\/(\d+))?$/);if(e){let t=e[1]?parseInt(e[1],10):1;if(t<1)return null;for(let e=n;e<=r;e+=t)i.add(e);continue}let a=t.match(/^(\d+)-(\d+)(?:\/(\d+))?$/);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10),o=a[3]?parseInt(a[3],10):1,s=n===0&&r===6;if(e>t||o<1||e<n||t>(s?7:r))return null;for(let n=e;n<=t;n+=o)i.add(s&&n===7?0:n);continue}if(t.match(/^\d+$/)){let e=parseInt(t,10);if(n===0&&r===6&&e===7&&(e=0),e<n||e>r)return null;i.add(e);continue}return null}return i.size===0?null:Array.from(i).sort((e,t)=>e-t)}function n(e){let n=e.trim().split(/\s+/);if(n.length!==5)return null;let r=[];for(let e=0;e<5;e++){let i=t(n[e],s[e]);if(!i)return null;r.push(i)}return{minute:r[0],hour:r[1],dayOfMonth:r[2],month:r[3],dayOfWeek:r[4]}}function r(e,t){let n=new Set(e.minute),r=new Set(e.hour),i=new Set(e.dayOfMonth),a=new Set(e.month),o=new Set(e.dayOfWeek),s=e.dayOfMonth.length===31,c=e.dayOfWeek.length===7,l=new Date(t.getTime());l.setSeconds(0,0),l.setMinutes(l.getMinutes()+1);for(let e=0;e<527040;e++){let e=l.getMonth()+1;if(!a.has(e)){l.setMonth(l.getMonth()+1,1),l.setHours(0,0,0,0);continue}let t=l.getDate(),u=l.getDay();if(!(s&&c||(s?o.has(u):c?i.has(t):i.has(t)||o.has(u)))){l.setDate(l.getDate()+1),l.setHours(0,0,0,0);continue}if(!r.has(l.getHours())){l.setHours(l.getHours()+1,0,0,0);continue}if(!n.has(l.getMinutes())){l.setMinutes(l.getMinutes()+1);continue}return l}return null}function i(e,t){return new Date(2e3,0,1,t,e).toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`})}function a(e,t){let n=new Date;return n.setUTCHours(t,e,0,0),n.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,timeZoneName:`short`})}function o(e,t){let n=t?.utc??!1,r=e.trim().split(/\s+/);if(r.length!==5)return e;let[o,s,l,u,d]=r,f=o.match(/^\*\/(\d+)$/);if(f&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(f[1],10);return e===1?`Every minute`:`Every ${e} minutes`}if(o.match(/^\d+$/)&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(o,10);return e===0?`Every hour`:`Every hour at :${e.toString().padStart(2,`0`)}`}let p=s.match(/^\*\/(\d+)$/);if(o.match(/^\d+$/)&&p&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(p[1],10),t=parseInt(o,10),n=t===0?``:` at :${t.toString().padStart(2,`0`)}`;return e===1?`Every hour${n}`:`Every ${e} hours${n}`}if(!o.match(/^\d+$/)||!s.match(/^\d+$/))return e;let m=parseInt(o,10),h=parseInt(s,10),g=n?a:i;if(l===`*`&&u===`*`&&d===`*`)return`Every day at ${g(m,h)}`;if(l===`*`&&u===`*`&&d.match(/^\d$/)){let e=parseInt(d,10)%7,t;if(n){let n=new Date,r=(e-n.getUTCDay()+7)%7;n.setUTCDate(n.getUTCDate()+r),n.setUTCHours(h,m,0,0),t=c[n.getDay()]}else t=c[e];if(t)return`Every ${t} at ${g(m,h)}`}return l===`*`&&u===`*`&&d===`1-5`?`Weekdays at ${g(m,h)}`:e}var s,c,l=e((()=>{s=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:6}],c=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]}));export{n as i,o as n,l as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./datadog-YsyhnDmr.js";t();export{e as shutdownDatadog};
|
|
@@ -1 +0,0 @@
|
|
|
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"./DesktopHandoff-BQwx7qWA.js";async function a(e){return(0,o.jsx)(i,{onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./earlyInput-CFYRGxau.js";export{e as startCapturingEarlyInput};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as ee,kt as v,nn as y,un as b,vt as te,wn as x}from"./schemas-BGAvj1T4.js";import{t as ne}from"./v4-f1i_CNUT.js";import{Tt as re,cn as ie,jr as S,lr as C}from"./state-sIHsFpDu.js";import{Dr as ae,Pr as oe,no as se,oc as ce,oo as le,yc as ue}from"./paths-Ci1iwL5Y.js";import{l as de,p as fe}from"./sessionStoragePortable-CJUZrbIq.js";import{$u as pe,Ep as me,Fr as he,G as ge,Hf as _e,K as ve,Qu as ye,Sr as be,Ta as xe,Tp as Se,Vf as Ce,Xv as we,Yv as Te,Zi as Ee,bD as De,i as Oe,na as ke,o as Ae,wa as je,yD as Me}from"./loadAgentsDir-C_wFhytF.js";import{Qn as Ne,Zn as Pe}from"./prompt-6ZKyqv6z.js";import{o as Fe,t as Ie}from"./fileStateCache-BhVfo23e.js";import{t as Le}from"./QueryEngine-CMcQGyql.js";import*as w from"node:path";import{dirname as Re}from"node:path";import{randomUUID as ze}from"node:crypto";import{Readable as Be,Writable as Ve}from"node:stream";ne();var T={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},E={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},He=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ue=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),We=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ge=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ue)}),Ke=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),qe=_([Ge.and(x({type:b(`env_var`)})),Ke.and(x({type:b(`terminal`)})),We]),Je=x({_meta:m(p(),g()).nullish(),methodId:p()}),Ye=x({_meta:m(p(),g()).nullish()}),Xe=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ze=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),Qe=x({_meta:m(p(),g()).nullish()}),$e=x({_meta:m(p(),g()).nullish()}),et=x({amount:f(),currency:p()}),tt=x({_meta:m(p(),g()).nullish(),terminalId:p()}),nt=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),rt=_([p(),f(),f(),v(),h(p())]),it=y(_([x({content:m(p(),rt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),at=x({_meta:m(p(),g()).nullish()}),ot=p(),st=x({_meta:m(p(),g()).nullish(),elicitationId:ot}),ct=b(`object`),lt=b(`string`),ut=x({_meta:m(p(),g()).nullish()}),dt=x({_meta:m(p(),g()).nullish(),form:at.nullish(),url:ut.nullish()}),ft=x({const:p(),title:p()}),pt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),mt=x({code:_([b(-32700),b(-32600),b(-32601),b(-32602),b(-32603),b(-32800),b(-32e3),b(-32002),b(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),ht=g(),gt=g(),_t=g(),vt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),xt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),St=x({_meta:m(p(),g()).nullish()}),Ct=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),wt=x({_meta:m(p(),g()).nullish()}),Tt=x({_meta:m(p(),g()).nullish(),logout:wt.nullish()}),Et=x({_meta:m(p(),g()).nullish()}),Dt=x({_meta:m(p(),g()).nullish()}),Ot=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),kt=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),At=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),jt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(pt),name:p()}),D=_([kt.and(x({type:b(`http`)})),At.and(x({type:b(`sse`)})),jt]),O=p(),Mt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:O,name:p()}),Nt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Pt=x({_meta:m(p(),g()).nullish()}),Ft=x({_meta:m(p(),g()).nullish()}),It=x({_meta:m(p(),g()).nullish()}),Lt=x({_meta:m(p(),g()).nullish()}),Rt=x({_meta:m(p(),g()).nullish()}),zt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=x({diff:p(),uri:p()}),Vt=x({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({languageId:p(),text:p(),uri:p()}),Gt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),qt=x({excerpts:h(Vt),uri:p()}),Jt=x({_meta:m(p(),g()).nullish()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({name:p(),owner:p(),remoteUrl:p()}),Zt=x({_meta:m(p(),g()).nullish()}),Qt=x({_meta:m(p(),g()).nullish(),jump:Ht.nullish(),rename:Yt.nullish(),searchAndReplace:Zt.nullish()}),$t=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),en=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),tn=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),nn=x({_meta:m(p(),g()).nullish(),diagnostics:Pt.nullish(),editHistory:zt.nullish(),openFiles:Ut.nullish(),recentFiles:Gt.nullish(),relatedSnippets:Jt.nullish(),userActions:tn.nullish()}),rn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),an=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),on=p(),sn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),cn=x({_meta:m(p(),g()).nullish(),kind:sn,name:p(),optionId:on}),ln=_([b(`high`),b(`medium`),b(`low`)]),un=_([b(`pending`),b(`in_progress`),b(`completed`)]),dn=x({_meta:m(p(),g()).nullish(),content:p(),priority:ln,status:un}),fn=x({_meta:m(p(),g()).nullish(),entries:h(dn)}),k=x({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),pn=x({id:p(),position:k,uri:p()}),mn=x({id:p(),newName:p(),position:k,uri:p()}),hn=x({action:p(),position:k,timestampMs:f(),uri:p()}),gn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),_n=x({_meta:m(p(),g()).nullish(),auth:He.optional().default({terminal:!1}),elicitation:dt.nullish(),fs:vt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Qt.nullish(),positionEncodings:h(gn).optional(),terminal:v().optional().default(!1)}),vn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),yn=f().int().gte(0).lte(65535),bn=x({_meta:m(p(),g()).nullish(),clientCapabilities:_n.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:bt.nullish(),protocolVersion:yn}),A=x({end:k,start:k}),xn=x({message:p(),range:A,severity:Nt,uri:p()}),Sn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),Cn=x({_meta:m(p(),g()).nullish(),diagnostics:h(xn).nullish(),editHistory:h(Bt).nullish(),openFiles:h(Sn).nullish(),recentFiles:h(Wt).nullish(),relatedSnippets:h(qt).nullish(),userActions:h(hn).nullish()}),wn=x({newText:p(),range:A}),Tn=_([x({cursorPosition:k.nullish(),edits:h(wn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),pn.and(x({kind:b(`jump`)})),mn.and(x({kind:b(`rename`)})),$t.and(x({kind:b(`searchAndReplace`)}))]),En=x({_meta:m(p(),g()).nullish(),content:p()}),Dn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var On=x({requestId:j}),kn=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(kn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),An=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),jn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),Mn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Nn=x({_meta:m(p(),g()).nullish(),optionId:on}),Pn=_([x({outcome:b(`cancelled`)}),Nn.and(x({outcome:b(`selected`)}))]),Fn=x({_meta:m(p(),g()).nullish(),outcome:Pn}),In=x({_meta:m(p(),g()).nullish()}),Ln=x({_meta:m(p(),g()).nullish()}),Rn=x({currentValue:v()}),zn=p(),Bn=p(),Vn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),N=p(),Hn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:N}),Un=x({_meta:m(p(),g()).nullish(),group:zn,name:p(),options:h(Hn)}),P=y(_([x({currentValue:N,options:_([h(Hn),h(Un)])}).and(x({type:b(`select`)})),Rn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Vn.nullish(),description:p().nullish(),id:Bn,name:p()})),Wn=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Gn=x({_meta:m(p(),g()).nullish()}),F=p(),Kn=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:F}),qn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Jn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Yn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Xn=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(pt).optional(),outputByteLimit:f().nullish(),sessionId:F}),Zn=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),Qn=x({_meta:m(p(),g()).nullish(),position:k,sessionId:F,uri:p(),version:f(),visibleRange:A}),$n=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:F,text:p(),uri:p(),version:f()}),er=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),tr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),nr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),rr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:F}),ir=x({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:F}),ar=x({_meta:m(p(),g()).nullish(),id:p(),reason:Kt.nullish(),sessionId:F}),or=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),sr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),cr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:F,title:p().nullish(),updatedAt:p().nullish()}),lr=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=x({_meta:m(p(),g()).nullish()}),I=p(),fr=x({_meta:m(p(),g()).nullish(),currentModeId:I}),pr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:I,name:p()}),L=x({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:I}),R=x({_meta:m(p(),g()).nullish(),availableModels:h(Mt),currentModelId:O}),mr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),hr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),gr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),_r=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),vr=x({_meta:m(p(),g()).nullish()}),yr=x({_meta:m(p(),g()).nullish(),additionalDirectories:In.nullish(),close:Ln.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=y(_([x({type:b(`boolean`),value:v()}),x({value:N})]),x({_meta:m(p(),g()).nullish(),configId:Bn,sessionId:F})),xr=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Sr=x({_meta:m(p(),g()).nullish(),modeId:I,sessionId:F}),Cr=x({_meta:m(p(),g()).nullish()}),wr=x({_meta:m(p(),g()).nullish(),modelId:O,sessionId:F}),Tr=x({_meta:m(p(),g()).nullish()}),Er=x({_meta:m(p(),g()).nullish(),sessionId:F}),Dr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Or=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),kr=x({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:Or.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(ft).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=x({_meta:m(p(),g()).nullish(),context:Cn.nullish(),position:k,selection:A.nullish(),sessionId:F,triggerKind:en,uri:p(),version:f()}),jr=x({_meta:m(p(),g()).nullish(),suggestions:h(Tn)}),Mr=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Pr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),Fr=x({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:v()}),Ir=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Lr=x({range:A.nullish(),text:p()}),Rr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:F,uri:p(),version:f()});x({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,ht]).nullish()});var zr=_([b(`full`),b(`incremental`)]),Br=x({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=x({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Ft.nullish(),didFocus:It.nullish(),didOpen:Lt.nullish(),didSave:Rt.nullish()}),Hr=x({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=x({_meta:m(p(),g()).nullish(),context:nn.nullish(),events:Hr.nullish()}),Wr=x({_meta:m(p(),g()).nullish(),auth:Tt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Ot.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:gn.nullish(),promptCapabilities:vn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=x({_meta:m(p(),g()).nullish(),agentCapabilities:Wr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:bt.nullish(),authMethods:h(qe).optional().default([]),protocolVersion:yn}),Kr=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Xe]),qr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:Kr}),z=_([Ir.and(x({type:b(`text`)})),jn.and(x({type:b(`image`)})),An.and(x({type:b(`audio`)})),Mn.and(x({type:b(`resource_link`)})),qr.and(x({type:b(`resource`)}))]),Jr=x({_meta:m(p(),g()).nullish(),content:z}),B=x({_meta:m(p(),g()).nullish(),content:z,messageId:p().nullish()}),Yr=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(z),sessionId:F}),Xr=x({anyOf:h(ft)}),Zr=_([Jr.and(x({type:b(`content`)})),nt.and(x({type:b(`diff`)})),Mr.and(x({type:b(`terminal`)}))]),V=p(),Qr=x({sessionId:F,toolCallId:V.nullish()}),$r=y(_([Qr,On]),x({elicitationId:ot,url:p().url()})),ei=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),ni=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),ri=x({_meta:m(p(),g()).nullish(),content:h(Zr).optional(),kind:ni.optional(),locations:h(ei).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.optional(),title:p(),toolCallId:V}),ii=x({_meta:m(p(),g()).nullish(),content:h(Zr).nullish(),kind:ni.nullish(),locations:h(ei).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.nullish(),title:p().nullish(),toolCallId:V}),ai=x({_meta:m(p(),g()).nullish(),options:h(cn),sessionId:F,toolCall:ii}),oi=x({_meta:m(p(),g()).nullish(),hint:p()}),si=x({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=x({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([x({enum:h(p()),type:lt}),Xr]),ui=x({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(x({type:b(`string`)})),an.and(x({type:b(`number`)})),xt.and(x({type:b(`integer`)})),Ze.and(x({type:b(`boolean`)})),ui.and(x({type:b(`array`)}))]),fi=x({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ct.optional().default(`object`)}),pi=y(_([y(_([Qr,On]),x({requestedSchema:fi})).and(x({mode:b(`form`)})),$r.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),mi=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([Gr,Ye,Dt,gr,hr,lr,mr,_r,$e,Cr,xr,x({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Qe,_t])}),x({error:mt,id:j})]);var hi=x({_meta:m(p(),g()).nullish(),cost:et.nullish(),size:f(),used:f()}),gi=_([B.and(x({sessionUpdate:b(`user_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_thought_chunk`)})),ri.and(x({sessionUpdate:b(`tool_call`)})),ii.and(x({sessionUpdate:b(`tool_call_update`)})),fn.and(x({sessionUpdate:b(`plan`)})),ci.and(x({sessionUpdate:b(`available_commands_update`)})),fr.and(x({sessionUpdate:b(`current_mode_update`)})),Wn.and(x({sessionUpdate:b(`config_option_update`)})),ur.and(x({sessionUpdate:b(`session_info_update`)})),hi.and(x({sessionUpdate:b(`usage_update`)}))]),_i=x({_meta:m(p(),g()).nullish(),sessionId:F,update:gi});x({method:p(),params:_([_i,st,ht]).nullish()});var vi=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),yi=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),bi=x({name:p(),uri:p()}),xi=x({_meta:m(p(),g()).nullish(),repository:Xt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([bn,Je,Et,rn,rr,Ct,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,gt]).nullish()});var Si=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:F});x({id:j,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,gt]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),En,Fn,tt,Fr,Dn,yi,St,it,_t])}),x({error:mt,id:j})]),e(),d(),r(),s(),i(),o();function Ci(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
2
|
-
`);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
|
|
3
|
-
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}ne();var wi,H=new WeakMap,Ti=class{constructor(e,t){l(this,H,void 0);let n=e(this);u(H,this,new ji(async(e,t)=>{switch(e){case T.initialize:{let e=bn.parse(t);return n.initialize(e)}case T.session_new:{let e=rn.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=Ct.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=tr.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=sr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Yn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=Sr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Je.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=Et.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Yr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=wr.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=br.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=xi.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Ar.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Jn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=qn.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=$n.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Rr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=Zn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=er.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Qn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Kn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=ar.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(H,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(H,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(H,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(H,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(H,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(H,this))}async unstable_createElicitation(e){return await c(H,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(H,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(H,this).sendRequest(e,t)}async extNotification(e,t){return await c(H,this).sendNotification(e,t)}get signal(){return c(H,this).signal}get closed(){return c(H,this).closed}},U=new WeakMap,W=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,U,void 0),l(this,W,void 0),this.id=e,u(U,this,n),u(W,this,r)}async currentOutput(){return await c(W,this).sendRequest(E.terminal_output,{sessionId:c(U,this),terminalId:this.id})}async waitForExit(){return await c(W,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(U,this),terminalId:this.id})}async kill(){return await c(W,this).sendRequest(E.terminal_kill,{sessionId:c(U,this),terminalId:this.id})??{}}async release(){return await c(W,this).sendRequest(E.terminal_release,{sessionId:c(U,this),terminalId:this.id})??{}}async[wi](){await this.release()}},G=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ai=new WeakMap,Y=new WeakSet,ji=class{constructor(e,t,r){a(this,Y),l(this,G,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,ki,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ai,void 0),u(Oi,this,e),u(ki,this,t),u(K,this,r),u(Ai,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Mi).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ai,this)}async sendRequest(e,t){var r,i;n(Y,this,Ri).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(G,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ri).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Mi(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Pi).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,Ni).call(this,e)}}function Ni(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(G,this).values())e.reject(t);c(G,this).clear(),c(J,this).abort(t)}async function Pi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Fi).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,Ii).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Li).call(this,e):console.error(`Invalid message`,{message:e})}async function Fi(e,t){try{return{result:await c(Oi,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function Ii(e,t){try{return await c(ki,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Li(e){let t=c(G,this).get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new Z(n,r,i))}c(G,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ri(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Ni).call(this,e)})),c(q,this)}var Z=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};ie(),de(),ue(),le(),Ne(),Fe(),De(),we(),pe(),ke(),he(),ve(),Ae();var zi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Vi(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=Bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!zi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Hi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ui=256;function Wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ui?t:t.slice(0,Ui-1)+`…`}function Gi(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Ki(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
4
|
-
`+e+(e.endsWith(`
|
|
5
|
-
`)?``:`
|
|
6
|
-
`)+t}var qi=console;function Q(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Gi(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Gi(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Gi(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Ji(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Yi(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Ki(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Ki(e.text)}:Xi(e,!1)}))}:{};case`Bash`:{let e=``,a=+!!r,o=String(t.id);if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
|
|
7
|
-
`),a=t.return_code??+!!r}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
8
|
-
`));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}:e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Yi(i??``,r)}}function Yi(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Xi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Xi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
|
|
9
|
-
`)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function Zi(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Qi(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1;try{for(;!r.aborted;){let s=await Zi(t,r);if(s.done||r.aborted)break;let m=s.value;if(m==null)continue;let h=m;switch(h.type){case`system`:h.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
|
-
|
|
11
|
-
Compacting completed.`}}}));break;case`result`:{let t=h.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=h.modelUsage;if(i&&d){let e=ia(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=h.total_cost_usd;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:a,size:f,cost:o==null?void 0:{amount:o,currency:`USD`}}});let s=h.subtype,p=h.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:h.stop_reason===`max_tokens`&&(c=`max_tokens`),p&&(c=`end_turn`);break;case`error_during_execution`:c=h.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=ea(h,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=h.message,r=h.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s=$i(h,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=h.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
|
-
|
|
13
|
-
Compacting completed.`}}});break;default:qi.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}function $i(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:$(s,`assistant`,t,n,r,void 0,i)}function ea(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`content_block_delta`:{let o=a.delta;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function $(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:a={sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:i.thinking??``}};break;case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:ta(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,rawInput:e,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=Ji(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function ta(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function na(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){qi.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=$(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a});for(let e of t)await n.sessionUpdate(e)}}}function ra(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function ia(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=ra(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function aa(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=sa(r);if(n.name===`ExitPlanMode`)return oa(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await ge(n,s,c,l,u);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:u}}let p=Q({name:n.name,id:u,input:s},f,i),m={toolCallId:u,title:p.title,kind:p.kind,status:`pending`,rawInput:s},h=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`}];try{let n=await e.requestPermission({sessionId:t,toolCall:m,options:h});if(n.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`}};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:s}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function oa(e,t,n,r,i,a,o,s){let c=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&c.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let l=Q({name:`ExitPlanMode`,id:n,input:r},i,a),u={toolCallId:n,title:l.title,kind:l.kind,status:`pending`,rawInput:r},d=await e.requestPermission({sessionId:t,toolCall:u,options:c});if(d.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(d.outcome.outcome===`selected`&&`optionId`in d.outcome&&d.outcome.optionId!==void 0){let n=d.outcome.optionId;if(c.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function sa(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}function ca(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(la(n,r))}else if(e.type===`resource`){let n=e.resource;n&&typeof n.text==`string`&&t.push(n.text)}}return t.filter(e=>e.length>0).join(`
|
|
14
|
-
`)}function la(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}Se(),oe(),_e(),e();var ua=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await me({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Wi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=ca(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=ze();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),S(e.sessionId,re());let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Qi(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=Sa(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async setSessionConfigOption(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){ce();let n=t.sessionId??ze(),r=e.cwd;S(n,re()),C(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=Pe(),a=ye(i),o=e._meta,s=ga(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=pa(c,s,l),d=aa(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=_a(l),p={...Me(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([Ee(r),Oe(r)]);p.agentDefinitions=h;let g=new Le({cwd:r,tools:a,commands:m,mcpClients:[],agents:h.activeAgents,canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Ie(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:u,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},ee=Ce(),v=ae(),y={availableModels:ee.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};g.setModel(v);let b=wa(_,y),te={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Hi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,models:y,modes:_,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Hi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return S(e.sessionId,n?Re(n.filePath):null),C(e.cwd),await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions}}await this.teardownSession(e.sessionId)}let n=await fe(e.sessionId,e.cwd),r=n?Re(n.filePath):null;S(e.sessionId,r),C(e.cwd);let i;if(n)try{let t=await be(e.sessionId);t&&t.messages.length>0&&(i=Te(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let a=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:i});if(i&&i.length>0){let t=this.sessions.get(e.sessionId);t&&await na(e.sessionId,i,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:a.sessionId,modes:a.modes,models:a.models,configOptions:a.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async replaySessionHistory(e){try{let t=await be(e.sessionId);if(!t||t.messages.length===0)return;let n=Te(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await na(e.sessionId,n,this.conn,r.toolUseCache,this.clientCapabilities,r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}applySessionMode(e,t){if(!fa(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}getSetting(e){let t=se();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},da=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function fa(e){return da.includes(e)}function pa(e,t,n){if(t){let t=ma(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!_a(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return ha(n)??`default`}function ma(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Vi(e,t)}function ha(e){if(e!=null)try{return Vi(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function ga(e,t){return!!e&&Object.hasOwn(e,t)}function _a(e){return va()&&(ya()||ba(e))}function va(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function ya(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||xa(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ba(e){try{return Vi(e)===`bypassPermissions`}catch{return!1}}function xa(e){return e===`1`||e?.toLowerCase()===`true`}function Sa(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),Ca(e),n}Ca(e)}function Ca(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}function wa(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}ue(),xe();function Ta(e,t){let n=Be.toWeb(e);return Ci(Ve.toWeb(t),n)}async function Ea(){ce(),je();let e=Ta(process.stdin,process.stdout),t,n=new Ti(e=>(t=new ua(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{Ea as runAcpAgent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t}from"./envLessBridgeConfig-C9UUbQCo.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -1 +0,0 @@
|
|
|
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-Ci1iwL5Y.js";import{Ot as a,SE as o,Sd as s,Tt as c,wE as l,xd as u}from"./loadAgentsDir-C_wFhytF.js";import{n as d,t as f}from"./ExitFlow-DKusdm_v.js";import{spawnSync as p}from"child_process";function m(){return i(_)??`Goodbye!`}async function h(e){if(s())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=c()!==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 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./extra-usage-XJxfHsbe.js";e();export{t as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{iu as e,nu as t,ru as n,tu as r}from"./loadAgentsDir-C_wFhytF.js";e();export{r as drainPendingExtraction,t as executeExtractMemories,n as initExtractMemories};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./fast-CpN8lLnE.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./gates-C4JvRq4i.js";e();export{t as getChicagoEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Cn as t,Sn as n,mn as r}from"./loadAgentsDir-C_wFhytF.js";t();export{e as executeSessionEndHooks,r as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./inboundAttachments-60kD5Qt_.js";export{e as resolveAndPrepend};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,cn as a,ot as o}from"./state-sIHsFpDu.js";import{Cc as s,Jt as c,Pt as l,S as u,dc as d,la as f,nn as p,on as m,ua as h,v as g,yc as _}from"./paths-Ci1iwL5Y.js";import{Q as v,U as y,Z as b,l as x,p as S,z as C}from"./debug-otxXY3j-.js";import{n as ee,r as w}from"./analytics-DqMQntaB.js";import{F as T,P as E,i as te,m as ne,v as D}from"./git-C0IuvuIy.js";import{g as O,m as k}from"./log-DSV4Ht5l.js";import{n as A,t as j}from"./sleep-C6koP5Ka.js";import{Aa as re,Cy as ie,Fa as ae,Fr as M,Ia as N,Ka as oe,La as P,Ma as se,Mo as F,Na as I,Oa as ce,Pa as le,Po as L,Qa as R,Ra as z,Sy as ue,Td as de,Uo as fe,Wa as pe,br as B,ja as me,ka as he,qo as V,xd as ge}from"./loadAgentsDir-C_wFhytF.js";import{O as H,_ as _e,d as U,k as ve,n as ye,t as W}from"./rcDebugLog-C42A0pX1.js";import{a as G,c as K,d as be,f as xe,o as q,r as Se,s as J,u as Y}from"./debugUtils-l8nsUZ6R.js";import{a as Ce,i as we}from"./trustedDevice-C5s2au0k.js";import{a as X,i as Te,n as Z,o as Q,t as $}from"./bridgeConfig-pjDV5Z2l.js";import{a as Ee,o as De,r as Oe,s as ke,t as Ae}from"./bridgeEnabled-D9jI6X-w.js";import{i as je,t as Me}from"./assistant-BULedprW.js";import{t as Ne}from"./capacityWake-DtmDHwEt.js";import{n as Pe,t as Fe}from"./pollConfig-_2W7bHoW.js";import{a as Ie,n as Le,r as Re,t as ze}from"./workSecret-DJu7k30X.js";import{a as Be,i as Ve,n as He,t as Ue}from"./createSession-WkBw7wdn.js";import{i as We,n as Ge}from"./envLessBridgeConfig-C9UUbQCo.js";import{n as Ke,o as qe}from"./mappers-Dxs_kNJH.js";import{n as Je,r as Ye,t as Xe}from"./sessionTitle-DEKvIVCK.js";import{a as Ze,i as Qe,n as $e,o as et,r as tt,t as nt}from"./bridgeMessaging-DN0X35NX.js";import{t as rt}from"./HybridTransport-CP0RopXu.js";import{n as it,r as at,t as ot}from"./flushGate-DNutWuOE.js";import{hostname as st}from"os";import{randomUUID as ct}from"crypto";a(),k(),D(),_(),h(),m(),u(),X(),ie(),Oe(),fe(),pe(),M(),Ve(),We(),Ke(),Ye(),ae(),x(),W(),E(),ee(),b(),K(),ge(),Ce(),H(),U(),n(),q(),y(),j(),he();var lt=2e3,ut=6e4,dt=900*1e3,ft=0;async function pt(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:l,workerType:u,getAccessToken:d,createSession:f,archiveSession:p,getCurrentTitle:m=()=>s,toSDKMessages:h=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:g,getPollIntervalConfig:_=()=>Pe,initialHistoryCap:y=200,initialMessages:b,previouslyFlushedUUIDs:x,onInboundMessage:ee,onPermissionResponse:E,onInterrupt:te,onSetModel:ne,onSetMaxThinkingTokens:D,onSetPermissionMode:O,onStateChange:k,onUserMessage:A,perpetual:j,initialSSESequenceNum:ie=0}=e,ae=++ft,{writeBridgePointer:M,clearBridgePointer:N,readBridgePointer:oe}=await import(`./bridgePointer-Clcvh52n.js`),P=j?await oe(n):null,F=P?.source===`repl`?P:null;S(`[bridge:repl] initBridgeCore #${ae} starting (initialMessages=${b?.length??0}${F?` perpetual prior=env:${F.environmentId}`:``})`);let I=le({baseUrl:c,getAccessToken:d,runnerVersion:`2.7.1`,onDebug:S,onAuth401:g,getTrustedDeviceToken:we}),L=process.env.USER_TYPE===`ant`?se(I):I,R={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:ct(),workerType:u,environmentId:ct(),reuseEnvironmentId:F?.environmentId,apiBaseUrl:c,sessionIngressUrl:l},z,ue;try{let e=await L.registerBridgeEnvironment(R);z=e.environment_id,ue=e.environment_secret}catch(e){return J(`registration_failed`,`[bridge:repl] Environment registration failed: ${C(e)}`),F&&await N(n),k?.(`failed`,C(e)),null}S(`[bridge:repl] Environment registered: ${z}`),T(`info`,`bridge_repl_env_registered`),w(`tengu_bridge_repl_env_registered`,{});async function fe(e,t){if(z!==e)return S(`[bridge:repl] Env mismatch (requested ${e}, got ${z}) — cannot reconnect in place`),!1;let n=xe(t),r=n===t?[t]:[t,n];for(let e of r)try{return await L.reconnectSession(z,e),S(`[bridge:repl] Reconnected session ${e} in place on env ${z}`),!0}catch(t){S(`[bridge:repl] reconnectSession(${e}) failed: ${C(t)}`)}return S(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let pe=F?await fe(F.environmentId,F.sessionId):!1;F&&!pe&&await N(n);let B;if(pe&&F){if(B=F.sessionId,S(`[bridge:repl] Perpetual session reused: ${B}`),b&&x)for(let e of b)x.add(e.uuid)}else{let e=await f({environmentId:z,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return S(`[bridge:repl] Session creation failed, deregistering environment`),w(`tengu_bridge_repl_session_failed`,{}),await L.deregisterEnvironment(z).catch(()=>{}),k?.(`failed`,`Session creation failed`),null;B=e,S(`[bridge:repl] Session created: ${B}`)}await M(n,{sessionId:B,environmentId:z,source:`repl`}),T(`info`,`bridge_repl_session_created`),w(`tengu_bridge_repl_started`,{has_initial_messages:!!(b&&b.length>0),inProtectedNamespace:t()});let he=new Set;if(b)for(let e of b)he.add(e.uuid);let V=new nt(2e3);for(let e of he)V.add(e);let ge=new nt(2e3),H=new AbortController,U=null;_e(e=>{H.signal.aborted||U?.reportMetadata(e)},{replayCurrent:!0});let W=0,G=pe?ie:0,K=null,q=null,Se=Ne(H.signal),Y=Se.wake,Ce=Se.signal,X=new ot,Te=!A,Z=0,Q=null;async function $(){if(Q)return Q;Q=Ee();try{return await Q}finally{Q=null}}async function Ee(){if(Z++,ye(`doReconnect: attempt=${Z}/3 envId=${z} sessionId=${B} workId=${K}`),W++,S(`[bridge:repl] Reconnecting after env lost (attempt ${Z}/3)`),Z>3)return S(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}if(Y(),X.drop(),K){let e=K;if(await L.stopWork(z,e,!1).catch(()=>{}),K!==e)return S(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Z=0,!0;K=null,q=null}if(H.signal.aborted)return S(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=z;R.reuseEnvironmentId=e;try{let e=await L.registerBridgeEnvironment(R);z=e.environment_id,ue=e.environment_secret}catch(e){return R.reuseEnvironmentId=void 0,S(`[bridge:repl] Environment re-registration failed: ${C(e)}`),!1}if(R.reuseEnvironmentId=void 0,S(`[bridge:repl] Re-registered: requested=${e} got=${z}`),H.signal.aborted)return S(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await L.deregisterEnvironment(z).catch(()=>{}),!1;if(U!==null)return S(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Z=0,!0;if(await fe(e,B))return w(`tengu_bridge_repl_reconnected_in_place`,{}),Z=0,!0;if(z!==e&&w(`tengu_bridge_repl_env_expired_fresh_session`,{}),await p(B),H.signal.aborted)return S(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await L.deregisterEnvironment(z).catch(()=>{}),!1;let t=m(),r=await f({environmentId:z,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?H.signal.aborted?(S(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await p(r),!1):(B=r,de(be(r)).catch(()=>{}),G=0,ge.clear(),Te=!A,S(`[bridge:repl] Re-created session: ${B}`),await M(n,{sessionId:B,environmentId:z,source:`repl`}),x?.clear(),Z=0,!0):(S(`[bridge:repl] Session creation failed during reconnection`),!1)}function De(){return d()}function Oe(){let e=X.end();if(e.length===0)return;if(!U){S(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)V.add(t.uuid);let t=h(e).map(e=>({...e,session_id:B}));S(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),U.writeBatch(t)}let ke=null;function Ae(){ke?.()}function je(e){if(ye(`handleTransportPermanentClose: code=${e} transport=${U?`exists`:`null`} pollAborted=${H.signal.aborted}`),S(`[bridge:repl] Transport permanently closed: code=${e}`),w(`tengu_bridge_repl_ws_closed`,{code:e}),U){let e=U.getLastSequenceNum();e>G&&(G=e),U=null}Y();let t=X.drop();if(t>0&&S(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){k?.(`failed`,`session ended`),H.abort(),Ae();return}k?.(`reconnecting`,`Remote Control connection lost (code ${e})`),S(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),$().then(t=>{t||H.signal.aborted||(S(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),w(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),k?.(`failed`,`reconnection failed`),Ae())})}let Me;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Me=()=>{S(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),$()},process.on(`SIGUSR2`,Me));let Fe=null;process.env.USER_TYPE===`ant`&&me({fireClose:e=>{if(!Fe){S(`[bridge:debug] fireClose: no transport wired yet`);return}S(`[bridge:debug] fireClose(${e}) — injecting`),Fe(e)},forceReconnect:()=>{S(`[bridge:debug] forceReconnect — injecting`),$()},injectFault:re,wakePollLoop:Y,describe:()=>`env=${z} session=${B} transport=${U?.getStateLabel()??`null`} workId=${K??`null`}`}),mt({api:L,getCredentials:()=>({environmentId:z,environmentSecret:ue}),signal:H.signal,getPollIntervalConfig:_,onStateChange:k,getWsState:()=>U?.getStateLabel()??`null`,isAtCapacity:()=>U!==null,capacitySignal:Ce,onFatalError:Ae,getHeartbeatInfo:()=>!K||!q?null:{environmentId:z,workId:K,sessionToken:q},onHeartbeatFatal:e=>{if(S(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}X.drop(),K&&L.stopWork(z,K,!1).catch(e=>{S(`[bridge:repl] stopWork after heartbeat fatal: ${C(e)}`)}),K=null,q=null,Y(),k?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await $()?{environmentId:z,environmentSecret:ue}:null},onWorkReceived:(e,t,i,a)=>{if(U?.isConnectedStatus()&&S(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),S(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${B} match=${Ie(e,B)}`),M(n,{sessionId:B,environmentId:z,source:`repl`}),!Ie(e,B)){S(`[bridge:repl] Rejecting foreign session: expected=${B} got=${e}`);return}K=i,q=t;let o=a||r(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=De(),!s){S(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ve(s)}if(w(`tengu_bridge_repl_work_received`,{}),U){let e=U;U=null;let t=e.getLastSequenceNum();t>G&&(G=t),e.close()}X.deactivate();let u=e=>Qe(e,{transport:U,sessionId:B,onInterrupt:te,onSetModel:ne,onSetMaxThinkingTokens:D,onSetPermissionMode:O}),d=!1,f=e=>{U=e,e.setOnConnect(()=>{if(U===e){if(S(`[bridge:repl] Ingress transport connected`),w(`tengu_bridge_repl_ws_connected`,{}),!o){let e=De();e&&ve(e)}if(He=!1,!d&&b&&b.length>0){d=!0;let t=y,n=b.filter(e=>Ze(e)&&!x?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(S(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),w(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=h(r);if(i.length>0){S(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:B})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){S(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(x)for(let e of i)e.uuid&&x.add(e.uuid)}).catch(e=>S(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{U===e&&(Oe(),k?.(`connected`))})}else Oe(),k?.(`connected`)}else X.active||k?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);ye(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{ye(`ingress (non-JSON): ${String(e).slice(0,200)}`)}tt(e,V,ge,ee,E,u)}),Fe=je,e.setOnClose(t=>{U===e&&(ye(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),je(t))}),!d&&b&&b.length>0&&X.start(),e.connect()};if(W++,o){let n=ze(c,e),r=W;S(`[bridge:repl] CCR v2: sessionUrl=${n} session=${e} gen=${r}`),at({sessionUrl:n,ingressToken:t,sessionId:e,initialSequenceNum:G}).then(e=>{if(H.signal.aborted){e.close();return}if(r!==W){S(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${W}`),e.close();return}f(e)},e=>{S(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${C(e)}`,{level:`error`}),w(`tengu_bridge_repl_ccr_v2_init_failed`,{}),r===W&&(K&&(L.stopWork(z,K,!1).catch(e=>{S(`[bridge:repl] stopWork after v2 init failure: ${C(e)}`)}),K=null,q=null),Y())})}else{let t=Le(l,e);S(`[bridge:repl] Ingress URL: ${t}`),S(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;f(it(new rt(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${De()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{k?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),Y()}})))}}});let Re=j?setInterval(()=>{Q||M(n,{sessionId:B,environmentId:z,source:`repl`})},60*6e4):null;Re?.unref?.();let Be=_().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{U&&(S(`[bridge:repl] keep_alive sent`),U.write({type:`keep_alive`}).catch(e=>{S(`[bridge:repl] keep_alive write failed: ${C(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;ke=async()=>{if(He){S(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${z} session=${B}`);return}He=!0;let e=Date.now();if(S(`[bridge:repl] Teardown starting: env=${z} session=${B} workId=${K??`none`} transportState=${U?.getStateLabel()??`null`}`),Re!==null&&clearInterval(Re),Ve!==null&&clearInterval(Ve),Me&&process.off(`SIGUSR2`,Me),process.env.USER_TYPE===`ant`&&(ce(),Fe=null),H.abort(),S(`[bridge:repl] Teardown: poll loop aborted`),U){let e=U.getLastSequenceNum();e>G&&(G=e)}if(j){U=null,X.drop(),await M(n,{sessionId:B,environmentId:z,source:`repl`}),S(`[bridge:repl] Teardown (perpetual): leaving env=${z} session=${B} alive on server, duration=${Date.now()-e}ms`);return}let t=U;if(U=null,X.drop(),t){let e={...et(B),session_id:B};t.write(e)}let r=K?L.stopWork(z,K,!0).then(()=>{S(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{S(`[bridge:repl] Teardown stopWork failed: ${C(e)}`)}):Promise.resolve();await Promise.all([r,p(B)]),t?.close(),S(`[bridge:repl] Teardown: transport closed`),await L.deregisterEnvironment(z).catch(e=>{S(`[bridge:repl] Teardown deregister failed: ${C(e)}`)}),await N(n),S(`[bridge:repl] Teardown complete: env=${z} duration=${Date.now()-e}ms`)};let Ue=v(()=>ke?.());return S(`[bridge:repl] Ready: env=${z} session=${B}`),k?.(`ready`),{get bridgeSessionId(){return B},get environmentId(){return z},getSSESequenceNum(){let e=U?.getLastSequenceNum()??0;return Math.max(G,e)},sessionIngressUrl:l,writeMessages(e){let t=e.filter(e=>Ze(e)&&!he.has(e.uuid)&&!V.has(e.uuid));if(t.length===0)return;if(!Te)for(let e of t){let t=$e(e);if(t!==void 0&&A?.(t,B)){Te=!0;break}}if(X.enqueue(...t)){S(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!U){let e=t.map(e=>e.type).join(`,`);S(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${B}`,{level:`warn`});return}for(let e of t)V.add(e.uuid);S(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=h(t).map(e=>({...e,session_id:B}));U.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!V.has(e.uuid));if(t.length===0)return;if(!U){S(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${B}`,{level:`warn`});return}for(let e of t)e.uuid&&V.add(e.uuid);let n=t.map(e=>({...e,session_id:B}));U.writeBatch(n)},sendControlRequest(e){if(!U){S(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:B};U.write(t),S(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!U){S(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:B};U.write(t),S(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!U){S(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:B};U.write(t),S(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!U){S(`[bridge:repl] sendResult: skipping, transport not configured session=${B}`);return}U.reportState(`idle`);let e={...et(B),session_id:B};U.write(e),S(`[bridge:repl] Sent result for session=${B}`)},async teardown(){Ue(),await ke?.(),S(`[bridge:repl] Torn down`),w(`tengu_bridge_repl_teardown`,{})}}}async function mt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:s,capacitySignal:c,onFatalError:l,getPollIntervalConfig:u=()=>Pe,getHeartbeatInfo:d,onHeartbeatFatal:f}){S(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let p=0,m=null,h=null,g=0,_=!1;for(;!n.aborted;){let{environmentId:v,environmentSecret:y}=t(),b=u();try{let t=await e.pollForWork(v,y,n,b.reclaim_older_than_ms);if(g=0,p>0&&(S(`[bridge:repl] Poll recovered after ${p} consecutive error(s)`),p=0,m=null,h=null,r?.(`ready`)),!t){let t=_;if(_=!1,s?.()&&c&&!t){let t=b.poll_interval_ms_at_capacity;if(b.non_exclusive_heartbeat_interval_ms>0&&d){w(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:b.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&s()&&(r===null||Date.now()<r);){let t=u();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=d();if(!n)break;let r=c();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(S(`[bridge:repl:heartbeat] Failed: ${C(e)}`),e instanceof I){r.cleanup(),w(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),f?(f(e),S(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await A(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:s()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(w(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&S(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:b.non_exclusive_heartbeat_interval_ms;if(r>0){let e=c(),t=Date.now();await A(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(S(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),w(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),_=!0)}}else await A(b.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Re(t.secret)}catch(n){S(`[bridge:repl] Failed to decode work secret: ${C(n)}`),w(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(v,t.id,!1).catch(()=>{});continue}S(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(v,t.id,a.session_ingress_token)}catch(e){S(`[bridge:repl] Acknowledge failed workId=${t.id}: ${C(e)}`)}if(t.data.type===`healthcheck`){S(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{z(e,`session_id`)}catch{S(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),S(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof I&&i.status===404&&a){let e=t().environmentId;if(v!==e){S(`[bridge:repl] Stale poll error for old env=${v}, current env=${e} — skipping onEnvironmentLost`),p=0,m=null;continue}if(g++,S(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${g}/3)`),w(`tengu_bridge_repl_env_lost`,{attempt:g}),g>3){S(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),l?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){p=0,m=null,r?.(`ready`),S(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),l?.();break}if(i instanceof I){let e=N(i.errorType),t=P(i);S(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),w(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),T(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),l?.();break}let s=Date.now();h!==null&&s-h>6e4*2&&(S(`[bridge:repl] Detected system sleep (${Math.round((s-h)/1e3)}s gap), resetting poll error budget`),T(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:s-h}),p=0,m=null),h=s,p++,m===null&&(m=s);let c=s-m,f=G(i),_=Se(i),y=o?.()??`unknown`;if(S(`[bridge:repl] Poll error (attempt ${p}, elapsed ${Math.round(c/1e3)}s, ws=${y}): ${_}`),w(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:p,elapsedMs:c}),p===1&&r?.(`reconnecting`,_),c>=9e5){S(`[bridge:repl] Poll failures exceeded ${dt/1e3}s (${p} errors), giving up`),T(`info`,`bridge_repl_poll_give_up`),w(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:p,elapsedMs:c,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let b=Math.min(lt*2**(p-1),ut);if(u().non_exclusive_heartbeat_interval_ms>0){let t=d?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await A(b,n)}}S(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}x(),y(),q(),K();async function ht(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:u,onSetMaxThinkingTokens:m,onSetPermissionMode:h,onStateChange:_,initialMessages:v,getMessages:y,previouslyFlushedUUIDs:b,initialName:x,perpetual:ee,outboundOnly:w,tags:T}=t??{};if(Y(De),!await Ee())return J(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!$())return J(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),_?.(`failed`,`/login`),null;if(await R(),!oe(`allow_remote_control`))return J(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),_?.(`failed`,`disabled by your organization's policy`),null;if(!Te()){let e=d();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&c()?.expiresAt===e.bridgeOauthDeadExpiresAt)return S(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await l();let t=c();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){J(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),_?.(`failed`,`/login`);let e=t.expiresAt;return s(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let E=Z(),D=`remote-control-${ue()}`,O=!1,k=!1;if(x)D=x,O=!0,k=!0;else{let e=i(),t=e?B(e):void 0;if(t)D=t,O=!0,k=!0;else if(v&&v.length>0)for(let e=v.length-1;e>=0;e--){let t=v[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||V(t))continue;let n=F(t.message.content);if(!n)continue;let r=_t(n);if(r){D=r,O=!0;break}}}let A=0,j,re=0,ie=(e,t,n)=>{O=!0,D=e,S(`[bridge:repl] derived title from message ${n}: ${e}`),Be(t,e,{baseUrl:E,getAccessToken:$}).catch(()=>{})},ae=(e,t)=>{let n=++re,r=A;Je(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===re&&j===t&&!B(i())&&ie(e,t,r)})},M=(e,t)=>{if(k||B(i()))return!0;if(j!==void 0&&j!==t&&(A=0),j=t,A++,A===1&&!O){let n=_t(e);n&&ie(n,t,A),ae(e,t)}else if(A===3){let n=y?.();ae(n?Xe(L(n)):e,t)}return A>=3},N=g(`tengu_bridge_initial_history_cap`,200,300*1e3),P=Q()?`self-hosted`:await f();if(!P)return J(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),_?.(`failed`,`/login`),null;if(ke()&&!ee){let e=await Ge();if(e)return J(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),_?.(`failed`,"run `claude update` to upgrade"),null;S(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-Dte7ZUAN.js`);return t({baseUrl:E,orgUUID:P,title:D,getAccessToken:$,onAuth401:p,toSDKMessages:qe,initialHistoryCap:N,initialMessages:v,onInboundMessage:n,onUserMessage:M,onPermissionResponse:r,onInterrupt:a,onSetModel:u,onSetMaxThinkingTokens:m,onSetPermissionMode:h,onStateChange:_,outboundOnly:w,tags:T})}let se=Ae();if(se)return J(`version_too_old`,`[bridge:repl] Skipping: ${se}`),_?.(`failed`,"run `claude update` to upgrade"),null;let I=await te(),ce=await ne(),le=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||E,z=`claude_code`;{let{isAssistantMode:t}=(je(),e(Me));t()&&(z=`claude_code_assistant`)}return pt({dir:o(),machineName:st(),branch:I,gitRepoUrl:ce,title:D,baseUrl:E,sessionIngressUrl:le,workerType:z,getAccessToken:$,createSession:e=>He({...e,events:[],baseUrl:E,getAccessToken:$}),archiveSession:e=>Ue(e,{baseUrl:E,getAccessToken:$,timeoutMs:1500}).catch(e=>{S(`[bridge:repl] archiveBridgeSession threw: ${C(e)}`,{level:`error`})}),getCurrentTitle:()=>B(i())??D,onUserMessage:M,toSDKMessages:qe,onAuth401:p,getPollIntervalConfig:Fe,initialHistoryCap:N,initialMessages:v,previouslyFlushedUUIDs:b,onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:u,onSetMaxThinkingTokens:m,onSetPermissionMode:h,onStateChange:_,perpetual:ee})}var gt=50;function _t(e){let t=O(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>gt?n.slice(0,gt-1)+`…`:n}export{ht as initReplBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./language-BYeqMX74.js";t();export{e as getResolvedLanguage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,t}from"./loadAgentsDir-C_wFhytF.js";e();export{t as clearAgentDefinitionsCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ly as e,oy as t,sy as n}from"./loadAgentsDir-C_wFhytF.js";t();export{n as loadPluginHooks,e as setupPluginHookHotReload};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,o as n,t as r}from"./localSearch-B0p0_bjP.js";n();export{r as clearSkillIndexCache,e as getSkillIndex,t as searchSkills};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./login-C1uE6Pg9.js";t();export{n as Login,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{iE as e,nE as t,rE as n,tE as r}from"./loadAgentsDir-C_wFhytF.js";n();export{r as call,t as clearAuthRelatedCaches,e as performLogout};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./p-map-D7WEmnBE.js";import{Mt as r,Rn as i,T as a,b as o,f as s,g as c,h as ee,t as l,v as te,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Sc as f,dc as p,lc as m,yc as h}from"./paths-Ci1iwL5Y.js";import{K as g,U as _}from"./debug-otxXY3j-.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{n as b,o as x}from"./process-DMKLUQIO.js";import{i as S,o as C}from"./platform-mh9ypxS8.js";import{s as w,u as ne}from"./types-KeqFPzY5.js";import{l as T,o as re}from"./stringUtils-KZoO4GUd.js";import{$C as ie,$x as ae,DC as oe,Dw as E,EC as D,Gw as O,Hy as k,Iw as A,Iy as j,Ly as M,Ow as N,QC as P,Rw as F,SE as I,Vw as L,Vy as R,XC as z,Yx as B,ZC as V,_w as H,cC as U,gw as W,jw as G,lC as K,rw as se,tS as ce,tw as le,wE as q,zw as ue}from"./loadAgentsDir-C_wFhytF.js";import{n as J,t as Y}from"./exit-DOBLl8jN.js";import{stat as de}from"fs/promises";import{cwd as fe}from"process";n();var X=e(i(),1);q(),b(),l(),L(),re(),oe(),k();var Z=d();function pe({servers:e,scope:t,onDone:n}){let r=Object.keys(e),[i,l]=(0,X.useState)({});(0,X.useEffect)(()=>{A().then(({servers:e})=>l(e))},[]);let d=r.filter(e=>i[e]!==void 0);async function f(n){let r=0;for(let a of n){let n=e[a];if(n){let e=a;if(i[e]!==void 0){let t=1;for(;i[`${a}_${t}`]!==void 0;)t++;e=`${a}_${t}`}await G(e,n,t),r++}}m(r)}let[p]=a(),m=(0,X.useCallback)(e=>{x(e>0?`\n${te(`success`,p)(`Successfully imported ${e} MCP ${T(e,`server`)} to ${t} config.`)}\n`:`
|
|
2
|
-
No servers were imported.`),n(),I()},[p,t,n]),h=(0,X.useCallback)(()=>{m(0)},[m]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(s,{title:`Import MCP Servers from Claude Desktop`,subtitle:`Found ${r.length} MCP ${T(r.length,`server`)} in Claude Desktop.`,color:`success`,onCancel:h,hideInputGuide:!0,children:[d.length>0&&(0,Z.jsx)(o,{color:`warning`,children:`Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix.`}),(0,Z.jsx)(o,{children:`Please select the servers you want to import:`}),(0,Z.jsx)(R,{options:r.map(e=>({label:`${e}${d.includes(e)?` (already exists)`:``}`,value:e})),defaultValue:r.filter(e=>!d.includes(e)),onSubmit:f,onCancel:h,hideIndexes:!0})]}),(0,Z.jsx)(u,{paddingX:1,children:(0,Z.jsx)(o,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(ee,{children:[(0,Z.jsx)(c,{shortcut:`Space`,action:`select`}),(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}l(),M(),v(),ie(),ce(),L(),N(),K(),h(),_(),q(),w(),C();async function Q(e,t){try{let n=await B(e,t);return n.type===`connected`?`✓ Connected`:n.type===`needs-auth`?`! Needs authentication`:`✗ Failed to connect`}catch{return`✗ Connection error`}}async function me({debug:e,verbose:t}){let n=fe();y(`tengu_mcp_start`,{});try{await de(n)}catch(e){throw g(e)&&Y(`Error: Directory ${n} does not exist`),e}try{let{setup:r}=await import(`./setup-CDxkPTCq.js`);await r(n,`default`,!1,!1,void 0,!1);let{startMCPServer:i}=await import(`./mcp-CbDDqdzF.js`);await i(n,e??!1,t??!1)}catch(e){Y(`Error: Failed to start MCP server: ${e}`)}}async function he(e,t){let n=F(e),r=()=>{n&&(n.type===`sse`||n.type===`http`)&&(V(e,n),z(e,n))};try{if(t.scope){let n=H(t.scope);y(`tengu_mcp_delete`,{name:e,scope:n}),await O(e,n),r(),process.stdout.write(`Removed MCP server ${e} from ${n} config\n`),J(`File modified: ${W(n)}`)}let n=m(),i=p(),{servers:a}=ue(`project`),o=!!a[e],s=[];if(n.mcpServers?.[e]&&s.push(`local`),o&&s.push(`project`),i.mcpServers?.[e]&&s.push(`user`),s.length===0)Y(`No MCP server found with name: "${e}"`);else if(s.length===1){let t=s[0];y(`tengu_mcp_delete`,{name:e,scope:t}),await O(e,t),r(),process.stdout.write(`Removed MCP server "${e}" from ${t} config\n`),J(`File modified: ${W(t)}`)}else process.stderr.write(`MCP server "${e}" exists in multiple scopes:\n`),s.forEach(e=>{process.stderr.write(` - ${E(e)} (${W(e)})\n`)}),process.stderr.write(`
|
|
3
|
-
To remove from a specific scope, use:
|
|
4
|
-
`),s.forEach(t=>{process.stderr.write(` claude mcp remove "${e}" -s ${t}\n`)}),Y()}catch(e){Y(e.message)}}async function ge(){y(`tengu_mcp_list`,{});let{servers:e}=await A();if(Object.keys(e).length===0)console.log("No MCP servers configured. Use `claude mcp add` to add a server.");else{console.log(`Checking MCP server health...
|
|
5
|
-
`);let n=await t(Object.entries(e),async([e,t])=>({name:e,server:t,status:await Q(e,t)}),{concurrency:ae()});for(let{name:e,server:t,status:r}of n)if(t.type===`sse`)console.log(`${e}: ${t.url} (SSE) - ${r}`);else if(t.type===`http`)console.log(`${e}: ${t.url} (HTTP) - ${r}`);else if(t.type===`claudeai-proxy`)console.log(`${e}: ${t.url} - ${r}`);else if(!t.type||t.type===`stdio`){let n=t,i=Array.isArray(n.args)?n.args:[];console.log(`${e}: ${n.command} ${i.join(` `)} - ${r}`)}}await I(0)}async function $(e){y(`tengu_mcp_get`,{name:e});let t=F(e);t||Y(`No MCP server found with name: ${e}`),console.log(`${e}:`),console.log(` Scope: ${E(t.scope)}`);let n=await Q(e,t);if(console.log(` Status: ${n}`),t.type===`sse`){if(console.log(` Type: sse`),console.log(` URL: ${t.url}`),t.headers){console.log(` Headers:`);for(let[e,n]of Object.entries(t.headers))console.log(` ${e}: ${n}`)}if(t.oauth?.clientId||t.oauth?.callbackPort){let n=[];t.oauth.clientId&&(n.push(`client_id configured`),P(e,t)?.clientSecret&&n.push(`client_secret configured`)),t.oauth.callbackPort&&n.push(`callback_port ${t.oauth.callbackPort}`),console.log(` OAuth: ${n.join(`, `)}`)}}else if(t.type===`http`){if(console.log(` Type: http`),console.log(` URL: ${t.url}`),t.headers){console.log(` Headers:`);for(let[e,n]of Object.entries(t.headers))console.log(` ${e}: ${n}`)}if(t.oauth?.clientId||t.oauth?.callbackPort){let n=[];t.oauth.clientId&&(n.push(`client_id configured`),P(e,t)?.clientSecret&&n.push(`client_secret configured`)),t.oauth.callbackPort&&n.push(`callback_port ${t.oauth.callbackPort}`),console.log(` OAuth: ${n.join(`, `)}`)}}else if(t.type===`stdio`){console.log(` Type: stdio`),console.log(` Command: ${t.command}`);let e=Array.isArray(t.args)?t.args:[];if(console.log(` Args: ${e.join(` `)}`),t.env){console.log(` Environment:`);for(let[e,n]of Object.entries(t.env))console.log(` ${e}=${n}`)}}console.log(`\nTo remove this server, run: claude mcp remove "${e}" -s ${t.scope}`),await I(0)}async function _e(e,t,n){try{let r=H(n.scope),i=ne(t),a=n.clientSecret&&i&&typeof i==`object`&&`type`in i&&(i.type===`sse`||i.type===`http`)&&`url`in i&&typeof i.url==`string`&&`oauth`in i&&i.oauth&&typeof i.oauth==`object`&&`clientId`in i.oauth?await le():void 0;await G(e,i,r);let o=i&&typeof i==`object`&&`type`in i?String(i.type||`stdio`):`stdio`;a&&i&&typeof i==`object`&&`type`in i&&(i.type===`sse`||i.type===`http`)&&`url`in i&&typeof i.url==`string`&&se(e,{type:i.type,url:i.url},a),y(`tengu_mcp_add`,{scope:r,source:`json`,type:o}),J(`Added ${o} MCP server ${e} to ${r} config`)}catch(e){Y(e.message)}}async function ve(e){try{let t=H(e.scope);y(`tengu_mcp_add`,{scope:t,platform:S(),source:`desktop`});let{readClaudeDesktopMcpServers:n}=await import(`./claudeDesktop-BqTW_pbB.js`),i=await n();Object.keys(i).length===0&&J(`No MCP servers found in Claude Desktop configuration or configuration file does not exist.`);let{unmount:a}=await r((0,Z.jsx)(U,{children:(0,Z.jsx)(j,{children:(0,Z.jsx)(pe,{servers:i,scope:t,onDone:()=>{a()}})})}),{exitOnCtrlC:!0})}catch(e){Y(e.message)}}async function ye(){y(`tengu_mcp_reset_mcpjson_choices`,{}),f(e=>({...e,enabledMcpjsonServers:[],disabledMcpjsonServers:[],enableAllProjectMcpServers:!1})),J(`All project-scoped (.mcp.json) server approvals and rejections have been reset.
|
|
6
|
-
You will be prompted for approval next time you start Claude Code.`)}export{ve as mcpAddFromDesktopHandler,_e as mcpAddJsonHandler,$ as mcpGetHandler,ge as mcpListHandler,he as mcpRemoveHandler,ye as mcpResetChoicesHandler,me as mcpServeHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Q as i,Rn as a,T as o,b as s,f as c,g as l,h as u,nt as d,t as f,tt as p,v as m,x as h}from"./src-Di342QoJ.js";import{t as g}from"./jsx-runtime-D-D469L8.js";import{l as _,u as v}from"./debug-otxXY3j-.js";import{l as y,n as b,o as x}from"./stringUtils-KZoO4GUd.js";import{$C as S,By as C,Cw as w,DC as T,EC as E,JC as ee,Jy as D,Ky as O,Ow as k,Tw as A,YC as j,aS as M,dC as te,ew as ne,gw as N,lC as P,uC as F}from"./loadAgentsDir-C_wFhytF.js";import{D as re,O as ie}from"./rcDebugLog-C42A0pX1.js";import{t as ae}from"./useKeybinding-DPOUuymz.js";import{i as oe,n as se,r as ce}from"./MCPConnectionManager-D5a9ysw2.js";import{n as le,t as ue}from"./McpParsingWarnings-B_z9pZ_8.js";import{a as de,c as I,i as L,l as fe,n as pe,o as R,r as me,s as he,t as ge,u as z}from"./PluginSettings-D3bQRsge.js";function _e({agentServer:e,onCancel:t,onComplete:n}){let[a]=o(),[d,f]=(0,B.useState)(!1),[g,_]=(0,B.useState)(null),[v,y]=(0,B.useState)(null),x=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>x.current?.abort(),[]),p(`confirm:no`,(0,B.useCallback)(()=>{d&&(x.current?.abort(),x.current=null,f(!1),y(null))},[d]),{context:`Confirmation`,isActive:d});let S=(0,B.useCallback)(async()=>{if(!e.needsAuth||!e.url)return;f(!0),_(null);let t=new AbortController;x.current=t;try{let r={type:e.transport,url:e.url};await ne(e.name,r,y,t.signal),n?.(`Authentication successful for ${e.name}. The server will connect when the agent runs.`)}catch(e){e instanceof Error&&!(e instanceof ee)&&_(e.message)}finally{f(!1),x.current=null}},[e,n]),C=b(String(e.name));if(d)return(0,V.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,V.jsxs)(s,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,V.jsxs)(h,{children:[(0,V.jsx)(O,{}),(0,V.jsx)(s,{children:` A browser window will open for authentication`})]}),v&&(0,V.jsxs)(h,{flexDirection:`column`,children:[(0,V.jsx)(s,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually:`}),(0,V.jsx)(i,{url:v})]}),(0,V.jsx)(h,{marginLeft:3,children:(0,V.jsxs)(s,{dimColor:!0,children:[`Return here after authenticating in your browser.`,` `,(0,V.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})]});let w=[];return e.needsAuth&&w.push({label:e.isAuthenticated?`Re-authenticate`:`Authenticate`,value:`auth`}),w.push({label:`Back`,value:`back`}),(0,V.jsxs)(c,{title:`${C} MCP Server`,subtitle:`agent-only`,onCancel:t,inputGuide:e=>e.pending?(0,V.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):(0,V.jsxs)(u,{children:[(0,V.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,V.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,V.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:[(0,V.jsxs)(h,{flexDirection:`column`,gap:0,children:[(0,V.jsxs)(h,{children:[(0,V.jsx)(s,{bold:!0,children:`Type: `}),(0,V.jsx)(s,{dimColor:!0,children:e.transport})]}),e.url&&(0,V.jsxs)(h,{children:[(0,V.jsx)(s,{bold:!0,children:`URL: `}),(0,V.jsx)(s,{dimColor:!0,children:e.url})]}),e.command&&(0,V.jsxs)(h,{children:[(0,V.jsx)(s,{bold:!0,children:`Command: `}),(0,V.jsx)(s,{dimColor:!0,children:e.command})]}),(0,V.jsxs)(h,{children:[(0,V.jsx)(s,{bold:!0,children:`Used by: `}),(0,V.jsx)(s,{dimColor:!0,children:e.sourceAgents.join(`, `)})]}),(0,V.jsxs)(h,{marginTop:1,children:[(0,V.jsx)(s,{bold:!0,children:`Status: `}),(0,V.jsxs)(s,{children:[m(`inactive`,a)(r.radioOff),` not connected (agent-only)`]})]}),e.needsAuth&&(0,V.jsxs)(h,{children:[(0,V.jsx)(s,{bold:!0,children:`Auth: `}),e.isAuthenticated?(0,V.jsxs)(s,{children:[m(`success`,a)(r.tick),` authenticated`]}):(0,V.jsxs)(s,{children:[m(`warning`,a)(r.triangleUpOutline),` may need authentication`]})]})]}),(0,V.jsx)(h,{children:(0,V.jsx)(s,{dimColor:!0,children:`This server connects only when running the agent.`})}),g&&(0,V.jsx)(h,{children:(0,V.jsxs)(s,{color:`error`,children:[`Error: `,g]})}),(0,V.jsx)(h,{children:(0,V.jsx)(M,{options:w,onChange:async e=>{switch(e){case`auth`:await S();break;case`back`:t();break}},onCancel:t})})]})}var B,V,H=e((()=>{n(),B=t(a(),1),f(),ae(),S(),x(),T(),C(),D(),V=g()}));function U(e){switch(e){case`project`:return{label:`Project MCPs`,path:N(e)};case`user`:return{label:`User MCPs`,path:N(e)};case`local`:return{label:`Local MCPs`,path:N(e)};case`enterprise`:return{label:`Enterprise MCPs`};case`dynamic`:return{label:`Built-in MCPs`,path:`always available`};default:return{label:e}}}function ve(e){let t=new Map;for(let n of e){let e=n.scope;t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[,e]of t)e.sort((e,t)=>e.name.localeCompare(t.name));return t}function ye({servers:e,agentServers:t=[],onSelectServer:n,onSelectAgentServer:a,onComplete:f}){let[p]=o(),[g,_]=(0,W.useState)(0),b=W.useMemo(()=>ve(e.filter(e=>e.client.config.type!==`claudeai-proxy`)),[e]),x=W.useMemo(()=>e.filter(e=>e.client.config.type===`claudeai-proxy`).sort((e,t)=>e.name.localeCompare(t.name)),[e]),S=W.useMemo(()=>(b.get(`dynamic`)??[]).sort((e,t)=>e.name.localeCompare(t.name)),[b]),C=U(`dynamic`),w=W.useMemo(()=>{let e=[];for(let t of K){let n=b.get(t)??[];for(let t of n)e.push({type:`server`,server:t})}for(let t of x)e.push({type:`server`,server:t});for(let n of t)e.push({type:`agent-server`,agentServer:n});for(let t of S)e.push({type:`server`,server:t});return e},[b,x,t,S]),T=(0,W.useCallback)(()=>{f(`MCP dialog dismissed`,{display:`system`})},[f]);d({"confirm:previous":()=>_(e=>e===0?w.length-1:e-1),"confirm:next":()=>_(e=>e===w.length-1?0:e+1),"confirm:yes":(0,W.useCallback)(()=>{let e=w[g];e&&(e.type===`server`?n(e.server):e.type===`agent-server`&&a&&a(e.agentServer))},[w,g,n,a]),"confirm:no":T},{context:`Confirmation`});let ee=e=>w.findIndex(t=>t.type===`server`&&t.server===e),D=e=>w.findIndex(t=>t.type===`agent-server`&&t.agentServer===e),O=v(),k=e.some(e=>e.client.type===`failed`);if(e.length===0&&t.length===0)return null;let A=e=>{let t=ee(e),n=g===t,i=``,a=``;if(e.client.type===`disabled`)i=m(`inactive`,p)(r.radioOff),a=`disabled`;else if(e.client.type===`connected`)i=m(`success`,p)(r.tick),a=`connected`;else if(e.client.type===`pending`){i=m(`inactive`,p)(r.radioOff);let{reconnectAttempt:t,maxReconnectAttempts:n}=e.client;a=t&&n?`reconnecting (${t}/${n})…`:`connecting…`}else e.client.type===`needs-auth`?(i=m(`warning`,p)(r.triangleUpOutline),a=`needs authentication`):(i=m(`error`,p)(r.cross),a=`failed`);return(0,G.jsxs)(h,{children:[(0,G.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,G.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,G.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,G.jsx)(s,{dimColor:!n,children:a})]},`${e.name}-${t}`)},j=e=>{let t=D(e),n=g===t,i=e.needsAuth?m(`warning`,p)(r.triangleUpOutline):m(`inactive`,p)(r.radioOff),a=e.needsAuth?`may need auth`:`agent-only`;return(0,G.jsxs)(h,{children:[(0,G.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,G.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,G.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,G.jsx)(s,{dimColor:!n,children:a})]},`agent-${e.name}-${t}`)},M=e.length+t.length;return(0,G.jsxs)(h,{flexDirection:`column`,children:[(0,G.jsx)(ue,{}),(0,G.jsx)(c,{title:`Manage MCP servers`,subtitle:`${M} ${y(M,`server`)}`,onCancel:T,hideInputGuide:!0,children:(0,G.jsxs)(h,{flexDirection:`column`,children:[K.map(e=>{let t=b.get(e);if(!t||t.length===0)return null;let n=U(e);return(0,G.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsxs)(h,{paddingLeft:2,children:[(0,G.jsx)(s,{bold:!0,children:n.label}),n.path&&(0,G.jsxs)(s,{dimColor:!0,children:[` (`,n.path,`)`]})]}),t.map(e=>A(e))]},e)}),x.length>0&&(0,G.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(h,{paddingLeft:2,children:(0,G.jsx)(s,{bold:!0,children:`claude.ai`})}),x.map(e=>A(e))]}),t.length>0&&(0,G.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsx)(h,{paddingLeft:2,children:(0,G.jsx)(s,{bold:!0,children:`Agent MCPs`})}),[...new Set(t.flatMap(e=>e.sourceAgents))].map(e=>(0,G.jsxs)(h,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(h,{paddingLeft:2,children:(0,G.jsxs)(s,{dimColor:!0,children:[`@`,e]})}),t.filter(t=>t.sourceAgents.includes(e)).map(e=>j(e))]},e))]}),S.length>0&&(0,G.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,G.jsxs)(h,{paddingLeft:2,children:[(0,G.jsx)(s,{bold:!0,children:C.label}),C.path&&(0,G.jsxs)(s,{dimColor:!0,children:[` (`,C.path,`)`]})]}),S.map(e=>A(e))]}),(0,G.jsxs)(h,{flexDirection:`column`,children:[k&&(0,G.jsx)(s,{dimColor:!0,children:O?`※ Error logs shown inline with --debug`:`※ Run claude --debug to see error logs`}),(0,G.jsxs)(s,{dimColor:!0,children:[(0,G.jsx)(i,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`}),` for help`]})]})]})}),(0,G.jsx)(h,{paddingX:1,children:(0,G.jsx)(s,{dimColor:!0,italic:!0,children:(0,G.jsxs)(u,{children:[(0,G.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,G.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,G.jsx)(E,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}var W,G,K,be=e((()=>{n(),W=t(a(),1),f(),ae(),k(),_(),x(),T(),le(),G=g(),K=[`project`,`local`,`user`,`enterprise`]}));function xe({serverName:e,onComplete:t}){let[n]=o(),i=te(),a=ce(),[c,l]=(0,q.useState)(!0),[u,d]=(0,q.useState)(null);return(0,q.useEffect)(()=>{async function n(){try{if(!i.getState().mcp.clients.find(t=>t.name===e)){d(`MCP server "${e}" not found`),l(!1),t(`MCP server "${e}" not found`);return}switch((await a(e)).client.type){case`connected`:l(!1),t(`Successfully reconnected to ${e}`);break;case`needs-auth`:d(`${e} requires authentication`),l(!1),t(`${e} requires authentication. Use /mcp to authenticate.`);break;case`pending`:case`failed`:case`disabled`:d(`Failed to reconnect to ${e}`),l(!1),t(`Failed to reconnect to ${e}`);break}}catch(e){let n=e instanceof Error?e.message:String(e);d(n),l(!1),t(`Error: ${n}`)}}n()},[e,a,i,t]),c?(0,J.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,J.jsxs)(s,{color:`text`,children:[`Reconnecting to `,(0,J.jsx)(s,{bold:!0,children:e})]}),(0,J.jsxs)(h,{children:[(0,J.jsx)(O,{}),(0,J.jsx)(s,{children:` Establishing connection to MCP server`})]})]}):u?(0,J.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,J.jsxs)(h,{children:[(0,J.jsxs)(s,{children:[m(`error`,n)(r.cross),` `]}),(0,J.jsxs)(s,{color:`error`,children:[`Failed to reconnect to `,e]})]}),(0,J.jsxs)(s,{dimColor:!0,children:[`Error: `,u]})]}):null}var q,J,Se=e((()=>{n(),q=t(a(),1),f(),se(),P(),D(),J=g()}));function Y({onComplete:e}){let t=F(e=>e.mcp),n=F(e=>e.agentDefinitions),r=t.clients,[i,a]=X.useState({type:`list`}),[o,s]=X.useState([]),c=(0,X.useMemo)(()=>w(n.allAgents),[n.allAgents]),l=X.useMemo(()=>r.filter(e=>e.name!==`ide`).sort((e,t)=>e.name.localeCompare(t.name)),[r]);switch(X.useEffect(()=>{let e=!1;async function n(){let n=await Promise.all(l.map(async e=>{let n=e.config.scope,r=e.config.type===`sse`,i=e.config.type===`http`,a=e.config.type===`claudeai-proxy`,o;if(r||i){let n=await new j(e.name,e.config).tokens(),r=re()!==null&&e.type===`connected`,i=e.type===`connected`&&A(t.tools,e.name).length>0;o=!!n||r||i}let s={name:e.name,client:e,scope:n};return a?{...s,transport:`claudeai-proxy`,isAuthenticated:!1,config:e.config}:r?{...s,transport:`sse`,isAuthenticated:o,config:e.config}:i?{...s,transport:`http`,isAuthenticated:o,config:e.config}:{...s,transport:`stdio`,config:e.config}}));e||s(n)}return n(),()=>{e=!0}},[l,t.tools]),(0,X.useEffect)(()=>{o.length===0&&l.length>0||o.length===0&&c.length===0&&e("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},[o.length,l.length,c.length,e]),i.type){case`list`:return(0,Z.jsx)(ye,{servers:o,agentServers:c,onSelectServer:e=>a({type:`server-menu`,server:e}),onSelectAgentServer:e=>a({type:`agent-server-menu`,agentServer:e}),onComplete:e,defaultTab:i.defaultTab});case`server-menu`:{let n=A(t.tools,i.server.name),r=i.server.transport===`claudeai-proxy`?`claude.ai`:`Claude Code`;return i.server.transport===`stdio`?(0,Z.jsx)(he,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e}):(0,Z.jsx)(fe,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e})}case`server-tools`:return(0,Z.jsx)(me,{server:i.server,onSelectTool:(e,t)=>a({type:`server-tool-detail`,server:i.server,toolIndex:t}),onBack:()=>a({type:`server-menu`,server:i.server})});case`server-tool-detail`:{let e=A(t.tools,i.server.name)[i.toolIndex];return e?(0,Z.jsx)(de,{tool:e,server:i.server,onBack:()=>a({type:`server-tools`,server:i.server})}):(a({type:`server-tools`,server:i.server}),null)}case`agent-server-menu`:return(0,Z.jsx)(_e,{agentServer:i.agentServer,onCancel:()=>a({type:`list`,defaultTab:`Agents`}),onComplete:e})}}var X,Z,Ce=e((()=>{X=t(a(),1),S(),k(),P(),ie(),H(),be(),z(),I(),R(),L(),Z=g()})),we=e((()=>{H(),be(),Se(),z(),Ce(),I(),R(),L()}));function Te({action:e,target:t,onComplete:n}){let r=F(e=>e.mcp.clients),i=oe(),a=(0,Q.useRef)(!1);return(0,Q.useEffect)(()=>{if(a.current)return;a.current=!0;let o=e===`enable`,s=r.filter(e=>e.name!==`ide`),c=t===`all`?s.filter(e=>o?e.type===`disabled`:e.type!==`disabled`):s.filter(e=>e.name===t);if(c.length===0){n(t===`all`?`All MCP servers are already ${o?`enabled`:`disabled`}`:`MCP server "${t}" not found`);return}for(let e of c)i(e.name);n(t===`all`?`${o?`Enabled`:`Disabled`} ${c.length} MCP server(s)`:`MCP server "${t}" ${o?`enabled`:`disabled`}`)},[e,t,r,i,n]),null}async function Ee(e,t,n){if(n){let t=n.trim().split(/\s+/);if(t[0]===`no-redirect`)return(0,$.jsx)(Y,{onComplete:e});if(t[0]===`reconnect`&&t[1])return(0,$.jsx)(xe,{serverName:t.slice(1).join(` `),onComplete:e});if(t[0]===`enable`||t[0]===`disable`)return(0,$.jsx)(Te,{action:t[0],target:t.length>1?t.slice(1).join(` `):`all`,onComplete:e})}return process.env.USER_TYPE===`ant`?(0,$.jsx)(ge,{onComplete:e,args:`manage`,showMcpRedirectMessage:!0}):(0,$.jsx)(Y,{onComplete:e})}var Q,$;e((()=>{Q=t(a(),1),we(),Se(),se(),P(),pe(),$=g()}))();export{Ee as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{In as i,Ln as a,Q as o,Rn as s,b as c,d as l,f as u,t as d,tt as f,x as p}from"./src-Di342QoJ.js";import{t as m}from"./jsx-runtime-D-D469L8.js";import{cn as h,ot as g}from"./state-sIHsFpDu.js";import{Bc as ee,Uc as _,a as v,lo as y,n as b,oo as x,s as S}from"./paths-Ci1iwL5Y.js";import{B as C,U as w}from"./debug-otxXY3j-.js";import{n as T,r as E}from"./analytics-DqMQntaB.js";import{n as D,t as O}from"./cwd--iizewsn.js";import{r as k,v as A}from"./git-C0IuvuIy.js";import{o as j,s as M}from"./log-DSV4Ht5l.js";import{g as N,x as P}from"./startupProfiler-CAntGAbs.js";import{By as F,Cp as te,Jn as I,Kn as ne,Qk as L,Sp as R,Xk as z,aS as re,lC as B,ou as ie,qk as ae,su as oe,uC as V}from"./loadAgentsDir-C_wFhytF.js";import{r as se,t as ce}from"./browser-Bt-ckCaU.js";import{t as H}from"./useKeybinding-DPOUuymz.js";import{n as U,t as W}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{r as le,t as ue}from"./promptEditor-Dz41P-3I.js";import{homedir as de}from"os";import{join as G,relative as fe}from"path";import{mkdir as K,writeFile as pe}from"fs/promises";function me(e){return k(e)!==null}var he=e((()=>{A()}));function ge({onSelect:e,onCancel:t}){let r=(0,q.use)(z()),a=G(n(),`CLAUDE.md`),o=G(g(),`CLAUDE.md`),s=r.some(e=>e.path===a),u=r.some(e=>e.path===o),d=[...r.filter(e=>e.type!==`AutoMem`&&e.type!==`TeamMem`).map(e=>({...e,exists:!0})),...s?[]:[{path:a,type:`User`,content:``,exists:!1}],...u?[]:[{path:o,type:`Project`,content:``,exists:!1}]],m=new Map,h=d.map(e=>{let t=ee(e.path),n=e.exists?``:` (new)`,r=e.parent?(m.get(e.parent)??0)+1:0;m.set(e.path,r);let i=r>0?` `.repeat(r-1):``,s;s=e.type===`User`&&!e.isNested&&e.path===a?`User memory`:e.type===`Project`&&!e.isNested&&e.path===o?`Project memory`:r>0?`${i}L ${t}${n}`:`${t}`;let c,l=me(g());return c=e.type===`User`&&!e.isNested?`Saved in ~/.claude/CLAUDE.md`:e.type===`Project`&&!e.isNested&&e.path===o?`${l?`Checked in at`:`Saved in`} ./CLAUDE.md`:e.parent?`@-imported`:e.isNested?`dynamically loaded`:``,{label:s,value:e.path,description:c}}),_=[],v=V(e=>e.agentDefinitions);if(S()){_.push({label:`Open auto-memory folder`,value:`${X}${b()}`,description:``});for(let e of v.activeAgents)if(e.memory){let t=ne(e.agentType,e.memory);_.push({label:`Open ${i.bold(e.agentType)} agent memory`,value:`${X}${t}`,description:`${e.memory} scope`})}}h.push(..._);let x=Y&&h.some(e=>e.value===Y)?Y:h[0]?.value||``,[C,w]=(0,q.useState)(S),[T,D]=(0,q.useState)(oe),[O]=(0,q.useState)(S),k=V(e=>Object.values(e.tasks).some(e=>e.type===`dream`&&e.status===`running`)),[A,j]=(0,q.useState)(null);(0,q.useEffect)(()=>{O&&te().then(j)},[O,k]);let M=k?`running`:A===null?``:A===0?`never`:`last ran ${N(new Date(A))}`,[P,F]=(0,q.useState)(null),I=P!==null,L=+!!O;function R(){let e=!C;y(`userSettings`,{autoMemoryEnabled:e}),w(e),E(`tengu_auto_memory_toggled`,{enabled:e})}function B(){let e=!T;y(`userSettings`,{autoDreamEnabled:e}),D(e),E(`tengu_auto_dream_toggled`,{enabled:e})}return U(),f(`confirm:no`,t,{context:`Confirmation`}),f(`confirm:yes`,()=>{P===0?R():P===1&&B()},{context:`Confirmation`,isActive:I}),f(`select:next`,()=>{F(e=>e!==null&&e<L?e+1:null)},{context:`Select`,isActive:I}),f(`select:previous`,()=>{F(e=>e!==null&&e>0?e-1:e)},{context:`Select`,isActive:I}),(0,J.jsxs)(p,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(p,{flexDirection:`column`,marginBottom:1,children:[(0,J.jsx)(l,{isFocused:P===0,children:(0,J.jsxs)(c,{children:[`Auto-memory: `,C?`on`:`off`]})}),O&&(0,J.jsx)(l,{isFocused:P===1,styled:!1,children:(0,J.jsxs)(c,{color:P===1?`suggestion`:void 0,children:[`Auto-dream: `,T?`on`:`off`,M&&(0,J.jsxs)(c,{dimColor:!0,children:[` · `,M]}),!k&&T&&(0,J.jsx)(c,{dimColor:!0,children:` · /dream to run`})]})})]}),(0,J.jsx)(re,{defaultFocusValue:x,options:h,isDisabled:I,onChange:t=>{if(t.startsWith(X)){let e=t.slice(15);K(e,{recursive:!0}).catch(()=>{}).then(()=>se(e));return}Y=t,e(t)},onCancel:t,onUpFromFirstItem:()=>F(L)})]})}var q,J,Y,X,_e=e((()=>{a(),s(),q=t(s(),1),h(),W(),d(),H(),v(),T(),ie(),R(),B(),I(),ce(),L(),r(),_(),P(),he(),x(),F(),J=m(),X=`__open_folder__`}));function ve(e){let t=de(),n=O(),r=e.startsWith(t)?`~`+e.slice(t.length):null,i=e.startsWith(n)?`./`+fe(n,e):null;return r&&i?r.length<=i.length?r:i:r||i||e}var ye=e((()=>{s(),d(),D(),m()}));function be({onDone:e}){let t=async t=>{try{t.includes(n())&&await K(n(),{recursive:!0});try{await pe(t,``,{encoding:`utf8`,flag:`wx`})}catch(e){if(C(e)!==`EEXIST`)throw e}await ue(t);let r=`default`,i=``;process.env.VISUAL?(r=`$VISUAL`,i=process.env.VISUAL):process.env.EDITOR&&(r=`$EDITOR`,i=process.env.EDITOR);let a=r===`default`?``:`Using ${r}="${i}".`,o=a?`> ${a} To change editor, set $EDITOR or $VISUAL environment variable.`:`> To use a different editor, set the $EDITOR or $VISUAL environment variable.`;e(`Opened memory file at ${ve(t)}\n\n${o}`,{display:`system`})}catch(t){M(t),e(`Error opening memory file: ${t}`)}},r=()=>{e(`Cancelled memory editing`,{display:`system`})};return(0,Q.jsx)(u,{title:`Memory`,onCancel:r,color:`remember`,children:(0,Q.jsxs)(p,{flexDirection:`column`,children:[(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(ge,{onSelect:t,onCancel:r})}),(0,Q.jsx)(p,{marginTop:1,children:(0,Q.jsxs)(c,{dimColor:!0,children:[`Learn more: `,(0,Q.jsx)(o,{url:`https://code.claude.com/docs/en/memory`})]})})]})})}var Z,Q,$;e((()=>{Z=t(s(),1),d(),_e(),ye(),L(),r(),w(),j(),le(),Q=m(),$=async e=>(ae(),await z(),(0,Q.jsx)(be,{onDone:e}))}))();export{$ as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Dr as e,Pr as t}from"./paths-Ci1iwL5Y.js";t();export{e as getMainLoopModel};
|
|
@@ -1 +0,0 @@
|
|
|
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"./PluginSettings-D3bQRsge.js";async function a(e,t,n){return(0,o.jsx)(i,{onComplete:e,args:n})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./pluginStartupCheck-DCDWHam6.js";e();export{t as getPluginEditableScopes};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ka as e,Qa as t,Wa as n}from"./loadAgentsDir-C_wFhytF.js";n();export{e as isPolicyAllowed,t as waitForPolicyLimitsToLoad};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./poorMode-aDmmvJ_e.js";t();export{e as isPoorModeActive};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{Ct as r,cn as i,mr as a,t as o}from"./state-sIHsFpDu.js";import{$ as s,Bc as c,Dt as l,Ot as u,Uc as d,tt as f,vs as p,ys as m}from"./paths-Ci1iwL5Y.js";import{P as h,U as g,_,h as v,j as y,l as b,p as x}from"./debug-otxXY3j-.js";import{n as S,r as C}from"./analytics-DqMQntaB.js";import{O as w,et as T,k as E,o as D,s as O}from"./log-DSV4Ht5l.js";import{n as k,t as ee}from"./sleep-C6koP5Ka.js";import{$D as te,$_ as ne,$o as A,$w as re,A as ie,Ao as ae,BO as oe,CS as se,Co as ce,Dl as le,Eo as j,Fc as ue,Fk as de,G as fe,Il as M,Jo as pe,K as me,KO as he,Mc as N,Nc as P,O_ as F,Qw as I,Rk as L,Rl as R,So as z,TS as ge,To as _e,Ui as ve,Uo as ye,Wo as be,Xi as xe,Zo as Se,Zw as Ce,_D as we,_v as B,aA as Te,bO as Ee,bv as De,cp as Oe,dv as ke,eO as Ae,ev as je,fv as Me,gD as Ne,gv as Pe,ha as V,hv as Fe,k_ as H,kl as Ie,lj as Le,nO as Re,na as ze,qi as Be,rA as Ve,rO as He,sp as Ue,ta as We,tv as Ge,uj as Ke,vo as U,w as qe,wO as Je,xO as Ye,zO as Xe,zl as Ze}from"./loadAgentsDir-C_wFhytF.js";import{a as W,i as Qe,o as G}from"./xml-CVF7dWfi.js";import{E as $e,T as et,w as tt}from"./sessionTracing-CJUUEWZ4.js";import{n as nt,t as rt}from"./slashCommandParsing-BfanVchF.js";import{randomUUID as K}from"crypto";function it(e,t,n,r,i){let a=0;for(let o of p){let s=n[o];if(s)for(let n of s)for(let s of n.hooks){let c=s.once?()=>{x(`Removing one-shot hook for event ${o} in skill '${r}'`),Ge(e,t,o,s)}:void 0;ne(e,t,o,n.matcher||``,s,c,i),a++}}a>0&&x(`Registered ${a} hooks from skill '${r}'`)}var at=e((()=>{m(),b(),je()}));function ot(){return!1}function st(){if(!ot())throw Error(`ToolUseContext.options.allowBackgroundForkedSlashCommands is test-only and cannot be enabled outside NODE_ENV=test.`)}async function q(e,t,n,r,i,a,o){let s=ke(),u=e.pluginInfo?G(e.pluginInfo.repository).marketplace:void 0;C(`tengu_slash_command_forked`,{command_name:e.name,invocation_trigger:`user-slash`,...e.pluginInfo&&{_PROTO_plugin_name:e.pluginInfo.pluginManifest.name,...u&&{_PROTO_marketplace_name:u},...B(e.pluginInfo)}});let{skillContent:d,modifiedGetAppState:f,baseAgent:p,promptMessages:m}=await Ze(e,t,n),h=e.effort===void 0?p:{...p,effort:e.effort};x(`Executing forked slash command /${e.name} with agent ${h.agentType}`);let g=await n.getAppState();n.options.allowBackgroundForkedSlashCommands===!0&&st();let _=!1;if(g.kairosEnabled&&(_=!0),_){let t=te(),r=V(e),i=l(),c=e=>oe({value:e,mode:`prompt`,priority:`later`,isMeta:!0,skipSlashCommands:!0,workload:i}),u=async()=>{if(!o?.runId)return;let e=await Ee({runId:o.runId,rootDir:o.rootDir,priority:`later`,workload:i});for(let t of e)Xe(t)},d=async e=>{o?.runId&&await Ye({runId:o.runId,rootDir:o.rootDir,error:e instanceof Error?e.message:String(e)})};return(async()=>{let i=Date.now()+$;for(;Date.now()<i&&n.getAppState().mcp.clients.some(e=>e.type===`pending`);)await k(Q);let o=n.options.refreshTools?.()??n.options.tools,l=[];for await(let r of H({agentDefinition:h,promptMessages:m,toolUseContext:{...n,getAppState:f,abortController:t},canUseTool:a,isAsync:!0,querySource:`agent:custom`,model:e.model,availableTools:o,override:{agentId:s}}))l.push(r);let d=M(l,`Command completed`);x(`Background forked command /${r} completed (agent ${s})`),c(`<scheduled-task-result command="/${r}">\n${d}\n</scheduled-task-result>`);try{await u()}catch(e){O(e)}})().catch(async e=>{O(e),c(`<scheduled-task-result command="/${r}" status="failed">\n${e instanceof Error?e.message:String(e)}\n</scheduled-task-result>`),await d(e)}),{messages:[],shouldQuery:!1,command:e,deferAutonomyCompletion:!!o?.runId}}let v=[],y=[],b=`forked-command-${e.name}`,S=0,w=e=>(S++,{type:`progress`,data:{message:e,type:`agent_progress`,prompt:d,agentId:s},parentToolUseID:b,toolUseID:`${b}-${S}`,timestamp:new Date().toISOString(),uuid:K()}),T=()=>{i({jsx:Oe(y,{tools:n.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};T();try{for await(let t of H({agentDefinition:h,promptMessages:m,toolUseContext:{...n,getAppState:f},canUseTool:a,isAsync:!1,querySource:`agent:custom`,model:e.model,availableTools:n.options.tools})){v.push(t);let e=Se([t]);if(t.type===`assistant`){let r=de(t);r>0&&n.setResponseLength(e=>e+r);let i=e[0];i&&i.type===`assistant`&&(y.push(w(t)),T())}if(t.type===`user`){let t=e[0];t&&t.type===`user`&&(y.push(w(t)),T())}}}finally{i(null)}let E=M(v,`Command completed`);return x(`Forked slash command /${e.name} completed with agent ${s}`),process.env.USER_TYPE===`ant`&&(E=`[ANT-ONLY] API calls: ${c(Re(s))}\n${E}`),{messages:[j({content:A({inputString:`/${V(e)} ${t}`.trim(),precedingInputBlocks:r})}),j({content:`<local-command-stdout>\n${E}\n</local-command-stdout>`})],shouldQuery:!1,command:e,resultText:E}}function ct(e){return!/[^a-zA-Z0-9:\-_]/.test(e)}async function lt(e,t,n,r,i,o,s,c,l,u){let d=nt(e);if(!d){C(`tengu_input_slash_missing`,{});let e="Commands are in the form `/command [args]`";return{messages:[z(),...r,j({content:A({inputString:e,precedingInputBlocks:t})})],shouldQuery:!1,resultText:e}}let{commandName:f,args:p,isMcp:m}=d,h=m?`mcp`:ve().has(f)?f:`custom`;if(!We(f,i.options.commands)){let n=!1;try{await v().stat(`/${f}`),n=!0}catch{}if(ct(f)&&!n){C(`tengu_input_slash_invalid`,{input:f});let e=`Unknown skill: ${f}`;return{messages:[z(),...r,j({content:A({inputString:e,precedingInputBlocks:t})}),...p?[ce(`Args from unknown skill: ${p}`,`warning`)]:[]],shouldQuery:!1,resultText:e}}let i=K();return a(i),C(`tengu_input_prompt`,{}),et(`user_prompt`,{prompt_length:String(e.length),prompt:$e(e),"prompt.id":i}),{messages:[j({content:A({inputString:e,precedingInputBlocks:t}),uuid:s}),...r],shouldQuery:!0}}let{messages:g,shouldQuery:_,allowedTools:y,model:b,effort:x,command:S,resultText:w,nextInput:T,submitNextInput:E,deferAutonomyCompletion:D}=await ut(f,p,o,i,t,n,c,l,s,u);if(g.length===0){let e={input:h};if(S.type===`prompt`&&S.pluginInfo){let{pluginManifest:t,repository:n}=S.pluginInfo,{marketplace:r}=G(n),i=W(r);e._PROTO_plugin_name=t.name,r&&(e._PROTO_marketplace_name=r),e.plugin_repository=i?n:`third-party`,e.plugin_name=i?t.name:`third-party`,i&&t.version&&(e.plugin_version=t.version),Object.assign(e,B(S.pluginInfo))}return C(`tengu_input_command`,{...e,invocation_trigger:`user-slash`,...process.env.USER_TYPE===`ant`&&{skill_name:f,...S.type===`prompt`&&{skill_source:S.source},...S.loadedFrom&&{skill_loaded_from:S.loadedFrom},...S.kind&&{skill_kind:S.kind}}}),{messages:[],shouldQuery:!1,model:b,nextInput:T,submitNextInput:E,deferAutonomyCompletion:D}}if(g.length===2&&g[1].type===`user`&&typeof g[1].message.content==`string`&&g[1].message.content.startsWith(`Unknown command:`))return e.startsWith(`/var`)||e.startsWith(`/tmp`)||e.startsWith(`/private`)||C(`tengu_input_slash_invalid`,{input:f}),{messages:[z(),...g],shouldQuery:_,allowedTools:y,model:b};let O={input:h};if(S.type===`prompt`&&S.pluginInfo){let{pluginManifest:e,repository:t}=S.pluginInfo,{marketplace:n}=G(t),r=W(n);O._PROTO_plugin_name=e.name,n&&(O._PROTO_marketplace_name=n),O.plugin_repository=r?t:`third-party`,O.plugin_name=r?e.name:`third-party`,r&&e.version&&(O.plugin_version=e.version),Object.assign(O,B(S.pluginInfo))}C(`tengu_input_command`,{...O,invocation_trigger:`user-slash`,...process.env.USER_TYPE===`ant`&&{skill_name:f,...S.type===`prompt`&&{skill_source:S.source},...S.loadedFrom&&{skill_loaded_from:S.loadedFrom},...S.kind&&{skill_kind:S.kind}}});let k=g.length>0&&g[0]&&be(g[0]);return{messages:_||g.every(pe)||k?g:[z(),...g],shouldQuery:_,allowedTools:y,model:b,effort:x,resultText:w,nextInput:T,submitNextInput:E,deferAutonomyCompletion:D}}async function ut(e,t,n,r,i,a,o,s,c,l){let u=xe(e,r.options.commands);if(u.type===`prompt`&&u.userInvocable!==!1&&Pe(e),u.userInvocable===!1)return{messages:[j({content:A({inputString:`/${e}`,precedingInputBlocks:i})}),j({content:`This skill can only be invoked by Claude, not directly by users. Ask Claude to use the "${e}" skill for you.`})],shouldQuery:!1,command:u};try{switch(u.type){case`local-jsx`:return new Promise(e=>{let a=!1,o=(n,r)=>{if(a=!0,r?.display===`skip`){e({messages:[],shouldQuery:!1,command:u,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput});return}let o=(r?.metaMessages??[]).map(e=>j({content:e,isMeta:!0})),s=ge()&&typeof n==`string`&&n.endsWith(` dismissed`),c=r?.displayArgs??t;e({messages:r?.display===`system`?s?o:[U(J(u,c)),U(`<local-command-stdout>${n}</local-command-stdout>`),...o]:[j({content:A({inputString:J(u,c),precedingInputBlocks:i})}),j(n?{content:`<local-command-stdout>${n}</local-command-stdout>`}:{content:`<local-command-stdout>${Le}</local-command-stdout>`}),...o],shouldQuery:r?.shouldQuery??!1,command:u,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput})};u.load().then(e=>e.call(o,{...r,canUseTool:s},t)).then(t=>{if(t!=null){if(r.options.isNonInteractiveSession){e({messages:[],shouldQuery:!1,command:u});return}a||n({jsx:t,shouldHidePromptInput:!0,showSpinner:!1,isLocalJSXCommand:!0,isImmediate:u.immediate===!0})}}).catch(t=>{O(t),!a&&(a=!0,n({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),e({messages:[],shouldQuery:!1,command:u}))})});case`local`:{let e=j({content:A({inputString:J(u,u.isSensitive&&t.trim()?`***`:t),precedingInputBlocks:i})});try{let n=z(),i=await(await u.load()).call(t,r);if(i.type===`skip`)return{messages:[],shouldQuery:!1,command:u};if(i.type===`compact`){let t=[n,e,...i.displayText?[j({content:`<local-command-stdout>${i.displayText}</local-command-stdout>`,timestamp:new Date(Date.now()+100).toISOString()})]:[]],r={...i.compactionResult,messagesToKeep:[...i.compactionResult.messagesToKeep??[],...t]};return Te(),{messages:le(r),shouldQuery:!1,command:u}}return{messages:[e,U(`<local-command-stdout>${i.value}</local-command-stdout>`)],shouldQuery:!1,command:u,resultText:i.value}}catch(t){return O(t),{messages:[e,U(`<local-command-stderr>${String(t)}</local-command-stderr>`)],shouldQuery:!1,command:u}}}case`prompt`:try{return u.context===`fork`?await q(u,t,r,i,n,s??fe,l):await Z(u,t,r,i,a,c)}catch(e){return e instanceof y?{messages:[j({content:A({inputString:J(u,t),precedingInputBlocks:i})}),_e({toolUse:!1})],shouldQuery:!1,command:u}:{messages:[j({content:A({inputString:J(u,t),precedingInputBlocks:i})}),j({content:`<local-command-stderr>${String(e)}</local-command-stderr>`})],shouldQuery:!1,command:u}}}}catch(e){if(e instanceof h)return{messages:[j({content:A({inputString:e.message,precedingInputBlocks:i})})],shouldQuery:!1,command:u};throw e}}function J(e,t){return ae(V(e),t)}function Y(e,t=`loading`){return[`<${w}>${e}</${w}>`,`<${E}>${e}</${E}>`,`<skill-format>true</skill-format>`].join(`
|
|
2
|
-
`)}function dt(e,t){return[`<${w}>${e}</${w}>`,`<${E}>/${e}</${E}>`,t?`<command-args>${t}</command-args>`:null].filter(Boolean).join(`
|
|
3
|
-
`)}function X(e,t){return e.userInvocable===!1&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)?Y(e.name,e.progressMessage):dt(e.name,t)}async function ft(e,t,n,r,i=[]){let a=Be(e,n);if(!a)throw new h(`Unknown command: ${e}`);if(a.type!==`prompt`)throw Error(`Unexpected ${a.type} command. Expected 'prompt' command. Use /${e} directly in the main conversation.`);return Z(a,t,r,[],i)}async function Z(e,t,i,a=[],c=[],l){if(n(process.env.CLAUDE_CODE_COORDINATOR_MODE)&&!i.agentId){let n=X(e,t),r=[`Skill "/${e.name}" is available for workers.`];e.description&&r.push(`Description: ${e.description}`),e.whenToUse&&r.push(`When to use: ${e.whenToUse}`);let i=e.allowedTools??[];i.length>0&&r.push(`This skill grants workers additional tool permissions: ${i.join(`, `)}`),r.push(`\nInstruct a worker to use this skill by including "Use the /${e.name} skill" in your Agent prompt. The worker has access to the Skill tool and will receive the skill's content and permissions when it invokes it.`);let a=[{type:`text`,text:r.join(`
|
|
4
|
-
`)}];return{messages:[j({content:n,uuid:l}),j({content:a,isMeta:!0})],shouldQuery:!0,model:e.model,effort:e.effort,command:e}}let u=await e.getPromptForCommand(t,i),d=!I(`hooks`)||re(e.source);if(e.hooks&&d){let t=r();it(i.setAppState,t,e.hooks,e.name,e.type===`prompt`?e.skillRoot:void 0)}let f=e.source?`${e.source}:${e.name}`:e.name,p=u.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
5
|
-
|
|
6
|
-
`);o(e.name,f,p,s()?.agentId??null);let m=X(e,t),h=ie(e.allowedTools??[]),g=c.length>0||a.length>0?[...c,...a,...u]:u,_=await we(P(u.filter(e=>e.type===`text`).map(e=>e.text).join(` `),i,null,[],i.messages,`repl_main_thread`,{skipSkillDiscovery:!0}));return{messages:[j({content:m,uuid:l}),j({content:g,isMeta:!0}),..._,N({type:`command_permissions`,allowedTools:h,model:e.model})],shouldQuery:!0,allowedTools:h,model:e.model,effort:e.effort,command:e}}var Q,$;e((()=>{i(),ze(),Ke(),T(),S(),He(),Ie(),Ve(),F(),Ue(),Ae(),f(),ue(),b(),t(),g(),d(),R(),_(),se(),Ne(),at(),D(),he(),ye(),qe(),me(),Qe(),Ce(),rt(),ee(),Fe(),tt(),De(),L(),Me(),Je(),u(),Q=200,$=1e4}))();export{Y as formatSkillLoadingMetadata,ft as processPromptSlashCommand,lt as processSlashCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{TA as e,yA as t}from"./loadAgentsDir-C_wFhytF.js";e();export{t as clearPromptCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./prompt-6ZKyqv6z.js";t();export{e as isDeferredTool};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ad as e,Bd as t,Dd as n,Fd as r,Id as i,Ld as a,Md as o,Nd as s,Od as c,Pd as l,Rd as u,Vd as d,jd as f,kd as p,zd as m}from"./loadAgentsDir-C_wFhytF.js";r();export{n as detectAndGetBackend,c as ensureBackendsRegistered,p as getBackendByType,e as getCachedBackend,f as getCachedDetectionResult,o as getInProcessBackend,s as getResolvedTeammateMode,l as getTeammateExecutor,i as isInProcessEnabled,a as markInProcessFallback,u as registerITermBackend,m as registerTmuxBackend,t as registerWindowsTerminalBackend,d as resetBackendDetection};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{FA as e,MA as t}from"./loadAgentsDir-C_wFhytF.js";e();export{t as SandboxManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{rl as e,tl as t}from"./loadAgentsDir-C_wFhytF.js";t();export{e as isSearchExtraToolsEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Su as e,wu as t}from"./loadAgentsDir-C_wFhytF.js";e();export{t as registerSessionFileAccessHooks};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./sessionMemory-Ctauybzs.js";t();export{e as manuallyExtractSessionMemory};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Tk as e,xk as t}from"./loadAgentsDir-C_wFhytF.js";e();export{t as getSessionMemoryContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./sessionObserver-ardnTJ37.js";e();export{t as heuristicObserverBackend};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fr as e,Hr as t,di as n}from"./loadAgentsDir-C_wFhytF.js";e();export{t as linkSessionToPR,n as recordTranscript};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as e,s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{In as r,Ln as i}from"./src-Di342QoJ.js";import{Ct as ee,U as a,cn as o,dr as s,jr as c,lr as l,ut as te}from"./state-sIHsFpDu.js";import{Cc as u,Cn as ne,at as d,dc as f,it as p,lc as re,on as m,rt as h,st as g,yc as _}from"./paths-Ci1iwL5Y.js";import{U as v,z as y}from"./debug-otxXY3j-.js";import{n as b,r as x}from"./analytics-DqMQntaB.js";import{n as S,t as C}from"./cwd--iizewsn.js";import{F as w,P as T,f as ie,n as E,r as D,v as O}from"./git-C0IuvuIy.js";import{a as k,n as A}from"./env-C2A9gV_G.js";import{o as j,s as M}from"./log-DSV4Ht5l.js";import{a as N,n as P}from"./startupProfiler-CAntGAbs.js";import{Cn as F,Di as I,Fr as L,It as R,KE as z,Ot as B,Qk as V,Sn as H,St as U,Zi as W,_C as G,by as K,dy as q,gC as J,gx as Y,hC as ae,mh as X,na as oe,ph as se,qE as ce,qk as le,ux as ue,uy as de,vy as fe,wt as Z,xt as pe}from"./loadAgentsDir-C_wFhytF.js";import{l as me,u as he}from"./terminalSetup-C1X-sXwp.js";import{c as ge,n as _e}from"./releaseNotes-C8KQGZHq.js";import{s as ve,u as ye}from"./logoV2Utils-BJHvwGup.js";import{i as be,r as xe}from"./runtimeObserver-DaKaKNVW.js";import{n as Q,r as Se}from"./sessionMemory-Ctauybzs.js";import{t as Ce}from"./sinks-Dc9V7k6a.js";import{homedir as we}from"os";import{join as Te}from"path";import{copyFile as Ee,stat as De}from"fs/promises";t(),i(),o(),b(),S(),v(),T(),k(),O(),m(),g(),h(),V(),ce(),J(),he(),de(),se(),oe(),L(),F(),ge(),be(),Se(),_(),j();function $(){u(e=>({...e,iterm2SetupInProgress:!1}))}function Oe(){let e=f();return{inProgress:e.iterm2SetupInProgress??!1,backupPath:e.iterm2BackupPath||null}}function ke(){return Te(we(),`Library`,`Preferences`,`com.googlecode.iterm2.plist`)}async function Ae(){let{inProgress:e,backupPath:t}=Oe();if(!e)return{status:`no_backup`};if(!t)return $(),{status:`no_backup`};try{await De(t)}catch{return $(),{status:`no_backup`}}try{return await Ee(t,ke()),$(),{status:`restored`}}catch(e){return M(Error(`Failed to restore iTerm2 settings with: ${e}`)),$(),{status:`failed`,backupPath:t}}}_(),j(),ye(),ue(),K(),P(),B();async function je(t,i,o,u,m,h,g,_,v){w(`info`,`setup_started`);let b=process.version.match(/^v(\d+)\./)?.[1];if((!b||parseInt(b,10)<18)&&(console.error(r.bold.red(`Error: Claude Code requires Node.js version 18 or higher.`)),process.exit(1)),g&&c(z(g)),e(),!e()&&p()){let{captureTeammateModeSnapshot:e}=await import(`./teammateModeSnapshot-BDJ1JTcl.js`);e()}if(!a()){if(p()){let e=await Ae();e.status===`restored`?console.log(r.yellow(`Detected an interrupted iTerm2 setup. Your original settings have been restored. You may need to restart iTerm2 for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore iTerm2 settings. Please manually restore your original settings with: defaults import com.googlecode.iterm2 ${e.backupPath}.`))}try{let e=await me();e.status===`restored`?console.log(r.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){M(e)}}X(t);let S=Date.now();if(ae(),w(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-S}),q(t),u){let e=H(),n=await ie();!e&&!n&&(process.stderr.write(r.red(`Error: Can only use --worktree in a git repository, but ${r.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let i=_?`pr-${_}`:m??fe(),a;if(n){let e=E(C());e||(process.stderr.write(r.red(`Error: Could not determine the main git repository root.
|
|
2
|
-
`)),process.exit(1)),e!==(D(C())??C())&&(w(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),X(e)),a=h?Z(e,R(i)):void 0}else a=h?Z(C(),R(i)):void 0;let o;try{o=await U(ee(),i,a,_?{prNumber:_}:void 0)}catch(e){process.stderr.write(r.red(`Error creating worktree: ${y(e)}\n`)),process.exit(1)}if(x(`tengu_worktree_created`,{tmux_enabled:h}),h&&a){let e=await pe(a,o.worktreePath);e.created?console.log(r.green(`Created tmux session: ${r.bold(a)}\nTo attach: ${r.bold(`tmux attach -t ${a}`)}`)):console.error(r.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(o.worktreePath),X(o.worktreePath),l(C()),s(C()),I(o),le(),G()}w(`info`,`setup_background_jobs_starting`),e()||(Q(),xe()),Y(),w(`info`,`setup_background_jobs_launched`),N(`setup_before_prefetch`),w(`info`,`setup_prefetch_starting`);let T=a()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||e();if(T||W(te()),import(`./loadPluginHooks-CYZjzxyO.js`).then(e=>{T||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),e()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-CH9C_hoL.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-CVpefuSD.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-VGSpz4mk.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-BXsK8Dwf.js`).then(e=>e.registerSessionFileAccessHooks())),Ce(),x(`tengu_started`,{}),ne(a()),N(`setup_after_prefetch`),!e()){let{hasReleaseNotes:e}=await _e(f().lastReleaseNotesSeen);e&&await ve()}if((i===`bypassPermissions`||o)&&(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP)&&(console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1)),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`)){let[e,t]=await Promise.all([d.getIsDocker(),A.hasInternetAccess()]),n=d.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}let O=re();O.lastCost!==void 0&&O.lastDuration!==void 0&&x(`tengu_exit`,{last_session_cost:O.lastCost,last_session_api_duration:O.lastAPIDuration,last_session_tool_duration:O.lastToolDuration,last_session_duration:O.lastDuration,last_session_lines_added:O.lastLinesAdded,last_session_lines_removed:O.lastLinesRemoved,last_session_total_input_tokens:O.lastTotalInputTokens,last_session_total_output_tokens:O.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:O.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:O.lastTotalCacheReadInputTokens,last_session_fps_average:O.lastFpsAverage,last_session_fps_low_1_pct:O.lastFpsLow1Pct,last_session_id:O.lastSessionId,...O.lastSessionMetrics})}export{je as setup};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./sink-Do5fWbUC.js";t();export{e as initializeAnalyticsSink};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./sinks-Dc9V7k6a.js";export{e as initSinks};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-DR8-3Aex.js";import{i as t,r as n}from"./chokidar-SzksMqYp.js";import{Ct as r,Fr as i,Pr as a,cn as o,et as s,g as c,jr as ee,lr as l,nr as u,tr as te}from"./state-sIHsFpDu.js";import{Br as ne,Pr as re}from"./paths-Ci1iwL5Y.js";import{Q as ie,Z as ae,_ as oe,h as se,l as d,p as f}from"./debug-otxXY3j-.js";import{n as p,r as ce}from"./analytics-DqMQntaB.js";import{n as le,t as m}from"./cwd--iizewsn.js";import{$n as h,Am as ue,Cn as de,Co as fe,Di as g,Ed as pe,FE as me,Fc as he,Fr as ge,Gi as _e,Ic as ve,Jm as _,KE as ye,Km as be,Ny as xe,Ot as v,PE as y,Pt as b,Qk as x,Rt as S,Tt as C,Uo as w,Wi as T,Xm as E,Ym as D,_i as O,ad as k,ai as A,bn as j,by as M,gi as Se,i as N,jy as Ce,km as we,mh as P,na as Te,o as Ee,od as De,ph as Oe,qE as ke,qk as F,r as Ae,wi as I,xd as je,yy as L}from"./loadAgentsDir-C_wFhytF.js";import{Xt as Me}from"./prompt-6ZKyqv6z.js";import{f as Ne,l as Pe,t as Fe}from"./commitAttribution-iKd8bTOI.js";import{F as Ie,P as Le}from"./teamHelpers-D8R_gGLb.js";import{n as R,r as Re}from"./systemPromptSections-DY7epA2Y.js";import{r as ze}from"./asciicast-C_1Pi99k.js";import*as z from"path";import{dirname as Be}from"path";o(),Re(),we(),Ee(),Me(),ke(),x(),Pe(),je(),le(),d(),xe(),w(),re(),M(),Oe(),ge(),Le(),me(),v();function Ve(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=y().safeParse(i.todos);return a.success?a.data:[]}return[]}function He(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&Ce(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Fe(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!Ie()&&e.messages&&e.messages.length>0){let n=Ve(e.messages);if(n.length>0){let e=r();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function Ue(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ne(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t===`default`?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return u(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(u(r.agentType),!s()&&r.model&&r.model!==`inherit`&&te(ne(r.model)),{agentDefinition:r,agentType:r.agentType}):(f(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),u(void 0),{agentDefinition:void 0,agentType:void 0})}async function We(e,t,n,r){if(!e)return r;N.cache.clear?.();let i=await N(t),a=[...i.allAgents,...n];return{...i,allAgents:a,activeAgents:Ae(a)}}function H(e){let t=C();if(t){g(t);return}if(e){try{process.chdir(e.worktreePath)}catch{g(null);return}P(e.worktreePath),l(m()),b(e),F(),R(),L.cache.clear?.()}}function Ge(){let e=C();if(e){b(null),F(),R(),L.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}P(e.originalCwd),l(m())}}async function Ke(t,n,i){let a;if(a=i.modeApi?.matchSessionMode(t.mode),a&&t.messages.push(fe(a,`warning`)),n.forkSession)t.contentReplacements?.length&&await A(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(ee(ye(e),n.transcriptPath?Be(n.transcriptPath):null),await ze(),await Se(),ue(e))}if(O(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:i}=(De(),e(k)),a=new Map,o=n.sessionIdOverride??t.sessionId??r();a.set(o,t.goal),i(a,o)}n.forkSession||(H(t.worktreeSession),h());let{agentDefinition:o,agentType:s}=V(t.agentSetting,i.mainThreadAgentDefinition,i.agentDefinitions);I(i.modeApi?.isCoordinatorMode()?`coordinator`:`normal`);let c=n.includeAttribution?Ue(t):void 0,l=B(t.agentName,t.agentColor);pe(t.agentName);let u=await We(!!a,i.currentCwd,i.cliAgents,i.agentDefinitions);return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor===`default`?void 0:t.agentColor,restoredAgentDef:o,initialState:{...i.initialState,...s&&{agent:s},...c&&{attribution:c},...l&&{standaloneAgentContext:l},agentDefinitions:u}}}t(),o(),Te(),p(),D(),he(),ae(),d(),oe(),de(),i();var qe=1e3,Je=500,Ye=300,Xe=2e3,Ze=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=a(),Z=null;async function Qe(){if(K||q)return;K=!0,J||(J=!0,E(()=>{T(),X.emit()}));let e=await et();e.length!==0&&(f(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=n.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??qe,pollInterval:Z?.pollInterval??Je},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ze,interval:Z?.chokidarInterval??Xe,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=ie(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var $e=X.subscribe;async function et(){let e=se(),t=[],n=_(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=_(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=_(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=_(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of c()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){f(`Detected skill change: ${e}`),ce(`tengu_skill_file_changed`,{source:`chokidar`}),tt(e)}function tt(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),j(await S(`skills`,e[0]))){f(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}be(),_e(),ve(),X.emit()},Z?.reloadDebounce??Ye)}async function nt(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var rt={initialize:Qe,dispose:Q,subscribe:$e,resetForTesting:nt};export{V as a,Ke as i,B as n,He as o,Ge as r,H as s,rt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./featureCheck-j7P30mry.js";import{b as n,m as r,o as i}from"./skillGenerator-CBuoIFsH.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-DaKaKNVW.js";import{i as d}from"./observationStore-rLlDwRtG.js";import{a as f}from"./projectContext-Dn7umMp6.js";import{a as p,c as m,d as h,i as g}from"./sessionObserver-ardnTJ37.js";import{n as _}from"./toolEventObserver-DDJV8cvW.js";import{n as v}from"./skillGapStore-Wa7s6orv.js";var y=e((()=>{t(),a(),n(),s(),d(),u(),f(),c(),h(),p(),l(),o(),_(),g(),v(),i(),r(),m()}));export{y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./featureCheck-j7P30mry.js";import"./instinctParser-DOtj1Kni.js";import"./skillGenerator-CBuoIFsH.js";import{p as e}from"./runtimeObserver-DaKaKNVW.js";import{o as t}from"./observationStore-rLlDwRtG.js";import{c as n}from"./projectContext-Dn7umMp6.js";import"./sessionObserver-ardnTJ37.js";import"./toolEventObserver-DDJV8cvW.js";import"./skillGapStore-Wa7s6orv.js";import{t as r}from"./skillLearning-BI2YDG3K.js";r();export{e as loadInstincts,t as readObservations,n as resolveProjectContext};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./startupProfiler-CAntGAbs.js";t();export{e as profileCheckpoint};
|
|
@@ -1 +0,0 @@
|
|
|
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"./Settings-D5EWYL40.js";async function a(e,t){return(0,o.jsx)(i,{onClose:e,context:t,defaultTab:`Status`})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1 +0,0 @@
|
|
|
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"./BackgroundTasksDialog-OkUSMj0I.js";async function a(e,t){return(0,o.jsx)(i,{toolUseContext:t,onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./teamHelpers-D8R_gGLb.js";e();export{t as cleanupSessionTeams};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./teammateModeSnapshot-Bdra3VIJ.js";e();export{t as captureTeammateModeSnapshot};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fv as e,Hv as t,Lv as n,Pv as r,zv as i}from"./loadAgentsDir-C_wFhytF.js";e();export{r as checkOutTeleportedSessionBranch,n as processMessagesForTeleportResume,i as teleportResumeCodeSession,t as validateGitState};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./thinkback-CMsW7mvG.js";e();export{n as call,t as playAnimation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./toolPool-BJv0sBnR.js";e();export{t as applyCoordinatorToolFilter};
|