@camstack/addon-ai 0.1.5 → 0.1.6
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 +192 -4
- package/dist/addon.mjs +192 -4
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -43,7 +43,7 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
43
43
|
node_fs_promises = __toESM(node_fs_promises);
|
|
44
44
|
let node_child_process = require("node:child_process");
|
|
45
45
|
let node_net = require("node:net");
|
|
46
|
-
//#region ../types/dist/event-category-
|
|
46
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
47
47
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
48
48
|
EventCategory["SystemBoot"] = "system.boot";
|
|
49
49
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -196,6 +196,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
196
196
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
197
197
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
198
198
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
199
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
200
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
201
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
202
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
203
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
199
204
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
200
205
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
201
206
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -485,6 +490,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
485
490
|
*/
|
|
486
491
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
487
492
|
/**
|
|
493
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
494
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
495
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
496
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
497
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
498
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
499
|
+
* this bus topic drives notifier rules + live UI. See
|
|
500
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
501
|
+
*/
|
|
502
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
503
|
+
/**
|
|
504
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
505
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
506
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
507
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
508
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
509
|
+
*/
|
|
510
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
511
|
+
/**
|
|
488
512
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
489
513
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
490
514
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5223,6 +5247,25 @@ function _instanceof(cls, params = {}) {
|
|
|
5223
5247
|
};
|
|
5224
5248
|
return inst;
|
|
5225
5249
|
}
|
|
5250
|
+
//#endregion
|
|
5251
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5252
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5253
|
+
var ZodIssueCode = {
|
|
5254
|
+
invalid_type: "invalid_type",
|
|
5255
|
+
too_big: "too_big",
|
|
5256
|
+
too_small: "too_small",
|
|
5257
|
+
invalid_format: "invalid_format",
|
|
5258
|
+
not_multiple_of: "not_multiple_of",
|
|
5259
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5260
|
+
invalid_union: "invalid_union",
|
|
5261
|
+
invalid_key: "invalid_key",
|
|
5262
|
+
invalid_element: "invalid_element",
|
|
5263
|
+
invalid_value: "invalid_value",
|
|
5264
|
+
custom: "custom"
|
|
5265
|
+
};
|
|
5266
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5267
|
+
var ZodFirstPartyTypeKind;
|
|
5268
|
+
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5226
5269
|
Object.fromEntries([
|
|
5227
5270
|
{
|
|
5228
5271
|
id: "overview",
|
|
@@ -12608,7 +12651,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
12608
12651
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
12609
12652
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
12610
12653
|
*/
|
|
12611
|
-
var ZoneRuleStageEnum = _enum([
|
|
12654
|
+
var ZoneRuleStageEnum = _enum([
|
|
12655
|
+
"motion",
|
|
12656
|
+
"detection",
|
|
12657
|
+
"package"
|
|
12658
|
+
]);
|
|
12612
12659
|
DeviceType.Camera, method(object({
|
|
12613
12660
|
deviceId: number(),
|
|
12614
12661
|
stage: ZoneRuleStageEnum
|
|
@@ -12621,7 +12668,8 @@ DeviceType.Camera, method(object({
|
|
|
12621
12668
|
auth: "admin"
|
|
12622
12669
|
}), object({
|
|
12623
12670
|
motion: array(ZoneRuleSchema).readonly(),
|
|
12624
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
12671
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
12672
|
+
package: array(ZoneRuleSchema).readonly()
|
|
12625
12673
|
});
|
|
12626
12674
|
var ProviderStatusSchema = object({
|
|
12627
12675
|
connected: boolean(),
|
|
@@ -15849,6 +15897,7 @@ var EventKindIconSchema = _enum([
|
|
|
15849
15897
|
"smoke",
|
|
15850
15898
|
"water",
|
|
15851
15899
|
"button",
|
|
15900
|
+
"package",
|
|
15852
15901
|
"generic"
|
|
15853
15902
|
]);
|
|
15854
15903
|
var EventKindCategorySchema = _enum([
|
|
@@ -15856,7 +15905,8 @@ var EventKindCategorySchema = _enum([
|
|
|
15856
15905
|
"audio",
|
|
15857
15906
|
"detection",
|
|
15858
15907
|
"sensor",
|
|
15859
|
-
"custom"
|
|
15908
|
+
"custom",
|
|
15909
|
+
"package"
|
|
15860
15910
|
]);
|
|
15861
15911
|
var EventKindDescriptorSchema = object({
|
|
15862
15912
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -19502,6 +19552,108 @@ method(object({
|
|
|
19502
19552
|
auth: "admin"
|
|
19503
19553
|
});
|
|
19504
19554
|
/**
|
|
19555
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
19556
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
19557
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
19558
|
+
* delete-after-download.
|
|
19559
|
+
*
|
|
19560
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
19561
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
19562
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
19563
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
19564
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
19565
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
19566
|
+
* SQLite); history rows survive file deletion for audit.
|
|
19567
|
+
*/
|
|
19568
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
19569
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
19570
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
19571
|
+
var ExportTimelapseSchema = object({
|
|
19572
|
+
everyMs: number().int().positive(),
|
|
19573
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
19574
|
+
});
|
|
19575
|
+
/**
|
|
19576
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
19577
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
19578
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
19579
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
19580
|
+
*/
|
|
19581
|
+
var ExportOptionsSchema = object({
|
|
19582
|
+
speed: ExportSpeedSchema.optional(),
|
|
19583
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
19584
|
+
includeAudio: boolean(),
|
|
19585
|
+
maxLifeMs: number().int().positive(),
|
|
19586
|
+
deleteAfterDownload: boolean(),
|
|
19587
|
+
title: string().max(200).optional()
|
|
19588
|
+
}).superRefine((v, ctx) => {
|
|
19589
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
19590
|
+
code: ZodIssueCode.custom,
|
|
19591
|
+
message: "speed and timelapse are mutually exclusive",
|
|
19592
|
+
path: ["timelapse"]
|
|
19593
|
+
});
|
|
19594
|
+
});
|
|
19595
|
+
var ExportStateSchema = _enum([
|
|
19596
|
+
"queued",
|
|
19597
|
+
"rendering",
|
|
19598
|
+
"ready",
|
|
19599
|
+
"failed",
|
|
19600
|
+
"expired",
|
|
19601
|
+
"deleted"
|
|
19602
|
+
]);
|
|
19603
|
+
/** One export job / history row. */
|
|
19604
|
+
var ExportRecordSchema = object({
|
|
19605
|
+
id: string(),
|
|
19606
|
+
deviceId: number(),
|
|
19607
|
+
profile: string(),
|
|
19608
|
+
fromMs: number(),
|
|
19609
|
+
toMs: number(),
|
|
19610
|
+
options: ExportOptionsSchema,
|
|
19611
|
+
state: ExportStateSchema,
|
|
19612
|
+
/** 0–100 while rendering; null otherwise. */
|
|
19613
|
+
progressPct: number().nullable(),
|
|
19614
|
+
/** File size once ready; null before. */
|
|
19615
|
+
fileBytes: number().nullable(),
|
|
19616
|
+
expiresAt: number(),
|
|
19617
|
+
deleteAfterDownload: boolean(),
|
|
19618
|
+
/** Epoch of the first complete download; null until then. */
|
|
19619
|
+
downloadedAt: number().nullable(),
|
|
19620
|
+
createdAt: number(),
|
|
19621
|
+
/** User id/name that requested the export. */
|
|
19622
|
+
createdBy: string(),
|
|
19623
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
19624
|
+
error: string().nullable()
|
|
19625
|
+
});
|
|
19626
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
19627
|
+
var ExportDownloadSchema = object({
|
|
19628
|
+
url: string(),
|
|
19629
|
+
endpoints: array(string())
|
|
19630
|
+
});
|
|
19631
|
+
method(object({
|
|
19632
|
+
deviceId: number(),
|
|
19633
|
+
profile: string(),
|
|
19634
|
+
fromMs: number(),
|
|
19635
|
+
toMs: number(),
|
|
19636
|
+
options: ExportOptionsSchema
|
|
19637
|
+
}), ExportRecordSchema, {
|
|
19638
|
+
kind: "mutation",
|
|
19639
|
+
auth: "protected"
|
|
19640
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
19641
|
+
kind: "query",
|
|
19642
|
+
auth: "protected"
|
|
19643
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
19644
|
+
kind: "query",
|
|
19645
|
+
auth: "protected"
|
|
19646
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
19647
|
+
kind: "mutation",
|
|
19648
|
+
auth: "protected"
|
|
19649
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
19650
|
+
kind: "mutation",
|
|
19651
|
+
auth: "protected"
|
|
19652
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
19653
|
+
kind: "query",
|
|
19654
|
+
auth: "protected"
|
|
19655
|
+
});
|
|
19656
|
+
/**
|
|
19505
19657
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
19506
19658
|
* payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
|
|
19507
19659
|
* `deviceId`.
|
|
@@ -23425,6 +23577,42 @@ Object.freeze({
|
|
|
23425
23577
|
addonId: null,
|
|
23426
23578
|
access: "create"
|
|
23427
23579
|
},
|
|
23580
|
+
"recordingExport.cancelExport": {
|
|
23581
|
+
capName: "recordingExport",
|
|
23582
|
+
capScope: "system",
|
|
23583
|
+
addonId: null,
|
|
23584
|
+
access: "create"
|
|
23585
|
+
},
|
|
23586
|
+
"recordingExport.createExport": {
|
|
23587
|
+
capName: "recordingExport",
|
|
23588
|
+
capScope: "system",
|
|
23589
|
+
addonId: null,
|
|
23590
|
+
access: "create"
|
|
23591
|
+
},
|
|
23592
|
+
"recordingExport.deleteExport": {
|
|
23593
|
+
capName: "recordingExport",
|
|
23594
|
+
capScope: "system",
|
|
23595
|
+
addonId: null,
|
|
23596
|
+
access: "delete"
|
|
23597
|
+
},
|
|
23598
|
+
"recordingExport.getDownloadUrl": {
|
|
23599
|
+
capName: "recordingExport",
|
|
23600
|
+
capScope: "system",
|
|
23601
|
+
addonId: null,
|
|
23602
|
+
access: "view"
|
|
23603
|
+
},
|
|
23604
|
+
"recordingExport.getExport": {
|
|
23605
|
+
capName: "recordingExport",
|
|
23606
|
+
capScope: "system",
|
|
23607
|
+
addonId: null,
|
|
23608
|
+
access: "view"
|
|
23609
|
+
},
|
|
23610
|
+
"recordingExport.listExports": {
|
|
23611
|
+
capName: "recordingExport",
|
|
23612
|
+
capScope: "system",
|
|
23613
|
+
addonId: null,
|
|
23614
|
+
access: "view"
|
|
23615
|
+
},
|
|
23428
23616
|
"sceneMonitor.captureReference": {
|
|
23429
23617
|
capName: "scene-monitor",
|
|
23430
23618
|
capScope: "device",
|
package/dist/addon.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { createReadStream } from "node:fs";
|
|
|
5
5
|
import * as fsp from "node:fs/promises";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { createServer } from "node:net";
|
|
8
|
-
//#region ../types/dist/event-category-
|
|
8
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
9
9
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
10
10
|
EventCategory["SystemBoot"] = "system.boot";
|
|
11
11
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -158,6 +158,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
158
158
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
159
159
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
160
160
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
161
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
162
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
163
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
164
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
165
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
161
166
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
162
167
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
163
168
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -447,6 +452,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
447
452
|
*/
|
|
448
453
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
449
454
|
/**
|
|
455
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
456
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
457
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
458
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
459
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
460
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
461
|
+
* this bus topic drives notifier rules + live UI. See
|
|
462
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
463
|
+
*/
|
|
464
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
465
|
+
/**
|
|
466
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
467
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
468
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
469
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
470
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
471
|
+
*/
|
|
472
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
473
|
+
/**
|
|
450
474
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
451
475
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
452
476
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5185,6 +5209,25 @@ function _instanceof(cls, params = {}) {
|
|
|
5185
5209
|
};
|
|
5186
5210
|
return inst;
|
|
5187
5211
|
}
|
|
5212
|
+
//#endregion
|
|
5213
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5214
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5215
|
+
var ZodIssueCode = {
|
|
5216
|
+
invalid_type: "invalid_type",
|
|
5217
|
+
too_big: "too_big",
|
|
5218
|
+
too_small: "too_small",
|
|
5219
|
+
invalid_format: "invalid_format",
|
|
5220
|
+
not_multiple_of: "not_multiple_of",
|
|
5221
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5222
|
+
invalid_union: "invalid_union",
|
|
5223
|
+
invalid_key: "invalid_key",
|
|
5224
|
+
invalid_element: "invalid_element",
|
|
5225
|
+
invalid_value: "invalid_value",
|
|
5226
|
+
custom: "custom"
|
|
5227
|
+
};
|
|
5228
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5229
|
+
var ZodFirstPartyTypeKind;
|
|
5230
|
+
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5188
5231
|
Object.fromEntries([
|
|
5189
5232
|
{
|
|
5190
5233
|
id: "overview",
|
|
@@ -12570,7 +12613,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
12570
12613
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
12571
12614
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
12572
12615
|
*/
|
|
12573
|
-
var ZoneRuleStageEnum = _enum([
|
|
12616
|
+
var ZoneRuleStageEnum = _enum([
|
|
12617
|
+
"motion",
|
|
12618
|
+
"detection",
|
|
12619
|
+
"package"
|
|
12620
|
+
]);
|
|
12574
12621
|
DeviceType.Camera, method(object({
|
|
12575
12622
|
deviceId: number(),
|
|
12576
12623
|
stage: ZoneRuleStageEnum
|
|
@@ -12583,7 +12630,8 @@ DeviceType.Camera, method(object({
|
|
|
12583
12630
|
auth: "admin"
|
|
12584
12631
|
}), object({
|
|
12585
12632
|
motion: array(ZoneRuleSchema).readonly(),
|
|
12586
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
12633
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
12634
|
+
package: array(ZoneRuleSchema).readonly()
|
|
12587
12635
|
});
|
|
12588
12636
|
var ProviderStatusSchema = object({
|
|
12589
12637
|
connected: boolean(),
|
|
@@ -15811,6 +15859,7 @@ var EventKindIconSchema = _enum([
|
|
|
15811
15859
|
"smoke",
|
|
15812
15860
|
"water",
|
|
15813
15861
|
"button",
|
|
15862
|
+
"package",
|
|
15814
15863
|
"generic"
|
|
15815
15864
|
]);
|
|
15816
15865
|
var EventKindCategorySchema = _enum([
|
|
@@ -15818,7 +15867,8 @@ var EventKindCategorySchema = _enum([
|
|
|
15818
15867
|
"audio",
|
|
15819
15868
|
"detection",
|
|
15820
15869
|
"sensor",
|
|
15821
|
-
"custom"
|
|
15870
|
+
"custom",
|
|
15871
|
+
"package"
|
|
15822
15872
|
]);
|
|
15823
15873
|
var EventKindDescriptorSchema = object({
|
|
15824
15874
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -19464,6 +19514,108 @@ method(object({
|
|
|
19464
19514
|
auth: "admin"
|
|
19465
19515
|
});
|
|
19466
19516
|
/**
|
|
19517
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
19518
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
19519
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
19520
|
+
* delete-after-download.
|
|
19521
|
+
*
|
|
19522
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
19523
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
19524
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
19525
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
19526
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
19527
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
19528
|
+
* SQLite); history rows survive file deletion for audit.
|
|
19529
|
+
*/
|
|
19530
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
19531
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
19532
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
19533
|
+
var ExportTimelapseSchema = object({
|
|
19534
|
+
everyMs: number().int().positive(),
|
|
19535
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
19536
|
+
});
|
|
19537
|
+
/**
|
|
19538
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
19539
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
19540
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
19541
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
19542
|
+
*/
|
|
19543
|
+
var ExportOptionsSchema = object({
|
|
19544
|
+
speed: ExportSpeedSchema.optional(),
|
|
19545
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
19546
|
+
includeAudio: boolean(),
|
|
19547
|
+
maxLifeMs: number().int().positive(),
|
|
19548
|
+
deleteAfterDownload: boolean(),
|
|
19549
|
+
title: string().max(200).optional()
|
|
19550
|
+
}).superRefine((v, ctx) => {
|
|
19551
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
19552
|
+
code: ZodIssueCode.custom,
|
|
19553
|
+
message: "speed and timelapse are mutually exclusive",
|
|
19554
|
+
path: ["timelapse"]
|
|
19555
|
+
});
|
|
19556
|
+
});
|
|
19557
|
+
var ExportStateSchema = _enum([
|
|
19558
|
+
"queued",
|
|
19559
|
+
"rendering",
|
|
19560
|
+
"ready",
|
|
19561
|
+
"failed",
|
|
19562
|
+
"expired",
|
|
19563
|
+
"deleted"
|
|
19564
|
+
]);
|
|
19565
|
+
/** One export job / history row. */
|
|
19566
|
+
var ExportRecordSchema = object({
|
|
19567
|
+
id: string(),
|
|
19568
|
+
deviceId: number(),
|
|
19569
|
+
profile: string(),
|
|
19570
|
+
fromMs: number(),
|
|
19571
|
+
toMs: number(),
|
|
19572
|
+
options: ExportOptionsSchema,
|
|
19573
|
+
state: ExportStateSchema,
|
|
19574
|
+
/** 0–100 while rendering; null otherwise. */
|
|
19575
|
+
progressPct: number().nullable(),
|
|
19576
|
+
/** File size once ready; null before. */
|
|
19577
|
+
fileBytes: number().nullable(),
|
|
19578
|
+
expiresAt: number(),
|
|
19579
|
+
deleteAfterDownload: boolean(),
|
|
19580
|
+
/** Epoch of the first complete download; null until then. */
|
|
19581
|
+
downloadedAt: number().nullable(),
|
|
19582
|
+
createdAt: number(),
|
|
19583
|
+
/** User id/name that requested the export. */
|
|
19584
|
+
createdBy: string(),
|
|
19585
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
19586
|
+
error: string().nullable()
|
|
19587
|
+
});
|
|
19588
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
19589
|
+
var ExportDownloadSchema = object({
|
|
19590
|
+
url: string(),
|
|
19591
|
+
endpoints: array(string())
|
|
19592
|
+
});
|
|
19593
|
+
method(object({
|
|
19594
|
+
deviceId: number(),
|
|
19595
|
+
profile: string(),
|
|
19596
|
+
fromMs: number(),
|
|
19597
|
+
toMs: number(),
|
|
19598
|
+
options: ExportOptionsSchema
|
|
19599
|
+
}), ExportRecordSchema, {
|
|
19600
|
+
kind: "mutation",
|
|
19601
|
+
auth: "protected"
|
|
19602
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
19603
|
+
kind: "query",
|
|
19604
|
+
auth: "protected"
|
|
19605
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
19606
|
+
kind: "query",
|
|
19607
|
+
auth: "protected"
|
|
19608
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
19609
|
+
kind: "mutation",
|
|
19610
|
+
auth: "protected"
|
|
19611
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
19612
|
+
kind: "mutation",
|
|
19613
|
+
auth: "protected"
|
|
19614
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
19615
|
+
kind: "query",
|
|
19616
|
+
auth: "protected"
|
|
19617
|
+
});
|
|
19618
|
+
/**
|
|
19467
19619
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
19468
19620
|
* payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
|
|
19469
19621
|
* `deviceId`.
|
|
@@ -23387,6 +23539,42 @@ Object.freeze({
|
|
|
23387
23539
|
addonId: null,
|
|
23388
23540
|
access: "create"
|
|
23389
23541
|
},
|
|
23542
|
+
"recordingExport.cancelExport": {
|
|
23543
|
+
capName: "recordingExport",
|
|
23544
|
+
capScope: "system",
|
|
23545
|
+
addonId: null,
|
|
23546
|
+
access: "create"
|
|
23547
|
+
},
|
|
23548
|
+
"recordingExport.createExport": {
|
|
23549
|
+
capName: "recordingExport",
|
|
23550
|
+
capScope: "system",
|
|
23551
|
+
addonId: null,
|
|
23552
|
+
access: "create"
|
|
23553
|
+
},
|
|
23554
|
+
"recordingExport.deleteExport": {
|
|
23555
|
+
capName: "recordingExport",
|
|
23556
|
+
capScope: "system",
|
|
23557
|
+
addonId: null,
|
|
23558
|
+
access: "delete"
|
|
23559
|
+
},
|
|
23560
|
+
"recordingExport.getDownloadUrl": {
|
|
23561
|
+
capName: "recordingExport",
|
|
23562
|
+
capScope: "system",
|
|
23563
|
+
addonId: null,
|
|
23564
|
+
access: "view"
|
|
23565
|
+
},
|
|
23566
|
+
"recordingExport.getExport": {
|
|
23567
|
+
capName: "recordingExport",
|
|
23568
|
+
capScope: "system",
|
|
23569
|
+
addonId: null,
|
|
23570
|
+
access: "view"
|
|
23571
|
+
},
|
|
23572
|
+
"recordingExport.listExports": {
|
|
23573
|
+
capName: "recordingExport",
|
|
23574
|
+
capScope: "system",
|
|
23575
|
+
addonId: null,
|
|
23576
|
+
access: "view"
|
|
23577
|
+
},
|
|
23390
23578
|
"sceneMonitor.captureReference": {
|
|
23391
23579
|
capName: "scene-monitor",
|
|
23392
23580
|
capScope: "device",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|