@camstack/addon-pipeline-orchestrator 1.2.260 → 1.2.261
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/_stub.js +2 -2
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-CzKa9ewx.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-Cyq-KC8w.mjs} +2 -2
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DAPKENRp.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CzPdruOe.mjs +26 -0
- package/dist/{hostInit-Bwu2qcLu.mjs → hostInit-DSh3QF79.mjs} +2 -2
- package/dist/index.js +484 -26
- package/dist/index.mjs +484 -26
- package/dist/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DkNxpHH4.mjs +0 -26
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-D_u-oOmQ.mjs +0 -26
package/dist/index.js
CHANGED
|
@@ -10479,6 +10479,48 @@ var ModelProviderIdSchema = _enum([
|
|
|
10479
10479
|
"scrypted",
|
|
10480
10480
|
"custom"
|
|
10481
10481
|
]);
|
|
10482
|
+
/**
|
|
10483
|
+
* The licence of a model, as a record rather than a bare SPDX string: a
|
|
10484
|
+
* permissive CODE licence routinely sits on top of restrictive WEIGHTS or
|
|
10485
|
+
* DATA, and the obligations (attribution, modification notices, source offers)
|
|
10486
|
+
* are per upstream. A persisted custom-model row written when this field was a
|
|
10487
|
+
* string still parses — the string is lifted into `{ weights }`.
|
|
10488
|
+
*
|
|
10489
|
+
* Every licence surface (the admin "Models and licenses" page,
|
|
10490
|
+
* `THIRD_PARTY_MODELS.md`, the Hugging Face model table) is GENERATED from
|
|
10491
|
+
* these records by `scripts/gen-model-licenses.ts` (D661).
|
|
10492
|
+
*/
|
|
10493
|
+
var ModelLicenseSchema = preprocess((value) => typeof value === "string" ? { weights: value } : value, object({
|
|
10494
|
+
/** SPDX id of the WEIGHTS' terms, a `LicenseRef-*` for non-SPDX terms, or `UNKNOWN`. */
|
|
10495
|
+
weights: string().min(1),
|
|
10496
|
+
/** SPDX id of the upstream code that defines / trained the network. */
|
|
10497
|
+
code: string().min(1).optional(),
|
|
10498
|
+
/** Training data whose terms add obligations (attribution, non-commercial). */
|
|
10499
|
+
data: object({
|
|
10500
|
+
name: string().min(1),
|
|
10501
|
+
terms: string().min(1),
|
|
10502
|
+
url: string().url().optional()
|
|
10503
|
+
}).optional(),
|
|
10504
|
+
/** The project the weights come from. Required on built-in entries (guard). */
|
|
10505
|
+
upstream: object({
|
|
10506
|
+
name: string().min(1),
|
|
10507
|
+
url: string().url()
|
|
10508
|
+
}).optional(),
|
|
10509
|
+
/** Where the licence text governing the weights is published. */
|
|
10510
|
+
url: string().url().optional(),
|
|
10511
|
+
/** Attribution the licence REQUIRES, verbatim. */
|
|
10512
|
+
attribution: string().min(1).optional(),
|
|
10513
|
+
/** What CamStack changed. Required when `hosting` is `camstack-hf` (guard). */
|
|
10514
|
+
modifications: string().min(1).optional(),
|
|
10515
|
+
/** Who serves the file a node downloads. */
|
|
10516
|
+
hosting: _enum([
|
|
10517
|
+
"camstack-hf",
|
|
10518
|
+
"third-party",
|
|
10519
|
+
"built-in"
|
|
10520
|
+
]).optional(),
|
|
10521
|
+
/** True when the weights or their data forbid commercial use. */
|
|
10522
|
+
nonCommercial: boolean().optional()
|
|
10523
|
+
}));
|
|
10482
10524
|
var ModelCatalogEntrySchema = object({
|
|
10483
10525
|
id: string(),
|
|
10484
10526
|
name: string(),
|
|
@@ -10567,11 +10609,11 @@ var ModelCatalogEntrySchema = object({
|
|
|
10567
10609
|
p95LatencyMs: record(string(), number()).optional()
|
|
10568
10610
|
}).optional(),
|
|
10569
10611
|
/**
|
|
10570
|
-
*
|
|
10571
|
-
*
|
|
10572
|
-
*
|
|
10612
|
+
* The model's licence record — see {@link ModelLicenseSchema}. Optional in
|
|
10613
|
+
* the schema (a custom model's author may state none); REQUIRED and complete
|
|
10614
|
+
* on every built-in catalog entry (`scripts/check-catalog-licence.ts`).
|
|
10573
10615
|
*/
|
|
10574
|
-
license:
|
|
10616
|
+
license: ModelLicenseSchema.optional(),
|
|
10575
10617
|
/**
|
|
10576
10618
|
* Variant-selector grouping. The UI groups models by `family` + `tier` and
|
|
10577
10619
|
* offers `precision` / `optimization` as variant axes WITHIN a tier — so all
|
|
@@ -10666,23 +10708,6 @@ var ExpressionEvalError = class extends Error {
|
|
|
10666
10708
|
this.name = "ExpressionEvalError";
|
|
10667
10709
|
}
|
|
10668
10710
|
};
|
|
10669
|
-
/**
|
|
10670
|
-
* Frozen, null-prototype builtin function table for the expression engine
|
|
10671
|
-
* (spec §4 rule 4). The table is the SOLE surface of callable functions: the
|
|
10672
|
-
* parser rejects any callee not in it, and the evaluator gates each call on an
|
|
10673
|
-
* own-property check against it.
|
|
10674
|
-
*
|
|
10675
|
-
* Because the object has a NULL prototype AND is `Object.freeze`d:
|
|
10676
|
-
* - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
|
|
10677
|
-
* - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
|
|
10678
|
-
* (there is no `Object.prototype` in the chain), so those names are not
|
|
10679
|
-
* callable — they are simply "unknown function" at parse time.
|
|
10680
|
-
*
|
|
10681
|
-
* Every numeric argument is validated as a finite number and every numeric
|
|
10682
|
-
* RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
|
|
10683
|
-
* (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
|
|
10684
|
-
* closed rather than emitting a garbage value.
|
|
10685
|
-
*/
|
|
10686
10711
|
function asFiniteNumber(value, name, index) {
|
|
10687
10712
|
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
10688
10713
|
return value;
|
|
@@ -10698,6 +10723,10 @@ function finiteResult(value, name) {
|
|
|
10698
10723
|
function allFiniteNumbers(args, name) {
|
|
10699
10724
|
return args.map((a, idx) => asFiniteNumber(a, name, idx));
|
|
10700
10725
|
}
|
|
10726
|
+
function asBoolean$1(value, name, index) {
|
|
10727
|
+
if (typeof value !== "boolean") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a boolean`);
|
|
10728
|
+
return value;
|
|
10729
|
+
}
|
|
10701
10730
|
var INF = Number.POSITIVE_INFINITY;
|
|
10702
10731
|
var table = {
|
|
10703
10732
|
min: {
|
|
@@ -10798,6 +10827,40 @@ var table = {
|
|
|
10798
10827
|
if (from === to) return x;
|
|
10799
10828
|
throw new ExpressionEvalError("convert: unit conversion table not installed");
|
|
10800
10829
|
}
|
|
10830
|
+
},
|
|
10831
|
+
any: {
|
|
10832
|
+
minArgs: 1,
|
|
10833
|
+
maxArgs: INF,
|
|
10834
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "any", i)).some((b) => b)
|
|
10835
|
+
},
|
|
10836
|
+
all: {
|
|
10837
|
+
minArgs: 1,
|
|
10838
|
+
maxArgs: INF,
|
|
10839
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "all", i)).every((b) => b)
|
|
10840
|
+
},
|
|
10841
|
+
within: {
|
|
10842
|
+
minArgs: 2,
|
|
10843
|
+
maxArgs: 2,
|
|
10844
|
+
apply: (args, hooks) => {
|
|
10845
|
+
const windowMs = asFiniteNumber(args[1], "within", 1);
|
|
10846
|
+
if (windowMs < 0) throw new ExpressionEvalError("within: the window must not be negative");
|
|
10847
|
+
const at = args[0];
|
|
10848
|
+
if (at === null) return false;
|
|
10849
|
+
const ts = asFiniteNumber(at, "within", 0);
|
|
10850
|
+
const now = hooks.now;
|
|
10851
|
+
if (now === void 0 || !Number.isFinite(now)) throw new ExpressionEvalError("within: no clock was supplied to this evaluation");
|
|
10852
|
+
const inside = now - ts <= windowMs;
|
|
10853
|
+
if (inside) hooks.noteDeadline?.(ts + windowMs + 1);
|
|
10854
|
+
return inside;
|
|
10855
|
+
}
|
|
10856
|
+
},
|
|
10857
|
+
latest: {
|
|
10858
|
+
minArgs: 1,
|
|
10859
|
+
maxArgs: INF,
|
|
10860
|
+
apply: (args) => {
|
|
10861
|
+
const present = args.flatMap((a, i) => a === null ? [] : [asFiniteNumber(a, "latest", i)]);
|
|
10862
|
+
return present.length === 0 ? null : finiteResult(Math.max(...present), "latest");
|
|
10863
|
+
}
|
|
10801
10864
|
}
|
|
10802
10865
|
};
|
|
10803
10866
|
Object.freeze(Object.assign(Object.create(null), table));
|
|
@@ -11412,7 +11475,7 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
11412
11475
|
code: string().min(1).max(2e4)
|
|
11413
11476
|
})
|
|
11414
11477
|
]);
|
|
11415
|
-
object({
|
|
11478
|
+
var AutomationRecipeSchema = object({
|
|
11416
11479
|
triggers: array(AutomationTriggerSchema),
|
|
11417
11480
|
conditions: AutomationConditionSchema.optional(),
|
|
11418
11481
|
actions: array(AutomationActionSchema)
|
|
@@ -13520,6 +13583,195 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
13520
13583
|
}),
|
|
13521
13584
|
lastChangedAt: number()
|
|
13522
13585
|
});
|
|
13586
|
+
/** A composed device's stableId is this prefix plus the block id. */
|
|
13587
|
+
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
13588
|
+
/** Longest snippet a `code` source may carry (slice 4). */
|
|
13589
|
+
var MAX_COMPOSITION_CODE_LENGTH = 2e4;
|
|
13590
|
+
var CompositionSourceRefSchema = object({
|
|
13591
|
+
/** The owning addon; `stableId` is unique only within it. */
|
|
13592
|
+
addonId: string().min(1),
|
|
13593
|
+
stableId: string().min(1)
|
|
13594
|
+
});
|
|
13595
|
+
/** One field of one capability of one source device. */
|
|
13596
|
+
var CompositionFieldReadSchema = object({
|
|
13597
|
+
source: CompositionSourceRefSchema,
|
|
13598
|
+
cap: string().min(1),
|
|
13599
|
+
/** Dotted path into the source cap's runtime-state slice. */
|
|
13600
|
+
fieldPath: string().min(1)
|
|
13601
|
+
});
|
|
13602
|
+
/** `from`: copy one source field verbatim. It is also an expression's `from` binding. */
|
|
13603
|
+
var CompositionFromSourceSchema = CompositionFieldReadSchema.extend({ kind: literal("from") });
|
|
13604
|
+
var CompositionBindingSchema = discriminatedUnion("kind", [CompositionFromSourceSchema, object({
|
|
13605
|
+
kind: literal("literal"),
|
|
13606
|
+
value: union([
|
|
13607
|
+
string(),
|
|
13608
|
+
number(),
|
|
13609
|
+
boolean(),
|
|
13610
|
+
_null()
|
|
13611
|
+
])
|
|
13612
|
+
})]);
|
|
13613
|
+
/**
|
|
13614
|
+
* `expression`: a formula over named bindings, in the salvaged expression
|
|
13615
|
+
* engine. Validated at parse by the SAME function every other consumer runs,
|
|
13616
|
+
* so the editor and the store cannot disagree.
|
|
13617
|
+
*/
|
|
13618
|
+
var CompositionExpressionSourceSchema = object({
|
|
13619
|
+
kind: literal("expression"),
|
|
13620
|
+
expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
|
|
13621
|
+
bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), CompositionBindingSchema)
|
|
13622
|
+
}).superRefine((src, ctx) => {
|
|
13623
|
+
const err = validateExpressionSource(src);
|
|
13624
|
+
if (err !== null) ctx.addIssue({
|
|
13625
|
+
code: "custom",
|
|
13626
|
+
message: err,
|
|
13627
|
+
path: ["expr"]
|
|
13628
|
+
});
|
|
13629
|
+
});
|
|
13630
|
+
/** `code`: RESERVED for slice 4 (own runner, one-way eject). */
|
|
13631
|
+
var CompositionCodeSourceSchema = object({
|
|
13632
|
+
kind: literal("code"),
|
|
13633
|
+
code: string().min(1).max(MAX_COMPOSITION_CODE_LENGTH)
|
|
13634
|
+
});
|
|
13635
|
+
var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
13636
|
+
CompositionFromSourceSchema,
|
|
13637
|
+
CompositionExpressionSourceSchema,
|
|
13638
|
+
CompositionCodeSourceSchema
|
|
13639
|
+
]);
|
|
13640
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
|
|
13641
|
+
kind: literal("forward"),
|
|
13642
|
+
source: CompositionSourceRefSchema,
|
|
13643
|
+
cap: string().min(1),
|
|
13644
|
+
method: string().min(1)
|
|
13645
|
+
}), CompositionCodeSourceSchema]);
|
|
13646
|
+
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
13647
|
+
kind: literal("fields"),
|
|
13648
|
+
cap: string().min(1),
|
|
13649
|
+
fields: record(string().min(1), CompositionFieldSourceSchema).refine((fields) => Object.keys(fields).length <= 32, { message: `at most 32 fields per capability` }),
|
|
13650
|
+
/** RESERVED for slice 3; refused by the validator when non-empty. */
|
|
13651
|
+
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
13652
|
+
}), object({
|
|
13653
|
+
kind: literal("passthrough"),
|
|
13654
|
+
cap: string().min(1),
|
|
13655
|
+
source: CompositionSourceRefSchema
|
|
13656
|
+
})]);
|
|
13657
|
+
var CompositionSchema = object({
|
|
13658
|
+
target: discriminatedUnion("kind", [object({
|
|
13659
|
+
kind: literal("new"),
|
|
13660
|
+
type: _enum(DeviceType),
|
|
13661
|
+
role: _enum(DeviceRole).optional()
|
|
13662
|
+
}), object({
|
|
13663
|
+
kind: literal("existing"),
|
|
13664
|
+
device: CompositionSourceRefSchema
|
|
13665
|
+
})]),
|
|
13666
|
+
features: array(CompositionFeatureSchema).min(1).max(16)
|
|
13667
|
+
}).superRefine((composition, ctx) => {
|
|
13668
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13669
|
+
composition.features.forEach((feature, index) => {
|
|
13670
|
+
if (seen.has(feature.cap)) ctx.addIssue({
|
|
13671
|
+
code: "custom",
|
|
13672
|
+
message: `capability \`${feature.cap}\` is composed twice — one feature per capability`,
|
|
13673
|
+
path: [
|
|
13674
|
+
"features",
|
|
13675
|
+
index,
|
|
13676
|
+
"cap"
|
|
13677
|
+
]
|
|
13678
|
+
});
|
|
13679
|
+
seen.add(feature.cap);
|
|
13680
|
+
});
|
|
13681
|
+
});
|
|
13682
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
|
|
13683
|
+
var CompositionProblemSchema = object({
|
|
13684
|
+
code: _enum([
|
|
13685
|
+
"reserved-variant",
|
|
13686
|
+
"unknown-capability",
|
|
13687
|
+
"not-composable",
|
|
13688
|
+
"wrong-device-type",
|
|
13689
|
+
"has-commands",
|
|
13690
|
+
"unknown-field",
|
|
13691
|
+
"nested-field",
|
|
13692
|
+
"missing-field",
|
|
13693
|
+
"kind-mismatch",
|
|
13694
|
+
"may-be-null",
|
|
13695
|
+
"source-missing",
|
|
13696
|
+
"source-unreadable",
|
|
13697
|
+
"source-capability-missing",
|
|
13698
|
+
"source-field-unknown",
|
|
13699
|
+
"expression-invalid",
|
|
13700
|
+
"cycle",
|
|
13701
|
+
"duplicate-target"
|
|
13702
|
+
]),
|
|
13703
|
+
path: string(),
|
|
13704
|
+
message: string()
|
|
13705
|
+
});
|
|
13706
|
+
var CompositionFieldKindSchema = _enum([
|
|
13707
|
+
"string",
|
|
13708
|
+
"number",
|
|
13709
|
+
"boolean",
|
|
13710
|
+
"enum"
|
|
13711
|
+
]);
|
|
13712
|
+
/** How a field says "unavailable": `null` when its schema allows it, else the device goes offline (D393). */
|
|
13713
|
+
var CompositionUnavailableModeSchema = _enum(["null", "offline"]);
|
|
13714
|
+
/**
|
|
13715
|
+
* `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
|
|
13716
|
+
* field of its cap changes value · `constant` reads nothing, computed once.
|
|
13717
|
+
*/
|
|
13718
|
+
var CompositionFieldRoleSchema = _enum([
|
|
13719
|
+
"derived",
|
|
13720
|
+
"clock",
|
|
13721
|
+
"constant"
|
|
13722
|
+
]);
|
|
13723
|
+
var CompositionFieldPlanSchema = object({
|
|
13724
|
+
cap: string(),
|
|
13725
|
+
path: string(),
|
|
13726
|
+
/** Index into `composition.features` this field's capability came from —
|
|
13727
|
+
* lets a source/cycle problem name its path as `features[N].fields.<path>`
|
|
13728
|
+
* (the same convention `planComposition`'s own problems already use). */
|
|
13729
|
+
featureIndex: number().int().nonnegative(),
|
|
13730
|
+
kind: CompositionFieldKindSchema,
|
|
13731
|
+
nullable: boolean(),
|
|
13732
|
+
required: boolean(),
|
|
13733
|
+
unavailable: CompositionUnavailableModeSchema,
|
|
13734
|
+
role: CompositionFieldRoleSchema,
|
|
13735
|
+
source: CompositionFieldSourceSchema,
|
|
13736
|
+
reads: array(CompositionFieldReadSchema)
|
|
13737
|
+
});
|
|
13738
|
+
var CompositionValidationSchema = object({
|
|
13739
|
+
ok: boolean(),
|
|
13740
|
+
problems: array(CompositionProblemSchema),
|
|
13741
|
+
fields: array(CompositionFieldPlanSchema)
|
|
13742
|
+
});
|
|
13743
|
+
/** Mirrors `CoreBlockStatus`, pinned by `core-blocks-source.spec.ts` (Task 11). */
|
|
13744
|
+
var CompositionRunStatusSchema = _enum([
|
|
13745
|
+
"stopped",
|
|
13746
|
+
"starting",
|
|
13747
|
+
"running",
|
|
13748
|
+
"failed"
|
|
13749
|
+
]);
|
|
13750
|
+
var CompositionFieldStateKindSchema = _enum([
|
|
13751
|
+
"fresh",
|
|
13752
|
+
"stale",
|
|
13753
|
+
"unavailable"
|
|
13754
|
+
]);
|
|
13755
|
+
var CompositionFieldStateSchema = object({
|
|
13756
|
+
cap: string(),
|
|
13757
|
+
path: string(),
|
|
13758
|
+
state: CompositionFieldStateKindSchema,
|
|
13759
|
+
/** `null` whenever `state === 'unavailable'`; never a plausible stand-in (D393). */
|
|
13760
|
+
value: union([
|
|
13761
|
+
string(),
|
|
13762
|
+
number(),
|
|
13763
|
+
boolean(),
|
|
13764
|
+
_null()
|
|
13765
|
+
]),
|
|
13766
|
+
reason: string().optional()
|
|
13767
|
+
});
|
|
13768
|
+
var CompositionBlockStateSchema = object({
|
|
13769
|
+
blockId: string(),
|
|
13770
|
+
deviceId: number().nullable(),
|
|
13771
|
+
status: CompositionRunStatusSchema,
|
|
13772
|
+
reason: string().optional(),
|
|
13773
|
+
fields: array(CompositionFieldStateSchema)
|
|
13774
|
+
});
|
|
13523
13775
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
13524
13776
|
* agent is the reason placement is not fixed to the hub. */
|
|
13525
13777
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -13546,6 +13798,30 @@ var CoreBlockInputSchema = object({
|
|
|
13546
13798
|
*/
|
|
13547
13799
|
integrationId: string().optional()
|
|
13548
13800
|
});
|
|
13801
|
+
/**
|
|
13802
|
+
* What a block IS (D659). Absent means `code` — every row stored before this
|
|
13803
|
+
* union keeps working unchanged.
|
|
13804
|
+
* - `code`: the TypeScript in `code`, compiled and run in its own runner;
|
|
13805
|
+
* - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
|
|
13806
|
+
* - `composition`: declarative, run by the shared `composer`; `code` is `''`.
|
|
13807
|
+
*/
|
|
13808
|
+
var CoreBlockSourceSchema = discriminatedUnion("kind", [
|
|
13809
|
+
object({ kind: literal("code") }),
|
|
13810
|
+
object({
|
|
13811
|
+
kind: literal("recipe"),
|
|
13812
|
+
recipe: AutomationRecipeSchema
|
|
13813
|
+
}),
|
|
13814
|
+
object({
|
|
13815
|
+
kind: literal("composition"),
|
|
13816
|
+
composition: CompositionSchema
|
|
13817
|
+
})
|
|
13818
|
+
]);
|
|
13819
|
+
/** The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7). */
|
|
13820
|
+
var CompositionBlockInputSchema = object({
|
|
13821
|
+
name: string().min(1).max(120),
|
|
13822
|
+
enabled: boolean(),
|
|
13823
|
+
composition: CompositionSchema
|
|
13824
|
+
});
|
|
13549
13825
|
/** A stored block. */
|
|
13550
13826
|
var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
13551
13827
|
id: string(),
|
|
@@ -13561,8 +13837,38 @@ var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
|
13561
13837
|
*/
|
|
13562
13838
|
lastError: string().optional(),
|
|
13563
13839
|
/** Ms epoch of the last state change. */
|
|
13564
|
-
lastChangedAt: number()
|
|
13840
|
+
lastChangedAt: number(),
|
|
13841
|
+
/** What the block is. Absent means `code` (D659). */
|
|
13842
|
+
source: CoreBlockSourceSchema.optional()
|
|
13843
|
+
});
|
|
13844
|
+
/** A stored composition block and what the composer says about it. */
|
|
13845
|
+
var CompositionViewSchema = object({
|
|
13846
|
+
block: CoreBlockSchema,
|
|
13847
|
+
state: discriminatedUnion("kind", [object({
|
|
13848
|
+
kind: literal("answered"),
|
|
13849
|
+
state: CompositionBlockStateSchema.nullable()
|
|
13850
|
+
}), object({
|
|
13851
|
+
kind: literal("unreachable"),
|
|
13852
|
+
error: string()
|
|
13853
|
+
})])
|
|
13854
|
+
});
|
|
13855
|
+
/**
|
|
13856
|
+
* A read of the stored compositions. `not-loaded` while the `core_blocks`
|
|
13857
|
+
* table has not been READ: an empty answer then would make "not yet known"
|
|
13858
|
+
* look like "none", and invite the operator to recreate what exists (D315).
|
|
13859
|
+
*/
|
|
13860
|
+
var CompositionsNotLoadedSchema = object({
|
|
13861
|
+
state: literal("not-loaded"),
|
|
13862
|
+
reason: string()
|
|
13565
13863
|
});
|
|
13864
|
+
var CompositionListReadSchema = discriminatedUnion("state", [object({
|
|
13865
|
+
state: literal("loaded"),
|
|
13866
|
+
views: array(CompositionViewSchema)
|
|
13867
|
+
}), CompositionsNotLoadedSchema]);
|
|
13868
|
+
var CompositionGetReadSchema = discriminatedUnion("state", [object({
|
|
13869
|
+
state: literal("loaded"),
|
|
13870
|
+
view: CompositionViewSchema.nullable()
|
|
13871
|
+
}), CompositionsNotLoadedSchema]);
|
|
13566
13872
|
/** What a compile attempt produced. */
|
|
13567
13873
|
var CoreBlockCompileResultSchema = object({
|
|
13568
13874
|
ok: boolean(),
|
|
@@ -13600,7 +13906,72 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13600
13906
|
}), method(object({}), object({ libs: array(object({
|
|
13601
13907
|
filePath: string(),
|
|
13602
13908
|
content: string()
|
|
13603
|
-
})) }), { auth: "admin" })
|
|
13909
|
+
})) }), { auth: "admin" }), method(object({ block: CompositionBlockInputSchema }), object({ block: CoreBlockSchema }), {
|
|
13910
|
+
kind: "mutation",
|
|
13911
|
+
auth: "admin",
|
|
13912
|
+
caller: "required"
|
|
13913
|
+
}), method(object({
|
|
13914
|
+
blockId: string(),
|
|
13915
|
+
expectedUpdatedAt: number(),
|
|
13916
|
+
block: CompositionBlockInputSchema.partial()
|
|
13917
|
+
}), object({ block: CoreBlockSchema }), {
|
|
13918
|
+
kind: "mutation",
|
|
13919
|
+
auth: "admin",
|
|
13920
|
+
caller: "required"
|
|
13921
|
+
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
13922
|
+
composition: CompositionSchema,
|
|
13923
|
+
blockId: string().optional()
|
|
13924
|
+
}), CompositionValidationSchema, {
|
|
13925
|
+
kind: "mutation",
|
|
13926
|
+
auth: "admin",
|
|
13927
|
+
access: "view"
|
|
13928
|
+
});
|
|
13929
|
+
var ComposerBlockSchema = object({
|
|
13930
|
+
id: string().min(1),
|
|
13931
|
+
name: string().min(1).max(120),
|
|
13932
|
+
enabled: boolean(),
|
|
13933
|
+
updatedAt: number(),
|
|
13934
|
+
composition: CompositionSchema
|
|
13935
|
+
});
|
|
13936
|
+
/**
|
|
13937
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
13938
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13939
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13940
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13941
|
+
*/
|
|
13942
|
+
var ComposerUnreadableBlockSchema = object({
|
|
13943
|
+
id: string().min(1),
|
|
13944
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13945
|
+
name: string().nullable(),
|
|
13946
|
+
/** The parse error, in the operator's words. */
|
|
13947
|
+
error: string()
|
|
13948
|
+
});
|
|
13949
|
+
method(object({
|
|
13950
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13951
|
+
integrationId: string().nullable(),
|
|
13952
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13953
|
+
storeLoaded: boolean(),
|
|
13954
|
+
blocks: array(ComposerBlockSchema),
|
|
13955
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13956
|
+
restartBlockIds: array(string()),
|
|
13957
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13958
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13959
|
+
}), object({
|
|
13960
|
+
blocks: array(object({
|
|
13961
|
+
blockId: string(),
|
|
13962
|
+
status: CompositionRunStatusSchema,
|
|
13963
|
+
reason: string().optional()
|
|
13964
|
+
})),
|
|
13965
|
+
/**
|
|
13966
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13967
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
13968
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13969
|
+
*/
|
|
13970
|
+
acted: boolean()
|
|
13971
|
+
}), {
|
|
13972
|
+
kind: "mutation",
|
|
13973
|
+
auth: "admin"
|
|
13974
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13604
13975
|
/**
|
|
13605
13976
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
13606
13977
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -19345,8 +19716,8 @@ var NcTestResultSchema = object({
|
|
|
19345
19716
|
className: string().optional(),
|
|
19346
19717
|
label: string().optional()
|
|
19347
19718
|
});
|
|
19348
|
-
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
19349
|
-
*
|
|
19719
|
+
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
19720
|
+
* `z.infer` of this schema — one shape, no twin. `mixed` is DERIVED
|
|
19350
19721
|
* (a stored system rule whose kinds span families, D637) and never authored. */
|
|
19351
19722
|
var NcRuleKindSchema = _enum([
|
|
19352
19723
|
"detection",
|
|
@@ -36312,6 +36683,38 @@ var zoneRulesCapability = {
|
|
|
36312
36683
|
*/
|
|
36313
36684
|
durability: "restored"
|
|
36314
36685
|
};
|
|
36686
|
+
var NUMBER = {
|
|
36687
|
+
kind: "fixed",
|
|
36688
|
+
result: ["number"]
|
|
36689
|
+
};
|
|
36690
|
+
var BOOLEAN = {
|
|
36691
|
+
kind: "fixed",
|
|
36692
|
+
result: ["boolean"]
|
|
36693
|
+
};
|
|
36694
|
+
Object.freeze({
|
|
36695
|
+
min: NUMBER,
|
|
36696
|
+
max: NUMBER,
|
|
36697
|
+
abs: NUMBER,
|
|
36698
|
+
floor: NUMBER,
|
|
36699
|
+
ceil: NUMBER,
|
|
36700
|
+
sqrt: NUMBER,
|
|
36701
|
+
round: NUMBER,
|
|
36702
|
+
pow: NUMBER,
|
|
36703
|
+
clamp: NUMBER,
|
|
36704
|
+
avg: NUMBER,
|
|
36705
|
+
sum: NUMBER,
|
|
36706
|
+
age: NUMBER,
|
|
36707
|
+
convert: NUMBER,
|
|
36708
|
+
coalesce: { kind: "coalesce" },
|
|
36709
|
+
any: BOOLEAN,
|
|
36710
|
+
all: BOOLEAN,
|
|
36711
|
+
within: BOOLEAN,
|
|
36712
|
+
latest: {
|
|
36713
|
+
kind: "fixed",
|
|
36714
|
+
result: ["number", "null"]
|
|
36715
|
+
}
|
|
36716
|
+
});
|
|
36717
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
36315
36718
|
/**
|
|
36316
36719
|
* Accessory device helpers — shared across drivers.
|
|
36317
36720
|
*
|
|
@@ -38648,6 +39051,18 @@ Object.freeze({
|
|
|
38648
39051
|
addonId: null,
|
|
38649
39052
|
access: "create"
|
|
38650
39053
|
},
|
|
39054
|
+
"composer.applyBlocks": {
|
|
39055
|
+
capName: "composer",
|
|
39056
|
+
capScope: "system",
|
|
39057
|
+
addonId: null,
|
|
39058
|
+
access: "create"
|
|
39059
|
+
},
|
|
39060
|
+
"composer.getStates": {
|
|
39061
|
+
capName: "composer",
|
|
39062
|
+
capScope: "system",
|
|
39063
|
+
addonId: null,
|
|
39064
|
+
access: "view"
|
|
39065
|
+
},
|
|
38651
39066
|
"connectionTest.describeTest": {
|
|
38652
39067
|
capName: "connection-test",
|
|
38653
39068
|
capScope: "system",
|
|
@@ -38708,6 +39123,12 @@ Object.freeze({
|
|
|
38708
39123
|
addonId: null,
|
|
38709
39124
|
access: "create"
|
|
38710
39125
|
},
|
|
39126
|
+
"coreBlocks.createComposition": {
|
|
39127
|
+
capName: "core-blocks",
|
|
39128
|
+
capScope: "system",
|
|
39129
|
+
addonId: null,
|
|
39130
|
+
access: "create"
|
|
39131
|
+
},
|
|
38711
39132
|
"coreBlocks.delete": {
|
|
38712
39133
|
capName: "core-blocks",
|
|
38713
39134
|
capScope: "system",
|
|
@@ -38720,6 +39141,12 @@ Object.freeze({
|
|
|
38720
39141
|
addonId: null,
|
|
38721
39142
|
access: "view"
|
|
38722
39143
|
},
|
|
39144
|
+
"coreBlocks.getComposition": {
|
|
39145
|
+
capName: "core-blocks",
|
|
39146
|
+
capScope: "system",
|
|
39147
|
+
addonId: null,
|
|
39148
|
+
access: "view"
|
|
39149
|
+
},
|
|
38723
39150
|
"coreBlocks.getTypeDefs": {
|
|
38724
39151
|
capName: "core-blocks",
|
|
38725
39152
|
capScope: "system",
|
|
@@ -38732,6 +39159,12 @@ Object.freeze({
|
|
|
38732
39159
|
addonId: null,
|
|
38733
39160
|
access: "view"
|
|
38734
39161
|
},
|
|
39162
|
+
"coreBlocks.listCompositions": {
|
|
39163
|
+
capName: "core-blocks",
|
|
39164
|
+
capScope: "system",
|
|
39165
|
+
addonId: null,
|
|
39166
|
+
access: "view"
|
|
39167
|
+
},
|
|
38735
39168
|
"coreBlocks.restart": {
|
|
38736
39169
|
capName: "core-blocks",
|
|
38737
39170
|
capScope: "system",
|
|
@@ -38750,6 +39183,18 @@ Object.freeze({
|
|
|
38750
39183
|
addonId: null,
|
|
38751
39184
|
access: "create"
|
|
38752
39185
|
},
|
|
39186
|
+
"coreBlocks.updateComposition": {
|
|
39187
|
+
capName: "core-blocks",
|
|
39188
|
+
capScope: "system",
|
|
39189
|
+
addonId: null,
|
|
39190
|
+
access: "create"
|
|
39191
|
+
},
|
|
39192
|
+
"coreBlocks.validateComposition": {
|
|
39193
|
+
capName: "core-blocks",
|
|
39194
|
+
capScope: "system",
|
|
39195
|
+
addonId: null,
|
|
39196
|
+
access: "view"
|
|
39197
|
+
},
|
|
38753
39198
|
"cover.close": {
|
|
38754
39199
|
capName: "cover",
|
|
38755
39200
|
capScope: "device",
|
|
@@ -52114,6 +52559,8 @@ function buildRunnerConfig(base, overrides) {
|
|
|
52114
52559
|
var DEFAULT_LOAD_LIMIT = 1e5;
|
|
52115
52560
|
var DurableLedger = class DurableLedger {
|
|
52116
52561
|
mirror = /* @__PURE__ */ new Map();
|
|
52562
|
+
/** Whether ANY load has read the store successfully — see {@link hasAnswered}. */
|
|
52563
|
+
answered = false;
|
|
52117
52564
|
spec;
|
|
52118
52565
|
store;
|
|
52119
52566
|
logger;
|
|
@@ -52169,6 +52616,7 @@ var DurableLedger = class DurableLedger {
|
|
|
52169
52616
|
}
|
|
52170
52617
|
this.mirror.clear();
|
|
52171
52618
|
for (const [key, row] of next) this.mirror.set(key, row);
|
|
52619
|
+
this.answered = true;
|
|
52172
52620
|
if (skipped > 0) this.logger.warn("durable rows skipped as malformed — they gate NOTHING", { meta: {
|
|
52173
52621
|
collection: this.spec.collection,
|
|
52174
52622
|
skipped
|
|
@@ -52183,6 +52631,16 @@ var DurableLedger = class DurableLedger {
|
|
|
52183
52631
|
return [...this.mirror.values()];
|
|
52184
52632
|
}
|
|
52185
52633
|
}
|
|
52634
|
+
/**
|
|
52635
|
+
* Whether the mirror is an ANSWER from the store: true once any load has
|
|
52636
|
+
* succeeded, and never false again (a later failed load keeps that answer).
|
|
52637
|
+
* Before it, an empty mirror is "not read yet", never "the store is empty" —
|
|
52638
|
+
* {@link load} swallows its failure, so a caller that must tell the two apart
|
|
52639
|
+
* asks here (D642 review I1).
|
|
52640
|
+
*/
|
|
52641
|
+
hasAnswered() {
|
|
52642
|
+
return this.answered;
|
|
52643
|
+
}
|
|
52186
52644
|
/** Every mirrored row, insertion-ordered. */
|
|
52187
52645
|
snapshot() {
|
|
52188
52646
|
return [...this.mirror.values()];
|