@camstack/addon-pipeline 1.2.299 → 1.2.300
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/audio-analyzer/index.js +2 -2
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/{default-detection-model-DMcHBVmE.mjs → default-detection-model-DX-p9O91.mjs} +1 -1
- package/dist/{default-detection-model-H_NzHI_P.js → default-detection-model-nKzvW7BX.js} +1 -1
- package/dist/detection-pipeline/index.js +4 -4
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-BzDPLvQ6.js → dist-C2WOjQsy.js} +425 -22
- package/dist/{dist-DNlqf8dr.mjs → dist-CqhrlD0m.mjs} +425 -22
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-g2ZRFDvc.mjs → node-CZ1Z3f6z.mjs} +1 -1
- package/dist/{node-B-cB_Hdy.js → node-CiWM78Ze.js} +1 -1
- package/dist/pipeline-runner/index.js +3 -3
- package/dist/pipeline-runner/index.mjs +3 -3
- package/dist/{process-memory-Bo3-laZ_.js → process-memory-C0a37mXF.js} +1 -1
- package/dist/{process-memory-kKYoJ9hl.mjs → process-memory-taq9GnsO.mjs} +1 -1
- package/dist/recorder/index.js +15 -2
- package/dist/recorder/index.mjs +15 -2
- package/dist/{segment-demux-js-DrDj8kP6.js → segment-demux-js-5Xcu3sTI.js} +1 -1
- package/dist/{segment-demux-js-QK7qFMSj.mjs → segment-demux-js-Cydmp9fc.mjs} +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Da_bbYQp.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-C7I6DjP3.mjs} +2 -2
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-vnc0r4NV.mjs +26 -0
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CUFWg1jj.mjs +26 -0
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-aFrOa5WT.mjs → hostInit-DyrGVuyu.mjs} +2 -2
- package/dist/stream-broker/index.js +3 -3
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/python/postprocessors/testdata/ssdlite_mobiledet_outputs.json +289 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CxT9ry2j.mjs +0 -26
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Dti8Ex88.mjs +0 -26
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-emK7D4bc.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
7
|
-
const require_process_memory = require("../process-memory-
|
|
6
|
+
const require_dist = require("../dist-C2WOjQsy.js");
|
|
7
|
+
const require_process_memory = require("../process-memory-C0a37mXF.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
10
|
let node_path = require("node:path");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __require } from "../chunk-DnnnRqeS.mjs";
|
|
2
|
-
import { E as HF_BASE_URL, G as audioAnalyzerCapability, Rn as EventCategory, Ut as resolvePoolMemoryPolicy, W as audioAnalysisCapability, _n as hydrateSchema, bt as mapAudioLabelToMacro, en as errMsg, fn as audioChunkBytesPerSample, gn as expandAudioChunkToF32le, j as PoolMemoryWatchdog, n as AUDIO_BACKEND_CHOICES, p as DEFAULT_AUDIO_ANALYZER_CONFIG, sn as BaseAddon, xn as nodePin } from "../dist-
|
|
3
|
-
import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-
|
|
2
|
+
import { E as HF_BASE_URL, G as audioAnalyzerCapability, Rn as EventCategory, Ut as resolvePoolMemoryPolicy, W as audioAnalysisCapability, _n as hydrateSchema, bt as mapAudioLabelToMacro, en as errMsg, fn as audioChunkBytesPerSample, gn as expandAudioChunkToF32le, j as PoolMemoryWatchdog, n as AUDIO_BACKEND_CHOICES, p as DEFAULT_AUDIO_ANALYZER_CONFIG, sn as BaseAddon, xn as nodePin } from "../dist-CqhrlD0m.mjs";
|
|
3
|
+
import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-taq9GnsO.mjs";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
import { downloadFile } from "@camstack/system/addon-utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as audioKindId, Kt as stepModelRunsOnFormat, d as COCO_80_LABELS, f as COCO_TO_MACRO, gt as inferModelProvider, ht as hfModelUrl, r as AUDIO_MACRO_LABELS, y as DEVICE_BACKEND_TO_FORMAT } from "./dist-
|
|
1
|
+
import { K as audioKindId, Kt as stepModelRunsOnFormat, d as COCO_80_LABELS, f as COCO_TO_MACRO, gt as inferModelProvider, ht as hfModelUrl, r as AUDIO_MACRO_LABELS, y as DEVICE_BACKEND_TO_FORMAT } from "./dist-CqhrlD0m.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
//#region src/detection-pipeline/pipeline/landmark-precision-gate.ts
|
|
4
4
|
/**
|
|
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-emK7D4bc.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
7
|
-
const require_node = require("../node-
|
|
8
|
-
const require_default_detection_model = require("../default-detection-model-
|
|
6
|
+
const require_dist = require("../dist-C2WOjQsy.js");
|
|
7
|
+
const require_node = require("../node-CiWM78Ze.js");
|
|
8
|
+
const require_default_detection_model = require("../default-detection-model-nKzvW7BX.js");
|
|
9
9
|
const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
|
|
10
|
-
const require_process_memory = require("../process-memory-
|
|
10
|
+
const require_process_memory = require("../process-memory-C0a37mXF.js");
|
|
11
11
|
let node_os = require("node:os");
|
|
12
12
|
node_os = require_chunk.__toESM(node_os);
|
|
13
13
|
let node_fs = require("node:fs");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as __require } from "../chunk-DnnnRqeS.mjs";
|
|
2
|
-
import { Dn as array, Dt as overlayClusterStepSettings, Gt as runtimeDevices$1, H as YAMNET_TO_MACRO, In as string, Kt as stepModelRunsOnFormat, Ln as union, Mt as pipelineExecutorCapability, Nn as object, Rn as EventCategory, Sn as parseJsonUnknown, Tn as sleep, Ut as resolvePoolMemoryPolicy, Zt as supportedRuntimes$1, _n as hydrateSchema, en as errMsg, et as defaultDeviceFor$1, it as detectionPipelineCapability, j as PoolMemoryWatchdog, kt as pickClusterStepSettings, lt as evaluateZoneRules, m as DEFAULT_CLUSTER_STEP_SETTINGS, pn as createEvent, sn as BaseAddon, st as enumerateInferenceDevices, t as APPLE_SA_TO_MACRO, u as CLUSTER_MODEL_SCOPED_STEPS, vt as loadContributionCapability, xn as nodePin, y as DEVICE_BACKEND_TO_FORMAT, zt as resolveClusterStepModelId } from "../dist-
|
|
3
|
-
import { s as readProcessCost } from "../node-
|
|
4
|
-
import { _ as resolveModelForFormat, a as buildSubtreeCanRun, c as macroGateVerdict, f as ALL_PIPELINE_STEPS, g as getStepDefinition, h as getStep, i as mergeCustomModels, m as getDefaultModelForFormat, n as resolveDefaultDetectionModel, p as ALL_STEPS, r as CustomModelCatalog, u as localFrameRegistry, y as landmarkPrecisionVerdict } from "../default-detection-model-
|
|
2
|
+
import { Dn as array, Dt as overlayClusterStepSettings, Gt as runtimeDevices$1, H as YAMNET_TO_MACRO, In as string, Kt as stepModelRunsOnFormat, Ln as union, Mt as pipelineExecutorCapability, Nn as object, Rn as EventCategory, Sn as parseJsonUnknown, Tn as sleep, Ut as resolvePoolMemoryPolicy, Zt as supportedRuntimes$1, _n as hydrateSchema, en as errMsg, et as defaultDeviceFor$1, it as detectionPipelineCapability, j as PoolMemoryWatchdog, kt as pickClusterStepSettings, lt as evaluateZoneRules, m as DEFAULT_CLUSTER_STEP_SETTINGS, pn as createEvent, sn as BaseAddon, st as enumerateInferenceDevices, t as APPLE_SA_TO_MACRO, u as CLUSTER_MODEL_SCOPED_STEPS, vt as loadContributionCapability, xn as nodePin, y as DEVICE_BACKEND_TO_FORMAT, zt as resolveClusterStepModelId } from "../dist-CqhrlD0m.mjs";
|
|
3
|
+
import { s as readProcessCost } from "../node-CZ1Z3f6z.mjs";
|
|
4
|
+
import { _ as resolveModelForFormat, a as buildSubtreeCanRun, c as macroGateVerdict, f as ALL_PIPELINE_STEPS, g as getStepDefinition, h as getStep, i as mergeCustomModels, m as getDefaultModelForFormat, n as resolveDefaultDetectionModel, p as ALL_STEPS, r as CustomModelCatalog, u as localFrameRegistry, y as landmarkPrecisionVerdict } from "../default-detection-model-DX-p9O91.mjs";
|
|
5
5
|
import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
|
|
6
|
-
import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-
|
|
6
|
+
import { n as pickNodePlatformArch, t as readProcessMemory } from "../process-memory-taq9GnsO.mjs";
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as fs from "node:fs";
|
|
9
9
|
import * as path$1 from "node:path";
|
|
@@ -11701,23 +11701,6 @@ var ExpressionEvalError = class extends Error {
|
|
|
11701
11701
|
this.name = "ExpressionEvalError";
|
|
11702
11702
|
}
|
|
11703
11703
|
};
|
|
11704
|
-
/**
|
|
11705
|
-
* Frozen, null-prototype builtin function table for the expression engine
|
|
11706
|
-
* (spec §4 rule 4). The table is the SOLE surface of callable functions: the
|
|
11707
|
-
* parser rejects any callee not in it, and the evaluator gates each call on an
|
|
11708
|
-
* own-property check against it.
|
|
11709
|
-
*
|
|
11710
|
-
* Because the object has a NULL prototype AND is `Object.freeze`d:
|
|
11711
|
-
* - it cannot be polluted (no `__proto__` / `constructor` write reaches it);
|
|
11712
|
-
* - a lookup for `toString` / `hasOwnProperty` / `constructor` finds NOTHING
|
|
11713
|
-
* (there is no `Object.prototype` in the chain), so those names are not
|
|
11714
|
-
* callable — they are simply "unknown function" at parse time.
|
|
11715
|
-
*
|
|
11716
|
-
* Every numeric argument is validated as a finite number and every numeric
|
|
11717
|
-
* RESULT is re-checked finite, so `/0`, `sqrt(-1)` (→ NaN) and overflow
|
|
11718
|
-
* (`pow(10,400)` → Infinity) all raise `ExpressionEvalError` and fail the link
|
|
11719
|
-
* closed rather than emitting a garbage value.
|
|
11720
|
-
*/
|
|
11721
11704
|
function asFiniteNumber(value, name, index) {
|
|
11722
11705
|
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
11723
11706
|
return value;
|
|
@@ -11733,6 +11716,10 @@ function finiteResult(value, name) {
|
|
|
11733
11716
|
function allFiniteNumbers(args, name) {
|
|
11734
11717
|
return args.map((a, idx) => asFiniteNumber(a, name, idx));
|
|
11735
11718
|
}
|
|
11719
|
+
function asBoolean$1(value, name, index) {
|
|
11720
|
+
if (typeof value !== "boolean") throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a boolean`);
|
|
11721
|
+
return value;
|
|
11722
|
+
}
|
|
11736
11723
|
var INF = Number.POSITIVE_INFINITY;
|
|
11737
11724
|
var table = {
|
|
11738
11725
|
min: {
|
|
@@ -11833,6 +11820,40 @@ var table = {
|
|
|
11833
11820
|
if (from === to) return x;
|
|
11834
11821
|
throw new ExpressionEvalError("convert: unit conversion table not installed");
|
|
11835
11822
|
}
|
|
11823
|
+
},
|
|
11824
|
+
any: {
|
|
11825
|
+
minArgs: 1,
|
|
11826
|
+
maxArgs: INF,
|
|
11827
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "any", i)).some((b) => b)
|
|
11828
|
+
},
|
|
11829
|
+
all: {
|
|
11830
|
+
minArgs: 1,
|
|
11831
|
+
maxArgs: INF,
|
|
11832
|
+
apply: (args) => args.map((a, i) => asBoolean$1(a, "all", i)).every((b) => b)
|
|
11833
|
+
},
|
|
11834
|
+
within: {
|
|
11835
|
+
minArgs: 2,
|
|
11836
|
+
maxArgs: 2,
|
|
11837
|
+
apply: (args, hooks) => {
|
|
11838
|
+
const windowMs = asFiniteNumber(args[1], "within", 1);
|
|
11839
|
+
if (windowMs < 0) throw new ExpressionEvalError("within: the window must not be negative");
|
|
11840
|
+
const at = args[0];
|
|
11841
|
+
if (at === null) return false;
|
|
11842
|
+
const ts = asFiniteNumber(at, "within", 0);
|
|
11843
|
+
const now = hooks.now;
|
|
11844
|
+
if (now === void 0 || !Number.isFinite(now)) throw new ExpressionEvalError("within: no clock was supplied to this evaluation");
|
|
11845
|
+
const inside = now - ts <= windowMs;
|
|
11846
|
+
if (inside) hooks.noteDeadline?.(ts + windowMs + 1);
|
|
11847
|
+
return inside;
|
|
11848
|
+
}
|
|
11849
|
+
},
|
|
11850
|
+
latest: {
|
|
11851
|
+
minArgs: 1,
|
|
11852
|
+
maxArgs: INF,
|
|
11853
|
+
apply: (args) => {
|
|
11854
|
+
const present = args.flatMap((a, i) => a === null ? [] : [asFiniteNumber(a, "latest", i)]);
|
|
11855
|
+
return present.length === 0 ? null : finiteResult(Math.max(...present), "latest");
|
|
11856
|
+
}
|
|
11836
11857
|
}
|
|
11837
11858
|
};
|
|
11838
11859
|
Object.freeze(Object.assign(Object.create(null), table));
|
|
@@ -12447,7 +12468,7 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
12447
12468
|
code: string().min(1).max(2e4)
|
|
12448
12469
|
})
|
|
12449
12470
|
]);
|
|
12450
|
-
object({
|
|
12471
|
+
var AutomationRecipeSchema = object({
|
|
12451
12472
|
triggers: array(AutomationTriggerSchema),
|
|
12452
12473
|
conditions: AutomationConditionSchema.optional(),
|
|
12453
12474
|
actions: array(AutomationActionSchema)
|
|
@@ -14970,6 +14991,195 @@ var cameraStreamsCapability = {
|
|
|
14970
14991
|
*/
|
|
14971
14992
|
durability: "session"
|
|
14972
14993
|
};
|
|
14994
|
+
/** A composed device's stableId is this prefix plus the block id. */
|
|
14995
|
+
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
14996
|
+
/** Longest snippet a `code` source may carry (slice 4). */
|
|
14997
|
+
var MAX_COMPOSITION_CODE_LENGTH = 2e4;
|
|
14998
|
+
var CompositionSourceRefSchema = object({
|
|
14999
|
+
/** The owning addon; `stableId` is unique only within it. */
|
|
15000
|
+
addonId: string().min(1),
|
|
15001
|
+
stableId: string().min(1)
|
|
15002
|
+
});
|
|
15003
|
+
/** One field of one capability of one source device. */
|
|
15004
|
+
var CompositionFieldReadSchema = object({
|
|
15005
|
+
source: CompositionSourceRefSchema,
|
|
15006
|
+
cap: string().min(1),
|
|
15007
|
+
/** Dotted path into the source cap's runtime-state slice. */
|
|
15008
|
+
fieldPath: string().min(1)
|
|
15009
|
+
});
|
|
15010
|
+
/** `from`: copy one source field verbatim. It is also an expression's `from` binding. */
|
|
15011
|
+
var CompositionFromSourceSchema = CompositionFieldReadSchema.extend({ kind: literal("from") });
|
|
15012
|
+
var CompositionBindingSchema = discriminatedUnion("kind", [CompositionFromSourceSchema, object({
|
|
15013
|
+
kind: literal("literal"),
|
|
15014
|
+
value: union([
|
|
15015
|
+
string(),
|
|
15016
|
+
number(),
|
|
15017
|
+
boolean(),
|
|
15018
|
+
_null()
|
|
15019
|
+
])
|
|
15020
|
+
})]);
|
|
15021
|
+
/**
|
|
15022
|
+
* `expression`: a formula over named bindings, in the salvaged expression
|
|
15023
|
+
* engine. Validated at parse by the SAME function every other consumer runs,
|
|
15024
|
+
* so the editor and the store cannot disagree.
|
|
15025
|
+
*/
|
|
15026
|
+
var CompositionExpressionSourceSchema = object({
|
|
15027
|
+
kind: literal("expression"),
|
|
15028
|
+
expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
|
|
15029
|
+
bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), CompositionBindingSchema)
|
|
15030
|
+
}).superRefine((src, ctx) => {
|
|
15031
|
+
const err = validateExpressionSource(src);
|
|
15032
|
+
if (err !== null) ctx.addIssue({
|
|
15033
|
+
code: "custom",
|
|
15034
|
+
message: err,
|
|
15035
|
+
path: ["expr"]
|
|
15036
|
+
});
|
|
15037
|
+
});
|
|
15038
|
+
/** `code`: RESERVED for slice 4 (own runner, one-way eject). */
|
|
15039
|
+
var CompositionCodeSourceSchema = object({
|
|
15040
|
+
kind: literal("code"),
|
|
15041
|
+
code: string().min(1).max(MAX_COMPOSITION_CODE_LENGTH)
|
|
15042
|
+
});
|
|
15043
|
+
var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
15044
|
+
CompositionFromSourceSchema,
|
|
15045
|
+
CompositionExpressionSourceSchema,
|
|
15046
|
+
CompositionCodeSourceSchema
|
|
15047
|
+
]);
|
|
15048
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
|
|
15049
|
+
kind: literal("forward"),
|
|
15050
|
+
source: CompositionSourceRefSchema,
|
|
15051
|
+
cap: string().min(1),
|
|
15052
|
+
method: string().min(1)
|
|
15053
|
+
}), CompositionCodeSourceSchema]);
|
|
15054
|
+
var CompositionFeatureSchema = discriminatedUnion("kind", [object({
|
|
15055
|
+
kind: literal("fields"),
|
|
15056
|
+
cap: string().min(1),
|
|
15057
|
+
fields: record(string().min(1), CompositionFieldSourceSchema).refine((fields) => Object.keys(fields).length <= 32, { message: `at most 32 fields per capability` }),
|
|
15058
|
+
/** RESERVED for slice 3; refused by the validator when non-empty. */
|
|
15059
|
+
commands: record(string().min(1), CompositionCommandTargetSchema).optional()
|
|
15060
|
+
}), object({
|
|
15061
|
+
kind: literal("passthrough"),
|
|
15062
|
+
cap: string().min(1),
|
|
15063
|
+
source: CompositionSourceRefSchema
|
|
15064
|
+
})]);
|
|
15065
|
+
var CompositionSchema = object({
|
|
15066
|
+
target: discriminatedUnion("kind", [object({
|
|
15067
|
+
kind: literal("new"),
|
|
15068
|
+
type: _enum(DeviceType),
|
|
15069
|
+
role: _enum(DeviceRole).optional()
|
|
15070
|
+
}), object({
|
|
15071
|
+
kind: literal("existing"),
|
|
15072
|
+
device: CompositionSourceRefSchema
|
|
15073
|
+
})]),
|
|
15074
|
+
features: array(CompositionFeatureSchema).min(1).max(16)
|
|
15075
|
+
}).superRefine((composition, ctx) => {
|
|
15076
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15077
|
+
composition.features.forEach((feature, index) => {
|
|
15078
|
+
if (seen.has(feature.cap)) ctx.addIssue({
|
|
15079
|
+
code: "custom",
|
|
15080
|
+
message: `capability \`${feature.cap}\` is composed twice — one feature per capability`,
|
|
15081
|
+
path: [
|
|
15082
|
+
"features",
|
|
15083
|
+
index,
|
|
15084
|
+
"cap"
|
|
15085
|
+
]
|
|
15086
|
+
});
|
|
15087
|
+
seen.add(feature.cap);
|
|
15088
|
+
});
|
|
15089
|
+
});
|
|
15090
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
|
|
15091
|
+
var CompositionProblemSchema = object({
|
|
15092
|
+
code: _enum([
|
|
15093
|
+
"reserved-variant",
|
|
15094
|
+
"unknown-capability",
|
|
15095
|
+
"not-composable",
|
|
15096
|
+
"wrong-device-type",
|
|
15097
|
+
"has-commands",
|
|
15098
|
+
"unknown-field",
|
|
15099
|
+
"nested-field",
|
|
15100
|
+
"missing-field",
|
|
15101
|
+
"kind-mismatch",
|
|
15102
|
+
"may-be-null",
|
|
15103
|
+
"source-missing",
|
|
15104
|
+
"source-unreadable",
|
|
15105
|
+
"source-capability-missing",
|
|
15106
|
+
"source-field-unknown",
|
|
15107
|
+
"expression-invalid",
|
|
15108
|
+
"cycle",
|
|
15109
|
+
"duplicate-target"
|
|
15110
|
+
]),
|
|
15111
|
+
path: string(),
|
|
15112
|
+
message: string()
|
|
15113
|
+
});
|
|
15114
|
+
var CompositionFieldKindSchema = _enum([
|
|
15115
|
+
"string",
|
|
15116
|
+
"number",
|
|
15117
|
+
"boolean",
|
|
15118
|
+
"enum"
|
|
15119
|
+
]);
|
|
15120
|
+
/** How a field says "unavailable": `null` when its schema allows it, else the device goes offline (D393). */
|
|
15121
|
+
var CompositionUnavailableModeSchema = _enum(["null", "offline"]);
|
|
15122
|
+
/**
|
|
15123
|
+
* `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
|
|
15124
|
+
* field of its cap changes value · `constant` reads nothing, computed once.
|
|
15125
|
+
*/
|
|
15126
|
+
var CompositionFieldRoleSchema = _enum([
|
|
15127
|
+
"derived",
|
|
15128
|
+
"clock",
|
|
15129
|
+
"constant"
|
|
15130
|
+
]);
|
|
15131
|
+
var CompositionFieldPlanSchema = object({
|
|
15132
|
+
cap: string(),
|
|
15133
|
+
path: string(),
|
|
15134
|
+
/** Index into `composition.features` this field's capability came from —
|
|
15135
|
+
* lets a source/cycle problem name its path as `features[N].fields.<path>`
|
|
15136
|
+
* (the same convention `planComposition`'s own problems already use). */
|
|
15137
|
+
featureIndex: number().int().nonnegative(),
|
|
15138
|
+
kind: CompositionFieldKindSchema,
|
|
15139
|
+
nullable: boolean(),
|
|
15140
|
+
required: boolean(),
|
|
15141
|
+
unavailable: CompositionUnavailableModeSchema,
|
|
15142
|
+
role: CompositionFieldRoleSchema,
|
|
15143
|
+
source: CompositionFieldSourceSchema,
|
|
15144
|
+
reads: array(CompositionFieldReadSchema)
|
|
15145
|
+
});
|
|
15146
|
+
var CompositionValidationSchema = object({
|
|
15147
|
+
ok: boolean(),
|
|
15148
|
+
problems: array(CompositionProblemSchema),
|
|
15149
|
+
fields: array(CompositionFieldPlanSchema)
|
|
15150
|
+
});
|
|
15151
|
+
/** Mirrors `CoreBlockStatus`, pinned by `core-blocks-source.spec.ts` (Task 11). */
|
|
15152
|
+
var CompositionRunStatusSchema = _enum([
|
|
15153
|
+
"stopped",
|
|
15154
|
+
"starting",
|
|
15155
|
+
"running",
|
|
15156
|
+
"failed"
|
|
15157
|
+
]);
|
|
15158
|
+
var CompositionFieldStateKindSchema = _enum([
|
|
15159
|
+
"fresh",
|
|
15160
|
+
"stale",
|
|
15161
|
+
"unavailable"
|
|
15162
|
+
]);
|
|
15163
|
+
var CompositionFieldStateSchema = object({
|
|
15164
|
+
cap: string(),
|
|
15165
|
+
path: string(),
|
|
15166
|
+
state: CompositionFieldStateKindSchema,
|
|
15167
|
+
/** `null` whenever `state === 'unavailable'`; never a plausible stand-in (D393). */
|
|
15168
|
+
value: union([
|
|
15169
|
+
string(),
|
|
15170
|
+
number(),
|
|
15171
|
+
boolean(),
|
|
15172
|
+
_null()
|
|
15173
|
+
]),
|
|
15174
|
+
reason: string().optional()
|
|
15175
|
+
});
|
|
15176
|
+
var CompositionBlockStateSchema = object({
|
|
15177
|
+
blockId: string(),
|
|
15178
|
+
deviceId: number().nullable(),
|
|
15179
|
+
status: CompositionRunStatusSchema,
|
|
15180
|
+
reason: string().optional(),
|
|
15181
|
+
fields: array(CompositionFieldStateSchema)
|
|
15182
|
+
});
|
|
14973
15183
|
/** Where a block runs. The operator chooses — a block driving a device on an
|
|
14974
15184
|
* agent is the reason placement is not fixed to the hub. */
|
|
14975
15185
|
var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
|
|
@@ -14996,6 +15206,30 @@ var CoreBlockInputSchema = object({
|
|
|
14996
15206
|
*/
|
|
14997
15207
|
integrationId: string().optional()
|
|
14998
15208
|
});
|
|
15209
|
+
/**
|
|
15210
|
+
* What a block IS (D659). Absent means `code` — every row stored before this
|
|
15211
|
+
* union keeps working unchanged.
|
|
15212
|
+
* - `code`: the TypeScript in `code`, compiled and run in its own runner;
|
|
15213
|
+
* - `recipe`: RESERVED (automations), stored shape only; refused at run by name;
|
|
15214
|
+
* - `composition`: declarative, run by the shared `composer`; `code` is `''`.
|
|
15215
|
+
*/
|
|
15216
|
+
var CoreBlockSourceSchema = discriminatedUnion("kind", [
|
|
15217
|
+
object({ kind: literal("code") }),
|
|
15218
|
+
object({
|
|
15219
|
+
kind: literal("recipe"),
|
|
15220
|
+
recipe: AutomationRecipeSchema
|
|
15221
|
+
}),
|
|
15222
|
+
object({
|
|
15223
|
+
kind: literal("composition"),
|
|
15224
|
+
composition: CompositionSchema
|
|
15225
|
+
})
|
|
15226
|
+
]);
|
|
15227
|
+
/** The client-authored half of a composition block. No `code`, no placement (hub-only; Phase 7). */
|
|
15228
|
+
var CompositionBlockInputSchema = object({
|
|
15229
|
+
name: string().min(1).max(120),
|
|
15230
|
+
enabled: boolean(),
|
|
15231
|
+
composition: CompositionSchema
|
|
15232
|
+
});
|
|
14999
15233
|
/** A stored block. */
|
|
15000
15234
|
var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
15001
15235
|
id: string(),
|
|
@@ -15011,8 +15245,38 @@ var CoreBlockSchema = CoreBlockInputSchema.extend({
|
|
|
15011
15245
|
*/
|
|
15012
15246
|
lastError: string().optional(),
|
|
15013
15247
|
/** Ms epoch of the last state change. */
|
|
15014
|
-
lastChangedAt: number()
|
|
15248
|
+
lastChangedAt: number(),
|
|
15249
|
+
/** What the block is. Absent means `code` (D659). */
|
|
15250
|
+
source: CoreBlockSourceSchema.optional()
|
|
15251
|
+
});
|
|
15252
|
+
/** A stored composition block and what the composer says about it. */
|
|
15253
|
+
var CompositionViewSchema = object({
|
|
15254
|
+
block: CoreBlockSchema,
|
|
15255
|
+
state: discriminatedUnion("kind", [object({
|
|
15256
|
+
kind: literal("answered"),
|
|
15257
|
+
state: CompositionBlockStateSchema.nullable()
|
|
15258
|
+
}), object({
|
|
15259
|
+
kind: literal("unreachable"),
|
|
15260
|
+
error: string()
|
|
15261
|
+
})])
|
|
15262
|
+
});
|
|
15263
|
+
/**
|
|
15264
|
+
* A read of the stored compositions. `not-loaded` while the `core_blocks`
|
|
15265
|
+
* table has not been READ: an empty answer then would make "not yet known"
|
|
15266
|
+
* look like "none", and invite the operator to recreate what exists (D315).
|
|
15267
|
+
*/
|
|
15268
|
+
var CompositionsNotLoadedSchema = object({
|
|
15269
|
+
state: literal("not-loaded"),
|
|
15270
|
+
reason: string()
|
|
15015
15271
|
});
|
|
15272
|
+
var CompositionListReadSchema = discriminatedUnion("state", [object({
|
|
15273
|
+
state: literal("loaded"),
|
|
15274
|
+
views: array(CompositionViewSchema)
|
|
15275
|
+
}), CompositionsNotLoadedSchema]);
|
|
15276
|
+
var CompositionGetReadSchema = discriminatedUnion("state", [object({
|
|
15277
|
+
state: literal("loaded"),
|
|
15278
|
+
view: CompositionViewSchema.nullable()
|
|
15279
|
+
}), CompositionsNotLoadedSchema]);
|
|
15016
15280
|
/** What a compile attempt produced. */
|
|
15017
15281
|
var CoreBlockCompileResultSchema = object({
|
|
15018
15282
|
ok: boolean(),
|
|
@@ -15050,7 +15314,72 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
15050
15314
|
}), method(object({}), object({ libs: array(object({
|
|
15051
15315
|
filePath: string(),
|
|
15052
15316
|
content: string()
|
|
15053
|
-
})) }), { auth: "admin" })
|
|
15317
|
+
})) }), { auth: "admin" }), method(object({ block: CompositionBlockInputSchema }), object({ block: CoreBlockSchema }), {
|
|
15318
|
+
kind: "mutation",
|
|
15319
|
+
auth: "admin",
|
|
15320
|
+
caller: "required"
|
|
15321
|
+
}), method(object({
|
|
15322
|
+
blockId: string(),
|
|
15323
|
+
expectedUpdatedAt: number(),
|
|
15324
|
+
block: CompositionBlockInputSchema.partial()
|
|
15325
|
+
}), object({ block: CoreBlockSchema }), {
|
|
15326
|
+
kind: "mutation",
|
|
15327
|
+
auth: "admin",
|
|
15328
|
+
caller: "required"
|
|
15329
|
+
}), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
|
|
15330
|
+
composition: CompositionSchema,
|
|
15331
|
+
blockId: string().optional()
|
|
15332
|
+
}), CompositionValidationSchema, {
|
|
15333
|
+
kind: "mutation",
|
|
15334
|
+
auth: "admin",
|
|
15335
|
+
access: "view"
|
|
15336
|
+
});
|
|
15337
|
+
var ComposerBlockSchema = object({
|
|
15338
|
+
id: string().min(1),
|
|
15339
|
+
name: string().min(1).max(120),
|
|
15340
|
+
enabled: boolean(),
|
|
15341
|
+
updatedAt: number(),
|
|
15342
|
+
composition: CompositionSchema
|
|
15343
|
+
});
|
|
15344
|
+
/**
|
|
15345
|
+
* A stored composition row that no longer PARSES — a schema a release
|
|
15346
|
+
* tightened, a row written by a newer build. Sent by id so the composer keeps
|
|
15347
|
+
* its device as a placeholder and reports the block `failed` naming the parse
|
|
15348
|
+
* error. Leaving it out would read, twice, exactly like a delete (D49).
|
|
15349
|
+
*/
|
|
15350
|
+
var ComposerUnreadableBlockSchema = object({
|
|
15351
|
+
id: string().min(1),
|
|
15352
|
+
/** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
|
|
15353
|
+
name: string().nullable(),
|
|
15354
|
+
/** The parse error, in the operator's words. */
|
|
15355
|
+
error: string()
|
|
15356
|
+
});
|
|
15357
|
+
method(object({
|
|
15358
|
+
/** The shared Blocks integration; null until `core-blocks` has reconciled it. */
|
|
15359
|
+
integrationId: string().nullable(),
|
|
15360
|
+
/** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
|
|
15361
|
+
storeLoaded: boolean(),
|
|
15362
|
+
blocks: array(ComposerBlockSchema),
|
|
15363
|
+
/** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
|
|
15364
|
+
restartBlockIds: array(string()),
|
|
15365
|
+
/** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
|
|
15366
|
+
unreadableBlocks: array(ComposerUnreadableBlockSchema)
|
|
15367
|
+
}), object({
|
|
15368
|
+
blocks: array(object({
|
|
15369
|
+
blockId: string(),
|
|
15370
|
+
status: CompositionRunStatusSchema,
|
|
15371
|
+
reason: string().optional()
|
|
15372
|
+
})),
|
|
15373
|
+
/**
|
|
15374
|
+
* False when the composer declared and withdrew NOTHING (store not loaded,
|
|
15375
|
+
* integration unknown, its own rows unread or read empty once). An empty
|
|
15376
|
+
* apply the caller owes is paid off only by one the composer acted on (D49).
|
|
15377
|
+
*/
|
|
15378
|
+
acted: boolean()
|
|
15379
|
+
}), {
|
|
15380
|
+
kind: "mutation",
|
|
15381
|
+
auth: "admin"
|
|
15382
|
+
}), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
|
|
15054
15383
|
/**
|
|
15055
15384
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
15056
15385
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -21223,8 +21552,8 @@ var NcTestResultSchema = object({
|
|
|
21223
21552
|
className: string().optional(),
|
|
21224
21553
|
label: string().optional()
|
|
21225
21554
|
});
|
|
21226
|
-
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
21227
|
-
*
|
|
21555
|
+
/** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is
|
|
21556
|
+
* `z.infer` of this schema — one shape, no twin. `mixed` is DERIVED
|
|
21228
21557
|
* (a stored system rule whose kinds span families, D637) and never authored. */
|
|
21229
21558
|
var NcRuleKindSchema = _enum([
|
|
21230
21559
|
"detection",
|
|
@@ -38838,6 +39167,38 @@ DeviceType.Camera, method(object({
|
|
|
38838
39167
|
detection: array(ZoneRuleSchema).readonly(),
|
|
38839
39168
|
package: array(ZoneRuleSchema).readonly()
|
|
38840
39169
|
});
|
|
39170
|
+
var NUMBER = {
|
|
39171
|
+
kind: "fixed",
|
|
39172
|
+
result: ["number"]
|
|
39173
|
+
};
|
|
39174
|
+
var BOOLEAN = {
|
|
39175
|
+
kind: "fixed",
|
|
39176
|
+
result: ["boolean"]
|
|
39177
|
+
};
|
|
39178
|
+
Object.freeze({
|
|
39179
|
+
min: NUMBER,
|
|
39180
|
+
max: NUMBER,
|
|
39181
|
+
abs: NUMBER,
|
|
39182
|
+
floor: NUMBER,
|
|
39183
|
+
ceil: NUMBER,
|
|
39184
|
+
sqrt: NUMBER,
|
|
39185
|
+
round: NUMBER,
|
|
39186
|
+
pow: NUMBER,
|
|
39187
|
+
clamp: NUMBER,
|
|
39188
|
+
avg: NUMBER,
|
|
39189
|
+
sum: NUMBER,
|
|
39190
|
+
age: NUMBER,
|
|
39191
|
+
convert: NUMBER,
|
|
39192
|
+
coalesce: { kind: "coalesce" },
|
|
39193
|
+
any: BOOLEAN,
|
|
39194
|
+
all: BOOLEAN,
|
|
39195
|
+
within: BOOLEAN,
|
|
39196
|
+
latest: {
|
|
39197
|
+
kind: "fixed",
|
|
39198
|
+
result: ["number", "null"]
|
|
39199
|
+
}
|
|
39200
|
+
});
|
|
39201
|
+
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
38841
39202
|
var HF_BASE_URL = `https://huggingface.co/camstack/camstack-models/resolve/main`;
|
|
38842
39203
|
/**
|
|
38843
39204
|
* Accessory device helpers — shared across drivers.
|
|
@@ -41165,6 +41526,18 @@ Object.freeze({
|
|
|
41165
41526
|
addonId: null,
|
|
41166
41527
|
access: "create"
|
|
41167
41528
|
},
|
|
41529
|
+
"composer.applyBlocks": {
|
|
41530
|
+
capName: "composer",
|
|
41531
|
+
capScope: "system",
|
|
41532
|
+
addonId: null,
|
|
41533
|
+
access: "create"
|
|
41534
|
+
},
|
|
41535
|
+
"composer.getStates": {
|
|
41536
|
+
capName: "composer",
|
|
41537
|
+
capScope: "system",
|
|
41538
|
+
addonId: null,
|
|
41539
|
+
access: "view"
|
|
41540
|
+
},
|
|
41168
41541
|
"connectionTest.describeTest": {
|
|
41169
41542
|
capName: "connection-test",
|
|
41170
41543
|
capScope: "system",
|
|
@@ -41225,6 +41598,12 @@ Object.freeze({
|
|
|
41225
41598
|
addonId: null,
|
|
41226
41599
|
access: "create"
|
|
41227
41600
|
},
|
|
41601
|
+
"coreBlocks.createComposition": {
|
|
41602
|
+
capName: "core-blocks",
|
|
41603
|
+
capScope: "system",
|
|
41604
|
+
addonId: null,
|
|
41605
|
+
access: "create"
|
|
41606
|
+
},
|
|
41228
41607
|
"coreBlocks.delete": {
|
|
41229
41608
|
capName: "core-blocks",
|
|
41230
41609
|
capScope: "system",
|
|
@@ -41237,6 +41616,12 @@ Object.freeze({
|
|
|
41237
41616
|
addonId: null,
|
|
41238
41617
|
access: "view"
|
|
41239
41618
|
},
|
|
41619
|
+
"coreBlocks.getComposition": {
|
|
41620
|
+
capName: "core-blocks",
|
|
41621
|
+
capScope: "system",
|
|
41622
|
+
addonId: null,
|
|
41623
|
+
access: "view"
|
|
41624
|
+
},
|
|
41240
41625
|
"coreBlocks.getTypeDefs": {
|
|
41241
41626
|
capName: "core-blocks",
|
|
41242
41627
|
capScope: "system",
|
|
@@ -41249,6 +41634,12 @@ Object.freeze({
|
|
|
41249
41634
|
addonId: null,
|
|
41250
41635
|
access: "view"
|
|
41251
41636
|
},
|
|
41637
|
+
"coreBlocks.listCompositions": {
|
|
41638
|
+
capName: "core-blocks",
|
|
41639
|
+
capScope: "system",
|
|
41640
|
+
addonId: null,
|
|
41641
|
+
access: "view"
|
|
41642
|
+
},
|
|
41252
41643
|
"coreBlocks.restart": {
|
|
41253
41644
|
capName: "core-blocks",
|
|
41254
41645
|
capScope: "system",
|
|
@@ -41267,6 +41658,18 @@ Object.freeze({
|
|
|
41267
41658
|
addonId: null,
|
|
41268
41659
|
access: "create"
|
|
41269
41660
|
},
|
|
41661
|
+
"coreBlocks.updateComposition": {
|
|
41662
|
+
capName: "core-blocks",
|
|
41663
|
+
capScope: "system",
|
|
41664
|
+
addonId: null,
|
|
41665
|
+
access: "create"
|
|
41666
|
+
},
|
|
41667
|
+
"coreBlocks.validateComposition": {
|
|
41668
|
+
capName: "core-blocks",
|
|
41669
|
+
capScope: "system",
|
|
41670
|
+
addonId: null,
|
|
41671
|
+
access: "view"
|
|
41672
|
+
},
|
|
41270
41673
|
"cover.close": {
|
|
41271
41674
|
capName: "cover",
|
|
41272
41675
|
capScope: "device",
|