@camstack/types 1.2.182 → 1.2.183

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.
@@ -98,7 +98,7 @@ export declare const SceneReferenceSchema: z.ZodObject<{
98
98
  modelId: z.ZodString;
99
99
  condition: z.ZodString;
100
100
  capturedAt: z.ZodNumber;
101
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
101
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
102
102
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
103
103
  }, z.core.$strip>;
104
104
  export declare const SceneMonitorStateSchema: z.ZodObject<{
@@ -109,7 +109,7 @@ export declare const SceneMonitorStateSchema: z.ZodObject<{
109
109
  modelId: z.ZodString;
110
110
  condition: z.ZodString;
111
111
  capturedAt: z.ZodNumber;
112
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
112
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
113
113
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
114
114
  }, z.core.$strip>>;
115
115
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -200,7 +200,7 @@ export declare const SceneMonitorSchema: z.ZodObject<{
200
200
  modelId: z.ZodString;
201
201
  condition: z.ZodString;
202
202
  capturedAt: z.ZodNumber;
203
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
203
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
204
204
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
205
205
  }, z.core.$strip>>;
206
206
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -295,7 +295,7 @@ export declare const SceneMonitorStatusSchema: z.ZodObject<{
295
295
  modelId: z.ZodString;
296
296
  condition: z.ZodString;
297
297
  capturedAt: z.ZodNumber;
298
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
298
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
299
299
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
300
300
  }, z.core.$strip>>;
301
301
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -419,7 +419,7 @@ export declare const SceneMonitorStatusForDeviceSchema: z.ZodObject<{
419
419
  modelId: z.ZodString;
420
420
  condition: z.ZodString;
421
421
  capturedAt: z.ZodNumber;
422
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
422
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
423
423
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
424
424
  }, z.core.$strip>>;
425
425
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -528,7 +528,7 @@ export declare const sceneMonitorCapability: {
528
528
  modelId: z.ZodString;
529
529
  condition: z.ZodString;
530
530
  capturedAt: z.ZodNumber;
531
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
531
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
532
532
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
533
533
  }, z.core.$strip>>;
534
534
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -644,7 +644,7 @@ export declare const sceneMonitorCapability: {
644
644
  modelId: z.ZodString;
645
645
  condition: z.ZodString;
646
646
  capturedAt: z.ZodNumber;
647
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
647
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
648
648
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
649
649
  }, z.core.$strip>>;
650
650
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -767,7 +767,7 @@ export declare const sceneMonitorCapability: {
767
767
  modelId: z.ZodString;
768
768
  condition: z.ZodString;
769
769
  capturedAt: z.ZodNumber;
770
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
770
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
771
771
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
772
772
  }, z.core.$strip>>;
773
773
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -958,7 +958,7 @@ export declare const sceneMonitorCapability: {
958
958
  modelId: z.ZodString;
959
959
  condition: z.ZodString;
960
960
  capturedAt: z.ZodNumber;
961
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
961
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
962
962
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
963
963
  }, z.core.$strip>>;
964
964
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1057,7 +1057,7 @@ export declare const sceneMonitorCapability: {
1057
1057
  modelId: z.ZodString;
1058
1058
  condition: z.ZodString;
1059
1059
  capturedAt: z.ZodNumber;
1060
- thumbnailMediaId: z.ZodOptional<z.ZodString>;
1060
+ thumbnailMediaId: z.ZodOptional<z.ZodNumber>;
1061
1061
  anchorEmbedding: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
1062
1062
  }, z.core.$strip>>;
1063
1063
  textPrompts: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -195,6 +195,59 @@ export declare const settingsStoreCapability: {
195
195
  id: z.ZodString;
196
196
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
197
197
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
198
+ /**
199
+ * Make a SLOT hold this row — insert it, or update whatever already
200
+ * occupies the slot — and answer with the id the row HAS.
201
+ *
202
+ * ## Why the store needed this
203
+ *
204
+ * {@link set} is already an upsert, but its slot is the PRIMARY KEY: the
205
+ * caller has to know the id to address the row. That is exactly what a
206
+ * collection keyed by an `INTEGER` rowid alias cannot do — SQLite assigns
207
+ * the id, so a writer whose uniqueness rule is "one row per
208
+ * `(ownerKind, ownerId, kind, slot)`" has no id to name and no way to
209
+ * express the rule. {@link insert} can express it (a UNIQUE index
210
+ * arbitrates) but only by THROWING at the loser of a race, and the loser
211
+ * here is a legitimate re-capture, not an error.
212
+ *
213
+ * Getting there without this method means read-then-write: query the slot,
214
+ * then `insert` or `update`. Two statements instead of one, a race between
215
+ * them, and a recovery path that has to recognise a UNIQUE violation by its
216
+ * MESSAGE — across a process boundary, because the store lives behind an
217
+ * RPC door. A string match would be the whole gate, and a store that
218
+ * rephrased its error would lose the row silently. One statement has no
219
+ * such gate (D482).
220
+ *
221
+ * ## The contract
222
+ *
223
+ * `conflict` names the DECLARED columns that identify the slot. They must
224
+ * be covered by a UNIQUE index on the collection — SQLite resolves an
225
+ * `ON CONFLICT` target against its indexes and REFUSES the statement when
226
+ * none matches, so a wrong list is a loud error on the first write, never a
227
+ * silently duplicated row. An empty list is refused rather than passed on:
228
+ * `ON CONFLICT()` is not valid SQL, and the intent it would most likely
229
+ * encode ("no slot, just insert") is {@link insert}.
230
+ *
231
+ * Row shape is {@link insert}'s: `record.id` is used when the collection
232
+ * needs a supplied key and IGNORED when the primary key is an `INTEGER`
233
+ * rowid alias — exactly as `insert` and `insertMany` already treat it.
234
+ *
235
+ * Returns the id either way: the one SQLite assigned on an insert, or the
236
+ * one the row it updated already had. A caller cannot tell which happened,
237
+ * and deliberately — every caller wants the slot's id, and one that needed
238
+ * to distinguish creation from replacement would have to read first anyway.
239
+ */
240
+ readonly upsert: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
241
+ namespace: z.ZodOptional<z.ZodString>;
242
+ collection: z.ZodString;
243
+ conflict: z.ZodReadonly<z.ZodArray<z.ZodString>>;
244
+ record: z.ZodObject<{
245
+ id: z.ZodOptional<z.ZodString>;
246
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
247
+ }, z.core.$strip>;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
250
+ }, z.core.$strip>, "mutation">;
198
251
  /** Insert a new record. */
199
252
  readonly insert: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
200
253
  namespace: z.ZodOptional<z.ZodString>;
@@ -52,7 +52,7 @@ declare const StationaryObjectSchema: z.ZodObject<{
52
52
  becameStationaryAt: z.ZodNumber;
53
53
  lastConfirmedAt: z.ZodNumber;
54
54
  label: z.ZodOptional<z.ZodString>;
55
- keyFrameMediaKey: z.ZodOptional<z.ZodString>;
55
+ keyFrameMediaId: z.ZodOptional<z.ZodNumber>;
56
56
  }, z.core.$strip>;
57
57
  export type StationaryObject = z.infer<typeof StationaryObjectSchema>;
58
58
  export declare const CameraOccupancySnapshotSchema: z.ZodObject<{
@@ -89,7 +89,7 @@ export declare const CameraOccupancySnapshotSchema: z.ZodObject<{
89
89
  becameStationaryAt: z.ZodNumber;
90
90
  lastConfirmedAt: z.ZodNumber;
91
91
  label: z.ZodOptional<z.ZodString>;
92
- keyFrameMediaKey: z.ZodOptional<z.ZodString>;
92
+ keyFrameMediaId: z.ZodOptional<z.ZodNumber>;
93
93
  }, z.core.$strip>>>>;
94
94
  }, z.core.$strip>;
95
95
  export type CameraOccupancySnapshot = z.infer<typeof CameraOccupancySnapshotSchema>;
@@ -149,7 +149,7 @@ export declare const CameraOccupancySnapshotForDeviceSchema: z.ZodObject<{
149
149
  becameStationaryAt: z.ZodNumber;
150
150
  lastConfirmedAt: z.ZodNumber;
151
151
  label: z.ZodOptional<z.ZodString>;
152
- keyFrameMediaKey: z.ZodOptional<z.ZodString>;
152
+ keyFrameMediaId: z.ZodOptional<z.ZodNumber>;
153
153
  }, z.core.$strip>>>>;
154
154
  }, z.core.$strip>>;
