@camstack/types 1.2.374 → 1.2.376

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-rqlHXgwb.js");
2
+ const require_sleep = require("./sleep-Dq0Uyeh0.js");
3
3
  const require_event_category = require("./event-category-T43rdQWR.js");
4
4
  const require_composition = require("./composition-DIp0uE_b.js");
5
5
  const require_node_color = require("./node-color.js");
@@ -5660,11 +5660,12 @@ function describeModelVariant(models, modelId) {
5660
5660
  * for a user-supplied CLIP model: its registry row carries the same block.
5661
5661
  */
5662
5662
  /**
5663
- * `object-clip` (the historical MobileCLIP index, 512-d) or
5664
5663
  * `object-clip-<model>`. Lower-case and dash-only so the sqlite-vec table name
5665
5664
  * derived from it (`vec_` + non-word → `_`) cannot collide with another index's.
5665
+ * The bare `object-clip` — the retired MobileCLIP index — is NOT accepted (D871):
5666
+ * a model that names it is a catalog defect, not a model.
5666
5667
  */
5667
- var CLIP_VECTOR_INDEX_PATTERN = /^object-clip(-[a-z0-9][a-z0-9-]*)?$/;
5668
+ var CLIP_VECTOR_INDEX_PATTERN = /^object-clip-[a-z0-9][a-z0-9-]*$/;
5668
5669
  var ClipModelMetaSchema = zod.z.object({
5669
5670
  /** The paired text encoder's catalog id (the embedding-encoder's text catalog). */
5670
5671
  textModelId: zod.z.string().min(1),
@@ -5673,9 +5674,8 @@ var ClipModelMetaSchema = zod.z.object({
5673
5674
  /**
5674
5675
  * The `vector-store` index this model's vectors live in. ONE feature space
5675
5676
  * per index: two models share an index only when their vectors are ranked
5676
- * against each other, which for CLIP means never across families. MobileCLIP
5677
- * S1 and S2 share `object-clip` for history (separated by the row's
5678
- * `modelId`); any other model gets its own.
5677
+ * against each other, which for CLIP means never across families. Every
5678
+ * model gets its own.
5679
5679
  */
5680
5680
  vectorIndex: zod.z.string().regex(CLIP_VECTOR_INDEX_PATTERN),
5681
5681
  /**
@@ -13900,6 +13900,91 @@ id: zod.z.union([zod.z.string(), zod.z.number()]) }), {
13900
13900
  }
13901
13901
  };
13902
13902
  //#endregion
13903
+ //#region src/capabilities/storage-admin.cap.ts
13904
+ /** One table of the settings database. */
13905
+ var StorageTableSchema = zod.z.object({
13906
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
13907
+ name: zod.z.string(),
13908
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
13909
+ owner: zod.z.string().nullable(),
13910
+ rows: zod.z.number().int().nonnegative(),
13911
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
13912
+ bytes: zod.z.number().int().nonnegative().nullable(),
13913
+ /** Declared by an addon since this engine process started (a running addon claims it). */
13914
+ declaredThisBoot: zod.z.boolean()
13915
+ });
13916
+ /**
13917
+ * The collections retired by exact name: the D870 ones (their data became keys
13918
+ * of the camera's settings) and the three D871 leftovers (the `stats-5m` tables
13919
+ * superseded by `stats-5m-v2`, and the unread `vec_object_clip`). No addon
13920
+ * declares any of them any more; the engine still refuses one a running addon
13921
+ * declared this boot. `dropCollection` may remove these, the
13922
+ * per-addon scoped `addon-settings` / `addon-devices` / `sections` tables, and
13923
+ * the tables of owners that are no longer installed - nothing else.
13924
+ */
13925
+ var STORAGE_ADMIN_MOVED_COLLECTIONS = [
13926
+ "stream-broker:probe-snapshots",
13927
+ "stream-broker:profile-map",
13928
+ "stream-broker:rtsp-tokens",
13929
+ "notification-center:device-mutes",
13930
+ "recorder:recording-configs",
13931
+ "pipeline-orchestrator:device-features",
13932
+ "pipeline-analytics:stats-5m",
13933
+ "pipeline-orchestrator:stats-5m",
13934
+ "vec_object_clip"
13935
+ ];
13936
+ /** The per-addon blob tables a scoped name may carry. */
13937
+ var STORAGE_ADMIN_SCOPED_BASES = [
13938
+ "addon-settings",
13939
+ "addon-devices",
13940
+ "sections"
13941
+ ];
13942
+ /**
13943
+ * storage-admin - the operator's maintenance reach into the settings database:
13944
+ * list its tables, drop one that nothing owns any more (D870).
13945
+ *
13946
+ * Hub-only, internal and `auth: 'admin'` explicitly (`internal` does not gate
13947
+ * the mount, see `data-store-provider`). Both methods are LOGGED by the engine
13948
+ * with the table and the counts. `dropCollection` is a ONE-SHOT of the D870
13949
+ * migration and is marked for removal once the last hub has run it.
13950
+ *
13951
+ * `listTables` is READ-ONLY: it never creates a table, which `count` and `get`
13952
+ * on an undeclared scoped name used to do.
13953
+ */
13954
+ var storageAdminCapability = {
13955
+ name: "storage-admin",
13956
+ scope: "system",
13957
+ mode: "singleton",
13958
+ internal: true,
13959
+ methods: {
13960
+ /**
13961
+ * Every table of the settings database with its row count and size,
13962
+ * optionally only those owned by `ownerPrefix`. Reads only.
13963
+ */
13964
+ listTables: require_sleep.method(zod.z.object({ ownerPrefix: zod.z.string().min(1).optional() }), zod.z.object({ tables: zod.z.array(StorageTableSchema) }), { auth: "admin" }),
13965
+ /**
13966
+ * Drop one table. REFUSES when an addon declared it since the engine
13967
+ * started (a running addon still owns it), when it is an engine or
13968
+ * canonical table, when it does not exist, or when its row count is not
13969
+ * `expectRows` - the caller states what it believes it is deleting. The
13970
+ * engine also refuses anything but `<owner>:(addon-settings|addon-devices|
13971
+ * sections)`, the retired collections by name, and tables of owners that
13972
+ * are not installed (and refuses when it cannot read the installed list).
13973
+ * Removed with the D870 migration script once the last hub ran it.
13974
+ */
13975
+ dropCollection: require_sleep.method(zod.z.object({
13976
+ collection: zod.z.string().min(1),
13977
+ expectRows: zod.z.number().int().nonnegative()
13978
+ }), zod.z.object({
13979
+ dropped: zod.z.literal(true),
13980
+ rows: zod.z.number().int().nonnegative()
13981
+ }), {
13982
+ kind: "mutation",
13983
+ auth: "admin"
13984
+ })
13985
+ }
13986
+ };
13987
+ //#endregion
13903
13988
  //#region src/capabilities/keychain.cap.ts
13904
13989
  /**
13905
13990
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -14647,6 +14732,24 @@ var keychainAdminCapability = {
14647
14732
  auth: "admin",
14648
14733
  caller: "required"
14649
14734
  }),
14735
+ /**
14736
+ * Store a value an operator tool carries over from a retired store at an
14737
+ * addon's own ref (`secret://<owner>/<scope>/<path>`) and answer the ref -
14738
+ * the D870 migration moves a camera's restream tokens this way, so they
14739
+ * never sit in a settings row as plaintext. Audited as the operator; the
14740
+ * caller then writes the MARKER of the ref where the value used to be.
14741
+ */
14742
+ importSecret: require_sleep.method(zod.z.object({
14743
+ ref: zod.z.string().min(1),
14744
+ value: zod.z.string().min(1)
14745
+ }), zod.z.object({
14746
+ ref: zod.z.string(),
14747
+ version: zod.z.number().int()
14748
+ }), {
14749
+ kind: "mutation",
14750
+ auth: "admin",
14751
+ caller: "required"
14752
+ }),
14650
14753
  /** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
14651
14754
  deleteOrphans: require_sleep.method(zod.z.object({ refs: zod.z.array(zod.z.string().min(1)).max(1e3) }), zod.z.object({
14652
14755
  deleted: zod.z.array(zod.z.string()).readonly(),
@@ -62599,7 +62702,19 @@ var TlsStatusSchema = zod.z.object({
62599
62702
  sans: zod.z.array(zod.z.string()),
62600
62703
  caCertPem: zod.z.string().nullable(),
62601
62704
  reissueError: zod.z.string().nullable(),
62602
- restartRequired: zod.z.boolean()
62705
+ restartRequired: zod.z.boolean(),
62706
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
62707
+ caMissing: zod.z.boolean(),
62708
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
62709
+ localCaConstrained: zod.z.boolean().nullable(),
62710
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
62711
+ caReplacedAt: zod.z.string().nullable(),
62712
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
62713
+ storedUpload: zod.z.object({
62714
+ leafFingerprintSha256: zod.z.string(),
62715
+ validTo: zod.z.string(),
62716
+ hasCa: zod.z.boolean()
62717
+ }).nullable()
62603
62718
  });
62604
62719
  var localNetworkCapability = {
62605
62720
  name: "local-network",
@@ -62793,7 +62908,10 @@ var localNetworkCapability = {
62793
62908
  kind: "mutation",
62794
62909
  auth: "admin"
62795
62910
  }),
62796
- /** Replace the served material with operator-supplied PEMs. */
62911
+ /**
62912
+ * Replace the served material with operator-supplied PEMs. A certificate that does not lead
62913
+ * to a public CA must come with its CA certificate, validated and kept for Download CA (D873).
62914
+ */
62797
62915
  uploadCertificate: require_sleep.method(zod.z.object({
62798
62916
  certPem: zod.z.string().min(1),
62799
62917
  keyPem: zod.z.string().min(1),
@@ -62804,7 +62922,14 @@ var localNetworkCapability = {
62804
62922
  }),
62805
62923
  /** The local CA PEM, or empty when there is none to download. */
62806
62924
  downloadCa: require_sleep.method(zod.z.void(), zod.z.object({ pem: zod.z.string() })),
62807
- /** Drop uploaded material and return to the generated local CA. */
62925
+ /**
62926
+ * Serve the kept upload again after "Revert to generated" (D873). Refused when none is kept.
62927
+ */
62928
+ useStoredUploadedCertificate: require_sleep.method(zod.z.void(), TlsStatusSchema, {
62929
+ kind: "mutation",
62930
+ auth: "admin"
62931
+ }),
62932
+ /** Return to the generated local CA. The uploaded certificate stays stored (D873). */
62808
62933
  revertToGeneratedCertificate: require_sleep.method(zod.z.void(), TlsStatusSchema, {
62809
62934
  kind: "mutation",
62810
62935
  auth: "admin"
@@ -79377,6 +79502,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79377
79502
  addonId: null,
79378
79503
  access: "create"
79379
79504
  },
79505
+ "keychainAdmin.importSecret": {
79506
+ capName: "keychain-admin",
79507
+ capScope: "system",
79508
+ addonId: null,
79509
+ access: "create"
79510
+ },
79380
79511
  "keychainAdmin.listAudit": {
79381
79512
  capName: "keychain-admin",
79382
79513
  capScope: "system",
@@ -79773,6 +79904,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79773
79904
  addonId: null,
79774
79905
  access: "create"
79775
79906
  },
79907
+ "localNetwork.useStoredUploadedCertificate": {
79908
+ capName: "local-network",
79909
+ capScope: "system",
79910
+ addonId: null,
79911
+ access: "create"
79912
+ },
79776
79913
  "lockControl.getStatus": {
79777
79914
  capName: "lock-control",
79778
79915
  capScope: "device",
@@ -83157,6 +83294,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
83157
83294
  addonId: null,
83158
83295
  access: "create"
83159
83296
  },
83297
+ "storageAdmin.dropCollection": {
83298
+ capName: "storage-admin",
83299
+ capScope: "system",
83300
+ addonId: null,
83301
+ access: "delete"
83302
+ },
83303
+ "storageAdmin.listTables": {
83304
+ capName: "storage-admin",
83305
+ capScope: "system",
83306
+ addonId: null,
83307
+ access: "view"
83308
+ },
83160
83309
  "storageEvictable.evict": {
83161
83310
  capName: "storage-evictable",
83162
83311
  capScope: "system",
@@ -84712,6 +84861,7 @@ var KNOWN_CAP_NAMES = [
84712
84861
  "snapshot",
84713
84862
  "sso-bridge",
84714
84863
  "storage",
84864
+ "storage-admin",
84715
84865
  "storage-evictable",
84716
84866
  "storage-migration",
84717
84867
  "storage-occupancy",
@@ -84909,6 +85059,7 @@ var SYSTEM_CAP_NAMES = [
84909
85059
  "smtp-provider",
84910
85060
  "sso-bridge",
84911
85061
  "storage",
85062
+ "storage-admin",
84912
85063
  "storage-evictable",
84913
85064
  "storage-migration",
84914
85065
  "storage-occupancy",
@@ -86984,6 +87135,7 @@ var CAPABILITY_NAMES = {
86984
87135
  snapshot: "snapshot",
86985
87136
  ssoBridge: "sso-bridge",
86986
87137
  storage: "storage",
87138
+ storageAdmin: "storage-admin",
86987
87139
  storageEvictable: "storage-evictable",
86988
87140
  storageMigration: "storage-migration",
86989
87141
  storageOccupancy: "storage-occupancy",
@@ -87587,6 +87739,10 @@ var CAPABILITY_ROUTER_KEYS = [
87587
87739
  key: "storage",
87588
87740
  name: "storage"
87589
87741
  },
87742
+ {
87743
+ key: "storageAdmin",
87744
+ name: "storage-admin"
87745
+ },
87590
87746
  {
87591
87747
  key: "storageEvictable",
87592
87748
  name: "storage-evictable"
@@ -87868,6 +88024,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
87868
88024
  snapshotCapability,
87869
88025
  ssoBridgeCapability,
87870
88026
  storageCapability,
88027
+ storageAdminCapability,
87871
88028
  storageEvictableCapability,
87872
88029
  storageMigrationCapability,
87873
88030
  storageOccupancyCapability,
@@ -91926,6 +92083,7 @@ function createSystemProxy(api) {
91926
92083
  listAudit: (input) => dispatch("keychainAdmin", "listAudit", "query", input),
91927
92084
  reveal: (input) => dispatch("keychainAdmin", "reveal", "mutation", input),
91928
92085
  setSystemSecret: (input) => dispatch("keychainAdmin", "setSystemSecret", "mutation", input),
92086
+ importSecret: (input) => dispatch("keychainAdmin", "importSecret", "mutation", input),
91929
92087
  deleteOrphans: (input) => dispatch("keychainAdmin", "deleteOrphans", "mutation", input),
91930
92088
  rotateMasterKey: (input) => dispatch("keychainAdmin", "rotateMasterKey", "mutation", input),
91931
92089
  purgeRetiredKeys: (input) => dispatch("keychainAdmin", "purgeRetiredKeys", "mutation", input),
@@ -91977,6 +92135,7 @@ function createSystemProxy(api) {
91977
92135
  regenerateCertificate: (input) => dispatch("localNetwork", "regenerateCertificate", "mutation", input),
91978
92136
  uploadCertificate: (input) => dispatch("localNetwork", "uploadCertificate", "mutation", input),
91979
92137
  downloadCa: (input) => dispatch("localNetwork", "downloadCa", "query", input),
92138
+ useStoredUploadedCertificate: (input) => dispatch("localNetwork", "useStoredUploadedCertificate", "mutation", input),
91980
92139
  revertToGeneratedCertificate: (input) => dispatch("localNetwork", "revertToGeneratedCertificate", "mutation", input)
91981
92140
  },
91982
92141
  meshNetwork: {
@@ -97243,7 +97402,11 @@ var REMOVED_MODEL_IDS = {
97243
97402
  "face-embedding": ["arcface-r100", "inception-resnet-v1"],
97244
97403
  "plate-detection": ["yolov8n-plate"],
97245
97404
  "plate-ocr": ["vgg-english-g2"],
97246
- "clip-embedding": ["mobileclip-s1", "mobileclip-s2"],
97405
+ "clip-embedding": [
97406
+ "mobileclip-s0",
97407
+ "mobileclip-s1",
97408
+ "mobileclip-s2"
97409
+ ],
97247
97410
  "package-detection": ["yolov8n-package"],
97248
97411
  "bird-classifier": ["bird-classifier-aiy-edgetpu", "bird-nabirds-404"],
97249
97412
  "animal-classifier": ["animals-10"],
@@ -102557,6 +102720,8 @@ exports.STATE_LABELS = STATE_LABELS;
102557
102720
  exports.STATE_LABEL_KEYS = STATE_LABEL_KEYS;
102558
102721
  exports.STATIONARY_OVERLAY_STYLE = STATIONARY_OVERLAY_STYLE;
102559
102722
  exports.STORAGE_ACCESS_FALLBACK = STORAGE_ACCESS_FALLBACK;
102723
+ exports.STORAGE_ADMIN_MOVED_COLLECTIONS = STORAGE_ADMIN_MOVED_COLLECTIONS;
102724
+ exports.STORAGE_ADMIN_SCOPED_BASES = STORAGE_ADMIN_SCOPED_BASES;
102560
102725
  exports.STORAGE_BYTES_PER_GB = STORAGE_BYTES_PER_GB;
102561
102726
  exports.STORAGE_LOCATION_MODES = STORAGE_LOCATION_MODES;
102562
102727
  exports.STREAM_PROFILE_META = STREAM_PROFILE_META;
@@ -102664,6 +102829,7 @@ exports.StorageMigrationSourcesSchema = StorageMigrationSourcesSchema;
102664
102829
  exports.StorageOccupancyReportSchema = StorageOccupancyReportSchema;
102665
102830
  exports.StorageProviderInfoSchema = ProviderInfoSchema;
102666
102831
  exports.StorageReadChunkInputSchema = ReadChunkInputSchema;
102832
+ exports.StorageTableSchema = StorageTableSchema;
102667
102833
  exports.StorageTestLocationResultSchema = TestLocationResultSchema;
102668
102834
  exports.StorageWriteChunkInputSchema = WriteChunkInputSchema;
102669
102835
  exports.StreamCodecSchema = StreamCodecSchema;
@@ -102966,6 +103132,7 @@ exports.classifyCamerasForBenchmark = classifyCamerasForBenchmark;
102966
103132
  exports.classifyInferenceHardware = classifyInferenceHardware;
102967
103133
  exports.classifyRetrainReview = classifyRetrainReview;
102968
103134
  exports.classifySecretWrite = require_sleep.classifySecretWrite;
103135
+ exports.classifyStoreError = require_sleep.classifyStoreError;
102969
103136
  exports.classifyStream = classifyStream;
102970
103137
  exports.classifyStreams = classifyStreams;
102971
103138
  exports.clearKnownSecrets = require_sleep.clearKnownSecrets;
@@ -103591,6 +103758,7 @@ exports.stateLabel = stateLabel;
103591
103758
  exports.stateVocabularyFor = stateVocabularyFor;
103592
103759
  exports.stepModelRunsOnFormat = stepModelRunsOnFormat;
103593
103760
  exports.stepSettingSource = stepSettingSource;
103761
+ exports.storageAdminCapability = storageAdminCapability;
103594
103762
  exports.storageCapability = storageCapability;
103595
103763
  exports.storageEvictableCapability = storageEvictableCapability;
103596
103764
  exports.storageMigrationCapability = storageMigrationCapability;