camstack 1.2.181 → 1.2.182

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.
@@ -14681,7 +14681,7 @@ function date4(params) {
14681
14681
  // ../../node_modules/zod/v4/classic/external.js
14682
14682
  config(en_default());
14683
14683
 
14684
- // ../types/dist/sleep-DujUvOcb.mjs
14684
+ // ../types/dist/sleep-r3RWkGVx.mjs
14685
14685
  var AUDIO_CHUNK_FORMATS = [
14686
14686
  "f32le",
14687
14687
  "pcmu",
@@ -16554,6 +16554,254 @@ var CameraSwitchGroupSchema = external_exports.object({
16554
16554
  /** Unix ms when the group was composed server-side. */
16555
16555
  fetchedAt: external_exports.number()
16556
16556
  });
16557
+ var TRAINING_JOB_SCHEMA = "camstack.training/v1";
16558
+ var TRAINING_RESULT_SCHEMA = "camstack.training-result/v1";
16559
+ var TrainingExportSchema = external_exports.enum([
16560
+ "onnx",
16561
+ "openvino-fp16",
16562
+ "openvino-int8",
16563
+ "coreml-fp16"
16564
+ ]);
16565
+ var FloorsSchema = external_exports.record(external_exports.string(), external_exports.number().min(0).max(1));
16566
+ var TrainingJobSpecSchema = external_exports.object({
16567
+ schema: external_exports.literal(TRAINING_JOB_SCHEMA),
16568
+ jobKey: external_exports.string().uuid(),
16569
+ target: external_exports.object({
16570
+ kind: external_exports.literal("detector"),
16571
+ step: external_exports.literal("object-detection")
16572
+ }),
16573
+ base: external_exports.object({
16574
+ modelId: external_exports.string().min(1),
16575
+ /** Ultralytics weights id, e.g. `yolov9m.pt`. */
16576
+ weights: external_exports.string().min(1),
16577
+ imgsz: external_exports.number().int().positive()
16578
+ }),
16579
+ baseline: external_exports.object({
16580
+ modelId: external_exports.string().min(1),
16581
+ /** The baseline ONNX the holdout comparison runs; public mirror URL. */
16582
+ onnxUrl: external_exports.string().url(),
16583
+ imgsz: external_exports.number().int().positive(),
16584
+ floors: FloorsSchema
16585
+ }),
16586
+ dataset: external_exports.object({
16587
+ versionId: external_exports.string().min(1),
16588
+ annotationHash: external_exports.string(),
16589
+ /** sha256 of the uploaded archive; the trainer refuses a mismatch (exit 65). */
16590
+ sha256: external_exports.string().regex(/^[0-9a-f]{64}$/)
16591
+ }),
16592
+ split: external_exports.object({
16593
+ holdoutCameras: external_exports.array(external_exports.number().int()),
16594
+ /** When no camera is held out: the last N days of every camera. */
16595
+ holdoutLastDays: external_exports.number().int().nonnegative(),
16596
+ valFraction: external_exports.number().min(0).max(0.5),
16597
+ seed: external_exports.number().int()
16598
+ }),
16599
+ hyper: external_exports.object({
16600
+ epochs: external_exports.number().int().positive(),
16601
+ batch: external_exports.number().int().positive(),
16602
+ lr0: external_exports.number().positive(),
16603
+ /** Layers frozen from the start of the backbone; 0 = none. */
16604
+ freeze: external_exports.number().int().nonnegative(),
16605
+ patience: external_exports.number().int().nonnegative(),
16606
+ seed: external_exports.number().int()
16607
+ }),
16608
+ replay: external_exports.object({
16609
+ source: external_exports.literal("coco2017"),
16610
+ count: external_exports.number().int().nonnegative()
16611
+ }),
16612
+ exports: external_exports.array(TrainingExportSchema).min(1),
16613
+ calibration: external_exports.object({ maxFrames: external_exports.number().int().positive() }),
16614
+ floors: external_exports.object({
16615
+ minSupport: external_exports.number().int().positive(),
16616
+ clamp: external_exports.number().min(0).max(1)
16617
+ }),
16618
+ int8Gate: external_exports.object({ maxMap50Drop: external_exports.number().min(0).max(1) }),
16619
+ catalog: external_exports.object({
16620
+ id: external_exports.string().regex(/^[a-z0-9][a-z0-9-]{2,80}$/),
16621
+ name: external_exports.string().min(1).max(160)
16622
+ })
16623
+ });
16624
+ var TrainingResultFileSchema = external_exports.object({
16625
+ path: external_exports.string().min(1),
16626
+ bytes: external_exports.number().int().nonnegative(),
16627
+ sha256: external_exports.string().regex(/^[0-9a-f]{64}$/),
16628
+ format: external_exports.enum([
16629
+ "onnx",
16630
+ "openvino",
16631
+ "coreml",
16632
+ "pt"
16633
+ ]),
16634
+ variant: external_exports.enum(["base", "int8"])
16635
+ });
16636
+ var DraftFormatSchema = external_exports.object({
16637
+ /** RELATIVE path inside the bundle; the hub rewrites it to `camstack-local://`. */
16638
+ url: external_exports.string().min(1),
16639
+ sizeMB: external_exports.number().nonnegative(),
16640
+ isDirectory: external_exports.boolean().optional(),
16641
+ files: external_exports.array(external_exports.string()).optional(),
16642
+ runtimes: external_exports.array(external_exports.literal("python")).optional(),
16643
+ revision: external_exports.string().min(1)
16644
+ });
16645
+ var TrainingCatalogDraftSchema = external_exports.object({
16646
+ id: external_exports.string().min(1),
16647
+ name: external_exports.string().min(1),
16648
+ description: external_exports.string(),
16649
+ labels: external_exports.array(external_exports.unknown()),
16650
+ inputSize: external_exports.object({
16651
+ width: external_exports.number().int().positive(),
16652
+ height: external_exports.number().int().positive()
16653
+ }),
16654
+ preprocessMode: external_exports.literal("letterbox"),
16655
+ defaultClassFloors: FloorsSchema,
16656
+ formats: external_exports.object({
16657
+ onnx: DraftFormatSchema.optional(),
16658
+ openvino: DraftFormatSchema.optional(),
16659
+ coreml: DraftFormatSchema.optional()
16660
+ })
16661
+ });
16662
+ var TrainingEvalClassSchema = external_exports.object({
16663
+ positives: external_exports.number().int(),
16664
+ floor: external_exports.number().nullable(),
16665
+ tp: external_exports.number().int(),
16666
+ fp: external_exports.number().int(),
16667
+ fn: external_exports.number().int(),
16668
+ precision: external_exports.number().nullable(),
16669
+ recall: external_exports.number().nullable(),
16670
+ ap50: external_exports.number().nullable(),
16671
+ recallByCamera: external_exports.record(external_exports.string(), external_exports.number().nullable()).optional(),
16672
+ recallByLight: external_exports.record(external_exports.string(), external_exports.number().nullable()).optional(),
16673
+ fpByCamera: external_exports.record(external_exports.string(), external_exports.number()).optional(),
16674
+ smallFound: external_exports.number().int().optional(),
16675
+ smallTotal: external_exports.number().int().optional()
16676
+ }).passthrough();
16677
+ var TrainingEvalReportSchema = external_exports.object({
16678
+ frames: external_exports.number().int(),
16679
+ classes: external_exports.record(external_exports.string(), TrainingEvalClassSchema)
16680
+ }).passthrough();
16681
+ var TrainingResultSchema = external_exports.object({
16682
+ schema: external_exports.literal(TRAINING_RESULT_SCHEMA),
16683
+ jobKey: external_exports.string(),
16684
+ status: external_exports.enum(["succeeded", "failed"]),
16685
+ error: external_exports.object({
16686
+ stage: external_exports.string(),
16687
+ code: external_exports.string(),
16688
+ message: external_exports.string()
16689
+ }).nullable(),
16690
+ trainer: external_exports.object({
16691
+ version: external_exports.string(),
16692
+ revision: external_exports.string()
16693
+ }),
16694
+ toolchain: external_exports.record(external_exports.string(), external_exports.string().nullable()),
16695
+ dataset: external_exports.object({
16696
+ versionId: external_exports.string(),
16697
+ annotationHash: external_exports.string(),
16698
+ sha256: external_exports.string(),
16699
+ frames: external_exports.object({
16700
+ train: external_exports.number().int(),
16701
+ val: external_exports.number().int(),
16702
+ holdout: external_exports.number().int()
16703
+ }),
16704
+ holdoutCameras: external_exports.array(external_exports.number().int()),
16705
+ replayImages: external_exports.number().int()
16706
+ }).optional(),
16707
+ training: external_exports.object({
16708
+ epochsRun: external_exports.number().int(),
16709
+ bestEpoch: external_exports.number().int(),
16710
+ bestMap50: external_exports.number(),
16711
+ bestMap50_95: external_exports.number(),
16712
+ seconds: external_exports.number()
16713
+ }).optional(),
16714
+ evaluation: external_exports.object({
16715
+ holdoutFrames: external_exports.number().int(),
16716
+ baseline: TrainingEvalReportSchema.nullable(),
16717
+ candidate: TrainingEvalReportSchema.nullable(),
16718
+ candidateInt8: TrainingEvalReportSchema.nullable(),
16719
+ recallDeltaByCamera: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.number())).nullable(),
16720
+ map50: external_exports.record(external_exports.string(), external_exports.number().nullable())
16721
+ }).optional(),
16722
+ floors: external_exports.object({
16723
+ baseline: FloorsSchema,
16724
+ candidate: FloorsSchema,
16725
+ candidateInt8: FloorsSchema.nullable(),
16726
+ notes: external_exports.array(external_exports.string())
16727
+ }).optional(),
16728
+ int8: external_exports.object({
16729
+ kept: external_exports.boolean(),
16730
+ map50Fp16: external_exports.number().nullable(),
16731
+ map50Int8: external_exports.number().nullable(),
16732
+ reason: external_exports.string().nullable()
16733
+ }).optional(),
16734
+ exportsDropped: external_exports.array(external_exports.object({
16735
+ export: external_exports.string(),
16736
+ reason: external_exports.string()
16737
+ })).optional(),
16738
+ files: external_exports.array(TrainingResultFileSchema).optional(),
16739
+ bundle: external_exports.object({
16740
+ path: external_exports.literal("bundle.tar"),
16741
+ bytes: external_exports.number().int().nonnegative(),
16742
+ sha256: external_exports.string().regex(/^[0-9a-f]{64}$/)
16743
+ }).nullable().optional(),
16744
+ catalogDraft: external_exports.object({
16745
+ base: TrainingCatalogDraftSchema,
16746
+ int8: TrainingCatalogDraftSchema.nullable()
16747
+ }).nullable().optional(),
16748
+ licence: external_exports.string()
16749
+ });
16750
+ var TrainingStageSchema = external_exports.enum([
16751
+ "prepare",
16752
+ "replay",
16753
+ "train",
16754
+ "eval",
16755
+ "export",
16756
+ "package"
16757
+ ]);
16758
+ var EventBase = {
16759
+ v: external_exports.literal(1),
16760
+ ts: external_exports.number()
16761
+ };
16762
+ var TrainingEventSchema = external_exports.discriminatedUnion("type", [
16763
+ external_exports.object({
16764
+ ...EventBase,
16765
+ type: external_exports.literal("stage"),
16766
+ stage: TrainingStageSchema
16767
+ }),
16768
+ external_exports.object({
16769
+ ...EventBase,
16770
+ type: external_exports.literal("epoch"),
16771
+ epoch: external_exports.number().int(),
16772
+ epochs: external_exports.number().int(),
16773
+ boxLoss: external_exports.number().nullable().optional(),
16774
+ map50: external_exports.number().nullable().optional(),
16775
+ map50_95: external_exports.number().nullable().optional(),
16776
+ etaSec: external_exports.number().nullable().optional()
16777
+ }),
16778
+ external_exports.object({
16779
+ ...EventBase,
16780
+ type: external_exports.literal("metric"),
16781
+ name: external_exports.string(),
16782
+ value: external_exports.number()
16783
+ }),
16784
+ external_exports.object({
16785
+ ...EventBase,
16786
+ type: external_exports.literal("artifact"),
16787
+ path: external_exports.string(),
16788
+ bytes: external_exports.number(),
16789
+ sha256: external_exports.string()
16790
+ }),
16791
+ external_exports.object({
16792
+ ...EventBase,
16793
+ type: external_exports.literal("done"),
16794
+ status: external_exports.enum(["succeeded", "failed"]),
16795
+ resultSha256: external_exports.string().nullable().optional()
16796
+ }),
16797
+ external_exports.object({
16798
+ ...EventBase,
16799
+ type: external_exports.literal("error"),
16800
+ stage: external_exports.string(),
16801
+ code: external_exports.string(),
16802
+ message: external_exports.string()
16803
+ })
16804
+ ]);
16557
16805
  var BirthDecisionVerdictSchema = external_exports.enum([
16558
16806
  "confirmed",
16559
16807
  "suppressed",
@@ -18230,7 +18478,9 @@ var AddonHttpRouteSchema = external_exports.object({
18230
18478
  "authenticated",
18231
18479
  "admin"
18232
18480
  ]).optional(),
18233
- description: external_exports.string().optional()
18481
+ description: external_exports.string().optional(),
18482
+ /** The hub limits this route per client address before the handler runs. */
18483
+ rateLimit: external_exports.enum(["auth"]).optional()
18234
18484
  });
