@camstack/types 1.2.245 → 1.2.247

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.
@@ -1349,6 +1349,56 @@ var DATAPLANE_SECRET_HEADER = "x-camstack-dataplane-secret";
1349
1349
  */
1350
1350
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
1351
1351
  //#endregion
1352
+ //#region src/interfaces/addon-peer-bytes.ts
1353
+ /**
1354
+ * How long a minted ticket stays takeable.
1355
+ *
1356
+ * The consumer's dial is the next thing that happens after the cap call that
1357
+ * minted it returns — measured well under 100 ms on the same host for the clip
1358
+ * dial this is generalised from. Thirty seconds covers a busy hub and is short
1359
+ * enough that a ticket which leaked into a log is worth nothing by the time
1360
+ * anybody reads it.
1361
+ */
1362
+ var PEER_BYTES_TICKET_TTL_MS = 3e4;
1363
+ /**
1364
+ * Tickets minted and not yet taken or expired, per addon process.
1365
+ *
1366
+ * A bound, not a budget: it exists so a caller that mints and never dials
1367
+ * cannot grow a map without limit, and so a per-frame misuse of this facility
1368
+ * is refused by name rather than working slowly.
1369
+ */
1370
+ var PEER_BYTES_MAX_OUTSTANDING = 64;
1371
+ /**
1372
+ * How long the producer waits on a consumer that has stopped reading before it
1373
+ * cuts the body.
1374
+ *
1375
+ * D447: a raw HTTP stream reads no chunk the socket has not taken. The producer
1376
+ * honours `write()`'s return and awaits `drain`; a peer that never drains is
1377
+ * a peer that is gone, and holding the body for it is the unbounded buffer this
1378
+ * whole facility exists to avoid.
1379
+ */
1380
+ var PEER_BYTES_STALL_MS = 15e3;
1381
+ /** Bytes handed to the socket per `write()` when the producer holds a buffer. */
1382
+ var PEER_BYTES_CHUNK_BYTES = 256 * 1024;
1383
+ /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
1384
+ var PeerBytesTicketSchema = z.object({
1385
+ /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
1386
+ url: z.string().min(1),
1387
+ /**
1388
+ * The HOST node this URL means something on — the hub or a named agent,
1389
+ * never a runner. {@link AddonPeerBytes.open} compares it to its own and
1390
+ * refuses `cross-node` by name when they differ, without dialling.
1391
+ */
1392
+ hostNodeId: z.string().min(1),
1393
+ expiresAtMs: z.number().int().nonnegative(),
1394
+ /**
1395
+ * What the producer DECLARED the body to be, when it knows — `null` when it
1396
+ * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
1397
+ * must be able to tell "the producer did not say" from "the body is empty".
1398
+ */
1399
+ declaredBytes: z.number().int().nonnegative().nullable()
1400
+ });
1401
+ //#endregion
1352
1402
  //#region src/capabilities/schemas/streaming-shared.ts
1353
1403
  /** Shared Zod schemas used across streaming capabilities. */
