claude-code-best 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-C7od6sFQ.js → AddWorkspaceDirectory-DRO4tbYd.js} +1 -1
- package/dist/chunks/{App-EfHjElWP.js → App-DJyiiVKi.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CSz0291w.js → ApproveApiKey-DygOEAkM.js} +1 -1
- package/dist/chunks/ApproveApiKey-oTZKoMvB.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-mLIhDlxW.js → AssistantSessionChooser-C67mOxVi.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-Bqk_Cn3j.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-BCdft-m_.js → BypassPermissionsModeDialog-C4z7RkFV.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-BPlrCIo-.js → ClaudeInChromeOnboarding-CyVFdjBe.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-5FCT81WS.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-D8fk-Ib5.js → ClaudeMdExternalIncludesDialog-IpqqBuJs.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BmGziW64.js +1 -0
- package/dist/chunks/{DesktopHandoff-BQwx7qWA.js → DesktopHandoff-CJpa8Xy-.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-CujM8Ivu.js → DevChannelsDialog-CfAuHVRL.js} +1 -1
- package/dist/chunks/Dialog-C8eGKH-e.js +1 -0
- package/dist/chunks/{DiffDialog-Byv1UJvS.js → DiffDialog-CV3brWsG.js} +1 -1
- package/dist/chunks/{Doctor-Cv7wbi6C.js → Doctor-D3GysagF.js} +1 -1
- package/dist/chunks/Doctor-DohPtIKu.js +1 -0
- package/dist/chunks/{ExitFlow-DKusdm_v.js → ExitFlow-L2sh80sm.js} +2 -2
- package/dist/chunks/{Feedback-Diw8XUr-.js → Feedback-DfkBCvva.js} +1 -1
- package/dist/chunks/{Grove-CAi037VV.js → Grove-Bo74aZx-.js} +1 -1
- package/dist/chunks/Grove-C_ocvHd3.js +1 -0
- package/dist/chunks/{HybridTransport-CP0RopXu.js → HybridTransport-BItIDJyC.js} +1 -1
- package/dist/chunks/{ITermBackend-RvD4VX7c.js → ITermBackend-3iS8Bvmo.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Bhlgysxl.js → InvalidConfigDialog-6lPGcuOX.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-dGStgJZN.js → InvalidSettingsDialog-D8DwHiys.js} +1 -1
- package/dist/chunks/ListItem-DDMe4CJ3.js +1 -0
- package/dist/chunks/{MCPConnectionManager-D5a9ysw2.js → MCPConnectionManager-CsPizxTx.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-B_z9pZ_8.js → McpParsingWarnings-Cepe7RPZ.js} +1 -1
- package/dist/chunks/MessageSelector-BzUQUeDn.js +3 -0
- package/dist/chunks/{Messages-DTmFVhRG.js → Messages-KmeXIJqL.js} +3 -3
- package/dist/chunks/{Onboarding-BoAtphYb.js → Onboarding-BZUXID6q.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-DA7Ne7Mj.js → OverageCreditUpsell-Dhm7HBuD.js} +1 -1
- package/dist/chunks/{PermissionDialog-_WQPRYHQ.js → PermissionDialog-BrRBxx5o.js} +1 -1
- package/dist/chunks/PluginSettings-BZ-PX9Tg.js +17 -0
- package/dist/chunks/{PressEnterToContinue-BJ58eCFC.js → PressEnterToContinue-DtA_p3X6.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-DhIQ0Nge.js → PromptInputFooterSuggestions-Da8Fty6P.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-B__j9zE6.js → PromptInputHelpMenu-Bz7EPzzq.js} +1 -1
- package/dist/chunks/QueryEngine-CmJK27jU.js +1 -0
- package/dist/chunks/REPL-BBmn_itf.js +1 -0
- package/dist/chunks/{REPL-B1BS9jwx.js → REPL-DxEJZpIp.js} +36 -36
- package/dist/chunks/{RemoteCallout-Bwe1ESr9.js → RemoteCallout-DONJj8l2.js} +1 -1
- package/dist/chunks/RemoteSessionManager-BvvNspY8.js +2 -0
- package/dist/chunks/ResumeConversation-EpjJdFHu.js +1 -0
- package/dist/chunks/{SSETransport-D3e5KNL3.js → SSETransport-D51Jfdaj.js} +1 -1
- package/dist/chunks/SearchBox-CciJ8giD.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-kjVFsFkT.js +1 -0
- package/dist/chunks/SentryErrorBoundary-DsrmgmKF.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-D-YZTGQG.js → SentryErrorBoundary-nYTimi4l.js} +1 -1
- package/dist/chunks/Settings-C2vEJjLx.js +2 -0
- package/dist/chunks/{TeleportProgress-C3Ubx1Se.js → TeleportProgress--jgrqIfW.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-D_ax3xQy.js → TeleportRepoMismatchDialog-BKDaFT_L.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-DeVKIXQp.js → TeleportResumeWrapper-CxlpiHIz.js} +1 -1
- package/dist/chunks/{ThemePicker-DKmIL5Ku.js → ThemePicker-CYL4C-F-.js} +1 -1
- package/dist/chunks/{TmuxBackend-Bm_cRJ2x.js → TmuxBackend-C_N4ww8i.js} +2 -2
- package/dist/chunks/{TrustDialog-ClXFMKj6.js → TrustDialog-CYdftZ1M.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-SdQADfvA.js → ValidationErrorsList-CaTwOP3f.js} +1 -1
- package/dist/chunks/{WelcomeV2-BijS6i2Z.js → WelcomeV2-5rgKm4Mz.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-CGEQ5ClB.js → WindowsTerminalBackend-BzoSs0VA.js} +2 -2
- package/dist/chunks/{add-dir-B7kleB6k.js → add-dir-RNzFR3XZ.js} +1 -1
- package/dist/chunks/{agentDisplay-Dr1XbOAu.js → agentDisplay-DgeOQY1E.js} +1 -1
- package/dist/chunks/{agents-CpLvvWpO.js → agents-D7cgzb3f.js} +7 -7
- package/dist/chunks/{agents-Dy5YOJC9.js → agents-iMtFurok.js} +1 -1
- package/dist/chunks/{ant-gwf-4eGN.js → ant-CF1iRpXD.js} +1 -1
- package/dist/chunks/{api-CDmgYrwN.js → api-DMbWqJlK.js} +1 -1
- package/dist/chunks/api-DkgaFAzq.js +1 -0
- package/dist/chunks/artifacts-D2kY_AMp.js +1 -0
- package/dist/chunks/{assistant-1usDIXtk.js → assistant-CZ4VXgzH.js} +1 -1
- package/dist/chunks/assistant-CiNV3Q0f.js +1 -0
- package/dist/chunks/{assistant-BULedprW.js → assistant-JAqAZqaE.js} +1 -1
- package/dist/chunks/{auth-CvHVr2A5.js → auth-BemPA3ot.js} +1 -1
- package/dist/chunks/auth-CbQCc9vz.js +1 -0
- package/dist/chunks/{autoMode-DSMM2seL.js → autoMode-CGovMAzJ.js} +1 -1
- package/dist/chunks/{autonomy-TtBO2TAe.js → autonomy-BVXyNEj0.js} +1 -1
- package/dist/chunks/{autonomy-Dj6Nzxus.js → autonomy-BnAHLZWH.js} +3 -3
- package/dist/chunks/{autonomyPanel-CbmU7lPg.js → autonomyPanel-COMI2iR0.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-Cp2RvmEN.js → backgroundHousekeeping-BRtG20l2.js} +2 -2
- package/dist/chunks/backgroundHousekeeping-LYpOamcN.js +1 -0
- package/dist/chunks/{banner-D9Cq292T.js → banner-D_rqe2XQ.js} +1 -1
- package/dist/chunks/{branch-Cj5TGroO.js → branch-BnKwIQtC.js} +1 -1
- package/dist/chunks/{break-cache-DrIa8RdW.js → break-cache-CDzQDHwY.js} +1 -1
- package/dist/chunks/{bridge-CsqJAoEg.js → bridge-ChVjEHVq.js} +2 -2
- package/dist/chunks/bridgeConfig-Budgp2Go.js +1 -0
- package/dist/chunks/{bridgeConfig-pjDV5Z2l.js → bridgeConfig-e0MGfed6.js} +1 -1
- package/dist/chunks/{bridgeEnabled-D9jI6X-w.js → bridgeEnabled-DR-v8AXw.js} +1 -1
- package/dist/chunks/bridgeEnabled-DmvmwuUY.js +1 -0
- package/dist/chunks/bridgeMain-KYR5iq6H.js +1 -0
- package/dist/chunks/{bridgeMain-CNmR9iDD.js → bridgeMain-OsR-_PRp.js} +11 -11
- package/dist/chunks/{bridgeMessaging-DN0X35NX.js → bridgeMessaging-BvBnxgD4.js} +1 -1
- package/dist/chunks/{btw-BOg0RTKl.js → btw-_b16RGoh.js} +1 -1
- package/dist/chunks/{buddy-BFuPeIxM.js → buddy-DJ3QSQyd.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-kxVnIVRs.js → bypassPermissionsKillswitch-OhGSWZrB.js} +1 -1
- package/dist/chunks/{caches-BumkMuGA.js → caches-Bp4F7tZ5.js} +2 -2
- package/dist/chunks/caches-CkH9F-Fd.js +1 -0
- package/dist/chunks/{ccrClient-BI1QPLmN.js → ccrClient-D7pEGzQa.js} +1 -1
- package/dist/chunks/changeDetector-IFbty4jj.js +1 -0
- package/dist/chunks/{channelNotification-CoZSFUlb.js → channelNotification-BZFMAWln.js} +1 -1
- package/dist/chunks/channelNotification-CIyWY0hs.js +1 -0
- package/dist/chunks/{chrome-C_5EZcdc.js → chrome-B5IxDA16.js} +1 -1
- package/dist/chunks/clear-BVjSQsUL.js +1 -0
- package/dist/chunks/client-BUUsZdSe.js +1 -0
- package/dist/chunks/color-BYVWpzI8.js +1 -0
- package/dist/chunks/commands-pTQdOvN6.js +1 -0
- package/dist/chunks/{commitAttribution-iKd8bTOI.js → commitAttribution-ClSlXMPG.js} +1 -1
- package/dist/chunks/commitAttribution-QPrKt_BF.js +1 -0
- package/dist/chunks/{compact-B6Muofhz.js → compact-B9c12JXf.js} +3 -3
- package/dist/chunks/{companion-B_LrjSk5.js → companion-C8e7dVlu.js} +1 -1
- package/dist/chunks/completionCache-BB7-y2BX.js +1 -0
- package/dist/chunks/{completionCache-C7hDqIDL.js → completionCache-Br6OwASx.js} +1 -1
- package/dist/chunks/{config-CJd9kJ57.js → config-Bxgfx_nO.js} +1 -1
- package/dist/chunks/{config-CQd4IkXo.js → config-C-yz-f4W.js} +1 -1
- package/dist/chunks/{context-qAHTuazZ.js → context-Bf5t6C-a.js} +1 -1
- package/dist/chunks/{context-noninteractive-DZsSp-ES.js → context-noninteractive-CJu7hZCM.js} +1 -1
- package/dist/chunks/context-noninteractive-OUTZ6BKj.js +1 -0
- package/dist/chunks/conversation-BYMS5Hqa.js +1 -0
- package/dist/chunks/conversation-Bs8l0KNl.js +1 -0
- package/dist/chunks/{copy-B2jhZndZ.js → copy-C0BZ7Gm0.js} +1 -1
- package/dist/chunks/{createSSHSession-CKdoEmAg.js → createSSHSession-DNXCWneI.js} +1 -1
- package/dist/chunks/{createSession-WkBw7wdn.js → createSession-DjM6Ev45.js} +1 -1
- package/dist/chunks/createSession-DpqtD4ML.js +1 -0
- package/dist/chunks/cron-DwR6OJuW.js +1 -0
- package/dist/chunks/{cronJitterConfig-2u6WAlti.js → cronJitterConfig-CaFkPXKB.js} +1 -1
- package/dist/chunks/{crossProjectResume-CjJISRBQ.js → crossProjectResume-BCr6jfGz.js} +3 -3
- package/dist/chunks/{daemon-BRKR4D1D.js → daemon-Bu0Uy-qG.js} +1 -1
- package/dist/chunks/{datadog-YsyhnDmr.js → datadog-ClZjR-jM.js} +1 -1
- package/dist/chunks/datadog-DlzPb5oG.js +1 -0
- package/dist/chunks/desktop-WH8s-9-6.js +1 -0
- package/dist/chunks/{diff-BTtUFuf-.js → diff-D9hjPq4W.js} +1 -1
- package/dist/chunks/{doctor-BKBb426q.js → doctor-4-im_J_h.js} +1 -1
- package/dist/chunks/earlyInput-DEZaWwKF.js +1 -0
- package/dist/chunks/{effort-ClhxMqY6.js → effort-Bz-9GIpe.js} +1 -1
- package/dist/chunks/entry-CEBaLwEG.js +14 -0
- package/dist/chunks/{envLessBridgeConfig-C9UUbQCo.js → envLessBridgeConfig-DW4-nPbZ.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-izoVnE8s.js +1 -0
- package/dist/chunks/exit-DBNDTR4b.js +1 -0
- package/dist/chunks/{export-DS2esu8D.js → export-CQHUM_Nv.js} +1 -1
- package/dist/chunks/{exportRenderer-DX2L5fQ7.js → exportRenderer-CuIDQBLH.js} +1 -1
- package/dist/chunks/{extra-usage-XJxfHsbe.js → extra-usage-DTr6gExD.js} +1 -1
- package/dist/chunks/extra-usage-VSASGlte.js +1 -0
- package/dist/chunks/{extra-usage-core-D84ifgBo.js → extra-usage-core-D3CwYO_8.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-fxqxHnIt.js → extra-usage-noninteractive-d-QVg1D5.js} +1 -1
- package/dist/chunks/{extraUsage-P_NGI1-I.js → extraUsage-BNRQOkgU.js} +1 -1
- package/dist/chunks/extractMemories-hQlhiVOD.js +1 -0
- package/dist/chunks/fast-2gWrhEFZ.js +1 -0
- package/dist/chunks/{fast-CpN8lLnE.js → fast-bkGXbuHX.js} +1 -1
- package/dist/chunks/{feedback-CqRsOG3c.js → feedback-BvFgE_FF.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-CM0V7Uev.js → firstPartyEventLogger-D-ifHvWu.js} +1 -1
- package/dist/chunks/{flushGate-DNutWuOE.js → flushGate-BA24vFBg.js} +1 -1
- package/dist/chunks/{fpsMetrics-DKWp7vng.js → fpsMetrics-CBFlAGTS.js} +1 -1
- package/dist/chunks/{gates-C4JvRq4i.js → gates-C66Nz9b2.js} +1 -1
- package/dist/chunks/gates-dO6m4Hdp.js +1 -0
- package/dist/chunks/{gemini-B0M6SQSG.js → gemini-DuQl4hTA.js} +1 -1
- package/dist/chunks/{generateRecap-DhDOgXn3.js → generateRecap-CwBU76xi.js} +1 -1
- package/dist/chunks/{generateSessionName-CoFR2wgK.js → generateSessionName-LnmjE9jh.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-DGiSNykv.js → githubRepoPathMapping-DrreQj47.js} +1 -1
- package/dist/chunks/{goal-DRb6pPAp.js → goal-BIvjF6B7.js} +3 -3
- package/dist/chunks/{grok-emDua_hT.js → grok-KNLYSRBQ.js} +1 -1
- package/dist/chunks/{growthbook-COAneL48.js → growthbook-ksjGAskq.js} +1 -1
- package/dist/chunks/{heapdump-CA6DHA8G.js → heapdump-Cz8vkcOr.js} +1 -1
- package/dist/chunks/{help-XXY7deZm.js → help-Cx9OordP.js} +1 -1
- package/dist/chunks/{hooks-C6zZYnDi.js → hooks-BW-d9Bdu.js} +2 -2
- package/dist/chunks/hooks-BWoN0nQP.js +1 -0
- package/dist/chunks/{hostAdapter-DZbdeXCV.js → hostAdapter-DLmaB6eN.js} +1 -1
- package/dist/chunks/{ide-BLRNkzVx.js → ide-CECrIg1r.js} +2 -2
- package/dist/chunks/{inboundAttachments-60kD5Qt_.js → inboundAttachments-B0sGIu79.js} +1 -1
- package/dist/chunks/inboundAttachments-D8vq1NQO.js +1 -0
- package/dist/chunks/initReplBridge-BAEMZEcg.js +1 -0
- package/dist/chunks/{insights-BBugI3tW.js → insights-DeWggLxC.js} +1 -1
- package/dist/chunks/{install-github-app-ByyzrlM9.js → install-github-app-DqKEiHQ1.js} +2 -2
- package/dist/chunks/{install-CuVHbwyW.js → install-pxH_HR1p.js} +1 -1
- package/dist/chunks/{install-slack-app-CJGtmacz.js → install-slack-app-P1L9x-YI.js} +1 -1
- package/dist/chunks/{instrumentation-C8zvzMg1.js → instrumentation-Dx0s2jzr.js} +3 -3
- package/dist/chunks/{job-DBf6aPQX.js → job-CbxxkPgE.js} +1 -1
- package/dist/chunks/{keybindings-Bi7SMp5-.js → keybindings-BBPC7FAc.js} +1 -1
- package/dist/chunks/{lang-CVDkUhjk.js → lang-CKp0Tn76.js} +1 -1
- package/dist/chunks/language-CSDpzbTz.js +1 -0
- package/dist/chunks/{language-BYeqMX74.js → language-iERMuOEu.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-BKqxMFFn.js → launchAgentsPlatform-DQvKVtl2.js} +1 -1
- package/dist/chunks/{launchAutofixPr-CauX6gOB.js → launchAutofixPr-B7hu9C8h.js} +3 -3
- package/dist/chunks/{launchCommand-9eYsPG7W.js → launchCommand-CJsikSlW.js} +1 -1
- package/dist/chunks/{launchLocalMemory-Brrd_BJC.js → launchLocalMemory-Cpz7L5j5.js} +2 -2
- package/dist/chunks/{launchLocalVault-DtAn656A.js → launchLocalVault-XLfOQtP7.js} +3 -3
- package/dist/chunks/{launchMemoryStores-x7_Id7Yr.js → launchMemoryStores-Cz04PaDE.js} +1 -1
- package/dist/chunks/{launchOnboarding-DkamFByn.js → launchOnboarding-XPbUNdHS.js} +1 -1
- package/dist/chunks/{launchSchedule-DjNQNxW4.js → launchSchedule-B1VEe3o-.js} +1 -1
- package/dist/chunks/{launchSkillStore-D2GUGhDD.js → launchSkillStore-Cy59z5xx.js} +1 -1
- package/dist/chunks/{launchTeleport-DTfhiZkf.js → launchTeleport-ZPM_DvzK.js} +3 -3
- package/dist/chunks/{launchVault-BZ2Po4r8.js → launchVault-BhnTOZq8.js} +1 -1
- package/dist/chunks/loadAgentsDir-B-4D2dVE.js +1 -0
- package/dist/chunks/{loadAgentsDir-C_wFhytF.js → loadAgentsDir-CQF8qhne.js} +778 -778
- package/dist/chunks/loadPluginHooks-TyULD8KH.js +1 -0
- package/dist/chunks/{localSearch-B0p0_bjP.js → localSearch-BNYypHsK.js} +1 -1
- package/dist/chunks/localSearch-DsFH9yls.js +1 -0
- package/dist/chunks/login-CEJEl2mW.js +1 -0
- package/dist/chunks/{login-C1uE6Pg9.js → login-CxbcJk9_.js} +1 -1
- package/dist/chunks/{logoV2Utils-BJHvwGup.js → logoV2Utils-Br_w1z39.js} +1 -1
- package/dist/chunks/logout-BXr4jzNY.js +1 -0
- package/dist/chunks/{magicDocs-DPZzG7Z2.js → magicDocs-DnxdS9yV.js} +1 -1
- package/dist/chunks/{main-CNwSLti2.js → main-FBmdv32j.js} +145 -66
- package/dist/chunks/{mappers-Dxs_kNJH.js → mappers-BNI_df3v.js} +1 -1
- package/dist/chunks/mcp-BhAGhDQE.js +1 -0
- package/dist/chunks/{mcp-CbDDqdzF.js → mcp-DbqUZ1Cf.js} +1 -1
- package/dist/chunks/mcp-esqdO_lV.js +6 -0
- package/dist/chunks/{mcpServer-Py4Iz9Hx.js → mcpServer-Ct-GVL-y.js} +1 -1
- package/dist/chunks/{mcpServer-BJNjQXsU.js → mcpServer-DeL2ADSF.js} +1 -1
- package/dist/chunks/memory-DwapBEsD.js +1 -0
- package/dist/chunks/{mobile-BMglW1NB.js → mobile-D7MSmMhc.js} +1 -1
- package/dist/chunks/{modalContext-c5Yqx_CQ.js → modalContext-DxfeT_3m.js} +1 -1
- package/dist/chunks/{mode-CqGusjoT.js → mode-B5cmHCvz.js} +1 -1
- package/dist/chunks/{model-BBULcn7y.js → model-BePO0VaC.js} +1 -1
- package/dist/chunks/model-CgH43-hO.js +1 -0
- package/dist/chunks/{onChangeAppState-BkRihYau.js → onChangeAppState-B3d5iy6T.js} +1 -1
- package/dist/chunks/{openai-yNI_zoao.js → openai-fRhGOIQq.js} +3 -3
- package/dist/chunks/{overageCreditGrant-Cbh0_fbM.js → overageCreditGrant-B6sx7IFi.js} +1 -1
- package/dist/chunks/{panel-D3wvAEFE.js → panel-CAVG5BOM.js} +1 -1
- package/dist/chunks/{panel-BYfvo_mR.js → panel-DU8y_jcf.js} +1 -1
- package/dist/chunks/{panelCall-t10Sud9A.js → panelCall-DUQdjDee.js} +1 -1
- package/dist/chunks/{passes-D_iS6DaC.js → passes-CWPPUigp.js} +1 -1
- package/dist/chunks/{paths-Ci1iwL5Y.js → paths-4ZWdjPP4.js} +3 -3
- package/dist/chunks/{permissions-CHvu4-yX.js → permissions-DW8CRuJp.js} +3 -3
- package/dist/chunks/{pipeTransport-EAYXsubu.js → pipeTransport-CUeYRWJn.js} +1 -1
- package/dist/chunks/{plan-CP5nq_EB.js → plan-Cf-tHvGq.js} +1 -1
- package/dist/chunks/plugin-DXhCgoNC.js +1 -0
- package/dist/chunks/{pluginAutoupdate-ClrgF5b3.js → pluginAutoupdate-CdmKzIRf.js} +1 -1
- package/dist/chunks/{pluginBlocklist-B1LVo0j_.js → pluginBlocklist-C9XwbFSo.js} +1 -1
- package/dist/chunks/{pluginCliCommands-eqyMBWcP.js → pluginCliCommands-CmY_maYg.js} +1 -1
- package/dist/chunks/{pluginFlagging-BiTDVP10.js → pluginFlagging-DyzxZolj.js} +1 -1
- package/dist/chunks/{pluginOperations-gZ-iCmhu.js → pluginOperations-mr4I7Jw9.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-DCDWHam6.js → pluginStartupCheck-B6OdK29Z.js} +1 -1
- package/dist/chunks/pluginStartupCheck-BFuZqpnX.js +1 -0
- package/dist/chunks/{plugins-BAIVqfi8.js → plugins-rdPgpjF8.js} +1 -1
- package/dist/chunks/policyLimits-B3dtp_Fe.js +1 -0
- package/dist/chunks/{pollConfig-_2W7bHoW.js → pollConfig-DLbuHBse.js} +1 -1
- package/dist/chunks/{poor-Dii0mpOW.js → poor-pmz2b7zu.js} +1 -1
- package/dist/chunks/poorMode-BPIUnFFi.js +1 -0
- package/dist/chunks/{poorMode-aDmmvJ_e.js → poorMode-DD-q_w6Z.js} +1 -1
- package/dist/chunks/{print-BwSmcUQu.js → print-luaON-Cg.js} +12 -12
- package/dist/chunks/{privacy-settings-DaAgSLKw.js → privacy-settings-BpigC4oX.js} +1 -1
- package/dist/chunks/{processBashCommand-BZ1_JKu4.js → processBashCommand-f_84bSlP.js} +1 -1
- package/dist/chunks/processSlashCommand-BkBqV3Jd.js +6 -0
- package/dist/chunks/{projectContext-Cd7V9pES.js → projectContext-fS1t-xRh.js} +1 -1
- package/dist/chunks/{prompt-6ZKyqv6z.js → prompt-CogZQuTN.js} +1 -1
- package/dist/chunks/prompt-CriAIdkT.js +1 -0
- package/dist/chunks/prompt-TGc_H1cL.js +1 -0
- package/dist/chunks/{promptEditor-Dz41P-3I.js → promptEditor-C___2FFs.js} +2 -2
- package/dist/chunks/{protocolHandler-CHGHjfdf.js → protocolHandler-qwll5gSY.js} +1 -1
- package/dist/chunks/{rate-limit-options-BlU9av7g.js → rate-limit-options-nQcTipEp.js} +1 -1
- package/dist/chunks/{rcDebugLog-C42A0pX1.js → rcDebugLog-DOXxIr8l.js} +1 -1
- package/dist/chunks/{referral-IIcY3jkp.js → referral-CMPZjf3I.js} +1 -1
- package/dist/chunks/{refresh-DTGEx7X_.js → refresh-CP7Dnjp4.js} +1 -1
- package/dist/chunks/{registerProtocol-BkNncGMI.js → registerProtocol-DCNuqdCC.js} +1 -1
- package/dist/chunks/registry-DLqZJleQ.js +1 -0
- package/dist/chunks/{release-notes-BxzOD-zP.js → release-notes-BsDW6T9f.js} +1 -1
- package/dist/chunks/{releaseNotes-C8KQGZHq.js → releaseNotes-Tbd018Qz.js} +2 -2
- package/dist/chunks/{reload-plugins-gYyC6_g8.js → reload-plugins-iG9ZE9wF.js} +1 -1
- package/dist/chunks/{remote-env-CEJH5aJh.js → remote-env-BFntnltf.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Dte7ZUAN.js → remoteBridgeCore-Dpko9c-J.js} +1 -1
- package/dist/chunks/{remoteControlServer-GN-eDbEz.js → remoteControlServer-D3P82kVF.js} +1 -1
- package/dist/chunks/{rename-BEU6BNRp.js → rename-Codm2nfB.js} +1 -1
- package/dist/chunks/{resume-D36S2rXg.js → resume-BB1ceL_x.js} +2 -2
- package/dist/chunks/{runtimeObserver-CDMCeww2.js → runtimeObserver-BpRn0RiL.js} +1 -1
- package/dist/chunks/{runtimeObserver-DaKaKNVW.js → runtimeObserver-D6aF77Dq.js} +2 -2
- package/dist/chunks/sandbox-adapter-DrHD1mch.js +1 -0
- package/dist/chunks/{sandbox-toggle-BPO26t48.js → sandbox-toggle-DZ-8qXDS.js} +1 -1
- package/dist/chunks/searchExtraTools-Dwg6ZafS.js +1 -0
- package/dist/chunks/{sentry-9EbPa1Xu.js → sentry-CVdHlmNQ.js} +1 -1
- package/dist/chunks/{session-D18B22u4.js → session-B4j1ViVc.js} +1 -1
- package/dist/chunks/{sessionDiscovery-B-OTvXJf.js → sessionDiscovery-DkIIFsWX.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-n7HcOfZ7.js +1 -0
- package/dist/chunks/{sessionMemory-Ctauybzs.js → sessionMemory-CnT3-Mj7.js} +1 -1
- package/dist/chunks/sessionMemory-DVq43VXP.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BjkdLRvh.js +1 -0
- package/dist/chunks/sessionObserver-CrfmnMzL.js +1 -0
- package/dist/chunks/{sessionObserver-ardnTJ37.js → sessionObserver-gjdJ91cv.js} +1 -1
- package/dist/chunks/sessionStorage-BTbr9wkZ.js +1 -0
- package/dist/chunks/{sessionTitle-DEKvIVCK.js → sessionTitle-CSU5-VK9.js} +1 -1
- package/dist/chunks/{sessionTracing-CJUUEWZ4.js → sessionTracing-BDN64fWh.js} +1 -1
- package/dist/chunks/{settingsSync-BWt3oUR7.js → settingsSync-Nixbcaox.js} +1 -1
- package/dist/chunks/{setup-BECFDOT9.js → setup-9nXlu56r.js} +1 -1
- package/dist/chunks/{setup-CmCTB2T_.js → setup-CZxLEcQh.js} +1 -1
- package/dist/chunks/setup-n3Ixr_gs.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-BbALfdxE.js → shadowedRuleDetection-CCS7R7F1.js} +1 -1
- package/dist/chunks/{sideQuestion-BHK6dd1q.js → sideQuestion-MzExGTvn.js} +1 -1
- package/dist/chunks/{sink-Do5fWbUC.js → sink-BL75jACh.js} +1 -1
- package/dist/chunks/sink-CoUVbLFs.js +1 -0
- package/dist/chunks/{sinks-Dc9V7k6a.js → sinks-C-gxj_Eu.js} +2 -2
- package/dist/chunks/sinks-wuo1yQ_m.js +1 -0
- package/dist/chunks/{skill-learning-BHW9G3Dn.js → skill-learning-B9Msm4jG.js} +1 -1
- package/dist/chunks/skillChangeDetector-DlWPJTny.js +1 -0
- package/dist/chunks/{skillGapStore-DVMbI2yy.js → skillGapStore-Cpmbwyo3.js} +1 -1
- package/dist/chunks/{skillGapStore-Wa7s6orv.js → skillGapStore-CsADiV5a.js} +2 -2
- package/dist/chunks/{skillGenerator-CBuoIFsH.js → skillGenerator-_khb-Gmc.js} +2 -2
- package/dist/chunks/skillLearning-CFnZiM5J.js +1 -0
- package/dist/chunks/skillLearning-D6mvGN90.js +1 -0
- package/dist/chunks/{skillPanel-2w82nkOl.js → skillPanel-DQmj3Yh1.js} +3 -3
- package/dist/chunks/{skillSearchPanel-7BhCBkdh.js → skillSearchPanel-6w_zzoI3.js} +2 -2
- package/dist/chunks/{skills-D5rMEo2w.js → skills-B3LN9tp9.js} +1 -1
- package/dist/chunks/{sprites-uNWgVZT6.js → sprites-8JVWnXzp.js} +1 -1
- package/dist/chunks/{src-poaoYkuc.js → src-BJM0zMNO.js} +1 -1
- package/dist/chunks/{src-Di342QoJ.js → src-KjMLauwe.js} +1 -1
- package/dist/chunks/startupProfiler-BmnoJtfF.js +1 -0
- package/dist/chunks/{startupProfiler-CAntGAbs.js → startupProfiler-rCtNuhXz.js} +1 -1
- package/dist/chunks/{staticRender-C5v46np_.js → staticRender-DboURbK0.js} +1 -1
- package/dist/chunks/{stats-D0CJB2HV.js → stats-BDlygx5X.js} +1 -1
- package/dist/chunks/status-DlT1tUmc.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-Lqf99003.js → statusNoticeHelpers-Cd_LDPvn.js} +1 -1
- package/dist/chunks/{tag-BnvWS9HE.js → tag-BLPgXlQZ.js} +1 -1
- package/dist/chunks/tasks-Bf1Nf3WX.js +1 -0
- package/dist/chunks/{teamHelpers-D8R_gGLb.js → teamHelpers-B-poMJeE.js} +1 -1
- package/dist/chunks/teamHelpers-DeQCfdgu.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-Bdra3VIJ.js → teammateModeSnapshot-B1_3D1CQ.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-BRuKcJNr.js +1 -0
- package/dist/chunks/teleport-CSo3PT05.js +1 -0
- package/dist/chunks/{templateJobs-BDKGtmr3.js → templateJobs-BVebX2BK.js} +1 -1
- package/dist/chunks/{terminalSetup-C1X-sXwp.js → terminalSetup-DHWL0gnz.js} +1 -1
- package/dist/chunks/{terminalSetup-Bbvq-9Xl.js → terminalSetup-DZTEKKne.js} +1 -1
- package/dist/chunks/{theme-DXv6bV7f.js → theme-BHQSNwSe.js} +1 -1
- package/dist/chunks/thinkback-CVYpxAyO.js +1 -0
- package/dist/chunks/{thinkback-CMsW7mvG.js → thinkback-DOzxcgMy.js} +1 -1
- package/dist/chunks/{thinkback-play-CFdkpzlj.js → thinkback-play-CK1C_F7G.js} +1 -1
- package/dist/chunks/{toolEventObserver-DDJV8cvW.js → toolEventObserver-BIjUIh4k.js} +1 -1
- package/dist/chunks/{toolEventObserver-CF7T7FBH.js → toolEventObserver-XPorjjtG.js} +1 -1
- package/dist/chunks/toolPool-CDEeuQd2.js +1 -0
- package/dist/chunks/{toolPool-BJv0sBnR.js → toolPool-hQlvQn-j.js} +1 -1
- package/dist/chunks/{trustedDevice-C9nJhhyZ.js → trustedDevice-CyfQd_GU.js} +1 -1
- package/dist/chunks/{trustedDevice-C5s2au0k.js → trustedDevice-D-L5uAor.js} +1 -1
- package/dist/chunks/{tui-DoOiz2RW.js → tui-C7aBeORE.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-BEv1_AS1.js → ultrareviewCommand-rnMsUWTn.js} +2 -2
- package/dist/chunks/undercover-BviGW-bQ.js +1 -0
- package/dist/chunks/{undercover-DPVt2WN7.js → undercover-ClLYK52H.js} +1 -1
- package/dist/chunks/{updateCCB-D-4naIUu.js → updateCCB-pqkACWbs.js} +1 -1
- package/dist/chunks/upgrade-DAuhXFVI.js +1 -0
- package/dist/chunks/{upgrade-CSld83v7.js → upgrade-DpfZlPyC.js} +1 -1
- package/dist/chunks/{upload-DVlE8SRp.js → upload-D98tqZnO.js} +1 -1
- package/dist/chunks/{usage-D4Ubnttz.js → usage-BWd5R6DU.js} +1 -1
- package/dist/chunks/{usage-B_bY46ep.js → usage-CRquq5_O.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BHi41Ku_.js → useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js} +1 -1
- package/dist/chunks/useKeybinding-DOjEx42R.js +1 -0
- package/dist/chunks/useMainLoopModel-BZoZdEdj.js +1 -0
- package/dist/chunks/{useManagePlugins-B4kcqcyY.js → useManagePlugins-DMY74XAk.js} +1 -1
- package/dist/chunks/{useMergedTools-CTQl4cdV.js → useMergedTools-NN58Kguw.js} +1 -1
- package/dist/chunks/{useSearchInput-JPayBRPC.js → useSearchInput-CodP_5SB.js} +1 -1
- package/dist/chunks/{useSettingsErrors-YTgPxnRZ.js → useSettingsErrors-BRxaYl6B.js} +1 -1
- package/dist/chunks/useTerminalSize-mqo2Swmk.js +1 -0
- package/dist/chunks/{useVoice-CaBv3G13.js → useVoice-ByU-q_w4.js} +1 -1
- package/dist/chunks/{util-Q70qdjeS.js → util-SpgBY5_I.js} +1 -1
- package/dist/chunks/utils-CM5oEyAY.js +1 -0
- package/dist/chunks/{validatePlugin-6lg9B564.js → validatePlugin-CxCXNV8o.js} +1 -1
- package/dist/chunks/{vim-zOsQBIp4.js → vim-ByXlYzf9.js} +1 -1
- package/dist/chunks/{voice-DBQevAhk.js → voice-BnLS_SdQ.js} +1 -1
- package/dist/chunks/voiceModeEnabled-B3njLfhA.js +1 -0
- package/dist/chunks/{voiceModeEnabled-CjBjjeNR.js → voiceModeEnabled-D070o6QK.js} +1 -1
- package/dist/chunks/voiceStreamSTT-BkeyhhFJ.js +1 -0
- package/dist/chunks/{voiceStreamSTT-B8CTbb_6.js → voiceStreamSTT-vkQ-Aop7.js} +1 -1
- package/dist/chunks/{web-tools-CGqBqo07.js → web-tools-1yM0ZBfA.js} +1 -1
- package/dist/chunks/{workerRegistry-Bx6FvTZF.js → workerRegistry-7xGv_sNB.js} +1 -1
- package/dist/chunks/worktree-UA9gKCwL.js +1 -0
- package/dist/chunks/{xml-CVF7dWfi.js → xml-BUaEXGXx.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-Cc5SaLqs.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-OkUSMj0I.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BbPaorIs.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Dyv4mI_o.js +0 -1
- package/dist/chunks/Dialog-91X6ZGg9.js +0 -1
- package/dist/chunks/Doctor-CRrE5Sf4.js +0 -1
- package/dist/chunks/Grove-CgX5Fdeh.js +0 -1
- package/dist/chunks/ListItem-DCQhApdJ.js +0 -1
- package/dist/chunks/MessageSelector-CEvbAZGv.js +0 -3
- package/dist/chunks/PluginSettings-D3bQRsge.js +0 -17
- package/dist/chunks/QueryEngine-CMcQGyql.js +0 -1
- package/dist/chunks/REPL-C9f3ToGu.js +0 -1
- package/dist/chunks/RemoteSessionManager-BKD4YmzY.js +0 -2
- package/dist/chunks/ResumeConversation-DxqbAKA4.js +0 -1
- package/dist/chunks/SearchBox-CkO4rQ-9.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BVAhywUI.js +0 -1
- package/dist/chunks/SentryErrorBoundary-M1ipwe1n.js +0 -1
- package/dist/chunks/Settings-D5EWYL40.js +0 -2
- package/dist/chunks/api-BdbBnz5c.js +0 -1
- package/dist/chunks/assistant-BMviqf0l.js +0 -1
- package/dist/chunks/auth-ORBmEqnH.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BAvSPaZ5.js +0 -1
- package/dist/chunks/bridgeConfig-B49H_B9L.js +0 -1
- package/dist/chunks/bridgeEnabled-DsG2JvIr.js +0 -1
- package/dist/chunks/bridgeMain-DYCShrcV.js +0 -1
- package/dist/chunks/caches-BsYvQnWV.js +0 -1
- package/dist/chunks/changeDetector-By54zja0.js +0 -1
- package/dist/chunks/channelNotification-Cx82K1CD.js +0 -1
- package/dist/chunks/clear-BQr2zTyP.js +0 -1
- package/dist/chunks/client-BbavFXJZ.js +0 -1
- package/dist/chunks/color-DOsgZO2n.js +0 -1
- package/dist/chunks/commands-CfwfGt3T.js +0 -1
- package/dist/chunks/commitAttribution-CH9C_hoL.js +0 -1
- package/dist/chunks/completionCache-BQgiR45Q.js +0 -1
- package/dist/chunks/context-noninteractive-DCYvLxWx.js +0 -1
- package/dist/chunks/conversation-DYUVAAQt.js +0 -1
- package/dist/chunks/conversation-NrAy2em3.js +0 -1
- package/dist/chunks/createSession-Czx7_nf6.js +0 -1
- package/dist/chunks/cron-g_P3I5uT.js +0 -1
- package/dist/chunks/datadog-QSR9B7CZ.js +0 -1
- package/dist/chunks/desktop-BN9pHpK_.js +0 -1
- package/dist/chunks/earlyInput-D3OhUZ4G.js +0 -1
- package/dist/chunks/entry-CJlJ47nP.js +0 -14
- package/dist/chunks/envLessBridgeConfig-DSJqg3Ox.js +0 -1
- package/dist/chunks/exit-DxY3yJrp.js +0 -1
- package/dist/chunks/extra-usage-DaxUQk9I.js +0 -1
- package/dist/chunks/extractMemories-B3cTWsph.js +0 -1
- package/dist/chunks/fast-CHiQGMBE.js +0 -1
- package/dist/chunks/gates-DvjyKZVA.js +0 -1
- package/dist/chunks/hooks-DOej0jqp.js +0 -1
- package/dist/chunks/inboundAttachments-BBYxcnvj.js +0 -1
- package/dist/chunks/initReplBridge-Dt2aQBia.js +0 -1
- package/dist/chunks/language-BoKr5ylY.js +0 -1
- package/dist/chunks/loadAgentsDir-whRB0phu.js +0 -1
- package/dist/chunks/loadPluginHooks-CYZjzxyO.js +0 -1
- package/dist/chunks/localSearch-DAwFmV2Y.js +0 -1
- package/dist/chunks/login-DOyB64Rv.js +0 -1
- package/dist/chunks/logout-DTPo3Myl.js +0 -1
- package/dist/chunks/mcp-CVnFM6nR.js +0 -6
- package/dist/chunks/mcp-CzfQB8BT.js +0 -1
- package/dist/chunks/memory-BdUqEKio.js +0 -1
- package/dist/chunks/model-BOc_-7m0.js +0 -1
- package/dist/chunks/plugin-8apy_RBT.js +0 -1
- package/dist/chunks/pluginStartupCheck-EjLvCXru.js +0 -1
- package/dist/chunks/policyLimits-Cdp3QwZ1.js +0 -1
- package/dist/chunks/poorMode-DzEL0cu0.js +0 -1
- package/dist/chunks/processSlashCommand-v1Rvzxwn.js +0 -6
- package/dist/chunks/prompt-DPqKtC0b.js +0 -1
- package/dist/chunks/prompt-WjMHPk90.js +0 -1
- package/dist/chunks/registry-CBqb7wbi.js +0 -1
- package/dist/chunks/sandbox-adapter-DqTuhgud.js +0 -1
- package/dist/chunks/searchExtraTools-Brae4wmG.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BXsK8Dwf.js +0 -1
- package/dist/chunks/sessionMemory-Bv-AYifm.js +0 -1
- package/dist/chunks/sessionMemoryUtils-D-bzdsAT.js +0 -1
- package/dist/chunks/sessionObserver-j8D9hidw.js +0 -1
- package/dist/chunks/sessionStorage-Cw5ibYWA.js +0 -1
- package/dist/chunks/setup-CDxkPTCq.js +0 -2
- package/dist/chunks/sink-DFWgcGHX.js +0 -1
- package/dist/chunks/sinks-BnkxTOU9.js +0 -1
- package/dist/chunks/skillChangeDetector-DwAvG835.js +0 -1
- package/dist/chunks/skillLearning-BI2YDG3K.js +0 -1
- package/dist/chunks/skillLearning-BZMJRJPp.js +0 -1
- package/dist/chunks/startupProfiler-WtUzkMKV.js +0 -1
- package/dist/chunks/status-nte1Arzy.js +0 -1
- package/dist/chunks/tasks-CEs-pxkC.js +0 -1
- package/dist/chunks/teamHelpers-D4vCj2hP.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BDJ1JTcl.js +0 -1
- package/dist/chunks/teleport-RxTr4aCi.js +0 -1
- package/dist/chunks/thinkback-DRJBz3Is.js +0 -1
- package/dist/chunks/toolPool-0zCdXfEu.js +0 -1
- package/dist/chunks/undercover-DYa00dVv.js +0 -1
- package/dist/chunks/upgrade-BHj8ALep.js +0 -1
- package/dist/chunks/useKeybinding-DPOUuymz.js +0 -1
- package/dist/chunks/useMainLoopModel-D3tJJC3y.js +0 -1
- package/dist/chunks/useTerminalSize-Du-EamDN.js +0 -1
- package/dist/chunks/utils-Cr-x1Oyd.js +0 -1
- package/dist/chunks/voiceModeEnabled-DK6u8Aaj.js +0 -1
- package/dist/chunks/voiceStreamSTT-CCkOfmdI.js +0 -1
- package/dist/chunks/worktree-DPpgPLLG.js +0 -1
- /package/dist/chunks/{InProcessTransport-B9II3BiO.js → InProcessTransport-DW2ed2Hs.js} +0 -0
- /package/dist/chunks/{attributionHooks-VGSpz4mk.js → attributionHooks-COqmxGy1.js} +0 -0
- /package/dist/chunks/{attributionTrailer-C8uqiLIb.js → attributionTrailer-Nx8I_ZRK.js} +0 -0
- /package/dist/chunks/{autoModeDenials-DlO5g6E9.js → autoModeDenials-BDpcFLb7.js} +0 -0
- /package/dist/chunks/{bedrockClient-BUmO2U-X.js → bedrockClient-BfPpXPI0.js} +0 -0
- /package/dist/chunks/{ccshareResume-DKwcd0Vc.js → ccshareResume-DPP1blaU.js} +0 -0
- /package/dist/chunks/{chromeNativeHost-BldB1Zzi.js → chromeNativeHost-DfYuJafI.js} +0 -0
- /package/dist/chunks/{claudeDesktop-BqTW_pbB.js → claudeDesktop-CEQCLZmG.js} +0 -0
- /package/dist/chunks/{cleanup-rCLlo4w8.js → cleanup-DUVwlFl7.js} +0 -0
- /package/dist/chunks/{connectHeadless-ByewVfOb.js → connectHeadless-DutPm1RT.js} +0 -0
- /package/dist/chunks/{dangerousBackend-Dkjtndh1.js → dangerousBackend-BDKHrF6i.js} +0 -0
- /package/dist/chunks/{earlyInput-CFYRGxau.js → earlyInput-B3U01GAm.js} +0 -0
- /package/dist/chunks/{eventLoopStallDetector-bYy0fesH.js → eventLoopStallDetector-MNrFR4OH.js} +0 -0
- /package/dist/chunks/{files-Bdr_PQyV.js → files-BGuNpYgH.js} +0 -0
- /package/dist/chunks/{fuse-D3B-UE5Y.js → fuse-D7icKomM.js} +0 -0
- /package/dist/chunks/{instinctParser-DOtj1Kni.js → instinctParser-BMtAMLSx.js} +0 -0
- /package/dist/chunks/{lockfile-C3JsqLpb.js → lockfile-DEaq0BaL.js} +0 -0
- /package/dist/chunks/{main-CfkIGrBF.js → main-SFdnVz-G.js} +0 -0
- /package/dist/chunks/{observationStore-rLlDwRtG.js → observationStore-Bi1rRKcD.js} +0 -0
- /package/dist/chunks/{openaiShared-C-AuktRP.js → openaiShared-BkVgd2rZ.js} +0 -0
- /package/dist/chunks/{output-style-B64-Zum6.js → output-style-F8fBWFZo.js} +0 -0
- /package/dist/chunks/{parseConnectUrl-DL390ePs.js → parseConnectUrl-CVT_db9n.js} +0 -0
- /package/dist/chunks/{poller-BA1jhG3F.js → poller-DhLgWNxJ.js} +0 -0
- /package/dist/chunks/{postCommitAttribution-D8MoHFoz.js → postCommitAttribution-Br4g4R6h.js} +0 -0
- /package/dist/chunks/{projectContext-Dn7umMp6.js → projectContext-2Z2w8AI8.js} +0 -0
- /package/dist/chunks/{renderOptions-Caca3bCd.js → renderOptions-4HxIPoDZ.js} +0 -0
- /package/dist/chunks/{rewind-Djt1zU_3.js → rewind-FKh7loMA.js} +0 -0
- /package/dist/chunks/{sanitization-Ds6zRQyx.js → sanitization-B-JlvWcf.js} +0 -0
- /package/dist/chunks/{sdkHeapDumpMonitor-DLMMNeqo.js → sdkHeapDumpMonitor-DTHI5WbD.js} +0 -0
- /package/dist/chunks/{server-DONKdvGc.js → server-BsxW1FVq.js} +0 -0
- /package/dist/chunks/{serverBanner-DIyjgIM-.js → serverBanner-DR3GYXpH.js} +0 -0
- /package/dist/chunks/{serverLog-D1N5yx8A.js → serverLog-CH1fCGsD.js} +0 -0
- /package/dist/chunks/{sessionDataUploader-CsNePsOb.js → sessionDataUploader-BgmJTXQr.js} +0 -0
- /package/dist/chunks/{sessionManager-BOmgJd1l.js → sessionManager-mesT4zIQ.js} +0 -0
- /package/dist/chunks/{stickers-DDAm--86.js → stickers-B0P4weWp.js} +0 -0
- /package/dist/chunks/{udsClient-CBF_cZFW.js → udsClient-B85rNglp.js} +0 -0
- /package/dist/chunks/{upstreamproxy-CLf1UaJv.js → upstreamproxy-D-6vdoIJ.js} +0 -0
- /package/dist/chunks/{voice-YtzCcIoM.js → voice-BXg-kzte.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-
|
|
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=
|
|
3
|
-
`))}async function W(e,t){let n=e.getAppState(),r=await
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-KjMLauwe.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-CQF8qhne.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
|
+
`)||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
|
+
`))}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-4ZWdjPP4.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-Br6OwASx.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-KjMLauwe.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-4ZWdjPP4.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-C2vEJjLx.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-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-Ci1iwL5Y.js";import{b as p,x as m}from"./startupProfiler-CAntGAbs.js";import{Po as h,Uo as g,dl as _,iA as v,ll as y,rA as b}from"./loadAgentsDir-C_wFhytF.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-6ZKyqv6z.js";import{n as k,t as A}from"./staticRender-C5v46np_.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-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};
|
package/dist/chunks/{context-noninteractive-DZsSp-ES.js → context-noninteractive-CJu7hZCM.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
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-4ZWdjPP4.js";import{b as r,x as i}from"./startupProfiler-rCtNuhXz.js";import{Po as a,Uo as o,dl as s,iA as c,ll as l,rA as u}from"./loadAgentsDir-CQF8qhne.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:i,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
3
|
`;h+=`**Model:** ${s} \n`,h+=`**Tokens:** ${r(i)} / ${r(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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./context-noninteractive-CJu7hZCM.js";t();export{n as call,e as collectContextData};
|
|
@@ -0,0 +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-CQF8qhne.js";import{C as K,y as q}from"./rcDebugLog-DOXxIr8l.js";import{l as J,r as Y}from"./commitAttribution-ClSlXMPG.js";import{n as X,t as Z}from"./caches-Bp4F7tZ5.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-BYMS5Hqa.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-KjMLauwe.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Cc as f,dc as p,yc as m}from"./paths-4ZWdjPP4.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-CQF8qhne.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-4ZWdjPP4.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(`
|
|
@@ -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-BemPA3ot.js`),{getOrganizationUUID:p}=await import(`./client-BUUsZdSe.js`),{getOauthConfig:m}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:h}=await import(`./api-DkgaFAzq.js`),{parseGitHubRepository:g}=await import(`./detectRepository-BLwSmun2.js`),{getDefaultBranch:_}=await import(`./git-hSvFiuiG.js`),{getMainLoopModel:v}=await import(`./model-CgH43-hO.js`),{default:y}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-Budgp2Go.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-BemPA3ot.js`),{getOrganizationUUID:a}=await import(`./client-BUUsZdSe.js`),{getOauthConfig:o}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:c}=await import(`./api-DkgaFAzq.js`),{default:l}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-Budgp2Go.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-BemPA3ot.js`),{getOrganizationUUID:i}=await import(`./client-BUUsZdSe.js`),{getOauthConfig:a}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:o}=await import(`./api-DkgaFAzq.js`),{default:c}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-Budgp2Go.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-BemPA3ot.js`),{getOrganizationUUID:c}=await import(`./client-BUUsZdSe.js`),{getOauthConfig:l}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:u}=await import(`./api-DkgaFAzq.js`),{default:d}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-Budgp2Go.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,r}from"./createSession-DjM6Ev45.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";function t(e,t){let{min:n,max:r}=t,i=new Set;for(let t of e.split(`,`)){let e=t.match(/^\*(?:\/(\d+))?$/);if(e){let t=e[1]?parseInt(e[1],10):1;if(t<1)return null;for(let e=n;e<=r;e+=t)i.add(e);continue}let a=t.match(/^(\d+)-(\d+)(?:\/(\d+))?$/);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10),o=a[3]?parseInt(a[3],10):1,s=n===0&&r===6;if(e>t||o<1||e<n||t>(s?7:r))return null;for(let n=e;n<=t;n+=o)i.add(s&&n===7?0:n);continue}if(t.match(/^\d+$/)){let e=parseInt(t,10);if(n===0&&r===6&&e===7&&(e=0),e<n||e>r)return null;i.add(e);continue}return null}return i.size===0?null:Array.from(i).sort((e,t)=>e-t)}function n(e){if(typeof e!=`string`)return null;let n=e.trim().split(/\s+/);if(n.length!==5)return null;let r=[];for(let e=0;e<5;e++){let i=t(n[e],s[e]);if(!i)return null;r.push(i)}return{minute:r[0],hour:r[1],dayOfMonth:r[2],month:r[3],dayOfWeek:r[4]}}function r(e,t){let n=new Set(e.minute),r=new Set(e.hour),i=new Set(e.dayOfMonth),a=new Set(e.month),o=new Set(e.dayOfWeek),s=e.dayOfMonth.length===31,c=e.dayOfWeek.length===7,l=new Date(t.getTime());l.setSeconds(0,0),l.setMinutes(l.getMinutes()+1);for(let e=0;e<527040;e++){let e=l.getMonth()+1;if(!a.has(e)){l.setMonth(l.getMonth()+1,1),l.setHours(0,0,0,0);continue}let t=l.getDate(),u=l.getDay();if(!(s&&c||(s?o.has(u):c?i.has(t):i.has(t)||o.has(u)))){l.setDate(l.getDate()+1),l.setHours(0,0,0,0);continue}if(!r.has(l.getHours())){l.setHours(l.getHours()+1,0,0,0);continue}if(!n.has(l.getMinutes())){l.setMinutes(l.getMinutes()+1);continue}return l}return null}function i(e,t){return new Date(2e3,0,1,t,e).toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`})}function a(e,t){let n=new Date;return n.setUTCHours(t,e,0,0),n.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,timeZoneName:`short`})}function o(e,t){let n=t?.utc??!1,r=e.trim().split(/\s+/);if(r.length!==5)return e;let[o,s,l,u,d]=r,f=o.match(/^\*\/(\d+)$/);if(f&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(f[1],10);return e===1?`Every minute`:`Every ${e} minutes`}if(o.match(/^\d+$/)&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(o,10);return e===0?`Every hour`:`Every hour at :${e.toString().padStart(2,`0`)}`}let p=s.match(/^\*\/(\d+)$/);if(o.match(/^\d+$/)&&p&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(p[1],10),t=parseInt(o,10),n=t===0?``:` at :${t.toString().padStart(2,`0`)}`;return e===1?`Every hour${n}`:`Every ${e} hours${n}`}if(!o.match(/^\d+$/)||!s.match(/^\d+$/))return e;let m=parseInt(o,10),h=parseInt(s,10),g=n?a:i;if(l===`*`&&u===`*`&&d===`*`)return`Every day at ${g(m,h)}`;if(l===`*`&&u===`*`&&d.match(/^\d$/)){let e=parseInt(d,10)%7,t;if(n){let n=new Date,r=(e-n.getUTCDay()+7)%7;n.setUTCDate(n.getUTCDate()+r),n.setUTCHours(h,m,0,0),t=c[n.getDay()]}else t=c[e];if(t)return`Every ${t} at ${g(m,h)}`}return l===`*`&&u===`*`&&d===`1-5`?`Weekdays at ${g(m,h)}`:e}var s,c,l=e((()=>{s=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:6}],c=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]}));export{n as i,o as n,l as r,r as t};
|
|
@@ -1,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-Ci1iwL5Y.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,hf as Ye,hu as Xe,jg as Ze,kn as Qe,mf as $e,mu as et,qg as tt,qs as nt,qt as rt,uO as it,uk as at,zg as ot}from"./loadAgentsDir-C_wFhytF.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-6ZKyqv6z.js";import{n as ht,r as gt}from"./cron-g_P3I5uT.js";import{d as _t,h as vt}from"./rcDebugLog-C42A0pX1.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(),$e(),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(Ye()).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(),Xe(),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 et),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-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})+`
|
|
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(`
|
|
@@ -1,10 +1,10 @@
|
|
|
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-Ci1iwL5Y.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{E as O,g as pe,p as me,x as k}from"./startupProfiler-CAntGAbs.js";import{$u as he,DC as A,EC as j,Fr as ge,Jr as _e,Jy as ve,Ky as ye,Lr as be,R_ as xe,Ri as Se,Si as Ce,Zu as we,_b as Te,aS as Ee,dS as De,fS as Oe,kr as M,oS as ke,vb as Ae,xr as je,z_ as Me,zi as Ne,zr as Pe}from"./loadAgentsDir-C_wFhytF.js";import{i as Fe,r as N}from"./shellQuote-CBjhlaFO.js";import{t as P}from"./useKeybinding-DPOUuymz.js";import{t as Ie}from"./useTerminalSize-Du-EamDN.js";import{n as Le,t as Re}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{t as ze}from"./SearchBox-CkO4rQ-9.js";import{n as Be,t as Ve}from"./useSearchInput-JPayBRPC.js";import{n as He,t as F}from"./Messages-DTmFVhRG.js";import{n as Ue,t as We}from"./fuse-D3B-UE5Y.js";import{sep as I}from"path";function Ge({log:e,onExit:t,onSelect:n}){let[r,i]=L.useState(null);L.useEffect(()=>{i(null),Pe(e)&&_e(e).then(i)},[e]);let a=Pe(e)&&r===null,o=r??e,s=M(o)||``,c=we();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,L.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,R.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(ee,{message:`Loading session…`}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsx)(h,{children:(0,R.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(v,{flexDirection:`column`,children:[(0,R.jsx)(F,{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,R.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(p,{children:[pe(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsxs)(h,{children:[(0,R.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,z=e((()=>{L=t(l(),1),g(),P(),he(),k(),ge(),A(),He(),R=b()}));function Ke(e,t){if(e===V)return 3+H;let n=i(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function qe(e,t){let n=t-H-U;return i(e)<=n?e:n<=1?e.charAt(0):O(e,n)}function Je({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(W,G),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=>Ke(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-et,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,B.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,B.jsxs)(p,{dimColor:!0,children:[Ye,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===V?e:`#${qe(e,l-H)}`;return(0,B.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,B.jsxs)(p,{dimColor:!0,children:[Xe,h,Ze]}):(0,B.jsx)(p,{dimColor:!0,children:Qe})]})}var B,V,H,U,Ye,Xe,Ze,Qe,$e,et,W,G,tt=e((()=>{l(),g(),k(),B=b(),V=`All`,H=2,U=1,Ye=`← `,Xe=`→`,Ze=` (tab to cycle)`,Qe=`(tab to cycle)`,$e=2,et=2+$e+1,W=1+$e+15,G=14}));function nt({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]=K.useState(new Set),te=K.useRef(!1),g=K.useRef(null),_=K.useCallback(e=>l?l(e):h.has(e),[l,h]),y=K.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=K.useCallback(e=>e?`▼ `:`▶ `,[]),ne=K.useCallback(e=>` ▸ `,[]),x=f??b,re=p??ne,ie=K.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=K.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=K.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),oe=K.useCallback(e=>y.find(t=>t.node.id===e),[y]),C=K.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,rt.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,rt.jsx)(Ee,{options:ae,onChange:K.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:K.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 K,rt,it=e((()=>{K=t(l(),1),g(),ke(),rt=b()}));function at(e,t){return O(e.replace(/\s+/g,` `).trim(),t)}function ot({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function st(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 ct(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?ht:i?Y:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${at(ue(e),l)}${c}${s}`}function lt(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 ut({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=Le(i),oe=d(),C=be(),w=process.env.USER_TYPE===`ant`,[se]=u(),le=Te(se),E=q.useMemo(()=>e=>c(e,le.warning),[le.warning]),de=process.env.USER_TYPE===`ant`,[D,fe]=q.useState(null),[O,pe]=q.useState(!1),[k,he]=q.useState(!1),[A,ge]=q.useState(!1),_e=q.useMemo(()=>re(),[]),[ve,xe]=q.useState(``),[we,Oe]=q.useState(0),[ke,Ae]=q.useState(new Set),[Me,Ne]=q.useState(null),[Pe,Fe]=q.useState(1),[N,P]=q.useState(`list`),[Ie,Re]=q.useState(null),ze=q.useRef(null),[Ve,He]=q.useState(0),[F,Ue]=q.useState({status:`idle`}),[I,L]=q.useState(!1),R=q.useRef(null),{query:z,setQuery:Ke,cursorOffset:qe}=Be({isActive:N===`search`&&F.status!==`searching`,onExit:()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),B=q.useDeferredValue(z),[V,H]=q.useState(``);q.useEffect(()=>{if(!B){H(``);return}let e=setTimeout(H,300,B);return()=>clearTimeout(e)},[B]);let[U,Ye]=q.useState(null),[Xe,Ze]=q.useState(!1);q.useEffect(()=>{ce().then(e=>fe(e)),Se(_e).then(e=>{ge(e.length>1)})},[_e]);let Qe=q.useMemo(()=>new Map(e.map(e=>[e,ft(e)])),[e]),$e=q.useMemo(()=>w?new We(e.map(e=>({log:e,searchableText:Qe.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Qe,w]),et=q.useMemo(()=>mt(e),[e]),W=et.length>0,G=q.useMemo(()=>W?[`All`,...et]:[],[W,et]),tt=G.length>0&&Ve<G.length?Ve:0,K=G[tt],rt=K===`All`?void 0:K,it=+!!W,ut=q.useMemo(()=>{let t=e;return C&&(t=e.filter(e=>{let t=ne(),n=M(e);return!!(t&&n===t||e.customTitle||je(e.messages)||e.firstPrompt||e.customTitle)})),rt!==void 0&&(t=t.filter(e=>e.tag===rt)),O&&D&&(t=t.filter(e=>e.gitBranch===D)),A&&!k&&(t=t.filter(e=>e.projectPath===_e)),t},[e,C,rt,O,D,A,k,_e]),dt=q.useMemo(()=>{if(!z)return ut;let e=z.toLowerCase();return ut.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)})},[ut,z]);q.useEffect(()=>{w&&B&&B!==V&&Ze(!0)},[B,V,w]),q.useEffect(()=>{if(!w||!V||!$e){Ye(null),Ze(!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)>_t?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,$e,V,Ye,Ze);return()=>{clearTimeout(e)}},[V,$e,w]);let{filteredLogs:ht,snippets:Y}=q.useMemo(()=>{let e=new Map,t=dt;if(U&&V&&U.query===V){for(let t of U.results)if(t.searchableText){let n=st(t.searchableText,V,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=U.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[dt,U,V]),X=q.useMemo(()=>F.status===`results`&&F.results.length>0?F.results:ht,[F,ht]),Z=Math.max(30,ae-4),Q=q.useMemo(()=>{if(!C)return[];let e=pt(X);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=X.indexOf(n),i=Y.get(n),a=i?ot(i,E):null;if(t.length===1){let t=lt(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:ct(n,Z),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=X.indexOf(t),i=Y.get(t),a=i?ot(i,E):null,o=lt(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:ct(t,Z,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=lt(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:ct(n,Z,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[C,X,Z,g,Y,E]),yt=q.useMemo(()=>C?[]:X.map((e,t)=>{let n=at(ue(e)+(e.isSidechain?` (sidechain)`:``),Z),r=me(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=Y.get(e),o=a?ot(a,E):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[C,X,E,Z,g,Y]),$=Me?.value.log??null,bt=()=>{if(!C||!$)return``;let e=M($);if(!e)return``;let t=X.filter(t=>M(t)===e);if(!(t.length>1))return``;let n=ke.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=q.useCallback(async()=>{let e=$?M($):void 0;if(!$||!e){P(`list`),xe(``);return}ve.trim()&&(await Ce(e,ve.trim(),$.fullPath),C&&s&&s()),P(`list`),xe(``)},[$,ve,s,C]),St=q.useCallback(()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=q.useCallback(()=>{P(`search`),T(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=q.useCallback(async()=>{if(!z.trim()||!x||!de)return;R.current?.abort();let t=new AbortController;R.current=t,Ue({status:`searching`}),T(`tengu_agentic_search_started`,{query_length:z.length});try{let n=await x(z,e,t.signal);if(t.signal.aborted)return;Ue({status:`results`,results:n,query:z}),T(`tengu_agentic_search_completed`,{query_length:z.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;Ue({status:`error`,message:e instanceof Error?e.message:`Search failed`}),T(`tengu_agentic_search_error`,{query_length:z.length})}},[z,x,de,e]);q.useEffect(()=>{F.status!==`idle`&&F.status!==`searching`&&(F.status===`results`&&F.query!==z||F.status===`error`)&&Ue({status:`idle`})},[z,F]),q.useEffect(()=>()=>{R.current?.abort()},[]);let Tt=q.useRef(F.status);q.useEffect(()=>{let e=Tt.current;if(Tt.current=F.status,e===`searching`&&F.status===`results`){if(C&&Q.length>0)Ne(Q[0]);else if(!C&&X.length>0){let e=X[0];Ne({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[F.status,C,Q,X]);let Et=q.useCallback(e=>{let t=parseInt(e,10),n=X[t];!n||ze.current===t.toString()||(ze.current=t.toString(),Ne({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Fe(t+1))},[X]),Dt=q.useCallback(e=>{Ne(e);let t=X.findIndex(t=>M(t)===M(e.value.log));t>=0&&Fe(t+1)},[X]);_(`confirm:no`,()=>{R.current?.abort(),Ue({status:`idle`}),T(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:N!==`preview`&&F.status===`searching`}),_(`confirm:no`,()=>{P(`list`),xe(``)},{context:`Settings`,isActive:N===`rename`&&F.status!==`searching`}),_(`confirm:no`,()=>{Ke(``),L(!1),i?.()},{context:`Confirmation`,isActive:N!==`preview`&&N!==`rename`&&N!==`search`&&I&&F.status!==`searching`}),y((e,t)=>{if(N!==`preview`&&F.status!==`searching`&&N!==`rename`)if(N===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&z.trim()&&x&&de&&F.status!==`results`&&L(!0);else{if(I){if(t.return){wt(),L(!1);return}else if(t.downArrow){L(!1);return}else if(t.upArrow){P(`search`),L(!1);return}}if(W&&t.tab){let e=t.shift?-1:1;He(t=>{let n=((t<G.length?t:0)+G.length+e)%G.length,r=G[n];return T(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:et.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=!k;he(e),T(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(P(`search`),T(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(P(`rename`),xe(``),T(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Re($),P(`preview`),T(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(P(`search`),Ke(e),T(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];O&&D&&Ot.push(D),A&&!k&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&N!==`search`)+it,At=Math.max(1,Math.floor((t-kt-2)/3));return q.useEffect(()=>{l&&Pe+At*2>=X.length&&l(At*3)},[Pe,At,X.length,l]),e.length===0?null:N===`preview`&&Ie&&C?(0,J.jsx)(Ge,{log:Ie,onExit:()=>{P(`list`),Re(null)},onSelect:o}):(0,J.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(te,{color:`suggestion`})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),W?(0,J.jsx)(Je,{tabs:G,selectedIndex:tt,availableWidth:ae,showAllProjects:g}):(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,N===`list`&&X.length>At&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,`(`,Pe,` of `,X.length,`)`]})]})}),(0,J.jsx)(f,{query:z,isFocused:N===`search`,isTerminalFocused:oe,cursorOffset:qe}),Ot.length>0&&N!==`search`&&(0,J.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsx)(h,{children:Ot})})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),F.status===`searching`&&(0,J.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,J.jsx)(ye,{}),(0,J.jsx)(p,{children:` Searching…`})]}),F.status===`results`&&F.results.length>0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),F.status===`results`&&F.results.length===0&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),F.status===`error`&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&x&&de&&F.status!==`searching`&&F.status!==`results`&&F.status!==`error`&&(0,J.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,J.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{color:I?`suggestion`:void 0,children:I?r.pointer:` `}),(0,J.jsx)(p,{color:I?`suggestion`:void 0,bold:I,children:`Search deeply using Claude →`})]}),(0,J.jsx)(v,{height:1})]}),F.status===`searching`?null:N===`rename`&&$?(0,J.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:`Rename session:`}),(0,J.jsx)(v,{paddingTop:1,children:(0,J.jsx)(De,{value:ve,onChange:xe,onSubmit:xt,placeholder:ue($,`Enter new session name`),columns:ae,cursorOffset:we,onChangeCursorOffset:Oe,showCursor:!0})})]}):C?(0,J.jsx)(nt,{nodes:Q,onSelect:e=>{o(e.value.log)},onFocus:Dt,onCancel:i,focusNodeId:Me?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:N===`search`||I,hideIndexes:!1,isNodeExpanded:e=>{if(N===`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&&(Ae(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&&Ae(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,J.jsx)(Ee,{options:yt,onChange:e=>{let t=X[parseInt(e,10)];t&&o(t)},visibleOptionCount:At,onCancel:i,onFocus:Et,defaultFocusValue:Me?.id.toString(),layout:`expanded`,isDisabled:N===`search`||I,onUpFromFirstItem:Ct}),(0,J.jsx)(v,{paddingLeft:2,children:S.pending?(0,J.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):N===`rename`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F.status===`searching`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:`Searching with Claude…`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,J.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):N===`search`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:Xe&&w?`Searching…`:`Type to Search`}),(0,J.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[b&&(0,J.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),D&&(0,J.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),A&&(0,J.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${k?`current worktree`:`all worktrees`}`}),(0,J.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,J.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,J.jsx)(p,{children:`Type to search`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,J.jsx)(p,{children:bt()})]})})})]})}function dt(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 ft(e){let t=(e.messages.length<=X?e.messages:[...e.messages.slice(0,Z),...e.messages.slice(-Z)]).map(dt).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>Q?n.slice(0,Q):n}function pt(e){let t=new Map;for(let n of e){let e=M(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 mt(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 q,J,ht,Y,X,Z,Q,gt,_t,vt,yt=e((()=>{s(),n(),Ue(),q=t(l(),1),x(),Re(),Ve(),Ie(),g(),P(),se(),k(),Ne(),le(),E(),ge(),Ae(),A(),ke(),ze(),z(),ve(),tt(),Oe(),it(),J=b(),ht=2,Y=4,X=2e3,Z=1e3,Q=5e4,gt=.3,_t=60*1e3,vt=50}));function $(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 bt(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-wt/2)]).map($).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(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&&bt(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-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(Pe(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:
|
|
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-KjMLauwe.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-4ZWdjPP4.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{E as O,g as pe,p as me,x as k}from"./startupProfiler-rCtNuhXz.js";import{DC as he,EC as A,Fr as j,Jr as ge,Ky as _e,Lr as ve,R_ as ye,Ri as be,Si as xe,Wy as Se,Yu as Ce,Zu as we,aS as Te,dS as Ee,fS as De,gb as Oe,hb as ke,kr as M,oS as Ae,xr as je,z_ as Me,zi as Ne,zr as Pe}from"./loadAgentsDir-CQF8qhne.js";import{i as Fe,r as N}from"./shellQuote-CBjhlaFO.js";import{t as P}from"./useKeybinding-DOjEx42R.js";import{t as Ie}from"./useTerminalSize-mqo2Swmk.js";import{n as Le,t as Re}from"./useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js";import{t as ze}from"./SearchBox-CciJ8giD.js";import{n as Be,t as Ve}from"./useSearchInput-CodP_5SB.js";import{n as He,t as F}from"./Messages-KmeXIJqL.js";import{n as Ue,t as We}from"./fuse-D7icKomM.js";import{sep as I}from"path";function Ge({log:e,onExit:t,onSelect:n}){let[r,i]=L.useState(null);L.useEffect(()=>{i(null),Pe(e)&&ge(e).then(i)},[e]);let a=Pe(e)&&r===null,o=r??e,s=M(o)||``,c=Ce();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,L.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,R.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(ee,{message:`Loading session…`}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsx)(h,{children:(0,R.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(v,{flexDirection:`column`,children:[(0,R.jsx)(F,{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,R.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(p,{children:[pe(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsxs)(h,{children:[(0,R.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,z=e((()=>{L=t(l(),1),g(),P(),we(),k(),j(),he(),He(),R=b()}));function Ke(e,t){if(e===V)return 3+H;let n=i(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function qe(e,t){let n=t-H-U;return i(e)<=n?e:n<=1?e.charAt(0):O(e,n)}function Je({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(W,G),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=>Ke(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-et,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,B.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,B.jsxs)(p,{dimColor:!0,children:[Ye,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===V?e:`#${qe(e,l-H)}`;return(0,B.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,B.jsxs)(p,{dimColor:!0,children:[Xe,h,Ze]}):(0,B.jsx)(p,{dimColor:!0,children:Qe})]})}var B,V,H,U,Ye,Xe,Ze,Qe,$e,et,W,G,tt=e((()=>{l(),g(),k(),B=b(),V=`All`,H=2,U=1,Ye=`← `,Xe=`→`,Ze=` (tab to cycle)`,Qe=`(tab to cycle)`,$e=2,et=2+$e+1,W=1+$e+15,G=14}));function nt({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]=K.useState(new Set),te=K.useRef(!1),g=K.useRef(null),_=K.useCallback(e=>l?l(e):h.has(e),[l,h]),y=K.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=K.useCallback(e=>e?`▼ `:`▶ `,[]),ne=K.useCallback(e=>` ▸ `,[]),x=f??b,re=p??ne,ie=K.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=K.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=K.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),oe=K.useCallback(e=>y.find(t=>t.node.id===e),[y]),C=K.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,rt.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,rt.jsx)(Te,{options:ae,onChange:K.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:K.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 K,rt,it=e((()=>{K=t(l(),1),g(),Ae(),rt=b()}));function at(e,t){return O(e.replace(/\s+/g,` `).trim(),t)}function ot({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function st(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 ct(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?ht:i?Y:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${at(ue(e),l)}${c}${s}`}function lt(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 ut({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=Le(i),oe=d(),C=ve(),w=process.env.USER_TYPE===`ant`,[se]=u(),le=ke(se),E=q.useMemo(()=>e=>c(e,le.warning),[le.warning]),de=process.env.USER_TYPE===`ant`,[D,fe]=q.useState(null),[O,pe]=q.useState(!1),[k,he]=q.useState(!1),[j,ge]=q.useState(!1),_e=q.useMemo(()=>re(),[]),[ye,Ce]=q.useState(``),[we,De]=q.useState(0),[Oe,Ae]=q.useState(new Set),[Me,Ne]=q.useState(null),[Pe,Fe]=q.useState(1),[N,P]=q.useState(`list`),[Ie,Re]=q.useState(null),ze=q.useRef(null),[Ve,He]=q.useState(0),[F,Ue]=q.useState({status:`idle`}),[I,L]=q.useState(!1),R=q.useRef(null),{query:z,setQuery:Ke,cursorOffset:qe}=Be({isActive:N===`search`&&F.status!==`searching`,onExit:()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),B=q.useDeferredValue(z),[V,H]=q.useState(``);q.useEffect(()=>{if(!B){H(``);return}let e=setTimeout(H,300,B);return()=>clearTimeout(e)},[B]);let[U,Ye]=q.useState(null),[Xe,Ze]=q.useState(!1);q.useEffect(()=>{ce().then(e=>fe(e)),be(_e).then(e=>{ge(e.length>1)})},[_e]);let Qe=q.useMemo(()=>new Map(e.map(e=>[e,ft(e)])),[e]),$e=q.useMemo(()=>w?new We(e.map(e=>({log:e,searchableText:Qe.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Qe,w]),et=q.useMemo(()=>mt(e),[e]),W=et.length>0,G=q.useMemo(()=>W?[`All`,...et]:[],[W,et]),tt=G.length>0&&Ve<G.length?Ve:0,K=G[tt],rt=K===`All`?void 0:K,it=+!!W,ut=q.useMemo(()=>{let t=e;return C&&(t=e.filter(e=>{let t=ne(),n=M(e);return!!(t&&n===t||e.customTitle||je(e.messages)||e.firstPrompt||e.customTitle)})),rt!==void 0&&(t=t.filter(e=>e.tag===rt)),O&&D&&(t=t.filter(e=>e.gitBranch===D)),j&&!k&&(t=t.filter(e=>e.projectPath===_e)),t},[e,C,rt,O,D,j,k,_e]),dt=q.useMemo(()=>{if(!z)return ut;let e=z.toLowerCase();return ut.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)})},[ut,z]);q.useEffect(()=>{w&&B&&B!==V&&Ze(!0)},[B,V,w]),q.useEffect(()=>{if(!w||!V||!$e){Ye(null),Ze(!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)>_t?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,$e,V,Ye,Ze);return()=>{clearTimeout(e)}},[V,$e,w]);let{filteredLogs:ht,snippets:Y}=q.useMemo(()=>{let e=new Map,t=dt;if(U&&V&&U.query===V){for(let t of U.results)if(t.searchableText){let n=st(t.searchableText,V,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=U.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[dt,U,V]),X=q.useMemo(()=>F.status===`results`&&F.results.length>0?F.results:ht,[F,ht]),Z=Math.max(30,ae-4),Q=q.useMemo(()=>{if(!C)return[];let e=pt(X);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=X.indexOf(n),i=Y.get(n),a=i?ot(i,E):null;if(t.length===1){let t=lt(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:ct(n,Z),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=X.indexOf(t),i=Y.get(t),a=i?ot(i,E):null,o=lt(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:ct(t,Z,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=lt(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:ct(n,Z,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[C,X,Z,g,Y,E]),yt=q.useMemo(()=>C?[]:X.map((e,t)=>{let n=at(ue(e)+(e.isSidechain?` (sidechain)`:``),Z),r=me(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=Y.get(e),o=a?ot(a,E):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[C,X,E,Z,g,Y]),$=Me?.value.log??null,bt=()=>{if(!C||!$)return``;let e=M($);if(!e)return``;let t=X.filter(t=>M(t)===e);if(!(t.length>1))return``;let n=Oe.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=q.useCallback(async()=>{let e=$?M($):void 0;if(!$||!e){P(`list`),Ce(``);return}ye.trim()&&(await xe(e,ye.trim(),$.fullPath),C&&s&&s()),P(`list`),Ce(``)},[$,ye,s,C]),St=q.useCallback(()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=q.useCallback(()=>{P(`search`),T(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=q.useCallback(async()=>{if(!z.trim()||!x||!de)return;R.current?.abort();let t=new AbortController;R.current=t,Ue({status:`searching`}),T(`tengu_agentic_search_started`,{query_length:z.length});try{let n=await x(z,e,t.signal);if(t.signal.aborted)return;Ue({status:`results`,results:n,query:z}),T(`tengu_agentic_search_completed`,{query_length:z.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;Ue({status:`error`,message:e instanceof Error?e.message:`Search failed`}),T(`tengu_agentic_search_error`,{query_length:z.length})}},[z,x,de,e]);q.useEffect(()=>{F.status!==`idle`&&F.status!==`searching`&&(F.status===`results`&&F.query!==z||F.status===`error`)&&Ue({status:`idle`})},[z,F]),q.useEffect(()=>()=>{R.current?.abort()},[]);let Tt=q.useRef(F.status);q.useEffect(()=>{let e=Tt.current;if(Tt.current=F.status,e===`searching`&&F.status===`results`){if(C&&Q.length>0)Ne(Q[0]);else if(!C&&X.length>0){let e=X[0];Ne({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[F.status,C,Q,X]);let Et=q.useCallback(e=>{let t=parseInt(e,10),n=X[t];!n||ze.current===t.toString()||(ze.current=t.toString(),Ne({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Fe(t+1))},[X]),Dt=q.useCallback(e=>{Ne(e);let t=X.findIndex(t=>M(t)===M(e.value.log));t>=0&&Fe(t+1)},[X]);_(`confirm:no`,()=>{R.current?.abort(),Ue({status:`idle`}),T(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:N!==`preview`&&F.status===`searching`}),_(`confirm:no`,()=>{P(`list`),Ce(``)},{context:`Settings`,isActive:N===`rename`&&F.status!==`searching`}),_(`confirm:no`,()=>{Ke(``),L(!1),i?.()},{context:`Confirmation`,isActive:N!==`preview`&&N!==`rename`&&N!==`search`&&I&&F.status!==`searching`}),y((e,t)=>{if(N!==`preview`&&F.status!==`searching`&&N!==`rename`)if(N===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&z.trim()&&x&&de&&F.status!==`results`&&L(!0);else{if(I){if(t.return){wt(),L(!1);return}else if(t.downArrow){L(!1);return}else if(t.upArrow){P(`search`),L(!1);return}}if(W&&t.tab){let e=t.shift?-1:1;He(t=>{let n=((t<G.length?t:0)+G.length+e)%G.length,r=G[n];return T(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:et.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&&j){let e=!k;he(e),T(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(P(`search`),T(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(P(`rename`),Ce(``),T(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Re($),P(`preview`),T(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(P(`search`),Ke(e),T(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];O&&D&&Ot.push(D),j&&!k&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&N!==`search`)+it,At=Math.max(1,Math.floor((t-kt-2)/3));return q.useEffect(()=>{l&&Pe+At*2>=X.length&&l(At*3)},[Pe,At,X.length,l]),e.length===0?null:N===`preview`&&Ie&&C?(0,J.jsx)(Ge,{log:Ie,onExit:()=>{P(`list`),Re(null)},onSelect:o}):(0,J.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(te,{color:`suggestion`})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),W?(0,J.jsx)(Je,{tabs:G,selectedIndex:tt,availableWidth:ae,showAllProjects:g}):(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,N===`list`&&X.length>At&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,`(`,Pe,` of `,X.length,`)`]})]})}),(0,J.jsx)(f,{query:z,isFocused:N===`search`,isTerminalFocused:oe,cursorOffset:qe}),Ot.length>0&&N!==`search`&&(0,J.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsx)(h,{children:Ot})})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),F.status===`searching`&&(0,J.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,J.jsx)(Se,{}),(0,J.jsx)(p,{children:` Searching…`})]}),F.status===`results`&&F.results.length>0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),F.status===`results`&&F.results.length===0&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),F.status===`error`&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&x&&de&&F.status!==`searching`&&F.status!==`results`&&F.status!==`error`&&(0,J.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,J.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{color:I?`suggestion`:void 0,children:I?r.pointer:` `}),(0,J.jsx)(p,{color:I?`suggestion`:void 0,bold:I,children:`Search deeply using Claude →`})]}),(0,J.jsx)(v,{height:1})]}),F.status===`searching`?null:N===`rename`&&$?(0,J.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:`Rename session:`}),(0,J.jsx)(v,{paddingTop:1,children:(0,J.jsx)(Ee,{value:ye,onChange:Ce,onSubmit:xt,placeholder:ue($,`Enter new session name`),columns:ae,cursorOffset:we,onChangeCursorOffset:De,showCursor:!0})})]}):C?(0,J.jsx)(nt,{nodes:Q,onSelect:e=>{o(e.value.log)},onFocus:Dt,onCancel:i,focusNodeId:Me?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:N===`search`||I,hideIndexes:!1,isNodeExpanded:e=>{if(N===`search`||O)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Oe.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(Ae(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&&Ae(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,J.jsx)(Te,{options:yt,onChange:e=>{let t=X[parseInt(e,10)];t&&o(t)},visibleOptionCount:At,onCancel:i,onFocus:Et,defaultFocusValue:Me?.id.toString(),layout:`expanded`,isDisabled:N===`search`||I,onUpFromFirstItem:Ct}),(0,J.jsx)(v,{paddingLeft:2,children:S.pending?(0,J.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):N===`rename`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,J.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F.status===`searching`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:`Searching with Claude…`}),(0,J.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,J.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,J.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):N===`search`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:Xe&&w?`Searching…`:`Type to Search`}),(0,J.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[b&&(0,J.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),D&&(0,J.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),j&&(0,J.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${k?`current worktree`:`all worktrees`}`}),(0,J.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,J.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,J.jsx)(p,{children:`Type to search`}),(0,J.jsx)(A,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,J.jsx)(p,{children:bt()})]})})})]})}function dt(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 ft(e){let t=(e.messages.length<=X?e.messages:[...e.messages.slice(0,Z),...e.messages.slice(-Z)]).map(dt).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>Q?n.slice(0,Q):n}function pt(e){let t=new Map;for(let n of e){let e=M(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 mt(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 q,J,ht,Y,X,Z,Q,gt,_t,vt,yt=e((()=>{s(),n(),Ue(),q=t(l(),1),x(),Re(),Ve(),Ie(),g(),P(),se(),k(),Ne(),le(),E(),j(),Oe(),he(),Ae(),ze(),z(),_e(),tt(),De(),it(),J=b(),ht=2,Y=4,X=2e3,Z=1e3,Q=5e4,gt=.3,_t=60*1e3,vt=50}));function $(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 bt(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-wt/2)]).map($).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(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&&bt(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-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(Pe(e))try{return await ge(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
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=bt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
3
|
`)}
|
|
4
4
|
|
|
5
5
|
Search query: "${e}"
|
|
6
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 Me({model:e,system:Et,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 Ct,wt,Tt,Et,Dt=e((()=>{fe(),C(),E(),ae(),
|
|
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 Me({model:e,system:Et,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 Ct,wt,Tt,Et,Dt=e((()=>{fe(),C(),E(),ae(),j(),ye(),oe(),Ct=2e3,wt=100,Tt=100,Et=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
8
|
|
|
9
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
10
|
|
|
@@ -37,4 +37,4 @@ When in doubt, INCLUDE the session. It's better to return too many results than
|
|
|
37
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
38
|
|
|
39
39
|
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
-
{"relevant_indices": [2, 5, 0]}`}));function Ot(e,t,n){let r=re();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=M(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Fe([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+I)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=M(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Fe([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{x(),N(),
|
|
40
|
+
{"relevant_indices": [2, 5, 0]}`}));function Ot(e,t,n){let r=re();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=M(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Fe([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+I)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=M(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Fe([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{x(),N(),j()}));export{ut as a,Dt as i,kt as n,yt as o,St as r,Ot as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,r){let i=r?r.trim().split(/\s+/):[],a=i[0]||`status`;return a===`attach`?(e("Use `claude daemon attach` from the CLI. Attach is not available inside the REPL.",{display:`system`}),null):(e((await n(async()=>{if(a===`bg`)await(await import(`./bg-CngkAkgc.js`)).handleBgStart(i.slice(1));else{let{daemonMain:e}=await import(`./main-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,r){let i=r?r.trim().split(/\s+/):[],a=i[0]||`status`;return a===`attach`?(e("Use `claude daemon attach` from the CLI. Attach is not available inside the REPL.",{display:`system`}),null):(e((await n(async()=>{if(a===`bg`)await(await import(`./bg-CngkAkgc.js`)).handleBgStart(i.slice(1));else{let{daemonMain:e}=await import(`./main-SFdnVz-G.js`);await e([a,...i.slice(1)])}})).join(`
|
|
2
2
|
`)||`Done.`,{display:`system`}),null)}async function n(e){let t=[],n=console.log,r=console.error;console.log=(...e)=>t.push(e.map(String).join(` `)),console.error=(...e)=>t.push(e.map(String).join(` `));try{await e()}finally{console.log=n,console.error=r}return t}e((()=>{}))();export{t as call};
|
|
@@ -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-4ZWdjPP4.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-ClZjR-jM.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-KjMLauwe.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./DesktopHandoff-CJpa8Xy-.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-CV3brWsG.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-D3GysagF.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./earlyInput-B3U01GAm.js";export{e as startCapturingEarlyInput};
|