@oddsquad/vite-plugin-lit 0.7.0 → 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 +29 -0
  2. package/LICENSE +1 -1
  3. package/README.md +14 -7
  4. package/bin.mjs +2 -8
  5. package/client.d.ts +0 -6
  6. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-BuCvPGjS.js → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js} +2 -2
  7. package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-BuCvPGjS.js.map → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js.map} +1 -1
  8. package/dist/client/assets/{index-D632jo79.js → index-CgkhETVR.js} +2 -144
  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 +2 -105
  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 +11 -3
  25. package/lib/devframe/allowed-origins.d.ts.map +1 -1
  26. package/lib/devframe/allowed-origins.js +0 -5
  27. package/lib/devframe/allowed-origins.js.map +1 -1
  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 +0 -5
  69. package/lib/options.d.ts.map +1 -1
  70. package/lib/options.js +0 -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 +0 -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 +0 -5
  93. package/lib/plugins/private-fields.d.ts.map +1 -1
  94. package/lib/plugins/private-fields.js +0 -5
  95. package/lib/plugins/private-fields.js.map +1 -1
  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 +0 -5
  105. package/lib/runtime/child-state.d.ts.map +1 -1
  106. package/lib/runtime/child-state.js +18 -3
  107. package/lib/runtime/child-state.js.map +1 -1
  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 +0 -5
  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 +0 -5
  152. package/lib/runtime/patch.d.ts.map +1 -1
  153. package/lib/runtime/patch.js +0 -5
  154. package/lib/runtime/patch.js.map +1 -1
  155. package/lib/runtime/rpc-transport.d.ts +13 -3
  156. package/lib/runtime/rpc-transport.d.ts.map +1 -1
  157. package/lib/runtime/rpc-transport.js +3 -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 +0 -5
  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 +0 -5
  188. package/lib/runtime/standalone.d.ts.map +1 -1
  189. package/lib/runtime/standalone.js +0 -5
  190. package/lib/runtime/standalone.js.map +1 -1
  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 +0 -5
  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 +0 -5
  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 +2 -2
  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 +0 -5
  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-D632jo79.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/lib/devframe/definition.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAY3D,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAM1C,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe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AAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,eAAe,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gBAAgB,EAAE;IAC1B,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The framework-neutral Lit devframe: RPC functions, shared state, and the\n * timeline stream. Talks to the page runtime only through the injected\n * {@link TimelineSource} port, so it runs unchanged under `createDevServer()`,\n * `createBuild()`, or an MCP server with no Vite in the loop. `vite.ts` wires\n * the real page-runtime bridge and mounts this via `createPluginFromDevframe`.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport {defineDevframe, defineRpcFunction} from 'devframe';\n// Type-only: brings in the service's `declare module 'devframe'`\n// augmentation so `ctx.services.get()` types its API. Nothing is\n// imported at runtime, and the service is consumed, never installed\n// here -- a Vite hub already has it (see `panel/open-in-editor.ts`).\nimport type {} from '@devframes/service-open';\nimport type {DevframeDefinition, DevframeNodeContext} from 'devframe';\nimport type {\n InspectorCommand,\n InspectorDetails,\n InspectorTreeNode,\n} from '../../types/inspector.js';\nimport {TIMELINE_LAYERS} from '../../types/timeline.js';\nimport {MAX_HMR_INCOMPATIBILITIES} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {LIT_LOGO_ICON} from './icon.js';\nimport {PANEL_DIST_DIR} from './paths.js';\nimport type {\n FeatureSettings,\n SettingsOverride,\n TimelineEvent,\n} from '../../types/timeline.js';\nimport {\n DEFAULT_SESSION_STATE,\n LAYER_FLAGS,\n LIT_DEVFRAME_ID,\n RECENT_EVENTS_BUFFER_SIZE,\n RPC_COMPONENT_DETAILS,\n RPC_GET_META,\n RPC_HMR_INCOMPATIBILITIES,\n RPC_HMR_INCOMPATIBLE,\n RPC_INSPECT,\n RPC_INSPECTOR_MESSAGE,\n RPC_LIST_COMPONENTS,\n RPC_RECENT_EVENTS,\n RPC_TIMELINE_HISTORY,\n RPC_SET_RECORDING,\n RPC_EXPORT_SNAPSHOT,\n RPC_OPEN_SOURCE,\n RPC_SET_SETTINGS_OVERRIDE,\n RPC_TOGGLE_LAYER,\n RPC_UPDATE_SUMMARY,\n SESSION_STATE_KEY,\n TIMELINE_STREAM_ID,\n TIMELINE_STREAM_NAME,\n type ComponentDetailsArgs,\n type LitGetMetaResult,\n type RecentEventsArgs,\n type RecentEventsResult,\n type SessionState,\n type ExportSnapshotArgs,\n type ExportSnapshotResult,\n type OpenSourceArgs,\n type OpenSourceResult,\n type SetRecordingArgs,\n type ToggleLayerArgs,\n type UpdateSummaryArgs,\n type UpdateSummaryResult,\n} from './protocol.js';\nimport {\n attributeInput,\n rollup,\n toSpans,\n toUpdateCycles,\n} from '../timeline/derive.js';\nimport {resolveLaunchEditor} from './launch-editor.js';\nimport {createNullSource, type TimelineSource} from './source.js';\nimport type {SessionSnapshot} from '../../types/snapshot.js';\n\nexport interface CreateLitDevframeOptions {\n /** Page-runtime bridge. Use {@link createNullSource} when no page is attached. */\n source: TimelineSource;\n /** Plugin version, surfaced by `get-meta` and the devframe's own `version`. */\n version: string;\n /** Resolved feature settings, surfaced by `get-meta`. */\n features?: () => FeatureSettings | null;\n /**\n * Directory holding the built panel SPA. Defaults to the package's own\n * `dist/client`; the dev-time panel build points it elsewhere.\n */\n clientAssets?: string;\n /**\n * Absolute directory the injected `ElementSource.file` paths are relative\n * to (the Vite root). Read per call, since a host only knows it once its\n * dev server is up. Also the first root `open-source` confines opens to;\n * without it, relative paths resolve against the working directory.\n */\n sourceRoot?: () => string | undefined;\n /**\n * Further directories `open-source` may open files beneath, beyond\n * `sourceRoot` (the Vite host passes `server.fs.allow`, where sibling\n * packages of a monorepo live). Read per call. A path outside every root\n * is refused; with neither this nor `sourceRoot`, the process's working\n * directory is the only root.\n */\n allowedRoots?: () => readonly string[];\n /**\n * The editor key the developer named in config or env\n * (`sourceOverlay.editor`), or `undefined` when they never did. Read per\n * call. `open-source` maps it, or the panel's override of it, to a\n * `launch-editor` command; without either the editor is auto-detected.\n */\n configuredEditor?: () => string | undefined;\n /**\n * Boot from a recorded session instead of a live one. Set only by the\n * static-snapshot build (see `lib/snapshot.ts`): the caches below start\n * populated, so the frozen panel has a timeline and a component tree to\n * render with no page and no dev server behind it.\n */\n replay?: SessionSnapshot;\n}\n\n/**\n * Builds the Lit devframe definition. Framework-neutral: everything here\n * runs the same whether the host is Vite (`vite.ts`), a standalone dev\n * server, a static build, or an MCP server.\n */\nexport function createLitDevframe(\n options: CreateLitDevframeOptions\n): DevframeDefinition {\n const {\n source,\n version,\n features,\n replay,\n sourceRoot,\n allowedRoots,\n configuredEditor,\n } = options;\n\n return defineDevframe({\n id: LIT_DEVFRAME_ID,\n name: 'Lit',\n description: 'Timeline recorder and component inspector for Lit apps.',\n version,\n packageName: '@oddsquad/vite-plugin-lit',\n homepage: 'https://oddcelot.github.io/vite-plugin-lit/',\n importMetaUrl: import.meta.url,\n icon: LIT_LOGO_ICON,\n dock: {category: 'framework'},\n clientAssets: options.clientAssets ?? PANEL_DIST_DIR,\n\n // `component-details` takes an id, so `snapshot: true` (which bakes the\n // no-argument call) cannot express it. Bake one record per component the\n // session actually opened -- the only ids that have details to freeze.\n rpc: replay\n ? {\n snapshot: [\n {\n method: `${LIT_DEVFRAME_ID}:${RPC_COMPONENT_DETAILS}`,\n inputs: replay.details.map((d) => [{id: d.id}]),\n },\n ],\n }\n : undefined,\n\n async setup(ctx: DevframeNodeContext) {\n const my = ctx.scope(LIT_DEVFRAME_ID);\n\n // Bind the per-user settings store before any panel can connect.\n // Both sides build it lazily on first access, but only this one backs\n // it with a JSON file -- a client that asks first gets a plain\n // in-memory shared state instead, so the panel's preferences would\n // round-trip happily and then vanish on restart. The panel is the only\n // thing that reads or writes these (see `panel/devtools-settings.ts`);\n // this call exists purely to make them durable.\n await my.settings.global.all();\n\n const session = await my.rpc.sharedState<SessionState>(\n SESSION_STATE_KEY,\n {\n initialValue: replay\n ? {\n ...DEFAULT_SESSION_STATE,\n // Recorded events carry layer ids; without the custom layers\n // that produced them the frozen panel would show a filter it\n // cannot name.\n customLayers: replay.customLayers,\n }\n : DEFAULT_SESSION_STATE,\n }\n );\n\n // Latest inspector snapshot, cached so a panel that (re)connects after\n // the runtime already answered can read it without round-tripping to\n // the page again. Pre-filled when replaying: there is no page to ask.\n let cachedRoots: InspectorTreeNode[] = replay ? [...replay.roots] : [];\n const cachedDetails = new Map<number, InspectorDetails>(\n replay?.details.map((d) => [d.id, d])\n );\n\n // Bounded history for the `recent-events` agent query and the panel's\n // `timeline-history` seed. A plain array, not devframe's internal\n // per-stream replay buffer, which devframe marks `@internal` (see\n // plans/roadmap/02-agent-timeline-access.md).\n const recentEvents: TimelineEvent[] = replay ? [...replay.events] : [];\n\n // Event ids: `${epoch}-${seq}`. The epoch is the session start, so a\n // restarted dev server can never reissue an id an older snapshot holds;\n // the seq is monotonic across Clear. Stamped here, once, because this is\n // the only place every consumer (stream, `recent-events`, export) shares.\n // A replayed session never reaches `pushEvents`, so its ids are kept.\n const eventEpoch = Date.now().toString(36);\n let eventSeq = 0;\n\n // Recent HMR-incompatibility notices, capped the same way\n // `runtime/timeline/transport.ts` caps its pending queue — a long\n // session with many failing edits must not grow this forever.\n const hmrIncompatibilities: HmrIncompatibilityEvent[] = replay\n ? [...replay.hmrIncompatibilities]\n : [];\n\n // Terminal echo for an audience that only sees dev-server stdout (an\n // agent, or a CI log) and not the browser console or the panel.\n // Fire-and-log only — the cache above is the read-back store.\n const hmrDiagnostics = ctx.diagnostics.defineDiagnostics({\n docsBase:\n 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/',\n codes: {\n LIT_HMR_ACCESSOR: {\n why: (p: {tagName: string}) =>\n `<${p.tagName}> can't be hot-patched: standard accessor decorators`,\n docs: 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/#cannot-be-patched-in-place',\n },\n LIT_HMR_PATCH_FAILED: {\n why: (p: {tagName: string; detail: string}) =>\n `<${p.tagName}> can't be hot-patched: ${p.detail}`,\n docs: 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/#cannot-be-patched-in-place',\n },\n LIT_HMR_ATTRS_CHANGED: {\n why: (p: {tagName: string}) =>\n `<${p.tagName}> changed observedAttributes; reload recommended`,\n docs: 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/#cannot-be-patched-in-place',\n },\n },\n });\n ctx.diagnostics.register(hmrDiagnostics);\n\n // Streaming/source wiring only makes sense for a live session: a\n // static build or MCP run has no page attached (its `source` is a\n // `createNullSource()`), and `ctx.mode` is 'build' there.\n if (ctx.mode === 'dev') {\n // No `replayWindow`: a subscriber would be replayed the whole buffer\n // in separate chunks, including batches from before the last\n // recording started (a different clock) and ones the panel's Clear\n // dropped, and the node has no way to forget them. A connecting panel\n // is seeded from `timeline-history` instead, which is `recentEvents`,\n // cleared on the same edges.\n const channel =\n my.rpc.streaming.create<TimelineEvent[]>(TIMELINE_STREAM_NAME);\n // Started eagerly, not on the first event: `streaming:subscribe` is\n // fire-and-forget on the wire, and a subscribe naming a stream id\n // that does not exist yet is dropped with a DF0030 diagnostic rather\n // than queued. The panel subscribes as soon as it connects, which is\n // normally long before the first event, so the stream has to be\n // there waiting. `??` covers a re-start if the transport aborted it\n // after the last subscriber left.\n channel.start({id: TIMELINE_STREAM_ID});\n const ensureStream = () =>\n channel.get(TIMELINE_STREAM_ID) ??\n channel.start({id: TIMELINE_STREAM_ID});\n\n source.attach({\n pushEvents(incoming) {\n if (incoming.length === 0) return;\n const events = incoming.map((event) => ({\n ...event,\n id: event.id ?? `${eventEpoch}-${eventSeq++}`,\n }));\n ensureStream().write(events);\n recentEvents.push(...events);\n if (recentEvents.length > RECENT_EVENTS_BUFFER_SIZE) {\n recentEvents.splice(\n 0,\n recentEvents.length - RECENT_EVENTS_BUFFER_SIZE\n );\n }\n },\n addLayer(layer) {\n session.mutate((state) => {\n if (\n !state.customLayers.some((existing) => existing.id === layer.id)\n ) {\n state.customLayers.push(layer);\n }\n });\n },\n inspectorMessage(message) {\n if (message.type === 'tree') {\n cachedRoots = message.roots;\n } else if (message.type === 'details') {\n cachedDetails.set(message.details.id, message.details);\n } else if (message.type === 'gone') {\n cachedDetails.delete(message.id);\n }\n void ctx.rpc.broadcast({\n method: `${LIT_DEVFRAME_ID}:${RPC_INSPECTOR_MESSAGE}`,\n args: [message],\n // A page can be open with no panel docked; the runtime keeps\n // answering either way, so a broadcast with no listener is\n // normal rather than a missing-function error.\n optional: true,\n });\n },\n runtimeReady() {\n // A new page means a new timeline clock: the runtime re-zeroes on\n // the rising edge below, so events kept from the previous document\n // would sit in the same buffer on a different time origin and make\n // `recent-events`' `sinceMs` window meaningless. They also describe\n // a page that no longer exists.\n recentEvents.length = 0;\n\n // Replay current state to a runtime that just booted from its\n // defaults. Unconditional: `setRecording(false)` on a fresh page\n // is a no-op.\n const {layers} = session.value();\n source.setLayers(layers);\n source.setRecording(layers.recordingState);\n },\n hmrIncompatible(event) {\n hmrIncompatibilities.push(event);\n if (hmrIncompatibilities.length > MAX_HMR_INCOMPATIBILITIES) {\n hmrIncompatibilities.splice(\n 0,\n hmrIncompatibilities.length - MAX_HMR_INCOMPATIBILITIES\n );\n }\n void ctx.rpc.broadcast({\n method: `${LIT_DEVFRAME_ID}:${RPC_HMR_INCOMPATIBLE}`,\n args: [event],\n optional: true,\n });\n\n // Informational terminal echo, never a thrown error.\n if (event.reason.code === 'accessor-decorators') {\n hmrDiagnostics.LIT_HMR_ACCESSOR({tagName: event.tagName});\n } else if (event.reason.code === 'patch-failed') {\n hmrDiagnostics.LIT_HMR_PATCH_FAILED({\n tagName: event.tagName,\n detail: event.reason.detail,\n });\n } else {\n hmrDiagnostics.LIT_HMR_ATTRS_CHANGED({tagName: event.tagName});\n }\n },\n });\n\n // Single push point for recording/layer changes: fires for the\n // `set-recording` / `toggle-layer` actions below and for a panel\n // mutating shared state directly through devframe's generic\n // shared-state RPC. Immer only emits when the state reference\n // changes, so a no-op mutate sends nothing.\n //\n // Clearing on the rising edge belongs here rather than in\n // `set-recording` for the same reason: the runtime re-zeroes its\n // timeline clock when recording turns on (`runtime/timeline/clock.ts`),\n // so events kept from the previous recording sit in the buffer on a\n // larger time origin than everything captured after them. A `sinceMs`\n // window reads them as the future, and pairing a start with its end\n // across the seam yields a negative duration. Same rationale as\n // `runtimeReady()` above, one level finer: a new clock, not a new page.\n let wasRecording = session.value().layers.recordingState;\n session.on('updated', (state) => {\n const {recordingState} = state.layers;\n if (recordingState && !wasRecording) {\n recentEvents.length = 0;\n }\n wasRecording = recordingState;\n source.setRecording(recordingState);\n source.setLayers(state.layers);\n });\n }\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_GET_META,\n type: 'query',\n jsonSerializable: true,\n snapshot: true,\n agent: {\n description:\n 'Get the plugin version, active timeline layers, and resolved feature settings. Call once at the start of a session to learn what timeline layers exist before asking about events.',\n },\n handler: async (): Promise<LitGetMetaResult> => ({\n version,\n // `.value()` returns a deep-readonly snapshot; copy so callers\n // get a plain, mutable `TimelineLayer[]`.\n layers: [...TIMELINE_LAYERS, ...session.value().customLayers],\n features: features ? features() : null,\n stream: {\n channel: `${LIT_DEVFRAME_ID}:${TIMELINE_STREAM_NAME}`,\n id: TIMELINE_STREAM_ID,\n },\n }),\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_LIST_COMPONENTS,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and\n // by export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n 'List the live Lit component tree of the inspected page. Call this before asking about a specific element to find its id.',\n },\n handler: async (): Promise<InspectorTreeNode[]> => cachedRoots,\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_HMR_INCOMPATIBILITIES,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and\n // by export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n \"List recent components the Lit plugin could not hot-patch in place, and why. Call this after an unexplained full-page reload during development, or when a component's state resets unexpectedly on edit.\",\n },\n handler: async (): Promise<HmrIncompatibilityEvent[]> =>\n hmrIncompatibilities,\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_COMPONENT_DETAILS,\n type: 'query',\n jsonSerializable: true,\n agent: {\n description:\n 'Get reactive properties, attributes, and internal state for one component by id. Call list-components first to find the id.',\n },\n handler: async (\n args: ComponentDetailsArgs\n ): Promise<InspectorDetails | null> =>\n cachedDetails.get(args.id) ?? null,\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_RECENT_EVENTS,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and\n // by export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n 'Get recent timeline events (lifecycle, render, mouse, keyboard) to diagnose why a component re-rendered or updated. Call list-components first to find an element’s id, then filter by elementId to see just its events. Check the `recording` field in the response — if false, no events are being captured; ask the developer to enable Recording in the Timeline tab before retrying.',\n },\n // `args` is genuinely absent when an agent calls the tool with no\n // filters — the most common call — so it must default, not just be\n // typed optional.\n handler: async (\n args: RecentEventsArgs = {}\n ): Promise<RecentEventsResult> => {\n const recording = session.value().layers.recordingState;\n let filtered = recentEvents;\n if (args.layerId !== undefined) {\n filtered = filtered.filter((e) => e.layerId === args.layerId);\n }\n if (args.elementId !== undefined) {\n filtered = filtered.filter(\n (e) => e.meta?.elementId === args.elementId\n );\n }\n // Measured against the newest event in the whole buffer, not the\n // newest *matching* one: an element that last rendered 10s ago\n // must come back empty for `sinceMs: 1000`, not report its own\n // stale events as if they were recent.\n if (args.sinceMs !== undefined && recentEvents.length > 0) {\n const newest = recentEvents[recentEvents.length - 1]!.time;\n const cutoff = newest - args.sinceMs;\n filtered = filtered.filter((e) => e.time >= cutoff);\n }\n // A frozen session's panel reads the baked no-argument call, so\n // the agent-friendly 50/200 window would silently cut an export to\n // its last 25 spans -- and a link to anything older would miss.\n const limit = replay\n ? Math.min(\n args.limit ?? RECENT_EVENTS_BUFFER_SIZE,\n RECENT_EVENTS_BUFFER_SIZE\n )\n : Math.min(args.limit ?? 50, 200);\n const events = filtered.slice(-limit);\n return {\n recording,\n events,\n bufferSize: recentEvents.length,\n truncated: events.length < filtered.length,\n };\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_TIMELINE_HISTORY,\n type: 'query',\n jsonSerializable: true,\n // Not agent-exposed (agents have `recent-events`) and not baked\n // into a snapshot (a frozen panel reads `recent-events`, which\n // answers a replayed session with its whole buffer). This is the\n // live panel's seed: the stream carries nothing from before a\n // panel subscribed, so a reloaded panel asks for it here.\n handler: async (): Promise<TimelineEvent[]> => [...recentEvents],\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_UPDATE_SUMMARY,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and by\n // export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n 'Explain component updates: which components re-rendered, how often, how long they took, and which reactive properties changed to cause each update. Prefer this over lit:recent-events for \"why did this re-render\" and \"what is re-rendering too much\" — it answers from the same recording without the caller having to pair start/end events itself. Filter to one component with tagName. Check the `recording` field — if false, no events are being captured; call lit:set-recording first.',\n },\n // `args` is genuinely absent when an agent calls the tool with no\n // filters — the most common call — so it must default.\n handler: async (\n args: UpdateSummaryArgs = {}\n ): Promise<UpdateSummaryResult> => {\n const recording = session.value().layers.recordingState;\n let events: readonly TimelineEvent[] = recentEvents;\n // Same window semantics as `recent-events`: measured against the\n // newest event in the whole buffer, not the newest match.\n if (args.sinceMs !== undefined && recentEvents.length > 0) {\n const cutoff =\n recentEvents[recentEvents.length - 1]!.time - args.sinceMs;\n events = recentEvents.filter((e) => e.time >= cutoff);\n }\n let cycles = attributeInput(\n toUpdateCycles(toSpans(events)),\n events\n );\n if (args.tagName !== undefined) {\n cycles = cycles.filter((c) => c.tagName === args.tagName);\n }\n // Totals cover the whole window; only the per-cycle list is\n // capped, so a limit never silently understates a hot component.\n const components = rollup(cycles);\n const limit = Math.min(args.limit ?? 50, 200);\n const limited = cycles.slice(-limit);\n return {\n recording,\n components,\n cycles: limited,\n bufferSize: recentEvents.length,\n truncated: limited.length < cycles.length,\n };\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_INSPECT,\n type: 'action',\n jsonSerializable: true,\n handler: async (command: InspectorCommand): Promise<void> => {\n // \"Pick\" starts the overlay's inspect picker, which the host\n // toggles in the page rather than answering from the runtime.\n if (command.type === 'pick') {\n source.toggleOverlay();\n return;\n }\n source.sendInspector(command);\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_SET_RECORDING,\n type: 'action',\n jsonSerializable: true,\n // The one agent-exposed mutation. `recent-events` is a dead end\n // when recording is off, so an agent that can read the timeline\n // but never start it just hands the question back to the human.\n // Deliberately still the *only* one: the picker and layer toggles\n // stay panel-only.\n agent: {\n description:\n 'Start or stop timeline recording. This is a shared toggle: turning it on also affects the DevTools panel if a developer has it open. Call this if lit:recent-events reports `recording: false`.',\n },\n handler: async (args: SetRecordingArgs): Promise<void> => {\n session.mutate((state) => {\n state.layers.recordingState = args.recording;\n });\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_TOGGLE_LAYER,\n type: 'action',\n jsonSerializable: true,\n handler: async (args: ToggleLayerArgs): Promise<void> => {\n const flag = LAYER_FLAGS[args.layerId];\n // Custom layers have no capture flag to toggle — app code owns\n // whether it emits at all.\n if (!flag) return;\n session.mutate((state) => {\n state.layers[flag] = args.enabled;\n });\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_SET_SETTINGS_OVERRIDE,\n type: 'action',\n jsonSerializable: true,\n handler: async (override: SettingsOverride): Promise<void> => {\n source.setSettingsOverride(override);\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_OPEN_SOURCE,\n type: 'action',\n jsonSerializable: true,\n // Resolving here rather than in the panel is the whole point of\n // the hop: `file` is relative to the Vite root, while the open\n // service resolves relative paths against the host's\n // `workspaceRoot` -- in a monorepo (or any setup where the served\n // app isn't the workspace) those are different directories, and\n // `launchEditor` silently does nothing for a path that doesn't\n // exist. Not agent-exposed: it spawns a GUI process.\n handler: async (args: OpenSourceArgs): Promise<OpenSourceResult> => {\n const service = ctx.services.get('@devframes/service-open');\n if (service === undefined) return {opened: false};\n // Confined like `/__lit-open-in-editor`: whatever can reach this\n // RPC could otherwise have the editor open any file on disk.\n const {confineToRoots} = await import('../confine.js');\n const confined = confineToRoots(\n [sourceRoot?.() ?? process.cwd(), ...(allowedRoots?.() ?? [])],\n args.file\n );\n if ('failure' in confined) return {opened: false};\n const {path} = confined;\n const override = await my.settings.global.get('override');\n await service.openInEditor({\n path,\n line: args.line,\n editor: resolveLaunchEditor(configuredEditor?.(), override),\n });\n return {opened: true};\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_EXPORT_SNAPSHOT,\n type: 'action',\n jsonSerializable: true,\n // Not agent-exposed. It writes a directory to the developer's disk,\n // which is not something a coding agent should be able to do behind\n // their back -- same reasoning as the other mutating actions.\n handler: async (\n args: ExportSnapshotArgs\n ): Promise<ExportSnapshotResult> => {\n // Imported here, not at module scope: this file has to keep\n // loading in contexts with no filesystem, and the build adapter\n // it pulls in reaches straight for `node:fs`.\n const {buildSnapshot} = await import('../snapshot.js');\n // `outDir` comes from the client and the build deletes it before\n // writing, so it has to land strictly beneath the working\n // directory -- never the directory itself, and never elsewhere\n // on disk.\n const {resolve, sep} = await import('node:path');\n const cwd = process.cwd();\n const outDir = resolve(cwd, args.outDir ?? 'lit-devtools-snapshot');\n if (!outDir.startsWith(cwd + sep)) {\n throw new Error(\n `[lit-devtools] export-snapshot: outDir must be inside ${cwd}`\n );\n }\n return buildSnapshot(\n {\n capturedAt: new Date().toISOString(),\n version,\n customLayers: [...session.value().customLayers],\n roots: cachedRoots,\n details: [...cachedDetails.values()],\n events: [...recentEvents],\n hmrIncompatibilities: [...hmrIncompatibilities],\n },\n {\n outDir,\n features: features ? features() : null,\n clientAssets: options.clientAssets,\n }\n );\n },\n })\n );\n },\n });\n}\n\nexport default createLitDevframe({\n source: createNullSource(),\n version: '0.0.0',\n});\n"]}
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/lib/devframe/definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAY3D,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAM1C,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GAcrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,MAAM,EACN,OAAO,EACP,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AA8ClE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAiC;IAEjC,MAAM,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,GAAG,OAAO,CAAC;IAEZ,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C,GAAG,EAAE,IAAI,CAAC,MAAM,IAAI,uBAAuB,CAAC,CAAC;oBACpE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;wBAClC,MAAM,IAAI,KAAK,CACb,yDAAyD,GAAG,EAAE,CAC/D,CAAC;oBACJ,CAAC;oBACD,OAAO,aAAa,CAClB;wBACE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBACpC,OAAO;wBACP,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC;wBAC/C,KAAK,EAAE,WAAW;wBAClB,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;wBACpC,MAAM,EAAE,CAAC,GAAG,YAAY,CAAC;wBACzB,oBAAoB,EAAE,CAAC,GAAG,oBAAoB,CAAC;qBAChD,EACD;wBACE,MAAM;wBACN,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI;wBACtC,YAAY,EAAE,OAAO,CAAC,YAAY;qBACnC,CACF,CAAC;gBACJ,CAAC;aACF,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,eAAe,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gBAAgB,EAAE;IAC1B,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC","sourcesContent":["/**\n * The framework-neutral Lit devframe: RPC functions, shared state, and the\n * timeline stream. Talks to the page runtime only through the injected\n * {@link TimelineSource} port, so it runs unchanged under `createDevServer()`,\n * `createBuild()`, or an MCP server with no Vite in the loop. `vite.ts` wires\n * the real page-runtime bridge and mounts this via `createPluginFromDevframe`.\n *\n * @see plans/devframe-foundation.md\n */\n\nimport {defineDevframe, defineRpcFunction} from 'devframe';\n// Type-only: brings in the service's `declare module 'devframe'`\n// augmentation so `ctx.services.get()` types its API. Nothing is\n// imported at runtime, and the service is consumed, never installed\n// here -- a Vite hub already has it (see `panel/open-in-editor.ts`).\nimport type {} from '@devframes/service-open';\nimport type {DevframeDefinition, DevframeNodeContext} from 'devframe';\nimport type {\n InspectorCommand,\n InspectorDetails,\n InspectorTreeNode,\n} from '../../types/inspector.js';\nimport {TIMELINE_LAYERS} from '../../types/timeline.js';\nimport {MAX_HMR_INCOMPATIBILITIES} from '../../types/hmr-incompatibility.js';\nimport type {HmrIncompatibilityEvent} from '../../types/hmr-incompatibility.js';\nimport {LIT_LOGO_ICON} from './icon.js';\nimport {PANEL_DIST_DIR} from './paths.js';\nimport type {\n FeatureSettings,\n SettingsOverride,\n TimelineEvent,\n} from '../../types/timeline.js';\nimport {\n DEFAULT_SESSION_STATE,\n LAYER_FLAGS,\n LIT_DEVFRAME_ID,\n RECENT_EVENTS_BUFFER_SIZE,\n RPC_COMPONENT_DETAILS,\n RPC_GET_META,\n RPC_HMR_INCOMPATIBILITIES,\n RPC_HMR_INCOMPATIBLE,\n RPC_INSPECT,\n RPC_INSPECTOR_MESSAGE,\n RPC_LIST_COMPONENTS,\n RPC_RECENT_EVENTS,\n RPC_TIMELINE_HISTORY,\n RPC_SET_RECORDING,\n RPC_EXPORT_SNAPSHOT,\n RPC_OPEN_SOURCE,\n RPC_SET_SETTINGS_OVERRIDE,\n RPC_TOGGLE_LAYER,\n RPC_UPDATE_SUMMARY,\n SESSION_STATE_KEY,\n TIMELINE_STREAM_ID,\n TIMELINE_STREAM_NAME,\n type ComponentDetailsArgs,\n type LitGetMetaResult,\n type RecentEventsArgs,\n type RecentEventsResult,\n type SessionState,\n type ExportSnapshotArgs,\n type ExportSnapshotResult,\n type OpenSourceArgs,\n type OpenSourceResult,\n type SetRecordingArgs,\n type ToggleLayerArgs,\n type UpdateSummaryArgs,\n type UpdateSummaryResult,\n} from './protocol.js';\nimport {\n attributeInput,\n rollup,\n toSpans,\n toUpdateCycles,\n} from '../timeline/derive.js';\nimport {resolveLaunchEditor} from './launch-editor.js';\nimport {createNullSource, type TimelineSource} from './source.js';\nimport type {SessionSnapshot} from '../../types/snapshot.js';\n\nexport interface CreateLitDevframeOptions {\n /** Page-runtime bridge. Use {@link createNullSource} when no page is attached. */\n source: TimelineSource;\n /** Plugin version, surfaced by `get-meta` and the devframe's own `version`. */\n version: string;\n /** Resolved feature settings, surfaced by `get-meta`. */\n features?: () => FeatureSettings | null;\n /**\n * Directory holding the built panel SPA. Defaults to the package's own\n * `dist/client`; the dev-time panel build points it elsewhere.\n */\n clientAssets?: string;\n /**\n * Absolute directory the injected `ElementSource.file` paths are relative\n * to (the Vite root). Read per call, since a host only knows it once its\n * dev server is up. Also the first root `open-source` confines opens to;\n * without it, relative paths resolve against the working directory.\n */\n sourceRoot?: () => string | undefined;\n /**\n * Further directories `open-source` may open files beneath, beyond\n * `sourceRoot` (the Vite host passes `server.fs.allow`, where sibling\n * packages of a monorepo live). Read per call. A path outside every root\n * is refused; with neither this nor `sourceRoot`, the process's working\n * directory is the only root.\n */\n allowedRoots?: () => readonly string[];\n /**\n * The editor key the developer named in config or env\n * (`sourceOverlay.editor`), or `undefined` when they never did. Read per\n * call. `open-source` maps it, or the panel's override of it, to a\n * `launch-editor` command; without either the editor is auto-detected.\n */\n configuredEditor?: () => string | undefined;\n /**\n * Boot from a recorded session instead of a live one. Set only by the\n * static-snapshot build (see `lib/snapshot.ts`): the caches below start\n * populated, so the frozen panel has a timeline and a component tree to\n * render with no page and no dev server behind it.\n */\n replay?: SessionSnapshot;\n}\n\n/**\n * Builds the Lit devframe definition. Framework-neutral: everything here\n * runs the same whether the host is Vite (`vite.ts`), a standalone dev\n * server, a static build, or an MCP server.\n */\nexport function createLitDevframe(\n options: CreateLitDevframeOptions\n): DevframeDefinition {\n const {\n source,\n version,\n features,\n replay,\n sourceRoot,\n allowedRoots,\n configuredEditor,\n } = options;\n\n return defineDevframe({\n id: LIT_DEVFRAME_ID,\n name: 'Lit',\n description: 'Timeline recorder and component inspector for Lit apps.',\n version,\n packageName: '@oddsquad/vite-plugin-lit',\n homepage: 'https://oddcelot.github.io/vite-plugin-lit/',\n importMetaUrl: import.meta.url,\n icon: LIT_LOGO_ICON,\n dock: {category: 'framework'},\n clientAssets: options.clientAssets ?? PANEL_DIST_DIR,\n\n // `component-details` takes an id, so `snapshot: true` (which bakes the\n // no-argument call) cannot express it. Bake one record per component the\n // session actually opened -- the only ids that have details to freeze.\n rpc: replay\n ? {\n snapshot: [\n {\n method: `${LIT_DEVFRAME_ID}:${RPC_COMPONENT_DETAILS}`,\n inputs: replay.details.map((d) => [{id: d.id}]),\n },\n ],\n }\n : undefined,\n\n async setup(ctx: DevframeNodeContext) {\n const my = ctx.scope(LIT_DEVFRAME_ID);\n\n // Bind the per-user settings store before any panel can connect.\n // Both sides build it lazily on first access, but only this one backs\n // it with a JSON file -- a client that asks first gets a plain\n // in-memory shared state instead, so the panel's preferences would\n // round-trip happily and then vanish on restart. The panel is the only\n // thing that reads or writes these (see `panel/devtools-settings.ts`);\n // this call exists purely to make them durable.\n await my.settings.global.all();\n\n const session = await my.rpc.sharedState<SessionState>(\n SESSION_STATE_KEY,\n {\n initialValue: replay\n ? {\n ...DEFAULT_SESSION_STATE,\n // Recorded events carry layer ids; without the custom layers\n // that produced them the frozen panel would show a filter it\n // cannot name.\n customLayers: replay.customLayers,\n }\n : DEFAULT_SESSION_STATE,\n }\n );\n\n // Latest inspector snapshot, cached so a panel that (re)connects after\n // the runtime already answered can read it without round-tripping to\n // the page again. Pre-filled when replaying: there is no page to ask.\n let cachedRoots: InspectorTreeNode[] = replay ? [...replay.roots] : [];\n const cachedDetails = new Map<number, InspectorDetails>(\n replay?.details.map((d) => [d.id, d])\n );\n\n // Bounded history for the `recent-events` agent query and the panel's\n // `timeline-history` seed. A plain array, not devframe's internal\n // per-stream replay buffer, which devframe marks `@internal` (see\n // plans/devtools-features.md).\n const recentEvents: TimelineEvent[] = replay ? [...replay.events] : [];\n\n // Event ids: `${epoch}-${seq}`. The epoch is the session start, so a\n // restarted dev server can never reissue an id an older snapshot holds;\n // the seq is monotonic across Clear. Stamped here, once, because this is\n // the only place every consumer (stream, `recent-events`, export) shares.\n // A replayed session never reaches `pushEvents`, so its ids are kept.\n const eventEpoch = Date.now().toString(36);\n let eventSeq = 0;\n\n // Recent HMR-incompatibility notices, capped the same way\n // `runtime/timeline/transport.ts` caps its pending queue — a long\n // session with many failing edits must not grow this forever.\n const hmrIncompatibilities: HmrIncompatibilityEvent[] = replay\n ? [...replay.hmrIncompatibilities]\n : [];\n\n // Terminal echo for an audience that only sees dev-server stdout (an\n // agent, or a CI log) and not the browser console or the panel.\n // Fire-and-log only — the cache above is the read-back store.\n const hmrDiagnostics = ctx.diagnostics.defineDiagnostics({\n docsBase:\n 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/',\n codes: {\n LIT_HMR_ACCESSOR: {\n why: (p: {tagName: string}) =>\n `<${p.tagName}> can't be hot-patched: standard accessor decorators`,\n docs: 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/#cannot-be-patched-in-place',\n },\n LIT_HMR_PATCH_FAILED: {\n why: (p: {tagName: string; detail: string}) =>\n `<${p.tagName}> can't be hot-patched: ${p.detail}`,\n docs: 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/#cannot-be-patched-in-place',\n },\n LIT_HMR_ATTRS_CHANGED: {\n why: (p: {tagName: string}) =>\n `<${p.tagName}> changed observedAttributes; reload recommended`,\n docs: 'https://oddcelot.github.io/vite-plugin-lit/reference/limitations/#cannot-be-patched-in-place',\n },\n },\n });\n ctx.diagnostics.register(hmrDiagnostics);\n\n // Streaming/source wiring only makes sense for a live session: a\n // static build or MCP run has no page attached (its `source` is a\n // `createNullSource()`), and `ctx.mode` is 'build' there.\n if (ctx.mode === 'dev') {\n // No `replayWindow`: a subscriber would be replayed the whole buffer\n // in separate chunks, including batches from before the last\n // recording started (a different clock) and ones the panel's Clear\n // dropped, and the node has no way to forget them. A connecting panel\n // is seeded from `timeline-history` instead, which is `recentEvents`,\n // cleared on the same edges.\n const channel =\n my.rpc.streaming.create<TimelineEvent[]>(TIMELINE_STREAM_NAME);\n // Started eagerly, not on the first event: `streaming:subscribe` is\n // fire-and-forget on the wire, and a subscribe naming a stream id\n // that does not exist yet is dropped with a DF0030 diagnostic rather\n // than queued. The panel subscribes as soon as it connects, which is\n // normally long before the first event, so the stream has to be\n // there waiting. `??` covers a re-start if the transport aborted it\n // after the last subscriber left.\n channel.start({id: TIMELINE_STREAM_ID});\n const ensureStream = () =>\n channel.get(TIMELINE_STREAM_ID) ??\n channel.start({id: TIMELINE_STREAM_ID});\n\n source.attach({\n pushEvents(incoming) {\n if (incoming.length === 0) return;\n const events = incoming.map((event) => ({\n ...event,\n id: event.id ?? `${eventEpoch}-${eventSeq++}`,\n }));\n ensureStream().write(events);\n recentEvents.push(...events);\n if (recentEvents.length > RECENT_EVENTS_BUFFER_SIZE) {\n recentEvents.splice(\n 0,\n recentEvents.length - RECENT_EVENTS_BUFFER_SIZE\n );\n }\n },\n addLayer(layer) {\n session.mutate((state) => {\n if (\n !state.customLayers.some((existing) => existing.id === layer.id)\n ) {\n state.customLayers.push(layer);\n }\n });\n },\n inspectorMessage(message) {\n if (message.type === 'tree') {\n cachedRoots = message.roots;\n } else if (message.type === 'details') {\n cachedDetails.set(message.details.id, message.details);\n } else if (message.type === 'gone') {\n cachedDetails.delete(message.id);\n }\n void ctx.rpc.broadcast({\n method: `${LIT_DEVFRAME_ID}:${RPC_INSPECTOR_MESSAGE}`,\n args: [message],\n // A page can be open with no panel docked; the runtime keeps\n // answering either way, so a broadcast with no listener is\n // normal rather than a missing-function error.\n optional: true,\n });\n },\n runtimeReady() {\n // A new page means a new timeline clock: the runtime re-zeroes on\n // the rising edge below, so events kept from the previous document\n // would sit in the same buffer on a different time origin and make\n // `recent-events`' `sinceMs` window meaningless. They also describe\n // a page that no longer exists.\n recentEvents.length = 0;\n\n // Replay current state to a runtime that just booted from its\n // defaults. Unconditional: `setRecording(false)` on a fresh page\n // is a no-op.\n const {layers} = session.value();\n source.setLayers(layers);\n source.setRecording(layers.recordingState);\n },\n hmrIncompatible(event) {\n hmrIncompatibilities.push(event);\n if (hmrIncompatibilities.length > MAX_HMR_INCOMPATIBILITIES) {\n hmrIncompatibilities.splice(\n 0,\n hmrIncompatibilities.length - MAX_HMR_INCOMPATIBILITIES\n );\n }\n void ctx.rpc.broadcast({\n method: `${LIT_DEVFRAME_ID}:${RPC_HMR_INCOMPATIBLE}`,\n args: [event],\n optional: true,\n });\n\n // Informational terminal echo, never a thrown error.\n if (event.reason.code === 'accessor-decorators') {\n hmrDiagnostics.LIT_HMR_ACCESSOR({tagName: event.tagName});\n } else if (event.reason.code === 'patch-failed') {\n hmrDiagnostics.LIT_HMR_PATCH_FAILED({\n tagName: event.tagName,\n detail: event.reason.detail,\n });\n } else {\n hmrDiagnostics.LIT_HMR_ATTRS_CHANGED({tagName: event.tagName});\n }\n },\n });\n\n // Single push point for recording/layer changes: fires for the\n // `set-recording` / `toggle-layer` actions below and for a panel\n // mutating shared state directly through devframe's generic\n // shared-state RPC. Immer only emits when the state reference\n // changes, so a no-op mutate sends nothing.\n //\n // Clearing on the rising edge belongs here rather than in\n // `set-recording` for the same reason: the runtime re-zeroes its\n // timeline clock when recording turns on (`runtime/timeline/clock.ts`),\n // so events kept from the previous recording sit in the buffer on a\n // larger time origin than everything captured after them. A `sinceMs`\n // window reads them as the future, and pairing a start with its end\n // across the seam yields a negative duration. Same rationale as\n // `runtimeReady()` above, one level finer: a new clock, not a new page.\n let wasRecording = session.value().layers.recordingState;\n session.on('updated', (state) => {\n const {recordingState} = state.layers;\n if (recordingState && !wasRecording) {\n recentEvents.length = 0;\n }\n wasRecording = recordingState;\n source.setRecording(recordingState);\n source.setLayers(state.layers);\n });\n }\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_GET_META,\n type: 'query',\n jsonSerializable: true,\n snapshot: true,\n agent: {\n description:\n 'Get the plugin version, active timeline layers, and resolved feature settings. Call once at the start of a session to learn what timeline layers exist before asking about events.',\n },\n handler: async (): Promise<LitGetMetaResult> => ({\n version,\n // `.value()` returns a deep-readonly snapshot; copy so callers\n // get a plain, mutable `TimelineLayer[]`.\n layers: [...TIMELINE_LAYERS, ...session.value().customLayers],\n features: features ? features() : null,\n stream: {\n channel: `${LIT_DEVFRAME_ID}:${TIMELINE_STREAM_NAME}`,\n id: TIMELINE_STREAM_ID,\n },\n }),\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_LIST_COMPONENTS,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and\n // by export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n 'List the live Lit component tree of the inspected page. Call this before asking about a specific element to find its id.',\n },\n handler: async (): Promise<InspectorTreeNode[]> => cachedRoots,\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_HMR_INCOMPATIBILITIES,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and\n // by export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n \"List recent components the Lit plugin could not hot-patch in place, and why. Call this after an unexplained full-page reload during development, or when a component's state resets unexpectedly on edit.\",\n },\n handler: async (): Promise<HmrIncompatibilityEvent[]> =>\n hmrIncompatibilities,\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_COMPONENT_DETAILS,\n type: 'query',\n jsonSerializable: true,\n agent: {\n description:\n 'Get reactive properties, attributes, and internal state for one component by id. Call list-components first to find the id.',\n },\n handler: async (\n args: ComponentDetailsArgs\n ): Promise<InspectorDetails | null> =>\n cachedDetails.get(args.id) ?? null,\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_RECENT_EVENTS,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and\n // by export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n 'Get recent timeline events (lifecycle, render, mouse, keyboard) to diagnose why a component re-rendered or updated. Call list-components first to find an element’s id, then filter by elementId to see just its events. Check the `recording` field in the response — if false, no events are being captured; ask the developer to enable Recording in the Timeline tab before retrying.',\n },\n // `args` is genuinely absent when an agent calls the tool with no\n // filters — the most common call — so it must default, not just be\n // typed optional.\n handler: async (\n args: RecentEventsArgs = {}\n ): Promise<RecentEventsResult> => {\n const recording = session.value().layers.recordingState;\n let filtered = recentEvents;\n if (args.layerId !== undefined) {\n filtered = filtered.filter((e) => e.layerId === args.layerId);\n }\n if (args.elementId !== undefined) {\n filtered = filtered.filter(\n (e) => e.meta?.elementId === args.elementId\n );\n }\n // Measured against the newest event in the whole buffer, not the\n // newest *matching* one: an element that last rendered 10s ago\n // must come back empty for `sinceMs: 1000`, not report its own\n // stale events as if they were recent.\n if (args.sinceMs !== undefined && recentEvents.length > 0) {\n const newest = recentEvents[recentEvents.length - 1]!.time;\n const cutoff = newest - args.sinceMs;\n filtered = filtered.filter((e) => e.time >= cutoff);\n }\n // A frozen session's panel reads the baked no-argument call, so\n // the agent-friendly 50/200 window would silently cut an export to\n // its last 25 spans -- and a link to anything older would miss.\n const limit = replay\n ? Math.min(\n args.limit ?? RECENT_EVENTS_BUFFER_SIZE,\n RECENT_EVENTS_BUFFER_SIZE\n )\n : Math.min(args.limit ?? 50, 200);\n const events = filtered.slice(-limit);\n return {\n recording,\n events,\n bufferSize: recentEvents.length,\n truncated: events.length < filtered.length,\n };\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_TIMELINE_HISTORY,\n type: 'query',\n jsonSerializable: true,\n // Not agent-exposed (agents have `recent-events`) and not baked\n // into a snapshot (a frozen panel reads `recent-events`, which\n // answers a replayed session with its whole buffer). This is the\n // live panel's seed: the stream carries nothing from before a\n // panel subscribed, so a reloaded panel asks for it here.\n handler: async (): Promise<TimelineEvent[]> => [...recentEvents],\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_UPDATE_SUMMARY,\n type: 'query',\n jsonSerializable: true,\n // Baked into a static snapshot: takes no required arguments, and by\n // export time its answer is exactly what the session recorded.\n snapshot: true,\n agent: {\n description:\n 'Explain component updates: which components re-rendered, how often, how long they took, and which reactive properties changed to cause each update. Prefer this over lit:recent-events for \"why did this re-render\" and \"what is re-rendering too much\" — it answers from the same recording without the caller having to pair start/end events itself. Filter to one component with tagName. Check the `recording` field — if false, no events are being captured; call lit:set-recording first.',\n },\n // `args` is genuinely absent when an agent calls the tool with no\n // filters — the most common call — so it must default.\n handler: async (\n args: UpdateSummaryArgs = {}\n ): Promise<UpdateSummaryResult> => {\n const recording = session.value().layers.recordingState;\n let events: readonly TimelineEvent[] = recentEvents;\n // Same window semantics as `recent-events`: measured against the\n // newest event in the whole buffer, not the newest match.\n if (args.sinceMs !== undefined && recentEvents.length > 0) {\n const cutoff =\n recentEvents[recentEvents.length - 1]!.time - args.sinceMs;\n events = recentEvents.filter((e) => e.time >= cutoff);\n }\n let cycles = attributeInput(\n toUpdateCycles(toSpans(events)),\n events\n );\n if (args.tagName !== undefined) {\n cycles = cycles.filter((c) => c.tagName === args.tagName);\n }\n // Totals cover the whole window; only the per-cycle list is\n // capped, so a limit never silently understates a hot component.\n const components = rollup(cycles);\n const limit = Math.min(args.limit ?? 50, 200);\n const limited = cycles.slice(-limit);\n return {\n recording,\n components,\n cycles: limited,\n bufferSize: recentEvents.length,\n truncated: limited.length < cycles.length,\n };\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_INSPECT,\n type: 'action',\n jsonSerializable: true,\n handler: async (command: InspectorCommand): Promise<void> => {\n // \"Pick\" starts the overlay's inspect picker, which the host\n // toggles in the page rather than answering from the runtime.\n if (command.type === 'pick') {\n source.toggleOverlay();\n return;\n }\n source.sendInspector(command);\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_SET_RECORDING,\n type: 'action',\n jsonSerializable: true,\n // The one agent-exposed mutation. `recent-events` is a dead end\n // when recording is off, so an agent that can read the timeline\n // but never start it just hands the question back to the human.\n // Deliberately still the *only* one: the picker and layer toggles\n // stay panel-only.\n agent: {\n description:\n 'Start or stop timeline recording. This is a shared toggle: turning it on also affects the DevTools panel if a developer has it open. Call this if lit:recent-events reports `recording: false`.',\n },\n handler: async (args: SetRecordingArgs): Promise<void> => {\n session.mutate((state) => {\n state.layers.recordingState = args.recording;\n });\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_TOGGLE_LAYER,\n type: 'action',\n jsonSerializable: true,\n handler: async (args: ToggleLayerArgs): Promise<void> => {\n const flag = LAYER_FLAGS[args.layerId];\n // Custom layers have no capture flag to toggle — app code owns\n // whether it emits at all.\n if (!flag) return;\n session.mutate((state) => {\n state.layers[flag] = args.enabled;\n });\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_SET_SETTINGS_OVERRIDE,\n type: 'action',\n jsonSerializable: true,\n handler: async (override: SettingsOverride): Promise<void> => {\n source.setSettingsOverride(override);\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_OPEN_SOURCE,\n type: 'action',\n jsonSerializable: true,\n // Resolving here rather than in the panel is the whole point of\n // the hop: `file` is relative to the Vite root, while the open\n // service resolves relative paths against the host's\n // `workspaceRoot` -- in a monorepo (or any setup where the served\n // app isn't the workspace) those are different directories, and\n // `launchEditor` silently does nothing for a path that doesn't\n // exist. Not agent-exposed: it spawns a GUI process.\n handler: async (args: OpenSourceArgs): Promise<OpenSourceResult> => {\n const service = ctx.services.get('@devframes/service-open');\n if (service === undefined) return {opened: false};\n // Confined like `/__lit-open-in-editor`: whatever can reach this\n // RPC could otherwise have the editor open any file on disk.\n const {confineToRoots} = await import('../confine.js');\n const confined = confineToRoots(\n [sourceRoot?.() ?? process.cwd(), ...(allowedRoots?.() ?? [])],\n args.file\n );\n if ('failure' in confined) return {opened: false};\n const {path} = confined;\n const override = await my.settings.global.get('override');\n await service.openInEditor({\n path,\n line: args.line,\n editor: resolveLaunchEditor(configuredEditor?.(), override),\n });\n return {opened: true};\n },\n })\n );\n\n my.rpc.register(\n defineRpcFunction({\n name: RPC_EXPORT_SNAPSHOT,\n type: 'action',\n jsonSerializable: true,\n // Not agent-exposed. It writes a directory to the developer's disk,\n // which is not something a coding agent should be able to do behind\n // their back -- same reasoning as the other mutating actions.\n handler: async (\n args: ExportSnapshotArgs\n ): Promise<ExportSnapshotResult> => {\n // Imported here, not at module scope: this file has to keep\n // loading in contexts with no filesystem, and the build adapter\n // it pulls in reaches straight for `node:fs`.\n const {buildSnapshot} = await import('../snapshot.js');\n // `outDir` comes from the client and the build deletes it before\n // writing, so it has to land strictly beneath the working\n // directory -- never the directory itself, and never elsewhere\n // on disk.\n const {resolve, sep} = await import('node:path');\n const cwd = process.cwd();\n const outDir = resolve(cwd, args.outDir ?? 'lit-devtools-snapshot');\n if (!outDir.startsWith(cwd + sep)) {\n throw new Error(\n `[lit-devtools] export-snapshot: outDir must be inside ${cwd}`\n );\n }\n return buildSnapshot(\n {\n capturedAt: new Date().toISOString(),\n version,\n customLayers: [...session.value().customLayers],\n roots: cachedRoots,\n details: [...cachedDetails.values()],\n events: [...recentEvents],\n hmrIncompatibilities: [...hmrIncompatibilities],\n },\n {\n outDir,\n features: features ? features() : null,\n clientAssets: options.clientAssets,\n }\n );\n },\n })\n );\n },\n });\n}\n\nexport default createLitDevframe({\n source: createNullSource(),\n version: '0.0.0',\n});\n"]}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  /** Dock icon for the Lit devframe. */
7
2
  export declare const LIT_LOGO_ICON: string;
