@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
@@ -5774,7 +5774,7 @@ var ZodIssueCode = {
5774
5774
  var ZodFirstPartyTypeKind;
5775
5775
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5776
5776
  //#endregion
5777
- //#region ../types/dist/sleep-D-Q2_Mcd.mjs
5777
+ //#region ../types/dist/sleep-bZIhUvjd.mjs
5778
5778
  /**
5779
5779
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5780
5780
  * window to float samples (D455).
@@ -5891,7 +5891,7 @@ function isKeychainStoredField(field) {
5891
5891
  var SECRET_CLEAR = { $secretClear: true };
5892
5892
  /** The `'***'` token D634 redaction writes for non-admins. */
5893
5893
  var LEGACY_DEVICE_REDACTION = "***";
5894
- function isRecord$2(value) {
5894
+ function isRecord$5(value) {
5895
5895
  return typeof value === "object" && value !== null && !Array.isArray(value);
5896
5896
  }
5897
5897
  function makeSecretMarker(ref) {
@@ -5902,12 +5902,12 @@ function makeSecretMarker(ref) {
5902
5902
  }
5903
5903
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5904
5904
  function isSecretMarker(value) {
5905
- if (!isRecord$2(value)) return false;
5905
+ if (!isRecord$5(value)) return false;
5906
5906
  const ref = value["$secret"];
5907
5907
  return typeof ref === "string" && ref.length > 0;
5908
5908
  }
5909
5909
  function isSecretClear(value) {
5910
- return isRecord$2(value) && value["$secretClear"] === true;
5910
+ return isRecord$5(value) && value["$secretClear"] === true;
5911
5911
  }
5912
5912
  /**
5913
5913
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6517,7 +6517,7 @@ var KeychainWriteRefusedError = class extends Error {
6517
6517
  }
6518
6518
  };
6519
6519
  var KEEP = { kind: "keep" };
6520
- function isRecord$1(value) {
6520
+ function isRecord$4(value) {
6521
6521
  return typeof value === "object" && value !== null && !Array.isArray(value);
6522
6522
  }
6523
6523
  function defaultMintId() {
@@ -6530,7 +6530,7 @@ function collectSecretMarkerRefs(value, out = []) {
6530
6530
  return out;
6531
6531
  }
6532
6532
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6533
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6533
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6534
6534
  return out;
6535
6535
  }
6536
6536
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6585,7 +6585,7 @@ function rowId(row, idKey) {
6585
6585
  return null;
6586
6586
  }
6587
6587
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6588
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6588
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6589
6589
  if (!Array.isArray(incoming)) {
6590
6590
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6591
6591
  return {
@@ -6601,7 +6601,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6601
6601
  const kept = /* @__PURE__ */ new Set();
6602
6602
  const rows = [];
6603
6603
  for (const row of incoming) {
6604
- if (!isRecord$1(row)) {
6604
+ if (!isRecord$4(row)) {
6605
6605
  rows.push(row);
6606
6606
  continue;
6607
6607
  }
@@ -6626,7 +6626,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6626
6626
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6627
6627
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6628
6628
  case "object": {
6629
- if (!isRecord$1(incoming)) {
6629
+ if (!isRecord$4(incoming)) {
6630
6630
  if (incoming === void 0) return KEEP;
6631
6631
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6632
6632
  return {
@@ -6634,7 +6634,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6634
6634
  value: incoming
6635
6635
  };
6636
6636
  }
6637
- const storedObj = isRecord$1(stored) ? stored : {};
6637
+ const storedObj = isRecord$4(stored) ? stored : {};
6638
6638
  return {
6639
6639
  kind: "value",
6640
6640
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6757,7 +6757,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6757
6757
  value: items
6758
6758
  };
6759
6759
  }
6760
- if (isRecord$1(v)) {
6760
+ if (isRecord$4(v)) {
6761
6761
  const out = {};
6762
6762
  for (const [k, child] of Object.entries(v)) {
6763
6763
  const s = substitute(child);
@@ -7680,7 +7680,7 @@ var BaseAddon = class {
7680
7680
  if (!ctx) return;
7681
7681
  const addonId = ctx.id;
7682
7682
  setImmediate(() => {
7683
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7683
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7684
7684
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7685
7685
  }).catch((err) => {
7686
7686
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -8174,6 +8174,89 @@ var PeerBytesTicketSchema = object({
8174
8174
  */
8175
8175
  declaredBytes: number().int().nonnegative().nullable()
8176
8176
  });
8177
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8178
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8179
+ var RECORD_DATABASES = ["settings", "events"];
8180
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8181
+ var RECORD_CLASSES = [
8182
+ "config",
8183
+ "ledger",
8184
+ "audit",
8185
+ "mirror",
8186
+ "ephemeral"
8187
+ ];
8188
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8189
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8190
+ var RECORD_BATCH_MAX = 1e3;
8191
+ var RECORD_QUERY_MAX = 1e3;
8192
+ /**
8193
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8194
+ * Zod row schema that describes it, and the helper that turns the two into the
8195
+ * JSON the engine stores.
8196
+ *
8197
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
8198
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
8199
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
8200
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
8201
+ * never a field name (D879).
8202
+ */
8203
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
8204
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
8205
+ var RecordIndexSchema = object({
8206
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
8207
+ fields: array(RecordFieldPathSchema).min(1).max(4),
8208
+ unique: boolean().optional()
8209
+ }).strict();
8210
+ var RecordRetentionSchema = union([
8211
+ object({
8212
+ ttlMs: number().int().positive(),
8213
+ from: _enum(["at", "write"])
8214
+ }).strict(),
8215
+ object({
8216
+ maxRows: number().int().positive().optional(),
8217
+ maxRowsPerDevice: number().int().positive().optional()
8218
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
8219
+ object({
8220
+ owner: string().min(1),
8221
+ reason: string().min(1)
8222
+ }).strict(),
8223
+ object({ none: string().min(1) }).strict()
8224
+ ]);
8225
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
8226
+ var EntryDescriptorSchema = object({
8227
+ title: string().min(1),
8228
+ /** The record body field shown as the entry's name. */
8229
+ nameField: string().min(1),
8230
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
8231
+ fields: record(string(), unknown())
8232
+ }).strict();
8233
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
8234
+ var RecordKindDeclarationSchema = object({
8235
+ database: _enum(RECORD_DATABASES).default("settings"),
8236
+ class: _enum(RECORD_CLASSES),
8237
+ writeTrigger: string().min(1),
8238
+ device: _enum([
8239
+ "required",
8240
+ "optional",
8241
+ "none"
8242
+ ]).default("none"),
8243
+ at: _enum(["required", "none"]).default("none"),
8244
+ indexes: array(RecordIndexSchema).max(8).default([]),
8245
+ retention: RecordRetentionSchema,
8246
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
8247
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
8248
+ /** Derived from the Zod schema; never written by hand. */
8249
+ secretPaths: array(string().min(1)).default([]),
8250
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
8251
+ secretArrayKeys: record(string(), string()).default({}),
8252
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
8253
+ adoptsFrom: string().min(1).optional(),
8254
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
8255
+ transactFamily: string().min(1).optional(),
8256
+ entry: EntryDescriptorSchema.optional()
8257
+ }).strict();
8258
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
8259
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8177
8260
  /** Shared Zod schemas used across streaming capabilities. */
8178
8261
  var CamProfileSchema = _enum([
8179
8262
  "high",
@@ -16603,6 +16686,222 @@ id: union([string(), number()]) }), {
16603
16686
  kind: "mutation",
16604
16687
  auth: "admin"
16605
16688
  });
16689
+ /**
16690
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16691
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16692
+ * (operator intent, D870) and device-history (numbers over time, D850).
16693
+ *
16694
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16695
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16696
+ * that with the addon id closed over). It is deliberately NOT in any input
16697
+ * schema, so a session can never supply it, and a call with no stamp is refused
16698
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16699
+ * addons go through the owner's capability.
16700
+ *
16701
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16702
+ * never `[]`. Secret fields are never on the wire: a read shows the
16703
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16704
+ * resolves itself, and a write may carry only a keychain marker bound to the
16705
+ * row's own ref.
16706
+ *
16707
+ * Internal: addons reach it through `ctx.records`, never directly.
16708
+ */
16709
+ var RecordIdSchema = string().min(1).max(256);
16710
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16711
+ var RecordBodySchema = record(string(), unknown());
16712
+ var RecordInputSchema = object({
16713
+ id: RecordIdSchema,
16714
+ /** The device this row belongs to (D865 removal, per-device reads). */
16715
+ deviceId: number().int().optional(),
16716
+ /** The domain clock, ms: observed / created / opened. */
16717
+ at: number().int().optional(),
16718
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16719
+ expiresAt: number().int().optional(),
16720
+ data: RecordBodySchema
16721
+ });
16722
+ var RecordViewSchema = object({
16723
+ id: string(),
16724
+ deviceId: number().int().nullable(),
16725
+ at: number().nullable(),
16726
+ expiresAt: number().nullable(),
16727
+ rev: number().int(),
16728
+ updatedAt: number(),
16729
+ data: RecordBodySchema
16730
+ });
16731
+ /** Declared index fields only. Anything else does not compile, by design. */
16732
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16733
+ string(),
16734
+ number(),
16735
+ boolean(),
16736
+ object({ in: array(union([
16737
+ string(),
16738
+ number(),
16739
+ boolean()
16740
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16741
+ object({
16742
+ gt: union([string(), number()]).optional(),
16743
+ gte: union([string(), number()]).optional(),
16744
+ lt: union([string(), number()]).optional(),
16745
+ lte: union([string(), number()]).optional()
16746
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16747
+ ]));
16748
+ var KindShape = { kind: RecordKindNameSchema };
16749
+ var TimeWindowShape = {
16750
+ deviceId: number().int().optional(),
16751
+ atFrom: number().optional(),
16752
+ atTo: number().optional()
16753
+ };
16754
+ var RecordQueryInputSchema = object({
16755
+ ...KindShape,
16756
+ ...TimeWindowShape,
16757
+ where: RecordWhereSchema.optional(),
16758
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16759
+ order: _enum(["at", "id"]).optional(),
16760
+ desc: boolean().optional(),
16761
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16762
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16763
+ cursor: string().min(1).optional()
16764
+ });
16765
+ var RecordQueryResultSchema = object({
16766
+ records: array(RecordViewSchema),
16767
+ nextCursor: string().nullable()
16768
+ });
16769
+ var RecordKindStateSchema = _enum([
16770
+ "created",
16771
+ "unchanged",
16772
+ "updated"
16773
+ ]);
16774
+ var DeclareKindResultSchema = object({
16775
+ kindId: number().int(),
16776
+ state: RecordKindStateSchema,
16777
+ createdIndexes: array(string()),
16778
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16779
+ adoptionPending: object({
16780
+ legacyTable: string(),
16781
+ legacyRows: number().int()
16782
+ }).nullable()
16783
+ });
16784
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16785
+ var SecretRefsList = array(string());
16786
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16787
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16788
+ kind: "mutation",
16789
+ auth: "admin"
16790
+ }), method(object({
16791
+ ...KindShape,
16792
+ id: RecordIdSchema
16793
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16794
+ ...KindShape,
16795
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16796
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16797
+ ...KindShape,
16798
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16799
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16800
+ ...KindShape,
16801
+ record: RecordInputSchema,
16802
+ /** Compare-and-set. `0` means "the row must not exist". */
16803
+ ifRev: number().int().min(0).optional()
16804
+ }), object({
16805
+ rev: number().int(),
16806
+ releasedRefs: SecretRefsList
16807
+ }), {
16808
+ kind: "mutation",
16809
+ auth: "admin"
16810
+ }), method(object({
16811
+ ...KindShape,
16812
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16813
+ }), object({
16814
+ count: number().int(),
16815
+ releasedRefs: SecretRefsList
16816
+ }), {
16817
+ kind: "mutation",
16818
+ auth: "admin"
16819
+ }), method(object({
16820
+ ...KindShape,
16821
+ id: RecordIdSchema,
16822
+ data: RecordBodySchema,
16823
+ at: number().int().nullable().optional(),
16824
+ expiresAt: number().int().nullable().optional(),
16825
+ ifRev: number().int().min(1).optional()
16826
+ }), object({
16827
+ rev: number().int(),
16828
+ releasedRefs: SecretRefsList
16829
+ }), {
16830
+ kind: "mutation",
16831
+ auth: "admin"
16832
+ }), method(object({
16833
+ ...KindShape,
16834
+ id: RecordIdSchema
16835
+ }), object({
16836
+ deleted: boolean(),
16837
+ secretRefs: SecretRefsList
16838
+ }), {
16839
+ kind: "mutation",
16840
+ auth: "admin"
16841
+ }), method(object({
16842
+ ...KindShape,
16843
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16844
+ }), object({
16845
+ deleted: number().int(),
16846
+ secretRefs: SecretRefsList
16847
+ }), {
16848
+ kind: "mutation",
16849
+ auth: "admin"
16850
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16851
+ ...KindShape,
16852
+ ...TimeWindowShape,
16853
+ where: RecordWhereSchema.optional()
16854
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16855
+ ...KindShape,
16856
+ deviceId: number().int().optional(),
16857
+ from: number(),
16858
+ to: number(),
16859
+ bucketMs: number().int().positive()
16860
+ }), object({ buckets: array(object({
16861
+ bucketStart: number(),
16862
+ count: number().int()
16863
+ })) }), { auth: "admin" }), method(object({
16864
+ ...KindShape,
16865
+ op: _enum([
16866
+ "sum",
16867
+ "min",
16868
+ "max",
16869
+ "count"
16870
+ ]),
16871
+ field: RecordFieldPathSchema.optional(),
16872
+ groupBy: RecordFieldPathSchema.optional(),
16873
+ where: RecordWhereSchema.optional()
16874
+ }), object({ rows: array(object({
16875
+ group: union([
16876
+ string(),
16877
+ number(),
16878
+ _null()
16879
+ ]),
16880
+ value: number().nullable()
16881
+ })) }), { auth: "admin" }), method(object({
16882
+ ...KindShape,
16883
+ deviceId: number().int().optional(),
16884
+ atBefore: number().optional(),
16885
+ where: RecordWhereSchema.optional()
16886
+ }), object({
16887
+ deleted: number().int(),
16888
+ secretRefs: SecretRefsList
16889
+ }), {
16890
+ kind: "mutation",
16891
+ auth: "admin"
16892
+ }), method(object({
16893
+ deviceId: number().int(),
16894
+ kinds: array(RecordKindNameSchema).optional()
16895
+ }), object({
16896
+ deleted: record(string(), number().int()),
16897
+ secretRefs: SecretRefsList
16898
+ }), {
16899
+ kind: "mutation",
16900
+ auth: "admin"
16901
+ }), method(object(KindShape), object({ id: number().int() }), {
16902
+ kind: "mutation",
16903
+ auth: "admin"
16904
+ });
16606
16905
  /** One table of the settings database. */
16607
16906
  var StorageTableSchema = object({
16608
16907
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -16615,6 +16914,28 @@ var StorageTableSchema = object({
16615
16914
  /** Declared by an addon since this engine process started (a running addon claims it). */
16616
16915
  declaredThisBoot: boolean()
16617
16916
  });
16917
+ /** One declared record kind (D881) as System -> Data shows it. */
16918
+ var StorageKindSchema = object({
16919
+ owner: string(),
16920
+ kind: string(),
16921
+ database: _enum(["settings", "events"]),
16922
+ class: string(),
16923
+ state: _enum([
16924
+ "declared",
16925
+ "orphaned",
16926
+ "dropped"
16927
+ ]),
16928
+ /** `null` when the caller asked for no counts (`counts: false`). */
16929
+ rows: number().int().nonnegative().nullable(),
16930
+ /** Rows x the average size of a sample; null for an empty kind. */
16931
+ bytesEstimate: number().int().nonnegative().nullable(),
16932
+ writeTrigger: string(),
16933
+ retention: RecordRetentionSchema,
16934
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16935
+ entry: boolean(),
16936
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16937
+ declaration: RecordKindDeclarationSchema
16938
+ });
16618
16939
  method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16619
16940
  collection: string().min(1),
16620
16941
  expectRows: number().int().nonnegative()
@@ -16624,6 +16945,87 @@ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: arr
16624
16945
  }), {
16625
16946
  kind: "mutation",
16626
16947
  auth: "admin"
16948
+ }), method(object({
16949
+ owner: string().min(1).optional(),
16950
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16951
+ counts: boolean().optional()
16952
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16953
+ owner: string().min(1),
16954
+ kind: RecordKindNameSchema
16955
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16956
+ owner: string().min(1),
16957
+ kind: RecordKindNameSchema,
16958
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
16959
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16960
+ complete: boolean().optional()
16961
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16962
+ kind: "mutation",
16963
+ auth: "admin"
16964
+ }), method(object({
16965
+ collection: string().min(1),
16966
+ cursor: string().optional(),
16967
+ limit: number().int().min(1).max(1e3).optional()
16968
+ }), object({
16969
+ rows: array(object({
16970
+ id: string(),
16971
+ data: record(string(), unknown())
16972
+ })),
16973
+ nextCursor: string().nullable()
16974
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
16975
+ /**
16976
+ * record-entries - the ONE admin surface for every list of user-created entries
16977
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16978
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16979
+ *
16980
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16981
+ * the entry body with `secret: true` on every credential field, so a password
16982
+ * field is derived from the schema and never from a name. `putEntry` takes the
16983
+ * redaction token for an untouched secret (the stored value is kept), a string
16984
+ * for a new one, and the clear instruction to remove one. A read never carries
16985
+ * a secret value, and a locked keychain refuses the write with
16986
+ * `records/secret-unavailable` instead of storing plaintext.
16987
+ *
16988
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16989
+ */
16990
+ var EntryKindInfoSchema = object({
16991
+ owner: string(),
16992
+ kind: RecordKindNameSchema,
16993
+ title: string(),
16994
+ nameField: string(),
16995
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16996
+ fields: record(string(), unknown()),
16997
+ secretPaths: array(string()),
16998
+ rows: number().int().nonnegative()
16999
+ });
17000
+ var EntryViewSchema = object({
17001
+ id: RecordIdSchema,
17002
+ name: string(),
17003
+ rev: number().int(),
17004
+ updatedAt: number(),
17005
+ /** Secret fields hold the redaction token. */
17006
+ data: RecordBodySchema
17007
+ });
17008
+ var EntryAddress = {
17009
+ owner: string().min(1),
17010
+ kind: RecordKindNameSchema
17011
+ };
17012
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
17013
+ ...EntryAddress,
17014
+ id: RecordIdSchema.optional(),
17015
+ data: RecordBodySchema,
17016
+ ifRev: number().int().min(1).optional()
17017
+ }), object({
17018
+ id: string(),
17019
+ rev: number().int()
17020
+ }), {
17021
+ kind: "mutation",
17022
+ auth: "admin"
17023
+ }), method(object({
17024
+ ...EntryAddress,
17025
+ id: RecordIdSchema
17026
+ }), object({ deleted: boolean() }), {
17027
+ kind: "mutation",
17028
+ auth: "admin"
16627
17029
  });
16628
17030
  /**
16629
17031
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -67781,6 +68183,30 @@ Object.freeze({
67781
68183
  addonId: null,
67782
68184
  access: "create"
67783
68185
  },
68186
+ "recordEntries.deleteEntry": {
68187
+ capName: "record-entries",
68188
+ capScope: "system",
68189
+ addonId: null,
68190
+ access: "delete"
68191
+ },
68192
+ "recordEntries.listEntries": {
68193
+ capName: "record-entries",
68194
+ capScope: "system",
68195
+ addonId: null,
68196
+ access: "view"
68197
+ },
68198
+ "recordEntries.listEntryKinds": {
68199
+ capName: "record-entries",
68200
+ capScope: "system",
68201
+ addonId: null,
68202
+ access: "view"
68203
+ },
68204
+ "recordEntries.putEntry": {
68205
+ capName: "record-entries",
68206
+ capScope: "system",
68207
+ addonId: null,
68208
+ access: "create"
68209
+ },
67784
68210
  "recording.getAvailability": {
67785
68211
  capName: "recording",
67786
68212
  capScope: "device",
@@ -68081,6 +68507,102 @@ Object.freeze({
68081
68507
  addonId: null,
68082
68508
  access: "view"
68083
68509
  },
68510
+ "records.aggregate": {
68511
+ capName: "records",
68512
+ capScope: "system",
68513
+ addonId: null,
68514
+ access: "view"
68515
+ },
68516
+ "records.allocateId": {
68517
+ capName: "records",
68518
+ capScope: "system",
68519
+ addonId: null,
68520
+ access: "create"
68521
+ },
68522
+ "records.count": {
68523
+ capName: "records",
68524
+ capScope: "system",
68525
+ addonId: null,
68526
+ access: "view"
68527
+ },
68528
+ "records.declareKinds": {
68529
+ capName: "records",
68530
+ capScope: "system",
68531
+ addonId: null,
68532
+ access: "create"
68533
+ },
68534
+ "records.delete": {
68535
+ capName: "records",
68536
+ capScope: "system",
68537
+ addonId: null,
68538
+ access: "delete"
68539
+ },
68540
+ "records.deleteDevice": {
68541
+ capName: "records",
68542
+ capScope: "system",
68543
+ addonId: null,
68544
+ access: "delete"
68545
+ },
68546
+ "records.deleteMany": {
68547
+ capName: "records",
68548
+ capScope: "system",
68549
+ addonId: null,
68550
+ access: "delete"
68551
+ },
68552
+ "records.deleteWhere": {
68553
+ capName: "records",
68554
+ capScope: "system",
68555
+ addonId: null,
68556
+ access: "delete"
68557
+ },
68558
+ "records.get": {
68559
+ capName: "records",
68560
+ capScope: "system",
68561
+ addonId: null,
68562
+ access: "view"
68563
+ },
68564
+ "records.getMany": {
68565
+ capName: "records",
68566
+ capScope: "system",
68567
+ addonId: null,
68568
+ access: "view"
68569
+ },
68570
+ "records.histogram": {
68571
+ capName: "records",
68572
+ capScope: "system",
68573
+ addonId: null,
68574
+ access: "view"
68575
+ },
68576
+ "records.patch": {
68577
+ capName: "records",
68578
+ capScope: "system",
68579
+ addonId: null,
68580
+ access: "create"
68581
+ },
68582
+ "records.put": {
68583
+ capName: "records",
68584
+ capScope: "system",
68585
+ addonId: null,
68586
+ access: "create"
68587
+ },
68588
+ "records.putMany": {
68589
+ capName: "records",
68590
+ capScope: "system",
68591
+ addonId: null,
68592
+ access: "create"
68593
+ },
68594
+ "records.query": {
68595
+ capName: "records",
68596
+ capScope: "system",
68597
+ addonId: null,
68598
+ access: "view"
68599
+ },
68600
+ "records.secretRefs": {
68601
+ capName: "records",
68602
+ capScope: "system",
68603
+ addonId: null,
68604
+ access: "view"
68605
+ },
68084
68606
  "sceneMonitor.captureReference": {
68085
68607
  capName: "scene-monitor",
68086
68608
  capScope: "device",
@@ -68513,18 +69035,48 @@ Object.freeze({
68513
69035
  addonId: null,
68514
69036
  access: "create"
68515
69037
  },
69038
+ "storageAdmin.adoptRecords": {
69039
+ capName: "storage-admin",
69040
+ capScope: "system",
69041
+ addonId: null,
69042
+ access: "create"
69043
+ },
68516
69044
  "storageAdmin.dropCollection": {
68517
69045
  capName: "storage-admin",
68518
69046
  capScope: "system",
68519
69047
  addonId: null,
68520
69048
  access: "delete"
68521
69049
  },
69050
+ "storageAdmin.isAdoptedLegacyTable": {
69051
+ capName: "storage-admin",
69052
+ capScope: "system",
69053
+ addonId: null,
69054
+ access: "view"
69055
+ },
69056
+ "storageAdmin.listKinds": {
69057
+ capName: "storage-admin",
69058
+ capScope: "system",
69059
+ addonId: null,
69060
+ access: "view"
69061
+ },
68522
69062
  "storageAdmin.listTables": {
68523
69063
  capName: "storage-admin",
68524
69064
  capScope: "system",
68525
69065
  addonId: null,
68526
69066
  access: "view"
68527
69067
  },
69068
+ "storageAdmin.readLegacyCollection": {
69069
+ capName: "storage-admin",
69070
+ capScope: "system",
69071
+ addonId: null,
69072
+ access: "view"
69073
+ },
69074
+ "storageAdmin.readRecords": {
69075
+ capName: "storage-admin",
69076
+ capScope: "system",
69077
+ addonId: null,
69078
+ access: "view"
69079
+ },
68528
69080
  "storageEvictable.evict": {
68529
69081
  capName: "storage-evictable",
68530
69082
  capScope: "system",
@@ -72119,6 +72671,37 @@ Object.freeze({
72119
72671
  form: "single",
72120
72672
  optional: false
72121
72673
  }],
72674
+ "records.count": [{
72675
+ name: "deviceId",
72676
+ form: "single",
72677
+ optional: true
72678
+ }],
72679
+ "records.deleteDevice": [{
72680
+ name: "deviceId",
72681
+ form: "single",
72682
+ optional: false
72683
+ }],
72684
+ "records.deleteWhere": [{
72685
+ name: "deviceId",
72686
+ form: "single",
72687
+ optional: true
72688
+ }],
72689
+ "records.histogram": [{
72690
+ name: "deviceId",
72691
+ form: "single",
72692
+ optional: true
72693
+ }],
72694
+ "records.putMany": [{
72695
+ name: "records",
72696
+ form: "object-array",
72697
+ optional: false,
72698
+ itemField: "deviceId"
72699
+ }],
72700
+ "records.query": [{
72701
+ name: "deviceId",
72702
+ form: "single",
72703
+ optional: true
72704
+ }],
72122
72705
  "sceneMonitor.captureReference": [{
72123
72706
  name: "deviceId",
72124
72707
  form: "single",
@@ -72235,6 +72818,17 @@ Object.freeze({
72235
72818
  form: "single",
72236
72819
  optional: false
72237
72820
  }],
72821
+ "storageAdmin.adoptRecords": [{
72822
+ name: "records",
72823
+ form: "object-array",
72824
+ optional: false,
72825
+ itemField: "deviceId"
72826
+ }],
72827
+ "storageAdmin.readRecords": [{
72828
+ name: "deviceId",
72829
+ form: "single",
72830
+ optional: true
72831
+ }],
72238
72832
  "streamBroker.acquireEgressTranscode": [{
72239
72833
  name: "deviceId",
72240
72834
  form: "single",