@camstack/system 1.2.327 → 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-C4y0E61h.js → composition-sources-B7hfTiPS.js} +1 -1
- package/dist/{composition-sources-p97gwBHf.mjs → composition-sources-BHPqf6So.mjs} +1 -1
- package/dist/{dist-DM-F-y2o.js → dist-CSs0cFDN.js} +507 -343
- package/dist/{dist-DM0Ht3af.mjs → dist-CV7IqaYq.mjs} +478 -344
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{retired-settings-keys-DQFKJIa9.js → retired-settings-keys-CGQnAoRx.js} +1 -1
- package/dist/{retired-settings-keys-BzEKm8HG.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 = z.object({ databases: z.array(z.object({ livePath: z.string() })) });
|
|
9364
|
+
/** One b-tree table of the snapshot and the rows it holds. */
|
|
9365
|
+
var DatabaseSnapshotTableSchema = z.object({
|
|
9366
|
+
name: z.string(),
|
|
9367
|
+
rows: 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 = z.object({
|
|
9376
|
+
/** The live database the snapshot copies. Never to be copied as a file. */
|
|
9377
|
+
livePath: z.string(),
|
|
9378
|
+
/** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
|
|
9379
|
+
snapshotPath: z.string(),
|
|
9380
|
+
sizeBytes: z.number().int().nonnegative(),
|
|
9381
|
+
pageCount: z.number().int().nonnegative(),
|
|
9382
|
+
pageSize: 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: z.array(DatabaseSnapshotTableSchema),
|
|
9389
|
+
/** Wall time of the pinned copy (row counts included). */
|
|
9390
|
+
copyMs: z.number().nonnegative(),
|
|
9391
|
+
/** Wall time of the checks on the copy (`integrity_check`, row counts). */
|
|
9392
|
+
verifyMs: z.number().nonnegative(),
|
|
9393
|
+
/** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
|
|
9394
|
+
takenAt: 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: z.string(),
|
|
9404
|
+
/** Archive-relative path of the verified copy it carries in its place. */
|
|
9405
|
+
snapshotPath: 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(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(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 = z.object({
|
|
|
9444
9555
|
locations: z.array(z.string()),
|
|
9445
9556
|
entries: z.array(ArchiveEntrySchema),
|
|
9446
9557
|
totalBytes: z.number(),
|
|
9447
|
-
totalFiles: z.number()
|
|
9558
|
+
totalFiles: 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: z.array(ArchiveSqliteSnapshotSchema).optional()
|
|
9448
9564
|
});
|
|
9449
9565
|
var LocationStatSchema = z.object({
|
|
9450
9566
|
name: z.string(),
|
|
@@ -11793,6 +11909,76 @@ var CompositionBlockStateSchema = z.object({
|
|
|
11793
11909
|
reason: z.string().optional(),
|
|
11794
11910
|
fields: 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 = z.object({
|
|
11922
|
+
id: z.string().min(1),
|
|
11923
|
+
name: z.string().min(1).max(120),
|
|
11924
|
+
enabled: z.boolean(),
|
|
11925
|
+
updatedAt: 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 = z.object({
|
|
11935
|
+
id: 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: z.string().nullable(),
|
|
11938
|
+
/** The parse error, in the operator's words. */
|
|
11939
|
+
error: z.string()
|
|
11940
|
+
});
|
|
11941
|
+
var ComposerApplyInputSchema = z.object({
|
|
11942
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
11943
|
+
integrationId: z.string().nullable(),
|
|
11944
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
11945
|
+
storeLoaded: z.boolean(),
|
|
11946
|
+
blocks: z.array(ComposerBlockSchema),
|
|
11947
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
11948
|
+
restartBlockIds: z.array(z.string()),
|
|
11949
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
11950
|
+
unreadableBlocks: z.array(ComposerUnreadableBlockSchema)
|
|
11951
|
+
});
|
|
11952
|
+
var ComposerBlockVerdictSchema = z.object({
|
|
11953
|
+
blockId: z.string(),
|
|
11954
|
+
status: CompositionRunStatusSchema,
|
|
11955
|
+
reason: 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, z.object({
|
|
11968
|
+
blocks: 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: z.boolean()
|
|
11975
|
+
}), {
|
|
11976
|
+
kind: "mutation",
|
|
11977
|
+
auth: "admin"
|
|
11978
|
+
}),
|
|
11979
|
+
getStates: method(z.object({ blockIds: z.array(z.string()) }), z.object({ states: 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 = z.object({
|
|
13016
|
-
id: z.string().min(1),
|
|
13017
|
-
name: z.string().min(1).max(120),
|
|
13018
|
-
enabled: z.boolean(),
|
|
13019
|
-
updatedAt: 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 = z.object({
|
|
13029
|
-
id: 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: z.string().nullable(),
|
|
13032
|
-
/** The parse error, in the operator's words. */
|
|
13033
|
-
error: z.string()
|
|
13034
|
-
});
|
|
13035
|
-
var ComposerApplyInputSchema = z.object({
|
|
13036
|
-
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13037
|
-
integrationId: z.string().nullable(),
|
|
13038
|
-
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13039
|
-
storeLoaded: z.boolean(),
|
|
13040
|
-
blocks: z.array(ComposerBlockSchema),
|
|
13041
|
-
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13042
|
-
restartBlockIds: z.array(z.string()),
|
|
13043
|
-
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13044
|
-
unreadableBlocks: z.array(ComposerUnreadableBlockSchema)
|
|
13045
|
-
});
|
|
13046
|
-
var ComposerBlockVerdictSchema = z.object({
|
|
13047
|
-
blockId: z.string(),
|
|
13048
|
-
status: CompositionRunStatusSchema,
|
|
13049
|
-
reason: 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, z.object({
|
|
13062
|
-
blocks: 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: z.boolean()
|
|
13069
|
-
}), {
|
|
13070
|
-
kind: "mutation",
|
|
13071
|
-
auth: "admin"
|
|
13072
|
-
}),
|
|
13073
|
-
getStates: method(z.object({ blockIds: z.array(z.string()) }), z.object({ states: 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 = z.object({
|
|
16374
|
+
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
16375
|
+
lastPressedAt: z.number().nullable(),
|
|
16376
|
+
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
16377
|
+
pressCountSinceStart: z.number()
|
|
16378
|
+
});
|
|
16379
|
+
var DoorbellPressEventSchema = z.object({
|
|
16380
|
+
deviceId: z.number(),
|
|
16381
|
+
timestamp: 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 = z.object({ deviceIds: z.array(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 = 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 = z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: 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 = z.discriminatedUnion("state", [z.object({ state: z.literal("ok") }), z.object({
|
|
16467
|
+
state: z.literal("unreachable"),
|
|
16468
|
+
reason: z.string()
|
|
16469
|
+
})]);
|
|
16470
|
+
/** One provider of slots — the D554 source-listing row. */
|
|
16471
|
+
var ExtensionSourceSchema = z.object({
|
|
16472
|
+
/** The routing prefix of every `slotRef` this provider serves. */
|
|
16473
|
+
source: z.string(),
|
|
16474
|
+
label: z.string(),
|
|
16475
|
+
/** Stamped by the dispatcher from the registry (D557). */
|
|
16476
|
+
addonId: 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 = z.enum([
|
|
16487
|
+
"ok",
|
|
16488
|
+
"missing",
|
|
16489
|
+
"foreign",
|
|
16490
|
+
"unavailable"
|
|
16491
|
+
]);
|
|
16492
|
+
var ExtensionSlotSourceSchema = z.object({
|
|
16493
|
+
deviceId: z.number().int(),
|
|
16494
|
+
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
16495
|
+
name: z.string().nullable(),
|
|
16496
|
+
health: ExtensionSourceHealthSchema,
|
|
16497
|
+
detail: 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 = z.object({
|
|
16507
|
+
state: z.enum([
|
|
16508
|
+
"active",
|
|
16509
|
+
"inactive",
|
|
16510
|
+
"unknown"
|
|
16511
|
+
]),
|
|
16512
|
+
authority: z.string(),
|
|
16513
|
+
detail: z.string().optional()
|
|
16514
|
+
});
|
|
16515
|
+
/** One slot of one device, as its owner reads it from its own store. */
|
|
16516
|
+
var ExtensionSlotStateSchema = z.object({
|
|
16517
|
+
state: z.literal("ok"),
|
|
16518
|
+
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
16519
|
+
slotRef: z.string(),
|
|
16520
|
+
slot: ExtensionSlotIdSchema,
|
|
16521
|
+
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
16522
|
+
authority: z.string(),
|
|
16523
|
+
activation: ExtensionSlotActivationSchema.nullable(),
|
|
16524
|
+
value: ExtensionSlotValueSchema,
|
|
16525
|
+
sources: 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: 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 = z.object({
|
|
16543
|
+
state: z.literal("unreachable"),
|
|
16544
|
+
addonId: z.string(),
|
|
16545
|
+
reason: z.string()
|
|
16546
|
+
});
|
|
16547
|
+
var ExtensionSlotRowSchema = z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
|
|
16548
|
+
/** One device the slot's editor may offer as a source. */
|
|
16549
|
+
var ExtensionCandidateSchema = z.object({
|
|
16550
|
+
deviceId: z.number().int(),
|
|
16551
|
+
name: z.string(),
|
|
16552
|
+
type: z.string(),
|
|
16553
|
+
location: z.string().nullable(),
|
|
16554
|
+
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
16555
|
+
parentName: z.string().nullable(),
|
|
16556
|
+
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
16557
|
+
suggested: z.boolean(),
|
|
16558
|
+
/** Why it is suggested ("same location"), null when it is not. */
|
|
16559
|
+
reason: z.string().nullable()
|
|
16560
|
+
});
|
|
16561
|
+
var ExtensionCandidatesSchema = z.object({ candidates: 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 = z.object({
|
|
16569
|
+
applied: z.literal(true),
|
|
16570
|
+
reload: z.enum([
|
|
16571
|
+
"none",
|
|
16572
|
+
"host",
|
|
16573
|
+
"parent"
|
|
16574
|
+
])
|
|
16575
|
+
});
|
|
16576
|
+
var ExtensionSlotRefInputSchema = z.object({
|
|
16577
|
+
deviceId: z.number().int(),
|
|
16578
|
+
slotRef: 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(z.object({ deviceId: z.number().int() }), 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(z.object({ deviceId: z.number().int() }), 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
|
|
@@ -20407,10 +20789,12 @@ var NcMediaPolicySchema = z.object({
|
|
|
20407
20789
|
/**
|
|
20408
20790
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
20409
20791
|
* notification suppresses.
|
|
20410
|
-
* - `
|
|
20411
|
-
*
|
|
20412
|
-
*
|
|
20413
|
-
*
|
|
20792
|
+
* - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
|
|
20793
|
+
* independent window per detected class: cat→dog fires at once, cat→cat
|
|
20794
|
+
* still waits.
|
|
20795
|
+
* - `shared` — one window for the whole rule/scope: a cat silences the next
|
|
20796
|
+
* dog for `cooldownSec`. Only written when an operator picks it; it is no
|
|
20797
|
+
* longer what an unset rule means.
|
|
20414
20798
|
*
|
|
20415
20799
|
* AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
|
|
20416
20800
|
* must not be swallowed by a bark's window (the precedent this generalizes —
|
|
@@ -20425,8 +20809,11 @@ var NcThrottleSchema = z.object({
|
|
|
20425
20809
|
/**
|
|
20426
20810
|
* Class granularity of the cooldown key. Optional rather than defaulted:
|
|
20427
20811
|
* a Zod default does NOT run on the addon→addon cap path, so a persisted
|
|
20428
|
-
* rule authored before this field simply carries none
|
|
20429
|
-
*
|
|
20812
|
+
* rule authored before this field simply carries none. The engine used to
|
|
20813
|
+
* read absent as `shared` (D36); since 2026-10-01 it reads absent as
|
|
20814
|
+
* `per-class` — the operator's default — and only an explicit `shared`
|
|
20815
|
+
* still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
|
|
20816
|
+
* engine, and D36's dated note.
|
|
20430
20817
|
*/
|
|
20431
20818
|
granularity: NcThrottleGranularitySchema.optional()
|
|
20432
20819
|
});
|
|
@@ -30703,272 +31090,6 @@ var videoclipsCapability = {
|
|
|
30703
31090
|
}
|
|
30704
31091
|
};
|
|
30705
31092
|
/**
|
|
30706
|
-
* Doorbell button cap. Two kinds of providers coexist behind this cap
|
|
30707
|
-
* name (same pattern as `snapshot`):
|
|
30708
|
-
*
|
|
30709
|
-
* - **Native** providers: registered per-device by device-driver
|
|
30710
|
-
* addons via `ctx.registerNativeCap` — either on a
|
|
30711
|
-
* `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
|
|
30712
|
-
* or directly on the camera (Reolink registers at camera level).
|
|
30713
|
-
* Emits an `onPressed` event every time the firmware pushes a
|
|
30714
|
-
* ring; status tracks the last press and a pressCount since start
|
|
30715
|
-
* (diagnostic).
|
|
30716
|
-
*
|
|
30717
|
-
* - **Wrapper** provider: the `virtual-doorbell` system builtin
|
|
30718
|
-
* (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
|
|
30719
|
-
* device (contact / switch / event-emitter …) into a doorbell for
|
|
30720
|
-
* a camera. `defaultActive: false` — the operator explicitly binds
|
|
30721
|
-
* it per camera in the device-bindings UI, then picks the source
|
|
30722
|
-
* device + trigger in the per-device settings.
|
|
30723
|
-
*
|
|
30724
|
-
* The DeviceEventPropagator re-emits `onPressed` on the camera parent
|
|
30725
|
-
* — subscribers listening at the camera level receive ring events
|
|
30726
|
-
* with `via[]` populated. No code on the parent needed.
|
|
30727
|
-
*/
|
|
30728
|
-
var DoorbellStatusSchema = z.object({
|
|
30729
|
-
/** Ms epoch of the last press. null = never observed since this provider started. */
|
|
30730
|
-
lastPressedAt: z.number().nullable(),
|
|
30731
|
-
/** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
|
|
30732
|
-
pressCountSinceStart: z.number()
|
|
30733
|
-
});
|
|
30734
|
-
var DoorbellPressEventSchema = z.object({
|
|
30735
|
-
deviceId: z.number(),
|
|
30736
|
-
timestamp: z.number()
|
|
30737
|
-
});
|
|
30738
|
-
/**
|
|
30739
|
-
* The `doorbell-source` extension slot's editable value (D648): the camera's
|
|
30740
|
-
* virtual-doorbell trigger devices, exactly what the wrapper's
|
|
30741
|
-
* `doorbellSources` persists (as `{ deviceId }` records).
|
|
30742
|
-
*/
|
|
30743
|
-
var DoorbellSourceSlotValueSchema = z.object({ deviceIds: z.array(z.number().int().positive()) });
|
|
30744
|
-
/**
|
|
30745
|
-
* The `doorbell-source` slot — which devices ring this camera's VIRTUAL
|
|
30746
|
-
* doorbell, owned by the `virtual-doorbell` wrapper over its
|
|
30747
|
-
* `doorbellSources` store (D648). A source rings when one of its
|
|
30748
|
-
* `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
|
|
30749
|
-
* different authority (`deviceManager.setWrapperActive`, D62) — the slot
|
|
30750
|
-
* reports it, it never writes it.
|
|
30751
|
-
*/
|
|
30752
|
-
var DOORBELL_SOURCE_SLOT = {
|
|
30753
|
-
id: "doorbell-source",
|
|
30754
|
-
label: "Doorbell trigger devices",
|
|
30755
|
-
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.",
|
|
30756
|
-
shape: "association",
|
|
30757
|
-
hostDeviceTypes: [DeviceType.Camera],
|
|
30758
|
-
sourceCaps: SOURCE_CAPS,
|
|
30759
|
-
cardinality: "many",
|
|
30760
|
-
value: DoorbellSourceSlotValueSchema
|
|
30761
|
-
};
|
|
30762
|
-
var doorbellCapability = {
|
|
30763
|
-
name: "doorbell",
|
|
30764
|
-
scope: "device",
|
|
30765
|
-
deviceNative: true,
|
|
30766
|
-
mode: "singleton",
|
|
30767
|
-
kind: "wrapper",
|
|
30768
|
-
defaultActive: false,
|
|
30769
|
-
deviceTypes: [DeviceType.Button, DeviceType.Camera],
|
|
30770
|
-
extensionSlots: [DOORBELL_SOURCE_SLOT],
|
|
30771
|
-
methods: {},
|
|
30772
|
-
events: {
|
|
30773
|
-
/**
|
|
30774
|
-
* Fires once per physical press. Reolink delivers via Baichuan
|
|
30775
|
-
* push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
|
|
30776
|
-
* release/duration — it's a pulse.
|
|
30777
|
-
*/
|
|
30778
|
-
onPressed: {
|
|
30779
|
-
data: DoorbellPressEventSchema,
|
|
30780
|
-
fromState: {
|
|
30781
|
-
field: "lastPressedAt",
|
|
30782
|
-
on: "advance"
|
|
30783
|
-
}
|
|
30784
|
-
} },
|
|
30785
|
-
status: {
|
|
30786
|
-
schema: DoorbellStatusSchema,
|
|
30787
|
-
kind: "push"
|
|
30788
|
-
},
|
|
30789
|
-
/**
|
|
30790
|
-
* Runtime-state slice — last press timestamp + lifetime press count.
|
|
30791
|
-
* Mirrored by the kernel and readable via
|
|
30792
|
-
* `device.state.doorbell.value`. UIs can show "last ring 5m ago"
|
|
30793
|
-
* without subscribing.
|
|
30794
|
-
*/
|
|
30795
|
-
runtimeState: DoorbellStatusSchema,
|
|
30796
|
-
/**
|
|
30797
|
-
* 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.
|
|
30798
|
-
*
|
|
30799
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
30800
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
30801
|
-
*/
|
|
30802
|
-
durability: "restored"
|
|
30803
|
-
};
|
|
30804
|
-
var ExtensionSlotIdSchema = z.enum(["doorbell-source", "linked-devices"]);
|
|
30805
|
-
var EXTENSION_SLOTS = {
|
|
30806
|
-
"doorbell-source": {
|
|
30807
|
-
descriptor: DOORBELL_SOURCE_SLOT,
|
|
30808
|
-
declaringCap: "doorbell",
|
|
30809
|
-
hostDeviceTypes: [DeviceType.Camera]
|
|
30810
|
-
},
|
|
30811
|
-
"linked-devices": {
|
|
30812
|
-
descriptor: LINKED_DEVICES_SLOT,
|
|
30813
|
-
declaringCap: "device-manager",
|
|
30814
|
-
hostDeviceTypes: [DeviceType.Camera]
|
|
30815
|
-
}
|
|
30816
|
-
};
|
|
30817
|
-
/** A slot's editable value, discriminated on `slot`. */
|
|
30818
|
-
var ExtensionSlotValueSchema = z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: z.literal("linked-devices") })]);
|
|
30819
|
-
/** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
|
|
30820
|
-
var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
|
|
30821
|
-
var ExtensionSourceAvailabilitySchema = z.discriminatedUnion("state", [z.object({ state: z.literal("ok") }), z.object({
|
|
30822
|
-
state: z.literal("unreachable"),
|
|
30823
|
-
reason: z.string()
|
|
30824
|
-
})]);
|
|
30825
|
-
/** One provider of slots — the D554 source-listing row. */
|
|
30826
|
-
var ExtensionSourceSchema = z.object({
|
|
30827
|
-
/** The routing prefix of every `slotRef` this provider serves. */
|
|
30828
|
-
source: z.string(),
|
|
30829
|
-
label: z.string(),
|
|
30830
|
-
/** Stamped by the dispatcher from the registry (D557). */
|
|
30831
|
-
addonId: z.string().optional(),
|
|
30832
|
-
availability: ExtensionSourceAvailabilitySchema
|
|
30833
|
-
});
|
|
30834
|
-
/**
|
|
30835
|
-
* How one picked source stands. `missing` — no such device (deleted, or an id
|
|
30836
|
-
* that never existed); `foreign` — a device the slot's owner cannot read from
|
|
30837
|
-
* (a source owned by another addon); `unavailable` — it exists but is not a
|
|
30838
|
-
* valid source now (a container, which is never a pick). A source in any of
|
|
30839
|
-
* these states is SHOWN, never silently dropped or re-pointed.
|
|
30840
|
-
*/
|
|
30841
|
-
var ExtensionSourceHealthSchema = z.enum([
|
|
30842
|
-
"ok",
|
|
30843
|
-
"missing",
|
|
30844
|
-
"foreign",
|
|
30845
|
-
"unavailable"
|
|
30846
|
-
]);
|
|
30847
|
-
var ExtensionSlotSourceSchema = z.object({
|
|
30848
|
-
deviceId: z.number().int(),
|
|
30849
|
-
/** The device's name, or null when it could not be resolved (`missing`). */
|
|
30850
|
-
name: z.string().nullable(),
|
|
30851
|
-
health: ExtensionSourceHealthSchema,
|
|
30852
|
-
detail: z.string().optional()
|
|
30853
|
-
});
|
|
30854
|
-
/**
|
|
30855
|
-
* A DIFFERENT authority that gates whether the slot's sources do anything —
|
|
30856
|
-
* reported read-only, named, never written through this contract (D62). The
|
|
30857
|
-
* virtual doorbell's sources ring only while the wrapper is bound to the
|
|
30858
|
-
* camera, and that binding belongs to `deviceManager.setWrapperActive`.
|
|
30859
|
-
* `unknown` means the gate could not be read; it is not "inactive" (D315).
|
|
30860
|
-
*/
|
|
30861
|
-
var ExtensionSlotActivationSchema = z.object({
|
|
30862
|
-
state: z.enum([
|
|
30863
|
-
"active",
|
|
30864
|
-
"inactive",
|
|
30865
|
-
"unknown"
|
|
30866
|
-
]),
|
|
30867
|
-
authority: z.string(),
|
|
30868
|
-
detail: z.string().optional()
|
|
30869
|
-
});
|
|
30870
|
-
/** One slot of one device, as its owner reads it from its own store. */
|
|
30871
|
-
var ExtensionSlotStateSchema = z.object({
|
|
30872
|
-
state: z.literal("ok"),
|
|
30873
|
-
/** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
|
|
30874
|
-
slotRef: z.string(),
|
|
30875
|
-
slot: ExtensionSlotIdSchema,
|
|
30876
|
-
/** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
|
|
30877
|
-
authority: z.string(),
|
|
30878
|
-
activation: ExtensionSlotActivationSchema.nullable(),
|
|
30879
|
-
value: ExtensionSlotValueSchema,
|
|
30880
|
-
sources: z.array(ExtensionSlotSourceSchema),
|
|
30881
|
-
/**
|
|
30882
|
-
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
30883
|
-
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
30884
|
-
* the child a picked container stands for (D356 — a container is never a
|
|
30885
|
-
* pick, its children are). Read-only; the editor shows them and may offer
|
|
30886
|
-
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
30887
|
-
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
30888
|
-
* older than D655.
|
|
30889
|
-
*/
|
|
30890
|
-
impliedSources: z.array(ExtensionSlotSourceSchema).optional()
|
|
30891
|
-
});
|
|
30892
|
-
/**
|
|
30893
|
-
* A provider that could not answer `listSlots` at all. It could not name its
|
|
30894
|
-
* own slots, so the row names the ADDON and carries the refusal verbatim.
|
|
30895
|
-
* Written by the dispatcher, never by a provider.
|
|
30896
|
-
*/
|
|
30897
|
-
var ExtensionSlotUnreachableSchema = z.object({
|
|
30898
|
-
state: z.literal("unreachable"),
|
|
30899
|
-
addonId: z.string(),
|
|
30900
|
-
reason: z.string()
|
|
30901
|
-
});
|
|
30902
|
-
var ExtensionSlotRowSchema = z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
|
|
30903
|
-
/** One device the slot's editor may offer as a source. */
|
|
30904
|
-
var ExtensionCandidateSchema = z.object({
|
|
30905
|
-
deviceId: z.number().int(),
|
|
30906
|
-
name: z.string(),
|
|
30907
|
-
type: z.string(),
|
|
30908
|
-
location: z.string().nullable(),
|
|
30909
|
-
/** The container a child belongs to — "Spotlight 2" alone does not say which. */
|
|
30910
|
-
parentName: z.string().nullable(),
|
|
30911
|
-
/** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
|
|
30912
|
-
suggested: z.boolean(),
|
|
30913
|
-
/** Why it is suggested ("same location"), null when it is not. */
|
|
30914
|
-
reason: z.string().nullable()
|
|
30915
|
-
});
|
|
30916
|
-
var ExtensionCandidatesSchema = z.object({ candidates: z.array(ExtensionCandidateSchema) });
|
|
30917
|
-
/**
|
|
30918
|
-
* What a write did. `none` — applied in place. `host` / `parent` — the owner
|
|
30919
|
-
* reloaded the host (or, for an accessory child, its parent) because the
|
|
30920
|
-
* write changed what the host REGISTERS. A slot never adds a capability to its
|
|
30921
|
-
* host — that is a composition (D663) — so today's owners answer `none`.
|
|
30922
|
-
*/
|
|
30923
|
-
var ExtensionSetResultSchema = z.object({
|
|
30924
|
-
applied: z.literal(true),
|
|
30925
|
-
reload: z.enum([
|
|
30926
|
-
"none",
|
|
30927
|
-
"host",
|
|
30928
|
-
"parent"
|
|
30929
|
-
])
|
|
30930
|
-
});
|
|
30931
|
-
var ExtensionSlotRefInputSchema = z.object({
|
|
30932
|
-
deviceId: z.number().int(),
|
|
30933
|
-
slotRef: z.string().min(1)
|
|
30934
|
-
});
|
|
30935
|
-
var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
|
|
30936
|
-
var deviceExtensionCapability = {
|
|
30937
|
-
name: "device-extension",
|
|
30938
|
-
scope: "device",
|
|
30939
|
-
mode: "collection",
|
|
30940
|
-
kind: "wrapper",
|
|
30941
|
-
defaultActive: true,
|
|
30942
|
-
deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
|
|
30943
|
-
deviceConfig: { ui: {
|
|
30944
|
-
kind: "widget",
|
|
30945
|
-
widgetId: "host/extensions-panel",
|
|
30946
|
-
tab: "general",
|
|
30947
|
-
label: "Extensions",
|
|
30948
|
-
order: 72
|
|
30949
|
-
} },
|
|
30950
|
-
methods: {
|
|
30951
|
-
/** One row per slot owner — the D554 source listing `slotRef` routes by. */
|
|
30952
|
-
listSources: method(z.object({ deviceId: z.number().int() }), z.array(ExtensionSourceSchema)),
|
|
30953
|
-
/**
|
|
30954
|
-
* Every slot this device is offered, read by each owner from its own
|
|
30955
|
-
* store. A provider that throws is ONE `unreachable` row (D554.4).
|
|
30956
|
-
*/
|
|
30957
|
-
listSlots: method(z.object({ deviceId: z.number().int() }), z.array(ExtensionSlotRowSchema)),
|
|
30958
|
-
/** The devices the slot's editor may offer, suggestions pre-marked (D356). */
|
|
30959
|
-
listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
|
|
30960
|
-
/**
|
|
30961
|
-
* Write one slot through its owner's EXISTING write path. The owner
|
|
30962
|
-
* validates (a container is never a linked device, a camera is never its
|
|
30963
|
-
* own source) and refuses by name before persisting.
|
|
30964
|
-
*/
|
|
30965
|
-
setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
|
|
30966
|
-
kind: "mutation",
|
|
30967
|
-
auth: "admin"
|
|
30968
|
-
})
|
|
30969
|
-
}
|
|
30970
|
-
};
|
|
30971
|
-
/**
|
|
30972
31093
|
* Optional client-side hints sent at session creation to help the provider
|
|
30973
31094
|
* pick the best native source. All fields optional — a viewer that knows
|
|
30974
31095
|
* nothing still gets a sane default. (Relocated from the retired `webrtc`
|
|
@@ -47458,6 +47579,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
47458
47579
|
coverCapability,
|
|
47459
47580
|
customModelRegistryCapability,
|
|
47460
47581
|
dataStoreProviderCapability,
|
|
47582
|
+
databaseSnapshotCapability,
|
|
47461
47583
|
dayNightCapability,
|
|
47462
47584
|
decoderCapability,
|
|
47463
47585
|
detectionPipelineCapability,
|
|
@@ -48720,6 +48842,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
48720
48842
|
addonId: null,
|
|
48721
48843
|
access: "view"
|
|
48722
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
|
+
},
|
|
48723
48857
|
"dataStoreProvider.aggregate": {
|
|
48724
48858
|
capName: "data-store-provider",
|
|
48725
48859
|
capScope: "system",
|
|
@@ -58236,4 +58370,4 @@ function enumerateInferenceDevices(hw) {
|
|
|
58236
58370
|
return out;
|
|
58237
58371
|
}
|
|
58238
58372
|
//#endregion
|
|
58239
|
-
export {
|
|
58373
|
+
export { collectSecretConfigKeys as $, DEVICE_SETTINGS_CONTRIBUTION_METHODS as $n, motionCapability as $t, REDACTED_SECRET as A, vectorStoreCapability as An, foldSnapshotByFunction as At, UserRecordSchema as B, compositionItemFieldPath as Bn, legacyAutoLinkIds as Bt, LOG_LEVEL_RANK as C, storageProviderCapability as Cn, enumerateItemArrayFields as Ct, MINUTES_PER_DAY as D, validateComposition as Dn, expandContainer as Dt, METHOD_ACCESS_MAP as E, userManagementCapability as En, evictionPolicyOfLocation as Et, ScopedTokenSchema as F, buildFfmpegArgs as Fn, isLocationEnabled as Ft, authProviderCapability as G, isSourceCap as Gn, logDestinationCapability as Gt, addonSettingsCapability as H, compositionSourceKey as Hn, lifecycleJobSchema as Ht, StorageCleanupJobSchema as I, cloneStatefulExpressionMemory as In, isObjectInput as It, batteryCapability as J, DeviceRole as Jn, mayReadLocation as Jt, backupCapability as K, toExpressionValue as Kn, logLevelAtMost as Kt, StorageLocationModeSchema as L, composedDeviceRef as Ln, isSameAddonId as Lt, RecordingStatusSchema as M, COMPOSER_ADDON_ID as Mn, gbToBytes as Mt, STORAGE_ACCESS_FALLBACK as N, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Nn, isArrayOutputSchema as Nt, MOTION_CLOSE_AFTER_MS as O, vectorDimFromBase64 as On, extractNestedAddonId as Ot, STREAM_PROFILE_META as P, SOURCE_CAPS as Pn, isCollectionArrayMethod as Pt, cameraGridLayoutCapability as Q, DATAPLANE_SECRET_HEADER as Qn, modeMayWrite as Qt, StorageLocationTypeSchema as R, composedDeviceStableId as Rn, isVoidInput as Rt, FieldClaimSchema as S, storageOccupancyCapability as Sn, EventCategory as Sr, enumerateInferenceDevices as St, LocationIconIdSchema as T, streamQualityLabel as Tn, evaluateCompositionField as Tt, addonWidgetsCapability as U, createStatefulExpressionMemory as Un, localNetworkCapability as Ut, addonPagesCapability as V, compositionSliceKey as Vn, legacyModeOf as Vt, alertsCapability as W, evaluateSensorEdge as Wn, locationIconKey as Wt, buildDoorbellCompositionFeature as X, errMsg as Xn, memoizePinnedFfmpeg as Xt, buildCapabilityLookup as Y, DeviceType as Yn, mayWriteToLocation as Yt, buildStreamParamsConfigSchema as Z, BaseAddon as Zn, metricsProviderCapability as Zt, DERIVED_CAMERA_SILENCED_CAP_NAMES as _, settingsStoreCapability as _n, readinessKey as _r, deviceManagerCapability as _t, BatteryStatusSchema as a, platformProbeCapability as an, asNumber as ar, coreBlockIdFromAddonId as at, FIRST_LEVEL_MACRO_CLASSES as b, storageCapability as bn, sleep as br, doorbellCapability as bt, COMPOSED_ITEM_FIXED_FIELDS as c, reducePoints as cn, emitDownForOwnedCaps as cr, createDeviceExtensionProvider as ct, CORE_BLOCK_ADDON_PREFIX as d, resolveLocationMode as dn, hydrateSchema as dr, declarationOwnerNodeId as dt, normalizeUnit as en, DEVICE_STATUS_METHOD as er, composerCapability as et, CoreBlockSchema as f, resolveMethodAuth as fn, isDeviceConfigCap as fr, decodeVectorBase64 as ft, DAY_NAMES as g, scoreRuntimes as gn, parseJsonUnknown as gr, deviceExtensionCapability as gt, DATABASE_SNAPSHOT_TIMEOUT_MS as h, scopesAllowDeviceCap as hn, parseJsonObject as hr, describeComposableCaps as ht, BaseDevice as i, planComposition as in, asJsonObject as ir, coreBlockComposition as it, RUNTIME_DEFAULTS as j, withLocationMode as jn, formatMinutes as jt, RECORDING_SOURCE_CAMSTACK_ADDON as k, vectorIndexDimConflictError as kn, filesystemBrowseCapability as kt, COMPOSER_RUNNER_ID as l, replacedFieldKeys as ln, emitReadiness as lr, dataStoreProviderCapability as lt, DATABASE_SNAPSHOT_SUFFIX as m, scopesAllowAddon as mn, nodePin as mr, deriveBatteryPresence as mt, AlertSchema as n, objectInputDeclaresRequiredDeviceId as nn, ReadinessTimeoutError as nr, compositionSourceRefs as nt, CAMERA_SWITCH_ORDER as o, procedureAuthKey as on, asString$1 as or, coreBlockSourceKind as ot, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as p, runtimeStatePolicyFor as pn, isEvent as pr, defineExtensionSlotProvider as pt, bareAddonId as q, DeviceFeature as qn, looseSchema as qt, ApiKeyRecordSchema as r, parseStreamParamsFormPatch as rn, WELL_KNOWN_TAB_MAP as rr, coreBlockAddonId as rt, CAP_NAMES_WITH_STATUS as s, ptzAutotrackCapability as sn, createEvent as sr, coreBlocksCapability as st, ALL_CAPABILITY_DEFINITIONS as t, objectInputDeclaresAddonId as tn, ReadinessRegistry as tr, compositionFieldKey as tt, CORE_BLOCKS_ADDON_ID as u, resolveBucketMs as un, expandCapMethods as ur, databaseSnapshotCapability as ut, DeclaredDevices as v, siteZoneKey as vn, resolveCapMount as vr, deviceStateCapability as vt, LegacyStorageLocationDefaultSchema as w, streamCatalogCapability as wn, enumerateSchemaFields as wt, FieldClaimModeSchema as x, storageMigrationCapability as xn, toNodeId as xr, doorbellFeatureSources as xt, DeviceStatusSchema as y, snapshotCapability as yn, scopeKey as yr, deviceStatusCapability as yt, StorageMigrationJobSchema as z, compositionFeatureEnabled as zn, kebabToCamel as zt };
|