@camstack/system 1.2.393 → 1.2.394

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.
Files changed (75) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/addon-utils.js +1 -1
  4. package/dist/addon-utils.mjs +1 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/dist/builtins/autotrack/index.js +1 -1
  12. package/dist/builtins/autotrack/index.mjs +1 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/dist/builtins/camera-grid/index.js +1 -1
  18. package/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/dist/builtins/composer/composer.addon.js +2 -2
  20. package/dist/builtins/composer/composer.addon.mjs +2 -2
  21. package/dist/builtins/console-logging/index.js +1 -1
  22. package/dist/builtins/console-logging/index.mjs +1 -1
  23. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  24. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  25. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  26. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  27. package/dist/builtins/hub-forwarder/index.js +1 -1
  28. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  29. package/dist/builtins/keychain/index.js +3 -3
  30. package/dist/builtins/keychain/index.mjs +3 -3
  31. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  32. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  33. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  34. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  35. package/dist/builtins/local-network/local-network.addon.js +1 -1
  36. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  37. package/dist/builtins/loki-logging/index.js +1 -1
  38. package/dist/builtins/loki-logging/index.mjs +1 -1
  39. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  40. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  41. package/dist/builtins/platform-probe/index.js +1 -1
  42. package/dist/builtins/platform-probe/index.mjs +1 -1
  43. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  44. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  45. package/dist/builtins/snapshot/index.js +1 -1
  46. package/dist/builtins/snapshot/index.mjs +1 -1
  47. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  48. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  49. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  50. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  51. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  52. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  53. package/dist/builtins/system-config/system-config.addon.js +2 -2
  54. package/dist/builtins/system-config/system-config.addon.mjs +2 -2
  55. package/dist/builtins/winston-logging/index.js +1 -1
  56. package/dist/builtins/winston-logging/index.mjs +1 -1
  57. package/dist/{child-cap-dispatch-jQ61bSnU.js → child-cap-dispatch-CPx0qbCF.js} +1 -1
  58. package/dist/{child-cap-dispatch-BmNpRe0Y.mjs → child-cap-dispatch-CvXtuNaX.mjs} +1 -1
  59. package/dist/{composition-sources-CmcKAYMz.mjs → composition-sources-BuRXx2gs.mjs} +1 -1
  60. package/dist/{composition-sources-YkkhpPDx.js → composition-sources-CvpibBxI.js} +1 -1
  61. package/dist/{constants-DyC3WyXE.js → constants-Bz9gKWe8.js} +1 -1
  62. package/dist/{constants-Ca1v1Sdn.mjs → constants-C1WoQ0E8.mjs} +1 -1
  63. package/dist/{dist-BIc6o_mz.mjs → dist-0P1gm4Gd.mjs} +296 -157
  64. package/dist/{dist-D_jdr1G9.js → dist-CME5sVBJ.js} +296 -157
  65. package/dist/{event-loop-stall-monitor-r2ZBISpC.mjs → event-loop-stall-monitor-BHtIKJY2.mjs} +1 -1
  66. package/dist/{event-loop-stall-monitor-DXZb28pF.js → event-loop-stall-monitor-BawH8L8C.js} +1 -1
  67. package/dist/index.js +6 -6
  68. package/dist/index.mjs +6 -6
  69. package/dist/{jwt-signing-key-CQHHsrOf.js → jwt-signing-key-CyoJaT3C.js} +1 -1
  70. package/dist/{jwt-signing-key-BtfOMVyB.mjs → jwt-signing-key-DK-IFI9j.mjs} +1 -1
  71. package/dist/{restore-archive-CKcdqHk5.mjs → restore-archive-0g91qMVF.mjs} +1 -1
  72. package/dist/{restore-archive-BQSveGIo.js → restore-archive-K6kI-oPI.js} +1 -1
  73. package/dist/{retired-settings-keys-DoY1sb0U.js → retired-settings-keys-Db41_d9H.js} +1 -1
  74. package/dist/{retired-settings-keys-5x91Vz3i.mjs → retired-settings-keys-PrO5jugN.mjs} +1 -1
  75. package/package.json +1 -1
@@ -708,7 +708,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
708
708
  return EventCategory;
709
709
  }({});
710
710
  //#endregion
711
- //#region ../types/dist/sleep-r3RWkGVx.mjs
711
+ //#region ../types/dist/sleep-CI0n5D44.mjs
712
712
  /**
713
713
  * The audio chunk plane's byte format, and the ONE expansion from a coded
714
714
  * window to float samples (D455).
@@ -6425,6 +6425,16 @@ function featureFieldEntries(feature, arrayPath = COMPOSITION_ITEM_ARRAY_PATH) {
6425
6425
  function featureSources(feature) {
6426
6426
  return featureFieldEntries(feature).map((e) => e.source);
6427
6427
  }
6428
+ var NodeColorIdSchema = z.enum([
6429
+ "node-a",
6430
+ "node-b",
6431
+ "node-c",
6432
+ "node-d",
6433
+ "node-e",
6434
+ "node-f",
6435
+ "node-g",
6436
+ "node-h"
6437
+ ]);
6428
6438
  new Set([
6429
6439
  "track",
6430
6440
  "face",
@@ -26285,24 +26295,75 @@ var RetrainFrameListSchema = z.object({
26285
26295
  /** What the page pre-selects — the native key frame when one survives. */
