@camstack/addon-pipeline 1.2.5 → 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.
Files changed (32) hide show
  1. package/dist/audio-analyzer/index.js +1 -1
  2. package/dist/audio-analyzer/index.mjs +1 -1
  3. package/dist/detection-pipeline/index.js +499 -30
  4. package/dist/detection-pipeline/index.mjs +493 -24
  5. package/dist/{dist-ZB-B8UrH.mjs → dist-BwyGTnMu.mjs} +306 -3
  6. package/dist/{dist-CtQsET1Q.js → dist-CAT3VF7A.js} +306 -3
  7. package/dist/motion-wasm/index.js +1 -1
  8. package/dist/motion-wasm/index.mjs +1 -1
  9. package/dist/pipeline-runner/index.js +30 -15
  10. package/dist/pipeline-runner/index.mjs +30 -15
  11. package/dist/recorder/index.js +1 -1
  12. package/dist/recorder/index.mjs +1 -1
  13. package/dist/{step-definitions-DrRnEQPM.js → step-definitions-BPEExRug.js} +70 -2
  14. package/dist/{step-definitions-BKJI5CXI.mjs → step-definitions-DN1obXS7.mjs} +70 -2
  15. package/dist/stream-broker/_stub.js +1 -1
  16. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DPvS4Ex7.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BtN6sZcL.mjs} +1 -1
  17. 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
  18. package/dist/stream-broker/{hostInit-CG0IeE_e.mjs → hostInit-BIZvt2bk.mjs} +1 -1
  19. package/dist/stream-broker/index.js +35 -6
  20. package/dist/stream-broker/index.mjs +35 -6
  21. package/dist/stream-broker/remoteEntry.js +1 -1
  22. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-C-rkQ2rg.js → MaskShapeCanvas-DI4BY7W2-3uL2OmvC.js} +1 -1
  23. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-BtbCLveu.js → MotionZonesSettings-NcxxQN8r-JkIkJTeI.js} +1 -1
  24. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-C9CEgSlA.js → PrivacyMaskSettings-APgPLF7p-AKGABxQk.js} +1 -1
  25. package/embed-dist/assets/{index-CgJ1frQY.js → index-DfcKIHhA.js} +14 -14
  26. package/embed-dist/index.html +1 -1
  27. package/package.json +1 -1
  28. package/python/postprocessors/ctc.py +228 -4
  29. package/python/postprocessors/test_ctc.py +312 -0
  30. package/python/postprocessors/testdata/ctc_degenerate_lowres_logits.npy.gz.b64 +1 -0
  31. package/python/postprocessors/testdata/ctc_dwro309_logits.npy.gz.b64 +1 -0
  32. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CQC_f4Yv.mjs +0 -26
@@ -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
  }
@@ -11731,6 +11731,22 @@ var CameraMetricsSchema = object({
11731
11731
  ])
11732
11732
  });
11733
11733
  var CameraMetricsWithDeviceIdSchema = CameraMetricsSchema.extend({ deviceId: number() });
11734
+ /**
11735
+ * Reference to the frame's retained NATIVE surface + the parent crop's placement
11736
+ * within the frame, so the executor can re-cut a leaf child ROI at native
11737
+ * resolution on the detail plane. See the `runPipeline` `nativeCropRef` field.
11738
+ */
11739
+ var NativeCropRefSchema = object({
11740
+ /** Handle keying the retained native surface (node-pinned to its owner). */
11741
+ handle: FrameHandleSchema,
11742
+ /** The parent crop's padded/clamped rectangle in FRAME-space pixels. */
11743
+ cropFrameSpace: object({
11744
+ x: number(),
11745
+ y: number(),
11746
+ w: number(),
11747
+ h: number()
11748
+ })
11749
+ });
11734
11750
  var ModelFormatSchema$1 = _enum([
11735
11751
  "onnx",
11736
11752
  "coreml",
@@ -12104,7 +12120,22 @@ var pipelineExecutorCapability = {
12104
12120
  * Omitted ⇒ the runner's default device (current single-engine
12105
12121
  * behaviour). Selects WHICH device pool of the node runs the call.
12106
12122
  */
12107
- deviceKey: string().optional()
12123
+ deviceKey: string().optional(),
12124
+ /**
12125
+ * Two-plane NATIVE child-crop reference. Set by `runDetailSubtree` ONLY
12126
+ * when the parent crop was resolved from the frame's retained NATIVE
12127
+ * surface (a frameHandle HIT). Lets the executor re-cut a LEAF crop
12128
+ * child's ROI (plate-ocr, face-embedding, leaf classifiers) at native
12129
+ * resolution from that surface — the SAME quality path faces already
12130
+ * had — instead of the downscaled parent tile. `handle` keys the native
12131
+ * surface (node-pinned to its owner); `cropFrameSpace` is the parent
12132
+ * crop's padded/clamped rectangle in FRAME-space pixels, used to compose
12133
+ * the executor's crop-normalized child ROI back into frame-normalized
12134
+ * coordinates. Auxiliary to the image source (`image`/`frame`/…), NOT one
12135
+ * of the mutually-exclusive image inputs. Absent ⇒ tile-crop children
12136
+ * (today's behaviour on the fallback path).
12137
+ */
12138
+ nativeCropRef: NativeCropRefSchema.optional()
12108
12139
  }), PipelineRunResultBridge, { kind: "mutation" }),
12109
12140
  /**
12110
12141
  * Batched run — N raw frames packed into one cap call. The provider
@@ -12374,7 +12405,11 @@ var DetailResultSchema = object({
12374
12405
  bbox: NativeCropBboxSchema.optional(),
12375
12406
  embedding: string().optional(),
12376
12407
  label: string().optional(),
12377
- alignedCropJpeg: string().optional()
12408
+ alignedCropJpeg: string().optional(),
12409
+ /** Face short side (px) measured on the NATIVE crop surface. The `bbox`
12410
+ * above is detection-frame px (≈6× smaller on a 4K camera) — min-face-size
12411
+ * consumers MUST prefer this when present (2026-07-22 native-gate fix). */
12412
+ nativeFaceShortSidePx: number().optional()
12378
12413
  });
12379
12414
  /**
12380
12415
  * Per-camera tunable ranges + defaults. Single source of truth used
@@ -17041,6 +17076,226 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
17041
17076
  enabled: boolean()
17042
17077
  }), _void(), { kind: "mutation" });
17043
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
+ /**
17044
17299
  * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
17045
17300
  * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
17046
17301
  * caps stay wire-compatible without a circular cap→cap import.
@@ -24585,6 +24840,54 @@ Object.freeze({
24585
24840
  addonId: null,
24586
24841
  access: "create"
24587
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
+ },
24588
24891
  "notifier.cancel": {
24589
24892
  capName: "notifier",
24590
24893
  capScope: "device",