@camstack/types 1.1.48 → 1.1.50

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.
@@ -221,6 +221,48 @@ export interface PipelineAnalyticsPlateGalleryChangedPayload {
221
221
  readonly kind: 'buffered' | 'assigned' | 'unassigned' | 'deleted';
222
222
  readonly [key: string]: unknown;
223
223
  }
224
+ /**
225
+ * Emitted by `addon-post-analysis` when a package-drop is confirmed — a
226
+ * newly-appeared stationary object of a package class that cleared the
227
+ * class / zone / dwell / size gates inside a package zone. Telemetry (D8):
228
+ * the durable record is the `package-events` store row; this drives
229
+ * notifier rules + live UI. See
230
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
231
+ */
232
+ export interface PipelineAnalyticsPackageDeliveredPayload {
233
+ readonly deviceId: number;
234
+ /** Stationary-registry entry id the delivery is paired to. */
235
+ readonly entryId: string;
236
+ /** Persisted `package-events` row id for this delivery. */
237
+ readonly eventId: string;
238
+ readonly className: string;
239
+ /** Package-zone ids the entry's centroid fell inside. */
240
+ readonly zoneIds: readonly string[];
241
+ /** Native-res key-frame crop key (resolve via the event-media plane). */
242
+ readonly keyFrameMediaKey?: string;
243
+ readonly bbox: {
244
+ readonly x: number;
245
+ readonly y: number;
246
+ readonly w: number;
247
+ readonly h: number;
248
+ };
249
+ readonly timestamp: number;
250
+ readonly [key: string]: unknown;
251
+ }
252
+ /**
253
+ * Emitted by `addon-post-analysis` when a previously-delivered package
254
+ * leaves its zone (its stationary entry departed — moved or TTL-swept).
255
+ * Telemetry (D8). See package-zones-design §5.2.
256
+ */
257
+ export interface PipelineAnalyticsPackagePickedUpPayload {
258
+ readonly deviceId: number;
259
+ readonly entryId: string;
260
+ /** The `package-events` delivery row this pick-up pairs to. */
261
+ readonly deliveredEventId: string;
262
+ readonly className: string;
263
+ readonly timestamp: number;
264
+ readonly [key: string]: unknown;
265
+ }
224
266
  /**
225
267
  * Child steps enabled for a camera + their scheduling policy, as read
226
268
  * from the pipeline catalog. Announced on `PipelineInferenceResultPayload`
@@ -723,6 +765,8 @@ export interface EventCatalog {
723
765
  'pipeline-analytics.track-lifecycle': PipelineAnalyticsTrackLifecyclePayload;
724
766
  'pipeline-analytics.face-gallery-changed': PipelineAnalyticsFaceGalleryChangedPayload;
725
767
  'pipeline-analytics.plate-gallery-changed': PipelineAnalyticsPlateGalleryChangedPayload;
768
+ 'pipeline-analytics.package-delivered': PipelineAnalyticsPackageDeliveredPayload;
769
+ 'pipeline-analytics.package-picked-up': PipelineAnalyticsPackagePickedUpPayload;
726
770
  /**
727
771
  * On-board detection coming straight from the camera firmware (Reolink
728
772
  * AI alarms, ONVIF analytics, etc.) — as opposed to `detection.result`
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Ops-log — the durable, append-only operations audit shared by the
3
+ * recordings and events management surfaces.
4
+ *
5
+ * ONE row shape is reused for both domains so a single "Activity" view can
6
+ * merge the recorder's DurableState ring (recordings ops-log) and the
7
+ * pipeline-analytics SQLite collection (events ops-log). Each row records a
8
+ * management operation, WHY it ran (reason), and its measurable effect
9
+ * (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
10
+ * never fail the operation it records.
11
+ */
12
+ import { z } from 'zod';
13
+ /** Which management domain the operation belongs to. */
14
+ export declare const OpsLogDomainSchema: z.ZodEnum<{
15
+ events: "events";
16
+ recording: "recording";
17
+ }>;
18
+ export type OpsLogDomain = z.infer<typeof OpsLogDomainSchema>;
19
+ /** The kind of management operation performed. */
20
+ export declare const OpsLogOpSchema: z.ZodEnum<{
21
+ prune: "prune";
22
+ "manual-delete": "manual-delete";
23
+ rescan: "rescan";
24
+ "retention-run": "retention-run";
25
+ }>;
26
+ export type OpsLogOp = z.infer<typeof OpsLogOpSchema>;
27
+ /** Why the operation ran. */
28
+ export declare const OpsLogReasonSchema: z.ZodEnum<{
29
+ manual: "manual";
30
+ retention: "retention";
31
+ quota: "quota";
32
+ operator: "operator";
33
+ }>;
34
+ export type OpsLogReason = z.infer<typeof OpsLogReasonSchema>;
35
+ /** One audit row, shared verbatim by both domains. */
36
+ export declare const OpsLogEntrySchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ at: z.ZodNumber;
39
+ domain: z.ZodEnum<{
40
+ events: "events";
41
+ recording: "recording";
42
+ }>;
43
+ op: z.ZodEnum<{
44
+ prune: "prune";
45
+ "manual-delete": "manual-delete";
46
+ rescan: "rescan";
47
+ "retention-run": "retention-run";
48
+ }>;
49
+ reason: z.ZodEnum<{
50
+ manual: "manual";
51
+ retention: "retention";
52
+ quota: "quota";
53
+ operator: "operator";
54
+ }>;
55
+ deviceId: z.ZodNullable<z.ZodNumber>;
56
+ nodeId: z.ZodString;
57
+ itemsAffected: z.ZodNumber;
58
+ bytesReclaimed: z.ZodNumber;
59
+ detail: z.ZodNullable<z.ZodString>;
60
+ actor: z.ZodString;
61
+ }, z.core.$strip>;
62
+ export type OpsLogEntry = z.infer<typeof OpsLogEntrySchema>;
63
+ /** Shared query input for the per-domain `listOpsLog` cap methods. */
64
+ export declare const OpsLogQueryInputSchema: z.ZodObject<{
65
+ deviceId: z.ZodOptional<z.ZodNumber>;
66
+ limit: z.ZodOptional<z.ZodNumber>;
67
+ }, z.core.$strip>;
68
+ export type OpsLogQueryInput = z.infer<typeof OpsLogQueryInputSchema>;
69
+ /**
70
+ * Default cap on the recorder's DurableState ops-log ring — the newest N rows
71
+ * survive; older ones are evicted on append.
72
+ */
73
+ export declare const OPS_LOG_RING_DEFAULT_MAX = 500;
74
+ /** Default page size for a `listOpsLog` query when the caller omits `limit`. */
75
+ export declare const OPS_LOG_DEFAULT_LIMIT = 200;
@@ -1,4 +1,4 @@
1
- const require_event_category = require("./event-category-AkBNxg_X.js");
1
+ const require_event_category = require("./event-category-CGj9fI4L.js");
2
2
  let zod = require("zod");
