@camstack/addon-auth 1.2.136 → 1.2.137

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.
@@ -5376,7 +5376,7 @@ var ZodIssueCode = {
5376
5376
  var ZodFirstPartyTypeKind;
5377
5377
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5378
5378
  //#endregion
5379
- //#region ../types/dist/sleep-r3RWkGVx.mjs
5379
+ //#region ../types/dist/sleep-DwAQ9sqX.mjs
5380
5380
  /**
5381
5381
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5382
5382
  * window to float samples (D455).
@@ -9315,6 +9315,16 @@ var CompositionSchema = object({
9315
9315
  seen.add(feature.cap);
9316
9316
  });
9317
9317
  });
9318
+ var NodeColorIdSchema = _enum([
9319
+ "node-a",
9320
+ "node-b",
9321
+ "node-c",
9322
+ "node-d",
9323
+ "node-e",
9324
+ "node-f",
9325
+ "node-g",
9326
+ "node-h"
9327
+ ]);
9318
9328
  new Set([
9319
9329
  "track",
9320
9330
  "face",
@@ -18236,14 +18246,14 @@ var LlmProfileSchema = object({
18236
18246
  /** ConfigUISchema tree passed through untyped on the wire (the
18237
18247
  * notification-output `ConfigSchemaPassthrough` precedent at
18238
18248
  * notification-output.cap.ts:151); the exported TS type re-tightens it. */
18239
- var ConfigSchemaPassthrough$1 = unknown();
18249
+ var ConfigSchemaPassthrough$2 = unknown();
18240
18250
  var LlmProfileKindDescriptorSchema = object({
18241
18251
  kind: LlmProfileKindSchema,
18242
18252
  label: string(),
18243
18253
  icon: string(),
18244
18254
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
18245
18255
  addonId: string(),
18246
- configSchema: ConfigSchemaPassthrough$1
18256
+ configSchema: ConfigSchemaPassthrough$2
18247
18257
  });
18248
18258
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
18249
18259
  var LlmDefaultSchema = object({
@@ -19372,7 +19382,7 @@ var TargetKindCapsSchema = object({
19372
19382
  * the union is large and not meant for runtime validation here; the exported
19373
19383
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
19374
19384
  */
19375
- var ConfigSchemaPassthrough = unknown();
19385
+ var ConfigSchemaPassthrough$1 = unknown();
19376
19386
  var TargetKindSchema = object({
19377
19387
  kind: string(),
19378
19388
  label: string(),
@@ -19409,7 +19419,7 @@ var TargetKindSchema = object({
19409
19419
  * its raster path, which is the safe default for an unknown image.
19410
19420
  */
19411
19421
  iconMediaType: string().optional(),
19412
- configSchema: ConfigSchemaPassthrough,
19422
+ configSchema: ConfigSchemaPassthrough$1,
19413
19423
  /**
19414
19424
  * The config keys that decide WHERE this kind's secrets are sent (server,
19415
19425
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -24064,24 +24074,69 @@ var RetrainFrameListSchema = object({
24064
24074
  /** What the page pre-selects — the native key frame when one survives. */
24065
24075
  autoPickMediaId: number().int().optional()
24066
24076
  });
24077
+ /** Exclusive partition of a corpus copy's annotation progress (design §4.2). */
24078
+ var RetrainFrameWorkStateSchema = _enum([
24079
+ "unannotated",
24080
+ "annotated",
24081
+ "complete"
24082
+ ]);
24083
+ /**
24084
+ * Filters for paginated corpus list, KPI, and matching export (design §4.4).
24085
+ * Every narrowing field is ANDed; omitted fields impose no constraint.
24086
+ */
24087
+ var RetrainCorpusFilterSchema = object({
24088
+ workState: RetrainFrameWorkStateSchema.optional(),
24089
+ deviceIds: array(number()).max(500).optional(),
24090
+ /** When set, only frames in this named collection. */
24091
+ collectionId: string().optional(),
24092
+ /** Frames that carry at least one saved annotation in one of these classes. */
24093
+ classes: array(RetrainMacroClassSchema).optional(),
24094
+ page: number().int().positive().default(1),
24095
+ pageSize: number().int().positive().max(100).default(50)
24096
+ });
24097
+ var RetrainCorpusPageSchema = object({
24098
+ frames: array(RetrainFrameSchema.extend({ workState: RetrainFrameWorkStateSchema })).readonly(),
24099
+ total: number().int().nonnegative(),
24100
+ page: number().int().positive(),
24101
+ pageSize: number().int().positive()
24102
+ });
24103
+ var RetrainCorpusKpiCameraRowSchema = object({
24104
+ deviceId: number(),
24105
+ unannotated: number().int().nonnegative(),
24106
+ annotated: number().int().nonnegative(),
24107
+ complete: number().int().nonnegative(),
24108
+ /** This camera's `complete` count divided by corpus `total`, in `[0,1]`.
24109
+ * `null` when the corpus is empty (no ratio). */
24110
+ pctOfCorpus: number().min(0).max(1).nullable()
24111
+ });
24112
+ var RetrainCorpusKpiSchema = object({
24113
+ total: number().int().nonnegative(),
24114
+ unannotated: number().int().nonnegative(),
24115
+ annotated: number().int().nonnegative(),
24116
+ complete: number().int().nonnegative(),
24117
+ cameras: array(RetrainCorpusKpiCameraRowSchema).readonly()
24118
+ });
24067
24119
  /**
24068
24120
  * Which frames an annotated export carries. Every field narrows; an empty
24069
- * filter is every annotated copy. A dataset VERSION is a frozen `frameIds`
24070
- * list owned by whoever trains (the training orchestrator), so `frameIds` is
24071
- * the primitive a version export uses; `batchId` re-selects what an earlier
24072
- * export carried (`exportedInBatch`).
24121
+ * filter is every annotated copy. `frameIds` is the primitive a job or
24122
+ * download uses; `batchId` re-selects what an earlier export carried
24123
+ * (`exportedInBatch`). Frozen dataset versions were removed — live selection
24124
+ * resolves to `frameIds` at plan/start.
24073
24125
  */
24074
24126
  var RetrainExportFilterSchema = object({
24075
24127
  deviceIds: array(number()).optional(),
24076
24128
  frameIds: array(string()).max(2e4).optional(),
24077
24129
  /** Only frames in at least one of these named collections. */
24078
24130
  collectionIds: array(string()).max(200).optional(),
24079
- /** Exactly the frames of this dataset version (and its completeOnly). An
24080
- * unknown id selects nothing. */
24081
- datasetVersionId: string().optional(),
24131
+ /** Single collection (Frames filter bar). ANDed with `collectionIds` when both set. */
24132
+ collectionId: string().optional(),
24082
24133
  batchId: string().optional(),
24083
24134
  /** Only frames the operator marked complete (all subjects boxed). */
24084
- completeOnly: boolean().optional()
24135
+ completeOnly: boolean().optional(),
24136
+ /** Exclusive work-state partition (`workStateOf`); same as the corpus list. */
24137
+ workState: RetrainFrameWorkStateSchema.optional(),
24138
+ /** Frames with at least one saved annotation in one of these classes. */
24139
+ classes: array(RetrainMacroClassSchema).optional()
24085
24140
  });
24086
24141
  /**
24087
24142
  * `frames`: the full frame copies, boxes in `annotations.json`.
@@ -24281,8 +24336,7 @@ var RetrainDatasetStatsSchema = object({
24281
24336
  completeFrames: number().int()
24282
24337
  })).readonly()
24283
24338
  });
24284
- /** An immutable dataset version, without its frame list. */
24285
- var RetrainDatasetVersionSchema = object({
24339
+ object({
24286
24340
  id: string(),
24287
24341
  name: string(),
24288
24342
  createdAt: number(),
@@ -24290,22 +24344,33 @@ var RetrainDatasetVersionSchema = object({
24290
24344
  layout: RetrainExportLayoutSchema,
24291
24345
  completeOnly: boolean(),
24292
24346
  frameCount: number().int(),
24293
- /** sha256 of what the frames taught when the version was frozen. */
24294
24347
  annotationHash: string(),
24295
- /** The export manifest schema the version was cut under. */
24296
24348
  manifestSchema: string(),
24297
24349
  stats: RetrainDatasetStatsSchema
24298
24350
  });
24299
- var CreateRetrainDatasetVersionResultSchema = discriminatedUnion("kind", [object({
24300
- kind: literal("created"),
24301
- version: RetrainDatasetVersionSchema
24351
+ /**
24352
+ * Live training corpus criteria — same shape as `TrainingCorpusSelection` on
24353
+ * the training cap. Resolved here so plan/start and the annotated export share
24354
+ * one definition of "the frames" (`buildRetrainExportPlan`).
24355
+ */
24356
+ var RetrainTrainingCorpusSelectionSchema = object({
24357
+ collectionIds: array(string()).min(1),
24358
+ workState: _enum([
24359
+ "complete",
24360
+ "annotated_or_complete",
24361
+ "any_annotated"
24362
+ ]).default("complete")
24363
+ });
24364
+ var RetrainTrainingCorpusResolveResultSchema = discriminatedUnion("kind", [object({
24365
+ kind: literal("resolved"),
24366
+ frameIds: array(string()).max(2e4).readonly(),
24367
+ stats: RetrainDatasetStatsSchema,
24368
+ annotationHash: string(),
24369
+ layout: RetrainExportLayoutSchema
24302
24370
  }), object({
24303
24371
  kind: literal("refused"),
24304
- reason: _enum([
24305
- "empty-name",
24306
- "duplicate-name",
24307
- "no-frames"
24308
- ])
24372
+ reason: _enum(["unknown-collection", "no-frames"]),
24373
+ detail: string()
24309
24374
  })]);
24310
24375
  /** The outcome of a lifecycle move owned by the retrain page. */
24311
24376
  var RetrainTransitionResultSchema = object({
@@ -25012,6 +25077,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
25012
25077
  }), array(RetrainTrackSchema).readonly(), {
25013
25078
  kind: "query",
25014
25079
  auth: "admin"
25080
+ }), method(RetrainCorpusFilterSchema, RetrainCorpusPageSchema, {
25081
+ kind: "query",
25082
+ auth: "admin"
25083
+ }), method(object({}), RetrainCorpusKpiSchema, {
25084
+ kind: "query",
25085
+ auth: "admin"
25015
25086
  }), method(object({ trackId: string() }), RetrainFrameListSchema, {
25016
25087
  kind: "query",
25017
25088
  auth: "admin"
@@ -25107,36 +25178,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
25107
25178
  kind: "mutation",
25108
25179
  auth: "admin",
25109
25180
  timeoutMs: 12e4
25110
- }), method(object({
25111
- selection: RetrainDatasetSelectionSchema,
25112
- completeOnly: boolean().optional()
25113
- }), RetrainDatasetStatsSchema, {
25114
- kind: "query",
25115
- auth: "admin"
25116
- }), method(object({
25117
- name: string().max(120),
25118
- selection: RetrainDatasetSelectionSchema,
25119
- layout: RetrainExportLayoutSchema,
25120
- completeOnly: boolean()
25121
- }), CreateRetrainDatasetVersionResultSchema, {
25122
- kind: "mutation",
25123
- auth: "admin",
25124
- timeoutMs: 12e4
25125
- }), method(object({}), array(RetrainDatasetVersionSchema).readonly(), {
25126
- kind: "query",
25127
- auth: "admin"
25128
- }), method(object({ id: string() }), object({ deleted: boolean() }), {
25129
- kind: "mutation",
25130
- auth: "admin"
25131
- }), method(object({ id: string() }), object({
25132
- found: boolean(),
25133
- annotationHash: string(),
25134
- matches: boolean(),
25135
- missingFrames: number().int()
25136
- }), {
25137
- kind: "query",
25138
- auth: "admin",
25139
- timeoutMs: 12e4
25140
25181
  }), method(object({}), array(RetrainAssistProfileSchema).readonly(), {
25141
25182
  kind: "query",
25142
25183
  auth: "admin"
@@ -25163,6 +25204,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
25163
25204
  }), method(object({}), array(RetrainCollectionSchema).readonly(), {
25164
25205
  kind: "query",
25165
25206
  auth: "admin"
25207
+ }), method(RetrainTrainingCorpusSelectionSchema, RetrainTrainingCorpusResolveResultSchema, {
25208
+ kind: "query",
25209
+ auth: "admin",
25210
+ timeoutMs: 6e4
25166
25211
  }), method(object({
25167
25212
  id: string(),
25168
25213
  name: string().max(120)
@@ -25779,11 +25824,14 @@ var HardwareClassIdSchema = _enum([
25779
25824
  "intel-n-series",
25780
25825
  "apple-m-base",
25781
25826
  "apple-m-pro",
25827
+ "amd-phoenix",
25782
25828
  "unknown"
25783
25829
  ]);
25784
25830
  var AcceleratorKindSchema = _enum([
25785
25831
  "intel-npu",
25786
25832
  "intel-igpu",
25833
+ "amd-igpu",
25834
+ "amd-npu",
25787
25835
  "x86-cpu",
25788
25836
  "arm-cpu",
25789
25837
  "apple-ane",
@@ -27673,6 +27721,8 @@ var AgentPipelineSettingsSchema = object({
27673
27721
  * address is wrong (multi-homed host, NAT, custom interface).
27674
27722
  */
27675
27723
  reachableHost: string().optional(),
27724
+ /** Hub-persisted UI colour (`--color-node-*` theme tokens). */
27725
+ color: NodeColorIdSchema.optional(),
27676
27726
  /**
27677
27727
  * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
27678
27728
  * weight, steps}. Absent / all-disabled ⇒ the node's single default
@@ -28222,8 +28272,9 @@ method(object({
28222
28272
  auth: "admin"
28223
28273
  }), method(object({
28224
28274
  agentNodeId: string(),
28225
- reachableHost: string().nullable()
28226
- }), object({ success: literal(true) }), {
28275
+ reachableHost: string().nullable().optional(),
28276
+ color: NodeColorIdSchema.nullable().optional()
28277
+ }).refine((v) => v.reachableHost !== void 0 || v.color !== void 0, { message: "reachableHost or color required" }), object({ success: literal(true) }), {
28227
28278
  kind: "mutation",
28228
28279
  auth: "admin"
28229
28280
  }), method(object({
@@ -31305,7 +31356,7 @@ var CustomActionInputSchema = object({
31305
31356
  action: string().min(1),
31306
31357
  input: unknown()
31307
31358
  });
31308
- method(_void(), array(AddonListItemSchema).readonly()), method(object({
31359
+ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSchema).readonly()), method(object({
31309
31360
  addonId: string(),
31310
31361
  limit: number().min(1).max(500).default(100),
31311
31362
  level: LogLevelSchema$2.optional()
@@ -35198,6 +35249,7 @@ var OsdNamedTemplateSchema = object({
35198
35249
  });
35199
35250
  /** Where a slot's value comes from. */
35200
35251
  var OsdSourceSchema = discriminatedUnion("kind", [
35252
+ object({ kind: literal("none") }),
35201
35253
  object({
35202
35254
  kind: literal("static"),
35203
35255
  text: string().max(64)
@@ -35324,6 +35376,13 @@ method(object({ deviceId: number().int() }), object({
35324
35376
  }), object({ success: literal(true) }), {
35325
35377
  kind: "mutation",
35326
35378
  auth: "admin"
35379
+ }), method(object({
35380
+ deviceId: number().int(),
35381
+ slotId: string().min(1),
35382
+ enabled: boolean()
35383
+ }), object({ success: literal(true) }), {
35384
+ kind: "mutation",
35385
+ auth: "admin"
35327
35386
  }), method(object({
35328
35387
  sourceDeviceId: number().int(),
35329
35388
  targetDeviceId: number().int()
@@ -35704,7 +35763,15 @@ var GpuInfoSchema = object({
35704
35763
  name: string(),
35705
35764
  memoryMB: number().optional()
35706
35765
  });
35707
- var NpuInfoSchema = object({ type: _enum(["apple-ane", "intel-npu"]) });
35766
+ var NpuInfoSchema = object({
35767
+ type: _enum([
35768
+ "apple-ane",
35769
+ "intel-npu",
35770
+ "amd-xdna"
35771
+ ]),
35772
+ name: string().optional(),
35773
+ generation: _enum(["xdna1", "xdna2"]).optional()
35774
+ });
35708
35775
  var CoralInfoSchema = object({
35709
35776
  type: literal("coral-edgetpu"),
35710
35777
  bus: string().optional()
@@ -39466,9 +39533,11 @@ DeviceType.Camera, method(object({
39466
39533
  * once is what makes a second provider (RunPod, a local NVIDIA node) a new
39467
39534
  * manifest entry and nothing else.
39468
39535
  *
39469
- * Collection, routed by the `addonId` in every single-row input (the `llm` /
39470
- * `notification-output` posture); `describe` concat-fans across providers.
39471
- * Every method is `admin`: these spend money.
39536
+ * Collection of provider **types** (addons). Each addon owns zero or more
39537
+ * **entries** (credentials + defaults). Concat-fans: `describe`,
39538
+ * `describeTypes`, `listEntries`, `listJobs`. Single-row work is keyed by
39539
+ * `entryId`; callers also pass the owning `addonId` as the collection
39540
+ * selector (broker posture). Every method is `admin`: these spend money.
39472
39541
  *
39473
39542
  * Every cloud object a provider creates is tagged with the orchestrator's
39474
39543
  * `jobKey`, so a retried submit finds the job it already started instead of
@@ -39492,8 +39561,8 @@ var TrainingRegionOptionSchema = object({
39492
39561
  priceMultiplier: number().positive()
39493
39562
  });
39494
39563
  /**
39495
- * The provider's per-account settings, as the orchestrator reads them. They
39496
- * live in the PROVIDER addon's settings (operator decision 2026-10-08: they
39564
+ * The provider's per-entry settings, as the orchestrator reads them. They
39565
+ * live on the PROVIDER addon's entry (operator decision 2026-10-08: they
39497
39566
  * depend on the user's account), never hard-coded in the orchestrator.
39498
39567
  */
39499
39568
  var TrainingProviderDefaultsSchema = object({
@@ -39504,9 +39573,44 @@ var TrainingProviderDefaultsSchema = object({
39504
39573
  /** Hours a FAILED job's cloud dataset is kept for debugging; 0 = delete at once. */
39505
39574
  failedDatasetGraceHours: number().nonnegative()
39506
39575
  });
39576
+ /**
39577
+ * Entry form schema for a provider type — same seam as notification
39578
+ * `TargetKind.configSchema` (`z.unknown()` at the wire; callers tighten to
39579
+ * {@link ConfigUISchema}). Drives `ConfigFormBuilder` on Training → Providers.
39580
+ */
39581
+ var ConfigSchemaPassthrough = unknown();
39582
+ /** One creatable provider type, for the Add-entry dialog. */
39583
+ var TrainingProviderTypeSchema = object({
39584
+ typeId: string(),
39585
+ label: string(),
39586
+ /** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
39587
+ iconAsset: string(),
39588
+ /** Owning `training-provider` addon — collection selector for createEntry. */
39589
+ addonId: string(),
39590
+ /**
39591
+ * Fields for one entry of this type (credentials + defaults). Absent on a
39592
+ * type that only needs a name. Password fields are keychain-backed on the
39593
+ * provider addon (`secretStatePaths`), not D634 plaintext.
39594
+ */
39595
+ configSchema: ConfigSchemaPassthrough.optional()
39596
+ });
39597
+ /** One configured account / workspace under a provider type. */
39598
+ var TrainingProviderEntrySchema = object({
39599
+ entryId: string(),
39600
+ typeId: string(),
39601
+ name: string(),
39602
+ addonId: string(),
39603
+ /** Credentials are present — never the values. */
39604
+ configured: boolean()
39605
+ });
39507
39606
  var TrainingProviderDescriptorSchema = object({
39508
39607
  addonId: string(),
39509
- /** `modal`, `runpod`, `fake`, … */
39608
+ entryId: string(),
39609
+ typeId: string(),
39610
+ /** Operator-chosen entry name. */
39611
+ name: string(),
39612
+ iconAsset: string(),
39613
+ /** `modal`, `runpod`, `fake`, … — same as typeId for current providers. */
39510
39614
  kind: string(),
39511
39615
  label: string(),
39512
39616
  gpuTypes: array(TrainingGpuOptionSchema).readonly(),
@@ -39518,7 +39622,30 @@ var TrainingProviderDescriptorSchema = object({
39518
39622
  dataResidencyNote: string(),
39519
39623
  /** Credentials are present — never the values. */
39520
39624
  configured: boolean(),
39521
- defaults: TrainingProviderDefaultsSchema
39625
+ defaults: TrainingProviderDefaultsSchema,
39626
+ /**
39627
+ * Values for {@link TrainingProviderTypeSchema}'s `configSchema` — password
39628
+ * fields are keychain {@link SecretFieldView} or `null` / `''` (create),
39629
+ * never plaintext. Same hydrate contract as settings forms (D789).
39630
+ */
39631
+ formValues: record(string(), unknown()).optional()
39632
+ });
39633
+ /**
39634
+ * Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
39635
+ * An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
39636
+ * `{ $secretClear: true }` clears it.
39637
+ */
39638
+ var TrainingProviderUpdateEntryInputSchema = object({
39639
+ entryId: string().min(1),
39640
+ name: string().min(1),
39641
+ tokenId: string().optional(),
39642
+ tokenSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
39643
+ environment: string().optional(),
39644
+ gpuType: string().optional(),
39645
+ region: string().optional(),
39646
+ costCapUsd: number().nonnegative().optional(),
39647
+ maxRuntimeSec: number().int().positive().optional(),
39648
+ failedDatasetGraceHours: number().nonnegative().optional()
39522
39649
  });
39523
39650
  var TrainingCredentialCheckSchema = object({
39524
39651
  ok: boolean(),
@@ -39570,20 +39697,33 @@ var TrainerSourceRefSchema = object({
39570
39697
  /** A commit sha (never a branch) — the job must be reproducible. */
39571
39698
  revision: string().regex(/^[0-9a-f]{7,64}$/)
39572
39699
  });
39700
+ /** Cloud job identity — route with the owning addon's `addonId` selector. */
39573
39701
  var JobRef = {
39574
- addonId: string(),
39702
+ entryId: string().min(1),
39575
39703
  jobKey: string().uuid()
39576
39704
  };
39577
39705
  var TrainingLogLineSchema = object({
39578
39706
  ts: number(),
39579
39707
  text: string()
39580
39708
  });
39581
- method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({ addonId: string() }), TrainingCredentialCheckSchema, {
39709
+ method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderTypeSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderEntrySchema).readonly(), { auth: "admin" }), method(object({
39710
+ typeId: string().min(1),
39711
+ name: string().min(1)
39712
+ }), object({ entryId: string() }), {
39713
+ kind: "mutation",
39714
+ auth: "admin"
39715
+ }), method(object({ entryId: string().min(1) }), object({ ok: literal(true) }), {
39716
+ kind: "mutation",
39717
+ auth: "admin"
39718
+ }), method(TrainingProviderUpdateEntryInputSchema, object({ ok: literal(true) }), {
39719
+ kind: "mutation",
39720
+ auth: "admin"
39721
+ }), method(object({ entryId: string().min(1) }), TrainingCredentialCheckSchema, {
39582
39722
  kind: "mutation",
39583
39723
  auth: "admin",
39584
39724
  timeoutMs: 3e4
39585
39725
  }), method(object({
39586
- addonId: string(),
39726
+ entryId: string().min(1),
39587
39727
  gpuType: string(),
39588
39728
  region: string(),
39589
39729
  datasetBytes: number().int().nonnegative(),
@@ -39649,7 +39789,7 @@ method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "
39649
39789
  kind: "mutation",
39650
39790
  auth: "admin",
39651
39791
  timeoutMs: 5 * 6e4
39652
- }), method(object({ addonId: string() }), array(ProviderJobStatusSchema).readonly(), {
39792
+ }), method(object({ entryId: string().min(1).optional() }), array(ProviderJobStatusSchema).readonly(), {
39653
39793
  auth: "admin",
39654
39794
  timeoutMs: 2 * 6e4
39655
39795
  });
@@ -39659,20 +39799,31 @@ method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "
39659
39799
  *
39660
39800
  * It owns what every provider must agree on, written once:
39661
39801
  *
39662
- * - **Dataset versions.** Taken over from pipeline-analytics (D796): the rows
39663
- * live here (D808); pipeline-analytics still CUTS a version (it owns the corpus and
39664
- * the export plan) and reaches this store through the five row methods
39665
- * below, so the Retrain page and the export did not change.
39666
39802
  * - **Jobs.** A persisted state machine, a reconcile loop against the
39667
39803
  * provider, a cost guard, a daily orphan sweep and the retention rules.
39668
39804
  * - **The return flow.** Verified artefacts → Model Studio
39669
39805
  * (`custom-model-registry.importModelBundle`) → canary on cameras →
39670
39806
  * rollback. Nothing is ever registered automatically.
39671
39807
  *
39808
+ * Plan/start takes a live {@link TrainingCorpusSelection} (collections +
39809
+ * work-state rule); frame ids are resolved via pipeline-analytics at that
39810
+ * moment and snapshotted on the job. No frozen dataset version.
39811
+ *
39672
39812
  * Every method is `admin`.
39673
39813
  */
39674
- /** A version WITH its frame list — what the export and a job read. */
39675
- var TrainingDatasetVersionRowSchema = RetrainDatasetVersionSchema.omit({ frameCount: true }).extend({ frameIds: array(string()).max(2e4).readonly() });
39814
+ /**
39815
+ * Live corpus criteria for plan/start (design §5.2). Default is complete-only.
39816
+ * Frame ids are resolved at plan/start — never a frozen version id.
39817
+ */
39818
+ var TrainingCorpusSelectionSchema = object({
39819
+ collectionIds: array(string()).min(1),
39820
+ /** Default complete-only for v1 */
39821
+ workState: _enum([
39822
+ "complete",
39823
+ "annotated_or_complete",
39824
+ "any_annotated"
39825
+ ]).default("complete")
39826
+ });
39676
39827
  /** A base model a detector job can fine-tune, and the baseline it is judged against. */
39677
39828
  var TrainingBaseModelSchema = object({
39678
39829
  modelId: string(),
@@ -39690,9 +39841,13 @@ var TrainingPresetSchema = _enum([
39690
39841
  "thorough"
39691
39842
  ]);
39692
39843
  var TrainingJobRequestSchema = object({
39693
- datasetVersionId: string().min(1),
39694
- /** The `training-provider` addon that runs it. */
39695
- addonId: string().min(1),
39844
+ /** Live collection + work-state criteria; resolved at plan/start. */
39845
+ selection: TrainingCorpusSelectionSchema,
39846
+ /**
39847
+ * The provider **entry** that runs it (credentials + defaults).
39848
+ * Resolve to an owning addon via `training-provider.describe` / `listEntries`.
39849
+ */
39850
+ entryId: string().min(1),
39696
39851
  gpuType: string().min(1),
39697
39852
  region: string(),
39698
39853
  baseModelId: string().min(1),
@@ -39751,6 +39906,7 @@ var TrainingJobPlanSchema = object({
39751
39906
  * result lives after the operator acted on it.
39752
39907
  */
39753
39908
  var TrainingJobStateSchema = _enum([
39909
+ "queued",
39754
39910
  "uploading",
39755
39911
  "submitted",
39756
39912
  "starting",
@@ -39804,6 +39960,11 @@ var TrainingJobSchema = object({
39804
39960
  createdAt: number(),
39805
39961
  updatedAt: number(),
39806
39962
  state: TrainingJobStateSchema,
39963
+ /**
39964
+ * Shared by every job enqueued together via `startJobBatch`.
39965
+ * `null` for a lone `startJob`. The engine advances queued siblings by this id.
39966
+ */
39967
+ batchId: string().nullable().default(null),
39807
39968
  stage: TrainingStageSchema.nullable(),
39808
39969
  failure: object({
39809
39970
  reason: TrainingFailureReasonSchema,
@@ -39815,6 +39976,12 @@ var TrainingJobSchema = object({
39815
39976
  maxRuntimeSec: number().int().positive(),
39816
39977
  trainer: TrainerSourceRefSchema,
39817
39978
  datasetLayout: RetrainExportLayoutSchema,
39979
+ /** Frame count snapshotted when the job started (audit; equals `frameIds.length`). */
39980
+ frameCount: number().int().nonnegative(),
39981
+ /** Resolved frame ids at start — the archive ships exactly these. */
39982
+ frameIds: array(string()).max(2e4).readonly(),
39983
+ /** Hash of what those frames taught at start (trainer `dataset.annotationHash`). */
39984
+ annotationHash: string(),
39818
39985
  dataset: object({
39819
39986
  bytes: number().int(),
39820
39987
  sha256: string(),
@@ -39856,13 +40023,7 @@ var TrainingJobSchema = object({
39856
40023
  canary: TrainingCanarySchema.nullable()
39857
40024
  });
39858
40025
  var IdInput = object({ id: string().min(1) });
39859
- method(TrainingDatasetVersionRowSchema, object({ stored: boolean() }), {
39860
- kind: "mutation",
39861
- auth: "admin"
39862
- }), method(IdInput, TrainingDatasetVersionRowSchema.nullable(), { auth: "admin" }), method(object({}), array(RetrainDatasetVersionSchema).readonly(), { auth: "admin" }), method(object({ name: string() }), object({ id: string().nullable() }), { auth: "admin" }), method(IdInput, object({ removed: boolean() }), {
39863
- kind: "mutation",
39864
- auth: "admin"
39865
- }), method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }), method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
40026
+ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" }), method(TrainingJobRequestSchema, TrainingJobPlanSchema, {
39866
40027
  auth: "admin",
39867
40028
  timeoutMs: 6e4
39868
40029
  }), method(TrainingJobRequestSchema.extend({
@@ -39881,6 +40042,24 @@ method(TrainingDatasetVersionRowSchema, object({ stored: boolean() }), {
39881
40042
  kind: "mutation",
39882
40043
  auth: "admin",
39883
40044
  timeoutMs: 12e4
40045
+ }), method(TrainingJobRequestSchema.omit({ baseModelId: true }).extend({
40046
+ baseModelIds: array(string().min(1)).min(1),
40047
+ name: string().min(1).max(120),
40048
+ maxCostUsd: number().positive(),
40049
+ maxRuntimeSec: number().int().positive(),
40050
+ idempotencyKey: string().min(8).max(80)
40051
+ }), discriminatedUnion("kind", [object({
40052
+ kind: literal("started"),
40053
+ batchId: string(),
40054
+ jobs: array(TrainingJobSchema).min(1).readonly()
40055
+ }), object({
40056
+ kind: literal("refused"),
40057
+ reason: TrainingRefusalReasonSchema,
40058
+ detail: string()
40059
+ })]), {
40060
+ kind: "mutation",
40061
+ auth: "admin",
40062
+ timeoutMs: 12e4
39884
40063
  }), method(object({}), array(TrainingJobSchema).readonly(), { auth: "admin" }), method(IdInput, TrainingJobSchema.nullable(), { auth: "admin" }), method(IdInput, TrainingJobSchema, {
39885
40064
  kind: "mutation",
39886
40065
  auth: "admin",
@@ -43986,6 +44165,12 @@ Object.freeze({
43986
44165
  addonId: null,
43987
44166
  access: "create"
43988
44167
  },
44168
+ "osdManager.setSlotCameraEnabled": {
44169
+ capName: "osd-manager",
44170
+ capScope: "system",
44171
+ addonId: null,
44172
+ access: "create"
44173
+ },
43989
44174
  "osdManager.upsertTemplate": {
43990
44175
  capName: "osd-manager",
43991
44176
  capScope: "system",
@@ -44124,12 +44309,6 @@ Object.freeze({
44124
44309
  addonId: null,
44125
44310
  access: "create"
44126
44311
  },
44127
- "pipelineAnalytics.createRetrainDatasetVersion": {
44128
- capName: "pipeline-analytics",
44129
- capScope: "device",
44130
- addonId: null,
44131
- access: "create"
44132
- },
44133
44312
  "pipelineAnalytics.deleteDeviceEvents": {
44134
44313
  capName: "pipeline-analytics",
44135
44314
  capScope: "device",
@@ -44142,12 +44321,6 @@ Object.freeze({
44142
44321
  addonId: null,
44143
44322
  access: "delete"
44144
44323
  },
44145
- "pipelineAnalytics.deleteRetrainDatasetVersion": {
44146
- capName: "pipeline-analytics",
44147
- capScope: "device",
44148
- addonId: null,
44149
- access: "delete"
44150
- },
44151
44324
  "pipelineAnalytics.deleteTracks": {
44152
44325
  capName: "pipeline-analytics",
44153
44326
  capScope: "device",
@@ -44250,6 +44423,12 @@ Object.freeze({
44250
44423
  addonId: null,
44251
44424
  access: "view"
44252
44425
  },
44426
+ "pipelineAnalytics.getRetrainCorpusKpi": {
44427
+ capName: "pipeline-analytics",
44428
+ capScope: "device",
44429
+ addonId: null,
44430
+ access: "view"
44431
+ },
44253
44432
  "pipelineAnalytics.getRetrainExportUrl": {
44254
44433
  capName: "pipeline-analytics",
44255
44434
  capScope: "device",
@@ -44370,7 +44549,7 @@ Object.freeze({
44370
44549
  addonId: null,
44371
44550
  access: "view"
44372
44551
  },
44373
- "pipelineAnalytics.listRetrainDatasetVersions": {
44552
+ "pipelineAnalytics.listRetrainCorpusPage": {
44374
44553
  capName: "pipeline-analytics",
44375
44554
  capScope: "device",
44376
44555
  addonId: null,
@@ -44424,12 +44603,6 @@ Object.freeze({
44424
44603
  addonId: null,
44425
44604
  access: "create"
44426
44605
  },
44427
- "pipelineAnalytics.previewRetrainDataset": {
44428
- capName: "pipeline-analytics",
44429
- capScope: "device",
44430
- addonId: null,
44431
- access: "view"
44432
- },
44433
44606
  "pipelineAnalytics.proposeRetrainAnnotations": {
44434
44607
  capName: "pipeline-analytics",
44435
44608
  capScope: "device",
@@ -44508,6 +44681,12 @@ Object.freeze({
44508
44681
  addonId: null,
44509
44682
  access: "create"
44510
44683
  },
44684
+ "pipelineAnalytics.resolveRetrainTrainingCorpus": {
44685
+ capName: "pipeline-analytics",
44686
+ capScope: "device",
44687
+ addonId: null,
44688
+ access: "view"
44689
+ },
44511
44690
  "pipelineAnalytics.restageRetrainTrack": {
44512
44691
  capName: "pipeline-analytics",
44513
44692
  capScope: "device",
@@ -44568,12 +44747,6 @@ Object.freeze({
44568
44747
  addonId: null,
44569
44748
  access: "create"
44570
44749
  },
44571
- "pipelineAnalytics.verifyRetrainDatasetVersion": {
44572
- capName: "pipeline-analytics",
44573
- capScope: "device",
44574
- addonId: null,
44575
- access: "view"
44576
- },
44577
44750
  "pipelineAnalytics.wipeAllAnalytics": {
44578
44751
  capName: "pipeline-analytics",
44579
44752
  capScope: "device",
@@ -46968,18 +47141,6 @@ Object.freeze({
46968
47141
  addonId: null,
46969
47142
  access: "create"
46970
47143
  },
46971
- "training.findDatasetVersionIdByName": {
46972
- capName: "training",
46973
- capScope: "system",
46974
- addonId: null,
46975
- access: "view"
46976
- },
46977
- "training.getDatasetVersion": {
46978
- capName: "training",
46979
- capScope: "system",
46980
- addonId: null,
46981
- access: "view"
46982
- },
46983
47144
  "training.getJob": {
46984
47145
  capName: "training",
46985
47146
  capScope: "system",
@@ -46998,12 +47159,6 @@ Object.freeze({
46998
47159
  addonId: null,
46999
47160
  access: "view"
47000
47161
  },
47001
- "training.listDatasetVersions": {
47002
- capName: "training",
47003
- capScope: "system",
47004
- addonId: null,
47005
- access: "view"
47006
- },
47007
47162
  "training.listJobs": {
47008
47163
  capName: "training",
47009
47164
  capScope: "system",
@@ -47016,54 +47171,66 @@ Object.freeze({
47016
47171
  addonId: null,
47017
47172
  access: "view"
47018
47173
  },
47019
- "training.putDatasetVersion": {
47174
+ "training.registerResult": {
47020
47175
  capName: "training",
47021
47176
  capScope: "system",
47022
47177
  addonId: null,
47023
47178
  access: "create"
47024
47179
  },
47025
- "training.registerResult": {
47180
+ "training.rollbackCanary": {
47026
47181
  capName: "training",
47027
47182
  capScope: "system",
47028
47183
  addonId: null,
47029
47184
  access: "create"
47030
47185
  },
47031
- "training.removeDatasetVersion": {
47186
+ "training.startJob": {
47032
47187
  capName: "training",
47033
47188
  capScope: "system",
47034
47189
  addonId: null,
47035
- access: "delete"
47190
+ access: "create"
47036
47191
  },
47037
- "training.rollbackCanary": {
47192
+ "training.startJobBatch": {
47038
47193
  capName: "training",
47039
47194
  capScope: "system",
47040
47195
  addonId: null,
47041
47196
  access: "create"
47042
47197
  },
47043
- "training.startJob": {
47044
- capName: "training",
47198
+ "trainingProvider.cancelJob": {
47199
+ capName: "training-provider",
47045
47200
  capScope: "system",
47046
47201
  addonId: null,
47047
47202
  access: "create"
47048
47203
  },
47049
- "trainingProvider.cancelJob": {
47204
+ "trainingProvider.cleanupJob": {
47050
47205
  capName: "training-provider",
47051
47206
  capScope: "system",
47052
47207
  addonId: null,
47053
47208
  access: "create"
47054
47209
  },
47055
- "trainingProvider.cleanupJob": {
47210
+ "trainingProvider.createEntry": {
47056
47211
  capName: "training-provider",
47057
47212
  capScope: "system",
47058
47213
  addonId: null,
47059
47214
  access: "create"
47060
47215
  },
47216
+ "trainingProvider.deleteEntry": {
47217
+ capName: "training-provider",
47218
+ capScope: "system",
47219
+ addonId: null,
47220
+ access: "delete"
47221
+ },
47061
47222
  "trainingProvider.describe": {
47062
47223
  capName: "training-provider",
47063
47224
  capScope: "system",
47064
47225
  addonId: null,
47065
47226
  access: "view"
47066
47227
  },
47228
+ "trainingProvider.describeTypes": {
47229
+ capName: "training-provider",
47230
+ capScope: "system",
47231
+ addonId: null,
47232
+ access: "view"
47233
+ },
47067
47234
  "trainingProvider.estimateJob": {
47068
47235
  capName: "training-provider",
47069
47236
  capScope: "system",
@@ -47076,6 +47243,12 @@ Object.freeze({
47076
47243
  addonId: null,
47077
47244
  access: "view"
47078
47245
  },
47246
+ "trainingProvider.listEntries": {
47247
+ capName: "training-provider",
47248
+ capScope: "system",
47249
+ addonId: null,
47250
+ access: "view"
47251
+ },
47079
47252
  "trainingProvider.listJobEvents": {
47080
47253
  capName: "training-provider",
47081
47254
  capScope: "system",
@@ -47106,6 +47279,12 @@ Object.freeze({
47106
47279
  addonId: null,
47107
47280
  access: "create"
47108
47281
  },
47282
+ "trainingProvider.updateEntry": {
47283
+ capName: "training-provider",
47284
+ capScope: "system",
47285
+ addonId: null,
47286
+ access: "create"
47287
+ },
47109
47288
  "trainingProvider.uploadDataset": {
47110
47289
  capName: "training-provider",
47111
47290
  capScope: "system",
@@ -50316,6 +50495,11 @@ Object.freeze({
50316
50495
  form: "single",
50317
50496
  optional: false
50318
50497
  }],
50498
+ "osdManager.setSlotCameraEnabled": [{
50499
+ name: "deviceId",
50500
+ form: "single",
50501
+ optional: false
50502
+ }],
50319
50503
  "petFeeder.callPet": [{
50320
50504
  name: "deviceId",
50321
50505
  form: "single",
@@ -50536,6 +50720,11 @@ Object.freeze({
50536
50720
  form: "array",
50537
50721
  optional: false
50538
50722
  }],
50723
+ "pipelineAnalytics.listRetrainCorpusPage": [{
50724
+ name: "deviceIds",
50725
+ form: "array",
50726
+ optional: true
50727
+ }],
50539
50728
  "pipelineAnalytics.listRetrainStaging": [{
50540
50729
  name: "deviceIds",
50541
50730
  form: "array",
@@ -51645,6 +51834,7 @@ Object.freeze({
51645
51834
  });
51646
51835
  Object.freeze({
51647
51836
  "broker": "broker",
51837
+ "calendar-source": "calendar",
51648
51838
  "device-export": "device-export",
51649
51839
  "llm": "ai",
51650
51840
  "mesh-network": "mesh",