@camstack/addon-post-analysis 1.2.630 → 1.2.632

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.
@@ -9381,7 +9381,7 @@ function errMsg(err) {
9381
9381
  return String(err);
9382
9382
  }
9383
9383
  //#endregion
9384
- //#region ../types/dist/composition-xz-ud5EQ.mjs
9384
+ //#region ../types/dist/composition-BJ8iAZb3.mjs
9385
9385
  /**
9386
9386
  * Deterministic SHA-256 hash of an arbitrary serialisable value. The
9387
9387
  * canonical form sorts object keys alphabetically at every depth so two
@@ -9472,7 +9472,7 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
9472
9472
  * ONE table for everyone who asks "is this device HIGH?": the
9473
9473
  * recorder's `RecordingTriggers.sensorDeviceIds` trigger, the post-analysis
9474
9474
  * sensor markers, the orchestrator's camera-sensors bridge and
9475
- * the sources of a composite doorbell (`doorbellFeatureSources`, D671).
9475
+ * the sources of a pulse (`compilePulseOverride`, D936).
9476
9476
  * A second copy would diverge at the first cap added, and the symptom — "the
9477
9477
  * sensor rings the doorbell but does not record" — is exactly D62.
9478
9478
  *
@@ -17524,6 +17524,13 @@ var ComposerUnreadableBlockSchema = object({
17524
17524
  /** The parse error, in the operator's words. */
17525
17525
  error: string()
17526
17526
  });
