@camstack/addon-training 0.1.6 → 0.1.7

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 (43) hide show
  1. package/dist/MaskShapeCanvas-Kfg9dl6B.mjs +686 -0
  2. package/dist/{MotionZonesSettings-DPtcv80q.mjs → MotionZonesSettings-DKtYdHUO.mjs} +101 -119
  3. package/dist/{PrivacyMaskSettings-Wsn5QL0_.mjs → PrivacyMaskSettings-BvLUVz86.mjs} +45 -70
  4. package/dist/ReactKonva-DGuYUN0L.mjs +5416 -0
  5. package/dist/{SceneMonitorEditor-BlMwyiH8.mjs → SceneMonitorEditor-rFYGkGHV.mjs} +82 -82
  6. package/dist/_stub.js +28146 -12781
  7. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-Cbrdn9ib.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-B3xXUcaU.mjs} +3 -3
  8. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C7dks3FG.mjs +26 -0
  9. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DpjirGmB.mjs +89 -0
  10. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CFCVuRAs.mjs +58 -0
  11. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-BkvDudqY.mjs +62 -0
  12. package/dist/{_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-BT_wL8s3.mjs → _virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs} +1 -1
  13. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs +34 -0
  14. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom__loadShare__.js-DAZkHxxU.mjs +45 -0
  15. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CHqN9NLt.mjs +34 -0
  16. package/dist/addon-training.css +1 -1
  17. package/dist/{dist-BhCRZEE4.js → dist-DVDBSrjw.js} +270 -146
  18. package/dist/{dist-Cqa2fHNk.mjs → dist-Phot2UwD.mjs} +271 -141
  19. package/dist/grid-2x2-Bl3xw1w7.mjs +21 -0
  20. package/dist/{hostInit-BI98RYIm.mjs → hostInit-BAGO4XYA.mjs} +2 -2
  21. package/dist/index.js +100 -39
  22. package/dist/index.mjs +99 -38
  23. package/dist/lib-CVGFTwe0.mjs +7770 -0
  24. package/dist/orchestrator/training.addon.js +376 -222
  25. package/dist/orchestrator/training.addon.mjs +376 -222
  26. package/dist/{player-overlays-BX3obOMu.mjs → player-overlays-BT-6fK9N.mjs} +26 -7
  27. package/dist/providers/modal/training-modal.addon.js +361 -155
  28. package/dist/providers/modal/training-modal.addon.mjs +364 -158
  29. package/dist/remoteEntry.js +1 -1
  30. package/dist/{responsive-CdDIJCpI.mjs → responsive-Dy5RAD1s.mjs} +42 -38
  31. package/dist/{scene-monitor-copy-5u5w3K-Y.mjs → scene-monitor-copy-7HImRbA5.mjs} +4 -4
  32. package/dist/{square-C-P1-89Q.mjs → square-DoPBhbZN.mjs} +29 -4
  33. package/dist/{trash-2-BikGYiWf.mjs → trash-2-BwunNgLf.mjs} +1 -1
  34. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-DGLUs0o6.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-gU49KvnZ.mjs} +399 -390
  35. package/package.json +1 -1
  36. package/dist/MaskShapeCanvas-BokARvOj.mjs +0 -13806
  37. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BkKuzhOJ.mjs +0 -26
  38. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CaB1jnkt.mjs +0 -25
  39. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-B3rryujf.mjs +0 -25
  40. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-nL4MGFRP.mjs +0 -26
  41. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DDBEvLdo.mjs +0 -26
  42. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom__loadShare__.js-i_pnGDxd.mjs +0 -25
  43. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-gTIQrhKs.mjs +0 -25
@@ -5377,7 +5377,7 @@ var ZodIssueCode = {
5377
5377
  var ZodFirstPartyTypeKind;
5378
5378
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5379
5379
  //#endregion
5380
- //#region ../types/dist/sleep-r3RWkGVx.mjs
5380
+ //#region ../types/dist/sleep-CI0n5D44.mjs
5381
5381
  /**
5382
5382
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5383
5383
  * window to float samples (D455).
@@ -9306,6 +9306,16 @@ var CompositionSchema = object({
9306
9306
  seen.add(feature.cap);
9307
9307
  });
9308
9308
  });
9309
+ var NodeColorIdSchema = _enum([
9310
+ "node-a",
9311
+ "node-b",
9312
+ "node-c",
9313
+ "node-d",
9314
+ "node-e",
9315
+ "node-f",
9316
+ "node-g",
9317
+ "node-h"
9318
+ ]);
9309
9319
  new Set([
9310
9320
  "track",
9311
9321
  "face",
@@ -23900,24 +23910,69 @@ var RetrainFrameListSchema = object({
23900
23910
  /** What the page pre-selects — the native key frame when one survives. */
23901
23911
  autoPickMediaId: number().int().optional()
23902
23912
  });
