@camstack/addon-pipeline-orchestrator 1.2.64 → 1.2.66

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 (26) hide show
  1. package/assets/viewer/.viewer-current-files.json +11 -10
  2. package/assets/viewer/.viewer-version +1 -1
  3. package/assets/viewer/_expo/static/js/web/Clipboard-0de83d25768ad5af2aa33d2858d83638.js +8 -0
  4. package/assets/viewer/_expo/static/js/web/Haptics-fc5b9db6f144e63fd742618db6f23bb8.js +3 -0
  5. package/assets/viewer/_expo/static/js/web/{index-5080cd1b37a92fc9034b33e20134f1b0.js → index-ef0f9d402a53662b09bb594aa7222841.js} +139 -138
  6. package/assets/viewer/_expo/static/js/web/node-fs-33281f3c9929e9f695e881b6abfd574f.js +1 -0
  7. package/assets/viewer/_expo/static/js/web/node-path-3c2a6f6de5615b09b01d834d2153bbbd.js +1 -0
  8. package/assets/viewer/embed/assets/{MaskShapeCanvas-DI4BY7W2-xjPWPmCZ.js → MaskShapeCanvas-DI4BY7W2-Cee4KLmI.js} +1 -1
  9. package/assets/viewer/embed/assets/{MotionZonesSettings-NcxxQN8r-DYLpogPU.js → MotionZonesSettings-DNdnFHso-Crci_Kb6.js} +1 -1
  10. package/assets/viewer/embed/assets/PrivacyMaskSettings-DNSLc6ww-dRxFQi14.js +1 -0
  11. package/assets/viewer/embed/assets/SceneMonitorEditor-d_A4kO-M-CxXeVgv-.js +1 -0
  12. package/assets/viewer/embed/assets/index-CK6ZA4Bu.js +115 -0
  13. package/assets/viewer/embed/assets/index-CyhdNw82.css +1 -0
  14. package/assets/viewer/embed/index.html +2 -2
  15. package/assets/viewer/index.html +1 -1
  16. package/dist/_stub.js +1 -1
  17. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-D_S9bGZ-.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-DBSCwGMG.mjs} +3 -3
  18. package/dist/{_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DRp3PbOu.mjs → _virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CbIQ4mVS.mjs} +1 -1
  19. package/dist/{hostInit-nc6Xs4Ci.mjs → hostInit-TCsGV6tN.mjs} +3 -3
  20. package/dist/index.js +44 -2
  21. package/dist/index.mjs +44 -2
  22. package/dist/remoteEntry.js +1 -1
  23. package/package.json +1 -1
  24. package/assets/viewer/embed/assets/PrivacyMaskSettings-APgPLF7p-B5FCvu8Y.js +0 -1
  25. package/assets/viewer/embed/assets/index-Bxt7VgaT.js +0 -115
  26. package/assets/viewer/embed/assets/index-CmFMOd7A.css +0 -1
package/dist/index.js CHANGED
@@ -20651,7 +20651,31 @@ DeviceType.Camera, method(object({
20651
20651
  lastCapturedAt: number().nullable(),
20652
20652
  cacheAgeMs: number().nullable(),
20653
20653
  etag: string().nullable()
20654
- }))), systemMethod(object({
20654
+ }))), systemMethod(object({ deviceId: number() }), object({
20655
+ /** The battery slice as read, or null when the device has none. */
20656
+ battery: object({
20657
+ sleeping: boolean(),
20658
+ lastUpdated: number(),
20659
+ lastContactAt: number().optional()
20660
+ }).nullable(),
20661
+ /** The resolved snapshot state (what the overlay decision used). */
20662
+ state: object({
20663
+ isBattery: boolean(),
20664
+ reason: _enum([
20665
+ "disabled",
20666
+ "sleeping",
20667
+ "unreachable",
20668
+ "waking"
20669
+ ]).nullable()
20670
+ }),
20671
+ /** The cached frame behind the next paint. */
20672
+ frame: object({
20673
+ capturedAt: number().nullable(),
20674
+ ageMs: number().nullable()
20675
+ }),
20676
+ /** A wake window is currently open (the Waking overlay's source). */
20677
+ waking: boolean()
20678
+ })), systemMethod(object({
20655
20679
  /** The tiles a surface is actually rendering. One entry per (device,
20656
20680
  * width) the caller will paint — the width is snapped to the server's
20657
20681
  * ladder and becomes part of the link's SIGNED identity. */
@@ -20690,7 +20714,14 @@ targets: array(object({
20690
20714
  "sleeping",
20691
20715
  "unreachable",
20692
20716
  "waking"
20693
- ]).nullable()
20717
+ ]).nullable(),
20718
+ /** A battery camera (whatever its current state). An AWAKE battery
20719
+ * camera is deliberately NOT recaptured on the poll cadence — every
20720
+ * capture is a camera hit that would keep it out of sleep — so its
20721
+ * cached frame legitimately ages past the currency ceiling while
20722
+ * nothing is streaming. A surface must keep painting it (a fresh
20723
+ * frame is captured at each wake), not blank to "unavailable". */
20724
+ battery: boolean()
20694
20725
  })));