17527
+ /** A confirmed release the hub did not accept. `deviceId` is the claim's device. */
17528
+ var UnreleasedClaimSchema = object({
17529
+ deviceId: number().int(),
17530
+ capName: string(),
17531
+ owner: string(),
17532
+ error: string()
17533
+ });
17527
17534
  method(object({
17528
17535
  /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
17529
17536
  integrationId: string().nullable(),
@@ -17533,7 +17540,13 @@ method(object({
17533
17540
  /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
17534
17541
  restartBlockIds: array(string()),
17535
17542
  /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
17536
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
17543
+ unreadableBlocks: array(ComposerUnreadableBlockSchema),
17544
+ /**
17545
+ * Operator-confirmed deletions. Their claims are released on this apply,
17546
+ * before any replacement block claims. A block that merely vanished from the
17547
+ * snapshot is not listed here and still waits for two applies (D49).
17548
+ */
17549
+ retiredBlockIds: array(string()).optional()
17537
17550
  }), object({
17538
17551
  blocks: array(object({
17539
17552
  blockId: string(),
@@ -17545,7 +17558,13 @@ method(object({
17545
17558
  * integration unknown, its own rows unread or read empty once). An empty
17546
17559
  * apply the caller owes is paid off only by one the composer acted on (D49).
17547
17560
  */
17548
- acted: boolean()
17561
+ acted: boolean(),
17562
+ /**
17563
+ * Confirmed releases this apply tried and the hub did not accept. Empty when
17564
+ * every one landed (or there was nothing to hand back). Absent on a result
17565
+ * that never got that far.
17566
+ */
17567
+ unreleasedClaims: array(UnreleasedClaimSchema).optional()
17549
17568
  }), {
17550
17569
  kind: "mutation",
17551
17570
  auth: "admin"
@@ -57822,20 +57841,68 @@ var BatteryStatusSchema = object({
57822
57841
  */
57823
57842
  binary: boolean().optional()
57824
57843
  });
57844
+ var BATTERY_DEVICE_TYPES = [
57845
+ DeviceType.Camera,
57846
+ DeviceType.Sensor,
57847
+ DeviceType.Button,
57848
+ DeviceType.Switch,
57849
+ DeviceType.PetFeeder,
57850
+ DeviceType.Container,
57851
+ DeviceType.Thermostat
57852
+ ];
57853
+ /** Generic Customize target for the percentage reading (D936). */
57854
+ var batteryCustomize = {
57855
+ version: 1,
57856
+ targets: [{
57857
+ id: "percentage",
57858
+ cardinality: "scalar",
57859
+ vocabulary: {
57860
+ cap: "battery",
57861
+ stateField: "percentage"
57862
+ },
57863
+ deviceTypes: BATTERY_DEVICE_TYPES,
57864
+ apply: "add-or-replace",
57865
+ path: "percentage",
57866
+ sources: [{
57867
+ kind: "field",
57868
+ valueKinds: ["number", "string"],
57869
+ transforms: [{ kind: "identity" }, {
57870
+ kind: "linear",
57871
+ defaultScale: 1,
57872
+ defaultOffset: 0,
57873
+ clampMin: 0,
57874
+ clampMax: 100
57875
+ }]
57876
+ }],
57877
+ companions: [
57878
+ {
57879
+ kind: "constant",
57880
+ path: "charging",
57881
+ value: "unknown",
57882
+ when: "add"
57883
+ },
57884
+ {
57885
+ kind: "constant",
57886
+ path: "sleeping",
57887
+ value: false,
57888
+ when: "add"
57889
+ },
57890
+ {
57891
+ kind: "clock",
57892
+ path: "lastUpdated",
57893
+ when: "add"
57894
+ }
57895
+ ],
57896
+ sourceReport: { status: "assignment-status" },
57897
+ advancedExpression: true
57898
+ }]
57899
+ };
57825
57900
  var batteryCapability = {
57826
57901
  name: "battery",
57827
57902
  scope: "device",
57828
57903
  deviceNative: true,
57829
57904
  mode: "singleton",
57830
- deviceTypes: [
57831
- DeviceType.Camera,
57832
- DeviceType.Sensor,
57833
- DeviceType.Button,
57834
- DeviceType.Switch,
57835
- DeviceType.PetFeeder,
57836
- DeviceType.Container,
57837
- DeviceType.Thermostat
57838
- ],
57905
+ deviceTypes: BATTERY_DEVICE_TYPES,
57839
57906
  methods: {
57840
57907
  /**
57841
57908
  * Explicitly wake the camera from low-power sleep ahead of a
@@ -57919,6 +57986,7 @@ onStatusChanged: { data: object({
57919
57986
  kind: "gauge",
57920
57987
  unit: "%"
57921
57988
  } } },
57989
+ customize: batteryCustomize,
57922
57990
  /** Clock fields: written, but excluded from the compare that decides
57923
57991
  * whether persisting is worth a SQLite commit. */
57924
57992
  volatileStateFields: ["lastUpdated"]
@@ -58920,6 +58988,106 @@ var ConsumablesStatusSchema = object({
58920
58988
  items: array(ConsumableItemSchema),
58921
58989
  lastChangedAt: number()
58922
58990
  });
58991
+ /** Synthesize seed for a link-built status (no native provider).
58992
+ *
58993
+ * ⚠ NO LIVE CALLER since 2026-08-08 (device-links deleted; see
58994
+ * `CapabilityStatusSchema.empty`). The wiring guidance below was written for
58995
+ * exactly the case the operator is asking about again — a Dreame's HA
58996
+ * consumable-life sensors — so it is kept for that conversation, not because
58997
+ * anything reads it today. */
58998
+ var EMPTY_STATUS = {
58999
+ items: [],
59000
+ lastChangedAt: 0
59001
+ };
59002
+ /** Seed for a NEW link-built consumable item. `key`/`label` are overwritten
59003
+ * with the link's `itemKey` (see `status.itemArray`), so the placeholder
59004
+ * empty strings never survive into a validated item. Link-built items are
59005
+ * not resettable — there is no native provider to receive `reset()`.
59006
+ *
59007
+ * Wiring guidance (HA vacuum consumable-life sensors):
59008
+ * - a percent-remaining source (`numeric-sensor`, unit '%') → `level` via
59009
+ * `identity` (or `linear` scale 1 offset 0 clamp [0,100] to be safe);
59010
+ * - an hours-remaining source (e.g. Dreame 'Main Brush Time Left', unit 'h')
59011
+ * → `level` via `linear` with scale = 100 / max-hours for that item
59012
+ * (e.g. main brush 300 h → scale 0.3333) + clamp [0,100];
59013
+ * - a discrete source (`enum-sensor`, e.g. mop pad 'installed') → `status`
59014
+ * via `enum-map` (e.g. { installed: 'ok', missing: 'replace' }).
59015
+ * A numeric→'replace' THRESHOLD (level < 10 → 'replace') is NOT expressible
59016
+ * with the current transform kinds — leave `status` null (valid) until the
59017
+ * expression transform lands. */
59018
+ /** Generic Customize target for one consumable item (D936). Native rows stay read-only. */
59019
+ var consumablesCustomize = {
59020
+ version: 1,
59021
+ targets: [{
59022
+ id: "items",
59023
+ cardinality: "keyedArray",
59024
+ vocabulary: { cap: "consumables" },
59025
+ deviceTypes: Object.values(DeviceType),
59026
+ apply: "add",
59027
+ path: "items",
59028
+ keyField: "key",
59029
+ labelField: "label",
59030
+ itemSchema: ConsumableItemSchema,
59031
+ nativeItems: "read-only",
59032
+ sourceReport: { status: "assignment-status" },
59033
+ fields: [
59034
+ {
59035
+ path: "level",
59036
+ sources: [{
59037
+ kind: "numeric",
59038
+ transforms: [{ kind: "identity" }, {
59039
+ kind: "linear",
59040
+ defaultScale: 1,
59041
+ defaultOffset: 0,
59042
+ clampMin: 0,
59043
+ clampMax: 100
59044
+ }]
59045
+ }]
59046
+ },
59047
+ {
59048
+ path: "remaining.value",
59049
+ sources: [{
59050
+ kind: "numeric",
59051
+ transforms: [{ kind: "identity" }]
59052
+ }],
59053
+ literals: [{
59054
+ path: "remaining.unit",
59055
+ values: [...ConsumableRemainingUnitSchema.options]
59056
+ }]
59057
+ },
59058
+ {
59059
+ path: "status",
59060
+ sources: [{
59061
+ kind: "enum",
59062
+ transforms: [{
59063
+ kind: "enum-map",
59064
+ outputValues: [...ConsumableStatusSchema.options],
59065
+ unmapped: null
59066
+ }]
59067
+ }]
59068
+ }
59069
+ ],
59070
+ traits: [{
59071
+ path: "kind",
59072
+ values: [...ConsumableKindSchema.options],
59073
+ defaultValue: "wear"
59074
+ }, {
59075
+ path: "form",
59076
+ values: [...ConsumableFormSchema.options],
59077
+ defaultValue: "part"
59078
+ }],
59079
+ companions: [{
59080
+ kind: "clock",
59081
+ path: "lastChangedAt",
59082
+ when: "add"
59083
+ }, {
59084
+ kind: "clock",
59085
+ path: "lastFetchedAt",
59086
+ when: "add"
59087
+ }],
59088
+ advancedExpression: true
59089
+ }]
59090
+ };
58923
59091
  var consumablesCapability = {
58924
59092
  name: "consumables",
58925
59093
  scope: "device",
@@ -58957,10 +59125,7 @@ reset: method(object({
58957
59125
  status: {
58958
59126
  schema: ConsumablesStatusSchema,
58959
59127
  kind: "push",
58960
- empty: {
58961
- items: [],
58962
- lastChangedAt: 0
58963
- },
59128
+ empty: EMPTY_STATUS,
58964
59129
  itemArray: {
58965
59130
  path: "items",
58966
59131
  keyField: "key",
@@ -58996,6 +59161,7 @@ reset: method(object({
58996
59161
  * brush's remaining life and a dishwasher's salt are each recorded the moment
58997
59162
  * their provider reports them; an item that appears later gets its series.
58998
59163
  */
59164
+ customize: consumablesCustomize,
58999
59165
  history: {
59000
59166
  fields: {},
59001
59167
  items: {
@@ -59760,6 +59926,36 @@ var dishwasherCapability = {
59760
59926
  powerOn: { kind: "boolean" }
59761
59927
  } }
59762
59928
  };
59929
+ /** Pulse override: a rising edge advances `lastPressedAt` and the press count. */
59930
+ var doorbellCustomize = {
59931
+ version: 1,
59932
+ targets: [{
59933
+ id: "pressed",
59934
+ cardinality: "event",
59935
+ shape: "pulse",
59936
+ vocabulary: {
59937
+ cap: "doorbell",
59938
+ eventName: "onPressed"
59939
+ },
59940
+ deviceTypes: [DeviceType.Camera],
59941
+ apply: "add",
59942
+ applyAuthority: { kind: "composition-claim" },
59943
+ eventName: "onPressed",
59944
+ edges: ["rising"],
59945
+ timestampPath: "lastPressedAt",
59946
+ counterPath: "pressCountSinceStart",
59947
+ highWater: "composer-advance",
59948
+ combine: "any",
59949
+ debounce: {
59950
+ kind: "rising-edge",
59951
+ defaultDebounceMs: 2e3,
59952
+ changedAtRequired: true
59953
+ },
59954
+ sources: [{ kind: "binary" }, { kind: "switch" }],
59955
+ sourceReport: { status: "assignment-status" },
59956
+ advancedExpression: true
59957
+ }]
59958
+ };
59763
59959
  var DoorbellStatusSchema = object({
59764
59960
  /** Ms epoch of the last press. null = never observed since this provider started. */
59765
59961
  lastPressedAt: number().nullable(),
@@ -59826,7 +60022,8 @@ onPressed: {
59826
60022
  /**
59827
60023
  * History (D850): none — `pressCountSinceStart` resets with the addon, so it is not a monotonic meter; presses live in the events ledger.
59828
60024
  */
59829
- history: "none"
60025
+ history: "none",
60026
+ customize: doorbellCustomize
59830
60027
  };
59831
60028
  /**
59832
60029
  * Enum-state sensor — a string value picked from a finite option set.
@@ -62283,6 +62480,38 @@ authKey: string().optional() }), object({
62283
62480
  /** Human-readable error when `ok: false`. */
62284
62481
  error: string().optional()
62285
62482
  }), { kind: "mutation" });
62483
+ /** Span override: start on a rising edge, end on a fall or this timeout. */
62484
+ var motionCustomize = {
62485
+ version: 1,
62486
+ targets: [{
62487
+ id: "detected",
62488
+ cardinality: "event",
62489
+ shape: "span",
62490
+ vocabulary: {
62491
+ cap: "motion",
62492
+ eventName: "onMotionChanged"
62493
+ },
62494
+ deviceTypes: [DeviceType.Camera],
62495
+ apply: "replace",
62496
+ applyAuthority: {
62497
+ kind: "camera-sensors",
62498
+ timeoutField: "motionCooldownMs"
62499
+ },
62500
+ eventName: "onMotionChanged",
62501
+ start: "rising-edge",
62502
+ end: "falling-edge-or-timeout",
62503
+ timeoutMs: 3e4,
62504
+ combine: "any",
62505
+ sourceModes: [
62506
+ "in-addition",
62507
+ "confirm",
62508
+ "replace"
62509
+ ],
62510
+ sources: [{ kind: "binary" }, { kind: "switch" }],
62511
+ sourceReport: { status: "assignment-status" },
62512
+ advancedExpression: false
62513
+ }]
62514
+ };
62286
62515
  /**
62287
62516
  * Hardware / firmware motion sensor cap — binary detected state plus
62288
62517
  * a timestamp of the last observation. Distinct from
@@ -62447,7 +62676,8 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
62447
62676
  history: { fields: { detected: {
62448
62677
  kind: "boolean",
62449
62678
  excludeDeviceTypes: [DeviceType.Camera]
62450
- } } }
62679
+ } } },
62680
+ customize: motionCustomize
62451
62681
  };
62452
62682
  /**
62453
62683
  * Motion-trigger toggle for accessory devices.
@@ -65208,6 +65438,8 @@ var ptzAutotrackCapability = {
65208
65438
  */
65209
65439
  history: "none"
65210
65440
  };
65441
+ var RUNNING_POWER_START_DELAY_MS = 3e4;
65442
+ var RUNNING_POWER_STOP_DELAY_MS = 18e4;
65211
65443
  var RunningStateSourceSchema = _enum(["native", "assigned"]);
65212
65444
  var RunningStateStatusSchema = object({
65213
65445
  /** null = unknown — never coerced to false (D393). */
@@ -65216,19 +65448,100 @@ var RunningStateStatusSchema = object({
65216
65448
  since: number().nullable(),
65217
65449
  source: RunningStateSourceSchema,
65218
65450
  phase: string().nullable(),
65219
- lastFetchedAt: number()
65451
+ /** null until a reading has been published (D393). */
65452
+ lastFetchedAt: number().nullable()
65220
65453
  });
65221
65454
  var RunningFlipEventDataSchema = object({
65222
65455
  deviceId: number(),
65223
65456
  since: number().nullable(),
65224
65457
  phase: string().nullable()
65225
65458
  });
65459
+ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
65460
+ /** Generic Customize target for the running boolean (D936). */
65461
+ var runningCustomize = {
65462
+ version: 1,
65463
+ targets: [{
65464
+ id: "running",
65465
+ cardinality: "scalar",
65466
+ vocabulary: {
65467
+ cap: "running-state",
65468
+ stateField: "running"
65469
+ },
65470
+ deviceTypes: [
65471
+ DeviceType.Dishwasher,
65472
+ DeviceType.Vacuum,
65473
+ DeviceType.LawnMower,
65474
+ DeviceType.MediaPlayer,
65475
+ DeviceType.WaterHeater,
65476
+ DeviceType.Humidifier,
65477
+ DeviceType.Fan,
65478
+ DeviceType.Climate,
65479
+ DeviceType.Thermostat,
65480
+ DeviceType.PetFeeder
65481
+ ],
65482
+ apply: "add-or-replace",
65483
+ path: "running",
65484
+ sources: [
65485
+ {
65486
+ kind: "switch",
65487
+ transforms: [{ kind: "identity" }]
65488
+ },
65489
+ {
65490
+ kind: "binary",
65491
+ transforms: [{ kind: "identity" }, { kind: "invert" }]
65492
+ },
65493
+ {
65494
+ kind: "numeric",
65495
+ requiredUnit: "W",
65496
+ transforms: [{
65497
+ kind: "threshold",
65498
+ comparison: "gte",
65499
+ defaultThreshold: 5,
65500
+ defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
65501
+ defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
65502
+ thresholdUnit: "W"
65503
+ }]
65504
+ }
65505
+ ],
65506
+ companions: [
65507
+ {
65508
+ kind: "constant",
65509
+ path: "source",
65510
+ value: "assigned",
65511
+ when: "always"
65512
+ },
65513
+ {
65514
+ kind: "constant",
65515
+ path: "phase",
65516
+ value: null,
65517
+ when: "always"
65518
+ },
65519
+ {
65520
+ kind: "clock",
65521
+ path: "lastFetchedAt",
65522
+ when: "always"
65523
+ },
65524
+ {
65525
+ kind: "transition-time",
65526
+ path: "since",
65527
+ sourceChangedAt: "prefer"
65528
+ }
65529
+ ],
65530
+ sourceReport: {
65531
+ status: "assignment-status",
65532
+ runtimeField: "source",
65533
+ nativeValue: "native",
65534
+ assignedValue: "assigned"
65535
+ },
65536
+ advancedExpression: true
65537
+ }]
65538
+ };
65226
65539
  var runningStateCapability = {
65227
65540
  name: "running-state",
65228
65541
  scope: "device",
65229
65542
  deviceNative: true,
65230
65543
  mode: "singleton",
65231
- deviceTypes: Object.values(DeviceType),
65544
+ deviceTypes: RUNNING_DEVICE_TYPES,
65232
65545
  methods: {},
65233
65546
  events: {
65234
65547
  onStarted: { data: RunningFlipEventDataSchema },
@@ -65241,7 +65554,8 @@ var runningStateCapability = {
65241
65554
  runtimeState: RunningStateStatusSchema,
65242
65555
  durability: "restored",
65243
65556
  history: { fields: { running: { kind: "boolean" } } },
65244
- volatileStateFields: ["lastFetchedAt"]
65557
+ volatileStateFields: ["lastFetchedAt"],
65558
+ customize: runningCustomize
65245
65559
  };
65246
65560
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
65247
65561
  kind: "mutation",
@@ -87474,6 +87788,96 @@ var BucketAccumulator = class {
87474
87788
  }
87475
87789
  };
87476
87790
  DeviceType.Camera;
87791
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, 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, DeviceType.Dishwasher, DeviceType.Camera, DeviceType.Camera, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
87792
+ /**
87793
+ * A saved Customize assignment (D936). The schema is the type: callers use
87794
+ * `z.infer`, they do not restate the shape.
87795
+ */
87796
+ var OverrideSourceSchema = object({
87797
+ addonId: string().min(1),
87798
+ stableId: string().min(1),
87799
+ cap: string().min(1),
87800
+ fieldPath: string().min(1)
87801
+ });
87802
+ var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
87803
+ object({ kind: literal("identity") }),
87804
+ object({ kind: literal("invert") }),
87805
+ object({
87806
+ kind: literal("threshold"),
87807
+ comparison: _enum(["gte", "lte"]),
87808
+ threshold: number(),
87809
+ startDwellMs: number().nonnegative(),
87810
+ stopDwellMs: number().nonnegative()
87811
+ }),
87812
+ object({
87813
+ kind: literal("linear"),
87814
+ scale: number(),
87815
+ offset: number(),
87816
+ clampMin: number().optional(),
87817
+ clampMax: number().optional()
87818
+ }),
87819
+ object({
87820
+ kind: literal("enum-map"),
87821
+ mapping: record(string(), string().nullable())
87822
+ }),
87823
+ object({ kind: literal("number") })
87824
+ ]);
87825
+ var ScalarOverrideDraftSchema = object({
87826
+ kind: literal("scalar"),
87827
+ cap: string().min(1),
87828
+ targetId: string().min(1),
87829
+ source: OverrideSourceSchema,
87830
+ transform: CustomizeTransformDraftSchema
87831
+ });
87832
+ var KeyedArrayOverrideDraftSchema = object({
87833
+ kind: literal("keyedArray"),
87834
+ cap: string().min(1),
87835
+ targetId: string().min(1),
87836
+ key: string().min(1),
87837
+ label: string().min(1),
87838
+ fieldPath: string().min(1),
87839
+ source: OverrideSourceSchema,
87840
+ transform: CustomizeTransformDraftSchema
87841
+ });
87842
+ var PulseOverrideDraftSchema = object({
87843
+ kind: literal("pulse"),
87844
+ cap: string().min(1),
87845
+ targetId: string().min(1),
87846
+ enabled: boolean(),
87847
+ debounceMs: number().nonnegative(),
87848
+ sources: array(OverrideSourceSchema).min(1)
87849
+ });
87850
+ var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
87851
+ "in-addition",
87852
+ "confirm",
87853
+ "replace"
87854
+ ]).optional() });
87855
+ discriminatedUnion("kind", [
87856
+ ScalarOverrideDraftSchema,
87857
+ KeyedArrayOverrideDraftSchema,
87858
+ PulseOverrideDraftSchema,
87859
+ object({
87860
+ kind: literal("span"),
87861
+ cap: string().min(1),
87862
+ targetId: string().min(1),
87863
+ timeoutMs: number().nonnegative(),
87864
+ cooldownMs: number().nonnegative().optional(),
87865
+ sources: array(SpanSourceDraftSchema)
87866
+ })
87867
+ ]);
87868
+ object({
87869
+ targetId: string().min(1),
87870
+ configured: boolean(),
87871
+ source: _enum(["native", "assigned"]),
87872
+ state: _enum([
87873
+ "active",
87874
+ "stale",
87875
+ "released",
87876
+ "unavailable"
87877
+ ]),
87878
+ reason: string().nullable()
87879
+ });
87880
+ String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
87477
87881
  var G711_SCALE_CORRECTION_DB = {
87478
87882
  PCMU: 20 * Math.log10(4),
87479
87883
  PCMA: 20 * Math.log10(8)