@camstack/types 1.2.261 → 1.2.263

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 (31) hide show
  1. package/dist/addon.js +1 -1
  2. package/dist/addon.mjs +1 -1
  3. package/dist/capabilities/audio-analyzer.cap.d.ts +22 -0
  4. package/dist/capabilities/device-extension.cap.d.ts +38 -0
  5. package/dist/capabilities/device-manager.cap.d.ts +16 -3
  6. package/dist/capabilities/doorbell.cap.d.ts +0 -1
  7. package/dist/capabilities/index.d.ts +2 -1
  8. package/dist/capabilities/llm-runtime.cap.d.ts +2 -2
  9. package/dist/capabilities/llm-shared.d.ts +3 -3
  10. package/dist/capabilities/llm.cap.d.ts +3 -3
  11. package/dist/capabilities/notification-rules.cap.d.ts +3 -3
  12. package/dist/capabilities/osd-manager.cap.d.ts +1 -1
  13. package/dist/capabilities/pipeline-analytics.cap.d.ts +38 -16
  14. package/dist/capabilities/pipeline-executor.cap.d.ts +1 -0
  15. package/dist/capabilities/schemas/detection-shared.d.ts +31 -0
  16. package/dist/capabilities/storage.cap.d.ts +1 -1
  17. package/dist/device-extension/slot-provider.d.ts +5 -3
  18. package/dist/generated/addon-api.d.ts +0 -42
  19. package/dist/generated/device-proxy.d.ts +1 -1
  20. package/dist/generated/extension-slots.d.ts +1 -0
  21. package/dist/generated/method-access-map.d.ts +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +97 -46
  24. package/dist/index.mjs +95 -47
  25. package/dist/interfaces/storage-location-declaration.d.ts +1 -1
  26. package/dist/pipeline/step-format-runnable.d.ts +31 -0
  27. package/dist/{sleep-QxyLiUId.js → sleep-8K9gue-H.js} +2 -10
  28. package/dist/{sleep-BXv0ZcRa.mjs → sleep-DC-wdyeS.mjs} +2 -10
  29. package/dist/types/detection.d.ts +9 -0
  30. package/dist/types/io.d.ts +7 -0
  31. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -241,6 +241,7 @@ export { NC_SERVER_PACKAGE_NAME, NC_UPDATE_EVENT_PACKAGE_NAMES, type NcInstalled
241
241
  export type { TimelapseCadencePair, TimelapsePreviewMode, TimelapseRule, TimelapseRuleInput, TimelapseRulePatch, TimelapseTemplate, } from './notification/timelapse-rule.js';
242
242
  export { assertTimelapseCadences, DEFAULT_TIMELAPSE_PREVIEW_TEXT, readTimelapseGeneratedAt, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, } from './notification/timelapse-rule.js';
243
243
  export { CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, type ClusterModelScopedStep, type ClusterStepModels, type ClusterStepSettingField, type ClusterStepSettings, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, type HydratedClusterSection, type HydratedClusterView, interpretStoredClusterModel, type InvalidClusterStepModelEntry, invalidClusterStepModelEntries, isClusterScopedStep, overlayClusterStepSettings, pickClusterStepModels, pickClusterStepSettings, pickInvalidClusterStepModels, readClusterStepModels, readClusterStepSettings, resolveClusterStepModelId, type StepModelScope, type StoredClusterModelInterpretation, } from './pipeline/cluster-model-scope.js';
244
+ export { type FormatRunnableModel, stepModelRunsOnFormat, } from './pipeline/step-format-runnable.js';
244
245
  export { DEFAULT_DETAIL_CROP_CONVENTION, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, type DetailCropConvention, DetailCropConventionSchema, type DetailCropRect, deriveDetailCropRect, FULL_IMAGE_BBOX, type HydratedSettingsSection, type HydratedSettingsView, pickDetailCropConvention, readDetailCropConvention, } from './pipeline/detail-crop.js';
245
246
  export { DEFAULT_NATIVE_LEASE_SETTINGS, NATIVE_LEASE_ACTIVITY_FIELD, NATIVE_LEASE_ACTIVITY_KEY, NATIVE_LEASE_ADMISSION_FIELD, NATIVE_LEASE_ADMISSION_KEY, NATIVE_LEASE_BUDGET_FIELD, NATIVE_LEASE_BUDGET_KEY, NATIVE_LEASE_HOLD_FIELD, NATIVE_LEASE_HOLD_KEY, NATIVE_LEASE_SCENE_BUDGET_FIELD, NATIVE_LEASE_SCENE_BUDGET_KEY, NATIVE_LEASE_SECTION_ID, NATIVE_LEASE_TILE_BUDGET_FIELD, NATIVE_LEASE_TILE_BUDGET_KEY, type NativeLeaseAdmission, NativeLeaseAdmissionSchema, type NativeLeaseKnob, type NativeLeaseNumberKnob, type NativeLeaseSettings, type NativeLeaseSettingsOverride, NativeLeaseSettingsSchema, pickNativeLeaseOverride, readNativeLeaseOverride, } from './pipeline/native-lease.js';
246
247
  export { ACCESS_ROLES, type AccessRoleAssignment, type AccessRoleId, type AccessRoleSpec, buildRoleScopes, detectAccessRole, roleSpec, } from './schemas/access-roles.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-QxyLiUId.js");
2
+ const require_sleep = require("./sleep-8K9gue-H.js");
3
3
  const require_event_category = require("./event-category-BVfsrBYA.js");
4
4
  const require_canonical_hash = require("./canonical-hash-CSE4ioRi.js");
5
5
  const require_enums = require("./enums.js");
@@ -7567,14 +7567,44 @@ var AudioClassificationLabelSchema = zod.z.object({
7567
7567
  originalClass: zod.z.string().optional(),
7568
7568
  score: zod.z.number()
7569
7569
  });
7570
+ /**
7571
+ * Why an audio window reached no classifier (D660). `superseded` is the ONLY
7572
+ * contention drop the analyzer makes: a camera's pending window replaced by
7573
+ * its own newer one while the single pipeline served other cameras. `error`
7574
+ * is an inference (or pipeline spawn) that failed, including a backend that
7575
+ * exited or was disposed mid-inference; `timeout` is an inference that did not
7576
+ * answer within the analyzer's bound (the backend is then killed and
7577
+ * respawned); `disposed` is a window still queued when the analyzer shut down.
7578
+ */
7579
+ var AUDIO_NOT_CLASSIFIED_REASONS = [
7580
+ "superseded",
7581
+ "error",
7582
+ "timeout",
7583
+ "disposed"
7584
+ ];
7585
+ /**
7586
+ * Did the classifier RUN on this window? (D660)
7587
+ *
7588
+ * `classified` with no labels means the model heard nothing above the
7589
+ * camera's floor. `not-classified` means nobody listened — and until D660 the
7590
+ * two were the same shape (`classification` absent), so a window the global
7591
+ * busy gate threw away read downstream exactly like a quiet one (D393).
7592
+ */
7593
+ var AudioClassifyOutcomeSchema = zod.z.discriminatedUnion("state", [zod.z.object({ state: zod.z.literal("classified") }), zod.z.object({
7594
+ state: zod.z.literal("not-classified"),
7595
+ reason: zod.z.enum(AUDIO_NOT_CLASSIFIED_REASONS)
7596
+ })]);
7570
7597
  //#endregion
7571
7598
  //#region src/capabilities/audio-analyzer.cap.ts
7572
7599
  var AudioAnalysisResultSchema = zod.z.object({
7573
7600
  level: AudioLevelSchema,
7601
+ /** Labels at or above the camera's floor. Absent = none — read `classifyOutcome` to know whether the model ran at all. */
7574
7602
  classification: zod.z.object({
7575
7603
  labels: zod.z.array(AudioClassificationLabelSchema).readonly(),
7576
7604
  inferenceMs: zod.z.number()
7577
7605
  }).optional(),
7606
+ /** Whether the classifier ran on this window (D660). */
7607
+ classifyOutcome: AudioClassifyOutcomeSchema,
7578
7608
  timestamp: zod.z.number()
7579
7609
  });
7580
7610
  var AudioAnalysisSettingsSchema = zod.z.object({
@@ -12510,8 +12540,22 @@ var LinkedDeviceSchema = zod.z.object({
12510
12540
  * The `linked-devices` extension slot's editable value (D648): the operator's
12511
12541
  * pick list, exactly what `_linkedDeviceIds` persists. Tree children are NOT
12512
12542
  * in it — they are always linked and are not a pick.
12543
+ *
12544
+ * `trackedDeviceIds` (D655) is the tracked-event opt-in, exactly what
12545
+ * `_linkedDeviceTrackedIds` persists: which linked devices materialize a
12546
+ * synthetic tracked event on the camera. A read always carries it AS STORED
12547
+ * (an absent key reads as `[]`, which is what the resolver makes of it —
12548
+ * NONE). On a write it is optional: absent leaves the opt-in untouched, so a
12549
+ * card built before D655 cannot erase it by saving the pick list. A present
12550
+ * list REPLACES the opt-in; each id must be a pick, a device the camera links
12551
+ * by structure (the row's `impliedSources`: tree children, a picked
12552
+ * container's child) or already stored — so what was read can always be
12553
+ * written back unchanged, and a NEW opt-in outside the linked set is refused.
12513
12554
  */
12514
- var LinkedDevicesSlotValueSchema = zod.z.object({ deviceIds: zod.z.array(zod.z.number().int().positive()) });
12555
+ var LinkedDevicesSlotValueSchema = zod.z.object({
12556
+ deviceIds: zod.z.array(zod.z.number().int().positive()),
12557
+ trackedDeviceIds: zod.z.array(zod.z.number().int().positive()).optional()
12558
+ });
12515
12559
  /**
12516
12560
  * The `linked-devices` slot — a camera's companion devices, owned by the
12517
12561
  * device manager over `_linkedDeviceIds` (D648, D356). Any device may be a
@@ -12678,7 +12722,6 @@ var deviceManagerCapability = {
12678
12722
  scope: "system",
12679
12723
  mode: "singleton",
12680
12724
  extensionSlots: [LINKED_DEVICES_SLOT],
12681
- exposesDeviceSettings: true,
12682
12725
  methods: {
12683
12726
  /** Reserve (or re-resolve) a progressive numeric id for `(addonId, stableId)`.
12684
12727
  * Idempotent: returns the existing id if one is already persisted for the
@@ -13185,8 +13228,8 @@ var deviceManagerCapability = {
13185
13228
  * operator's persisted pick list (`mode` is always `manual` since D356:
13186
13229
  * same-location devices are suggested by the picker, never linked on
13187
13230
  * their own). Excludes the camera itself; deduped. The list is written by
13188
- * the settings section or the `linked-devices` extension slot, both over
13189
- * `_linkedDeviceIds` (see the module docblock).
13231
+ * the `linked-devices` extension slot over `_linkedDeviceIds` (see the
13232
+ * module docblock).
13190
13233
  */
13191
13234
  getLinkedDevices: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.object({
13192
13235
  mode: LinkedDevicesModeSchema,
@@ -17743,7 +17786,7 @@ var NcOccupancyConditionSchema = zod.z.object({
17743
17786
  });
17744
17787
  /**
17745
17788
  * The dBFS floor the analyzer reports on digital silence
17746
- * (`audio-analyzer-provider.ts`: `dbfs = rms > 0 ? 20*log10(rms) : -96`).
17789
+ * (`AudioAnalyzerProvider.analyseChunk`: `dbfs = rms > 0 ? 20*log10(rms) : -96`).
17747
17790
  *
17748
17791
  * It is the lower bound of {@link NcAudioConditionSchema.shape.dbThreshold} for
17749
17792
  * one reason worth stating out loud: **the scale is dBFS and it is
@@ -21610,6 +21653,13 @@ var AudioEventSchema = zod.z.object({
21610
21653
  originalClass: zod.z.string().optional(),
21611
21654
  score: zod.z.number()
21612
21655
  }).optional(),
21656
+ /**
21657
+ * Whether the classifier RAN on the window behind this row (D660). Absent
21658
+ * on rows written before D660 — unknown, NOT classified: until then a
21659
+ * window the analyzer's busy gate threw away was stored exactly like one
21660
+ * that heard nothing above the floor.
21661
+ */
21662
+ classifyOutcome: AudioClassifyOutcomeSchema.optional(),
21613
21663
  /** Populated by B5 (recording playback URL for this event). */
21614
21664
  mediaUrl: zod.z.string().optional()
21615
21665
  });
@@ -24081,7 +24131,14 @@ var pipelineExecutorCapability = {
24081
24131
  */
24082
24132
  inferCached: require_sleep.method(zod.z.object({
24083
24133
  stepId: zod.z.string(),
24084
- frameId: zod.z.number().int()
24134
+ frameId: zod.z.number().int(),
24135
+ /**
24136
+ * The model to time — REQUIRED (D658). Without it the pool answered the
24137
+ * step's ACTIVE variant (the first loaded after boot), so a benchmark
24138
+ * of model B silently timed model A. Callers pass the `rootModelId`
24139
+ * their warmup `runPipeline` reported: the model that actually ran.
24140
+ */
24141
+ modelId: zod.z.string().min(1)
24085
24142
  }), zod.z.record(zod.z.string(), zod.z.unknown()), { kind: "mutation" }),
24086
24143
  /**
24087
24144
  * Release a cached frame from the Python pool's memory.
@@ -30188,7 +30245,6 @@ var doorbellCapability = {
30188
30245
  kind: "wrapper",
30189
30246
  defaultActive: false,
30190
30247
  deviceTypes: [require_sleep.DeviceType.Button, require_sleep.DeviceType.Camera],
30191
- exposesDeviceSettings: true,
30192
30248
  extensionSlots: [DOORBELL_SOURCE_SLOT],
30193
30249
  methods: {},
30194
30250
  events: {
@@ -30348,7 +30404,17 @@ var ExtensionSlotStateSchema = zod.z.object({
30348
30404
  projects: zod.z.string().nullable(),
30349
30405
  activation: ExtensionSlotActivationSchema.nullable(),
30350
30406
  value: ExtensionSlotValueSchema,
30351
- sources: zod.z.array(ExtensionSlotSourceSchema)
30407
+ sources: zod.z.array(ExtensionSlotSourceSchema),
30408
+ /**
30409
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
30410
+ * are therefore not in `value` (D655): a camera's device-tree children, and
30411
+ * the child a picked container stands for (D356 — a container is never a
30412
+ * pick, its children are). Read-only; the editor shows them and may offer
30413
+ * per-device options on them (the linked-devices tracked-event opt-in).
30414
+ * Absent when the owner links nothing beyond the picks, and from an owner
30415
+ * older than D655.
30416
+ */
30417
+ impliedSources: zod.z.array(ExtensionSlotSourceSchema).optional()
30352
30418
  });
30353
30419
  /**
30354
30420
  * A provider that could not answer `listSlots` at all. It could not name its
@@ -44570,7 +44636,8 @@ function createDeviceExtensionProvider(options) {
44570
44636
  projects: EXTENSION_SLOTS[slot.slot].descriptor.projects ?? null,
44571
44637
  activation: listing.activation,
44572
44638
  value: listing.value,
44573
- sources: [...listing.sources]
44639
+ sources: [...listing.sources],
44640
+ ...listing.impliedSources !== void 0 ? { impliedSources: [...listing.impliedSources] } : {}
44574
44641
  });
44575
44642
  }
44576
44643
  return rows;
@@ -52174,12 +52241,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
52174
52241
  addonId: null,
52175
52242
  access: "create"
52176
52243
  },
52177
- "deviceManager.applyDeviceSettingsPatch": {
52178
- capName: "device-manager",
52179
- capScope: "system",
52180
- addonId: null,
52181
- access: "create"
52182
- },
52183
52244
  "deviceManager.applyInitialMeta": {
52184
52245
  capName: "device-manager",
52185
52246
  capScope: "system",
@@ -52282,12 +52343,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
52282
52343
  addonId: null,
52283
52344
  access: "view"
52284
52345
  },
52285
- "deviceManager.getDeviceLiveContribution": {
52286
- capName: "device-manager",
52287
- capScope: "system",
52288
- addonId: null,
52289
- access: "view"
52290
- },
52291
52346
  "deviceManager.getDeviceLiveInfoAggregate": {
52292
52347
  capName: "device-manager",
52293
52348
  capScope: "system",
@@ -52300,12 +52355,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
52300
52355
  addonId: null,
52301
52356
  access: "view"
52302
52357
  },
52303
- "deviceManager.getDeviceSettingsContribution": {
52304
- capName: "device-manager",
52305
- capScope: "system",
52306
- addonId: null,
52307
- access: "view"
52308
- },
52309
52358
  "deviceManager.getDeviceStatusAggregate": {
52310
52359
  capName: "device-manager",
52311
52360
  capScope: "system",
@@ -52810,24 +52859,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
52810
52859
  addonId: null,
52811
52860
  access: "view"
52812
52861
  },
52813
- "doorbell.applyDeviceSettingsPatch": {
52814
- capName: "doorbell",
52815
- capScope: "device",
52816
- addonId: null,
52817
- access: "create"
52818
- },
52819
- "doorbell.getDeviceLiveContribution": {
52820
- capName: "doorbell",
52821
- capScope: "device",
52822
- addonId: null,
52823
- access: "view"
52824
- },
52825
- "doorbell.getDeviceSettingsContribution": {
52826
- capName: "doorbell",
52827
- capScope: "device",
52828
- addonId: null,
52829
- access: "view"
52830
- },
52831
52862
  "doorbell.getStatus": {
52832
52863
  capName: "doorbell",
52833
52864
  capScope: "device",
@@ -64552,6 +64583,23 @@ function readTimelapseGeneratedAt(rule, deviceId) {
64552
64583
  return rule.lastGeneratedAt ?? 0;
64553
64584
  }
64554
64585
  //#endregion
64586
+ //#region src/pipeline/step-format-runnable.ts
64587
+ /** True when `model` ships a build for `format`. */
64588
+ function hasBuild(model, format) {
64589
+ return Boolean(model.formats[format]);
64590
+ }
64591
+ /**
64592
+ * Can a pool of `format` run a step whose catalog is `models`, given the model
64593
+ * the step names (`null`/absent = unpinned, the format default)?
64594
+ */
64595
+ function stepModelRunsOnFormat(models, modelId, format) {
64596
+ if (modelId !== void 0 && modelId !== null) {
64597
+ const named = models.find((m) => m.id === modelId);
64598
+ if (named !== void 0 && hasBuild(named, format)) return true;
64599
+ }
64600
+ return models.some((m) => m.legacy !== true && hasBuild(m, format));
64601
+ }
64602
+ //#endregion
64555
64603
  //#region src/pipeline/detail-crop.ts
64556
64604
  /**
64557
64605
  * THE detail-crop convention — the single derivation of the rectangle a
@@ -66988,6 +67036,7 @@ exports.AUDIO_ANALYSIS_CAP_NAME = AUDIO_ANALYSIS_CAP_NAME;
66988
67036
  exports.AUDIO_BACKEND_CHOICES = AUDIO_BACKEND_CHOICES;
66989
67037
  exports.AUDIO_CHUNK_FORMATS = require_sleep.AUDIO_CHUNK_FORMATS;
66990
67038
  exports.AUDIO_MACRO_LABELS = AUDIO_MACRO_LABELS;
67039
+ exports.AUDIO_NOT_CLASSIFIED_REASONS = AUDIO_NOT_CLASSIFIED_REASONS;
66991
67040
  exports.AUDIO_PRESETS = require_canonical_hash.AUDIO_PRESETS;
66992
67041
  exports.AUDIO_SCALE_EPOCH_ISO = AUDIO_SCALE_EPOCH_ISO;
66993
67042
  exports.AUDIO_SCALE_EPOCH_MS = AUDIO_SCALE_EPOCH_MS;
@@ -67041,6 +67090,7 @@ exports.AudioChunkInputSchema = AudioChunkInputSchema;
67041
67090
  exports.AudioClassSummarySchema = AudioClassSummarySchema;
67042
67091
  exports.AudioClassificationLabelSchema = AudioClassificationLabelSchema;
67043
67092
  exports.AudioClassificationResultSchema = AudioClassificationResultSchema;
67093
+ exports.AudioClassifyOutcomeSchema = AudioClassifyOutcomeSchema;
67044
67094
  exports.AudioCodecInfoSchema = AudioCodecInfoSchema;
67045
67095
  exports.AudioDecodeSessionConfigSchema = AudioDecodeSessionConfigSchema;
67046
67096
  exports.AudioDetachDeviceResultSchema = AudioDetachDeviceResultSchema;
@@ -68742,6 +68792,7 @@ exports.snapshotCapability = snapshotCapability;
68742
68792
  exports.ssoBridgeCapability = ssoBridgeCapability;
68743
68793
  exports.startReachabilityPoll = startReachabilityPoll;
68744
68794
  exports.stateVocabularyFor = stateVocabularyFor;
68795
+ exports.stepModelRunsOnFormat = stepModelRunsOnFormat;
68745
68796
  exports.storageCapability = storageCapability;
68746
68797
  exports.storageEvictableCapability = storageEvictableCapability;
68747
68798
  exports.storageMigrationCapability = storageMigrationCapability;