@oddsquad/vite-plugin-lit 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/LICENSE +1 -1
- package/README.md +40 -17
- package/bin.mjs +89 -13
- package/client.d.ts +0 -6
- package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-F2EfZsFX.js → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js} +2 -2
- package/dist/client/assets/{browser-agent-rpc-BXhoSh1z-F2EfZsFX.js.map → browser-agent-rpc-BXhoSh1z-ybEeG-x9.js.map} +1 -1
- package/dist/client/assets/{index-B2HYO7lk.js → index-CgkhETVR.js} +22 -145
- package/dist/client/assets/index-CgkhETVR.js.map +1 -0
- package/dist/client/index.html +1 -1
- package/dist/standalone/lit-devtools.js +6717 -0
- package/index.d.ts +0 -5
- package/index.d.ts.map +1 -1
- package/index.js +1 -5
- package/index.js.map +1 -1
- package/lib/color-scheme.d.ts +0 -5
- package/lib/color-scheme.d.ts.map +1 -1
- package/lib/color-scheme.js +0 -5
- package/lib/color-scheme.js.map +1 -1
- package/lib/confine.d.ts +0 -5
- package/lib/confine.d.ts.map +1 -1
- package/lib/confine.js +0 -5
- package/lib/confine.js.map +1 -1
- package/lib/devframe/allowed-origins.d.ts +21 -0
- package/lib/devframe/allowed-origins.d.ts.map +1 -0
- package/lib/devframe/allowed-origins.js +58 -0
- package/lib/devframe/allowed-origins.js.map +1 -0
- package/lib/devframe/definition.d.ts +7 -3
- package/lib/devframe/definition.d.ts.map +1 -1
- package/lib/devframe/definition.js +1 -6
- package/lib/devframe/definition.js.map +1 -1
- package/lib/devframe/icon.d.ts +0 -5
- package/lib/devframe/icon.d.ts.map +1 -1
- package/lib/devframe/icon.js +0 -5
- package/lib/devframe/icon.js.map +1 -1
- package/lib/devframe/launch-editor.d.ts +0 -5
- package/lib/devframe/launch-editor.d.ts.map +1 -1
- package/lib/devframe/launch-editor.js +0 -5
- package/lib/devframe/launch-editor.js.map +1 -1
- package/lib/devframe/paths.d.ts +8 -3
- package/lib/devframe/paths.d.ts.map +1 -1
- package/lib/devframe/paths.js +0 -5
- package/lib/devframe/paths.js.map +1 -1
- package/lib/devframe/protocol.d.ts +6 -3
- package/lib/devframe/protocol.d.ts.map +1 -1
- package/lib/devframe/protocol.js +0 -5
- package/lib/devframe/protocol.js.map +1 -1
- package/lib/devframe/rpc-source.d.ts +15 -3
- package/lib/devframe/rpc-source.d.ts.map +1 -1
- package/lib/devframe/rpc-source.js +0 -5
- package/lib/devframe/rpc-source.js.map +1 -1
- package/lib/devframe/source.d.ts +0 -5
- package/lib/devframe/source.d.ts.map +1 -1
- package/lib/devframe/source.js +7 -3
- package/lib/devframe/source.js.map +1 -1
- package/lib/devframe/vite.d.ts +0 -5
- package/lib/devframe/vite.d.ts.map +1 -1
- package/lib/devframe/vite.js +16 -3
- package/lib/devframe/vite.js.map +1 -1
- package/lib/http.d.ts +0 -5
- package/lib/http.d.ts.map +1 -1
- package/lib/http.js +0 -5
- package/lib/http.js.map +1 -1
- package/lib/icons.d.ts +0 -5
- package/lib/icons.d.ts.map +1 -1
- package/lib/icons.js +0 -5
- package/lib/icons.js.map +1 -1
- package/lib/options.d.ts +26 -5
- package/lib/options.d.ts.map +1 -1
- package/lib/options.js +19 -5
- package/lib/options.js.map +1 -1
- package/lib/override-baselines.d.ts +0 -5
- package/lib/override-baselines.d.ts.map +1 -1
- package/lib/override-baselines.js +0 -5
- package/lib/override-baselines.js.map +1 -1
- package/lib/plugin.d.ts +0 -5
- package/lib/plugin.d.ts.map +1 -1
- package/lib/plugin.js +3 -5
- package/lib/plugin.js.map +1 -1
- package/lib/plugins/css-literals.d.ts +0 -5
- package/lib/plugins/css-literals.d.ts.map +1 -1
- package/lib/plugins/css-literals.js +0 -5
- package/lib/plugins/css-literals.js.map +1 -1
- package/lib/plugins/css-queries.d.ts +0 -5
- package/lib/plugins/css-queries.d.ts.map +1 -1
- package/lib/plugins/css-queries.js +0 -5
- package/lib/plugins/css-queries.js.map +1 -1
- package/lib/plugins/open-in-editor.d.ts +0 -5
- package/lib/plugins/open-in-editor.d.ts.map +1 -1
- package/lib/plugins/open-in-editor.js +0 -5
- package/lib/plugins/open-in-editor.js.map +1 -1
- package/lib/plugins/private-fields.d.ts +22 -0
- package/lib/plugins/private-fields.d.ts.map +1 -0
- package/lib/plugins/private-fields.js +254 -0
- package/lib/plugins/private-fields.js.map +1 -0
- package/lib/plugins/shared.d.ts +0 -5
- package/lib/plugins/shared.d.ts.map +1 -1
- package/lib/plugins/shared.js +0 -5
- package/lib/plugins/shared.js.map +1 -1
- package/lib/plugins/timeline-virtual.d.ts +0 -5
- package/lib/plugins/timeline-virtual.d.ts.map +1 -1
- package/lib/plugins/timeline-virtual.js +0 -5
- package/lib/plugins/timeline-virtual.js.map +1 -1
- package/lib/runtime/child-state.d.ts +95 -0
- package/lib/runtime/child-state.d.ts.map +1 -0
- package/lib/runtime/child-state.js +461 -0
- package/lib/runtime/child-state.js.map +1 -0
- package/lib/runtime/css.d.ts +14 -3
- package/lib/runtime/css.d.ts.map +1 -1
- package/lib/runtime/css.js +3 -5
- package/lib/runtime/css.js.map +1 -1
- package/lib/runtime/edge-panel.d.ts +8 -3
- package/lib/runtime/edge-panel.d.ts.map +1 -1
- package/lib/runtime/edge-panel.js +0 -5
- package/lib/runtime/edge-panel.js.map +1 -1
- package/lib/runtime/fonts.d.ts +0 -5
- package/lib/runtime/fonts.d.ts.map +1 -1
- package/lib/runtime/fonts.js +0 -5
- package/lib/runtime/fonts.js.map +1 -1
- package/lib/runtime/indicator.d.ts +3 -3
- package/lib/runtime/indicator.js +0 -5
- package/lib/runtime/indicator.js.map +1 -1
- package/lib/runtime/inspector/collect.d.ts +3 -3
- package/lib/runtime/inspector/collect.d.ts.map +1 -1
- package/lib/runtime/inspector/collect.js +0 -5
- package/lib/runtime/inspector/collect.js.map +1 -1
- package/lib/runtime/inspector/highlight.d.ts +10 -3
- package/lib/runtime/inspector/highlight.d.ts.map +1 -1
- package/lib/runtime/inspector/highlight.js +0 -5
- package/lib/runtime/inspector/highlight.js.map +1 -1
- package/lib/runtime/inspector/install.d.ts +6 -3
- package/lib/runtime/inspector/install.d.ts.map +1 -1
- package/lib/runtime/inspector/install.js +4 -6
- package/lib/runtime/inspector/install.js.map +1 -1
- package/lib/runtime/inspector/serialize.d.ts +4 -3
- package/lib/runtime/inspector/serialize.d.ts.map +1 -1
- package/lib/runtime/inspector/serialize.js +0 -5
- package/lib/runtime/inspector/serialize.js.map +1 -1
- package/lib/runtime/intern.d.ts +11 -3
- package/lib/runtime/intern.d.ts.map +1 -1
- package/lib/runtime/intern.js +11 -3
- package/lib/runtime/intern.js.map +1 -1
- package/lib/runtime/overrides.d.ts +3 -3
- package/lib/runtime/overrides.d.ts.map +1 -1
- package/lib/runtime/overrides.js +0 -5
- package/lib/runtime/overrides.js.map +1 -1
- package/lib/runtime/page-channel.d.ts +0 -5
- package/lib/runtime/page-channel.d.ts.map +1 -1
- package/lib/runtime/page-channel.js +13 -3
- package/lib/runtime/page-channel.js.map +1 -1
- package/lib/runtime/patch.d.ts +22 -3
- package/lib/runtime/patch.d.ts.map +1 -1
- package/lib/runtime/patch.js +22 -6
- package/lib/runtime/patch.js.map +1 -1
- package/lib/runtime/rpc-transport.d.ts +21 -3
- package/lib/runtime/rpc-transport.d.ts.map +1 -1
- package/lib/runtime/rpc-transport.js +4 -5
- package/lib/runtime/rpc-transport.js.map +1 -1
- package/lib/runtime/source-meta.d.ts +0 -5
- package/lib/runtime/source-meta.d.ts.map +1 -1
- package/lib/runtime/source-meta.js +0 -5
- package/lib/runtime/source-meta.js.map +1 -1
- package/lib/runtime/source-overlay/editors.d.ts +0 -5
- package/lib/runtime/source-overlay/editors.d.ts.map +1 -1
- package/lib/runtime/source-overlay/editors.js +9 -9
- package/lib/runtime/source-overlay/editors.js.map +1 -1
- package/lib/runtime/source-overlay/mask-path.d.ts +0 -5
- package/lib/runtime/source-overlay/mask-path.d.ts.map +1 -1
- package/lib/runtime/source-overlay/mask-path.js +0 -5
- package/lib/runtime/source-overlay/mask-path.js.map +1 -1
- package/lib/runtime/source-overlay/overlay-element.d.ts +0 -5
- package/lib/runtime/source-overlay/overlay-element.d.ts.map +1 -1
- package/lib/runtime/source-overlay/overlay-element.js +0 -5
- package/lib/runtime/source-overlay/overlay-element.js.map +1 -1
- package/lib/runtime/source-overlay/source-host.d.ts +0 -5
- package/lib/runtime/source-overlay/source-host.d.ts.map +1 -1
- package/lib/runtime/source-overlay/source-host.js +0 -5
- package/lib/runtime/source-overlay/source-host.js.map +1 -1
- package/lib/runtime/source-overlay/template.d.ts +0 -5
- package/lib/runtime/source-overlay/template.d.ts.map +1 -1
- package/lib/runtime/source-overlay/template.js +0 -5
- package/lib/runtime/source-overlay/template.js.map +1 -1
- package/lib/runtime/source-overlay.d.ts +0 -5
- package/lib/runtime/source-overlay.d.ts.map +1 -1
- package/lib/runtime/source-overlay.js +0 -5
- package/lib/runtime/source-overlay.js.map +1 -1
- package/lib/runtime/standalone.d.ts +22 -0
- package/lib/runtime/standalone.d.ts.map +1 -0
- package/lib/runtime/standalone.js +45 -0
- package/lib/runtime/standalone.js.map +1 -0
- package/lib/runtime/timeline/chrome-tracks.d.ts +0 -5
- package/lib/runtime/timeline/chrome-tracks.d.ts.map +1 -1
- package/lib/runtime/timeline/chrome-tracks.js +5 -3
- package/lib/runtime/timeline/chrome-tracks.js.map +1 -1
- package/lib/runtime/timeline/clock.d.ts +7 -3
- package/lib/runtime/timeline/clock.d.ts.map +1 -1
- package/lib/runtime/timeline/clock.js +0 -5
- package/lib/runtime/timeline/clock.js.map +1 -1
- package/lib/runtime/timeline/flash.d.ts +0 -5
- package/lib/runtime/timeline/flash.d.ts.map +1 -1
- package/lib/runtime/timeline/flash.js +15 -3
- package/lib/runtime/timeline/flash.js.map +1 -1
- package/lib/runtime/timeline/identity.d.ts +0 -5
- package/lib/runtime/timeline/identity.d.ts.map +1 -1
- package/lib/runtime/timeline/identity.js +9 -3
- package/lib/runtime/timeline/identity.js.map +1 -1
- package/lib/runtime/timeline/input.d.ts +0 -5
- package/lib/runtime/timeline/input.d.ts.map +1 -1
- package/lib/runtime/timeline/input.js +2 -3
- package/lib/runtime/timeline/input.js.map +1 -1
- package/lib/runtime/timeline/install.d.ts +11 -3
- package/lib/runtime/timeline/install.d.ts.map +1 -1
- package/lib/runtime/timeline/install.js +4 -7
- package/lib/runtime/timeline/install.js.map +1 -1
- package/lib/runtime/timeline/lifecycle.d.ts +13 -3
- package/lib/runtime/timeline/lifecycle.d.ts.map +1 -1
- package/lib/runtime/timeline/lifecycle.js +5 -6
- package/lib/runtime/timeline/lifecycle.js.map +1 -1
- package/lib/runtime/timeline/public-api.d.ts +6 -3
- package/lib/runtime/timeline/public-api.d.ts.map +1 -1
- package/lib/runtime/timeline/public-api.js +0 -5
- package/lib/runtime/timeline/public-api.js.map +1 -1
- package/lib/runtime/timeline/render.d.ts +0 -5
- package/lib/runtime/timeline/render.d.ts.map +1 -1
- package/lib/runtime/timeline/render.js +21 -3
- package/lib/runtime/timeline/render.js.map +1 -1
- package/lib/runtime/timeline/transport.d.ts +0 -5
- package/lib/runtime/timeline/transport.d.ts.map +1 -1
- package/lib/runtime/timeline/transport.js +10 -3
- package/lib/runtime/timeline/transport.js.map +1 -1
- package/lib/segmented-tabs.d.ts +0 -5
- package/lib/segmented-tabs.d.ts.map +1 -1
- package/lib/segmented-tabs.js +0 -5
- package/lib/segmented-tabs.js.map +1 -1
- package/lib/snapshot.d.ts +11 -3
- package/lib/snapshot.d.ts.map +1 -1
- package/lib/snapshot.js +0 -5
- package/lib/snapshot.js.map +1 -1
- package/lib/source-meta.d.ts +0 -5
- package/lib/source-meta.d.ts.map +1 -1
- package/lib/source-meta.js +0 -5
- package/lib/source-meta.js.map +1 -1
- package/lib/timeline/derive.d.ts +0 -5
- package/lib/timeline/derive.d.ts.map +1 -1
- package/lib/timeline/derive.js +22 -3
- package/lib/timeline/derive.js.map +1 -1
- package/lib/timeline/filter.d.ts +0 -5
- package/lib/timeline/filter.d.ts.map +1 -1
- package/lib/timeline/filter.js +6 -3
- package/lib/timeline/filter.js.map +1 -1
- package/lib/timeline/tracks.d.ts +0 -5
- package/lib/timeline/tracks.d.ts.map +1 -1
- package/lib/timeline/tracks.js +12 -3
- package/lib/timeline/tracks.js.map +1 -1
- package/lib/tokens.d.ts +0 -5
- package/lib/tokens.d.ts.map +1 -1
- package/lib/tokens.js +0 -5
- package/lib/tokens.js.map +1 -1
- package/lib/transform.d.ts +0 -5
- package/lib/transform.d.ts.map +1 -1
- package/lib/transform.js +0 -5
- package/lib/transform.js.map +1 -1
- package/lib/types.d.ts +10 -5
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +0 -5
- package/lib/types.js.map +1 -1
- package/lib/wrap-table.d.ts +0 -5
- package/lib/wrap-table.d.ts.map +1 -1
- package/lib/wrap-table.js +12 -3
- package/lib/wrap-table.js.map +1 -1
- package/package.json +14 -10
- package/types/hmr-incompatibility.d.ts +0 -5
- package/types/hmr-incompatibility.d.ts.map +1 -1
- package/types/hmr-incompatibility.js +13 -3
- package/types/hmr-incompatibility.js.map +1 -1
- package/types/in-page.d.ts +0 -5
- package/types/in-page.d.ts.map +1 -1
- package/types/in-page.js +0 -5
- package/types/in-page.js.map +1 -1
- package/types/inspector.d.ts +0 -5
- package/types/inspector.d.ts.map +1 -1
- package/types/inspector.js +13 -3
- package/types/inspector.js.map +1 -1
- package/types/snapshot.d.ts +0 -5
- package/types/snapshot.d.ts.map +1 -1
- package/types/snapshot.js +12 -3
- package/types/snapshot.js.map +1 -1
- package/types/timeline.d.ts +4 -6
- package/types/timeline.d.ts.map +1 -1
- package/types/timeline.js +0 -5
- package/types/timeline.js.map +1 -1
- package/dist/client/assets/index-B2HYO7lk.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
1
|
export { litPlugin, litPlugin as default } from './lib/plugin.js';
|
|
7
2
|
export type { LitPluginOptions } from './lib/plugin.js';
|
|
8
3
|
export type { ElementInfo, EditorConfig, SourceOverlayOptions, } from './lib/types.js';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,SAAS,IAAI,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAChE,YAAY,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,gBAAgB,CAAC"}
|
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAC,SAAS,EAAE,SAAS,IAAI,OAAO,EAAC,MAAM,iBAAiB,CAAC","sourcesContent":["/* @ts-self-types=\"./index.d.ts\" */\nexport {litPlugin, litPlugin as default} from './lib/plugin.js';\nexport type {LitPluginOptions} from './lib/plugin.js';\nexport type {\n ElementInfo,\n EditorConfig,\n SourceOverlayOptions,\n} from './lib/types.js';\n"]}
|
package/lib/color-scheme.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-scheme.d.ts","sourceRoot":"","sources":["../src/lib/color-scheme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"color-scheme.d.ts","sourceRoot":"","sources":["../src/lib/color-scheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,uDAAuD;AACvD,eAAO,MAAM,yBAAyB,QAAO,qBAQ5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,SAAU,qBAAqB,KAAG,IAI9D,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,wBAAwB,SAAU,qBAAqB,KAAG,IAOtE,CAAC"}
|
package/lib/color-scheme.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
1
|
/** localStorage key for the panel UI color-scheme preference. */
|
|
7
2
|
export const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';
|
|
8
3
|
/** Read the saved preference, defaulting to `auto`. */
|
package/lib/color-scheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-scheme.js","sourceRoot":"","sources":["../src/lib/color-scheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color-scheme.js","sourceRoot":"","sources":["../src/lib/color-scheme.ts"],"names":[],"mappings":"AAaA,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAE/D,uDAAuD;AACvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA0B,EAAE;IACnE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACtD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,OAAO;YAAE,OAAO,GAAG,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAA2B,EAAQ,EAAE;IACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;IACtC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACjE,IAAI,IAAI,KAAK,MAAM;QAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAA2B,EAAQ,EAAE;IAC5E,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC","sourcesContent":["/**\n * Panel color-scheme preference, persisted in `localStorage`.\n *\n * `auto` is the default and needs no JavaScript: the token values injected by\n * {@link injectTokens} in `tokens.ts` react to `prefers-color-scheme` via\n * `@media`, so the panel follows whatever scheme its host requests — the OS\n * when standalone, or the embedding app's `color-scheme` when docked in the\n * Vite DevTools shell (the iframe inherits it). An explicit `light`/`dark`\n * preference pins the matching `.color-scheme-light` / `.color-scheme-dark`\n * class on the document root, overriding the media query.\n */\nexport type ColorSchemePreference = 'auto' | 'dark' | 'light';\n\n/** localStorage key for the panel UI color-scheme preference. */\nexport const COLOR_SCHEME_LS_KEY = 'lit-devtools-color-scheme';\n\n/** Read the saved preference, defaulting to `auto`. */\nexport const readColorSchemePreference = (): ColorSchemePreference => {\n try {\n const raw = localStorage.getItem(COLOR_SCHEME_LS_KEY);\n if (raw === 'auto' || raw === 'dark' || raw === 'light') return raw;\n } catch {\n // ignore\n }\n return 'auto';\n};\n\n/**\n * Apply a preference to the document root. `light`/`dark` pin the matching\n * class; `auto` removes both and lets the `prefers-color-scheme` `@media` rule\n * in the injected tokens own the scheme (and live-update on OS changes).\n */\nexport const applyColorScheme = (pref: ColorSchemePreference): void => {\n const root = document.documentElement;\n root.classList.remove('color-scheme-light', 'color-scheme-dark');\n if (pref !== 'auto') root.classList.add('color-scheme-' + pref);\n};\n\n/** Persist a preference and apply it immediately. */\nexport const setColorSchemePreference = (pref: ColorSchemePreference): void => {\n try {\n localStorage.setItem(COLOR_SCHEME_LS_KEY, pref);\n } catch {\n // ignore\n }\n applyColorScheme(pref);\n};\n"]}
|
package/lib/confine.d.ts
CHANGED
package/lib/confine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confine.d.ts","sourceRoot":"","sources":["../src/lib/confine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confine.d.ts","sourceRoot":"","sources":["../src/lib/confine.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,UAClB,SAAS,MAAM,EAAE,QAClB,MAAM,KACX;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,OAAO,EAAE,cAAc,CAAA;CAmB3C,CAAC"}
|
package/lib/confine.js
CHANGED
package/lib/confine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confine.js","sourceRoot":"","sources":["../src/lib/confine.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"confine.js","sourceRoot":"","sources":["../src/lib/confine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAE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I,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC","sourcesContent":["import {existsSync, realpathSync} from 'node:fs';\nimport {resolve as resolvePath, sep} from 'node:path';\n\n/** Why {@link confineToRoots} refused a path. */\nexport type ConfineFailure = 'outside' | 'missing';\n\n/**\n * Resolve `file` against the first of `roots` and accept it only if it lands\n * at or beneath one of them and exists. Every caller hands the result to\n * `launch-editor`, which spawns the developer's editor on it, so this is the\n * boundary that keeps a request from opening arbitrary files (absolute paths,\n * `../` traversal, a sibling directory that merely shares a root's prefix, a\n * symlink out of the tree).\n * Without roots nothing is allowed.\n */\nexport const confineToRoots = (\n roots: readonly string[],\n file: string\n): {path: string} | {failure: ConfineFailure} => {\n const resolvedRoots = roots.map((root) => resolvePath(root));\n const primary = resolvedRoots[0];\n if (primary === undefined) return {failure: 'outside'};\n const path = resolvePath(primary, file);\n if (!within(resolvedRoots, path)) return {failure: 'outside'};\n if (!existsSync(path)) return {failure: 'missing'};\n // Checked again on the real paths, so a symlink beneath a root can't point\n // the editor outside every root. The caller still gets the path as asked:\n // that's the one the developer recognises.\n const realRoots = resolvedRoots.flatMap((root) => {\n try {\n return [realpathSync(root)];\n } catch {\n return [];\n }\n });\n if (!within(realRoots, realpathSync(path))) return {failure: 'outside'};\n return {path};\n};\n\nconst within = (roots: readonly string[], path: string): boolean =>\n roots.some((root) => path === root || path.startsWith(root + sep));\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The origin allowlist behind `lit-devtools dev --allow-origin`.
|
|
3
|
+
*
|
|
4
|
+
* devframe compares `allowedOrigins` entries exactly, which cannot admit a
|
|
5
|
+
* page whose origin is only known once it boots: StackBlitz gives every port
|
|
6
|
+
* of a project its own `https://<slug>--<port>--<hash>.<zone>.webcontainer-api.io`.
|
|
7
|
+
* An entry may therefore put `*` in its host (`https://*.webcontainer-api.io`),
|
|
8
|
+
* standing for one or more DNS labels. Scheme and port still have to match.
|
|
9
|
+
*
|
|
10
|
+
* With a wildcard among the entries the list is handed to devframe as an
|
|
11
|
+
* origin registry, the one shape it accepts that decides per origin; its
|
|
12
|
+
* WebSocket and SSE gates both ask it. Without one it stays a plain array.
|
|
13
|
+
*/
|
|
14
|
+
import type { WsOriginRegistry } from 'devframe/rpc/transports/ws-server';
|
|
15
|
+
/**
|
|
16
|
+
* `allowedOrigins` for `createDevServer`, from the `--allow-origin` values:
|
|
17
|
+
* `undefined` for none, the entries as given when all are exact, or a registry
|
|
18
|
+
* that also matches the wildcard ones. Throws on a malformed wildcard entry.
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveAllowedOrigins: (entries: readonly string[]) => readonly string[] | WsOriginRegistry | undefined;
|
|
21
|
+
//# sourceMappingURL=allowed-origins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-origins.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/allowed-origins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AAsBxE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,YACvB,SAAS,MAAM,EAAE,KACzB,SAAS,MAAM,EAAE,GAAG,gBAAgB,GAAG,SAkBzC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The origin allowlist behind `lit-devtools dev --allow-origin`.
|
|
3
|
+
*
|
|
4
|
+
* devframe compares `allowedOrigins` entries exactly, which cannot admit a
|
|
5
|
+
* page whose origin is only known once it boots: StackBlitz gives every port
|
|
6
|
+
* of a project its own `https://<slug>--<port>--<hash>.<zone>.webcontainer-api.io`.
|
|
7
|
+
* An entry may therefore put `*` in its host (`https://*.webcontainer-api.io`),
|
|
8
|
+
* standing for one or more DNS labels. Scheme and port still have to match.
|
|
9
|
+
*
|
|
10
|
+
* With a wildcard among the entries the list is handed to devframe as an
|
|
11
|
+
* origin registry, the one shape it accepts that decides per origin; its
|
|
12
|
+
* WebSocket and SSE gates both ask it. Without one it stays a plain array.
|
|
13
|
+
*/
|
|
14
|
+
import {isAllowedOrigin} from 'devframe/rpc/transports/ws-server';
|
|
15
|
+
/** An entry with `*` in the host, compiled to a matcher. */
|
|
16
|
+
const compilePattern = (entry) => {
|
|
17
|
+
const match = /^(https?):\/\/([^/:]+)(?::(\d+))?\/?$/.exec(entry);
|
|
18
|
+
const host = match?.[2] ?? '';
|
|
19
|
+
// `*` alone, or `*.com`, would admit most of the web.
|
|
20
|
+
if (match === null || !/^(?:[^*]*\*)*[^*]*\.[^*.]+\.[^*.]+$/.test(host)) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`--allow-origin ${entry}: a wildcard needs the shape ` +
|
|
23
|
+
`https://*.example.com, with at least two literal labels after it`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
const [, scheme, , port] = match;
|
|
27
|
+
const hostSource = host
|
|
28
|
+
.split('*')
|
|
29
|
+
.map((part) => part.replace(/[.\\+?^$()[\]{}|-]/g, '\\$&'))
|
|
30
|
+
.join('[a-z0-9-]+(?:\\.[a-z0-9-]+)*');
|
|
31
|
+
const portSource = port === undefined ? '' : `:${port}`;
|
|
32
|
+
return new RegExp(`^${scheme}://${hostSource}${portSource}$`, 'i');
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* `allowedOrigins` for `createDevServer`, from the `--allow-origin` values:
|
|
36
|
+
* `undefined` for none, the entries as given when all are exact, or a registry
|
|
37
|
+
* that also matches the wildcard ones. Throws on a malformed wildcard entry.
|
|
38
|
+
*/
|
|
39
|
+
export const resolveAllowedOrigins = (entries) => {
|
|
40
|
+
if (entries.length === 0) return undefined;
|
|
41
|
+
const exact = entries
|
|
42
|
+
.filter((entry) => !entry.includes('*'))
|
|
43
|
+
.map((entry) => entry.replace(/\/$/, ''));
|
|
44
|
+
const patterns = entries
|
|
45
|
+
.filter((entry) => entry.includes('*'))
|
|
46
|
+
.map(compilePattern);
|
|
47
|
+
if (patterns.length === 0) return exact;
|
|
48
|
+
return {
|
|
49
|
+
// No viewer registers itself through this list, so the token guards
|
|
50
|
+
// nothing; it is random only so it is never a guessable constant.
|
|
51
|
+
token: crypto.randomUUID(),
|
|
52
|
+
registerFromUrl: () => undefined,
|
|
53
|
+
isAllowed: (origin) =>
|
|
54
|
+
isAllowedOrigin(origin, exact) ||
|
|
55
|
+
(origin !== undefined && patterns.some((re) => re.test(origin))),
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=allowed-origins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-origins.js","sourceRoot":"","sources":["../../src/lib/devframe/allowed-origins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAGlE,4DAA4D;AAC5D,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC/C,MAAM,KAAK,GAAG,uCAAuC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9B,sDAAsD;IACtD,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,qCAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CACb,kBAAkB,KAAK,+BAA+B;YACpD,kEAAkE,CACrE,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,EAAE,MAAM,EAAE,AAAD,EAAG,IAAI,CAAC,GAAG,KAAK,CAAC;IACjC,MAAM,UAAU,GAAG,IAAI;SACpB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;SAC1D,IAAI,CAAC,8BAA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Content":["/**\n * The origin allowlist behind `lit-devtools dev --allow-origin`.\n *\n * devframe compares `allowedOrigins` entries exactly, which cannot admit a\n * page whose origin is only known once it boots: StackBlitz gives every port\n * of a project its own `https://<slug>--<port>--<hash>.<zone>.webcontainer-api.io`.\n * An entry may therefore put `*` in its host (`https://*.webcontainer-api.io`),\n * standing for one or more DNS labels. Scheme and port still have to match.\n *\n * With a wildcard among the entries the list is handed to devframe as an\n * origin registry, the one shape it accepts that decides per origin; its\n * WebSocket and SSE gates both ask it. Without one it stays a plain array.\n */\n\nimport {isAllowedOrigin} from 'devframe/rpc/transports/ws-server';\nimport type {WsOriginRegistry} from 'devframe/rpc/transports/ws-server';\n\n/** An entry with `*` in the host, compiled to a matcher. */\nconst compilePattern = (entry: string): RegExp => {\n const match = /^(https?):\\/\\/([^/:]+)(?::(\\d+))?\\/?$/.exec(entry);\n const host = match?.[2] ?? '';\n // `*` alone, or `*.com`, would admit most of the web.\n if (match === null || !/^(?:[^*]*\\*)*[^*]*\\.[^*.]+\\.[^*.]+$/.test(host)) {\n throw new Error(\n `--allow-origin ${entry}: a wildcard needs the shape ` +\n `https://*.example.com, with at least two literal labels after it`\n );\n }\n const [, scheme, , port] = match;\n const hostSource = host\n .split('*')\n .map((part) => part.replace(/[.\\\\+?^$()[\\]{}|-]/g, '\\\\$&'))\n .join('[a-z0-9-]+(?:\\\\.[a-z0-9-]+)*');\n const portSource = port === undefined ? '' : `:${port}`;\n return new RegExp(`^${scheme}://${hostSource}${portSource}$`, 'i');\n};\n\n/**\n * `allowedOrigins` for `createDevServer`, from the `--allow-origin` values:\n * `undefined` for none, the entries as given when all are exact, or a registry\n * that also matches the wildcard ones. Throws on a malformed wildcard entry.\n */\nexport const resolveAllowedOrigins = (\n entries: readonly string[]\n): readonly string[] | WsOriginRegistry | undefined => {\n if (entries.length === 0) return undefined;\n const exact = entries\n .filter((entry) => !entry.includes('*'))\n .map((entry) => entry.replace(/\\/$/, ''));\n const patterns = entries\n .filter((entry) => entry.includes('*'))\n .map(compilePattern);\n if (patterns.length === 0) return exact;\n return {\n // No viewer registers itself through this list, so the token guards\n // nothing; it is random only so it is never a guessable constant.\n token: crypto.randomUUID(),\n registerFromUrl: () => undefined,\n isAllowed: (origin) =>\n isAllowedOrigin(origin, exact) ||\n (origin !== undefined && patterns.some((re) => re.test(origin))),\n };\n};\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The framework-neutral Lit devframe: RPC functions, shared state, and the
|
|
3
|
+
* timeline stream. Talks to the page runtime only through the injected
|
|
4
|
+
* {@link TimelineSource} port, so it runs unchanged under `createDevServer()`,
|
|
5
|
+
* `createBuild()`, or an MCP server with no Vite in the loop. `vite.ts` wires
|
|
6
|
+
* the real page-runtime bridge and mounts this via `createPluginFromDevframe`.
|
|
7
|
+
*
|
|
8
|
+
* @see plans/devframe-foundation.md
|
|
5
9
|
*/
|
|
6
10
|
import type { DevframeDefinition } from 'devframe';
|
|
7
11
|
import type { FeatureSettings } from '../../types/timeline.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/definition.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAC,kBAAkB,EAAsB,MAAM,UAAU,CAAC;AAWtE,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,yBAAyB,CAAC;AA6CjC,OAAO,EAAmB,KAAK,cAAc,EAAC,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,kFAAkF;IAClF,MAAM,EAAE,cAAc,CAAC;IACvB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACtC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IACvC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAC5C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,wBAAwB,GAChC,kBAAkB,CAqlBpB"}
|
|
@@ -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 framework-neutral Lit devframe: RPC functions, shared state, and the
|
|
8
3
|
* timeline stream. Talks to the page runtime only through the injected
|
|
@@ -117,7 +112,7 @@ export function createLitDevframe(options) {
|
|
|
117
112
|
// Bounded history for the `recent-events` agent query and the panel's
|
|
118
113
|
// `timeline-history` seed. A plain array, not devframe's internal
|
|
119
114
|
// per-stream replay buffer, which devframe marks `@internal` (see
|
|
120
|
-
// plans/
|
|
115
|
+
// plans/devtools-features.md).
|
|
121
116
|
const recentEvents = replay ? [...replay.events] : [];
|
|
122
117
|
// Event ids: `${epoch}-${seq}`. The epoch is the session start, so a
|
|
123
118
|
// restarted dev server can never reissue an id an older snapshot holds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/lib/devframe/definition.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH,OA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I,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 * @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,EACn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,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"]}
|
package/lib/devframe/icon.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"AAcA,sCAAsC;AACtC,eAAO,MAAM,aAAa,QAEvB,CAAC"}
|
package/lib/devframe/icon.js
CHANGED
|
@@ -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.
|
package/lib/devframe/icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/lib/devframe/icon.ts"],"names":[],"mappings":"AAAA
|
|
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
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch-editor.js","sourceRoot":"","sources":["../../src/lib/devframe/launch-editor.ts"],"names":[],"mappings":"
|
|
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"]}
|
package/lib/devframe/paths.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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
|
|
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"}
|