@camstack/addon-osd-manager 0.1.242 → 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-BvLGv1T6.mjs → MotionZonesSettings-Dx0QePDr.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BP1o-8R3.mjs → PrivacyMaskSettings-Dpvj9Htf.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-DdOZGeyN.mjs → SceneMonitorEditor-CInL6GVs.mjs} +3 -3
  4. package/dist/_stub.js +203 -152
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-X3Ix1Fi3.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-CCC6cRfD.mjs → hostInit-BZGn1YFH.mjs} +2 -2
  8. package/dist/index.js +635 -47
  9. package/dist/index.mjs +635 -47
  10. package/dist/{player-overlays-wuFmgQhe.mjs → player-overlays-Ces1nEGQ.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-CBm_gJiZ.mjs → responsive-xOj-SfJF.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-Ds8DsHQ7.mjs → scene-monitor-copy-BZMgBFaF.mjs} +1 -1
  14. package/dist/{square-B_a9tj8L.mjs → square-CAeV_Co2.mjs} +1 -1
  15. package/dist/{trash-2-ZC2TxXnK.mjs → trash-2-LqYIxrzA.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-ChxZqQtq.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-C23HfCvI.mjs +0 -26
package/dist/index.js CHANGED
@@ -5408,7 +5408,7 @@ var ZodIssueCode = {
5408
5408
  var ZodFirstPartyTypeKind;
5409
5409
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5410
5410
  //#endregion
5411
- //#region ../types/dist/sleep-bgZLodYc.mjs
5411
+ //#region ../types/dist/sleep-WsrozGDL.mjs
5412
5412
  /**
5413
5413
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5414
5414
  * window to float samples (D455).
@@ -5525,7 +5525,7 @@ function isKeychainStoredField(field) {
5525
5525
  var SECRET_CLEAR = { $secretClear: true };
5526
5526
  /** The `'***'` token D634 redaction writes for non-admins. */
5527
5527
  var LEGACY_DEVICE_REDACTION = "***";
5528
- function isRecord$2(value) {
5528
+ function isRecord$4(value) {
5529
5529
  return typeof value === "object" && value !== null && !Array.isArray(value);
5530
5530
  }
5531
5531
  function makeSecretMarker(ref) {
@@ -5536,12 +5536,12 @@ function makeSecretMarker(ref) {
5536
5536
  }
5537
5537
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5538
5538
  function isSecretMarker(value) {
5539
- if (!isRecord$2(value)) return false;
5539
+ if (!isRecord$4(value)) return false;
5540
5540
  const ref = value["$secret"];
5541
5541
  return typeof ref === "string" && ref.length > 0;
5542
5542
  }
5543
5543
  function isSecretClear(value) {
5544
- return isRecord$2(value) && value["$secretClear"] === true;
5544
+ return isRecord$4(value) && value["$secretClear"] === true;
5545
5545
  }
5546
5546
  /**
5547
5547
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6151,7 +6151,7 @@ var KeychainWriteRefusedError = class extends Error {
6151
6151
  }
6152
6152
  };
6153
6153
  var KEEP = { kind: "keep" };
6154
- function isRecord$1(value) {
6154
+ function isRecord$3(value) {
6155
6155
  return typeof value === "object" && value !== null && !Array.isArray(value);
6156
6156
  }
6157
6157
  function defaultMintId() {
@@ -6164,7 +6164,7 @@ function collectSecretMarkerRefs(value, out = []) {
6164
6164
  return out;
6165
6165
  }
6166
6166
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6167
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6167
+ else if (isRecord$3(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6168
6168
  return out;
6169
6169
  }
6170
6170
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6219,7 +6219,7 @@ function rowId(row, idKey) {
6219
6219
  return null;
6220
6220
  }
6221
6221
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6222
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6222
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$3) : [];
6223
6223
  if (!Array.isArray(incoming)) {
6224
6224
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6225
6225
  return {
@@ -6235,7 +6235,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6235
6235
  const kept = /* @__PURE__ */ new Set();
6236
6236
  const rows = [];
6237
6237
  for (const row of incoming) {
6238
- if (!isRecord$1(row)) {
6238
+ if (!isRecord$3(row)) {
6239
6239
  rows.push(row);
6240
6240
  continue;
6241
6241
  }
@@ -6260,7 +6260,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6260
6260
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6261
6261
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6262
6262
  case "object": {
6263
- if (!isRecord$1(incoming)) {
6263
+ if (!isRecord$3(incoming)) {
6264
6264
  if (incoming === void 0) return KEEP;
6265
6265
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6266
6266
  return {
@@ -6268,7 +6268,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6268
6268
  value: incoming
6269
6269
  };
6270
6270
  }
6271
- const storedObj = isRecord$1(stored) ? stored : {};
6271
+ const storedObj = isRecord$3(stored) ? stored : {};
6272
6272
  return {
6273
6273
  kind: "value",
6274
6274
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6391,7 +6391,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6391
6391
  value: items
6392
6392
  };
6393
6393
  }
6394
- if (isRecord$1(v)) {
6394
+ if (isRecord$3(v)) {
6395
6395
  const out = {};
6396
6396
  for (const [k, child] of Object.entries(v)) {
6397
6397
  const s = substitute(child);
@@ -6423,7 +6423,7 @@ var SecretOverwriteRefusedError = class extends Error {
6423
6423
  this.name = "SecretOverwriteRefusedError";
6424
6424
  }
6425
6425
  };
6426
- function isRecord(value) {
6426
+ function isRecord$2(value) {
6427
6427
  return typeof value === "object" && value !== null && !Array.isArray(value);
6428
6428
  }
6429
6429
  function resolvedValue(pass, marker) {
@@ -6452,7 +6452,7 @@ function inArray(pass, incoming, stored) {
6452
6452
  return incoming.map((item, index) => {
6453
6453
  const twin = stored[index];
6454
6454
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6455
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6455
+ if (isRecord$2(item) && isRecord$2(twin)) return inArrayRow(pass, item, twin);
6456
6456
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6457
6457
  return item;
6458
6458
  });
@@ -6463,7 +6463,7 @@ function inArrayRow(pass, incoming, stored) {
6463
6463
  const twin = stored[key];
6464
6464
  if (isSecretMarker(twin)) {
6465
6465
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6466
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6466
+ } else if (isRecord$2(value) && isRecord$2(twin)) out[key] = inArrayRow(pass, value, twin);
6467
6467
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6468
6468
  }
6469
6469
  return out;
@@ -6471,7 +6471,7 @@ function inArrayRow(pass, incoming, stored) {
6471
6471
  async function walk$1(pass, incoming, stored) {
6472
6472
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6473
6473
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6474
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6474
+ if (!isRecord$2(incoming) || !isRecord$2(stored)) return incoming;
6475
6475
  const out = { ...incoming };
6476
6476
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk$1(pass, value, stored[key]);
6477
6477
  return out;
@@ -6502,7 +6502,7 @@ async function restoreUnchangedSecrets(input) {
6502
6502
  function isJsonEqual(a, b) {
6503
6503
  if (Object.is(a, b)) return true;
6504
6504
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6505
- if (isRecord(a) && isRecord(b)) {
6505
+ if (isRecord$2(a) && isRecord$2(b)) {
6506
6506
  const keys = Object.keys(a);
6507
6507
  if (keys.length !== Object.keys(b).length) return false;
6508
6508
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6526,7 +6526,7 @@ function markerKeysOf(blob, owner) {
6526
6526
  }
6527
6527
  function nodeFromStored(value, owner) {
6528
6528
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6529
- if (!isRecord(value)) return null;
6529
+ if (!isRecord$2(value)) return null;
6530
6530
  const children = /* @__PURE__ */ new Map();
6531
6531
  for (const [key, child] of Object.entries(value)) {
6532
6532
  const node = nodeFromStored(child, owner);
@@ -7808,6 +7808,89 @@ var PeerBytesTicketSchema = object({
7808
7808
  */
7809
7809
  declaredBytes: number().int().nonnegative().nullable()
7810
7810
  });
7811
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7812
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7813
+ var RECORD_DATABASES = ["settings", "events"];
7814
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7815
+ var RECORD_CLASSES = [
7816
+ "config",
7817
+ "ledger",
7818
+ "audit",
7819
+ "mirror",
7820
+ "ephemeral"
7821
+ ];
7822
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7823
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7824
+ var RECORD_BATCH_MAX = 1e3;
7825
+ var RECORD_QUERY_MAX = 1e3;
7826
+ /**
7827
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7828
+ * Zod row schema that describes it, and the helper that turns the two into the
7829
+ * JSON the engine stores.
7830
+ *
7831
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7832
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7833
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7834
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7835
+ * never a field name (D879).
7836
+ */
7837
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7838
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7839
+ var RecordIndexSchema = object({
7840
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7841
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7842
+ unique: boolean().optional()
7843
+ }).strict();
7844
+ var RecordRetentionSchema = union([
7845
+ object({
7846
+ ttlMs: number().int().positive(),
7847
+ from: _enum(["at", "write"])
7848
+ }).strict(),
7849
+ object({
7850
+ maxRows: number().int().positive().optional(),
7851
+ maxRowsPerDevice: number().int().positive().optional()
7852
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7853
+ object({
7854
+ owner: string().min(1),
7855
+ reason: string().min(1)
7856
+ }).strict(),
7857
+ object({ none: string().min(1) }).strict()
7858
+ ]);
7859
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7860
+ var EntryDescriptorSchema = object({
7861
+ title: string().min(1),
7862
+ /** The record body field shown as the entry's name. */
7863
+ nameField: string().min(1),
7864
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7865
+ fields: record(string(), unknown())
7866
+ }).strict();
7867
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7868
+ var RecordKindDeclarationSchema = object({
7869
+ database: _enum(RECORD_DATABASES).default("settings"),
7870
+ class: _enum(RECORD_CLASSES),
7871
+ writeTrigger: string().min(1),
7872
+ device: _enum([
7873
+ "required",
7874
+ "optional",
7875
+ "none"
7876
+ ]).default("none"),
7877
+ at: _enum(["required", "none"]).default("none"),
7878
+ indexes: array(RecordIndexSchema).max(8).default([]),
7879
+ retention: RecordRetentionSchema,
7880
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7881
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7882
+ /** Derived from the Zod schema; never written by hand. */
7883
+ secretPaths: array(string().min(1)).default([]),
7884
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7885
+ secretArrayKeys: record(string(), string()).default({}),
7886
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7887
+ adoptsFrom: string().min(1).optional(),
7888
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7889
+ transactFamily: string().min(1).optional(),
7890
+ entry: EntryDescriptorSchema.optional()
7891
+ }).strict();
7892
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7893
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7811
7894
  /** Shared Zod schemas used across streaming capabilities. */
7812
7895
  var CamProfileSchema = _enum([
7813
7896
  "high",
@@ -15463,6 +15546,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15463
15546
  keyField: string()
15464
15547
  }).optional()
15465
15548
  })) });
15549
+ /**
15550
+ * The report of a one-shot "move this owner's plaintext secrets into the
15551
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15552
+ *
15553
+ * The owner runs it on its own rows, through its own write path; an operator
15554
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15555
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15556
+ */
15557
+ var RawSecretMigrationInputSchema = object({
15558
+ /** `false` (the default of the script) = report only. */
15559
+ apply: boolean() });
15560
+ var RawSecretMigrationReportSchema = object({
15561
+ apply: boolean(),
15562
+ /** Rows that can carry a secret (a profile, an enrolment). */
15563
+ rows: number().int(),
15564
+ /** Rows whose secret was plaintext when the run started. */
15565
+ raw: number().int(),
15566
+ /** Rows that already held a keychain marker when the run started. */
15567
+ markers: number().int(),
15568
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15569
+ migrated: number().int(),
15570
+ /** Plaintext rows left in place because the move or its read-back failed. */
15571
+ failed: number().int(),
15572
+ /** After the run: rows still holding plaintext. */
15573
+ remainingRaw: number().int(),
15574
+ /** After the run: markers the keychain could not resolve right now. */
15575
+ unresolvedMarkers: number().int(),
15576
+ /**
15577
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15578
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15579
+ */
15580
+ redundantCopies: number().int().optional(),
15581
+ /** True when nothing is raw and every marker resolves. */
15582
+ verified: boolean()
15583
+ });
15466
15584
  /** Where a block runs. The operator chooses — a block driving a device on an
15467
15585
  * agent is the reason placement is not fixed to the hub. */
15468
15586
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15689,6 +15807,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15689
15807
  }), SettingsUpdateResultSchema, {
15690
15808
  kind: "mutation",
15691
15809
  auth: "admin"
15810
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
15811
+ kind: "mutation",
15812
+ auth: "admin"
15692
15813
  }), method(object({}), object({ libs: array(object({
15693
15814
  filePath: string(),
15694
15815
  content: string()
@@ -15951,6 +16072,222 @@ id: union([string(), number()]) }), {
15951
16072
  kind: "mutation",
15952
16073
  auth: "admin"
15953
16074
  });
16075
+ /**
16076
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16077
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16078
+ * (operator intent, D870) and device-history (numbers over time, D850).
16079
+ *
16080
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16081
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16082
+ * that with the addon id closed over). It is deliberately NOT in any input
16083
+ * schema, so a session can never supply it, and a call with no stamp is refused
16084
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16085
+ * addons go through the owner's capability.
16086
+ *
16087
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16088
+ * never `[]`. Secret fields are never on the wire: a read shows the
16089
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16090
+ * resolves itself, and a write may carry only a keychain marker bound to the
16091
+ * row's own ref.
16092
+ *
16093
+ * Internal: addons reach it through `ctx.records`, never directly.
16094
+ */
16095
+ var RecordIdSchema = string().min(1).max(256);
16096
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16097
+ var RecordBodySchema = record(string(), unknown());
16098
+ var RecordInputSchema = object({
16099
+ id: RecordIdSchema,
16100
+ /** The device this row belongs to (D865 removal, per-device reads). */
16101
+ deviceId: number().int().optional(),
16102
+ /** The domain clock, ms: observed / created / opened. */
16103
+ at: number().int().optional(),
16104
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16105
+ expiresAt: number().int().optional(),
16106
+ data: RecordBodySchema
16107
+ });
16108
+ var RecordViewSchema = object({
16109
+ id: string(),
16110
+ deviceId: number().int().nullable(),
16111
+ at: number().nullable(),
16112
+ expiresAt: number().nullable(),
16113
+ rev: number().int(),
16114
+ updatedAt: number(),
16115
+ data: RecordBodySchema
16116
+ });
16117
+ /** Declared index fields only. Anything else does not compile, by design. */
16118
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16119
+ string(),
16120
+ number(),
16121
+ boolean(),
16122
+ object({ in: array(union([
16123
+ string(),
16124
+ number(),
16125
+ boolean()
16126
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16127
+ object({
16128
+ gt: union([string(), number()]).optional(),
16129
+ gte: union([string(), number()]).optional(),
16130
+ lt: union([string(), number()]).optional(),
16131
+ lte: union([string(), number()]).optional()
16132
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16133
+ ]));
16134
+ var KindShape = { kind: RecordKindNameSchema };
16135
+ var TimeWindowShape = {
16136
+ deviceId: number().int().optional(),
16137
+ atFrom: number().optional(),
16138
+ atTo: number().optional()
16139
+ };
16140
+ var RecordQueryInputSchema = object({
16141
+ ...KindShape,
16142
+ ...TimeWindowShape,
16143
+ where: RecordWhereSchema.optional(),
16144
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16145
+ order: _enum(["at", "id"]).optional(),
16146
+ desc: boolean().optional(),
16147
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16148
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16149
+ cursor: string().min(1).optional()
16150
+ });
16151
+ var RecordQueryResultSchema = object({
16152
+ records: array(RecordViewSchema),
16153
+ nextCursor: string().nullable()
16154
+ });
16155
+ var RecordKindStateSchema = _enum([
16156
+ "created",
16157
+ "unchanged",
16158
+ "updated"
16159
+ ]);
16160
+ var DeclareKindResultSchema = object({
16161
+ kindId: number().int(),
16162
+ state: RecordKindStateSchema,
16163
+ createdIndexes: array(string()),
16164
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16165
+ adoptionPending: object({
16166
+ legacyTable: string(),
16167
+ legacyRows: number().int()
16168
+ }).nullable()
16169
+ });
16170
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16171
+ var SecretRefsList = array(string());
16172
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16173
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16174
+ kind: "mutation",
16175
+ auth: "admin"
16176
+ }), method(object({
16177
+ ...KindShape,
16178
+ id: RecordIdSchema
16179
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16180
+ ...KindShape,
16181
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16182
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16183
+ ...KindShape,
16184
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16185
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16186
+ ...KindShape,
16187
+ record: RecordInputSchema,
16188
+ /** Compare-and-set. `0` means "the row must not exist". */
16189
+ ifRev: number().int().min(0).optional()
16190
+ }), object({
16191
+ rev: number().int(),
16192
+ releasedRefs: SecretRefsList
16193
+ }), {
16194
+ kind: "mutation",
16195
+ auth: "admin"
16196
+ }), method(object({
16197
+ ...KindShape,
16198
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16199
+ }), object({
16200
+ count: number().int(),
16201
+ releasedRefs: SecretRefsList
16202
+ }), {
16203
+ kind: "mutation",
16204
+ auth: "admin"
16205
+ }), method(object({
16206
+ ...KindShape,
16207
+ id: RecordIdSchema,
16208
+ data: RecordBodySchema,
16209
+ at: number().int().nullable().optional(),
16210
+ expiresAt: number().int().nullable().optional(),
16211
+ ifRev: number().int().min(1).optional()
16212
+ }), object({
16213
+ rev: number().int(),
16214
+ releasedRefs: SecretRefsList
16215
+ }), {
16216
+ kind: "mutation",
16217
+ auth: "admin"
16218
+ }), method(object({
16219
+ ...KindShape,
16220
+ id: RecordIdSchema
16221
+ }), object({
16222
+ deleted: boolean(),
16223
+ secretRefs: SecretRefsList
16224
+ }), {
16225
+ kind: "mutation",
16226
+ auth: "admin"
16227
+ }), method(object({
16228
+ ...KindShape,
16229
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16230
+ }), object({
16231
+ deleted: number().int(),
16232
+ secretRefs: SecretRefsList
16233
+ }), {
16234
+ kind: "mutation",
16235
+ auth: "admin"
16236
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16237
+ ...KindShape,
16238
+ ...TimeWindowShape,
16239
+ where: RecordWhereSchema.optional()
16240
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16241
+ ...KindShape,
16242
+ deviceId: number().int().optional(),
16243
+ from: number(),
16244
+ to: number(),
16245
+ bucketMs: number().int().positive()
16246
+ }), object({ buckets: array(object({
16247
+ bucketStart: number(),
16248
+ count: number().int()
16249
+ })) }), { auth: "admin" }), method(object({
16250
+ ...KindShape,
16251
+ op: _enum([
16252
+ "sum",
16253
+ "min",
16254
+ "max",
16255
+ "count"
16256
+ ]),
16257
+ field: RecordFieldPathSchema.optional(),
16258
+ groupBy: RecordFieldPathSchema.optional(),
16259
+ where: RecordWhereSchema.optional()
16260
+ }), object({ rows: array(object({
16261
+ group: union([
16262
+ string(),
16263
+ number(),
16264
+ _null()
16265
+ ]),
16266
+ value: number().nullable()
16267
+ })) }), { auth: "admin" }), method(object({
16268
+ ...KindShape,
16269
+ deviceId: number().int().optional(),
16270
+ atBefore: number().optional(),
16271
+ where: RecordWhereSchema.optional()
16272
+ }), object({
16273
+ deleted: number().int(),
16274
+ secretRefs: SecretRefsList
16275
+ }), {
16276
+ kind: "mutation",
16277
+ auth: "admin"
16278
+ }), method(object({
16279
+ deviceId: number().int(),
16280
+ kinds: array(RecordKindNameSchema).optional()
16281
+ }), object({
16282
+ deleted: record(string(), number().int()),
16283
+ secretRefs: SecretRefsList
16284
+ }), {
16285
+ kind: "mutation",
16286
+ auth: "admin"
16287
+ }), method(object(KindShape), object({ id: number().int() }), {
16288
+ kind: "mutation",
16289
+ auth: "admin"
16290
+ });
15954
16291
  /** One table of the settings database. */
15955
16292
  var StorageTableSchema = object({
15956
16293
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -15963,6 +16300,28 @@ var StorageTableSchema = object({
15963
16300
  /** Declared by an addon since this engine process started (a running addon claims it). */
15964
16301
  declaredThisBoot: boolean()
15965
16302
  });
16303
+ /** One declared record kind (D881) as System -> Data shows it. */
16304
+ var StorageKindSchema = object({
16305
+ owner: string(),
16306
+ kind: string(),
16307
+ database: _enum(["settings", "events"]),
16308
+ class: string(),
16309
+ state: _enum([
16310
+ "declared",
16311
+ "orphaned",
16312
+ "dropped"
16313
+ ]),
16314
+ /** `null` when the caller asked for no counts (`counts: false`). */
16315
+ rows: number().int().nonnegative().nullable(),
16316
+ /** Rows x the average size of a sample; null for an empty kind. */
16317
+ bytesEstimate: number().int().nonnegative().nullable(),
16318
+ writeTrigger: string(),
16319
+ retention: RecordRetentionSchema,
16320
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16321
+ entry: boolean(),
16322
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16323
+ declaration: RecordKindDeclarationSchema
16324
+ });
15966
16325
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
15967
16326
  collection: string().min(1),
15968
16327
  expectRows: number().int().nonnegative()
@@ -15972,6 +16331,77 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
15972
16331
  }), {
15973
16332
  kind: "mutation",
15974
16333
  auth: "admin"
16334
+ }), method(object({
16335
+ owner: string().min(1).optional(),
16336
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16337
+ counts: boolean().optional()
16338
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16339
+ owner: string().min(1),
16340
+ kind: RecordKindNameSchema
16341
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16342
+ owner: string().min(1),
16343
+ kind: RecordKindNameSchema,
16344
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX),
16345
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16346
+ complete: boolean().optional()
16347
+ }), object({ adopted: number().int() }), {
16348
+ kind: "mutation",
16349
+ auth: "admin"
16350
+ });
16351
+ /**
16352
+ * record-entries - the ONE admin surface for every list of user-created entries
16353
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16354
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16355
+ *
16356
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16357
+ * the entry body with `secret: true` on every credential field, so a password
16358
+ * field is derived from the schema and never from a name. `putEntry` takes the
16359
+ * redaction token for an untouched secret (the stored value is kept), a string
16360
+ * for a new one, and the clear instruction to remove one. A read never carries
16361
+ * a secret value, and a locked keychain refuses the write with
16362
+ * `records/secret-unavailable` instead of storing plaintext.
16363
+ *
16364
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16365
+ */
16366
+ var EntryKindInfoSchema = object({
16367
+ owner: string(),
16368
+ kind: RecordKindNameSchema,
16369
+ title: string(),
16370
+ nameField: string(),
16371
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16372
+ fields: record(string(), unknown()),
16373
+ secretPaths: array(string()),
16374
+ rows: number().int().nonnegative()
16375
+ });
16376
+ var EntryViewSchema = object({
16377
+ id: RecordIdSchema,
16378
+ name: string(),
16379
+ rev: number().int(),
16380
+ updatedAt: number(),
16381
+ /** Secret fields hold the redaction token. */
16382
+ data: RecordBodySchema
16383
+ });
16384
+ var EntryAddress = {
16385
+ owner: string().min(1),
16386
+ kind: RecordKindNameSchema
16387
+ };
16388
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16389
+ ...EntryAddress,
16390
+ id: RecordIdSchema.optional(),
16391
+ data: RecordBodySchema,
16392
+ ifRev: number().int().min(1).optional()
16393
+ }), object({
16394
+ id: string(),
16395
+ rev: number().int()
16396
+ }), {
16397
+ kind: "mutation",
16398
+ auth: "admin"
16399
+ }), method(object({
16400
+ ...EntryAddress,
16401
+ id: RecordIdSchema
16402
+ }), object({ deleted: boolean() }), {
16403
+ kind: "mutation",
16404
+ auth: "admin"
15975
16405
  });
15976
16406
  /**
15977
16407
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -38854,36 +39284,6 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
38854
39284
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
38855
39285
  });
38856
39286
  /**
38857
- * The report of a one-shot "move this owner's plaintext secrets into the
38858
- * keychain" run (D878). COUNTS only - never a value, never a ref.
38859
- *
38860
- * The owner runs it on its own rows, through its own write path; an operator
38861
- * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
38862
- * Dry run (`apply: false`) reports what WOULD move and changes nothing.
38863
- */
38864
- var RawSecretMigrationInputSchema = object({
38865
- /** `false` (the default of the script) = report only. */
38866
- apply: boolean() });
38867
- var RawSecretMigrationReportSchema = object({
38868
- apply: boolean(),
38869
- /** Rows that can carry a secret (a profile, an enrolment). */
38870
- rows: number().int(),
38871
- /** Rows whose secret was plaintext when the run started. */
38872
- raw: number().int(),
38873
- /** Rows that already held a keychain marker when the run started. */
38874
- markers: number().int(),
38875
- /** Plaintext rows moved by THIS run (always 0 on a dry run). */
38876
- migrated: number().int(),
38877
- /** Plaintext rows left in place because the move or its read-back failed. */
38878
- failed: number().int(),
38879
- /** After the run: rows still holding plaintext. */
38880
- remainingRaw: number().int(),
38881
- /** After the run: markers the keychain could not resolve right now. */
38882
- unresolvedMarkers: number().int(),
38883
- /** True when nothing is raw and every marker resolves. */
38884
- verified: boolean()
38885
- });
38886
- /**
38887
39287
  * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
38888
39288
  * methods concat-fan across providers; single-row methods route to ONE
38889
39289
  * provider by the `addonId` in the call input (the notification-output
@@ -63288,6 +63688,12 @@ Object.freeze({
63288
63688
  addonId: null,
63289
63689
  access: "view"
63290
63690
  },
63691
+ "coreBlocks.migrateRawSecrets": {
63692
+ capName: "core-blocks",
63693
+ capScope: "system",
63694
+ addonId: null,
63695
+ access: "create"
63696
+ },
63291
63697
  "coreBlocks.restart": {
63292
63698
  capName: "core-blocks",
63293
63699
  capScope: "system",
@@ -68040,6 +68446,30 @@ Object.freeze({
68040
68446
  addonId: null,
68041
68447
  access: "create"
68042
68448
  },
68449
+ "recordEntries.deleteEntry": {
68450
+ capName: "record-entries",
68451
+ capScope: "system",
68452
+ addonId: null,
68453
+ access: "delete"
68454
+ },
68455
+ "recordEntries.listEntries": {
68456
+ capName: "record-entries",
68457
+ capScope: "system",
68458
+ addonId: null,
68459
+ access: "view"
68460
+ },
68461
+ "recordEntries.listEntryKinds": {
68462
+ capName: "record-entries",
68463
+ capScope: "system",
68464
+ addonId: null,
68465
+ access: "view"
68466
+ },
68467
+ "recordEntries.putEntry": {
68468
+ capName: "record-entries",
68469
+ capScope: "system",
68470
+ addonId: null,
68471
+ access: "create"
68472
+ },
68043
68473
  "recording.getAvailability": {
68044
68474
  capName: "recording",
68045
68475
  capScope: "device",
@@ -68340,6 +68770,102 @@ Object.freeze({
68340
68770
  addonId: null,
68341
68771
  access: "view"
68342
68772
  },
68773
+ "records.aggregate": {
68774
+ capName: "records",
68775
+ capScope: "system",
68776
+ addonId: null,
68777
+ access: "view"
68778
+ },
68779
+ "records.allocateId": {
68780
+ capName: "records",
68781
+ capScope: "system",
68782
+ addonId: null,
68783
+ access: "create"
68784
+ },
68785
+ "records.count": {
68786
+ capName: "records",
68787
+ capScope: "system",
68788
+ addonId: null,
68789
+ access: "view"
68790
+ },
68791
+ "records.declareKinds": {
68792
+ capName: "records",
68793
+ capScope: "system",
68794
+ addonId: null,
68795
+ access: "create"
68796
+ },
68797
+ "records.delete": {
68798
+ capName: "records",
68799
+ capScope: "system",
68800
+ addonId: null,
68801
+ access: "delete"
68802
+ },
68803
+ "records.deleteDevice": {
68804
+ capName: "records",
68805
+ capScope: "system",
68806
+ addonId: null,
68807
+ access: "delete"
68808
+ },
68809
+ "records.deleteMany": {
68810
+ capName: "records",
68811
+ capScope: "system",
68812
+ addonId: null,
68813
+ access: "delete"
68814
+ },
68815
+ "records.deleteWhere": {
68816
+ capName: "records",
68817
+ capScope: "system",
68818
+ addonId: null,
68819
+ access: "delete"
68820
+ },
68821
+ "records.get": {
68822
+ capName: "records",
68823
+ capScope: "system",
68824
+ addonId: null,
68825
+ access: "view"
68826
+ },
68827
+ "records.getMany": {
68828
+ capName: "records",
68829
+ capScope: "system",
68830
+ addonId: null,
68831
+ access: "view"
68832
+ },
68833
+ "records.histogram": {
68834
+ capName: "records",
68835
+ capScope: "system",
68836
+ addonId: null,
68837
+ access: "view"
68838
+ },
68839
+ "records.patch": {
68840
+ capName: "records",
68841
+ capScope: "system",
68842
+ addonId: null,
68843
+ access: "create"
68844
+ },
68845
+ "records.put": {
68846
+ capName: "records",
68847
+ capScope: "system",
68848
+ addonId: null,
68849
+ access: "create"
68850
+ },
68851
+ "records.putMany": {
68852
+ capName: "records",
68853
+ capScope: "system",
68854
+ addonId: null,
68855
+ access: "create"
68856
+ },
68857
+ "records.query": {
68858
+ capName: "records",
68859
+ capScope: "system",
68860
+ addonId: null,
68861
+ access: "view"
68862
+ },
68863
+ "records.secretRefs": {
68864
+ capName: "records",
68865
+ capScope: "system",
68866
+ addonId: null,
68867
+ access: "view"
68868
+ },
68343
68869
  "sceneMonitor.captureReference": {
68344
68870
  capName: "scene-monitor",
68345
68871
  capScope: "device",
@@ -68772,18 +69298,36 @@ Object.freeze({
68772
69298
  addonId: null,
68773
69299
  access: "create"
68774
69300
  },
69301
+ "storageAdmin.adoptRecords": {
69302
+ capName: "storage-admin",
69303
+ capScope: "system",
69304
+ addonId: null,
69305
+ access: "create"
69306
+ },
68775
69307
  "storageAdmin.dropCollection": {
68776
69308
  capName: "storage-admin",
68777
69309
  capScope: "system",
68778
69310
  addonId: null,
68779
69311
  access: "delete"
68780
69312
  },
69313
+ "storageAdmin.listKinds": {
69314
+ capName: "storage-admin",
69315
+ capScope: "system",
69316
+ addonId: null,
69317
+ access: "view"
69318
+ },
68781
69319
  "storageAdmin.listTables": {
68782
69320
  capName: "storage-admin",
68783
69321
  capScope: "system",
68784
69322
  addonId: null,
68785
69323
  access: "view"
68786
69324
  },
69325
+ "storageAdmin.readRecords": {
69326
+ capName: "storage-admin",
69327
+ capScope: "system",
69328
+ addonId: null,
69329
+ access: "view"
69330
+ },
68787
69331
  "storageEvictable.evict": {
68788
69332
  capName: "storage-evictable",
68789
69333
  capScope: "system",
@@ -72378,6 +72922,37 @@ Object.freeze({
72378
72922
  form: "single",
72379
72923
  optional: false
72380
72924
  }],
72925
+ "records.count": [{
72926
+ name: "deviceId",
72927
+ form: "single",
72928
+ optional: true
72929
+ }],
72930
+ "records.deleteDevice": [{
72931
+ name: "deviceId",
72932
+ form: "single",
72933
+ optional: false
72934
+ }],
72935
+ "records.deleteWhere": [{
72936
+ name: "deviceId",
72937
+ form: "single",
72938
+ optional: true
72939
+ }],
72940
+ "records.histogram": [{
72941
+ name: "deviceId",
72942
+ form: "single",
72943
+ optional: true
72944
+ }],
72945
+ "records.putMany": [{
72946
+ name: "records",
72947
+ form: "object-array",
72948
+ optional: false,
72949
+ itemField: "deviceId"
72950
+ }],
72951
+ "records.query": [{
72952
+ name: "deviceId",
72953
+ form: "single",
72954
+ optional: true
72955
+ }],
72381
72956
  "sceneMonitor.captureReference": [{
72382
72957
  name: "deviceId",
72383
72958
  form: "single",
@@ -72494,6 +73069,17 @@ Object.freeze({
72494
73069
  form: "single",
72495
73070
  optional: false
72496
73071
  }],
73072
+ "storageAdmin.adoptRecords": [{
73073
+ name: "records",
73074
+ form: "object-array",
73075
+ optional: false,
73076
+ itemField: "deviceId"
73077
+ }],
73078
+ "storageAdmin.readRecords": [{
73079
+ name: "deviceId",
73080
+ form: "single",
73081
+ optional: true
73082
+ }],
72497
73083
  "streamBroker.acquireEgressTranscode": [{
72498
73084
  name: "deviceId",
72499
73085
  form: "single",
@@ -74919,7 +75505,9 @@ Object.freeze({
74919
75505
  },
74920
75506
  "setDeviceConfig": { "config": { "__nested__": { "bands": [] } } }
74921
75507
  },
75508
+ "records": { "query": { "limit": 100 } },
74922
75509
  "storage": { "upsertLocation": { "isSystem": false } },
75510
+ "storage-admin": { "readRecords": { "limit": 100 } },
74923
75511
  "storage-provider": {
74924
75512
  "beginDownload": { "location": { "__nested__": { "isSystem": false } } },
74925
75513
  "beginUpload": { "location": { "__nested__": { "isSystem": false } } },