agentfootprint-lens 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +57 -17
  2. package/dist/chunk-3IS4NPTF.js +771 -0
  3. package/dist/chunk-3IS4NPTF.js.map +1 -0
  4. package/dist/chunk-42NOCYBB.js +5877 -0
  5. package/dist/chunk-42NOCYBB.js.map +1 -0
  6. package/dist/chunk-4G7JKVUB.js +747 -0
  7. package/dist/chunk-4G7JKVUB.js.map +1 -0
  8. package/dist/chunk-52UBTWJA.js +342 -0
  9. package/dist/chunk-52UBTWJA.js.map +1 -0
  10. package/dist/chunk-5ABHHNC4.js +747 -0
  11. package/dist/chunk-5ABHHNC4.js.map +1 -0
  12. package/dist/chunk-6IZQK6MO.js +5927 -0
  13. package/dist/chunk-6IZQK6MO.js.map +1 -0
  14. package/dist/chunk-7LGQ4CJB.js +815 -0
  15. package/dist/chunk-7LGQ4CJB.js.map +1 -0
  16. package/dist/chunk-7NWR6EK7.js +5901 -0
  17. package/dist/chunk-7NWR6EK7.js.map +1 -0
  18. package/dist/chunk-A2LPISKV.js +818 -0
  19. package/dist/chunk-A2LPISKV.js.map +1 -0
  20. package/dist/chunk-AC7R3AEG.js +6052 -0
  21. package/dist/chunk-AC7R3AEG.js.map +1 -0
  22. package/dist/chunk-CGYR4ZUH.js +6052 -0
  23. package/dist/chunk-CGYR4ZUH.js.map +1 -0
  24. package/dist/chunk-DXC6C3J5.js +414 -0
  25. package/dist/chunk-DXC6C3J5.js.map +1 -0
  26. package/dist/chunk-F7AWXFOO.js +5821 -0
  27. package/dist/chunk-F7AWXFOO.js.map +1 -0
  28. package/dist/chunk-FJBBSOGT.js +6052 -0
  29. package/dist/chunk-FJBBSOGT.js.map +1 -0
  30. package/dist/chunk-FZ56PONS.js +5881 -0
  31. package/dist/chunk-FZ56PONS.js.map +1 -0
  32. package/dist/chunk-H23IANHO.js +833 -0
  33. package/dist/chunk-H23IANHO.js.map +1 -0
  34. package/dist/chunk-HNYJILUA.js +466 -0
  35. package/dist/chunk-HNYJILUA.js.map +1 -0
  36. package/dist/chunk-IKDU5ALY.js +810 -0
  37. package/dist/chunk-IKDU5ALY.js.map +1 -0
  38. package/dist/chunk-IMOCWE5Y.js +421 -0
  39. package/dist/chunk-IMOCWE5Y.js.map +1 -0
  40. package/dist/chunk-IN7EVN76.js +5881 -0
  41. package/dist/chunk-IN7EVN76.js.map +1 -0
  42. package/dist/chunk-IOEPPCO4.js +698 -0
  43. package/dist/chunk-IOEPPCO4.js.map +1 -0
  44. package/dist/chunk-IRCUFHPL.js +698 -0
  45. package/dist/chunk-IRCUFHPL.js.map +1 -0
  46. package/dist/chunk-KIZQRUG6.js +772 -0
  47. package/dist/chunk-KIZQRUG6.js.map +1 -0
  48. package/dist/chunk-KKAHUUTL.js +426 -0
  49. package/dist/chunk-KKAHUUTL.js.map +1 -0
  50. package/dist/chunk-L2NPXGKK.js +698 -0
  51. package/dist/chunk-L2NPXGKK.js.map +1 -0
  52. package/dist/chunk-LL7N2WNA.js +412 -0
  53. package/dist/chunk-LL7N2WNA.js.map +1 -0
  54. package/dist/chunk-LM25WQLJ.js +743 -0
  55. package/dist/chunk-LM25WQLJ.js.map +1 -0
  56. package/dist/chunk-LZKDSQTR.js +5877 -0
  57. package/dist/chunk-LZKDSQTR.js.map +1 -0
  58. package/dist/chunk-MNHT4PRL.js +466 -0
  59. package/dist/chunk-MNHT4PRL.js.map +1 -0
  60. package/dist/chunk-N6FR3VE6.js +411 -0
  61. package/dist/chunk-N6FR3VE6.js.map +1 -0
  62. package/dist/chunk-NHZROPO4.js +5898 -0
  63. package/dist/chunk-NHZROPO4.js.map +1 -0
  64. package/dist/chunk-ONVYERGO.js +342 -0
  65. package/dist/chunk-ONVYERGO.js.map +1 -0
  66. package/dist/chunk-OPGXU6ZN.js +502 -0
  67. package/dist/chunk-OPGXU6ZN.js.map +1 -0
  68. package/dist/chunk-PCKJZFGF.js +5778 -0
  69. package/dist/chunk-PCKJZFGF.js.map +1 -0
  70. package/dist/chunk-PUQL3NW7.js +5824 -0
  71. package/dist/chunk-PUQL3NW7.js.map +1 -0
  72. package/dist/chunk-Q5TOYT55.js +717 -0
  73. package/dist/chunk-Q5TOYT55.js.map +1 -0
  74. package/dist/chunk-QZO2IPFD.js +5939 -0
  75. package/dist/chunk-QZO2IPFD.js.map +1 -0
  76. package/dist/chunk-RBGOLDI3.js +5881 -0
  77. package/dist/chunk-RBGOLDI3.js.map +1 -0
  78. package/dist/chunk-V76XYGHJ.js +771 -0
  79. package/dist/chunk-V76XYGHJ.js.map +1 -0
  80. package/dist/chunk-VX46NKYD.js +714 -0
  81. package/dist/chunk-VX46NKYD.js.map +1 -0
  82. package/dist/chunk-W5S3ZJNH.js +828 -0
  83. package/dist/chunk-W5S3ZJNH.js.map +1 -0
  84. package/dist/chunk-YVQ3NAHZ.js +421 -0
  85. package/dist/chunk-YVQ3NAHZ.js.map +1 -0
  86. package/dist/chunk-ZHYATTKT.js +394 -0
  87. package/dist/chunk-ZHYATTKT.js.map +1 -0
  88. package/dist/core.cjs +748 -363
  89. package/dist/core.cjs.map +1 -1
  90. package/dist/core.d.cts +593 -213
  91. package/dist/core.d.ts +593 -213
  92. package/dist/core.js +31 -7
  93. package/dist/index.cjs +2788 -5923
  94. package/dist/index.cjs.map +1 -1
  95. package/dist/index.d.cts +449 -7
  96. package/dist/index.d.ts +449 -7
  97. package/dist/index.js +2264 -56
  98. package/dist/index.js.map +1 -1
  99. package/dist/react.cjs +258 -65
  100. package/dist/react.cjs.map +1 -1
  101. package/dist/react.js +5906 -28
  102. package/dist/react.js.map +1 -1
  103. package/dist/v2/core.cjs +495 -0
  104. package/dist/v2/core.cjs.map +1 -0
  105. package/dist/v2/core.d.cts +231 -0
  106. package/dist/v2/core.d.ts +231 -0
  107. package/dist/v2/core.js +13 -0
  108. package/dist/v2/core.js.map +1 -0
  109. package/dist/v2.cjs +836 -0
  110. package/dist/v2.cjs.map +1 -0
  111. package/dist/v2.d.cts +82 -0
  112. package/dist/v2.d.ts +82 -0
  113. package/dist/v2.js +23 -0
  114. package/dist/v2.js.map +1 -0
  115. package/package.json +1 -6
