@camstack/system 1.2.367 → 1.2.369

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 (67) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/addon-utils.js +1 -1
  4. package/dist/addon-utils.mjs +1 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/dist/builtins/autotrack/index.js +1 -1
  12. package/dist/builtins/autotrack/index.mjs +1 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  15. package/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/dist/builtins/camera-grid/index.js +1 -1
  18. package/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/dist/builtins/composer/composer.addon.js +2 -2
  20. package/dist/builtins/composer/composer.addon.mjs +2 -2
  21. package/dist/builtins/console-logging/index.js +1 -1
  22. package/dist/builtins/console-logging/index.mjs +1 -1
  23. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  24. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  25. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  26. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  27. package/dist/builtins/hub-forwarder/index.js +1 -1
  28. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  29. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  30. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  31. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  32. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  33. package/dist/builtins/local-network/local-network.addon.js +1 -1
  34. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  35. package/dist/builtins/loki-logging/index.js +1 -1
  36. package/dist/builtins/loki-logging/index.mjs +1 -1
  37. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  38. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  39. package/dist/builtins/platform-probe/index.js +1 -1
  40. package/dist/builtins/platform-probe/index.mjs +1 -1
  41. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  42. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  43. package/dist/builtins/snapshot/index.js +1 -1
  44. package/dist/builtins/snapshot/index.mjs +1 -1
  45. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  46. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  47. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  48. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  49. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  50. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  51. package/dist/builtins/system-config/system-config.addon.js +1 -1
  52. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  53. package/dist/builtins/winston-logging/index.js +1 -1
  54. package/dist/builtins/winston-logging/index.mjs +1 -1
  55. package/dist/{child-cap-dispatch-DxV4uO5r.mjs → child-cap-dispatch-BN_zwf_k.mjs} +1 -1
  56. package/dist/{child-cap-dispatch-D39k_fJX.js → child-cap-dispatch-BX2qNzid.js} +1 -1
  57. package/dist/{composition-sources-D8zoyjU2.mjs → composition-sources-DT6MCBGC.mjs} +1 -1
  58. package/dist/{composition-sources-B4ZDN0eX.js → composition-sources-DVR7AckV.js} +1 -1
  59. package/dist/{dist-BK15O90l.js → dist-BPFp08uY.js} +281 -150
  60. package/dist/{dist-CeGOZBrL.mjs → dist-DUQvCQhx.mjs} +281 -150
  61. package/dist/{event-loop-stall-monitor-CkyaRbMu.js → event-loop-stall-monitor-D4xK0sS_.js} +1 -1
  62. package/dist/{event-loop-stall-monitor-BCYVajJg.mjs → event-loop-stall-monitor-Dbf6C7qt.mjs} +1 -1
  63. package/dist/index.js +3 -3
  64. package/dist/index.mjs +3 -3
  65. package/dist/{retired-settings-keys-CKok9c60.mjs → retired-settings-keys-0j5pPZBx.mjs} +1 -1
  66. package/dist/{retired-settings-keys-Qu7fGRU2.js → retired-settings-keys-Cip-mCEN.js} +1 -1
  67. package/package.json +1 -1
@@ -710,7 +710,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
710
710
  return EventCategory;
711
711
  }({});
712
712
  //#endregion
