@camstack/types 1.1.18 → 1.1.20

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.
@@ -88,6 +88,12 @@ export declare const batteryCapability: {
88
88
  binary: z.ZodOptional<z.ZodBoolean>;
89
89
  }, z.core.$strip>;
90
90
  readonly kind: "push";
91
+ readonly empty: {
92
+ readonly percentage: 0;
93
+ readonly charging: "none";
94
+ readonly sleeping: false;
95
+ readonly lastUpdated: 0;
96
+ };
91
97
  };
92
98
  /**
93
99
  * Runtime-state slice — every provider that registers this cap
@@ -67,10 +67,49 @@ export interface CapabilityEventSchema<TData extends z.ZodType = z.ZodType> {
67
67
  readonly data: TData;
68
68
  }
69
69
  export type CapabilityStatusKind = 'push' | 'poll' | 'command-driven';
70
+ /**
71
+ * Declares that a cap's status is an ITEM-ARRAY wiring target: the status
72
+ * holds an array of keyed items (`consumables.items`) that device-links can
73
+ * populate per item via `DeviceLink.target.itemKey`. Links sharing an
74
+ * `itemKey` are grouped into ONE item: the merge seeds a new item from
75
+ * `emptyItem` (with `keyField` — and `labelField` when declared — set to the
76
+ * itemKey), overlays each link's per-item `fieldPath`, validates the item
77
+ * against `itemSchema`, then upserts it into the array by `keyField`.
78
+ */
79
+ export interface CapabilityStatusItemArray {
80
+ /** Dot-path from the status root to the array field (e.g. 'items'). */
81
+ readonly path: string;
82
+ /** Item field carrying the stable per-item key (e.g. 'key'). */
83
+ readonly keyField: string;
84
+ /** Optional item field defaulted to the itemKey when a NEW item is seeded
85
+ * and no link overlays it (e.g. 'label' — schemas often require it
86
+ * non-empty). Existing items keep their value. */
87
+ readonly labelField?: string;
88
+ /** Zod schema of ONE array item — the per-item validation gate (a bad
89
+ * item is skipped without discarding the other items). */
90
+ readonly itemSchema: z.ZodType;
91
+ /** Seed for a NEW item created from links; `keyField`/`labelField` are
92
+ * overwritten with the itemKey, links overlay the rest. Must produce an
93
+ * `itemSchema`-valid item once seeded. */
94
+ readonly emptyItem: Readonly<Record<string, unknown>>;
95
+ }
70
96
  export interface CapabilityStatusSchema<TStatus extends z.ZodType = z.ZodType> {
71
97
  readonly schema: TStatus;
72
98
  /** Documentation hint on update cadence — used by the aggregator and UI. */
73
99
  readonly kind?: CapabilityStatusKind;
100
+ /**
101
+ * Default status used as the merge BASE when a device-link *synthesizes*
102
+ * this cap (no native provider). Required-but-unlinked fields (enums,
103
+ * timestamps) come from here so the synthesized status validates against
104
+ * `schema`. Omit for caps that are never synthesize targets.
105
+ */
106
+ readonly empty?: z.infer<TStatus>;
107
+ /**
108
+ * Item-array wiring descriptor — set when the status holds an array of
109
+ * keyed items that device-links populate per item (`itemKey` grouping).
110
+ * See {@link CapabilityStatusItemArray}. Omit for scalar-only caps.
111
+ */
112
+ readonly itemArray?: CapabilityStatusItemArray;
74
113
  }
75
114
  /** How a contribution's component is resolved by the renderer. */
76
115
  export type UiContributionKind = 'remote';
@@ -84,6 +84,41 @@ export declare const consumablesCapability: {
84
84
  lastChangedAt: z.ZodNumber;
85
85
  }, z.core.$strip>;
86
86
  readonly kind: "push";
