@vibecook/ice 0.11.0 → 0.15.0-desk.1

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 (389) hide show
  1. package/README.md +79 -50
  2. package/dist/chunk-AMMFQP2C.js +2444 -0
  3. package/dist/chunk-AMMFQP2C.js.map +1 -0
  4. package/dist/chunk-BKV4ZEU3.js +1 -0
  5. package/dist/chunk-BKV4ZEU3.js.map +1 -0
  6. package/dist/chunk-ENIFIUEP.js +155 -0
  7. package/dist/chunk-ENIFIUEP.js.map +1 -0
  8. package/dist/chunk-H3SKYJLK.js +8269 -0
  9. package/dist/chunk-H3SKYJLK.js.map +1 -0
  10. package/dist/{chunk-OR5FNVUE.js → chunk-JS6PG6YD.js} +398 -167
  11. package/dist/chunk-JS6PG6YD.js.map +1 -0
  12. package/dist/{chunk-VGVDJZSP.js → chunk-PFJN3XN2.js} +13232 -7388
  13. package/dist/chunk-PFJN3XN2.js.map +1 -0
  14. package/dist/chunk-QXOCF56A.js +148 -0
  15. package/dist/chunk-QXOCF56A.js.map +1 -0
  16. package/dist/chunk-U4YMA4TJ.js +635 -0
  17. package/dist/chunk-U4YMA4TJ.js.map +1 -0
  18. package/dist/desk-engine.js +36 -0
  19. package/dist/desk-engine.js.map +1 -0
  20. package/dist/desk-kit.js +244 -0
  21. package/dist/desk-kit.js.map +1 -0
  22. package/dist/desk-objects.js +12734 -0
  23. package/dist/desk-objects.js.map +1 -0
  24. package/dist/desk.js +497 -0
  25. package/dist/desk.js.map +1 -0
  26. package/dist/devtools.js +233 -189
  27. package/dist/devtools.js.map +1 -1
  28. package/dist/dom.js +7 -19
  29. package/dist/index.js +232 -20
  30. package/dist/kernel.js +53 -25
  31. package/dist/react.js +1047 -38
  32. package/dist/react.js.map +1 -1
  33. package/dist/types/packages/core/src/behavior/define-behavior.d.ts +11 -0
  34. package/dist/types/packages/core/src/behavior/runtime.d.ts +4 -0
  35. package/dist/types/packages/core/src/canvas/define-canvas-type.d.ts +86 -0
  36. package/dist/types/packages/core/src/canvas/define-container.d.ts +17 -0
  37. package/dist/types/packages/core/src/canvas/diagnostics.d.ts +27 -0
  38. package/dist/types/packages/core/src/canvas/engine-catalog.d.ts +70 -0
  39. package/dist/types/packages/core/src/canvas/extensions.d.ts +125 -0
  40. package/dist/types/packages/core/src/canvas/frame-behavior-host.d.ts +16 -0
  41. package/dist/types/packages/core/src/canvas/frame-preview.d.ts +79 -0
  42. package/dist/types/packages/core/src/canvas/frame-projection.d.ts +38 -0
  43. package/dist/types/packages/core/src/canvas/frame-view.d.ts +36 -0
  44. package/dist/types/packages/core/src/canvas/migrate.d.ts +14 -0
  45. package/dist/types/packages/core/src/canvas/placement.d.ts +30 -0
  46. package/dist/types/packages/core/src/canvas/presentation-transition.d.ts +100 -0
  47. package/dist/types/packages/core/src/canvas/runtime-extension-host.d.ts +16 -0
  48. package/dist/types/packages/core/src/canvas/session.d.ts +47 -0
  49. package/dist/types/packages/core/src/catalog/camera-derived.d.ts +16 -27
  50. package/dist/types/packages/core/src/catalog/desk.d.ts +326 -0
  51. package/dist/types/packages/core/src/catalog/gesture.d.ts +51 -0
  52. package/dist/types/packages/core/src/catalog/graph.d.ts +2 -2
  53. package/dist/types/packages/core/src/catalog/index.d.ts +2 -0
  54. package/dist/types/packages/core/src/catalog/pointer.d.ts +42 -0
  55. package/dist/types/packages/core/src/catalog/selection-presence.d.ts +7 -0
  56. package/dist/types/packages/core/src/catalog/settings-resources.d.ts +28 -2
  57. package/dist/types/packages/core/src/catalog/surface.d.ts +1 -0
  58. package/dist/types/packages/core/src/doc/doc-commit-sink.d.ts +18 -2
  59. package/dist/types/packages/core/src/doc/doc-kit.d.ts +21 -2
  60. package/dist/types/packages/core/src/doc/envelope.d.ts +5 -2
  61. package/dist/types/packages/core/src/doc/schema-migrate.d.ts +1 -1
  62. package/dist/types/packages/core/src/doc/version-gate.d.ts +21 -3
  63. package/dist/types/packages/core/src/engine/commit-sink.d.ts +10 -1
  64. package/dist/types/packages/core/src/engine/engine.d.ts +6 -0
  65. package/dist/types/packages/core/src/engine/frame-control.d.ts +74 -0
  66. package/dist/types/packages/core/src/engine/guests.d.ts +4 -1
  67. package/dist/types/packages/core/src/engine/world-doors.d.ts +12 -0
  68. package/dist/types/packages/core/src/facade/create-canvas-engine.d.ts +146 -13
  69. package/dist/types/packages/core/src/index.d.ts +33 -12
  70. package/dist/types/packages/core/src/input/queue.d.ts +3 -1
  71. package/dist/types/packages/core/src/interaction/install.d.ts +36 -0
  72. package/dist/types/packages/core/src/interaction/wakes.d.ts +24 -0
  73. package/dist/types/packages/core/src/nav/nav-geometry.d.ts +100 -0
  74. package/dist/types/packages/core/src/nav/nested-canvas.d.ts +47 -4
  75. package/dist/types/packages/core/src/ops/cascade.d.ts +2 -1
  76. package/dist/types/packages/core/src/ops/claims.d.ts +6 -0
  77. package/dist/types/packages/core/src/ops/insert.d.ts +4 -0
  78. package/dist/types/packages/core/src/ops/point-pick.d.ts +4 -1
  79. package/dist/types/packages/core/src/ops/sibling-order.d.ts +14 -4
  80. package/dist/types/packages/core/src/ops/tray.d.ts +48 -0
  81. package/dist/types/packages/core/src/presence/presence-kit.d.ts +5 -0
  82. package/dist/types/packages/core/src/schema/meta.d.ts +10 -0
  83. package/dist/types/packages/core/src/schema/prefab.d.ts +8 -0
  84. package/dist/types/packages/core/src/settings/defaults.d.ts +25 -6
  85. package/dist/types/packages/core/src/surface/gpu-device.d.ts +55 -0
  86. package/dist/types/packages/core/src/systems/camera-sim.d.ts +29 -0
  87. package/dist/types/packages/core/src/systems/chrome.d.ts +15 -23
  88. package/dist/types/packages/core/src/systems/drag-mods.d.ts +34 -0
  89. package/dist/types/packages/core/src/systems/held.d.ts +73 -0
  90. package/dist/types/packages/core/src/systems/insert-ghost.d.ts +2 -0
  91. package/dist/types/packages/core/src/systems/l0-input.d.ts +14 -0
  92. package/dist/types/packages/core/src/systems/l1-pick.d.ts +53 -1
  93. package/dist/types/packages/core/src/systems/l2-arbitrate.d.ts +18 -4
  94. package/dist/types/packages/core/src/systems/l2-recognize.d.ts +3 -1
  95. package/dist/types/packages/core/src/systems/l3-behave.d.ts +4 -1
  96. package/dist/types/packages/core/src/systems/l3-claim.d.ts +7 -0
  97. package/dist/types/packages/core/src/systems/l3-connect.d.ts +1 -1
  98. package/dist/types/packages/core/src/systems/l3-drop.d.ts +30 -1
  99. package/dist/types/packages/core/src/systems/l3-marquee.d.ts +2 -1
  100. package/dist/types/packages/core/src/systems/l3-ports.d.ts +1 -1
  101. package/dist/types/packages/core/src/systems/l4-cursor.d.ts +5 -0
  102. package/dist/types/packages/core/src/systems/nav-flight.d.ts +85 -3
  103. package/dist/types/packages/core/src/systems/nav-tap.d.ts +44 -0
  104. package/dist/types/packages/core/src/systems/press-button.d.ts +25 -0
  105. package/dist/types/packages/core/src/systems/press-wheel.d.ts +11 -0
  106. package/dist/types/packages/core/src/systems/tray.d.ts +111 -0
  107. package/dist/types/packages/core/src/systems/zoom-through.d.ts +30 -0
  108. package/dist/types/packages/core/src/tools/define-tool.d.ts +10 -0
  109. package/dist/types/packages/core/src/widget/define-widget.d.ts +166 -63
  110. package/dist/types/packages/core/src/widget/equip.d.ts +14 -2
  111. package/dist/types/packages/core/src/widget/held-tools.d.ts +83 -0
  112. package/dist/types/packages/core/src/widget/menu-actions.d.ts +44 -0
  113. package/dist/types/packages/core/src/widget/mount-store.d.ts +21 -46
  114. package/dist/types/packages/core/src/widget/spawn.d.ts +1 -1
  115. package/dist/types/packages/desk/src/assets/blue-noise.gen.d.ts +10 -0
  116. package/dist/types/packages/desk/src/card/card.d.ts +103 -0
  117. package/dist/types/packages/desk/src/compose/ambient.d.ts +59 -0
  118. package/dist/types/packages/desk/src/compose/builder.d.ts +306 -0
  119. package/dist/types/packages/desk/src/compose/children.d.ts +3 -0
  120. package/dist/types/packages/desk/src/compose/index.d.ts +14 -0
  121. package/dist/types/packages/desk/src/compose/marks.d.ts +133 -0
  122. package/dist/types/packages/desk/src/compose/pick.d.ts +5 -0
  123. package/dist/types/packages/desk/src/compose/reflector.d.ts +120 -0
  124. package/dist/types/packages/desk/src/compose/tap.d.ts +5 -0
  125. package/dist/types/packages/desk/src/docs.d.ts +23 -0
  126. package/dist/types/packages/desk/src/engine/budget.d.ts +43 -0
  127. package/dist/types/packages/desk/src/engine/device.d.ts +54 -0
  128. package/dist/types/packages/desk/src/engine/index.d.ts +5 -0
  129. package/dist/types/packages/desk/src/engine/pipeline.d.ts +36 -0
  130. package/dist/types/packages/desk/src/engine/rasters.d.ts +66 -0
  131. package/dist/types/packages/desk/src/engine/records.d.ts +56 -0
  132. package/dist/types/packages/desk/src/engine/shader.d.ts +22 -0
  133. package/dist/types/packages/desk/src/engine/struct.d.ts +39 -0
  134. package/dist/types/packages/desk/src/engine/target.d.ts +26 -0
  135. package/dist/types/packages/desk/src/faults.d.ts +38 -0
  136. package/dist/types/packages/desk/src/gpu-ablation.d.ts +61 -0
  137. package/dist/types/packages/desk/src/gpu-memory.d.ts +54 -0
  138. package/dist/types/packages/desk/src/gpu-profiler.d.ts +141 -0
  139. package/dist/types/packages/desk/src/gpu-wrap.d.ts +8 -0
  140. package/dist/types/packages/desk/src/ground.d.ts +537 -0
  141. package/dist/types/packages/desk/src/hold/focus.d.ts +53 -0
  142. package/dist/types/packages/desk/src/hold/pose.d.ts +152 -0
  143. package/dist/types/packages/desk/src/hold/shaders.d.ts +9 -0
  144. package/dist/types/packages/desk/src/host/editor.d.ts +18 -0
  145. package/dist/types/packages/desk/src/host/index.d.ts +9 -0
  146. package/dist/types/packages/desk/src/host/ink.d.ts +18 -0
  147. package/dist/types/packages/desk/src/host/layer.d.ts +536 -0
  148. package/dist/types/packages/desk/src/host/picture.d.ts +2 -0
  149. package/dist/types/packages/desk/src/host/surface.d.ts +5 -0
  150. package/dist/types/packages/desk/src/index.d.ts +16 -0
  151. package/dist/types/packages/desk/src/kind.d.ts +189 -0
  152. package/dist/types/packages/desk/src/kinds/world.d.ts +447 -0
  153. package/dist/types/packages/desk/src/kit/arrays.d.ts +88 -0
  154. package/dist/types/packages/desk/src/kit/blobs.d.ts +40 -0
  155. package/dist/types/packages/desk/src/kit/book.d.ts +2 -0
  156. package/dist/types/packages/desk/src/kit/editor.d.ts +105 -0
  157. package/dist/types/packages/desk/src/kit/eye.d.ts +37 -0
  158. package/dist/types/packages/desk/src/kit/hold.d.ts +1 -0
  159. package/dist/types/packages/desk/src/kit/index.d.ts +26 -0
  160. package/dist/types/packages/desk/src/kit/inside.d.ts +116 -0
  161. package/dist/types/packages/desk/src/kit/layer.d.ts +159 -0
  162. package/dist/types/packages/desk/src/kit/light.d.ts +3 -0
  163. package/dist/types/packages/desk/src/kit/mesh.d.ts +29 -0
  164. package/dist/types/packages/desk/src/kit/mips.d.ts +2 -0
  165. package/dist/types/packages/desk/src/kit/nav.d.ts +2 -0
  166. package/dist/types/packages/desk/src/kit/paper-tex.d.ts +5 -0
  167. package/dist/types/packages/desk/src/kit/physics.d.ts +44 -0
  168. package/dist/types/packages/desk/src/kit/place.d.ts +44 -0
  169. package/dist/types/packages/desk/src/kit/print.d.ts +30 -0
  170. package/dist/types/packages/desk/src/kit/raster.d.ts +34 -0
  171. package/dist/types/packages/desk/src/kit/sdf.d.ts +1 -0
  172. package/dist/types/packages/desk/src/kit/seeds.d.ts +11 -0
  173. package/dist/types/packages/desk/src/kit/services.d.ts +34 -0
  174. package/dist/types/packages/desk/src/kit/springs.d.ts +12 -0
  175. package/dist/types/packages/desk/src/kit/strokes.d.ts +93 -0
  176. package/dist/types/packages/desk/src/kit/text.d.ts +142 -0
  177. package/dist/types/packages/desk/src/kit/uniform.d.ts +8 -0
  178. package/dist/types/packages/desk/src/kit/view.d.ts +39 -0
  179. package/dist/types/packages/desk/src/kit/wgsl.d.ts +15 -0
  180. package/dist/types/packages/desk/src/lattice/line.d.ts +15 -0
  181. package/dist/types/packages/desk/src/lattice/lod.d.ts +52 -0
  182. package/dist/types/packages/desk/src/lattice/ruler.d.ts +88 -0
  183. package/dist/types/packages/desk/src/marks/assemble.d.ts +65 -0
  184. package/dist/types/packages/desk/src/marks/ease.d.ts +4 -0
  185. package/dist/types/packages/desk/src/marks/laser.d.ts +41 -0
  186. package/dist/types/packages/desk/src/marks/layout.d.ts +167 -0
  187. package/dist/types/packages/desk/src/marks/pass.d.ts +59 -0
  188. package/dist/types/packages/desk/src/marks/shaders.d.ts +12 -0
  189. package/dist/types/packages/desk/src/mat/grid.d.ts +50 -0
  190. package/dist/types/packages/desk/src/mat/lamp.d.ts +14 -0
  191. package/dist/types/packages/desk/src/mat/layout.d.ts +144 -0
  192. package/dist/types/packages/desk/src/mat/mat-pass.d.ts +83 -0
  193. package/dist/types/packages/desk/src/mat/night.d.ts +95 -0
  194. package/dist/types/packages/desk/src/mat/projector.d.ts +39 -0
  195. package/dist/types/packages/desk/src/mat/shaders.d.ts +17 -0
  196. package/dist/types/packages/desk/src/mat/tilt.d.ts +14 -0
  197. package/dist/types/packages/desk/src/missing/layout.d.ts +27 -0
  198. package/dist/types/packages/desk/src/missing/object.d.ts +6 -0
  199. package/dist/types/packages/desk/src/missing/pass.d.ts +39 -0
  200. package/dist/types/packages/desk/src/missing/shaders.d.ts +7 -0
  201. package/dist/types/packages/desk/src/missing/slots.d.ts +8 -0
  202. package/dist/types/packages/desk/src/nav/flight.d.ts +186 -0
  203. package/dist/types/packages/desk/src/nav/portal.d.ts +95 -0
  204. package/dist/types/packages/desk/src/object.d.ts +46 -0
  205. package/dist/types/packages/desk/src/pass-instrument.d.ts +89 -0
  206. package/dist/types/packages/desk/src/shaders.d.ts +12 -0
  207. package/dist/types/packages/desk/src/shaders.gen.d.ts +17 -0
  208. package/dist/types/packages/desk/src/submit-instrument.d.ts +36 -0
  209. package/dist/types/packages/desk/src/theme.d.ts +497 -0
  210. package/dist/types/packages/desk/src/tray/carry.d.ts +99 -0
  211. package/dist/types/packages/desk/src/tray/drawer.d.ts +124 -0
  212. package/dist/types/packages/desk/src/tray/flux.d.ts +49 -0
  213. package/dist/types/packages/desk/src/tray/index.d.ts +4 -0
  214. package/dist/types/packages/desk/src/tray/lattice.d.ts +71 -0
  215. package/dist/types/packages/desk/src/tray/layout.d.ts +7 -0
  216. package/dist/types/packages/desk/src/tray/look.d.ts +29 -0
  217. package/dist/types/packages/desk/src/tray/pass.d.ts +101 -0
  218. package/dist/types/packages/desk/src/tray/shaders.d.ts +10 -0
  219. package/dist/types/packages/desk/src/tray/specimens.d.ts +214 -0
  220. package/dist/types/packages/devtools/src/attach.d.ts +22 -8
  221. package/dist/types/packages/devtools/src/dock.d.ts +18 -14
  222. package/dist/types/packages/devtools/src/gpu-panel.d.ts +105 -0
  223. package/dist/types/packages/devtools/src/index.d.ts +5 -4
  224. package/dist/types/packages/dom/src/desk-host.d.ts +104 -0
  225. package/dist/types/packages/dom/src/host.d.ts +13 -14
  226. package/dist/types/packages/dom/src/index.d.ts +12 -10
  227. package/dist/types/packages/dom/src/loop.d.ts +18 -1
  228. package/dist/types/packages/dom/src/pointer-adapter.d.ts +11 -29
  229. package/dist/types/packages/dom/src/widget-focus.d.ts +17 -13
  230. package/dist/types/packages/ice/src/desk-engine.d.ts +2 -0
  231. package/dist/types/packages/ice/src/desk-kit.d.ts +6 -0
  232. package/dist/types/packages/ice/src/desk-objects.d.ts +5 -0
  233. package/dist/types/packages/ice/src/desk.d.ts +5 -0
  234. package/dist/types/packages/kernel/src/atlas-pack.d.ts +157 -0
  235. package/dist/types/packages/kernel/src/bezier.d.ts +0 -15
  236. package/dist/types/packages/kernel/src/coords.d.ts +0 -39
  237. package/dist/types/packages/kernel/src/index.d.ts +2 -2
  238. package/dist/types/packages/kernel/src/nav-flight.d.ts +6 -0
  239. package/dist/types/packages/kernel/src/tray.d.ts +155 -0
  240. package/dist/types/packages/objects/src/board/board-pass.d.ts +180 -0
  241. package/dist/types/packages/objects/src/board/board-pen.d.ts +36 -0
  242. package/dist/types/packages/objects/src/board/board.d.ts +104 -0
  243. package/dist/types/packages/objects/src/board/data.d.ts +31 -0
  244. package/dist/types/packages/objects/src/board/history.d.ts +33 -0
  245. package/dist/types/packages/objects/src/board/kind.d.ts +208 -0
  246. package/dist/types/packages/objects/src/board/layout.d.ts +102 -0
  247. package/dist/types/packages/objects/src/board/object.d.ts +7 -0
  248. package/dist/types/packages/objects/src/board/pen.d.ts +71 -0
  249. package/dist/types/packages/objects/src/board/shaders.d.ts +36 -0
  250. package/dist/types/packages/objects/src/board/stroke.d.ts +99 -0
  251. package/dist/types/packages/objects/src/board/theme.d.ts +150 -0
  252. package/dist/types/packages/objects/src/calendar/data.d.ts +97 -0
  253. package/dist/types/packages/objects/src/calendar/events.d.ts +58 -0
  254. package/dist/types/packages/objects/src/calendar/hand.d.ts +53 -0
  255. package/dist/types/packages/objects/src/calendar/host/input.d.ts +67 -0
  256. package/dist/types/packages/objects/src/calendar/host/print.d.ts +9 -0
  257. package/dist/types/packages/objects/src/calendar/kind.d.ts +297 -0
  258. package/dist/types/packages/objects/src/calendar/law.d.ts +151 -0
  259. package/dist/types/packages/objects/src/calendar/layout.d.ts +47 -0
  260. package/dist/types/packages/objects/src/calendar/month.d.ts +75 -0
  261. package/dist/types/packages/objects/src/calendar/object.d.ts +45 -0
  262. package/dist/types/packages/objects/src/calendar/pad.d.ts +42 -0
  263. package/dist/types/packages/objects/src/calendar/pass.d.ts +229 -0
  264. package/dist/types/packages/objects/src/calendar/print.d.ts +87 -0
  265. package/dist/types/packages/objects/src/calendar/printing.d.ts +80 -0
  266. package/dist/types/packages/objects/src/calendar/roll.d.ts +45 -0
  267. package/dist/types/packages/objects/src/calendar/shaders.d.ts +12 -0
  268. package/dist/types/packages/objects/src/calendar/sheet.d.ts +43 -0
  269. package/dist/types/packages/objects/src/calendar/tiles.d.ts +67 -0
  270. package/dist/types/packages/objects/src/calendar/turn.d.ts +73 -0
  271. package/dist/types/packages/objects/src/calendar/writing.d.ts +42 -0
  272. package/dist/types/packages/objects/src/index.d.ts +22 -0
  273. package/dist/types/packages/objects/src/kinds.d.ts +24 -0
  274. package/dist/types/packages/objects/src/minimat/inside.d.ts +17 -0
  275. package/dist/types/packages/objects/src/minimat/kind.d.ts +51 -0
  276. package/dist/types/packages/objects/src/minimat/layout.d.ts +83 -0
  277. package/dist/types/packages/objects/src/minimat/minimat.d.ts +179 -0
  278. package/dist/types/packages/objects/src/minimat/object.d.ts +8 -0
  279. package/dist/types/packages/objects/src/minimat/pass.d.ts +61 -0
  280. package/dist/types/packages/objects/src/minimat/shaders.d.ts +10 -0
  281. package/dist/types/packages/objects/src/minimat/theme.d.ts +98 -0
  282. package/dist/types/packages/objects/src/notebook/ink.d.ts +70 -0
  283. package/dist/types/packages/objects/src/notebook/kind.d.ts +236 -0
  284. package/dist/types/packages/objects/src/notebook/law.d.ts +129 -0
  285. package/dist/types/packages/objects/src/notebook/layout.d.ts +46 -0
  286. package/dist/types/packages/objects/src/notebook/leaf.d.ts +44 -0
  287. package/dist/types/packages/objects/src/notebook/mesh.d.ts +20 -0
  288. package/dist/types/packages/objects/src/notebook/motion.d.ts +107 -0
  289. package/dist/types/packages/objects/src/notebook/object.d.ts +8 -0
  290. package/dist/types/packages/objects/src/notebook/pages.d.ts +56 -0
  291. package/dist/types/packages/objects/src/notebook/pass.d.ts +197 -0
  292. package/dist/types/packages/objects/src/notebook/pick.d.ts +30 -0
  293. package/dist/types/packages/objects/src/notebook/raster.d.ts +28 -0
  294. package/dist/types/packages/objects/src/notebook/shaders.d.ts +11 -0
  295. package/dist/types/packages/objects/src/notebook/shape.d.ts +155 -0
  296. package/dist/types/packages/objects/src/notebook/theme.d.ts +76 -0
  297. package/dist/types/packages/objects/src/palette.d.ts +577 -0
  298. package/dist/types/packages/objects/src/paper/host/body.d.ts +30 -0
  299. package/dist/types/packages/objects/src/paper/kind.d.ts +81 -0
  300. package/dist/types/packages/objects/src/paper/layout.d.ts +73 -0
  301. package/dist/types/packages/objects/src/paper/object.d.ts +31 -0
  302. package/dist/types/packages/objects/src/paper/pages.d.ts +43 -0
  303. package/dist/types/packages/objects/src/paper/paper-pass.d.ts +86 -0
  304. package/dist/types/packages/objects/src/paper/paper.d.ts +117 -0
  305. package/dist/types/packages/objects/src/paper/shaders.d.ts +18 -0
  306. package/dist/types/packages/objects/src/paper/theme.d.ts +58 -0
  307. package/dist/types/packages/objects/src/paper/typing.d.ts +51 -0
  308. package/dist/types/packages/objects/src/paper/writing.d.ts +161 -0
  309. package/dist/types/packages/objects/src/photo/carry.d.ts +33 -0
  310. package/dist/types/packages/objects/src/photo/kind.d.ts +136 -0
  311. package/dist/types/packages/objects/src/photo/layout.d.ts +39 -0
  312. package/dist/types/packages/objects/src/photo/object.d.ts +5 -0
  313. package/dist/types/packages/objects/src/photo/photo-pass.d.ts +104 -0
  314. package/dist/types/packages/objects/src/photo/photo.d.ts +262 -0
  315. package/dist/types/packages/objects/src/photo/pictures.d.ts +152 -0
  316. package/dist/types/packages/objects/src/photo/sample.d.ts +9 -0
  317. package/dist/types/packages/objects/src/photo/shaders.d.ts +18 -0
  318. package/dist/types/packages/objects/src/preset.d.ts +44 -0
  319. package/dist/types/packages/objects/src/shaders.d.ts +3 -0
  320. package/dist/types/packages/objects/src/shaders.gen.d.ts +21 -0
  321. package/dist/types/packages/react/src/canvas-hooks.d.ts +12 -0
  322. package/dist/types/packages/react/src/desk.d.ts +56 -0
  323. package/dist/types/packages/react/src/engine-context.d.ts +2 -2
  324. package/dist/types/packages/react/src/frame-preview-boundary.d.ts +19 -0
  325. package/dist/types/packages/react/src/hooks.d.ts +9 -14
  326. package/dist/types/packages/react/src/index.d.ts +16 -9
  327. package/dist/types/packages/react/src/keymap.d.ts +21 -2
  328. package/dist/types/packages/react/src/selection-menu.d.ts +174 -0
  329. package/dist/types/packages/react/src/tray-bar.d.ts +124 -0
  330. package/package.json +64 -31
  331. package/dist/chunk-2TNVB2ON.js +0 -1163
  332. package/dist/chunk-2TNVB2ON.js.map +0 -1
  333. package/dist/chunk-OR5FNVUE.js.map +0 -1
  334. package/dist/chunk-Q665T4L7.js +0 -681
  335. package/dist/chunk-Q665T4L7.js.map +0 -1
  336. package/dist/chunk-VGVDJZSP.js.map +0 -1
  337. package/dist/ground.js +0 -1108
  338. package/dist/ground.js.map +0 -1
  339. package/dist/r3f.js +0 -1644
  340. package/dist/r3f.js.map +0 -1
  341. package/dist/types/packages/core/src/input/measure-queue.d.ts +0 -30
  342. package/dist/types/packages/core/src/settings/ground-config.d.ts +0 -101
  343. package/dist/types/packages/core/src/systems/measure-ingest.d.ts +0 -26
  344. package/dist/types/packages/devtools/src/gl-panel.d.ts +0 -69
  345. package/dist/types/packages/dom/src/measure-adapter.d.ts +0 -31
  346. package/dist/types/packages/dom/src/measure-wiring.d.ts +0 -49
  347. package/dist/types/packages/dom/src/planes.d.ts +0 -33
  348. package/dist/types/packages/dom/src/reflectors/chrome.d.ts +0 -33
  349. package/dist/types/packages/dom/src/reflectors/dom-widgets.d.ts +0 -59
  350. package/dist/types/packages/dom/src/reflectors/graybox.d.ts +0 -31
  351. package/dist/types/packages/dom/src/reflectors/plane-transform.d.ts +0 -38
  352. package/dist/types/packages/ground/src/index.d.ts +0 -69
  353. package/dist/types/packages/ground/src/layer.d.ts +0 -40
  354. package/dist/types/packages/ground/src/pass.d.ts +0 -41
  355. package/dist/types/packages/ground/src/passes/grid-contract.d.ts +0 -28
  356. package/dist/types/packages/ground/src/passes/grid-magnet-pass.d.ts +0 -2
  357. package/dist/types/packages/ground/src/passes/grid-magnet.d.ts +0 -31
  358. package/dist/types/packages/ground/src/passes/grid.d.ts +0 -10
  359. package/dist/types/packages/ground/src/passes/guides-collect.d.ts +0 -14
  360. package/dist/types/packages/ground/src/passes/guides.d.ts +0 -3
  361. package/dist/types/packages/ground/src/passes/magnet-collect.d.ts +0 -63
  362. package/dist/types/packages/ground/src/passes/soup-collect.d.ts +0 -35
  363. package/dist/types/packages/ground/src/passes/soup-mesh.d.ts +0 -8
  364. package/dist/types/packages/ground/src/passes/wires-collect.d.ts +0 -35
  365. package/dist/types/packages/ground/src/passes/wires.d.ts +0 -10
  366. package/dist/types/packages/ground/src/poles.d.ts +0 -47
  367. package/dist/types/packages/ground/src/renderer.d.ts +0 -15
  368. package/dist/types/packages/ice/src/ground.d.ts +0 -1
  369. package/dist/types/packages/ice/src/r3f.d.ts +0 -1
  370. package/dist/types/packages/kernel/src/eviction.d.ts +0 -23
  371. package/dist/types/packages/kernel/src/zoom-bands.d.ts +0 -19
  372. package/dist/types/packages/r3f/src/bridge.d.ts +0 -129
  373. package/dist/types/packages/r3f/src/composite-material.d.ts +0 -26
  374. package/dist/types/packages/r3f/src/compositor-pass.d.ts +0 -105
  375. package/dist/types/packages/r3f/src/dev-write-trap.d.ts +0 -30
  376. package/dist/types/packages/r3f/src/gl-root.d.ts +0 -96
  377. package/dist/types/packages/r3f/src/gl-router.d.ts +0 -70
  378. package/dist/types/packages/r3f/src/index.d.ts +0 -17
  379. package/dist/types/packages/r3f/src/island-state.d.ts +0 -112
  380. package/dist/types/packages/r3f/src/island.d.ts +0 -13
  381. package/dist/types/packages/r3f/src/pool.d.ts +0 -56
  382. package/dist/types/packages/r3f/src/preview-capture.d.ts +0 -19
  383. package/dist/types/packages/r3f/src/resource-registry.d.ts +0 -30
  384. package/dist/types/packages/r3f/src/self-sustain.d.ts +0 -39
  385. package/dist/types/packages/r3f/src/use-island-frame.d.ts +0 -39
  386. package/dist/types/packages/react/src/infinite-canvas.d.ts +0 -140
  387. package/dist/types/packages/react/src/preview-snapshots.d.ts +0 -17
  388. package/dist/types/packages/react/src/widget-preview.d.ts +0 -14
  389. package/dist/types/packages/react/src/widget-root.d.ts +0 -33
