@camstack/types 1.2.270 → 1.2.272
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/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/control.cap.d.ts +4 -4
- package/dist/capabilities/core-blocks.cap.d.ts +1 -1
- package/dist/capabilities/device-discovery.cap.d.ts +1 -1
- package/dist/capabilities/device-extension.cap.d.ts +8 -8
- package/dist/capabilities/device-manager.cap.d.ts +50 -0
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/integrations.cap.d.ts +3 -3
- package/dist/capabilities/llm-runtime.cap.d.ts +3 -3
- package/dist/capabilities/llm.cap.d.ts +4 -4
- package/dist/capabilities/motion.cap.d.ts +12 -0
- package/dist/capabilities/notification-rules.cap.d.ts +9 -9
- package/dist/capabilities/osd-manager.cap.d.ts +10 -10
- package/dist/capabilities/pet-feeder.cap.d.ts +4 -4
- package/dist/capabilities/pipeline-analytics.cap.d.ts +22 -10
- package/dist/capabilities/pipeline-executor.cap.d.ts +2 -2
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +156 -6
- package/dist/capabilities/pipeline-runner.cap.d.ts +9 -0
- package/dist/capabilities/recording-archive.cap.d.ts +4 -4
- package/dist/capabilities/recording-export.cap.d.ts +7 -7
- package/dist/capabilities/recording-onboard.cap.d.ts +5 -5
- package/dist/capabilities/recording.cap.d.ts +5 -5
- package/dist/capabilities/snapshot.cap.d.ts +2 -2
- package/dist/capabilities/storage-provider.cap.d.ts +11 -11
- package/dist/capabilities/storage.cap.d.ts +3 -3
- package/dist/capabilities/stream-broker.cap.d.ts +1 -1
- package/dist/capabilities/videoclips.cap.d.ts +3 -3
- package/dist/capabilities/zone-analytics.cap.d.ts +2 -2
- package/dist/composition/composition-report.d.ts +3 -3
- package/dist/{composition-D5BQywfe.mjs → composition-BK-GTFYb.mjs} +27 -3
- package/dist/{composition-BAH3n-zq.js → composition-BRxAnxtU.js} +27 -3
- package/dist/device/base-device-provider.d.ts +19 -1
- package/dist/device/device-context.d.ts +12 -0
- package/dist/expression/builtins.d.ts +18 -0
- package/dist/expression/expression-source.d.ts +2 -0
- package/dist/generated/addon-api.d.ts +7 -66
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +299 -23
- package/dist/index.mjs +284 -24
- package/dist/interfaces/addon.d.ts +9 -0
- package/dist/interfaces/storage-location-mode.d.ts +1 -1
- package/dist/interfaces/storage-location.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/pipeline/camera-sensors.d.ts +146 -0
- package/dist/{sleep-Bg0IB7gg.js → sleep-DYGSsCgK.js} +1 -0
- package/dist/{sleep-E6eD4yQS.mjs → sleep-DlrgY4Qb.mjs} +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-DYGSsCgK.js");
|
|
3
3
|
const require_event_category = require("./event-category-MbnB-6AN.js");
|
|
4
|
-
const require_composition = require("./composition-
|
|
4
|
+
const require_composition = require("./composition-BRxAnxtU.js");
|
|
5
5
|
const require_err_msg = require("./err-msg-Dx2Kor0g.js");
|
|
6
6
|
const require_enums = require("./enums.js");
|
|
7
7
|
let zod = require("zod");
|
|
@@ -12415,6 +12415,34 @@ var DeviceBindingsForDeviceSchema = zod.z.object({
|
|
|
12415
12415
|
nativeAddonId: zod.z.string()
|
|
12416
12416
|
}))
|
|
12417
12417
|
});
|
|
12418
|
+
/**
|
|
12419
|
+
* The STORED wrapper activation for one `(device, capability)` pair — the row
|
|
12420
|
+
* `setWrapperActive` writes, read back three-way (D675):
|
|
12421
|
+
*
|
|
12422
|
+
* - `value` — the store answered and holds an activation: the bound wrapper's
|
|
12423
|
+
* addon id, or `null`, the operator's explicit "off" marker (D62);
|
|
12424
|
+
* - `missing` — the store answered, its activation map exists, and it holds
|
|
12425
|
+
* nothing for this pair: the operator never activated or deactivated a
|
|
12426
|
+
* wrapper here;
|
|
12427
|
+
* - `failed` — the store could not be read, holds no activation map at all
|
|
12428
|
+
* (an empty or unready snapshot, D44), or holds something that is not an
|
|
12429
|
+
* activation. It carries NO information: a consumer must never read it as
|
|
12430
|
+
* `missing` (D315, D393).
|
|
12431
|
+
*
|
|
12432
|
+
* This is the persisted INPUT, not the derived `getBindings` view — no registry
|
|
12433
|
+
* resolution, no `defaultActive` auto-binding, no cluster native-cap folding.
|
|
12434
|
+
*/
|
|
12435
|
+
var WrapperActivationReadSchema = zod.z.discriminatedUnion("kind", [
|
|
12436
|
+
zod.z.object({
|
|
12437
|
+
kind: zod.z.literal("value"),
|
|
12438
|
+
wrapperAddonId: zod.z.string().nullable()
|
|
12439
|
+
}),
|
|
12440
|
+
zod.z.object({ kind: zod.z.literal("missing") }),
|
|
12441
|
+
zod.z.object({
|
|
12442
|
+
kind: zod.z.literal("failed"),
|
|
12443
|
+
error: zod.z.string()
|
|
12444
|
+
})
|
|
12445
|
+
]);
|
|
12418
12446
|
var SavedDeviceRowSchema = zod.z.object({
|
|
12419
12447
|
/** Numeric id reserved at allocateDeviceId time. */
|
|
12420
12448
|
id: zod.z.number(),
|
|
@@ -13213,6 +13241,21 @@ var deviceManagerCapability = {
|
|
|
13213
13241
|
auth: "admin"
|
|
13214
13242
|
}),
|
|
13215
13243
|
/**
|
|
13244
|
+
* The STORED wrapper activation for one `(device, capName)` pair, three-way
|
|
13245
|
+
* (`value` / `missing` / `failed`, see {@link WrapperActivationReadSchema}).
|
|
13246
|
+
*
|
|
13247
|
+
* The narrow read of the durable authority behind `getBindings`: a
|
|
13248
|
+
* consumer that must know what the operator PERSISTED (virtual-doorbell,
|
|
13249
|
+
* before it drops a press) asks this instead of pulling device-manager's
|
|
13250
|
+
* whole addon store through `addonSettingsRaw.getGlobal` — which answered
|
|
13251
|
+
* `{}` on every isolated-engine hub and so never worked (D675). It reads
|
|
13252
|
+
* ONE row (the activation map, ~1.6 KB), never the ~625 KB store.
|
|
13253
|
+
*/
|
|
13254
|
+
getWrapperActivation: require_sleep.method(zod.z.object({
|
|
13255
|
+
deviceId: zod.z.number(),
|
|
13256
|
+
capName: zod.z.string().min(1)
|
|
13257
|
+
}), WrapperActivationReadSchema),
|
|
13258
|
+
/**
|
|
13216
13259
|
* Return the addon ids that declared a wrapper provider for `capName`.
|
|
13217
13260
|
* Backs the device-bindings UI's wrapper-picker dropdown. Entries are
|
|
13218
13261
|
* sourced from `CapabilityRegistry.wrapperProviders`, populated when
|
|
@@ -20481,6 +20524,123 @@ var oauthIntegrationCapability = {
|
|
|
20481
20524
|
getDescriptor: require_sleep.method(zod.z.void(), OauthIntegrationDescriptorSchema, { auth: "admin" }) }
|
|
20482
20525
|
};
|
|
20483
20526
|
//#endregion
|
|
20527
|
+
//#region src/pipeline/camera-sensors.ts
|
|
20528
|
+
/**
|
|
20529
|
+
* What started a camera's onboard motion (D672). `camera` is the camera's own
|
|
20530
|
+
* firmware; `sensor` is a device the operator ATTACHED to it. Absent on the
|
|
20531
|
+
* wire means the camera: only the camera-sensors bridge ever says `sensor`.
|
|
20532
|
+
*/
|
|
20533
|
+
var MotionTriggeredBySchema = zod.z.discriminatedUnion("kind", [zod.z.object({ kind: zod.z.literal("camera") }), zod.z.object({
|
|
20534
|
+
kind: zod.z.literal("sensor"),
|
|
20535
|
+
deviceId: zod.z.number().int().positive()
|
|
20536
|
+
})]);
|
|
20537
|
+
var CAMERA_TRIGGER = Object.freeze({ kind: "camera" });
|
|
20538
|
+
function readMotionTriggeredBy(value) {
|
|
20539
|
+
if (value === void 0) return {
|
|
20540
|
+
triggeredBy: CAMERA_TRIGGER,
|
|
20541
|
+
malformed: false
|
|
20542
|
+
};
|
|
20543
|
+
const parsed = MotionTriggeredBySchema.safeParse(value);
|
|
20544
|
+
return parsed.success ? {
|
|
20545
|
+
triggeredBy: parsed.data,
|
|
20546
|
+
malformed: false
|
|
20547
|
+
} : {
|
|
20548
|
+
triggeredBy: CAMERA_TRIGGER,
|
|
20549
|
+
malformed: true
|
|
20550
|
+
};
|
|
20551
|
+
}
|
|
20552
|
+
/** The orchestrator device-store key, beside `motionSources`. */
|
|
20553
|
+
var CAMERA_SENSORS_SETTINGS_KEY = "cameraSensors";
|
|
20554
|
+
/** More than this is a configuration error, not a camera. */
|
|
20555
|
+
var MAX_CAMERA_SENSORS = 8;
|
|
20556
|
+
var CameraSensorRefSchema = zod.z.object({
|
|
20557
|
+
addonId: zod.z.string().min(1),
|
|
20558
|
+
stableId: zod.z.string().min(1)
|
|
20559
|
+
});
|
|
20560
|
+
function cameraSensorRefKey(ref) {
|
|
20561
|
+
return `${ref.addonId}/${ref.stableId}`;
|
|
20562
|
+
}
|
|
20563
|
+
/** CS-1 accepts exactly one mode; CS-2 (D673) widens it to confirm / replace. */
|
|
20564
|
+
var CameraSensorsModeSchema = zod.z.enum(["in-addition"]);
|
|
20565
|
+
var CameraSensorsConfigSchema = zod.z.object({
|
|
20566
|
+
mode: CameraSensorsModeSchema,
|
|
20567
|
+
sensors: zod.z.array(CameraSensorRefSchema).min(1).max(8)
|
|
20568
|
+
}).superRefine((value, ctx) => {
|
|
20569
|
+
const seen = /* @__PURE__ */ new Set();
|
|
20570
|
+
value.sensors.forEach((ref, index) => {
|
|
20571
|
+
const key = cameraSensorRefKey(ref);
|
|
20572
|
+
if (seen.has(key)) ctx.addIssue({
|
|
20573
|
+
code: "custom",
|
|
20574
|
+
path: ["sensors", index],
|
|
20575
|
+
message: `duplicate camera sensor ${key}`
|
|
20576
|
+
});
|
|
20577
|
+
seen.add(key);
|
|
20578
|
+
});
|
|
20579
|
+
});
|
|
20580
|
+
var RefFields = {
|
|
20581
|
+
addonId: zod.z.string(),
|
|
20582
|
+
stableId: zod.z.string()
|
|
20583
|
+
};
|
|
20584
|
+
var CameraSensorAttachmentSchema = zod.z.discriminatedUnion("state", [
|
|
20585
|
+
zod.z.object({
|
|
20586
|
+
...RefFields,
|
|
20587
|
+
state: zod.z.literal("ready"),
|
|
20588
|
+
deviceId: zod.z.number(),
|
|
20589
|
+
name: zod.z.string(),
|
|
20590
|
+
caps: zod.z.array(zod.z.string()).readonly()
|
|
20591
|
+
}),
|
|
20592
|
+
zod.z.object({
|
|
20593
|
+
...RefFields,
|
|
20594
|
+
state: zod.z.literal("offline"),
|
|
20595
|
+
deviceId: zod.z.number(),
|
|
20596
|
+
name: zod.z.string(),
|
|
20597
|
+
reason: zod.z.enum(["offline", "disabled"])
|
|
20598
|
+
}),
|
|
20599
|
+
zod.z.object({
|
|
20600
|
+
...RefFields,
|
|
20601
|
+
state: zod.z.literal("missing"),
|
|
20602
|
+
reason: zod.z.string()
|
|
20603
|
+
}),
|
|
20604
|
+
zod.z.object({
|
|
20605
|
+
...RefFields,
|
|
20606
|
+
state: zod.z.literal("unsupported"),
|
|
20607
|
+
deviceId: zod.z.number(),
|
|
20608
|
+
name: zod.z.string(),
|
|
20609
|
+
reason: zod.z.string()
|
|
20610
|
+
}),
|
|
20611
|
+
zod.z.object({
|
|
20612
|
+
...RefFields,
|
|
20613
|
+
state: zod.z.literal("unreadable"),
|
|
20614
|
+
reason: zod.z.string()
|
|
20615
|
+
})
|
|
20616
|
+
]);
|
|
20617
|
+
/**
|
|
20618
|
+
* Why a configured camera forwards NOTHING from its sensors, however ready they
|
|
20619
|
+
* are (D672): it does not list `onboard` in `motionSources` (attaching a sensor
|
|
20620
|
+
* does not add it), or it has no active detection config at all (the bridge
|
|
20621
|
+
* reads the active config). Absent = forwarded, or an older node that does not
|
|
20622
|
+
* say.
|
|
20623
|
+
*/
|
|
20624
|
+
var CameraSensorsNotForwardedSchema = zod.z.enum(["onboard-not-listed", "no-active-detection"]);
|
|
20625
|
+
var CameraSensorsStatusSchema = zod.z.discriminatedUnion("state", [
|
|
20626
|
+
zod.z.object({ state: zod.z.literal("not-configured") }),
|
|
20627
|
+
zod.z.object({
|
|
20628
|
+
state: zod.z.literal("unreadable"),
|
|
20629
|
+
reason: zod.z.string()
|
|
20630
|
+
}),
|
|
20631
|
+
zod.z.object({
|
|
20632
|
+
state: zod.z.literal("configured"),
|
|
20633
|
+
mode: CameraSensorsModeSchema,
|
|
20634
|
+
sensors: zod.z.array(CameraSensorAttachmentSchema).readonly(),
|
|
20635
|
+
notForwarded: CameraSensorsNotForwardedSchema.optional()
|
|
20636
|
+
})
|
|
20637
|
+
]);
|
|
20638
|
+
/** What a camera reads before its first settings read ANSWERED (D315). */
|
|
20639
|
+
var CAMERA_SENSORS_NOT_LOADED = Object.freeze({
|
|
20640
|
+
state: "unreadable",
|
|
20641
|
+
reason: "camera sensor mappings not loaded"
|
|
20642
|
+
});
|
|
20643
|
+
//#endregion
|
|
20484
20644
|
//#region src/pipeline/cluster-model-scope.ts
|
|
20485
20645
|
/**
|
|
20486
20646
|
* A model choice has a SCOPE, and a scope change has a workflow.
|
|
@@ -21403,6 +21563,12 @@ var MotionEventSchema = zod.z.object({
|
|
|
21403
21563
|
/** Populated by B5 (recording playback URL for this event). */
|
|
21404
21564
|
mediaUrl: zod.z.string().optional(),
|
|
21405
21565
|
/**
|
|
21566
|
+
* The FIRST trigger of an `onboard` episode, written once at open (D672).
|
|
21567
|
+
* Absent = not recorded (a row written before D672, or an analyzer /
|
|
21568
|
+
* device-activity episode) — never read as "the camera" (D393).
|
|
21569
|
+
*/
|
|
21570
|
+
triggeredBy: MotionTriggeredBySchema.optional(),
|
|
21571
|
+
/**
|
|
21406
21572
|
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
21407
21573
|
* episode is still open — a further rising edge extends it in place rather
|
|
21408
21574
|
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
@@ -24682,6 +24848,28 @@ var MotionSourceEnum = zod.z.enum([
|
|
|
24682
24848
|
*/
|
|
24683
24849
|
var MotionSourcesSchema = zod.z.array(MotionSourceEnum);
|
|
24684
24850
|
/**
|
|
24851
|
+
* The operator-facing name of each MOTION source (D672: `onboard` = the
|
|
24852
|
+
* camera's sensors — its own motion plus any sensor attached to it). The wire
|
|
24853
|
+
* value stays `onboard`; only the label changed. `detectionSources: 'onboard'`
|
|
24854
|
+
* ("Camera onboard AI") and the notification source filter keep their labels.
|
|
24855
|
+
*/
|
|
24856
|
+
var MOTION_SOURCE_LABELS = {
|
|
24857
|
+
analyzer: "Frame-diff Analyzer (motion addon)",
|
|
24858
|
+
onboard: "Camera sensors",
|
|
24859
|
+
"device-activity": "Device activity (the device says it is working)"
|
|
24860
|
+
};
|
|
24861
|
+
/** A value this build does not know (a newer node's) is shown as itself. */
|
|
24862
|
+
function motionSourceLabel(value) {
|
|
24863
|
+
const parsed = MotionSourceEnum.safeParse(value);
|
|
24864
|
+
return parsed.success ? MOTION_SOURCE_LABELS[parsed.data] : value;
|
|
24865
|
+
}
|
|
24866
|
+
/** The order the motion-source picker offers them in (not the enum's order). */
|
|
24867
|
+
var MOTION_SOURCE_PICKER_ORDER = [
|
|
24868
|
+
"analyzer",
|
|
24869
|
+
"onboard",
|
|
24870
|
+
"device-activity"
|
|
24871
|
+
];
|
|
24872
|
+
/**
|
|
24685
24873
|
* Which root detector a camera runs — EXACTLY ONE.
|
|
24686
24874
|
*
|
|
24687
24875
|
* Deliberately the SAME vocabulary post-analysis already tags every detection
|
|
@@ -25049,20 +25237,14 @@ var RunnerCameraDeviceUIFields = [
|
|
|
25049
25237
|
type: "multiselect",
|
|
25050
25238
|
label: "Motion Sources",
|
|
25051
25239
|
default: ["analyzer"],
|
|
25052
|
-
options:
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
|
|
25056
|
-
|
|
25057
|
-
|
|
25058
|
-
|
|
25059
|
-
|
|
25060
|
-
},
|
|
25061
|
-
{
|
|
25062
|
-
value: "device-activity",
|
|
25063
|
-
label: "Device activity (the device says it is working)"
|
|
25064
|
-
}
|
|
25065
|
-
]
|
|
25240
|
+
options: MOTION_SOURCE_PICKER_ORDER.map((value) => value === "onboard" ? {
|
|
25241
|
+
value,
|
|
25242
|
+
label: MOTION_SOURCE_LABELS[value],
|
|
25243
|
+
description: "The camera's own motion, plus any sensor attached to it"
|
|
25244
|
+
} : {
|
|
25245
|
+
value,
|
|
25246
|
+
label: MOTION_SOURCE_LABELS[value]
|
|
25247
|
+
})
|
|
25066
25248
|
},
|
|
25067
25249
|
{
|
|
25068
25250
|
key: "detectionSources",
|
|
@@ -26027,6 +26209,11 @@ var CameraStatusSchema = zod.z.object({
|
|
|
26027
26209
|
*/
|
|
26028
26210
|
switchedOff: zod.z.array(CameraSwitchIdSchema).readonly(),
|
|
26029
26211
|
/**
|
|
26212
|
+
* The camera's attached sensors (D672). Optional only for a status composed
|
|
26213
|
+
* by an orchestrator older than D672; this orchestrator always sets it.
|
|
26214
|
+
*/
|
|
26215
|
+
cameraSensors: CameraSensorsStatusSchema.optional(),
|
|
26216
|
+
/**
|
|
26030
26217
|
* Stages of the bounded fan-out that were CUT SHORT — a timeout or a
|
|
26031
26218
|
* rejection — and whose block is therefore `null` because we could not
|
|
26032
26219
|
* READ it, not because there is nothing there.
|
|
@@ -35907,7 +36094,9 @@ var MotionOnMotionChangedDataSchema = zod.z.object({
|
|
|
35907
36094
|
detected: zod.z.boolean(),
|
|
35908
36095
|
timestamp: zod.z.number(),
|
|
35909
36096
|
source: MotionSourceEnum,
|
|
35910
|
-
regions: zod.z.array(MotionRegionSchema).readonly().optional()
|
|
36097
|
+
regions: zod.z.array(MotionRegionSchema).readonly().optional(),
|
|
36098
|
+
/** Who started it (D672). Absent = the camera itself. Only `onboard` carries `sensor`. */
|
|
36099
|
+
triggeredBy: MotionTriggeredBySchema.optional()
|
|
35911
36100
|
});
|
|
35912
36101
|
var motionCapability = {
|
|
35913
36102
|
name: "motion",
|
|
@@ -45130,7 +45319,8 @@ function expressionOutcome(source, read, now, stateful) {
|
|
|
45130
45319
|
state: "stale",
|
|
45131
45320
|
value: require_composition.evaluateCount(null, {
|
|
45132
45321
|
kind: "count",
|
|
45133
|
-
highWater: null
|
|
45322
|
+
highWater: null,
|
|
45323
|
+
primed: false
|
|
45134
45324
|
}, stateful.currentOutput),
|
|
45135
45325
|
reason: `${unavailable.reason}; holding the last accumulator value`,
|
|
45136
45326
|
deadline: null
|
|
@@ -46896,6 +47086,7 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
46896
47086
|
}];
|
|
46897
47087
|
}
|
|
46898
47088
|
async onShutdown() {
|
|
47089
|
+
this._restoreShuttingDown = true;
|
|
46899
47090
|
this.cancelRestoreRetries();
|
|
46900
47091
|
const devices = await this.ctx.kernel.devices?.getAll() ?? [];
|
|
46901
47092
|
for (const device of devices) try {
|
|
@@ -47013,6 +47204,7 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
47013
47204
|
};
|
|
47014
47205
|
}
|
|
47015
47206
|
async restoreDevices(savedDevices) {
|
|
47207
|
+
this._restoreShuttingDown = false;
|
|
47016
47208
|
const report = await this.onRestoreDevices(savedDevices);
|
|
47017
47209
|
if (savedDevices.length === 0) return;
|
|
47018
47210
|
if (report && report.failedCount > 0) {
|
|
@@ -47027,8 +47219,13 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
47027
47219
|
/** Retry lane width. See `device-restore-retry.ts` for why retries
|
|
47028
47220
|
* never re-stampede full-width while the initial pass does (D167). */
|
|
47029
47221
|
restoreRetryConcurrency = 4;
|
|
47030
|
-
|
|
47222
|
+
/** Every bounded retry this process started — the default pass's, and each
|
|
47223
|
+
* `restoreWithBoundedRetry` of a provider's own rows. Cancelled together. */
|
|
47224
|
+
_restoreRetrySchedulers = [];
|
|
47031
47225
|
_restoreRetryCompletion = null;
|
|
47226
|
+
/** Set by `onShutdown` BEFORE the retries are cancelled: a restore pass still
|
|
47227
|
+
* in flight must not start a scheduler after the cancel ran. */
|
|
47228
|
+
_restoreShuttingDown = false;
|
|
47032
47229
|
_permanentRestoreFailures = /* @__PURE__ */ new Map();
|
|
47033
47230
|
/** Settles when the background retry rounds finish (or `null` when
|
|
47034
47231
|
* nothing failed). Exposed for tests and subclass diagnostics —
|
|
@@ -47097,8 +47294,8 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
47097
47294
|
});
|
|
47098
47295
|
}
|
|
47099
47296
|
cancelRestoreRetries() {
|
|
47100
|
-
this.
|
|
47101
|
-
this.
|
|
47297
|
+
for (const scheduler of this._restoreRetrySchedulers) scheduler.cancel();
|
|
47298
|
+
this._restoreRetrySchedulers = [];
|
|
47102
47299
|
}
|
|
47103
47300
|
recordPermanentRestoreFailure(failure) {
|
|
47104
47301
|
this._permanentRestoreFailures.set(failure.deviceId, failure);
|
|
@@ -47115,6 +47312,13 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
47115
47312
|
});
|
|
47116
47313
|
}
|
|
47117
47314
|
scheduleRestoreRetries(failures, attempt) {
|
|
47315
|
+
if (this._restoreShuttingDown) {
|
|
47316
|
+
this.ctx.logger.info("Restore retries not scheduled — the provider is shutting down", { meta: {
|
|
47317
|
+
rows: failures.length,
|
|
47318
|
+
deviceIds: failures.map((f) => f.saved.id)
|
|
47319
|
+
} });
|
|
47320
|
+
return;
|
|
47321
|
+
}
|
|
47118
47322
|
const scheduler = new DeviceRestoreRetryScheduler({
|
|
47119
47323
|
logger: this.ctx.logger,
|
|
47120
47324
|
delaysMs: this.restoreRetryDelaysMs,
|
|
@@ -47122,10 +47326,54 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
47122
47326
|
attempt,
|
|
47123
47327
|
onPermanentFailure: (failure) => this.recordPermanentRestoreFailure(failure)
|
|
47124
47328
|
});
|
|
47125
|
-
this.
|
|
47126
|
-
|
|
47329
|
+
this._restoreRetrySchedulers = [...this._restoreRetrySchedulers, scheduler];
|
|
47330
|
+
const run = scheduler.run(failures).then(() => void 0).catch((err) => {
|
|
47127
47331
|
this.ctx.logger.error("Restore retry scheduler crashed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
47128
47332
|
});
|
|
47333
|
+
const prior = this._restoreRetryCompletion;
|
|
47334
|
+
this._restoreRetryCompletion = prior === null ? run : Promise.all([prior, run]).then(() => void 0);
|
|
47335
|
+
}
|
|
47336
|
+
/**
|
|
47337
|
+
* Restore rows the default pass does not handle (a provider's own restore
|
|
47338
|
+
* loop) under the SAME bounded retry (D347): one attempt each, in order; a
|
|
47339
|
+
* row that throws is logged with `tags.deviceId` and retried in the
|
|
47340
|
+
* background rounds, then marked permanently failed like any other.
|
|
47341
|
+
*
|
|
47342
|
+
* A restore is a device build, and a build whose runtime-state load did not
|
|
47343
|
+
* answer is REFUSED rather than started on cold defaults (D677) — so a
|
|
47344
|
+
* transient hub read must cost a retry, never the device until the next
|
|
47345
|
+
* runner restart. An ANSWERED `{}` is the device's true state and never
|
|
47346
|
+
* refuses.
|
|
47347
|
+
*/
|
|
47348
|
+
async restoreWithBoundedRetry(rows, attempt) {
|
|
47349
|
+
const failures = [];
|
|
47350
|
+
for (const saved of rows) {
|
|
47351
|
+
if (this.isUnrestorableShell(saved)) {
|
|
47352
|
+
this.quarantineShell(saved);
|
|
47353
|
+
continue;
|
|
47354
|
+
}
|
|
47355
|
+
try {
|
|
47356
|
+
await attempt(saved);
|
|
47357
|
+
} catch (err) {
|
|
47358
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
47359
|
+
this.ctx.logger.warn("Failed to restore device — bounded retry scheduled", {
|
|
47360
|
+
tags: {
|
|
47361
|
+
deviceId: saved.id,
|
|
47362
|
+
stableId: saved.stableId
|
|
47363
|
+
},
|
|
47364
|
+
meta: {
|
|
47365
|
+
type: saved.type,
|
|
47366
|
+
attempt: 1,
|
|
47367
|
+
error
|
|
47368
|
+
}
|
|
47369
|
+
});
|
|
47370
|
+
failures.push({
|
|
47371
|
+
saved,
|
|
47372
|
+
error
|
|
47373
|
+
});
|
|
47374
|
+
}
|
|
47375
|
+
}
|
|
47376
|
+
if (failures.length > 0) this.scheduleRestoreRetries(failures, attempt);
|
|
47129
47377
|
}
|
|
47130
47378
|
/**
|
|
47131
47379
|
* Tear down and reconstruct ONE device from its persisted rows — the
|
|
@@ -53434,6 +53682,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
53434
53682
|
addonId: null,
|
|
53435
53683
|
access: "view"
|
|
53436
53684
|
},
|
|
53685
|
+
"deviceManager.getWrapperActivation": {
|
|
53686
|
+
capName: "device-manager",
|
|
53687
|
+
capScope: "system",
|
|
53688
|
+
addonId: null,
|
|
53689
|
+
access: "view"
|
|
53690
|
+
},
|
|
53437
53691
|
"deviceManager.listAll": {
|
|
53438
53692
|
capName: "device-manager",
|
|
53439
53693
|
capScope: "system",
|
|
@@ -59578,6 +59832,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
|
|
|
59578
59832
|
form: "single",
|
|
59579
59833
|
optional: false
|
|
59580
59834
|
}],
|
|
59835
|
+
"deviceManager.getWrapperActivation": [{
|
|
59836
|
+
name: "deviceId",
|
|
59837
|
+
form: "single",
|
|
59838
|
+
optional: false
|
|
59839
|
+
}],
|
|
59581
59840
|
"deviceManager.listAll": [{
|
|
59582
59841
|
name: "deviceIds",
|
|
59583
59842
|
form: "array",
|
|
@@ -61250,6 +61509,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
|
|
|
61250
61509
|
"deviceManager.getStreamProfileMap",
|
|
61251
61510
|
"deviceManager.getStreamSources",
|
|
61252
61511
|
"deviceManager.getWireableFields",
|
|
61512
|
+
"deviceManager.getWrapperActivation",
|
|
61253
61513
|
"deviceManager.listAll",
|
|
61254
61514
|
"deviceManager.loadConfig",
|
|
61255
61515
|
"deviceManager.loadMeta",
|
|
@@ -68250,8 +68510,11 @@ exports.BrokerSubscribeResultSchema = SubscribeResultSchema;
|
|
|
68250
68510
|
exports.BrokerTestConnectionResultSchema = TestConnectionResultSchema;
|
|
68251
68511
|
exports.BrokerUnsubscribeInputSchema = UnsubscribeInputSchema;
|
|
68252
68512
|
exports.BulkRecordSchema = BulkRecordSchema;
|
|
68513
|
+
exports.CAMERA_SENSORS_NOT_LOADED = CAMERA_SENSORS_NOT_LOADED;
|
|
68514
|
+
exports.CAMERA_SENSORS_SETTINGS_KEY = CAMERA_SENSORS_SETTINGS_KEY;
|
|
68253
68515
|
exports.CAMERA_SWITCH_CATALOG = CAMERA_SWITCH_CATALOG;
|
|
68254
68516
|
exports.CAMERA_SWITCH_ORDER = CAMERA_SWITCH_ORDER;
|
|
68517
|
+
exports.CAMERA_TRIGGER = CAMERA_TRIGGER;
|
|
68255
68518
|
exports.CAM_PROFILE_ORDER = require_sleep.CAM_PROFILE_ORDER;
|
|
68256
68519
|
exports.CAPABILITY_NAMES = CAPABILITY_NAMES;
|
|
68257
68520
|
exports.CAPABILITY_ROUTER_KEYS = CAPABILITY_ROUTER_KEYS;
|
|
@@ -68311,6 +68574,12 @@ exports.CameraMotionStatusSchema = CameraMotionStatusSchema;
|
|
|
68311
68574
|
exports.CameraOccupancySnapshotForDeviceSchema = CameraOccupancySnapshotForDeviceSchema;
|
|
68312
68575
|
exports.CameraRecordingModeSchema = CameraRecordingModeSchema;
|
|
68313
68576
|
exports.CameraRecordingStatusSchema = CameraRecordingStatusSchema;
|
|
68577
|
+
exports.CameraSensorAttachmentSchema = CameraSensorAttachmentSchema;
|
|
68578
|
+
exports.CameraSensorRefSchema = CameraSensorRefSchema;
|
|
68579
|
+
exports.CameraSensorsConfigSchema = CameraSensorsConfigSchema;
|
|
68580
|
+
exports.CameraSensorsModeSchema = CameraSensorsModeSchema;
|
|
68581
|
+
exports.CameraSensorsNotForwardedSchema = CameraSensorsNotForwardedSchema;
|
|
68582
|
+
exports.CameraSensorsStatusSchema = CameraSensorsStatusSchema;
|
|
68314
68583
|
exports.CameraSourceStatusSchema = CameraSourceStatusSchema;
|
|
68315
68584
|
exports.CameraSourceStreamSchema = CameraSourceStreamSchema;
|
|
68316
68585
|
exports.CameraStatusDegradationReasonSchema = CameraStatusDegradationReasonSchema;
|
|
@@ -68756,6 +69025,7 @@ exports.MACRO_LABELS = MACRO_LABELS;
|
|
|
68756
69025
|
exports.MAX_ARCHIVED_DEBUG_NOTES = MAX_ARCHIVED_DEBUG_NOTES;
|
|
68757
69026
|
exports.MAX_BIRTH_DECISION_RECORDS = MAX_BIRTH_DECISION_RECORDS;
|
|
68758
69027
|
exports.MAX_BIRTH_LATENCY_PROXY_MS = MAX_BIRTH_LATENCY_PROXY_MS;
|
|
69028
|
+
exports.MAX_CAMERA_SENSORS = MAX_CAMERA_SENSORS;
|
|
68759
69029
|
exports.MAX_CLIP_EVENT_IDS = MAX_CLIP_EVENT_IDS;
|
|
68760
69030
|
exports.MAX_CLIP_LABELS = MAX_CLIP_LABELS;
|
|
68761
69031
|
exports.MAX_COMPOSITION_CODE_LENGTH = require_composition.MAX_COMPOSITION_CODE_LENGTH;
|
|
@@ -68782,6 +69052,7 @@ exports.MODEL_FORMATS = MODEL_FORMATS;
|
|
|
68782
69052
|
exports.MODEL_HOSTING = MODEL_HOSTING;
|
|
68783
69053
|
exports.MODEL_PROVIDER_IDS = MODEL_PROVIDER_IDS;
|
|
68784
69054
|
exports.MOTION_CLOSE_AFTER_MS = MOTION_CLOSE_AFTER_MS;
|
|
69055
|
+
exports.MOTION_SOURCE_LABELS = MOTION_SOURCE_LABELS;
|
|
68785
69056
|
exports.MOTION_TRIGGER_FEATURE = MOTION_TRIGGER_FEATURE;
|
|
68786
69057
|
exports.ManagedModelCatalogEntrySchema = ManagedModelCatalogEntrySchema;
|
|
68787
69058
|
exports.ManagedModelExtraFileSchema = ManagedModelExtraFileSchema;
|
|
@@ -68832,6 +69103,7 @@ exports.MotionSourcesSchema = MotionSourcesSchema;
|
|
|
68832
69103
|
exports.MotionStatusSchema = MotionStatusSchema;
|
|
68833
69104
|
exports.MotionTriggerRuntimeStateSchema = MotionTriggerRuntimeStateSchema;
|
|
68834
69105
|
exports.MotionTriggerStatusSchema = MotionTriggerStatusSchema;
|
|
69106
|
+
exports.MotionTriggeredBySchema = MotionTriggeredBySchema;
|
|
68835
69107
|
exports.MotionZoneOptionsSchema = MotionZoneOptionsSchema;
|
|
68836
69108
|
exports.MotionZonePatchSchema = MotionZonePatchSchema;
|
|
68837
69109
|
exports.MotionZoneRegionSchema = MotionZoneRegionSchema;
|
|
@@ -69471,6 +69743,7 @@ exports.WidgetLoginMethodSchema = WidgetLoginMethodSchema;
|
|
|
69471
69743
|
exports.WidgetMetadataSchema = WidgetMetadataSchema;
|
|
69472
69744
|
exports.WidgetRemoteSchema = WidgetRemoteSchema;
|
|
69473
69745
|
exports.WidgetSizeEnum = WidgetSizeEnum;
|
|
69746
|
+
exports.WrapperActivationReadSchema = WrapperActivationReadSchema;
|
|
69474
69747
|
exports.WrapperEvidenceSchema = WrapperEvidenceSchema;
|
|
69475
69748
|
exports.WrapperIdentitySchema = WrapperIdentitySchema;
|
|
69476
69749
|
exports.WrapperKindSchema = WrapperKindSchema;
|
|
@@ -69544,6 +69817,7 @@ exports.buttonCapability = buttonCapability;
|
|
|
69544
69817
|
exports.cameraCredentialsCapability = cameraCredentialsCapability;
|
|
69545
69818
|
exports.cameraGridLayoutCapability = cameraGridLayoutCapability;
|
|
69546
69819
|
exports.cameraPipelineConfigCapability = cameraPipelineConfigCapability;
|
|
69820
|
+
exports.cameraSensorRefKey = cameraSensorRefKey;
|
|
69547
69821
|
exports.cameraStreamsCapability = cameraStreamsCapability;
|
|
69548
69822
|
exports.canConvertUnit = canConvertUnit;
|
|
69549
69823
|
exports.canonicalEgressPlan = canonicalEgressPlan;
|
|
@@ -69833,6 +70107,7 @@ exports.modelDistributorCapability = modelDistributorCapability;
|
|
|
69833
70107
|
exports.modelFormatForRuntime = modelFormatForRuntime;
|
|
69834
70108
|
exports.motionCapability = motionCapability;
|
|
69835
70109
|
exports.motionDetectionCapability = motionDetectionCapability;
|
|
70110
|
+
exports.motionSourceLabel = motionSourceLabel;
|
|
69836
70111
|
exports.motionTriggerCapability = motionTriggerCapability;
|
|
69837
70112
|
exports.motionZonesCapability = motionZonesCapability;
|
|
69838
70113
|
exports.mqttBrokerCapability = mqttBrokerCapability;
|
|
@@ -69913,6 +70188,7 @@ exports.readClusterStepModels = readClusterStepModels;
|
|
|
69913
70188
|
exports.readClusterStepSettings = readClusterStepSettings;
|
|
69914
70189
|
exports.readDetailCropConvention = readDetailCropConvention;
|
|
69915
70190
|
exports.readDeviceStateFrom = readDeviceStateFrom;
|
|
70191
|
+
exports.readMotionTriggeredBy = readMotionTriggeredBy;
|
|
69916
70192
|
exports.readNativeLeaseOverride = readNativeLeaseOverride;
|
|
69917
70193
|
exports.readNodePin = require_sleep.readNodePin;
|
|
69918
70194
|
exports.readTimelapseGeneratedAt = readTimelapseGeneratedAt;
|