26286
26296
  autoPickMediaId: z.number().int().optional()
26287
26297
  });
26298
+ /** Exclusive partition of a corpus copy's annotation progress (design §4.2). */
26299
+ var RetrainFrameWorkStateSchema = z.enum([
26300
+ "unannotated",
26301
+ "annotated",
26302
+ "complete"
26303
+ ]);
26304
+ /**
26305
+ * Filters for paginated corpus list, KPI, and matching export (design §4.4).
26306
+ * Every narrowing field is ANDed; omitted fields impose no constraint.
26307
+ */
26308
+ var RetrainCorpusFilterSchema = z.object({
26309
+ workState: RetrainFrameWorkStateSchema.optional(),
26310
+ deviceIds: z.array(z.number()).max(500).optional(),
26311
+ /** When set, only frames in this named collection. */
26312
+ collectionId: z.string().optional(),
26313
+ /** Frames that carry at least one saved annotation in one of these classes. */
26314
+ classes: z.array(RetrainMacroClassSchema).optional(),
26315
+ page: z.number().int().positive().default(1),
26316
+ pageSize: z.number().int().positive().max(100).default(50)
26317
+ });
26318
+ /**
26319
+ * One row on the Frames corpus grid: a wire frame plus its exclusive work
26320
+ * state (`workStateOf`), so the UI can badge To do / In progress / Complete
26321
+ * when the filter is All (annotation counts are not otherwise on the wire).
26322
+ */
26323
+ var RetrainCorpusPageFrameSchema = RetrainFrameSchema.extend({ workState: RetrainFrameWorkStateSchema });
26324
+ var RetrainCorpusPageSchema = z.object({
26325
+ frames: z.array(RetrainCorpusPageFrameSchema).readonly(),
26326
+ total: z.number().int().nonnegative(),
26327
+ page: z.number().int().positive(),
26328
+ pageSize: z.number().int().positive()
26329
+ });
26330
+ var RetrainCorpusKpiCameraRowSchema = z.object({
26331
+ deviceId: z.number(),
26332
+ unannotated: z.number().int().nonnegative(),
26333
+ annotated: z.number().int().nonnegative(),
26334
+ complete: z.number().int().nonnegative(),
26335
+ /** This camera's `complete` count divided by corpus `total`, in `[0,1]`.
26336
+ * `null` when the corpus is empty (no ratio). */
26337
+ pctOfCorpus: z.number().min(0).max(1).nullable()
26338
+ });
26339
+ var RetrainCorpusKpiSchema = z.object({
26340
+ total: z.number().int().nonnegative(),
26341
+ unannotated: z.number().int().nonnegative(),
26342
+ annotated: z.number().int().nonnegative(),
26343
+ complete: z.number().int().nonnegative(),
26344
+ cameras: z.array(RetrainCorpusKpiCameraRowSchema).readonly()
26345
+ });
26288
26346
  /**
26289
26347
  * Which frames an annotated export carries. Every field narrows; an empty
26290
- * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
26291
- * list owned by whoever trains (the training orchestrator), so `frameIds` is
26292
- * the primitive a version export uses; `batchId` re-selects what an earlier
26293
- * export carried (`exportedInBatch`).
26348
+ * filter is every annotated copy. `frameIds` is the primitive a job or
26349
+ * download uses; `batchId` re-selects what an earlier export carried
26350
+ * (`exportedInBatch`). Frozen dataset versions were removed — live selection
26351
+ * resolves to `frameIds` at plan/start.
26294
26352
  */
26295
26353
  var RetrainExportFilterSchema = z.object({
26296
26354
  deviceIds: z.array(z.number()).optional(),
26297
26355
  frameIds: z.array(z.string()).max(2e4).optional(),
26298
26356
  /** Only frames in at least one of these named collections. */
26299
26357
  collectionIds: z.array(z.string()).max(200).optional(),
26300
- /** Exactly the frames of this dataset version (and its completeOnly). An
26301
- * unknown id selects nothing. */
26302
- datasetVersionId: z.string().optional(),
26358
+ /** Single collection (Frames filter bar). ANDed with `collectionIds` when both set. */
26359
+ collectionId: z.string().optional(),
26303
26360
  batchId: z.string().optional(),
26304
26361
  /** Only frames the operator marked complete (all subjects boxed). */
26305
- completeOnly: z.boolean().optional()
26362
+ completeOnly: z.boolean().optional(),
26363
+ /** Exclusive work-state partition (`workStateOf`); same as the corpus list. */
26364
+ workState: RetrainFrameWorkStateSchema.optional(),
26365
+ /** Frames with at least one saved annotation in one of these classes. */
26366
+ classes: z.array(RetrainMacroClassSchema).optional()
26306
26367
  });
