@oddsquad/vite-plugin-lit 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/LICENSE +1 -1
  3. package/README.md +40 -17
  4. package/bin.mjs +89 -13
  5. package/client.d.ts +0 -6
  6. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-F2EfZsFX.js → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js} +2 -2
  7. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-F2EfZsFX.js.map → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js.map} +1 -1
  8. package/dist/client/assets/{index-B2HYO7lk.js → index-CgkhETVR.js} +22 -145
  9. package/dist/client/assets/index-CgkhETVR.js.map +1 -0
  10. package/dist/client/index.html +1 -1
  11. package/dist/standalone/lit-devtools.js +6717 -0
  12. package/index.d.ts +0 -5
  13. package/index.d.ts.map +1 -1
  14. package/index.js +1 -5
  15. package/index.js.map +1 -1
  16. package/lib/color-scheme.d.ts +0 -5
  17. package/lib/color-scheme.d.ts.map +1 -1
  18. package/lib/color-scheme.js +0 -5
  19. package/lib/color-scheme.js.map +1 -1
  20. package/lib/confine.d.ts +0 -5
  21. package/lib/confine.d.ts.map +1 -1
  22. package/lib/confine.js +0 -5
  23. package/lib/confine.js.map +1 -1
  24. package/lib/devframe/allowed-origins.d.ts +21 -0
  25. package/lib/devframe/allowed-origins.d.ts.map +1 -0
  26. package/lib/devframe/allowed-origins.js +58 -0
  27. package/lib/devframe/allowed-origins.js.map +1 -0
  28. package/lib/devframe/definition.d.ts +7 -3
  29. package/lib/devframe/definition.d.ts.map +1 -1
  30. package/lib/devframe/definition.js +1 -6
  31. package/lib/devframe/definition.js.map +1 -1
  32. package/lib/devframe/icon.d.ts +0 -5
  33. package/lib/devframe/icon.d.ts.map +1 -1
  34. package/lib/devframe/icon.js +0 -5
  35. package/lib/devframe/icon.js.map +1 -1
  36. package/lib/devframe/launch-editor.d.ts +0 -5
  37. package/lib/devframe/launch-editor.d.ts.map +1 -1
  38. package/lib/devframe/launch-editor.js +0 -5
  39. package/lib/devframe/launch-editor.js.map +1 -1
  40. package/lib/devframe/paths.d.ts +8 -3
  41. package/lib/devframe/paths.d.ts.map +1 -1
  42. package/lib/devframe/paths.js +0 -5
  43. package/lib/devframe/paths.js.map +1 -1
  44. package/lib/devframe/protocol.d.ts +6 -3
  45. package/lib/devframe/protocol.d.ts.map +1 -1
  46. package/lib/devframe/protocol.js +0 -5
  47. package/lib/devframe/protocol.js.map +1 -1
  48. package/lib/devframe/rpc-source.d.ts +15 -3
  49. package/lib/devframe/rpc-source.d.ts.map +1 -1
  50. package/lib/devframe/rpc-source.js +0 -5
  51. package/lib/devframe/rpc-source.js.map +1 -1
  52. package/lib/devframe/source.d.ts +0 -5
  53. package/lib/devframe/source.d.ts.map +1 -1
  54. package/lib/devframe/source.js +7 -3
  55. package/lib/devframe/source.js.map +1 -1
  56. package/lib/devframe/vite.d.ts +0 -5
  57. package/lib/devframe/vite.d.ts.map +1 -1
  58. package/lib/devframe/vite.js +16 -3
  59. package/lib/devframe/vite.js.map +1 -1
  60. package/lib/http.d.ts +0 -5
  61. package/lib/http.d.ts.map +1 -1
  62. package/lib/http.js +0 -5
  63. package/lib/http.js.map +1 -1
  64. package/lib/icons.d.ts +0 -5
  65. package/lib/icons.d.ts.map +1 -1
  66. package/lib/icons.js +0 -5
  67. package/lib/icons.js.map +1 -1
  68. package/lib/options.d.ts +26 -5
  69. package/lib/options.d.ts.map +1 -1
  70. package/lib/options.js +19 -5
  71. package/lib/options.js.map +1 -1
  72. package/lib/override-baselines.d.ts +0 -5
  73. package/lib/override-baselines.d.ts.map +1 -1
  74. package/lib/override-baselines.js +0 -5
  75. package/lib/override-baselines.js.map +1 -1
  76. package/lib/plugin.d.ts +0 -5
  77. package/lib/plugin.d.ts.map +1 -1
  78. package/lib/plugin.js +3 -5
  79. package/lib/plugin.js.map +1 -1
  80. package/lib/plugins/css-literals.d.ts +0 -5
  81. package/lib/plugins/css-literals.d.ts.map +1 -1
  82. package/lib/plugins/css-literals.js +0 -5
  83. package/lib/plugins/css-literals.js.map +1 -1
  84. package/lib/plugins/css-queries.d.ts +0 -5
  85. package/lib/plugins/css-queries.d.ts.map +1 -1
  86. package/lib/plugins/css-queries.js +0 -5
  87. package/lib/plugins/css-queries.js.map +1 -1
  88. package/lib/plugins/open-in-editor.d.ts +0 -5
  89. package/lib/plugins/open-in-editor.d.ts.map +1 -1
  90. package/lib/plugins/open-in-editor.js +0 -5
  91. package/lib/plugins/open-in-editor.js.map +1 -1
  92. package/lib/plugins/private-fields.d.ts +22 -0
  93. package/lib/plugins/private-fields.d.ts.map +1 -0
  94. package/lib/plugins/private-fields.js +254 -0
  95. package/lib/plugins/private-fields.js.map +1 -0
  96. package/lib/plugins/shared.d.ts +0 -5
  97. package/lib/plugins/shared.d.ts.map +1 -1
  98. package/lib/plugins/shared.js +0 -5
  99. package/lib/plugins/shared.js.map +1 -1
  100. package/lib/plugins/timeline-virtual.d.ts +0 -5
  101. package/lib/plugins/timeline-virtual.d.ts.map +1 -1
  102. package/lib/plugins/timeline-virtual.js +0 -5
  103. package/lib/plugins/timeline-virtual.js.map +1 -1
  104. package/lib/runtime/child-state.d.ts +95 -0
  105. package/lib/runtime/child-state.d.ts.map +1 -0
  106. package/lib/runtime/child-state.js +461 -0
  107. package/lib/runtime/child-state.js.map +1 -0
  108. package/lib/runtime/css.d.ts +14 -3
  109. package/lib/runtime/css.d.ts.map +1 -1
  110. package/lib/runtime/css.js +3 -5
  111. package/lib/runtime/css.js.map +1 -1
  112. package/lib/runtime/edge-panel.d.ts +8 -3
  113. package/lib/runtime/edge-panel.d.ts.map +1 -1
  114. package/lib/runtime/edge-panel.js +0 -5
  115. package/lib/runtime/edge-panel.js.map +1 -1
  116. package/lib/runtime/fonts.d.ts +0 -5
  117. package/lib/runtime/fonts.d.ts.map +1 -1
  118. package/lib/runtime/fonts.js +0 -5
  119. package/lib/runtime/fonts.js.map +1 -1
  120. package/lib/runtime/indicator.d.ts +3 -3
  121. package/lib/runtime/indicator.js +0 -5
  122. package/lib/runtime/indicator.js.map +1 -1
  123. package/lib/runtime/inspector/collect.d.ts +3 -3
  124. package/lib/runtime/inspector/collect.d.ts.map +1 -1
  125. package/lib/runtime/inspector/collect.js +0 -5
  126. package/lib/runtime/inspector/collect.js.map +1 -1
  127. package/lib/runtime/inspector/highlight.d.ts +10 -3
  128. package/lib/runtime/inspector/highlight.d.ts.map +1 -1
  129. package/lib/runtime/inspector/highlight.js +0 -5
  130. package/lib/runtime/inspector/highlight.js.map +1 -1
  131. package/lib/runtime/inspector/install.d.ts +6 -3
  132. package/lib/runtime/inspector/install.d.ts.map +1 -1
  133. package/lib/runtime/inspector/install.js +4 -6
  134. package/lib/runtime/inspector/install.js.map +1 -1
  135. package/lib/runtime/inspector/serialize.d.ts +4 -3
  136. package/lib/runtime/inspector/serialize.d.ts.map +1 -1
  137. package/lib/runtime/inspector/serialize.js +0 -5
  138. package/lib/runtime/inspector/serialize.js.map +1 -1
  139. package/lib/runtime/intern.d.ts +11 -3
  140. package/lib/runtime/intern.d.ts.map +1 -1
  141. package/lib/runtime/intern.js +11 -3
  142. package/lib/runtime/intern.js.map +1 -1
  143. package/lib/runtime/overrides.d.ts +3 -3
  144. package/lib/runtime/overrides.d.ts.map +1 -1
  145. package/lib/runtime/overrides.js +0 -5
  146. package/lib/runtime/overrides.js.map +1 -1
  147. package/lib/runtime/page-channel.d.ts +0 -5
  148. package/lib/runtime/page-channel.d.ts.map +1 -1
  149. package/lib/runtime/page-channel.js +13 -3
  150. package/lib/runtime/page-channel.js.map +1 -1
  151. package/lib/runtime/patch.d.ts +22 -3
  152. package/lib/runtime/patch.d.ts.map +1 -1
  153. package/lib/runtime/patch.js +22 -6
  154. package/lib/runtime/patch.js.map +1 -1
  155. package/lib/runtime/rpc-transport.d.ts +21 -3
  156. package/lib/runtime/rpc-transport.d.ts.map +1 -1
  157. package/lib/runtime/rpc-transport.js +4 -5
  158. package/lib/runtime/rpc-transport.js.map +1 -1
  159. package/lib/runtime/source-meta.d.ts +0 -5
  160. package/lib/runtime/source-meta.d.ts.map +1 -1
  161. package/lib/runtime/source-meta.js +0 -5
  162. package/lib/runtime/source-meta.js.map +1 -1
  163. package/lib/runtime/source-overlay/editors.d.ts +0 -5
  164. package/lib/runtime/source-overlay/editors.d.ts.map +1 -1
  165. package/lib/runtime/source-overlay/editors.js +9 -9
  166. package/lib/runtime/source-overlay/editors.js.map +1 -1
  167. package/lib/runtime/source-overlay/mask-path.d.ts +0 -5
  168. package/lib/runtime/source-overlay/mask-path.d.ts.map +1 -1
  169. package/lib/runtime/source-overlay/mask-path.js +0 -5
  170. package/lib/runtime/source-overlay/mask-path.js.map +1 -1
  171. package/lib/runtime/source-overlay/overlay-element.d.ts +0 -5
  172. package/lib/runtime/source-overlay/overlay-element.d.ts.map +1 -1
  173. package/lib/runtime/source-overlay/overlay-element.js +0 -5
  174. package/lib/runtime/source-overlay/overlay-element.js.map +1 -1
  175. package/lib/runtime/source-overlay/source-host.d.ts +0 -5
  176. package/lib/runtime/source-overlay/source-host.d.ts.map +1 -1
  177. package/lib/runtime/source-overlay/source-host.js +0 -5
  178. package/lib/runtime/source-overlay/source-host.js.map +1 -1
  179. package/lib/runtime/source-overlay/template.d.ts +0 -5
  180. package/lib/runtime/source-overlay/template.d.ts.map +1 -1
  181. package/lib/runtime/source-overlay/template.js +0 -5
  182. package/lib/runtime/source-overlay/template.js.map +1 -1
  183. package/lib/runtime/source-overlay.d.ts +0 -5
  184. package/lib/runtime/source-overlay.d.ts.map +1 -1
  185. package/lib/runtime/source-overlay.js +0 -5
  186. package/lib/runtime/source-overlay.js.map +1 -1
  187. package/lib/runtime/standalone.d.ts +22 -0
  188. package/lib/runtime/standalone.d.ts.map +1 -0
  189. package/lib/runtime/standalone.js +45 -0
  190. package/lib/runtime/standalone.js.map +1 -0
  191. package/lib/runtime/timeline/chrome-tracks.d.ts +0 -5
  192. package/lib/runtime/timeline/chrome-tracks.d.ts.map +1 -1
  193. package/lib/runtime/timeline/chrome-tracks.js +5 -3
  194. package/lib/runtime/timeline/chrome-tracks.js.map +1 -1
  195. package/lib/runtime/timeline/clock.d.ts +7 -3
  196. package/lib/runtime/timeline/clock.d.ts.map +1 -1
  197. package/lib/runtime/timeline/clock.js +0 -5
  198. package/lib/runtime/timeline/clock.js.map +1 -1
  199. package/lib/runtime/timeline/flash.d.ts +0 -5
  200. package/lib/runtime/timeline/flash.d.ts.map +1 -1
  201. package/lib/runtime/timeline/flash.js +15 -3
  202. package/lib/runtime/timeline/flash.js.map +1 -1
  203. package/lib/runtime/timeline/identity.d.ts +0 -5
  204. package/lib/runtime/timeline/identity.d.ts.map +1 -1
  205. package/lib/runtime/timeline/identity.js +9 -3
  206. package/lib/runtime/timeline/identity.js.map +1 -1
  207. package/lib/runtime/timeline/input.d.ts +0 -5
  208. package/lib/runtime/timeline/input.d.ts.map +1 -1
  209. package/lib/runtime/timeline/input.js +2 -3
  210. package/lib/runtime/timeline/input.js.map +1 -1
  211. package/lib/runtime/timeline/install.d.ts +11 -3
  212. package/lib/runtime/timeline/install.d.ts.map +1 -1
  213. package/lib/runtime/timeline/install.js +4 -7
  214. package/lib/runtime/timeline/install.js.map +1 -1
  215. package/lib/runtime/timeline/lifecycle.d.ts +13 -3
  216. package/lib/runtime/timeline/lifecycle.d.ts.map +1 -1
  217. package/lib/runtime/timeline/lifecycle.js +5 -6
  218. package/lib/runtime/timeline/lifecycle.js.map +1 -1
  219. package/lib/runtime/timeline/public-api.d.ts +6 -3
  220. package/lib/runtime/timeline/public-api.d.ts.map +1 -1
  221. package/lib/runtime/timeline/public-api.js +0 -5
  222. package/lib/runtime/timeline/public-api.js.map +1 -1
  223. package/lib/runtime/timeline/render.d.ts +0 -5
  224. package/lib/runtime/timeline/render.d.ts.map +1 -1
  225. package/lib/runtime/timeline/render.js +21 -3
  226. package/lib/runtime/timeline/render.js.map +1 -1
  227. package/lib/runtime/timeline/transport.d.ts +0 -5
  228. package/lib/runtime/timeline/transport.d.ts.map +1 -1
  229. package/lib/runtime/timeline/transport.js +10 -3
  230. package/lib/runtime/timeline/transport.js.map +1 -1
  231. package/lib/segmented-tabs.d.ts +0 -5
  232. package/lib/segmented-tabs.d.ts.map +1 -1
  233. package/lib/segmented-tabs.js +0 -5
  234. package/lib/segmented-tabs.js.map +1 -1
  235. package/lib/snapshot.d.ts +11 -3
  236. package/lib/snapshot.d.ts.map +1 -1
  237. package/lib/snapshot.js +0 -5
  238. package/lib/snapshot.js.map +1 -1
  239. package/lib/source-meta.d.ts +0 -5
  240. package/lib/source-meta.d.ts.map +1 -1
  241. package/lib/source-meta.js +0 -5
  242. package/lib/source-meta.js.map +1 -1
  243. package/lib/timeline/derive.d.ts +0 -5
  244. package/lib/timeline/derive.d.ts.map +1 -1
  245. package/lib/timeline/derive.js +22 -3
  246. package/lib/timeline/derive.js.map +1 -1
  247. package/lib/timeline/filter.d.ts +0 -5
  248. package/lib/timeline/filter.d.ts.map +1 -1
  249. package/lib/timeline/filter.js +6 -3
  250. package/lib/timeline/filter.js.map +1 -1
  251. package/lib/timeline/tracks.d.ts +0 -5
  252. package/lib/timeline/tracks.d.ts.map +1 -1
  253. package/lib/timeline/tracks.js +12 -3
  254. package/lib/timeline/tracks.js.map +1 -1
  255. package/lib/tokens.d.ts +0 -5
  256. package/lib/tokens.d.ts.map +1 -1
  257. package/lib/tokens.js +0 -5
  258. package/lib/tokens.js.map +1 -1
  259. package/lib/transform.d.ts +0 -5
  260. package/lib/transform.d.ts.map +1 -1
  261. package/lib/transform.js +0 -5
  262. package/lib/transform.js.map +1 -1
  263. package/lib/types.d.ts +10 -5
  264. package/lib/types.d.ts.map +1 -1
  265. package/lib/types.js +0 -5
  266. package/lib/types.js.map +1 -1
  267. package/lib/wrap-table.d.ts +0 -5
  268. package/lib/wrap-table.d.ts.map +1 -1
  269. package/lib/wrap-table.js +12 -3
  270. package/lib/wrap-table.js.map +1 -1
  271. package/package.json +14 -10
  272. package/types/hmr-incompatibility.d.ts +0 -5
  273. package/types/hmr-incompatibility.d.ts.map +1 -1
  274. package/types/hmr-incompatibility.js +13 -3
  275. package/types/hmr-incompatibility.js.map +1 -1
  276. package/types/in-page.d.ts +0 -5
  277. package/types/in-page.d.ts.map +1 -1
  278. package/types/in-page.js +0 -5
  279. package/types/in-page.js.map +1 -1
  280. package/types/inspector.d.ts +0 -5
  281. package/types/inspector.d.ts.map +1 -1
  282. package/types/inspector.js +13 -3
  283. package/types/inspector.js.map +1 -1
  284. package/types/snapshot.d.ts +0 -5
  285. package/types/snapshot.d.ts.map +1 -1
  286. package/types/snapshot.js +12 -3
  287. package/types/snapshot.js.map +1 -1
  288. package/types/timeline.d.ts +4 -6
  289. package/types/timeline.d.ts.map +1 -1
  290. package/types/timeline.js +0 -5
  291. package/types/timeline.js.map +1 -1
  292. package/dist/client/assets/index-B2HYO7lk.js.map +0 -1
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Package-root resolution for the devframe.
8
3
  *
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/lib/devframe/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,eAAe,GAAG,GAAW,EAAE;IACnC,IAAI,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,yEAAyE;IACzE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACvC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACtD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,MAAM,YAAY,GAAW,eAAe,EAAE,CAAC;AAEtD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAExB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAGpE,CAAC,OAAO,IAAI,OAAO,CAAC;AAEvB,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAW,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Package-root resolution for the devframe.\n *\n * `tsc` flattens `src/lib/devframe/*.ts` to `lib/devframe/*.js`, so a path\n * relative to `import.meta.url` lands one directory apart depending on\n * whether the module was loaded from source (tests, `vite dev` on this repo)\n * or from the published output. Walking up to the nearest `package.json`\n * instead is correct in both layouts — the same reason\n * `resolveRuntimeModule()` in plugin.ts probes for both extensions.\n */\n\nimport {existsSync, readFileSync} from 'node:fs';\nimport {dirname, join} from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst findPackageRoot = (): string => {\n let dir = dirname(fileURLToPath(import.meta.url));\n // 6 levels is more than either layout needs; the loop exits at the root.\n for (let depth = 0; depth < 6; depth++) {\n if (existsSync(join(dir, 'package.json'))) return dir;\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n throw new Error('[lit-plugin] could not locate the package root');\n};\n\n/** Absolute path of this package's root directory. */\nexport const PACKAGE_ROOT: string = findPackageRoot();\n\n/** This package's version, as published. Surfaced by the `get-meta` query. */\nexport const PACKAGE_VERSION: string =\n (\n JSON.parse(readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8')) as {\n version?: string;\n }\n ).version ?? '0.0.0';\n\n/** Where `vp run build:panel` writes the panel SPA the host serves. */\nexport const PANEL_DIST_DIR: string = join(PACKAGE_ROOT, 'dist', 'client');\n"]}
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/lib/devframe/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,eAAe,GAAG,GAAW,EAAE;IACnC,IAAI,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,yEAAyE;IACzE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACvC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACtD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,MAAM,YAAY,GAAW,eAAe,EAAE,CAAC;AAEtD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAExB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAGpE,CAAC,OAAO,IAAI,OAAO,CAAC;AAEvB,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAW,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["/**\n * Package-root resolution for the devframe.\n *\n * `tsc` flattens `src/lib/devframe/*.ts` to `lib/devframe/*.js`, so a path\n * relative to `import.meta.url` lands one directory apart depending on\n * whether the module was loaded from source (tests, `vite dev` on this repo)\n * or from the published output. Walking up to the nearest `package.json`\n * instead is correct in both layouts — the same reason\n * `resolveRuntimeModule()` in plugin.ts probes for both extensions.\n */\n\nimport {existsSync, readFileSync} from 'node:fs';\nimport {dirname, join} from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst findPackageRoot = (): string => {\n let dir = dirname(fileURLToPath(import.meta.url));\n // 6 levels is more than either layout needs; the loop exits at the root.\n for (let depth = 0; depth < 6; depth++) {\n if (existsSync(join(dir, 'package.json'))) return dir;\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n throw new Error('[lit-plugin] could not locate the package root');\n};\n\n/** Absolute path of this package's root directory. */\nexport const PACKAGE_ROOT: string = findPackageRoot();\n\n/** This package's version, as published. Surfaced by the `get-meta` query. */\nexport const PACKAGE_VERSION: string =\n (\n JSON.parse(readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8')) as {\n version?: string;\n }\n ).version ?? '0.0.0';\n\n/** Where `vp run build:panel` writes the panel SPA the host serves. */\nexport const PANEL_DIST_DIR: string = join(PACKAGE_ROOT, 'dist', 'client');\n"]}
@@ -1,7 +1,10 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * Shared wire contract between the Lit devframe's node-side definition
3
+ * ({@link ../definition.ts}) and its panel: shared-state / streaming /
4
+ * RPC-function names, their payload shapes, and the `devframe` registry
5
+ * augmentations that type them end to end.
6
+ *
7
+ * @see plans/devframe-foundation.md
5
8
  */
