@camstack/types 1.1.33 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/addon-pages-source.cap.d.ts +4 -0
- package/dist/capabilities/addon-pages.cap.d.ts +4 -0
- package/dist/capabilities/custom-model-registry.cap.d.ts +2 -0
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/model-convert.cap.d.ts +1 -0
- package/dist/capabilities/model-distributor.cap.d.ts +2 -0
- package/dist/capabilities/pipeline-executor.cap.d.ts +27 -47
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +31 -69
- package/dist/device/index.d.ts +2 -0
- package/dist/device/reachability-poll.d.ts +90 -0
- package/dist/generated/addon-api.d.ts +36 -146
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +217 -108
- package/dist/index.mjs +214 -107
- package/dist/interfaces/addon.d.ts +12 -2
- package/dist/interfaces/pipeline-executor-capability.d.ts +2 -8
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts +0 -14
- package/dist/{sleep-Cc14_yxc.mjs → sleep-DiQ8xW1M.mjs} +0 -3
- package/dist/{sleep-DmP-uxoe.js → sleep-DuN1nc6O.js} +0 -3
- package/dist/types/agent-pipeline-settings.d.ts +8 -0
- package/dist/types/model-variant-groups.d.ts +10 -0
- package/dist/types/models.d.ts +3 -0
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-DuN1nc6O.js");
|
|
3
3
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
4
4
|
exports.BaseAddon = require_sleep.BaseAddon;
|
|
5
5
|
exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as ReadinessRegistry, C as asJsonObject, O as parseJsonUnknown, P as scopeKey, T as asString, a as adminUiCapability, b as DeviceType, gt as DisposerChain, ht as EventCategory, i as deviceOpsCapability, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, st as normalizeAddonInitResult, t as sleep, ut as emitReadiness } from "./sleep-
|
|
1
|
+
import { A as ReadinessRegistry, C as asJsonObject, O as parseJsonUnknown, P as scopeKey, T as asString, a as adminUiCapability, b as DeviceType, gt as DisposerChain, ht as EventCategory, i as deviceOpsCapability, j as ReadinessTimeoutError, k as DATAPLANE_SECRET_HEADER, o as createDeviceProxy, ot as BaseAddon, p as expandCapMethods, st as normalizeAddonInitResult, t as sleep, ut as emitReadiness } from "./sleep-DiQ8xW1M.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
export { BaseAddon, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, normalizeAddonInitResult, parseJsonUnknown, scopeKey, sleep };
|
|
@@ -19,6 +19,8 @@ declare const AddonPageDeclarationSchema: z.ZodObject<{
|
|
|
19
19
|
path: z.ZodString;
|
|
20
20
|
remoteName: z.ZodString;
|
|
21
21
|
bundle: z.ZodString;
|
|
22
|
+
section: z.ZodOptional<z.ZodString>;
|
|
23
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
22
24
|
}, z.core.$strip>;
|
|
23
25
|
export declare const addonPagesSourceCapability: {
|
|
24
26
|
readonly name: "addon-pages-source";
|
|
@@ -33,6 +35,8 @@ export declare const addonPagesSourceCapability: {
|
|
|
33
35
|
path: z.ZodString;
|
|
34
36
|
remoteName: z.ZodString;
|
|
35
37
|
bundle: z.ZodString;
|
|
38
|
+
section: z.ZodOptional<z.ZodString>;
|
|
39
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
36
40
|
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
37
41
|
};
|
|
38
42
|
};
|
|
@@ -9,6 +9,8 @@ declare const AddonPageInfoSchema: z.ZodObject<{
|
|
|
9
9
|
path: z.ZodString;
|
|
10
10
|
remoteName: z.ZodString;
|
|
11
11
|
bundle: z.ZodString;
|
|
12
|
+
section: z.ZodOptional<z.ZodString>;
|
|
13
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
12
14
|
}, z.core.$strip>;
|
|
13
15
|
bundleUrl: z.ZodString;
|
|
14
16
|
}, z.core.$strip>;
|
|
@@ -26,6 +28,8 @@ export declare const addonPagesCapability: {
|
|
|
26
28
|
path: z.ZodString;
|
|
27
29
|
remoteName: z.ZodString;
|
|
28
30
|
bundle: z.ZodString;
|
|
31
|
+
section: z.ZodOptional<z.ZodString>;
|
|
32
|
+
sectionLabel: z.ZodOptional<z.ZodString>;
|
|
29
33
|
}, z.core.$strip>;
|
|
30
34
|
bundleUrl: z.ZodString;
|
|
31
35
|
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
@@ -122,6 +122,7 @@ export declare const CustomModelDescriptorSchema: z.ZodObject<{
|
|
|
122
122
|
standard: "standard";
|
|
123
123
|
fast: "fast";
|
|
124
124
|
}>>;
|
|
125
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
125
126
|
}, z.core.$strip>>;
|
|
126
127
|
}, z.core.$strip>;
|
|
127
128
|
}, z.core.$strip>;
|
|
@@ -237,6 +238,7 @@ export declare const customModelRegistryCapability: {
|
|
|
237
238
|
standard: "standard";
|
|
238
239
|
fast: "fast";
|
|
239
240
|
}>>;
|
|
241
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
240
242
|
}, z.core.$strip>>;
|
|
241
243
|
}, z.core.$strip>;
|
|
242
244
|
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
@@ -72,9 +72,9 @@ export { type Attachment, AttachmentMediaTypeSchema, type AttachmentMediaType, A
|
|
|
72
72
|
export { type IOauthIntegrationProvider, type OauthIntegrationDescriptor, OauthIntegrationDescriptorSchema, oauthIntegrationCapability, } from './oauth-integration.cap.js';
|
|
73
73
|
export { type AudioEvent, AudioEventSchema, type DetectionSource, DetectionSourceSchema, type EventKind, EventKindSchema, type IPipelineAnalyticsProvider, type MediaFile, type MediaFileKind, MediaFileSchema, type MotionEvent, MotionEventSchema, type ObjectEvent, ObjectEventSchema, pipelineAnalyticsCapability, type ScoredObjectEvent, ScoredObjectEventSchema, type Track, TrackedDetectionSchema, TrackSchema, type TrackState, TrackStateSchema, } from './pipeline-analytics.cap.js';
|
|
74
74
|
export type { PipelineStepInputOutput, PipelineValidationIssue, PipelineValidationResult, } from './pipeline-executor.cap.js';
|
|
75
|
-
export {
|
|
75
|
+
export { ModelSubstitutionSchema, PipelineDefaultStepSchema, PipelineEngineChoiceSchema, PipelineRunResultBridge, PipelineStepInputSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, pipelineExecutorCapability, } from './pipeline-executor.cap.js';
|
|
76
76
|
export type { CameraAssignmentStatus, CameraAudioStatus, CameraBrokerProfile, CameraBrokerStatus, CameraDecoderShm, CameraDecoderStatus, CameraDetectionPhase, CameraDetectionProvisioning, CameraDetectionProvisioningState, CameraDetectionStatus, CameraMotionStatus, CameraRecordingMode, CameraRecordingStatus, CameraSourceStatus, CameraSourceStream, CameraStatus, IngestOwner, } from './pipeline-orchestrator.cap.js';
|
|
77
|
-
export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CapabilityBindingsSchema,
|
|
77
|
+
export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CapabilityBindingsSchema, GlobalMetricsSchema, IngestOwnerSchema, PipelineAssignmentSchema, pipelineOrchestratorCapability, } from './pipeline-orchestrator.cap.js';
|
|
78
78
|
export type { MotionSource, MotionSources, ReportMotionInput, RunnerFrameSource, } from './pipeline-runner.cap.js';
|
|
79
79
|
export { MotionSourceEnum, MotionSourcesSchema, pipelineRunnerCapability, ReportMotionInputSchema, RunnerCameraConfigSchema, RunnerCameraDeviceUIFields, RunnerFrameSourceSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema, } from './pipeline-runner.cap.js';
|
|
80
80
|
export { AudioChunkInputSchema, AudioClassificationLabelSchema, AudioLevelSchema, BoundingBoxSchema, FrameInputSchema, SpatialDetectionSchema, } from './schemas/detection-shared.js';
|
|
@@ -123,6 +123,7 @@ export declare const ModelDistributeInputSchema: z.ZodObject<{
|
|
|
123
123
|
standard: "standard";
|
|
124
124
|
fast: "fast";
|
|
125
125
|
}>>;
|
|
126
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
126
127
|
}, z.core.$strip>>;
|
|
127
128
|
}, z.core.$strip>;
|
|
128
129
|
}, z.core.$strip>;
|
|
@@ -251,6 +252,7 @@ export declare const modelDistributorCapability: {
|
|
|
251
252
|
standard: "standard";
|
|
252
253
|
fast: "fast";
|
|
253
254
|
}>>;
|
|
255
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
254
256
|
}, z.core.$strip>>;
|
|
255
257
|
}, z.core.$strip>;
|
|
256
258
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -108,6 +108,7 @@ declare const PipelineModelOptionSchema: z.ZodObject<{
|
|
|
108
108
|
standard: "standard";
|
|
109
109
|
fast: "fast";
|
|
110
110
|
}>>;
|
|
111
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
111
112
|
}, z.core.$strip>>;
|
|
112
113
|
legacy: z.ZodOptional<z.ZodBoolean>;
|
|
113
114
|
}, z.core.$strip>;
|
|
@@ -148,6 +149,7 @@ declare const PipelineAddonSchemaSchema: z.ZodObject<{
|
|
|
148
149
|
standard: "standard";
|
|
149
150
|
fast: "fast";
|
|
150
151
|
}>>;
|
|
152
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
151
153
|
}, z.core.$strip>>;
|
|
152
154
|
legacy: z.ZodOptional<z.ZodBoolean>;
|
|
153
155
|
}, z.core.$strip>>>;
|
|
@@ -212,6 +214,7 @@ declare const PipelineSlotSchemaSchema: z.ZodObject<{
|
|
|
212
214
|
standard: "standard";
|
|
213
215
|
fast: "fast";
|
|
214
216
|
}>>;
|
|
217
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
215
218
|
}, z.core.$strip>>;
|
|
216
219
|
legacy: z.ZodOptional<z.ZodBoolean>;
|
|
217
220
|
}, z.core.$strip>>>;
|
|
@@ -316,6 +319,7 @@ declare const PipelineSchemaSchema: z.ZodObject<{
|
|
|
316
319
|
standard: "standard";
|
|
317
320
|
fast: "fast";
|
|
318
321
|
}>>;
|
|
322
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
319
323
|
}, z.core.$strip>>;
|
|
320
324
|
legacy: z.ZodOptional<z.ZodBoolean>;
|
|
321
325
|
}, z.core.$strip>>>;
|
|
@@ -328,21 +332,6 @@ declare const PipelineSchemaSchema: z.ZodObject<{
|
|
|
328
332
|
}, z.core.$strip>>>;
|
|
329
333
|
}, z.core.$strip>>>;
|
|
330
334
|
}, z.core.$strip>;
|
|
331
|
-
declare const DetectorOutputSchema: z.ZodObject<{
|
|
332
|
-
detections: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
333
|
-
class: z.ZodString;
|
|
334
|
-
originalClass: z.ZodString;
|
|
335
|
-
score: z.ZodNumber;
|
|
336
|
-
bbox: z.ZodObject<{
|
|
337
|
-
x: z.ZodNumber;
|
|
338
|
-
y: z.ZodNumber;
|
|
339
|
-
w: z.ZodNumber;
|
|
340
|
-
h: z.ZodNumber;
|
|
341
|
-
}, z.core.$strip>;
|
|
342
|
-
}, z.core.$strip>>>;
|
|
343
|
-
inferenceMs: z.ZodNumber;
|
|
344
|
-
modelId: z.ZodString;
|
|
345
|
-
}, z.core.$strip>;
|
|
346
335
|
declare const EngineProvisioningSchema: z.ZodObject<{
|
|
347
336
|
runtimeId: z.ZodNullable<z.ZodEnum<{
|
|
348
337
|
onnx: "onnx";
|
|
@@ -534,6 +523,27 @@ export declare const pipelineExecutorCapability: {
|
|
|
534
523
|
}, z.core.$strip>, z.ZodObject<{
|
|
535
524
|
success: z.ZodLiteral<true>;
|
|
536
525
|
}, z.core.$strip>, "mutation">;
|
|
526
|
+
/**
|
|
527
|
+
* Clear THIS node's executor-side PER-DEVICE settings stores (the
|
|
528
|
+
* per-camera step overrides the object-detection root reads via
|
|
529
|
+
* `applyDeviceOverridesToTree`). `nodeId` is the ROUTING key — the
|
|
530
|
+
* generated cap-router strips it (default `nodeIdMode: 'routing'`) and
|
|
531
|
+
* dispatches to that node, so the provider method runs ON the target
|
|
532
|
+
* node and receives no `nodeId`.
|
|
533
|
+
*
|
|
534
|
+
* This is the slimmed executor leg of the orchestrator's
|
|
535
|
+
* `resetNodePipelineDefaults` flow (which owns the real reset: node
|
|
536
|
+
* addonDefaults pins + per-camera orchestrator overrides). The legacy
|
|
537
|
+
* `resetToDefault` — which reset a persisted global step-tree seed
|
|
538
|
+
* nothing in the live per-camera path read — was removed together with
|
|
539
|
+
* that seed.
|
|
540
|
+
*/
|
|
541
|
+
readonly clearDeviceOverrides: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
542
|
+
nodeId: z.ZodString;
|
|
543
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
544
|
+
success: z.ZodLiteral<true>;
|
|
545
|
+
clearedDevices: z.ZodNumber;
|
|
546
|
+
}, z.core.$strip>, "mutation">;
|
|
537
547
|
readonly getSchema: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
|
|
538
548
|
availableEngines: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
539
549
|
engine: z.ZodObject<{
|
|
@@ -627,6 +637,7 @@ export declare const pipelineExecutorCapability: {
|
|
|
627
637
|
standard: "standard";
|
|
628
638
|
fast: "fast";
|
|
629
639
|
}>>;
|
|
640
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
630
641
|
}, z.core.$strip>>;
|
|
631
642
|
legacy: z.ZodOptional<z.ZodBoolean>;
|
|
632
643
|
}, z.core.$strip>>>;
|
|
@@ -797,37 +808,6 @@ export declare const pipelineExecutorCapability: {
|
|
|
797
808
|
}, z.core.$strip>, z.ZodObject<{
|
|
798
809
|
success: z.ZodLiteral<true>;
|
|
799
810
|
}, z.core.$strip>, "mutation">;
|
|
800
|
-
readonly detect: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
801
|
-
addonId: z.ZodString;
|
|
802
|
-
frame: z.ZodObject<{
|
|
803
|
-
data: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
804
|
-
format: z.ZodEnum<{
|
|
805
|
-
jpeg: "jpeg";
|
|
806
|
-
rgb: "rgb";
|
|
807
|
-
bgr: "bgr";
|
|
808
|
-
yuv420: "yuv420";
|
|
809
|
-
gray: "gray";
|
|
810
|
-
}>;
|
|
811
|
-
width: z.ZodNumber;
|
|
812
|
-
height: z.ZodNumber;
|
|
813
|
-
timestamp: z.ZodNumber;
|
|
814
|
-
}, z.core.$strip>;
|
|
815
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
816
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
817
|
-
detections: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
818
|
-
class: z.ZodString;
|
|
819
|
-
originalClass: z.ZodString;
|
|
820
|
-
score: z.ZodNumber;
|
|
821
|
-
bbox: z.ZodObject<{
|
|
822
|
-
x: z.ZodNumber;
|
|
823
|
-
y: z.ZodNumber;
|
|
824
|
-
w: z.ZodNumber;
|
|
825
|
-
h: z.ZodNumber;
|
|
826
|
-
}, z.core.$strip>;
|
|
827
|
-
}, z.core.$strip>>>;
|
|
828
|
-
inferenceMs: z.ZodNumber;
|
|
829
|
-
modelId: z.ZodString;
|
|
830
|
-
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
831
811
|
/**
|
|
832
812
|
* Stateless single-frame execution. Callers (runner, benchmark) pass
|
|
833
813
|
* the complete `engine` + `steps` tree; the executor holds no state
|
|
@@ -1119,4 +1099,4 @@ export declare const pipelineExecutorCapability: {
|
|
|
1119
1099
|
};
|
|
1120
1100
|
};
|
|
1121
1101
|
export type IPipelineExecutorProvider = InferProvider<typeof pipelineExecutorCapability>;
|
|
1122
|
-
export { PipelineEngineChoiceSchema, PipelineDefaultStepSchema,
|
|
1102
|
+
export { PipelineEngineChoiceSchema, PipelineDefaultStepSchema, PipelineSchemaSchema, PipelineAddonSchemaSchema, PipelineSlotSchemaSchema, PipelineModelOptionSchema, AvailableEngineSchema, PipelineTemplateSchema, PipelineTemplateStepSchema, EngineDeviceInfoSchema, EngineProvisioningSchema, ModelSubstitutionSchema, PipelineValidationIssueSchema, PipelineValidationResultSchema, };
|
|
@@ -111,22 +111,6 @@ declare const PipelineAssignmentSchema: z.ZodObject<{
|
|
|
111
111
|
}>;
|
|
112
112
|
assignedAt: z.ZodNumber;
|
|
113
113
|
}, z.core.$strip>;
|
|
114
|
-
/**
|
|
115
|
-
* Decoder placement record. Symmetric to `PipelineAssignmentSchema` but for
|
|
116
|
-
* the decoder-node placement domain (`balanceDecoder` decision: manual pin
|
|
117
|
-
* → co-located with pipeline → capacity).
|
|
118
|
-
*/
|
|
119
|
-
declare const DecoderAssignmentSchema: z.ZodObject<{
|
|
120
|
-
deviceId: z.ZodNumber;
|
|
121
|
-
decoderNodeId: z.ZodString;
|
|
122
|
-
pinned: z.ZodBoolean;
|
|
123
|
-
reason: z.ZodEnum<{
|
|
124
|
-
manual: "manual";
|
|
125
|
-
capacity: "capacity";
|
|
126
|
-
"hardware-affinity": "hardware-affinity";
|
|
127
|
-
"co-located": "co-located";
|
|
128
|
-
}>;
|
|
129
|
-
}, z.core.$strip>;
|
|
130
114
|
/**
|
|
131
115
|
* Per-agent load summary surfaced to the load balancer + dashboards.
|
|
132
116
|
* Aggregated from each runner's `getLocalLoad` cap call.
|
|
@@ -619,27 +603,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
619
603
|
reachableHost: z.ZodOptional<z.ZodString>;
|
|
620
604
|
configIssue: z.ZodOptional<z.ZodString>;
|
|
621
605
|
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
622
|
-
/** Pin a device's decoder to a specific node. */
|
|
623
|
-
readonly assignDecoder: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
624
|
-
deviceId: z.ZodNumber;
|
|
625
|
-
nodeId: z.ZodString;
|
|
626
|
-
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
627
|
-
/** Clear a device's decoder pin (revert to auto). */
|
|
628
|
-
readonly unassignDecoder: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
629
|
-
deviceId: z.ZodNumber;
|
|
630
|
-
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
631
|
-
/** Get every camera's decoder placement. */
|
|
632
|
-
readonly getDecoderAssignments: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
633
|
-
deviceId: z.ZodNumber;
|
|
634
|
-
decoderNodeId: z.ZodString;
|
|
635
|
-
pinned: z.ZodBoolean;
|
|
636
|
-
reason: z.ZodEnum<{
|
|
637
|
-
manual: "manual";
|
|
638
|
-
capacity: "capacity";
|
|
639
|
-
"hardware-affinity": "hardware-affinity";
|
|
640
|
-
"co-located": "co-located";
|
|
641
|
-
}>;
|
|
642
|
-
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
643
606
|
/** Pin a device's audio analysis to a specific cluster node. */
|
|
644
607
|
readonly assignAudio: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
645
608
|
deviceId: z.ZodNumber;
|
|
@@ -673,33 +636,6 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
673
636
|
pinned: z.ZodBoolean;
|
|
674
637
|
assignedAt: z.ZodNumber;
|
|
675
638
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
676
|
-
/**
|
|
677
|
-
* Get one camera's decoder placement (computed if not yet pinned).
|
|
678
|
-
*
|
|
679
|
-
* ADVISORY today: reports the orchestrator's decoder preference only.
|
|
680
|
-
* Actual decode placement is broker-owned (local-node pin + frame-plane
|
|
681
|
-
* co-location guard). Reserved to become the binding source/decoder-owner
|
|
682
|
-
* control in the stream-LB epic (Phase 2).
|
|
683
|
-
*
|
|
684
|
-
* `pipelineNodeId` is the node already chosen to run inference for
|
|
685
|
-
* this camera. When provided, the balancer prefers co-location with
|
|
686
|
-
* it; omitted → falls back to the last known assignment in the
|
|
687
|
-
* `assignments` map and finally to 'hub'.
|
|
688
|
-
*/
|
|
689
|
-
readonly getDecoderAssignment: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
690
|
-
deviceId: z.ZodNumber;
|
|
691
|
-
pipelineNodeId: z.ZodOptional<z.ZodString>;
|
|
692
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
693
|
-
deviceId: z.ZodNumber;
|
|
694
|
-
decoderNodeId: z.ZodString;
|
|
695
|
-
pinned: z.ZodBoolean;
|
|
696
|
-
reason: z.ZodEnum<{
|
|
697
|
-
manual: "manual";
|
|
698
|
-
capacity: "capacity";
|
|
699
|
-
"hardware-affinity": "hardware-affinity";
|
|
700
|
-
"co-located": "co-located";
|
|
701
|
-
}>;
|
|
702
|
-
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
703
639
|
/** Read one agent's settings. Null when not yet seeded. */
|
|
704
640
|
readonly getAgentSettings: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
705
641
|
agentNodeId: z.ZodString;
|
|
@@ -797,14 +733,15 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
797
733
|
* `enabledDecoderNodes`, `enabledAudioNodes`, `remoteSourcingNodes`).
|
|
798
734
|
* Each flag is optional in the patch: omit a flag to leave it unchanged,
|
|
799
735
|
* pass `null` to reset it to the node default (`hub` → capable, every
|
|
800
|
-
* other node → not). Detection/
|
|
801
|
-
*
|
|
802
|
-
*
|
|
736
|
+
* other node → not). Detection/audio eligibility is derived from these
|
|
737
|
+
* flags across the cluster; changing them re-derives the enabled sets
|
|
738
|
+
* and reconciles dispatch immediately. There is NO separate decode flag:
|
|
739
|
+
* decode is always co-located with its frame consumer, so decode
|
|
740
|
+
* eligibility IS detect eligibility.
|
|
803
741
|
*/
|
|
804
742
|
readonly setAgentCapabilities: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
805
743
|
agentNodeId: z.ZodString;
|
|
806
744
|
detect: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
807
|
-
decode: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
808
745
|
audio: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
809
746
|
ingest: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
810
747
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -825,6 +762,31 @@ export declare const pipelineOrchestratorCapability: {
|
|
|
825
762
|
}, z.core.$strip>, z.ZodObject<{
|
|
826
763
|
success: z.ZodLiteral<true>;
|
|
827
764
|
}, z.core.$strip>, "mutation">;
|
|
765
|
+
/**
|
|
766
|
+
* Reset one node's pipeline to its hardware-aware defaults — the HONEST
|
|
767
|
+
* reset (replaces the executor's legacy `resetToDefault`, which cleared a
|
|
768
|
+
* dead persisted step-tree seed nothing in the live path read):
|
|
769
|
+
* (a) strips every `modelId` pin from that node's
|
|
770
|
+
* `agentSettings.addonDefaults` (cells revert to Auto — the node
|
|
771
|
+
* resolves its own hardware-aware format default at runtime);
|
|
772
|
+
* (b) clears per-camera step overrides scoped to that node
|
|
773
|
+
* (`stepOverridesByAgent[node]` + the wholesale
|
|
774
|
+
* `pipelineByAgent[node]` escape hatch);
|
|
775
|
+
* (c) clears the executor-side per-device settings stores on that node
|
|
776
|
+
* (`pipelineExecutor.clearDeviceOverrides`);
|
|
777
|
+
* (d) hot-reloads every camera assigned to the node.
|
|
778
|
+
*
|
|
779
|
+
* Returns the EFFECTIVE post-reset object-detection model for the node
|
|
780
|
+
* (the executor's pure hardware-aware default) so the UI can report what
|
|
781
|
+
* will actually run — not a value that never reaches the live path.
|
|
782
|
+
*/
|
|
783
|
+
readonly resetNodePipelineDefaults: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
784
|
+
agentNodeId: z.ZodString;
|
|
785
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
786
|
+
success: z.ZodLiteral<true>;
|
|
787
|
+
effectiveModelId: z.ZodNullable<z.ZodString>;
|
|
788
|
+
clearedCameraOverrides: z.ZodNumber;
|
|
789
|
+
}, z.core.$strip>, "mutation">;
|
|
828
790
|
/** Read one camera's settings. Null when never touched (inherits agent defaults fully). */
|
|
829
791
|
readonly getCameraSettings: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
830
792
|
deviceId: z.ZodNumber;
|
|
@@ -1400,4 +1362,4 @@ export type CameraAudioStatus = z.infer<typeof CameraAudioStatusSchema>;
|
|
|
1400
1362
|
export type CameraRecordingStatus = z.infer<typeof CameraRecordingStatusSchema>;
|
|
1401
1363
|
export type CameraRecordingMode = z.infer<typeof CameraRecordingModeSchema>;
|
|
1402
1364
|
export type IngestOwner = z.infer<typeof IngestOwnerSchema>;
|
|
1403
|
-
export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraPipelineConfigSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CameraStepOverridePatchSchema, CapabilityBindingsSchema,
|
|
1365
|
+
export { AgentLoadSummarySchema, CameraAssignmentStatusSchema, CameraAudioStatusSchema, CameraBrokerProfileSchema, CameraBrokerStatusSchema, CameraDecoderShmSchema, CameraDecoderStatusSchema, CameraDetectionPhaseSchema, CameraDetectionProvisioningSchema, CameraDetectionProvisioningStateSchema, CameraDetectionStatusSchema, CameraMotionStatusSchema, CameraPipelineConfigSchema, CameraRecordingModeSchema, CameraRecordingStatusSchema, CameraSourceStatusSchema, CameraSourceStreamSchema, CameraStatusSchema, CameraStepOverridePatchSchema, CapabilityBindingsSchema, GlobalMetricsSchema, IngestOwnerSchema, PipelineAssignmentSchema, PipelineTemplateSchema as OrchestratorPipelineTemplateSchema, };
|
package/dist/device/index.d.ts
CHANGED
|
@@ -21,3 +21,5 @@ export { getByPath, setByPath } from './path-util.js';
|
|
|
21
21
|
export { applyTransform } from './device-link-transform.js';
|
|
22
22
|
export { enumerateItemArrayFields, enumerateSchemaFields } from './schema-fields.js';
|
|
23
23
|
export type { WireableField } from './schema-fields.js';
|
|
24
|
+
export { startReachabilityPoll, REACHABILITY_POLL_INTERVAL_MS, REACHABILITY_FAILURES_TO_OFFLINE, REACHABILITY_PROBE_TIMEOUT_MS, } from './reachability-poll.js';
|
|
25
|
+
export type { ReachabilityPollOptions, ReachabilityPollHandle, ReachabilityPollLogger, } from './reachability-poll.js';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared control-plane reachability poller for camera devices.
|
|
3
|
+
*
|
|
4
|
+
* `device.online` must reflect CONTROL-PLANE REACHABILITY — "can we talk to
|
|
5
|
+
* the camera's management API right now" — NOT whether video happens to be
|
|
6
|
+
* flowing through the stream broker. A camera that dials on-demand (no
|
|
7
|
+
* consumer attached) is fully reachable yet has no active stream; driving
|
|
8
|
+
* `online` from stream health falsely marks it OFFLINE.
|
|
9
|
+
*
|
|
10
|
+
* Every camera provider owns a cheap control-plane round-trip (Hikvision
|
|
11
|
+
* ISAPI `getDeviceInfo`, Amcrest Dahua CGI `getDeviceInfo`, ONVIF
|
|
12
|
+
* `getDeviceInformation`, RTSP `OPTIONS`/TCP-connect). Each provider passes
|
|
13
|
+
* that round-trip as a `probe: () => Promise<boolean>` and this helper runs
|
|
14
|
+
* the loop, applies hysteresis, and drives the device's `online` setter.
|
|
15
|
+
*
|
|
16
|
+
* Hysteresis rules (avoid flapping on a single dropped packet):
|
|
17
|
+
* - mark ONLINE immediately on the first successful probe;
|
|
18
|
+
* - mark OFFLINE only after {@link REACHABILITY_FAILURES_TO_OFFLINE}
|
|
19
|
+
* CONSECUTIVE failures.
|
|
20
|
+
*
|
|
21
|
+
* Robustness rules:
|
|
22
|
+
* - each probe is bounded by {@link REACHABILITY_PROBE_TIMEOUT_MS} so a hung
|
|
23
|
+
* control channel can't wedge the loop;
|
|
24
|
+
* - a single in-flight probe at a time — a slow probe never stacks up;
|
|
25
|
+
* - the loop never throws (a rejected/thrown probe counts as a failure);
|
|
26
|
+
* - `isEnabled()` gates each tick so a soft-disabled device isn't polled.
|
|
27
|
+
*/
|
|
28
|
+
/** Poll cadence — probe every camera's control plane on this interval. */
|
|
29
|
+
export declare const REACHABILITY_POLL_INTERVAL_MS = 30000;
|
|
30
|
+
/**
|
|
31
|
+
* Consecutive failures required before flipping `online` to `false`.
|
|
32
|
+
* ONLINE is asserted on the first success; OFFLINE waits for N misses so a
|
|
33
|
+
* single transient timeout doesn't flap the flag.
|
|
34
|
+
*/
|
|
35
|
+
export declare const REACHABILITY_FAILURES_TO_OFFLINE = 3;
|
|
36
|
+
/** Per-probe timeout — an unreachable/hung control channel resolves as a miss. */
|
|
37
|
+
export declare const REACHABILITY_PROBE_TIMEOUT_MS = 10000;
|
|
38
|
+
/**
|
|
39
|
+
* Minimal logger surface the poller uses. Declared with METHOD syntax
|
|
40
|
+
* (not a property arrow) so the parameter check is bivariant — a scoped
|
|
41
|
+
* logger whose `debug` takes a structured `LogExtras` second argument
|
|
42
|
+
* satisfies this without the caller having to import the logger types.
|
|
43
|
+
*/
|
|
44
|
+
export interface ReachabilityPollLogger {
|
|
45
|
+
debug(message: string, meta?: unknown): void;
|
|
46
|
+
}
|
|
47
|
+
export interface ReachabilityPollOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Control-plane round-trip. Resolve `true` when the camera is reachable,
|
|
50
|
+
* `false` (or throw/reject) when it is not. Never assume it resolves —
|
|
51
|
+
* the poller bounds it with a timeout regardless.
|
|
52
|
+
*/
|
|
53
|
+
readonly probe: () => Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Drives the device's online flag — typically `(v) => { device.online = v }`
|
|
56
|
+
* or `device.markOnline`. Called only on an actual transition decision
|
|
57
|
+
* (idempotent setters are fine; `markOnline` already no-ops on no-change).
|
|
58
|
+
*/
|
|
59
|
+
readonly setOnline: (online: boolean) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Gate for each tick. Return `false` to skip the probe entirely (e.g. a
|
|
62
|
+
* soft-disabled device, or a sleeping battery camera). Default: always on.
|
|
63
|
+
* A skipped tick does NOT count as a failure and leaves `online` untouched.
|
|
64
|
+
*/
|
|
65
|
+
readonly isEnabled?: () => boolean;
|
|
66
|
+
/** Override the 30s cadence (tests). */
|
|
67
|
+
readonly intervalMs?: number;
|
|
68
|
+
/** Override the 3-miss offline threshold (tests). */
|
|
69
|
+
readonly failuresToOffline?: number;
|
|
70
|
+
/** Override the 10s per-probe timeout (tests). */
|
|
71
|
+
readonly probeTimeoutMs?: number;
|
|
72
|
+
/** Optional scoped logger for probe-failure diagnostics. */
|
|
73
|
+
readonly logger?: ReachabilityPollLogger;
|
|
74
|
+
/**
|
|
75
|
+
* Run the first probe immediately instead of waiting one interval.
|
|
76
|
+
* Default `true` — a freshly-activated camera should reflect reachability
|
|
77
|
+
* without a 30s blind window.
|
|
78
|
+
*/
|
|
79
|
+
readonly runImmediately?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface ReachabilityPollHandle {
|
|
82
|
+
/** Stop the loop and release the timer. Idempotent. */
|
|
83
|
+
readonly stop: () => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Start the reachability poll loop. Returns a handle whose `stop()` clears the
|
|
87
|
+
* timer and prevents any further ticks. Start on device activation, stop on
|
|
88
|
+
* device teardown (`removeDevice`) so no timer leaks.
|
|
89
|
+
*/
|
|
90
|
+
export declare function startReachabilityPoll(options: ReachabilityPollOptions): ReachabilityPollHandle;
|