23913
+ /** Exclusive partition of a corpus copy's annotation progress (design §4.2). */
23914
+ var RetrainFrameWorkStateSchema = _enum([
23915
+ "unannotated",
23916
+ "annotated",
23917
+ "complete"
23918
+ ]);
23919
+ /**
23920
+ * Filters for paginated corpus list, KPI, and matching export (design §4.4).
23921
+ * Every narrowing field is ANDed; omitted fields impose no constraint.
23922
+ */
23923
+ var RetrainCorpusFilterSchema = object({
23924
+ workState: RetrainFrameWorkStateSchema.optional(),
23925
+ deviceIds: array(number()).max(500).optional(),
23926
+ /** When set, only frames in this named collection. */
23927
+ collectionId: string().optional(),
23928
+ /** Frames that carry at least one saved annotation in one of these classes. */
23929
+ classes: array(RetrainMacroClassSchema).optional(),
23930
+ page: number().int().positive().default(1),
23931
+ pageSize: number().int().positive().max(100).default(50)
23932
+ });
23933
+ var RetrainCorpusPageSchema = object({
23934
+ frames: array(RetrainFrameSchema.extend({ workState: RetrainFrameWorkStateSchema })).readonly(),
23935
+ total: number().int().nonnegative(),
23936
+ page: number().int().positive(),
23937
+ pageSize: number().int().positive()
23938
+ });
23939
+ var RetrainCorpusKpiCameraRowSchema = object({
23940
+ deviceId: number(),
23941
+ unannotated: number().int().nonnegative(),
23942
+ annotated: number().int().nonnegative(),
23943
+ complete: number().int().nonnegative(),
23944
+ /** This camera's `complete` count divided by corpus `total`, in `[0,1]`.
23945
+ * `null` when the corpus is empty (no ratio). */
23946
+ pctOfCorpus: number().min(0).max(1).nullable()
23947
+ });
23948
+ var RetrainCorpusKpiSchema = object({
23949
+ total: number().int().nonnegative(),
23950
+ unannotated: number().int().nonnegative(),
23951
+ annotated: number().int().nonnegative(),
23952
+ complete: number().int().nonnegative(),
23953
+ cameras: array(RetrainCorpusKpiCameraRowSchema).readonly()
23954
+ });
23903
23955
  /**
23904
23956
  * Which frames an annotated export carries. Every field narrows; an empty
23905
- * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
23906
- * list owned by whoever trains (the training orchestrator), so `frameIds` is
23907
- * the primitive a version export uses; `batchId` re-selects what an earlier
23908
- * export carried (`exportedInBatch`).
23957
+ * filter is every annotated copy. `frameIds` is the primitive a job or
23958
+ * download uses; `batchId` re-selects what an earlier export carried
23959
+ * (`exportedInBatch`). Frozen dataset versions were removed — live selection
23960
+ * resolves to `frameIds` at plan/start.
23909
23961
  */
23910
23962
  var RetrainExportFilterSchema = object({
23911
23963
  deviceIds: array(number()).optional(),
23912
23964
  frameIds: array(string()).max(2e4).optional(),
23913
23965
  /** Only frames in at least one of these named collections. */
23914
23966
  collectionIds: array(string()).max(200).optional(),
23915
- /** Exactly the frames of this dataset version (and its completeOnly). An
23916
- * unknown id selects nothing. */
23917
- datasetVersionId: string().optional(),
23967
+ /** Single collection (Frames filter bar). ANDed with `collectionIds` when both set. */
23968
+ collectionId: string().optional(),
23918
23969
  batchId: string().optional(),
23919
23970
  /** Only frames the operator marked complete (all subjects boxed). */
23920
- completeOnly: boolean().optional()
23971
+ completeOnly: boolean().optional(),
23972
+ /** Exclusive work-state partition (`workStateOf`); same as the corpus list. */
23973
+ workState: RetrainFrameWorkStateSchema.optional(),
23974
+ /** Frames with at least one saved annotation in one of these classes. */
23975
+ classes: array(RetrainMacroClassSchema).optional()
23921
23976
  });
