@camstack/addon-remote-storage 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.
package/dist/s3.addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-C77pnEyI.js");
5
+ const require_shared = require("./shared-B_GfteRr.js");
6
6
  let node_stream = require("node:stream");
7
7
  let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
8
8
  let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
package/dist/s3.addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-BXdymO1F.mjs";
1
+ import { c as BaseAddon, i as rearmIdleAbort, n as getOptionalBasePath, o as scheduleIdleAbort, s as storageProviderCapability, t as createSessionId } from "./shared-Co8avCOn.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { DeleteObjectCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
4
  import { Upload } from "@aws-sdk/lib-storage";
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_shared = require("./shared-C77pnEyI.js");
5
+ const require_shared = require("./shared-B_GfteRr.js");
6
6
  let ssh2 = require("ssh2");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_shared.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-BXdymO1F.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-Co8avCOn.mjs";
2
2
  import { Client } from "ssh2";
3
3
  import * as path from "node:path";
4
4
  //#region src/providers/sftp/sftp-config-schema.ts
@@ -11038,7 +11038,8 @@ var PipelineStepInputSchema = lazy(() => object({
11038
11038
  modelId: string().optional(),
11039
11039
  enabled: boolean().default(true),
11040
11040
  children: array(PipelineStepInputSchema).optional(),
11041
- settings: record(string(), unknown()).optional()
11041
+ settings: record(string(), unknown()).optional(),
11042
+ jumpDeviceKey: string().optional()
11042
11043
  }));
