From 7b29dbff7e43e87741476f47df17ad1582b16546 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 21 Sep 2026 00:58:15 +0800 Subject: feat(pipeline): add runnable artifact pipeline increment [Change Nature] - This commit adds the first runnable increment of the F# artifact pipeline: CLI, server, frontend bundle, stage fixture, and tests. It is feature work, not a bug fix. [New Capability] - CLI `run` executes the three-step Blender fixture through the process bridge and writes GLBs, step logs, events, and a manifest; `verify` validates a manifest without Blender. - Server exposes run start, run-scoped SSE, artifact manifest/file routes, and serves the Fable frontend from its build output. - Frontend starts runs, follows run-scoped SSE progress, and links the artifact manifest on completion. [Implementation] - Shared layer holds domain, run state, replay, and artifact contracts; Modeling holds the pipeline, 120s bridge timeout, and result-file protocol; stage/blender/fixture.py owns geometry in Python (bpy owns geometry, F# owns orchestration). - Fable bundle is regenerated into public/ and copied by the server project; solution includes all projects with warnings-as-errors. - README documents build, Fable, server, interpreter/env, fixture limitations, and current verification status. [Impact] - Verified: 40/40 solution tests pass; Release build 0 warnings/errors; real CLI run with bpy 5.0.1 produced 3 GLBs, 3 logs, and a verify-clean manifest; isolated-port server smoke flow succeeded. - Not yet verified: browser end-to-end behavior and production fidelity. Artifacts and caches are gitignored. --- src/SomhairlesDream.Frontend/Bindings.fs | 109 +++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 src/SomhairlesDream.Frontend/Bindings.fs (limited to 'src/SomhairlesDream.Frontend/Bindings.fs') diff --git a/src/SomhairlesDream.Frontend/Bindings.fs b/src/SomhairlesDream.Frontend/Bindings.fs new file mode 100644 index 0000000..dc75d7d --- /dev/null +++ b/src/SomhairlesDream.Frontend/Bindings.fs @@ -0,0 +1,109 @@ +module SomhairlesDream.Frontend.Bindings + +open Fable.Core + +[] +type ThreeVector = + abstract set: x: float * y: float * z: float -> ThreeVector + abstract x: float with get, set + abstract y: float with get, set + abstract z: float with get, set + +[] +type ThreeNode = + abstract add: child: ThreeNode -> unit + abstract clear: unit -> unit + abstract lookAt: x: float * y: float * z: float -> unit + abstract position: ThreeVector with get + abstract rotation: ThreeVector with get + abstract background: obj with get, set + +[] +type ThreeRenderer = + abstract setPixelRatio: ratio: float -> unit + abstract setSize: width: float * height: float * updateStyle: bool -> unit + abstract render: scene: ThreeNode * camera: ThreeNode -> unit + +[] +type ThreeGeometry = + abstract setAttribute: name: string * attribute: obj -> ThreeGeometry + abstract setIndex: attribute: obj -> ThreeGeometry + abstract computeVertexNormals: unit -> unit + +[] +type ServerEvent = + abstract data: string with get + +[] +type EventSource = + abstract onerror: (obj -> unit) with get, set + abstract onmessage: (ServerEvent -> unit) with get, set + abstract close: unit -> unit + +[] +type FetchResponse = + abstract ok: bool with get + abstract status: int with get + abstract json: unit -> JS.Promise + +[] +type HtmlInput = + abstract value: string with get + abstract ``checked``: bool with get + +[] +let createScene () : ThreeNode = jsNative + +[] +let createGroup () : ThreeNode = jsNative + +[] +let createPerspectiveCamera (fieldOfView: float, aspect: float, nearPlane: float, farPlane: float) : ThreeNode = jsNative + +[] +let createRenderer (options: obj) : ThreeRenderer = jsNative + +[] +let createBufferGeometry () : ThreeGeometry = jsNative + +[] +let createFloat32BufferAttribute (values: float array, itemSize: int) : obj = jsNative + +[] +let createUint32BufferAttribute (values: int array) : obj = jsNative + +[] +let createColor (value: string) : obj = jsNative + +[] +let createBoxGeometry (width: float, height: float, depth: float) : obj = jsNative + +[] +let createMeshStandardMaterial (options: obj) : obj = jsNative + +[] +let createMesh (geometry: obj, material: obj) : ThreeNode = jsNative + +[] +let createAmbientLight (color: string, intensity: float) : ThreeNode = jsNative + +[] +let createDirectionalLight (color: string, intensity: float) : ThreeNode = jsNative + +[] +let createEventSource (url: string) : EventSource = jsNative + +[] +let fetch (url: string, options: obj) : JS.Promise = jsNative + +[] +let encodeURIComponent (value: string) : string = jsNative + +[] +let setInterval (callback: unit -> unit) (milliseconds: int) : int = jsNative + +[] +let clearInterval (handle: int) : unit = jsNative + +[] +let requestAnimationFrame (callback: float -> unit) : int = jsNative -- cgit v1.2.3