@camstack/addon-model-studio 1.1.267 → 1.1.269

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 (19) hide show
  1. package/dist/{MotionZonesSettings-DgzasBlT.mjs → MotionZonesSettings-CQCE7D5x.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-C6V_pqH4.mjs → PrivacyMaskSettings-CqIzAvon.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-bYSdvmL5.mjs → SceneMonitorEditor-D4xyT88g.mjs} +3 -3
  4. package/dist/_stub.js +3529 -3521
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-C3hY64lf.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CRat01zd.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CnmMjNl4.mjs +26 -0
  7. package/dist/addon-model-studio.css +1 -1
  8. package/dist/{hostInit-GD6w76TD.mjs → hostInit-CWxJPCLF.mjs} +3 -3
  9. package/dist/model-studio.addon.js +606 -12
  10. package/dist/model-studio.addon.mjs +606 -12
  11. package/dist/{player-overlays-DQIaDqhZ.mjs → player-overlays-Rte6z1Nb.mjs} +1 -1
  12. package/dist/remoteEntry.js +1 -1
  13. package/dist/{responsive-atOEv1Rp.mjs → responsive-DBJKTwS9.mjs} +1 -1
  14. package/dist/{scene-monitor-copy-_tVUcOrI.mjs → scene-monitor-copy-DHzQxb9S.mjs} +1 -1
  15. package/dist/{square-CQdNilMj.mjs → square-DW4sxrDb.mjs} +1 -1
  16. package/dist/{trash-2-C8zCmZRx.mjs → trash-2-BrJVk_OD.mjs} +1 -1
  17. 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-CGhEUBpt.mjs} +1 -1
  18. package/package.json +1 -1
  19. 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-bZIhUvjd.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$5(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$5(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$5(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$4(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$4(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$4) : [];
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$4(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$4(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$4(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$4(v)) {
6787
6787
  const out = {};
6788
6788
  for (const [k, child] of Object.entries(v)) {
6789
6789
  const s = substitute(child);
@@ -7706,7 +7706,7 @@ var BaseAddon = class {
7706
7706
  if (!ctx) return;
7707
7707
  const addonId = ctx.id;
7708
7708
  setImmediate(() => {
7709
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7709
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7710
7710
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7711
7711
  }).catch((err) => {
7712
7712
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -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,87 @@ 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).max(RECORD_BATCH_MAX),
16985
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16986
+ complete: boolean().optional()
16987
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16988
+ kind: "mutation",
16989
+ auth: "admin"
16990
+ }), method(object({
16991
+ collection: string().min(1),
16992
+ cursor: string().optional(),
16993
+ limit: number().int().min(1).max(1e3).optional()
16994
+ }), object({
16995
+ rows: array(object({
16996
+ id: string(),
16997
+ data: record(string(), unknown())
16998
+ })),
16999
+ nextCursor: string().nullable()
17000
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
17001
+ /**
17002
+ * record-entries - the ONE admin surface for every list of user-created entries
17003
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
17004
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
17005
+ *
17006
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
17007
+ * the entry body with `secret: true` on every credential field, so a password
17008
+ * field is derived from the schema and never from a name. `putEntry` takes the
17009
+ * redaction token for an untouched secret (the stored value is kept), a string
17010
+ * for a new one, and the clear instruction to remove one. A read never carries
17011
+ * a secret value, and a locked keychain refuses the write with
17012
+ * `records/secret-unavailable` instead of storing plaintext.
17013
+ *
17014
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
17015
+ */
17016
+ var EntryKindInfoSchema = object({
17017
+ owner: string(),
17018
+ kind: RecordKindNameSchema,
17019
+ title: string(),
17020
+ nameField: string(),
17021
+ /** JSON Schema of the body; `secret: true` marks a password field. */
17022
+ fields: record(string(), unknown()),
17023
+ secretPaths: array(string()),
17024
+ rows: number().int().nonnegative()
17025
+ });
17026
+ var EntryViewSchema = object({
17027
+ id: RecordIdSchema,
17028
+ name: string(),
17029
+ rev: number().int(),
17030
+ updatedAt: number(),
17031
+ /** Secret fields hold the redaction token. */
17032
+ data: RecordBodySchema
17033
+ });
17034
+ var EntryAddress = {
17035
+ owner: string().min(1),
17036
+ kind: RecordKindNameSchema
17037
+ };
17038
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
17039
+ ...EntryAddress,
17040
+ id: RecordIdSchema.optional(),
17041
+ data: RecordBodySchema,
17042
+ ifRev: number().int().min(1).optional()
17043
+ }), object({
17044
+ id: string(),
17045
+ rev: number().int()
17046
+ }), {
17047
+ kind: "mutation",
17048
+ auth: "admin"
17049
+ }), method(object({
17050
+ ...EntryAddress,
17051
+ id: RecordIdSchema
17052
+ }), object({ deleted: boolean() }), {
17053
+ kind: "mutation",
17054
+ auth: "admin"
16653
17055
  });
16654
17056
  /**
16655
17057
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -67807,6 +68209,30 @@ Object.freeze({
67807
68209
  addonId: null,
67808
68210
  access: "create"
67809
68211
  },
68212
+ "recordEntries.deleteEntry": {
68213
+ capName: "record-entries",
68214
+ capScope: "system",
68215
+ addonId: null,
68216
+ access: "delete"
68217
+ },
68218
+ "recordEntries.listEntries": {
68219
+ capName: "record-entries",
68220
+ capScope: "system",
68221
+ addonId: null,
68222
+ access: "view"
68223
+ },
68224
+ "recordEntries.listEntryKinds": {
68225
+ capName: "record-entries",
68226
+ capScope: "system",
68227
+ addonId: null,
68228
+ access: "view"
68229
+ },
68230
+ "recordEntries.putEntry": {
68231
+ capName: "record-entries",
68232
+ capScope: "system",
68233
+ addonId: null,
68234
+ access: "create"
68235
+ },
67810
68236
  "recording.getAvailability": {
67811
68237
  capName: "recording",
67812
68238
  capScope: "device",
@@ -68107,6 +68533,102 @@ Object.freeze({
68107
68533
  addonId: null,
68108
68534
  access: "view"
68109
68535
  },
68536
+ "records.aggregate": {
68537
+ capName: "records",
68538
+ capScope: "system",
68539
+ addonId: null,
68540
+ access: "view"
68541
+ },
68542
+ "records.allocateId": {
68543
+ capName: "records",
68544
+ capScope: "system",
68545
+ addonId: null,
68546
+ access: "create"
68547
+ },
68548
+ "records.count": {
68549
+ capName: "records",
68550
+ capScope: "system",
68551
+ addonId: null,
68552
+ access: "view"
68553
+ },
68554
+ "records.declareKinds": {
68555
+ capName: "records",
68556
+ capScope: "system",
68557
+ addonId: null,
68558
+ access: "create"
68559
+ },
68560
+ "records.delete": {
68561
+ capName: "records",
68562
+ capScope: "system",
68563
+ addonId: null,
68564
+ access: "delete"
68565
+ },
68566
+ "records.deleteDevice": {
68567
+ capName: "records",
68568
+ capScope: "system",
68569
+ addonId: null,
68570
+ access: "delete"
68571
+ },
68572
+ "records.deleteMany": {
68573
+ capName: "records",
68574
+ capScope: "system",
68575
+ addonId: null,
68576
+ access: "delete"
68577
+ },
68578
+ "records.deleteWhere": {
68579
+ capName: "records",
68580
+ capScope: "system",
68581
+ addonId: null,
68582
+ access: "delete"
68583
+ },
68584
+ "records.get": {
68585
+ capName: "records",
68586
+ capScope: "system",
68587
+ addonId: null,
68588
+ access: "view"
68589
+ },
68590
+ "records.getMany": {
68591
+ capName: "records",
68592
+ capScope: "system",
68593
+ addonId: null,
68594
+ access: "view"
68595
+ },
68596
+ "records.histogram": {
68597
+ capName: "records",
68598
+ capScope: "system",
68599
+ addonId: null,
68600
+ access: "view"
68601
+ },
68602
+ "records.patch": {
68603
+ capName: "records",
68604
+ capScope: "system",
68605
+ addonId: null,
68606
+ access: "create"
68607
+ },
68608
+ "records.put": {
68609
+ capName: "records",
68610
+ capScope: "system",
68611
+ addonId: null,
68612
+ access: "create"
68613
+ },
68614
+ "records.putMany": {
68615
+ capName: "records",
68616
+ capScope: "system",
68617
+ addonId: null,
68618
+ access: "create"
68619
+ },
68620
+ "records.query": {
68621
+ capName: "records",
68622
+ capScope: "system",
68623
+ addonId: null,
68624
+ access: "view"
68625
+ },
68626
+ "records.secretRefs": {
68627
+ capName: "records",
68628
+ capScope: "system",
68629
+ addonId: null,
68630
+ access: "view"
68631
+ },
68110
68632
  "sceneMonitor.captureReference": {
68111
68633
  capName: "scene-monitor",
68112
68634
  capScope: "device",
@@ -68539,18 +69061,48 @@ Object.freeze({
68539
69061
  addonId: null,
68540
69062
  access: "create"
68541
69063
  },
69064
+ "storageAdmin.adoptRecords": {
69065
+ capName: "storage-admin",
69066
+ capScope: "system",
69067
+ addonId: null,
69068
+ access: "create"
69069
+ },
68542
69070
  "storageAdmin.dropCollection": {
68543
69071
  capName: "storage-admin",
68544
69072
  capScope: "system",
68545
69073
  addonId: null,
68546
69074
  access: "delete"
68547
69075
  },
69076
+ "storageAdmin.isAdoptedLegacyTable": {
69077
+ capName: "storage-admin",
69078
+ capScope: "system",
69079
+ addonId: null,
69080
+ access: "view"
69081
+ },
69082
+ "storageAdmin.listKinds": {
69083
+ capName: "storage-admin",
69084
+ capScope: "system",
69085
+ addonId: null,
69086
+ access: "view"
69087
+ },
68548
69088
  "storageAdmin.listTables": {
68549
69089
  capName: "storage-admin",
68550
69090
  capScope: "system",
68551
69091
  addonId: null,
68552
69092
  access: "view"
68553
69093
  },
69094
+ "storageAdmin.readLegacyCollection": {
69095
+ capName: "storage-admin",
69096
+ capScope: "system",
69097
+ addonId: null,
69098
+ access: "view"
69099
+ },
69100
+ "storageAdmin.readRecords": {
69101
+ capName: "storage-admin",
69102
+ capScope: "system",
69103
+ addonId: null,
69104
+ access: "view"
69105
+ },
68554
69106
  "storageEvictable.evict": {
68555
69107
  capName: "storage-evictable",
68556
69108
  capScope: "system",
@@ -72145,6 +72697,37 @@ Object.freeze({
72145
72697
  form: "single",
72146
72698
  optional: false
72147
72699
  }],
72700
+ "records.count": [{
72701
+ name: "deviceId",
72702
+ form: "single",
72703
+ optional: true
72704
+ }],
72705
+ "records.deleteDevice": [{
72706
+ name: "deviceId",
72707
+ form: "single",
72708
+ optional: false
72709
+ }],
72710
+ "records.deleteWhere": [{
72711
+ name: "deviceId",
72712
+ form: "single",
72713
+ optional: true
72714
+ }],
72715
+ "records.histogram": [{
72716
+ name: "deviceId",
72717
+ form: "single",
72718
+ optional: true
72719
+ }],
72720
+ "records.putMany": [{
72721
+ name: "records",
72722
+ form: "object-array",
72723
+ optional: false,
72724
+ itemField: "deviceId"
72725
+ }],
72726
+ "records.query": [{
72727
+ name: "deviceId",
72728
+ form: "single",
72729
+ optional: true
72730
+ }],
72148
72731
  "sceneMonitor.captureReference": [{
72149
72732
  name: "deviceId",
72150
72733
  form: "single",
@@ -72261,6 +72844,17 @@ Object.freeze({
72261
72844
  form: "single",
72262
72845
  optional: false
72263
72846
  }],
72847
+ "storageAdmin.adoptRecords": [{
72848
+ name: "records",
72849
+ form: "object-array",
72850
+ optional: false,
72851
+ itemField: "deviceId"
72852
+ }],
72853
+ "storageAdmin.readRecords": [{
72854
+ name: "deviceId",
72855
+ form: "single",
72856
+ optional: true
72857
+ }],
72264
72858
  "streamBroker.acquireEgressTranscode": [{
72265
72859
  name: "deviceId",
72266
72860
  form: "single",