20695
20726
  /**
20696
20727
  * `sso-bridge` — internal hub-only cap that lets SSO-style auth
@@ -31950,6 +31981,12 @@ Object.freeze({
31950
31981
  addonId: null,
31951
31982
  access: "view"
31952
31983
  },
31984
+ "snapshot.getDebugState": {
31985
+ capName: "snapshot",
31986
+ capScope: "device",
31987
+ addonId: null,
31988
+ access: "view"
31989
+ },
31953
31990
  "snapshot.getSnapshot": {
31954
31991
  capName: "snapshot",
31955
31992
  capScope: "device",
@@ -34547,6 +34584,11 @@ Object.freeze({
34547
34584
  form: "single",
34548
34585
  optional: false
34549
34586
  }],
34587
+ "snapshot.getDebugState": [{
34588
+ name: "deviceId",
34589
+ form: "single",
34590
+ optional: false
34591
+ }],
34550
34592
  "snapshot.getSnapshot": [{
34551
34593
  name: "deviceId",
34552
34594
  form: "single",
package/dist/index.mjs CHANGED
@@ -20623,7 +20623,31 @@ DeviceType.Camera, method(object({
20623
20623
  lastCapturedAt: number().nullable(),
20624
20624
  cacheAgeMs: number().nullable(),
20625
20625
  etag: string().nullable()
20626
- }))), systemMethod(object({
20626
+ }))), systemMethod(object({ deviceId: number() }), object({
20627
+ /** The battery slice as read, or null when the device has none. */
20628
+ battery: object({
20629
+ sleeping: boolean(),
20630
+ lastUpdated: number(),
20631
+ lastContactAt: number().optional()
20632
+ }).nullable(),
20633
+ /** The resolved snapshot state (what the overlay decision used). */
20634
+ state: object({
20635
+ isBattery: boolean(),
20636
+ reason: _enum([
20637
+ "disabled",
20638
+ "sleeping",
20639
+ "unreachable",
20640
+ "waking"
20641
+ ]).nullable()
20642
+ }),
20643
+ /** The cached frame behind the next paint. */
20644
+ frame: object({
20645
+ capturedAt: number().nullable(),
20646
+ ageMs: number().nullable()
20647
+ }),
20648
+ /** A wake window is currently open (the Waking overlay's source). */
20649
+ waking: boolean()
20650
+ })), systemMethod(object({
20627
20651
  /** The tiles a surface is actually rendering. One entry per (device,
20628
20652
  * width) the caller will paint — the width is snapped to the server's
20629
20653
  * ladder and becomes part of the link's SIGNED identity. */
@@ -20662,7 +20686,14 @@ targets: array(object({
20662
20686
  "sleeping",
20663
20687
  "unreachable",
20664
20688
  "waking"
20665
- ]).nullable()
20689
+ ]).nullable(),
20690
+ /** A battery camera (whatever its current state). An AWAKE battery
20691
+ * camera is deliberately NOT recaptured on the poll cadence — every
20692
+ * capture is a camera hit that would keep it out of sleep — so its
20693
+ * cached frame legitimately ages past the currency ceiling while
20694
+ * nothing is streaming. A surface must keep painting it (a fresh
20695
+ * frame is captured at each wake), not blank to "unavailable". */
20696
+ battery: boolean()
20666
20697
  })));
