@camstack/types 1.2.16 → 1.2.18

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 (64) hide show
  1. package/dist/addon.d.ts +1 -0
  2. package/dist/addon.js +266 -2
  3. package/dist/addon.mjs +265 -3
  4. package/dist/capabilities/addons.cap.d.ts +7 -7
  5. package/dist/capabilities/broker.cap.d.ts +8 -8
  6. package/dist/capabilities/camera-streams.cap.d.ts +5 -5
  7. package/dist/capabilities/climate-control.cap.d.ts +8 -8
  8. package/dist/capabilities/day-night.cap.d.ts +8 -8
  9. package/dist/capabilities/decoder.cap.d.ts +2 -2
  10. package/dist/capabilities/device-manager.cap.d.ts +24 -2
  11. package/dist/capabilities/face-gallery.cap.d.ts +1 -1
  12. package/dist/capabilities/image-settings.cap.d.ts +16 -16
  13. package/dist/capabilities/index.d.ts +2 -2
  14. package/dist/capabilities/intercom.cap.d.ts +6 -6
  15. package/dist/capabilities/lawn-mower-control.cap.d.ts +4 -4
  16. package/dist/capabilities/llm-runtime.cap.d.ts +3 -3
  17. package/dist/capabilities/llm.cap.d.ts +4 -4
  18. package/dist/capabilities/local-network.cap.d.ts +38 -0
  19. package/dist/capabilities/media-player.cap.d.ts +9 -9
  20. package/dist/capabilities/metrics-provider.cap.d.ts +2 -2
  21. package/dist/capabilities/mqtt-broker.cap.d.ts +3 -3
  22. package/dist/capabilities/notification-output.cap.d.ts +4 -0
  23. package/dist/capabilities/notification-rules.cap.d.ts +378 -18
  24. package/dist/capabilities/pipeline-analytics.cap.d.ts +133 -27
  25. package/dist/capabilities/pipeline-executor.cap.d.ts +2 -2
  26. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +15 -15
  27. package/dist/capabilities/pipeline-runner.cap.d.ts +2 -2
  28. package/dist/capabilities/recording-export.cap.d.ts +7 -7
  29. package/dist/capabilities/recording.cap.d.ts +102 -129
  30. package/dist/capabilities/schemas/orchestrator-metrics.d.ts +2 -2
  31. package/dist/capabilities/schemas/streaming-shared.d.ts +4 -4
  32. package/dist/capabilities/storage-provider.cap.d.ts +44 -0
  33. package/dist/capabilities/storage.cap.d.ts +17 -1
  34. package/dist/capabilities/stream-broker.cap.d.ts +58 -12
  35. package/dist/capabilities/webrtc-session.cap.d.ts +6 -6
  36. package/dist/enums/event-category.d.ts +13 -0
  37. package/dist/enums.js +1 -1
  38. package/dist/enums.mjs +1 -1
  39. package/dist/{event-category-Cdyife4p.js → event-category-39bpf1r_.js} +13 -0
  40. package/dist/{event-category-BLcNejAE.mjs → event-category-Bz24uP1U.mjs} +13 -0
  41. package/dist/generated/addon-api.d.ts +5358 -30965
  42. package/dist/generated/cap-input-defaults.d.ts +29 -0
  43. package/dist/generated/device-proxy.d.ts +2 -2
  44. package/dist/generated/method-access-map.d.ts +1 -1
  45. package/dist/generated/system-proxy.d.ts +3 -3
  46. package/dist/index.d.ts +2 -1
  47. package/dist/index.js +724 -138
  48. package/dist/index.mjs +711 -135
  49. package/dist/interfaces/addon.d.ts +9 -0
  50. package/dist/interfaces/ops-log.d.ts +2 -0
  51. package/dist/interfaces/recording-config.d.ts +33 -91
  52. package/dist/interfaces/relocate.d.ts +55 -0
  53. package/dist/interfaces/storage-location-declaration.d.ts +1 -1
  54. package/dist/interfaces/storage-location.d.ts +4 -0
  55. package/dist/interfaces/stream-broker.d.ts +1 -1
  56. package/dist/lifecycle/job.d.ts +6 -6
  57. package/dist/node.js +1 -0
  58. package/dist/node.mjs +1 -0
  59. package/dist/notification/condition-taxonomy.d.ts +61 -0
  60. package/dist/notification/format-transcode.d.ts +12 -1
  61. package/dist/{sleep-C3ceNSsf.mjs → sleep-B_Uaqbai.mjs} +7 -1
  62. package/dist/{sleep-DRg9F6JJ.js → sleep-DETsT9rJ.js} +7 -1
  63. package/package.json +1 -1
  64. package/dist/interfaces/recording-config-migrate.d.ts +0 -12