6
9
  import type { FeatureSettings, OverrideBaselines, SettingsOverride, TimelineEvent, TimelineLayer, TimelineLayersState } from '../../types/timeline.js';
7
10
  import type { InspectorCommand, InspectorDetails, InspectorMessage, InspectorTreeNode } from '../../types/inspector.js';
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAC,eAAe,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAExE,iFAAiF;AACjF,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,oDAAoD;AACpD,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,gDAAgD;AAChD,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD,kDAAkD;AAClD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,k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7D,sBAAsB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;QACjE,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;KAC/D;IAED,UAAU,wBAAwB;QAChC,GAAG,EAAE;YACH,8DAA8D;YAC9D,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;YACvC;;;;;;eAMG;YACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;YAC5B;;;;eAIG;YACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;SACvC,CAAC;KACH;CACF"}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Shared wire contract between the Lit devframe's node-side definition
8
3
  * ({@link ../definition.ts}) and its panel: shared-state / streaming /
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/lib/devframe/protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAC;AAkB7D,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,gDAAgD;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD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AE,yBAAyB;IAC/C,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,sBAAsB;CACjC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Shared wire contract between the Lit devframe's node-side definition\n * ({@link ../definition.ts}) and its panel: shared-state / streaming /\n * RPC-function names, their payload shapes, and the `devframe` registry\n * augmentations that type them end to end.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport {DEFAULT_LAYERS_STATE} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n OverrideBaselines,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {\n InspectorCommand,\n InspectorDetails,\n InspectorMessage,\n InspectorTreeNode,\n} from '../../types/inspector.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport type {ComponentRollup, UpdateCycle} from '../timeline/derive.js';\n\n/** The devframe's scope id. RPC names become `lit:*`, MCP wire names `lit_*`. */\nexport const LIT_DEVFRAME_ID = 'lit';\n\n/** Shared-state key holding the {@link SessionState} snapshot. */\nexport const SESSION_STATE_KEY = 'session';\n\n/** Streaming channel name the timeline event batches are pushed on. */\nexport const TIMELINE_STREAM_NAME = 'timeline';\n\n/**\n * Id of the one long-lived timeline stream. Fixed rather than discovered:\n * there is exactly one page feed per dev session, so the panel can subscribe\n * without a round trip to look the id up. The node side re-`start()`s this id\n * if the transport dropped the stream after the last subscriber left.\n */\nexport const TIMELINE_STREAM_ID = 'live';\n\n/**\n * Cap on the node-side recent-events ring buffer. It is also the history a\n * (re)connecting panel is seeded with (see {@link RPC_TIMELINE_HISTORY}).\n */\nexport const RECENT_EVENTS_BUFFER_SIZE = 512;\n\n/** Bare (unscoped) name of the `get-meta` query. */\nexport const RPC_GET_META = 'get-meta';\n\n/** Bare name of the `list-components` query. */\nexport const RPC_LIST_COMPONENTS = 'list-components';\n\n/** Bare name of the `component-details` query. */\nexport const RPC_COMPONENT_DETAILS = 'component-details';\n\n/** Bare name of the `recent-events` query. */\nexport const RPC_RECENT_EVENTS = 'recent-events';\n\n/**\n * Bare name of the `timeline-history` query: the node's whole recent-events\n * buffer, oldest first, as `TimelineEvent[]`. What a live panel seeds itself\n * with on connect, since the stream only carries events from then on. Not\n * `recent-events`, whose live answer is filtered and capped for agents.\n */\nexport const RPC_TIMELINE_HISTORY = 'timeline-history';\n\n/** Bare name of the `update-summary` query. */\nexport const RPC_UPDATE_SUMMARY = 'update-summary';\n\n/** Bare name of the `inspect` action. */\nexport const RPC_INSPECT = 'inspect';\n\n/** Bare name of the `set-recording` action. */\nexport const RPC_SET_RECORDING = 'set-recording';\n\n/** Bare name of the `toggle-layer` action. */\nexport const RPC_TOGGLE_LAYER = 'toggle-layer';\n\n/** Bare name of the `set-settings-override` action. */\nexport const RPC_SET_SETTINGS_OVERRIDE = 'set-settings-override';\n\n/** Bare name of the `open-source` action. */\nexport const RPC_OPEN_SOURCE = 'open-source';\n\n/** Arguments for {@link RPC_OPEN_SOURCE}. */\nexport interface OpenSourceArgs {\n /**\n * The path as the panel has it: what the transform injected, so relative\n * to the Vite root (or absolute, when the file lives outside it).\n */\n file: string;\n line?: number;\n}\n\n/** What {@link RPC_OPEN_SOURCE} reports back. */\nexport interface OpenSourceResult {\n /**\n * False when no open service is installed on the host, which is the\n * panel's cue to fall back to `/__lit-open-in-editor`. Also false when the\n * file is missing or outside the allowed roots; the endpoint refuses those\n * paths too.\n */\n opened: boolean;\n}\n\n/** Freeze the current session into a static panel directory. */\nexport const RPC_EXPORT_SNAPSHOT = 'export-snapshot';\n\n/** Arguments for {@link RPC_EXPORT_SNAPSHOT}. */\nexport interface ExportSnapshotArgs {\n /**\n * Where to write. Relative paths resolve against the dev server's cwd,\n * and the result has to stay beneath it. Defaults to\n * `lit-devtools-snapshot`. An existing directory is only replaced when it\n * holds an earlier snapshot.\n */\n outDir?: string;\n}\n\n/** What {@link RPC_EXPORT_SNAPSHOT} reports back, for the panel to display. */\nexport interface ExportSnapshotResult {\n outDir: string;\n events: number;\n components: number;\n details: number;\n}\n\n/** Bare name of the `inspector-message` client (node → panel) event. */\nexport const RPC_INSPECTOR_MESSAGE = 'inspector-message';\n\n/** Bare name of the `hmr-incompatibilities` query. */\nexport const RPC_HMR_INCOMPATIBILITIES = 'hmr-incompatibilities';\n\n/** Bare name of the `hmr-incompatible` client (node → panel) event. */\nexport const RPC_HMR_INCOMPATIBLE = 'hmr-incompatible';\n\n/**\n * Bare name of the page-to-server event. A page runtime that is not on a Vite\n * dev server's HMR socket sends every channel message it would have sent over\n * `import.meta.hot` as `page-send(channel, data)`.\n */\nexport const RPC_PAGE_SEND = 'page-send';\n\n/**\n * Bare name of the server-to-page client event, the reverse direction of\n * {@link RPC_PAGE_SEND}: `page-receive(channel, data)`. Broadcast to every\n * connected client and marked optional, since the panel does not register it.\n */\nexport const RPC_PAGE_RECEIVE = 'page-receive';\n\n/**\n * Recording/layers snapshot shared between every surface (panel, page\n * runtime, MCP). Survives reconnect; mutated either by the `set-recording` /\n * `toggle-layer` actions below or directly by a panel through the generic\n * shared-state RPC devframe provides.\n *\n * `layers.recordingState` is the single authority for \"is recording\" — the\n * runtime's own layer state carries it, so a separate flag here would be a\n * second copy to keep in sync.\n */\nexport interface SessionState {\n layers: TimelineLayersState;\n /** Layers announced at runtime by app code through `addTimelineLayer()`. */\n customLayers: TimelineLayer[];\n}\n\nexport const DEFAULT_SESSION_STATE: SessionState = {\n layers: DEFAULT_LAYERS_STATE,\n customLayers: [],\n};\n\n/** Result of the `get-meta` query. */\nexport interface LitGetMetaResult {\n version: string;\n /** Built-in layers followed by any runtime-announced custom ones. */\n layers: TimelineLayer[];\n features: FeatureSettings | null;\n /** Channel and id to pass to `rpc.streaming.subscribe()`. */\n stream: {channel: string; id: string};\n}\n\n/** Argument of the `component-details` query. */\nexport interface ComponentDetailsArgs {\n id: number;\n}\n\n/** Argument of the `recent-events` query. */\nexport interface RecentEventsArgs {\n layerId?: string;\n elementId?: number;\n /**\n * Only events from the last `sinceMs` milliseconds, measured against\n * the newest event currently in the buffer — not wall-clock time.\n * `TimelineEvent.time` is \"ms since recording started\" in the page\n * (see `runtime/timeline/clock.ts`), which has no fixed relationship\n * to this process's clock.\n */\n sinceMs?: number;\n /** Default 50, hard ceiling 200 regardless of what's requested. */\n limit?: number;\n}\n\n/** Result of the `recent-events` query. */\nexport interface RecentEventsResult {\n /** Whether the timeline is currently recording. */\n recording: boolean;\n /** Most recent events matching the filters, oldest first. */\n events: TimelineEvent[];\n /** Total events currently held in the ring buffer, before filtering. */\n bufferSize: number;\n /** True if filtering matched more events than were returned. */\n truncated: boolean;\n}\n\n/** Argument of the `update-summary` query. */\nexport interface UpdateSummaryArgs {\n /** Restrict to one component, by tag name. */\n tagName?: string;\n /** Same window semantics as {@link RecentEventsArgs.sinceMs}. */\n sinceMs?: number;\n /** Cycles returned (the component totals always cover the whole window).\n * Default 50, hard ceiling 200. */\n limit?: number;\n}\n\n/** Result of the `update-summary` query. */\nexport interface UpdateSummaryResult {\n /** Whether the timeline is currently recording. */\n recording: boolean;\n /** Per-component totals over the window, slowest first. */\n components: ComponentRollup[];\n /** The most recent update cycles in the window, oldest first. */\n cycles: UpdateCycle[];\n /** Total events currently held in the ring buffer, before derivation. */\n bufferSize: number;\n /** True if more cycles were derived than were returned. */\n truncated: boolean;\n}\n\n/** Argument of the `set-recording` action. */\nexport interface SetRecordingArgs {\n recording: boolean;\n}\n\n/** Argument of the `toggle-layer` action. */\nexport interface ToggleLayerArgs {\n layerId: string;\n enabled: boolean;\n}\n\n/**\n * Maps a {@link TimelineLayer.id} to the {@link TimelineLayersState} flag\n * that gates it. Custom layers have no flag and are always on.\n */\nexport const LAYER_FLAGS: Readonly<Record<string, keyof TimelineLayersState>> =\n {\n 'lit-lifecycle': 'litLifecycleEnabled',\n 'lit-render': 'litRenderEnabled',\n 'lit-render-verbose': 'litRenderVerboseEnabled',\n mouse: 'mouseEventEnabled',\n keyboard: 'keyboardEventEnabled',\n };\n\n// Hand-typed rather than derived through `RpcDefinitionsToFunctionsWithNamespace`\n// (also exported by `devframe/rpc`): the definitions themselves live in\n// definition.ts next to their handlers, and hand-typing here avoids a\n// value-level dependency from this shared-contract module back onto it.\ndeclare module 'devframe' {\n interface DevframeRpcServerFunctions {\n 'lit:get-meta': () => Promise<LitGetMetaResult>;\n 'lit:list-components': () => Promise<InspectorTreeNode[]>;\n 'lit:component-details': (\n args: ComponentDetailsArgs\n ) => Promise<InspectorDetails | null>;\n 'lit:recent-events': (\n args?: RecentEventsArgs\n ) => Promise<RecentEventsResult>;\n 'lit:timeline-history': () => Promise<TimelineEvent[]>;\n 'lit:update-summary': (\n args?: UpdateSummaryArgs\n ) => Promise<UpdateSummaryResult>;\n 'lit:inspect': (command: InspectorCommand) => Promise<void>;\n 'lit:set-recording': (args: SetRecordingArgs) => Promise<void>;\n 'lit:toggle-layer': (args: ToggleLayerArgs) => Promise<void>;\n 'lit:set-settings-override': (override: SettingsOverride) => Promise<void>;\n 'lit:open-source': (args: OpenSourceArgs) => Promise<OpenSourceResult>;\n 'lit:export-snapshot': (\n args: ExportSnapshotArgs\n ) => Promise<ExportSnapshotResult>;\n 'lit:hmr-incompatibilities': () => Promise<HmrIncompatibilityEvent[]>;\n 'lit:page-send': (channel: string, data?: unknown) => void;\n }\n\n interface DevframeRpcClientFunctions {\n 'lit:inspector-message': (message: InspectorMessage) => void;\n 'lit:hmr-incompatible': (event: HmrIncompatibilityEvent) => void;\n 'lit:page-receive': (channel: string, data?: unknown) => void;\n }\n\n interface DevframeSettingsRegistry {\n lit: {\n /** Panel chrome preference. Mirrors `COLOR_SCHEME_LS_KEY`. */\n appearance?: 'auto' | 'dark' | 'light';\n /**\n * The Settings tab's live overrides, stored as one blob the way the\n * panel already treats them. Mirrors `SETTINGS_OVERRIDE_LS_KEY`, which\n * stays: the page runtime reads it synchronously at module-init time,\n * long before any client exists, and every settings-store read is\n * async by design.\n */\n override?: SettingsOverride;\n /**\n * The config value each overridden key was set against. A sibling of\n * `override` so the runtime never sees it. Mirrors\n * `OVERRIDE_BASELINES_LS_KEY`.\n */\n overrideBaselines?: OverrideBaselines;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/lib/devframe/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAC;AAkB7D,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,gDAAgD;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAErD,kDAAkD;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAEzD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC;AAErC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEjD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAE/C,uDAAuD;AACvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAuB7C,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAqBrD,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAEzD,sDAAsD;AACtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAkB/C,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,MAAM,EAAE,oBAAoB;IAC5B,YAAY,EAAE,EAAE;CACjB,CAAC;AAiFF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GACtB;IACE,eAAe,EAAE,qBAAqB;IACtC,YAAY,EAAE,kBAAkB;IAChC,oBAAoB,EAAE,yBAAyB;IAC/C,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,sBAAsB;CACjC,CAAC","sourcesContent":["/**\n * Shared wire contract between the Lit devframe's node-side definition\n * ({@link ../definition.ts}) and its panel: shared-state / streaming /\n * RPC-function names, their payload shapes, and the `devframe` registry\n * augmentations that type them end to end.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport {DEFAULT_LAYERS_STATE} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n OverrideBaselines,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {\n InspectorCommand,\n InspectorDetails,\n InspectorMessage,\n InspectorTreeNode,\n} from '../../types/inspector.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport type {ComponentRollup, UpdateCycle} from '../timeline/derive.js';\n\n/** The devframe's scope id. RPC names become `lit:*`, MCP wire names `lit_*`. */\nexport const LIT_DEVFRAME_ID = 'lit';\n\n/** Shared-state key holding the {@link SessionState} snapshot. */\nexport const SESSION_STATE_KEY = 'session';\n\n/** Streaming channel name the timeline event batches are pushed on. */\nexport const TIMELINE_STREAM_NAME = 'timeline';\n\n/**\n * Id of the one long-lived timeline stream. Fixed rather than discovered:\n * there is exactly one page feed per dev session, so the panel can subscribe\n * without a round trip to look the id up. The node side re-`start()`s this id\n * if the transport dropped the stream after the last subscriber left.\n */\nexport const TIMELINE_STREAM_ID = 'live';\n\n/**\n * Cap on the node-side recent-events ring buffer. It is also the history a\n * (re)connecting panel is seeded with (see {@link RPC_TIMELINE_HISTORY}).\n */\nexport const RECENT_EVENTS_BUFFER_SIZE = 512;\n\n/** Bare (unscoped) name of the `get-meta` query. */\nexport const RPC_GET_META = 'get-meta';\n\n/** Bare name of the `list-components` query. */\nexport const RPC_LIST_COMPONENTS = 'list-components';\n\n/** Bare name of the `component-details` query. */\nexport const RPC_COMPONENT_DETAILS = 'component-details';\n\n/** Bare name of the `recent-events` query. */\nexport const RPC_RECENT_EVENTS = 'recent-events';\n\n/**\n * Bare name of the `timeline-history` query: the node's whole recent-events\n * buffer, oldest first, as `TimelineEvent[]`. What a live panel seeds itself\n * with on connect, since the stream only carries events from then on. Not\n * `recent-events`, whose live answer is filtered and capped for agents.\n */\nexport const RPC_TIMELINE_HISTORY = 'timeline-history';\n\n/** Bare name of the `update-summary` query. */\nexport const RPC_UPDATE_SUMMARY = 'update-summary';\n\n/** Bare name of the `inspect` action. */\nexport const RPC_INSPECT = 'inspect';\n\n/** Bare name of the `set-recording` action. */\nexport const RPC_SET_RECORDING = 'set-recording';\n\n/** Bare name of the `toggle-layer` action. */\nexport const RPC_TOGGLE_LAYER = 'toggle-layer';\n\n/** Bare name of the `set-settings-override` action. */\nexport const RPC_SET_SETTINGS_OVERRIDE = 'set-settings-override';\n\n/** Bare name of the `open-source` action. */\nexport const RPC_OPEN_SOURCE = 'open-source';\n\n/** Arguments for {@link RPC_OPEN_SOURCE}. */\nexport interface OpenSourceArgs {\n /**\n * The path as the panel has it: what the transform injected, so relative\n * to the Vite root (or absolute, when the file lives outside it).\n */\n file: string;\n line?: number;\n}\n\n/** What {@link RPC_OPEN_SOURCE} reports back. */\nexport interface OpenSourceResult {\n /**\n * False when no open service is installed on the host, which is the\n * panel's cue to fall back to `/__lit-open-in-editor`. Also false when the\n * file is missing or outside the allowed roots; the endpoint refuses those\n * paths too.\n */\n opened: boolean;\n}\n\n/** Freeze the current session into a static panel directory. */\nexport const RPC_EXPORT_SNAPSHOT = 'export-snapshot';\n\n/** Arguments for {@link RPC_EXPORT_SNAPSHOT}. */\nexport interface ExportSnapshotArgs {\n /**\n * Where to write. Relative paths resolve against the dev server's cwd,\n * and the result has to stay beneath it. Defaults to\n * `lit-devtools-snapshot`. An existing directory is only replaced when it\n * holds an earlier snapshot.\n */\n outDir?: string;\n}\n\n/** What {@link RPC_EXPORT_SNAPSHOT} reports back, for the panel to display. */\nexport interface ExportSnapshotResult {\n outDir: string;\n events: number;\n components: number;\n details: number;\n}\n\n/** Bare name of the `inspector-message` client (node → panel) event. */\nexport const RPC_INSPECTOR_MESSAGE = 'inspector-message';\n\n/** Bare name of the `hmr-incompatibilities` query. */\nexport const RPC_HMR_INCOMPATIBILITIES = 'hmr-incompatibilities';\n\n/** Bare name of the `hmr-incompatible` client (node → panel) event. */\nexport const RPC_HMR_INCOMPATIBLE = 'hmr-incompatible';\n\n/**\n * Bare name of the page-to-server event. A page runtime that is not on a Vite\n * dev server's HMR socket sends every channel message it would have sent over\n * `import.meta.hot` as `page-send(channel, data)`.\n */\nexport const RPC_PAGE_SEND = 'page-send';\n\n/**\n * Bare name of the server-to-page client event, the reverse direction of\n * {@link RPC_PAGE_SEND}: `page-receive(channel, data)`. Broadcast to every\n * connected client and marked optional, since the panel does not register it.\n */\nexport const RPC_PAGE_RECEIVE = 'page-receive';\n\n/**\n * Recording/layers snapshot shared between every surface (panel, page\n * runtime, MCP). Survives reconnect; mutated either by the `set-recording` /\n * `toggle-layer` actions below or directly by a panel through the generic\n * shared-state RPC devframe provides.\n *\n * `layers.recordingState` is the single authority for \"is recording\" — the\n * runtime's own layer state carries it, so a separate flag here would be a\n * second copy to keep in sync.\n */\nexport interface SessionState {\n layers: TimelineLayersState;\n /** Layers announced at runtime by app code through `addTimelineLayer()`. */\n customLayers: TimelineLayer[];\n}\n\nexport const DEFAULT_SESSION_STATE: SessionState = {\n layers: DEFAULT_LAYERS_STATE,\n customLayers: [],\n};\n\n/** Result of the `get-meta` query. */\nexport interface LitGetMetaResult {\n version: string;\n /** Built-in layers followed by any runtime-announced custom ones. */\n layers: TimelineLayer[];\n features: FeatureSettings | null;\n /** Channel and id to pass to `rpc.streaming.subscribe()`. */\n stream: {channel: string; id: string};\n}\n\n/** Argument of the `component-details` query. */\nexport interface ComponentDetailsArgs {\n id: number;\n}\n\n/** Argument of the `recent-events` query. */\nexport interface RecentEventsArgs {\n layerId?: string;\n elementId?: number;\n /**\n * Only events from the last `sinceMs` milliseconds, measured against\n * the newest event currently in the buffer — not wall-clock time.\n * `TimelineEvent.time` is \"ms since recording started\" in the page\n * (see `runtime/timeline/clock.ts`), which has no fixed relationship\n * to this process's clock.\n */\n sinceMs?: number;\n /** Default 50, hard ceiling 200 regardless of what's requested. */\n limit?: number;\n}\n\n/** Result of the `recent-events` query. */\nexport interface RecentEventsResult {\n /** Whether the timeline is currently recording. */\n recording: boolean;\n /** Most recent events matching the filters, oldest first. */\n events: TimelineEvent[];\n /** Total events currently held in the ring buffer, before filtering. */\n bufferSize: number;\n /** True if filtering matched more events than were returned. */\n truncated: boolean;\n}\n\n/** Argument of the `update-summary` query. */\nexport interface UpdateSummaryArgs {\n /** Restrict to one component, by tag name. */\n tagName?: string;\n /** Same window semantics as {@link RecentEventsArgs.sinceMs}. */\n sinceMs?: number;\n /** Cycles returned (the component totals always cover the whole window).\n * Default 50, hard ceiling 200. */\n limit?: number;\n}\n\n/** Result of the `update-summary` query. */\nexport interface UpdateSummaryResult {\n /** Whether the timeline is currently recording. */\n recording: boolean;\n /** Per-component totals over the window, slowest first. */\n components: ComponentRollup[];\n /** The most recent update cycles in the window, oldest first. */\n cycles: UpdateCycle[];\n /** Total events currently held in the ring buffer, before derivation. */\n bufferSize: number;\n /** True if more cycles were derived than were returned. */\n truncated: boolean;\n}\n\n/** Argument of the `set-recording` action. */\nexport interface SetRecordingArgs {\n recording: boolean;\n}\n\n/** Argument of the `toggle-layer` action. */\nexport interface ToggleLayerArgs {\n layerId: string;\n enabled: boolean;\n}\n\n/**\n * Maps a {@link TimelineLayer.id} to the {@link TimelineLayersState} flag\n * that gates it. Custom layers have no flag and are always on.\n */\nexport const LAYER_FLAGS: Readonly<Record<string, keyof TimelineLayersState>> =\n {\n 'lit-lifecycle': 'litLifecycleEnabled',\n 'lit-render': 'litRenderEnabled',\n 'lit-render-verbose': 'litRenderVerboseEnabled',\n mouse: 'mouseEventEnabled',\n keyboard: 'keyboardEventEnabled',\n };\n\n// Hand-typed rather than derived through `RpcDefinitionsToFunctionsWithNamespace`\n// (also exported by `devframe/rpc`): the definitions themselves live in\n// definition.ts next to their handlers, and hand-typing here avoids a\n// value-level dependency from this shared-contract module back onto it.\ndeclare module 'devframe' {\n interface DevframeRpcServerFunctions {\n 'lit:get-meta': () => Promise<LitGetMetaResult>;\n 'lit:list-components': () => Promise<InspectorTreeNode[]>;\n 'lit:component-details': (\n args: ComponentDetailsArgs\n ) => Promise<InspectorDetails | null>;\n 'lit:recent-events': (\n args?: RecentEventsArgs\n ) => Promise<RecentEventsResult>;\n 'lit:timeline-history': () => Promise<TimelineEvent[]>;\n 'lit:update-summary': (\n args?: UpdateSummaryArgs\n ) => Promise<UpdateSummaryResult>;\n 'lit:inspect': (command: InspectorCommand) => Promise<void>;\n 'lit:set-recording': (args: SetRecordingArgs) => Promise<void>;\n 'lit:toggle-layer': (args: ToggleLayerArgs) => Promise<void>;\n 'lit:set-settings-override': (override: SettingsOverride) => Promise<void>;\n 'lit:open-source': (args: OpenSourceArgs) => Promise<OpenSourceResult>;\n 'lit:export-snapshot': (\n args: ExportSnapshotArgs\n ) => Promise<ExportSnapshotResult>;\n 'lit:hmr-incompatibilities': () => Promise<HmrIncompatibilityEvent[]>;\n 'lit:page-send': (channel: string, data?: unknown) => void;\n }\n\n interface DevframeRpcClientFunctions {\n 'lit:inspector-message': (message: InspectorMessage) => void;\n 'lit:hmr-incompatible': (event: HmrIncompatibilityEvent) => void;\n 'lit:page-receive': (channel: string, data?: unknown) => void;\n }\n\n interface DevframeSettingsRegistry {\n lit: {\n /** Panel chrome preference. Mirrors `COLOR_SCHEME_LS_KEY`. */\n appearance?: 'auto' | 'dark' | 'light';\n /**\n * The Settings tab's live overrides, stored as one blob the way the\n * panel already treats them. Mirrors `SETTINGS_OVERRIDE_LS_KEY`, which\n * stays: the page runtime reads it synchronously at module-init time,\n * long before any client exists, and every settings-store read is\n * async by design.\n */\n override?: SettingsOverride;\n /**\n * The config value each overridden key was set against. A sibling of\n * `override` so the runtime never sees it. Mirrors\n * `OVERRIDE_BASELINES_LS_KEY`.\n */\n overrideBaselines?: OverrideBaselines;\n };\n }\n}\n"]}
@@ -1,7 +1,19 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * A {@link TimelineSource} for a page that is *not* on this process's Vite
3
+ * dev server: the page dials the devframe host over devframe's own RPC
4
+ * connection and carries the runtime's channel messages as two RPC events,
5
+ * `lit:page-send` (page to server) and `lit:page-receive` (server to page).
6
+ * That lets `lit-devtools dev` show a live tree, inspector and timeline
7
+ * instead of running on {@link createNullSource}.
8
+ *
9
+ * The channel names and payloads are the ones {@link HotTimelineSource} moves
10
+ * over `import.meta.hot`; only the carrier differs. The page half is
11
+ * `runtime/rpc-transport.ts`.
12
+ *
13
+ * Like `definition.ts`, nothing here imports Vite. The devframe-specific
14
+ * wiring lives in {@link createStandaloneLitDevframe}; the class itself takes a
15
+ * tiny {@link PageLinkNode}, so its channel-to-sink mapping is testable
16
+ * without a running server.
5
17
  */
