@camstack/addon-model-studio 1.1.267 → 1.1.268

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 (18) hide show
  1. package/dist/{MotionZonesSettings-DgzasBlT.mjs → MotionZonesSettings-Bbrx9VW1.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-C6V_pqH4.mjs → PrivacyMaskSettings-Bc3Nh1vj.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-bYSdvmL5.mjs → SceneMonitorEditor-DoqQ-nbD.mjs} +3 -3
  4. package/dist/_stub.js +17 -17
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-C3hY64lf.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-BalgjE7Q.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-D4LoTU4p.mjs +26 -0
  7. package/dist/{hostInit-GD6w76TD.mjs → hostInit-BxoVlAJO.mjs} +2 -2
  8. package/dist/model-studio.addon.js +589 -17
  9. package/dist/model-studio.addon.mjs +589 -17
  10. package/dist/{player-overlays-DQIaDqhZ.mjs → player-overlays-DqOjIJBM.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-atOEv1Rp.mjs → responsive-DMQNbXa7.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-_tVUcOrI.mjs → scene-monitor-copy-D7Oz3W2_.mjs} +1 -1
  14. package/dist/{square-CQdNilMj.mjs → square-cSGFDS5x.mjs} +1 -1
  15. package/dist/{trash-2-C8zCmZRx.mjs → trash-2-8LnhGolp.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DzJS1VnS.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-BbWnFACc.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BxQy7-RG.mjs +0 -26
@@ -5800,7 +5800,7 @@ var ZodIssueCode = {
5800
5800
  var ZodFirstPartyTypeKind;
5801
5801
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5802
5802
  //#endregion
5803
- //#region ../types/dist/sleep-D-Q2_Mcd.mjs
5803
+ //#region ../types/dist/sleep-WsrozGDL.mjs
5804
5804
  /**
5805
5805
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5806
5806
  * window to float samples (D455).
@@ -5917,7 +5917,7 @@ function isKeychainStoredField(field) {
5917
5917
  var SECRET_CLEAR = { $secretClear: true };
5918
5918
  /** The `'***'` token D634 redaction writes for non-admins. */
5919
5919
  var LEGACY_DEVICE_REDACTION = "***";
5920
- function isRecord$2(value) {
5920
+ function isRecord$4(value) {
5921
5921
  return typeof value === "object" && value !== null && !Array.isArray(value);
5922
5922
  }
5923
5923
  function makeSecretMarker(ref) {
@@ -5928,12 +5928,12 @@ function makeSecretMarker(ref) {
5928
5928
  }
5929
5929
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5930
5930
  function isSecretMarker(value) {
5931
- if (!isRecord$2(value)) return false;
5931
+ if (!isRecord$4(value)) return false;
5932
5932
  const ref = value["$secret"];
5933
5933
  return typeof ref === "string" && ref.length > 0;
5934
5934
  }
5935
5935
  function isSecretClear(value) {
5936
- return isRecord$2(value) && value["$secretClear"] === true;
5936
+ return isRecord$4(value) && value["$secretClear"] === true;
5937
5937
  }
5938
5938
  /**
5939
5939
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6543,7 +6543,7 @@ var KeychainWriteRefusedError = class extends Error {
6543
6543
  }
6544
6544
  };
6545
6545
  var KEEP = { kind: "keep" };
6546
- function isRecord$1(value) {
6546
+ function isRecord$3(value) {
6547
6547
  return typeof value === "object" && value !== null && !Array.isArray(value);
6548
6548
  }
6549
6549
  function defaultMintId() {
@@ -6556,7 +6556,7 @@ function collectSecretMarkerRefs(value, out = []) {
6556
6556
  return out;
6557
6557
  }
6558
6558
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6559
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6559
+ else if (isRecord$3(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6560
6560
  return out;
6561
6561
  }
6562
6562
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6611,7 +6611,7 @@ function rowId(row, idKey) {
6611
6611
  return null;
6612
6612
  }
6613
6613
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6614
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6614
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$3) : [];
6615
6615
  if (!Array.isArray(incoming)) {
6616
6616
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6617
6617
  return {
@@ -6627,7 +6627,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6627
6627
  const kept = /* @__PURE__ */ new Set();
6628
6628
  const rows = [];
6629
6629
  for (const row of incoming) {
6630
- if (!isRecord$1(row)) {
6630
+ if (!isRecord$3(row)) {
6631
6631
  rows.push(row);
6632
6632
  continue;
6633
6633
  }
@@ -6652,7 +6652,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6652
6652
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6653
6653
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6654
6654
  case "object": {
6655
- if (!isRecord$1(incoming)) {
6655
+ if (!isRecord$3(incoming)) {
6656
6656
  if (incoming === void 0) return KEEP;
6657
6657
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6658
6658
  return {
@@ -6660,7 +6660,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6660
6660
  value: incoming
6661
6661
  };
6662
6662
  }
6663
- const storedObj = isRecord$1(stored) ? stored : {};
6663
+ const storedObj = isRecord$3(stored) ? stored : {};
6664
6664
  return {
6665
6665
  kind: "value",
6666
6666
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6783,7 +6783,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6783
6783
  value: items
6784
6784
  };
6785
6785
  }
6786
- if (isRecord$1(v)) {
6786
+ if (isRecord$3(v)) {
6787
6787
  const out = {};
6788
6788
  for (const [k, child] of Object.entries(v)) {
6789
6789
  const s = substitute(child);
@@ -6815,7 +6815,7 @@ var SecretOverwriteRefusedError = class extends Error {
6815
6815
  this.name = "SecretOverwriteRefusedError";
6816
6816
  }
6817
6817
  };
6818
- function isRecord$3(value) {
6818
+ function isRecord$2(value) {
6819
6819
  return typeof value === "object" && value !== null && !Array.isArray(value);
6820
6820
  }
6821
6821
  function resolvedValue(pass, marker) {
@@ -6844,7 +6844,7 @@ function inArray(pass, incoming, stored) {
6844
6844
  return incoming.map((item, index) => {
6845
6845
  const twin = stored[index];
6846
6846
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6847
- if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
6847
+ if (isRecord$2(item) && isRecord$2(twin)) return inArrayRow(pass, item, twin);
6848
6848
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6849
6849
  return item;
6850
6850
  });
@@ -6855,7 +6855,7 @@ function inArrayRow(pass, incoming, stored) {
6855
6855
  const twin = stored[key];
6856
6856
  if (isSecretMarker(twin)) {
6857
6857
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6858
- } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
6858
+ } else if (isRecord$2(value) && isRecord$2(twin)) out[key] = inArrayRow(pass, value, twin);
6859
6859
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6860
6860
  }
6861
6861
  return out;
@@ -6863,7 +6863,7 @@ function inArrayRow(pass, incoming, stored) {
6863
6863
  async function walk(pass, incoming, stored) {
6864
6864
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6865
6865
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6866
- if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
6866
+ if (!isRecord$2(incoming) || !isRecord$2(stored)) return incoming;
6867
6867
  const out = { ...incoming };
6868
6868
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6869
6869
  return out;
@@ -6894,7 +6894,7 @@ async function restoreUnchangedSecrets(input) {
6894
6894
  function isJsonEqual(a, b) {
6895
6895
  if (Object.is(a, b)) return true;
6896
6896
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6897
- if (isRecord$3(a) && isRecord$3(b)) {
6897
+ if (isRecord$2(a) && isRecord$2(b)) {
6898
6898
  const keys = Object.keys(a);
6899
6899
  if (keys.length !== Object.keys(b).length) return false;
6900
6900
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6918,7 +6918,7 @@ function markerKeysOf(blob, owner) {
6918
6918
  }
6919
6919
  function nodeFromStored(value, owner) {
6920
6920
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6921
- if (!isRecord$3(value)) return null;
6921
+ if (!isRecord$2(value)) return null;
6922
6922
  const children = /* @__PURE__ */ new Map();
6923
6923
  for (const [key, child] of Object.entries(value)) {
6924
6924
  const node = nodeFromStored(child, owner);
@@ -8200,6 +8200,89 @@ var PeerBytesTicketSchema = object({
8200
8200
  */
8201
8201
  declaredBytes: number().int().nonnegative().nullable()
8202
8202
  });
8203
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8204
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8205
+ var RECORD_DATABASES = ["settings", "events"];
8206
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8207
+ var RECORD_CLASSES = [
8208
+ "config",
8209
+ "ledger",
8210
+ "audit",
8211
+ "mirror",
8212
+ "ephemeral"
8213
+ ];
8214
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8215
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8216
+ var RECORD_BATCH_MAX = 1e3;
8217
+ var RECORD_QUERY_MAX = 1e3;
8218
+ /**
8219
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8220
+ * Zod row schema that describes it, and the helper that turns the two into the
8221
+ * JSON the engine stores.
8222
+ *
8223
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
8224
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
8225
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
8226
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
8227
+ * never a field name (D879).
8228
+ */
8229
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
8230
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
8231
+ var RecordIndexSchema = object({
8232
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
8233
+ fields: array(RecordFieldPathSchema).min(1).max(4),
8234
+ unique: boolean().optional()
8235
+ }).strict();
8236
+ var RecordRetentionSchema = union([
8237
+ object({
8238
+ ttlMs: number().int().positive(),
8239
+ from: _enum(["at", "write"])
8240
+ }).strict(),
8241
+ object({
8242
+ maxRows: number().int().positive().optional(),
8243
+ maxRowsPerDevice: number().int().positive().optional()
8244
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
8245
+ object({
8246
+ owner: string().min(1),
8247
+ reason: string().min(1)
8248
+ }).strict(),
8249
+ object({ none: string().min(1) }).strict()
8250
+ ]);
8251
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
8252
+ var EntryDescriptorSchema = object({
8253
+ title: string().min(1),
8254
+ /** The record body field shown as the entry's name. */
8255
+ nameField: string().min(1),
8256
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
8257
+ fields: record(string(), unknown())
8258
+ }).strict();
8259
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
8260
+ var RecordKindDeclarationSchema = object({
8261
+ database: _enum(RECORD_DATABASES).default("settings"),
8262
+ class: _enum(RECORD_CLASSES),
8263
+ writeTrigger: string().min(1),
8264
+ device: _enum([
8265
+ "required",
8266
+ "optional",
8267
+ "none"
8268
+ ]).default("none"),
8269
+ at: _enum(["required", "none"]).default("none"),
8270
+ indexes: array(RecordIndexSchema).max(8).default([]),
8271
+ retention: RecordRetentionSchema,
8272
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
8273
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
8274
+ /** Derived from the Zod schema; never written by hand. */
8275
+ secretPaths: array(string().min(1)).default([]),
8276
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
8277
+ secretArrayKeys: record(string(), string()).default({}),
8278
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
8279
+ adoptsFrom: string().min(1).optional(),
8280
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
8281
+ transactFamily: string().min(1).optional(),
8282
+ entry: EntryDescriptorSchema.optional()
8283
+ }).strict();
8284
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
8285
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8203
8286
  /** Shared Zod schemas used across streaming capabilities. */
8204
8287
  var CamProfileSchema = _enum([
8205
8288
  "high",
@@ -16629,6 +16712,222 @@ id: union([string(), number()]) }), {
16629
16712
  kind: "mutation",
16630
16713
  auth: "admin"
16631
16714
  });
16715
+ /**
16716
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16717
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16718
+ * (operator intent, D870) and device-history (numbers over time, D850).
16719
+ *
16720
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16721
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16722
+ * that with the addon id closed over). It is deliberately NOT in any input
16723
+ * schema, so a session can never supply it, and a call with no stamp is refused
16724
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16725
+ * addons go through the owner's capability.
16726
+ *
16727
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16728
+ * never `[]`. Secret fields are never on the wire: a read shows the
16729
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16730
+ * resolves itself, and a write may carry only a keychain marker bound to the
16731
+ * row's own ref.
16732
+ *
16733
+ * Internal: addons reach it through `ctx.records`, never directly.
16734
+ */
16735
+ var RecordIdSchema = string().min(1).max(256);
16736
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16737
+ var RecordBodySchema = record(string(), unknown());
16738
+ var RecordInputSchema = object({
16739
+ id: RecordIdSchema,
16740
+ /** The device this row belongs to (D865 removal, per-device reads). */
16741
+ deviceId: number().int().optional(),
16742
+ /** The domain clock, ms: observed / created / opened. */
16743
+ at: number().int().optional(),
16744
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16745
+ expiresAt: number().int().optional(),
16746
+ data: RecordBodySchema
16747
+ });
16748
+ var RecordViewSchema = object({
16749
+ id: string(),
16750
+ deviceId: number().int().nullable(),
16751
+ at: number().nullable(),
16752
+ expiresAt: number().nullable(),
16753
+ rev: number().int(),
16754
+ updatedAt: number(),
16755
+ data: RecordBodySchema
16756
+ });
16757
+ /** Declared index fields only. Anything else does not compile, by design. */
16758
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16759
+ string(),
16760
+ number(),
16761
+ boolean(),
16762
+ object({ in: array(union([
16763
+ string(),
16764
+ number(),
16765
+ boolean()
16766
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16767
+ object({
16768
+ gt: union([string(), number()]).optional(),
16769
+ gte: union([string(), number()]).optional(),
16770
+ lt: union([string(), number()]).optional(),
16771
+ lte: union([string(), number()]).optional()
16772
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16773
+ ]));
16774
+ var KindShape = { kind: RecordKindNameSchema };
16775
+ var TimeWindowShape = {
16776
+ deviceId: number().int().optional(),
16777
+ atFrom: number().optional(),
16778
+ atTo: number().optional()
16779
+ };
16780
+ var RecordQueryInputSchema = object({
16781
+ ...KindShape,
16782
+ ...TimeWindowShape,
16783
+ where: RecordWhereSchema.optional(),
16784
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16785
+ order: _enum(["at", "id"]).optional(),
16786
+ desc: boolean().optional(),
16787
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16788
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16789
+ cursor: string().min(1).optional()
16790
+ });
16791
+ var RecordQueryResultSchema = object({
16792
+ records: array(RecordViewSchema),
16793
+ nextCursor: string().nullable()
16794
+ });
16795
+ var RecordKindStateSchema = _enum([
16796
+ "created",
16797
+ "unchanged",
16798
+ "updated"
16799
+ ]);
16800
+ var DeclareKindResultSchema = object({
16801
+ kindId: number().int(),
16802
+ state: RecordKindStateSchema,
16803
+ createdIndexes: array(string()),
16804
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16805
+ adoptionPending: object({
16806
+ legacyTable: string(),
16807
+ legacyRows: number().int()
16808
+ }).nullable()
16809
+ });
16810
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16811
+ var SecretRefsList = array(string());
16812
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16813
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16814
+ kind: "mutation",
16815
+ auth: "admin"
16816
+ }), method(object({
16817
+ ...KindShape,
16818
+ id: RecordIdSchema
16819
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16820
+ ...KindShape,
16821
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16822
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16823
+ ...KindShape,
16824
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16825
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16826
+ ...KindShape,
16827
+ record: RecordInputSchema,
16828
+ /** Compare-and-set. `0` means "the row must not exist". */
16829
+ ifRev: number().int().min(0).optional()
16830
+ }), object({
16831
+ rev: number().int(),
16832
+ releasedRefs: SecretRefsList
16833
+ }), {
16834
+ kind: "mutation",
16835
+ auth: "admin"
16836
+ }), method(object({
16837
+ ...KindShape,
16838
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16839
+ }), object({
16840
+ count: number().int(),
16841
+ releasedRefs: SecretRefsList
16842
+ }), {
16843
+ kind: "mutation",
16844
+ auth: "admin"
16845
+ }), method(object({
16846
+ ...KindShape,
16847
+ id: RecordIdSchema,
16848
+ data: RecordBodySchema,
16849
+ at: number().int().nullable().optional(),
16850
+ expiresAt: number().int().nullable().optional(),
16851
+ ifRev: number().int().min(1).optional()
16852
+ }), object({
16853
+ rev: number().int(),
16854
+ releasedRefs: SecretRefsList
16855
+ }), {
16856
+ kind: "mutation",
16857
+ auth: "admin"
16858
+ }), method(object({
16859
+ ...KindShape,
16860
+ id: RecordIdSchema
16861
+ }), object({
16862
+ deleted: boolean(),
16863
+ secretRefs: SecretRefsList
16864
+ }), {
16865
+ kind: "mutation",
16866
+ auth: "admin"
16867
+ }), method(object({
16868
+ ...KindShape,
16869
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16870
+ }), object({
16871
+ deleted: number().int(),
16872
+ secretRefs: SecretRefsList
16873
+ }), {
16874
+ kind: "mutation",
16875
+ auth: "admin"
16876
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16877
+ ...KindShape,
16878
+ ...TimeWindowShape,
16879
+ where: RecordWhereSchema.optional()
16880
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16881
+ ...KindShape,
16882
+ deviceId: number().int().optional(),
16883
+ from: number(),
16884
+ to: number(),
16885
+ bucketMs: number().int().positive()
16886
+ }), object({ buckets: array(object({
16887
+ bucketStart: number(),
16888
+ count: number().int()
16889
+ })) }), { auth: "admin" }), method(object({
16890
+ ...KindShape,
16891
+ op: _enum([
16892
+ "sum",
16893
+ "min",
16894
+ "max",
16895
+ "count"
16896
+ ]),
16897
+ field: RecordFieldPathSchema.optional(),
16898
+ groupBy: RecordFieldPathSchema.optional(),
16899
+ where: RecordWhereSchema.optional()
16900
+ }), object({ rows: array(object({
16901
+ group: union([
16902
+ string(),
16903
+ number(),
16904
+ _null()
16905
+ ]),
16906
+ value: number().nullable()
16907
+ })) }), { auth: "admin" }), method(object({
16908
+ ...KindShape,
16909
+ deviceId: number().int().optional(),
16910
+ atBefore: number().optional(),
16911
+ where: RecordWhereSchema.optional()
16912
+ }), object({
16913
+ deleted: number().int(),
16914
+ secretRefs: SecretRefsList
16915
+ }), {
16916
+ kind: "mutation",
16917
+ auth: "admin"
16918
+ }), method(object({
16919
+ deviceId: number().int(),
16920
+ kinds: array(RecordKindNameSchema).optional()
16921
+ }), object({
16922
+ deleted: record(string(), number().int()),
16923
+ secretRefs: SecretRefsList
16924
+ }), {
16925
+ kind: "mutation",
16926
+ auth: "admin"
16927
+ }), method(object(KindShape), object({ id: number().int() }), {
16928
+ kind: "mutation",
16929
+ auth: "admin"
16930
+ });
16632
16931
  /** One table of the settings database. */
16633
16932
  var StorageTableSchema = object({
16634
16933
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -16641,6 +16940,28 @@ var StorageTableSchema = object({
16641
16940
  /** Declared by an addon since this engine process started (a running addon claims it). */
16642
16941
  declaredThisBoot: boolean()
16643
16942
  });
16943
+ /** One declared record kind (D881) as System -> Data shows it. */
16944
+ var StorageKindSchema = object({
16945
+ owner: string(),
16946
+ kind: string(),
16947
+ database: _enum(["settings", "events"]),
16948
+ class: string(),
16949
+ state: _enum([
16950
+ "declared",
16951
+ "orphaned",
16952
+ "dropped"
16953
+ ]),
16954
+ /** `null` when the caller asked for no counts (`counts: false`). */
16955
+ rows: number().int().nonnegative().nullable(),
16956
+ /** Rows x the average size of a sample; null for an empty kind. */
16957
+ bytesEstimate: number().int().nonnegative().nullable(),
16958
+ writeTrigger: string(),
16959
+ retention: RecordRetentionSchema,
16960
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16961
+ entry: boolean(),
16962
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16963
+ declaration: RecordKindDeclarationSchema
16964
+ });
16644
16965
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16645
16966
  collection: string().min(1),
16646
16967
  expectRows: number().int().nonnegative()
@@ -16650,6 +16971,77 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
16650
16971
  }), {
16651
16972
  kind: "mutation",
16652
16973
  auth: "admin"
16974
+ }), method(object({
16975
+ owner: string().min(1).optional(),
16976
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16977
+ counts: boolean().optional()
16978
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16979
+ owner: string().min(1),
16980
+ kind: RecordKindNameSchema
16981
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16982
+ owner: string().min(1),
16983
+ kind: RecordKindNameSchema,
16984
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX),
16985
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16986
+ complete: boolean().optional()
16987
+ }), object({ adopted: number().int() }), {
16988
+ kind: "mutation",
16989
+ auth: "admin"
16990
+ });
16991
+ /**
16992
+ * record-entries - the ONE admin surface for every list of user-created entries
16993
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16994
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16995
+ *
16996
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16997
+ * the entry body with `secret: true` on every credential field, so a password
16998
+ * field is derived from the schema and never from a name. `putEntry` takes the
16999
+ * redaction token for an untouched secret (the stored value is kept), a string
17000
+ * for a new one, and the clear instruction to remove one. A read never carries
17001
+ * a secret value, and a locked keychain refuses the write with
17002
+ * `records/secret-unavailable` instead of storing plaintext.
17003
+ *
17004
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
17005
+ */
17006
+ var EntryKindInfoSchema = object({
17007
+ owner: string(),
17008
+ kind: RecordKindNameSchema,
17009
+ title: string(),
17010
+ nameField: string(),
17011
+ /** JSON Schema of the body; `secret: true` marks a password field. */
17012
+ fields: record(string(), unknown()),
17013
+ secretPaths: array(string()),
17014
+ rows: number().int().nonnegative()
17015
+ });
17016
+ var EntryViewSchema = object({
17017
+ id: RecordIdSchema,
17018
+ name: string(),
17019
+ rev: number().int(),
17020
+ updatedAt: number(),
17021
+ /** Secret fields hold the redaction token. */
17022
+ data: RecordBodySchema
17023
+ });
17024
+ var EntryAddress = {
17025
+ owner: string().min(1),
17026
+ kind: RecordKindNameSchema
17027
+ };
17028
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
17029
+ ...EntryAddress,
17030
+ id: RecordIdSchema.optional(),
17031
+ data: RecordBodySchema,
17032
+ ifRev: number().int().min(1).optional()
17033
+ }), object({
17034
+ id: string(),
17035
+ rev: number().int()
17036
+ }), {
17037
+ kind: "mutation",
17038
+ auth: "admin"
17039
+ }), method(object({
17040
+ ...EntryAddress,
17041
+ id: RecordIdSchema
17042
+ }), object({ deleted: boolean() }), {
17043
+ kind: "mutation",
17044
+ auth: "admin"
16653
17045
  });
16654
17046
  /**
16655
17047
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -67807,6 +68199,30 @@ Object.freeze({
67807
68199
  addonId: null,
67808
68200
  access: "create"
67809
68201
  },
68202
+ "recordEntries.deleteEntry": {
68203
+ capName: "record-entries",
68204
+ capScope: "system",
68205
+ addonId: null,
68206
+ access: "delete"
68207
+ },
68208
+ "recordEntries.listEntries": {
68209
+ capName: "record-entries",
68210
+ capScope: "system",
68211
+ addonId: null,
68212
+ access: "view"
68213
+ },
68214
+ "recordEntries.listEntryKinds": {
68215
+ capName: "record-entries",
68216
+ capScope: "system",
68217
+ addonId: null,
68218
+ access: "view"
68219
+ },
68220
+ "recordEntries.putEntry": {
68221
+ capName: "record-entries",
68222
+ capScope: "system",
68223
+ addonId: null,
68224
+ access: "create"
68225
+ },
67810
68226
  "recording.getAvailability": {
67811
68227
  capName: "recording",
67812
68228
  capScope: "device",
@@ -68107,6 +68523,102 @@ Object.freeze({
68107
68523
  addonId: null,
68108
68524
  access: "view"
68109
68525
  },
68526
+ "records.aggregate": {
68527
+ capName: "records",
68528
+ capScope: "system",
68529
+ addonId: null,
68530
+ access: "view"
68531
+ },
68532
+ "records.allocateId": {
68533
+ capName: "records",
68534
+ capScope: "system",
68535
+ addonId: null,
68536
+ access: "create"
68537
+ },
68538
+ "records.count": {
68539
+ capName: "records",
68540
+ capScope: "system",
68541
+ addonId: null,
68542
+ access: "view"
68543
+ },
68544
+ "records.declareKinds": {
68545
+ capName: "records",
68546
+ capScope: "system",
68547
+ addonId: null,
68548
+ access: "create"
68549
+ },
68550
+ "records.delete": {
68551
+ capName: "records",
68552
+ capScope: "system",
68553
+ addonId: null,
68554
+ access: "delete"
68555
+ },
68556
+ "records.deleteDevice": {
68557
+ capName: "records",
68558
+ capScope: "system",
68559
+ addonId: null,
68560
+ access: "delete"
68561
+ },
68562
+ "records.deleteMany": {
68563
+ capName: "records",
68564
+ capScope: "system",
68565
+ addonId: null,
68566
+ access: "delete"
68567
+ },
68568
+ "records.deleteWhere": {
68569
+ capName: "records",
68570
+ capScope: "system",
68571
+ addonId: null,
68572
+ access: "delete"
68573
+ },
68574
+ "records.get": {
68575
+ capName: "records",
68576
+ capScope: "system",
68577
+ addonId: null,
68578
+ access: "view"
68579
+ },
68580
+ "records.getMany": {
68581
+ capName: "records",
68582
+ capScope: "system",
68583
+ addonId: null,
68584
+ access: "view"
68585
+ },
68586
+ "records.histogram": {
68587
+ capName: "records",
68588
+ capScope: "system",
68589
+ addonId: null,
68590
+ access: "view"
68591
+ },
68592
+ "records.patch": {
68593
+ capName: "records",
68594
+ capScope: "system",
68595
+ addonId: null,
68596
+ access: "create"
68597
+ },
68598
+ "records.put": {
68599
+ capName: "records",
68600
+ capScope: "system",
68601
+ addonId: null,
68602
+ access: "create"
68603
+ },
68604
+ "records.putMany": {
68605
+ capName: "records",
68606
+ capScope: "system",
68607
+ addonId: null,
68608
+ access: "create"
68609
+ },
68610
+ "records.query": {
68611
+ capName: "records",
68612
+ capScope: "system",
68613
+ addonId: null,
68614
+ access: "view"
68615
+ },
68616
+ "records.secretRefs": {
68617
+ capName: "records",
68618
+ capScope: "system",
68619
+ addonId: null,
68620
+ access: "view"
68621
+ },
68110
68622
  "sceneMonitor.captureReference": {
68111
68623
  capName: "scene-monitor",
68112
68624
  capScope: "device",
@@ -68539,18 +69051,36 @@ Object.freeze({
68539
69051
  addonId: null,
68540
69052
  access: "create"
68541
69053
  },
69054
+ "storageAdmin.adoptRecords": {
69055
+ capName: "storage-admin",
69056
+ capScope: "system",
69057
+ addonId: null,
69058
+ access: "create"
69059
+ },
68542
69060
  "storageAdmin.dropCollection": {
68543
69061
  capName: "storage-admin",
68544
69062
  capScope: "system",
68545
69063
  addonId: null,
68546
69064
  access: "delete"
68547
69065
  },
69066
+ "storageAdmin.listKinds": {
69067
+ capName: "storage-admin",
69068
+ capScope: "system",
69069
+ addonId: null,
69070
+ access: "view"
69071
+ },
68548
69072
  "storageAdmin.listTables": {
68549
69073
  capName: "storage-admin",
68550
69074
  capScope: "system",
68551
69075
  addonId: null,
68552
69076
  access: "view"
68553
69077
  },
69078
+ "storageAdmin.readRecords": {
69079
+ capName: "storage-admin",
69080
+ capScope: "system",
69081
+ addonId: null,
69082
+ access: "view"
69083
+ },
68554
69084
  "storageEvictable.evict": {
68555
69085
  capName: "storage-evictable",
68556
69086
  capScope: "system",
@@ -72145,6 +72675,37 @@ Object.freeze({
72145
72675
  form: "single",
72146
72676
  optional: false
72147
72677
  }],
72678
+ "records.count": [{
72679
+ name: "deviceId",
72680
+ form: "single",
72681
+ optional: true
72682
+ }],
72683
+ "records.deleteDevice": [{
72684
+ name: "deviceId",
72685
+ form: "single",
72686
+ optional: false
72687
+ }],
72688
+ "records.deleteWhere": [{
72689
+ name: "deviceId",
72690
+ form: "single",
72691
+ optional: true
72692
+ }],
72693
+ "records.histogram": [{
72694
+ name: "deviceId",
72695
+ form: "single",
72696
+ optional: true
72697
+ }],
72698
+ "records.putMany": [{
72699
+ name: "records",
72700
+ form: "object-array",
72701
+ optional: false,
72702
+ itemField: "deviceId"
72703
+ }],
72704
+ "records.query": [{
72705
+ name: "deviceId",
72706
+ form: "single",
72707
+ optional: true
72708
+ }],
72148
72709
  "sceneMonitor.captureReference": [{
72149
72710
  name: "deviceId",
72150
72711
  form: "single",
@@ -72261,6 +72822,17 @@ Object.freeze({
72261
72822
  form: "single",
72262
72823
  optional: false
72263
72824
  }],
72825
+ "storageAdmin.adoptRecords": [{
72826
+ name: "records",
72827
+ form: "object-array",
72828
+ optional: false,
72829
+ itemField: "deviceId"
72830
+ }],
72831
+ "storageAdmin.readRecords": [{
72832
+ name: "deviceId",
72833
+ form: "single",
72834
+ optional: true
72835
+ }],
72264
72836
  "streamBroker.acquireEgressTranscode": [{
72265
72837
  name: "deviceId",
72266
72838
  form: "single",