package/README.md CHANGED
@@ -133,30 +133,70 @@ One mental model. The runner does the work; Lens watches.
133
133
 
134
134
  ## Theming
135
135
 
136
- Lens inherits from `footprint-explainable-ui`'s theme system. Two built-in presets, or bring your own:
136
+ **As of v0.13.0 Lens inherits theme tokens from your app via CSS variables.** Set `--fp-*` (the same names `footprint-explainable-ui` uses) on any parent — Lens picks them up automatically. No `theme=` prop needed; no flash of unstyled content on theme switch.
137
+
138
+ ### The token contract — set these on `:root` (or any parent of `<Lens>`)
139
+
140
+ ```css
141
+ :root {
142
+ /* Surfaces */
143
+ --fp-bg-primary: #0f172a;
144
+ --fp-bg-secondary: #1e293b;
145
+ --fp-bg-tertiary: #334155;
146
+
147
+ /* Text */
148
+ --fp-text-primary: #f8fafc;
149
+ --fp-text-secondary: #94a3b8;
150
+ --fp-text-muted: #64748b;
151
+
152
+ /* Border */
153
+ --fp-border: #334155;
154
+
155
+ /* Accent / state */
156
+ --fp-color-primary: #6366f1;
157
+ --fp-color-success: #22c55e;
158
+ --fp-color-error: #ef4444;
159
+ --fp-color-warning: #f59e0b;
160
+ }
161
+ ```
137
162
 