87
+ readonly empty: {
88
+ items: {
89
+ key: string;
90
+ label: string;
91
+ level: number | null;
92
+ status: "replace" | "ok" | null;
93
+ lastResetAt: number | null;
94
+ resettable: boolean;
95
+ }[];
96
+ lastChangedAt: number;
97
+ };
98
+ readonly itemArray: {
99
+ readonly path: "items";
100
+ readonly keyField: "key";
101
+ readonly labelField: "label";
102
+ readonly itemSchema: z.ZodObject<{
103
+ key: z.ZodString;
104
+ label: z.ZodString;
105
+ level: z.ZodNullable<z.ZodNumber>;
106
+ status: z.ZodNullable<z.ZodEnum<{
107
+ replace: "replace";
108
+ ok: "ok";
109
+ }>>;
110
+ lastResetAt: z.ZodNullable<z.ZodNumber>;
111
+ resettable: z.ZodBoolean;
112
+ }, z.core.$strip>;
113
+ readonly emptyItem: {
114
+ key: string;
115
+ label: string;
116
+ level: number | null;
117
+ status: "replace" | "ok" | null;
118
+ lastResetAt: number | null;
119
+ resettable: boolean;
120
+ };
121
+ };
87
122
  };
88
123
  readonly runtimeState: z.ZodObject<{
89
124
  items: z.ZodArray<z.ZodObject<{
@@ -19,6 +19,46 @@
19
19
  import { z } from 'zod';
20
20
  import { DeviceType } from '../device/device-type.js';
21
21
  import { StreamSourceEntrySchema } from './schemas/streaming-shared.js';
22
+ /** Cap-wire shape of a DeviceLink — structurally mirrors `DeviceLink` in
23
+ * `device-management.ts`. Source is a union: a FIELD source copies a sibling
24
+ * accessory's status field (`kind` optional/absent for wire compat); a
25
+ * LITERAL source carries a per-device constant (no sibling is read); a
26
+ * GLOBAL source (P2e) copies ANY device's status field, addressed by the
27
+ * source device's full re-sync-stable `stableId`. */
28
+ export declare const DeviceLinkSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ source: z.ZodUnion<readonly [z.ZodObject<{
31
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
32
+ sourceKey: z.ZodString;
33
+ cap: z.ZodString;
34
+ fieldPath: z.ZodString;
35
+ }, z.core.$strip>, z.ZodObject<{
36
+ kind: z.ZodLiteral<"literal">;
37
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ kind: z.ZodLiteral<"global">;
40
+ sourceStableId: z.ZodString;
41
+ cap: z.ZodString;
42
+ fieldPath: z.ZodString;
43
+ }, z.core.$strip>]>;
44
+ target: z.ZodObject<{
45
+ cap: z.ZodString;
46
+ fieldPath: z.ZodString;
47
+ itemKey: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>;
49
+ transform: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
50
+ kind: z.ZodLiteral<"identity">;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ kind: z.ZodLiteral<"enum-map">;
53
+ mapping: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
54
+ fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ kind: z.ZodLiteral<"linear">;
57
+ scale: z.ZodNumber;
58
+ offset: z.ZodNumber;
59
+ clamp: z.ZodOptional<z.ZodReadonly<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
60
+ }, z.core.$strip>], "kind">>;
61
+ }, z.core.$strip>;
22
62
  /**
23
63
  * Serializable projection of a live IDevice.
24
64
  * Returned by listAll, getDevice, getChildren.
@@ -57,11 +97,20 @@ export declare const DeviceInfoSchema: z.ZodObject<{
57
97
  }, z.core.$strip>>>>;
58
98
  deviceLinks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
59
99
  id: z.ZodString;
60
- source: z.ZodObject<{
100
+ source: z.ZodUnion<readonly [z.ZodObject<{
101
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
61
102
  sourceKey: z.ZodString;
62
103
  cap: z.ZodString;
63
104
  fieldPath: z.ZodString;
64
- }, z.core.$strip>;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ kind: z.ZodLiteral<"literal">;
107
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ kind: z.ZodLiteral<"global">;
110
+ sourceStableId: z.ZodString;
111
+ cap: z.ZodString;
112
+ fieldPath: z.ZodString;
113
+ }, z.core.$strip>]>;
65
114
  target: z.ZodObject<{
66
115
  cap: z.ZodString;
67
116
  fieldPath: z.ZodString;
@@ -129,11 +178,20 @@ export declare const DeviceMetaSchema: z.ZodObject<{
129
178
  }, z.core.$strip>>>>;
130
179
  deviceLinks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
131
180
  id: z.ZodString;
132
- source: z.ZodObject<{
181
+ source: z.ZodUnion<readonly [z.ZodObject<{
182
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
133
183
  sourceKey: z.ZodString;
134
184
  cap: z.ZodString;
135
185
  fieldPath: z.ZodString;
136
- }, z.core.$strip>;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ kind: z.ZodLiteral<"literal">;
188
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
189
+ }, z.core.$strip>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"global">;
191
+ sourceStableId: z.ZodString;
192
+ cap: z.ZodString;
193
+ fieldPath: z.ZodString;
194
+ }, z.core.$strip>]>;
137
195
  target: z.ZodObject<{
138
196
  cap: z.ZodString;
139
197
  fieldPath: z.ZodString;
@@ -254,11 +312,20 @@ export declare const deviceManagerCapability: {
254
312
  }, z.core.$strip>>>>;
255
313
  deviceLinks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
256
314
  id: z.ZodString;
257
- source: z.ZodObject<{
315
+ source: z.ZodUnion<readonly [z.ZodObject<{
316
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
258
317
  sourceKey: z.ZodString;
259
318
  cap: z.ZodString;
260
319
  fieldPath: z.ZodString;
261
- }, z.core.$strip>;
320
+ }, z.core.$strip>, z.ZodObject<{
321
+ kind: z.ZodLiteral<"literal">;
322
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
323
+ }, z.core.$strip>, z.ZodObject<{
324
+ kind: z.ZodLiteral<"global">;
325
+ sourceStableId: z.ZodString;
326
+ cap: z.ZodString;
327
+ fieldPath: z.ZodString;
328
+ }, z.core.$strip>]>;
262
329
  target: z.ZodObject<{
263
330
  cap: z.ZodString;
264
331
  fieldPath: z.ZodString;
@@ -345,11 +412,20 @@ export declare const deviceManagerCapability: {
345
412
  deviceId: z.ZodNumber;
346
413
  deviceLinks: z.ZodReadonly<z.ZodArray<z.ZodObject<{
347
414
  id: z.ZodString;
348
- source: z.ZodObject<{
415
+ source: z.ZodUnion<readonly [z.ZodObject<{
416
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
349
417
  sourceKey: z.ZodString;
350
418
  cap: z.ZodString;
351
419
  fieldPath: z.ZodString;
352
- }, z.core.$strip>;
420
+ }, z.core.$strip>, z.ZodObject<{
421
+ kind: z.ZodLiteral<"literal">;
422
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
423
+ }, z.core.$strip>, z.ZodObject<{
424
+ kind: z.ZodLiteral<"global">;
425
+ sourceStableId: z.ZodString;
426
+ cap: z.ZodString;
427
+ fieldPath: z.ZodString;
428
+ }, z.core.$strip>]>;
353
429
  target: z.ZodObject<{
354
430
  cap: z.ZodString;
355
431
  fieldPath: z.ZodString;
@@ -370,9 +446,17 @@ export declare const deviceManagerCapability: {
370
446
  }, z.core.$strip>>>;
371
447
  }, z.core.$strip>, z.ZodVoid, "mutation">;
372
448
  /** List the wireable status-schema fields per cap bound to a device.
373
- * Powers the Wiring tab's field pickers. Caps without a status schema are omitted. */
449
+ * Powers the Wiring tab's field pickers. Caps without a status schema are
450
+ * omitted. Item-array caps (`status.itemArray`, e.g. consumables) also
451
+ * emit their per-item fields tagged `item: true` (a link targeting one
452
+ * must carry a `target.itemKey`) plus the cap-level `itemArray`
453
+ * descriptor. `includeSynthesizable: true` (TARGET pickers only) unions
454
+ * in unbound device-scoped caps that declare `status.empty` and match
455
+ * the device's type — so the FIRST link to a synthesize-only cap
456
+ * (consumables on an HA vacuum) can be authored. */
374
457
  readonly getWireableFields: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
