@readmagic/workmate 0.0.23 → 0.0.25

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.
Files changed (402) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-Y5S_lMjD.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-Bnb1jWcg.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-DVbU-BaD.js +1 -0
  4. package/dist/chunks/App-B8q8PV77.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-i0TkZgQp.js +2 -0
  6. package/dist/chunks/BypassPermissionsModeDialog-DjqGAL4C.js +1 -0
  7. package/dist/chunks/CustomSelect-BvTftqEH.js +1 -0
  8. package/dist/chunks/DiffDialog-v5r8cBKW.js +6 -0
  9. package/dist/chunks/Doctor-DKpBnbuI.js +1 -0
  10. package/dist/chunks/Doctor-uvO6NM5m.js +3 -0
  11. package/dist/chunks/ExitFlow-Dh9QdaYK.js +2 -0
  12. package/dist/chunks/InvalidConfigDialog-C9boykQn.js +1 -0
  13. package/dist/chunks/{InvalidSettingsDialog-Dtmpzeps.js → InvalidSettingsDialog-UN5mleCK.js} +1 -1
  14. package/dist/chunks/KeybindingProviderSetup-DsJqfEt-.js +1 -0
  15. package/dist/chunks/MCPConnectionManager-DkZVxLEj.js +1 -0
  16. package/dist/chunks/MCPToolListView-De1W4jpj.js +1 -0
  17. package/dist/chunks/McpParsingWarnings-zkM_lGd0.js +1 -0
  18. package/dist/chunks/MessageSelector-DW_itlX-.js +3 -0
  19. package/dist/chunks/Messages-BFsCpACq.js +10 -0
  20. package/dist/chunks/Onboarding-BT90cFkn.js +1 -0
  21. package/dist/chunks/PromptInputFooterSuggestions-CCTZYbWI.js +1 -0
  22. package/dist/chunks/PromptInputHelpMenu-Bm5KY0Ma.js +1 -0
  23. package/dist/chunks/{ProviderSetup-XcBHjUnd.js → ProviderSetup-yIj8YOKF.js} +1 -1
  24. package/dist/chunks/QueryEngine-egz5mbaW.js +1 -0
  25. package/dist/chunks/REPL-D27CE4WN.js +124 -0
  26. package/dist/chunks/REPL-e8wAT1wN.js +1 -0
  27. package/dist/chunks/ResumeConversation-CWA27Lke.js +1 -0
  28. package/dist/chunks/SearchExtraToolsTool-BRchtZ9Q.js +1 -0
  29. package/dist/chunks/{SelectMulti-Bc6l11_K.js → SelectMulti-BW7Ffk1G.js} +1 -1
  30. package/dist/chunks/Settings-axHLvYIy.js +3 -0
  31. package/dist/chunks/Spinner-VjwI7m_g.js +1 -0
  32. package/dist/chunks/{SpinnerGlyph-CmkRUvHe.js → SpinnerGlyph-CqrOK3Mx.js} +1 -1
  33. package/dist/chunks/TextInput-Cev5Awdd.js +22 -0
  34. package/dist/chunks/ThemePicker-CtQYHmOr.js +1 -0
  35. package/dist/chunks/TrustDialog-8Sjmuu0e.js +1 -0
  36. package/dist/chunks/{ValidationErrorsList-DgNzJQUP.js → ValidationErrorsList-INwwoerV.js} +1 -1
  37. package/dist/chunks/_baseEach-DrPH_FGo.js +1 -0
  38. package/dist/chunks/add-dir-D3RMaYxy.js +1 -0
  39. package/dist/chunks/{agentDisplay-BReJUBWg.js → agentDisplay-B3npXoCS.js} +1 -1
  40. package/dist/chunks/{agents-B3x8yJ_r.js → agents-2mPGmeq6.js} +1 -1
  41. package/dist/chunks/agents-DEnmg8Xo.js +101 -0
  42. package/dist/chunks/allErrors-C9kx6lnk.js +1 -0
  43. package/dist/chunks/analytics-COpjZpvd.js +1 -0
  44. package/dist/chunks/{appleTerminalBackup-BArZWB21.js → appleTerminalBackup-CT7g8yOs.js} +1 -1
  45. package/dist/chunks/backgroundHousekeeping-BkFxfjOf.js +1 -0
  46. package/dist/chunks/backgroundHousekeeping-CvWfd99M.js +1 -0
  47. package/dist/chunks/banner-DHpTmEO7.js +2 -0
  48. package/dist/chunks/branch-Be_yDFU8.js +2 -0
  49. package/dist/chunks/{break-cache-BMXqFTeS.js → break-cache-UUt6Dkf2.js} +2 -2
  50. package/dist/chunks/btw-DUml5L1w.js +1 -0
  51. package/dist/chunks/caches-DWjwe-DN.js +1 -0
  52. package/dist/chunks/caches-VLs1tQkZ.js +1 -0
  53. package/dist/chunks/{claudeDesktop-D8ml2767.js → claudeDesktop-mBGFDbI6.js} +1 -1
  54. package/dist/chunks/{clear-Bdhb6b39.js → clear-CrGjNe6E.js} +1 -1
  55. package/dist/chunks/{client-CpTCeWba.js → client-BDuhbzLD.js} +1 -1
  56. package/dist/chunks/{client-4iqhC8xq.js → client-BYFVVMcf.js} +1 -1
  57. package/dist/chunks/client-CO_6v4yl.js +1 -0
  58. package/dist/chunks/client-DO-O441l.js +1 -0
  59. package/dist/chunks/commands-Cn1P7Tms.js +1 -0
  60. package/dist/chunks/compact-DGUhdXcc.js +2 -0
  61. package/dist/chunks/config-C7GTF4iI.js +1 -0
  62. package/dist/chunks/config-CWPHVTic.js +3 -0
  63. package/dist/chunks/config-Cox0TM2Z.js +1 -0
  64. package/dist/chunks/context-mV5zjqmc.js +1 -0
  65. package/dist/chunks/context-noninteractive--OuiZUzL.js +1 -0
  66. package/dist/chunks/{context-noninteractive-Dd4xIoP1.js → context-noninteractive-DvfVvmSE.js} +2 -2
  67. package/dist/chunks/conversation--y8PD2Lk.js +1 -0
  68. package/dist/chunks/conversation-BIPJEOwO.js +1 -0
  69. package/dist/chunks/conversationRecovery-BBJzrA0g.js +1 -0
  70. package/dist/chunks/crossProjectResume-CwZb3cEU.js +40 -0
  71. package/dist/chunks/cwd-BZMp3CZ8.js +1 -0
  72. package/dist/chunks/cwd-BvNt_018.js +1 -0
  73. package/dist/chunks/debug-CRnGsZOV.js +39 -0
  74. package/dist/chunks/{detectRepository-CfX8Lc0A.js → detectRepository-CsJLbVEe.js} +1 -1
  75. package/dist/chunks/{diff-BOAElpfQ.js → diff-DUEoNCnJ.js} +1 -1
  76. package/dist/chunks/{directoryCompletion-D_Rtg-4j.js → directoryCompletion-Bgi8DBT5.js} +1 -1
  77. package/dist/chunks/doctor-4NiE46ZG.js +1 -0
  78. package/dist/chunks/entry-D1iD76SW.js +13 -0
  79. package/dist/chunks/{esm-CGx9qY3q.js → esm-DUH16IqH.js} +1 -1
  80. package/dist/chunks/execAsync-D6SA-YsV.js +1 -0
  81. package/dist/chunks/{execFileNoThrow-BTachNBI.js → execFileNoThrow-BgRsj_SW.js} +3 -3
  82. package/dist/chunks/exit-CrsQsjbx.js +1 -0
  83. package/dist/chunks/extraUsage-BtHE-SBX.js +1 -0
  84. package/dist/chunks/extractMemories-kogJzpit.js +1 -0
  85. package/dist/chunks/fast-CuNVwVTr.js +1 -0
  86. package/dist/chunks/fast-RlFnwGRV.js +1 -0
  87. package/dist/chunks/fetchModelList-Cjow_QGy.js +1 -0
  88. package/dist/chunks/fetchModelList-uiCPVqbJ.js +1 -0
  89. package/dist/chunks/fileSuggestions-C96V9-Ne.js +3 -0
  90. package/dist/chunks/firstPartyEventLogger-CN9UOmEC.js +1 -0
  91. package/dist/chunks/firstPartyEventLogger-RR5rvDtk.js +1 -0
  92. package/dist/chunks/{gemini-D_ORb_L6.js → gemini-4YGElN3H.js} +2 -2
  93. package/dist/chunks/generateSessionName-BHIKyXpz.js +1 -0
  94. package/dist/chunks/{genericProcessUtils-DwQFuna9.js → genericProcessUtils-BNlr-QxM.js} +1 -1
  95. package/dist/chunks/getMachineId-bsd-DTYGimUN.js +1 -0
  96. package/dist/chunks/getMachineId-darwin-DqIFUVvd.js +2 -0
  97. package/dist/chunks/getMachineId-linux-CnCTmdzd.js +1 -0
  98. package/dist/chunks/getMachineId-unsupported-Cx21ssu1.js +1 -0
  99. package/dist/chunks/getMachineId-win-vZhex7KX.js +1 -0
  100. package/dist/chunks/goal-ePK_jLo3.js +3 -0
  101. package/dist/chunks/grok-DnmklTrm.js +1 -0
  102. package/dist/chunks/help-B7xRle-V.js +1 -0
  103. package/dist/chunks/history-kOw3CcLT.js +1 -0
  104. package/dist/chunks/hooks-BDY1jMbS.js +1 -0
  105. package/dist/chunks/{hooks-DIvN6gdv.js → hooks-BN5f58HY.js} +2 -2
  106. package/dist/chunks/install-DrMiHa2Q.js +1 -0
  107. package/dist/chunks/instrumentation-Oj5xagJG.js +21 -0
  108. package/dist/chunks/{job-R6c4-3c8.js → job-D9ypO0cd.js} +1 -1
  109. package/dist/chunks/keybindings-BRRN_eap.js +1 -0
  110. package/dist/chunks/launchLocalMemory-DliLezJw.js +3 -0
  111. package/dist/chunks/launchOnboarding-A-kk-7ID.js +8 -0
  112. package/dist/chunks/loadAgentsDir-CJAK4kif.js +1 -0
  113. package/dist/chunks/{loadAgentsDir-DlPbtIsS.js → loadAgentsDir-DGozQu_6.js} +550 -550
  114. package/dist/chunks/{loadPluginHooks-C_msxVIc.js → loadPluginHooks-BiHPKDaY.js} +1 -1
  115. package/dist/chunks/{loader-CICGtLp2.js → loader-CtoR-vO-.js} +1 -1
  116. package/dist/chunks/{localSearch-CK-sFzPm.js → localSearch-BU02Qsv9.js} +1 -1
  117. package/dist/chunks/localSearch-DyaB2Rm-.js +1 -0
  118. package/dist/chunks/{log-D2TIwHBV.js → log-DoSpAwRP.js} +1 -1
  119. package/dist/chunks/logoUtils-DLd6JKqW.js +1 -0
  120. package/dist/chunks/{magicDocs-BEF8D3if.js → magicDocs-Bj8LYrN2.js} +2 -2
  121. package/dist/chunks/main-B_09WbaG.js +345 -0
  122. package/dist/chunks/managedEnv-BJGfe3m7.js +1 -0
  123. package/dist/chunks/{managedEnv-OPlzUPbJ.js → managedEnv-CIWJsuty.js} +1 -1
  124. package/dist/chunks/mcp-1nBvcNxw.js +1 -0
  125. package/dist/chunks/mcp-7DXpXMdT.js +2 -0
  126. package/dist/chunks/mcp-kw99WVi2.js +6 -0
  127. package/dist/chunks/memory-CjWvzR_9.js +1 -0
  128. package/dist/chunks/mode-CBKawxnD.js +2 -0
  129. package/dist/chunks/model-DpZaKZMb.js +1 -0
  130. package/dist/chunks/model-DwbqvCY2.js +1 -0
  131. package/dist/chunks/modelOptions-CXBfKFXA.js +1 -0
  132. package/dist/chunks/nativeInstaller-SmPeEisk.js +1 -0
  133. package/dist/chunks/{notifications-4wP1Tx9Y.js → notifications-ql0eSo0Y.js} +1 -1
  134. package/dist/chunks/onChangeAppState-D85b33R5.js +1 -0
  135. package/dist/chunks/open-Cyrr4E5x.js +1 -0
  136. package/dist/chunks/openai-D_j7-KW6.js +2 -0
  137. package/dist/chunks/overlayContext-CLjlCFBl.js +1 -0
  138. package/dist/chunks/{panel-CVS4SK_E.js → panel-DMZkOEiU.js} +1 -1
  139. package/dist/chunks/parser-2usBI4G-.js +1 -0
  140. package/dist/chunks/{parser-Cg6hSCmn.js → parser-UqADrvxF.js} +1 -1
  141. package/dist/chunks/partition-CwxTlmMd.js +1 -0
  142. package/dist/chunks/{pasteStore-P0zP-ch0.js → pasteStore-ovtxMVR5.js} +1 -1
  143. package/dist/chunks/permissions-CgsvWOk_.js +3 -0
  144. package/dist/chunks/pidLock-B-SW3Nhx.js +3 -0
  145. package/dist/chunks/plan-BJrWtXEh.js +1 -0
  146. package/dist/chunks/platform-DsMIk3eq.js +2 -0
  147. package/dist/chunks/plugin-D97VJAxW.js +17 -0
  148. package/dist/chunks/{pluginAutoupdate-8qugAFhb.js → pluginAutoupdate-DQqYDPVg.js} +1 -1
  149. package/dist/chunks/{pluginBlocklist-q01ackCf.js → pluginBlocklist-BAr9WTup.js} +1 -1
  150. package/dist/chunks/pluginCliCommands-CUGPc853.js +1 -0
  151. package/dist/chunks/{pluginFlagging-BG2MHCQJ.js → pluginFlagging-BO_3qjfs.js} +1 -1
  152. package/dist/chunks/pluginOperations-rTrzu6Vg.js +2 -0
  153. package/dist/chunks/pluginStartupCheck-BRHnXlym.js +1 -0
  154. package/dist/chunks/{pluginStartupCheck-DTMa6TgL.js → pluginStartupCheck-BX6cv-vs.js} +1 -1
  155. package/dist/chunks/plugins-9crasx2V.js +4 -0
  156. package/dist/chunks/poorMode-BaS0DBUO.js +1 -0
  157. package/dist/chunks/{poorMode-B0QGV6Ci.js → poorMode-DmvzFAz_.js} +1 -1
  158. package/dist/chunks/print-Bi3xVdB3.js +13 -0
  159. package/dist/chunks/processBashCommand-BBtnCx-7.js +1 -0
  160. package/dist/chunks/processSlashCommand-jzF0GmLO.js +5 -0
  161. package/dist/chunks/{projectOnboardingState-B5YATuc6.js → projectOnboardingState--L3BKjOE.js} +1 -1
  162. package/dist/chunks/prompt-CmijKW7G.js +1 -0
  163. package/dist/chunks/prompt-DYBx_D0H.js +1 -0
  164. package/dist/chunks/{prompt-mM79EGnT.js → prompt-DzO1um1h.js} +4 -4
  165. package/dist/chunks/{promptEditor-DLGN_eLu.js → promptEditor-B6S_Rzcu.js} +2 -2
  166. package/dist/chunks/protocolHandler-BWgH1jaF.js +13 -0
  167. package/dist/chunks/{proxy-CDBfZjO7.js → proxy-BjkGlmBu.js} +1 -1
  168. package/dist/chunks/reconciler-CVMmAaCy.js +1 -0
  169. package/dist/chunks/refresh-CAGv8BJY.js +1 -0
  170. package/dist/chunks/reject-CEUkoI2G.js +1 -0
  171. package/dist/chunks/{reload-plugins-C42xSB5l.js → reload-plugins-DeyJTx4s.js} +1 -1
  172. package/dist/chunks/rename-DPFis9g_.js +1 -0
  173. package/dist/chunks/{renderOptions-DV0dn0IW.js → renderOptions-DRS2EslG.js} +1 -1
  174. package/dist/chunks/resume-N4O5YI-S.js +2 -0
  175. package/dist/chunks/ripgrep-3omwGI-l.js +1 -0
  176. package/dist/chunks/ripgrep-CgQrN3XX.js +5 -0
  177. package/dist/chunks/{runtimeObserver-1wQO8HSZ.js → runtimeObserver-C0CJvA3q.js} +1 -1
  178. package/dist/chunks/{runtimeObserver-XQrOux41.js → runtimeObserver-DMSzdFWt.js} +4 -4
  179. package/dist/chunks/sandbox-adapter-D15jjHJR.js +1 -0
  180. package/dist/chunks/sandbox-toggle-Tbbaw18C.js +1 -0
  181. package/dist/chunks/searchExtraTools-BoFc__Eg.js +1 -0
  182. package/dist/chunks/select-Fq6g2Ejk.js +1 -0
  183. package/dist/chunks/sessionFileAccessHooks-Rgsp4_Ex.js +1 -0
  184. package/dist/chunks/{sessionObserver-DS4G6mb9.js → sessionObserver-CRie77tp.js} +2 -2
  185. package/dist/chunks/sessionObserver-PcaVCVkX.js +1 -0
  186. package/dist/chunks/sessionStorage-Dkf7FRgA.js +1 -0
  187. package/dist/chunks/sessionTracing-D7rekMdW.js +11 -0
  188. package/dist/chunks/settings-8fwIkMDV.js +1 -0
  189. package/dist/chunks/settings-CodSADx8.js +24 -0
  190. package/dist/chunks/setup-DBiIrXrh.js +3 -0
  191. package/dist/chunks/{shadowedRuleDetection-BRxZjobz.js → shadowedRuleDetection-CTnYVrmP.js} +1 -1
  192. package/dist/chunks/{sideQuestion-DLJxyrlp.js → sideQuestion-Cl8m2qYx.js} +3 -3
  193. package/dist/chunks/sinks-CiupmfTg.js +1 -0
  194. package/dist/chunks/sinks-DH83d_kd.js +1 -0
  195. package/dist/chunks/skillChangeDetector-BrrZaFkT.js +1 -0
  196. package/dist/chunks/{skillGapStore-CKN_d3pO.js → skillGapStore-es3K-aYe.js} +2 -2
  197. package/dist/chunks/{skillLifecycle-BMY2JGGG.js → skillLifecycle-BcgoOQBk.js} +2 -2
  198. package/dist/chunks/{skillSearchPanel-D9trHULQ.js → skillSearchPanel-CuDDb1L-.js} +4 -4
  199. package/dist/chunks/skills-BRtgqnLz.js +1 -0
  200. package/dist/chunks/{src-CiJCsqUl.js → src-C8gyNm5a.js} +1 -1
  201. package/dist/chunks/src-Db7K3F_i.js +3 -0
  202. package/dist/chunks/startupProfiler-D1NRu2nj.js +1 -0
  203. package/dist/chunks/startupProfiler-DF0AjiDf.js +3 -0
  204. package/dist/chunks/{state-B4jiUise.js → state-BQ4BEGin.js} +1 -1
  205. package/dist/chunks/state-D3gvDiu8.js +1 -0
  206. package/dist/chunks/status-WXA16wIM.js +1 -0
  207. package/dist/chunks/statusNoticeHelpers-BfmIub5L.js +1 -0
  208. package/dist/chunks/{stringUtils-C718f5ey.js → stringUtils-Bu_lJH5c.js} +1 -1
  209. package/dist/chunks/switcher-5gilU5_R.js +1 -0
  210. package/dist/chunks/{switcher-CAajZeNL.js → switcher-DMfuKuw_.js} +1 -1
  211. package/dist/chunks/{tasks-BWNQr2d3.js → tasks-B6gYXxOx.js} +1 -1
  212. package/dist/chunks/{templateJobs-gUET39Ho.js → templateJobs-BW6TaqEC.js} +1 -1
  213. package/dist/chunks/{terminalSetup-B_10N_gE.js → terminalSetup-BgIXFBpd.js} +4 -4
  214. package/dist/chunks/{terminalSetup-qc2PlvOm.js → terminalSetup-C-g9Xvj3.js} +1 -1
  215. package/dist/chunks/{theme-B7fKI6E5.js → theme-9AZceq_m.js} +1 -1
  216. package/dist/chunks/tipRegistry-DtO1H_Wo.js +2 -0
  217. package/dist/chunks/{toolEventObserver-BL06sDI4.js → toolEventObserver-DTuJcREC.js} +1 -1
  218. package/dist/chunks/toolPool-DHS8jWaL.js +1 -0
  219. package/dist/chunks/{types-Dx7P7JLQ.js → types-97nL3naE.js} +16 -16
  220. package/dist/chunks/{udsClient-cQz6nJ_T.js → udsClient-CmYHFiBD.js} +1 -1
  221. package/dist/chunks/{use-select-navigation-BiUJdWai.js → use-select-navigation-BStVRvcX.js} +1 -1
  222. package/dist/chunks/useExitOnCtrlCDWithKeybindings-DWRFdFoU.js +1 -0
  223. package/dist/chunks/useMainLoopModel-DSN5HjV1.js +1 -0
  224. package/dist/chunks/useManagePlugins-ntnOf5OU.js +1 -0
  225. package/dist/chunks/useMergedTools-C5Yns9Ij.js +1 -0
  226. package/dist/chunks/useSearchInput-B_mY9wBq.js +1 -0
  227. package/dist/chunks/useSettingsErrors-CM7tThcp.js +1 -0
  228. package/dist/chunks/util-Bb2S6g9N.js +1 -0
  229. package/dist/chunks/{validatePlugin-D6tFo87L.js → validatePlugin-D8WQ5z4W.js} +1 -1
  230. package/dist/chunks/vim-Dpnhgoz_.js +1 -0
  231. package/dist/chunks/worktree-a5oOPSYl.js +1 -0
  232. package/dist/cli.js +1 -1
  233. package/package.json +1 -12
  234. package/dist/chunks/AddWorkspaceDirectory-OgcBcK5A.js +0 -1
  235. package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +0 -1
  236. package/dist/chunks/AgentsMdExternalIncludesDialog-CNEifEyV.js +0 -1
  237. package/dist/chunks/App-B-3tPQ3k.js +0 -1
  238. package/dist/chunks/BackgroundTasksDialog-COuhHcey.js +0 -2
  239. package/dist/chunks/BypassPermissionsModeDialog-bJek4siJ.js +0 -1
  240. package/dist/chunks/CustomSelect-DoeEXOIP.js +0 -1
  241. package/dist/chunks/DiffDialog-B3X9FMpO.js +0 -6
  242. package/dist/chunks/Doctor-6PXyjIi6.js +0 -3
  243. package/dist/chunks/Doctor-DNgkgYhB.js +0 -1
  244. package/dist/chunks/ExitFlow-DgAZp_8U.js +0 -2
  245. package/dist/chunks/Grove-CHatOzcE.js +0 -11
  246. package/dist/chunks/InvalidConfigDialog-DXL92MN9.js +0 -1
  247. package/dist/chunks/KeybindingProviderSetup-DA37QUFs.js +0 -1
  248. package/dist/chunks/MCPConnectionManager-thZd-xA_.js +0 -1
  249. package/dist/chunks/MCPToolListView-CpY-YJg4.js +0 -1
  250. package/dist/chunks/McpParsingWarnings-JvChf3xr.js +0 -1
  251. package/dist/chunks/MessageSelector-C0_iw7SI.js +0 -3
  252. package/dist/chunks/Messages-K4DDsDP9.js +0 -10
  253. package/dist/chunks/Onboarding-C1UdzM-1.js +0 -1
  254. package/dist/chunks/PromptInputFooterSuggestions-AyLog8p7.js +0 -1
  255. package/dist/chunks/PromptInputHelpMenu-oyic20ip.js +0 -1
  256. package/dist/chunks/QueryEngine-DYxBjJ4i.js +0 -1
  257. package/dist/chunks/REPL-CQBJRrT0.js +0 -124
  258. package/dist/chunks/REPL-CrVuMQY2.js +0 -1
  259. package/dist/chunks/ResumeConversation-Dl8H9Gfy.js +0 -1
  260. package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +0 -1
  261. package/dist/chunks/Settings-TGp3fPrS.js +0 -3
  262. package/dist/chunks/Spinner-zYPFVFHN.js +0 -1
  263. package/dist/chunks/TextInput-CD9iau2k.js +0 -22
  264. package/dist/chunks/ThemePicker-0F0hZYPX.js +0 -1
  265. package/dist/chunks/TrustDialog-C76YiMKz.js +0 -1
  266. package/dist/chunks/_baseEach-4ff-vRlp.js +0 -1
  267. package/dist/chunks/add-dir-JMsRLGfx.js +0 -1
  268. package/dist/chunks/agents-9qQ8I6zW.js +0 -101
  269. package/dist/chunks/allErrors-DfWylHSw.js +0 -1
  270. package/dist/chunks/analytics-DJobLaWP.js +0 -1
  271. package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +0 -1
  272. package/dist/chunks/backgroundHousekeeping-CVNIhQg8.js +0 -17
  273. package/dist/chunks/banner-Cu2-XUek.js +0 -2
  274. package/dist/chunks/branch-C4TsMEkx.js +0 -2
  275. package/dist/chunks/btw-Dn1eYFAz.js +0 -1
  276. package/dist/chunks/caches-BGzKwpnc.js +0 -1
  277. package/dist/chunks/caches-DArHxBgL.js +0 -1
  278. package/dist/chunks/client-BiqbIkwr.js +0 -1
  279. package/dist/chunks/client-CZ8nyVh5.js +0 -1
  280. package/dist/chunks/commands-QepeBbFn.js +0 -1
  281. package/dist/chunks/compact-Bu9BUpxV.js +0 -2
  282. package/dist/chunks/config-C-Y2qtB2.js +0 -3
  283. package/dist/chunks/config-D58C3_Lu.js +0 -1
  284. package/dist/chunks/config-DD8fCYXn.js +0 -1
  285. package/dist/chunks/context-CY_yfdYa.js +0 -1
  286. package/dist/chunks/context-noninteractive-BDDi3NLF.js +0 -1
  287. package/dist/chunks/conversation-B0wxBwzv.js +0 -1
  288. package/dist/chunks/conversation-DUu9qBnq.js +0 -1
  289. package/dist/chunks/conversationRecovery-2ft8sCPE.js +0 -1
  290. package/dist/chunks/crossProjectResume-6boHMUBx.js +0 -40
  291. package/dist/chunks/cwd-Dc3NV7s8.js +0 -1
  292. package/dist/chunks/cwd-Pa83R95t.js +0 -1
  293. package/dist/chunks/datadog-BPuGcxxC.js +0 -1
  294. package/dist/chunks/debug-Bglx1aTu.js +0 -39
  295. package/dist/chunks/doctor-CkLzqAMd.js +0 -1
  296. package/dist/chunks/entry-TNOoyy7_.js +0 -13
  297. package/dist/chunks/esm-eTAUP-La.js +0 -1
  298. package/dist/chunks/execAsync-Bv2yxuGe.js +0 -1
  299. package/dist/chunks/exit-DXApFJIP.js +0 -1
  300. package/dist/chunks/extraUsage-CmQaLPV1.js +0 -1
  301. package/dist/chunks/extractMemories-xP63mv6R.js +0 -1
  302. package/dist/chunks/fast-C5nQH8rm.js +0 -1
  303. package/dist/chunks/fast-eGx2IxD7.js +0 -1
  304. package/dist/chunks/fetchModelList-CxLsVNsu.js +0 -1
  305. package/dist/chunks/fetchModelList-D24lRIgR.js +0 -1
  306. package/dist/chunks/fileSuggestions-DHxdwq28.js +0 -3
  307. package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +0 -1
  308. package/dist/chunks/firstPartyEventLogger-M6UMli2c.js +0 -3
  309. package/dist/chunks/generateSessionName-BQoDduyA.js +0 -1
  310. package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +0 -1
  311. package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +0 -2
  312. package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +0 -1
  313. package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +0 -1
  314. package/dist/chunks/getMachineId-win-DamF2CH_.js +0 -1
  315. package/dist/chunks/goal-D7c2mSds.js +0 -3
  316. package/dist/chunks/grok-B2-ZbUiR.js +0 -1
  317. package/dist/chunks/grove-O6qp7ITR.js +0 -1
  318. package/dist/chunks/help-CZJdRviD.js +0 -1
  319. package/dist/chunks/history-CQiUERTL.js +0 -1
  320. package/dist/chunks/hooks-BNuUlMzL.js +0 -1
  321. package/dist/chunks/install-T_CV1Slu.js +0 -1
  322. package/dist/chunks/instrumentation-BjqUZ383.js +0 -21
  323. package/dist/chunks/keybindings-CLRaiL_Z.js +0 -1
  324. package/dist/chunks/launchLocalMemory-DrbKrwXc.js +0 -3
  325. package/dist/chunks/launchOnboarding-tqsMD8ni.js +0 -8
  326. package/dist/chunks/loadAgentsDir-CcmY8zCj.js +0 -1
  327. package/dist/chunks/localSearch-DrUj0B-d.js +0 -1
  328. package/dist/chunks/logoUtils-x2pHV-Nl.js +0 -1
  329. package/dist/chunks/main-kOVUGxOS.js +0 -345
  330. package/dist/chunks/managedEnv-BEqrGqn1.js +0 -1
  331. package/dist/chunks/mcp-BNd29r6p.js +0 -6
  332. package/dist/chunks/mcp-D0wAJrRT.js +0 -1
  333. package/dist/chunks/mcp-mgOlm1cY.js +0 -2
  334. package/dist/chunks/memory-DDLk9_LJ.js +0 -1
  335. package/dist/chunks/mode-CcNsWgK3.js +0 -2
  336. package/dist/chunks/model-BwBG0V1u.js +0 -1
  337. package/dist/chunks/model-DzCP4K-9.js +0 -1
  338. package/dist/chunks/modelOptions-DRaG3bo0.js +0 -1
  339. package/dist/chunks/nativeInstaller-C3pVPqrZ.js +0 -1
  340. package/dist/chunks/onChangeAppState-BlaoFbYF.js +0 -1
  341. package/dist/chunks/open-BtQHzzL9.js +0 -1
  342. package/dist/chunks/openai-CDN71NdX.js +0 -2
  343. package/dist/chunks/overlayContext-BT2Lq8ei.js +0 -1
  344. package/dist/chunks/parser-CG5RuOCK.js +0 -1
  345. package/dist/chunks/partition-CIl_ORUT.js +0 -1
  346. package/dist/chunks/permissions-zSNOZSwr.js +0 -3
  347. package/dist/chunks/pidLock-BTqO-h7Y.js +0 -3
  348. package/dist/chunks/plan-Bs6em6lk.js +0 -1
  349. package/dist/chunks/platform-BacQ6ACS.js +0 -2
  350. package/dist/chunks/plugin-DDDxjBa0.js +0 -17
  351. package/dist/chunks/pluginCliCommands-DXZfCZsv.js +0 -1
  352. package/dist/chunks/pluginOperations-hXYLrzM2.js +0 -2
  353. package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +0 -1
  354. package/dist/chunks/plugins-COoGBYk6.js +0 -4
  355. package/dist/chunks/poorMode-G-pnu6NM.js +0 -1
  356. package/dist/chunks/print-BASybEtO.js +0 -13
  357. package/dist/chunks/processBashCommand-DDi_Pymt.js +0 -1
  358. package/dist/chunks/processSlashCommand-Cq9kaoSF.js +0 -5
  359. package/dist/chunks/prompt-CHobfCB1.js +0 -1
  360. package/dist/chunks/prompt-CMm6RHHc.js +0 -1
  361. package/dist/chunks/protocolHandler-DjQALaU2.js +0 -13
  362. package/dist/chunks/reconciler-CeXqh95g.js +0 -1
  363. package/dist/chunks/refresh-Ce2yk28a.js +0 -1
  364. package/dist/chunks/registerProtocol-CAsDme_E.js +0 -1
  365. package/dist/chunks/reject-Bld5E-bn.js +0 -1
  366. package/dist/chunks/rename-CtBghpxZ.js +0 -1
  367. package/dist/chunks/resume-BWkaTDqd.js +0 -2
  368. package/dist/chunks/ripgrep-DLs8MraF.js +0 -1
  369. package/dist/chunks/ripgrep-Dl3y5r4m.js +0 -5
  370. package/dist/chunks/sandbox-adapter-8GO6eJxw.js +0 -1
  371. package/dist/chunks/sandbox-toggle-Dir9Polo.js +0 -1
  372. package/dist/chunks/searchExtraTools-BhDq8DTJ.js +0 -1
  373. package/dist/chunks/select-Bxf5-5sI.js +0 -1
  374. package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +0 -1
  375. package/dist/chunks/sessionObserver-DGEQM4cO.js +0 -1
  376. package/dist/chunks/sessionStorage-BcAscOGE.js +0 -1
  377. package/dist/chunks/sessionTracing-BoDDYLxW.js +0 -11
  378. package/dist/chunks/settings-B2jvL8Dp.js +0 -24
  379. package/dist/chunks/settings-CisDe8DB.js +0 -1
  380. package/dist/chunks/setup-BRypY6iT.js +0 -3
  381. package/dist/chunks/sinks-CGdKmq_8.js +0 -1
  382. package/dist/chunks/sinks-Cz2HfgMU.js +0 -1
  383. package/dist/chunks/skillChangeDetector-xviGstqm.js +0 -1
  384. package/dist/chunks/skills-CX_AvwLG.js +0 -1
  385. package/dist/chunks/src-CHw1lvBc.js +0 -3
  386. package/dist/chunks/startupProfiler-BH0FoI66.js +0 -1
  387. package/dist/chunks/startupProfiler-CJdr3SxP.js +0 -3
  388. package/dist/chunks/state-BhOKSFi5.js +0 -1
  389. package/dist/chunks/status-Daaak6Bo.js +0 -1
  390. package/dist/chunks/statusNoticeHelpers-vFVgIYuw.js +0 -1
  391. package/dist/chunks/switcher-BpgmH4AI.js +0 -1
  392. package/dist/chunks/tipRegistry-DamZr34w.js +0 -2
  393. package/dist/chunks/toolPool-CX5wDBi1.js +0 -1
  394. package/dist/chunks/useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js +0 -1
  395. package/dist/chunks/useMainLoopModel-DwjSVzzO.js +0 -1
  396. package/dist/chunks/useManagePlugins-BqfIVa6E.js +0 -1
  397. package/dist/chunks/useMergedTools-Bw8FchX8.js +0 -1
  398. package/dist/chunks/useSearchInput-B25K1RnK.js +0 -1
  399. package/dist/chunks/useSettingsErrors-DYQ44kX4.js +0 -1
  400. package/dist/chunks/util-CtlC2dsN.js +0 -1
  401. package/dist/chunks/vim-CoRp9lY1.js +0 -1
  402. package/dist/chunks/worktree-B8apCnVe.js +0 -1
