@camstack/sdk 0.1.26 → 0.1.27
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/package.json +1 -1
- package/dist/sdk/src/adaptive-stream.d.ts +0 -91
- package/dist/sdk/src/backend-client.d.ts +0 -315
- package/dist/sdk/src/backend-router.d.ts +0 -5
- package/dist/sdk/src/camera.d.ts +0 -37
- package/dist/sdk/src/detection.d.ts +0 -58
- package/dist/sdk/src/devices.d.ts +0 -147
- package/dist/sdk/src/features.d.ts +0 -31
- package/dist/sdk/src/index.d.ts +0 -15
- package/dist/sdk/src/nvr.d.ts +0 -285
- package/dist/sdk/src/timeline.d.ts +0 -177
- package/dist/sdk/src/types.d.ts +0 -44
- package/dist/types/src/catalogs/coco-classmap.d.ts +0 -4
- package/dist/types/src/constants.d.ts +0 -2
- package/dist/types/src/generated/addon-api.d.ts +0 -4947
- package/dist/types/src/index.d.ts +0 -81
- package/dist/types/src/interfaces/addon-i18n.d.ts +0 -40
- package/dist/types/src/interfaces/addon-routes.d.ts +0 -49
- package/dist/types/src/interfaces/addon.d.ts +0 -293
- package/dist/types/src/interfaces/advanced-notifier.d.ts +0 -58
- package/dist/types/src/interfaces/agent-protocol.d.ts +0 -188
- package/dist/types/src/interfaces/agent.d.ts +0 -86
- package/dist/types/src/interfaces/analysis-persistence.d.ts +0 -277
- package/dist/types/src/interfaces/analysis.d.ts +0 -26
- package/dist/types/src/interfaces/api-shared.d.ts +0 -175
- package/dist/types/src/interfaces/auth-provider.d.ts +0 -38
- package/dist/types/src/interfaces/auth.d.ts +0 -46
- package/dist/types/src/interfaces/camera-pipeline.d.ts +0 -120
- package/dist/types/src/interfaces/capability.d.ts +0 -83
- package/dist/types/src/interfaces/classifier.d.ts +0 -7
- package/dist/types/src/interfaces/config-ui.d.ts +0 -151
- package/dist/types/src/interfaces/context.d.ts +0 -43
- package/dist/types/src/interfaces/cropper.d.ts +0 -7
- package/dist/types/src/interfaces/decoder.d.ts +0 -26
- package/dist/types/src/interfaces/detection-addon.d.ts +0 -14
- package/dist/types/src/interfaces/detector.d.ts +0 -7
- package/dist/types/src/interfaces/device-capabilities/accessory.d.ts +0 -13
- package/dist/types/src/interfaces/device-capabilities/audio-detector.d.ts +0 -11
- package/dist/types/src/interfaces/device-capabilities/camera.d.ts +0 -21
- package/dist/types/src/interfaces/device-capabilities/doorbell.d.ts +0 -9
- package/dist/types/src/interfaces/device-capabilities/events.d.ts +0 -46
- package/dist/types/src/interfaces/device-capabilities/index.d.ts +0 -14
- package/dist/types/src/interfaces/device-capabilities/motion-sensor.d.ts +0 -6
- package/dist/types/src/interfaces/device-capabilities/native-detection.d.ts +0 -13
- package/dist/types/src/interfaces/device-capabilities/object-detector.d.ts +0 -58
- package/dist/types/src/interfaces/device-capabilities/pan-tilt-zoom.d.ts +0 -28
- package/dist/types/src/interfaces/device-capabilities/recording.d.ts +0 -17
- package/dist/types/src/interfaces/device-capabilities/siren.d.ts +0 -7
- package/dist/types/src/interfaces/device-capabilities/status-light.d.ts +0 -6
- package/dist/types/src/interfaces/device-capabilities/switch.d.ts +0 -7
- package/dist/types/src/interfaces/device-capabilities/two-way-audio.d.ts +0 -7
- package/dist/types/src/interfaces/device-capability.d.ts +0 -13
- package/dist/types/src/interfaces/device-provider.d.ts +0 -42
- package/dist/types/src/interfaces/device.d.ts +0 -39
- package/dist/types/src/interfaces/event-bus.d.ts +0 -21
- package/dist/types/src/interfaces/feature-flags.d.ts +0 -13
- package/dist/types/src/interfaces/ffmpeg.d.ts +0 -9
- package/dist/types/src/interfaces/inference-capabilities.d.ts +0 -100
- package/dist/types/src/interfaces/inference-engine.d.ts +0 -16
- package/dist/types/src/interfaces/lifecycle.d.ts +0 -18
- package/dist/types/src/interfaces/logging.d.ts +0 -32
- package/dist/types/src/interfaces/model-catalog.d.ts +0 -24
- package/dist/types/src/interfaces/network-quality.d.ts +0 -24
- package/dist/types/src/interfaces/network.d.ts +0 -42
- package/dist/types/src/interfaces/notification.d.ts +0 -52
- package/dist/types/src/interfaces/pipeline-runner.d.ts +0 -22
- package/dist/types/src/interfaces/pipeline-slot.d.ts +0 -9
- package/dist/types/src/interfaces/platform.d.ts +0 -54
- package/dist/types/src/interfaces/process.d.ts +0 -40
- package/dist/types/src/interfaces/python-env.d.ts +0 -19
- package/dist/types/src/interfaces/refiner.d.ts +0 -7
- package/dist/types/src/interfaces/repl.d.ts +0 -25
- package/dist/types/src/interfaces/repositories.d.ts +0 -19
- package/dist/types/src/interfaces/restreamer.d.ts +0 -23
- package/dist/types/src/interfaces/router.d.ts +0 -29
- package/dist/types/src/interfaces/scene-intelligence.d.ts +0 -20
- package/dist/types/src/interfaces/scoped-token.d.ts +0 -21
- package/dist/types/src/interfaces/server-analysis.d.ts +0 -145
- package/dist/types/src/interfaces/server-network.d.ts +0 -77
- package/dist/types/src/interfaces/storage-backend.d.ts +0 -26
- package/dist/types/src/interfaces/storage.d.ts +0 -173
- package/dist/types/src/interfaces/stream-broker.d.ts +0 -91
- package/dist/types/src/interfaces/streaming.d.ts +0 -28
- package/dist/types/src/interfaces/task-handler.d.ts +0 -45
- package/dist/types/src/interfaces/webrtc-provider.d.ts +0 -10
- package/dist/types/src/interfaces/worker-protocol.d.ts +0 -109
- package/dist/types/src/schemas/system-settings-schemas.d.ts +0 -26
- package/dist/types/src/types/analytics.d.ts +0 -74
- package/dist/types/src/types/benchmark.d.ts +0 -111
- package/dist/types/src/types/camera-detection.d.ts +0 -33
- package/dist/types/src/types/config.d.ts +0 -36
- package/dist/types/src/types/detection.d.ts +0 -92
- package/dist/types/src/types/device-type.d.ts +0 -9
- package/dist/types/src/types/entities.d.ts +0 -34
- package/dist/types/src/types/events.d.ts +0 -34
- package/dist/types/src/types/io.d.ts +0 -24
- package/dist/types/src/types/labels.d.ts +0 -11
- package/dist/types/src/types/live-state.d.ts +0 -46
- package/dist/types/src/types/models.d.ts +0 -78
- package/dist/types/src/types/pipeline-schema.d.ts +0 -77
- package/dist/types/src/types/pipeline.d.ts +0 -41
- package/dist/types/src/types/tracked.d.ts +0 -20
- package/dist/types/src/types/zones.d.ts +0 -47
- package/dist/types/src/utils/cosine-similarity.d.ts +0 -2
- package/dist/types/src/utils/hf-url.d.ts +0 -1
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API-shared types — types that originated in @camstack/core, @camstack/kernel,
|
|
3
|
-
* or server internals and are now canonical here so the generated API type file
|
|
4
|
-
* has zero external dependencies beyond @camstack/types.
|
|
5
|
-
*/
|
|
6
|
-
import type { ProviderStatus } from './device-provider.js';
|
|
7
|
-
import type { ElementStatus } from './lifecycle.js';
|
|
8
|
-
import type { CameraPriority, CameraPhase } from './stream-broker.js';
|
|
9
|
-
import type { AddonPageDeclaration } from './addon.js';
|
|
10
|
-
export interface BackupManifest {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly timestamp: number;
|
|
13
|
-
readonly label?: string;
|
|
14
|
-
readonly locations: readonly string[];
|
|
15
|
-
readonly sizeMB: number;
|
|
16
|
-
readonly path: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ProviderListItem {
|
|
19
|
-
id: string;
|
|
20
|
-
type: string;
|
|
21
|
-
name: string;
|
|
22
|
-
status: ProviderStatus;
|
|
23
|
-
started: boolean;
|
|
24
|
-
lifecycle: ElementStatus;
|
|
25
|
-
}
|
|
26
|
-
export interface InstalledPackage {
|
|
27
|
-
readonly name: string;
|
|
28
|
-
readonly version: string;
|
|
29
|
-
readonly dir: string;
|
|
30
|
-
readonly installSource?: 'npm' | 'workspace' | 'upload';
|
|
31
|
-
}
|
|
32
|
-
export interface PackageVersionInfo {
|
|
33
|
-
readonly version: string;
|
|
34
|
-
readonly publishedAt: string;
|
|
35
|
-
readonly deprecated?: string;
|
|
36
|
-
readonly distTags: readonly string[];
|
|
37
|
-
}
|
|
38
|
-
export type AutoUpdateChannel = 'off' | 'latest' | 'beta' | 'inherit';
|
|
39
|
-
/** A page declaration enriched with its source addon ID */
|
|
40
|
-
export interface AddonPageInfo {
|
|
41
|
-
readonly addonId: string;
|
|
42
|
-
readonly page: AddonPageDeclaration;
|
|
43
|
-
readonly bundleUrl: string;
|
|
44
|
-
}
|
|
45
|
-
export type BenchmarkPhase = 'init' | 'warmup' | 'running' | 'done';
|
|
46
|
-
export interface BenchmarkProgress {
|
|
47
|
-
readonly addonId: string;
|
|
48
|
-
readonly phase: BenchmarkPhase;
|
|
49
|
-
readonly elapsedSec: number;
|
|
50
|
-
readonly totalSec: number;
|
|
51
|
-
readonly warmupFrame: number;
|
|
52
|
-
readonly warmupTotal: number;
|
|
53
|
-
readonly framesProcessed: number;
|
|
54
|
-
readonly totalDetections: number;
|
|
55
|
-
readonly objectsFound: number;
|
|
56
|
-
readonly errorCount: number;
|
|
57
|
-
readonly simulatedCameras: number;
|
|
58
|
-
readonly batchSize: number;
|
|
59
|
-
readonly currentDps: number;
|
|
60
|
-
readonly currentFps: number;
|
|
61
|
-
readonly recentAvgMs: number;
|
|
62
|
-
readonly inferenceMs: number;
|
|
63
|
-
}
|
|
64
|
-
export interface BenchmarkResult {
|
|
65
|
-
readonly addonId: string;
|
|
66
|
-
readonly addonName: string;
|
|
67
|
-
readonly referenceImage: string;
|
|
68
|
-
readonly runtime: string;
|
|
69
|
-
readonly iterations: number;
|
|
70
|
-
readonly durationSec: number;
|
|
71
|
-
readonly warmup: number;
|
|
72
|
-
readonly inputResolution: string;
|
|
73
|
-
readonly dps: number;
|
|
74
|
-
readonly totalDetections: number;
|
|
75
|
-
readonly objectsFound: number;
|
|
76
|
-
readonly avgDetectionsPerFrame: number;
|
|
77
|
-
readonly inferenceAvgMs: number;
|
|
78
|
-
readonly inferenceP50Ms: number;
|
|
79
|
-
readonly inferenceP95Ms: number;
|
|
80
|
-
readonly inferenceP99Ms: number;
|
|
81
|
-
readonly fps: number;
|
|
82
|
-
readonly avgMs: number;
|
|
83
|
-
readonly p50Ms: number;
|
|
84
|
-
readonly p95Ms: number;
|
|
85
|
-
readonly p99Ms: number;
|
|
86
|
-
readonly minMs: number;
|
|
87
|
-
readonly maxMs: number;
|
|
88
|
-
readonly peakMemoryMB: number;
|
|
89
|
-
readonly errorCount: number;
|
|
90
|
-
readonly successCount: number;
|
|
91
|
-
readonly modelId: string;
|
|
92
|
-
readonly simulatedCameras: number;
|
|
93
|
-
readonly batchSize: number;
|
|
94
|
-
}
|
|
95
|
-
export interface HistoryEntry {
|
|
96
|
-
readonly id: string;
|
|
97
|
-
readonly date: string;
|
|
98
|
-
readonly agentName: string;
|
|
99
|
-
readonly addonId: string;
|
|
100
|
-
readonly modelName: string;
|
|
101
|
-
readonly runtime: string;
|
|
102
|
-
readonly dps: number;
|
|
103
|
-
readonly inferenceAvgMs: number;
|
|
104
|
-
readonly totalDetections: number;
|
|
105
|
-
readonly fps: number;
|
|
106
|
-
readonly avgMs: number;
|
|
107
|
-
readonly p50Ms: number;
|
|
108
|
-
readonly p95Ms: number;
|
|
109
|
-
readonly p99Ms: number;
|
|
110
|
-
readonly minMs: number;
|
|
111
|
-
readonly maxMs: number;
|
|
112
|
-
readonly peakMemoryMB: number;
|
|
113
|
-
readonly iterations: number;
|
|
114
|
-
readonly warmup: number;
|
|
115
|
-
readonly inputResolution: string;
|
|
116
|
-
readonly simulatedCameras?: number;
|
|
117
|
-
readonly batchSize?: number;
|
|
118
|
-
readonly errorCount?: number;
|
|
119
|
-
}
|
|
120
|
-
export interface PipelineProgressEvent {
|
|
121
|
-
readonly step: 'loading-engine' | 'inferring' | 'complete';
|
|
122
|
-
readonly addonId: string;
|
|
123
|
-
readonly modelId: string;
|
|
124
|
-
readonly ms?: number;
|
|
125
|
-
readonly message?: string;
|
|
126
|
-
}
|
|
127
|
-
export interface OrchestratorMetrics {
|
|
128
|
-
readonly activeCameras: number;
|
|
129
|
-
readonly throttledCameras: number;
|
|
130
|
-
readonly avgInferenceTimeMs: number;
|
|
131
|
-
readonly queueDepth: number;
|
|
132
|
-
}
|
|
133
|
-
export interface CameraMetrics {
|
|
134
|
-
readonly priority: CameraPriority;
|
|
135
|
-
readonly configuredFps: number;
|
|
136
|
-
readonly actualFps: number;
|
|
137
|
-
readonly queueDepth: number;
|
|
138
|
-
readonly avgInferenceTimeMs: number;
|
|
139
|
-
readonly droppedFrames: number;
|
|
140
|
-
readonly phase: CameraPhase;
|
|
141
|
-
}
|
|
142
|
-
export interface PackageUpdate {
|
|
143
|
-
readonly name: string;
|
|
144
|
-
readonly currentVersion: string;
|
|
145
|
-
readonly latestVersion: string;
|
|
146
|
-
readonly category: 'addon' | 'core';
|
|
147
|
-
readonly requiresRestart: boolean;
|
|
148
|
-
}
|
|
149
|
-
export interface UpdateResult {
|
|
150
|
-
readonly success: boolean;
|
|
151
|
-
readonly version: string;
|
|
152
|
-
readonly requiresRestart: boolean;
|
|
153
|
-
readonly error?: string;
|
|
154
|
-
}
|
|
155
|
-
export interface DetectorDetails {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
models: Array<{
|
|
159
|
-
id: string;
|
|
160
|
-
name: string;
|
|
161
|
-
inputSize?: {
|
|
162
|
-
width: number;
|
|
163
|
-
height: number;
|
|
164
|
-
};
|
|
165
|
-
}>;
|
|
166
|
-
runtimes: Array<{
|
|
167
|
-
value: string;
|
|
168
|
-
label: string;
|
|
169
|
-
}>;
|
|
170
|
-
backends: Array<{
|
|
171
|
-
value: string;
|
|
172
|
-
label: string;
|
|
173
|
-
}>;
|
|
174
|
-
defaultConfig: Record<string, unknown> | null;
|
|
175
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result returned by an auth provider after successful authentication.
|
|
3
|
-
*/
|
|
4
|
-
export interface AuthResult {
|
|
5
|
-
readonly externalId: string;
|
|
6
|
-
readonly username: string;
|
|
7
|
-
readonly email?: string;
|
|
8
|
-
readonly displayName?: string;
|
|
9
|
-
readonly avatarUrl?: string;
|
|
10
|
-
readonly groups?: string[];
|
|
11
|
-
readonly rawProfile?: unknown;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Pluggable authentication provider.
|
|
15
|
-
* Each addon can register one or more auth providers (collection capability).
|
|
16
|
-
*/
|
|
17
|
-
export interface IAuthProvider {
|
|
18
|
-
readonly id: string;
|
|
19
|
-
readonly name: string;
|
|
20
|
-
readonly icon: string;
|
|
21
|
-
/** Type of auth flow */
|
|
22
|
-
readonly flowType: 'credentials' | 'redirect' | 'token';
|
|
23
|
-
/**
|
|
24
|
-
* For 'credentials' flow: validate username/password, return user info.
|
|
25
|
-
*/
|
|
26
|
-
validateCredentials?(username: string, password: string): Promise<AuthResult | null>;
|
|
27
|
-
/**
|
|
28
|
-
* For 'redirect' flow (OIDC, OAuth2):
|
|
29
|
-
* getLoginUrl() returns the URL to redirect the user to.
|
|
30
|
-
* handleCallback() processes the callback and returns user info.
|
|
31
|
-
*/
|
|
32
|
-
getLoginUrl?(state: string): string;
|
|
33
|
-
handleCallback?(params: Record<string, string>): Promise<AuthResult>;
|
|
34
|
-
/**
|
|
35
|
-
* For 'token' flow: validate an external token (e.g., from mobile app).
|
|
36
|
-
*/
|
|
37
|
-
validateToken?(token: string): Promise<AuthResult | null>;
|
|
38
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export type UserRole = 'super_admin' | 'admin' | 'viewer' | 'agent';
|
|
2
|
-
export interface UserPermissions {
|
|
3
|
-
role: UserRole;
|
|
4
|
-
allowedProviders: string[] | '*';
|
|
5
|
-
allowedDevices: Record<string, string[] | '*'>;
|
|
6
|
-
}
|
|
7
|
-
export interface UserRecord {
|
|
8
|
-
id: string;
|
|
9
|
-
username: string;
|
|
10
|
-
passwordHash: string;
|
|
11
|
-
role: UserRole;
|
|
12
|
-
allowedProviders: string[] | '*';
|
|
13
|
-
allowedDevices: Record<string, string[] | '*'>;
|
|
14
|
-
createdAt: number;
|
|
15
|
-
updatedAt: number;
|
|
16
|
-
}
|
|
17
|
-
export interface ApiKeyRecord {
|
|
18
|
-
id: string;
|
|
19
|
-
label: string;
|
|
20
|
-
role: UserRole;
|
|
21
|
-
allowedProviders: string[] | '*';
|
|
22
|
-
allowedDevices: Record<string, string[] | '*'>;
|
|
23
|
-
tokenHash: string;
|
|
24
|
-
tokenPrefix: string;
|
|
25
|
-
createdAt: number;
|
|
26
|
-
lastUsedAt?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface TokenPayload {
|
|
29
|
-
type?: 'api_key' | 'service';
|
|
30
|
-
keyId?: string;
|
|
31
|
-
userId?: string;
|
|
32
|
-
username?: string;
|
|
33
|
-
role: UserRole;
|
|
34
|
-
agentId?: string;
|
|
35
|
-
allowedProviders: string[] | '*';
|
|
36
|
-
allowedDevices: Record<string, string[] | '*'>;
|
|
37
|
-
iat?: number;
|
|
38
|
-
exp?: number;
|
|
39
|
-
}
|
|
40
|
-
export interface AuthenticatedUser {
|
|
41
|
-
id: string;
|
|
42
|
-
username: string;
|
|
43
|
-
role: UserRole;
|
|
44
|
-
permissions: UserPermissions;
|
|
45
|
-
isApiKey: boolean;
|
|
46
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Camera Analysis Pipeline -- unified stream processing.
|
|
3
|
-
*/
|
|
4
|
-
export interface IStreamSourceAdapter {
|
|
5
|
-
protocol: string;
|
|
6
|
-
connect(config: Record<string, unknown>): Promise<NormalizedSource>;
|
|
7
|
-
disconnect(): Promise<void>;
|
|
8
|
-
getStatus(): SourceAdapterStatus;
|
|
9
|
-
}
|
|
10
|
-
export interface NormalizedSource {
|
|
11
|
-
type: 'url' | 'pipe';
|
|
12
|
-
url?: string;
|
|
13
|
-
pipe?: NodeJS.ReadableStream;
|
|
14
|
-
capabilities: SourceCapabilities;
|
|
15
|
-
}
|
|
16
|
-
export interface SourceCapabilities {
|
|
17
|
-
hasVideo: boolean;
|
|
18
|
-
hasAudio: boolean;
|
|
19
|
-
videoCodec?: 'h264' | 'h265' | 'mjpeg' | 'vp8' | 'vp9' | 'av1';
|
|
20
|
-
audioCodec?: 'aac' | 'opus' | 'pcm' | 'g711';
|
|
21
|
-
width?: number;
|
|
22
|
-
height?: number;
|
|
23
|
-
fps?: number;
|
|
24
|
-
sampleRate?: number;
|
|
25
|
-
audioChannels?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface SourceAdapterStatus {
|
|
28
|
-
connected: boolean;
|
|
29
|
-
protocol: string;
|
|
30
|
-
error?: string;
|
|
31
|
-
bytesReceived?: number;
|
|
32
|
-
connectedSince?: number;
|
|
33
|
-
}
|
|
34
|
-
export interface VideoFrame {
|
|
35
|
-
data: Buffer;
|
|
36
|
-
format: 'jpeg' | 'raw-yuv420' | 'raw-rgb' | 'h264-nal';
|
|
37
|
-
width: number;
|
|
38
|
-
height: number;
|
|
39
|
-
pts: number;
|
|
40
|
-
timestamp: number;
|
|
41
|
-
keyframe?: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface AudioChunk {
|
|
44
|
-
data: Buffer;
|
|
45
|
-
format: 'pcm-s16le' | 'pcm-f32le' | 'aac' | 'opus';
|
|
46
|
-
sampleRate: number;
|
|
47
|
-
channels: number;
|
|
48
|
-
pts: number;
|
|
49
|
-
timestamp: number;
|
|
50
|
-
dBFS?: number;
|
|
51
|
-
}
|
|
52
|
-
export interface ICameraPipeline {
|
|
53
|
-
readonly deviceId: string;
|
|
54
|
-
readonly active: boolean;
|
|
55
|
-
start(): Promise<void>;
|
|
56
|
-
stop(): Promise<void>;
|
|
57
|
-
onVideoFrame(callback: VideoFrameCallback, options?: FrameSubscriptionOptions): () => void;
|
|
58
|
-
getLatestFrame(): VideoFrame | null;
|
|
59
|
-
onAudioChunk(callback: AudioChunkCallback): () => void;
|
|
60
|
-
getAudioLevel(): number;
|
|
61
|
-
getOutputStream(format: PipelineOutputFormat): PipelineOutputStream | null;
|
|
62
|
-
getAvailableOutputs(): PipelineOutputFormat[];
|
|
63
|
-
getStatus(): PipelineStatusInfo;
|
|
64
|
-
}
|
|
65
|
-
export type VideoFrameCallback = (frame: VideoFrame) => void;
|
|
66
|
-
export type AudioChunkCallback = (chunk: AudioChunk) => void;
|
|
67
|
-
export interface FrameSubscriptionOptions {
|
|
68
|
-
maxFps?: number;
|
|
69
|
-
format?: 'jpeg' | 'raw-yuv420' | 'raw-rgb';
|
|
70
|
-
maxWidth?: number;
|
|
71
|
-
maxHeight?: number;
|
|
72
|
-
keyframeOnly?: boolean;
|
|
73
|
-
}
|
|
74
|
-
export type PipelineOutputFormat = 'webrtc' | 'hls' | 'mjpeg' | 'rtsp' | 'raw-h264';
|
|
75
|
-
export interface PipelineOutputStream {
|
|
76
|
-
format: PipelineOutputFormat;
|
|
77
|
-
url?: string;
|
|
78
|
-
createOffer?(): Promise<string>;
|
|
79
|
-
handleAnswer?(sdp: string): Promise<void>;
|
|
80
|
-
pipe?: NodeJS.ReadableStream;
|
|
81
|
-
consumerCount: number;
|
|
82
|
-
}
|
|
83
|
-
export interface PipelineStatusInfo {
|
|
84
|
-
active: boolean;
|
|
85
|
-
source: {
|
|
86
|
-
protocol: string;
|
|
87
|
-
connected: boolean;
|
|
88
|
-
capabilities: SourceCapabilities;
|
|
89
|
-
} | null;
|
|
90
|
-
decode: {
|
|
91
|
-
fps: number;
|
|
92
|
-
droppedFrames: number;
|
|
93
|
-
totalFrames: number;
|
|
94
|
-
};
|
|
95
|
-
videoConsumers: number;
|
|
96
|
-
audioConsumers: number;
|
|
97
|
-
outputs: Array<{
|
|
98
|
-
format: PipelineOutputFormat;
|
|
99
|
-
consumers: number;
|
|
100
|
-
active: boolean;
|
|
101
|
-
}>;
|
|
102
|
-
uptime: number;
|
|
103
|
-
}
|
|
104
|
-
export interface IPipelineManager {
|
|
105
|
-
getPipeline(deviceId: string): ICameraPipeline | null;
|
|
106
|
-
createPipeline(deviceId: string, source: NormalizedSource): ICameraPipeline;
|
|
107
|
-
destroyPipeline(deviceId: string): Promise<void>;
|
|
108
|
-
listPipelines(): Array<{
|
|
109
|
-
deviceId: string;
|
|
110
|
-
status: PipelineStatusInfo;
|
|
111
|
-
}>;
|
|
112
|
-
}
|
|
113
|
-
export interface IPipelineConsumer {
|
|
114
|
-
id: string;
|
|
115
|
-
name: string;
|
|
116
|
-
videoRequirements?: FrameSubscriptionOptions;
|
|
117
|
-
needsAudio: boolean;
|
|
118
|
-
attachToPipeline(pipeline: ICameraPipeline, deviceId: string): void;
|
|
119
|
-
detachFromPipeline(deviceId: string): void;
|
|
120
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { IStorageProvider } from './storage.js';
|
|
2
|
-
import type { ILogDestination } from './logging.js';
|
|
3
|
-
import type { IAnalysisAddon } from './analysis.js';
|
|
4
|
-
import type { IAddonPageProvider, IAdminUI } from './addon.js';
|
|
5
|
-
import type { IAuthProvider } from './auth-provider.js';
|
|
6
|
-
import type { INotificationOutput } from './notification.js';
|
|
7
|
-
import type { IAddonRouteProvider } from './addon-routes.js';
|
|
8
|
-
import type { IAnalysisDataPersistence } from './analysis-persistence.js';
|
|
9
|
-
import type { ISceneIntelligence } from './scene-intelligence.js';
|
|
10
|
-
import type { IAdvancedNotifier } from './advanced-notifier.js';
|
|
11
|
-
/**
|
|
12
|
-
* Whether a capability allows one active provider (singleton) or many (collection).
|
|
13
|
-
*/
|
|
14
|
-
export type CapabilityMode = 'singleton' | 'collection';
|
|
15
|
-
/**
|
|
16
|
-
* Declared in addon package.json manifests under camstack.addons[].capabilities.
|
|
17
|
-
*/
|
|
18
|
-
export interface CapabilityDeclaration {
|
|
19
|
-
/** Capability name (e.g. 'storage', 'decoder', 'analysis-pipeline') */
|
|
20
|
-
readonly name: string;
|
|
21
|
-
/** singleton: one active at a time. collection: all active in parallel. */
|
|
22
|
-
readonly mode: CapabilityMode;
|
|
23
|
-
/** Optional dependencies — addon won't initialize until these capabilities are available */
|
|
24
|
-
readonly dependsOn?: readonly string[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Registration object for a service that consumes a capability.
|
|
28
|
-
* The registry calls the appropriate callback when providers are added/removed/replaced.
|
|
29
|
-
*/
|
|
30
|
-
export interface CapabilityConsumerRegistration<T = unknown> {
|
|
31
|
-
/** Which capability this consumer needs */
|
|
32
|
-
readonly capability: string;
|
|
33
|
-
/** Called when a singleton provider is set or replaced. Async for teardown of previous. */
|
|
34
|
-
onSet?(provider: T): void | Promise<void>;
|
|
35
|
-
/** Called when a collection provider is added */
|
|
36
|
-
onAdded?(provider: T): void | Promise<void>;
|
|
37
|
-
/** Called when a collection provider is removed (addon disabled) */
|
|
38
|
-
onRemoved?(provider: T): void | Promise<void>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Introspection data for a registered capability.
|
|
42
|
-
*/
|
|
43
|
-
export interface CapabilityInfo {
|
|
44
|
-
readonly name: string;
|
|
45
|
-
readonly mode: CapabilityMode;
|
|
46
|
-
/** All addon IDs that provide this capability */
|
|
47
|
-
readonly providers: readonly string[];
|
|
48
|
-
/** For singleton: the active addon ID (null if none) */
|
|
49
|
-
readonly activeProvider: string | null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Maps capability names to their provider interfaces.
|
|
53
|
-
* Extensible via TypeScript declaration merging:
|
|
54
|
-
*
|
|
55
|
-
* ```typescript
|
|
56
|
-
* declare module '@camstack/types' {
|
|
57
|
-
* interface CapabilityProviderMap {
|
|
58
|
-
* 'my-custom-capability': IMyProvider
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export interface CapabilityProviderMap {
|
|
64
|
-
'storage': IStorageProvider;
|
|
65
|
-
'log-destination': ILogDestination;
|
|
66
|
-
'analysis-pipeline': IAnalysisAddon;
|
|
67
|
-
'restreamer': unknown;
|
|
68
|
-
'webrtc': unknown;
|
|
69
|
-
'stream-broker': unknown;
|
|
70
|
-
'addon-pages': IAddonPageProvider;
|
|
71
|
-
'admin-ui': IAdminUI;
|
|
72
|
-
'auth-provider': IAuthProvider;
|
|
73
|
-
'notification-output': INotificationOutput;
|
|
74
|
-
'addon-routes': IAddonRouteProvider;
|
|
75
|
-
'recording-engine': unknown;
|
|
76
|
-
'analysis-data-persistence': IAnalysisDataPersistence;
|
|
77
|
-
'device-provider': unknown;
|
|
78
|
-
'network-access': unknown;
|
|
79
|
-
'streaming-engine': unknown;
|
|
80
|
-
'scene-intelligence': ISceneIntelligence;
|
|
81
|
-
'advanced-notifier': IAdvancedNotifier;
|
|
82
|
-
[key: string]: unknown;
|
|
83
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IPipelineSlotProvider } from './pipeline-slot.js';
|
|
2
|
-
import type { CropInput } from '../types/detection.js';
|
|
3
|
-
import type { ClassifierOutput } from '../types/detection.js';
|
|
4
|
-
export interface IClassifierProvider extends IPipelineSlotProvider {
|
|
5
|
-
readonly slot: 'classifier';
|
|
6
|
-
classify(input: CropInput): Promise<ClassifierOutput>;
|
|
7
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import type { ModelCatalogEntry, ModelFormat, ModelOutputFormat, CustomModelMetadata } from '../types/models.js';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration UI Schema -- declarative form definition for any element.
|
|
4
|
-
*
|
|
5
|
-
* Used by addons, providers, and devices to declare their settings UI.
|
|
6
|
-
* The admin UI renders these schemas as responsive forms.
|
|
7
|
-
*/
|
|
8
|
-
export interface ConfigUISchema {
|
|
9
|
-
sections: ConfigSection[];
|
|
10
|
-
}
|
|
11
|
-
export interface ConfigSection {
|
|
12
|
-
id: string;
|
|
13
|
-
title: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
style?: 'card' | 'accordion';
|
|
16
|
-
defaultCollapsed?: boolean;
|
|
17
|
-
columns?: 1 | 2 | 3 | 4;
|
|
18
|
-
fields: ConfigField[];
|
|
19
|
-
}
|
|
20
|
-
export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigColorField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigGroupField | ConfigSeparatorField | ConfigInfoField | ConfigModelSelectorField | ConfigStorageLocationField;
|
|
21
|
-
export interface ConfigFieldBase {
|
|
22
|
-
key: string;
|
|
23
|
-
label: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
required?: boolean;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
placeholder?: string;
|
|
28
|
-
span?: 1 | 2 | 3 | 4;
|
|
29
|
-
showWhen?: ConfigCondition;
|
|
30
|
-
}
|
|
31
|
-
export interface ConfigCondition {
|
|
32
|
-
field: string;
|
|
33
|
-
equals?: unknown;
|
|
34
|
-
notEquals?: unknown;
|
|
35
|
-
in?: unknown[];
|
|
36
|
-
notIn?: unknown[];
|
|
37
|
-
}
|
|
38
|
-
export interface ConfigTextField extends ConfigFieldBase {
|
|
39
|
-
type: 'text';
|
|
40
|
-
maxLength?: number;
|
|
41
|
-
pattern?: string;
|
|
42
|
-
inputType?: 'text' | 'url' | 'email';
|
|
43
|
-
}
|
|
44
|
-
export interface ConfigNumberField extends ConfigFieldBase {
|
|
45
|
-
type: 'number';
|
|
46
|
-
min?: number;
|
|
47
|
-
max?: number;
|
|
48
|
-
step?: number;
|
|
49
|
-
unit?: string;
|
|
50
|
-
}
|
|
51
|
-
export interface ConfigBooleanField extends ConfigFieldBase {
|
|
52
|
-
type: 'boolean';
|
|
53
|
-
style?: 'switch' | 'checkbox';
|
|
54
|
-
}
|
|
55
|
-
export interface ConfigSelectField extends ConfigFieldBase {
|
|
56
|
-
type: 'select';
|
|
57
|
-
options: ConfigOption[];
|
|
58
|
-
dependsOn?: Record<string, unknown>;
|
|
59
|
-
}
|
|
60
|
-
export interface ConfigMultiSelectField extends ConfigFieldBase {
|
|
61
|
-
type: 'multiselect';
|
|
62
|
-
options: ConfigOption[];
|
|
63
|
-
maxItems?: number;
|
|
64
|
-
}
|
|
65
|
-
export interface ConfigColorField extends ConfigFieldBase {
|
|
66
|
-
type: 'color';
|
|
67
|
-
presets?: string[];
|
|
68
|
-
}
|
|
69
|
-
export interface ConfigPasswordField extends ConfigFieldBase {
|
|
70
|
-
type: 'password';
|
|
71
|
-
showToggle?: boolean;
|
|
72
|
-
}
|
|
73
|
-
export interface ConfigTextAreaField extends ConfigFieldBase {
|
|
74
|
-
type: 'textarea';
|
|
75
|
-
rows?: number;
|
|
76
|
-
maxLength?: number;
|
|
77
|
-
}
|
|
78
|
-
export interface ConfigSliderField extends ConfigFieldBase {
|
|
79
|
-
type: 'slider';
|
|
80
|
-
min: number;
|
|
81
|
-
max: number;
|
|
82
|
-
step?: number;
|
|
83
|
-
showValue?: boolean;
|
|
84
|
-
unit?: string;
|
|
85
|
-
default?: number;
|
|
86
|
-
}
|
|
87
|
-
export interface ConfigTagsField extends ConfigFieldBase {
|
|
88
|
-
type: 'tags';
|
|
89
|
-
suggestions?: string[];
|
|
90
|
-
maxTags?: number;
|
|
91
|
-
}
|
|
92
|
-
export interface ConfigGroupField extends ConfigFieldBase {
|
|
93
|
-
type: 'group';
|
|
94
|
-
fields: ConfigField[];
|
|
95
|
-
style?: 'card' | 'inline' | 'accordion';
|
|
96
|
-
defaultCollapsed?: boolean;
|
|
97
|
-
}
|
|
98
|
-
/** Visual separator between fields */
|
|
99
|
-
export interface ConfigSeparatorField {
|
|
100
|
-
type: 'separator';
|
|
101
|
-
key: string;
|
|
102
|
-
}
|
|
103
|
-
/** Read-only informational text */
|
|
104
|
-
export interface ConfigInfoField {
|
|
105
|
-
type: 'info';
|
|
106
|
-
key: string;
|
|
107
|
-
label: string;
|
|
108
|
-
content: string;
|
|
109
|
-
variant?: 'info' | 'warning' | 'success' | 'danger';
|
|
110
|
-
}
|
|
111
|
-
export interface ConfigOption {
|
|
112
|
-
value: string;
|
|
113
|
-
label: string;
|
|
114
|
-
description?: string;
|
|
115
|
-
icon?: string;
|
|
116
|
-
}
|
|
117
|
-
export interface ConfigModelSelectorField extends ConfigFieldBase {
|
|
118
|
-
type: 'model-selector';
|
|
119
|
-
/** Filter models by type */
|
|
120
|
-
modelType?: string;
|
|
121
|
-
/** Allow user to enter a custom local path or URL (default: true) */
|
|
122
|
-
allowCustomPath?: boolean;
|
|
123
|
-
/** Allow file upload via UI (default: true) */
|
|
124
|
-
allowUpload?: boolean;
|
|
125
|
-
/** Accepted file extensions for upload (default: ['.onnx']) */
|
|
126
|
-
acceptExtensions?: string[];
|
|
127
|
-
/** URL to model conversion documentation/guide */
|
|
128
|
-
conversionGuideUrl?: string;
|
|
129
|
-
/** Brief text explaining what models are compatible */
|
|
130
|
-
compatibilityNote?: string;
|
|
131
|
-
/** Legacy: inline catalog entries */
|
|
132
|
-
catalog?: readonly ModelCatalogEntry[];
|
|
133
|
-
allowCustom?: boolean;
|
|
134
|
-
acceptFormats?: readonly ModelFormat[];
|
|
135
|
-
allowConversion?: boolean;
|
|
136
|
-
requiredMetadata?: readonly (keyof CustomModelMetadata)[];
|
|
137
|
-
outputFormatHint?: ModelOutputFormat;
|
|
138
|
-
}
|
|
139
|
-
import type { StorageLocationType } from './storage.js';
|
|
140
|
-
export interface ConfigStorageLocationField extends ConfigFieldBase {
|
|
141
|
-
type: 'storage-location';
|
|
142
|
-
/** Which location type this field selects a provider for */
|
|
143
|
-
locationType: StorageLocationType;
|
|
144
|
-
/** Show available space indicator next to each provider option */
|
|
145
|
-
showAvailableSpace?: boolean;
|
|
146
|
-
}
|
|
147
|
-
export interface IConfigurable {
|
|
148
|
-
getConfigSchema(): ConfigUISchema;
|
|
149
|
-
getConfig(): Record<string, unknown>;
|
|
150
|
-
onConfigChange(config: Record<string, unknown>): Promise<void>;
|
|
151
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { IScopedLogger } from './logging.js';
|
|
2
|
-
import type { IEventBus } from './event-bus.js';
|
|
3
|
-
import type { IStorageLocation } from './storage.js';
|
|
4
|
-
/**
|
|
5
|
-
* CamstackContext -- injected into every provider, device, and addon.
|
|
6
|
-
*
|
|
7
|
-
* Each element receives a context scoped to its identity:
|
|
8
|
-
* - logger is pre-scoped: (Frigate)[FrontDoor] for a device, (Frigate) for a provider
|
|
9
|
-
* - storage is namespaced: all reads/writes are relative to this element's ID
|
|
10
|
-
* - eventBus is shared (system-wide) but the source is pre-filled
|
|
11
|
-
* - config provides read/write access to this element's persisted configuration
|
|
12
|
-
*
|
|
13
|
-
* The `id` is an immutable progressive identifier assigned at creation time.
|
|
14
|
-
* It never changes even if the element is renamed.
|
|
15
|
-
*/
|
|
16
|
-
export interface CamstackContext {
|
|
17
|
-
/** Immutable progressive ID of this element (e.g., 'provider:frigate-1', 'device:frigate-1/front-door') */
|
|
18
|
-
readonly id: string;
|
|
19
|
-
/** Pre-scoped logger -- logs automatically include this element's scope chain */
|
|
20
|
-
readonly logger: IScopedLogger;
|
|
21
|
-
/** Event bus -- shared system-wide, use for emitting and subscribing to events */
|
|
22
|
-
readonly eventBus: IEventBus;
|
|
23
|
-
/** Storage scoped to this element -- all paths are relative to this element's namespace */
|
|
24
|
-
readonly storage: IStorageLocation;
|
|
25
|
-
/** Persisted configuration for this element -- read/write/subscribe to changes */
|
|
26
|
-
readonly config: IElementConfig;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Scoped configuration store for an element.
|
|
30
|
-
* Values are persisted in the element's storage namespace.
|
|
31
|
-
*/
|
|
32
|
-
export interface IElementConfig {
|
|
33
|
-
/** Get the full config object */
|
|
34
|
-
getAll(): Record<string, unknown>;
|
|
35
|
-
/** Get a single value by dot-path (e.g., 'mqtt.brokerUrl') */
|
|
36
|
-
get<T = unknown>(key: string): T | undefined;
|
|
37
|
-
/** Set a single value */
|
|
38
|
-
set(key: string, value: unknown): Promise<void>;
|
|
39
|
-
/** Set the entire config object (merge or replace) */
|
|
40
|
-
setAll(config: Record<string, unknown>): Promise<void>;
|
|
41
|
-
/** Subscribe to config changes -- callback receives the new full config */
|
|
42
|
-
onChange(callback: (config: Record<string, unknown>) => void): () => void;
|
|
43
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IPipelineSlotProvider } from './pipeline-slot.js';
|
|
2
|
-
import type { CropInput } from '../types/detection.js';
|
|
3
|
-
import type { CropperOutput } from '../types/detection.js';
|
|
4
|
-
export interface ICropperProvider extends IPipelineSlotProvider {
|
|
5
|
-
readonly slot: 'cropper';
|
|
6
|
-
crop(input: CropInput): Promise<CropperOutput>;
|
|
7
|
-
}
|