@camstack/types 1.2.359 → 1.2.361

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.
@@ -136,6 +136,18 @@ export declare const dataStoreProviderCapability: {
136
136
  }, z.core.$strip>, z.ZodObject<{
137
137
  id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
138
138
  }, z.core.$strip>, "mutation">;
139
+ /** Upsert many records in ONE transaction; see the door's `upsertMany`. */
140
+ readonly upsertMany: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
141
+ namespace: z.ZodOptional<z.ZodString>;
142
+ collection: z.ZodString;
143
+ conflict: z.ZodReadonly<z.ZodArray<z.ZodString>>;
144
+ records: z.ZodReadonly<z.ZodArray<z.ZodObject<{
145
+ id: z.ZodOptional<z.ZodString>;
146
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
147
+ }, z.core.$strip>>>;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ upserted: z.ZodNumber;
150
+ }, z.core.$strip>, "mutation">;
139
151
  /** Insert many records in ONE transaction. All or nothing. */
140
152
  readonly insertMany: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
141
153
  namespace: z.ZodOptional<z.ZodString>;
@@ -178,6 +190,14 @@ export declare const dataStoreProviderCapability: {
178
190
  collection: z.ZodString;
179
191
  id: z.ZodString;
180
192
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
193
+ }, z.core.$strip>, z.ZodObject<{
194
+ op: z.ZodLiteral<"upsertMany">;
195
+ collection: z.ZodString;
196
+ conflict: z.ZodReadonly<z.ZodArray<z.ZodString>>;
197
+ records: z.ZodReadonly<z.ZodArray<z.ZodObject<{
198
+ id: z.ZodOptional<z.ZodString>;
199
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
200
+ }, z.core.$strip>>>;
181
201
  }, z.core.$strip>], "op">>>;
182
202
  }, z.core.$strip>, z.ZodObject<{
183
203
  applied: z.ZodBoolean;
@@ -336,6 +356,13 @@ export declare const dataStoreProviderCapability: {
336
356
  columns: z.ZodReadonly<z.ZodArray<z.ZodString>>;
337
357
  unique: z.ZodOptional<z.ZodBoolean>;
338
358
  }, z.core.$strip>>>>;
359
+ database: z.ZodOptional<z.ZodEnum<{
360
+ events: "events";
361
+ history: "history";
362
+ settings: "settings";
363
+ }>>;
364
+ primaryKey: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
365
+ withoutRowid: z.ZodOptional<z.ZodBoolean>;
339
366
  }, z.core.$strip>, z.ZodVoid, "mutation">;
340
367
  };
341
368
  };
@@ -106,7 +106,7 @@ export type { AudioStreamPick, CameraStream, CamProfile, CamStreamKind, DecodedA
106
106
  export { AudioChunkFormatSchema, AudioStreamPickSchema, BrokerStatsSchema, BrokerStatusSchema, CAM_PROFILE_ORDER, CameraStreamSchema, CamProfileSchema, CamStreamKindSchema, CamStreamResolutionSchema, DecodedAudioChunkSchema, FrameHandleSchema, makeProfileBrokerId, makeSourceBrokerId, ProfileRtspEntrySchema, ProfileSlotSchema, ProfileSlotStatusSchema, parseProfileBrokerId, StreamSourceEntrySchema, StreamSourceSchema, SubscribeAudioChunksInputSchema, SubscribeAudioChunksResultSchema, selectAssignedProfileSlots, } from './schemas/streaming-shared.js';
107
107
  export { buildEventKindDescriptor, EVENT_KIND_BY_CAP, EVENTFUL_CAP_NAMES, type SensorEventKindDescriptor, } from './sensor-event-kinds.js';
108
108
  export { type ImageContract, ImageContractSchema, type ImageContractState, ImageContractStateSchema, type IServerManagementProvider, type ServerBootMode, ServerBootModeSchema, type ServerPackageStatus, ServerPackageStatusSchema, type ServerRollbackInfo, ServerRollbackInfoSchema, type ServerUpdateActionResult, ServerUpdateActionResultSchema, type ServerUpdateCheckResult, ServerUpdateCheckResultSchema, type ServerUpdateOutcome, ServerUpdateOutcomeSchema, type ServerUpdateState, ServerUpdateStateSchema, serverManagementCapability, type WrapperEvidence, WrapperEvidenceSchema, type WrapperIdentity, WrapperIdentitySchema, type WrapperKind, WrapperKindSchema, } from './server-management.cap.js';
109
- export { type BulkRecord, BulkRecordSchema, type CollectionColumn, CollectionColumnSchema, type CollectionIndex, CollectionIndexSchema, type ISettingsStoreProvider, type MutationFilter, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, type SettingsStoreClient, settingsStoreCapability, } from './settings-store.cap.js';
109
+ export { type BulkRecord, BulkRecordSchema, type CollectionColumn, CollectionColumnSchema, type CollectionIndex, CollectionIndexSchema, DATA_STORE_DATABASES, type DataStoreDatabase, DataStoreDatabaseSchema, type DeclareCollectionInput, DeclareCollectionInputSchema, type ISettingsStoreProvider, type MutationFilter, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, type SettingsStoreClient, settingsStoreCapability, } from './settings-store.cap.js';
110
110
  export type { ISmtpProvider } from './smtp-provider.cap.js';
111
111
  export { SendEmailInputSchema, SendEmailResultSchema, SmtpStatusSchema, smtpProviderCapability, } from './smtp-provider.cap.js';
112
112
  export { type ISnapshotOrchestrator, SnapshotImageSchema, snapshotCapability, } from './snapshot.cap.js';
@@ -1070,6 +1070,15 @@ export declare const RetrainBoxReviewSchema: z.ZodObject<{
1070
1070
  score: z.ZodOptional<z.ZodNumber>;
1071
1071
  modelId: z.ZodOptional<z.ZodString>;
1072
1072
  }, z.core.$strip>>;
1073
+ macroClass: z.ZodOptional<z.ZodEnum<{
1074
+ animal: "animal";
1075
+ face: "face";
1076
+ package: "package";
1077
+ person: "person";
1078
+ plate: "plate";
1079
+ vehicle: "vehicle";
1080
+ }>>;
1081
+ label: z.ZodOptional<z.ZodString>;
1073
1082
  iou: z.ZodOptional<z.ZodNumber>;
1074
1083
  }, z.core.$strip>;