package/dist/addon.d.ts CHANGED
@@ -28,6 +28,7 @@ export { DATAPLANE_SECRET_HEADER } from './interfaces/addon-data-plane.js';
28
28
  export { expandCapMethods } from './capabilities/capability-definition.js';
29
29
  export { nodePin, readNodePin } from './cap-call-context.js';
30
30
  export { COLLECTION_ARRAY_METHODS, isCollectionArrayMethodName, } from './generated/collection-array-methods.js';
31
+ export { CAP_INPUT_DEFAULTS, withCapInputDefaults } from './generated/cap-input-defaults.js';
31
32
  export { deviceOpsCapability } from './capabilities/device-ops.cap.js';
32
33
  export { createDeviceProxy } from './generated/device-proxy.js';
33
34
  export { BaseAddon, normalizeAddonInitResult } from './addon/base-addon.js';
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-DRg9F6JJ.js");
3
- const require_event_category = require("./event-category-Cdyife4p.js");
2
+ const require_sleep = require("./sleep-DETsT9rJ.js");
3
+ const require_event_category = require("./event-category-39bpf1r_.js");
4
4
  const require_err_msg = require("./err-msg-COpsHMw2.js");
5
5
  //#region src/generated/collection-array-methods.ts
6
6
  /**
@@ -56,7 +56,270 @@ function isCollectionArrayMethodName(capName, method) {
56
56
  return methods !== void 0 && methods.includes(method);
57
57
  }
58
58
  //#endregion
59
+ //#region src/generated/cap-input-defaults.ts
60
+ /**
61
+ * AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
62
+ *
63
+ * capName → method → the TOP-LEVEL input defaults the method's Zod schema
64
+ * would materialise. A cap call made from an addon (`ctx.api`) never passes
65
+ * through the tRPC router, so those `.default(…)` values never run — three
66
+ * production failures in one day came from exactly that (see the generator's
67
+ * header). The addon link merges these in, so a declared default means the same
68
+ * thing on both paths.
69
+ *
70
+ * Plain data, zero Zod: a forked runner must not import the schema barrel
71
+ * (~144MB RSS per runner — D28).
72
+ *
73
+ * Coverage: 21 caps, 48 methods with defaults.
74
+ */
75
+ var CAP_INPUT_DEFAULTS = Object.freeze({
76
+ "addons": { "getLogs": { "limit": 100 } },
77
+ "audio-analyzer": { "analyseChunk": { "settings": { "__nested__": {
78
+ "minConfidence": .3,
79
+ "allowedClasses": []
80
+ } } } },
81
+ "audio-codec": {
82
+ "pullEncoded": { "maxCount": 8 },
83
+ "pullPcm": { "maxCount": 8 }
84
+ },
85
+ "battery": { "wakeForStream": { "timeoutMs": 8e3 } },
86
+ "decoder": {
87
+ "createSession": {
88
+ "maxFps": 0,
89
+ "outputFormat": "jpeg",
90
+ "scale": 1,
91
+ "frameSink": "callback"
92
+ },
93
+ "pullFrames": { "maxCount": 1 },
94
+ "pullHandles": { "maxCount": 1 }
95
+ },
96
+ "device-adoption": { "listCandidates": {
97
+ "page": 1,
98
+ "pageSize": 50
99
+ } },
100
+ "device-manager": { "adoptionListCandidates": {
101
+ "page": 1,
102
+ "pageSize": 50
103
+ } },
104
+ "llm": { "upsertProfile": { "profile": { "__nested__": { "timeoutMs": 6e4 } } } },
105
+ "llm-runtime": {
106
+ "complete": { "runtime": { "__nested__": {
107
+ "contextSize": 4096,
108
+ "gpuLayers": 0,
109
+ "parallel": 1,
110
+ "autoStart": false,
111
+ "idleStopMinutes": 30
112
+ } } },
113
+ "ensureStarted": { "runtime": { "__nested__": {
114
+ "contextSize": 4096,
115
+ "gpuLayers": 0,
116
+ "parallel": 1,
117
+ "autoStart": false,
118
+ "idleStopMinutes": 30
119
+ } } }
120
+ },
121
+ "mqtt-broker": { "startEmbeddedBroker": {
122
+ "port": 1883,
123
+ "allowAnonymous": false
124
+ } },
125
+ "nodes": { "getCapUsageGraph": { "windowSeconds": 60 } },
126
+ "notification-output": { "send": { "notification": { "__nested__": {
127
+ "format": "text",
128
+ "priority": 3
129
+ } } } },
130
+ "notification-rules": {
131
+ "createRule": { "rule": { "__nested__": {
132
+ "enabled": true,
133
+ "conditions": {},
134
+ "media": { "attach": "best" },
135
+ "throttle": {
136
+ "cooldownSec": 60,
137
+ "scope": "rule-device"
138
+ },
139
+ "priority": 3
140
+ } } },
141
+ "getHistory": { "filter": { "limit": 100 } },
142
+ "testRule": {
143
+ "rule": { "__nested__": {
144
+ "enabled": true,
145
+ "conditions": {},
146
+ "media": { "attach": "best" },
147
+ "throttle": {
148
+ "cooldownSec": 60,
149
+ "scope": "rule-device"
150
+ },
151
+ "priority": 3
152
+ } },
153
+ "lookbackMinutes": 60
154
+ }
155
+ },
156
+ "pipeline-analytics": {
157
+ "getAudioEvents": { "limit": 1e3 },
158
+ "getKeyEvents": { "limit": 50 },
159
+ "getMotionEvents": { "limit": 1e3 },
160
+ "getObjectEvents": { "limit": 1e3 },
161
+ "getSensorEvents": { "limit": 1e3 },
162
+ "listRecentTracks": { "limit": 200 },
163
+ "searchObjectEvents": {
164
+ "limit": 50,
165
+ "minScore": .2
166
+ }
167
+ },
168
+ "pipeline-runner": {
169
+ "attachCamera": {
170
+ "detectionMode": "on-motion",
171
+ "audioMode": "always-on",
172
+ "motionCooldownMs": 3e4,
173
+ "motionFps": 4,
174
+ "detectionFps": 10,
175
+ "motionSources": ["analyzer"],
176
+ "pipelineEnabled": true,
177
+ "zones": [],
178
+ "onboardMotionDrivesAnalyzer": true,
179
+ "occupancyRecheckEnabled": false,
180
+ "occupancyRecheckSec": 30,
181
+ "occupancyRecheckFrames": 4,
182
+ "frameSource": { "kind": "local-broker" }
183
+ },
184
+ "reportMotion": { "source": "analyzer" }
185
+ },
186
+ "recording": {
187
+ "renderClip": {
188
+ "preRollSec": 3,
189
+ "postRollSec": 7,
190
+ "maxWidth": 640
191
+ },
192
+ "renderGif": {
193
+ "preRollSec": 2,
194
+ "postRollSec": 5,
195
+ "maxWidth": 480,
196
+ "fps": 5
197
+ },
198
+ "setDeviceConfig": { "config": { "__nested__": { "bands": [] } } }
199
+ },
200
+ "storage": { "upsertLocation": {
201
+ "isDefault": false,
202
+ "isSystem": false
203
+ } },
204
+ "storage-provider": {
205
+ "beginDownload": { "location": { "__nested__": {
206
+ "isDefault": false,
207
+ "isSystem": false
208
+ } } },
209
+ "beginUpload": { "location": { "__nested__": {
210
+ "isDefault": false,
211
+ "isSystem": false
212
+ } } },
213
+ "delete": { "location": { "__nested__": {
214
+ "isDefault": false,
215
+ "isSystem": false
216
+ } } },
217
+ "exists": { "location": { "__nested__": {
218
+ "isDefault": false,
219
+ "isSystem": false
220
+ } } },
221
+ "getAvailableSpace": { "location": { "__nested__": {
222
+ "isDefault": false,
223
+ "isSystem": false
224
+ } } },
225
+ "list": { "location": { "__nested__": {
226
+ "isDefault": false,
227
+ "isSystem": false
228
+ } } },
229
+ "read": { "location": { "__nested__": {
230
+ "isDefault": false,
231
+ "isSystem": false
232
+ } } },
233
+ "resolve": { "location": { "__nested__": {
234
+ "isDefault": false,
235
+ "isSystem": false
236
+ } } },
237
+ "write": { "location": { "__nested__": {
238
+ "isDefault": false,
239
+ "isSystem": false
240
+ } } }
241
+ },
242
+ "stream-broker": {
243
+ "pullAudioChunks": { "maxCount": 8 },
244
+ "pullFrameHandles": { "maxCount": 4 },
245
+ "renderPreBufferClip": {
246
+ "preRollSec": 3,
247
+ "postRollSec": 5,
248
+ "format": "gif",
249
+ "maxWidth": 480,
250
+ "fps": 5
251
+ }
252
+ },
253
+ "user-management": {
254
+ "createApiKey": { "isAdmin": false },
255
+ "createUser": { "isAdmin": false }
256
+ },
257
+ "zones": {
258
+ "addZone": { "zone": { "__nested__": {
259
+ "kind": "polygon",
260
+ "color": "#3b82f6"
261
+ } } },
262
+ "updateZone": { "zone": { "__nested__": {
263
+ "kind": "polygon",
264
+ "color": "#3b82f6"
265
+ } } }
266
+ }
267
+ });
268
+ /**
269
+ * Fill the declared defaults for `(capName, method)` into `input`, WITHOUT
270
+ * touching anything the caller set.
271
+ *
272
+ * Deliberately additive-only:
273
+ * - a caller-provided value always wins (including `null`; only `undefined`
274
+ * is treated as absent);
275
+ * - unknown keys survive untouched — the addon path carries routing fields
276
+ * (`nodeId`, `addonId`) inline in the args, and a Zod parse would strip
277
+ * them and silently break routing;
278
+ * - a non-object input is returned as-is.
279
+ */
280
+ function withCapInputDefaults(capName, method, input) {
281
+ const defaults = CAP_INPUT_DEFAULTS[capName]?.[method];
282
+ if (defaults === void 0) return input;
283
+ return mergeDefaults(defaults, input);
284
+ }
285
+ /** Marks a nested default group (see the generator). */
286
+ var NESTED_MARKER = "__nested__";
287
+ function isNestedGroup(value) {
288
+ return typeof value === "object" && value !== null && !Array.isArray(value) && NESTED_MARKER in value;
289
+ }
290
+ function mergeDefaults(defaults, input) {
291
+ if (input === void 0 || input === null) return materialise(defaults);
292
+ if (typeof input !== "object" || Array.isArray(input)) return input;
293
+ const given = input;
294
+ let out = null;
295
+ for (const [key, value] of Object.entries(defaults)) {
296
+ if (isNestedGroup(value)) {
297
+ const nested = value[NESTED_MARKER];
298
+ if (nested === void 0) continue;
299
+ const merged = mergeDefaults(nested, given[key]);
300
+ if (merged === given[key]) continue;
301
+ out ??= { ...given };
302
+ out[key] = merged;
303
+ continue;
304
+ }
305
+ if (given[key] !== void 0) continue;
306
+ out ??= { ...given };
307
+ out[key] = value;
308
+ }
309
+ return out ?? input;
310
+ }
311
+ /** A defaults group with no caller input at all — drop the nesting markers. */
312
+ function materialise(defaults) {
313
+ const out = {};
314
+ for (const [key, value] of Object.entries(defaults)) {
315
+ const nested = isNestedGroup(value) ? value[NESTED_MARKER] : void 0;
316
+ out[key] = nested === void 0 ? value : materialise(nested);
317
+ }
318
+ return out;
319
+ }
320
+ //#endregion
59
321
  exports.BaseAddon = require_sleep.BaseAddon;