23922
23977
  /**
23923
23978
  * `frames`: the full frame copies, boxes in `annotations.json`.
@@ -24117,8 +24172,7 @@ var RetrainDatasetStatsSchema = object({
24117
24172
  completeFrames: number().int()
24118
24173
  })).readonly()
24119
24174
  });
24120
- /** An immutable dataset version, without its frame list. */
24121
- var RetrainDatasetVersionSchema = object({
24175
+ object({
24122
24176
  id: string(),
24123
24177
  name: string(),
24124
24178
  createdAt: number(),
@@ -24126,22 +24180,33 @@ var RetrainDatasetVersionSchema = object({
24126
24180
  layout: RetrainExportLayoutSchema,
24127
24181
  completeOnly: boolean(),
24128
24182
  frameCount: number().int(),
24129
- /** sha256 of what the frames taught when the version was frozen. */
24130
24183
  annotationHash: string(),
24131
- /** The export manifest schema the version was cut under. */
24132
24184
  manifestSchema: string(),
24133
24185
  stats: RetrainDatasetStatsSchema
24134
24186
  });
24135
- var CreateRetrainDatasetVersionResultSchema = discriminatedUnion("kind", [object({
24136
- kind: literal("created"),
24137
- version: RetrainDatasetVersionSchema
24187
+ /**
24188
+ * Live training corpus criteria — same shape as `TrainingCorpusSelection` on
24189
+ * the training cap. Resolved here so plan/start and the annotated export share
24190
+ * one definition of "the frames" (`buildRetrainExportPlan`).
24191
+ */
24192
+ var RetrainTrainingCorpusSelectionSchema = object({
24193
+ collectionIds: array(string()).min(1),
24194
+ workState: _enum([
24195
+ "complete",
24196
+ "annotated_or_complete",
24197
+ "any_annotated"
24198
+ ]).default("complete")
24199
+ });
24200
+ var RetrainTrainingCorpusResolveResultSchema = discriminatedUnion("kind", [object({
24201
+ kind: literal("resolved"),
24202
+ frameIds: array(string()).max(2e4).readonly(),
24203
+ stats: RetrainDatasetStatsSchema,
24204
+ annotationHash: string(),
24205
+ layout: RetrainExportLayoutSchema
24138
24206
  }), object({
24139
24207
  kind: literal("refused"),
24140
- reason: _enum([
24141
- "empty-name",
24142
- "duplicate-name",
24143
- "no-frames"
24144
- ])
24208
+ reason: _enum(["unknown-collection", "no-frames"]),
24209
+ detail: string()
24145
24210
  })]);
24146
24211
  /** The outcome of a lifecycle move owned by the retrain page. */
24147
24212
  var RetrainTransitionResultSchema = object({
@@ -24848,6 +24913,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24848
24913
  }), array(RetrainTrackSchema).readonly(), {
24849
24914
  kind: "query",
24850
24915
  auth: "admin"
24916
+ }), method(RetrainCorpusFilterSchema, RetrainCorpusPageSchema, {
24917
+ kind: "query",
24918
+ auth: "admin"
24919
+ }), method(object({}), RetrainCorpusKpiSchema, {
24920
+ kind: "query",
24921
+ auth: "admin"
24851
24922
  }), method(object({ trackId: string() }), RetrainFrameListSchema, {
24852
24923
  kind: "query",
24853
24924
  auth: "admin"
@@ -24943,36 +25014,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24943
25014
  kind: "mutation",
24944
25015
  auth: "admin",
24945
25016
  timeoutMs: 12e4
24946
- }), method(object({
24947
- selection: RetrainDatasetSelectionSchema,
24948
- completeOnly: boolean().optional()
24949
- }), RetrainDatasetStatsSchema, {
24950
- kind: "query",
24951
- auth: "admin"
24952
- }), method(object({
24953
- name: string().max(120),
24954
- selection: RetrainDatasetSelectionSchema,
24955
- layout: RetrainExportLayoutSchema,
24956
- completeOnly: boolean()
24957
- }), CreateRetrainDatasetVersionResultSchema, {
24958
- kind: "mutation",
24959
- auth: "admin",
24960
- timeoutMs: 12e4
24961
- }), method(object({}), array(RetrainDatasetVersionSchema).readonly(), {
24962
- kind: "query",
24963
- auth: "admin"
24964
- }), method(object({ id: string() }), object({ deleted: boolean() }), {
24965
- kind: "mutation",
24966
- auth: "admin"
24967
- }), method(object({ id: string() }), object({
24968
- found: boolean(),
24969
- annotationHash: string(),
24970
- matches: boolean(),
24971
- missingFrames: number().int()
24972
- }), {
24973
- kind: "query",
24974
- auth: "admin",
24975
- timeoutMs: 12e4
24976
25017
  }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
24977
25018
  kind: "query",
24978
25019
  auth: "admin"
@@ -24999,6 +25040,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
24999
25040
  }), method(object({}), array(RetrainCollectionSchema).readonly(), {
25000
25041
  kind: "query",
25001
25042
  auth: "admin"
25043
+ }), method(RetrainTrainingCorpusSelectionSchema, RetrainTrainingCorpusResolveResultSchema, {
25044
+ kind: "query",
25045
+ auth: "admin",
25046
+ timeoutMs: 6e4
25002
25047
  }), method(object({
25003
25048
  id: string(),
25004
25049
  name: string().max(120)
@@ -27512,6 +27557,8 @@ var AgentPipelineSettingsSchema = object({
27512
27557
  * address is wrong (multi-homed host, NAT, custom interface).
27513
27558
  */
27514
27559
  reachableHost: string().optional(),
27560
+ /** Hub-persisted UI colour (`--color-node-*` theme tokens). */
27561
+ color: NodeColorIdSchema.optional(),
27515
27562
  /**
27516
27563
  * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
27517
27564
  * weight, steps}. Absent / all-disabled ⇒ the node's single default
@@ -28061,8 +28108,9 @@ method(object({
28061
28108
  auth: "admin"
28062
28109
  }), method(object({
28063
28110
  agentNodeId: string(),
28064
- reachableHost: string().nullable()
28065
- }), object({ success: literal(true) }), {
28111
+ reachableHost: string().nullable().optional(),
28112
+ color: NodeColorIdSchema.nullable().optional()
28113
+ }).refine((v) => v.reachableHost !== void 0 || v.color !== void 0, { message: "reachableHost or color required" }), object({ success: literal(true) }), {
28066
28114
  kind: "mutation",
28067
28115
  auth: "admin"
28068
28116
  }), method(object({
@@ -39278,9 +39326,11 @@ DeviceType.Camera, method(object({
39278
39326
  * once is what makes a second provider (RunPod, a local NVIDIA node) a new
39279
39327
  * manifest entry and nothing else.
39280
39328
  *
39281
- * Collection, routed by the `addonId` in every single-row input (the `llm` /
39282
- * `notification-output` posture); `describe` concat-fans across providers.
39283
- * Every method is `admin`: these spend money.
39329
+ * Collection of provider **types** (addons). Each addon owns zero or more
39330
+ * **entries** (credentials + defaults). Concat-fans: `describe`,
39331
+ * `describeTypes`, `listEntries`, `listJobs`. Single-row work is keyed by
39332
+ * `entryId`; callers also pass the owning `addonId` as the collection
39333
+ * selector (broker posture). Every method is `admin`: these spend money.
39284
39334
  *
39285
39335
  * Every cloud object a provider creates is tagged with the orchestrator's
39286
39336
  * `jobKey`, so a retried submit finds the job it already started instead of
@@ -39304,8 +39354,8 @@ var TrainingRegionOptionSchema = object({
39304
39354
  priceMultiplier: number().positive()
39305
39355
  });
39306
39356
  /**
39307
- * The provider's per-account settings, as the orchestrator reads them. They
39308
- * live in the PROVIDER addon's settings (operator decision 2026-10-08: they
39357
+ * The provider's per-entry settings, as the orchestrator reads them. They
39358
+ * live on the PROVIDER addon's entry (operator decision 2026-10-08: they
39309
39359
  * depend on the user's account), never hard-coded in the orchestrator.
39310
39360
  */
39311
39361
  var TrainingProviderDefaultsSchema = object({
@@ -39316,9 +39366,32 @@ var TrainingProviderDefaultsSchema = object({
39316
39366
  /** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
39317
39367
  failedDatasetGraceHours: number().nonnegative()
39318
39368
  });
39369
+ /** One creatable provider type, for the Add-entry dialog. */
39370
+ var TrainingProviderTypeSchema = object({
39371
+ typeId: string(),
39372
+ label: string(),
39373
+ /** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
39374
+ iconAsset: string(),
39375
+ /** Owning `training-provider` addon — collection selector for createEntry. */
39376
+ addonId: string()
39377
+ });
39378
+ /** One configured account / workspace under a provider type. */
39379
+ var TrainingProviderEntrySchema = object({
39380
+ entryId: string(),
39381
+ typeId: string(),
39382
+ name: string(),
39383
+ addonId: string(),
39384
+ /** Credentials are present — never the values. */
39385
+ configured: boolean()
39386
+ });
39319
39387
  var TrainingProviderDescriptorSchema = object({
39320
39388
  addonId: string(),
39321
- /** `modal`, `runpod`, `fake`, … */
39389
+ entryId: string(),
39390
+ typeId: string(),
39391
+ /** Operator-chosen entry name. */
39392
+ name: string(),
39393
+ iconAsset: string(),
39394
+ /** `modal`, `runpod`, `fake`, … — same as typeId for current providers. */
39322
39395
  kind: string(),
39323
39396
  label: string(),
39324
39397
  gpuTypes: array(TrainingGpuOptionSchema).readonly(),
@@ -39382,8 +39455,9 @@ var TrainerSourceRefSchema = object({
39382
39455
  /** A commit sha (never a branch) — the job must be reproducible. */
39383
39456
  revision: string().regex(/^[0-9a-f]{7,64}$/)
39384
39457
  });
39458
+ /** Cloud job identity — route with the owning addon's `addonId` selector. */
39385
39459
  var JobRef = {
39386
- addonId: string(),
39460
+ entryId: string().min(1),
39387
39461
  jobKey: string().uuid()
39388
39462
  };
39389
39463
  var TrainingLogLineSchema = object({
@@ -39396,17 +39470,37 @@ var trainingProviderCapability = {
39396
39470
  mode: "collection",
39397
39471
  internal: true,
39398
39472
  methods: {
39399
- /** Every provider's offer and settings. Concat-fans across providers. */
39473
+ /** Every entry's offer and settings. Concat-fans across providers. */
39400
39474
  describe: method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }),
39401
- /** Call the provider with the stored credentials. Never returns them. */
39402
- validateCredentials: method(object({ addonId: string() }), TrainingCredentialCheckSchema, {
39475
+ /** Creatable types for the Add-entry dialog. Concat-fans. */
39476
+ describeTypes: method(object({}), array(TrainingProviderTypeSchema).readonly(), { auth: "admin" }),
39477
+ /** Configured entries (pills). Concat-fans. */
39478
+ listEntries: method(object({}), array(TrainingProviderEntrySchema).readonly(), { auth: "admin" }),
39479
+ /**
39480
+ * Create an entry under this provider type. Pin with `{ addonId }` of the
39481
+ * type's owning addon (from describeTypes).
39482
+ */
39483
+ createEntry: method(object({
39484
+ typeId: string().min(1),
39485
+ name: string().min(1)
39486
+ }), object({ entryId: string() }), {
39487
+ kind: "mutation",
39488
+ auth: "admin"
39489
+ }),
39490
+ /** Delete an entry. Pin with the owning `{ addonId }`. */
39491
+ deleteEntry: method(object({ entryId: string().min(1) }), object({ ok: literal(true) }), {
39492
+ kind: "mutation",
39493
+ auth: "admin"
39494
+ }),
39495
+ /** Call the provider with the entry's stored credentials. Never returns them. */
39496
+ validateCredentials: method(object({ entryId: string().min(1) }), TrainingCredentialCheckSchema, {
39403
39497
  kind: "mutation",
39404
39498
  auth: "admin",
39405
39499
  timeoutMs: 3e4
39406
39500
  }),
39407
39501
  /** USD range for a run of `gpuSeconds` on `gpuType` in `region`. */
39408
39502
  estimateJob: method(object({
39409
- addonId: string(),
39503
+ entryId: string().min(1),
39410
39504
  gpuType: string(),
39411
39505
  region: string(),
39412
39506
  datasetBytes: number().int().nonnegative(),
@@ -39502,8 +39596,11 @@ var trainingProviderCapability = {
39502
39596
  auth: "admin",
39503
39597
  timeoutMs: 5 * 6e4
39504
39598
  }),
39505
- /** Every job the provider can still see — the orphan sweep diffs it against our records. */
39506
- listJobs: method(object({ addonId: string() }), array(ProviderJobStatusSchema).readonly(), {
39599
+ /**
39600
+ * Jobs this provider can still see. Optional `entryId` filters; omit to
39601
+ * list every entry (orphan sweep). Pin with `{ addonId }`.
39602
+ */
39603
+ listJobs: method(object({ entryId: string().min(1).optional() }), array(ProviderJobStatusSchema).readonly(), {
39507
39604
  auth: "admin",
39508
39605
  timeoutMs: 2 * 6e4
39509
39606
  })
@@ -39515,20 +39612,31 @@ var trainingProviderCapability = {
39515
39612
  *
39516
39613
  * It owns what every provider must agree on, written once:
39517
39614
  *
39518
- * - **Dataset versions.** Taken over from pipeline-analytics (D796): the rows
39519
- * live here (D808); pipeline-analytics still CUTS a version (it owns the corpus and
39520
- * the export plan) and reaches this store through the five row methods
39521
- * below, so the Retrain page and the export did not change.
39522
39615
  * - **Jobs.** A persisted state machine, a reconcile loop against the
39523
39616
  * provider, a cost guard, a daily orphan sweep and the retention rules.
39524
39617
  * - **The return flow.** Verified artefacts → Model Studio
39525
39618
  * (`custom-model-registry.importModelBundle`) → canary on cameras →
39526
39619
  * rollback. Nothing is ever registered automatically.
39527
39620
  *
39621
+ * Plan/start takes a live {@link TrainingCorpusSelection} (collections +
39622
+ * work-state rule); frame ids are resolved via pipeline-analytics at that
39623
+ * moment and snapshotted on the job. No frozen dataset version.
39624
+ *
39528
39625
  * Every method is `admin`.
39529
39626
  */
39530
- /** A version WITH its frame list — what the export and a job read. */
39531
- var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: array(string()).max(2e4).readonly() });
39627
+ /**
39628
+ * Live corpus criteria for plan/start (design §5.2). Default is complete-only.
39629
+ * Frame ids are resolved at plan/start — never a frozen version id.
39630
+ */
39631
+ var TrainingCorpusSelectionSchema = object({
39632
+ collectionIds: array(string()).min(1),
39633
+ /** Default complete-only for v1 */
39634
+ workState: _enum([
39635
+ "complete",
39636
+ "annotated_or_complete",
39637
+ "any_annotated"
39638
+ ]).default("complete")
39639
+ });
39532
39640
  /** A base model a detector job can fine-tune, and the baseline it is judged against. */
39533
39641
  var TrainingBaseModelSchema = object({
39534
39642
  modelId: string(),
@@ -39546,9 +39654,13 @@ var TrainingPresetSchema = _enum([
39546
39654
  "thorough"
39547
39655
  ]);
39548
39656
  var TrainingJobRequestSchema = object({
39549
- datasetVersionId: string().min(1),
39550
- /** The `training-provider` addon that runs it. */
39551
- addonId: string().min(1),
39657
+ /** Live collection + work-state criteria; resolved at plan/start. */
39658
+ selection: TrainingCorpusSelectionSchema,
39659
+ /**
39660
+ * The provider **entry** that runs it (credentials + defaults).
39661
+ * Resolve to an owning addon via `training-provider.describe` / `listEntries`.
39662
+ */
39663
+ entryId: string().min(1),
39552
39664
  gpuType: string().min(1),
39553
39665
  region: string(),
39554
39666
  baseModelId: string().min(1),
@@ -39607,6 +39719,7 @@ var TrainingJobPlanSchema = object({
39607
39719
  * result lives after the operator acted on it.
39608
39720
  */
39609
39721
  var TrainingJobStateSchema = _enum([
39722
+ "queued",
39610
39723
  "uploading",
39611
39724
  "submitted",
39612
39725
  "starting",
@@ -39660,6 +39773,11 @@ var TrainingJobSchema = object({
39660
39773
  createdAt: number(),
39661
39774
  updatedAt: number(),
39662
39775
  state: TrainingJobStateSchema,
39776
+ /**
39777
+ * Shared by every job enqueued together via `startJobBatch`.
39778
+ * `null` for a lone `startJob`. The engine advances queued siblings by this id.
39779
+ */
39780
+ batchId: string().nullable().default(null),
39663
39781
  stage: TrainingStageSchema.nullable(),
39664
39782
  failure: object({
39665
39783
  reason: TrainingFailureReasonSchema,
@@ -39671,6 +39789,12 @@ var TrainingJobSchema = object({
39671
39789
  maxRuntimeSec: number().int().positive(),
39672
39790
  trainer: TrainerSourceRefSchema,
39673
39791
  datasetLayout: RetrainExportLayoutSchema,
39792
+ /** Frame count snapshotted when the job started (audit; equals `frameIds.length`). */
39793
+ frameCount: number().int().nonnegative(),
39794
+ /** Resolved frame ids at start — the archive ships exactly these. */
39795
+ frameIds: array(string()).max(2e4).readonly(),
39796
+ /** Hash of what those frames taught at start (trainer `dataset.annotationHash`). */
39797
+ annotationHash: string(),
39674
39798
  dataset: object({
39675
39799
  bytes: number().int(),
39676
39800
  sha256: string(),
@@ -39718,19 +39842,6 @@ var trainingCapability = {
39718
39842
  mode: "singleton",
39719
39843
  mount: { kind: "hub-only" },
39720
39844
  methods: {
39721
- /** Store a version once. `stored: false` = that id already exists (immutable). */
39722
- putDatasetVersion: method(TrainingDatasetVersionRowSchema, object({ stored: boolean() }), {
39723
- kind: "mutation",
39724
- auth: "admin"
39725
- }),
39726
- getDatasetVersion: method(IdInput, TrainingDatasetVersionRowSchema.nullable(), { auth: "admin" }),
39727
- /** Every version without its frame list, newest first. */
39728
- listDatasetVersions: method(object({}), array(RetrainDatasetVersionSchema).readonly(), { auth: "admin" }),
39729
- findDatasetVersionIdByName: method(object({ name: string() }), object({ id: string().nullable() }), { auth: "admin" }),
39730
- removeDatasetVersion: method(IdInput, object({ removed: boolean() }), {
39731
- kind: "mutation",
39732
- auth: "admin"
39733
- }),
39734
39845
  listBaseModels: method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }),
39735
39846
  /** Split, estimate, defaults and any named refusal — nothing is started. */
39736
39847
  planJob: method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
@@ -39759,6 +39870,32 @@ var trainingCapability = {
39759
39870
  auth: "admin",
39760
39871
  timeoutMs: 12e4
39761
39872
  }),
39873
+ /**
39874
+ * Enqueue one job per base model (same selection, entry, caps). The first
39875
+ * becomes `uploading`; the rest stay `queued` until the prior job settles.
39876
+ * One ACTIVE job at a time — a parallel `startJob` still gets
39877
+ * `job-already-running`. The same `idempotencyKey` returns the batch it
39878
+ * already started.
39879
+ */
39880
+ startJobBatch: method(TrainingJobRequestSchema.omit({ baseModelId: true }).extend({
39881
+ baseModelIds: array(string().min(1)).min(1),
39882
+ name: string().min(1).max(120),
39883
+ maxCostUsd: number().positive(),
39884
+ maxRuntimeSec: number().int().positive(),
39885
+ idempotencyKey: string().min(8).max(80)
39886
+ }), discriminatedUnion("kind", [object({
39887
+ kind: literal("started"),
39888
+ batchId: string(),
39889
+ jobs: array(TrainingJobSchema).min(1).readonly()
39890
+ }), object({
39891
+ kind: literal("refused"),
39892
+ reason: TrainingRefusalReasonSchema,
39893
+ detail: string()
39894
+ })]), {
39895
+ kind: "mutation",
39896
+ auth: "admin",
39897
+ timeoutMs: 12e4
39898
+ }),
39762
39899
  listJobs: method(object({}), array(TrainingJobSchema).readonly(), { auth: "admin" }),
39763
39900
  getJob: method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }),
39764
39901
  cancelJob: method(IdInput, TrainingJobSchema, {
@@ -44016,12 +44153,6 @@ Object.freeze({
44016
44153
  addonId: null,
44017
44154
  access: "create"
44018
44155
  },
44019
- "pipelineAnalytics.createRetrainDatasetVersion": {
44020
- capName: "pipeline-analytics",
44021
- capScope: "device",
44022
- addonId: null,
44023
- access: "create"
44024
- },
44025
44156
  "pipelineAnalytics.deleteDeviceEvents": {
44026
44157
  capName: "pipeline-analytics",
44027
44158
  capScope: "device",
@@ -44034,12 +44165,6 @@ Object.freeze({
44034
44165
  addonId: null,
44035
44166
  access: "delete"
44036
44167
  },
44037
- "pipelineAnalytics.deleteRetrainDatasetVersion": {
44038
- capName: "pipeline-analytics",
44039
- capScope: "device",
44040
- addonId: null,
44041
- access: "delete"
44042
- },
44043
44168
  "pipelineAnalytics.deleteTracks": {
44044
44169
  capName: "pipeline-analytics",
44045
44170
  capScope: "device",
@@ -44142,6 +44267,12 @@ Object.freeze({
44142
44267
  addonId: null,
44143
44268
  access: "view"
44144
44269
  },
44270
+ "pipelineAnalytics.getRetrainCorpusKpi": {
44271
+ capName: "pipeline-analytics",
44272
+ capScope: "device",
44273
+ addonId: null,
44274
+ access: "view"
44275
+ },
44145
44276
  "pipelineAnalytics.getRetrainExportUrl": {
44146
44277
  capName: "pipeline-analytics",
44147
44278
  capScope: "device",
@@ -44262,7 +44393,7 @@ Object.freeze({
44262
44393
  addonId: null,
44263
44394
  access: "view"
44264
44395
  },
44265
- "pipelineAnalytics.listRetrainDatasetVersions": {
44396
+ "pipelineAnalytics.listRetrainCorpusPage": {
44266
44397
  capName: "pipeline-analytics",
44267
44398
  capScope: "device",
44268
44399
  addonId: null,
@@ -44316,12 +44447,6 @@ Object.freeze({
44316
44447
  addonId: null,
44317
44448
  access: "create"
44318
44449
  },
44319
- "pipelineAnalytics.previewRetrainDataset": {
44320
- capName: "pipeline-analytics",
44321
- capScope: "device",
44322
- addonId: null,
44323
- access: "view"
44324
- },
44325
44450
  "pipelineAnalytics.proposeRetrainAnnotations": {
44326
44451
  capName: "pipeline-analytics",
44327
44452
  capScope: "device",
@@ -44400,6 +44525,12 @@ Object.freeze({
44400
44525
  addonId: null,
44401
44526
  access: "create"
44402
44527
  },
44528
+ "pipelineAnalytics.resolveRetrainTrainingCorpus": {
44529
+ capName: "pipeline-analytics",
44530
+ capScope: "device",
44531
+ addonId: null,
44532
+ access: "view"
44533
+ },
44403
44534
  "pipelineAnalytics.restageRetrainTrack": {
44404
44535
  capName: "pipeline-analytics",
44405
44536
  capScope: "device",
@@ -44460,12 +44591,6 @@ Object.freeze({
44460
44591
  addonId: null,
44461
44592
  access: "create"
44462
44593
  },
44463
- "pipelineAnalytics.verifyRetrainDatasetVersion": {
44464
- capName: "pipeline-analytics",
44465
- capScope: "device",
44466
- addonId: null,
44467
- access: "view"
44468
- },
44469
44594
  "pipelineAnalytics.wipeAllAnalytics": {
44470
44595
  capName: "pipeline-analytics",
44471
44596
  capScope: "device",
@@ -46860,18 +46985,6 @@ Object.freeze({
46860
46985
  addonId: null,
46861
46986
  access: "create"
46862
46987
  },
46863
- "training.findDatasetVersionIdByName": {
46864
- capName: "training",
46865
- capScope: "system",
46866
- addonId: null,
46867
- access: "view"
46868
- },
46869
- "training.getDatasetVersion": {
46870
- capName: "training",
46871
- capScope: "system",
46872
- addonId: null,
46873
- access: "view"
46874
- },
46875
46988
  "training.getJob": {
46876
46989
  capName: "training",
46877
46990
  capScope: "system",
@@ -46890,12 +47003,6 @@ Object.freeze({
46890
47003
  addonId: null,
46891
47004
  access: "view"
46892
47005
  },
46893
- "training.listDatasetVersions": {
46894
- capName: "training",
46895
- capScope: "system",
46896
- addonId: null,
46897
- access: "view"
46898
- },
46899
47006
  "training.listJobs": {
46900
47007
  capName: "training",
46901
47008
  capScope: "system",
@@ -46908,54 +47015,66 @@ Object.freeze({
46908
47015
  addonId: null,
46909
47016
  access: "view"
46910
47017
  },
46911
- "training.putDatasetVersion": {
47018
+ "training.registerResult": {
46912
47019
  capName: "training",
46913
47020
  capScope: "system",
46914
47021
  addonId: null,
46915
47022
  access: "create"
46916
47023
  },
46917
- "training.registerResult": {
47024
+ "training.rollbackCanary": {
46918
47025
  capName: "training",
46919
47026
  capScope: "system",
46920
47027
  addonId: null,
46921
47028
  access: "create"
46922
47029
  },
46923
- "training.removeDatasetVersion": {
47030
+ "training.startJob": {
46924
47031
  capName: "training",
46925
47032
  capScope: "system",
46926
47033
  addonId: null,
46927
- access: "delete"
47034
+ access: "create"
46928
47035
  },
46929
- "training.rollbackCanary": {
47036
+ "training.startJobBatch": {
46930
47037
  capName: "training",
46931
47038
  capScope: "system",
46932
47039
  addonId: null,
46933
47040
  access: "create"
46934
47041
  },
46935
- "training.startJob": {
46936
- capName: "training",
47042
+ "trainingProvider.cancelJob": {
47043
+ capName: "training-provider",
46937
47044
  capScope: "system",
46938
47045
  addonId: null,
46939
47046
  access: "create"
46940
47047
  },
46941
- "trainingProvider.cancelJob": {
47048
+ "trainingProvider.cleanupJob": {
46942
47049
  capName: "training-provider",
46943
47050
  capScope: "system",
46944
47051
  addonId: null,
46945
47052
  access: "create"
46946
47053
  },
46947
- "trainingProvider.cleanupJob": {
47054
+ "trainingProvider.createEntry": {
46948
47055
  capName: "training-provider",
46949
47056
  capScope: "system",
46950
47057
  addonId: null,
46951
47058
  access: "create"
46952
47059
  },
47060
+ "trainingProvider.deleteEntry": {
47061
+ capName: "training-provider",
47062
+ capScope: "system",
47063
+ addonId: null,
47064
+ access: "delete"
47065
+ },
46953
47066
  "trainingProvider.describe": {
46954
47067
  capName: "training-provider",
46955
47068
  capScope: "system",
46956
47069
  addonId: null,
46957
47070
  access: "view"
46958
47071
  },
47072
+ "trainingProvider.describeTypes": {
47073
+ capName: "training-provider",
47074
+ capScope: "system",
47075
+ addonId: null,
47076
+ access: "view"
47077
+ },
46959
47078
  "trainingProvider.estimateJob": {
46960
47079
  capName: "training-provider",
46961
47080
  capScope: "system",
@@ -46968,6 +47087,12 @@ Object.freeze({
46968
47087
  addonId: null,
46969
47088
  access: "view"
46970
47089
  },
47090
+ "trainingProvider.listEntries": {
47091
+ capName: "training-provider",
47092
+ capScope: "system",
47093
+ addonId: null,
47094
+ access: "view"
47095
+ },
46971
47096
  "trainingProvider.listJobEvents": {
46972
47097
  capName: "training-provider",
46973
47098
  capScope: "system",
@@ -50424,6 +50549,11 @@ Object.freeze({
50424
50549
  form: "array",
50425
50550
  optional: false
50426
50551
  }],
50552
+ "pipelineAnalytics.listRetrainCorpusPage": [{
50553
+ name: "deviceIds",
50554
+ form: "array",
50555
+ optional: true
50556
+ }],
50427
50557
  "pipelineAnalytics.listRetrainStaging": [{
50428
50558
  name: "deviceIds",
50429
50559
  form: "array",
@@ -52572,4 +52702,4 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
52572
52702
  var MB = 1024 * 1024;
52573
52703
  1024 * MB, 3072 * MB;
52574
52704
  //#endregion
52575
- export { TrainingResultSchema as a, trainingCapability as c, boolean as d, number as f, string as h, TrainingJobSpecSchema as i, trainingProviderCapability as l, record as m, TrainingDatasetVersionRowSchema as n, addonPagesSourceCapability as o, object as p, TrainingJobSchema as r, parseTrainingEventLine as s, TRAINING_JOB_SCHEMA as t, BaseAddon as u };
52705
+ export { addonPagesSourceCapability as a, trainingProviderCapability as c, number as d, object as f, TrainingResultSchema as i, BaseAddon as l, string as m, TrainingJobSchema as n, parseTrainingEventLine as o, record as p, TrainingJobSpecSchema as r, trainingCapability as s, TRAINING_JOB_SCHEMA as t, boolean as u };