@camstack/addon-tailscale 1.2.0 → 1.2.2

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.
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- const require_dist = require("../dist-Dh1t-SVr.js");
27
+ const require_dist = require("../dist-0noe8Yiw.js");
28
28
  let node_child_process = require("node:child_process");
29
29
  let node_util = require("node:util");
30
30
  let node_fs = require("node:fs");
@@ -1,4 +1,4 @@
1
- import { i as EventCategory, n as networkAccessCapability, r as BaseAddon, t as meshNetworkCapability } from "../dist-liMVmwKI.mjs";
1
+ import { i as EventCategory, n as networkAccessCapability, r as BaseAddon, t as meshNetworkCapability } from "../dist-COXW-QqG.mjs";
2
2
  import { execFile, spawn } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import * as fs from "node:fs";
@@ -11013,7 +11013,8 @@ var PipelineStepInputSchema = lazy(() => object({
11013
11013
  modelId: string().optional(),
11014
11014
  enabled: boolean().default(true),
11015
11015
  children: array(PipelineStepInputSchema).optional(),
11016
- settings: record(string(), unknown()).optional()
11016
+ settings: record(string(), unknown()).optional(),
11017
+ jumpDeviceKey: string().optional()
11017
11018
  }));
11018
11019
  var ModelSubstitutionSchema = object({
11019
11020
  addonId: string(),
@@ -11319,10 +11320,40 @@ var NativeCropBboxSchema = object({
11319
11320
  });
11320
11321
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11321
11322
  var NativeCropResultSchema = object({
11322
- /** Packed rgb (24-bit) pixels of the crop. */
11323
- bytes: _instanceof(Uint8Array),
11323
+ /**
11324
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11325
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11326
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11327
+ * path below), where shipping raw RGB is both an invariant violation and, for
11328
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11329
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11330
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11331
+ */
11332
+ bytes: _instanceof(Uint8Array).optional(),
11333
+ /**
11334
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11335
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11336
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11337
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11338
+ * set `encodeJpeg: true`; `bytes` is then absent.
11339
+ */
11340
+ jpeg: string().optional(),
11324
11341
  width: number().int().positive(),
11325
- height: number().int().positive()
11342
+ height: number().int().positive(),
11343
+ /**
11344
+ * Which source served this crop, so a quality-sensitive consumer (the native
11345
+ * `keyFrame`) can reject a degraded fallback:
11346
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11347
+ * quality path).
11348
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11349
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11350
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11351
+ *
11352
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11353
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11354
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11355
+ */
11356
+ tier: _enum(["native", "ram-fullframe"]).optional()
11326
11357
  });
11327
11358
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11328
11359
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11452,6 +11483,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11452
11483
  hubHostnameOverride: string().optional()
11453
11484
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11454
11485
  /**
11486
+ * One ENABLED inference device on the runner's node, as the step-tree
11487
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11488
+ * roster on the attach payload whenever the camera is elected onto a specific
11489
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11490
+ * runner auto-jumps an enrichment step to when the elected device's format
11491
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11492
+ * per-device knobs so the auto choice is weighted-least-loaded.
11493
+ */
11494
+ var RunnerInferenceDeviceSchema = object({
11495
+ deviceKey: string(),
11496
+ weight: number().positive().default(1),
11497
+ maxSessions: number().int().positive().nullable().default(null)
11498
+ });
11499
+ /**
11455
11500
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11456
11501
  * specific runner instance via `attachCamera`. Carries everything the
11457
11502
  * runner needs to subscribe to the local broker and execute inference.
@@ -11569,7 +11614,16 @@ var RunnerCameraConfigSchema = object({
11569
11614
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11570
11615
  * this only selects WHICH device pool of that node runs the session.
11571
11616
  */
11572
- deviceKey: string().optional()
11617
+ deviceKey: string().optional(),
11618
+ /**
11619
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11620
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11621
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11622
+ * step whose model has no build for the elected device's format onto another
11623
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11624
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11625
+ */
11626
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11573
11627
  });
11574
11628
  motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