375
458
  deviceId: z.ZodNumber;
459
+ includeSynthesizable: z.ZodOptional<z.ZodBoolean>;
376
460
  }, z.core.$strip>, z.ZodObject<{
377
461
  caps: z.ZodReadonly<z.ZodArray<z.ZodObject<{
378
462
  cap: z.ZodString;
@@ -385,7 +469,12 @@ export declare const deviceManagerCapability: {
385
469
  enum: "enum";
386
470
  }>;
387
471
  enumValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
472
+ item: z.ZodOptional<z.ZodBoolean>;
388
473
  }, z.core.$strip>>>;
474
+ itemArray: z.ZodOptional<z.ZodObject<{
475
+ path: z.ZodString;
476
+ keyField: z.ZodString;
477
+ }, z.core.$strip>>;
389
478
  }, z.core.$strip>>>;
390
479
  }, z.core.$strip>, "query">;
391
480
  /** Stamp (or update) the semantic role on the device's meta row.
@@ -501,11 +590,20 @@ export declare const deviceManagerCapability: {
501
590
  }, z.core.$strip>>>>;
502
591
  deviceLinks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
503
592
  id: z.ZodString;
504
- source: z.ZodObject<{
593
+ source: z.ZodUnion<readonly [z.ZodObject<{
594
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
505
595
  sourceKey: z.ZodString;
506
596
  cap: z.ZodString;
507
597
  fieldPath: z.ZodString;
508
- }, z.core.$strip>;
598
+ }, z.core.$strip>, z.ZodObject<{
599
+ kind: z.ZodLiteral<"literal">;
600
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
601
+ }, z.core.$strip>, z.ZodObject<{
602
+ kind: z.ZodLiteral<"global">;
603
+ sourceStableId: z.ZodString;
604
+ cap: z.ZodString;
605
+ fieldPath: z.ZodString;
606
+ }, z.core.$strip>]>;
509
607
  target: z.ZodObject<{
510
608
  cap: z.ZodString;
511
609
  fieldPath: z.ZodString;
@@ -561,11 +659,20 @@ export declare const deviceManagerCapability: {
561
659
  }, z.core.$strip>>>>;
562
660
  deviceLinks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
563
661
  id: z.ZodString;
564
- source: z.ZodObject<{
662
+ source: z.ZodUnion<readonly [z.ZodObject<{
663
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
565
664
  sourceKey: z.ZodString;
566
665
  cap: z.ZodString;
567
666
  fieldPath: z.ZodString;
568
- }, z.core.$strip>;
667
+ }, z.core.$strip>, z.ZodObject<{
668
+ kind: z.ZodLiteral<"literal">;
669
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
670
+ }, z.core.$strip>, z.ZodObject<{
671
+ kind: z.ZodLiteral<"global">;
672
+ sourceStableId: z.ZodString;
673
+ cap: z.ZodString;
674
+ fieldPath: z.ZodString;
675
+ }, z.core.$strip>]>;
569
676
  target: z.ZodObject<{
570
677
  cap: z.ZodString;
571
678
  fieldPath: z.ZodString;
@@ -621,11 +728,20 @@ export declare const deviceManagerCapability: {
621
728
  }, z.core.$strip>>>>;
622
729
  deviceLinks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
623
730
  id: z.ZodString;
624
- source: z.ZodObject<{
731
+ source: z.ZodUnion<readonly [z.ZodObject<{
732
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
625
733
  sourceKey: z.ZodString;
626
734
  cap: z.ZodString;
627
735
  fieldPath: z.ZodString;
628
- }, z.core.$strip>;
736
+ }, z.core.$strip>, z.ZodObject<{
737
+ kind: z.ZodLiteral<"literal">;
738
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
739
+ }, z.core.$strip>, z.ZodObject<{
740
+ kind: z.ZodLiteral<"global">;
741
+ sourceStableId: z.ZodString;
742
+ cap: z.ZodString;
743
+ fieldPath: z.ZodString;
744
+ }, z.core.$strip>]>;
629
745
  target: z.ZodObject<{
630
746
  cap: z.ZodString;
631
747
  fieldPath: z.ZodString;
@@ -754,6 +870,7 @@ export declare const deviceManagerCapability: {
754
870
  capName: z.ZodString;
755
871
  kind: z.ZodEnum<{
756
872
  native: "native";
873
+ linked: "linked";
757
874
  wrapped: "wrapped";
758
875
  }>;
759
876
  providerAddonId: z.ZodString;
@@ -775,6 +892,7 @@ export declare const deviceManagerCapability: {
775
892
  capName: z.ZodString;
776
893
  kind: z.ZodEnum<{
777
894
  native: "native";
895
+ linked: "linked";
778
896
  wrapped: "wrapped";
779
897
  }>;
780
898
  providerAddonId: z.ZodString;
@@ -37,7 +37,7 @@ export { ArchiveEntrySchema, ArchiveManifestSchema, BackupDestinationInfoSchema,
37
37
  export { BrokerAddInputSchema, BrokerGetStateInputSchema, type BrokerInfo as UnifiedBrokerInfo, BrokerInfoSchema as UnifiedBrokerInfoSchema, type BrokerProviderInfo, BrokerProviderInfoSchema, BrokerPublishInputSchema, BrokerRegistryStatusSchema, type BrokerStatus as UnifiedBrokerStatus, BrokerStatusEnum, BrokerSubscribeInputSchema, BrokerSubscribeResultSchema, BrokerTestConnectionResultSchema, BrokerUnsubscribeInputSchema, brokerCapability, type IBrokerProvider, } from './broker.cap.js';
38
38
  export { cameraPipelineConfigCapability, type ICameraPipelineConfigProvider, } from './camera-pipeline-config.cap.js';
39
39
  export { cameraStreamsCapability, type ICameraStreamsProvider, type PickedCamStream, PickedCamStreamSchema, PickStreamPreferencesSchema, PickStreamRequirementsSchema, type StreamCodec, StreamCodecSchema, } from './camera-streams.cap.js';
40
- export type { CapabilityDefinition, CapabilityEventSchema, CapabilityMethodAuth, CapabilityMethodKind, CapabilityMethodOptions, CapabilityMethodSchema, CapabilityMountHint, CapabilityMountKind, DeviceConfigDerivedFormUi, DeviceConfigSpec, DeviceConfigUiSpec, DeviceConfigWidgetUi, DeviceSettingsContribution, InferDeviceProxyCap, InferEvents, InferName, InferNativeProvider, InferProvider, InferRuntimeState, ProviderKind, UiContribution, UiContributionKind, UiContributionRemote, } from './capability-definition.js';
40
+ export type { CapabilityDefinition, CapabilityEventSchema, CapabilityMethodAuth, CapabilityMethodKind, CapabilityMethodOptions, CapabilityMethodSchema, CapabilityMountHint, CapabilityMountKind, CapabilityStatusItemArray, CapabilityStatusKind, CapabilityStatusSchema, DeviceConfigDerivedFormUi, DeviceConfigSpec, DeviceConfigUiSpec, DeviceConfigWidgetUi, DeviceSettingsContribution, InferDeviceProxyCap, InferEvents, InferName, InferNativeProvider, InferProvider, InferRuntimeState, ProviderKind, UiContribution, UiContributionKind, UiContributionRemote, } from './capability-definition.js';
41
41
  export { DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, event, expandCapMethods, isDeviceConfigCap, method, resolveCapMount, } from './capability-definition.js';
42
42
  export * from './custom-actions.js';
43
43
  export type { CustomModelDescriptor, ICustomModelRegistryProvider, } from './custom-model-registry.cap.js';
@@ -74,8 +74,8 @@ export type { PipelineStepInputOutput } from './pipeline-executor.cap.js';
74
74
  export { DetectorOutputSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, pipelineExecutorCapability, } from './pipeline-executor.cap.js';
75
75
  export type { CameraAssignmentStatus, CameraAudioStatus, CameraBrokerProfile, CameraBrokerStatus, CameraDecoderShm, CameraDecoderStatus, CameraDetectionPhase, CameraDetectionProvisioning, CameraDetectionProvisioningState, CameraDetectionStatus, CameraMotionStatus, CameraRecordingMode, CameraRecordingStatus, CameraSourceStatus, CameraSourceStream, CameraStatus, } from './pipeline-orchestrator.cap.js';
76
76
  export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CapabilityBindingsSchema, DecoderAssignmentSchema, GlobalMetricsSchema, PipelineAssignmentSchema, pipelineOrchestratorCapability, } from './pipeline-orchestrator.cap.js';
77
- export type { MotionSource, MotionSources, ReportMotionInput } from './pipeline-runner.cap.js';
78
- export { MotionSourceEnum, MotionSourcesSchema, pipelineRunnerCapability, ReportMotionInputSchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, } from './pipeline-runner.cap.js';
77
+ export type { MotionSource, MotionSources, ReportMotionInput, RunnerFrameSource, } from './pipeline-runner.cap.js';
78
+ export { MotionSourceEnum, MotionSourcesSchema, pipelineRunnerCapability, ReportMotionInputSchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, } from './pipeline-runner.cap.js';
79
79
  export { ExposedResourceSchema, RegisteredStreamSchema, restreamerCapability, } from './restreamer.cap.js';
80
80
  export { AudioChunkInputSchema, AudioClassificationLabelSchema, AudioLevelSchema, BoundingBoxSchema, FrameInputSchema, SpatialDetectionSchema, } from './schemas/detection-shared.js';
81
81
  export { CameraMetricsSchema, CameraMetricsWithDeviceIdSchema, OrchestratorMetricsSchema, } from './schemas/orchestrator-metrics.js';
@@ -59,6 +59,32 @@ export declare const ReportMotionInputSchema: z.ZodObject<{
59
59
  }, z.core.$strip>>>>;
60
60
  }, z.core.$strip>;
61
61
  export type ReportMotionInput = z.infer<typeof ReportMotionInputSchema>;
62
+ /**
63
+ * Where a runner gets a camera's decoded frames (cross-node Phase 2,
64
+ * restream-owner model — P2c).
65
+ *
66
+ * - `local-broker` (DEFAULT): today's path — subscribe to the co-located
67
+ * stream-broker's shm frame plane. Every pre-P2c attach payload (no
68
+ * `frameSource` key) parses to this, so the field is additive with zero
69
+ * behavior change.
70
+ * - `remote-restream`: the detect node is NOT the camera's source-owner.
71
+ * The runner acquires the owner's COMPRESSED passthrough restream
72
+ * (`streamBroker.getStreamWithCodec({video:'copy'})` — refcounted, the
73
+ * double-pull guard) and decodes LOCALLY via a satellite frame plane +
74
+ * pull-mode decoder session pinned to its own node. The shm ring stays
75
+ * node-local; only H.264/H.265 packets cross the wire.
76
+ * `hubHostnameOverride` mirrors the recorder's `recordingHubHostname`:
77
+ * when set it overrides the `CAMSTACK_HUB_URL`-derived host the runner
78
+ * dials for the owner's restream.
79
+ */
80
+ export declare const RunnerFrameSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
+ kind: z.ZodLiteral<"local-broker">;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ kind: z.ZodLiteral<"remote-restream">;
84
+ ownerNodeId: z.ZodString;
85
+ hubHostnameOverride: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>], "kind">;
87
+ export type RunnerFrameSource = z.infer<typeof RunnerFrameSourceSchema>;
62
88
  /**
63
89
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
64
90
  * specific runner instance via `attachCamera`. Carries everything the
@@ -145,6 +171,13 @@ declare const RunnerCameraConfigSchema: z.ZodObject<{
145
171
  onboardMotionDrivesAnalyzer: z.ZodDefault<z.ZodBoolean>;
146
172
  occupancyRecheckSec: z.ZodDefault<z.ZodNumber>;
147
173
  occupancyRecheckFrames: z.ZodDefault<z.ZodNumber>;
174
+ frameSource: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
175
+ kind: z.ZodLiteral<"local-broker">;
176
+ }, z.core.$strip>, z.ZodObject<{
177
+ kind: z.ZodLiteral<"remote-restream">;
178
+ ownerNodeId: z.ZodString;
179
+ hubHostnameOverride: z.ZodOptional<z.ZodString>;
180
+ }, z.core.$strip>], "kind">>;
148
181
  }, z.core.$strip>;
149
182
  /**
150
183
  * Per-device settings UI fields the runner cap owns. Co-located with
@@ -285,6 +318,13 @@ export declare const pipelineRunnerCapability: {
285
318
  onboardMotionDrivesAnalyzer: z.ZodDefault<z.ZodBoolean>;
286
319
  occupancyRecheckSec: z.ZodDefault<z.ZodNumber>;
287
320
  occupancyRecheckFrames: z.ZodDefault<z.ZodNumber>;
321
+ frameSource: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
322
+ kind: z.ZodLiteral<"local-broker">;
323
+ }, z.core.$strip>, z.ZodObject<{
324
+ kind: z.ZodLiteral<"remote-restream">;
325
+ ownerNodeId: z.ZodString;
326
+ hubHostnameOverride: z.ZodOptional<z.ZodString>;
327
+ }, z.core.$strip>], "kind">>;
288
328
  }, z.core.$strip>, z.ZodObject<{
289
329
  success: z.ZodLiteral<true>;
290
330
  }, z.core.$strip>, "mutation">;
@@ -1,3 +1,13 @@
1
+ /**
2
+ * `recording` cap — footage availability + HLS playback manifests + per-device
3
+ * recording config. NOTE on events (source of truth, R5/C3): this cap carries
4
+ * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
5
+ * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
6
+ * rows); the recorder's internal EventMap markers are ephemeral in-RAM
7
+ * annotations that are not exposed here and must not be treated as an event
8
+ * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
9
+ * (`interfaces/recording-config.ts`).
10
+ */
1
11
  import { z } from 'zod';
