@readmagic/workmate 0.0.22 → 0.0.23

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 (394) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DWgTWJ7R.js → AddWorkspaceDirectory-OgcBcK5A.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-s0Orgord.js → AgentsMdExternalIncludesDialog-CNEifEyV.js} +1 -1
  4. package/dist/chunks/App-B-3tPQ3k.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-COuhHcey.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-D2Gesf-u.js → BypassPermissionsModeDialog-bJek4siJ.js} +1 -1
  7. package/dist/chunks/CustomSelect-DoeEXOIP.js +1 -0
  8. package/dist/chunks/{DiffDialog-v2IiYyi3.js → DiffDialog-B3X9FMpO.js} +5 -5
  9. package/dist/chunks/Doctor-6PXyjIi6.js +3 -0
  10. package/dist/chunks/Doctor-DNgkgYhB.js +1 -0
  11. package/dist/chunks/{ExitFlow-BasHk1mk.js → ExitFlow-DgAZp_8U.js} +2 -2
  12. package/dist/chunks/Grove-CHatOzcE.js +11 -0
  13. package/dist/chunks/{InvalidConfigDialog-DYVQK5js.js → InvalidConfigDialog-DXL92MN9.js} +1 -1
  14. package/dist/chunks/{InvalidSettingsDialog-Dg6OiStR.js → InvalidSettingsDialog-Dtmpzeps.js} +1 -1
  15. package/dist/chunks/{KeybindingProviderSetup-Bn1jzN5F.js → KeybindingProviderSetup-DA37QUFs.js} +1 -1
  16. package/dist/chunks/MCPConnectionManager-thZd-xA_.js +1 -0
  17. package/dist/chunks/MCPToolListView-CpY-YJg4.js +1 -0
  18. package/dist/chunks/{McpParsingWarnings-DZejAh8b.js → McpParsingWarnings-JvChf3xr.js} +1 -1
  19. package/dist/chunks/MessageSelector-C0_iw7SI.js +3 -0
  20. package/dist/chunks/Messages-K4DDsDP9.js +10 -0
  21. package/dist/chunks/Onboarding-C1UdzM-1.js +1 -0
  22. package/dist/chunks/{PromptInputFooterSuggestions-lkr_A5jQ.js → PromptInputFooterSuggestions-AyLog8p7.js} +1 -1
  23. package/dist/chunks/{PromptInputHelpMenu-DaQKKyM5.js → PromptInputHelpMenu-oyic20ip.js} +1 -1
  24. package/dist/chunks/ProviderSetup-XcBHjUnd.js +1 -0
  25. package/dist/chunks/QueryEngine-DYxBjJ4i.js +1 -0
  26. package/dist/chunks/REPL-CQBJRrT0.js +124 -0
  27. package/dist/chunks/REPL-CrVuMQY2.js +1 -0
  28. package/dist/chunks/ResumeConversation-Dl8H9Gfy.js +1 -0
  29. package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +1 -0
  30. package/dist/chunks/{SelectMulti-CNE06VAN.js → SelectMulti-Bc6l11_K.js} +1 -1
  31. package/dist/chunks/Settings-TGp3fPrS.js +3 -0
  32. package/dist/chunks/Spinner-zYPFVFHN.js +1 -0
  33. package/dist/chunks/{SpinnerGlyph-A6G-gloN.js → SpinnerGlyph-CmkRUvHe.js} +1 -1
  34. package/dist/chunks/{TextInput-7uqPhq9T.js → TextInput-CD9iau2k.js} +5 -5
  35. package/dist/chunks/{ThemePicker-DT9zVy-0.js → ThemePicker-0F0hZYPX.js} +1 -1
  36. package/dist/chunks/TrustDialog-C76YiMKz.js +1 -0
  37. package/dist/chunks/{ValidationErrorsList-BLtP647v.js → ValidationErrorsList-DgNzJQUP.js} +1 -1
  38. package/dist/chunks/_baseEach-4ff-vRlp.js +1 -0
  39. package/dist/chunks/add-dir-JMsRLGfx.js +1 -0
  40. package/dist/chunks/{agentDisplay-vLQHFrmq.js → agentDisplay-BReJUBWg.js} +1 -1
  41. package/dist/chunks/agents-9qQ8I6zW.js +101 -0
  42. package/dist/chunks/{agents-DLz0kfsr.js → agents-B3x8yJ_r.js} +1 -1
  43. package/dist/chunks/allErrors-DfWylHSw.js +1 -0
  44. package/dist/chunks/{appleTerminalBackup-BYKdf3of.js → appleTerminalBackup-BArZWB21.js} +1 -1
  45. package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +1 -0
  46. package/dist/chunks/backgroundHousekeeping-CVNIhQg8.js +17 -0
  47. package/dist/chunks/banner-Cu2-XUek.js +2 -0
  48. package/dist/chunks/{bedrockClient-DxE_mHFI.js → bedrockClient-CfiDN-kF.js} +2 -2
  49. package/dist/chunks/branch-C4TsMEkx.js +2 -0
  50. package/dist/chunks/{break-cache-BL2gnDLX.js → break-cache-BMXqFTeS.js} +2 -2
  51. package/dist/chunks/btw-Dn1eYFAz.js +1 -0
  52. package/dist/chunks/caches-BGzKwpnc.js +1 -0
  53. package/dist/chunks/caches-DArHxBgL.js +1 -0
  54. package/dist/chunks/{claudeDesktop-D3PEgx3U.js → claudeDesktop-D8ml2767.js} +1 -1
  55. package/dist/chunks/{clear-CXfhVRp8.js → clear-Bdhb6b39.js} +1 -1
  56. package/dist/chunks/{client-DdenNfkQ.js → client-4iqhC8xq.js} +1 -1
  57. package/dist/chunks/client-BiqbIkwr.js +1 -0
  58. package/dist/chunks/client-CZ8nyVh5.js +1 -0
  59. package/dist/chunks/{client-DvhWKIOx.js → client-CpTCeWba.js} +1 -1
  60. package/dist/chunks/commands-QepeBbFn.js +1 -0
  61. package/dist/chunks/compact-Bu9BUpxV.js +2 -0
  62. package/dist/chunks/config-C-Y2qtB2.js +3 -0
  63. package/dist/chunks/config-D58C3_Lu.js +1 -0
  64. package/dist/chunks/config-DD8fCYXn.js +1 -0
  65. package/dist/chunks/{context-3s9wtn4L.js → context-CY_yfdYa.js} +1 -1
  66. package/dist/chunks/context-noninteractive-BDDi3NLF.js +1 -0
  67. package/dist/chunks/{context-noninteractive-CJhUu_4y.js → context-noninteractive-Dd4xIoP1.js} +5 -5
  68. package/dist/chunks/conversation-B0wxBwzv.js +1 -0
  69. package/dist/chunks/conversation-DUu9qBnq.js +1 -0
  70. package/dist/chunks/conversationRecovery-2ft8sCPE.js +1 -0
  71. package/dist/chunks/crossProjectResume-6boHMUBx.js +40 -0
  72. package/dist/chunks/cwd-Dc3NV7s8.js +1 -0
  73. package/dist/chunks/cwd-Pa83R95t.js +1 -0
  74. package/dist/chunks/{datadog-v_mXWncN.js → datadog-BPuGcxxC.js} +1 -1
  75. package/dist/chunks/{debug-8DCufdSp.js → debug-Bglx1aTu.js} +5 -5
  76. package/dist/chunks/{detectRepository-DfX8xXw2.js → detectRepository-CfX8Lc0A.js} +1 -1
  77. package/dist/chunks/{diff-DJSt7QO6.js → diff-BOAElpfQ.js} +1 -1
  78. package/dist/chunks/{directoryCompletion-CT6YVeg7.js → directoryCompletion-D_Rtg-4j.js} +1 -1
  79. package/dist/chunks/dist-es-B3-7VFf2.js +1 -0
  80. package/dist/chunks/dist-es-B7j_mv242.js +1 -0
  81. package/dist/chunks/dist-es-BSKD_hOQ.js +1 -0
  82. package/dist/chunks/dist-es-BSRN-2nA.js +9 -0
  83. package/dist/chunks/{dist-es-yHGBqhBe.js → dist-es-BXXmyhQ2.js} +1 -1
  84. package/dist/chunks/{dist-es-C3reqy7X.js → dist-es-BaQndfvh2.js} +1 -1
  85. package/dist/chunks/dist-es-CzTYn7xo.js +1 -0
  86. package/dist/chunks/dist-es-DSkyibcN.js +1 -0
  87. package/dist/chunks/{dist-es-BOPBJQo3.js → dist-es-_UNJQniz.js} +1 -1
  88. package/dist/chunks/dist-es-hwK6468D.js +1 -0
  89. package/dist/chunks/dist-es-ovsdbtwh.js +1 -0
  90. package/dist/chunks/doctor-CkLzqAMd.js +1 -0
  91. package/dist/chunks/{entry-ex0-RyYV.js → entry-TNOoyy7_.js} +4 -4
  92. package/dist/chunks/{envUtils-DcaKZlRU.js → envUtils-DfkgIdYf.js} +1 -1
  93. package/dist/chunks/esm-eTAUP-La.js +1 -0
  94. package/dist/chunks/{execFileNoThrow-BsfuytkN.js → execFileNoThrow-BTachNBI.js} +1 -1
  95. package/dist/chunks/exit-DXApFJIP.js +1 -0
  96. package/dist/chunks/extraUsage-CmQaLPV1.js +1 -0
  97. package/dist/chunks/extractMemories-xP63mv6R.js +1 -0
  98. package/dist/chunks/fast-C5nQH8rm.js +1 -0
  99. package/dist/chunks/fast-eGx2IxD7.js +1 -0
  100. package/dist/chunks/fetchModelList-CxLsVNsu.js +1 -0
  101. package/dist/chunks/fetchModelList-D24lRIgR.js +1 -0
  102. package/dist/chunks/{fileSuggestions-B-SLfb-o.js → fileSuggestions-DHxdwq28.js} +2 -2
  103. package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +1 -0
  104. package/dist/chunks/firstPartyEventLogger-M6UMli2c.js +3 -0
  105. package/dist/chunks/{gemini-BC9kHhwe.js → gemini-D_ORb_L6.js} +2 -2
  106. package/dist/chunks/generateSessionName-BQoDduyA.js +1 -0
  107. package/dist/chunks/{genericProcessUtils-BYi0OefF.js → genericProcessUtils-DwQFuna9.js} +1 -1
  108. package/dist/chunks/goal-D7c2mSds.js +3 -0
  109. package/dist/chunks/grok-B2-ZbUiR.js +1 -0
  110. package/dist/chunks/grove-O6qp7ITR.js +1 -0
  111. package/dist/chunks/{help-CK90i4hE.js → help-CZJdRviD.js} +1 -1
  112. package/dist/chunks/history-CQiUERTL.js +1 -0
  113. package/dist/chunks/hooks-BNuUlMzL.js +1 -0
  114. package/dist/chunks/{hooks-BRFDg9DV.js → hooks-DIvN6gdv.js} +3 -3
  115. package/dist/chunks/{install-ZMll-dAa.js → install-T_CV1Slu.js} +1 -1
  116. package/dist/chunks/instrumentation-BjqUZ383.js +21 -0
  117. package/dist/chunks/{job-G_ukhLc4.js → job-R6c4-3c8.js} +1 -1
  118. package/dist/chunks/keybindings-CLRaiL_Z.js +1 -0
  119. package/dist/chunks/{launchLocalMemory-BcRlXLm6.js → launchLocalMemory-DrbKrwXc.js} +2 -2
  120. package/dist/chunks/launchOnboarding-tqsMD8ni.js +8 -0
  121. package/dist/chunks/loadAgentsDir-CcmY8zCj.js +1 -0
  122. package/dist/chunks/{loadAgentsDir-C1LkW7gl.js → loadAgentsDir-DlPbtIsS.js} +540 -543
  123. package/dist/chunks/loadPluginHooks-C_msxVIc.js +1 -0
  124. package/dist/chunks/{loader-C61fB6vU.js → loader-CICGtLp2.js} +1 -1
  125. package/dist/chunks/{localSearch-DFo_WTMm.js → localSearch-CK-sFzPm.js} +1 -1
  126. package/dist/chunks/localSearch-DrUj0B-d.js +1 -0
  127. package/dist/chunks/{log-DaILwWJa.js → log-D2TIwHBV.js} +1 -1
  128. package/dist/chunks/logoUtils-x2pHV-Nl.js +1 -0
  129. package/dist/chunks/{magicDocs-DYc9TFmI.js → magicDocs-BEF8D3if.js} +3 -3
  130. package/dist/chunks/main-kOVUGxOS.js +345 -0
  131. package/dist/chunks/managedEnv-BEqrGqn1.js +1 -0
  132. package/dist/chunks/managedEnv-OPlzUPbJ.js +1 -0
  133. package/dist/chunks/mcp-BNd29r6p.js +6 -0
  134. package/dist/chunks/mcp-D0wAJrRT.js +1 -0
  135. package/dist/chunks/mcp-mgOlm1cY.js +2 -0
  136. package/dist/chunks/memory-DDLk9_LJ.js +1 -0
  137. package/dist/chunks/{mode-Pan-Q2c4.js → mode-CcNsWgK3.js} +2 -2
  138. package/dist/chunks/model-BwBG0V1u.js +1 -0
  139. package/dist/chunks/model-DzCP4K-9.js +1 -0
  140. package/dist/chunks/modelOptions-DRaG3bo0.js +1 -0
  141. package/dist/chunks/nativeInstaller-C3pVPqrZ.js +1 -0
  142. package/dist/chunks/notifications-4wP1Tx9Y.js +1 -0
  143. package/dist/chunks/onChangeAppState-BlaoFbYF.js +1 -0
  144. package/dist/chunks/openai-CDN71NdX.js +2 -0
  145. package/dist/chunks/{overlayContext-CMV7nYR9.js → overlayContext-BT2Lq8ei.js} +1 -1
  146. package/dist/chunks/{panel-D9fGQgln.js → panel-CVS4SK_E.js} +1 -1
  147. package/dist/chunks/parser-CG5RuOCK.js +1 -0
  148. package/dist/chunks/{parser-D8slvrJP.js → parser-Cg6hSCmn.js} +1 -1
  149. package/dist/chunks/partition-CIl_ORUT.js +1 -0
  150. package/dist/chunks/{pasteStore-DNV1M5Xd.js → pasteStore-P0zP-ch0.js} +1 -1
  151. package/dist/chunks/permissions-zSNOZSwr.js +3 -0
  152. package/dist/chunks/pidLock-BTqO-h7Y.js +3 -0
  153. package/dist/chunks/{plan-CQLnPLuE.js → plan-Bs6em6lk.js} +1 -1
  154. package/dist/chunks/{platform-Dzff1WWw.js → platform-BacQ6ACS.js} +1 -1
  155. package/dist/chunks/plugin-DDDxjBa0.js +17 -0
  156. package/dist/chunks/{pluginAutoupdate-BJaAqwTH.js → pluginAutoupdate-8qugAFhb.js} +1 -1
  157. package/dist/chunks/pluginBlocklist-q01ackCf.js +1 -0
  158. package/dist/chunks/pluginCliCommands-DXZfCZsv.js +1 -0
  159. package/dist/chunks/{pluginFlagging-DQP8tBi2.js → pluginFlagging-BG2MHCQJ.js} +1 -1
  160. package/dist/chunks/pluginOperations-hXYLrzM2.js +2 -0
  161. package/dist/chunks/{pluginStartupCheck-CfRvCrFg.js → pluginStartupCheck-DTMa6TgL.js} +1 -1
  162. package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +1 -0
  163. package/dist/chunks/plugins-COoGBYk6.js +4 -0
  164. package/dist/chunks/{poorMode-J5SYJvoY.js → poorMode-B0QGV6Ci.js} +1 -1
  165. package/dist/chunks/poorMode-G-pnu6NM.js +1 -0
  166. package/dist/chunks/print-BASybEtO.js +13 -0
  167. package/dist/chunks/processBashCommand-DDi_Pymt.js +1 -0
  168. package/dist/chunks/processSlashCommand-Cq9kaoSF.js +5 -0
  169. package/dist/chunks/{projectContext-Bw3o5BrN.js → projectContext-5fmRr6Sd.js} +1 -1
  170. package/dist/chunks/{projectContext-BN2ZWzOG.js → projectContext-DhtjLv3k.js} +1 -1
  171. package/dist/chunks/{projectOnboardingState-CJycxw5P.js → projectOnboardingState-B5YATuc6.js} +1 -1
  172. package/dist/chunks/prompt-CHobfCB1.js +1 -0
  173. package/dist/chunks/prompt-CMm6RHHc.js +1 -0
  174. package/dist/chunks/{prompt-BGqgPgCU.js → prompt-mM79EGnT.js} +1 -1
  175. package/dist/chunks/{promptEditor-CmQ9p4oe.js → promptEditor-DLGN_eLu.js} +1 -1
  176. package/dist/chunks/{protocolHandler-CJo9-PfZ.js → protocolHandler-DjQALaU2.js} +1 -1
  177. package/dist/chunks/{proxy-CB17QimU.js → proxy-CDBfZjO7.js} +2 -2
  178. package/dist/chunks/reconciler-CeXqh95g.js +1 -0
  179. package/dist/chunks/refresh-Ce2yk28a.js +1 -0
  180. package/dist/chunks/{registerProtocol-CLIpzVwF.js → registerProtocol-CAsDme_E.js} +1 -1
  181. package/dist/chunks/reject-Bld5E-bn.js +1 -0
  182. package/dist/chunks/{reload-plugins-DjugL8jH.js → reload-plugins-C42xSB5l.js} +1 -1
  183. package/dist/chunks/rename-CtBghpxZ.js +1 -0
  184. package/dist/chunks/{renderOptions-Zqfm2U1y.js → renderOptions-DV0dn0IW.js} +1 -1
  185. package/dist/chunks/resume-BWkaTDqd.js +2 -0
  186. package/dist/chunks/ripgrep-DLs8MraF.js +1 -0
  187. package/dist/chunks/{ripgrep-BuzOTf1S.js → ripgrep-Dl3y5r4m.js} +1 -1
  188. package/dist/chunks/{runtimeObserver-CK_iZ6OB.js → runtimeObserver-1wQO8HSZ.js} +1 -1
  189. package/dist/chunks/{runtimeObserver-CpP0L9T9.js → runtimeObserver-XQrOux41.js} +4 -4
  190. package/dist/chunks/sandbox-adapter-8GO6eJxw.js +1 -0
  191. package/dist/chunks/{sandbox-toggle-KOHYvbQT.js → sandbox-toggle-Dir9Polo.js} +1 -1
  192. package/dist/chunks/searchExtraTools-BhDq8DTJ.js +1 -0
  193. package/dist/chunks/{select-C_KXmqbI.js → select-Bxf5-5sI.js} +1 -1
  194. package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +1 -0
  195. package/dist/chunks/sessionObserver-DGEQM4cO.js +1 -0
  196. package/dist/chunks/{sessionObserver-WOYv2n7C.js → sessionObserver-DS4G6mb9.js} +2 -2
  197. package/dist/chunks/sessionStorage-BcAscOGE.js +1 -0
  198. package/dist/chunks/sessionTracing-BoDDYLxW.js +11 -0
  199. package/dist/chunks/settings-B2jvL8Dp.js +24 -0
  200. package/dist/chunks/settings-CisDe8DB.js +1 -0
  201. package/dist/chunks/setup-BRypY6iT.js +3 -0
  202. package/dist/chunks/{shadowedRuleDetection-Df-kZ_pK.js → shadowedRuleDetection-BRxZjobz.js} +1 -1
  203. package/dist/chunks/{sideQuestion-CMB8hfgX.js → sideQuestion-DLJxyrlp.js} +3 -3
  204. package/dist/chunks/sinks-CGdKmq_8.js +1 -0
  205. package/dist/chunks/sinks-Cz2HfgMU.js +1 -0
  206. package/dist/chunks/skillChangeDetector-xviGstqm.js +1 -0
  207. package/dist/chunks/{skillGapStore-CfmlO6pb.js → skillGapStore-CKN_d3pO.js} +2 -2
  208. package/dist/chunks/{skillLifecycle-BQ2LMfMx.js → skillLifecycle-BMY2JGGG.js} +2 -2
  209. package/dist/chunks/{skillSearchPanel-BwYuwLFs.js → skillSearchPanel-D9trHULQ.js} +2 -2
  210. package/dist/chunks/{skills-BVHPQma0.js → skills-CX_AvwLG.js} +1 -1
  211. package/dist/chunks/startupProfiler-BH0FoI66.js +1 -0
  212. package/dist/chunks/{startupProfiler-DTs9w9EN.js → startupProfiler-CJdr3SxP.js} +2 -2
  213. package/dist/chunks/state-B4jiUise.js +1 -0
  214. package/dist/chunks/state-BhOKSFi5.js +1 -0
  215. package/dist/chunks/status-Daaak6Bo.js +1 -0
  216. package/dist/chunks/statusNoticeHelpers-vFVgIYuw.js +1 -0
  217. package/dist/chunks/{stringUtils-BQm3OfeJ.js → stringUtils-C718f5ey.js} +1 -1
  218. package/dist/chunks/sts-ei3CGBNu.js +1 -0
  219. package/dist/chunks/switcher-BpgmH4AI.js +1 -0
  220. package/dist/chunks/{switcher-Bq1Ct_Sn.js → switcher-CAajZeNL.js} +1 -1
  221. package/dist/chunks/{tasks-0c8Uy04D.js → tasks-BWNQr2d3.js} +1 -1
  222. package/dist/chunks/{templateJobs-BdFzE9XG.js → templateJobs-gUET39Ho.js} +1 -1
  223. package/dist/chunks/{terminalSetup-Cf_r6pwK.js → terminalSetup-B_10N_gE.js} +3 -3
  224. package/dist/chunks/{terminalSetup-D7J6bxcn.js → terminalSetup-qc2PlvOm.js} +1 -1
  225. package/dist/chunks/{theme-Bby4fssR.js → theme-B7fKI6E5.js} +1 -1
  226. package/dist/chunks/tipRegistry-DamZr34w.js +2 -0
  227. package/dist/chunks/{toolEventObserver-CzFZUIsM.js → toolEventObserver-BL06sDI4.js} +1 -1
  228. package/dist/chunks/toolPool-CX5wDBi1.js +1 -0
  229. package/dist/chunks/{types-zk5Ltv5q.js → types-Dx7P7JLQ.js} +2 -2
  230. package/dist/chunks/udsClient-cQz6nJ_T.js +1 -0
  231. package/dist/chunks/{use-select-navigation-DMaC_3iw.js → use-select-navigation-BiUJdWai.js} +1 -1
  232. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CjW3gUOt.js → useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js} +1 -1
  233. package/dist/chunks/useMainLoopModel-DwjSVzzO.js +1 -0
  234. package/dist/chunks/useManagePlugins-BqfIVa6E.js +1 -0
  235. package/dist/chunks/{useMergedTools-DarmnCEw.js → useMergedTools-Bw8FchX8.js} +1 -1
  236. package/dist/chunks/{useSearchInput-C2JuUW3g.js → useSearchInput-B25K1RnK.js} +1 -1
  237. package/dist/chunks/useSettingsErrors-DYQ44kX4.js +1 -0
  238. package/dist/chunks/{util-Bq5l7FF5.js → util-CtlC2dsN.js} +1 -1
  239. package/dist/chunks/validatePlugin-D6tFo87L.js +1 -0
  240. package/dist/chunks/vim-CoRp9lY1.js +1 -0
  241. package/dist/chunks/worktree-B8apCnVe.js +1 -0
  242. package/dist/cli.js +1 -1
  243. package/package.json +1 -5
  244. package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +0 -1
  245. package/dist/chunks/App-BcEI6U5j.js +0 -1
  246. package/dist/chunks/ApproveApiKey-DegdTXZl.js +0 -1
  247. package/dist/chunks/ApproveApiKey-_VXIMSwY.js +0 -1
  248. package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +0 -2
  249. package/dist/chunks/CustomSelect-B46Eh0gU.js +0 -1
  250. package/dist/chunks/Doctor-BP0Rqraa.js +0 -1
  251. package/dist/chunks/Doctor-By_y3C2V.js +0 -3
  252. package/dist/chunks/Grove-C3mhgshv.js +0 -11
  253. package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +0 -1
  254. package/dist/chunks/MCPToolListView-DLSrQHDc.js +0 -1
  255. package/dist/chunks/MessageSelector-CdDlJE48.js +0 -3
  256. package/dist/chunks/Messages-DuL_r1Or.js +0 -10
  257. package/dist/chunks/Onboarding-CE2GNA-h.js +0 -1
  258. package/dist/chunks/QueryEngine-DNNy1UCD.js +0 -1
  259. package/dist/chunks/REPL-CEhW-C41.js +0 -1
  260. package/dist/chunks/REPL-CkSL4C_8.js +0 -124
  261. package/dist/chunks/ResumeConversation-BMCO_3X7.js +0 -1
  262. package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +0 -1
  263. package/dist/chunks/Settings-mDykHLok.js +0 -2
  264. package/dist/chunks/Spinner-DwsJJUtn.js +0 -1
  265. package/dist/chunks/TrustDialog-G4jM9IfM.js +0 -1
  266. package/dist/chunks/add-dir-7RfQAC3h.js +0 -1
  267. package/dist/chunks/agents-BNg_skSm.js +0 -101
  268. package/dist/chunks/allErrors-DaztSMrw.js +0 -1
  269. package/dist/chunks/auth-BTB00dq5.js +0 -10
  270. package/dist/chunks/auth-Bbc0Ny8i.js +0 -1
  271. package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +0 -1
  272. package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +0 -17
  273. package/dist/chunks/banner-mqZEluky.js +0 -2
  274. package/dist/chunks/branch-exFKkymg.js +0 -2
  275. package/dist/chunks/btw-3l78DYET.js +0 -1
  276. package/dist/chunks/caches-6Nx6tsk9.js +0 -1
  277. package/dist/chunks/caches-ouaWB9bY.js +0 -1
  278. package/dist/chunks/client-C01Bnxxv.js +0 -1
  279. package/dist/chunks/client-DYRgRQsr.js +0 -1
  280. package/dist/chunks/commands-BoxOw75F.js +0 -1
  281. package/dist/chunks/compact-BOYr105K.js +0 -2
  282. package/dist/chunks/config-BddEvZZl.js +0 -3
  283. package/dist/chunks/config-GEv9hUzz.js +0 -1
  284. package/dist/chunks/config-kw4xg7Nk.js +0 -1
  285. package/dist/chunks/context-noninteractive-DFvoZ2L9.js +0 -1
  286. package/dist/chunks/conversation-CoGharlH.js +0 -1
  287. package/dist/chunks/conversation-MxEVm54C.js +0 -1
  288. package/dist/chunks/conversationRecovery-Da_8uldZ.js +0 -1
  289. package/dist/chunks/crossProjectResume-CzPCHq_K.js +0 -40
  290. package/dist/chunks/cwd-BcO6WHKo.js +0 -1
  291. package/dist/chunks/cwd-CDUelriw.js +0 -1
  292. package/dist/chunks/dist-es-5t7v8oaj.js +0 -1
  293. package/dist/chunks/dist-es-BIjDeceU.js +0 -1
  294. package/dist/chunks/dist-es-C-OjW2Ao.js +0 -1
  295. package/dist/chunks/dist-es-CEk66gUu.js +0 -1
  296. package/dist/chunks/dist-es-CIULjvtA2.js +0 -1
  297. package/dist/chunks/dist-es-CMtO44xC.js +0 -1
  298. package/dist/chunks/dist-es-CYPVg66r.js +0 -9
  299. package/dist/chunks/dist-es-D1Y8zSMI.js +0 -1
  300. package/dist/chunks/dist-es-Gt_DpXlP.js +0 -1
  301. package/dist/chunks/dist-es-kj-F5A132.js +0 -1
  302. package/dist/chunks/doctor-DWvioSU9.js +0 -1
  303. package/dist/chunks/esm-BQY8jJNR.js +0 -1
  304. package/dist/chunks/exit-BxC_ZEtO.js +0 -1
  305. package/dist/chunks/extraUsage-DYm33Occ.js +0 -1
  306. package/dist/chunks/extractMemories-CzN3Ax2B.js +0 -1
  307. package/dist/chunks/fast-DqUpl_Lr.js +0 -1
  308. package/dist/chunks/fast-NUdUyAaM.js +0 -1
  309. package/dist/chunks/fetchModelList-CqsTAWEN.js +0 -1
  310. package/dist/chunks/fetchModelList-DBMHE6Ng.js +0 -1
  311. package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +0 -3
  312. package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +0 -1
  313. package/dist/chunks/generateSessionName-ChvKBVxB.js +0 -1
  314. package/dist/chunks/goal-ByyimpVU.js +0 -3
  315. package/dist/chunks/grok-DenjixMl.js +0 -1
  316. package/dist/chunks/grove-Dq8QbQ9o.js +0 -7
  317. package/dist/chunks/history-CNQNd6hT.js +0 -1
  318. package/dist/chunks/hooks-BaYwmkxD.js +0 -1
  319. package/dist/chunks/instrumentation-BwVyvRfY.js +0 -21
  320. package/dist/chunks/keybindings-wNxBzDVQ.js +0 -1
  321. package/dist/chunks/launchOnboarding-CDjQ64RO.js +0 -8
  322. package/dist/chunks/loadAgentsDir-DKXap_Om.js +0 -1
  323. package/dist/chunks/loadPluginHooks-DtmHtEiS.js +0 -1
  324. package/dist/chunks/localSearch-BB9x5C2N.js +0 -1
  325. package/dist/chunks/logoUtils-Dj_2SWmO.js +0 -1
  326. package/dist/chunks/main-BRg8L_aw.js +0 -346
  327. package/dist/chunks/managedEnv-DsqAYOJ4.js +0 -1
  328. package/dist/chunks/managedEnv-lybrMred.js +0 -1
  329. package/dist/chunks/mcp-Bsw3cMiJ.js +0 -6
  330. package/dist/chunks/mcp-DDdud6Y7.js +0 -1
  331. package/dist/chunks/mcp-DbgTDUt7.js +0 -2
  332. package/dist/chunks/memory-CzwTzihf.js +0 -1
  333. package/dist/chunks/model-BYfmXKHf.js +0 -1
  334. package/dist/chunks/model-BwBE0Pt5.js +0 -1
  335. package/dist/chunks/modelOptions-DvNBapgG.js +0 -1
  336. package/dist/chunks/nativeInstaller-DnSNJWIi.js +0 -1
  337. package/dist/chunks/notifications-B0DTaYoy.js +0 -1
  338. package/dist/chunks/omit-Dl1Us_PY.js +0 -1
  339. package/dist/chunks/onChangeAppState-4KOJMN82.js +0 -1
  340. package/dist/chunks/openai-C_6C1_0N.js +0 -10
  341. package/dist/chunks/parser-BKAVMTyD.js +0 -1
  342. package/dist/chunks/partition-B504IgAa.js +0 -1
  343. package/dist/chunks/permissions-CLFMhdRk.js +0 -3
  344. package/dist/chunks/pidLock-D9do1Afy.js +0 -3
  345. package/dist/chunks/plugin-BYdF7uob.js +0 -17
  346. package/dist/chunks/pluginBlocklist-DKKmOnWM.js +0 -1
  347. package/dist/chunks/pluginCliCommands-z8TtJMKH.js +0 -1
  348. package/dist/chunks/pluginOperations-BcfJCDco.js +0 -2
  349. package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +0 -1
  350. package/dist/chunks/plugins-CTM8jpOw.js +0 -4
  351. package/dist/chunks/policyLimits-a7ix6GnU.js +0 -1
  352. package/dist/chunks/poorMode-C11JEH3d.js +0 -1
  353. package/dist/chunks/print-u6MzL5Cr.js +0 -13
  354. package/dist/chunks/processBashCommand-DIwrI2QC.js +0 -1
  355. package/dist/chunks/processSlashCommand-B-Gujpxm.js +0 -5
  356. package/dist/chunks/prompt-BPJDGlx5.js +0 -1
  357. package/dist/chunks/prompt-DEdZzkEz.js +0 -1
  358. package/dist/chunks/reconciler-DSKLuOS7.js +0 -1
  359. package/dist/chunks/refresh-BbZFCNpn.js +0 -1
  360. package/dist/chunks/rename-DOtCOtEr.js +0 -1
  361. package/dist/chunks/resume-BB4T4WIV.js +0 -2
  362. package/dist/chunks/ripgrep-CZ2CqaHb.js +0 -1
  363. package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +0 -1
  364. package/dist/chunks/searchExtraTools-CdJghGkj.js +0 -1
  365. package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +0 -1
  366. package/dist/chunks/sessionObserver-DB-sLv-X.js +0 -1
  367. package/dist/chunks/sessionStorage-sgOAbDn7.js +0 -1
  368. package/dist/chunks/sessionTracing-yBre24PH.js +0 -11
  369. package/dist/chunks/settings-C-KNkvsM.js +0 -1
  370. package/dist/chunks/settings-DKN4xSpQ.js +0 -24
  371. package/dist/chunks/setup-CN_Pk7AR.js +0 -3
  372. package/dist/chunks/sinks-BS17vtN0.js +0 -1
  373. package/dist/chunks/sinks-D1EjkHb4.js +0 -1
  374. package/dist/chunks/skillChangeDetector-CBKuGuEi.js +0 -1
  375. package/dist/chunks/startupProfiler-B_U4QDtf.js +0 -1
  376. package/dist/chunks/state-BowF111d.js +0 -1
  377. package/dist/chunks/state-CGuyDES7.js +0 -1
  378. package/dist/chunks/status-BurdTfyz.js +0 -2
  379. package/dist/chunks/status-DMq1An5h.js +0 -1
  380. package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +0 -1
  381. package/dist/chunks/sts-C2Gf2WYN.js +0 -1
  382. package/dist/chunks/switcher-DGD4ORVf.js +0 -1
  383. package/dist/chunks/tipRegistry-CyRXWWTz.js +0 -2
  384. package/dist/chunks/toolPool-CnrZcprA.js +0 -1
  385. package/dist/chunks/udsClient-ftP0yIpe.js +0 -1
  386. package/dist/chunks/useMainLoopModel-DWscpA9I.js +0 -1
  387. package/dist/chunks/useManagePlugins-CYXVcql2.js +0 -1
  388. package/dist/chunks/useSettingsErrors-DutJBiKZ.js +0 -1
  389. package/dist/chunks/validatePlugin-DIdEydz_.js +0 -1
  390. package/dist/chunks/vim-D8prM2IH.js +0 -1
  391. package/dist/chunks/worktree-Caqt2WRZ.js +0 -1
  392. /package/dist/chunks/{dist-es-Cgsa8pb82.js → dist-es-Cgsa8pb8.js} +0 -0
  393. /package/dist/chunks/{dist-es-Cwru7c2B2.js → dist-es-Cwru7c2B.js} +0 -0
  394. /package/dist/chunks/{dist-es-DXIR5NLi2.js → dist-es-DXIR5NLi.js} +0 -0
