@camstack/addon-post-analysis 1.2.659 → 1.2.661

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 (15) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{clip-model-registry-BtzUYE5M.mjs → clip-model-registry-CVajwmEk.mjs} +174 -11
  3. package/dist/{clip-model-registry-MIf9O34C.js → clip-model-registry-RvEPUqvS.js} +179 -10
  4. package/dist/embedding-encoder/index.js +1 -1
  5. package/dist/embedding-encoder/index.mjs +1 -1
  6. package/dist/pipeline-analytics/_stub.js +2 -2
  7. package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-C4XD7qn7.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-CwKrui6c.mjs} +2 -2
  8. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BDKliSzv.mjs +26 -0
  9. package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BwWOFFOc.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BGdtpHOa.mjs} +1 -1
  10. package/dist/pipeline-analytics/{hostInit-CyiqXj1W.mjs → hostInit-DR75U6YM.mjs} +2 -2
  11. package/dist/pipeline-analytics/index.js +330 -168
  12. package/dist/pipeline-analytics/index.mjs +330 -168
  13. package/dist/pipeline-analytics/remoteEntry.js +1 -1
  14. package/package.json +2 -2
  15. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Dfps3D5t.mjs +0 -26
@@ -1,4 +1,4 @@
1
- import { $ as MAX_TRACK_RELATIONS, $i as DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, $n as bundledCamstack, $r as normalizeNcAction, $t as NcTemplateVarDescriptorSchema, A as DETECTION_MACRO_CLASSES, Aa as string, Ai as sceneMonitorCapability, An as TrackPuritySchema, Ar as isAlertEpisodeOpen, At as NcAlarmConfigSchema, B as EXPORT_DENSE_MAX_RANGES, Bi as sunTimes, Bn as alertEpisodeKind, Br as isLabelSupplyStepId, Bt as NcRuleSchema, C as COCO_TO_MACRO, Ca as literal, Ci as retrainRevisionConflictMessage, Cn as SetTrackRelationInputSchema, Cr as eventKindLabel, Ct as NC_GROUPING_MIN_SEC, D as DEFAULT_DETAIL_CROP_CONVENTION, Da as partialRecord, Di as ruleDeviceCompatCapQueries, Dn as TimelapseRulePatchSchema, Dr as gifDeriveSpeed, Dt as NC_SYSTEM_EVENT_KIND_GROUP_SPECS, E as CoverStateSchema, Ea as object, Ei as ruleBelongsToAlarm$1, En as TimelapseRuleInputSchema, Er as failureContributionCapability, Et as NC_STATE_SUMMARY_SECTION_IDS, F as EMBEDDING_REQUIREMENTS_FAILED, Fa as DeviceType, Fi as storageOccupancyCapability, Fn as activateAlarmProfile, Fr as isDetectionMacroClass, Ft as NcConditionDescriptorSchema, G as LabelAttributionSchema, Gi as systemEventSummaryScheduleOf, Gn as applySecureOnArmEdit, Gr as isSystemDelivery, Gt as NcSnoozeInputSchema, H as FULL_IMAGE_BBOX, Hi as systemEventDeliveryProblems, Hn as applyBlockingEdit, Hr as isRetiredClearKey, Ht as NcRuleUpdateInputSchema, I as EMBEDDING_REQUIREMENTS_UNAVAILABLE, Ia as errMsg, Ii as subKindsOf, In as addonWidgetsSourceCapability, Ir as isDrawableSubjectPath, It as NcConditionsSchema, J as LockStateSchema, Ji as templateVarsFor, Jn as audioMetricsCapability, Jr as kebabToCamel, Jt as NcStateSummarySectionIdSchema, K as ListTrackRelationsInputSchema, Ki as systemEventSummarySplitOf, Kn as armRemovalReconcile, Kr as isSystemEventSummaryRule, Kt as NcSnoozeSchema, L as EVENT_DENSITY_BATCH_MAX, La as EventCategory, Li as subjectPathSampleFromBox, Ln as alarmDeviceSecureOnArm, Lr as isEventKindLabelKey, Lt as NcRuleActionSchema, M as DeclaredDevices, Ma as tuple, Mi as sensorRaisedOf, Mn as TrackRelationSchema, Mr as isAppLinkBase, Mt as NcAlarmSensorsInputSchema, N as DetectionSourceSchema, Na as union, Ni as servedTemplateVars, Nn as TrackSideSchema, Nr as isAudioClassName, Nt as NcAlarmSensorsSchema, O as DEFAULT_EVENT_COLOR, Oa as record, Oi as ruleGroupingApplies, On as TimelapseRuleSchema, Or as gifFromMp4Args, Ot as NC_TAXONOMY, P as EMBEDDING_MODEL_FAILED, Pa as unknown, Pi as startMoverUnderClearance, Pn as TrackSourceSchema, Pr as isDefaultAlarmProfileId, Pt as NcAlarmSettingsPatchSchema, Q as MAX_TRACK_PURITIES, Qi as zoneAnalyticsCapability, Qn as buildViewerLink, Qr as ncMediaPolicyError, Qt as NcTemplatePreviewSchema, R as EVENT_KIND_BY_CAP, Ri as subjectPathSvgPoints, Rn as alarmPanelCapability, Rr as isEventOwnerType, Rt as NcRuleInputSchema, S as BucketAccumulator, Sa as discriminatedUnion, Sn as SetTrackPurityResultSchema, Sr as ensureAlarmProfiles, St as NC_GROUPING_MAX_SEC, T as ClearTrackRelationResultSchema, Ta as number, Ti as ruleAutoTriggersAlarm, Tn as TRACK_RELATIONS_DEFAULT_LIMIT, Tr as faceGalleryCapability, Tt as NC_SNOOZE_MAX_MINUTES, U as FailureCounters, Ui as systemEventFamilyProblems, Un as applyModeDelaysEdits, Ur as isRootSuppliableStepId, Ut as NcScheduleSchema, V as FIRST_LEVEL_MACRO_CLASSES, Vi as syncActiveAlarmProfileSettings, Vn as alertEpisodePayload, Vr as isMediaOwnerType, Vt as NcRuleTargetSchema, W as LABEL_SUPPLY_MACRO, Wi as systemEventFilterApplies, Wn as applyNonBlockingEdit, Wr as isScheduleActive, Wt as NcSharedSequenceSchema, X as MAX_BIRTH_DECISION_RECORDS, Xi as viewerLinkBaseOf, Xn as buildEventKindDescriptor, Xr as mayWriteToLocation, Xt as NcTaxonomySchema, Y as MAX_ARCHIVED_DEBUG_NOTES, Yi as vectorDimFromBase64, Yn as audioModeOf, Yr as linkedStepOf, Yt as NcSystemEventKindSchema, Z as MAX_BIRTH_LATENCY_PROXY_MS, Zi as withSystemEventClasses, Zn as buildSubjectPath, Zr as memoizePinnedFfmpeg, Zt as NcTemplatePreviewInputSchema, _ as AlarmArmModeSchema, _a as sleep$1, _i as resolveDeliveryParams, _n as SCENE_DEFAULT_UNCOVERED_POLICY, _t as NC_CONFIRM_DEFAULT_TIMEOUT_MS, a as CLIP_EMBEDDING_STEP_ID, aa as CamProfileSchema, ai as paletteResultSchema, an as RECORDING_SOURCE_CAMSTACK_ADDON, ar as coreBlockIdFromAddonId, at as NC_ALARM_DELAY_FIELDS, b as BaseDevice, ba as array, bi as resolveModeNotifyPolicy, bn as SceneMonitorSchema, bt as NC_DEFAULT_SNOOZE_MINUTES, c as readClusterModelPinStrict, ca as RECORD_QUERY_MAX, ci as pickFaceRescoreIntervalMinutes, cn as RetrainOriginSchema, cr as deleteAlarmProfile, ct as NC_ALARM_SYSTEM_EVENT_KINDS, d as APPEARANCE_BIN_COUNT, da as defineCustomActions, di as projectSubjectPath, dn as SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX, dr as deriveRecordingMode, dt as NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT, ea as canonicalHash, ei as normalizeNcCapTarget, en as OPS_LOG_DEFAULT_LIMIT, er as calendarEventLocalSpan, et as MOTION_CLOSE_AFTER_MS, f as APPEARANCE_BLOCKS, fa as defineRecordKinds, fi as readDeviceStateFrom, fn as SCENE_CONFIRM_DEFAULT_TIMEOUT_MS, fr as describeSystemEventDeliveryProblem, ft as NC_CLIP_POST_ROLL_DEFAULT_SEC, g as ActionTargetResolver, gi as resolveClipSearchMinScore, gn as SCENE_DEFAULT_QUIET_SECONDS, gt as NC_CONFIRM_DEFAULT_MAX_IMAGE_PX, h as AUDIO_MACRO_LABELS, ha as nodePin, hi as renameAlarmProfile, hn as SCENE_DEFAULT_OBSERVATION_SPACING_SEC, hr as deviceRemovalHookCapability, ht as NC_CONDITION_CATALOG, ia as CAP_ADVANCE_FIELDS, ii as paintHex, in as RECORDING_EXPORT_MAX_READ_BYTES, ir as consumableLowPercentOf, it as NC_ALARM_DEFAULT_TRIGGERED_DURATION_SEC, j as DETECTION_PIPELINE_CAP_NAME, ja as templateLiteral, ji as secureActuationFor, jn as TrackRelationKindSchema, jr as isAlertEpisodeSeverity, jt as NcAlarmPostTriggeredActionSchema, k as DEFAULT_TIMELAPSE_PREVIEW_TEXT, ka as strictObject, ki as ruleKindOf, kn as TrackPlacementSchema, kr as isAlarmControllableCap, kt as NC_TEMPLATE_VARS, l as resolveClusterModelPin, la as createEvent, li as pipelineAnalyticsCapability, ln as RetrainStatusSchema, lr as deriveDetailCropRect, lt as NC_ALARM_TRIGGERED_MAX_SEC, m as ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT, ma as isDeviceScopedCap, mi as readTimelapseGeneratedAt, mn as SCENE_DEFAULT_CHECK_INTERVAL_SEC, mr as deviceAttentionKind, mt as NC_CLIP_RETENTION_MAX_SEC, na as isSourceCap, ni as notificationRulesCapability, nn as PackageLlmVerdictSchema, nr as cloneAlarmSettings, nt as MotionTriggeredBySchema, o as CLUSTER_MODEL_OWNER_ADDON_ID, oa as InvalidRecordError, oi as parseAlertEpisodePayload, on as RebuildObjectEmbeddingsRefusalSchema, or as cosineSimilarity$1, ot as NC_ALARM_DELAY_MAX_SEC, p as APPEARANCE_RESOLVES_AMBIGUITY_DEFAULT, pa as hydrateSchema, pi as readMotionTriggeredBy, pn as SCENE_DEFAULT_ANCHOR_THRESHOLD, pr as describeSystemEventFamilyProblem, pt as NC_CLIP_PRE_ROLL_DEFAULT_SEC, q as ListTrackRelationsResultSchema, qi as templateCarriesSummary, qn as assertTimelapseCadences, qr as isVectorIndexDimConflict, qt as NcSnoozeSuppressedSchema, ra as BaseAddon, ri as occupancyScope, rr as consumableFormOf, rt as NC_ALARM_DEFAULT_PROFILE_ID, s as FACE_EMBEDDING_STEP_ID, sa as RECORD_MAX_DATA_BYTES, sn as RetrainDismissedSchema, sr as createAlarmProfile, st as NC_ALARM_NOTIFY_FIELDS, t as BUILTIN_CLIP_MODELS, ta as evaluateSensorEdge, ti as normalizeNcMediaPolicy, tn as OpsLogEntrySchema, tr as classifyRetrainReview, tt as MediaFileKindEnum, u as ACTION_TARGET_INVALIDATION_EVENTS, ua as customAction, ui as plateGalleryCapability, un as RetrainVerdictSubjectSchema, ur as derivePostTriggeredAction, ut as NC_AUDIO_CONFIRM_HITS_DEFAULT, v as ArchivedDebugNoteSchema, va as ZodObject, vi as resolveLocationMode, vn as SCENE_DIVERGED, vr as embeddingRefusalOf, vt as NC_CONSUMABLE_LOW_PERCENT_DEFAULT, w as ClearTrackRelationInputSchema, wa as looseObject, wi as rootSupplyServes, wn as TIMELAPSE_DENSE_FLOOR_SEC, wr as evictionPolicyOfLocation, wt as NC_SENSOR_TRANSITION_KINDS, x as BirthDecisionRecordSchema, xa as boolean, xi as resolveNcMediaImage, xn as SetTrackPurityInputSchema, xr as encodeVectorBase64, xt as NC_GROUPING_DEFAULT_SEC, y as BIRTH_DECISION_DEFAULT_LIMIT, ya as _enum, yi as resolveModeDelays, yn as SCENE_RESET_RECAPTURES, yt as NC_CONSUMABLE_SYSTEM_EVENT_KINDS, z as EVENT_OWNER_TYPES, zi as summarizeReview, zn as alertEpisodeId, zr as isKnownTemplateVar, zt as NcRulePatchSchema } from "../clip-model-registry-BtzUYE5M.mjs";
1
+ import { $ as MAX_TRACK_RELATIONS, $i as DEFAULT_FIRST_SIGHTING_FRESHNESS_MS, $n as bundledCamstack, $r as normalizeNcAction, $t as NcTemplateVarDescriptorSchema, A as DETECTION_MACRO_CLASSES, Aa as strictObject, Ai as sceneMonitorCapability, An as TrackPuritySchema, Ar as isAlertEpisodeOpen, At as NcAlarmConfigSchema, B as EXPORT_DENSE_MAX_RANGES, Bi as sunTimes, Bn as alertEpisodeKind, Br as isLabelSupplyStepId, Bt as NcRuleSchema, C as COCO_TO_MACRO, Ca as discriminatedUnion, Ci as retrainRevisionConflictMessage, Cn as SetTrackRelationInputSchema, Cr as eventKindLabel, Ct as NC_GROUPING_MIN_SEC, D as DEFAULT_DETAIL_CROP_CONVENTION, Da as object, Di as ruleDeviceCompatCapQueries, Dn as TimelapseRulePatchSchema, Dr as gifDeriveSpeed, Dt as NC_SYSTEM_EVENT_KIND_GROUP_SPECS, E as CoverStateSchema, Ea as number, Ei as ruleBelongsToAlarm$1, En as TimelapseRuleInputSchema, Er as failureContributionCapability, Et as NC_STATE_SUMMARY_SECTION_IDS, F as EMBEDDING_REQUIREMENTS_FAILED, Fa as unknown, Fi as storageOccupancyCapability, Fn as activateAlarmProfile, Fr as isDetectionMacroClass, Ft as NcConditionDescriptorSchema, G as LabelAttributionSchema, Gi as systemEventSummaryScheduleOf, Gn as applySecureOnArmEdit, Gr as isSystemDelivery, Gt as NcSnoozeInputSchema, H as FULL_IMAGE_BBOX, Hi as systemEventDeliveryProblems, Hn as applyBlockingEdit, Hr as isRetiredClearKey, Ht as NcRuleUpdateInputSchema, I as EMBEDDING_REQUIREMENTS_UNAVAILABLE, Ia as DeviceType, Ii as subKindsOf, In as addonWidgetsSourceCapability, Ir as isDrawableSubjectPath, It as NcConditionsSchema, J as LockStateSchema, Ji as templateVarsFor, Jn as audioMetricsCapability, Jr as kebabToCamel, Jt as NcStateSummarySectionIdSchema, K as ListTrackRelationsInputSchema, Ki as systemEventSummarySplitOf, Kn as armRemovalReconcile, Kr as isSystemEventSummaryRule, Kt as NcSnoozeSchema, L as EVENT_DENSITY_BATCH_MAX, La as errMsg, Li as subjectPathSampleFromBox, Ln as alarmDeviceSecureOnArm, Lr as isEventKindLabelKey, Lt as NcRuleActionSchema, M as DeclaredDevices, Ma as templateLiteral, Mi as sensorRaisedOf, Mn as TrackRelationSchema, Mr as isAppLinkBase, Mt as NcAlarmSensorsInputSchema, N as DetectionSourceSchema, Na as tuple, Ni as servedTemplateVars, Nn as TrackSideSchema, Nr as isAudioClassName, Nt as NcAlarmSensorsSchema, O as DEFAULT_EVENT_COLOR, Oa as partialRecord, Oi as ruleGroupingApplies, On as TimelapseRuleSchema, Or as gifFromMp4Args, Ot as NC_TAXONOMY, P as EMBEDDING_MODEL_FAILED, Pa as union, Pi as startMoverUnderClearance, Pn as TrackSourceSchema, Pr as isDefaultAlarmProfileId, Pt as NcAlarmSettingsPatchSchema, Q as MAX_TRACK_PURITIES, Qi as zoneAnalyticsCapability, Qn as buildViewerLink, Qr as ncMediaPolicyError, Qt as NcTemplatePreviewSchema, R as EVENT_KIND_BY_CAP, Ra as EventCategory, Ri as subjectPathSvgPoints, Rn as alarmPanelCapability, Rr as isEventOwnerType, Rt as NcRuleInputSchema, S as BucketAccumulator, Sa as boolean, Sn as SetTrackPurityResultSchema, Sr as ensureAlarmProfiles, St as NC_GROUPING_MAX_SEC, T as ClearTrackRelationResultSchema, Ta as looseObject, Ti as ruleAutoTriggersAlarm, Tn as TRACK_RELATIONS_DEFAULT_LIMIT, Tr as faceGalleryCapability, Tt as NC_SNOOZE_MAX_MINUTES, U as FailureCounters, Ui as systemEventFamilyProblems, Un as applyModeDelaysEdits, Ur as isRootSuppliableStepId, Ut as NcScheduleSchema, V as FIRST_LEVEL_MACRO_CLASSES, Vi as syncActiveAlarmProfileSettings, Vn as alertEpisodePayload, Vr as isMediaOwnerType, Vt as NcRuleTargetSchema, W as LABEL_SUPPLY_MACRO, Wi as systemEventFilterApplies, Wn as applyNonBlockingEdit, Wr as isScheduleActive, Wt as NcSharedSequenceSchema, X as MAX_BIRTH_DECISION_RECORDS, Xi as viewerLinkBaseOf, Xn as buildEventKindDescriptor, Xr as mayWriteToLocation, Xt as NcTaxonomySchema, Y as MAX_ARCHIVED_DEBUG_NOTES, Yi as vectorDimFromBase64, Yn as audioModeOf, Yr as linkedStepOf, Yt as NcSystemEventKindSchema, Z as MAX_BIRTH_LATENCY_PROXY_MS, Zi as withSystemEventClasses, Zn as buildSubjectPath, Zr as memoizePinnedFfmpeg, Zt as NcTemplatePreviewInputSchema, _ as AlarmArmModeSchema, _i as resolveDeliveryParams, _n as SCENE_DEFAULT_UNCOVERED_POLICY, _t as NC_CONFIRM_DEFAULT_TIMEOUT_MS, a as CLIP_EMBEDDING_STEP_ID, aa as CamProfileSchema, ai as paletteResultSchema, an as RECORDING_SOURCE_CAMSTACK_ADDON, ar as coreBlockIdFromAddonId, at as NC_ALARM_DELAY_FIELDS, b as BaseDevice, ba as _enum, bi as resolveModeNotifyPolicy, bn as SceneMonitorSchema, bt as NC_DEFAULT_SNOOZE_MINUTES, c as readClusterModelPinStrict, ca as RECORD_QUERY_MAX, ci as pickFaceRescoreIntervalMinutes, cn as RetrainOriginSchema, cr as deleteAlarmProfile, ct as NC_ALARM_SYSTEM_EVENT_KINDS, d as APPEARANCE_BIN_COUNT, da as defineAddonMigrations, di as projectSubjectPath, dn as SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX, dr as deriveRecordingMode, dt as NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT, ea as canonicalHash, ei as normalizeNcCapTarget, en as OPS_LOG_DEFAULT_LIMIT, er as calendarEventLocalSpan, et as MOTION_CLOSE_AFTER_MS, f as APPEARANCE_BLOCKS, fa as defineCustomActions, fi as readDeviceStateFrom, fn as SCENE_CONFIRM_DEFAULT_TIMEOUT_MS, fr as describeSystemEventDeliveryProblem, ft as NC_CLIP_POST_ROLL_DEFAULT_SEC, g as ActionTargetResolver, ga as nodePin, gi as resolveClipSearchMinScore, gn as SCENE_DEFAULT_QUIET_SECONDS, gt as NC_CONFIRM_DEFAULT_MAX_IMAGE_PX, h as AUDIO_MACRO_LABELS, ha as isDeviceScopedCap, hi as renameAlarmProfile, hn as SCENE_DEFAULT_OBSERVATION_SPACING_SEC, hr as deviceRemovalHookCapability, ht as NC_CONDITION_CATALOG, ia as CAP_ADVANCE_FIELDS, ii as paintHex, in as RECORDING_EXPORT_MAX_READ_BYTES, ir as consumableLowPercentOf, it as NC_ALARM_DEFAULT_TRIGGERED_DURATION_SEC, j as DETECTION_PIPELINE_CAP_NAME, ja as string, ji as secureActuationFor, jn as TrackRelationKindSchema, jr as isAlertEpisodeSeverity, jt as NcAlarmPostTriggeredActionSchema, k as DEFAULT_TIMELAPSE_PREVIEW_TEXT, ka as record, ki as ruleKindOf, kn as TrackPlacementSchema, kr as isAlarmControllableCap, kt as NC_TEMPLATE_VARS, l as resolveClusterModelPin, la as createEvent, li as pipelineAnalyticsCapability, ln as RetrainStatusSchema, lr as deriveDetailCropRect, lt as NC_ALARM_TRIGGERED_MAX_SEC, m as ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT, ma as hydrateSchema, mi as readTimelapseGeneratedAt, mn as SCENE_DEFAULT_CHECK_INTERVAL_SEC, mr as deviceAttentionKind, mt as NC_CLIP_RETENTION_MAX_SEC, na as isSourceCap, ni as notificationRulesCapability, nn as PackageLlmVerdictSchema, nr as cloneAlarmSettings, nt as MotionTriggeredBySchema, o as CLUSTER_MODEL_OWNER_ADDON_ID, oa as InvalidRecordError, oi as parseAlertEpisodePayload, on as RebuildObjectEmbeddingsRefusalSchema, or as cosineSimilarity$1, ot as NC_ALARM_DELAY_MAX_SEC, p as APPEARANCE_RESOLVES_AMBIGUITY_DEFAULT, pa as defineRecordKinds, pi as readMotionTriggeredBy, pn as SCENE_DEFAULT_ANCHOR_THRESHOLD, pr as describeSystemEventFamilyProblem, pt as NC_CLIP_PRE_ROLL_DEFAULT_SEC, q as ListTrackRelationsResultSchema, qi as templateCarriesSummary, qn as assertTimelapseCadences, qr as isVectorIndexDimConflict, qt as NcSnoozeSuppressedSchema, ra as BaseAddon, ri as occupancyScope, rr as consumableFormOf, rt as NC_ALARM_DEFAULT_PROFILE_ID, s as FACE_EMBEDDING_STEP_ID, sa as RECORD_MAX_DATA_BYTES, sn as RetrainDismissedSchema, sr as createAlarmProfile, st as NC_ALARM_NOTIFY_FIELDS, t as BUILTIN_CLIP_MODELS, ta as evaluateSensorEdge, ti as normalizeNcMediaPolicy, tn as OpsLogEntrySchema, tr as classifyRetrainReview, tt as MediaFileKindEnum, u as ACTION_TARGET_INVALIDATION_EVENTS, ua as customAction, ui as plateGalleryCapability, un as RetrainVerdictSubjectSchema, ur as derivePostTriggeredAction, ut as NC_AUDIO_CONFIRM_HITS_DEFAULT, v as ArchivedDebugNoteSchema, va as sleep$1, vi as resolveLocationMode, vn as SCENE_DIVERGED, vr as embeddingRefusalOf, vt as NC_CONSUMABLE_LOW_PERCENT_DEFAULT, w as ClearTrackRelationInputSchema, wa as literal, wi as rootSupplyServes, wn as TIMELAPSE_DENSE_FLOOR_SEC, wr as evictionPolicyOfLocation, wt as NC_SENSOR_TRANSITION_KINDS, x as BirthDecisionRecordSchema, xa as array, xi as resolveNcMediaImage, xn as SetTrackPurityInputSchema, xr as encodeVectorBase64, xt as NC_GROUPING_DEFAULT_SEC, y as BIRTH_DECISION_DEFAULT_LIMIT, ya as ZodObject, yi as resolveModeDelays, yn as SCENE_RESET_RECAPTURES, yt as NC_CONSUMABLE_SYSTEM_EVENT_KINDS, z as EVENT_OWNER_TYPES, zi as summarizeReview, zn as alertEpisodeId, zr as isKnownTemplateVar, zt as NcRulePatchSchema } from "../clip-model-registry-CVajwmEk.mjs";
2
2
  import { t as __exportAll } from "../embedding-encoder/index.mjs";
