@camstack/addon-pipeline 1.2.6 → 1.2.7
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 +1 -1
- package/dist/audio-analyzer/index.mjs +1 -1
- package/dist/detection-pipeline/index.js +2 -2
- package/dist/detection-pipeline/index.mjs +2 -2
- package/dist/{dist-Bw_V5L0r.mjs → dist-BwyGTnMu.mjs} +269 -1
- package/dist/{dist-Bh0H8jM6.js → dist-CAT3VF7A.js} +269 -1
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +13 -8
- package/dist/pipeline-runner/index.mjs +13 -8
- package/dist/recorder/index.js +1 -1
- package/dist/recorder/index.mjs +1 -1
- package/dist/{step-definitions-xxdpJX9-.js → step-definitions-BPEExRug.js} +1 -1
- package/dist/{step-definitions-aY4D9Loy.mjs → step-definitions-DN1obXS7.mjs} +1 -1
- package/dist/stream-broker/_stub.js +1 -1
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DX-Ef8CP.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BtN6sZcL.mjs} +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-D34ivtL2.mjs +26 -0
- package/dist/stream-broker/{hostInit-DUL71Vjq.mjs → hostInit-BIZvt2bk.mjs} +1 -1
- package/dist/stream-broker/index.js +35 -6
- package/dist/stream-broker/index.mjs +35 -6
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-CGWEeRkz.js → MaskShapeCanvas-DI4BY7W2-3uL2OmvC.js} +1 -1
- package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-4YbTa3Wp.js → MotionZonesSettings-NcxxQN8r-JkIkJTeI.js} +1 -1
- package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-DL_tAs9-.js → PrivacyMaskSettings-APgPLF7p-AKGABxQk.js} +1 -1
- package/embed-dist/assets/{index-CvBwcYl_.js → index-DfcKIHhA.js} +14 -14
- package/embed-dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-gchR4WlX.mjs +0 -26
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-D6vf50IK.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-CAT3VF7A.js");
|
|
7
7
|
const require_node_topology_platform = require("../node-topology-platform-CFZ7F4xW.js");
|
|
8
8
|
const require_model_download_service_Cp9f4dk6 = require("../model-download-service-Cp9f4dk6-Dv-oFwjN.js");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __require } from "../chunk-BdkLduGY.mjs";
|
|
2
|
-
import { D as mapAudioLabelToMacro, H as errMsg, J as hydrateSchema, U as BaseAddon, _ as audioAnalysisCapability, d as HF_BASE_URL, n as AUDIO_BACKEND_CHOICES, o as DEFAULT_AUDIO_ANALYZER_CONFIG, v as audioAnalyzerCapability } from "../dist-
|
|
2
|
+
import { D as mapAudioLabelToMacro, H as errMsg, J as hydrateSchema, U as BaseAddon, _ as audioAnalysisCapability, d as HF_BASE_URL, n as AUDIO_BACKEND_CHOICES, o as DEFAULT_AUDIO_ANALYZER_CONFIG, v as audioAnalyzerCapability } from "../dist-BwyGTnMu.mjs";
|
|
3
3
|
import { t as pickNodePlatformArch } from "../node-topology-platform-BkR_k6WT.mjs";
|
|
4
4
|
import { i as downloadFile } from "../model-download-service-Cp9f4dk6-CwUb5v3Y.mjs";
|
|
5
5
|
import * as fs from "node:fs";
|
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../chunk-D6vf50IK.js");
|
|
6
|
-
const require_dist = require("../dist-
|
|
7
|
-
const require_step_definitions = require("../step-definitions-
|
|
6
|
+
const require_dist = require("../dist-CAT3VF7A.js");
|
|
7
|
+
const require_step_definitions = require("../step-definitions-BPEExRug.js");
|
|
8
8
|
const require_node_topology_platform = require("../node-topology-platform-CFZ7F4xW.js");
|
|
9
9
|
const require_model_download_service_Cp9f4dk6 = require("../model-download-service-Cp9f4dk6-Dv-oFwjN.js");
|
|
10
10
|
let node_child_process = require("node:child_process");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __require } from "../chunk-BdkLduGY.mjs";
|
|
2
|
-
import { B as supportedRuntimes$1, C as detectionPipelineCapability, H as errMsg, J as hydrateSchema, L as runtimeDevices$1, M as pipelineExecutorCapability, Q as parseJsonUnknown, T as evaluateZoneRules, U as BaseAddon, dt as string, ft as union, h as YAMNET_TO_MACRO, j as nodePin, lt as object, pt as EventCategory, q as createEvent, rt as array, s as DEVICE_BACKEND_TO_FORMAT, t as APPLE_SA_TO_MACRO, tt as sleep, w as enumerateInferenceDevices, x as defaultDeviceFor$1 } from "../dist-
|
|
3
|
-
import { a as getStepDefinition, i as getStep, n as ALL_STEPS, o as resolveModelForFormat, r as getDefaultModelForFormat, t as ALL_PIPELINE_STEPS } from "../step-definitions-
|
|
2
|
+
import { B as supportedRuntimes$1, C as detectionPipelineCapability, H as errMsg, J as hydrateSchema, L as runtimeDevices$1, M as pipelineExecutorCapability, Q as parseJsonUnknown, T as evaluateZoneRules, U as BaseAddon, dt as string, ft as union, h as YAMNET_TO_MACRO, j as nodePin, lt as object, pt as EventCategory, q as createEvent, rt as array, s as DEVICE_BACKEND_TO_FORMAT, t as APPLE_SA_TO_MACRO, tt as sleep, w as enumerateInferenceDevices, x as defaultDeviceFor$1 } from "../dist-BwyGTnMu.mjs";
|
|
3
|
+
import { a as getStepDefinition, i as getStep, n as ALL_STEPS, o as resolveModelForFormat, r as getDefaultModelForFormat, t as ALL_PIPELINE_STEPS } from "../step-definitions-DN1obXS7.mjs";
|
|
4
4
|
import { t as pickNodePlatformArch } from "../node-topology-platform-BkR_k6WT.mjs";
|
|
5
5
|
import { a as ensureModel, o as isModelDownloaded, r as deleteModelFromDisk } from "../model-download-service-Cp9f4dk6-CwUb5v3Y.mjs";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -6915,7 +6915,6 @@ object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
|
6915
6915
|
patch: record(string(), unknown())
|
|
6916
6916
|
}), object({ success: literal(true) });
|
|
6917
6917
|
object({ deviceId: number() }), unknown().nullable();
|
|
6918
|
-
/** Shorthand to define a method schema */
|
|
6919
6918
|
function method(input, output, options) {
|
|
6920
6919
|
return {
|
|
6921
6920
|
input,
|
|
@@ -6923,6 +6922,7 @@ function method(input, output, options) {
|
|
|
6923
6922
|
kind: options?.kind ?? "query",
|
|
6924
6923
|
auth: options?.auth ?? "protected",
|
|
6925
6924
|
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6925
|
+
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
6926
6926
|
timeoutMs: options?.timeoutMs
|
|
6927
6927
|
};
|
|
6928
6928
|
}
|
|
@@ -17076,6 +17076,226 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
17076
17076
|
enabled: boolean()
|
|
17077
17077
|
}), _void(), { kind: "mutation" });
|
|
17078
17078
|
/**
|
|
17079
|
+
* notification-rules — the Notification Center rule surface (P1 core).
|
|
17080
|
+
*
|
|
17081
|
+
* Spec: `docs/superpowers/specs/2026-07-22-notification-center-requirements.md`
|
|
17082
|
+
* (operator decisions D-1/D-2/D-3 are binding):
|
|
17083
|
+
*
|
|
17084
|
+
* - D-2: rule EVALUATION lives in `addon-post-analysis` (the
|
|
17085
|
+
* `notification-center` module), hooked on the durable persistence
|
|
17086
|
+
* moments (object-event insert, TrackCloser.closeExpired) with a
|
|
17087
|
+
* persisted outbox + retry — never the lossy telemetry bus (D8).
|
|
17088
|
+
* - D-3: urgency belongs to the RULE. `delivery: 'immediate'` fires on the
|
|
17089
|
+
* FIRST persisted detection matching the conditions (per-track dedup,
|
|
17090
|
+
* `maxPerTrack` fixed at 1 — see {@link NC_MAX_PER_TRACK_IMMEDIATE});
|
|
17091
|
+
* `delivery: 'track-end'` evaluates the finalized track record at close.
|
|
17092
|
+
* - DISPATCH stays behind `notification-output` (rules reference targets
|
|
17093
|
+
* by id; per-backend params are a passthrough blob capped by the
|
|
17094
|
+
* target kind's own caps/degrade engine).
|
|
17095
|
+
*
|
|
17096
|
+
* P1 scope: admin-authored rules only (`createdBy` stamped from the
|
|
17097
|
+
* server-injected caller identity — the first `caller: 'required'`
|
|
17098
|
+
* adopter). The P1 condition subset is: devices, classes(+exclude),
|
|
17099
|
+
* minConfidence, admin zones (any/all + exclude), weekly schedule
|
|
17100
|
+
* windows, and the optional label/identity/plate matchers. User rules,
|
|
17101
|
+
* private zones, per-recipient fan-out and the wider condition table are
|
|
17102
|
+
* P2+ (see spec §7).
|
|
17103
|
+
*
|
|
17104
|
+
* All schemas here are the single source of truth — `NcRule` etc. are
|
|
17105
|
+
* `z.infer` exports; no duplicate interfaces (the advanced-notifier
|
|
17106
|
+
* schema/interface drift is explicitly not repeated).
|
|
17107
|
+
*/
|
|
17108
|
+
/** D-3: the urgency of a rule — which persistence moment evaluates it. */
|
|
17109
|
+
var NcDeliverySchema = _enum(["immediate", "track-end"]);
|
|
17110
|
+
/** Weekly schedule — OR of windows; absence on the rule = always active. */
|
|
17111
|
+
var NcScheduleSchema = object({
|
|
17112
|
+
windows: array(object({
|
|
17113
|
+
/** Days of week the window STARTS on (0 = Sunday … 6 = Saturday). */
|
|
17114
|
+
days: array(number().int().min(0).max(6)).min(1),
|
|
17115
|
+
startMinute: number().int().min(0).max(1439),
|
|
17116
|
+
endMinute: number().int().min(0).max(1439)
|
|
17117
|
+
})).min(1),
|
|
17118
|
+
/** IANA timezone; default = hub host timezone. */
|
|
17119
|
+
timezone: string().optional(),
|
|
17120
|
+
/** Active OUTSIDE the windows (e.g. "only outside business hours"). */
|
|
17121
|
+
invert: boolean().optional()
|
|
17122
|
+
});
|
|
17123
|
+
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
17124
|
+
var NcPlateMatcherSchema = object({
|
|
17125
|
+
values: array(string().min(1)).min(1),
|
|
17126
|
+
/** Max Levenshtein distance after normalization (uppercase alphanumeric). */
|
|
17127
|
+
maxDistance: number().int().min(0).max(3).default(1)
|
|
17128
|
+
});
|
|
17129
|
+
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
17130
|
+
var NcZoneConditionSchema = object({
|
|
17131
|
+
ids: array(string().min(1)).min(1),
|
|
17132
|
+
/** Quantifier over `ids` — at least one / every one visited. */
|
|
17133
|
+
match: _enum(["any", "all"]).default("any")
|
|
17134
|
+
});
|
|
17135
|
+
/**
|
|
17136
|
+
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
17137
|
+
* membership lists are OR within the list (spec §2.3).
|
|
17138
|
+
*/
|
|
17139
|
+
var NcConditionsSchema = object({
|
|
17140
|
+
/** Device scope — absent = all devices. */
|
|
17141
|
+
devices: array(number()).optional(),
|
|
17142
|
+
/** Detector class names (any overlap with the record's class set). */
|
|
17143
|
+
classes: array(string().min(1)).optional(),
|
|
17144
|
+
/** Veto classes — any overlap fails the rule. */
|
|
17145
|
+
classesExclude: array(string().min(1)).optional(),
|
|
17146
|
+
/** Minimum detection confidence 0–1 (fails when the record has none). */
|
|
17147
|
+
minConfidence: number().min(0).max(1).optional(),
|
|
17148
|
+
/** Admin zone membership over event `zones` / track `zonesVisited`. */
|
|
17149
|
+
zones: NcZoneConditionSchema.optional(),
|
|
17150
|
+
/** Veto zones — any hit fails the rule. */
|
|
17151
|
+
zonesExclude: array(string().min(1)).optional(),
|
|
17152
|
+
/**
|
|
17153
|
+
* Exact (case-insensitive) match on the record's collapsed `label`
|
|
17154
|
+
* (identity name / plate text / subclass).
|
|
17155
|
+
*/
|
|
17156
|
+
labelEquals: array(string().min(1)).optional(),
|
|
17157
|
+
/**
|
|
17158
|
+
* Identity matcher. P1 boundary: matched against the record's collapsed
|
|
17159
|
+
* `label` (the identity display name propagated by the face pipeline) —
|
|
17160
|
+
* identity-ID matching rides in P2 when identity ids reach the record.
|
|
17161
|
+
*/
|
|
17162
|
+
identities: array(string().min(1)).optional(),
|
|
17163
|
+
/** Fuzzy plate matcher against the record's `label` (plate text). */
|
|
17164
|
+
plates: NcPlateMatcherSchema.optional()
|
|
17165
|
+
});
|
|
17166
|
+
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
17167
|
+
var NcRuleTargetSchema = object({
|
|
17168
|
+
/** `notification-output` Target id. */
|
|
17169
|
+
targetId: string().min(1),
|
|
17170
|
+
/**
|
|
17171
|
+
* Per-backend passthrough. Recognized keys are mapped onto the canonical
|
|
17172
|
+
* Notification (`priority`, `level`, `sound`, `clickUrl`, `ttl`); the
|
|
17173
|
+
* degrade engine drops what the backend can't render.
|
|
17174
|
+
*/
|
|
17175
|
+
params: record(string(), unknown()).optional()
|
|
17176
|
+
});
|
|
17177
|
+
/**
|
|
17178
|
+
* Media attachment policy (P1 still-image subset). `best` = the best
|
|
17179
|
+
* AVAILABLE media at dispatch time (D-3); `best-matching` (track-end
|
|
17180
|
+
* condition-best) is deferred — operator open point.
|
|
17181
|
+
*/
|
|
17182
|
+
var NcMediaPolicySchema = object({ attach: _enum([
|
|
17183
|
+
"best",
|
|
17184
|
+
"keyFrame",
|
|
17185
|
+
"none"
|
|
17186
|
+
]).default("best") });
|
|
17187
|
+
/** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
|
|
17188
|
+
var NcThrottleSchema = object({
|
|
17189
|
+
cooldownSec: number().int().min(0).max(86400).default(60),
|
|
17190
|
+
/** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
|
|
17191
|
+
scope: _enum(["rule", "rule-device"]).default("rule-device")
|
|
17192
|
+
});
|
|
17193
|
+
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
17194
|
+
var NcRuleInputSchema = object({
|
|
17195
|
+
name: string().min(1).max(200),
|
|
17196
|
+
enabled: boolean().default(true),
|
|
17197
|
+
delivery: NcDeliverySchema,
|
|
17198
|
+
conditions: NcConditionsSchema.default({}),
|
|
17199
|
+
schedule: NcScheduleSchema.optional(),
|
|
17200
|
+
targets: array(NcRuleTargetSchema).min(1),
|
|
17201
|
+
media: NcMediaPolicySchema.default({ attach: "best" }),
|
|
17202
|
+
throttle: NcThrottleSchema.default({
|
|
17203
|
+
cooldownSec: 60,
|
|
17204
|
+
scope: "rule-device"
|
|
17205
|
+
}),
|
|
17206
|
+
/** `{{var}}` templating over camera/class/label/zones/confidence/time. */
|
|
17207
|
+
template: object({
|
|
17208
|
+
title: string().max(500).optional(),
|
|
17209
|
+
body: string().max(2e3).optional()
|
|
17210
|
+
}).optional(),
|
|
17211
|
+
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
17212
|
+
priority: number().int().min(1).max(5).default(3)
|
|
17213
|
+
});
|
|
17214
|
+
/** Partial patch for `updateRule` — any subset of the input fields. */
|
|
17215
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial();
|
|
17216
|
+
/** A persisted rule. */
|
|
17217
|
+
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
17218
|
+
id: string(),
|
|
17219
|
+
/** userId of the admin who created the rule (server-stamped caller). */
|
|
17220
|
+
createdBy: string(),
|
|
17221
|
+
createdAt: number(),
|
|
17222
|
+
updatedAt: number()
|
|
17223
|
+
});
|
|
17224
|
+
var NcTestResultSchema = object({
|
|
17225
|
+
recordId: string(),
|
|
17226
|
+
recordKind: _enum(["object-event", "track"]),
|
|
17227
|
+
deviceId: number(),
|
|
17228
|
+
timestamp: number(),
|
|
17229
|
+
wouldFire: boolean(),
|
|
17230
|
+
/** Condition id that failed (first failing group), when `wouldFire` is false. */
|
|
17231
|
+
failedCondition: string().optional(),
|
|
17232
|
+
className: string().optional(),
|
|
17233
|
+
label: string().optional()
|
|
17234
|
+
});
|
|
17235
|
+
var NcConditionDescriptorSchema = object({
|
|
17236
|
+
/** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
|
|
17237
|
+
id: string(),
|
|
17238
|
+
group: _enum([
|
|
17239
|
+
"scope",
|
|
17240
|
+
"class",
|
|
17241
|
+
"zones",
|
|
17242
|
+
"quality",
|
|
17243
|
+
"label",
|
|
17244
|
+
"schedule"
|
|
17245
|
+
]),
|
|
17246
|
+
label: string(),
|
|
17247
|
+
/** Editor widget the UI renders — never hardcode per-condition forms. */
|
|
17248
|
+
valueType: _enum([
|
|
17249
|
+
"deviceIdList",
|
|
17250
|
+
"stringList",
|
|
17251
|
+
"number01",
|
|
17252
|
+
"zoneSelection",
|
|
17253
|
+
"zoneIdList",
|
|
17254
|
+
"schedule",
|
|
17255
|
+
"plateMatcher"
|
|
17256
|
+
]),
|
|
17257
|
+
operator: _enum([
|
|
17258
|
+
"in",
|
|
17259
|
+
"notIn",
|
|
17260
|
+
"anyOf",
|
|
17261
|
+
"allOf",
|
|
17262
|
+
"gte",
|
|
17263
|
+
"fuzzyIn",
|
|
17264
|
+
"withinSchedule"
|
|
17265
|
+
]),
|
|
17266
|
+
/** Which delivery kinds the condition applies to. */
|
|
17267
|
+
appliesTo: array(NcDeliverySchema),
|
|
17268
|
+
phase: string(),
|
|
17269
|
+
description: string().optional()
|
|
17270
|
+
});
|
|
17271
|
+
method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
|
|
17272
|
+
kind: "mutation",
|
|
17273
|
+
auth: "admin",
|
|
17274
|
+
caller: "required"
|
|
17275
|
+
}), method(object({
|
|
17276
|
+
ruleId: string(),
|
|
17277
|
+
patch: NcRulePatchSchema
|
|
17278
|
+
}), object({ rule: NcRuleSchema }), {
|
|
17279
|
+
kind: "mutation",
|
|
17280
|
+
auth: "admin",
|
|
17281
|
+
caller: "required"
|
|
17282
|
+
}), method(object({ ruleId: string() }), object({ success: literal(true) }), {
|
|
17283
|
+
kind: "mutation",
|
|
17284
|
+
auth: "admin"
|
|
17285
|
+
}), method(object({
|
|
17286
|
+
ruleId: string(),
|
|
17287
|
+
enabled: boolean()
|
|
17288
|
+
}), object({ success: literal(true) }), {
|
|
17289
|
+
kind: "mutation",
|
|
17290
|
+
auth: "admin"
|
|
17291
|
+
}), method(object({
|
|
17292
|
+
rule: NcRuleInputSchema,
|
|
17293
|
+
lookbackMinutes: number().int().min(1).max(1440).default(60)
|
|
17294
|
+
}), object({ results: array(NcTestResultSchema) }), {
|
|
17295
|
+
kind: "mutation",
|
|
17296
|
+
auth: "admin"
|
|
17297
|
+
}), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) }));
|
|
17298
|
+
/**
|
|
17079
17299
|
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
17080
17300
|
* surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
|
|
17081
17301
|
* caps stay wire-compatible without a circular cap→cap import.
|
|
@@ -24620,6 +24840,54 @@ Object.freeze({
|
|
|
24620
24840
|
addonId: null,
|
|
24621
24841
|
access: "create"
|
|
24622
24842
|
},
|
|
24843
|
+
"notificationRules.createRule": {
|
|
24844
|
+
capName: "notification-rules",
|
|
24845
|
+
capScope: "system",
|
|
24846
|
+
addonId: null,
|
|
24847
|
+
access: "create"
|
|
24848
|
+
},
|
|
24849
|
+
"notificationRules.deleteRule": {
|
|
24850
|
+
capName: "notification-rules",
|
|
24851
|
+
capScope: "system",
|
|
24852
|
+
addonId: null,
|
|
24853
|
+
access: "delete"
|
|
24854
|
+
},
|
|
24855
|
+
"notificationRules.getConditionCatalog": {
|
|
24856
|
+
capName: "notification-rules",
|
|
24857
|
+
capScope: "system",
|
|
24858
|
+
addonId: null,
|
|
24859
|
+
access: "view"
|
|
24860
|
+
},
|
|
24861
|
+
"notificationRules.getRule": {
|
|
24862
|
+
capName: "notification-rules",
|
|
24863
|
+
capScope: "system",
|
|
24864
|
+
addonId: null,
|
|
24865
|
+
access: "view"
|
|
24866
|
+
},
|
|
24867
|
+
"notificationRules.listRules": {
|
|
24868
|
+
capName: "notification-rules",
|
|
24869
|
+
capScope: "system",
|
|
24870
|
+
addonId: null,
|
|
24871
|
+
access: "view"
|
|
24872
|
+
},
|
|
24873
|
+
"notificationRules.setRuleEnabled": {
|
|
24874
|
+
capName: "notification-rules",
|
|
24875
|
+
capScope: "system",
|
|
24876
|
+
addonId: null,
|
|
24877
|
+
access: "create"
|
|
24878
|
+
},
|
|
24879
|
+
"notificationRules.testRule": {
|
|
24880
|
+
capName: "notification-rules",
|
|
24881
|
+
capScope: "system",
|
|
24882
|
+
addonId: null,
|
|
24883
|
+
access: "create"
|
|
24884
|
+
},
|
|
24885
|
+
"notificationRules.updateRule": {
|
|
24886
|
+
capName: "notification-rules",
|
|
24887
|
+
capScope: "system",
|
|
24888
|
+
addonId: null,
|
|
24889
|
+
access: "create"
|
|
24890
|
+
},
|
|
24623
24891
|
"notifier.cancel": {
|
|
24624
24892
|
capName: "notifier",
|
|
24625
24893
|
capScope: "device",
|
|
@@ -6915,7 +6915,6 @@ object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
|
6915
6915
|
patch: record(string(), unknown())
|
|
6916
6916
|
}), object({ success: literal(true) });
|
|
6917
6917
|
object({ deviceId: number() }), unknown().nullable();
|
|
6918
|
-
/** Shorthand to define a method schema */
|
|
6919
6918
|
function method(input, output, options) {
|
|
6920
6919
|
return {
|
|
6921
6920
|
input,
|
|
@@ -6923,6 +6922,7 @@ function method(input, output, options) {
|
|
|
6923
6922
|
kind: options?.kind ?? "query",
|
|
6924
6923
|
auth: options?.auth ?? "protected",
|
|
6925
6924
|
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6925
|
+
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
6926
6926
|
timeoutMs: options?.timeoutMs
|
|
6927
6927
|
};
|
|
6928
6928
|
}
|
|
@@ -17076,6 +17076,226 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
17076
17076
|
enabled: boolean()
|
|
17077
17077
|
}), _void(), { kind: "mutation" });
|
|
17078
17078
|
/**
|
|
17079
|
+
* notification-rules — the Notification Center rule surface (P1 core).
|
|
17080
|
+
*
|
|
17081
|
+
* Spec: `docs/superpowers/specs/2026-07-22-notification-center-requirements.md`
|
|
17082
|
+
* (operator decisions D-1/D-2/D-3 are binding):
|
|
17083
|
+
*
|
|
17084
|
+
* - D-2: rule EVALUATION lives in `addon-post-analysis` (the
|
|
17085
|
+
* `notification-center` module), hooked on the durable persistence
|
|
17086
|
+
* moments (object-event insert, TrackCloser.closeExpired) with a
|
|
17087
|
+
* persisted outbox + retry — never the lossy telemetry bus (D8).
|
|
17088
|
+
* - D-3: urgency belongs to the RULE. `delivery: 'immediate'` fires on the
|
|
17089
|
+
* FIRST persisted detection matching the conditions (per-track dedup,
|
|
17090
|
+
* `maxPerTrack` fixed at 1 — see {@link NC_MAX_PER_TRACK_IMMEDIATE});
|
|
17091
|
+
* `delivery: 'track-end'` evaluates the finalized track record at close.
|
|
17092
|
+
* - DISPATCH stays behind `notification-output` (rules reference targets
|
|
17093
|
+
* by id; per-backend params are a passthrough blob capped by the
|
|
17094
|
+
* target kind's own caps/degrade engine).
|
|
17095
|
+
*
|
|
17096
|
+
* P1 scope: admin-authored rules only (`createdBy` stamped from the
|
|
17097
|
+
* server-injected caller identity — the first `caller: 'required'`
|
|
17098
|
+
* adopter). The P1 condition subset is: devices, classes(+exclude),
|
|
17099
|
+
* minConfidence, admin zones (any/all + exclude), weekly schedule
|
|
17100
|
+
* windows, and the optional label/identity/plate matchers. User rules,
|
|
17101
|
+
* private zones, per-recipient fan-out and the wider condition table are
|
|
17102
|
+
* P2+ (see spec §7).
|
|
17103
|
+
*
|
|
17104
|
+
* All schemas here are the single source of truth — `NcRule` etc. are
|
|
17105
|
+
* `z.infer` exports; no duplicate interfaces (the advanced-notifier
|
|
17106
|
+
* schema/interface drift is explicitly not repeated).
|
|
17107
|
+
*/
|
|
17108
|
+
/** D-3: the urgency of a rule — which persistence moment evaluates it. */
|
|
17109
|
+
var NcDeliverySchema = _enum(["immediate", "track-end"]);
|
|
17110
|
+
/** Weekly schedule — OR of windows; absence on the rule = always active. */
|
|
17111
|
+
var NcScheduleSchema = object({
|
|
17112
|
+
windows: array(object({
|
|
17113
|
+
/** Days of week the window STARTS on (0 = Sunday … 6 = Saturday). */
|
|
17114
|
+
days: array(number().int().min(0).max(6)).min(1),
|
|
17115
|
+
startMinute: number().int().min(0).max(1439),
|
|
17116
|
+
endMinute: number().int().min(0).max(1439)
|
|
17117
|
+
})).min(1),
|
|
17118
|
+
/** IANA timezone; default = hub host timezone. */
|
|
17119
|
+
timezone: string().optional(),
|
|
17120
|
+
/** Active OUTSIDE the windows (e.g. "only outside business hours"). */
|
|
17121
|
+
invert: boolean().optional()
|
|
17122
|
+
});
|
|
17123
|
+
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
17124
|
+
var NcPlateMatcherSchema = object({
|
|
17125
|
+
values: array(string().min(1)).min(1),
|
|
17126
|
+
/** Max Levenshtein distance after normalization (uppercase alphanumeric). */
|
|
17127
|
+
maxDistance: number().int().min(0).max(3).default(1)
|
|
17128
|
+
});
|
|
17129
|
+
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
17130
|
+
var NcZoneConditionSchema = object({
|
|
17131
|
+
ids: array(string().min(1)).min(1),
|
|
17132
|
+
/** Quantifier over `ids` — at least one / every one visited. */
|
|
17133
|
+
match: _enum(["any", "all"]).default("any")
|
|
17134
|
+
});
|
|
17135
|
+
/**
|
|
17136
|
+
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
17137
|
+
* membership lists are OR within the list (spec §2.3).
|
|
17138
|
+
*/
|
|
17139
|
+
var NcConditionsSchema = object({
|
|
17140
|
+
/** Device scope — absent = all devices. */
|
|
17141
|
+
devices: array(number()).optional(),
|
|
17142
|
+
/** Detector class names (any overlap with the record's class set). */
|
|
17143
|
+
classes: array(string().min(1)).optional(),
|
|
17144
|
+
/** Veto classes — any overlap fails the rule. */
|
|
17145
|
+
classesExclude: array(string().min(1)).optional(),
|
|
17146
|
+
/** Minimum detection confidence 0–1 (fails when the record has none). */
|
|
17147
|
+
minConfidence: number().min(0).max(1).optional(),
|
|
17148
|
+
/** Admin zone membership over event `zones` / track `zonesVisited`. */
|
|
17149
|
+
zones: NcZoneConditionSchema.optional(),
|
|
17150
|
+
/** Veto zones — any hit fails the rule. */
|
|
17151
|
+
zonesExclude: array(string().min(1)).optional(),
|
|
17152
|
+
/**
|
|
17153
|
+
* Exact (case-insensitive) match on the record's collapsed `label`
|
|
17154
|
+
* (identity name / plate text / subclass).
|
|
17155
|
+
*/
|
|
17156
|
+
labelEquals: array(string().min(1)).optional(),
|
|
17157
|
+
/**
|
|
17158
|
+
* Identity matcher. P1 boundary: matched against the record's collapsed
|
|
17159
|
+
* `label` (the identity display name propagated by the face pipeline) —
|
|
17160
|
+
* identity-ID matching rides in P2 when identity ids reach the record.
|
|
17161
|
+
*/
|
|
17162
|
+
identities: array(string().min(1)).optional(),
|
|
17163
|
+
/** Fuzzy plate matcher against the record's `label` (plate text). */
|
|
17164
|
+
plates: NcPlateMatcherSchema.optional()
|
|
17165
|
+
});
|
|
17166
|
+
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
17167
|
+
var NcRuleTargetSchema = object({
|
|
17168
|
+
/** `notification-output` Target id. */
|
|
17169
|
+
targetId: string().min(1),
|
|
17170
|
+
/**
|
|
17171
|
+
* Per-backend passthrough. Recognized keys are mapped onto the canonical
|
|
17172
|
+
* Notification (`priority`, `level`, `sound`, `clickUrl`, `ttl`); the
|
|
17173
|
+
* degrade engine drops what the backend can't render.
|
|
17174
|
+
*/
|
|
17175
|
+
params: record(string(), unknown()).optional()
|
|
17176
|
+
});
|
|
17177
|
+
/**
|
|
17178
|
+
* Media attachment policy (P1 still-image subset). `best` = the best
|
|
17179
|
+
* AVAILABLE media at dispatch time (D-3); `best-matching` (track-end
|
|
17180
|
+
* condition-best) is deferred — operator open point.
|
|
17181
|
+
*/
|
|
17182
|
+
var NcMediaPolicySchema = object({ attach: _enum([
|
|
17183
|
+
"best",
|
|
17184
|
+
"keyFrame",
|
|
17185
|
+
"none"
|
|
17186
|
+
]).default("best") });
|
|
17187
|
+
/** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
|
|
17188
|
+
var NcThrottleSchema = object({
|
|
17189
|
+
cooldownSec: number().int().min(0).max(86400).default(60),
|
|
17190
|
+
/** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
|
|
17191
|
+
scope: _enum(["rule", "rule-device"]).default("rule-device")
|
|
17192
|
+
});
|
|
17193
|
+
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
17194
|
+
var NcRuleInputSchema = object({
|
|
17195
|
+
name: string().min(1).max(200),
|
|
17196
|
+
enabled: boolean().default(true),
|
|
17197
|
+
delivery: NcDeliverySchema,
|
|
17198
|
+
conditions: NcConditionsSchema.default({}),
|
|
17199
|
+
schedule: NcScheduleSchema.optional(),
|
|
17200
|
+
targets: array(NcRuleTargetSchema).min(1),
|
|
17201
|
+
media: NcMediaPolicySchema.default({ attach: "best" }),
|
|
17202
|
+
throttle: NcThrottleSchema.default({
|
|
17203
|
+
cooldownSec: 60,
|
|
17204
|
+
scope: "rule-device"
|
|
17205
|
+
}),
|
|
17206
|
+
/** `{{var}}` templating over camera/class/label/zones/confidence/time. */
|
|
17207
|
+
template: object({
|
|
17208
|
+
title: string().max(500).optional(),
|
|
17209
|
+
body: string().max(2e3).optional()
|
|
17210
|
+
}).optional(),
|
|
17211
|
+
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
17212
|
+
priority: number().int().min(1).max(5).default(3)
|
|
17213
|
+
});
|
|
17214
|
+
/** Partial patch for `updateRule` — any subset of the input fields. */
|
|
17215
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial();
|
|
17216
|
+
/** A persisted rule. */
|
|
17217
|
+
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
17218
|
+
id: string(),
|
|
17219
|
+
/** userId of the admin who created the rule (server-stamped caller). */
|
|
17220
|
+
createdBy: string(),
|
|
17221
|
+
createdAt: number(),
|
|
17222
|
+
updatedAt: number()
|
|
17223
|
+
});
|
|
17224
|
+
var NcTestResultSchema = object({
|
|
17225
|
+
recordId: string(),
|
|
17226
|
+
recordKind: _enum(["object-event", "track"]),
|
|
17227
|
+
deviceId: number(),
|
|
17228
|
+
timestamp: number(),
|
|
17229
|
+
wouldFire: boolean(),
|
|
17230
|
+
/** Condition id that failed (first failing group), when `wouldFire` is false. */
|
|
17231
|
+
failedCondition: string().optional(),
|
|
17232
|
+
className: string().optional(),
|
|
17233
|
+
label: string().optional()
|
|
17234
|
+
});
|
|
17235
|
+
var NcConditionDescriptorSchema = object({
|
|
17236
|
+
/** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
|
|
17237
|
+
id: string(),
|
|
17238
|
+
group: _enum([
|
|
17239
|
+
"scope",
|
|
17240
|
+
"class",
|
|
17241
|
+
"zones",
|
|
17242
|
+
"quality",
|
|
17243
|
+
"label",
|
|
17244
|
+
"schedule"
|
|
17245
|
+
]),
|
|
17246
|
+
label: string(),
|
|
17247
|
+
/** Editor widget the UI renders — never hardcode per-condition forms. */
|
|
17248
|
+
valueType: _enum([
|
|
17249
|
+
"deviceIdList",
|
|
17250
|
+
"stringList",
|
|
17251
|
+
"number01",
|
|
17252
|
+
"zoneSelection",
|
|
17253
|
+
"zoneIdList",
|
|
17254
|
+
"schedule",
|
|
17255
|
+
"plateMatcher"
|
|
17256
|
+
]),
|
|
17257
|
+
operator: _enum([
|
|
17258
|
+
"in",
|
|
17259
|
+
"notIn",
|
|
17260
|
+
"anyOf",
|
|
17261
|
+
"allOf",
|
|
17262
|
+
"gte",
|
|
17263
|
+
"fuzzyIn",
|
|
17264
|
+
"withinSchedule"
|
|
17265
|
+
]),
|
|
17266
|
+
/** Which delivery kinds the condition applies to. */
|
|
17267
|
+
appliesTo: array(NcDeliverySchema),
|
|
17268
|
+
phase: string(),
|
|
17269
|
+
description: string().optional()
|
|
17270
|
+
});
|
|
17271
|
+
method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
|
|
17272
|
+
kind: "mutation",
|
|
17273
|
+
auth: "admin",
|
|
17274
|
+
caller: "required"
|
|
17275
|
+
}), method(object({
|
|
17276
|
+
ruleId: string(),
|
|
17277
|
+
patch: NcRulePatchSchema
|
|
17278
|
+
}), object({ rule: NcRuleSchema }), {
|
|
17279
|
+
kind: "mutation",
|
|
17280
|
+
auth: "admin",
|
|
17281
|
+
caller: "required"
|
|
17282
|
+
}), method(object({ ruleId: string() }), object({ success: literal(true) }), {
|
|
17283
|
+
kind: "mutation",
|
|
17284
|
+
auth: "admin"
|
|
17285
|
+
}), method(object({
|
|
17286
|
+
ruleId: string(),
|
|
17287
|
+
enabled: boolean()
|
|
17288
|
+
}), object({ success: literal(true) }), {
|
|
17289
|
+
kind: "mutation",
|
|
17290
|
+
auth: "admin"
|
|
17291
|
+
}), method(object({
|
|
17292
|
+
rule: NcRuleInputSchema,
|
|
17293
|
+
lookbackMinutes: number().int().min(1).max(1440).default(60)
|
|
17294
|
+
}), object({ results: array(NcTestResultSchema) }), {
|
|
17295
|
+
kind: "mutation",
|
|
17296
|
+
auth: "admin"
|
|
17297
|
+
}), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) }));
|
|
17298
|
+
/**
|
|
17079
17299
|
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
17080
17300
|
* surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
|
|
17081
17301
|
* caps stay wire-compatible without a circular cap→cap import.
|
|
@@ -24620,6 +24840,54 @@ Object.freeze({
|
|
|
24620
24840
|
addonId: null,
|
|
24621
24841
|
access: "create"
|
|
24622
24842
|
},
|
|
24843
|
+
"notificationRules.createRule": {
|
|
24844
|
+
capName: "notification-rules",
|
|
24845
|
+
capScope: "system",
|
|
24846
|
+
addonId: null,
|
|
24847
|
+
access: "create"
|
|
24848
|
+
},
|
|
24849
|
+
"notificationRules.deleteRule": {
|
|
24850
|
+
capName: "notification-rules",
|
|
24851
|
+
capScope: "system",
|
|
24852
|
+
addonId: null,
|
|
24853
|
+
access: "delete"
|
|
24854
|
+
},
|
|
24855
|
+
"notificationRules.getConditionCatalog": {
|
|
24856
|
+
capName: "notification-rules",
|
|
24857
|
+
capScope: "system",
|
|
24858
|
+
addonId: null,
|
|
24859
|
+
access: "view"
|
|
24860
|
+
},
|
|
24861
|
+
"notificationRules.getRule": {
|
|
24862
|
+
capName: "notification-rules",
|
|
24863
|
+
capScope: "system",
|
|
24864
|
+
addonId: null,
|
|
24865
|
+
access: "view"
|
|
24866
|
+
},
|
|
24867
|
+
"notificationRules.listRules": {
|
|
24868
|
+
capName: "notification-rules",
|
|
24869
|
+
capScope: "system",
|
|
24870
|
+
addonId: null,
|
|
24871
|
+
access: "view"
|
|
24872
|
+
},
|
|
24873
|
+
"notificationRules.setRuleEnabled": {
|
|
24874
|
+
capName: "notification-rules",
|
|
24875
|
+
capScope: "system",
|
|
24876
|
+
addonId: null,
|
|
24877
|
+
access: "create"
|
|
24878
|
+
},
|
|
24879
|
+
"notificationRules.testRule": {
|
|
24880
|
+
capName: "notification-rules",
|
|
24881
|
+
capScope: "system",
|
|
24882
|
+
addonId: null,
|
|
24883
|
+
access: "create"
|
|
24884
|
+
},
|
|
24885
|
+
"notificationRules.updateRule": {
|
|
24886
|
+
capName: "notification-rules",
|
|
24887
|
+
capScope: "system",
|
|
24888
|
+
addonId: null,
|
|
24889
|
+
access: "create"
|
|
24890
|
+
},
|
|
24623
24891
|
"notifier.cancel": {
|
|
24624
24892
|
capName: "notifier",
|
|
24625
24893
|
capScope: "device",
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
5
|
+
const require_dist = require("../dist-CAT3VF7A.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
//#region src/motion-wasm/wasm-motion-detector.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as motionDetectionCapability, J as hydrateSchema, K as DeviceType, T as evaluateZoneRules, U as BaseAddon } from "../dist-
|
|
1
|
+
import { A as motionDetectionCapability, J as hydrateSchema, K as DeviceType, T as evaluateZoneRules, U as BaseAddon } from "../dist-BwyGTnMu.mjs";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region src/motion-wasm/wasm-motion-detector.ts
|