@camstack/system 1.2.328 → 1.2.329
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.
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +7 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +294 -79
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +294 -79
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +4 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/sqlite-storage/sqlite-snapshot-protocol.d.ts +49 -0
- package/dist/builtins/sqlite-storage/sqlite-snapshot-worker.d.ts +33 -0
- package/dist/builtins/sqlite-storage/sqlite-snapshotter.d.ts +98 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-backup/system-backup.service.d.ts +74 -20
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-GkgXF6B9.js → composition-sources-B7hfTiPS.js} +1 -1
- package/dist/{composition-sources-I8Rx7woY.mjs → composition-sources-BHPqf6So.mjs} +1 -1
- package/dist/{dist-BUejKKBm.js → dist-CSs0cFDN.js} +496 -337
- package/dist/{dist-DWq17vC8.mjs → dist-CV7IqaYq.mjs} +467 -338
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{retired-settings-keys-DBPEzGop.js → retired-settings-keys-CGQnAoRx.js} +1 -1
- package/dist/{retired-settings-keys-BfHclEyd.mjs → retired-settings-keys-DSUs7U6l.mjs} +1 -1
- package/dist/sqlite-snapshot-protocol-2QaTouWV.mjs +34 -0
- package/dist/sqlite-snapshot-protocol-B9OndqZv.js +51 -0
- package/dist/sqlite-snapshot-worker.js +185 -0
- package/dist/sqlite-snapshot-worker.mjs +179 -0
- package/package.json +5 -2
|
@@ -9334,6 +9334,117 @@ var authProviderCapability = {
|
|
|
9334
9334
|
mount: { kind: "skip" }
|
|
9335
9335
|
};
|
|
9336
9336
|
/**
|
|
9337
|
+
* The suffix of a verified snapshot, written next to the live database it
|
|
9338
|
+
* copies: `<db>.backup-snapshot`. A restore promotes it back over `<db>`
|
|
9339
|
+
* (`server/backend/src/sqlite-restore.ts` spells the same string — the
|
|
9340
|
+
* launcher stays free of `@camstack/*` runtime imports — and a spec pins the
|
|
9341
|
+
* two together).
|
|
9342
|
+
*/
|
|
9343
|
+
var DATABASE_SNAPSHOT_SUFFIX = ".backup-snapshot";
|
|
9344
|
+
/**
|
|
9345
|
+
* The suffix of a copy still being written or verified. A file under this name
|
|
9346
|
+
* is never archived and never promoted: only a copy that passed every check is
|
|
9347
|
+
* renamed to {@link DATABASE_SNAPSHOT_SUFFIX}.
|
|
9348
|
+
*/
|
|
9349
|
+
var DATABASE_SNAPSHOT_PARTIAL_SUFFIX = ".backup-snapshot-partial";
|
|
9350
|
+
/**
|
|
9351
|
+
* How long one snapshot may take end to end: the pinned copy of the whole
|
|
9352
|
+
* database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
|
|
9353
|
+
* disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
|
|
9354
|
+
* generous because a timeout fails the whole backup run.
|
|
9355
|
+
*/
|
|
9356
|
+
var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
|
|
9357
|
+
/**
|
|
9358
|
+
* The databases an owner snapshots — declared by the OWNER, so a caller never
|
|
9359
|
+
* guesses which file is live from what sits beside it (a cleanly closed
|
|
9360
|
+
* database has no sidecars and is just as owned). Paths are absolute on the
|
|
9361
|
+
* owner's host.
|
|
9362
|
+
*/
|
|
9363
|
+
var DatabaseSnapshotTargetsSchema = zod.z.object({ databases: zod.z.array(zod.z.object({ livePath: zod.z.string() })) });
|
|
9364
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
9365
|
+
var DatabaseSnapshotTableSchema = zod.z.object({
|
|
9366
|
+
name: zod.z.string(),
|
|
9367
|
+
rows: zod.z.number().int().nonnegative()
|
|
9368
|
+
});
|
|
9369
|
+
/**
|
|
9370
|
+
* What the owner wrote. Every path is ABSOLUTE on the owner's host — the
|
|
9371
|
+
* caller pins the call to its own node, so it can read the file; a caller
|
|
9372
|
+
* that finds the path outside its own data root refuses it rather than
|
|
9373
|
+
* archiving something it cannot place.
|
|
9374
|
+
*/
|
|
9375
|
+
var DatabaseSnapshotResultSchema = zod.z.object({
|
|
9376
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
9377
|
+
livePath: zod.z.string(),
|
|
9378
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
9379
|
+
snapshotPath: zod.z.string(),
|
|
9380
|
+
sizeBytes: zod.z.number().int().nonnegative(),
|
|
9381
|
+
pageCount: zod.z.number().int().nonnegative(),
|
|
9382
|
+
pageSize: zod.z.number().int().positive(),
|
|
9383
|
+
/**
|
|
9384
|
+
* Every b-tree table with its row count. Read inside the SAME read
|
|
9385
|
+
* transaction the copy was taken from, and found EQUAL on the copy — so
|
|
9386
|
+
* this is the content of the snapshot, not an estimate of the source.
|
|
9387
|
+
*/
|
|
9388
|
+
tables: zod.z.array(DatabaseSnapshotTableSchema),
|
|
9389
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
9390
|
+
copyMs: zod.z.number().nonnegative(),
|
|
9391
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
9392
|
+
verifyMs: zod.z.number().nonnegative(),
|
|
9393
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
9394
|
+
takenAt: zod.z.number()
|
|
9395
|
+
});
|
|
9396
|
+
/**
|
|
9397
|
+
* A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
|
|
9398
|
+
* the same facts, with both paths relative to the archive root (the node's
|
|
9399
|
+
* data dir), because an archive outlives the host that made it.
|
|
9400
|
+
*/
|
|
9401
|
+
var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
|
|
9402
|
+
/** Archive-relative path of the live database the archive does NOT carry. */
|
|
9403
|
+
livePath: zod.z.string(),
|
|
9404
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
9405
|
+
snapshotPath: zod.z.string()
|
|
9406
|
+
});
|
|
9407
|
+
/**
|
|
9408
|
+
* database-snapshot — the OWNER of a live SQLite database writes a consistent,
|
|
9409
|
+
* verified copy of it (D693).
|
|
9410
|
+
*
|
|
9411
|
+
* A live database cannot be copied as files: three files written by a live
|
|
9412
|
+
* process cannot be read at one instant from outside it, and a tar of the
|
|
9413
|
+
* `.db` / `-wal` / `-shm` trio was measured torn in 6/6 archives (D679). Nor may
|
|
9414
|
+
* another process open it (D679 rule 2). So the process that owns the
|
|
9415
|
+
* connection writes the copy — through its own connection, on a thread,
|
|
9416
|
+
* pinned to one read transaction — and checks it before handing it out.
|
|
9417
|
+
*
|
|
9418
|
+
* Hub-only and internal: `sqlite-settings` is the registrant, and its consumer
|
|
9419
|
+
* is `backup-orchestrator`, which calls it pinned to its own node so the path
|
|
9420
|
+
* it gets back is on its own host. `auth: 'admin'` explicitly — `internal`
|
|
9421
|
+
* does not gate the mount (see `data-store-provider`).
|
|
9422
|
+
*/
|
|
9423
|
+
var databaseSnapshotCapability = {
|
|
9424
|
+
name: "database-snapshot",
|
|
9425
|
+
scope: "system",
|
|
9426
|
+
mode: "singleton",
|
|
9427
|
+
internal: true,
|
|
9428
|
+
methods: {
|
|
9429
|
+
/**
|
|
9430
|
+
* Which databases this owner snapshots. Answered from memory — no file is
|
|
9431
|
+
* touched — so a backup can ask it before deciding anything.
|
|
9432
|
+
*/
|
|
9433
|
+
listDatabases: method(zod.z.object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }),
|
|
9434
|
+
/**
|
|
9435
|
+
* Write `<db>.backup-snapshot` and return what it holds. Throws — and
|
|
9436
|
+
* leaves no file under the final name — when the copy fails
|
|
9437
|
+
* `integrity_check` or its row counts differ from the pinned source's.
|
|
9438
|
+
* A second call while one is running joins it.
|
|
9439
|
+
*/
|
|
9440
|
+
writeSnapshot: method(zod.z.object({}), DatabaseSnapshotResultSchema, {
|
|
9441
|
+
kind: "mutation",
|
|
9442
|
+
auth: "admin",
|
|
9443
|
+
timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
|
|
9444
|
+
})
|
|
9445
|
+
}
|
|
9446
|
+
};
|
|
9447
|
+
/**
|
|
9337
9448
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
9338
9449
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
9339
9450
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -9444,7 +9555,12 @@ var ArchiveManifestSchema = zod.z.object({
|
|
|
9444
9555
|
locations: zod.z.array(zod.z.string()),
|
|
9445
9556
|
entries: zod.z.array(ArchiveEntrySchema),
|
|
9446
9557
|
totalBytes: zod.z.number(),
|
|
9447
|
-
totalFiles: zod.z.number()
|
|
9558
|
+
totalFiles: zod.z.number(),
|
|
9559
|
+
/**
|
|
9560
|
+
* Live SQLite databases this archive carries as their OWNER's verified
|
|
9561
|
+
* snapshot instead of as files (D693). Absent on archives made before.
|
|
9562
|
+
*/
|
|
9563
|
+
sqliteSnapshots: zod.z.array(ArchiveSqliteSnapshotSchema).optional()
|
|
9448
9564
|
});
|
|
9449
9565
|
var LocationStatSchema = zod.z.object({
|
|
9450
9566
|
name: zod.z.string(),
|
|
@@ -11793,6 +11909,76 @@ var CompositionBlockStateSchema = zod.z.object({
|
|
|
11793
11909
|
reason: zod.z.string().optional(),
|
|
11794
11910
|
fields: zod.z.array(CompositionFieldStateSchema)
|
|
11795
11911
|
});
|
|
11912
|
+
/**
|
|
11913
|
+
* composer — runs every DECLARATIVE composition (D659).
|
|
11914
|
+
*
|
|
11915
|
+
* Internal and admin-only: its one caller is `core-blocks`' supervisor, which
|
|
11916
|
+
* sends the WHOLE set of composition blocks on every converge (idempotent),
|
|
11917
|
+
* and reads their state for the API. Nothing else talks to it.
|
|
11918
|
+
*/
|
|
11919
|
+
/** The composer's runner id, `resolveRunnerId(decl, 'composer')`; pinned by `composer-manifest.spec.ts`. */
|
|
11920
|
+
var COMPOSER_RUNNER_ID = COMPOSER_ADDON_ID;
|
|
11921
|
+
var ComposerBlockSchema = zod.z.object({
|
|
11922
|
+
id: zod.z.string().min(1),
|
|
11923
|
+
name: zod.z.string().min(1).max(120),
|
|
11924
|
+
enabled: zod.z.boolean(),
|
|
11925
|
+
updatedAt: zod.z.number(),
|
|
11926
|
+
composition: CompositionSchema
|
|
11927
|
+
});
|
|
11928
|
+
/**
|
|
11929
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
11930
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
11931
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
11932
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
11933
|
+
*/
|
|
11934
|
+
var ComposerUnreadableBlockSchema = zod.z.object({
|
|
11935
|
+
id: zod.z.string().min(1),
|
|
11936
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
11937
|
+
name: zod.z.string().nullable(),
|
|
11938
|
+
/** The parse error, in the operator's words. */
|
|
11939
|
+
error: zod.z.string()
|
|
11940
|
+
});
|
|
11941
|
+
var ComposerApplyInputSchema = zod.z.object({
|
|
11942
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
11943
|
+
integrationId: zod.z.string().nullable(),
|
|
11944
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
11945
|
+
storeLoaded: zod.z.boolean(),
|
|
11946
|
+
blocks: zod.z.array(ComposerBlockSchema),
|
|
11947
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
11948
|
+
restartBlockIds: zod.z.array(zod.z.string()),
|
|
11949
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
11950
|
+
unreadableBlocks: zod.z.array(ComposerUnreadableBlockSchema)
|
|
11951
|
+
});
|
|
11952
|
+
var ComposerBlockVerdictSchema = zod.z.object({
|
|
11953
|
+
blockId: zod.z.string(),
|
|
11954
|
+
status: CompositionRunStatusSchema,
|
|
11955
|
+
reason: zod.z.string().optional()
|
|
11956
|
+
});
|
|
11957
|
+
var composerCapability = {
|
|
11958
|
+
name: "composer",
|
|
11959
|
+
scope: "system",
|
|
11960
|
+
mode: "singleton",
|
|
11961
|
+
internal: true,
|
|
11962
|
+
methods: {
|
|
11963
|
+
/**
|
|
11964
|
+
* Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
|
|
11965
|
+
* `router({})` throws on one — every cap router is built at boot.
|
|
11966
|
+
*/
|
|
11967
|
+
applyBlocks: method(ComposerApplyInputSchema, zod.z.object({
|
|
11968
|
+
blocks: zod.z.array(ComposerBlockVerdictSchema),
|
|
11969
|
+
/**
|
|
11970
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
11971
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
11972
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
11973
|
+
*/
|
|
11974
|
+
acted: zod.z.boolean()
|
|
11975
|
+
}), {
|
|
11976
|
+
kind: "mutation",
|
|
11977
|
+
auth: "admin"
|
|
11978
|
+
}),
|
|
11979
|
+
getStates: method(zod.z.object({ blockIds: zod.z.array(zod.z.string()) }), zod.z.object({ states: zod.z.array(CompositionBlockStateSchema) }), { auth: "admin" })
|
|
11980
|
+
}
|
|
11981
|
+
};
|
|
11796
11982
|
function problem(code, path, message) {
|
|
11797
11983
|
return {
|
|
11798
11984
|
code,
|
|
@@ -13004,76 +13190,6 @@ var coreBlocksCapability = {
|
|
|
13004
13190
|
}
|
|
13005
13191
|
};
|
|
13006
13192
|
/**
|
|
13007
|
-
* composer — runs every DECLARATIVE composition (D659).
|
|
13008
|
-
*
|
|
13009
|
-
* Internal and admin-only: its one caller is `core-blocks`' supervisor, which
|
|
13010
|
-
* sends the WHOLE set of composition blocks on every converge (idempotent),
|
|
13011
|
-
* and reads their state for the API. Nothing else talks to it.
|
|
13012
|
-
*/
|
|
13013
|
-
/** The composer's runner id, `resolveRunnerId(decl, 'composer')`; pinned by `composer-manifest.spec.ts`. */
|
|
13014
|
-
var COMPOSER_RUNNER_ID = COMPOSER_ADDON_ID;
|
|
13015
|
-
var ComposerBlockSchema = zod.z.object({
|
|
13016
|
-
id: zod.z.string().min(1),
|
|
13017
|
-
name: zod.z.string().min(1).max(120),
|
|
13018
|
-
enabled: zod.z.boolean(),
|
|
13019
|
-
updatedAt: zod.z.number(),
|
|
13020
|
-
composition: CompositionSchema
|
|
13021
|
-
});
|
|
13022
|
-
/**
|
|
13023
|
-
* A stored composition row that no longer PARSES — a schema a release
|
|
13024
|
-
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13025
|
-
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13026
|
-
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13027
|
-
*/
|
|
13028
|
-
var ComposerUnreadableBlockSchema = zod.z.object({
|
|
13029
|
-
id: zod.z.string().min(1),
|
|
13030
|
-
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13031
|
-
name: zod.z.string().nullable(),
|
|
13032
|
-
/** The parse error, in the operator's words. */
|
|
13033
|
-
error: zod.z.string()
|
|
13034
|
-
});
|
|
13035
|
-
var ComposerApplyInputSchema = zod.z.object({
|
|
13036
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13037
|
-
integrationId: zod.z.string().nullable(),
|
|
13038
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13039
|
-
storeLoaded: zod.z.boolean(),
|
|
13040
|
-
blocks: zod.z.array(ComposerBlockSchema),
|
|
13041
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13042
|
-
restartBlockIds: zod.z.array(zod.z.string()),
|
|
13043
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13044
|
-
unreadableBlocks: zod.z.array(ComposerUnreadableBlockSchema)
|
|
13045
|
-
});
|
|
13046
|
-
var ComposerBlockVerdictSchema = zod.z.object({
|
|
13047
|
-
blockId: zod.z.string(),
|
|
13048
|
-
status: CompositionRunStatusSchema,
|
|
13049
|
-
reason: zod.z.string().optional()
|
|
13050
|
-
});
|
|
13051
|
-
var composerCapability = {
|
|
13052
|
-
name: "composer",
|
|
13053
|
-
scope: "system",
|
|
13054
|
-
mode: "singleton",
|
|
13055
|
-
internal: true,
|
|
13056
|
-
methods: {
|
|
13057
|
-
/**
|
|
13058
|
-
* Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
|
|
13059
|
-
* `router({})` throws on one — every cap router is built at boot.
|
|
13060
|
-
*/
|
|
13061
|
-
applyBlocks: method(ComposerApplyInputSchema, zod.z.object({
|
|
13062
|
-
blocks: zod.z.array(ComposerBlockVerdictSchema),
|
|
13063
|
-
/**
|
|
13064
|
-
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13065
|
-
* integration unknown, its own rows unread or read empty once). An empty
|
|
13066
|
-
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13067
|
-
*/
|
|
13068
|
-
acted: zod.z.boolean()
|
|
13069
|
-
}), {
|
|
13070
|
-
kind: "mutation",
|
|
13071
|
-
auth: "admin"
|
|
13072
|
-
}),
|
|
13073
|
-
getStates: method(zod.z.object({ blockIds: zod.z.array(zod.z.string()) }), zod.z.object({ states: zod.z.array(CompositionBlockStateSchema) }), { auth: "admin" })
|
|
13074
|
-
}
|
|
13075
|
-
};
|
|
13076
|
-
/**
|
|
13077
13193
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
13078
13194
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
13079
13195
|
* contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
|
|
@@ -16232,6 +16348,272 @@ var deviceManagerCapability = {
|
|
|
16232
16348
|
}
|
|
16233
16349
|
};
|
|
16234
16350
|
/**
|
|
16351
|
+
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
16352
|
+
* name (same pattern as `snapshot`):
|
|
16353
|
+
*
|
|
16354
|
+
* - **Native** providers: registered per-device by device-driver
|
|
16355
|
+
* addons via `ctx.registerNativeCap` — either on a
|
|
16356
|
+
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
16357
|
+
* or directly on the camera (Reolink registers at camera level).
|
|
16358
|
+
* Emits an `onPressed` event every time the firmware pushes a
|
|
16359
|
+
* ring; status tracks the last press and a pressCount since start
|
|
16360
|
+
* (diagnostic).
|
|
16361
|
+
*
|
|
16362
|
+
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
16363
|
+
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
16364
|
+
* device (contact / switch / event-emitter …) into a doorbell for
|
|
16365
|
+
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
16366
|
+
* it per camera in the device-bindings UI, then picks the source
|
|
16367
|
+
* device + trigger in the per-device settings.
|
|
16368
|
+
*
|
|
16369
|
+
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
16370
|
+
* — subscribers listening at the camera level receive ring events
|
|
16371
|
+
* with `via[]` populated. No code on the parent needed.
|
|
16372
|
+
*/
|
|
16373
|
+
var DoorbellStatusSchema = zod.z.object({
|
|
16374
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
16375
|
+
lastPressedAt: zod.z.number().nullable(),
|
|
16376
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
16377
|
+
pressCountSinceStart: zod.z.number()
|
|
16378
|
+
});
|
|
16379
|
+
var DoorbellPressEventSchema = zod.z.object({
|
|
16380
|
+
deviceId: zod.z.number(),
|
|
16381
|
+
timestamp: zod.z.number()
|
|
16382
|
+
});
|
|
16383
|
+
/**
|
|
16384
|
+
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
16385
|
+
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
16386
|
+
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
16387
|
+
*/
|
|
16388
|
+
var DoorbellSourceSlotValueSchema = zod.z.object({ deviceIds: zod.z.array(zod.z.number().int().positive()) });
|
|
16389
|
+
/**
|
|
16390
|
+
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
16391
|
+
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
16392
|
+
* `doorbellSources` store (D648). A source rings when one of its
|
|
16393
|
+
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
16394
|
+
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
16395
|
+
* reports it, it never writes it.
|
|
16396
|
+
*/
|
|
16397
|
+
var DOORBELL_SOURCE_SLOT = {
|
|
16398
|
+
id: "doorbell-source",
|
|
16399
|
+
label: "Doorbell trigger devices",
|
|
16400
|
+
description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
|
|
16401
|
+
shape: "association",
|
|
16402
|
+
hostDeviceTypes: [DeviceType.Camera],
|
|
16403
|
+
sourceCaps: SOURCE_CAPS,
|
|
16404
|
+
cardinality: "many",
|
|
16405
|
+
value: DoorbellSourceSlotValueSchema
|
|
16406
|
+
};
|
|
16407
|
+
var doorbellCapability = {
|
|
16408
|
+
name: "doorbell",
|
|
16409
|
+
scope: "device",
|
|
16410
|
+
deviceNative: true,
|
|
16411
|
+
mode: "singleton",
|
|
16412
|
+
kind: "wrapper",
|
|
16413
|
+
defaultActive: false,
|
|
16414
|
+
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
16415
|
+
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
16416
|
+
methods: {},
|
|
16417
|
+
events: {
|
|
16418
|
+
/**
|
|
16419
|
+
* Fires once per physical press. Reolink delivers via Baichuan
|
|
16420
|
+
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
16421
|
+
* release/duration — it's a pulse.
|
|
16422
|
+
*/
|
|
16423
|
+
onPressed: {
|
|
16424
|
+
data: DoorbellPressEventSchema,
|
|
16425
|
+
fromState: {
|
|
16426
|
+
field: "lastPressedAt",
|
|
16427
|
+
on: "advance"
|
|
16428
|
+
}
|
|
16429
|
+
} },
|
|
16430
|
+
status: {
|
|
16431
|
+
schema: DoorbellStatusSchema,
|
|
16432
|
+
kind: "push"
|
|
16433
|
+
},
|
|
16434
|
+
/**
|
|
16435
|
+
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
16436
|
+
* Mirrored by the kernel and readable via
|
|
16437
|
+
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
16438
|
+
* without subscribing.
|
|
16439
|
+
*/
|
|
16440
|
+
runtimeState: DoorbellStatusSchema,
|
|
16441
|
+
/**
|
|
16442
|
+
* Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
|
|
16443
|
+
*
|
|
16444
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
16445
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
16446
|
+
*/
|
|
16447
|
+
durability: "restored"
|
|
16448
|
+
};
|
|
16449
|
+
var ExtensionSlotIdSchema = zod.z.enum(["doorbell-source", "linked-devices"]);
|
|
16450
|
+
var EXTENSION_SLOTS = {
|
|
16451
|
+
"doorbell-source": {
|
|
16452
|
+
descriptor: DOORBELL_SOURCE_SLOT,
|
|
16453
|
+
declaringCap: "doorbell",
|
|
16454
|
+
hostDeviceTypes: [DeviceType.Camera]
|
|
16455
|
+
},
|
|
16456
|
+
"linked-devices": {
|
|
16457
|
+
descriptor: LINKED_DEVICES_SLOT,
|
|
16458
|
+
declaringCap: "device-manager",
|
|
16459
|
+
hostDeviceTypes: [DeviceType.Camera]
|
|
16460
|
+
}
|
|
16461
|
+
};
|
|
16462
|
+
/** A slot's editable value, discriminated on `slot`. */
|
|
16463
|
+
var ExtensionSlotValueSchema = zod.z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: zod.z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: zod.z.literal("linked-devices") })]);
|
|
16464
|
+
/** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
|
|
16465
|
+
var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
|
|
16466
|
+
var ExtensionSourceAvailabilitySchema = zod.z.discriminatedUnion("state", [zod.z.object({ state: zod.z.literal("ok") }), zod.z.object({
|
|
16467
|
+
state: zod.z.literal("unreachable"),
|
|
16468
|
+
reason: zod.z.string()
|
|
16469
|
+
})]);
|
|
16470
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16471
|
+
var ExtensionSourceSchema = zod.z.object({
|
|
16472
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16473
|
+
source: zod.z.string(),
|
|
16474
|
+
label: zod.z.string(),
|
|
16475
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16476
|
+
addonId: zod.z.string().optional(),
|
|
16477
|
+
availability: ExtensionSourceAvailabilitySchema
|
|
16478
|
+
});
|
|
16479
|
+
/**
|
|
16480
|
+
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
16481
|
+
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
16482
|
+
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
16483
|
+
* valid source now (a container, which is never a pick). A source in any of
|
|
16484
|
+
* these states is SHOWN, never silently dropped or re-pointed.
|
|
16485
|
+
*/
|
|
16486
|
+
var ExtensionSourceHealthSchema = zod.z.enum([
|
|
16487
|
+
"ok",
|
|
16488
|
+
"missing",
|
|
16489
|
+
"foreign",
|
|
16490
|
+
"unavailable"
|
|
16491
|
+
]);
|
|
16492
|
+
var ExtensionSlotSourceSchema = zod.z.object({
|
|
16493
|
+
deviceId: zod.z.number().int(),
|
|
16494
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16495
|
+
name: zod.z.string().nullable(),
|
|
16496
|
+
health: ExtensionSourceHealthSchema,
|
|
16497
|
+
detail: zod.z.string().optional()
|
|
16498
|
+
});
|
|
16499
|
+
/**
|
|
16500
|
+
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
16501
|
+
* reported read-only, named, never written through this contract (D62). The
|
|
16502
|
+
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
16503
|
+
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
16504
|
+
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
16505
|
+
*/
|
|
16506
|
+
var ExtensionSlotActivationSchema = zod.z.object({
|
|
16507
|
+
state: zod.z.enum([
|
|
16508
|
+
"active",
|
|
16509
|
+
"inactive",
|
|
16510
|
+
"unknown"
|
|
16511
|
+
]),
|
|
16512
|
+
authority: zod.z.string(),
|
|
16513
|
+
detail: zod.z.string().optional()
|
|
16514
|
+
});
|
|
16515
|
+
/** One slot of one device, as its owner reads it from its own store. */
|
|
16516
|
+
var ExtensionSlotStateSchema = zod.z.object({
|
|
16517
|
+
state: zod.z.literal("ok"),
|
|
16518
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16519
|
+
slotRef: zod.z.string(),
|
|
16520
|
+
slot: ExtensionSlotIdSchema,
|
|
16521
|
+
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
16522
|
+
authority: zod.z.string(),
|
|
16523
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16524
|
+
value: ExtensionSlotValueSchema,
|
|
16525
|
+
sources: zod.z.array(ExtensionSlotSourceSchema),
|
|
16526
|
+
/**
|
|
16527
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
16528
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
16529
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
16530
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
16531
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
16532
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
16533
|
+
* older than D655.
|
|
16534
|
+
*/
|
|
16535
|
+
impliedSources: zod.z.array(ExtensionSlotSourceSchema).optional()
|
|
16536
|
+
});
|
|
16537
|
+
/**
|
|
16538
|
+
* A provider that could not answer `listSlots` at all. It could not name its
|
|
16539
|
+
* own slots, so the row names the ADDON and carries the refusal verbatim.
|
|
16540
|
+
* Written by the dispatcher, never by a provider.
|
|
16541
|
+
*/
|
|
16542
|
+
var ExtensionSlotUnreachableSchema = zod.z.object({
|
|
16543
|
+
state: zod.z.literal("unreachable"),
|
|
16544
|
+
addonId: zod.z.string(),
|
|
16545
|
+
reason: zod.z.string()
|
|
16546
|
+
});
|
|
16547
|
+
var ExtensionSlotRowSchema = zod.z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
|
|
16548
|
+
/** One device the slot's editor may offer as a source. */
|
|
16549
|
+
var ExtensionCandidateSchema = zod.z.object({
|
|
16550
|
+
deviceId: zod.z.number().int(),
|
|
16551
|
+
name: zod.z.string(),
|
|
16552
|
+
type: zod.z.string(),
|
|
16553
|
+
location: zod.z.string().nullable(),
|
|
16554
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16555
|
+
parentName: zod.z.string().nullable(),
|
|
16556
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16557
|
+
suggested: zod.z.boolean(),
|
|
16558
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16559
|
+
reason: zod.z.string().nullable()
|
|
16560
|
+
});
|
|
16561
|
+
var ExtensionCandidatesSchema = zod.z.object({ candidates: zod.z.array(ExtensionCandidateSchema) });
|
|
16562
|
+
/**
|
|
16563
|
+
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
16564
|
+
* reloaded the host (or, for an accessory child, its parent) because the
|
|
16565
|
+
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
16566
|
+
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
16567
|
+
*/
|
|
16568
|
+
var ExtensionSetResultSchema = zod.z.object({
|
|
16569
|
+
applied: zod.z.literal(true),
|
|
16570
|
+
reload: zod.z.enum([
|
|
16571
|
+
"none",
|
|
16572
|
+
"host",
|
|
16573
|
+
"parent"
|
|
16574
|
+
])
|
|
16575
|
+
});
|
|
16576
|
+
var ExtensionSlotRefInputSchema = zod.z.object({
|
|
16577
|
+
deviceId: zod.z.number().int(),
|
|
16578
|
+
slotRef: zod.z.string().min(1)
|
|
16579
|
+
});
|
|
16580
|
+
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
16581
|
+
var deviceExtensionCapability = {
|
|
16582
|
+
name: "device-extension",
|
|
16583
|
+
scope: "device",
|
|
16584
|
+
mode: "collection",
|
|
16585
|
+
kind: "wrapper",
|
|
16586
|
+
defaultActive: true,
|
|
16587
|
+
deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
|
|
16588
|
+
deviceConfig: { ui: {
|
|
16589
|
+
kind: "widget",
|
|
16590
|
+
widgetId: "host/extensions-panel",
|
|
16591
|
+
tab: "general",
|
|
16592
|
+
label: "Extensions",
|
|
16593
|
+
order: 72
|
|
16594
|
+
} },
|
|
16595
|
+
methods: {
|
|
16596
|
+
/** One row per slot owner — the D554 source listing `slotRef` routes by. */
|
|
16597
|
+
listSources: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.array(ExtensionSourceSchema)),
|
|
16598
|
+
/**
|
|
16599
|
+
* Every slot this device is offered, read by each owner from its own
|
|
16600
|
+
* store. A provider that throws is ONE `unreachable` row (D554.4).
|
|
16601
|
+
*/
|
|
16602
|
+
listSlots: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.array(ExtensionSlotRowSchema)),
|
|
16603
|
+
/** The devices the slot's editor may offer, suggestions pre-marked (D356). */
|
|
16604
|
+
listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
|
|
16605
|
+
/**
|
|
16606
|
+
* Write one slot through its owner's EXISTING write path. The owner
|
|
16607
|
+
* validates (a container is never a linked device, a camera is never its
|
|
16608
|
+
* own source) and refuses by name before persisting.
|
|
16609
|
+
*/
|
|
16610
|
+
setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
16611
|
+
kind: "mutation",
|
|
16612
|
+
auth: "admin"
|
|
16613
|
+
})
|
|
16614
|
+
}
|
|
16615
|
+
};
|
|
16616
|
+
/**
|
|
16235
16617
|
* Per-field ownership (D663). A composition may CLAIM fields of a native
|
|
16236
16618
|
* cap's runtime-state slice on an existing device: `replace` overlays the
|
|
16237
16619
|
* claimed fields on the native slice, `add` builds a slice the device does
|
|
@@ -30708,272 +31090,6 @@ var videoclipsCapability = {
|
|
|
30708
31090
|
}
|
|
30709
31091
|
};
|
|
30710
31092
|
/**
|
|
30711
|
-
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
30712
|
-
* name (same pattern as `snapshot`):
|
|
30713
|
-
*
|
|
30714
|
-
* - **Native** providers: registered per-device by device-driver
|
|
30715
|
-
* addons via `ctx.registerNativeCap` — either on a
|
|
30716
|
-
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
30717
|
-
* or directly on the camera (Reolink registers at camera level).
|
|
30718
|
-
* Emits an `onPressed` event every time the firmware pushes a
|
|
30719
|
-
* ring; status tracks the last press and a pressCount since start
|
|
30720
|
-
* (diagnostic).
|
|
30721
|
-
*
|
|
30722
|
-
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
30723
|
-
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
30724
|
-
* device (contact / switch / event-emitter …) into a doorbell for
|
|
30725
|
-
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
30726
|
-
* it per camera in the device-bindings UI, then picks the source
|
|
30727
|
-
* device + trigger in the per-device settings.
|
|
30728
|
-
*
|
|
30729
|
-
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
30730
|
-
* — subscribers listening at the camera level receive ring events
|
|
30731
|
-
* with `via[]` populated. No code on the parent needed.
|
|
30732
|
-
*/
|
|
30733
|
-
var DoorbellStatusSchema = zod.z.object({
|
|
30734
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
30735
|
-
lastPressedAt: zod.z.number().nullable(),
|
|
30736
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
30737
|
-
pressCountSinceStart: zod.z.number()
|
|
30738
|
-
});
|
|
30739
|
-
var DoorbellPressEventSchema = zod.z.object({
|
|
30740
|
-
deviceId: zod.z.number(),
|
|
30741
|
-
timestamp: zod.z.number()
|
|
30742
|
-
});
|
|
30743
|
-
/**
|
|
30744
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
30745
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
30746
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
30747
|
-
*/
|
|
30748
|
-
var DoorbellSourceSlotValueSchema = zod.z.object({ deviceIds: zod.z.array(zod.z.number().int().positive()) });
|
|
30749
|
-
/**
|
|
30750
|
-
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
30751
|
-
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
30752
|
-
* `doorbellSources` store (D648). A source rings when one of its
|
|
30753
|
-
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
30754
|
-
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
30755
|
-
* reports it, it never writes it.
|
|
30756
|
-
*/
|
|
30757
|
-
var DOORBELL_SOURCE_SLOT = {
|
|
30758
|
-
id: "doorbell-source",
|
|
30759
|
-
label: "Doorbell trigger devices",
|
|
30760
|
-
description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
|
|
30761
|
-
shape: "association",
|
|
30762
|
-
hostDeviceTypes: [DeviceType.Camera],
|
|
30763
|
-
sourceCaps: SOURCE_CAPS,
|
|
30764
|
-
cardinality: "many",
|
|
30765
|
-
value: DoorbellSourceSlotValueSchema
|
|
30766
|
-
};
|
|
30767
|
-
var doorbellCapability = {
|
|
30768
|
-
name: "doorbell",
|
|
30769
|
-
scope: "device",
|
|
30770
|
-
deviceNative: true,
|
|
30771
|
-
mode: "singleton",
|
|
30772
|
-
kind: "wrapper",
|
|
30773
|
-
defaultActive: false,
|
|
30774
|
-
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
30775
|
-
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
30776
|
-
methods: {},
|
|
30777
|
-
events: {
|
|
30778
|
-
/**
|
|
30779
|
-
* Fires once per physical press. Reolink delivers via Baichuan
|
|
30780
|
-
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
30781
|
-
* release/duration — it's a pulse.
|
|
30782
|
-
*/
|
|
30783
|
-
onPressed: {
|
|
30784
|
-
data: DoorbellPressEventSchema,
|
|
30785
|
-
fromState: {
|
|
30786
|
-
field: "lastPressedAt",
|
|
30787
|
-
on: "advance"
|
|
30788
|
-
}
|
|
30789
|
-
} },
|
|
30790
|
-
status: {
|
|
30791
|
-
schema: DoorbellStatusSchema,
|
|
30792
|
-
kind: "push"
|
|
30793
|
-
},
|
|
30794
|
-
/**
|
|
30795
|
-
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
30796
|
-
* Mirrored by the kernel and readable via
|
|
30797
|
-
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
30798
|
-
* without subscribing.
|
|
30799
|
-
*/
|
|
30800
|
-
runtimeState: DoorbellStatusSchema,
|
|
30801
|
-
/**
|
|
30802
|
-
* Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
|
|
30803
|
-
*
|
|
30804
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
30805
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
30806
|
-
*/
|
|
30807
|
-
durability: "restored"
|
|
30808
|
-
};
|
|
30809
|
-
var ExtensionSlotIdSchema = zod.z.enum(["doorbell-source", "linked-devices"]);
|
|
30810
|
-
var EXTENSION_SLOTS = {
|
|
30811
|
-
"doorbell-source": {
|
|
30812
|
-
descriptor: DOORBELL_SOURCE_SLOT,
|
|
30813
|
-
declaringCap: "doorbell",
|
|
30814
|
-
hostDeviceTypes: [DeviceType.Camera]
|
|
30815
|
-
},
|
|
30816
|
-
"linked-devices": {
|
|
30817
|
-
descriptor: LINKED_DEVICES_SLOT,
|
|
30818
|
-
declaringCap: "device-manager",
|
|
30819
|
-
hostDeviceTypes: [DeviceType.Camera]
|
|
30820
|
-
}
|
|
30821
|
-
};
|
|
30822
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
30823
|
-
var ExtensionSlotValueSchema = zod.z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: zod.z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: zod.z.literal("linked-devices") })]);
|
|
30824
|
-
/** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
|
|
30825
|
-
var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
|
|
30826
|
-
var ExtensionSourceAvailabilitySchema = zod.z.discriminatedUnion("state", [zod.z.object({ state: zod.z.literal("ok") }), zod.z.object({
|
|
30827
|
-
state: zod.z.literal("unreachable"),
|
|
30828
|
-
reason: zod.z.string()
|
|
30829
|
-
})]);
|
|
30830
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
30831
|
-
var ExtensionSourceSchema = zod.z.object({
|
|
30832
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
30833
|
-
source: zod.z.string(),
|
|
30834
|
-
label: zod.z.string(),
|
|
30835
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
30836
|
-
addonId: zod.z.string().optional(),
|
|
30837
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
30838
|
-
});
|
|
30839
|
-
/**
|
|
30840
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
30841
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
30842
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
30843
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
30844
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
30845
|
-
*/
|
|
30846
|
-
var ExtensionSourceHealthSchema = zod.z.enum([
|
|
30847
|
-
"ok",
|
|
30848
|
-
"missing",
|
|
30849
|
-
"foreign",
|
|
30850
|
-
"unavailable"
|
|
30851
|
-
]);
|
|
30852
|
-
var ExtensionSlotSourceSchema = zod.z.object({
|
|
30853
|
-
deviceId: zod.z.number().int(),
|
|
30854
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
30855
|
-
name: zod.z.string().nullable(),
|
|
30856
|
-
health: ExtensionSourceHealthSchema,
|
|
30857
|
-
detail: zod.z.string().optional()
|
|
30858
|
-
});
|
|
30859
|
-
/**
|
|
30860
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
30861
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
30862
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
30863
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
30864
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
30865
|
-
*/
|
|
30866
|
-
var ExtensionSlotActivationSchema = zod.z.object({
|
|
30867
|
-
state: zod.z.enum([
|
|
30868
|
-
"active",
|
|
30869
|
-
"inactive",
|
|
30870
|
-
"unknown"
|
|
30871
|
-
]),
|
|
30872
|
-
authority: zod.z.string(),
|
|
30873
|
-
detail: zod.z.string().optional()
|
|
30874
|
-
});
|
|
30875
|
-
/** One slot of one device, as its owner reads it from its own store. */
|
|
30876
|
-
var ExtensionSlotStateSchema = zod.z.object({
|
|
30877
|
-
state: zod.z.literal("ok"),
|
|
30878
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
30879
|
-
slotRef: zod.z.string(),
|
|
30880
|
-
slot: ExtensionSlotIdSchema,
|
|
30881
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
30882
|
-
authority: zod.z.string(),
|
|
30883
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
30884
|
-
value: ExtensionSlotValueSchema,
|
|
30885
|
-
sources: zod.z.array(ExtensionSlotSourceSchema),
|
|
30886
|
-
/**
|
|
30887
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
30888
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
30889
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
30890
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
30891
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
30892
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
30893
|
-
* older than D655.
|
|
30894
|
-
*/
|
|
30895
|
-
impliedSources: zod.z.array(ExtensionSlotSourceSchema).optional()
|
|
30896
|
-
});
|
|
30897
|
-
/**
|
|
30898
|
-
* A provider that could not answer `listSlots` at all. It could not name its
|
|
30899
|
-
* own slots, so the row names the ADDON and carries the refusal verbatim.
|
|
30900
|
-
* Written by the dispatcher, never by a provider.
|
|
30901
|
-
*/
|
|
30902
|
-
var ExtensionSlotUnreachableSchema = zod.z.object({
|
|
30903
|
-
state: zod.z.literal("unreachable"),
|
|
30904
|
-
addonId: zod.z.string(),
|
|
30905
|
-
reason: zod.z.string()
|
|
30906
|
-
});
|
|
30907
|
-
var ExtensionSlotRowSchema = zod.z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
|
|
30908
|
-
/** One device the slot's editor may offer as a source. */
|
|
30909
|
-
var ExtensionCandidateSchema = zod.z.object({
|
|
30910
|
-
deviceId: zod.z.number().int(),
|
|
30911
|
-
name: zod.z.string(),
|
|
30912
|
-
type: zod.z.string(),
|
|
30913
|
-
location: zod.z.string().nullable(),
|
|
30914
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
30915
|
-
parentName: zod.z.string().nullable(),
|
|
30916
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
30917
|
-
suggested: zod.z.boolean(),
|
|
30918
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
30919
|
-
reason: zod.z.string().nullable()
|
|
30920
|
-
});
|
|
30921
|
-
var ExtensionCandidatesSchema = zod.z.object({ candidates: zod.z.array(ExtensionCandidateSchema) });
|
|
30922
|
-
/**
|
|
30923
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
30924
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
30925
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
30926
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
30927
|
-
*/
|
|
30928
|
-
var ExtensionSetResultSchema = zod.z.object({
|
|
30929
|
-
applied: zod.z.literal(true),
|
|
30930
|
-
reload: zod.z.enum([
|
|
30931
|
-
"none",
|
|
30932
|
-
"host",
|
|
30933
|
-
"parent"
|
|
30934
|
-
])
|
|
30935
|
-
});
|
|
30936
|
-
var ExtensionSlotRefInputSchema = zod.z.object({
|
|
30937
|
-
deviceId: zod.z.number().int(),
|
|
30938
|
-
slotRef: zod.z.string().min(1)
|
|
30939
|
-
});
|
|
30940
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
30941
|
-
var deviceExtensionCapability = {
|
|
30942
|
-
name: "device-extension",
|
|
30943
|
-
scope: "device",
|
|
30944
|
-
mode: "collection",
|
|
30945
|
-
kind: "wrapper",
|
|
30946
|
-
defaultActive: true,
|
|
30947
|
-
deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
|
|
30948
|
-
deviceConfig: { ui: {
|
|
30949
|
-
kind: "widget",
|
|
30950
|
-
widgetId: "host/extensions-panel",
|
|
30951
|
-
tab: "general",
|
|
30952
|
-
label: "Extensions",
|
|
30953
|
-
order: 72
|
|
30954
|
-
} },
|
|
30955
|
-
methods: {
|
|
30956
|
-
/** One row per slot owner — the D554 source listing `slotRef` routes by. */
|
|
30957
|
-
listSources: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.array(ExtensionSourceSchema)),
|
|
30958
|
-
/**
|
|
30959
|
-
* Every slot this device is offered, read by each owner from its own
|
|
30960
|
-
* store. A provider that throws is ONE `unreachable` row (D554.4).
|
|
30961
|
-
*/
|
|
30962
|
-
listSlots: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.array(ExtensionSlotRowSchema)),
|
|
30963
|
-
/** The devices the slot's editor may offer, suggestions pre-marked (D356). */
|
|
30964
|
-
listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
|
|
30965
|
-
/**
|
|
30966
|
-
* Write one slot through its owner's EXISTING write path. The owner
|
|
30967
|
-
* validates (a container is never a linked device, a camera is never its
|
|
30968
|
-
* own source) and refuses by name before persisting.
|
|
30969
|
-
*/
|
|
30970
|
-
setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
30971
|
-
kind: "mutation",
|
|
30972
|
-
auth: "admin"
|
|
30973
|
-
})
|
|
30974
|
-
}
|
|
30975
|
-
};
|
|
30976
|
-
/**
|
|
30977
31093
|
* Optional client-side hints sent at session creation to help the provider
|
|
30978
31094
|
* pick the best native source. All fields optional — a viewer that knows
|
|
30979
31095
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -47463,6 +47579,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
47463
47579
|
coverCapability,
|
|
47464
47580
|
customModelRegistryCapability,
|
|
47465
47581
|
dataStoreProviderCapability,
|
|
47582
|
+
databaseSnapshotCapability,
|
|
47466
47583
|
dayNightCapability,
|
|
47467
47584
|
decoderCapability,
|
|
47468
47585
|
detectionPipelineCapability,
|
|
@@ -48725,6 +48842,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
48725
48842
|
addonId: null,
|
|
48726
48843
|
access: "view"
|
|
48727
48844
|
},
|
|
48845
|
+
"databaseSnapshot.listDatabases": {
|
|
48846
|
+
capName: "database-snapshot",
|
|
48847
|
+
capScope: "system",
|
|
48848
|
+
addonId: null,
|
|
48849
|
+
access: "view"
|
|
48850
|
+
},
|
|
48851
|
+
"databaseSnapshot.writeSnapshot": {
|
|
48852
|
+
capName: "database-snapshot",
|
|
48853
|
+
capScope: "system",
|
|
48854
|
+
addonId: null,
|
|
48855
|
+
access: "create"
|
|
48856
|
+
},
|
|
48728
48857
|
"dataStoreProvider.aggregate": {
|
|
48729
48858
|
capName: "data-store-provider",
|
|
48730
48859
|
capScope: "system",
|
|
@@ -58325,6 +58454,24 @@ Object.defineProperty(exports, "CoreBlockSchema", {
|
|
|
58325
58454
|
return CoreBlockSchema;
|
|
58326
58455
|
}
|
|
58327
58456
|
});
|
|
58457
|
+
Object.defineProperty(exports, "DATABASE_SNAPSHOT_PARTIAL_SUFFIX", {
|
|
58458
|
+
enumerable: true,
|
|
58459
|
+
get: function() {
|
|
58460
|
+
return DATABASE_SNAPSHOT_PARTIAL_SUFFIX;
|
|
58461
|
+
}
|
|
58462
|
+
});
|
|
58463
|
+
Object.defineProperty(exports, "DATABASE_SNAPSHOT_SUFFIX", {
|
|
58464
|
+
enumerable: true,
|
|
58465
|
+
get: function() {
|
|
58466
|
+
return DATABASE_SNAPSHOT_SUFFIX;
|
|
58467
|
+
}
|
|
58468
|
+
});
|
|
58469
|
+
Object.defineProperty(exports, "DATABASE_SNAPSHOT_TIMEOUT_MS", {
|
|
58470
|
+
enumerable: true,
|
|
58471
|
+
get: function() {
|
|
58472
|
+
return DATABASE_SNAPSHOT_TIMEOUT_MS;
|
|
58473
|
+
}
|
|
58474
|
+
});
|
|
58328
58475
|
Object.defineProperty(exports, "DATAPLANE_SECRET_HEADER", {
|
|
58329
58476
|
enumerable: true,
|
|
58330
58477
|
get: function() {
|
|
@@ -58763,6 +58910,12 @@ Object.defineProperty(exports, "dataStoreProviderCapability", {
|
|
|
58763
58910
|
return dataStoreProviderCapability;
|
|
58764
58911
|
}
|
|
58765
58912
|
});
|
|
58913
|
+
Object.defineProperty(exports, "databaseSnapshotCapability", {
|
|
58914
|
+
enumerable: true,
|
|
58915
|
+
get: function() {
|
|
58916
|
+
return databaseSnapshotCapability;
|
|
58917
|
+
}
|
|
58918
|
+
});
|
|
58766
58919
|
Object.defineProperty(exports, "declarationOwnerNodeId", {
|
|
58767
58920
|
enumerable: true,
|
|
58768
58921
|
get: function() {
|
|
@@ -59279,6 +59432,12 @@ Object.defineProperty(exports, "toExpressionValue", {
|
|
|
59279
59432
|
return toExpressionValue;
|
|
59280
59433
|
}
|
|
59281
59434
|
});
|
|
59435
|
+
Object.defineProperty(exports, "toNodeId", {
|
|
59436
|
+
enumerable: true,
|
|
59437
|
+
get: function() {
|
|
59438
|
+
return toNodeId;
|
|
59439
|
+
}
|
|
59440
|
+
});
|
|
59282
59441
|
Object.defineProperty(exports, "userManagementCapability", {
|
|
59283
59442
|
enumerable: true,
|
|
59284
59443
|
get: function() {
|