paseo-plugin-genui 0.0.0-stage → 0.1.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 (375) hide show
  1. package/LICENSE +202 -0
  2. package/OVERVIEW.md +21 -0
  3. package/README.md +77 -2
  4. package/assets/fonts/Excalifont-OFL.txt +109 -0
  5. package/assets/fonts/Excalifont-Regular-latin.woff2 +0 -0
  6. package/assets/icon.png +0 -0
  7. package/assets/icon.svg +1 -0
  8. package/assets/screenshot-chat.png +0 -0
  9. package/assets/screenshot-gallery.png +0 -0
  10. package/assets/screenshot-playground.png +0 -0
  11. package/client/components/content.tsx +468 -0
  12. package/client/components/data.tsx +967 -0
  13. package/client/components/dev.tsx +998 -0
  14. package/client/components/diagram.tsx +513 -0
  15. package/client/components/inputs.tsx +994 -0
  16. package/client/components/layout.tsx +239 -0
  17. package/client/components/media.tsx +428 -0
  18. package/client/components/project.tsx +641 -0
  19. package/client/components/widgets.tsx +836 -0
  20. package/client/gallery.tsx +449 -0
  21. package/client/live-ui.tsx +525 -0
  22. package/client/loaders.ts +342 -0
  23. package/client/markdown.tsx +172 -0
  24. package/client/node-renderer.tsx +149 -0
  25. package/client/render.tsx +186 -0
  26. package/client/runtime.ts +103 -0
  27. package/client/settings.tsx +57 -0
  28. package/client/web.ts +186 -0
  29. package/gallery/Acceptance-baseline.ui +1 -0
  30. package/gallery/Acceptance-checklist.ui +14 -0
  31. package/gallery/Acceptance-evidence.ui +9 -0
  32. package/gallery/Acceptance.ui +1 -0
  33. package/gallery/Badge.ui +3 -0
  34. package/gallery/Benchmark-context.ui +8 -0
  35. package/gallery/Benchmark-hyperfine.ui +1 -0
  36. package/gallery/Benchmark-runs-list.ui +9 -0
  37. package/gallery/Benchmark-runs.ui +1 -0
  38. package/gallery/Benchmark-vitest.ui +1 -0
  39. package/gallery/Benchmark.ui +9 -0
  40. package/gallery/Board-bb-tasks.ui +1 -0
  41. package/gallery/Board-gh-issues.ui +1 -0
  42. package/gallery/Board-gh-prs.ui +1 -0
  43. package/gallery/Board.ui +12 -0
  44. package/gallery/Button-destructive.ui +4 -0
  45. package/gallery/Button.ui +5 -0
  46. package/gallery/Calendar.ui +15 -0
  47. package/gallery/CalendarHeatmap-short.ui +11 -0
  48. package/gallery/CalendarHeatmap.ui +4 -0
  49. package/gallery/Callout.ui +4 -0
  50. package/gallery/Card.ui +4 -0
  51. package/gallery/Carousel.ui +8 -0
  52. package/gallery/Changes-paths.ui +1 -0
  53. package/gallery/Changes-uncommitted.ui +1 -0
  54. package/gallery/Changes.ui +1 -0
  55. package/gallery/Chart-area.ui +3 -0
  56. package/gallery/Chart-funnel.ui +3 -0
  57. package/gallery/Chart-heatmap.ui +11 -0
  58. package/gallery/Chart-pie.ui +3 -0
  59. package/gallery/Chart-radar.ui +3 -0
  60. package/gallery/Chart-scatter.ui +4 -0
  61. package/gallery/Chart-stacked.ui +5 -0
  62. package/gallery/Chart.ui +3 -0
  63. package/gallery/Checklist.ui +6 -0
  64. package/gallery/Choice.ui +8 -0
  65. package/gallery/Code.ui +3 -0
  66. package/gallery/Commits-limit.ui +1 -0
  67. package/gallery/Commits.ui +1 -0
  68. package/gallery/Compare-conditions.ui +4 -0
  69. package/gallery/Compare-three.ui +7 -0
  70. package/gallery/Compare.ui +4 -0
  71. package/gallery/Coverage-go.ui +1 -0
  72. package/gallery/Coverage-lcov.ui +1 -0
  73. package/gallery/Coverage-python.ui +1 -0
  74. package/gallery/Coverage.ui +1 -0
  75. package/gallery/DateInput.ui +5 -0
  76. package/gallery/Decision-percent.ui +10 -0
  77. package/gallery/Decision.ui +12 -0
  78. package/gallery/Dependencies-audit.ui +1 -0
  79. package/gallery/Dependencies-both.ui +1 -0
  80. package/gallery/Dependencies-list.ui +7 -0
  81. package/gallery/Dependencies-pip.ui +1 -0
  82. package/gallery/Dependencies-pnpm.ui +1 -0
  83. package/gallery/Dependencies.ui +1 -0
  84. package/gallery/Details.ui +4 -0
  85. package/gallery/Diagram-flow.ui +16 -0
  86. package/gallery/Diagram-sequence.ui +15 -0
  87. package/gallery/Diagram.ui +16 -0
  88. package/gallery/Diff.ui +3 -0
  89. package/gallery/Divider.ui +5 -0
  90. package/gallery/EditableTable.ui +9 -0
  91. package/gallery/Entity-list.ui +6 -0
  92. package/gallery/Entity.ui +8 -0
  93. package/gallery/Environments.ui +1 -0
  94. package/gallery/Estimate-points.ui +6 -0
  95. package/gallery/Estimate.ui +8 -0
  96. package/gallery/File.ui +4 -0
  97. package/gallery/Findings-biome.ui +1 -0
  98. package/gallery/Findings-eslint.ui +1 -0
  99. package/gallery/Findings-oxlint.ui +1 -0
  100. package/gallery/Findings-review.ui +1 -0
  101. package/gallery/Findings-ruff.ui +1 -0
  102. package/gallery/Findings-sarif.ui +1 -0
  103. package/gallery/Findings-ship.ui +11 -0
  104. package/gallery/Findings-tsc.ui +1 -0
  105. package/gallery/Findings.ui +7 -0
  106. package/gallery/Flashcards.ui +3 -0
  107. package/gallery/FollowUps.ui +4 -0
  108. package/gallery/Form.ui +8 -0
  109. package/gallery/Gallery-links.ui +8 -0
  110. package/gallery/Gallery-strip.ui +14 -0
  111. package/gallery/Gallery.ui +10 -0
  112. package/gallery/Gauge.ui +7 -0
  113. package/gallery/Grid.ui +8 -0
  114. package/gallery/Hotspots-photo.ui +8 -0
  115. package/gallery/Hotspots.ui +11 -0
  116. package/gallery/Icon.ui +5 -0
  117. package/gallery/Image.ui +4 -0
  118. package/gallery/ImageSearch-aspects.ui +6 -0
  119. package/gallery/ImageSearch.ui +4 -0
  120. package/gallery/Input.ui +5 -0
  121. package/gallery/Json-api.ui +1 -0
  122. package/gallery/Json.ui +8 -0
  123. package/gallery/KeyValue.ui +3 -0
  124. package/gallery/List-dots.ui +8 -0
  125. package/gallery/List.ui +8 -0
  126. package/gallery/ListEditor.ui +5 -0
  127. package/gallery/Logs-jsonl.ui +1 -0
  128. package/gallery/Logs-lines.ui +11 -0
  129. package/gallery/Logs-python.ui +1 -0
  130. package/gallery/Logs.ui +1 -0
  131. package/gallery/Map-city.ui +8 -0
  132. package/gallery/Map.ui +8 -0
  133. package/gallery/Metric.ui +3 -0
  134. package/gallery/OptionCards-multi.ui +10 -0
  135. package/gallery/OptionCards.ui +10 -0
  136. package/gallery/Pipeline-checks.ui +1 -0
  137. package/gallery/Pipeline-passed.ui +1 -0
  138. package/gallery/Pipeline-running.ui +1 -0
  139. package/gallery/Pipeline-stages.ui +13 -0
  140. package/gallery/Pipeline.ui +1 -0
  141. package/gallery/Plan.ui +9 -0
  142. package/gallery/Progress.ui +4 -0
  143. package/gallery/Provenance-deploy.ui +6 -0
  144. package/gallery/Provenance-no-receipt.ui +1 -0
  145. package/gallery/Provenance.ui +1 -0
  146. package/gallery/PullRequest.ui +1 -0
  147. package/gallery/Quiz.ui +6 -0
  148. package/gallery/Radio.ui +5 -0
  149. package/gallery/Rating.ui +5 -0
  150. package/gallery/Roadmap-sprint.ui +8 -0
  151. package/gallery/Roadmap-year.ui +9 -0
  152. package/gallery/Roadmap.ui +12 -0
  153. package/gallery/Row.ui +3 -0
  154. package/gallery/SegmentedBar-status.ui +8 -0
  155. package/gallery/SegmentedBar.ui +8 -0
  156. package/gallery/Select.ui +5 -0
  157. package/gallery/Slider.ui +7 -0
  158. package/gallery/Snippet.ui +3 -0
  159. package/gallery/Sources-chips.ui +4 -0
  160. package/gallery/Sources.ui +8 -0
  161. package/gallery/Sparkline.ui +6 -0
  162. package/gallery/Stack.ui +7 -0
  163. package/gallery/StackTrace-aggregate.ui +1 -0
  164. package/gallery/StackTrace-browser.ui +1 -0
  165. package/gallery/StackTrace-go.ui +1 -0
  166. package/gallery/StackTrace-java.ui +1 -0
  167. package/gallery/StackTrace-python.ui +1 -0
  168. package/gallery/StackTrace-rust.ui +1 -0
  169. package/gallery/StackTrace.ui +1 -0
  170. package/gallery/Status.ui +9 -0
  171. package/gallery/Stepper.ui +5 -0
  172. package/gallery/Steps.ui +8 -0
  173. package/gallery/Swatches-long-names.ui +4 -0
  174. package/gallery/Swatches-picker.ui +5 -0
  175. package/gallery/Swatches.ui +10 -0
  176. package/gallery/Table.ui +7 -0
  177. package/gallery/Tabs.ui +8 -0
  178. package/gallery/Tests-junit.ui +1 -0
  179. package/gallery/Tests-vitest-junit.ui +1 -0
  180. package/gallery/Tests-vitest.ui +1 -0
  181. package/gallery/Tests.ui +9 -0
  182. package/gallery/Text.ui +4 -0
  183. package/gallery/TextArea.ui +5 -0
  184. package/gallery/Threads-ids.ui +1 -0
  185. package/gallery/Threads.ui +1 -0
  186. package/gallery/Timeline.ui +8 -0
  187. package/gallery/Timer.ui +4 -0
  188. package/gallery/Toggle.ui +5 -0
  189. package/gallery/Transcript-text.ui +1 -0
  190. package/gallery/Transcript-untimed.ui +1 -0
  191. package/gallery/Transcript-whisper.ui +1 -0
  192. package/gallery/Transcript.ui +1 -0
  193. package/gallery/Tree.ui +3 -0
  194. package/gallery/Treemap-du.ui +1 -0
  195. package/gallery/Treemap-esbuild.ui +1 -0
  196. package/gallery/Treemap-tree.ui +7 -0
  197. package/gallery/Treemap.ui +18 -0
  198. package/gallery/Walkthrough.ui +9 -0
  199. package/gallery/Waterfall-har.ui +1 -0
  200. package/gallery/Waterfall-trace.ui +1 -0
  201. package/gallery/Waterfall.ui +11 -0
  202. package/gallery/data/acceptance/coil/viewport-lifecycle.json +25 -0
  203. package/gallery/data/acceptance/coil-gate.json +153 -0
  204. package/gallery/data/acceptance/orbit-baseline.json +163 -0
  205. package/gallery/data/acceptance/shots/gate-cell-opened.png +0 -0
  206. package/gallery/data/acceptance/shots/gate-light.png +0 -0
  207. package/gallery/data/acceptance/shots/gate-phone-dark.png +0 -0
  208. package/gallery/data/activity.json +1 -0
  209. package/gallery/data/bb-tasks-orb.json +420 -0
  210. package/gallery/data/biome.json +229 -0
  211. package/gallery/data/compare/status-after.png +0 -0
  212. package/gallery/data/compare/status-before.png +0 -0
  213. package/gallery/data/compare/status-dark-2x.png +0 -0
  214. package/gallery/data/compare/status-rerender.png +0 -0
  215. package/gallery/data/coverage-py.json +1 -0
  216. package/gallery/data/coverage-summary.json +1 -0
  217. package/gallery/data/coverage.out +23 -0
  218. package/gallery/data/deploys.json +1 -0
  219. package/gallery/data/device-runs.json +285 -0
  220. package/gallery/data/du-node-modules.txt +359 -0
  221. package/gallery/data/esbuild-meta.json +292 -0
  222. package/gallery/data/eslint.json +266 -0
  223. package/gallery/data/eslint.sarif +343 -0
  224. package/gallery/data/findings-review.json +76 -0
  225. package/gallery/data/gh-issues-nextjs.json +293 -0
  226. package/gallery/data/gh-pr-checks.json +272 -0
  227. package/gallery/data/gh-prs-nextjs.json +419 -0
  228. package/gallery/data/gh-run-failed.json +1 -0
  229. package/gallery/data/gh-run-passed.json +1 -0
  230. package/gallery/data/gh-run-running.json +1 -0
  231. package/gallery/data/github-release.json +57 -0
  232. package/gallery/data/hyperfine-startup.json +187 -0
  233. package/gallery/data/lcov.info +234 -0
  234. package/gallery/data/logs/media-sync.log +127 -0
  235. package/gallery/data/logs/thumbnailer.jsonl +17 -0
  236. package/gallery/data/logs/vitest-run.log +89 -0
  237. package/gallery/data/npm-audit.json +672 -0
  238. package/gallery/data/npm-outdated.json +179 -0
  239. package/gallery/data/oxlint.json +156 -0
  240. package/gallery/data/pip-outdated.json +68 -0
  241. package/gallery/data/pnpm-outdated.json +58 -0
  242. package/gallery/data/provenance/devicectl-install.json +35 -0
  243. package/gallery/data/provenance/install-timeout.log +4 -0
  244. package/gallery/data/provenance/iphone-install.json +72 -0
  245. package/gallery/data/provenance/iphone-no-receipt.json +57 -0
  246. package/gallery/data/provenance/live-home.jpg +0 -0
  247. package/gallery/data/provenance/live-probe.txt +10 -0
  248. package/gallery/data/provenance/xcodebuild-2811.log +19 -0
  249. package/gallery/data/provenance/xcodebuild-4712.log +19 -0
  250. package/gallery/data/pytest-junit.xml +64 -0
  251. package/gallery/data/python-org-trace.json +35 -0
  252. package/gallery/data/python-org.har +31 -0
  253. package/gallery/data/retry.ts +13 -0
  254. package/gallery/data/ruff.json +261 -0
  255. package/gallery/data/src/durations.py +63 -0
  256. package/gallery/data/src/json-logic.ts +156 -0
  257. package/gallery/data/src/mapMath.ts +135 -0
  258. package/gallery/data/src/semver/bump.go +73 -0
  259. package/gallery/data/traces/browser-error.json +5 -0
  260. package/gallery/data/traces/go/main.go +27 -0
  261. package/gallery/data/traces/go-panic.txt +16 -0
  262. package/gallery/data/traces/java-caused-by.txt +15 -0
  263. package/gallery/data/traces/node-aggregate.txt +30 -0
  264. package/gallery/data/traces/node-cause.txt +21 -0
  265. package/gallery/data/traces/py/deploy.json +5 -0
  266. package/gallery/data/traces/py/deploy.py +17 -0
  267. package/gallery/data/traces/py/settings.py +19 -0
  268. package/gallery/data/traces/python-chain.txt +30 -0
  269. package/gallery/data/traces/rust/main.rs +11 -0
  270. package/gallery/data/traces/rust-panic.txt +16 -0
  271. package/gallery/data/traces/shop/cart.mjs +19 -0
  272. package/gallery/data/traces/shop/pricing.mjs +12 -0
  273. package/gallery/data/traces/shop/status.mjs +9 -0
  274. package/gallery/data/traces/web/app.js +11 -0
  275. package/gallery/data/traces/web/index.html +1 -0
  276. package/gallery/data/traces/web/search.js +10 -0
  277. package/gallery/data/transcript/call-noisy.wav +0 -0
  278. package/gallery/data/transcript/call.json +362 -0
  279. package/gallery/data/transcript/call.wav +0 -0
  280. package/gallery/data/transcript/mlx-whisper-tiny.en-noisy.json +1 -0
  281. package/gallery/data/transcript/whisper-cpp-base.en-noisy.json +658 -0
  282. package/gallery/data/transcript/whisper-cpp-base.en.json +658 -0
  283. package/gallery/data/transcript/whisper-cpp-base.en.srt +16 -0
  284. package/gallery/data/transcript/whisper-cpp-tiny.en-noisy.json +619 -0
  285. package/gallery/data/tsc.txt +4 -0
  286. package/gallery/data/vitest-bench.json +119 -0
  287. package/gallery/data/vitest-junit.xml +133 -0
  288. package/gallery/data/vitest-report.json +612 -0
  289. package/gallery/images/bell.svg +10 -0
  290. package/gallery/images/bike.svg +47 -0
  291. package/gallery/images/footer-planet.webp +0 -0
  292. package/gallery/images/front-light.svg +13 -0
  293. package/gallery/images/golden-hour.webp +0 -0
  294. package/gallery/images/option-flowers.webp +0 -0
  295. package/gallery/images/option-hilltop.webp +0 -0
  296. package/gallery/images/option-meadow.webp +0 -0
  297. package/gallery/images/option-sky.webp +0 -0
  298. package/gallery/images/u-lock.svg +10 -0
  299. package/index.client.tsx +164 -0
  300. package/index.server.ts +216 -0
  301. package/package.json +50 -4
  302. package/paseo-plugin.json +14 -0
  303. package/server/data-source.ts +407 -0
  304. package/server/project.ts +981 -0
  305. package/server/web/address.ts +57 -0
  306. package/server/web/cache.ts +85 -0
  307. package/server/web/commons.ts +126 -0
  308. package/server/web/geocode.ts +40 -0
  309. package/server/web/image.ts +35 -0
  310. package/server/web/lookups.ts +248 -0
  311. package/server/web/net.ts +210 -0
  312. package/shared/core/acceptance.ts +744 -0
  313. package/shared/core/ast.ts +76 -0
  314. package/shared/core/benchmark.ts +743 -0
  315. package/shared/core/catalog.ts +733 -0
  316. package/shared/core/compare.ts +225 -0
  317. package/shared/core/coverage.ts +456 -0
  318. package/shared/core/data.ts +334 -0
  319. package/shared/core/decisions.ts +527 -0
  320. package/shared/core/dependencies.ts +604 -0
  321. package/shared/core/diagnostics.ts +24 -0
  322. package/shared/core/environments.ts +212 -0
  323. package/shared/core/evaluate.ts +737 -0
  324. package/shared/core/fields.ts +66 -0
  325. package/shared/core/findings.ts +1172 -0
  326. package/shared/core/form.ts +69 -0
  327. package/shared/core/index.ts +44 -0
  328. package/shared/core/junit.ts +252 -0
  329. package/shared/core/lexer.ts +275 -0
  330. package/shared/core/logs.ts +496 -0
  331. package/shared/core/markdown.ts +2374 -0
  332. package/shared/core/parser.ts +355 -0
  333. package/shared/core/perf-units.ts +228 -0
  334. package/shared/core/pipeline.ts +679 -0
  335. package/shared/core/project.ts +472 -0
  336. package/shared/core/provenance.ts +725 -0
  337. package/shared/core/stack-trace.ts +718 -0
  338. package/shared/core/streaming.ts +136 -0
  339. package/shared/core/test-results.ts +562 -0
  340. package/shared/core/thread-activity.ts +203 -0
  341. package/shared/core/tracking.ts +887 -0
  342. package/shared/core/transcript.ts +1364 -0
  343. package/shared/core/treemap.ts +446 -0
  344. package/shared/core/types.ts +70 -0
  345. package/shared/core/validate.ts +574 -0
  346. package/shared/core/waterfall.ts +536 -0
  347. package/shared/diagram/flowchart.ts +205 -0
  348. package/shared/diagram/layout.ts +440 -0
  349. package/shared/diagram/markdown.ts +135 -0
  350. package/shared/diagram/sequence.ts +122 -0
  351. package/shared/diagram/zoom.ts +114 -0
  352. package/shared/fallback.ts +120 -0
  353. package/shared/genui.test.ts +122 -0
  354. package/shared/instructions.ts +144 -0
  355. package/shared/logic/calendarMath.ts +130 -0
  356. package/shared/logic/chartMath.ts +289 -0
  357. package/shared/logic/choose-logic.ts +196 -0
  358. package/shared/logic/compare-logic.ts +270 -0
  359. package/shared/logic/content-model.ts +227 -0
  360. package/shared/logic/environments-logic.ts +53 -0
  361. package/shared/logic/explain-logic.ts +315 -0
  362. package/shared/logic/fieldLogic.ts +138 -0
  363. package/shared/logic/gallery-search.ts +71 -0
  364. package/shared/logic/icons.ts +322 -0
  365. package/shared/logic/json-logic.ts +153 -0
  366. package/shared/logic/mapMath.ts +133 -0
  367. package/shared/logic/project-logic.ts +39 -0
  368. package/shared/logic/references-model.ts +201 -0
  369. package/shared/logic/sketch.ts +165 -0
  370. package/shared/logic/supersession.ts +77 -0
  371. package/shared/logic/values.ts +133 -0
  372. package/shared/logic/widget-logic.ts +163 -0
  373. package/shared/rpc.ts +252 -0
  374. package/shared/segment.ts +81 -0
  375. package/shared/settings.ts +12 -0