26307
26368
  /**
26308
26369
  * `frames`: the full frame copies, boxes in `annotations.json`.
@@ -26502,8 +26563,7 @@ var RetrainDatasetStatsSchema = z.object({
26502
26563
  completeFrames: z.number().int()
26503
26564
  })).readonly()
26504
26565
  });
26505
- /** An immutable dataset version, without its frame list. */
26506
- var RetrainDatasetVersionSchema = z.object({
26566
+ z.object({
26507
26567
  id: z.string(),
26508
26568
  name: z.string(),
26509
26569
  createdAt: z.number(),
@@ -26511,22 +26571,33 @@ var RetrainDatasetVersionSchema = z.object({
26511
26571
  layout: RetrainExportLayoutSchema,
26512
26572
  completeOnly: z.boolean(),
26513
26573
  frameCount: z.number().int(),
26514
- /** sha256 of what the frames taught when the version was frozen. */
26515
26574
  annotationHash: z.string(),
26516
- /** The export manifest schema the version was cut under. */
26517
26575
  manifestSchema: z.string(),
26518
26576
  stats: RetrainDatasetStatsSchema
26519
26577
  });
26520
- var CreateRetrainDatasetVersionResultSchema = z.discriminatedUnion("kind", [z.object({
26521
- kind: z.literal("created"),
26522
- version: RetrainDatasetVersionSchema
26578
+ /**
26579
+ * Live training corpus criteria — same shape as `TrainingCorpusSelection` on
26580
+ * the training cap. Resolved here so plan/start and the annotated export share
26581
+ * one definition of "the frames" (`buildRetrainExportPlan`).
26582
+ */
26583
+ var RetrainTrainingCorpusSelectionSchema = z.object({
26584
+ collectionIds: z.array(z.string()).min(1),
26585
+ workState: z.enum([
26586
+ "complete",
26587
+ "annotated_or_complete",
26588
+ "any_annotated"
26589
+ ]).default("complete")
26590
+ });
26591
+ var RetrainTrainingCorpusResolveResultSchema = z.discriminatedUnion("kind", [z.object({
26592
+ kind: z.literal("resolved"),
26593
+ frameIds: z.array(z.string()).max(2e4).readonly(),
26594
+ stats: RetrainDatasetStatsSchema,
26595
+ annotationHash: z.string(),
26596
+ layout: RetrainExportLayoutSchema
26523
26597
  }), z.object({
26524
26598
  kind: z.literal("refused"),
26525
- reason: z.enum([
26526
- "empty-name",
26527
- "duplicate-name",
26528
- "no-frames"
26529
- ])
26599
+ reason: z.enum(["unknown-collection", "no-frames"]),
26600
+ detail: z.string()
26530
26601
  })]);
26531
26602
  /** The outcome of a lifecycle move owned by the retrain page. */
26532
26603
  var RetrainTransitionResultSchema = z.object({
@@ -27672,6 +27743,26 @@ var pipelineAnalyticsCapability = {
27672
27743
  auth: "admin"
27673
27744
  }),
27674
27745
  /**
27746
+ * Paginated corpus copies for the Frames grid — index reads only.
27747
+ *
27748
+ * Filters AND (`workState`, cameras, one collection, annotated classes).
27749
+ * An answered empty match is `{ frames: [], total: 0, … }` (D315), never a
27750
+ * pending masquerade. Classification uses `workStateOf` (annotation count
27751
+ * wins over a stray `complete` flag).
27752
+ */
27753
+ listRetrainCorpusPage: method(RetrainCorpusFilterSchema, RetrainCorpusPageSchema, {
27754
+ kind: "query",
27755
+ auth: "admin"
27756
+ }),
27757
+ /**
27758
+ * Global + per-camera corpus KPI. Unfiltered totals; `%` on a camera row is
27759
+ * `complete(camera) / corpus total`, or `null` when the corpus is empty.
27760
+ */
27761
+ getRetrainCorpusKpi: method(z.object({}), RetrainCorpusKpiSchema, {
27762
+ kind: "query",
27763
+ auth: "admin"
27764
+ }),
27765
+ /**
27675
27766
  * What a track can contribute, and what it already has.
27676
27767
  *
27677
27768
  * `candidates` are the track's whole, unannotated frames — index rows only,
@@ -27898,53 +27989,6 @@ var pipelineAnalyticsCapability = {
27898
27989
  auth: "admin",
27899
27990
  timeoutMs: 12e4
27900
27991
  }),
27901
- /** The counts a selection would freeze — class × camera × day/night,
27902
- * completeness — without freezing anything. Index reads only. */
27903
- previewRetrainDataset: method(z.object({
27904
- selection: RetrainDatasetSelectionSchema,
27905
- completeOnly: z.boolean().optional()
27906
- }), RetrainDatasetStatsSchema, {
27907
- kind: "query",
27908
- auth: "admin"
27909
- }),
27910
- /**
27911
- * Freeze a dataset version: the frames the selection yields (the same plan
27912
- * the annotated export builds), the hash of what they teach, the export
27913
- * parameters and the counts. Immutable — a different selection is a new
27914
- * version. Export it with `getRetrainExportUrl({ datasetVersionId })`.
27915
- */
27916
- createRetrainDatasetVersion: method(z.object({
27917
- name: z.string().max(120),
27918
- selection: RetrainDatasetSelectionSchema,
27919
- layout: RetrainExportLayoutSchema,
27920
- completeOnly: z.boolean()
27921
- }), CreateRetrainDatasetVersionResultSchema, {
27922
- kind: "mutation",
27923
- auth: "admin",
27924
- timeoutMs: 12e4
27925
- }),
27926
- /** Every dataset version, newest first. */
27927
- listRetrainDatasetVersions: method(z.object({}), z.array(RetrainDatasetVersionSchema).readonly(), {
27928
- kind: "query",
27929
- auth: "admin"
27930
- }),
27931
- /** Delete a version. Its frames stay in the dataset. */
27932
- deleteRetrainDatasetVersion: method(z.object({ id: z.string() }), z.object({ deleted: z.boolean() }), {
27933
- kind: "mutation",
27934
- auth: "admin"
27935
- }),
27936
- /** Does the corpus still teach what the version froze? `missingFrames`
27937
- * counts frames that left the dataset (or lost every box and tick). */
27938
- verifyRetrainDatasetVersion: method(z.object({ id: z.string() }), z.object({
27939
- found: z.boolean(),
27940
- annotationHash: z.string(),
27941
- matches: z.boolean(),
27942
- missingFrames: z.number().int()
27943
- }), {
27944
- kind: "query",
27945
- auth: "admin",
27946
- timeoutMs: 12e4
27947
- }),
27948
27992
  /** The enabled, vision-capable LLM profiles, each saying whether a frame
27949
27993
  * sent to it leaves the house. */
27950
27994
  listRetrainAssistProfiles: method(z.object({}), z.array(RetrainAssistProfileSchema).readonly(), {
@@ -27991,6 +28035,16 @@ var pipelineAnalyticsCapability = {
27991
28035
  kind: "query",
27992
28036
  auth: "admin"
27993
28037
  }),
28038
+ /**
28039
+ * Resolve a live training corpus selection to frame ids + stats (index
28040
+ * reads only). Same plan the annotated export builds — training plan/start
28041
+ * calls this instead of a frozen dataset version.
28042
+ */
28043
+ resolveRetrainTrainingCorpus: method(RetrainTrainingCorpusSelectionSchema, RetrainTrainingCorpusResolveResultSchema, {
28044
+ kind: "query",
28045
+ auth: "admin",
28046
+ timeoutMs: 6e4
28047
+ }),
27994
28048
  renameRetrainCollection: method(z.object({
27995
28049
  id: z.string(),
27996
28050
  name: z.string().max(120)
@@ -31094,6 +31148,8 @@ var AgentPipelineSettingsSchema = z.object({
31094
31148
  * address is wrong (multi-homed host, NAT, custom interface).
31095
31149
  */
31096
31150
  reachableHost: z.string().optional(),
31151
+ /** Hub-persisted UI colour (`--color-node-*` theme tokens). */
31152
+ color: NodeColorIdSchema.optional(),
31097
31153
  /**
31098
31154
  * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
31099
31155
  * weight, steps}. Absent / all-disabled ⇒ the node's single default
@@ -31850,8 +31906,9 @@ var pipelineOrchestratorCapability = {
31850
31906
  */
31851
31907
  setAgentReachableHost: method(z.object({
31852
31908
  agentNodeId: z.string(),
31853
- reachableHost: z.string().nullable()
31854
- }), z.object({ success: z.literal(true) }), {
31909
+ reachableHost: z.string().nullable().optional(),
31910
+ color: NodeColorIdSchema.nullable().optional()
31911
+ }).refine((v) => v.reachableHost !== void 0 || v.color !== void 0, { message: "reachableHost or color required" }), z.object({ success: z.literal(true) }), {
31855
31912
  kind: "mutation",
31856
31913
  auth: "admin"
31857
31914
  }),
@@ -48785,9 +48842,11 @@ var zoneRulesCapability = {
48785
48842
  * once is what makes a second provider (RunPod, a local NVIDIA node) a new
48786
48843
  * manifest entry and nothing else.
48787
48844
  *
48788
- * Collection, routed by the `addonId` in every single-row input (the `llm` /
48789
- * `notification-output` posture); `describe` concat-fans across providers.
48790
- * Every method is `admin`: these spend money.
48845
+ * Collection of provider **types** (addons). Each addon owns zero or more
48846
+ * **entries** (credentials + defaults). Concat-fans: `describe`,
48847
+ * `describeTypes`, `listEntries`, `listJobs`. Single-row work is keyed by
48848
+ * `entryId`; callers also pass the owning `addonId` as the collection
48849
+ * selector (broker posture). Every method is `admin`: these spend money.
48791
48850
  *
48792
48851
  * Every cloud object a provider creates is tagged with the orchestrator's
48793
48852
  * `jobKey`, so a retried submit finds the job it already started instead of
@@ -48811,8 +48870,8 @@ var TrainingRegionOptionSchema = z.object({
48811
48870
  priceMultiplier: z.number().positive()
48812
48871
  });
48813
48872
  /**
48814
- * The provider's per-account settings, as the orchestrator reads them. They
48815
- * live in the PROVIDER addon's settings (operator decision 2026-10-08: they
48873
+ * The provider's per-entry settings, as the orchestrator reads them. They
48874
+ * live on the PROVIDER addon's entry (operator decision 2026-10-08: they
48816
48875
  * depend on the user's account), never hard-coded in the orchestrator.
48817
48876
  */
48818
48877
  var TrainingProviderDefaultsSchema = z.object({
@@ -48823,9 +48882,32 @@ var TrainingProviderDefaultsSchema = z.object({
48823
48882
  /** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
48824
48883
  failedDatasetGraceHours: z.number().nonnegative()
48825
48884
  });
48885
+ /** One creatable provider type, for the Add-entry dialog. */
48886
+ var TrainingProviderTypeSchema = z.object({
48887
+ typeId: z.string(),
48888
+ label: z.string(),
48889
+ /** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
48890
+ iconAsset: z.string(),
48891
+ /** Owning `training-provider` addon — collection selector for createEntry. */
48892
+ addonId: z.string()
48893
+ });
48894
+ /** One configured account / workspace under a provider type. */
48895
+ var TrainingProviderEntrySchema = z.object({
48896
+ entryId: z.string(),
48897
+ typeId: z.string(),
48898
+ name: z.string(),
48899
+ addonId: z.string(),
48900
+ /** Credentials are present — never the values. */
48901
+ configured: z.boolean()
48902
+ });
48826
48903
  var TrainingProviderDescriptorSchema = z.object({
48827
48904
  addonId: z.string(),
48828
- /** `modal`, `runpod`, `fake`, … */
48905
+ entryId: z.string(),
48906
+ typeId: z.string(),
48907
+ /** Operator-chosen entry name. */
48908
+ name: z.string(),
48909
+ iconAsset: z.string(),
48910
+ /** `modal`, `runpod`, `fake`, … — same as typeId for current providers. */
48829
48911
  kind: z.string(),
48830
48912
  label: z.string(),
48831
48913
  gpuTypes: z.array(TrainingGpuOptionSchema).readonly(),
@@ -48889,8 +48971,9 @@ var TrainerSourceRefSchema = z.object({
48889
48971
  /** A commit sha (never a branch) — the job must be reproducible. */
48890
48972
  revision: z.string().regex(/^[0-9a-f]{7,64}$/)
48891
48973
  });
48974
+ /** Cloud job identity — route with the owning addon's `addonId` selector. */
48892
48975
  var JobRef = {
48893
- addonId: z.string(),
48976
+ entryId: z.string().min(1),
48894
48977
  jobKey: z.string().uuid()
48895
48978
  };
48896
48979
  var TrainingLogLineSchema = z.object({
@@ -48903,17 +48986,37 @@ var trainingProviderCapability = {
48903
48986
  mode: "collection",
48904
48987
  internal: true,
48905
48988
  methods: {
48906
- /** Every provider's offer and settings. Concat-fans across providers. */
48989
+ /** Every entry's offer and settings. Concat-fans across providers. */
48907
48990
  describe: method(z.object({}), z.array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }),
48908
- /** Call the provider with the stored credentials. Never returns them. */
48909
- validateCredentials: method(z.object({ addonId: z.string() }), TrainingCredentialCheckSchema, {
48991
+ /** Creatable types for the Add-entry dialog. Concat-fans. */
48992
+ describeTypes: method(z.object({}), z.array(TrainingProviderTypeSchema).readonly(), { auth: "admin" }),
48993
+ /** Configured entries (pills). Concat-fans. */
48994
+ listEntries: method(z.object({}), z.array(TrainingProviderEntrySchema).readonly(), { auth: "admin" }),
48995
+ /**
48996
+ * Create an entry under this provider type. Pin with `{ addonId }` of the
48997
+ * type's owning addon (from describeTypes).
48998
+ */
48999
+ createEntry: method(z.object({
49000
+ typeId: z.string().min(1),
49001
+ name: z.string().min(1)
49002
+ }), z.object({ entryId: z.string() }), {
49003
+ kind: "mutation",
49004
+ auth: "admin"
49005
+ }),
49006
+ /** Delete an entry. Pin with the owning `{ addonId }`. */
49007
+ deleteEntry: method(z.object({ entryId: z.string().min(1) }), z.object({ ok: z.literal(true) }), {
49008
+ kind: "mutation",
49009
+ auth: "admin"
49010
+ }),
49011
+ /** Call the provider with the entry's stored credentials. Never returns them. */
49012
+ validateCredentials: method(z.object({ entryId: z.string().min(1) }), TrainingCredentialCheckSchema, {
48910
49013
  kind: "mutation",
48911
49014
  auth: "admin",
48912
49015
  timeoutMs: 3e4
48913
49016
  }),
48914
49017
  /** USD range for a run of `gpuSeconds` on `gpuType` in `region`. */
48915
49018
  estimateJob: method(z.object({
48916
- addonId: z.string(),
49019
+ entryId: z.string().min(1),
48917
49020
  gpuType: z.string(),
48918
49021
  region: z.string(),
48919
49022
  datasetBytes: z.number().int().nonnegative(),
@@ -49009,8 +49112,11 @@ var trainingProviderCapability = {
49009
49112
  auth: "admin",
49010
49113
  timeoutMs: 5 * 6e4
49011
49114
  }),
49012
- /** Every job the provider can still see — the orphan sweep diffs it against our records. */
49013
- listJobs: method(z.object({ addonId: z.string() }), z.array(ProviderJobStatusSchema).readonly(), {
49115
+ /**
49116
+ * Jobs this provider can still see. Optional `entryId` filters; omit to
49117
+ * list every entry (orphan sweep). Pin with `{ addonId }`.
49118
+ */
49119
+ listJobs: method(z.object({ entryId: z.string().min(1).optional() }), z.array(ProviderJobStatusSchema).readonly(), {
49014
49120
  auth: "admin",
49015
49121
  timeoutMs: 2 * 6e4
49016
49122
  })
@@ -49022,20 +49128,31 @@ var trainingProviderCapability = {
49022
49128
  *
49023
49129
  * It owns what every provider must agree on, written once:
49024
49130
  *
49025
- * - **Dataset versions.** Taken over from pipeline-analytics (D796): the rows
49026
- * live here (D808); pipeline-analytics still CUTS a version (it owns the corpus and
49027
- * the export plan) and reaches this store through the five row methods
49028
- * below, so the Retrain page and the export did not change.
49029
49131
  * - **Jobs.** A persisted state machine, a reconcile loop against the
49030
49132
  * provider, a cost guard, a daily orphan sweep and the retention rules.
49031
49133
  * - **The return flow.** Verified artefacts → Model Studio
49032
49134
  * (`custom-model-registry.importModelBundle`) → canary on cameras →
49033
49135
  * rollback. Nothing is ever registered automatically.
49034
49136
  *
49137
+ * Plan/start takes a live {@link TrainingCorpusSelection} (collections +
49138
+ * work-state rule); frame ids are resolved via pipeline-analytics at that
49139
+ * moment and snapshotted on the job. No frozen dataset version.
49140
+ *
49035
49141
  * Every method is `admin`.
49036
49142
  */
49037
- /** A version WITH its frame list — what the export and a job read. */
49038
- var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: z.array(z.string()).max(2e4).readonly() });
49143
+ /**
49144
+ * Live corpus criteria for plan/start (design §5.2). Default is complete-only.
49145
+ * Frame ids are resolved at plan/start — never a frozen version id.
49146
+ */
49147
+ var TrainingCorpusSelectionSchema = z.object({
49148
+ collectionIds: z.array(z.string()).min(1),
49149
+ /** Default complete-only for v1 */
49150
+ workState: z.enum([
49151
+ "complete",
49152
+ "annotated_or_complete",
49153
+ "any_annotated"
49154
+ ]).default("complete")
49155
+ });
49039
49156
  /** A base model a detector job can fine-tune, and the baseline it is judged against. */
49040
49157
  var TrainingBaseModelSchema = z.object({
49041
49158
  modelId: z.string(),
@@ -49053,9 +49170,13 @@ var TrainingPresetSchema = z.enum([
49053
49170
  "thorough"
49054
49171
  ]);
49055
49172
  var TrainingJobRequestSchema = z.object({
49056
- datasetVersionId: z.string().min(1),
49057
- /** The `training-provider` addon that runs it. */
49058
- addonId: z.string().min(1),
49173
+ /** Live collection + work-state criteria; resolved at plan/start. */
49174
+ selection: TrainingCorpusSelectionSchema,
49175
+ /**
49176
+ * The provider **entry** that runs it (credentials + defaults).
49177
+ * Resolve to an owning addon via `training-provider.describe` / `listEntries`.
49178
+ */
49179
+ entryId: z.string().min(1),
49059
49180
  gpuType: z.string().min(1),
49060
49181
  region: z.string(),
49061
49182
  baseModelId: z.string().min(1),
@@ -49114,6 +49235,7 @@ var TrainingJobPlanSchema = z.object({
49114
49235
  * result lives after the operator acted on it.
49115
49236
  */
49116
49237
  var TrainingJobStateSchema = z.enum([
49238
+ "queued",
49117
49239
  "uploading",
49118
49240
  "submitted",
49119
49241
  "starting",
@@ -49167,6 +49289,11 @@ var TrainingJobSchema = z.object({
49167
49289
  createdAt: z.number(),
49168
49290
  updatedAt: z.number(),
49169
49291
  state: TrainingJobStateSchema,
49292
+ /**
49293
+ * Shared by every job enqueued together via `startJobBatch`.
49294
+ * `null` for a lone `startJob`. The engine advances queued siblings by this id.
49295
+ */
49296
+ batchId: z.string().nullable().default(null),
49170
49297
  stage: TrainingStageSchema.nullable(),
49171
49298
  failure: z.object({
49172
49299
  reason: TrainingFailureReasonSchema,
@@ -49178,6 +49305,12 @@ var TrainingJobSchema = z.object({
49178
49305
  maxRuntimeSec: z.number().int().positive(),
49179
49306
  trainer: TrainerSourceRefSchema,
49180
49307
  datasetLayout: RetrainExportLayoutSchema,
49308
+ /** Frame count snapshotted when the job started (audit; equals `frameIds.length`). */
49309
+ frameCount: z.number().int().nonnegative(),
49310
+ /** Resolved frame ids at start — the archive ships exactly these. */
49311
+ frameIds: z.array(z.string()).max(2e4).readonly(),
49312
+ /** Hash of what those frames taught at start (trainer `dataset.annotationHash`). */
49313
+ annotationHash: z.string(),
49181
49314
  dataset: z.object({
49182
49315
  bytes: z.number().int(),
49183
49316
  sha256: z.string(),
@@ -49225,19 +49358,6 @@ var trainingCapability = {
49225
49358
  mode: "singleton",
49226
49359
  mount: { kind: "hub-only" },
49227
49360
  methods: {
49228
- /** Store a version once. `stored: false` = that id already exists (immutable). */
49229
- putDatasetVersion: method(TrainingDatasetVersionRowSchema, z.object({ stored: z.boolean() }), {
49230
- kind: "mutation",
49231
- auth: "admin"
49232
- }),
49233
- getDatasetVersion: method(IdInput, TrainingDatasetVersionRowSchema.nullable(), { auth: "admin" }),
49234
- /** Every version without its frame list, newest first. */
49235
- listDatasetVersions: method(z.object({}), z.array(RetrainDatasetVersionSchema).readonly(), { auth: "admin" }),
49236
- findDatasetVersionIdByName: method(z.object({ name: z.string() }), z.object({ id: z.string().nullable() }), { auth: "admin" }),
49237
- removeDatasetVersion: method(IdInput, z.object({ removed: z.boolean() }), {
49238
- kind: "mutation",
49239
- auth: "admin"
49240
- }),
49241
49361
  listBaseModels: method(z.object({}), z.array(TrainingBaseModelSchema).readonly(), { auth: "admin" }),
49242
49362
  /** Split, estimate, defaults and any named refusal — nothing is started. */
49243
49363
  planJob: method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
@@ -49266,6 +49386,32 @@ var trainingCapability = {
49266
49386
  auth: "admin",
49267
49387
  timeoutMs: 12e4
49268
49388
  }),
49389
+ /**
49390
+ * Enqueue one job per base model (same selection, entry, caps). The first
49391
+ * becomes `uploading`; the rest stay `queued` until the prior job settles.
49392
+ * One ACTIVE job at a time — a parallel `startJob` still gets
49393
+ * `job-already-running`. The same `idempotencyKey` returns the batch it
49394
+ * already started.
49395
+ */
49396
+ startJobBatch: method(TrainingJobRequestSchema.omit({ baseModelId: true }).extend({
49397
+ baseModelIds: z.array(z.string().min(1)).min(1),
49398
+ name: z.string().min(1).max(120),
49399
+ maxCostUsd: z.number().positive(),
49400
+ maxRuntimeSec: z.number().int().positive(),
49401
+ idempotencyKey: z.string().min(8).max(80)
49402
+ }), z.discriminatedUnion("kind", [z.object({
49403
+ kind: z.literal("started"),
49404
+ batchId: z.string(),
49405
+ jobs: z.array(TrainingJobSchema).min(1).readonly()
49406
+ }), z.object({
49407
+ kind: z.literal("refused"),
49408
+ reason: TrainingRefusalReasonSchema,
49409
+ detail: z.string()
49410
+ })]), {
49411
+ kind: "mutation",
49412
+ auth: "admin",
49413
+ timeoutMs: 12e4
49414
+ }),
49269
49415
  listJobs: method(z.object({}), z.array(TrainingJobSchema).readonly(), { auth: "admin" }),
49270
49416
  getJob: method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }),
49271
49417
  cancelJob: method(IdInput, TrainingJobSchema, {
@@ -55348,12 +55494,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55348
55494
  addonId: null,
55349
55495
  access: "create"
55350
55496
  },
55351
- "pipelineAnalytics.createRetrainDatasetVersion": {
55352
- capName: "pipeline-analytics",
55353
- capScope: "device",
55354
- addonId: null,
55355
- access: "create"
55356
- },
55357
55497
  "pipelineAnalytics.deleteDeviceEvents": {
55358
55498
  capName: "pipeline-analytics",
55359
55499
  capScope: "device",
@@ -55366,12 +55506,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55366
55506
  addonId: null,
55367
55507
  access: "delete"
55368
55508
  },
55369
- "pipelineAnalytics.deleteRetrainDatasetVersion": {
55370
- capName: "pipeline-analytics",
55371
- capScope: "device",
55372
- addonId: null,
55373
- access: "delete"
55374
- },
55375
55509
  "pipelineAnalytics.deleteTracks": {
55376
55510
  capName: "pipeline-analytics",
55377
55511
  capScope: "device",
@@ -55474,6 +55608,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
55474
55608
  addonId: null,
55475
55609
  access: "view"
55476
55610
  },
55611
+ "pipelineAnalytics.getRetrainCorpusKpi": {
55612
+ capName: "pipeline-analytics",
55613
+ capScope: "device",
55614
+ addonId: null,
55615
+ access: "view"
55616
+ },
55477
55617
  "pipelineAnalytics.getRetrainExportUrl": {
55478
55618
  capName: "pipeline-analytics",
55479
55619
  capScope: "device",
@@ -55594,7 +55734,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
55594
55734
  addonId: null,
55595
55735
  access: "view"
55596
55736
  },
55597
- "pipelineAnalytics.listRetrainDatasetVersions": {
55737
+ "pipelineAnalytics.listRetrainCorpusPage": {
55598
55738
  capName: "pipeline-analytics",
55599
55739
  capScope: "device",
55600
55740
  addonId: null,
@@ -55648,12 +55788,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55648
55788
  addonId: null,
55649
55789
  access: "create"
55650
55790
  },
55651
- "pipelineAnalytics.previewRetrainDataset": {
55652
- capName: "pipeline-analytics",
55653
- capScope: "device",
55654
- addonId: null,
55655
- access: "view"
55656
- },
55657
55791
  "pipelineAnalytics.proposeRetrainAnnotations": {
55658
55792
  capName: "pipeline-analytics",
55659
55793
  capScope: "device",
@@ -55732,6 +55866,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
55732
55866
  addonId: null,
55733
55867
  access: "create"
55734
55868
  },
55869
+ "pipelineAnalytics.resolveRetrainTrainingCorpus": {
55870
+ capName: "pipeline-analytics",
55871
+ capScope: "device",
55872
+ addonId: null,
55873
+ access: "view"
55874
+ },
55735
55875
  "pipelineAnalytics.restageRetrainTrack": {
55736
55876
  capName: "pipeline-analytics",
55737
55877
  capScope: "device",
@@ -55792,12 +55932,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
55792
55932
  addonId: null,
55793
55933
  access: "create"
55794
55934
  },
55795
- "pipelineAnalytics.verifyRetrainDatasetVersion": {
55796
- capName: "pipeline-analytics",
55797
- capScope: "device",
55798
- addonId: null,
55799
- access: "view"
55800
- },
55801
55935
  "pipelineAnalytics.wipeAllAnalytics": {
55802
55936
  capName: "pipeline-analytics",
55803
55937
  capScope: "device",
@@ -58192,18 +58326,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
58192
58326
  addonId: null,
58193
58327
  access: "create"
58194
58328
  },
58195
- "training.findDatasetVersionIdByName": {
58196
- capName: "training",
58197
- capScope: "system",
58198
- addonId: null,
58199
- access: "view"
58200
- },
58201
- "training.getDatasetVersion": {
58202
- capName: "training",
58203
- capScope: "system",
58204
- addonId: null,
58205
- access: "view"
58206
- },
58207
58329
  "training.getJob": {
58208
58330
  capName: "training",
58209
58331
  capScope: "system",
@@ -58222,12 +58344,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
58222
58344
  addonId: null,
58223
58345
  access: "view"
58224
58346
  },
58225
- "training.listDatasetVersions": {
58226
- capName: "training",
58227
- capScope: "system",
58228
- addonId: null,
58229
- access: "view"
58230
- },
58231
58347
  "training.listJobs": {
58232
58348
  capName: "training",
58233
58349
  capScope: "system",
@@ -58240,54 +58356,66 @@ var METHOD_ACCESS_MAP = Object.freeze({
58240
58356
  addonId: null,
58241
58357
  access: "view"
58242
58358
  },
58243
- "training.putDatasetVersion": {
58359
+ "training.registerResult": {
58244
58360
  capName: "training",
58245
58361
  capScope: "system",
58246
58362
  addonId: null,
58247
58363
  access: "create"
58248
58364
  },
58249
- "training.registerResult": {
58365
+ "training.rollbackCanary": {
58250
58366
  capName: "training",
58251
58367
  capScope: "system",
58252
58368
  addonId: null,
58253
58369
  access: "create"
58254
58370
  },
58255
- "training.removeDatasetVersion": {
58371
+ "training.startJob": {
58256
58372
  capName: "training",
58257
58373
  capScope: "system",
58258
58374
  addonId: null,
58259
- access: "delete"
58375
+ access: "create"
58260
58376
  },
58261
- "training.rollbackCanary": {
58377
+ "training.startJobBatch": {
58262
58378
  capName: "training",
58263
58379
  capScope: "system",
58264
58380
  addonId: null,
58265
58381
  access: "create"
58266
58382
  },
58267
- "training.startJob": {
58268
- capName: "training",
58383
+ "trainingProvider.cancelJob": {
58384
+ capName: "training-provider",
58269
58385
  capScope: "system",
58270
58386
  addonId: null,
58271
58387
  access: "create"
58272
58388
  },
58273
- "trainingProvider.cancelJob": {
58389
+ "trainingProvider.cleanupJob": {
58274
58390
  capName: "training-provider",
58275
58391
  capScope: "system",
58276
58392
  addonId: null,
58277
58393
  access: "create"
58278
58394
  },
58279
- "trainingProvider.cleanupJob": {
58395
+ "trainingProvider.createEntry": {
58280
58396
  capName: "training-provider",
58281
58397
  capScope: "system",
58282
58398
  addonId: null,
58283
58399
  access: "create"
58284
58400
  },
58401
+ "trainingProvider.deleteEntry": {
58402
+ capName: "training-provider",
58403
+ capScope: "system",
58404
+ addonId: null,
58405
+ access: "delete"
58406
+ },
58285
58407
  "trainingProvider.describe": {
58286
58408
  capName: "training-provider",
58287
58409
  capScope: "system",
58288
58410
  addonId: null,
58289
58411
  access: "view"
58290
58412
  },
58413
+ "trainingProvider.describeTypes": {
58414
+ capName: "training-provider",
58415
+ capScope: "system",
58416
+ addonId: null,
58417
+ access: "view"
58418
+ },
58291
58419
  "trainingProvider.estimateJob": {
58292
58420
  capName: "training-provider",
58293
58421
  capScope: "system",
@@ -58300,6 +58428,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
58300
58428
  addonId: null,
58301
58429
  access: "view"
58302
58430
  },
58431
+ "trainingProvider.listEntries": {
58432
+ capName: "training-provider",
58433
+ capScope: "system",
58434
+ addonId: null,
58435
+ access: "view"
58436
+ },
58303
58437
  "trainingProvider.listJobEvents": {
58304
58438
  capName: "training-provider",
58305
58439
  capScope: "system",
@@ -62015,6 +62149,11 @@ Object.freeze({
62015
62149
  form: "array",
62016
62150
  optional: false
62017
62151
  }],
62152
+ "pipelineAnalytics.listRetrainCorpusPage": [{
62153
+ name: "deviceIds",
62154
+ form: "array",
62155
+ optional: true
62156
+ }],
62018
62157
  "pipelineAnalytics.listRetrainStaging": [{
62019
62158
  name: "deviceIds",
62020
62159
  form: "array",