@camstack/addon-training 0.1.53 → 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-2L6ZZUzt.mjs → MotionZonesSettings-DyDTHPys.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-z2Lm90YH.mjs → PrivacyMaskSettings-axajI4sK.mjs} +2 -2
  3. package/dist/{SceneMonitorEditor-NTZadJI1.mjs → SceneMonitorEditor-BjLJsI6P.mjs} +1 -1
  4. package/dist/_stub.js +8 -8
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-BNV-3iai.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-Dw2AZ607.js → dist-21g95f5X.js} +589 -17
  8. package/dist/{dist-DFfQ_Mth.mjs → dist-91Rnxphf.mjs} +589 -17
  9. package/dist/{hostInit-CCumz-Qi.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-C3wXNwRM.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-9dr-MOnd.mjs → responsive-9DT2DlLH.mjs} +1 -1
  18. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-BCUryvJe.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-QkGe-Wgc.mjs +0 -26
@@ -5405,7 +5405,7 @@ var ZodIssueCode = {
5405
5405
  var ZodFirstPartyTypeKind;
5406
5406
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5407
5407
  //#endregion
5408
- //#region ../types/dist/sleep-D-Q2_Mcd.mjs
5408
+ //#region ../types/dist/sleep-WsrozGDL.mjs
5409
5409
  /**
5410
5410
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5411
5411
  * window to float samples (D455).
@@ -5522,7 +5522,7 @@ function isKeychainStoredField(field) {
5522
5522
  var SECRET_CLEAR = { $secretClear: true };
5523
5523
  /** The `'***'` token D634 redaction writes for non-admins. */
5524
5524
  var LEGACY_DEVICE_REDACTION = "***";
5525
- function isRecord$2(value) {
5525
+ function isRecord$4(value) {
5526
5526
  return typeof value === "object" && value !== null && !Array.isArray(value);
5527
5527
  }
5528
5528
  function makeSecretMarker(ref) {
@@ -5533,12 +5533,12 @@ function makeSecretMarker(ref) {
5533
5533
  }
5534
5534
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5535
5535
  function isSecretMarker(value) {
5536
- if (!isRecord$2(value)) return false;
5536
+ if (!isRecord$4(value)) return false;
5537
5537
  const ref = value["$secret"];
5538
5538
  return typeof ref === "string" && ref.length > 0;
5539
5539
  }
5540
5540
  function isSecretClear(value) {
5541
- return isRecord$2(value) && value["$secretClear"] === true;
5541
+ return isRecord$4(value) && value["$secretClear"] === true;
5542
5542
  }
5543
5543
  /**
5544
5544
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6148,7 +6148,7 @@ var KeychainWriteRefusedError = class extends Error {
6148
6148
  }
6149
6149
  };
6150
6150
  var KEEP = { kind: "keep" };
6151
- function isRecord$1(value) {
6151
+ function isRecord$3(value) {
6152
6152
  return typeof value === "object" && value !== null && !Array.isArray(value);
6153
6153
  }
6154
6154
  function defaultMintId() {
@@ -6161,7 +6161,7 @@ function collectSecretMarkerRefs(value, out = []) {
6161
6161
  return out;
6162
6162
  }
6163
6163
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6164
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6164
+ else if (isRecord$3(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6165
6165
  return out;
6166
6166
  }
6167
6167
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6216,7 +6216,7 @@ function rowId(row, idKey) {
6216
6216
  return null;
6217
6217
  }
6218
6218
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6219
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6219
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$3) : [];
6220
6220
  if (!Array.isArray(incoming)) {
6221
6221
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6222
6222
  return {
@@ -6232,7 +6232,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6232
6232
  const kept = /* @__PURE__ */ new Set();
6233
6233
  const rows = [];
6234
6234
  for (const row of incoming) {
6235
- if (!isRecord$1(row)) {
6235
+ if (!isRecord$3(row)) {
6236
6236
  rows.push(row);
6237
6237
  continue;
6238
6238
  }
@@ -6257,7 +6257,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6257
6257
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6258
6258
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6259
6259
  case "object": {
6260
- if (!isRecord$1(incoming)) {
6260
+ if (!isRecord$3(incoming)) {
6261
6261
  if (incoming === void 0) return KEEP;
6262
6262
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6263
6263
  return {
@@ -6265,7 +6265,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6265
6265
  value: incoming
6266
6266
  };
6267
6267
  }
6268
- const storedObj = isRecord$1(stored) ? stored : {};
6268
+ const storedObj = isRecord$3(stored) ? stored : {};
6269
6269
  return {
6270
6270
  kind: "value",
6271
6271
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6388,7 +6388,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6388
6388
  value: items
6389
6389
  };
6390
6390
  }
6391
- if (isRecord$1(v)) {
6391
+ if (isRecord$3(v)) {
6392
6392
  const out = {};
6393
6393
  for (const [k, child] of Object.entries(v)) {
6394
6394
  const s = substitute(child);
@@ -6420,7 +6420,7 @@ var SecretOverwriteRefusedError = class extends Error {
6420
6420
  this.name = "SecretOverwriteRefusedError";
6421
6421
  }
6422
6422
  };
6423
- function isRecord(value) {
6423
+ function isRecord$2(value) {
6424
6424
  return typeof value === "object" && value !== null && !Array.isArray(value);
6425
6425
  }
6426
6426
  function resolvedValue(pass, marker) {
@@ -6449,7 +6449,7 @@ function inArray(pass, incoming, stored) {
6449
6449
  return incoming.map((item, index) => {
6450
6450
  const twin = stored[index];
6451
6451
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6452
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6452
+ if (isRecord$2(item) && isRecord$2(twin)) return inArrayRow(pass, item, twin);
6453
6453
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6454
6454
  return item;
6455
6455
  });
@@ -6460,7 +6460,7 @@ function inArrayRow(pass, incoming, stored) {
6460
6460
  const twin = stored[key];
6461
6461
  if (isSecretMarker(twin)) {
6462
6462
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6463
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6463
+ } else if (isRecord$2(value) && isRecord$2(twin)) out[key] = inArrayRow(pass, value, twin);
6464
6464
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6465
6465
  }
6466
6466
  return out;
@@ -6468,7 +6468,7 @@ function inArrayRow(pass, incoming, stored) {
6468
6468
  async function walk(pass, incoming, stored) {
6469
6469
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6470
6470
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6471
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6471
+ if (!isRecord$2(incoming) || !isRecord$2(stored)) return incoming;
6472
6472
  const out = { ...incoming };
6473
6473
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6474
6474
  return out;
@@ -6499,7 +6499,7 @@ async function restoreUnchangedSecrets(input) {
6499
6499
  function isJsonEqual(a, b) {
6500
6500
  if (Object.is(a, b)) return true;
6501
6501
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6502
- if (isRecord(a) && isRecord(b)) {
6502
+ if (isRecord$2(a) && isRecord$2(b)) {
6503
6503
  const keys = Object.keys(a);
6504
6504
  if (keys.length !== Object.keys(b).length) return false;
6505
6505
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6523,7 +6523,7 @@ function markerKeysOf(blob, owner) {
6523
6523
  }
6524
6524
  function nodeFromStored(value, owner) {
6525
6525
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6526
- if (!isRecord(value)) return null;
6526
+ if (!isRecord$2(value)) return null;
6527
6527
  const children = /* @__PURE__ */ new Map();
6528
6528
  for (const [key, child] of Object.entries(value)) {
6529
6529
  const node = nodeFromStored(child, owner);
@@ -7805,6 +7805,89 @@ var PeerBytesTicketSchema = object({
7805
7805
  */
7806
7806
  declaredBytes: number().int().nonnegative().nullable()
7807
7807
  });
7808
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7809
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7810
+ var RECORD_DATABASES = ["settings", "events"];
7811
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7812
+ var RECORD_CLASSES = [
7813
+ "config",
7814
+ "ledger",
7815
+ "audit",
7816
+ "mirror",
7817
+ "ephemeral"
7818
+ ];
7819
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7820
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7821
+ var RECORD_BATCH_MAX = 1e3;
7822
+ var RECORD_QUERY_MAX = 1e3;
7823
+ /**
7824
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7825
+ * Zod row schema that describes it, and the helper that turns the two into the
7826
+ * JSON the engine stores.
7827
+ *
7828
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7829
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7830
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7831
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7832
+ * never a field name (D879).
7833
+ */
7834
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7835
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7836
+ var RecordIndexSchema = object({
7837
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7838
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7839
+ unique: boolean().optional()
7840
+ }).strict();
7841
+ var RecordRetentionSchema = union([
7842
+ object({
7843
+ ttlMs: number().int().positive(),
7844
+ from: _enum(["at", "write"])
7845
+ }).strict(),
7846
+ object({
7847
+ maxRows: number().int().positive().optional(),
7848
+ maxRowsPerDevice: number().int().positive().optional()
7849
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7850
+ object({
7851
+ owner: string().min(1),
7852
+ reason: string().min(1)
7853
+ }).strict(),
7854
+ object({ none: string().min(1) }).strict()
7855
+ ]);
7856
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7857
+ var EntryDescriptorSchema = object({
7858
+ title: string().min(1),
7859
+ /** The record body field shown as the entry's name. */
7860
+ nameField: string().min(1),
7861
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7862
+ fields: record(string(), unknown())
7863
+ }).strict();
7864
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7865
+ var RecordKindDeclarationSchema = object({
7866
+ database: _enum(RECORD_DATABASES).default("settings"),
7867
+ class: _enum(RECORD_CLASSES),
7868
+ writeTrigger: string().min(1),
7869
+ device: _enum([
7870
+ "required",
7871
+ "optional",
7872
+ "none"
7873
+ ]).default("none"),
7874
+ at: _enum(["required", "none"]).default("none"),
7875
+ indexes: array(RecordIndexSchema).max(8).default([]),
7876
+ retention: RecordRetentionSchema,
7877
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7878
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7879
+ /** Derived from the Zod schema; never written by hand. */
7880
+ secretPaths: array(string().min(1)).default([]),
7881
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7882
+ secretArrayKeys: record(string(), string()).default({}),
7883
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7884
+ adoptsFrom: string().min(1).optional(),
7885
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7886
+ transactFamily: string().min(1).optional(),
7887
+ entry: EntryDescriptorSchema.optional()
7888
+ }).strict();
7889
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7890
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7808
7891
  /** Shared Zod schemas used across streaming capabilities. */
7809
7892
  var CamProfileSchema = _enum([
7810
7893
  "high",
@@ -16004,6 +16087,222 @@ id: union([string(), number()]) }), {
16004
16087
  kind: "mutation",
16005
16088
  auth: "admin"
16006
16089
  });
16090
+ /**
16091
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16092
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16093
+ * (operator intent, D870) and device-history (numbers over time, D850).
16094
+ *
16095
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16096
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16097
+ * that with the addon id closed over). It is deliberately NOT in any input
16098
+ * schema, so a session can never supply it, and a call with no stamp is refused
16099
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16100
+ * addons go through the owner's capability.
16101
+ *
16102
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16103
+ * never `[]`. Secret fields are never on the wire: a read shows the
16104
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16105
+ * resolves itself, and a write may carry only a keychain marker bound to the
16106
+ * row's own ref.
16107
+ *
16108
+ * Internal: addons reach it through `ctx.records`, never directly.
16109
+ */
16110
+ var RecordIdSchema = string().min(1).max(256);
16111
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16112
+ var RecordBodySchema = record(string(), unknown());
16113
+ var RecordInputSchema = object({
16114
+ id: RecordIdSchema,
16115
+ /** The device this row belongs to (D865 removal, per-device reads). */
16116
+ deviceId: number().int().optional(),
16117
+ /** The domain clock, ms: observed / created / opened. */
16118
+ at: number().int().optional(),
16119
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16120
+ expiresAt: number().int().optional(),
16121
+ data: RecordBodySchema
16122
+ });
16123
+ var RecordViewSchema = object({
16124
+ id: string(),
16125
+ deviceId: number().int().nullable(),
16126
+ at: number().nullable(),
16127
+ expiresAt: number().nullable(),
16128
+ rev: number().int(),
16129
+ updatedAt: number(),
16130
+ data: RecordBodySchema
16131
+ });
16132
+ /** Declared index fields only. Anything else does not compile, by design. */
16133
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16134
+ string(),
16135
+ number(),
16136
+ boolean(),
16137
+ object({ in: array(union([
16138
+ string(),
16139
+ number(),
16140
+ boolean()
16141
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16142
+ object({
16143
+ gt: union([string(), number()]).optional(),
16144
+ gte: union([string(), number()]).optional(),
16145
+ lt: union([string(), number()]).optional(),
16146
+ lte: union([string(), number()]).optional()
16147
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16148
+ ]));
16149
+ var KindShape = { kind: RecordKindNameSchema };
16150
+ var TimeWindowShape = {
16151
+ deviceId: number().int().optional(),
16152
+ atFrom: number().optional(),
16153
+ atTo: number().optional()
16154
+ };
16155
+ var RecordQueryInputSchema = object({
16156
+ ...KindShape,
16157
+ ...TimeWindowShape,
16158
+ where: RecordWhereSchema.optional(),
16159
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16160
+ order: _enum(["at", "id"]).optional(),
16161
+ desc: boolean().optional(),
16162
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16163
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16164
+ cursor: string().min(1).optional()
16165
+ });
16166
+ var RecordQueryResultSchema = object({
16167
+ records: array(RecordViewSchema),
16168
+ nextCursor: string().nullable()
16169
+ });
16170
+ var RecordKindStateSchema = _enum([
16171
+ "created",
16172
+ "unchanged",
16173
+ "updated"
16174
+ ]);
16175
+ var DeclareKindResultSchema = object({
16176
+ kindId: number().int(),
16177
+ state: RecordKindStateSchema,
16178
+ createdIndexes: array(string()),
16179
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16180
+ adoptionPending: object({
16181
+ legacyTable: string(),
16182
+ legacyRows: number().int()
16183
+ }).nullable()
16184
+ });
16185
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16186
+ var SecretRefsList = array(string());
16187
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16188
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16189
+ kind: "mutation",
16190
+ auth: "admin"
16191
+ }), method(object({
16192
+ ...KindShape,
16193
+ id: RecordIdSchema
16194
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16195
+ ...KindShape,
16196
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16197
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16198
+ ...KindShape,
16199
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16200
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16201
+ ...KindShape,
16202
+ record: RecordInputSchema,
16203
+ /** Compare-and-set. `0` means "the row must not exist". */
16204
+ ifRev: number().int().min(0).optional()
16205
+ }), object({
16206
+ rev: number().int(),
16207
+ releasedRefs: SecretRefsList
16208
+ }), {
16209
+ kind: "mutation",
16210
+ auth: "admin"
16211
+ }), method(object({
16212
+ ...KindShape,
16213
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16214
+ }), object({
16215
+ count: number().int(),
16216
+ releasedRefs: SecretRefsList
16217
+ }), {
16218
+ kind: "mutation",
16219
+ auth: "admin"
16220
+ }), method(object({
16221
+ ...KindShape,
16222
+ id: RecordIdSchema,
16223
+ data: RecordBodySchema,
16224
+ at: number().int().nullable().optional(),
16225
+ expiresAt: number().int().nullable().optional(),
16226
+ ifRev: number().int().min(1).optional()
16227
+ }), object({
16228
+ rev: number().int(),
16229
+ releasedRefs: SecretRefsList
16230
+ }), {
16231
+ kind: "mutation",
16232
+ auth: "admin"
16233
+ }), method(object({
16234
+ ...KindShape,
16235
+ id: RecordIdSchema
16236
+ }), object({
16237
+ deleted: boolean(),
16238
+ secretRefs: SecretRefsList
16239
+ }), {
16240
+ kind: "mutation",
16241
+ auth: "admin"
16242
+ }), method(object({
16243
+ ...KindShape,
16244
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16245
+ }), object({
16246
+ deleted: number().int(),
16247
+ secretRefs: SecretRefsList
16248
+ }), {
16249
+ kind: "mutation",
16250
+ auth: "admin"
16251
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16252
+ ...KindShape,
16253
+ ...TimeWindowShape,
16254
+ where: RecordWhereSchema.optional()
16255
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16256
+ ...KindShape,
16257
+ deviceId: number().int().optional(),
16258
+ from: number(),
16259
+ to: number(),
16260
+ bucketMs: number().int().positive()
16261
+ }), object({ buckets: array(object({
16262
+ bucketStart: number(),
16263
+ count: number().int()
16264
+ })) }), { auth: "admin" }), method(object({
16265
+ ...KindShape,
16266
+ op: _enum([
16267
+ "sum",
16268
+ "min",
16269
+ "max",
16270
+ "count"
16271
+ ]),
16272
+ field: RecordFieldPathSchema.optional(),
16273
+ groupBy: RecordFieldPathSchema.optional(),
16274
+ where: RecordWhereSchema.optional()
16275
+ }), object({ rows: array(object({
16276
+ group: union([
16277
+ string(),
16278
+ number(),
16279
+ _null()
16280
+ ]),
16281
+ value: number().nullable()
16282
+ })) }), { auth: "admin" }), method(object({
16283
+ ...KindShape,
16284
+ deviceId: number().int().optional(),
16285
+ atBefore: number().optional(),
16286
+ where: RecordWhereSchema.optional()
16287
+ }), object({
16288
+ deleted: number().int(),
16289
+ secretRefs: SecretRefsList
16290
+ }), {
16291
+ kind: "mutation",
16292
+ auth: "admin"
16293
+ }), method(object({
16294
+ deviceId: number().int(),
16295
+ kinds: array(RecordKindNameSchema).optional()
16296
+ }), object({
16297
+ deleted: record(string(), number().int()),
16298
+ secretRefs: SecretRefsList
16299
+ }), {
16300
+ kind: "mutation",
16301
+ auth: "admin"
16302
+ }), method(object(KindShape), object({ id: number().int() }), {
16303
+ kind: "mutation",
16304
+ auth: "admin"
16305
+ });
16007
16306
  /** One table of the settings database. */
16008
16307
  var StorageTableSchema = object({
16009
16308
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -16016,6 +16315,28 @@ var StorageTableSchema = object({
16016
16315
  /** Declared by an addon since this engine process started (a running addon claims it). */
16017
16316
  declaredThisBoot: boolean()
16018
16317
  });
16318
+ /** One declared record kind (D881) as System -> Data shows it. */
16319
+ var StorageKindSchema = object({
16320
+ owner: string(),
16321
+ kind: string(),
16322
+ database: _enum(["settings", "events"]),
16323
+ class: string(),
16324
+ state: _enum([
16325
+ "declared",
16326
+ "orphaned",
16327
+ "dropped"
16328
+ ]),
16329
+ /** `null` when the caller asked for no counts (`counts: false`). */
16330
+ rows: number().int().nonnegative().nullable(),
16331
+ /** Rows x the average size of a sample; null for an empty kind. */
16332
+ bytesEstimate: number().int().nonnegative().nullable(),
16333
+ writeTrigger: string(),
16334
+ retention: RecordRetentionSchema,
16335
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16336
+ entry: boolean(),
16337
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16338
+ declaration: RecordKindDeclarationSchema
16339
+ });
16019
16340
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16020
16341
  collection: string().min(1),
16021
16342
  expectRows: number().int().nonnegative()
@@ -16025,6 +16346,77 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
16025
16346
  }), {
16026
16347
  kind: "mutation",
16027
16348
  auth: "admin"
16349
+ }), method(object({
16350
+ owner: string().min(1).optional(),
16351
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16352
+ counts: boolean().optional()
16353
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16354
+ owner: string().min(1),
16355
+ kind: RecordKindNameSchema
16356
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16357
+ owner: string().min(1),
16358
+ kind: RecordKindNameSchema,
16359
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX),
16360
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16361
+ complete: boolean().optional()
16362
+ }), object({ adopted: number().int() }), {
16363
+ kind: "mutation",
16364
+ auth: "admin"
16365
+ });
16366
+ /**
16367
+ * record-entries - the ONE admin surface for every list of user-created entries
16368
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16369
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16370
+ *
16371
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16372
+ * the entry body with `secret: true` on every credential field, so a password
16373
+ * field is derived from the schema and never from a name. `putEntry` takes the
16374
+ * redaction token for an untouched secret (the stored value is kept), a string
16375
+ * for a new one, and the clear instruction to remove one. A read never carries
16376
+ * a secret value, and a locked keychain refuses the write with
16377
+ * `records/secret-unavailable` instead of storing plaintext.
16378
+ *
16379
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16380
+ */
16381
+ var EntryKindInfoSchema = object({
16382
+ owner: string(),
16383
+ kind: RecordKindNameSchema,
16384
+ title: string(),
16385
+ nameField: string(),
16386
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16387
+ fields: record(string(), unknown()),
16388
+ secretPaths: array(string()),
16389
+ rows: number().int().nonnegative()
16390
+ });
16391
+ var EntryViewSchema = object({
16392
+ id: RecordIdSchema,
16393
+ name: string(),
16394
+ rev: number().int(),
16395
+ updatedAt: number(),
16396
+ /** Secret fields hold the redaction token. */
16397
+ data: RecordBodySchema
16398
+ });
16399
+ var EntryAddress = {
16400
+ owner: string().min(1),
16401
+ kind: RecordKindNameSchema
16402
+ };
16403
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16404
+ ...EntryAddress,
16405
+ id: RecordIdSchema.optional(),
16406
+ data: RecordBodySchema,
16407
+ ifRev: number().int().min(1).optional()
16408
+ }), object({
16409
+ id: string(),
16410
+ rev: number().int()
16411
+ }), {
16412
+ kind: "mutation",
16413
+ auth: "admin"
16414
+ }), method(object({
16415
+ ...EntryAddress,
16416
+ id: RecordIdSchema
16417
+ }), object({ deleted: boolean() }), {
16418
+ kind: "mutation",
16419
+ auth: "admin"
16028
16420
  });
16029
16421
  /**
16030
16422
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -67178,6 +67570,30 @@ Object.freeze({
67178
67570
  addonId: null,
67179
67571
  access: "create"
67180
67572
  },
67573
+ "recordEntries.deleteEntry": {
67574
+ capName: "record-entries",
67575
+ capScope: "system",
67576
+ addonId: null,
67577
+ access: "delete"
67578
+ },
67579
+ "recordEntries.listEntries": {
67580
+ capName: "record-entries",
67581
+ capScope: "system",
67582
+ addonId: null,
67583
+ access: "view"
67584
+ },
67585
+ "recordEntries.listEntryKinds": {
67586
+ capName: "record-entries",
67587
+ capScope: "system",
67588
+ addonId: null,
67589
+ access: "view"
67590
+ },
67591
+ "recordEntries.putEntry": {
67592
+ capName: "record-entries",
67593
+ capScope: "system",
67594
+ addonId: null,
67595
+ access: "create"
67596
+ },
67181
67597
  "recording.getAvailability": {
67182
67598
  capName: "recording",
67183
67599
  capScope: "device",
@@ -67478,6 +67894,102 @@ Object.freeze({
67478
67894
  addonId: null,
67479
67895
  access: "view"
67480
67896
  },
67897
+ "records.aggregate": {
67898
+ capName: "records",
67899
+ capScope: "system",
67900
+ addonId: null,
67901
+ access: "view"
67902
+ },
67903
+ "records.allocateId": {
67904
+ capName: "records",
67905
+ capScope: "system",
67906
+ addonId: null,
67907
+ access: "create"
67908
+ },
67909
+ "records.count": {
67910
+ capName: "records",
67911
+ capScope: "system",
67912
+ addonId: null,
67913
+ access: "view"
67914
+ },
67915
+ "records.declareKinds": {
67916
+ capName: "records",
67917
+ capScope: "system",
67918
+ addonId: null,
67919
+ access: "create"
67920
+ },
67921
+ "records.delete": {
67922
+ capName: "records",
67923
+ capScope: "system",
67924
+ addonId: null,
67925
+ access: "delete"
67926
+ },
67927
+ "records.deleteDevice": {
67928
+ capName: "records",
67929
+ capScope: "system",
67930
+ addonId: null,
67931
+ access: "delete"
67932
+ },
67933
+ "records.deleteMany": {
67934
+ capName: "records",
67935
+ capScope: "system",
67936
+ addonId: null,
67937
+ access: "delete"
67938
+ },
67939
+ "records.deleteWhere": {
67940
+ capName: "records",
67941
+ capScope: "system",
67942
+ addonId: null,
67943
+ access: "delete"
67944
+ },
67945
+ "records.get": {
67946
+ capName: "records",
67947
+ capScope: "system",
67948
+ addonId: null,
67949
+ access: "view"
67950
+ },
67951
+ "records.getMany": {
67952
+ capName: "records",
67953
+ capScope: "system",
67954
+ addonId: null,
67955
+ access: "view"
67956
+ },
67957
+ "records.histogram": {
67958
+ capName: "records",
67959
+ capScope: "system",
67960
+ addonId: null,
67961
+ access: "view"
67962
+ },
67963
+ "records.patch": {
67964
+ capName: "records",
67965
+ capScope: "system",
67966
+ addonId: null,
67967
+ access: "create"
67968
+ },
67969
+ "records.put": {
67970
+ capName: "records",
67971
+ capScope: "system",
67972
+ addonId: null,
67973
+ access: "create"
67974
+ },
67975
+ "records.putMany": {
67976
+ capName: "records",
67977
+ capScope: "system",
67978
+ addonId: null,
67979
+ access: "create"
67980
+ },
67981
+ "records.query": {
67982
+ capName: "records",
67983
+ capScope: "system",
67984
+ addonId: null,
67985
+ access: "view"
67986
+ },
67987
+ "records.secretRefs": {
67988
+ capName: "records",
67989
+ capScope: "system",
67990
+ addonId: null,
67991
+ access: "view"
67992
+ },
67481
67993
  "sceneMonitor.captureReference": {
67482
67994
  capName: "scene-monitor",
67483
67995
  capScope: "device",
@@ -67910,18 +68422,36 @@ Object.freeze({
67910
68422
  addonId: null,
67911
68423
  access: "create"
67912
68424
  },
68425
+ "storageAdmin.adoptRecords": {
68426
+ capName: "storage-admin",
68427
+ capScope: "system",
68428
+ addonId: null,
68429
+ access: "create"
68430
+ },
67913
68431
  "storageAdmin.dropCollection": {
67914
68432
  capName: "storage-admin",
67915
68433
  capScope: "system",
67916
68434
  addonId: null,
67917
68435
  access: "delete"
67918
68436
  },
68437
+ "storageAdmin.listKinds": {
68438
+ capName: "storage-admin",
68439
+ capScope: "system",
68440
+ addonId: null,
68441
+ access: "view"
68442
+ },
67919
68443
  "storageAdmin.listTables": {
67920
68444
  capName: "storage-admin",
67921
68445
  capScope: "system",
67922
68446
  addonId: null,
67923
68447
  access: "view"
67924
68448
  },
68449
+ "storageAdmin.readRecords": {
68450
+ capName: "storage-admin",
68451
+ capScope: "system",
68452
+ addonId: null,
68453
+ access: "view"
68454
+ },
67925
68455
  "storageEvictable.evict": {
67926
68456
  capName: "storage-evictable",
67927
68457
  capScope: "system",
@@ -71516,6 +72046,37 @@ Object.freeze({
71516
72046
  form: "single",
71517
72047
  optional: false
71518
72048
  }],
72049
+ "records.count": [{
72050
+ name: "deviceId",
72051
+ form: "single",
72052
+ optional: true
72053
+ }],
72054
+ "records.deleteDevice": [{
72055
+ name: "deviceId",
72056
+ form: "single",
72057
+ optional: false
72058
+ }],
72059
+ "records.deleteWhere": [{
72060
+ name: "deviceId",
72061
+ form: "single",
72062
+ optional: true
72063
+ }],
72064
+ "records.histogram": [{
72065
+ name: "deviceId",
72066
+ form: "single",
72067
+ optional: true
72068
+ }],
72069
+ "records.putMany": [{
72070
+ name: "records",
72071
+ form: "object-array",
72072
+ optional: false,
72073
+ itemField: "deviceId"
72074
+ }],
72075
+ "records.query": [{
72076
+ name: "deviceId",
72077
+ form: "single",
72078
+ optional: true
72079
+ }],
71519
72080
  "sceneMonitor.captureReference": [{
71520
72081
  name: "deviceId",
71521
72082
  form: "single",
@@ -71632,6 +72193,17 @@ Object.freeze({
71632
72193
  form: "single",
71633
72194
  optional: false
71634
72195
  }],
72196
+ "storageAdmin.adoptRecords": [{
72197
+ name: "records",
72198
+ form: "object-array",
72199
+ optional: false,
72200
+ itemField: "deviceId"
72201
+ }],
72202
+ "storageAdmin.readRecords": [{
72203
+ name: "deviceId",
72204
+ form: "single",
72205
+ optional: true
72206
+ }],
71635
72207
  "streamBroker.acquireEgressTranscode": [{
71636
72208
  name: "deviceId",
71637
72209
  form: "single",