@camstack/addon-agent-ui 1.2.149 → 1.2.151
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/addon.js +535 -68
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -5361,7 +5361,7 @@ var ZodIssueCode = {
|
|
|
5361
5361
|
var ZodFirstPartyTypeKind;
|
|
5362
5362
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5363
5363
|
//#endregion
|
|
5364
|
-
//#region ../types/dist/sleep-
|
|
5364
|
+
//#region ../types/dist/sleep-DC-wdyeS.mjs
|
|
5365
5365
|
/**
|
|
5366
5366
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5367
5367
|
* window to float samples (D455).
|
|
@@ -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)
|
|
@@ -10967,12 +11030,32 @@ var AudioClassificationLabelSchema = object({
|
|
|
10967
11030
|
originalClass: string().optional(),
|
|
10968
11031
|
score: number()
|
|
10969
11032
|
});
|
|
11033
|
+
/**
|
|
11034
|
+
* Did the classifier RUN on this window? (D660)
|
|
11035
|
+
*
|
|
11036
|
+
* `classified` with no labels means the model heard nothing above the
|
|
11037
|
+
* camera's floor. `not-classified` means nobody listened — and until D660 the
|
|
11038
|
+
* two were the same shape (`classification` absent), so a window the global
|
|
11039
|
+
* busy gate threw away read downstream exactly like a quiet one (D393).
|
|
11040
|
+
*/
|
|
11041
|
+
var AudioClassifyOutcomeSchema = discriminatedUnion("state", [object({ state: literal("classified") }), object({
|
|
11042
|
+
state: literal("not-classified"),
|
|
11043
|
+
reason: _enum([
|
|
11044
|
+
"superseded",
|
|
11045
|
+
"error",
|
|
11046
|
+
"timeout",
|
|
11047
|
+
"disposed"
|
|
11048
|
+
])
|
|
11049
|
+
})]);
|
|
10970
11050
|
var AudioAnalysisResultSchema = object({
|
|
10971
11051
|
level: AudioLevelSchema,
|
|
11052
|
+
/** Labels at or above the camera's floor. Absent = none — read `classifyOutcome` to know whether the model ran at all. */
|
|
10972
11053
|
classification: object({
|
|
10973
11054
|
labels: array(AudioClassificationLabelSchema).readonly(),
|
|
10974
11055
|
inferenceMs: number()
|
|
10975
11056
|
}).optional(),
|
|
11057
|
+
/** Whether the classifier ran on this window (D660). */
|
|
11058
|
+
classifyOutcome: AudioClassifyOutcomeSchema,
|
|
10976
11059
|
timestamp: number()
|
|
10977
11060
|
});
|
|
10978
11061
|
var AudioAnalysisSettingsSchema = object({
|
|
@@ -12530,6 +12613,195 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
12530
12613
|
}),
|
|
12531
12614
|
lastChangedAt: number()
|
|
12532
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
|
+
});
|
|
12533
12805
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
12534
12806
|
* agent is the reason placement is not fixed to the hub. */
|
|
12535
12807
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -12556,6 +12828,30 @@ var CoreBlockInputSchema = object({
|
|
|
12556
12828
|
*/
|
|
12557
12829
|
integrationId: string().optional()
|
|
12558
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
|
+
});
|
|
12559
12855
|
/** A stored block. */
|
|
12560
12856
|
var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
12561
12857
|
id: string(),
|
|
@@ -12571,8 +12867,38 @@ var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
|
12571
12867
|
*/
|
|
12572
12868
|
lastError: string().optional(),
|
|
12573
12869
|
/** Ms epoch of the last state change. */
|
|
12574
|
-
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
|
+
})])
|
|
12575
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()
|
|
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]);
|
|
12576
12902
|
/** What a compile attempt produced. */
|
|
12577
12903
|
var CoreBlockCompileResultSchema = object({
|
|
12578
12904
|
ok: boolean(),
|
|
@@ -12610,7 +12936,72 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
12610
12936
|
}), method(object({}), object({ libs: array(object({
|
|
12611
12937
|
filePath: string(),
|
|
12612
12938
|
content: string()
|
|
12613
|
-
})) }), { 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" });
|
|
12614
13005
|
/**
|
|
12615
13006
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
12616
13007
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -13909,8 +14300,22 @@ var LinkedDeviceSchema = object({
|
|
|
13909
14300
|
* The `linked-devices` extension slot's editable value (D648): the operator's
|
|
13910
14301
|
* pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
|
|
13911
14302
|
* in it — they are always linked and are not a pick.
|
|
13912
|
-
|
|
13913
|
-
|
|
14303
|
+
*
|
|
14304
|
+
* `trackedDeviceIds` (D655) is the tracked-event opt-in, exactly what
|
|
14305
|
+
* `_linkedDeviceTrackedIds` persists: which linked devices materialize a
|
|
14306
|
+
* synthetic tracked event on the camera. A read always carries it AS STORED
|
|
14307
|
+
* (an absent key reads as `[]`, which is what the resolver makes of it —
|
|
14308
|
+
* NONE). On a write it is optional: absent leaves the opt-in untouched, so a
|
|
14309
|
+
* card built before D655 cannot erase it by saving the pick list. A present
|
|
14310
|
+
* list REPLACES the opt-in; each id must be a pick, a device the camera links
|
|
14311
|
+
* by structure (the row's `impliedSources`: tree children, a picked
|
|
14312
|
+
* container's child) or already stored — so what was read can always be
|
|
14313
|
+
* written back unchanged, and a NEW opt-in outside the linked set is refused.
|
|
14314
|
+
*/
|
|
14315
|
+
var LinkedDevicesSlotValueSchema = object({
|
|
14316
|
+
deviceIds: array(number().int().positive()),
|
|
14317
|
+
trackedDeviceIds: array(number().int().positive()).optional()
|
|
14318
|
+
});
|
|
13914
14319
|
DeviceType.Camera;
|
|
13915
14320
|
/** One camera's resolved linked set, tagged with the camera it belongs to.
|
|
13916
14321
|
* The batch answer needs the tag; the single-device answer already has it
|
|
@@ -18341,8 +18746,8 @@ var NcTestResultSchema = object({
|
|
|
18341
18746
|
className: string().optional(),
|
|
18342
18747
|
label: string().optional()
|
|
18343
18748
|
});
|
|
18344
|
-
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
18345
|
-
*
|
|
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
|
|
18346
18751
|
* (a stored system rule whose kinds span families, D637) and never authored. */
|
|
18347
18752
|
var NcRuleKindSchema = _enum([
|
|
18348
18753
|
"detection",
|
|
@@ -20241,6 +20646,13 @@ var AudioEventSchema = object({
|
|
|
20241
20646
|
originalClass: string().optional(),
|
|
20242
20647
|
score: number()
|
|
20243
20648
|
}).optional(),
|
|
20649
|
+
/**
|
|
20650
|
+
* Whether the classifier RAN on the window behind this row (D660). Absent
|
|
20651
|
+
* on rows written before D660 — unknown, NOT classified: until then a
|
|
20652
|
+
* window the analyzer's busy gate threw away was stored exactly like one
|
|
20653
|
+
* that heard nothing above the floor.
|
|
20654
|
+
*/
|
|
20655
|
+
classifyOutcome: AudioClassifyOutcomeSchema.optional(),
|
|
20244
20656
|
/** Populated by B5 (recording playback URL for this event). */
|
|
20245
20657
|
mediaUrl: string().optional()
|
|
20246
20658
|
});
|
|
@@ -21832,7 +22244,14 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
|
|
|
21832
22244
|
height: number()
|
|
21833
22245
|
}), { kind: "mutation" }), method(object({
|
|
21834
22246
|
stepId: string(),
|
|
21835
|
-
frameId: number().int()
|
|
22247
|
+
frameId: number().int(),
|
|
22248
|
+
/**
|
|
22249
|
+
* The model to time — REQUIRED (D658). Without it the pool answered the
|
|
22250
|
+
* step's ACTIVE variant (the first loaded after boot), so a benchmark
|
|
22251
|
+
* of model B silently timed model A. Callers pass the `rootModelId`
|
|
22252
|
+
* their warmup `runPipeline` reported: the model that actually ran.
|
|
22253
|
+
*/
|
|
22254
|
+
modelId: string().min(1)
|
|
21836
22255
|
}), record(string(), unknown()), { kind: "mutation" }), method(object({ frameId: number().int() }), _void(), { kind: "mutation" }), method(object({ deviceKey: string().optional() }), EffectiveTuningSchema), method(_void(), array(object({
|
|
21837
22256
|
engineKey: string(),
|
|
21838
22257
|
engine: PipelineEngineChoiceSchema,
|
|
@@ -25794,7 +26213,17 @@ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
|
|
|
25794
26213
|
projects: string().nullable(),
|
|
25795
26214
|
activation: ExtensionSlotActivationSchema.nullable(),
|
|
25796
26215
|
value: ExtensionSlotValueSchema,
|
|
25797
|
-
sources: array(ExtensionSlotSourceSchema)
|
|
26216
|
+
sources: array(ExtensionSlotSourceSchema),
|
|
26217
|
+
/**
|
|
26218
|
+
* Devices the owner links to the host ON ITS OWN, by structure, and that
|
|
26219
|
+
* are therefore not in `value` (D655): a camera's device-tree children, and
|
|
26220
|
+
* the child a picked container stands for (D356 — a container is never a
|
|
26221
|
+
* pick, its children are). Read-only; the editor shows them and may offer
|
|
26222
|
+
* per-device options on them (the linked-devices tracked-event opt-in).
|
|
26223
|
+
* Absent when the owner links nothing beyond the picks, and from an owner
|
|
26224
|
+
* older than D655.
|
|
26225
|
+
*/
|
|
26226
|
+
impliedSources: array(ExtensionSlotSourceSchema).optional()
|
|
25798
26227
|
}), object({
|
|
25799
26228
|
state: literal("unreachable"),
|
|
25800
26229
|
addonId: string(),
|
|
@@ -34388,6 +34817,38 @@ DeviceType.Camera, method(object({
|
|
|
34388
34817
|
detection: array(ZoneRuleSchema).readonly(),
|
|
34389
34818
|
package: array(ZoneRuleSchema).readonly()
|
|
34390
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}`;
|
|
34391
34852
|
/**
|
|
34392
34853
|
* Accessory device helpers — shared across drivers.
|
|
34393
34854
|
*
|
|
@@ -36696,6 +37157,18 @@ Object.freeze({
|
|
|
36696
37157
|
addonId: null,
|
|
36697
37158
|
access: "create"
|
|
36698
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
|
+
},
|
|
36699
37172
|
"connectionTest.describeTest": {
|
|
36700
37173
|
capName: "connection-test",
|
|
36701
37174
|
capScope: "system",
|
|
@@ -36756,6 +37229,12 @@ Object.freeze({
|
|
|
36756
37229
|
addonId: null,
|
|
36757
37230
|
access: "create"
|
|
36758
37231
|
},
|
|
37232
|
+
"coreBlocks.createComposition": {
|
|
37233
|
+
capName: "core-blocks",
|
|
37234
|
+
capScope: "system",
|
|
37235
|
+
addonId: null,
|
|
37236
|
+
access: "create"
|
|
37237
|
+
},
|
|
36759
37238
|
"coreBlocks.delete": {
|
|
36760
37239
|
capName: "core-blocks",
|
|
36761
37240
|
capScope: "system",
|
|
@@ -36768,6 +37247,12 @@ Object.freeze({
|
|
|
36768
37247
|
addonId: null,
|
|
36769
37248
|
access: "view"
|
|
36770
37249
|
},
|
|
37250
|
+
"coreBlocks.getComposition": {
|
|
37251
|
+
capName: "core-blocks",
|
|
37252
|
+
capScope: "system",
|
|
37253
|
+
addonId: null,
|
|
37254
|
+
access: "view"
|
|
37255
|
+
},
|
|
36771
37256
|
"coreBlocks.getTypeDefs": {
|
|
36772
37257
|
capName: "core-blocks",
|
|
36773
37258
|
capScope: "system",
|
|
@@ -36780,6 +37265,12 @@ Object.freeze({
|
|
|
36780
37265
|
addonId: null,
|
|
36781
37266
|
access: "view"
|
|
36782
37267
|
},
|
|
37268
|
+
"coreBlocks.listCompositions": {
|
|
37269
|
+
capName: "core-blocks",
|
|
37270
|
+
capScope: "system",
|
|
37271
|
+
addonId: null,
|
|
37272
|
+
access: "view"
|
|
37273
|
+
},
|
|
36783
37274
|
"coreBlocks.restart": {
|
|
36784
37275
|
capName: "core-blocks",
|
|
36785
37276
|
capScope: "system",
|
|
@@ -36798,6 +37289,18 @@ Object.freeze({
|
|
|
36798
37289
|
addonId: null,
|
|
36799
37290
|
access: "create"
|
|
36800
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
|
+
},
|
|
36801
37304
|
"cover.close": {
|
|
36802
37305
|
capName: "cover",
|
|
36803
37306
|
capScope: "device",
|
|
@@ -37284,12 +37787,6 @@ Object.freeze({
|
|
|
37284
37787
|
addonId: null,
|
|
37285
37788
|
access: "create"
|
|
37286
37789
|
},
|
|
37287
|
-
"deviceManager.applyDeviceSettingsPatch": {
|
|
37288
|
-
capName: "device-manager",
|
|
37289
|
-
capScope: "system",
|
|
37290
|
-
addonId: null,
|
|
37291
|
-
access: "create"
|
|
37292
|
-
},
|
|
37293
37790
|
"deviceManager.applyInitialMeta": {
|
|
37294
37791
|
capName: "device-manager",
|
|
37295
37792
|
capScope: "system",
|
|
@@ -37392,12 +37889,6 @@ Object.freeze({
|
|
|
37392
37889
|
addonId: null,
|
|
37393
37890
|
access: "view"
|
|
37394
37891
|
},
|
|
37395
|
-
"deviceManager.getDeviceLiveContribution": {
|
|
37396
|
-
capName: "device-manager",
|
|
37397
|
-
capScope: "system",
|
|
37398
|
-
addonId: null,
|
|
37399
|
-
access: "view"
|
|
37400
|
-
},
|
|
37401
37892
|
"deviceManager.getDeviceLiveInfoAggregate": {
|
|
37402
37893
|
capName: "device-manager",
|
|
37403
37894
|
capScope: "system",
|
|
@@ -37410,12 +37901,6 @@ Object.freeze({
|
|
|
37410
37901
|
addonId: null,
|
|
37411
37902
|
access: "view"
|
|
37412
37903
|
},
|
|
37413
|
-
"deviceManager.getDeviceSettingsContribution": {
|
|
37414
|
-
capName: "device-manager",
|
|
37415
|
-
capScope: "system",
|
|
37416
|
-
addonId: null,
|
|
37417
|
-
access: "view"
|
|
37418
|
-
},
|
|
37419
37904
|
"deviceManager.getDeviceStatusAggregate": {
|
|
37420
37905
|
capName: "device-manager",
|
|
37421
37906
|
capScope: "system",
|
|
@@ -37920,24 +38405,6 @@ Object.freeze({
|
|
|
37920
38405
|
addonId: null,
|
|
37921
38406
|
access: "view"
|
|
37922
38407
|
},
|
|
37923
|
-
"doorbell.applyDeviceSettingsPatch": {
|
|
37924
|
-
capName: "doorbell",
|
|
37925
|
-
capScope: "device",
|
|
37926
|
-
addonId: null,
|
|
37927
|
-
access: "create"
|
|
37928
|
-
},
|
|
37929
|
-
"doorbell.getDeviceLiveContribution": {
|
|
37930
|
-
capName: "doorbell",
|
|
37931
|
-
capScope: "device",
|
|
37932
|
-
addonId: null,
|
|
37933
|
-
access: "view"
|
|
37934
|
-
},
|
|
37935
|
-
"doorbell.getDeviceSettingsContribution": {
|
|
37936
|
-
capName: "doorbell",
|
|
37937
|
-
capScope: "device",
|
|
37938
|
-
addonId: null,
|
|
37939
|
-
access: "view"
|
|
37940
|
-
},
|
|
37941
38408
|
"doorbell.getStatus": {
|
|
37942
38409
|
capName: "doorbell",
|
|
37943
38410
|
capScope: "device",
|
|
@@ -45815,7 +46282,7 @@ var AgentUIAddon = class extends BaseAddon {
|
|
|
45815
46282
|
capability: adminUiCapability,
|
|
45816
46283
|
provider: {
|
|
45817
46284
|
getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
|
|
45818
|
-
getVersion: async () => ({ version: "1.2.
|
|
46285
|
+
getVersion: async () => ({ version: "1.2.151" })
|
|
45819
46286
|
}
|
|
45820
46287
|
}];
|
|
45821
46288
|
}
|