@camstack/addon-model-studio 1.1.177 → 1.1.178
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/{MotionZonesSettings-C4-p0MUC.mjs → MotionZonesSettings-Cxw4j3rn.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-CiAgalv0.mjs → PrivacyMaskSettings-zQ-six-W.mjs} +4 -4
- package/dist/{SceneMonitorEditor-CRv5TJpn.mjs → SceneMonitorEditor-CeDqxaTk.mjs} +3 -3
- package/dist/_stub.js +17 -17
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-Pq2JbHl4.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page--dtMhecm.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B8ssxRgI.mjs +26 -0
- package/dist/{hostInit-Cx4ONiPc.mjs → hostInit-C9TQCtVD.mjs} +2 -2
- package/dist/model-studio.addon.js +425 -22
- package/dist/model-studio.addon.mjs +425 -22
- package/dist/{player-overlays-ClBjPU73.mjs → player-overlays-D2YtQYEE.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-DlMFoaeo.mjs → responsive-i8VV1SdO.mjs} +1 -1
- package/dist/{scene-monitor-copy-CTpOVqsU.mjs → scene-monitor-copy-BktPixFQ.mjs} +1 -1
- package/dist/{square-C3Zmy4Ca.mjs → square-COwEP7Tf.mjs} +1 -1
- package/dist/{trash-2-BD__w_cV.mjs → trash-2-9RsOz0YH.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-C_0n96Ey.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-BkBVoxTt.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CIxAEvWm.mjs +0 -26
|
@@ -10429,23 +10429,6 @@ var ExpressionEvalError = class extends Error {
|
|
|
10429
10429
|
this.name = "ExpressionEvalError";
|
|
10430
10430
|
}
|
|
10431
10431
|
};
|
|
10432
|
-
/**
|
|
10433
|
-
* Frozen, null-prototype builtin function table for the expression engine
|
|
10434
|
-
* (spec §4 rule 4). The table is the SOLE surface of callable functions: the
|
|
10435
|
-
* parser rejects any callee not in it, and the evaluator gates each call on an
|
|
10436
|
-
* own-property check against it.
|
|
10437
|
-
*
|
|
10438
|
-
* Because the object has a NULL prototype AND is `Object.freeze`d:
|
|
10439
|
-
* - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
|
|
10440
|
-
* - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
|
|
10441
|
-
* (there is no `Object.prototype` in the chain), so those names are not
|
|
10442
|
-
* callable — they are simply "unknown function" at parse time.
|
|
10443
|
-
*
|
|
10444
|
-
* Every numeric argument is validated as a finite number and every numeric
|
|
10445
|
-
* RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
|
|
10446
|
-
* (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
|
|
10447
|
-
* closed rather than emitting a garbage value.
|
|
10448
|
-
*/
|
|
10449
10432
|
function asFiniteNumber(value, name, index) {
|
|
10450
10433
|
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
10451
10434
|
return value;
|
|
@@ -10461,6 +10444,10 @@ function finiteResult(value, name) {
|
|
|
10461
10444
|
function allFiniteNumbers(args, name) {
|
|
10462
10445
|
return args.map((a, idx) => asFiniteNumber(a, name, idx));
|
|
10463
10446
|
}
|
|
10447
|
+
function asBoolean$1(value, name, index) {
|
|
10448
|
+
if (typeof value !== "boolean") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a boolean`);
|
|
10449
|
+
return value;
|
|
10450
|
+
}
|
|
10464
10451
|
var INF = Number.POSITIVE_INFINITY;
|
|
10465
10452
|
var table = {
|
|
10466
10453
|
min: {
|
|
@@ -10561,6 +10548,40 @@ var table = {
|
|
|
10561
10548
|
if (from === to) return x;
|
|
10562
10549
|
throw new ExpressionEvalError("convert: unit conversion table not installed");
|
|
10563
10550
|
}
|
|
10551
|
+
},
|
|
10552
|
+
any: {
|
|
10553
|
+
minArgs: 1,
|
|
10554
|
+
maxArgs: INF,
|
|
10555
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "any", i)).some((b) => b)
|
|
10556
|
+
},
|
|
10557
|
+
all: {
|
|
10558
|
+
minArgs: 1,
|
|
10559
|
+
maxArgs: INF,
|
|
10560
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "all", i)).every((b) => b)
|
|
10561
|
+
},
|
|
10562
|
+
within: {
|
|
10563
|
+
minArgs: 2,
|
|
10564
|
+
maxArgs: 2,
|
|
10565
|
+
apply: (args, hooks) => {
|
|
10566
|
+
const windowMs = asFiniteNumber(args[1], "within", 1);
|
|
10567
|
+
if (windowMs < 0) throw new ExpressionEvalError("within: the window must not be negative");
|
|
10568
|
+
const at = args[0];
|
|
10569
|
+
if (at === null) return false;
|
|
10570
|
+
const ts = asFiniteNumber(at, "within", 0);
|
|
10571
|
+
const now = hooks.now;
|
|
10572
|
+
if (now === void 0 || !Number.isFinite(now)) throw new ExpressionEvalError("within: no clock was supplied to this evaluation");
|
|
10573
|
+
const inside = now - ts <= windowMs;
|
|
10574
|
+
if (inside) hooks.noteDeadline?.(ts + windowMs + 1);
|
|
10575
|
+
return inside;
|
|
10576
|
+
}
|
|
10577
|
+
},
|
|
10578
|
+
latest: {
|
|
10579
|
+
minArgs: 1,
|
|
10580
|
+
maxArgs: INF,
|
|
10581
|
+
apply: (args) => {
|
|
10582
|
+
const present = args.flatMap((a, i) => a === null ? [] : [asFiniteNumber(a, "latest", i)]);
|
|
10583
|
+
return present.length === 0 ? null : finiteResult(Math.max(...present), "latest");
|
|
10584
|
+
}
|
|
10564
10585
|
}
|
|
10565
10586
|
};
|
|
10566
10587
|
Object.freeze(Object.assign(Object.create(null), table));
|
|
@@ -11175,7 +11196,7 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
11175
11196
|
code: string().min(1).max(2e4)
|
|
11176
11197
|
})
|
|
11177
11198
|
]);
|
|
11178
|
-
object({
|
|
11199
|
+
var AutomationRecipeSchema = object({
|
|
11179
11200
|
triggers: array(AutomationTriggerSchema),
|
|
11180
11201
|
conditions: AutomationConditionSchema.optional(),
|
|
11181
11202
|
actions: array(AutomationActionSchema)
|
|
@@ -13243,6 +13264,195 @@ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), ar
|
|
|
13243
13264
|
}),
|
|
13244
13265
|
lastChangedAt: number()
|
|
13245
13266
|
});
|
|
13267
|
+
/** A composed device's stableId is this prefix plus the block id. */
|
|
13268
|
+
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
13269
|
+
/** Longest snippet a `code` source may carry (slice 4). */
|
|
13270
|
+
var MAX_COMPOSITION_CODE_LENGTH = 2e4;
|
|
13271
|
+
var CompositionSourceRefSchema = object({
|
|
13272
|
+
/** The owning addon; `stableId` is unique only within it. */
|
|
13273
|
+
addonId: string().min(1),
|
|
13274
|
+
stableId: string().min(1)
|
|
13275
|
+
});
|
|
13276
|
+
/** One field of one capability of one source device. */
|
|
13277
|
+
var CompositionFieldReadSchema = object({
|
|
13278
|
+
source: CompositionSourceRefSchema,
|
|
13279
|
+
cap: string().min(1),
|
|
13280
|
+
/** Dotted path into the source cap's runtime-state slice. */
|
|
13281
|
+
fieldPath: string().min(1)
|
|
13282
|
+
});
|
|
13283
|
+
/** `from`: copy one source field verbatim. It is also an expression's `from` binding. */
|
|
13284
|
+
var CompositionFromSourceSchema = CompositionFieldReadSchema.extend({ kind: literal("from") });
|
|
13285
|
+
var CompositionBindingSchema = discriminatedUnion("kind", [CompositionFromSourceSchema, object({
|
|
13286
|
+
kind: literal("literal"),
|
|
13287
|
+
value: union([
|
|
13288
|
+
string(),
|
|
13289
|
+
number(),
|
|
13290
|
+
boolean(),
|
|
13291
|
+
_null()
|
|
13292
|
+
])
|
|
13293
|
+
})]);
|
|
13294
|
+
/**
|
|
13295
|
+
* `expression`: a formula over named bindings, in the salvaged expression
|
|
13296
|
+
* engine. Validated at parse by the SAME function every other consumer runs,
|
|
13297
|
+
* so the editor and the store cannot disagree.
|
|
13298
|
+
*/
|
|
13299
|
+
var CompositionExpressionSourceSchema = object({
|
|
13300
|
+
kind: literal("expression"),
|
|
13301
|
+
expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
|
|
13302
|
+
bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), CompositionBindingSchema)
|
|
13303
|
+
}).superRefine((src, ctx) => {
|
|
13304
|
+
const err = validateExpressionSource(src);
|
|
13305
|
+
if (err !== null) ctx.addIssue({
|
|
13306
|
+
code: "custom",
|
|
13307
|
+
message: err,
|
|
13308
|
+
path: ["expr"]
|
|
13309
|
+
});
|
|
13310
|
+
});
|
|
13311
|
+
/** `code`: RESERVED for slice 4 (own runner, one-way eject). */
|
|
13312
|
+
var CompositionCodeSourceSchema = object({
|
|
13313
|
+
kind: literal("code"),
|
|
13314
|
+
code: string().min(1).max(MAX_COMPOSITION_CODE_LENGTH)
|
|
13315
|
+
});
|
|
13316
|
+
var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
13317
|
+
CompositionFromSourceSchema,
|
|
13318
|
+
CompositionExpressionSourceSchema,
|
|
13319
|
+
CompositionCodeSourceSchema
|
|
13320
|
+
]);
|
|
13321
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
|
|
13322
|
+
kind: literal("forward"),
|
|
13323
|
+
source: CompositionSourceRefSchema,
|
|
13324
|
+
cap: string().min(1),
|
|
13325
|
+
method: string().min(1)
|
|
13326
|
+
}), CompositionCodeSourceSchema]);
|
|
13327
|
+
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
13328
|
+
kind: literal("fields"),
|
|
13329
|
+
cap: string().min(1),
|
|
13330
|
+
fields: record(string().min(1), CompositionFieldSourceSchema).refine((fields) => Object.keys(fields).length <= 32, { message: `at most 32 fields per capability` }),
|
|
13331
|
+
/** RESERVED for slice 3; refused by the validator when non-empty. */
|
|
13332
|
+
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
13333
|
+
}), object({
|
|
13334
|
+
kind: literal("passthrough"),
|
|
13335
|
+
cap: string().min(1),
|
|
13336
|
+
source: CompositionSourceRefSchema
|
|
13337
|
+
})]);
|
|
13338
|
+
var CompositionSchema = object({
|
|
13339
|
+
target: discriminatedUnion("kind", [object({
|
|
13340
|
+
kind: literal("new"),
|
|
13341
|
+
type: _enum(DeviceType),
|
|
13342
|
+
role: _enum(DeviceRole).optional()
|
|
13343
|
+
}), object({
|
|
13344
|
+
kind: literal("existing"),
|
|
13345
|
+
device: CompositionSourceRefSchema
|
|
13346
|
+
})]),
|
|
13347
|
+
features: array(CompositionFeatureSchema).min(1).max(16)
|
|
13348
|
+
}).superRefine((composition, ctx) => {
|
|
13349
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13350
|
+
composition.features.forEach((feature, index) => {
|
|
13351
|
+
if (seen.has(feature.cap)) ctx.addIssue({
|
|
13352
|
+
code: "custom",
|
|
13353
|
+
message: `capability \`${feature.cap}\` is composed twice — one feature per capability`,
|
|
13354
|
+
path: [
|
|
13355
|
+
"features",
|
|
13356
|
+
index,
|
|
13357
|
+
"cap"
|
|
13358
|
+
]
|
|
13359
|
+
});
|
|
13360
|
+
seen.add(feature.cap);
|
|
13361
|
+
});
|
|
13362
|
+
});
|
|
13363
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
|
|
13364
|
+
var CompositionProblemSchema = object({
|
|
13365
|
+
code: _enum([
|
|
13366
|
+
"reserved-variant",
|
|
13367
|
+
"unknown-capability",
|
|
13368
|
+
"not-composable",
|
|
13369
|
+
"wrong-device-type",
|
|
13370
|
+
"has-commands",
|
|
13371
|
+
"unknown-field",
|
|
13372
|
+
"nested-field",
|
|
13373
|
+
"missing-field",
|
|
13374
|
+
"kind-mismatch",
|
|
13375
|
+
"may-be-null",
|
|
13376
|
+
"source-missing",
|
|
13377
|
+
"source-unreadable",
|
|
13378
|
+
"source-capability-missing",
|
|
13379
|
+
"source-field-unknown",
|
|
13380
|
+
"expression-invalid",
|
|
13381
|
+
"cycle",
|
|
13382
|
+
"duplicate-target"
|
|
13383
|
+
]),
|
|
13384
|
+
path: string(),
|
|
13385
|
+
message: string()
|
|
13386
|
+
});
|
|
13387
|
+
var CompositionFieldKindSchema = _enum([
|
|
13388
|
+
"string",
|
|
13389
|
+
"number",
|
|
13390
|
+
"boolean",
|
|
13391
|
+
"enum"
|
|
13392
|
+
]);
|
|
13393
|
+
/** How a field says "unavailable": `null` when its schema allows it, else the device goes offline (D393). */
|
|
13394
|
+
var CompositionUnavailableModeSchema = _enum(["null", "offline"]);
|
|
13395
|
+
/**
|
|
13396
|
+
* `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
|
|
13397
|
+
* field of its cap changes value · `constant` reads nothing, computed once.
|
|
13398
|
+
*/
|
|
13399
|
+
var CompositionFieldRoleSchema = _enum([
|
|
13400
|
+
"derived",
|
|
13401
|
+
"clock",
|
|
13402
|
+
"constant"
|
|
13403
|
+
]);
|
|
13404
|
+
var CompositionFieldPlanSchema = object({
|
|
13405
|
+
cap: string(),
|
|
13406
|
+
path: string(),
|
|
13407
|
+
/** Index into `composition.features` this field's capability came from —
|
|
13408
|
+
* lets a source/cycle problem name its path as `features[N].fields.<path>`
|
|
13409
|
+
* (the same convention `planComposition`'s own problems already use). */
|
|
13410
|
+
featureIndex: number().int().nonnegative(),
|
|
13411
|
+
kind: CompositionFieldKindSchema,
|
|
13412
|
+
nullable: boolean(),
|
|
13413
|
+
required: boolean(),
|
|
13414
|
+
unavailable: CompositionUnavailableModeSchema,
|
|
13415
|
+
role: CompositionFieldRoleSchema,
|
|
13416
|
+
source: CompositionFieldSourceSchema,
|
|
13417
|
+
reads: array(CompositionFieldReadSchema)
|
|
13418
|
+
});
|
|
13419
|
+
var CompositionValidationSchema = object({
|
|
13420
|
+
ok: boolean(),
|
|
13421
|
+
problems: array(CompositionProblemSchema),
|
|
13422
|
+
fields: array(CompositionFieldPlanSchema)
|
|
13423
|
+
});
|
|
13424
|
+
/** Mirrors `CoreBlockStatus`, pinned by `core-blocks-source.spec.ts` (Task 11). */
|
|
13425
|
+
var CompositionRunStatusSchema = _enum([
|
|
13426
|
+
"stopped",
|
|
13427
|
+
"starting",
|
|
13428
|
+
"running",
|
|
13429
|
+
"failed"
|
|
13430
|
+
]);
|
|
13431
|
+
var CompositionFieldStateKindSchema = _enum([
|
|
13432
|
+
"fresh",
|
|
13433
|
+
"stale",
|
|
13434
|
+
"unavailable"
|
|
13435
|
+
]);
|
|
13436
|
+
var CompositionFieldStateSchema = object({
|
|
13437
|
+
cap: string(),
|
|
13438
|
+
path: string(),
|
|
13439
|
+
state: CompositionFieldStateKindSchema,
|
|
13440
|
+
/** `null` whenever `state === 'unavailable'`; never a plausible stand-in (D393). */
|
|
13441
|
+
value: union([
|
|
13442
|
+
string(),
|
|
13443
|
+
number(),
|
|
13444
|
+
boolean(),
|
|
13445
|
+
_null()
|
|
13446
|
+
]),
|
|
13447
|
+
reason: string().optional()
|
|
13448
|
+
});
|
|
13449
|
+
var CompositionBlockStateSchema = object({
|
|
13450
|
+
blockId: string(),
|
|
13451
|
+
deviceId: number().nullable(),
|
|
13452
|
+
status: CompositionRunStatusSchema,
|
|
13453
|
+
reason: string().optional(),
|
|
13454
|
+
fields: array(CompositionFieldStateSchema)
|
|
13455
|
+
});
|
|
13246
13456
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
13247
13457
|
* agent is the reason placement is not fixed to the hub. */
|
|
13248
13458
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -13269,6 +13479,30 @@ var CoreBlockInputSchema = object({
|
|
|
13269
13479
|
*/
|
|
13270
13480
|
integrationId: string().optional()
|
|
13271
13481
|
});
|
|
13482
|
+
/**
|
|
13483
|
+
* What a block IS (D659). Absent means `code` — every row stored before this
|
|
13484
|
+
* union keeps working unchanged.
|
|
13485
|
+
* - `code`: the TypeScript in `code`, compiled and run in its own runner;
|
|
13486
|
+
* - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
|
|
13487
|
+
* - `composition`: declarative, run by the shared `composer`; `code` is `''`.
|
|
13488
|
+
*/
|
|
13489
|
+
var CoreBlockSourceSchema = discriminatedUnion("kind", [
|
|
13490
|
+
object({ kind: literal("code") }),
|
|
13491
|
+
object({
|
|
13492
|
+
kind: literal("recipe"),
|
|
13493
|
+
recipe: AutomationRecipeSchema
|
|
13494
|
+
}),
|
|
13495
|
+
object({
|
|
13496
|
+
kind: literal("composition"),
|
|
13497
|
+
composition: CompositionSchema
|
|
13498
|
+
})
|
|
13499
|
+
]);
|
|
13500
|
+
/** The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7). */
|
|
13501
|
+
var CompositionBlockInputSchema = object({
|
|
13502
|
+
name: string().min(1).max(120),
|
|
13503
|
+
enabled: boolean(),
|
|
13504
|
+
composition: CompositionSchema
|
|
13505
|
+
});
|
|
13272
13506
|
/** A stored block. */
|
|
13273
13507
|
var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
13274
13508
|
id: string(),
|
|
@@ -13284,8 +13518,38 @@ var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
|
13284
13518
|
*/
|
|
13285
13519
|
lastError: string().optional(),
|
|
13286
13520
|
/** Ms epoch of the last state change. */
|
|
13287
|
-
lastChangedAt: number()
|
|
13521
|
+
lastChangedAt: number(),
|
|
13522
|
+
/** What the block is. Absent means `code` (D659). */
|
|
13523
|
+
source: CoreBlockSourceSchema.optional()
|
|
13524
|
+
});
|
|
13525
|
+
/** A stored composition block and what the composer says about it. */
|
|
13526
|
+
var CompositionViewSchema = object({
|
|
13527
|
+
block: CoreBlockSchema,
|
|
13528
|
+
state: discriminatedUnion("kind", [object({
|
|
13529
|
+
kind: literal("answered"),
|
|
13530
|
+
state: CompositionBlockStateSchema.nullable()
|
|
13531
|
+
}), object({
|
|
13532
|
+
kind: literal("unreachable"),
|
|
13533
|
+
error: string()
|
|
13534
|
+
})])
|
|
13288
13535
|
});
|
|
13536
|
+
/**
|
|
13537
|
+
* A read of the stored compositions. `not-loaded` while the `core_blocks`
|
|
13538
|
+
* table has not been READ: an empty answer then would make "not yet known"
|
|
13539
|
+
* look like "none", and invite the operator to recreate what exists (D315).
|
|
13540
|
+
*/
|
|
13541
|
+
var CompositionsNotLoadedSchema = object({
|
|
13542
|
+
state: literal("not-loaded"),
|
|
13543
|
+
reason: string()
|
|
13544
|
+
});
|
|
13545
|
+
var CompositionListReadSchema = discriminatedUnion("state", [object({
|
|
13546
|
+
state: literal("loaded"),
|
|
13547
|
+
views: array(CompositionViewSchema)
|
|
13548
|
+
}), CompositionsNotLoadedSchema]);
|
|
13549
|
+
var CompositionGetReadSchema = discriminatedUnion("state", [object({
|
|
13550
|
+
state: literal("loaded"),
|
|
13551
|
+
view: CompositionViewSchema.nullable()
|
|
13552
|
+
}), CompositionsNotLoadedSchema]);
|
|
13289
13553
|
/** What a compile attempt produced. */
|
|
13290
13554
|
var CoreBlockCompileResultSchema = object({
|
|
13291
13555
|
ok: boolean(),
|
|
@@ -13323,7 +13587,72 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
13323
13587
|
}), method(object({}), object({ libs: array(object({
|
|
13324
13588
|
filePath: string(),
|
|
13325
13589
|
content: string()
|
|
13326
|
-
})) }), { auth: "admin" })
|
|
13590
|
+
})) }), { auth: "admin" }), method(object({ block: CompositionBlockInputSchema }), object({ block: CoreBlockSchema }), {
|
|
13591
|
+
kind: "mutation",
|
|
13592
|
+
auth: "admin",
|
|
13593
|
+
caller: "required"
|
|
13594
|
+
}), method(object({
|
|
13595
|
+
blockId: string(),
|
|
13596
|
+
expectedUpdatedAt: number(),
|
|
13597
|
+
block: CompositionBlockInputSchema.partial()
|
|
13598
|
+
}), object({ block: CoreBlockSchema }), {
|
|
13599
|
+
kind: "mutation",
|
|
13600
|
+
auth: "admin",
|
|
13601
|
+
caller: "required"
|
|
13602
|
+
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
13603
|
+
composition: CompositionSchema,
|
|
13604
|
+
blockId: string().optional()
|
|
13605
|
+
}), CompositionValidationSchema, {
|
|
13606
|
+
kind: "mutation",
|
|
13607
|
+
auth: "admin",
|
|
13608
|
+
access: "view"
|
|
13609
|
+
});
|
|
13610
|
+
var ComposerBlockSchema = object({
|
|
13611
|
+
id: string().min(1),
|
|
13612
|
+
name: string().min(1).max(120),
|
|
13613
|
+
enabled: boolean(),
|
|
13614
|
+
updatedAt: number(),
|
|
13615
|
+
composition: CompositionSchema
|
|
13616
|
+
});
|
|
13617
|
+
/**
|
|
13618
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
13619
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
13620
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
13621
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
13622
|
+
*/
|
|
13623
|
+
var ComposerUnreadableBlockSchema = object({
|
|
13624
|
+
id: string().min(1),
|
|
13625
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
13626
|
+
name: string().nullable(),
|
|
13627
|
+
/** The parse error, in the operator's words. */
|
|
13628
|
+
error: string()
|
|
13629
|
+
});
|
|
13630
|
+
method(object({
|
|
13631
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
13632
|
+
integrationId: string().nullable(),
|
|
13633
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
13634
|
+
storeLoaded: boolean(),
|
|
13635
|
+
blocks: array(ComposerBlockSchema),
|
|
13636
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
13637
|
+
restartBlockIds: array(string()),
|
|
13638
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
13639
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
13640
|
+
}), object({
|
|
13641
|
+
blocks: array(object({
|
|
13642
|
+
blockId: string(),
|
|
13643
|
+
status: CompositionRunStatusSchema,
|
|
13644
|
+
reason: string().optional()
|
|
13645
|
+
})),
|
|
13646
|
+
/**
|
|
13647
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
13648
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
13649
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
13650
|
+
*/
|
|
13651
|
+
acted: boolean()
|
|
13652
|
+
}), {
|
|
13653
|
+
kind: "mutation",
|
|
13654
|
+
auth: "admin"
|
|
13655
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
13327
13656
|
/**
|
|
13328
13657
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
13329
13658
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -19090,8 +19419,8 @@ var NcTestResultSchema = object({
|
|
|
19090
19419
|
className: string().optional(),
|
|
19091
19420
|
label: string().optional()
|
|
19092
19421
|
});
|
|
19093
|
-
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
19094
|
-
*
|
|
19422
|
+
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
19423
|
+
* `z.infer` of this schema — one shape, no twin. `mixed` is DERIVED
|
|
19095
19424
|
* (a stored system rule whose kinds span families, D637) and never authored. */
|
|
19096
19425
|
var NcRuleKindSchema = _enum([
|
|
19097
19426
|
"detection",
|
|
@@ -35161,6 +35490,38 @@ DeviceType.Camera, method(object({
|
|
|
35161
35490
|
detection: array(ZoneRuleSchema).readonly(),
|
|
35162
35491
|
package: array(ZoneRuleSchema).readonly()
|
|
35163
35492
|
});
|
|
35493
|
+
var NUMBER = {
|
|
35494
|
+
kind: "fixed",
|
|
35495
|
+
result: ["number"]
|
|
35496
|
+
};
|
|
35497
|
+
var BOOLEAN = {
|
|
35498
|
+
kind: "fixed",
|
|
35499
|
+
result: ["boolean"]
|
|
35500
|
+
};
|
|
35501
|
+
Object.freeze({
|
|
35502
|
+
min: NUMBER,
|
|
35503
|
+
max: NUMBER,
|
|
35504
|
+
abs: NUMBER,
|
|
35505
|
+
floor: NUMBER,
|
|
35506
|
+
ceil: NUMBER,
|
|
35507
|
+
sqrt: NUMBER,
|
|
35508
|
+
round: NUMBER,
|
|
35509
|
+
pow: NUMBER,
|
|
35510
|
+
clamp: NUMBER,
|
|
35511
|
+
avg: NUMBER,
|
|
35512
|
+
sum: NUMBER,
|
|
35513
|
+
age: NUMBER,
|
|
35514
|
+
convert: NUMBER,
|
|
35515
|
+
coalesce: { kind: "coalesce" },
|
|
35516
|
+
any: BOOLEAN,
|
|
35517
|
+
all: BOOLEAN,
|
|
35518
|
+
within: BOOLEAN,
|
|
35519
|
+
latest: {
|
|
35520
|
+
kind: "fixed",
|
|
35521
|
+
result: ["number", "null"]
|
|
35522
|
+
}
|
|
35523
|
+
});
|
|
35524
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
35164
35525
|
/**
|
|
35165
35526
|
* Accessory device helpers — shared across drivers.
|
|
35166
35527
|
*
|
|
@@ -37469,6 +37830,18 @@ Object.freeze({
|
|
|
37469
37830
|
addonId: null,
|
|
37470
37831
|
access: "create"
|
|
37471
37832
|
},
|
|
37833
|
+
"composer.applyBlocks": {
|
|
37834
|
+
capName: "composer",
|
|
37835
|
+
capScope: "system",
|
|
37836
|
+
addonId: null,
|
|
37837
|
+
access: "create"
|
|
37838
|
+
},
|
|
37839
|
+
"composer.getStates": {
|
|
37840
|
+
capName: "composer",
|
|
37841
|
+
capScope: "system",
|
|
37842
|
+
addonId: null,
|
|
37843
|
+
access: "view"
|
|
37844
|
+
},
|
|
37472
37845
|
"connectionTest.describeTest": {
|
|
37473
37846
|
capName: "connection-test",
|
|
37474
37847
|
capScope: "system",
|
|
@@ -37529,6 +37902,12 @@ Object.freeze({
|
|
|
37529
37902
|
addonId: null,
|
|
37530
37903
|
access: "create"
|
|
37531
37904
|
},
|
|
37905
|
+
"coreBlocks.createComposition": {
|
|
37906
|
+
capName: "core-blocks",
|
|
37907
|
+
capScope: "system",
|
|
37908
|
+
addonId: null,
|
|
37909
|
+
access: "create"
|
|
37910
|
+
},
|
|
37532
37911
|
"coreBlocks.delete": {
|
|
37533
37912
|
capName: "core-blocks",
|
|
37534
37913
|
capScope: "system",
|
|
@@ -37541,6 +37920,12 @@ Object.freeze({
|
|
|
37541
37920
|
addonId: null,
|
|
37542
37921
|
access: "view"
|
|
37543
37922
|
},
|
|
37923
|
+
"coreBlocks.getComposition": {
|
|
37924
|
+
capName: "core-blocks",
|
|
37925
|
+
capScope: "system",
|
|
37926
|
+
addonId: null,
|
|
37927
|
+
access: "view"
|
|
37928
|
+
},
|
|
37544
37929
|
"coreBlocks.getTypeDefs": {
|
|
37545
37930
|
capName: "core-blocks",
|
|
37546
37931
|
capScope: "system",
|
|
@@ -37553,6 +37938,12 @@ Object.freeze({
|
|
|
37553
37938
|
addonId: null,
|
|
37554
37939
|
access: "view"
|
|
37555
37940
|
},
|
|
37941
|
+
"coreBlocks.listCompositions": {
|
|
37942
|
+
capName: "core-blocks",
|
|
37943
|
+
capScope: "system",
|
|
37944
|
+
addonId: null,
|
|
37945
|
+
access: "view"
|
|
37946
|
+
},
|
|
37556
37947
|
"coreBlocks.restart": {
|
|
37557
37948
|
capName: "core-blocks",
|
|
37558
37949
|
capScope: "system",
|
|
@@ -37571,6 +37962,18 @@ Object.freeze({
|
|
|
37571
37962
|
addonId: null,
|
|
37572
37963
|
access: "create"
|
|
37573
37964
|
},
|
|
37965
|
+
"coreBlocks.updateComposition": {
|
|
37966
|
+
capName: "core-blocks",
|
|
37967
|
+
capScope: "system",
|
|
37968
|
+
addonId: null,
|
|
37969
|
+
access: "create"
|
|
37970
|
+
},
|
|
37971
|
+
"coreBlocks.validateComposition": {
|
|
37972
|
+
capName: "core-blocks",
|
|
37973
|
+
capScope: "system",
|
|
37974
|
+
addonId: null,
|
|
37975
|
+
access: "view"
|
|
37976
|
+
},
|
|
37574
37977
|
"cover.close": {
|
|
37575
37978
|
capName: "cover",
|
|
37576
37979
|
capScope: "device",
|