@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
@@ -5438,7 +5438,7 @@ var ZodIssueCode = {
5438
5438
  var ZodFirstPartyTypeKind;
5439
5439
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5440
5440
  //#endregion
5441
- //#region ../types/dist/sleep-D-Q2_Mcd.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",
@@ -16037,6 +16120,222 @@ id: union([string(), number()]) }), {
16037
16120
  kind: "mutation",
16038
16121
  auth: "admin"
16039
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
+ });
16040
16339
  /** One table of the settings database. */
16041
16340
  var StorageTableSchema = object({
16042
16341
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -16049,6 +16348,28 @@ var StorageTableSchema = object({
16049
16348
  /** Declared by an addon since this engine process started (a running addon claims it). */
16050
16349
  declaredThisBoot: boolean()
16051
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
+ });
16052
16373
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16053
16374
  collection: string().min(1),
16054
16375
  expectRows: number().int().nonnegative()
@@ -16058,6 +16379,77 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
16058
16379
  }), {
16059
16380
  kind: "mutation",
16060
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"
16061
16453
  });
16062
16454
  /**
16063
16455
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -67211,6 +67603,30 @@ Object.freeze({
67211
67603
  addonId: null,
67212
67604
  access: "create"
67213
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
+ },
67214
67630
  "recording.getAvailability": {
67215
67631
  capName: "recording",
67216
67632
  capScope: "device",
@@ -67511,6 +67927,102 @@ Object.freeze({
67511
67927
  addonId: null,
67512
67928
  access: "view"
67513
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
+ },
67514
68026
  "sceneMonitor.captureReference": {
67515
68027
  capName: "scene-monitor",
67516
68028
  capScope: "device",
@@ -67943,18 +68455,36 @@ Object.freeze({
67943
68455
  addonId: null,
67944
68456
  access: "create"
67945
68457
  },
68458
+ "storageAdmin.adoptRecords": {
68459
+ capName: "storage-admin",
68460
+ capScope: "system",
68461
+ addonId: null,
68462
+ access: "create"
68463
+ },
67946
68464
  "storageAdmin.dropCollection": {
67947
68465
  capName: "storage-admin",
67948
68466
  capScope: "system",
67949
68467
  addonId: null,
67950
68468
  access: "delete"
67951
68469
  },
68470
+ "storageAdmin.listKinds": {
68471
+ capName: "storage-admin",
68472
+ capScope: "system",
68473
+ addonId: null,
68474
+ access: "view"
68475
+ },
67952
68476
  "storageAdmin.listTables": {
67953
68477
  capName: "storage-admin",
67954
68478
  capScope: "system",
67955
68479
  addonId: null,
67956
68480
  access: "view"
67957
68481
  },
68482
+ "storageAdmin.readRecords": {
68483
+ capName: "storage-admin",
68484
+ capScope: "system",
68485
+ addonId: null,
68486
+ access: "view"
68487
+ },
67958
68488
  "storageEvictable.evict": {
67959
68489
  capName: "storage-evictable",
67960
68490
  capScope: "system",
@@ -71549,6 +72079,37 @@ Object.freeze({
71549
72079
  form: "single",
71550
72080
  optional: false
71551
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
+ }],
71552
72113
  "sceneMonitor.captureReference": [{
71553
72114
  name: "deviceId",
71554
72115
  form: "single",
@@ -71665,6 +72226,17 @@ Object.freeze({
71665
72226
  form: "single",
71666
72227
  optional: false
71667
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
+ }],
71668
72240
  "streamBroker.acquireEgressTranscode": [{
71669
72241
  name: "deviceId",
71670
72242
  form: "single",