@camstack/addon-osd-manager 0.1.243 → 0.1.244

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-D33EAKv-.mjs → MotionZonesSettings-Dx0QePDr.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BhHKLXkl.mjs → PrivacyMaskSettings-Dpvj9Htf.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-BechjHQf.mjs → SceneMonitorEditor-CInL6GVs.mjs} +3 -3
  4. package/dist/_stub.js +202 -151
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-C7G9Y8qi.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-DkadILEV.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Dfue3rir.mjs +26 -0
  7. package/dist/{hostInit-C_ixqaxz.mjs → hostInit-BZGn1YFH.mjs} +2 -2
  8. package/dist/index.js +591 -17
  9. package/dist/index.mjs +591 -17
  10. package/dist/{player-overlays-BZDAYS9O.mjs → player-overlays-Ces1nEGQ.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-DWwtegbU.mjs → responsive-xOj-SfJF.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-BGLxak_F.mjs → scene-monitor-copy-BZMgBFaF.mjs} +1 -1
  14. package/dist/{square-CFpzQ33C.mjs → square-CAeV_Co2.mjs} +1 -1
  15. package/dist/{trash-2-_8r13DVx.mjs → trash-2-LqYIxrzA.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-CFhCZpWZ.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-epKXdpkT.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CGo2CGP3.mjs +0 -26
package/dist/index.mjs CHANGED
@@ -5404,7 +5404,7 @@ var ZodIssueCode = {
5404
5404
  var ZodFirstPartyTypeKind;
5405
5405
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5406
5406
  //#endregion
5407
- //#region ../types/dist/sleep-D-Q2_Mcd.mjs
5407
+ //#region ../types/dist/sleep-WsrozGDL.mjs
5408
5408
  /**
5409
5409
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5410
5410
  * window to float samples (D455).
@@ -5521,7 +5521,7 @@ function isKeychainStoredField(field) {
5521
5521
  var SECRET_CLEAR = { $secretClear: true };
5522
5522
  /** The `'***'` token D634 redaction writes for non-admins. */
5523
5523
  var LEGACY_DEVICE_REDACTION = "***";
5524
- function isRecord$2(value) {
5524
+ function isRecord$4(value) {
5525
5525
  return typeof value === "object" && value !== null && !Array.isArray(value);
5526
5526
  }
5527
5527
  function makeSecretMarker(ref) {
@@ -5532,12 +5532,12 @@ function makeSecretMarker(ref) {
5532
5532
  }
5533
5533
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5534
5534
  function isSecretMarker(value) {
5535
- if (!isRecord$2(value)) return false;
5535
+ if (!isRecord$4(value)) return false;
5536
5536
  const ref = value["$secret"];
5537
5537
  return typeof ref === "string" && ref.length > 0;
5538
5538
  }
5539
5539
  function isSecretClear(value) {
5540
- return isRecord$2(value) && value["$secretClear"] === true;
5540
+ return isRecord$4(value) && value["$secretClear"] === true;
5541
5541
  }
5542
5542
  /**
5543
5543
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6147,7 +6147,7 @@ var KeychainWriteRefusedError = class extends Error {
6147
6147
  }
6148
6148
  };
6149
6149
  var KEEP = { kind: "keep" };
6150
- function isRecord$1(value) {
6150
+ function isRecord$3(value) {
6151
6151
  return typeof value === "object" && value !== null && !Array.isArray(value);
6152
6152
  }
6153
6153
  function defaultMintId() {
@@ -6160,7 +6160,7 @@ function collectSecretMarkerRefs(value, out = []) {
6160
6160
  return out;
6161
6161
  }
6162
6162
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6163
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6163
+ else if (isRecord$3(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6164
6164
  return out;
6165
6165
  }
6166
6166
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6215,7 +6215,7 @@ function rowId(row, idKey) {
6215
6215
  return null;
6216
6216
  }
6217
6217
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6218
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6218
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$3) : [];
6219
6219
  if (!Array.isArray(incoming)) {
6220
6220
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6221
6221
  return {
@@ -6231,7 +6231,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6231
6231
  const kept = /* @__PURE__ */ new Set();
6232
6232
  const rows = [];
6233
6233
  for (const row of incoming) {
6234
- if (!isRecord$1(row)) {
6234
+ if (!isRecord$3(row)) {
6235
6235
  rows.push(row);
6236
6236
  continue;
6237
6237
  }
@@ -6256,7 +6256,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6256
6256
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6257
6257
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6258
6258
  case "object": {
6259
- if (!isRecord$1(incoming)) {
6259
+ if (!isRecord$3(incoming)) {
6260
6260
  if (incoming === void 0) return KEEP;
6261
6261
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6262
6262
  return {
@@ -6264,7 +6264,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6264
6264
  value: incoming
6265
6265
  };
6266
6266
  }
6267
- const storedObj = isRecord$1(stored) ? stored : {};
6267
+ const storedObj = isRecord$3(stored) ? stored : {};
6268
6268
  return {
6269
6269
  kind: "value",
6270
6270
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6387,7 +6387,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6387
6387
  value: items
6388
6388
  };
6389
6389
  }
6390
- if (isRecord$1(v)) {
6390
+ if (isRecord$3(v)) {
6391
6391
  const out = {};
6392
6392
  for (const [k, child] of Object.entries(v)) {
6393
6393
  const s = substitute(child);
@@ -6419,7 +6419,7 @@ var SecretOverwriteRefusedError = class extends Error {
6419
6419
  this.name = "SecretOverwriteRefusedError";
6420
6420
  }
6421
6421
  };
6422
- function isRecord(value) {
6422
+ function isRecord$2(value) {
6423
6423
  return typeof value === "object" && value !== null && !Array.isArray(value);
6424
6424
  }
6425
6425
  function resolvedValue(pass, marker) {
@@ -6448,7 +6448,7 @@ function inArray(pass, incoming, stored) {
6448
6448
  return incoming.map((item, index) => {
6449
6449
  const twin = stored[index];
6450
6450
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6451
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6451
+ if (isRecord$2(item) && isRecord$2(twin)) return inArrayRow(pass, item, twin);
6452
6452
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6453
6453
  return item;
6454
6454
  });
@@ -6459,7 +6459,7 @@ function inArrayRow(pass, incoming, stored) {
6459
6459
  const twin = stored[key];
6460
6460
  if (isSecretMarker(twin)) {
6461
6461
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6462
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6462
+ } else if (isRecord$2(value) && isRecord$2(twin)) out[key] = inArrayRow(pass, value, twin);
6463
6463
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6464
6464
  }
6465
6465
  return out;
@@ -6467,7 +6467,7 @@ function inArrayRow(pass, incoming, stored) {
6467
6467
  async function walk$1(pass, incoming, stored) {
6468
6468
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6469
6469
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6470
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6470
+ if (!isRecord$2(incoming) || !isRecord$2(stored)) return incoming;
6471
6471
  const out = { ...incoming };
6472
6472
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk$1(pass, value, stored[key]);
6473
6473
  return out;
@@ -6498,7 +6498,7 @@ async function restoreUnchangedSecrets(input) {
6498
6498
  function isJsonEqual(a, b) {
6499
6499
  if (Object.is(a, b)) return true;
6500
6500
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6501
- if (isRecord(a) && isRecord(b)) {
6501
+ if (isRecord$2(a) && isRecord$2(b)) {
6502
6502
  const keys = Object.keys(a);
6503
6503
  if (keys.length !== Object.keys(b).length) return false;
6504
6504
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6522,7 +6522,7 @@ function markerKeysOf(blob, owner) {
6522
6522
  }
6523
6523
  function nodeFromStored(value, owner) {
6524
6524
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6525
- if (!isRecord(value)) return null;
6525
+ if (!isRecord$2(value)) return null;
6526
6526
  const children = /* @__PURE__ */ new Map();
6527
6527
  for (const [key, child] of Object.entries(value)) {
6528
6528
  const node = nodeFromStored(child, owner);
@@ -7804,6 +7804,89 @@ var PeerBytesTicketSchema = object({
7804
7804
  */
7805
7805
  declaredBytes: number().int().nonnegative().nullable()
7806
7806
  });
7807
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7808
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7809
+ var RECORD_DATABASES = ["settings", "events"];
7810
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7811
+ var RECORD_CLASSES = [
7812
+ "config",
7813
+ "ledger",
7814
+ "audit",
7815
+ "mirror",
7816
+ "ephemeral"
7817
+ ];
7818
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7819
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7820
+ var RECORD_BATCH_MAX = 1e3;
7821
+ var RECORD_QUERY_MAX = 1e3;
7822
+ /**
7823
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7824
+ * Zod row schema that describes it, and the helper that turns the two into the
7825
+ * JSON the engine stores.
7826
+ *
7827
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7828
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7829
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7830
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7831
+ * never a field name (D879).
7832
+ */
7833
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7834
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7835
+ var RecordIndexSchema = object({
7836
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7837
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7838
+ unique: boolean().optional()
7839
+ }).strict();
7840
+ var RecordRetentionSchema = union([
7841
+ object({
7842
+ ttlMs: number().int().positive(),
7843
+ from: _enum(["at", "write"])
7844
+ }).strict(),
7845
+ object({
7846
+ maxRows: number().int().positive().optional(),
7847
+ maxRowsPerDevice: number().int().positive().optional()
7848
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7849
+ object({
7850
+ owner: string().min(1),
7851
+ reason: string().min(1)
7852
+ }).strict(),
7853
+ object({ none: string().min(1) }).strict()
7854
+ ]);
7855
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7856
+ var EntryDescriptorSchema = object({
7857
+ title: string().min(1),
7858
+ /** The record body field shown as the entry's name. */
7859
+ nameField: string().min(1),
7860
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7861
+ fields: record(string(), unknown())
7862
+ }).strict();
7863
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7864
+ var RecordKindDeclarationSchema = object({
7865
+ database: _enum(RECORD_DATABASES).default("settings"),
7866
+ class: _enum(RECORD_CLASSES),
7867
+ writeTrigger: string().min(1),
7868
+ device: _enum([
7869
+ "required",
7870
+ "optional",
7871
+ "none"
7872
+ ]).default("none"),
7873
+ at: _enum(["required", "none"]).default("none"),
7874
+ indexes: array(RecordIndexSchema).max(8).default([]),
7875
+ retention: RecordRetentionSchema,
7876
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7877
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7878
+ /** Derived from the Zod schema; never written by hand. */
7879
+ secretPaths: array(string().min(1)).default([]),
7880
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7881
+ secretArrayKeys: record(string(), string()).default({}),
7882
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7883
+ adoptsFrom: string().min(1).optional(),
7884
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7885
+ transactFamily: string().min(1).optional(),
7886
+ entry: EntryDescriptorSchema.optional()
7887
+ }).strict();
7888
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7889
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7807
7890
  /** Shared Zod schemas used across streaming capabilities. */
7808
7891
  var CamProfileSchema = _enum([
7809
7892
  "high",
@@ -15985,6 +16068,222 @@ id: union([string(), number()]) }), {
15985
16068
  kind: "mutation",
15986
16069
  auth: "admin"
15987
16070
  });
16071
+ /**
16072
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16073
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16074
+ * (operator intent, D870) and device-history (numbers over time, D850).
16075
+ *
16076
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16077
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16078
+ * that with the addon id closed over). It is deliberately NOT in any input
16079
+ * schema, so a session can never supply it, and a call with no stamp is refused
16080
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16081
+ * addons go through the owner's capability.
16082
+ *
16083
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16084
+ * never `[]`. Secret fields are never on the wire: a read shows the
16085
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16086
+ * resolves itself, and a write may carry only a keychain marker bound to the
16087
+ * row's own ref.
16088
+ *
16089
+ * Internal: addons reach it through `ctx.records`, never directly.
16090
+ */
16091
+ var RecordIdSchema = string().min(1).max(256);
16092
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16093
+ var RecordBodySchema = record(string(), unknown());
16094
+ var RecordInputSchema = object({
16095
+ id: RecordIdSchema,
16096
+ /** The device this row belongs to (D865 removal, per-device reads). */
16097
+ deviceId: number().int().optional(),
16098
+ /** The domain clock, ms: observed / created / opened. */
16099
+ at: number().int().optional(),
16100
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16101
+ expiresAt: number().int().optional(),
16102
+ data: RecordBodySchema
16103
+ });
16104
+ var RecordViewSchema = object({
16105
+ id: string(),
16106
+ deviceId: number().int().nullable(),
16107
+ at: number().nullable(),
16108
+ expiresAt: number().nullable(),
16109
+ rev: number().int(),
16110
+ updatedAt: number(),
16111
+ data: RecordBodySchema
16112
+ });
16113
+ /** Declared index fields only. Anything else does not compile, by design. */
16114
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16115
+ string(),
16116
+ number(),
16117
+ boolean(),
16118
+ object({ in: array(union([
16119
+ string(),
16120
+ number(),
16121
+ boolean()
16122
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16123
+ object({
16124
+ gt: union([string(), number()]).optional(),
16125
+ gte: union([string(), number()]).optional(),
16126
+ lt: union([string(), number()]).optional(),
16127
+ lte: union([string(), number()]).optional()
16128
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16129
+ ]));
16130
+ var KindShape = { kind: RecordKindNameSchema };
16131
+ var TimeWindowShape = {
16132
+ deviceId: number().int().optional(),
16133
+ atFrom: number().optional(),
16134
+ atTo: number().optional()
16135
+ };
16136
+ var RecordQueryInputSchema = object({
16137
+ ...KindShape,
16138
+ ...TimeWindowShape,
16139
+ where: RecordWhereSchema.optional(),
16140
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16141
+ order: _enum(["at", "id"]).optional(),
16142
+ desc: boolean().optional(),
16143
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16144
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16145
+ cursor: string().min(1).optional()
16146
+ });
16147
+ var RecordQueryResultSchema = object({
16148
+ records: array(RecordViewSchema),
16149
+ nextCursor: string().nullable()
16150
+ });
16151
+ var RecordKindStateSchema = _enum([
16152
+ "created",
16153
+ "unchanged",
16154
+ "updated"
16155
+ ]);
16156
+ var DeclareKindResultSchema = object({
16157
+ kindId: number().int(),
16158
+ state: RecordKindStateSchema,
16159
+ createdIndexes: array(string()),
16160
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16161
+ adoptionPending: object({
16162
+ legacyTable: string(),
16163
+ legacyRows: number().int()
16164
+ }).nullable()
16165
+ });
16166
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16167
+ var SecretRefsList = array(string());
16168
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16169
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16170
+ kind: "mutation",
16171
+ auth: "admin"
16172
+ }), method(object({
16173
+ ...KindShape,
16174
+ id: RecordIdSchema
16175
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16176
+ ...KindShape,
16177
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16178
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16179
+ ...KindShape,
16180
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16181
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16182
+ ...KindShape,
16183
+ record: RecordInputSchema,
16184
+ /** Compare-and-set. `0` means "the row must not exist". */
16185
+ ifRev: number().int().min(0).optional()
16186
+ }), object({
16187
+ rev: number().int(),
16188
+ releasedRefs: SecretRefsList
16189
+ }), {
16190
+ kind: "mutation",
16191
+ auth: "admin"
16192
+ }), method(object({
16193
+ ...KindShape,
16194
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16195
+ }), object({
16196
+ count: number().int(),
16197
+ releasedRefs: SecretRefsList
16198
+ }), {
16199
+ kind: "mutation",
16200
+ auth: "admin"
16201
+ }), method(object({
16202
+ ...KindShape,
16203
+ id: RecordIdSchema,
16204
+ data: RecordBodySchema,
16205
+ at: number().int().nullable().optional(),
16206
+ expiresAt: number().int().nullable().optional(),
16207
+ ifRev: number().int().min(1).optional()
16208
+ }), object({
16209
+ rev: number().int(),
16210
+ releasedRefs: SecretRefsList
16211
+ }), {
16212
+ kind: "mutation",
16213
+ auth: "admin"
16214
+ }), method(object({
16215
+ ...KindShape,
16216
+ id: RecordIdSchema
16217
+ }), object({
16218
+ deleted: boolean(),
16219
+ secretRefs: SecretRefsList
16220
+ }), {
16221
+ kind: "mutation",
16222
+ auth: "admin"
16223
+ }), method(object({
16224
+ ...KindShape,
16225
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16226
+ }), object({
16227
+ deleted: number().int(),
16228
+ secretRefs: SecretRefsList
16229
+ }), {
16230
+ kind: "mutation",
16231
+ auth: "admin"
16232
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16233
+ ...KindShape,
16234
+ ...TimeWindowShape,
16235
+ where: RecordWhereSchema.optional()
16236
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16237
+ ...KindShape,
16238
+ deviceId: number().int().optional(),
16239
+ from: number(),
16240
+ to: number(),
16241
+ bucketMs: number().int().positive()
16242
+ }), object({ buckets: array(object({
16243
+ bucketStart: number(),
16244
+ count: number().int()
16245
+ })) }), { auth: "admin" }), method(object({
16246
+ ...KindShape,
16247
+ op: _enum([
16248
+ "sum",
16249
+ "min",
16250
+ "max",
16251
+ "count"
16252
+ ]),
16253
+ field: RecordFieldPathSchema.optional(),
16254
+ groupBy: RecordFieldPathSchema.optional(),
16255
+ where: RecordWhereSchema.optional()
16256
+ }), object({ rows: array(object({
16257
+ group: union([
16258
+ string(),
16259
+ number(),
16260
+ _null()
16261
+ ]),
16262
+ value: number().nullable()
16263
+ })) }), { auth: "admin" }), method(object({
16264
+ ...KindShape,
16265
+ deviceId: number().int().optional(),
16266
+ atBefore: number().optional(),
16267
+ where: RecordWhereSchema.optional()
16268
+ }), object({
16269
+ deleted: number().int(),
16270
+ secretRefs: SecretRefsList
16271
+ }), {
16272
+ kind: "mutation",
16273
+ auth: "admin"
16274
+ }), method(object({
16275
+ deviceId: number().int(),
16276
+ kinds: array(RecordKindNameSchema).optional()
16277
+ }), object({
16278
+ deleted: record(string(), number().int()),
16279
+ secretRefs: SecretRefsList
16280
+ }), {
16281
+ kind: "mutation",
16282
+ auth: "admin"
16283
+ }), method(object(KindShape), object({ id: number().int() }), {
16284
+ kind: "mutation",
16285
+ auth: "admin"
16286
+ });
15988
16287
  /** One table of the settings database. */
15989
16288
  var StorageTableSchema = object({
15990
16289
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -15997,6 +16296,28 @@ var StorageTableSchema = object({
15997
16296
  /** Declared by an addon since this engine process started (a running addon claims it). */
15998
16297
  declaredThisBoot: boolean()
15999
16298
  });
16299
+ /** One declared record kind (D881) as System -> Data shows it. */
16300
+ var StorageKindSchema = object({
16301
+ owner: string(),
16302
+ kind: string(),
16303
+ database: _enum(["settings", "events"]),
16304
+ class: string(),
16305
+ state: _enum([
16306
+ "declared",
16307
+ "orphaned",
16308
+ "dropped"
16309
+ ]),
16310
+ /** `null` when the caller asked for no counts (`counts: false`). */
16311
+ rows: number().int().nonnegative().nullable(),
16312
+ /** Rows x the average size of a sample; null for an empty kind. */
16313
+ bytesEstimate: number().int().nonnegative().nullable(),
16314
+ writeTrigger: string(),
16315
+ retention: RecordRetentionSchema,
16316
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16317
+ entry: boolean(),
16318
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16319
+ declaration: RecordKindDeclarationSchema
16320
+ });
16000
16321
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16001
16322
  collection: string().min(1),
16002
16323
  expectRows: number().int().nonnegative()
@@ -16006,6 +16327,77 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
16006
16327
  }), {
16007
16328
  kind: "mutation",
16008
16329
  auth: "admin"
16330
+ }), method(object({
16331
+ owner: string().min(1).optional(),
16332
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16333
+ counts: boolean().optional()
16334
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16335
+ owner: string().min(1),
16336
+ kind: RecordKindNameSchema
16337
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16338
+ owner: string().min(1),
16339
+ kind: RecordKindNameSchema,
16340
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX),
16341
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16342
+ complete: boolean().optional()
16343
+ }), object({ adopted: number().int() }), {
16344
+ kind: "mutation",
16345
+ auth: "admin"
16346
+ });
16347
+ /**
16348
+ * record-entries - the ONE admin surface for every list of user-created entries
16349
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16350
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16351
+ *
16352
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16353
+ * the entry body with `secret: true` on every credential field, so a password
16354
+ * field is derived from the schema and never from a name. `putEntry` takes the
16355
+ * redaction token for an untouched secret (the stored value is kept), a string
16356
+ * for a new one, and the clear instruction to remove one. A read never carries
16357
+ * a secret value, and a locked keychain refuses the write with
16358
+ * `records/secret-unavailable` instead of storing plaintext.
16359
+ *
16360
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16361
+ */
16362
+ var EntryKindInfoSchema = object({
16363
+ owner: string(),
16364
+ kind: RecordKindNameSchema,
16365
+ title: string(),
16366
+ nameField: string(),
16367
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16368
+ fields: record(string(), unknown()),
16369
+ secretPaths: array(string()),
16370
+ rows: number().int().nonnegative()
16371
+ });
16372
+ var EntryViewSchema = object({
16373
+ id: RecordIdSchema,
16374
+ name: string(),
16375
+ rev: number().int(),
16376
+ updatedAt: number(),
16377
+ /** Secret fields hold the redaction token. */
16378
+ data: RecordBodySchema
16379
+ });
16380
+ var EntryAddress = {
16381
+ owner: string().min(1),
16382
+ kind: RecordKindNameSchema
16383
+ };
16384
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16385
+ ...EntryAddress,
16386
+ id: RecordIdSchema.optional(),
16387
+ data: RecordBodySchema,
16388
+ ifRev: number().int().min(1).optional()
16389
+ }), object({
16390
+ id: string(),
16391
+ rev: number().int()
16392
+ }), {
16393
+ kind: "mutation",
16394
+ auth: "admin"
16395
+ }), method(object({
16396
+ ...EntryAddress,
16397
+ id: RecordIdSchema
16398
+ }), object({ deleted: boolean() }), {
16399
+ kind: "mutation",
16400
+ auth: "admin"
16009
16401
  });
16010
16402
  /**
16011
16403
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -68050,6 +68442,30 @@ Object.freeze({
68050
68442
  addonId: null,
68051
68443
  access: "create"
68052
68444
  },
68445
+ "recordEntries.deleteEntry": {
68446
+ capName: "record-entries",
68447
+ capScope: "system",
68448
+ addonId: null,
68449
+ access: "delete"
68450
+ },
68451
+ "recordEntries.listEntries": {
68452
+ capName: "record-entries",
68453
+ capScope: "system",
68454
+ addonId: null,
68455
+ access: "view"
68456
+ },
68457
+ "recordEntries.listEntryKinds": {
68458
+ capName: "record-entries",
68459
+ capScope: "system",
68460
+ addonId: null,
68461
+ access: "view"
68462
+ },
68463
+ "recordEntries.putEntry": {
68464
+ capName: "record-entries",
68465
+ capScope: "system",
68466
+ addonId: null,
68467
+ access: "create"
68468
+ },
68053
68469
  "recording.getAvailability": {
68054
68470
  capName: "recording",
68055
68471
  capScope: "device",
@@ -68350,6 +68766,102 @@ Object.freeze({
68350
68766
  addonId: null,
68351
68767
  access: "view"
68352
68768
  },
68769
+ "records.aggregate": {
68770
+ capName: "records",
68771
+ capScope: "system",
68772
+ addonId: null,
68773
+ access: "view"
68774
+ },
68775
+ "records.allocateId": {
68776
+ capName: "records",
68777
+ capScope: "system",
68778
+ addonId: null,
68779
+ access: "create"
68780
+ },
68781
+ "records.count": {
68782
+ capName: "records",
68783
+ capScope: "system",
68784
+ addonId: null,
68785
+ access: "view"
68786
+ },
68787
+ "records.declareKinds": {
68788
+ capName: "records",
68789
+ capScope: "system",
68790
+ addonId: null,
68791
+ access: "create"
68792
+ },
68793
+ "records.delete": {
68794
+ capName: "records",
68795
+ capScope: "system",
68796
+ addonId: null,
68797
+ access: "delete"
68798
+ },
68799
+ "records.deleteDevice": {
68800
+ capName: "records",
68801
+ capScope: "system",
68802
+ addonId: null,
68803
+ access: "delete"
68804
+ },
68805
+ "records.deleteMany": {
68806
+ capName: "records",
68807
+ capScope: "system",
68808
+ addonId: null,
68809
+ access: "delete"
68810
+ },
68811
+ "records.deleteWhere": {
68812
+ capName: "records",
68813
+ capScope: "system",
68814
+ addonId: null,
68815
+ access: "delete"
68816
+ },
68817
+ "records.get": {
68818
+ capName: "records",
68819
+ capScope: "system",
68820
+ addonId: null,
68821
+ access: "view"
68822
+ },
68823
+ "records.getMany": {
68824
+ capName: "records",
68825
+ capScope: "system",
68826
+ addonId: null,
68827
+ access: "view"
68828
+ },
68829
+ "records.histogram": {
68830
+ capName: "records",
68831
+ capScope: "system",
68832
+ addonId: null,
68833
+ access: "view"
68834
+ },
68835
+ "records.patch": {
68836
+ capName: "records",
68837
+ capScope: "system",
68838
+ addonId: null,
68839
+ access: "create"
68840
+ },
68841
+ "records.put": {
68842
+ capName: "records",
68843
+ capScope: "system",
68844
+ addonId: null,
68845
+ access: "create"
68846
+ },
68847
+ "records.putMany": {
68848
+ capName: "records",
68849
+ capScope: "system",
68850
+ addonId: null,
68851
+ access: "create"
68852
+ },
68853
+ "records.query": {
68854
+ capName: "records",
68855
+ capScope: "system",
68856
+ addonId: null,
68857
+ access: "view"
68858
+ },
68859
+ "records.secretRefs": {
68860
+ capName: "records",
68861
+ capScope: "system",
68862
+ addonId: null,
68863
+ access: "view"
68864
+ },
68353
68865
  "sceneMonitor.captureReference": {
68354
68866
  capName: "scene-monitor",
68355
68867
  capScope: "device",
@@ -68782,18 +69294,36 @@ Object.freeze({
68782
69294
  addonId: null,
68783
69295
  access: "create"
68784
69296
  },
69297
+ "storageAdmin.adoptRecords": {
69298
+ capName: "storage-admin",
69299
+ capScope: "system",
69300
+ addonId: null,
69301
+ access: "create"
69302
+ },
68785
69303
  "storageAdmin.dropCollection": {
68786
69304
  capName: "storage-admin",
68787
69305
  capScope: "system",
68788
69306
  addonId: null,
68789
69307
  access: "delete"
68790
69308
  },
69309
+ "storageAdmin.listKinds": {
69310
+ capName: "storage-admin",
69311
+ capScope: "system",
69312
+ addonId: null,
69313
+ access: "view"
69314
+ },
68791
69315
  "storageAdmin.listTables": {
68792
69316
  capName: "storage-admin",
68793
69317
  capScope: "system",
68794
69318
  addonId: null,
68795
69319
  access: "view"
68796
69320
  },
69321
+ "storageAdmin.readRecords": {
69322
+ capName: "storage-admin",
69323
+ capScope: "system",
69324
+ addonId: null,
69325
+ access: "view"
69326
+ },
68797
69327
  "storageEvictable.evict": {
68798
69328
  capName: "storage-evictable",
68799
69329
  capScope: "system",
@@ -72388,6 +72918,37 @@ Object.freeze({
72388
72918
  form: "single",
72389
72919
  optional: false
72390
72920
  }],
72921
+ "records.count": [{
72922
+ name: "deviceId",
72923
+ form: "single",
72924
+ optional: true
72925
+ }],
72926
+ "records.deleteDevice": [{
72927
+ name: "deviceId",
72928
+ form: "single",
72929
+ optional: false
72930
+ }],
72931
+ "records.deleteWhere": [{
72932
+ name: "deviceId",
72933
+ form: "single",
72934
+ optional: true
72935
+ }],
72936
+ "records.histogram": [{
72937
+ name: "deviceId",
72938
+ form: "single",
72939
+ optional: true
72940
+ }],
72941
+ "records.putMany": [{
72942
+ name: "records",
72943
+ form: "object-array",
72944
+ optional: false,
72945
+ itemField: "deviceId"
72946
+ }],
72947
+ "records.query": [{
72948
+ name: "deviceId",
72949
+ form: "single",
72950
+ optional: true
72951
+ }],
72391
72952
  "sceneMonitor.captureReference": [{
72392
72953
  name: "deviceId",
72393
72954
  form: "single",
@@ -72504,6 +73065,17 @@ Object.freeze({
72504
73065
  form: "single",
72505
73066
  optional: false
72506
73067
  }],
73068
+ "storageAdmin.adoptRecords": [{
73069
+ name: "records",
73070
+ form: "object-array",
73071
+ optional: false,
73072
+ itemField: "deviceId"
73073
+ }],
73074
+ "storageAdmin.readRecords": [{
73075
+ name: "deviceId",
73076
+ form: "single",
73077
+ optional: true
73078
+ }],
72507
73079
  "streamBroker.acquireEgressTranscode": [{
72508
73080
  name: "deviceId",
72509
73081
  form: "single",
@@ -74929,7 +75501,9 @@ Object.freeze({
74929
75501
  },
74930
75502
  "setDeviceConfig": { "config": { "__nested__": { "bands": [] } } }
74931
75503
  },
75504
+ "records": { "query": { "limit": 100 } },
74932
75505
  "storage": { "upsertLocation": { "isSystem": false } },
75506
+ "storage-admin": { "readRecords": { "limit": 100 } },
74933
75507
  "storage-provider": {
74934
75508
  "beginDownload": { "location": { "__nested__": { "isSystem": false } } },
74935
75509
  "beginUpload": { "location": { "__nested__": { "isSystem": false } } },