20667
20698
  /**
20668
20699
  * `sso-bridge` — internal hub-only cap that lets SSO-style auth
@@ -31922,6 +31953,12 @@ Object.freeze({
31922
31953
  addonId: null,
31923
31954
  access: "view"
31924
31955
  },
31956
+ "snapshot.getDebugState": {
31957
+ capName: "snapshot",
31958
+ capScope: "device",
31959
+ addonId: null,
31960
+ access: "view"
31961
+ },
31925
31962
  "snapshot.getSnapshot": {
31926
31963
  capName: "snapshot",
31927
31964
  capScope: "device",
@@ -34519,6 +34556,11 @@ Object.freeze({
34519
34556
  form: "single",
34520
34557
  optional: false
34521
34558
  }],
34559
+ "snapshot.getDebugState": [{
34560
+ name: "deviceId",
34561
+ form: "single",
34562
+ optional: false
34563
+ }],
34522
34564
  "snapshot.getSnapshot": [{
34523
34565
  name: "deviceId",
34524
34566
  form: "single",
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-D_S9bGZ-.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-DBSCwGMG.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-pipeline-orchestrator",
3
- "version": "1.2.64",
3
+ "version": "1.2.66",
4
4
  "description": "Hub-side camera-to-agent load balancer — tracks runner capacity and dispatches attachCamera calls to the optimal pipeline-runner instance",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1 +0,0 @@
1
- import{u as G,a as Q,r as s,i as ee,b as te,j as t,W as se,T as N,S as ne,d as ae,E as re,c as oe}from"./index-Bxt7VgaT.js";import{MaskShapeCanvas as le}from"./MaskShapeCanvas-DI4BY7W2-xjPWPmCZ.js";var ie=oe("hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]),de=120,ce="privacy-mask",C="rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",y="rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";function Y(i){return i.kind==="rect"||i.kind==="polygon"?i:null}function ue(i){const l=new Set(i.map(k=>k.id));let a=0;for(;l.has(a);)a+=1;return a}function ge(i,l){if(i.length!==l.length)return!1;for(let a=0;a<i.length;a+=1)if(JSON.stringify(i[a])!==JSON.stringify(l[a]))return!1;return!0}function fe({deviceId:i}){const l=G(Q().trpcClient,i),[a,k]=s.useState(null),[v,P]=s.useState(!1),[r,u]=s.useState(null),[g,R]=s.useState(null),[c,z]=s.useState(!1),[x,S]=s.useState(!1),[M,p]=s.useState(null),[b,f]=s.useState(null),w=s.useRef(!1);s.useEffect(()=>{if(!l)return;let e=!1;return w.current=!1,k(null),P(!1),u(null),R(null),S(!1),p(null),f(null),(async()=>{try{const n=await l.privacyMask?.getOptions({});if(e)return;if(!n)throw new Error("device proxy not ready");if(k(n),w.current)return;const o=await l.privacyMask?.getStatus({});if(e)return;if(!o)throw new Error("device proxy not ready");w.current=!0;const d={enabled:o.enabled,regions:o.regions};R(d),u(d)}catch(n){if(e)return;ee(n)?P(!0):console.error("Privacy Mask load failed",n)}})(),()=>{e=!0}},[l]);const A=s.useMemo(()=>r!==null&&g!==null&&(r.enabled!==g.enabled||!ge(r.regions,g.regions)),[r,g]),E=r?r.regions.length:0,h=a?a.maxRegions:0,D=s.useRef(0);s.useEffect(()=>{D.current=h},[h]);const j=h>0&&E>=h,K=s.useCallback(()=>{u(e=>e&&{...e,enabled:!e.enabled})},[]),T=s.useCallback(e=>{p(typeof e=="number"?e:null)},[]),I=s.useMemo(()=>r?r.regions.map(e=>({id:e.id,shape:e.shape,enabled:e.enabled,label:`Zone ${String(e.id)}`})):[],[r]),O=s.useCallback((e,n)=>{const o=Y(n);o&&u(d=>d&&{...d,regions:d.regions.map(m=>m.id===e?{...m,shape:o}:m)})},[]),_=s.useCallback(e=>{const n=Y(e);n&&(f(null),u(o=>{if(!o)return o;const d=D.current;if(d>0&&o.regions.length>=d)return o;const m=ue(o.regions),X={id:m,enabled:!0,shape:n};return p(m),{...o,regions:[...o.regions,X]}}))},[]),$=s.useCallback(e=>{S(!0),p(null),f(e)},[]),q=s.useCallback(e=>{S(!0),f(null),p(e)},[]),B=s.useCallback(e=>{p(n=>n===e?null:n),u(n=>n&&{...n,regions:n.regions.filter(o=>o.id!==e)})},[]),H=s.useCallback(()=>{f(null),p(null),g&&u({enabled:g.enabled,regions:g.regions})},[g]),J=s.useCallback(async()=>{if(!(!l||!r)){z(!0);try{await l.privacyMask?.setMask({patch:{enabled:r.enabled,regions:[...r.regions]}});const e=await l.privacyMask?.getStatus({});if(e){const n={enabled:e.enabled,regions:e.regions};R(n),u(n)}}catch(e){console.error("Privacy Mask save failed",e)}finally{z(!1)}}},[l,r]),U=s.useCallback(()=>{S(e=>(e&&(f(null),p(null)),!e))},[]),L=a?.supportedShapes??[];te(s.useMemo(()=>x&&!v&&a&&r?{id:ce,order:de,node:t.jsx(le,{transparent:!0,items:I,supportedShapes:L,polygonVertices:a.polygonVertices,selectedId:M,onSelect:T,onShapeChange:O,onDrawComplete:_,drawingKind:b})}:null,[x,v,a,r,I,L,M,T,O,_,b]));const W=a?.supportedShapes.includes("rect")??!1,Z=a?.supportedShapes.includes("polygon")??!1,V=a!==null&&(a.maxRegions<=0||a.supportedShapes.length===0),F=!v&&!V&&a!==null&&r!==null;return l?t.jsx(se,{title:"Privacy Mask",icon:t.jsx(re,{className:"h-3.5 w-3.5 text-foreground-subtle"}),children:t.jsx("div",{className:"flex flex-col gap-3",children:v||V?t.jsx("p",{className:`${N} leading-relaxed`,children:"This camera doesn't support an on-board privacy mask."}):F?t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:`${N} leading-relaxed`,children:["Toggle ",t.jsx("strong",{className:"text-foreground",children:"Edit mask"})," to draw blanked-out zones on the live frame, then ",t.jsx("strong",{className:"text-foreground",children:"Save"})," to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it."]}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("button",{type:"button",onClick:U,disabled:c,"aria-pressed":x,className:x?y:C,children:x?"Done editing":"Edit mask"}),t.jsx("button",{type:"button",onClick:K,disabled:c,"aria-pressed":r.enabled,className:r.enabled?y:C,children:r.enabled?"Mask on":"Mask off"}),W&&t.jsx("button",{type:"button",onClick:()=>$("rect"),disabled:c||j,"aria-pressed":b==="rect",className:b==="rect"?y:C,title:j?"Maximum zones reached":"Add a rectangle zone",children:"+ Rect"}),Z&&t.jsx("button",{type:"button",onClick:()=>$("polygon"),disabled:c||j,"aria-pressed":b==="polygon",className:b==="polygon"?y:C,title:j?"Maximum zones reached":"Add a polygon zone",children:"+ Polygon"}),t.jsxs("span",{className:`${N} ml-1 tabular-nums`,children:[E," / ",h," zones"]}),t.jsx("span",{className:"flex-1"}),t.jsx("button",{type:"button",onClick:H,disabled:c||!A,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"Revert"}),t.jsx("button",{type:"button",onClick:()=>{J()},disabled:c||!A,className:y,children:c?"Saving…":"Save"})]}),E>0?t.jsx("div",{className:"flex flex-col gap-1",children:r.regions.map(e=>{const n=M===e.id,o=e.shape.kind==="polygon"?ie:ne;return t.jsxs("div",{className:`flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${n?"border-primary/50 bg-primary/10":"border-border bg-surface"}`,children:[t.jsxs("button",{type:"button",onClick:()=>q(e.id),disabled:c,className:"flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors",children:[t.jsx(o,{className:"h-3.5 w-3.5 shrink-0"}),t.jsxs("span",{children:["Zone ",e.id]}),t.jsx("span",{className:"text-foreground-faint capitalize",children:e.shape.kind})]}),t.jsx("button",{type:"button",onClick:()=>B(e.id),disabled:c,"aria-label":`Delete zone ${String(e.id)}`,title:"Delete zone",className:"inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors",children:t.jsx(ae,{className:"h-3.5 w-3.5"})})]},e.id)})}):null]}):t.jsx("p",{className:`${N} leading-relaxed`,children:"Loading the camera's privacy mask…"})})}):null}export{fe as PrivacyMaskSettings};