18235
18485
  var InvokeRequestSchema = external_exports.object({
18236
18486
  method: external_exports.string(),
@@ -18940,6 +19190,26 @@ var BackupDestinationInfoSchema = external_exports.object({
18940
19190
  */
18941
19191
  lastError: external_exports.string().optional()
18942
19192
  });
19193
+ var BackupArchiveEncryptionSchema = external_exports.object({
19194
+ /** `x25519-hkdf-aes256gcm-stream-v1`. */
19195
+ scheme: external_exports.string(),
19196
+ /** 16 hex — the backup key whose secret restores this archive. */
19197
+ keyId: external_exports.string()
19198
+ });
19199
+ var BackupEncryptionStatusSchema = external_exports.object({
19200
+ enabled: external_exports.boolean(),
19201
+ active: external_exports.object({
19202
+ keyId: external_exports.string(),
19203
+ publicKey: external_exports.string(),
19204
+ createdAt: external_exports.number()
19205
+ }).nullable(),
19206
+ /** Every key ever set up, newest first. */
19207
+ keys: external_exports.array(external_exports.object({
19208
+ keyId: external_exports.string(),
19209
+ createdAt: external_exports.number(),
19210
+ retiredAt: external_exports.number().nullable()
19211
+ })).readonly()
19212
+ });
18943
19213
  var BackupArchiveEntrySchema = external_exports.object({
18944
19214
  id: external_exports.string(),
18945
19215
  filename: external_exports.string(),
@@ -18947,7 +19217,9 @@ var BackupArchiveEntrySchema = external_exports.object({
18947
19217
  sizeBytes: external_exports.number(),
18948
19218
  label: external_exports.string().optional(),
18949
19219
  /** Top-level locations included in the archive (db, addons, tls, …). */
18950
- locations: external_exports.array(external_exports.string()).readonly()
19220
+ locations: external_exports.array(external_exports.string()).readonly(),
19221
+ /** Present when the archive is encrypted; restore then needs that key. */
19222
+ encryption: BackupArchiveEncryptionSchema.optional()
18951
19223
  });
18952
19224
  var BackupEntrySchema = external_exports.object({
18953
19225
  id: external_exports.string(),
@@ -18956,7 +19228,8 @@ var BackupEntrySchema = external_exports.object({
18956
19228
  label: external_exports.string().optional(),
18957
19229
  createdAt: external_exports.number(),
18958
19230
  sizeBytes: external_exports.number(),
18959
- locations: external_exports.array(external_exports.string()).optional()
19231
+ locations: external_exports.array(external_exports.string()).optional(),
19232
+ encryption: BackupArchiveEncryptionSchema.optional()
18960
19233
  });
18961
19234
  var ArchiveEntrySchema = external_exports.object({
18962
19235
  path: external_exports.string(),
@@ -19169,11 +19442,58 @@ var backupCapability = {
19169
19442
  * this list and skips entries whose path doesn't start with
19170
19443
  * any of them.
19171
19444
  */
19172
- locations: external_exports.array(external_exports.string()).optional()
19445
+ locations: external_exports.array(external_exports.string()).optional(),
19446
+ /**
19447
+ * The backup SECRET key, for an encrypted archive (ignored for a plain
19448
+ * one). The archive is decrypted into the hub's private staging
19449
+ * before the restart; the key is not stored. A wrong or missing key
19450
+ * is refused before the archive is downloaded.
19451
+ */
19452
+ backupSecretKey: external_exports.string().optional()
19173
19453
  }), external_exports.void(), {
19174
19454
  kind: "mutation",
19175
19455
  auth: "admin"
19176
19456
  }),
19457
+ /** The encryption setting — public keys only. */
19458
+ getEncryption: method(external_exports.void(), BackupEncryptionStatusSchema, { auth: "admin" }),
19459
+ /**
19460
+ * Turn encryption on, or replace the key: generates a new key pair, keeps
19461
+ * the PUBLIC key, and returns the SECRET key — once. It is never stored
19462
+ * on the hub and cannot be shown again; archives made from now on need
19463
+ * it to be restored. A previous key is retired: archives made with it
19464
+ * still need IT.
19465
+ */
19466
+ setupEncryption: method(external_exports.object({}), external_exports.object({
19467
+ keyId: external_exports.string(),
19468
+ secretKey: external_exports.string(),
19469
+ publicKey: external_exports.string(),
19470
+ createdAt: external_exports.number(),
19471
+ replacedKeyId: external_exports.string().nullable()
19472
+ }), {
19473
+ kind: "mutation",
19474
+ auth: "admin"
19475
+ }),
19476
+ /** New archives are plain again. Existing encrypted archives keep needing their key. */
19477
+ disableEncryption: method(external_exports.object({}), external_exports.object({ disabledKeyId: external_exports.string().nullable() }), {
19478
+ kind: "mutation",
19479
+ auth: "admin"
19480
+ }),
19481
+ /**
19482
+ * Does this secret key parse, and which backup key is it? A mutation so
19483
+ * the key never travels in a URL. Nothing is stored.
19484
+ */
19485
+ checkBackupKey: method(external_exports.object({ backupSecretKey: external_exports.string() }), external_exports.object({
19486
+ valid: external_exports.boolean(),
19487
+ keyId: external_exports.string().nullable(),
19488
+ /** The hub knows this key (active or retired). */
19489
+ known: external_exports.boolean(),
19490
+ /** It is the key new archives are encrypted to. */
19491
+ active: external_exports.boolean(),
19492
+ error: external_exports.string().optional()
19493
+ }), {
19494
+ kind: "mutation",
19495
+ auth: "admin"
19496
+ }),
19177
19497
  delete: method(external_exports.object({
19178
19498
  destinationId: external_exports.string(),
19179
19499
  backupId: external_exports.string()
@@ -21121,6 +21441,54 @@ var CustomModelDescriptorSchema = external_exports.object({
21121
21441
  stepId: external_exports.string(),
21122
21442
  entry: ModelCatalogEntrySchema
21123
21443
  });
21444
+ var ModelBundleFileSchema = external_exports.object({
21445
+ /** Relative path inside the bundle tar; an mlpackage member is `<x>.mlpackage/<member>`. */
21446
+ path: external_exports.string().min(1),
21447
+ bytes: external_exports.number().int().nonnegative(),
21448
+ sha256: external_exports.string().regex(/^[0-9a-f]{64}$/)
21449
+ });
21450
+ var ImportModelBundleInputSchema = external_exports.object({
21451
+ /** The registry provider that keeps the model (Model Studio). */
21452
+ addonId: external_exports.string(),
21453
+ stepId: external_exports.string().min(1),
21454
+ /**
21455
+ * The catalog rows to register, complete, every format URL already
21456
+ * `camstack-local://<modelId>/<file>` naming a file of the bundle. One
21457
+ * bundle may carry several rows (a base and its INT8 variant).
21458
+ */
21459
+ entries: external_exports.array(ModelCatalogEntrySchema).min(1).max(4),
21460
+ /** The bundle tar, offered by the producer over `ctx.peerBytes` (same host). */
21461
+ bundle: external_exports.object({
21462
+ ticket: PeerBytesTicketSchema,
21463
+ bytes: external_exports.number().int().positive(),
21464
+ sha256: external_exports.string().regex(/^[0-9a-f]{64}$/)
21465
+ }),
21466
+ /** Every file the tar must hold; anything missing, extra or different is refused. */
21467
+ files: external_exports.array(ModelBundleFileSchema).min(1).max(64),
21468
+ /** Convert missing engine formats and push the model to every agent afterwards. */
21469
+ distribute: external_exports.boolean()
21470
+ });
21471
+ var ImportModelBundleResultSchema = external_exports.discriminatedUnion("kind", [external_exports.object({
21472
+ kind: external_exports.literal("imported"),
21473
+ modelIds: external_exports.array(external_exports.string()).readonly(),
21474
+ distributed: external_exports.array(external_exports.object({
21475
+ modelId: external_exports.string(),
21476
+ nodeId: external_exports.string(),
21477
+ format: external_exports.enum(MODEL_FORMATS),
21478
+ ok: external_exports.boolean(),
21479
+ error: external_exports.string().optional()
21480
+ })).readonly()
21481
+ }), external_exports.object({
21482
+ kind: external_exports.literal("refused"),
21483
+ reason: external_exports.enum([
21484
+ "transfer-failed",
21485
+ "checksum-mismatch",
21486
+ "bundle-mismatch",
21487
+ "invalid-entry",
21488
+ "id-taken"
21489
+ ]),
21490
+ detail: external_exports.string()
21491
+ })]);
21124
21492
  var customModelRegistryCapability = {
21125
21493
  name: "custom-model-registry",
21126
21494
  scope: "system",
@@ -21136,7 +21504,22 @@ var customModelRegistryCapability = {
21136
21504
  * `ctx.api.customModelRegistry.listModels.query()` — UDS/Moleculer,
21137
21505
  * never tRPC — so `auth: 'admin'` costs it nothing.
21138
21506
  */
21139
- listModels: method(external_exports.void(), external_exports.array(CustomModelDescriptorSchema).readonly(), { auth: "admin" })
21507
+ listModels: method(external_exports.void(), external_exports.array(CustomModelDescriptorSchema).readonly(), { auth: "admin" }),
21508
+ /**
21509
+ * Register a model whose files arrive as ONE bundle tar (D806): the tar
21510
+ * is taken over `ctx.peerBytes`, checked against `bundle.sha256` and
21511
+ * every row of `files`, unpacked into the hub's flat modelsDir (directory
21512
+ * formats included), each format's `.revision` record written, the rows
21513
+ * upserted under the operator's name, the hub marked available and —
21514
+ * when asked — engine formats converted and the model distributed. A
21515
+ * model id already registered by another source is refused, never
21516
+ * overwritten.
21517
+ */
21518
+ importModelBundle: method(ImportModelBundleInputSchema, ImportModelBundleResultSchema, {
21519
+ kind: "mutation",
21520
+ auth: "admin",
21521
+ timeoutMs: 30 * 6e4
21522
+ })
21140
21523
  }
21141
21524
  };
21142
21525
  var QueryFilterSchema = external_exports.object({
@@ -21772,6 +22155,31 @@ var KeychainKeySourceSchema = external_exports.object({
21772
22155
  */
21773
22156
  sharesBackupWithDatabase: external_exports.boolean()
21774
22157
  });
22158
+ var KeychainResetRecordSchema = external_exports.object({
22159
+ id: external_exports.string(),
22160
+ at: external_exports.number(),
22161
+ /** `user:<id>` or {@link KEYCHAIN_RESET_TRIGGER_ACTOR}. */
22162
+ actor: external_exports.string(),
22163
+ /** Why the keychain was locked when it was reset; `null` when it was not locked. */
22164
+ lockedReason: external_exports.string().nullable(),
22165
+ /** Values moved into the archive table (ciphertext under the lost key). */
22166
+ archived: external_exports.number().int(),
22167
+ /** `keychain:secrets-orphaned-<ts>`, or `null` when nothing was stored. */
22168
+ archivedCollection: external_exports.string().nullable(),
22169
+ /**
22170
+ * `keychain:keys-orphaned-<ts>`: the wrapped data keys of the archive, kept
22171
+ * so the archive can still be opened if the lost master key turns up.
22172
+ */
22173
+ archivedKeysCollection: external_exports.string().nullable(),
22174
+ /**
22175
+ * `system-settings` keys whose marker the reset cleared — the cluster
22176
+ * secret's: a marker left pointing at an archived value would refuse every
22177
+ * agent forever (D797).
22178
+ */
22179
+ clearedSettingsKeys: external_exports.array(external_exports.string()).readonly(),
22180
+ /** When an operator dismissed the notice on the Secrets page; `null` until then. */
22181
+ acknowledgedAt: external_exports.number().nullable()
22182
+ });
21775
22183
  var KeychainStatusSchema = external_exports.object({
21776
22184
  keychain: KeychainStateSchema,
21777
22185
  /** The source of the master key in use; `null` while locked. */
@@ -21789,7 +22197,9 @@ var KeychainStatusSchema = external_exports.object({
21789
22197
  /** Wrapped copies of the data key under a previous master key, kept until purged. */
21790
22198
  retiredWraps: external_exports.number().int(),
21791
22199
  recoveryKeyDownloadedAt: external_exports.number().nullable(),
21792
- secretCount: external_exports.number().int()
22200
+ secretCount: external_exports.number().int(),
22201
+ /** The most recent reset, acknowledged or not; `null` when the keychain was never reset. */
22202
+ lastReset: KeychainResetRecordSchema.nullable()
21793
22203
  });
21794
22204
  var KeychainSecretUsageSchema = external_exports.enum([
21795
22205
  "in-use",
@@ -21806,13 +22216,14 @@ var KeychainAuditActionSchema = external_exports.enum([
21806
22216
  "download-recovery-key",
21807
22217
  "delete-orphans",
21808
22218
  "reset",
22219
+ "acknowledge-reset",
21809
22220
  "initialize"
21810
22221
  ]);
21811
22222
  var KeychainAuditEntrySchema = external_exports.object({
21812
22223
  id: external_exports.string(),
21813
22224
  at: external_exports.number(),
21814
22225
  action: KeychainAuditActionSchema,
21815
- /** `addon:<id>` | `user:<id>` | `system`. */
22226
+ /** `addon:<id>` | `user:<id>` | `system` | `trigger-file`. */
21816
22227
  actor: external_exports.string(),
21817
22228
  ref: external_exports.string().nullable(),
21818
22229
  detail: external_exports.string().nullable()
@@ -21916,6 +22327,21 @@ var keychainAdminCapability = {
21916
22327
  kind: "mutation",
21917
22328
  auth: "admin",
21918
22329
  caller: "required"
22330
+ }),
22331
+ /**
22332
+ * What the last reset left to re-enter: the archived refs (owner, scope,
22333
+ * field — never a value) that hold no value again yet. Process-held refs
22334
+ * the hub regenerates itself (the session signing key) are not listed.
22335
+ */
22336
+ resetReport: method(external_exports.object({}), external_exports.object({
22337
+ reset: KeychainResetRecordSchema.nullable(),
22338
+ pendingReentry: external_exports.array(KeychainSecretMetaSchema).readonly()
22339
+ }), { auth: "admin" }),
22340
+ /** Dismiss the "keychain was reset" notice. Audited. */
22341
+ acknowledgeReset: method(external_exports.object({}), external_exports.object({ acknowledged: external_exports.boolean() }), {
22342
+ kind: "mutation",
22343
+ auth: "admin",
22344
+ caller: "required"
21919
22345
  })
21920
22346
  }
21921
22347
  };
@@ -25066,7 +25492,7 @@ var RedirectLoginMethodSchema = external_exports.object({
25066
25492
  * The provider names an external identity a signed-in user can link to
25067
25493
  * their own account (D782): `auth.listLinkableProviders` /
25068
25494
  * `beginExternalLink` offer exactly the redirect methods that set this,
25069
- * whatever their id. Absent / false — a login button only (magic-link).
25495
+ * whatever their id. Absent / false — a login button only.
25070
25496
  */
25071
25497
  linkable: external_exports.boolean().optional()
25072
25498
  });
@@ -31001,6 +31427,26 @@ var pipelineAnalyticsCapability = {
31001
31427
  auth: "admin",
31002
31428
  timeoutMs: 60 * 6e4
31003
31429
  }),
31430
+ /**
31431
+ * OFFER the annotated archive instead of pushing it (D805): the same tar
31432
+ * `writeRetrainArchive` streams, behind a one-shot `ctx.peerBytes` ticket
31433
+ * the caller dials at once (same host). For a consumer that cannot expose
31434
+ * an upload URL — a training provider streaming straight into its cloud.
31435
+ * The answer is the plan; the bytes and their sha256 are the consumer's
31436
+ * to measure as they arrive.
31437
+ */
31438
+ offerRetrainArchive: method(external_exports.object({
31439
+ filter: RetrainExportFilterSchema,
31440
+ layout: RetrainExportLayoutSchema
31441
+ }), external_exports.object({
31442
+ ticket: PeerBytesTicketSchema,
31443
+ frames: external_exports.number().int(),
31444
+ annotations: external_exports.number().int()
31445
+ }), {
31446
+ kind: "mutation",
31447
+ auth: "admin",
31448
+ timeoutMs: 12e4
31449
+ }),
31004
31450
  /** The counts a selection would freeze — class × camera × day/night,
31005
31451
  * completeness — without freezing anything. Index reads only. */
31006
31452
  previewRetrainDataset: method(external_exports.object({
@@ -35510,7 +35956,14 @@ var SsoBridgeClaimsSchema = external_exports.object({
35510
35956
  * Verified `iss` of the id_token behind an OIDC login bridge (D782). A
35511
35957
  * subject is unique only per issuer, so a link is bound to it.
35512
35958
  */
35513
- issuer: external_exports.string().optional()
35959
+ issuer: external_exports.string().optional(),
35960
+ /**
35961
+ * SHA-256 (hex) of the `camstack_sso_state` cookie the IdP `/start` set in
35962
+ * the browser that began this sign-in. `/api/auth/sso/finish` requires the
35963
+ * request to present the matching cookie — a login bridge is useless in
35964
+ * any other browser.
35965
+ */
35966
+ browserBinding: external_exports.string().optional()
35514
35967
  });
35515
35968
  var ssoBridgeCapability = {
35516
35969
  name: "sso-bridge",
@@ -35528,7 +35981,7 @@ var ssoBridgeCapability = {
35528
35981
  * `/api/auth/sso/finish` to become admin — a full privilege escalation
35529
35982
  * through the exact surface this cap exists to close (see the module
35530
35983
  * docblock). Every real caller (`oauth-grants.ts`, `main.ts`
35531
- * registration, the OIDC/magic-link addons) reaches this through
35984
+ * registration, the OIDC addon) reaches this through
35532
35985
  * `ctx.api` / the in-process registry — never through tRPC — so
35533
35986
  * `auth: 'admin'` costs those callers nothing.
35534
35987
  */
@@ -47057,16 +47510,6 @@ var ApiKeySummarySchema = external_exports.object({
47057
47510
  createdAt: external_exports.number(),
47058
47511
  lastUsedAt: external_exports.number().optional()
47059
47512
  });
47060
- var CreateApiKeyInputSchema = external_exports.object({
47061
- label: external_exports.string(),
47062
- isAdmin: external_exports.boolean().default(false),
47063
- allowedProviders: external_exports.union([external_exports.array(external_exports.string()), external_exports.literal("*")]).optional(),
47064
- allowedDevices: external_exports.record(external_exports.string(), external_exports.union([external_exports.array(external_exports.string()), external_exports.literal("*")])).optional()
47065
- });
47066
- var CreateApiKeyResultSchema = external_exports.object({
47067
- token: external_exports.string(),
47068
- record: ApiKeySummarySchema
47069
- });
47070
47513
  var ScopedTokenSummarySchema = external_exports.object({
47071
47514
  id: external_exports.string(),
47072
47515
  userId: external_exports.string(),
@@ -47168,20 +47611,11 @@ var userManagementCapability = {
47168
47611
  access: "view"
47169
47612
  }),
47170
47613
  listApiKeys: method(external_exports.void(), external_exports.array(ApiKeySummarySchema), { auth: "admin" }),
47171
- createApiKey: method(CreateApiKeyInputSchema, CreateApiKeyResultSchema, {
47172
- kind: "mutation",
47173
- auth: "admin",
47174
- access: "create"
47175
- }),
47176
47614
  revokeApiKey: method(external_exports.object({ id: external_exports.string() }), external_exports.object({ success: external_exports.literal(true) }), {
47177
47615
  kind: "mutation",
47178
47616
  auth: "admin",
47179
47617
  access: "delete"
47180
47618
  }),
47181
- validateApiKey: method(external_exports.object({ token: external_exports.string() }), ApiKeySummarySchema.nullable(), {
47182
- kind: "mutation",
47183
- access: "view"
47184
- }),
47185
47619
  createScopedToken: method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
47186
47620
  kind: "mutation",
47187
47621
  auth: "admin",
@@ -47271,20 +47705,6 @@ var userManagementCapability = {
47271
47705
  userId: external_exports.string(),
47272
47706
  issuer: external_exports.string()
47273
47707
  }).nullable(), { auth: "admin" }),
47274
- /**
47275
- * Link `(provider, subject)` to `userId`. Idempotent for the same user;
47276
- * REFUSES (throws) an identity already linked to another user, and a
47277
- * user that does not exist.
47278
- */
47279
- linkExternalIdentity: method(ExternalIdentityKeySchema.extend({
47280
- userId: external_exports.string(),
47281
- issuer: external_exports.string().min(1),
47282
- label: external_exports.string().optional()
47283
- }), external_exports.object({ success: external_exports.literal(true) }), {
47284
- kind: "mutation",
47285
- auth: "admin",
47286
- access: "create"
47287
- }),
47288
47708
  /** Remove one link of `userId`. `success: false` when it was not linked to that user. */
47289
47709
  unlinkExternalIdentity: method(ExternalIdentityKeySchema.extend({ userId: external_exports.string() }), external_exports.object({ success: external_exports.boolean() }), {
47290
47710
  kind: "mutation",
@@ -47815,6 +48235,472 @@ var zoneRulesCapability = {
47815
48235
  */
47816
48236
  durability: "restored"
47817
48237
  };
48238
+ var TrainingGpuOptionSchema = external_exports.object({
48239
+ id: external_exports.string(),
48240
+ label: external_exports.string(),
48241
+ /** List price, USD per GPU-hour, before any region multiplier. */
48242
+ usdPerHour: external_exports.number().nonnegative(),
48243
+ vramGb: external_exports.number().nonnegative()
48244
+ });
48245
+ var TrainingRegionOptionSchema = external_exports.object({
48246
+ /** `''` = any region (the provider's choice). */
48247
+ id: external_exports.string(),
48248
+ label: external_exports.string(),
48249
+ priceMultiplier: external_exports.number().positive()
48250
+ });
48251
+ var TrainingProviderDefaultsSchema = external_exports.object({
48252
+ gpuType: external_exports.string(),
48253
+ region: external_exports.string(),
48254
+ costCapUsd: external_exports.number().nonnegative(),
48255
+ maxRuntimeSec: external_exports.number().int().positive(),
48256
+ /** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
48257
+ failedDatasetGraceHours: external_exports.number().nonnegative()
48258
+ });
48259
+ var TrainingProviderDescriptorSchema = external_exports.object({
48260
+ addonId: external_exports.string(),
48261
+ /** `modal`, `runpod`, `fake`, … */
48262
+ kind: external_exports.string(),
48263
+ label: external_exports.string(),
48264
+ gpuTypes: external_exports.array(TrainingGpuOptionSchema).readonly(),
48265
+ regions: external_exports.array(TrainingRegionOptionSchema).readonly(),
48266
+ maxDatasetBytes: external_exports.number().int().positive(),
48267
+ maxRuntimeSec: external_exports.number().int().positive(),
48268
+ freeTierNote: external_exports.string().optional(),
48269
+ /** Where the data goes, in one sentence the confirm dialog repeats. */
48270
+ dataResidencyNote: external_exports.string(),
48271
+ /** Credentials are present — never the values. */
48272
+ configured: external_exports.boolean(),
48273
+ defaults: TrainingProviderDefaultsSchema
48274
+ });
48275
+ var TrainingCredentialCheckSchema = external_exports.object({
48276
+ ok: external_exports.boolean(),
48277
+ /** Workspace / account name, when the provider says. */
48278
+ account: external_exports.string().optional(),
48279
+ reason: external_exports.enum([
48280
+ "missing",
48281
+ "invalid",
48282
+ "forbidden",
48283
+ "network",
48284
+ "quota"
48285
+ ]).optional(),
48286
+ detail: external_exports.string().optional()
48287
+ });
48288
+ var ProviderJobStateSchema = external_exports.enum([
48289
+ "pending",
48290
+ "starting",
48291
+ "running",
48292
+ "succeeded",
48293
+ "failed",
48294
+ "cancelled",
48295
+ "lost"
48296
+ ]);
48297
+ var ProviderJobStatusSchema = external_exports.object({
48298
+ jobKey: external_exports.string(),
48299
+ providerJobId: external_exports.string().optional(),
48300
+ state: ProviderJobStateSchema,
48301
+ startedAt: external_exports.number().optional(),
48302
+ endedAt: external_exports.number().optional(),
48303
+ exitCode: external_exports.number().int().optional(),
48304
+ failureReason: external_exports.string().optional(),
48305
+ gpuType: external_exports.string(),
48306
+ region: external_exports.string().optional(),
48307
+ billedSeconds: external_exports.number().nonnegative(),
48308
+ costUsd: external_exports.number().nonnegative(),
48309
+ /** True when `costUsd` is runtime × list price, not a billing answer. */
48310
+ costIsEstimate: external_exports.boolean(),
48311
+ lastFetchedAt: external_exports.number()
48312
+ });
48313
+ var TrainerSourceRefSchema = external_exports.object({
48314
+ /** Hugging Face repo id, e.g. `camstack/camstack-trainer`. */
48315
+ repo: external_exports.string().min(1),
48316
+ /** A commit sha (never a branch) — the job must be reproducible. */
48317
+ revision: external_exports.string().regex(/^[0-9a-f]{7,64}$/)
48318
+ });
48319
+ var JobRef = {
48320
+ addonId: external_exports.string(),
48321
+ jobKey: external_exports.string().uuid()
48322
+ };
48323
+ var TrainingLogLineSchema = external_exports.object({
48324
+ ts: external_exports.number(),
48325
+ text: external_exports.string()
48326
+ });
48327
+ var trainingProviderCapability = {
48328
+ name: "training-provider",
48329
+ scope: "system",
48330
+ mode: "collection",
48331
+ internal: true,
48332
+ methods: {
48333
+ /** Every provider's offer and settings. Concat-fans across providers. */
48334
+ describe: method(external_exports.object({}), external_exports.array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }),
48335
+ /** Call the provider with the stored credentials. Never returns them. */
48336
+ validateCredentials: method(external_exports.object({ addonId: external_exports.string() }), TrainingCredentialCheckSchema, {
48337
+ kind: "mutation",
48338
+ auth: "admin",
48339
+ timeoutMs: 3e4
48340
+ }),
48341
+ /** USD range for a run of `gpuSeconds` on `gpuType` in `region`. */
48342
+ estimateJob: method(external_exports.object({
48343
+ addonId: external_exports.string(),
48344
+ gpuType: external_exports.string(),
48345
+ region: external_exports.string(),
48346
+ datasetBytes: external_exports.number().int().nonnegative(),
48347
+ gpuSecondsLow: external_exports.number().nonnegative(),
48348
+ gpuSecondsHigh: external_exports.number().nonnegative()
48349
+ }), external_exports.object({
48350
+ usdLow: external_exports.number().nonnegative(),
48351
+ usdHigh: external_exports.number().nonnegative(),
48352
+ notes: external_exports.array(external_exports.string()).readonly()
48353
+ }), { auth: "admin" }),
48354
+ /**
48355
+ * Take the dataset archive behind `ticket` (minted by pipeline-analytics,
48356
+ * same host) and land it as the job's dataset in the cloud, streamed —
48357
+ * nothing is staged on the hub's disk. Idempotent per `jobKey`: a second
48358
+ * call replaces a partial upload. Answers what actually landed.
48359
+ */
48360
+ uploadDataset: method(external_exports.object({
48361
+ ...JobRef,
48362
+ ticket: PeerBytesTicketSchema
48363
+ }), external_exports.object({
48364
+ bytes: external_exports.number().int().nonnegative(),
48365
+ sha256: external_exports.string()
48366
+ }), {
48367
+ kind: "mutation",
48368
+ auth: "admin",
48369
+ timeoutMs: 120 * 6e4
48370
+ }),
48371
+ /**
48372
+ * Start the trainer on a GPU. Looks the job up by `jobKey` first, so a
48373
+ * retried submit never starts a second GPU. `jobSpecJson` is written next
48374
+ * to the dataset as `job.json`; `maxRuntimeSec` is enforced by the
48375
+ * provider (a hard timeout), not by the hub.
48376
+ */
48377
+ submitJob: method(external_exports.object({
48378
+ ...JobRef,
48379
+ trainer: TrainerSourceRefSchema,
48380
+ jobSpecJson: external_exports.string().min(2).max(64e3),
48381
+ gpuType: external_exports.string(),
48382
+ region: external_exports.string(),
48383
+ maxRuntimeSec: external_exports.number().int().positive()
48384
+ }), ProviderJobStatusSchema, {
48385
+ kind: "mutation",
48386
+ auth: "admin",
48387
+ timeoutMs: 30 * 6e4
48388
+ }),
48389
+ getJob: method(external_exports.object(JobRef), ProviderJobStatusSchema, {
48390
+ auth: "admin",
48391
+ timeoutMs: 6e4
48392
+ }),
48393
+ /** Stdout/stderr since `cursor` (opaque), oldest first, at most `max` lines. */
48394
+ listJobEvents: method(external_exports.object({
48395
+ ...JobRef,
48396
+ cursor: external_exports.string().optional(),
48397
+ max: external_exports.number().int().min(1).max(500)
48398
+ }), external_exports.object({
48399
+ lines: external_exports.array(TrainingLogLineSchema).readonly(),
48400
+ cursor: external_exports.string()
48401
+ }), {
48402
+ auth: "admin",
48403
+ timeoutMs: 6e4
48404
+ }),
48405
+ /** Stop the job. Idempotent: an unknown or finished job is a no-op. */
48406
+ cancelJob: method(external_exports.object(JobRef), external_exports.object({ ok: external_exports.literal(true) }), {
48407
+ kind: "mutation",
48408
+ auth: "admin",
48409
+ timeoutMs: 6e4
48410
+ }),
48411
+ /** The job's `result.json`, as text (small, JSON). `found: false` before it exists. */
48412
+ readResult: method(external_exports.object(JobRef), external_exports.object({
48413
+ found: external_exports.boolean(),
48414
+ text: external_exports.string().optional()
48415
+ }), {
48416
+ kind: "mutation",
48417
+ auth: "admin",
48418
+ timeoutMs: 5 * 6e4
48419
+ }),
48420
+ /**
48421
+ * Offer one output file of the job (`bundle.tar`) to the caller as a
48422
+ * one-shot `ctx.peerBytes` ticket, streamed from the cloud — the provider
48423
+ * stages nothing on disk. The caller dials it at once.
48424
+ */
48425
+ offerArtifact: method(external_exports.object({
48426
+ ...JobRef,
48427
+ path: external_exports.enum(["bundle.tar"])
48428
+ }), external_exports.object({ ticket: PeerBytesTicketSchema }), {
48429
+ kind: "mutation",
48430
+ auth: "admin",
48431
+ timeoutMs: 5 * 6e4
48432
+ }),
48433
+ /** Delete every cloud object tagged with `jobKey` (the dataset first). Idempotent. */
48434
+ cleanupJob: method(external_exports.object(JobRef), external_exports.object({ deleted: external_exports.array(external_exports.string()).readonly() }), {
48435
+ kind: "mutation",
48436
+ auth: "admin",
48437
+ timeoutMs: 5 * 6e4
48438
+ }),
48439
+ /** Every job the provider can still see — the orphan sweep diffs it against our records. */
48440
+ listJobs: method(external_exports.object({ addonId: external_exports.string() }), external_exports.array(ProviderJobStatusSchema).readonly(), {
48441
+ auth: "admin",
48442
+ timeoutMs: 2 * 6e4
48443
+ })
48444
+ }
48445
+ };
48446
+ var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: external_exports.array(external_exports.string()).max(2e4).readonly() });
48447
+ var TrainingBaseModelSchema = external_exports.object({
48448
+ modelId: external_exports.string(),
48449
+ label: external_exports.string(),
48450
+ weights: external_exports.string(),
48451
+ imgsz: external_exports.number().int(),
48452
+ baselineOnnxUrl: external_exports.string(),
48453
+ baselineFloors: external_exports.record(external_exports.string(), external_exports.number()),
48454
+ /** The base the fleet runs most — the UI's default. */
48455
+ recommended: external_exports.boolean()
48456
+ });
48457
+ var TrainingPresetSchema = external_exports.enum([
48458
+ "quick",
48459
+ "standard",
48460
+ "thorough"
48461
+ ]);
48462
+ var TrainingJobRequestSchema = external_exports.object({
48463
+ datasetVersionId: external_exports.string().min(1),
48464
+ /** The `training-provider` addon that runs it. */
48465
+ addonId: external_exports.string().min(1),
48466
+ gpuType: external_exports.string().min(1),
48467
+ region: external_exports.string(),
48468
+ baseModelId: external_exports.string().min(1),
48469
+ preset: TrainingPresetSchema,
48470
+ /** Freeze the backbone's first N layers; `null` = the preset's choice. */
48471
+ freeze: external_exports.number().int().nonnegative().nullable(),
48472
+ /** Cameras held out whole for evaluation; `null` = the orchestrator's default. */
48473
+ holdoutCameras: external_exports.array(external_exports.number().int()).nullable()
48474
+ });
48475
+ var TrainingSplitPlanSchema = external_exports.object({
48476
+ holdoutCameras: external_exports.array(external_exports.number().int()).readonly(),
48477
+ /** Used when no camera is held out: the last N days of every camera. */
48478
+ holdoutLastDays: external_exports.number().int().nonnegative(),
48479
+ /** Holdout subjects per class (camera holdout only; `null` = known only after the split). */
48480
+ holdoutSupport: external_exports.record(external_exports.string(), external_exports.number().int()).nullable(),
48481
+ trainSubjects: external_exports.number().int()
48482
+ });
48483
+ var TrainingRefusalReasonSchema = external_exports.enum([
48484
+ "unknown-dataset",
48485
+ "unknown-provider",
48486
+ "provider-not-configured",
48487
+ "unknown-base-model",
48488
+ "unknown-gpu",
48489
+ "dataset-too-large",
48490
+ "no-training-subjects",
48491
+ "job-already-running"
48492
+ ]);
48493
+ var TrainingJobPlanSchema = external_exports.object({
48494
+ refusal: external_exports.object({
48495
+ reason: TrainingRefusalReasonSchema,
48496
+ detail: external_exports.string()
48497
+ }).nullable(),
48498
+ warnings: external_exports.array(external_exports.string()).readonly(),
48499
+ split: TrainingSplitPlanSchema.nullable(),
48500
+ estimate: external_exports.object({
48501
+ datasetBytes: external_exports.number().int(),
48502
+ uploadMinutesAt20Mbps: external_exports.number(),
48503
+ gpuSecondsLow: external_exports.number(),
48504
+ gpuSecondsHigh: external_exports.number(),
48505
+ usdLow: external_exports.number(),
48506
+ usdHigh: external_exports.number(),
48507
+ notes: external_exports.array(external_exports.string()).readonly()
48508
+ }).nullable(),
48509
+ /** Pre-filled from the provider's settings; the operator may lower or raise them. */
48510
+ defaults: external_exports.object({
48511
+ maxCostUsd: external_exports.number(),
48512
+ maxRuntimeSec: external_exports.number().int()
48513
+ }).nullable(),
48514
+ /** The sentence the confirm dialog repeats: where the frames go and when they are deleted. */
48515
+ dataNotice: external_exports.string()
48516
+ });
48517
+ var TrainingJobStateSchema = external_exports.enum([
48518
+ "uploading",
48519
+ "submitted",
48520
+ "starting",
48521
+ "running",
48522
+ "collecting",
48523
+ "ready",
48524
+ "registered",
48525
+ "canary",
48526
+ "failed",
48527
+ "cancelling",
48528
+ "cancelled",
48529
+ "lost",
48530
+ "expired",
48531
+ "discarded"
48532
+ ]);
48533
+ var TrainingFailureReasonSchema = external_exports.enum([
48534
+ "cost-cap",
48535
+ "runtime-cap",
48536
+ "upload-failed",
48537
+ "submit-failed",
48538
+ "trainer-failed",
48539
+ "result-invalid",
48540
+ "checksum-mismatch",
48541
+ "fetch-failed",
48542
+ "provider-error",
48543
+ "hub-restart-during-upload"
48544
+ ]);
48545
+ var TrainingProgressPointSchema = external_exports.object({
48546
+ epoch: external_exports.number().int(),
48547
+ map50: external_exports.number().nullable(),
48548
+ map50_95: external_exports.number().nullable()
48549
+ });
48550
+ var TrainingCanarySchema = external_exports.object({
48551
+ deviceIds: external_exports.array(external_exports.number().int()).readonly(),
48552
+ since: external_exports.number(),
48553
+ /** Every override the canary replaced, exactly, so rollback restores it. */
48554
+ previous: external_exports.array(external_exports.object({
48555
+ deviceId: external_exports.number().int(),
48556
+ nodeId: external_exports.string(),
48557
+ deviceKey: external_exports.string(),
48558
+ patch: external_exports.object({
48559
+ modelId: external_exports.string().optional(),
48560
+ settings: external_exports.record(external_exports.string(), external_exports.unknown()).readonly().optional()
48561
+ }).nullable()
48562
+ })).readonly()
48563
+ });
48564
+ var TrainingJobSchema = external_exports.object({
48565
+ id: external_exports.string(),
48566
+ idempotencyKey: external_exports.string(),
48567
+ name: external_exports.string(),
48568
+ createdAt: external_exports.number(),
48569
+ updatedAt: external_exports.number(),
48570
+ state: TrainingJobStateSchema,
48571
+ stage: TrainingStageSchema.nullable(),
48572
+ failure: external_exports.object({
48573
+ reason: TrainingFailureReasonSchema,
48574
+ stage: external_exports.string().nullable(),
48575
+ detail: external_exports.string()
48576
+ }).nullable(),
48577
+ request: TrainingJobRequestSchema,
48578
+ maxCostUsd: external_exports.number().nonnegative(),
48579
+ maxRuntimeSec: external_exports.number().int().positive(),
48580
+ trainer: TrainerSourceRefSchema,
48581
+ datasetLayout: RetrainExportLayoutSchema,
48582
+ dataset: external_exports.object({
48583
+ bytes: external_exports.number().int(),
48584
+ sha256: external_exports.string(),
48585
+ uploadedAt: external_exports.number()
48586
+ }).nullable(),
48587
+ split: TrainingSplitPlanSchema,
48588
+ provider: external_exports.object({
48589
+ state: ProviderJobStateSchema.nullable(),
48590
+ providerJobId: external_exports.string().nullable(),
48591
+ startedAt: external_exports.number().nullable(),
48592
+ endedAt: external_exports.number().nullable(),
48593
+ billedSeconds: external_exports.number(),
48594
+ costUsd: external_exports.number(),
48595
+ costIsEstimate: external_exports.boolean(),
48596
+ lastPolledAt: external_exports.number().nullable()
48597
+ }),
48598
+ progress: external_exports.object({
48599
+ epoch: external_exports.number().int().nullable(),
48600
+ epochs: external_exports.number().int().nullable(),
48601
+ etaSec: external_exports.number().nullable(),
48602
+ series: external_exports.array(TrainingProgressPointSchema).readonly()
48603
+ }),
48604
+ /** The last lines of the job's output (≤ 200), newest last. Never frame paths. */
48605
+ logTail: external_exports.array(external_exports.string()).readonly(),
48606
+ logCursor: external_exports.string().nullable(),
48607
+ artifacts: external_exports.object({
48608
+ bundleBytes: external_exports.number().int(),
48609
+ bundleSha256: external_exports.string(),
48610
+ fetchedAt: external_exports.number(),
48611
+ /** When the staged artefacts are deleted from the hub. */
48612
+ expiresAt: external_exports.number()
48613
+ }).nullable(),
48614
+ /** When the provider-side copy of the frames was deleted; null while it exists. */
48615
+ cloudDatasetDeletedAt: external_exports.number().nullable(),
48616
+ /** A failed job's dataset is kept until then (the provider's grace), then deleted. */
48617
+ cloudCleanupDueAt: external_exports.number().nullable(),
48618
+ /** Model ids registered from this job (base, and int8 when kept). */
48619
+ registeredModelIds: external_exports.array(external_exports.string()).readonly(),
48620
+ canary: TrainingCanarySchema.nullable()
48621
+ });
48622
+ var IdInput = external_exports.object({ id: external_exports.string().min(1) });
48623
+ var trainingCapability = {
48624
+ name: "training",
48625
+ scope: "system",
48626
+ mode: "singleton",
48627
+ mount: { kind: "hub-only" },
48628
+ methods: {
48629
+ /** Store a version once. `stored: false` = that id already exists (immutable). */
48630
+ putDatasetVersion: method(TrainingDatasetVersionRowSchema, external_exports.object({ stored: external_exports.boolean() }), {
48631
+ kind: "mutation",
48632
+ auth: "admin"
48633
+ }),
48634
+ getDatasetVersion: method(IdInput, TrainingDatasetVersionRowSchema.nullable(), { auth: "admin" }),
48635
+ /** Every version without its frame list, newest first. */
48636
+ listDatasetVersions: method(external_exports.object({}), external_exports.array(RetrainDatasetVersionSchema).readonly(), { auth: "admin" }),
48637
+ findDatasetVersionIdByName: method(external_exports.object({ name: external_exports.string() }), external_exports.object({ id: external_exports.string().nullable() }), { auth: "admin" }),
48638
+ removeDatasetVersion: method(IdInput, external_exports.object({ removed: external_exports.boolean() }), {
48639
+ kind: "mutation",
48640
+ auth: "admin"
48641
+ }),
48642
+ listBaseModels: method(external_exports.object({}), external_exports.array(TrainingBaseModelSchema).readonly(), { auth: "admin" }),
48643
+ /** Split, estimate, defaults and any named refusal — nothing is started. */
48644
+ planJob: method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
48645
+ auth: "admin",
48646
+ timeoutMs: 6e4
48647
+ }),
48648
+ /**
48649
+ * Start a job. The same `idempotencyKey` returns the job it already
48650
+ * started. Answers at once (`uploading`); the upload and the submit run in
48651
+ * the background and the job record says how far they got.
48652
+ */
48653
+ startJob: method(TrainingJobRequestSchema.extend({
48654
+ name: external_exports.string().min(1).max(120),
48655
+ maxCostUsd: external_exports.number().positive(),
48656
+ maxRuntimeSec: external_exports.number().int().positive(),
48657
+ idempotencyKey: external_exports.string().min(8).max(80)
48658
+ }), external_exports.discriminatedUnion("kind", [external_exports.object({
48659
+ kind: external_exports.literal("started"),
48660
+ job: TrainingJobSchema
48661
+ }), external_exports.object({
48662
+ kind: external_exports.literal("refused"),
48663
+ reason: TrainingRefusalReasonSchema,
48664
+ detail: external_exports.string()
48665
+ })]), {
48666
+ kind: "mutation",
48667
+ auth: "admin",
48668
+ timeoutMs: 12e4
48669
+ }),
48670
+ listJobs: method(external_exports.object({}), external_exports.array(TrainingJobSchema).readonly(), { auth: "admin" }),
48671
+ getJob: method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }),
48672
+ cancelJob: method(IdInput, TrainingJobSchema, {
48673
+ kind: "mutation",
48674
+ auth: "admin",
48675
+ timeoutMs: 12e4
48676
+ }),
48677
+ /** The verified `result.json` of a job in `ready` or later; null before. */
48678
+ getJobResult: method(IdInput, TrainingResultSchema.nullable(), { auth: "admin" }),
48679
+ /** Hand the verified bundle to Model Studio; optionally canary right after. */
48680
+ registerResult: method(IdInput.extend({ canaryDeviceIds: external_exports.array(external_exports.number().int()).readonly() }), TrainingJobSchema, {
48681
+ kind: "mutation",
48682
+ auth: "admin",
48683
+ timeoutMs: 30 * 6e4
48684
+ }),
48685
+ /** Pin the registered model on these cameras, remembering what it replaced. */
48686
+ canaryResult: method(IdInput.extend({ deviceIds: external_exports.array(external_exports.number().int()).min(1).readonly() }), TrainingJobSchema, {
48687
+ kind: "mutation",
48688
+ auth: "admin",
48689
+ timeoutMs: 12e4
48690
+ }),
48691
+ /** Put every canary camera back exactly as it was. */
48692
+ rollbackCanary: method(IdInput, TrainingJobSchema, {
48693
+ kind: "mutation",
48694
+ auth: "admin",
48695
+ timeoutMs: 12e4
48696
+ }),
48697
+ /** Delete the staged artefacts of an unregistered result. */
48698
+ discardResult: method(IdInput, TrainingJobSchema, {
48699
+ kind: "mutation",
48700
+ auth: "admin"
48701
+ })
48702
+ }
48703
+ };
47818
48704
  var PIPELINE_FLOW_CAPABILITY_NAMES = [
47819
48705
  "decoder",
47820
48706
  "motion-detection",
@@ -48694,6 +49580,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
48694
49580
  addonId: null,
48695
49581
  access: "create"
48696
49582
  },
49583
+ "backup.checkBackupKey": {
49584
+ capName: "backup",
49585
+ capScope: "system",
49586
+ addonId: null,
49587
+ access: "create"
49588
+ },
48697
49589
  "backup.delete": {
48698
49590
  capName: "backup",
48699
49591
  capScope: "system",
@@ -48706,6 +49598,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
48706
49598
  addonId: null,
48707
49599
  access: "delete"
48708
49600
  },
49601
+ "backup.disableEncryption": {
49602
+ capName: "backup",
49603
+ capScope: "system",
49604
+ addonId: null,
49605
+ access: "create"
49606
+ },
49607
+ "backup.getEncryption": {
49608
+ capName: "backup",
49609
+ capScope: "system",
49610
+ addonId: null,
49611
+ access: "view"
49612
+ },
48709
49613
  "backup.getEntries": {
48710
49614
  capName: "backup",
48711
49615
  capScope: "system",
@@ -48760,6 +49664,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
48760
49664
  addonId: null,
48761
49665
  access: "create"
48762
49666
  },
49667
+ "backup.setupEncryption": {
49668
+ capName: "backup",
49669
+ capScope: "system",
49670
+ addonId: null,
49671
+ access: "create"
49672
+ },
48763
49673
  "backup.trigger": {
48764
49674
  capName: "backup",
48765
49675
  capScope: "system",
@@ -49312,6 +50222,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
49312
50222
  addonId: null,
49313
50223
  access: "create"
49314
50224
  },
50225
+ "customModelRegistry.importModelBundle": {
50226
+ capName: "custom-model-registry",
50227
+ capScope: "system",
50228
+ addonId: null,
50229
+ access: "create"
50230
+ },
49315
50231
  "customModelRegistry.listModels": {
49316
50232
  capName: "custom-model-registry",
49317
50233
  capScope: "system",
@@ -50752,6 +51668,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
50752
51668
  addonId: null,
50753
51669
  access: "view"
50754
51670
  },
51671
+ "keychainAdmin.acknowledgeReset": {
51672
+ capName: "keychain-admin",
51673
+ capScope: "system",
51674
+ addonId: null,
51675
+ access: "create"
51676
+ },
50755
51677
  "keychainAdmin.deleteOrphans": {
50756
51678
  capName: "keychain-admin",
50757
51679
  capScope: "system",
@@ -50788,6 +51710,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
50788
51710
  addonId: null,
50789
51711
  access: "delete"
50790
51712
  },
51713
+ "keychainAdmin.resetReport": {
51714
+ capName: "keychain-admin",
51715
+ capScope: "system",
51716
+ addonId: null,
51717
+ access: "delete"
51718
+ },
50791
51719
  "keychainAdmin.reveal": {
50792
51720
  capName: "keychain-admin",
50793
51721
  capScope: "system",
@@ -52534,6 +53462,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
52534
53462
  addonId: null,
52535
53463
  access: "view"
52536
53464
  },
53465
+ "pipelineAnalytics.offerRetrainArchive": {
53466
+ capName: "pipeline-analytics",
53467
+ capScope: "device",
53468
+ addonId: null,
53469
+ access: "create"
53470
+ },
52537
53471
  "pipelineAnalytics.ownersWithMedia": {
52538
53472
  capName: "pipeline-analytics",
52539
53473
  capScope: "device",
@@ -55072,6 +56006,174 @@ var METHOD_ACCESS_MAP = Object.freeze({
55072
56006
  addonId: null,
55073
56007
  access: "view"
55074
56008
  },
56009
+ "training.canaryResult": {
56010
+ capName: "training",
56011
+ capScope: "system",
56012
+ addonId: null,
56013
+ access: "create"
56014
+ },
56015
+ "training.cancelJob": {
56016
+ capName: "training",
56017
+ capScope: "system",
56018
+ addonId: null,
56019
+ access: "create"
56020
+ },
56021
+ "training.discardResult": {
56022
+ capName: "training",
56023
+ capScope: "system",
56024
+ addonId: null,
56025
+ access: "create"
56026
+ },
56027
+ "training.findDatasetVersionIdByName": {
56028
+ capName: "training",
56029
+ capScope: "system",
56030
+ addonId: null,
56031
+ access: "view"
56032
+ },
56033
+ "training.getDatasetVersion": {
56034
+ capName: "training",
56035
+ capScope: "system",
56036
+ addonId: null,
56037
+ access: "view"
56038
+ },
56039
+ "training.getJob": {
56040
+ capName: "training",
56041
+ capScope: "system",
56042
+ addonId: null,
56043
+ access: "view"
56044
+ },
56045
+ "training.getJobResult": {
56046
+ capName: "training",
56047
+ capScope: "system",
56048
+ addonId: null,
56049
+ access: "view"
56050
+ },
56051
+ "training.listBaseModels": {
56052
+ capName: "training",
56053
+ capScope: "system",
56054
+ addonId: null,
56055
+ access: "view"
56056
+ },
56057
+ "training.listDatasetVersions": {
56058
+ capName: "training",
56059
+ capScope: "system",
56060
+ addonId: null,
56061
+ access: "view"
56062
+ },
56063
+ "training.listJobs": {
56064
+ capName: "training",
56065
+ capScope: "system",
56066
+ addonId: null,
56067
+ access: "view"
56068
+ },
56069
+ "training.planJob": {
56070
+ capName: "training",
56071
+ capScope: "system",
56072
+ addonId: null,
56073
+ access: "view"
56074
+ },
56075
+ "training.putDatasetVersion": {
56076
+ capName: "training",
56077
+ capScope: "system",
56078
+ addonId: null,
56079
+ access: "create"
56080
+ },
56081
+ "training.registerResult": {
56082
+ capName: "training",
56083
+ capScope: "system",
56084
+ addonId: null,
56085
+ access: "create"
56086
+ },
56087
+ "training.removeDatasetVersion": {
56088
+ capName: "training",
56089
+ capScope: "system",
56090
+ addonId: null,
56091
+ access: "delete"
56092
+ },
56093
+ "training.rollbackCanary": {
56094
+ capName: "training",
56095
+ capScope: "system",
56096
+ addonId: null,
56097
+ access: "create"
56098
+ },
56099
+ "training.startJob": {
56100
+ capName: "training",
56101
+ capScope: "system",
56102
+ addonId: null,
56103
+ access: "create"
56104
+ },
56105
+ "trainingProvider.cancelJob": {
56106
+ capName: "training-provider",
56107
+ capScope: "system",
56108
+ addonId: null,
56109
+ access: "create"
56110
+ },
56111
+ "trainingProvider.cleanupJob": {
56112
+ capName: "training-provider",
56113
+ capScope: "system",
56114
+ addonId: null,
56115
+ access: "create"
56116
+ },
56117
+ "trainingProvider.describe": {
56118
+ capName: "training-provider",
56119
+ capScope: "system",
56120
+ addonId: null,
56121
+ access: "view"
56122
+ },
56123
+ "trainingProvider.estimateJob": {
56124
+ capName: "training-provider",
56125
+ capScope: "system",
56126
+ addonId: null,
56127
+ access: "view"
56128
+ },
56129
+ "trainingProvider.getJob": {
56130
+ capName: "training-provider",
56131
+ capScope: "system",
56132
+ addonId: null,
56133
+ access: "view"
56134
+ },
56135
+ "trainingProvider.listJobEvents": {
56136
+ capName: "training-provider",
56137
+ capScope: "system",
56138
+ addonId: null,
56139
+ access: "view"
56140
+ },
56141
+ "trainingProvider.listJobs": {
56142
+ capName: "training-provider",
56143
+ capScope: "system",
56144
+ addonId: null,
56145
+ access: "view"
56146
+ },
56147
+ "trainingProvider.offerArtifact": {
56148
+ capName: "training-provider",
56149
+ capScope: "system",
56150
+ addonId: null,
56151
+ access: "create"
56152
+ },
56153
+ "trainingProvider.readResult": {
56154
+ capName: "training-provider",
56155
+ capScope: "system",
56156
+ addonId: null,
56157
+ access: "create"
56158
+ },
56159
+ "trainingProvider.submitJob": {
56160
+ capName: "training-provider",
56161
+ capScope: "system",
56162
+ addonId: null,
56163
+ access: "create"
56164
+ },
56165
+ "trainingProvider.uploadDataset": {
56166
+ capName: "training-provider",
56167
+ capScope: "system",
56168
+ addonId: null,
56169
+ access: "create"
56170
+ },
56171
+ "trainingProvider.validateCredentials": {
56172
+ capName: "training-provider",
56173
+ capScope: "system",
56174
+ addonId: null,
56175
+ access: "create"
56176
+ },
55075
56177
  "turnProvider.getTurnServers": {
55076
56178
  capName: "turn-provider",
55077
56179
  capScope: "system",
@@ -55096,12 +56198,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55096
56198
  addonId: null,
55097
56199
  access: "create"
55098
56200
  },
55099
- "userManagement.createApiKey": {
55100
- capName: "user-management",
55101
- capScope: "system",
55102
- addonId: null,
55103
- access: "create"
55104
- },
55105
56201
  "userManagement.createScopedToken": {
55106
56202
  capName: "user-management",
55107
56203
  capScope: "system",
@@ -55138,12 +56234,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55138
56234
  addonId: null,
55139
56235
  access: "view"
55140
56236
  },
55141
- "userManagement.linkExternalIdentity": {
55142
- capName: "user-management",
55143
- capScope: "system",
55144
- addonId: null,
55145
- access: "create"
55146
- },
55147
56237
  "userManagement.listApiKeys": {
55148
56238
  capName: "user-management",
55149
56239
  capScope: "system",
@@ -55246,12 +56336,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55246
56336
  addonId: null,
55247
56337
  access: "create"
55248
56338
  },
55249
- "userManagement.validateApiKey": {
55250
- capName: "user-management",
55251
- capScope: "system",
55252
- addonId: null,
55253
- access: "view"
55254
- },
55255
56339
  "userManagement.validateCredentials": {
55256
56340
  capName: "user-management",
55257
56341
  capScope: "system",
@@ -59407,6 +60491,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
59407
60491
  form: "single",
59408
60492
  optional: false
59409
60493
  }],
60494
+ "training.canaryResult": [{
60495
+ name: "deviceIds",
60496
+ form: "array",
60497
+ optional: false
60498
+ }],
59410
60499
  "update.getStatus": [{
59411
60500
  name: "deviceId",
59412
60501
  form: "single",