@camstack/addon-cloudflare 1.2.1 → 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.
@@ -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,8 +11320,24 @@ 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
11342
  height: number().int().positive(),
11326
11343
  /**
@@ -11466,6 +11483,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11466
11483
  hubHostnameOverride: string().optional()
11467
11484
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11468
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
+ /**
11469
11500
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11470
11501
  * specific runner instance via `attachCamera`. Carries everything the
11471
11502
  * runner needs to subscribe to the local broker and execute inference.
@@ -11583,7 +11614,16 @@ var RunnerCameraConfigSchema = object({
11583
11614
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11584
11615
  * this only selects WHICH device pool of that node runs the session.
11585
11616
  */
11586
- 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()
11587
11627
  });
11588
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;
11589
11629
  /**
@@ -11639,7 +11679,18 @@ var RunnerLocalMetricsSchema = object({
11639
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({
11640
11680
  handle: FrameHandleSchema,
11641
11681
  bbox: NativeCropBboxSchema,
11642
- 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()
11643
11694
  }), NativeCropResultSchema.nullable()), method(object({
11644
11695
  deviceId: number(),
11645
11696
  frameHandle: FrameHandleSchema.optional(),
@@ -16806,7 +16857,16 @@ var PipelineTemplateSchema = object({
16806
16857
  });
16807
16858
  var DeviceStepConfigSchema = object({
16808
16859
  modelId: string().optional(),
16809
- settings: record(string(), unknown()).optional()
16860
+ settings: record(string(), unknown()).optional(),
16861
+ /**
16862
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16863
+ * When set, this step runs on the named enabled device of the SAME node
16864
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16865
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16866
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16867
+ * auto-jumps only when the effective device's format cannot run the step.
16868
+ */
16869
+ jumpDeviceKey: string().optional()
16810
16870
  });
16811
16871
  var AgentPipelineSettingsSchema = object({
16812
16872
  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,8 +11320,24 @@ 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
11342
  height: number().int().positive(),
11326
11343
  /**
@@ -11466,6 +11483,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11466
11483
  hubHostnameOverride: string().optional()
11467
11484
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11468
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
+ /**
11469
11500
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11470
11501
  * specific runner instance via `attachCamera`. Carries everything the
11471
11502
  * runner needs to subscribe to the local broker and execute inference.
@@ -11583,7 +11614,16 @@ var RunnerCameraConfigSchema = object({
11583
11614
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11584
11615
  * this only selects WHICH device pool of that node runs the session.
11585
11616
  */
11586
- 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()
11587
11627
  });
11588
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;
11589
11629
  /**
@@ -11639,7 +11679,18 @@ var RunnerLocalMetricsSchema = object({
11639
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({
11640
11680
  handle: FrameHandleSchema,
11641
11681
  bbox: NativeCropBboxSchema,
11642
- 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()
11643
11694
  }), NativeCropResultSchema.nullable()), method(object({
11644
11695
  deviceId: number(),
11645
11696
  frameHandle: FrameHandleSchema.optional(),
@@ -16806,7 +16857,16 @@ var PipelineTemplateSchema = object({
16806
16857
  });
16807
16858
  var DeviceStepConfigSchema = object({
16808
16859
  modelId: string().optional(),
16809
- settings: record(string(), unknown()).optional()
16860
+ settings: record(string(), unknown()).optional(),
16861
+ /**
16862
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16863
+ * When set, this step runs on the named enabled device of the SAME node
16864
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16865
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16866
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16867
+ * auto-jumps only when the effective device's format cannot run the step.
16868
+ */
16869
+ jumpDeviceKey: string().optional()
16810
16870
  });
16811
16871
  var AgentPipelineSettingsSchema = object({
16812
16872
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_dist = require("../dist-Dj-pqK75.js");
24
+ const require_dist = require("../dist-MFDeHonq.js");
25
25
  let node_path = require("node:path");
26
26
  node_path = __toESM(node_path);
27
27
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-DcLZyoLm.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-BIPIB3HA.mjs";
2
2
  import * as path from "node:path";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-Dj-pqK75.js");
2
+ const require_dist = require("../dist-MFDeHonq.js");
3
3
  //#region src/turn/cloudflare-turn.ts
4
4
  /**
5
5
  * Cloudflare returns ICE servers in several flavours depending on which
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-DcLZyoLm.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-BIPIB3HA.mjs";
2
2
  //#region src/turn/cloudflare-turn.ts
3
3
  /**
4
4
  * Cloudflare returns ICE servers in several flavours depending on which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-cloudflare",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Cloudflare bundle — Tunnel (network-access) + TURN relay (turn-provider). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",