@camstack/types 1.2.98 → 1.2.99

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 (32) hide show
  1. package/dist/capabilities/alerts.cap.d.ts +5 -5
  2. package/dist/capabilities/custom-model-registry.cap.d.ts +18 -0
  3. package/dist/capabilities/decoder.cap.d.ts +12 -12
  4. package/dist/capabilities/index.d.ts +1 -1
  5. package/dist/capabilities/local-network.cap.d.ts +38 -7
  6. package/dist/capabilities/model-convert.cap.d.ts +27 -0
  7. package/dist/capabilities/model-distributor.cap.d.ts +18 -0
  8. package/dist/capabilities/motion-detection.cap.d.ts +4 -4
  9. package/dist/capabilities/native-object-detection.cap.d.ts +15 -15
  10. package/dist/capabilities/notification-rules.cap.d.ts +2 -2
  11. package/dist/capabilities/osd-manager.cap.d.ts +1 -1
  12. package/dist/capabilities/pipeline-analytics.cap.d.ts +10 -10
  13. package/dist/capabilities/pipeline-executor.cap.d.ts +16 -12
  14. package/dist/capabilities/pipeline-runner.cap.d.ts +182 -5
  15. package/dist/capabilities/schemas/detection-shared.d.ts +4 -4
  16. package/dist/capabilities/schemas/streaming-shared.d.ts +6 -6
  17. package/dist/capabilities/stream-broker.cap.d.ts +3 -3
  18. package/dist/capabilities/zone-rules.cap.d.ts +3 -3
  19. package/dist/generated/addon-api.d.ts +14 -0
  20. package/dist/generated/method-access-map.d.ts +1 -1
  21. package/dist/generated/system-proxy.d.ts +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +141 -15
  24. package/dist/index.mjs +138 -16
  25. package/dist/interfaces/pipeline-executor-capability.d.ts +3 -0
  26. package/dist/interfaces/pipeline-runner-capability.d.ts +31 -0
  27. package/dist/interfaces/stream-broker.d.ts +5 -2
  28. package/dist/types/frame-view.d.ts +52 -0
  29. package/dist/types/io.d.ts +3 -0
  30. package/dist/types/labels.d.ts +11 -0
  31. package/dist/types/models.d.ts +27 -0
  32. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2359,6 +2359,17 @@ var LabelDefinitionSchema = zod.z.object({
2359
2359
  description: zod.z.string().optional(),
2360
2360
  icon: zod.z.string().optional()
2361
2361
  });
2362
+ /** Detection-macro targets a catalog `classMap` may resolve to. */
2363
+ var CLASS_MAP_MACRO_TARGETS = [
2364
+ "person",
2365
+ "vehicle",
2366
+ "animal",
2367
+ "package"
2368
+ ];
2369
+ var ClassMapDefinitionSchema = zod.z.object({
2370
+ mapping: zod.z.record(zod.z.string(), zod.z.enum(CLASS_MAP_MACRO_TARGETS)),
2371
+ preserveOriginal: zod.z.boolean()
2372
+ });
2362
2373
  //#endregion
2363
2374
  //#region src/types/model-variant-groups.ts
