@camstack/types 1.1.34 → 1.1.35

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-DmP-uxoe.js");
2
+ const require_sleep = require("./sleep-DuN1nc6O.js");
3
3
  const require_err_msg = require("./err-msg-COpsHMw2.js");
4
4
  let zod = require("zod");
5
5
  //#region src/health/wiring-health.ts
@@ -7605,11 +7605,6 @@ var PipelineSchemaSchema = zod.z.object({
7605
7605
  selectedEngine: PipelineEngineChoiceSchema,
7606
7606
  slots: zod.z.array(PipelineSlotSchemaSchema).readonly()
7607
7607
  });
7608
- var DetectorOutputSchema = zod.z.object({
7609
- detections: zod.z.array(SpatialDetectionSchema).readonly(),
7610
- inferenceMs: zod.z.number(),
7611
- modelId: zod.z.string()
7612
- });
7613
7608
  var EngineProvisioningSchema = zod.z.object({
7614
7609
  runtimeId: zod.z.enum([
7615
7610
  "onnx",
@@ -7775,23 +7770,23 @@ var pipelineExecutorCapability = {
7775
7770
  auth: "admin"
7776
7771
  }),
7777
7772
  /**
7778
- * Reset ONE node's detection-pipeline to its factory defaults, forcing
7779
- * regeneration of the (now hardware-aware) default object-detection
7780
- * model. `nodeId` is the ROUTING key — the generated cap-router strips
7781
- * it (default `nodeIdMode: 'routing'`, same as `getSelectedEngine` /
7782
- * `getDefaultSteps`) and dispatches to that node, so the provider method
7783
- * runs ON the target node and receives no `nodeId`.
7773
+ * Clear THIS node's executor-side PER-DEVICE settings stores (the
7774
+ * per-camera step overrides the object-detection root reads via
7775
+ * `applyDeviceOverridesToTree`). `nodeId` is the ROUTING key — the
7776
+ * generated cap-router strips it (default `nodeIdMode: 'routing'`) and
7777
+ * dispatches to that node, so the provider method runs ON the target
7778
+ * node and receives no `nodeId`.
7784
7779
  *
7785
- * Clears the node's persisted global pipeline seed (`pipelineSteps`) +
7786
- * legacy engine blob (`pipelineEngine`) and every device's per-camera
7787
- * step overrides, then re-seeds the hardware-aware default tree. Returns
7788
- * the regenerated object-detection model id (null when the default tree
7789
- * has no detector for this node's engine format) so the caller can
7790
- * verify the reset without a second round-trip.
7780
+ * This is the slimmed executor leg of the orchestrator's
7781
+ * `resetNodePipelineDefaults` flow (which owns the real reset: node
7782
+ * addonDefaults pins + per-camera orchestrator overrides). The legacy
7783
+ * `resetToDefault` which reset a persisted global step-tree seed
7784
+ * nothing in the live per-camera path read was removed together with
7785
+ * that seed.
7791
7786
  */
7792
- resetToDefault: require_sleep.method(zod.z.object({ nodeId: zod.z.string() }), zod.z.object({
7787
+ clearDeviceOverrides: require_sleep.method(zod.z.object({ nodeId: zod.z.string() }), zod.z.object({
7793
7788
  success: zod.z.literal(true),
7794
- regeneratedModelId: zod.z.string().nullable()
7789
+ clearedDevices: zod.z.number()
7795
7790
  }), {
7796
7791
  kind: "mutation",
7797
7792
  auth: "admin"
@@ -7837,11 +7832,6 @@ var pipelineExecutorCapability = {
7837
7832
  modelId: zod.z.string(),
7838
7833
  format: ModelFormatSchema$1
7839
7834
  }), zod.z.object({ success: zod.z.literal(true) }), { kind: "mutation" }),
7840
- detect: require_sleep.method(zod.z.object({
7841
- addonId: zod.z.string(),
7842
- frame: FrameInputSchema,
7843
- config: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
7844
- }), DetectorOutputSchema),
7845
7835
  /**
7846
7836
  * Stateless single-frame execution. Callers (runner, benchmark) pass
7847
7837
  * the complete `engine` + `steps` tree; the executor holds no state
@@ -12565,7 +12555,7 @@ function createSystemProxy(api) {
12565
12555
  getEngineProvisioning: (input) => dispatch("pipelineExecutor", "getEngineProvisioning", "query", input),
12566
12556
  getVideoPipelineSteps: (input) => dispatch("pipelineExecutor", "getVideoPipelineSteps", "query", input),
12567
12557
  setVideoPipelineSteps: (input) => dispatch("pipelineExecutor", "setVideoPipelineSteps", "mutation", input),
12568
- resetToDefault: (input) => dispatch("pipelineExecutor", "resetToDefault", "mutation", input),
12558
+ clearDeviceOverrides: (input) => dispatch("pipelineExecutor", "clearDeviceOverrides", "mutation", input),
12569
12559
  getSchema: (input) => dispatch("pipelineExecutor", "getSchema", "query", input),
12570
12560
  getGlobalSteps: (input) => dispatch("pipelineExecutor", "getGlobalSteps", "query", input),
12571
12561
  getGlobalPipelineConfig: (input) => dispatch("pipelineExecutor", "getGlobalPipelineConfig", "query", input),
@@ -12579,7 +12569,6 @@ function createSystemProxy(api) {
12579
12569
  getAddonModels: (input) => dispatch("pipelineExecutor", "getAddonModels", "query", input),
12580
12570
  downloadModel: (input) => dispatch("pipelineExecutor", "downloadModel", "mutation", input),
12581
12571
  deleteModel: (input) => dispatch("pipelineExecutor", "deleteModel", "mutation", input),
12582
- detect: (input) => dispatch("pipelineExecutor", "detect", "query", input),
12583
12572
  cacheFrameInPool: (input) => dispatch("pipelineExecutor", "cacheFrameInPool", "mutation", input),
12584
12573
  inferCached: (input) => dispatch("pipelineExecutor", "inferCached", "mutation", input),
12585
12574
  uncacheFrame: (input) => dispatch("pipelineExecutor", "uncacheFrame", "mutation", input),
@@ -12603,7 +12592,6 @@ function createSystemProxy(api) {
12603
12592
  getCapabilityBindings: (input) => dispatch("pipelineOrchestrator", "getCapabilityBindings", "query", input),
12604
12593
  setCapabilityBinding: (input) => dispatch("pipelineOrchestrator", "setCapabilityBinding", "mutation", input),
12605
12594
  getIngestOwner: (input) => dispatch("pipelineOrchestrator", "getIngestOwner", "query", input),
12606
- getDecoderAssignments: (input) => dispatch("pipelineOrchestrator", "getDecoderAssignments", "query", input),
12607
12595
  getAudioNodeLoad: (input) => dispatch("pipelineOrchestrator", "getAudioNodeLoad", "query", input),
12608
12596
  getAgentSettings: (input) => dispatch("pipelineOrchestrator", "getAgentSettings", "query", input),
12609
12597
  listAgentSettings: (input) => dispatch("pipelineOrchestrator", "listAgentSettings", "query", input),
@@ -12613,6 +12601,7 @@ function createSystemProxy(api) {
12613
12601
  setAgentDetectWeight: (input) => dispatch("pipelineOrchestrator", "setAgentDetectWeight", "mutation", input),
12614
12602
  setAgentCapabilities: (input) => dispatch("pipelineOrchestrator", "setAgentCapabilities", "mutation", input),
12615
12603
  setAgentReachableHost: (input) => dispatch("pipelineOrchestrator", "setAgentReachableHost", "mutation", input),
12604
+ resetNodePipelineDefaults: (input) => dispatch("pipelineOrchestrator", "resetNodePipelineDefaults", "mutation", input),
12616
12605
  getCameraStatuses: (input) => dispatch("pipelineOrchestrator", "getCameraStatuses", "query", input),
12617
12606
  listTemplates: (input) => dispatch("pipelineOrchestrator", "listTemplates", "query", input),
12618
12607
  saveTemplate: (input) => dispatch("pipelineOrchestrator", "saveTemplate", "mutation", input),
@@ -13398,7 +13387,9 @@ var AddonPageDeclarationSchema$1 = zod.z.object({
13398
13387
  icon: zod.z.string(),
13399
13388
  path: zod.z.string(),
13400
13389
  remoteName: zod.z.string(),
13401
- bundle: zod.z.string()
13390
+ bundle: zod.z.string(),
13391
+ section: zod.z.string().optional(),
13392
+ sectionLabel: zod.z.string().optional()
13402
13393
  });
13403
13394
  var AddonPageInfoSchema = zod.z.object({
13404
13395
  addonId: zod.z.string(),
@@ -13445,7 +13436,18 @@ var AddonPageDeclarationSchema = zod.z.object({
13445
13436
  * the static-file route can compute an mtime-based cache-buster URL
13446
13437
  * without a separate filesystem stat.
13447
13438
  */
13448
- bundle: zod.z.string()
13439
+ bundle: zod.z.string(),
13440
+ /**
13441
+ * Sidebar section this page docks into. Well-known ids: `'detection'`,
13442
+ * `'cluster'`, `'administration'` — the page renders inside that group.
13443
+ * Any OTHER string creates (or joins) a custom section rendered after
13444
+ * the built-in groups; its label comes from `sectionLabel` (first
13445
+ * declaration wins), falling back to the id. Absent → the legacy
13446
+ * "Addon Pages" group.
13447
+ */
13448
+ section: zod.z.string().optional(),
13449
+ /** Display label for a CUSTOM `section` id (ignored for well-known ids). */
13450
+ sectionLabel: zod.z.string().optional()
13449
13451
  });
13450
13452
  var addonPagesSourceCapability = {
13451
13453
  name: "addon-pages-source",
@@ -17601,7 +17603,12 @@ var AgentPipelineSettingsSchema = zod.z.object({
17601
17603
  detectWeight: zod.z.number().positive().optional(),
17602
17604
  /** Node is eligible to run the detection pipeline (decode + inference). */
17603
17605
  detect: zod.z.boolean().optional(),
17604
- /** Node is eligible to host decoder sessions. */
17606
+ /**
17607
+ * DEPRECATED AND IGNORED. Decode is always co-located with its frame
17608
+ * consumer, so decode eligibility IS detect eligibility. Kept optional in
17609
+ * the schema ONLY so persisted stores written before the removal still
17610
+ * parse — no code reads it and no write path emits it.
17611
+ */
17605
17612
  decode: zod.z.boolean().optional(),
17606
17613
  /** Node is eligible to run audio-analyzer sessions. */
17607
17614
  audio: zod.z.boolean().optional(),
@@ -17662,25 +17669,6 @@ var PipelineAssignmentSchema = zod.z.object({
17662
17669
  assignedAt: zod.z.number()
17663
17670
  });
17664
17671
  /**
17665
- * Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
17666
- * the decoder-node placement domain (`balanceDecoder` decision: manual pin
17667
- * → co-located with pipeline → capacity).
17668
- */
17669
- var DecoderAssignmentSchema = zod.z.object({
17670
- deviceId: zod.z.number(),
17671
- /** Moleculer node id of the decoder provider currently responsible for this camera. */
17672
- decoderNodeId: zod.z.string(),
17673
- /** True when the assignment was set manually via `assignDecoder`, false when chosen by the balancer. */
17674
- pinned: zod.z.boolean(),
17675
- /** Why this assignment was made — useful for debugging the decoder balancer. */
17676
- reason: zod.z.enum([
17677
- "manual",
17678
- "co-located",
17679
- "capacity",
17680
- "hardware-affinity"
17681
- ])
17682
- });
17683
- /**
17684
17672
  * Per-agent load summary surfaced to the load balancer + dashboards.
17685
17673
  * Aggregated from each runner's `getLocalLoad` cap call.
17686
17674
  */
@@ -17967,21 +17955,6 @@ var pipelineOrchestratorCapability = {
17967
17955
  * present. Defaults to `{ ownerNodeId: 'hub' }`.
17968
17956
  */
17969
17957
  getIngestOwner: require_sleep.method(zod.z.void(), IngestOwnerSchema),
17970
- /** Pin a device's decoder to a specific node. */
17971
- assignDecoder: require_sleep.method(zod.z.object({
17972
- deviceId: zod.z.number(),
17973
- nodeId: zod.z.string()
17974
- }), zod.z.void(), {
17975
- kind: "mutation",
17976
- auth: "admin"
17977
- }),
17978
- /** Clear a device's decoder pin (revert to auto). */
17979
- unassignDecoder: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
17980
- kind: "mutation",
17981
- auth: "admin"
17982
- }),
17983
- /** Get every camera's decoder placement. */
17984
- getDecoderAssignments: require_sleep.method(zod.z.void(), zod.z.array(DecoderAssignmentSchema).readonly()),
17985
17958
  /** Pin a device's audio analysis to a specific cluster node. */
17986
17959
  assignAudio: require_sleep.method(zod.z.object({
17987
17960
  deviceId: zod.z.number(),
@@ -18013,23 +17986,6 @@ var pipelineOrchestratorCapability = {
18013
17986
  pinned: zod.z.boolean(),
18014
17987
  assignedAt: zod.z.number()
18015
17988
  }))),
18016
- /**
18017
- * Get one camera's decoder placement (computed if not yet pinned).
18018
- *
18019
- * ADVISORY today: reports the orchestrator's decoder preference only.
18020
- * Actual decode placement is broker-owned (local-node pin + frame-plane
18021
- * co-location guard). Reserved to become the binding source/decoder-owner
18022
- * control in the stream-LB epic (Phase 2).
18023
- *
18024
- * `pipelineNodeId` is the node already chosen to run inference for
18025
- * this camera. When provided, the balancer prefers co-location with
18026
- * it; omitted → falls back to the last known assignment in the
18027
- * `assignments` map and finally to 'hub'.
18028
- */
18029
- getDecoderAssignment: require_sleep.method(zod.z.object({
18030
- deviceId: zod.z.number(),
18031
- pipelineNodeId: zod.z.string().optional()
18032
- }), DecoderAssignmentSchema),
18033
17989
  /** Read one agent's settings. Null when not yet seeded. */
18034
17990
  getAgentSettings: require_sleep.method(zod.z.object({ agentNodeId: zod.z.string() }), AgentPipelineSettingsSchema.nullable()),
18035
17991
  /** Enumerate every agent's settings (hub + remote runners). */
@@ -18099,14 +18055,15 @@ var pipelineOrchestratorCapability = {
18099
18055
  * `enabledDecoderNodes`, `enabledAudioNodes`, `remoteSourcingNodes`).
18100
18056
  * Each flag is optional in the patch: omit a flag to leave it unchanged,
18101
18057
  * pass `null` to reset it to the node default (`hub` → capable, every
18102
- * other node → not). Detection/decode/audio eligibility is derived from
18103
- * these flags across the cluster; changing them re-derives the enabled
18104
- * sets and reconciles dispatch immediately.
18058
+ * other node → not). Detection/audio eligibility is derived from these
18059
+ * flags across the cluster; changing them re-derives the enabled sets
18060
+ * and reconciles dispatch immediately. There is NO separate decode flag:
18061
+ * decode is always co-located with its frame consumer, so decode
18062
+ * eligibility IS detect eligibility.
18105
18063
  */
18106
18064
  setAgentCapabilities: require_sleep.method(zod.z.object({
18107
18065
  agentNodeId: zod.z.string(),
18108
18066
  detect: zod.z.boolean().nullable().optional(),
18109
- decode: zod.z.boolean().nullable().optional(),
18110
18067
  audio: zod.z.boolean().nullable().optional(),
18111
18068
  ingest: zod.z.boolean().nullable().optional()
18112
18069
  }), zod.z.object({ success: zod.z.literal(true) }), {
@@ -18129,6 +18086,34 @@ var pipelineOrchestratorCapability = {
18129
18086
  kind: "mutation",
18130
18087
  auth: "admin"
18131
18088
  }),
18089
+ /**
18090
+ * Reset one node's pipeline to its hardware-aware defaults — the HONEST
18091
+ * reset (replaces the executor's legacy `resetToDefault`, which cleared a
18092
+ * dead persisted step-tree seed nothing in the live path read):
18093
+ * (a) strips every `modelId` pin from that node's
18094
+ * `agentSettings.addonDefaults` (cells revert to Auto — the node
18095
+ * resolves its own hardware-aware format default at runtime);
18096
+ * (b) clears per-camera step overrides scoped to that node
18097
+ * (`stepOverridesByAgent[node]` + the wholesale
18098
+ * `pipelineByAgent[node]` escape hatch);
18099
+ * (c) clears the executor-side per-device settings stores on that node
18100
+ * (`pipelineExecutor.clearDeviceOverrides`);
18101
+ * (d) hot-reloads every camera assigned to the node.
18102
+ *
18103
+ * Returns the EFFECTIVE post-reset object-detection model for the node
18104
+ * (the executor's pure hardware-aware default) so the UI can report what
18105
+ * will actually run — not a value that never reaches the live path.
18106
+ */
18107
+ resetNodePipelineDefaults: require_sleep.method(zod.z.object({ agentNodeId: zod.z.string() }), zod.z.object({
18108
+ success: zod.z.literal(true),
18109
+ /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
18110
+ effectiveModelId: zod.z.string().nullable(),
18111
+ /** Number of cameras whose node-scoped overrides were cleared. */
18112
+ clearedCameraOverrides: zod.z.number()
18113
+ }), {
18114
+ kind: "mutation",
18115
+ auth: "admin"
18116
+ }),
18132
18117
  /** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
18133
18118
  getCameraSettings: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), CameraPipelineSettingsSchema.nullable()),
18134
18119
  /** Set or clear the 3-state toggle for one (camera, addonId). Pass `enabled: null` to clear and revert to agent default. */
@@ -26100,23 +26085,23 @@ var METHOD_ACCESS_MAP = Object.freeze({
26100
26085
  addonId: null,
26101
26086
  access: "create"
26102
26087
  },
26103
- "pipelineExecutor.deleteModel": {
26088
+ "pipelineExecutor.clearDeviceOverrides": {
26104
26089
  capName: "pipeline-executor",
26105
26090
  capScope: "system",
26106
26091
  addonId: null,
26107
26092
  access: "delete"
26108
26093
  },
26109
- "pipelineExecutor.deleteTemplate": {
26094
+ "pipelineExecutor.deleteModel": {
26110
26095
  capName: "pipeline-executor",
26111
26096
  capScope: "system",
26112
26097
  addonId: null,
26113
26098
  access: "delete"
26114
26099
  },
26115
- "pipelineExecutor.detect": {
26100
+ "pipelineExecutor.deleteTemplate": {
26116
26101
  capName: "pipeline-executor",
26117
26102
  capScope: "system",
26118
26103
  addonId: null,
26119
- access: "view"
26104
+ access: "delete"
26120
26105
  },
26121
26106
  "pipelineExecutor.downloadModel": {
26122
26107
  capName: "pipeline-executor",
@@ -26262,12 +26247,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
26262
26247
  addonId: null,
26263
26248
  access: "create"
26264
26249
  },
26265
- "pipelineExecutor.resetToDefault": {
26266
- capName: "pipeline-executor",
26267
- capScope: "system",
26268
- addonId: null,
26269
- access: "delete"
26270
- },
26271
26250
  "pipelineExecutor.runAudioTest": {
26272
26251
  capName: "pipeline-executor",
26273
26252
  capScope: "system",
@@ -26328,12 +26307,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
26328
26307
  addonId: null,
26329
26308
  access: "create"
26330
26309
  },
26331
- "pipelineOrchestrator.assignDecoder": {
26332
- capName: "pipeline-orchestrator",
26333
- capScope: "system",
26334
- addonId: null,
26335
- access: "create"
26336
- },
26337
26310
  "pipelineOrchestrator.assignPipeline": {
26338
26311
  capName: "pipeline-orchestrator",
26339
26312
  capScope: "system",
@@ -26412,18 +26385,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
26412
26385
  addonId: null,
26413
26386
  access: "view"
26414
26387
  },
26415
- "pipelineOrchestrator.getDecoderAssignment": {
26416
- capName: "pipeline-orchestrator",
26417
- capScope: "system",
26418
- addonId: null,
26419
- access: "view"
26420
- },
26421
- "pipelineOrchestrator.getDecoderAssignments": {
26422
- capName: "pipeline-orchestrator",
26423
- capScope: "system",
26424
- addonId: null,
26425
- access: "view"
26426
- },
26427
26388
  "pipelineOrchestrator.getGlobalMetrics": {
26428
26389
  capName: "pipeline-orchestrator",
26429
26390
  capScope: "system",
@@ -26472,6 +26433,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
26472
26433
  addonId: null,
26473
26434
  access: "delete"
26474
26435
  },
26436
+ "pipelineOrchestrator.resetNodePipelineDefaults": {
26437
+ capName: "pipeline-orchestrator",
26438
+ capScope: "system",
26439
+ addonId: null,
26440
+ access: "delete"
26441
+ },
26475
26442
  "pipelineOrchestrator.resolvePipeline": {
26476
26443
  capName: "pipeline-orchestrator",
26477
26444
  capScope: "system",
@@ -26544,12 +26511,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
26544
26511
  addonId: null,
26545
26512
  access: "create"
26546
26513
  },
26547
- "pipelineOrchestrator.unassignDecoder": {
26548
- capName: "pipeline-orchestrator",
26549
- capScope: "system",
26550
- addonId: null,
26551
- access: "create"
26552
- },
26553
26514
  "pipelineOrchestrator.unassignPipeline": {
26554
26515
  capName: "pipeline-orchestrator",
26555
26516
  capScope: "system",
@@ -28811,12 +28772,10 @@ exports.DayNightSettingsPatchSchema = DayNightSettingsPatchSchema;
28811
28772
  exports.DayNightStatusSchema = DayNightStatusSchema;
28812
28773
  exports.DecodedAudioChunkSchema = require_sleep.DecodedAudioChunkSchema;
28813
28774
  exports.DecodedFrameSchema = require_sleep.DecodedFrameSchema;
28814
- exports.DecoderAssignmentSchema = DecoderAssignmentSchema;
28815
28775
  exports.DecoderSessionConfigSchema = DecoderSessionConfigSchema;
28816
28776
  exports.DecoderStatsSchema = DecoderStatsSchema;
28817
28777
  exports.DeleteIntegrationResultSchema = DeleteIntegrationResultSchema;
28818
28778
  exports.DetectionSourceSchema = DetectionSourceSchema;
28819
- exports.DetectorOutputSchema = DetectorOutputSchema;
28820
28779
  exports.DeviceCodeSeveritySchema = DeviceCodeSeveritySchema;
28821
28780
  exports.DeviceConfig = DeviceConfig;
28822
28781
  exports.DeviceDiscoveryStatusSchema = DeviceDiscoveryStatusSchema;