1075
1084
  export type RetrainBoxReview = z.infer<typeof RetrainBoxReviewSchema>;
@@ -1112,6 +1121,15 @@ export declare const RetrainFrameReviewSchema: z.ZodObject<{
1112
1121
  score: z.ZodOptional<z.ZodNumber>;
1113
1122
  modelId: z.ZodOptional<z.ZodString>;
1114
1123
  }, z.core.$strip>>;
1124
+ macroClass: z.ZodOptional<z.ZodEnum<{
1125
+ animal: "animal";
1126
+ face: "face";
1127
+ package: "package";
1128
+ person: "person";
1129
+ plate: "plate";
1130
+ vehicle: "vehicle";
1131
+ }>>;
1132
+ label: z.ZodOptional<z.ZodString>;
1115
1133
  iou: z.ZodOptional<z.ZodNumber>;
1116
1134
  }, z.core.$strip>>>;
1117
1135
  summary: z.ZodObject<{
@@ -1471,6 +1489,15 @@ export declare const RetrainFrameSchema: z.ZodObject<{
1471
1489
  score: z.ZodOptional<z.ZodNumber>;
1472
1490
  modelId: z.ZodOptional<z.ZodString>;
1473
1491
  }, z.core.$strip>>;
1492
+ macroClass: z.ZodOptional<z.ZodEnum<{
1493
+ animal: "animal";
1494
+ face: "face";
1495
+ package: "package";
1496
+ person: "person";
1497
+ plate: "plate";
1498
+ vehicle: "vehicle";
1499
+ }>>;
1500
+ label: z.ZodOptional<z.ZodString>;
1474
1501
  iou: z.ZodOptional<z.ZodNumber>;
1475
1502
  }, z.core.$strip>>>;
1476
1503
  summary: z.ZodObject<{
@@ -1628,6 +1655,15 @@ export declare const RetrainFrameSelectionSchema: z.ZodObject<{
1628
1655
  score: z.ZodOptional<z.ZodNumber>;
1629
1656
  modelId: z.ZodOptional<z.ZodString>;
1630
1657
  }, z.core.$strip>>;
1658
+ macroClass: z.ZodOptional<z.ZodEnum<{
1659
+ animal: "animal";
1660
+ face: "face";
1661
+ package: "package";
1662
+ person: "person";
1663
+ plate: "plate";
1664
+ vehicle: "vehicle";
1665
+ }>>;
1666
+ label: z.ZodOptional<z.ZodString>;
1631
1667
  iou: z.ZodOptional<z.ZodNumber>;
1632
1668
  }, z.core.$strip>>>;
1633
1669
  summary: z.ZodObject<{
@@ -1812,6 +1848,15 @@ export declare const RetrainFrameListSchema: z.ZodObject<{
1812
1848
  score: z.ZodOptional<z.ZodNumber>;
1813
1849
  modelId: z.ZodOptional<z.ZodString>;
1814
1850
  }, z.core.$strip>>;
1851
+ macroClass: z.ZodOptional<z.ZodEnum<{
1852
+ animal: "animal";
1853
+ face: "face";
1854
+ package: "package";
1855
+ person: "person";
1856
+ plate: "plate";
1857
+ vehicle: "vehicle";
1858
+ }>>;
1859
+ label: z.ZodOptional<z.ZodString>;
1815
1860
  iou: z.ZodOptional<z.ZodNumber>;
1816
1861
  }, z.core.$strip>>>;