8
3
  //# sourceMappingURL=icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgBH,sCAAsC;AACtC,eAAO,MAAM,aAAa,QAEvB,CAAC"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"AAcA,sCAAsC;AACtC,eAAO,MAAM,aAAa,QAEvB,CAAC"}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  // The official Lit logo mark (Iconify `logos:lit-icon`). Its native viewBox is
7
2
  // 256×320 — taller than wide — so when the DevTools dock sizes an icon to its
8
3
  // width it overflowed the square slot and looked bigger than the other icons.
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,cAAc;AACd,MAAM,YAAY,GAChB,kEAAkE;IAClE,2HAA2H;IAC3H,mGAAmG;IACnG,0FAA0F;IAC1F,kDAAkD,CAAC;AAErD,sCAAsC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,kBAAkB,CACnE,YAAY,CACb,EAAE,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// The official Lit logo mark (Iconify `logos:lit-icon`). Its native viewBox is\n// 256×320 — taller than wide — so when the DevTools dock sizes an icon to its\n// width it overflowed the square slot and looked bigger than the other icons.\n// We pad it to a square viewBox (-32 0 320 320, centering the 256-wide art) so\n// it renders at the same box size as the built-in phosphor icons. Inlined as a\n// data: URI rather than `logos:lit-icon` so it also works offline (no Iconify\n// API fetch).\nconst LIT_LOGO_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-32 0 320 320\">' +\n '<path fill=\"#00e8ff\" d=\"m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z\"/>' +\n '<path fill=\"#283198\" d=\"M128 256V128l64-64v128zM0 256l64 64l9.202-60.602L64 192l-37.542 23.71z\"/>' +\n '<path fill=\"#324fff\" d=\"M64 192V64l64-64v128zm128 128V192l64-64v128zM0 256V128l64 64z\"/>' +\n '<path fill=\"#0ff\" d=\"M64 320V192l64 64z\"/></svg>';\n\n/** Dock icon for the Lit devframe. */\nexport const LIT_LOGO_ICON = `data:image/svg+xml,${encodeURIComponent(\n LIT_LOGO_SVG\n)}`;\n"]}
1
+ {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,cAAc;AACd,MAAM,YAAY,GAChB,kEAAkE;IAClE,2HAA2H;IAC3H,mGAAmG;IACnG,0FAA0F;IAC1F,kDAAkD,CAAC;AAErD,sCAAsC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,kBAAkB,CACnE,YAAY,CACb,EAAE,CAAC","sourcesContent":["// The official Lit logo mark (Iconify `logos:lit-icon`). Its native viewBox is\n// 256×320 — taller than wide — so when the DevTools dock sizes an icon to its\n// width it overflowed the square slot and looked bigger than the other icons.\n// We pad it to a square viewBox (-32 0 320 320, centering the 256-wide art) so\n// it renders at the same box size as the built-in phosphor icons. Inlined as a\n// data: URI rather than `logos:lit-icon` so it also works offline (no Iconify\n// API fetch).\nconst LIT_LOGO_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-32 0 320 320\">' +\n '<path fill=\"#00e8ff\" d=\"m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z\"/>' +\n '<path fill=\"#283198\" d=\"M128 256V128l64-64v128zM0 256l64 64l9.202-60.602L64 192l-37.542 23.71z\"/>' +\n '<path fill=\"#324fff\" d=\"M64 192V64l64-64v128zm128 128V192l64-64v128zM0 256V128l64 64z\"/>' +\n '<path fill=\"#0ff\" d=\"M64 320V192l64 64z\"/></svg>';\n\n/** Dock icon for the Lit devframe. */\nexport const LIT_LOGO_ICON = `data:image/svg+xml,${encodeURIComponent(\n LIT_LOGO_SVG\n)}`;\n"]}
@@ -1,8 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
1
  import type { KnownEditor } from 'devframe/utils/launch-editor';
7
2
  import type { SettingsOverride } from '../../types/timeline.js';
8
3
  /** The `launch-editor` command for an overlay editor key, if it has one. */
@@ -1 +1 @@
1
- {"version":3,"file":"launch-editor.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/launch-editor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAqB9D,4EAA4E;AAC5E,eAAO,MAAM,cAAc,QACpB,MAAM,GAAG,SAAS,KACtB,WAAW,GAAG,SAGF,CAAC;AAEhB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,eAClB,MAAM,GAAG,SAAS,YACpB,gBAAgB,GAAG,SAAS,KACrC,WAAW,GAAG,SAC4C,CAAC"}
1
+ {"version":3,"file":"launch-editor.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/launch-editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAqB9D,4EAA4E;AAC5E,eAAO,MAAM,cAAc,QACpB,MAAM,GAAG,SAAS,KACtB,WAAW,GAAG,SAGF,CAAC;AAEhB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,eAClB,MAAM,GAAG,SAAS,YACpB,gBAAgB,GAAG,SAAS,KACrC,WAAW,GAAG,SAC4C,CAAC"}
@@ -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 source overlay's editor keys, mapped to the command `launch-editor`
8
3
  * knows them by. The two vocabularies overlap by accident of naming (`zed`,
@@ -1 +1 @@
1
- {"version":3,"file":"launch-editor.js","sourceRoot":"","sources":["../../src/lib/devframe/launch-editor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;;;;;;GAWG;AACH,MAAM,cAAc,GAAgC;IAClD,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAuB,EACE,EAAE,CAC3B,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,CAAC;IACrD,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC;IACrB,CAAC,CAAC,SAAS,CAAC;AAEhB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,UAA8B,EAC9B,QAAsC,EACb,EAAE,CAC3B,cAAc,CAAC,QAAQ,EAAE,mBAAmB,IAAI,UAAU,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type {KnownEditor} from 'devframe/utils/launch-editor';\nimport type {SettingsOverride} from '../../types/timeline.js';\n\n/**\n * The source overlay's editor keys, mapped to the command `launch-editor`\n * knows them by. The two vocabularies overlap by accident of naming (`zed`,\n * `cursor`, `idea`) except for VS Code, whose overlay key is `vscode` but\n * whose command is `code`.\n *\n * `windsurf` is missing on purpose: `@devframes/service-open` only accepts\n * `launch-editor`'s own picklist, and passing anything else would either be\n * rejected or spawn a command nobody vetted. It, custom `{name, url}`\n * editors and unknown keys all resolve to `undefined`, which leaves\n * `launch-editor` to auto-detect as it always did.\n */\nconst LAUNCH_EDITORS: Record<string, KnownEditor> = {\n vscode: 'code',\n cursor: 'cursor',\n zed: 'zed',\n idea: 'idea',\n};\n\n/** The `launch-editor` command for an overlay editor key, if it has one. */\nexport const toLaunchEditor = (\n key: string | undefined\n): KnownEditor | undefined =>\n key !== undefined && Object.hasOwn(LAUNCH_EDITORS, key)\n ? LAUNCH_EDITORS[key]\n : undefined;\n\n/**\n * The editor server-side open-in-editor should use: the panel override if the\n * developer set one, else the editor named in config or env, else nothing.\n *\n * `configured` must be `undefined` when the developer never named an editor.\n * The Settings tab reports `vscode` for that case (the overlay's URL-scheme\n * default), but forcing `code` here would trade auto-detection for a guess\n * on every project that never chose.\n */\nexport const resolveLaunchEditor = (\n configured: string | undefined,\n override: SettingsOverride | undefined\n): KnownEditor | undefined =>\n toLaunchEditor(override?.sourceOverlayEditor ?? configured);\n"]}
1
+ {"version":3,"file":"launch-editor.js","sourceRoot":"","sources":["../../src/lib/devframe/launch-editor.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,cAAc,GAAgC;IAClD,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAuB,EACE,EAAE,CAC3B,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,CAAC;IACrD,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC;IACrB,CAAC,CAAC,SAAS,CAAC;AAEhB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,UAA8B,EAC9B,QAAsC,EACb,EAAE,CAC3B,cAAc,CAAC,QAAQ,EAAE,mBAAmB,IAAI,UAAU,CAAC,CAAC","sourcesContent":["import type {KnownEditor} from 'devframe/utils/launch-editor';\nimport type {SettingsOverride} from '../../types/timeline.js';\n\n/**\n * The source overlay's editor keys, mapped to the command `launch-editor`\n * knows them by. The two vocabularies overlap by accident of naming (`zed`,\n * `cursor`, `idea`) except for VS Code, whose overlay key is `vscode` but\n * whose command is `code`.\n *\n * `windsurf` is missing on purpose: `@devframes/service-open` only accepts\n * `launch-editor`'s own picklist, and passing anything else would either be\n * rejected or spawn a command nobody vetted. It, custom `{name, url}`\n * editors and unknown keys all resolve to `undefined`, which leaves\n * `launch-editor` to auto-detect as it always did.\n */\nconst LAUNCH_EDITORS: Record<string, KnownEditor> = {\n vscode: 'code',\n cursor: 'cursor',\n zed: 'zed',\n idea: 'idea',\n};\n\n/** The `launch-editor` command for an overlay editor key, if it has one. */\nexport const toLaunchEditor = (\n key: string | undefined\n): KnownEditor | undefined =>\n key !== undefined && Object.hasOwn(LAUNCH_EDITORS, key)\n ? LAUNCH_EDITORS[key]\n : undefined;\n\n/**\n * The editor server-side open-in-editor should use: the panel override if the\n * developer set one, else the editor named in config or env, else nothing.\n *\n * `configured` must be `undefined` when the developer never named an editor.\n * The Settings tab reports `vscode` for that case (the overlay's URL-scheme\n * default), but forcing `code` here would trade auto-detection for a guess\n * on every project that never chose.\n */\nexport const resolveLaunchEditor = (\n configured: string | undefined,\n override: SettingsOverride | undefined\n): KnownEditor | undefined =>\n toLaunchEditor(override?.sourceOverlayEditor ?? configured);\n"]}
@@ -1,7 +1,12 @@
1
1
  /**
2
- * @license
3
- * Copyright 2026 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
2
+ * Package-root resolution for the devframe.
3
+ *
4
+ * `tsc` flattens `src/lib/devframe/*.ts` to `lib/devframe/*.js`, so a path
5
+ * relative to `import.meta.url` lands one directory apart depending on
6
+ * whether the module was loaded from source (tests, `vite dev` on this repo)
7
+ * or from the published output. Walking up to the nearest `package.json`
8
+ * instead is correct in both layouts — the same reason
9
+ * `resolveRuntimeModule()` in plugin.ts probes for both extensions.
5
10
  */
6
11
  /** Absolute path of this package's root directory. */
7
12
  export declare const PACKAGE_ROOT: string;
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6BH,sDAAsD;AACtD,eAAO,MAAM,YAAY,EAAE,MAA0B,CAAC;AAEtD,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,MAKR,CAAC;AAEvB,uEAAuE;AACvE,eAAO,MAAM,cAAc,EAAE,MAA6C,CAAC"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,sDAAsD;AACtD,eAAO,MAAM,YAAY,EAAE,MAA0B,CAAC;AAEtD,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,MAKR,CAAC;AAEvB,uEAAuE;AACvE,eAAO,MAAM,cAAc,EAAE,MAA6C,CAAC"}
@@ -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,kBAAkB,CAA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,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,kDAAkD;A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;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,OAAO,GAAG,IA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AC,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,KAAK,IAA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AU,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,MAAM,iBA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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