@readmagic/workmate 0.0.11 → 0.0.13
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-ag2JTpmU.js → AddWorkspaceDirectory-BzNj9rS6.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CDZPR488.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-CH9x1Ngp.js +1 -0
- package/dist/chunks/App-D-bYAYAl.js +1 -0
- package/dist/chunks/ApproveApiKey-BEGV9Zj9.js +1 -0
- package/dist/chunks/ApproveApiKey-CjacpIqq.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-A9hw_SV0.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-B05t83wa.js → BypassPermissionsModeDialog-B0BizN_J.js} +1 -1
- package/dist/chunks/{DiffDialog-DUbFrzKu.js → DiffDialog-mQ-5_TSv.js} +2 -2
- package/dist/chunks/Doctor-BC6IuQhd.js +3 -0
- package/dist/chunks/Doctor-i_5_AQd-.js +1 -0
- package/dist/chunks/ExitFlow-Bu2cVGpC.js +2 -0
- package/dist/chunks/{Grove-BDoVj02t.js → Grove-D0nn8zOV.js} +2 -2
- package/dist/chunks/{HybridTransport-C_U0IJfz.js → HybridTransport-BQNLZNa_.js} +1 -1
- package/dist/chunks/InvalidConfigDialog-C5CIiSIE.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-Br8kQOHz.js → InvalidSettingsDialog-Dq7hKXcO.js} +1 -1
- package/dist/chunks/MCPConnectionManager-aDDsYkGM.js +1 -0
- package/dist/chunks/MCPToolListView-Cr0MDkzT.js +1 -0
- package/dist/chunks/{McpParsingWarnings-COa71S9q.js → McpParsingWarnings-CUx2zexI.js} +1 -1
- package/dist/chunks/MessageSelector-DwGOWKKL.js +3 -0
- package/dist/chunks/Messages-C1jh4ixt.js +11 -0
- package/dist/chunks/Onboarding-t-P6Q5O6.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-to5eYBvI.js → PromptInputFooterSuggestions-R12fbdmp.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-CfMFx-TF.js → PromptInputHelpMenu-BgADIzRj.js} +1 -1
- package/dist/chunks/QueryEngine-HlLQJmsd.js +1 -0
- package/dist/chunks/REPL-Rs_JQkDc.js +1 -0
- package/dist/chunks/REPL-VKAmKkII.js +133 -0
- package/dist/chunks/RemoteSessionManager-BbgXeM-t.js +2 -0
- package/dist/chunks/ResumeConversation-66zbx12g.js +1 -0
- package/dist/chunks/{SSETransport-DN4tCDEh.js → SSETransport-BBQkdn4e.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-Bq87I_vu.js +1 -0
- package/dist/chunks/Settings-BKdLcyXe.js +2 -0
- package/dist/chunks/{TeleportProgress-C2LQVLav.js → TeleportProgress-3hmIApkj.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-BZL8Zblz.js → TeleportRepoMismatchDialog-BA1a66RK.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-wPiIs8xg.js → TeleportResumeWrapper-BT4O-Wsi.js} +1 -1
- package/dist/chunks/{ThemePicker-BT_NaRQC.js → ThemePicker-DUlhcoso.js} +1 -1
- package/dist/chunks/TrustDialog-Dpk03V1Y.js +1 -0
- package/dist/chunks/{ValidationErrorsList-C-hWdy_8.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
- package/dist/chunks/add-dir-BUr0z-VU.js +1 -0
- package/dist/chunks/{agentDisplay-CuSHqgZc.js → agentDisplay-D7bdOOG7.js} +1 -1
- package/dist/chunks/{agents-CMC0iQP4.js → agents-22wiC58F.js} +1 -1
- package/dist/chunks/agents-8ELI8RJo.js +103 -0
- package/dist/chunks/allErrors-C1eMbHSv.js +1 -0
- package/dist/chunks/api-DgjIFdMn.js +1 -0
- package/dist/chunks/{api-BbJfMXRS.js → api-f3GN2I_J.js} +1 -1
- package/dist/chunks/auth-B73a4Cob.js +1 -0
- package/dist/chunks/{auth-7mJGtlZp.js → auth-Czy7GoRh.js} +1 -1
- package/dist/chunks/auth-D_0waidQ.js +1 -0
- package/dist/chunks/backgroundHousekeeping-C_ArdTFX.js +17 -0
- package/dist/chunks/backgroundHousekeeping-YJhvZ0dh.js +1 -0
- package/dist/chunks/{banner-1Wyeyawe.js → banner-BcAM7iSx.js} +1 -1
- package/dist/chunks/bg-Ci7pG4eo.js +9 -0
- package/dist/chunks/branch-bb4-bErF.js +3 -0
- package/dist/chunks/{break-cache-CAoZ9b72.js → break-cache-4rlQORVk.js} +2 -2
- package/dist/chunks/{bridgeConfig-UgaUfuP6.js → bridgeConfig-B80T_lw7.js} +1 -1
- package/dist/chunks/bridgeConfig-DywkIo_k.js +1 -0
- package/dist/chunks/{bridgeMessaging-Ci5H68MX.js → bridgeMessaging-DyvHd16Z.js} +1 -1
- package/dist/chunks/{bridgePointer-BL8-lGvN.js → bridgePointer-DHWK3LEe.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-C36w15ge.js → bridgeStatusUtil-DStiD05t.js} +1 -1
- package/dist/chunks/btw-BRmV51bR.js +1 -0
- package/dist/chunks/caches-C5DIVdvI.js +1 -0
- package/dist/chunks/caches-zDZEgNKq.js +1 -0
- package/dist/chunks/{capacityWake-BOySRJUJ.js → capacityWake-ByL6fM6I.js} +1 -1
- package/dist/chunks/{ccrClient-Br4LAofR.js → ccrClient-BALhzhPF.js} +1 -1
- package/dist/chunks/{claudeDesktop-Bgds1-YT.js → claudeDesktop-Ct_hyICL.js} +1 -1
- package/dist/chunks/{clear-C4Vtnbye.js → clear-B_yVyJXP.js} +1 -1
- package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
- package/dist/chunks/client-7lIxWcaM.js +1 -0
- package/dist/chunks/{client-B9404qIP.js → client-BMA05FW8.js} +1 -1
- package/dist/chunks/client-DVg8PpFX.js +1 -0
- package/dist/chunks/commands-ByFXqW43.js +1 -0
- package/dist/chunks/compact-BUShp2eQ.js +2 -0
- package/dist/chunks/config-9rLTDOYW.js +3 -0
- package/dist/chunks/config-BwHNU_pI.js +1 -0
- package/dist/chunks/{config-kB2eazPX.js → config-DMKtiMzJ.js} +1 -1
- package/dist/chunks/{context-BN7DEjoH.js → context-6Pk3iVhh.js} +1 -1
- package/dist/chunks/{context-noninteractive-D91W2B8e.js → context-noninteractive-CHzerxnH.js} +2 -2
- package/dist/chunks/context-noninteractive-DFwRQyFE.js +1 -0
- package/dist/chunks/conversation-5zb5XkSA.js +1 -0
- package/dist/chunks/conversation-JP2ZXrwu.js +1 -0
- package/dist/chunks/createSSHSession-XkHMiGRN.js +6 -0
- package/dist/chunks/{createSession-DRqkLZWt.js → createSession-BNGm9fL4.js} +1 -1
- package/dist/chunks/createSession-VTqzWAu6.js +1 -0
- package/dist/chunks/crossProjectResume-DxgQVYSi.js +40 -0
- package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
- package/dist/chunks/cwd-DpqwaYHw.js +1 -0
- package/dist/chunks/datadog-3WUWcCFn.js +1 -0
- package/dist/chunks/{debug-BecbSVoN.js → debug-Dr1SjdXn.js} +2 -2
- package/dist/chunks/{debugUtils-CmJfIUxW.js → debugUtils-cK-iOsEV.js} +1 -1
- package/dist/chunks/detached-CqfQYVOi.js +5 -0
- package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
- package/dist/chunks/{detectRepository-C15umvKN.js → detectRepository-CMEkS5_2.js} +1 -1
- package/dist/chunks/{diff-DeK4bwjw.js → diff-CKlLimGq.js} +1 -1
- package/dist/chunks/{directoryCompletion-BJCu19HJ.js → directoryCompletion-ByBTSuLu.js} +1 -1
- package/dist/chunks/doctor-Bvx0u0sO.js +1 -0
- package/dist/chunks/{entry-mdegyj8z.js → entry-DCbq734V.js} +4 -4
- package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
- package/dist/chunks/{esm-Ka3lhafK.js → esm-CtQkOk5D.js} +1 -1
- package/dist/chunks/{execFileNoThrow-DHyW8FMX.js → execFileNoThrow-mXq4K0rl.js} +1 -1
- package/dist/chunks/{execSyncWrapper-CDzB0BM1.js → execSyncWrapper-Ne33rRiD.js} +1 -1
- package/dist/chunks/exit-DTsz5Lcb.js +1 -0
- package/dist/chunks/{extraUsage-BrKbpBK-.js → extraUsage-C86bZVgt.js} +1 -1
- package/dist/chunks/extractMemories-6OnMgL2S.js +1 -0
- package/dist/chunks/fast-B2ziqJEA.js +1 -0
- package/dist/chunks/{fast-DWn40OcQ.js → fast-BkhjaTkZ.js} +1 -1
- package/dist/chunks/{fileSuggestions-C7Pwq2yj.js → fileSuggestions-BalHmi1-.js} +2 -2
- package/dist/chunks/{firstPartyEventLogger-BHjBQH0J.js → firstPartyEventLogger-1RTgXHSz.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-CXMzhLrF.js +1 -0
- package/dist/chunks/{flushGate-DdJjxCes.js → flushGate-DWL05x7v.js} +1 -1
- package/dist/chunks/{gemini-DHv2iVfy.js → gemini-BLpLJyli.js} +1 -1
- package/dist/chunks/generateSessionName-CdbMksHi.js +1 -0
- package/dist/chunks/{genericProcessUtils-B2HcDYhg.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
- package/dist/chunks/git-Bs1vtuvX.js +1 -0
- package/dist/chunks/{git-DBlOv64X.js → git-CoQQ6YEf.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-CK56bUDe.js → githubRepoPathMapping-CmpEaQoo.js} +1 -1
- package/dist/chunks/{goal-BZG4gtnb.js → goal-V3qix-i1.js} +3 -3
- package/dist/chunks/grok-BLLATotv.js +1 -0
- package/dist/chunks/{grove-_zlQ83yR.js → grove-b9gGKgu4.js} +1 -1
- package/dist/chunks/{help-C_2tdXHC.js → help-BR7UEr5R.js} +1 -1
- package/dist/chunks/{hooks-C7Bn7MBe.js → hooks-C-QMGvCg.js} +3 -3
- package/dist/chunks/hooks-D6wtd0Qq.js +1 -0
- package/dist/chunks/{initReplBridge-NkZRcM77.js → initReplBridge-DyScxedy.js} +1 -1
- package/dist/chunks/{install-Du-DSVzj.js → install-DGH_bjUh.js} +1 -1
- package/dist/chunks/{instrumentation-DMs3b82f.js → instrumentation-DQ705pC7.js} +4 -4
- package/dist/chunks/{job-rbX1VZmp.js → job-BaMT6Lb2.js} +1 -1
- package/dist/chunks/{jwtUtils-OzxN2zts.js → jwtUtils-FQWtM6iM.js} +1 -1
- package/dist/chunks/keybindings-CG292HS1.js +2 -0
- package/dist/chunks/{launchLocalMemory-BLRCK1_o.js → launchLocalMemory-CtZrkmaw.js} +2 -2
- package/dist/chunks/{launchOnboarding-Al_X75Vz.js → launchOnboarding-CyOtdZkT.js} +1 -1
- package/dist/chunks/loadAgentsDir-4UC4yLg1.js +1 -0
- package/dist/chunks/{loadAgentsDir-BL93ulMm.js → loadAgentsDir-mcRW90aq.js} +596 -604
- package/dist/chunks/loadPluginHooks-CWI0RMUx.js +1 -0
- package/dist/chunks/{localSearch-C5ipegd9.js → localSearch-CCCDKpYx.js} +1 -1
- package/dist/chunks/localSearch-D4hVR7-d.js +1 -0
- package/dist/chunks/{log-Dauqle-Z.js → log-27kCA_9u.js} +1 -1
- package/dist/chunks/{logoV2Utils-CkvOihX7.js → logoV2Utils--8OUQQPd.js} +1 -1
- package/dist/chunks/{magicDocs-DLav5QK0.js → magicDocs-26J_l1De.js} +3 -3
- package/dist/chunks/main-CGLCy2pM.js +31 -0
- package/dist/chunks/main-DUjtDK1Q.js +513 -0
- package/dist/chunks/managedEnv-BuCurT_S.js +1 -0
- package/dist/chunks/{managedEnv-DJSCuqCb.js → managedEnv-Ds6MlFQE.js} +1 -1
- package/dist/chunks/{mappers-DQxMcezy.js → mappers-DwZw084m.js} +1 -1
- package/dist/chunks/mcp-CEKR7PjL.js +6 -0
- package/dist/chunks/mcp-DCAf2hHD.js +1 -0
- package/dist/chunks/mcp-mCuc8dNe.js +2 -0
- package/dist/chunks/{memoize-FeyE7JEh.js → memoize-Co4vS6UF.js} +1 -1
- package/dist/chunks/memory-B5SkpC7u.js +1 -0
- package/dist/chunks/{mode-Bl2RZC8M.js → mode-B80CHkqo.js} +1 -1
- package/dist/chunks/model-BqaneI4D.js +1 -0
- package/dist/chunks/model-C29_32BD.js +1 -0
- package/dist/chunks/model-NG8fvuT2.js +1 -0
- package/dist/chunks/{modelOptions-BtEZe5BB.js → modelOptions-CiZgZxZC.js} +1 -1
- package/dist/chunks/{nativeInstaller-BEwayifa.js → nativeInstaller-DqbEfGSX.js} +1 -1
- package/dist/chunks/oauth-D38aRTUb.js +1 -0
- package/dist/chunks/oauth-U649LV5H.js +1 -0
- package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
- package/dist/chunks/{omit--yH_T4rf.js → omit-KEhe84f4.js} +1 -1
- package/dist/chunks/{onChangeAppState-ZdwI7boX.js → onChangeAppState-Dq1tIEJI.js} +1 -1
- package/dist/chunks/openai-BvnsYTpQ.js +10 -0
- package/dist/chunks/{panel-CoNfXy3K.js → panel-CoF2a-h4.js} +1 -1
- package/dist/chunks/parser-B2PlJg4C.js +1 -0
- package/dist/chunks/{parser-BH4u7QiV.js → parser-CUUiH40T.js} +1 -1
- package/dist/chunks/partition-DeT341qu.js +1 -0
- package/dist/chunks/permissions-BPpeHxpk.js +3 -0
- package/dist/chunks/pidLock-DQGDoFQP.js +3 -0
- package/dist/chunks/{plan-BNYDTnQd.js → plan-BRiC5ujG.js} +1 -1
- package/dist/chunks/{platform-B0uTQc9P.js → platform-Dg1c9F_1.js} +1 -1
- package/dist/chunks/plugin-Dcg_GGR9.js +17 -0
- package/dist/chunks/pluginAutoupdate-ByH9IPC9.js +1 -0
- package/dist/chunks/pluginBlocklist-BfoLN9a-.js +1 -0
- package/dist/chunks/pluginCliCommands-Bc2Iybhz.js +1 -0
- package/dist/chunks/{pluginFlagging-DcJ_FQuv.js → pluginFlagging-Cr0d0hBA.js} +1 -1
- package/dist/chunks/pluginOperations-CKNyYjS-.js +2 -0
- package/dist/chunks/pluginStartupCheck-B48_cGgo.js +1 -0
- package/dist/chunks/{pluginStartupCheck-CKBFaMFr.js → pluginStartupCheck-DiCDQQlr.js} +1 -1
- package/dist/chunks/plugins-BP_36tOl.js +4 -0
- package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
- package/dist/chunks/{poorMode-B_xEvuEV.js → poorMode-DxgO_bUb.js} +1 -1
- package/dist/chunks/print-2uavraPq.js +26 -0
- package/dist/chunks/processBashCommand-g3sAMpHt.js +1 -0
- package/dist/chunks/processSlashCommand-tIbeCrv5.js +5 -0
- package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
- package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
- package/dist/chunks/{prompt-Dx7IWhBt.js → prompt-DIlq8NTy.js} +4 -4
- package/dist/chunks/prompt-DLv-Cd67.js +1 -0
- package/dist/chunks/prompt-DV5tCLRh.js +1 -0
- package/dist/chunks/{promptEditor-WCkmpejM.js → promptEditor-BILqOGl1.js} +2 -2
- package/dist/chunks/{protocolHandler-BiVWrpHi.js → protocolHandler-B83fCYI4.js} +1 -1
- package/dist/chunks/{proxy-CVn7o19p.js → proxy-BEKNaTXI.js} +1 -1
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
- package/dist/chunks/reconciler-CDq6XgAS.js +1 -0
- package/dist/chunks/refresh-ysrhoWCo.js +1 -0
- package/dist/chunks/{registerProtocol-E0Iu5hEx.js → registerProtocol-DduKPsn_.js} +1 -1
- package/dist/chunks/{reload-plugins-D-3AUT9g.js → reload-plugins-CGb0HTsH.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CV6we3ZA.js → remoteBridgeCore-BmteXmI9.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-D26Q09-7.js → remoteManagedSettings-CwDGxL5p.js} +1 -1
- package/dist/chunks/rename-1GLIUlYk.js +1 -0
- package/dist/chunks/{renderOptions-DDLbSMQU.js → renderOptions-45A-EdsK.js} +1 -1
- package/dist/chunks/resume-DWtlUiHW.js +2 -0
- package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
- package/dist/chunks/{ripgrep-C1ydIMzT.js → ripgrep-DQ_ILUJV.js} +1 -1
- package/dist/chunks/{runtimeObserver-L7pSIWBT.js → runtimeObserver-4ZqaCXYy.js} +4 -4
- package/dist/chunks/{runtimeObserver-OU8KrZQG.js → runtimeObserver-CtNY8Al2.js} +1 -1
- package/dist/chunks/sandbox-adapter-BzjRQh_r.js +1 -0
- package/dist/chunks/sandbox-toggle-Bz49-F6e.js +1 -0
- package/dist/chunks/searchExtraTools-D6vj8qJ-.js +1 -0
- package/dist/chunks/{session-DUYsfPy_.js → session-wb6X4Wrq.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-Da97UA2n.js +1 -0
- package/dist/chunks/{sessionObserver-Dv3Ba8eA.js → sessionObserver-BJQ5hwjU.js} +2 -2
- package/dist/chunks/sessionObserver-DXO4trhk.js +1 -0
- package/dist/chunks/{sessionState-D-SaBzWD.js → sessionState-Bn3ESS5f.js} +1 -1
- package/dist/chunks/sessionStorage-DlPVsQn9.js +1 -0
- package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
- package/dist/chunks/sessionTitle-Cbzrb9jT.js +14 -0
- package/dist/chunks/{sessionTracing-Bqb3vJTt.js → sessionTracing-CEsm8pZL.js} +1 -1
- package/dist/chunks/settings-3ionQKNv.js +1 -0
- package/dist/chunks/settings-DiBMs2gM.js +20 -0
- package/dist/chunks/settingsSync-eHaSngKo.js +1 -0
- package/dist/chunks/setup-DeyiuGNX.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-BzAZ57p2.js → shadowedRuleDetection-D5X5fhzj.js} +1 -1
- package/dist/chunks/{shellQuote-DS6WrivY.js → shellQuote-C_I6DHLV.js} +1 -1
- package/dist/chunks/{sideQuestion-CvMBBjI8.js → sideQuestion-BHRtwhyj.js} +3 -3
- package/dist/chunks/{sinks-f7qYjbKJ.js → sinks-Bgy2UNK-.js} +2 -2
- package/dist/chunks/sinks-CgzLmim2.js +1 -0
- package/dist/chunks/skillChangeDetector-BlSP16j6.js +1 -0
- package/dist/chunks/{skillGapStore-CqaT8c0C.js → skillGapStore-BjQSSz2E.js} +2 -2
- package/dist/chunks/{skillLifecycle-CnR8IqJM.js → skillLifecycle-Sp8strFv.js} +2 -2
- package/dist/chunks/{skillSearchPanel-D9qrOXpI.js → skillSearchPanel-3sYRez_Q.js} +5 -5
- package/dist/chunks/skills-CJhWI8t1.js +1 -0
- package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
- package/dist/chunks/{startupProfiler-CmH_aVy2.js → startupProfiler-Dc5r6LgE.js} +2 -2
- package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
- package/dist/chunks/state-CsdHk8n-.js +1 -0
- package/dist/chunks/{stats-B8uQ-UDi.js → stats-BkadEKa-.js} +1 -1
- package/dist/chunks/status-CDCurOqs.js +2 -0
- package/dist/chunks/{status-BekdWoIj.js → status-yoQIQ2Ni.js} +1 -1
- package/dist/chunks/statusNoticeHelpers-Sl4jjauz.js +1 -0
- package/dist/chunks/{stringUtils-C8PaYpQF.js → stringUtils-Df-Lnjxd.js} +1 -1
- package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
- package/dist/chunks/switcher-C-m6MUwE.js +1 -0
- package/dist/chunks/switcher-uoQMHmEZ.js +1 -0
- package/dist/chunks/{syncCache-ClP9aBqK.js → syncCache-BooMjgU6.js} +1 -1
- package/dist/chunks/{tasks-Dmh6qikm.js → tasks-CHG_6sXQ.js} +1 -1
- package/dist/chunks/teleport-C9KRE4X8.js +1 -0
- package/dist/chunks/{templateJobs-CxqU-s5i.js → templateJobs-BYYfF4m5.js} +2 -2
- package/dist/chunks/{terminalSetup-BKGcmlWp.js → terminalSetup-CbXKCpWM.js} +1 -1
- package/dist/chunks/{terminalSetup-Cy19F1Js.js → terminalSetup-fwhFTxGi.js} +1 -1
- package/dist/chunks/{theme-U7lMFHQ0.js → theme-MvX7hojJ.js} +1 -1
- package/dist/chunks/tmux-d3cNCIZA.js +1 -0
- package/dist/chunks/{toolEventObserver-D9qjoVl5.js → toolEventObserver-BFEl47bq.js} +1 -1
- package/dist/chunks/toolPool-Cq74Cvjp.js +1 -0
- package/dist/chunks/trustedDevice-BGwujSqc.js +1 -0
- package/dist/chunks/{trustedDevice-DL0pWP4_.js → trustedDevice-BLiKbGpG.js} +1 -1
- package/dist/chunks/{types-DafcFtmb.js → types-BJ7qTz75.js} +1 -1
- package/dist/chunks/{udsClient-CWnfsgFP.js → udsClient-CF8BmZgN.js} +1 -1
- package/dist/chunks/{updateCCB-C6XftzIG.js → updateCCB-CfckOy7T.js} +1 -1
- package/dist/chunks/{upstreamproxy-CXmjxHpl.js → upstreamproxy-BuBFDFAD.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DEEJhm_W.js → useExitOnCtrlCDWithKeybindings-CPLBDluY.js} +1 -1
- package/dist/chunks/useMainLoopModel-C00PbZ1Q.js +1 -0
- package/dist/chunks/useManagePlugins-DFaGntzJ.js +1 -0
- package/dist/chunks/{useMergedTools-DbhqKk1-.js → useMergedTools-DYobZ5N4.js} +1 -1
- package/dist/chunks/{useSearchInput-gUDbkLaC.js → useSearchInput-KFKh2ozY.js} +1 -1
- package/dist/chunks/useSettingsErrors-BRgjvaHd.js +1 -0
- package/dist/chunks/{userAgent-CU7Ndh79.js → userAgent-DUrr02yh.js} +1 -1
- package/dist/chunks/util-D7uwPgF1.js +1 -0
- package/dist/chunks/validatePlugin-VukX52bx.js +1 -0
- package/dist/chunks/{vim-w37BfGZ5.js → vim-C4Hs5U2h.js} +1 -1
- package/dist/chunks/{which-BRWBO7Gu.js → which-mplwBbc0.js} +1 -1
- package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
- package/dist/chunks/{windowsPaths-DtWHLjmE.js → windowsPaths-C7Mdo9aU.js} +1 -1
- package/dist/chunks/{workSecret-BEhXgH2M.js → workSecret-XLodD7tw.js} +1 -1
- package/dist/chunks/workerRegistry-BA37PVbv.js +6 -0
- package/dist/chunks/worktree-Lik8xuKd.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/App-BuKmqFPm.js +0 -1
- package/dist/chunks/ApproveApiKey-CIWOi_7v.js +0 -1
- package/dist/chunks/ApproveApiKey-M6U-NafA.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CSywJdVL.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +0 -1
- package/dist/chunks/Doctor-BcnUfJ4I.js +0 -1
- package/dist/chunks/Doctor-Dz4TuYas.js +0 -3
- package/dist/chunks/ExitFlow-BwyAtIHx.js +0 -2
- package/dist/chunks/InvalidConfigDialog-bih293Xt.js +0 -1
- package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +0 -1
- package/dist/chunks/MCPToolListView-DJ06N1DG.js +0 -1
- package/dist/chunks/MessageSelector-o4ULADFg.js +0 -3
- package/dist/chunks/Messages-qqwHuAW5.js +0 -11
- package/dist/chunks/Onboarding-BzuQjney.js +0 -1
- package/dist/chunks/QueryEngine-Dt0BKUeF.js +0 -1
- package/dist/chunks/REPL-CUbEDqEl.js +0 -133
- package/dist/chunks/REPL-DMaKNhTa.js +0 -1
- package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +0 -2
- package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +0 -1
- package/dist/chunks/Settings-DfdcmvOV.js +0 -2
- package/dist/chunks/TrustDialog-ACaJ_m7A.js +0 -1
- package/dist/chunks/WelcomeV2-ZQRKlcT4.js +0 -1
- package/dist/chunks/add-dir-SAKTkw0S.js +0 -1
- package/dist/chunks/agents-ZgRKpjHv.js +0 -103
- package/dist/chunks/allErrors-_cOQksHC.js +0 -1
- package/dist/chunks/api-DS1MiW01.js +0 -1
- package/dist/chunks/auth-DGZzCbU0.js +0 -1
- package/dist/chunks/auth-DN1MUpB8.js +0 -1
- package/dist/chunks/autoMode-CBtY7ACs.js +0 -45
- package/dist/chunks/autonomy-DuQmYhq6.js +0 -15
- package/dist/chunks/autonomy-lJV7yWUl.js +0 -1
- package/dist/chunks/autonomyPanel-DAQm6lDz.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +0 -1
- package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +0 -17
- package/dist/chunks/bg-CJ0YWFli.js +0 -9
- package/dist/chunks/bg-CeUrRz_7.js +0 -1
- package/dist/chunks/branch-k3kirqbA.js +0 -3
- package/dist/chunks/bridgeConfig-CzRUPn-D.js +0 -1
- package/dist/chunks/btw-nVoVuIae.js +0 -1
- package/dist/chunks/caches-B8sM3Zys.js +0 -1
- package/dist/chunks/caches-Bp9MZ7IE.js +0 -1
- package/dist/chunks/cliLaunch-BTpfAGGI.js +0 -1
- package/dist/chunks/client-BCAbKdNz.js +0 -1
- package/dist/chunks/client-CJE6gEvU.js +0 -1
- package/dist/chunks/commands-DL-BzoMQ.js +0 -1
- package/dist/chunks/compact-Cx7BPXLU.js +0 -2
- package/dist/chunks/config-S5OW4Xqr.js +0 -1
- package/dist/chunks/config-aRiTrtCv.js +0 -3
- package/dist/chunks/connectHeadless-CqRoEtrg.js +0 -1
- package/dist/chunks/context-noninteractive-DPacEFJ1.js +0 -1
- package/dist/chunks/conversation-D5Nbu9eT.js +0 -1
- package/dist/chunks/conversation-hcUx9e-C.js +0 -1
- package/dist/chunks/createSSHSession-DecOR6M5.js +0 -6
- package/dist/chunks/createSession-D27zvmOs.js +0 -1
- package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +0 -40
- package/dist/chunks/cwd-ClLru_7T.js +0 -1
- package/dist/chunks/dangerousBackend-DwcP0P08.js +0 -1
- package/dist/chunks/datadog-bm551AVV.js +0 -1
- package/dist/chunks/detached-CIyF0M5O.js +0 -5
- package/dist/chunks/detectRepository-DDfLfKcM.js +0 -1
- package/dist/chunks/doctor-BJORBomU.js +0 -1
- package/dist/chunks/exit-CF3KBl-S.js +0 -1
- package/dist/chunks/extractMemories-4lBn134y.js +0 -1
- package/dist/chunks/fast-0Vi354KI.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +0 -1
- package/dist/chunks/generateSessionName-DhS_6oHd.js +0 -1
- package/dist/chunks/git-DF4RFFaT.js +0 -1
- package/dist/chunks/grok-BS57ZhyW.js +0 -1
- package/dist/chunks/hooks-DT80Arzc.js +0 -1
- package/dist/chunks/keybindings-CwdC_8S0.js +0 -2
- package/dist/chunks/loadAgentsDir-eVKq8efm.js +0 -1
- package/dist/chunks/loadPluginHooks-B0au35a4.js +0 -1
- package/dist/chunks/localSearch-CZlFfR_X.js +0 -1
- package/dist/chunks/lockfile-D5-j7HOZ.js +0 -1
- package/dist/chunks/main-CVNWNAoh.js +0 -513
- package/dist/chunks/main-LMyE3jXY.js +0 -31
- package/dist/chunks/managedEnv-CYepSnm8.js +0 -1
- package/dist/chunks/mcp-BAbbEaBA.js +0 -1
- package/dist/chunks/mcp-Ct4Sum6A.js +0 -6
- package/dist/chunks/mcp-D5HkCqUh.js +0 -2
- package/dist/chunks/memory-COa7aUbx.js +0 -1
- package/dist/chunks/model-B7rtZ7KV.js +0 -1
- package/dist/chunks/model-Bgh_r4lg.js +0 -1
- package/dist/chunks/model-DiuEAv6h.js +0 -1
- package/dist/chunks/oauth-BN2I0_jl.js +0 -1
- package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
- package/dist/chunks/openai-DWs4D-nQ.js +0 -10
- package/dist/chunks/parseConnectUrl-BiyKR5-x.js +0 -1
- package/dist/chunks/parser-BMIaRErw.js +0 -1
- package/dist/chunks/partition-DLcW5Oo_.js +0 -1
- package/dist/chunks/permissions-CaucYK3s.js +0 -3
- package/dist/chunks/pidLock-DgOBc1Xo.js +0 -3
- package/dist/chunks/plugin-BN-of1_H.js +0 -17
- package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +0 -1
- package/dist/chunks/pluginBlocklist-DXQlbG0P.js +0 -1
- package/dist/chunks/pluginCliCommands-CfdVNs8D.js +0 -1
- package/dist/chunks/pluginOperations-DnhzFbYI.js +0 -2
- package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +0 -1
- package/dist/chunks/plugins-CBW7kPyp.js +0 -4
- package/dist/chunks/poorMode-yH1o41cQ.js +0 -1
- package/dist/chunks/print-BZOx09SU.js +0 -26
- package/dist/chunks/processBashCommand-dcCNCiBp.js +0 -1
- package/dist/chunks/processSlashCommand-YDiM63Qr.js +0 -5
- package/dist/chunks/prompt-CXGy0llt.js +0 -1
- package/dist/chunks/prompt-DovNDmcx.js +0 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
- package/dist/chunks/reconciler-C2Nd_e4n.js +0 -1
- package/dist/chunks/refresh-B84H2Ezd.js +0 -1
- package/dist/chunks/rename-CSavuBIE.js +0 -1
- package/dist/chunks/resume-CROylN3J.js +0 -2
- package/dist/chunks/ripgrep-2M1GkXqJ.js +0 -1
- package/dist/chunks/sandbox-adapter-6UwMLh6e.js +0 -1
- package/dist/chunks/sandbox-toggle-YrQNWGsr.js +0 -1
- package/dist/chunks/searchExtraTools-Bdv5HJ74.js +0 -1
- package/dist/chunks/server-LdbAb0sV.js +0 -1
- package/dist/chunks/serverBanner-BdExKFHT.js +0 -1
- package/dist/chunks/serverLog-BFmvyJ93.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +0 -1
- package/dist/chunks/sessionManager-CPa049BO.js +0 -1
- package/dist/chunks/sessionObserver-B0zucj_c.js +0 -1
- package/dist/chunks/sessionStorage-BM1x51Z7.js +0 -1
- package/dist/chunks/sessionTitle-uCuYaNif.js +0 -14
- package/dist/chunks/settings-BG15IFYx.js +0 -1
- package/dist/chunks/settings-D4CpDv2y.js +0 -20
- package/dist/chunks/settingsSync-BSrpnyqo.js +0 -1
- package/dist/chunks/setup-C62oq4AZ.js +0 -3
- package/dist/chunks/sinks-WJ7nzLQs.js +0 -1
- package/dist/chunks/skillChangeDetector-U5kRU5nd.js +0 -1
- package/dist/chunks/skills-BgcFh0vy.js +0 -1
- package/dist/chunks/startupProfiler-B4HBBbHN.js +0 -1
- package/dist/chunks/state-BAGmpVBn.js +0 -1
- package/dist/chunks/state-D_lk6z-C.js +0 -1
- package/dist/chunks/status-D6KlRJmR.js +0 -2
- package/dist/chunks/statusNoticeHelpers-BMM8_uJ1.js +0 -1
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
- package/dist/chunks/switcher-Ck9CrXrr.js +0 -1
- package/dist/chunks/switcher-DnAhkyIn.js +0 -1
- package/dist/chunks/teleport-DH3IuAUQ.js +0 -1
- package/dist/chunks/tmux-D5EvHWi3.js +0 -1
- package/dist/chunks/toolPool-69mfSPAs.js +0 -1
- package/dist/chunks/trustedDevice-B6AKlsl_.js +0 -1
- package/dist/chunks/useMainLoopModel-6w7mhwhU.js +0 -1
- package/dist/chunks/useManagePlugins-CjnsO-Of.js +0 -1
- package/dist/chunks/useSettingsErrors-CgPad-H0.js +0 -1
- package/dist/chunks/util-B4oMhJKh.js +0 -1
- package/dist/chunks/validatePlugin-y_O_tCEL.js +0 -1
- package/dist/chunks/windowsPaths-BY-IVNwQ.js +0 -1
- package/dist/chunks/workerRegistry-Bq9bS5pw.js +0 -6
- package/dist/chunks/worktree-4SUJ4dtz.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Nt as a,_ as o,_n as s,g as c,p as l,zt as u}from"./loadAgentsDir-mcRW90aq.js";import{lr as d,ur as f}from"./state-BPFYBqm1.js";import{n as p,t as m}from"./cwd-Besi3Os3.js";import{P as h,R as g,c as _,f as v,i as ee,u as y}from"./debug-Dr1SjdXn.js";import{cr as b,g as x,n as te,or as ne}from"./settings-DiBMs2gM.js";import{c as re,h as ie}from"./config-9rLTDOYW.js";import{m as ae,p as oe,r as S}from"./git-CoQQ6YEf.js";import{n as se,r as ce}from"./execFileNoThrow-mXq4K0rl.js";import{o as le,s as C}from"./log-27kCA_9u.js";import{n as ue,r as w}from"./analytics-DJobLaWP.js";import{a as de,s as fe}from"./ripgrep-DQ_ILUJV.js";import*as T from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?k:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?D:0}function he(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ge(e){return e>=97&&e<=122}function _e(e){return e>=65&&e<=90}function E(){return new Promise(e=>setImmediate(e))}function ve(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 ye,be,D,O,k,A,j,M,N,P,F,xe=e((()=>{n(),ye=16,be=8,D=6,O=4,k=8,A=3,j=1,M=100,N=64,P=new Int32Array(N),F=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 E(),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 E(),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=ve(e,M)}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*24+k+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+=O:n+=A+i*j,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,P[0],!0);for(let e=1;e<i;e++)f+=me(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 I(){return z||(z=new F),z}function Se(){z=null,B=null,H++,U=null,W=[],G=[],K=[],V.clear(),q=null,J=null,Y=0,X=null,Z=null,Q=null}function Ce(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 we(){let e=S(m());if(!e)return null;try{return pe(T.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function Te(e,t,n){return n===t?e:e.map(e=>{let r=T.join(t,e);return T.relative(n,r)})}async function Ee(e){if(e.length===0||!z||W.length===0)return;let t=await ke(e),n=[...W,...G,...K,...e,...t],r=Ce(n);if(r===Q){_(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,_(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function De(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=y(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,Be.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,_(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function Oe(e,t){let n=Date.now();_(`[FileIndex] getFilesUsingGit called`);let r=m(),i=S(r);if(!i)return _(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await se(oe(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(_(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return _(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=Te(o.stdout.trim().split(`
|
|
2
2
|
`).filter(Boolean),i,r),c=await De(i,r);if(c){let e=s.length;s=c.filter(s),_(`[FileIndex] applied ignore patterns: ${e} -> ${s.length} files`)}W=s;let l=Date.now()-n;if(_(`[FileIndex] git ls-files: ${s.length} tracked files in ${l}ms`),w(`tengu_file_suggestions_git_ls_files`,{file_count:s.length,tracked_count:s.length,untracked_count:0,duration_ms:l}),!U){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=H;U=se(oe(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=Te(e.stdout.trim().split(`
|
|
3
|
-
`).filter(Boolean),i,r),n=await De(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),_(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}_(`[FileIndex] background untracked fetch: ${t.length} files`),Ee(t)}}).catch(e=>{_(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return _(`[FileIndex] git ls-files error: ${h(e)}`),null}}async function ke(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)Ae(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await E(),n=performance.now());return[...t].map(e=>e+T.sep)}function Ae(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 je(e){return(await Promise.all(l.map(t=>
|
|
3
|
+
`).filter(Boolean),i,r),n=await De(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),_(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}_(`[FileIndex] background untracked fetch: ${t.length} files`),Ee(t)}}).catch(e=>{_(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return _(`[FileIndex] git ls-files error: ${h(e)}`),null}}async function ke(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)Ae(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await E(),n=performance.now());return[...t].map(e=>e+T.sep)}function Ae(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 je(e){return(await Promise.all(l.map(t=>o(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function Me(e,t){_(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await Oe(e,t);if(n!==null)return _(`[FileIndex] using git ls-files result (${n.length} files)`),n;_(`[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 fe(i,`.`,e)).map(e=>T.relative(m(),e)),o=Date.now()-r;return _(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),w(`tengu_file_suggestions_ripgrep`,{file_count:a.length,duration_ms:o}),a}async function Ne(){let e=AbortSignal.timeout(1e4),t=I();try{let n=te(),r=re(),i=n.respectGitignore??r.respectGitignore??!0,a=m(),[o,s]=await Promise.all([Me(e,i),je(a)]);G=s;let c=[...o,...s],l=await ke(c);K=l;let u=[...l,...c],d=Ce(u);d===Z?_(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,Z=d,Q=null)}catch(e){C(e)}return t}function Pe(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 Fe(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=Pe(n,r),n===``)return``}return n}function L(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Ie(e,t){return e.search(t,$).map(e=>L(e.path,e.score))}function R(){if(B)return;let e=we();if(z&&!(e!==null&&e!==X)&&Date.now()-Y<He)return;let t=H,n=Date.now();I(),B=Ne().then(r=>t===H?(B=null,V.emit(),X=e,Y=Date.now(),_(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(_(`[FileIndex] Cache refresh failed: ${h(e)}`),C(e),t===H&&(B=null),I()))}async function Le(){let e=y(),t=m();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 Re(e,t=!1){if(!e&&!t)return[];if(te().fileSuggestion?.type===`command`)return(await u({...a(),query:e})).slice(0,$).map(L);if(e===``||e===`.`||e===`./`){let e=await Le();return R(),e.slice(0,$).map(L)}let n=Date.now();try{let t=B!==null;R();let r=e,i=`.`+T.sep;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=ne(r));let a=z?Ie(z,r):[],o=Date.now()-n;return _(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),w(`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 ze(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 Be,z,B,V,Ve,H,U,W,G,K,q,J,Y,X,Z,Q,$,He,Ue=e((()=>{Be=t(i(),1),c(),xe(),ue(),ie(),p(),ee(),g(),ce(),v(),ae(),s(),le(),b(),de(),x(),f(),z=null,B=null,V=d(),Ve=V.subscribe,H=0,U=null,W=[],G=[],K=[],q=null,J=null,Y=0,X=null,Z=null,Q=null,$=15,He=5e3}));export{Ue as a,Re as i,Se as n,Ve as o,Fe as r,R as s,ze as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,n as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{Wt as p,pt as m,z as ee}from"./state-BemZdQIl.js";import{n as te,t as ne}from"./cwd-Cfdf7z7s.js";import{C as h,P as re,R as ie,U as ae,V as oe,x as se}from"./debug-BecbSVoN.js";import{Jt as ce,Yt as le}from"./settings-D4CpDv2y.js";import{c as ue,d as g,h as _,n as de}from"./config-aRiTrtCv.js";import{c as fe,o as pe}from"./execFileNoThrow-DHyW8FMX.js";import{d as me,o as he,p as v,s as y}from"./log-Dauqle-Z.js";import{a as ge,i as _e,o as ve}from"./platform-B0uTQc9P.js";import{l as ye,s as be}from"./types-DafcFtmb.js";import{i as xe,n as Se}from"./analytics-DJobLaWP.js";import{n as Ce,r as b}from"./startupProfiler-CmH_aVy2.js";import{$n as we,Bt as x,Fr as Te,Ft as Ee,Gt as De,Ir as Oe,Nt as ke,Ot as Ae,_n as je,jt as S,nr as Me,vn as Ne,zt as Pe}from"./model-Bgh_r4lg.js";import{n as Fe,t as Ie}from"./userAgent-CU7Ndh79.js";import{Z as Le,_ as Re,c as ze,et as C,it as Be,n as Ve,o as He,t as Ue,v as We,w}from"./esm-Ka3lhafK.js";import*as T from"path";import{randomUUID as E}from"crypto";import{appendFile as Ge,mkdir as D,readdir as Ke,unlink as O,writeFile as qe}from"fs/promises";function k(){return r(process.env.CLAUDE_CODE_USE_BEDROCK)||r(process.env.CLAUDE_CODE_USE_VERTEX)||r(process.env.CLAUDE_CODE_USE_FOUNDRY)||v()}function Je(){return v()}var A=e((()=>{a(),me()}));async function Ye(){j===null&&!M&&(M=Qe(),j=await M,M=null,N.cache.clear?.())}function Xe(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Ze(){if(j!==null)return j;let e=S();if(e?.emailAddress)return e.emailAddress}async function Qe(){let e=S();if(e?.emailAddress)return e.emailAddress}var j,M,N,P,F=e((()=>{fe(),n(),p(),x(),_(),te(),le(),a(),j=null,M=null,N=t(e=>{let t=g(),n=ue(),i,a,o;if(e&&(i=Ee()??void 0,a=ke()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=S(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.11`,platform:ce(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:i,rateLimitTier:a,firstTokenTime:o,...r(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),P=t(async()=>{let e=await pe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function $e(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,et=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=$e();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function tt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,nt=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=tt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function rt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function it(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function at(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ot(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function st(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):st(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ct=e((()=>{et(),nt(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=rt();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=it();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=at();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=ot();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return T.join(i(),`telemetry`)}function lt(e){if(!d.isAxiosError(e))return re(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,ut=e((()=>{We(),f(),p(),ct(),x(),_(),a(),ie(),Me(),be(),he(),je(),se(),Fe(),Te(),Se(),C(),o(),q=E(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return T.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await ye(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await O(e)}catch{}else await D(K(),{recursive:!0}),await qe(e,t.map(e=>h(e)).join(`
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{i as r,l as i,o as a}from"./envUtils-DcaKZlRU.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{Wt as p,pt as m,z as ee}from"./state-BPFYBqm1.js";import{n as te,t as ne}from"./cwd-Besi3Os3.js";import{C as h,P as re,R as ie,U as ae,V as oe,x as se}from"./debug-Dr1SjdXn.js";import{Yt as ce,qt as le}from"./settings-DiBMs2gM.js";import{c as ue,d as g,h as _,n as de}from"./config-9rLTDOYW.js";import{c as fe,o as pe}from"./execFileNoThrow-mXq4K0rl.js";import{d as me,o as he,p as v,s as y}from"./log-27kCA_9u.js";import{a as ge,i as _e,o as ve}from"./platform-Dg1c9F_1.js";import{l as ye,s as be}from"./types-BJ7qTz75.js";import{i as xe,n as Se}from"./analytics-DJobLaWP.js";import{n as Ce,r as b}from"./startupProfiler-Dc5r6LgE.js";import{$n as we,Bt as x,Fr as Te,Ft as Ee,Gt as De,Ir as Oe,Nt as ke,Ot as Ae,_n as je,jt as S,nr as Me,vn as Ne,zt as Pe}from"./model-C29_32BD.js";import{n as Fe,t as Ie}from"./userAgent-DUrr02yh.js";import{Z as Le,_ as Re,c as ze,et as C,it as Be,n as Ve,o as He,t as Ue,v as We,w}from"./esm-CtQkOk5D.js";import*as T from"path";import{randomUUID as E}from"crypto";import{appendFile as Ge,mkdir as D,readdir as Ke,unlink as O,writeFile as qe}from"fs/promises";function k(){return i(process.env.CLAUDE_CODE_USE_BEDROCK)||i(process.env.CLAUDE_CODE_USE_VERTEX)||i(process.env.CLAUDE_CODE_USE_FOUNDRY)||v()}function Je(){return v()}var A=e((()=>{a(),me()}));async function Ye(){j===null&&!M&&(M=Qe(),j=await M,M=null,N.cache.clear?.())}function Xe(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Ze(){if(j!==null)return j;let e=S();if(e?.emailAddress)return e.emailAddress}async function Qe(){let e=S();if(e?.emailAddress)return e.emailAddress}var j,M,N,P,F=e((()=>{fe(),n(),p(),x(),_(),te(),ce(),a(),j=null,M=null,N=t(e=>{let t=g(),n=ue(),r,a,o;if(e&&(r=Ee()??void 0,a=ke()??void 0,r&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=S(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.13`,platform:le(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:r,rateLimitTier:a,firstTokenTime:o,...i(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),P=t(async()=>{let e=await pe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function $e(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,et=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=$e();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function tt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,nt=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=tt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function rt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function it(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function at(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ot(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function st(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):st(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ct=e((()=>{et(),nt(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=rt();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=it();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=at();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=ot();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return T.join(r(),`telemetry`)}function lt(e){if(!d.isAxiosError(e))return re(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,ut=e((()=>{We(),f(),p(),ct(),x(),_(),a(),ie(),Me(),be(),he(),je(),se(),Fe(),Te(),Se(),C(),o(),q=E(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return T.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await ye(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await O(e)}catch{}else await D(K(),{recursive:!0}),await qe(e,t.map(e=>h(e)).join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`,`utf8`)}catch(e){y(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await D(K(),{recursive:!0}),await Ge(e,t.map(e=>h(e)).join(`
|
|
4
4
|
`)+`
|
|
5
|
-
`,`utf8`)}catch(e){y(e)}}async deleteFile(e){try{await O(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(oe(e))return;throw e}for(let e of t){let t=T.join(K(),e);this.retryFileInBackground(t)}}catch(e){y(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}let n=await this.sendEventsInBatches(t);n.length===0?await this.deleteFile(e):await this.saveEventsToFile(e,n)}async export(e,t){if(this.isShutdown){t({code:w.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:w.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:w.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:w.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:w.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:w.SUCCESS})}catch(e){y(e),t({code:w.FAILED,error:ae(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=lt(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await Ne(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;y(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":Ie(),"x-service-name":`
|
|
5
|
+
`,`utf8`)}catch(e){y(e)}}async deleteFile(e){try{await O(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(oe(e))return;throw e}for(let e of t){let t=T.join(K(),e);this.retryFileInBackground(t)}}catch(e){y(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}let n=await this.sendEventsInBatches(t);n.length===0?await this.deleteFile(e):await this.saveEventsToFile(e,n)}async export(e,t){if(this.isShutdown){t({code:w.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:w.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:w.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:w.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:w.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:w.SUCCESS})}catch(e){y(e),t({code:w.FAILED,error:ae(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=lt(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await Ne(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;y(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":Ie(),"x-service-name":`workmate`},n=de()||ee(),r=this.skipAuth||!n;if(!r&&De()){let e=Ae();Pe()?e&&Oe(e.expiresAt)&&(r=!0):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:we(),a=!i.error,o=a?{...t,...i.headers}:t;try{let t=await d.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&d.isAxiosError(n)&&n.response?.status===401){let n=await d.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{},r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:m(),additional_metadata:Buffer.from(h({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Be(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=xe(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(h(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush()}async forceFlush(){await Promise.all(this.pendingExports)}}}));function X(e){return!1}var dt=e((()=>{}));function ft(){return{}}function pt(e){let t=ft()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}async function mt(){if($)try{await $.shutdown()}catch{}}function Z(){return!k()}async function ht(e,t,n={}){try{let r=await Le({model:n.model,betas:n.betas}),i={event_name:t,event_id:E(),core_metadata:r,user_metadata:N(!0),event_metadata:n},a=g();a&&(i.user_id=a),e.emit({body:t,attributes:i})}catch{}}function gt(e,t={}){Z()&&(!Q||X(`firstParty`)||ht(Q,e,t))}function _t(){if(b(`1p_event_logging_start`),!Z())return;b(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||vt.toString(),10),t=yt,n=bt,r=_e(),i={[l]:`workmate`,[c]:`0.0.13`};if(r===`wsl`){let e=ge();e&&(i[`wsl.version`]=e)}$=new He({resource:Re(i),processors:[new Ve(new Y({maxBatchSize:t,isKilled:()=>X(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.13`)}var vt,yt,bt,Q,$,xt=e((()=>{ze(),Ue(),u(),_(),ve(),Ce(),F(),A(),ut(),C(),dt(),vt=1e4,yt=200,bt=8192,Q=null,$=null}));export{gt as a,P as c,Xe as d,A as f,Z as i,Ye as l,Je as m,xt as n,pt as o,k as p,_t as r,mt as s,ft as t,F as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./firstPartyEventLogger-1RTgXHSz.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{A as n,C as r,m as i,w as a}from"./external-CEp-aPkt.js";import{n as o,r as s,t as c}from"./lazySchema-B4D4qJVE.js";import{P as l,R as u,c as d,i as f}from"./debug-
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{A as n,C as r,m as i,w as a}from"./external-CEp-aPkt.js";import{n as o,r as s,t as c}from"./lazySchema-B4D4qJVE.js";import{P as l,R as u,c as d,i as f}from"./debug-Dr1SjdXn.js";import{A as p,dt as m,ft as h,j as g}from"./sessionState-Bn3ESS5f.js";import"./bridgeMessaging-DyvHd16Z.js";import{i as _}from"./workSecret-XLodD7tw.js";import{t as v}from"./ccrClient-BALhzhPF.js";import{n as y,t as b}from"./SSETransport-BBQkdn4e.js";s(),c(),m();var x={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},S=o(()=>a({init_retry_max_attempts:r().int().min(1).max(10).default(3),init_retry_base_delay_ms:r().int().min(100).default(500),init_retry_jitter_fraction:r().min(0).max(1).default(.25),init_retry_max_delay_ms:r().int().min(500).default(4e3),http_timeout_ms:r().int().min(2e3).default(1e4),uuid_dedup_buffer_size:r().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:r().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:r().min(0).max(.5).default(.1),token_refresh_buffer_ms:r().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:r().int().min(500).max(2e3).default(1500),connect_timeout_ms:r().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return h(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:i().default(!1)}));async function C(){let e=x,t=S().safeParse(e);return t.success?t.data:x}async function w(){let e=await C();return e.min_version&&h(`0.0.13`,e.min_version)?`Your version of Work Mate (0.0.13) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}y(),f(),u(),p();function T(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function E(e){let{sessionUrl:t,ingressToken:n,sessionId:r,initialSequenceNum:i,getAuthToken:a}=e,o;a?o=()=>{let e=a();return e?{Authorization:`Bearer ${e}`}:{}}:g(n);let s=e.epoch??await _(t,n);d(`[bridge:repl] CCR v2: worker sessionId=${r} epoch=${s}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let c=new URL(t);c.pathname=c.pathname.replace(/\/$/,``)+`/worker/events/stream`;let u=new b(c,{},r,void 0,i,o),f,p=new v(u,new URL(t),{getAuthHeaders:o,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{d(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{p.close(),u.close(),f?.(4090)}catch(e){d(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${l(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});u.setOnEvent(e=>{p.reportDelivery(e.event_id,`received`),p.reportDelivery(e.event_id,`processed`)});let m,h=!1,y=!1;return{write(e){return p.writeEvent(e)},async writeBatch(e){for(let t of e){if(y)break;await p.writeEvent(t)}},close(){y=!0,p.close(),u.close()},isConnectedStatus(){return h},getStateLabel(){return u.isClosedStatus()?`closed`:u.isConnectedStatus()?h?`connected`:`init`:`connecting`},setOnData(e){u.setOnData(e)},setOnClose(e){f=e,u.setOnClose(t=>{p.close(),e(t??4092)})},setOnConnect(e){m=e},getLastSequenceNum(){return u.getLastSequenceNum()},droppedBatchCount:0,reportState(e){p.reportState(e)},reportMetadata(e){p.reportMetadata(e)},reportDelivery(e,t){p.reportDelivery(e,t)},flush(){return p.flush()},connect(){e.outboundOnly||u.connect(),p.initialize(s).then(()=>{h=!0,d(`[bridge:repl] v2 transport ready for writes (epoch=${s}, sse=${u.isConnectedStatus()?`open`:`opening`})`),m?.()},e=>{d(`[bridge:repl] CCR v2 initialize failed: ${l(e)}`,{level:`error`}),p.close(),u.close(),f?.(4091)})}}}e();var D=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{C as a,w as i,T as n,E as r,D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ja as t,Ka as n,ha as r,ot as i,rt as a,za as o}from"./loadAgentsDir-mcRW90aq.js";import{P as s,R as c,c as l,i as u}from"./debug-Dr1SjdXn.js";import{a as d,l as f}from"./proxy-BEKNaTXI.js";import{K as p,M as m,W as h,Y as g,Z as _,et as v,q as y}from"./sessionState-Bn3ESS5f.js";import{n as b,r as x}from"./SSETransport-BBQkdn4e.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${s(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${s(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),c(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,a,o,s,c,u){try{let r=v(c.model),d=t(e,o),f=(await Promise.all(o.map(e=>i(e,{getToolPermissionContext:c.getToolPermissionContext,tools:o,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:m,systemInstruction:b}=g(d,a),x=y(f),C=p(c.toolChoice),w=T({model:r,signal:s,fetchOverride:c.fetchOverride,body:{contents:m,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${r}, messages=${m.length}, tools=${x.length}`);let E=h(w,r),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[_]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:n([t],o,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{a(),u(),o(),O(),m()}))();export{k as queryModelGemini};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$ as t,Da as n,Q as r,Q_ as i,za as a}from"./loadAgentsDir-mcRW90aq.js";import{P as o,R as s,c,i as l}from"./debug-Dr1SjdXn.js";import{s as u,u as d}from"./types-BJ7qTz75.js";import{at as f}from"./sessionState-Bn3ESS5f.js";import{r as p,t as m}from"./sessionTitle-Cbzrb9jT.js";async function h(e,r){let i=m(e);if(!i)return null;try{let e=await t({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:i,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:r,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),a=d(Array.isArray(e.message.content)?n(e.message.content):e.message.content);return a&&typeof a==`object`&&`name`in a&&typeof a.name==`string`?a.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{r(),l(),s(),u(),a(),p(),i()}));export{g as n,h as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-mXq4K0rl.js";function i(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}async function a(e,t=10){if(process.platform===`win32`){let r=await n(`powershell.exe`,[`-NoProfile`,`-Command`,`
|
|
2
2
|
$pid = ${String(e)}
|
|
3
3
|
$ancestors = @()
|
|
4
4
|
for ($i = 0; $i -lt ${t}; $i++) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,m as n,r,u as i}from"./git-CoQQ6YEf.js";n();export{r as findGitRoot,t as getBranch,e as getDefaultBranch,i as getRemoteUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{Wt as a,cr as o}from"./state-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{Wt as a,cr as o}from"./state-BPFYBqm1.js";import{n as s,t as c}from"./cwd-Besi3Os3.js";import{C as ee,f as l,i as te,nt as ne,tt as re,u,x as ie}from"./debug-Dr1SjdXn.js";import{r as ae,t as d}from"./execFileNoThrow-mXq4K0rl.js";import{o as oe}from"./log-27kCA_9u.js";import{n as f,t as se}from"./memoize-Co4vS6UF.js";import{r as ce,t as le}from"./which-mplwBbc0.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as g}from"path";import{readFileSync as _,realpathSync as v,statSync as y,unwatchFile as b,watchFile as de}from"fs";import{createHash as fe}from"crypto";import{readFile as x,readdir as pe,stat as me}from"fs/promises";function S(e,t,n){let r=he();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=u(),o=ee(i)+`
|
|
2
2
|
`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function he(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function ge(e,t,n){let r=Date.now();S(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return S(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw S(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var C=e((()=>{l(),ie()}));async function w(e,t,n,r){try{return _e(await x(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function _e(e,t,n,r){let i=e.split(`
|
|
3
3
|
`),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=xe(t,a,n);continue}if(!s)continue;let r=ve(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ve(e){let t=0;for(;t<e.length&&Se(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:ye(e,t)}}function ye(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
|
|
4
4
|
`;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=be(n)),n}function be(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function xe(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function Se(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var T=e((()=>{}));function Ce(){N.clear()}async function E(e){let t=h(e??c()),n=N.get(t);if(n!==void 0)return n;let r=V(t);if(!r)return N.set(t,null),null;let i=m(r,`.git`);try{if((await me(i)).isFile()){let e=(await x(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return N.set(t,n),n}}return N.set(t,i),i}catch{return N.set(t,null),null}}function D(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function O(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function k(e){try{let t=(await x(m(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return D(e)?{type:`branch`,name:e}:null}if(!D(n))return null;let r=await A(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return O(t)?{type:`detached`,sha:t}:null}catch{return null}}async function A(e,t){let n=await j(e,t);if(n)return n;let r=await M(e);return r&&r!==e?j(r,t):null}async function j(e,t){try{let n=(await x(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return D(t)?A(e,t):null}return O(n)?n:null}catch{}try{let n=await x(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Wt as e,et as t}from"./state-
|
|
1
|
+
import{Wt as e,et as t}from"./state-BPFYBqm1.js";import{c as n,i as r}from"./debug-Dr1SjdXn.js";import{kn as i,wn as a}from"./settings-DiBMs2gM.js";import{c as o,h as s,y as c}from"./config-9rLTDOYW.js";import{S as l,m as u,r as d,x as f}from"./git-CoQQ6YEf.js";import{a as p,i as m,n as h}from"./detectRepository-CMEkS5_2.js";import{realpath as g}from"fs/promises";e(),s(),r(),m(),a(),l(),u();async function _(){try{let e=await h();if(!e){n(`Not in a GitHub repository, skipping path mapping update`);return}let r=t(),i=d(r)??r,a;try{a=(await g(i)).normalize(`NFC`)}catch{a=i}let s=e.toLowerCase(),l=o().githubRepoPaths?.[s]??[];if(l[0]===a){n(`Path ${a} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==a),f=[a,...u];c(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),n(`Added ${a} to tracked paths for repo ${s}`)}catch(e){n(`Error updating repo path mapping: ${e}`)}}function v(e){let t=o(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(i));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await f(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let r=o(),i=e.toLowerCase(),a=r.githubRepoPaths?.[i]??[],s=a.filter(e=>e!==t);if(s.length===a.length)return;let l={...r.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,c(e=>({...e,githubRepoPaths:l})),n(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
2
|
-
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){
|
|
3
|
-
`)}function M(e){return a(e),
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fy as t,Gy as n,Hy as r,Iy as i,Ky as a,Ly as o,Py as s,Ry as c,Vy as l,Wy as u,Xu as d,Yu as f,_l as p,gl as m,hy as h,uy as g,vl as _,zy as v}from"./loadAgentsDir-mcRW90aq.js";import{I as y,P as b,fi as x,t as S}from"./src-P_wYS_NJ2.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{n as w,t as T}from"./PermissionDialog-Cb3z8OUP.js";function E({currentGoal:e,newObjective:t,onConfirm:n,onCancel:r}){function i(e){e===`yes`?n():r()}let a=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(y,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(b,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(y,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(b,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Status: `}),c(e.status)]}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Time: `}),o(e)]}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Tokens: `}),a]})]}),(0,D.jsxs)(y,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(b,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(b,{children:t})]}),(0,D.jsx)(y,{marginTop:1,children:(0,D.jsx)(d,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:i,onCancel:r})})]})})}var D,O=e((()=>{x(),S(),f(),w(),r(),D=C()}));function k(e){let t=e.split(`
|
|
2
|
+
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){h(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=v();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${c(e.status)}`,`Time: ${o(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
|
|
3
|
+
`)}function M(e){return a(e),l(),p(),`Goal set.`}async function N(e,r,a){let o=a.trim();if(!o||o.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let c=o.toLowerCase();if(c===`clear`){let t=s();return t&&(_(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(c===`pause`){let t=u();return t&&(p(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(c===`resume`){if(v()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=n();return t&&p(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(c===`continue`){let t=i();return t&&p(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(c===`complete`){let n=t();return n&&(p(),A()),e(n?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(o.length>F)return e(`Goal objective is too long (${o.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let l=v();return l&&l.status!==`complete`?(0,P.jsx)(E,{currentGoal:l,newObjective:o,onConfirm:()=>{A(),e(M(o),{display:`system`,shouldQuery:!0,displayArgs:k(o),metaMessages:[`<goal-objective-updated>\n${o}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(o),{display:`system`,shouldQuery:!0,displayArgs:k(o),metaMessages:[`<goal-objective-updated>\n${o}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{x(),r(),m(),g(),O(),P=C(),F=4e3,I=80}))();export{N as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Dy as t,Ja as n,Ka as r,cT as i,ha as a,jy as o,ot as s,rt as c,sT as l,za as u}from"./loadAgentsDir-mcRW90aq.js";import{c as d,i as f}from"./debug-Dr1SjdXn.js";import{V as p,W as m}from"./model-C29_32BD.js";import{F as h,I as g,M as _,N as v,R as y,nt as b}from"./sessionState-Bn3ESS5f.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,i,o,c,u){try{let a=b(u.model),f=n(e,o),m=(await Promise.all(o.map(e=>s(e,{getToolPermissionContext:u.getToolPermissionContext,tools:o,agents:u.agents,allowedAgentTypes:u.allowedAgentTypes,model:u.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),_=y(f,i),S=g(m),w=h(u.toolChoice),T=l({maxRetries:0,fetchOverride:u.fetchOverride,source:u.querySource});d(`[Grok] Calling model=${a}, messages=${_.length}, tools=${S.length}`);let E=v(await T.chat.completions.create({model:a,messages:_,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...u.temperatureOverride!==void 0&&{temperature:u.temperatureOverride}},{signal:c}),a),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:r([t],o,u.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&t(p(a,k),k,u.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);d(`[Grok] Error: ${t}`,{level:`error`}),yield a({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{i(),S(),_(),u(),c(),f(),o(),m()}))();export{w as queryModelGrok};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{
|
|
1
|
+
import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{Yd as i,Zd as a}from"./loadAgentsDir-mcRW90aq.js";import{c as o,i as s}from"./debug-Dr1SjdXn.js";import{c,h as l,y as u}from"./config-9rLTDOYW.js";import{a as d,n as f}from"./process-gEbdy6uY.js";import{d as p,f as m,o as h,s as g}from"./log-27kCA_9u.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{l as y,u as b}from"./oauth-D38aRTUb.js";import{$n as x,Bt as S,Kt as C,jt as w,nr as T,rr as E,tr as D}from"./model-C29_32BD.js";import{n as O,t as k}from"./userAgent-DUrr02yh.js";r(),t(),_(),S(),s(),a(),p(),f(),b(),l(),T(),h(),O();var A=1440*60*1e3,j=e(async()=>{if(m())return{success:!1};try{return{success:!0,data:(await E(()=>{let e=x();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.get(`${y().BASE_API_URL}/api/oauth/account/settings`,{headers:{...e.headers,"User-Agent":k()}})})).data}}catch(e){return g(e),j.cache.clear?.(),{success:!1}}});async function M(){try{await E(()=>{let e=x();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.post(`${y().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...e.headers,"User-Agent":k()}})}),j.cache.clear?.()}catch(e){g(e)}}async function N(e){try{await E(()=>{let t=x();if(t.error)throw Error(`Failed to get auth headers: ${t.error}`);return n.patch(`${y().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:e},{headers:{...t.headers,"User-Agent":k()}})}),j.cache.clear?.()}catch(e){g(e)}}async function P(){if(!C())return!1;let e=w()?.accountUuid;if(!e)return!1;let t=c().groveConfigCache?.[e];return t?Date.now()-t.timestamp>A?(o(`Grove: Cache stale, returning cached data and refreshing in background`),F(e),t.grove_enabled):(o(`Grove: Using fresh cached config`),t.grove_enabled):(o(`Grove: No cache, fetching config in background (dialog skipped this session)`),F(e),!1)}async function F(e){try{let t=await I();if(!t.success)return;let n=t.data.grove_enabled,r=c().groveConfigCache?.[e];if(r?.grove_enabled===n&&Date.now()-r.timestamp<=A)return;u(t=>({...t,groveConfigCache:{...t.groveConfigCache,[e]:{grove_enabled:n,timestamp:Date.now()}}}))}catch(e){o(`Grove: Failed to fetch and store config: ${e}`)}}var I=e(async()=>{if(m())return{success:!1};try{let{grove_enabled:e,domain_excluded:t,notice_is_grace_period:r,notice_reminder_frequency:i}=(await E(()=>{let e=x();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.get(`${y().BASE_API_URL}/api/claude_code_grove`,{headers:{...e.headers,"User-Agent":D()},timeout:3e3})})).data;return{success:!0,data:{grove_enabled:e,domain_excluded:t??!1,notice_is_grace_period:r??!0,notice_reminder_frequency:i}}}catch(e){return o(`Failed to fetch Grove notice config: ${e}`),{success:!1}}});function L(e,t,n){if(!e.success||!t.success)return!1;let r=e.data,i=t.data;if(r.grove_enabled!==null)return!1;if(n||!i.notice_is_grace_period)return!0;let a=i.notice_reminder_frequency;return a!==null&&r.grove_notice_viewed_at?Math.floor((Date.now()-new Date(r.grove_notice_viewed_at).getTime())/(1e3*60*60*24))>=a:r.grove_notice_viewed_at==null}async function R(){let[e,t]=await Promise.all([j(),I()]);if(L(e,t,!1)){let e=t.success?t.data:null;v(`tengu_grove_print_viewed`,{dismissable:e?.notice_is_grace_period}),e===null||e.notice_is_grace_period?(d(`
|
|
2
2
|
An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms.
|
|
3
3
|
|
|
4
4
|
`),await M()):(d(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{DC as n,Di as r,EC as i,MC as a,Mi as o,OC as s,Xu as c,Zu as l,zi as u}from"./loadAgentsDir-mcRW90aq.js";import{I as d,Lt as f,P as p,Wt as m,a as h,fi as g,n as _,ot as v,r as y,t as b,x}from"./src-P_wYS_NJ2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{b as C,y as w}from"./startupProfiler-Dc5r6LgE.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-CPLBDluY.js";import{n as D,r as O}from"./modalContext-CUThy6Ph.js";import{n as k,t as A}from"./PromptInputHelpMenu-BgADIzRj.js";function j({commands:e,maxHeight:t,columns:n,title:r,onCancel:i,emptyMessage:a}){let{headerFocused:s,focusHeader:l}=h(),u=Math.max(1,n-10),f=Math.max(1,Math.floor((t-10)/2)),m=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:C(o(e),u,!0)}))},[e,u]);return(0,N.jsx)(d,{flexDirection:`column`,paddingY:1,children:e.length===0&&a?(0,N.jsx)(p,{dimColor:!0,children:a}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(p,{children:r}),(0,N.jsx)(d,{marginTop:1,children:(0,N.jsx)(c,{options:m,visibleOptionCount:f,onCancel:i,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:l,isDisabled:s})})]})})}var M,N,P=e((()=>{g(),M=t(g(),1),u(),w(),b(),l(),N=S()}));function F(){return(0,I.jsxs)(d,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(p,{bold:!0,children:`Getting started`}),(0,I.jsxs)(d,{flexDirection:`column`,children:[(0,I.jsxs)(p,{children:[(0,I.jsx)(p,{bold:!0,children:`1. `}),(0,I.jsx)(p,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,I.jsxs)(p,{children:[(0,I.jsx)(p,{bold:!0,children:`2. `}),(0,I.jsx)(p,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(p,{children:[(0,I.jsx)(p,{bold:!0,children:`3. `}),(0,I.jsx)(p,{children:`Type `}),(0,I.jsx)(p,{bold:!0,children:`/help`}),(0,I.jsx)(p,{children:` for commands, or `}),(0,I.jsx)(p,{bold:!0,children:`?`}),(0,I.jsx)(p,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(d,{flexDirection:`column`,children:[(0,I.jsx)(d,{children:(0,I.jsx)(p,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{g(),b(),k(),I=S()}));function R({onClose:e,commands:t}){let{rows:n,columns:i}=v(),a=Math.floor(n/2),o=O(),c=()=>e(`Help dialog dismissed`,{display:`system`});m(`help:dismiss`,c,{context:`Help`});let l=T(c),u=s(`help:dismiss`,`Help`,`esc`),h=r(),g=t.filter(e=>h.has(e.name)&&!e.isHidden),b=t.filter(e=>!h.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(_,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(_,{title:`commands`,children:(0,z.jsx)(j,{commands:g,maxHeight:a,columns:i,title:`Browse default commands:`,onCancel:c})},`commands`)),S.push((0,z.jsx)(_,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:a,columns:i,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:c})},`custom`)),(0,z.jsx)(d,{flexDirection:`column`,height:o?void 0:a,children:(0,z.jsxs)(x,{color:`professionalBlue`,children:[(0,z.jsx)(y,{title:`Work Mate v0.0.13`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(d,{marginTop:1,children:(0,z.jsxs)(p,{children:[`For more help: `,(0,z.jsx)(f,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(d,{marginTop:1,children:(0,z.jsx)(p,{dimColor:!0,children:l.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,l.keyName,` again to exit`]}):(0,z.jsxs)(p,{italic:!0,children:[u,` to cancel`]})})})]})})}var z,B=e((()=>{g(),E(),n(),u(),D(),a(),b(),i(),P(),L(),z=S()})),V,H;e((()=>{B(),V=S(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$c as o,Bp as s,EC as c,Hp as l,Lp as u,Rp as d,Up as f,Vp as p,Xu as m,Zu as h,cg as g,el as _,ig as v,lg as y,ng as b,rg as ee,zp as x}from"./loadAgentsDir-mcRW90aq.js";import{I as S,Lt as C,P as w,Wt as T,fi as E,t as D,y as O}from"./src-P_wYS_NJ2.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as te,lt as ne}from"./state-BPFYBqm1.js";import{c as A,f as j,g as M}from"./settings-DiBMs2gM.js";import{n as N,r as re}from"./analytics-DJobLaWP.js";import{l as P,o as F}from"./stringUtils-Df-Lnjxd.js";function ie(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);u(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=ne();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}}}return n}function ae(e,t){return f(Object.keys(e[t]||{}),e,t)}function oe(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),te(),l(),L=n(function(e){return{PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
|
|
2
2
|
Exit code 0 - stdout/stderr not shown
|
|
3
3
|
Exit code 2 - show stderr to model and block tool call
|
|
4
4
|
Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
|
|
@@ -59,7 +59,7 @@ Exit code 2 - block the response (action becomes decline)
|
|
|
59
59
|
Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`mcp_server_name`,values:[]}},ConfigChange:{summary:`When configuration files change during a session`,description:`Input to command is JSON with source (user_settings, project_settings, local_settings, policy_settings, skills) and file_path.
|
|
60
60
|
Exit code 0 - allow the change
|
|
61
61
|
Exit code 2 - block the change from being applied to the session
|
|
62
|
-
Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`source`,values:[`user_settings`,`project_settings`,`local_settings`,`policy_settings`,`skills`]}},InstructionsLoaded:{summary:`When an instruction file (
|
|
62
|
+
Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`source`,values:[`user_settings`,`project_settings`,`local_settings`,`policy_settings`,`skills`]}},InstructionsLoaded:{summary:`When an instruction file (AGENTS.md or rule) is loaded`,description:`Input to command is JSON with file_path, memory_type (User, Project, Local, Managed), load_reason (session_start, nested_traversal, path_glob_match, include, compact), globs (optional — the paths: frontmatter patterns that matched), trigger_file_path (optional — the file Claude touched that caused the load), and parent_file_path (optional — the file that @-included this one).
|
|
63
63
|
Exit code 0 - command completes successfully
|
|
64
64
|
Other exit codes - show stderr to user only
|
|
65
65
|
This hook is observability-only and does not support blocking.`,matcherMetadata:{fieldToMatch:`load_reason`,values:[`session_start`,`nested_traversal`,`path_glob_match`,`include`,`compact`]}},WorktreeCreate:{summary:`Create an isolated worktree for VCS-agnostic isolation`,description:`Input to command is JSON with name (suggested worktree slug).
|
|
@@ -76,4 +76,4 @@ CLAUDE_ENV_FILE is set — write bash exports there to apply env to subsequent B
|
|
|
76
76
|
The matcher field specifies filenames to watch in the current directory (e.g. ".envrc|.env").
|
|
77
77
|
Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to dynamically update the watch list.
|
|
78
78
|
Exit code 0 - command completes successfully
|
|
79
|
-
Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:o}){return(0,B.jsx)(
|
|
79
|
+
Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:o}){return(0,B.jsx)(O,{title:`Hooks`,subtitle:`${n} ${P(n,`hook`)} configured`,onCancel:o,children:(0,B.jsxs)(S,{flexDirection:`column`,gap:1,children:[r&&(0,B.jsxs)(S,{flexDirection:`column`,children:[(0,B.jsxs)(w,{color:`suggestion`,children:[a.info,` Hooks Restricted by Policy`]}),(0,B.jsx)(w,{dimColor:!0,children:`Only hooks from managed settings can run. User-defined hooks from ~/.workmate/settings.json, .workmate/settings.json, and .workmate/settings.local.json are blocked.`})]}),(0,B.jsx)(S,{flexDirection:`column`,children:(0,B.jsxs)(w,{dimColor:!0,children:[a.info,` This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.`,` `,(0,B.jsx)(C,{url:`https://code.workmate.com/docs/en/hooks`,children:`Learn more`})]})}),(0,B.jsx)(S,{flexDirection:`column`,children:(0,B.jsx)(m,{onChange:e=>{i(e)},onCancel:o,options:Object.entries(e).map(([e,n])=>{let r=t[e]||0;return{label:r>0?(0,B.jsxs)(w,{children:[e,` `,(0,B.jsxs)(w,{color:`suggestion`,children:[`(`,r,`)`]})]}):e,value:e,description:n.summary}})})})]})})}var B,V=e((()=>{i(),E(),D(),F(),h(),B=k()}));function H({selectedEvent:e,selectedMatcher:t,hooksForSelectedMatcher:n,hookEventMetadata:r,onSelect:i,onCancel:a}){let o=r.matcherMetadata===void 0?e:`${e} - Matcher: ${t||`(all)`}`;return n.length===0?(0,U.jsx)(O,{title:o,subtitle:r.description,onCancel:a,inputGuide:()=>(0,U.jsx)(w,{children:`Esc to go back`}),children:(0,U.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(w,{dimColor:!0,children:`No hooks configured for this event.`}),(0,U.jsx)(w,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,U.jsx)(O,{title:o,subtitle:r.description,onCancel:a,children:(0,U.jsx)(S,{flexDirection:`column`,children:(0,U.jsx)(m,{options:n.map((e,t)=>({label:`[${e.config.type}] ${d(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${s(e.source)} (${e.pluginName})`:s(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{E(),D(),l(),h(),U=k()}));function G({selectedEvent:e,matchersForSelectedEvent:t,hooksByEventAndMatcher:n,eventDescription:r,onSelect:i,onCancel:a}){let o=K.useMemo(()=>t.map(t=>{let r=n[e]?.[t]||[];return{matcher:t,sources:Array.from(new Set(r.map(e=>e.source))),hookCount:r.length}}),[t,n,e]);return t.length===0?(0,q.jsx)(O,{title:`${e} - Matchers`,subtitle:r,onCancel:a,inputGuide:()=>(0,q.jsx)(w,{children:`Esc to go back`}),children:(0,q.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(w,{dimColor:!0,children:`No hooks configured for this event.`}),(0,q.jsx)(w,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,q.jsx)(O,{title:`${e} - Matchers`,subtitle:r,onCancel:a,children:(0,q.jsx)(S,{flexDirection:`column`,children:(0,q.jsx)(m,{options:o.map(e=>({label:`[${e.sources.map(p).join(`, `)}] ${e.matcher||`(all)`}`,value:e.matcher,description:`${e.hookCount} ${P(e.hookCount,`hook`)}`})),onChange:e=>{i(e)},onCancel:a})})})}var K,q,se=e((()=>{K=t(E(),1),D(),l(),F(),h(),q=k()}));function ce({selectedHook:e,eventSupportsMatcher:t,onCancel:n}){return(0,J.jsx)(O,{title:`Hook details`,onCancel:n,inputGuide:()=>(0,J.jsx)(w,{children:`Esc to go back`}),children:(0,J.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(S,{flexDirection:`column`,children:[(0,J.jsxs)(w,{children:[`Event: `,(0,J.jsx)(w,{bold:!0,children:e.event})]}),t&&(0,J.jsxs)(w,{children:[`Matcher: `,(0,J.jsx)(w,{bold:!0,children:e.matcher||`(all)`})]}),(0,J.jsxs)(w,{children:[`Type: `,(0,J.jsx)(w,{bold:!0,children:e.config.type})]}),(0,J.jsxs)(w,{children:[`Source: `,(0,J.jsx)(w,{dimColor:!0,children:x(e.source)})]}),e.pluginName&&(0,J.jsxs)(w,{children:[`Plugin: `,(0,J.jsx)(w,{dimColor:!0,children:e.pluginName})]})]}),(0,J.jsxs)(S,{flexDirection:`column`,children:[(0,J.jsxs)(w,{dimColor:!0,children:[le(e.config),`:`]}),(0,J.jsx)(S,{borderStyle:`round`,borderDimColor:!0,paddingLeft:1,paddingRight:1,children:(0,J.jsx)(w,{children:ue(e.config)})})]}),`statusMessage`in e.config&&e.config.statusMessage&&(0,J.jsxs)(w,{children:[`Status message: `,(0,J.jsx)(w,{dimColor:!0,children:e.config.statusMessage})]}),(0,J.jsx)(w,{dimColor:!0,children:`To modify or remove this hook, edit settings.json directly or ask Claude to help.`})]})})}function le(e){switch(e.type){case`command`:return`Command`;case`prompt`:return`Prompt`;case`agent`:return`Prompt`;case`http`:return`URL`}}function ue(e){switch(e.type){case`command`:return e.command;case`prompt`:return e.prompt;case`agent`:return e.prompt;case`http`:return e.url}}var J,Y=e((()=>{E(),D(),l(),J=k()}));function de({toolNames:e,onExit:t}){let[n,r]=(0,X.useState)({mode:`select-event`}),[i,a]=(0,X.useState)(()=>j()?.disableAllHooks===!0&&A(`policySettings`)?.disableAllHooks===!0),[o,s]=(0,X.useState)(()=>A(`policySettings`)?.allowManagedHooksOnly===!0);y(e=>{if(e===`policySettings`){let e=j()?.disableAllHooks===!0;a(e&&A(`policySettings`)?.disableAllHooks===!0),s(A(`policySettings`)?.allowManagedHooksOnly===!0)}});let c=n.mode,l=`event`in n?n.event:`PreToolUse`,u=`matcher`in n?n.matcher:null,d=ee(e=>e.mcp),f=v(),p=(0,X.useMemo)(()=>[...e,...d.tools.map(e=>e.name)],[e,d.tools]),m=(0,X.useMemo)(()=>ie(f.getState(),p),[p,f]),h=(0,X.useMemo)(()=>ae(m,l),[m,l]),g=(0,X.useMemo)(()=>oe(m,l,u),[m,l,u]),_=(0,X.useCallback)(()=>{t(`Hooks dialog dismissed`,{display:`system`})},[t]);T(`confirm:no`,_,{context:`Confirmation`,isActive:c===`select-event`}),T(`confirm:no`,()=>{r({mode:`select-event`})},{context:`Confirmation`,isActive:c===`select-matcher`}),T(`confirm:no`,()=>{`event`in n&&(I(n.event,p)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event}))},{context:`Confirmation`,isActive:c===`select-hook`}),T(`confirm:no`,()=>{if(n.mode===`view-hook`){let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}},{context:`Confirmation`,isActive:c===`view-hook`});let b=L(p),x=j()?.disableAllHooks===!0,{hooksByEvent:C,totalHooksCount:E}=(0,X.useMemo)(()=>{let e={},t=0;for(let[n,r]of Object.entries(m)){let i=Object.values(r).reduce((e,t)=>e+t.length,0);e[n]=i,t+=i}return{hooksByEvent:e,totalHooksCount:t}},[m]);if(x)return(0,Z.jsx)(O,{title:`Hook Configuration - Disabled`,onCancel:_,inputGuide:()=>(0,Z.jsx)(w,{children:`Esc to close`}),children:(0,Z.jsxs)(S,{flexDirection:`column`,gap:1,children:[(0,Z.jsxs)(S,{flexDirection:`column`,children:[(0,Z.jsxs)(w,{children:[`All hooks are currently `,(0,Z.jsx)(w,{bold:!0,children:`disabled`}),i&&` by a managed settings file`,`. You have `,(0,Z.jsx)(w,{bold:!0,children:E}),` `,`configured `,P(E,`hook`),` that `,P(E,`is`,`are`),` not running.`]}),(0,Z.jsx)(S,{marginTop:1,children:(0,Z.jsx)(w,{dimColor:!0,children:`When hooks are disabled:`})}),(0,Z.jsx)(w,{dimColor:!0,children:`· No hook commands will execute`}),(0,Z.jsx)(w,{dimColor:!0,children:`· StatusLine will not be displayed`}),(0,Z.jsx)(w,{dimColor:!0,children:`· Tool operations will proceed without hook validation`})]}),!i&&(0,Z.jsx)(w,{dimColor:!0,children:`To re-enable hooks, remove "disableAllHooks" from settings.json or ask Claude.`})]})});switch(n.mode){case`select-event`:return(0,Z.jsx)(z,{hookEventMetadata:b,hooksByEvent:C,totalHooksCount:E,restrictedByPolicy:o,onSelectEvent:e=>{I(e,p)===void 0?r({mode:`select-hook`,event:e,matcher:``}):r({mode:`select-matcher`,event:e})},onCancel:_});case`select-matcher`:return(0,Z.jsx)(G,{selectedEvent:n.event,matchersForSelectedEvent:h,hooksByEventAndMatcher:m,eventDescription:b[n.event].description,onSelect:e=>{r({mode:`select-hook`,event:n.event,matcher:e})},onCancel:()=>{r({mode:`select-event`})}});case`select-hook`:return(0,Z.jsx)(H,{selectedEvent:n.event,selectedMatcher:n.matcher,hooksForSelectedMatcher:g,hookEventMetadata:b[n.event],onSelect:e=>{r({mode:`view-hook`,event:n.event,hook:e})},onCancel:()=>{I(n.event,p)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event})}});case`view-hook`:return(0,Z.jsx)(ce,{selectedHook:n.hook,eventSupportsMatcher:I(n.event,p)!==void 0,onCancel:()=>{let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}})}}var X,Z,fe=e((()=>{E(),X=t(E(),1),b(),g(),D(),c(),R(),M(),F(),V(),W(),se(),Y(),Z=k()})),Q,$;e((()=>{fe(),N(),_(),Q=k(),$=async(e,t)=>{re(`tengu_hooks_command`,{});let n=t.getAppState().toolPermissionContext;return(0,Q.jsx)(de,{toolNames:o(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Yt as e,_n as t,gn as n,ln as r}from"./loadAgentsDir-mcRW90aq.js";t();export{e as executeSessionEndHooks,r as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|