1817
1862
  summary: z.ZodObject<{
@@ -2000,6 +2045,15 @@ export declare const RetrainCorpusPageFrameSchema: z.ZodObject<{
2000
2045
  score: z.ZodOptional<z.ZodNumber>;
2001
2046
  modelId: z.ZodOptional<z.ZodString>;
2002
2047
  }, z.core.$strip>>;
2048
+ macroClass: z.ZodOptional<z.ZodEnum<{
2049
+ animal: "animal";
2050
+ face: "face";
2051
+ package: "package";
2052
+ person: "person";
2053
+ plate: "plate";
2054
+ vehicle: "vehicle";
2055
+ }>>;
2056
+ label: z.ZodOptional<z.ZodString>;
2003
2057
  iou: z.ZodOptional<z.ZodNumber>;
2004
2058
  }, z.core.$strip>>>;
2005
2059
  summary: z.ZodObject<{
@@ -2156,6 +2210,15 @@ export declare const RetrainCorpusPageSchema: z.ZodObject<{
2156
2210
  score: z.ZodOptional<z.ZodNumber>;
2157
2211
  modelId: z.ZodOptional<z.ZodString>;
2158
2212
  }, z.core.$strip>>;
2213
+ macroClass: z.ZodOptional<z.ZodEnum<{
2214
+ animal: "animal";
2215
+ face: "face";
2216
+ package: "package";
2217
+ person: "person";
2218
+ plate: "plate";
2219
+ vehicle: "vehicle";
2220
+ }>>;
2221
+ label: z.ZodOptional<z.ZodString>;
2159
2222
  iou: z.ZodOptional<z.ZodNumber>;
2160
2223
  }, z.core.$strip>>>;
2161
2224
  summary: z.ZodObject<{
@@ -2540,6 +2603,15 @@ export declare const AddRetrainFrameFromRecordingResultSchema: z.ZodDiscriminate
2540
2603
  score: z.ZodOptional<z.ZodNumber>;
2541
2604
  modelId: z.ZodOptional<z.ZodString>;
2542
2605
  }, z.core.$strip>>;
2606
+ macroClass: z.ZodOptional<z.ZodEnum<{
2607
+ animal: "animal";
2608
+ face: "face";
2609
+ package: "package";
2610
+ person: "person";
2611
+ plate: "plate";
2612
+ vehicle: "vehicle";
2613
+ }>>;
2614
+ label: z.ZodOptional<z.ZodString>;
2543
2615
  iou: z.ZodOptional<z.ZodNumber>;
2544
2616
  }, z.core.$strip>>>;
2545
2617
  summary: z.ZodObject<{
@@ -5452,6 +5524,15 @@ export declare const pipelineAnalyticsCapability: {
5452
5524
  score: z.ZodOptional<z.ZodNumber>;
5453
5525
  modelId: z.ZodOptional<z.ZodString>;
5454
5526
  }, z.core.$strip>>;
5527
+ macroClass: z.ZodOptional<z.ZodEnum<{
5528
+ animal: "animal";
5529
+ face: "face";
5530
+ package: "package";
5531
+ person: "person";
5532
+ plate: "plate";
5533
+ vehicle: "vehicle";
5534
+ }>>;
5535
+ label: z.ZodOptional<z.ZodString>;
5455
5536
  iou: z.ZodOptional<z.ZodNumber>;
5456
5537
  }, z.core.$strip>>>;
5457
5538
  summary: z.ZodObject<{
@@ -5666,6 +5747,15 @@ export declare const pipelineAnalyticsCapability: {
5666
5747
  score: z.ZodOptional<z.ZodNumber>;
5667
5748
  modelId: z.ZodOptional<z.ZodString>;
5668
5749
  }, z.core.$strip>>;
5750
+ macroClass: z.ZodOptional<z.ZodEnum<{
5751
+ animal: "animal";
5752
+ face: "face";
5753
+ package: "package";
5754
+ person: "person";
5755
+ plate: "plate";
5756
+ vehicle: "vehicle";
5757
+ }>>;
5758
+ label: z.ZodOptional<z.ZodString>;
5669
5759
  iou: z.ZodOptional<z.ZodNumber>;
5670
5760
  }, z.core.$strip>>>;
5671
5761
  summary: z.ZodObject<{
@@ -5836,6 +5926,15 @@ export declare const pipelineAnalyticsCapability: {
5836
5926
  score: z.ZodOptional<z.ZodNumber>;
5837
5927
  modelId: z.ZodOptional<z.ZodString>;
5838
5928
  }, z.core.$strip>>;
5929
+ macroClass: z.ZodOptional<z.ZodEnum<{
5930
+ animal: "animal";
5931
+ face: "face";
5932
+ package: "package";
5933
+ person: "person";
5934
+ plate: "plate";
5935
+ vehicle: "vehicle";
5936
+ }>>;
5937
+ label: z.ZodOptional<z.ZodString>;
5839
5938
  iou: z.ZodOptional<z.ZodNumber>;
5840
5939
  }, z.core.$strip>>>;
