claude-code-best 2.6.8 → 2.6.9
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-YmrkKVv2.js → AddWorkspaceDirectory-_RSNUS7K.js} +1 -1
- package/dist/chunks/{App-IAjCdPUn.js → App-4VqMMjIu.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DhsT69v7.js → ApproveApiKey-B7oSxzWc.js} +1 -1
- package/dist/chunks/ApproveApiKey-Bmcop2Do.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DCUVNGfn.js → AssistantSessionChooser-Lf5l_1Dh.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-Di_gH2TW.js → BackgroundTasksDialog-Ckgmqm6u.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-BeZqE75e.js → BypassPermissionsModeDialog-DNqPpiPC.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-CZHktpPE.js → ClaudeInChromeOnboarding-BODZ64gw.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-Dofr1TYr.js → ClaudeMdExternalIncludesDialog-DLI6ey3G.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DO61Zz-S.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-FSHC5mxO.js +1 -0
- package/dist/chunks/{DesktopHandoff-C8_CDNft.js → DesktopHandoff--xyI5kTQ.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-DkGWCFpL.js → DevChannelsDialog-DJ4mHsA_.js} +1 -1
- package/dist/chunks/{DiffDialog-93P95op8.js → DiffDialog-CVWUlOjm.js} +1 -1
- package/dist/chunks/{Doctor-Zd0UaR5d.js → Doctor-DVoFX-9y.js} +1 -1
- package/dist/chunks/Doctor-Dcntgp5Z.js +1 -0
- package/dist/chunks/{ExitFlow-4edARxmd.js → ExitFlow-BKzQPr75.js} +1 -1
- package/dist/chunks/{Feedback-CZY-BikO.js → Feedback-hFZwDSRp.js} +1 -1
- package/dist/chunks/Grove-Cmcsx2UE.js +1 -0
- package/dist/chunks/{Grove-TYf1glGP.js → Grove-G0DtwY22.js} +1 -1
- package/dist/chunks/{HybridTransport-BNexuwcN.js → HybridTransport-xN03sWrt.js} +1 -1
- package/dist/chunks/{ITermBackend-DuomVpsD.js → ITermBackend-DzN3ZWds.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Byury3Zx.js → InvalidConfigDialog-Iy4Su1Lm.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-B8_0AvWo.js → InvalidSettingsDialog-dx4y_nY-.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-xL_wQCda.js → MCPConnectionManager-kVO-4BcA.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-C6u4RM2a.js → McpParsingWarnings-D420-W8M.js} +1 -1
- package/dist/chunks/{MessageSelector-DAyH1noQ.js → MessageSelector-CDVC2CAj.js} +1 -1
- package/dist/chunks/{Messages-QH8_sB13.js → Messages-C5gVVVmY.js} +2 -2
- package/dist/chunks/{Onboarding-XWhelEBr.js → Onboarding-BkidUre_.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-BvPz1jLU.js → OverageCreditUpsell-DoRUucoN.js} +1 -1
- package/dist/chunks/{PluginSettings-D1YHfrE1.js → PluginSettings-DhpNtjTm.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-rqUoa9Ch.js → PromptInputFooterSuggestions-BnpXzkW9.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-OTViHSR0.js → PromptInputHelpMenu-DKbiO4C0.js} +1 -1
- package/dist/chunks/{QueryEngine-DigBggXq.js → QueryEngine-J15EOjWx.js} +1 -1
- package/dist/chunks/REPL-Dk3Ics9i.js +1 -0
- package/dist/chunks/{REPL-D2p-vgct.js → REPL-nrJ13J1o.js} +6 -6
- package/dist/chunks/{RemoteCallout-CCIWIrd-.js → RemoteCallout-DGXIcTKv.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-Dx81p5dH.js → RemoteSessionManager-3KsuTCZM.js} +1 -1
- package/dist/chunks/{ResumeConversation-73r3Zh5P.js → ResumeConversation-kS7lkjJm.js} +1 -1
- package/dist/chunks/{SSETransport-C9hd2v-w.js → SSETransport-Cy1rXP6E.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-C998WSxs.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BJLT-ebr.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-z8tMb-zO.js → SentryErrorBoundary-B_6MfzRa.js} +1 -1
- package/dist/chunks/{Settings-D9qdaMe5.js → Settings-DBopjMkN.js} +2 -2
- package/dist/chunks/{TeleportProgress-CPXN7u3Z.js → TeleportProgress-CQUN_zoe.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-CiyXjTxq.js → TeleportRepoMismatchDialog-CPquWrd-.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-Dao8ktHk.js → TeleportResumeWrapper-NIFNCHIO.js} +1 -1
- package/dist/chunks/{ThemePicker-CFYFNnPp.js → ThemePicker-DnK0DStD.js} +1 -1
- package/dist/chunks/{TmuxBackend-B5DBBugq.js → TmuxBackend-C00k5RF9.js} +1 -1
- package/dist/chunks/{TrustDialog-DtIXHMR_.js → TrustDialog-CUnvtDeS.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-BK0wOS55.js → ValidationErrorsList-CJbO1qub.js} +1 -1
- package/dist/chunks/{WelcomeV2-BjUbi9vp.js → WelcomeV2-BBFGft_e.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-DFLLlAOp.js → WindowsTerminalBackend-DSsgxuNK.js} +1 -1
- package/dist/chunks/{add-dir-JoVgNFOk.js → add-dir-BPqd010H.js} +1 -1
- package/dist/chunks/{agentDisplay-B3RjWR-3.js → agentDisplay-C0B1b_90.js} +1 -1
- package/dist/chunks/{agents-UqS5PhD2.js → agents-CYs7WGHP.js} +1 -1
- package/dist/chunks/{agents-BUyLUAIu.js → agents-DMzVeRly.js} +1 -1
- package/dist/chunks/{ant-Bq1wIvnP.js → ant-BO0Hmoii.js} +1 -1
- package/dist/chunks/api-B2HW-oZI.js +1 -0
- package/dist/chunks/{api-O4eHGLTY.js → api-DLLVkmRJ.js} +1 -1
- package/dist/chunks/asciicast-C3nf97NR.js +1 -0
- package/dist/chunks/{asciicast-o5Zg4dJt.js → asciicast-DIsaWcsJ.js} +1 -1
- package/dist/chunks/assistant-BmM44yln.js +1 -0
- package/dist/chunks/{assistant-CMIbt3Ir.js → assistant-CHp4-EaF.js} +1 -1
- package/dist/chunks/{assistant-D5Tg_1ry.js → assistant-_dIpsqHM.js} +1 -1
- package/dist/chunks/{auth-D3SKo0wT.js → auth-DelyQc8g.js} +1 -1
- package/dist/chunks/auth-ndSNSeqS.js +1 -0
- package/dist/chunks/{autoMode-BIVJlkBM.js → autoMode-D3-o7xPK.js} +1 -1
- package/dist/chunks/{autonomy-Mi7Fkq1J.js → autonomy-CzSRoxjl.js} +1 -1
- package/dist/chunks/{autonomy-BYi6z9LD.js → autonomy-tTAucjip.js} +1 -1
- package/dist/chunks/{autonomyPanel-D_GsUMOf.js → autonomyPanel-DcK8N52K.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-BG_UYxFF.js → backgroundHousekeeping-Bbkz61_-.js} +2 -2
- package/dist/chunks/backgroundHousekeeping-DVo3ndZr.js +1 -0
- package/dist/chunks/{branch-BC-K45fw.js → branch-ZJF4xAh9.js} +1 -1
- package/dist/chunks/{bridge-DBteRzgS.js → bridge-C6gSt_32.js} +2 -2
- package/dist/chunks/{bridgeConfig-C_GoD1k5.js → bridgeConfig-DXUNQp2l.js} +1 -1
- package/dist/chunks/bridgeConfig-ZcbBdhji.js +1 -0
- package/dist/chunks/bridgeEnabled-D5qCI5v2.js +1 -0
- package/dist/chunks/{bridgeEnabled-cSK8a7tN.js → bridgeEnabled-G6vxQV-7.js} +1 -1
- package/dist/chunks/bridgeMain-B4Zv8UOe.js +1 -0
- package/dist/chunks/{bridgeMain-QbfEOTqV.js → bridgeMain-DlnIQOtX.js} +6 -6
- package/dist/chunks/{bridgeMessaging-CqXQzew4.js → bridgeMessaging-mek-AaFi.js} +1 -1
- package/dist/chunks/{bridgePointer-FvAMj3re.js → bridgePointer-B2FPGDWR.js} +1 -1
- package/dist/chunks/{btw-DBtPlEWc.js → btw-Cz2lyle-.js} +1 -1
- package/dist/chunks/{buddy-BYwTgNnf.js → buddy-BMqKttFw.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-DkYLp9m0.js → bypassPermissionsKillswitch-BxvX48jr.js} +1 -1
- package/dist/chunks/caches-D_W3nCFE.js +1 -0
- package/dist/chunks/{caches-DGW9ovtw.js → caches-wtRUk5y5.js} +2 -2
- package/dist/chunks/{ccrClient-B9pi3b8Y.js → ccrClient-BOrmrmgF.js} +1 -1
- package/dist/chunks/changeDetector-CUsHUdul.js +1 -0
- package/dist/chunks/channelNotification-CLVU5AuO.js +1 -0
- package/dist/chunks/{channelNotification-n7Avue-9.js → channelNotification-D8do6HUN.js} +1 -1
- package/dist/chunks/{chrome-BwZPfW9Z.js → chrome-JF2BXNK6.js} +1 -1
- package/dist/chunks/clear-BP-G1JWa.js +1 -0
- package/dist/chunks/client-BHfY6SC5.js +1 -0
- package/dist/chunks/{color-BsBrog6H.js → color-oh8CGhkI.js} +1 -1
- package/dist/chunks/commands-E0eNJ_XZ.js +1 -0
- package/dist/chunks/commitAttribution-B4DOgUS7.js +1 -0
- package/dist/chunks/{commitAttribution-q7SEukgl.js → commitAttribution-CUdm_sRl.js} +1 -1
- package/dist/chunks/{compact-DiY1w7pT.js → compact-R6vMbGQQ.js} +1 -1
- package/dist/chunks/{companion-D18UNnC7.js → companion-ClxqTyG9.js} +1 -1
- package/dist/chunks/{config-D3QKcEKz.js → config-BQ-MayP6.js} +1 -1
- package/dist/chunks/{config-CSHnElBp.js → config-CPK9PlWS.js} +1 -1
- package/dist/chunks/{context-DnyYrN2X.js → context-CWfsKYEB.js} +1 -1
- package/dist/chunks/{context-noninteractive-CFlod2Eg.js → context-noninteractive-BJ4hE3MX.js} +1 -1
- package/dist/chunks/context-noninteractive-D1Kxn5e0.js +1 -0
- package/dist/chunks/conversation-C23rDJe3.js +1 -0
- package/dist/chunks/{conversation-CRoOMglD.js → conversation-DizpkPtq.js} +1 -1
- package/dist/chunks/{copy-CHGX-YpC.js → copy-BuPCS2HG.js} +1 -1
- package/dist/chunks/{createSSHSession-Bf-8h3Sw.js → createSSHSession-Di9Je4Th.js} +1 -1
- package/dist/chunks/createSession-Bsa0VJKS.js +1 -0
- package/dist/chunks/{createSession-rRZIkjl3.js → createSession-D6v0lBtG.js} +1 -1
- package/dist/chunks/{cronJitterConfig-DmBBJDTf.js → cronJitterConfig-By18m-PD.js} +1 -1
- package/dist/chunks/{crossProjectResume-BQxLBpDD.js → crossProjectResume-C4YT2T6P.js} +1 -1
- package/dist/chunks/{datadog-Bb65d6yd.js → datadog-BFSdlK6C.js} +1 -1
- package/dist/chunks/datadog-MUvg76p3.js +1 -0
- package/dist/chunks/{desktop-DiCA6RUU.js → desktop-Bd-JHrBo.js} +1 -1
- package/dist/chunks/{diff-BvLQ-t8P.js → diff-DGmINgOc.js} +1 -1
- package/dist/chunks/{directoryCompletion-DP_4B1GL.js → directoryCompletion-D7EGwonO.js} +1 -1
- package/dist/chunks/{doctor-bmTXLycZ.js → doctor-DQ42RQPx.js} +1 -1
- package/dist/chunks/{effort-CSTwkB2B.js → effort-E6XjzPYR.js} +1 -1
- package/dist/chunks/entry-Di8oWZUk.js +14 -0
- package/dist/chunks/{envLessBridgeConfig-DJJKeDBT.js → envLessBridgeConfig-BNvozi46.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-CUTBQKDY.js +1 -0
- package/dist/chunks/{exit-eirVuF-n.js → exit-CVlpMwCq.js} +1 -1
- package/dist/chunks/{export-CcJD8r8U.js → export-CXcPQd0T.js} +1 -1
- package/dist/chunks/{exportRenderer-DtezFcml.js → exportRenderer-B9WXgMV2.js} +1 -1
- package/dist/chunks/{extra-usage-CBcgeIcJ.js → extra-usage-B2KmuAZe.js} +1 -1
- package/dist/chunks/extra-usage-DVtAa1zD.js +1 -0
- package/dist/chunks/{extra-usage-core-DWM0Q56J.js → extra-usage-core-B20tawuN.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-BvJEi4WX.js → extra-usage-noninteractive-DZRe98BZ.js} +1 -1
- package/dist/chunks/{extraUsage-CWde-Mi0.js → extraUsage-CxqJdnGC.js} +1 -1
- package/dist/chunks/extractMemories-8uB606Y0.js +1 -0
- package/dist/chunks/{fast-DQyJ7c7s.js → fast-CPmJ2bp3.js} +1 -1
- package/dist/chunks/fast-DTGg3pRh.js +1 -0
- package/dist/chunks/{feedback-BzBBKT2y.js → feedback-4GY3ahvw.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-BOHIpp-w.js → firstPartyEventLogger-CISUrAsf.js} +1 -1
- package/dist/chunks/{flushGate-DeCDhkKp.js → flushGate-Dr8sMjB7.js} +1 -1
- package/dist/chunks/gates-BbF5S-Dy.js +1 -0
- package/dist/chunks/{gates-CAVdjC23.js → gates-DI4pxvrD.js} +1 -1
- package/dist/chunks/{gemini-CFrOUVS4.js → gemini-Dcfosr2Z.js} +1 -1
- package/dist/chunks/{generateRecap-Bcp5DiiO.js → generateRecap-CH_fgtxk.js} +1 -1
- package/dist/chunks/{generateSessionName-DeFGkHct.js → generateSessionName-DO0R__8w.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-B07Wb07_.js → githubRepoPathMapping-D5I8CVDz.js} +1 -1
- package/dist/chunks/{grok-DtidcVWD.js → grok-X0FzcE6Y.js} +1 -1
- package/dist/chunks/{growthbook-gLwBDK-r.js → growthbook-DZPT2JzB.js} +1 -1
- package/dist/chunks/{heapdump-BxQYlnPR.js → heapdump-Cq6i0wJH.js} +1 -1
- package/dist/chunks/{help-Bi0sABuv.js → help-B8ddA-Ec.js} +1 -1
- package/dist/chunks/{hooks-Cc_DxF9N.js → hooks-CvFNccdv.js} +1 -1
- package/dist/chunks/hooks-gwB4Eotj.js +1 -0
- package/dist/chunks/{hostAdapter-D9_d4gU0.js → hostAdapter-D3s4JFk-.js} +1 -1
- package/dist/chunks/{ide-3wDIOoZF.js → ide-CzxV5_D7.js} +1 -1
- package/dist/chunks/{inboundAttachments-DPMETKd6.js → inboundAttachments-B3ZTyNKF.js} +1 -1
- package/dist/chunks/inboundAttachments-DxrrrqBW.js +1 -0
- package/dist/chunks/{initReplBridge-BWP41EGm.js → initReplBridge-DWpGy3aE.js} +1 -1
- package/dist/chunks/{insights-w7qM4YyA.js → insights-DiWlKgVQ.js} +1 -1
- package/dist/chunks/{install-N2FgArWv.js → install-BFpg1zm1.js} +1 -1
- package/dist/chunks/{install-github-app-By39Zi78.js → install-github-app-BUCGGSw0.js} +1 -1
- package/dist/chunks/{install-slack-app-CVwZphU-.js → install-slack-app-D5JDqzbs.js} +1 -1
- package/dist/chunks/{instrumentation-BkLEupDC.js → instrumentation--BToLJT9.js} +3 -3
- package/dist/chunks/{job-CgBE27O7.js → job-mUyxSEc2.js} +1 -1
- package/dist/chunks/{keybindings-DHXJzU3E.js → keybindings-D4DbE4G0.js} +1 -1
- package/dist/chunks/{lang-DLneRt1b.js → lang-cMcnaxAR.js} +1 -1
- package/dist/chunks/language-DC6bsdvI.js +1 -0
- package/dist/chunks/{language-BVAzlrRz.js → language-sTn9sA3E.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-CtfK0qPa.js → launchAgentsPlatform-CAfyCAsQ.js} +1 -1
- package/dist/chunks/{launchAutofixPr-CQBv0rQ0.js → launchAutofixPr-CSMamZS6.js} +1 -1
- package/dist/chunks/{launchLocalMemory-BNE09TKr.js → launchLocalMemory-nYAwNsNT.js} +1 -1
- package/dist/chunks/{launchLocalVault-Dw_NJUnd.js → launchLocalVault-yPp8S-tG.js} +1 -1
- package/dist/chunks/{launchMemoryStores-CRRB6Z5A.js → launchMemoryStores-Dk3SXucB.js} +1 -1
- package/dist/chunks/{launchOnboarding-nMAF5iv7.js → launchOnboarding-BoqmHyRx.js} +1 -1
- package/dist/chunks/{launchSchedule-Akq1AmK8.js → launchSchedule-C2HBjD6C.js} +1 -1
- package/dist/chunks/{launchSkillStore-Zwtasj13.js → launchSkillStore-B5Yjvi-k.js} +1 -1
- package/dist/chunks/{launchTeleport-BzlIYyll.js → launchTeleport-BayvAnwh.js} +1 -1
- package/dist/chunks/{launchVault-BevXlxJB.js → launchVault-BszsgPbZ.js} +1 -1
- package/dist/chunks/loadAgentsDir-6_9ZFegv.js +1 -0
- package/dist/chunks/{loadAgentsDir-DF6FgRn-.js → loadAgentsDir-Cl2w3uvH.js} +53 -53
- package/dist/chunks/{loadPluginHooks-DBHkyJaj.js → loadPluginHooks-YHtjByxm.js} +1 -1
- package/dist/chunks/{localSearch-v4itMlCM.js → localSearch-CpeqVibs.js} +1 -1
- package/dist/chunks/localSearch-DbEm6f3k.js +1 -0
- package/dist/chunks/login-D2x89UCR.js +1 -0
- package/dist/chunks/{login-CKodBzyZ.js → login-TVtq34WQ.js} +1 -1
- package/dist/chunks/{logoV2Utils-VebeEs7Y.js → logoV2Utils-DwaRnvOY.js} +1 -1
- package/dist/chunks/logout-BBPihkXp.js +1 -0
- package/dist/chunks/{magicDocs-uX5n3NKh.js → magicDocs-_yNWB88A.js} +1 -1
- package/dist/chunks/{main-Cd_i0ZPo.js → main-gTbhsbIs.js} +15 -15
- package/dist/chunks/{mappers-CPL2ni36.js → mappers-COd8OOml.js} +1 -1
- package/dist/chunks/{mcp-Dhp1SaId.js → mcp-CChzTC5v.js} +2 -2
- package/dist/chunks/{mcp-Ci_TbB5m.js → mcp-D-0wE0nJ.js} +1 -1
- package/dist/chunks/{mcp-DeWOD4B4.js → mcp-DoraEndj.js} +1 -1
- package/dist/chunks/{mcpServer-CPJo2eKm.js → mcpServer-CpBN77YB.js} +1 -1
- package/dist/chunks/{mcpServer-CTuPkyD6.js → mcpServer-Wd9rZG_E.js} +1 -1
- package/dist/chunks/{memory-enMuKEnU.js → memory-I21QZZ9h.js} +1 -1
- package/dist/chunks/{model-4f3U2YMu.js → model-BrHh21Db.js} +1 -1
- package/dist/chunks/model-C6_WjCy0.js +1 -0
- package/dist/chunks/{onChangeAppState-DxTGoS7j.js → onChangeAppState-Cn_HSmmQ.js} +1 -1
- package/dist/chunks/{openai-CwG_KpH1.js → openai-BD2V4lHN.js} +1 -1
- package/dist/chunks/{overageCreditGrant-CCkJVN9k.js → overageCreditGrant-B47t5a73.js} +1 -1
- package/dist/chunks/{passes-O0VEQz1a.js → passes-DAOPYX0C.js} +1 -1
- package/dist/chunks/{path-C4kbwvSH.js → path-B3lx7yHn.js} +1 -1
- package/dist/chunks/{paths-o5iA-EnQ.js → paths-q1-Ni8Oh.js} +3 -3
- package/dist/chunks/{permissions-BtYQvivG.js → permissions-BmxTU-Pk.js} +1 -1
- package/dist/chunks/{pipeTransport-BEfqa7Uh.js → pipeTransport-DnHE3axn.js} +1 -1
- package/dist/chunks/{plan-Jw4GjVL0.js → plan-4dmnQ9bv.js} +1 -1
- package/dist/chunks/{plugin-DZq0voFR.js → plugin-CG7lJIpf.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-D19vNoOp.js → pluginAutoupdate-CPLuidh-.js} +1 -1
- package/dist/chunks/{pluginBlocklist-DeX8I4dK.js → pluginBlocklist-BHxIUqu4.js} +1 -1
- package/dist/chunks/{pluginCliCommands-CMgqxOaT.js → pluginCliCommands-BcDIvxR3.js} +1 -1
- package/dist/chunks/{pluginFlagging-DFLE5fkh.js → pluginFlagging-Dh6rYOvj.js} +1 -1
- package/dist/chunks/{pluginOperations-BTz69m3_.js → pluginOperations-fdLcp72i.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-CWWKwD5F.js → pluginStartupCheck-Dy7EckW4.js} +1 -1
- package/dist/chunks/pluginStartupCheck-fyqW-stg.js +1 -0
- package/dist/chunks/{plugins-BPUnAc0r.js → plugins-C3-iYKTp.js} +1 -1
- package/dist/chunks/policyLimits-DUGrXcje.js +1 -0
- package/dist/chunks/{pollConfig-DyHumJli.js → pollConfig-BGXMaSla.js} +1 -1
- package/dist/chunks/{poor-CHHZIPDW.js → poor-CxAil0Mi.js} +1 -1
- package/dist/chunks/poorMode-BkPHRLuG.js +1 -0
- package/dist/chunks/{poorMode-7N6J6YN2.js → poorMode-DFcYVnMT.js} +1 -1
- package/dist/chunks/{print-QCXJDmz0.js → print-Cog1o-Tw.js} +4 -4
- package/dist/chunks/{privacy-settings-DR0_P3JF.js → privacy-settings-D6g7p6sB.js} +1 -1
- package/dist/chunks/{processBashCommand-CkqKsBSD.js → processBashCommand-DqgujTR4.js} +1 -1
- package/dist/chunks/{processSlashCommand-DIk_hLHW.js → processSlashCommand-DUPS9Xx3.js} +1 -1
- package/dist/chunks/prompt-B-8CD-W_.js +1 -0
- package/dist/chunks/{prompt-DiHksuOs.js → prompt-BmOnuQfF.js} +1 -1
- package/dist/chunks/prompt-Da3gIGA8.js +1 -0
- package/dist/chunks/{promptEditor-B3S5E5Q7.js → promptEditor-ClGwMkWl.js} +1 -1
- package/dist/chunks/{protocolHandler-D1XT2l3j.js → protocolHandler--b0d38gF.js} +1 -1
- package/dist/chunks/{rate-limit-options-DHh1ksB5.js → rate-limit-options-DD2ZRREl.js} +1 -1
- package/dist/chunks/{rcDebugLog-BNojB_eB.js → rcDebugLog-fhwD4wm-.js} +1 -1
- package/dist/chunks/{referral-BADm5sBf.js → referral-rRvT6UDX.js} +1 -1
- package/dist/chunks/{refresh-D48fjYJ4.js → refresh-C7S_6LOQ.js} +1 -1
- package/dist/chunks/{registerProtocol-Dzmi6VC4.js → registerProtocol-Bu_tz5Au.js} +1 -1
- package/dist/chunks/{registry-CEu_N3dS.js → registry-Bk0vdx_8.js} +1 -1
- package/dist/chunks/{release-notes-Dr61jYDO.js → release-notes-BShc_V-B.js} +1 -1
- package/dist/chunks/{releaseNotes-5SV7C5aV.js → releaseNotes-D3wZdQVZ.js} +2 -2
- package/dist/chunks/{reload-plugins-BxuE-21F.js → reload-plugins-CpytFAAC.js} +1 -1
- package/dist/chunks/{remote-env-BaQjT5em.js → remote-env-B9Of1v31.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-B8MjcW6f.js → remoteBridgeCore-BXp6nJ8q.js} +1 -1
- package/dist/chunks/{remoteControlServer-BvoNcg9D.js → remoteControlServer-BvlTaHu4.js} +1 -1
- package/dist/chunks/{rename-B3q0tgmd.js → rename-DhTddAd7.js} +1 -1
- package/dist/chunks/{resume-BSGOqus7.js → resume-DwVeFqnc.js} +1 -1
- package/dist/chunks/{runtimeObserver-Bb6wSUMJ.js → runtimeObserver-BtgDP8Gz.js} +1 -1
- package/dist/chunks/{runtimeObserver-BbwUiToa.js → runtimeObserver-dtT0QHYO.js} +2 -2
- package/dist/chunks/sandbox-adapter-Cm8kCM_U.js +1 -0
- package/dist/chunks/{sandbox-toggle-L7YPKXba.js → sandbox-toggle-CG2vZNAb.js} +1 -1
- package/dist/chunks/searchExtraTools-D-RZ9DId.js +1 -0
- package/dist/chunks/{sentry-DG3ru8XE.js → sentry-DFk8bzvt.js} +1 -1
- package/dist/chunks/{session-B5wA2K9M.js → session-DifFcUdR.js} +1 -1
- package/dist/chunks/{sessionDiscovery-DijWFNjj.js → sessionDiscovery-CRbLIQv1.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-Bixkjai4.js +1 -0
- package/dist/chunks/{sessionMemory-CeWjRuFL.js → sessionMemory-BdptRKL8.js} +1 -1
- package/dist/chunks/sessionMemory-T1K_mJRE.js +1 -0
- package/dist/chunks/sessionMemoryUtils-q3xRtP-z.js +1 -0
- package/dist/chunks/{sessionObserver-CsDT2GnB.js → sessionObserver-D3vw6SJ_.js} +1 -1
- package/dist/chunks/sessionObserver-i_3day_6.js +1 -0
- package/dist/chunks/sessionStorage-CusaYoh0.js +1 -0
- package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +3 -0
- package/dist/chunks/{sessionTitle-CxmvZO71.js → sessionTitle-DnvlYJ-c.js} +1 -1
- package/dist/chunks/{sessionTracing-Cy5dAplG.js → sessionTracing-BkzKJi0v.js} +1 -1
- package/dist/chunks/{settingsSync-54E8xV8N.js → settingsSync-CHZVpM34.js} +1 -1
- package/dist/chunks/{setup-GJtdESQj.js → setup-BfecYO-n.js} +1 -1
- package/dist/chunks/{setup-B5CMpp0c.js → setup-BpwYOhci.js} +2 -2
- package/dist/chunks/{setup-KWELOokh.js → setup-GxlEx1KG.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-C4NGjljb.js → shadowedRuleDetection-FNzEipG0.js} +1 -1
- package/dist/chunks/{sideQuestion-DBrzdgkl.js → sideQuestion-Bfa0SZn5.js} +1 -1
- package/dist/chunks/sink-BSwQ045N.js +1 -0
- package/dist/chunks/{sink-BKc24wdw.js → sink-DpAjuilF.js} +1 -1
- package/dist/chunks/{sinks-BTS1DWM4.js → sinks-C37Xl5c3.js} +2 -2
- package/dist/chunks/sinks-DHHmQJi-.js +1 -0
- package/dist/chunks/{skill-learning-C5NrosiL.js → skill-learning-BSeEbCnP.js} +1 -1
- package/dist/chunks/{skillChangeDetector-NJrEtU47.js → skillChangeDetector-BEDBRGbY.js} +1 -1
- package/dist/chunks/{skillGapStore-D1rkePoo.js → skillGapStore-B4GmZRJ0.js} +2 -2
- package/dist/chunks/{skillGapStore-uXpRqLGG.js → skillGapStore-BCO6YB3H.js} +1 -1
- package/dist/chunks/{skillGenerator-Deog7yBO.js → skillGenerator-QgDWAvzK.js} +2 -2
- package/dist/chunks/skillLearning-CFYgFRPE.js +1 -0
- package/dist/chunks/skillLearning-en7AuVDZ.js +1 -0
- package/dist/chunks/{skillPanel-Bx63GX9w.js → skillPanel-srZjMIbC.js} +3 -3
- package/dist/chunks/{skillSearchPanel-CM5EZGkH.js → skillSearchPanel-DTvHcwNK.js} +2 -2
- package/dist/chunks/{skills-JvC7Ms0P.js → skills-BlVUkWg4.js} +1 -1
- package/dist/chunks/{sprites-YBiqlYch.js → sprites-QO9r_mXk.js} +1 -1
- package/dist/chunks/{stats-BJMKNvVK.js → stats-DdXM-u7l.js} +1 -1
- package/dist/chunks/{status-DAJ28yxZ.js → status-BIZWtZqI.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-B7nbsqLz.js → statusNoticeHelpers-9sIAjiE6.js} +1 -1
- package/dist/chunks/{tag-B4y7cBqH.js → tag-DDJ8pAsl.js} +1 -1
- package/dist/chunks/{tasks-CSye58Ap.js → tasks-DYt6udr3.js} +1 -1
- package/dist/chunks/{teamHelpers-BFZ4eVwW.js → teamHelpers-BJuKEuyS.js} +1 -1
- package/dist/chunks/teamHelpers-Cw5dPQor.js +1 -0
- package/dist/chunks/teammateModeSnapshot-BXC7ssXX.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-DXc2vyo2.js → teammateModeSnapshot-Zp1weNIZ.js} +1 -1
- package/dist/chunks/{teleport-NN6zSxxe.js → teleport-DkoFG3EI.js} +1 -1
- package/dist/chunks/{templateJobs-DAVqqU0g.js → templateJobs-V2-TVeGE.js} +1 -1
- package/dist/chunks/{terminalSetup-DqL65XR2.js → terminalSetup-DMUDhXur.js} +1 -1
- package/dist/chunks/{terminalSetup-jZKBoPTc.js → terminalSetup-l0Vv_v1c.js} +1 -1
- package/dist/chunks/{theme-DPv2L3ut.js → theme-Dm1yCDce.js} +1 -1
- package/dist/chunks/thinkback-D1mk7cq1.js +1 -0
- package/dist/chunks/{thinkback-tcfR5Uod.js → thinkback-DQAZE5SA.js} +1 -1
- package/dist/chunks/{thinkback-play-D_uOESmO.js → thinkback-play-BJcGmc9X.js} +1 -1
- package/dist/chunks/{toolEventObserver-D6ZTtdh_.js → toolEventObserver-BgkqkNwy.js} +1 -1
- package/dist/chunks/{toolEventObserver-CtApZXry.js → toolEventObserver-C-BImvCz.js} +1 -1
- package/dist/chunks/toolPool-DNH5H4Jg.js +1 -0
- package/dist/chunks/{toolPool-DFpa-yul.js → toolPool-DYvz_Mjt.js} +1 -1
- package/dist/chunks/{trustedDevice-DsgCQRsJ.js → trustedDevice-BDrK9AQ6.js} +1 -1
- package/dist/chunks/{trustedDevice-Bxn7WW5C.js → trustedDevice-CXsk3eij.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-BfuSrdXz.js → ultrareviewCommand-Bc8hMzHz.js} +1 -1
- package/dist/chunks/undercover-DUrQYxYo.js +1 -0
- package/dist/chunks/{undercover-CM8zTx5g.js → undercover-kRoI_nlN.js} +1 -1
- package/dist/chunks/{updateCCB-DTArxdyR.js → updateCCB-BPGNN7VA.js} +1 -1
- package/dist/chunks/upgrade-BTI562Ce.js +1 -0
- package/dist/chunks/{upgrade-CEd1Jxw_.js → upgrade-DmEGLk6v.js} +1 -1
- package/dist/chunks/{upload-DNo3bZLc.js → upload-49qk5TBL.js} +1 -1
- package/dist/chunks/{usage-X4-qec8g.js → usage-DhJDFJVx.js} +1 -1
- package/dist/chunks/{usage-DEwRsc7E.js → usage-sYgTL8wR.js} +1 -1
- package/dist/chunks/{useMainLoopModel-2A9HV1H3.js → useMainLoopModel-CJaR_qEJ.js} +1 -1
- package/dist/chunks/{useManagePlugins-D9MBag8O.js → useManagePlugins-B1FpmxFo.js} +1 -1
- package/dist/chunks/{useMergedTools-DCYrP_YE.js → useMergedTools-eMPZ95TX.js} +1 -1
- package/dist/chunks/{useSearchInput-CepwLBvi.js → useSearchInput-CR-b0Qi6.js} +1 -1
- package/dist/chunks/{useSettingsErrors-C8ffWXbY.js → useSettingsErrors-p-PFBeaC.js} +1 -1
- package/dist/chunks/{useVoice-vHZVaTAN.js → useVoice-D3PqTfCK.js} +1 -1
- package/dist/chunks/{util-B13MVSse.js → util-BZ2fS3PR.js} +1 -1
- package/dist/chunks/utils-hhztcb0b.js +1 -0
- package/dist/chunks/{validatePlugin-Cf_toBOJ.js → validatePlugin-QtcXXmZu.js} +1 -1
- package/dist/chunks/{vim-6p7eiRPG.js → vim-LmepJftY.js} +1 -1
- package/dist/chunks/{voice-Bvc_BxoI.js → voice-CNRTt4gH.js} +1 -1
- package/dist/chunks/voiceModeEnabled-B57V7REx.js +1 -0
- package/dist/chunks/{voiceModeEnabled-BPbOh6jd.js → voiceModeEnabled-wWM929QG.js} +1 -1
- package/dist/chunks/{voiceStreamSTT-CzCUhap3.js → voiceStreamSTT-CnK9GN6Q.js} +1 -1
- package/dist/chunks/voiceStreamSTT-Dp-1uSjP.js +1 -0
- package/dist/chunks/{workerRegistry-DCtC-WN3.js → workerRegistry-CrIpKIZe.js} +1 -1
- package/dist/chunks/worktree-YbEK6b36.js +1 -0
- package/dist/chunks/{xml-CqxiCY4v.js → xml-CMdTGiv6.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-CAvlRKLr.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DrkzPawC.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CtqOQRDT.js +0 -1
- package/dist/chunks/Doctor-CheDaF3O.js +0 -1
- package/dist/chunks/Grove-CbcR0CsI.js +0 -1
- package/dist/chunks/REPL-Cxh0Qnnt.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BNpA8JzR.js +0 -1
- package/dist/chunks/SentryErrorBoundary-BFwcMSIK.js +0 -1
- package/dist/chunks/api-kAjsowcb.js +0 -1
- package/dist/chunks/asciicast-aoKFhc7C.js +0 -1
- package/dist/chunks/assistant-nOCkNa3_.js +0 -1
- package/dist/chunks/auth-CDOk9J9A.js +0 -1
- package/dist/chunks/backgroundHousekeeping-wHy1eAso.js +0 -1
- package/dist/chunks/bridgeConfig-V_pmBzSH.js +0 -1
- package/dist/chunks/bridgeEnabled-BxtxHb8R.js +0 -1
- package/dist/chunks/bridgeMain-CMNptMs4.js +0 -1
- package/dist/chunks/caches-B-GiT9hm.js +0 -1
- package/dist/chunks/changeDetector-S1Jti1bW.js +0 -1
- package/dist/chunks/channelNotification-Bx6dpA7I.js +0 -1
- package/dist/chunks/clear-BXv0Sq3m.js +0 -1
- package/dist/chunks/client-DNQukPEE.js +0 -1
- package/dist/chunks/commands-BK3ugb0u.js +0 -1
- package/dist/chunks/commitAttribution-CtQYmnw-.js +0 -1
- package/dist/chunks/context-noninteractive-0YpW67KZ.js +0 -1
- package/dist/chunks/conversation-DCG0fiGV.js +0 -1
- package/dist/chunks/createSession-BYf27ahD.js +0 -1
- package/dist/chunks/datadog-NnzM1Mu3.js +0 -1
- package/dist/chunks/entry-BUwwv2dM.js +0 -14
- package/dist/chunks/envLessBridgeConfig-Dq02Vvx1.js +0 -1
- package/dist/chunks/extra-usage-DhB0NElh.js +0 -1
- package/dist/chunks/extractMemories-wcRNh_jz.js +0 -1
- package/dist/chunks/fast-ukzN3wl2.js +0 -1
- package/dist/chunks/gates-CB_pFChT.js +0 -1
- package/dist/chunks/hooks-BTBhK9sh.js +0 -1
- package/dist/chunks/inboundAttachments-DBaPmCTv.js +0 -1
- package/dist/chunks/language-ZBygqv6V.js +0 -1
- package/dist/chunks/loadAgentsDir-OIIKHPq9.js +0 -1
- package/dist/chunks/localSearch-DslXIfeC.js +0 -1
- package/dist/chunks/login-CTIVwgFU.js +0 -1
- package/dist/chunks/logout-B3MyP8fk.js +0 -1
- package/dist/chunks/model-BsHyPvD0.js +0 -1
- package/dist/chunks/pluginStartupCheck-Non969kz.js +0 -1
- package/dist/chunks/policyLimits-D6dpS-CU.js +0 -1
- package/dist/chunks/poorMode-DX4EXe0o.js +0 -1
- package/dist/chunks/prompt-2ia5b-QO.js +0 -1
- package/dist/chunks/prompt-CNtVpGdl.js +0 -1
- package/dist/chunks/sandbox-adapter-Cr6f6gjf.js +0 -1
- package/dist/chunks/searchExtraTools-DRVIhwVJ.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-DnbPctQc.js +0 -1
- package/dist/chunks/sessionMemory-BOT9f5f0.js +0 -1
- package/dist/chunks/sessionMemoryUtils-B47JMJa2.js +0 -1
- package/dist/chunks/sessionObserver-BNZflr2e.js +0 -1
- package/dist/chunks/sessionStorage-BUuPrnU0.js +0 -1
- package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +0 -3
- package/dist/chunks/sink-DG0SNHP7.js +0 -1
- package/dist/chunks/sinks-Cbp-8X1S.js +0 -1
- package/dist/chunks/skillLearning-BHjRTDJw.js +0 -1
- package/dist/chunks/skillLearning-By7jxHSI.js +0 -1
- package/dist/chunks/teamHelpers-CKBoDEPj.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BfOLEMKn.js +0 -1
- package/dist/chunks/thinkback-B0OSwcPG.js +0 -1
- package/dist/chunks/toolPool-DqemSx_r.js +0 -1
- package/dist/chunks/undercover-B-R6dhHB.js +0 -1
- package/dist/chunks/upgrade-CCrHxXrm.js +0 -1
- package/dist/chunks/utils-C-vk0zpl.js +0 -1
- package/dist/chunks/voiceModeEnabled-JSBux8GA.js +0 -1
- package/dist/chunks/voiceStreamSTT-D9ER6Ml3.js +0 -1
- package/dist/chunks/worktree-Dv0mPuy_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ln as e,vt as t,wn as n}from"./schemas-BGAvj1T4.js";import{t as r}from"./v4-f1i_CNUT.js";import{E as i,T as a,U as o,V as s,d as c,s as l,w as u}from"./debug-UI3T040K.js";import{
|
|
1
|
+
import{Ln as e,vt as t,wn as n}from"./schemas-BGAvj1T4.js";import{t as r}from"./v4-f1i_CNUT.js";import{E as i,T as a,U as o,V as s,d as c,s as l,w as u}from"./debug-UI3T040K.js";import{_ as d,c as f,g as p,l as m,m as h}from"./sessionStoragePortable-DJZ_6cL8.js";import{n as g,t as _}from"./lazySchema-2sOku3cX.js";import{dirname as v,join as y}from"path";import{mkdir as b,readFile as x,stat as S,unlink as C,writeFile as w}from"fs/promises";r(),l(),s(),d(),_(),m(),u();var T=50,E=g(()=>n({sessionId:e(),environmentId:e(),source:t([`standalone`,`repl`])}));function D(e){return y(f(),h(e),`bridge-pointer.json`)}async function O(e,t){let n=D(e);try{await b(v(n),{recursive:!0}),await w(n,i(t),`utf8`),c(`[bridge:pointer] wrote ${n}`)}catch(e){c(`[bridge:pointer] write failed: ${e}`,{level:`warn`})}}async function k(e){let t=D(e),n,r;try{r=(await S(t)).mtimeMs,n=await x(t,`utf8`)}catch{return null}let i=E().safeParse(M(n));if(!i.success)return c(`[bridge:pointer] invalid schema, clearing: ${t}`),await j(e),null;let a=Math.max(0,Date.now()-r);return a>144e5?(c(`[bridge:pointer] stale (>4h mtime), clearing: ${t}`),await j(e),null):{...i.data,ageMs:a}}async function A(e){let t=await k(e);if(t)return{pointer:t,dir:e};let n=await p(e);if(n.length<=1)return null;if(n.length>T)return c(`[bridge:pointer] ${n.length} worktrees exceeds fanout cap ${T}, skipping`),null;let r=h(e),i=n.filter(e=>h(e)!==r),a=await Promise.all(i.map(async e=>{let t=await k(e);return t?{pointer:t,dir:e}:null})),o=null;for(let e of a)e&&(!o||e.pointer.ageMs<o.pointer.ageMs)&&(o=e);return o&&c(`[bridge:pointer] fanout found pointer in worktree ${o.dir} (ageMs=${o.pointer.ageMs})`),o}async function j(e){let t=D(e);try{await C(t),c(`[bridge:pointer] cleared ${t}`)}catch(e){o(e)||c(`[bridge:pointer] clear failed: ${e}`,{level:`warn`})}}function M(e){try{return a(e)}catch{return null}}export{j as clearBridgePointer,k as readBridgePointer,A as readBridgePointerAcrossWorktrees,O as writeBridgePointer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Ct as n,F as r,Rn as i,Tt as a,W as o,b as s,t as c,x as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{Ac as d,Gs as f,Pc as p}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Ct as n,F as r,Rn as i,Tt as a,W as o,b as s,t as c,x as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{Ac as d,Gs as f,Pc as p}from"./paths-q1-Ni8Oh.js";import{L as m,V as h}from"./debug-UI3T040K.js";import{LO as g,Lo as _,Ml as v,OD as y,Oo as b,Uw as x,Uy as S,Vg as C,Wy as w,_k as T,dt as E,ft as D,jl as O,kD as k,vk as A,yk as j,zg as M}from"./loadAgentsDir-Cl2w3uvH.js";import{X as N}from"./rcDebugLog-fhwD4wm-.js";import{n as P,r as F}from"./sideQuestion-Bfa0SZn5.js";import{i as I,n as L}from"./modalContext-CmSKRyea.js";function R({question:e,context:t,onDone:n}){let[i,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(0),h=(0,H.useRef)(null),{rows:g}=I(r());a(()=>p(e=>e+1),i||u?null:80);function _(e){if(e.key===`escape`||e.key===`return`||e.key===` `||e.ctrl&&(e.key===`c`||e.key===`d`)){e.preventDefault(),n(void 0,{display:`skip`});return}(e.key===`up`||e.ctrl&&e.key===`p`)&&(e.preventDefault(),h.current?.scrollBy(-K)),(e.key===`down`||e.ctrl&&e.key===`n`)&&(e.preventDefault(),h.current?.scrollBy(K))}(0,H.useEffect)(()=>{let n=y();async function r(){try{let r=await F({question:e,cacheSafeParams:await B(t)});n.signal.aborted||(r.response?c(r.response):d(`No response received`))}catch(e){n.signal.aborted||d(m(e)||`Failed to get response`)}}return r(),()=>{n.abort()}},[e,t]);let v=Math.max(5,g-W-G);return(0,U.jsxs)(l,{flexDirection:`column`,paddingLeft:2,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:_,children:[(0,U.jsxs)(l,{children:[(0,U.jsxs)(s,{color:`warning`,bold:!0,children:[`/btw`,` `]}),(0,U.jsx)(s,{dimColor:!0,children:e})]}),(0,U.jsx)(l,{marginTop:1,marginLeft:2,maxHeight:v,children:(0,U.jsx)(o,{ref:h,flexDirection:`column`,flexGrow:1,children:u?(0,U.jsx)(s,{color:`error`,children:u}):i?(0,U.jsx)(M,{children:i}):(0,U.jsxs)(l,{children:[(0,U.jsx)(S,{frame:f,messageColor:`warning`}),(0,U.jsx)(s,{color:`warning`,children:`Answering...`})]})})}),(i||u)&&(0,U.jsx)(l,{marginTop:1,children:(0,U.jsxs)(s,{dimColor:!0,children:[`↑`,`/`,`↓`,` to scroll · Space, Enter, or Escape to dismiss`]})})]})}function z(e){let t=e.at(-1);return t?.type===`assistant`&&t.message.stop_reason===null?e.slice(0,-1):e}async function B(e){let t=b(z(e.messages)),n=O();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[r,i,a]=await Promise.all([E(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),A(),T()]);return{systemPrompt:N(r),userContext:i,systemContext:a,toolUseContext:e,forkContextMessages:t}}async function V(e,t,n){let r=n?.trim();return r?(p(e=>({...e,btwUseCount:e.btwUseCount+1})),(0,U.jsx)(R,{question:r,context:t,onDone:e})):(e(`Usage: /btw <your question>`,{display:`system`}),null)}var H,U,W,G,K;e((()=>{i(),H=t(i(),1),n(),C(),w(),f(),D(),L(),j(),x(),c(),k(),d(),h(),v(),_(),P(),g(),U=u(),W=5,G=6,K=3}))();export{V as call};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i,x as a,xt as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ac as c,Jt as l,Pc as u,Sc as d,St as f,on as p,wt as m}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i,x as a,xt as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ac as c,Jt as l,Pc as u,Sc as d,St as f,on as p,wt as m}from"./paths-q1-Ni8Oh.js";import{l as h,u as g}from"./oauth-CdZEzMww.js";import{a as _,i as v,n as y,o as b,r as x,s as S,t as C,v as w}from"./companion-ClxqTyG9.js";import{r as T,t as E}from"./sprites-QO9r_mXk.js";function D({name:e,value:t}){let n=Math.round(Math.max(0,Math.min(100,t))/10),i=`█`.repeat(n)+`░`.repeat(10-n);return(0,k.jsxs)(r,{children:[e.padEnd(10),` `,i,` `,String(t).padStart(3)]})}function O({companion:e,lastReaction:t,onDone:n}){let i=_[e.rarity],s=b[e.rarity],c=T(e,0);return o(()=>{n?.(void 0,{display:`skip`})},{isActive:n!==void 0}),(0,k.jsxs)(a,{flexDirection:`column`,borderStyle:`round`,borderColor:i,paddingX:j,paddingY:1,width:A,flexShrink:0,children:[(0,k.jsxs)(a,{justifyContent:`space-between`,children:[(0,k.jsxs)(r,{bold:!0,color:i,children:[s,` `,e.rarity.toUpperCase()]}),(0,k.jsx)(r,{color:i,children:e.species.toUpperCase()})]}),e.shiny&&(0,k.jsxs)(r,{color:`warning`,bold:!0,children:[`✨`,` SHINY `,`✨`]}),(0,k.jsx)(a,{flexDirection:`column`,marginY:1,children:c.map((e,t)=>(0,k.jsx)(r,{color:i,children:e},t))}),(0,k.jsx)(r,{bold:!0,children:e.name}),(0,k.jsx)(a,{marginY:1,children:(0,k.jsxs)(r,{dimColor:!0,italic:!0,children:[`"`,e.personality,`"`]})}),(0,k.jsx)(a,{flexDirection:`column`,children:S.map(t=>(0,k.jsx)(D,{name:t,value:e.stats[t]??0},t))}),t&&(0,k.jsxs)(a,{flexDirection:`column`,marginTop:1,children:[(0,k.jsx)(r,{dimColor:!0,children:`last said`}),(0,k.jsx)(a,{borderStyle:`round`,borderColor:`inactive`,paddingX:1,children:(0,k.jsx)(r,{dimColor:!0,italic:!0,children:t})})]})]})}var k,A,j,M=e((()=>{i(),E(),w(),k=s(),A=40,j=2}));function N(e,t){let n=y();if(!n||d().companionMuted)return;let r=P(e,n.name),i=Date.now();if(!r&&i-R<z)return;let a=I(e);a.trim()&&(R=i,L(n,a,r).then(e=>{e&&(B.push(e),B.length>V&&B.shift(),t(e))}).catch(()=>{}))}function P(e,t){let n=RegExp(`\\b${F(t)}\\b`,`i`);for(let t=e.length-1;t>=Math.max(0,e.length-3);t--){let r=e[t];if(r?.type!==`user`)continue;let i=r.message?.content;if(typeof i==`string`&&n.test(i))return!0}return!1}function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function I(e){return e.slice(-12).filter(e=>e.type===`user`||e.type===`assistant`).map(e=>{let t=e.type===`user`?`user`:`claude`,n=e.message?.content;return`${t}: ${typeof n==`string`?n.slice(0,300):Array.isArray(n)?n.filter(e=>e?.type===`text`).map(e=>e.text).join(` `).slice(0,300):``}`}).join(`
|
|
2
2
|
`).slice(0,5e3)}async function L(e,t,n){let r=l();if(!r?.accessToken)return null;let i=d().oauthAccount?.organizationUuid;if(!i)return null;let a=`${h().BASE_API_URL}/api/organizations/${i}/claude_code/buddy_react`,o=await fetch(a,{method:`POST`,headers:{Authorization:`Bearer ${r.accessToken}`,"Content-Type":`application/json`,"User-Agent":f()},body:JSON.stringify({name:e.name.slice(0,32),personality:e.personality.slice(0,200),species:e.species,rarity:e.rarity,stats:e.stats,transcript:t,reason:n?`addressed`:`turn`,recent:B.map(e=>e.slice(0,200)),addressed:n}),signal:AbortSignal.timeout(1e4)});if(!o.ok)return null;try{return(await o.json()).reaction?.trim()||null}catch{return null}}var R,z,B,V,H=e((()=>{x(),c(),p(),g(),m(),R=0,z=45e3,B=[],V=8}));function U(e){return e.charAt(0).toUpperCase()+e.slice(1)}async function W(e,t,n){let r=n?.trim().toLowerCase()??``,i=t.setAppState;if(r===`off`)return u(e=>({...e,companionMuted:!0})),e(`companion muted`,{display:`system`}),null;if(r===`on`)return u(e=>({...e,companionMuted:!1})),e(`companion unmuted`,{display:`system`}),null;if(r===`pet`){let n=y();return n?(u(e=>({...e,companionMuted:!1})),i?.(e=>({...e,companionPetAt:Date.now()})),N(t.messages??[],e=>i?.(t=>t.companionReaction===e?t:{...t,companionReaction:e})),e(`petted ${n.name}`,{display:`system`}),null):(e(`no companion yet · run /buddy first`,{display:`system`}),null)}let a=y();if(a&&d().companionMuted&&u(e=>({...e,companionMuted:!1})),a){let n=t.getAppState?.()?.companionReaction;return G.createElement(O,{companion:a,lastReaction:n,onDone:e})}let o=C(),s=v(o),c=K[s.bones.species]??`Buddy`,l=q[s.bones.species]??`Mysterious and code-savvy.`,f={name:c,personality:l,seed:o,hatchedAt:Date.now()};u(e=>({...e,companion:f}));let p=b[s.bones.rarity],m=T(s.bones,0),h=s.bones.shiny?` ✨ Shiny!`:``;return e([`A wild companion appeared!`,``,...m,``,`${c} the ${U(s.bones.species)}${h}`,`Rarity: ${p} (${s.bones.rarity})`,`"${l}"`,``,`Your companion will now appear beside your input box!`,`Say its name to get its take · /buddy pet · /buddy off`].join(`
|
|
3
3
|
`),{display:`system`}),null}var G,K,q;e((()=>{G=t(n(),1),x(),w(),E(),M(),c(),H(),K={duck:`Waddles`,goose:`Goosberry`,blob:`Gooey`,cat:`Whiskers`,dragon:`Ember`,octopus:`Inky`,owl:`Hoots`,penguin:`Waddleford`,turtle:`Shelly`,snail:`Trailblazer`,ghost:`Casper`,axolotl:`Axie`,capybara:`Chill`,cactus:`Spike`,robot:`Byte`,rabbit:`Flops`,mushroom:`Spore`,chonk:`Chonk`},q={duck:`Quirky and easily amused. Leaves rubber duck debugging tips everywhere.`,goose:`Assertive and honks at bad code. Takes no prisoners in code reviews.`,blob:`Adaptable and goes with the flow. Sometimes splits into two when confused.`,cat:`Independent and judgmental. Watches you type with mild disdain.`,dragon:`Fiery and passionate about architecture. Hoards good variable names.`,octopus:`Multitasker extraordinaire. Wraps tentacles around every problem at once.`,owl:`Wise but verbose. Always says "let me think about that" for exactly 3 seconds.`,penguin:`Cool under pressure. Slides gracefully through merge conflicts.`,turtle:`Patient and thorough. Believes slow and steady wins the deploy.`,snail:`Methodical and leaves a trail of useful comments. Never rushes.`,ghost:`Ethereal and appears at the worst possible moments with spooky insights.`,axolotl:`Regenerative and cheerful. Recovers from any bug with a smile.`,capybara:`Zen master. Remains calm while everything around is on fire.`,cactus:`Prickly on the outside but full of good intentions. Thrives on neglect.`,robot:`Efficient and literal. Processes feedback in binary.`,rabbit:`Energetic and hops between tasks. Finishes before you start.`,mushroom:`Quietly insightful. Grows on you over time.`,chonk:`Big, warm, and takes up the whole couch. Prioritizes comfort over elegance.`}}))();export{W as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{K as a,V as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{BS as l,L as u,LS as d,RS as f,w as p,zS as m}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{K as a,V as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{BS as l,L as u,LS as d,RS as f,w as p,zS as m}from"./loadAgentsDir-Cl2w3uvH.js";async function h(e,t,n){{if(y)return;y=!0;let{updateContext:r,notification:i}=await u(e,n);t(e=>{let t=r(e.toolPermissionContext),n=t===e.toolPermissionContext?e:{...e,toolPermissionContext:t};return i?{...n,notifications:{...n.notifications,queue:[...n.notifications.queue,{key:`auto-mode-gate-notification`,text:i,color:`warning`,priority:`high`}]}}:n})}}function g(){y=!1}function _(){let e=f(e=>e.mainLoopModel),t=f(e=>e.mainLoopModelForSession),n=f(e=>e.fastMode),i=l(),o=m(),s=(0,v.useRef)(!0);(0,v.useEffect)(()=>{r()||(s.current?s.current=!1:g(),h(o.getState().toolPermissionContext,i,n).catch(e=>{c(Error(`Auto mode gate check failed`,{cause:a(e)}))}))},[e,t,n])}var v,y,b=e((()=>{v=t(n(),1),o(),s(),i(),d(),p(),y=!1}));export{_ as i,b as n,g as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./caches-wtRUk5y5.js";e();export{t as clearSessionCaches};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-80gRi2ZW.js";import{p as i}from"./zod-DT6hytkp.js";import{Fr as a,Pr as o,Zn as s,cn as c,u as l}from"./state-sIHsFpDu.js";import{Ac as u,Ka as d,Sc as f,oo as p}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-80gRi2ZW.js";import{p as i}from"./zod-DT6hytkp.js";import{Fr as a,Pr as o,Zn as s,cn as c,u as l}from"./state-sIHsFpDu.js";import{Ac as u,Ka as d,Sc as f,oo as p}from"./paths-q1-Ni8Oh.js";import{L as m,V as h,d as g,h as _,p as v,s as ee}from"./debug-UI3T040K.js";import{n as y,r as b}from"./analytics-DqMQntaB.js";import{n as x,t as S}from"./cwd--iizewsn.js";import{E as te,S as ne,_ as re,r as ie,v as ae}from"./git-CN3qtTb_.js";import{o as oe,s as C}from"./log-CzsijfHZ.js";import{i as se,n as ce}from"./path-B3lx7yHn.js";import{n as w,r as le}from"./execFileNoThrow-CuQN1sz8.js";import{AD as ue,Ac as de,Bk as fe,Cm as pe,Dk as me,Hd as he,Hk as ge,MD as _e,Nt as ve,Ok as ye,Q as be,Um as xe,Wm as Se,X as Ce,Xi as we,_ as Te,_k as Ee,_l as De,aC as Oe,bh as ke,bk as Ae,cy as je,gA as Me,gk as Ne,hA as Pe,hl as Fe,iC as Ie,kc as Le,ly as Re,m as ze,v as Be,vk as Ve,xh as He,yk as Ue,ym as We,yn as Ge,zd as Ke,zi as qe,zt as Je}from"./loadAgentsDir-Cl2w3uvH.js";import{Gt as Ye,Wt as Xe}from"./prompt-BmOnuQfF.js";import{a as Ze,t as Qe}from"./detectRepository-CBk3S2zv.js";import{r as $e,t as et}from"./magicDocs-_yNWB88A.js";import*as T from"path";import{statSync as tt}from"fs";function E(e,t,n){if(t===0)return n?j:0;let r=e.charCodeAt(t-1);return nt(r)?k:rt(r)&&it(e.charCodeAt(t))?A:0}function nt(e){return e===47||e===92||e===45||e===95||e===46||e===32}function rt(e){return e>=97&&e<=122}function it(e){return e>=65&&e<=90}function D(){return new Promise(e=>setImmediate(e))}function at(e,t){let n=new Set;for(let r of e){let e=r.length;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if(n===47||n===92){e=t;break}}let i=r.slice(0,e);if(i.length>0&&(n.add(i),n.size>=t))break}let r=Array.from(n);return r.sort((e,t)=>{let n=e.length-t.length;return n===0?e<t?-1:+(e>t):n}),r.slice(0,t).map(e=>({path:e,score:0}))}var O,k,A,ot,j,M,st,ct,N,P,lt,ut=e((()=>{n(),O=16,k=8,A=6,ot=4,j=8,M=3,st=1,ct=100,N=64,P=new Int32Array(N),lt=class{constructor(){r(this,`paths`,[]),r(this,`lowerPaths`,[]),r(this,`charBits`,new Int32Array),r(this,`pathLens`,new Uint16Array),r(this,`topLevelCache`,null),r(this,`readyCount`,0)}loadFromFileList(e){let t=new Set,n=[];for(let r of e)r.length>0&&!t.has(r)&&(t.add(r),n.push(r));this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{};return{queryable:new Promise(e=>{t=e}),done:this.buildAsync(e,t)}}async buildAsync(e,t){let n=new Set,r=[],i=performance.now();for(let t=0;t<e.length;t++){let a=e[t];a.length>0&&!n.has(a)&&(n.add(a),r.push(a)),(t&255)==255&&performance.now()-i>4&&(await D(),i=performance.now())}this.resetArrays(r),i=performance.now();let a=!0;for(let e=0;e<r.length;e++)this.indexPath(e),(e&255)==255&&performance.now()-i>4&&(this.readyCount=e+1,a&&(t(),a=!1),await D(),i=performance.now());this.readyCount=r.length,t()}buildIndex(e){this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=at(e,ct)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n>=97&&n<=122&&(r|=1<<n-97)}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0)return this.topLevelCache?this.topLevelCache.slice(0,t):[];let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),i=Math.min(r.length,N),a=Array(i),o=0;for(let e=0;e<i;e++){let t=r.charAt(e);a[e]=t;let n=t.charCodeAt(0);n>=97&&n<=122&&(o|=1<<n-97)}let s=i*(O+k)+j+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:p,readyCount:m}=this;for(let e=0;e<m;e++){if((f[e]&o)!==o)continue;let r=n?u[e]:d[e],m=a[0],h=0,g=[],_=r.indexOf(m);if(_===-1)continue;g[h++]=_;for(let e=_+1;e<r.length;e++){if(r.charCodeAt(e)!==m.charCodeAt(0))continue;let t=r.charCodeAt(e-1);(t===47||t===92||t===45||t===95||t===46||t===32)&&(g[h++]=e)}let v=u[e],ee=p[e],y=Math.max(0,32-(ee>>2)),b=-1/0;for(let e=0;e<h;e++){P[0]=g[e];let n=0,o=0,u=P[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}P[e]=t;let i=t-u-1;i===0?o+=ot:n+=M+i*st,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*O+o-n;f+=E(v,P[0],!0);for(let e=1;e<i;e++)f+=E(v,P[e],!1);f+=y,f>b&&(b=f)}if(b===-1/0)continue;let x=b;if(c.length<t)c.push({path:v,fuzzScore:x}),c.length===t&&(c.sort((e,t)=>e.fuzzScore-t.fuzzScore),l=c[0].fuzzScore);else if(x>l){let e=0,t=c.length;for(;e<t;){let n=e+t>>1;c[n].fuzzScore<x?e=n+1:t=n}c.splice(e,0,{path:v,fuzzScore:x}),c.shift(),l=c[0].fuzzScore}}c.sort((e,t)=>t.fuzzScore-e.fuzzScore);let h=c.length,g=Math.max(h,1),_=Array(h);for(let e=0;e<h;e++){let t=c[e].path,n=e/g;_[e]={path:t,score:t.includes(`test`)?Math.min(n*1.05,1):n}}return _}}}));function F(){return R||(R=new lt),R}function dt(){R=null,z=null,V++,H=null,U=[],W=[],G=[],B.clear(),K=null,q=null,J=0,Y=null,X=null,Z=null}function ft(e){let t=e.length,n=Math.max(1,Math.floor(t/500)),r=-2128831035;for(let i=0;i<t;i+=n){let t=e[i];for(let e=0;e<t.length;e++)r=(r^t.charCodeAt(e))*16777619|0;r=r*16777619|0}if(t>0){let n=e[t-1];for(let e=0;e<n.length;e++)r=(r^n.charCodeAt(e))*16777619|0}return`${t}:${(r>>>0).toString(16)}`}function pt(){let e=ie(S());if(!e)return null;try{return tt(T.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function mt(e,t,n){return n===t?e:e.map(e=>{let r=T.join(t,e);return T.relative(n,r)})}async function ht(e){if(e.length===0||!R||U.length===0)return;let t=await vt(e),n=[...U,...W,...G,...e,...t],r=ft(n);if(r===Z){g(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await R.loadFromFileListAsync(n).done,Z=r,g(`[FileIndex] rebuilt index with ${U.length} tracked + ${e.length} untracked files`)}async function gt(e,t){let n=`${e}:${t}`;if(q===n)return K;let r=v(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,kt.default)(),s=!1,c=a.flatMap(e=>i.map(t=>T.join(e,t))),l=await Promise.all(c.map(e=>r.readFile(e,{encoding:`utf8`}).catch(()=>null)));for(let[e,t]of l.entries())t!==null&&(o.add(t),s=!0,g(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return K=u,q=n,u}async function _t(e,t){let n=Date.now();g(`[FileIndex] getFilesUsingGit called`);let r=S(),i=ie(r);if(!i)return g(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await w(re(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(g(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return g(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=mt(o.stdout.trim().split(`
|
|
2
2
|
`).filter(Boolean),i,r),c=await gt(i,r);if(c){let e=s.length;s=c.filter(s),g(`[FileIndex] applied ignore patterns: ${e} -> ${s.length} files`)}U=s;let l=Date.now()-n;if(g(`[FileIndex] git ls-files: ${s.length} tracked files in ${l}ms`),b(`tengu_file_suggestions_git_ls_files`,{file_count:s.length,tracked_count:s.length,untracked_count:0,duration_ms:l}),!H){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=V;H=w(re(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===V&&e.code===0){let t=mt(e.stdout.trim().split(`
|
|
3
|
-
`).filter(Boolean),i,r),n=await gt(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),g(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}g(`[FileIndex] background untracked fetch: ${t.length} files`),ht(t)}}).catch(e=>{g(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{H=null})}return s}catch(e){return g(`[FileIndex] git ls-files error: ${m(e)}`),null}}async function vt(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)yt(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await D(),n=performance.now());return[...t].map(e=>e+T.sep)}function yt(e,t,n,r){for(let i=t;i<n;i++){let t=T.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=T.dirname(t);if(e===t)break;r.add(t),t=e}}}async function bt(e){return(await Promise.all(ze.map(t=>Be(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function xt(e,t){g(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await _t(e,t);if(n!==null)return g(`[FileIndex] using git ls-files result (${n.length} files)`),n;g(`[FileIndex] git ls-files returned null, falling back to ripgrep`);let r=Date.now(),i=[`--files`,`--follow`,`--hidden`,`--glob`,`!.git/`,`--glob`,`!.svn/`,`--glob`,`!.hg/`,`--glob`,`!.bzr/`,`--glob`,`!.jj/`,`--glob`,`!.sl/`];t||i.push(`--no-ignore-vcs`);let a=(await Me(i,`.`,e)).map(e=>T.relative(S(),e)),o=Date.now()-r;return g(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),b(`tengu_file_suggestions_ripgrep`,{file_count:a.length,duration_ms:o}),a}async function St(){let e=AbortSignal.timeout(1e4),t=F();try{let n=d(),r=f(),i=n.respectGitignore??r.respectGitignore??!0,a=S(),[o,s]=await Promise.all([xt(e,i),bt(a)]);W=s;let c=[...o,...s],l=await vt(c);G=l;let u=[...l,...c],p=ft(u);p===X?g(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,X=p,Z=null)}catch(e){C(e)}return t}function Ct(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return e.substring(0,r)}function wt(e){if(e.length===0)return``;let t=e.map(e=>e.displayText),n=t[0];for(let e=1;e<t.length;e++){let r=t[e];if(n=Ct(n,r),n===``)return``}return n}function I(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Tt(e,t){return e.search(t,Q).map(e=>I(e.path,e.score))}function L(){if(z)return;let e=pt();if(R&&!(e!==null&&e!==Y)&&Date.now()-J<jt)return;let t=V,n=Date.now();F(),z=St().then(r=>t===V?(z=null,B.emit(),Y=e,J=Date.now(),g(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(g(`[FileIndex] Cache refresh failed: ${m(e)}`),C(e),t===V&&(z=null),F()))}async function Et(){let e=v(),t=S();try{return(await e.readdir(t)).map(e=>{let n=T.join(t,e.name),r=T.relative(t,n);return e.isDirectory()?r+T.sep:r})}catch(e){return C(e),[]}}async function Dt(e,t=!1){if(!e&&!t)return[];if(d().fileSuggestion?.type===`command`)return(await Je({...ve(),query:e})).slice(0,Q).map(I);if(e===``||e===`.`||e===`./`){let e=await Et();return L(),e.slice(0,Q).map(I)}let n=Date.now();try{let t=z!==null;L();let r=e,i=`.`+T.sep;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=ce(r));let a=R?Tt(R,r):[],o=Date.now()-n;return g(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),b(`tengu_file_suggestions_query`,{duration_ms:o,cache_hit:!t,result_count:a.length,query_length:e.length}),a}catch(e){return C(e),[]}}function Ot(e,t,n,r,i,a){let o=typeof e==`string`?e:e.displayText;i(t.substring(0,r)+o+t.substring(r+n.length)),a(r+o.length)}var kt,R,z,B,At,V,H,U,W,G,K,q,J,Y,X,Z,Q,jt,$=e((()=>{kt=t(i(),1),Te(),ut(),y(),u(),x(),ee(),h(),le(),_(),ae(),Ge(),oe(),se(),Pe(),p(),a(),R=null,z=null,B=o(),At=B.subscribe,V=0,H=null,U=[],W=[],G=[],K=null,q=null,J=0,Y=null,X=null,Z=null,Q=15,jt=5e3}));function Mt(e=new Set){let t=e.size>0;Ve.cache.clear?.(),Ee.cache.clear?.(),Ne.cache.clear?.(),Xe.cache.clear?.(),dt(),qe(),t||ge(),Ae(null),s(null),De(),de(),ye(`session_start`),Ie(),je(),t||Ke(),process.env.USER_TYPE===`ant`&&import(`./TungstenTool-C5IqKVr0.js`).then(({clearSessionsWithTungstenUsage:e,resetInitializationState:t})=>{e(),t()}),import(`./attributionHooks-PygdohOh.js`).then(({clearAttributionCaches:e})=>e()),Qe(),Ce(),t||ue(),l(e),ne(),We(),He(),et(),xe(),import(`./utils-
|
|
3
|
+
`).filter(Boolean),i,r),n=await gt(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),g(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}g(`[FileIndex] background untracked fetch: ${t.length} files`),ht(t)}}).catch(e=>{g(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{H=null})}return s}catch(e){return g(`[FileIndex] git ls-files error: ${m(e)}`),null}}async function vt(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)yt(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await D(),n=performance.now());return[...t].map(e=>e+T.sep)}function yt(e,t,n,r){for(let i=t;i<n;i++){let t=T.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=T.dirname(t);if(e===t)break;r.add(t),t=e}}}async function bt(e){return(await Promise.all(ze.map(t=>Be(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function xt(e,t){g(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await _t(e,t);if(n!==null)return g(`[FileIndex] using git ls-files result (${n.length} files)`),n;g(`[FileIndex] git ls-files returned null, falling back to ripgrep`);let r=Date.now(),i=[`--files`,`--follow`,`--hidden`,`--glob`,`!.git/`,`--glob`,`!.svn/`,`--glob`,`!.hg/`,`--glob`,`!.bzr/`,`--glob`,`!.jj/`,`--glob`,`!.sl/`];t||i.push(`--no-ignore-vcs`);let a=(await Me(i,`.`,e)).map(e=>T.relative(S(),e)),o=Date.now()-r;return g(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),b(`tengu_file_suggestions_ripgrep`,{file_count:a.length,duration_ms:o}),a}async function St(){let e=AbortSignal.timeout(1e4),t=F();try{let n=d(),r=f(),i=n.respectGitignore??r.respectGitignore??!0,a=S(),[o,s]=await Promise.all([xt(e,i),bt(a)]);W=s;let c=[...o,...s],l=await vt(c);G=l;let u=[...l,...c],p=ft(u);p===X?g(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,X=p,Z=null)}catch(e){C(e)}return t}function Ct(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return e.substring(0,r)}function wt(e){if(e.length===0)return``;let t=e.map(e=>e.displayText),n=t[0];for(let e=1;e<t.length;e++){let r=t[e];if(n=Ct(n,r),n===``)return``}return n}function I(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Tt(e,t){return e.search(t,Q).map(e=>I(e.path,e.score))}function L(){if(z)return;let e=pt();if(R&&!(e!==null&&e!==Y)&&Date.now()-J<jt)return;let t=V,n=Date.now();F(),z=St().then(r=>t===V?(z=null,B.emit(),Y=e,J=Date.now(),g(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(g(`[FileIndex] Cache refresh failed: ${m(e)}`),C(e),t===V&&(z=null),F()))}async function Et(){let e=v(),t=S();try{return(await e.readdir(t)).map(e=>{let n=T.join(t,e.name),r=T.relative(t,n);return e.isDirectory()?r+T.sep:r})}catch(e){return C(e),[]}}async function Dt(e,t=!1){if(!e&&!t)return[];if(d().fileSuggestion?.type===`command`)return(await Je({...ve(),query:e})).slice(0,Q).map(I);if(e===``||e===`.`||e===`./`){let e=await Et();return L(),e.slice(0,Q).map(I)}let n=Date.now();try{let t=z!==null;L();let r=e,i=`.`+T.sep;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=ce(r));let a=R?Tt(R,r):[],o=Date.now()-n;return g(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),b(`tengu_file_suggestions_query`,{duration_ms:o,cache_hit:!t,result_count:a.length,query_length:e.length}),a}catch(e){return C(e),[]}}function Ot(e,t,n,r,i,a){let o=typeof e==`string`?e:e.displayText;i(t.substring(0,r)+o+t.substring(r+n.length)),a(r+o.length)}var kt,R,z,B,At,V,H,U,W,G,K,q,J,Y,X,Z,Q,jt,$=e((()=>{kt=t(i(),1),Te(),ut(),y(),u(),x(),ee(),h(),le(),_(),ae(),Ge(),oe(),se(),Pe(),p(),a(),R=null,z=null,B=o(),At=B.subscribe,V=0,H=null,U=[],W=[],G=[],K=null,q=null,J=0,Y=null,X=null,Z=null,Q=15,jt=5e3}));function Mt(e=new Set){let t=e.size>0;Ve.cache.clear?.(),Ee.cache.clear?.(),Ne.cache.clear?.(),Xe.cache.clear?.(),dt(),qe(),t||ge(),Ae(null),s(null),De(),de(),ye(`session_start`),Ie(),je(),t||Ke(),process.env.USER_TYPE===`ant`&&import(`./TungstenTool-C5IqKVr0.js`).then(({clearSessionsWithTungstenUsage:e,resetInitializationState:t})=>{e(),t()}),import(`./attributionHooks-PygdohOh.js`).then(({clearAttributionCaches:e})=>e()),Qe(),Ce(),t||ue(),l(e),ne(),We(),He(),et(),xe(),import(`./utils-hhztcb0b.js`).then(({clearWebFetchCache:e})=>e()),import(`./SearchExtraToolsTool-C998WSxs.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-6_9ZFegv.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-Da3gIGA8.js`).then(({clearPromptCache:e})=>e())}var Nt=e((()=>{c(),we(),Ye(),Ue(),$(),he(),_e(),fe(),Re(),Fe(),ke(),$e(),pe(),Le(),be(),me(),Ze(),te(),Oe(),Se()}));export{Dt as a,L as c,wt as i,Nt as n,$ as o,Ot as r,At as s,Mt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{At as n,jt as r}from"./paths-o5iA-EnQ.js";import{E as i,L as a,R as o,V as s,d as c,s as l,w as u}from"./debug-UI3T040K.js";import{F as d,P as f}from"./git-CN3qtTb_.js";import{r as p,u as m}from"./proxy-CfZp-wce.js";import{n as h,t as g}from"./sleep-8Eb9j_Ly.js";import{D as _,E as v,O as y,a as b,l as x,r as S}from"./rcDebugLog-BNojB_eB.js";import{n as C}from"./jwtUtils-CpXwh_du.js";import{randomUUID as w}from"crypto";s(),l(),f(),m(),g(),r(),y(),S(),u(),e();var T=class extends Error{constructor(e,t){super(e),this.retryAfterMs=t}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let n=0,r=0;for(;r<this.pending.length&&r<e;){let e;try{e=Buffer.byteLength(i(this.pending[r]))}catch{this.pending.splice(r,1);continue}if(r>0&&n+e>t)break;n+=e,r++}return this.pending.splice(0,r)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await h(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}g(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,p({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??v,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),b(()=>{this.writeEvent({type:`keep_alive`})}),c(`CCRClient: initialized, epoch=${this.workerEpoch}`),d(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||d(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,r,i,{timeout:s=1e4}={}){let l=this.getAuthHeaders();if(Object.keys(l).length===0)return{ok:!1};try{let a=await this.http[e](`${this.sessionBaseUrl}${t}`,r,{headers:{...l,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":n()},validateStatus:j,timeout:s});if(a.status>=200&&a.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(a.status===409&&this.handleEpochMismatch(),a.status===401||a.status===403){let e=_(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(c(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),d(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(c(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),d(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(c(`CCRClient: ${i} returned ${a.status}`,{level:`warn`}),d(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:a.status}),a.status===429){let e=a.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(n){return c(`CCRClient: ${i} failed: ${a(n)}`,{level:`warn`}),d(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:o(n)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){c(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),d(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&c(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return c(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,r){for(let r=1;r<=10;r++){let i;try{i=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":n()},validateStatus:j,timeout:3e4})}catch(t){c(`CCRClient: GET ${e} failed (attempt ${r}/10): ${a(t)}`,{level:`warn`}),r<10&&await h(Math.min(500*2**(r-1),3e4)+Math.random()*500);continue}if(i.status>=200&&i.status<300)return i.data;i.status===409&&this.handleEpochMismatch(),c(`CCRClient: GET ${e} returned ${i.status} (attempt ${r}/10)`,{level:`warn`}),r<10&&await h(Math.min(500*2**(r-1),3e4)+Math.random()*500)}return c(`CCRClient: GET retries exhausted`,{level:`error`}),d(`error`,`cli_worker_get_retries_exhausted`,{context:r}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),x(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
|
|
1
|
+
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{At as n,jt as r}from"./paths-q1-Ni8Oh.js";import{E as i,L as a,R as o,V as s,d as c,s as l,w as u}from"./debug-UI3T040K.js";import{F as d,P as f}from"./git-CN3qtTb_.js";import{r as p,u as m}from"./proxy-CfZp-wce.js";import{n as h,t as g}from"./sleep-8Eb9j_Ly.js";import{D as _,E as v,O as y,a as b,l as x,r as S}from"./rcDebugLog-fhwD4wm-.js";import{n as C}from"./jwtUtils-CpXwh_du.js";import{randomUUID as w}from"crypto";s(),l(),f(),m(),g(),r(),y(),S(),u(),e();var T=class extends Error{constructor(e,t){super(e),this.retryAfterMs=t}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let n=0,r=0;for(;r<this.pending.length&&r<e;){let e;try{e=Buffer.byteLength(i(this.pending[r]))}catch{this.pending.splice(r,1);continue}if(r>0&&n+e>t)break;n+=e,r++}return this.pending.splice(0,r)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await h(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}g(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,p({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??v,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),b(()=>{this.writeEvent({type:`keep_alive`})}),c(`CCRClient: initialized, epoch=${this.workerEpoch}`),d(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||d(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,r,i,{timeout:s=1e4}={}){let l=this.getAuthHeaders();if(Object.keys(l).length===0)return{ok:!1};try{let a=await this.http[e](`${this.sessionBaseUrl}${t}`,r,{headers:{...l,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":n()},validateStatus:j,timeout:s});if(a.status>=200&&a.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(a.status===409&&this.handleEpochMismatch(),a.status===401||a.status===403){let e=_(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(c(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),d(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(c(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),d(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(c(`CCRClient: ${i} returned ${a.status}`,{level:`warn`}),d(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:a.status}),a.status===429){let e=a.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(n){return c(`CCRClient: ${i} failed: ${a(n)}`,{level:`warn`}),d(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:o(n)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){c(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),d(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&c(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return c(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,r){for(let r=1;r<=10;r++){let i;try{i=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":n()},validateStatus:j,timeout:3e4})}catch(t){c(`CCRClient: GET ${e} failed (attempt ${r}/10): ${a(t)}`,{level:`warn`}),r<10&&await h(Math.min(500*2**(r-1),3e4)+Math.random()*500);continue}if(i.status>=200&&i.status<300)return i.data;i.status===409&&this.handleEpochMismatch(),c(`CCRClient: GET ${e} returned ${i.status} (attempt ${r}/10)`,{level:`warn`}),r<10&&await h(Math.min(500*2**(r-1),3e4)+Math.random()*500)}return c(`CCRClient: GET retries exhausted`,{level:`error`}),d(`error`,`cli_worker_get_retries_exhausted`,{context:r}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),x(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SA as e,vA as t}from"./loadAgentsDir-Cl2w3uvH.js";t();export{e as settingsChangeDetector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t}from"./channelNotification-D8do6HUN.js";t();export{e as ChannelPermissionRequestNotificationSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ln as t,Mn as n,Tt as r,un as i,vt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{cn as c,y as l}from"./state-sIHsFpDu.js";import{S as u,_ as d}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ln as t,Mn as n,Tt as r,un as i,vt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{cn as c,y as l}from"./state-sIHsFpDu.js";import{S as u,_ as d}from"./paths-q1-Ni8Oh.js";import{E as f,et as p}from"./log-CzsijfHZ.js";import{n as m,t as h}from"./lazySchema-2sOku3cX.js";import{i as g,n as _,o as v,p as y,r as b}from"./xml-CMdTGiv6.js";function x(){let e=d(`tengu_harbor_ledger`,[]),t=w().safeParse(e);return t.success?t.data:[]}function S(){return!0}function C(e){if(!e)return!1;let{name:t,marketplace:n}=v(e);return n?n===`builtin`&&t===`weixin`?!0:x().some(e=>e.plugin===t&&e.marketplace===n):!1}var w,T=e((()=>{s(),y(),h(),g(),u(),w=m(()=>r(o({marketplace:t(),plugin:t()})))}));function E(e,t,n){let r=Object.entries(n??{}).filter(([e])=>P.test(e)).map(([e,t])=>` ${e}="${_(t)}"`).join(``);return`<${f} source="${_(e)}"${r}>\n${t}\n</${f}>`}function D(e,t){let n=e.split(`:`);return t.find(t=>t.kind===`server`?e===t.name:n[0]===`plugin`&&n[1]===t.name)}function O(e,t,n){if(!t?.experimental?.[`claude/channel`])return{action:`skip`,kind:`capability`,reason:`server did not declare claude/channel capability`};let r=D(e,l());if(!r)return{action:`skip`,kind:`session`,reason:`server ${e} not in --channels list for this session`};if(r.kind===`plugin`){let e=n?v(n).marketplace:void 0;if(e!==r.marketplace)return{action:`skip`,kind:`marketplace`,reason:`you asked for plugin:${r.name}@${r.marketplace} but the installed ${r.name} plugin is from ${e??`an unknown source`}`}}return{action:`register`}}var k,A,j,M,N,P,F=e((()=>{s(),c(),p(),h(),g(),b(),T(),k=m(()=>o({method:i(`notifications/claude/channel`),params:o({content:t(),meta:n(t(),t()).optional()})})),A=`notifications/claude/channel/permission`,j=m(()=>o({method:i(A),params:o({request_id:t(),behavior:a([`allow`,`deny`])})})),M=`notifications/claude/channel/permission_request`,N=m(()=>o({method:i(M),params:o({request_id:t(),tool_name:t(),description:t(),input_preview:t(),channel_context:o({source_server:t().optional(),chat_id:t().optional()}).optional()})})),P=/^[a-zA-Z_][a-zA-Z0-9_]*$/}));export{N as a,F as c,C as d,S as f,j as i,E as l,M as n,D as o,k as r,O as s,A as t,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{f as n,s as r}from"./envUtils-BWeoiL4Y.js";import{Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Ac as u,Pc as d,Sc as f,dn as p,on as m}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{f as n,s as r}from"./envUtils-BWeoiL4Y.js";import{Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Ac as u,Pc as d,Sc as f,dn as p,on as m}from"./paths-q1-Ni8Oh.js";import{a as h,n as g}from"./env-chR0gV31.js";import{LS as _,Nx as v,Px as y,RS as b}from"./loadAgentsDir-Cl2w3uvH.js";import{n as x,t as S}from"./browser-fLRXxIsQ.js";import{c as C,d as w,t as T}from"./common-CMCv4N_v.js";import{n as E,t as D}from"./setup-GxlEx1KG.js";function O({onDone:e,isExtensionInstalled:t,configEnabled:r,isClaudeAISubscriber:i,isWSL:s}){let l=b(e=>e.mcp.clients),[u,f]=(0,k.useState)(0),[p,m]=(0,k.useState)(r??!1),[h,g]=(0,k.useState)(!1),[_,y]=(0,k.useState)(t),S=process.env.USER_TYPE===`ant`&&n(),C=l.find(e=>e.name===T)?.type===`connected`;function D(e){S?x(e):w(e)}function O(e){switch(e){case`install-extension`:f(e=>e+1),g(!0),D(j);break;case`reconnect`:f(e=>e+1),E().then(e=>{y(e),e&&g(!1)}),D(N);break;case`manage-permissions`:f(e=>e+1),D(M);break;case`toggle-default`:{let e=!p;d(t=>({...t,claudeInChromeDefaultEnabled:e})),m(e);break}}}let P=[],F=_?``:` (requires extension)`;!_&&!S&&P.push({label:`Install Chrome extension`,value:`install-extension`}),P.push({label:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{children:`Manage permissions`}),(0,A.jsx)(a,{dimColor:!0,children:F})]}),value:`manage-permissions`},{label:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{children:`Reconnect extension`}),(0,A.jsx)(a,{dimColor:!0,children:F})]}),value:`reconnect`},{label:`Enabled by default: ${p?`Yes`:`No`}`,value:`toggle-default`});let I=s||process.env.USER_TYPE!==`ant`&&!i;return(0,A.jsx)(o,{title:`Claude in Chrome (Beta)`,onCancel:()=>e(),color:`chromeYellow`,children:(0,A.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,A.jsx)(a,{children:`Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. Navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests.`}),s&&(0,A.jsx)(a,{color:`error`,children:`Claude in Chrome is not supported in WSL at this time.`}),process.env.USER_TYPE!==`ant`&&!i&&(0,A.jsx)(a,{color:`error`,children:`Claude in Chrome requires a claude.ai subscription.`}),!I&&(0,A.jsxs)(A.Fragment,{children:[!S&&(0,A.jsxs)(c,{flexDirection:`column`,children:[(0,A.jsxs)(a,{children:[`Status: `,C?(0,A.jsx)(a,{color:`success`,children:`Enabled`}):(0,A.jsx)(a,{color:`inactive`,children:`Disabled`})]}),(0,A.jsxs)(a,{children:[`Extension:`,` `,_?(0,A.jsx)(a,{color:`success`,children:`Installed`}):(0,A.jsx)(a,{color:`warning`,children:`Not detected`})]})]}),(0,A.jsx)(v,{options:P,onChange:O,hideIndexes:!0},u),h&&(0,A.jsxs)(a,{color:`warning`,children:[`Once installed, select `,`"Reconnect extension"`,` to connect.`]}),(0,A.jsxs)(a,{children:[(0,A.jsx)(a,{dimColor:!0,children:`Usage: `}),(0,A.jsx)(a,{children:`claude --chrome`}),(0,A.jsx)(a,{dimColor:!0,children:` or `}),(0,A.jsx)(a,{children:`claude --no-chrome`})]}),(0,A.jsx)(a,{dimColor:!0,children:`Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on.`})]}),(0,A.jsx)(a,{dimColor:!0,children:`Learn more: https://code.claude.com/docs/en/chrome`})]})})}var k,A,j,M,N,P;e((()=>{k=t(i(),1),y(),s(),_(),m(),S(),C(),D(),u(),h(),r(),A=l(),j=`https://claude.ai/chrome`,M=`https://clau.de/chrome/permissions`,N=`https://clau.de/chrome/reconnect`,P=async function(e){let t=await E(),n=f(),r=p(),i=g.isWslEnvironment();return(0,A.jsx)(O,{onDone:e,isExtensionInstalled:t,configEnabled:n.claudeInChromeDefaultEnabled,isClaudeAISubscriber:r,isWSL:i})}}))();export{P as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./conversation-DizpkPtq.js";var r;e((()=>{t(),r=async(e,t)=>(await n(t),{type:`text`,value:``})}))();export{r as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{la as e,ua as t}from"./paths-q1-Ni8Oh.js";t();export{e as getOrganizationUUID};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-DMYOtLTK.js";import{$y as a,Ar as o,Tr as s,nb as c,pi as l}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-DMYOtLTK.js";import{$y as a,Ar as o,Tr as s,nb as c,pi as l}from"./loadAgentsDir-Cl2w3uvH.js";async function u(e,n,i){if(r())return e(`Cannot set color: This session is a swarm teammate. Teammate colors are assigned by the team leader.`,{display:`system`}),null;if(!i||i.trim()===``)return e(`Please provide a color. Available colors: ${a.join(`, `)}, default`,{display:`system`}),null;let o=i.trim().toLowerCase();return d.includes(o)?(await l(t(),`default`,s()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:void 0}})),e(`Session color reset to default`,{display:`system`}),null):a.includes(o)?(await l(t(),o,s()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:o}})),e(`Session color set to: ${o}`,{display:`system`}),null):(e(`Invalid color "${o}". Available colors: ${a.join(`, `)}, default`,{display:`system`}),null)}var d;e((()=>{n(),c(),o(),i(),d=[`default`,`reset`,`none`,`gray`,`grey`]}))();export{u as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gi as e,Xi as t,zi as n}from"./loadAgentsDir-Cl2w3uvH.js";t();export{n as clearCommandsCache,e as getCommands};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,l as t}from"./commitAttribution-CUdm_sRl.js";t();export{e as isInternalModelRepo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n,ot as r}from"./state-sIHsFpDu.js";import{Pr as i,mc as a,pc as o}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n,ot as r}from"./state-sIHsFpDu.js";import{Pr as i,mc as a,pc as o}from"./paths-q1-Ni8Oh.js";import{h as s,s as c}from"./debug-UI3T040K.js";import{n as l,t as u}from"./cwd--iizewsn.js";import{E as d,T as f,_ as p,r as m,v as h}from"./git-CN3qtTb_.js";import{o as g}from"./log-CzsijfHZ.js";import{n as _,r as v}from"./execFileNoThrow-CuQN1sz8.js";import{basename as y,extname as b,join as x,posix as S,sep as C}from"path";import{randomUUID as w}from"crypto";import{stat as T}from"fs/promises";function E(e){let t=S.sep+e.split(C).join(S.sep).replace(/^\/+/,``),n=y(e).toLowerCase(),r=b(e).toLowerCase();if(D.has(n)||O.has(r))return!0;let i=n.split(`.`);if(i.length>2){let e=`.`+i.slice(-2).join(`.`);if(O.has(e))return!0}for(let e of k)if(t.includes(e))return!0;for(let e of A)if(e.test(n))return!0;return!1}var D,O,k,A,j=e((()=>{D=new Set([`package-lock.json`,`yarn.lock`,`pnpm-lock.yaml`,`bun.lockb`,`bun.lock`,`composer.lock`,`gemfile.lock`,`cargo.lock`,`poetry.lock`,`pipfile.lock`,`shrinkwrap.json`,`npm-shrinkwrap.json`]),O=new Set([`.lock`,`.min.js`,`.min.css`,`.min.html`,`.bundle.js`,`.bundle.css`,`.generated.ts`,`.generated.js`,`.d.ts`]),k=[`/dist/`,`/build/`,`/out/`,`/output/`,`/node_modules/`,`/vendor/`,`/vendored/`,`/third_party/`,`/third-party/`,`/external/`,`/.next/`,`/.nuxt/`,`/.svelte-kit/`,`/coverage/`,`/__pycache__/`,`/.tox/`,`/venv/`,`/.venv/`,`/target/release/`,`/target/debug/`],A=[/^.*\.min\.[a-z]+$/i,/^.*-min\.[a-z]+$/i,/^.*\.bundle\.[a-z]+$/i,/^.*\.generated\.[a-z]+$/i,/^.*\.gen\.[a-z]+$/i,/^.*\.auto\.[a-z]+$/i,/^.*_generated\.[a-z]+$/i,/^.*_gen\.[a-z]+$/i,/^.*\.pb\.(go|js|ts|py|rb)$/i,/^.*_pb2?\.py$/i,/^.*\.pb\.h$/i,/^.*\.grpc\.[a-z]+$/i,/^.*\.swagger\.[a-z]+$/i,/^.*\.openapi\.[a-z]+$/i]}));function M(){return m(u())??r()}function N(){return W}function P(){return process.env.CLAUDE_CODE_ENTRYPOINT??`cli`}function F(){return{fileStates:new Map,sessionBaselines:new Map,surface:P(),startingHeadSha:null,promptCount:0,promptCountAtLastCommit:0,permissionPromptCount:0,permissionPromptCountAtLastCommit:0,escapeCount:0,escapeCountAtLastCommit:0}}async function I(e,n){let r=M(),i=t(),a={},o=[],s=new Set,c={},l=0,u=0,d=new Map,f=new Map;for(let t of e){s.add(t.surface);let e=t.sessionBaselines instanceof Map?t.sessionBaselines:new Map(Object.entries(t.sessionBaselines??{}));for(let[t,n]of e)f.has(t)||f.set(t,n);let n=t.fileStates instanceof Map?t.fileStates:new Map(Object.entries(t.fileStates??{}));for(let[e,t]of n){let n=d.get(e);n?d.set(e,{...t,claudeContribution:n.claudeContribution+t.claudeContribution}):d.set(e,t)}}let p=await Promise.all(n.map(async t=>{if(E(t))return{type:`generated`,file:t};let n=x(r,t),i=d.get(t),a=f.get(t),o=e[0].surface,s=0,c=0;if(await R(t))if(i)s=i.claudeContribution,c=0;else{let e=await L(t);c=e>0?e:100}else try{let e=await T(n);if(i)s=i.claudeContribution,c=0;else if(a){let n=await L(t);c=n>0?n:e.size}else c=e.size}catch{return null}s=Math.max(0,s),c=Math.max(0,c);let l=s+c,u=l>0?Math.round(s/l*100):0;return{type:`file`,file:t,claudeChars:s,humanChars:c,percent:u,surface:o}}));for(let e of p)if(e){if(e.type===`generated`){o.push(e.file);continue}a[e.file]={claudeChars:e.claudeChars,humanChars:e.humanChars,percent:e.percent,surface:e.surface},l+=e.claudeChars,u+=e.humanChars,c[e.surface]=(c[e.surface]??0)+e.claudeChars}let m=l+u,h=m>0?Math.round(l/m*100):0,g={};for(let[e,t]of Object.entries(c))g[e]={claudeChars:t,percent:m>0?Math.round(t/m*100):0};return{version:1,summary:{claudePercent:h,claudeChars:l,humanChars:u,surfaces:Array.from(s)},files:a,surfaceBreakdown:g,excludedGenerated:o,sessions:[i]}}async function L(e){let t=M();try{let n=await _(p(),[`diff`,`--cached`,`--stat`,`--`,e],{cwd:t,timeout:5e3});if(n.code!==0||!n.stdout)return 0;let r=n.stdout.split(`
|
|
2
2
|
`).filter(Boolean),i=0;for(let e of r)if(e.includes(`file changed`)||e.includes(`files changed`)){let t=e.match(/(\d+) insertions?/),n=e.match(/(\d+) deletions?/),r=t?parseInt(t[1],10):0,a=n?parseInt(n[1],10):0;i+=(r+a)*40}return i}catch{return 0}}async function R(e){let t=M();try{let n=await _(p(),[`diff`,`--cached`,`--name-status`,`--`,e],{cwd:t,timeout:5e3});if(n.code===0&&n.stdout)return n.stdout.trim().startsWith(`D `)}catch{}return!1}function z(e,t){let n={};for(let[t,r]of e.fileStates)n[t]=r;return{type:`attribution-snapshot`,messageId:t,surface:e.surface,fileStates:n,promptCount:e.promptCount,promptCountAtLastCommit:e.promptCountAtLastCommit,permissionPromptCount:e.permissionPromptCount,permissionPromptCountAtLastCommit:e.permissionPromptCountAtLastCommit,escapeCount:e.escapeCount,escapeCountAtLastCommit:e.escapeCountAtLastCommit}}function B(e){let t=F(),n=e[e.length-1];if(!n)return t;t.surface=n.surface;for(let[e,r]of Object.entries(n.fileStates))t.fileStates.set(e,r);return t.promptCount=n.promptCount??0,t.promptCountAtLastCommit=n.promptCountAtLastCommit??0,t.permissionPromptCount=n.permissionPromptCount??0,t.permissionPromptCountAtLastCommit=n.permissionPromptCountAtLastCommit??0,t.escapeCount=n.escapeCount??0,t.escapeCountAtLastCommit=n.escapeCountAtLastCommit??0,t}function V(e,t){t(B(e))}function H(e,t){let n={...e,promptCount:e.promptCount+1};return t(z(n,w())),n}var U,W,G,K=e((()=>{n(),l(),c(),v(),s(),j(),d(),h(),g(),i(),o(),U=`github.com:anthropics/claude-cli-internal,github.com/anthropics/claude-cli-internal,github.com:anthropics/anthropic,github.com/anthropics/anthropic,github.com:anthropics/apps,github.com/anthropics/apps,github.com:anthropics/casino,github.com/anthropics/casino,github.com:anthropics/dbt,github.com/anthropics/dbt,github.com:anthropics/dotfiles,github.com/anthropics/dotfiles,github.com:anthropics/terraform-config,github.com/anthropics/terraform-config,github.com:anthropics/hex-export,github.com/anthropics/hex-export,github.com:anthropics/feedback-v2,github.com/anthropics/feedback-v2,github.com:anthropics/labs,github.com/anthropics/labs,github.com:anthropics/argo-rollouts,github.com/anthropics/argo-rollouts,github.com:anthropics/starling-configs,github.com/anthropics/starling-configs,github.com:anthropics/ts-tools,github.com/anthropics/ts-tools,github.com:anthropics/ts-capsules,github.com/anthropics/ts-capsules,github.com:anthropics/feldspar-testing,github.com/anthropics/feldspar-testing,github.com:anthropics/trellis,github.com/anthropics/trellis,github.com:anthropics/claude-for-hiring,github.com/anthropics/claude-for-hiring,github.com:anthropics/forge-web,github.com/anthropics/forge-web,github.com:anthropics/infra-manifests,github.com/anthropics/infra-manifests,github.com:anthropics/mycro_manifests,github.com/anthropics/mycro_manifests,github.com:anthropics/mycro_configs,github.com/anthropics/mycro_configs,github.com:anthropics/mobile-apps,github.com/anthropics/mobile-apps`.split(`,`),W=null,G=a(async()=>{if(W!==null)return W===`internal`;let e=await f(M());if(!e)return W=`none`,!1;let t=U.some(t=>e.includes(t));return W=t?`internal`:`external`,t})}));export{P as a,H as c,G as d,B as f,M as i,K as l,I as n,L as o,z as p,F as r,N as s,V as t,R as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-Di342QoJ.js";import{cn as r,dn as i}from"./state-sIHsFpDu.js";import{B as a,V as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{Bk as l,Cl as u,Gg as d,Ik as f,Lk as p,Lo as m,Mk as h,Nk as g,Oo as _,Sl as v,Vk as y,Wg as b,_k as x,_l as S,aT as C,bl as w,dl as T,dt as E,ed as D,ek as O,ft as k,hl as A,ll as j,oT as M,ok as N,qt as P,td as F,vk as I,vl as L,wl as R,yk as z,yl as B,yn as V}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-Di342QoJ.js";import{cn as r,dn as i}from"./state-sIHsFpDu.js";import{B as a,V as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{Bk as l,Cl as u,Gg as d,Ik as f,Lk as p,Lo as m,Mk as h,Nk as g,Oo as _,Sl as v,Vk as y,Wg as b,_k as x,_l as S,aT as C,bl as w,dl as T,dt as E,ed as D,ek as O,ft as k,hl as A,ll as j,oT as M,ok as N,qt as P,td as F,vk as I,vl as L,wl as R,yk as z,yl as B,yn as V}from"./loadAgentsDir-Cl2w3uvH.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([P({trigger:`manual`,customInstructions:n||null},t.abortController.signal),W(t,e)]),o=R(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(B);case`aborted`:throw Error(w);case`exhausted`:case`error`:case`media_unstrippable`:throw Error(L)}N(void 0),S(),p(),I.cache.clear?.();let c=[i.userDisplayMessage,s.result.userDisplayMessage].filter(Boolean).join(`
|
|
2
2
|
`)||void 0;return{type:`compact`,compactionResult:{...s.result,userDisplayMessage:c},displayText:U(t,c)}}finally{t.setStreamMode?.(`requesting`),t.setResponseLength?.(()=>0),t.onCompactProgress?.({type:`compact_end`}),t.setSDKStatus?.(``)}}function U(e,n){let r=b(`tip`),i=C(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...n?[n]:[],...r?[r]:[]];return t.dim(`Compacted `+a.join(`
|
|
3
3
|
`))}async function W(e,t){let n=e.getAppState(),r=await E(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([I(),x()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var G,K;e((()=>{n(),r(),k(),z(),M(),l(),u(),f(),h(),A(),j(),O(),o(),V(),s(),m(),d(),F(),G=null,K=async(e,t)=>{let{abortController:n}=t,{messages:r}=t;if(r=_(r),r.length===0)throw Error(`No messages to compact`);let o=e.trim();try{if(!o){let e=await T(r,t.agentId);if(e)return I.cache.clear?.(),S(),y(t.options.querySource??`compact`,t.agentId),i(),p(),{type:`compact`,compactionResult:e,displayText:U(t)}}if(G?.isReactiveOnlyMode())return await H(r,t,o,G);let e=(await g(r,t)).messages,n=await v(e,t,await W(t,e),!1,o,!1);return N(void 0),p(),I.cache.clear?.(),S(),{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(B):a(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(L):(c(e),Error(`Error during compaction: ${e}`))}}}))();export{K as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Sc as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Sc as n}from"./paths-q1-Ni8Oh.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=n();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=n().companion;if(!e)return;let{bones:t}=L(e.seed??z()),r=V(e);return{...e,...t,...r}}var U,W,G=e((()=>{t(),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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ac as e,Nc as t,Pc as n,Sc as r,_c as i,bc as a,gc as o}from"./paths-
|
|
1
|
+
import{Ac as e,Nc as t,Pc as n,Sc as r,_c as i,bc as a,gc as o}from"./paths-q1-Ni8Oh.js";e();export{o as checkHasTrustDialogAccepted,i as enableConfigs,a as getCurrentProjectConfig,r as getGlobalConfig,t as saveCurrentProjectConfig,n 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-DBopjMkN.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{Zc as l,el as u,nc as d,tc as f}from"./paths-o5iA-EnQ.js";import{b as p,x as m}from"./startupProfiler-DnXZaX4A.js";import{Lo as h,Mk as g,Nk as _,Oo as v,al as y,rl as b}from"./loadAgentsDir-DF6FgRn-.js";import{Fn as x,In as S,Mn as C,Pn as w,hn as T,in as E,rn as D,xn as O}from"./prompt-DiHksuOs.js";import{n as k,t as ee}from"./staticRender-Br64h1E1.js";function A(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 x: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 T: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 C: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===T);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((()=>{S(),O(),w(),E(),u(),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:A(e)})]})}var X,Z,Q,te=e((()=>{r(),o(),U(),u(),m(),d(),K(),X=c(),Z=`Autocompact buffer`,Q=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function ne(e){return v(e)}async function re(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=ne(n),{messages:s}=await _(o),c=process.stdout.columns||80,l=r();return e(await k((0,$.jsx)(Y,{data:await b(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{r(),te(),g(),y(),h(),ee(),$=c()}))();export{re as call};
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./figures-gfT9mM8P.js";import{Rn as r,b as i,o as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Zc as l,el as u,nc as d,tc as f}from"./paths-q1-Ni8Oh.js";import{b as p,x as m}from"./startupProfiler-DnXZaX4A.js";import{Lo as h,Mk as g,Nk as _,Oo as v,al as y,rl as b}from"./loadAgentsDir-Cl2w3uvH.js";import{Fn as x,In as S,Mn as C,Pn as w,hn as T,in as E,rn as D,xn as O}from"./prompt-BmOnuQfF.js";import{n as k,t as ee}from"./staticRender-Br64h1E1.js";function A(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 x: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 T: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 C: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===T);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((()=>{S(),O(),w(),E(),u(),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:A(e)})]})}var X,Z,Q,te=e((()=>{r(),o(),U(),u(),m(),d(),K(),X=c(),Z=`Autocompact buffer`,Q=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function ne(e){return v(e)}async function re(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,o=ne(n),{messages:s}=await _(o),c=process.stdout.columns||80,l=r();return e(await k((0,$.jsx)(Y,{data:await b(s,i,async()=>l.toolPermissionContext,a,l.agentDefinitions,c,t,void 0,o)}))),null}var $;e((()=>{r(),te(),g(),y(),h(),ee(),$=c()}))();export{re as call};
|
package/dist/chunks/{context-noninteractive-CFlod2Eg.js → context-noninteractive-BJ4hE3MX.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{nc as t,tc as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{nc as t,tc as n}from"./paths-q1-Ni8Oh.js";import{b as r,x as i}from"./startupProfiler-DnXZaX4A.js";import{Lo as a,Mk as o,Nk as s,Oo as c,al as l,rl as u}from"./loadAgentsDir-Cl2w3uvH.js";async function d(e){let{messages:t,getAppState:n,options:{mainLoopModel:r,tools:i,agentDefinitions:a,customSystemPrompt:o,appendSystemPrompt:l}}=e,d=c(t),{messages:f}=await s(d),p=n();return u(f,r,async()=>p.toolPermissionContext,i,a,void 0,{options:{customSystemPrompt:o,appendSystemPrompt:l}},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-BJ4hE3MX.js";t();export{n as call,e as collectContextData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./conversation-DizpkPtq.js";e();export{t as clearConversation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Ct as n,Jn as r,Xn as i,Z as a,cn as o,gn as s,ot as c,qn as l,yn as u}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{Ar as h,Du as g,Eu as _,Hm as v,Jv as y,L_ as b,Mn as x,Ov as S,R_ as C,SE as w,Vm as T,Vv as E,Yt as D,ab as O,ad as k,bE as A,di as j,fr as M,ib as N,id as P,jn as F,kn as ee,kv as I,mE as L,nr as R,pE as z,un as B,wi as V,wt as H,xi as U,xt as W,yn as G}from"./loadAgentsDir-
|
|
1
|
+
import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Ct as n,Jn as r,Xn as i,Z as a,cn as o,gn as s,ot as c,qn as l,yn as u}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{Ar as h,Du as g,Eu as _,Hm as v,Jv as y,L_ as b,Mn as x,Ov as S,R_ as C,SE as w,Vm as T,Vv as E,Yt as D,ab as O,ad as k,bE as A,di as j,fr as M,ib as N,id as P,jn as F,kn as ee,kv as I,mE as L,nr as R,pE as z,un as B,wi as V,wt as H,xi as U,xt as W,yn as G}from"./loadAgentsDir-Cl2w3uvH.js";import{C as K,y as q}from"./rcDebugLog-fhwD4wm-.js";import{l as J,r as Y}from"./commitAttribution-CUdm_sRl.js";import{n as X,t as Z}from"./caches-wtRUk5y5.js";import{randomUUID as Q}from"crypto";function $(){let e=P();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:y,setConversationId:b}){let x=B();await D(`clear`,{getAppState:_,setAppState:y,signal:AbortSignal.timeout(x),timeoutMs:x});let S=a();S&&f(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:S});let w=new Set,T=[],k=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(_)for(let e of Object.values(_().tasks))k(e)||(g(e)?(w.add(e.agentId),T.push(e)):O(e)&&w.add(e.identity.agentId));t(()=>[]),$();{let{setContextBlocked:t}=(q(),e(K));t(!1)}b&&b(Q()),Z(w),l(null),r(null),i(null),u(),v(c()),o.clear(),d?.clear(),p?.clear(),y&&y(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!k(r)){t[n]=r;continue}try{r.status===`running`&&(C(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)}ee(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}}}),E(),R(),s({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=n()),await j();for(let e of T)e.status===`running`&&F(e.id,M(A(e.agentId)));{let{saveMode:t}=(h(),e(V)),{isCoordinatorMode:n}=(L(),e(z));t(n()?`coordinator`:`normal`)}let N=W();N&&U(N);let P=await I(`clear`);P.length>0&&t(()=>P)}var ne=t((()=>{k(),o(),d(),N(),_(),b(),w(),J(),G(),p(),y(),T(),S(),h(),x(),H(),X()}));export{ne as n,te as t};
|
|
@@ -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-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Oo as p,Pc as m,Sc as h,jo as g}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,Rn as r,b as i,g as a,h as o,p as s,t as c,tn as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Oo as p,Pc as m,Sc as h,jo as g}from"./paths-q1-Ni8Oh.js";import{n as _,r as v}from"./analytics-DqMQntaB.js";import{Ak as y,Co as b,Lo as x,Nx as S,Px as C,Xo as w,jk as T}from"./loadAgentsDir-Cl2w3uvH.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=y.lexer(w(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=b(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=p(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-q1-Ni8Oh.js";import{E as i,T as a,d as o,s,w as c}from"./debug-UI3T040K.js";import{l,u}from"./oauth-CdZEzMww.js";import{i as d,t as f}from"./cliLaunch-BQa48gsr.js";import{resolve as p}from"path";import{existsSync as m,unlinkSync as h}from"fs";import{randomUUID as g}from"crypto";s(),c(),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){o(`[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=a(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):(o(`[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=i({type:`user`,message:{role:`user`,content:e},parent_tool_use_id:null,session_id:``});return this.writeToStdin(t)}sendInterrupt(){let e=i({type:`control_request`,request_id:crypto.randomUUID(),request:{subtype:`interrupt`}});this.writeToStdin(e)}respondToPermissionRequest(e,t){let n=i({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=i({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 s=new Headers(e.headers);for(let[e,t]of Object.entries(a))s.set(e,t);s.delete(`host`),s.delete(`x-auth-nonce`),o(`[SSHAuthProxy] ${e.method} ${r.pathname} -> ${i}`);try{let t=await fetch(i,{method:e.method,headers:s,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 o(`[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 o(`[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 o(`[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 s=i.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(Boolean);o(`[SSHProbe] raw lines: ${JSON.stringify(s)}`);let c=s.findIndex(e=>/^(Linux|Darwin)\s/.test(e));if(c===-1)throw new A(`Could not detect remote platform (uname output missing)`);let l=c>=2&&s[c-2]||null,u=c>=1&&s[c-1]||null,d=u&&/^\d+\.\d+/.test(u)?u:null,f=l!==null&&l.startsWith(`/`),p=s[c+1]||`/`,[m,h]=s[c].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.`);o(`[SSHDeploy] deploying to ${t} (${n}/${r}, v${i})`);let s=L();o(`[SSHDeploy] local binary: ${s}`),a?.(`Creating remote directory...`);let c=await I(t,`mkdir -p ${N}`);if(c.exitCode!==0)throw Error(`Failed to create remote directory: ${c.stderr}`);a?.(`Uploading binary...`);let l=`${N}/${P}`,u=Bun.spawn([`scp`,`-o`,`ConnectTimeout=10`,s,`${t}:${l}`],{stdout:`pipe`,stderr:`pipe`}),d=setTimeout(()=>u.kill(),M),f=await new Response(u.stderr).text(),p=await u.exited;if(clearTimeout(d),p!==0)throw Error(`SCP upload failed (exit ${p}): ${f.trim()}`);a?.(`Installing wrapper script...`);let m=await I(t,[`cat > ${N}/${F} << 'WRAPPER'`,`#!/bin/sh`,`exec bun ${N}/${P} "$@"`,`WRAPPER`,`chmod +x ${N}/${F}`].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,r}from"./createSession-D6v0lBtG.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{L as t,V as n,d as r,s as i}from"./debug-UI3T040K.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-BBMFODKH.js";async function l({environmentId:e,title:n,events:i,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{L as t,V as n,d as r,s as i}from"./debug-UI3T040K.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-BBMFODKH.js";async function l({environmentId:e,title:n,events:i,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-DelyQc8g.js`),{getOrganizationUUID:p}=await import(`./client-BHfY6SC5.js`),{getOauthConfig:m}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:h}=await import(`./api-B2HW-oZI.js`),{parseGitHubRepository:g}=await import(`./detectRepository-DCTvg4p0.js`),{getDefaultBranch:_}=await import(`./git-D23Mzu_K.js`),{getMainLoopModel:v}=await import(`./model-C6_WjCy0.js`),{default:y}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-ZcbBdhji.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-DCTvg4p0.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={...n!==void 0&&{title:n},events:i,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: ${t(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,n){let{getClaudeAIOAuthTokens:i}=await import(`./auth-DelyQc8g.js`),{getOrganizationUUID:a}=await import(`./client-BHfY6SC5.js`),{getOauthConfig:o}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:c}=await import(`./api-B2HW-oZI.js`),{default:l}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-ZcbBdhji.js`),d=n?.getAccessToken?.()??i()?.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=`${n?.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: ${t(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-DelyQc8g.js`),{getOrganizationUUID:i}=await import(`./client-BHfY6SC5.js`),{getOauthConfig:a}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:o}=await import(`./api-B2HW-oZI.js`),{default:c}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-ZcbBdhji.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,n,i){let{getClaudeAIOAuthTokens:a}=await import(`./auth-DelyQc8g.js`),{getOrganizationUUID:c}=await import(`./client-BHfY6SC5.js`),{getOauthConfig:l}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:u}=await import(`./api-B2HW-oZI.js`),{default:d}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-ZcbBdhji.js`),p=i?.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),_=`${i?.baseUrl??l().BASE_API_URL}/v1/sessions/${g}`;r(`[bridge] Updating session title: ${g} → ${n}`);try{let e=await d.patch(_,{title:n},{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: ${t(e)}`)}}var p=e((()=>{i(),n(),c(),a()}));export{f as a,p as i,l as n,u as r,d as t};
|