@camstack/types 1.2.581 → 1.2.582

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-BURDyp_n.js");
2
+ const require_sleep = require("./sleep-Coq9CYAH.js");
3
3
  const require_event_category = require("./event-category-d9kiqCqC.js");
4
4
  const require_composed_stable_id = require("./composed-stable-id-C3NfRTj8.js");
5
5
  const require_implemented_methods = require("./implemented-methods-C7ScGvEz.js");
@@ -58926,6 +58926,34 @@ var OrphanListSchema = zod.z.object({
58926
58926
  /** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
58927
58927
  truncated: zod.z.boolean()
58928
58928
  });
58929
+ var DeviceHistoryRangeDeleteRefusalSchema = zod.z.enum([
58930
+ "invalid-range",
58931
+ "range-too-large",
58932
+ "series-not-found",
58933
+ "not-a-point-series"
58934
+ ]);
58935
+ var RollupRowsSchema = zod.z.object({
58936
+ "5m": zod.z.number().int(),
58937
+ "1h": zod.z.number().int(),
58938
+ "1d": zod.z.number().int()
58939
+ });
58940
+ /**
58941
+ * What a time-range delete did, or WOULD do (`dryRun`). `rows` is what was
58942
+ * removed: raw points inside the range, and the rollup rows covering it (those
58943
+ * are removed and rebuilt from what remains, so a gap leaves no stale value).
58944
+ * `rewritten` is how many rollup rows were rebuilt from the remaining points;
58945
+ * `null` on a dry run, which cannot know before it has deleted.
58946
+ */
58947
+ var RangeDeleteResultSchema = zod.z.discriminatedUnion("ok", [zod.z.object({
58948
+ ok: zod.z.literal(true),
58949
+ dryRun: zod.z.boolean(),
58950
+ seriesId: zod.z.number().int(),
58951
+ rows: TierRowsSchema,
58952
+ rewritten: RollupRowsSchema.nullable()
58953
+ }), zod.z.object({
58954
+ ok: zod.z.literal(false),
58955
+ reason: DeviceHistoryRangeDeleteRefusalSchema
58956
+ })]);
58929
58957
  var DeviceHistoryStatusSchema = zod.z.object({
58930
58958
  startedAt: zod.z.number(),
58931
58959
  /** The store is declared, series loaded and the first reconcile has answered. */
@@ -59084,6 +59112,27 @@ var deviceHistoryCapability = {
59084
59112
  deleteOrphanSeries: require_sleep.method(zod.z.object({ seriesIds: zod.z.array(zod.z.number().int()).min(1).max(50) }), zod.z.object({ results: zod.z.array(OrphanDeleteEntrySchema).readonly() }), {
59085
59113
  kind: "mutation",
59086
59114
  auth: "admin"
59115
+ }),
59116
+ /**
59117
+ * Delete the points of ONE device series with a timestamp in
59118
+ * `[fromMs, toMs]` (both inclusive, `fromMs < toMs`) — for a spurious
59119
+ * reading an operator has judged wrong. The rollup rows covering the
59120
+ * range (and the bucket that held the deleted value forward) are removed
59121
+ * and rebuilt from the points that remain. `dryRun: true` deletes nothing
59122
+ * and returns the counts a real run would remove. Only a series fed by
59123
+ * points has a range to delete; a bucket-fed series is refused
59124
+ * `not-a-point-series`. `scope` is the series' scope ('' for most).
59125
+ */
59126
+ deleteSeriesRange: require_sleep.method(zod.z.object({
59127
+ deviceId: zod.z.number().int(),
59128
+ key: zod.z.string().min(1),
59129
+ scope: zod.z.string(),
59130
+ fromMs: zod.z.number().int().nonnegative(),
59131
+ toMs: zod.z.number().int().nonnegative(),
59132
+ dryRun: zod.z.boolean()
59133
+ }), RangeDeleteResultSchema, {
59134
+ kind: "mutation",
59135
+ auth: "admin"
59087
59136
  })
59088
59137
  },
59089
59138
  vocabulary: { notOperatorFacing: "recorded history of device state — read by charts, not actuated" }
@@ -85720,6 +85769,91 @@ var EffectiveSharesSchema = zod.z.object({
85720
85769
  deviceWeights: zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.number()))
85721
85770
  });
85722
85771
  //#endregion
85772
+ //#region src/pipeline/health-digest/schemas.ts
85773
+ /**
85774
+ * Health digest (planning#572) — findings an operator can act on, built every
85775
+ * few minutes from state the orchestrator already holds in memory. A finding is
85776
+ * `{ severity, subject, what, evidence, action }`; a number that could not be
85777
+ * read is `null`, never `0` (D393).
85778
+ */
85779
+ var HEALTH_FINDING_KINDS = [
85780
+ "motion-without-detections",
85781
+ "detections-under-floor",
85782
+ "inference-too-slow",
85783
+ "frames-shed",
85784
+ "inference-device-unusable"
85785
+ ];
85786
+ var HealthFindingKindSchema = zod.z.enum(HEALTH_FINDING_KINDS);
85787
+ var HealthSeveritySchema = zod.z.enum([
85788
+ "info",
85789
+ "warning",
85790
+ "critical"
85791
+ ]);
85792
+ var HealthSubjectSchema = zod.z.discriminatedUnion("type", [
85793
+ zod.z.object({
85794
+ type: zod.z.literal("camera"),
85795
+ deviceId: zod.z.number()
85796
+ }),
85797
+ zod.z.object({
85798
+ type: zod.z.literal("node"),
85799
+ nodeId: zod.z.string()
85800
+ }),
85801
+ zod.z.object({
85802
+ type: zod.z.literal("inference-device"),
85803
+ nodeId: zod.z.string(),
85804
+ deviceKey: zod.z.string()
85805
+ })
85806
+ ]);
85807
+ var HealthFindingSchema = zod.z.object({
85808
+ /** Stable across ticks for the same condition on the same subject. */
85809
+ id: zod.z.string(),
85810
+ kind: HealthFindingKindSchema,
85811
+ severity: HealthSeveritySchema,
85812
+ subject: HealthSubjectSchema,
85813
+ what: zod.z.string(),
85814
+ /** The numbers behind the sentence; `null` = the value could not be read. */
85815
+ evidence: zod.z.record(zod.z.string(), zod.z.number().nullable()),
85816
+ action: zod.z.string()
85817
+ });
85818
+ /** One in-memory source the tick read, and whether it answered. */
85819
+ var HealthSourceStatusSchema = zod.z.object({
85820
+ source: zod.z.string(),
85821
+ /** Entries read; `null` = the read failed. */
85822
+ entries: zod.z.number().nullable()
85823
+ });
85824
+ var HealthNodeSummarySchema = zod.z.object({
85825
+ nodeId: zod.z.string(),
85826
+ sessionsNow: zod.z.number(),
85827
+ /** `deviceKey` of every inference device the balancer excludes on this node. */
85828
+ unusableDevices: zod.z.array(zod.z.string()).readonly(),
85829
+ devices: zod.z.array(zod.z.object({
85830
+ deviceKey: zod.z.string(),
85831
+ sessionsNow: zod.z.number(),
85832
+ usable: zod.z.boolean()
85833
+ })).readonly()
85834
+ });
85835
+ var HealthDigestSchema = zod.z.object({
85836
+ generatedAt: zod.z.number(),
85837
+ /** Wall time the tick took to build this digest. */
85838
+ tickMs: zod.z.number(),
85839
+ /** Cameras known to the digest; `null` when a camera source failed to read (the union would be incomplete). */
85840
+ camerasSeen: zod.z.number().nullable(),
85841
+ findings: zod.z.array(HealthFindingSchema).readonly(),
85842
+ nodes: zod.z.array(HealthNodeSummarySchema).readonly(),
85843
+ sources: zod.z.array(HealthSourceStatusSchema).readonly(),
85844
+ /** Signals the digest does not cover yet, and why — never computed by scanning. */
85845
+ notCovered: zod.z.array(zod.z.string()).readonly()
85846
+ });
85847
+ var HealthDigestInputSchema = zod.z.object({
85848
+ /** Newest first; 1 = the latest digest. */
85849
+ history: zod.z.number().int().min(1).max(24).default(1) });
85850
+ var HealthDigestAnswerSchema = zod.z.object({
85851
+ /** Null until the first tick has run. */
85852
+ latest: HealthDigestSchema.nullable(),
85853
+ /** Older digests, newest first, when `history` > 1. */
85854
+ previous: zod.z.array(HealthDigestSchema).readonly()
85855
+ });
85856
+ //#endregion
85723
85857
  //#region src/capabilities/pipeline-orchestrator.cap.ts
85724
85858
  var CameraPipelineConfigSchema = zod.z.object({
85725
85859
  engine: PipelineEngineChoiceSchema.optional(),
@@ -86703,6 +86837,16 @@ var pipelineOrchestratorCapability = {
86703
86837
  */
86704
86838
  getPlacementStats: require_sleep.method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }),
86705
86839
  /**
86840
+ * Health digest (planning#572) — findings an operator can act on, built
86841
+ * every 5 minutes from state the orchestrator already holds in memory
86842
+ * (no log scan, no database read): motion that never becomes a detection,
86843
+ * candidates all under the class floor, inference slower than the fps it
86844
+ * must allow, shed frames, unusable inference devices. `latest` is null
86845
+ * until the first tick; `previous` holds older digests when `history` > 1.
86846
+ * In memory on the hub — a restart starts empty.
86847
+ */
86848
+ getHealthDigest: require_sleep.method(HealthDigestInputSchema, HealthDigestAnswerSchema, { auth: "admin" }),
86849
+ /**
86706
86850
  * Load balancing (D748, D755) — shares proportional to each node's
86707
86851
  * capacity in parallel sessions: from the latency table at the models
86708
86852
  * Auto tune picks (`hardware`), or from node benchmark results
@@ -119975,6 +120119,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
119975
120119
  access: "delete",
119976
120120
  role: "admin"
119977
120121
  },
120122
+ "deviceHistory.deleteSeriesRange": {
120123
+ capName: "device-history",
120124
+ capScope: "system",
120125
+ addonId: null,
120126
+ access: "delete",
120127
+ role: "admin"
120128
+ },
119978
120129
  "deviceHistory.getDeviceEnabled": {
119979
120130
  capName: "device-history",
119980
120131
  capScope: "system",
@@ -124791,6 +124942,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
124791
124942
  access: "view",
124792
124943
  role: "admin"
124793
124944
  },
124945
+ "pipelineOrchestrator.getHealthDigest": {
124946
+ capName: "pipeline-orchestrator",
124947
+ capScope: "system",
124948
+ addonId: null,
124949
+ access: "view",
124950
+ role: "admin"
124951
+ },
124794
124952
  "pipelineOrchestrator.getIngestOwner": {
124795
124953
  capName: "pipeline-orchestrator",
124796
124954
  capScope: "system",
@@ -131395,6 +131553,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
131395
131553
  form: "single",
131396
131554
  optional: false
131397
131555
  }],
131556
+ "deviceHistory.deleteSeriesRange": [{
131557
+ name: "deviceId",
131558
+ form: "single",
131559
+ optional: false
131560
+ }],
131398
131561
  "deviceHistory.getDeviceEnabled": [{
131399
131562
  name: "deviceId",
131400
131563
  form: "single",
@@ -134081,6 +134244,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
134081
134244
  "deviceExport.applyDeviceSettingsPatch",
134082
134245
  "deviceExport.getDeviceLiveContribution",
134083
134246
  "deviceExport.getDeviceSettingsContribution",
134247
+ "deviceHistory.deleteSeriesRange",
134084
134248
  "deviceHistory.getDeviceEnabled",
134085
134249
  "deviceHistory.listSeries",
134086
134250
  "deviceHistory.query",
@@ -135828,6 +135992,7 @@ function createSystemProxy(api) {
135828
135992
  applyAutoTune: (input) => dispatch("pipelineOrchestrator", "applyAutoTune", "mutation", input),
135829
135993
  setLoadBalancingShares: (input) => dispatch("pipelineOrchestrator", "setLoadBalancingShares", "mutation", input),
135830
135994
  getPlacementStats: (input) => dispatch("pipelineOrchestrator", "getPlacementStats", "query", input),
135995
+ getHealthDigest: (input) => dispatch("pipelineOrchestrator", "getHealthDigest", "query", input),
135831
135996
  suggestShares: (input) => dispatch("pipelineOrchestrator", "suggestShares", "query", input),
135832
135997
  getEffectiveShares: (input) => dispatch("pipelineOrchestrator", "getEffectiveShares", "query", input),
135833
135998
  setShareSource: (input) => dispatch("pipelineOrchestrator", "setShareSource", "mutation", input),
@@ -149054,6 +149219,7 @@ exports.DeviceHistoryKindSchema = DeviceHistoryKindSchema;
149054
149219
  exports.DeviceHistoryOrphanDeleteRefusalSchema = DeviceHistoryOrphanDeleteRefusalSchema;
149055
149220
  exports.DeviceHistoryOrphanReasonSchema = DeviceHistoryOrphanReasonSchema;
149056
149221
  exports.DeviceHistoryProducerKindSchema = DeviceHistoryProducerKindSchema;
149222
+ exports.DeviceHistoryRangeDeleteRefusalSchema = DeviceHistoryRangeDeleteRefusalSchema;
149057
149223
  exports.DeviceHistoryRefusalReasonSchema = DeviceHistoryRefusalReasonSchema;
149058
149224
  exports.DeviceHistoryResolutionSchema = DeviceHistoryResolutionSchema;
149059
149225
  exports.DeviceHistoryStatusSchema = DeviceHistoryStatusSchema;
@@ -149340,6 +149506,7 @@ exports.HAP_AUDIO_BASE = HAP_AUDIO_BASE;
149340
149506
  exports.HAP_AUDIO_BITRATE_KBPS = HAP_AUDIO_BITRATE_KBPS;
149341
149507
  exports.HAP_AUDIO_VBV_KBITS = HAP_AUDIO_VBV_KBITS;
149342
149508
  exports.HAP_KEYFRAME_INTERVAL_SEC = HAP_KEYFRAME_INTERVAL_SEC;
149509
+ exports.HEALTH_FINDING_KINDS = HEALTH_FINDING_KINDS;
149343
149510
  exports.HEAT_PUMP_CIRCUIT_KINDS = HEAT_PUMP_CIRCUIT_KINDS;
149344
149511
  exports.HERO_ANIMATIONS = HERO_ANIMATIONS;
149345
149512
  exports.HERO_BACKGROUNDS = HERO_BACKGROUNDS;
@@ -149385,7 +149552,16 @@ exports.HUB_MDNS_TXT_KEYS = HUB_MDNS_TXT_KEYS;
149385
149552
  exports.HUB_VIEWER_MOUNT = HUB_VIEWER_MOUNT;
149386
149553
  exports.HWACCEL_OPTIONS = HWACCEL_OPTIONS;
149387
149554
  exports.HardwareClassIdSchema = HardwareClassIdSchema;
149555
+ exports.HealthDigestAnswerSchema = HealthDigestAnswerSchema;
149556
+ exports.HealthDigestInputSchema = HealthDigestInputSchema;
149557
+ exports.HealthDigestSchema = HealthDigestSchema;
149558
+ exports.HealthFindingKindSchema = HealthFindingKindSchema;
149559
+ exports.HealthFindingSchema = HealthFindingSchema;
149560
+ exports.HealthNodeSummarySchema = HealthNodeSummarySchema;
149561
+ exports.HealthSeveritySchema = HealthSeveritySchema;
149562
+ exports.HealthSourceStatusSchema = HealthSourceStatusSchema;
149388
149563
  exports.HealthStatusSchema = HealthStatusSchema;
149564
+ exports.HealthSubjectSchema = HealthSubjectSchema;
149389
149565
  exports.HeatPumpCircuitKindSchema = HeatPumpCircuitKindSchema;
149390
149566
  exports.HeatPumpCircuitSchema = HeatPumpCircuitSchema;
149391
149567
  exports.HeatPumpEnergySchema = HeatPumpEnergySchema;