@camstack/addon-training 0.1.52 → 0.1.54

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 (20) hide show
  1. package/dist/{MotionZonesSettings-Cau1SI-b.mjs → MotionZonesSettings-DyDTHPys.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-DmJWF2_b.mjs → PrivacyMaskSettings-axajI4sK.mjs} +2 -2
  3. package/dist/{SceneMonitorEditor-BSZqSQ0p.mjs → SceneMonitorEditor-BjLJsI6P.mjs} +1 -1
  4. package/dist/_stub.js +9 -9
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-g28Hr7pc.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-CTdPJIbP.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-bhLaA3pg.mjs +26 -0
  7. package/dist/{dist-DVe1xcMf.js → dist-21g95f5X.js} +633 -47
  8. package/dist/{dist-KECbhuG2.mjs → dist-91Rnxphf.mjs} +633 -47
  9. package/dist/{hostInit-COAzU4jk.mjs → hostInit-CTK-hcBi.mjs} +2 -2
  10. package/dist/index.js +1 -1
  11. package/dist/orchestrator/training.addon.js +1 -1
  12. package/dist/orchestrator/training.addon.mjs +1 -1
  13. package/dist/{player-overlays-Dd7lUDqm.mjs → player-overlays-B4kmFVR9.mjs} +1 -1
  14. package/dist/providers/modal/training-modal.addon.js +1 -1
  15. package/dist/providers/modal/training-modal.addon.mjs +1 -1
  16. package/dist/remoteEntry.js +1 -1
  17. package/dist/{responsive-kf4rDTpJ.mjs → responsive-9DT2DlLH.mjs} +1 -1
  18. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-7yP2teCi.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-Cui1iZ9z.mjs} +1 -1
  19. package/package.json +1 -1
  20. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DuAkPx1X.mjs +0 -26