5841
5940
  summary: z.ZodObject<{
@@ -6520,6 +6619,15 @@ export declare const pipelineAnalyticsCapability: {
6520
6619
  score: z.ZodOptional<z.ZodNumber>;
6521
6620
  modelId: z.ZodOptional<z.ZodString>;
6522
6621
  }, z.core.$strip>>;
6622
+ macroClass: z.ZodOptional<z.ZodEnum<{
6623
+ animal: "animal";
6624
+ face: "face";
6625
+ package: "package";
6626
+ person: "person";
6627
+ plate: "plate";
6628
+ vehicle: "vehicle";
6629
+ }>>;
6630
+ label: z.ZodOptional<z.ZodString>;
6523
6631
  iou: z.ZodOptional<z.ZodNumber>;
6524
6632
  }, z.core.$strip>>>;
6525
6633
  summary: z.ZodObject<{
@@ -7033,6 +7141,15 @@ export declare const pipelineAnalyticsCapability: {
7033
7141
  score: z.ZodOptional<z.ZodNumber>;
7034
7142
  modelId: z.ZodOptional<z.ZodString>;
7035
7143
  }, z.core.$strip>>;
7144
+ macroClass: z.ZodOptional<z.ZodEnum<{
7145
+ animal: "animal";
7146
+ face: "face";
7147
+ package: "package";
7148
+ person: "person";
7149
+ plate: "plate";
7150
+ vehicle: "vehicle";
7151
+ }>>;
7152
+ label: z.ZodOptional<z.ZodString>;
7036
7153
  iou: z.ZodOptional<z.ZodNumber>;
7037
7154
  }, z.core.$strip>>>;
7038
7155
  summary: z.ZodObject<{
@@ -7215,6 +7332,15 @@ export declare const pipelineAnalyticsCapability: {
7215
7332
  score: z.ZodOptional<z.ZodNumber>;
7216
7333
  modelId: z.ZodOptional<z.ZodString>;
7217
7334
  }, z.core.$strip>>;
7335
+ macroClass: z.ZodOptional<z.ZodEnum<{
7336
+ animal: "animal";
7337
+ face: "face";
7338
+ package: "package";
7339
+ person: "person";
7340
+ plate: "plate";
7341
+ vehicle: "vehicle";
7342
+ }>>;
7343
+ label: z.ZodOptional<z.ZodString>;
7218
7344
  iou: z.ZodOptional<z.ZodNumber>;
7219
7345
  }, z.core.$strip>>>;
7220
7346
  summary: z.ZodObject<{
@@ -80,9 +80,24 @@ declare const BulkRecordSchema: z.ZodObject<{
80
80
  id: z.ZodOptional<z.ZodString>;
81
81
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
82
82
  }, z.core.$strip>;
83
+ /**
84
+ * The database FILES one `sqlite-settings` engine process owns (D851).
85
+ * Closed on purpose: a file is a thing the engine opens, backs up and gives a
86
+ * serving thread, so a new one is a code change, never a string a caller
87
+ * invents. `settings` is `camstack.db` and the default for every collection
88
+ * that names no file.
89
+ */
90
+ declare const DataStoreDatabaseSchema: z.ZodEnum<{
91
+ events: "events";
92
+ history: "history";
93
+ settings: "settings";
94
+ }>;
95
+ /** Every database file, in a stable order (settings first). */
96
+ declare const DATA_STORE_DATABASES: readonly z.infer<typeof DataStoreDatabaseSchema>[];
83
97
  /**
84
98
  * One write inside a {@link settingsStoreCapability.methods.transact} call.
85
- * Only the three that a "replace this set, bump that revision" write needs.
99
+ * The three that a "replace this set, bump that revision" write needs, plus
100
+ * the batched upsert a rollup writer needs.
86
101
  */
87
102
  declare const TransactOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
88
103
  op: z.ZodLiteral<"deleteWhere">;
@@ -106,6 +121,14 @@ declare const TransactOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
121
  collection: z.ZodString;
107
122
  id: z.ZodString;
108
123
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ op: z.ZodLiteral<"upsertMany">;
126
+ collection: z.ZodString;
127
+ conflict: z.ZodReadonly<z.ZodArray<z.ZodString>>;
128
+ records: z.ZodReadonly<z.ZodArray<z.ZodObject<{
129
+ id: z.ZodOptional<z.ZodString>;
130
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
131
+ }, z.core.$strip>>>;
109
132
  }, z.core.$strip>], "op">;
