@readmagic/workmate 0.0.23 → 0.0.24
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-OgcBcK5A.js → AddWorkspaceDirectory-Ch8IcWXO.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-CNEifEyV.js → AgentsMdExternalIncludesDialog-LjI_H_Au.js} +1 -1
- package/dist/chunks/{App-B-3tPQ3k.js → App-BOqh_1tN.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-COuhHcey.js → BackgroundTasksDialog-CSEuuoq9.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-bJek4siJ.js → BypassPermissionsModeDialog-CwfCwUr9.js} +1 -1
- package/dist/chunks/CustomSelect-wmZ9jz0W.js +1 -0
- package/dist/chunks/{DiffDialog-B3X9FMpO.js → DiffDialog-BpXIEWiE.js} +1 -1
- package/dist/chunks/Doctor-CMpr7tdf.js +1 -0
- package/dist/chunks/{Doctor-6PXyjIi6.js → Doctor-DqW6j3_B.js} +1 -1
- package/dist/chunks/{ExitFlow-DgAZp_8U.js → ExitFlow-DacaBTlk.js} +1 -1
- package/dist/chunks/{Grove-CHatOzcE.js → Grove-CNqYPWI6.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-DXL92MN9.js → InvalidConfigDialog-0TMJItCC.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-Dtmpzeps.js → InvalidSettingsDialog-iwh8H52b.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-DA37QUFs.js → KeybindingProviderSetup-D49HHTXD.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-thZd-xA_.js → MCPConnectionManager-Cie77ZAK.js} +1 -1
- package/dist/chunks/{MCPToolListView-CpY-YJg4.js → MCPToolListView-B4ehtkXd.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-JvChf3xr.js → McpParsingWarnings-Bff66RtJ.js} +1 -1
- package/dist/chunks/{MessageSelector-C0_iw7SI.js → MessageSelector-Dpd6Iywp.js} +1 -1
- package/dist/chunks/{Messages-K4DDsDP9.js → Messages-DN7M3oS_.js} +1 -1
- package/dist/chunks/{Onboarding-C1UdzM-1.js → Onboarding-CQmE3rUf.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-AyLog8p7.js → PromptInputFooterSuggestions-HI6HH3TP.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-oyic20ip.js → PromptInputHelpMenu-3QNUC2Cg.js} +1 -1
- package/dist/chunks/{ProviderSetup-XcBHjUnd.js → ProviderSetup-BCSPsvfv.js} +1 -1
- package/dist/chunks/{QueryEngine-DYxBjJ4i.js → QueryEngine-DdLWvJv6.js} +1 -1
- package/dist/chunks/{REPL-CQBJRrT0.js → REPL-BqO9KcK_.js} +5 -5
- package/dist/chunks/REPL-CmZmypfF.js +1 -0
- package/dist/chunks/{ResumeConversation-Dl8H9Gfy.js → ResumeConversation-DBqX7gva.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +1 -0
- package/dist/chunks/{SelectMulti-Bc6l11_K.js → SelectMulti-BQRHed-d.js} +1 -1
- package/dist/chunks/{Settings-TGp3fPrS.js → Settings-B-7yBewS.js} +3 -3
- package/dist/chunks/{Spinner-zYPFVFHN.js → Spinner-ByQXTvAA.js} +1 -1
- package/dist/chunks/{TextInput-CD9iau2k.js → TextInput-B8ruWRf2.js} +1 -1
- package/dist/chunks/{ThemePicker-0F0hZYPX.js → ThemePicker-BQErFFW1.js} +1 -1
- package/dist/chunks/{TrustDialog-C76YiMKz.js → TrustDialog-BIhz6AZE.js} +1 -1
- package/dist/chunks/{_baseEach-4ff-vRlp.js → _baseEach-CsIRoaTH.js} +1 -1
- package/dist/chunks/{add-dir-JMsRLGfx.js → add-dir-CrUDs19x.js} +1 -1
- package/dist/chunks/{agentDisplay-BReJUBWg.js → agentDisplay-M4pfwbMC.js} +1 -1
- package/dist/chunks/{agents-9qQ8I6zW.js → agents-CGaCQeLw.js} +1 -1
- package/dist/chunks/{agents-B3x8yJ_r.js → agents-DddX7lLX.js} +1 -1
- package/dist/chunks/{allErrors-DfWylHSw.js → allErrors-BF73lon8.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-CVNIhQg8.js → backgroundHousekeeping-Bq3LMsVR.js} +2 -2
- package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +1 -0
- package/dist/chunks/{branch-C4TsMEkx.js → branch-Yg_taNlT.js} +1 -1
- package/dist/chunks/{btw-Dn1eYFAz.js → btw-udbprVvu.js} +1 -1
- package/dist/chunks/caches-ChjIEcdd.js +1 -0
- package/dist/chunks/{caches-DArHxBgL.js → caches-DLJ6urv-.js} +1 -1
- package/dist/chunks/{clear-Bdhb6b39.js → clear-B8ZtFPOK.js} +1 -1
- package/dist/chunks/commands-CVCpJo7M.js +1 -0
- package/dist/chunks/{compact-Bu9BUpxV.js → compact-izk6RKHQ.js} +1 -1
- package/dist/chunks/config-CFqpXMFX.js +1 -0
- package/dist/chunks/{context-CY_yfdYa.js → context-BbVm4SWK.js} +1 -1
- package/dist/chunks/{context-noninteractive-Dd4xIoP1.js → context-noninteractive-C7wrRZnM.js} +1 -1
- package/dist/chunks/context-noninteractive-x0HAzWhc.js +1 -0
- package/dist/chunks/conversation-DouVzO0K.js +1 -0
- package/dist/chunks/{conversation-DUu9qBnq.js → conversation-DrVkifKy.js} +1 -1
- package/dist/chunks/{conversationRecovery-2ft8sCPE.js → conversationRecovery-DliPBo_z.js} +1 -1
- package/dist/chunks/{crossProjectResume-6boHMUBx.js → crossProjectResume-DxMy05_P.js} +1 -1
- package/dist/chunks/{datadog-BPuGcxxC.js → datadog-Cu3s7P48.js} +1 -1
- package/dist/chunks/{diff-BOAElpfQ.js → diff-DdpHThJ7.js} +1 -1
- package/dist/chunks/doctor-D_kV_D_l.js +1 -0
- package/dist/chunks/{entry-TNOoyy7_.js → entry-Bxseqbi_.js} +1 -1
- package/dist/chunks/{esm-eTAUP-La.js → esm-BXTZz3av.js} +1 -1
- package/dist/chunks/{exit-DXApFJIP.js → exit-C_R_FgzR.js} +1 -1
- package/dist/chunks/{extraUsage-CmQaLPV1.js → extraUsage-xMuDiNKh.js} +1 -1
- package/dist/chunks/extractMemories-D4Dl1itt.js +1 -0
- package/dist/chunks/{fast-eGx2IxD7.js → fast-DH-C5IZs.js} +1 -1
- package/dist/chunks/fast-bopOPrtf.js +1 -0
- package/dist/chunks/fetchModelList-DC4VQpqa.js +1 -0
- package/dist/chunks/{fetchModelList-CxLsVNsu.js → fetchModelList-FE8tzTDc.js} +1 -1
- package/dist/chunks/{fileSuggestions-DHxdwq28.js → fileSuggestions-C-9unnoJ.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-M6UMli2c.js → firstPartyEventLogger-QmjjQmgt.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +1 -0
- package/dist/chunks/{gemini-D_ORb_L6.js → gemini-C_ApXgwc.js} +1 -1
- package/dist/chunks/{generateSessionName-BQoDduyA.js → generateSessionName-CQ03xlYI.js} +1 -1
- package/dist/chunks/{goal-D7c2mSds.js → goal-CdL29Y8C.js} +1 -1
- package/dist/chunks/{grok-B2-ZbUiR.js → grok-C6WAslUT.js} +1 -1
- package/dist/chunks/{help-CZJdRviD.js → help-DxanITNN.js} +1 -1
- package/dist/chunks/{history-CQiUERTL.js → history-BMycjPTT.js} +1 -1
- package/dist/chunks/hooks-D9ApLkBp.js +1 -0
- package/dist/chunks/{hooks-DIvN6gdv.js → hooks-DR3IYPJ3.js} +1 -1
- package/dist/chunks/{install-T_CV1Slu.js → install-0D9u2dZw.js} +1 -1
- package/dist/chunks/{instrumentation-BjqUZ383.js → instrumentation-BFiGwntt.js} +3 -3
- package/dist/chunks/{job-R6c4-3c8.js → job-YhJQWgE0.js} +1 -1
- package/dist/chunks/{keybindings-CLRaiL_Z.js → keybindings-DZrF9iNd.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DrbKrwXc.js → launchLocalMemory-DhJ56KDc.js} +1 -1
- package/dist/chunks/{launchOnboarding-tqsMD8ni.js → launchOnboarding-DmMoZwv5.js} +1 -1
- package/dist/chunks/{loadAgentsDir-DlPbtIsS.js → loadAgentsDir-B0Anodo0.js} +23 -23
- package/dist/chunks/loadAgentsDir-BbUR6pqH.js +1 -0
- package/dist/chunks/{loadPluginHooks-C_msxVIc.js → loadPluginHooks-BSwCtQ6T.js} +1 -1
- package/dist/chunks/{localSearch-CK-sFzPm.js → localSearch-BxLYi6w_.js} +1 -1
- package/dist/chunks/localSearch-zfn7jgrh.js +1 -0
- package/dist/chunks/{logoUtils-x2pHV-Nl.js → logoUtils-CRxTutvr.js} +1 -1
- package/dist/chunks/{magicDocs-BEF8D3if.js → magicDocs-Bkz7ZcmL.js} +1 -1
- package/dist/chunks/{main-kOVUGxOS.js → main-9ksgUUY_.js} +5 -5
- package/dist/chunks/{mcp-D0wAJrRT.js → mcp-ChF12reQ.js} +1 -1
- package/dist/chunks/{mcp-mgOlm1cY.js → mcp-DoEl5uah.js} +1 -1
- package/dist/chunks/{mcp-BNd29r6p.js → mcp-hp9qqjAy.js} +2 -2
- package/dist/chunks/{memory-DDLk9_LJ.js → memory-Qv-wGNQ5.js} +1 -1
- package/dist/chunks/{mode-CcNsWgK3.js → mode-bFXPCR2P.js} +1 -1
- package/dist/chunks/{model-DzCP4K-9.js → model-6lkW4o2c.js} +1 -1
- package/dist/chunks/{model-BwBG0V1u.js → model-BvQFFOf8.js} +1 -1
- package/dist/chunks/{modelOptions-DRaG3bo0.js → modelOptions-BBvF3wHK.js} +1 -1
- package/dist/chunks/{nativeInstaller-C3pVPqrZ.js → nativeInstaller-CdjmE9Zy.js} +1 -1
- package/dist/chunks/{notifications-4wP1Tx9Y.js → notifications-Bc6k-Ozy.js} +1 -1
- package/dist/chunks/{onChangeAppState-BlaoFbYF.js → onChangeAppState-DLjZ1x95.js} +1 -1
- package/dist/chunks/{openai-CDN71NdX.js → openai-D46QvESE.js} +1 -1
- package/dist/chunks/{overlayContext-BT2Lq8ei.js → overlayContext-8--_fbvY.js} +1 -1
- package/dist/chunks/{partition-CIl_ORUT.js → partition-DznN4XZH.js} +1 -1
- package/dist/chunks/{permissions-zSNOZSwr.js → permissions-DmGFViHI.js} +1 -1
- package/dist/chunks/{pidLock-BTqO-h7Y.js → pidLock-Cm4sW35f.js} +2 -2
- package/dist/chunks/{plan-Bs6em6lk.js → plan-CzGBz_87.js} +1 -1
- package/dist/chunks/{plugin-DDDxjBa0.js → plugin-CluR79xX.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-8qugAFhb.js → pluginAutoupdate-ennb9k8_.js} +1 -1
- package/dist/chunks/{pluginBlocklist-q01ackCf.js → pluginBlocklist-9OrNEh--.js} +1 -1
- package/dist/chunks/{pluginCliCommands-DXZfCZsv.js → pluginCliCommands-CJv5uhOG.js} +1 -1
- package/dist/chunks/{pluginFlagging-BG2MHCQJ.js → pluginFlagging-js_-WmYj.js} +1 -1
- package/dist/chunks/{pluginOperations-hXYLrzM2.js → pluginOperations-CcUSHAIa.js} +1 -1
- package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +1 -0
- package/dist/chunks/{pluginStartupCheck-DTMa6TgL.js → pluginStartupCheck-SRXOyqr7.js} +1 -1
- package/dist/chunks/{plugins-COoGBYk6.js → plugins-IwwaCDba.js} +1 -1
- package/dist/chunks/{print-BASybEtO.js → print-CgszM1ea.js} +2 -2
- package/dist/chunks/{processBashCommand-DDi_Pymt.js → processBashCommand-D098WsqY.js} +1 -1
- package/dist/chunks/{processSlashCommand-Cq9kaoSF.js → processSlashCommand-DOQFjJ88.js} +1 -1
- package/dist/chunks/prompt-BKPmDAuL.js +1 -0
- package/dist/chunks/{prompt-mM79EGnT.js → prompt-CJ1l3XXk.js} +1 -1
- package/dist/chunks/prompt-CgOklk7z.js +1 -0
- package/dist/chunks/{promptEditor-DLGN_eLu.js → promptEditor-DoGHJN_W.js} +1 -1
- package/dist/chunks/{reconciler-CeXqh95g.js → reconciler-ykkSPR-i.js} +1 -1
- package/dist/chunks/{refresh-Ce2yk28a.js → refresh-Dn_I1R4v.js} +1 -1
- package/dist/chunks/{reject-Bld5E-bn.js → reject-DtcCfuZV.js} +1 -1
- package/dist/chunks/{reload-plugins-C42xSB5l.js → reload-plugins-CQZFQLWP.js} +1 -1
- package/dist/chunks/{rename-CtBghpxZ.js → rename-DyEfsZiq.js} +1 -1
- package/dist/chunks/{resume-BWkaTDqd.js → resume-BcXEDUqZ.js} +1 -1
- package/dist/chunks/{runtimeObserver-1wQO8HSZ.js → runtimeObserver-DEuR8z0f.js} +1 -1
- package/dist/chunks/{runtimeObserver-XQrOux41.js → runtimeObserver-PJ1o8GRA.js} +2 -2
- package/dist/chunks/sandbox-adapter-DfB9kgQD.js +1 -0
- package/dist/chunks/{sandbox-toggle-Dir9Polo.js → sandbox-toggle-D9GDUsTl.js} +1 -1
- package/dist/chunks/searchExtraTools-D4gMMQv0.js +1 -0
- package/dist/chunks/{select-Bxf5-5sI.js → select-DIxfl_VN.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +1 -0
- package/dist/chunks/{sessionObserver-DS4G6mb9.js → sessionObserver-BtKjvteq.js} +1 -1
- package/dist/chunks/sessionObserver-D6qzEdGJ.js +1 -0
- package/dist/chunks/sessionStorage-C_7gow_z.js +1 -0
- package/dist/chunks/{sessionTracing-BoDDYLxW.js → sessionTracing-CtbeAD0s.js} +1 -1
- package/dist/chunks/{setup-BRypY6iT.js → setup-qecdf-ES.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-BRxZjobz.js → shadowedRuleDetection-Bg_aIc5Z.js} +1 -1
- package/dist/chunks/{sideQuestion-DLJxyrlp.js → sideQuestion-D49GsfH7.js} +1 -1
- package/dist/chunks/sinks-C-lP7uyO.js +1 -0
- package/dist/chunks/{sinks-Cz2HfgMU.js → sinks-De-B1lPQ.js} +1 -1
- package/dist/chunks/{skillChangeDetector-xviGstqm.js → skillChangeDetector-DkOJoNhT.js} +1 -1
- package/dist/chunks/{skillGapStore-CKN_d3pO.js → skillGapStore-CcFoHNLl.js} +2 -2
- package/dist/chunks/{skillLifecycle-BMY2JGGG.js → skillLifecycle-Bnz_4wE5.js} +2 -2
- package/dist/chunks/{skillSearchPanel-D9trHULQ.js → skillSearchPanel-C_5yUhqn.js} +2 -2
- package/dist/chunks/{skills-CX_AvwLG.js → skills-BE5scC-g.js} +1 -1
- package/dist/chunks/status-Dw09WZLd.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-vFVgIYuw.js → statusNoticeHelpers-BRQpUIlH.js} +1 -1
- package/dist/chunks/switcher-CgZVah7U.js +1 -0
- package/dist/chunks/{switcher-CAajZeNL.js → switcher-DZwUo5Ed.js} +1 -1
- package/dist/chunks/{tasks-BWNQr2d3.js → tasks-DdcUQEeD.js} +1 -1
- package/dist/chunks/{templateJobs-gUET39Ho.js → templateJobs-C8qsPrLj.js} +1 -1
- package/dist/chunks/{theme-B7fKI6E5.js → theme-f1h2QI8J.js} +1 -1
- package/dist/chunks/{tipRegistry-DamZr34w.js → tipRegistry-B71o4qWr.js} +1 -1
- package/dist/chunks/{toolEventObserver-BL06sDI4.js → toolEventObserver-7QP38x4t.js} +1 -1
- package/dist/chunks/{toolPool-CX5wDBi1.js → toolPool-V-7Yv0GA.js} +1 -1
- package/dist/chunks/{use-select-navigation-BiUJdWai.js → use-select-navigation-hWL5VHnL.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js → useExitOnCtrlCDWithKeybindings-BKwzUpgb.js} +1 -1
- package/dist/chunks/useMainLoopModel-DxvV70Ru.js +1 -0
- package/dist/chunks/{useManagePlugins-BqfIVa6E.js → useManagePlugins-BXLXazrR.js} +1 -1
- package/dist/chunks/useMergedTools-CCgnBJzO.js +1 -0
- package/dist/chunks/{useSearchInput-B25K1RnK.js → useSearchInput-CzopttqC.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DYQ44kX4.js → useSettingsErrors-SFPWfxsA.js} +1 -1
- package/dist/chunks/{util-CtlC2dsN.js → util-Cbb3S6SX.js} +1 -1
- package/dist/chunks/{validatePlugin-D6tFo87L.js → validatePlugin-BMSoeb_b.js} +1 -1
- package/dist/chunks/worktree-Vm-SNY5x.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +0 -1
- package/dist/chunks/CustomSelect-DoeEXOIP.js +0 -1
- package/dist/chunks/Doctor-DNgkgYhB.js +0 -1
- package/dist/chunks/REPL-CrVuMQY2.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +0 -1
- package/dist/chunks/caches-BGzKwpnc.js +0 -1
- package/dist/chunks/commands-QepeBbFn.js +0 -1
- package/dist/chunks/config-D58C3_Lu.js +0 -1
- package/dist/chunks/context-noninteractive-BDDi3NLF.js +0 -1
- package/dist/chunks/conversation-B0wxBwzv.js +0 -1
- package/dist/chunks/doctor-CkLzqAMd.js +0 -1
- package/dist/chunks/extractMemories-xP63mv6R.js +0 -1
- package/dist/chunks/fast-C5nQH8rm.js +0 -1
- package/dist/chunks/fetchModelList-D24lRIgR.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +0 -1
- package/dist/chunks/hooks-BNuUlMzL.js +0 -1
- package/dist/chunks/loadAgentsDir-CcmY8zCj.js +0 -1
- package/dist/chunks/localSearch-DrUj0B-d.js +0 -1
- package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +0 -1
- package/dist/chunks/prompt-CHobfCB1.js +0 -1
- package/dist/chunks/prompt-CMm6RHHc.js +0 -1
- package/dist/chunks/sandbox-adapter-8GO6eJxw.js +0 -1
- package/dist/chunks/searchExtraTools-BhDq8DTJ.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +0 -1
- package/dist/chunks/sessionObserver-DGEQM4cO.js +0 -1
- package/dist/chunks/sessionStorage-BcAscOGE.js +0 -1
- package/dist/chunks/sinks-CGdKmq_8.js +0 -1
- package/dist/chunks/status-Daaak6Bo.js +0 -1
- package/dist/chunks/switcher-BpgmH4AI.js +0 -1
- package/dist/chunks/useMainLoopModel-DwjSVzzO.js +0 -1
- package/dist/chunks/useMergedTools-Bw8FchX8.js +0 -1
- package/dist/chunks/worktree-B8apCnVe.js +0 -1
|
@@ -1 +1 @@
|
|
|
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,o as i}from"./envUtils-DfkgIdYf.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as ee}from"./esm-lWlUmoUA.js";import{B as m,C as te,D as h,E as ne,F as re,O as ie,S as ae,T as oe,b as se,c as ce,i as le,m as ue,n as g,o as de,u as fe,v as _,x as pe}from"./esm-BbMeEYcz.js";import{n as me,t as he}from"./esm-sVMjGuep.js";import{F as ge,I as _e,It as ve,Y as ye,at as be,st as xe,x as Se}from"./state-B4jiUise.js";import{C as Ce,I as we,i as Te,x as Ee}from"./debug-Bglx1aTu.js";import{Gt as De,Lr as Oe,Pr as ke,Ut as Ae,Wt as v,h as je,qt as Me,t as Ne}from"./settings-B2jvL8Dp.js";import{i as Pe,t as Fe}from"./execFileNoThrow-BTachNBI.js";import{a as Ie,n as Le,o as Re,r as ze}from"./platform-BacQ6ACS.js";import{Bt as Be,Ft as Ve,Gt as He,It as Ue,Lt as We,Pt as Ge,Qt as Ke,Vt as qe,Yt as y,Zt as Je,bt as Ye,d as Xe,o as Ze,t as b,yt as Qe,zt as $e}from"./model-BwBG0V1u.js";import{i as et,t as tt}from"./genericProcessUtils-DwQFuna9.js";import{arch as nt,hostname as rt,platform as it,release as at}from"os";import{extname as ot}from"path";import{stat as st}from"fs/promises";import{inspect as ct}from"util";import*as lt from"process";import{AsyncLocalStorage as ut}from"async_hooks";var x,dt=e((()=>{(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(x||(x={}))})),ft,pt,mt=e((()=>{ft=class{emit(e){}enabled(){return!1}},pt=new ft}));function ht(e,t,n){return r=>r===e?t:n}var S,C,gt=e((()=>{S=Symbol.for(`io.opentelemetry.js.api.logs`),C=globalThis})),_t,vt,yt=e((()=>{mt(),_t=class{getLogger(e,t,n){return new ft}},vt=new _t})),bt,xt=e((()=>{mt(),bt=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):pt}}})),w,St=e((()=>{yt(),xt(),w=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new bt(this,e,t,n)}_getDelegate(){return this._delegate??vt}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),Ct,wt=e((()=>{gt(),yt(),St(),Ct=class e{constructor(){this._proxyLoggerProvider=new w}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return C[S]?this.getLoggerProvider():(C[S]=ht(1,e,vt),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return C[S]?.call(C,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete C[S],this._proxyLoggerProvider=new w}}})),Tt,T=e((()=>{dt(),mt(),wt(),Tt=Ct.getInstance()}));function Et(){return`workmate/0.0.23`}var Dt=e((()=>{})),Ot,kt,E,At=e((()=>{n(),Je(),Ot=[{modelEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],kt=[{modelEnvVar:`OPENAI_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],E=t((e,t)=>{if(y()===`firstParty`)return;let n=e.toLowerCase(),r=y()===`openai`?kt:Ot;for(let e of r){let r=process.env[e.modelEnvVar],i=process.env[e.capabilitiesEnvVar];if(!(!r||i===void 0)&&n===r.toLowerCase())return i.toLowerCase().split(`,`).map(e=>e.trim()).includes(t)}},(e,t)=>`${e.toLowerCase()}:${t}`)}));function jt(e){let t=[],n=[];for(let r of e)O.includes(r)?t.push(r):n.push(r);return{allowed:t,disallowed:n}}function Mt(e){if(!e||e.length===0)return;let{allowed:t,disallowed:n}=jt(e);for(let e of n)console.warn(`Warning: Beta header '${e}' is not allowed. Only the following betas are supported: ${O.join(`, `)}`);return t.length>0?t:void 0}function Nt(e){let t=E(e,`interleaved_thinking`);if(t!==void 0)return t;let n=b(e),r=y();return r===`foundry`?!0:r===`firstParty`?!n.includes(`claude-3-`):n.includes(`claude-opus-4`)||n.includes(`claude-sonnet-4`)}function Pt(e){let t=b(e),n=y();return n===`foundry`?!0:n===`firstParty`?!t.includes(`claude-3-`):t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function Ft(e){let t=b(e),n=y();return n!==`firstParty`&&n!==`foundry`?!1:t.includes(`claude-sonnet-4-6`)||t.includes(`claude-sonnet-4-5`)||t.includes(`claude-opus-4-1`)||t.includes(`claude-opus-4-5`)||t.includes(`claude-opus-4-6`)||t.includes(`claude-opus-4-7`)||t.includes(`claude-haiku-4-5`)}function It(e){return!0}function D(){return(y()===`firstParty`||y()===`foundry`)&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)&&Ke()}function Lt(){return y()===`firstParty`&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function Rt(e,t){let n=[...k(e)];t?.isAgenticQuery&&(n.includes(`claude-code-20250219`)||n.push(Ve));let r=be();return!r||r.length===0?n:[...n,...r.filter(e=>!n.includes(e))]}var O,zt,k,Bt,Vt=e((()=>{n(),ve(),He(),Ye(),i(),Xe(),At(),Je(),je(),O=[Ue],zt=t(e=>{let t=[],n=b(e).includes(`haiku`);y();let i=D();n||t.push(Ve),Qe(e)&&t.push(Ue),!r(process.env.DISABLE_INTERLEAVED_THINKING)&&Nt(e)&&t.push($e),i&&Nt(e)&&!_e()&&Ne().showThinkingSummaries!==!0&&t.push(qe);let a=r(process.env.USE_API_CONTEXT_MANAGEMENT)||Pt(e),o=Pt(e);return D()&&(a||o)&&t.push(We),i&&Ft(e),i&&t.push(Be),process.env.ANTHROPIC_BETAS&&t.push(...process.env.ANTHROPIC_BETAS.split(`,`).map(e=>e.trim()).filter(Boolean)),t}),k=t(e=>{let t=zt(e);return y()===`bedrock`?t.filter(e=>!Ge.has(e)):t}),Bt=t(e=>zt(e).filter(e=>Ge.has(e)))}));function Ht(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function Ut(){return process.platform===`linux`?A??!1:!1}async function Wt(){if(j!==void 0)return j;if(process.platform===`darwin`)return j=null,null;try{let e=await tt(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Ae)if(e.includes(t))return j=t,t}}catch{}return j=null,null}async function Gt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?await Wt()||`pycharm`:v.terminal}function Kt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?j===void 0?`pycharm`:j||`pycharm`:v.terminal}async function qt(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await Wt()}var Jt,A,j,Yt,Xt=e((()=>{n(),Me(),i(),Pe(),et(),Jt=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await Fe(`test`,[`-f`,`/.dockerenv`]);return e===0}),A=null,process.platform===`linux`&&st(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{A=!0},()=>{A=!1}),Yt={...v,terminal:Kt(),getIsDocker:Jt,getIsBubblewrapSandbox:Ht,isMuslEnvironment:Ut,getTerminalWithJetBrainsDetectionAsync:Gt,initJetBrainsDetection:qt}}));function Zt(e){return Qt?.has(e)??!1}var Qt,$t=e((()=>{Te(),we()}));function M(){return an.getStore()}function en(e,t){return an.run(e,t)}function tn(e){return e?.agentType===`subagent`}function nn(){let e=M();if(!(!tn(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function rn(){let e=M();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var an,on=e((()=>{an=new ut}));function sn(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function cn(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function ln(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&Zt(t))}function un(e,t,n){let r=dn(e);return!r||!yn.has(r.serverName)&&!ln(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function dn(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function fn(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function N(e,t=0){if(typeof e==`string`)return e.length>bn?`${e.slice(0,xn)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=Sn)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,I).map(e=>N(e,t+1));return e.length>I&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,I).map(([e,n])=>[e,N(n,t+1)]);return n.length>I&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function pn(e){if(!cn())return;let t=Ce(N(e));return t.length>F&&(t=`${t.slice(0,F)}…[truncated]`),t}function P(e){let t=ot(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>Cn?`other`:n}function mn(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=P(t);e&&(r.add(e),n=e)}for(let t of e.split(Tn)){if(!t)continue;let e=t.split(En);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(wn.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=P(i);a&&!r.has(a)&&(r.add(a),n=n?`${n},${a}`:a)}}if(n)return n}function hn(){let e=M();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=ye();return i?{parentSessionId:i}:{}}function gn(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(L&&R){let e=n-R;e>0&&(r=(t.user-L.user+(t.system-L.system))/(e*1e3)*100)}return L=t,R=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function _n(e={}){let t=e.model?String(e.model):Ze(),n=typeof e.betas==`string`?e.betas:k(t).join(`,`),[r,i]=await Promise.all([On(),ke()]),a=gn();return{model:t,sessionId:xe(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(ge()),clientType:Se(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...hn(),...i&&{rh:i}}}function vn(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,skillMode:o,observerMode:s,...c}=e,l={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(l.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(l.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(l.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(l.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(l.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(l.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(l.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(l.github_action_ref=r.githubActionRef),r.wslVersion&&(l.wsl_version=r.wslVersion),r.linuxDistroId&&(l.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(l.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(l.linux_kernel=r.linuxKernel),r.vcs&&(l.vcs=r.vcs),r.versionBase&&(l.version_base=r.versionBase);let u={session_id:c.sessionId,model:c.model,user_type:c.userType,is_interactive:c.isInteractive===`true`,client_type:c.clientType};if(c.betas&&(u.betas=c.betas),c.entrypoint&&(u.entrypoint=c.entrypoint),c.agentSdkVersion&&(u.agent_sdk_version=c.agentSdkVersion),c.sweBenchRunId&&(u.swe_bench_run_id=c.sweBenchRunId),c.sweBenchInstanceId&&(u.swe_bench_instance_id=c.sweBenchInstanceId),c.sweBenchTaskId&&(u.swe_bench_task_id=c.sweBenchTaskId),c.agentId&&(u.agent_id=c.agentId),c.parentSessionId&&(u.parent_session_id=c.parentSessionId),c.agentType&&(u.agent_type=c.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;l.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let d;return(t.accountUuid||t.organizationUuid)&&(d={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:l,...i&&{process:Buffer.from(Ce(i)).toString(`base64`)},...d&&{auth:d},core:u,additional:{...a&&{rh:a},...o&&{skill_mode:o},...s&&{observer_mode:s},...n}}}var yn,bn,xn,F,I,Sn,Cn,wn,Tn,En,Dn,On,L,R,kn=e((()=>{n(),Me(),Xt(),Vt(),Xe(),ve(),i(),$t(),Oe(),Re(),on(),Ee(),yn=new Set,bn=512,xn=128,F=4*1024,I=20,Sn=2,Cn=10,wn=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Tn=/\s*(?:&&|\|\||[;|])\s*/,En=/\s+/,Dn=t(()=>{let e=`0.0.23`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),On=t(async()=>{let[e,t,n,i]=await Promise.all([v.getPackageManagers(),v.getRuntimes(),ze(),Le()]);return{platform:De(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:v.arch,nodeVersion:v.nodeVersion,terminal:Yt.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:v.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:v.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),version:`0.0.23`,versionBase:Dn(),buildTime:`2026-08-26T10:35:19.203Z`,deploymentEnvironment:v.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Ie()&&{wslVersion:Ie()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),L=null,R=null}));function An(e){return e.setValue(z,!0)}function jn(e){return e.getValue(z)===!0}var z,B=e((()=>{f(),z=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Mn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Nn(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Pn(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Nn(e){return typeof e==`string`&&e!==``}function Pn(e){return e==null?!0:Array.isArray(e)?Fn(e):In(typeof e)}function Fn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(In(e)){t=e;continue}return!1}return!1}}return!0}function In(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var Ln=e((()=>{f()}));function Rn(){return e=>{p.error(zn(e))}}function zn(e){return typeof e==`string`?e:JSON.stringify(Bn(e))}function Bn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Vn=e((()=>{f()}));function Hn(e){try{Un(e)}catch{}}var Un,Wn=e((()=>{Vn(),Un=Rn()}));function Gn(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${ct(t)} for ${e}, expected a number, using defaults`);return}return n}function V(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var Kn=e((()=>{f()})),qn,Jn=e((()=>{qn=`2.9.0`})),Yn,Xn=e((()=>{Yn=`process.runtime.name`})),H,Zn=e((()=>{Jn(),_(),Xn(),H={[ne]:`opentelemetry`,[Yn]:`node`,[oe]:ie,[h]:qn}})),U,Qn=e((()=>{Kn(),Zn(),U=performance})),$n=e((()=>{Qn()}));function W(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function er(e){return or(W(U.timeOrigin),W(typeof e==`number`?e:U.now()))}function tr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=G),[n,r]}function nr(e){return e[0]*1e6+e[1]/1e3}function rr(e){return e[0]+e[1]/G}function ir(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ar(e){return ir(e)||typeof e==`number`||e instanceof Date}function or(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=G&&(n[1]-=G,n[0]+=1),n}var sr,cr,G,lr=e((()=>{$n(),sr=9,cr=10**6,G=10**sr})),K,ur=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(K||(K={}))}));function dr(e){if(!fr(e)||pr(e)!==gr)return!1;let t=xr(e);if(t===null)return!0;let n=Cr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&yr.call(n)===br}function fr(e){return typeof e==`object`&&!!e}function pr(e){return e==null?e===void 0?vr:_r:q&&q in Object(e)?mr(e):hr(e)}function mr(e){let t=Cr.call(e,q),n=e[q],r=!1;try{e[q]=void 0,r=!0}catch{}let i=wr.call(e);return r&&(t?e[q]=n:delete e[q]),i}function hr(e){return wr.call(e)}var gr,_r,vr,yr,br,xr,Sr,Cr,q,wr,Tr=e((()=>{gr=`[object Object]`,_r=`[object Null]`,vr=`[object Undefined]`,yr=Function.prototype.toString,br=yr.call(Object),xr=Object.getPrototypeOf,Sr=Object.prototype,Cr=Sr.hasOwnProperty,q=Symbol?Symbol.toStringTag:void 0,wr=Sr.toString}));function Er(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Or(t,e.shift(),0,n);return t}function Dr(e){return J(e)?e.slice():e}function Or(e,t,n=0,r){let i;if(!(n>Mr)){if(n++,X(e)||X(t)||Ar(t))i=Dr(t);else if(J(e)){if(i=e.slice(),J(t))for(let e=0,n=t.length;e<n;e++)i.push(Dr(t[e]));else if(Y(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Dr(t[r]))}}}else if(Y(e))if(Y(t)){if(!jr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(X(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(kr(e,s,r)||kr(t,s,r))delete i[s];else{if(Y(a)&&Y(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Or(i[s],c,n,r)}}}}else i=t;return i}}function kr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function J(e){return Array.isArray(e)}function Ar(e){return typeof e==`function`}function Y(e){return!X(e)&&!J(e)&&!Ar(e)&&typeof e==`object`}function X(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function jr(e,t){return!(!dr(e)||!dr(t))}var Mr,Nr=e((()=>{Tr(),Mr=20})),Pr,Fr=e((()=>{a(),Pr=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Ir,Lr=e((()=>{Fr(),a(),Ir=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new Pr),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Rr(e,t){return new Promise(n=>{d.with(An(d.active()),()=>{e.export(t,n)})})}var zr=e((()=>{f(),B()})),Br,Vr=e((()=>{B(),Ln(),Wn(),Vn(),lr(),ur(),$n(),Nr(),Lr(),zr(),Br={_export:Rr}}));function Hr(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,Ur=e((()=>{})),Q,Wr=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Gr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Kr(){return Gr({[te]:Hr(),[oe]:H[oe],[ne]:H[ne],[h]:H[h]})}function qr(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Jr(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Yr(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Xr,Zr=e((()=>{f(),Vr(),_(),Ur(),Wr(),a(),Xr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=qr(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=qr(this._rawAttributes),this._schemaUrl=Jr(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Yr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),Qr,$r,ei=e((()=>{f(),_(),Vr(),a(),Qr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=V(`OTEL_RESOURCE_ATTRIBUTES`),r=V(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[te]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},$r=new Qr})),ti,ni,ri,ii,ai,oi=e((()=>{ti=`host.arch`,ni=`host.id`,ri=`host.name`,ii=`os.type`,ai=`os.version`}));async function si(){if(!$)switch(lt.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,ci=e((()=>{})),li,ui,di=e((()=>{li=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},ui=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),fi,pi,mi=e((()=>{oi(),ci(),di(),fi=class{detect(e){return{attributes:{[ri]:rt(),[ti]:li(nt()),[ni]:si()}}}},pi=new fi})),hi,gi,_i=e((()=>{oi(),di(),hi=class{detect(e){return{attributes:{[ii]:ui(it()),[ai]:at()}}}},gi=new hi})),vi=e((()=>{mi(),_i(),oi()})),yi=e((()=>{vi()})),bi=e((()=>{ei(),yi()})),xi=e((()=>{Zr(),bi(),Ur()}));function Si(e){return Ci(e,new WeakSet)}function Ci(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Ci(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Ci(e,t))}return!1}var wi=e((()=>{})),Ti,Ei=e((()=>{f(),g(),_(),wi(),a(),Ti=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,m=Date.now();if(this.hrTime=ue(r??m),this.hrTimeObserved=ue(i??m),p){let e=u.getSpanContext(p);e&&ee(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Si(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(pe,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),Di,Oi=e((()=>{T(),f(),Ei(),a(),Di=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??x.UNSPECIFIED;if(r!==x.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new Ti(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==x.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),ki,Ai=e((()=>{ki=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),ji,Mi=e((()=>{g(),a(),ji=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>de(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Ni(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Pi=e((()=>{})),Fi,Ii=e((()=>{Fi=`otel.sdk.log.created`})),Li,Ri=e((()=>{Ii(),a(),Li=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(Fi,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),zi,Bi=e((()=>{zi=`0.215.0`})),Vi,Hi,Ui,Wi=e((()=>{f(),T(),Ai(),Mi(),Pi(),Ri(),Bi(),a(),Vi={disabled:!1,minimumSeverity:x.UNSPECIFIED,traceBased:!1},Hi=()=>({...Vi}),Ui=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new ji(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ki,this._loggerConfigurator=i??Hi;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,zi):s();this.loggerMetrics=new Li(c)}getLoggerConfig(e){let t=Ni(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Gi,Ki=e((()=>{f(),T(),he(),g(),Oi(),Wi(),a(),Gi=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??me(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Hi,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new Ui(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new le(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),pt;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Di({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),qi,Ji=e((()=>{g(),qi=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:fe(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:ce.SUCCESS})}}}));async function Yi(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var Xi,Zi,Qi=e((()=>{f(),g(),a(),Xi=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await Yi(t),await d.with(m(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){re(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===ce.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},Zi=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new le(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new Xi(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){re(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new Xi(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,re(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),$i,ea=e((()=>{Qi(),$i=class extends Zi{onShutdown(){}}})),ta=e((()=>{ea()})),na=e((()=>{ta()})),ra=e((()=>{Ki(),Ji(),na(),T()}));export{mn as $,rr as A,Hn as B,Er as C,At as Ct,er as D,Tt as Dt,or as E,T as Et,Qn as F,B as G,Ln as H,U as I,dn as J,jn as K,Gn as L,ar as M,ir as N,tr as O,W as P,P as Q,V as R,Nr as S,E as St,ur as T,Dt as Tt,Pn as U,Wn as V,Mn as W,pn as X,fn as Y,_n as Z,Gr as _,Vt as _t,Ji as a,rn as at,Ir as b,D as bt,xi as c,on as ct,pi as d,qt as dt,kn as et,mi as f,Xt as ft,Zr as g,k as gt,Kr as h,Rt as ht,qi as i,vn as it,lr as j,nr as k,_i as l,en as lt,ei as m,Bt as mt,$i as n,un as nt,Gi as o,M as ot,$r as p,Mt as pt,An as q,ea as r,sn as rt,Ki as s,nn as st,ra as t,cn as tt,gi as u,Yt as ut,Vr as v,It as vt,K as w,Et as wt,Lr as x,Lt as xt,Br as y,Ft as yt,Kn as z};
|
|
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,o as i}from"./envUtils-DfkgIdYf.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as ee}from"./esm-lWlUmoUA.js";import{B as m,C as te,D as h,E as ne,F as re,O as ie,S as ae,T as oe,b as se,c as ce,i as le,m as ue,n as g,o as de,u as fe,v as _,x as pe}from"./esm-BbMeEYcz.js";import{n as me,t as he}from"./esm-sVMjGuep.js";import{F as ge,I as _e,It as ve,Y as ye,at as be,st as xe,x as Se}from"./state-B4jiUise.js";import{C as Ce,I as we,i as Te,x as Ee}from"./debug-Bglx1aTu.js";import{Gt as De,Lr as Oe,Pr as ke,Ut as Ae,Wt as v,h as je,qt as Me,t as Ne}from"./settings-B2jvL8Dp.js";import{i as Pe,t as Fe}from"./execFileNoThrow-BTachNBI.js";import{a as Ie,n as Le,o as Re,r as ze}from"./platform-BacQ6ACS.js";import{Bt as Be,Ft as Ve,Gt as He,It as Ue,Lt as We,Pt as Ge,Qt as Ke,Vt as qe,Yt as y,Zt as Je,bt as Ye,d as Xe,o as Ze,t as b,yt as Qe,zt as $e}from"./model-BvQFFOf8.js";import{i as et,t as tt}from"./genericProcessUtils-DwQFuna9.js";import{arch as nt,hostname as rt,platform as it,release as at}from"os";import{extname as ot}from"path";import{stat as st}from"fs/promises";import{inspect as ct}from"util";import*as lt from"process";import{AsyncLocalStorage as ut}from"async_hooks";var x,dt=e((()=>{(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(x||(x={}))})),ft,pt,mt=e((()=>{ft=class{emit(e){}enabled(){return!1}},pt=new ft}));function ht(e,t,n){return r=>r===e?t:n}var S,C,gt=e((()=>{S=Symbol.for(`io.opentelemetry.js.api.logs`),C=globalThis})),_t,vt,yt=e((()=>{mt(),_t=class{getLogger(e,t,n){return new ft}},vt=new _t})),bt,xt=e((()=>{mt(),bt=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):pt}}})),w,St=e((()=>{yt(),xt(),w=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new bt(this,e,t,n)}_getDelegate(){return this._delegate??vt}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),Ct,wt=e((()=>{gt(),yt(),St(),Ct=class e{constructor(){this._proxyLoggerProvider=new w}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return C[S]?this.getLoggerProvider():(C[S]=ht(1,e,vt),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return C[S]?.call(C,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete C[S],this._proxyLoggerProvider=new w}}})),Tt,T=e((()=>{dt(),mt(),wt(),Tt=Ct.getInstance()}));function Et(){return`workmate/0.0.24`}var Dt=e((()=>{})),Ot,kt,E,At=e((()=>{n(),Je(),Ot=[{modelEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],kt=[{modelEnvVar:`OPENAI_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],E=t((e,t)=>{if(y()===`firstParty`)return;let n=e.toLowerCase(),r=y()===`openai`?kt:Ot;for(let e of r){let r=process.env[e.modelEnvVar],i=process.env[e.capabilitiesEnvVar];if(!(!r||i===void 0)&&n===r.toLowerCase())return i.toLowerCase().split(`,`).map(e=>e.trim()).includes(t)}},(e,t)=>`${e.toLowerCase()}:${t}`)}));function jt(e){let t=[],n=[];for(let r of e)O.includes(r)?t.push(r):n.push(r);return{allowed:t,disallowed:n}}function Mt(e){if(!e||e.length===0)return;let{allowed:t,disallowed:n}=jt(e);for(let e of n)console.warn(`Warning: Beta header '${e}' is not allowed. Only the following betas are supported: ${O.join(`, `)}`);return t.length>0?t:void 0}function Nt(e){let t=E(e,`interleaved_thinking`);if(t!==void 0)return t;let n=b(e),r=y();return r===`foundry`?!0:r===`firstParty`?!n.includes(`claude-3-`):n.includes(`claude-opus-4`)||n.includes(`claude-sonnet-4`)}function Pt(e){let t=b(e),n=y();return n===`foundry`?!0:n===`firstParty`?!t.includes(`claude-3-`):t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function Ft(e){let t=b(e),n=y();return n!==`firstParty`&&n!==`foundry`?!1:t.includes(`claude-sonnet-4-6`)||t.includes(`claude-sonnet-4-5`)||t.includes(`claude-opus-4-1`)||t.includes(`claude-opus-4-5`)||t.includes(`claude-opus-4-6`)||t.includes(`claude-opus-4-7`)||t.includes(`claude-haiku-4-5`)}function It(e){return!0}function D(){return(y()===`firstParty`||y()===`foundry`)&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)&&Ke()}function Lt(){return y()===`firstParty`&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function Rt(e,t){let n=[...k(e)];t?.isAgenticQuery&&(n.includes(`claude-code-20250219`)||n.push(Ve));let r=be();return!r||r.length===0?n:[...n,...r.filter(e=>!n.includes(e))]}var O,zt,k,Bt,Vt=e((()=>{n(),ve(),He(),Ye(),i(),Xe(),At(),Je(),je(),O=[Ue],zt=t(e=>{let t=[],n=b(e).includes(`haiku`);y();let i=D();n||t.push(Ve),Qe(e)&&t.push(Ue),!r(process.env.DISABLE_INTERLEAVED_THINKING)&&Nt(e)&&t.push($e),i&&Nt(e)&&!_e()&&Ne().showThinkingSummaries!==!0&&t.push(qe);let a=r(process.env.USE_API_CONTEXT_MANAGEMENT)||Pt(e),o=Pt(e);return D()&&(a||o)&&t.push(We),i&&Ft(e),i&&t.push(Be),process.env.ANTHROPIC_BETAS&&t.push(...process.env.ANTHROPIC_BETAS.split(`,`).map(e=>e.trim()).filter(Boolean)),t}),k=t(e=>{let t=zt(e);return y()===`bedrock`?t.filter(e=>!Ge.has(e)):t}),Bt=t(e=>zt(e).filter(e=>Ge.has(e)))}));function Ht(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function Ut(){return process.platform===`linux`?A??!1:!1}async function Wt(){if(j!==void 0)return j;if(process.platform===`darwin`)return j=null,null;try{let e=await tt(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Ae)if(e.includes(t))return j=t,t}}catch{}return j=null,null}async function Gt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?await Wt()||`pycharm`:v.terminal}function Kt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?j===void 0?`pycharm`:j||`pycharm`:v.terminal}async function qt(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await Wt()}var Jt,A,j,Yt,Xt=e((()=>{n(),Me(),i(),Pe(),et(),Jt=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await Fe(`test`,[`-f`,`/.dockerenv`]);return e===0}),A=null,process.platform===`linux`&&st(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{A=!0},()=>{A=!1}),Yt={...v,terminal:Kt(),getIsDocker:Jt,getIsBubblewrapSandbox:Ht,isMuslEnvironment:Ut,getTerminalWithJetBrainsDetectionAsync:Gt,initJetBrainsDetection:qt}}));function Zt(e){return Qt?.has(e)??!1}var Qt,$t=e((()=>{Te(),we()}));function M(){return an.getStore()}function en(e,t){return an.run(e,t)}function tn(e){return e?.agentType===`subagent`}function nn(){let e=M();if(!(!tn(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function rn(){let e=M();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var an,on=e((()=>{an=new ut}));function sn(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function cn(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function ln(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&Zt(t))}function un(e,t,n){let r=dn(e);return!r||!yn.has(r.serverName)&&!ln(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function dn(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function fn(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function N(e,t=0){if(typeof e==`string`)return e.length>bn?`${e.slice(0,xn)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=Sn)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,I).map(e=>N(e,t+1));return e.length>I&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,I).map(([e,n])=>[e,N(n,t+1)]);return n.length>I&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function pn(e){if(!cn())return;let t=Ce(N(e));return t.length>F&&(t=`${t.slice(0,F)}…[truncated]`),t}function P(e){let t=ot(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>Cn?`other`:n}function mn(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=P(t);e&&(r.add(e),n=e)}for(let t of e.split(Tn)){if(!t)continue;let e=t.split(En);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(wn.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=P(i);a&&!r.has(a)&&(r.add(a),n=n?`${n},${a}`:a)}}if(n)return n}function hn(){let e=M();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=ye();return i?{parentSessionId:i}:{}}function gn(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(L&&R){let e=n-R;e>0&&(r=(t.user-L.user+(t.system-L.system))/(e*1e3)*100)}return L=t,R=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function _n(e={}){let t=e.model?String(e.model):Ze(),n=typeof e.betas==`string`?e.betas:k(t).join(`,`),[r,i]=await Promise.all([On(),ke()]),a=gn();return{model:t,sessionId:xe(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(ge()),clientType:Se(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...hn(),...i&&{rh:i}}}function vn(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,skillMode:o,observerMode:s,...c}=e,l={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(l.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(l.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(l.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(l.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(l.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(l.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(l.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(l.github_action_ref=r.githubActionRef),r.wslVersion&&(l.wsl_version=r.wslVersion),r.linuxDistroId&&(l.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(l.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(l.linux_kernel=r.linuxKernel),r.vcs&&(l.vcs=r.vcs),r.versionBase&&(l.version_base=r.versionBase);let u={session_id:c.sessionId,model:c.model,user_type:c.userType,is_interactive:c.isInteractive===`true`,client_type:c.clientType};if(c.betas&&(u.betas=c.betas),c.entrypoint&&(u.entrypoint=c.entrypoint),c.agentSdkVersion&&(u.agent_sdk_version=c.agentSdkVersion),c.sweBenchRunId&&(u.swe_bench_run_id=c.sweBenchRunId),c.sweBenchInstanceId&&(u.swe_bench_instance_id=c.sweBenchInstanceId),c.sweBenchTaskId&&(u.swe_bench_task_id=c.sweBenchTaskId),c.agentId&&(u.agent_id=c.agentId),c.parentSessionId&&(u.parent_session_id=c.parentSessionId),c.agentType&&(u.agent_type=c.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;l.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let d;return(t.accountUuid||t.organizationUuid)&&(d={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:l,...i&&{process:Buffer.from(Ce(i)).toString(`base64`)},...d&&{auth:d},core:u,additional:{...a&&{rh:a},...o&&{skill_mode:o},...s&&{observer_mode:s},...n}}}var yn,bn,xn,F,I,Sn,Cn,wn,Tn,En,Dn,On,L,R,kn=e((()=>{n(),Me(),Xt(),Vt(),Xe(),ve(),i(),$t(),Oe(),Re(),on(),Ee(),yn=new Set,bn=512,xn=128,F=4*1024,I=20,Sn=2,Cn=10,wn=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Tn=/\s*(?:&&|\|\||[;|])\s*/,En=/\s+/,Dn=t(()=>{let e=`0.0.24`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),On=t(async()=>{let[e,t,n,i]=await Promise.all([v.getPackageManagers(),v.getRuntimes(),ze(),Le()]);return{platform:De(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:v.arch,nodeVersion:v.nodeVersion,terminal:Yt.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:v.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:v.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),version:`0.0.24`,versionBase:Dn(),buildTime:`2026-08-26T10:41:05.156Z`,deploymentEnvironment:v.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Ie()&&{wslVersion:Ie()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),L=null,R=null}));function An(e){return e.setValue(z,!0)}function jn(e){return e.getValue(z)===!0}var z,B=e((()=>{f(),z=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Mn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Nn(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Pn(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Nn(e){return typeof e==`string`&&e!==``}function Pn(e){return e==null?!0:Array.isArray(e)?Fn(e):In(typeof e)}function Fn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(In(e)){t=e;continue}return!1}return!1}}return!0}function In(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var Ln=e((()=>{f()}));function Rn(){return e=>{p.error(zn(e))}}function zn(e){return typeof e==`string`?e:JSON.stringify(Bn(e))}function Bn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Vn=e((()=>{f()}));function Hn(e){try{Un(e)}catch{}}var Un,Wn=e((()=>{Vn(),Un=Rn()}));function Gn(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${ct(t)} for ${e}, expected a number, using defaults`);return}return n}function V(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var Kn=e((()=>{f()})),qn,Jn=e((()=>{qn=`2.9.0`})),Yn,Xn=e((()=>{Yn=`process.runtime.name`})),H,Zn=e((()=>{Jn(),_(),Xn(),H={[ne]:`opentelemetry`,[Yn]:`node`,[oe]:ie,[h]:qn}})),U,Qn=e((()=>{Kn(),Zn(),U=performance})),$n=e((()=>{Qn()}));function W(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function er(e){return or(W(U.timeOrigin),W(typeof e==`number`?e:U.now()))}function tr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=G),[n,r]}function nr(e){return e[0]*1e6+e[1]/1e3}function rr(e){return e[0]+e[1]/G}function ir(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ar(e){return ir(e)||typeof e==`number`||e instanceof Date}function or(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=G&&(n[1]-=G,n[0]+=1),n}var sr,cr,G,lr=e((()=>{$n(),sr=9,cr=10**6,G=10**sr})),K,ur=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(K||(K={}))}));function dr(e){if(!fr(e)||pr(e)!==gr)return!1;let t=xr(e);if(t===null)return!0;let n=Cr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&yr.call(n)===br}function fr(e){return typeof e==`object`&&!!e}function pr(e){return e==null?e===void 0?vr:_r:q&&q in Object(e)?mr(e):hr(e)}function mr(e){let t=Cr.call(e,q),n=e[q],r=!1;try{e[q]=void 0,r=!0}catch{}let i=wr.call(e);return r&&(t?e[q]=n:delete e[q]),i}function hr(e){return wr.call(e)}var gr,_r,vr,yr,br,xr,Sr,Cr,q,wr,Tr=e((()=>{gr=`[object Object]`,_r=`[object Null]`,vr=`[object Undefined]`,yr=Function.prototype.toString,br=yr.call(Object),xr=Object.getPrototypeOf,Sr=Object.prototype,Cr=Sr.hasOwnProperty,q=Symbol?Symbol.toStringTag:void 0,wr=Sr.toString}));function Er(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Or(t,e.shift(),0,n);return t}function Dr(e){return J(e)?e.slice():e}function Or(e,t,n=0,r){let i;if(!(n>Mr)){if(n++,X(e)||X(t)||Ar(t))i=Dr(t);else if(J(e)){if(i=e.slice(),J(t))for(let e=0,n=t.length;e<n;e++)i.push(Dr(t[e]));else if(Y(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Dr(t[r]))}}}else if(Y(e))if(Y(t)){if(!jr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(X(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(kr(e,s,r)||kr(t,s,r))delete i[s];else{if(Y(a)&&Y(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Or(i[s],c,n,r)}}}}else i=t;return i}}function kr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function J(e){return Array.isArray(e)}function Ar(e){return typeof e==`function`}function Y(e){return!X(e)&&!J(e)&&!Ar(e)&&typeof e==`object`}function X(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function jr(e,t){return!(!dr(e)||!dr(t))}var Mr,Nr=e((()=>{Tr(),Mr=20})),Pr,Fr=e((()=>{a(),Pr=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Ir,Lr=e((()=>{Fr(),a(),Ir=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new Pr),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Rr(e,t){return new Promise(n=>{d.with(An(d.active()),()=>{e.export(t,n)})})}var zr=e((()=>{f(),B()})),Br,Vr=e((()=>{B(),Ln(),Wn(),Vn(),lr(),ur(),$n(),Nr(),Lr(),zr(),Br={_export:Rr}}));function Hr(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,Ur=e((()=>{})),Q,Wr=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Gr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Kr(){return Gr({[te]:Hr(),[oe]:H[oe],[ne]:H[ne],[h]:H[h]})}function qr(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Jr(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Yr(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Xr,Zr=e((()=>{f(),Vr(),_(),Ur(),Wr(),a(),Xr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=qr(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=qr(this._rawAttributes),this._schemaUrl=Jr(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Yr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),Qr,$r,ei=e((()=>{f(),_(),Vr(),a(),Qr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=V(`OTEL_RESOURCE_ATTRIBUTES`),r=V(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[te]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},$r=new Qr})),ti,ni,ri,ii,ai,oi=e((()=>{ti=`host.arch`,ni=`host.id`,ri=`host.name`,ii=`os.type`,ai=`os.version`}));async function si(){if(!$)switch(lt.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,ci=e((()=>{})),li,ui,di=e((()=>{li=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},ui=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),fi,pi,mi=e((()=>{oi(),ci(),di(),fi=class{detect(e){return{attributes:{[ri]:rt(),[ti]:li(nt()),[ni]:si()}}}},pi=new fi})),hi,gi,_i=e((()=>{oi(),di(),hi=class{detect(e){return{attributes:{[ii]:ui(it()),[ai]:at()}}}},gi=new hi})),vi=e((()=>{mi(),_i(),oi()})),yi=e((()=>{vi()})),bi=e((()=>{ei(),yi()})),xi=e((()=>{Zr(),bi(),Ur()}));function Si(e){return Ci(e,new WeakSet)}function Ci(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Ci(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Ci(e,t))}return!1}var wi=e((()=>{})),Ti,Ei=e((()=>{f(),g(),_(),wi(),a(),Ti=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,m=Date.now();if(this.hrTime=ue(r??m),this.hrTimeObserved=ue(i??m),p){let e=u.getSpanContext(p);e&&ee(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Si(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(pe,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),Di,Oi=e((()=>{T(),f(),Ei(),a(),Di=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??x.UNSPECIFIED;if(r!==x.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new Ti(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==x.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),ki,Ai=e((()=>{ki=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),ji,Mi=e((()=>{g(),a(),ji=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>de(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Ni(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Pi=e((()=>{})),Fi,Ii=e((()=>{Fi=`otel.sdk.log.created`})),Li,Ri=e((()=>{Ii(),a(),Li=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(Fi,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),zi,Bi=e((()=>{zi=`0.215.0`})),Vi,Hi,Ui,Wi=e((()=>{f(),T(),Ai(),Mi(),Pi(),Ri(),Bi(),a(),Vi={disabled:!1,minimumSeverity:x.UNSPECIFIED,traceBased:!1},Hi=()=>({...Vi}),Ui=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new ji(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ki,this._loggerConfigurator=i??Hi;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,zi):s();this.loggerMetrics=new Li(c)}getLoggerConfig(e){let t=Ni(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Gi,Ki=e((()=>{f(),T(),he(),g(),Oi(),Wi(),a(),Gi=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??me(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Hi,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new Ui(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new le(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),pt;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Di({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),qi,Ji=e((()=>{g(),qi=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:fe(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:ce.SUCCESS})}}}));async function Yi(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var Xi,Zi,Qi=e((()=>{f(),g(),a(),Xi=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await Yi(t),await d.with(m(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){re(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===ce.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},Zi=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new le(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new Xi(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){re(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new Xi(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,re(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),$i,ea=e((()=>{Qi(),$i=class extends Zi{onShutdown(){}}})),ta=e((()=>{ea()})),na=e((()=>{ta()})),ra=e((()=>{Ki(),Ji(),na(),T()}));export{mn as $,rr as A,Hn as B,Er as C,At as Ct,er as D,Tt as Dt,or as E,T as Et,Qn as F,B as G,Ln as H,U as I,dn as J,jn as K,Gn as L,ar as M,ir as N,tr as O,W as P,P as Q,V as R,Nr as S,E as St,ur as T,Dt as Tt,Pn as U,Wn as V,Mn as W,pn as X,fn as Y,_n as Z,Gr as _,Vt as _t,Ji as a,rn as at,Ir as b,D as bt,xi as c,on as ct,pi as d,qt as dt,kn as et,mi as f,Xt as ft,Zr as g,k as gt,Kr as h,Rt as ht,qi as i,vn as it,lr as j,nr as k,_i as l,en as lt,ei as m,Bt as mt,$i as n,un as nt,Gi as o,M as ot,$r as p,Mt as pt,An as q,ea as r,sn as rt,Ki as s,nn as st,ra as t,cn as tt,gi as u,Yt as ut,Vr as v,It as vt,K as w,Et as wt,Lr as x,Lt as xt,Br as y,Ft as yt,Kn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as t,Xs as n,Ys as r,_i as i,hi as a,jC as o,vt as s,xt as c}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as t,Xs as n,Ys as r,_i as i,hi as a,jC as o,vt as s,xt as c}from"./loadAgentsDir-B0Anodo0.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,t as d}from"./ExitFlow-DacaBTlk.js";import{spawnSync as f}from"child_process";function p(){return o(g)??`Goodbye!`}async function m(e){if(n())return e(),f(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=s()!==null;return t?(0,h.jsx)(d,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(p()),await a(0,`prompt_input_exit`),null)}var h,g;e((()=>{t(),u(),r(),i(),c(),h=l(),g=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{m as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,md as a,pd as o}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,md as a,pd as o}from"./loadAgentsDir-B0Anodo0.js";import{D as s,Gt as c,I as l,P as u,T as d,ai as f,t as p,x as m}from"./src-DL3w8VPk.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{G as g,H as _,N as v,U as y,W as b,bt as x,d as S,h as C,yt as w}from"./model-BvQFFOf8.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{t as D}from"./select-DIxfl_VN.js";import{n as O,r as k,t as A}from"./modelOptions-BBvF3wHK.js";import{t as j}from"./CustomSelect-wmZ9jz0W.js";import{n as M,t as N}from"./fetchModelList-FE8tzTDc.js";function P({initial:e,sessionModel:t,onSelect:n,onCancel:i,isStandaloneCommand:a,showFastModeNotice:f,headerText:p}){let h=T(),_=e===null?L:e,[x,S]=(0,F.useState)(_),E=r(e=>g()?e.fastMode:!1),[k,j]=(0,F.useState)(()=>new Set(w(_)?[_.replace(/\[1m\]/i,``)]:[])),M=(0,F.useCallback)(()=>{if(!x||x===L)return;let e=x.replace(/\[1m\]/i,``);j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[x]),P=(0,F.useMemo)(()=>O(E??!1),[E]),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=!1;return V(!1),N().then(t=>{if(!e){if(!t||t.length===0){z(null),V(!0);return}z(t)}}).catch(()=>{e||V(!0)}),()=>{e=!0}},[]);let H=(0,F.useMemo)(()=>R?A(R,E??!1):null,[R,E]),U=R===null&&!B,W=(0,F.useMemo)(()=>{let t=H??P;return e!==null&&!t.some(t=>t.value===e)?[...t,{value:e,label:C(e),description:`Current model`}]:t},[H,P,e]),G=(0,F.useMemo)(()=>W.map(e=>({...e,value:e.value===null?L:e.value})),[W]),K=(0,F.useMemo)(()=>G.some(e=>e.value===_)?_:G[0]?.value??void 0,[G,_]),q=Math.min(10,G.length),J=Math.max(0,G.length-q),Y=G.find(e=>e.value===x)?.label,X=x!==void 0&&x!==L&&k.has(x.replace(/\[1m\]/i,``)),Z=(0,F.useCallback)(e=>{S(e)},[]);c({"modelPicker:toggle1M":()=>M()},{context:`ModelPicker`});function Q(e){if(e===L){n(null);return}let t=e.replace(/\[1m\]/i,``);n(k.has(t)?`${t}[1m]`:t)}let $=(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(l,{marginBottom:1,flexDirection:`column`,children:[(0,I.jsx)(u,{color:`remember`,bold:!0,children:`Select model`}),(0,I.jsx)(u,{dimColor:!0,children:p??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,I.jsxs)(u,{dimColor:!0,children:[`Currently using `,C(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,I.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsx)(l,{flexDirection:`column`,children:(0,I.jsx)(D,{defaultValue:_,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:i??(()=>{}),visibleOptionCount:q})}),J>0&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsxs)(u,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsx)(u,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&R===null&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsx)(u,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,I.jsx)(l,{marginBottom:1,flexDirection:`column`,children:X?(0,I.jsxs)(u,{dimColor:!0,children:[`1M context on`,(0,I.jsx)(u,{color:`subtle`,children:` · Space to toggle`})]}):(0,I.jsxs)(u,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,I.jsx)(u,{color:`subtle`,children:` · Space to toggle`})]})}),g()?f?(0,I.jsx)(l,{marginBottom:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Fast mode is `,(0,I.jsx)(u,{bold:!0,children:`ON`}),` and available with `,v,` only (/fast). Switching to other models turn off fast mode.`]})}):y()&&!b()?(0,I.jsx)(l,{marginBottom:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Use `,(0,I.jsx)(u,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,v,` only).`]})}):null:null]}),a&&(0,I.jsx)(u,{dimColor:!0,italic:!0,children:h.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,I.jsxs)(d,{children:[(0,I.jsx)(s,{shortcut:`Enter`,action:`confirm`}),(0,I.jsx)(o,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return a?(0,I.jsx)(m,{color:`permission`,children:$}):$}var F,I,L,R=e((()=>{F=t(f(),1),x(),E(),_(),p(),i(),n(),S(),k(),M(),a(),j(),I=h(),L=`__NO_PREFERENCE__`}));function z(e,t,n){return!1}var B=e((()=>{}));export{R as i,z as n,P as r,B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cc as e,lc as t,sc as n,uc as r}from"./loadAgentsDir-B0Anodo0.js";r();export{n as drainPendingExtraction,e as executeExtractMemories,t as initExtractMemories};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,zp as a}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,zp as a}from"./loadAgentsDir-B0Anodo0.js";import{Gt as o,I as s,Lt as c,P as l,ai as u,di as d,fi as f,j as p,t as m,y as h}from"./src-DL3w8VPk.js";import{t as g}from"./jsx-runtime-Bb4Xn-E0.js";import{Ht as _,b as v,h as y}from"./settings-B2jvL8Dp.js";import{p as b,s as x}from"./config-C-Y2qtB2.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{_ as w,l as T}from"./startupProfiler-CJdr3SxP.js";import{A as E,F as D,G as O,H as k,I as A,K as j,M,N,P,R as F,Z as I,j as L}from"./model-BvQFFOf8.js";import{n as R,t as z}from"./systemTheme-Ceakddth.js";function B({cooldown:e}){return e?(0,H.jsx)(l,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(l,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let n=R(x().theme);return t?d.dim(p(`promptBorder`,n)(`↯`)):p(`fastMode`,n)(`↯`)}var H,U=e((()=>{f(),_(),m(),b(),z(),H=g()}));function W(e,t){P(),v(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!j(e.mainLoopModel);return{...e,...t?{mainLoopModel:D(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=r(e=>e.mainLoopModel),i=r(e=>e.fastMode),u=a(),[d,f]=(0,J.useState)(i??!1),p=A(),m=p.status===`cooldown`,g=t!==null,_=E(L(!0));function v(){g||(W(d,u),C(`tengu_fast_mode_toggled`,{enabled:d,source:`picker`}),d?e(`${V(d)} Fast mode ON${j(n)?``:` · model set to ${N}`} · ${_}`):(u(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function y(){if(g){i&&W(!1,u),e(`Fast mode OFF`,{display:`system`});return}e(i?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function b(){g||f(e=>!e)}return o({"confirm:yes":v,"confirm:nextField":b,"confirm:next":b,"confirm:previous":b,"confirm:cycleMode":b,"confirm:toggle":b},{context:`Confirmation`}),(0,Y.jsxs)(h,{title:(0,Y.jsxs)(l,{children:[(0,Y.jsx)(B,{cooldown:m}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${N}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:y,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(l,{children:[`Press `,e.keyName,` again to exit`]}):g?(0,Y.jsx)(l,{children:`Esc to cancel`}):(0,Y.jsx)(l,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsx)(l,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(s,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(l,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(l,{color:d?`fastMode`:void 0,bold:d,children:d?`ON `:`OFF`}),(0,Y.jsx)(l,{dimColor:!0,children:_})]})}),m&&p.status===`cooldown`&&(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsxs)(l,{color:`warning`,children:[p.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,T(p.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(l,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(c,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=F();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),C(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${j(i)?``:` · model set to ${N}`} · ${E(L(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!O())return null;await I();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=F();return C(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{J=t(u(),1),m(),U(),i(),S(),n(),k(),w(),M(),y(),Y=g()}));export{U as a,V as i,q as n,X as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./fast-DH-C5IZs.js";t();export{n as FastModePicker,e as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./fetchModelList-FE8tzTDc.js";e();export{t as fetchAvailableModels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{g as t,v as n}from"./types-Dx7P7JLQ.js";import{c as r,i}from"./debug-Bglx1aTu.js";import{Et as a,Tt as o,Yt as s,Zt as c,at as l,ct as u}from"./model-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{g as t,v as n}from"./types-Dx7P7JLQ.js";import{c as r,i}from"./debug-Bglx1aTu.js";import{Et as a,Tt as o,Yt as s,Zt as c,at as l,ct as u}from"./model-BvQFFOf8.js";import{n as d,r as f}from"./client-4iqhC8xq.js";async function p(){let e=s();try{switch(e){case`firstParty`:{let e=await o({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.display_name??n.id,description:n.id});return t.length>0?t:null}case`openai`:{let e=d({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.id,description:`via openai-compat`});return t.length>0?t:null}case`grok`:{let{getGrokClient:e}=await import(`./client-BiqbIkwr.js`),t=e({maxRetries:1}),n=[];for await(let e of t.models.list())n.push({value:e.id,label:e.id,description:`via grok`});return n.length>0?n:null}case`bedrock`:{let e=(await l()).map(e=>({value:e,label:e,description:`Bedrock inference profile`}));return e.length>0?e:null}case`gemini`:case`vertex`:case`foundry`:return null}}catch(t){return r(`[fetchModelList] ${e} failed: ${t instanceof Error?t.message:`unknown`}`),null}return null}var m,h,g=e((()=>{a(),f(),i(),t(),u(),c(),m=300*1e3,h=n(p,m)}));export{g as n,h as t};
|
|
@@ -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{Lt as a,_ as o,g as s,jt as c,mn as l,p as u}from"./loadAgentsDir-
|
|
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{Lt as a,_ as o,g as s,jt as c,mn as l,p as u}from"./loadAgentsDir-B0Anodo0.js";import{Jn as d,qn as f}from"./state-B4jiUise.js";import{n as p,t as m}from"./cwd-Pa83R95t.js";import{I as h,M as g,c as _,f as v,i as ee,u as y}from"./debug-Bglx1aTu.js";import{Ir as b,Lr as x,Or as te,er as ne,h as re,nr as ie,t as ae}from"./settings-B2jvL8Dp.js";import{p as oe,s as se}from"./config-C-Y2qtB2.js";import{i as ce,n as S}from"./execFileNoThrow-BTachNBI.js";import{o as le,s as C}from"./log-D2TIwHBV.js";import{n as ue,r as w}from"./analytics-DJobLaWP.js";import{a as de,s as fe}from"./ripgrep-Dl3y5r4m.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,xe,Se,Ce,A,j,we,Te=e((()=>{n(),ye=16,be=8,D=6,O=4,k=8,xe=3,Se=1,Ce=100,A=64,j=new Int32Array(A),we=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,Ce)}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,A),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++){j[0]=g[e];let n=0,o=0,u=j[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}j[e]=t;let i=t-u-1;i===0?o+=O:n+=xe+i*Se,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,j[0],!0);for(let e=1;e<i;e++)f+=me(v,j[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 M(){return z||(z=new we),z}function Ee(){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 N(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 De(){let e=te(m());if(!e)return null;try{return pe(T.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function P(e,t,n){return n===t?e:e.map(e=>{let r=T.join(t,e);return T.relative(n,r)})}async function Oe(e){if(e.length===0||!z||W.length===0)return;let t=await I(e),n=[...W,...G,...K,...e,...t],r=N(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 F(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 ke(e,t){let n=Date.now();_(`[FileIndex] getFilesUsingGit called`);let r=m(),i=te(r);if(!i)return _(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await S(b(),[`-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=P(o.stdout.trim().split(`
|
|
2
2
|
`).filter(Boolean),i,r),c=await F(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=S(b(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=P(e.stdout.trim().split(`
|
|
3
3
|
`).filter(Boolean),i,r),n=await F(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`),Oe(t)}}).catch(e=>{_(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return _(`[FileIndex] git ls-files error: ${g(e)}`),null}}async function I(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(u.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 ke(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=M();try{let n=ae(),r=se(),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 I(c);K=l;let u=[...l,...c],d=N(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=De();if(z&&!(e!==null&&e!==X)&&Date.now()-Y<He)return;let t=H,n=Date.now();M(),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: ${g(e)}`),C(e),t===H&&(B=null),M()))}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(ae().fileSuggestion?.type===`command`)return(await a({...c(),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),s(),Te(),ue(),oe(),p(),ee(),h(),ce(),v(),x(),l(),le(),ie(),de(),re(),d(),z=null,B=null,V=f(),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,Ee as n,Ve as o,Fe as r,R as s,ze as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
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-DfkgIdYf.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{C as c,v as l,w as u}from"./esm-BbMeEYcz.js";import{Tt as d,Z as f,_ as ee,c as te,et as p,it as ne,n as re,o as ie,t as ae,v as oe,w as m,wt as se}from"./esm-eTAUP-La.js";import{n as h,t as ce}from"./axios-DaWTGg7G.js";import{d as le,l as ue}from"./types-Dx7P7JLQ.js";import{It as g,st as _}from"./state-B4jiUise.js";import{n as de,t as fe}from"./cwd-Pa83R95t.js";import{C as v,I as pe,M as me,V as he,x as ge,z as _e}from"./debug-Bglx1aTu.js";import{Gt as ve,qt as ye}from"./settings-B2jvL8Dp.js";import{p as y,u as b}from"./config-C-Y2qtB2.js";import{a as be,s as xe}from"./execFileNoThrow-BTachNBI.js";import{d as Se,o as Ce,p as x,s as S}from"./log-D2TIwHBV.js";import{a as we,i as Te,o as Ee}from"./platform-BacQ6ACS.js";import{i as De,n as Oe}from"./analytics-DJobLaWP.js";import{n as ke,r as C}from"./startupProfiler-CJdr3SxP.js";import*as w from"path";import{randomUUID as T}from"crypto";import{appendFile as Ae,mkdir as E,readdir as je,unlink as D,writeFile as Me}from"fs/promises";function O(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var k=e((()=>{}));function A(){return i(process.env.CLAUDE_CODE_USE_BEDROCK)||i(process.env.CLAUDE_CODE_USE_VERTEX)||i(process.env.CLAUDE_CODE_USE_FOUNDRY)||x()}function Ne(){return x()}var Pe=e((()=>{a(),Se()}));async function Fe(){}var Ie,j,M=e((()=>{xe(),n(),g(),y(),de(),ye(),a(),Ie=t(e=>({deviceId:b(),sessionId:_(),email:void 0,appVersion:`0.0.23`,platform:ve(),userType:process.env.USER_TYPE,...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}}})),j=t(async()=>{let e=await be(`git config --get user.email`,{shell:!0,reject:!1,cwd:fe()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function Le(){return{seconds:0,nanos:0}}function N(e){return e!=null}var P,Re=e((()=>{P={fromJSON(e){return{seconds:N(e.seconds)?globalThis.Number(e.seconds):0,nanos:N(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 P.fromPartial(e??{})},fromPartial(e){let t=Le();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function ze(){return{account_id:0,organization_uuid:``,account_uuid:``}}function F(e){return e!=null}var I,Be=e((()=>{I={fromJSON(e){return{account_id:F(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:F(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:F(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 I.fromPartial(e??{})},fromPartial(e){let t=ze();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function Ve(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function He(){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 Ue(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function We(){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 Ge(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function L(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):Ge(P.fromJSON(e))}function R(e){return e!=null}var z,B,V,H,Ke=e((()=>{Re(),Be(),z={fromJSON(e){return{actor_id:R(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:R(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:R(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 z.fromPartial(e??{})},fromPartial(e){let t=Ve();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},B={fromJSON(e){return{platform:R(e.platform)?globalThis.String(e.platform):``,node_version:R(e.node_version)?globalThis.String(e.node_version):``,terminal:R(e.terminal)?globalThis.String(e.terminal):``,package_managers:R(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:R(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:R(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:R(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:R(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:R(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:R(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:R(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:R(e.version)?globalThis.String(e.version):``,github_event_name:R(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:R(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:R(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:R(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:R(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:R(e.github_actions_metadata)?z.fromJSON(e.github_actions_metadata):void 0,arch:R(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:R(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:R(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:R(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:R(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:R(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:R(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:R(e.version_base)?globalThis.String(e.version_base):``,coworker_type:R(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:R(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:R(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:R(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:R(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:R(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:R(e.vcs)?globalThis.String(e.vcs):``,platform_raw:R(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=z.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 B.fromPartial(e??{})},fromPartial(e){let t=He();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?z.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}},V={fromJSON(e){return{slack_team_id:R(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:R(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:R(e.trigger)?globalThis.String(e.trigger):``,creation_method:R(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 V.fromPartial(e??{})},fromPartial(e){let t=Ue();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}},H={fromJSON(e){return{event_name:R(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:R(e.client_timestamp)?L(e.client_timestamp):void 0,model:R(e.model)?globalThis.String(e.model):``,session_id:R(e.session_id)?globalThis.String(e.session_id):``,user_type:R(e.user_type)?globalThis.String(e.user_type):``,betas:R(e.betas)?globalThis.String(e.betas):``,env:R(e.env)?B.fromJSON(e.env):void 0,entrypoint:R(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:R(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:R(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:R(e.client_type)?globalThis.String(e.client_type):``,process:R(e.process)?globalThis.String(e.process):``,additional_metadata:R(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:R(e.auth)?I.fromJSON(e.auth):void 0,server_timestamp:R(e.server_timestamp)?L(e.server_timestamp):void 0,event_id:R(e.event_id)?globalThis.String(e.event_id):``,device_id:R(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:R(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:R(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:R(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:R(e.email)?globalThis.String(e.email):``,agent_id:R(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:R(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:R(e.agent_type)?globalThis.String(e.agent_type):``,slack:R(e.slack)?V.fromJSON(e.slack):void 0,team_name:R(e.team_name)?globalThis.String(e.team_name):``,skill_name:R(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:R(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:R(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=B.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=I.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=V.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 H.fromPartial(e??{})},fromPartial(e){let t=We();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?B.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?I.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?V.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 U(){return w.join(r(),`telemetry`)}function qe(e){if(!h.isAxiosError(e))return me(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 W,G,K,Je=e((()=>{oe(),ce(),g(),Ke(),a(),pe(),ue(),Ce(),k(),ge(),d(),Oe(),p(),o(),W=T(),G=`1p_failed_events.`,K=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,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.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 w.join(U(),`${G}${_()}.${W}.json`)}async loadEventsFromFile(e){try{return await le(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await D(e)}catch{}else await E(U(),{recursive:!0}),await Me(e,`${t.map(e=>v(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-DfkgIdYf.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{C as c,v as l,w as u}from"./esm-BbMeEYcz.js";import{Tt as d,Z as f,_ as ee,c as te,et as p,it as ne,n as re,o as ie,t as ae,v as oe,w as m,wt as se}from"./esm-BXTZz3av.js";import{n as h,t as ce}from"./axios-DaWTGg7G.js";import{d as le,l as ue}from"./types-Dx7P7JLQ.js";import{It as g,st as _}from"./state-B4jiUise.js";import{n as de,t as fe}from"./cwd-Pa83R95t.js";import{C as v,I as pe,M as me,V as he,x as ge,z as _e}from"./debug-Bglx1aTu.js";import{Gt as ve,qt as ye}from"./settings-B2jvL8Dp.js";import{p as y,u as b}from"./config-C-Y2qtB2.js";import{a as be,s as xe}from"./execFileNoThrow-BTachNBI.js";import{d as Se,o as Ce,p as x,s as S}from"./log-D2TIwHBV.js";import{a as we,i as Te,o as Ee}from"./platform-BacQ6ACS.js";import{i as De,n as Oe}from"./analytics-DJobLaWP.js";import{n as ke,r as C}from"./startupProfiler-CJdr3SxP.js";import*as w from"path";import{randomUUID as T}from"crypto";import{appendFile as Ae,mkdir as E,readdir as je,unlink as D,writeFile as Me}from"fs/promises";function O(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var k=e((()=>{}));function A(){return i(process.env.CLAUDE_CODE_USE_BEDROCK)||i(process.env.CLAUDE_CODE_USE_VERTEX)||i(process.env.CLAUDE_CODE_USE_FOUNDRY)||x()}function Ne(){return x()}var Pe=e((()=>{a(),Se()}));async function Fe(){}var Ie,j,M=e((()=>{xe(),n(),g(),y(),de(),ye(),a(),Ie=t(e=>({deviceId:b(),sessionId:_(),email:void 0,appVersion:`0.0.24`,platform:ve(),userType:process.env.USER_TYPE,...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}}})),j=t(async()=>{let e=await be(`git config --get user.email`,{shell:!0,reject:!1,cwd:fe()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function Le(){return{seconds:0,nanos:0}}function N(e){return e!=null}var P,Re=e((()=>{P={fromJSON(e){return{seconds:N(e.seconds)?globalThis.Number(e.seconds):0,nanos:N(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 P.fromPartial(e??{})},fromPartial(e){let t=Le();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function ze(){return{account_id:0,organization_uuid:``,account_uuid:``}}function F(e){return e!=null}var I,Be=e((()=>{I={fromJSON(e){return{account_id:F(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:F(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:F(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 I.fromPartial(e??{})},fromPartial(e){let t=ze();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function Ve(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function He(){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 Ue(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function We(){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 Ge(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function L(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):Ge(P.fromJSON(e))}function R(e){return e!=null}var z,B,V,H,Ke=e((()=>{Re(),Be(),z={fromJSON(e){return{actor_id:R(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:R(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:R(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 z.fromPartial(e??{})},fromPartial(e){let t=Ve();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},B={fromJSON(e){return{platform:R(e.platform)?globalThis.String(e.platform):``,node_version:R(e.node_version)?globalThis.String(e.node_version):``,terminal:R(e.terminal)?globalThis.String(e.terminal):``,package_managers:R(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:R(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:R(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:R(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:R(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:R(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:R(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:R(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:R(e.version)?globalThis.String(e.version):``,github_event_name:R(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:R(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:R(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:R(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:R(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:R(e.github_actions_metadata)?z.fromJSON(e.github_actions_metadata):void 0,arch:R(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:R(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:R(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:R(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:R(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:R(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:R(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:R(e.version_base)?globalThis.String(e.version_base):``,coworker_type:R(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:R(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:R(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:R(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:R(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:R(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:R(e.vcs)?globalThis.String(e.vcs):``,platform_raw:R(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=z.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 B.fromPartial(e??{})},fromPartial(e){let t=He();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?z.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}},V={fromJSON(e){return{slack_team_id:R(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:R(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:R(e.trigger)?globalThis.String(e.trigger):``,creation_method:R(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 V.fromPartial(e??{})},fromPartial(e){let t=Ue();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}},H={fromJSON(e){return{event_name:R(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:R(e.client_timestamp)?L(e.client_timestamp):void 0,model:R(e.model)?globalThis.String(e.model):``,session_id:R(e.session_id)?globalThis.String(e.session_id):``,user_type:R(e.user_type)?globalThis.String(e.user_type):``,betas:R(e.betas)?globalThis.String(e.betas):``,env:R(e.env)?B.fromJSON(e.env):void 0,entrypoint:R(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:R(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:R(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:R(e.client_type)?globalThis.String(e.client_type):``,process:R(e.process)?globalThis.String(e.process):``,additional_metadata:R(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:R(e.auth)?I.fromJSON(e.auth):void 0,server_timestamp:R(e.server_timestamp)?L(e.server_timestamp):void 0,event_id:R(e.event_id)?globalThis.String(e.event_id):``,device_id:R(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:R(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:R(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:R(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:R(e.email)?globalThis.String(e.email):``,agent_id:R(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:R(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:R(e.agent_type)?globalThis.String(e.agent_type):``,slack:R(e.slack)?V.fromJSON(e.slack):void 0,team_name:R(e.team_name)?globalThis.String(e.team_name):``,skill_name:R(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:R(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:R(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=B.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=I.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=V.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 H.fromPartial(e??{})},fromPartial(e){let t=We();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?B.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?I.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?V.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 U(){return w.join(r(),`telemetry`)}function qe(e){if(!h.isAxiosError(e))return me(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 W,G,K,Je=e((()=>{oe(),ce(),g(),Ke(),a(),pe(),ue(),Ce(),k(),ge(),d(),Oe(),p(),o(),W=T(),G=`1p_failed_events.`,K=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,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.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 w.join(U(),`${G}${_()}.${W}.json`)}async loadEventsFromFile(e){try{return await le(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await D(e)}catch{}else await E(U(),{recursive:!0}),await Me(e,`${t.map(e=>v(e)).join(`
|
|
2
2
|
`)}\n`,`utf8`)}catch(e){S(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await E(U(),{recursive:!0}),await Ae(e,`${t.map(e=>v(e)).join(`
|
|
3
|
-
`)}\n`,`utf8`)}catch(e){S(e)}}async deleteFile(e){try{await D(e)}catch{}}async retryPreviousBatches(){try{let e=`${G}${_()}.`,t;try{t=(await je(U())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(W))}catch(e){if(_e(e))return;throw e}for(let e of t){let t=w.join(U(),e);this.retryFileInBackground(t)}}catch(e){S(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:m.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:m.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:m.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:m.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:m.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:m.SUCCESS})}catch(e){S(e),t({code:m.FAILED,error:he(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=qe(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await O(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}`;S(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":se(),"x-service-name":`workmate`};try{let n=await h.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}catch(e){throw e}}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:H.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:_(),additional_metadata:Buffer.from(v({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=ne(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=De(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:H.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(v(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 q(e){return!1}var Ye=e((()=>{}));function J(){return{}}function Xe(e){let t=J()[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 Ze(){if($)try{await $.shutdown()}catch{}}function Y(){return!A()}async function Qe(e,t,n={}){try{let r=await f({model:n.model,betas:n.betas}),i={event_name:t,event_id:T(),core_metadata:r,user_metadata:Ie(!0),event_metadata:n},a=b();a&&(i.user_id=a),e.emit({body:t,attributes:i})}catch{}}function $e(e,t={}){Y()&&(!Q||q(`firstParty`)||Qe(Q,e,t))}function et(){if(C(`1p_event_logging_start`),!Y())return;C(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||X.toString(),10),t=Z,n=tt,r=Te(),i={[c]:`workmate`,[u]:`0.0.
|
|
3
|
+
`)}\n`,`utf8`)}catch(e){S(e)}}async deleteFile(e){try{await D(e)}catch{}}async retryPreviousBatches(){try{let e=`${G}${_()}.`,t;try{t=(await je(U())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(W))}catch(e){if(_e(e))return;throw e}for(let e of t){let t=w.join(U(),e);this.retryFileInBackground(t)}}catch(e){S(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:m.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:m.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:m.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:m.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:m.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:m.SUCCESS})}catch(e){S(e),t({code:m.FAILED,error:he(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=qe(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await O(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}`;S(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":se(),"x-service-name":`workmate`};try{let n=await h.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}catch(e){throw e}}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:H.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:_(),additional_metadata:Buffer.from(v({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=ne(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=De(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:H.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(v(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 q(e){return!1}var Ye=e((()=>{}));function J(){return{}}function Xe(e){let t=J()[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 Ze(){if($)try{await $.shutdown()}catch{}}function Y(){return!A()}async function Qe(e,t,n={}){try{let r=await f({model:n.model,betas:n.betas}),i={event_name:t,event_id:T(),core_metadata:r,user_metadata:Ie(!0),event_metadata:n},a=b();a&&(i.user_id=a),e.emit({body:t,attributes:i})}catch{}}function $e(e,t={}){Y()&&(!Q||q(`firstParty`)||Qe(Q,e,t))}function et(){if(C(`1p_event_logging_start`),!Y())return;C(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||X.toString(),10),t=Z,n=tt,r=Te(),i={[c]:`workmate`,[u]:`0.0.24`};if(r===`wsl`){let e=we();e&&(i[`wsl.version`]=e)}$=new ie({resource:ee(i),processors:[new re(new K({maxBatchSize:t,isKilled:()=>q(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.24`)}var X,Z,tt,Q,$,nt=e((()=>{te(),ae(),l(),y(),Ee(),ke(),M(),Pe(),Je(),p(),Ye(),X=1e4,Z=200,tt=8192,Q=null,$=null}));export{$e as a,j as c,Pe as d,A as f,O as h,Y as i,Fe as l,k as m,nt as n,Xe as o,Ne as p,et as r,Ze as s,J as t,M as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./firstPartyEventLogger-QmjjQmgt.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{KS as t,PS as n,WS as r,YS as i,Yi as a,ZS as o,da as s,eC as c,et as l,iS as u,la as d,qS as f,rt as p}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{KS as t,PS as n,WS as r,YS as i,Yi as a,ZS as o,da as s,eC as c,et as l,iS as u,la as d,qS as f,rt as p}from"./loadAgentsDir-B0Anodo0.js";import{I as m,M as h,c as g,i as _}from"./debug-Bglx1aTu.js";import{c as v,i as y}from"./proxy-CDBfZjO7.js";import{randomUUID as b}from"crypto";function x(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={};for(let e of a.split(`
|
|
2
2
|
`)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`))continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);r===`data`&&(o.data=o.data?`${o.data}\n${i}`:i)}o.data&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function S(){return(process.env.GEMINI_BASE_URL||T).replace(/\/+$/,``)}function C(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*w(e){let t=await(e.fetchOverride??fetch)(`${S()}/${C(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,...y({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,E);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: ${h(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: ${h(e)}`)}}finally{n.releaseLock()}}var T,E,D=e((()=>{m(),v(),T=`https://generativelanguage.googleapis.com/v1beta`,E={stream:!0}}));async function*O(e,n,a,l,m,h){try{let u=c(m.model),_=s(e,a),v=(await Promise.all(a.map(e=>p(e,{getToolPermissionContext:m.getToolPermissionContext,tools:a,agents:m.agents,allowedAgentTypes:m.allowedAgentTypes,model:m.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:y,systemInstruction:x}=i(_,n),S=f(v),C=t(m.toolChoice),T=w({model:u,signal:l,fetchOverride:m.fetchOverride,body:{contents:y,...x&&{systemInstruction:x},...S.length>0&&{tools:S},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...m.temperatureOverride!==void 0&&{temperature:m.temperatureOverride},...h.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...h.type===`enabled`&&{thinkingBudget:h.budgetTokens}}}}}});g(`[Gemini] Calling model=${u}, messages=${y.length}, tools=${S.length}`);let E=r(T,u),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[o]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:d([t],a,m.agentId)},requestId:void 0,type:`assistant`,uuid:b(),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);g(`[Gemini] Error: ${t}`,{level:`error`}),yield u({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{l(),_(),a(),D(),n()}))();export{O as queryModelGemini};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{X as t,Yi as n,Yx as r,Z as i,aC as a,qg as o}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{X as t,Yi as n,Yx as r,Z as i,aC as a,qg as o}from"./loadAgentsDir-B0Anodo0.js";import{f as s,l as c}from"./types-Dx7P7JLQ.js";import{I as l,M as u,c as d,i as f}from"./debug-Bglx1aTu.js";import{r as p,t as m}from"./sessionTitle-k4wpUS5l.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await i({systemPrompt:a([`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:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),o=s(Array.isArray(e.message.content)?r(e.message.content):e.message.content);return o&&typeof o==`object`&&`name`in o&&typeof o.name==`string`?o.name:null}catch(e){return d(`generateSessionName failed: ${u(e)}`,{level:`error`}),null}}var g=e((()=>{t(),f(),l(),c(),n(),p(),o()}));export{g as n,h as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$c as t,Ag as n,Fg as r,Qc as i,al as a,cl as o,dl as s,el as c,fl as l,il as u,ll as d,nl as f,ol as p,pl as m,rl as h,tl as g}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$c as t,Ag as n,Fg as r,Qc as i,al as a,cl as o,dl as s,el as c,fl as l,il as u,ll as d,nl as f,ol as p,pl as m,rl as h,tl as g}from"./loadAgentsDir-B0Anodo0.js";import{I as _,P as v,t as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{t as x}from"./select-DIxfl_VN.js";import{t as S}from"./CustomSelect-wmZ9jz0W.js";import{n as C,t as w}from"./PermissionDialog-BaibiQae.js";function T({currentGoal:e,newObjective:t,onConfirm:n,onCancel:r}){function i(e){e===`yes`?n():r()}let o=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,E.jsx)(w,{color:`warning`,title:`Replace active goal?`,children:(0,E.jsxs)(_,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,E.jsx)(v,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,E.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(v,{dimColor:!0,children:`Current goal:`}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Status: `}),a(e.status)]}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Time: `}),u(e)]}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Tokens: `}),o]})]}),(0,E.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(v,{dimColor:!0,children:`New objective:`}),(0,E.jsx)(v,{children:t})]}),(0,E.jsx)(_,{marginTop:1,children:(0,E.jsx)(x,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:i,onCancel:r})})]})})}var E,D=e((()=>{y(),S(),C(),d(),E=b()}));function O(e){let t=e.split(`
|
|
2
2
|
`)[0]??e;return t.length<=F?t:`${t.slice(0,F)}…`}function k(){r(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function A(){let e=p();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: ${a(e.status)}`,`Time: ${u(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
3
|
`)}function j(e){return m(e),o(),t(),`Goal set.`}async function M(e,n,r){let i=r.trim();if(!i||i.toLowerCase()===`status`)return e(A(),{display:`system`}),null;let a=i.toLowerCase();if(a===`clear`){let t=g();return t&&(c(),k()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(a===`pause`){let n=s();return n&&(t(),k()),e(n?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(a===`resume`){if(p()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let n=l();return n&&t(),e(n?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!n}),null}if(a===`continue`){let n=h();return n&&t(),e(n?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!n}),null}if(a===`complete`){let n=f();return n&&(t(),k()),e(n?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(i.length>P)return e(`Goal objective is too long (${i.length} chars; limit ${P}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let o=p();return o&&o.status!==`complete`?(0,N.jsx)(T,{currentGoal:o,newObjective:i,onConfirm:()=>{k(),e(j(i),{display:`system`,shouldQuery:!0,displayArgs:O(i),metaMessages:[`<goal-objective-updated>\n${i}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(j(i),{display:`system`,shouldQuery:!0,displayArgs:O(i),metaMessages:[`<goal-objective-updated>\n${i}\n</goal-objective-updated>`]}),null)}var N,P,F;e((()=>{d(),i(),n(),D(),N=b(),P=4e3,F=80}))();export{M as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{BS as t,FS as n,LS as r,PS as i,RS as a,Yi as o,da as s,et as c,iS as l,la as u,nC as d,n_ as f,o_ as p,rt as m}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{BS as t,FS as n,LS as r,PS as i,RS as a,Yi as o,da as s,et as c,iS as l,la as u,nC as d,n_ as f,o_ as p,rt as m}from"./loadAgentsDir-B0Anodo0.js";import{c as h,i as g}from"./debug-Bglx1aTu.js";import{M as _,k as v}from"./model-BvQFFOf8.js";import{n as y,t as b}from"./client-CpTCeWba.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,p){try{let l=d(p.model),g=s(e,o),_=(await Promise.all(o.map(e=>m(e,{getToolPermissionContext:p.getToolPermissionContext,tools:o,agents:p.agents,allowedAgentTypes:p.allowedAgentTypes,model:p.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=t(g,i),S=a(_),w=r(p.toolChoice),T=b({maxRetries:0,fetchOverride:p.fetchOverride,source:p.querySource});h(`[Grok] Calling model=${l}, messages=${y.length}, tools=${S.length}`);let E=n(await T.chat.completions.create({model:l,messages:y,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...p.temperatureOverride!==void 0&&{temperature:p.temperatureOverride}},{signal:c}),l),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:u([t],o,p.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&&f(v(l,k),k,p.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);h(`[Grok] Error: ${t}`,{level:`error`}),yield l({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{y(),S(),i(),o(),c(),g(),p(),_()}))();export{w as queryModelGrok};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ei as n,Ni as r,Si as i,bb as a,gb as o,hb as s,mb as c}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ei as n,Ni as r,Si as i,bb as a,gb as o,hb as s,mb as c}from"./loadAgentsDir-B0Anodo0.js";import{I as l,Lt as u,P as d,Wt as f,a as p,ai as m,n as h,ot as g,r as _,t as v,x as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{v as x,y as S}from"./startupProfiler-CJdr3SxP.js";import{n as C,t as w}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{n as T,t as E}from"./select-DIxfl_VN.js";import{n as D,r as O}from"./modalContext-DDZdU1J8.js";import{n as k,t as A}from"./PromptInputHelpMenu-3QNUC2Cg.js";function j({commands:e,maxHeight:t,columns:r,title:i,onCancel:a,emptyMessage:o}){let{headerFocused:s,focusHeader:c}=p(),u=Math.max(1,r-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:S(n(e),u,!0)}))},[e,u]);return(0,N.jsx)(l,{flexDirection:`column`,paddingY:1,children:e.length===0&&o?(0,N.jsx)(d,{dimColor:!0,children:o}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d,{children:i}),(0,N.jsx)(l,{marginTop:1,children:(0,N.jsx)(E,{options:m,visibleOptionCount:f,onCancel:a,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:c,isDisabled:s})})]})})}var M,N,P=e((()=>{M=t(m(),1),r(),x(),v(),T(),N=b()}));function F(){return(0,I.jsxs)(l,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(d,{bold:!0,children:`Getting started`}),(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(d,{children:[(0,I.jsx)(d,{bold:!0,children:`1. `}),(0,I.jsx)(d,{children:`Ask a question or describe a task — Work Mate will explore your code and respond.`})]}),(0,I.jsxs)(d,{children:[(0,I.jsx)(d,{bold:!0,children:`2. `}),(0,I.jsx)(d,{children:`When Work Mate wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(d,{children:[(0,I.jsx)(d,{bold:!0,children:`3. `}),(0,I.jsx)(d,{children:`Type `}),(0,I.jsx)(d,{bold:!0,children:`/help`}),(0,I.jsx)(d,{children:` for commands, or `}),(0,I.jsx)(d,{bold:!0,children:`?`}),(0,I.jsx)(d,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsx)(l,{children:(0,I.jsx)(d,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{v(),k(),I=b()}));function R({onClose:e,commands:t}){let{rows:n,columns:r}=g(),a=Math.floor(n/2),s=O(),c=()=>e(`Help dialog dismissed`,{display:`system`});f(`help:dismiss`,c,{context:`Help`});let p=C(c),m=o(`help:dismiss`,`Help`,`esc`),v=i(),b=t.filter(e=>v.has(e.name)&&!e.isHidden),x=t.filter(e=>!v.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(h,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(h,{title:`commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:a,columns:r,title:`Browse default commands:`,onCancel:c})},`commands`)),S.push((0,z.jsx)(h,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:x,maxHeight:a,columns:r,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:c})},`custom`)),(0,z.jsx)(l,{flexDirection:`column`,height:s?void 0:a,children:(0,z.jsxs)(y,{color:`professionalBlue`,children:[(0,z.jsx)(_,{title:`Work Mate v0.0.24`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(l,{marginTop:1,children:(0,z.jsxs)(d,{children:[`For more help: `,(0,z.jsx)(u,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(l,{marginTop:1,children:(0,z.jsx)(d,{dimColor:!0,children:p.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,p.keyName,` again to exit`]}):(0,z.jsxs)(d,{italic:!0,children:[m,` to cancel`]})})})]})})}var z,B=e((()=>{w(),s(),r(),D(),a(),v(),c(),P(),L(),z=b()})),V,H;e((()=>{B(),V=b(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-DfkgIdYf.js";import{It as i,Q as a,st as o}from"./state-B4jiUise.js";import{$ as s,C as c,I as l,N as u,S as d,c as f,et as p,f as m,h,i as g,x as _}from"./debug-Bglx1aTu.js";import{b as v,x as y}from"./config-C-Y2qtB2.js";import{h as b,m as x}from"./firstPartyEventLogger-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-DfkgIdYf.js";import{It as i,Q as a,st as o}from"./state-B4jiUise.js";import{$ as s,C as c,I as l,N as u,S as d,c as f,et as p,f as m,h,i as g,x as _}from"./debug-Bglx1aTu.js";import{b as v,x as y}from"./config-C-Y2qtB2.js";import{h as b,m as x}from"./firstPartyEventLogger-QmjjQmgt.js";import{a as S,i as C,n as w,r as T}from"./pasteStore-P0zP-ch0.js";import{join as E}from"path";import{appendFile as D,writeFile as O}from"fs/promises";function k(e){return(e.match(/\r\n|\r|\n/g)||[]).length}function A(e,t){return t===0?`[Pasted text #${e}]`:`[Pasted text #${e} +${t} lines]`}function j(e){return`[Image #${e}]`}function M(e){return[...e.matchAll(/\[(Pasted text|Image|\.\.\.Truncated text) #(\d+)(?: \+\d+ lines)?(\.)*\]/g)].map(e=>({id:parseInt(e[2]||`0`,10),match:e[0],index:e.index})).filter(e=>e.id>0)}function N(e,t){let n=M(e),r=e;for(let e=n.length-1;e>=0;e--){let i=n[e],a=t[i.id];a?.type===`text`&&(r=r.slice(0,i.index)+a.content+r.slice(i.index+i.match.length))}return r}function P(e){return d(e)}async function*F(){let e=o();for(let e=q.length-1;e>=0;e--)yield q[e];let n=E(t(),`history.jsonl`);try{for await(let t of h(n))try{let n=P(t);if(n.sessionId===e&&Q.has(n.timestamp))continue;yield n}catch(e){f(`Failed to parse history line: ${e}`)}}catch(e){if(u(e)===`ENOENT`)return;throw e}}async function*I(){for await(let e of F())yield await z(e)}async function*L(){let e=a(),t=o(),n=[],r=0;for await(let i of F())if(!(!i||typeof i.project!=`string`)&&i.project===e&&(i.sessionId===t?(yield await z(i),r++):n.push(i),r+n.length>=G))break;for(let e of n){if(r>=G)return;yield await z(e),r++}}async function R(e){if(e.content)return{id:e.id,type:e.type,content:e.content,mediaType:e.mediaType,filename:e.filename};if(e.contentHash){let t=await C(e.contentHash);if(t)return{id:e.id,type:e.type,content:t,mediaType:e.mediaType,filename:e.filename}}return null}async function z(e){let t={};for(let[n,r]of Object.entries(e.pastedContents||{})){let e=await R(r);e&&(t[Number(n)]=e)}return{display:e.display,pastedContents:t}}async function B(){if(q.length===0)return;let e;try{let n=E(t(),`history.jsonl`);await O(n,``,{encoding:`utf8`,mode:384,flag:`a`}),e=await y(n,{stale:1e4,retries:{retries:3,minTimeout:50}});let r=q.map(e=>`${c(e)}\n`);q=[],await D(n,r.join(``),{mode:384})}catch(e){f(`Failed to write prompt history: ${e}`)}finally{e&&await e()}}async function V(e){if(!(J||q.length===0)&&!(e>5)){J=!0;try{await B()}finally{J=!1,q.length>0&&(await b(500),V(e+1))}}}async function H(e){let t=typeof e==`string`?{display:e,pastedContents:{}}:e,n={};if(t.pastedContents){for(let[e,r]of Object.entries(t.pastedContents))if(r.type!==`image`)if(r.content.length<=K)n[Number(e)]={id:r.id,type:r.type,content:r.content,mediaType:r.mediaType,filename:r.filename};else{let t=w(r.content);n[Number(e)]={id:r.id,type:r.type,contentHash:t,mediaType:r.mediaType,filename:r.filename},S(t,r.content)}}let r={...t,pastedContents:n,timestamp:Date.now(),project:a(),sessionId:o()};q.push(r),Z=r,Y=V(0)}function U(e){n(process.env.CLAUDE_CODE_SKIP_PROMPT_HISTORY)||(X||(X=!0,p(async()=>{Y&&await Y,q.length>0&&await B()})),H(e))}function W(){if(!Z)return;let e=Z;Z=null;let t=q.lastIndexOf(e);t===-1?Q.add(e.timestamp):q.splice(t,1)}var G,K,q,J,Y,X,Z,Q,$=e((()=>{i(),s(),g(),r(),l(),m(),v(),T(),x(),_(),G=100,K=1024,q=[],J=!1,Y=null,X=!1,Z=null,Q=new Set}));export{L as a,I as c,A as i,M as l,N as n,k as o,j as r,$ as s,U as t,W as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Kt as e,mn as t,on as n}from"./loadAgentsDir-B0Anodo0.js";t();export{e as executeSessionEndHooks,n as getSessionEndHookTimeoutMs};
|
|
@@ -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{Cd as o,Ec as s,Ed as c,Hp as l,Ip as u,Lp as d,Rp as ee,Sd as f,Tc as p,Td as m,Up as h,bd as g,mb as _,wd as v,xd as y}from"./loadAgentsDir-
|
|
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{Cd as o,Ec as s,Ed as c,Hp as l,Ip as u,Lp as d,Rp as ee,Sd as f,Tc as p,Td as m,Up as h,bd as g,mb as _,wd as v,xd as y}from"./loadAgentsDir-B0Anodo0.js";import{I as b,Lt as x,P as S,Wt as C,ai as w,t as T,y as E}from"./src-DL3w8VPk.js";import{t as D}from"./jsx-runtime-Bb4Xn-E0.js";import{It as O,rt as te}from"./state-B4jiUise.js";import{d as k,h as ne,s as A}from"./settings-B2jvL8Dp.js";import{l as j,o as M}from"./stringUtils-C718f5ey.js";import{n as N,r as re}from"./analytics-DJobLaWP.js";import{n as P,t as F}from"./select-DIxfl_VN.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);g(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=te();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 c(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(),O(),m(),L=n(e=>({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).
|