@@ -1,21 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DcaKZlRU.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,E as de,I as b,K as fe,L as x,M as pe,N as me,O as he,P as S,R as ge,U as _e,W as C,_ as w,b as ve,c as ye,d as be,gt as T,h as xe,ht as Se,i as Ce,k as E,mt as we,n as Te,o as Ee,p as De,pt as Oe,q as ke,t as Ae,u as je,v as D,w as O,y as Me}from"./esm-BQY8jJNR.js";import{n as Ne,t as Pe}from"./axios-DaWTGg7G.js";import{g as Fe,v as Ie}from"./types-zk5Ltv5q.js";import{Dn as Le,Kn as Re,L as ze,Sn as Be,W as Ve,kt as k,on as He,q as Ue,zt as We}from"./state-BowF111d.js";import{C as Ge,H as Ke,L as qe,N as Je,c as A,et as Ye,i as j,r as Xe,tt as Ze,x as Qe}from"./debug-8DCufdSp.js";import{d as $e,h as et}from"./settings-DKN4xSpQ.js";import{c as tt,m as nt,n as rt,v as it}from"./config-BddEvZZl.js";import{d as at,f as ot,o as st,s as M}from"./log-DaILwWJa.js";import{a as ct,i as lt,o as ut}from"./platform-Dzff1WWw.js";import{n as dt,r as ft}from"./startupProfiler-DTs9w9EN.js";import{Cn as pt,Ct as mt,Dn as ht,En as gt,St as _t,Tt as vt,gt as yt,xt as bt,yt as xt}from"./model-BwBE0Pt5.js";import{_ as St,a as Ct,c as wt,f as Tt,g as Et,l as Dt,m as Ot,v as kt,y as At}from"./proxy-CB17QimU.js";import{C as jt,S as Mt,_ as Nt,c as Pt,g as Ft,l as It,r as Lt}from"./sessionTracing-yBre24PH.js";var N;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(N||(N={}));var P;(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`})(P||(P={}));var F;(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(F||(F={}));function Rt(e){let t=Object.keys(e);return t.length===0?``:(t=t.sort(),JSON.stringify(t.map(t=>[t,e[t]])))}function zt(e){return`${e.name}:${e.version??``}:${e.schemaUrl??``}`}var Bt=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function I(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new Bt(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function Vt(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ht(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 Ut(e,t){return e.toLowerCase()===t.toLowerCase()}var L;(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`})(L||(L={})),r();var Wt=class{constructor(){i(this,`kind`,L.DROP)}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,r){}};r();function Gt(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 Kt=class{constructor(e,t,n=!0,r=Gt(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=Ht(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},qt=class{constructor(e,t){i(this,`kind`,L.HISTOGRAM),i(this,`_boundaries`,void 0),i(this,`_recordMinMax`,void 0),this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new Kt(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 Kt(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 Kt(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:F.HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===P.GAUGE||e.type===P.UP_DOWN_COUNTER||e.type===P.OBSERVABLE_GAUGE||e.type===P.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 Jt=class e{constructor(e=new Yt,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))}},Yt=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])}},Xt=2146435072,Zt=1048575,Qt=1023,$t=-1022,en=Qt,tn=2**-1022;function nn(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((t.getUint32(0)&Xt)>>20)-Qt}function rn(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let n=t.getUint32(0),r=t.getUint32(4);return(n&Zt)*2**32+r}function an(e,t){return e===0||e===1/0||e===-1/0||Number.isNaN(e)?e:e*2**t}function on(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}var R=class extends Error{};r();var sn=class{constructor(e){i(this,`_shift`,void 0),this._shift=-e}mapToIndex(e){return e<tn?this._minNormalLowerBoundaryIndex():nn(e)+this._rightShift(rn(e)-1,52)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new R(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new R(`overflow: ${e} is > maximum lower boundary: ${n}`);return an(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=$t>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return en>>this._shift}_rightShift(e,t){return Math.floor(e*2**-t)}};r();var cn=class{constructor(e){i(this,`_scale`,void 0),i(this,`_scaleFactor`,void 0),i(this,`_inverseFactor`,void 0),this._scale=e,this._scaleFactor=an(Math.LOG2E,e),this._inverseFactor=an(Math.LN2,-e)}mapToIndex(e){if(e<=tn)return this._minNormalLowerBoundaryIndex()-1;if(rn(e)===0)return(nn(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 R(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return tn;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new R(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return $t<<this._scale}_maxNormalLowerBoundaryIndex(){return(en+1<<this._scale)-1}},ln=-10,un=20,dn=Array.from({length:31},(e,t)=>t>10?new cn(t-10):new sn(t-10));function fn(e){if(e>un||e<ln)throw new R(`expected scale >= ${ln} && <= ${un}, got: ${e}`);return dn[e+10]}p(),r();var z=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}},pn=20,mn=160,hn=2,gn=class e{constructor(e,t=mn,n=!0,r=0,a=0,o=0,s=1/0,c=-1/0,l=new Jt,u=new Jt,d=fn(pn)){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<hn&&(m.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
2
- changing to the minimum size of: ${hn}`),this._maxSize=hn)}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=on(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=fn(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=z.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),r=z.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 z(0,-1);let r=t-n;return new z(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()}},_n=class{constructor(e,t){i(this,`kind`,L.EXPONENTIAL_HISTOGRAM),i(this,`_maxSize`,void 0),i(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new gn(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:F.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===P.GAUGE||e.type===P.UP_DOWN_COUNTER||e.type===P.OBSERVABLE_GAUGE||e.type===P.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 vn=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=S(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},yn=class{constructor(){i(this,`kind`,L.LAST_VALUE)}createAccumulation(e){return new vn(e)}merge(e,t){let n=E(t.sampleTime)>=E(e.sampleTime)?t:e;return new vn(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=E(t.sampleTime)>=E(e.sampleTime)?t:e;return new vn(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:F.GAUGE,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()}))}}};r();var B=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}},bn=class{constructor(e){i(this,`kind`,L.SUM),i(this,`monotonic`,void 0),this.monotonic=e}createAccumulation(e){return new B(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue();return t.reset?new B(t.startTime,this.monotonic,r,t.reset):new B(e.startTime,this.monotonic,n+r)}diff(e,t){let n=e.toPointValue(),r=t.toPointValue();return this.monotonic&&n>r?new B(t.startTime,this.monotonic,r,!0):new B(t.startTime,this.monotonic,r-n)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:F.SUM,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()})),isMonotonic:this.monotonic}}};p(),r();var xn=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};i(xn,`DEFAULT_INSTANCE`,new Wt);var Sn=class e{createAggregator(t){switch(t.type){case P.COUNTER:case P.OBSERVABLE_COUNTER:case P.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}};i(Sn,`MONOTONIC_INSTANCE`,new bn(!0)),i(Sn,`NON_MONOTONIC_INSTANCE`,new bn(!1));var Cn=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};i(Cn,`DEFAULT_INSTANCE`,new yn);var wn=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};i(wn,`DEFAULT_INSTANCE`,new qt([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0));var Tn=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 qt(this._boundaries,this._recordMinMax)}},En=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 _n(this._maxSize,this._recordMinMax)}},Dn=class{_resolve(e){switch(e.type){case P.COUNTER:case P.UP_DOWN_COUNTER:case P.OBSERVABLE_COUNTER:case P.OBSERVABLE_UP_DOWN_COUNTER:return kn;case P.GAUGE:case P.OBSERVABLE_GAUGE:return An;case P.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Tn(e.advice.explicitBucketBoundaries):jn}return m.warn(`Unable to recognize instrument type: ${e.type}`),On}createAggregator(e){return this._resolve(e).createAggregator(e)}},On=new xn,kn=new Sn,An=new Cn,jn=new wn;new En;var Mn=new Dn,V;(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`})(V||(V={}));function Nn(e){switch(e.type){case V.DEFAULT:return Mn;case V.DROP:return On;case V.SUM:return kn;case V.LAST_VALUE:return An;case V.EXPONENTIAL_HISTOGRAM:{let t=e;return new En(t.options?.maxSize,t.options?.recordMinMax)}case V.EXPLICIT_BUCKET_HISTOGRAM:{let t=e;return t.options==null?jn:new Tn(t.options?.boundaries,t.options?.recordMinMax)}default:throw Error(`Unsupported Aggregation`)}}var Pn=e=>({type:V.DEFAULT}),Fn=e=>N.CUMULATIVE,In=`otel.component.name`,Ln=`otel.component.type`,Rn=`periodic_metric_reader`,zn=`otel.sdk.metric_reader.collection.duration`,Bn=`error.type`;r();var Vn=new Map,Hn=class{constructor(e,t){i(this,`collectionDuration`,void 0),i(this,`standardAttrs`,void 0);let n=Vn.get(e)??0;Vn.set(e,n+1),this.standardAttrs={[Ln]:e,[In]:`${e}/${n}`},this.collectionDuration=t.createHistogram(zn,{unit:`s`,description:`The duration of the collect operation of the metric reader.`,advice:{explicitBucketBoundaries:[]}})}recordCollection(e,t){let n=t?{...this.standardAttrs,[Bn]:t}:this.standardAttrs;this.collectionDuration.record(e,n)}},Un=`2.9.0`;p(),D(),r();var Wn=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??Pn,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??Fn,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector,this._otelComponentType=e?.otelComponentType??this.constructor.name,this._selfObsMetrics=new Hn(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`,Un);this._selfObsMetrics=new Hn(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(he(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 I(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 I(this.onForceFlush(),e.timeoutMillis)}};function Gn(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 Kn=class extends Wn{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:Rn,metricProducers:r,cardinalitySelector:e=>{let t={default:2e3,...a};switch(e){case P.COUNTER:return t.counter??t.default;case P.GAUGE:return t.gauge??t.default;case P.HISTOGRAM:return t.histogram??t.default;case P.OBSERVABLE_COUNTER:return t.observableCounter??t.default;case P.OBSERVABLE_UP_DOWN_COUNTER:return t.observableUpDownCounter??t.default;case P.OBSERVABLE_GAUGE:return t.observableGauge??t.default;case P.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?Gn(e,this._maxExportBatchSize):[e],r=null;for(let e of n)try{let t=await I(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 Bt){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 qn=class e{constructor(e){i(this,`_shutdown`,!1),i(this,`_temporalitySelector`,void 0),this._temporalitySelector=e?.temporalitySelector??Fn}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 Jn=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 H(e,t,n){return Qn(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 Yn(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 Xn(e,t){return Ut(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}var Zn=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function Qn(e){return Zn.test(e)}p(),r();var U=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())}},$n=class extends U{add(e,t,n){this._record(e,t,n)}},er=class extends U{add(e,t,n){if(e<0){m.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},tr=class extends U{record(e,t,n){this._record(e,t,n)}},nr=class extends U{record(e,t,n){if(e<0){m.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},W=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)}},rr=class extends W{},ir=class extends W{},ar=class extends W{};function or(e){return e instanceof W}r();var sr=class{constructor(e){i(this,`_meterSharedState`,void 0),this._meterSharedState=e}createGauge(e,t){let n=H(e,P.GAUGE,t);return new tr(this._meterSharedState.registerMetricStorage(n),n)}createHistogram(e,t){let n=H(e,P.HISTOGRAM,t);return new nr(this._meterSharedState.registerMetricStorage(n),n)}createCounter(e,t){let n=H(e,P.COUNTER,t);return new er(this._meterSharedState.registerMetricStorage(n),n)}createUpDownCounter(e,t){let n=H(e,P.UP_DOWN_COUNTER,t);return new $n(this._meterSharedState.registerMetricStorage(n),n)}createObservableGauge(e,t){let n=H(e,P.OBSERVABLE_GAUGE,t);return new ir(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=H(e,P.OBSERVABLE_COUNTER,t);return new rr(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=H(e,P.OBSERVABLE_UP_DOWN_COUNTER,t);return new ar(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 cr=class{constructor(e){i(this,`_instrumentDescriptor`,void 0),this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=H(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};r();var lr=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}},G=class extends lr{constructor(){super(Rt)}};D(),r();var ur=class{constructor(e,t){i(this,`_activeCollectionStorage`,new G),i(this,`_cumulativeMemoStorage`,new G),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=Rt(this._overflowAttributes)}record(e,t,n){let r=this._activeCollectionStorage.get(t);if(!r){let i=S(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 G,e}};r();var dr=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===N.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=fr(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 G,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 fr(e){return Array.from(e.entries())}r();var pr=class extends cr{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 ur(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new dr(t,r),this._attributesProcessor=n}record(e,t){if(this._attributesProcessor===void 0){this._deltaMetricStorage.batchCumulate(e,t);return}let n=new G;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 mr(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 hr(e,t){return`\t- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function gr(e,t){return`\t- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function _r(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 vr(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 yr(e,t){return e.valueType===t.valueType?e.unit===t.unit?e.type===t.type?e.description===t.description?``:vr(e,t):_r(e,t):gr(e,t):hr(e,t)}p(),r();var br=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();Xn(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
- `,mr(t,e),`The longer description will be used.
7
- To resolve the conflict:`,yr(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
- `,mr(t,e),`To resolve the conflict:
10
- `,yr(t,e))}return n}};p(),r();var xr=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 G),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(!or(e))return;let r=this._buffer.get(e);if(r??(r=new G,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 wr=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(or));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(or)),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=I(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=I(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&&Vt(n.instruments,t))}};p(),r();var Tr=class extends cr{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 ur(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new dr(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 Er=class{constructor(e,t){i(this,`metricStorageRegistry`,new br),i(this,`observableRegistry`,new wr),i(this,`meter`,void 0),i(this,`_meterProviderSharedState`,void 0),i(this,`_instrumentationScope`,void 0),this.meter=new sr(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,Tr);return t.length===1?t[0]:new xr(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,pr)}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=Yn(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 Dr=class{constructor(e){i(this,`viewRegistry`,new Jn),i(this,`metricCollectors`,[]),i(this,`meterSharedStates`,new Map),i(this,`resource`,void 0),this.resource=e}getMeterSharedState(e){let t=zt(e),n=this.meterSharedStates.get(t);return n??(n=new Er(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,Nn(n.selectAggregation(e))]);return t}};D(),r();var Or=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=S(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 kr=/[\^$\\.+?()[\]{}|]/g,Ar=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(kr,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(e){return e.includes(`*`)}},K=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 jr=class{process(e,t){return e}},Mr=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 Nr(){return Fr}function Pr(e){return new Mr(e)}var Fr=new jr;r();var Ir=class{constructor(e){i(this,`_nameFilter`,void 0),i(this,`_type`,void 0),i(this,`_unitFilter`,void 0),this._nameFilter=new Ar(e?.name??`*`),this._type=e?.type,this._unitFilter=new K(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};r();var Lr=class{constructor(e){i(this,`_nameFilter`,void 0),i(this,`_versionFilter`,void 0),i(this,`_schemaUrlFilter`,void 0),this._nameFilter=new K(e?.name),this._versionFilter=new K(e?.version),this._schemaUrlFilter=new K(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};r();function Rr(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function zr(e){if(Rr(e))throw Error(`Cannot create view with no selector arguments supplied`);if(e.name!=null&&(e?.instrumentName==null||Ar.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 Br=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),zr(e),e.attributesProcessors==null?this.attributesProcessor=Nr():this.attributesProcessor=Pr(e.attributesProcessors),this.name=e.name,this.description=e.description,this.aggregation=Nn(e.aggregation??{type:V.DEFAULT}),this.instrumentSelector=new Ir({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Lr({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}};p(),ye(),r();var Vr=class{constructor(e){if(i(this,`_sharedState`,void 0),i(this,`_shutdown`,!1),this._sharedState=new Dr(e?.resource??xe()),e?.views!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new Br(t));if(e?.readers!=null&&e.readers.length>0)for(let t of e.readers){let n=new Or(this._sharedState,t);t.setMetricProducer(n),this._sharedState.metricCollectors.push(n),e.sdkMetricsEnabled&&t instanceof Wn&&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)))}},Hr=`exception`,Ur=Symbol.for(`nodejs.util.inspect.custom`);function Wr(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??(t[n]=r));return t}function Gr(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 Kr=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=b.now(),this._performanceOffset=t-(this._performanceStartTime+b.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(!_e(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++),pe(t)&&(pe(n)||(n=t),t=void 0);let i=C(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=C(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=he(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<=b.now())return ue(e+this._performanceOffset);if(typeof e==`number`)return S(e);if(e instanceof Date)return S(e.getTime());if(me(e))return e;if(this._startTimeProvided)return S(Date.now());let t=b.now()-this._performanceStartTime;return de(this.startTime,S(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(Hr,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}[Ur](e,t,n){return Gr(`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:Wr(this.resource)}},e,t,n)}},q;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(q||(q={}));var qr=`otel.component.name`,Jr=`otel.component.type`,Yr=`otel.span.parent.origin`,Xr=`otel.span.sampling_result`,Zr=`otel.sdk.processor.span.processed`,Qr=`otel.sdk.processor.span.queue.capacity`,$r=`otel.sdk.processor.span.queue.size`,ei=`otel.sdk.span.live`,ti=`otel.sdk.span.started`,ni=`batching_span_processor`;r();var ri=class{constructor(e){i(this,`startedSpans`,void 0),i(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(ti,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ei,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=ai(t);if(this.startedSpans.add(1,{[Yr]:ii(e),[Xr]:n}),t===q.NOT_RECORD)return()=>{};let r={[Xr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function ii(e){return e?e.isRemote?`remote`:`local`:`none`}function ai(e){switch(e){case q.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case q.RECORD:return`RECORD_ONLY`;case q.NOT_RECORD:return`DROP`}}var oi=`2.9.0`;p(),D(),r();var si=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`,oi);this._tracerMetrics=new ri(n)}startSpan(e,t={},n=f.active()){t.root&&(n=d.deleteSpan(n));let r=d.getSpan(n);if(fe(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:C(e.attributes)})),ne=C(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=C(Object.assign(ne,g.attributes));return new Kr({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)}[Ur](e,t,n){return Gr(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Wr(this._resource)},spanLimits:this._spanLimits},e,t,n)}};D(),r();var ci=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)})}},J=class{shouldSample(){return{decision:q.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Y=class{shouldSample(){return{decision:q.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}};p(),D(),r();var X=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 Y),this._remoteParentSampled=e.remoteParentSampled??new Y,this._remoteParentNotSampled=e.remoteParentNotSampled??new J,this._localParentSampled=e.localParentSampled??new Y,this._localParentNotSampled=e.localParentNotSampled??new J}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 li=new Map,ui=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=li.get(e)??0;if(li.set(e,r+1),this.standardAttrs={[Jr]:e,[qr]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[se]:`queue_full`},this.processedSpans=t.createCounter(Zr,{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(Qr,{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($r,{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 di=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 ve(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 ui(ni,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(ke(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)}},fi=class extends di{onShutdown(){}};r();var pi=8,mi=16,hi=class{constructor(){i(this,`generateTraceId`,_i(mi)),i(this,`generateSpanId`,_i(pi))}},gi=Buffer.allocUnsafe(mi);function _i(e){return function(){for(let t=0;t<e/4;t++)gi.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<e&&!(gi[t]>0);t++)t===e-1&&(gi[e-1]=1);return gi.toString(`hex`,0,e)}}p(),ye(),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 vi=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??xe();let t=e.spanProcessors??[];this._activeSpanProcessor=new ci(t),this._tracerOptions={resource:this._resource,sampler:e.sampler??new X({root:new Y}),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 hi,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 si({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()}[Ur](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return Gr(`TracerProvider`,{resource:{attributes:Wr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}};D();var yi=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 bi=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?q.RECORD_AND_SAMPLED:q.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 xi(){return{sampler:Si(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:x(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:x(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:x(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:x(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:x(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:x(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:x(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:x(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}function Si(){let e=ge(`OTEL_TRACES_SAMPLER`)??Q.ParentBasedAlwaysOn;switch(e){case Q.AlwaysOn:return new Y;case Q.AlwaysOff:return new J;case Q.ParentBasedAlwaysOn:return new X({root:new Y});case Q.ParentBasedAlwaysOff:return new X({root:new J});case Q.TraceIdRatio:return new bi(Ci());case Q.ParentBasedTraceIdRatio:return new X({root:new bi(Ci())});default:return m.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${Q.ParentBasedAlwaysOn}".`),new X({root:new Y})}}function Ci(){let e=x(`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 wi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??x(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??x(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??x(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??x(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,Object.assign({},e,{spanLimits:t})}D();var Ti=class extends vi{constructor(e={}){let t=le({},xi(),wi(e));delete t.generalLimits,super(t)}};D();var Ei=class extends fi{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=x(n);r!==void 0&&(t[e]=r)}super({exporter:e,...t})}};n(),Se(),We(),Ye(),Qe(),ut(),dt(),et(),At(),St(),Ot(),wt(),Mt(),Ae(),Pe(),_t(),nt(),j(),qe(),gt(),st(),Fe(),at(),we();var Di=3600*1e3,Oi=1440*60*1e3;async function ki(){let e=pt();if(e.error)throw Error(`Auth error: ${e.error}`);let t={"Content-Type":`application/json`,"User-Agent":Oe(),...e.headers};return(await Ne.get(`https://api.anthropic.com/api/claude_code/organizations/metrics_enabled`,{headers:t,timeout:5e3})).data}async function Ai(){if(ot())return{enabled:!1,hasError:!1};try{let e=await ht(ki,{also403Revoked:!0});return A(`Metrics opt-out API response: enabled=${e.metrics_logging_enabled}`),{enabled:e.metrics_logging_enabled,hasError:!1}}catch(e){return A(`Failed to check metrics opt-out status: ${Je(e)}`),M(e),{enabled:!1,hasError:!0}}}var ji=Ie(Ai,Di);async function Mi(){let e=await ji();if(e.hasError)return e;let t=tt().metricsStatusCache;return t!==void 0&&t.enabled===e.enabled&&Date.now()-t.timestamp<Oi||it(t=>({...t,metricsStatusCache:{enabled:e.enabled,timestamp:Date.now()}})),e}async function Ni(){if(vt()&&!bt())return{enabled:!1,hasError:!1};let e=tt().metricsStatusCache;return e?(Date.now()-e.timestamp>Oi&&Mi().catch(M),{enabled:e.enabled,hasError:!1}):Mi()}D(),Pe(),_t(),nt(),j(),qe(),gt(),st(),we(),r();var Pi=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(!(rt()||ze())){A(`BigQuery metrics export: trust not established, skipping`),t({code:O.SUCCESS});return}if(!(await Ni()).enabled){A(`Metrics export disabled by organization setting`),t({code:O.SUCCESS});return}let n=this.transformMetricsForInternal(e),r=pt();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":Oe(),...r.headers},a=await Ne.post(this.endpoint,n,{timeout:this.timeout,headers:i});A(`BigQuery metrics exported successfully`),A(`BigQuery API Response: ${Ge(a.data,null,2)}`),t({code:O.SUCCESS})}catch(e){A(`BigQuery metrics export failed: ${Je(e)}`),M(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()===N.DELTA?`delta`:`cumulative`};if(t[`wsl.version`]&&(n[`wsl.version`]=t[`wsl.version`]),vt()){n[`user.customer_type`]=`claude_ai`;let e=xt();e&&(n[`user.subscription_type`]=e)}else n[`user.customer_type`]=`api`;return{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 N.DELTA}};j(),st();var Fi=class{error(e,...t){M(Error(e)),A(`[3P telemetry] OTEL diag error: ${e}`,{level:`error`})}warn(e,...t){M(Error(e)),A(`[3P telemetry] OTEL diag warn: ${e}`,{level:`warn`})}info(e,...t){}debug(e,...t){}verbose(e,...t){}};p(),ye(),v(),We(),_t(),j(),qe(),Qe(),Ft(),Pt();var Ii=6e4,Li=5e3,Ri=5e3,zi=class extends Error{};function Bi(e,t){return new Promise((n,r)=>{setTimeout((e,t)=>e(new zi(t)),e,r,t).unref()})}function Vi(){process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE||(process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=`delta`)}function Hi(e){return(e||``).trim().split(`,`).filter(Boolean).map(e=>e.trim()).filter(e=>e!==`none`)}async function Ui(){let t=Hi(process.env.OTEL_METRICS_EXPORTER),n=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||Ii.toString(),10),r=[];for(let n of t)if(n===`console`){let e=new qn,t=e.export.bind(e);e.export=(e,n)=>(e.resource?.attributes&&(A(`
11
- === Resource Attributes ===`),A(Ge(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=$i();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 Kn({exporter:e,exportIntervalMillis:n}):e)}async function Wi(){let e=Hi(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=${Ge(e)}, protocol=${t}, endpoint=${n}`);let r=[];for(let n of e)if(n===`console`)r.push(new Ce);else if(n===`otlp`){let e=$i();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 Gi(){let e=Hi(process.env.OTEL_TRACES_EXPORTER),t=[];for(let n of e)if(n===`console`)t.push(new yi);else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=$i();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 Ki(){return t(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function qi(){return new Kn({exporter:new Pi,exportIntervalMillis:300*1e3})}function Ji(){let e=xt(),t=vt()&&(e===`enterprise`||e===`team`);return mt()||t}async function Yi(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 Ti({resource:e,spanProcessors:[new Ei(new n(i),{scheduledDelayMillis:Ri})]});d.setGlobalTracerProvider(o),Re(o);let s=new Ee({resource:e,processors:[new Te(new r(a),{scheduledDelayMillis:Li})]});T.setGlobalLoggerProvider(s),Be(s),He(T.getLogger(`com.anthropic.claude_code.events`,`0.0.22`)),process.on(`beforeExit`,async()=>{await s?.forceFlush(),await o?.forceFlush()}),process.on(`exit`,()=>{s?.forceFlush(),o?.forceFlush()})}async function Xi(){if(ft(`telemetry_init_start`),Vi(),Xe())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 Fi,o.ERROR),Nt();let e=[],t=Ki();A(`[3P telemetry] isTelemetryEnabled=${t} (CLAUDE_CODE_ENABLE_TELEMETRY=${process.env.CLAUDE_CODE_ENABLE_TELEMETRY})`),t&&e.push(...await Ui()),Ji()&&e.push(qi());let n=lt(),r={[re]:`workmate`,[ae]:`0.0.22`};if(n===`wsl`){let e=ct();e&&(r[`wsl.version`]=e)}let i=w(r),a=w(je.detect().attributes||{}),s=be.detect(),c=w(s.attributes?.[`host.arch`]?{[g]:s.attributes[g]}:{}),l=w(De.detect().attributes||{}),u=i.merge(a).merge(c).merge(l);if(jt()){Yi(u).catch(e=>A(`Beta tracing init failed: ${e}`,{level:`error`}));let t=new Vr({resource:u,views:[],readers:e});return Le(t),Ze(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{Lt();let n=Ve(),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),Bi(e,`OpenTelemetry shutdown timeout`)])}catch{}}),t.getMeter(`com.anthropic.claude_code`,`0.0.22`)}let f=new Vr({resource:u,views:[],readers:e});if(Le(f),t){let e=await Wi();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||Li.toString(),10)}))});T.setGlobalLoggerProvider(t),Be(t),He(T.getLogger(`com.anthropic.claude_code.events`,`0.0.22`)),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&&It()){let e=await Gi();if(e.length>0){let t=new Ti({resource:u,spanProcessors:e.map(e=>new Ei(e,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||Ri.toString(),10)}))});d.setGlobalTracerProvider(t),Re(t)}}return Ze(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{Lt();let t=[f.shutdown()],n=Ve();n&&t.push(n.shutdown());let r=k();r&&t.push(r.shutdown()),await Promise.race([Promise.all(t),Bi(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.22`)}async function Zi(){let e=Ue();if(!e)return;let t=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||`5000`,10);try{let n=[e.forceFlush()],r=Ve();r&&n.push(r.forceFlush());let i=k();i&&n.push(i.forceFlush()),await Promise.race([Promise.all(n),Bi(t,`OpenTelemetry flush timeout`)]),A(`Telemetry flushed successfully`)}catch(e){e instanceof zi?A(`Telemetry flush timed out after ${t}ms. Some metrics may not be exported.`,{level:`warn`}):A(`Telemetry flush failed: ${Je(e)}`,{level:`error`})}}function Qi(){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 $i(){let e=Ct(),t=Tt(),n=$e(),r={},i=Qi();n?.otelHeadersHelper?r.headers=async()=>{let e=yt();return{...i,...e}}:Object.keys(i).length>0&&(r.headers=async()=>i);let a=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!e||a&&Dt(a)){let e=Et();return(t||e)&&(r.httpAgentOptions={...t,...e&&{ca:e}}),r}let o=Et();return r.httpAgentOptions=n=>t||o?new kt(e,{...t&&{cert:t.cert,key:t.key,passphrase:t.passphrase},...o&&{ca:o}}):new kt(e),r}export{Zi as flushTelemetry,Xi as initializeTelemetry};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bw as t,Jw as n,Kw as r,Lw as i,Rw as a,Ww as o,Yw as s,qw as c}from"./loadAgentsDir-C1LkW7gl.js";import{C as l,L as u,P as d,x as f}from"./debug-8DCufdSp.js";import{r as p,t as m}from"./promptEditor-CmQ9p4oe.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(o.map(e=>c(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(c(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(n)},null,2)}\n`}var b=e((()=>{f(),s(),r()}));async function x(){if(!t())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=i(),n=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(d(e)===`EEXIST`)n=!0;else throw e}let r=await m(e);return r.error?{type:`text`,value:`${n?`Opened`:`Created`} ${e}. Could not open in editor: ${r.error}`}:{type:`text`,value:n?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{a(),b(),u(),p()}))();export{x as call};
@@ -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,c,m as l,v as u}from"./config-BddEvZZl.js";import{n as d,r as f}from"./analytics-DJobLaWP.js";import{n as p,t as m}from"./ThemePicker-DT9zVy-0.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 s(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=c();return(0,y.jsx)(v,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return u(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-C1LkW7gl.js";e();export{t as clearAgentDefinitionsCache};
@@ -1 +0,0 @@
1
- import{Qm as e,Xm as t,Ym as n}from"./loadAgentsDir-C1LkW7gl.js";n();export{t as loadPluginHooks,e as setupPluginHookHotReload};
@@ -1 +0,0 @@
1
- import{a as e,o as t,s as n,t as r}from"./localSearch-DFo_WTMm.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{jr as t,vr as n}from"./loadAgentsDir-C1LkW7gl.js";import{Gr as r,t as i}from"./src-DL3w8VPk.js";import{ut as a,zt as o}from"./state-BowF111d.js";import{n as s,t as c}from"./cwd-BcO6WHKo.js";import{An as l,Dn as u,h as d,t as f}from"./settings-DKN4xSpQ.js";import{C as p,S as m,_ as h,y as g}from"./startupProfiler-DTs9w9EN.js";import{St as _,Tt as v,vt as y}from"./model-BwBE0Pt5.js";function b(e){return e>=70?`horizontal`:`compact`}function x(e,t,n){if(t===`horizontal`){let t=n,r=e-(7+t),i=Math.max(30,r),a=Math.min(t+i+M+N,e-j);return a<t+i+M+N&&(i=a-t-M-N),{leftWidth:t,rightWidth:i,totalWidth:a}}let r=Math.min(e-j,70);return{leftWidth:r,rightWidth:r,totalWidth:r}}function S(e,t,n){let i=Math.max(r(e),r(t),r(n),20);return Math.min(i+4,k)}function C(e){return!e||e.length>A?`Welcome back!`:`Welcome back ${e}!`}function w(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 T(){if(F)return F;let e=a();return F=t(10).then(t=>(P=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),P)).catch(()=>(P=[],P)),F}function E(){return P}function D(){return{version:process.env.DEMO_VERSION??`0.0.22`,cwd:process.env.DEMO_VERSION?`/code/claude`:u(c()),billingType:v()?y():`API Usage Billing`,agentName:f().agent}}function O(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 k,A,j,M,N,P,F,I=e((()=>{o(),i(),_(),s(),l(),h(),n(),d(),k=50,A=20,j=4,M=1,N=2,P=[],F=null}));export{b as a,E as c,C as i,I as l,S as n,D as o,O as r,T as s,x as t,w as u};