2364
2375
  var FORMAT_KEYS = [
@@ -2689,7 +2700,13 @@ var ModelCatalogEntrySchema = zod.z.object({
2689
2700
  * `id` stays the source of truth for resolution/download/persistence; grouping
2690
2701
  * is a presentation overlay resolved back to an `id`.
2691
2702
  */
2692
- group: ModelVariantGroupSchema.optional()
2703
+ group: ModelVariantGroupSchema.optional(),
2704
+ /**
2705
+ * Per-MODEL class map override. Absent ⇒ the step's `StepDefinition.classMap`
2706
+ * applies (Frigate / COCO public catalog). Set on a custom model whose raw
2707
+ * labels already ARE the CamStack macros (Scrypted identity map).
2708
+ */
2709
+ classMap: ClassMapDefinitionSchema.optional()
2693
2710
  });
2694
2711
  var ConvertTargetSchema = zod.z.discriminatedUnion("format", [zod.z.object({
2695
2712
  format: zod.z.literal("openvino"),
@@ -2718,7 +2735,8 @@ var ModelConvertMetadataSchema = zod.z.object({
2718
2735
  "ocr",
2719
2736
  "segmentation"
2720
2737
  ]),
2721
- faceAlignment: zod.z.boolean().optional()
2738
+ faceAlignment: zod.z.boolean().optional(),
2739
+ classMap: ClassMapDefinitionSchema.optional()
2722
2740
  });
2723
2741
  var ConvertArtifactSchema = zod.z.object({
2724
2742
  format: zod.z.enum(MODEL_FORMATS),
@@ -16276,6 +16294,33 @@ var NativeCropRefSchema = zod.z.object({
16276
16294
  h: zod.z.number()
16277
16295
  })
16278
16296
  });
16297
+ zod.z.object({
16298
+ crop: zod.z.object({
16299
+ left: zod.z.number(),
16300
+ top: zod.z.number(),
16301
+ width: zod.z.number().positive(),
16302
+ height: zod.z.number().positive()
16303
+ }).optional(),
16304
+ content: zod.z.object({
16305
+ width: zod.z.number().int().positive(),
16306
+ height: zod.z.number().int().positive()
16307
+ }),
16308
+ fit: zod.z.enum(["stretch", "contain"]),
16309
+ format: zod.z.enum([
16310
+ "rgb",
16311
+ "gray",
16312
+ "jpeg"
16313
+ ])
16314
+ });
16315
+ var FrameRefSchema = zod.z.object({
16316
+ registryId: zod.z.string().min(1),
16317
+ id: zod.z.string().min(1),
16318
+ width: zod.z.number().int().positive(),
16319
+ height: zod.z.number().int().positive(),
16320
+ format: zod.z.enum(["rgb", "gray"]),
16321
+ timestamp: zod.z.number(),
16322
+ capturedAt: zod.z.number().optional()
16323
+ });
16279
16324
  var ModelFormatSchema$1 = zod.z.enum([
16280
16325
  "onnx",
16281
16326
  "coreml",
@@ -16597,7 +16642,7 @@ var pipelineExecutorCapability = {
16597
16642
  * legacy call shape used by existing benchmark code; once all
16598
16643
  * callers pass it explicitly we make it required.
16599
16644
  *
16600
- * Exactly one of `frame`, `frameHandle`, `imageBase64`,
16645
+ * Exactly one of `frame`, `frameRef`, `frameHandle`, `imageBase64`,
16601
16646
  * `referenceImage` must be provided:
16602
16647
  * - `frame`: runtime dispatch path (runner → decoded broker frame).
16603
16648
  * Carries the raw buffer, dimensions, and format; the executor
@@ -16619,6 +16664,12 @@ var pipelineExecutorCapability = {
16619
16664
  steps: zod.z.array(PipelineStepInputSchema).min(1),
16620
16665
  frame: FrameInputSchema.optional(),
16621
16666
  /**
16667
+ * Process-local lazy frame. Valid only when caller and provider resolve
16668
+ * in the same execution-group process; split/cross-node callers use
16669
+ * `frame`/`image` inline compatibility instead.
16670
+ */
16671
+ frameRef: FrameRefSchema.optional(),
16672
+ /**
16622
16673
  * CB5 shm passthrough — a `FrameHandle` naming the same ring slot
16623
16674
  * the decoded pixels live in. One more member of the one-of
16624
16675
  * frame/frameHandle/image/imageBase64/referenceImage group.
@@ -16975,7 +17026,10 @@ var NativeCropResultSchema = zod.z.object({
16975
17026
  * Which source served this crop, so a quality-sensitive consumer (the native
16976
17027
  * `keyFrame`) can reject a degraded fallback:
16977
17028
  * - `native` — cut from the decode worker's retained NATIVE surface (the
16978
- * quality path).
17029
+ * quality path). A subject-tile serve is also native-resolution and stays
17030
+ * `native` here: the public enum cannot name `tile` without a breaking cap
17031
+ * change. Runner telemetry distinguishes lease vs tile via `source` on the
17032
+ * internal crop result (`nativeHits` vs `tileHits`).
16979
17033
  * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
16980
17034
  * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
16981
17035
  * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
@@ -17624,12 +17678,41 @@ var RunnerLocalLoadSchema = zod.z.object({
17624
17678
  * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
17625
17679
  * working unchanged when they switch to reading from the runner cap.
17626
17680
  */
17681
+ var FrameLazyCountersSchema = zod.z.object({
17682
+ framesDecoded: zod.z.number(),
17683
+ framesAdmitted: zod.z.number(),
17684
+ framesDroppedPixelFree: zod.z.number(),
17685
+ viewsMaterialized: zod.z.number(),
17686
+ viewsSkipped: zod.z.number(),
17687
+ workerToRunnerBytes: zod.z.number(),
17688
+ runnerToPoolRawBytes: zod.z.number(),
17689
+ runnerToPoolJpegBytes: zod.z.number(),
17690
+ onDemandFullFrameRequests: zod.z.number(),
17691
+ onDemandCropRequests: zod.z.number(),
17692
+ nativeHits: zod.z.number(),
17693
+ nativeMisses: zod.z.number(),
17694
+ tileHits: zod.z.number(),
17695
+ tileMisses: zod.z.number(),
17696
+ fallbackHits: zod.z.number(),
17697
+ fallbackMisses: zod.z.number(),
17698
+ retainedWritesAvoided: zod.z.number(),
17699
+ residentRefs: zod.z.number(),
17700
+ residentBytes: zod.z.number(),
17701
+ releases: zod.z.number(),
17702
+ evictions: zod.z.number(),
17703
+ staleMisses: zod.z.number()
17704
+ });
17705
+ var FrameLazyMetricsSchema = zod.z.object({
17706
+ node: FrameLazyCountersSchema,
17707
+ cameras: zod.z.array(FrameLazyCountersSchema.extend({ deviceId: zod.z.number() }))
17708
+ });
17627
17709
  var RunnerLocalMetricsSchema = zod.z.object({
17628
17710
  nodeId: zod.z.string(),
17629
17711
  activeCameras: zod.z.number(),
17630
17712
  throttledCameras: zod.z.number(),
17631
17713
  avgInferenceTimeMs: zod.z.number(),
17632
- queueDepth: zod.z.number()
17714
+ queueDepth: zod.z.number(),
17715
+ frameLazy: FrameLazyMetricsSchema.optional()
17633
17716
  });
17634
17717
  /**
17635
17718
  * Pipeline Runner capability — runtime detection workhorse.
@@ -24696,6 +24779,17 @@ var NotificationEndpointSchema = zod.z.object({
24696
24779
  /** What the ranking currently resolves to (null when nothing is reachable). */
24697
24780
  resolved: zod.z.string().nullable()
24698
24781
  });
24782
+ /**
24783
+ * The URLs the SDK / viewer should race for API access. `baseUrls` empty =
24784
+ * AUTO (every LAN IPv4 + the public tunnel). `resolved` is what that choice
24785
+ * currently expands to, so the UI can show the effective set either way.
24786
+ */
24787
+ var ViewerEndpointsSchema = zod.z.object({
24788
+ /** The operator's explicit race set, or empty for AUTO. */
24789
+ baseUrls: zod.z.array(zod.z.string()).readonly(),
24790
+ /** What the ranking currently resolves to (may be empty if nothing is up). */
24791
+ resolved: zod.z.array(zod.z.string()).readonly()
24792
+ });
24699
24793
  var AllowedAddressesSchema = zod.z.object({
24700
24794
  /**
24701
24795
  * Allowlist of interface addresses operators have explicitly opted
@@ -24737,13 +24831,13 @@ var localNetworkCapability = {
24737
24831
  */
24738
24832
  getPreferred: require_sleep.method(zod.z.void(), PreferredSchema),
24739
24833
  /**
24740
- * Ordered candidate base URLs the SDK should try on connect.
24741
- * Includes LAN IPs (one per non-internal interface), the public
24742
- * tunnel hostname (when active), and loopback as a last-resort
24743
- * fallback. Filterable by `includeLoopback` / `ipv4Only`.
24744
- * Honours `getAllowedAddresses()` when set addresses outside
24745
- * the allowlist are dropped (the public tunnel + loopback are
24746
- * always included as escape hatches).
24834
+ * Ordered candidate base URLs (the palette the Network tab shows).
24835
+ * Includes LAN IPv4, stable LAN IPv6, the public tunnel, and mesh when
24836
+ * joined. Loopback is off by default. The SDK races the subset from
24837
+ * `getViewerEndpoints`, not this full list — IPv6 stays here because
24838
+ * WebRTC ICE gathers dual-stack regardless of the HTTP race. Honours
24839
+ * `getAllowedAddresses()` when set addresses outside the allowlist
24840
+ * are dropped (the public tunnel is still included as an escape hatch).
24747
24841
  *
24748
24842
  * **The port is the hub's, not the caller's** (D62 — a function's fact
24749
24843
  * belongs to whoever already owns it). This method used to take a `port`
@@ -24774,10 +24868,11 @@ var localNetworkCapability = {
24774
24868
  */
24775
24869
  port: zod.z.number().int().min(1).max(65535).optional(),
24776
24870
  /** Include `http(s)://127.0.0.1:<port>` as the lowest-priority
24777
- * candidate. Default `true`. */
24871
+ * candidate. Default `false` — loopback is not a client route. */
24778
24872
  includeLoopback: zod.z.boolean().optional(),
24779
- /** Skip IPv6 entries. Some legacy clients can't parse them.
24780
- * Default `false`. */
24873
+ /** Skip IPv6 entries. Default `false` the palette includes stable
24874
+ * LAN IPv6 (ICE/WebRTC uses dual-stack regardless). Pass `true` to
24875
+ * hide them. The viewer HTTP/WS race is `getViewerEndpoints`. */
24781
24876
  ipv4Only: zod.z.boolean().optional(),
24782
24877
  /** Scheme to emit for LAN/loopback URLs. Default `'http'`.
24783
24878
  * Pass `'https'` when the caller is itself loaded over HTTPS
@@ -24806,6 +24901,19 @@ var localNetworkCapability = {
24806
24901
  */
24807
24902
  setNotificationEndpoint: require_sleep.method(zod.z.object({ baseUrl: zod.z.string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }),
24808
24903
  /**
24904
+ * The endpoints the SDK / viewer races for API access. Empty `baseUrls`
24905
+ * means AUTO: every LAN IPv4 address plus the public tunnel, never IPv6,
24906
+ * never mesh, never loopback. `resolved` is that set (or the operator's
24907
+ * explicit subset) as it stands right now.
24908
+ */
24909
+ getViewerEndpoints: require_sleep.method(zod.z.void(), ViewerEndpointsSchema),
24910
+ /**
24911
+ * Replace the viewer race set. Empty `baseUrls` restores AUTO. Stored
24912
+ * verbatim (not indices) so a temporarily-down tunnel is not silently
24913
+ * dropped from the operator's choice.
24914
+ */
24915
+ setViewerEndpoints: require_sleep.method(zod.z.object({ baseUrls: zod.z.array(zod.z.string()).readonly() }), ViewerEndpointsSchema, { kind: "mutation" }),
24916
+ /**
24809
24917
  * Read the operator's allowlist. Empty = "auto" (no filter). Used
24810
24918
  * by the admin UI's address selector to seed its checkbox state.
24811
24919
  */
@@ -36817,6 +36925,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36817
36925
  addonId: null,
36818
36926
  access: "view"
36819
36927
  },
36928
+ "localNetwork.getViewerEndpoints": {
36929
+ capName: "local-network",
36930
+ capScope: "system",
36931
+ addonId: null,
36932
+ access: "view"
36933
+ },
36820
36934
  "localNetwork.list": {
36821
36935
  capName: "local-network",
36822
36936
  capScope: "system",
@@ -36853,6 +36967,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36853
36967
  addonId: null,
36854
36968
  access: "create"
36855
36969
  },
36970
+ "localNetwork.setViewerEndpoints": {
36971
+ capName: "local-network",
36972
+ capScope: "system",
36973
+ addonId: null,
36974
+ access: "create"
36975
+ },
36856
36976
  "localNetwork.uploadCertificate": {
36857
36977
  capName: "local-network",
36858
36978
  capScope: "system",
@@ -43055,6 +43175,8 @@ function createSystemProxy(api) {
43055
43175
  getConnectionEndpoints: (input) => dispatch("localNetwork", "getConnectionEndpoints", "query", input),
43056
43176
  getNotificationEndpoint: (input) => dispatch("localNetwork", "getNotificationEndpoint", "query", input),
43057
43177
  setNotificationEndpoint: (input) => dispatch("localNetwork", "setNotificationEndpoint", "mutation", input),
43178
+ getViewerEndpoints: (input) => dispatch("localNetwork", "getViewerEndpoints", "query", input),
43179
+ setViewerEndpoints: (input) => dispatch("localNetwork", "setViewerEndpoints", "mutation", input),
43058
43180
  getAllowedAddresses: (input) => dispatch("localNetwork", "getAllowedAddresses", "query", input),
43059
43181
  setAllowedAddresses: (input) => dispatch("localNetwork", "setAllowedAddresses", "mutation", input),
43060
43182
  resetAllowlistToBestMatch: (input) => dispatch("localNetwork", "resetAllowlistToBestMatch", "mutation", input),
@@ -47382,6 +47504,7 @@ exports.CAPABILITY_ROUTER_KEYS = CAPABILITY_ROUTER_KEYS;
47382
47504
  exports.CAP_NAMES_WITH_STATUS = CAP_NAMES_WITH_STATUS;
47383
47505
  exports.CAP_NODE_PIN_CONTEXT_KEY = require_sleep.CAP_NODE_PIN_CONTEXT_KEY;
47384
47506
  exports.CAP_PROVIDER_KIND_MAP = CAP_PROVIDER_KIND_MAP;
47507
+ exports.CLASS_MAP_MACRO_TARGETS = CLASS_MAP_MACRO_TARGETS;
47385
47508
  exports.CLUSTER_MODEL_SCOPED_STEPS = CLUSTER_MODEL_SCOPED_STEPS;
47386
47509
  exports.CLUSTER_MODEL_SECTION_ID = CLUSTER_MODEL_SECTION_ID;
47387
47510
  exports.CLUSTER_STEP_SETTING_FIELDS = CLUSTER_STEP_SETTING_FIELDS;
@@ -47428,6 +47551,7 @@ exports.CapScopeSchema = CapScopeSchema;
47428
47551
  exports.CapabilityBindingsSchema = CapabilityBindingsSchema;
47429
47552
  exports.CarbonMonoxideStatusSchema = CarbonMonoxideStatusSchema;
47430
47553
  exports.ChargingStatus = require_sleep.ChargingStatus;
47554
+ exports.ClassMapDefinitionSchema = ClassMapDefinitionSchema;
47431
47555
  exports.ClientNetworkStatsSchema = ClientNetworkStatsSchema;
47432
47556
  exports.ClimateControlStatusSchema = ClimateControlStatusSchema;
47433
47557
  exports.ClipPlaybackSchema = ClipPlaybackSchema;
@@ -47603,6 +47727,8 @@ exports.Fmp4BoxSplitter = require_canonical_hash.Fmp4BoxSplitter;
47603
47727
  exports.FrameHandleFormatSchema = require_sleep.FrameHandleFormatSchema;
47604
47728
  exports.FrameHandleSchema = require_sleep.FrameHandleSchema;
47605
47729
  exports.FrameInputSchema = FrameInputSchema;
47730
+ exports.FrameLazyCountersSchema = FrameLazyCountersSchema;
47731
+ exports.FrameLazyMetricsSchema = FrameLazyMetricsSchema;
47606
47732
  exports.GasStatusSchema = GasStatusSchema;
47607
47733
  exports.GetStreamWithCodecInputSchema = GetStreamWithCodecInputSchema;
47608
47734
  exports.GlobalMetricsSchema = GlobalMetricsSchema;