@lumencast/runtime 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/{broadcast-L5wm2I6J.js → broadcast-DtHoU_fS.js} +3 -3
- package/dist/{broadcast-L5wm2I6J.js.map → broadcast-DtHoU_fS.js.map} +1 -1
- package/dist/{control-eEUG7unp.js → control-B9frEbNG.js} +4 -4
- package/dist/{control-eEUG7unp.js.map → control-B9frEbNG.js.map} +1 -1
- package/dist/{index-Clrya_9l.js → index-Dz27r92m.js} +378 -332
- package/dist/index-Dz27r92m.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/lumencast.js +22 -18
- package/dist/mount.d.ts.map +1 -1
- package/dist/mount.js +11 -0
- package/dist/mount.js.map +1 -1
- package/dist/render/primitives/index.d.ts.map +1 -1
- package/dist/render/primitives/index.js +6 -0
- package/dist/render/primitives/index.js.map +1 -1
- package/dist/render/primitives/meet-peer-slot.d.ts +29 -0
- package/dist/render/primitives/meet-peer-slot.d.ts.map +1 -0
- package/dist/render/primitives/meet-peer-slot.js +46 -0
- package/dist/render/primitives/meet-peer-slot.js.map +1 -0
- package/dist/state/reserved-leaves.d.ts +37 -0
- package/dist/state/reserved-leaves.d.ts.map +1 -0
- package/dist/state/reserved-leaves.js +96 -0
- package/dist/state/reserved-leaves.js.map +1 -0
- package/dist/{status-pill-elORkMrh.js → status-pill-B2vBTwRC.js} +2 -2
- package/dist/{status-pill-elORkMrh.js.map → status-pill-B2vBTwRC.js.map} +1 -1
- package/dist/{test-7q_KJkdX.js → test-DD2SBDku.js} +4 -4
- package/dist/{test-7q_KJkdX.js.map → test-DD2SBDku.js.map} +1 -1
- package/dist/{tree-BMxx5170.js → tree-CgU_sUwI.js} +213 -197
- package/dist/tree-CgU_sUwI.js.map +1 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +12 -0
- package/src/mount.ts +12 -0
- package/src/render/primitives/index.ts +6 -0
- package/src/render/primitives/meet-peer-slot.tsx +55 -0
- package/src/state/reserved-leaves.ts +121 -0
- package/src/types.ts +12 -0
- package/dist/index-Clrya_9l.js.map +0 -1
- package/dist/tree-BMxx5170.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAgB5D,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;oEACgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAC;IACvD;;;;0EAIsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACjD;;;;;uEAKmE;IACnE,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,CAmBjF,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { Image } from "./image";
|
|
|
9
9
|
import { Shape } from "./shape";
|
|
10
10
|
import { Media } from "./media";
|
|
11
11
|
import { MeetPeer } from "./meet-peer";
|
|
12
|
+
import { MeetPeerSlot } from "./meet-peer-slot";
|
|
12
13
|
import { Instance } from "./instance";
|
|
13
14
|
import { Capture } from "./capture";
|
|
14
15
|
export const PRIMITIVES = {
|
|
@@ -25,5 +26,10 @@ export const PRIMITIVES = {
|
|
|
25
26
|
instance: Instance,
|
|
26
27
|
// RFC-0001 / ADR 004 — Zab vendor capture placeholder (transparent, inert).
|
|
27
28
|
"x-zab.capture": Capture,
|
|
29
|
+
// ADR Blue 009 §3.1 (Amendment 2) — Zab vendor meet-peer SLOT placeholder.
|
|
30
|
+
// Carries only a logical `x-zab.slotRef` ; the host's slot-aware peer-stream
|
|
31
|
+
// registry resolves `slotRef → peer_label → MediaStream` (transparent when
|
|
32
|
+
// unbound). Closes the kind→primitive gap that left it an unknown-kind drop.
|
|
33
|
+
"x-zab.meet-peer": MeetPeerSlot,
|
|
28
34
|
};
|
|
29
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/primitives/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,uEAAuE;AACvE,0DAA0D;AAK1D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,M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AU,GAA+D;IACpF,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,2EAA2E;IAC3E,2EAA2E;IAC3E,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,QAAQ;IAClB,4EAA4E;IAC5E,eAAe,EAAE,OAAO;IACxB,2EAA2E;IAC3E,6EAA6E;IAC7E,2EAA2E;IAC3E,6EAA6E;IAC7E,iBAAiB,EAAE,YAAY;CAChC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PrimitiveProps } from "./index";
|
|
2
|
+
/** `x-zab.meet-peer` — the transparent meet-peer SLOT placeholder (Zab vendor
|
|
3
|
+
* primitive, ADR Blue 009 §3.1 Amendment 2 ; type shipped in v0.10.0 / #81).
|
|
4
|
+
*
|
|
5
|
+
* Distinct from `meet.peer` (the cam-identity source) : this node carries NO
|
|
6
|
+
* peer identity, only a hash-stable LOGICAL `x-zab.slotRef` (e.g. `cam-caster-1`)
|
|
7
|
+
* + geometry. WHICH `peer_label` fills a slot is RUNTIME, stream-level ZabCam
|
|
8
|
+
* state — never baked in the scene. The slot→peer binding is ported by Orion on
|
|
9
|
+
* the LSDP as `__cam.slots.<slotRef>` = "<peer_label>" (§3.3) and re-keyed into
|
|
10
|
+
* the host's peer-stream registry (Solar `slot-binding.ts`) so the registry
|
|
11
|
+
* resolves `slotRef → peer_label → MediaStream`.
|
|
12
|
+
*
|
|
13
|
+
* Contract (rendered verbatim) :
|
|
14
|
+
* - `x-zab.slotRef` (string) — the SLOT REFERENCE, used as the resolver KEY.
|
|
15
|
+
* The host's peer-stream resolver (`resolvePeerStream`/`subscribePeerStream`)
|
|
16
|
+
* is keyed by `slotRef` on the antenne (Solar's slot-aware registry maps it
|
|
17
|
+
* to a `peer_label`, then to a stream). Empty / missing → a transparent inert
|
|
18
|
+
* box (the slot is not addressable).
|
|
19
|
+
* - geometry (`width`/`height` + position) — applied by the Tree's
|
|
20
|
+
* UniversalWrapper, exactly like `meet.peer` ; the `<video>` fills the box
|
|
21
|
+
* 100%/100% and is never forced full-screen (RC-Geo).
|
|
22
|
+
*
|
|
23
|
+
* Receive-only : the slot reads its stream through the host viewer (Solar joins
|
|
24
|
+
* the room and owns the peer connections / track lifecycle) ; the primitive
|
|
25
|
+
* carries no creds and never mutates the scene (RC-ReadOnly). An UNBOUND slot
|
|
26
|
+
* (no `__cam.slots.*` assignment) or a not-yet-connected peer → a transparent
|
|
27
|
+
* placeholder, no throw, no diagnostic (R3). */
|
|
28
|
+
export declare function MeetPeerSlot({ resolved }: PrimitiveProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=meet-peer-slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meet-peer-slot.d.ts","sourceRoot":"","sources":["../../../src/render/primitives/meet-peer-slot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;iDAyBiD;AACjD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,cAAc,2CAyBxD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LivePeerVideo } from "./live-peer-video";
|
|
3
|
+
/** `x-zab.meet-peer` — the transparent meet-peer SLOT placeholder (Zab vendor
|
|
4
|
+
* primitive, ADR Blue 009 §3.1 Amendment 2 ; type shipped in v0.10.0 / #81).
|
|
5
|
+
*
|
|
6
|
+
* Distinct from `meet.peer` (the cam-identity source) : this node carries NO
|
|
7
|
+
* peer identity, only a hash-stable LOGICAL `x-zab.slotRef` (e.g. `cam-caster-1`)
|
|
8
|
+
* + geometry. WHICH `peer_label` fills a slot is RUNTIME, stream-level ZabCam
|
|
9
|
+
* state — never baked in the scene. The slot→peer binding is ported by Orion on
|
|
10
|
+
* the LSDP as `__cam.slots.<slotRef>` = "<peer_label>" (§3.3) and re-keyed into
|
|
11
|
+
* the host's peer-stream registry (Solar `slot-binding.ts`) so the registry
|
|
12
|
+
* resolves `slotRef → peer_label → MediaStream`.
|
|
13
|
+
*
|
|
14
|
+
* Contract (rendered verbatim) :
|
|
15
|
+
* - `x-zab.slotRef` (string) — the SLOT REFERENCE, used as the resolver KEY.
|
|
16
|
+
* The host's peer-stream resolver (`resolvePeerStream`/`subscribePeerStream`)
|
|
17
|
+
* is keyed by `slotRef` on the antenne (Solar's slot-aware registry maps it
|
|
18
|
+
* to a `peer_label`, then to a stream). Empty / missing → a transparent inert
|
|
19
|
+
* box (the slot is not addressable).
|
|
20
|
+
* - geometry (`width`/`height` + position) — applied by the Tree's
|
|
21
|
+
* UniversalWrapper, exactly like `meet.peer` ; the `<video>` fills the box
|
|
22
|
+
* 100%/100% and is never forced full-screen (RC-Geo).
|
|
23
|
+
*
|
|
24
|
+
* Receive-only : the slot reads its stream through the host viewer (Solar joins
|
|
25
|
+
* the room and owns the peer connections / track lifecycle) ; the primitive
|
|
26
|
+
* carries no creds and never mutates the scene (RC-ReadOnly). An UNBOUND slot
|
|
27
|
+
* (no `__cam.slots.*` assignment) or a not-yet-connected peer → a transparent
|
|
28
|
+
* placeholder, no throw, no diagnostic (R3). */
|
|
29
|
+
export function MeetPeerSlot({ resolved }) {
|
|
30
|
+
const slotRef = typeof resolved["x-zab.slotRef"] === "string" &&
|
|
31
|
+
resolved["x-zab.slotRef"].length > 0
|
|
32
|
+
? resolved["x-zab.slotRef"]
|
|
33
|
+
: "";
|
|
34
|
+
// No slotRef → not addressable : a transparent inert box of the wrapper
|
|
35
|
+
// geometry (no throw, no diagnostic), exactly like an unbound slot.
|
|
36
|
+
if (slotRef === "") {
|
|
37
|
+
return (_jsx("div", { "aria-hidden": true, "data-lumencast-meet-peer-slot": true, style: { width: "100%", height: "100%", opacity: 0, pointerEvents: "none" } }));
|
|
38
|
+
}
|
|
39
|
+
// Key the peer-viewer resolver by `slotRef` (NOT a peer_label). The shared
|
|
40
|
+
// `LivePeerVideo` is resolver-key agnostic : it passes its `peerLabel` prop
|
|
41
|
+
// straight to `resolvePeerStream`/`subscribePeerStream`, and the host's
|
|
42
|
+
// slot-aware registry translates the slotRef to the bound peer's stream. An
|
|
43
|
+
// unbound slot resolves to `null` → the transparent placeholder.
|
|
44
|
+
return _jsx(LivePeerVideo, { peerLabel: slotRef, objectFit: "cover", muted: true });
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=meet-peer-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meet-peer-slot.js","sourceRoot":"","sources":["../../../src/render/primitives/meet-peer-slot.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;iDAyBiD;AACjD,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAkB;IACvD,MAAM,OAAO,GACX,OAAO,QAAQ,CAAC,eAAe,CAAC,KAAK,QAAQ;QAC5C,QAAQ,CAAC,eAAe,CAAY,CAAC,MAAM,GAAG,CAAC;QAC9C,CAAC,CAAE,QAAQ,CAAC,eAAe,CAAY;QACvC,CAAC,CAAC,EAAE,CAAC;IAET,wEAAwE;IACxE,oEAAoE;IACpE,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,CACL,0EAGE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,GAC3E,CACH,CAAC;IACJ,CAAC;IAED,2EAA2E;IAC3E,4EAA4E;IAC5E,wEAAwE;IACxE,4EAA4E;IAC5E,iEAAiE;IACjE,OAAO,KAAC,aAAa,IAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,OAAO,EAAC,KAAK,SAAG,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Every reserved cam leaf lives under this prefix. */
|
|
2
|
+
export declare const CAM_RESERVED_PREFIX = "__cam.";
|
|
3
|
+
/** One scalar leaf per bound slot : `__cam.slots.<slotRef>` = "<peer_label>"
|
|
4
|
+
* (ADR Blue 009 §3.3). Mirrors Solar's `CAM_SLOTS_PREFIX` — keep them in sync. */
|
|
5
|
+
export declare const CAM_SLOTS_PREFIX = "__cam.slots.";
|
|
6
|
+
/** The single viewer-credentials leaf (ADR Blue 009 §3.2, Orion #268). */
|
|
7
|
+
export declare const CAM_VIEWER_LEAF = "__cam.viewer";
|
|
8
|
+
/** The reserved cam state surfaced to the host in one shot on every change. */
|
|
9
|
+
export interface ReservedCamLeaves {
|
|
10
|
+
/** `__cam.viewer` — receive-only viewer creds for the active stream. Opaque to
|
|
11
|
+
* the runtime (shape `{ rooms: [{ signalingUrl, roomId, token }] }` validated
|
|
12
|
+
* host-side) ; `undefined` when the leaf is absent. */
|
|
13
|
+
viewer?: unknown;
|
|
14
|
+
/** `slotRef → peer_label` snapshot from the `__cam.slots.*` subtree. A slot
|
|
15
|
+
* ABSENT from this map is UNBOUND — the host releases it (`assign(slotRef,
|
|
16
|
+
* null)`) so the `x-zab.meet-peer` node falls back to its placeholder. Only
|
|
17
|
+
* non-empty string values are kept. */
|
|
18
|
+
slots: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
/** A reserved cam leaf the runtime forwards rather than renders. */
|
|
21
|
+
export declare function isReservedCamPath(path: string): boolean;
|
|
22
|
+
export interface ReservedLeafObserver {
|
|
23
|
+
/** Reseed from a full snapshot's state (reserved leaves not present are
|
|
24
|
+
* dropped). Emits when the projected state changed. */
|
|
25
|
+
onSnapshot(state: Record<string, unknown>): void;
|
|
26
|
+
/** Apply a delta's patches ; emits only when a reserved leaf actually moved. */
|
|
27
|
+
onDelta(patches: ReadonlyArray<{
|
|
28
|
+
path: string;
|
|
29
|
+
value: unknown;
|
|
30
|
+
}>): void;
|
|
31
|
+
}
|
|
32
|
+
/** Track the reserved `__cam.*` leaves across snapshots + deltas and `emit` the
|
|
33
|
+
* host-facing projection whenever it changes (de-duplicated by content, so an
|
|
34
|
+
* unrelated scene's deltas never call back). Created only when the host supplies
|
|
35
|
+
* `onReservedLeaves` — zero cost otherwise. */
|
|
36
|
+
export declare function createReservedLeafObserver(emit: (leaves: ReservedCamLeaves) => void): ReservedLeafObserver;
|
|
37
|
+
//# sourceMappingURL=reserved-leaves.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-leaves.d.ts","sourceRoot":"","sources":["../../src/state/reserved-leaves.ts"],"names":[],"mappings":"AAkBA,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C;mFACmF;AACnF,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,0EAA0E;AAC1E,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC;;4DAEwD;IACxD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;4CAGwC;IACxC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AA6BD,MAAM,WAAW,oBAAoB;IACnC;4DACwD;IACxD,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACjD,gFAAgF;IAChF,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CACzE;AAED;;;gDAGgD;AAChD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GACxC,oBAAoB,CAiCtB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Reserved `__cam.*` LSDP leaves — surfaced to the host, never rendered.
|
|
2
|
+
//
|
|
3
|
+
// ADR Blue 009 §3.2–3.3 (axe 1, antenne). The meet-cam antenne path needs two
|
|
4
|
+
// pieces of RUNTIME, stream-level ZabCam state that travel on the LSDP wire as
|
|
5
|
+
// RESERVED leaves (they bind to no node and are never painted) :
|
|
6
|
+
//
|
|
7
|
+
// - `__cam.slots.<slotRef>` = "<peer_label>" (Orion #267 deltas, §3.3)
|
|
8
|
+
// which peer currently fills an authored `x-zab.meet-peer` slot.
|
|
9
|
+
// - `__cam.viewer` = { rooms: [{ signalingUrl, roomId, token }] } (Orion #268)
|
|
10
|
+
// the receive-only viewer credentials for the active stream.
|
|
11
|
+
//
|
|
12
|
+
// The runtime does NOT join rooms, hold creds, or re-key slots itself — that is
|
|
13
|
+
// the host's WebRTC viewer (Solar `peer-viewer/*`). The runtime's only job is to
|
|
14
|
+
// SURFACE these reserved leaves to the host through `MountOptions.onReservedLeaves`
|
|
15
|
+
// so Solar can feed `__cam.viewer` into its viewer injection and drive its
|
|
16
|
+
// slot-binding registry's `assign(slotRef, peer_label | null)` from `__cam.slots.*`.
|
|
17
|
+
// Receive-only : the token flows host→viewer→join ; the runtime never reads it.
|
|
18
|
+
/** Every reserved cam leaf lives under this prefix. */
|
|
19
|
+
export const CAM_RESERVED_PREFIX = "__cam.";
|
|
20
|
+
/** One scalar leaf per bound slot : `__cam.slots.<slotRef>` = "<peer_label>"
|
|
21
|
+
* (ADR Blue 009 §3.3). Mirrors Solar's `CAM_SLOTS_PREFIX` — keep them in sync. */
|
|
22
|
+
export const CAM_SLOTS_PREFIX = "__cam.slots.";
|
|
23
|
+
/** The single viewer-credentials leaf (ADR Blue 009 §3.2, Orion #268). */
|
|
24
|
+
export const CAM_VIEWER_LEAF = "__cam.viewer";
|
|
25
|
+
/** A reserved cam leaf the runtime forwards rather than renders. */
|
|
26
|
+
export function isReservedCamPath(path) {
|
|
27
|
+
return path === CAM_VIEWER_LEAF || path.startsWith(CAM_SLOTS_PREFIX);
|
|
28
|
+
}
|
|
29
|
+
/** Project a raw reserved-leaf state into the host-facing shape. Defensive : a
|
|
30
|
+
* malformed slot value (non-string / empty) or empty slotRef is dropped. */
|
|
31
|
+
function project(raw) {
|
|
32
|
+
const slots = {};
|
|
33
|
+
let viewer;
|
|
34
|
+
for (const [path, value] of raw) {
|
|
35
|
+
if (path === CAM_VIEWER_LEAF) {
|
|
36
|
+
if (value !== undefined && value !== null)
|
|
37
|
+
viewer = value;
|
|
38
|
+
}
|
|
39
|
+
else if (path.startsWith(CAM_SLOTS_PREFIX)) {
|
|
40
|
+
const slotRef = path.slice(CAM_SLOTS_PREFIX.length);
|
|
41
|
+
if (slotRef !== "" && typeof value === "string" && value !== "")
|
|
42
|
+
slots[slotRef] = value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return viewer !== undefined ? { viewer, slots } : { slots };
|
|
46
|
+
}
|
|
47
|
+
/** A stable identity key for change detection — two `ReservedCamLeaves` with the
|
|
48
|
+
* same content always produce the same key regardless of insertion order. */
|
|
49
|
+
function identity(leaves) {
|
|
50
|
+
const slots = Object.keys(leaves.slots)
|
|
51
|
+
.sort()
|
|
52
|
+
.map((k) => `${k}=${leaves.slots[k]}`)
|
|
53
|
+
.join("&");
|
|
54
|
+
const viewer = leaves.viewer === undefined ? "" : JSON.stringify(leaves.viewer);
|
|
55
|
+
return `${slots}|${viewer}`;
|
|
56
|
+
}
|
|
57
|
+
/** Track the reserved `__cam.*` leaves across snapshots + deltas and `emit` the
|
|
58
|
+
* host-facing projection whenever it changes (de-duplicated by content, so an
|
|
59
|
+
* unrelated scene's deltas never call back). Created only when the host supplies
|
|
60
|
+
* `onReservedLeaves` — zero cost otherwise. */
|
|
61
|
+
export function createReservedLeafObserver(emit) {
|
|
62
|
+
const raw = new Map();
|
|
63
|
+
// Seed with the empty projection's identity so a plain scene (no cam leaves)
|
|
64
|
+
// never fires a spurious empty emit ; a later transition to/from cam state does.
|
|
65
|
+
let last = identity({ slots: {} });
|
|
66
|
+
const flush = () => {
|
|
67
|
+
const leaves = project(raw);
|
|
68
|
+
const key = identity(leaves);
|
|
69
|
+
if (key === last)
|
|
70
|
+
return;
|
|
71
|
+
last = key;
|
|
72
|
+
emit(leaves);
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
onSnapshot(state) {
|
|
76
|
+
raw.clear();
|
|
77
|
+
for (const [path, value] of Object.entries(state)) {
|
|
78
|
+
if (isReservedCamPath(path))
|
|
79
|
+
raw.set(path, value);
|
|
80
|
+
}
|
|
81
|
+
flush();
|
|
82
|
+
},
|
|
83
|
+
onDelta(patches) {
|
|
84
|
+
let touched = false;
|
|
85
|
+
for (const patch of patches) {
|
|
86
|
+
if (isReservedCamPath(patch.path)) {
|
|
87
|
+
raw.set(patch.path, patch.value);
|
|
88
|
+
touched = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (touched)
|
|
92
|
+
flush();
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=reserved-leaves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reserved-leaves.js","sourceRoot":"","sources":["../../src/state/reserved-leaves.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,iEAAiE;AACjE,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,kFAAkF;AAClF,oEAAoE;AACpE,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,oFAAoF;AACpF,2EAA2E;AAC3E,qFAAqF;AACrF,gFAAgF;AAEhF,uDAAuD;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,Q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B,IAAI,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;oBAClC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;oBACjC,OAAO,GAAG,IAAI,CAAC;gBACjB,CAAC;YACH,CAAC;YACD,IAAI,OAAO;gBAAE,KAAK,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useSignals as g } from "@preact/signals-react/runtime";
|
|
3
|
-
import { u as d } from "./index-
|
|
3
|
+
import { u as d } from "./index-Dz27r92m.js";
|
|
4
4
|
const f = {
|
|
5
5
|
position: "fixed",
|
|
6
6
|
bottom: 12,
|
|
@@ -238,4 +238,4 @@ export {
|
|
|
238
238
|
k as C,
|
|
239
239
|
w as S
|
|
240
240
|
};
|
|
241
|
-
//# sourceMappingURL=status-pill-
|
|
241
|
+
//# sourceMappingURL=status-pill-B2vBTwRC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-pill-elORkMrh.js","sources":["../src/overlay/control.tsx","../src/overlay/status-pill.tsx"],"sourcesContent":["import { useSignals } from \"@preact/signals-react/runtime\";\nimport type { OperatorInput } from \"../render/bundle\";\nimport { useLumencastRuntime } from \"./runtime-context\";\n\nconst PANEL_STYLE: React.CSSProperties = {\n position: \"fixed\",\n bottom: 12,\n left: 12,\n zIndex: 100_000,\n width: 320,\n maxHeight: \"70vh\",\n overflowY: \"auto\",\n padding: 12,\n fontFamily: \"system-ui, -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 12,\n color: \"#e5e7eb\",\n background: \"rgba(17, 24, 39, 0.92)\",\n border: \"1px solid rgba(75, 85, 99, 0.6)\",\n borderRadius: 10,\n boxShadow: \"0 8px 32px rgba(0, 0, 0, 0.45)\",\n};\n\nconst ROW_STYLE: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n padding: \"6px 0\",\n borderBottom: \"1px solid rgba(75, 85, 99, 0.35)\",\n};\n\nconst LABEL_STYLE: React.CSSProperties = {\n color: \"#9ca3af\",\n fontSize: 10.5,\n letterSpacing: \"0.02em\",\n textTransform: \"uppercase\",\n};\n\nconst INPUT_STYLE: React.CSSProperties = {\n background: \"rgba(31, 41, 55, 0.8)\",\n border: \"1px solid rgba(75, 85, 99, 0.6)\",\n borderRadius: 6,\n color: \"#f9fafb\",\n padding: \"4px 6px\",\n fontSize: 12,\n width: \"100%\",\n};\n\nexport function ControlPanel() {\n const { bundle, store, sendInput } = useLumencastRuntime();\n useSignals();\n\n const inputs = bundle.operator_inputs ?? [];\n if (inputs.length === 0) return null;\n\n // Group entries by `group` field for readability.\n const groups = new Map<string, OperatorInput[]>();\n for (const entry of inputs) {\n const g = entry.group ?? \"General\";\n const list = groups.get(g) ?? [];\n list.push(entry);\n groups.set(g, list);\n }\n\n return (\n <div style={PANEL_STYLE} data-testid=\"lumencast-control-panel\">\n <div\n style={{\n fontWeight: 600,\n fontSize: 11,\n letterSpacing: \"0.06em\",\n color: \"#9ca3af\",\n textTransform: \"uppercase\",\n marginBottom: 6,\n }}\n >\n Operator inputs\n </div>\n {[...groups.entries()].map(([group, entries]) => (\n <div key={group} style={{ marginBottom: 8 }}>\n <div\n style={{\n color: \"#6b7280\",\n fontSize: 10,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n padding: \"4px 0\",\n }}\n >\n {group}\n </div>\n {entries.map((entry) => (\n <InputRow\n key={entry.path}\n entry={entry}\n currentValue={store.signal(entry.path).value}\n onCommit={(v) =>\n // Operator-control values come from form widgets typed per\n // OperatorInput.type; coerce to LeafValue at the boundary.\n sendInput([\n {\n path: entry.path,\n value: v as Parameters<typeof sendInput>[0][number][\"value\"],\n },\n ])\n }\n />\n ))}\n </div>\n ))}\n </div>\n );\n}\n\nfunction InputRow({\n entry,\n currentValue,\n onCommit,\n}: {\n entry: OperatorInput;\n currentValue: unknown;\n onCommit: (value: unknown) => void;\n}) {\n return (\n <div style={ROW_STYLE}>\n <span style={LABEL_STYLE}>{entry.label}</span>\n <Editor entry={entry} currentValue={currentValue} onCommit={onCommit} />\n </div>\n );\n}\n\nfunction Editor({\n entry,\n currentValue,\n onCommit,\n}: {\n entry: OperatorInput;\n currentValue: unknown;\n onCommit: (value: unknown) => void;\n}) {\n switch (entry.type) {\n case \"boolean\": {\n const checked = currentValue === true;\n return (\n <label style={{ display: \"flex\", alignItems: \"center\", gap: 6 }}>\n <input type=\"checkbox\" checked={checked} onChange={(e) => onCommit(e.target.checked)} />\n <span style={{ fontSize: 11, color: \"#d1d5db\" }}>{checked ? \"on\" : \"off\"}</span>\n </label>\n );\n }\n case \"number\": {\n const min = entry.min as number | undefined;\n const max = entry.max as number | undefined;\n const step = entry.step as number | undefined;\n return (\n <input\n type=\"number\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"number\" ? currentValue : \"\"}\n min={min}\n max={max}\n step={step}\n onChange={(e) => {\n const n = Number(e.target.value);\n if (Number.isFinite(n)) onCommit(n);\n }}\n />\n );\n }\n case \"text\": {\n const max = entry.max_length as number | undefined;\n return (\n <input\n type=\"text\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"\"}\n maxLength={max}\n onChange={(e) => onCommit(e.target.value)}\n />\n );\n }\n case \"colour\": {\n return (\n <input\n type=\"color\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"#000000\"}\n onChange={(e) => onCommit(e.target.value)}\n />\n );\n }\n case \"duration\": {\n return (\n <input\n type=\"number\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"number\" ? currentValue : \"\"}\n min={0}\n step={100}\n onChange={(e) => {\n const n = Number(e.target.value);\n if (Number.isFinite(n) && n >= 0) onCommit(n);\n }}\n />\n );\n }\n case \"select\":\n case \"enum\": {\n const options =\n (entry.enum_values as string[] | undefined) ??\n (entry.options as string[] | undefined) ??\n [];\n return (\n <select\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"\"}\n onChange={(e) => onCommit(e.target.value)}\n >\n {options.map((opt) => (\n <option key={opt} value={opt}>\n {opt}\n </option>\n ))}\n </select>\n );\n }\n case \"path-ref\":\n default:\n // FIXME (v2) — `path-ref` UX is deferred ; for now show a plain\n // text entry so the value is still editable.\n return (\n <input\n type=\"text\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"\"}\n onChange={(e) => onCommit(e.target.value)}\n />\n );\n }\n}\n","import { useLumencastRuntime } from \"./runtime-context\";\n\nconst COLOURS: Record<string, string> = {\n live: \"rgba(34, 197, 94, 0.85)\",\n connecting: \"rgba(234, 179, 8, 0.85)\",\n disconnected: \"rgba(239, 68, 68, 0.85)\",\n};\n\nconst LABELS: Record<string, string> = {\n live: \"live\",\n connecting: \"reconnecting\",\n disconnected: \"disconnected\",\n};\n\nexport function StatusPill() {\n const { status } = useLumencastRuntime();\n return (\n <div\n data-testid=\"lumencast-status-pill\"\n style={{\n position: \"fixed\",\n top: 12,\n right: 12,\n padding: \"4px 10px\",\n fontSize: 11,\n fontFamily: \"system-ui, -apple-system, BlinkMacSystemFont, sans-serif\",\n color: \"white\",\n background: COLOURS[status] ?? \"#444\",\n borderRadius: 999,\n userSelect: \"none\",\n pointerEvents: \"none\",\n }}\n >\n {LABELS[status] ?? status}\n </div>\n );\n}\n"],"names":["PANEL_STYLE","ROW_STYLE","LABEL_STYLE","INPUT_STYLE","ControlPanel","bundle","store","sendInput","useLumencastRuntime","useSignals","inputs","groups","entry","g","list","jsxs","jsx","group","entries","InputRow","v","currentValue","onCommit","Editor","checked","min","max","step","e","n","options","opt","COLOURS","LABELS","StatusPill","status"],"mappings":";;;AAIA,MAAMA,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;A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EAAA;AACnB,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,OAAO;AAAA,QACL,UAAU;AAAA,QACV,KAAK;AAAA,QACL,OAAO;AAAA,QACP,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,YAAYgB,EAAQG,CAAM,KAAK;AAAA,QAC/B,cAAc;AAAA,QACd,YAAY;AAAA,QACZ,eAAe;AAAA,MAAA;AAAA,MAGhB,UAAAF,EAAOE,CAAM,KAAKA;AAAA,IAAA;AAAA,EAAA;AAGzB;"}
|
|
1
|
+
{"version":3,"file":"status-pill-B2vBTwRC.js","sources":["../src/overlay/control.tsx","../src/overlay/status-pill.tsx"],"sourcesContent":["import { useSignals } from \"@preact/signals-react/runtime\";\nimport type { OperatorInput } from \"../render/bundle\";\nimport { useLumencastRuntime } from \"./runtime-context\";\n\nconst PANEL_STYLE: React.CSSProperties = {\n position: \"fixed\",\n bottom: 12,\n left: 12,\n zIndex: 100_000,\n width: 320,\n maxHeight: \"70vh\",\n overflowY: \"auto\",\n padding: 12,\n fontFamily: \"system-ui, -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 12,\n color: \"#e5e7eb\",\n background: \"rgba(17, 24, 39, 0.92)\",\n border: \"1px solid rgba(75, 85, 99, 0.6)\",\n borderRadius: 10,\n boxShadow: \"0 8px 32px rgba(0, 0, 0, 0.45)\",\n};\n\nconst ROW_STYLE: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n padding: \"6px 0\",\n borderBottom: \"1px solid rgba(75, 85, 99, 0.35)\",\n};\n\nconst LABEL_STYLE: React.CSSProperties = {\n color: \"#9ca3af\",\n fontSize: 10.5,\n letterSpacing: \"0.02em\",\n textTransform: \"uppercase\",\n};\n\nconst INPUT_STYLE: React.CSSProperties = {\n background: \"rgba(31, 41, 55, 0.8)\",\n border: \"1px solid rgba(75, 85, 99, 0.6)\",\n borderRadius: 6,\n color: \"#f9fafb\",\n padding: \"4px 6px\",\n fontSize: 12,\n width: \"100%\",\n};\n\nexport function ControlPanel() {\n const { bundle, store, sendInput } = useLumencastRuntime();\n useSignals();\n\n const inputs = bundle.operator_inputs ?? [];\n if (inputs.length === 0) return null;\n\n // Group entries by `group` field for readability.\n const groups = new Map<string, OperatorInput[]>();\n for (const entry of inputs) {\n const g = entry.group ?? \"General\";\n const list = groups.get(g) ?? [];\n list.push(entry);\n groups.set(g, list);\n }\n\n return (\n <div style={PANEL_STYLE} data-testid=\"lumencast-control-panel\">\n <div\n style={{\n fontWeight: 600,\n fontSize: 11,\n letterSpacing: \"0.06em\",\n color: \"#9ca3af\",\n textTransform: \"uppercase\",\n marginBottom: 6,\n }}\n >\n Operator inputs\n </div>\n {[...groups.entries()].map(([group, entries]) => (\n <div key={group} style={{ marginBottom: 8 }}>\n <div\n style={{\n color: \"#6b7280\",\n fontSize: 10,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n padding: \"4px 0\",\n }}\n >\n {group}\n </div>\n {entries.map((entry) => (\n <InputRow\n key={entry.path}\n entry={entry}\n currentValue={store.signal(entry.path).value}\n onCommit={(v) =>\n // Operator-control values come from form widgets typed per\n // OperatorInput.type; coerce to LeafValue at the boundary.\n sendInput([\n {\n path: entry.path,\n value: v as Parameters<typeof sendInput>[0][number][\"value\"],\n },\n ])\n }\n />\n ))}\n </div>\n ))}\n </div>\n );\n}\n\nfunction InputRow({\n entry,\n currentValue,\n onCommit,\n}: {\n entry: OperatorInput;\n currentValue: unknown;\n onCommit: (value: unknown) => void;\n}) {\n return (\n <div style={ROW_STYLE}>\n <span style={LABEL_STYLE}>{entry.label}</span>\n <Editor entry={entry} currentValue={currentValue} onCommit={onCommit} />\n </div>\n );\n}\n\nfunction Editor({\n entry,\n currentValue,\n onCommit,\n}: {\n entry: OperatorInput;\n currentValue: unknown;\n onCommit: (value: unknown) => void;\n}) {\n switch (entry.type) {\n case \"boolean\": {\n const checked = currentValue === true;\n return (\n <label style={{ display: \"flex\", alignItems: \"center\", gap: 6 }}>\n <input type=\"checkbox\" checked={checked} onChange={(e) => onCommit(e.target.checked)} />\n <span style={{ fontSize: 11, color: \"#d1d5db\" }}>{checked ? \"on\" : \"off\"}</span>\n </label>\n );\n }\n case \"number\": {\n const min = entry.min as number | undefined;\n const max = entry.max as number | undefined;\n const step = entry.step as number | undefined;\n return (\n <input\n type=\"number\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"number\" ? currentValue : \"\"}\n min={min}\n max={max}\n step={step}\n onChange={(e) => {\n const n = Number(e.target.value);\n if (Number.isFinite(n)) onCommit(n);\n }}\n />\n );\n }\n case \"text\": {\n const max = entry.max_length as number | undefined;\n return (\n <input\n type=\"text\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"\"}\n maxLength={max}\n onChange={(e) => onCommit(e.target.value)}\n />\n );\n }\n case \"colour\": {\n return (\n <input\n type=\"color\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"#000000\"}\n onChange={(e) => onCommit(e.target.value)}\n />\n );\n }\n case \"duration\": {\n return (\n <input\n type=\"number\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"number\" ? currentValue : \"\"}\n min={0}\n step={100}\n onChange={(e) => {\n const n = Number(e.target.value);\n if (Number.isFinite(n) && n >= 0) onCommit(n);\n }}\n />\n );\n }\n case \"select\":\n case \"enum\": {\n const options =\n (entry.enum_values as string[] | undefined) ??\n (entry.options as string[] | undefined) ??\n [];\n return (\n <select\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"\"}\n onChange={(e) => onCommit(e.target.value)}\n >\n {options.map((opt) => (\n <option key={opt} value={opt}>\n {opt}\n </option>\n ))}\n </select>\n );\n }\n case \"path-ref\":\n default:\n // FIXME (v2) — `path-ref` UX is deferred ; for now show a plain\n // text entry so the value is still editable.\n return (\n <input\n type=\"text\"\n style={INPUT_STYLE}\n value={typeof currentValue === \"string\" ? currentValue : \"\"}\n onChange={(e) => onCommit(e.target.value)}\n />\n );\n }\n}\n","import { useLumencastRuntime } from \"./runtime-context\";\n\nconst COLOURS: Record<string, string> = {\n live: \"rgba(34, 197, 94, 0.85)\",\n connecting: \"rgba(234, 179, 8, 0.85)\",\n disconnected: \"rgba(239, 68, 68, 0.85)\",\n};\n\nconst LABELS: Record<string, string> = {\n live: \"live\",\n connecting: \"reconnecting\",\n disconnected: \"disconnected\",\n};\n\nexport function StatusPill() {\n const { status } = useLumencastRuntime();\n return (\n <div\n data-testid=\"lumencast-status-pill\"\n style={{\n position: \"fixed\",\n top: 12,\n right: 12,\n padding: \"4px 10px\",\n fontSize: 11,\n fontFamily: \"system-ui, -apple-system, BlinkMacSystemFont, sans-serif\",\n color: \"white\",\n background: COLOURS[status] ?? \"#444\",\n borderRadius: 999,\n userSelect: \"none\",\n pointerEvents: \"none\",\n }}\n >\n {LABELS[status] ?? status}\n </div>\n );\n}\n"],"names":["PANEL_STYLE","ROW_STYLE","LABEL_STYLE","INPUT_STYLE","ControlPanel","bundle","store","sendInput","useLumencastRuntime","useSignals","inputs","groups","entry","g","list","jsxs","jsx","group","entries","InputRow","v","currentValue","onCommit","Editor","checked","min","max","step","e","n","options","opt","COLOURS","LABELS","StatusPill","status"],"mappings":";;;AAIA,MAAMA,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW;AACb,GAEMC,IAAiC;AAAA,EACrC,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AAAA,EACL,SAAS;AAAA,EACT,cAAc;AAChB,GAEMC,IAAmC;AAAA,EACvC,OAAO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A,MAGhB,UAAAF,EAAOE,CAAM,KAAKA;AAAA,IAAA;AAAA,EAAA;AAGzB;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e, Fragment as y } from "react/jsx-runtime";
|
|
2
|
-
import { A as b, T as h, r as x } from "./tree-
|
|
3
|
-
import { S, C as k } from "./status-pill-
|
|
2
|
+
import { A as b, T as h, r as x } from "./tree-CgU_sUwI.js";
|
|
3
|
+
import { S, C as k } from "./status-pill-B2vBTwRC.js";
|
|
4
4
|
import { useSignals as v } from "@preact/signals-react/runtime";
|
|
5
5
|
import { useState as f } from "react";
|
|
6
|
-
import { u } from "./index-
|
|
6
|
+
import { u } from "./index-Dz27r92m.js";
|
|
7
7
|
const T = {
|
|
8
8
|
position: "fixed",
|
|
9
9
|
bottom: 12,
|
|
@@ -207,4 +207,4 @@ function F() {
|
|
|
207
207
|
export {
|
|
208
208
|
F as TestMode
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=test-
|
|
210
|
+
//# sourceMappingURL=test-DD2SBDku.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-7q_KJkdX.js","sources":["../src/overlay/test.tsx","../src/modes/test.tsx"],"sourcesContent":["import { useSignals } from \"@preact/signals-react/runtime\";\nimport { useState } from \"react\";\nimport { useLumencastRuntime } from \"./runtime-context\";\n\nconst PANEL_STYLE: React.CSSProperties = {\n position: \"fixed\",\n bottom: 12,\n right: 12,\n zIndex: 100_001,\n width: 360,\n maxHeight: \"70vh\",\n overflowY: \"auto\",\n padding: 12,\n fontFamily: \"system-ui, -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 12,\n color: \"#e5e7eb\",\n background: \"rgba(8, 47, 73, 0.92)\",\n border: \"1px solid rgba(56, 189, 248, 0.4)\",\n borderRadius: 10,\n boxShadow: \"0 8px 32px rgba(0, 0, 0, 0.45)\",\n};\n\nconst SECTION_TITLE: React.CSSProperties = {\n fontWeight: 600,\n fontSize: 11,\n letterSpacing: \"0.06em\",\n color: \"#7dd3fc\",\n textTransform: \"uppercase\",\n marginBottom: 6,\n};\n\nconst BUTTON_STYLE: React.CSSProperties = {\n background: \"rgba(14, 165, 233, 0.4)\",\n border: \"1px solid rgba(125, 211, 252, 0.5)\",\n borderRadius: 6,\n color: \"#f0f9ff\",\n padding: \"3px 8px\",\n fontSize: 11,\n cursor: \"pointer\",\n};\n\nconst ADAPTER_ROW: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n padding: \"6px 0\",\n borderBottom: \"1px solid rgba(56, 189, 248, 0.2)\",\n};\n\n/** Test-mode overlay : adapter mocker + state inspector + time\n * controls. Drives the server's __test.* family via the same `sendInput`\n * channel. */\nexport function TestPanel() {\n const { bundle, store, sendInput } = useLumencastRuntime();\n useSignals();\n const [filter, setFilter] = useState(\"\");\n\n const adapters = bundle.external_adapters ?? [];\n const stateRecord = store.toRecord();\n const filteredEntries = Object.entries(stateRecord).filter(\n ([k]) => filter === \"\" || k.includes(filter),\n );\n\n return (\n <div style={PANEL_STYLE} data-testid=\"lumencast-test-panel\">\n {/* Time controls */}\n <div style={SECTION_TITLE}>Time</div>\n <div style={{ display: \"flex\", gap: 6, marginBottom: 8 }}>\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => sendInput([{ path: \"__test.tick\", value: 100 }])}\n >\n tick +100ms\n </button>\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => sendInput([{ path: \"__test.tick\", value: 1_000 }])}\n >\n tick +1s\n </button>\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => sendInput([{ path: \"__test.reset\", value: true }])}\n >\n reset\n </button>\n </div>\n\n {/* Adapter mocker */}\n <div style={SECTION_TITLE}>External adapters</div>\n {adapters.length === 0 && (\n <div style={{ color: \"#94a3b8\", fontStyle: \"italic\", fontSize: 11 }}>\n No external adapters declared in this scene.\n </div>\n )}\n {adapters.map((adapter) => (\n <AdapterRow\n key={adapter.key}\n adapter={adapter}\n onMock={(payload) =>\n // LSDP/1 patch values must be leaf — JSON-encode the structured payload.\n sendInput([\n {\n path: \"__test.mock_adapter\",\n value: JSON.stringify({ key: adapter.key, payload }),\n },\n ])\n }\n />\n ))}\n\n {/* State inspector */}\n <div style={{ ...SECTION_TITLE, marginTop: 12 }}>State</div>\n <input\n type=\"text\"\n placeholder=\"filter paths…\"\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n style={{\n background: \"rgba(8, 47, 73, 0.6)\",\n border: \"1px solid rgba(125, 211, 252, 0.4)\",\n borderRadius: 6,\n color: \"#e0f2fe\",\n padding: \"4px 6px\",\n fontSize: 11,\n width: \"100%\",\n marginBottom: 6,\n }}\n />\n <div style={{ fontFamily: \"monospace\", fontSize: 10.5 }}>\n {filteredEntries.map(([path, value]) => (\n <div\n key={path}\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr auto\",\n gap: 8,\n padding: \"2px 0\",\n borderBottom: \"1px dashed rgba(125, 211, 252, 0.15)\",\n }}\n >\n <span style={{ color: \"#bae6fd\" }}>{path}</span>\n <span style={{ color: \"#fef3c7\" }}>{formatValue(value)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nfunction AdapterRow({\n adapter,\n onMock,\n}: {\n adapter: { key: string; label: string; kind: string };\n onMock: (payload: unknown) => void;\n}) {\n const [draft, setDraft] = useState(\"{}\");\n return (\n <div style={ADAPTER_ROW}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <span style={{ color: \"#e0f2fe\" }}>{adapter.label}</span>\n <span style={{ color: \"#94a3b8\", fontSize: 10 }}>{adapter.kind}</span>\n </div>\n <textarea\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n rows={2}\n style={{\n fontFamily: \"monospace\",\n fontSize: 10.5,\n background: \"rgba(8, 47, 73, 0.6)\",\n color: \"#e0f2fe\",\n border: \"1px solid rgba(125, 211, 252, 0.3)\",\n borderRadius: 4,\n padding: 4,\n resize: \"vertical\",\n }}\n />\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => {\n try {\n const parsed = JSON.parse(draft);\n onMock(parsed);\n } catch {\n onMock(draft);\n }\n }}\n >\n fire\n </button>\n </div>\n );\n}\n\nfunction formatValue(value: unknown): string {\n if (value === undefined) return \"—\";\n if (value === null) return \"null\";\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"object\") return JSON.stringify(value);\n return String(value);\n}\n","import { Tree } from \"../render/tree\";\nimport { AllowedHostsProvider, readAllowedHosts } from \"../render/allowed-hosts\";\nimport { ControlPanel } from \"../overlay/control\";\nimport { TestPanel } from \"../overlay/test\";\nimport { StatusPill } from \"../overlay/status-pill\";\nimport { useLumencastRuntime } from \"../overlay/runtime-context\";\n\n/** Test mode : scene + operator overlay + test extensions (adapter\n * mocker, state inspector, time controls). */\nexport function TestMode() {\n const { store, bundle } = useLumencastRuntime();\n return (\n <>\n <AllowedHostsProvider hosts={readAllowedHosts(bundle)}>\n <Tree node={bundle.root} store={store} />\n </AllowedHostsProvider>\n <StatusPill />\n <ControlPanel />\n <TestPanel />\n </>\n );\n}\n"],"names":["PANEL_STYLE","SECTION_TITLE","BUTTON_STYLE","ADAPTER_ROW","TestPanel","bundle","store","sendInput","useLumencastRuntime","useSignals","filter","setFilter","useState","adapters","stateRecord","filteredEntries","k","jsxs","jsx","adapter","AdapterRow","payload","e","path","value","formatValue","onMock","draft","setDraft","parsed","TestMode","Fragment","AllowedHostsProvider","readAllowedHosts","Tree","StatusPill","ControlPanel"],"mappings":";;;;;;AAIA,MAAMA,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,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esContent":["import { useSignals } from \"@preact/signals-react/runtime\";\nimport { useState } from \"react\";\nimport { useLumencastRuntime } from \"./runtime-context\";\n\nconst PANEL_STYLE: React.CSSProperties = {\n position: \"fixed\",\n bottom: 12,\n right: 12,\n zIndex: 100_001,\n width: 360,\n maxHeight: \"70vh\",\n overflowY: \"auto\",\n padding: 12,\n fontFamily: \"system-ui, -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 12,\n color: \"#e5e7eb\",\n background: \"rgba(8, 47, 73, 0.92)\",\n border: \"1px solid rgba(56, 189, 248, 0.4)\",\n borderRadius: 10,\n boxShadow: \"0 8px 32px rgba(0, 0, 0, 0.45)\",\n};\n\nconst SECTION_TITLE: React.CSSProperties = {\n fontWeight: 600,\n fontSize: 11,\n letterSpacing: \"0.06em\",\n color: \"#7dd3fc\",\n textTransform: \"uppercase\",\n marginBottom: 6,\n};\n\nconst BUTTON_STYLE: React.CSSProperties = {\n background: \"rgba(14, 165, 233, 0.4)\",\n border: \"1px solid rgba(125, 211, 252, 0.5)\",\n borderRadius: 6,\n color: \"#f0f9ff\",\n padding: \"3px 8px\",\n fontSize: 11,\n cursor: \"pointer\",\n};\n\nconst ADAPTER_ROW: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n padding: \"6px 0\",\n borderBottom: \"1px solid rgba(56, 189, 248, 0.2)\",\n};\n\n/** Test-mode overlay : adapter mocker + state inspector + time\n * controls. Drives the server's __test.* family via the same `sendInput`\n * channel. */\nexport function TestPanel() {\n const { bundle, store, sendInput } = useLumencastRuntime();\n useSignals();\n const [filter, setFilter] = useState(\"\");\n\n const adapters = bundle.external_adapters ?? [];\n const stateRecord = store.toRecord();\n const filteredEntries = Object.entries(stateRecord).filter(\n ([k]) => filter === \"\" || k.includes(filter),\n );\n\n return (\n <div style={PANEL_STYLE} data-testid=\"lumencast-test-panel\">\n {/* Time controls */}\n <div style={SECTION_TITLE}>Time</div>\n <div style={{ display: \"flex\", gap: 6, marginBottom: 8 }}>\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => sendInput([{ path: \"__test.tick\", value: 100 }])}\n >\n tick +100ms\n </button>\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => sendInput([{ path: \"__test.tick\", value: 1_000 }])}\n >\n tick +1s\n </button>\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => sendInput([{ path: \"__test.reset\", value: true }])}\n >\n reset\n </button>\n </div>\n\n {/* Adapter mocker */}\n <div style={SECTION_TITLE}>External adapters</div>\n {adapters.length === 0 && (\n <div style={{ color: \"#94a3b8\", fontStyle: \"italic\", fontSize: 11 }}>\n No external adapters declared in this scene.\n </div>\n )}\n {adapters.map((adapter) => (\n <AdapterRow\n key={adapter.key}\n adapter={adapter}\n onMock={(payload) =>\n // LSDP/1 patch values must be leaf — JSON-encode the structured payload.\n sendInput([\n {\n path: \"__test.mock_adapter\",\n value: JSON.stringify({ key: adapter.key, payload }),\n },\n ])\n }\n />\n ))}\n\n {/* State inspector */}\n <div style={{ ...SECTION_TITLE, marginTop: 12 }}>State</div>\n <input\n type=\"text\"\n placeholder=\"filter paths…\"\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n style={{\n background: \"rgba(8, 47, 73, 0.6)\",\n border: \"1px solid rgba(125, 211, 252, 0.4)\",\n borderRadius: 6,\n color: \"#e0f2fe\",\n padding: \"4px 6px\",\n fontSize: 11,\n width: \"100%\",\n marginBottom: 6,\n }}\n />\n <div style={{ fontFamily: \"monospace\", fontSize: 10.5 }}>\n {filteredEntries.map(([path, value]) => (\n <div\n key={path}\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr auto\",\n gap: 8,\n padding: \"2px 0\",\n borderBottom: \"1px dashed rgba(125, 211, 252, 0.15)\",\n }}\n >\n <span style={{ color: \"#bae6fd\" }}>{path}</span>\n <span style={{ color: \"#fef3c7\" }}>{formatValue(value)}</span>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nfunction AdapterRow({\n adapter,\n onMock,\n}: {\n adapter: { key: string; label: string; kind: string };\n onMock: (payload: unknown) => void;\n}) {\n const [draft, setDraft] = useState(\"{}\");\n return (\n <div style={ADAPTER_ROW}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <span style={{ color: \"#e0f2fe\" }}>{adapter.label}</span>\n <span style={{ color: \"#94a3b8\", fontSize: 10 }}>{adapter.kind}</span>\n </div>\n <textarea\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n rows={2}\n style={{\n fontFamily: \"monospace\",\n fontSize: 10.5,\n background: \"rgba(8, 47, 73, 0.6)\",\n color: \"#e0f2fe\",\n border: \"1px solid rgba(125, 211, 252, 0.3)\",\n borderRadius: 4,\n padding: 4,\n resize: \"vertical\",\n }}\n />\n <button\n type=\"button\"\n style={BUTTON_STYLE}\n onClick={() => {\n try {\n const parsed = JSON.parse(draft);\n onMock(parsed);\n } catch {\n onMock(draft);\n }\n }}\n >\n fire\n </button>\n </div>\n );\n}\n\nfunction formatValue(value: unknown): string {\n if (value === undefined) return \"—\";\n if (value === null) return \"null\";\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"object\") return JSON.stringify(value);\n return String(value);\n}\n","import { Tree } from \"../render/tree\";\nimport { AllowedHostsProvider, readAllowedHosts } from \"../render/allowed-hosts\";\nimport { ControlPanel } from \"../overlay/control\";\nimport { TestPanel } from \"../overlay/test\";\nimport { StatusPill } from \"../overlay/status-pill\";\nimport { useLumencastRuntime } from \"../overlay/runtime-context\";\n\n/** Test mode : scene + operator overlay + test extensions (adapter\n * mocker, state inspector, time controls). */\nexport function TestMode() {\n const { store, bundle } = useLumencastRuntime();\n return (\n <>\n <AllowedHostsProvider hosts={readAllowedHosts(bundle)}>\n <Tree node={bundle.root} store={store} />\n </AllowedHostsProvider>\n <StatusPill />\n <ControlPanel />\n <TestPanel />\n </>\n );\n}\n"],"names":["PANEL_STYLE","SECTION_TITLE","BUTTON_STYLE","ADAPTER_ROW","TestPanel","bundle","store","sendInput","useLumencastRuntime","useSignals","filter","setFilter","useState","adapters","stateRecord","filteredEntries","k","jsxs","jsx","adapter","AdapterRow","payload","e","path","value","formatValue","onMock","draft","setDraft","parsed","TestMode","Fragment","AllowedHostsProvider","readAllowedHosts","Tree","StatusPill","ControlPanel"],"mappings":";;;;;;AAIA,MAAMA,IAAmC;AAAA,EACvC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW;AACb,GAEMC,IAAqC;AAAA,EACzC,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;AAAA,EACf,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAChB,GAEMC,IAAoC;AAAA,EACxC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU;AAAA,EACV,QAAQ;AACV,GAEMC,IAAmC;AAAA,EACvC,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AAAA,EACL,SAAS;AAAA,EACT,cAAc;AAChB;AAKO,SAASC,IAAY;AAC1B,QAAM,EAAE,QAAAC,GAAQ,OAAAC,GAAO,WAAAC,EAAA,IAAcC,EAAA;AACrC,EAAAC,EAAA;AACA,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAE,GAEjCC,IAAWR,EAAO,qBAAqB,CAAA,GACvCS,IAAcR,EAAM,SAAA,GACpBS,IAAkB,OAAO,QAAQD,CAAW,EAAE;AAAA,IAClD,CAAC,CAACE,CAAC,MAAMN,MAAW,MAAMM,EAAE,SAASN,CAAM;AAAA,EAAA;AAG7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