110
133
  /**
111
134
  * The precondition of a transaction: the row `key` of `collection` must hold
@@ -145,6 +168,51 @@ declare const CollectionIndexSchema: z.ZodObject<{
145
168
  columns: z.ZodReadonly<z.ZodArray<z.ZodString>>;
146
169
  unique: z.ZodOptional<z.ZodBoolean>;
147
170
  }, z.core.$strip>;
171
+ /**
172
+ * The input of `declareCollection` — ONE schema for the door and for the
173
+ * engine behind it, so the two surfaces cannot drift (the dispatcher forwards
174
+ * the payload untouched).
175
+ *
176
+ * - `database` — the file the collection lives in (D851). Absent means
177
+ * `settings`. A declaration naming a file other than the one the table is
178
+ * already in is REFUSED by the engine, never moved.
179
+ * - `primaryKey` — a COMPOSITE key, as column names. A single name is the same
180
+ * as `primaryKey: true` on that column. A composite-keyed collection has no
181
+ * `id`: it is written with `insertMany` / `upsertMany` / `transact` and read
182
+ * with `query` / `count` / `aggregate` / `deleteWhere`; the calls that
183
+ * address one row by id are refused.
184
+ * - `withoutRowid` — emit `WITHOUT ROWID`. Requires a primary key.
185
+ */
186
+ declare const DeclareCollectionInputSchema: z.ZodObject<{
187
+ namespace: z.ZodOptional<z.ZodString>;
188
+ collection: z.ZodString;
189
+ columns: z.ZodReadonly<z.ZodArray<z.ZodObject<{
190
+ name: z.ZodString;
191
+ type: z.ZodEnum<{
192
+ BOOLEAN: "BOOLEAN";
193
+ INTEGER: "INTEGER";
194
+ JSON: "JSON";
195
+ REAL: "REAL";
196
+ TEXT: "TEXT";
197
+ }>;
198
+ primaryKey: z.ZodOptional<z.ZodBoolean>;
199
+ notNull: z.ZodOptional<z.ZodBoolean>;
200
+ unique: z.ZodOptional<z.ZodBoolean>;
201
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
202
+ }, z.core.$strip>>>;
203
+ indexes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
204
+ name: z.ZodString;
205
+ columns: z.ZodReadonly<z.ZodArray<z.ZodString>>;
206
+ unique: z.ZodOptional<z.ZodBoolean>;
207
+ }, z.core.$strip>>>>;
208
+ database: z.ZodOptional<z.ZodEnum<{
209
+ events: "events";
210
+ history: "history";
211
+ settings: "settings";
212
+ }>>;
213
+ primaryKey: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
214
+ withoutRowid: z.ZodOptional<z.ZodBoolean>;
215
+ }, z.core.$strip>;
148
216
  /**
149
217
  * settings-store — singleton capability for addon-scoped persistence.
150
218
  *
@@ -295,6 +363,31 @@ export declare const settingsStoreCapability: {
295
363
  }, z.core.$strip>, z.ZodObject<{
296
364
  id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
297
365
  }, z.core.$strip>, "mutation">;
366
+ /**
367
+ * {@link upsert} for a BATCH, in ONE transaction on ONE prepared statement.
368
+ *
369
+ * The write-side twin of {@link insertMany} for rows that may already
370
+ * exist: a rollup writer recomputes a bucket and must overwrite it, and
371
+ * N round trips with N COMMITs is the cost {@link insertMany} was added to
372
+ * avoid. `conflict` has the meaning it has on {@link upsert} (declared
373
+ * columns covered by a UNIQUE index or the primary key, never empty).
374
+ *
375
+ * Every record of a batch must carry the SAME set of declared columns and
376
+ * every `conflict` column: one batch is one statement shape, and a record
377
+ * that silently bound NULL over a column it did not mention would erase
378
+ * it. A heterogeneous batch is refused whole. **All or nothing.**
379
+ */
380
+ readonly upsertMany: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
381
+ namespace: z.ZodOptional<z.ZodString>;
382
+ collection: z.ZodString;
383
+ conflict: z.ZodReadonly<z.ZodArray<z.ZodString>>;
384
+ records: z.ZodReadonly<z.ZodArray<z.ZodObject<{
385
+ id: z.ZodOptional<z.ZodString>;
386
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
387
+ }, z.core.$strip>>>;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ upserted: z.ZodNumber;
390
+ }, z.core.$strip>, "mutation">;
298
391
  /** Insert a new record. */
299
392
  readonly insert: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
300
393
  namespace: z.ZodOptional<z.ZodString>;
@@ -388,6 +481,14 @@ export declare const settingsStoreCapability: {
388
481
  collection: z.ZodString;
389
482
  id: z.ZodString;
390
483
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
484
+ }, z.core.$strip>, z.ZodObject<{
485
+ op: z.ZodLiteral<"upsertMany">;
486
+ collection: z.ZodString;
487
+ conflict: z.ZodReadonly<z.ZodArray<z.ZodString>>;
488
+ records: z.ZodReadonly<z.ZodArray<z.ZodObject<{
489
+ id: z.ZodOptional<z.ZodString>;
490
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
491
+ }, z.core.$strip>>>;
391
492
  }, z.core.$strip>], "op">>>;