2
12
  import { type InferProvider } from './capability-definition.js';
3
13
  export declare const RecordingStatusSchema: z.ZodObject<{
@@ -6,13 +6,19 @@
6
6
  */
7
7
  export interface DeviceBindingEntry {
8
8
  capName: string;
9
- kind: 'native' | 'wrapped';
9
+ /** `native`/`wrapped` = a real provider serves the cap. `linked` = the cap
10
+ * is SYNTHESIZED from device-links (no provider — the getStatus dispatcher
11
+ * routes to device-manager's resolveLinkedStatus). UI metadata only —
12
+ * consumers must never branch on it for routing (D13). */
13
+ kind: 'native' | 'wrapped' | 'linked';
10
14
  /** Currently-active provider. For kind='native', equal to `nativeAddonId`.
11
- * For kind='wrapped', the wrapper addon id. */
15
+ * For kind='wrapped', the wrapper addon id. For kind='linked', the
16
+ * device-manager addon id (the synthesize owner). */
12
17
  providerAddonId: string;
13
18
  /** Node where the active provider runs. 'hub' for native; may vary for wrappers. */
14
19
  providerNodeId: string;
15
- /** Always the addon id of the underlying native provider for the device. */
20
+ /** Always the addon id of the underlying native provider for the device.
21
+ * Empty for kind='linked' (no native exists). */
16
22
  nativeAddonId: string;
17
23
  }
18
24
  export interface DeviceBinding {
@@ -95,17 +95,39 @@ export interface ChildLayoutEntry {
95
95
  readonly collapsed?: boolean;
96
96
  }
97
97
  export type ChildLayout = readonly ChildLayoutEntry[];
98
- /** One end of a device link: a single field on a source device's capability,
99
- * addressed by the source's re-sync-stable accessory `stableIdSuffix`
98
+ /** Field source: copy one field of a sibling accessory's cap status.
99
+ * Addressed by the source's re-sync-stable accessory `stableIdSuffix`
100
100
  * (`sourceKey`) — NOT a raw numeric id — so the link survives a re-sync. The
101
101
  * source must be a sibling accessory under the SAME parent container as the
102
- * target device; resolution is `${parentStableId}-${sourceKey}` (cross-parent
103
- * links are out of scope and resolve to no source). */
104
- export interface DeviceLinkSource {
102
+ * target device; resolution is `${parentStableId}-${sourceKey}`. For a source
103
+ * anywhere else in the cluster use `DeviceLinkGlobalSource`. */
104
+ export interface DeviceLinkFieldSource {
105
+ readonly kind?: 'field';
105
106
  readonly sourceKey: string;
106
107
  readonly cap: string;
107
108
  readonly fieldPath: string;
108
109
  }
110
+ /** Literal source: a per-device constant (e.g. `battery.binary = true`,
111
+ * a consumable item's `label`/`resettable`). No sibling is read. */
112
+ export interface DeviceLinkLiteralSource {
113
+ readonly kind: 'literal';
114
+ readonly value: string | number | boolean | null;
115
+ }
116
+ /** Global source (P2e): copy one field of ANY device's cap status, regardless
117
+ * of parent container. Addressed by the source device's FULL `stableId` —
118
+ * chosen over the numeric id because a re-sync (`resetToSource`) REALLOCATES
119
+ * numeric ids while stableIds are deterministic from the provider (the same
120
+ * property the sibling `sourceKey` mechanism relies on). stableId uniqueness
121
+ * is formally per-addon; the resolver matches the first meta row with that
122
+ * stableId (effective global uniqueness — an `addonId` disambiguator can be
123
+ * added later without a wire break). */
124
+ export interface DeviceLinkGlobalSource {
125
+ readonly kind: 'global';
126
+ readonly sourceStableId: string;
127
+ readonly cap: string;
128
+ readonly fieldPath: string;
129
+ }
130
+ export type DeviceLinkSource = DeviceLinkFieldSource | DeviceLinkLiteralSource | DeviceLinkGlobalSource;
109
131
  /** The target field a link writes: a dot-path into the target cap's status. */
110
132
  export interface DeviceLinkTarget {
111
133
  readonly cap: string;
@@ -11,7 +11,7 @@ export type { IDevice } from './device.js';
11
11
  export { DEVICE_PROFILES, BATTERY_DEVICE_PROFILE, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
12
12
  export type { DeviceProfile, DeviceProfileMatch, DeviceProfileDefaults, PipelinePhaseMode, } from './device-profile.js';
13
13
  export type { ICameraDevice, StreamSourceEntry } from './camera-device.js';
14
- export type { DeviceManualCreation, DeviceDiscovery, DiscoveredDevice, SavedDevice, DeviceMeta, InitialDeviceMeta, CreateDeviceSpec, ChildLayout, ChildLayoutEntry, DeviceLinkSource, DeviceLinkTarget, DeviceLinkTransform, DeviceLink, DeviceLinks, } from './device-management.js';
14
+ export type { DeviceManualCreation, DeviceDiscovery, DiscoveredDevice, SavedDevice, DeviceMeta, InitialDeviceMeta, CreateDeviceSpec, ChildLayout, ChildLayoutEntry, DeviceLinkFieldSource, DeviceLinkLiteralSource, DeviceLinkGlobalSource, DeviceLinkSource, DeviceLinkTarget, DeviceLinkTransform, DeviceLink, DeviceLinks, } from './device-management.js';
15
15
  export { zodEntriesToConfigUI } from './zod-to-config-ui.js';
16
16
  export type { DeviceConfigEntry } from './zod-to-config-ui.js';
17
17
  export { createRuntimeStateBridge } from './runtime-state-helpers.js';
@@ -19,5 +19,5 @@ export type { RuntimeStateBridge } from './runtime-state-helpers.js';
19
19
  export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot, } from './device-runtime-state.js';
20
20
  export { getByPath, setByPath } from './path-util.js';
21
21
  export { applyTransform } from './device-link-transform.js';
22
- export { enumerateSchemaFields } from './schema-fields.js';
22
+ export { enumerateItemArrayFields, enumerateSchemaFields } from './schema-fields.js';
23
23
  export type { WireableField } from './schema-fields.js';
@@ -3,9 +3,22 @@ export interface WireableField {
3
3
  readonly path: string;
4
4
  readonly kind: 'string' | 'number' | 'boolean' | 'enum';
5
5
  readonly enumValues?: readonly string[];
6
+ /** True when `path` is relative to ONE item of an item-array cap (see
7
+ * `CapabilityStatusItemArray`) — a link targeting it must carry a
8
+ * `target.itemKey`. Absent/false for plain status fields. */
9
+ readonly item?: boolean;
6
10
  }
7
11
  /** Walk a cap status schema into flat wireable leaf fields (dotted paths).
8
12
  * Recurses into nested ZodObject (unwrapping nullable/optional/default first),
9
13
  * so fields with null live values are still offered. Arrays / unknown shapes
10
14
  * are skipped — never throws. */
11
15
  export declare function enumerateSchemaFields(schema: z.ZodType, prefix?: string): readonly WireableField[];
16
+ /** Enumerate the per-item wireable fields of an item-array cap (see
17
+ * `CapabilityStatusItemArray`): the item schema's leaf fields, minus the
18
+ * `keyField` (the key comes from the link's `itemKey`, never from a wired
19
+ * source), each tagged `item: true` so the authoring UI collects an
20
+ * `itemKey` alongside the field. Never throws. */
21
+ export declare function enumerateItemArrayFields(itemArray: {
22
+ readonly keyField: string;
23
+ readonly itemSchema: z.ZodType;
24
+ }): readonly WireableField[];