@@ -0,0 +1,120 @@
1
+ import { type Entity, type ReflectorDef, type World } from "../../../core/src/index";
2
+ import type { KindFaults } from "../faults";
3
+ import type { Ground, GroundFrameInputs, GroundStats } from "../ground";
4
+ import { type KindLocal, type ObjectKind } from "../kinds/world";
5
+ import { type GridConfig } from "../mat/grid";
6
+ import type { GroundTheme, Palette } from "../theme";
7
+ import { type TrayOptions } from "../tray/drawer";
8
+ import { type TrayFlux } from "../tray/flux";
9
+ import { type TrayCarry } from "../tray/carry";
10
+ import { type TrayCarriedFrame, type TraySpecimenFrame } from "../tray/specimens";
11
+ import type { Ambient, AmbientState } from "./ambient";
12
+ import type { DeskBuilder, DeskBuilderStats, DeskWakeReason, HoldPin } from "./builder";
13
+ export interface DeskReflectorOptions {
14
+ readonly world: World;
15
+ readonly builder: DeskBuilder;
16
+ /** The kinds whose `theme()` makes a look — every object kind the ground registers. */
17
+ readonly kinds: readonly ObjectKind[];
18
+ readonly ambient: Ambient;
19
+ /** The ground once `Ground.create` resolved, null before and after the layer ends. */
20
+ readonly ground: () => Ground | null;
21
+ /** The host sizes its canvas to `width × height` DEVICE px (the swap chain follows). */
22
+ readonly attach: {
23
+ resize(width: number, height: number): void;
24
+ };
25
+ readonly theme: GroundTheme;
26
+ /** The host's palette — what each kind's `theme()` reads its look from. */
27
+ readonly palette: Palette;
28
+ /** The root's grid: the lattice's fade-in and the mat's config (its gobo, its rulers). */
29
+ readonly grid?: GridConfig;
30
+ /** The device pixel ratio the canvas is capped at (2). */
31
+ readonly maxDpr?: number;
32
+ readonly name?: string;
33
+ /** Called after every frame drawn — the layer publishes the selection menu's anchor from it (D4a). */
34
+ readonly onFrame?: () => void;
35
+ /** The kinds' own state on this desk (`KindLocal`, by kind name): what the tray's carried objects are drawn with, as the builder's are (K5b). */
36
+ readonly locals?: ReadonlyMap<string, KindLocal>;
37
+ /** The drawer as the host set it (petition I21 — `deskLayer({ tray })`): its foot inset. */
38
+ readonly tray?: TrayOptions;
39
+ /**
40
+ * THE KIND BOUNDARY (petition I24, faults.ts): the tray's specimens and carried copies are recorded through it (a missing kind's are the
41
+ * missing face; a throw is a strike), and a missing kind is never asked for its look again.
42
+ */
43
+ readonly faults?: KindFaults;
44
+ /**
45
+ * Called when a frame is asked for from OUTSIDE the flush — a wake (a pin, an ink landing, the ambient's policy), the ground
46
+ * arriving, a theme, a grid, a harness's pin (K7a): the host wakes a sleeping loop with it.
47
+ */
48
+ readonly onWake?: (reason: string) => void;
49
+ }
50
+ /** What woke a frame, counted since the mount — the builder's reasons and the reflector's own. */
51
+ export type DeskWakes = Readonly<Record<DeskWakeReason | "camera" | "viewport" | "nav" | "theme" | "grid" | "pin" | "ambient" | "live" | "ink" | "tray", number>>;
52
+ export interface DeskReflectorStats extends DeskBuilderStats {
53
+ /** Whole-frame renders so far — the churn instrument (0 on an idle desk). */
54
+ readonly redraws: number;
55
+ /** The ground's stats for the last frame drawn (null before the first). */
56
+ readonly frame: GroundStats | null;
57
+ readonly ambient: AmbientState;
58
+ }
59
+ export interface DeskReflector {
60
+ /** The drawing reflector (`always: true`): register it where the ground layer goes. */
61
+ readonly reflector: ReflectorDef & {
62
+ available(): boolean;
63
+ };
64
+ /** The ground is here (or gone): the next tick paints. */
65
+ ready(): void;
66
+ /** The host's projection changed (a theme switch): the looks are remade, the next frame re-renders. */
67
+ setTheme(theme: GroundTheme, palette?: Palette): void;
68
+ /** The root's grid (the mat's config, the fade-in) as a whole. */
69
+ configureGrid(grid: GridConfig): void;
70
+ /** Wake a frame for a reason the world does not carry (a pin, an asset, the writing's flux — D2c's `ink`). */
71
+ wake(reason: "pin" | "ambient" | "ink"): void;
72
+ /**
73
+ * A harness's pins on the build (D2b): live insides on or off (the oracle's `portals: false`), a pinned root
74
+ * dressing (`lodZoom`), every spring and ghost held where it is (`freeze` — a still of a moving frame), the
75
+ * re-dressing ramp held at its start (`holdRedress`). Each present key is set; the next frame paints.
76
+ */
77
+ pinBuild(pins: {
78
+ readonly portals?: boolean;
79
+ readonly lodZoom?: number | null;
80
+ readonly freeze?: boolean;
81
+ readonly holdRedress?: boolean;
82
+ readonly hold?: HoldPin | null;
83
+ }): void;
84
+ /** The kinds whose own state moved this tick (their `local.tick` wanted a frame): the builder remakes their records this build (D6). */
85
+ restless(kinds: ReadonlySet<string>): void;
86
+ /** The frame dirty and not yet drawn (a rig's witness). */
87
+ dirty(): boolean;
88
+ /**
89
+ * WHEN THE REFLECTOR IS NEXT DUE (K7a — its registered wake): `now` while a frame is owed (dirt, a live spring or ghost, the
90
+ * drawer on its way) or the ambient still moves (the wind's clock is a frame); `Infinity` otherwise — and while it cannot
91
+ * draw (no ground yet, no viewport): the ground's arrival and the viewport's write wake it.
92
+ */
93
+ due(now: number): number;
94
+ redraws(): number;
95
+ stats(): DeskReflectorStats;
96
+ wakes(): DeskWakes;
97
+ /** The inputs of the last render, as handed to `Ground.render`. */
98
+ lastInputs(): GroundFrameInputs | null;
99
+ grid(): GridConfig;
100
+ theme(): GroundTheme;
101
+ /** A kind's look for the theme in force (its `theme()` of the palette) — the held bar's swatches read it (D3t-a). */
102
+ look(kind: string): unknown;
103
+ /** The pegboard drawer's flux (design-017 §3): its motion, the drawer as drawn (the pose seam's answer), the pins for a still. */
104
+ readonly tray: TrayFlux;
105
+ /** The tray's specimens as the last frame drew them (K5a) — a rig's witness; empty while the drawer is shut or bare. */
106
+ traySpecimens(): readonly TraySpecimenFrame[];
107
+ /**
108
+ * Did the last frame's TRAY draw `e` — a specimen, a lifted copy's key, an insert ghost it presented (K5b over K6b)? The frame raster
109
+ * queue's word on what shows is the builder's and this: an ask a specimen's writing made (its word, `tray.local`) is run, not let go.
110
+ */
111
+ trayShows(e: Entity): boolean;
112
+ /** The take's motion (K5b — tray/carry.ts): the lifted copy, the ghost's grow and its flight home. */
113
+ readonly carry: TrayCarry;
114
+ /** What the tray carried in the last frame drawn (K5b) — a rig's witness: each pose's slot, phase, ghost and rect on screen. */
115
+ trayCarried(): readonly TrayCarriedFrame[];
116
+ dispose(): void;
117
+ }
118
+ export declare function createDeskReflector(opts: DeskReflectorOptions): DeskReflector;
119
+ /** Each kind's look for a theme, by kind name — what `ObjectContext.look` carries. */
120
+ export declare function looksOf(kinds: readonly ObjectKind[], palette: Palette, theme: GroundTheme): Map<string, unknown>;
@@ -0,0 +1,5 @@
1
+ import { type Entity, type World } from "../../../core/src/index";
2
+ export declare function tapHit(world: World, pid: string): {
3
+ readonly found: boolean;
4
+ readonly hit: Entity | undefined;
5
+ };
@@ -0,0 +1,23 @@
1
+ import { type CommitExtender, type DocSession } from "../../core/src/index";
2
+ /** The document a driver writes into — the facade's `engine.docs` (its `current()` session: store + live writer + the gate's verdict). */
3
+ export interface TypingDocs {
4
+ current(): Pick<DocSession, "store" | "liveWriter" | "readOnly" | "versionReport"> | undefined;
5
+ /** The facade's door into a gesture's own transaction (`docs.extendCommits`, D7 #2): a landing's writes in the gesture's undo step. Absent (a bare store), a driver has no such door. */
6
+ extendCommits?(extend: CommitExtender): () => void;
7
+ /** The facade's history doors (`docs.undo`/`docs.redo` — historyStep: the tween retarget, the read-only posture; D7 #9). Absent (a bare store), a driver moves no history. */
8
+ undo?(): boolean;
9
+ redo?(): boolean;
10
+ }
11
+ /** What a desk writer holds while it commits: the session's store and live writer. */
12
+ export type WritableSession = Pick<DocSession, "store" | "liveWriter">;
13
+ /**
14
+ * THE WRITER'S GATE (D7 #1): the session a desk gesture may commit into — none without a document, and none when the
15
+ * version gate's verdict is read-only (a doc a newer build wrote, a pack this build does not compile, a root that does not
16
+ * agree). `readOnly` is the verdict at open; the report is asked again because a peer's pack can move it after. This is
17
+ * the facade's `requireWritable` law at the desk's own write surfaces: strata's store has no read-only mode, and every desk
18
+ * writer commits through it directly (guardedTransaction, setWidgetProps), never through the doc kit's commit sink, so a
19
+ * gate that lived only in the sink never reached them. A refused writer does what "no document" means to it: nothing lands.
20
+ */
21
+ export declare function writable(docs: TypingDocs): WritableSession | undefined;
22
+ /** No document at all: the runtime is all there is (a desk without a facade, a catalog harness). */
23
+ export declare const NO_DOCS: TypingDocs;
@@ -0,0 +1,43 @@
1
+ export interface BudgetStats {
2
+ readonly cap: number;
3
+ /** Bytes charged across every owner — the resident arrays and the caches together. */
4
+ readonly used: number;
5
+ /** Bytes that reside (never evicted): the thumbnail arrays. */
6
+ readonly resident: number;
7
+ /** What the caches may hold beside what resides: `cap − resident`, never under the floor. */
8
+ readonly room: number;
9
+ readonly entries: number;
10
+ /** Evictions since the ledger was made. */
11
+ readonly evictions: number;
12
+ readonly byOwner: Readonly<Record<string, {
13
+ readonly bytes: number;
14
+ readonly entries: number;
15
+ }>>;
16
+ }
17
+ export interface RasterBudget {
18
+ readonly cap: number;
19
+ /** The caches' room this moment: `cap − resident`, never under the floor. */
20
+ room(): number;
21
+ /** An owner's raster `key` of `bytes`, and how to let it go; a second charge of the same key re-sizes it (the old bytes released). Touches it. */
22
+ charge(owner: string, key: string, bytes: number, evict: () => void): void;
23
+ /** An owner's `key` kept WHOLE (a thumbnail array): never evicted, outside the caches' room; a second call re-sizes it. */
24
+ reside(owner: string, key: string, bytes: number): void;
25
+ /** The raster was used (drawn, written): it is the most recently used now. */
26
+ touch(owner: string, key: string): void;
27
+ /** The owner let the raster (or the resident array) go itself (no eviction). */
28
+ release(owner: string, key: string): void;
29
+ /**
30
+ * Every raster `owner` holds, let go WITHOUT its eviction (petition I24 — a kind gone MISSING: its caches went with its passes,
31
+ * and nothing of it is called again). Returns the bytes forgotten.
32
+ */
33
+ forget(owner: string): number;
34
+ /**
35
+ * Evict least-recently-used caches until they are within their room — never one `keep` says to hold (an owner's word on
36
+ * what is on screen this frame; absent, every cache may go), never a resident charge. Returns the bytes freed.
37
+ */
38
+ trim(keep?: (owner: string, key: string) => boolean): number;
39
+ stats(): BudgetStats;
40
+ }
41
+ /** The caches' floor as a share of the cap: what they may always hold, however much resides (D-K9-d.1). */
42
+ export declare const BUDGET_FLOOR: number;
43
+ export declare function createRasterBudget(cap: number, floor?: number): RasterBudget;
@@ -0,0 +1,54 @@
1
+ export interface GpuOptions {
2
+ /** `navigator.gpu` in a browser; Dawn's `create([])` in Node. */
3
+ readonly gpu: GPU;
4
+ readonly label?: string;
5
+ readonly powerPreference?: GPUPowerPreference;
6
+ /** Features to enable where the adapter has them, beside `timestamp-query` — asked for whenever the adapter has it (the GPU profiler's clock, design-016 §4: a feature cannot be added to a device later, and one unused costs nothing). */
7
+ readonly requiredFeatures?: readonly GPUFeatureName[];
8
+ /** Device loss and uncaptured errors — the layer degrades, it does not throw. */
9
+ readonly onLost?: (info: GPUDeviceLostInfo) => void;
10
+ readonly onError?: (error: GPUError) => void;
11
+ }
12
+ export interface Gpu {
13
+ readonly adapter: GPUAdapter;
14
+ readonly device: GPUDevice;
15
+ readonly info: {
16
+ readonly vendor: string;
17
+ readonly architecture: string;
18
+ readonly description: string;
19
+ };
20
+ }
21
+ export declare function acquire(opts: GpuOptions): Promise<Gpu>;
22
+ /**
23
+ * The one limit the desk asks above WebGPU's floor (K9 R1): the adapter's own `maxTextureArrayLayers` — a device asked for
24
+ * nothing gets the floor, 256, whatever the hardware holds (Apple 2048), and the kinds' shared thumbnail arrays (kit/arrays.ts
25
+ * `LayerArray`) stop there: the 257th picture has no layer, the 257th whiteboard no far-LOD thumbnail. On an adapter AT the floor
26
+ * this asks for 256 and changes nothing — the arrays' own reclaim and the boards' bare draw carry that cap honestly.
27
+ */
28
+ export declare function arrayLayerLimit(adapter: Pick<GPUAdapter, "limits">): Record<string, number> | undefined;
29
+ /**
30
+ * A device the host already HAS — the engine's (design-015 D7: ONE device per engine) — wired as `acquire` wires one it
31
+ * made: its loss and its uncaptured errors reach the handlers. The caller does not own it, so it never destroys it.
32
+ */
33
+ export declare function adopt(adapter: GPUAdapter, device: GPUDevice, opts?: Pick<GpuOptions, "onLost" | "onError">): Gpu;
34
+ /** A swap chain as the ground draws into it — made by `host/surface.ts` (a canvas) or a test's fake. */
35
+ export interface Surface {
36
+ readonly context: GPUCanvasContext;
37
+ readonly format: GPUTextureFormat;
38
+ /** Size the drawing buffer to the CSS box × dpr (clamped). True when it changed. */
39
+ fit(maxDpr?: number): {
40
+ changed: boolean;
41
+ width: number;
42
+ height: number;
43
+ cssWidth: number;
44
+ cssHeight: number;
45
+ dpr: number;
46
+ };
47
+ /** The swap-chain texture view for this frame. */
48
+ view(): GPUTextureView;
49
+ /** The drawing buffer's size in device px — whatever sized the canvas, `fit()` or the host. */
50
+ size(): {
51
+ readonly w: number;
52
+ readonly h: number;
53
+ };
54
+ }
@@ -0,0 +1,5 @@
1
+ export { defineStruct, type StructDef, type StructBuffer, type FieldSlot, type FieldType, type FieldValue, type StructValues } from "./struct";
2
+ export { compose, compile, type ComposedShader, type ComposeOptions, type ShaderPart } from "./shader";
3
+ export { acquire, adopt, type Gpu, type GpuOptions, type Surface } from "./device";
4
+ export { bindLayout, bindGroup, renderPipeline, uniformBuffer, storageBuffer, BLEND_OVER, type BindEntry, type BindKind, type RenderPipelineOptions, type Visibility, } from "./pipeline";
5
+ export { Target, beginPass, readback, type Clear, type TargetOptions } from "./target";
@@ -0,0 +1,36 @@
1
+ export type Visibility = "vertex" | "fragment" | "compute";
2
+ export type BindEntry = {
3
+ readonly binding: number;
4
+ readonly stages: readonly Visibility[];
5
+ readonly buffer: GPUBufferBindingType;
6
+ } | {
7
+ readonly binding: number;
8
+ readonly stages: readonly Visibility[];
9
+ readonly texture: GPUTextureSampleType;
10
+ readonly dimension?: GPUTextureViewDimension;
11
+ } | {
12
+ readonly binding: number;
13
+ readonly stages: readonly Visibility[];
14
+ readonly sampler: GPUSamplerBindingType;
15
+ };
16
+ /** A binding's layout without its number — what a card material declares (K7b), the card deals the numbers. */
17
+ export type BindKind = BindEntry extends infer E ? (E extends BindEntry ? Omit<E, "binding"> : never) : never;
18
+ export declare function bindLayout(device: GPUDevice, entries: readonly BindEntry[], label?: string): GPUBindGroupLayout;
19
+ export declare function bindGroup(device: GPUDevice, layout: GPUBindGroupLayout, resources: ReadonlyArray<GPUBuffer | GPUTextureView | GPUSampler>, label?: string): GPUBindGroup;
20
+ /** Straight-alpha "source over": colour by src-alpha, alpha accumulates. */
21
+ export declare const BLEND_OVER: GPUBlendState;
22
+ export interface RenderPipelineOptions {
23
+ readonly label?: string;
24
+ readonly layout: GPUPipelineLayout;
25
+ readonly module: GPUShaderModule;
26
+ readonly vertex?: string;
27
+ readonly fragment?: string;
28
+ readonly format: GPUTextureFormat;
29
+ readonly blend?: GPUBlendState;
30
+ /** WGSL `override` values, fixed at creation — how one file becomes N specialised pipelines. */
31
+ readonly constants?: Record<string, number>;
32
+ readonly topology?: GPUPrimitiveTopology;
33
+ }
34
+ export declare function renderPipeline(device: GPUDevice, o: RenderPipelineOptions): Promise<GPURenderPipeline>;
35
+ export declare function uniformBuffer(device: GPUDevice, size: number, label?: string): GPUBuffer;
36
+ export declare function storageBuffer(device: GPUDevice, size: number, label?: string): GPUBuffer;
@@ -0,0 +1,66 @@
1
+ import type { Entity } from "../../../core/src/index";
2
+ /** What a run says: `done` — the raster is laid (or no longer owed); `wait` — no room for it now: held until its owner `wake`s. */
3
+ export type RasterRun = () => "done" | "wait";
4
+ export interface RasterQueueStats {
5
+ /** The frame's budget, ms. */
6
+ readonly budgetMs: number;
7
+ /** Asks waiting for their turn, and those held for room. */
8
+ readonly waiting: number;
9
+ readonly held: number;
10
+ /** Runs since the queue was made, the turns that ran any, and their ms. */
11
+ readonly ran: number;
12
+ readonly turns: number;
13
+ readonly ms: number;
14
+ /** Asks let go unrun: their object was not drawn when their turn came. */
15
+ readonly dropped: number;
16
+ /** The most runs one turn made, the most ms one turn spent, and the most one run took — a turn overshoots its budget by at most its last run. */
17
+ readonly peakRuns: number;
18
+ readonly peakMs: number;
19
+ readonly dearest: number;
20
+ }
21
+ export interface RasterQueue {
22
+ /** The frame's budget, ms (the turn's first run excepted). */
23
+ readonly budgetMs: number;
24
+ /**
25
+ * Ask for `owner`'s raster of `key` (a kind and its object): `priority` orders the turn (lower first — a kind puts what shows
26
+ * nothing before what shows a stand-in, and the nearest the view's centre first); `run` lays it when its turn comes. A second ask
27
+ * for the same key replaces the first — its priority and its run, and a held ask is waiting again.
28
+ */
29
+ ask(owner: string, key: Entity, priority: number, run: RasterRun): void;
30
+ /** The ask is withdrawn: the object's need went away before its turn (the zoom came back to the band it holds), or it left. */
31
+ drop(owner: string, key: Entity): void;
32
+ has(owner: string, key: Entity): boolean;
33
+ /** Room may have been made — `owner` let a raster go, or (no owner) the host drew a frame: the held asks wait for their turn again. */
34
+ wake(owner?: string): void;
35
+ /** Every ask of `owner` withdrawn (its state reset), or every ask. */
36
+ clear(owner?: string): void;
37
+ /** The host's turn, once a tick before the build: the runs, lowest priority first, while the budget lasts. Returns how many ran. */
38
+ drain(): number;
39
+ /** Asks waiting for their turn — the host keeps the desk awake while there are any (held asks are not counted). */
40
+ readonly size: number;
41
+ stats(): RasterQueueStats;
42
+ }
43
+ export interface RasterQueueOptions {
44
+ /** The frame's budget, ms (default `RASTER_BUDGET_MS`). */
45
+ readonly budgetMs?: number;
46
+ /** The clock the budget is kept on (default `performance.now`). */
47
+ readonly clock?: () => number;
48
+ /** Was the object drawn in the last build (the builder's word, `DeskBuilder.shows`)? Absent: every ask is run. */
49
+ readonly shows?: (key: Entity) => boolean;
50
+ }
51
+ /**
52
+ * The frame's raster budget, ms: a zoom's frame keeps its other work (≈ 1 ms of JS on the stress desk) inside design-016 §6's
53
+ * 8 ms with a raster's worth to spare — a note's ink at band 2 costs ≈ 2 ms on this Mac, and the turn's first always runs.
54
+ */
55
+ export declare const RASTER_BUDGET_MS = 4;
56
+ /**
57
+ * What an object shows while its raster waits its turn (K6b): NOTHING (a blank sheet, a bare board), its old raster MAGNIFIED (a
58
+ * band or a density short of the screen's — soft), or its old raster MINIFIED (past it — only the pages' room is at stake).
59
+ */
60
+ export type RasterWait = "nothing" | "magnified" | "minified";
61
+ /**
62
+ * The priority every kind asks with, so one turn orders them all alike (K6b): what shows nothing first, then a stand-in magnified,
63
+ * then one minified — the nearest the view's centre (`px`, screen px) first within each.
64
+ */
65
+ export declare function rasterPriority(shows: RasterWait, px: number): number;
66
+ export declare function createRasterQueue(opts?: RasterQueueOptions): RasterQueue;
@@ -0,0 +1,56 @@
1
+ import type { StructBuffer, StructDef } from "./struct";
2
+ /** How the pass packs one record into its slot; `blocks` (when the store has them) and `blockBase` name the slot's block. Returns the block records used (0 without blocks). */
3
+ export type RecordPacker<R, F extends string, B extends string> = (record: R, aux: number, into: StructBuffer<F>, slot: number, blocks: StructBuffer<B> | null, blockBase: number) => number;
4
+ export interface RecordStoreOptions<R, F extends string, B extends string = never> {
5
+ readonly device: GPUDevice;
6
+ readonly def: StructDef<F>;
7
+ /** Slots at the start; grown by doubling up to `max` (65,536). */
8
+ readonly capacity: number;
9
+ readonly max?: number;
10
+ /** The records buffer's label (`paper/notes`); the draw list is `<label> order`, the blocks `blocks.label`. */
11
+ readonly label: string;
12
+ readonly pack: RecordPacker<R, F, B>;
13
+ /** A fixed block of `per` sub-records of `def` a slot (the mini mat's chips). */
14
+ readonly blocks?: {
15
+ readonly def: StructDef<B>;
16
+ readonly per: number;
17
+ readonly label: string;
18
+ };
19
+ }
20
+ export interface RecordStoreStats {
21
+ /** Records packed and uploaded since the store was made. */
22
+ readonly written: number;
23
+ /** Bytes those uploads carried (records and blocks). */
24
+ readonly bytes: number;
25
+ /** Draw-list uploads. */
26
+ readonly orderWrites: number;
27
+ /** Slots in use, the capacity, how many times the buffers were remade. */
28
+ readonly slots: number;
29
+ readonly capacity: number;
30
+ readonly grown: number;
31
+ }
32
+ export interface RecordStore<R> {
33
+ /** The records buffer, the draw list and (with blocks) the blocks buffer — bind them; their identity moves on growth, `version` says when. */
34
+ readonly records: GPUBuffer;
35
+ readonly order: GPUBuffer;
36
+ readonly blocks: GPUBuffer | null;
37
+ readonly version: number;
38
+ /**
39
+ * One frame's records in paint order. `keys`: one per record, stable across frames (absent = transient: slots dealt from 0,
40
+ * everything packed). `aux(i)`: a number per record folded into the change test and handed to the pack. Returns the count
41
+ * that will draw — `order[0 … count)` names each paint index's slot.
42
+ */
43
+ prepare(records: readonly R[], keys: readonly number[] | undefined, aux?: (index: number) => number): number;
44
+ /** The slot drawn at paint index `i` this frame. */
45
+ slotAt(i: number): number;
46
+ /** What the pack folded in at paint index `i`: its aux and the block records it used. */
47
+ entryAt(i: number): {
48
+ readonly aux: number;
49
+ readonly blockN: number;
50
+ };
51
+ /** Every live record repacked at the next `prepare` (a law changed under them). */
52
+ invalidate(): void;
53
+ stats(): RecordStoreStats;
54
+ dispose(): void;
55
+ }
56
+ export declare function createRecordStore<R, F extends string, B extends string = never>(opts: RecordStoreOptions<R, F, B>): RecordStore<R>;
@@ -0,0 +1,22 @@
1
+ import type { StructDef } from "./struct";
2
+ export interface ShaderPart {
3
+ readonly label: string;
4
+ readonly text: string;
5
+ }
6
+ export interface ComposeOptions {
7
+ /** Structs whose WGSL text is prepended, in order. */
8
+ readonly structs?: ReadonlyArray<StructDef<string>>;
9
+ /** Pure modules, in dependency order. */
10
+ readonly modules?: ReadonlyArray<ShaderPart>;
11
+ /** The entry: bindings + @vertex/@fragment/@compute. */
12
+ readonly entry: ShaderPart;
13
+ }
14
+ export interface ComposedShader {
15
+ readonly code: string;
16
+ readonly label: string;
17
+ /** Map a line of the composed code back to `<part>:<line>`. */
18
+ locate(line: number): string;
19
+ }
20
+ export declare function compose(opts: ComposeOptions): ComposedShader;
21
+ /** Create the module and surface compilation errors with mapped locations. */
22
+ export declare function compile(device: GPUDevice, shader: ComposedShader): Promise<GPUShaderModule>;
@@ -0,0 +1,39 @@
1
+ /** The scalar and vector types, and a fixed array of vec4f (`array<vec4f, N>`: stride 16, legal in a uniform block) — the portal chain's. */
2
+ export type FieldType = "f32" | "i32" | "u32" | "vec2f" | "vec3f" | "vec4f" | "mat4x4f" | `array<vec4f, ${number}>`;
3
+ interface TypeInfo {
4
+ readonly align: number;
5
+ readonly size: number;
6
+ readonly n: number;
7
+ readonly scalar: "f" | "i" | "u";
8
+ }
9
+ /** A field type's layout: the table's, or a vec4f array's — N × 16 bytes, 4N floats, written as one flat list. */
10
+ export declare function typeInfo(type: FieldType): TypeInfo | undefined;
11
+ export interface FieldSlot {
12
+ readonly byte: number;
13
+ readonly type: FieldType;
14
+ readonly n: number;
15
+ }
16
+ export type FieldValue = number | boolean | ArrayLike<number>;
17
+ export type StructValues<F extends string> = Partial<Record<F, FieldValue>>;
18
+ export interface StructDef<F extends string> {
19
+ readonly name: string;
20
+ readonly fields: ReadonlyArray<readonly [F, FieldType]>;
21
+ /** Padded size in bytes; also the array stride. */
22
+ readonly size: number;
23
+ readonly slots: Readonly<Record<F, FieldSlot>>;
24
+ /** `struct <name> { ... }` — prepend to any shader that binds this. */
25
+ readonly wgsl: string;
26
+ /** Backing storage for `count` elements. */
27
+ alloc(count?: number): StructBuffer<F>;
28
+ }
29
+ export interface StructBuffer<F extends string> {
30
+ readonly def: StructDef<F>;
31
+ readonly count: number;
32
+ readonly bytes: ArrayBuffer;
33
+ /** Write fields by name into element `index`. Unknown names and wrong arity throw. */
34
+ set(values: StructValues<F>, index?: number): void;
35
+ /** The byte view to upload; `elements` trims to a prefix of the array. */
36
+ view(elements?: number): Uint8Array<ArrayBuffer>;
37
+ }
38
+ export declare function defineStruct<F extends string>(name: string, fields: ReadonlyArray<readonly [F, FieldType]>): StructDef<F>;
39
+ export {};
@@ -0,0 +1,26 @@
1
+ export interface TargetOptions {
2
+ readonly format: GPUTextureFormat;
3
+ readonly label?: string;
4
+ /** Add COPY_SRC when a host wants to read the pixels back (the oracle does). */
5
+ readonly readable?: boolean;
6
+ }
7
+ export declare class Target {
8
+ texture: GPUTexture;
9
+ view: GPUTextureView;
10
+ width: number;
11
+ height: number;
12
+ readonly format: GPUTextureFormat;
13
+ private readonly usage;
14
+ private readonly device;
15
+ private readonly opts;
16
+ constructor(device: GPUDevice, opts: TargetOptions, width?: number, height?: number);
17
+ private make;
18
+ /** True when the texture was recreated (and therefore holds nothing). */
19
+ resize(w0: number, h0: number): boolean;
20
+ dispose(): void;
21
+ }
22
+ export type Clear = readonly [number, number, number, number];
23
+ /** Begin a colour-only render pass; `clear` omitted loads the existing contents. */
24
+ export declare function beginPass(encoder: GPUCommandEncoder, view: GPUTextureView, clear?: Clear, label?: string): GPURenderPassEncoder;
25
+ /** Read a texture back as raw bytes with row padding removed (oracle / tests). */
26
+ export declare function readback(device: GPUDevice, texture: GPUTexture, bytesPerTexel: number): Promise<Uint8Array>;
@@ -0,0 +1,38 @@
1
+ import type { Entity } from "../../core/src/index";
2
+ /** A kind the desk draws as MISSING, and why — what `DeskLayerStatus.faults` lists, in the order the kinds went missing. */
3
+ export interface KindFault {
4
+ readonly kind: string;
5
+ readonly reason: string;
6
+ }
7
+ /** The strikes a kind is allowed: the third throw makes it missing (design-009 §16's ladder — three strikes, then quarantine). */
8
+ export declare const KIND_STRIKES = 3;
9
+ /**
10
+ * A missing kind's row in the layer's `due().kinds` (host/layer.ts): no time — a time there is ≥ 0, `Infinity` never on its own —
11
+ * so −1 reads as what it is: this kind is never due again, nothing of it runs.
12
+ */
13
+ export declare const KIND_MISSING = -1;
14
+ export interface KindFaults {
15
+ /** How many kinds are missing — 0 while none is (every call site's first and, then, only test). */
16
+ readonly size: number;
17
+ /** Is `kind` missing (refused at create, or quarantined)? Nothing of it is called again. */
18
+ missing(kind: string): boolean;
19
+ /** `kind` was REFUSED at create (ground.ts — `reason` says so): missing from the start. Said once; a second word for it is ignored. */
20
+ refuse(kind: string, reason: string): void;
21
+ /**
22
+ * One of `kind`'s calls threw: a strike, said on the console with the call and the entity. The third makes it MISSING (said once,
23
+ * the listeners told) — returns true then. A strike for a kind already missing is ignored (its last call's throw, still unwinding).
24
+ */
25
+ strike(kind: string, call: string, err: unknown, entity?: Entity): boolean;
26
+ /** The strikes `kind` has taken (0 … `KIND_STRIKES`). */
27
+ strikes(kind: string): number;
28
+ /** The missing kinds, in the order they went — one array until the next goes (a host may hold it). */
29
+ list(): readonly KindFault[];
30
+ /** Told once for each kind that goes missing, after it is in `list()`. Returns the unsubscribe. */
31
+ subscribe(listener: (fault: KindFault) => void): () => void;
32
+ }
33
+ /**
34
+ * The first line of a fault worth a host's reading: an error's message, its first non-blank line — for the engine's WGSL refusal
35
+ * (`WGSL <label>:` then the compiler's lines, engine/shader.ts `compile`) the compiler's first, with its place.
36
+ */
37
+ export declare function faultText(err: unknown): string;
38
+ export declare function createKindFaults(): KindFaults;
@@ -0,0 +1,61 @@
1
+ import type { GroundFrameInputs } from "./ground";
2
+ export interface KindCostOptions {
3
+ /** Rounds (7). */
4
+ readonly rounds?: number;
5
+ /** The batch's target GPU time, ms (25). */
6
+ readonly targetMs?: number;
7
+ /** The probe's frames (4). */
8
+ readonly probeFrames?: number;
9
+ /** The batch's bounds (3 … 300 frames). */
10
+ readonly minFrames?: number;
11
+ readonly maxFrames?: number;
12
+ /** The kinds to leave out (default: every kind with an object in the frame). */
13
+ readonly kinds?: readonly string[];
14
+ }
15
+ export interface Sampled {
16
+ readonly median: number;
17
+ readonly min: number;
18
+ }
19
+ export interface KindCost {
20
+ /** ms per frame the frame loses without the kind: the median of the paired base − without-k over rounds. */
21
+ readonly ms: number;
22
+ /** …as a share of the base frame. */
23
+ readonly share: number;
24
+ /** The frame without the kind, ms per frame. */
25
+ readonly without: Sampled;
26
+ /** The kind's objects in the frame (every slot's). */
27
+ readonly objects: number;
28
+ /** The cost clears the noise floor. */
29
+ readonly clears: boolean;
30
+ }
31
+ export interface KindCostReport {
32
+ /** Frames a batch, rounds, and every round's batches in the order drawn. */
33
+ readonly frames: number;
34
+ readonly rounds: number;
35
+ /** The frame as it is, ms per frame. */
36
+ readonly base: Sampled;
37
+ /** The A/A control: the same frame as a variant of its own. */
38
+ readonly control: Sampled;
39
+ /** median(control) − median(base): the A/A offset. */
40
+ readonly aa: number;
41
+ /** The noise floor: the median over rounds of |control − base| within a round. */
42
+ readonly noise: number;
43
+ readonly kinds: Readonly<Record<string, KindCost>>;
44
+ /** Every batch, ms per frame, by variant (`base`, `control`, each kind), in round order — round r drew variant i at position (i − r) mod n. */
45
+ readonly samples: Readonly<Record<string, readonly number[]>>;
46
+ }
47
+ export interface Ablation {
48
+ /** The frame to measure (the last one drawn). */
49
+ readonly inputs: GroundFrameInputs;
50
+ /** Draw one frame of these inputs, synchronously (`Ground.render`). */
51
+ render(inputs: GroundFrameInputs): void;
52
+ /** Resolve once the GPU finished everything submitted (`queue.onSubmittedWorkDone`). */
53
+ drain(): Promise<unknown>;
54
+ now(): number;
55
+ }
56
+ /** Every kind with an object in the frame, and how many — the root's, the insides', the departed desk's. */
57
+ export declare function kindsIn(inputs: GroundFrameInputs): Record<string, number>;
58
+ /** The frame with `kind`'s objects left out of every slot (its insides with them); `null` kind: the frame as it is. The held object is always left out (the rest frame). */
59
+ export declare function withoutKind(inputs: GroundFrameInputs, kind: string | null): GroundFrameInputs;
60
+ /** Measure what each kind costs the frame (the header's method). */
61
+ export declare function ablateKinds(a: Ablation, opts?: KindCostOptions): Promise<KindCostReport>;