392
493
  }, z.core.$strip>, z.ZodObject<{
393
494
  applied: z.ZodBoolean;
@@ -594,6 +695,13 @@ export declare const settingsStoreCapability: {
594
695
  columns: z.ZodReadonly<z.ZodArray<z.ZodString>>;
595
696
  unique: z.ZodOptional<z.ZodBoolean>;
596
697
  }, z.core.$strip>>>>;
698
+ database: z.ZodOptional<z.ZodEnum<{
699
+ events: "events";
700
+ history: "history";
701
+ settings: "settings";
702
+ }>>;
703
+ primaryKey: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
704
+ withoutRowid: z.ZodOptional<z.ZodBoolean>;
597
705
  }, z.core.$strip>, z.ZodVoid, "mutation">;
598
706
  };
599
707
  };
@@ -604,10 +712,12 @@ export type ISettingsStoreProvider = InferProvider<typeof settingsStoreCapabilit
604
712
  * Methods are accessed as `client.get.query(input)`, `client.set.mutate(input)`, etc.
605
713
  */
606
714
  export type SettingsStoreClient = import('../generated/addon-api.js').AddonApi['settingsStore'];
607
- export { AggregateFieldSchema, AggregateResultSchema, BulkRecordSchema, CollectionColumnSchema, CollectionIndexSchema, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, TransactGuardSchema, TransactOpSchema, };
715
+ export { AggregateFieldSchema, DATA_STORE_DATABASES, DataStoreDatabaseSchema, DeclareCollectionInputSchema, AggregateResultSchema, BulkRecordSchema, CollectionColumnSchema, CollectionIndexSchema, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, TransactGuardSchema, TransactOpSchema, };
608
716
  export type BulkRecord = z.infer<typeof BulkRecordSchema>;
609
717
  export type AggregateField = z.infer<typeof AggregateFieldSchema>;
610
718
  export type AggregateResult = z.infer<typeof AggregateResultSchema>;
611
719
  export type MutationFilter = z.infer<typeof MutationFilterSchema>;
612
720
  export type CollectionColumn = z.infer<typeof CollectionColumnSchema>;
613
721
  export type CollectionIndex = z.infer<typeof CollectionIndexSchema>;
722
+ export type DataStoreDatabase = z.infer<typeof DataStoreDatabaseSchema>;
723
+ export type DeclareCollectionInput = z.infer<typeof DeclareCollectionInputSchema>;
package/dist/client.js CHANGED
@@ -124,6 +124,7 @@ var RETRAIN_REVIEW_MATCH_IOU = .5;
124
124
  var RETRAIN_REVIEW_ADJUSTED_IOU = .95;
125
125
  /** Two boxes this close on every edge are the same rectangle (an exact match). */
126
126
  var EXACT_EDGE_EPSILON = 1e-6;
127
+ var optLabel = (label) => label !== void 0 ? { label } : {};
127
128
  /** Intersection over union of two normalised rectangles. */
128
129
  function retrainBoxIou(a, b) {
129
130
  const inter = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
@@ -133,13 +134,13 @@ function retrainBoxIou(a, b) {
133
134
  function sameRect(a, b) {
134
135
  return Math.abs(a.x - b.x) <= EXACT_EDGE_EPSILON && Math.abs(a.y - b.y) <= EXACT_EDGE_EPSILON && Math.abs(a.w - b.w) <= EXACT_EDGE_EPSILON && Math.abs(a.h - b.h) <= EXACT_EDGE_EPSILON;
135
136
  }
136
- function labelOf(value) {
137
+ function labelField(value) {
137
138
  return value?.trim() ?? "";
138
139
  }
139
140
  /** Kept box versus its baseline: class/label first, then geometry. */
140
141
  function compareKept(saved, baseline, adjustedIou) {
141
142
  const iou = retrainBoxIou(saved.bbox, baseline.bbox);
142
- if (saved.macroClass !== baseline.macroClass || labelOf(saved.label) !== labelOf(baseline.label)) return {
143
+ if (saved.macroClass !== baseline.macroClass || labelField(saved.label) !== labelField(baseline.label)) return {
143
144
  status: "reclassified",
144
145
  iou
145
146
  };
@@ -214,6 +215,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
214
215
  savedId: box.id,
215
216
  status: "model-error",
216
217
  approximate: false,
218
+ macroClass: box.macroClass,
219
+ ...optLabel(box.label),
217
220
  ...baseline !== null ? {
218
221
  origin: baseline,
219
222
  iou: retrainBoxIou(box.bbox, baseline.bbox)
@@ -227,6 +230,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
227
230
  savedId: box.id,
228
231
  status: "added",
229
232
  approximate: approximate && baseline === null,
233
+ macroClass: box.macroClass,
234
+ ...optLabel(box.label),
230
235
  ...baseline !== null ? { origin: baseline } : {}
231
236
  });
232
237
  return;
@@ -237,6 +242,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
237
242
  savedId: box.id,
238
243
  status: verdict.status,
239
244
  approximate,
245
+ macroClass: box.macroClass,
246
+ ...optLabel(box.label),
240
247
  origin: baseline,
241
248
  iou: verdict.iou
242
249
  });
@@ -245,6 +252,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
245
252
  ref: entry.ref,
246
253
  status: "removed",
247
254
  approximate: false,
255
+ macroClass: entry.snapshot.macroClass,
256
+ ...optLabel(entry.snapshot.label),
248
257
  origin: entry.snapshot
249
258
  });