3
3
  import * as fs$1 from "node:fs";
4
4
  import { createWriteStream, promises } from "node:fs";
@@ -8880,11 +8880,25 @@ function cleanSourcePreference(ownerKind) {
8880
8880
  * The ONE placeholder grammar. `renderTemplate` substitutes what it matches and
8881
8881
  * {@link templatePlaceholders} lists it; a second regex here would be a legend
8882
8882
  * that disagrees with the renderer about what a variable is, which is the
8883
- * failure mode where an editor advertises `{{ camera }}` as unsupported and the
8883
+ * failure mode where an editor advertises `{{ device }}` as unsupported and the
8884
8884
  * notification prints the camera anyway.
8885
8885
  */
8886
8886
  var PLACEHOLDER_PATTERN = /\{\{\s*(\w+)\s*\}\}/g;
8887
8887
  /**
8888
+ * Names that were renamed and still resolve at render time, mapped to the name
8889
+ * that replaced them. `{{camera}}` became `{{device}}` (a rule on an appliance
8890
+ * names that device, not a camera); a template written by an older client still
8891
+ * prints the right name. An alias is NOT declared in the catalog and no picker
8892
+ * offers it: the stored rules are rewritten by the `pipeline-analytics` template
8893
+ * migration, and this table only covers a client that has not updated yet.
8894
+ */
8895
+ var NC_DEPRECATED_TEMPLATE_VARS = { camera: "device" };
8896
+ /** The deprecated names a template still uses, in order of first appearance. */
8897
+ function deprecatedPlaceholders(template) {
8898
+ if (template === void 0) return [];
8899
+ return templatePlaceholders(template).filter((name) => name in NC_DEPRECATED_TEMPLATE_VARS);
8900
+ }
8901
+ /**
8888
8902
  * The variable names a template names, de-duplicated, in order of first
8889
8903
  * appearance.
8890
8904
  *
@@ -8910,14 +8924,19 @@ function templatePlaceholders(template) {
8910
8924
  */
8911
8925
  function renderTemplate(template, vars) {
8912
8926
  if (template === void 0 || template.trim().length === 0) return null;
8913
- return template.replace(PLACEHOLDER_PATTERN, (_m, name) => vars[name] ?? "");
8927
+ return template.replace(PLACEHOLDER_PATTERN, (_m, name) => {
8928
+ const current = vars[name];
8929
+ if (current !== void 0) return current;
8930
+ const renamed = NC_DEPRECATED_TEMPLATE_VARS[name];
8931
+ return (renamed !== void 0 ? vars[renamed] : void 0) ?? "";
8932
+ });
8914
8933
  }
8915
8934
  //#endregion
8916
8935
  //#region src/notification-center/texts/en.json
8917
8936
  var en_default = {
8918
8937
  "detection.title": "{{rule}}",
8919
- "detection.body": "{{subject}} on {{camera}}{{inZones}}",
8920
- "detection.body.trackEnd": "{{subject}} on {{camera}}{{inZones}} — visit ended",
8938
+ "detection.body": "{{subject}} on {{device}}{{inZones}}",
8939
+ "detection.body.trackEnd": "{{subject}} on {{device}}{{inZones}} — visit ended",
8921
8940
  "detection.subject": "{{classNoun}}",
8922
8941
  "detection.subject.labelled": "{{classNoun}} ({{label}})",
8923
8942
  "detection.subject.identity": "{{label}}",
@@ -8989,11 +9008,11 @@ var en_default = {
8989
9008
  "other": "{{count}} other {{classNoun}}"
8990
9009
  },
8991
9010
  "package.delivered.title": "Parcel delivered",
8992
- "package.delivered.body": "Delivered at {{camera}}{{inZones}}",
9011
+ "package.delivered.body": "Delivered at {{device}}{{inZones}}",
8993
9012
  "package.delivered.possible.title": "Possible parcel",
8994
- "package.delivered.possible.body": "Possible parcel at {{camera}}{{inZones}}",
9013
+ "package.delivered.possible.body": "Possible parcel at {{device}}{{inZones}}",
8995
9014
  "package.picked-up.title": "Parcel collected",
8996
- "package.picked-up.body": "Collected from {{camera}}{{inZones}}",
9015
+ "package.picked-up.body": "Collected from {{device}}{{inZones}}",
8997
9016
  "occupancy.body": "{{scope}} {{op}} ({{count}}/{{capacity}})",
8998
9017
  "occupancy.op.occupied": "occupied",
8999
9018
  "occupancy.op.free": "free",
@@ -9129,7 +9148,7 @@ var en_default = {
9129
9148
  "system.camera-enabled.title": "Device switched on",
9130
9149
  "system.camera-enabled.body": "Device {{deviceName}} was switched back on",
9131
9150
  "test.prefix": "[TEST] {{body}}",
9132
- "timelapse.title": "Timelapse — {{camera}}",
9151
+ "timelapse.title": "Timelapse — {{device}}",
9133
9152
  "timelapse.body.window": "{{rule}} — {{from}}→{{to}}",
9134
9153
  "timelapse.body.tooManyEvents": "too many events for dense sampling: video at a uniform cadence",
9135
9154
  "timelapse.body.denseRanges": {
@@ -9143,7 +9162,7 @@ var en_default = {
9143
9162
  },
9144
9163
  "snooze.digest.header": "{{scope}} was snoozed, {{from}}–{{to}}.",
9145
9164
  "snooze.digest.header.global": "{{scope}} was snoozed for everyone, {{from}}–{{to}}.",
9146
- "snooze.digest.line": "• {{rule}} on {{camera}} — {{count}}",
9165
+ "snooze.digest.line": "• {{rule}} on {{device}} — {{count}}",
9147
9166
  "snooze.scope.all": "Everything",
9148
9167
  "snooze.scope.anyDevice": "A camera",
9149
9168
  "snooze.scope.anyRule": "A rule",
@@ -9322,8 +9341,8 @@ var en_default = {
9322
9341
  //#region src/notification-center/texts/it.json
9323
9342
  var it_default = {
9324
9343
  "detection.title": "{{rule}}",
9325
- "detection.body": "{{subject}} su {{camera}}{{inZones}}",
9326
- "detection.body.trackEnd": "{{subject}} su {{camera}}{{inZones}} — visita terminata",
9344
+ "detection.body": "{{subject}} su {{device}}{{inZones}}",
9345
+ "detection.body.trackEnd": "{{subject}} su {{device}}{{inZones}} — visita terminata",
9327
9346
  "detection.subject": "{{classNoun}}",
9328
9347
  "detection.subject.labelled": "{{classNoun}} ({{label}})",
9329
9348
  "detection.subject.identity": "{{label}}",
@@ -9395,11 +9414,11 @@ var it_default = {
9395
9414
  "other": "{{count}} altri {{classNoun}}"
9396
9415
  },
9397
9416
  "package.delivered.title": "Pacco consegnato",
9398
- "package.delivered.body": "Consegnato su {{camera}}{{inZones}}",
9417
+ "package.delivered.body": "Consegnato su {{device}}{{inZones}}",
9399
9418
  "package.delivered.possible.title": "Possibile pacco",
9400
- "package.delivered.possible.body": "Possibile pacco su {{camera}}{{inZones}}",
9419
+ "package.delivered.possible.body": "Possibile pacco su {{device}}{{inZones}}",
9401
9420
  "package.picked-up.title": "Pacco ritirato",
9402
- "package.picked-up.body": "Ritirato da {{camera}}{{inZones}}",
9421
+ "package.picked-up.body": "Ritirato da {{device}}{{inZones}}",
9403
9422
  "occupancy.body": "{{scope}} {{op}} ({{count}}/{{capacity}})",
9404
9423
  "occupancy.op.occupied": "occupata",
9405
9424
  "occupancy.op.free": "libera",
@@ -9535,7 +9554,7 @@ var it_default = {
9535
9554
  "system.camera-enabled.title": "Dispositivo riacceso",
9536
9555
  "system.camera-enabled.body": "Il dispositivo {{deviceName}} è stato riacceso",
9537
9556
  "test.prefix": "[PROVA] {{body}}",
9538
- "timelapse.title": "Sequenza — {{camera}}",
9557
+ "timelapse.title": "Sequenza — {{device}}",
9539
9558
  "timelapse.body.window": "{{rule}} — {{from}}→{{to}}",
9540
9559
  "timelapse.body.tooManyEvents": "troppi eventi per il campionamento denso: video a cadenza uniforme",
9541
9560
  "timelapse.body.denseRanges": {
@@ -9549,7 +9568,7 @@ var it_default = {
9549
9568
  },
9550
9569
  "snooze.digest.header": "{{scope}} in pausa, {{from}}–{{to}}.",
9551
9570
  "snooze.digest.header.global": "{{scope}} in pausa per tutti, {{from}}–{{to}}.",
9552
- "snooze.digest.line": "• {{rule}} su {{camera}} — {{count}}",
9571
+ "snooze.digest.line": "• {{rule}} su {{device}} — {{count}}",
9553
9572
  "snooze.scope.all": "Tutto",
9554
9573
  "snooze.scope.anyDevice": "Una camera",
9555
9574
  "snooze.scope.anyRule": "Una regola",
@@ -9773,7 +9792,7 @@ var it_default = {
9773
9792
  * as plain strings. {@link renderTemplate} never re-scans a replacement, so
9774
9793
  * there is exactly one level of composition and it cannot grow: a fragment that
9775
9794
  * names another composite renders it empty, and a value that happens to look
9776
- * like `{{camera}}` is printed, not substituted.
9795
+ * like `{{device}}` is printed, not substituted.
9777
9796
  */
9778
9797
  /** The languages the hub ships texts for. */
9779
9798
  var NC_LANGUAGES = ["en", "it"];
@@ -56135,6 +56154,258 @@ var ZoneCatalogueCache = class {
56135
56154
  }
56136
56155
  };
56137
56156
  //#endregion
56157
+ //#region src/notification-center/record-kinds.ts
56158
+ /**
56159
+ * Record kinds owned by the pipeline-analytics addon (records plan phase 2,
56160
+ * steps 18-24): the notification-center config tables.
56161
+ *
56162
+ * The notification-center module is hosted inside the pipeline-analytics addon.
56163
+ * That addon declares no `execution.group`, so the UDS owner stamp is the addon
56164
+ * id: `pipeline-analytics`. Declared hub-only (agents have no `ctx.records`).
56165
+ * One deploy covers all 7 kinds.
56166
+ */
56167
+ /**
56168
+ * The hub language and operator-authored per-key overrides.
56169
+ * One row, id `texts`. Losing it degrades to the shipped English catalog.
56170
+ */
56171
+ var TextsBodySchema = object({
56172
+ language: NcLanguageSchema,
56173
+ overrides: partialRecord(NcLanguageSchema, record(string(), string()))
56174
+ });
56175
+ /**
56176
+ * A shared action sequence (without id, which is the record key).
56177
+ * Extends the wire shape with `createdAt` / `updatedAt` (stored by the legacy table).
56178
+ */
56179
+ var SequenceBodySchema = NcSharedSequenceSchema.omit({ id: true }).extend({
56180
+ createdAt: number(),
56181
+ updatedAt: number()
56182
+ });
56183
+ /**
56184
+ * The AI section of one ordinary rule. Record id = the rule id.
56185
+ */
56186
+ var RuleAiBodySchema = object({
56187
+ ai: NcRuleAiSchema,
56188
+ updatedAt: number()
56189
+ });
56190
+ /** A calendar-events rule (without `id`). */
56191
+ var CalendarEventsRuleBodySchema = NcCalendarEventsRuleSchema.omit({ id: true });
56192
+ /** A multi-camera digest rule (without `id`). */
56193
+ var SummaryRuleBodySchema = NcSummaryRuleSchema.omit({ id: true });
56194
+ /** A timelapse rule (without `id`). */
56195
+ var TimelapseRuleBodySchema = TimelapseRuleSchema.omit({ id: true });
56196
+ /** A notification rule (without `id`). */
56197
+ var RuleBodySchema = NcRuleSchema.omit({ id: true });
56198
+ var ncRecordKinds = defineRecordKinds({
56199
+ /**
56200
+ * The hub language + per-key text overrides. One row (id `texts`).
56201
+ */
56202
+ texts: {
56203
+ schema: TextsBodySchema,
56204
+ class: "config",
56205
+ writeTrigger: "an operator changes the hub language (setLanguage) or replaces the per-key override set (setOverrides)",
56206
+ device: "none",
56207
+ at: "none",
56208
+ retention: { none: "one row (id `texts`); losing it costs the chosen language and household wording, never a notification — every read degrades to the shipped English catalog" }
56209
+ },
56210
+ /**
56211
+ * Shared action sequences — named, ordered runs of steps with their own throttle.
56212
+ * One row per sequence, id = sequence UUID.
56213
+ */
56214
+ sequences: {
56215
+ schema: SequenceBodySchema,
56216
+ class: "config",
56217
+ writeTrigger: "an admin creates/edits/deletes a shared sequence via notificationRules.createSequence / updateSequence / deleteSequence, or the one-shot boot migration that materialises legacy inline sequences",
56218
+ device: "none",
56219
+ at: "none",
56220
+ retention: { none: "a row goes only when an admin deletes it; bounded by the sequence set a human is willing to author" }
56221
+ },
56222
+ /**
56223
+ * Per-rule AI section: whether and how a rule narrates itself.
56224
+ * Record id = the rule id it belongs to.
56225
+ */
56226
+ "rule-ai": {
56227
+ schema: RuleAiBodySchema,
56228
+ class: "config",
56229
+ writeTrigger: "an operator switches the AI section of a notification rule on or off, or edits its prompt / word cap / language",
56230
+ device: "none",
56231
+ at: "none",
56232
+ retention: { none: "a row goes when the operator clears the section or deletes the rule; bounded by the rule set a human is willing to author" }
56233
+ },
56234
+ /**
56235
+ * Calendar-events rules. One row per rule, id = rule UUID.
56236
+ */
56237
+ "calendar-events-rules": {
56238
+ schema: CalendarEventsRuleBodySchema,
56239
+ class: "config",
56240
+ writeTrigger: "an operator creates or edits a calendar-events rule, or the producer stamps a delivered window via markGenerated",
56241
+ device: "none",
56242
+ at: "none",
56243
+ indexes: [{
56244
+ name: "enabled",
56245
+ fields: ["enabled"]
56246
+ }],
56247
+ retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
56248
+ },
56249
+ /**
56250
+ * Multi-camera digest rules. One row per rule, id = rule UUID.
56251
+ */
56252
+ "summary-rules": {
56253
+ schema: SummaryRuleBodySchema,
56254
+ class: "config",
56255
+ writeTrigger: "an operator creates or edits a digest rule, or the producer stamps a delivered window via markGenerated",
56256
+ device: "none",
56257
+ at: "none",
56258
+ indexes: [{
56259
+ name: "enabled",
56260
+ fields: ["enabled"]
56261
+ }],
56262
+ retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
56263
+ },
56264
+ /**
56265
+ * Timelapse rules. One row per rule, id = rule UUID.
56266
+ * Three rows on prod (2026-10-18).
56267
+ */
56268
+ "timelapse-rules": {
56269
+ schema: TimelapseRuleBodySchema,
56270
+ class: "config",
56271
+ writeTrigger: "an operator creates or edits a timelapse rule, or the scheduler stamps a successful per-camera generation via markGenerated",
56272
+ device: "none",
56273
+ at: "none",
56274
+ indexes: [{
56275
+ name: "enabled",
56276
+ fields: ["enabled"]
56277
+ }],
56278
+ retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
56279
+ },
56280
+ /**
56281
+ * Notification rules — the main rule set. One row per rule, id = rule UUID.
56282
+ * 18 rows on prod (2026-10-18); most coupled kind in this owner.
56283
+ */
56284
+ rules: {
56285
+ schema: RuleBodySchema,
56286
+ class: "config",
56287
+ writeTrigger: "an operator creates, edits, enables/disables a rule or opts a target out of it; nothing writes on the evaluation path",
56288
+ device: "none",
56289
+ at: "none",
56290
+ indexes: [{
56291
+ name: "delivery",
56292
+ fields: ["delivery"]
56293
+ }],
56294
+ retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
56295
+ }
56296
+ });
56297
+ //#endregion
56298
+ //#region src/migrations/device-template-var.ts
56299
+ /** `{{camera}}` and `{{ camera }}`: the whitespace the renderer allows is kept as written. */
56300
+ var OLD_VARIABLE = /\{\{(\s*)camera(\s*)\}\}/g;
56301
+ /** The template text with the variable renamed; the same string when it names none. */
56302
+ function renameDeviceVariable(text) {
56303
+ return text.replace(OLD_VARIABLE, "{{$1device$2}}");
56304
+ }
56305
+ /** A `{ title, body }` template with both fields renamed; `null` when neither changed. */
56306
+ function renamedTemplate(template) {
56307
+ if (template === void 0) return null;
56308
+ const title = template.title === void 0 ? void 0 : renameDeviceVariable(template.title);
56309
+ const body = template.body === void 0 ? void 0 : renameDeviceVariable(template.body);
56310
+ if (title === template.title && body === template.body) return null;
56311
+ return {
56312
+ ...template,
56313
+ ...title !== void 0 ? { title } : {},
56314
+ ...body !== void 0 ? { body } : {}
56315
+ };
56316
+ }
56317
+ function renamedRule(data) {
56318
+ const template = renamedTemplate(data.template);
56319
+ return template === null ? null : {
56320
+ ...data,
56321
+ template
56322
+ };
56323
+ }
56324
+ function renamedTimelapseRule(data) {
56325
+ const template = renamedTemplate(data.template);
56326
+ const previewText = data.previewText === void 0 ? void 0 : renameDeviceVariable(data.previewText);
56327
+ const previewChanged = previewText !== data.previewText;
56328
+ if (template === null && !previewChanged) return null;
56329
+ return {
56330
+ ...data,
56331
+ ...template !== null ? { template } : {},
56332
+ ...previewChanged && previewText !== void 0 ? { previewText } : {}
56333
+ };
56334
+ }
56335
+ function renamedTexts(data) {
56336
+ let changed = false;
56337
+ const overrides = Object.fromEntries(Object.entries(data.overrides).map(([language, table]) => [language, Object.fromEntries(Object.entries(table).map(([key, text]) => {
56338
+ const next = renameDeviceVariable(text);
56339
+ if (next !== text) changed = true;
56340
+ return [key, next];
56341
+ }))]));
56342
+ return changed ? {
56343
+ ...data,
56344
+ overrides
56345
+ } : null;
56346
+ }
56347
+ var PAGE$1 = 500;
56348
+ /** Every row of a kind, page by page. */
56349
+ async function allRows(kind) {
56350
+ const rows = [];
56351
+ let cursor;
56352
+ do {
56353
+ const page = await kind.query({
56354
+ limit: PAGE$1,
56355
+ ...cursor !== void 0 ? { cursor } : {}
56356
+ });
56357
+ rows.push(...page.records);
56358
+ cursor = page.nextCursor ?? void 0;
56359
+ } while (cursor !== void 0);
56360
+ return rows;
56361
+ }
56362
+ /** Rewrite the rows of one kind that carry the old name; returns how many were written. */
56363
+ async function rewriteKind(kind, rewrite) {
56364
+ let written = 0;
56365
+ for (const row of await allRows(kind)) {
56366
+ const next = rewrite(row.data);
56367
+ if (next === null) continue;
56368
+ await kind.put({
56369
+ id: row.id,
56370
+ data: next
56371
+ }, { ifRev: row.rev });
56372
+ written += 1;
56373
+ }
56374
+ return written;
56375
+ }
56376
+ async function migrateDeviceTemplateVariable(ports) {
56377
+ const rules = await rewriteKind(ports.rules, renamedRule);
56378
+ const timelapseRules = await rewriteKind(ports.timelapseRules, renamedTimelapseRule);
56379
+ const texts = await rewriteKind(ports.texts, renamedTexts);
56380
+ return {
56381
+ outcome: rules + timelapseRules + texts === 0 ? "already-done" : "done",
56382
+ summary: {
56383
+ rules,
56384
+ timelapseRules,
56385
+ texts
56386
+ }
56387
+ };
56388
+ }
56389
+ //#endregion
56390
+ //#region src/migrations/index.ts
56391
+ /** The `pipeline-analytics` catalogue (D987): offered to the engine at the hub's boot. */
56392
+ var ADDON_MIGRATIONS = [{
56393
+ meta: {
56394
+ id: "pipeline-analytics/2026-11-01-template-camera-to-device",
56395
+ owner: "pipeline-analytics",
56396
+ level: "addon-state",
56397
+ seq: 1,
56398
+ dependsOn: [],
56399
+ store: "settings",
56400
+ scope: "cluster",
56401
+ onFailure: "tolerate",
56402
+ bodyKind: "procedure",
56403
+ description: "Rename the {{camera}} template variable to {{device}} in every stored notification rule, timelapse rule and text override",
56404
+ fixtureMark: "the rule name and the trigger conditions the migration does not know"
56405
+ },
56406
+ procedure: migrateDeviceTemplateVariable
56407
+ }];
56408
+ //#endregion
56138
56409
  //#region src/pipeline-analytics/clip-space-plan.ts
56139
56410
  /**
56140
56411
  * Which CLIP feature space a search reads and a rebuild fills — decided in one
@@ -67033,7 +67304,7 @@ var CaptureScheduler = class {
67033
67304
  for (let i = lane.queue.length - 1; i >= 0; i -= 1) {
67034
67305
  const entry = lane.queue[i];
67035
67306
  if (entry === void 0) continue;
67036
- if (entry.staleAfterMs === void 0 || nowMs - entry.enqueuedAt <= entry.staleAfterMs) continue;
67307
+ if (entry.staleAfterMs === void 0 || nowMs - entry.enqueuedAt < entry.staleAfterMs) continue;
67037
67308
  lane.queue.splice(i, 1);
67038
67309
  this.bump(deviceId, "droppedStale");
67039
67310
  this.noteDropped(deviceId, entry, "stale");
@@ -67109,7 +67380,7 @@ var CaptureScheduler = class {
67109
67380
  while (lane.inFlight < this.budget && lane.queue.length > 0) {
67110
67381
  const entry = lane.queue.shift();
67111
67382
  if (entry === void 0) return;
67112
- if (entry.staleAfterMs !== void 0 && this.now() - entry.enqueuedAt > entry.staleAfterMs) {
67383
+ if (entry.staleAfterMs !== void 0 && this.now() - entry.enqueuedAt >= entry.staleAfterMs) {
67113
67384
  this.bump(deviceId, "droppedStale");
67114
67385
  this.noteDropped(deviceId, entry, "stale");
67115
67386
  entry.drop();
@@ -82301,147 +82572,6 @@ var NcDeviceMuteStore = class {
82301
82572
  }
82302
82573
  };
82303
82574
  //#endregion
82304
- //#region src/notification-center/record-kinds.ts
82305
- /**
82306
- * Record kinds owned by the pipeline-analytics addon (records plan phase 2,
82307
- * steps 18-24): the notification-center config tables.
82308
- *
82309
- * The notification-center module is hosted inside the pipeline-analytics addon.
82310
- * That addon declares no `execution.group`, so the UDS owner stamp is the addon
82311
- * id: `pipeline-analytics`. Declared hub-only (agents have no `ctx.records`).
82312
- * One deploy covers all 7 kinds.
82313
- */
82314
- /**
82315
- * The hub language and operator-authored per-key overrides.
82316
- * One row, id `texts`. Losing it degrades to the shipped English catalog.
82317
- */
82318
- var TextsBodySchema = object({
82319
- language: NcLanguageSchema,
82320
- overrides: partialRecord(NcLanguageSchema, record(string(), string()))
82321
- });
82322
- /**
82323
- * A shared action sequence (without id, which is the record key).
82324
- * Extends the wire shape with `createdAt` / `updatedAt` (stored by the legacy table).
82325
- */
82326
- var SequenceBodySchema = NcSharedSequenceSchema.omit({ id: true }).extend({
82327
- createdAt: number(),
82328
- updatedAt: number()
82329
- });
82330
- /**
82331
- * The AI section of one ordinary rule. Record id = the rule id.
82332
- */
82333
- var RuleAiBodySchema = object({
82334
- ai: NcRuleAiSchema,
82335
- updatedAt: number()
82336
- });
82337
- /** A calendar-events rule (without `id`). */
82338
- var CalendarEventsRuleBodySchema = NcCalendarEventsRuleSchema.omit({ id: true });
82339
- /** A multi-camera digest rule (without `id`). */
82340
- var SummaryRuleBodySchema = NcSummaryRuleSchema.omit({ id: true });
82341
- /** A timelapse rule (without `id`). */
82342
- var TimelapseRuleBodySchema = TimelapseRuleSchema.omit({ id: true });
82343
- /** A notification rule (without `id`). */
82344
- var RuleBodySchema = NcRuleSchema.omit({ id: true });
82345
- var ncRecordKinds = defineRecordKinds({
82346
- /**
82347
- * The hub language + per-key text overrides. One row (id `texts`).
82348
- */
82349
- texts: {
82350
- schema: TextsBodySchema,
82351
- class: "config",
82352
- writeTrigger: "an operator changes the hub language (setLanguage) or replaces the per-key override set (setOverrides)",
82353
- device: "none",
82354
- at: "none",
82355
- retention: { none: "one row (id `texts`); losing it costs the chosen language and household wording, never a notification — every read degrades to the shipped English catalog" }
82356
- },
82357
- /**
82358
- * Shared action sequences — named, ordered runs of steps with their own throttle.
82359
- * One row per sequence, id = sequence UUID.
82360
- */
82361
- sequences: {
82362
- schema: SequenceBodySchema,
82363
- class: "config",
82364
- writeTrigger: "an admin creates/edits/deletes a shared sequence via notificationRules.createSequence / updateSequence / deleteSequence, or the one-shot boot migration that materialises legacy inline sequences",
82365
- device: "none",
82366
- at: "none",
82367
- retention: { none: "a row goes only when an admin deletes it; bounded by the sequence set a human is willing to author" }
82368
- },
82369
- /**
82370
- * Per-rule AI section: whether and how a rule narrates itself.
82371
- * Record id = the rule id it belongs to.
82372
- */
82373
- "rule-ai": {
82374
- schema: RuleAiBodySchema,
82375
- class: "config",
82376
- writeTrigger: "an operator switches the AI section of a notification rule on or off, or edits its prompt / word cap / language",
82377
- device: "none",
82378
- at: "none",
82379
- retention: { none: "a row goes when the operator clears the section or deletes the rule; bounded by the rule set a human is willing to author" }
82380
- },
82381
- /**
82382
- * Calendar-events rules. One row per rule, id = rule UUID.
82383
- */
82384
- "calendar-events-rules": {
82385
- schema: CalendarEventsRuleBodySchema,
82386
- class: "config",
82387
- writeTrigger: "an operator creates or edits a calendar-events rule, or the producer stamps a delivered window via markGenerated",
82388
- device: "none",
82389
- at: "none",
82390
- indexes: [{
82391
- name: "enabled",
82392
- fields: ["enabled"]
82393
- }],
82394
- retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
82395
- },
82396
- /**
82397
- * Multi-camera digest rules. One row per rule, id = rule UUID.
82398
- */
82399
- "summary-rules": {
82400
- schema: SummaryRuleBodySchema,
82401
- class: "config",
82402
- writeTrigger: "an operator creates or edits a digest rule, or the producer stamps a delivered window via markGenerated",
82403
- device: "none",
82404
- at: "none",
82405
- indexes: [{
82406
- name: "enabled",
82407
- fields: ["enabled"]
82408
- }],
82409
- retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
82410
- },
82411
- /**
82412
- * Timelapse rules. One row per rule, id = rule UUID.
82413
- * Three rows on prod (2026-10-18).
82414
- */
82415
- "timelapse-rules": {
82416
- schema: TimelapseRuleBodySchema,
82417
- class: "config",
82418
- writeTrigger: "an operator creates or edits a timelapse rule, or the scheduler stamps a successful per-camera generation via markGenerated",
82419
- device: "none",
82420
- at: "none",
82421
- indexes: [{
82422
- name: "enabled",
82423
- fields: ["enabled"]
82424
- }],
82425
- retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
82426
- },
82427
- /**
82428
- * Notification rules — the main rule set. One row per rule, id = rule UUID.
82429
- * 18 rows on prod (2026-10-18); most coupled kind in this owner.
82430
- */
82431
- rules: {
82432
- schema: RuleBodySchema,
82433
- class: "config",
82434
- writeTrigger: "an operator creates, edits, enables/disables a rule or opts a target out of it; nothing writes on the evaluation path",
82435
- device: "none",
82436
- at: "none",
82437
- indexes: [{
82438
- name: "delivery",
82439
- fields: ["delivery"]
82440
- }],
82441
- retention: { none: "a row goes only when the operator deletes the rule; bounded by the rule set a human is willing to author" }
82442
- }
82443
- });
82444
- //#endregion
82445
82575
  //#region src/notification-center/sequence-store.ts
82446
82576
  /**
82447
82577
  * Shared action sequences for the notification centre.
@@ -87526,6 +87656,26 @@ var NcDispatcher = class {
87526
87656
  renderText(input) {
87527
87657
  return renderRowText(this.texts, input);
87528
87658
  }
87659
+ /** Rules already warned about a deprecated variable in this process — once each. */
87660
+ deprecatedVarWarned = /* @__PURE__ */ new Set();
87661
+ /**
87662
+ * A rule template written by an older client may still say `{{camera}}`. It
87663
+ * renders (the alias), and the rule is named once so the operator can edit it.
87664
+ */
87665
+ warnDeprecatedVars(entry) {
87666
+ if (this.deprecatedVarWarned.has(entry.ruleId)) return;
87667
+ const template = entry.payload.template;
87668
+ const used = [...new Set([...deprecatedPlaceholders(template?.title), ...deprecatedPlaceholders(template?.body)])];
87669
+ if (used.length === 0) return;
87670
+ this.deprecatedVarWarned.add(entry.ruleId);
87671
+ this.deps.logger.warn("rule template uses a renamed variable — it still renders, edit it to the new name", {
87672
+ tags: { ruleId: entry.ruleId },
87673
+ meta: {
87674
+ variables: used,
87675
+ replacement: "device"
87676
+ }
87677
+ });
87678
+ }
87529
87679
  /**
87530
87680
  * Builds the notification AND returns the artefact ids its media resolve
87531
87681
  * indexed — see {@link withArtifactUrls}. A tuple rather than a field on
@@ -87539,6 +87689,7 @@ var NcDispatcher = class {
87539
87689
  const alarmSource = systemEvent?.alarmSource;
87540
87690
  const zoneLabels = systemEvent === void 0 ? await resolveZoneLabels(this.deps.getZoneNames, subject.deviceId, subject.zones) : alarmSource?.zones !== void 0 && alarmSource.zones.length > 0 ? await resolveZoneLabels(this.deps.getZoneNames, alarmSource.deviceId, alarmSource.zones) : [];
87541
87691
  const vars = buildTemplateVars(this.texts, entry, deviceName, zoneLabels);
87692
+ this.warnDeprecatedVars(entry);
87542
87693
  const systemCount = systemEvent?.textCount !== void 0 ? { count: systemEvent.textCount } : {};
87543
87694
  const title = renderRowTitle(this.texts, entry, vars);
87544
87695
  const authoredBody = entry.payload.template?.body;
@@ -88653,15 +88804,15 @@ async function resolveZoneLabels(getZoneNames, deviceId, zoneIds) {
88653
88804
  function percentOf(confidence) {
88654
88805
  return confidence !== void 0 ? `${Math.round(confidence * 100)}%` : "";
88655
88806
  }
88656
- /** What `{{camera}}` renders on a system row that names no device. */
88807
+ /** What `{{device}}` renders on a system row that names no device. */
88657
88808
  var NC_DEVICELESS_CAMERA_NAME = "system";
88658
88809
  /**
88659
- * The name `{{camera}}` renders for a row — the ONE derivation, shared by the
88810
+ * The name `{{device}}` renders for a row — the ONE derivation, shared by the
88660
88811
  * dispatcher and the template-variable parity spec.
88661
88812
  *
88662
88813
  * A system row that names no device (a node, a backup, an update) renders the
88663
88814
  * filler {@link NC_DEVICELESS_CAMERA_NAME}: there is no camera to name, which
88664
- * is why the catalog offers `{{camera}}` on a system rule only for the kinds
88815
+ * is why the catalog offers `{{device}}` on a system rule only for the kinds
88665
88816
  * that carry a device (template-vars.ts). Everything else asks the directory,
88666
88817
  * and falls back to `camera <id>` when it cannot answer.
88667
88818
  */
@@ -88714,7 +88865,7 @@ function buildTemplateVars(texts, entry, deviceName, zoneLabels, timeZone) {
88714
88865
  const cameraName = deviceName.toLocaleLowerCase(locale);
88715
88866
  const zonesLower = zoneLabels.map((z) => z.toLocaleLowerCase(locale));
88716
88867
  return {
88717
- camera: cameraName,
88868
+ device: cameraName,
88718
88869
  class: detection?.className ?? (systemEvent !== void 0 ? "" : subject.className),
88719
88870
  classLabel: (() => {
88720
88871
  const wire = detection?.className ?? (systemEvent !== void 0 ? "" : subject.className);
@@ -96578,7 +96729,7 @@ function clockOf(atMs) {
96578
96729
  * catalog, the same way `buildTemplateVars` is asserted for rule rows. */
96579
96730
  function timelapseTemplateVars(input) {
96580
96731
  return {
96581
- camera: input.deviceName ?? `camera ${input.deviceId}`,
96732
+ device: input.deviceName ?? `camera ${input.deviceId}`,
96582
96733
  rule: input.ruleName,
96583
96734
  from: clockOf(input.window.startMs),
96584
96735
  to: clockOf(input.window.endMs),
@@ -96644,7 +96795,7 @@ function paramsFor(target, clickUrl) {
96644
96795
  */
96645
96796
  function timelapsePreviewText(input) {
96646
96797
  const vars = {
96647
- camera: input.deviceName ?? `camera ${input.deviceId}`,
96798
+ device: input.deviceName ?? `camera ${input.deviceId}`,
96648
96799
  ...input.ruleName !== void 0 ? { rule: input.ruleName } : {},
96649
96800
  ...input.window !== void 0 ? {
96650
96801
  from: clockOf(input.window.startMs),
@@ -104176,7 +104327,7 @@ function buildSnoozeDigest(texts, snooze, rows, deviceNames) {
104176
104327
  key: "snooze.digest.line",
104177
104328
  vars: {
104178
104329
  rule: r.ruleName,
104179
- camera: deviceNames.get(r.deviceId) ?? `camera ${r.deviceId}`,
104330
+ device: deviceNames.get(r.deviceId) ?? `camera ${r.deviceId}`,
104180
104331
  count: `${r.count}`
104181
104332
  }
104182
104333
  }));
@@ -122811,6 +122962,7 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends BaseAddon {
122811
122962
  return out;
122812
122963
  };
122813
122964
  await step("declareCollections", () => this.declareCollections(api));
122965
+ if (this.localOwnNodeId() === "hub") await step("migrations", () => this.runTemplateMigrations());
122814
122966
  this.armAlarmPanelDeclaration(api);
122815
122967
  const logger = this.ctx.logger;
122816
122968
  const storage = await step("resolveMediaStorage", () => this.resolveMediaStorage(logger));
@@ -123161,6 +123313,16 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends BaseAddon {
123161
123313
  });
123162
123314
  return this.collectionsBootInstance;
123163
123315
  }
123316
+ /** The addon's migration catalogue (D987), bound to the notification kinds. */
123317
+ async runTemplateMigrations() {
123318
+ const records = this.requireRecords();
123319
+ const ports = {
123320
+ rules: records.kind(ncRecordKinds["rules"]),
123321
+ timelapseRules: records.kind(ncRecordKinds["timelapse-rules"]),
123322
+ texts: records.kind(ncRecordKinds.texts)
123323
+ };
123324
+ await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, ports));
123325
+ }
123164
123326
  /** `declare-collections.ts` — declareCollections. */
123165
123327
  async declareCollections(api) {
123166
123328
  return this.collectionsBoot.declareCollections(api);