@camstack/types 1.2.375 → 1.2.376

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.
@@ -457,18 +457,32 @@ export declare abstract class BaseAddon<TConfig extends object = Record<string,
457
457
  /** Re-resolve the config (a keychain-only change, or a retry) and apply it. */
458
458
  private scheduleSecretReresolve;
459
459
  /**
460
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
461
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
462
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
463
- * re-initialize) doesn't propagate up into `initialize()` and leave the
460
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
461
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
464
462
  * addon permanently broken.
465
463
  *
466
- * Retry only the two known infra fingerprints. Anything else propagates so
467
- * real bugs surface immediately. After the budget expires we fall back to
468
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
464
+ * Two kinds of outage, two budgets:
465
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
466
+ * initialized`, `provider not available`): a short budget, then the addon
467
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
468
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
469
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
470
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
471
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
472
+ * loop. A long, bounded budget; only after it the error propagates - the
473
+ * addon never runs on defaults for a store it could not ask.
474
+ * Anything else propagates immediately so real bugs surface.
469
475
  */
470
476
  private readAddonStoreWithRetry;
471
477
  }
478
+ /**
479
+ * Is a settings read failure worth retrying, and with which budget? Only
480
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
481
+ * one of the exact phrases our own transport raises. A message that merely
482
+ * contains "timed out" or "unreachable" is not evidence of anything, and
483
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
484
+ */
485
+ export declare function classifyStoreError(err: unknown): 'restart' | 'transport' | 'permanent';
472
486
  /**
473
487
  * Normalize an `ICamstackAddon.initialize()` return value into the
474
488
  * `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-rqlHXgwb.js");
2
+ const require_sleep = require("./sleep-Dq0Uyeh0.js");
3
3
  const require_event_category = require("./event-category-T43rdQWR.js");
4
4
  const require_err_msg = require("./err-msg-Ls8Q6dHO.js");
5
5
  //#region src/generated/cap-input-defaults.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { An as isSecretMarker, Bt as registerKnownSecret, D as collectZodSecretPaths, Dn as classifySecretWrite, En as SECRET_CLEAR, F as viewerUiCapability, Ft as createSecretsAccess, Gt as PEER_BYTES_STALL_MS, Ht as shortSecretRefHash, I as DEVICE_CHILDREN_BATCH_MAX, It as MIN_SCRUBBED_LENGTH, Jt as DATAPLANE_SECRET_HEADER, Kt as PEER_BYTES_TICKET_TTL_MS, Lt as clearKnownSecrets, Mn as makeSecretMarker, Nn as toSecretFieldView, Nt as resolveSecretViewsIn, O as isZodSecret, On as isSecretClear, P as deviceOpsCapability, Pt as REVALIDATE_AFTER_MS, Qt as normalizeAddonInitResult, Rt as forgetKnownSecret, S as createEventBusSliceSource, Ut as PEER_BYTES_CHUNK_BYTES, V as adminUiCapability, Vt as scrubKnownSecrets, Wt as PEER_BYTES_MAX_OUTSTANDING, Xt as DisposerChain, Y as expandCapMethods, Zt as BaseAddon, _ as readErrorI18n, _n as createEvent, at as MODEL_FORMATS, b as isDeviceScopedCap, c as asString, cn as arrayItemFieldPath, d as parseJsonUnknown, dn as globalSecretScope, f as hfModelUrl, fn as isSecretRef, g as ErrorI18nPayloadSchema, j as HF_REPO, jn as isSecretMarkerLike, kn as isSecretFieldView, ln as buildSecretRef, mn as parseSecretRef, nt as nodePin, o as asJsonObject, ot as ReadinessRegistry, p as BOOT_RECOVERY_BACKOFF_MS, pn as normalizeSecretOwner, r as maskUrlCredentials, rt as readNodePin, sn as SECRET_REF_SCHEME, st as ReadinessTimeoutError, t as sleep, un as formatSecretScope, ut as scopeKey, vn as emitReadiness, x as createDeviceProxy, y as DEVICE_SCOPED_CAPS, z as describeCustomActions, zt as knownSecretCount } from "./sleep-DRqxtc0C.mjs";
1
+ import { $t as normalizeAddonInitResult, An as isSecretFieldView, Bt as registerKnownSecret, D as collectZodSecretPaths, Dn as SECRET_CLEAR, F as viewerUiCapability, Ft as createSecretsAccess, Gt as PEER_BYTES_STALL_MS, Ht as shortSecretRefHash, I as DEVICE_CHILDREN_BATCH_MAX, It as MIN_SCRUBBED_LENGTH, Jt as DATAPLANE_SECRET_HEADER, Kt as PEER_BYTES_TICKET_TTL_MS, Lt as clearKnownSecrets, Mn as isSecretMarkerLike, Nn as makeSecretMarker, Nt as resolveSecretViewsIn, O as isZodSecret, On as classifySecretWrite, P as deviceOpsCapability, Pn as toSecretFieldView, Pt as REVALIDATE_AFTER_MS, Rt as forgetKnownSecret, S as createEventBusSliceSource, Ut as PEER_BYTES_CHUNK_BYTES, V as adminUiCapability, Vt as scrubKnownSecrets, Wt as PEER_BYTES_MAX_OUTSTANDING, Xt as DisposerChain, Y as expandCapMethods, Zt as BaseAddon, _ as readErrorI18n, at as MODEL_FORMATS, b as isDeviceScopedCap, c as asString, cn as SECRET_REF_SCHEME, d as parseJsonUnknown, dn as formatSecretScope, f as hfModelUrl, fn as globalSecretScope, g as ErrorI18nPayloadSchema, hn as parseSecretRef, j as HF_REPO, jn as isSecretMarker, kn as isSecretClear, ln as arrayItemFieldPath, mn as normalizeSecretOwner, nt as nodePin, o as asJsonObject, ot as ReadinessRegistry, p as BOOT_RECOVERY_BACKOFF_MS, pn as isSecretRef, r as maskUrlCredentials, rt as readNodePin, st as ReadinessTimeoutError, t as sleep, un as buildSecretRef, ut as scopeKey, vn as createEvent, x as createDeviceProxy, y as DEVICE_SCOPED_CAPS, yn as emitReadiness, z as describeCustomActions, zt as knownSecretCount } from "./sleep-bwsTj221.mjs";
2
2
  import { t as EventCategory } from "./event-category-C4hVnRo8.mjs";
3
3
  import { a as DeviceType, t as errMsg } from "./err-msg-DLerKiVO.mjs";
4
4
  //#region src/generated/cap-input-defaults.ts
@@ -45,6 +45,7 @@ export type { CustomModelDescriptor, ICustomModelRegistryProvider, ImportModelBu
45
45
  export { CustomModelDescriptorSchema, customModelRegistryCapability, ImportModelBundleInputSchema, ImportModelBundleResultSchema, ModelBundleFileSchema, } from './custom-model-registry.cap.js';
46
46
  export { type DataStoreEngineInfo, dataStoreProviderCapability, EngineInfoSchema as DataStoreEngineInfoSchema, type IDataStoreProvider, } from './data-store-provider.cap.js';
47
47
  export { type ArchiveSqliteSnapshot, ArchiveSqliteSnapshotSchema, DATABASE_SNAPSHOT_PARTIAL_SUFFIX, DATABASE_SNAPSHOT_SUFFIX, DATABASE_SNAPSHOT_TIMEOUT_MS, type DatabaseSnapshotRequest, DatabaseSnapshotRequestSchema, type DatabaseSnapshotResult, DatabaseSnapshotResultSchema, type DatabaseSnapshotTable, DatabaseSnapshotTableSchema, type DatabaseSnapshotTargets, DatabaseSnapshotTargetsSchema, type DatabaseSnapshotWritten, DatabaseSnapshotWrittenSchema, databaseSnapshotCapability, type IDatabaseSnapshotProvider, } from './database-snapshot.cap.js';
48
+ export { type IStorageAdminProvider, STORAGE_ADMIN_MOVED_COLLECTIONS, STORAGE_ADMIN_SCOPED_BASES, type StorageTable, StorageTableSchema, storageAdminCapability, } from './storage-admin.cap.js';
48
49
  export { type IKeychainProvider, KEYCHAIN_MAX_REFS_PER_CALL, type KeychainResolveEntry, KeychainResolveEntrySchema, type KeychainResolveResult, KeychainResolveResultSchema, type KeychainSecretMeta, KeychainSecretMetaSchema, type KeychainState, KeychainStateSchema, type KeychainUnavailableReason, KeychainUnavailableReasonSchema, keychainCapability, } from './keychain.cap.js';
49
50
  export { type DeviceHistoryStatus, DeviceHistoryStatusSchema, type DeviceHistoryIngestResult, type DeviceHistoryKind, DeviceHistoryKindSchema, type DeviceHistoryQueryPoint, type DeviceHistoryRefusalReason, DeviceHistoryRefusalReasonSchema, type DeviceHistoryResolution, DeviceHistoryResolutionSchema, type DeviceHistorySeriesInfo, type DeviceHistorySubject, DeviceHistorySubjectSchema, type IDeviceHistoryProvider, deviceHistoryCapability, } from './device-history.cap.js';
50
51
  export { type DeviceCaStatus, DeviceCaStatusSchema, type DeviceCertificateSettings, DeviceCertificateSettingsSchema, deviceCredentialsCapability, type IDeviceCredentialsProvider, } from './device-credentials.cap.js';
@@ -290,6 +291,7 @@ import type { coverCapability } from './cover.cap.js';
290
291
  import type { customModelRegistryCapability } from './custom-model-registry.cap.js';
291
292
  import type { dataStoreProviderCapability } from './data-store-provider.cap.js';
292
293
  import type { databaseSnapshotCapability } from './database-snapshot.cap.js';
294
+ import type { storageAdminCapability } from './storage-admin.cap.js';
293
295
  import type { deviceHistoryCapability } from './device-history.cap.js';
294
296
  import type { keychainCapability } from './keychain.cap.js';
295
297
  import type { keychainAdminCapability } from './keychain-admin.cap.js';
@@ -419,6 +421,6 @@ import type { trainingProviderCapability } from './training-provider.cap.js';
419
421
  import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
420
422
  import type { zoneRulesCapability } from './zone-rules.cap.js';
421
423
  import type { zonesCapability } from './zones.cap.js';
422
- type AnyCapability = typeof streamSignalsCapability | typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof storageOccupancyCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof databaseSnapshotCapability | typeof deviceHistoryCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceAdminLinkCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof calendarSourceCapability | typeof calendarsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof composerCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof navigationCapability | typeof consumablesCapability | typeof connectionTestCapability | typeof rebootCapability | typeof deviceDiscoveryCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof imageCapability | typeof lockControlCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof trainingCapability | typeof trainingProviderCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingArchiveCapability | typeof recordingExportCapability | typeof recordingSignalCapability | typeof deviceOpsCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof integrationsCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof oidcConnectionsCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof cameraGridLayoutCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof recordingOnboardCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof networkLinkCapability | typeof buttonCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability | typeof deviceExtensionCapability;
424
+ type AnyCapability = typeof streamSignalsCapability | typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof storageOccupancyCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof databaseSnapshotCapability | typeof storageAdminCapability | typeof deviceHistoryCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceAdminLinkCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof calendarSourceCapability | typeof calendarsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof composerCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof navigationCapability | typeof consumablesCapability | typeof connectionTestCapability | typeof rebootCapability | typeof deviceDiscoveryCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof imageCapability | typeof lockControlCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof trainingCapability | typeof trainingProviderCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingArchiveCapability | typeof recordingExportCapability | typeof recordingSignalCapability | typeof deviceOpsCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof integrationsCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof oidcConnectionsCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof cameraGridLayoutCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof recordingOnboardCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof networkLinkCapability | typeof buttonCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability | typeof deviceExtensionCapability;
423
425
  export type CapabilityName = AnyCapability['name'];
424
426
  export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
@@ -305,6 +305,22 @@ export declare const keychainAdminCapability: {
305
305
  }, z.core.$strip>, "mutation"> & {
306
306
  readonly caller: 'required';
307
307
  };
308
+ /**
309
+ * Store a value an operator tool carries over from a retired store at an
310
+ * addon's own ref (`secret://<owner>/<scope>/<path>`) and answer the ref -
311
+ * the D870 migration moves a camera's restream tokens this way, so they
312
+ * never sit in a settings row as plaintext. Audited as the operator; the
313
+ * caller then writes the MARKER of the ref where the value used to be.
314
+ */
315
+ readonly importSecret: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
316
+ ref: z.ZodString;
317
+ value: z.ZodString;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ ref: z.ZodString;
320
+ version: z.ZodNumber;
321
+ }, z.core.$strip>, "mutation"> & {
322
+ readonly caller: 'required';
323
+ };
308
324
  /** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
309
325
  readonly deleteOrphans: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
310
326
  refs: z.ZodArray<z.ZodString>;
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ import { type InferProvider } from './capability-definition.js';
3
+ /** One table of the settings database. */
4
+ export declare const StorageTableSchema: z.ZodObject<{
5
+ name: z.ZodString;
6
+ owner: z.ZodNullable<z.ZodString>;
7
+ rows: z.ZodNumber;
8
+ bytes: z.ZodNullable<z.ZodNumber>;
9
+ declaredThisBoot: z.ZodBoolean;
10
+ }, z.core.$strip>;
11
+ export type StorageTable = z.infer<typeof StorageTableSchema>;
12
+ /**
13
+ * The collections retired by exact name: the D870 ones (their data became keys
14
+ * of the camera's settings) and the three D871 leftovers (the `stats-5m` tables
15
+ * superseded by `stats-5m-v2`, and the unread `vec_object_clip`). No addon
16
+ * declares any of them any more; the engine still refuses one a running addon
17
+ * declared this boot. `dropCollection` may remove these, the
18
+ * per-addon scoped `addon-settings` / `addon-devices` / `sections` tables, and
19
+ * the tables of owners that are no longer installed - nothing else.
20
+ */
21
+ export declare const STORAGE_ADMIN_MOVED_COLLECTIONS: readonly string[];
22
+ /** The per-addon blob tables a scoped name may carry. */
23
+ export declare const STORAGE_ADMIN_SCOPED_BASES: readonly string[];
24
+ /**
25
+ * storage-admin - the operator's maintenance reach into the settings database:
26
+ * list its tables, drop one that nothing owns any more (D870).
27
+ *
28
+ * Hub-only, internal and `auth: 'admin'` explicitly (`internal` does not gate
29
+ * the mount, see `data-store-provider`). Both methods are LOGGED by the engine
30
+ * with the table and the counts. `dropCollection` is a ONE-SHOT of the D870
31
+ * migration and is marked for removal once the last hub has run it.
32
+ *
33
+ * `listTables` is READ-ONLY: it never creates a table, which `count` and `get`
34
+ * on an undeclared scoped name used to do.
35
+ */
36
+ export declare const storageAdminCapability: {
37
+ readonly name: 'storage-admin';
38
+ readonly scope: 'system';
39
+ readonly mode: 'singleton';
40
+ readonly internal: true;
41
+ readonly methods: {
42
+ /**
43
+ * Every table of the settings database with its row count and size,
44
+ * optionally only those owned by `ownerPrefix`. Reads only.
45
+ */
46
+ readonly listTables: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
47
+ ownerPrefix: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ tables: z.ZodArray<z.ZodObject<{
50
+ name: z.ZodString;
51
+ owner: z.ZodNullable<z.ZodString>;
52
+ rows: z.ZodNumber;
53
+ bytes: z.ZodNullable<z.ZodNumber>;
54
+ declaredThisBoot: z.ZodBoolean;
55
+ }, z.core.$strip>>;
56
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
57
+ /**
58
+ * Drop one table. REFUSES when an addon declared it since the engine
59
+ * started (a running addon still owns it), when it is an engine or
60
+ * canonical table, when it does not exist, or when its row count is not
61
+ * `expectRows` - the caller states what it believes it is deleting. The
62
+ * engine also refuses anything but `<owner>:(addon-settings|addon-devices|
63
+ * sections)`, the retired collections by name, and tables of owners that
64
+ * are not installed (and refuses when it cannot read the installed list).
65
+ * Removed with the D870 migration script once the last hub ran it.
66
+ */
67
+ readonly dropCollection: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
68
+ collection: z.ZodString;
69
+ expectRows: z.ZodNumber;
70
+ }, z.core.$strip>, z.ZodObject<{
71
+ dropped: z.ZodLiteral<true>;
72
+ rows: z.ZodNumber;
73
+ }, z.core.$strip>, "mutation">;
74
+ };
75
+ };
76
+ export type IStorageAdminProvider = InferProvider<typeof storageAdminCapability>;
package/dist/client.js CHANGED
@@ -27796,6 +27796,7 @@ function createSystemProxy(api) {
27796
27796
  listAudit: (input) => dispatch("keychainAdmin", "listAudit", "query", input),
27797
27797
  reveal: (input) => dispatch("keychainAdmin", "reveal", "mutation", input),
27798
27798
  setSystemSecret: (input) => dispatch("keychainAdmin", "setSystemSecret", "mutation", input),
27799
+ importSecret: (input) => dispatch("keychainAdmin", "importSecret", "mutation", input),
27799
27800
  deleteOrphans: (input) => dispatch("keychainAdmin", "deleteOrphans", "mutation", input),
27800
27801
  rotateMasterKey: (input) => dispatch("keychainAdmin", "rotateMasterKey", "mutation", input),
27801
27802
  purgeRetiredKeys: (input) => dispatch("keychainAdmin", "purgeRetiredKeys", "mutation", input),
package/dist/client.mjs CHANGED
@@ -27795,6 +27795,7 @@ function createSystemProxy(api) {
27795
27795
  listAudit: (input) => dispatch("keychainAdmin", "listAudit", "query", input),
27796
27796
  reveal: (input) => dispatch("keychainAdmin", "reveal", "mutation", input),
27797
27797
  setSystemSecret: (input) => dispatch("keychainAdmin", "setSystemSecret", "mutation", input),
27798
+ importSecret: (input) => dispatch("keychainAdmin", "importSecret", "mutation", input),
27798
27799
  deleteOrphans: (input) => dispatch("keychainAdmin", "deleteOrphans", "mutation", input),
27799
27800
  rotateMasterKey: (input) => dispatch("keychainAdmin", "rotateMasterKey", "mutation", input),
27800
27801
  purgeRetiredKeys: (input) => dispatch("keychainAdmin", "purgeRetiredKeys", "mutation", input),
@@ -117,6 +117,7 @@ import type { settingsStoreCapability } from '../capabilities/settings-store.cap
117
117
  import type { smtpProviderCapability } from '../capabilities/smtp-provider.cap.js';
118
118
  import type { snapshotCapability } from '../capabilities/snapshot.cap.js';
119
119
  import type { ssoBridgeCapability } from '../capabilities/sso-bridge.cap.js';
120
+ import type { storageAdminCapability } from '../capabilities/storage-admin.cap.js';
120
121
  import type { storageEvictableCapability } from '../capabilities/storage-evictable.cap.js';
121
122
  import type { storageMigrationCapability } from '../capabilities/storage-migration.cap.js';
122
123
  import type { storageOccupancyCapability } from '../capabilities/storage-occupancy.cap.js';
@@ -3986,6 +3987,13 @@ export type AppRouter = TrpcCoreRouter<{
3986
3987
  output: z.infer<typeof keychainAdminCapability.methods.setSystemSecret.output>;
3987
3988
  meta: object;
3988
3989
  }>;
3990
+ importSecret: TRPCMutationProcedure<{
3991
+ input: {
3992
+ [x: string]: unknown;
3993
+ } & z.input<typeof keychainAdminCapability.methods.importSecret.input>;
3994
+ output: z.infer<typeof keychainAdminCapability.methods.importSecret.output>;
3995
+ meta: object;
3996
+ }>;
3989
3997
  deleteOrphans: TRPCMutationProcedure<{
3990
3998
  input: {
3991
3999
  [x: string]: unknown;
@@ -8812,6 +8820,27 @@ export type AppRouter = TrpcCoreRouter<{
8812
8820
  meta: object;
8813
8821
  }>;
8814
8822
  }>>;
8823
+ storageAdmin: TRPCBuiltRouter<{
8824
+ ctx: TrpcContext;
8825
+ meta: object;
8826
+ errorShape: AugmentedErrorShape;
8827
+ transformer: true;
8828
+ }, TRPCDecorateCreateRouterOptions<{
8829
+ listTables: TRPCQueryProcedure<{
8830
+ input: {
8831
+ [x: string]: unknown;
8832
+ } & z.input<typeof storageAdminCapability.methods.listTables.input>;
8833
+ output: z.infer<typeof storageAdminCapability.methods.listTables.output>;
8834
+ meta: object;
8835
+ }>;
8836
+ dropCollection: TRPCMutationProcedure<{
8837
+ input: {
8838
+ [x: string]: unknown;
8839
+ } & z.input<typeof storageAdminCapability.methods.dropCollection.input>;
8840
+ output: z.infer<typeof storageAdminCapability.methods.dropCollection.output>;
8841
+ meta: object;
8842
+ }>;
8843
+ }>>;
8815
8844
  storageEvictable: TRPCBuiltRouter<{
8816
8845
  ctx: TrpcContext;
8817
8846
  meta: object;
@@ -140,6 +140,7 @@ export { smtpProviderCapability } from '../capabilities/smtp-provider.cap.js';
140
140
  export { snapshotCapability } from '../capabilities/snapshot.cap.js';
141
141
  export { ssoBridgeCapability } from '../capabilities/sso-bridge.cap.js';
142
142
  export { storageCapability } from '../capabilities/storage.cap.js';
143
+ export { storageAdminCapability } from '../capabilities/storage-admin.cap.js';
143
144
  export { storageEvictableCapability } from '../capabilities/storage-evictable.cap.js';
144
145
  export { storageMigrationCapability } from '../capabilities/storage-migration.cap.js';
145
146
  export { storageOccupancyCapability } from '../capabilities/storage-occupancy.cap.js';
@@ -315,6 +316,7 @@ export declare const CAPABILITY_NAMES: {
315
316
  readonly snapshot: 'snapshot';
316
317
  readonly ssoBridge: 'sso-bridge';
317
318
  readonly storage: 'storage';
319
+ readonly storageAdmin: 'storage-admin';
318
320
  readonly storageEvictable: 'storage-evictable';
319
321
  readonly storageMigration: 'storage-migration';
320
322
  readonly storageOccupancy: 'storage-occupancy';
@@ -503,6 +505,7 @@ export interface CapabilityRouterMap<TRouter = unknown> {
503
505
  readonly snapshot: TRouter;
504
506
  readonly ssoBridge: TRouter;
505
507
  readonly storage: TRouter;
508
+ readonly storageAdmin: TRouter;
506
509
  readonly storageEvictable: TRouter;
507
510
  readonly storageMigration: TRouter;
508
511
  readonly storageOccupancy: TRouter;
@@ -536,8 +539,8 @@ export interface CapabilityRouterMap<TRouter = unknown> {
536
539
  readonly zoneRules: TRouter;
537
540
  readonly zones: TRouter;
538
541
  }
539
- /** Capability names whose mode is `singleton` (140 caps). */
540
- export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-adoption', 'device-credentials', 'device-discovery', 'device-history', 'device-manager', 'device-ops', 'device-state', 'device-status', 'doorbell', 'enum-sensor', 'event-emitter', 'face-gallery', 'fan-control', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'media-player', 'metrics-provider', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'oidc-connections', 'osd', 'osd-manager', 'pet-feeder', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'reboot', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'scene-monitor', 'script-runner', 'server-management', 'settings-store', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tamper', 'temperature-sensor', 'terminal-session', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'webrtc-session', 'zone-analytics', 'zone-rules', 'zones'];
542
+ /** Capability names whose mode is `singleton` (141 caps). */
543
+ export declare const SINGLETON_CAPABILITY_NAMES: readonly ['accessories', 'addon-pages', 'addon-settings', 'addon-widgets', 'addons', 'admin-ui', 'air-quality-sensor', 'alarm-panel', 'alerts', 'ambient-light-sensor', 'audio-analysis', 'audio-analyzer', 'audio-codec', 'audio-metrics', 'automation-control', 'backup', 'battery', 'binary', 'brightness', 'button', 'calendars', 'camera-credentials', 'camera-grid-layout', 'camera-pipeline-config', 'camera-streams', 'carbon-monoxide', 'climate-control', 'color', 'composer', 'connectivity', 'consumables', 'contact', 'control', 'core-blocks', 'cover', 'database-snapshot', 'day-night', 'decoder', 'detection-pipeline', 'device-admin-link', 'device-adoption', 'device-credentials', 'device-discovery', 'device-history', 'device-manager', 'device-ops', 'device-state', 'device-status', 'doorbell', 'enum-sensor', 'event-emitter', 'face-gallery', 'fan-control', 'feature-probe', 'filesystem-browse', 'flood', 'gas', 'humidifier', 'humidity-sensor', 'image', 'image-settings', 'integrations', 'intercom', 'keychain', 'keychain-admin', 'lawn-mower-control', 'llm-runtime', 'local-network', 'lock-control', 'media-player', 'metrics-provider', 'model-convert', 'model-distributor', 'motion', 'motion-detection', 'motion-trigger', 'motion-zones', 'native-object-detection', 'navigation', 'network-link', 'network-quality', 'node-certificates', 'nodes', 'notification-rules', 'notifier', 'numeric-sensor', 'oidc-connections', 'osd', 'osd-manager', 'pet-feeder', 'pipeline-analytics', 'pipeline-executor', 'pipeline-orchestrator', 'pipeline-runner', 'plate-gallery', 'platform-probe', 'power-meter', 'presence', 'pressure-sensor', 'privacy-mask', 'ptz', 'ptz-autotrack', 'reboot', 'recording-archive', 'recording-export', 'recording-onboard', 'recording-signal', 'scene-monitor', 'script-runner', 'server-management', 'settings-store', 'smoke', 'snapshot', 'sso-bridge', 'storage', 'storage-admin', 'storage-migration', 'stream-broker', 'stream-catalog', 'stream-params', 'stream-signals', 'switch', 'system', 'tamper', 'temperature-sensor', 'terminal-session', 'toast', 'training', 'update', 'user-management', 'vacuum-control', 'valve', 'vector-store', 'vibration', 'viewer-ui', 'water-heater', 'weather', 'webrtc-session', 'zone-analytics', 'zone-rules', 'zones'];
541
544
  /** Union of singleton capability names (literal string union). */
542
545
  export type SingletonCapabilityName = typeof SINGLETON_CAPABILITY_NAMES[number];
543
546
  /** Capability names whose mode is `collection` (34 caps). */
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 1338 method paths across 174 capabilities.
9
+ * Coverage: 1341 method paths across 175 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -83,7 +83,7 @@ export interface SystemProxy {
83
83
  readonly deviceState: Pick<InferProvider<typeof deviceStateCapability>, 'getAllSnapshots' | 'listClaims'>;
84
84
  readonly faceGallery: Pick<InferProvider<typeof faceGalleryCapability>, 'listIdentities' | 'createIdentity' | 'renameIdentity' | 'deleteIdentity' | 'listIdentitySamples' | 'auditIdentitySamples' | 'removeSample' | 'getFaceMedia' | 'assignFace' | 'unassignFace' | 'deleteFace' | 'assignFaces' | 'unassignFaces' | 'suggestFaceClusters'>;
85
85
  readonly integrations: Pick<InferProvider<typeof integrationsCapability>, 'list' | 'get' | 'getByAddonId' | 'create' | 'update' | 'delete' | 'getSettings' | 'setSettings' | 'getAvailableTypes' | 'testConnection'>;
86
- readonly keychainAdmin: Pick<InferProvider<typeof keychainAdminCapability>, 'status' | 'listSecrets' | 'listAudit' | 'reveal' | 'setSystemSecret' | 'deleteOrphans' | 'rotateMasterKey' | 'purgeRetiredKeys' | 'downloadRecoveryKey' | 'resetKeychain' | 'resetReport' | 'acknowledgeReset'>;
86
+ readonly keychainAdmin: Pick<InferProvider<typeof keychainAdminCapability>, 'status' | 'listSecrets' | 'listAudit' | 'reveal' | 'setSystemSecret' | 'importSecret' | 'deleteOrphans' | 'rotateMasterKey' | 'purgeRetiredKeys' | 'downloadRecoveryKey' | 'resetKeychain' | 'resetReport' | 'acknowledgeReset'>;
87
87
  readonly llm: Pick<InferProvider<typeof llmCapability>, 'generate' | 'generateVision' | 'cancel' | 'listProfileKinds' | 'listProfiles' | 'upsertProfile' | 'deleteProfile' | 'testProfile' | 'listModels' | 'getDefaults' | 'setDefault' | 'getUsage' | 'listModelCatalog' | 'listRuntimeNodes' | 'listNodeModels' | 'resolveModelRef' | 'installModel' | 'deleteModel' | 'getRuntimeStatus' | 'startRuntime' | 'stopRuntime'>;
88
88
  readonly localNetwork: Pick<InferProvider<typeof localNetworkCapability>, 'list' | 'getPreferred' | 'getConnectionEndpoints' | 'getNotificationEndpoint' | 'setNotificationEndpoint' | 'getViewerEndpoints' | 'setViewerEndpoints' | 'getAddresses' | 'addCustomAddress' | 'removeCustomAddress' | 'setAddressRole' | 'getHubAddresses' | 'getAllowedAddresses' | 'setAllowedAddresses' | 'resetAllowlistToBestMatch' | 'getTlsStatus' | 'regenerateCertificate' | 'uploadCertificate' | 'downloadCa' | 'useStoredUploadedCertificate' | 'revertToGeneratedCertificate'>;
89
89
  readonly meshNetwork: Pick<InferProvider<typeof meshNetworkCapability>, 'getStatus' | 'join' | 'startLogin' | 'leave' | 'logout' | 'listPeers' | 'testConnection'>;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from './audio/audio-chunk-format.js';
2
2
  export type { EventOwnerType, MediaOwnerKey, MediaOwnerKeyInput, MediaOwnerType, MediaPresenceOwnerKind, } from './media/media-owner-key.js';
3
3
  export { EVENT_OWNER_TYPES, EventOwnerTypeSchema, MEDIA_OWNER_TYPES, MEDIA_PRESENCE_OWNER_KINDS, MediaPresenceOwnerKindSchema, formatMediaOwnerKey, isEventOwnerType, isMediaOwnerType, parseMediaOwnerKey, } from './media/media-owner-key.js';
4
4
  export type { CapabilitiesAccess } from './addon/base-addon.js';
5
- export { BaseAddon, normalizeAddonInitResult } from './addon/base-addon.js';
5
+ export { BaseAddon, classifyStoreError, normalizeAddonInitResult } from './addon/base-addon.js';
6
6
  export { normalizeNodeId } from './addon/per-node-store.js';
7
7
  export type { AddonRouteInvokeRequest, AddonRouteReplyEnvelope, } from './addon/build-addon-route-provider.js';
8
8
  export { buildAddonRouteProvider } from './addon/build-addon-route-provider.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-rqlHXgwb.js");
2
+ const require_sleep = require("./sleep-Dq0Uyeh0.js");
3
3
  const require_event_category = require("./event-category-T43rdQWR.js");
4
4
  const require_composition = require("./composition-DIp0uE_b.js");
5
5
  const require_node_color = require("./node-color.js");
@@ -13900,6 +13900,91 @@ id: zod.z.union([zod.z.string(), zod.z.number()]) }), {
13900
13900
  }
13901
13901
  };
13902
13902
  //#endregion
13903
+ //#region src/capabilities/storage-admin.cap.ts
13904
+ /** One table of the settings database. */
13905
+ var StorageTableSchema = zod.z.object({
13906
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
13907
+ name: zod.z.string(),
13908
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
13909
+ owner: zod.z.string().nullable(),
13910
+ rows: zod.z.number().int().nonnegative(),
13911
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
13912
+ bytes: zod.z.number().int().nonnegative().nullable(),
13913
+ /** Declared by an addon since this engine process started (a running addon claims it). */
13914
+ declaredThisBoot: zod.z.boolean()
13915
+ });
13916
+ /**
13917
+ * The collections retired by exact name: the D870 ones (their data became keys
13918
+ * of the camera's settings) and the three D871 leftovers (the `stats-5m` tables
13919
+ * superseded by `stats-5m-v2`, and the unread `vec_object_clip`). No addon
13920
+ * declares any of them any more; the engine still refuses one a running addon
13921
+ * declared this boot. `dropCollection` may remove these, the
13922
+ * per-addon scoped `addon-settings` / `addon-devices` / `sections` tables, and
13923
+ * the tables of owners that are no longer installed - nothing else.
13924
+ */
13925
+ var STORAGE_ADMIN_MOVED_COLLECTIONS = [
13926
+ "stream-broker:probe-snapshots",
13927
+ "stream-broker:profile-map",
13928
+ "stream-broker:rtsp-tokens",
13929
+ "notification-center:device-mutes",
13930
+ "recorder:recording-configs",
13931
+ "pipeline-orchestrator:device-features",
13932
+ "pipeline-analytics:stats-5m",
13933
+ "pipeline-orchestrator:stats-5m",
13934
+ "vec_object_clip"
13935
+ ];
13936
+ /** The per-addon blob tables a scoped name may carry. */
13937
+ var STORAGE_ADMIN_SCOPED_BASES = [
13938
+ "addon-settings",
13939
+ "addon-devices",
13940
+ "sections"
13941
+ ];
13942
+ /**
13943
+ * storage-admin - the operator's maintenance reach into the settings database:
13944
+ * list its tables, drop one that nothing owns any more (D870).
13945
+ *
13946
+ * Hub-only, internal and `auth: 'admin'` explicitly (`internal` does not gate
13947
+ * the mount, see `data-store-provider`). Both methods are LOGGED by the engine
13948
+ * with the table and the counts. `dropCollection` is a ONE-SHOT of the D870
13949
+ * migration and is marked for removal once the last hub has run it.
13950
+ *
13951
+ * `listTables` is READ-ONLY: it never creates a table, which `count` and `get`
13952
+ * on an undeclared scoped name used to do.
13953
+ */
13954
+ var storageAdminCapability = {
13955
+ name: "storage-admin",
13956
+ scope: "system",
13957
+ mode: "singleton",
13958
+ internal: true,
13959
+ methods: {
13960
+ /**
13961
+ * Every table of the settings database with its row count and size,
13962
+ * optionally only those owned by `ownerPrefix`. Reads only.
13963
+ */
13964
+ listTables: require_sleep.method(zod.z.object({ ownerPrefix: zod.z.string().min(1).optional() }), zod.z.object({ tables: zod.z.array(StorageTableSchema) }), { auth: "admin" }),
13965
+ /**
13966
+ * Drop one table. REFUSES when an addon declared it since the engine
13967
+ * started (a running addon still owns it), when it is an engine or
13968
+ * canonical table, when it does not exist, or when its row count is not
13969
+ * `expectRows` - the caller states what it believes it is deleting. The
13970
+ * engine also refuses anything but `<owner>:(addon-settings|addon-devices|
13971
+ * sections)`, the retired collections by name, and tables of owners that
13972
+ * are not installed (and refuses when it cannot read the installed list).
13973
+ * Removed with the D870 migration script once the last hub ran it.
13974
+ */
13975
+ dropCollection: require_sleep.method(zod.z.object({
13976
+ collection: zod.z.string().min(1),
13977
+ expectRows: zod.z.number().int().nonnegative()
13978
+ }), zod.z.object({
13979
+ dropped: zod.z.literal(true),
13980
+ rows: zod.z.number().int().nonnegative()
13981
+ }), {
13982
+ kind: "mutation",
13983
+ auth: "admin"
13984
+ })
13985
+ }
13986
+ };
13987
+ //#endregion
13903
13988
  //#region src/capabilities/keychain.cap.ts
13904
13989
  /**
13905
13990
  * `keychain` — the hub's encrypted store of secret values (D787).
@@ -14647,6 +14732,24 @@ var keychainAdminCapability = {
14647
14732
  auth: "admin",
14648
14733
  caller: "required"
14649
14734
  }),
14735
+ /**
14736
+ * Store a value an operator tool carries over from a retired store at an
14737
+ * addon's own ref (`secret://<owner>/<scope>/<path>`) and answer the ref -
14738
+ * the D870 migration moves a camera's restream tokens this way, so they
14739
+ * never sit in a settings row as plaintext. Audited as the operator; the
14740
+ * caller then writes the MARKER of the ref where the value used to be.
14741
+ */
14742
+ importSecret: require_sleep.method(zod.z.object({
14743
+ ref: zod.z.string().min(1),
14744
+ value: zod.z.string().min(1)
14745
+ }), zod.z.object({
14746
+ ref: zod.z.string(),
14747
+ version: zod.z.number().int()
14748
+ }), {
14749
+ kind: "mutation",
14750
+ auth: "admin",
14751
+ caller: "required"
14752
+ }),
14650
14753
  /** Delete refs no owner points at any more. Re-checked here; `unknown` is kept. */
14651
14754
  deleteOrphans: require_sleep.method(zod.z.object({ refs: zod.z.array(zod.z.string().min(1)).max(1e3) }), zod.z.object({
14652
14755
  deleted: zod.z.array(zod.z.string()).readonly(),
@@ -79399,6 +79502,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
79399
79502
  addonId: null,
79400
79503
  access: "create"
79401
79504
  },
79505
+ "keychainAdmin.importSecret": {
79506
+ capName: "keychain-admin",
79507
+ capScope: "system",
79508
+ addonId: null,
79509
+ access: "create"
79510
+ },
79402
79511
  "keychainAdmin.listAudit": {
79403
79512
  capName: "keychain-admin",
79404
79513
  capScope: "system",
@@ -83185,6 +83294,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
83185
83294
  addonId: null,
83186
83295
  access: "create"
83187
83296
  },
83297
+ "storageAdmin.dropCollection": {
83298
+ capName: "storage-admin",
83299
+ capScope: "system",
83300
+ addonId: null,
83301
+ access: "delete"
83302
+ },
83303
+ "storageAdmin.listTables": {
83304
+ capName: "storage-admin",
83305
+ capScope: "system",
83306
+ addonId: null,
83307
+ access: "view"
83308
+ },
83188
83309
  "storageEvictable.evict": {
83189
83310
  capName: "storage-evictable",
83190
83311
  capScope: "system",
@@ -84740,6 +84861,7 @@ var KNOWN_CAP_NAMES = [
84740
84861
  "snapshot",
84741
84862
  "sso-bridge",
84742
84863
  "storage",
84864
+ "storage-admin",
84743
84865
  "storage-evictable",
84744
84866
  "storage-migration",
84745
84867
  "storage-occupancy",
@@ -84937,6 +85059,7 @@ var SYSTEM_CAP_NAMES = [
84937
85059
  "smtp-provider",
84938
85060
  "sso-bridge",
84939
85061
  "storage",
85062
+ "storage-admin",
84940
85063
  "storage-evictable",
84941
85064
  "storage-migration",
84942
85065
  "storage-occupancy",
@@ -87012,6 +87135,7 @@ var CAPABILITY_NAMES = {
87012
87135
  snapshot: "snapshot",
87013
87136
  ssoBridge: "sso-bridge",
87014
87137
  storage: "storage",
87138
+ storageAdmin: "storage-admin",
87015
87139
  storageEvictable: "storage-evictable",
87016
87140
  storageMigration: "storage-migration",
87017
87141
  storageOccupancy: "storage-occupancy",
@@ -87615,6 +87739,10 @@ var CAPABILITY_ROUTER_KEYS = [
87615
87739
  key: "storage",
87616
87740
  name: "storage"
87617
87741
  },
87742
+ {
87743
+ key: "storageAdmin",
87744
+ name: "storage-admin"
87745
+ },
87618
87746
  {
87619
87747
  key: "storageEvictable",
87620
87748
  name: "storage-evictable"
@@ -87896,6 +88024,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
87896
88024
  snapshotCapability,
87897
88025
  ssoBridgeCapability,
87898
88026
  storageCapability,
88027
+ storageAdminCapability,
87899
88028
  storageEvictableCapability,
87900
88029
  storageMigrationCapability,
87901
88030
  storageOccupancyCapability,
@@ -91954,6 +92083,7 @@ function createSystemProxy(api) {
91954
92083
  listAudit: (input) => dispatch("keychainAdmin", "listAudit", "query", input),
91955
92084
  reveal: (input) => dispatch("keychainAdmin", "reveal", "mutation", input),
91956
92085
  setSystemSecret: (input) => dispatch("keychainAdmin", "setSystemSecret", "mutation", input),
92086
+ importSecret: (input) => dispatch("keychainAdmin", "importSecret", "mutation", input),
91957
92087
  deleteOrphans: (input) => dispatch("keychainAdmin", "deleteOrphans", "mutation", input),
91958
92088
  rotateMasterKey: (input) => dispatch("keychainAdmin", "rotateMasterKey", "mutation", input),
91959
92089
  purgeRetiredKeys: (input) => dispatch("keychainAdmin", "purgeRetiredKeys", "mutation", input),
@@ -102590,6 +102720,8 @@ exports.STATE_LABELS = STATE_LABELS;
102590
102720
  exports.STATE_LABEL_KEYS = STATE_LABEL_KEYS;
102591
102721
  exports.STATIONARY_OVERLAY_STYLE = STATIONARY_OVERLAY_STYLE;
102592
102722
  exports.STORAGE_ACCESS_FALLBACK = STORAGE_ACCESS_FALLBACK;
102723
+ exports.STORAGE_ADMIN_MOVED_COLLECTIONS = STORAGE_ADMIN_MOVED_COLLECTIONS;
102724
+ exports.STORAGE_ADMIN_SCOPED_BASES = STORAGE_ADMIN_SCOPED_BASES;
102593
102725
  exports.STORAGE_BYTES_PER_GB = STORAGE_BYTES_PER_GB;
102594
102726
  exports.STORAGE_LOCATION_MODES = STORAGE_LOCATION_MODES;
102595
102727
  exports.STREAM_PROFILE_META = STREAM_PROFILE_META;
@@ -102697,6 +102829,7 @@ exports.StorageMigrationSourcesSchema = StorageMigrationSourcesSchema;
102697
102829
  exports.StorageOccupancyReportSchema = StorageOccupancyReportSchema;
102698
102830
  exports.StorageProviderInfoSchema = ProviderInfoSchema;
102699
102831
  exports.StorageReadChunkInputSchema = ReadChunkInputSchema;
102832
+ exports.StorageTableSchema = StorageTableSchema;
102700
102833
  exports.StorageTestLocationResultSchema = TestLocationResultSchema;
102701
102834
  exports.StorageWriteChunkInputSchema = WriteChunkInputSchema;
102702
102835
  exports.StreamCodecSchema = StreamCodecSchema;
@@ -102999,6 +103132,7 @@ exports.classifyCamerasForBenchmark = classifyCamerasForBenchmark;
102999
103132
  exports.classifyInferenceHardware = classifyInferenceHardware;
103000
103133
  exports.classifyRetrainReview = classifyRetrainReview;
103001
103134
  exports.classifySecretWrite = require_sleep.classifySecretWrite;
103135
+ exports.classifyStoreError = require_sleep.classifyStoreError;
103002
103136
  exports.classifyStream = classifyStream;
103003
103137
  exports.classifyStreams = classifyStreams;
103004
103138
  exports.clearKnownSecrets = require_sleep.clearKnownSecrets;
@@ -103624,6 +103758,7 @@ exports.stateLabel = stateLabel;
103624
103758
  exports.stateVocabularyFor = stateVocabularyFor;
103625
103759
  exports.stepModelRunsOnFormat = stepModelRunsOnFormat;
103626
103760
  exports.stepSettingSource = stepSettingSource;
103761
+ exports.storageAdminCapability = storageAdminCapability;
103627
103762
  exports.storageCapability = storageCapability;
103628
103763
  exports.storageEvictableCapability = storageEvictableCapability;
103629
103764
  exports.storageMigrationCapability = storageMigrationCapability;