11043
11044
  var ModelSubstitutionSchema = object({
11044
11045
  addonId: string(),
@@ -11344,8 +11345,24 @@ var NativeCropBboxSchema = object({
11344
11345
  });
11345
11346
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11346
11347
  var NativeCropResultSchema = object({
11347
- /** Packed rgb (24-bit) pixels of the crop. */
11348
- bytes: _instanceof(Uint8Array),
11348
+ /**
11349
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11350
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11351
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11352
+ * path below), where shipping raw RGB is both an invariant violation and, for
11353
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11354
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11355
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11356
+ */
11357
+ bytes: _instanceof(Uint8Array).optional(),
11358
+ /**
11359
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11360
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11361
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11362
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11363
+ * set `encodeJpeg: true`; `bytes` is then absent.
11364
+ */
11365
+ jpeg: string().optional(),
11349
11366
  width: number().int().positive(),
11350
11367
  height: number().int().positive(),
11351
11368
  /**
@@ -11491,6 +11508,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11491
11508
  hubHostnameOverride: string().optional()
11492
11509
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11493
11510
  /**
11511
+ * One ENABLED inference device on the runner's node, as the step-tree
11512
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11513
+ * roster on the attach payload whenever the camera is elected onto a specific
11514
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11515
+ * runner auto-jumps an enrichment step to when the elected device's format
11516
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11517
+ * per-device knobs so the auto choice is weighted-least-loaded.
11518
+ */
11519
+ var RunnerInferenceDeviceSchema = object({
11520
+ deviceKey: string(),
11521
+ weight: number().positive().default(1),
11522
+ maxSessions: number().int().positive().nullable().default(null)
11523
+ });
11524
+ /**
11494
11525
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11495
11526
  * specific runner instance via `attachCamera`. Carries everything the
11496
11527
  * runner needs to subscribe to the local broker and execute inference.
@@ -11608,7 +11639,16 @@ var RunnerCameraConfigSchema = object({
11608
11639
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11609
11640
  * this only selects WHICH device pool of that node runs the session.
11610
11641
  */
11611
- deviceKey: string().optional()
11642
+ deviceKey: string().optional(),
11643
+ /**
11644
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11645
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11646
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11647
+ * step whose model has no build for the elected device's format onto another
11648
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11649
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11650
+ */
11651
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11612
11652
  });
11613
11653
  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;
11614
11654
  /**
@@ -11664,7 +11704,18 @@ var RunnerLocalMetricsSchema = object({
11664
11704
  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({
11665
11705
  handle: FrameHandleSchema,
11666
11706
  bbox: NativeCropBboxSchema,
11667
- maxWidth: number().int().positive().optional()
11707
+ maxWidth: number().int().positive().optional(),
11708
+ /**
11709
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11710
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11711
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11712
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11713
+ * no raw pixels cross the process boundary. Same-node callers omit it
11714
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11715
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11716
+ * the caller falls back to encoding locally.
11717
+ */
11718
+ encodeJpeg: boolean().optional()
11668
11719
  }), NativeCropResultSchema.nullable()), method(object({
11669
11720
  deviceId: number(),
11670
11721
  frameHandle: FrameHandleSchema.optional(),
@@ -16793,7 +16844,16 @@ var PipelineTemplateSchema = object({
16793
16844
  });
16794
16845
  var DeviceStepConfigSchema = object({
16795
16846
  modelId: string().optional(),
16796
- settings: record(string(), unknown()).optional()
16847
+ settings: record(string(), unknown()).optional(),
16848
+ /**
16849
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16850
+ * When set, this step runs on the named enabled device of the SAME node
16851
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16852
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16853
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16854
+ * auto-jumps only when the effective device's format cannot run the step.
16855
+ */
16856
+ jumpDeviceKey: string().optional()
16797
16857
  });
16798
16858
  var AgentPipelineSettingsSchema = object({
16799
16859
  maxCameras: number().int().nonnegative().nullable().default(null),
@@ -11015,7 +11015,8 @@ var PipelineStepInputSchema = lazy(() => object({
11015
11015
  modelId: string().optional(),
11016
11016
  enabled: boolean().default(true),
11017
11017
  children: array(PipelineStepInputSchema).optional(),
11018
- settings: record(string(), unknown()).optional()
11018
+ settings: record(string(), unknown()).optional(),
11019
+ jumpDeviceKey: string().optional()
11019
11020
  }));
11020
11021
  var ModelSubstitutionSchema = object({
11021
11022
  addonId: string(),
@@ -11321,8 +11322,24 @@ var NativeCropBboxSchema = object({
11321
11322
  });
11322
11323
  /** Result of a best-effort native-resolution crop (`getNativeCrop`). */
11323
11324
  var NativeCropResultSchema = object({
11324
- /** Packed rgb (24-bit) pixels of the crop. */
11325
- bytes: _instanceof(Uint8Array),
11325
+ /**
11326
+ * Packed rgb (24-bit) pixels of the crop. Present on the DEFAULT (raw) path —
11327
+ * same-node (in-process / UDS) callers get zero-copy RGB and encode locally.
11328
+ * OMITTED when the caller requested `encodeJpeg` (the cross-node compressed
11329
+ * path below), where shipping raw RGB is both an invariant violation and, for
11330
+ * a native full frame (~26 MB at 4K), larger than Moleculer's 10 MB
11331
+ * `maxPacketSize` → the packet is dropped and the call 60s-times-out. That is
11332
+ * the cross-node native-media miss: `bytes` is replaced by `jpeg`.
11333
+ */
11334
+ bytes: _instanceof(Uint8Array).optional(),
11335
+ /**
11336
+ * Base64 JPEG of the crop — the COMPRESSED cross-node payload. The OWNING node
11337
+ * (which holds the native surface) encodes it in-process, so a native 4K frame
11338
+ * ships as ~0.5–2 MB (well under `maxPacketSize`) and NO raw pixels ever cross
11339
+ * a process boundary (CLAUDE.md invariant #21). Present ONLY when the request
11340
+ * set `encodeJpeg: true`; `bytes` is then absent.
11341
+ */
11342
+ jpeg: string().optional(),
11326
11343
  width: number().int().positive(),
11327
11344
  height: number().int().positive(),
11328
11345
  /**
@@ -11468,6 +11485,20 @@ var RunnerFrameSourceSchema = discriminatedUnion("kind", [object({ kind: literal
11468
11485
  hubHostnameOverride: string().optional()
11469
11486
  })]).describe("Per-camera frame-source mode for the runner (P2c)");
11470
11487
  /**
11488
+ * One ENABLED inference device on the runner's node, as the step-tree
11489
+ * device-jump resolver sees it (phase 1). The orchestrator populates this
11490
+ * roster on the attach payload whenever the camera is elected onto a specific
11491
+ * `deviceKey` and the node has ≥2 enabled devices — it is the candidate set the
11492
+ * runner auto-jumps an enrichment step to when the elected device's format
11493
+ * cannot run that step's model. `weight`/`maxSessions` mirror the balancer's
11494
+ * per-device knobs so the auto choice is weighted-least-loaded.
11495
+ */
11496
+ var RunnerInferenceDeviceSchema = object({
11497
+ deviceKey: string(),
11498
+ weight: number().positive().default(1),
11499
+ maxSessions: number().int().positive().nullable().default(null)
11500
+ });
11501
+ /**
11471
11502
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
11472
11503
  * specific runner instance via `attachCamera`. Carries everything the
11473
11504
  * runner needs to subscribe to the local broker and execute inference.
@@ -11585,7 +11616,16 @@ var RunnerCameraConfigSchema = object({
11585
11616
  * omitted ⇒ the runner's default device. The engine itself stays node-local —
11586
11617
  * this only selects WHICH device pool of that node runs the session.
11587
11618
  */
11588
- deviceKey: string().optional()
11619
+ deviceKey: string().optional(),
11620
+ /**
11621
+ * Step-tree device-jump roster (phase 1): the node's ENABLED inference
11622
+ * devices, populated by the orchestrator ONLY when `deviceKey` is set and the
11623
+ * node has ≥2 enabled devices. The runner uses it to AUTO-jump an enrichment
11624
+ * step whose model has no build for the elected device's format onto another
11625
+ * enabled device of the SAME node (weighted-least-loaded). Absent/single-entry
11626
+ * ⇒ no jump possible; the step runs on `deviceKey`.
11627
+ */
11628
+ inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
11589
11629
  });
11590
11630
  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;
11591
11631
  /**
@@ -11641,7 +11681,18 @@ var RunnerLocalMetricsSchema = object({
11641
11681
  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({
11642
11682
  handle: FrameHandleSchema,
11643
11683
  bbox: NativeCropBboxSchema,
11644
- maxWidth: number().int().positive().optional()
11684
+ maxWidth: number().int().positive().optional(),
11685
+ /**
11686
+ * When `true`, the runner encodes the resolved crop to JPEG ON THE
11687
+ * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
11688
+ * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
11689
+ * agent) so the compressed payload fits Moleculer's `maxPacketSize` and
11690
+ * no raw pixels cross the process boundary. Same-node callers omit it
11691
+ * and keep the zero-copy raw `bytes` path. Additive + optional: a
11692
+ * pre-encode runner (version skew) ignores it and returns `bytes`, so
11693
+ * the caller falls back to encoding locally.
11694
+ */
11695
+ encodeJpeg: boolean().optional()
11645
11696
  }), NativeCropResultSchema.nullable()), method(object({
11646
11697
  deviceId: number(),
11647
11698
  frameHandle: FrameHandleSchema.optional(),
@@ -16770,7 +16821,16 @@ var PipelineTemplateSchema = object({
16770
16821
  });
16771
16822
  var DeviceStepConfigSchema = object({
16772
16823
  modelId: string().optional(),
16773
- settings: record(string(), unknown()).optional()
16824
+ settings: record(string(), unknown()).optional(),
16825
+ /**
16826
+ * Step-tree device jump (same-node, phase 1) — OPTIONAL manual override.
16827
+ * When set, this step runs on the named enabled device of the SAME node
16828
+ * (`<backend>:<device>`) instead of the camera's elected device, bypassing
16829
+ * the runtime AUTO-jump. The orchestrator rejects a `jumpDeviceKey` pointing
16830
+ * at a disabled/absent device on that node at save time. Absent ⇒ the runner
16831
+ * auto-jumps only when the effective device's format cannot run the step.
16832
+ */
16833
+ jumpDeviceKey: string().optional()
16774
16834
  });
16775
16835
  var AgentPipelineSettingsSchema = object({
16776
16836
  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_shared = require("./shared-C77pnEyI.js");
5
+ const require_shared = require("./shared-B_GfteRr.js");
6
6
  let node_stream = require("node:stream");
7
7
  let webdav = require("webdav");
8
8
  //#region src/providers/webdav/webdav-config-schema.ts
@@ -1,4 +1,4 @@
1
- import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-BXdymO1F.mjs";
1
+ import { a as safeJoinRemotePath, c as BaseAddon, i as rearmIdleAbort, o as scheduleIdleAbort, r as getRequiredBasePath, s as storageProviderCapability, t as createSessionId } from "./shared-Co8avCOn.mjs";
2
2
  import { PassThrough } from "node:stream";
3
3
  import { AuthType, createClient } from "webdav";
4
4
  //#region src/providers/webdav/webdav-config-schema.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-remote-storage",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Remote storage providers (SFTP, S3, WebDAV) — unifies remote backends behind the storage-provider cap",
5
5
  "keywords": [
6
6
  "camstack",