155
155
  }, z.core.$strip>;
@@ -250,7 +250,7 @@ export declare const zoneAnalyticsCapability: {
250
250
  becameStationaryAt: z.ZodNumber;
251
251
  lastConfirmedAt: z.ZodNumber;
252
252
  label: z.ZodOptional<z.ZodString>;
253
- keyFrameMediaKey: z.ZodOptional<z.ZodString>;
253
+ keyFrameMediaId: z.ZodOptional<z.ZodNumber>;
254
254
  }, z.core.$strip>>>>;
255
255
  }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
256
256
  /**
@@ -308,7 +308,7 @@ export declare const zoneAnalyticsCapability: {
308
308
  becameStationaryAt: z.ZodNumber;
309
309
  lastConfirmedAt: z.ZodNumber;
310
310
  label: z.ZodOptional<z.ZodString>;
311
- keyFrameMediaKey: z.ZodOptional<z.ZodString>;
311
+ keyFrameMediaId: z.ZodOptional<z.ZodNumber>;
312
312
  }, z.core.$strip>>>>;
313
313
  }, z.core.$strip>>;
314
314
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
@@ -401,7 +401,7 @@ export declare const zoneAnalyticsCapability: {
401
401
  becameStationaryAt: z.ZodNumber;
402
402
  lastConfirmedAt: z.ZodNumber;
403
403
  label: z.ZodOptional<z.ZodString>;
404
- keyFrameMediaKey: z.ZodOptional<z.ZodString>;
404
+ keyFrameMediaId: z.ZodOptional<z.ZodNumber>;
405
405
  }, z.core.$strip>>>>;
406
406
  }, z.core.$strip>;
407
407
  /**
@@ -558,7 +558,7 @@ export declare enum EventCategory {
558
558
  * a package zone — a newly-appeared stationary object of a package class
559
559
  * that cleared the class / zone / dwell / size gates. Payload:
560
560
  * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
561
- * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
561
+ * entryId, className, zoneIds, keyFrameMediaId?, bbox, timestamp }`.
562
562
  * Telemetry (D8): the durable record is the `package-events` store row;
563
563
  * this bus topic drives notifier rules + live UI. See
564
564
  * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
package/dist/enums.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_category = require("./event-category-BNJ9EE5B.js");
2
+ const require_event_category = require("./event-category-yW4s1MGD.js");
3
3
  //#region src/enums/event-source-type.ts
4
4
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
5
5
  EventSourceType["Addon"] = "addon";
package/dist/enums.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-DAXzJeTX.mjs";
1
+ import { t as EventCategory } from "./event-category-ZyX6jcse.mjs";
2
2
  //#region src/enums/event-source-type.ts
3
3
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
4
4
  EventSourceType["Addon"] = "addon";
@@ -559,7 +559,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
559
559
  * a package zone — a newly-appeared stationary object of a package class
560
560
  * that cleared the class / zone / dwell / size gates. Payload:
561
561
  * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
562
- * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
562
+ * entryId, className, zoneIds, keyFrameMediaId?, bbox, timestamp }`.
563
563
  * Telemetry (D8): the durable record is the `package-events` store row;
564
564
  * this bus topic drives notifier rules + live UI. See
565
565
  * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
@@ -559,7 +559,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
559
559
  * a package zone — a newly-appeared stationary object of a package class
560
560
  * that cleared the class / zone / dwell / size gates. Payload:
561
561
  * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
562
- * entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
562
+ * entryId, className, zoneIds, keyFrameMediaId?, bbox, timestamp }`.
563
563
  * Telemetry (D8): the durable record is the `package-events` store row;
564
564
  * this bus topic drives notifier rules + live UI. See
565
565
  * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
@@ -1634,6 +1634,13 @@ export type AppRouter = TrpcCoreRouter<{
1634
1634
  output: z.infer<typeof dataStoreProviderCapability.methods.insert.output>;
1635
1635
  meta: object;
1636
1636
  }>;
1637
+ upsert: TRPCMutationProcedure<{
1638
+ input: {
1639
+ [x: string]: unknown;
1640
+ } & z.input<typeof dataStoreProviderCapability.methods.upsert.input>;
1641
+ output: z.infer<typeof dataStoreProviderCapability.methods.upsert.output>;
1642
+ meta: object;
1643
+ }>;
1637
1644
  insertMany: TRPCMutationProcedure<{
1638
1645
  input: {
1639
1646
  [x: string]: unknown;
@@ -7127,6 +7134,13 @@ export type AppRouter = TrpcCoreRouter<{
7127
7134
  output: z.infer<typeof settingsStoreCapability.methods.query.output>;
7128
7135
  meta: object;
7129
7136
  }>;
7137
+ upsert: TRPCMutationProcedure<{
7138
+ input: {
7139
+ [x: string]: unknown;
7140
+ } & z.input<typeof settingsStoreCapability.methods.upsert.input>;
7141
+ output: z.infer<typeof settingsStoreCapability.methods.upsert.output>;
7142
+ meta: object;
7143
+ }>;
7130
7144
  insert: TRPCMutationProcedure<{
7131
7145
  input: {
7132
7146
  [x: string]: unknown;
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 1029 method paths across 129 capabilities.
9
+ * Coverage: 1031 method paths across 129 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -90,7 +90,7 @@ export interface SystemProxy {
90
90
  readonly recording: Pick<InferProvider<typeof recordingCapability>, 'getAvailabilityBatch' | 'getDaysWithRecordingsBatch' | 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'getRelocateResidue' | 'reconcileLedgerAgainstDisk' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance' | 'getPlacement' | 'setDevicePlacement'>;
91
91
  readonly recordingExport: Pick<InferProvider<typeof recordingExportCapability>, 'createExport' | 'getExport' | 'cancelExport' | 'deleteExport' | 'getDownloadUrl' | 'readExportBytes'>;
92
92
  readonly serverManagement: Pick<InferProvider<typeof serverManagementCapability>, 'getServerPackageStatus' | 'checkServerUpdate' | 'applyServerUpdate' | 'rollbackServerUpdate' | 'restartServer'>;
93
- readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'insert' | 'insertMany' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;
93
+ readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'upsert' | 'insert' | 'insertMany' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;
94
94
  readonly storage: Pick<InferProvider<typeof storageCapability>, 'resolve' | 'write' | 'read' | 'exists' | 'list' | 'delete' | 'getAvailableSpace' | 'beginUpload' | 'writeChunk' | 'finalizeUpload' | 'abortUpload' | 'beginDownload' | 'readChunk' | 'endDownload' | 'listLocations' | 'listLocationDeclarations' | 'upsertLocation' | 'deleteLocation' | 'listDrainProgress' | 'testLocation' | 'listProviders' | 'testConfig'>;
95
95
  readonly storageMigration: Pick<InferProvider<typeof storageMigrationCapability>, 'plan' | 'start' | 'status' | 'cancel' | 'movers' | 'residue' | 'drain' | 'cleanupStart' | 'cleanupStatus' | 'cleanupCancel' | 'history'>;
96
96
  readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'fetchEventMedia' | 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'subscribeFrames' | 'pullFrameHandles' | 'unsubscribeFrames' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './audio/audio-chunk-format.js';
2
2
  export type { EventOwnerType, MediaOwnerKey, MediaOwnerKeyInput, MediaOwnerType, } from './media/media-owner-key.js';
3
- export { EVENT_OWNER_TYPES, MEDIA_OWNER_TYPES, formatMediaOwnerKey, isEventOwnerType, parseMediaOwnerKey, } from './media/media-owner-key.js';
3
+ export { EVENT_OWNER_TYPES, EventOwnerTypeSchema, MEDIA_OWNER_TYPES, formatMediaOwnerKey, isEventOwnerType, isMediaOwnerType, parseMediaOwnerKey, } from './media/media-owner-key.js';
4
4
  export type { CapabilitiesAccess } from './addon/base-addon.js';
5
5
  export { BaseAddon, normalizeAddonInitResult } from './addon/base-addon.js';
6
6
  export type { AddonRouteInvokeRequest, AddonRouteReplyEnvelope, } from './addon/build-addon-route-provider.js';