@nimblesite/lsp-profiler-ui 0.0.0-stage โ†’ 0.0.1

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,205 @@
1
+ "use strict";
2
+ // Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
3
+ /**
4
+ * Launch actions for the Processes panel.
5
+ *
6
+ * Two surfaces, one language: per-row inline actions ("Profile CPU" ๐Ÿ”ฅ /
7
+ * "Track Memory" ๐Ÿ—„๏ธ โ€” the #62 fix, hardened for #79) and the metric-explicit
8
+ * title-bar launches for the current file ("Run & Profile CPU" / "Run & Track
9
+ * Memory" โ€” the #82 fix). The tree rendering lives in process-explorer.ts;
10
+ * this module owns what happens when the user clicks.
11
+ */
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.memoryTrackRoute = memoryTrackRoute;
47
+ exports.createProcessRowActions = createProcessRowActions;
48
+ exports.openFileToProfile = openFileToProfile;
49
+ exports.registerLaunchCommands = registerLaunchCommands;
50
+ const unknown_shape_1 = require("./unknown-shape");
51
+ const ids_1 = require("./ids");
52
+ const vscode = __importStar(require("vscode"));
53
+ const profiler_attach_1 = require("./profiler-attach");
54
+ /** Structural guard: does this tree item carry a profilable process? */
55
+ function isProcessRow(item) {
56
+ return (0, unknown_shape_1.numberField)((0, unknown_shape_1.rawField)(item, "process"), "pid") !== undefined;
57
+ }
58
+ /**
59
+ * Resolve the row an inline action targets. VS Code sometimes invokes inline
60
+ * tree-view commands with no argument (#79 โ€” e.g. a click racing the panel's
61
+ * auto-refresh), so fall back to the panel's current selection before warning.
62
+ */
63
+ function resolveProcessRow(item, view) {
64
+ if (isProcessRow(item)) {
65
+ return item;
66
+ }
67
+ return view.selection.find((entry) => isProcessRow(entry));
68
+ }
69
+ /** Guard: narrow to a real target, warning when an action has no row. */
70
+ function ensureSelection(item) {
71
+ if (item === undefined) {
72
+ vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Select a process row, then use Profile CPU or Track Memory.`);
73
+ return false;
74
+ }
75
+ return true;
76
+ }
77
+ /** Start CPU profiling the given process row โ€” no input box (the #62 fix). */
78
+ async function profileProcess(store, item) {
79
+ if (!ensureSelection(item)) {
80
+ return;
81
+ }
82
+ // The blocked contextValue hides the menu actions, but a click can race the
83
+ // panel's auto-refresh (or arrive via the palette) โ€” never attempt an attach
84
+ // the panel already knows will fail; explain why instead (#266).
85
+ if (!item.process.debuggable) {
86
+ vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Can't profile PID ${String(item.process.pid)} โ€” ${item.process.undebuggableReason ?? "the profiler cannot attach to it"}.`);
87
+ return;
88
+ }
89
+ const preset = vscode.workspace.getConfiguration((0, ids_1.configSection)()).get("profiler.preset", "default");
90
+ await (0, profiler_attach_1.startProfilingForPid)(store, item.process.pid, preset);
91
+ }
92
+ const DEFAULT_ROW_DEPS = {
93
+ runCommand: async (command, ...args) => vscode.commands.executeCommand(command, ...args),
94
+ activeSession: () => vscode.debug.activeDebugSession,
95
+ };
96
+ /**
97
+ * Memory tracking rides the DAP-`evaluate` courier ([PROF-UI-MEMORY]),
98
+ * so it can only ever target the live host debuggee โ€” tracemalloc cannot
99
+ * be injected into an arbitrary external PID. Anything else routes to the
100
+ * "launch it under the debugger" offer instead of silently starting the wrong
101
+ * (CPU) profiler.
102
+ */
103
+ function memoryTrackRoute(store, pid, session) {
104
+ const debuggeePid = session?.type === (0, ids_1.debugType)() ? store.getDebuggeeProcessId(session.id) : undefined;
105
+ return debuggeePid === pid ? "start-tracking" : "offer-launch";
106
+ }
107
+ /** Track memory for the given row: real tracking for the debuggee, an honest offer otherwise. */
108
+ async function memoryTrackProcess(store, item, deps) {
109
+ if (!ensureSelection(item)) {
110
+ return;
111
+ }
112
+ const { pid } = item.process;
113
+ // A direct runtime reads any attachable heap; a courier runtime only its debuggee ([PROF-UI-CAPABILITIES]).
114
+ if (store.memoryIsDirect(item.process.runtime) || memoryTrackRoute(store, pid, deps.activeSession()) === "start-tracking") {
115
+ await deps.runCommand((0, ids_1.cmd)("memoryStart"), pid);
116
+ return;
117
+ }
118
+ offerMemoryLaunch(pid, deps);
119
+ }
120
+ /** A courier runtime tracks only its debuggee: offer the launch that makes `pid`'s program one. */
121
+ function offerMemoryLaunch(pid, deps) {
122
+ const launch = "Run & Track Memory (Current File)";
123
+ const offer = `${(0, ids_1.brand)()}: Memory tracking needs the target running under the ${(0, ids_1.brand)()} debugger โ€” PID ${String(pid)} is not the active debuggee. Launch the current file with memory tracking instead?`;
124
+ void offerMemoryLaunchChoice(offer, launch, deps);
125
+ }
126
+ /** Await the launch offer and run the launch when it is accepted. */
127
+ async function offerMemoryLaunchChoice(offer, launch, deps) {
128
+ const choice = await vscode.window.showWarningMessage(offer, launch);
129
+ if (choice === launch) {
130
+ await deps.runCommand((0, ids_1.cmd)("trackMemoryCurrentFile"));
131
+ }
132
+ }
133
+ /**
134
+ * The per-row launch handlers exactly as VS Code invokes them for the inline
135
+ * buttons and context menu. Exported so tests can drive the real command
136
+ * surface, including the no-argument invocation of issue #79.
137
+ */
138
+ function createProcessRowActions(store, view, deps = DEFAULT_ROW_DEPS) {
139
+ return {
140
+ profileProcess: async (item) => { await profileProcess(store, resolveProcessRow(item, view)); },
141
+ memoryTrackProcess: async (item) => { await memoryTrackProcess(store, resolveProcessRow(item, view), deps); },
142
+ };
143
+ }
144
+ /**
145
+ * Build the debug configuration for a metric-explicit run-and-profile launch.
146
+ * Exported so tests can assert each metric produces the right launch shape.
147
+ *
148
+ * CPU sets `profileOnLaunch` (honoured by profiler.ts). Memory stops on entry
149
+ * because tracemalloc is injected via DAP `evaluate`, which needs a paused
150
+ * debuggee ([PROF-UI-MEMORY]); memory-profiler.ts starts tracking at the
151
+ * entry pause and then resumes the program.
152
+ */
153
+ async function profileCurrentFile(store, metric) {
154
+ const file = metricBusy(store, metric) ? undefined : profilableFile(store);
155
+ if (file === undefined) {
156
+ return;
157
+ }
158
+ const configuration = store.host.launchConfig(metric, file.fsPath);
159
+ if (configuration === undefined) {
160
+ vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: Running the current file for profiling is not supported here.`);
161
+ return;
162
+ }
163
+ if (!(await vscode.debug.startDebugging(vscode.workspace.getWorkspaceFolder(file), configuration))) {
164
+ vscode.window.showErrorMessage(`${(0, ids_1.brand)()}: Could not launch the current file for profiling.`);
165
+ }
166
+ }
167
+ /**
168
+ * While the matching metric is starting or running the launch button is hidden
169
+ * ([PROF-UI-PROCESSES]); the command is guarded per metric too, so the palette
170
+ * path can't spawn a second SAME-metric session on top of the active one โ€” yet a
171
+ * CPU run while memory tracking is live (and vice versa) is fine.
172
+ */
173
+ function metricBusy(store, metric) {
174
+ const busy = metric === "cpu" ? store.cpuBusy.value : store.memoryBusy.value;
175
+ if (busy) {
176
+ const label = metric === "cpu" ? "CPU profile" : "memory tracking session";
177
+ vscode.window.showWarningMessage(`${(0, ids_1.brand)()}: A ${label} is already active. Stop it before running another.`);
178
+ }
179
+ return busy;
180
+ }
181
+ /** What to open before "run & profile", naming the host's languages as a user knows them ([PROF-UI-HOST]). */
182
+ function openFileToProfile(languageNames) {
183
+ return `${(0, ids_1.brand)()}: Open a file in ${languageNames.join(" or ")} to run and profile.`;
184
+ }
185
+ /** The active editor's file when it is in one of the host's languages; otherwise say what to open. */
186
+ function profilableFile(store) {
187
+ const editor = vscode.window.activeTextEditor;
188
+ if (editor === undefined || !store.host.languageIds.includes(editor.document.languageId)) {
189
+ vscode.window.showWarningMessage(openFileToProfile(store.host.languageNames));
190
+ return undefined;
191
+ }
192
+ return editor.document.uri;
193
+ }
194
+ // โ”€โ”€ Registration โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
195
+ /** Register every launch command the Processes panel contributes. */
196
+ function registerLaunchCommands(store, view) {
197
+ const rowActions = createProcessRowActions(store, view);
198
+ return [
199
+ vscode.commands.registerCommand((0, ids_1.cmd)("profileProcess"), rowActions.profileProcess),
200
+ vscode.commands.registerCommand((0, ids_1.cmd)("memoryTrackProcess"), rowActions.memoryTrackProcess),
201
+ vscode.commands.registerCommand((0, ids_1.cmd)("profileCurrentFileCpu"), async () => { await profileCurrentFile(store, "cpu"); }),
202
+ vscode.commands.registerCommand((0, ids_1.cmd)("trackMemoryCurrentFile"), async () => { await profileCurrentFile(store, "memory"); }),
203
+ ];
204
+ }
205
+ //# sourceMappingURL=process-launch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-launch.js","sourceRoot":"","sources":["../../src/process-launch.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAwD;AACxD,+BAA6D;AAC7D,MAAY,MAAM,mCAAe;AACjC,uDAAyD;AAezD,wEAAwE;AACxE,SAAS,YAAY,CAAC,IAAiC;IACrD,OAAO,IAAA,2BAAW,EAAC,IAAA,wBAAQ,EAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC;AACrE,CAAC;AAED;;;;GAIG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AC,gBAAgB,CAAC;IAC9C,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACzF,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QAC9E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC7B,CAAC;AAED,4EAA4E;AAE5E,qEAAqE;AACrE,gCAAuC,KAAY,EAAE,IAAsB;IACzE,MAAM,UAAU,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACxD,OAAO;QACL,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC;QACjF,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,oBAAoB,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC;QACzF,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,uBAAuB,CAAC,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACtH,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,wBAAwB,CAAC,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3H,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as vscode from "vscode";
2
+ /**
3
+ * A non-process placeholder row. Returned (instead of an empty list) when the
4
+ * user's search filter empties a NON-empty process list, so the empty-tree
5
+ * viewsWelcome never claims "No processes running" while processes are in
6
+ * fact running, just filtered (procexp-2).
7
+ */
8
+ export declare class MessageTreeItem extends vscode.TreeItem {
9
+ constructor(label: string);
10
+ }
@@ -0,0 +1,53 @@
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.MessageTreeItem = void 0;
37
+ // Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
38
+ const vscode = __importStar(require("vscode"));
39
+ /**
40
+ * A non-process placeholder row. Returned (instead of an empty list) when the
41
+ * user's search filter empties a NON-empty process list, so the empty-tree
42
+ * viewsWelcome never claims "No processes running" while processes are in
43
+ * fact running, just filtered (procexp-2).
44
+ */
45
+ class MessageTreeItem extends vscode.TreeItem {
46
+ constructor(label) {
47
+ super(label, vscode.TreeItemCollapsibleState.None);
48
+ this.contextValue = "processesMessage";
49
+ this.iconPath = new vscode.ThemeIcon("filter");
50
+ }
51
+ }
52
+ exports.MessageTreeItem = MessageTreeItem;
53
+ //# sourceMappingURL=process-message-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-message-item.js","sourceRoot":"","sources":["../../src/process-message-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsE;AACtE,MAAY,MAAM,mCAAe;AAEjC;;;;;GAKG;AACH,qBAA6B,SAAQ,MAAM,CAAC,QAAQ;IAClD,YAAmB,KAAa;QAC9B,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,YAAY,GAAG,kBAAkB,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The store-side source of the Processes list (#148).
3
+ *
4
+ * The OS has no push event for "a process appeared", so the list is
5
+ * genuinely poll-sourced โ€” but per the architecture the poll belongs HERE,
6
+ * feeding the store's `processes` Signal, never inside the panel: the tree
7
+ * provider stays a pure projection of centralised state and owns no timer.
8
+ * Polling runs only while the panel is visible, so navigating away stops the
9
+ * LSP round-trips.
10
+ */
11
+ import * as vscode from "vscode";
12
+ import type { ProfilerStore as Store } from "./store";
13
+ export { bindProcessesContextKey, bindServerStateContextKey } from "./process-context-keys";
14
+ /**
15
+ * Fetch the process table from the LSP into the store's `processes` Signal.
16
+ * Every outcome lands honestly ([PROF-UI-PROCESSES], #147): no running
17
+ * client stays "loading" (the serverState welcome owns the copy), a failure is
18
+ * "error", and only a successful fetch may render "No processes running".
19
+ */
20
+ export declare function fetchProcessesIntoStore(store: Store): Promise<void>;
21
+ /**
22
+ * Poll the LSP into the store while the panel is visible: an immediate fetch on
23
+ * becoming visible (no blank 2-second first paint), then one per interval. The
24
+ * returned disposable stops the timer and the visibility subscription.
25
+ */
26
+ export declare function bindProcessPolling(store: Store, treeView: Pick<vscode.TreeView<unknown>, "visible" | "onDidChangeVisibility">): vscode.Disposable;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ // Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
3
+ /**
4
+ * The store-side source of the Processes list (#148).
5
+ *
6
+ * The OS has no push event for "a process appeared", so the list is
7
+ * genuinely poll-sourced โ€” but per the architecture the poll belongs HERE,
8
+ * feeding the store's `processes` Signal, never inside the panel: the tree
9
+ * provider stays a pure projection of centralised state and owns no timer.
10
+ * Polling runs only while the panel is visible, so navigating away stops the
11
+ * LSP round-trips.
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.bindServerStateContextKey = exports.bindProcessesContextKey = void 0;
48
+ exports.fetchProcessesIntoStore = fetchProcessesIntoStore;
49
+ exports.bindProcessPolling = bindProcessPolling;
50
+ const vscode = __importStar(require("vscode"));
51
+ const ids_1 = require("./ids");
52
+ const logger_1 = require("./logger");
53
+ const failure_1 = require("./failure");
54
+ const server_command_1 = require("./server-command");
55
+ const wire_adapters_1 = require("./wire-adapters");
56
+ var process_context_keys_1 = require("./process-context-keys");
57
+ Object.defineProperty(exports, "bindProcessesContextKey", { enumerable: true, get: function () { return process_context_keys_1.bindProcessesContextKey; } });
58
+ Object.defineProperty(exports, "bindServerStateContextKey", { enumerable: true, get: function () { return process_context_keys_1.bindServerStateContextKey; } });
59
+ /** LSP command name ([PROF-WIRE-METHODS]). */
60
+ const LSP_CMD = (0, ids_1.lspTable)({ processes: "processes" });
61
+ /** Default poll interval (ms) when the setting is absent. */
62
+ const DEFAULT_REFRESH_MS = 2000;
63
+ /**
64
+ * Fetch the process table from the LSP into the store's `processes` Signal.
65
+ * Every outcome lands honestly ([PROF-UI-PROCESSES], #147): no running
66
+ * client stays "loading" (the serverState welcome owns the copy), a failure is
67
+ * "error", and only a successful fetch may render "No processes running".
68
+ */
69
+ async function fetchProcessesIntoStore(store) {
70
+ const client = store.client.value;
71
+ if (client?.isRunning() !== true) {
72
+ store.processesLoading();
73
+ return;
74
+ }
75
+ try {
76
+ const roots = (vscode.workspace.workspaceFolders ?? []).map((folder) => folder.uri.fsPath);
77
+ const result = await (0, server_command_1.executeServerCommand)(client, LSP_CMD.processes, { workspace_roots: roots });
78
+ store.processesLoaded((result?.processes ?? []).map((process) => (0, wire_adapters_1.toUiProcess)(process)));
79
+ }
80
+ catch (error) {
81
+ logger_1.Logger.error(`Processes fetch failed: ${(0, failure_1.errorText)(error)}`);
82
+ store.processesFetchFailed();
83
+ }
84
+ }
85
+ /**
86
+ * Poll the LSP into the store while the panel is visible: an immediate fetch on
87
+ * becoming visible (no blank 2-second first paint), then one per interval. The
88
+ * returned disposable stops the timer and the visibility subscription.
89
+ */
90
+ function bindProcessPolling(store, treeView) {
91
+ const poll = processPoll(store);
92
+ const subscription = treeView.onDidChangeVisibility((event) => {
93
+ if (event.visible) {
94
+ poll.start();
95
+ }
96
+ else {
97
+ poll.stop();
98
+ }
99
+ });
100
+ if (treeView.visible) {
101
+ poll.start();
102
+ }
103
+ return { dispose() { subscription.dispose(); poll.stop(); } };
104
+ }
105
+ /** A fetch now and then every configured interval, until stopped. */
106
+ function processPoll(store) {
107
+ let timer = undefined;
108
+ return {
109
+ start() {
110
+ if (timer !== undefined) {
111
+ return;
112
+ }
113
+ const intervalMs = vscode.workspace.getConfiguration((0, ids_1.configSection)()).get("profiler.processRefreshMs", DEFAULT_REFRESH_MS);
114
+ void fetchProcessesIntoStore(store);
115
+ timer = setInterval(() => { void fetchProcessesIntoStore(store); }, intervalMs);
116
+ },
117
+ stop() {
118
+ if (timer !== undefined) {
119
+ clearInterval(timer);
120
+ timer = undefined;
121
+ }
122
+ },
123
+ };
124
+ }
125
+ //# sourceMappingURL=process-poll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-poll.js","sourceRoot":"","sources":["../../src/process-poll.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,MAAY,MAAM,mCAAe;AACjC,+BAAgD;AAChD,qCAAkC;AAClC,uCAAsC;AACtC,qDAAwD;AAExD,mDAA8C;AAG9C,+DAA4F;AAAnF,+HAAA,uBAAuB,OAAA;AAAE,iIAAA,yBAAyB,OAAA;AAE3D,8CAA8C;AAC9C,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AK,CAAC,OAAO,EAAE,CAAC;YAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAAC,CAAC;aAAM,CAAC;YAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;IACvC,OAAO,EAAE,OAAO,KAAW,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,qEAAqE;AACrE,SAAS,WAAW,CAAC,KAAY;IAC/B,IAAI,KAAK,GAA+C,SAAS,CAAC;IAClE,OAAO;QACL,KAAK;YACH,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAAC,OAAO;YAAC,CAAC;YACpC,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAA,mBAAa,GAAE,CAAC,CAAC,GAAG,CAAS,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;YACnI,KAAK,uBAAuB,CAAC,KAAK,CAAC,CAAC;YACpC,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAClF,CAAC;QACD,IAAI;YACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAAC,KAAK,GAAG,SAAS,CAAC;YAAC,CAAC;QACvE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Makes the Processes panel react to the store's profiling state.
3
+ *
4
+ * One `effect` over `store.profiler` drives three things whenever a session
5
+ * starts, streams samples, or stops:
6
+ * 1. the view's native chrome โ€” a live message ("๐Ÿ”ฅ Profiling PID 1234 ยท
7
+ * 12.3K samples (4s)") and a badge dot;
8
+ * 2. the per-activity gating context keys (`<prefix>.profiler.cpuBusy` / `.memoryBusy`,
9
+ * plus the aggregate `.profilerBusy` and `.profiling` / `.memoryTracking` /
10
+ * `.profilerStarting`) that hide the matching "Run & Profile" launch and
11
+ * reveal the Stop affordances in package.json;
12
+ * 3. a tree repaint, so the actively-profiled row swaps its inline Profile
13
+ * button for a Stop button (the marker itself derives from the store's
14
+ * profiler signal inside the provider โ€” no pushed field, #148).
15
+ *
16
+ * The message/badge update on every change (cheap), but the context keys and
17
+ * the tree rebuild only fire when the *gating* state changes โ€” a per-second
18
+ * sample-count tick must not rebuild the whole tree.
19
+ */
20
+ import * as vscode from "vscode";
21
+ import type { ProfilerStore as Store } from "./store";
22
+ import type { ProfilerSession } from "./profiler-state";
23
+ import type { ProcessesProvider } from "./process-explorer";
24
+ /**
25
+ * Bind the panel to the store's profiling state. Returns a disposable that
26
+ * stops the effect and drops the seam reference.
27
+ */
28
+ export declare function bindProcessPanelReactivity(store: Store, treeView: vscode.TreeView<unknown>, provider: ProcessesProvider): vscode.Disposable;
29
+ /**
30
+ * Keep the store's "which PID is the active debuggee" marker in sync, so only
31
+ * that row exposes the inline Track Memory action ([PROF-UI-PROCESSES]).
32
+ * Memory tracking rides the DAP courier ([PROF-UI-MEMORY]), so it can only
33
+ * ever target the process of the active host-debug-type session โ€” never an
34
+ * external process in the list. The debuggee changes when the active session
35
+ * changes or when the DAP `process` event resolves its PID into the store's
36
+ * `sessionIdToPid` map, so react to both. Writing the store signal bumps
37
+ * `processesRevision`, which repaints every subscribed panel (#148).
38
+ */
39
+ export declare function bindDebuggeeTracking(store: Store): vscode.Disposable;
40
+ /**
41
+ * The live message shown above the tree, or undefined when idle. Pure so it can
42
+ * be asserted directly; the live view value is read via [`processesViewState`].
43
+ */
44
+ export declare function panelMessage(session: ProfilerSession): string | undefined;
45
+ /** A badge dot while busy (its tooltip mirrors the message), else none. */
46
+ export declare function panelBadge(session: ProfilerSession): vscode.ViewBadge | undefined;
47
+ /**
48
+ * The panel's live chrome, or `undefined`s when idle. E2e seam for
49
+ * [PROF-UI-PROCESSES]: TreeView message/badge are not otherwise
50
+ * readable once the view is owned by VS Code.
51
+ */
52
+ export declare function processesViewState(): {
53
+ message: string | undefined;
54
+ badge: number | undefined;
55
+ };