138
- ```tsx
139
- import { coolDark, coolLight } from 'footprint-explainable-ui';
140
- import { Lens } from 'agentfootprint-lens';
163
+ Resolution order per token: **`--lens-X` → `--fp-X` → hardcoded fallback**. So Lens-specific overrides win over shared `--fp-*` design tokens, which win over the built-in defaults.
141
164
 
142
- <Lens for={agent} theme={isDark ? coolDark : coolLight} />
143
- ```
165
+ ### Light / dark theme switching
144
166
 
145
- Pass any `ThemeTokens` object. CSS vars work too handy if your app already flips theme at the `:root` level:
167
+ If your app already toggles theme by mutating CSS variables on `:root`, `body`, or a wrapper, Lens follows automatically with no extra wiring:
146
168
 
147
169
  ```tsx
148
- <Lens
149
- for={agent}
150
- theme={{
151
- colors: {
152
- bgPrimary: 'var(--my-bg)',
153
- textPrimary: 'var(--my-fg)',
154
- // …
155
- },
156
- }}
157
- />
170
+ function App() {
171
+ const [dark, setDark] = useState(true);
172
+ return (
173
+ <div data-theme={dark ? 'dark' : 'light'}>
174
+ {/* your existing :root[data-theme=dark] { --fp-* … } CSS */}
175
+ <Lens for={agent} />
176
+ </div>
177
+ );
178
+ }
158
179
  ```
159
180
 
181
+ ### Lens-only overrides (when you want Lens to look different from the rest of the app)
182
+
183
+ Set `--lens-*` on a parent of `<Lens>` only:
184
+
185
+ ```css
186
+ .my-lens-container {
187
+ --lens-bg-primary: #0a0e1a; /* darker than the app */
188
+ --lens-color-primary: #f59e0b; /* amber accent for Lens chips */
189
+ --lens-edge-decision: #ec4899; /* edge color for decision arrows in the graph */
190
+ --lens-src-skill: #7c3aed; /* skill-injection chip color */
191
+ }
192
+ ```
193
+
194
+ See `src/v2/react/theme/tokens.ts` for the full token list (surfaces / text / border / accent / 4 edge kinds / 7 injection-source chips / typography).
195
+
196
+ ### Programmatic override (legacy `theme=` prop)
197
+
198
+ The old `<Lens theme={tokens} />` API still works for back-compat, but the CSS-variable contract above is the new recommended path — it survives SSR, doesn't reflow on toggle, and themes both Lens and `footprint-explainable-ui` from the same token sheet.
199
+
160
200
  ---
161
201
 
162
202
  ## Responsive