@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,70 @@
1
+ export interface ProfilerPalette {
2
+ readonly critical: string;
3
+ readonly hot: string;
4
+ readonly warm: string;
5
+ readonly memory: string;
6
+ readonly memoryHot: string;
7
+ readonly memoryWarm?: string;
8
+ readonly memoryCool?: string;
9
+ readonly leak: string;
10
+ readonly success: string;
11
+ }
12
+ export declare const DEFAULT_PALETTE: ProfilerPalette;
13
+ /** Bind host configuration; each render reads the current palette. */
14
+ export declare function configurePalette(read: () => ProfilerPalette): void;
15
+ export declare function profilerPalette(): ProfilerPalette;
16
+ /** Reject CSS injection and invalid overrides, retaining the host default. */
17
+ export declare function resolvePalette(base: ProfilerPalette, overrides: unknown): ProfilerPalette;
18
+ /**
19
+ * Every palette CSS variable with its value, and `--prof-hot-ink`, the text
20
+ * colour readable on the hot accent. A palette without a memory ramp ramps
21
+ * from its own memory accent, never the default's.
22
+ */
23
+ export declare function paletteVars(palette?: ProfilerPalette): Record<string, string>;
24
+ /** The palette as CSS variables, with the same names in every profiler view. */
25
+ export declare function paletteCss(palette?: ProfilerPalette): string;
26
+ /**
27
+ * Text that stays readable on `fill`, a six-digit hex colour: dark ink on a
28
+ * light fill, light ink on a dark one. Embedded in the flame webview, so it
29
+ * calls nothing else.
30
+ */
31
+ export declare function inkFor(fill: string): string;
32
+ /** The source classification a host that supplies none gets: a frame with a file is source. */
33
+ export declare function hasSourceFile(file: string): boolean;
34
+ /** A frame reduced to what decides its rank: its key, and where it came from. */
35
+ export interface FrameRank {
36
+ key: string;
37
+ i: number;
38
+ }
39
+ /**
40
+ * The frame ordering policy: by key, then by original index.
41
+ *
42
+ * The index term is not decoration. Two frames can share a file AND a name --
43
+ * one function inlined at two sites, or two runtime frames with no file at all
44
+ * -- and a comparator that answers 0 for those hands their order to whatever
45
+ * the engine does with elements it was told are equal. Rank is what picks a
46
+ * frame's colour, so an order the engine decides is a colour the engine
47
+ * decides, and the same profile stops looking the same twice.
48
+ *
49
+ * Exported because a sort's OUTPUT cannot tell this apart from a comparator
50
+ * with no tie-break at all: `Array.prototype.sort` is required to be stable,
51
+ * so equal elements come back in input order either way. The policy has to be
52
+ * asserted directly or it is not pinned.
53
+ */
54
+ export declare function byFrameKeyThenIndex(left: FrameRank, right: FrameRank): number;
55
+ /** Each frame's rank by (file, name): frame identity, never array order, picks its colour. */
56
+ export declare function frameRanks(frames: readonly {
57
+ file?: string;
58
+ name: string;
59
+ }[]): number[];
60
+ /** Stable frame ranks choose from the host ramp; unknown frames stay neutral. */
61
+ export declare function framePaletteColor(index: number, source: boolean, palette: ProfilerPalette): string;
62
+ /** CPU heat thresholds shared by canvas and source annotations. */
63
+ export declare function cpuHeatColor(pct: number, palette?: ProfilerPalette): string;
64
+ /** Every frame coloured from the host ramp by its rank. */
65
+ export declare function paletteFrames<Frame extends {
66
+ file: string;
67
+ name: string;
68
+ color: string;
69
+ source?: boolean;
70
+ }>(frames: Frame[], palette: ProfilerPalette): Frame[];
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_PALETTE = void 0;
4
+ exports.configurePalette = configurePalette;
5
+ exports.profilerPalette = profilerPalette;
6
+ exports.resolvePalette = resolvePalette;
7
+ exports.paletteVars = paletteVars;
8
+ exports.paletteCss = paletteCss;
9
+ exports.inkFor = inkFor;
10
+ exports.hasSourceFile = hasSourceFile;
11
+ exports.byFrameKeyThenIndex = byFrameKeyThenIndex;
12
+ exports.frameRanks = frameRanks;
13
+ exports.framePaletteColor = framePaletteColor;
14
+ exports.cpuHeatColor = cpuHeatColor;
15
+ exports.paletteFrames = paletteFrames;
16
+ // Implements [PROF-UI-PALETTE]. Pure, validated host palette shared by every surface.
17
+ // framePaletteColor, paletteFrames and everything they call are embedded in
18
+ // the flame webview by Function.prototype.toString (flame-script.ts), so they
19
+ // stay self-contained declarations that call only each other.
20
+ const unknown_shape_1 = require("./unknown-shape");
21
+ exports.DEFAULT_PALETTE = {
22
+ critical: "#e8500a", hot: "#f97316", warm: "#fbbf24",
23
+ memory: "#c084fc", memoryHot: "#a78bfa", memoryWarm: "#8b5cf6", memoryCool: "#7c3aed", leak: "#f87171", success: "#34d399",
24
+ };
25
+ /** The CSS variable each palette colour sets, in every profiler view and on every live repaint. */
26
+ const PALETTE_CSS_VARS = [
27
+ ["critical", "--prof-critical"], ["hot", "--prof-hot"], ["warm", "--prof-warm"], ["memory", "--prof-mem-critical"],
28
+ ["memoryHot", "--prof-mem-hot"], ["memoryWarm", "--prof-mem-warm"], ["memoryCool", "--prof-mem-cool"],
29
+ ["leak", "--prof-mem-leak"], ["success", "--prof-success"],
30
+ ];
31
+ /** A six-digit hex colour: the only override CSS can never be injected through. */
32
+ const HEX_COLOR = /^#[0-9a-f]{6}$/iu;
33
+ let readPalette = () => exports.DEFAULT_PALETTE;
34
+ /** Bind host configuration; each render reads the current palette. */
35
+ function configurePalette(read) { readPalette = read; }
36
+ function profilerPalette() { return readPalette(); }
37
+ /** Reject CSS injection and invalid overrides, retaining the host default. */
38
+ function resolvePalette(base, overrides) {
39
+ if (!(0, unknown_shape_1.isRecord)(overrides)) {
40
+ return base;
41
+ }
42
+ const pick = (key, fallback) => {
43
+ const value = overrides[key];
44
+ return typeof value === "string" && HEX_COLOR.test(value) ? value : fallback;
45
+ };
46
+ return {
47
+ critical: pick("critical", base.critical), hot: pick("hot", base.hot), warm: pick("warm", base.warm),
48
+ memory: pick("memory", base.memory), memoryHot: pick("memoryHot", base.memoryHot),
49
+ memoryWarm: pick("memoryWarm", base.memoryWarm ?? base.memoryHot), memoryCool: pick("memoryCool", base.memoryCool ?? base.memoryHot),
50
+ leak: pick("leak", base.leak), success: pick("success", base.success),
51
+ };
52
+ }
53
+ /**
54
+ * Every palette CSS variable with its value, and `--prof-hot-ink`, the text
55
+ * colour readable on the hot accent. A palette without a memory ramp ramps
56
+ * from its own memory accent, never the default's.
57
+ */
58
+ function paletteVars(palette = profilerPalette()) {
59
+ const valid = resolvePalette(exports.DEFAULT_PALETTE, { ...palette,
60
+ memoryWarm: palette.memoryWarm ?? palette.memoryHot, memoryCool: palette.memoryCool ?? palette.memoryHot });
61
+ const vars = PALETTE_CSS_VARS.map(([key, name]) => [name, valid[key] ?? valid.memoryHot]);
62
+ return { ...Object.fromEntries(vars), "--prof-hot-ink": inkFor(valid.hot) };
63
+ }
64
+ /** The palette as CSS variables, with the same names in every profiler view. */
65
+ function paletteCss(palette = profilerPalette()) {
66
+ return `:root { ${Object.entries(paletteVars(palette)).map(([name, value]) => `${name}: ${value};`).join(" ")} }`;
67
+ }
68
+ const COLOR_CHANNEL_MAX = 255;
69
+ const LUMA_RED = 0.2126;
70
+ const LUMA_GREEN = 0.7152;
71
+ const LUMA_BLUE = 0.0722;
72
+ const LUMA_THRESHOLD = 0.5;
73
+ const RED_CHANNEL_OFFSET = 1;
74
+ const GREEN_CHANNEL_OFFSET = 3;
75
+ const BLUE_CHANNEL_OFFSET = 5;
76
+ /**
77
+ * Text that stays readable on `fill`, a six-digit hex colour: dark ink on a
78
+ * light fill, light ink on a dark one. Embedded in the flame webview, so it
79
+ * calls nothing else.
80
+ */
81
+ function inkFor(fill) {
82
+ const channel = (at) => Number.parseInt(fill.slice(at, at + 2), 16) / COLOR_CHANNEL_MAX;
83
+ const luma = LUMA_RED * channel(RED_CHANNEL_OFFSET) + LUMA_GREEN * channel(GREEN_CHANNEL_OFFSET) + LUMA_BLUE * channel(BLUE_CHANNEL_OFFSET);
84
+ return luma < LUMA_THRESHOLD ? "rgba(245, 245, 245, 0.95)" : "rgba(15, 15, 15, 0.9)";
85
+ }
86
+ /** The source classification a host that supplies none gets: a frame with a file is source. */
87
+ function hasSourceFile(file) {
88
+ return file !== "";
89
+ }
90
+ /**
91
+ * The frame ordering policy: by key, then by original index.
92
+ *
93
+ * The index term is not decoration. Two frames can share a file AND a name --
94
+ * one function inlined at two sites, or two runtime frames with no file at all
95
+ * -- and a comparator that answers 0 for those hands their order to whatever
96
+ * the engine does with elements it was told are equal. Rank is what picks a
97
+ * frame's colour, so an order the engine decides is a colour the engine
98
+ * decides, and the same profile stops looking the same twice.
99
+ *
100
+ * Exported because a sort's OUTPUT cannot tell this apart from a comparator
101
+ * with no tie-break at all: `Array.prototype.sort` is required to be stable,
102
+ * so equal elements come back in input order either way. The policy has to be
103
+ * asserted directly or it is not pinned.
104
+ */
105
+ function byFrameKeyThenIndex(left, right) {
106
+ if (left.key < right.key) {
107
+ return -1;
108
+ }
109
+ if (left.key > right.key) {
110
+ return 1;
111
+ }
112
+ return left.i - right.i;
113
+ }
114
+ /** Each frame's rank by (file, name): frame identity, never array order, picks its colour. */
115
+ function frameRanks(frames) {
116
+ const ranks = Array.from({ length: frames.length }, () => 0);
117
+ const keyed = frames.map((frame, index) => ({ key: `${frame.file ?? ""}\u0000${frame.name}`, i: index }));
118
+ for (const [rank, entry] of keyed.toSorted(byFrameKeyThenIndex).entries()) {
119
+ ranks[entry.i] = rank;
120
+ }
121
+ return ranks;
122
+ }
123
+ const RAMP_SIZE = 3;
124
+ /** Stable frame ranks choose from the host ramp; unknown frames stay neutral. */
125
+ function framePaletteColor(index, source, palette) {
126
+ return source ? [palette.critical, palette.hot, palette.warm][index % RAMP_SIZE] : "#78818b";
127
+ }
128
+ const CPU_HEAT_HIGH = 20;
129
+ const CPU_HEAT_MEDIUM = 10;
130
+ const CPU_HEAT_LOW = 5;
131
+ /** CPU heat thresholds shared by canvas and source annotations. */
132
+ function cpuHeatColor(pct, palette = profilerPalette()) {
133
+ if (pct >= CPU_HEAT_HIGH) {
134
+ return palette.critical;
135
+ }
136
+ if (pct >= CPU_HEAT_MEDIUM) {
137
+ return palette.hot;
138
+ }
139
+ if (pct >= CPU_HEAT_LOW) {
140
+ return palette.warm;
141
+ }
142
+ return "#88888899";
143
+ }
144
+ /** Every frame coloured from the host ramp by its rank. */
145
+ function paletteFrames(frames, palette) {
146
+ const ranks = frameRanks(frames);
147
+ return frames.map((frame, index) => ({ ...frame,
148
+ color: framePaletteColor(ranks[index] ?? index, frame.source ?? hasSourceFile(frame.file), palette) }));
149
+ }
150
+ //# sourceMappingURL=palette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette.js","sourceRoot":"","sources":["../../src/palette.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sFAAsF;AACtF,4EAA4E;AAC5E,8EAA8E;AAC9E,8DAA8D;AAC9D,mDAA2C;AAc9B,QAAA,eAAe,GAAoB;IAC9C,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS;IACpD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EA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E,CAAC;AAC3B,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,mEAAmE;AACnE,sBAA6B,GAAW,EAAE,OAAO,GAAG,eAAe,EAAE;IACnE,IAAI,GAAG,IAAI,aAAa,EAAE,CAAC;QAAC,OAAO,OAAO,CAAC,QAAQ,CAAC;IAAC,CAAC;IACtD,IAAI,GAAG,IAAI,eAAe,EAAE,CAAC;QAAC,OAAO,OAAO,CAAC,GAAG,CAAC;IAAC,CAAC;IACnD,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QAAC,OAAO,OAAO,CAAC,IAAI,CAAC;IAAC,CAAC;IACjD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,2DAA2D;AAC3D,uBAA6G,MAAe,EAAE,OAAwB;IACpJ,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK;QAC7C,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,KAAK,CAAC,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as vscode from "vscode";
2
+ import type { ProcessesProvider } from "./process-explorer";
3
+ import type { TreeItem } from "./process-explorer-rows";
4
+ import type { ProfilerStore as Store } from "./store";
5
+ /**
6
+ * The panel is a pure projection of centralised state (#148): the store-side
7
+ * poll feeds `store.processes` while the view is visible, the revision
8
+ * subscription repaints on every store change, and the context-key mirror
9
+ * keeps the welcome's loading/error/empty copy honest (#147).
10
+ */
11
+ export declare function bindPanel(store: Store, treeView: vscode.TreeView<TreeItem>, provider: ProcessesProvider): void;
@@ -0,0 +1,65 @@
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.bindPanel = bindPanel;
37
+ // Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
38
+ const vscode = __importStar(require("vscode"));
39
+ const process_poll_1 = require("./process-poll");
40
+ const process_reactivity_1 = require("./process-reactivity");
41
+ const reactive_refresh_1 = require("./reactive-refresh");
42
+ const process_decoration_1 = require("./process-decoration");
43
+ /**
44
+ * The panel is a pure projection of centralised state (#148): the store-side
45
+ * poll feeds `store.processes` while the view is visible, the revision
46
+ * subscription repaints on every store change, and the context-key mirror
47
+ * keeps the welcome's loading/error/empty copy honest (#147).
48
+ */
49
+ function bindPanel(store, treeView, provider) {
50
+ provider.disposables.push((0, process_poll_1.bindProcessPolling)(store, treeView), (0, process_poll_1.bindProcessesContextKey)(store), (0, process_poll_1.bindServerStateContextKey)(store));
51
+ (0, reactive_refresh_1.subscribeRevision)(store.processesRevision, provider);
52
+ // React to the store's profiling state: live chrome, button-gating context
53
+ // keys, and the active-row repaint ([PROF-UI-PROCESSES]).
54
+ provider.disposables.push(
55
+ // React to the store's profiling state: live chrome, button-gating context
56
+ // keys, and the active-row repaint ([PROF-UI-PROCESSES]).
57
+ (0, process_reactivity_1.bindProcessPanelReactivity)(store, treeView, provider),
58
+ // Reveal the inline Track Memory action only on the active debuggee row
59
+ // ([PROF-UI-PROCESSES]) — memory tracking can't target external processes.
60
+ (0, process_reactivity_1.bindDebuggeeTracking)(store));
61
+ // Colour workspace rows green and non-debuggable rows grey ([PROF-UI-PROCESSES]).
62
+ const decorations = new process_decoration_1.ProcessDecorationProvider(provider);
63
+ provider.disposables.push(decorations, vscode.window.registerFileDecorationProvider(decorations));
64
+ }
65
+ //# sourceMappingURL=process-bind-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-bind-panel.js","sourceRoot":"","sources":["../../src/process-bind-panel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsE;AACtE,MAAY,MAAM,mCAAe;AAGjC,iDAAwG;AACxG,6DAAwF;AACxF,yDAAuD;AACvD,6DAAiE;AAGjE;;;;;GAKG;AACH,mBAA0B,KAAY,EAAE,QAAmC,EAAE,QAA2B;IACtG,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,IAAA,iCAAkB,EAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,IAAA,sCAAuB,EAAC,KAAK,CAAC,EAAE,IAAA,wCAAyB,EAAC,KAAK,CAAC,CAAC,CAAC;IACjI,IAAA,oCAAiB,EAAC,KAAK,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACrD,2EAA2E;IAC3E,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,CAAC,IAAI;IACvB,2EAA2E;IAC3E,0DAA0D;IAC1D,IAAA,+CAA0B,EAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;IACrD,wEAAwE;IACxE,2EAA2E;IAC3E,IAAA,yCAAoB,EAAC,KAAK,CAAC,CAC5B,CAAC;IACF,kFAAkF;IAClF,MAAM,WAAW,GAAG,IAAI,8CAAyB,CAAC,QAAQ,CAAC,CAAC;IAC5D,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC,CAAC;AACpG,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as vscode from "vscode";
2
+ import type { ProcessesProvider } from "./process-explorer";
3
+ import type { ProfilerStore as Store } from "./store";
4
+ /** The view's toolbar commands and the per-row actions. */
5
+ export declare function registerViewCommands(store: Store, provider: ProcessesProvider): vscode.Disposable[];
@@ -0,0 +1,112 @@
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.registerViewCommands = registerViewCommands;
37
+ // Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
38
+ const vscode = __importStar(require("vscode"));
39
+ const ids_1 = require("./ids");
40
+ const failure_1 = require("./failure");
41
+ const server_command_1 = require("./server-command");
42
+ const process_poll_1 = require("./process-poll");
43
+ const progress_ops_1 = require("./progress-ops");
44
+ /** The view's toolbar commands and the per-row actions. */
45
+ function registerViewCommands(store, provider) {
46
+ return [
47
+ // Manual refresh runs under the view's progress bar so the click visibly
48
+ // does something; returns the promise so callers/tests can await it.
49
+ vscode.commands.registerCommand((0, ids_1.cmd)("refreshProcesses"), async () => { await (0, progress_ops_1.withViewProgress)((0, ids_1.viewId)(), "Refresh processes", async () => { await provider.refreshNow(); }); }),
50
+ vscode.commands.registerCommand((0, ids_1.cmd)("sortProcesses"), () => { provider.cycleSortMode(); }),
51
+ vscode.commands.registerCommand((0, ids_1.cmd)("groupProcesses"), () => { provider.cycleGroupMode(); }),
52
+ ...registerRowCommands(store, provider),
53
+ ];
54
+ }
55
+ /** The filter and the per-row actions: kill, copy PID, reveal the entry script. */
56
+ function registerRowCommands(store, provider) {
57
+ return [
58
+ vscode.commands.registerCommand((0, ids_1.cmd)("filterProcesses"), async () => {
59
+ const input = await vscode.window.showInputBox({ prompt: "Filter processes by name, script, or PID", placeHolder: "e.g. uvicorn" });
60
+ provider.setFilter(input ?? "");
61
+ }),
62
+ vscode.commands.registerCommand((0, ids_1.cmd)("killProcess"), async (item) => { await killProcess(store, item); }),
63
+ vscode.commands.registerCommand((0, ids_1.cmd)("copyProcessPid"), (item) => {
64
+ if (item !== undefined) {
65
+ void vscode.env.clipboard.writeText(String(item.process.pid));
66
+ vscode.window.showInformationMessage(`${(0, ids_1.brand)()}: Copied PID ${String(item.process.pid)}`);
67
+ }
68
+ }),
69
+ vscode.commands.registerCommand((0, ids_1.cmd)("revealProcessScript"), (item) => { revealProcessScript(store, item); }),
70
+ ];
71
+ }
72
+ function revealProcessScript(store, item) {
73
+ const scriptPath = item?.process.script;
74
+ if (typeof scriptPath === "string" && store.sourceEntries(item?.process.runtime ?? "")) {
75
+ void vscode.window.showTextDocument(vscode.Uri.file(scriptPath));
76
+ }
77
+ else {
78
+ vscode.window.showInformationMessage(`${(0, ids_1.brand)()}: This process has no entry file to reveal.`);
79
+ }
80
+ }
81
+ /**
82
+ * Kill a row's process after a modal confirmation; the server refuses PIDs it
83
+ * does not recognise as profilable, so this can never hit the editor itself.
84
+ */
85
+ async function killProcess(store, item) {
86
+ const client = store.client.value;
87
+ if (item === undefined || client?.isRunning() !== true) {
88
+ return;
89
+ }
90
+ if (!await confirmKill(item)) {
91
+ return;
92
+ }
93
+ await performKill(store, client, item);
94
+ }
95
+ /** Ask the user to confirm terminating the row's process. */
96
+ async function confirmKill(item) {
97
+ const question = `${(0, ids_1.brand)()}: Kill process ${item.process.name} (PID ${String(item.process.pid)})? It will be terminated immediately.`;
98
+ const choice = await vscode.window.showWarningMessage(question, { modal: true }, "Kill");
99
+ return choice === "Kill";
100
+ }
101
+ /** Send the kill command and refresh the panel, surfacing any server refusal. */
102
+ async function performKill(store, client, item) {
103
+ try {
104
+ await (0, server_command_1.executeServerCommand)(client, (0, ids_1.lsp)("kill"), { pid: item.process.pid });
105
+ vscode.window.showInformationMessage(`${(0, ids_1.brand)()}: Killed PID ${String(item.process.pid)}.`);
106
+ await (0, process_poll_1.fetchProcessesIntoStore)(store);
107
+ }
108
+ catch (error) {
109
+ vscode.window.showErrorMessage(`${(0, ids_1.brand)()}: ${(0, failure_1.errorText)(error)}`);
110
+ }
111
+ }
112
+ //# sourceMappingURL=process-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-commands.js","sourceRoot":"","sources":["../../src/process-commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsE;AACtE,MAAY,MAAM,mCAAe;AACjC,+BAAgD;AAIhD,uCAAsC;AACtC,qDAAwD;AACxD,iDAAyD;AACzD,iDAAkD;AAElD,2DAA2D;AAC3D,8BAAqC,KAAY,EAAE,QAA2B;IAC5E,OAAO;QACL,yEAAyE;QACzE,qEAAqE;QACrE,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,kBAAkB,CAAC,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,IAAA,+BAAgB,EAAC,IAAA,YAAM,GAAE,EAAE,mBAAmB,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9K,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1F,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5F,GAAG,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC;KACxC,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,SAAS,mBAAmB,CAAC,KAAY,EAAE,QAA2B;IACpE,OAAO;QACL,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,SAAG,EAAC,iBAAiB,CAAC,EAAE,KAAK,IAAI,EAAE;YACjE,MAAM,KAAK,GAAG,MA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,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACpF,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG,IAAA,WAAK,GAAE,gBAAgB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5F,MAAM,IAAA,sCAAuB,EAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAA,WAAK,GAAE,KAAK,IAAA,mBAAS,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type * as vscode from "vscode";
2
+ import type { ProfilerStore as Store } from "./store";
3
+ /** Mirror the language client's state to `<prefix>.profiler.serverState` so the welcome copy is honest. */
4
+ export declare function bindServerStateContextKey(store: Store): vscode.Disposable;
5
+ /**
6
+ * Mirror the store's fetch state to the `<prefix>.profiler.processesState` context key
7
+ * that gates the welcome's loading/error/empty copy (#147). Reactive: the
8
+ * effect re-fires whenever the store's process state changes, including the
9
+ * initial "loading" seed.
10
+ */
11
+ export declare function bindProcessesContextKey(store: Store): vscode.Disposable;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bindServerStateContextKey = bindServerStateContextKey;
4
+ exports.bindProcessesContextKey = bindProcessesContextKey;
5
+ const context_keys_1 = require("./context-keys");
6
+ const signals_core_1 = require("@preact/signals-core");
7
+ const node_1 = require("vscode-languageclient/node");
8
+ /** Mirror the language client's state to `<prefix>.profiler.serverState` so the welcome copy is honest. */
9
+ function bindServerStateContextKey(store) {
10
+ let subscription = undefined;
11
+ const disposeEffect = (0, signals_core_1.effect)(() => {
12
+ const client = store.client.value;
13
+ subscription?.dispose();
14
+ subscription = client?.onDidChangeState(() => { publishClientState(client); });
15
+ publishClientState(client);
16
+ });
17
+ return { dispose() { disposeEffect(); subscription?.dispose(); } };
18
+ }
19
+ /** Mirror one client's connection state to the `<prefix>.profiler.serverState` context key. */
20
+ function publishClientState(client) {
21
+ (0, context_keys_1.setContextKey)("serverState", clientStateLabel(client));
22
+ }
23
+ /** The welcome copy's label for a language client's connection state. */
24
+ function clientStateLabel(client) {
25
+ if (client === undefined) {
26
+ return "starting";
27
+ }
28
+ if (client.state === node_1.State.Running) {
29
+ return "running";
30
+ }
31
+ if (client.state === node_1.State.Stopped) {
32
+ return "stopped";
33
+ }
34
+ return "starting";
35
+ }
36
+ /**
37
+ * Mirror the store's fetch state to the `<prefix>.profiler.processesState` context key
38
+ * that gates the welcome's loading/error/empty copy (#147). Reactive: the
39
+ * effect re-fires whenever the store's process state changes, including the
40
+ * initial "loading" seed.
41
+ */
42
+ function bindProcessesContextKey(store) {
43
+ const dispose = (0, signals_core_1.effect)(() => {
44
+ (0, context_keys_1.setContextKey)("processesState", store.processes.value.fetch);
45
+ });
46
+ return { dispose };
47
+ }
48
+ //# sourceMappingURL=process-context-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-context-keys.js","sourceRoot":"","sources":["../../src/process-context-keys.ts"],"names":[],"mappings":";;;;AAEA,iDAA+C;AAC/C,uDAA8C;AAC9C,qDAAmD;AAInD,2GAA2G;AAC3G,mCAA0C,KAAY;IACpD,IAAI,YAAY,GAAkC,SAAS,CAAC;IAC5D,MAAM,aAAa,GAAG,IAAA,qBAAM,EAAC,GAAG,EAAE;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;QAClC,YAAY,EAAE,OAAO,EAAE,CAAC;QACxB,YAAY,GAAG,MAAM,EAAE,gBAAgB,CAAC,GAAG,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/E,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,KAAW,aAAa,EAAE,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED,+FAA+F;AAC/F,SAAS,kBAAkB,CAAC,MAAkC;IAC5D,IAAA,4BAAa,EAAC,aAAa,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,yEAAyE;AACzE,SAAS,gBAAgB,CAAC,MAAkC;IAC1D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IAChD,IAAI,MAAM,CAAC,KAAK,KAAK,YAAK,CAAC,OAAO,EAAE,CAAC;QAAC,OAAO,SAAS,CAAC;IAAC,CAAC;IACzD,IAAI,MAAM,CAAC,KAAK,KAAK,YAAK,CAAC,OAAO,EAAE,CAAC;QAAC,OAAO,SAAS,CAAC;IAAC,CAAC;IACzD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,iCAAwC,KAAY;IAClD,MAAM,OAAO,GAAG,IAAA,qBAAM,EAAC,GAAG,EAAE;QAC1B,IAAA,4BAAa,EAAC,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as vscode from "vscode";
2
+ import type { ProcessesProvider } from "./process-explorer";
3
+ /**
4
+ * Colours whole process-row labels green (workspace) or grey (non-debuggable),
5
+ * keyed on the synthetic `<prefix>-process:` URI each row carries — the only way
6
+ * to tint a tree item's full label. Implements [PROF-UI-PROCESSES].
7
+ *
8
+ * Greying wins over green: a process you cannot debug is never shown as an
9
+ * actionable workspace row.
10
+ */
11
+ export declare class ProcessDecorationProvider implements vscode.FileDecorationProvider, vscode.Disposable {
12
+ private readonly emitter;
13
+ readonly onDidChangeFileDecorations: vscode.Event<undefined>;
14
+ private readonly subscription;
15
+ constructor(provider: ProcessesProvider);
16
+ provideFileDecoration(uri: vscode.Uri): vscode.FileDecoration | undefined;
17
+ dispose(): void;
18
+ }
@@ -0,0 +1,76 @@
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.ProcessDecorationProvider = void 0;
37
+ // Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
38
+ const vscode = __importStar(require("vscode"));
39
+ const ids_1 = require("./ids");
40
+ /**
41
+ * Colours whole process-row labels green (workspace) or grey (non-debuggable),
42
+ * keyed on the synthetic `<prefix>-process:` URI each row carries — the only way
43
+ * to tint a tree item's full label. Implements [PROF-UI-PROCESSES].
44
+ *
45
+ * Greying wins over green: a process you cannot debug is never shown as an
46
+ * actionable workspace row.
47
+ */
48
+ class ProcessDecorationProvider {
49
+ emitter = new vscode.EventEmitter();
50
+ onDidChangeFileDecorations = this.emitter.event;
51
+ subscription;
52
+ constructor(provider) {
53
+ // Rows are recreated on every refresh with state baked into their URI query;
54
+ // re-query decorations whenever the tree repaints so colours never go stale.
55
+ this.subscription = provider.onDidChangeTreeData(() => { this.emitter.fire(undefined); });
56
+ }
57
+ provideFileDecoration(uri) {
58
+ if (uri.scheme !== (0, ids_1.processUriScheme)()) {
59
+ return undefined;
60
+ }
61
+ const params = new URLSearchParams(uri.query);
62
+ if (params.get("dbg") === "0") {
63
+ return { color: new vscode.ThemeColor("disabledForeground"), tooltip: "Can't profile" };
64
+ }
65
+ if (params.get("ws") === "1") {
66
+ return { color: new vscode.ThemeColor("charts.green"), tooltip: "Workspace process" };
67
+ }
68
+ return undefined;
69
+ }
70
+ dispose() {
71
+ this.subscription.dispose();
72
+ this.emitter.dispose();
73
+ }
74
+ }
75
+ exports.ProcessDecorationProvider = ProcessDecorationProvider;
76
+ //# sourceMappingURL=process-decoration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-decoration.js","sourceRoot":"","sources":["../../src/process-decoration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsE;AACtE,MAAY,MAAM,mCAAe;AACjC,+BAAyC;AAGzC;;;;;;;GAOG;AACH;IACmB,OAAO,GAAG,IAAI,MAAM,CAAC,YAAY,EAAa,CAAC;IAChD,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC/C,YAAY,CAAoB;IAEjD,YAAmB,QAA2B;QAC5C,6EAA6E;QAC7E,6EAA6E;QAC7E,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,mBAAmB,CAAC,GAAG,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