3
3
  //#region src/disposer-chain.ts
4
4
  var DisposerChain = class {
@@ -2975,6 +2975,10 @@ function createDeviceProxy(api, binding, opts) {
2975
2975
  pruneTracksBefore: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "pruneTracksBefore", "mutation", input),
2976
2976
  wipeAllAnalytics: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "wipeAllAnalytics", "mutation", input),
2977
2977
  deleteTracks: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deleteTracks", "mutation", input),
2978
+ getEventStoreFootprint: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventStoreFootprint", "query", input),
2979
+ pruneEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "pruneEvents", "mutation", input),
2980
+ deleteDeviceEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deleteDeviceEvents", "mutation", input),
2981
+ listOpsLog: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listOpsLog", "query", input),
2978
2982
  getEventMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventMedia", "query", input),
2979
2983
  getTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getTrackMedia", "query", input),
2980
2984
  searchObjectEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "searchObjectEvents", "query", input),
@@ -3221,11 +3225,16 @@ function createDeviceProxy(api, binding, opts) {
3221
3225
  setDeviceConfig: (input) => dispatchSystem("recording", "setDeviceConfig", "mutation", input),
3222
3226
  rescanStorage: (input) => dispatchSystem("recording", "rescanStorage", "mutation", input),
3223
3227
  pruneFootage: (input) => dispatchSystem("recording", "pruneFootage", "mutation", input),
3228
+ deleteFootprint: (input) => dispatchSystem("recording", "deleteFootprint", "mutation", input),
3224
3229
  getStatus: (input) => dispatchSystem("recording", "getStatus", "query", input),
3225
3230
  getDeviceSettingsContribution: (input) => dispatchSystem("recording", "getDeviceSettingsContribution", "query", input),
3226
3231
  getDeviceLiveContribution: (input) => dispatchSystem("recording", "getDeviceLiveContribution", "query", input),
3227
3232
  applyDeviceSettingsPatch: (input) => dispatchSystem("recording", "applyDeviceSettingsPatch", "mutation", input)
3228
3233
  },