@@ -5438,7 +5438,7 @@ var ZodIssueCode = {
5438
5438
  var ZodFirstPartyTypeKind;
5439
5439
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5440
5440
  //#endregion
5441
- //#region ../types/dist/sleep-bgZLodYc.mjs
5441
+ //#region ../types/dist/sleep-WsrozGDL.mjs
5442
5442
  /**
5443
5443
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5444
5444
  * window to float samples (D455).
@@ -5555,7 +5555,7 @@ function isKeychainStoredField(field) {
5555
5555
  var SECRET_CLEAR = { $secretClear: true };
5556
5556
  /** The `'***'` token D634 redaction writes for non-admins. */
5557
5557
  var LEGACY_DEVICE_REDACTION = "***";
5558
- function isRecord$2(value) {
5558
+ function isRecord$4(value) {
5559
5559
  return typeof value === "object" && value !== null && !Array.isArray(value);
5560
5560
  }
5561
5561
  function makeSecretMarker(ref) {
@@ -5566,12 +5566,12 @@ function makeSecretMarker(ref) {
5566
5566
  }
5567
5567
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5568
5568
  function isSecretMarker(value) {
5569
- if (!isRecord$2(value)) return false;
5569
+ if (!isRecord$4(value)) return false;
5570
5570
  const ref = value["$secret"];
5571
5571
  return typeof ref === "string" && ref.length > 0;
5572
5572
  }
5573
5573
  function isSecretClear(value) {
5574
- return isRecord$2(value) && value["$secretClear"] === true;
5574
+ return isRecord$4(value) && value["$secretClear"] === true;
5575
5575
  }
5576
5576
  /**
5577
5577
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6181,7 +6181,7 @@ var KeychainWriteRefusedError = class extends Error {
6181
6181
  }
6182
6182
  };
6183
6183
  var KEEP = { kind: "keep" };
6184
- function isRecord$1(value) {
6184
+ function isRecord$3(value) {
6185
6185
  return typeof value === "object" && value !== null && !Array.isArray(value);
6186
6186
  }
6187
6187
  function defaultMintId() {
@@ -6194,7 +6194,7 @@ function collectSecretMarkerRefs(value, out = []) {
6194
6194
  return out;
6195
6195
  }
6196
6196
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6197
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6197
+ else if (isRecord$3(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6198
6198
  return out;
6199
6199
  }
6200
6200
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6249,7 +6249,7 @@ function rowId(row, idKey) {
6249
6249
  return null;
6250
6250
  }
6251
6251
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6252
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6252
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$3) : [];
6253
6253
  if (!Array.isArray(incoming)) {
6254
6254
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6255
6255
  return {
@@ -6265,7 +6265,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6265
6265
  const kept = /* @__PURE__ */ new Set();
6266
6266
  const rows = [];
6267
6267
  for (const row of incoming) {
6268
- if (!isRecord$1(row)) {
6268
+ if (!isRecord$3(row)) {
6269
6269
  rows.push(row);
6270
6270
  continue;
6271
6271
  }
@@ -6290,7 +6290,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6290
6290
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6291
6291
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6292
6292
  case "object": {
6293
- if (!isRecord$1(incoming)) {
6293
+ if (!isRecord$3(incoming)) {
6294
6294
  if (incoming === void 0) return KEEP;
6295
6295
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6296
6296
  return {
@@ -6298,7 +6298,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6298
6298
  value: incoming
6299
6299
  };
6300
6300
  }
6301
- const storedObj = isRecord$1(stored) ? stored : {};
6301
+ const storedObj = isRecord$3(stored) ? stored : {};
6302
6302
  return {
6303
6303
  kind: "value",
6304
6304
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6421,7 +6421,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6421
6421
  value: items
6422
6422
  };
6423
6423
  }
6424
- if (isRecord$1(v)) {
6424
+ if (isRecord$3(v)) {
6425
6425
  const out = {};
6426
6426
  for (const [k, child] of Object.entries(v)) {
6427
6427
  const s = substitute(child);
@@ -6453,7 +6453,7 @@ var SecretOverwriteRefusedError = class extends Error {
6453
6453
  this.name = "SecretOverwriteRefusedError";
6454
6454
  }
6455
6455
  };
6456
- function isRecord(value) {
6456
+ function isRecord$2(value) {
6457
6457
  return typeof value === "object" && value !== null && !Array.isArray(value);
6458
6458
  }
6459
6459
  function resolvedValue(pass, marker) {
@@ -6482,7 +6482,7 @@ function inArray(pass, incoming, stored) {
6482
6482
  return incoming.map((item, index) => {
6483
6483
  const twin = stored[index];
6484
6484
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6485
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6485
+ if (isRecord$2(item) && isRecord$2(twin)) return inArrayRow(pass, item, twin);
6486
6486
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6487
6487
  return item;
6488
6488
  });
@@ -6493,7 +6493,7 @@ function inArrayRow(pass, incoming, stored) {
6493
6493
  const twin = stored[key];
6494
6494
  if (isSecretMarker(twin)) {
6495
6495
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6496
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6496
+ } else if (isRecord$2(value) && isRecord$2(twin)) out[key] = inArrayRow(pass, value, twin);
6497
6497
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6498
6498
  }
6499
6499
  return out;
@@ -6501,7 +6501,7 @@ function inArrayRow(pass, incoming, stored) {
6501
6501
  async function walk(pass, incoming, stored) {
6502
6502
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6503
6503
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6504
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6504
+ if (!isRecord$2(incoming) || !isRecord$2(stored)) return incoming;
6505
6505
  const out = { ...incoming };
6506
6506
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6507
6507
  return out;
@@ -6532,7 +6532,7 @@ async function restoreUnchangedSecrets(input) {
6532
6532
  function isJsonEqual(a, b) {
6533
6533
  if (Object.is(a, b)) return true;
6534
6534
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6535
- if (isRecord(a) && isRecord(b)) {
6535
+ if (isRecord$2(a) && isRecord$2(b)) {
6536
6536
  const keys = Object.keys(a);
6537
6537
  if (keys.length !== Object.keys(b).length) return false;
6538
6538
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6556,7 +6556,7 @@ function markerKeysOf(blob, owner) {
6556
6556
  }
6557
6557
  function nodeFromStored(value, owner) {
6558
6558
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6559
- if (!isRecord(value)) return null;
6559
+ if (!isRecord$2(value)) return null;
6560
6560
  const children = /* @__PURE__ */ new Map();
6561
6561
  for (const [key, child] of Object.entries(value)) {
6562
6562
  const node = nodeFromStored(child, owner);
@@ -7838,6 +7838,89 @@ var PeerBytesTicketSchema = object({
7838
7838
  */
7839
7839
  declaredBytes: number().int().nonnegative().nullable()
7840
7840
  });
7841
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7842
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7843
+ var RECORD_DATABASES = ["settings", "events"];
7844
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7845
+ var RECORD_CLASSES = [
7846
+ "config",
7847
+ "ledger",
7848
+ "audit",
7849
+ "mirror",
7850
+ "ephemeral"
7851
+ ];
7852
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7853
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7854
+ var RECORD_BATCH_MAX = 1e3;
7855
+ var RECORD_QUERY_MAX = 1e3;
7856
+ /**
7857
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7858
+ * Zod row schema that describes it, and the helper that turns the two into the
7859
+ * JSON the engine stores.
7860
+ *
7861
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7862
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7863
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7864
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7865
+ * never a field name (D879).
7866
+ */
7867
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7868
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7869
+ var RecordIndexSchema = object({
7870
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7871
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7872
+ unique: boolean().optional()
7873
+ }).strict();
7874
+ var RecordRetentionSchema = union([
7875
+ object({
7876
+ ttlMs: number().int().positive(),
7877
+ from: _enum(["at", "write"])
7878
+ }).strict(),
7879
+ object({
7880
+ maxRows: number().int().positive().optional(),
7881
+ maxRowsPerDevice: number().int().positive().optional()
7882
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7883
+ object({
7884
+ owner: string().min(1),
7885
+ reason: string().min(1)
7886
+ }).strict(),
7887
+ object({ none: string().min(1) }).strict()
7888
+ ]);
7889
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7890
+ var EntryDescriptorSchema = object({
7891
+ title: string().min(1),
7892
+ /** The record body field shown as the entry's name. */
7893
+ nameField: string().min(1),
7894
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7895
+ fields: record(string(), unknown())
7896
+ }).strict();
7897
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7898
+ var RecordKindDeclarationSchema = object({
7899
+ database: _enum(RECORD_DATABASES).default("settings"),
7900
+ class: _enum(RECORD_CLASSES),
7901
+ writeTrigger: string().min(1),
7902
+ device: _enum([
7903
+ "required",
7904
+ "optional",
7905
+ "none"
7906
+ ]).default("none"),
7907
+ at: _enum(["required", "none"]).default("none"),
7908
+ indexes: array(RecordIndexSchema).max(8).default([]),
7909
+ retention: RecordRetentionSchema,
7910
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7911
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7912
+ /** Derived from the Zod schema; never written by hand. */
7913
+ secretPaths: array(string().min(1)).default([]),
7914
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7915
+ secretArrayKeys: record(string(), string()).default({}),
7916
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7917
+ adoptsFrom: string().min(1).optional(),
7918
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7919
+ transactFamily: string().min(1).optional(),
7920
+ entry: EntryDescriptorSchema.optional()
7921
+ }).strict();
7922
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7923
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7841
7924
  /** Shared Zod schemas used across streaming capabilities. */
7842
7925
  var CamProfileSchema = _enum([
7843
7926
  "high",
@@ -15511,6 +15594,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15511
15594
  keyField: string()
15512
15595
  }).optional()
15513
15596
  })) });
15597
+ /**
15598
+ * The report of a one-shot "move this owner's plaintext secrets into the
15599
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15600
+ *
15601
+ * The owner runs it on its own rows, through its own write path; an operator
15602
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15603
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15604
+ */
15605
+ var RawSecretMigrationInputSchema = object({
15606
+ /** `false` (the default of the script) = report only. */
15607
+ apply: boolean() });
15608
+ var RawSecretMigrationReportSchema = object({
15609
+ apply: boolean(),
15610
+ /** Rows that can carry a secret (a profile, an enrolment). */
15611
+ rows: number().int(),
15612
+ /** Rows whose secret was plaintext when the run started. */
15613
+ raw: number().int(),
15614
+ /** Rows that already held a keychain marker when the run started. */
15615
+ markers: number().int(),
15616
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15617
+ migrated: number().int(),
15618
+ /** Plaintext rows left in place because the move or its read-back failed. */
15619
+ failed: number().int(),
15620
+ /** After the run: rows still holding plaintext. */
15621
+ remainingRaw: number().int(),
15622
+ /** After the run: markers the keychain could not resolve right now. */
15623
+ unresolvedMarkers: number().int(),
15624
+ /**
15625
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15626
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15627
+ */
15628
+ redundantCopies: number().int().optional(),
15629
+ /** True when nothing is raw and every marker resolves. */
15630
+ verified: boolean()
15631
+ });
15514
15632
  /** Where a block runs. The operator chooses — a block driving a device on an
15515
15633
  * agent is the reason placement is not fixed to the hub. */
15516
15634
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15737,6 +15855,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15737
15855
  }), SettingsUpdateResultSchema, {
15738
15856
  kind: "mutation",
15739
15857
  auth: "admin"
15858
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
15859
+ kind: "mutation",
15860
+ auth: "admin"
15740
15861
  }), method(object({}), object({ libs: array(object({
15741
15862
  filePath: string(),
15742
15863
  content: string()
@@ -15999,6 +16120,222 @@ id: union([string(), number()]) }), {
15999
16120
  kind: "mutation",
16000
16121
  auth: "admin"
16001
16122
  });
16123
+ /**
16124
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16125
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16126
+ * (operator intent, D870) and device-history (numbers over time, D850).
16127
+ *
16128
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16129
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16130
+ * that with the addon id closed over). It is deliberately NOT in any input
16131
+ * schema, so a session can never supply it, and a call with no stamp is refused
16132
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16133
+ * addons go through the owner's capability.
16134
+ *
16135
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16136
+ * never `[]`. Secret fields are never on the wire: a read shows the
16137
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16138
+ * resolves itself, and a write may carry only a keychain marker bound to the
16139
+ * row's own ref.
16140
+ *
16141
+ * Internal: addons reach it through `ctx.records`, never directly.
16142
+ */
16143
+ var RecordIdSchema = string().min(1).max(256);
16144
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16145
+ var RecordBodySchema = record(string(), unknown());
16146
+ var RecordInputSchema = object({
16147
+ id: RecordIdSchema,
16148
+ /** The device this row belongs to (D865 removal, per-device reads). */
16149
+ deviceId: number().int().optional(),
16150
+ /** The domain clock, ms: observed / created / opened. */
16151
+ at: number().int().optional(),
16152
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16153
+ expiresAt: number().int().optional(),
16154
+ data: RecordBodySchema
16155
+ });
16156
+ var RecordViewSchema = object({
16157
+ id: string(),
16158
+ deviceId: number().int().nullable(),
16159
+ at: number().nullable(),
16160
+ expiresAt: number().nullable(),
16161
+ rev: number().int(),
16162
+ updatedAt: number(),
16163
+ data: RecordBodySchema
16164
+ });
16165
+ /** Declared index fields only. Anything else does not compile, by design. */
16166
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16167
+ string(),
16168
+ number(),
16169
+ boolean(),
16170
+ object({ in: array(union([
16171
+ string(),
16172
+ number(),
16173
+ boolean()
16174
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16175
+ object({
16176
+ gt: union([string(), number()]).optional(),
16177
+ gte: union([string(), number()]).optional(),
16178
+ lt: union([string(), number()]).optional(),
16179
+ lte: union([string(), number()]).optional()
16180
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16181
+ ]));
16182
+ var KindShape = { kind: RecordKindNameSchema };
16183
+ var TimeWindowShape = {
16184
+ deviceId: number().int().optional(),
16185
+ atFrom: number().optional(),
16186
+ atTo: number().optional()
16187
+ };
16188
+ var RecordQueryInputSchema = object({
16189
+ ...KindShape,
16190
+ ...TimeWindowShape,
16191
+ where: RecordWhereSchema.optional(),
16192
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16193
+ order: _enum(["at", "id"]).optional(),
16194
+ desc: boolean().optional(),
16195
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16196
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16197
+ cursor: string().min(1).optional()
16198
+ });
16199
+ var RecordQueryResultSchema = object({
16200
+ records: array(RecordViewSchema),
16201
+ nextCursor: string().nullable()
16202
+ });
16203
+ var RecordKindStateSchema = _enum([
16204
+ "created",
16205
+ "unchanged",
16206
+ "updated"
16207
+ ]);
16208
+ var DeclareKindResultSchema = object({
16209
+ kindId: number().int(),
16210
+ state: RecordKindStateSchema,
16211
+ createdIndexes: array(string()),
16212
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16213
+ adoptionPending: object({
16214
+ legacyTable: string(),
16215
+ legacyRows: number().int()
16216
+ }).nullable()
16217
+ });
16218
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16219
+ var SecretRefsList = array(string());
16220
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16221
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16222
+ kind: "mutation",
16223
+ auth: "admin"
16224
+ }), method(object({
16225
+ ...KindShape,
16226
+ id: RecordIdSchema
16227
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16228
+ ...KindShape,
16229
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16230
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16231
+ ...KindShape,
16232
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16233
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16234
+ ...KindShape,
16235
+ record: RecordInputSchema,
16236
+ /** Compare-and-set. `0` means "the row must not exist". */
16237
+ ifRev: number().int().min(0).optional()
16238
+ }), object({
16239
+ rev: number().int(),
16240
+ releasedRefs: SecretRefsList
16241
+ }), {
16242
+ kind: "mutation",
16243
+ auth: "admin"
16244
+ }), method(object({
16245
+ ...KindShape,
16246
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16247
+ }), object({
16248
+ count: number().int(),
16249
+ releasedRefs: SecretRefsList
16250
+ }), {
16251
+ kind: "mutation",
16252
+ auth: "admin"
16253
+ }), method(object({
16254
+ ...KindShape,
16255
+ id: RecordIdSchema,
16256
+ data: RecordBodySchema,
16257
+ at: number().int().nullable().optional(),
16258
+ expiresAt: number().int().nullable().optional(),
16259
+ ifRev: number().int().min(1).optional()
16260
+ }), object({
16261
+ rev: number().int(),
16262
+ releasedRefs: SecretRefsList
16263
+ }), {
16264
+ kind: "mutation",
16265
+ auth: "admin"
16266
+ }), method(object({
16267
+ ...KindShape,
16268
+ id: RecordIdSchema
16269
+ }), object({
16270
+ deleted: boolean(),
16271
+ secretRefs: SecretRefsList
16272
+ }), {
16273
+ kind: "mutation",
16274
+ auth: "admin"
16275
+ }), method(object({
16276
+ ...KindShape,
16277
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16278
+ }), object({
16279
+ deleted: number().int(),
16280
+ secretRefs: SecretRefsList
16281
+ }), {
16282
+ kind: "mutation",
16283
+ auth: "admin"
16284
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16285
+ ...KindShape,
16286
+ ...TimeWindowShape,
16287
+ where: RecordWhereSchema.optional()
16288
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16289
+ ...KindShape,
16290
+ deviceId: number().int().optional(),
16291
+ from: number(),
16292
+ to: number(),
16293
+ bucketMs: number().int().positive()
16294
+ }), object({ buckets: array(object({
16295
+ bucketStart: number(),
16296
+ count: number().int()
16297
+ })) }), { auth: "admin" }), method(object({
16298
+ ...KindShape,
16299
+ op: _enum([
16300
+ "sum",
16301
+ "min",
16302
+ "max",
16303
+ "count"
16304
+ ]),
16305
+ field: RecordFieldPathSchema.optional(),
16306
+ groupBy: RecordFieldPathSchema.optional(),
16307
+ where: RecordWhereSchema.optional()
16308
+ }), object({ rows: array(object({
16309
+ group: union([
16310
+ string(),
16311
+ number(),
16312
+ _null()
16313
+ ]),
16314
+ value: number().nullable()
16315
+ })) }), { auth: "admin" }), method(object({
16316
+ ...KindShape,
16317
+ deviceId: number().int().optional(),
16318
+ atBefore: number().optional(),
16319
+ where: RecordWhereSchema.optional()
16320
+ }), object({
16321
+ deleted: number().int(),
16322
+ secretRefs: SecretRefsList
16323
+ }), {
16324
+ kind: "mutation",
16325
+ auth: "admin"
16326
+ }), method(object({
16327
+ deviceId: number().int(),
16328
+ kinds: array(RecordKindNameSchema).optional()
16329
+ }), object({
16330
+ deleted: record(string(), number().int()),
16331
+ secretRefs: SecretRefsList
16332
+ }), {
16333
+ kind: "mutation",
16334
+ auth: "admin"
16335
+ }), method(object(KindShape), object({ id: number().int() }), {
16336
+ kind: "mutation",
16337
+ auth: "admin"
16338
+ });
16002
16339
  /** One table of the settings database. */
16003
16340
  var StorageTableSchema = object({
16004
16341
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -16011,6 +16348,28 @@ var StorageTableSchema = object({
16011
16348
  /** Declared by an addon since this engine process started (a running addon claims it). */
16012
16349
  declaredThisBoot: boolean()
16013
16350
  });
16351
+ /** One declared record kind (D881) as System -> Data shows it. */
16352
+ var StorageKindSchema = object({
16353
+ owner: string(),
16354
+ kind: string(),
16355
+ database: _enum(["settings", "events"]),
16356
+ class: string(),
16357
+ state: _enum([
16358
+ "declared",
16359
+ "orphaned",
16360
+ "dropped"
16361
+ ]),
16362
+ /** `null` when the caller asked for no counts (`counts: false`). */
16363
+ rows: number().int().nonnegative().nullable(),
16364
+ /** Rows x the average size of a sample; null for an empty kind. */
16365
+ bytesEstimate: number().int().nonnegative().nullable(),
16366
+ writeTrigger: string(),
16367
+ retention: RecordRetentionSchema,
16368
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16369
+ entry: boolean(),
16370
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16371
+ declaration: RecordKindDeclarationSchema
16372
+ });
16014
16373
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16015
16374
  collection: string().min(1),
16016
16375
  expectRows: number().int().nonnegative()
@@ -16020,6 +16379,77 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
16020
16379
  }), {
16021
16380
  kind: "mutation",
16022
16381
  auth: "admin"
16382
+ }), method(object({
16383
+ owner: string().min(1).optional(),
16384
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16385
+ counts: boolean().optional()
16386
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16387
+ owner: string().min(1),
16388
+ kind: RecordKindNameSchema
16389
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16390
+ owner: string().min(1),
16391
+ kind: RecordKindNameSchema,
16392
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX),
16393
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16394
+ complete: boolean().optional()
16395
+ }), object({ adopted: number().int() }), {
16396
+ kind: "mutation",
16397
+ auth: "admin"
16398
+ });
16399
+ /**
16400
+ * record-entries - the ONE admin surface for every list of user-created entries
16401
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16402
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16403
+ *
16404
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16405
+ * the entry body with `secret: true` on every credential field, so a password
16406
+ * field is derived from the schema and never from a name. `putEntry` takes the
16407
+ * redaction token for an untouched secret (the stored value is kept), a string
16408
+ * for a new one, and the clear instruction to remove one. A read never carries
16409
+ * a secret value, and a locked keychain refuses the write with
16410
+ * `records/secret-unavailable` instead of storing plaintext.
16411
+ *
16412
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16413
+ */
16414
+ var EntryKindInfoSchema = object({
16415
+ owner: string(),
16416
+ kind: RecordKindNameSchema,
16417
+ title: string(),
16418
+ nameField: string(),
16419
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16420
+ fields: record(string(), unknown()),
16421
+ secretPaths: array(string()),
16422
+ rows: number().int().nonnegative()
16423
+ });
16424
+ var EntryViewSchema = object({
16425
+ id: RecordIdSchema,
16426
+ name: string(),
16427
+ rev: number().int(),
16428
+ updatedAt: number(),
16429
+ /** Secret fields hold the redaction token. */
16430
+ data: RecordBodySchema
16431
+ });
16432
+ var EntryAddress = {
16433
+ owner: string().min(1),
16434
+ kind: RecordKindNameSchema
16435
+ };
16436
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16437
+ ...EntryAddress,
16438
+ id: RecordIdSchema.optional(),
16439
+ data: RecordBodySchema,
16440
+ ifRev: number().int().min(1).optional()
16441
+ }), object({
16442
+ id: string(),
16443
+ rev: number().int()
16444
+ }), {
16445
+ kind: "mutation",
16446
+ auth: "admin"
16447
+ }), method(object({
16448
+ ...EntryAddress,
16449
+ id: RecordIdSchema
16450
+ }), object({ deleted: boolean() }), {
16451
+ kind: "mutation",
16452
+ auth: "admin"
16023
16453
  });
16024
16454
  /**
16025
16455
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -38857,36 +39287,6 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
38857
39287
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
38858
39288
  });
38859
39289
  /**
38860
- * The report of a one-shot "move this owner's plaintext secrets into the
38861
- * keychain" run (D878). COUNTS only - never a value, never a ref.
38862
- *
38863
- * The owner runs it on its own rows, through its own write path; an operator
38864
- * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
38865
- * Dry run (`apply: false`) reports what WOULD move and changes nothing.
38866
- */
38867
- var RawSecretMigrationInputSchema = object({
38868
- /** `false` (the default of the script) = report only. */
38869
- apply: boolean() });
38870
- var RawSecretMigrationReportSchema = object({
38871
- apply: boolean(),
38872
- /** Rows that can carry a secret (a profile, an enrolment). */
38873
- rows: number().int(),
38874
- /** Rows whose secret was plaintext when the run started. */
38875
- raw: number().int(),
38876
- /** Rows that already held a keychain marker when the run started. */
38877
- markers: number().int(),
38878
- /** Plaintext rows moved by THIS run (always 0 on a dry run). */
38879
- migrated: number().int(),
38880
- /** Plaintext rows left in place because the move or its read-back failed. */
38881
- failed: number().int(),
38882
- /** After the run: rows still holding plaintext. */
38883
- remainingRaw: number().int(),
38884
- /** After the run: markers the keychain could not resolve right now. */
38885
- unresolvedMarkers: number().int(),
38886
- /** True when nothing is raw and every marker resolves. */
38887
- verified: boolean()
38888
- });
38889
- /**
38890
39290
  * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
38891
39291
  * methods concat-fan across providers; single-row methods route to ONE
38892
39292
  * provider by the `addonId` in the call input (the notification-output
@@ -62445,6 +62845,12 @@ Object.freeze({
62445
62845
  addonId: null,
62446
62846
  access: "view"
62447
62847
  },
62848
+ "coreBlocks.migrateRawSecrets": {
62849
+ capName: "core-blocks",
62850
+ capScope: "system",
62851
+ addonId: null,
62852
+ access: "create"
62853
+ },
62448
62854
  "coreBlocks.restart": {
62449
62855
  capName: "core-blocks",
62450
62856
  capScope: "system",
@@ -67197,6 +67603,30 @@ Object.freeze({
67197
67603
  addonId: null,
67198
67604
  access: "create"
67199
67605
  },
67606
+ "recordEntries.deleteEntry": {
67607
+ capName: "record-entries",
67608
+ capScope: "system",
67609
+ addonId: null,
67610
+ access: "delete"
67611
+ },
67612
+ "recordEntries.listEntries": {
67613
+ capName: "record-entries",
67614
+ capScope: "system",
67615
+ addonId: null,
67616
+ access: "view"
67617
+ },
67618
+ "recordEntries.listEntryKinds": {
67619
+ capName: "record-entries",
67620
+ capScope: "system",
67621
+ addonId: null,
67622
+ access: "view"
67623
+ },
67624
+ "recordEntries.putEntry": {
67625
+ capName: "record-entries",
67626
+ capScope: "system",
67627
+ addonId: null,
67628
+ access: "create"
67629
+ },
67200
67630
  "recording.getAvailability": {
67201
67631
  capName: "recording",
67202
67632
  capScope: "device",
@@ -67497,6 +67927,102 @@ Object.freeze({
67497
67927
  addonId: null,
67498
67928
  access: "view"
67499
67929
  },
67930
+ "records.aggregate": {
67931
+ capName: "records",
67932
+ capScope: "system",
67933
+ addonId: null,
67934
+ access: "view"
67935
+ },
67936
+ "records.allocateId": {
67937
+ capName: "records",
67938
+ capScope: "system",
67939
+ addonId: null,
67940
+ access: "create"
67941
+ },
67942
+ "records.count": {
67943
+ capName: "records",
67944
+ capScope: "system",
67945
+ addonId: null,
67946
+ access: "view"
67947
+ },
67948
+ "records.declareKinds": {
67949
+ capName: "records",
67950
+ capScope: "system",
67951
+ addonId: null,
67952
+ access: "create"
67953
+ },
67954
+ "records.delete": {
67955
+ capName: "records",
67956
+ capScope: "system",
67957
+ addonId: null,
67958
+ access: "delete"
67959
+ },
67960
+ "records.deleteDevice": {
67961
+ capName: "records",
67962
+ capScope: "system",
67963
+ addonId: null,
67964
+ access: "delete"
67965
+ },
67966
+ "records.deleteMany": {
67967
+ capName: "records",
67968
+ capScope: "system",
67969
+ addonId: null,
67970
+ access: "delete"
67971
+ },
67972
+ "records.deleteWhere": {
67973
+ capName: "records",
67974
+ capScope: "system",
67975
+ addonId: null,
67976
+ access: "delete"
67977
+ },
67978
+ "records.get": {
67979
+ capName: "records",
67980
+ capScope: "system",
67981
+ addonId: null,
67982
+ access: "view"
67983
+ },
67984
+ "records.getMany": {
67985
+ capName: "records",
67986
+ capScope: "system",
67987
+ addonId: null,
67988
+ access: "view"
67989
+ },
67990
+ "records.histogram": {
67991
+ capName: "records",
67992
+ capScope: "system",
67993
+ addonId: null,
67994
+ access: "view"
67995
+ },
67996
+ "records.patch": {
67997
+ capName: "records",
67998
+ capScope: "system",
67999
+ addonId: null,
68000
+ access: "create"
68001
+ },
68002
+ "records.put": {
68003
+ capName: "records",
68004
+ capScope: "system",
68005
+ addonId: null,
68006
+ access: "create"
68007
+ },
68008
+ "records.putMany": {
68009
+ capName: "records",
68010
+ capScope: "system",
68011
+ addonId: null,
68012
+ access: "create"
68013
+ },
68014
+ "records.query": {
68015
+ capName: "records",
68016
+ capScope: "system",
68017
+ addonId: null,
68018
+ access: "view"
68019
+ },
68020
+ "records.secretRefs": {
68021
+ capName: "records",
68022
+ capScope: "system",
68023
+ addonId: null,
68024
+ access: "view"
68025
+ },
67500
68026
  "sceneMonitor.captureReference": {
67501
68027
  capName: "scene-monitor",
67502
68028
  capScope: "device",
@@ -67929,18 +68455,36 @@ Object.freeze({
67929
68455
  addonId: null,
67930
68456
  access: "create"
67931
68457
  },
68458
+ "storageAdmin.adoptRecords": {
68459
+ capName: "storage-admin",
68460
+ capScope: "system",
68461
+ addonId: null,
68462
+ access: "create"
68463
+ },
67932
68464
  "storageAdmin.dropCollection": {
67933
68465
  capName: "storage-admin",
67934
68466
  capScope: "system",
67935
68467
  addonId: null,
67936
68468
  access: "delete"
67937
68469
  },
68470
+ "storageAdmin.listKinds": {
68471
+ capName: "storage-admin",
68472
+ capScope: "system",
68473
+ addonId: null,
68474
+ access: "view"
68475
+ },
67938
68476
  "storageAdmin.listTables": {
67939
68477
  capName: "storage-admin",
67940
68478
  capScope: "system",
67941
68479
  addonId: null,
67942
68480
  access: "view"
67943
68481
  },
68482
+ "storageAdmin.readRecords": {
68483
+ capName: "storage-admin",
68484
+ capScope: "system",
68485
+ addonId: null,
68486
+ access: "view"
68487
+ },
67944
68488
  "storageEvictable.evict": {
67945
68489
  capName: "storage-evictable",
67946
68490
  capScope: "system",
@@ -71535,6 +72079,37 @@ Object.freeze({
71535
72079
  form: "single",
71536
72080
  optional: false
71537
72081
  }],
72082
+ "records.count": [{
72083
+ name: "deviceId",
72084
+ form: "single",
72085
+ optional: true
72086
+ }],
72087
+ "records.deleteDevice": [{
72088
+ name: "deviceId",
72089
+ form: "single",
72090
+ optional: false
72091
+ }],
72092
+ "records.deleteWhere": [{
72093
+ name: "deviceId",
72094
+ form: "single",
72095
+ optional: true
72096
+ }],
72097
+ "records.histogram": [{
72098
+ name: "deviceId",
72099
+ form: "single",
72100
+ optional: true
72101
+ }],
72102
+ "records.putMany": [{
72103
+ name: "records",
72104
+ form: "object-array",
72105
+ optional: false,
72106
+ itemField: "deviceId"
72107
+ }],
72108
+ "records.query": [{
72109
+ name: "deviceId",
72110
+ form: "single",
72111
+ optional: true
72112
+ }],
71538
72113
  "sceneMonitor.captureReference": [{
71539
72114
  name: "deviceId",
71540
72115
  form: "single",
@@ -71651,6 +72226,17 @@ Object.freeze({
71651
72226
  form: "single",
71652
72227
  optional: false
71653
72228
  }],
72229
+ "storageAdmin.adoptRecords": [{
72230
+ name: "records",
72231
+ form: "object-array",
72232
+ optional: false,
72233
+ itemField: "deviceId"
72234
+ }],
72235
+ "storageAdmin.readRecords": [{
72236
+ name: "deviceId",
72237
+ form: "single",
72238
+ optional: true
72239
+ }],
71654
72240
  "streamBroker.acquireEgressTranscode": [{
71655
72241
  name: "deviceId",
71656
72242
  form: "single",