322
+ exports.CAP_INPUT_DEFAULTS = CAP_INPUT_DEFAULTS;
60
323
  exports.COLLECTION_ARRAY_METHODS = COLLECTION_ARRAY_METHODS;
61
324
  exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
62
325
  exports.DeviceType = require_sleep.DeviceType;
@@ -80,3 +343,4 @@ exports.readNodePin = require_sleep.readNodePin;
80
343
  exports.scopeKey = require_sleep.scopeKey;
81
344
  exports.sleep = require_sleep.sleep;
82
345
  exports.viewerUiCapability = require_sleep.viewerUiCapability;
346
+ exports.withCapInputDefaults = withCapInputDefaults;
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { A as parseJsonUnknown, Ct as DisposerChain, D as asString, F as ReadinessRegistry, I as ReadinessTimeoutError, M as nodePin, N as readNodePin, P as DATAPLANE_SECRET_HEADER, S as DeviceType, T as asJsonObject, a as viewerUiCapability, dt as BaseAddon, ft as normalizeAddonInitResult, ht as emitReadiness, i as deviceOpsCapability, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep, z as scopeKey } from "./sleep-C3ceNSsf.mjs";
2
- import { t as EventCategory } from "./event-category-BLcNejAE.mjs";
1
+ import { A as parseJsonUnknown, Ct as DisposerChain, D as asString, F as ReadinessRegistry, I as ReadinessTimeoutError, M as nodePin, N as readNodePin, P as DATAPLANE_SECRET_HEADER, S as DeviceType, T as asJsonObject, a as viewerUiCapability, dt as BaseAddon, ft as normalizeAddonInitResult, ht as emitReadiness, i as deviceOpsCapability, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep, z as scopeKey } from "./sleep-B_Uaqbai.mjs";
2
+ import { t as EventCategory } from "./event-category-Bz24uP1U.mjs";
3
3
  import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