250
259
  if (opts.inferRemoved === true) for (const origin of origins) {
@@ -253,6 +262,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
253
262
  ref: origin.ref,
254
263
  status: "removed",
255
264
  approximate: true,
265
+ macroClass: origin.macroClass,
266
+ ...optLabel(origin.label),
256
267
  origin
257
268
  });
258
269
  }
@@ -7772,6 +7783,7 @@ function createSystemProxy(api) {
7772
7783
  set: (input) => dispatch("settingsStore", "set", "mutation", input),
7773
7784
  query: (input) => dispatch("settingsStore", "query", "query", input),
7774
7785
  upsert: (input) => dispatch("settingsStore", "upsert", "mutation", input),
7786
+ upsertMany: (input) => dispatch("settingsStore", "upsertMany", "mutation", input),
7775
7787
  insert: (input) => dispatch("settingsStore", "insert", "mutation", input),
7776
7788
  insertMany: (input) => dispatch("settingsStore", "insertMany", "mutation", input),
7777
7789
  transact: (input) => dispatch("settingsStore", "transact", "mutation", input),
package/dist/client.mjs CHANGED
@@ -123,6 +123,7 @@ var RETRAIN_REVIEW_MATCH_IOU = .5;
123
123
  var RETRAIN_REVIEW_ADJUSTED_IOU = .95;
124
124
  /** Two boxes this close on every edge are the same rectangle (an exact match). */
125
125
  var EXACT_EDGE_EPSILON = 1e-6;
126
+ var optLabel = (label) => label !== void 0 ? { label } : {};
126
127
  /** Intersection over union of two normalised rectangles. */
127
128
  function retrainBoxIou(a, b) {
128
129
  const inter = Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));
@@ -132,13 +133,13 @@ function retrainBoxIou(a, b) {
132
133
  function sameRect(a, b) {
133
134
  return Math.abs(a.x - b.x) <= EXACT_EDGE_EPSILON && Math.abs(a.y - b.y) <= EXACT_EDGE_EPSILON && Math.abs(a.w - b.w) <= EXACT_EDGE_EPSILON && Math.abs(a.h - b.h) <= EXACT_EDGE_EPSILON;
134
135
  }
135
- function labelOf(value) {
136
+ function labelField(value) {
136
137
  return value?.trim() ?? "";
137
138
  }
138
139
  /** Kept box versus its baseline: class/label first, then geometry. */
139
140
  function compareKept(saved, baseline, adjustedIou) {
140
141
  const iou = retrainBoxIou(saved.bbox, baseline.bbox);
141
- if (saved.macroClass !== baseline.macroClass || labelOf(saved.label) !== labelOf(baseline.label)) return {
142
+ if (saved.macroClass !== baseline.macroClass || labelField(saved.label) !== labelField(baseline.label)) return {
142
143
  status: "reclassified",
143
144
  iou
144
145
  };
@@ -213,6 +214,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
213
214
  savedId: box.id,
214
215
  status: "model-error",
215
216
  approximate: false,
217
+ macroClass: box.macroClass,
218
+ ...optLabel(box.label),
216
219
  ...baseline !== null ? {
217
220
  origin: baseline,
218
221
  iou: retrainBoxIou(box.bbox, baseline.bbox)
@@ -226,6 +229,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
226
229
  savedId: box.id,
227
230
  status: "added",
228
231
  approximate: approximate && baseline === null,
232
+ macroClass: box.macroClass,
233
+ ...optLabel(box.label),
229
234
  ...baseline !== null ? { origin: baseline } : {}
230
235
  });
231
236
  return;
@@ -236,6 +241,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
236
241
  savedId: box.id,
237
242
  status: verdict.status,
238
243
  approximate,
244
+ macroClass: box.macroClass,
245
+ ...optLabel(box.label),
239
246
  origin: baseline,
240
247
  iou: verdict.iou
241
248
  });
@@ -244,6 +251,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
244
251
  ref: entry.ref,
245
252
  status: "removed",
246
253
  approximate: false,
254
+ macroClass: entry.snapshot.macroClass,
255
+ ...optLabel(entry.snapshot.label),
247
256
  origin: entry.snapshot
248
257
  });