1354
1404
  var CamProfileSchema = z.enum([
@@ -3581,11 +3631,6 @@ function createDeviceProxy(api, binding, opts) {
3581
3631
  },
3582
3632
  enumSensor: { getStatus: (input) => dispatch("enum-sensor", "enumSensor", "getStatus", "query", input) },
3583
3633
  eventEmitter: { getStatus: (input) => dispatch("event-emitter", "eventEmitter", "getStatus", "query", input) },
3584
- events: {
3585
- getEvents: (input) => dispatch("events", "events", "getEvents", "query", input),
3586
- getEventThumbnail: (input) => dispatch("events", "events", "getEventThumbnail", "query", input),
3587
- getEventClipUrl: (input) => dispatch("events", "events", "getEventClipUrl", "query", input)
3588
- },
3589
3634
  fanControl: {
3590
3635
  setPercentage: (input) => dispatch("fan-control", "fanControl", "setPercentage", "mutation", input),
3591
3636
  setPreset: (input) => dispatch("fan-control", "fanControl", "setPreset", "mutation", input),
@@ -3837,6 +3882,13 @@ function createDeviceProxy(api, binding, opts) {
3837
3882
  setSettings: (input) => dispatch("ptz-autotrack", "ptzAutotrack", "setSettings", "mutation", input)
3838
3883
  },
3839
3884
  reboot: { reboot: (input) => dispatch("reboot", "reboot", "reboot", "mutation", input) },
3885
+ recording: {
3886
+ listSources: (input) => dispatch("recording", "recording", "listSources", "query", input),
3887
+ getAvailability: (input) => dispatch("recording", "recording", "getAvailability", "query", input),
3888
+ getDaysWithRecordings: (input) => dispatch("recording", "recording", "getDaysWithRecordings", "query", input),
3889
+ getPlayback: (input) => dispatch("recording", "recording", "getPlayback", "query", input),
3890
+ getPlaybackOptions: (input) => dispatch("recording", "recording", "getPlaybackOptions", "query", input)
3891
+ },
3840
3892
  recordingOnboard: {
3841
3893
  getOptions: (input) => dispatch("recording-onboard", "recordingOnboard", "getOptions", "query", input),
3842
3894
  setSettings: (input) => dispatch("recording-onboard", "recordingOnboard", "setSettings", "mutation", input),
@@ -3912,7 +3964,9 @@ function createDeviceProxy(api, binding, opts) {
3912
3964
  listSources: (input) => dispatch("videoclips", "videoclips", "listSources", "query", input),
3913
3965
  getClipPlayback: (input) => dispatch("videoclips", "videoclips", "getClipPlayback", "query", input),
3914
3966
  readClipBytes: (input) => dispatch("videoclips", "videoclips", "readClipBytes", "query", input),
3915
- dialClipStream: (input) => dispatch("videoclips", "videoclips", "dialClipStream", "query", input)
3967
+ offerClipBytes: (input) => dispatch("videoclips", "videoclips", "offerClipBytes", "query", input),
3968
+ dialClipStream: (input) => dispatch("videoclips", "videoclips", "dialClipStream", "query", input),
3969
+ getPlaybackOptions: (input) => dispatch("videoclips", "videoclips", "getPlaybackOptions", "query", input)
3916
3970
  },
3917
3971
  waterHeater: {
3918
3972
  setTargetTemp: (input) => dispatch("water-heater", "waterHeater", "setTargetTemp", "mutation", input),
@@ -4072,25 +4126,22 @@ function createDeviceProxy(api, binding, opts) {
4072
4126
  listPlates: (input) => dispatchSystem("plateGallery", "listPlates", "query", input),
4073
4127
  getPlateByTrack: (input) => dispatchSystem("plateGallery", "getPlateByTrack", "query", input)
4074
4128
  },
4075
- recording: {
4076
- getAvailability: (input) => dispatchSystem("recording", "getAvailability", "query", input),
4077
- getDaysWithRecordings: (input) => dispatchSystem("recording", "getDaysWithRecordings", "query", input),
4078
- getPlaybackManifest: (input) => dispatchSystem("recording", "getPlaybackManifest", "query", input),
4079
- getDeviceConfig: (input) => dispatchSystem("recording", "getDeviceConfig", "query", input),
4080
- locateSegment: (input) => dispatchSystem("recording", "locateSegment", "query", input),
4081
- readSegmentBytes: (input) => dispatchSystem("recording", "readSegmentBytes", "query", input),
4082
- readGopBytes: (input) => dispatchSystem("recording", "readGopBytes", "query", input),
4083
- readWindowBytes: (input) => dispatchSystem("recording", "readWindowBytes", "query", input),
4084
- setDeviceConfig: (input) => dispatchSystem("recording", "setDeviceConfig", "mutation", input),
4085
- rescanStorage: (input) => dispatchSystem("recording", "rescanStorage", "mutation", input),
4086
- pruneFootage: (input) => dispatchSystem("recording", "pruneFootage", "mutation", input),
4087
- deleteFootprint: (input) => dispatchSystem("recording", "deleteFootprint", "mutation", input),
4088
- renderGif: (input) => dispatchSystem("recording", "renderGif", "mutation", input),
4089
- renderClip: (input) => dispatchSystem("recording", "renderClip", "mutation", input),
4090
- getStatus: (input) => dispatchSystem("recording", "getStatus", "query", input),
4091
- getDeviceSettingsContribution: (input) => dispatchSystem("recording", "getDeviceSettingsContribution", "query", input),
4092
- getDeviceLiveContribution: (input) => dispatchSystem("recording", "getDeviceLiveContribution", "query", input),
4093
- applyDeviceSettingsPatch: (input) => dispatchSystem("recording", "applyDeviceSettingsPatch", "mutation", input)
4129
+ recordingArchive: {
4130
+ getDeviceConfig: (input) => dispatchSystem("recordingArchive", "getDeviceConfig", "query", input),
4131
+ locateSegment: (input) => dispatchSystem("recordingArchive", "locateSegment", "query", input),
4132
+ readSegmentBytes: (input) => dispatchSystem("recordingArchive", "readSegmentBytes", "query", input),
4133
+ readGopBytes: (input) => dispatchSystem("recordingArchive", "readGopBytes", "query", input),
4134
+ readWindowBytes: (input) => dispatchSystem("recordingArchive", "readWindowBytes", "query", input),
4135
+ setDeviceConfig: (input) => dispatchSystem("recordingArchive", "setDeviceConfig", "mutation", input),
4136
+ rescanStorage: (input) => dispatchSystem("recordingArchive", "rescanStorage", "mutation", input),
4137
+ pruneFootage: (input) => dispatchSystem("recordingArchive", "pruneFootage", "mutation", input),
4138
+ deleteFootprint: (input) => dispatchSystem("recordingArchive", "deleteFootprint", "mutation", input),
4139
+ renderGif: (input) => dispatchSystem("recordingArchive", "renderGif", "mutation", input),
4140
+ renderClip: (input) => dispatchSystem("recordingArchive", "renderClip", "mutation", input),
4141
+ getStatus: (input) => dispatchSystem("recordingArchive", "getStatus", "query", input),
4142
+ getDeviceSettingsContribution: (input) => dispatchSystem("recordingArchive", "getDeviceSettingsContribution", "query", input),
4143
+ getDeviceLiveContribution: (input) => dispatchSystem("recordingArchive", "getDeviceLiveContribution", "query", input),
4144
+ applyDeviceSettingsPatch: (input) => dispatchSystem("recordingArchive", "applyDeviceSettingsPatch", "mutation", input)
4094
4145
  },
4095
4146
  recordingExport: { listExports: (input) => dispatchSystem("recordingExport", "listExports", "query", input) },
4096
4147
  streamBroker: {
@@ -4155,7 +4206,6 @@ var DEVICE_SCOPED_CAPS = new Set([
4155
4206
  "doorbell",
4156
4207
  "enum-sensor",
4157
4208
  "event-emitter",
4158
- "events",
4159
4209
  "fan-control",
4160
4210
  "feature-probe",
4161
4211
  "flood",
@@ -4187,6 +4237,7 @@ var DEVICE_SCOPED_CAPS = new Set([
4187
4237
  "ptz",
4188
4238
  "ptz-autotrack",
4189
4239
  "reboot",
4240
+ "recording",
4190
4241
  "recording-onboard",
4191
4242
  "recording-signal",
4192
4243
  "scene-monitor",
@@ -4373,4 +4424,4 @@ function sleepCancellable(ms, signal) {
4373
4424
  });
4374
4425
  }
4375
4426
  //#endregion
4376
- export { AudioStreamPickSchema as $, DeviceType as A, createDurableState as At, optionalMethod as B, AUDIO_CHUNK_FORMATS as Bt, customAction as C, parseProfileBrokerId as Ct, ChargingStatus as D, DisposerChain as Dt, deviceCustomAction as E, SHARE_VIEW_KINDS as Et, PROVIDER_PIN_FIELD as F, WELL_KNOWN_TAB_MAP as Ft, readNodePin as G, systemMethod as H, expandAudioChunkToF32le as Ht, event as I, collectHydratedFieldEntries as It, ReadinessTimeoutError as J, toNodeId as K, expandCapMethods as L, collectHydratedFieldValues as Lt, DEFAULT_RUNTIME_STATE_DURABILITY as M, emitReadiness as Mt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as N, isEvent as Nt, DeviceFeature as O, BaseAddon as Ot, DEVICE_STATUS_METHOD as P, WELL_KNOWN_TABS as Pt, AudioChunkFormatSchema as Q, isDeviceConfigCap as R, hydrateSchema as Rt, DEVICE_CHILDREN_BATCH_MAX as S, makeSourceBrokerId as St, describeCustomActions as T, DATAPLANE_SECRET_HEADER as Tt, CAP_NODE_PIN_CONTEXT_KEY as U, isAudioChunkFormat as Ut, resolveCapMount as V, audioChunkBytesPerSample as Vt, nodePin as W, readinessKey as X, emitDownForOwnedCaps as Y, scopeKey as Z, createMirrorSource as _, SubscribeAudioChunksInputSchema as _t, asJsonObject as a, CamStreamResolutionSchema as at, deviceOpsCapability as b, SubscribeFramesResultSchema as bt, parseJsonArray as c, DecodedFrameSchema as ct, BOOT_RECOVERY_BACKOFF_MS as d, FrameHandleSchema as dt, BrokerStatsSchema as et, DEVICE_SCOPED_CAPS as f, ProfileRtspEntrySchema as ft, createLazyTrpcSource as g, StreamSourceSchema as gt, createEventBusSliceSource as h, StreamSourceEntrySchema$1 as ht, asJsonArray as i, CamStreamKindSchema as it, adminUiCapability as j, createEvent as jt, DeviceRole as k, normalizeAddonInitResult as kt, parseJsonObject as l, EncodedPacketSchema as lt, createDeviceProxy as m, ProfileSlotStatusSchema as mt, sleepCancellable as n, CAM_PROFILE_ORDER as nt, asNumber as o, CameraStreamSchema as ot, isDeviceScopedCap as p, ProfileSlotSchema as pt, ReadinessRegistry as q, asBoolean as r, CamProfileSchema as rt, asString as s, DecodedAudioChunkSchema as st, sleep as t, BrokerStatusSchema as tt, parseJsonUnknown as u, FrameHandleFormatSchema as ut, createSliceHandle as v, SubscribeAudioChunksResultSchema as vt, defineCustomActions as w, selectAssignedProfileSlots as wt, viewerUiCapability as x, makeProfileBrokerId as xt, RawStateResultSchema as y, SubscribeFramesInputSchema as yt, method as z, resolveHydratedFieldValue as zt };
4427
+ export { AudioStreamPickSchema as $, DeviceType as A, DATAPLANE_SECRET_HEADER as At, optionalMethod as B, WELL_KNOWN_TAB_MAP as Bt, customAction as C, parseProfileBrokerId as Ct, ChargingStatus as D, PEER_BYTES_STALL_MS as Dt, deviceCustomAction as E, PEER_BYTES_MAX_OUTSTANDING as Et, PROVIDER_PIN_FIELD as F, createDurableState as Ft, readNodePin as G, AUDIO_CHUNK_FORMATS as Gt, systemMethod as H, collectHydratedFieldValues as Ht, event as I, createEvent as It, ReadinessTimeoutError as J, isAudioChunkFormat as Jt, toNodeId as K, audioChunkBytesPerSample as Kt, expandCapMethods as L, emitReadiness as Lt, DEFAULT_RUNTIME_STATE_DURABILITY as M, DisposerChain as Mt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as N, BaseAddon as Nt, DeviceFeature as O, PEER_BYTES_TICKET_TTL_MS as Ot, DEVICE_STATUS_METHOD as P, normalizeAddonInitResult as Pt, AudioChunkFormatSchema as Q, isDeviceConfigCap as R, isEvent as Rt, DEVICE_CHILDREN_BATCH_MAX as S, makeSourceBrokerId as St, describeCustomActions as T, PEER_BYTES_CHUNK_BYTES as Tt, CAP_NODE_PIN_CONTEXT_KEY as U, hydrateSchema as Ut, resolveCapMount as V, collectHydratedFieldEntries as Vt, nodePin as W, resolveHydratedFieldValue as Wt, readinessKey as X, emitDownForOwnedCaps as Y, scopeKey as Z, createMirrorSource as _, SubscribeAudioChunksInputSchema as _t, asJsonObject as a, CamStreamResolutionSchema as at, deviceOpsCapability as b, SubscribeFramesResultSchema as bt, parseJsonArray as c, DecodedFrameSchema as ct, BOOT_RECOVERY_BACKOFF_MS as d, FrameHandleSchema as dt, BrokerStatsSchema as et, DEVICE_SCOPED_CAPS as f, ProfileRtspEntrySchema as ft, createLazyTrpcSource as g, StreamSourceSchema as gt, createEventBusSliceSource as h, StreamSourceEntrySchema$1 as ht, asJsonArray as i, CamStreamKindSchema as it, adminUiCapability as j, SHARE_VIEW_KINDS as jt, DeviceRole as k, PeerBytesTicketSchema as kt, parseJsonObject as l, EncodedPacketSchema as lt, createDeviceProxy as m, ProfileSlotStatusSchema as mt, sleepCancellable as n, CAM_PROFILE_ORDER as nt, asNumber as o, CameraStreamSchema as ot, isDeviceScopedCap as p, ProfileSlotSchema as pt, ReadinessRegistry as q, expandAudioChunkToF32le as qt, asBoolean as r, CamProfileSchema as rt, asString as s, DecodedAudioChunkSchema as st, sleep as t, BrokerStatusSchema as tt, parseJsonUnknown as u, FrameHandleFormatSchema as ut, createSliceHandle as v, SubscribeAudioChunksResultSchema as vt, defineCustomActions as w, selectAssignedProfileSlots as wt, viewerUiCapability as x, makeProfileBrokerId as xt, RawStateResultSchema as y, SubscribeFramesInputSchema as yt, method as z, WELL_KNOWN_TABS as zt };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.245",
3
+ "version": "1.2.247",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1,47 +0,0 @@
1
- import { z } from 'zod';
2
- import { type InferProvider } from './capability-definition.js';
3
- import { DeviceType } from '../device/device-type.js';
4
- declare const EventItemSchema: z.ZodObject<{
5
- id: z.ZodString;
6
- type: z.ZodString;
7
- timestamp: z.ZodNumber;
8
- label: z.ZodOptional<z.ZodString>;
9
- thumbnailUrl: z.ZodOptional<z.ZodString>;
10
- clipUrl: z.ZodOptional<z.ZodString>;
11
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
12
- }, z.core.$strip>;
13
- export declare const eventsCapability: {
14
- readonly name: "events";
15
- readonly scope: "device";
16
- readonly mode: "singleton";
17
- readonly deviceTypes: readonly [DeviceType.Camera];
18
- readonly methods: {
19
- readonly getEvents: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
20
- deviceId: z.ZodNumber;
21
- from: z.ZodOptional<z.ZodNumber>;
22
- to: z.ZodOptional<z.ZodNumber>;
23
- limit: z.ZodOptional<z.ZodNumber>;
24
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
25
- id: z.ZodString;
26
- type: z.ZodString;
27
- timestamp: z.ZodNumber;
28
- label: z.ZodOptional<z.ZodString>;
29
- thumbnailUrl: z.ZodOptional<z.ZodString>;
30
- clipUrl: z.ZodOptional<z.ZodString>;
31
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
32
- }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
33
- readonly getEventThumbnail: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
34
- deviceId: z.ZodNumber;
35
- eventId: z.ZodString;
36
- }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
37
- base64: z.ZodString;
38
- contentType: z.ZodString;
39
- }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
40
- readonly getEventClipUrl: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
41
- deviceId: z.ZodNumber;
42
- eventId: z.ZodString;
43
- }, z.core.$strip>, z.ZodNullable<z.ZodString>, import("./capability-definition.js").CapabilityMethodKind>;
44
- };
45
- };
46
- export type IEventsProvider = InferProvider<typeof eventsCapability>;
47
- export { EventItemSchema };