4
4
  //#region src/generated/collection-array-methods.ts
5
5
  /**
@@ -55,4 +55,266 @@ function isCollectionArrayMethodName(capName, method) {
55
55
  return methods !== void 0 && methods.includes(method);
56
56
  }
57
57
  //#endregion
58
- export { BaseAddon, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, isCollectionArrayMethodName, nodePin, normalizeAddonInitResult, parseJsonUnknown, readNodePin, scopeKey, sleep, viewerUiCapability };
58
+ //#region src/generated/cap-input-defaults.ts
59
+ /**
60
+ * AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
61
+ *
62
+ * capName → method → the TOP-LEVEL input defaults the method's Zod schema
63
+ * would materialise. A cap call made from an addon (`ctx.api`) never passes
64
+ * through the tRPC router, so those `.default(…)` values never run — three
65
+ * production failures in one day came from exactly that (see the generator's
66
+ * header). The addon link merges these in, so a declared default means the same
67
+ * thing on both paths.
68
+ *
69
+ * Plain data, zero Zod: a forked runner must not import the schema barrel
70
+ * (~144MB RSS per runner — D28).
71
+ *
72
+ * Coverage: 21 caps, 48 methods with defaults.
73
+ */
74
+ var CAP_INPUT_DEFAULTS = Object.freeze({
75
+ "addons": { "getLogs": { "limit": 100 } },
76
+ "audio-analyzer": { "analyseChunk": { "settings": { "__nested__": {
77
+ "minConfidence": .3,
78
+ "allowedClasses": []
79
+ } } } },
80
+ "audio-codec": {
81
+ "pullEncoded": { "maxCount": 8 },
82
+ "pullPcm": { "maxCount": 8 }
83
+ },
84
+ "battery": { "wakeForStream": { "timeoutMs": 8e3 } },
85
+ "decoder": {
86
+ "createSession": {
87
+ "maxFps": 0,
88
+ "outputFormat": "jpeg",
89
+ "scale": 1,
90
+ "frameSink": "callback"
91
+ },
92
+ "pullFrames": { "maxCount": 1 },
93
+ "pullHandles": { "maxCount": 1 }
94
+ },
95
+ "device-adoption": { "listCandidates": {
96
+ "page": 1,
97
+ "pageSize": 50
98
+ } },
99
+ "device-manager": { "adoptionListCandidates": {
100
+ "page": 1,
101
+ "pageSize": 50
102
+ } },
103
+ "llm": { "upsertProfile": { "profile": { "__nested__": { "timeoutMs": 6e4 } } } },
104
+ "llm-runtime": {
105
+ "complete": { "runtime": { "__nested__": {
106
+ "contextSize": 4096,
107
+ "gpuLayers": 0,
108
+ "parallel": 1,
109
+ "autoStart": false,
110
+ "idleStopMinutes": 30
111
+ } } },
112
+ "ensureStarted": { "runtime": { "__nested__": {
113
+ "contextSize": 4096,
114
+ "gpuLayers": 0,
115
+ "parallel": 1,
116
+ "autoStart": false,
117
+ "idleStopMinutes": 30
118
+ } } }
119
+ },
120
+ "mqtt-broker": { "startEmbeddedBroker": {
121
+ "port": 1883,
122
+ "allowAnonymous": false
123
+ } },
124
+ "nodes": { "getCapUsageGraph": { "windowSeconds": 60 } },
125
+ "notification-output": { "send": { "notification": { "__nested__": {
126
+ "format": "text",
127
+ "priority": 3
128
+ } } } },
129
+ "notification-rules": {
130
+ "createRule": { "rule": { "__nested__": {
131
+ "enabled": true,
132
+ "conditions": {},
133
+ "media": { "attach": "best" },
134
+ "throttle": {
135
+ "cooldownSec": 60,
136
+ "scope": "rule-device"
137
+ },
138
+ "priority": 3
139
+ } } },
140
+ "getHistory": { "filter": { "limit": 100 } },
141
+ "testRule": {
142
+ "rule": { "__nested__": {
143
+ "enabled": true,
144
+ "conditions": {},
145
+ "media": { "attach": "best" },
146
+ "throttle": {
147
+ "cooldownSec": 60,
148
+ "scope": "rule-device"
149
+ },
150
+ "priority": 3
151
+ } },
152
+ "lookbackMinutes": 60
153
+ }
154
+ },
155
+ "pipeline-analytics": {
156
+ "getAudioEvents": { "limit": 1e3 },
157
+ "getKeyEvents": { "limit": 50 },
158
+ "getMotionEvents": { "limit": 1e3 },
159
+ "getObjectEvents": { "limit": 1e3 },
160
+ "getSensorEvents": { "limit": 1e3 },
161
+ "listRecentTracks": { "limit": 200 },
162
+ "searchObjectEvents": {
163
+ "limit": 50,
164
+ "minScore": .2
165
+ }
166
+ },
167
+ "pipeline-runner": {
168
+ "attachCamera": {
169
+ "detectionMode": "on-motion",
170
+ "audioMode": "always-on",
171
+ "motionCooldownMs": 3e4,
172
+ "motionFps": 4,
173
+ "detectionFps": 10,
174
+ "motionSources": ["analyzer"],
175
+ "pipelineEnabled": true,
176
+ "zones": [],
177
+ "onboardMotionDrivesAnalyzer": true,
178
+ "occupancyRecheckEnabled": false,
179
+ "occupancyRecheckSec": 30,
180
+ "occupancyRecheckFrames": 4,
181
+ "frameSource": { "kind": "local-broker" }
182
+ },
183
+ "reportMotion": { "source": "analyzer" }
184
+ },
185
+ "recording": {
186
+ "renderClip": {
187
+ "preRollSec": 3,
188
+ "postRollSec": 7,
189
+ "maxWidth": 640
190
+ },
191
+ "renderGif": {
192
+ "preRollSec": 2,
193
+ "postRollSec": 5,
194
+ "maxWidth": 480,
195
+ "fps": 5
196
+ },
197
+ "setDeviceConfig": { "config": { "__nested__": { "bands": [] } } }
198
+ },
199
+ "storage": { "upsertLocation": {
200
+ "isDefault": false,
201
+ "isSystem": false
202
+ } },
203
+ "storage-provider": {
204
+ "beginDownload": { "location": { "__nested__": {
205
+ "isDefault": false,
206
+ "isSystem": false
207
+ } } },
208
+ "beginUpload": { "location": { "__nested__": {
209
+ "isDefault": false,
210
+ "isSystem": false
211
+ } } },
212
+ "delete": { "location": { "__nested__": {
213
+ "isDefault": false,
214
+ "isSystem": false
215
+ } } },
216
+ "exists": { "location": { "__nested__": {
217
+ "isDefault": false,
218
+ "isSystem": false
219
+ } } },
220
+ "getAvailableSpace": { "location": { "__nested__": {
221
+ "isDefault": false,
222
+ "isSystem": false
223
+ } } },
224
+ "list": { "location": { "__nested__": {
225
+ "isDefault": false,
226
+ "isSystem": false
227
+ } } },
228
+ "read": { "location": { "__nested__": {
229
+ "isDefault": false,
230
+ "isSystem": false
231
+ } } },
232
+ "resolve": { "location": { "__nested__": {
233
+ "isDefault": false,
234
+ "isSystem": false
235
+ } } },
236
+ "write": { "location": { "__nested__": {
237
+ "isDefault": false,
238
+ "isSystem": false
239
+ } } }
240
+ },
241
+ "stream-broker": {
242
+ "pullAudioChunks": { "maxCount": 8 },
243
+ "pullFrameHandles": { "maxCount": 4 },
244
+ "renderPreBufferClip": {
245
+ "preRollSec": 3,
246
+ "postRollSec": 5,
247
+ "format": "gif",
248
+ "maxWidth": 480,
249
+ "fps": 5
250
+ }
251
+ },
252
+ "user-management": {
253
+ "createApiKey": { "isAdmin": false },
254
+ "createUser": { "isAdmin": false }
255
+ },
256
+ "zones": {
257
+ "addZone": { "zone": { "__nested__": {
258
+ "kind": "polygon",
259
+ "color": "#3b82f6"
260
+ } } },
261
+ "updateZone": { "zone": { "__nested__": {
262
+ "kind": "polygon",
263
+ "color": "#3b82f6"
264
+ } } }
265
+ }
266
+ });
267
+ /**
268
+ * Fill the declared defaults for `(capName, method)` into `input`, WITHOUT
269
+ * touching anything the caller set.
270
+ *
271
+ * Deliberately additive-only:
272
+ * - a caller-provided value always wins (including `null`; only `undefined`
273
+ * is treated as absent);
274
+ * - unknown keys survive untouched — the addon path carries routing fields
275
+ * (`nodeId`, `addonId`) inline in the args, and a Zod parse would strip
276
+ * them and silently break routing;
277
+ * - a non-object input is returned as-is.
278
+ */
279
+ function withCapInputDefaults(capName, method, input) {
280
+ const defaults = CAP_INPUT_DEFAULTS[capName]?.[method];
281
+ if (defaults === void 0) return input;
282
+ return mergeDefaults(defaults, input);
283
+ }
284
+ /** Marks a nested default group (see the generator). */
285
+ var NESTED_MARKER = "__nested__";
286
+ function isNestedGroup(value) {
287
+ return typeof value === "object" && value !== null && !Array.isArray(value) && NESTED_MARKER in value;
288
+ }
289
+ function mergeDefaults(defaults, input) {
290
+ if (input === void 0 || input === null) return materialise(defaults);
291
+ if (typeof input !== "object" || Array.isArray(input)) return input;
292
+ const given = input;
293
+ let out = null;
294
+ for (const [key, value] of Object.entries(defaults)) {
295
+ if (isNestedGroup(value)) {
296
+ const nested = value[NESTED_MARKER];
297
+ if (nested === void 0) continue;
298
+ const merged = mergeDefaults(nested, given[key]);
299
+ if (merged === given[key]) continue;
300
+ out ??= { ...given };
301
+ out[key] = merged;
302
+ continue;
303
+ }
304
+ if (given[key] !== void 0) continue;
305
+ out ??= { ...given };
306
+ out[key] = value;
307
+ }
308
+ return out ?? input;
309
+ }
310
+ /** A defaults group with no caller input at all — drop the nesting markers. */
311
+ function materialise(defaults) {
312
+ const out = {};
313
+ for (const [key, value] of Object.entries(defaults)) {
314
+ const nested = isNestedGroup(value) ? value[NESTED_MARKER] : void 0;
315
+ out[key] = nested === void 0 ? value : materialise(nested);
316
+ }
317
+ return out;
318
+ }
319
+ //#endregion
320
+ export { BaseAddon, CAP_INPUT_DEFAULTS, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, isCollectionArrayMethodName, nodePin, normalizeAddonInitResult, parseJsonUnknown, readNodePin, scopeKey, sleep, viewerUiCapability, withCapInputDefaults };
@@ -128,9 +128,9 @@ declare const AddonAutoUpdateSchema: z.ZodEnum<{
128
128
  inherit: "inherit";
129
129
  }>;
