claude-code-best 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/chunks/{AddWorkspaceDirectory-DRO4tbYd.js → AddWorkspaceDirectory-BCCbaWoh.js} +1 -1
- package/dist/chunks/{App-DJyiiVKi.js → App-BIAYUFvT.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DygOEAkM.js → ApproveApiKey-DRARgWX3.js} +1 -1
- package/dist/chunks/ApproveApiKey-Do-Qth0X.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-C67mOxVi.js → AssistantSessionChooser-eUrEGDlX.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-Bqk_Cn3j.js → BackgroundTasksDialog-DSeAqhMC.js} +2 -2
- package/dist/chunks/{BypassPermissionsModeDialog-C4z7RkFV.js → BypassPermissionsModeDialog-8z7R5EpU.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-CyVFdjBe.js → ClaudeInChromeOnboarding-B7mDm5Hb.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-IpqqBuJs.js → ClaudeMdExternalIncludesDialog-DE9dpWtg.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DTZS-dek.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-UcQCmIWd.js +1 -0
- package/dist/chunks/{DesktopHandoff-CJpa8Xy-.js → DesktopHandoff-Ce0nE7D6.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-CfAuHVRL.js → DevChannelsDialog-mt0lA5wR.js} +1 -1
- package/dist/chunks/Dialog-91X6ZGg9.js +1 -0
- package/dist/chunks/{DiffDialog-CV3brWsG.js → DiffDialog-BfSnz8L-.js} +2 -2
- package/dist/chunks/{Doctor-D3GysagF.js → Doctor-BOVjkAKn.js} +1 -1
- package/dist/chunks/Doctor-osWC5WVY.js +1 -0
- package/dist/chunks/{ExitFlow-L2sh80sm.js → ExitFlow-C3BGvwv-.js} +1 -1
- package/dist/chunks/{Feedback-DfkBCvva.js → Feedback-BtZb1A8b.js} +1 -1
- package/dist/chunks/Grove-DyC_Wrfx.js +1 -0
- package/dist/chunks/{Grove-Bo74aZx-.js → Grove-HpMLktXp.js} +1 -1
- package/dist/chunks/{HybridTransport-BItIDJyC.js → HybridTransport-COk7jAC7.js} +1 -1
- package/dist/chunks/{ITermBackend-3iS8Bvmo.js → ITermBackend-BlwyeN8U.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-6lPGcuOX.js → InvalidConfigDialog-QVIRDXwA.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-D8DwHiys.js → InvalidSettingsDialog-CZRZm0oa.js} +1 -1
- package/dist/chunks/ListItem-DCQhApdJ.js +1 -0
- package/dist/chunks/{MCPConnectionManager-CsPizxTx.js → MCPConnectionManager-2Fulnp8q.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-Cepe7RPZ.js → McpParsingWarnings-DWMO0bV6.js} +1 -1
- package/dist/chunks/{MessageSelector-BzUQUeDn.js → MessageSelector-B4jJQ-KQ.js} +2 -2
- package/dist/chunks/Messages-ltcn1Qkf.js +11 -0
- package/dist/chunks/{Onboarding-BZUXID6q.js → Onboarding-CHcND5Tt.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Dhm7HBuD.js → OverageCreditUpsell-CMBqZrnz.js} +1 -1
- package/dist/chunks/{PermissionDialog-BrRBxx5o.js → PermissionDialog-R-Vl4Tk-.js} +1 -1
- package/dist/chunks/{PluginSettings-BZ-PX9Tg.js → PluginSettings-DIS_qrVA.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-DtA_p3X6.js → PressEnterToContinue-BYdiZwYD.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-Da8Fty6P.js → PromptInputFooterSuggestions-DAFZfAT0.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-Bz7EPzzq.js → PromptInputHelpMenu-CAwbW7z2.js} +1 -1
- package/dist/chunks/{QueryEngine-CmJK27jU.js → QueryEngine-BQs519Rb.js} +1 -1
- package/dist/chunks/REPL-DJh_wVWI.js +1 -0
- package/dist/chunks/{REPL-DxEJZpIp.js → REPL-Dx3SPe95.js} +13 -13
- package/dist/chunks/{RemoteCallout-DONJj8l2.js → RemoteCallout-CwI1mLQ9.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-BvvNspY8.js → RemoteSessionManager-BXMBhfQD.js} +1 -1
- package/dist/chunks/{ResumeConversation-EpjJdFHu.js → ResumeConversation-BK7L_YBI.js} +1 -1
- package/dist/chunks/{SSETransport-D51Jfdaj.js → SSETransport-Co-0nMlR.js} +1 -1
- package/dist/chunks/SearchBox-Bu4gYF0J.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-DVi-ggud.js +1 -0
- package/dist/chunks/SentryErrorBoundary-DLML64E_.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-nYTimi4l.js → SentryErrorBoundary-kEgE7qeH.js} +1 -1
- package/dist/chunks/{Settings-C2vEJjLx.js → Settings-DOve7mW1.js} +2 -2
- package/dist/chunks/{TeleportProgress--jgrqIfW.js → TeleportProgress--n-u7MYY.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-BKDaFT_L.js → TeleportRepoMismatchDialog-CzQzdYb2.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-CxlpiHIz.js → TeleportResumeWrapper-CtANoO1Z.js} +1 -1
- package/dist/chunks/{ThemePicker-CYL4C-F-.js → ThemePicker-kBt6obJb.js} +1 -1
- package/dist/chunks/{TmuxBackend-C_N4ww8i.js → TmuxBackend-Q5xdOkW4.js} +1 -1
- package/dist/chunks/{TrustDialog-CYdftZ1M.js → TrustDialog-CoCFqyRD.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-CaTwOP3f.js → ValidationErrorsList-CL42YlaS.js} +1 -1
- package/dist/chunks/{WelcomeV2-5rgKm4Mz.js → WelcomeV2-B0d9sH1c.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-BzoSs0VA.js → WindowsTerminalBackend-CLSeqqHh.js} +1 -1
- package/dist/chunks/{add-dir-RNzFR3XZ.js → add-dir-IrADCHV-.js} +1 -1
- package/dist/chunks/{agentDisplay-DgeOQY1E.js → agentDisplay-BUXpQhYh.js} +1 -1
- package/dist/chunks/{agents-iMtFurok.js → agents-BqQtaTaM.js} +1 -1
- package/dist/chunks/{agents-D7cgzb3f.js → agents-Cx0f6suK.js} +1 -1
- package/dist/chunks/{ant-CF1iRpXD.js → ant-BUkS8Em4.js} +1 -1
- package/dist/chunks/api-CoBZPEi-.js +1 -0
- package/dist/chunks/{api-DMbWqJlK.js → api-Cy1N7XAQ.js} +1 -1
- package/dist/chunks/{artifacts-D2kY_AMp.js → artifacts-DH8c2yG0.js} +1 -1
- package/dist/chunks/assistant-B2_c5C4T.js +1 -0
- package/dist/chunks/{assistant-CZ4VXgzH.js → assistant-BGzd9a5x.js} +1 -1
- package/dist/chunks/{assistant-JAqAZqaE.js → assistant-C3dP-BSJ.js} +1 -1
- package/dist/chunks/auth-CRVuUNwf.js +1 -0
- package/dist/chunks/{auth-BemPA3ot.js → auth-DVtMm7Hj.js} +1 -1
- package/dist/chunks/{autoMode-CGovMAzJ.js → autoMode-ThlM20qr.js} +1 -1
- package/dist/chunks/{autonomy-BVXyNEj0.js → autonomy-B637YdCF.js} +1 -1
- package/dist/chunks/{autonomy-BnAHLZWH.js → autonomy-B_vxYZbV.js} +1 -1
- package/dist/chunks/{autonomyPanel-COMI2iR0.js → autonomyPanel-BM2VhTsn.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BWAfdRVf.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-BRtG20l2.js → backgroundHousekeeping-Cll7XHG1.js} +2 -2
- package/dist/chunks/{banner-D_rqe2XQ.js → banner-DUL-7A0b.js} +1 -1
- package/dist/chunks/{branch-BnKwIQtC.js → branch-BlH5WYNu.js} +1 -1
- package/dist/chunks/{break-cache-CDzQDHwY.js → break-cache-DjCRzxDv.js} +1 -1
- package/dist/chunks/{bridge-ChVjEHVq.js → bridge-QRFJRzVG.js} +2 -2
- package/dist/chunks/{bridgeConfig-e0MGfed6.js → bridgeConfig-Di9LziJ3.js} +1 -1
- package/dist/chunks/bridgeConfig-pVTHa_ED.js +1 -0
- package/dist/chunks/bridgeEnabled-c_BeJX3S.js +1 -0
- package/dist/chunks/{bridgeEnabled-DR-v8AXw.js → bridgeEnabled-z1fPRzzV.js} +1 -1
- package/dist/chunks/bridgeMain-CHk_DCxy.js +1 -0
- package/dist/chunks/{bridgeMain-OsR-_PRp.js → bridgeMain-DVoobI7G.js} +11 -11
- package/dist/chunks/{bridgeMessaging-BvBnxgD4.js → bridgeMessaging-BG8fNZac.js} +1 -1
- package/dist/chunks/{btw-_b16RGoh.js → btw-DpeWZQbf.js} +1 -1
- package/dist/chunks/{buddy-DJ3QSQyd.js → buddy-Bni2g0Km.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-OhGSWZrB.js → bypassPermissionsKillswitch-7e56Rquc.js} +1 -1
- package/dist/chunks/caches-3byHT6VF.js +1 -0
- package/dist/chunks/{caches-Bp4F7tZ5.js → caches-CzEBsMvP.js} +2 -2
- package/dist/chunks/{ccrClient-D7pEGzQa.js → ccrClient-iR6zwGb1.js} +1 -1
- package/dist/chunks/changeDetector-Cg75mKOu.js +1 -0
- package/dist/chunks/channelNotification-BSmZprUZ.js +1 -0
- package/dist/chunks/{channelNotification-BZFMAWln.js → channelNotification-CSmLgwtO.js} +1 -1
- package/dist/chunks/{chrome-B5IxDA16.js → chrome-BO1vbvZ0.js} +1 -1
- package/dist/chunks/clear-CTOCrXv_.js +1 -0
- package/dist/chunks/client-BgdjJNnC.js +1 -0
- package/dist/chunks/{color-BYVWpzI8.js → color-BP4FmcMn.js} +1 -1
- package/dist/chunks/commands-CkfOhzGE.js +1 -0
- package/dist/chunks/commitAttribution-DKvggTZx.js +1 -0
- package/dist/chunks/{commitAttribution-ClSlXMPG.js → commitAttribution-Djh1ZpYH.js} +1 -1
- package/dist/chunks/{compact-B9c12JXf.js → compact-BtAvCkY0.js} +1 -1
- package/dist/chunks/{companion-C8e7dVlu.js → companion-C-jfFhlz.js} +1 -1
- package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
- package/dist/chunks/{completionCache-Br6OwASx.js → completionCache-C7hDqIDL.js} +1 -1
- package/dist/chunks/{config-Bxgfx_nO.js → config-CloXpblh.js} +1 -1
- package/dist/chunks/{config-C-yz-f4W.js → config-DwsIX0hc.js} +1 -1
- package/dist/chunks/{context-Bf5t6C-a.js → context-DdwMoH4j.js} +1 -1
- package/dist/chunks/{context-noninteractive-CJu7hZCM.js → context-noninteractive-BWbEqad6.js} +13 -13
- package/dist/chunks/context-noninteractive-DNOyQYnM.js +1 -0
- package/dist/chunks/{conversation-BYMS5Hqa.js → conversation-DR4MFYYi.js} +1 -1
- package/dist/chunks/conversation-DVhyJA1O.js +1 -0
- package/dist/chunks/{copy-C0BZ7Gm0.js → copy-tl-41wwU.js} +1 -1
- package/dist/chunks/{createSSHSession-DNXCWneI.js → createSSHSession-B_IyqOll.js} +1 -1
- package/dist/chunks/createSession-CIM50iEU.js +1 -0
- package/dist/chunks/{createSession-DjM6Ev45.js → createSession-Csaqw8kb.js} +1 -1
- package/dist/chunks/{cronJitterConfig-CaFkPXKB.js → cronJitterConfig-2sHTXBLu.js} +1 -1
- package/dist/chunks/crossProjectResume-C1I0X__e.js +40 -0
- package/dist/chunks/{datadog-ClZjR-jM.js → datadog-BzkFYNcv.js} +1 -1
- package/dist/chunks/datadog-vQKKqB6Z.js +1 -0
- package/dist/chunks/desktop-oTXppB2O.js +1 -0
- package/dist/chunks/{diff-D9hjPq4W.js → diff-B23DUoT8.js} +1 -1
- package/dist/chunks/{doctor-4-im_J_h.js → doctor-o2MJvjAE.js} +1 -1
- package/dist/chunks/{effort-Bz-9GIpe.js → effort-B1X_S_oa.js} +1 -1
- package/dist/chunks/entry-BAXMpXJ0.js +14 -0
- package/dist/chunks/envLessBridgeConfig-Dj0umjOo.js +1 -0
- package/dist/chunks/{envLessBridgeConfig-DW4-nPbZ.js → envLessBridgeConfig-YNTOVEqU.js} +1 -1
- package/dist/chunks/{exit-DBNDTR4b.js → exit-CwGJifQF.js} +1 -1
- package/dist/chunks/{export-CQHUM_Nv.js → export-CqbYdFmJ.js} +1 -1
- package/dist/chunks/{exportRenderer-CuIDQBLH.js → exportRenderer-DP_z8YD1.js} +1 -1
- package/dist/chunks/extra-usage-1FUBiJOE.js +1 -0
- package/dist/chunks/{extra-usage-DTr6gExD.js → extra-usage-BQ5Z1wJb.js} +1 -1
- package/dist/chunks/{extra-usage-core-D3CwYO_8.js → extra-usage-core-B1oJoxYa.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-d-QVg1D5.js → extra-usage-noninteractive-BV_6cpdd.js} +1 -1
- package/dist/chunks/{extraUsage-BNRQOkgU.js → extraUsage-Ca_6qcke.js} +1 -1
- package/dist/chunks/extractMemories-B-yrLjpP.js +1 -0
- package/dist/chunks/{fast-bkGXbuHX.js → fast-BJMGfO_S.js} +1 -1
- package/dist/chunks/fast-CFtN26up.js +1 -0
- package/dist/chunks/{feedback-BvFgE_FF.js → feedback-O0Gushxg.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-D-ifHvWu.js → firstPartyEventLogger-0s2WJ6SR.js} +1 -1
- package/dist/chunks/{flushGate-BA24vFBg.js → flushGate-CLjpgnG6.js} +1 -1
- package/dist/chunks/{fpsMetrics-CBFlAGTS.js → fpsMetrics-DH78PzGr.js} +1 -1
- package/dist/chunks/gates-4fq2Ws2D.js +1 -0
- package/dist/chunks/{gates-C66Nz9b2.js → gates-C5y8P5t9.js} +1 -1
- package/dist/chunks/{gemini-DuQl4hTA.js → gemini-D6lfJRGH.js} +1 -1
- package/dist/chunks/{generateRecap-CwBU76xi.js → generateRecap-AYujRzfu.js} +1 -1
- package/dist/chunks/{generateSessionName-LnmjE9jh.js → generateSessionName-CXg1uVLN.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-DrreQj47.js → githubRepoPathMapping-CdjkMIX3.js} +1 -1
- package/dist/chunks/{goal-BIvjF6B7.js → goal-BGr-SlcA.js} +1 -1
- package/dist/chunks/{grok-KNLYSRBQ.js → grok-DxyRt4Jq.js} +1 -1
- package/dist/chunks/{growthbook-ksjGAskq.js → growthbook-D93ZmHUL.js} +1 -1
- package/dist/chunks/{heapdump-Cz8vkcOr.js → heapdump-DZz5qnZg.js} +1 -1
- package/dist/chunks/{help-Cx9OordP.js → help-C8HhaC70.js} +1 -1
- package/dist/chunks/hooks-CmW7bdtz.js +1 -0
- package/dist/chunks/{hooks-BW-d9Bdu.js → hooks-De2yBPig.js} +1 -1
- package/dist/chunks/{hostAdapter-DLmaB6eN.js → hostAdapter-CZdJUeS1.js} +1 -1
- package/dist/chunks/{ide-CECrIg1r.js → ide-GnSLasRI.js} +1 -1
- package/dist/chunks/{inboundAttachments-B0sGIu79.js → inboundAttachments-C8y3D5mp.js} +1 -1
- package/dist/chunks/inboundAttachments-DZiITyN8.js +1 -0
- package/dist/chunks/{initReplBridge-BAEMZEcg.js → initReplBridge-YGXqLbNZ.js} +1 -1
- package/dist/chunks/{insights-DeWggLxC.js → insights-23tyPxXV.js} +1 -1
- package/dist/chunks/{install-pxH_HR1p.js → install-BXi4d63r.js} +1 -1
- package/dist/chunks/{install-github-app-DqKEiHQ1.js → install-github-app-D2X7BgzJ.js} +1 -1
- package/dist/chunks/{install-slack-app-P1L9x-YI.js → install-slack-app-_J1t0kSP.js} +1 -1
- package/dist/chunks/{instrumentation-Dx0s2jzr.js → instrumentation-C9WDRy-K.js} +3 -3
- package/dist/chunks/{job-CbxxkPgE.js → job-DXX7dNN_.js} +1 -1
- package/dist/chunks/{keybindings-BBPC7FAc.js → keybindings-CChhkkE0.js} +1 -1
- package/dist/chunks/{lang-CKp0Tn76.js → lang-COIVItM_.js} +1 -1
- package/dist/chunks/language-CiMwEWO-.js +1 -0
- package/dist/chunks/{language-iERMuOEu.js → language-DzWvcLCu.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-DQvKVtl2.js → launchAgentsPlatform-Du_WvKeU.js} +1 -1
- package/dist/chunks/{launchAutofixPr-B7hu9C8h.js → launchAutofixPr-CypNniKH.js} +1 -1
- package/dist/chunks/{launchCommand-CJsikSlW.js → launchCommand-9eYsPG7W.js} +1 -1
- package/dist/chunks/{launchLocalMemory-Cpz7L5j5.js → launchLocalMemory-GkqB_Gcr.js} +1 -1
- package/dist/chunks/{launchLocalVault-XLfOQtP7.js → launchLocalVault-CBihJDzq.js} +1 -1
- package/dist/chunks/{launchMemoryStores-Cz04PaDE.js → launchMemoryStores-BkK0wwq0.js} +1 -1
- package/dist/chunks/{launchOnboarding-XPbUNdHS.js → launchOnboarding-BubTG5vY.js} +1 -1
- package/dist/chunks/{launchSchedule-B1VEe3o-.js → launchSchedule-CkV6Ai-0.js} +1 -1
- package/dist/chunks/{launchSkillStore-Cy59z5xx.js → launchSkillStore-DIrFg_WZ.js} +1 -1
- package/dist/chunks/{launchTeleport-ZPM_DvzK.js → launchTeleport-DFrgN9sU.js} +1 -1
- package/dist/chunks/{launchVault-BhnTOZq8.js → launchVault-CIiNsg91.js} +1 -1
- package/dist/chunks/loadAgentsDir-CjhNkoq0.js +1 -0
- package/dist/chunks/{loadAgentsDir-CQF8qhne.js → loadAgentsDir-DC4jN6-f.js} +777 -777
- package/dist/chunks/{loadPluginHooks-TyULD8KH.js → loadPluginHooks-DukITDP2.js} +1 -1
- package/dist/chunks/{localSearch-BNYypHsK.js → localSearch-But4wyLg.js} +1 -1
- package/dist/chunks/localSearch-D8FFon8N.js +1 -0
- package/dist/chunks/login-B3TV33p4.js +1 -0
- package/dist/chunks/{login-CxbcJk9_.js → login-ajsn1Sg7.js} +1 -1
- package/dist/chunks/{logoV2Utils-Br_w1z39.js → logoV2Utils-CpeUvaOM.js} +1 -1
- package/dist/chunks/logout-BqbTEPv9.js +1 -0
- package/dist/chunks/{magicDocs-DnxdS9yV.js → magicDocs-TF6U6QoB.js} +1 -1
- package/dist/chunks/{main-FBmdv32j.js → main-bjQRqaUr.js} +31 -31
- package/dist/chunks/mappers-Bg-xtimK.js +1 -0
- package/dist/chunks/{mcp-BhAGhDQE.js → mcp-DtHGTZUo.js} +1 -1
- package/dist/chunks/{mcp-esqdO_lV.js → mcp-Vj0ijoSq.js} +3 -3
- package/dist/chunks/{mcp-DbqUZ1Cf.js → mcp-i8lqdWTr.js} +1 -1
- package/dist/chunks/{mcpServer-DeL2ADSF.js → mcpServer-CuqaXxiJ.js} +1 -1
- package/dist/chunks/{mcpServer-Ct-GVL-y.js → mcpServer-Dr9UfcEd.js} +1 -1
- package/dist/chunks/{memory-DwapBEsD.js → memory-DVJxsbcO.js} +1 -1
- package/dist/chunks/{mobile-D7MSmMhc.js → mobile-DLGq6g08.js} +1 -1
- package/dist/chunks/{modalContext-DxfeT_3m.js → modalContext-CuTwi_eD.js} +1 -1
- package/dist/chunks/{mode-B5cmHCvz.js → mode-C9yWWppB.js} +1 -1
- package/dist/chunks/model-BYSyXf9-.js +1 -0
- package/dist/chunks/{model-BePO0VaC.js → model-Dq-13vaB.js} +1 -1
- package/dist/chunks/{onChangeAppState-B3d5iy6T.js → onChangeAppState-Cc4zOnqx.js} +1 -1
- package/dist/chunks/{openai-fRhGOIQq.js → openai-DMCGGZts.js} +1 -1
- package/dist/chunks/{overageCreditGrant-B6sx7IFi.js → overageCreditGrant-CzkWDmsQ.js} +1 -1
- package/dist/chunks/{panel-CAVG5BOM.js → panel-BY6q16am.js} +1 -1
- package/dist/chunks/{panel-DU8y_jcf.js → panel-BdRBXAv3.js} +1 -1
- package/dist/chunks/panelCall-D36EWzwF.js +1 -0
- package/dist/chunks/{passes-CWPPUigp.js → passes-CPAwB9_F.js} +1 -1
- package/dist/chunks/{paths-4ZWdjPP4.js → paths-CEAy4QCs.js} +3 -3
- package/dist/chunks/{permissions-DW8CRuJp.js → permissions-B39hfy0O.js} +1 -1
- package/dist/chunks/{pipeTransport-CUeYRWJn.js → pipeTransport-7auNUakO.js} +1 -1
- package/dist/chunks/{plan-Cf-tHvGq.js → plan-pCEs76NM.js} +1 -1
- package/dist/chunks/plugin-BSC-7wQh.js +1 -0
- package/dist/chunks/{pluginAutoupdate-CdmKzIRf.js → pluginAutoupdate-Cre72Rtf.js} +1 -1
- package/dist/chunks/{pluginBlocklist-C9XwbFSo.js → pluginBlocklist-D2Cj4TR2.js} +1 -1
- package/dist/chunks/{pluginCliCommands-CmY_maYg.js → pluginCliCommands-CTxmCPph.js} +1 -1
- package/dist/chunks/{pluginFlagging-DyzxZolj.js → pluginFlagging-C5EGcjZe.js} +1 -1
- package/dist/chunks/{pluginOperations-mr4I7Jw9.js → pluginOperations-DDI1CG0K.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-B6OdK29Z.js → pluginStartupCheck-B3QqfRt6.js} +1 -1
- package/dist/chunks/pluginStartupCheck-DYC8CWxw.js +1 -0
- package/dist/chunks/{plugins-rdPgpjF8.js → plugins-Bz7JxD43.js} +1 -1
- package/dist/chunks/policyLimits-C-oHygGe.js +1 -0
- package/dist/chunks/{pollConfig-DLbuHBse.js → pollConfig-CyO4Ycwc.js} +1 -1
- package/dist/chunks/{poor-pmz2b7zu.js → poor-eRoBwI0Z.js} +1 -1
- package/dist/chunks/{poorMode-DD-q_w6Z.js → poorMode-BdNsLBQ-.js} +1 -1
- package/dist/chunks/poorMode-D2-4vRxb.js +1 -0
- package/dist/chunks/{print-luaON-Cg.js → print-Ogibzjap.js} +4 -4
- package/dist/chunks/{privacy-settings-BpigC4oX.js → privacy-settings-Dd7PtKbY.js} +1 -1
- package/dist/chunks/{processBashCommand-f_84bSlP.js → processBashCommand-BjdUo_Na.js} +1 -1
- package/dist/chunks/{processSlashCommand-BkBqV3Jd.js → processSlashCommand-tetvMLMl.js} +1 -1
- package/dist/chunks/projectContext-2CzYVggO.js +1 -0
- package/dist/chunks/projectContext-CVk2Ix1r.js +1 -0
- package/dist/chunks/prompt-BHI7PZe4.js +227 -0
- package/dist/chunks/prompt-DZ1EAUlC.js +1 -0
- package/dist/chunks/prompt-DeRHlPn1.js +1 -0
- package/dist/chunks/{promptEditor-C___2FFs.js → promptEditor-DoJ-xPi4.js} +1 -1
- package/dist/chunks/{protocolHandler-qwll5gSY.js → protocolHandler-Dgzu5UWb.js} +1 -1
- package/dist/chunks/{rate-limit-options-nQcTipEp.js → rate-limit-options-B6QH2-xn.js} +1 -1
- package/dist/chunks/{rcDebugLog-DOXxIr8l.js → rcDebugLog-C0Bam8V9.js} +1 -1
- package/dist/chunks/{referral-CMPZjf3I.js → referral-B10JtHMk.js} +1 -1
- package/dist/chunks/{refresh-CP7Dnjp4.js → refresh-DmEsCaJ0.js} +1 -1
- package/dist/chunks/{registerProtocol-DCNuqdCC.js → registerProtocol-CQjmvg7a.js} +1 -1
- package/dist/chunks/{registry-DLqZJleQ.js → registry-CLaXh4Gk.js} +1 -1
- package/dist/chunks/{release-notes-BsDW6T9f.js → release-notes-dxng0ob_.js} +1 -1
- package/dist/chunks/{releaseNotes-Tbd018Qz.js → releaseNotes-CS5L5W0H.js} +2 -2
- package/dist/chunks/{reload-plugins-iG9ZE9wF.js → reload-plugins-CgzAjBDp.js} +1 -1
- package/dist/chunks/{remote-env-BFntnltf.js → remote-env-BasfU8Ra.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Dpko9c-J.js → remoteBridgeCore-IJI5koHz.js} +1 -1
- package/dist/chunks/{remoteControlServer-D3P82kVF.js → remoteControlServer-BBCt7ySV.js} +1 -1
- package/dist/chunks/{rename-Codm2nfB.js → rename-eEdSZsJ2.js} +1 -1
- package/dist/chunks/{resume-BB1ceL_x.js → resume-DjnfattK.js} +1 -1
- package/dist/chunks/{runtimeObserver-D6aF77Dq.js → runtimeObserver-ByTBtmBf.js} +2 -2
- package/dist/chunks/{runtimeObserver-BpRn0RiL.js → runtimeObserver-COpkJmg-.js} +1 -1
- package/dist/chunks/sandbox-adapter-DagBhoTC.js +1 -0
- package/dist/chunks/{sandbox-toggle-DZ-8qXDS.js → sandbox-toggle-CQohaYND.js} +1 -1
- package/dist/chunks/searchExtraTools-kk-wV-cC.js +1 -0
- package/dist/chunks/{sentry-CVdHlmNQ.js → sentry-C0bQlih_.js} +1 -1
- package/dist/chunks/{session-B4j1ViVc.js → session-Dx_ODOHl.js} +1 -1
- package/dist/chunks/{sessionDiscovery-DkIIFsWX.js → sessionDiscovery-DAqs0Ra6.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-C-Ic-0Ry.js +1 -0
- package/dist/chunks/sessionMemory-BMtFup-Y.js +1 -0
- package/dist/chunks/{sessionMemory-CnT3-Mj7.js → sessionMemory-Bq3ECr1S.js} +1 -1
- package/dist/chunks/sessionMemoryUtils-BU7N_IQG.js +1 -0
- package/dist/chunks/sessionObserver-BwAfzGUg.js +1 -0
- package/dist/chunks/{sessionObserver-gjdJ91cv.js → sessionObserver-rd6RRTzc.js} +1 -1
- package/dist/chunks/sessionStorage-X2u45U9z.js +1 -0
- package/dist/chunks/{sessionTitle-CSU5-VK9.js → sessionTitle-1k_2BhFL.js} +1 -1
- package/dist/chunks/{sessionTracing-BDN64fWh.js → sessionTracing-DNSDPYdR.js} +1 -1
- package/dist/chunks/{settingsSync-Nixbcaox.js → settingsSync-3xG2A_wN.js} +1 -1
- package/dist/chunks/{setup-n3Ixr_gs.js → setup-C2V4elOv.js} +2 -2
- package/dist/chunks/{setup-CZxLEcQh.js → setup-CY808VaY.js} +1 -1
- package/dist/chunks/{setup-9nXlu56r.js → setup-Hlga8GJ_.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-CCS7R7F1.js → shadowedRuleDetection-BdBNo5eP.js} +1 -1
- package/dist/chunks/{sideQuestion-MzExGTvn.js → sideQuestion-DWOCUKMh.js} +1 -1
- package/dist/chunks/{sink-BL75jACh.js → sink-DCh0VJ4g.js} +1 -1
- package/dist/chunks/sink-nZmawD5W.js +1 -0
- package/dist/chunks/sinks-BTZnXPr_.js +1 -0
- package/dist/chunks/{sinks-C-gxj_Eu.js → sinks-_9T2oPB_.js} +2 -2
- package/dist/chunks/{skill-learning-B9Msm4jG.js → skill-learning-CzZFGFZO.js} +2 -2
- package/dist/chunks/{skillChangeDetector-DlWPJTny.js → skillChangeDetector-345QNWDp.js} +1 -1
- package/dist/chunks/{skillGapStore-CsADiV5a.js → skillGapStore-Bz_qbwI1.js} +2 -2
- package/dist/chunks/{skillGapStore-Cpmbwyo3.js → skillGapStore-DJm3SULe.js} +1 -1
- package/dist/chunks/{skillGenerator-_khb-Gmc.js → skillGenerator-BcNv-VZ5.js} +2 -2
- package/dist/chunks/skillLearning-BJAfTX2G.js +1 -0
- package/dist/chunks/skillLearning-DPhuKS4j.js +1 -0
- package/dist/chunks/{skillPanel-DQmj3Yh1.js → skillPanel-Q85P-Gg4.js} +3 -3
- package/dist/chunks/{skillSearchPanel-6w_zzoI3.js → skillSearchPanel-CMCQDAcX.js} +2 -2
- package/dist/chunks/{skills-B3LN9tp9.js → skills-D3eUg3HG.js} +1 -1
- package/dist/chunks/{sprites-8JVWnXzp.js → sprites-ChoMSqpa.js} +1 -1
- package/dist/chunks/{src-KjMLauwe.js → src-Di342QoJ.js} +1 -1
- package/dist/chunks/{src-BJM0zMNO.js → src-poaoYkuc.js} +1 -1
- package/dist/chunks/startupProfiler-CBcN1Chw.js +3 -0
- package/dist/chunks/startupProfiler-DtTgsdnI.js +1 -0
- package/dist/chunks/{staticRender-DboURbK0.js → staticRender-DKFIRhkH.js} +1 -1
- package/dist/chunks/{stats-BDlygx5X.js → stats-DdhEa_6-.js} +1 -1
- package/dist/chunks/status-CX7Kgn21.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-Cd_LDPvn.js → statusNoticeHelpers-AibXOONm.js} +1 -1
- package/dist/chunks/{tag-BLPgXlQZ.js → tag-BJ_u3aJm.js} +1 -1
- package/dist/chunks/tasks-DeEWOchP.js +1 -0
- package/dist/chunks/teamHelpers-CxoQp7OY.js +1 -0
- package/dist/chunks/{teamHelpers-B-poMJeE.js → teamHelpers-WmWa_h3B.js} +1 -1
- package/dist/chunks/{teammateModeSnapshot-B1_3D1CQ.js → teammateModeSnapshot-DZ6ulELC.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-KWxn1jxl.js +1 -0
- package/dist/chunks/{teleport-CSo3PT05.js → teleport-CuDXJj_f.js} +1 -1
- package/dist/chunks/{templateJobs-BVebX2BK.js → templateJobs-nFBp68za.js} +1 -1
- package/dist/chunks/{terminalSetup-DZTEKKne.js → terminalSetup-BORjK3qH.js} +1 -1
- package/dist/chunks/{terminalSetup-DHWL0gnz.js → terminalSetup-DULcnnWe.js} +1 -1
- package/dist/chunks/{theme-BHQSNwSe.js → theme-Bf2QD0ja.js} +1 -1
- package/dist/chunks/thinkback-C1nnGg5r.js +1 -0
- package/dist/chunks/{thinkback-DOzxcgMy.js → thinkback-DZEhr3Ii.js} +1 -1
- package/dist/chunks/{thinkback-play-CK1C_F7G.js → thinkback-play-BtEBESXM.js} +1 -1
- package/dist/chunks/{toolEventObserver-XPorjjtG.js → toolEventObserver-CNZy5TpN.js} +1 -1
- package/dist/chunks/{toolEventObserver-BIjUIh4k.js → toolEventObserver-DMdrez6V.js} +1 -1
- package/dist/chunks/toolPool-DDj2TbY6.js +1 -0
- package/dist/chunks/{toolPool-hQlvQn-j.js → toolPool-DHQyHmDY.js} +1 -1
- package/dist/chunks/{trustedDevice-D-L5uAor.js → trustedDevice-DWb5CPB_.js} +1 -1
- package/dist/chunks/{trustedDevice-CyfQd_GU.js → trustedDevice-Dw2crViN.js} +1 -1
- package/dist/chunks/{tui-C7aBeORE.js → tui-DcXIK0fP.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-rnMsUWTn.js → ultrareviewCommand-BfN25zni.js} +1 -1
- package/dist/chunks/undercover-DSp7SB7e.js +1 -0
- package/dist/chunks/{undercover-ClLYK52H.js → undercover-rcR56jZx.js} +1 -1
- package/dist/chunks/{updateCCB-pqkACWbs.js → updateCCB-DlTAqQJq.js} +1 -1
- package/dist/chunks/{upgrade-DpfZlPyC.js → upgrade-ClLcX7zy.js} +1 -1
- package/dist/chunks/upgrade-kf1QWUo7.js +1 -0
- package/dist/chunks/{upload-D98tqZnO.js → upload-BqEzK59v.js} +1 -1
- package/dist/chunks/{usage-CRquq5_O.js → usage-BgKDh8pQ.js} +1 -1
- package/dist/chunks/{usage-BWd5R6DU.js → usage-DW-akzSR.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js → useExitOnCtrlCDWithKeybindings-BHi41Ku_.js} +1 -1
- package/dist/chunks/useKeybinding-DPOUuymz.js +1 -0
- package/dist/chunks/useMainLoopModel-BTpZ8k3k.js +1 -0
- package/dist/chunks/{useManagePlugins-DMY74XAk.js → useManagePlugins-z0qezP5r.js} +1 -1
- package/dist/chunks/{useMergedTools-NN58Kguw.js → useMergedTools-B78rAreW.js} +1 -1
- package/dist/chunks/{useSearchInput-CodP_5SB.js → useSearchInput-CwxF3CHN.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BRxaYl6B.js → useSettingsErrors-CjDaon07.js} +1 -1
- package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
- package/dist/chunks/{useVoice-ByU-q_w4.js → useVoice-X5WSnyed.js} +1 -1
- package/dist/chunks/{util-SpgBY5_I.js → util-CP-_gsEO.js} +1 -1
- package/dist/chunks/utils-CULcnflj.js +1 -0
- package/dist/chunks/{validatePlugin-CxCXNV8o.js → validatePlugin-DUuaprqR.js} +1 -1
- package/dist/chunks/{vim-ByXlYzf9.js → vim-BfmsdxOa.js} +1 -1
- package/dist/chunks/{voice-BnLS_SdQ.js → voice-B3GIfFlB.js} +1 -1
- package/dist/chunks/voiceModeEnabled-BrA5ZhH4.js +1 -0
- package/dist/chunks/{voiceModeEnabled-D070o6QK.js → voiceModeEnabled-C1Q9j5q6.js} +1 -1
- package/dist/chunks/{voiceStreamSTT-vkQ-Aop7.js → voiceStreamSTT-BguyxdrW.js} +1 -1
- package/dist/chunks/voiceStreamSTT-Dmp7Vm1S.js +1 -0
- package/dist/chunks/{web-tools-1yM0ZBfA.js → web-tools-qf_VwWRn.js} +1 -1
- package/dist/chunks/{workerRegistry-7xGv_sNB.js → workerRegistry-SbiLJIsG.js} +1 -1
- package/dist/chunks/worktree-Djga1wtm.js +1 -0
- package/dist/chunks/{xml-BUaEXGXx.js → xml-D7-jJqSA.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-oTZKoMvB.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-5FCT81WS.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-BmGziW64.js +0 -1
- package/dist/chunks/Dialog-C8eGKH-e.js +0 -1
- package/dist/chunks/Doctor-DohPtIKu.js +0 -1
- package/dist/chunks/Grove-C_ocvHd3.js +0 -1
- package/dist/chunks/ListItem-DDMe4CJ3.js +0 -1
- package/dist/chunks/Messages-KmeXIJqL.js +0 -11
- package/dist/chunks/REPL-BBmn_itf.js +0 -1
- package/dist/chunks/SearchBox-CciJ8giD.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-kjVFsFkT.js +0 -1
- package/dist/chunks/SentryErrorBoundary-DsrmgmKF.js +0 -1
- package/dist/chunks/api-DkgaFAzq.js +0 -1
- package/dist/chunks/assistant-CiNV3Q0f.js +0 -1
- package/dist/chunks/auth-CbQCc9vz.js +0 -1
- package/dist/chunks/backgroundHousekeeping-LYpOamcN.js +0 -1
- package/dist/chunks/bridgeConfig-Budgp2Go.js +0 -1
- package/dist/chunks/bridgeEnabled-DmvmwuUY.js +0 -1
- package/dist/chunks/bridgeMain-KYR5iq6H.js +0 -1
- package/dist/chunks/caches-CkH9F-Fd.js +0 -1
- package/dist/chunks/ccshareResume-DPP1blaU.js +0 -1
- package/dist/chunks/changeDetector-IFbty4jj.js +0 -1
- package/dist/chunks/channelNotification-CIyWY0hs.js +0 -1
- package/dist/chunks/clear-BVjSQsUL.js +0 -1
- package/dist/chunks/client-BUUsZdSe.js +0 -1
- package/dist/chunks/commands-pTQdOvN6.js +0 -1
- package/dist/chunks/commitAttribution-QPrKt_BF.js +0 -1
- package/dist/chunks/completionCache-BB7-y2BX.js +0 -1
- package/dist/chunks/context-noninteractive-OUTZ6BKj.js +0 -1
- package/dist/chunks/conversation-Bs8l0KNl.js +0 -1
- package/dist/chunks/createSession-DpqtD4ML.js +0 -1
- package/dist/chunks/crossProjectResume-BCr6jfGz.js +0 -40
- package/dist/chunks/datadog-DlzPb5oG.js +0 -1
- package/dist/chunks/desktop-WH8s-9-6.js +0 -1
- package/dist/chunks/entry-CEBaLwEG.js +0 -14
- package/dist/chunks/envLessBridgeConfig-izoVnE8s.js +0 -1
- package/dist/chunks/extra-usage-VSASGlte.js +0 -1
- package/dist/chunks/extractMemories-hQlhiVOD.js +0 -1
- package/dist/chunks/fast-2gWrhEFZ.js +0 -1
- package/dist/chunks/gates-dO6m4Hdp.js +0 -1
- package/dist/chunks/hooks-BWoN0nQP.js +0 -1
- package/dist/chunks/inboundAttachments-D8vq1NQO.js +0 -1
- package/dist/chunks/language-CSDpzbTz.js +0 -1
- package/dist/chunks/loadAgentsDir-B-4D2dVE.js +0 -1
- package/dist/chunks/localSearch-DsFH9yls.js +0 -1
- package/dist/chunks/login-CEJEl2mW.js +0 -1
- package/dist/chunks/logout-BXr4jzNY.js +0 -1
- package/dist/chunks/mappers-BNI_df3v.js +0 -1
- package/dist/chunks/model-CgH43-hO.js +0 -1
- package/dist/chunks/panelCall-DUQdjDee.js +0 -1
- package/dist/chunks/plugin-DXhCgoNC.js +0 -1
- package/dist/chunks/pluginStartupCheck-BFuZqpnX.js +0 -1
- package/dist/chunks/policyLimits-B3dtp_Fe.js +0 -1
- package/dist/chunks/poorMode-BPIUnFFi.js +0 -1
- package/dist/chunks/projectContext-2Z2w8AI8.js +0 -1
- package/dist/chunks/projectContext-fS1t-xRh.js +0 -1
- package/dist/chunks/prompt-CogZQuTN.js +0 -227
- package/dist/chunks/prompt-CriAIdkT.js +0 -1
- package/dist/chunks/prompt-TGc_H1cL.js +0 -1
- package/dist/chunks/sandbox-adapter-DrHD1mch.js +0 -1
- package/dist/chunks/searchExtraTools-Dwg6ZafS.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-n7HcOfZ7.js +0 -1
- package/dist/chunks/sessionMemory-DVq43VXP.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BjkdLRvh.js +0 -1
- package/dist/chunks/sessionObserver-CrfmnMzL.js +0 -1
- package/dist/chunks/sessionStorage-BTbr9wkZ.js +0 -1
- package/dist/chunks/sink-CoUVbLFs.js +0 -1
- package/dist/chunks/sinks-wuo1yQ_m.js +0 -1
- package/dist/chunks/skillLearning-CFnZiM5J.js +0 -1
- package/dist/chunks/skillLearning-D6mvGN90.js +0 -1
- package/dist/chunks/startupProfiler-BmnoJtfF.js +0 -1
- package/dist/chunks/startupProfiler-rCtNuhXz.js +0 -3
- package/dist/chunks/status-DlT1tUmc.js +0 -1
- package/dist/chunks/tasks-Bf1Nf3WX.js +0 -1
- package/dist/chunks/teamHelpers-DeQCfdgu.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BRuKcJNr.js +0 -1
- package/dist/chunks/thinkback-CVYpxAyO.js +0 -1
- package/dist/chunks/toolPool-CDEeuQd2.js +0 -1
- package/dist/chunks/undercover-BviGW-bQ.js +0 -1
- package/dist/chunks/upgrade-DAuhXFVI.js +0 -1
- package/dist/chunks/useKeybinding-DOjEx42R.js +0 -1
- package/dist/chunks/useMainLoopModel-BZoZdEdj.js +0 -1
- package/dist/chunks/useTerminalSize-mqo2Swmk.js +0 -1
- package/dist/chunks/utils-CM5oEyAY.js +0 -1
- package/dist/chunks/voiceModeEnabled-B3njLfhA.js +0 -1
- package/dist/chunks/voiceStreamSTT-BkeyhhFJ.js +0 -1
- package/dist/chunks/worktree-UA9gKCwL.js +0 -1
- /package/dist/chunks/{chromeNativeHost-DfYuJafI.js → chromeNativeHost-BldB1Zzi.js} +0 -0
- /package/dist/chunks/{claudeDesktop-CEQCLZmG.js → claudeDesktop-BqTW_pbB.js} +0 -0
- /package/dist/chunks/{cleanup-DUVwlFl7.js → cleanup-rCLlo4w8.js} +0 -0
- /package/dist/chunks/{eventLoopStallDetector-MNrFR4OH.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
- /package/dist/chunks/{postCommitAttribution-Br4g4R6h.js → postCommitAttribution-D8MoHFoz.js} +0 -0
- /package/dist/chunks/{sdkHeapDumpMonitor-DTHI5WbD.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
- /package/dist/chunks/{sessionDataUploader-BgmJTXQr.js → sessionDataUploader-CsNePsOb.js} +0 -0
- /package/dist/chunks/{udsClient-B85rNglp.js → udsClient-CBF_cZFW.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-Di342QoJ.js";import{cn as r,dn as i}from"./state-sIHsFpDu.js";import{H as a,U as o}from"./debug-otxXY3j-.js";import{o as s,s as c}from"./log-DSV4Ht5l.js";import{AT as l,Al as u,Cl as d,Cn as f,El as p,Hk as m,Ol as h,Po as g,Tk as _,Tl as v,Uk as y,Uo as b,Wk as x,Zt as S,__ as C,_l as w,cA as T,dA as E,dd as D,dt as O,fA as k,fd as A,ft as j,g_ as M,hl as N,iA as P,jT as F,jk as I,kl as L,rA as R,sA as z,wl as B,xl as V}from"./loadAgentsDir-DC4jN6-f.js";async function H(e,t,n,r){t.onCompactProgress?.({type:`hooks_start`,hookType:`pre_compact`}),t.setSDKStatus?.(`compacting`);try{let[i,a]=await Promise.all([S({trigger:`manual`,customInstructions:n||null},t.abortController.signal),W(t,e)]),o=u(n,i.newCustomInstructions);t.setStreamMode?.(`requesting`),t.setResponseLength?.(()=>0),t.onCompactProgress?.({type:`compact_start`});let s=await r.reactiveCompactOnPromptTooLong(e,a,{customInstructions:o,trigger:`manual`});if(!s.ok)switch(s.reason){case`too_few_groups`:throw Error(v);case`aborted`:throw Error(p);case`exhausted`:case`error`:case`media_unstrippable`:throw Error(B)}I(void 0),d(),T(),y.cache.clear?.();let c=[i.userDisplayMessage,s.result.userDisplayMessage].filter(Boolean).join(`
|
|
2
2
|
`)||void 0;return{type:`compact`,compactionResult:{...s.result,userDisplayMessage:c},displayText:U(t,c)}}finally{t.setStreamMode?.(`requesting`),t.setResponseLength?.(()=>0),t.onCompactProgress?.({type:`compact_end`}),t.setSDKStatus?.(``)}}function U(e,n){let r=M(`tip`),i=l(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...n?[n]:[],...r?[r]:[]];return t.dim(`Compacted `+a.join(`
|
|
3
3
|
`))}async function W(e,t){let n=e.getAppState(),r=await O(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=D({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,o]=await Promise.all([y(),m()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var G,K;e((()=>{n(),r(),j(),x(),F(),E(),L(),z(),R(),V(),N(),_(),o(),f(),s(),b(),C(),A(),G=null,K=async(e,t)=>{let{abortController:n}=t,{messages:r}=t;if(r=g(r),r.length===0)throw Error(`No messages to compact`);let o=e.trim();try{if(!o){let e=await w(r,t.agentId);if(e)return y.cache.clear?.(),d(),k(t.options.querySource??`compact`,t.agentId),i(),T(),{type:`compact`,compactionResult:e,displayText:U(t)}}if(G?.isReactiveOnlyMode())return await H(r,t,o,G);let e=(await P(r,t)).messages,n=await h(e,t,await W(t,e),!1,o,!1);return I(void 0),T(),y.cache.clear?.(),d(),{type:`compact`,compactionResult:n,displayText:U(t,n.userDisplayMessage)}}catch(e){throw n.signal.aborted?Error(`Compaction canceled.`):a(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(v):a(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(B):(c(e),Error(`Error during compaction: ${e}`))}}}))();export{K as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{dc as t,yc as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{dc as t,yc as n}from"./paths-CEAy4QCs.js";var r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A=e((()=>{r=[`common`,`uncommon`,`rare`,`epic`,`legendary`],i=String.fromCharCode,a=i(100,117,99,107),o=i(103,111,111,115,101),s=i(98,108,111,98),c=i(99,97,116),l=i(100,114,97,103,111,110),u=i(111,99,116,111,112,117,115),d=i(111,119,108),f=i(112,101,110,103,117,105,110),p=i(116,117,114,116,108,101),m=i(115,110,97,105,108),h=i(103,104,111,115,116),g=i(97,120,111,108,111,116,108),_=i(99,97,112,121,98,97,114,97),v=i(99,97,99,116,117,115),y=i(114,111,98,111,116),b=i(114,97,98,98,105,116),x=i(109,117,115,104,114,111,111,109),S=i(99,104,111,110,107),C=[a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S],w=[`·`,`✦`,`×`,`◉`,`@`,`°`],T=[`none`,`crown`,`tophat`,`propeller`,`halo`,`wizard`,`beanie`,`tinyduck`],E=[`DEBUGGING`,`PATIENCE`,`CHAOS`,`WISDOM`,`SNARK`],D={common:60,uncommon:25,rare:10,epic:4,legendary:1},O={common:`★`,uncommon:`★★`,rare:`★★★`,epic:`★★★★`,legendary:`★★★★★`},k={common:`inactive`,uncommon:`success`,rare:`permission`,epic:`autoAccept`,legendary:`warning`}}));function j(e){let t=e>>>0;return function(){t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function M(e){if(typeof Bun<`u`)return Number(BigInt(Bun.hash(e))&4294967295n);let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function N(e,t){return t[Math.floor(e()*t.length)]}function P(e){let t=Object.values(D).reduce((e,t)=>e+t,0),n=e()*t;for(let e of r)if(n-=D[e],n<0)return e;return`common`}function F(e,t){let n=U[t],r=N(e,E),i=N(e,E);for(;i===r;)i=N(e,E);let a={};for(let t of E)t===r?a[t]=Math.min(100,n+50+Math.floor(e()*30)):t===i?a[t]=Math.max(1,n-10+Math.floor(e()*15)):a[t]=n+Math.floor(e()*40);return a}function I(e){let t=P(e);return{bones:{rarity:t,species:N(e,C),eye:N(e,w),hat:t===`common`?`none`:N(e,T),shiny:e()<.01,stats:F(e,t)},inspirationSeed:Math.floor(e()*1e9)}}function L(e){return I(j(M(e)))}function R(){return`rehatch-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function z(){let e=t();return e.oauthAccount?.accountUuid??e.userID??`anon`}function B(e,t){return RegExp(`(^|${W})${t}($|${W})`).test(e)}function V(e){if(e.seed)return{};let t=`${e.name} ${e.personality}`.toLowerCase(),n={},i=C.find(e=>B(t,e)),a=r.find(e=>B(t,e));return i&&(n.species=i),a&&(n.rarity=a),n}function H(){let e=t().companion;if(!e)return;let{bones:n}=L(e.seed??z()),r=V(e);return{...e,...n,...r}}var U,W,G=e((()=>{n(),A(),U={common:5,uncommon:15,rare:25,epic:35,legendary:50},W=`[^a-z0-9]+`}));export{b as C,p as E,f as S,m as T,o as _,k as a,u as b,g as c,_ as d,c as f,h as g,a as h,L as i,s as l,l as m,H as n,O as o,S as p,G as r,E as s,R as t,v as u,A as v,y as w,d as x,x as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./completionCache-C7hDqIDL.js";t();export{e as regenerateCompletionCache};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{$ as t,In as n,Ln as r,t as i,v as a}from"./src-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{$ as t,In as n,Ln as r,t as i,v as a}from"./src-Di342QoJ.js";import{G as o,U as s,l as c,p as l}from"./debug-otxXY3j-.js";import{o as u,s as d}from"./log-DSV4Ht5l.js";import{r as f,t as p}from"./execFileNoThrow-azCkYhmF.js";import{homedir as m}from"os";import{dirname as h,join as g}from"path";import{mkdir as _,readFile as v,writeFile as y}from"fs/promises";import{pathToFileURL as b}from"url";function x(){let e=process.env.SHELL||``,t=m(),n=g(t,`.claude`);if(e.endsWith(`/zsh`)||e.endsWith(`/zsh.exe`)){let e=g(n,`completion.zsh`);return{name:`zsh`,rcFile:g(t,`.zshrc`),cacheFile:e,completionLine:`[[ -f "${e}" ]] && source "${e}"`,shellFlag:`zsh`}}if(e.endsWith(`/bash`)||e.endsWith(`/bash.exe`)){let e=g(n,`completion.bash`);return{name:`bash`,rcFile:g(t,`.bashrc`),cacheFile:e,completionLine:`[ -f "${e}" ] && source "${e}"`,shellFlag:`bash`}}if(e.endsWith(`/fish`)||e.endsWith(`/fish.exe`)){let e=process.env.XDG_CONFIG_HOME||g(t,`.config`),r=g(n,`completion.fish`);return{name:`fish`,rcFile:g(e,`fish`,`config.fish`),cacheFile:r,completionLine:`[ -f "${r}" ] && source "${r}"`,shellFlag:`fish`}}return null}function S(e){return t()?`\x1b]8;;${b(e).href}\x07${e}\x1b]8;;\x07`:e}async function C(e){let t=x();if(!t)return``;try{await _(h(t.cacheFile),{recursive:!0})}catch(r){return d(r),`${T}${a(`warning`,e)(`Could not write ${t.name} completion cache`)}${T}${n.dim(`Run manually: claude completion ${t.shellFlag} > ${t.cacheFile}`)}${T}`}if((await p(process.argv[1]||`claude`,[`completion`,t.shellFlag,`--output`,t.cacheFile])).code!==0)return`${T}${a(`warning`,e)(`Could not generate ${t.name} shell completions`)}${T}${n.dim(`Run manually: claude completion ${t.shellFlag} > ${t.cacheFile}`)}${T}`;let r=``;try{if(r=await v(t.rcFile,{encoding:`utf-8`}),r.includes(`claude completion`)||r.includes(t.cacheFile))return`${T}${a(`success`,e)(`Shell completions updated for ${t.name}`)}${T}${n.dim(`See ${S(t.rcFile)}`)}${T}`}catch(r){if(!o(r))return d(r),`${T}${a(`warning`,e)(`Could not install ${t.name} shell completions`)}${T}${n.dim(`Add this to ${S(t.rcFile)}:`)}${T}${n.dim(t.completionLine)}${T}`}try{await _(h(t.rcFile),{recursive:!0});let i=r&&!r.endsWith(`
|
|
2
2
|
`)?`
|
|
3
3
|
`:``,o=`${r}${i}\n# Claude Code shell completions\n${t.completionLine}\n`;return await y(t.rcFile,o,{encoding:`utf-8`}),`${T}${a(`success`,e)(`Installed ${t.name} shell completions`)}${T}${n.dim(`Added to ${S(t.rcFile)}`)}${T}${n.dim(`Run: source ${t.rcFile}`)}${T}`}catch(r){return d(r),`${T}${a(`warning`,e)(`Could not install ${t.name} shell completions`)}${T}${n.dim(`Add this to ${S(t.rcFile)}:`)}${T}${n.dim(t.completionLine)}${T}`}}async function w(){let e=x();if(e){if(l(`update: Regenerating ${e.name} completion cache`),(await p(process.argv[1]||`claude`,[`completion`,e.shellFlag,`--output`,e.cacheFile])).code!==0){l(`update: Failed to regenerate ${e.name} completion cache`);return}l(`update: Regenerated ${e.name} completion cache at ${e.cacheFile}`)}}var T,E=e((()=>{r(),i(),c(),s(),f(),u(),T=`
|
|
4
4
|
`}));export{w as n,C as r,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cc as e,Sc as t,ac as n,dc as r,lc as i,oc as a,yc as o}from"./paths-
|
|
1
|
+
import{Cc as e,Sc as t,ac as n,dc as r,lc as i,oc as a,yc as o}from"./paths-CEAy4QCs.js";o();export{n as checkHasTrustDialogAccepted,a as enableConfigs,i as getCurrentProjectConfig,r as getGlobalConfig,t as saveCurrentProjectConfig,e as saveGlobalConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Settings-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Settings-DOve7mW1.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./figures-gfT9mM8P.js";import{Rn as r,b as i,o as a,t as o,x as s}from"./src-KjMLauwe.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Bc as l,Gs as u,Uc as d,Ws as f}from"./paths-4ZWdjPP4.js";import{b as p,x as m}from"./startupProfiler-rCtNuhXz.js";import{Po as h,Uo as g,dl as _,iA as v,ll as y,rA as b}from"./loadAgentsDir-CQF8qhne.js";import{En as x,Gn as S,Kn as C,Mn as w,Un as T,hn as E,mn as D,qn as O}from"./prompt-CogZQuTN.js";import{n as k,t as A}from"./staticRender-DboURbK0.js";function ee(e){let t=[];return j(e,t),M(e,t),P(e,t),F(e,t),I(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function j(e,t){e.percentage>=B&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function M(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<L||r<R)continue;let a=N(n.name,r,i);a&&t.push(a)}}function N(e,t,n){let r=p(t);switch(e){case C:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case x:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case T:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};case D:return{severity:`info`,title:`WebFetch results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Web page content can be very large. Consider extracting only the specific information needed.`,savingsTokens:Math.floor(t*.4)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function P(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===x);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=L&&r>=R||a>=z&&n.resultTokens>=R&&t.push({severity:`info`,title:`File reads using ${p(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function F(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=V&&n>=H){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${l(e.path)} (${p(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${p(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function I(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<B&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var L,R,z,B,V,H,U=e((()=>{O(),w(),S(),E(),d(),m(),L=15,R=1e4,z=5,B=80,V=5,H=5e3}));function W({suggestions:e}){return e.length===0?null:(0,G.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(i,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,G.jsxs)(s,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,G.jsxs)(s,{children:[(0,G.jsx)(a,{status:e.severity,withSpace:!0}),(0,G.jsx)(i,{bold:!0,children:e.title}),e.savingsTokens?(0,G.jsxs)(i,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,p(e.savingsTokens)]}):null]}),(0,G.jsx)(s,{marginLeft:2,children:(0,G.jsx)(i,{dimColor:!0,children:e.detail})})]},t))]})}var G,K=e((()=>{t(),r(),o(),m(),G=c()}));function q(){return null}function J(e){let t=new Map;for(let n of e){let e=f(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of Q){let r=t.get(e);r&&n.set(e,r)}return n}function Y({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:r,percentage:a,gridRows:o,model:c,memoryFiles:u,mcpTools:d,deferredBuiltinTools:f=[],systemTools:m,systemPromptSections:h,agents:g,skills:_,messageBreakdown:v,cacheHitRate:y,cacheThreshold:b}=e,x=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==Z&&!e.isDeferred),S=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),C=f.length>0,w=t.find(e=>e.name===Z);return(0,X.jsxs)(s,{flexDirection:`column`,paddingLeft:1,children:[(0,X.jsx)(i,{bold:!0,children:`Context Usage`}),(0,X.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,X.jsx)(s,{flexDirection:`column`,flexShrink:0,children:o.map((e,t)=>(0,X.jsx)(s,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,X.jsx)(i,{dimColor:!0,children:`⛶ `},t):e.categoryName===Z?(0,X.jsx)(i,{color:e.color,children:`⛝ `},t):(0,X.jsx)(i,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,X.jsxs)(s,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,X.jsxs)(i,{dimColor:!0,children:[c,` · `,p(n),`/`,p(r),` tokens (`,a,`%)`]}),(0,X.jsx)(q,{}),y!==void 0&&b!==void 0&&(0,X.jsxs)(i,{color:y<b?`warning`:void 0,children:[`Cache hit rate: `,y.toFixed(0),`%`,y<b?` (below ${b}% threshold)`:``]}),(0,X.jsx)(i,{children:` `}),(0,X.jsx)(i,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),x.map((e,t)=>{let n=p(e.tokens),a=e.isDeferred?`N/A`:`${(e.tokens/r*100).toFixed(1)}%`,o=e.name===Z,c=e.name,l=e.isDeferred?` `:o?`⛝`:`⛁`;return(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{color:e.color,children:l}),(0,X.jsxs)(i,{children:[` `,c,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[n,` tokens (`,a,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{dimColor:!0,children:`⛶`}),(0,X.jsx)(i,{children:` Free space: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/r*100).toFixed(1),`%)`]})]}),w&&w.tokens>0&&(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{color:w.color,children:`⛝`}),(0,X.jsxs)(i,{dimColor:!0,children:[` `,w.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(w.tokens),` tokens (`,(w.tokens/r*100).toFixed(1),`%)`]})]})]})]}),(0,X.jsxs)(s,{flexDirection:`column`,marginLeft:-1,children:[d.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`MCP tools`}),(0,X.jsxs)(i,{dimColor:!0,children:[` · /mcp`,S?` (loaded on-demand)`:``]})]}),d.some(e=>e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Loaded`}),d.filter(e=>e.isLoaded).map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),S&&d.some(e=>!e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Available`}),d.filter(e=>!e.isLoaded).map((e,t)=>(0,X.jsx)(s,{children:(0,X.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!S&&d.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),(m&&m.length>0||C)&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] System tools`}),C&&(0,X.jsx)(i,{dimColor:!0,children:` (some loaded on-demand)`})]}),(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Loaded`}),m?.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},`sys-${t}`)),f.filter(e=>e.isLoaded).map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},`def-${t}`))]}),C&&f.some(e=>!e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Available`}),f.filter(e=>!e.isLoaded).map((e,t)=>(0,X.jsx)(s,{children:(0,X.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]})]}),h&&h.length>0&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] System prompt sections`}),h.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),g.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Custom agents`}),(0,X.jsx)(i,{dimColor:!0,children:` · /agents`})]}),Array.from(J(g).entries()).map(([e,t])=>(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.agentType,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]},e))]}),u.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Memory files`}),(0,X.jsx)(i,{dimColor:!0,children:` · /memory`})]}),u.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,l(e.path),`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]}),_&&_.tokens>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Skills`}),(0,X.jsx)(i,{dimColor:!0,children:` · /skills`})]}),Array.from(J(_.skillFrontmatter).entries()).map(([e,t])=>(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]},e))]}),v&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Message breakdown`}),(0,X.jsxs)(s,{flexDirection:`column`,marginLeft:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Tool calls: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.toolCallTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Tool results: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.toolResultTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Attachments: `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.attachmentTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Assistant messages (non-tool): `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.assistantMessageTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`User messages (non-tool-result): `}),(0,X.jsxs)(i,{dimColor:!0,children:[p(v.userMessageTokens),` tokens`]})]})]}),v.toolCallsByType.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top tools`}),v.toolCallsByType.slice(0,5).map((e,t)=>(0,X.jsxs)(s,{marginLeft:1,children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[`calls `,p(e.callTokens),`, results `,p(e.resultTokens)]})]},t))]}),v.attachmentsByType.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top attachments`}),v.attachmentsByType.slice(0,5).map((e,t)=>(0,X.jsxs)(s,{marginLeft:1,children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[p(e.tokens),` tokens`]})]},t))]})]})]}),(0,X.jsx)(W,{suggestions:ee(e)})]})}var X,Z,Q,te=e((()=>{r(),o(),U(),d(),m(),u(),K(),X=c(),Z=`Autocompact buffer`,Q=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function ne(e){return h(e)}async function re(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=ne(n),{messages:s}=await v(o),c=process.stdout.columns||80,l=r();return e(await k((0,$.jsx)(Y,{data:await y(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{r(),te(),b(),_(),g(),A(),$=c()}))();export{re as call};
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./figures-gfT9mM8P.js";import{Rn as r,b as i,o as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Bc as l,Gs as u,Uc as d,Ws as f}from"./paths-CEAy4QCs.js";import{b as p,y as m}from"./startupProfiler-CBcN1Chw.js";import{Po as h,Uo as g,dl as _,iA as v,ll as y,rA as b}from"./loadAgentsDir-DC4jN6-f.js";import{En as x,Gn as S,Kn as C,Mn as w,Un as T,hn as E,mn as D,qn as O}from"./prompt-BHI7PZe4.js";import{n as k,t as A}from"./staticRender-DKFIRhkH.js";function ee(e){let t=[];return j(e,t),M(e,t),P(e,t),F(e,t),I(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function j(e,t){e.percentage>=B&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function M(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<L||r<R)continue;let a=N(n.name,r,i);a&&t.push(a)}}function N(e,t,n){let r=m(t);switch(e){case C:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case x:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case T:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};case D:return{severity:`info`,title:`WebFetch results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Web page content can be very large. Consider extracting only the specific information needed.`,savingsTokens:Math.floor(t*.4)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function P(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===x);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=L&&r>=R||a>=z&&n.resultTokens>=R&&t.push({severity:`info`,title:`File reads using ${m(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function F(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=V&&n>=H){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${l(e.path)} (${m(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${m(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function I(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<B&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var L,R,z,B,V,H,U=e((()=>{O(),w(),S(),E(),d(),p(),L=15,R=1e4,z=5,B=80,V=5,H=5e3}));function W({suggestions:e}){return e.length===0?null:(0,G.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(i,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,G.jsxs)(s,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,G.jsxs)(s,{children:[(0,G.jsx)(a,{status:e.severity,withSpace:!0}),(0,G.jsx)(i,{bold:!0,children:e.title}),e.savingsTokens?(0,G.jsxs)(i,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,m(e.savingsTokens)]}):null]}),(0,G.jsx)(s,{marginLeft:2,children:(0,G.jsx)(i,{dimColor:!0,children:e.detail})})]},t))]})}var G,K=e((()=>{t(),r(),o(),p(),G=c()}));function q(){return null}function J(e){let t=new Map;for(let n of e){let e=f(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of Q){let r=t.get(e);r&&n.set(e,r)}return n}function Y({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:r,percentage:a,gridRows:o,model:c,memoryFiles:u,mcpTools:d,deferredBuiltinTools:f=[],systemTools:p,systemPromptSections:h,agents:g,skills:_,messageBreakdown:v,cacheHitRate:y,cacheThreshold:b}=e,x=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==Z&&!e.isDeferred),S=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),C=f.length>0,w=t.find(e=>e.name===Z);return(0,X.jsxs)(s,{flexDirection:`column`,paddingLeft:1,children:[(0,X.jsx)(i,{bold:!0,children:`Context Usage`}),(0,X.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,X.jsx)(s,{flexDirection:`column`,flexShrink:0,children:o.map((e,t)=>(0,X.jsx)(s,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,X.jsx)(i,{dimColor:!0,children:`⛶ `},t):e.categoryName===Z?(0,X.jsx)(i,{color:e.color,children:`⛝ `},t):(0,X.jsx)(i,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,X.jsxs)(s,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,X.jsxs)(i,{dimColor:!0,children:[c,` · `,m(n),`/`,m(r),` tokens (`,a,`%)`]}),(0,X.jsx)(q,{}),y!==void 0&&b!==void 0&&(0,X.jsxs)(i,{color:y<b?`warning`:void 0,children:[`Cache hit rate: `,y.toFixed(0),`%`,y<b?` (below ${b}% threshold)`:``]}),(0,X.jsx)(i,{children:` `}),(0,X.jsx)(i,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),x.map((e,t)=>{let n=m(e.tokens),a=e.isDeferred?`N/A`:`${(e.tokens/r*100).toFixed(1)}%`,o=e.name===Z,c=e.name,l=e.isDeferred?` `:o?`⛝`:`⛁`;return(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{color:e.color,children:l}),(0,X.jsxs)(i,{children:[` `,c,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[n,` tokens (`,a,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{dimColor:!0,children:`⛶`}),(0,X.jsx)(i,{children:` Free space: `}),(0,X.jsxs)(i,{dimColor:!0,children:[m(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/r*100).toFixed(1),`%)`]})]}),w&&w.tokens>0&&(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{color:w.color,children:`⛝`}),(0,X.jsxs)(i,{dimColor:!0,children:[` `,w.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(w.tokens),` tokens (`,(w.tokens/r*100).toFixed(1),`%)`]})]})]})]}),(0,X.jsxs)(s,{flexDirection:`column`,marginLeft:-1,children:[d.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`MCP tools`}),(0,X.jsxs)(i,{dimColor:!0,children:[` · /mcp`,S?` (loaded on-demand)`:``]})]}),d.some(e=>e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Loaded`}),d.filter(e=>e.isLoaded).map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]}),S&&d.some(e=>!e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Available`}),d.filter(e=>!e.isLoaded).map((e,t)=>(0,X.jsx)(s,{children:(0,X.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!S&&d.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]}),(p&&p.length>0||C)&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] System tools`}),C&&(0,X.jsx)(i,{dimColor:!0,children:` (some loaded on-demand)`})]}),(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Loaded`}),p?.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},`sys-${t}`)),f.filter(e=>e.isLoaded).map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},`def-${t}`))]}),C&&f.some(e=>!e.isLoaded)&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:`Available`}),f.filter(e=>!e.isLoaded).map((e,t)=>(0,X.jsx)(s,{children:(0,X.jsxs)(i,{dimColor:!0,children:[`└ `,e.name]})},t))]})]}),h&&h.length>0&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] System prompt sections`}),h.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]}),g.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Custom agents`}),(0,X.jsx)(i,{dimColor:!0,children:` · /agents`})]}),Array.from(J(g).entries()).map(([e,t])=>(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.agentType,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]},e))]}),u.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Memory files`}),(0,X.jsx)(i,{dimColor:!0,children:` · /memory`})]}),u.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,l(e.path),`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]}),_&&_.tokens>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{bold:!0,children:`Skills`}),(0,X.jsx)(i,{dimColor:!0,children:` · /skills`})]}),Array.from(J(_.skillFrontmatter).entries()).map(([e,t])=>(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{dimColor:!0,children:e}),t.map((e,t)=>(0,X.jsxs)(s,{children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]},e))]}),v&&process.env.USER_TYPE===`ant`&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Message breakdown`}),(0,X.jsxs)(s,{flexDirection:`column`,marginLeft:1,children:[(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Tool calls: `}),(0,X.jsxs)(i,{dimColor:!0,children:[m(v.toolCallTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Tool results: `}),(0,X.jsxs)(i,{dimColor:!0,children:[m(v.toolResultTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Attachments: `}),(0,X.jsxs)(i,{dimColor:!0,children:[m(v.attachmentTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`Assistant messages (non-tool): `}),(0,X.jsxs)(i,{dimColor:!0,children:[m(v.assistantMessageTokens),` tokens`]})]}),(0,X.jsxs)(s,{children:[(0,X.jsx)(i,{children:`User messages (non-tool-result): `}),(0,X.jsxs)(i,{dimColor:!0,children:[m(v.userMessageTokens),` tokens`]})]})]}),v.toolCallsByType.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top tools`}),v.toolCallsByType.slice(0,5).map((e,t)=>(0,X.jsxs)(s,{marginLeft:1,children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[`calls `,m(e.callTokens),`, results `,m(e.resultTokens)]})]},t))]}),v.attachmentsByType.length>0&&(0,X.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,X.jsx)(i,{bold:!0,children:`[ANT-ONLY] Top attachments`}),v.attachmentsByType.slice(0,5).map((e,t)=>(0,X.jsxs)(s,{marginLeft:1,children:[(0,X.jsxs)(i,{children:[`└ `,e.name,`: `]}),(0,X.jsxs)(i,{dimColor:!0,children:[m(e.tokens),` tokens`]})]},t))]})]})]}),(0,X.jsx)(W,{suggestions:ee(e)})]})}var X,Z,Q,te=e((()=>{r(),o(),U(),d(),p(),u(),K(),X=c(),Z=`Autocompact buffer`,Q=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function ne(e){return h(e)}async function re(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=ne(n),{messages:s}=await v(o),c=process.stdout.columns||80,l=r();return e(await k((0,$.jsx)(Y,{data:await y(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{r(),te(),b(),_(),g(),A(),$=c()}))();export{re as call};
|
package/dist/chunks/{context-noninteractive-CJu7hZCM.js → context-noninteractive-BWbEqad6.js}
RENAMED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Gs as t,Ws as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Gs as t,Ws as n}from"./paths-CEAy4QCs.js";import{b as r,y as i}from"./startupProfiler-CBcN1Chw.js";import{Po as a,Uo as o,dl as s,iA as c,ll as l,rA as u}from"./loadAgentsDir-DC4jN6-f.js";async function d(e){let{messages:t,getAppState:n,options:{mainLoopModel:r,tools:i,agentDefinitions:o,customSystemPrompt:s,appendSystemPrompt:u}}=e,d=a(t),{messages:f}=await c(d),p=n();return l(f,r,async()=>p.toolPermissionContext,i,o,void 0,{options:{customSystemPrompt:s,appendSystemPrompt:u}},void 0,d)}async function f(e,t){return{type:`text`,value:p(await d(t))}}function p(e){let{categories:t,totalTokens:r,rawMaxTokens:a,percentage:o,model:s,memoryFiles:c,mcpTools:l,agents:u,skills:d,messageBreakdown:f,systemTools:p,systemPromptSections:m}=e,h=`## Context Usage
|
|
2
2
|
|
|
3
|
-
`;h+=`**Model:** ${s} \n`,h+=`**Tokens:** ${r
|
|
3
|
+
`;h+=`**Model:** ${s} \n`,h+=`**Tokens:** ${i(r)} / ${i(a)} (${o}%)\n`,h+=`
|
|
4
4
|
`;let g=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==`Autocompact buffer`);if(g.length>0){h+=`### Estimated usage by category
|
|
5
5
|
|
|
6
6
|
`,h+=`| Category | Tokens | Percentage |
|
|
7
7
|
`,h+=`|----------|--------|------------|
|
|
8
|
-
`;for(let e of g){let t=(e.tokens/a*100).toFixed(1);h+=`| ${e.name} | ${
|
|
8
|
+
`;for(let e of g){let t=(e.tokens/a*100).toFixed(1);h+=`| ${e.name} | ${i(e.tokens)} | ${t}% |\n`}let e=t.find(e=>e.name===`Free space`);if(e&&e.tokens>0){let t=(e.tokens/a*100).toFixed(1);h+=`| Free space | ${i(e.tokens)} | ${t}% |\n`}let n=t.find(e=>e.name===`Autocompact buffer`);if(n&&n.tokens>0){let e=(n.tokens/a*100).toFixed(1);h+=`| Autocompact buffer | ${i(n.tokens)} | ${e}% |\n`}h+=`
|
|
9
9
|
`}if(l.length>0){h+=`### MCP Tools
|
|
10
10
|
|
|
11
11
|
`,h+=`| Tool | Server | Tokens |
|
|
12
12
|
`,h+=`|------|--------|--------|
|
|
13
|
-
`;for(let e of l)h+=`| ${e.name} | ${e.serverName} | ${
|
|
13
|
+
`;for(let e of l)h+=`| ${e.name} | ${e.serverName} | ${i(e.tokens)} |\n`;h+=`
|
|
14
14
|
`}if(p&&p.length>0&&process.env.USER_TYPE===`ant`){h+=`### [ANT-ONLY] System Tools
|
|
15
15
|
|
|
16
16
|
`,h+=`| Tool | Tokens |
|
|
17
17
|
`,h+=`|------|--------|
|
|
18
|
-
`;for(let e of p)h+=`| ${e.name} | ${
|
|
18
|
+
`;for(let e of p)h+=`| ${e.name} | ${i(e.tokens)} |\n`;h+=`
|
|
19
19
|
`}if(m&&m.length>0&&process.env.USER_TYPE===`ant`){h+=`### [ANT-ONLY] System Prompt Sections
|
|
20
20
|
|
|
21
21
|
`,h+=`| Section | Tokens |
|
|
22
22
|
`,h+=`|---------|--------|
|
|
23
|
-
`;for(let e of m)h+=`| ${e.name} | ${
|
|
23
|
+
`;for(let e of m)h+=`| ${e.name} | ${i(e.tokens)} |\n`;h+=`
|
|
24
24
|
`}if(u.length>0){h+=`### Custom Agents
|
|
25
25
|
|
|
26
26
|
`,h+=`| Agent Type | Source | Tokens |
|
|
27
27
|
`,h+=`|------------|--------|--------|
|
|
28
|
-
`;for(let e of u){let t;switch(e.source){case`projectSettings`:t=`Project`;break;case`userSettings`:t=`User`;break;case`localSettings`:t=`Local`;break;case`flagSettings`:t=`Flag`;break;case`policySettings`:t=`Policy`;break;case`plugin`:t=`Plugin`;break;case`built-in`:t=`Built-in`;break;default:t=String(e.source)}h+=`| ${e.agentType} | ${t} | ${
|
|
28
|
+
`;for(let e of u){let t;switch(e.source){case`projectSettings`:t=`Project`;break;case`userSettings`:t=`User`;break;case`localSettings`:t=`Local`;break;case`flagSettings`:t=`Flag`;break;case`policySettings`:t=`Policy`;break;case`plugin`:t=`Plugin`;break;case`built-in`:t=`Built-in`;break;default:t=String(e.source)}h+=`| ${e.agentType} | ${t} | ${i(e.tokens)} |\n`}h+=`
|
|
29
29
|
`}if(c.length>0){h+=`### Memory Files
|
|
30
30
|
|
|
31
31
|
`,h+=`| Type | Path | Tokens |
|
|
32
32
|
`,h+=`|------|------|--------|
|
|
33
|
-
`;for(let e of c)h+=`| ${e.type} | ${e.path} | ${
|
|
33
|
+
`;for(let e of c)h+=`| ${e.type} | ${e.path} | ${i(e.tokens)} |\n`;h+=`
|
|
34
34
|
`}if(d&&d.tokens>0&&d.skillFrontmatter.length>0){h+=`### Skills
|
|
35
35
|
|
|
36
36
|
`,h+=`| Skill | Source | Tokens |
|
|
37
37
|
`,h+=`|-------|--------|--------|
|
|
38
|
-
`;for(let e of d.skillFrontmatter)h+=`| ${e.name} | ${n(e.source)} | ${
|
|
38
|
+
`;for(let e of d.skillFrontmatter)h+=`| ${e.name} | ${n(e.source)} | ${i(e.tokens)} |\n`;h+=`
|
|
39
39
|
`}if(f&&process.env.USER_TYPE===`ant`){if(h+=`### [ANT-ONLY] Message Breakdown
|
|
40
40
|
|
|
41
41
|
`,h+=`| Category | Tokens |
|
|
42
42
|
`,h+=`|----------|--------|
|
|
43
|
-
`,h+=`| Tool calls | ${
|
|
43
|
+
`,h+=`| Tool calls | ${i(f.toolCallTokens)} |\n`,h+=`| Tool results | ${i(f.toolResultTokens)} |\n`,h+=`| Attachments | ${i(f.attachmentTokens)} |\n`,h+=`| Assistant messages (non-tool) | ${i(f.assistantMessageTokens)} |\n`,h+=`| User messages (non-tool-result) | ${i(f.userMessageTokens)} |\n`,h+=`
|
|
44
44
|
`,f.toolCallsByType.length>0){h+=`#### Top Tools
|
|
45
45
|
|
|
46
46
|
`,h+=`| Tool | Call Tokens | Result Tokens |
|
|
47
47
|
`,h+=`|------|-------------|---------------|
|
|
48
|
-
`;for(let e of f.toolCallsByType)h+=`| ${e.name} | ${
|
|
48
|
+
`;for(let e of f.toolCallsByType)h+=`| ${e.name} | ${i(e.callTokens)} | ${i(e.resultTokens)} |\n`;h+=`
|
|
49
49
|
`}if(f.attachmentsByType.length>0){h+=`#### Top Attachments
|
|
50
50
|
|
|
51
51
|
`,h+=`| Attachment | Tokens |
|
|
52
52
|
`,h+=`|------------|--------|
|
|
53
|
-
`;for(let e of f.attachmentsByType)h+=`| ${e.name} | ${
|
|
54
|
-
`}}return h}var m=e((()=>{u(),s(),
|
|
53
|
+
`;for(let e of f.attachmentsByType)h+=`| ${e.name} | ${i(e.tokens)} |\n`;h+=`
|
|
54
|
+
`}}return h}var m=e((()=>{u(),s(),r(),o(),t()}));export{d as n,m as r,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./context-noninteractive-BWbEqad6.js";t();export{n as call,e as collectContextData};
|
|
@@ -1 +1 @@
|
|
|
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 s,ot as c,qn as l,yn as u}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-DSV4Ht5l.js";import{$t as h,$v as g,Ai as ee,Au as _,Cn as v,Di as y,Fn as b,Fr as x,GE as S,In as C,Nn as w,Ob as T,Ot as E,Qv as D,RE as O,Tt as k,_r as A,cv as j,dy as M,gd as N,gi as P,hd as F,ju as I,kb as L,mh as R,mn as z,ph as B,qE as V,sr as H,sv as U,vy as W,zE as G}from"./loadAgentsDir-
|
|
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 s,ot as c,qn as l,yn as u}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-DSV4Ht5l.js";import{$t as h,$v as g,Ai as ee,Au as _,Cn as v,Di as y,Fn as b,Fr as x,GE as S,In as C,Nn as w,Ob as T,Ot as E,Qv as D,RE as O,Tt as k,_r as A,cv as j,dy as M,gd as N,gi as P,hd as F,ju as I,kb as L,mh as R,mn as z,ph as B,qE as V,sr as H,sv as U,vy as W,zE as G}from"./loadAgentsDir-DC4jN6-f.js";import{C as K,y as q}from"./rcDebugLog-C0Bam8V9.js";import{l as J,r as Y}from"./commitAttribution-Djh1ZpYH.js";import{n as X,t as Z}from"./caches-CzEBsMvP.js";import{randomUUID as Q}from"crypto";function $(){let e=F();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:d,loadedNestedMemoryPaths:p,getAppState:_,setAppState:v,setConversationId:C}){let T=z();await h(`clear`,{getAppState:_,setAppState:v,signal:AbortSignal.timeout(T),timeoutMs:T});let E=a();E&&f(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:E});let D=new Set,N=[],F=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(_)for(let e of Object.values(_().tasks))F(e)||(I(e)?(D.add(e.agentId),N.push(e)):L(e)&&D.add(e.identity.agentId));t(()=>[]),$();{let{setContextBlocked:t}=(q(),e(K));t(!1)}C&&C(Q()),Z(D),l(null),r(null),i(null),u(),R(c()),o.clear(),d?.clear(),p?.clear(),v&&v(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!F(r)){t[n]=r;continue}try{r.status===`running`&&(j(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){m(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}}}),M(),H(),s({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=n()),await P();for(let e of N)e.status===`running`&&b(e.id,A(S(e.agentId)));{let{saveMode:t}=(x(),e(ee)),{isCoordinatorMode:n}=(G(),e(O));t(n()?`coordinator`:`normal`)}let B=k();B&&y(B);let V=await g(`clear`);V.length>0&&t(()=>V)}var ne=t((()=>{N(),o(),d(),T(),_(),U(),V(),J(),v(),p(),W(),B(),D(),x(),C(),E(),X()}));export{ne as n,te as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./conversation-DR4MFYYi.js";e();export{t as clearConversation};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,Rn as r,b as i,g as a,h as o,p as s,t as c,tn as l,x as u}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,Rn as r,b as i,g as a,h as o,p as s,t as c,tn as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Cc as f,dc as p,yc as m}from"./paths-CEAy4QCs.js";import{n as h,r as g}from"./analytics-DqMQntaB.js";import{o as _,r as v}from"./stringUtils-KZoO4GUd.js";import{Uo as y,aS as b,ko as x,nA as S,ns as C,oS as w,tA as T}from"./loadAgentsDir-DC4jN6-f.js";import{tmpdir as E}from"os";import{join as D}from"path";import{mkdir as O,writeFile as k}from"fs/promises";function A(e){let t=T.lexer(C(e)),n=[];for(let e of t)if(e.type===`code`){let t=e;n.push({code:t.text,lang:t.lang})}return n}function j(e){let t=[];for(let n=e.length-1;n>=0&&t.length<V;n--){let r=e[n];if(r?.type!==`assistant`||r.isApiErrorMessage)continue;let i=r.message.content;if(!Array.isArray(i))continue;let a=x(i,`
|
|
2
2
|
|
|
3
3
|
`);a&&t.push(a)}return t}function M(e){if(e){let t=e.replace(/[^a-zA-Z0-9]/g,``);if(t&&t!==`plaintext`)return`.${t}`}return`.txt`}async function N(e,t){let n=D(z,t);return await O(z,{recursive:!0}),await k(n,e,`utf-8`),n}async function P(e,t){let n=await l(e);n&&process.stdout.write(n);let r=v(e,`
|
|
4
4
|
`)+1,i=e.length;try{return`Copied to clipboard (${i} characters, ${r} lines)\nAlso written to ${await N(e,t)}`}catch{return`Copied to clipboard (${i} characters, ${r} lines)`}}function F(e,t){let r=e.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{Jt as n,on as r}from"./paths-
|
|
1
|
+
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{Jt as n,on as r}from"./paths-CEAy4QCs.js";import{D as i,E as a,O as o,l as s,p as c}from"./debug-otxXY3j-.js";import{l,u}from"./oauth-CdZEzMww.js";import{i as d,t as f}from"./cliLaunch-Citfs01Q.js";import{resolve as p}from"path";import{existsSync as m,unlinkSync as h}from"fs";import{randomUUID as g}from"crypto";s(),a(),e();function _(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}var v=2e3,y=15e3,b=3,x=class{constructor(e,n){t(this,`proc`,void 0),t(this,`options`,void 0),t(this,`connected`,!1),t(this,`disconnected`,!1),t(this,`readLoopAbort`,null),t(this,`reconnectAttempt`,0),t(this,`maxReconnectAttempts`,void 0),t(this,`userInitiatedDisconnect`,!1),t(this,`reconnecting`,!1),this.proc=e,this.options=n,this.maxReconnectAttempts=n.maxReconnectAttempts??b}connect(){this.connected||(this.readLoopAbort=new AbortController,this.startReadLoop(),this.monitorExit(),this.connected=!0,this.options.onConnected())}async startReadLoop(){let e=this.proc.stdout;if(!e){this.options.onError(Error(`SSH process stdout is not available`));return}let t=e.getReader(),n=new TextDecoder,r=``;try{for(;!this.disconnected;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.split(`
|
|
2
2
|
`);r=a.pop()??``;for(let e of a){let t=e.trim();t&&this.processLine(t)}}}catch(e){this.disconnected||this.options.onError(e instanceof Error?e:Error(String(e)))}finally{t.releaseLock(),!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}}monitorExit(){if(this.proc.exitCode!==null){this.userInitiatedDisconnect||this.handleProcessExit();return}this.proc.exited.then(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}).catch(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()})}async handleProcessExit(){if(!(this.disconnected||this.reconnecting)){if(this.connected=!1,!this.options.reconnect){this.disconnected=!0,this.options.onDisconnected();return}if(this.reconnectAttempt>=this.maxReconnectAttempts){this.disconnected=!0,this.options.onDisconnected();return}this.reconnecting=!0;try{await this.attemptReconnect()}finally{this.reconnecting=!1}}}async attemptReconnect(){let e=this.options.reconnect;for(;this.reconnectAttempt<this.maxReconnectAttempts;){this.reconnectAttempt++,this.options.onReconnecting(this.reconnectAttempt,this.maxReconnectAttempts);let t=Math.min(v*2**(this.reconnectAttempt-1),y);if(await new Promise(e=>setTimeout(e,t)),this.userInitiatedDisconnect)return;try{this.proc=await e(),this.reconnectAttempt=0,this.connected=!0,this.startReadLoop(),this.monitorExit(),this.options.onConnected();return}catch(e){c(`[SSH] reconnect attempt ${this.reconnectAttempt} failed: ${e instanceof Error?e.message:String(e)}`)}}this.disconnected=!0,this.options.onDisconnected()}processLine(e){let t;try{t=i(e)}catch{return}if(!_(t))return;let n=t;if(n.type===`control_request`){let e=n;e.request.subtype===`can_use_tool`?this.options.onPermissionRequest(e.request,e.request_id):(c(`[SSH] Unsupported control request subtype: ${e.request.subtype}`),this.sendErrorResponse(e.request_id,`Unsupported control request subtype: ${e.request.subtype}`));return}n.type!==`control_response`&&n.type!==`keep_alive`&&n.type!==`control_cancel_request`&&n.type!==`streamlined_text`&&n.type!==`streamlined_tool_use_summary`&&!(n.type===`system`&&n.subtype===`post_turn_summary`)&&this.options.onMessage(n)}writeToStdin(e){try{let t=this.proc.stdin;if(!t||typeof t==`number`||this.disconnected)return!1;let n=new TextEncoder().encode(e+`
|
|
3
3
|
`);return t.write(n),t.flush?.(),!0}catch{return!1}}async sendMessage(e){let t=o({type:`user`,message:{role:`user`,content:e},parent_tool_use_id:null,session_id:``});return this.writeToStdin(t)}sendInterrupt(){let e=o({type:`control_request`,request_id:crypto.randomUUID(),request:{subtype:`interrupt`}});this.writeToStdin(e)}respondToPermissionRequest(e,t){let n=o({type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}});this.writeToStdin(n)}sendErrorResponse(e,t){let n=o({type:`control_response`,response:{subtype:`error`,request_id:e,error:t}});this.writeToStdin(n)}disconnect(){if(!this.disconnected){this.userInitiatedDisconnect=!0,this.disconnected=!0,this.connected=!1,this.readLoopAbort?.abort();try{let e=this.proc.stdin;e&&typeof e!=`number`&&e.end?.()}catch{}try{this.proc.kill()}catch{}}}isConnected(){return this.connected&&!this.disconnected}};r(),u(),s();var S=process.platform===`win32`;function C(){let e=process.env.ANTHROPIC_API_KEY;if(e)return{"x-api-key":e};let t=n();return t?.accessToken?{Authorization:`Bearer ${t.accessToken}`}:{}}function w(){return process.env.ANTHROPIC_BASE_URL||l().BASE_API_URL}async function T(e,t){if(t&&e.headers.get(`x-auth-nonce`)!==t)return new Response(`Forbidden`,{status:403});let n=w(),r=new URL(e.url),i=`${n}${r.pathname}${r.search}`,a=C();if(Object.keys(a).length===0)return new Response(JSON.stringify({error:`No API credentials available on local machine`}),{status:401,headers:{"content-type":`application/json`}});let o=new Headers(e.headers);for(let[e,t]of Object.entries(a))o.set(e,t);o.delete(`host`),o.delete(`x-auth-nonce`),c(`[SSHAuthProxy] ${e.method} ${r.pathname} -> ${i}`);try{let t=await fetch(i,{method:e.method,headers:o,body:e.body,duplex:`half`}),n=new Headers(t.headers);return n.delete(`content-encoding`),n.delete(`content-length`),new Response(t.body,{status:t.status,statusText:t.statusText,headers:n})}catch(e){let t=e instanceof Error?e.message:String(e);return c(`[SSHAuthProxy] upstream error: ${t}`),new Response(JSON.stringify({error:`Proxy upstream error: ${t}`}),{status:502,headers:{"content-type":`application/json`}})}}async function E(){let e=g();return S?O(e):D(e)}async function D(e){let t=`/tmp/claude-ssh-auth-${e}.sock`,n=Bun.serve({unix:t,fetch:e=>T(e,null)});return c(`[SSHAuthProxy] listening on unix:${t}`),{proxy:{stop(){n.stop(!0);try{h(t)}catch{}}},localAddress:t,authEnv:{ANTHROPIC_AUTH_SOCKET:t}}}async function O(e){let t=g(),n=Bun.serve({port:0,hostname:`127.0.0.1`,fetch:e=>T(e,t)}),r=n.port;return c(`[SSHAuthProxy] listening on TCP 127.0.0.1:${r} (nonce-protected)`),{proxy:{stop(){n.stop(!0)}},localAddress:`127.0.0.1:${r}`,authEnv:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${r}`,ANTHROPIC_AUTH_NONCE:t}}}s();var k=15e3,A=class extends Error{constructor(e){super(e),this.name=`SSHProbeError`}};async function j(e,t){t?.(`Probing remote host…`);let n=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=10`,e,`CLAUDE_BIN=$(test -x "$HOME/.local/bin/claude" && echo "$HOME/.local/bin/claude" || command -v claude 2>/dev/null); echo "$CLAUDE_BIN"; $CLAUDE_BIN --version 2>/dev/null; uname -sm; pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`pipe`}),r=await Promise.race([n.exited,new Promise((e,t)=>setTimeout(()=>t(new A(`SSH probe timed out after ${k/1e3}s`)),k))]),i=await new Response(n.stdout).text(),a=await new Response(n.stderr).text();if(r!==0)throw new A(`SSH probe failed: ${a.trim()||`exit code ${r}`}`);let o=i.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(Boolean);c(`[SSHProbe] raw lines: ${JSON.stringify(o)}`);let s=o.findIndex(e=>/^(Linux|Darwin)\s/.test(e));if(s===-1)throw new A(`Could not detect remote platform (uname output missing)`);let l=s>=2&&o[s-2]||null,u=s>=1&&o[s-1]||null,d=u&&/^\d+\.\d+/.test(u)?u:null,f=l!==null&&l.startsWith(`/`),p=o[s+1]||`/`,[m,h]=o[s].split(/\s+/),g=m===`Darwin`?`darwin`:`linux`,_=h===`aarch64`||h===`arm64`?`arm64`:`x64`;return t?.(`Detected ${g}/${_}`),{hasBinary:f&&d!==null,remoteVersion:d,remotePlatform:g,remoteArch:_,defaultCwd:p,binaryPath:f?l:null}}s();var M=6e4,N=`~/.local/bin`,P=`claude-code-cli.js`,F=`claude`;async function I(e,t,n=M){let r=Bun.spawn([`ssh`,`-o`,`ConnectTimeout=10`,e,t],{stdout:`pipe`,stderr:`pipe`}),i=setTimeout(()=>r.kill(),n);try{let[e,t]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]),n=await r.exited;return{stdout:e.trim(),stderr:t.trim(),exitCode:n}}finally{clearTimeout(i)}}function L(){let e=p(import.meta.dir,`../..`),t=p(e,`dist/cli.js`);if(m(t))return t;let n=p(e,`src/entrypoints/cli.tsx`);if(m(n))return n;throw Error("Cannot find local CLI binary to deploy. Run `bun run build` first.")}async function R(e){let{host:t,remotePlatform:n,remoteArch:r,localVersion:i,onProgress:a}=e;if(n!==`linux`&&n!==`darwin`)throw Error(`Remote platform "${n}" is not supported. Only linux and darwin are supported.`);c(`[SSHDeploy] deploying to ${t} (${n}/${r}, v${i})`);let o=L();c(`[SSHDeploy] local binary: ${o}`),a?.(`Creating remote directory...`);let s=await I(t,`mkdir -p ${N}`);if(s.exitCode!==0)throw Error(`Failed to create remote directory: ${s.stderr}`);a?.(`Uploading binary...`);let l=`${N}/${P}`,u=Bun.spawn([`scp`,`-o`,`ConnectTimeout=10`,o,`${t}:${l}`],{stdout:`pipe`,stderr:`pipe`}),d=setTimeout(()=>u.kill(),M),f=await new Response(u.stderr).text(),p=await u.exited;if(clearTimeout(d),p!==0)throw Error(`SCP upload failed (exit ${p}): ${f.trim()}`);a?.(`Installing wrapper script...`);let m=await I(t,[`cat > ${N}/${F} << 'WRAPPER'`,`#!/bin/sh`,`exec bun ${N}/${P} "$@"`,`WRAPPER`,`chmod +x ${N}/${F}`].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,r}from"./createSession-Csaqw8kb.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-l8nsUZ6R.js";async function l({environmentId:e,title:t,events:n,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-l8nsUZ6R.js";async function l({environmentId:e,title:t,events:n,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-DVtMm7Hj.js`),{getOrganizationUUID:p}=await import(`./client-BgdjJNnC.js`),{getOauthConfig:m}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:h}=await import(`./api-CoBZPEi-.js`),{parseGitHubRepository:g}=await import(`./detectRepository-BLwSmun2.js`),{getDefaultBranch:_}=await import(`./git-hSvFiuiG.js`),{getMainLoopModel:v}=await import(`./model-BYSyXf9-.js`),{default:y}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-pVTHa_ED.js`),x=u?.()??f()?.accessToken;if(!x)return r(`[bridge] No access token for session creation`),null;let S=b()?`self-hosted`:await p();if(!S)return r(`[bridge] No org UUID for session creation`),null;let C=null,w=null;if(a){let{parseGitRemote:e}=await import(`./detectRepository-BLwSmun2.js`),t=e(a);if(t){let{host:e,owner:n,name:r}=t,i=o||await _()||void 0;C={type:`git_repository`,url:`https://${e}/${n}/${r}`,revision:i},w={type:`git_repository`,git_info:{type:`github`,repo:`${n}/${r}`,branches:[`claude/${o||`task`}`]}}}else{let e=g(a);if(e){let[t,n]=e.split(`/`);if(t&&n){let e=o||await _()||void 0;C={type:`git_repository`,url:`https://github.com/${t}/${n}`,revision:e},w={type:`git_repository`,git_info:{type:`github`,repo:`${t}/${n}`,branches:[`claude/${o||`task`}`]}}}}}}let T={...t!==void 0&&{title:t},events:n,session_context:{sources:C?[C]:[],outcomes:w?[w]:[],model:v()},environment_id:e,source:`remote-control`,...d&&{permission_mode:d}},E={...h(x),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":S},D=`${l??m().BASE_API_URL}/v1/sessions`,O;try{O=await y.post(D,T,{headers:E,signal:c,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session creation request failed: ${i(e)}`),null}if(!(O.status===200||O.status===201)){let e=s(O.data);return r(`[bridge] Session creation failed with status ${O.status}${e?`: ${e}`:``}`),null}let k=O.data;return!k||typeof k!=`object`||!(`id`in k)||typeof k.id!=`string`?(r(`[bridge] No session ID in response`),null):k.id}async function u(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-DVtMm7Hj.js`),{getOrganizationUUID:a}=await import(`./client-BgdjJNnC.js`),{getOauthConfig:o}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:c}=await import(`./api-CoBZPEi-.js`),{default:l}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-pVTHa_ED.js`),d=t?.getAccessToken?.()??n()?.accessToken;if(!d)return r(`[bridge] No access token for session fetch`),null;let f=u()?`self-hosted`:await a();if(!f)return r(`[bridge] No org UUID for session fetch`),null;let p={...c(d),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":f},m=`${t?.baseUrl??o().BASE_API_URL}/v1/sessions/${e}`;r(`[bridge] Fetching session ${e}`);let h;try{h=await l.get(m,{headers:p,timeout:1e4,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session fetch request failed: ${i(e)}`),null}if(h.status!==200){let e=s(h.data);return r(`[bridge] Session fetch failed with status ${h.status}${e?`: ${e}`:``}`),null}return h.data}async function d(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-DVtMm7Hj.js`),{getOrganizationUUID:i}=await import(`./client-BgdjJNnC.js`),{getOauthConfig:a}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:o}=await import(`./api-CoBZPEi-.js`),{default:c}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-pVTHa_ED.js`),u=t?.getAccessToken?.()??n()?.accessToken;if(!u){r(`[bridge] No access token for session archive`);return}let d=l()?`self-hosted`:await i();if(!d){r(`[bridge] No org UUID for session archive`);return}let f={...o(u),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":d},p=`${t?.baseUrl??a().BASE_API_URL}/v1/sessions/${e}/archive`;r(`[bridge] Archiving session ${e}`);let m=await c.post(p,{},{headers:f,timeout:t?.timeoutMs??1e4,validateStatus:e=>e<500});if(m.status===200)r(`[bridge] Session ${e} archived successfully`);else{let e=s(m.data);r(`[bridge] Session archive failed with status ${m.status}${e?`: ${e}`:``}`)}}async function f(e,t,n){let{getClaudeAIOAuthTokens:a}=await import(`./auth-DVtMm7Hj.js`),{getOrganizationUUID:c}=await import(`./client-BgdjJNnC.js`),{getOauthConfig:l}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:u}=await import(`./api-CoBZPEi-.js`),{default:d}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-pVTHa_ED.js`),p=n?.getAccessToken?.()??a()?.accessToken;if(!p){r(`[bridge] No access token for session title update`);return}let m=f()?`self-hosted`:await c();if(!m){r(`[bridge] No org UUID for session title update`);return}let h={...u(p),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":m},g=o(e),_=`${n?.baseUrl??l().BASE_API_URL}/v1/sessions/${g}`;r(`[bridge] Updating session title: ${g} → ${t}`);try{let e=await d.patch(_,{title:t},{headers:h,timeout:1e4,validateStatus:e=>e<500});if(e.status===200)r(`[bridge] Session title updated successfully`);else{let t=s(e.data);r(`[bridge] Session title update failed with status ${e.status}${t?`: ${t}`:``}`)}}catch(e){r(`[bridge] Session title update request failed: ${i(e)}`)}}var p=e((()=>{n(),t(),c(),a()}));export{f as a,p as i,l as n,u as r,d as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-80gRi2ZW.js";import{Cn as i,Ln as a,Mn as o,Tt as s,Xn as c,Yn as l,kt as u,ln as d,un as f,vt as p,wn as m,wt as h}from"./schemas-BGAvj1T4.js";import{n as g,t as _}from"./v4-f1i_CNUT.js";import{Ct as v,St as ee,cn as y,gr as te,gt as b,ot as x,ut as S,vn as ne}from"./state-sIHsFpDu.js";import{Jc as C,S as re,Tl as w,Uc as ie,ds as ae,us as oe,v as se,wl as ce}from"./paths-4ZWdjPP4.js";import{B as le,D as ue,E as T,O as E,Q as de,U as D,Z as fe,j as pe,l as O,p as k,z as me}from"./debug-otxXY3j-.js";import{n as he,r as A}from"./analytics-DqMQntaB.js";import{n as ge,o as _e}from"./process-DMKLUQIO.js";import{F as ve,P as ye,n as be,v as xe}from"./git-C0IuvuIy.js";import{o as Se,s as j}from"./log-DSV4Ht5l.js";import{s as Ce,u as we}from"./types-KeqFPzY5.js";import{n as M,t as N}from"./lazySchema-B0QShMaQ.js";import{a as Te,i as Ee}from"./genericProcessUtils-tJxf3yqB.js";import{Ag as De,An as Oe,Bg as ke,Cn as Ae,FD as P,Fg as je,G as Me,Gg as Ne,Hg as Pe,Ig as Fe,Js as Ie,K as Le,Kg as F,LD as I,Lg as L,MD as R,Mg as Re,Ng as ze,Pg as Be,Rg as Ve,Ug as He,Us as Ue,Vg as We,Vs as Ge,Wg as Ke,dO as qe,dk as Je,ff as Ye,fu as Xe,jg as Ze,kn as Qe,pf as $e,pu as et,qg as tt,qs as nt,qt as rt,uO as it,uk as at,zg as ot}from"./loadAgentsDir-CQF8qhne.js";import{B as z,H as st,I as B,J as ct,K as lt,R as ut,V as dt,W as ft,q as pt,z as mt}from"./prompt-CogZQuTN.js";import{n as ht,r as gt}from"./cron-DwR6OJuW.js";import{d as _t,h as vt}from"./rcDebugLog-DOXxIr8l.js";import{t as yt}from"./controlMessageCompat-Ds-CF-sM.js";import{dirname as bt,isAbsolute as xt,join as St,resolve as Ct}from"path";import{randomUUID as V}from"crypto";import{mkdir as wt,readFile as Tt,unlink as Et,writeFile as H}from"fs/promises";_(),N(),tt();var Dt=M(()=>c()),Ot=M(()=>m({matcher:a().optional(),hookCallbackIds:s(a()),timeout:i().optional()}).describe(`Configuration for matching and routing hook callbacks.`)),kt=M(()=>m({subtype:f(`initialize`),hooks:o(Be(),s(Ot())).optional(),sdkMcpServers:s(a()).optional(),jsonSchema:o(a(),c()).optional(),systemPrompt:a().optional(),appendSystemPrompt:a().optional(),agents:o(a(),Ze()).optional(),promptSuggestions:u().optional(),agentProgressSummaries:u().optional()}).describe(`Initializes the SDK session with hooks, MCP servers, and agent configuration.`));M(()=>m({commands:s(F()),agents:s(Re()),output_style:a(),available_output_styles:s(a()),models:s(Ve()),account:De(),pid:i().optional().describe(`@internal CLI process PID for tmux socket isolation`),fast_mode_state:ze().optional()}).describe(`Response from session initialization with available commands, models, and account info.`));var At=M(()=>m({subtype:f(`interrupt`)}).describe(`Interrupts the currently running conversation turn.`)),jt=M(()=>m({subtype:f(`can_use_tool`),tool_name:a(),input:o(a(),c()),permission_suggestions:s(ke()).optional(),blocked_path:a().optional(),decision_reason:a().optional(),title:a().optional(),display_name:a().optional(),tool_use_id:a(),agent_id:a().optional(),description:a().optional()}).describe(`Requests permission to use a tool with the given input.`)),Mt=M(()=>m({subtype:f(`set_permission_mode`),mode:ot(),ultraplan:u().optional().describe(`@internal CCR ultraplan session marker.`)}).describe(`Sets the permission mode for tool execution handling.`)),Nt=M(()=>m({subtype:f(`set_model`),model:a().optional()}).describe(`Sets the model to use for subsequent conversation turns.`)),Pt=M(()=>m({subtype:f(`set_max_thinking_tokens`),max_thinking_tokens:i().nullable()}).describe(`Sets the maximum number of thinking tokens for extended thinking.`)),Ft=M(()=>m({subtype:f(`mcp_status`)}).describe(`Requests the current status of all MCP server connections.`));M(()=>m({mcpServers:s(L())}).describe(`Response containing the current status of all MCP server connections.`));var It=M(()=>m({subtype:f(`get_context_usage`)}).describe(`Requests a breakdown of current context window usage by category.`)),Lt=M(()=>m({name:a(),tokens:i(),color:a(),isDeferred:u().optional()})),Rt=M(()=>m({color:a(),isFilled:u(),categoryName:a(),tokens:i(),percentage:i(),squareFullness:i()}));M(()=>m({categories:s(Lt()),totalTokens:i(),maxTokens:i(),rawMaxTokens:i(),percentage:i(),gridRows:s(s(Rt())),model:a(),memoryFiles:s(m({path:a(),type:a(),tokens:i()})),mcpTools:s(m({name:a(),serverName:a(),tokens:i(),isLoaded:u().optional()})),deferredBuiltinTools:s(m({name:a(),tokens:i(),isLoaded:u()})).optional(),systemTools:s(m({name:a(),tokens:i()})).optional(),systemPromptSections:s(m({name:a(),tokens:i()})).optional(),agents:s(m({agentType:a(),source:a(),tokens:i()})),slashCommands:m({totalCommands:i(),includedCommands:i(),tokens:i()}).optional(),skills:m({totalSkills:i(),includedSkills:i(),tokens:i(),skillFrontmatter:s(m({name:a(),source:a(),tokens:i()}))}).optional(),autoCompactThreshold:i().optional(),isAutoCompactEnabled:u(),messageBreakdown:m({toolCallTokens:i(),toolResultTokens:i(),attachmentTokens:i(),assistantMessageTokens:i(),userMessageTokens:i(),toolCallsByType:s(m({name:a(),callTokens:i(),resultTokens:i()})),attachmentsByType:s(m({name:a(),tokens:i()}))}).optional(),apiUsage:m({input_tokens:i(),output_tokens:i(),cache_creation_input_tokens:i(),cache_read_input_tokens:i()}).nullable()}).describe(`Breakdown of current context window usage by category (system prompt, tools, messages, etc.).`));var zt=M(()=>m({subtype:f(`rewind_files`),user_message_id:a(),dry_run:u().optional()}).describe(`Rewinds file changes made since a specific user message.`));M(()=>m({canRewind:u(),error:a().optional(),filesChanged:s(a()).optional(),insertions:i().optional(),deletions:i().optional()}).describe(`Result of a rewindFiles operation.`));var Bt=M(()=>m({subtype:f(`cancel_async_message`),message_uuid:a()}).describe(`Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.`));M(()=>m({cancelled:u()}).describe(`Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).`));var Vt=M(()=>m({subtype:f(`seed_read_state`),path:a(),mtime:i()}).describe(`Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.`)),Ht=M(()=>m({subtype:f(`hook_callback`),callback_id:a(),input:je(),tool_use_id:a().optional()}).describe(`Delivers a hook callback with its input data.`)),Ut=M(()=>m({subtype:f(`mcp_message`),server_name:a(),message:Dt()}).describe(`Sends a JSON-RPC message to a specific MCP server.`)),Wt=M(()=>m({subtype:f(`mcp_set_servers`),servers:o(a(),Fe())}).describe(`Replaces the set of dynamically managed MCP servers.`));M(()=>m({added:s(a()),removed:s(a()),errors:o(a(),a())}).describe(`Result of replacing the set of dynamically managed MCP servers.`));var Gt=M(()=>m({subtype:f(`reload_plugins`)}).describe(`Reloads plugins from disk and returns the refreshed session components.`));M(()=>m({commands:s(F()),agents:s(Re()),plugins:s(m({name:a(),path:a(),source:a().optional()})),mcpServers:s(L()),error_count:i()}).describe(`Refreshed commands, agents, plugins, and MCP server status after reload.`));var Kt=M(()=>m({subtype:f(`mcp_reconnect`),serverName:a()}).describe(`Reconnects a disconnected or failed MCP server.`)),qt=M(()=>m({subtype:f(`mcp_toggle`),serverName:a(),enabled:u()}).describe(`Enables or disables an MCP server.`)),Jt=M(()=>m({subtype:f(`stop_task`),task_id:a()}).describe(`Stops a running task.`)),Yt=M(()=>m({subtype:f(`apply_flag_settings`),settings:o(a(),c())}).describe(`Merges the provided settings into the flag settings layer, updating the active configuration.`)),Xt=M(()=>m({subtype:f(`get_settings`)}).describe(`Returns the effective merged settings and the raw per-source settings.`));M(()=>m({effective:o(a(),c()),sources:s(m({source:p([`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`]),settings:o(a(),c())})).describe(`Ordered low-to-high priority — later entries override earlier ones.`),applied:m({model:a(),effort:p([`low`,`medium`,`high`,`xhigh`,`max`]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe(`Effective merged settings plus raw per-source settings in merge order.`));var Zt=M(()=>m({subtype:f(`elicitation`),mcp_server_name:a(),message:a(),mode:p([`form`,`url`]).optional(),url:a().optional(),elicitation_id:a().optional(),requested_schema:o(a(),c()).optional()}).describe(`Requests the SDK consumer to handle an MCP elicitation (user input request).`)),Qt=M(()=>m({action:p([`accept`,`decline`,`cancel`]),content:o(a(),c()).optional()}).describe(`Response from the SDK consumer for an elicitation request.`)),$t=M(()=>l([At(),jt(),kt(),Mt(),Nt(),Pt(),Ft(),It(),Ht(),Ut(),zt(),Bt(),Vt(),Wt(),Gt(),Kt(),qt(),Jt(),Yt(),Xt(),Zt()])),U=M(()=>m({type:f(`control_request`),request_id:a(),request:$t()})),en=M(()=>m({subtype:f(`success`),request_id:a(),response:o(a(),c()).optional()})),tn=M(()=>m({subtype:f(`error`),request_id:a(),error:a(),pending_permission_requests:s(d(()=>U())).optional()})),nn=M(()=>m({type:f(`control_response`),response:l([en(),tn()])})),rn=M(()=>m({type:f(`control_cancel_request`),request_id:a()}).describe(`Cancels a currently open control request.`)),an=M(()=>m({type:f(`keep_alive`)}).describe(`Keep-alive message to maintain WebSocket connection.`)),on=M(()=>m({type:f(`update_environment_variables`),variables:o(a(),a())}).describe(`Updates environment variables at runtime.`));M(()=>l([We(),He(),Ke(),Pe(),nn(),U(),rn(),an()])),M(()=>l([Ne(),U(),nn(),an(),on()])),n(),y(),fe(),D(),T(),ge(),ye(),Oe(),_(),O(),N(),P(),Ye(),M(()=>g.object({tool_name:g.string().describe(`The name of the tool requesting permission`),input:g.record(g.string(),g.unknown()).describe(`The input for the tool`),tool_use_id:g.string().optional().describe(`The unique tool use request ID`)}));var sn=M(()=>g.enum([`user_temporary`,`user_permanent`,`user_reject`]).optional().catch(void 0)),cn=M(()=>g.object({behavior:g.literal(`allow`),updatedInput:g.record(g.string(),g.unknown()),updatedPermissions:g.array($e()).optional().catch(e=>{k(`Malformed updatedPermissions from SDK host ignored: ${e.error.issues[0]?.message??`unknown`}`,{level:`warn`})}),toolUseID:g.string().optional(),decisionClassification:sn()})),ln=M(()=>g.object({behavior:g.literal(`deny`),message:g.string(),interrupt:g.boolean().optional(),toolUseID:g.string().optional(),decisionClassification:sn()})),W=M(()=>g.union([cn(),ln()]));function G(e,t,n,r){let i={type:`permissionPromptTool`,permissionPromptToolName:t.name,toolResult:e};if(e.behavior===`allow`){let t=e.updatedPermissions;t&&(r.setAppState(e=>({...e,toolPermissionContext:R(e.toolPermissionContext,t)})),I(t));let a=Object.keys(e.updatedInput).length>0?e.updatedInput:n;return{...e,updatedInput:a,decisionReason:i}}else e.behavior===`deny`&&e.interrupt&&(k(`SDK permission prompt deny+interrupt: tool=${t.name} message=${e.message}`),r.abortController.abort());return{...e,decisionReason:i}}he(),Se(),ie(),oe(),re(),it(),_t(),et(),Ae(),Le();var un=/\u2028|\u2029/g;function dn(e){return e.replace(un,e=>e===`\u2028`?`\\u2028`:`\\u2029`)}function fn(e){return dn(E(e))}O(),T(),_(),P();var pn=`SandboxNetworkAccess`;function mn(e){if(e){if(e.type===`classifier`)return e.reason;switch(e.type){case`rule`:case`mode`:case`subcommandResults`:case`permissionPromptTool`:return;case`hook`:case`asyncAgent`:case`sandboxOverride`:case`workingDir`:case`safetyCheck`:case`other`:return e.reason}}}function hn(e,t,n,r){let i;try{i=e.getActivityDescription?.(t)??e.getToolUseSummary?.(t)??e.userFacingName(t)}catch{i=e.name}return{tool_name:e.name,action_description:i,tool_use_id:n,request_id:r,input:t}}var gn=1e3,_n=class{constructor(e,t){r(this,`structuredInput`,void 0),r(this,`pendingRequests`,new Map),r(this,`restoredWorkerState`,Promise.resolve(null)),r(this,`inputClosed`,!1),r(this,`unexpectedResponseCallback`,void 0),r(this,`resolvedToolUseIds`,new Set),r(this,`prependedLines`,[]),r(this,`onControlRequestSent`,void 0),r(this,`onControlRequestResolved`,void 0),r(this,`outbound`,new Xe),this.input=e,this.replayUserMessages=t,this.input=e,this.structuredInput=this.read()}trackResolvedToolUseId(e){let t=e.request;if(t.subtype===`can_use_tool`&&(this.resolvedToolUseIds.add(t.tool_use_id),this.resolvedToolUseIds.size>gn)){let e=this.resolvedToolUseIds.values().next().value;e!==void 0&&this.resolvedToolUseIds.delete(e)}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(e){this.prependedLines.push(E({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})+`
|
|
1
|
+
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-80gRi2ZW.js";import{Cn as i,Ln as a,Mn as o,Tt as s,Xn as c,Yn as l,kt as u,ln as d,un as f,vt as p,wn as m,wt as h}from"./schemas-BGAvj1T4.js";import{n as g,t as _}from"./v4-f1i_CNUT.js";import{Ct as v,St as ee,cn as y,gr as te,gt as b,ot as x,ut as S,vn as ne}from"./state-sIHsFpDu.js";import{Jc as C,S as re,Tl as w,Uc as ie,ds as ae,us as oe,v as se,wl as ce}from"./paths-CEAy4QCs.js";import{B as le,D as ue,E as T,O as E,Q as de,U as D,Z as fe,j as pe,l as O,p as k,z as me}from"./debug-otxXY3j-.js";import{n as he,r as A}from"./analytics-DqMQntaB.js";import{n as ge,o as _e}from"./process-DMKLUQIO.js";import{F as ve,P as ye,n as be,v as xe}from"./git-C0IuvuIy.js";import{o as Se,s as j}from"./log-DSV4Ht5l.js";import{s as Ce,u as we}from"./types-KeqFPzY5.js";import{n as M,t as N}from"./lazySchema-B0QShMaQ.js";import{a as Te,i as Ee}from"./genericProcessUtils-tJxf3yqB.js";import{Ag as De,An as Oe,Bg as ke,Cn as Ae,FD as P,Fg as je,G as Me,Gg as Ne,Hg as Pe,Ig as Fe,Js as Ie,K as Le,Kg as F,LD as I,Lg as L,MD as R,Mg as Re,Ng as ze,Pg as Be,Rg as Ve,Ug as He,Us as Ue,Vg as We,Vs as Ge,Wg as Ke,dO as qe,dk as Je,ff as Ye,fu as Xe,jg as Ze,kn as Qe,pf as $e,pu as et,qg as tt,qs as nt,qt as rt,uO as it,uk as at,zg as ot}from"./loadAgentsDir-DC4jN6-f.js";import{B as z,H as st,I as B,J as ct,K as lt,R as ut,V as dt,W as ft,q as pt,z as mt}from"./prompt-BHI7PZe4.js";import{n as ht,r as gt}from"./cron-DwR6OJuW.js";import{d as _t,h as vt}from"./rcDebugLog-C0Bam8V9.js";import{t as yt}from"./controlMessageCompat-Ds-CF-sM.js";import{dirname as bt,isAbsolute as xt,join as St,resolve as Ct}from"path";import{randomUUID as V}from"crypto";import{mkdir as wt,readFile as Tt,unlink as Et,writeFile as H}from"fs/promises";_(),N(),tt();var Dt=M(()=>c()),Ot=M(()=>m({matcher:a().optional(),hookCallbackIds:s(a()),timeout:i().optional()}).describe(`Configuration for matching and routing hook callbacks.`)),kt=M(()=>m({subtype:f(`initialize`),hooks:o(Be(),s(Ot())).optional(),sdkMcpServers:s(a()).optional(),jsonSchema:o(a(),c()).optional(),systemPrompt:a().optional(),appendSystemPrompt:a().optional(),agents:o(a(),Ze()).optional(),promptSuggestions:u().optional(),agentProgressSummaries:u().optional()}).describe(`Initializes the SDK session with hooks, MCP servers, and agent configuration.`));M(()=>m({commands:s(F()),agents:s(Re()),output_style:a(),available_output_styles:s(a()),models:s(Ve()),account:De(),pid:i().optional().describe(`@internal CLI process PID for tmux socket isolation`),fast_mode_state:ze().optional()}).describe(`Response from session initialization with available commands, models, and account info.`));var At=M(()=>m({subtype:f(`interrupt`)}).describe(`Interrupts the currently running conversation turn.`)),jt=M(()=>m({subtype:f(`can_use_tool`),tool_name:a(),input:o(a(),c()),permission_suggestions:s(ke()).optional(),blocked_path:a().optional(),decision_reason:a().optional(),title:a().optional(),display_name:a().optional(),tool_use_id:a(),agent_id:a().optional(),description:a().optional()}).describe(`Requests permission to use a tool with the given input.`)),Mt=M(()=>m({subtype:f(`set_permission_mode`),mode:ot(),ultraplan:u().optional().describe(`@internal CCR ultraplan session marker.`)}).describe(`Sets the permission mode for tool execution handling.`)),Nt=M(()=>m({subtype:f(`set_model`),model:a().optional()}).describe(`Sets the model to use for subsequent conversation turns.`)),Pt=M(()=>m({subtype:f(`set_max_thinking_tokens`),max_thinking_tokens:i().nullable()}).describe(`Sets the maximum number of thinking tokens for extended thinking.`)),Ft=M(()=>m({subtype:f(`mcp_status`)}).describe(`Requests the current status of all MCP server connections.`));M(()=>m({mcpServers:s(L())}).describe(`Response containing the current status of all MCP server connections.`));var It=M(()=>m({subtype:f(`get_context_usage`)}).describe(`Requests a breakdown of current context window usage by category.`)),Lt=M(()=>m({name:a(),tokens:i(),color:a(),isDeferred:u().optional()})),Rt=M(()=>m({color:a(),isFilled:u(),categoryName:a(),tokens:i(),percentage:i(),squareFullness:i()}));M(()=>m({categories:s(Lt()),totalTokens:i(),maxTokens:i(),rawMaxTokens:i(),percentage:i(),gridRows:s(s(Rt())),model:a(),memoryFiles:s(m({path:a(),type:a(),tokens:i()})),mcpTools:s(m({name:a(),serverName:a(),tokens:i(),isLoaded:u().optional()})),deferredBuiltinTools:s(m({name:a(),tokens:i(),isLoaded:u()})).optional(),systemTools:s(m({name:a(),tokens:i()})).optional(),systemPromptSections:s(m({name:a(),tokens:i()})).optional(),agents:s(m({agentType:a(),source:a(),tokens:i()})),slashCommands:m({totalCommands:i(),includedCommands:i(),tokens:i()}).optional(),skills:m({totalSkills:i(),includedSkills:i(),tokens:i(),skillFrontmatter:s(m({name:a(),source:a(),tokens:i()}))}).optional(),autoCompactThreshold:i().optional(),isAutoCompactEnabled:u(),messageBreakdown:m({toolCallTokens:i(),toolResultTokens:i(),attachmentTokens:i(),assistantMessageTokens:i(),userMessageTokens:i(),toolCallsByType:s(m({name:a(),callTokens:i(),resultTokens:i()})),attachmentsByType:s(m({name:a(),tokens:i()}))}).optional(),apiUsage:m({input_tokens:i(),output_tokens:i(),cache_creation_input_tokens:i(),cache_read_input_tokens:i()}).nullable()}).describe(`Breakdown of current context window usage by category (system prompt, tools, messages, etc.).`));var zt=M(()=>m({subtype:f(`rewind_files`),user_message_id:a(),dry_run:u().optional()}).describe(`Rewinds file changes made since a specific user message.`));M(()=>m({canRewind:u(),error:a().optional(),filesChanged:s(a()).optional(),insertions:i().optional(),deletions:i().optional()}).describe(`Result of a rewindFiles operation.`));var Bt=M(()=>m({subtype:f(`cancel_async_message`),message_uuid:a()}).describe(`Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.`));M(()=>m({cancelled:u()}).describe(`Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).`));var Vt=M(()=>m({subtype:f(`seed_read_state`),path:a(),mtime:i()}).describe(`Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.`)),Ht=M(()=>m({subtype:f(`hook_callback`),callback_id:a(),input:je(),tool_use_id:a().optional()}).describe(`Delivers a hook callback with its input data.`)),Ut=M(()=>m({subtype:f(`mcp_message`),server_name:a(),message:Dt()}).describe(`Sends a JSON-RPC message to a specific MCP server.`)),Wt=M(()=>m({subtype:f(`mcp_set_servers`),servers:o(a(),Fe())}).describe(`Replaces the set of dynamically managed MCP servers.`));M(()=>m({added:s(a()),removed:s(a()),errors:o(a(),a())}).describe(`Result of replacing the set of dynamically managed MCP servers.`));var Gt=M(()=>m({subtype:f(`reload_plugins`)}).describe(`Reloads plugins from disk and returns the refreshed session components.`));M(()=>m({commands:s(F()),agents:s(Re()),plugins:s(m({name:a(),path:a(),source:a().optional()})),mcpServers:s(L()),error_count:i()}).describe(`Refreshed commands, agents, plugins, and MCP server status after reload.`));var Kt=M(()=>m({subtype:f(`mcp_reconnect`),serverName:a()}).describe(`Reconnects a disconnected or failed MCP server.`)),qt=M(()=>m({subtype:f(`mcp_toggle`),serverName:a(),enabled:u()}).describe(`Enables or disables an MCP server.`)),Jt=M(()=>m({subtype:f(`stop_task`),task_id:a()}).describe(`Stops a running task.`)),Yt=M(()=>m({subtype:f(`apply_flag_settings`),settings:o(a(),c())}).describe(`Merges the provided settings into the flag settings layer, updating the active configuration.`)),Xt=M(()=>m({subtype:f(`get_settings`)}).describe(`Returns the effective merged settings and the raw per-source settings.`));M(()=>m({effective:o(a(),c()),sources:s(m({source:p([`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`]),settings:o(a(),c())})).describe(`Ordered low-to-high priority — later entries override earlier ones.`),applied:m({model:a(),effort:p([`low`,`medium`,`high`,`xhigh`,`max`]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe(`Effective merged settings plus raw per-source settings in merge order.`));var Zt=M(()=>m({subtype:f(`elicitation`),mcp_server_name:a(),message:a(),mode:p([`form`,`url`]).optional(),url:a().optional(),elicitation_id:a().optional(),requested_schema:o(a(),c()).optional()}).describe(`Requests the SDK consumer to handle an MCP elicitation (user input request).`)),Qt=M(()=>m({action:p([`accept`,`decline`,`cancel`]),content:o(a(),c()).optional()}).describe(`Response from the SDK consumer for an elicitation request.`)),$t=M(()=>l([At(),jt(),kt(),Mt(),Nt(),Pt(),Ft(),It(),Ht(),Ut(),zt(),Bt(),Vt(),Wt(),Gt(),Kt(),qt(),Jt(),Yt(),Xt(),Zt()])),U=M(()=>m({type:f(`control_request`),request_id:a(),request:$t()})),en=M(()=>m({subtype:f(`success`),request_id:a(),response:o(a(),c()).optional()})),tn=M(()=>m({subtype:f(`error`),request_id:a(),error:a(),pending_permission_requests:s(d(()=>U())).optional()})),nn=M(()=>m({type:f(`control_response`),response:l([en(),tn()])})),rn=M(()=>m({type:f(`control_cancel_request`),request_id:a()}).describe(`Cancels a currently open control request.`)),an=M(()=>m({type:f(`keep_alive`)}).describe(`Keep-alive message to maintain WebSocket connection.`)),on=M(()=>m({type:f(`update_environment_variables`),variables:o(a(),a())}).describe(`Updates environment variables at runtime.`));M(()=>l([We(),He(),Ke(),Pe(),nn(),U(),rn(),an()])),M(()=>l([Ne(),U(),nn(),an(),on()])),n(),y(),fe(),D(),T(),ge(),ye(),Oe(),_(),O(),N(),P(),Ye(),M(()=>g.object({tool_name:g.string().describe(`The name of the tool requesting permission`),input:g.record(g.string(),g.unknown()).describe(`The input for the tool`),tool_use_id:g.string().optional().describe(`The unique tool use request ID`)}));var sn=M(()=>g.enum([`user_temporary`,`user_permanent`,`user_reject`]).optional().catch(void 0)),cn=M(()=>g.object({behavior:g.literal(`allow`),updatedInput:g.record(g.string(),g.unknown()),updatedPermissions:g.array($e()).optional().catch(e=>{k(`Malformed updatedPermissions from SDK host ignored: ${e.error.issues[0]?.message??`unknown`}`,{level:`warn`})}),toolUseID:g.string().optional(),decisionClassification:sn()})),ln=M(()=>g.object({behavior:g.literal(`deny`),message:g.string(),interrupt:g.boolean().optional(),toolUseID:g.string().optional(),decisionClassification:sn()})),W=M(()=>g.union([cn(),ln()]));function G(e,t,n,r){let i={type:`permissionPromptTool`,permissionPromptToolName:t.name,toolResult:e};if(e.behavior===`allow`){let t=e.updatedPermissions;t&&(r.setAppState(e=>({...e,toolPermissionContext:R(e.toolPermissionContext,t)})),I(t));let a=Object.keys(e.updatedInput).length>0?e.updatedInput:n;return{...e,updatedInput:a,decisionReason:i}}else e.behavior===`deny`&&e.interrupt&&(k(`SDK permission prompt deny+interrupt: tool=${t.name} message=${e.message}`),r.abortController.abort());return{...e,decisionReason:i}}he(),Se(),ie(),oe(),re(),it(),_t(),et(),Ae(),Le();var un=/\u2028|\u2029/g;function dn(e){return e.replace(un,e=>e===`\u2028`?`\\u2028`:`\\u2029`)}function fn(e){return dn(E(e))}O(),T(),_(),P();var pn=`SandboxNetworkAccess`;function mn(e){if(e){if(e.type===`classifier`)return e.reason;switch(e.type){case`rule`:case`mode`:case`subcommandResults`:case`permissionPromptTool`:return;case`hook`:case`asyncAgent`:case`sandboxOverride`:case`workingDir`:case`safetyCheck`:case`other`:return e.reason}}}function hn(e,t,n,r){let i;try{i=e.getActivityDescription?.(t)??e.getToolUseSummary?.(t)??e.userFacingName(t)}catch{i=e.name}return{tool_name:e.name,action_description:i,tool_use_id:n,request_id:r,input:t}}var gn=1e3,_n=class{constructor(e,t){r(this,`structuredInput`,void 0),r(this,`pendingRequests`,new Map),r(this,`restoredWorkerState`,Promise.resolve(null)),r(this,`inputClosed`,!1),r(this,`unexpectedResponseCallback`,void 0),r(this,`resolvedToolUseIds`,new Set),r(this,`prependedLines`,[]),r(this,`onControlRequestSent`,void 0),r(this,`onControlRequestResolved`,void 0),r(this,`outbound`,new Xe),this.input=e,this.replayUserMessages=t,this.input=e,this.structuredInput=this.read()}trackResolvedToolUseId(e){let t=e.request;if(t.subtype===`can_use_tool`&&(this.resolvedToolUseIds.add(t.tool_use_id),this.resolvedToolUseIds.size>gn)){let e=this.resolvedToolUseIds.values().next().value;e!==void 0&&this.resolvedToolUseIds.delete(e)}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(e){this.prependedLines.push(E({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})+`
|
|
2
2
|
`)}async*read(){let e=``,t=async function*(){for(;;){this.prependedLines.length>0&&(e=this.prependedLines.join(``)+e,this.prependedLines=[]);let t=e.indexOf(`
|
|
3
3
|
`);if(t===-1)break;let n=e.slice(0,t);e=e.slice(t+1);let r=await this.processLine(n);r&&(ve(`info`,`cli_stdin_message_parsed`,{type:r.type}),yield r)}}.bind(this);yield*t();for await(let n of this.input)e+=n,yield*t();if(e){let t=await this.processLine(e);t&&(yield t)}this.inputClosed=!0;for(let e of this.pendingRequests.values())e.reject(Error(`Tool permission stream closed before response received`))}getPendingPermissionRequests(){return Array.from(this.pendingRequests.values()).map(e=>e.request).filter(e=>e.request.subtype===`can_use_tool`)}setUnexpectedResponseCallback(e){this.unexpectedResponseCallback=e}injectControlResponse(e){let t=e.response,n=t?.request_id;if(!n)return;let r=this.pendingRequests.get(n);if(r)if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n),this.write({type:`control_cancel_request`,request_id:n}),t.subtype===`error`)r.reject(Error(t.error));else{let e=t.response;if(r.schema)try{r.resolve(r.schema.parse(e))}catch(e){r.reject(e)}else r.resolve({})}}setOnControlRequestSent(e){this.onControlRequestSent=e}setOnControlRequestResolved(e){this.onControlRequestResolved=e}async processLine(e){if(e)try{let t=yt(ue(e));if(t.type===`keep_alive`)return;if(t.type===`update_environment_variables`){let e=t.variables??{},n=Object.keys(e);for(let[t,n]of Object.entries(e))process.env[t]=n;k(`[structuredIO] applied update_environment_variables: ${n.join(`, `)}`);return}if(t.type===`control_response`){let e=`uuid`in t&&typeof t.uuid==`string`?t.uuid:void 0;e&&qe(e,`completed`);let n=t.response,r=this.pendingRequests.get(n.request_id);if(!r){let e=(n.subtype===`success`?n.response:void 0)?.toolUseID;if(typeof e==`string`&&this.resolvedToolUseIds.has(e)){k(`Ignoring duplicate control_response for already-resolved toolUseID=${e} request_id=${n.request_id}`);return}this.unexpectedResponseCallback&&await this.unexpectedResponseCallback(t);return}if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n.request_id),r.request.request.subtype===`can_use_tool`&&this.onControlRequestResolved&&this.onControlRequestResolved(n.request_id),n.subtype===`error`){r.reject(Error(n.error??`Unknown error`));return}let i=n.response;if(r.schema)try{r.resolve(r.schema.parse(i))}catch(e){r.reject(e)}else r.resolve({});return this.replayUserMessages?t:void 0}if(t.type!==`user`&&t.type!==`control_request`&&t.type!==`assistant`&&t.type!==`system`){k(`Ignoring unknown message type: ${t.type}`,{level:`warn`});return}return t.type===`control_request`?(t.request||vn(`Error: Missing request on control_request`),t):(t.type===`assistant`||t.type===`system`||t.message?.role!==`user`&&vn(`Error: Expected message role 'user', got '${t.message?.role}'`),t)}catch(t){console.error(`Error parsing streaming input line: ${e}: ${t}`),process.exit(1)}}async write(e){_e(fn(e)+`
|
|
4
4
|
`)}async sendRequest(e,t,n,r=V()){let i={type:`control_request`,request_id:r,request:e};if(this.inputClosed)throw Error(`Stream closed`);if(n?.aborted)throw Error(`Request aborted`);this.outbound.enqueue(i),e.subtype===`can_use_tool`&&this.onControlRequestSent&&this.onControlRequestSent(i);let a=()=>{this.outbound.enqueue({type:`control_cancel_request`,request_id:r});let e=this.pendingRequests.get(r);e&&(this.trackResolvedToolUseId(e.request),e.reject(new pe))};n&&n.addEventListener(`abort`,a,{once:!0});try{return await new Promise((n,i)=>{this.pendingRequests.set(r,{request:{type:`control_request`,request_id:r,request:e},resolve:e=>{n(e)},reject:i,schema:t})})}finally{n&&n.removeEventListener(`abort`,a),this.pendingRequests.delete(r)}}createCanUseTool(e){return async(t,n,r,i,a,o)=>{let s=o??await Me(t,n,r,i,a);if(s.behavior===`allow`||s.behavior===`deny`)return s;let c=new AbortController,l=r.abortController.signal,u=()=>c.abort();l.addEventListener(`abort`,u,{once:!0});try{let i=yn(t.name,a,n,r,s.suggestions).then(e=>({source:`hook`,decision:e})),o=V();e?.(hn(t,n,a,o));let l=this.sendRequest({subtype:`can_use_tool`,tool_name:t.name,input:n,permission_suggestions:s.suggestions,blocked_path:s.blockedPath,decision_reason:mn(s.decisionReason),tool_use_id:a,agent_id:r.agentId},W(),c.signal,o).then(e=>({source:`sdk`,result:e})),u=await Promise.race([i,l]);return u.source===`hook`?u.decision?(l.catch(()=>{}),c.abort(),u.decision):G((await l).result,t,n,r):G(u.result,t,n,r)}catch(e){return G({behavior:`deny`,message:`Tool permission request failed: ${e}`,toolUseID:a},t,n,r)}finally{this.getPendingPermissionRequests().length===0&&vt(`running`),l.removeEventListener(`abort`,u)}}}createHookCallback(e,t){return{type:`callback`,timeout:t,callback:async(t,n,r)=>{try{return await this.sendRequest({subtype:`hook_callback`,callback_id:e,input:t,tool_use_id:n||void 0},Qe(),r)}catch(t){return console.error(`Error in hook callback ${e}:`,t),{}}}}}async handleElicitation(e,t,n,r,i,a,o){try{return await this.sendRequest({subtype:`elicitation`,mcp_server_name:e,message:t,mode:i,url:a,elicitation_id:o,requested_schema:n},Qt(),r)}catch{return{action:`cancel`}}}createSandboxAskCallback(){return async e=>{try{return(await this.sendRequest({subtype:`can_use_tool`,tool_name:pn,input:{host:e.host},tool_use_id:V(),description:`Allow network connection to ${e.host}?`},W())).behavior===`allow`}catch{return!1}}}async sendMcpMessage(e,t){return(await this.sendRequest({subtype:`mcp_message`,server_name:e,message:t},m({mcp_response:h()}))).mcp_response}};function vn(e){console.error(e),process.exit(1)}async function yn(e,t,n,r,i){let a=r.getAppState().toolPermissionContext.mode,o=rt(e,t,n,r,a,i,r.abortController.signal);for await(let e of o)if(e.permissionRequestResult&&(e.permissionRequestResult.behavior===`allow`||e.permissionRequestResult.behavior===`deny`)){let t=e.permissionRequestResult;if(t.behavior===`allow`){let e=t.updatedInput||n,i=t.updatedPermissions??[];if(i.length>0){I(i);let e=R(r.getAppState().toolPermissionContext,i);r.setAppState(t=>t.toolPermissionContext===e?t:{...t,toolPermissionContext:e})}return{behavior:`allow`,updatedInput:e,userModified:!1,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}else return{behavior:`deny`,message:t.message||`Permission denied by PermissionRequest hook`,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}}Je();function bn(e){if(e.type!==`user`)return;let t=e.message?.content;if(!t||Array.isArray(t)&&t.length===0)return;let n=`uuid`in e&&typeof e.uuid==`string`?e.uuid:void 0;return{content:Array.isArray(t)?xn(t):t,uuid:n}}function xn(e){return e.some(Sn)?e.map(e=>{if(!Sn(e))return e;let t=e.source,n=typeof t.mediaType==`string`&&t.mediaType?t.mediaType:at(e.source.data);return{...e,source:{type:`base64`,media_type:n,data:e.source.data}}}):e}function Sn(e){return e.type!==`image`||e.source?.type!==`base64`?!1:!e.source.media_type}ce(),O(),D(),xe(),nt();function Cn(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=Tn(s.source,n?.projectRoot);e?s.sourceIsFallback||w(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function wn(e){let t=Ue();if(Object.keys(t).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let n;try{n=await Ie()}catch(e){j(e),n={}}let r=Cn(t,n,{projectRoot:x()}),i=[...r.missing.map(e=>({name:e,source:Tn(t[e].source),action:`install`})),...r.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],a=[],o=[];for(let t of i){if(e?.skip?.(t.name,t.source)){a.push(t.name);continue}if(t.action===`update`&&ae(t.source)&&!await C(t.source.path)){k(`[reconcile] '${t.name}' declared path does not exist; keeping materialized entry`),a.push(t.name);continue}o.push(t)}if(o.length===0)return{installed:[],updated:[],failed:[],upToDate:r.upToDate,skipped:a};k(`[reconcile] ${o.length} marketplace(s): ${o.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let s=[],c=[],l=[];for(let t=0;t<o.length;t++){let{name:n,source:r,action:i}=o[t];e?.onProgress?.({type:`installing`,name:n,action:i,index:t+1,total:o.length});try{let t=await Ge(r);i===`install`?s.push(n):c.push(n),e?.onProgress?.({type:`installed`,name:n,alreadyMaterialized:t.alreadyMaterialized})}catch(t){let r=me(t);l.push({name:n,error:r}),e?.onProgress?.({type:`failed`,name:n,error:r}),j(t)}}return{installed:s,updated:c,failed:l,upToDate:r.upToDate,skipped:a}}function Tn(e,t){if((e.source===`directory`||e.source===`file`)&&!xt(e.path)){let n=t??x(),r=be(n);return{...e,path:Ct(r??n,e.path)}}return e}function K(e){return St(e??S(),kn)}async function En(e){let t;try{t=await Tt(K(e),`utf8`)}catch{return}let n=An().safeParse(we(t,!1));return n.success?n.data:void 0}async function Dn(e,t){let n=K(t),r=E(e);try{return await H(n,r,{flag:`wx`}),!0}catch(e){let t=le(e);if(t===`EEXIST`)return!1;if(t===`ENOENT`){await wt(bt(n),{recursive:!0});try{return await H(n,r,{flag:`wx`}),!0}catch(e){if(le(e)===`EEXIST`)return!1;throw e}}throw e}}function q(e){Y?.(),Y=de(async()=>{await J(e)})}async function On(e){let t=e?.dir,n=e?.lockIdentity??v(),r={sessionId:n,pid:process.pid,acquiredAt:Date.now()};if(await Dn(r,t))return X=void 0,q(e),k(`[ScheduledTasks] acquired scheduler lock (PID ${process.pid})`),!0;let i=await En(t);return i?.sessionId===n?(i.pid!==process.pid&&(await H(K(t),E(r)),q(e)),!0):i&&Te(i.pid)?(X!==i.sessionId&&(X=i.sessionId,k(`[ScheduledTasks] scheduler lock held by session ${i.sessionId} (PID ${i.pid})`)),!1):(i&&k(`[ScheduledTasks] recovering stale scheduler lock from PID ${i.pid}`),await Et(K(t)).catch(()=>{}),await Dn(r,t)?(X=void 0,q(e),!0):!1)}async function J(e){Y?.(),Y=void 0,X=void 0;let t=e?.dir,n=e?.lockIdentity??v(),r=await En(t);if(!(!r||r.sessionId!==n))try{await Et(K(t)),k(`[ScheduledTasks] released scheduler lock`)}catch{}}var kn,An,Y,X,jn=e((()=>{_(),y(),O(),D(),Ee(),Ce(),N(),T(),kn=St(`.claude`,`scheduled_tasks.lock`),An=M(()=>m({sessionId:a(),pid:i(),acquiredAt:i()}))})),Mn=t({buildMissedTaskNotification:()=>Fn,createCronScheduler:()=>Pn,isRecurringTaskAged:()=>Nn});function Nn(e,t,n){return n===0?!1:!!(e.recurring&&!e.permanent&&t-e.createdAt>=n)}function Pn(e){let{onFire:t,isLoading:n,assistantMode:r=!1,onFireTask:i,onMissed:a,dir:o,lockIdentity:s,getJitterConfig:c,isKilled:l,filter:u}=e,d=o||s?{dir:o,lockIdentity:s}:void 0,f=[],p=new Map,m=new Set,h=new Set,g=null,_=null,v=null,y=null,x=!1,S=!1;async function C(e){let n=await pt(o);if(x||(f=n,!e))return;let r=ut(n,Date.now()).filter(e=>!e.recurring&&!m.has(e.id)&&(!u||u(e)));if(r.length>0){for(let e of r)m.add(e.id),p.set(e.id,1/0);A(`tengu_scheduled_task_missed`,{count:r.length,taskIds:r.map(e=>e.id).join(`,`)}),a?a(r):t(Fn(r)),ct(r.map(e=>e.id),o).catch(e=>k(`[ScheduledTasks] failed to remove missed tasks: ${e}`)),k(`[ScheduledTasks] surfaced ${r.length} missed one-shot task(s)`)}}function re(){if(l?.()||n()&&!r)return;let e=Date.now(),a=new Set,s=[],d=c?.()??B;function m(n,r){if(u&&!u(n)||(a.add(n.id),h.has(n.id)))return;let c=p.get(n.id);if(c===void 0&&(c=n.recurring?st(n.cron,n.lastFiredAt??n.createdAt,n.id,d)??1/0:lt(n.cron,n.createdAt,n.id,d)??1/0,p.set(n.id,c),k(`[ScheduledTasks] scheduled ${n.id} for ${c===1/0?`never`:new Date(c).toISOString()}`)),e<c)return;k(`[ScheduledTasks] firing ${n.id}${n.recurring?` (recurring)`:``}`),A(`tengu_scheduled_task_fire`,{recurring:n.recurring??!1,taskId:n.id}),i?i(n):t(n.prompt);let l=Nn(n,e,d.recurringMaxAgeMs);if(l){let t=Math.floor((e-n.createdAt)/1e3/60/60);k(`[ScheduledTasks] recurring task ${n.id} aged out (${t}h since creation), deleting after final fire`),A(`tengu_scheduled_task_expired`,{taskId:n.id,ageHours:t})}if(n.recurring&&!l){let t=st(n.cron,e,n.id,d)??1/0;p.set(n.id,t),r||s.push(n.id)}else r?(ne([n.id]),p.delete(n.id)):(h.add(n.id),ct([n.id],o).catch(e=>k(`[ScheduledTasks] failed to remove task ${n.id}: ${e}`)).finally(()=>h.delete(n.id)),p.delete(n.id))}if(S){for(let e of f)m(e,!1);if(s.length>0){for(let e of s)h.add(e);ft(s,e,o).catch(e=>k(`[ScheduledTasks] failed to persist lastFiredAt: ${e}`)).finally(()=>{for(let e of s)h.delete(e)})}}if(o===void 0)for(let e of ee())m(e,!0);if(a.size===0){p.clear();return}for(let e of p.keys())a.has(e)||p.delete(e)}async function w(){if(x)return;g&&(clearInterval(g),g=null);let{default:e}=await import(`./chokidar-BcI3rIKm.js`);if(x)return;if(S=await On(d).catch(()=>!1),x){S&&(S=!1,J(d));return}S||(v=setInterval(()=>{On(d).then(e=>{if(x){e&&J(d);return}e&&(S=!0,v&&(clearInterval(v),v=null))}).catch(e=>k(String(e),{level:`error`}))},Q),v.unref?.()),C(!0);let t=mt(o);y=e.watch(t,{persistent:!1,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:In},ignorePermissionErrors:!0}),y.on(`add`,()=>void C(!1)),y.on(`change`,()=>void C(!1)),y.on(`unlink`,()=>{x||(f=[],p.clear())}),_=setInterval(re,Z),_.unref?.()}return{start(){if(x=!1,o!==void 0){k(`[ScheduledTasks] scheduler start() — dir=${o}, hasTasks=${z(o)}`),w();return}if(k(`[ScheduledTasks] scheduler start() — enabled=${b()}, hasTasks=${z()}`),!b()&&(r||z())&&te(!0),b()){w();return}g=setInterval(e=>{b()&&e()},Z,w),g.unref?.()},stop(){x=!0,g&&(clearInterval(g),g=null),_&&(clearInterval(_),_=null),v&&(clearInterval(v),v=null),y?.close(),y=null,S&&(S=!1,J(d))},getNextFireTime(){let e=1/0;for(let t of p.values())t<e&&(e=t);return e===1/0?null:e}}}function Fn(e){let t=e.length>1;return`${`The following one-shot scheduled task${t?`s were`:` was`} missed while Claude was not running. ${t?`They have`:`It has`} already been removed from .claude/scheduled_tasks.json.\n\nDo NOT execute ${t?`these prompts`:`this prompt`} yet. First use the AskUserQuestion tool to ask whether to run ${t?`each one`:`it`} now. Only execute if the user confirms.`}\n\n${e.map(e=>{let t=`[${ht(e.cron)}, created ${new Date(e.createdAt).toLocaleString()}]`,n=(e.prompt.match(/`+/g)??[]).reduce((e,t)=>Math.max(e,t.length),0),r="`".repeat(Math.max(3,n+1));return`${t}\n${r}\n${e.prompt}\n${r}`}).join(`
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Cn as i,F as a,In as o,Ln as s,Mn as c,Rn as l,T as u,Ut as d,_ as f,b as p,g as m,h,l as ee,m as te,t as g,tt as _,x as v,xt as y}from"./src-Di342QoJ.js";import{t as b}from"./jsx-runtime-D-D469L8.js";import{Ct as ne,cn as x,ot as re}from"./state-sIHsFpDu.js";import{Mr as ie,Pr as ae}from"./paths-CEAy4QCs.js";import{D as S,E as oe,l as C,p as w}from"./debug-otxXY3j-.js";import{n as se,r as T}from"./analytics-DqMQntaB.js";import{i as ce,v as le}from"./git-C0IuvuIy.js";import{a as ue,o as E,s as de}from"./log-DSV4Ht5l.js";import{b as D,x as fe}from"./teammate-CbskW5G9.js";import{T as O,b as pe,f as me,h as he}from"./startupProfiler-CBcN1Chw.js";import{DC as ge,EC as k,Fr as A,Jr as _e,Ky as ve,Lr as ye,R_ as be,Ri as xe,Si as Se,Wy as Ce,Yu as we,Zu as Te,aS as Ee,dS as De,fS as Oe,gb as ke,hb as Ae,kr as j,oS as je,xr as Me,z_ as Ne,zi as Pe,zr as Fe}from"./loadAgentsDir-DC4jN6-f.js";import{i as Ie,r as M}from"./shellQuote-CBjhlaFO.js";import{t as N}from"./useKeybinding-DPOUuymz.js";import{t as Le}from"./useTerminalSize-Du-EamDN.js";import{n as Re,t as ze}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{t as Be}from"./SearchBox-Bu4gYF0J.js";import{n as Ve,t as He}from"./useSearchInput-CwxF3CHN.js";import{n as Ue,t as P}from"./Messages-ltcn1Qkf.js";import{n as We,t as Ge}from"./fuse-D7icKomM.js";import{sep as F}from"path";function Ke({log:e,onExit:t,onSelect:n}){let[r,i]=I.useState(null);I.useEffect(()=>{i(null),Fe(e)&&_e(e).then(i)},[e]);let a=Fe(e)&&r===null,o=r??e,s=j(o)||``,c=we();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,I.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,L.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,L.jsx)(ee,{message:`Loading session…`}),(0,L.jsx)(p,{dimColor:!0,children:(0,L.jsx)(h,{children:(0,L.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,L.jsxs)(v,{flexDirection:`column`,children:[(0,L.jsx)(P,{messages:o.messages,tools:c,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:s,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,L.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,L.jsxs)(p,{children:[he(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,L.jsx)(p,{dimColor:!0,children:(0,L.jsxs)(h,{children:[(0,L.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,L.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var I,L,R=e((()=>{I=t(l(),1),g(),N(),Te(),pe(),A(),ge(),Ue(),L=b()}));function qe(e,t){if(e===B)return 3+V;let n=i(e),r=t?Math.min(n,t-V-H):n;return Math.max(0,r)+V+H}function Je(e,t){let n=t-V-H;return i(e)<=n?e:n<=1?e.charAt(0):O(e,n)}function Ye({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(U,W),s=n-a-o-2,c=Math.max(0,Math.min(t,e.length-1)),l=Math.max(20,Math.floor(s/2)),u=e.map(e=>qe(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-tt,n=u[c]??0;for(d=c,f=c+1;d>0||f<e.length;){let r=d>0,i=f<e.length;if(r){let e=(u[d-1]??0)+1;if(n+e<=t){d--,n+=e;continue}}if(i){let e=(u[f]??0)+1;if(n+e<=t){f++,n+=e;continue}}break}}let m=d,h=e.length-f,ee=e.slice(d,f),te=ee.map((e,t)=>d+t);return(0,z.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,z.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,z.jsxs)(p,{dimColor:!0,children:[Xe,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===B?e:`#${Je(e,l-V)}`;return(0,z.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,z.jsxs)(p,{dimColor:!0,children:[Ze,h,Qe]}):(0,z.jsx)(p,{dimColor:!0,children:$e})]})}var z,B,V,H,Xe,Ze,Qe,$e,et,tt,U,W,nt=e((()=>{l(),g(),pe(),z=b(),B=`All`,V=2,H=1,Xe=`← `,Ze=`→`,Qe=` (tab to cycle)`,$e=`(tab to cycle)`,et=2,tt=2+et+1,U=1+et+15,W=14}));function rt({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:o=`expanded`,isDisabled:s=!1,hideIndexes:c=!1,isNodeExpanded:l,onExpand:u,onCollapse:d,getParentPrefix:f,getChildPrefix:p,onUpFromFirstItem:m}){let[h,ee]=G.useState(new Set),te=G.useRef(!1),g=G.useRef(null),_=G.useCallback(e=>l?l(e):h.has(e),[l,h]),y=G.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),b=G.useCallback(e=>e?`▼ `:`▶ `,[]),ne=G.useCallback(e=>` ▸ `,[]),x=f??b,re=p??ne,ie=G.useCallback(e=>{let t=``;return e.hasChildren?t=x(e.isExpanded):e.depth>0&&(t=re(e.depth)),t+e.node.label},[x,re]),ae=G.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=G.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),oe=G.useCallback(e=>y.find(t=>t.node.id===e),[y]),C=G.useCallback((e,t)=>{let n=oe(e);!n||!n.hasChildren||(t?u?u(e):ee(t=>new Set(t).add(e)):d?d(e):ee(t=>{let n=new Set(t);return n.delete(e),n}))},[oe,u,d]);return(0,it.jsx)(v,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=oe(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),C(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),C(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),te.current=!0,C(t.parentId,!1),r)){let e=S.get(t.parentId);e&&r(e)}}}},children:(0,it.jsx)(Ee,{options:ae,onChange:G.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:G.useCallback(e=>{if(te.current){te.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=S.get(e);t&&r(t)}},[r,S]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:o,isDisabled:s,hideIndexes:c,onUpFromFirstItem:m})})}var G,it,at=e((()=>{G=t(l(),1),g(),je(),it=b()}));function ot(e,t){return O(e.replace(/\s+/g,` `).trim(),t)}function st({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function ct(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function lt(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?gt:i?J:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${ot(ue(e),l)}${c}${s}`}function ut(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=me(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function dt({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:i,onSelect:o,onLogsChanged:s,onLoadMore:l,initialSearchQuery:ee,showAllProjects:g=!1,onToggleAllProjects:b,onAgenticSearch:x}){let ie=a(),ae=n===void 0?ie.columns:n,S=Re(i),oe=d(),C=ye(),w=process.env.USER_TYPE===`ant`,[se]=u(),le=Ae(se),E=K.useMemo(()=>e=>c(e,le.warning),[le.warning]),de=process.env.USER_TYPE===`ant`,[D,fe]=K.useState(null),[O,pe]=K.useState(!1),[he,ge]=K.useState(!1),[A,_e]=K.useState(!1),ve=K.useMemo(()=>re(),[]),[be,we]=K.useState(``),[Te,Oe]=K.useState(0),[ke,je]=K.useState(new Set),[Ne,Pe]=K.useState(null),[Fe,Ie]=K.useState(1),[M,N]=K.useState(`list`),[Le,ze]=K.useState(null),Be=K.useRef(null),[He,Ue]=K.useState(0),[P,We]=K.useState({status:`idle`}),[F,I]=K.useState(!1),L=K.useRef(null),{query:R,setQuery:qe,cursorOffset:Je}=Ve({isActive:M===`search`&&P.status!==`searching`,onExit:()=>{N(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{N(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),z=K.useDeferredValue(R),[B,V]=K.useState(``);K.useEffect(()=>{if(!z){V(``);return}let e=setTimeout(V,300,z);return()=>clearTimeout(e)},[z]);let[H,Xe]=K.useState(null),[Ze,Qe]=K.useState(!1);K.useEffect(()=>{ce().then(e=>fe(e)),xe(ve).then(e=>{_e(e.length>1)})},[ve]);let $e=K.useMemo(()=>new Map(e.map(e=>[e,pt(e)])),[e]),et=K.useMemo(()=>w?new Ge(e.map(e=>({log:e,searchableText:$e.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:_t,ignoreLocation:!0,includeScore:!0}):null,[e,$e,w]),tt=K.useMemo(()=>ht(e),[e]),U=tt.length>0,W=K.useMemo(()=>U?[`All`,...tt]:[],[U,tt]),nt=W.length>0&&He<W.length?He:0,G=W[nt],it=G===`All`?void 0:G,at=+!!U,dt=K.useMemo(()=>{let t=e;return C&&(t=e.filter(e=>{let t=ne(),n=j(e);return!!(t&&n===t||e.customTitle||Me(e.messages)||e.firstPrompt||e.customTitle)})),it!==void 0&&(t=t.filter(e=>e.tag===it)),O&&D&&(t=t.filter(e=>e.gitBranch===D)),A&&!he&&(t=t.filter(e=>e.projectPath===ve)),t},[e,C,it,O,D,A,he,ve]),ft=K.useMemo(()=>{if(!R)return dt;let e=R.toLowerCase();return dt.filter(t=>{let n=ue(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[dt,R]);K.useEffect(()=>{w&&z&&z!==B&&Qe(!0)},[z,B,w]),K.useEffect(()=>{if(!w||!B||!et){Xe(null),Qe(!1);return}let e=setTimeout((e,t,n,r)=>{let i=e.search(t);i.sort((e,t)=>{let n=new Date(e.item.log.modified).getTime(),r=new Date(t.item.log.modified).getTime()-n;return Math.abs(r)>vt?r:(e.score??1)-(t.score??1)}),n({results:i.map(e=>({log:e.item.log,score:e.score,searchableText:e.item.searchableText})),query:t}),r(!1)},0,et,B,Xe,Qe);return()=>{clearTimeout(e)}},[B,et,w]);let{filteredLogs:gt,snippets:J}=K.useMemo(()=>{let e=new Map,t=ft;if(H&&B&&H.query===B){for(let t of H.results)if(t.searchableText){let n=ct(t.searchableText,B,yt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=H.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[ft,H,B]),Y=K.useMemo(()=>P.status===`results`&&P.results.length>0?P.results:gt,[P,gt]),X=Math.max(30,ae-4),Z=K.useMemo(()=>{if(!C)return[];let e=mt(Y);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Y.indexOf(n),i=J.get(n),a=i?st(i,E):null;if(t.length===1){let t=ut(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:lt(n,X),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Y.indexOf(t),i=J.get(t),a=i?st(i,E):null,o=ut(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:lt(t,X,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=ut(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:lt(n,X,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[C,Y,X,g,J,E]),bt=K.useMemo(()=>C?[]:Y.map((e,t)=>{let n=ot(ue(e)+(e.isSidechain?` (sidechain)`:``),X),r=me(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=J.get(e),o=a?st(a,E):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[C,Y,E,X,g,J]),Q=Ne?.value.log??null,xt=()=>{if(!C||!Q)return``;let e=j(Q);if(!e)return``;let t=Y.filter(t=>j(t)===e);if(!(t.length>1))return``;let n=ke.has(e);return t.indexOf(Q)>0||n?`← to collapse`:`→ to expand`},St=K.useCallback(async()=>{let e=Q?j(Q):void 0;if(!Q||!e){N(`list`),we(``);return}be.trim()&&(await Se(e,be.trim(),Q.fullPath),C&&s&&s()),N(`list`),we(``)},[Q,be,s,C]),Ct=K.useCallback(()=>{N(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},[]),wt=K.useCallback(()=>{N(`search`),T(`tengu_session_search_toggled`,{enabled:!0})},[]),Tt=K.useCallback(async()=>{if(!R.trim()||!x||!de)return;L.current?.abort();let t=new AbortController;L.current=t,We({status:`searching`}),T(`tengu_agentic_search_started`,{query_length:R.length});try{let n=await x(R,e,t.signal);if(t.signal.aborted)return;We({status:`results`,results:n,query:R}),T(`tengu_agentic_search_completed`,{query_length:R.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;We({status:`error`,message:e instanceof Error?e.message:`Search failed`}),T(`tengu_agentic_search_error`,{query_length:R.length})}},[R,x,de,e]);K.useEffect(()=>{P.status!==`idle`&&P.status!==`searching`&&(P.status===`results`&&P.query!==R||P.status===`error`)&&We({status:`idle`})},[R,P]),K.useEffect(()=>()=>{L.current?.abort()},[]);let Et=K.useRef(P.status);K.useEffect(()=>{let e=Et.current;if(Et.current=P.status,e===`searching`&&P.status===`results`){if(C&&Z.length>0)Pe(Z[0]);else if(!C&&Y.length>0){let e=Y[0];Pe({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[P.status,C,Z,Y]);let Dt=K.useCallback(e=>{let t=parseInt(e,10),n=Y[t];!n||Be.current===t.toString()||(Be.current=t.toString(),Pe({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Ie(t+1))},[Y]),Ot=K.useCallback(e=>{Pe(e);let t=Y.findIndex(t=>j(t)===j(e.value.log));t>=0&&Ie(t+1)},[Y]);_(`confirm:no`,()=>{L.current?.abort(),We({status:`idle`}),T(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:M!==`preview`&&P.status===`searching`}),_(`confirm:no`,()=>{N(`list`),we(``)},{context:`Settings`,isActive:M===`rename`&&P.status!==`searching`}),_(`confirm:no`,()=>{qe(``),I(!1),i?.()},{context:`Confirmation`,isActive:M!==`preview`&&M!==`rename`&&M!==`search`&&F&&P.status!==`searching`}),y((e,t)=>{if(M!==`preview`&&P.status!==`searching`&&M!==`rename`)if(M===`search`)e.toLowerCase()===`n`&&t.ctrl?Ct():(t.return||t.downArrow)&&R.trim()&&x&&de&&P.status!==`results`&&I(!0);else{if(F){if(t.return){Tt(),I(!1);return}else if(t.downArrow){I(!1);return}else if(t.upArrow){N(`search`),I(!1);return}}if(U&&t.tab){let e=t.shift?-1:1;Ue(t=>{let n=((t<W.length?t:0)+W.length+e)%W.length,r=W[n];return T(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:tt.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&b)b(),T(`tengu_session_all_projects_toggled`,{enabled:!g});else if(r===`b`&&t.ctrl){let e=!O;pe(e),T(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&A){let e=!he;ge(e),T(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(N(`search`),T(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&Q?(N(`rename`),we(``),T(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&Q?(ze(Q),N(`preview`),T(`tengu_session_preview_opened`,{messageCount:Q.messageCount})):Q&&n&&e.length>0&&!/^\s+$/.test(e)&&(N(`search`),qe(e),T(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let kt=[];O&&D&&kt.push(D),A&&!he&&kt.push(`current worktree`);let At=8+ +(kt.length>0&&M!==`search`)+at,$=Math.max(1,Math.floor((t-At-2)/3));return K.useEffect(()=>{l&&Fe+$*2>=Y.length&&l($*3)},[Fe,$,Y.length,l]),e.length===0?null:M===`preview`&&Le&&C?(0,q.jsx)(Ke,{log:Le,onExit:()=>{N(`list`),ze(null)},onSelect:o}):(0,q.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,q.jsx)(v,{flexShrink:0,children:(0,q.jsx)(te,{color:`suggestion`})}),(0,q.jsx)(v,{flexShrink:0,children:(0,q.jsx)(p,{children:` `})}),U?(0,q.jsx)(Ye,{tabs:W,selectedIndex:nt,availableWidth:ae,showAllProjects:g}):(0,q.jsx)(v,{flexShrink:0,children:(0,q.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,M===`list`&&Y.length>$&&(0,q.jsxs)(p,{dimColor:!0,children:[` `,`(`,Fe,` of `,Y.length,`)`]})]})}),(0,q.jsx)(f,{query:R,isFocused:M===`search`,isTerminalFocused:oe,cursorOffset:Je}),kt.length>0&&M!==`search`&&(0,q.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsx)(h,{children:kt})})}),(0,q.jsx)(v,{flexShrink:0,children:(0,q.jsx)(p,{children:` `})}),P.status===`searching`&&(0,q.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,q.jsx)(Ce,{}),(0,q.jsx)(p,{children:` Searching…`})]}),P.status===`results`&&P.results.length>0&&(0,q.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),P.status===`results`&&P.results.length===0&>.length===0&&(0,q.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),P.status===`error`&>.length===0&&(0,q.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,q.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!R.trim()&&x&&de&&P.status!==`searching`&&P.status!==`results`&&P.status!==`error`&&(0,q.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,q.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,q.jsx)(p,{color:F?`suggestion`:void 0,children:F?r.pointer:` `}),(0,q.jsx)(p,{color:F?`suggestion`:void 0,bold:F,children:`Search deeply using Claude →`})]}),(0,q.jsx)(v,{height:1})]}),P.status===`searching`?null:M===`rename`&&Q?(0,q.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,q.jsx)(p,{bold:!0,children:`Rename session:`}),(0,q.jsx)(v,{paddingTop:1,children:(0,q.jsx)(De,{value:be,onChange:we,onSubmit:St,placeholder:ue(Q,`Enter new session name`),columns:ae,cursorOffset:Te,onChangeCursorOffset:Oe,showCursor:!0})})]}):C?(0,q.jsx)(rt,{nodes:Z,onSelect:e=>{o(e.value.log)},onFocus:Ot,onCancel:i,focusNodeId:Ne?.id,visibleOptionCount:$,layout:`expanded`,isDisabled:M===`search`||F,hideIndexes:!1,isNodeExpanded:e=>{if(M===`search`||O)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?ke.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(je(e=>new Set(e).add(t)),T(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&je(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:wt}):(0,q.jsx)(Ee,{options:bt,onChange:e=>{let t=Y[parseInt(e,10)];t&&o(t)},visibleOptionCount:$,onCancel:i,onFocus:Dt,defaultFocusValue:Ne?.id.toString(),layout:`expanded`,isDisabled:M===`search`||F,onUpFromFirstItem:wt}),(0,q.jsx)(v,{paddingLeft:2,children:S.pending?(0,q.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):M===`rename`?(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(h,{children:[(0,q.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,q.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):P.status===`searching`?(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(h,{children:[(0,q.jsx)(p,{children:`Searching with Claude…`}),(0,q.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F?(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(h,{children:[(0,q.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,q.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,q.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):M===`search`?(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(h,{children:[(0,q.jsx)(p,{children:Ze&&w?`Searching…`:`Type to Search`}),(0,q.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,q.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,q.jsx)(p,{dimColor:!0,children:(0,q.jsxs)(h,{children:[b&&(0,q.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),D&&(0,q.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),A&&(0,q.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${he?`current worktree`:`all worktrees`}`}),(0,q.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,q.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,q.jsx)(p,{children:`Type to search`}),(0,q.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),xt()&&(0,q.jsx)(p,{children:xt()})]})})})]})}function ft(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function pt(e){let t=(e.messages.length<=Y?e.messages:[...e.messages.slice(0,X),...e.messages.slice(-X)]).map(ft).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Z?n.slice(0,Z):n}function mt(e){let t=new Map;for(let n of e){let e=j(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function ht(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var K,q,gt,J,Y,X,Z,_t,vt,yt,bt=e((()=>{s(),n(),We(),K=t(l(),1),x(),ze(),He(),Le(),g(),N(),se(),pe(),Pe(),le(),E(),A(),ke(),ge(),je(),Be(),R(),ve(),nt(),Oe(),at(),q=b(),gt=2,J=4,Y=2e3,X=1e3,Z=5e4,_t=.3,vt=60*1e3,yt=50}));function Q(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function xt(e){if(e.length===0)return``;let t=(e.length<=Tt?e:[...e.slice(0,Tt/2),...e.slice(-Tt/2)]).map(Q).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>wt?t.slice(0,wt)+`…`:t}function St(e,t){return!!(ue(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&xt(e.messages).toLowerCase().includes(t))}async function Ct(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>St(e,r)),a;if(i.length>=Et)a=i.slice(0,Et);else{let e=t.filter(e=>!St(e,r)),n=Et-i.length;a=[...i,...e.slice(0,n)]}w(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${D(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(Fe(e))try{return await _e(e)}catch(t){return de(t),e}return e}),s=await Promise.all(o);w(`Agentic search: loaded ${D(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
+
${s.map((e,t)=>{let n=[`${t}:`],r=ue(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=xt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
|
+
`)}
|
|
4
|
+
|
|
5
|
+
Search query: "${e}"
|
|
6
|
+
|
|
7
|
+
Find the sessions that are most relevant to this query.`;w(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=ie();w(`Agentic search using model: ${e}`);let t=(await Ne({model:e,system:Dt,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return w(`No text content in agentic search response`),[];w(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return w(`Could not find JSON in agentic search response`),[];let i=(S(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return w(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return de(e),w(`Agentic search error: ${e}`),[]}}var wt,Tt,Et,Dt,Ot=e((()=>{fe(),C(),E(),ae(),A(),be(),oe(),wt=2e3,Tt=100,Et=100,Dt=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
|
+
|
|
9
|
+
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
10
|
+
|
|
11
|
+
Each session may include:
|
|
12
|
+
- Title (display name or custom title)
|
|
13
|
+
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
14
|
+
- Branch (git branch name, shown as [branch: name])
|
|
15
|
+
- Summary (AI-generated summary)
|
|
16
|
+
- First message (beginning of the conversation)
|
|
17
|
+
- Transcript (excerpt of conversation content)
|
|
18
|
+
|
|
19
|
+
IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
|
|
20
|
+
|
|
21
|
+
For each session, consider (in order of priority):
|
|
22
|
+
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
23
|
+
2. Partial tag matches or tag-related terms
|
|
24
|
+
3. Title matches (custom titles or first message content)
|
|
25
|
+
4. Branch name matches
|
|
26
|
+
5. Summary and transcript content matches
|
|
27
|
+
6. Semantic similarity and related concepts
|
|
28
|
+
|
|
29
|
+
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
30
|
+
- Contain the query term anywhere in any field
|
|
31
|
+
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
32
|
+
- Discuss topics that could be related to the query
|
|
33
|
+
- Have transcripts that mention the concept even in passing
|
|
34
|
+
|
|
35
|
+
When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
|
|
36
|
+
|
|
37
|
+
Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
|
|
38
|
+
|
|
39
|
+
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
+
{"relevant_indices": [2, 5, 0]}`}));function kt(e,t,n){let r=re();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=j(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Ie([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+F)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=j(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Ie([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var At=e((()=>{x(),M(),A()}));export{dt as a,Ot as i,At as n,bt as o,Ct as r,kt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,t as i}from"./axios-DhfaybwJ.js";import{Fa as a,G as o,J as s,Na as c,Pr as l,br as u,ci as d,ct as f,hc as p,lt as m,ri as h,yc as g}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,t as i}from"./axios-DhfaybwJ.js";import{Fa as a,G as o,J as s,Na as c,Pr as l,br as u,ci as d,ct as f,hc as p,lt as m,ri as h,yc as g}from"./paths-CEAy4QCs.js";import{o as _,s as v}from"./log-DSV4Ht5l.js";import{createHash as y}from"crypto";function b(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}async function x(){if(N.length===0)return;let e=N;N=[];try{await r.post(E,e,{headers:{"Content-Type":`application/json`,"DD-API-KEY":D},timeout:A})}catch(e){v(e)}}function S(){P||(P=setTimeout(()=>{P=null,x()},T()).unref())}async function C(){P&&(clearTimeout(P),P=null),await x()}async function w(e,t){if(c()!==`firstParty`)return;let n=F;if(n===null&&(n=await I()),!(!n||!j.has(e)))try{let{envContext:n,...r}=await o({model:t.model,betas:t.betas}),i={...r,...n,...t,userBucket:R()};if(typeof i.toolName==`string`&&i.toolName.startsWith(`mcp__`)&&(i.toolName=`mcp`),process.env.USER_TYPE!==`ant`&&typeof i.model==`string`){let e=u(i.model.replace(/\[1m]$/i,``));i.model=e in h?e:`other`}if(typeof i.version==`string`&&(i.version=i.version.replace(/^(\d+\.\d+\.\d+-dev\.\d{8})\.t\d+\.sha[a-f0-9]+$/,`$1`)),i.status!==void 0&&i.status!==null){let e=String(i.status);i.http_status=e;let t=e.charAt(0);t>=`1`&&t<=`5`&&(i.http_status_range=`${t}xx`),delete i.status}let a=i,s={ddsource:`nodejs`,ddtags:[`event:${e}`,...M.filter(e=>a[e]!==void 0&&a[e]!==null).map(e=>`${b(e)}:${a[e]}`)].join(`,`),message:e,service:`claude-code`,hostname:`claude-code`,env:process.env.USER_TYPE};for(let[e,t]of Object.entries(i))t!=null&&(s[b(e)]=t);N.push(s),N.length>=k?(P&&(clearTimeout(P),P=null),x()):S()}catch(e){v(e)}}function T(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||``,10)||O}var E,D,O,k,A,j,M,N,P,F,I,L,R,z=e((()=>{i(),n(),g(),_(),l(),a(),d(),f(),s(),E=process.env.DATADOG_LOGS_ENDPOINT??``,D=process.env.DATADOG_API_KEY??``,O=15e3,k=100,A=5e3,j=new Set(`chrome_bridge_connection_succeeded.chrome_bridge_connection_failed.chrome_bridge_disconnected.chrome_bridge_tool_call_completed.chrome_bridge_tool_call_error.chrome_bridge_tool_call_started.chrome_bridge_tool_call_timeout.tengu_api_error.tengu_api_success.tengu_brief_mode_enabled.tengu_brief_mode_toggled.tengu_brief_send.tengu_cancel.tengu_compact_failed.tengu_exit.tengu_flicker.tengu_init.tengu_model_fallback_triggered.tengu_oauth_error.tengu_oauth_success.tengu_oauth_token_refresh_failure.tengu_oauth_token_refresh_success.tengu_oauth_token_refresh_lock_acquiring.tengu_oauth_token_refresh_lock_acquired.tengu_oauth_token_refresh_starting.tengu_oauth_token_refresh_completed.tengu_oauth_token_refresh_lock_releasing.tengu_oauth_token_refresh_lock_released.tengu_query_error.tengu_session_file_read.tengu_started.tengu_tool_use_error.tengu_tool_use_granted_in_prompt_permanent.tengu_tool_use_granted_in_prompt_temporary.tengu_tool_use_rejected_in_prompt.tengu_tool_use_success.tengu_uncaught_exception.tengu_unhandled_rejection.tengu_voice_recording_started.tengu_voice_toggled.tengu_team_mem_sync_pull.tengu_team_mem_sync_push.tengu_team_mem_sync_started.tengu_team_mem_entries_capped`.split(`.`)),M=[`arch`,`clientType`,`errorType`,`http_status_range`,`http_status`,`kairosActive`,`model`,`platform`,`provider`,`skillMode`,`subscriptionType`,`toolName`,`userBucket`,`userType`,`version`,`versionBase`],N=[],P=null,F=null,I=t(async()=>{if(m()||!E||!D)return F=!1,!1;try{return F=!0,!0}catch(e){return v(e),F=!1,!1}}),L=30,R=t(()=>{let e=p(),t=y(`sha256`).update(e).digest(`hex`);return parseInt(t.slice(0,8),16)%L})}));export{w as i,I as n,C as r,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./datadog-BzkFYNcv.js";t();export{e as shutdownDatadog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./DesktopHandoff-Ce0nE7D6.js";async function a(e){return(0,o.jsx)(i,{onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";var n,r;e((()=>{n=t(),r=async(e,t)=>{let{DiffDialog:r}=await import(`./DiffDialog-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";var n,r;e((()=>{n=t(),r=async(e,t)=>{let{DiffDialog:r}=await import(`./DiffDialog-BfSnz8L-.js`);return(0,n.jsx)(r,{messages:t.messages,onDone:e})}}))();export{r as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Doctor-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Doctor-BOVjkAKn.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
|