249
258
  if (opts.inferRemoved === true) for (const origin of origins) {
@@ -252,6 +261,8 @@ function classifyRetrainReview(saved, origins, dismissed, opts = {}) {
252
261
  ref: origin.ref,
253
262
  status: "removed",
254
263
  approximate: true,
264
+ macroClass: origin.macroClass,
265
+ ...optLabel(origin.label),
255
266
  origin
256
267
  });
257
268
  }
@@ -7771,6 +7782,7 @@ function createSystemProxy(api) {
7771
7782
  set: (input) => dispatch("settingsStore", "set", "mutation", input),
7772
7783
  query: (input) => dispatch("settingsStore", "query", "query", input),
7773
7784
  upsert: (input) => dispatch("settingsStore", "upsert", "mutation", input),
7785
+ upsertMany: (input) => dispatch("settingsStore", "upsertMany", "mutation", input),
7774
7786
  insert: (input) => dispatch("settingsStore", "insert", "mutation", input),
7775
7787
  insertMany: (input) => dispatch("settingsStore", "insertMany", "mutation", input),
7776
7788
  transact: (input) => dispatch("settingsStore", "transact", "mutation", input),
@@ -1878,6 +1878,13 @@ export type AppRouter = TrpcCoreRouter<{
1878
1878
  output: z.infer<typeof dataStoreProviderCapability.methods.upsert.output>;
1879
1879
  meta: object;
1880
1880
  }>;
1881
+ upsertMany: TRPCMutationProcedure<{
1882
+ input: {
1883
+ [x: string]: unknown;
1884
+ } & z.input<typeof dataStoreProviderCapability.methods.upsertMany.input>;
1885
+ output: z.infer<typeof dataStoreProviderCapability.methods.upsertMany.output>;
1886
+ meta: object;
1887
+ }>;
1881
1888
  insertMany: TRPCMutationProcedure<{
1882
1889
  input: {
1883
1890
  [x: string]: unknown;
@@ -8153,6 +8160,13 @@ export type AppRouter = TrpcCoreRouter<{
8153
8160
  output: z.infer<typeof settingsStoreCapability.methods.upsert.output>;
8154
8161
  meta: object;
8155
8162
  }>;
8163
+ upsertMany: TRPCMutationProcedure<{
8164
+ input: {
8165
+ [x: string]: unknown;
8166
+ } & z.input<typeof settingsStoreCapability.methods.upsertMany.input>;
8167
+ output: z.infer<typeof settingsStoreCapability.methods.upsertMany.output>;
8168
+ meta: object;
8169
+ }>;
8156
8170
  insert: TRPCMutationProcedure<{
8157
8171
  input: {
8158
8172
  [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: 1303 method paths across 170 capabilities.
9
+ * Coverage: 1305 method paths across 170 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -99,7 +99,7 @@ export interface SystemProxy {
99
99
  readonly recordingArchive: Pick<InferProvider<typeof recordingArchiveCapability>, 'getAvailabilityBatch' | 'getDaysWithRecordingsBatch' | 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'getRelocateResidue' | 'reconcileLedgerAgainstDisk' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance' | 'getPlacement' | 'setDevicePlacement'>;
100
100
  readonly recordingExport: Pick<InferProvider<typeof recordingExportCapability>, 'createExport' | 'getExport' | 'cancelExport' | 'deleteExport' | 'getDownloadUrl' | 'readExportBytes'>;
101
101
  readonly serverManagement: Pick<InferProvider<typeof serverManagementCapability>, 'getServerPackageStatus' | 'checkServerUpdate' | 'applyServerUpdate' | 'rollbackServerUpdate' | 'restartServer'>;
102
- readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'upsert' | 'insert' | 'insertMany' | 'transact' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;
102
+ readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'upsert' | 'upsertMany' | 'insert' | 'insertMany' | 'transact' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;
103
103
  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'>;
104
104
  readonly storageMigration: Pick<InferProvider<typeof storageMigrationCapability>, 'plan' | 'start' | 'status' | 'cancel' | 'movers' | 'residue' | 'drain' | 'cleanupStart' | 'cleanupStatus' | 'cleanupCancel' | 'history'>;
105
105
  readonly streamBroker: Pick<InferProvider<typeof streamBrokerCapability>, 'fetchEventMedia' | 'listAllCameraStreams' | 'listAllProfileSlots' | 'getBrokerStats' | 'probeStream' | 'listClients' | 'getLiveViewerCounts' | 'killClient' | 'getStreamUrl' | 'getStreamWithCodec' | 'releaseStreamWithCodec' | 'acquireEgressTranscode' | 'releaseEgressTranscode' | 'subscribeAudioChunks' | 'pullAudioChunks' | 'unsubscribeAudioChunks' | 'setPreBufferDuration' | 'getPreBufferInfo' | 'getRtspPort' | 'getAllRtspEntries' | 'getRtspEntry' | 'regenerateRtspToken' | 'setRtspEnabled' | 'isRtspEnabled'>;