@@ -0,0 +1,733 @@
1
+ // The component catalog: the only components, actions and functions a UI
2
+ // spec may use. The validator checks specs against it, the renderer draws it,
3
+ // and the agent instructions are generated from it, so all three stay in
4
+ // lockstep.
5
+
6
+ export type ParamKind =
7
+ /** Any scalar; numbers and booleans are converted with String(). */
8
+ | "string"
9
+ /** Markdown text. */
10
+ | "text"
11
+ | "number"
12
+ | "boolean"
13
+ /** One of `values`. */
14
+ | "enum"
15
+ /** Children: a node, string, number, null/false (dropped), or a nested list of those. Normalized to UiNode[]. */
16
+ | "nodes"
17
+ /** Any list. */
18
+ | "list"
19
+ /** `number[]`, or an object of series name → `number[]`. */
20
+ | "series"
21
+ /** A `$state` reference (two-way binding). Must be written literally as `$name`. */
22
+ | "binding"
23
+ /** An action call or a list of action calls. Normalized to Action[]. */
24
+ | "actions"
25
+ /** Any value. */
26
+ | "any";
27
+
28
+ /** What a bound `$state` must hold. `null` always fits: it means "empty". */
29
+ export type StateKind = "text" | "number" | "boolean" | "scalar" | "list";
30
+
31
+ export interface ParamSpec {
32
+ readonly name: string;
33
+ readonly kind: ParamKind;
34
+ /** Optional params may be omitted or passed as `null`. */
35
+ readonly optional?: boolean;
36
+ /** Required param that may also be `null`. */
37
+ readonly nullable?: boolean;
38
+ /** Allowed literals for `enum`. */
39
+ readonly values?: readonly string[];
40
+ /** For `binding`: the state's required type, checked at compile and evaluation time. */
41
+ readonly holds?: StateKind;
42
+ }
43
+
44
+ export interface ComponentSpec {
45
+ readonly params: readonly ParamSpec[];
46
+ /** Guidance for the agent instructions, only where the signature alone would mislead. */
47
+ readonly summary?: string;
48
+ }
49
+
50
+ /** Instruction-prompt grouping; one line per group. */
51
+ export type ComponentGroup = "Layout" | "Content" | "Media" | "Data" | "Inputs" | "Widgets" | "Project" | "Dev" | "Manage" | "Evidence";
52
+
53
+ export interface CatalogComponentSpec extends ComponentSpec {
54
+ readonly group: ComponentGroup;
55
+ }
56
+
57
+ const TONES = ["neutral", "good", "warn", "bad", "info"] as const;
58
+
59
+ const tone = { name: "tone", kind: "enum", optional: true, values: TONES } as const;
60
+ const label = { name: "label", kind: "string", optional: true } as const;
61
+ const children = { name: "children", kind: "nodes" } as const;
62
+
63
+ export const COMPONENTS = {
64
+ Card: {
65
+ group: "Layout",
66
+ params: [{ name: "title", kind: "string", nullable: true }, children],
67
+ },
68
+ Row: {
69
+ group: "Layout",
70
+ params: [children],
71
+ summary: "equal-width, wraps",
72
+ },
73
+ Stack: {
74
+ group: "Layout",
75
+ params: [children],
76
+ },
77
+ Grid: {
78
+ group: "Layout",
79
+ params: [children, { name: "columns", kind: "number", optional: true }],
80
+ summary: "tiles",
81
+ },
82
+ Tabs: {
83
+ group: "Layout",
84
+ params: [{ name: "labels", kind: "list" }, children],
85
+ },
86
+ Details: {
87
+ group: "Layout",
88
+ params: [{ name: "title", kind: "string" }, children, { name: "open", kind: "boolean", optional: true }],
89
+ summary: "collapsible",
90
+ },
91
+ Divider: {
92
+ group: "Layout",
93
+ params: [],
94
+ },
95
+ Text: {
96
+ group: "Content",
97
+ params: [{ name: "text", kind: "text" }, tone],
98
+ summary: "markdown",
99
+ },
100
+ Callout: {
101
+ group: "Content",
102
+ params: [{ name: "text", kind: "text" }, tone, { name: "title", kind: "string", optional: true }],
103
+ },
104
+ Metric: {
105
+ group: "Content",
106
+ params: [
107
+ { name: "label", kind: "string" },
108
+ { name: "value", kind: "string" },
109
+ { name: "note", kind: "string", optional: true },
110
+ tone,
111
+ ],
112
+ summary: "key number; 2-4 in a Row",
113
+ },
114
+ Badge: {
115
+ group: "Content",
116
+ params: [{ name: "text", kind: "string" }, tone],
117
+ summary: "1-3 word status; explain in the next cell",
118
+ },
119
+ Icon: {
120
+ group: "Content",
121
+ params: [{ name: "name", kind: "string" }, tone],
122
+ summary: "lucide name",
123
+ },
124
+ KeyValue: {
125
+ group: "Content",
126
+ params: [{ name: "pairs", kind: "any" }],
127
+ summary: "object or [[k, v]]",
128
+ },
129
+ Image: {
130
+ group: "Content",
131
+ params: [{ name: "src", kind: "string" }, { name: "alt", kind: "string", optional: true }],
132
+ summary: "path or https URL; the only way the user sees an image (they never see images your tools open)",
133
+ },
134
+ File: {
135
+ group: "Content",
136
+ params: [
137
+ { name: "path", kind: "string" },
138
+ { name: "line", kind: "number", optional: true },
139
+ ],
140
+ },
141
+ Table: {
142
+ group: "Data",
143
+ params: [
144
+ { name: "columns", kind: "list" },
145
+ { name: "rows", kind: "list" },
146
+ ],
147
+ summary: "rows: lists of values or components",
148
+ },
149
+ Chart: {
150
+ group: "Data",
151
+ params: [
152
+ { name: "type", kind: "enum", values: ["bar", "line", "area", "pie", "scatter", "radar", "funnel", "heatmap"] },
153
+ { name: "labels", kind: "list" },
154
+ { name: "series", kind: "series" },
155
+ { name: "unit", kind: "string", optional: true },
156
+ { name: "stacked", kind: "boolean", optional: true },
157
+ ],
158
+ summary: "series: numbers or {name: numbers | {values, tone}}; scatter: labels are the x values; heatmap: one series per row",
159
+ },
160
+ Sparkline: {
161
+ group: "Data",
162
+ params: [{ name: "values", kind: "list" }, tone],
163
+ },
164
+ Progress: {
165
+ group: "Data",
166
+ params: [
167
+ { name: "value", kind: "number" },
168
+ { name: "max", kind: "number", optional: true },
169
+ label,
170
+ tone,
171
+ ],
172
+ summary: "% without max",
173
+ },
174
+ Steps: {
175
+ group: "Data",
176
+ params: [{ name: "items", kind: "list" }],
177
+ summary: "{title,detail?,status?:done|current|blocked}",
178
+ },
179
+ Timeline: {
180
+ group: "Data",
181
+ params: [{ name: "items", kind: "list" }],
182
+ summary: "{time,title,detail?,tone?}",
183
+ },
184
+ Tree: {
185
+ group: "Data",
186
+ params: [{ name: "items", kind: "list" }],
187
+ summary: "paths or {label,children?,note?}",
188
+ },
189
+ Code: {
190
+ group: "Data",
191
+ params: [
192
+ { name: "code", kind: "string" },
193
+ { name: "language", kind: "string", optional: true },
194
+ ],
195
+ },
196
+ Snippet: {
197
+ group: "Data",
198
+ params: [
199
+ { name: "path", kind: "string" },
200
+ { name: "from", kind: "number", optional: true },
201
+ { name: "to", kind: "number", optional: true },
202
+ ],
203
+ summary: "lines of a file, 1-based",
204
+ },
205
+ Diff: {
206
+ group: "Data",
207
+ params: [{ name: "patch", kind: "string" }],
208
+ summary: "unified, one file",
209
+ },
210
+ Diagram: {
211
+ group: "Data",
212
+ params: [
213
+ { name: "mermaid", kind: "string" },
214
+ { name: "details", kind: "any", optional: true },
215
+ ],
216
+ summary: "details {nodeId: text or components} open when that node is clicked",
217
+ },
218
+ Slider: {
219
+ group: "Inputs",
220
+ params: [
221
+ { name: "value", kind: "binding", holds: "number" },
222
+ { name: "min", kind: "number" },
223
+ { name: "max", kind: "number" },
224
+ { name: "step", kind: "number", optional: true },
225
+ label,
226
+ ],
227
+ },
228
+ Stepper: {
229
+ group: "Inputs",
230
+ params: [
231
+ { name: "value", kind: "binding", holds: "number" },
232
+ { name: "min", kind: "number", optional: true },
233
+ { name: "max", kind: "number", optional: true },
234
+ { name: "step", kind: "number", optional: true },
235
+ label,
236
+ ],
237
+ summary: "counts",
238
+ },
239
+ Toggle: {
240
+ group: "Inputs",
241
+ params: [
242
+ { name: "value", kind: "binding", holds: "boolean" },
243
+ { name: "label", kind: "string" },
244
+ ],
245
+ },
246
+ Choice: {
247
+ group: "Inputs",
248
+ params: [{ name: "value", kind: "binding", holds: "scalar" }, { name: "options", kind: "list" }, label],
249
+ summary: "short options",
250
+ },
251
+ Radio: {
252
+ group: "Inputs",
253
+ params: [{ name: "value", kind: "binding", holds: "scalar" }, { name: "options", kind: "list" }, label],
254
+ summary: "{value,detail} options",
255
+ },
256
+ Select: {
257
+ group: "Inputs",
258
+ params: [{ name: "value", kind: "binding", holds: "scalar" }, { name: "options", kind: "list" }, label],
259
+ summary: "many options",
260
+ },
261
+ Checklist: {
262
+ group: "Inputs",
263
+ params: [{ name: "value", kind: "binding", holds: "list" }, { name: "options", kind: "list" }, label],
264
+ summary: "multi-select, state []",
265
+ },
266
+ ListEditor: {
267
+ group: "Inputs",
268
+ params: [
269
+ { name: "value", kind: "binding", holds: "list" },
270
+ label,
271
+ { name: "placeholder", kind: "string", optional: true },
272
+ ],
273
+ summary: "editable list of strings",
274
+ },
275
+ Input: {
276
+ group: "Inputs",
277
+ params: [
278
+ { name: "value", kind: "binding", holds: "text" },
279
+ label,
280
+ { name: "placeholder", kind: "string", optional: true },
281
+ ],
282
+ },
283
+ TextArea: {
284
+ group: "Inputs",
285
+ params: [
286
+ { name: "value", kind: "binding", holds: "text" },
287
+ label,
288
+ { name: "placeholder", kind: "string", optional: true },
289
+ ],
290
+ },
291
+ DateInput: {
292
+ group: "Inputs",
293
+ params: [{ name: "value", kind: "binding", holds: "text" }, label],
294
+ summary: "yyyy-mm-dd",
295
+ },
296
+ Rating: {
297
+ group: "Inputs",
298
+ params: [
299
+ { name: "value", kind: "binding", holds: "number" },
300
+ { name: "max", kind: "number", optional: true },
301
+ label,
302
+ ],
303
+ },
304
+ Button: {
305
+ group: "Inputs",
306
+ params: [
307
+ { name: "label", kind: "string" },
308
+ { name: "action", kind: "actions", optional: true },
309
+ {
310
+ name: "variant",
311
+ kind: "enum",
312
+ optional: true,
313
+ values: ["primary", "secondary", "destructive"],
314
+ },
315
+ { name: "icon", kind: "string", optional: true },
316
+ ],
317
+ summary:
318
+ "no action sends its label as the user's reply; primary for the one main action, destructive for deleting or discarding; icon: lucide name",
319
+ },
320
+ Form: {
321
+ group: "Inputs",
322
+ params: [children, { name: "submit", kind: "string", optional: true }],
323
+ summary: "one labeled field per question; submit sends every answer in one message",
324
+ },
325
+ Timer: {
326
+ group: "Widgets",
327
+ params: [{ name: "seconds", kind: "number", optional: true }, label],
328
+ summary: "no seconds = stopwatch",
329
+ },
330
+ Quiz: {
331
+ group: "Widgets",
332
+ params: [{ name: "questions", kind: "list" }],
333
+ summary: "{q,options,answer:index,why?}",
334
+ },
335
+ Flashcards: {
336
+ group: "Widgets",
337
+ params: [{ name: "cards", kind: "list" }],
338
+ summary: "{front,back}",
339
+ },
340
+ // Added from ChatGPT's catalog (see README "Components").
341
+ ImageSearch: {
342
+ group: "Media",
343
+ params: [
344
+ { name: "query", kind: "string" },
345
+ { name: "alt", kind: "string", optional: true },
346
+ { name: "aspect", kind: "enum", optional: true, values: ["wide", "square", "tall"] },
347
+ ],
348
+ summary: "a photo found on the web from a description, credited; for things no file shows; aspect wide by default",
349
+ },
350
+ Gallery: {
351
+ group: "Media",
352
+ params: [
353
+ { name: "images", kind: "list" },
354
+ { name: "columns", kind: "number", optional: true },
355
+ ],
356
+ summary: "paths, https URLs or {src|query, caption?}",
357
+ },
358
+ Map: {
359
+ group: "Media",
360
+ params: [
361
+ { name: "places", kind: "list" },
362
+ { name: "route", kind: "boolean", optional: true },
363
+ ],
364
+ summary: "{name, lat?, lng?, note?}; names without lat/lng are looked up; route joins them in order",
365
+ },
366
+ Hotspots: {
367
+ group: "Media",
368
+ params: [
369
+ { name: "image", kind: "string" },
370
+ { name: "points", kind: "list" },
371
+ ],
372
+ summary: "numbered pins on an image: {x, y (% across, down), title, text?}",
373
+ },
374
+ Entity: {
375
+ group: "Content",
376
+ params: [
377
+ { name: "name", kind: "string" },
378
+ { name: "kind", kind: "enum", optional: true, values: ["product", "place", "person", "org", "link", "other"] },
379
+ { name: "image", kind: "string", optional: true },
380
+ { name: "facts", kind: "any", optional: true },
381
+ { name: "url", kind: "string", optional: true },
382
+ { name: "note", kind: "text", optional: true },
383
+ ],
384
+ summary: "a product, place or person card; facts {label: value} open in its detail view",
385
+ },
386
+ Sources: {
387
+ group: "Content",
388
+ params: [{ name: "links", kind: "list" }],
389
+ summary: "https URLs or {url, title?, note?}",
390
+ },
391
+ List: {
392
+ group: "Content",
393
+ params: [{ name: "items", kind: "list" }],
394
+ summary: "rows {title, detail?, icon?, value?, tone?, action?}",
395
+ },
396
+ Calendar: {
397
+ group: "Data",
398
+ params: [
399
+ { name: "events", kind: "list" },
400
+ { name: "month", kind: "string", optional: true },
401
+ ],
402
+ summary: "{date: yyyy-mm-dd, title, tone?} on a month grid; month yyyy-mm",
403
+ },
404
+ Gauge: {
405
+ group: "Data",
406
+ params: [
407
+ { name: "value", kind: "number" },
408
+ { name: "min", kind: "number", optional: true },
409
+ { name: "max", kind: "number", optional: true },
410
+ label,
411
+ tone,
412
+ ],
413
+ summary: "a dial; max defaults to 100",
414
+ },
415
+ CalendarHeatmap: {
416
+ group: "Data",
417
+ params: [{ name: "days", kind: "any" }, label, tone],
418
+ summary: "{yyyy-mm-dd: count} or [{date, value}]",
419
+ },
420
+ SegmentedBar: {
421
+ group: "Data",
422
+ params: [
423
+ { name: "parts", kind: "list" },
424
+ { name: "unit", kind: "string", optional: true },
425
+ ],
426
+ summary: "shares of one whole: {label, value, tone?}",
427
+ },
428
+ Carousel: {
429
+ group: "Layout",
430
+ params: [children],
431
+ summary: "a swipeable row of cards",
432
+ },
433
+ OptionCards: {
434
+ group: "Inputs",
435
+ params: [{ name: "value", kind: "binding" }, { name: "options", kind: "list" }, label],
436
+ summary: "picture or detail options {value, title?, detail?, image?, icon?}; a list state picks several",
437
+ },
438
+ Swatches: {
439
+ group: "Inputs",
440
+ params: [
441
+ { name: "colors", kind: "list" },
442
+ { name: "value", kind: "binding", holds: "text", optional: true },
443
+ label,
444
+ ],
445
+ summary: "CSS colors or {value, name?}; with a $state the user picks one",
446
+ },
447
+ EditableTable: {
448
+ group: "Inputs",
449
+ params: [{ name: "value", kind: "binding", holds: "list" }, { name: "columns", kind: "list" }, label],
450
+ summary: "state: list of row objects; columns: keys or {key, label?, type?: text|number|boolean}, type inferred if omitted",
451
+ },
452
+ FollowUps: {
453
+ group: "Inputs",
454
+ params: [{ name: "prompts", kind: "list" }],
455
+ summary: "suggested next questions; a tap sends one",
456
+ },
457
+ Walkthrough: {
458
+ group: "Widgets",
459
+ params: [{ name: "steps", kind: "list" }],
460
+ summary: "{title, body, code?, language?} revealed one step at a time",
461
+ },
462
+ // Project: the first four read BB's own state for the reply's thread, so the
463
+ // model writes no data at all; Tests and Json take Load() of a report.
464
+ Changes: {
465
+ group: "Project",
466
+ params: [
467
+ { name: "target", kind: "string", optional: true },
468
+ { name: "paths", kind: "list", optional: true },
469
+ ],
470
+ summary:
471
+ 'files changed in this thread\'s checkout with +/- and diffs; target: omit for the branch\'s work incl. uncommitted, "uncommitted", or a commit sha; paths filters',
472
+ },
473
+ Commits: {
474
+ group: "Project",
475
+ params: [{ name: "limit", kind: "number", optional: true }],
476
+ summary: "this branch's commits since the default branch, each opening its changes",
477
+ },
478
+ PullRequest: {
479
+ group: "Project",
480
+ params: [],
481
+ summary: "this branch's pull request: state, checks, review",
482
+ },
483
+ Threads: {
484
+ group: "Project",
485
+ params: [{ name: "ids", kind: "list", optional: true }],
486
+ summary: "live status of BB threads; omit ids for this thread's subthreads",
487
+ },
488
+ Tests: {
489
+ group: "Project",
490
+ params: [{ name: "results", kind: "any" }, { name: "title", kind: "string", optional: true }],
491
+ summary: "Load a vitest/jest JSON or JUnit XML report, or [{name, status: passed|failed|skipped, message?, file?, line?}]",
492
+ },
493
+ Json: {
494
+ group: "Project",
495
+ params: [{ name: "value", kind: "any" }, label],
496
+ summary: "collapsible JSON explorer; Load() a big file instead of retyping it",
497
+ },
498
+ // Dev: what tools print, read from the file the agent saved (Load), never
499
+ // retyped: logs, errors, findings, CI runs, coverage, dependencies, timings.
500
+ Logs: {
501
+ group: "Dev",
502
+ params: [
503
+ { name: "output", kind: "any" },
504
+ { name: "command", kind: "string", optional: true },
505
+ { name: "exit", kind: "number", optional: true },
506
+ ],
507
+ summary: "Load a log or command output; exit: its exit code",
508
+ },
509
+ StackTrace: {
510
+ group: "Dev",
511
+ params: [{ name: "trace", kind: "any" }, { name: "title", kind: "string", optional: true }],
512
+ summary: "an error and its stack, any language",
513
+ },
514
+ Findings: {
515
+ group: "Dev",
516
+ params: [{ name: "items", kind: "any" }, { name: "title", kind: "string", optional: true }],
517
+ summary: "review/lint/type errors [{severity, title, file?, line?, detail?, fix?, status?: open|fixed|confirmed|rejected}] or Load ESLint JSON, SARIF, tsc output",
518
+ },
519
+ Coverage: {
520
+ group: "Dev",
521
+ params: [{ name: "report", kind: "any" }],
522
+ summary: "Load coverage-summary.json, lcov.info, coverage.py JSON or Go coverage.out",
523
+ },
524
+ Dependencies: {
525
+ group: "Dev",
526
+ params: [{ name: "report", kind: "any" }],
527
+ summary: "Load npm outdated/audit --json or pip list --outdated --format=json; or [{name, current, latest}]",
528
+ },
529
+ Pipeline: {
530
+ group: "Dev",
531
+ params: [{ name: "run", kind: "any" }],
532
+ summary: "a CI run: Load gh run view --json jobs, or [{name, status, jobs?}]",
533
+ },
534
+ Benchmark: {
535
+ group: "Dev",
536
+ params: [{ name: "results", kind: "any" }, { name: "unit", kind: "string", optional: true }],
537
+ summary: "before/after [{name, before, after, better?: lower|higher, context?}], every run [{name, metrics, status?, context?}] or Load hyperfine JSON",
538
+ },
539
+ Waterfall: {
540
+ group: "Dev",
541
+ params: [{ name: "spans", kind: "any" }, { name: "unit", kind: "string", optional: true }],
542
+ summary: "timings [{name, start, duration, depth?}] or Load a .har",
543
+ },
544
+ Treemap: {
545
+ group: "Dev",
546
+ params: [{ name: "items", kind: "any" }, { name: "unit", kind: "string", optional: true }],
547
+ summary: "sizes [{path, size}] or Load an esbuild metafile",
548
+ },
549
+ // Manage: planning and tracking, plus BB's own environments.
550
+ Board: {
551
+ group: "Manage",
552
+ params: [{ name: "items", kind: "any" }, { name: "columns", kind: "list", optional: true }],
553
+ summary: "kanban: [{title, status, …}] or Load bb tasks list --json, gh issue list --json",
554
+ },
555
+ Roadmap: {
556
+ group: "Manage",
557
+ params: [{ name: "items", kind: "list" }],
558
+ summary: "Gantt [{title, start, end, lane?, status?, milestone?}], dates yyyy-mm-dd",
559
+ },
560
+ Status: {
561
+ group: "Manage",
562
+ params: [{ name: "items", kind: "list" }],
563
+ summary: "health [{name, status: on-track|at-risk|off-track|done, progress?, owner?, due?, note?}]",
564
+ },
565
+ Plan: {
566
+ group: "Manage",
567
+ params: [{ name: "steps", kind: "list" }, { name: "submit", kind: "string", optional: true }],
568
+ summary: "steps the user approves before you start [{title, detail?, files?, risk?, estimate?}]",
569
+ },
570
+ Decision: {
571
+ group: "Manage",
572
+ params: [
573
+ { name: "options", kind: "list" },
574
+ { name: "criteria", kind: "list" },
575
+ ],
576
+ summary: "options [{name, scores: 1-5 per criterion, pros?, cons?}] vs criteria; user tunes weights",
577
+ },
578
+ Estimate: {
579
+ group: "Manage",
580
+ params: [{ name: "tasks", kind: "list" }, { name: "unit", kind: "string", optional: true }],
581
+ summary: "three-point effort [{title, low, high, likely?}]: P50/P90 total",
582
+ },
583
+ Environments: {
584
+ group: "Manage",
585
+ params: [],
586
+ summary: "this project's worktrees: branch, threads, changes, PR",
587
+ },
588
+ // Evidence: what is actually proven, running, or heard, as opposed to what
589
+ // an agent says. Grounded in the user's own BB history (acceptance claims
590
+ // without proof, visual parity disputes, wrong installed builds, speech).
591
+ Acceptance: {
592
+ group: "Evidence",
593
+ params: [{ name: "criteria", kind: "any" }, { name: "columns", kind: "list", optional: true }],
594
+ summary:
595
+ "is it really done (criteria, a review verdict, claimed vs checked): [{name, status | cells: {column: status | {status, note?, evidence?}}}]; passed|failed|blocked|untested|claimed",
596
+ },
597
+ Compare: {
598
+ group: "Evidence",
599
+ params: [{ name: "images", kind: "list" }],
600
+ summary: "a visual difference vs a reference or before/after: [src | {src, label?}], reference first; wipe, blink, pixel diff",
601
+ },
602
+ Transcript: {
603
+ group: "Evidence",
604
+ params: [{ name: "tracks", kind: "any" }, { name: "audio", kind: "string", optional: true }],
605
+ summary:
606
+ "transcription or speaker errors: [{name, words: [{text, start, end, speaker?}]} | {name, text}], the first is the reference; WER; a word seeks the audio",
607
+ },
608
+ Provenance: {
609
+ group: "Evidence",
610
+ params: [{ name: "stages", kind: "list" }, { name: "expected", kind: "any", optional: true }],
611
+ summary:
612
+ "which build/revision is really installed or deployed where: [{name, status, facts?: {branch, sha, build, device}}], source to live; expected flags mismatches",
613
+ },
614
+ } as const satisfies Record<string, CatalogComponentSpec>;
615
+
616
+ export type ComponentName = keyof typeof COMPONENTS;
617
+
618
+ /** `Name(a, b?, $state, kind:x|y?)`: how the reference and the gallery write a component's or action's call. */
619
+ export function callSignature(name: string, spec: ComponentSpec): string {
620
+ const params = spec.params.map((param) => {
621
+ let base = param.kind === "binding" ? `$${param.name}` : param.name;
622
+ // Tones are listed once in the reference header; other enums inline their values.
623
+ if (param.kind === "enum" && param.name !== "tone") {
624
+ base += `:${param.values?.join("|")}`;
625
+ }
626
+ return param.optional ? `${base}?` : base;
627
+ });
628
+ return `${name}(${params.join(", ")})`;
629
+ }
630
+
631
+ /** `Sig: summary`, as the reference lists a component. */
632
+ export function componentSignature(name: ComponentName): string {
633
+ const spec: ComponentSpec = COMPONENTS[name];
634
+ const sig = callSignature(name, spec);
635
+ return spec.summary === undefined ? sig : `${sig}: ${spec.summary}`;
636
+ }
637
+
638
+ export const ACTIONS = {
639
+ Send: {
640
+ params: [{ name: "text", kind: "string" }],
641
+ summary: "send text as the user's next message",
642
+ },
643
+ Set: {
644
+ params: [
645
+ { name: "state", kind: "binding" },
646
+ { name: "value", kind: "any" },
647
+ ],
648
+ summary: "assign a state variable",
649
+ },
650
+ OpenUrl: {
651
+ params: [{ name: "url", kind: "string" }],
652
+ summary: "open an http(s) URL",
653
+ },
654
+ Copy: {
655
+ params: [{ name: "text", kind: "string" }],
656
+ summary: "copy text to the clipboard",
657
+ },
658
+ } as const satisfies Record<string, ComponentSpec>;
659
+
660
+ export type ActionName = keyof typeof ACTIONS;
661
+
662
+ /** Global pure functions. */
663
+ export const FUNCTIONS = {
664
+ round: "round(x, digits?)",
665
+ fmt: "fmt(x, digits?) → grouped string, e.g. 1,234.5",
666
+ sum: "sum(list)",
667
+ min: "min(list | ...numbers)",
668
+ max: "max(list | ...numbers)",
669
+ abs: "abs(x)",
670
+ floor: "floor(x)",
671
+ ceil: "ceil(x)",
672
+ sqrt: "sqrt(x)",
673
+ pow: "pow(x, y)",
674
+ keys: "keys(object) → list of keys",
675
+ values: "values(object) → list of values",
676
+ entries: "entries(object) → list of [key, value]",
677
+ Load: "Load(path): JSON/CSV/TSV/JSONL/text file, workspace-relative or in thread storage",
678
+ } as const;
679
+
680
+ export type FunctionName = keyof typeof FUNCTIONS;
681
+
682
+ /** Whitelisted methods by receiver type. Anything else is an error. */
683
+ export const METHODS = {
684
+ list: [
685
+ "map",
686
+ "filter",
687
+ "find",
688
+ "some",
689
+ "every",
690
+ "join",
691
+ "slice",
692
+ "includes",
693
+ "indexOf",
694
+ ],
695
+ string: [
696
+ "includes",
697
+ "slice",
698
+ "split",
699
+ "trim",
700
+ "toUpperCase",
701
+ "toLowerCase",
702
+ "startsWith",
703
+ "endsWith",
704
+ ],
705
+ number: ["toFixed"],
706
+ } as const;
707
+
708
+ /** Read-only properties allowed on lists and strings (plain objects allow any own key). */
709
+ export const PROPERTIES = { list: ["length"], string: ["length"] } as const;
710
+
711
+ /** Property names that are always rejected, on every receiver. */
712
+ export const FORBIDDEN_PROPERTIES = [
713
+ "__proto__",
714
+ "prototype",
715
+ "constructor",
716
+ ] as const;
717
+
718
+ /** Resource limits enforced by compile/evaluate. */
719
+ export const LIMITS = {
720
+ sourceChars: 20_000,
721
+ /** Interpreter steps per evaluate() call. */
722
+ steps: 200_000,
723
+ /** UiNodes produced per evaluate() call. */
724
+ nodes: 2_000,
725
+ /** Elements in any list produced or iterated. */
726
+ listLength: 1_000,
727
+ /**
728
+ * Elements in any list of a loaded file. Reports (SARIF results, Ruff, a HAR)
729
+ * pass 1,000 often and go to a component whole; iterating one in the spec
730
+ * (`.map`, `.filter`, …) is still capped at listLength.
731
+ */
732
+ loadedListLength: 20_000,
733
+ } as const;