@@ -1,21 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DfkgIdYf.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{E as a,M as o,S as s,b as c,d as l,h as u,i as d,l as f,n as p,p as ee,s as m,v as te,w as h,y as ne}from"./esm-lWlUmoUA.js";import{A as g,C as re,S as ie,b as _,v,w as ae,x as oe,y as se}from"./esm-BbMeEYcz.js";import{A as ce,B as y,C as le,D as ue,Dt as b,E as de,Et as fe,I as x,K as pe,L as S,M as me,N as he,O as ge,P as C,R as _e,Tt as ve,U as ye,W as w,_ as T,b as be,c as xe,d as Se,h as Ce,i as we,k as E,n as Te,o as Ee,p as De,q as Oe,t as ke,u as Ae,v as D,w as O,wt as je,y as Me}from"./esm-eTAUP-La.js";import{n as Ne,t as Pe}from"./axios-DaWTGg7G.js";import{Cn as Fe,Et as k,I as Ie,It as Le,U as Re,Vn as ze,nn as Be,vn as Ve}from"./state-B4jiUise.js";import{$ as He,C as Ue,I as We,M as Ge,V as Ke,c as A,et as qe,i as j,r as Je,x as Ye}from"./debug-Bglx1aTu.js";import{n as Xe,p as Ze}from"./config-C-Y2qtB2.js";import{o as Qe,s as $e}from"./log-D2TIwHBV.js";import{a as et,i as tt,o as nt}from"./platform-BacQ6ACS.js";import{n as rt,r as it}from"./startupProfiler-CJdr3SxP.js";import{At as at,Dt as ot}from"./model-BwBG0V1u.js";import{_ as st,a as ct,c as lt,f as ut,g as dt,l as ft,m as pt,v as mt,y as ht}from"./proxy-CDBfZjO7.js";import{C as gt,S as _t,_ as vt,c as yt,g as bt,l as xt,r as St}from"./sessionTracing-BoDDYLxW.js";var M;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(M||(M={}));var N;(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(N||(N={}));var P;(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(P||(P={}));function Ct(e){let t=Object.keys(e);return t.length===0?``:(t=t.sort(),JSON.stringify(t.map(t=>[t,e[t]])))}function wt(e){return`${e.name}:${e.version??``}:${e.schemaUrl??``}`}var Tt=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function F(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new Tt(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function Et(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Dt(e,t){let n=0,r=e.length-1,i=e.length;for(;r>=n;){let a=n+Math.trunc((r-n)/2);e[a]<t?n=a+1:(i=a,r=a-1)}return i}function Ot(e,t){return e.toLowerCase()===t.toLowerCase()}var I;(function(e){e[e.DROP=0]=`DROP`,e[e.SUM=1]=`SUM`,e[e.LAST_VALUE=2]=`LAST_VALUE`,e[e.HISTOGRAM=3]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=4]=`EXPONENTIAL_HISTOGRAM`})(I||(I={})),r();var kt=class{constructor(){i(this,`kind`,I.DROP)}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,r){}};r();function At(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var jt=class{constructor(e,t,n=!0,r=At(t)){i(this,`startTime`,void 0),i(this,`_boundaries`,void 0),i(this,`_recordMinMax`,void 0),i(this,`_current`,void 0),this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=r}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=Dt(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Mt=class{constructor(e,t){i(this,`kind`,I.HISTOGRAM),i(this,`_boundaries`,void 0),i(this,`_recordMinMax`,void 0),this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new jt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,a=r.buckets.counts,o=Array(i.length);for(let e=0;e<i.length;e++)o[e]=i[e]+a[e];let s=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&r.hasMinMax?(s=Math.min(n.min,r.min),c=Math.max(n.max,r.max)):n.hasMinMax?(s=n.min,c=n.max):r.hasMinMax&&(s=r.min,c=r.max)),new jt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:o},count:n.count+r.count,sum:n.sum+r.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||r.hasMinMax),min:s,max:c})}diff(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,a=r.buckets.counts,o=Array(i.length);for(let e=0;e<i.length;e++)o[e]=a[e]-i[e];return new jt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:o},count:r.count-n.count,sum:r.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:P.HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===N.GAUGE||e.type===N.UP_DOWN_COUNTER||e.type===N.OBSERVABLE_GAUGE||e.type===N.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:n.startTime,endTime:r,value:{min:i.hasMinMax?i.min:void 0,max:i.hasMinMax?i.max:void 0,sum:a?void 0:i.sum,buckets:i.buckets,count:i.count}}})}}};r();var Nt=class e{constructor(e=new Pt,t=0,n=0,r=0){i(this,`backing`,void 0),i(this,`indexBase`,void 0),i(this,`indexStart`,void 0),i(this,`indexEnd`,void 0),this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=r}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,r=0,i=0;for(let e=this.indexStart;e<=this.indexEnd;){let a=e%n;a<0&&(a+=n);for(let o=a;o<n&&r<t;o++)this._relocateBucket(i,r),r++,e++;i++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}},Pt=class e{constructor(e=[0]){i(this,`_counts`,void 0),this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let r=Array(e).fill(0);r.splice(n,this._counts.length-t,...this._counts.slice(t)),r.splice(0,t,...this._counts.slice(0,t)),this._counts=r}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let r=0;r<n;r++){let n=this._counts[e+r];this._counts[e+r]=this._counts[t-r-1],this._counts[t-r-1]=n}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new e([...this._counts])}},Ft=2146435072,It=1048575,Lt=1023,Rt=-1022,zt=Lt,Bt=2**-1022;function Vt(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((t.getUint32(0)&Ft)>>20)-Lt}function Ht(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let n=t.getUint32(0),r=t.getUint32(4);return(n&It)*2**32+r}function Ut(e,t){return e===0||e===1/0||e===-1/0||Number.isNaN(e)?e:e*2**t}function Wt(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}var L=class extends Error{};r();var Gt=class{constructor(e){i(this,`_shift`,void 0),this._shift=-e}mapToIndex(e){return e<Bt?this._minNormalLowerBoundaryIndex():Vt(e)+this._rightShift(Ht(e)-1,52)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new L(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new L(`overflow: ${e} is > maximum lower boundary: ${n}`);return Ut(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=Rt>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return zt>>this._shift}_rightShift(e,t){return Math.floor(e*2**-t)}};r();var Kt=class{constructor(e){i(this,`_scale`,void 0),i(this,`_scaleFactor`,void 0),i(this,`_inverseFactor`,void 0),this._scale=e,this._scaleFactor=Ut(Math.LOG2E,e),this._inverseFactor=Ut(Math.LN2,-e)}mapToIndex(e){if(e<=Bt)return this._minNormalLowerBoundaryIndex()-1;if(Ht(e)===0)return(Vt(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new L(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return Bt;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new L(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return Rt<<this._scale}_maxNormalLowerBoundaryIndex(){return(zt+1<<this._scale)-1}},qt=-10,Jt=20,Yt=Array.from({length:31},(e,t)=>t>10?new Kt(t-10):new Gt(t-10));function Xt(e){if(e>Jt||e<qt)throw new L(`expected scale >= ${qt} && <= ${Jt}, got: ${e}`);return Yt[e+10]}p(),r();var R=class e{static combine(t,n){return new e(Math.min(t.low,n.low),Math.max(t.high,n.high))}constructor(e,t){i(this,`low`,void 0),i(this,`high`,void 0),this.low=e,this.high=t}},Zt=20,Qt=160,$t=2,en=class e{constructor(e,t=Qt,n=!0,r=0,a=0,o=0,s=1/0,c=-1/0,l=new Nt,u=new Nt,d=Xt(Zt)){i(this,`startTime`,void 0),i(this,`_maxSize`,void 0),i(this,`_recordMinMax`,void 0),i(this,`_sum`,void 0),i(this,`_count`,void 0),i(this,`_zeroCount`,void 0),i(this,`_min`,void 0),i(this,`_max`,void 0),i(this,`_positive`,void 0),i(this,`_negative`,void 0),i(this,`_mapping`,void 0),this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=r,this._count=a,this._zeroCount=o,this._min=s,this._max=c,this._positive=l,this._negative=u,this._mapping=d,this._maxSize<$t&&(m.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
2
- changing to the minimum size of: ${$t}`),this._maxSize=$t)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let r=this._mapping.mapToIndex(t),i=!1,a=0,o=0;if(e.length===0?(e.indexStart=r,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):r<e.indexStart&&e.indexEnd-r>=this._maxSize?(i=!0,o=r,a=e.indexEnd):r>e.indexEnd&&r-e.indexStart>=this._maxSize&&(i=!0,o=e.indexStart,a=r),i){let e=this._changeScale(a,o);this._downscale(e),r=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,r,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let n=e.indexEnd-t;n>=e.backing.length&&this._grow(e,n+1),e.indexStart=t}else if(t>e.indexEnd){let n=t-e.indexStart;n>=e.backing.length&&this._grow(e,n+1),e.indexEnd=t}let r=t-e.indexBase;r<0&&(r+=e.backing.length),e.incrementBucket(r,n)}_grow(e,t){let n=e.backing.length,r=e.indexBase-e.indexStart,i=n-r,a=Wt(t);a>this._maxSize&&(a=this._maxSize);let o=a-r;e.backing.growTo(a,i,o)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=Xt(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=R.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),r=R.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(r.high,r.low))}_highLowAtScale(e,t,n){if(e.length===0)return new R(0,-1);let r=t-n;return new R(e.indexStart>>r,e.indexEnd>>r)}_mergeBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++)this._incrementIndexBy(e,i+t>>a,n.at(t))}_diffBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++){let r=(i+t>>a)-e.indexBase;r<0&&(r+=e.backing.length),e.decrementBucket(r,n.at(t))}e.trim()}},tn=class{constructor(e,t){i(this,`kind`,I.EXPONENTIAL_HISTOGRAM),i(this,`_maxSize`,void 0),i(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new en(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:P.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===N.GAUGE||e.type===N.UP_DOWN_COUNTER||e.type===N.OBSERVABLE_GAUGE||e.type===N.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:n.startTime,endTime:r,value:{min:i.hasMinMax?i.min:void 0,max:i.hasMinMax?i.max:void 0,sum:a?void 0:i.sum,positive:{offset:i.positive.offset,bucketCounts:i.positive.bucketCounts},negative:{offset:i.negative.offset,bucketCounts:i.negative.bucketCounts},count:i.count,scale:i.scale,zeroCount:i.zeroCount}}})}}};D(),r();var nn=class{constructor(e,t=0,n=[0,0]){i(this,`startTime`,void 0),i(this,`_current`,void 0),i(this,`sampleTime`,void 0),this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=C(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},rn=class{constructor(){i(this,`kind`,I.LAST_VALUE)}createAccumulation(e){return new nn(e)}merge(e,t){let n=E(t.sampleTime)>=E(e.sampleTime)?t:e;return new nn(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=E(t.sampleTime)>=E(e.sampleTime)?t:e;return new nn(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:P.GAUGE,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()}))}}};r();var z=class{constructor(e,t,n=0,r=!1){i(this,`startTime`,void 0),i(this,`monotonic`,void 0),i(this,`_current`,void 0),i(this,`reset`,void 0),this.startTime=e,this.monotonic=t,this._current=n,this.reset=r}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},an=class{constructor(e){i(this,`kind`,I.SUM),i(this,`monotonic`,void 0),this.monotonic=e}createAccumulation(e){return new z(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue();return t.reset?new z(t.startTime,this.monotonic,r,t.reset):new z(e.startTime,this.monotonic,n+r)}diff(e,t){let n=e.toPointValue(),r=t.toPointValue();return this.monotonic&&n>r?new z(t.startTime,this.monotonic,r,!0):new z(t.startTime,this.monotonic,r-n)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:P.SUM,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()})),isMonotonic:this.monotonic}}};p(),r();var on=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};i(on,`DEFAULT_INSTANCE`,new kt);var sn=class e{createAggregator(t){switch(t.type){case N.COUNTER:case N.OBSERVABLE_COUNTER:case N.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}};i(sn,`MONOTONIC_INSTANCE`,new an(!0)),i(sn,`NON_MONOTONIC_INSTANCE`,new an(!1));var cn=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};i(cn,`DEFAULT_INSTANCE`,new rn);var ln=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};i(ln,`DEFAULT_INSTANCE`,new Mt([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0));var un=class{constructor(e,t=!0){if(i(this,`_boundaries`,void 0),i(this,`_recordMinMax`,void 0),e==null)throw Error(`ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array`);e=e.concat(),e=e.sort((e,t)=>e-t);let n=e.lastIndexOf(-1/0),r=e.indexOf(1/0);r===-1&&(r=void 0),this._boundaries=e.slice(n+1,r),this._recordMinMax=t}createAggregator(e){return new Mt(this._boundaries,this._recordMinMax)}},dn=class{constructor(e=160,t=!0){i(this,`_maxSize`,void 0),i(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new tn(this._maxSize,this._recordMinMax)}},fn=class{_resolve(e){switch(e.type){case N.COUNTER:case N.UP_DOWN_COUNTER:case N.OBSERVABLE_COUNTER:case N.OBSERVABLE_UP_DOWN_COUNTER:return mn;case N.GAUGE:case N.OBSERVABLE_GAUGE:return hn;case N.HISTOGRAM:return e.advice.explicitBucketBoundaries?new un(e.advice.explicitBucketBoundaries):gn}return m.warn(`Unable to recognize instrument type: ${e.type}`),pn}createAggregator(e){return this._resolve(e).createAggregator(e)}},pn=new on,mn=new sn,hn=new cn,gn=new ln;new dn;var _n=new fn,B;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.DROP=1]=`DROP`,e[e.SUM=2]=`SUM`,e[e.LAST_VALUE=3]=`LAST_VALUE`,e[e.EXPLICIT_BUCKET_HISTOGRAM=4]=`EXPLICIT_BUCKET_HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=5]=`EXPONENTIAL_HISTOGRAM`})(B||(B={}));function vn(e){switch(e.type){case B.DEFAULT:return _n;case B.DROP:return pn;case B.SUM:return mn;case B.LAST_VALUE:return hn;case B.EXPONENTIAL_HISTOGRAM:{let t=e;return new dn(t.options?.maxSize,t.options?.recordMinMax)}case B.EXPLICIT_BUCKET_HISTOGRAM:{let t=e;return t.options==null?gn:new un(t.options?.boundaries,t.options?.recordMinMax)}default:throw Error(`Unsupported Aggregation`)}}var yn=e=>({type:B.DEFAULT}),bn=e=>M.CUMULATIVE,xn=`otel.component.name`,Sn=`otel.component.type`,Cn=`periodic_metric_reader`,wn=`otel.sdk.metric_reader.collection.duration`,Tn=`error.type`;r();var En=new Map,Dn=class{constructor(e,t){i(this,`collectionDuration`,void 0),i(this,`standardAttrs`,void 0);let n=En.get(e)??0;En.set(e,n+1),this.standardAttrs={[Sn]:e,[xn]:`${e}/${n}`},this.collectionDuration=t.createHistogram(wn,{unit:`s`,description:`The duration of the collect operation of the metric reader.`,advice:{explicitBucketBoundaries:[]}})}recordCollection(e,t){let n=t?{...this.standardAttrs,[Tn]:t}:this.standardAttrs;this.collectionDuration.record(e,n)}},On=`2.9.0`;p(),D(),r();var kn=class{constructor(e){i(this,`_shutdown`,!1),i(this,`_metricProducers`,void 0),i(this,`_sdkMetricProducer`,void 0),i(this,`_selfObsMetrics`,void 0),i(this,`_aggregationTemporalitySelector`,void 0),i(this,`_aggregationSelector`,void 0),i(this,`_cardinalitySelector`,void 0),i(this,`_otelComponentType`,void 0),this._aggregationSelector=e?.aggregationSelector??yn,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??bn,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector,this._otelComponentType=e?.otelComponentType??this.constructor.name,this._selfObsMetrics=new Dn(this._otelComponentType,a())}setMetricProducer(e){if(this._sdkMetricProducer)throw Error(`MetricReader can not be bound to a MeterProvider again.`);this._sdkMetricProducer=e,this.onInitialized()}_setSelfObsMeterProvider(e){let t=e.getMeter(`@opentelemetry/sdk-metrics`,On);this._selfObsMetrics=new Dn(this._otelComponentType,t)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw Error(`MetricReader is not bound to a MetricProducer`);if(this._shutdown)throw Error(`MetricReader is shutdown`);let t=ue(),[n,...r]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(t=>t.collect({timeoutMillis:e?.timeoutMillis}))]),i=ue(),a=n.errors.concat(r.flatMap(e=>e.errors)),o=ce(ge(t,i));return this._selfObsMetrics.recordCollection(o,a.length>0?a[0].name??`collect_error`:void 0),{resourceMetrics:{resource:n.resourceMetrics.resource,scopeMetrics:n.resourceMetrics.scopeMetrics.concat(r.flatMap(e=>e.resourceMetrics.scopeMetrics))},errors:a}}async shutdown(e){if(this._shutdown){m.error(`Cannot call shutdown twice.`);return}e?.timeoutMillis==null?await this.onShutdown():await F(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){m.warn(`Cannot forceFlush on already shutdown MetricReader.`);return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await F(this.onForceFlush(),e.timeoutMillis)}};function An(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`maxExportBatchSize must be a positive integer`);let n=[],r=0,i=[];function a(){i.length>0&&(n.push({resource:e.resource,scopeMetrics:i}),i=[],r=0)}for(let n of e.scopeMetrics){let e=null;for(let o of n.metrics){let s=o.dataPoints;if(s.length===0){e||(e={scope:n.scope,metrics:[]},i.push(e)),e.metrics.push(o);continue}let c=0;for(;c<s.length;){let l=t-r,u=Math.min(l,s.length-c);e||(e={scope:n.scope,metrics:[]},i.push(e));let d={...o,dataPoints:s.slice(c,c+u)};e.metrics.push(d),c+=u,r+=u,r===t&&(a(),e=null)}}}return a(),n}p(),D(),r();var jn=class extends kn{constructor(e){let{exporter:t,exportIntervalMillis:n=6e4,metricProducers:r,cardinalityLimits:a,maxExportBatchSize:o}=e,{exportTimeoutMillis:s=3e4}=e;if(super({aggregationSelector:t.selectAggregation?.bind(t),aggregationTemporalitySelector:t.selectAggregationTemporality?.bind(t),otelComponentType:Cn,metricProducers:r,cardinalitySelector:e=>{let t={default:2e3,...a};switch(e){case N.COUNTER:return t.counter??t.default;case N.GAUGE:return t.gauge??t.default;case N.HISTOGRAM:return t.histogram??t.default;case N.OBSERVABLE_COUNTER:return t.observableCounter??t.default;case N.OBSERVABLE_UP_DOWN_COUNTER:return t.observableUpDownCounter??t.default;case N.OBSERVABLE_GAUGE:return t.observableGauge??t.default;case N.UP_DOWN_COUNTER:return t.upDownCounter??t.default;default:return t.default}}}),i(this,`_interval`,void 0),i(this,`_exporter`,void 0),i(this,`_exportInterval`,void 0),i(this,`_exportTimeout`,void 0),i(this,`_maxExportBatchSize`,void 0),i(this,`_ongoingExportPromise`,null),n<=0)throw Error(`exportIntervalMillis must be greater than 0`);if(s<=0)throw Error(`exportTimeoutMillis must be greater than 0`);if(o!==void 0&&(!Number.isInteger(o)||o<=0))throw Error(`maxExportBatchSize must be a positive integer`);if(n<s){if(`exportIntervalMillis`in e&&`exportTimeoutMillis`in e)throw Error(`exportIntervalMillis must be greater than or equal to exportTimeoutMillis`);m.info(`Timeout of ${s} exceeds the interval of ${n}. Clamping timeout to interval duration.`),s=n}this._exportInterval=n,this._exportTimeout=s,this._exporter=t,this._maxExportBatchSize=o}async _runOnce(){try{await this._doRun()}catch(e){y(e)}}async _doRun(){if(this._ongoingExportPromise){m.debug(`PeriodicExportingMetricReader: export already in progress, skipping`);return}let e=async()=>{let{resourceMetrics:e,errors:t}=await this.collect({timeoutMillis:this._exportTimeout});if(t.length>0&&m.error(`PeriodicExportingMetricReader: metrics collection errors`,...t),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(e){m.debug(`Error while resolving async portion of resource: `,e),y(e)}if(e.scopeMetrics.length===0)return;let n=this._maxExportBatchSize?An(e,this._maxExportBatchSize):[e],r=null;for(let e of n)try{let t=await F(Me._export(this._exporter,e),this._exportTimeout);t.code!==O.SUCCESS&&(r=Error(`PeriodicExportingMetricReader: metrics export failed (error ${t.error})`))}catch(e){if(e instanceof Tt){m.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`);break}else m.error(`PeriodicExportingMetricReader: metrics export threw error`,e),r=e instanceof Error?e:Error(String(e))}if(r)throw r};this._ongoingExportPromise=e();try{await this._ongoingExportPromise}finally{this._ongoingExportPromise=null}}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=`number`&&this._interval.unref()}async onForceFlush(){await this._awaitOngoingExport(),this._ongoingExportPromise?await this._awaitOngoingExport():await this._runOnce(),await this._exporter.forceFlush()}async _awaitOngoingExport(){if(this._ongoingExportPromise){m.debug(`PeriodicExportingMetricReader: export already in progress, awaiting ongoing export`);try{await this._ongoingExportPromise}catch{}}}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}};D(),r();var Mn=class e{constructor(e){i(this,`_shutdown`,!1),i(this,`_temporalitySelector`,void 0),this._temporalitySelector=e?.temporalitySelector??bn}export(t,n){if(this._shutdown){n({code:O.FAILED});return}return e._sendMetrics(t,n)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let t of e.scopeMetrics)for(let e of t.metrics)console.dir({descriptor:e.descriptor,dataPointType:e.dataPointType,dataPoints:e.dataPoints},{depth:null});t({code:O.SUCCESS})}};r();var Nn=class{constructor(){i(this,`_registeredViews`,[])}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,e)&&this._matchMeter(n.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};p();function V(e,t,n){return Ln(e)||m.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:n?.description??``,unit:n?.unit??``,valueType:n?.valueType??h.DOUBLE,advice:n?.advice??{}}}function Pn(e,t){return{name:e.name??t.name,description:e.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function Fn(e,t){return Ot(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}var In=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function Ln(e){return In.test(e)}p(),r();var H=class{constructor(e,t){i(this,`_writableMetricStorage`,void 0),i(this,`_descriptor`,void 0),this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n){if(typeof e!=`number`){m.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===h.INT&&!Number.isInteger(e)&&(m.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,Date.now())}},Rn=class extends H{add(e,t,n){this._record(e,t,n)}},zn=class extends H{add(e,t,n){if(e<0){m.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},Bn=class extends H{record(e,t,n){this._record(e,t,n)}},Vn=class extends H{record(e,t,n){if(e<0){m.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},U=class{constructor(e,t,n){i(this,`_metricStorages`,void 0),i(this,`_descriptor`,void 0),i(this,`_observableRegistry`,void 0),this._descriptor=e,this._metricStorages=t,this._observableRegistry=n}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},Hn=class extends U{},Un=class extends U{},Wn=class extends U{};function Gn(e){return e instanceof U}r();var Kn=class{constructor(e){i(this,`_meterSharedState`,void 0),this._meterSharedState=e}createGauge(e,t){let n=V(e,N.GAUGE,t);return new Bn(this._meterSharedState.registerMetricStorage(n),n)}createHistogram(e,t){let n=V(e,N.HISTOGRAM,t);return new Vn(this._meterSharedState.registerMetricStorage(n),n)}createCounter(e,t){let n=V(e,N.COUNTER,t);return new zn(this._meterSharedState.registerMetricStorage(n),n)}createUpDownCounter(e,t){let n=V(e,N.UP_DOWN_COUNTER,t);return new Rn(this._meterSharedState.registerMetricStorage(n),n)}createObservableGauge(e,t){let n=V(e,N.OBSERVABLE_GAUGE,t);return new Un(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=V(e,N.OBSERVABLE_COUNTER,t);return new Hn(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=V(e,N.OBSERVABLE_UP_DOWN_COUNTER,t);return new Wn(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};r();var qn=class{constructor(e){i(this,`_instrumentDescriptor`,void 0),this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=V(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};r();var Jn=class{constructor(e){i(this,`_valueMap`,new Map),i(this,`_keyMap`,new Map),i(this,`_hash`,void 0),this._hash=e}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let r=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,r),r}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},W=class extends Jn{constructor(){super(Ct)}};D(),r();var Yn=class{constructor(e,t){i(this,`_activeCollectionStorage`,new W),i(this,`_cumulativeMemoStorage`,new W),i(this,`_cardinalityLimit`,void 0),i(this,`_overflowAttributes`,{"otel.metric.overflow":!0}),i(this,`_overflowHashCode`,void 0),i(this,`_aggregator`,void 0),this._aggregator=e,this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=Ct(this._overflowAttributes)}record(e,t,n){let r=this._activeCollectionStorage.get(t);if(!r){let i=C(n);if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(i))?.record(e);return}r=this._aggregator.createAccumulation(i),this._activeCollectionStorage.set(t,r)}r?.record(e)}batchCumulate(e,t){for(let[n,r,i]of e.entries()){let e=n,a=i,o=this._aggregator.createAccumulation(t);o?.record(r);let s=o;if(this._cumulativeMemoStorage.has(e,a)){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(e,a))){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}if(this._activeCollectionStorage.has(e,a)){let t=this._activeCollectionStorage.get(e,a);s=this._aggregator.merge(t,s)}this._cumulativeMemoStorage.set(e,o,a),this._activeCollectionStorage.set(e,s,a)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new W,e}};r();var Xn=class e{constructor(e,t){i(this,`_aggregator`,void 0),i(this,`_unreportedAccumulations`,new Map),i(this,`_reportHistory`,new Map),this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(t,n,r,i){this._stashAccumulations(r);let a=this._getMergedUnreportedAccumulations(t),o=a,s;if(this._reportHistory.has(t)){let n=this._reportHistory.get(t),r=n.collectionTime;s=n.aggregationTemporality,o=s===M.CUMULATIVE?e.merge(n.accumulations,a,this._aggregator):e.calibrateStartTime(n.accumulations,a,r)}else s=t.selectAggregationTemporality(n.type);this._reportHistory.set(t,{accumulations:o,collectionTime:i,aggregationTemporality:s});let c=Zn(o);if(c.length!==0)return this._aggregator.toMetricData(n,s,c,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let t=this._unreportedAccumulations.get(n);t===void 0&&(t=[],this._unreportedAccumulations.set(n,t)),t.push(e)}}_getMergedUnreportedAccumulations(t){let n=new W,r=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),r===void 0)return n;for(let t of r)n=e.merge(n,t,this._aggregator);return n}static merge(e,t,n){let r=e,i=t.entries(),a=i.next();for(;a.done!==!0;){let[t,o,s]=a.value;if(e.has(t,s)){let i=e.get(t,s),a=n.merge(i,o);r.set(t,a,s)}else r.set(t,o,s);a=i.next()}return r}static calibrateStartTime(e,t,n){for(let[r,i]of e.keys())t.get(r,i)?.setStartTime(n);return t}};function Zn(e){return Array.from(e.entries())}r();var Qn=class extends qn{constructor(e,t,n,r,a){super(e),i(this,`_aggregationCardinalityLimit`,void 0),i(this,`_deltaMetricStorage`,void 0),i(this,`_temporalMetricStorage`,void 0),i(this,`_attributesProcessor`,void 0),this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new Yn(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new Xn(t,r),this._attributesProcessor=n}record(e,t){if(this._attributesProcessor===void 0){this._deltaMetricStorage.batchCumulate(e,t);return}let n=new W;for(let[t,r]of e.entries())n.set(this._attributesProcessor.process(t),r);this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};function $n(e,t){let n=``;return e.unit!==t.unit&&(n+=`\t- Unit '${e.unit}' does not match '${t.unit}'\n`),e.type!==t.type&&(n+=`\t- Type '${e.type}' does not match '${t.type}'\n`),e.valueType!==t.valueType&&(n+=`\t- Value Type '${e.valueType}' does not match '${t.valueType}'\n`),e.description!==t.description&&(n+=`\t- Description '${e.description}' does not match '${t.description}'\n`),n}function er(e,t){return`\t- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function tr(e,t){return`\t- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function nr(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}function rr(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'
3
- \t- OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${r}
4
- \t- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}function ir(e,t){return e.valueType===t.valueType?e.unit===t.unit?e.type===t.type?e.description===t.description?``:rr(e,t):nr(e,t):tr(e,t):er(e,t)}p(),r();var ar=class e{constructor(){i(this,`_sharedRegistry`,new Map),i(this,`_perCollectorRegistry`,new Map)}static create(){return new e}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let e of n.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n??(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let r=n.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),r=t.get(n.name);if(r===void 0){t.set(n.name,[e]);return}r.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let r of t){let t=r.getInstrumentDescriptor();Fn(t,e)?(t.description!==e.description&&(e.description.length>t.description.length&&r.updateDescription(e.description),m.warn(`A view or instrument with the name `,e.name,` has already been registered, but has a different description and is incompatible with another registered view.
5
- `,`Details:
6
- `,$n(t,e),`The longer description will be used.
7
- To resolve the conflict:`,ir(t,e))),n=r):m.warn(`A view or instrument with the name `,e.name,` has already been registered and is incompatible with another registered view.
8
- `,`Details:
9
- `,$n(t,e),`To resolve the conflict:
10
- `,ir(t,e))}return n}};p(),r();var or=class{constructor(e){i(this,`_backingStorages`,void 0),i(this,`hasAttributeProcessor`,void 0),this._backingStorages=e,this.hasAttributeProcessor=e.some(e=>e.hasAttributeProcessor)}record(e,t,n,r){this.hasAttributeProcessor&&n===void 0&&(n=f.active());let i=this._backingStorages;for(let a=0;a<i.length;a++)i[a].record(e,t,n,r)}};p(),r();var sr=class{constructor(e,t){i(this,`_buffer`,new W),i(this,`_instrumentName`,void 0),i(this,`_valueType`,void 0),this._instrumentName=e,this._valueType=t}observe(e,t={}){if(typeof e!=`number`){m.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===h.INT&&!Number.isInteger(e)&&(m.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},cr=class{constructor(){i(this,`_buffer`,new Map)}observe(e,t,n={}){if(!Gn(e))return;let r=this._buffer.get(e);if(r??(r=new W,this._buffer.set(e,r)),typeof t!=`number`){m.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===h.INT&&!Number.isInteger(t)&&(m.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||r.set(n,t)}};p(),r();var lr=class{constructor(){i(this,`_callbacks`,[]),i(this,`_batchCallbacks`,[])}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(Gn));if(n.size===0){m.error(`BatchObservableCallback is not associated with valid instruments`,t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(Gn)),r=this._findBatchCallback(e,n);r<0||this._batchCallbacks.splice(r,1)}async observe(e,t){let n=this._observeCallbacks(e,t),r=this._observeBatchCallbacks(e,t);return(await Promise.allSettled([...n,...r])).filter(e=>e.status===`rejected`).map(e=>e.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:r})=>{let i=new sr(r._descriptor.name,r._descriptor.valueType),a=Promise.resolve(n(i));t!=null&&(a=F(a,t)),await a,r._metricStorages.forEach(t=>{t.record(i._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:r})=>{let i=new cr,a=Promise.resolve(n(i));t!=null&&(a=F(a,t)),await a,r.forEach(t=>{let n=i._buffer.get(t);n!=null&&t._metricStorages.forEach(t=>{t.record(n,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&Et(n.instruments,t))}};p(),r();var ur=class extends qn{constructor(e,t,n,r,a){super(e),i(this,`_aggregationCardinalityLimit`,void 0),i(this,`_deltaMetricStorage`,void 0),i(this,`_temporalMetricStorage`,void 0),i(this,`_attributesProcessor`,void 0),i(this,`hasAttributeProcessor`,void 0),this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new Yn(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new Xn(t,r),this._attributesProcessor=n,this.hasAttributeProcessor=n!==void 0}record(e,t,n,r){this._attributesProcessor!==void 0&&(t=this._attributesProcessor.process(t,n??f.active())),this._deltaMetricStorage.record(e,t,r)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};r();var dr=class{constructor(e,t){i(this,`metricStorageRegistry`,new ar),i(this,`observableRegistry`,new lr),i(this,`meter`,void 0),i(this,`_meterProviderSharedState`,void 0),i(this,`_instrumentationScope`,void 0),this.meter=new Kn(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,ur);return t.length===1?t[0]:new or(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Qn)}async collect(e,t,n){let r=await this.observableRegistry.observe(t,n?.timeoutMillis),i=this.metricStorageRegistry.getStorages(e);if(i.length===0)return null;let a=[];return i.forEach(n=>{let r=n.collect(e,t);r!=null&&a.push(r)}),a.length===0?{errors:r}:{scopeMetrics:{scope:this._instrumentationScope,metrics:a},errors:r}}_registerMetricStorage(e,t){let n=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(n=>{let r=Pn(n,e),i=this.metricStorageRegistry.findOrUpdateCompatibleStorage(r);if(i!=null)return i;let a=new t(r,n.aggregation.createAggregator(r),n.attributesProcessor,this._meterProviderSharedState.metricCollectors,n.aggregationCardinalityLimit);return this.metricStorageRegistry.register(a),a});if(n.length===0){let r=this._meterProviderSharedState.selectAggregations(e.type).map(([n,r])=>{let i=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(i!=null)return i;let a=r.createAggregator(e),o=n.selectCardinalityLimit(e.type),s=new t(e,a,void 0,[n],o);return this.metricStorageRegistry.registerForCollector(n,s),s});n=n.concat(r)}return n}};r();var fr=class{constructor(e){i(this,`viewRegistry`,new Nn),i(this,`metricCollectors`,[]),i(this,`meterSharedStates`,new Map),i(this,`resource`,void 0),this.resource=e}getMeterSharedState(e){let t=wt(e),n=this.meterSharedStates.get(t);return n??(n=new dr(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,vn(n.selectAggregation(e))]);return t}};D(),r();var pr=class{constructor(e,t){i(this,`_sharedState`,void 0),i(this,`_metricReader`,void 0),this._sharedState=e,this._metricReader=t}async collect(e){let t=C(Date.now()),n=[],r=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(async i=>{let a=await i.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&r.push(...a.errors)});return await Promise.all(i),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:r}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){return this._metricReader.selectCardinalityLimit?.(e)??2e3}};r();var mr=/[\^$\\.+?()[\]{}|]/g,hr=class e{constructor(t){i(this,`_matchAll`,void 0),i(this,`_regexp`,void 0),t===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(mr,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(e){return e.includes(`*`)}},G=class{constructor(e){i(this,`_matchAll`,void 0),i(this,`_pattern`,void 0),this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};r();var gr=class{process(e,t){return e}},_r=class{constructor(e){i(this,`_processors`,void 0),this._processors=e}process(e,t){let n=e;for(let e of this._processors)n=e.process(n,t);return n}};function vr(){return br}function yr(e){return new _r(e)}var br=new gr;r();var xr=class{constructor(e){i(this,`_nameFilter`,void 0),i(this,`_type`,void 0),i(this,`_unitFilter`,void 0),this._nameFilter=new hr(e?.name??`*`),this._type=e?.type,this._unitFilter=new G(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};r();var Sr=class{constructor(e){i(this,`_nameFilter`,void 0),i(this,`_versionFilter`,void 0),i(this,`_schemaUrlFilter`,void 0),this._nameFilter=new G(e?.name),this._versionFilter=new G(e?.version),this._schemaUrlFilter=new G(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};r();function Cr(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function wr(e){if(Cr(e))throw Error(`Cannot create view with no selector arguments supplied`);if(e.name!=null&&(e?.instrumentName==null||hr.hasWildcard(e.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}var Tr=class{constructor(e){i(this,`name`,void 0),i(this,`description`,void 0),i(this,`aggregation`,void 0),i(this,`attributesProcessor`,void 0),i(this,`instrumentSelector`,void 0),i(this,`meterSelector`,void 0),i(this,`aggregationCardinalityLimit`,void 0),wr(e),e.attributesProcessors==null?this.attributesProcessor=vr():this.attributesProcessor=yr(e.attributesProcessors),this.name=e.name,this.description=e.description,this.aggregation=vn(e.aggregation??{type:B.DEFAULT}),this.instrumentSelector=new xr({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Sr({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}};p(),xe(),r();var Er=class{constructor(e){if(i(this,`_sharedState`,void 0),i(this,`_shutdown`,!1),this._sharedState=new fr(e?.resource??Ce()),e?.views!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new Tr(t));if(e?.readers!=null&&e.readers.length>0)for(let t of e.readers){let n=new pr(this._sharedState,t);t.setMetricProducer(n),this._sharedState.metricCollectors.push(n),e.sdkMetricsEnabled&&t instanceof kn&&t._setSelfObsMeterProvider(this)}}getMeter(e,t=``,n={}){return this._shutdown?(m.warn(`A shutdown MeterProvider cannot provide a Meter`),a()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}async shutdown(e){if(this._shutdown){m.warn(`shutdown may only be called once per MeterProvider`);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){m.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}},Dr=`exception`,Or=Symbol.for(`nodejs.util.inspect.custom`);function kr(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??(t[n]=r));return t}function Ar(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}p(),D(),v(),r();var jr=class{constructor(e){i(this,`_spanContext`,void 0),i(this,`kind`,void 0),i(this,`parentSpanContext`,void 0),i(this,`attributes`,{}),i(this,`links`,[]),i(this,`events`,[]),i(this,`startTime`,void 0),i(this,`resource`,void 0),i(this,`instrumentationScope`,void 0),i(this,`_droppedAttributesCount`,0),i(this,`_droppedEventsCount`,0),i(this,`_droppedLinksCount`,0),i(this,`_attributesCount`,0),i(this,`name`,void 0),i(this,`status`,{code:l.UNSET}),i(this,`endTime`,[0,0]),i(this,`_ended`,!1),i(this,`_duration`,[-1,-1]),i(this,`_spanProcessor`,void 0),i(this,`_spanLimits`,void 0),i(this,`_attributeValueLengthLimit`,void 0),i(this,`_recordEndMetrics`,void 0),i(this,`_performanceStartTime`,void 0),i(this,`_performanceOffset`,void 0),i(this,`_startTimeProvided`,void 0);let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=x.now(),this._performanceOffset=t-(this._performanceStartTime+x.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return m.warn(`Invalid attribute key: ${e}`),this;if(!ye(t))return m.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return m.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&m.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),me(t)&&(me(n)||(n=t),t=void 0);let i=w(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&m.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=w(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===l.UNSET||this.status.code===l.OK)return this;let t={code:e.code};return e.code===l.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&m.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){m.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=ge(this.startTime,this.endTime),this._duration[0]<0&&(m.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&m.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&m.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=x.now())return ue(e+this._performanceOffset);if(typeof e==`number`)return C(e);if(e instanceof Date)return C(e.getTime());if(he(e))return e;if(this._startTimeProvided)return C(Date.now());let t=x.now()-this._performanceStartTime;return de(this.startTime,C(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[_]=e:e&&(e.code?n[ie]=e.code.toString():e.name&&(n[ie]=e.name),e.message&&(n[_]=e.message),e.stack&&(n[oe]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Dr,n,t):m.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);m.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(m.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[Or](e,t,n){return Ar(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:kr(this.resource)}},e,t,n)}},K;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(K||(K={}));var Mr=`otel.component.name`,Nr=`otel.component.type`,Pr=`otel.span.parent.origin`,Fr=`otel.span.sampling_result`,Ir=`otel.sdk.processor.span.processed`,Lr=`otel.sdk.processor.span.queue.capacity`,Rr=`otel.sdk.processor.span.queue.size`,zr=`otel.sdk.span.live`,Br=`otel.sdk.span.started`,Vr=`batching_span_processor`;r();var Hr=class{constructor(e){i(this,`startedSpans`,void 0),i(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(Br,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(zr,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Wr(t);if(this.startedSpans.add(1,{[Pr]:Ur(e),[Fr]:n}),t===K.NOT_RECORD)return()=>{};let r={[Fr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Ur(e){return e?e.isRemote?`remote`:`local`:`none`}function Wr(e){switch(e){case K.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case K.RECORD:return`RECORD_ONLY`;case K.NOT_RECORD:return`DROP`}}var Gr=`2.9.0`;p(),D(),r();var Kr=class{constructor(e,t){i(this,`_sampler`,void 0),i(this,`_spanLimits`,void 0),i(this,`_idGenerator`,void 0),i(this,`instrumentationScope`,void 0),i(this,`_resource`,void 0),i(this,`_spanProcessor`,void 0),i(this,`_tracerMetrics`,void 0),this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor;let n=t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Gr);this._tracerMetrics=new Hr(n)}startSpan(e,t={},n=f.active()){t.root&&(n=d.deleteSpan(n));let r=d.getSpan(n);if(pe(n))return m.debug(`Instrumentation suppressed, returning Noop Span`),d.wrapSpanContext(c);let i=r?.spanContext(),a=this._idGenerator.generateSpanId(),o,l,p;!i||!d.isSpanContextValid(i)?l=this._idGenerator.generateTraceId():(l=i.traceId,p=i.traceState,o=i);let te=t.kind??ee.INTERNAL,h=(t.links??[]).map(e=>({context:e.context,attributes:w(e.attributes)})),ne=w(t.attributes),g=this._sampler.shouldSample(n,l,e,te,ne,h),re=this._tracerMetrics.startSpan(i,g.decision);p=g.traceState??p;let ie=g.decision===u.RECORD_AND_SAMPLED?s.SAMPLED:s.NONE,_={traceId:l,spanId:a,traceFlags:ie,traceState:p};if(g.decision===u.NOT_RECORD)return m.debug(`Recording is off, propagating context in a non-recording span`),d.wrapSpanContext(_);let v=w(Object.assign(ne,g.attributes));return new jr({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:_,name:e,kind:te,links:h,parentSpanContext:o,attributes:v,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:re})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??f.active(),c=this.startSpan(e,i,s),l=d.setSpan(s,c);return f.with(l,o,void 0,c)}[Or](e,t,n){return Ar(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:kr(this._resource)},spanLimits:this._spanLimits},e,t,n)}};D(),r();var qr=class{constructor(e){i(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{y(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},q=class{shouldSample(){return{decision:K.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},J=class{shouldSample(){return{decision:K.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};p(),D(),r();var Y=class{constructor(e){i(this,`_root`,void 0),i(this,`_remoteParentSampled`,void 0),i(this,`_remoteParentNotSampled`,void 0),i(this,`_localParentSampled`,void 0),i(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(y(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new J),this._remoteParentSampled=e.remoteParentSampled??new J,this._remoteParentNotSampled=e.remoteParentNotSampled??new q,this._localParentSampled=e.localParentSampled??new J,this._localParentNotSampled=e.localParentNotSampled??new q}shouldSample(e,t,n,r,i,a){let o=d.getSpanContext(e);return!o||!te(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&s.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&s.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};v(),r();var Jr=new Map,Yr=class{constructor(e,t,n){i(this,`processedSpans`,void 0),i(this,`queueSize`,void 0),i(this,`queueSizeCallback`,void 0),i(this,`standardAttrs`,void 0),i(this,`droppedAttrs`,void 0);let r=Jr.get(e)??0;if(Jr.set(e,r+1),this.standardAttrs={[Nr]:e,[Mr]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[se]:`queue_full`},this.processedSpans=t.createCounter(Ir,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(Lr,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(Rr,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[se]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}};p(),D(),r();var Xr=class{constructor(e){i(this,`_maxExportBatchSize`,void 0),i(this,`_maxQueueSize`,void 0),i(this,`_scheduledDelayMillis`,void 0),i(this,`_exportTimeoutMillis`,void 0),i(this,`_exporter`,void 0),i(this,`_metrics`,void 0),i(this,`_isExporting`,!1),i(this,`_finishedSpans`,[]),i(this,`_timer`,void 0),i(this,`_shutdownOnce`,void 0),i(this,`_droppedSpansCount`,0),this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new be(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(m.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize);let t=e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):a();this._metrics=new Yr(Vr,t,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&s.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&m.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(m.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);f.with(Oe(f.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===O.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{y(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,y(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Zr=class extends Xr{onShutdown(){}};r();var Qr=8,$r=16,ei=class{constructor(){i(this,`generateTraceId`,ti($r)),i(this,`generateSpanId`,ti(Qr))}},X=Buffer.allocUnsafe($r);function ti(e){return function(){for(let t=0;t<e/4;t++)X.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<e&&!(X[t]>0);t++)t===e-1&&(X[e-1]=1);return X.toString(`hex`,0,e)}}p(),xe(),r();var Z;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(Z||(Z={}));var ni=class{constructor(e={}){i(this,`_resource`,void 0),i(this,`_activeSpanProcessor`,void 0),i(this,`_forceFlushTimeoutMillis`,void 0),i(this,`_tracerOptions`,void 0),i(this,`_tracers`,new Map),this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Ce();let t=e.spanProcessors??[];this._activeSpanProcessor=new qr(t),this._tracerOptions={resource:this._resource,sampler:e.sampler??new Y({root:new J}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new ei,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return a()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new Kr({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Z.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==Z.timeout&&(r=Z.resolved,n(r))}).catch(e=>{clearTimeout(i),r=Z.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==Z.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Or](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return Ar(`TracerProvider`,{resource:{attributes:kr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}};D();var ri=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:E(e.startTime),duration:E(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});if(t)return t({code:O.SUCCESS})}};p(),r();var ii=class{constructor(e=0){i(this,`_ratio`,void 0),i(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:ne(t)&&this._accumulate(t)<this._upperBound?K.RECORD_AND_SAMPLED:K.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}};p(),D();var Q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Q||(Q={}));var $=1;function ai(){return{sampler:oi(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:S(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:S(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:S(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:S(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:S(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:S(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:S(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:S(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}function oi(){let e=_e(`OTEL_TRACES_SAMPLER`)??Q.ParentBasedAlwaysOn;switch(e){case Q.AlwaysOn:return new J;case Q.AlwaysOff:return new q;case Q.ParentBasedAlwaysOn:return new Y({root:new J});case Q.ParentBasedAlwaysOff:return new Y({root:new q});case Q.TraceIdRatio:return new ii(si());case Q.ParentBasedTraceIdRatio:return new Y({root:new ii(si())});default:return m.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${Q.ParentBasedAlwaysOn}".`),new Y({root:new J})}}function si(){let e=S(`OTEL_TRACES_SAMPLER_ARG`);return e==null?(m.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${$}.`),$):e<0||e>1?(m.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${$}.`),$):e}D();function ci(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??S(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??S(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??S(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??S(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,Object.assign({},e,{spanLimits:t})}D();var li=class extends ni{constructor(e={}){let t=le({},ai(),ci(e));delete t.generalLimits,super(t)}};D();var ui=class extends Zr{constructor(e,t){t||(t={});for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])if(t[e]===void 0){let r=S(n);r!==void 0&&(t[e]=r)}super({exporter:e,...t})}};n(),fe(),Pe(),Le(),He(),We(),Ye(),Qe(),nt(),rt(),ht(),st(),pt(),lt(),_t(),ke(),j();async function di(){return A(`Metrics opt-out check skipped — login removed`),{enabled:!1,hasError:!1}}D(),Ze(),j(),at(),ve(),r();var fi=class{constructor(e={}){i(this,`endpoint`,void 0),i(this,`timeout`,void 0),i(this,`pendingExports`,[]),i(this,`isShutdown`,!1),this.endpoint=`https://api.anthropic.com/api/claude_code/metrics`,this.timeout=e.timeout||5e3}async export(e,t){if(this.isShutdown){t({code:O.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{if(!(Xe()||Ie())){A(`BigQuery metrics export: trust not established, skipping`),t({code:O.SUCCESS});return}if(!(await di()).enabled){A(`Metrics export disabled by organization setting`),t({code:O.SUCCESS});return}let n=this.transformMetricsForInternal(e),r=ot();if(r.error){A(`Metrics export failed: ${r.error}`),t({code:O.FAILED,error:Error(r.error)});return}let i={"Content-Type":`application/json`,"User-Agent":je(),...r.headers},a=await Ne.post(this.endpoint,n,{timeout:this.timeout,headers:i});A(`BigQuery metrics exported successfully`),A(`BigQuery API Response: ${Ue(a.data,null,2)}`),t({code:O.SUCCESS})}catch(e){A(`BigQuery metrics export failed: ${Ge(e)}`),$e(e),t({code:O.FAILED,error:Ke(e)})}}transformMetricsForInternal(e){let t=e.resource.attributes,n={"service.name":t[`service.name`]||`workmate`,"service.version":t[`service.version`]||`unknown`,"os.type":t[`os.type`]||`unknown`,"os.version":t[`os.version`]||`unknown`,"host.arch":t[`host.arch`]||`unknown`,"aggregation.temporality":this.selectAggregationTemporality()===M.DELTA?`delta`:`cumulative`};return t[`wsl.version`]&&(n[`wsl.version`]=t[`wsl.version`]),n[`user.customer_type`]=`api`,{resource_attributes:n,metrics:e.scopeMetrics.flatMap(e=>e.metrics.map(e=>({name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit,data_points:this.extractDataPoints(e)})))}}extractDataPoints(e){return(e.dataPoints||[]).filter(e=>typeof e.value==`number`).map(e=>({attributes:this.convertAttributes(e.attributes),value:e.value,timestamp:this.hrTimeToISOString(e.endTime||e.startTime||[Date.now()/1e3,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),A(`BigQuery metrics exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),A(`BigQuery metrics exporter flush complete`)}convertAttributes(e){let t={};if(e)for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return t}hrTimeToISOString(e){let[t,n]=e;return new Date(t*1e3+n/1e6).toISOString()}selectAggregationTemporality(){return M.DELTA}};j(),Qe();var pi=class{error(e,...t){$e(Error(e)),A(`[3P telemetry] OTEL diag error: ${e}`,{level:`error`})}warn(e,...t){$e(Error(e)),A(`[3P telemetry] OTEL diag warn: ${e}`,{level:`warn`})}info(e,...t){}debug(e,...t){}verbose(e,...t){}};p(),xe(),v(),Le(),j(),We(),Ye(),bt(),yt();var mi=6e4,hi=5e3,gi=5e3,_i=class extends Error{};function vi(e,t){return new Promise((n,r)=>{setTimeout((e,t)=>e(new _i(t)),e,r,t).unref()})}function yi(){process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE||(process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=`delta`)}function bi(e){return(e||``).trim().split(`,`).filter(Boolean).map(e=>e.trim()).filter(e=>e!==`none`)}async function xi(){let t=bi(process.env.OTEL_METRICS_EXPORTER),n=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||mi.toString(),10),r=[];for(let n of t)if(n===`console`){let e=new Mn,t=e.export.bind(e);e.export=(e,n)=>(e.resource?.attributes&&(A(`
11
- === Resource Attributes ===`),A(Ue(e.resource.attributes)),A(`===========================
12
- `)),t(e,n)),r.push(e)}else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),t=Ai();switch(e){case`http/json`:{let{OTLPMetricExporter:e}=await import(`./esm-BadZVa27.js`);r.push(new e(t));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else if(n===`prometheus`){let{PrometheusExporter:t}=await import(`./src-BacxF9BD.js`).then(t=>e(t.default,1));r.push(new t)}else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`);return r.map(e=>`export`in e?new jn({exporter:e,exportIntervalMillis:n}):e)}async function Si(){let e=bi(process.env.OTEL_LOGS_EXPORTER),t=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;A(`[3P telemetry] getOtlpLogExporters: types=${Ue(e)}, protocol=${t}, endpoint=${n}`);let r=[];for(let n of e)if(n===`console`)r.push(new we);else if(n===`otlp`){let e=Ai();switch(t){case`http/json`:{let{OTLPLogExporter:t}=await import(`./esm-BCmY8V0C.js`);r.push(new t(e));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${t}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${n}`);return r}async function Ci(){let e=bi(process.env.OTEL_TRACES_EXPORTER),t=[];for(let n of e)if(n===`console`)t.push(new ri);else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=Ai();switch(e){case`http/json`:{let{OTLPTraceExporter:e}=await import(`./esm-BUJtY-Rb.js`);t.push(new e(n));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${n}`);return t}function wi(){return t(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function Ti(){return new jn({exporter:new fi,exportIntervalMillis:300*1e3})}function Ei(){return!1}async function Di(e){let t=process.env.BETA_TRACING_ENDPOINT;if(!t)return;let[{OTLPTraceExporter:n},{OTLPLogExporter:r}]=await Promise.all([import(`./esm-BUJtY-Rb.js`),import(`./esm-BCmY8V0C.js`)]),i={url:`${t}/v1/traces`},a={url:`${t}/v1/logs`},o=new li({resource:e,spanProcessors:[new ui(new n(i),{scheduledDelayMillis:gi})]});d.setGlobalTracerProvider(o),ze(o);let s=new Ee({resource:e,processors:[new Te(new r(a),{scheduledDelayMillis:hi})]});b.setGlobalLoggerProvider(s),Ve(s),Be(b.getLogger(`com.anthropic.claude_code.events`,`0.0.23`)),process.on(`beforeExit`,async()=>{await s?.forceFlush(),await o?.forceFlush()}),process.on(`exit`,()=>{s?.forceFlush(),o?.forceFlush()})}async function Oi(){if(it(`telemetry_init_start`),yi(),Je())for(let e of[`OTEL_METRICS_EXPORTER`,`OTEL_LOGS_EXPORTER`,`OTEL_TRACES_EXPORTER`]){let t=process.env[e];t?.includes(`console`)&&(process.env[e]=t.split(`,`).map(e=>e.trim()).filter(e=>e!==`console`).join(`,`))}m.setLogger(new pi,o.ERROR),vt();let e=[],t=wi();A(`[3P telemetry] isTelemetryEnabled=${t} (CLAUDE_CODE_ENABLE_TELEMETRY=${process.env.CLAUDE_CODE_ENABLE_TELEMETRY})`),t&&e.push(...await xi()),Ei()&&e.push(Ti());let n=tt(),r={[re]:`workmate`,[ae]:`0.0.23`};if(n===`wsl`){let e=et();e&&(r[`wsl.version`]=e)}let i=T(r),a=T(Ae.detect().attributes||{}),s=Se.detect(),c=T(s.attributes?.[`host.arch`]?{[g]:s.attributes[g]}:{}),l=T(De.detect().attributes||{}),u=i.merge(a).merge(c).merge(l);if(gt()){Di(u).catch(e=>A(`Beta tracing init failed: ${e}`,{level:`error`}));let t=new Er({resource:u,views:[],readers:e});return Fe(t),qe(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{St();let n=Re(),r=k(),i=[t.shutdown()];n&&i.push(n.forceFlush().then(()=>n.shutdown())),r&&i.push(r.forceFlush().then(()=>r.shutdown())),await Promise.race([Promise.all(i),vi(e,`OpenTelemetry shutdown timeout`)])}catch{}}),t.getMeter(`com.anthropic.claude_code`,`0.0.23`)}let f=new Er({resource:u,views:[],readers:e});if(Fe(f),t){let e=await Si();if(A(`[3P telemetry] Created ${e.length} log exporter(s)`),e.length>0){let t=new Ee({resource:u,processors:e.map(e=>new Te(e,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||hi.toString(),10)}))});b.setGlobalLoggerProvider(t),Ve(t),Be(b.getLogger(`com.anthropic.claude_code.events`,`0.0.23`)),A(`[3P telemetry] Event logger set successfully`),process.on(`beforeExit`,async()=>{await t?.forceFlush(),await k()?.forceFlush()}),process.on(`exit`,()=>{t?.forceFlush(),k()?.forceFlush()})}}if(t&&xt()){let e=await Ci();if(e.length>0){let t=new li({resource:u,spanProcessors:e.map(e=>new ui(e,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||gi.toString(),10)}))});d.setGlobalTracerProvider(t),ze(t)}}return qe(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{St();let t=[f.shutdown()],n=Re();n&&t.push(n.shutdown());let r=k();r&&t.push(r.shutdown()),await Promise.race([Promise.all(t),vi(e,`OpenTelemetry shutdown timeout`)])}catch(t){throw t instanceof Error&&t.message.includes(`timeout`)&&A(`
13
- OpenTelemetry telemetry flush timed out after ${e}ms
14
-
15
- To resolve this issue, you can:
16
- 1. Increase the timeout by setting CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS env var (e.g., 5000 for 5 seconds)
17
- 2. Check if your OpenTelemetry backend is experiencing scalability issues
18
- 3. Disable OpenTelemetry by unsetting CLAUDE_CODE_ENABLE_TELEMETRY env var
19
-
20
- Current timeout: ${e}ms
21
- `,{level:`error`}),t}}),f.getMeter(`com.anthropic.claude_code`,`0.0.23`)}function ki(){let e={},t=process.env.OTEL_EXPORTER_OTLP_HEADERS;if(t)for(let n of t.split(`,`)){let[t,...r]=n.split(`=`);t&&r.length>0&&(e[t.trim()]=r.join(`=`).trim())}return e}function Ai(){let e=ct(),t=ut(),n={},r=ki();Object.keys(r).length>0&&(n.headers=async()=>r);let i=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!e||i&&ft(i)){let e=dt();return(t||e)&&(n.httpAgentOptions={...t,...e&&{ca:e}}),n}let a=dt();return n.httpAgentOptions=n=>t||a?new mt(e,{...t&&{cert:t.cert,key:t.key,passphrase:t.passphrase},...a&&{ca:a}}):new mt(e),n}export{Oi as initializeTelemetry};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_w as t,aw as n,cw as r,fw as i,gw as a,hw as o,mw as s,ow as c}from"./loadAgentsDir-DlPbtIsS.js";import{C as l,I as u,N as d,x as f}from"./debug-Bglx1aTu.js";import{r as p,t as m}from"./promptEditor-DLGN_eLu.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(i.map(e=>o(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(o(r))||(n[r]=i);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return`${l({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.workmate.com/docs/en/keybindings`,bindings:v(a)},null,2)}\n`}var b=e((()=>{f(),t(),s()}));async function x(){if(!r())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=n(),t=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(d(e)===`EEXIST`)t=!0;else throw e}let i=await m(e);return i.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${i.error}`}:{type:`text`,value:t?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{c(),b(),u(),p()}))();export{x as call};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gc as n,Hc as r,Jc as i,Kc as a,Uc as o,Vc as s,Wc as c,Xc as l,Yc as u,qc as d}from"./loadAgentsDir-DlPbtIsS.js";import{I as f,P as p,ai as m,hn as h,t as g,y as _}from"./src-DL3w8VPk.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{n as y,t as b}from"./TextInput-CD9iau2k.js";function x(e){return e.mode===`list`?e.stores.length===0?(0,S.jsx)(f,{children:(0,S.jsx)(p,{dimColor:!0,children:`No memory stores found. Use /local-memory create <store> to create one.`})}):(0,S.jsxs)(f,{flexDirection:`column`,children:[(0,S.jsx)(f,{marginBottom:1,children:(0,S.jsxs)(p,{bold:!0,children:[`Local Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{children:` `}),(0,S.jsx)(p,{color:`success`,children:`◆`}),(0,S.jsxs)(p,{children:[` `,e]})]},e))]}):e.mode===`created`?(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{color:`success`,children:`✓`}),(0,S.jsx)(p,{children:` Store created: `}),(0,S.jsx)(p,{bold:!0,children:e.store})]}):e.mode===`stored`?(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{color:`success`,children:`✓`}),(0,S.jsx)(p,{children:` Stored entry `}),(0,S.jsx)(p,{bold:!0,children:e.key}),(0,S.jsx)(p,{children:` in `}),(0,S.jsx)(p,{bold:!0,children:e.store})]}):e.mode===`fetched`?(0,S.jsxs)(f,{flexDirection:`column`,children:[(0,S.jsxs)(f,{marginBottom:1,children:[(0,S.jsx)(p,{bold:!0,children:e.store}),(0,S.jsx)(p,{dimColor:!0,children:`/`}),(0,S.jsx)(p,{bold:!0,children:e.key})]}),(0,S.jsx)(f,{children:(0,S.jsx)(p,{children:e.value})})]}):e.mode===`not-found`?(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{color:`error`,children:`Not found: `}),(0,S.jsx)(p,{bold:!0,children:e.store}),e.key?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(p,{dimColor:!0,children:`/`}),(0,S.jsx)(p,{bold:!0,children:e.key})]}):null]}):e.mode===`entries`?e.keys.length===0?(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{dimColor:!0,children:`No entries in `}),(0,S.jsx)(p,{bold:!0,children:e.store}),(0,S.jsxs)(p,{dimColor:!0,children:[`. Use /local-memory store `,e.store,` <key> <value> to add one.`]})]}):(0,S.jsxs)(f,{flexDirection:`column`,children:[(0,S.jsxs)(f,{marginBottom:1,children:[(0,S.jsx)(p,{bold:!0,children:e.store}),(0,S.jsxs)(p,{dimColor:!0,children:[` (`,e.keys.length,` entries)`]})]}),e.keys.map(e=>(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{children:` `}),(0,S.jsx)(p,{color:`success`,children:`·`}),(0,S.jsxs)(p,{children:[` `,e]})]},e))]}):e.mode===`archived`?(0,S.jsxs)(f,{children:[(0,S.jsx)(p,{color:`success`,children:`✓`}),(0,S.jsx)(p,{children:` Archived store: `}),(0,S.jsx)(p,{bold:!0,children:e.store}),(0,S.jsxs)(p,{dimColor:!0,children:[` (renamed to `,e.store,`.archived)`]})]}):(0,S.jsx)(f,{children:(0,S.jsxs)(p,{color:`error`,children:[`Error: `,e.message]})})}var S,C=e((()=>{g(),S=v()}));function w(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`create`){let e=n[1];return e?{action:`create`,store:e}:{action:`invalid`,reason:`create requires a store name. ${T}`}}if(r===`store`){let e=n[1],t=n[2];if(!e)return{action:`invalid`,reason:`store requires a store name. ${T}`};if(!t)return{action:`invalid`,reason:`store requires a key. ${T}`};let r=n.slice(3).join(` `);return r?{action:`store`,store:e,key:t,value:r}:{action:`invalid`,reason:`store requires a value. ${T}`}}if(r===`fetch`){let e=n[1],t=n[2];return e?t?{action:`fetch`,store:e,key:t}:{action:`invalid`,reason:`fetch requires a key. ${T}`}:{action:`invalid`,reason:`fetch requires a store name. ${T}`}}if(r===`entries`){let e=n[1];return e?{action:`entries`,store:e}:{action:`invalid`,reason:`entries requires a store name. ${T}`}}if(r===`archive`){let e=n[1];return e?{action:`archive`,store:e}:{action:`invalid`,reason:`archive requires a store name. ${T}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${T}`}}var T,E=e((()=>{T=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`}));function D(e){return async(t,n,r)=>{let i=e.parseArgs(r??``);if(O(i))return t(`Invalid args: ${i.reason}`,{display:`system`}),e.errorView(i.reason);try{let r=await e.dispatch(i,t,n);return r===null?null:k.createElement(e.View,r)}catch(n){let r=n instanceof Error?n.message:String(n);return e.onDispatchError?.(n),t(`${e.commandName} failed: ${r}`,{display:`system`}),e.errorView(r)}}}function O(e){return typeof e==`object`&&!!e&&`action`in e&&e.action===`invalid`}var k,A=e((()=>{k=t(m(),1)}));function j(e){return e.length===0?`No memory stores found.`:[`Local Memory Stores`,...e.map(e=>`- ${e}`)].join(`
2
- `)}function M(e,t){return t.length===0?`No entries in "${e}".`:[`Entries in "${e}"`,...t.map(e=>`- ${e}`)].join(`
3
- `)}function N({onDone:e}){let[t,c]=F.useState({kind:`menu`}),[u,m]=F.useState(0),[g,v]=F.useState(``),[y,x]=F.useState(0),[S,C]=F.useState(null),w=F.useCallback(e=>{c(e),v(``),x(0),C(null)},[]),T=F.useCallback(t=>e(t,{display:`system`}),[e]),E=F.useCallback((e,t,n,c,l={})=>{try{if(e===`list`){T(j(d()));return}if(e===`about`){T(L);return}if(!t){C(`Internal: missing store`);return}if(e===`create`){r(t),T(`Store created: ${t}`);return}if(e===`entries`){let e=a(t);T(M(t,e));return}if(e===`archive`){s(t),T(`Archived store: ${t}`);return}if(e===`fetch`){if(!n){C(`Internal: missing key`);return}let e=o(t,n);if(e===null){T(`Entry not found: ${t}/${n}`);return}T(`Entry fetched: ${t}/${n}\n\n${e}`);return}if(e===`store`){if(!n||c===void 0){C(`Internal: missing key or value`);return}if(!l.confirmedOverwrite&&o(t,n)!==null){w({kind:`confirm-overwrite`,store:t,key:n,value:c});return}i(t,n,c),T(`Stored ${t}/${n} (${c.length} chars)`);return}}catch(e){C(e instanceof Error?e.message:String(e))}},[T,w]);if(h((e,n)=>{if(t.kind!==`menu`)return;if(n.upArrow){m(e=>Math.max(0,e-1));return}if(n.downArrow){m(e=>Math.min(z.length-1,e+1));return}if(n.return){let e=z[u];if(!e)return;if(e.kind===`list`||e.kind===`about`){E(e.kind,void 0,void 0,void 0);return}w({kind:`collect-store`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=z.length&&m(r-1)},{isActive:t.kind===`menu`}),h((e,n)=>{if(t.kind!==`confirm-archive`&&t.kind!==`confirm-overwrite`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();r===`y`||n.return?t.kind===`confirm-archive`?E(`archive`,t.store,void 0,void 0):E(`store`,t.store,t.key,t.value,{confirmedOverwrite:!0}):r===`n`&&w({kind:`menu`})},{isActive:t.kind===`confirm-archive`||t.kind===`confirm-overwrite`}),h((e,n)=>{if(!(t.kind!==`collect-store`&&t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:t.action,store:t.store});return}if(t.kind===`collect-key`){w({kind:`collect-store`,action:t.action});return}w({kind:`menu`})}},{isActive:t.kind===`collect-store`||t.kind===`collect-key`||t.kind===`collect-value`}),t.kind===`menu`)return(0,I.jsx)(_,{title:`Local Memory`,subtitle:`${z.length} actions`,onCancel:()=>T(`Local memory panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,I.jsxs)(f,{flexDirection:`column`,children:[z.map((e,t)=>(0,I.jsxs)(f,{flexDirection:`row`,children:[(0,I.jsx)(p,{children:`${t===u?`›`:` `} ${e.label}`.padEnd(R)}),(0,I.jsx)(p,{dimColor:!0,children:e.description})]},e.kind)),(0,I.jsx)(f,{marginTop:1,children:(0,I.jsx)(p,{dimColor:!0,children:`↑/↓ or 1-7 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-archive`)return(0,I.jsx)(_,{title:`Confirm Archive`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,I.jsxs)(f,{flexDirection:`column`,children:[(0,I.jsxs)(p,{children:[`Archive store "`,t.store,`"? This renames it to *.archived.`]}),(0,I.jsx)(f,{marginTop:1,children:(0,I.jsx)(p,{dimColor:!0,children:`y/Enter = archive · n/Esc = cancel`})})]})});if(t.kind===`confirm-overwrite`)return(0,I.jsx)(_,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,I.jsxs)(f,{flexDirection:`column`,children:[(0,I.jsxs)(p,{children:[`Entry "`,t.store,`/`,t.key,`" already exists. Overwrite with new value (`,t.value.length,` chars)?`]}),(0,I.jsx)(f,{marginTop:1,children:(0,I.jsx)(p,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})})]})});let D=t.kind===`collect-store`?`STORE NAME`:t.kind===`collect-key`?`KEY NAME`:`VALUE`,O=t.kind===`collect-store`?`e.g. my-notes`:t.kind===`collect-key`?`e.g. todo-2026-05-08`:`free text`;return(0,I.jsx)(_,{title:`Local Memory · ${t.kind.replace(`collect-`,``).toUpperCase()}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,I.jsxs)(f,{flexDirection:`column`,children:[(0,I.jsx)(f,{children:(0,I.jsx)(p,{dimColor:!0,children:D})}),(0,I.jsxs)(f,{children:[(0,I.jsx)(p,{children:`> `}),(0,I.jsx)(b,{value:g,onChange:e=>{v(e),C(null)},cursorOffset:y,onChangeCursorOffset:x,onSubmit:e=>{let r=e.trim();if(t.kind===`collect-store`){if(!r){C(`Store name required`);return}if(!n(r)){C(`Invalid store name (no /, \\, :, null byte, or leading dot; max 255 chars)`);return}t.action===`create`||t.action===`entries`||t.action===`archive`?t.action===`archive`?w({kind:`confirm-archive`,store:r}):E(t.action,r,void 0,void 0):w({kind:`collect-key`,action:t.action,store:r});return}if(t.kind===`collect-key`){if(!r){C(`Key required`);return}if(!l(r)){C(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}t.action===`fetch`?E(`fetch`,t.store,r,void 0):w({kind:`collect-value`,action:`store`,store:t.store,key:r});return}t.kind===`collect-value`&&E(`store`,t.store,t.key,e)},placeholder:O,columns:70,showCursor:!0})]}),S!==null&&(0,I.jsx)(f,{marginTop:0,children:(0,I.jsxs)(p,{color:`warning`,children:[`✗ `,S]})}),(0,I.jsx)(f,{marginTop:1,children:(0,I.jsx)(p,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function P(e,t){if(e.action===`list`)return t(j(d()),{display:`system`}),null;if(e.action===`create`){let{store:n}=e;return r(n),t(`Store created: ${n}`,{display:`system`}),null}if(e.action===`store`){let{store:n,key:r,value:a}=e;return i(n,r,a),t(`Stored entry "${r}" in store "${n}".`,{display:`system`}),null}if(e.action===`fetch`){let{store:n,key:r}=e,i=o(n,r);return i===null?(t(`Entry not found: ${n}/${r}`,{display:`system`}),null):(t(`Entry fetched: ${n}/${r}\n${i}`,{display:`system`}),null)}if(e.action===`entries`){let{store:n}=e;return t(M(n,a(n)),{display:`system`}),null}if(e.action===`archive`){let{store:n}=e;return s(n),t(`Archived store: ${n}`,{display:`system`}),null}return t(L,{display:`system`}),null}var F,I,L,R,z,B,V;e((()=>{F=t(m(),1),g(),c(),u(),y(),C(),E(),A(),I=v(),L=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`,R=26,z=[{kind:`list`,label:`List`,description:`显示所有 store`},{kind:`create`,label:`Create`,description:`创建一个新的记忆 store`},{kind:`store`,label:`Store`,description:`写入条目:store 名 + key + value`},{kind:`fetch`,label:`Fetch`,description:`按 store 名 + key 读取条目`},{kind:`entries`,label:`Entries`,description:`列出某个 store 里的 entry key`},{kind:`archive`,label:`Archive`,description:`归档 store(重命名为 *.archived)`},{kind:`about`,label:`About`,description:`显示命令语法`}],B=D({commandName:`local-memory`,parseArgs:e=>{let t=w(e);return t.action===`invalid`?{action:`invalid`,reason:`${L}\n${t.reason}`}:t},dispatch:P,View:x,errorView:e=>F.createElement(x,{mode:`error`,message:e})}),V=async(e,t,n)=>(n??``).trim()===``?(0,I.jsx)(N,{onDone:e}):B(e,t,n)}))();export{V as callLocalMemory};
@@ -1,8 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,I as n,P as r,t as i,x as a}from"./src-DL3w8VPk.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as s,g as c,p as l,s as u}from"./config-C-Y2qtB2.js";import{n as d,r as f}from"./analytics-DJobLaWP.js";import{n as p,t as m}from"./ThemePicker-0F0hZYPX.js";function h(e){return e}function g(e){let t=e.trim().toLowerCase();return t===``||t===`reset`?{sub:`full`}:b.has(t)?{sub:t}:{sub:`full`,unknownArg:t}}function _({onDone:e}){let[,n]=t();return(0,y.jsx)(a,{color:`permission`,children:(0,y.jsx)(m,{onThemeSelect:t=>{n(t),f(`tengu_onboarding_step`,{stepId:h(`theme`)}),e(`Theme set to ${t}.`)},onCancel:()=>e(`Theme picker dismissed.`),skipExitHandling:!0})})}function v({theme:e,hasCompletedOnboarding:t,lastOnboardingVersion:i}){return(0,y.jsxs)(n,{flexDirection:`column`,paddingLeft:1,children:[(0,y.jsx)(r,{bold:!0,children:`Onboarding status`}),(0,y.jsxs)(r,{children:[`- Theme: `,(0,y.jsx)(r,{bold:!0,children:e})]}),(0,y.jsxs)(r,{children:[`- Onboarding completed:`,` `,(0,y.jsx)(r,{bold:!0,color:t?`success`:`warning`,children:t?`yes`:`no`})]}),(0,y.jsxs)(r,{children:[`- Last onboarding version: `,(0,y.jsx)(r,{bold:!0,children:i})]}),(0,y.jsx)(r,{dimColor:!0,children:`Run /onboarding (no args) to re-run the full flow, or /onboarding theme | trust | model | mcp for a specific step.`})]})}var y,b,x;e((()=>{i(),d(),p(),l(),y=o(),b=new Set([`full`,`theme`,`trust`,`model`,`mcp`,`status`]),x=async(e,t,n)=>{let{sub:r,unknownArg:i}=g(n);if(f(`tengu_onboarding_step`,{stepId:h(`slash_${r}`)}),i!==void 0)return e(`Unknown /onboarding subcommand: \`${i}\`.\nValid: full | theme | trust | model | mcp | status`,{display:`system`}),null;if(r===`theme`)return(0,y.jsx)(_,{onDone:t=>e(t)});if(r===`trust`)return c(e=>({...e,hasTrustDialogAccepted:!1})),e("Workspace trust cleared for the current project. The trust dialog will appear on the next `claude` launch.",{display:`system`}),null;if(r===`model`)return e("Run `/model` to pick the AI model. Onboarding does not own the model picker; this entry exists for discoverability only.",{display:`system`}),null;if(r===`mcp`)return e("MCP server setup:\n - `/mcp` — list configured MCP servers\n - `claude mcp add <name> <command>` — add a server (in your shell)\n - `claude mcp remove <name>` — remove a server\nServers also load from `.mcp.json` in the workspace and from `~/.workmate.json` globally.",{display:`system`}),null;if(r===`status`){let e=u();return(0,y.jsx)(v,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return s(e=>({...e,hasCompletedOnboarding:!1})),e(`Onboarding flag cleared. The full first-run setup (theme, OAuth/API key, security notes, terminal-setup) will run on the next \`claude\` launch.
2
-
3
- For individual steps in this session, use:
4
- /onboarding theme — re-pick theme inline
5
- /onboarding trust — re-confirm workspace trust on next launch
6
- /onboarding model — open /model picker
7
- /onboarding mcp — show MCP setup hints
8
- /onboarding status — show current onboarding state`,{display:`system`}),null}}))();export{x as callOnboarding};
@@ -1 +0,0 @@
1
- import{o as e,t}from"./loadAgentsDir-DlPbtIsS.js";e();export{t as clearAgentDefinitionsCache};
@@ -1 +0,0 @@
1
- import{a as e,o as t,s as n,t as r}from"./localSearch-CK-sFzPm.js";t();export{r as clearSkillIndexCache,e as getSkillIndex,n as searchSkills};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ar as t,_r as n}from"./loadAgentsDir-DlPbtIsS.js";import{Gr as r,t as i}from"./src-DL3w8VPk.js";import{It as a,st as o}from"./state-B4jiUise.js";import{n as s,t as c}from"./cwd-Pa83R95t.js";import{h as l,t as u,wn as d,xn as f}from"./settings-B2jvL8Dp.js";import{C as p,S as m,_ as h,y as g}from"./startupProfiler-CJdr3SxP.js";function _(e){return e>=70?`horizontal`:`compact`}function v(e,t,n){if(t===`horizontal`){let t=n,r=e-(7+t),i=Math.max(30,r),a=Math.min(t+i+k+A,e-O);return a<t+i+k+A&&(i=a-t-k-A),{leftWidth:t,rightWidth:i,totalWidth:a}}let r=Math.min(e-O,70);return{leftWidth:r,rightWidth:r,totalWidth:r}}function y(e,t,n){let i=Math.max(r(e),r(t),r(n),20);return Math.min(i+4,E)}function b(e){return!e||e.length>D?`Welcome back!`:`Welcome back ${e}!`}function x(e,t){if(r(e)<=t)return e;let n=e.split(`/`),i=n[0]||``,a=n[n.length-1]||``,o=r(i),s=r(a);if(n.length===1)return m(e,t);if(i===``&&2+s>=t)return`/${m(a,Math.max(1,t-1))}`;if(i!==``&&3+s>=t)return`…/${m(a,Math.max(1,t-1-1))}`;if(n.length===2)return`${p(i,t-1-1-s)}…/${a}`;let c=t-o-s-1-2;if(c<=0)return`${p(i,Math.max(0,t-s-1-2))}/…/${a}`;let l=[];for(let e=n.length-2;e>0;e--){let t=n[e];if(t&&r(t)+1<=c)l.unshift(t),c-=r(t)+1;else break}return l.length===0?`${i}/…/${a}`:`${i}/…/${l.join(`/`)}/${a}`}async function S(){if(M)return M;let e=o();return M=t(10).then(t=>(j=t.filter(t=>{if(t.isSidechain||t.sessionId===e||t.summary?.includes(`I apologize`))return!1;let n=t.summary&&t.summary!==`No prompt`,r=t.firstPrompt&&t.firstPrompt!==`No prompt`;return n||r}).slice(0,3),j)).catch(()=>(j=[],j)),M}function C(){return j}function w(){return{version:process.env.DEMO_VERSION??`0.0.23`,cwd:process.env.DEMO_VERSION?`/code/claude`:f(c()),billingType:`API Usage Billing`,agentName:u().agent}}function T(e,t,n){return r(e)+3+r(t)>n?{shouldSplit:!0,truncatedModel:g(e,n),truncatedBilling:g(t,n)}:{shouldSplit:!1,truncatedModel:g(e,Math.max(n-r(t)-3,10)),truncatedBilling:t}}var E,D,O,k,A,j,M,N=e((()=>{a(),i(),s(),d(),h(),n(),l(),E=50,D=20,O=4,k=1,A=2,j=[],M=null}));export{_ as a,C as c,b as i,N as l,y as n,w as o,T as r,S as s,v as t,x as u};