@camstack/server 1.2.899 → 1.2.901
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/CHANGELOG.md +12 -0
- package/dist/api/trpc/generated-cap-routers.js +50 -0
- package/package.json +11 -10
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +4 -4
- package/system/dist/builtins/composer/composer.addon.mjs +4 -4
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/composition-api.d.ts +37 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +14 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +516 -7
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +516 -7
- package/system/dist/builtins/core-blocks/link-contributions.d.ts +85 -0
- package/system/dist/builtins/core-blocks/power-source-service.d.ts +25 -1
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-identifiers-action.d.ts +8 -0
- package/system/dist/builtins/device-manager/device-identity-index.d.ts +56 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +625 -62
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +624 -61
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +9 -1
- package/system/dist/builtins/device-manager/device-provider-context.d.ts +3 -0
- package/system/dist/builtins/device-manager/device-row-store.d.ts +4 -2
- package/system/dist/builtins/device-manager/identity-link-reconciler.d.ts +66 -0
- package/system/dist/builtins/device-manager/identity-links-store.d.ts +22 -0
- package/system/dist/builtins/device-manager/record-kinds.d.ts +2 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-LHKTf-nM.js → capture-engine-B3csK2sW.js} +1 -1
- package/system/dist/{capture-engine-BcD6iCZM.mjs → capture-engine-CCAzcezv.mjs} +1 -1
- package/system/dist/{composition-sources-C3ARJk2g.mjs → composition-sources-BX7u-Hdf.mjs} +1 -1
- package/system/dist/{composition-sources-DNUDbuXy.js → composition-sources-Bkbk5Oh5.js} +1 -1
- package/system/dist/{constants-dL8fl9aI.js → constants-BqxCksdV.js} +1 -1
- package/system/dist/{constants-er38mZOb.mjs → constants-_bOm_ae5.mjs} +1 -1
- package/system/dist/{device-ca-Ccz5olgH.mjs → device-ca-DRqN1P5Y.mjs} +1 -1
- package/system/dist/{device-ca-KWa6uJRU.js → device-ca-KNx_DazP.js} +1 -1
- package/system/dist/{dist-DEAjZE_-.js → dist-BNrIzdrJ.js} +351 -7
- package/system/dist/{dist-DBanWvHF.mjs → dist-S-zGcCEr.mjs} +310 -8
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-CVv79TVO.mjs → hub-identity-DSdbZxeR.mjs} +1 -1
- package/system/dist/{hub-identity-Dy8ZSUuq.js → hub-identity-pN0LtUhx.js} +1 -1
- package/system/dist/{hub-mdns-ciao-C_XjO7YI.js → hub-mdns-ciao-GafEbDm8.js} +2 -2
- package/system/dist/{hub-mdns-ciao-DtmIyWDL.mjs → hub-mdns-ciao-wAcv5VBY.mjs} +2 -2
- package/system/dist/index.js +8 -8
- package/system/dist/index.mjs +8 -8
- package/system/dist/{legacy-integration-rows-door-BL8T4lya.mjs → legacy-integration-rows-door--186Wij_.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-DPInWtE6.js → legacy-integration-rows-door-B1swGb0r.js} +1 -1
- package/system/dist/{rename-composition-block-Dgo-9-Ts.mjs → rename-composition-block-Cf5syiM4.mjs} +1 -1
- package/system/dist/{rename-composition-block-BxzETYOf.js → rename-composition-block-gJ_4GdHr.js} +1 -1
- package/system/dist/{restore-archive-BUtuNTe1.mjs → restore-archive-DScscuGI.mjs} +82 -82
- package/system/dist/{restore-archive-Zvx9sHZP.js → restore-archive-DXi9iBay.js} +1 -1
- package/system/dist/{wal-maintenance-DS2IKwtK.js → wal-maintenance-BA9XNPvt.js} +0 -0
- package/system/dist/{wal-maintenance-cASt_sYy.mjs → wal-maintenance-s3KdED98.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BNrIzdrJ.js");
|
|
7
7
|
const require_formatter = require("../../formatter-xbxeV4GD.js");
|
|
8
8
|
const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tc as BaseAddon, Za as preconditionOf, pa as logDestinationCapability, wl as defineAddonMigrations } from "../../dist-S-zGcCEr.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
|
|
3
3
|
import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-hTaAsYlX.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fc as HISTORY_DEFAULT_MIN_INTERVAL_MS, Pl as historyItemFieldPath, wu as DeviceType } from "./dist-S-zGcCEr.mjs";
|
|
2
2
|
//#region src/builtins/shared/device-state-changed.ts
|
|
3
3
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
4
4
|
function isRecord$2(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tu as errMsg, ac as compositionSourceKey } from "./dist-S-zGcCEr.mjs";
|
|
2
2
|
//#region src/builtins/core-blocks/composition-sources.ts
|
|
3
3
|
/**
|
|
4
4
|
* Describe what a composition reads and writes for SAVE-time validation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
|
|
2
|
-
var MESH_CA_KEY_REF = require("./dist-
|
|
2
|
+
var MESH_CA_KEY_REF = require("./dist-BNrIzdrJ.js").buildSecretRef({
|
|
3
3
|
owner: "system",
|
|
4
4
|
scope: { kind: "global" },
|
|
5
5
|
fieldPath: "meshCaKey"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as DEVICE_SAN_USER_PREFIX,
|
|
1
|
+
import { J as DEVICE_SAN_USER_PREFIX, hl as buildSecretRef, q as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-S-zGcCEr.mjs";
|
|
2
2
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
|
|
3
3
|
import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/auth/jwt-signing-key.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let zod = require("zod");
|
|
2
2
|
require("node:crypto");
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-7P4A3bYA.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -231,6 +231,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
231
231
|
* dropped) — consumers MUST also gate on the device record's `probed` flag.
|
|
232
232
|
*/
|
|
233
233
|
EventCategory["DeviceReady"] = "device.ready";
|
|
234
|
+
/**
|
|
235
|
+
* An identity link (D1063) became `linked` — auto on strong evidence or
|
|
236
|
+
* confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
|
|
237
|
+
* truth, and core-blocks reconciles its contributions from it as well.
|
|
238
|
+
* Payload: `IdentityLinkEventPayload`.
|
|
239
|
+
*/
|
|
240
|
+
EventCategory["IdentityLinkCreated"] = "identity-link.created";
|
|
241
|
+
/**
|
|
242
|
+
* A `linked` identity link stopped acting: its evidence is gone (an auto link
|
|
243
|
+
* is deleted; an operator-confirmed one stays `linked`, flagged
|
|
244
|
+
* `evidenceGone`, and no longer acts), a side was removed, or the operator
|
|
245
|
+
* unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
|
|
246
|
+
*/
|
|
247
|
+
EventCategory["IdentityLinkLost"] = "identity-link.lost";
|
|
234
248
|
EventCategory["IntegrationEnabled"] = "integration.enabled";
|
|
235
249
|
EventCategory["IntegrationDisabled"] = "integration.disabled";
|
|
236
250
|
EventCategory["IntegrationDeleted"] = "integration.deleted";
|
|
@@ -1298,7 +1312,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1298
1312
|
*/
|
|
1299
1313
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
1300
1314
|
//#endregion
|
|
1301
|
-
//#region ../types/dist/sleep-
|
|
1315
|
+
//#region ../types/dist/sleep-C9eelFbV.mjs
|
|
1302
1316
|
/**
|
|
1303
1317
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1304
1318
|
* window to float samples (D455).
|
|
@@ -19745,7 +19759,7 @@ function sleep(ms) {
|
|
|
19745
19759
|
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
19746
19760
|
}
|
|
19747
19761
|
//#endregion
|
|
19748
|
-
//#region ../types/dist/implemented-methods-
|
|
19762
|
+
//#region ../types/dist/implemented-methods-DXeNAPAS.mjs
|
|
19749
19763
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
19750
19764
|
opus: "libopus",
|
|
19751
19765
|
aac: "aac",
|
|
@@ -22420,6 +22434,8 @@ var CompositionItemEntrySchema = zod.z.object({
|
|
|
22420
22434
|
*/
|
|
22421
22435
|
reset: CompositionForwardCommandSchema.optional()
|
|
22422
22436
|
});
|
|
22437
|
+
/** Which identity link added a feature (D1063). */
|
|
22438
|
+
var CompositionContributedBySchema = zod.z.object({ linkId: zod.z.string().min(1) });
|
|
22423
22439
|
var CompositionFieldsFeatureSchema = zod.z.object({
|
|
22424
22440
|
kind: zod.z.literal("fields"),
|
|
22425
22441
|
cap: zod.z.string().min(1),
|
|
@@ -22431,7 +22447,14 @@ var CompositionFieldsFeatureSchema = zod.z.object({
|
|
|
22431
22447
|
*/
|
|
22432
22448
|
items: zod.z.record(zod.z.string().regex(COMPOSITION_ITEM_KEY_RE), CompositionItemEntrySchema).refine((items) => Object.keys(items).length <= 16, { message: `at most 16 items` }).optional(),
|
|
22433
22449
|
/** Method name → what serves it. Only a BUILT capability takes commands (D967). */
|
|
22434
|
-
commands: zod.z.record(zod.z.string().min(1), CompositionCommandTargetSchema).optional()
|
|
22450
|
+
commands: zod.z.record(zod.z.string().min(1), CompositionCommandTargetSchema).optional(),
|
|
22451
|
+
/**
|
|
22452
|
+
* Provenance only (D1063): the identity link that added this feature. The
|
|
22453
|
+
* source ref stays in `fields`; `enabled` stays the operator's switch. An
|
|
22454
|
+
* operator edit of the source drops the stamp and the feature becomes the
|
|
22455
|
+
* operator's; a lost link removes only stamped features.
|
|
22456
|
+
*/
|
|
22457
|
+
contributedBy: CompositionContributedBySchema.optional()
|
|
22435
22458
|
});
|
|
22436
22459
|
/** RESERVED for slice 3: a media / data-plane cap, whole, from one source. */
|
|
22437
22460
|
var CompositionPassthroughFeatureSchema = zod.z.object({
|
|
@@ -62566,7 +62589,8 @@ var CompositionProblemCodeSchema = zod.z.enum([
|
|
|
62566
62589
|
"command-source-unknown",
|
|
62567
62590
|
"command-input-unknown",
|
|
62568
62591
|
"command-input-missing",
|
|
62569
|
-
"power-source-is-actuator"
|
|
62592
|
+
"power-source-is-actuator",
|
|
62593
|
+
"link-contribution-removed"
|
|
62570
62594
|
]);
|
|
62571
62595
|
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
62572
62596
|
var CompositionProblemSchema = zod.z.object({
|
|
@@ -68511,7 +68535,9 @@ var PowerSourceRefusalReasonSchema = zod.z.enum([
|
|
|
68511
68535
|
"switch-call-failed",
|
|
68512
68536
|
"switch-options-unreadable",
|
|
68513
68537
|
"not-settable",
|
|
68514
|
-
"switch-is-actuator"
|
|
68538
|
+
"switch-is-actuator",
|
|
68539
|
+
"link-lost",
|
|
68540
|
+
"link-unknown"
|
|
68515
68541
|
]);
|
|
68516
68542
|
var PowerSourceActionResultSchema = zod.z.discriminatedUnion("accepted", [zod.z.object({ accepted: zod.z.literal(true) }), zod.z.object({
|
|
68517
68543
|
accepted: zod.z.literal(false),
|
|
@@ -68706,7 +68732,8 @@ function powerSourceLinkOfComposition(composition, blockId) {
|
|
|
68706
68732
|
return {
|
|
68707
68733
|
device,
|
|
68708
68734
|
switch: read.source,
|
|
68709
|
-
offSeconds: normalizeOffSeconds(storedOffSeconds(composition))
|
|
68735
|
+
offSeconds: normalizeOffSeconds(storedOffSeconds(composition)),
|
|
68736
|
+
...feature.contributedBy === void 0 ? {} : { contributedBy: feature.contributedBy }
|
|
68710
68737
|
};
|
|
68711
68738
|
}
|
|
68712
68739
|
var ACTUATOR_CAP = "switch";
|
|
@@ -71933,6 +71960,119 @@ var IdentityCandidatesSchema = zod.z.discriminatedUnion("status", [zod.z.object(
|
|
|
71933
71960
|
pairs: zod.z.array(IdentityCandidatePairSchema).readonly(),
|
|
71934
71961
|
undeclaredDeviceIds: zod.z.array(zod.z.number().int()).readonly()
|
|
71935
71962
|
})]);
|
|
71963
|
+
var IdentityLinkKindSchema = zod.z.enum(["same-device", "poe-power"]);
|
|
71964
|
+
/**
|
|
71965
|
+
* - `proposed` — one strong key matched: waits for the operator;
|
|
71966
|
+
* - `linked` — confirmed by the operator, or auto-linked on strong evidence;
|
|
71967
|
+
* - `dismissed` — the operator said no (or unlinked): sticky, never re-proposed.
|
|
71968
|
+
*/
|
|
71969
|
+
var IdentityLinkStateSchema = zod.z.enum([
|
|
71970
|
+
"proposed",
|
|
71971
|
+
"linked",
|
|
71972
|
+
"dismissed"
|
|
71973
|
+
]);
|
|
71974
|
+
/** Who decided the current state: the matcher (`auto`) or the operator. */
|
|
71975
|
+
var IdentityLinkOriginSchema = zod.z.enum(["auto", "operator"]);
|
|
71976
|
+
/** One side: the device ref that survives re-registration, plus its current numeric id. */
|
|
71977
|
+
var IdentityLinkSideSchema = zod.z.object({
|
|
71978
|
+
addonId: zod.z.string().min(1),
|
|
71979
|
+
stableId: zod.z.string().min(1),
|
|
71980
|
+
deviceId: zod.z.number().int()
|
|
71981
|
+
});
|
|
71982
|
+
/** The stored body of one `identity-links` record. */
|
|
71983
|
+
var IdentityLinkBodySchema = zod.z.object({
|
|
71984
|
+
kind: IdentityLinkKindSchema,
|
|
71985
|
+
a: IdentityLinkSideSchema,
|
|
71986
|
+
b: IdentityLinkSideSchema,
|
|
71987
|
+
state: IdentityLinkStateSchema,
|
|
71988
|
+
origin: IdentityLinkOriginSchema,
|
|
71989
|
+
/** The identifiers that matched when the link was last evaluated, ordered by key then value. */
|
|
71990
|
+
evidence: zod.z.array(IdentityMatchedKeySchema).readonly(),
|
|
71991
|
+
/** An operator-confirmed link whose evidence no longer matches: kept, flagged. */
|
|
71992
|
+
evidenceGone: zod.z.literal(true).optional(),
|
|
71993
|
+
createdAt: zod.z.number().int().nonnegative(),
|
|
71994
|
+
decidedAt: zod.z.number().int().nonnegative().optional()
|
|
71995
|
+
});
|
|
71996
|
+
var IdentityLinkSchema = IdentityLinkBodySchema.extend({ id: zod.z.string().min(1) });
|
|
71997
|
+
/** The one table of link kinds. */
|
|
71998
|
+
var IDENTITY_LINK_KINDS = {
|
|
71999
|
+
"same-device": {
|
|
72000
|
+
directional: false,
|
|
72001
|
+
attachingRole: null,
|
|
72002
|
+
contributions: []
|
|
72003
|
+
},
|
|
72004
|
+
"poe-power": {
|
|
72005
|
+
directional: true,
|
|
72006
|
+
attachingRole: DeviceRole.PoePort,
|
|
72007
|
+
contributions: [{
|
|
72008
|
+
cap: "power-source",
|
|
72009
|
+
targetId: "switch",
|
|
72010
|
+
host: "b",
|
|
72011
|
+
source: "a",
|
|
72012
|
+
sourceCap: "switch",
|
|
72013
|
+
sourceField: "on"
|
|
72014
|
+
}]
|
|
72015
|
+
}
|
|
72016
|
+
};
|
|
72017
|
+
/** Whether the attaching side of `kind` may be a device of `aRole`. */
|
|
72018
|
+
function identityLinkSidesRefusal(kind, aRole) {
|
|
72019
|
+
const required = IDENTITY_LINK_KINDS[kind].attachingRole;
|
|
72020
|
+
if (required === null) return null;
|
|
72021
|
+
return aRole === required ? null : "attaching-side-role";
|
|
72022
|
+
}
|
|
72023
|
+
function refKey(ref) {
|
|
72024
|
+
return `${ref.addonId}/${ref.stableId}`;
|
|
72025
|
+
}
|
|
72026
|
+
/**
|
|
72027
|
+
* The record id of a link: `<kind>:<refA>|<refB>`. A symmetric kind sorts the
|
|
72028
|
+
* two refs, so either order names one row; a directional kind keeps `a` first.
|
|
72029
|
+
*/
|
|
72030
|
+
function identityLinkId(kind, a, b) {
|
|
72031
|
+
const x = refKey(a);
|
|
72032
|
+
const y = refKey(b);
|
|
72033
|
+
if (IDENTITY_LINK_KINDS[kind].directional || x <= y) return `${kind}:${x}|${y}`;
|
|
72034
|
+
return `${kind}:${y}|${x}`;
|
|
72035
|
+
}
|
|
72036
|
+
/**
|
|
72037
|
+
* The answer of `device-manager.listIdentityLinks`. `not-loaded` until the
|
|
72038
|
+
* links have been read — never an empty list (D315).
|
|
72039
|
+
*/
|
|
72040
|
+
var IdentityLinksReadSchema = zod.z.discriminatedUnion("status", [zod.z.object({
|
|
72041
|
+
status: zod.z.literal("not-loaded"),
|
|
72042
|
+
reason: zod.z.string()
|
|
72043
|
+
}), zod.z.object({
|
|
72044
|
+
status: zod.z.literal("answered"),
|
|
72045
|
+
links: zod.z.array(IdentityLinkSchema).readonly()
|
|
72046
|
+
})]);
|
|
72047
|
+
/** Why an operator decision on a link was refused. */
|
|
72048
|
+
var IdentityLinkDecisionRefusalSchema = zod.z.enum([
|
|
72049
|
+
"not-loaded",
|
|
72050
|
+
"unknown-link",
|
|
72051
|
+
"wrong-state"
|
|
72052
|
+
]);
|
|
72053
|
+
/** The answer of `confirmIdentityLink` / `dismissIdentityLink` / `unlinkIdentity`. */
|
|
72054
|
+
var IdentityLinkDecisionSchema = zod.z.discriminatedUnion("ok", [zod.z.object({
|
|
72055
|
+
ok: zod.z.literal(true),
|
|
72056
|
+
link: IdentityLinkSchema
|
|
72057
|
+
}), zod.z.object({
|
|
72058
|
+
ok: zod.z.literal(false),
|
|
72059
|
+
reason: IdentityLinkDecisionRefusalSchema,
|
|
72060
|
+
message: zod.z.string()
|
|
72061
|
+
})]);
|
|
72062
|
+
/** Why a link was lost. */
|
|
72063
|
+
var IdentityLinkLostReasonSchema = zod.z.enum([
|
|
72064
|
+
"evidence-gone",
|
|
72065
|
+
"device-removed",
|
|
72066
|
+
"operator-unlinked"
|
|
72067
|
+
]);
|
|
72068
|
+
zod.z.object({
|
|
72069
|
+
linkId: zod.z.string(),
|
|
72070
|
+
kind: IdentityLinkKindSchema,
|
|
72071
|
+
aDeviceId: zod.z.number().int(),
|
|
72072
|
+
bDeviceId: zod.z.number().int(),
|
|
72073
|
+
origin: IdentityLinkOriginSchema,
|
|
72074
|
+
reason: IdentityLinkLostReasonSchema.optional()
|
|
72075
|
+
});
|
|
71936
72076
|
var DeviceSearchRequiresSchema = zod.z.object({
|
|
71937
72077
|
/** Capability names the field wants a value of. Absent when the field wants actions only. */
|
|
71938
72078
|
caps: zod.z.array(zod.z.string()).readonly().optional(),
|
|
@@ -72499,6 +72639,11 @@ var DeviceInfoSchema = zod.z.object({
|
|
|
72499
72639
|
* the owning provider via `setIdentifiers`; read-only for the operator.
|
|
72500
72640
|
* Absent ⇒ the provider declared none. */
|
|
72501
72641
|
identifiers: DeviceIdentifiersSchema.optional(),
|
|
72642
|
+
/** The identity of the device at the far end of this device's physical
|
|
72643
|
+
* link (D1059 amended by D1063) — a PoE port's wired client. Written only by
|
|
72644
|
+
* the owning provider via `setAttachedIdentifiers`; it never makes the two
|
|
72645
|
+
* devices the same device. Absent ⇒ none declared. */
|
|
72646
|
+
attachedIdentifiers: DeviceIdentifiersSchema.optional(),
|
|
72502
72647
|
/** Optional upstream-system identity + rendering envelope. See
|
|
72503
72648
|
* `SourceInfo` in `packages/types/src/device/source-info.ts`. */
|
|
72504
72649
|
sourceInfo: SourceInfoSchema.optional(),
|
|
@@ -72667,6 +72812,8 @@ var DeviceMetaSchema = zod.z.object({
|
|
|
72667
72812
|
metadata: zod.z.record(zod.z.string(), zod.z.unknown()).nullable().optional(),
|
|
72668
72813
|
/** Provider-declared identifiers (D1059). See `DeviceMeta.identifiers`. */
|
|
72669
72814
|
identifiers: DeviceIdentifiersSchema.optional(),
|
|
72815
|
+
/** The far end of the device's physical link (D1063). See `DeviceMeta.attachedIdentifiers`. */
|
|
72816
|
+
attachedIdentifiers: DeviceIdentifiersSchema.optional(),
|
|
72670
72817
|
/** Optional upstream-system identity + rendering envelope. See
|
|
72671
72818
|
* `SourceInfo`. Present when the device has been persisted with a
|
|
72672
72819
|
* non-synthetic source identifier (HA entities, vendor MAC, …);
|
|
@@ -73180,6 +73327,46 @@ var deviceManagerCapability = {
|
|
|
73180
73327
|
kind: "query",
|
|
73181
73328
|
auth: "admin"
|
|
73182
73329
|
}),
|
|
73330
|
+
/** Declare the identity of the device at the FAR END of this device's
|
|
73331
|
+
* physical link (D1063 amending D1059) — a PoE port's wired client: its MAC,
|
|
73332
|
+
* its IP. Same owner check, normalisation and merge as `setIdentifiers`
|
|
73333
|
+
* (`unread` keeps the stored value), its own column. It never makes the two
|
|
73334
|
+
* devices the same device: it feeds directional identity links only. */
|
|
73335
|
+
setAttachedIdentifiers: method(zod.z.object({
|
|
73336
|
+
deviceId: zod.z.number(),
|
|
73337
|
+
identifiers: DeviceIdentifiersSchema.nullable(),
|
|
73338
|
+
/** Kinds the provider tried to read and could not: their stored value is kept. */
|
|
73339
|
+
unread: zod.z.array(DeviceIdentifierKeySchema).optional()
|
|
73340
|
+
}), zod.z.void(), {
|
|
73341
|
+
kind: "mutation",
|
|
73342
|
+
auth: "admin"
|
|
73343
|
+
}),
|
|
73344
|
+
/** Identity links (D1063): `proposed`, `linked` and `dismissed` relations
|
|
73345
|
+
* between devices of different integrations, decided from their declared
|
|
73346
|
+
* identifiers. With `deviceId`, only the links naming that device.
|
|
73347
|
+
* `not-loaded` until the links have been read — never an empty list. */
|
|
73348
|
+
listIdentityLinks: method(zod.z.object({ deviceId: zod.z.number().int().optional() }), IdentityLinksReadSchema, {
|
|
73349
|
+
kind: "query",
|
|
73350
|
+
auth: "admin"
|
|
73351
|
+
}),
|
|
73352
|
+
/** Confirm a `proposed` link: it becomes `linked` by the operator and its
|
|
73353
|
+
* default contributions are added. Refused by name when the link is unknown
|
|
73354
|
+
* or not `proposed`. */
|
|
73355
|
+
confirmIdentityLink: method(zod.z.object({ linkId: zod.z.string().min(1) }), IdentityLinkDecisionSchema, {
|
|
73356
|
+
kind: "mutation",
|
|
73357
|
+
auth: "admin"
|
|
73358
|
+
}),
|
|
73359
|
+
/** Dismiss a `proposed` link: sticky, never proposed again. */
|
|
73360
|
+
dismissIdentityLink: method(zod.z.object({ linkId: zod.z.string().min(1) }), IdentityLinkDecisionSchema, {
|
|
73361
|
+
kind: "mutation",
|
|
73362
|
+
auth: "admin"
|
|
73363
|
+
}),
|
|
73364
|
+
/** Unlink a `linked` link: it becomes `dismissed` (sticky) and its stamped
|
|
73365
|
+
* contributions are removed. */
|
|
73366
|
+
unlinkIdentity: method(zod.z.object({ linkId: zod.z.string().min(1) }), IdentityLinkDecisionSchema, {
|
|
73367
|
+
kind: "mutation",
|
|
73368
|
+
auth: "admin"
|
|
73369
|
+
}),
|
|
73183
73370
|
/** Operator-curated location registry. Returns the union of:
|
|
73184
73371
|
* (1) labels persisted in the registry via `addLocation`, and
|
|
73185
73372
|
* (2) labels currently in use on at least one device's
|
|
@@ -117830,6 +118017,62 @@ function lockDoorLinkOfComposition(composition) {
|
|
|
117830
118017
|
}
|
|
117831
118018
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
117832
118019
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
118020
|
+
var catalog$3 = CAP_CUSTOMIZE_CATALOG;
|
|
118021
|
+
function scalarTargets(cap) {
|
|
118022
|
+
return (catalog$3[cap]?.targets ?? []).filter((target) => target.cardinality === "scalar" && target.path !== void 0);
|
|
118023
|
+
}
|
|
118024
|
+
/** How many scalar targets the cap declares: above one, the cap's feature is shared. */
|
|
118025
|
+
function scalarTargetCount(cap) {
|
|
118026
|
+
return scalarTargets(cap).length;
|
|
118027
|
+
}
|
|
118028
|
+
function valuePath(target) {
|
|
118029
|
+
return target.path ?? target.id;
|
|
118030
|
+
}
|
|
118031
|
+
function ownedPaths(target) {
|
|
118032
|
+
return [valuePath(target), ...(target.companions ?? []).map((companion) => companion.path)];
|
|
118033
|
+
}
|
|
118034
|
+
function find(cap, targetId) {
|
|
118035
|
+
return scalarTargets(cap).find((target) => target.id === targetId) ?? null;
|
|
118036
|
+
}
|
|
118037
|
+
/** The feature without its identity-link stamp. */
|
|
118038
|
+
function unstamped(feature) {
|
|
118039
|
+
const { contributedBy, ...rest } = feature;
|
|
118040
|
+
return contributedBy === void 0 ? feature : rest;
|
|
118041
|
+
}
|
|
118042
|
+
function without(fields, paths) {
|
|
118043
|
+
return Object.fromEntries(Object.entries(fields).filter(([path]) => !paths.has(path)));
|
|
118044
|
+
}
|
|
118045
|
+
/**
|
|
118046
|
+
* The cap's feature with `compiled` (one target's own feature) merged in. A cap
|
|
118047
|
+
* with one scalar target is replaced whole, as before.
|
|
118048
|
+
*/
|
|
118049
|
+
function mergeScalarTarget(current, compiled, cap, targetId) {
|
|
118050
|
+
const target = find(cap, targetId);
|
|
118051
|
+
if (current === null || target === null || scalarTargetCount(cap) < 2) return compiled;
|
|
118052
|
+
const kept = without(current.fields, new Set(ownedPaths(target)));
|
|
118053
|
+
return {
|
|
118054
|
+
...unstamped(current),
|
|
118055
|
+
...compiled,
|
|
118056
|
+
fields: {
|
|
118057
|
+
...kept,
|
|
118058
|
+
...compiled.fields
|
|
118059
|
+
}
|
|
118060
|
+
};
|
|
118061
|
+
}
|
|
118062
|
+
/** The cap's feature without `targetId`'s paths; null when no target value is left. */
|
|
118063
|
+
function removeScalarTarget(current, cap, targetId) {
|
|
118064
|
+
if (current === null) return null;
|
|
118065
|
+
const target = find(cap, targetId);
|
|
118066
|
+
if (target === null || scalarTargetCount(cap) < 2) return null;
|
|
118067
|
+
const stillAssigned = scalarTargets(cap).filter((row) => row.id !== targetId).filter((row) => current.fields[valuePath(row)] !== void 0);
|
|
118068
|
+
if (stillAssigned.length === 0) return null;
|
|
118069
|
+
const needed = new Set(stillAssigned.flatMap((row) => ownedPaths(row)));
|
|
118070
|
+
const drop = new Set(ownedPaths(target).filter((path) => !needed.has(path)));
|
|
118071
|
+
return {
|
|
118072
|
+
...unstamped(current),
|
|
118073
|
+
fields: without(current.fields, drop)
|
|
118074
|
+
};
|
|
118075
|
+
}
|
|
117833
118076
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
117834
118077
|
new Set(CAP_NAMES);
|
|
117835
118078
|
function isUnfilledRequiredProblem(problem) {
|
|
@@ -118615,6 +118858,20 @@ var BaseDevice = class {
|
|
|
118615
118858
|
}, raw, options);
|
|
118616
118859
|
}
|
|
118617
118860
|
/**
|
|
118861
|
+
* Declare the identity of the device at the FAR END of this device's physical
|
|
118862
|
+
* link (D1063): a PoE port's wired client. Same normalisation, `unread`
|
|
118863
|
+
* rule and owner check as {@link declareIdentifiers}, written through
|
|
118864
|
+
* `device-manager.setAttachedIdentifiers`. It never makes the two devices the
|
|
118865
|
+
* same device. Best-effort: never throws.
|
|
118866
|
+
*/
|
|
118867
|
+
async declareAttachedIdentifiers(raw, options) {
|
|
118868
|
+
return declareDeviceIdentifiers({
|
|
118869
|
+
deviceId: this.id,
|
|
118870
|
+
logger: this.ctx.logger,
|
|
118871
|
+
writer: this.ctx.api.deviceManager?.setAttachedIdentifiers
|
|
118872
|
+
}, raw, options);
|
|
118873
|
+
}
|
|
118874
|
+
/**
|
|
118618
118875
|
* Re-publish the device's current `features` array to the persisted
|
|
118619
118876
|
* meta blob. Drivers call this after a probe finishes when the live
|
|
118620
118877
|
* `features` getter has gained new flags (e.g. `hasIntercom` flips
|
|
@@ -125459,6 +125716,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
125459
125716
|
access: "create",
|
|
125460
125717
|
role: "admin"
|
|
125461
125718
|
},
|
|
125719
|
+
"deviceManager.confirmIdentityLink": {
|
|
125720
|
+
capName: "device-manager",
|
|
125721
|
+
capScope: "system",
|
|
125722
|
+
addonId: null,
|
|
125723
|
+
access: "create",
|
|
125724
|
+
role: "admin"
|
|
125725
|
+
},
|
|
125462
125726
|
"deviceManager.createDevice": {
|
|
125463
125727
|
capName: "device-manager",
|
|
125464
125728
|
capScope: "system",
|
|
@@ -125508,6 +125772,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
125508
125772
|
access: "create",
|
|
125509
125773
|
role: "admin"
|
|
125510
125774
|
},
|
|
125775
|
+
"deviceManager.dismissIdentityLink": {
|
|
125776
|
+
capName: "device-manager",
|
|
125777
|
+
capScope: "system",
|
|
125778
|
+
addonId: null,
|
|
125779
|
+
access: "create",
|
|
125780
|
+
role: "admin"
|
|
125781
|
+
},
|
|
125511
125782
|
"deviceManager.enable": {
|
|
125512
125783
|
capName: "device-manager",
|
|
125513
125784
|
capScope: "system",
|
|
@@ -125704,6 +125975,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
125704
125975
|
access: "view",
|
|
125705
125976
|
role: "admin"
|
|
125706
125977
|
},
|
|
125978
|
+
"deviceManager.listIdentityLinks": {
|
|
125979
|
+
capName: "device-manager",
|
|
125980
|
+
capScope: "system",
|
|
125981
|
+
addonId: null,
|
|
125982
|
+
access: "view",
|
|
125983
|
+
role: "admin"
|
|
125984
|
+
},
|
|
125707
125985
|
"deviceManager.listLocationDescriptions": {
|
|
125708
125986
|
capName: "device-manager",
|
|
125709
125987
|
capScope: "system",
|
|
@@ -125900,6 +126178,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
125900
126178
|
access: "create",
|
|
125901
126179
|
role: "admin"
|
|
125902
126180
|
},
|
|
126181
|
+
"deviceManager.setAttachedIdentifiers": {
|
|
126182
|
+
capName: "device-manager",
|
|
126183
|
+
capScope: "system",
|
|
126184
|
+
addonId: null,
|
|
126185
|
+
access: "create",
|
|
126186
|
+
role: "admin"
|
|
126187
|
+
},
|
|
125903
126188
|
"deviceManager.setChildLayout": {
|
|
125904
126189
|
capName: "device-manager",
|
|
125905
126190
|
capScope: "system",
|
|
@@ -126061,6 +126346,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
126061
126346
|
access: "create",
|
|
126062
126347
|
role: "admin"
|
|
126063
126348
|
},
|
|
126349
|
+
"deviceManager.unlinkIdentity": {
|
|
126350
|
+
capName: "device-manager",
|
|
126351
|
+
capScope: "system",
|
|
126352
|
+
addonId: null,
|
|
126353
|
+
access: "delete",
|
|
126354
|
+
role: "admin"
|
|
126355
|
+
},
|
|
126064
126356
|
"deviceManager.updateConfig": {
|
|
126065
126357
|
capName: "device-manager",
|
|
126066
126358
|
capScope: "system",
|
|
@@ -134947,6 +135239,11 @@ Object.freeze({
|
|
|
134947
135239
|
form: "array",
|
|
134948
135240
|
optional: true
|
|
134949
135241
|
}],
|
|
135242
|
+
"deviceManager.listIdentityLinks": [{
|
|
135243
|
+
name: "deviceId",
|
|
135244
|
+
form: "single",
|
|
135245
|
+
optional: true
|
|
135246
|
+
}],
|
|
134950
135247
|
"deviceManager.loadConfig": [{
|
|
134951
135248
|
name: "deviceId",
|
|
134952
135249
|
form: "single",
|
|
@@ -134997,6 +135294,11 @@ Object.freeze({
|
|
|
134997
135294
|
form: "single",
|
|
134998
135295
|
optional: false
|
|
134999
135296
|
}],
|
|
135297
|
+
"deviceManager.setAttachedIdentifiers": [{
|
|
135298
|
+
name: "deviceId",
|
|
135299
|
+
form: "single",
|
|
135300
|
+
optional: false
|
|
135301
|
+
}],
|
|
135000
135302
|
"deviceManager.setChildLayout": [{
|
|
135001
135303
|
name: "deviceId",
|
|
135002
135304
|
form: "single",
|
|
@@ -140449,6 +140751,12 @@ Object.defineProperty(exports, "DeviceFeature", {
|
|
|
140449
140751
|
return DeviceFeature;
|
|
140450
140752
|
}
|
|
140451
140753
|
});
|
|
140754
|
+
Object.defineProperty(exports, "DeviceIdentifierKeySchema", {
|
|
140755
|
+
enumerable: true,
|
|
140756
|
+
get: function() {
|
|
140757
|
+
return DeviceIdentifierKeySchema;
|
|
140758
|
+
}
|
|
140759
|
+
});
|
|
140452
140760
|
Object.defineProperty(exports, "DeviceIdentifiersSchema", {
|
|
140453
140761
|
enumerable: true,
|
|
140454
140762
|
get: function() {
|
|
@@ -140665,6 +140973,12 @@ Object.defineProperty(exports, "HvacModeSchema", {
|
|
|
140665
140973
|
return HvacModeSchema;
|
|
140666
140974
|
}
|
|
140667
140975
|
});
|
|
140976
|
+
Object.defineProperty(exports, "IDENTITY_LINK_KINDS", {
|
|
140977
|
+
enumerable: true,
|
|
140978
|
+
get: function() {
|
|
140979
|
+
return IDENTITY_LINK_KINDS;
|
|
140980
|
+
}
|
|
140981
|
+
});
|
|
140668
140982
|
Object.defineProperty(exports, "IDLE_ACTION_STATUS", {
|
|
140669
140983
|
enumerable: true,
|
|
140670
140984
|
get: function() {
|
|
@@ -140677,6 +140991,12 @@ Object.defineProperty(exports, "INTERNAL_ACTION_PREFIX", {
|
|
|
140677
140991
|
return INTERNAL_ACTION_PREFIX;
|
|
140678
140992
|
}
|
|
140679
140993
|
});
|
|
140994
|
+
Object.defineProperty(exports, "IdentityLinkBodySchema", {
|
|
140995
|
+
enumerable: true,
|
|
140996
|
+
get: function() {
|
|
140997
|
+
return IdentityLinkBodySchema;
|
|
140998
|
+
}
|
|
140999
|
+
});
|
|
140680
141000
|
Object.defineProperty(exports, "InvalidRecordError", {
|
|
140681
141001
|
enumerable: true,
|
|
140682
141002
|
get: function() {
|
|
@@ -142093,6 +142413,18 @@ Object.defineProperty(exports, "identifierStrength", {
|
|
|
142093
142413
|
return identifierStrength;
|
|
142094
142414
|
}
|
|
142095
142415
|
});
|
|
142416
|
+
Object.defineProperty(exports, "identityLinkId", {
|
|
142417
|
+
enumerable: true,
|
|
142418
|
+
get: function() {
|
|
142419
|
+
return identityLinkId;
|
|
142420
|
+
}
|
|
142421
|
+
});
|
|
142422
|
+
Object.defineProperty(exports, "identityLinkSidesRefusal", {
|
|
142423
|
+
enumerable: true,
|
|
142424
|
+
get: function() {
|
|
142425
|
+
return identityLinkSidesRefusal;
|
|
142426
|
+
}
|
|
142427
|
+
});
|
|
142096
142428
|
Object.defineProperty(exports, "implementedMethodsOf", {
|
|
142097
142429
|
enumerable: true,
|
|
142098
142430
|
get: function() {
|
|
@@ -142465,6 +142797,12 @@ Object.defineProperty(exports, "mergeIdentifiers", {
|
|
|
142465
142797
|
return mergeIdentifiers;
|
|
142466
142798
|
}
|
|
142467
142799
|
});
|
|
142800
|
+
Object.defineProperty(exports, "mergeScalarTarget", {
|
|
142801
|
+
enumerable: true,
|
|
142802
|
+
get: function() {
|
|
142803
|
+
return mergeScalarTarget;
|
|
142804
|
+
}
|
|
142805
|
+
});
|
|
142468
142806
|
Object.defineProperty(exports, "methodRefusal", {
|
|
142469
142807
|
enumerable: true,
|
|
142470
142808
|
get: function() {
|
|
@@ -142825,6 +143163,12 @@ Object.defineProperty(exports, "removeFromTags", {
|
|
|
142825
143163
|
return removeFromTags;
|
|
142826
143164
|
}
|
|
142827
143165
|
});
|
|
143166
|
+
Object.defineProperty(exports, "removeScalarTarget", {
|
|
143167
|
+
enumerable: true,
|
|
143168
|
+
get: function() {
|
|
143169
|
+
return removeScalarTarget;
|
|
143170
|
+
}
|
|
143171
|
+
});
|
|
142828
143172
|
Object.defineProperty(exports, "renameInTags", {
|
|
142829
143173
|
enumerable: true,
|
|
142830
143174
|
get: function() {
|