11575
11629
  /**
@@ -11625,7 +11679,18 @@ var RunnerLocalMetricsSchema = object({
11625
11679
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
11626
11680
  handle: FrameHandleSchema,
11627
11681
  bbox: NativeCropBboxSchema,
11628
- maxWidth: number().int().positive().optional()
11682
+ maxWidth: number().int().positive().optional(),
11683
+ /**
11684
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11685
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11686
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11687
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11688
+ * no raw pixels cross the process boundary. Same-node callers omit it
11689
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11690
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11691
+ * the caller falls back to encoding locally.
11692
+ */
11693
+ encodeJpeg: boolean().optional()
11629
11694
  }), NativeCropResultSchema.nullable()), method(object({
11630
11695
  deviceId: number(),
11631
11696
  frameHandle: FrameHandleSchema.optional(),
@@ -14653,7 +14718,8 @@ var LinkedDeviceSchema = object({
14653
14718
  deviceId: number(),
14654
14719
  name: string(),
14655
14720
  location: string().nullable(),
14656
- features: array(string())
14721
+ features: array(string()),
14722
+ producesTrackedEvents: boolean().optional()
14657
14723
  });
14658
14724
  var SavedDeviceRowSchema = object({
14659
14725
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16300,6 +16366,7 @@ var TrackSchema = object({
16300
16366
  deviceId: number(),
16301
16367
  className: string(),
16302
16368
  label: string().optional(),
16369
+ producingDeviceName: string().optional(),
16303
16370
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16304
16371
  source: TrackSourceSchema.optional(),
16305
16372
  firstSeen: number(),
@@ -16437,7 +16504,8 @@ var MediaFileKindEnum = _enum([
16437
16504
  "fullFrameBoxed",
16438
16505
  "faceCrop",
16439
16506
  "plateCrop",
16440
- "keyFrame"
16507
+ "keyFrame",
16508
+ "keyFrameSmall"
16441
16509
  ]);
16442
16510
  var MediaFileSchema = object({
16443
16511
  key: string(),
@@ -16768,7 +16836,16 @@ var PipelineTemplateSchema = object({
16768
16836
  });
16769
16837
  var DeviceStepConfigSchema = object({
16770
16838
  modelId: string().optional(),
16771
- settings: record(string(), unknown()).optional()
16839
+ settings: record(string(), unknown()).optional(),
16840
+ /**
16841
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16842
+ * When set, this step runs on the named enabled device of the SAME node
16843
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16844
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16845
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16846
+ * auto-jumps only when the effective device's format cannot run the step.
16847
+ */
16848
+ jumpDeviceKey: string().optional()
16772
16849
  });
16773
16850
  var AgentPipelineSettingsSchema = object({
16774
16851
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -11013,7 +11013,8 @@ var PipelineStepInputSchema = lazy(() => object({
11013
11013
  modelId: string().optional(),
11014
11014
  enabled: boolean().default(true),
11015
11015
  children: array(PipelineStepInputSchema).optional(),
11016
- settings: record(string(), unknown()).optional()
11016
+ settings: record(string(), unknown()).optional(),
11017
+ jumpDeviceKey: string().optional()
11017
11018
  }));
11018
11019
  var ModelSubstitutionSchema = object({
11019
11020
  addonId: string(),
@@ -11319,10 +11320,40 @@ var NativeCropBboxSchema = object({
11319
11320
  });
11320
11321
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11321
11322
  var NativeCropResultSchema = object({
11322
- /** Packed rgb (24-bit) pixels of the crop. */
11323
- bytes: _instanceof(Uint8Array),
11323
+ /**
11324
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11325
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11326
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11327
+ * path below), where shipping raw RGB is both an invariant violation and, for
11328
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11329
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11330
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11331
+ */
11332
+ bytes: _instanceof(Uint8Array).optional(),
11333
+ /**
11334
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11335
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11336
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11337
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11338
+ * set `encodeJpeg: true`; `bytes` is then absent.
11339
+ */
11340
+ jpeg: string().optional(),
11324
11341
  width: number().int().positive(),
11325
- height: number().int().positive()
11342
+ height: number().int().positive(),
11343
+ /**
11344
+ * Which source served this crop, so a quality-sensitive consumer (the native
11345
+ * `keyFrame`) can reject a degraded fallback:
11346
+ * - `native` — cut from the decode worker's retained NATIVE surface (the
11347
+ * quality path).
11348
+ * - `ram-fullframe` — the native surface MISSED but the request was full-frame,
11349
+ * so the ≤640 RAM `RetainedFrameStore` served it (honest lower-res; legit for
11350
+ * the blank-frame guard / 640-snapshot resolve, NOT for the clean keyFrame).
11351
+ *
11352
+ * OPTIONAL: a pre-tier runner (version skew) omits it — an ABSENT `tier` MUST be
11353
+ * treated as `native` (accepted) by every consumer so mixed-version clusters
11354
+ * keep the pre-tier behaviour. An ROI miss returns `null` (no tier at all).
11355
+ */
11356
+ tier: _enum(["native", "ram-fullframe"]).optional()
11326
11357
  });
11327
11358
  /** Parent detection context passed to `runDetailSubtree` — the crop's
11328
11359
  * originating detection, in FRAME-space coordinates. Reuses
@@ -11452,6 +11483,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11452
11483
  hubHostnameOverride: string().optional()
11453
11484
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11454
11485
  /**
11486
+ * One ENABLED inference device on the runner's node, as the step-tree
11487
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11488
+ * roster on the attach payload whenever the camera is elected onto a specific
11489
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11490
+ * runner auto-jumps an enrichment step to when the elected device's format
11491
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11492
+ * per-device knobs so the auto choice is weighted-least-loaded.
11493
+ */
11494
+ var RunnerInferenceDeviceSchema = object({
11495
+ deviceKey: string(),
11496
+ weight: number().positive().default(1),
11497
+ maxSessions: number().int().positive().nullable().default(null)
11498
+ });
11499
+ /**
11455
11500
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11456
11501
  * specific runner instance via `attachCamera`. Carries everything the
11457
11502
  * runner needs to subscribe to the local broker and execute inference.
@@ -11569,7 +11614,16 @@ var RunnerCameraConfigSchema = object({
11569
11614
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11570
11615
  * this only selects WHICH device pool of that node runs the session.
11571
11616
  */
11572
- deviceKey: string().optional()
11617
+ deviceKey: string().optional(),
11618
+ /**
11619
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11620
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11621
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11622
+ * step whose model has no build for the elected device's format onto another
11623
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11624
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11625
+ */
11626
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11573
11627
  });
11574
11628
  motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
11575
11629
  /**
@@ -11625,7 +11679,18 @@ var RunnerLocalMetricsSchema = object({
11625
11679
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
11626
11680
  handle: FrameHandleSchema,
11627
11681
  bbox: NativeCropBboxSchema,
11628
- maxWidth: number().int().positive().optional()
11682
+ maxWidth: number().int().positive().optional(),
11683
+ /**
11684
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11685
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11686
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11687
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11688
+ * no raw pixels cross the process boundary. Same-node callers omit it
11689
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11690
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11691
+ * the caller falls back to encoding locally.
11692
+ */
11693
+ encodeJpeg: boolean().optional()
11629
11694
  }), NativeCropResultSchema.nullable()), method(object({
11630
11695
  deviceId: number(),
11631
11696
  frameHandle: FrameHandleSchema.optional(),
@@ -14653,7 +14718,8 @@ var LinkedDeviceSchema = object({
14653
14718
  deviceId: number(),
14654
14719
  name: string(),
14655
14720
  location: string().nullable(),
14656
- features: array(string())
14721
+ features: array(string()),
14722
+ producesTrackedEvents: boolean().optional()
14657
14723
  });
14658
14724
  var SavedDeviceRowSchema = object({
14659
14725
  /** Numeric id reserved at allocateDeviceId time. */
@@ -16300,6 +16366,7 @@ var TrackSchema = object({
16300
16366
  deviceId: number(),
16301
16367
  className: string(),
16302
16368
  label: string().optional(),
16369
+ producingDeviceName: string().optional(),
16303
16370
  /** Track provenance. Absent ⇒ `pipeline` (legacy rows). */
16304
16371
  source: TrackSourceSchema.optional(),
16305
16372
  firstSeen: number(),
@@ -16437,7 +16504,8 @@ var MediaFileKindEnum = _enum([
16437
16504
  "fullFrameBoxed",
16438
16505
  "faceCrop",
16439
16506
  "plateCrop",
16440
- "keyFrame"
16507
+ "keyFrame",
16508
+ "keyFrameSmall"
16441
16509
  ]);
16442
16510
  var MediaFileSchema = object({
16443
16511
  key: string(),
@@ -16768,7 +16836,16 @@ var PipelineTemplateSchema = object({
16768
16836
  });
16769
16837
  var DeviceStepConfigSchema = object({
16770
16838
  modelId: string().optional(),
16771
- settings: record(string(), unknown()).optional()
16839
+ settings: record(string(), unknown()).optional(),
16840
+ /**
16841
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16842
+ * When set, this step runs on the named enabled device of the SAME node
16843
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16844
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16845
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16846
+ * auto-jumps only when the effective device's format cannot run the step.
16847
+ */
16848
+ jumpDeviceKey: string().optional()
16772
16849
  });
16773
16850
  var AgentPipelineSettingsSchema = object({
16774
16851
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Dh1t-SVr.js");
5
+ const require_dist = require("../dist-0noe8Yiw.js");
6
6
  let node_child_process = require("node:child_process");
7
7
  let node_util = require("node:util");
8
8
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { i as EventCategory, n as networkAccessCapability, r as BaseAddon } from "../dist-liMVmwKI.mjs";
1
+ import { i as EventCategory, n as networkAccessCapability, r as BaseAddon } from "../dist-COXW-QqG.mjs";
2
2
  import { execFile } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import { randomUUID } from "node:crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-tailscale",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Tailscale bundle for CamStack — joins the host to a tailnet (client) and exposes the hub via Serve/Funnel (ingress). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",