@camstack/addon-post-analysis 1.2.327 → 1.2.330

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.
@@ -11886,7 +11886,16 @@ var AutomationActionSchema = discriminatedUnion("kind", [
11886
11886
  }),
11887
11887
  object({
11888
11888
  kind: literal("cap"),
11889
- deviceId: union([number().int(), object({ $var: string().min(1) })]),
11889
+ /**
11890
+ * One device, several same-family devices (locks / climate family / …),
11891
+ * or `{ $var }` for the device that triggered the run. An array is
11892
+ * fan-out at codegen — each id gets the same cap.method call.
11893
+ */
11894
+ deviceId: union([
11895
+ number().int(),
11896
+ array(number().int()).min(1),
11897
+ object({ $var: string().min(1) })
11898
+ ]),
11890
11899
  cap: string().min(1),
11891
11900
  method: string().min(1),
11892
11901
  /** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
@@ -15164,7 +15173,7 @@ DeviceType.Camera;
15164
15173
  * This matters here more than anywhere else in the repo, because every provider
15165
15174
  * that knows a device's host knows its PASSWORD too: `{ host, port, username,
15166
15175
  * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
15167
- * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
15176
+ * and `http://admin:hunter2@192.168.x.x/` is a URL a browser accepts. The
15168
15177
  * camera's own page will ask for its own login. That is correct, and pre-
15169
15178
  * filling it is the operator's business, not ours.
15170
15179
  *
@@ -21977,17 +21986,41 @@ var NC_ALARM_TRIGGERED_MAX_SEC = 3600;
21977
21986
  var NcAlarmDelaySecSchema = number().int().min(0).max(600);
21978
21987
  var NcAlarmTriggeredSecSchema = number().int().min(0).max(NC_ALARM_TRIGGERED_MAX_SEC);
21979
21988
  var uniqueModes = (entries) => new Set(entries.map((e) => e.mode)).size === entries.length;
21989
+ /**
21990
+ * What the panel does when a bounded triggered window ends.
21991
+ * - `rearmAfter` — return to the armed mode
21992
+ * - `disableAfter` — auto-disarm
21993
+ * - `doNothing` — stay triggered until a human disarms
21994
+ */
21995
+ var NcAlarmPostTriggeredActionSchema = _enum([
21996
+ "rearmAfter",
21997
+ "disableAfter",
21998
+ "doNothing"
21999
+ ]);
21980
22000
  var NcAlarmModeDelaysListSchema = array(object({
21981
22001
  mode: AlarmArmModeSchema,
21982
22002
  exitDelaySec: NcAlarmDelaySecSchema.optional(),
21983
22003
  entryDelaySec: NcAlarmDelaySecSchema.optional(),
21984
- triggeredDurationSec: NcAlarmTriggeredSecSchema.optional()
22004
+ /**
22005
+ * Duration of `triggered` before {@link postTriggeredAction}. Kept as the
22006
+ * historical field name so older clients still read/write a number.
22007
+ */
22008
+ triggeredDurationSec: NcAlarmTriggeredSecSchema.optional(),
22009
+ postTriggeredAction: NcAlarmPostTriggeredActionSchema.optional(),
22010
+ /**
22011
+ * When this mode may be armed. Absent / null = always allowed (same as a
22012
+ * rule with no `schedule`). Evaluated with {@link isScheduleActive}.
22013
+ */
22014
+ schedule: NcScheduleSchema.optional()
21985
22015
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
21986
22016
  var NcAlarmModeDelaysEditListSchema = array(object({
21987
22017
  mode: AlarmArmModeSchema,
21988
22018
  exitDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
21989
22019
  entryDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
21990
- triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional()
22020
+ triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional(),
22021
+ postTriggeredAction: NcAlarmPostTriggeredActionSchema.nullable().optional(),
22022
+ /** Set a schedule, or `null` to clear (mode always allowed again). */
22023
+ schedule: NcScheduleSchema.nullable().optional()
21991
22024
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
21992
22025
  /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
21993
22026
  var NcAlarmNonBlockingEditSchema = object({
@@ -22059,12 +22092,18 @@ var NcAlarmSettingsSchema = object({
22059
22092
  /** Grace period between a trigger and the alarm firing. 0 = immediate. */
22060
22093
  entryDelaySec: NcAlarmDelaySecSchema,
22061
22094
  /**
22062
- * How long `triggered` lasts before the panel re-arms itself.
22063
- * **0 = until an operator disarms it** — the behaviour before this field
22064
- * existed, and therefore what an untouched install keeps doing.
22095
+ * How long `triggered` lasts before {@link postTriggeredAction} runs.
22096
+ * Ignored when the action is `doNothing`. Historical name kept so older
22097
+ * clients still round-trip a number.
22065
22098
  */
22066
22099
  triggeredDurationSec: NcAlarmTriggeredSecSchema,
22067
22100
  /**
22101
+ * What happens when the triggered window ends. Absent on a blob older than
22102
+ * this field → derived from {@link triggeredDurationSec} (`>0` ⇒ rearmAfter,
22103
+ * else doNothing).
22104
+ */
22105
+ postTriggeredAction: NcAlarmPostTriggeredActionSchema.optional(),
22106
+ /**
22068
22107
  * Deprecated by D630 — every transition is announced. Parsed, never read;
22069
22108
  * remove after one release. Optional so an older admin's patch (which still
22070
22109
  * sends it) parses rather than failing the whole save.
@@ -34618,7 +34657,7 @@ var LocalInterfaceSchema = object({
34618
34657
  name: string(),
34619
34658
  family: _enum(["IPv4", "IPv6"]),
34620
34659
  address: string(),
34621
- /** CIDR shorthand (e.g. `192.168.1.10/24`). Empty when OS doesn't expose. */
34660
+ /** CIDR shorthand (e.g. `192.168.x.x/24`). Empty when OS doesn't expose. */
34622
34661
  cidr: string(),
34623
34662
  /** OS netmask. Stable across calls so the SDK can hash on it. */
34624
34663
  netmask: string(),
@@ -35153,7 +35192,7 @@ var MeshPeerSchema = object({
35153
35192
  tags: array(string()).readonly(),
35154
35193
  /** True when the peer advertises itself as an exit-node candidate. */
35155
35194
  exitNodeOption: boolean(),
35156
- /** Subnet routes the peer advertises (e.g. `["192.168.1.0/24"]`). */
35195
+ /** Subnet routes the peer advertises (e.g. `["192.168.x.x/24"]`). */
35157
35196
  advertisedRoutes: array(string()).readonly(),
35158
35197
  /** Owner account login (e.g. `foo@example.com`). Null for tagged peers. */
35159
35198
  userLogin: string().nullable(),
@@ -50409,6 +50448,7 @@ Object.freeze({
50409
50448
  access: "create"
50410
50449
  }
50411
50450
  });
50451
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
50412
50452
  DeviceFeature.BatteryOperated;
50413
50453
  /**
50414
50454
  * The vocabulary, in the order a picker offers it.
@@ -54948,6 +54988,10 @@ function bindingPullsAlarmTrigger(binding, sequenceActionsOf) {
54948
54988
  if (steps === void 0) return false;
54949
54989
  return steps.some((step) => step.kind === "cap" && step.cap === ALARM_PANEL_CAP && step.method === ALARM_PANEL_TRIGGER_METHOD);
54950
54990
  }
54991
+ /** True when the rule's deviceState gate names any `armed_*` word. */
54992
+ function ruleGatedOnArmedState(rule) {
54993
+ return (rule.conditions.deviceState?.states ?? []).some((s) => s.trim().toLowerCase().startsWith(ARMED_WORD_PREFIX));
54994
+ }
54951
54995
  /**
54952
54996
  * A rule belongs to the alarm when its `deviceState` gate names ANY device's
54953
54997
  * `armed_*` word, or an on-match binding pulls the alarm panel's trigger
@@ -54955,10 +54999,19 @@ function bindingPullsAlarmTrigger(binding, sequenceActionsOf) {
54955
54999
  * escalation.
54956
55000
  */
54957
55001
  function ruleBelongsToAlarm(rule) {
54958
- if ((rule.conditions.deviceState?.states ?? []).some((s) => s.trim().toLowerCase().startsWith(ARMED_WORD_PREFIX))) return true;
55002
+ if (ruleGatedOnArmedState(rule)) return true;
54959
55003
  for (const binding of rule.actions?.onTrigger ?? []) if (bindingPullsAlarmTrigger(binding, rule.sequenceActionsOf)) return true;
54960
55004
  return false;
54961
55005
  }
55006
+ /**
55007
+ * A rule gated on `armed_*` auto-triggers the CamStack `alarm-panel` on match
55008
+ * — no `onTrigger` sequence required. Sirens are never part of this path.
55009
+ * An explicit `alarm-panel.trigger` binding without an armed gate stays
55010
+ * explicit actuation only ({@link ruleBelongsToAlarm}).
55011
+ */
55012
+ function ruleAutoTriggersAlarm(rule) {
55013
+ return ruleGatedOnArmedState(rule);
55014
+ }
54962
55015
  /** Whether this controllable should be closed/locked/turned off on arm. */
54963
55016
  function alarmDeviceSecureOnArm(input) {
54964
55017
  if (!input.controllable) return false;
@@ -54990,6 +55043,14 @@ var NC_ALARM_DELAY_FIELDS = [
54990
55043
  "entryDelaySec",
54991
55044
  "triggeredDurationSec"
54992
55045
  ];
55046
+ /**
55047
+ * Derive the post-triggered action from a stored blob that may predate the field:
55048
+ * a positive duration meant re-arm; zero/absent meant stay triggered.
55049
+ */
55050
+ function derivePostTriggeredAction(action, triggeredDurationSec) {
55051
+ if (action !== void 0) return action;
55052
+ return triggeredDurationSec > 0 ? "rearmAfter" : "doNothing";
55053
+ }
54993
55054
  /** The mode's value when it overrides the field, else the global one. */
54994
55055
  function pick(override, global) {
54995
55056
  return override === void 0 ? {
@@ -55006,14 +55067,19 @@ function resolveModeDelays(settings, mode) {
55006
55067
  const exit = pick(entry?.exitDelaySec, settings.exitDelaySec);
55007
55068
  const entryDelay = pick(entry?.entryDelaySec, settings.entryDelaySec);
55008
55069
  const triggered = pick(entry?.triggeredDurationSec, settings.triggeredDurationSec);
55070
+ const actionOverride = entry?.postTriggeredAction;
55071
+ const actionSource = actionOverride !== void 0 ? "mode" : "default";
55072
+ const postTriggeredAction = derivePostTriggeredAction(actionOverride ?? settings.postTriggeredAction, triggered.value);
55009
55073
  return {
55010
55074
  exitDelaySec: exit.value,
55011
55075
  entryDelaySec: entryDelay.value,
55012
55076
  triggeredDurationSec: triggered.value,
55077
+ postTriggeredAction,
55013
55078
  source: {
55014
55079
  exitDelaySec: exit.source,
55015
55080
  entryDelaySec: entryDelay.source,
55016
- triggeredDurationSec: triggered.source
55081
+ triggeredDurationSec: triggered.source,
55082
+ postTriggeredAction: actionSource
55017
55083
  }
55018
55084
  };
55019
55085
  }
@@ -55022,6 +55088,14 @@ function edited(current, edit) {
55022
55088
  if (edit === void 0) return current;
55023
55089
  return edit === null ? void 0 : edit;
55024
55090
  }
55091
+ function editedAction(current, edit) {
55092
+ if (edit === void 0) return current;
55093
+ return edit === null ? void 0 : edit;
55094
+ }
55095
+ function editedSchedule(current, edit) {
55096
+ if (edit === void 0) return current;
55097
+ return edit === null ? void 0 : edit;
55098
+ }
55025
55099
  /**
55026
55100
  * Apply per-field edits to the stored overrides. Returns new arrays, never mutates the input;
55027
55101
  * an entry with no field left is dropped (the mode inherits everything again).
@@ -55035,13 +55109,17 @@ function applyModeDelaysEdits(current, edits) {
55035
55109
  const exit = edited(base.exitDelaySec, edit.exitDelaySec);
55036
55110
  const entry = edited(base.entryDelaySec, edit.entryDelaySec);
55037
55111
  const triggered = edited(base.triggeredDurationSec, edit.triggeredDurationSec);
55112
+ const action = editedAction(base.postTriggeredAction, edit.postTriggeredAction);
55113
+ const schedule = editedSchedule(base.schedule, edit.schedule);
55038
55114
  if (exit !== void 0) next.exitDelaySec = exit;
55039
55115
  if (entry !== void 0) next.entryDelaySec = entry;
55040
55116
  if (triggered !== void 0) next.triggeredDurationSec = triggered;
55117
+ if (action !== void 0) next.postTriggeredAction = action;
55118
+ if (schedule !== void 0) next.schedule = schedule;
55041
55119
  if (at >= 0) out[at] = next;
55042
55120
  else out.push(next);
55043
55121
  }
55044
- return out.filter((e) => e.exitDelaySec !== void 0 || e.entryDelaySec !== void 0 || e.triggeredDurationSec !== void 0);
55122
+ return out.filter((e) => e.exitDelaySec !== void 0 || e.entryDelaySec !== void 0 || e.triggeredDurationSec !== void 0 || e.postTriggeredAction !== void 0 || e.schedule !== void 0);
55045
55123
  }
55046
55124
  /**
55047
55125
  * Put ONE device on, or take it off, ONE mode's device-id list. A no-op answers
@@ -55119,11 +55197,12 @@ function applySecureOnArmEdit(lists, edit) {
55119
55197
  /** Stable id of the always-present Default profile (migrated from flat settings). */
55120
55198
  var NC_ALARM_DEFAULT_PROFILE_ID = "default";
55121
55199
  var NC_ALARM_DEFAULT_PROFILE_NAME = "Default";
55122
- /** Stock delays — same numbers the panel shipped with before any editor existed. */
55200
+ /** Stock delays — re-arm 10 s after trigger (inherited by every mode). */
55123
55201
  var NC_ALARM_SYSTEM_DEFAULT_DELAYS = {
55124
55202
  exitDelaySec: 30,
55125
55203
  entryDelaySec: 20,
55126
- triggeredDurationSec: 0
55204
+ triggeredDurationSec: 10,
55205
+ postTriggeredAction: "rearmAfter"
55127
55206
  };
55128
55207
  /** Empty memberships + stock delays + no announce targets. */
55129
55208
  function ncAlarmSystemDefaultSettings() {
@@ -55145,6 +55224,7 @@ function cloneAlarmSettings(settings) {
55145
55224
  exitDelaySec: settings.exitDelaySec,
55146
55225
  entryDelaySec: settings.entryDelaySec,
55147
55226
  triggeredDurationSec: settings.triggeredDurationSec,
55227
+ ...settings.postTriggeredAction !== void 0 ? { postTriggeredAction: settings.postTriggeredAction } : {},
55148
55228
  ...settings.announceArm !== void 0 ? { announceArm: settings.announceArm } : {},
55149
55229
  announceTargets: [...settings.announceTargets],
55150
55230
  nonBlocking: settings.nonBlocking.map((l) => ({
@@ -55159,7 +55239,22 @@ function cloneAlarmSettings(settings) {
55159
55239
  mode: l.mode,
55160
55240
  deviceIds: [...l.deviceIds]
55161
55241
  })),
55162
- modeDelays: settings.modeDelays.map((e) => ({ ...e }))
55242
+ modeDelays: settings.modeDelays.map((e) => ({
55243
+ mode: e.mode,
55244
+ ...e.exitDelaySec !== void 0 ? { exitDelaySec: e.exitDelaySec } : {},
55245
+ ...e.entryDelaySec !== void 0 ? { entryDelaySec: e.entryDelaySec } : {},
55246
+ ...e.triggeredDurationSec !== void 0 ? { triggeredDurationSec: e.triggeredDurationSec } : {},
55247
+ ...e.postTriggeredAction !== void 0 ? { postTriggeredAction: e.postTriggeredAction } : {},
55248
+ ...e.schedule !== void 0 ? { schedule: {
55249
+ windows: e.schedule.windows.map((w) => ({
55250
+ days: [...w.days],
55251
+ startMinute: w.startMinute,
55252
+ endMinute: w.endMinute
55253
+ })),
55254
+ ...e.schedule.timezone !== void 0 ? { timezone: e.schedule.timezone } : {},
55255
+ ...e.schedule.invert === true ? { invert: true } : {}
55256
+ } } : {}
55257
+ }))
55163
55258
  };
55164
55259
  }
55165
55260
  /**
@@ -58115,4 +58210,4 @@ function buildClipModelRegistry(entries) {
58115
58210
  /** The built-in catalog's registry. */
58116
58211
  var BUILTIN_CLIP_MODELS = buildClipModelRegistry(CLIP_IMAGE_MODELS);
58117
58212
  //#endregion
58118
- export { NC_ALARM_DELAY_MAX_SEC as $, gifFromMp4Args as $n, DeviceType as $r, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS as $t, EMBEDDING_REQUIREMENTS_FAILED as A, audioMetricsCapability as An, ruleDeviceCompatCapQueries as Ar, NcRulePatchSchema as At, ListTrackRelationsInputSchema as B, describeSystemEventFamilyProblem as Bn, systemEventDeliveryProblems as Br, NcSystemEventKindSchema as Bt, DEFAULT_EVENT_COLOR as C, string as Ci, alarmDeviceSecureOnArm as Cn, readTimelapseGeneratedAt as Cr, NcAlarmSettingsPatchSchema as Ct, DeclaredDevices as D, unknown as Di, applyNonBlockingEdit as Dn, resolveModeDelays as Dr, NcRuleActionSchema as Dt, DETECTION_PIPELINE_CAP_NAME as E, union as Ei, applyModeDelaysEdits as En, resolveLocationMode as Er, NcLegacyRuleActionSequenceSchema as Et, EXPORT_DENSE_MAX_RANGES as F, cosineSimilarity as Fn, sensorRaisedOf as Fr, NcSharedSequenceSchema as Ft, MAX_BIRTH_LATENCY_PROXY_MS as G, embeddingRequirementsUnavailableError as Gn, templateCarriesSummary as Gr, OPS_LOG_DEFAULT_LIMIT as Gt, LockStateSchema as H, embeddingModelFailedError as Hn, systemEventFilterApplies as Hr, NcTemplatePreviewInputSchema as Ht, FIRST_LEVEL_MACRO_CLASSES as I, createAlarmProfile as In, servedTemplateVars as Ir, NcSnoozeInputSchema as It, MOTION_CLOSE_AFTER_MS as J, eventKindLabel as Jn, zoneAnalyticsCapability as Jr, RECORDING_EXPORT_MAX_READ_BYTES as Jt, MAX_TRACK_PURITIES as K, encodeVectorBase64 as Kn, templateVarsFor as Kr, OpsLogEntrySchema as Kt, FULL_IMAGE_BBOX as L, deleteAlarmProfile as Ln, storageOccupancyCapability as Lr, NcSnoozeSchema as Lt, EVENT_DENSITY_BATCH_MAX as M, buildEventKindDescriptor as Mn, ruleKindOf as Mr, NcRuleTargetSchema as Mt, EVENT_KIND_BY_CAP as N, cloneAlarmSettings as Nn, sceneMonitorCapability as Nr, NcRuleUpdateInputSchema as Nt, DetectionSourceSchema as O, EventCategory as Oi, applySecureOnArmEdit as On, resolvePoolMemoryPolicy as Or, NcRuleActionsSchema as Ot, EVENT_OWNER_TYPES as P, consumableLowPercentOf as Pn, secureActuationFor as Pr, NcScheduleSchema as Pt, NC_ALARM_DELAY_FIELDS as Q, gifDeriveSpeed as Qn, isSourceCap as Qr, SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX as Qt, FailureCounters as R, deriveRecordingMode as Rn, subKindsOf as Rr, NcSnoozeSuppressedSchema as Rt, CoverStateSchema as S, strictObject as Si, addonWidgetsSourceCapability as Sn, readMotionTriggeredBy as Sr, NcAlarmSensorsSchema as St, DETECTION_MACRO_CLASSES as T, tuple as Ti, applyBlockingEdit as Tn, resolveClipSearchMinScore as Tr, NcConditionsSchema as Tt, MAX_ARCHIVED_DEBUG_NOTES as U, embeddingRefusalOf as Un, systemEventSummaryScheduleOf as Ur, NcTemplatePreviewSchema as Ut, ListTrackRelationsResultSchema as V, embeddingEncoderCapability as Vn, systemEventFamilyProblems as Vr, NcTaxonomySchema as Vt, MAX_BIRTH_DECISION_RECORDS as W, embeddingRequirementsFailedError as Wn, systemEventSummarySplitOf as Wr, NcTemplateVarDescriptorSchema as Wt, MotionTriggeredBySchema as X, faceGalleryCapability as Xn, canonicalHash as Xr, RebuildObjectEmbeddingsRefusalSchema as Xt, MediaFileKindEnum as Y, evictionPolicyOfLocation as Yn, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Yr, RECORDING_SOURCE_CAMSTACK_ADDON as Yt, NC_ALARM_DEFAULT_PROFILE_ID as Z, failureContributionCapability as Zn, evaluateSensorEdge as Zr, RetrainStatusSchema as Zt, BaseDevice as _, looseObject as _i, TrackRelationKindSchema as _n, occupancyScope as _r, NC_TANK_SYSTEM_EVENT_KINDS as _t, CLIP_EMBEDDING_STEP_ID as a, defineCustomActions as ai, SCENE_DIVERGED as an, isEventOwnerType as ar, NC_CLIP_PRE_ROLL_DEFAULT_SEC as at, ClearTrackRelationInputSchema as b, partialRecord as bi, TrackSourceSchema as bn, plateGalleryCapability as br, NcAlarmConfigSchema as bt, resolveClusterModelPin as c, nodePin as ci, SetTrackPurityInputSchema as cn, isRetiredClearKey as cr, NC_CONSUMABLE_LOW_PERCENT_DEFAULT as ct, APPEARANCE_RESOLVES_AMBIGUITY_DEFAULT as d, ZodObject as di, TIMELAPSE_DENSE_FLOOR_SEC as dn, isSystemEventSummaryRule as dr, NC_GROUPING_DEFAULT_SEC as dt, errMsg as ei, SCENE_DEFAULT_ANCHOR_THRESHOLD as en, isAlarmControllableCap as er, NC_ALARM_SYSTEM_EVENT_KINDS as et, ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT as f, _enum as fi, TRACK_RELATIONS_DEFAULT_LIMIT as fn, isVectorIndexDimConflict as fr, NC_GROUPING_MAX_SEC as ft, BIRTH_DECISION_DEFAULT_LIMIT as g, literal as gi, TrackPuritySchema as gn, notificationRulesCapability as gr, NC_SYSTEM_EVENT_KIND_GROUP_SPECS as gt, ArchivedDebugNoteSchema as h, discriminatedUnion as hi, TimelapseRuleSchema as hn, memoizePinnedFfmpeg as hr, NC_SNOOZE_MAX_MINUTES as ht, CLIP_TEXT_MODELS as i, customAction as ii, SCENE_DEFAULT_UNCOVERED_POLICY as in, isEventKindLabelKey as ir, NC_CLIP_POST_ROLL_DEFAULT_SEC as it, EMBEDDING_REQUIREMENTS_UNAVAILABLE as j, audioModeOf as jn, ruleGroupingApplies as jr, NcRuleSchema as jt, EMBEDDING_MODEL_FAILED as k, assertTimelapseCadences as kn, ruleBelongsToAlarm as kr, NcRuleInputSchema as kt, APPEARANCE_BIN_COUNT as l, normalizeNodeId as li, SetTrackPurityResultSchema as ln, isScheduleActive as lr, NC_CONSUMABLE_SYSTEM_EVENT_KINDS as lt, AlarmArmModeSchema as m, boolean as mi, TimelapseRulePatchSchema as mn, mayWriteToLocation as mr, NC_SENSOR_TRANSITION_KINDS as mt, DEFAULT_CLIP_MODEL as n, CamProfileSchema as ni, SCENE_DEFAULT_OBSERVATION_SPACING_SEC as nn, isDefaultAlarmProfileId as nr, NC_AUDIO_CONFIRM_HITS_DEFAULT as nt, FACE_EMBEDDING_STEP_ID as o, hydrateSchema as oi, SCENE_RESET_RECAPTURES as on, isKnownTemplateVar as or, NC_CLIP_RETENTION_MAX_SEC as ot, AUDIO_MACRO_LABELS as p, array as pi, TimelapseRuleInputSchema as pn, kebabToCamel as pr, NC_GROUPING_MIN_SEC as pt, MAX_TRACK_RELATIONS as q, ensureAlarmProfiles as qn, vectorDimFromBase64 as qr, PoolMemoryWatchdog as qt, CLIP_IMAGE_MODELS as r, createEvent as ri, SCENE_DEFAULT_QUIET_SECONDS as rn, isDetectionMacroClass as rr, NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT as rt, readClusterModelPinStrict as s, isDeviceScopedCap as si, SceneMonitorSchema as sn, isMediaOwnerType as sr, NC_CONDITION_CATALOG as st, BUILTIN_CLIP_MODELS as t, BaseAddon as ti, SCENE_DEFAULT_CHECK_INTERVAL_SEC as tn, isAudioClassName as tr, NC_ALARM_TRIGGERED_MAX_SEC as tt, APPEARANCE_BLOCKS as u, sleep as ui, SetTrackRelationInputSchema as un, isSystemDelivery as ur, NC_DEFAULT_SNOOZE_MINUTES as ut, BirthDecisionRecordSchema as v, number as vi, TrackRelationSchema as vn, parseProcStatus as vr, NC_TAXONOMY as vt, DEFAULT_TIMELAPSE_PREVIEW_TEXT as w, templateLiteral as wi, alarmPanelCapability as wn, renameAlarmProfile as wr, NcConditionDescriptorSchema as wt, ClearTrackRelationResultSchema as x, record as xi, activateAlarmProfile as xn, readDeviceStateFrom as xr, NcAlarmSensorsInputSchema as xt, COCO_TO_MACRO as y, object as yi, TrackSideSchema as yn, pipelineAnalyticsCapability as yr, NC_TEMPLATE_VARS as yt, LabelAttributionSchema as z, describeSystemEventDeliveryProblem as zn, syncActiveAlarmProfileSettings as zr, NcStateSummarySectionIdSchema as zt };
58213
+ export { NC_ALARM_DELAY_MAX_SEC as $, failureContributionCapability as $n, canonicalHash as $r, SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX as $t, EMBEDDING_REQUIREMENTS_FAILED as A, unknown as Ai, assertTimelapseCadences as An, resolvePoolMemoryPolicy as Ar, NcRuleInputSchema as At, ListTrackRelationsInputSchema as B, deriveRecordingMode as Bn, storageOccupancyCapability as Br, NcStateSummarySectionIdSchema as Bt, DEFAULT_EVENT_COLOR as C, partialRecord as Ci, addonWidgetsSourceCapability as Cn, readDeviceStateFrom as Cr, NcAlarmSensorsSchema as Ct, DeclaredDevices as D, templateLiteral as Di, applyModeDelaysEdits as Dn, resolveClipSearchMinScore as Dr, NcLegacyRuleActionSequenceSchema as Dt, DETECTION_PIPELINE_CAP_NAME as E, string as Ei, applyBlockingEdit as En, renameAlarmProfile as Er, NcConditionsSchema as Et, EXPORT_DENSE_MAX_RANGES as F, consumableLowPercentOf as Fn, ruleKindOf as Fr, NcScheduleSchema as Ft, MAX_BIRTH_LATENCY_PROXY_MS as G, embeddingRefusalOf as Gn, systemEventFilterApplies as Gr, NcTemplateVarDescriptorSchema as Gt, LockStateSchema as H, describeSystemEventFamilyProblem as Hn, syncActiveAlarmProfileSettings as Hr, NcTaxonomySchema as Ht, FIRST_LEVEL_MACRO_CLASSES as I, cosineSimilarity as In, sceneMonitorCapability as Ir, NcSharedSequenceSchema as It, MOTION_CLOSE_AFTER_MS as J, encodeVectorBase64 as Jn, templateCarriesSummary as Jr, PoolMemoryWatchdog as Jt, MAX_TRACK_PURITIES as K, embeddingRequirementsFailedError as Kn, systemEventSummaryScheduleOf as Kr, OPS_LOG_DEFAULT_LIMIT as Kt, FULL_IMAGE_BBOX as L, createAlarmProfile as Ln, secureActuationFor as Lr, NcSnoozeInputSchema as Lt, EVENT_DENSITY_BATCH_MAX as M, audioModeOf as Mn, ruleBelongsToAlarm as Mr, NcRuleSchema as Mt, EVENT_KIND_BY_CAP as N, buildEventKindDescriptor as Nn, ruleDeviceCompatCapQueries as Nr, NcRuleTargetSchema as Nt, DetectionSourceSchema as O, tuple as Oi, applyNonBlockingEdit as On, resolveLocationMode as Or, NcRuleActionSchema as Ot, EVENT_OWNER_TYPES as P, cloneAlarmSettings as Pn, ruleGroupingApplies as Pr, NcRuleUpdateInputSchema as Pt, NC_ALARM_DELAY_FIELDS as Q, faceGalleryCapability as Qn, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Qr, RetrainStatusSchema as Qt, FailureCounters as R, deleteAlarmProfile as Rn, sensorRaisedOf as Rr, NcSnoozeSchema as Rt, CoverStateSchema as S, object as Si, activateAlarmProfile as Sn, plateGalleryCapability as Sr, NcAlarmSensorsInputSchema as St, DETECTION_MACRO_CLASSES as T, strictObject as Ti, alarmPanelCapability as Tn, readTimelapseGeneratedAt as Tr, NcConditionDescriptorSchema as Tt, MAX_ARCHIVED_DEBUG_NOTES as U, embeddingEncoderCapability as Un, systemEventDeliveryProblems as Ur, NcTemplatePreviewInputSchema as Ut, ListTrackRelationsResultSchema as V, describeSystemEventDeliveryProblem as Vn, subKindsOf as Vr, NcSystemEventKindSchema as Vt, MAX_BIRTH_DECISION_RECORDS as W, embeddingModelFailedError as Wn, systemEventFamilyProblems as Wr, NcTemplatePreviewSchema as Wt, MotionTriggeredBySchema as X, eventKindLabel as Xn, vectorDimFromBase64 as Xr, RECORDING_SOURCE_CAMSTACK_ADDON as Xt, MediaFileKindEnum as Y, ensureAlarmProfiles as Yn, templateVarsFor as Yr, RECORDING_EXPORT_MAX_READ_BYTES as Yt, NC_ALARM_DEFAULT_PROFILE_ID as Z, evictionPolicyOfLocation as Zn, zoneAnalyticsCapability as Zr, RebuildObjectEmbeddingsRefusalSchema as Zt, BaseDevice as _, boolean as _i, TrackPuritySchema as _n, memoizePinnedFfmpeg as _r, NC_TANK_SYSTEM_EVENT_KINDS as _t, CLIP_EMBEDDING_STEP_ID as a, CamProfileSchema as ai, SCENE_DEFAULT_UNCOVERED_POLICY as an, isDetectionMacroClass as ar, NC_CLIP_PRE_ROLL_DEFAULT_SEC as at, ClearTrackRelationInputSchema as b, looseObject as bi, TrackSideSchema as bn, parseProcStatus as br, NcAlarmConfigSchema as bt, resolveClusterModelPin as c, defineCustomActions as ci, SceneMonitorSchema as cn, isKnownTemplateVar as cr, NC_CONSUMABLE_LOW_PERCENT_DEFAULT as ct, APPEARANCE_RESOLVES_AMBIGUITY_DEFAULT as d, nodePin as di, SetTrackRelationInputSchema as dn, isScheduleActive as dr, NC_GROUPING_DEFAULT_SEC as dt, evaluateSensorEdge as ei, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS as en, gifDeriveSpeed as er, NC_ALARM_SYSTEM_EVENT_KINDS as et, ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT as f, normalizeNodeId as fi, TIMELAPSE_DENSE_FLOOR_SEC as fn, isSystemDelivery as fr, NC_GROUPING_MAX_SEC as ft, BIRTH_DECISION_DEFAULT_LIMIT as g, array as gi, TimelapseRuleSchema as gn, mayWriteToLocation as gr, NC_SYSTEM_EVENT_KIND_GROUP_SPECS as gt, ArchivedDebugNoteSchema as h, _enum as hi, TimelapseRulePatchSchema as hn, kebabToCamel as hr, NC_SNOOZE_MAX_MINUTES as ht, CLIP_TEXT_MODELS as i, BaseAddon as ii, SCENE_DEFAULT_QUIET_SECONDS as in, isDefaultAlarmProfileId as ir, NC_CLIP_POST_ROLL_DEFAULT_SEC as it, EMBEDDING_REQUIREMENTS_UNAVAILABLE as j, EventCategory as ji, audioMetricsCapability as jn, ruleAutoTriggersAlarm as jr, NcRulePatchSchema as jt, EMBEDDING_MODEL_FAILED as k, union as ki, applySecureOnArmEdit as kn, resolveModeDelays as kr, NcRuleActionsSchema as kt, APPEARANCE_BIN_COUNT as l, hydrateSchema as li, SetTrackPurityInputSchema as ln, isMediaOwnerType as lr, NC_CONSUMABLE_SYSTEM_EVENT_KINDS as lt, AlarmArmModeSchema as m, ZodObject as mi, TimelapseRuleInputSchema as mn, isVectorIndexDimConflict as mr, NC_SENSOR_TRANSITION_KINDS as mt, DEFAULT_CLIP_MODEL as n, DeviceType as ni, SCENE_DEFAULT_CHECK_INTERVAL_SEC as nn, isAlarmControllableCap as nr, NC_AUDIO_CONFIRM_HITS_DEFAULT as nt, FACE_EMBEDDING_STEP_ID as o, createEvent as oi, SCENE_DIVERGED as on, isEventKindLabelKey as or, NC_CLIP_RETENTION_MAX_SEC as ot, AUDIO_MACRO_LABELS as p, sleep as pi, TRACK_RELATIONS_DEFAULT_LIMIT as pn, isSystemEventSummaryRule as pr, NC_GROUPING_MIN_SEC as pt, MAX_TRACK_RELATIONS as q, embeddingRequirementsUnavailableError as qn, systemEventSummarySplitOf as qr, OpsLogEntrySchema as qt, CLIP_IMAGE_MODELS as r, errMsg as ri, SCENE_DEFAULT_OBSERVATION_SPACING_SEC as rn, isAudioClassName as rr, NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT as rt, readClusterModelPinStrict as s, customAction as si, SCENE_RESET_RECAPTURES as sn, isEventOwnerType as sr, NC_CONDITION_CATALOG as st, BUILTIN_CLIP_MODELS as t, isSourceCap as ti, SCENE_DEFAULT_ANCHOR_THRESHOLD as tn, gifFromMp4Args as tr, NC_ALARM_TRIGGERED_MAX_SEC as tt, APPEARANCE_BLOCKS as u, isDeviceScopedCap as ui, SetTrackPurityResultSchema as un, isRetiredClearKey as ur, NC_DEFAULT_SNOOZE_MINUTES as ut, BirthDecisionRecordSchema as v, discriminatedUnion as vi, TrackRelationKindSchema as vn, notificationRulesCapability as vr, NC_TAXONOMY as vt, DEFAULT_TIMELAPSE_PREVIEW_TEXT as w, record as wi, alarmDeviceSecureOnArm as wn, readMotionTriggeredBy as wr, NcAlarmSettingsPatchSchema as wt, ClearTrackRelationResultSchema as x, number as xi, TrackSourceSchema as xn, pipelineAnalyticsCapability as xr, NcAlarmPostTriggeredActionSchema as xt, COCO_TO_MACRO as y, literal as yi, TrackRelationSchema as yn, occupancyScope as yr, NC_TEMPLATE_VARS as yt, LabelAttributionSchema as z, derivePostTriggeredAction as zn, servedTemplateVars as zr, NcSnoozeSuppressedSchema as zt };
@@ -11917,7 +11917,16 @@ var AutomationActionSchema = discriminatedUnion("kind", [
11917
11917
  }),
11918
11918
  object({
11919
11919
  kind: literal("cap"),
11920
- deviceId: union([number().int(), object({ $var: string().min(1) })]),
11920
+ /**
11921
+ * One device, several same-family devices (locks / climate family / …),
11922
+ * or `{ $var }` for the device that triggered the run. An array is
11923
+ * fan-out at codegen — each id gets the same cap.method call.
11924
+ */
11925
+ deviceId: union([
11926
+ number().int(),
11927
+ array(number().int()).min(1),
11928
+ object({ $var: string().min(1) })
11929
+ ]),
11921
11930
  cap: string().min(1),
11922
11931
  method: string().min(1),
11923
11932
  /** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
@@ -15195,7 +15204,7 @@ DeviceType.Camera;
15195
15204
  * This matters here more than anywhere else in the repo, because every provider
15196
15205
  * that knows a device's host knows its PASSWORD too: `{ host, port, username,
15197
15206
  * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
15198
- * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
15207
+ * and `http://admin:hunter2@192.168.x.x/` is a URL a browser accepts. The
15199
15208
  * camera's own page will ask for its own login. That is correct, and pre-
15200
15209
  * filling it is the operator's business, not ours.
15201
15210
  *
@@ -22008,17 +22017,41 @@ var NC_ALARM_TRIGGERED_MAX_SEC = 3600;
22008
22017
  var NcAlarmDelaySecSchema = number().int().min(0).max(600);
22009
22018
  var NcAlarmTriggeredSecSchema = number().int().min(0).max(NC_ALARM_TRIGGERED_MAX_SEC);
22010
22019
  var uniqueModes = (entries) => new Set(entries.map((e) => e.mode)).size === entries.length;
22020
+ /**
22021
+ * What the panel does when a bounded triggered window ends.
22022
+ * - `rearmAfter` — return to the armed mode
22023
+ * - `disableAfter` — auto-disarm
22024
+ * - `doNothing` — stay triggered until a human disarms
22025
+ */
22026
+ var NcAlarmPostTriggeredActionSchema = _enum([
22027
+ "rearmAfter",
22028
+ "disableAfter",
22029
+ "doNothing"
22030
+ ]);
22011
22031
  var NcAlarmModeDelaysListSchema = array(object({
22012
22032
  mode: AlarmArmModeSchema,
22013
22033
  exitDelaySec: NcAlarmDelaySecSchema.optional(),
22014
22034
  entryDelaySec: NcAlarmDelaySecSchema.optional(),
22015
- triggeredDurationSec: NcAlarmTriggeredSecSchema.optional()
22035
+ /**
22036
+ * Duration of `triggered` before {@link postTriggeredAction}. Kept as the
22037
+ * historical field name so older clients still read/write a number.
22038
+ */
22039
+ triggeredDurationSec: NcAlarmTriggeredSecSchema.optional(),
22040
+ postTriggeredAction: NcAlarmPostTriggeredActionSchema.optional(),
22041
+ /**
22042
+ * When this mode may be armed. Absent / null = always allowed (same as a
22043
+ * rule with no `schedule`). Evaluated with {@link isScheduleActive}.
22044
+ */
22045
+ schedule: NcScheduleSchema.optional()
22016
22046
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
22017
22047
  var NcAlarmModeDelaysEditListSchema = array(object({
22018
22048
  mode: AlarmArmModeSchema,
22019
22049
  exitDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
22020
22050
  entryDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
22021
- triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional()
22051
+ triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional(),
22052
+ postTriggeredAction: NcAlarmPostTriggeredActionSchema.nullable().optional(),
22053
+ /** Set a schedule, or `null` to clear (mode always allowed again). */
22054
+ schedule: NcScheduleSchema.nullable().optional()
22022
22055
  })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
22023
22056
  /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
22024
22057
  var NcAlarmNonBlockingEditSchema = object({
@@ -22090,12 +22123,18 @@ var NcAlarmSettingsSchema = object({
22090
22123
  /** Grace period between a trigger and the alarm firing. 0 = immediate. */
22091
22124
  entryDelaySec: NcAlarmDelaySecSchema,
22092
22125
  /**
22093
- * How long `triggered` lasts before the panel re-arms itself.
22094
- * **0 = until an operator disarms it** — the behaviour before this field
22095
- * existed, and therefore what an untouched install keeps doing.
22126
+ * How long `triggered` lasts before {@link postTriggeredAction} runs.
22127
+ * Ignored when the action is `doNothing`. Historical name kept so older
22128
+ * clients still round-trip a number.
22096
22129
  */
22097
22130
  triggeredDurationSec: NcAlarmTriggeredSecSchema,
22098
22131
  /**
22132
+ * What happens when the triggered window ends. Absent on a blob older than
22133
+ * this field → derived from {@link triggeredDurationSec} (`>0` ⇒ rearmAfter,
22134
+ * else doNothing).
22135
+ */
22136
+ postTriggeredAction: NcAlarmPostTriggeredActionSchema.optional(),
22137
+ /**
22099
22138
  * Deprecated by D630 — every transition is announced. Parsed, never read;
22100
22139
  * remove after one release. Optional so an older admin's patch (which still
22101
22140
  * sends it) parses rather than failing the whole save.
@@ -34649,7 +34688,7 @@ var LocalInterfaceSchema = object({
34649
34688
  name: string(),
34650
34689
  family: _enum(["IPv4", "IPv6"]),
34651
34690
  address: string(),
34652
- /** CIDR shorthand (e.g. `192.168.1.10/24`). Empty when OS doesn't expose. */
34691
+ /** CIDR shorthand (e.g. `192.168.x.x/24`). Empty when OS doesn't expose. */
34653
34692
  cidr: string(),
34654
34693
  /** OS netmask. Stable across calls so the SDK can hash on it. */
34655
34694
  netmask: string(),
@@ -35184,7 +35223,7 @@ var MeshPeerSchema = object({
35184
35223
  tags: array(string()).readonly(),
35185
35224
  /** True when the peer advertises itself as an exit-node candidate. */
35186
35225
  exitNodeOption: boolean(),
35187
- /** Subnet routes the peer advertises (e.g. `["192.168.1.0/24"]`). */
35226
+ /** Subnet routes the peer advertises (e.g. `["192.168.x.x/24"]`). */
35188
35227
  advertisedRoutes: array(string()).readonly(),
35189
35228
  /** Owner account login (e.g. `foo@example.com`). Null for tagged peers. */
35190
35229
  userLogin: string().nullable(),
@@ -50440,6 +50479,7 @@ Object.freeze({
50440
50479
  access: "create"
50441
50480
  }
50442
50481
  });
50482
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
50443
50483
  DeviceFeature.BatteryOperated;
50444
50484
  /**
50445
50485
  * The vocabulary, in the order a picker offers it.
@@ -54979,6 +55019,10 @@ function bindingPullsAlarmTrigger(binding, sequenceActionsOf) {
54979
55019
  if (steps === void 0) return false;
54980
55020
  return steps.some((step) => step.kind === "cap" && step.cap === ALARM_PANEL_CAP && step.method === ALARM_PANEL_TRIGGER_METHOD);
54981
55021
  }
55022
+ /** True when the rule's deviceState gate names any `armed_*` word. */
55023
+ function ruleGatedOnArmedState(rule) {
55024
+ return (rule.conditions.deviceState?.states ?? []).some((s) => s.trim().toLowerCase().startsWith(ARMED_WORD_PREFIX));
55025
+ }
54982
55026
  /**
54983
55027
  * A rule belongs to the alarm when its `deviceState` gate names ANY device's
54984
55028
  * `armed_*` word, or an on-match binding pulls the alarm panel's trigger
@@ -54986,10 +55030,19 @@ function bindingPullsAlarmTrigger(binding, sequenceActionsOf) {
54986
55030
  * escalation.
54987
55031
  */
54988
55032
  function ruleBelongsToAlarm(rule) {
54989
- if ((rule.conditions.deviceState?.states ?? []).some((s) => s.trim().toLowerCase().startsWith(ARMED_WORD_PREFIX))) return true;
55033
+ if (ruleGatedOnArmedState(rule)) return true;
54990
55034
  for (const binding of rule.actions?.onTrigger ?? []) if (bindingPullsAlarmTrigger(binding, rule.sequenceActionsOf)) return true;
54991
55035
  return false;
54992
55036
  }
55037
+ /**
55038
+ * A rule gated on `armed_*` auto-triggers the CamStack `alarm-panel` on match
55039
+ * — no `onTrigger` sequence required. Sirens are never part of this path.
55040
+ * An explicit `alarm-panel.trigger` binding without an armed gate stays
55041
+ * explicit actuation only ({@link ruleBelongsToAlarm}).
55042
+ */
55043
+ function ruleAutoTriggersAlarm(rule) {
55044
+ return ruleGatedOnArmedState(rule);
55045
+ }
54993
55046
  /** Whether this controllable should be closed/locked/turned off on arm. */
54994
55047
  function alarmDeviceSecureOnArm(input) {
54995
55048
  if (!input.controllable) return false;
@@ -55021,6 +55074,14 @@ var NC_ALARM_DELAY_FIELDS = [
55021
55074
  "entryDelaySec",
55022
55075
  "triggeredDurationSec"
55023
55076
  ];
55077
+ /**
55078
+ * Derive the post-triggered action from a stored blob that may predate the field:
55079
+ * a positive duration meant re-arm; zero/absent meant stay triggered.
55080
+ */
55081
+ function derivePostTriggeredAction(action, triggeredDurationSec) {
55082
+ if (action !== void 0) return action;
55083
+ return triggeredDurationSec > 0 ? "rearmAfter" : "doNothing";
55084
+ }
55024
55085
  /** The mode's value when it overrides the field, else the global one. */
55025
55086
  function pick(override, global) {
55026
55087
  return override === void 0 ? {
@@ -55037,14 +55098,19 @@ function resolveModeDelays(settings, mode) {
55037
55098
  const exit = pick(entry?.exitDelaySec, settings.exitDelaySec);
55038
55099
  const entryDelay = pick(entry?.entryDelaySec, settings.entryDelaySec);
55039
55100
  const triggered = pick(entry?.triggeredDurationSec, settings.triggeredDurationSec);
55101
+ const actionOverride = entry?.postTriggeredAction;
55102
+ const actionSource = actionOverride !== void 0 ? "mode" : "default";
55103
+ const postTriggeredAction = derivePostTriggeredAction(actionOverride ?? settings.postTriggeredAction, triggered.value);
55040
55104
  return {
55041
55105
  exitDelaySec: exit.value,
55042
55106
  entryDelaySec: entryDelay.value,
55043
55107
  triggeredDurationSec: triggered.value,
55108
+ postTriggeredAction,
55044
55109
  source: {
55045
55110
  exitDelaySec: exit.source,
55046
55111
  entryDelaySec: entryDelay.source,
55047
- triggeredDurationSec: triggered.source
55112
+ triggeredDurationSec: triggered.source,
55113
+ postTriggeredAction: actionSource
55048
55114
  }
55049
55115
  };
55050
55116
  }
@@ -55053,6 +55119,14 @@ function edited(current, edit) {
55053
55119
  if (edit === void 0) return current;
55054
55120
  return edit === null ? void 0 : edit;
55055
55121
  }
55122
+ function editedAction(current, edit) {
55123
+ if (edit === void 0) return current;
55124
+ return edit === null ? void 0 : edit;
55125
+ }
55126
+ function editedSchedule(current, edit) {
55127
+ if (edit === void 0) return current;
55128
+ return edit === null ? void 0 : edit;
55129
+ }
55056
55130
  /**
55057
55131
  * Apply per-field edits to the stored overrides. Returns new arrays, never mutates the input;
55058
55132
  * an entry with no field left is dropped (the mode inherits everything again).
@@ -55066,13 +55140,17 @@ function applyModeDelaysEdits(current, edits) {
55066
55140
  const exit = edited(base.exitDelaySec, edit.exitDelaySec);
55067
55141
  const entry = edited(base.entryDelaySec, edit.entryDelaySec);
55068
55142
  const triggered = edited(base.triggeredDurationSec, edit.triggeredDurationSec);
55143
+ const action = editedAction(base.postTriggeredAction, edit.postTriggeredAction);
55144
+ const schedule = editedSchedule(base.schedule, edit.schedule);
55069
55145
  if (exit !== void 0) next.exitDelaySec = exit;
55070
55146
  if (entry !== void 0) next.entryDelaySec = entry;
55071
55147
  if (triggered !== void 0) next.triggeredDurationSec = triggered;
55148
+ if (action !== void 0) next.postTriggeredAction = action;
55149
+ if (schedule !== void 0) next.schedule = schedule;
55072
55150
  if (at >= 0) out[at] = next;
55073
55151
  else out.push(next);
55074
55152
  }
55075
- return out.filter((e) => e.exitDelaySec !== void 0 || e.entryDelaySec !== void 0 || e.triggeredDurationSec !== void 0);
55153
+ return out.filter((e) => e.exitDelaySec !== void 0 || e.entryDelaySec !== void 0 || e.triggeredDurationSec !== void 0 || e.postTriggeredAction !== void 0 || e.schedule !== void 0);
55076
55154
  }
55077
55155
  /**
55078
55156
  * Put ONE device on, or take it off, ONE mode's device-id list. A no-op answers
@@ -55150,11 +55228,12 @@ function applySecureOnArmEdit(lists, edit) {
55150
55228
  /** Stable id of the always-present Default profile (migrated from flat settings). */
55151
55229
  var NC_ALARM_DEFAULT_PROFILE_ID = "default";
55152
55230
  var NC_ALARM_DEFAULT_PROFILE_NAME = "Default";
55153
- /** Stock delays — same numbers the panel shipped with before any editor existed. */
55231
+ /** Stock delays — re-arm 10 s after trigger (inherited by every mode). */
55154
55232
  var NC_ALARM_SYSTEM_DEFAULT_DELAYS = {
55155
55233
  exitDelaySec: 30,
55156
55234
  entryDelaySec: 20,
55157
- triggeredDurationSec: 0
55235
+ triggeredDurationSec: 10,
55236
+ postTriggeredAction: "rearmAfter"
55158
55237
  };
55159
55238
  /** Empty memberships + stock delays + no announce targets. */
55160
55239
  function ncAlarmSystemDefaultSettings() {
@@ -55176,6 +55255,7 @@ function cloneAlarmSettings(settings) {
55176
55255
  exitDelaySec: settings.exitDelaySec,
55177
55256
  entryDelaySec: settings.entryDelaySec,
55178
55257
  triggeredDurationSec: settings.triggeredDurationSec,
55258
+ ...settings.postTriggeredAction !== void 0 ? { postTriggeredAction: settings.postTriggeredAction } : {},
55179
55259
  ...settings.announceArm !== void 0 ? { announceArm: settings.announceArm } : {},
55180
55260
  announceTargets: [...settings.announceTargets],
55181
55261
  nonBlocking: settings.nonBlocking.map((l) => ({
@@ -55190,7 +55270,22 @@ function cloneAlarmSettings(settings) {
55190
55270
  mode: l.mode,
55191
55271
  deviceIds: [...l.deviceIds]
55192
55272
  })),
55193
- modeDelays: settings.modeDelays.map((e) => ({ ...e }))
55273
+ modeDelays: settings.modeDelays.map((e) => ({
55274
+ mode: e.mode,
55275
+ ...e.exitDelaySec !== void 0 ? { exitDelaySec: e.exitDelaySec } : {},
55276
+ ...e.entryDelaySec !== void 0 ? { entryDelaySec: e.entryDelaySec } : {},
55277
+ ...e.triggeredDurationSec !== void 0 ? { triggeredDurationSec: e.triggeredDurationSec } : {},
55278
+ ...e.postTriggeredAction !== void 0 ? { postTriggeredAction: e.postTriggeredAction } : {},
55279
+ ...e.schedule !== void 0 ? { schedule: {
55280
+ windows: e.schedule.windows.map((w) => ({
55281
+ days: [...w.days],
55282
+ startMinute: w.startMinute,
55283
+ endMinute: w.endMinute
55284
+ })),
55285
+ ...e.schedule.timezone !== void 0 ? { timezone: e.schedule.timezone } : {},
55286
+ ...e.schedule.invert === true ? { invert: true } : {}
55287
+ } } : {}
55288
+ }))
55194
55289
  };
55195
55290
  }
55196
55291
  /**
@@ -58608,6 +58703,12 @@ Object.defineProperty(exports, "NcAlarmConfigSchema", {
58608
58703
  return NcAlarmConfigSchema;
58609
58704
  }
58610
58705
  });
58706
+ Object.defineProperty(exports, "NcAlarmPostTriggeredActionSchema", {
58707
+ enumerable: true,
58708
+ get: function() {
58709
+ return NcAlarmPostTriggeredActionSchema;
58710
+ }
58711
+ });
58611
58712
  Object.defineProperty(exports, "NcAlarmSensorsInputSchema", {
58612
58713
  enumerable: true,
58613
58714
  get: function() {
@@ -59094,6 +59195,12 @@ Object.defineProperty(exports, "deleteAlarmProfile", {
59094
59195
  return deleteAlarmProfile;
59095
59196
  }
59096
59197
  });
59198
+ Object.defineProperty(exports, "derivePostTriggeredAction", {
59199
+ enumerable: true,
59200
+ get: function() {
59201
+ return derivePostTriggeredAction;
59202
+ }
59203
+ });
59097
59204
  Object.defineProperty(exports, "deriveRecordingMode", {
59098
59205
  enumerable: true,
59099
59206
  get: function() {
@@ -59460,6 +59567,12 @@ Object.defineProperty(exports, "resolvePoolMemoryPolicy", {
59460
59567
  return resolvePoolMemoryPolicy;
59461
59568
  }
59462
59569
  });
59570
+ Object.defineProperty(exports, "ruleAutoTriggersAlarm", {
59571
+ enumerable: true,
59572
+ get: function() {
59573
+ return ruleAutoTriggersAlarm;
59574
+ }
59575
+ });
59463
59576
  Object.defineProperty(exports, "ruleBelongsToAlarm", {
59464
59577
  enumerable: true,
59465
59578
  get: function() {
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_clip_model_registry = require("../clip-model-registry-CDG2krro.js");
5
+ const require_clip_model_registry = require("../clip-model-registry-DQmmIYXS.js");
6
6
  let node_fs = require("node:fs");
7
7
  node_fs = require_clip_model_registry.__toESM(node_fs);
8
8
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Gn as embeddingRequirementsUnavailableError, Hn as embeddingModelFailedError, Or as resolvePoolMemoryPolicy, Vn as embeddingEncoderCapability, Wn as embeddingRequirementsFailedError, a as CLIP_EMBEDDING_STEP_ID, c as resolveClusterModelPin, i as CLIP_TEXT_MODELS, li as normalizeNodeId, n as DEFAULT_CLIP_MODEL, qt as PoolMemoryWatchdog, r as CLIP_IMAGE_MODELS, t as BUILTIN_CLIP_MODELS, ti as BaseAddon, vr as parseProcStatus } from "../clip-model-registry-Cn5n0a0Q.mjs";
1
+ import { Ar as resolvePoolMemoryPolicy, Jt as PoolMemoryWatchdog, Kn as embeddingRequirementsFailedError, Un as embeddingEncoderCapability, Wn as embeddingModelFailedError, a as CLIP_EMBEDDING_STEP_ID, br as parseProcStatus, c as resolveClusterModelPin, fi as normalizeNodeId, i as CLIP_TEXT_MODELS, ii as BaseAddon, n as DEFAULT_CLIP_MODEL, qn as embeddingRequirementsUnavailableError, r as CLIP_IMAGE_MODELS, t as BUILTIN_CLIP_MODELS } from "../clip-model-registry-CGaaUvAD.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import * as fs from "node:fs";
4
4
  import * as path$1 from "node:path";
@@ -2,7 +2,7 @@ import { a as e, i as t, n, o as r, r as i, t as a } from "./_virtual_mf___mfe_i
2
2
  import { t as o } from "./_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-B3Wx5J80.mjs";
3
3
  import { a as s, i as c, n as l, o as u, r as d, s as f, t as p } from "./_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-n9xCtjjZ.mjs";
4
4
  import { n as m, r as h, t as g } from "./_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-Bm-iyjmq.mjs";
5
- import { t as _ } from "./_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DK7fUvI-.mjs";
5
+ import { t as _ } from "./_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BdFzCOK8.mjs";
6
6
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
7
7
  var v = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), y = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), b = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), x = (e) => {
8
8
  let t = b(e);