@camstack/types 1.1.49 → 1.1.51
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/index.d.ts +2 -2
- package/dist/capabilities/pipeline-analytics.cap.d.ts +162 -0
- package/dist/capabilities/recording.cap.d.ts +55 -1
- package/dist/capabilities/sensor-event-kinds.d.ts +32 -15
- package/dist/capabilities/zone-rules.cap.d.ts +4 -3
- package/dist/catalogs/event-taxonomy.d.ts +44 -0
- package/dist/catalogs/index.d.ts +2 -0
- package/dist/generated/addon-api.d.ts +210 -2
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +475 -53
- package/dist/index.mjs +461 -54
- package/dist/interfaces/config-ui.d.ts +47 -1
- package/dist/interfaces/ops-log.d.ts +75 -0
- package/dist/{sleep-BfvNtyu8.js → sleep-CF-UWPp0.js} +5 -0
- package/dist/{sleep-DOq2moJx.mjs → sleep-D8ZkNoYz.mjs} +5 -0
- package/dist/types/pipeline-step.d.ts +16 -2
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-CF-UWPp0.js");
|
|
3
3
|
const require_event_category = require("./event-category-CGj9fI4L.js");
|
|
4
4
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
5
5
|
exports.BaseAddon = require_sleep.BaseAddon;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as parseJsonUnknown, D as asString, I as scopeKey, M as ReadinessRegistry, N as ReadinessTimeoutError, S as DeviceType, T as asJsonObject, a as viewerUiCapability, bt as DisposerChain, ct as BaseAddon, ft as emitReadiness, i as deviceOpsCapability, j as DATAPLANE_SECRET_HEADER, lt as normalizeAddonInitResult, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep } from "./sleep-
|
|
1
|
+
import { A as parseJsonUnknown, D as asString, I as scopeKey, M as ReadinessRegistry, N as ReadinessTimeoutError, S as DeviceType, T as asJsonObject, a as viewerUiCapability, bt as DisposerChain, ct as BaseAddon, ft as emitReadiness, i as deviceOpsCapability, j as DATAPLANE_SECRET_HEADER, lt as normalizeAddonInitResult, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep } from "./sleep-D8ZkNoYz.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-D4HJq7Mw.mjs";
|
|
3
3
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
4
4
|
export { BaseAddon, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, normalizeAddonInitResult, parseJsonUnknown, scopeKey, sleep, viewerUiCapability };
|
|
@@ -77,8 +77,8 @@ export { type ILlmProvider, type LlmDefault, type LlmDefaultSelector, LlmDefault
|
|
|
77
77
|
export { type ILlmRuntimeProvider, llmRuntimeCapability, type LlmNodeModel, LlmNodeModelSchema, type LlmRuntimeCompleteInput, LlmRuntimeCompleteInputSchema, type LlmRuntimeDiskUsage, LlmRuntimeDiskUsageSchema, type LlmRuntimeStatus, LlmRuntimeStatusSchema, type ManagedModelRef, ManagedModelRefSchema, type ManagedRuntimeConfig, ManagedRuntimeConfigSchema, } from './llm-runtime.cap.js';
|
|
78
78
|
export { type LlmErrorCode, LlmErrorCodeSchema, type LlmGenerateBaseInput, LlmGenerateBaseInputSchema, type LlmGenerateErr, LlmGenerateErrSchema, type LlmGenerateOk, LlmGenerateOkSchema, type LlmGenerateResult, LlmGenerateResultSchema, type LlmImage, LlmImageSchema, type LlmUsage, LlmUsageSchema, } from './llm-shared.js';
|
|
79
79
|
export { type IOauthIntegrationProvider, type OauthIntegrationDescriptor, OauthIntegrationDescriptorSchema, oauthIntegrationCapability, } from './oauth-integration.cap.js';
|
|
80
|
-
export { type AudioEvent, AudioEventSchema, type DetectionSource, DetectionSourceSchema, type EventKind, type EventKindCategory, EventKindCategorySchema, type EventKindDescriptor, EventKindDescriptorSchema, type EventKindIcon, EventKindIconSchema, EventKindSchema, type IPipelineAnalyticsProvider, type KeyEvent, KeyEventSchema, type MediaFile, type MediaFileKind, MediaFileSchema, type MotionEvent, MotionEventSchema, type ObjectEvent, ObjectEventSchema, pipelineAnalyticsCapability, type RecentTracksPage, RecentTracksPageSchema, type RecentTracksQuery, RecentTracksQueryInput, type ScoredObjectEvent, ScoredObjectEventSchema, type SensorEvent, SensorEventSchema, type Track, type TrackCascadeCounts, TrackCascadeCountsSchema, TrackedDetectionSchema, type TrackEnvelope, TrackEnvelopeSchema, type TrackProjection, TrackProjectionSchema, TrackSchema, type TrackState, TrackStateSchema, type TrackZoneFilter, TrackZoneFilterSchema, } from './pipeline-analytics.cap.js';
|
|
81
|
-
export { EVENT_KIND_BY_CAP, type SensorEventKindDescriptor } from './sensor-event-kinds.js';
|
|
80
|
+
export { type AudioEvent, AudioEventSchema, type DetectionSource, DetectionSourceSchema, type EventKind, type EventKindCategory, EventKindCategorySchema, type EventKindDescriptor, EventKindDescriptorSchema, type EventKindIcon, EventKindIconSchema, EventKindSchema, type EventPruneCounts, type EventStoreDeviceFootprint, type EventStoreFootprint, type IPipelineAnalyticsProvider, type KeyEvent, KeyEventSchema, type MediaFile, type MediaFileKind, MediaFileSchema, type MotionEvent, MotionEventSchema, type ObjectEvent, ObjectEventSchema, pipelineAnalyticsCapability, type RecentTracksPage, RecentTracksPageSchema, type RecentTracksQuery, RecentTracksQueryInput, type ScoredObjectEvent, ScoredObjectEventSchema, type SensorEvent, SensorEventSchema, type Track, type TrackCascadeCounts, TrackCascadeCountsSchema, TrackedDetectionSchema, type TrackEnvelope, TrackEnvelopeSchema, type TrackProjection, TrackProjectionSchema, TrackSchema, type TrackState, TrackStateSchema, type TrackZoneFilter, TrackZoneFilterSchema, } from './pipeline-analytics.cap.js';
|
|
81
|
+
export { EVENT_KIND_BY_CAP, EVENTFUL_CAP_NAMES, buildEventKindDescriptor, type SensorEventKindDescriptor, } from './sensor-event-kinds.js';
|
|
82
82
|
export type { PipelineStepInputOutput, PipelineValidationIssue, PipelineValidationResult, } from './pipeline-executor.cap.js';
|
|
83
83
|
export { ModelSubstitutionSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, pipelineExecutorCapability, } from './pipeline-executor.cap.js';
|
|
84
84
|
export type { CameraAssignmentStatus, CameraAudioStatus, CameraBrokerProfile, CameraBrokerStatus, CameraDecoderShm, CameraDecoderStatus, CameraDetectionPhase, CameraDetectionProvisioning, CameraDetectionProvisioningState, CameraDetectionStatus, CameraMotionStatus, CameraRecordingMode, CameraRecordingStatus, CameraSourceStatus, CameraSourceStream, CameraStatus, IngestOwner, } from './pipeline-orchestrator.cap.js';
|
|
@@ -76,6 +76,7 @@ export declare const EventKindIconSchema: z.ZodEnum<{
|
|
|
76
76
|
export type EventKindIcon = z.infer<typeof EventKindIconSchema>;
|
|
77
77
|
export declare const EventKindCategorySchema: z.ZodEnum<{
|
|
78
78
|
sensor: "sensor";
|
|
79
|
+
control: "control";
|
|
79
80
|
audio: "audio";
|
|
80
81
|
custom: "custom";
|
|
81
82
|
motion: "motion";
|
|
@@ -83,10 +84,18 @@ export declare const EventKindCategorySchema: z.ZodEnum<{
|
|
|
83
84
|
detection: "detection";
|
|
84
85
|
}>;
|
|
85
86
|
export type EventKindCategory = z.infer<typeof EventKindCategorySchema>;
|
|
87
|
+
/** Taxonomy level — macro (timeline lane) vs sub (events-page leaf). */
|
|
88
|
+
export declare const EventKindLevelSchema: z.ZodEnum<{
|
|
89
|
+
sub: "sub";
|
|
90
|
+
macro: "macro";
|
|
91
|
+
}>;
|
|
92
|
+
export type EventKindLevel = z.infer<typeof EventKindLevelSchema>;
|
|
86
93
|
declare const EventKindDescriptorSchema: z.ZodObject<{
|
|
87
94
|
kind: z.ZodString;
|
|
95
|
+
labelKey: z.ZodString;
|
|
88
96
|
label: z.ZodString;
|
|
89
97
|
color: z.ZodString;
|
|
98
|
+
iconId: z.ZodString;
|
|
90
99
|
icon: z.ZodEnum<{
|
|
91
100
|
button: "button";
|
|
92
101
|
generic: "generic";
|
|
@@ -103,12 +112,18 @@ declare const EventKindDescriptorSchema: z.ZodObject<{
|
|
|
103
112
|
}>;
|
|
104
113
|
category: z.ZodEnum<{
|
|
105
114
|
sensor: "sensor";
|
|
115
|
+
control: "control";
|
|
106
116
|
audio: "audio";
|
|
107
117
|
custom: "custom";
|
|
108
118
|
motion: "motion";
|
|
109
119
|
package: "package";
|
|
110
120
|
detection: "detection";
|
|
111
121
|
}>;
|
|
122
|
+
parentKind: z.ZodNullable<z.ZodString>;
|
|
123
|
+
level: z.ZodEnum<{
|
|
124
|
+
sub: "sub";
|
|
125
|
+
macro: "macro";
|
|
126
|
+
}>;
|
|
112
127
|
source: z.ZodObject<{
|
|
113
128
|
capName: z.ZodString;
|
|
114
129
|
deviceId: z.ZodNumber;
|
|
@@ -168,11 +183,27 @@ declare const TrackAudioLabelSchema: z.ZodObject<{
|
|
|
168
183
|
lastAt: z.ZodNumber;
|
|
169
184
|
}, z.core.$strip>;
|
|
170
185
|
export type TrackAudioLabel = z.infer<typeof TrackAudioLabelSchema>;
|
|
186
|
+
/**
|
|
187
|
+
* How a track was produced. `pipeline` (default / absent) = the spatial
|
|
188
|
+
* detection+tracking pipeline. `sensor` = a SYNTHETIC track projected from a
|
|
189
|
+
* linked sensor/control state change (no positions; carries a snapshot). The
|
|
190
|
+
* spatial subsystems (tracker association, occupancy count, re-id/embedding,
|
|
191
|
+
* resurrection) MUST skip `sensor` tracks — they have no bbox trajectory.
|
|
192
|
+
*/
|
|
193
|
+
export declare const TrackSourceSchema: z.ZodEnum<{
|
|
194
|
+
sensor: "sensor";
|
|
195
|
+
pipeline: "pipeline";
|
|
196
|
+
}>;
|
|
197
|
+
export type TrackSource = z.infer<typeof TrackSourceSchema>;
|
|
171
198
|
declare const TrackSchema: z.ZodObject<{
|
|
172
199
|
trackId: z.ZodString;
|
|
173
200
|
deviceId: z.ZodNumber;
|
|
174
201
|
className: z.ZodString;
|
|
175
202
|
label: z.ZodOptional<z.ZodString>;
|
|
203
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
204
|
+
sensor: "sensor";
|
|
205
|
+
pipeline: "pipeline";
|
|
206
|
+
}>>;
|
|
176
207
|
firstSeen: z.ZodNumber;
|
|
177
208
|
lastSeen: z.ZodNumber;
|
|
178
209
|
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -365,6 +396,10 @@ declare const RecentTracksPageSchema: z.ZodObject<{
|
|
|
365
396
|
deviceId: z.ZodNumber;
|
|
366
397
|
className: z.ZodString;
|
|
367
398
|
label: z.ZodOptional<z.ZodString>;
|
|
399
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
400
|
+
sensor: "sensor";
|
|
401
|
+
pipeline: "pipeline";
|
|
402
|
+
}>>;
|
|
368
403
|
firstSeen: z.ZodNumber;
|
|
369
404
|
lastSeen: z.ZodNumber;
|
|
370
405
|
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -500,6 +535,31 @@ declare const TrackCascadeCountsSchema: z.ZodObject<{
|
|
|
500
535
|
embeddings: z.ZodNumber;
|
|
501
536
|
}, z.core.$strip>;
|
|
502
537
|
export type TrackCascadeCounts = z.infer<typeof TrackCascadeCountsSchema>;
|
|
538
|
+
/** Event-store footprint for one camera. */
|
|
539
|
+
declare const EventStoreDeviceFootprintSchema: z.ZodObject<{
|
|
540
|
+
deviceId: z.ZodNumber;
|
|
541
|
+
rows: z.ZodNumber;
|
|
542
|
+
bytes: z.ZodNumber;
|
|
543
|
+
}, z.core.$strip>;
|
|
544
|
+
export type EventStoreDeviceFootprint = z.infer<typeof EventStoreDeviceFootprintSchema>;
|
|
545
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
546
|
+
declare const EventStoreFootprintSchema: z.ZodObject<{
|
|
547
|
+
totalRows: z.ZodNumber;
|
|
548
|
+
totalBytes: z.ZodNumber;
|
|
549
|
+
devices: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
550
|
+
deviceId: z.ZodNumber;
|
|
551
|
+
rows: z.ZodNumber;
|
|
552
|
+
bytes: z.ZodNumber;
|
|
553
|
+
}, z.core.$strip>>>;
|
|
554
|
+
}, z.core.$strip>;
|
|
555
|
+
export type EventStoreFootprint = z.infer<typeof EventStoreFootprintSchema>;
|
|
556
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
557
|
+
declare const EventPruneCountsSchema: z.ZodObject<{
|
|
558
|
+
motion: z.ZodNumber;
|
|
559
|
+
object: z.ZodNumber;
|
|
560
|
+
audio: z.ZodNumber;
|
|
561
|
+
}, z.core.$strip>;
|
|
562
|
+
export type EventPruneCounts = z.infer<typeof EventPruneCountsSchema>;
|
|
503
563
|
export declare const pipelineAnalyticsCapability: {
|
|
504
564
|
readonly name: "pipeline-analytics";
|
|
505
565
|
readonly scope: "device";
|
|
@@ -516,6 +576,10 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
516
576
|
deviceId: z.ZodNumber;
|
|
517
577
|
className: z.ZodString;
|
|
518
578
|
label: z.ZodOptional<z.ZodString>;
|
|
579
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
580
|
+
sensor: "sensor";
|
|
581
|
+
pipeline: "pipeline";
|
|
582
|
+
}>>;
|
|
519
583
|
firstSeen: z.ZodNumber;
|
|
520
584
|
lastSeen: z.ZodNumber;
|
|
521
585
|
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -580,6 +644,10 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
580
644
|
deviceId: z.ZodNumber;
|
|
581
645
|
className: z.ZodString;
|
|
582
646
|
label: z.ZodOptional<z.ZodString>;
|
|
647
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
648
|
+
sensor: "sensor";
|
|
649
|
+
pipeline: "pipeline";
|
|
650
|
+
}>>;
|
|
583
651
|
firstSeen: z.ZodNumber;
|
|
584
652
|
lastSeen: z.ZodNumber;
|
|
585
653
|
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -666,6 +734,10 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
666
734
|
deviceId: z.ZodNumber;
|
|
667
735
|
className: z.ZodString;
|
|
668
736
|
label: z.ZodOptional<z.ZodString>;
|
|
737
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
738
|
+
sensor: "sensor";
|
|
739
|
+
pipeline: "pipeline";
|
|
740
|
+
}>>;
|
|
669
741
|
firstSeen: z.ZodNumber;
|
|
670
742
|
lastSeen: z.ZodNumber;
|
|
671
743
|
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -748,6 +820,10 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
748
820
|
deviceId: z.ZodNumber;
|
|
749
821
|
className: z.ZodString;
|
|
750
822
|
label: z.ZodOptional<z.ZodString>;
|
|
823
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
824
|
+
sensor: "sensor";
|
|
825
|
+
pipeline: "pipeline";
|
|
826
|
+
}>>;
|
|
751
827
|
firstSeen: z.ZodNumber;
|
|
752
828
|
lastSeen: z.ZodNumber;
|
|
753
829
|
positions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -916,8 +992,10 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
916
992
|
deviceId: z.ZodNumber;
|
|
917
993
|
}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
918
994
|
kind: z.ZodString;
|
|
995
|
+
labelKey: z.ZodString;
|
|
919
996
|
label: z.ZodString;
|
|
920
997
|
color: z.ZodString;
|
|
998
|
+
iconId: z.ZodString;
|
|
921
999
|
icon: z.ZodEnum<{
|
|
922
1000
|
button: "button";
|
|
923
1001
|
generic: "generic";
|
|
@@ -934,12 +1012,18 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
934
1012
|
}>;
|
|
935
1013
|
category: z.ZodEnum<{
|
|
936
1014
|
sensor: "sensor";
|
|
1015
|
+
control: "control";
|
|
937
1016
|
audio: "audio";
|
|
938
1017
|
custom: "custom";
|
|
939
1018
|
motion: "motion";
|
|
940
1019
|
package: "package";
|
|
941
1020
|
detection: "detection";
|
|
942
1021
|
}>;
|
|
1022
|
+
parentKind: z.ZodNullable<z.ZodString>;
|
|
1023
|
+
level: z.ZodEnum<{
|
|
1024
|
+
sub: "sub";
|
|
1025
|
+
macro: "macro";
|
|
1026
|
+
}>;
|
|
943
1027
|
source: z.ZodObject<{
|
|
944
1028
|
capName: z.ZodString;
|
|
945
1029
|
deviceId: z.ZodNumber;
|
|
@@ -1077,6 +1161,84 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
1077
1161
|
deleted: z.ZodNumber;
|
|
1078
1162
|
failed: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
1079
1163
|
}, z.core.$strip>, "mutation">;
|
|
1164
|
+
/**
|
|
1165
|
+
* Durable event-store footprint for the management UI: event rows
|
|
1166
|
+
* (motion + object + audio) counted per camera + total, plus the
|
|
1167
|
+
* event-owned media bytes on disk per camera + total. Stat/count-based,
|
|
1168
|
+
* computed on demand.
|
|
1169
|
+
*/
|
|
1170
|
+
readonly getEventStoreFootprint: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
1171
|
+
totalRows: z.ZodNumber;
|
|
1172
|
+
totalBytes: z.ZodNumber;
|
|
1173
|
+
devices: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
1174
|
+
deviceId: z.ZodNumber;
|
|
1175
|
+
rows: z.ZodNumber;
|
|
1176
|
+
bytes: z.ZodNumber;
|
|
1177
|
+
}, z.core.$strip>>>;
|
|
1178
|
+
}, z.core.$strip>, "query">;
|
|
1179
|
+
/**
|
|
1180
|
+
* Cluster-wide prune of events older than `olderThanMs` (exclusive) across
|
|
1181
|
+
* every camera, deleting each event's media in lockstep. Logged to the
|
|
1182
|
+
* events ops-log with `reason` (default `'retention'`). Returns the summed
|
|
1183
|
+
* per-kind deleted counts.
|
|
1184
|
+
*/
|
|
1185
|
+
readonly pruneEvents: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
1186
|
+
olderThanMs: z.ZodNumber;
|
|
1187
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
1188
|
+
manual: "manual";
|
|
1189
|
+
retention: "retention";
|
|
1190
|
+
quota: "quota";
|
|
1191
|
+
operator: "operator";
|
|
1192
|
+
}>>;
|
|
1193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1194
|
+
motion: z.ZodNumber;
|
|
1195
|
+
object: z.ZodNumber;
|
|
1196
|
+
audio: z.ZodNumber;
|
|
1197
|
+
}, z.core.$strip>, "mutation">;
|
|
1198
|
+
/**
|
|
1199
|
+
* Manually delete EVERY event (motion + object + audio) for one camera and
|
|
1200
|
+
* its event-owned media in lockstep. Logged to the events ops-log as
|
|
1201
|
+
* `op:'manual-delete', reason:'manual'`. Destructive — the admin UI guards
|
|
1202
|
+
* it behind a confirm.
|
|
1203
|
+
*/
|
|
1204
|
+
readonly deleteDeviceEvents: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
1205
|
+
deviceId: z.ZodNumber;
|
|
1206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1207
|
+
motion: z.ZodNumber;
|
|
1208
|
+
object: z.ZodNumber;
|
|
1209
|
+
audio: z.ZodNumber;
|
|
1210
|
+
}, z.core.$strip>, "mutation">;
|
|
1211
|
+
/** The events ops-log rows (newest-first), optionally scoped to one camera.
|
|
1212
|
+
* Backed by a declared pipeline-analytics SQLite collection. */
|
|
1213
|
+
readonly listOpsLog: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
1214
|
+
deviceId: z.ZodOptional<z.ZodNumber>;
|
|
1215
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
1216
|
+
}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
1217
|
+
id: z.ZodString;
|
|
1218
|
+
at: z.ZodNumber;
|
|
1219
|
+
domain: z.ZodEnum<{
|
|
1220
|
+
events: "events";
|
|
1221
|
+
recording: "recording";
|
|
1222
|
+
}>;
|
|
1223
|
+
op: z.ZodEnum<{
|
|
1224
|
+
prune: "prune";
|
|
1225
|
+
"manual-delete": "manual-delete";
|
|
1226
|
+
rescan: "rescan";
|
|
1227
|
+
"retention-run": "retention-run";
|
|
1228
|
+
}>;
|
|
1229
|
+
reason: z.ZodEnum<{
|
|
1230
|
+
manual: "manual";
|
|
1231
|
+
retention: "retention";
|
|
1232
|
+
quota: "quota";
|
|
1233
|
+
operator: "operator";
|
|
1234
|
+
}>;
|
|
1235
|
+
deviceId: z.ZodNullable<z.ZodNumber>;
|
|
1236
|
+
nodeId: z.ZodString;
|
|
1237
|
+
itemsAffected: z.ZodNumber;
|
|
1238
|
+
bytesReclaimed: z.ZodNumber;
|
|
1239
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
1240
|
+
actor: z.ZodString;
|
|
1241
|
+
}, z.core.$strip>>>, "query">;
|
|
1080
1242
|
readonly getEventMedia: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
1081
1243
|
eventId: z.ZodString;
|
|
1082
1244
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -464,14 +464,68 @@ export declare const recordingCapability: {
|
|
|
464
464
|
storageBytes: z.ZodNumber;
|
|
465
465
|
}, z.core.$strip>, "mutation">;
|
|
466
466
|
/** Apply this device's retention policy to footage now; returns the oldest
|
|
467
|
-
* surviving footage start (the retention floor) or null if no footage.
|
|
467
|
+
* surviving footage start (the retention floor) or null if no footage. The
|
|
468
|
+
* prune is logged to the recordings ops-log with `reason` (default
|
|
469
|
+
* `'retention'` — the policy-driven prune; `'quota'` when disk-pressure
|
|
470
|
+
* triggered). */
|
|
468
471
|
readonly pruneFootage: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
469
472
|
deviceId: z.ZodNumber;
|
|
473
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
474
|
+
manual: "manual";
|
|
475
|
+
retention: "retention";
|
|
476
|
+
quota: "quota";
|
|
477
|
+
operator: "operator";
|
|
478
|
+
}>>;
|
|
470
479
|
}, z.core.$strip>, z.ZodObject<{
|
|
471
480
|
floorMs: z.ZodNullable<z.ZodNumber>;
|
|
472
481
|
deletedBuckets: z.ZodNumber;
|
|
473
482
|
reclaimedBytes: z.ZodNumber;
|
|
474
483
|
}, z.core.$strip>, "mutation">;
|
|
484
|
+
/**
|
|
485
|
+
* Manually delete a camera's footage — the whole footprint, or a
|
|
486
|
+
* `[fromMs, toMs)` window when either bound is given. Logged to the
|
|
487
|
+
* recordings ops-log as `op:'manual-delete', reason:'manual'`. Destructive:
|
|
488
|
+
* the admin UI guards it behind a confirm.
|
|
489
|
+
*/
|
|
490
|
+
readonly deleteFootprint: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
491
|
+
deviceId: z.ZodNumber;
|
|
492
|
+
fromMs: z.ZodOptional<z.ZodNumber>;
|
|
493
|
+
toMs: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
495
|
+
deletedBuckets: z.ZodNumber;
|
|
496
|
+
reclaimedBytes: z.ZodNumber;
|
|
497
|
+
}, z.core.$strip>, "mutation">;
|
|
498
|
+
/** The recordings ops-log rows (newest-first), optionally scoped to one
|
|
499
|
+
* camera. Backed by the recorder's bounded DurableState ring. */
|
|
500
|
+
readonly listOpsLog: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
501
|
+
deviceId: z.ZodOptional<z.ZodNumber>;
|
|
502
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
503
|
+
}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
504
|
+
id: z.ZodString;
|
|
505
|
+
at: z.ZodNumber;
|
|
506
|
+
domain: z.ZodEnum<{
|
|
507
|
+
events: "events";
|
|
508
|
+
recording: "recording";
|
|
509
|
+
}>;
|
|
510
|
+
op: z.ZodEnum<{
|
|
511
|
+
prune: "prune";
|
|
512
|
+
"manual-delete": "manual-delete";
|
|
513
|
+
rescan: "rescan";
|
|
514
|
+
"retention-run": "retention-run";
|
|
515
|
+
}>;
|
|
516
|
+
reason: z.ZodEnum<{
|
|
517
|
+
manual: "manual";
|
|
518
|
+
retention: "retention";
|
|
519
|
+
quota: "quota";
|
|
520
|
+
operator: "operator";
|
|
521
|
+
}>;
|
|
522
|
+
deviceId: z.ZodNullable<z.ZodNumber>;
|
|
523
|
+
nodeId: z.ZodString;
|
|
524
|
+
itemsAffected: z.ZodNumber;
|
|
525
|
+
bytesReclaimed: z.ZodNumber;
|
|
526
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
527
|
+
actor: z.ZodString;
|
|
528
|
+
}, z.core.$strip>>>, "query">;
|
|
475
529
|
};
|
|
476
530
|
};
|
|
477
531
|
export type IRecordingProvider = InferProvider<typeof recordingCapability>;
|
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
|
|
3
3
|
* `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
|
|
4
|
-
*
|
|
5
|
-
* event-emitter) into per-camera event-kind entries.
|
|
4
|
+
* caps into per-camera event-kind descriptors.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
6
|
+
* The descriptor DATA (color / iconId / labelKey / parentKind / category)
|
|
7
|
+
* is NOT duplicated here — every entry is derived from the single
|
|
8
|
+
* `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
|
|
9
|
+
* ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
|
|
10
|
+
* control cap means adding one line here (and a taxonomy entry); the anti-
|
|
11
|
+
* drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
|
|
12
|
+
* eventful cap is missing.
|
|
11
13
|
*/
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { type EventTaxonomyEntry } from '../catalogs/event-taxonomy.js';
|
|
15
|
+
import type { EventKindDescriptor, EventKindIcon } from './pipeline-analytics.cap.js';
|
|
16
|
+
/**
|
|
17
|
+
* The static half of an `EventKindDescriptor` (no per-device `source`).
|
|
18
|
+
* Extends the taxonomy entry with the legacy closed-enum `icon` glyph kept
|
|
19
|
+
* as a fallback for clients that predate `iconId`.
|
|
20
|
+
*/
|
|
21
|
+
export interface SensorEventKindDescriptor extends EventTaxonomyEntry {
|
|
22
|
+
/** Legacy closed-vocab glyph — fallback for `iconId`. */
|
|
18
23
|
readonly icon: EventKindIcon;
|
|
19
|
-
readonly category: EventKindCategory;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
|
-
* Sensor cap name → static event-kind descriptor. A linked device
|
|
26
|
+
* Sensor / control cap name → static event-kind descriptor. A linked device
|
|
23
27
|
* contributes one entry per bound cap present in this map.
|
|
24
28
|
*/
|
|
25
29
|
export declare const EVENT_KIND_BY_CAP: Readonly<Record<string, SensorEventKindDescriptor>>;
|
|
30
|
+
/** The cap names covered by the taxonomy (for the anti-drift guard). */
|
|
31
|
+
export declare const EVENTFUL_CAP_NAMES: readonly string[];
|
|
32
|
+
/**
|
|
33
|
+
* Build a full `EventKindDescriptor` for a taxonomy `kind`, stamping the
|
|
34
|
+
* per-device `source`. Returns null when `kind` is not in the taxonomy.
|
|
35
|
+
* This is THE bridge from the serializable taxonomy dictionary to the cap
|
|
36
|
+
* wire shape — every event-kind descriptor the server emits goes through it,
|
|
37
|
+
* so color/iconId/labelKey are never re-declared at a call site.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildEventKindDescriptor(kind: string, source: {
|
|
40
|
+
readonly capName: string;
|
|
41
|
+
readonly deviceId: number;
|
|
42
|
+
}): EventKindDescriptor | null;
|
|
@@ -100,9 +100,10 @@ export declare const zoneRulesCapability: {
|
|
|
100
100
|
* `package` backs the package-drop detector — a package zone is a
|
|
101
101
|
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
102
102
|
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
103
|
-
* The orchestrator provider
|
|
104
|
-
*
|
|
105
|
-
* consumers read
|
|
103
|
+
* The orchestrator provider writes this stage as a first-class slice
|
|
104
|
+
* (Phase 4): every mutation mirrors the full `{motion, detection,
|
|
105
|
+
* package}` shape, so consumers read the current package rules directly
|
|
106
|
+
* off `device.state.zoneRules.value.package`.
|
|
106
107
|
*/
|
|
107
108
|
readonly runtimeState: z.ZodObject<{
|
|
108
109
|
motion: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type EventTaxonomyCategory = 'motion' | 'audio' | 'detection' | 'sensor' | 'control' | 'package' | 'custom';
|
|
2
|
+
export type EventTaxonomyLevel = 'macro' | 'sub';
|
|
3
|
+
/**
|
|
4
|
+
* The static, serializable half of an event kind. Descriptors surfaced by
|
|
5
|
+
* `listEventKinds` extend this with a per-device `source`.
|
|
6
|
+
*/
|
|
7
|
+
export interface EventTaxonomyEntry {
|
|
8
|
+
/** Unique kind id ('vehicle', 'car', 'lock', 'audio-dog', …). */
|
|
9
|
+
readonly kind: string;
|
|
10
|
+
/** Macro parent ('car' → 'vehicle'); null for a macro. */
|
|
11
|
+
readonly parentKind: string | null;
|
|
12
|
+
/** Derived from `parentKind` — explicit for the UI. */
|
|
13
|
+
readonly level: EventTaxonomyLevel;
|
|
14
|
+
readonly category: EventTaxonomyCategory;
|
|
15
|
+
/** Hex color for timeline/legend rendering. */
|
|
16
|
+
readonly color: string;
|
|
17
|
+
/** Dictionary id → lucide component on the UI side. */
|
|
18
|
+
readonly iconId: string;
|
|
19
|
+
/** i18n key; `label` is the English fallback. */
|
|
20
|
+
readonly labelKey: string;
|
|
21
|
+
/** English fallback label (UI translates `labelKey` when it can). */
|
|
22
|
+
readonly label: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const TAXONOMY_COLORS: {
|
|
25
|
+
readonly motion: "#f59e0b";
|
|
26
|
+
readonly audio: "#06b6d4";
|
|
27
|
+
readonly person: "#22c55e";
|
|
28
|
+
readonly vehicle: "#3b82f6";
|
|
29
|
+
readonly animal: "#f97316";
|
|
30
|
+
readonly package: "#a855f7";
|
|
31
|
+
readonly sensor: "#8b5cf6";
|
|
32
|
+
readonly control: "#10b981";
|
|
33
|
+
readonly genericDetection: "#64748b";
|
|
34
|
+
};
|
|
35
|
+
/** Global default color when a kind is unknown (matches legacy box-drawer). */
|
|
36
|
+
export declare const DEFAULT_EVENT_COLOR = "#22ff55";
|
|
37
|
+
/** The complete taxonomy dictionary, keyed by kind. */
|
|
38
|
+
export declare const EVENT_TAXONOMY: Readonly<Record<string, EventTaxonomyEntry>>;
|
|
39
|
+
/** Taxonomy entry for a kind, or undefined when unknown. */
|
|
40
|
+
export declare function getTaxonomyEntry(kind: string): EventTaxonomyEntry | undefined;
|
|
41
|
+
/** Color for a kind — dictionary value, else the global default. */
|
|
42
|
+
export declare function colorForKind(kind: string): string;
|
|
43
|
+
/** The sub kinds whose `parentKind` is `macro` (empty for a leaf macro). */
|
|
44
|
+
export declare function subKindsOf(macro: string): readonly EventTaxonomyEntry[];
|
package/dist/catalogs/index.d.ts
CHANGED