713
- //#region ../types/dist/sleep-C16NCZR2.mjs
713
+ //#region ../types/dist/sleep-DAJ9Er57.mjs
714
714
  /**
715
715
  * The audio chunk plane's byte format, and the ONE expansion from a coded
716
716
  * window to float samples (D455).
@@ -26294,7 +26294,7 @@ var pipelineExecutorCapability = {
26294
26294
  auth: "admin"
26295
26295
  }),
26296
26296
  /**
26297
- * Best settings (D745): the MODEL-BOUND thresholds (`bindsToModel` keys of
26297
+ * Auto tune (D745): the MODEL-BOUND thresholds (`bindsToModel` keys of
26298
26298
  * the object-detection root, and their binding keys) stored in THIS node's
26299
26299
  * per-camera detector settings — and, unless `dryRun`, remove them so the
26300
26300
  * running model's own defaults apply. Every other key of a camera's store
@@ -26666,103 +26666,17 @@ var pipelineExecutorCapability = {
26666
26666
  }
26667
26667
  };
26668
26668
  /**
26669
- * Wire shapes of the Load balancing surface (D748): the session placement
26670
- * policy, the atomic share write, the observed placement statistics, the
26671
- * hardware share suggestion and the stale device pins.
26672
- */
26673
- /**
26674
- * How a new detection session picks its node and device.
26675
- * - `least-loaded` — the historical rule: lowest `attached / weight`, a
26676
- * constant node order at a tie (D37). An idle node always ties at 0, so a
26677
- * weight only bites once a node already holds a session.
26678
- * - `share` — the share of PARALLEL sessions is held to the weights, and a
26679
- * full or drowning node yields to a free one (D748).
26680
- */
26681
- var SessionPlacementPolicySchema = zod.z.enum(["least-loaded", "share"]);
26682
- var LoadBalancingSharesInputSchema = zod.z.object({
26683
- /** nodeId → share (> 0). A node left out keeps its weight. */
26684
- nodes: zod.z.record(zod.z.string(), zod.z.number().positive()).default({}),
26685
- /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
26686
- devices: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number().positive())).default({})
26687
- });
26688
- var PlacementStatsInputSchema = zod.z.object({
26689
- /** Window the observed shares are averaged over (default 1 h, max 24 h). */
26690
- windowMs: zod.z.number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
26691
- var PlacementDeviceStatsSchema = zod.z.object({
26692
- deviceKey: zod.z.string(),
26693
- /** Sessions running on this device now. */
26694
- sessionsNow: zod.z.number(),
26695
- /** Sessions started on this device inside the window. */
26696
- sessionsStarted: zod.z.number(),
26697
- /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
26698
- observedShare: zod.z.number().nullable()
26699
- });
26700
- var PlacementNodeStatsSchema = zod.z.object({
26701
- nodeId: zod.z.string(),
26702
- sessionsNow: zod.z.number(),
26703
- sessionsStarted: zod.z.number(),
26704
- /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
26705
- observedShare: zod.z.number().nullable(),
26706
- /** Most sessions this node ran at once inside the window. */
26707
- peakSessions: zod.z.number(),
26708
- /** Sessions a share election handed elsewhere because this node was full or drowning. */
26709
- yieldsAway: zod.z.number(),
26710
- devices: zod.z.array(PlacementDeviceStatsSchema).readonly()
26711
- });
26712
- /** A camera's device pin that the session path cannot honour. */
26713
- var StaleDevicePinSchema = zod.z.object({
26714
- deviceId: zod.z.number(),
26715
- deviceKey: zod.z.string(),
26716
- /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
26717
- reason: zod.z.enum(["disabled", "absent"])
26718
- });
26719
- var PlacementStatsSchema = zod.z.object({
26720
- policy: SessionPlacementPolicySchema,
26721
- windowMs: zod.z.number(),
26722
- /** How much of the window was actually observed (the hub keeps it in memory). */
26723
- observedForMs: zod.z.number(),
26724
- sessionsNow: zod.z.number(),
26725
- /** Most parallel sessions across the cluster inside the window. */
26726
- clusterPeakSessions: zod.z.number(),
26727
- nodes: zod.z.array(PlacementNodeStatsSchema).readonly(),
26728
- stalePins: zod.z.array(StaleDevicePinSchema).readonly()
26729
- });
26730
- var SuggestSharesInputSchema = zod.z.object({ headroom: zod.z.number().min(.3).max(.5).default(.4) });
26731
- var SuggestedDeviceShareSchema = zod.z.object({
26732
- deviceKey: zod.z.string(),
26733
- /** Share of the node (0–100, rounded). */
26734
- share: zod.z.number(),
26735
- modelId: zod.z.string().nullable(),
26736
- /** Inferences per second at that model, from the measured table. */
26737
- fps: zod.z.number().nullable(),
26738
- measured: zod.z.boolean(),
26739
- /** Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋. Never enforced. */
26740
- suggestedMaxSessions: zod.z.number().nullable()
26741
- });
26742
- var SuggestedNodeShareSchema = zod.z.object({
26743
- nodeId: zod.z.string(),
26744
- /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
26745
- share: zod.z.number().nullable(),
26746
- /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
26747
- capacitySessions: zod.z.number(),
26748
- devices: zod.z.array(SuggestedDeviceShareSchema).readonly(),
26749
- skippedReason: zod.z.string().nullable()
26750
- });
26751
- var SuggestSharesResultSchema = zod.z.object({
26752
- headroom: zod.z.number(),
26753
- /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
26754
- cameraFps: zod.z.number(),
26755
- /** How many share → model → capacity rounds ran before the shares stopped moving (≤ 3). */
26756
- iterations: zod.z.number(),
26757
- nodes: zod.z.array(SuggestedNodeShareSchema).readonly()
26758
- });
26759
- /**
26760
- * The wire shapes of the Best settings plan and apply (D745), used by the
26669
+ * The wire shapes of the Auto tune plan and apply (D745), used by the
26761
26670
  * `pipeline-orchestrator` cap. The recommender's own types
26762
- * (`recommend.ts`, `demand.ts`) are the TS face of the same data; these
26671
+ * (`recommend.ts`) are the TS face of the same data; these
26763
26672
  * schemas are what crosses the cap boundary.
26764
26673
  */
26765
26674
  var ModelFormatSchema$1 = zod.z.enum(MODEL_FORMATS);
26675
+ /** The operator's range for it. */
26676
+ var MIN_SESSIONS_PER_DEVICE_RANGE = {
26677
+ min: 1,
26678
+ max: 8
26679
+ };
26766
26680
  var HardwareClassIdSchema = zod.z.enum([
26767
26681
  "intel-core-ultra",
26768
26682
  "intel-n-series",
@@ -26780,8 +26694,9 @@ var AcceleratorKindSchema = zod.z.enum([
26780
26694
  ]);
26781
26695
  var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
26782
26696
  zod.z.object({
26783
- kind: zod.z.literal("fits"),
26784
- utilisation: zod.z.number()
26697
+ kind: zod.z.literal("capacity"),
26698
+ sessions: zod.z.number(),
26699
+ minSessions: zod.z.number()
26785
26700
  }),
26786
26701
  zod.z.object({
26787
26702
  kind: zod.z.literal("tie-faster"),
@@ -26796,16 +26711,13 @@ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
26796
26711
  }),
26797
26712
  zod.z.object({
26798
26713
  kind: zod.z.literal("no-fit-lightest"),
26799
- utilisation: zod.z.number()
26714
+ sessions: zod.z.number(),
26715
+ minSessions: zod.z.number()
26800
26716
  }),
26801
26717
  zod.z.object({
26802
26718
  kind: zod.z.literal("derived-latency"),
26803
26719
  modelId: zod.z.string()
26804
26720
  }),
26805
- zod.z.object({
26806
- kind: zod.z.literal("estimated-load"),
26807
- observedForMs: zod.z.number().nullable()
26808
- }),
26809
26721
  zod.z.object({ kind: zod.z.literal("cpu-device") }),
26810
26722
  zod.z.object({ kind: zod.z.literal("coral-untouched") }),
26811
26723
  zod.z.object({ kind: zod.z.literal("device-disabled") }),
@@ -26821,28 +26733,13 @@ var RecommendationReasonSchema = zod.z.discriminatedUnion("kind", [
26821
26733
  format: ModelFormatSchema$1
26822
26734
  })
26823
26735
  ]);
26824
- var DeviceDemandSchema = zod.z.object({
26825
- nodeId: zod.z.string(),
26826
- deviceKey: zod.z.string(),
26827
- demandFps: zod.z.number(),
26828
- maxCameraFps: zod.z.number(),
26829
- alwaysOnCameras: zod.z.number(),
26830
- onMotionSessions: zod.z.number(),
26831
- onMotionSource: zod.z.enum([
26832
- "observed-24h",
26833
- "estimate",
26834
- "none"
26835
- ]),
26836
- observedForMs: zod.z.number().nullable(),
26837
- /** How on-motion sessions were charged: per-device observation, or split by share (D748). */
26838
- placement: SessionPlacementPolicySchema
26839
- });
26840
26736
  var DeviceModelChoiceSchema = zod.z.object({
26841
26737
  modelId: zod.z.string(),
26842
26738
  p50Ms: zod.z.number(),
26843
26739
  fps: zod.z.number(),
26844
26740
  measured: zod.z.boolean(),
26845
- utilisation: zod.z.number(),
26741
+ /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
26742
+ capacitySessions: zod.z.number(),
26846
26743
  personRecall: zod.z.number()
26847
26744
  });
26848
26745
  var DeviceRecommendationSchema = zod.z.object({
@@ -26850,7 +26747,6 @@ var DeviceRecommendationSchema = zod.z.object({
26850
26747
  accelerator: AcceleratorKindSchema.nullable(),
26851
26748
  enabled: zod.z.boolean(),
26852
26749
  available: zod.z.boolean(),
26853
- demand: DeviceDemandSchema.nullable(),
26854
26750
  chosen: DeviceModelChoiceSchema.nullable(),
26855
26751
  reasons: zod.z.array(RecommendationReasonSchema).readonly()
26856
26752
  });
@@ -26892,7 +26788,7 @@ var DetectorStoreClearSchema = zod.z.object({
26892
26788
  deviceId: zod.z.number(),
26893
26789
  keys: zod.z.array(zod.z.string()).readonly()
26894
26790
  });
26895
- var BestSettingsWarningSchema = zod.z.discriminatedUnion("kind", [
26791
+ var AutoTuneWarningSchema = zod.z.discriminatedUnion("kind", [
26896
26792
  zod.z.object({
26897
26793
  kind: zod.z.literal("detector-store-cluster-wide"),
26898
26794
  skippedNodes: zod.z.array(zod.z.string()).readonly()
@@ -26907,36 +26803,37 @@ var BestSettingsWarningSchema = zod.z.discriminatedUnion("kind", [
26907
26803
  deviceKey: zod.z.string()
26908
26804
  })
26909
26805
  ]);
26910
- var BestSettingsOptionsSchema = zod.z.object({
26806
+ var AutoTuneOptionsSchema = zod.z.object({
26911
26807
  /** Share of each accelerator's throughput kept free (0.3–0.5). */
26912
26808
  headroom: zod.z.number().min(.3).max(.5).default(.4),
26913
26809
  /**
26914
- * What-if shares (D748): plan as if these node/device shares were stored
26915
- * and the policy were `share`. Absent = the stored shares under the stored
26916
- * policy. A what-if plan is for display; apply always re-plans from what
26917
- * is stored.
26810
+ * The least number of parallel sessions every device must sustain at the
26811
+ * camera rate with the headroom kept free (D755). The most accurate model
26812
+ * that reaches it wins.
26918
26813
  */
26919
- shares: LoadBalancingSharesInputSchema.optional()
26814
+ minSessionsPerDevice: zod.z.number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
26920
26815
  });
26921
- var BestSettingsPlanSchema = zod.z.object({
26816
+ var AutoTunePlanSchema = zod.z.object({
26922
26817
  /** Hash of everything the apply will write — the apply refuses a different one. */
26923
26818
  planHash: zod.z.string(),
26924
26819
  family: zod.z.literal("yolov9"),
26925
26820
  headroom: zod.z.number(),
26926
- /** Planned under what-if shares (D748): for display — apply refuses it as stale. */
26927
- whatIf: zod.z.boolean(),
26821
+ minSessionsPerDevice: zod.z.number(),
26822
+ /** The detection rate a session is counted at (the fastest camera running the pipeline root). */
26823
+ cameraFps: zod.z.number(),
26928
26824
  generatedAt: zod.z.number(),
26929
26825
  nodes: zod.z.array(NodeRecommendationSchema).readonly(),
26930
26826
  nodeChanges: zod.z.array(NodeDeviceChangeSchema).readonly(),
26931
26827
  cameraClears: zod.z.array(CameraOverrideClearSchema).readonly(),
26932
26828
  detectorStoreClears: zod.z.array(DetectorStoreClearSchema).readonly(),
26933
- warnings: zod.z.array(BestSettingsWarningSchema).readonly()
26829
+ warnings: zod.z.array(AutoTuneWarningSchema).readonly()
26934
26830
  });
26935
- var BestSettingsApplyInputSchema = zod.z.object({
26831
+ var AutoTuneApplyInputSchema = zod.z.object({
26936
26832
  planHash: zod.z.string(),
26937
- headroom: zod.z.number().min(.3).max(.5).default(.4)
26833
+ headroom: zod.z.number().min(.3).max(.5).default(.4),
26834
+ minSessionsPerDevice: zod.z.number().int().min(MIN_SESSIONS_PER_DEVICE_RANGE.min).max(MIN_SESSIONS_PER_DEVICE_RANGE.max).default(2)
26938
26835
  });
26939
- var BestSettingsPhaseResultSchema = zod.z.object({
26836
+ var AutoTunePhaseResultSchema = zod.z.object({
26940
26837
  phase: zod.z.enum([
26941
26838
  "download",
26942
26839
  "camera-overrides",
@@ -26947,25 +26844,196 @@ var BestSettingsPhaseResultSchema = zod.z.object({
26947
26844
  ok: zod.z.boolean(),
26948
26845
  detail: zod.z.string()
26949
26846
  });
26950
- var BestSettingsApplyResultSchema = zod.z.discriminatedUnion("kind", [
26847
+ var AutoTuneApplyResultSchema = zod.z.discriminatedUnion("kind", [
26951
26848
  zod.z.object({
26952
26849
  kind: zod.z.literal("applied"),
26953
26850
  planHash: zod.z.string(),
26954
- phases: zod.z.array(BestSettingsPhaseResultSchema).readonly()
26851
+ phases: zod.z.array(AutoTunePhaseResultSchema).readonly()
26955
26852
  }),
26956
26853
  zod.z.object({
26957
26854
  kind: zod.z.literal("aborted"),
26958
- phases: zod.z.array(BestSettingsPhaseResultSchema).readonly()
26855
+ phases: zod.z.array(AutoTunePhaseResultSchema).readonly()
26959
26856
  }),
26960
26857
  zod.z.object({
26961
26858
  kind: zod.z.literal("stale"),
26962
- plan: BestSettingsPlanSchema
26859
+ plan: AutoTunePlanSchema
26963
26860
  }),
26964
26861
  zod.z.object({
26965
26862
  kind: zod.z.literal("refused"),
26966
26863
  reason: zod.z.enum(["apply-in-progress"])
26967
26864
  })
26968
26865
  ]);
26866
+ /**
26867
+ * Wire shapes of the Load balancing surface (D748): the session placement
26868
+ * policy, the atomic share write, the observed placement statistics, the
26869
+ * hardware share suggestion and the stale device pins.
26870
+ */
26871
+ /**
26872
+ * How a new detection session picks its node and device.
26873
+ * - `least-loaded` — the historical rule: lowest `attached / weight`, a
26874
+ * constant node order at a tie (D37). An idle node always ties at 0, so a
26875
+ * weight only bites once a node already holds a session.
26876
+ * - `share` — the share of PARALLEL sessions is held to the weights, and a
26877
+ * full or drowning node yields to a free one (D748).
26878
+ */
26879
+ var SessionPlacementPolicySchema = zod.z.enum(["least-loaded", "share"]);
26880
+ var LoadBalancingSharesInputSchema = zod.z.object({
26881
+ /** nodeId → share (> 0). A node left out keeps its weight. */
26882
+ nodes: zod.z.record(zod.z.string(), zod.z.number().positive()).default({}),
26883
+ /** nodeId → deviceKey → share (> 0). A device left out keeps its weight. */
26884
+ devices: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number().positive())).default({})
26885
+ });
26886
+ var PlacementStatsInputSchema = zod.z.object({
26887
+ /** Window the observed shares are averaged over (default 1 h, max 24 h). */
26888
+ windowMs: zod.z.number().int().min(6e4).max(1440 * 60 * 1e3).default(3600 * 1e3) });
26889
+ var PlacementDeviceStatsSchema = zod.z.object({
26890
+ deviceKey: zod.z.string(),
26891
+ /** Sessions running on this device now. */
26892
+ sessionsNow: zod.z.number(),
26893
+ /** Sessions started on this device inside the window. */
26894
+ sessionsStarted: zod.z.number(),
26895
+ /** Time-weighted share of the node's parallel sessions over the window (0–1); null = no session ran. */
26896
+ observedShare: zod.z.number().nullable()
26897
+ });
26898
+ var PlacementNodeStatsSchema = zod.z.object({
26899
+ nodeId: zod.z.string(),
26900
+ sessionsNow: zod.z.number(),
26901
+ sessionsStarted: zod.z.number(),
26902
+ /** Time-weighted share of the cluster's parallel sessions over the window (0–1); null = none ran. */
26903
+ observedShare: zod.z.number().nullable(),
26904
+ /** Most sessions this node ran at once inside the window. */
26905
+ peakSessions: zod.z.number(),
26906
+ /** Sessions a share election handed elsewhere because this node was full or drowning. */
26907
+ yieldsAway: zod.z.number(),
26908
+ devices: zod.z.array(PlacementDeviceStatsSchema).readonly()
26909
+ });
26910
+ /** A camera's device pin that the session path cannot honour. */
26911
+ var StaleDevicePinSchema = zod.z.object({
26912
+ deviceId: zod.z.number(),
26913
+ deviceKey: zod.z.string(),
26914
+ /** `disabled` — the key exists on some node but is not enabled anywhere; `absent` — no node has it. */
26915
+ reason: zod.z.enum(["disabled", "absent"])
26916
+ });
26917
+ var PlacementStatsSchema = zod.z.object({
26918
+ policy: SessionPlacementPolicySchema,
26919
+ windowMs: zod.z.number(),
26920
+ /** How much of the window was actually observed (the hub keeps it in memory). */
26921
+ observedForMs: zod.z.number(),
26922
+ sessionsNow: zod.z.number(),
26923
+ /** Most parallel sessions across the cluster inside the window. */
26924
+ clusterPeakSessions: zod.z.number(),
26925
+ nodes: zod.z.array(PlacementNodeStatsSchema).readonly(),
26926
+ stalePins: zod.z.array(StaleDevicePinSchema).readonly()
26927
+ });
26928
+ /**
26929
+ * Where an automatic share's capacity comes from (D755).
26930
+ * - `hardware` — the static capacity of each device at its Auto tune model:
26931
+ * the measured latency table for the node's hardware class.
26932
+ * - `benchmark` — the node's own measured capacity (node benchmark results).
26933
+ * A node with no results falls back to `hardware`, and says so.
26934
+ */
26935
+ var CapacitySourceSchema = zod.z.enum(["hardware", "benchmark"]);
26936
+ /** Why a node under the `benchmark` source was sized from hardware instead. */
26937
+ var CapacityFallbackSchema = zod.z.enum(["no-benchmark-results", "partial-benchmark-results"]);
26938
+ var SuggestSharesInputSchema = zod.z.object({
26939
+ headroom: zod.z.number().min(.3).max(.5).default(.4),
26940
+ /** Default `hardware`. */
26941
+ source: CapacitySourceSchema.default("hardware")
26942
+ });
26943
+ var SuggestedDeviceShareSchema = zod.z.object({
26944
+ deviceKey: zod.z.string(),
26945
+ /** Share of the node (0–100, rounded). */
26946
+ share: zod.z.number(),
26947
+ modelId: zod.z.string().nullable(),
26948
+ /** Inferences per second at that model, from the measured table; null when sized by a benchmark. */
26949
+ fps: zod.z.number().nullable(),
26950
+ /** False for a table cell derived from another chip; true for a measured cell or a benchmark. */
26951
+ measured: zod.z.boolean(),
26952
+ /**
26953
+ * Advisory session cap: ⌊fps × (1 − headroom) / camera fps⌋ from the table,
26954
+ * or the benchmark's measured max sessions. Never enforced.
26955
+ */
26956
+ suggestedMaxSessions: zod.z.number().nullable()
26957
+ });
26958
+ var SuggestedNodeShareSchema = zod.z.object({
26959
+ nodeId: zod.z.string(),
26960
+ /** Share of the cluster (0–100, rounded); null = node skipped (offline, unknown hardware). */
26961
+ share: zod.z.number().nullable(),
26962
+ /** Parallel sessions the node sustains at the suggested models with the headroom kept free. */
26963
+ capacitySessions: zod.z.number(),
26964
+ devices: zod.z.array(SuggestedDeviceShareSchema).readonly(),
26965
+ skippedReason: zod.z.string().nullable(),
26966
+ /** What this node's capacity was read from; null when the node is skipped. */
26967
+ capacitySource: CapacitySourceSchema.nullable(),
26968
+ /** Set when the `benchmark` source was asked for and this node used `hardware`. */
26969
+ capacityFallback: CapacityFallbackSchema.nullable()
26970
+ });
26971
+ var SuggestSharesResultSchema = zod.z.object({
26972
+ headroom: zod.z.number(),
26973
+ /** The source asked for; each node says what it actually used. */
26974
+ source: CapacitySourceSchema,
26975
+ /** Camera detection rate the capacity is counted in (the fastest camera's fps). */
26976
+ cameraFps: zod.z.number(),
26977
+ /** The Auto tune capacity floor the models were picked at. */
26978
+ minSessionsPerDevice: zod.z.number(),
26979
+ nodes: zod.z.array(SuggestedNodeShareSchema).readonly()
26980
+ });
26981
+ /**
26982
+ * Where the node and device shares come from (D750, D755).
26983
+ * - `hardware` (default) — computed by the system from each node's static
26984
+ * capacity (its accelerators at their Auto tune models, from the measured
26985
+ * latency table), recomputed whenever a node or device joins, leaves, is
26986
+ * switched on or off, or changes model. No load input.
26987
+ * - `benchmark` — the same, from each node's measured capacity (node
26988
+ * benchmark results); a node without results falls back to `hardware`.
26989
+ * - `manual` — the operator's stored sliders.
26990
+ * Either way a node or device that cannot take sessions gives its share to
26991
+ * the others in proportion; the stored values are never rewritten for that.
26992
+ */
26993
+ var ShareSourceSchema = zod.z.enum([
26994
+ "hardware",
26995
+ "benchmark",
26996
+ "manual"
26997
+ ]);
26998
+ var SetShareSourceInputSchema = zod.z.object({ source: ShareSourceSchema });
26999
+ zod.z.object({
27000
+ nodes: zod.z.record(zod.z.string(), zod.z.number()),
27001
+ devices: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number()))
27002
+ });
27003
+ var EffectiveDeviceShareSchema = zod.z.object({
27004
+ deviceKey: zod.z.string(),
27005
+ /** Can take sessions now (enabled, available, can run the root). */
27006
+ eligible: zod.z.boolean(),
27007
+ /** The share the source assigns, as a percentage of the node's devices. */
27008
+ configuredPct: zod.z.number(),
27009
+ /** The share actually used, after an ineligible device's share went to the others. */
27010
+ effectivePct: zod.z.number()
27011
+ });
27012
+ var EffectiveNodeShareSchema = zod.z.object({
27013
+ nodeId: zod.z.string(),
27014
+ eligible: zod.z.boolean(),
27015
+ configuredPct: zod.z.number(),
27016
+ effectivePct: zod.z.number(),
27017
+ /** Automatic sources: what this node's share was computed from; null under `manual` or before the first answer. */
27018
+ capacitySource: CapacitySourceSchema.nullable(),
27019
+ /** Automatic `benchmark`: why this node used `hardware` instead. */
27020
+ capacityFallback: CapacityFallbackSchema.nullable(),
27021
+ devices: zod.z.array(EffectiveDeviceShareSchema).readonly()
27022
+ });
27023
+ var EffectiveSharesSchema = zod.z.object({
27024
+ source: ShareSourceSchema,
27025
+ policy: SessionPlacementPolicySchema,
27026
+ /** An automatic source with no computed answer yet: the stored sliders are used meanwhile. */
27027
+ autoPending: zod.z.boolean(),
27028
+ /** When the automatic shares were last computed (ms epoch); null = never. */
27029
+ computedAt: zod.z.number().nullable(),
27030
+ /** What made the system recompute them last. */
27031
+ trigger: zod.z.string().nullable(),
27032
+ nodes: zod.z.array(EffectiveNodeShareSchema).readonly(),
27033
+ /** The relative weights the election reads (before eligibility). */
27034
+ nodeWeights: zod.z.record(zod.z.string(), zod.z.number()),
27035
+ deviceWeights: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number()))
27036
+ });
26969
27037
  zod.z.object({
26970
27038
  activeCameras: zod.z.number(),
26971
27039
  throttledCameras: zod.z.number(),
@@ -28377,8 +28445,10 @@ var CameraStepOverridePatchSchema = zod.z.object({
28377
28445
  modelId: zod.z.string().optional(),
28378
28446
  settings: zod.z.record(zod.z.string(), zod.z.unknown()).readonly().optional()
28379
28447
  });
28448
+ var CameraStepSettingsSchema = zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.unknown()).readonly());
28380
28449
  var CameraPipelineSettingsSchema = zod.z.object({
28381
28450
  stepToggles: zod.z.record(zod.z.string(), zod.z.boolean()).optional(),
28451
+ stepSettings: CameraStepSettingsSchema.optional(),
28382
28452
  stepOverridesByDevice: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), CameraStepOverridePatchSchema))).optional(),
28383
28453
  pipelineByAgent: zod.z.record(zod.z.string(), CameraPipelineForAgentSchema).optional()
28384
28454
  });
@@ -29174,23 +29244,25 @@ var pipelineOrchestratorCapability = {
29174
29244
  auth: "admin"
29175
29245
  }),
29176
29246
  /**
29177
- * Best settings (D745) — DRY RUN. Recommends ONE detector family (YOLOv9)
29178
- * for the whole cluster from each node's static hardware class, the
29179
- * measured latency table and the detection demand, and lists every write
29247
+ * Auto tune (D745, D755) — DRY RUN. Recommends ONE detector family
29248
+ * (YOLOv9) for the whole cluster from each node's static hardware class
29249
+ * and the measured latency table: per device, the most accurate model
29250
+ * that sustains at least `minSessionsPerDevice` parallel sessions at the
29251
+ * camera rate with the headroom kept free (no load input), and lists every write
29180
29252
  * the apply would make: the node model pins set, the enrichment pins and
29181
29253
  * model-bound thresholds removed (node level and per camera), and the
29182
29254
  * per-camera detector thresholds cleared. Writes nothing. Step
29183
29255
  * enablement, device enablement, pins, recording, notifications, zones and
29184
29256
  * rules are never part of it. `planHash` names exactly this diff.
29185
29257
  */
29186
- planBestSettings: method(BestSettingsOptionsSchema, BestSettingsPlanSchema, { auth: "admin" }),
29258
+ planAutoTune: method(AutoTuneOptionsSchema, AutoTunePlanSchema, { auth: "admin" }),
29187
29259
  /**
29188
- * Best settings (D745) — APPLY the plan the operator confirmed. Recomputes
29260
+ * Auto tune (D745) — APPLY the plan the operator confirmed. Recomputes
29189
29261
  * the plan and refuses (`stale`, with the fresh plan) when its hash is not
29190
29262
  * `planHash`, so what is written is exactly the confirmed diff. Offline
29191
29263
  * nodes are skipped; there is no undo.
29192
29264
  */
29193
- applyBestSettings: method(BestSettingsApplyInputSchema, BestSettingsApplyResultSchema, {
29265
+ applyAutoTune: method(AutoTuneApplyInputSchema, AutoTuneApplyResultSchema, {
29194
29266
  kind: "mutation",
29195
29267
  auth: "admin"
29196
29268
  }),
@@ -29215,12 +29287,32 @@ var pipelineOrchestratorCapability = {
29215
29287
  */
29216
29288
  getPlacementStats: method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }),
29217
29289
  /**
29218
- * Load balancing (D748) — shares proportional to each node's measured
29219
- * capacity at the models Best settings would pick, iterated (≤ 3 rounds)
29220
- * until the shares stop moving; per device, an ADVISORY session cap.
29221
- * Writes nothing.
29290
+ * Load balancing (D748, D755) — shares proportional to each node's
29291
+ * capacity in parallel sessions: from the latency table at the models
29292
+ * Auto tune picks (`hardware`), or from node benchmark results
29293
+ * (`benchmark`, each node without results falling back to `hardware` and
29294
+ * saying so). The automatic shares are exactly this answer. Per device,
29295
+ * an ADVISORY session cap. Writes nothing.
29222
29296
  */
29223
29297
  suggestShares: method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }),
29298
+ /**
29299
+ * Load balancing (D750) — the shares placement reads now: the source
29300
+ * (automatic capacity shares or the operator's sliders), each node's and
29301
+ * device's configured share, and the effective share after a node or
29302
+ * device that cannot take sessions gave its share to the others.
29303
+ */
29304
+ getEffectiveShares: method(zod.z.void(), EffectiveSharesSchema, { auth: "admin" }),
29305
+ /**
29306
+ * Load balancing (D750, D755) — switch the share source: `hardware`
29307
+ * (automatic, from static capacity), `benchmark` (automatic, from node
29308
+ * benchmark results) or `manual`. Going manual seeds the sliders with the
29309
+ * current automatic shares (one atomic write), so nothing jumps; going
29310
+ * to an automatic source recomputes at once.
29311
+ */
29312
+ setShareSource: method(SetShareSourceInputSchema, zod.z.object({ success: zod.z.literal(true) }), {
29313
+ kind: "mutation",
29314
+ auth: "admin"
29315
+ }),
29224
29316
  /** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
29225
29317
  getCameraSettings: method(zod.z.object({ deviceId: zod.z.number() }), CameraPipelineSettingsSchema.nullable()),
29226
29318
  /** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
@@ -29250,6 +29342,22 @@ var pipelineOrchestratorCapability = {
29250
29342
  kind: "mutation",
29251
29343
  auth: "admin"
29252
29344
  }),
29345
+ /**
29346
+ * Write or clear one step's CAMERA-WIDE settings (D754) — the fields this
29347
+ * camera overrides on every accelerator it runs on. `settings` is the
29348
+ * whole field-level bag for that step (only the overridden keys; a
29349
+ * model-bound field travels with its binding key); `null` or `{}` clears
29350
+ * it. Merged at dispatch between the node base and the per-(node,device)
29351
+ * override, key by key.
29352
+ */
29353
+ setCameraStepSettings: method(zod.z.object({
29354
+ deviceId: zod.z.number(),
29355
+ addonId: zod.z.string(),
29356
+ settings: zod.z.record(zod.z.string(), zod.z.unknown()).nullable()
29357
+ }), zod.z.object({ success: zod.z.literal(true) }), {
29358
+ kind: "mutation",
29359
+ auth: "admin"
29360
+ }),
29253
29361
  /** Write or clear the wholesale per-agent pipeline override. Pass `pipeline: null` to drop the override. */
29254
29362
  setCameraPipelineForAgent: method(zod.z.object({
29255
29363
  deviceId: zod.z.number(),
@@ -52403,7 +52511,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
52403
52511
  addonId: null,
52404
52512
  access: "view"
52405
52513
  },
52406
- "pipelineOrchestrator.applyBestSettings": {
52514
+ "pipelineOrchestrator.applyAutoTune": {
52407
52515
  capName: "pipeline-orchestrator",
52408
52516
  capScope: "system",
52409
52517
  addonId: null,
@@ -52523,6 +52631,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
52523
52631
  addonId: null,
52524
52632
  access: "view"
52525
52633
  },
52634
+ "pipelineOrchestrator.getEffectiveShares": {
52635
+ capName: "pipeline-orchestrator",
52636
+ capScope: "system",
52637
+ addonId: null,
52638
+ access: "view"
52639
+ },
52526
52640
  "pipelineOrchestrator.getGlobalMetrics": {
52527
52641
  capName: "pipeline-orchestrator",
52528
52642
  capScope: "system",
@@ -52589,7 +52703,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
52589
52703
  addonId: null,
52590
52704
  access: "create"
52591
52705
  },
52592
- "pipelineOrchestrator.planBestSettings": {
52706
+ "pipelineOrchestrator.planAutoTune": {
52593
52707
  capName: "pipeline-orchestrator",
52594
52708
  capScope: "system",
52595
52709
  addonId: null,
@@ -52691,6 +52805,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
52691
52805
  addonId: null,
52692
52806
  access: "create"
52693
52807
  },
52808
+ "pipelineOrchestrator.setCameraStepSettings": {
52809
+ capName: "pipeline-orchestrator",
52810
+ capScope: "system",
52811
+ addonId: null,
52812
+ access: "create"
52813
+ },
52694
52814
  "pipelineOrchestrator.setCameraStepToggle": {
52695
52815
  capName: "pipeline-orchestrator",
52696
52816
  capScope: "system",
@@ -52721,6 +52841,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
52721
52841
  addonId: null,
52722
52842
  access: "create"
52723
52843
  },
52844
+ "pipelineOrchestrator.setShareSource": {
52845
+ capName: "pipeline-orchestrator",
52846
+ capScope: "system",
52847
+ addonId: null,
52848
+ access: "create"
52849
+ },
52724
52850
  "pipelineOrchestrator.suggestShares": {
52725
52851
  capName: "pipeline-orchestrator",
52726
52852
  capScope: "system",
@@ -58388,6 +58514,11 @@ Object.freeze({
58388
58514
  form: "single",
58389
58515
  optional: false
58390
58516
  }],
58517
+ "pipelineOrchestrator.setCameraStepSettings": [{
58518
+ name: "deviceId",
58519
+ form: "single",
58520
+ optional: false
58521
+ }],
58391
58522
  "pipelineOrchestrator.setCameraStepToggle": [{
58392
58523
  name: "deviceId",
58393
58524
  form: "single",