3234
+ recordingExport: {
3235
+ createExport: (input) => dispatchSystem("recordingExport", "createExport", "mutation", input),
3236
+ listExports: (input) => dispatchSystem("recordingExport", "listExports", "query", input)
3237
+ },
3229
3238
  streamBroker: {
3230
3239
  publishCameraStream: (input) => dispatchSystem("streamBroker", "publishCameraStream", "mutation", input),
3231
3240
  retractCameraStream: (input) => dispatchSystem("streamBroker", "retractCameraStream", "mutation", input),
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-H4AVePnn.mjs";
1
+ import { t as EventCategory } from "./event-category-D4HJq7Mw.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/disposer-chain.ts
4
4
  var DisposerChain = class {
@@ -2975,6 +2975,10 @@ function createDeviceProxy(api, binding, opts) {
2975
2975
  pruneTracksBefore: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "pruneTracksBefore", "mutation", input),
2976
2976
  wipeAllAnalytics: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "wipeAllAnalytics", "mutation", input),
2977
2977
  deleteTracks: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deleteTracks", "mutation", input),
2978
+ getEventStoreFootprint: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventStoreFootprint", "query", input),
2979
+ pruneEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "pruneEvents", "mutation", input),
2980
+ deleteDeviceEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deleteDeviceEvents", "mutation", input),
2981
+ listOpsLog: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listOpsLog", "query", input),
2978
2982
  getEventMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getEventMedia", "query", input),
2979
2983
  getTrackMedia: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getTrackMedia", "query", input),
2980
2984
  searchObjectEvents: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "searchObjectEvents", "query", input),
@@ -3221,11 +3225,16 @@ function createDeviceProxy(api, binding, opts) {
3221
3225
  setDeviceConfig: (input) => dispatchSystem("recording", "setDeviceConfig", "mutation", input),
3222
3226
  rescanStorage: (input) => dispatchSystem("recording", "rescanStorage", "mutation", input),
3223
3227
  pruneFootage: (input) => dispatchSystem("recording", "pruneFootage", "mutation", input),
3228
+ deleteFootprint: (input) => dispatchSystem("recording", "deleteFootprint", "mutation", input),
3224
3229
  getStatus: (input) => dispatchSystem("recording", "getStatus", "query", input),
3225
3230
  getDeviceSettingsContribution: (input) => dispatchSystem("recording", "getDeviceSettingsContribution", "query", input),
3226
3231
  getDeviceLiveContribution: (input) => dispatchSystem("recording", "getDeviceLiveContribution", "query", input),
3227
3232
  applyDeviceSettingsPatch: (input) => dispatchSystem("recording", "applyDeviceSettingsPatch", "mutation", input)
3228
3233
  },
3234
+ recordingExport: {
3235
+ createExport: (input) => dispatchSystem("recordingExport", "createExport", "mutation", input),
3236
+ listExports: (input) => dispatchSystem("recordingExport", "listExports", "query", input)
3237
+ },
3229
3238
  streamBroker: {
3230
3239
  publishCameraStream: (input) => dispatchSystem("streamBroker", "publishCameraStream", "mutation", input),
3231
3240
  retractCameraStream: (input) => dispatchSystem("streamBroker", "retractCameraStream", "mutation", input),
@@ -22,8 +22,22 @@ export interface StepDefinition {
22
22
  readonly slot: PipelineSlot;
23
23
  /** Which postprocessor to apply to raw model output */
24
24
  readonly postprocessor: PostprocessorType;
25
- /** How this step receives its input */
26
- readonly extractMode: 'full-frame' | 'crop-roi';
25
+ /**
26
+ * How this step receives its input:
27
+ * - `full-frame` — the whole frame (root detectors like object-detection).
28
+ * - `crop-roi` — a crop of a PARENT detection's bbox (child steps like
29
+ * face-detection, plate-detection, classifiers).
30
+ * - `crop-zone` — a crop of the device's own `package`-stage zone-rules
31
+ * polygons (+ upscale for small-parcel recall), NOT a parent detection.
32
+ * A ROOT-plane detector (`inputClasses === null`) that makes the drawn
33
+ * package zones its inference input instead of the full frame. Used by the
34
+ * `package-detection` step (design ADDENDUM). NOTE: the frame-preparation
35
+ * for `crop-zone` (zone-bbox crop + upscale + bbox re-projection back to
36
+ * full-frame coords) is a pipeline-runner concern that is NOT yet
37
+ * implemented — a `crop-zone` root currently runs full-frame until that
38
+ * plumbing lands (see step-definitions.ts STEP_PACKAGE_DETECTION).
39
+ */
40
+ readonly extractMode: 'full-frame' | 'crop-roi' | 'crop-zone';
27
41
  /** Classes this step accepts from a parent detector (null = root, accepts full frame) */
28
42
  readonly inputClasses: readonly string[] | null;
29
43
  /** Classes this step outputs (e.g., ['person','vehicle','animal'] for YOLO) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.1.48",
3
+ "version": "1.1.50",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",