6
18
  import type { DevframeDefinition } from 'devframe';
7
19
  import type { InspectorCommand } from '../../types/inspector.js';
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-source.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/rpc-source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH,OAAO,KAAK,EAAC,kBAAkB,EAAsB,MAAM,UAAU,CAAC;AAMtE,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EACV,gBAAgB,EAGhB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,iBAAiB,CAAC;AAG9D,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,aAAa,CAAC;AAE9D,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,aAAa,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACvE,8CAA8C;IAC9C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACpD;AAKD;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,cAAc;;IAItD,wEAAwE;IACxE,IAAI,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAG7B;IAED,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,IAAI,CAKrC;IAqCD,aAAa,IAAI,IAAI,CAEpB;IAED,aAAa,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAEzC;IAED,YAAY,CAAC,SAAS,EAAE,OAA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ED,aAAa,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAEzC;IAED,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAErC;IAED,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAK3C;IAED,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAEpD;CACF;AAED,eAAO,MAAM,uBAAuB,QAAO,iBAClB,CAAC;AAE1B;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC,GAChD,kBAAkB,CAwCpB"}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * A {@link TimelineSource} for a page that is *not* on this process's Vite
8
3
  * dev server: the page dials the devframe host over devframe's own RPC
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-source.js","sourceRoot":"","sources":["../../src/lib/devframe/rpc-source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAOlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAW7C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK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C,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;IAC3D,MAAM,EAAC,KAAK,EAAC,GAAG,UAAU,CAAC;IAE3B,OAAO;QACL,GAAG,UAAU;QACb,KAAK,CAAC,KAAK,CAAC,GAAwB,EAAE,IAAI;YACxC,kDAAkD;YAClD,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACvB,MAAM,CAAC,IAAI,CAAC;oBACV,aAAa,CAAC,OAAO;wBACnB,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,QAAQ,CACrC,iBAAiB,CAAC;4BAChB,IAAI,EAAE,aAAa;4BACnB,IAAI,EAAE,OAAO;4BACb,OAAO,EAAE,CAAC,OAAe,EAAE,IAAc,EAAE,EAAE,CAC3C,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;yBACzB,CAAC,CACH,CAAC;oBACJ,CAAC;oBACD,WAAW,CAAC,OAAO,EAAE,IAAI;wBACvB,GAAG,CAAC,GAAG;6BACJ,SAAS,CAAC;4BACT,MAAM,EAAE,GAAG,eAAe,IAAI,gBAAgB,EAAE;4BAChD,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;4BACrB,mDAAmD;4BACnD,6BAA6B;4BAC7B,QAAQ,EAAE,IAAI;4BACd,KAAK,EAAE,IAAI;yBACZ,CAAC;6BACD,KAAK,CAAC,GAAG,EAAE;4BACV,sDAAsD;wBACxD,CAAC,CAAC,CAAC;oBACP,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;YACD,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * A {@link TimelineSource} for a page that is *not* on this process's Vite\n * dev server: the page dials the devframe host over devframe's own RPC\n * connection and carries the runtime's channel messages as two RPC events,\n * `lit:page-send` (page to server) and `lit:page-receive` (server to page).\n * That lets `lit-devtools dev` show a live tree, inspector and timeline\n * instead of running on {@link createNullSource}.\n *\n * The channel names and payloads are the ones {@link HotTimelineSource} moves\n * over `import.meta.hot`; only the carrier differs. The page half is\n * `runtime/rpc-transport.ts`.\n *\n * Like `definition.ts`, nothing here imports Vite. The devframe-specific\n * wiring lives in {@link createStandaloneLitDevframe}; the class itself takes a\n * tiny {@link PageLinkNode}, so its channel-to-sink mapping is testable\n * without a running server.\n */\n\nimport {defineRpcFunction} from 'devframe';\nimport type {DevframeDefinition, DevframeNodeContext} from 'devframe';\nimport {\n INSPECT_CMD_CHANNEL,\n INSPECT_DATA_CHANNEL,\n INSPECT_OVERLAY_TOGGLE_CHANNEL,\n} from '../../types/inspector.js';\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport {HMR_INCOMPATIBLE_CHANNEL} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {SETTINGS_OVERRIDE_CHANNEL} from '../../types/timeline.js';\nimport type {\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport {createLitDevframe} from './definition.js';\nimport type {CreateLitDevframeOptions} from './definition.js';\nimport {LIT_DEVFRAME_ID, RPC_PAGE_RECEIVE, RPC_PAGE_SEND} from './protocol.js';\nimport {layersWireFormat} from './source.js';\nimport type {TimelineSink, TimelineSource} from './source.js';\n\n/** What {@link RpcTimelineSource} needs of the server it is mounted on. */\nexport interface PageLinkNode {\n /** Deliver messages the page sent to `handler`. Called once, on bind. */\n onPageMessage(handler: (channel: string, data: unknown) => void): void;\n /** Send a message to every connected page. */\n sendToPages(channel: string, data?: unknown): void;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * `TimelineSource` over devframe RPC. Messages that arrive from the network\n * are untrusted in shape, so each is checked before it reaches the sink;\n * anything unrecognised is ignored rather than thrown, which keeps a\n * misbehaving page from taking the session down.\n */\nexport class RpcTimelineSource implements TimelineSource {\n #node: PageLinkNode | undefined;\n #sink: TimelineSink | undefined;\n\n /** Wire the source to a server. Call once, before pages can connect. */\n bind(node: PageLinkNode): void {\n this.#node = node;\n node.onPageMessage((channel, data) => this.#receive(channel, data));\n }\n\n attach(sink: TimelineSink): () => void {\n this.#sink = sink;\n return () => {\n if (this.#sink === sink) this.#sink = undefined;\n };\n }\n\n #receive(channel: string, data: unknown): void {\n const sink = this.#sink;\n if (sink === undefined) return;\n switch (channel) {\n case 'lit:timeline:push-event': {\n const events = isRecord(data) ? data.events : undefined;\n sink.pushEvents(\n Array.isArray(events) ? (events as TimelineEvent[]) : []\n );\n break;\n }\n case 'lit:timeline:custom-layer': {\n const layer = isRecord(data)\n ? (data.layer as TimelineLayer)\n : undefined;\n if (layer?.id) sink.addLayer(layer);\n break;\n }\n case INSPECT_DATA_CHANNEL:\n // No dock to bring forward on a `pick`, unlike the Vite hub: the\n // standalone panel is the whole page.\n if (isRecord(data) && typeof data.type === 'string') {\n sink.inspectorMessage(data as unknown as InspectorMessage);\n }\n break;\n case HMR_INCOMPATIBLE_CHANNEL:\n if (isRecord(data))\n sink.hmrIncompatible(data as unknown as HmrIncompatibilityEvent);\n break;\n case 'lit:timeline:runtime-ready':\n sink.runtimeReady();\n break;\n }\n }\n\n toggleOverlay(): void {\n this.#node?.sendToPages(INSPECT_OVERLAY_TOGGLE_CHANNEL);\n }\n\n sendInspector(cmd: InspectorCommand): void {\n this.#node?.sendToPages(INSPECT_CMD_CHANNEL, cmd);\n }\n\n setRecording(recording: boolean): void {\n this.#node?.sendToPages('lit:timeline:recording-changed', {recording});\n }\n\n setLayers(layers: TimelineLayersState): void {\n this.#node?.sendToPages(\n 'lit:timeline:layers-changed',\n layersWireFormat(layers)\n );\n }\n\n setSettingsOverride(override: SettingsOverride): void {\n this.#node?.sendToPages(SETTINGS_OVERRIDE_CHANNEL, override);\n }\n}\n\nexport const createRpcTimelineSource = (): RpcTimelineSource =>\n new RpcTimelineSource();\n\n/**\n * The Lit devframe with an {@link RpcTimelineSource} already mounted on it,\n * for hosts with no page of their own (`lit-devtools dev`). Wraps\n * `setup()` so the two page-link RPC functions are registered on the same\n * context the definition runs against, leaving `definition.ts` unaware of how\n * its source is fed.\n */\nexport function createStandaloneLitDevframe(\n options: Omit<CreateLitDevframeOptions, 'source'>\n): DevframeDefinition {\n const source = new RpcTimelineSource();\n const definition = createLitDevframe({...options, source});\n const {setup} = definition;\n\n return {\n ...definition,\n async setup(ctx: DevframeNodeContext, info) {\n // A static build or MCP run has no pages to link.\n if (ctx.mode === 'dev') {\n source.bind({\n onPageMessage(handler) {\n ctx.scope(LIT_DEVFRAME_ID).rpc.register(\n defineRpcFunction({\n name: RPC_PAGE_SEND,\n type: 'event',\n handler: (channel: string, data?: unknown) =>\n handler(channel, data),\n })\n );\n },\n sendToPages(channel, data) {\n ctx.rpc\n .broadcast({\n method: `${LIT_DEVFRAME_ID}:${RPC_PAGE_RECEIVE}`,\n args: [channel, data],\n // Only pages register this; the panel, on the same\n // connection list, does not.\n optional: true,\n event: true,\n })\n .catch(() => {\n // A page that vanished mid-broadcast is not an error.\n });\n },\n });\n }\n await setup(ctx, info);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"rpc-source.js","sourceRoot":"","sources":["../../src/lib/devframe/rpc-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAOlE,OAAO,EAAC,iBAAiB,EAAC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CAAC;YACD,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * A {@link TimelineSource} for a page that is *not* on this process's Vite\n * dev server: the page dials the devframe host over devframe's own RPC\n * connection and carries the runtime's channel messages as two RPC events,\n * `lit:page-send` (page to server) and `lit:page-receive` (server to page).\n * That lets `lit-devtools dev` show a live tree, inspector and timeline\n * instead of running on {@link createNullSource}.\n *\n * The channel names and payloads are the ones {@link HotTimelineSource} moves\n * over `import.meta.hot`; only the carrier differs. The page half is\n * `runtime/rpc-transport.ts`.\n *\n * Like `definition.ts`, nothing here imports Vite. The devframe-specific\n * wiring lives in {@link createStandaloneLitDevframe}; the class itself takes a\n * tiny {@link PageLinkNode}, so its channel-to-sink mapping is testable\n * without a running server.\n */\n\nimport {defineRpcFunction} from 'devframe';\nimport type {DevframeDefinition, DevframeNodeContext} from 'devframe';\nimport {\n INSPECT_CMD_CHANNEL,\n INSPECT_DATA_CHANNEL,\n INSPECT_OVERLAY_TOGGLE_CHANNEL,\n} from '../../types/inspector.js';\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport {HMR_INCOMPATIBLE_CHANNEL} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {SETTINGS_OVERRIDE_CHANNEL} from '../../types/timeline.js';\nimport type {\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport {createLitDevframe} from './definition.js';\nimport type {CreateLitDevframeOptions} from './definition.js';\nimport {LIT_DEVFRAME_ID, RPC_PAGE_RECEIVE, RPC_PAGE_SEND} from './protocol.js';\nimport {layersWireFormat} from './source.js';\nimport type {TimelineSink, TimelineSource} from './source.js';\n\n/** What {@link RpcTimelineSource} needs of the server it is mounted on. */\nexport interface PageLinkNode {\n /** Deliver messages the page sent to `handler`. Called once, on bind. */\n onPageMessage(handler: (channel: string, data: unknown) => void): void;\n /** Send a message to every connected page. */\n sendToPages(channel: string, data?: unknown): void;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * `TimelineSource` over devframe RPC. Messages that arrive from the network\n * are untrusted in shape, so each is checked before it reaches the sink;\n * anything unrecognised is ignored rather than thrown, which keeps a\n * misbehaving page from taking the session down.\n */\nexport class RpcTimelineSource implements TimelineSource {\n #node: PageLinkNode | undefined;\n #sink: TimelineSink | undefined;\n\n /** Wire the source to a server. Call once, before pages can connect. */\n bind(node: PageLinkNode): void {\n this.#node = node;\n node.onPageMessage((channel, data) => this.#receive(channel, data));\n }\n\n attach(sink: TimelineSink): () => void {\n this.#sink = sink;\n return () => {\n if (this.#sink === sink) this.#sink = undefined;\n };\n }\n\n #receive(channel: string, data: unknown): void {\n const sink = this.#sink;\n if (sink === undefined) return;\n switch (channel) {\n case 'lit:timeline:push-event': {\n const events = isRecord(data) ? data.events : undefined;\n sink.pushEvents(\n Array.isArray(events) ? (events as TimelineEvent[]) : []\n );\n break;\n }\n case 'lit:timeline:custom-layer': {\n const layer = isRecord(data)\n ? (data.layer as TimelineLayer)\n : undefined;\n if (layer?.id) sink.addLayer(layer);\n break;\n }\n case INSPECT_DATA_CHANNEL:\n // No dock to bring forward on a `pick`, unlike the Vite hub: the\n // standalone panel is the whole page.\n if (isRecord(data) && typeof data.type === 'string') {\n sink.inspectorMessage(data as unknown as InspectorMessage);\n }\n break;\n case HMR_INCOMPATIBLE_CHANNEL:\n if (isRecord(data))\n sink.hmrIncompatible(data as unknown as HmrIncompatibilityEvent);\n break;\n case 'lit:timeline:runtime-ready':\n sink.runtimeReady();\n break;\n }\n }\n\n toggleOverlay(): void {\n this.#node?.sendToPages(INSPECT_OVERLAY_TOGGLE_CHANNEL);\n }\n\n sendInspector(cmd: InspectorCommand): void {\n this.#node?.sendToPages(INSPECT_CMD_CHANNEL, cmd);\n }\n\n setRecording(recording: boolean): void {\n this.#node?.sendToPages('lit:timeline:recording-changed', {recording});\n }\n\n setLayers(layers: TimelineLayersState): void {\n this.#node?.sendToPages(\n 'lit:timeline:layers-changed',\n layersWireFormat(layers)\n );\n }\n\n setSettingsOverride(override: SettingsOverride): void {\n this.#node?.sendToPages(SETTINGS_OVERRIDE_CHANNEL, override);\n }\n}\n\nexport const createRpcTimelineSource = (): RpcTimelineSource =>\n new RpcTimelineSource();\n\n/**\n * The Lit devframe with an {@link RpcTimelineSource} already mounted on it,\n * for hosts with no page of their own (`lit-devtools dev`). Wraps\n * `setup()` so the two page-link RPC functions are registered on the same\n * context the definition runs against, leaving `definition.ts` unaware of how\n * its source is fed.\n */\nexport function createStandaloneLitDevframe(\n options: Omit<CreateLitDevframeOptions, 'source'>\n): DevframeDefinition {\n const source = new RpcTimelineSource();\n const definition = createLitDevframe({...options, source});\n const {setup} = definition;\n\n return {\n ...definition,\n async setup(ctx: DevframeNodeContext, info) {\n // A static build or MCP run has no pages to link.\n if (ctx.mode === 'dev') {\n source.bind({\n onPageMessage(handler) {\n ctx.scope(LIT_DEVFRAME_ID).rpc.register(\n defineRpcFunction({\n name: RPC_PAGE_SEND,\n type: 'event',\n handler: (channel: string, data?: unknown) =>\n handler(channel, data),\n })\n );\n },\n sendToPages(channel, data) {\n ctx.rpc\n .broadcast({\n method: `${LIT_DEVFRAME_ID}:${RPC_PAGE_RECEIVE}`,\n args: [channel, data],\n // Only pages register this; the panel, on the same\n // connection list, does not.\n optional: true,\n event: true,\n })\n .catch(() => {\n // A page that vanished mid-broadcast is not an error.\n });\n },\n });\n }\n await setup(ctx, info);\n },\n };\n}\n"]}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * The `TimelineSource` port: the abstraction over "where page-runtime
8
3
  * traffic comes from". The framework-neutral definition
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sour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@@ -1,7 +1,11 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * The `TimelineSource` port: the abstraction over "where page-runtime
3
+ * traffic comes from". The framework-neutral definition
4
+ * ({@link ../definition.ts}) only ever talks to this interface, so it can run
5
+ * under `createDevServer()` with no Vite installed. `vite.ts` supplies the
6
+ * real implementation (an `import.meta.hot` bridge); `createDevServer()` /
7
+ * `createBuild()` / an MCP server use {@link createNullSource} instead, since
8
+ * no page is attached.
5
9
  */
6
10
  /**
7
11
  * The wire form of {@link TimelineLayersState}: the flat map of boolean toggle
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/lib/devframe/source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmDH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,EAAE,CAAC,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;IAC/C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;IACzC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;IACvD,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;IAC3C,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;CAClD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,MAAM;YACJ,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,aAAa,KAAI,CAAC;QAClB,aAAa,KAAI,CAAC;QAClB,YAAY,KAAI,CAAC;QACjB,SAAS,KAAI,CAAC;QACd,mBAAmB,KAAI,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The `TimelineSource` port: the abstraction over \"where page-runtime\n * traffic comes from\". The framework-neutral definition\n * ({@link ../definition.ts}) only ever talks to this interface, so it can run\n * under `createDevServer()` with no Vite installed. `vite.ts` supplies the\n * real implementation (an `import.meta.hot` bridge); `createDevServer()` /\n * `createBuild()` / an MCP server use {@link createNullSource} instead, since\n * no page is attached.\n */\n\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport type {\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\n\n/** The definition's sink for events arriving from the page runtime. */\nexport interface TimelineSink {\n pushEvents(events: TimelineEvent[]): void;\n addLayer(layer: TimelineLayer): void;\n inspectorMessage(msg: InspectorMessage): void;\n hmrIncompatible(event: HmrIncompatibilityEvent): void;\n /**\n * A page runtime just connected (first load, reload, or HMR reconnect). It\n * starts from the compiled-in defaults, so whatever recording/layer state\n * this session already holds has to be replayed to it — otherwise a page\n * loaded while recording is on silently captures nothing.\n */\n runtimeReady(): void;\n}\n\n/** Where the definition sends/receives page-runtime traffic. */\nexport interface TimelineSource {\n /** Start forwarding page-runtime traffic to `sink`. Returns a detach function. */\n attach(sink: TimelineSink): () => void;\n sendInspector(cmd: InspectorCommand): void;\n toggleOverlay(): void;\n setRecording(r: boolean): void;\n setLayers(l: TimelineLayersState): void;\n /** Apply a live feature-settings override to the running page. */\n setSettingsOverride(override: SettingsOverride): void;\n}\n\n/**\n * The wire form of {@link TimelineLayersState}: the flat map of boolean toggle\n * fields the page runtime's `lit:timeline:layers-changed` listener expects,\n * not `{layers}`. Shared by every source so they cannot drift apart.\n */\nexport const layersWireFormat = (layers: TimelineLayersState) => ({\n litLifecycleEnabled: layers.litLifecycleEnabled,\n litRenderEnabled: layers.litRenderEnabled,\n litRenderVerboseEnabled: layers.litRenderVerboseEnabled,\n mouseEventEnabled: layers.mouseEventEnabled,\n keyboardEventEnabled: layers.keyboardEventEnabled,\n});\n\n/**\n * No-op source used wherever no page is attached (`createDevServer()`,\n * `createBuild()`, an MCP server). `attach()` never calls the sink; every\n * other method is a no-op.\n */\nexport function createNullSource(): TimelineSource {\n return {\n attach() {\n return () => {};\n },\n sendInspector() {},\n toggleOverlay() {},\n setRecording() {},\n setLayers() {},\n setSettingsOverride() {},\n };\n}\n"]}
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/lib/devframe/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,EAAE,CAAC,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;IAC/C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;IACzC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;IACvD,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;IAC3C,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;CAClD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,MAAM;YACJ,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,aAAa,KAAI,CAAC;QAClB,aAAa,KAAI,CAAC;QAClB,YAAY,KAAI,CAAC;QACjB,SAAS,KAAI,CAAC;QACd,mBAAmB,KAAI,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The `TimelineSource` port: the abstraction over \"where page-runtime\n * traffic comes from\". The framework-neutral definition\n * ({@link ../definition.ts}) only ever talks to this interface, so it can run\n * under `createDevServer()` with no Vite installed. `vite.ts` supplies the\n * real implementation (an `import.meta.hot` bridge); `createDevServer()` /\n * `createBuild()` / an MCP server use {@link createNullSource} instead, since\n * no page is attached.\n */\n\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport type {\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\n\n/** The definition's sink for events arriving from the page runtime. */\nexport interface TimelineSink {\n pushEvents(events: TimelineEvent[]): void;\n addLayer(layer: TimelineLayer): void;\n inspectorMessage(msg: InspectorMessage): void;\n hmrIncompatible(event: HmrIncompatibilityEvent): void;\n /**\n * A page runtime just connected (first load, reload, or HMR reconnect). It\n * starts from the compiled-in defaults, so whatever recording/layer state\n * this session already holds has to be replayed to it — otherwise a page\n * loaded while recording is on silently captures nothing.\n */\n runtimeReady(): void;\n}\n\n/** Where the definition sends/receives page-runtime traffic. */\nexport interface TimelineSource {\n /** Start forwarding page-runtime traffic to `sink`. Returns a detach function. */\n attach(sink: TimelineSink): () => void;\n sendInspector(cmd: InspectorCommand): void;\n toggleOverlay(): void;\n setRecording(r: boolean): void;\n setLayers(l: TimelineLayersState): void;\n /** Apply a live feature-settings override to the running page. */\n setSettingsOverride(override: SettingsOverride): void;\n}\n\n/**\n * The wire form of {@link TimelineLayersState}: the flat map of boolean toggle\n * fields the page runtime's `lit:timeline:layers-changed` listener expects,\n * not `{layers}`. Shared by every source so they cannot drift apart.\n */\nexport const layersWireFormat = (layers: TimelineLayersState) => ({\n litLifecycleEnabled: layers.litLifecycleEnabled,\n litRenderEnabled: layers.litRenderEnabled,\n litRenderVerboseEnabled: layers.litRenderVerboseEnabled,\n mouseEventEnabled: layers.mouseEventEnabled,\n keyboardEventEnabled: layers.keyboardEventEnabled,\n});\n\n/**\n * No-op source used wherever no page is attached (`createDevServer()`,\n * `createBuild()`, an MCP server). `attach()` never calls the sink; every\n * other method is a no-op.\n */\nexport function createNullSource(): TimelineSource {\n return {\n attach() {\n return () => {};\n },\n sendInspector() {},\n toggleOverlay() {},\n setRecording() {},\n setLayers() {},\n setSettingsOverride() {},\n };\n}\n"]}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools
8
3
  * hub and bridges the page runtime's `import.meta.hot` transport to the
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/vite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,MAAM,CAAC;AAChD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAMjD,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAGhB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAGlD,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,aAAa,CAAC;AAE9D,OAAO,EAAC,iBAAiB,EAAC,CAAC;AAE3B;;;;;;GAMG;AACH,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,wEAAwE;IACxE,OAAO,EAAE,CACP,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,CAAC,EAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,KACtD,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KACvE,CAAC;IACF,QAAQ,CAAC,EAAE;QAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAA;KAAC,CAAC;IACtE;;;;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M,uBAAuB,QAAO,iBAClB,CAAC"}
@@ -1,7 +1,20 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools
3
+ * hub and bridges the page runtime's `import.meta.hot` transport to the
4
+ * definition's `TimelineSource` port. Everything Vite-specific lives here:
5
+ * the definition itself must keep running under `createDevServer()` with no
6
+ * Vite installed.
7
+ *
8
+ * Vite DevTools 0.7+ is itself built on devframe, so its plugin context is a
9
+ * devframe hub context: `ctx.install(definition)` serves the panel SPA from
10
+ * the definition's `clientAssets`, registers its dock, and exposes its RPC
11
+ * over the hub's authenticated WebSocket. That is all
12
+ * `createPluginFromDevframe()` from `@vitejs/devtools-kit` does, so calling
13
+ * `install` directly keeps DevTools an optional peer we never import at
14
+ * runtime — the hook below is duck-typed, exactly as the panel's previous
15
+ * dock registration was.
16
+ *
17
+ * @see plans/devframe-foundation.md
5
18
  */
6
19
  import {
7
20
  INSPECT_CMD_CHANNEL,
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/lib/devframe/vite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAQlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAC,iBAAiB,EAAC,CAAC;AA+C3B;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAiB;IAC5B,IAAI,CAAmC;IACvC,KAAK,CAA2B;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AAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC;gBACvC,OAAO,GAAG,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC;gBACxD,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBAE9B,mEAAmE;gBACnE,oEAAoE;gBACpE,qCAAqC;gBACrC,IAAI,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;oBAChD,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;wBACvB,EAAE,EAAE,oBAAoB;wBACxB,KAAK,EAAE,kBAAkB;wBACzB,WAAW,EACT,2FAA2F;wBAC7F,IAAI,EAAE,sBAAsB;wBAC5B,QAAQ,EAAE,KAAK;wBACf,WAAW,EAAE,CAAC,EAAC,GAAG,EAAE,cAAc,EAAC,CAAC;wBACpC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;qBACtC,CAAC,CAAC;gBACL,CAAC;gBAED,mEAAmE;gBACnE,mEAAmE;gBACnE,mEAAmE;gBACnE,6BAA6B,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAsB,EAAE,CAC7D,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools\n * hub and bridges the page runtime's `import.meta.hot` transport to the\n * definition's `TimelineSource` port. Everything Vite-specific lives here:\n * the definition itself must keep running under `createDevServer()` with no\n * Vite installed.\n *\n * Vite DevTools 0.7+ is itself built on devframe, so its plugin context is a\n * devframe hub context: `ctx.install(definition)` serves the panel SPA from\n * the definition's `clientAssets`, registers its dock, and exposes its RPC\n * over the hub's authenticated WebSocket. That is all\n * `createPluginFromDevframe()` from `@vitejs/devtools-kit` does, so calling\n * `install` directly keeps DevTools an optional peer we never import at\n * runtime — the hook below is duck-typed, exactly as the panel's previous\n * dock registration was.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport type {Plugin, ViteDevServer} from 'vite';\nimport type {DevframeDefinition} from 'devframe';\nimport {\n INSPECT_CMD_CHANNEL,\n INSPECT_DATA_CHANNEL,\n INSPECT_OVERLAY_TOGGLE_CHANNEL,\n} from '../../types/inspector.js';\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport {HMR_INCOMPATIBLE_CHANNEL} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {SETTINGS_OVERRIDE_CHANNEL} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport {createLitDevframe} from './definition.js';\nimport {LIT_DEVFRAME_ID} from './protocol.js';\nimport {layersWireFormat} from './source.js';\nimport type {TimelineSink, TimelineSource} from './source.js';\n\nexport {createLitDevframe};\n\n/**\n * The slice of the Vite DevTools hub context this plugin uses. Structurally a\n * subset of `ViteDevToolsNodeContext` from `@vitejs/devtools-kit/node`;\n * declared here so the package never imports that optional peer at runtime.\n * Install `@vitejs/devtools-kit` as a dev dependency to check it against the\n * real declarations.\n */\ninterface DevToolsHubContext {\n readonly viteServer?: ViteDevServer;\n /** Serve a devframe's SPA, register its dock, and run its `setup()`. */\n install: (\n devframe: DevframeDefinition,\n options?: {base?: string; dock?: Record<string, unknown>}\n ) => Promise<void>;\n docks?: {\n activate?: (dockId: string, params?: Record<string, unknown>) => void;\n };\n commands?: {register?: (command: Record<string, unknown>) => unknown};\n /**\n * The hub's host runtime. Structurally the slice of devframe's\n * `DevframeHost` {@link registerInstance} needs; `DevframeHubContext`\n * extends `DevframeNodeContext`, which carries it.\n */\n host?: {resolveOrigin?: () => string};\n}\n\ndeclare module 'vite' {\n interface Plugin {\n /** Vite DevTools plugin hook, contributed by `@vitejs/devtools`. */\n devtools?: {\n capabilities?: {dev?: boolean; build?: boolean};\n setup: (ctx: DevToolsHubContext) => void | Promise<void>;\n };\n }\n}\n\nexport interface CreateLitDevframePluginOptions {\n version: string;\n features?: () => FeatureSettings | null;\n /** See {@link CreateLitDevframeOptions.configuredEditor}. */\n configuredEditor?: () => string | undefined;\n /** Override the built panel SPA directory. Defaults to `dist/client`. */\n clientAssets?: string;\n}\n\n/**\n * `TimelineSource` over a Vite dev server's `hot` channel.\n *\n * `install()` runs the definition's `setup()` — and therefore\n * `source.attach()` — before it resolves, so this is attached before a dev\n * server is necessarily in hand. Calls made before {@link bind} are dropped\n * rather than buffered: nothing can emit a page-runtime event until a page\n * has connected to a bound server.\n */\nexport class HotTimelineSource implements TimelineSource {\n #hot: ViteDevServer['hot'] | undefined;\n #sink: TimelineSink | undefined;\n #hub: DevToolsHubContext | undefined;\n\n /**\n * Wire the source to a live dev server. Call once, from `devtools.setup()`.\n * `hub` is optional: without it the bridge still carries page traffic both\n * ways, it just cannot bring the dock to the front on an overlay pick.\n */\n bind(server: ViteDevServer, hub?: DevToolsHubContext): void {\n this.#hub = hub;\n const hot = server.hot;\n this.#hot = hot;\n\n hot.on('lit:timeline:push-event', (data: {events?: TimelineEvent[]}) => {\n this.#sink?.pushEvents(data.events ?? []);\n });\n\n hot.on('lit:timeline:custom-layer', (data: {layer?: TimelineLayer}) => {\n if (!data.layer?.id) return;\n this.#sink?.addLayer(data.layer);\n });\n\n hot.on(INSPECT_DATA_CHANNEL, (data: InspectorMessage) => {\n // An overlay pick means the developer clicked an element in the page and\n // wants the Components tab. Bring the dock forward from the node side\n // rather than having the panel reach into the parent frame.\n if (data.type === 'pick') {\n // Carry the target with the activation, not just the dock id: the\n // params ride the hub's `devframe:docks:active` state, so a panel\n // that mounts *because of* this pick still lands on the right\n // element instead of racing the separate `pick` message.\n this.#hub?.docks?.activate?.(LIT_DEVFRAME_ID, {componentId: data.id});\n }\n this.#sink?.inspectorMessage(data);\n });\n\n hot.on(HMR_INCOMPATIBLE_CHANNEL, (event: HmrIncompatibilityEvent) => {\n this.#sink?.hmrIncompatible(event);\n });\n\n // The runtime announces itself on every connect. It boots from the\n // compiled-in defaults (recording off), so the session's current state\n // has to be pushed back down or a page that loads while recording is on\n // captures nothing while every surface still reports `recording: true`.\n hot.on('lit:timeline:runtime-ready', () => {\n this.#sink?.runtimeReady();\n });\n }\n\n /** Toggle the page's inspect overlay. Also used by the palette command. */\n toggleOverlay(): void {\n this.#hot?.send(INSPECT_OVERLAY_TOGGLE_CHANNEL);\n }\n\n attach(sink: TimelineSink): () => void {\n this.#sink = sink;\n return () => {\n if (this.#sink === sink) this.#sink = undefined;\n };\n }\n\n sendInspector(cmd: InspectorCommand): void {\n this.#hot?.send(INSPECT_CMD_CHANNEL, cmd);\n }\n\n setRecording(recording: boolean): void {\n this.#hot?.send('lit:timeline:recording-changed', {recording});\n }\n\n setLayers(layers: TimelineLayersState): void {\n this.#hot?.send('lit:timeline:layers-changed', layersWireFormat(layers));\n }\n\n setSettingsOverride(override: SettingsOverride): void {\n this.#hot?.send(SETTINGS_OVERRIDE_CHANNEL, override);\n }\n}\n\n/**\n * One warning per process, not per dev server: a restart-heavy session\n * should not paper the terminal with the same advisory. Carries the reason,\n * because \"discovery unavailable\" with no cause is the kind of message that\n * costs an afternoon when the guess below finally goes stale.\n */\nlet warnedDiscoveryUnavailable = false;\n\nconst warnDiscoveryUnavailable = (reason: string): void => {\n if (warnedDiscoveryUnavailable) return;\n warnedDiscoveryUnavailable = true;\n console.warn(\n `[lit-plugin] devframe instance-registry discovery unavailable ` +\n `(${reason}); stdio MCP clients cannot auto-discover this dev ` +\n `server. The MCP endpoint itself is unaffected — point clients at ` +\n `<dev-server-origin>/__devtools/__mcp directly.`\n );\n};\n\n/**\n * Publish this devframe in devframe's global instance registry\n * (`~/.devframe/instances/`), so stdio MCP connectors — `devframe connect`,\n * this package's own `lit-devtools mcp` — find the running dev server\n * without port guessing.\n *\n * `createDevServer()` registers itself, but this plugin never goes through\n * it: it mounts into the Vite DevTools hub, and `@vitejs/devtools@0.7.5`\n * calls `initHub()` with no `register` option, which defaults to off. So a\n * Vite-hosted devframe is invisible to discovery unless a plugin publishes\n * the record itself — which is all this does. `registerDevframeInstance()`\n * is documented for exactly this case (\"custom hosts that serve a devframe\n * in-process call this explicitly with the origin they are reachable at\"),\n * and the registry is a directory of per-`pid`+`port` JSON files, so\n * registrants coexist.\n *\n * The mount path is the soft spot: `/__devtools/` is where this version of\n * Vite DevTools mounts, not a promise about where a devframe host mounts in\n * general. So the guess is verified before it is published — the same\n * `probeDevframeOrigin()` primitive the registry's own liveness check uses\n * has to answer at that base, or nothing is registered. A record that\n * doesn't answer is worse than no record: an agent dials it and gets 404s\n * from a server that claimed to be there.\n *\n * The MCP path is then taken from what that probe *reports* rather than\n * assumed to be the `__mcp` default, which removes the second guess\n * entirely. Note the two path conventions in play: `__connection.json`\n * serves `mcp.path` **relative** to the base (`\"__mcp\"`), while a registry\n * record stores it **absolute** (`\"/__devtools/__mcp\"`) because the\n * connector dials `origin + record.mcp.path` directly. Joining the two is\n * exactly what devframe's own `probePort()` does with its root-mounted\n * probe.\n *\n * Known sharp edge: records are keyed by `pid`+`port` alone. Another\n * devframe-hosting plugin in the same Vite process would share this file,\n * and whichever unregisters first removes it for both. Single-devframe use\n * is the common case and there is no cross-plugin coordination primitive\n * today.\n */\nasync function registerInstance(\n ctx: DevToolsHubContext,\n name: string\n): Promise<{unregister: () => void} | {reason: string}> {\n // Both imports are dynamic and optional: `@vitejs/devtools-kit` is an\n // optional peer this package must never hard-resolve, and `devframe`'s\n // `internal` subpath is only needed on this path.\n const constants = await import('@vitejs/devtools-kit/constants').catch(\n () => null\n );\n const internal = await import('devframe/internal').catch(() => null);\n if (!constants) return {reason: '@vitejs/devtools-kit not resolvable'};\n if (!internal) return {reason: 'devframe/internal not resolvable'};\n\n const basePath = constants.DEVTOOLS_MOUNT_PATH;\n const origin = ctx.host?.resolveOrigin?.();\n if (!origin) return {reason: 'host origin unavailable'};\n\n const probed = await internal.probeDevframeOrigin(origin, basePath);\n if (!probed) {\n return {reason: `no devframe answered at ${origin}${basePath}`};\n }\n\n // Relative (`\"__mcp\"`) as served, absolute as stored — see above. A host\n // that already reports an absolute path is passed through unchanged.\n const reported = probed.meta.mcp?.path;\n const mcpPath =\n reported === undefined\n ? null\n : reported.startsWith('/')\n ? reported\n : `${basePath}${reported}`;\n\n const {unregister} = internal.registerDevframeInstance({\n pid: process.pid,\n // The probe reports the origin that actually answered — a `localhost`\n // bind may only be dialable as `127.0.0.1` or `[::1]` — so its port is\n // the one truly listening, which `config.server.port` is not when the\n // configured port was taken.\n port: Number(new URL(probed.origin).port) || 0,\n origin: probed.origin,\n basePath,\n id: LIT_DEVFRAME_ID,\n name,\n rootDir: process.cwd(),\n // Registering with `mcp: null` is honest rather than useless: the\n // connector surfaces the instance with its own \"MCP disabled\" hint,\n // which beats the instance being invisible.\n mcp: mcpPath === null ? null : {path: mcpPath},\n startedAt: Date.now(),\n });\n return {unregister};\n}\n\n/**\n * Register once the dev server is actually accepting connections. The\n * DevTools `setup()` hook runs during server construction, well before\n * `listen()` resolves, so probing from there always fails to connect — the\n * record has to wait for the port it is about to advertise to be real.\n */\nfunction registerInstanceWhenListening(\n ctx: DevToolsHubContext,\n name: string\n): void {\n const httpServer = ctx.viteServer?.httpServer;\n if (!httpServer) {\n // Middleware mode: no server of our own to advertise.\n warnDiscoveryUnavailable('no HTTP server (middleware mode?)');\n return;\n }\n\n const run = (): void => {\n registerInstance(ctx, name)\n .then((result) => {\n if ('unregister' in result) {\n httpServer.once('close', result.unregister);\n } else {\n warnDiscoveryUnavailable(result.reason);\n }\n })\n .catch((error: unknown) => {\n warnDiscoveryUnavailable(String(error));\n });\n };\n\n if (httpServer.listening) run();\n else httpServer.once('listening', run);\n}\n\n/**\n * The Vite plugin that mounts the Lit devframe on the DevTools hub. A no-op\n * when DevTools is not active: without it nothing calls `devtools.setup()`,\n * so the definition is never installed and the panel simply isn't there.\n */\nexport function createLitDevframePlugin(\n options: CreateLitDevframePluginOptions\n): Plugin {\n const source = new HotTimelineSource();\n // Only known once `setup()` has the dev server, which is after the\n // definition is built -- hence the getter.\n let viteRoot: string | undefined;\n let fsAllow: readonly string[] = [];\n const definition = createLitDevframe({\n source,\n version: options.version,\n features: options.features,\n configuredEditor: options.configuredEditor,\n clientAssets: options.clientAssets,\n sourceRoot: () => viteRoot,\n allowedRoots: () => fsAllow,\n });\n\n return {\n name: `devframe:${LIT_DEVFRAME_ID}`,\n devtools: {\n // The panel reflects a running page, so there is nothing to mount\n // during `vite build`. A static snapshot goes through\n // `devframe/adapters/build` instead.\n capabilities: {dev: true, build: false},\n async setup(ctx) {\n // Bind before installing: `install()` runs the definition's `setup()`,\n // which attaches to this source, and the dev server is already\n // available on the context by now.\n if (ctx.viteServer) source.bind(ctx.viteServer, ctx);\n viteRoot = ctx.viteServer?.config.root;\n fsAllow = ctx.viteServer?.config.server.fs?.allow ?? [];\n await ctx.install(definition);\n\n // The overlay picker as a palette command with a managed shortcut.\n // Only meaningful when the source overlay is enabled, since that is\n // what draws the picker in the page.\n if (options.features?.()?.sourceOverlay.enabled) {\n ctx.commands?.register?.({\n id: 'lit:overlay:toggle',\n title: 'Pick Lit Element',\n description:\n 'Click to inspect in the Components panel, hold Meta/Ctrl and click to open in your editor',\n icon: 'ph:crosshair-duotone',\n category: 'Lit',\n keybindings: [{key: 'Meta+Shift+E'}],\n handler: () => source.toggleOverlay(),\n });\n }\n\n // Discovery is a convenience on top of a panel that already works,\n // so this never blocks `setup()` and never throws: a failure costs\n // the user the stdio MCP shortcut, and the direct URL still works.\n registerInstanceWhenListening(ctx, definition.name);\n },\n },\n };\n}\n\n/**\n * The page-runtime bridge on its own, for a host that drives its own mount\n * (or a test that wants to observe page traffic without a hub). Bind it to a\n * dev server, then either hand it to {@link createLitDevframe} or\n * {@link TimelineSource.attach} your own sink.\n */\nexport const createHotTimelineSource = (): HotTimelineSource =>\n new HotTimelineSource();\n"]}
1
+ {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/lib/devframe/vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAC,yBAAyB,EAAC,MAAM,yBAAyB,CAAC;AAQlE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAC,iBAAiB,EAAC,CAAC;AA+C3B;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAiB;IAC5B,IAAI,CAAmC;IACvC,KAAK,CAA2B;IAChC,IAAI,CAAiC;IAErC;;;;OAIG;IACH,IAAI,CAAC,MAAqB,EAAE,GAAwB;QAClD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAEhB,GAAG,CAAC,EAAE,CAAC,yBAAyB,EAAE,CAAC,IAAgC,EAAE,EAAE;YACrE,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,2BAA2B,EAAE,CAAC,IAA6B,EAAE,EAAE;YACpE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE;gBAAE,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E,KAAK;wBACf,WAAW,EAAE,CAAC,EAAC,GAAG,EAAE,cAAc,EAAC,CAAC;wBACpC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;qBACtC,CAAC,CAAC;gBACL,CAAC;gBAED,mEAAmE;gBACnE,mEAAmE;gBACnE,mEAAmE;gBACnE,6BAA6B,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAsB,EAAE,CAC7D,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["/**\n * Mounts the Lit devframe ({@link createLitDevframe}) into the Vite DevTools\n * hub and bridges the page runtime's `import.meta.hot` transport to the\n * definition's `TimelineSource` port. Everything Vite-specific lives here:\n * the definition itself must keep running under `createDevServer()` with no\n * Vite installed.\n *\n * Vite DevTools 0.7+ is itself built on devframe, so its plugin context is a\n * devframe hub context: `ctx.install(definition)` serves the panel SPA from\n * the definition's `clientAssets`, registers its dock, and exposes its RPC\n * over the hub's authenticated WebSocket. That is all\n * `createPluginFromDevframe()` from `@vitejs/devtools-kit` does, so calling\n * `install` directly keeps DevTools an optional peer we never import at\n * runtime — the hook below is duck-typed, exactly as the panel's previous\n * dock registration was.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport type {Plugin, ViteDevServer} from 'vite';\nimport type {DevframeDefinition} from 'devframe';\nimport {\n INSPECT_CMD_CHANNEL,\n INSPECT_DATA_CHANNEL,\n INSPECT_OVERLAY_TOGGLE_CHANNEL,\n} from '../../types/inspector.js';\nimport type {\n InspectorCommand,\n InspectorMessage,\n} from '../../types/inspector.js';\nimport {HMR_INCOMPATIBLE_CHANNEL} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {SETTINGS_OVERRIDE_CHANNEL} from '../../types/timeline.js';\nimport type {\n FeatureSettings,\n SettingsOverride,\n TimelineEvent,\n TimelineLayer,\n TimelineLayersState,\n} from '../../types/timeline.js';\nimport {createLitDevframe} from './definition.js';\nimport {LIT_DEVFRAME_ID} from './protocol.js';\nimport {layersWireFormat} from './source.js';\nimport type {TimelineSink, TimelineSource} from './source.js';\n\nexport {createLitDevframe};\n\n/**\n * The slice of the Vite DevTools hub context this plugin uses. Structurally a\n * subset of `ViteDevToolsNodeContext` from `@vitejs/devtools-kit/node`;\n * declared here so the package never imports that optional peer at runtime.\n * Install `@vitejs/devtools-kit` as a dev dependency to check it against the\n * real declarations.\n */\ninterface DevToolsHubContext {\n readonly viteServer?: ViteDevServer;\n /** Serve a devframe's SPA, register its dock, and run its `setup()`. */\n install: (\n devframe: DevframeDefinition,\n options?: {base?: string; dock?: Record<string, unknown>}\n ) => Promise<void>;\n docks?: {\n activate?: (dockId: string, params?: Record<string, unknown>) => void;\n };\n commands?: {register?: (command: Record<string, unknown>) => unknown};\n /**\n * The hub's host runtime. Structurally the slice of devframe's\n * `DevframeHost` {@link registerInstance} needs; `DevframeHubContext`\n * extends `DevframeNodeContext`, which carries it.\n */\n host?: {resolveOrigin?: () => string};\n}\n\ndeclare module 'vite' {\n interface Plugin {\n /** Vite DevTools plugin hook, contributed by `@vitejs/devtools`. */\n devtools?: {\n capabilities?: {dev?: boolean; build?: boolean};\n setup: (ctx: DevToolsHubContext) => void | Promise<void>;\n };\n }\n}\n\nexport interface CreateLitDevframePluginOptions {\n version: string;\n features?: () => FeatureSettings | null;\n /** See {@link CreateLitDevframeOptions.configuredEditor}. */\n configuredEditor?: () => string | undefined;\n /** Override the built panel SPA directory. Defaults to `dist/client`. */\n clientAssets?: string;\n}\n\n/**\n * `TimelineSource` over a Vite dev server's `hot` channel.\n *\n * `install()` runs the definition's `setup()` — and therefore\n * `source.attach()` — before it resolves, so this is attached before a dev\n * server is necessarily in hand. Calls made before {@link bind} are dropped\n * rather than buffered: nothing can emit a page-runtime event until a page\n * has connected to a bound server.\n */\nexport class HotTimelineSource implements TimelineSource {\n #hot: ViteDevServer['hot'] | undefined;\n #sink: TimelineSink | undefined;\n #hub: DevToolsHubContext | undefined;\n\n /**\n * Wire the source to a live dev server. Call once, from `devtools.setup()`.\n * `hub` is optional: without it the bridge still carries page traffic both\n * ways, it just cannot bring the dock to the front on an overlay pick.\n */\n bind(server: ViteDevServer, hub?: DevToolsHubContext): void {\n this.#hub = hub;\n const hot = server.hot;\n this.#hot = hot;\n\n hot.on('lit:timeline:push-event', (data: {events?: TimelineEvent[]}) => {\n this.#sink?.pushEvents(data.events ?? []);\n });\n\n hot.on('lit:timeline:custom-layer', (data: {layer?: TimelineLayer}) => {\n if (!data.layer?.id) return;\n this.#sink?.addLayer(data.layer);\n });\n\n hot.on(INSPECT_DATA_CHANNEL, (data: InspectorMessage) => {\n // An overlay pick means the developer clicked an element in the page and\n // wants the Components tab. Bring the dock forward from the node side\n // rather than having the panel reach into the parent frame.\n if (data.type === 'pick') {\n // Carry the target with the activation, not just the dock id: the\n // params ride the hub's `devframe:docks:active` state, so a panel\n // that mounts *because of* this pick still lands on the right\n // element instead of racing the separate `pick` message.\n this.#hub?.docks?.activate?.(LIT_DEVFRAME_ID, {componentId: data.id});\n }\n this.#sink?.inspectorMessage(data);\n });\n\n hot.on(HMR_INCOMPATIBLE_CHANNEL, (event: HmrIncompatibilityEvent) => {\n this.#sink?.hmrIncompatible(event);\n });\n\n // The runtime announces itself on every connect. It boots from the\n // compiled-in defaults (recording off), so the session's current state\n // has to be pushed back down or a page that loads while recording is on\n // captures nothing while every surface still reports `recording: true`.\n hot.on('lit:timeline:runtime-ready', () => {\n this.#sink?.runtimeReady();\n });\n }\n\n /** Toggle the page's inspect overlay. Also used by the palette command. */\n toggleOverlay(): void {\n this.#hot?.send(INSPECT_OVERLAY_TOGGLE_CHANNEL);\n }\n\n attach(sink: TimelineSink): () => void {\n this.#sink = sink;\n return () => {\n if (this.#sink === sink) this.#sink = undefined;\n };\n }\n\n sendInspector(cmd: InspectorCommand): void {\n this.#hot?.send(INSPECT_CMD_CHANNEL, cmd);\n }\n\n setRecording(recording: boolean): void {\n this.#hot?.send('lit:timeline:recording-changed', {recording});\n }\n\n setLayers(layers: TimelineLayersState): void {\n this.#hot?.send('lit:timeline:layers-changed', layersWireFormat(layers));\n }\n\n setSettingsOverride(override: SettingsOverride): void {\n this.#hot?.send(SETTINGS_OVERRIDE_CHANNEL, override);\n }\n}\n\n/**\n * One warning per process, not per dev server: a restart-heavy session\n * should not paper the terminal with the same advisory. Carries the reason,\n * because \"discovery unavailable\" with no cause is the kind of message that\n * costs an afternoon when the guess below finally goes stale.\n */\nlet warnedDiscoveryUnavailable = false;\n\nconst warnDiscoveryUnavailable = (reason: string): void => {\n if (warnedDiscoveryUnavailable) return;\n warnedDiscoveryUnavailable = true;\n console.warn(\n `[lit-plugin] devframe instance-registry discovery unavailable ` +\n `(${reason}); stdio MCP clients cannot auto-discover this dev ` +\n `server. The MCP endpoint itself is unaffected — point clients at ` +\n `<dev-server-origin>/__devtools/__mcp directly.`\n );\n};\n\n/**\n * Publish this devframe in devframe's global instance registry\n * (`~/.devframe/instances/`), so stdio MCP connectors — `devframe connect`,\n * this package's own `lit-devtools mcp` — find the running dev server\n * without port guessing.\n *\n * `createDevServer()` registers itself, but this plugin never goes through\n * it: it mounts into the Vite DevTools hub, and `@vitejs/devtools@0.7.5`\n * calls `initHub()` with no `register` option, which defaults to off. So a\n * Vite-hosted devframe is invisible to discovery unless a plugin publishes\n * the record itself — which is all this does. `registerDevframeInstance()`\n * is documented for exactly this case (\"custom hosts that serve a devframe\n * in-process call this explicitly with the origin they are reachable at\"),\n * and the registry is a directory of per-`pid`+`port` JSON files, so\n * registrants coexist.\n *\n * The mount path is the soft spot: `/__devtools/` is where this version of\n * Vite DevTools mounts, not a promise about where a devframe host mounts in\n * general. So the guess is verified before it is published — the same\n * `probeDevframeOrigin()` primitive the registry's own liveness check uses\n * has to answer at that base, or nothing is registered. A record that\n * doesn't answer is worse than no record: an agent dials it and gets 404s\n * from a server that claimed to be there.\n *\n * The MCP path is then taken from what that probe *reports* rather than\n * assumed to be the `__mcp` default, which removes the second guess\n * entirely. Note the two path conventions in play: `__connection.json`\n * serves `mcp.path` **relative** to the base (`\"__mcp\"`), while a registry\n * record stores it **absolute** (`\"/__devtools/__mcp\"`) because the\n * connector dials `origin + record.mcp.path` directly. Joining the two is\n * exactly what devframe's own `probePort()` does with its root-mounted\n * probe.\n *\n * Known sharp edge: records are keyed by `pid`+`port` alone. Another\n * devframe-hosting plugin in the same Vite process would share this file,\n * and whichever unregisters first removes it for both. Single-devframe use\n * is the common case and there is no cross-plugin coordination primitive\n * today.\n */\nasync function registerInstance(\n ctx: DevToolsHubContext,\n name: string\n): Promise<{unregister: () => void} | {reason: string}> {\n // Both imports are dynamic and optional: `@vitejs/devtools-kit` is an\n // optional peer this package must never hard-resolve, and `devframe`'s\n // `internal` subpath is only needed on this path.\n const constants = await import('@vitejs/devtools-kit/constants').catch(\n () => null\n );\n const internal = await import('devframe/internal').catch(() => null);\n if (!constants) return {reason: '@vitejs/devtools-kit not resolvable'};\n if (!internal) return {reason: 'devframe/internal not resolvable'};\n\n const basePath = constants.DEVTOOLS_MOUNT_PATH;\n const origin = ctx.host?.resolveOrigin?.();\n if (!origin) return {reason: 'host origin unavailable'};\n\n const probed = await internal.probeDevframeOrigin(origin, basePath);\n if (!probed) {\n return {reason: `no devframe answered at ${origin}${basePath}`};\n }\n\n // Relative (`\"__mcp\"`) as served, absolute as stored — see above. A host\n // that already reports an absolute path is passed through unchanged.\n const reported = probed.meta.mcp?.path;\n const mcpPath =\n reported === undefined\n ? null\n : reported.startsWith('/')\n ? reported\n : `${basePath}${reported}`;\n\n const {unregister} = internal.registerDevframeInstance({\n pid: process.pid,\n // The probe reports the origin that actually answered — a `localhost`\n // bind may only be dialable as `127.0.0.1` or `[::1]` — so its port is\n // the one truly listening, which `config.server.port` is not when the\n // configured port was taken.\n port: Number(new URL(probed.origin).port) || 0,\n origin: probed.origin,\n basePath,\n id: LIT_DEVFRAME_ID,\n name,\n rootDir: process.cwd(),\n // Registering with `mcp: null` is honest rather than useless: the\n // connector surfaces the instance with its own \"MCP disabled\" hint,\n // which beats the instance being invisible.\n mcp: mcpPath === null ? null : {path: mcpPath},\n startedAt: Date.now(),\n });\n return {unregister};\n}\n\n/**\n * Register once the dev server is actually accepting connections. The\n * DevTools `setup()` hook runs during server construction, well before\n * `listen()` resolves, so probing from there always fails to connect — the\n * record has to wait for the port it is about to advertise to be real.\n */\nfunction registerInstanceWhenListening(\n ctx: DevToolsHubContext,\n name: string\n): void {\n const httpServer = ctx.viteServer?.httpServer;\n if (!httpServer) {\n // Middleware mode: no server of our own to advertise.\n warnDiscoveryUnavailable('no HTTP server (middleware mode?)');\n return;\n }\n\n const run = (): void => {\n registerInstance(ctx, name)\n .then((result) => {\n if ('unregister' in result) {\n httpServer.once('close', result.unregister);\n } else {\n warnDiscoveryUnavailable(result.reason);\n }\n })\n .catch((error: unknown) => {\n warnDiscoveryUnavailable(String(error));\n });\n };\n\n if (httpServer.listening) run();\n else httpServer.once('listening', run);\n}\n\n/**\n * The Vite plugin that mounts the Lit devframe on the DevTools hub. A no-op\n * when DevTools is not active: without it nothing calls `devtools.setup()`,\n * so the definition is never installed and the panel simply isn't there.\n */\nexport function createLitDevframePlugin(\n options: CreateLitDevframePluginOptions\n): Plugin {\n const source = new HotTimelineSource();\n // Only known once `setup()` has the dev server, which is after the\n // definition is built -- hence the getter.\n let viteRoot: string | undefined;\n let fsAllow: readonly string[] = [];\n const definition = createLitDevframe({\n source,\n version: options.version,\n features: options.features,\n configuredEditor: options.configuredEditor,\n clientAssets: options.clientAssets,\n sourceRoot: () => viteRoot,\n allowedRoots: () => fsAllow,\n });\n\n return {\n name: `devframe:${LIT_DEVFRAME_ID}`,\n devtools: {\n // The panel reflects a running page, so there is nothing to mount\n // during `vite build`. A static snapshot goes through\n // `devframe/adapters/build` instead.\n capabilities: {dev: true, build: false},\n async setup(ctx) {\n // Bind before installing: `install()` runs the definition's `setup()`,\n // which attaches to this source, and the dev server is already\n // available on the context by now.\n if (ctx.viteServer) source.bind(ctx.viteServer, ctx);\n viteRoot = ctx.viteServer?.config.root;\n fsAllow = ctx.viteServer?.config.server.fs?.allow ?? [];\n await ctx.install(definition);\n\n // The overlay picker as a palette command with a managed shortcut.\n // Only meaningful when the source overlay is enabled, since that is\n // what draws the picker in the page.\n if (options.features?.()?.sourceOverlay.enabled) {\n ctx.commands?.register?.({\n id: 'lit:overlay:toggle',\n title: 'Pick Lit Element',\n description:\n 'Click to inspect in the Components panel, hold Meta/Ctrl and click to open in your editor',\n icon: 'ph:crosshair-duotone',\n category: 'Lit',\n keybindings: [{key: 'Meta+Shift+E'}],\n handler: () => source.toggleOverlay(),\n });\n }\n\n // Discovery is a convenience on top of a panel that already works,\n // so this never blocks `setup()` and never throws: a failure costs\n // the user the stdio MCP shortcut, and the direct URL still works.\n registerInstanceWhenListening(ctx, definition.name);\n },\n },\n };\n}\n\n/**\n * The page-runtime bridge on its own, for a host that drives its own mount\n * (or a test that wants to observe page traffic without a hub). Bind it to a\n * dev server, then either hand it to {@link createLitDevframe} or\n * {@link TimelineSource.attach} your own sink.\n */\nexport const createHotTimelineSource = (): HotTimelineSource =>\n new HotTimelineSource();\n"]}
package/lib/http.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * Headers the trust check looks at. Both the open-in-editor endpoint and the
8
3
  * timeline/inspector endpoints are local-only dev tooling: only the page the
package/lib/http.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,YAAa,YAAY,KAAG,OAgBxD,CAAC"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,YAAa,YAAY,KAAG,OAgBxD,CAAC"}
package/lib/http.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /**
7
2
  * True when the request demonstrably comes from the dev server's own page.
8
3
  *
package/lib/http.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAqB,EAAW,EAAE;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,KAAK,CAAC;IAC9D,CAAC;IACD,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC;YACH,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,sEAAsE;IACtE,OAAO,IAAI,KAAK,SAAS,CAAC;AAC5B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Headers the trust check looks at. Both the open-in-editor endpoint and the\n * timeline/inspector endpoints are local-only dev tooling: only the page the\n * dev server itself served may drive them.\n */\nexport interface TrustHeaders {\n origin?: string;\n host?: string;\n 'sec-fetch-site'?: string;\n}\n\n/**\n * True when the request demonstrably comes from the dev server's own page.\n *\n * Two independent signals, because neither is present on every request:\n * - `Origin` is sent on CORS-mode fetches and on every non-GET/HEAD request,\n * but NOT on a plain cross-site GET (`<img>`, `<iframe>`, a navigation).\n * - `Sec-Fetch-Site` is sent by Chromium and Firefox on every request and is\n * the signal that covers exactly that gap; `same-origin` and `none` (a\n * user-typed URL) are ours, `cross-site`/`same-site` are not.\n * A request is trusted only when every signal it does carry says same-origin,\n * and at least one of them is present.\n *\n * This does not stop DNS rebinding, where a hostile page reaches the server\n * under its own name and `Origin` and `Host` agree. Vite's\n * `server.allowedHosts` check does, and it runs before any plugin middleware,\n * so this doesn't repeat it (source-overlay_test pins that ordering).\n */\nexport const isTrustedRequest = (headers: TrustHeaders): boolean => {\n const site = headers['sec-fetch-site'];\n if (site !== undefined) {\n if (site !== 'same-origin' && site !== 'none') return false;\n }\n const {origin, host} = headers;\n if (origin !== undefined && origin !== 'null') {\n try {\n if (new URL(origin).host !== host) return false;\n } catch {\n return false;\n }\n return true;\n }\n // No `Origin`: trust only when `Sec-Fetch-Site` vouched for it above.\n return site !== undefined;\n};\n"]}
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/lib/http.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAqB,EAAW,EAAE;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,KAAK,CAAC;IAC9D,CAAC;IACD,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC9C,IAAI,CAAC;YACH,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,sEAAsE;IACtE,OAAO,IAAI,KAAK,SAAS,CAAC;AAC5B,CAAC,CAAC","sourcesContent":["/**\n * Headers the trust check looks at. Both the open-in-editor endpoint and the\n * timeline/inspector endpoints are local-only dev tooling: only the page the\n * dev server itself served may drive them.\n */\nexport interface TrustHeaders {\n origin?: string;\n host?: string;\n 'sec-fetch-site'?: string;\n}\n\n/**\n * True when the request demonstrably comes from the dev server's own page.\n *\n * Two independent signals, because neither is present on every request:\n * - `Origin` is sent on CORS-mode fetches and on every non-GET/HEAD request,\n * but NOT on a plain cross-site GET (`<img>`, `<iframe>`, a navigation).\n * - `Sec-Fetch-Site` is sent by Chromium and Firefox on every request and is\n * the signal that covers exactly that gap; `same-origin` and `none` (a\n * user-typed URL) are ours, `cross-site`/`same-site` are not.\n * A request is trusted only when every signal it does carry says same-origin,\n * and at least one of them is present.\n *\n * This does not stop DNS rebinding, where a hostile page reaches the server\n * under its own name and `Origin` and `Host` agree. Vite's\n * `server.allowedHosts` check does, and it runs before any plugin middleware,\n * so this doesn't repeat it (source-overlay_test pins that ordering).\n */\nexport const isTrustedRequest = (headers: TrustHeaders): boolean => {\n const site = headers['sec-fetch-site'];\n if (site !== undefined) {\n if (site !== 'same-origin' && site !== 'none') return false;\n }\n const {origin, host} = headers;\n if (origin !== undefined && origin !== 'null') {\n try {\n if (new URL(origin).host !== host) return false;\n } catch {\n return false;\n }\n return true;\n }\n // No `Origin`: trust only when `Sec-Fetch-Site` vouched for it above.\n return site !== undefined;\n};\n"]}
package/lib/icons.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /** `cube` — Components tab. */
7
2
  export declare const CUBE_ICON = "M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z";
8
3
  /** `clock` — Timeline tab. */
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,+BAA+B;AAC/B,eAAO,MAAM,SAAS,mTAC4R,CAAC;AAEnT,8BAA8B;AAC9B,eAAO,MAAM,UAAU,gMACwK,CAAC;AAEhM,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,qNACsL,CAAC;AAErN,6BAA6B;AAC7B,eAAO,MAAM,SAAS,01DACm0D,CAAC;AAE11D,iEAAiE;AACjE,eAAO,MAAM,SAAS,gbAA0a,CAAC;AAEjc,mEAAmE;AACnE,eAAO,MAAM,SAAS,yPAAmP,CAAC;AAE1Q,iDAAiD;AACjD,eAAO,MAAM,UAAU,kfAA4e,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAMA,+BAA+B;AAC/B,eAAO,MAAM,SAAS,mTAC4R,CAAC;AAEnT,8BAA8B;AAC9B,eAAO,MAAM,UAAU,gMACwK,CAAC;AAEhM,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,qNACsL,CAAC;AAErN,6BAA6B;AAC7B,eAAO,MAAM,SAAS,01DACm0D,CAAC;AAE11D,iEAAiE;AACjE,eAAO,MAAM,SAAS,gbAA0a,CAAC;AAEjc,mEAAmE;AACnE,eAAO,MAAM,SAAS,yPAAmP,CAAC;AAE1Q,iDAAiD;AACjD,eAAO,MAAM,UAAU,kfAA4e,CAAC"}
package/lib/icons.js CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  // Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools
7
2
  // modules stay self-contained with no extra icon library dependency.
8
3
  // Panel icons are SVG path data used via <svg viewBox="0 0 256 256"
package/lib/icons.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0EAA0E;AAC1E,qEAAqE;AACrE,oEAAoE;AACpE,2EAA2E;AAC3E,wBAAwB;AAExB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GACpB,gTAAgT,CAAC;AAEnT,8BAA8B;AAC9B,MAAM,CAAC,MAAM,UAAU,GACrB,6LAA6L,CAAC;AAEhM,oCAAoC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,kNAAkN,CAAC;AAErN,6BAA6B;AAC7B,MAAM,CAAC,MAAM,SAAS,GACpB,u1DAAu1D,CAAC;AAE11D,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,uaAAua,CAAC;AAEjc,mEAAmE;AACnE,MAAM,CAAC,MAAM,SAAS,GAAG,gPAAgP,CAAC;AAE1Q,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,yeAAye,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools\n// modules stay self-contained with no extra icon library dependency.\n// Panel icons are SVG path data used via <svg viewBox=\"0 0 256 256\"\n// fill=\"currentColor\"><path d={...}/></svg>; runtime icons are full markup\n// injected as raw HTML.\n\n/** `cube` — Components tab. */\nexport const CUBE_ICON =\n 'M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z';\n\n/** `clock` — Timeline tab. */\nexport const CLOCK_ICON =\n 'M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z';\n\n/** `notification` — Updates tab. */\nexport const NOTIFICATION_ICON =\n 'M216,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V56A16,16,0,0,1,48,40h80a8,8,0,0,1,0,16H48V208H200V128a8,8,0,0,1,16,0Zm16-68a36,36,0,1,1-36-36A36,36,0,0,1,232,60Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,216,60Z';\n\n/** `gear` — Settings tab. */\nexport const GEAR_ICON =\n 'M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z';\n\n/** `code` — the source overlay's \"open in editor\" affordance. */\nexport const CODE_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z\"></path></svg>`;\n\n/** `copy-simple` — the source overlay's \"copy path\" affordance. */\nexport const COPY_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z\"></path></svg>`;\n\n/** `flame` — the HMR update indicator's mark. */\nexport const FLAME_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M183.89,153.34a57.6,57.6,0,0,1-46.56,46.55A8.75,8.75,0,0,1,136,200a8,8,0,0,1-1.32-15.89c16.57-2.79,30.63-16.85,33.44-33.45a8,8,0,0,1,15.78,2.68ZM216,144a88,88,0,0,1-176,0c0-27.92,11-56.47,32.66-84.85a8,8,0,0,1,11.93-.89l24.12,23.41,22-60.41a8,8,0,0,1,12.63-3.41C165.21,36,216,84.55,216,144Zm-16,0c0-46.09-35.79-85.92-58.21-106.33L119.52,98.74a8,8,0,0,1-13.09,3L80.06,76.16C64.09,99.21,56,122,56,144a72,72,0,0,0,144,0Z\"></path></svg>`;\n"]}
1
+ {"version":3,"file":"icons.js","sourceRoot":"","sources":["../src/lib/icons.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qEAAqE;AACrE,oEAAoE;AACpE,2EAA2E;AAC3E,wBAAwB;AAExB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GACpB,gTAAgT,CAAC;AAEnT,8BAA8B;AAC9B,MAAM,CAAC,MAAM,UAAU,GACrB,6LAA6L,CAAC;AAEhM,oCAAoC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,kNAAkN,CAAC;AAErN,6BAA6B;AAC7B,MAAM,CAAC,MAAM,SAAS,GACpB,u1DAAu1D,CAAC;AAE11D,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,uaAAua,CAAC;AAEjc,mEAAmE;AACnE,MAAM,CAAC,MAAM,SAAS,GAAG,gPAAgP,CAAC;AAE1Q,iDAAiD;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,yeAAye,CAAC","sourcesContent":["// Phosphor Icons (https://phosphoricons.com, MIT) inlined so the devtools\n// modules stay self-contained with no extra icon library dependency.\n// Panel icons are SVG path data used via <svg viewBox=\"0 0 256 256\"\n// fill=\"currentColor\"><path d={...}/></svg>; runtime icons are full markup\n// injected as raw HTML.\n\n/** `cube` — Components tab. */\nexport const CUBE_ICON =\n 'M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z';\n\n/** `clock` — Timeline tab. */\nexport const CLOCK_ICON =\n 'M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z';\n\n/** `notification` — Updates tab. */\nexport const NOTIFICATION_ICON =\n 'M216,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V56A16,16,0,0,1,48,40h80a8,8,0,0,1,0,16H48V208H200V128a8,8,0,0,1,16,0Zm16-68a36,36,0,1,1-36-36A36,36,0,0,1,232,60Zm-16,0a20,20,0,1,0-20,20A20,20,0,0,0,216,60Z';\n\n/** `gear` — Settings tab. */\nexport const GEAR_ICON =\n 'M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z';\n\n/** `code` — the source overlay's \"open in editor\" affordance. */\nexport const CODE_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z\"></path></svg>`;\n\n/** `copy-simple` — the source overlay's \"copy path\" affordance. */\nexport const COPY_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z\"></path></svg>`;\n\n/** `flame` — the HMR update indicator's mark. */\nexport const FLAME_ICON = `<svg viewBox=\"0 0 256 256\" aria-hidden=\"true\"><path d=\"M183.89,153.34a57.6,57.6,0,0,1-46.56,46.55A8.75,8.75,0,0,1,136,200a8,8,0,0,1-1.32-15.89c16.57-2.79,30.63-16.85,33.44-33.45a8,8,0,0,1,15.78,2.68ZM216,144a88,88,0,0,1-176,0c0-27.92,11-56.47,32.66-84.85a8,8,0,0,1,11.93-.89l24.12,23.41,22-60.41a8,8,0,0,1,12.63-3.41C165.21,36,216,84.55,216,144Zm-16,0c0-46.09-35.79-85.92-58.21-106.33L119.52,98.74a8,8,0,0,1-13.09,3L80.06,76.16C64.09,99.21,56,122,56,144a72,72,0,0,0,144,0Z\"></path></svg>`;\n"]}