@nimblesite/lsp-profiler-ui 0.0.0-stage → 0.3.0

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 (352) hide show
  1. package/LICENSE +21 -0
  2. package/out/src/bind-host.d.ts +3 -0
  3. package/out/src/bind-host.js +52 -0
  4. package/out/src/bind-host.js.map +1 -0
  5. package/out/src/context-keys.d.ts +4 -0
  6. package/out/src/context-keys.js +54 -0
  7. package/out/src/context-keys.js.map +1 -0
  8. package/out/src/dap-evaluate.d.ts +84 -0
  9. package/out/src/dap-evaluate.js +442 -0
  10. package/out/src/dap-evaluate.js.map +1 -0
  11. package/out/src/dap-output.d.ts +50 -0
  12. package/out/src/dap-output.js +177 -0
  13. package/out/src/dap-output.js.map +1 -0
  14. package/out/src/debug/adapter-resolution.d.ts +56 -0
  15. package/out/src/debug/adapter-resolution.js +112 -0
  16. package/out/src/debug/adapter-resolution.js.map +1 -0
  17. package/out/src/debug/dap-messages.d.ts +18 -0
  18. package/out/src/debug/dap-messages.js +71 -0
  19. package/out/src/debug/dap-messages.js.map +1 -0
  20. package/out/src/debug/index.d.ts +7 -0
  21. package/out/src/debug/index.js +27 -0
  22. package/out/src/debug/index.js.map +1 -0
  23. package/out/src/debug/launch-config.d.ts +42 -0
  24. package/out/src/debug/launch-config.js +73 -0
  25. package/out/src/debug/launch-config.js.map +1 -0
  26. package/out/src/debug/launch-lifecycle.d.ts +29 -0
  27. package/out/src/debug/launch-lifecycle.js +40 -0
  28. package/out/src/debug/launch-lifecycle.js.map +1 -0
  29. package/out/src/debug/poll.d.ts +25 -0
  30. package/out/src/debug/poll.js +70 -0
  31. package/out/src/debug/poll.js.map +1 -0
  32. package/out/src/debug/profiling.d.ts +34 -0
  33. package/out/src/debug/profiling.js +81 -0
  34. package/out/src/debug/profiling.js.map +1 -0
  35. package/out/src/debug/testing/assertions.d.ts +27 -0
  36. package/out/src/debug/testing/assertions.js +111 -0
  37. package/out/src/debug/testing/assertions.js.map +1 -0
  38. package/out/src/debug/testing/dap-client.d.ts +86 -0
  39. package/out/src/debug/testing/dap-client.js +204 -0
  40. package/out/src/debug/testing/dap-client.js.map +1 -0
  41. package/out/src/debug/testing/index.d.ts +7 -0
  42. package/out/src/debug/testing/index.js +31 -0
  43. package/out/src/debug/testing/index.js.map +1 -0
  44. package/out/src/debug/testing/vscode-harness.d.ts +44 -0
  45. package/out/src/debug/testing/vscode-harness.js +81 -0
  46. package/out/src/debug/testing/vscode-harness.js.map +1 -0
  47. package/out/src/debug/ui-stubs.d.ts +26 -0
  48. package/out/src/debug/ui-stubs.js +88 -0
  49. package/out/src/debug/ui-stubs.js.map +1 -0
  50. package/out/src/debug-link-setup.d.ts +4 -0
  51. package/out/src/debug-link-setup.js +19 -0
  52. package/out/src/debug-link-setup.js.map +1 -0
  53. package/out/src/debug-link-view.d.ts +4 -0
  54. package/out/src/debug-link-view.js +49 -0
  55. package/out/src/debug-link-view.js.map +1 -0
  56. package/out/src/debug-link.d.ts +6 -0
  57. package/out/src/debug-link.js +95 -0
  58. package/out/src/debug-link.js.map +1 -0
  59. package/out/src/debug-selection.d.ts +14 -0
  60. package/out/src/debug-selection.js +33 -0
  61. package/out/src/debug-selection.js.map +1 -0
  62. package/out/src/debuggee-pause.d.ts +11 -0
  63. package/out/src/debuggee-pause.js +109 -0
  64. package/out/src/debuggee-pause.js.map +1 -0
  65. package/out/src/editor-path-key.d.ts +52 -0
  66. package/out/src/editor-path-key.js +105 -0
  67. package/out/src/editor-path-key.js.map +1 -0
  68. package/out/src/failure.d.ts +5 -0
  69. package/out/src/failure.js +53 -0
  70. package/out/src/failure.js.map +1 -0
  71. package/out/src/file-log-sink.d.ts +20 -0
  72. package/out/src/file-log-sink.js +74 -0
  73. package/out/src/file-log-sink.js.map +1 -0
  74. package/out/src/flame-html.d.ts +8 -0
  75. package/out/src/flame-html.js +104 -0
  76. package/out/src/flame-html.js.map +1 -0
  77. package/out/src/flame-model.d.ts +93 -0
  78. package/out/src/flame-model.js +242 -0
  79. package/out/src/flame-model.js.map +1 -0
  80. package/out/src/flame-script-helpers.d.ts +26 -0
  81. package/out/src/flame-script-helpers.js +71 -0
  82. package/out/src/flame-script-helpers.js.map +1 -0
  83. package/out/src/flame-script.d.ts +1 -0
  84. package/out/src/flame-script.js +332 -0
  85. package/out/src/flame-script.js.map +1 -0
  86. package/out/src/flame-time-order.d.ts +14 -0
  87. package/out/src/flame-time-order.js +112 -0
  88. package/out/src/flame-time-order.js.map +1 -0
  89. package/out/src/flamegraph-artifact.d.ts +9 -0
  90. package/out/src/flamegraph-artifact.js +45 -0
  91. package/out/src/flamegraph-artifact.js.map +1 -0
  92. package/out/src/host.d.ts +31 -0
  93. package/out/src/host.js +6 -0
  94. package/out/src/host.js.map +1 -0
  95. package/out/src/ids.d.ts +27 -0
  96. package/out/src/ids.js +63 -0
  97. package/out/src/ids.js.map +1 -0
  98. package/out/src/index.d.ts +42 -0
  99. package/out/src/index.js +98 -0
  100. package/out/src/index.js.map +1 -0
  101. package/out/src/logger.d.ts +50 -0
  102. package/out/src/logger.js +86 -0
  103. package/out/src/logger.js.map +1 -0
  104. package/out/src/memory-autopilot.d.ts +64 -0
  105. package/out/src/memory-autopilot.js +306 -0
  106. package/out/src/memory-autopilot.js.map +1 -0
  107. package/out/src/memory-capture-ids.d.ts +17 -0
  108. package/out/src/memory-capture-ids.js +45 -0
  109. package/out/src/memory-capture-ids.js.map +1 -0
  110. package/out/src/memory-capture-ingest.d.ts +15 -0
  111. package/out/src/memory-capture-ingest.js +84 -0
  112. package/out/src/memory-capture-ingest.js.map +1 -0
  113. package/out/src/memory-capture-legs.d.ts +4 -0
  114. package/out/src/memory-capture-legs.js +55 -0
  115. package/out/src/memory-capture-legs.js.map +1 -0
  116. package/out/src/memory-capture-present.d.ts +32 -0
  117. package/out/src/memory-capture-present.js +71 -0
  118. package/out/src/memory-capture-present.js.map +1 -0
  119. package/out/src/memory-capture-roundtrip.d.ts +17 -0
  120. package/out/src/memory-capture-roundtrip.js +75 -0
  121. package/out/src/memory-capture-roundtrip.js.map +1 -0
  122. package/out/src/memory-capture-state.d.ts +23 -0
  123. package/out/src/memory-capture-state.js +89 -0
  124. package/out/src/memory-capture-state.js.map +1 -0
  125. package/out/src/memory-capture-types.d.ts +28 -0
  126. package/out/src/memory-capture-types.js +70 -0
  127. package/out/src/memory-capture-types.js.map +1 -0
  128. package/out/src/memory-capture.d.ts +24 -0
  129. package/out/src/memory-capture.js +51 -0
  130. package/out/src/memory-capture.js.map +1 -0
  131. package/out/src/memory-dashboard-html.d.ts +3 -0
  132. package/out/src/memory-dashboard-html.js +327 -0
  133. package/out/src/memory-dashboard-html.js.map +1 -0
  134. package/out/src/memory-dashboard-mapping.d.ts +34 -0
  135. package/out/src/memory-dashboard-mapping.js +135 -0
  136. package/out/src/memory-dashboard-mapping.js.map +1 -0
  137. package/out/src/memory-dashboard.d.ts +82 -0
  138. package/out/src/memory-dashboard.js +142 -0
  139. package/out/src/memory-dashboard.js.map +1 -0
  140. package/out/src/memory-decorations.d.ts +61 -0
  141. package/out/src/memory-decorations.js +247 -0
  142. package/out/src/memory-decorations.js.map +1 -0
  143. package/out/src/memory-finalize.d.ts +25 -0
  144. package/out/src/memory-finalize.js +207 -0
  145. package/out/src/memory-finalize.js.map +1 -0
  146. package/out/src/memory-guidance.d.ts +14 -0
  147. package/out/src/memory-guidance.js +36 -0
  148. package/out/src/memory-guidance.js.map +1 -0
  149. package/out/src/memory-inspect-commands.d.ts +20 -0
  150. package/out/src/memory-inspect-commands.js +114 -0
  151. package/out/src/memory-inspect-commands.js.map +1 -0
  152. package/out/src/memory-launch-direct.d.ts +12 -0
  153. package/out/src/memory-launch-direct.js +74 -0
  154. package/out/src/memory-launch-direct.js.map +1 -0
  155. package/out/src/memory-launch.d.ts +4 -0
  156. package/out/src/memory-launch.js +92 -0
  157. package/out/src/memory-launch.js.map +1 -0
  158. package/out/src/memory-leak-offer.d.ts +18 -0
  159. package/out/src/memory-leak-offer.js +51 -0
  160. package/out/src/memory-leak-offer.js.map +1 -0
  161. package/out/src/memory-profiler.d.ts +27 -0
  162. package/out/src/memory-profiler.js +71 -0
  163. package/out/src/memory-profiler.js.map +1 -0
  164. package/out/src/memory-ref-graph.d.ts +62 -0
  165. package/out/src/memory-ref-graph.js +248 -0
  166. package/out/src/memory-ref-graph.js.map +1 -0
  167. package/out/src/memory-ref-picker.d.ts +21 -0
  168. package/out/src/memory-ref-picker.js +103 -0
  169. package/out/src/memory-ref-picker.js.map +1 -0
  170. package/out/src/memory-registration.d.ts +4 -0
  171. package/out/src/memory-registration.js +63 -0
  172. package/out/src/memory-registration.js.map +1 -0
  173. package/out/src/memory-start-core.d.ts +8 -0
  174. package/out/src/memory-start-core.js +165 -0
  175. package/out/src/memory-start-core.js.map +1 -0
  176. package/out/src/memory-start-stop-commands.d.ts +10 -0
  177. package/out/src/memory-start-stop-commands.js +75 -0
  178. package/out/src/memory-start-stop-commands.js.map +1 -0
  179. package/out/src/memory-start.d.ts +6 -0
  180. package/out/src/memory-start.js +13 -0
  181. package/out/src/memory-start.js.map +1 -0
  182. package/out/src/memory-status.d.ts +24 -0
  183. package/out/src/memory-status.js +135 -0
  184. package/out/src/memory-status.js.map +1 -0
  185. package/out/src/palette-vscode.d.ts +2 -0
  186. package/out/src/palette-vscode.js +50 -0
  187. package/out/src/palette-vscode.js.map +1 -0
  188. package/out/src/palette.d.ts +70 -0
  189. package/out/src/palette.js +150 -0
  190. package/out/src/palette.js.map +1 -0
  191. package/out/src/process-bind-panel.d.ts +11 -0
  192. package/out/src/process-bind-panel.js +65 -0
  193. package/out/src/process-bind-panel.js.map +1 -0
  194. package/out/src/process-commands.d.ts +5 -0
  195. package/out/src/process-commands.js +112 -0
  196. package/out/src/process-commands.js.map +1 -0
  197. package/out/src/process-context-keys.d.ts +11 -0
  198. package/out/src/process-context-keys.js +48 -0
  199. package/out/src/process-context-keys.js.map +1 -0
  200. package/out/src/process-decoration.d.ts +18 -0
  201. package/out/src/process-decoration.js +76 -0
  202. package/out/src/process-decoration.js.map +1 -0
  203. package/out/src/process-explorer-rows.d.ts +59 -0
  204. package/out/src/process-explorer-rows.js +47 -0
  205. package/out/src/process-explorer-rows.js.map +1 -0
  206. package/out/src/process-explorer.d.ts +66 -0
  207. package/out/src/process-explorer.js +241 -0
  208. package/out/src/process-explorer.js.map +1 -0
  209. package/out/src/process-group-item.d.ts +8 -0
  210. package/out/src/process-group-item.js +55 -0
  211. package/out/src/process-group-item.js.map +1 -0
  212. package/out/src/process-launch-item.d.ts +12 -0
  213. package/out/src/process-launch-item.js +57 -0
  214. package/out/src/process-launch-item.js.map +1 -0
  215. package/out/src/process-launch.d.ts +47 -0
  216. package/out/src/process-launch.js +205 -0
  217. package/out/src/process-launch.js.map +1 -0
  218. package/out/src/process-message-item.d.ts +10 -0
  219. package/out/src/process-message-item.js +53 -0
  220. package/out/src/process-message-item.js.map +1 -0
  221. package/out/src/process-poll.d.ts +26 -0
  222. package/out/src/process-poll.js +125 -0
  223. package/out/src/process-poll.js.map +1 -0
  224. package/out/src/process-reactivity.d.ts +55 -0
  225. package/out/src/process-reactivity.js +188 -0
  226. package/out/src/process-reactivity.js.map +1 -0
  227. package/out/src/process-registration.d.ts +11 -0
  228. package/out/src/process-registration.js +55 -0
  229. package/out/src/process-registration.js.map +1 -0
  230. package/out/src/process-tree-item.d.ts +18 -0
  231. package/out/src/process-tree-item.js +219 -0
  232. package/out/src/process-tree-item.js.map +1 -0
  233. package/out/src/processes-state.d.ts +75 -0
  234. package/out/src/processes-state.js +76 -0
  235. package/out/src/processes-state.js.map +1 -0
  236. package/out/src/profile-on-launch.d.ts +4 -0
  237. package/out/src/profile-on-launch.js +16 -0
  238. package/out/src/profile-on-launch.js.map +1 -0
  239. package/out/src/profile-server.d.ts +24 -0
  240. package/out/src/profile-server.js +170 -0
  241. package/out/src/profile-server.js.map +1 -0
  242. package/out/src/profiler-attach.d.ts +19 -0
  243. package/out/src/profiler-attach.js +129 -0
  244. package/out/src/profiler-attach.js.map +1 -0
  245. package/out/src/profiler-commands.d.ts +8 -0
  246. package/out/src/profiler-commands.js +110 -0
  247. package/out/src/profiler-commands.js.map +1 -0
  248. package/out/src/profiler-decorations.d.ts +74 -0
  249. package/out/src/profiler-decorations.js +237 -0
  250. package/out/src/profiler-decorations.js.map +1 -0
  251. package/out/src/profiler-dispose.d.ts +6 -0
  252. package/out/src/profiler-dispose.js +20 -0
  253. package/out/src/profiler-dispose.js.map +1 -0
  254. package/out/src/profiler-flamegraph-html.d.ts +61 -0
  255. package/out/src/profiler-flamegraph-html.js +366 -0
  256. package/out/src/profiler-flamegraph-html.js.map +1 -0
  257. package/out/src/profiler-format.d.ts +10 -0
  258. package/out/src/profiler-format.js +28 -0
  259. package/out/src/profiler-format.js.map +1 -0
  260. package/out/src/profiler-launch-cooperative.d.ts +16 -0
  261. package/out/src/profiler-launch-cooperative.js +167 -0
  262. package/out/src/profiler-launch-cooperative.js.map +1 -0
  263. package/out/src/profiler-launch.d.ts +29 -0
  264. package/out/src/profiler-launch.js +123 -0
  265. package/out/src/profiler-launch.js.map +1 -0
  266. package/out/src/profiler-results.d.ts +22 -0
  267. package/out/src/profiler-results.js +104 -0
  268. package/out/src/profiler-results.js.map +1 -0
  269. package/out/src/profiler-session-core.d.ts +42 -0
  270. package/out/src/profiler-session-core.js +116 -0
  271. package/out/src/profiler-session-core.js.map +1 -0
  272. package/out/src/profiler-state.d.ts +87 -0
  273. package/out/src/profiler-state.js +83 -0
  274. package/out/src/profiler-state.js.map +1 -0
  275. package/out/src/profiler-status.d.ts +38 -0
  276. package/out/src/profiler-status.js +163 -0
  277. package/out/src/profiler-status.js.map +1 -0
  278. package/out/src/profiler-styles.d.ts +21 -0
  279. package/out/src/profiler-styles.js +160 -0
  280. package/out/src/profiler-styles.js.map +1 -0
  281. package/out/src/profiler-webview.d.ts +95 -0
  282. package/out/src/profiler-webview.js +243 -0
  283. package/out/src/profiler-webview.js.map +1 -0
  284. package/out/src/profiler.d.ts +23 -0
  285. package/out/src/profiler.js +113 -0
  286. package/out/src/profiler.js.map +1 -0
  287. package/out/src/progress-ops.d.ts +24 -0
  288. package/out/src/progress-ops.js +135 -0
  289. package/out/src/progress-ops.js.map +1 -0
  290. package/out/src/reactive-refresh.d.ts +24 -0
  291. package/out/src/reactive-refresh.js +33 -0
  292. package/out/src/reactive-refresh.js.map +1 -0
  293. package/out/src/sample-summary.d.ts +39 -0
  294. package/out/src/sample-summary.js +32 -0
  295. package/out/src/sample-summary.js.map +1 -0
  296. package/out/src/sampled-view.d.ts +15 -0
  297. package/out/src/sampled-view.js +56 -0
  298. package/out/src/sampled-view.js.map +1 -0
  299. package/out/src/server-command.d.ts +4 -0
  300. package/out/src/server-command.js +14 -0
  301. package/out/src/server-command.js.map +1 -0
  302. package/out/src/settings.d.ts +1 -0
  303. package/out/src/settings.js +22 -0
  304. package/out/src/settings.js.map +1 -0
  305. package/out/src/store.d.ts +34 -0
  306. package/out/src/store.js +64 -0
  307. package/out/src/store.js.map +1 -0
  308. package/out/src/testing/cpu-capture-assertions.d.ts +8 -0
  309. package/out/src/testing/cpu-capture-assertions.js +71 -0
  310. package/out/src/testing/cpu-capture-assertions.js.map +1 -0
  311. package/out/src/testing/cpu-capture-contract.d.ts +8 -0
  312. package/out/src/testing/cpu-capture-contract.js +123 -0
  313. package/out/src/testing/cpu-capture-contract.js.map +1 -0
  314. package/out/src/testing/webview-contract-helpers.d.ts +24 -0
  315. package/out/src/testing/webview-contract-helpers.js +125 -0
  316. package/out/src/testing/webview-contract-helpers.js.map +1 -0
  317. package/out/src/testing/webview-contract-leak.d.ts +2 -0
  318. package/out/src/testing/webview-contract-leak.js +80 -0
  319. package/out/src/testing/webview-contract-leak.js.map +1 -0
  320. package/out/src/testing/webview-contract-memory.d.ts +5 -0
  321. package/out/src/testing/webview-contract-memory.js +221 -0
  322. package/out/src/testing/webview-contract-memory.js.map +1 -0
  323. package/out/src/testing/webview-contract-palette.d.ts +6 -0
  324. package/out/src/testing/webview-contract-palette.js +121 -0
  325. package/out/src/testing/webview-contract-palette.js.map +1 -0
  326. package/out/src/testing/webview-contract-panel.d.ts +7 -0
  327. package/out/src/testing/webview-contract-panel.js +100 -0
  328. package/out/src/testing/webview-contract-panel.js.map +1 -0
  329. package/out/src/testing/webview-contract-results.d.ts +6 -0
  330. package/out/src/testing/webview-contract-results.js +136 -0
  331. package/out/src/testing/webview-contract-results.js.map +1 -0
  332. package/out/src/testing/webview-contract.d.ts +18 -0
  333. package/out/src/testing/webview-contract.js +23 -0
  334. package/out/src/testing/webview-contract.js.map +1 -0
  335. package/out/src/timeouts.d.ts +21 -0
  336. package/out/src/timeouts.js +30 -0
  337. package/out/src/timeouts.js.map +1 -0
  338. package/out/src/trace-actions.d.ts +33 -0
  339. package/out/src/trace-actions.js +135 -0
  340. package/out/src/trace-actions.js.map +1 -0
  341. package/out/src/unknown-shape.d.ts +58 -0
  342. package/out/src/unknown-shape.js +110 -0
  343. package/out/src/unknown-shape.js.map +1 -0
  344. package/out/src/wire-adapters.d.ts +18 -0
  345. package/out/src/wire-adapters.js +160 -0
  346. package/out/src/wire-adapters.js.map +1 -0
  347. package/out/src/wire-generated.d.ts +760 -0
  348. package/out/src/wire-generated.js +38 -0
  349. package/out/src/wire-generated.js.map +1 -0
  350. package/package.json +53 -4
  351. package/scripts/contributions.mjs +187 -0
  352. package/README.md +0 -3
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.memoryCommandDisposables = memoryCommandDisposables;
37
+ // Implements [PROF-UI-MEMORY]. See docs/specs/LSP-PROFILER-SPEC.md
38
+ const vscode = __importStar(require("vscode"));
39
+ const ids_1 = require("./ids");
40
+ const progress_ops_1 = require("./progress-ops");
41
+ const memory_capture_1 = require("./memory-capture");
42
+ const memory_finalize_1 = require("./memory-finalize");
43
+ const memory_start_1 = require("./memory-start");
44
+ const memory_inspect_commands_1 = require("./memory-inspect-commands");
45
+ const memory_start_stop_commands_1 = require("./memory-start-stop-commands");
46
+ /** The memory command registrations and debug-session listeners. */
47
+ function memoryCommandDisposables(store) {
48
+ return [
49
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryMenu"), async () => { await (0, memory_inspect_commands_1.handleMemoryMenu)(store); }),
50
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryStart"), async (pid) => {
51
+ await (0, progress_ops_1.withUserProgress)((0, memory_capture_1.memStartTitle)(), async (report) => { await (0, memory_start_stop_commands_1.runMemoryStartCommand)(store, report, typeof pid === "number" ? pid : undefined); });
52
+ }),
53
+ vscode.commands.registerCommand((0, ids_1.cmd)("memorySnapshot"), async () => { await (0, memory_inspect_commands_1.handleMemorySnapshot)(store); }),
54
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryDiff"), async () => { await (0, memory_inspect_commands_1.handleMemoryDiff)(store); }),
55
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryGcCollect"), async () => { await (0, memory_inspect_commands_1.handleMemoryGcCollect)(store); }),
56
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryStop"), async () => { await (0, memory_start_stop_commands_1.runMemoryStopCommand)(store); }),
57
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryReferences"), async () => { await (0, memory_inspect_commands_1.handleMemoryReferences)(store); }),
58
+ // The status-bar show/hide on session changes is bound in memory-status.ts.
59
+ vscode.debug.onDidStartDebugSession((session) => { (0, memory_start_1.trackMemoryOnLaunch)(store, session); }),
60
+ vscode.debug.onDidTerminateDebugSession((session) => { (0, memory_finalize_1.settleMemoryOnSessionEnd)(store, session); }),
61
+ ];
62
+ }
63
+ //# sourceMappingURL=memory-registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-registration.js","sourceRoot":"","sources":["../../src/memory-registration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,MAAY,MAAM,mCAAe;AACjC,+BAA4B;AAE5B,iDAAkD;AAClD,qDAAiD;AACjD,uDAA6D;AAC7D,iDAAqD;AACrD,uEAAoJ;AACpJ,6EAA2F;AAE3F,oEAAoE;AACpE,kCAAyC,KAAY;IACnD,OAAO;QACL,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,YAAY,CAAC,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,IAAA,0CAAgB,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAClG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,aAAa,CAAC,EAAE,KAAK,EAAE,GAAa,EAAE,EAAE;YAA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AO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1F,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,IAAA,0CAAwB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;KACpG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ProfilerStore as Store } from "./store";
2
+ /**
3
+ * Start tracking and adopt the session. Returns whether tracking actually
4
+ * started, so each caller shows its own context-appropriate message. The start
5
+ * reply carries the at-exit `finalSnapshotFile` the session is finalised from on
6
+ * session end ([PROF-PY-MEMORY-FINAL]).
7
+ */
8
+ export declare function handleMemoryStart(store: Store, report: (message: string) => void, pid?: number): Promise<boolean>;
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.handleMemoryStart = handleMemoryStart;
37
+ // Implements [PROF-UI-MEMORY], [PROF-UI-PROCESSES] (memory leg). See docs/specs/LSP-PROFILER-SPEC.md
38
+ const vscode = __importStar(require("vscode"));
39
+ const ids_1 = require("./ids");
40
+ const logger_1 = require("./logger");
41
+ const dap_evaluate_1 = require("./dap-evaluate");
42
+ const server_command_1 = require("./server-command");
43
+ const memory_capture_1 = require("./memory-capture");
44
+ /**
45
+ * The running client, when a memory start may begin. Memory starts gate on the
46
+ * memory leg only ([PROF-UI-PROCESSES]): independent of any live CPU profile,
47
+ * but never a second memory session. Otherwise the reason is shown.
48
+ */
49
+ function clientForMemoryStart(store) {
50
+ const client = store.client.value;
51
+ if (client?.isRunning() !== true) {
52
+ void vscode.window.showErrorMessage(`${(0, ids_1.brand)()} LSP not connected`);
53
+ return undefined;
54
+ }
55
+ if (store.memoryBusy.value) {
56
+ void vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Memory tracking is already active.`);
57
+ return undefined;
58
+ }
59
+ return client;
60
+ }
61
+ /** The process to track: an explicit PID (a Processes row) or the active debuggee. */
62
+ function memoryTarget(store, debugSession, pid) {
63
+ const target = pid ?? (debugSession === undefined ? undefined : store.getDebuggeeProcessId(debugSession.id));
64
+ if (target === undefined) {
65
+ void vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Pick a process in the panel, or debug a program, to track its memory.`);
66
+ }
67
+ return target;
68
+ }
69
+ /** Resolve the client and debug target one memory start runs against. */
70
+ function startContext(store, pid) {
71
+ const client = clientForMemoryStart(store);
72
+ if (client === undefined) {
73
+ return undefined;
74
+ }
75
+ const debugSession = vscode.debug.activeDebugSession;
76
+ const target = memoryTarget(store, debugSession, pid);
77
+ if (target === undefined) {
78
+ return undefined;
79
+ }
80
+ return { client, target: { target, debugSession } };
81
+ }
82
+ /**
83
+ * Start tracking and adopt the session. Returns whether tracking actually
84
+ * started, so each caller shows its own context-appropriate message. The start
85
+ * reply carries the at-exit `finalSnapshotFile` the session is finalised from on
86
+ * session end ([PROF-PY-MEMORY-FINAL]).
87
+ */
88
+ async function handleMemoryStart(store, report, pid) {
89
+ const context = startContext(store, pid);
90
+ if (context === undefined) {
91
+ return false;
92
+ }
93
+ // From here on the panel reflects a tracking start in flight; every exit path
94
+ // must settle it back to active or idle ([PROF-UI-STATE]).
95
+ store.memoryTrackingStarting();
96
+ try {
97
+ return await startTracking(store, context, report);
98
+ }
99
+ catch (error) {
100
+ return reportStartFailure(store, context.target.target, error);
101
+ }
102
+ }
103
+ /** Settle a failed start back to idle and tell the user why. */
104
+ function reportStartFailure(store, target, error) {
105
+ store.memoryTrackingStopped();
106
+ const message = error instanceof Error ? error.message : String(error);
107
+ logger_1.Logger.warn(`Memory tracking failed for PID ${String(target)}: ${message}`);
108
+ void vscode.window.showErrorMessage(`Memory tracking failed: ${message}`);
109
+ return false;
110
+ }
111
+ /** Ask the server to start, run a courier runtime's script in the debuggee, then adopt. */
112
+ async function startTracking(store, context, report) {
113
+ report("Starting the memory session…");
114
+ const result = await (0, server_command_1.executeServerCommand)(context.client, memory_capture_1.LSP_MEM_CMD.start, { pid: context.target.target, traceback_depth: memory_capture_1.TRACEBACK_DEPTH });
115
+ if (result === undefined || (result.step.kind === "Evaluate" && !(await injectCourier(result.step.script, report)))) {
116
+ store.memoryTrackingStopped();
117
+ return false;
118
+ }
119
+ adoptMemorySession(store, context, result);
120
+ return true;
121
+ }
122
+ /** Adopt the started session: remember its debug session, mode and live id. */
123
+ function adoptMemorySession(store, context, result) {
124
+ // Remember which debug session this tracks, so only its termination
125
+ // finalises the run ([PROF-PY-MEMORY-FINAL]).
126
+ const session = context.target.debugSession;
127
+ const tracked = store.getDebuggeeProcessId(session?.id ?? "") === context.target.target ? session?.id : undefined;
128
+ store.memoryTrackingActive(result.memory_session_id, undefined, tracked);
129
+ (0, memory_capture_1.setDirectMemorySession)(result.mode.kind === "Direct");
130
+ logger_1.Logger.info(`Memory tracking started: session ${result.memory_session_id} (${result.mode.kind})`);
131
+ }
132
+ /**
133
+ * Courier runtimes ([PROF-MEMORY-MODE]) start tracking by running a script in
134
+ * the paused debuggee: pause transparently, inject, resume.
135
+ */
136
+ async function injectCourier(script, report) {
137
+ report("Pausing the program…");
138
+ const acquired = await (0, dap_evaluate_1.acquireStoppedFrame)();
139
+ if (acquired === null) {
140
+ warnPauseFailed();
141
+ return false;
142
+ }
143
+ try {
144
+ return await injectTracker(script, acquired.frameId, report);
145
+ }
146
+ finally {
147
+ await acquired.release();
148
+ }
149
+ }
150
+ /** Evaluate the courier script in an acquired frame and report the outcome. */
151
+ async function injectTracker(script, frameId, report) {
152
+ report("Injecting the tracker…");
153
+ const injected = (await (0, dap_evaluate_1.evaluateInDebugSession)(script, frameId)) !== null;
154
+ if (!injected) {
155
+ warnInjectionFailed();
156
+ }
157
+ return injected;
158
+ }
159
+ function warnPauseFailed() {
160
+ void vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Could not pause the program — pause at a breakpoint, then start memory tracking.`);
161
+ }
162
+ function warnInjectionFailed() {
163
+ void vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Could not start the memory tracker in the debuggee.`);
164
+ }
165
+ //# sourceMappingURL=memory-start-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-start-core.js","sourceRoot":"","sources":["../../src/memory-start-core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qGAAqG;AACrG,MAAY,MAAM,mCAAe;AACjC,+BAA8B;AAC9B,qCAAkC;AAElC,iDAA6E;AAC7E,qDAAwD;AAExD,qDAAwF;AAKxF;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,KAAY;IACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IA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MAAiC;IAC5E,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,MAAM,IAAA,kCAAmB,GAAE,CAAC;IAC7C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,eAAe,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,OAAO,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;YAAS,CAAC;QACT,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,OAAe,EAAE,MAAiC;IAC7F,MAAM,CAAC,wBAAwB,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,qCAAsB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;IAC1E,IAAI,CAAC,QAAQ,EAAE,CAAC;QAAC,mBAAmB,EAAE,CAAC;IAAC,CAAC;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,eAAe;IACtB,KAAK,MAAM,CAAC,MAAM,CAAC,kBAAkB,CACnC,GAAG,IAAA,WAAK,GAAE,oFAAoF,CAC/F,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB;IAC1B,KAAK,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,IAAA,WAAK,GAAE,uDAAuD,CAAC,CAAC;AAC3G,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ProfilerStore as Store } from "./store";
2
+ /** The `<prefix>.profiler.memoryStart` body: start tracking, then narrate what comes next. */
3
+ export declare function runMemoryStartCommand(store: Store, report: (message: string) => void, pid?: number): Promise<void>;
4
+ /**
5
+ * The `<prefix>.profiler.memoryStop` body. Stopping never silently produces
6
+ * nothing: it says whether a snapshot was captured, or plainly that none was
7
+ * ([PROF-PY-MEMORY-FINAL], #146). Stopping mid-run leaves the debuggee's
8
+ * `atexit` hook armed, so the file it will write is scheduled for cleanup.
9
+ */
10
+ export declare function runMemoryStopCommand(store: Store): Promise<void>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.runMemoryStartCommand = runMemoryStartCommand;
37
+ exports.runMemoryStopCommand = runMemoryStopCommand;
38
+ // Implements [PROF-UI-MEMORY]. See docs/specs/LSP-PROFILER-SPEC.md
39
+ const vscode = __importStar(require("vscode"));
40
+ const ids_1 = require("./ids");
41
+ const memory_capture_1 = require("./memory-capture");
42
+ const memory_finalize_1 = require("./memory-finalize");
43
+ const memory_guidance_1 = require("./memory-guidance");
44
+ const memory_autopilot_1 = require("./memory-autopilot");
45
+ const memory_start_core_1 = require("./memory-start-core");
46
+ /** The `<prefix>.profiler.memoryStart` body: start tracking, then narrate what comes next. */
47
+ async function runMemoryStartCommand(store, report, pid) {
48
+ if (await (0, memory_start_core_1.handleMemoryStart)(store, report, pid)) {
49
+ // The moment of disorientation is right here (the user just landed in the
50
+ // Debug view), so the toast says what happens next in the tracked runtime's
51
+ // own mode ([PROF-UI-AUTOPILOT]) and carries the action ([PROF-UI-MEMORY], #263).
52
+ (0, memory_finalize_1.showActionableToast)((0, memory_guidance_1.trackingGuidance)((0, memory_capture_1.isDirectMemorySession)(), (0, memory_autopilot_1.captureIntervalSeconds)()), "Take Snapshot", (0, ids_1.cmd)("memorySnapshot"));
53
+ }
54
+ }
55
+ /**
56
+ * The `<prefix>.profiler.memoryStop` body. Stopping never silently produces
57
+ * nothing: it says whether a snapshot was captured, or plainly that none was
58
+ * ([PROF-PY-MEMORY-FINAL], #146). Stopping mid-run leaves the debuggee's
59
+ * `atexit` hook armed, so the file it will write is scheduled for cleanup.
60
+ */
61
+ async function runMemoryStopCommand(store) {
62
+ const hadSnapshot = (0, memory_capture_1.hasCapturedSnapshot)();
63
+ const direct = (0, memory_capture_1.isDirectMemorySession)();
64
+ (0, memory_finalize_1.scheduleSnapshotCleanup)(store);
65
+ await (0, memory_capture_1.endServerSession)(store);
66
+ (0, memory_finalize_1.handleMemoryStop)(store);
67
+ if (hadSnapshot) {
68
+ void vscode.window.showInformationMessage(`${(0, ids_1.brand)()}: Memory tracking stopped.`);
69
+ return;
70
+ }
71
+ // The toast tells the user to take a snapshot, so it offers the way there
72
+ // (the quick-pick action menu), never an invisible palette ([PROF-UI-MEMORY], #263).
73
+ (0, memory_finalize_1.showActionableToast)((0, memory_guidance_1.stoppedWithoutSnapshot)(direct), "Memory Actions…", (0, ids_1.cmd)("memoryMenu"));
74
+ }
75
+ //# sourceMappingURL=memory-start-stop-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-start-stop-commands.js","sourceRoot":"","sources":["../../src/memory-start-stop-commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,MAAY,MAAM,mCAAe;AACjC,+BAAmC;AAEnC,qDAAgG;AAChG,uDAAmG;AACnG,uDAA6E;AAC7E,yDAA4D;AAC5D,2DAAwD;AAExD,8FAA8F;AACvF,KAAK,gCAAgC,KAAY,EAAE,MAAiC,EAAE,GAAY;IACvG,IAAI,MAAM,IAAA,qCAAiB,EAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;QAChD,0EAA0E;QAC1E,4EAA4E;QAC5E,kFAAkF;QAClF,IAAA,qCAAmB,EACjB,IAAA,kCAAgB,EAAC,IAAA,sCAAqB,GAAE,EAAE,IAAA,yCAAsB,GAAE,CAAC,EACnE,eAAe,EACf,IAAA,SAAG,EAAC,gBAAgB,CAAC,CACtB,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACI,KAAK,+BAA+B,KAAY;IACrD,MAAM,WAAW,GAAG,IAAA,oCAAmB,GAAE,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAA,sCAAqB,GAAE,CAAC;IACvC,IAAA,yCAAuB,EAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,IAAA,iCAAgB,EAAC,KAAK,CAAC,CAAC;IAC9B,IAAA,kCAAgB,EAAC,KAAK,CAAC,CAAC;IACxB,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG,IAAA,WAAK,GAAE,4BAA4B,CAAC,CAAC;QAClF,OAAO;IACT,CAAC;IACD,0EAA0E;IAC1E,qFAAqF;IACrF,IAAA,qCAAmB,EAAC,IAAA,wCAAsB,EAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,IAAA,SAAG,EAAC,YAAY,CAAC,CAAC,CAAC;AAC5F,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Starting memory tracking: from the menu, from a Processes row and from a
3
+ * "Run & Track Memory (Current File)" launch (#82).
4
+ */
5
+ export { handleMemoryStart } from "./memory-start-core";
6
+ export { trackMemoryOnLaunch } from "./memory-launch";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // Implements [PROF-UI-MEMORY], [PROF-UI-PROCESSES] (memory leg). See docs/specs/LSP-PROFILER-SPEC.md
3
+ /**
4
+ * Starting memory tracking: from the menu, from a Processes row and from a
5
+ * "Run & Track Memory (Current File)" launch (#82).
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.trackMemoryOnLaunch = exports.handleMemoryStart = void 0;
9
+ var memory_start_core_1 = require("./memory-start-core");
10
+ Object.defineProperty(exports, "handleMemoryStart", { enumerable: true, get: function () { return memory_start_core_1.handleMemoryStart; } });
11
+ var memory_launch_1 = require("./memory-launch");
12
+ Object.defineProperty(exports, "trackMemoryOnLaunch", { enumerable: true, get: function () { return memory_launch_1.trackMemoryOnLaunch; } });
13
+ //# sourceMappingURL=memory-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-start.js","sourceRoot":"","sources":["../../src/memory-start.ts"],"names":[],"mappings":";AAAA,qGAAqG;AACrG;;;GAGG;;;AAEH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Memory status-bar lifecycle: hidden → one-click start affordance (while a
3
+ * host debug session is active) → starting spinner → tracking readout.
4
+ * A start in flight is never silent ([PROF-UI-STATE]).
5
+ *
6
+ * The item renders from the store's reactive `profiler` signal plus the debug
7
+ * session lifecycle (the "debugging but not yet tracking" state is not a store
8
+ * signal), mirroring `profiler-status.ts`. Owned here so memory-profiler.ts
9
+ * stays focused on command routing and session flow.
10
+ */
11
+ import * as vscode from "vscode";
12
+ import type { ProfilerStore as Store } from "./store";
13
+ /**
14
+ * Create the memory status-bar item (click = action menu) and bind it to the
15
+ * store's `profiler` signal and the debug-session lifecycle. Returns
16
+ * disposables that tear down the effect, the listeners, and the item.
17
+ */
18
+ export declare function bindMemoryStatusBar(store: Store): vscode.Disposable[];
19
+ /**
20
+ * The memory status-bar text, or undefined when hidden. E2e seam for
21
+ * [PROF-UI-STATE]: StatusBarItem visibility is not readable via the
22
+ * public API, mirroring `profilerStatusText()` (profiler-status.ts).
23
+ */
24
+ export declare function memoryStatusText(): string | undefined;
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ // Implements [PROF-UI-STATE] + [PROF-UI-PROCESSES].
3
+ // See docs/specs/LSP-PROFILER-SPEC.md
4
+ /**
5
+ * Memory status-bar lifecycle: hidden → one-click start affordance (while a
6
+ * host debug session is active) → starting spinner → tracking readout.
7
+ * A start in flight is never silent ([PROF-UI-STATE]).
8
+ *
9
+ * The item renders from the store's reactive `profiler` signal plus the debug
10
+ * session lifecycle (the "debugging but not yet tracking" state is not a store
11
+ * signal), mirroring `profiler-status.ts`. Owned here so memory-profiler.ts
12
+ * stays focused on command routing and session flow.
13
+ */
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.bindMemoryStatusBar = bindMemoryStatusBar;
49
+ exports.memoryStatusText = memoryStatusText;
50
+ const vscode = __importStar(require("vscode"));
51
+ const ids_1 = require("./ids");
52
+ const signals_core_1 = require("@preact/signals-core");
53
+ /** Status bar priority — lower than host's main item. */
54
+ const MEMORY_STATUS_BAR_PRIORITY = 98;
55
+ let memoryStatusBarItem = null;
56
+ /** Last-rendered visibility, so the e2e seam knows when the item is hidden. */
57
+ let memoryStatusVisible = false;
58
+ /**
59
+ * Create the memory status-bar item (click = action menu) and bind it to the
60
+ * store's `profiler` signal and the debug-session lifecycle. Returns
61
+ * disposables that tear down the effect, the listeners, and the item.
62
+ */
63
+ function bindMemoryStatusBar(store) {
64
+ memoryStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, MEMORY_STATUS_BAR_PRIORITY);
65
+ // Click the status-bar item to open the memory action menu (no palette needed).
66
+ memoryStatusBarItem.command = (0, ids_1.cmd)("memoryMenu");
67
+ // Reactive leg: tracking state, and whether any runtime offers memory ([PROF-UI-CAPABILITIES]).
68
+ const disposeEffect = (0, signals_core_1.effect)(() => { refreshMemoryStatusBar(store); });
69
+ refreshMemoryStatusBar(store);
70
+ const forget = () => { memoryStatusBarItem = null; memoryStatusVisible = false; };
71
+ return [memoryStatusBarItem, { dispose: disposeEffect }, ...debugSessionRefresh(store), { dispose: forget }];
72
+ }
73
+ /** The imperative leg: show/hide as host debug sessions come and go. */
74
+ function debugSessionRefresh(store) {
75
+ const refresh = () => { refreshMemoryStatusBar(store); };
76
+ return [
77
+ vscode.debug.onDidChangeActiveDebugSession(refresh),
78
+ vscode.debug.onDidStartDebugSession(refresh),
79
+ vscode.debug.onDidTerminateDebugSession(refresh),
80
+ ];
81
+ }
82
+ /**
83
+ * Show the memory status-bar entry whenever a host debug session is active
84
+ * and a runtime offers memory (or tracking is starting/on) and click it to open the action menu. Hidden
85
+ * otherwise. A start in flight shows a spinner — never silence between the
86
+ * click and the tracking state ([PROF-UI-STATE]).
87
+ */
88
+ function refreshMemoryStatusBar(store) {
89
+ if (memoryStatusBarItem === null) {
90
+ return;
91
+ }
92
+ // Both signals are read on every pass, so the effect that calls this
93
+ // re-runs when either changes ([PROF-UI-CAPABILITIES]).
94
+ const memoryState = store.profiler.value.memory;
95
+ const offered = store.memoryOffered();
96
+ const debugging = vscode.debug.activeDebugSession?.type === (0, ids_1.debugType)();
97
+ // A host whose runtimes advertise no memory backend never offers tracking.
98
+ if ((!debugging || !offered) && memoryState === "idle") {
99
+ hideMemoryStatusBar();
100
+ return;
101
+ }
102
+ showMemoryStatusBar(memoryStatusBarItem, memoryStatusLook(memoryState));
103
+ }
104
+ /** Paint the item with `look` and show it. */
105
+ function showMemoryStatusBar(item, look) {
106
+ item.text = look.text;
107
+ item.tooltip = look.tooltip;
108
+ item.backgroundColor = look.highlighted ? new vscode.ThemeColor("statusBarItem.warningBackground") : undefined;
109
+ memoryStatusVisible = true;
110
+ item.show();
111
+ }
112
+ /** The item's text and tooltip in each tracking state; live tracking is highlighted. */
113
+ function memoryStatusLook(state) {
114
+ if (state === "starting") {
115
+ return { text: "$(loading~spin) Memory: starting…", tooltip: `${(0, ids_1.brand)()} is starting memory tracking`, highlighted: false };
116
+ }
117
+ if (state === "active") {
118
+ return { text: "$(eye) Memory: tracking", tooltip: `${(0, ids_1.brand)()}: memory tracking active — click for snapshot/compare/stop`, highlighted: true };
119
+ }
120
+ return { text: "$(database) Memory", tooltip: `${(0, ids_1.brand)()}: click to start memory tracking (briefly pauses the program)`, highlighted: false };
121
+ }
122
+ /** Hide the item and record it for the e2e seam. */
123
+ function hideMemoryStatusBar() {
124
+ memoryStatusVisible = false;
125
+ memoryStatusBarItem?.hide();
126
+ }
127
+ /**
128
+ * The memory status-bar text, or undefined when hidden. E2e seam for
129
+ * [PROF-UI-STATE]: StatusBarItem visibility is not readable via the
130
+ * public API, mirroring `profilerStatusText()` (profiler-status.ts).
131
+ */
132
+ function memoryStatusText() {
133
+ return memoryStatusVisible ? memoryStatusBarItem?.text : undefined;
134
+ }
135
+ //# sourceMappingURL=memory-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-status.js","sourceRoot":"","sources":["../../src/memory-status.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,sCAAsC;AACtC;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,MAAY,MAAM,mCAAe;AACjC,+BAA8C;AAC9C,uDAA8C;AAG9C,yDAAyD;AACzD,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,IAAI,mBAAmB,GAAgC,IAAI,CAAC;AAC5D,+EAA+E;AAC/E,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAEhC;;;;GAIG;AACH,6BAAoC,KAAY;IAC9C,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;IACpH,gFAAgF;IAChF,mBAAmB,CAAC,OAAO,GAAG,IAAA,SAAG,EAAC,YAAY,CAAC,CAAC;IAChD,gGAAgG;IAChG,MAAM,aAAa,GAAG,IAAA,qBAAM,EAAC,GAAG,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,sBA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 @@
1
+ import * as vscode from "vscode";
2
+ export declare function bindPanelPalette(panel: vscode.WebviewPanel): vscode.Disposable;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.bindPanelPalette = bindPanelPalette;
37
+ // Implements [PROF-UI-PALETTE]. Apply settings changes to already-open panels.
38
+ const vscode = __importStar(require("vscode"));
39
+ const ids_1 = require("./ids");
40
+ const palette_1 = require("./palette");
41
+ function bindPanelPalette(panel) {
42
+ const subscription = vscode.workspace.onDidChangeConfiguration(event => {
43
+ if (event.affectsConfiguration(`${(0, ids_1.configSection)()}.profiler.palette`)) {
44
+ void panel.webview.postMessage({ type: "profilerPalette", palette: (0, palette_1.profilerPalette)(), vars: (0, palette_1.paletteVars)() });
45
+ }
46
+ });
47
+ panel.onDidDispose(() => { subscription.dispose(); });
48
+ return subscription;
49
+ }
50
+ //# sourceMappingURL=palette-vscode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette-vscode.js","sourceRoot":"","sources":["../../src/palette-vscode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAA+E;AAC/E,MAAY,MAAM,mCAAe;AACjC,+BAAsC;AACtC,uCAAyD;AAEzD,0BAAiC,KAA0B;IACzD,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE;QACrE,IAAI,KAAK,CAAC,oBAAoB,CAAC,GAAG,IAAA,mBAAa,GAAE,mBAAmB,CAAC,EAAE,CAAC;YACtE,KAAK,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAA,yBAAe,GAAE,EAAE,IAAI,EAAE,IAAA,qBAAW,GAAE,EAAE,CAAC,CAAC;QAC/G,CAAC;IACH,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,YAAY,CAAC;AACtB,CAAC"}