130
130
  declare const BulkUpdateItemStatusSchema: z.ZodEnum<{
131
- failed: "failed";
132
131
  queued: "queued";
133
132
  done: "done";
133
+ failed: "failed";
134
134
  updating: "updating";
135
135
  "done-pending-restart": "done-pending-restart";
136
136
  }>;
@@ -140,9 +140,9 @@ declare const BulkUpdateItemSchema: z.ZodObject<{
140
140
  fromVersion: z.ZodString;
141
141
  toVersion: z.ZodString;
142
142
  status: z.ZodEnum<{
143
- failed: "failed";
144
143
  queued: "queued";
145
144
  done: "done";
145
+ failed: "failed";
146
146
  updating: "updating";
147
147
  "done-pending-restart": "done-pending-restart";
148
148
  }>;
@@ -178,9 +178,9 @@ declare const BulkUpdateStateSchema: z.ZodObject<{
178
178
  fromVersion: z.ZodString;
179
179
  toVersion: z.ZodString;
180
180
  status: z.ZodEnum<{
181
- failed: "failed";
182
181
  queued: "queued";
183
182
  done: "done";
183
+ failed: "failed";
184
184
  updating: "updating";
185
185
  "done-pending-restart": "done-pending-restart";
186
186
  }>;
@@ -598,7 +598,6 @@ export declare const addonsCapability: {
598
598
  addon: "addon";
599
599
  }>;
600
600
  phase: z.ZodEnum<{
601
- failed: "failed";
602
601
  queued: "queued";
603
602
  fetching: "fetching";
604
603
  staged: "staged";
@@ -607,6 +606,7 @@ export declare const addonsCapability: {
607
606
  restarting: "restarting";
608
607
  applied: "applied";
609
608
  done: "done";
609
+ failed: "failed";
610
610
  skipped: "skipped";
611
611
  }>;
612
612
  stagedPath: z.ZodNullable<z.ZodString>;
@@ -616,7 +616,6 @@ export declare const addonsCapability: {
616
616
  nodeId: z.ZodString;
617
617
  packageName: z.ZodString;
618
618
  phase: z.ZodEnum<{
619
- failed: "failed";
620
619
  queued: "queued";
621
620
  fetching: "fetching";
622
621
  staged: "staged";
@@ -625,6 +624,7 @@ export declare const addonsCapability: {
625
624
  restarting: "restarting";
626
625
  applied: "applied";
627
626
  done: "done";
627
+ failed: "failed";
628
628
  skipped: "skipped";
629
629
  }>;
630
630
  message: z.ZodString;
@@ -674,7 +674,6 @@ export declare const addonsCapability: {
674
674
  addon: "addon";
675
675
  }>;
676
676
  phase: z.ZodEnum<{
677
- failed: "failed";
678
677
  queued: "queued";
679
678
  fetching: "fetching";
680
679
  staged: "staged";
@@ -683,6 +682,7 @@ export declare const addonsCapability: {
683
682
  restarting: "restarting";
684
683
  applied: "applied";
685
684
  done: "done";
685
+ failed: "failed";
686
686
  skipped: "skipped";
687
687
  }>;
688
688
  stagedPath: z.ZodNullable<z.ZodString>;
@@ -692,7 +692,6 @@ export declare const addonsCapability: {
692
692
  nodeId: z.ZodString;
693
693
  packageName: z.ZodString;
694
694
  phase: z.ZodEnum<{
695
- failed: "failed";
696
695
  queued: "queued";
697
696
  fetching: "fetching";
698
697
  staged: "staged";
@@ -701,6 +700,7 @@ export declare const addonsCapability: {
701
700
  restarting: "restarting";
702
701
  applied: "applied";
703
702
  done: "done";
703
+ failed: "failed";
704
704
  skipped: "skipped";
705
705
  }>;
706
706
  message: z.ZodString;