@camstack/addon-admin-ui 1.2.275 → 1.2.277
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/assets/{AddonCollectionPage-ikVhTVzs.js → AddonCollectionPage-65yIgq50.js} +1 -1
- package/dist/assets/Addons-CjKLXBV3.js +1 -0
- package/dist/assets/{AdminTabs-9fSBXuDS.js → AdminTabs-Bsxd4tRa.js} +1 -1
- package/dist/assets/AiProfiles-l7LHrzwT.js +3 -0
- package/dist/assets/{BrokerForm-Bent7WqE.js → BrokerForm-3rcdA3-f.js} +1 -1
- package/dist/assets/Build-DRVkaxIT.js +32 -0
- package/dist/assets/{Capabilities-BDkZGAB2.js → Capabilities-CESfvDkp.js} +1 -1
- package/dist/assets/CapabilityBadges-MCiRJB78.js +1 -0
- package/dist/assets/{Cluster-DG8cMiIh.js → Cluster-Dl8XeKqT.js} +2 -2
- package/dist/assets/Data-pqJND2n4.js +1 -0
- package/dist/assets/DetectionIntelligence-CxLbtcRH.js +1 -0
- package/dist/assets/{DeviceAggregateSection-BrAVgjqX.js → DeviceAggregateSection-BuSC-cdc.js} +1 -1
- package/dist/assets/DeviceDetail-DeJgcjCA.js +2 -0
- package/dist/assets/{Devices-LToPXNjW.js → Devices-B6Wzjk85.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-6feVvRxx.js → EmbedPlayerPage-rypUtfsp.js} +1 -1
- package/dist/assets/Events-DMZqhcSB.js +1 -0
- package/dist/assets/{FormBuilder-BUSMC4T5.js → FormBuilder-BkkpgbP0.js} +1 -1
- package/dist/assets/Identity-CAF1wZr0.js +1 -0
- package/dist/assets/IntegrationDetail-C9zY-gd5.js +1 -0
- package/dist/assets/{Integrations-D8WqtsaD.js → Integrations-C-0BUSAM.js} +1 -1
- package/dist/assets/Integrations-D-oa4wlE.js +1 -0
- package/dist/assets/{Locations-wtJYrLHX.js → Locations-BENkzgun.js} +2 -2
- package/dist/assets/{Logs-DtWNAN_l.js → Logs-HI08UKTA.js} +1 -1
- package/dist/assets/ModelLicenses-zZgTMqXO.js +1 -0
- package/dist/assets/{MotionZonesSettings-vKL977Gy.js → MotionZonesSettings-CTDWIbp0.js} +1 -1
- package/dist/assets/{MyAccess-BQoxYze-.js → MyAccess-CauYj362.js} +1 -1
- package/dist/assets/Network-CFX3d_W_.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-BBANGVTd.js → NodeAddonsSettingsPanel-lBWaWtyZ.js} +1 -1
- package/dist/assets/NodeInferenceDevices-CqSDOYod.js +1 -0
- package/dist/assets/Notifications-BVaBx5zp.js +1 -0
- package/dist/assets/Pipeline-DLB19p4D.js +1 -0
- package/dist/assets/Plates-C-yOBq5k.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-CK8HOJJL.js → PrivacyMaskSettings-0zZkGNOM.js} +1 -1
- package/dist/assets/{ProviderIcon-sS9F5ldk.js → ProviderIcon-CPPKo-Ts.js} +1 -1
- package/dist/assets/Recordings-DbiWFy0T.js +1 -0
- package/dist/assets/{ScanNetworkModal-C4ocFkNb.js → ScanNetworkModal-BJrHm0qj.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-DJPX6_Ac.js → SceneMonitorEditor-drNxXbce.js} +1 -1
- package/dist/assets/{Scenes-BVXBKqWi.js → Scenes-0xZl7nj0.js} +1 -1
- package/dist/assets/{Settings-DulJoBBf.js → Settings-C-s7TZ7R.js} +1 -1
- package/dist/assets/{Showroom-DjEuJ6qx.js → Showroom-BzLt_-OR.js} +1 -1
- package/dist/assets/{StorageLocationsPanel-DJ3lmzq7.js → StorageLocationsPanel-OeuRyPsr.js} +1 -1
- package/dist/assets/{Terminal-BG4lg8nI.js → Terminal-SFoH9jRn.js} +1 -1
- package/dist/assets/{Viewer-BysE8KOm.js → Viewer-DyEoPMvX.js} +1 -1
- package/dist/assets/{__vite-browser-external-B6qJ4svC.js → __vite-browser-external-Cc3gW-QT.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CVm-6q6M.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DJ3Gqc8B.js} +1 -1
- package/dist/assets/{archive-DkSEf0_q.js → archive-Dn3V52rE.js} +1 -1
- package/dist/assets/{authed-media-DIpjbqi0.js → authed-media-BZ_HLhjH.js} +1 -1
- package/dist/assets/{boxes-BQi9ynyX.js → boxes-C-ssGRxU.js} +1 -1
- package/dist/assets/circle-slash-D2ZkUEEp.js +1 -0
- package/dist/assets/{debounced-invalidate-DAZt27t0.js → debounced-invalidate-LQZZcUzN.js} +1 -1
- package/dist/assets/dist-DcgQ6Ev-.js +349 -0
- package/dist/assets/{dist-D0NjW2x5.js → dist-DdKUzVhB.js} +1 -1
- package/dist/assets/{face-bbox-BhD_0dbz.js → face-bbox-B5Kgf0Oj.js} +1 -1
- package/dist/assets/{hard-drive-download-CBTHszX5.js → hard-drive-download-CsozppT1.js} +1 -1
- package/dist/assets/{hostInit-Ct7mnLBf.js → hostInit-B4fqBDQa.js} +1 -1
- package/dist/assets/{index-B-0u4ZEx.css → index-Cz9U1hKX.css} +1 -1
- package/dist/assets/index-DJ7rWfAu.js +4 -0
- package/dist/assets/{layers-DS7nDdsa.js → layers-YEExzxCf.js} +1 -1
- package/dist/assets/{location-owned-usage-BX6axSqT.js → location-owned-usage-DASRr9Gn.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-6e85fd91.js → mf-entry-bootstrap-0-d8a20dad.js} +2 -2
- package/dist/assets/player-overlays-DAihiFvO.js +1 -0
- package/dist/assets/remoteEntry-DY7q5PVh.js +1 -0
- package/dist/assets/{send-_NEbZ0fJ.js → send-s1IW1yHx.js} +1 -1
- package/dist/assets/{settings-2-B0TxscGS.js → settings-2-sJ1lVWl6.js} +1 -1
- package/dist/assets/{square-check-big-jb3YOP8l.js → square-check-big-CP5rWVEN.js} +1 -1
- package/dist/assets/src-B4JHPaAN.js +67 -0
- package/dist/assets/src-DOeAf_sL.js +349 -0
- package/dist/assets/{use-scenes-feed-C0ggTpoV.js → use-scenes-feed-BlcOIyWI.js} +1 -1
- package/dist/assets/{use-stationary-objects-BlIsBs2_.js → use-stationary-objects-C7CknC2f.js} +1 -1
- package/dist/assets/useEventInvalidation-vH-47C-i.js +1 -0
- package/dist/assets/{useNodeUrlSelection-seRVS-5t.js → useNodeUrlSelection-Bmq-ZpDy.js} +1 -1
- package/dist/assets/user-round-CQEU9c3C.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-Bqg-K8l_.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-9zlM_isR.js} +2 -2
- package/dist/index.html +7 -7
- package/dist/server/addon.js +472 -27
- package/package.json +1 -1
- package/dist/assets/Addons-B9hTzMEr.js +0 -1
- package/dist/assets/AiProfiles-CWcbi_We.js +0 -3
- package/dist/assets/Build-BNSSkt85.js +0 -32
- package/dist/assets/CapabilityBadges-Pm3xGC_s.js +0 -1
- package/dist/assets/Data-BA4tsLZU.js +0 -1
- package/dist/assets/DetectionIntelligence-DoTWiyE-.js +0 -1
- package/dist/assets/DeviceDetail-D4fBEm8i.js +0 -2
- package/dist/assets/Events-CuZVXT_T.js +0 -1
- package/dist/assets/Identity-Bk2EOu2L.js +0 -1
- package/dist/assets/IntegrationDetail-DT_luTyr.js +0 -1
- package/dist/assets/Integrations-DzXcsS9I.js +0 -1
- package/dist/assets/Network-DVQkKBW2.js +0 -1
- package/dist/assets/NodeInferenceDevices-DugbPcgC.js +0 -1
- package/dist/assets/Notifications-QbT3SbR0.js +0 -1
- package/dist/assets/Pipeline-54HWK5c2.js +0 -1
- package/dist/assets/Plates-BTESPcJn.js +0 -1
- package/dist/assets/Recordings-C05R61xH.js +0 -1
- package/dist/assets/circle-slash-qRAK-J6-.js +0 -1
- package/dist/assets/dist-HE4O5MUL.js +0 -349
- package/dist/assets/index-CtcPl_wv.js +0 -4
- package/dist/assets/player-overlays-BT1OHjf_.js +0 -1
- package/dist/assets/remoteEntry-SylOUegU.js +0 -1
- package/dist/assets/src-C64xyGXQ.js +0 -349
- package/dist/assets/src-XCOYjn7M.js +0 -67
- package/dist/assets/useEventInvalidation-Cq4MhSNE.js +0 -1
- package/dist/assets/user-round-vNWYDU1B.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -9566,6 +9566,48 @@ var ModelProviderIdSchema = _enum([
|
|
|
9566
9566
|
"scrypted",
|
|
9567
9567
|
"custom"
|
|
9568
9568
|
]);
|
|
9569
|
+
/**
|
|
9570
|
+
* The licence of a model, as a record rather than a bare SPDX string: a
|
|
9571
|
+
* permissive CODE licence routinely sits on top of restrictive WEIGHTS or
|
|
9572
|
+
* DATA, and the obligations (attribution, modification notices, source offers)
|
|
9573
|
+
* are per upstream. A persisted custom-model row written when this field was a
|
|
9574
|
+
* string still parses — the string is lifted into `{ weights }`.
|
|
9575
|
+
*
|
|
9576
|
+
* Every licence surface (the admin "Models and licenses" page,
|
|
9577
|
+
* `THIRD_PARTY_MODELS.md`, the Hugging Face model table) is GENERATED from
|
|
9578
|
+
* these records by `scripts/gen-model-licenses.ts` (D661).
|
|
9579
|
+
*/
|
|
9580
|
+
var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { weights: value } : value, object({
|
|
9581
|
+
/** SPDX id of the WEIGHTS' terms, a `LicenseRef-*` for non-SPDX terms, or `UNKNOWN`. */
|
|
9582
|
+
weights: string().min(1),
|
|
9583
|
+
/** SPDX id of the upstream code that defines / trained the network. */
|
|
9584
|
+
code: string().min(1).optional(),
|
|
9585
|
+
/** Training data whose terms add obligations (attribution, non-commercial). */
|
|
9586
|
+
data: object({
|
|
9587
|
+
name: string().min(1),
|
|
9588
|
+
terms: string().min(1),
|
|
9589
|
+
url: string().url().optional()
|
|
9590
|
+
}).optional(),
|
|
9591
|
+
/** The project the weights come from. Required on built-in entries (guard). */
|
|
9592
|
+
upstream: object({
|
|
9593
|
+
name: string().min(1),
|
|
9594
|
+
url: string().url()
|
|
9595
|
+
}).optional(),
|
|
9596
|
+
/** Where the licence text governing the weights is published. */
|
|
9597
|
+
url: string().url().optional(),
|
|
9598
|
+
/** Attribution the licence REQUIRES, verbatim. */
|
|
9599
|
+
attribution: string().min(1).optional(),
|
|
9600
|
+
/** What CamStack changed. Required when `hosting` is `camstack-hf` (guard). */
|
|
9601
|
+
modifications: string().min(1).optional(),
|
|
9602
|
+
/** Who serves the file a node downloads. */
|
|
9603
|
+
hosting: _enum([
|
|
9604
|
+
"camstack-hf",
|
|
9605
|
+
"third-party",
|
|
9606
|
+
"built-in"
|
|
9607
|
+
]).optional(),
|
|
9608
|
+
/** True when the weights or their data forbid commercial use. */
|
|
9609
|
+
nonCommercial: boolean().optional()
|
|
9610
|
+
}));
|
|
9569
9611
|
var ModelCatalogEntrySchema = object({
|
|
9570
9612
|
id: string(),
|
|
9571
9613
|
name: string(),
|
|
@@ -9654,11 +9696,11 @@ var ModelCatalogEntrySchema = object({
|
|
|
9654
9696
|
p95LatencyMs: record(string(), number()).optional()
|
|
9655
9697
|
}).optional(),
|
|
9656
9698
|
/**
|
|
9657
|
-
*
|
|
9658
|
-
*
|
|
9659
|
-
*
|
|
9699
|
+
* The model's licence record — see {@link ModelLicenseSchema}. Optional in
|
|
9700
|
+
* the schema (a custom model's author may state none); REQUIRED and complete
|
|
9701
|
+
* on every built-in catalog entry (`scripts/check-catalog-licence.ts`).
|
|
9660
9702
|
*/
|
|
9661
|
-
license:
|
|
9703
|
+
license: ModelLicenseSchema.optional(),
|
|
9662
9704
|
/**
|
|
9663
9705
|
* Variant-selector grouping. The UI groups models by `family` + `tier` and
|
|
9664
9706
|
* offers `precision` / `optimization` as variant axes WITHIN a tier — so all
|
|
@@ -9753,23 +9795,6 @@ var ExpressionEvalError = class extends Error {
|
|
|
9753
9795
|
this.name = "ExpressionEvalError";
|
|
9754
9796
|
}
|
|
9755
9797
|
};
|
|
9756
|
-
/**
|
|
9757
|
-
* Frozen, null-prototype builtin function table for the expression engine
|
|
9758
|
-
* (spec §4 rule 4). The table is the SOLE surface of callable functions: the
|
|
9759
|
-
* parser rejects any callee not in it, and the evaluator gates each call on an
|
|
9760
|
-
* own-property check against it.
|
|
9761
|
-
*
|
|
9762
|
-
* Because the object has a NULL prototype AND is `Object.freeze`d:
|
|
9763
|
-
* - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
|
|
9764
|
-
* - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
|
|
9765
|
-
* (there is no `Object.prototype` in the chain), so those names are not
|
|
9766
|
-
* callable — they are simply "unknown function" at parse time.
|
|
9767
|
-
*
|
|
9768
|
-
* Every numeric argument is validated as a finite number and every numeric
|
|
9769
|
-
* RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
|
|
9770
|
-
* (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
|
|
9771
|
-
* closed rather than emitting a garbage value.
|
|
9772
|
-
*/
|
|
9773
9798
|
function asFiniteNumber(value, name, index) {
|
|
9774
9799
|
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
9775
9800
|
return value;
|
|
@@ -9785,6 +9810,10 @@ function finiteResult(value, name) {
|
|
|
9785
9810
|
function allFiniteNumbers(args, name) {
|
|
9786
9811
|
return args.map((a, idx) => asFiniteNumber(a, name, idx));
|
|
9787
9812
|
}
|
|
9813
|
+
function asBoolean$1(value, name, index) {
|
|
9814
|
+
if (typeof value !== "boolean") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a boolean`);
|
|
9815
|
+
return value;
|
|
9816
|
+
}
|
|
9788
9817
|
var INF = Number.POSITIVE_INFINITY;
|
|
9789
9818
|
var table = {
|
|
9790
9819
|
min: {
|
|
@@ -9885,6 +9914,40 @@ var table = {
|
|
|
9885
9914
|
if (from === to) return x;
|
|
9886
9915
|
throw new ExpressionEvalError("convert: unit conversion table not installed");
|
|
9887
9916
|
}
|
|
9917
|
+
},
|
|
9918
|
+
any: {
|
|
9919
|
+
minArgs: 1,
|
|
9920
|
+
maxArgs: INF,
|
|
9921
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "any", i)).some((b) => b)
|
|
9922
|
+
},
|
|
9923
|
+
all: {
|
|
9924
|
+
minArgs: 1,
|
|
9925
|
+
maxArgs: INF,
|
|
9926
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "all", i)).every((b) => b)
|
|
9927
|
+
},
|
|
9928
|
+
within: {
|
|
9929
|
+
minArgs: 2,
|
|
9930
|
+
maxArgs: 2,
|
|
9931
|
+
apply: (args, hooks) => {
|
|
9932
|
+
const windowMs = asFiniteNumber(args[1], "within", 1);
|
|
9933
|
+
if (windowMs < 0) throw new ExpressionEvalError("within: the window must not be negative");
|
|
9934
|
+
const at = args[0];
|
|
9935
|
+
if (at === null) return false;
|
|
9936
|
+
const ts = asFiniteNumber(at, "within", 0);
|
|
9937
|
+
const now = hooks.now;
|
|
9938
|
+
if (now === void 0 || !Number.isFinite(now)) throw new ExpressionEvalError("within: no clock was supplied to this evaluation");
|
|
9939
|
+
const inside = now - ts <= windowMs;
|
|
9940
|
+
if (inside) hooks.noteDeadline?.(ts + windowMs + 1);
|
|
9941
|
+
return inside;
|
|
9942
|
+
}
|
|
9943
|
+
},
|
|
9944
|
+
latest: {
|
|
9945
|
+
minArgs: 1,
|
|
9946
|
+
maxArgs: INF,
|
|
9947
|
+
apply: (args) => {
|
|
9948
|
+
const present = args.flatMap((a, i) => a === null ? [] : [asFiniteNumber(a, "latest", i)]);
|
|
9949
|
+
return present.length === 0 ? null : finiteResult(Math.max(...present), "latest");
|
|
9950
|
+
}
|
|
9888
9951
|
}
|
|
9889
9952
|
};
|
|
9890
9953
|
Object.freeze(Object.assign(Object.create(null), table));
|
|
@@ -10499,7 +10562,7 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
10499
10562
|
code: string().min(1).max(2e4)
|
|
10500
10563
|
})
|
|
10501
10564
|
]);
|
|
10502
|
-
object({
|
|
10565
|
+
var AutomationRecipeSchema = object({
|
|
10503
10566
|
triggers: array(AutomationTriggerSchema),
|
|
10504
10567
|
conditions: AutomationConditionSchema.optional(),
|
|
10505
10568
|
actions: array(AutomationActionSchema)
|
|
@@ -12550,6 +12613,195 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
12550
12613
|
}),
|
|
12551
12614
|
lastChangedAt: number()
|
|
12552
12615
|
});
|
|
12616
|
+
/** A composed device's stableId is this prefix plus the block id. */
|
|
12617
|
+
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
12618
|
+
/** Longest snippet a `code` source may carry (slice 4). */
|
|
12619
|
+
var MAX_COMPOSITION_CODE_LENGTH = 2e4;
|
|
12620
|
+
var CompositionSourceRefSchema = object({
|
|
12621
|
+
/** The owning addon; `stableId` is unique only within it. */
|
|
12622
|
+
addonId: string().min(1),
|
|
12623
|
+
stableId: string().min(1)
|
|
12624
|
+
});
|
|
12625
|
+
/** One field of one capability of one source device. */
|
|
12626
|
+
var CompositionFieldReadSchema = object({
|
|
12627
|
+
source: CompositionSourceRefSchema,
|
|
12628
|
+
cap: string().min(1),
|
|
12629
|
+
/** Dotted path into the source cap's runtime-state slice. */
|
|
12630
|
+
fieldPath: string().min(1)
|
|
12631
|
+
});
|
|
12632
|
+
/** `from`: copy one source field verbatim. It is also an expression's `from` binding. */
|
|
12633
|
+
var CompositionFromSourceSchema = CompositionFieldReadSchema.extend({ kind: literal("from") });
|
|
12634
|
+
var CompositionBindingSchema = discriminatedUnion("kind", [CompositionFromSourceSchema, object({
|
|
12635
|
+
kind: literal("literal"),
|
|
12636
|
+
value: union([
|
|
12637
|
+
string(),
|
|
12638
|
+
number(),
|
|
12639
|
+
boolean(),
|
|
12640
|
+
_null()
|
|
12641
|
+
])
|
|
12642
|
+
})]);
|
|
12643
|
+
/**
|
|
12644
|
+
* `expression`: a formula over named bindings, in the salvaged expression
|
|
12645
|
+
* engine. Validated at parse by the SAME function every other consumer runs,
|
|
12646
|
+
* so the editor and the store cannot disagree.
|
|
12647
|
+
*/
|
|
12648
|
+
var CompositionExpressionSourceSchema = object({
|
|
12649
|
+
kind: literal("expression"),
|
|
12650
|
+
expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
|
|
12651
|
+
bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), CompositionBindingSchema)
|
|
12652
|
+
}).superRefine((src, ctx) => {
|
|
12653
|
+
const err = validateExpressionSource(src);
|
|
12654
|
+
if (err !== null) ctx.addIssue({
|
|
12655
|
+
code: "custom",
|
|
12656
|
+
message: err,
|
|
12657
|
+
path: ["expr"]
|
|
12658
|
+
});
|
|
12659
|
+
});
|
|
12660
|
+
/** `code`: RESERVED for slice 4 (own runner, one-way eject). */
|
|
12661
|
+
var CompositionCodeSourceSchema = object({
|
|
12662
|
+
kind: literal("code"),
|
|
12663
|
+
code: string().min(1).max(MAX_COMPOSITION_CODE_LENGTH)
|
|
12664
|
+
});
|
|
12665
|
+
var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
12666
|
+
CompositionFromSourceSchema,
|
|
12667
|
+
CompositionExpressionSourceSchema,
|
|
12668
|
+
CompositionCodeSourceSchema
|
|
12669
|
+
]);
|
|
12670
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
|
|
12671
|
+
kind: literal("forward"),
|
|
12672
|
+
source: CompositionSourceRefSchema,
|
|
12673
|
+
cap: string().min(1),
|
|
12674
|
+
method: string().min(1)
|
|
12675
|
+
}), CompositionCodeSourceSchema]);
|
|
12676
|
+
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
12677
|
+
kind: literal("fields"),
|
|
12678
|
+
cap: string().min(1),
|
|
12679
|
+
fields: record(string().min(1), CompositionFieldSourceSchema).refine((fields) => Object.keys(fields).length <= 32, { message: `at most 32 fields per capability` }),
|
|
12680
|
+
/** RESERVED for slice 3; refused by the validator when non-empty. */
|
|
12681
|
+
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
12682
|
+
}), object({
|
|
12683
|
+
kind: literal("passthrough"),
|
|
12684
|
+
cap: string().min(1),
|
|
12685
|
+
source: CompositionSourceRefSchema
|
|
12686
|
+
})]);
|
|
12687
|
+
var CompositionSchema = object({
|
|
12688
|
+
target: discriminatedUnion("kind", [object({
|
|
12689
|
+
kind: literal("new"),
|
|
12690
|
+
type: _enum(DeviceType),
|
|
12691
|
+
role: _enum(DeviceRole).optional()
|
|
12692
|
+
}), object({
|
|
12693
|
+
kind: literal("existing"),
|
|
12694
|
+
device: CompositionSourceRefSchema
|
|
12695
|
+
})]),
|
|
12696
|
+
features: array(CompositionFeatureSchema).min(1).max(16)
|
|
12697
|
+
}).superRefine((composition, ctx) => {
|
|
12698
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12699
|
+
composition.features.forEach((feature, index) => {
|
|
12700
|
+
if (seen.has(feature.cap)) ctx.addIssue({
|
|
12701
|
+
code: "custom",
|
|
12702
|
+
message: `capability \`${feature.cap}\` is composed twice — one feature per capability`,
|
|
12703
|
+
path: [
|
|
12704
|
+
"features",
|
|
12705
|
+
index,
|
|
12706
|
+
"cap"
|
|
12707
|
+
]
|
|
12708
|
+
});
|
|
12709
|
+
seen.add(feature.cap);
|
|
12710
|
+
});
|
|
12711
|
+
});
|
|
12712
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
|
|
12713
|
+
var CompositionProblemSchema = object({
|
|
12714
|
+
code: _enum([
|
|
12715
|
+
"reserved-variant",
|
|
12716
|
+
"unknown-capability",
|
|
12717
|
+
"not-composable",
|
|
12718
|
+
"wrong-device-type",
|
|
12719
|
+
"has-commands",
|
|
12720
|
+
"unknown-field",
|
|
12721
|
+
"nested-field",
|
|
12722
|
+
"missing-field",
|
|
12723
|
+
"kind-mismatch",
|
|
12724
|
+
"may-be-null",
|
|
12725
|
+
"source-missing",
|
|
12726
|
+
"source-unreadable",
|
|
12727
|
+
"source-capability-missing",
|
|
12728
|
+
"source-field-unknown",
|
|
12729
|
+
"expression-invalid",
|
|
12730
|
+
"cycle",
|
|
12731
|
+
"duplicate-target"
|
|
12732
|
+
]),
|
|
12733
|
+
path: string(),
|
|
12734
|
+
message: string()
|
|
12735
|
+
});
|
|
12736
|
+
var CompositionFieldKindSchema = _enum([
|
|
12737
|
+
"string",
|
|
12738
|
+
"number",
|
|
12739
|
+
"boolean",
|
|
12740
|
+
"enum"
|
|
12741
|
+
]);
|
|
12742
|
+
/** How a field says "unavailable": `null` when its schema allows it, else the device goes offline (D393). */
|
|
12743
|
+
var CompositionUnavailableModeSchema = _enum(["null", "offline"]);
|
|
12744
|
+
/**
|
|
12745
|
+
* `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
|
|
12746
|
+
* field of its cap changes value · `constant` reads nothing, computed once.
|
|
12747
|
+
*/
|
|
12748
|
+
var CompositionFieldRoleSchema = _enum([
|
|
12749
|
+
"derived",
|
|
12750
|
+
"clock",
|
|
12751
|
+
"constant"
|
|
12752
|
+
]);
|
|
12753
|
+
var CompositionFieldPlanSchema = object({
|
|
12754
|
+
cap: string(),
|
|
12755
|
+
path: string(),
|
|
12756
|
+
/** Index into `composition.features` this field's capability came from —
|
|
12757
|
+
* lets a source/cycle problem name its path as `features[N].fields.<path>`
|
|
12758
|
+
* (the same convention `planComposition`'s own problems already use). */
|
|
12759
|
+
featureIndex: number().int().nonnegative(),
|
|
12760
|
+
kind: CompositionFieldKindSchema,
|
|
12761
|
+
nullable: boolean(),
|
|
12762
|
+
required: boolean(),
|
|
12763
|
+
unavailable: CompositionUnavailableModeSchema,
|
|
12764
|
+
role: CompositionFieldRoleSchema,
|
|
12765
|
+
source: CompositionFieldSourceSchema,
|
|
12766
|
+
reads: array(CompositionFieldReadSchema)
|
|
12767
|
+
});
|
|
12768
|
+
var CompositionValidationSchema = object({
|
|
12769
|
+
ok: boolean(),
|
|
12770
|
+
problems: array(CompositionProblemSchema),
|
|
12771
|
+
fields: array(CompositionFieldPlanSchema)
|
|
12772
|
+
});
|
|
12773
|
+
/** Mirrors `CoreBlockStatus`, pinned by `core-blocks-source.spec.ts` (Task 11). */
|
|
12774
|
+
var CompositionRunStatusSchema = _enum([
|
|
12775
|
+
"stopped",
|
|
12776
|
+
"starting",
|
|
12777
|
+
"running",
|
|
12778
|
+
"failed"
|
|
12779
|
+
]);
|
|
12780
|
+
var CompositionFieldStateKindSchema = _enum([
|
|
12781
|
+
"fresh",
|
|
12782
|
+
"stale",
|
|
12783
|
+
"unavailable"
|
|
12784
|
+
]);
|
|
12785
|
+
var CompositionFieldStateSchema = object({
|
|
12786
|
+
cap: string(),
|
|
12787
|
+
path: string(),
|
|
12788
|
+
state: CompositionFieldStateKindSchema,
|
|
12789
|
+
/** `null` whenever `state === 'unavailable'`; never a plausible stand-in (D393). */
|
|
12790
|
+
value: union([
|
|
12791
|
+
string(),
|
|
12792
|
+
number(),
|
|
12793
|
+
boolean(),
|
|
12794
|
+
_null()
|
|
12795
|
+
]),
|
|
12796
|
+
reason: string().optional()
|
|
12797
|
+
});
|
|
12798
|
+
var CompositionBlockStateSchema = object({
|
|
12799
|
+
blockId: string(),
|
|
12800
|
+
deviceId: number().nullable(),
|
|
12801
|
+
status: CompositionRunStatusSchema,
|
|
12802
|
+
reason: string().optional(),
|
|
12803
|
+
fields: array(CompositionFieldStateSchema)
|
|
12804
|
+
});
|
|
12553
12805
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
12554
12806
|
* agent is the reason placement is not fixed to the hub. */
|
|
12555
12807
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -12576,6 +12828,30 @@ var CoreBlockInputSchema = object({
|
|
|
12576
12828
|
*/
|
|
12577
12829
|
integrationId: string().optional()
|
|
12578
12830
|
});
|
|
12831
|
+
/**
|
|
12832
|
+
* What a block IS (D659). Absent means `code` — every row stored before this
|
|
12833
|
+
* union keeps working unchanged.
|
|
12834
|
+
* - `code`: the TypeScript in `code`, compiled and run in its own runner;
|
|
12835
|
+
* - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
|
|
12836
|
+
* - `composition`: declarative, run by the shared `composer`; `code` is `''`.
|
|
12837
|
+
*/
|
|
12838
|
+
var CoreBlockSourceSchema = discriminatedUnion("kind", [
|
|
12839
|
+
object({ kind: literal("code") }),
|
|
12840
|
+
object({
|
|
12841
|
+
kind: literal("recipe"),
|
|
12842
|
+
recipe: AutomationRecipeSchema
|
|
12843
|
+
}),
|
|
12844
|
+
object({
|
|
12845
|
+
kind: literal("composition"),
|
|
12846
|
+
composition: CompositionSchema
|
|
12847
|
+
})
|
|
12848
|
+
]);
|
|
12849
|
+
/** The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7). */
|
|
12850
|
+
var CompositionBlockInputSchema = object({
|
|
12851
|
+
name: string().min(1).max(120),
|
|
12852
|
+
enabled: boolean(),
|
|
12853
|
+
composition: CompositionSchema
|
|
12854
|
+
});
|
|
12579
12855
|
/** A stored block. */
|
|
12580
12856
|
var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
12581
12857
|
id: string(),
|
|
@@ -12591,8 +12867,38 @@ var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
|
12591
12867
|
*/
|
|
12592
12868
|
lastError: string().optional(),
|
|
12593
12869
|
/** Ms epoch of the last state change. */
|
|
12594
|
-
lastChangedAt: number()
|
|
12870
|
+
lastChangedAt: number(),
|
|
12871
|
+
/** What the block is. Absent means `code` (D659). */
|
|
12872
|
+
source: CoreBlockSourceSchema.optional()
|
|
12873
|
+
});
|
|
12874
|
+
/** A stored composition block and what the composer says about it. */
|
|
12875
|
+
var CompositionViewSchema = object({
|
|
12876
|
+
block: CoreBlockSchema,
|
|
12877
|
+
state: discriminatedUnion("kind", [object({
|
|
12878
|
+
kind: literal("answered"),
|
|
12879
|
+
state: CompositionBlockStateSchema.nullable()
|
|
12880
|
+
}), object({
|
|
12881
|
+
kind: literal("unreachable"),
|
|
12882
|
+
error: string()
|
|
12883
|
+
})])
|
|
12884
|
+
});
|
|
12885
|
+
/**
|
|
12886
|
+
* A read of the stored compositions. `not-loaded` while the `core_blocks`
|
|
12887
|
+
* table has not been READ: an empty answer then would make "not yet known"
|
|
12888
|
+
* look like "none", and invite the operator to recreate what exists (D315).
|
|
12889
|
+
*/
|
|
12890
|
+
var CompositionsNotLoadedSchema = object({
|
|
12891
|
+
state: literal("not-loaded"),
|
|
12892
|
+
reason: string()
|
|
12595
12893
|
});
|
|
12894
|
+
var CompositionListReadSchema = discriminatedUnion("state", [object({
|
|
12895
|
+
state: literal("loaded"),
|
|
12896
|
+
views: array(CompositionViewSchema)
|
|
12897
|
+
}), CompositionsNotLoadedSchema]);
|
|
12898
|
+
var CompositionGetReadSchema = discriminatedUnion("state", [object({
|
|
12899
|
+
state: literal("loaded"),
|
|
12900
|
+
view: CompositionViewSchema.nullable()
|
|
12901
|
+
}), CompositionsNotLoadedSchema]);
|
|
12596
12902
|
/** What a compile attempt produced. */
|
|
12597
12903
|
var CoreBlockCompileResultSchema = object({
|
|
12598
12904
|
ok: boolean(),
|
|
@@ -12630,7 +12936,72 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
12630
12936
|
}), method(object({}), object({ libs: array(object({
|
|
12631
12937
|
filePath: string(),
|
|
12632
12938
|
content: string()
|
|
12633
|
-
})) }), { auth: "admin" })
|
|
12939
|
+
})) }), { auth: "admin" }), method(object({ block: CompositionBlockInputSchema }), object({ block: CoreBlockSchema }), {
|
|
12940
|
+
kind: "mutation",
|
|
12941
|
+
auth: "admin",
|
|
12942
|
+
caller: "required"
|
|
12943
|
+
}), method(object({
|
|
12944
|
+
blockId: string(),
|
|
12945
|
+
expectedUpdatedAt: number(),
|
|
12946
|
+
block: CompositionBlockInputSchema.partial()
|
|
12947
|
+
}), object({ block: CoreBlockSchema }), {
|
|
12948
|
+
kind: "mutation",
|
|
12949
|
+
auth: "admin",
|
|
12950
|
+
caller: "required"
|
|
12951
|
+
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
12952
|
+
composition: CompositionSchema,
|
|
12953
|
+
blockId: string().optional()
|
|
12954
|
+
}), CompositionValidationSchema, {
|
|
12955
|
+
kind: "mutation",
|
|
12956
|
+
auth: "admin",
|
|
12957
|
+
access: "view"
|
|
12958
|
+
});
|
|
12959
|
+
var ComposerBlockSchema = object({
|
|
12960
|
+
id: string().min(1),
|
|
12961
|
+
name: string().min(1).max(120),
|
|
12962
|
+
enabled: boolean(),
|
|
12963
|
+
updatedAt: number(),
|
|
12964
|
+
composition: CompositionSchema
|
|
12965
|
+
});
|
|
12966
|
+
/**
|
|
12967
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
12968
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
12969
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
12970
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
12971
|
+
*/
|
|
12972
|
+
var ComposerUnreadableBlockSchema = object({
|
|
12973
|
+
id: string().min(1),
|
|
12974
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
12975
|
+
name: string().nullable(),
|
|
12976
|
+
/** The parse error, in the operator's words. */
|
|
12977
|
+
error: string()
|
|
12978
|
+
});
|
|
12979
|
+
method(object({
|
|
12980
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
12981
|
+
integrationId: string().nullable(),
|
|
12982
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
12983
|
+
storeLoaded: boolean(),
|
|
12984
|
+
blocks: array(ComposerBlockSchema),
|
|
12985
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
12986
|
+
restartBlockIds: array(string()),
|
|
12987
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
12988
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
12989
|
+
}), object({
|
|
12990
|
+
blocks: array(object({
|
|
12991
|
+
blockId: string(),
|
|
12992
|
+
status: CompositionRunStatusSchema,
|
|
12993
|
+
reason: string().optional()
|
|
12994
|
+
})),
|
|
12995
|
+
/**
|
|
12996
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
12997
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
12998
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
12999
|
+
*/
|
|
13000
|
+
acted: boolean()
|
|
13001
|
+
}), {
|
|
13002
|
+
kind: "mutation",
|
|
13003
|
+
auth: "admin"
|
|
13004
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
12634
13005
|
/**
|
|
12635
13006
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
12636
13007
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -18375,8 +18746,8 @@ var NcTestResultSchema = object({
|
|
|
18375
18746
|
className: string().optional(),
|
|
18376
18747
|
label: string().optional()
|
|
18377
18748
|
});
|
|
18378
|
-
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
18379
|
-
*
|
|
18749
|
+
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
18750
|
+
* `z.infer` of this schema — one shape, no twin. `mixed` is DERIVED
|
|
18380
18751
|
* (a stored system rule whose kinds span families, D637) and never authored. */
|
|
18381
18752
|
var NcRuleKindSchema = _enum([
|
|
18382
18753
|
"detection",
|
|
@@ -34446,6 +34817,38 @@ DeviceType.Camera, method(object({
|
|
|
34446
34817
|
detection: array(ZoneRuleSchema).readonly(),
|
|
34447
34818
|
package: array(ZoneRuleSchema).readonly()
|
|
34448
34819
|
});
|
|
34820
|
+
var NUMBER = {
|
|
34821
|
+
kind: "fixed",
|
|
34822
|
+
result: ["number"]
|
|
34823
|
+
};
|
|
34824
|
+
var BOOLEAN = {
|
|
34825
|
+
kind: "fixed",
|
|
34826
|
+
result: ["boolean"]
|
|
34827
|
+
};
|
|
34828
|
+
Object.freeze({
|
|
34829
|
+
min: NUMBER,
|
|
34830
|
+
max: NUMBER,
|
|
34831
|
+
abs: NUMBER,
|
|
34832
|
+
floor: NUMBER,
|
|
34833
|
+
ceil: NUMBER,
|
|
34834
|
+
sqrt: NUMBER,
|
|
34835
|
+
round: NUMBER,
|
|
34836
|
+
pow: NUMBER,
|
|
34837
|
+
clamp: NUMBER,
|
|
34838
|
+
avg: NUMBER,
|
|
34839
|
+
sum: NUMBER,
|
|
34840
|
+
age: NUMBER,
|
|
34841
|
+
convert: NUMBER,
|
|
34842
|
+
coalesce: { kind: "coalesce" },
|
|
34843
|
+
any: BOOLEAN,
|
|
34844
|
+
all: BOOLEAN,
|
|
34845
|
+
within: BOOLEAN,
|
|
34846
|
+
latest: {
|
|
34847
|
+
kind: "fixed",
|
|
34848
|
+
result: ["number", "null"]
|
|
34849
|
+
}
|
|
34850
|
+
});
|
|
34851
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
34449
34852
|
/**
|
|
34450
34853
|
* Accessory device helpers — shared across drivers.
|
|
34451
34854
|
*
|
|
@@ -36754,6 +37157,18 @@ Object.freeze({
|
|
|
36754
37157
|
addonId: null,
|
|
36755
37158
|
access: "create"
|
|
36756
37159
|
},
|
|
37160
|
+
"composer.applyBlocks": {
|
|
37161
|
+
capName: "composer",
|
|
37162
|
+
capScope: "system",
|
|
37163
|
+
addonId: null,
|
|
37164
|
+
access: "create"
|
|
37165
|
+
},
|
|
37166
|
+
"composer.getStates": {
|
|
37167
|
+
capName: "composer",
|
|
37168
|
+
capScope: "system",
|
|
37169
|
+
addonId: null,
|
|
37170
|
+
access: "view"
|
|
37171
|
+
},
|
|
36757
37172
|
"connectionTest.describeTest": {
|
|
36758
37173
|
capName: "connection-test",
|
|
36759
37174
|
capScope: "system",
|
|
@@ -36814,6 +37229,12 @@ Object.freeze({
|
|
|
36814
37229
|
addonId: null,
|
|
36815
37230
|
access: "create"
|
|
36816
37231
|
},
|
|
37232
|
+
"coreBlocks.createComposition": {
|
|
37233
|
+
capName: "core-blocks",
|
|
37234
|
+
capScope: "system",
|
|
37235
|
+
addonId: null,
|
|
37236
|
+
access: "create"
|
|
37237
|
+
},
|
|
36817
37238
|
"coreBlocks.delete": {
|
|
36818
37239
|
capName: "core-blocks",
|
|
36819
37240
|
capScope: "system",
|
|
@@ -36826,6 +37247,12 @@ Object.freeze({
|
|
|
36826
37247
|
addonId: null,
|
|
36827
37248
|
access: "view"
|
|
36828
37249
|
},
|
|
37250
|
+
"coreBlocks.getComposition": {
|
|
37251
|
+
capName: "core-blocks",
|
|
37252
|
+
capScope: "system",
|
|
37253
|
+
addonId: null,
|
|
37254
|
+
access: "view"
|
|
37255
|
+
},
|
|
36829
37256
|
"coreBlocks.getTypeDefs": {
|
|
36830
37257
|
capName: "core-blocks",
|
|
36831
37258
|
capScope: "system",
|
|
@@ -36838,6 +37265,12 @@ Object.freeze({
|
|
|
36838
37265
|
addonId: null,
|
|
36839
37266
|
access: "view"
|
|
36840
37267
|
},
|
|
37268
|
+
"coreBlocks.listCompositions": {
|
|
37269
|
+
capName: "core-blocks",
|
|
37270
|
+
capScope: "system",
|
|
37271
|
+
addonId: null,
|
|
37272
|
+
access: "view"
|
|
37273
|
+
},
|
|
36841
37274
|
"coreBlocks.restart": {
|
|
36842
37275
|
capName: "core-blocks",
|
|
36843
37276
|
capScope: "system",
|
|
@@ -36856,6 +37289,18 @@ Object.freeze({
|
|
|
36856
37289
|
addonId: null,
|
|
36857
37290
|
access: "create"
|
|
36858
37291
|
},
|
|
37292
|
+
"coreBlocks.updateComposition": {
|
|
37293
|
+
capName: "core-blocks",
|
|
37294
|
+
capScope: "system",
|
|
37295
|
+
addonId: null,
|
|
37296
|
+
access: "create"
|
|
37297
|
+
},
|
|
37298
|
+
"coreBlocks.validateComposition": {
|
|
37299
|
+
capName: "core-blocks",
|
|
37300
|
+
capScope: "system",
|
|
37301
|
+
addonId: null,
|
|
37302
|
+
access: "view"
|
|
37303
|
+
},
|
|
36859
37304
|
"cover.close": {
|
|
36860
37305
|
capName: "cover",
|
|
36861
37306
|
capScope: "device",
|
|
@@ -45835,7 +46280,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
45835
46280
|
capability: adminUiCapability,
|
|
45836
46281
|
provider: {
|
|
45837
46282
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
45838
|
-
getVersion: async () => ({ version: "1.2.
|
|
46283
|
+
getVersion: async () => ({ version: "1.2.277" })
|
|
45839
46284
|
}
|
|
45840
46285
|
}];
|
|
45841
46286
|
}
|