@camstack/types 0.1.2 → 0.1.3
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/__tests__/addon-capability-provider.test.d.ts +2 -0
- package/dist/__tests__/addon-capability-provider.test.d.ts.map +1 -0
- package/dist/__tests__/addon-declaration.test.d.ts +2 -0
- package/dist/__tests__/addon-declaration.test.d.ts.map +1 -0
- package/dist/__tests__/capability.test.d.ts +2 -0
- package/dist/__tests__/capability.test.d.ts.map +1 -0
- package/dist/catalogs/coco-classmap.d.ts +5 -0
- package/dist/catalogs/coco-classmap.d.ts.map +1 -0
- package/dist/catalogs/index.d.ts +2 -0
- package/dist/catalogs/index.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/generated/addon-api.d.ts +4870 -0
- package/dist/generated/addon-api.d.ts.map +1 -0
- package/dist/index.d.ts +82 -6702
- package/dist/index.d.ts.map +1 -0
- package/dist/interfaces/addon-i18n.d.ts +41 -0
- package/dist/interfaces/addon-i18n.d.ts.map +1 -0
- package/dist/interfaces/addon-routes.d.ts +50 -0
- package/dist/interfaces/addon-routes.d.ts.map +1 -0
- package/dist/interfaces/addon.d.ts +294 -0
- package/dist/interfaces/addon.d.ts.map +1 -0
- package/dist/interfaces/advanced-notifier.d.ts +59 -0
- package/dist/interfaces/advanced-notifier.d.ts.map +1 -0
- package/dist/interfaces/agent-protocol.d.ts +189 -0
- package/dist/interfaces/agent-protocol.d.ts.map +1 -0
- package/dist/interfaces/agent.d.ts +87 -0
- package/dist/interfaces/agent.d.ts.map +1 -0
- package/dist/interfaces/analysis-persistence.d.ts +278 -0
- package/dist/interfaces/analysis-persistence.d.ts.map +1 -0
- package/dist/interfaces/analysis.d.ts +27 -0
- package/dist/interfaces/analysis.d.ts.map +1 -0
- package/dist/interfaces/api-shared.d.ts +168 -0
- package/dist/interfaces/api-shared.d.ts.map +1 -0
- package/dist/interfaces/auth-provider.d.ts +39 -0
- package/dist/interfaces/auth-provider.d.ts.map +1 -0
- package/dist/interfaces/auth.d.ts +47 -0
- package/dist/interfaces/auth.d.ts.map +1 -0
- package/dist/interfaces/camera-pipeline.d.ts +121 -0
- package/dist/interfaces/camera-pipeline.d.ts.map +1 -0
- package/dist/interfaces/capability.d.ts +84 -0
- package/dist/interfaces/capability.d.ts.map +1 -0
- package/dist/interfaces/classifier.d.ts +8 -0
- package/dist/interfaces/classifier.d.ts.map +1 -0
- package/dist/interfaces/config-ui.d.ts +152 -0
- package/dist/interfaces/config-ui.d.ts.map +1 -0
- package/dist/interfaces/context.d.ts +44 -0
- package/dist/interfaces/context.d.ts.map +1 -0
- package/dist/interfaces/cropper.d.ts +8 -0
- package/dist/interfaces/cropper.d.ts.map +1 -0
- package/dist/interfaces/decoder.d.ts +27 -0
- package/dist/interfaces/decoder.d.ts.map +1 -0
- package/dist/interfaces/detection-addon.d.ts +15 -0
- package/dist/interfaces/detection-addon.d.ts.map +1 -0
- package/dist/interfaces/detector.d.ts +8 -0
- package/dist/interfaces/detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/accessory.d.ts +14 -0
- package/dist/interfaces/device-capabilities/accessory.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/audio-detector.d.ts +12 -0
- package/dist/interfaces/device-capabilities/audio-detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/camera.d.ts +22 -0
- package/dist/interfaces/device-capabilities/camera.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/doorbell.d.ts +10 -0
- package/dist/interfaces/device-capabilities/doorbell.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/events.d.ts +47 -0
- package/dist/interfaces/device-capabilities/events.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/index.d.ts +15 -0
- package/dist/interfaces/device-capabilities/index.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts +7 -0
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/native-detection.d.ts +14 -0
- package/dist/interfaces/device-capabilities/native-detection.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/object-detector.d.ts +59 -0
- package/dist/interfaces/device-capabilities/object-detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts +29 -0
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/recording.d.ts +18 -0
- package/dist/interfaces/device-capabilities/recording.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/siren.d.ts +8 -0
- package/dist/interfaces/device-capabilities/siren.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/status-light.d.ts +7 -0
- package/dist/interfaces/device-capabilities/status-light.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/switch.d.ts +8 -0
- package/dist/interfaces/device-capabilities/switch.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts +8 -0
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts.map +1 -0
- package/dist/interfaces/device-capability.d.ts +14 -0
- package/dist/interfaces/device-capability.d.ts.map +1 -0
- package/dist/interfaces/device-provider.d.ts +43 -0
- package/dist/interfaces/device-provider.d.ts.map +1 -0
- package/dist/interfaces/device.d.ts +40 -0
- package/dist/interfaces/device.d.ts.map +1 -0
- package/dist/interfaces/event-bus.d.ts +22 -0
- package/dist/interfaces/event-bus.d.ts.map +1 -0
- package/dist/interfaces/feature-flags.d.ts +14 -0
- package/dist/interfaces/feature-flags.d.ts.map +1 -0
- package/dist/interfaces/ffmpeg.d.ts +10 -0
- package/dist/interfaces/ffmpeg.d.ts.map +1 -0
- package/dist/interfaces/inference-capabilities.d.ts +101 -0
- package/dist/interfaces/inference-capabilities.d.ts.map +1 -0
- package/dist/interfaces/inference-engine.d.ts +17 -0
- package/dist/interfaces/inference-engine.d.ts.map +1 -0
- package/dist/interfaces/lifecycle.d.ts +19 -0
- package/dist/interfaces/lifecycle.d.ts.map +1 -0
- package/dist/interfaces/logging.d.ts +33 -0
- package/dist/interfaces/logging.d.ts.map +1 -0
- package/dist/interfaces/model-catalog.d.ts +25 -0
- package/dist/interfaces/model-catalog.d.ts.map +1 -0
- package/dist/interfaces/network-quality.d.ts +25 -0
- package/dist/interfaces/network-quality.d.ts.map +1 -0
- package/dist/interfaces/network.d.ts +43 -0
- package/dist/interfaces/network.d.ts.map +1 -0
- package/dist/interfaces/notification.d.ts +53 -0
- package/dist/interfaces/notification.d.ts.map +1 -0
- package/dist/interfaces/pipeline-runner.d.ts +23 -0
- package/dist/interfaces/pipeline-runner.d.ts.map +1 -0
- package/dist/interfaces/pipeline-slot.d.ts +10 -0
- package/dist/interfaces/pipeline-slot.d.ts.map +1 -0
- package/dist/interfaces/platform.d.ts +55 -0
- package/dist/interfaces/platform.d.ts.map +1 -0
- package/dist/interfaces/process.d.ts +41 -0
- package/dist/interfaces/process.d.ts.map +1 -0
- package/dist/interfaces/python-env.d.ts +20 -0
- package/dist/interfaces/python-env.d.ts.map +1 -0
- package/dist/interfaces/refiner.d.ts +8 -0
- package/dist/interfaces/refiner.d.ts.map +1 -0
- package/dist/interfaces/repl.d.ts +26 -0
- package/dist/interfaces/repl.d.ts.map +1 -0
- package/dist/interfaces/repositories.d.ts +20 -0
- package/dist/interfaces/repositories.d.ts.map +1 -0
- package/dist/interfaces/restreamer.d.ts +24 -0
- package/dist/interfaces/restreamer.d.ts.map +1 -0
- package/dist/interfaces/router.d.ts +30 -0
- package/dist/interfaces/router.d.ts.map +1 -0
- package/dist/interfaces/scene-intelligence.d.ts +21 -0
- package/dist/interfaces/scene-intelligence.d.ts.map +1 -0
- package/dist/interfaces/scoped-token.d.ts +22 -0
- package/dist/interfaces/scoped-token.d.ts.map +1 -0
- package/dist/interfaces/server-analysis.d.ts +146 -0
- package/dist/interfaces/server-analysis.d.ts.map +1 -0
- package/dist/interfaces/server-network.d.ts +78 -0
- package/dist/interfaces/server-network.d.ts.map +1 -0
- package/dist/interfaces/storage-backend.d.ts +27 -0
- package/dist/interfaces/storage-backend.d.ts.map +1 -0
- package/dist/interfaces/storage.d.ts +174 -0
- package/dist/interfaces/storage.d.ts.map +1 -0
- package/dist/interfaces/stream-broker.d.ts +92 -0
- package/dist/interfaces/stream-broker.d.ts.map +1 -0
- package/dist/interfaces/streaming.d.ts +29 -0
- package/dist/interfaces/streaming.d.ts.map +1 -0
- package/dist/interfaces/task-handler.d.ts +46 -0
- package/dist/interfaces/task-handler.d.ts.map +1 -0
- package/dist/interfaces/webrtc-provider.d.ts +11 -0
- package/dist/interfaces/webrtc-provider.d.ts.map +1 -0
- package/dist/interfaces/worker-protocol.d.ts +110 -0
- package/dist/interfaces/worker-protocol.d.ts.map +1 -0
- package/dist/schemas/system-settings-schemas.d.ts +27 -0
- package/dist/schemas/system-settings-schemas.d.ts.map +1 -0
- package/dist/types/analytics.d.ts +75 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/benchmark.d.ts +112 -0
- package/dist/types/benchmark.d.ts.map +1 -0
- package/dist/types/camera-detection.d.ts +34 -0
- package/dist/types/camera-detection.d.ts.map +1 -0
- package/dist/types/config.d.ts +37 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/detection.d.ts +93 -0
- package/dist/types/detection.d.ts.map +1 -0
- package/dist/types/device-type.d.ts +10 -0
- package/dist/types/device-type.d.ts.map +1 -0
- package/dist/types/entities.d.ts +35 -0
- package/dist/types/entities.d.ts.map +1 -0
- package/dist/types/events.d.ts +35 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/io.d.ts +25 -0
- package/dist/types/io.d.ts.map +1 -0
- package/dist/types/labels.d.ts +12 -0
- package/dist/types/labels.d.ts.map +1 -0
- package/dist/types/live-state.d.ts +47 -0
- package/dist/types/live-state.d.ts.map +1 -0
- package/dist/types/models.d.ts +79 -0
- package/dist/types/models.d.ts.map +1 -0
- package/dist/types/pipeline-schema.d.ts +78 -0
- package/dist/types/pipeline-schema.d.ts.map +1 -0
- package/dist/types/pipeline.d.ts +42 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/tracked.d.ts +21 -0
- package/dist/types/tracked.d.ts.map +1 -0
- package/dist/types/zones.d.ts +48 -0
- package/dist/types/zones.d.ts.map +1 -0
- package/dist/utils/cosine-similarity.d.ts +3 -0
- package/dist/utils/cosine-similarity.d.ts.map +1 -0
- package/dist/utils/hf-url.d.ts +2 -0
- package/dist/utils/hf-url.d.ts.map +1 -0
- package/package.json +3 -2
- package/dist/index.d.mts +0 -6702
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,mBAAmB,sBAAsB,CAAA;AACzC,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,4BAA4B,CAAA;AAGnC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,+BAA+B,CAAA;AAClD,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,iCAAiC,CAAA;AACpD,mBAAmB,kCAAkC,C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C,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,wBAAwB,CAAA;AAC3C,YAAY,EACV,SAAS,IAAI,eAAe,EAC5B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,+BAA+B,CAAA;AACtC,mBAAmB,iCAAiC,CAAA;AACpD,mBAAmB,iCAAiC,CAAA;AACpD,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,4BAA4B,CAAA;AAG/C,cAAc,sCAAsC,CAAA;AAGpD,cAAc,gBAAgB,CAAA;AAG9B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAG/D,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,6BAA6B,CAAA;AAEpC,YAAY,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE1F,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Addon i18n interface -- allows addons to provide translations
|
|
3
|
+
* for their UI labels, descriptions, and config schema fields.
|
|
4
|
+
*
|
|
5
|
+
* Addons implement IAddonTranslationProvider to supply translations
|
|
6
|
+
* either as a static map or via a dynamic lookup method.
|
|
7
|
+
*/
|
|
8
|
+
/** A flat key-value map of translation strings for a single locale */
|
|
9
|
+
export type TranslationMap = Readonly<Record<string, string>>;
|
|
10
|
+
/** A complete translations bundle keyed by locale code (e.g. 'en', 'it', 'de') */
|
|
11
|
+
export type TranslationBundle = Readonly<Record<string, TranslationMap>>;
|
|
12
|
+
/**
|
|
13
|
+
* Provider interface for addons that supply translations.
|
|
14
|
+
*
|
|
15
|
+
* Addons can provide translations in two ways:
|
|
16
|
+
* 1. A static bundle via `getTranslationBundle()` containing all locales
|
|
17
|
+
* 2. A per-locale lookup via `getTranslations(locale)` for lazy loading
|
|
18
|
+
*
|
|
19
|
+
* At least one method must be implemented. If both are present,
|
|
20
|
+
* `getTranslations()` takes precedence for the requested locale.
|
|
21
|
+
*/
|
|
22
|
+
export interface IAddonTranslationProvider {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
/**
|
|
25
|
+
* Return translations for a specific locale.
|
|
26
|
+
* Returns undefined if the locale is not supported.
|
|
27
|
+
*/
|
|
28
|
+
getTranslations?(locale: string): TranslationMap | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Return the full translation bundle containing all supported locales.
|
|
31
|
+
* Useful when the addon ships all translations statically.
|
|
32
|
+
*/
|
|
33
|
+
getTranslationBundle?(): TranslationBundle;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a translation key against a provider for the given locale.
|
|
37
|
+
* Falls back to 'en' if the requested locale is not available,
|
|
38
|
+
* then falls back to the key itself if no translation is found.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveTranslation(provider: IAddonTranslationProvider, locale: string, key: string): string;
|
|
41
|
+
//# sourceMappingURL=addon-i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon-i18n.d.ts","sourceRoot":"","sources":["../../src/interfaces/addon-i18n.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAE7D,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;AAExE;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,eAAe,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAA;IAE5D;;;OAGG;IACH,oBAAoB,CAAC,IAAI,iBAAiB,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,yBAAyB,EACnC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,MAAM,CA4BR"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { TokenScope } from './scoped-token.js';
|
|
2
|
+
export type RouteAccess = 'public' | 'authenticated' | 'admin';
|
|
3
|
+
/**
|
|
4
|
+
* Request object passed to addon route handlers.
|
|
5
|
+
*/
|
|
6
|
+
export interface AddonHttpRequest {
|
|
7
|
+
readonly params: Record<string, string>;
|
|
8
|
+
readonly query: Record<string, string>;
|
|
9
|
+
readonly body: unknown;
|
|
10
|
+
readonly headers: Record<string, string>;
|
|
11
|
+
/** Populated for 'authenticated' and 'admin' routes */
|
|
12
|
+
readonly user?: {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly username: string;
|
|
15
|
+
readonly role: string;
|
|
16
|
+
};
|
|
17
|
+
/** Populated when request uses a scoped token */
|
|
18
|
+
readonly scopedToken?: {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly userId: string;
|
|
21
|
+
readonly scopes: TokenScope[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Reply object for addon route handlers.
|
|
26
|
+
*/
|
|
27
|
+
export interface AddonHttpReply {
|
|
28
|
+
status(code: number): AddonHttpReply;
|
|
29
|
+
send(data: unknown): void;
|
|
30
|
+
redirect(url: string): void;
|
|
31
|
+
header(name: string, value: string): AddonHttpReply;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A single HTTP route registered by an addon.
|
|
35
|
+
*/
|
|
36
|
+
export interface IAddonHttpRoute {
|
|
37
|
+
readonly method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly access: RouteAccess;
|
|
40
|
+
readonly description?: string;
|
|
41
|
+
readonly handler: (request: AddonHttpRequest, reply: AddonHttpReply) => Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Provider interface for addons that expose HTTP endpoints.
|
|
45
|
+
*/
|
|
46
|
+
export interface IAddonRouteProvider {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
getRoutes(): IAddonHttpRoute[];
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=addon-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon-routes.d.ts","sourceRoot":"","sources":["../../src/interfaces/addon-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,eAAe,GAAG,OAAO,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,EAAE;QACd,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KACtB,CAAA;IACD,iDAAiD;IACjD,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,CAAA;KAC9B,CAAA;CACF;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;IACpC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAAA;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,SAAS,IAAI,eAAe,EAAE,CAAA;CAC/B"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import type { PipelineSlot } from '../types/pipeline.js';
|
|
2
|
+
import type { ConfigUISchema } from './config-ui.js';
|
|
3
|
+
import type { IAddonRouter } from './router.js';
|
|
4
|
+
import type { INetworkProvider } from './network.js';
|
|
5
|
+
import type { IScopedLogger } from './logging.js';
|
|
6
|
+
import type { IEventBus } from './event-bus.js';
|
|
7
|
+
import type { IStorageProvider, IStorageLocation, ISettingsBackend, IEmbeddingsBackend } from './storage.js';
|
|
8
|
+
import type { CapabilityDeclaration, CapabilityProviderMap } from './capability.js';
|
|
9
|
+
import type { IElementConfig } from './context.js';
|
|
10
|
+
import type { ITaskHandler } from './task-handler.js';
|
|
11
|
+
import type { SubProcessInfo, WorkerProcessStats } from './worker-protocol.js';
|
|
12
|
+
/** Storage interface for addon file operations */
|
|
13
|
+
export interface IAddonFileStorage {
|
|
14
|
+
readFile(path: string): Promise<Buffer>;
|
|
15
|
+
writeFile(path: string, data: Buffer): Promise<void>;
|
|
16
|
+
deleteFile(path: string): Promise<void>;
|
|
17
|
+
listFiles(prefix?: string): Promise<readonly string[]>;
|
|
18
|
+
exists(path: string): Promise<boolean>;
|
|
19
|
+
}
|
|
20
|
+
/** Storage interface for addon structured data (DB) */
|
|
21
|
+
export interface IAddonStructuredStorage {
|
|
22
|
+
query(collection: string, filter?: Record<string, unknown>): Promise<readonly unknown[]>;
|
|
23
|
+
insert(collection: string, data: Record<string, unknown>): Promise<void>;
|
|
24
|
+
update(collection: string, id: string, data: Record<string, unknown>): Promise<void>;
|
|
25
|
+
delete(collection: string, id: string): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
/** Named file storage locations available to addons */
|
|
28
|
+
export type AddonFileLocationName = 'data' | 'media' | 'recordings' | 'models' | 'cache' | 'logs';
|
|
29
|
+
/** Named structured storage locations available to addons */
|
|
30
|
+
export type AddonStructuredLocationName = 'data' | 'events' | 'config';
|
|
31
|
+
/** Combined storage location name (union of file and structured) */
|
|
32
|
+
export type AddonStorageLocationName = AddonFileLocationName | AddonStructuredLocationName;
|
|
33
|
+
/** Storage access for addons -- replaces raw AddonLocationPaths */
|
|
34
|
+
export interface AddonStorageLocations {
|
|
35
|
+
/** Get file storage for a named location */
|
|
36
|
+
getFiles(location: AddonFileLocationName): IAddonFileStorage;
|
|
37
|
+
/** Get structured storage (DB) for a named location */
|
|
38
|
+
getStructured(location: AddonStructuredLocationName): IAddonStructuredStorage;
|
|
39
|
+
}
|
|
40
|
+
export type AddonCapability = 'storage' | 'backup' | 'log-destination' | 'device-exporter' | 'network-access' | 'turn-provider' | 'webrtc-provider' | 'remote-access' | 'recording-engine' | 'notification-output' | 'streaming-engine' | 'pipeline-consumer' | 'detection-engine' | 'object-detector' | 'motion-analyzer' | 'sub-detector' | 'face-detector' | 'plate-detector' | 'recognizer' | 'face-recognizer' | 'plate-recognizer' | 'audio-classifier' | 'device-provider' | 'stream-broker' | 'analysis-data-persistence' | 'analysis-pipeline';
|
|
41
|
+
export interface RequiredStep {
|
|
42
|
+
readonly slot: PipelineSlot;
|
|
43
|
+
readonly outputClasses: readonly string[];
|
|
44
|
+
readonly description: string;
|
|
45
|
+
}
|
|
46
|
+
export interface AddonManifest {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly version: string;
|
|
50
|
+
readonly description?: string;
|
|
51
|
+
/** Relative path to SVG icon asset within the addon package */
|
|
52
|
+
readonly icon?: string;
|
|
53
|
+
/** Brand hex color for UI display (e.g., "#3b82f6") */
|
|
54
|
+
readonly color?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether multiple instances of this provider can be created.
|
|
57
|
+
* 'unique' — only one instance allowed (e.g., RTSP, ONVIF)
|
|
58
|
+
* 'multiple' — user can create N instances (e.g., Frigate, Scrypted)
|
|
59
|
+
* Default: 'multiple'
|
|
60
|
+
*/
|
|
61
|
+
readonly instanceMode?: 'unique' | 'multiple';
|
|
62
|
+
/** Whether this addon is protected (required by the system, cannot be uninstalled) */
|
|
63
|
+
readonly protected?: boolean;
|
|
64
|
+
readonly packageName?: string;
|
|
65
|
+
readonly capabilities?: readonly (AddonCapability | {
|
|
66
|
+
name: string;
|
|
67
|
+
mode: string;
|
|
68
|
+
})[];
|
|
69
|
+
readonly requiredFeatures?: readonly string[];
|
|
70
|
+
readonly slot?: PipelineSlot;
|
|
71
|
+
readonly inputClasses?: readonly string[];
|
|
72
|
+
readonly outputClasses?: readonly string[];
|
|
73
|
+
readonly requiredSteps?: readonly RequiredStep[];
|
|
74
|
+
readonly supportsCustomModels?: boolean;
|
|
75
|
+
readonly mayRequirePython?: boolean;
|
|
76
|
+
readonly defaultConfig?: Readonly<Record<string, unknown>>;
|
|
77
|
+
/** Whether this addon performs active inference with models.
|
|
78
|
+
* Passive addons (e.g. motion-detection) set this to false
|
|
79
|
+
* and are excluded from the inference pipeline schema. Default: true. */
|
|
80
|
+
readonly passive?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Label output type — declares what kind of label this addon produces
|
|
83
|
+
* when used as a classifier/recognizer in the pipeline.
|
|
84
|
+
* Used to tag LabelData.origin so the UI can render labels appropriately.
|
|
85
|
+
*/
|
|
86
|
+
readonly labelOutputType?: import('../types/detection.js').LabelOrigin;
|
|
87
|
+
}
|
|
88
|
+
/** @deprecated Use IStorageProvider.resolve() instead of raw paths */
|
|
89
|
+
export interface AddonLocationPaths {
|
|
90
|
+
readonly data: string;
|
|
91
|
+
readonly media: string;
|
|
92
|
+
readonly recordings: string;
|
|
93
|
+
readonly models: string;
|
|
94
|
+
readonly logs: string;
|
|
95
|
+
readonly cache: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Minimal model-management API exposed to addons via AddonContext.
|
|
99
|
+
*/
|
|
100
|
+
export interface IAddonModelManager {
|
|
101
|
+
/** Ensure a model is downloaded. Returns the local file path. */
|
|
102
|
+
ensure(modelId: string, format?: import('../types/models.js').ModelFormat): Promise<string>;
|
|
103
|
+
/** Ensure extra files for a model are downloaded. Returns paths. */
|
|
104
|
+
ensureExtraFiles(modelId: string): Promise<readonly string[]>;
|
|
105
|
+
/** Absolute path to the shared models directory. */
|
|
106
|
+
getModelsDir(): string;
|
|
107
|
+
/** Check if a model is already downloaded. */
|
|
108
|
+
isDownloaded(modelId: string, format?: import('../types/models.js').ModelFormat): boolean;
|
|
109
|
+
/** @deprecated Use ensure() instead. Legacy API kept for backward compatibility. */
|
|
110
|
+
downloadModel(id: string): Promise<string>;
|
|
111
|
+
}
|
|
112
|
+
/** Process management for addon sub-processes (ffmpeg, python, etc.) */
|
|
113
|
+
export interface IAddonProcessManager {
|
|
114
|
+
/** Spawn a child process managed by this addon's worker */
|
|
115
|
+
spawn(config: SubProcessConfig): Promise<IManagedSubProcess>;
|
|
116
|
+
/** List all sub-processes spawned by this addon */
|
|
117
|
+
listProcesses(): readonly SubProcessInfo[];
|
|
118
|
+
/** Get worker stats (this addon's worker process) */
|
|
119
|
+
getWorkerStats(): WorkerProcessStats;
|
|
120
|
+
}
|
|
121
|
+
export interface SubProcessConfig {
|
|
122
|
+
readonly name: string;
|
|
123
|
+
readonly command: string;
|
|
124
|
+
readonly args?: readonly string[];
|
|
125
|
+
readonly cwd?: string;
|
|
126
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
127
|
+
readonly autoRestart?: boolean;
|
|
128
|
+
readonly maxRestarts?: number;
|
|
129
|
+
}
|
|
130
|
+
export interface IManagedSubProcess {
|
|
131
|
+
readonly pid: number;
|
|
132
|
+
readonly name: string;
|
|
133
|
+
getStats(): WorkerProcessStats;
|
|
134
|
+
write(data: Buffer): void;
|
|
135
|
+
readonly stdout: AsyncIterable<Buffer>;
|
|
136
|
+
readonly stderr: AsyncIterable<Buffer>;
|
|
137
|
+
kill(signal?: NodeJS.Signals): void;
|
|
138
|
+
wait(): Promise<{
|
|
139
|
+
code: number | null;
|
|
140
|
+
signal: string | null;
|
|
141
|
+
}>;
|
|
142
|
+
onExit(handler: (code: number | null) => void): void;
|
|
143
|
+
onError(handler: (error: Error) => void): void;
|
|
144
|
+
}
|
|
145
|
+
/** Dependency manager — ensures binaries/tools are available for addons */
|
|
146
|
+
export interface IAddonDepsManager {
|
|
147
|
+
/** Ensure a named binary is available (check local -> PATH -> download) */
|
|
148
|
+
ensureBinary(opts: {
|
|
149
|
+
readonly name: string;
|
|
150
|
+
readonly downloadUrl: string;
|
|
151
|
+
readonly isArchive?: boolean;
|
|
152
|
+
readonly archiveFormat?: 'zip' | 'tar.gz' | 'tar.xz';
|
|
153
|
+
readonly archiveInnerPath?: string;
|
|
154
|
+
}): Promise<string>;
|
|
155
|
+
/** Ensure ffmpeg is available */
|
|
156
|
+
ensureFfmpeg(): Promise<string>;
|
|
157
|
+
/** Ensure Python is available, returns path or null if unavailable */
|
|
158
|
+
ensurePython(): Promise<string | null>;
|
|
159
|
+
/** Install Python packages in the managed Python environment */
|
|
160
|
+
installPythonPackages(packages: readonly string[]): Promise<void>;
|
|
161
|
+
/** Get the deps directory path */
|
|
162
|
+
getDepsDir(): string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* AddonContext -- injected into every addon at initialize().
|
|
166
|
+
*
|
|
167
|
+
* The context includes both the CamstackContext fields (id, logger, eventBus, storage, config)
|
|
168
|
+
* and addon-specific extras (addonConfig, models, locationPaths, router, network).
|
|
169
|
+
*/
|
|
170
|
+
/**
|
|
171
|
+
* AddonContext -- injected into every addon at initialize().
|
|
172
|
+
*
|
|
173
|
+
* The `api` field is typed as `AddonApi` — a generated interface that
|
|
174
|
+
* mirrors the server's tRPC router namespaces. This gives addons type-safe
|
|
175
|
+
* access to server procedures without depending on the server package.
|
|
176
|
+
*
|
|
177
|
+
* To regenerate after changing routers: npx tsx scripts/generate-api-types.ts
|
|
178
|
+
*/
|
|
179
|
+
export interface AddonContext {
|
|
180
|
+
/** Immutable progressive ID */
|
|
181
|
+
readonly id: string;
|
|
182
|
+
/** Pre-scoped logger */
|
|
183
|
+
readonly logger: IScopedLogger;
|
|
184
|
+
/** System event bus */
|
|
185
|
+
readonly eventBus: IEventBus;
|
|
186
|
+
/** Scoped storage location (legacy — use storageProvider instead) */
|
|
187
|
+
readonly storage: IStorageLocation;
|
|
188
|
+
/** Persisted config store */
|
|
189
|
+
readonly config: IElementConfig;
|
|
190
|
+
/** Bootstrap configuration from server settings (read-only) */
|
|
191
|
+
readonly addonConfig: Readonly<Record<string, unknown>>;
|
|
192
|
+
/** Model management -- download default models or retrieve cached paths. */
|
|
193
|
+
models?: IAddonModelManager;
|
|
194
|
+
/** @deprecated Use storageProvider.resolve() instead */
|
|
195
|
+
readonly locationPaths: AddonLocationPaths;
|
|
196
|
+
/** File storage provider — resolve paths, read/write files per location type */
|
|
197
|
+
readonly storageProvider?: IStorageProvider;
|
|
198
|
+
/** Settings backend — query/insert structured data (events, settings, metadata) */
|
|
199
|
+
readonly settingsBackend?: ISettingsBackend;
|
|
200
|
+
/** Embeddings backend — vector storage for similarity search */
|
|
201
|
+
readonly embeddingsBackend?: IEmbeddingsBackend;
|
|
202
|
+
/**
|
|
203
|
+
* Private data directory for this addon.
|
|
204
|
+
* Resolved via storageProvider.resolve('addons-data', '{addonId}/').
|
|
205
|
+
* The addon owns this directory exclusively.
|
|
206
|
+
*/
|
|
207
|
+
readonly dataDir: string;
|
|
208
|
+
/** HTTP router for registering addon routes */
|
|
209
|
+
readonly router?: IAddonRouter;
|
|
210
|
+
/** Network access provider */
|
|
211
|
+
readonly network?: INetworkProvider;
|
|
212
|
+
/**
|
|
213
|
+
* Register a task handler that can be dispatched by the hub.
|
|
214
|
+
* Only effective in agent mode — in hub mode, handlers are stored but not dispatched.
|
|
215
|
+
*/
|
|
216
|
+
registerTaskHandler?(handler: ITaskHandler): void;
|
|
217
|
+
/** Process management — spawn and monitor sub-processes */
|
|
218
|
+
readonly process?: IAddonProcessManager;
|
|
219
|
+
/** Dependency management — ensure binary/tool availability */
|
|
220
|
+
readonly deps?: IAddonDepsManager;
|
|
221
|
+
/**
|
|
222
|
+
* Full tRPC client — same API as the frontend.
|
|
223
|
+
* Transport is transparent: direct caller (in-process), WSS (worker), or WSS (remote agent).
|
|
224
|
+
* Use this for all server interactions: storage, events, devices, streaming, etc.
|
|
225
|
+
*/
|
|
226
|
+
readonly api?: import('../generated/addon-api.js').AddonApi;
|
|
227
|
+
}
|
|
228
|
+
export interface ICamstackAddon {
|
|
229
|
+
readonly id?: string;
|
|
230
|
+
readonly manifest: AddonManifest;
|
|
231
|
+
initialize(context: AddonContext): Promise<void>;
|
|
232
|
+
shutdown(): Promise<void>;
|
|
233
|
+
getConfigSchema?(): ConfigUISchema;
|
|
234
|
+
/**
|
|
235
|
+
* Return the provider instance for a declared capability.
|
|
236
|
+
* Called by CapabilityRegistry after initialize() succeeds.
|
|
237
|
+
* Returns null if this addon does not provide the requested capability.
|
|
238
|
+
*/
|
|
239
|
+
getCapabilityProvider?<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
|
|
240
|
+
}
|
|
241
|
+
/** Declaration of a UI page provided by an addon */
|
|
242
|
+
export interface AddonPageDeclaration {
|
|
243
|
+
/** Unique page ID (scoped to addon) */
|
|
244
|
+
readonly id: string;
|
|
245
|
+
/** Display label for sidebar */
|
|
246
|
+
readonly label: string;
|
|
247
|
+
/** Lucide icon name for sidebar */
|
|
248
|
+
readonly icon: string;
|
|
249
|
+
/** Route path (e.g., '/benchmark') */
|
|
250
|
+
readonly path: string;
|
|
251
|
+
/** Relative path to JS bundle within addon package (default export = React component) */
|
|
252
|
+
readonly bundle: string;
|
|
253
|
+
/** @deprecated Web component element name — addon pages now export React components */
|
|
254
|
+
readonly element?: string;
|
|
255
|
+
}
|
|
256
|
+
/** Provider interface for addons that expose UI pages */
|
|
257
|
+
export interface IAddonPageProvider {
|
|
258
|
+
readonly id: string;
|
|
259
|
+
getPages(): readonly AddonPageDeclaration[];
|
|
260
|
+
}
|
|
261
|
+
/** Provider interface for the admin UI shell (singleton capability) */
|
|
262
|
+
export interface IAdminUI {
|
|
263
|
+
getStaticDir(): string;
|
|
264
|
+
getVersion(): string;
|
|
265
|
+
}
|
|
266
|
+
export interface AddonDeclaration {
|
|
267
|
+
readonly id: string;
|
|
268
|
+
readonly entry: string;
|
|
269
|
+
readonly slot: PipelineSlot;
|
|
270
|
+
/** Relative path to SVG icon asset within the addon package */
|
|
271
|
+
readonly icon?: string;
|
|
272
|
+
/** Brand hex color for UI display */
|
|
273
|
+
readonly color?: string;
|
|
274
|
+
/** Instance mode: 'unique' or 'multiple'. Default: 'multiple' */
|
|
275
|
+
readonly instanceMode?: 'unique' | 'multiple';
|
|
276
|
+
/** @deprecated Use inProcess instead. Legacy opt-in flag for forking. */
|
|
277
|
+
readonly forkable?: boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Force this addon to stay in-process (no forking).
|
|
280
|
+
* Default: false — all non-infra addons are forked by default.
|
|
281
|
+
* Use CAMSTACK_FORCE_INPROCESS=true env var for emergency global fallback.
|
|
282
|
+
*/
|
|
283
|
+
readonly inProcess?: boolean;
|
|
284
|
+
/** Capabilities this addon provides. Declared in package.json camstack.addons[].capabilities */
|
|
285
|
+
readonly capabilities?: readonly CapabilityDeclaration[];
|
|
286
|
+
/** UI pages provided by this addon */
|
|
287
|
+
readonly pages?: readonly AddonPageDeclaration[];
|
|
288
|
+
}
|
|
289
|
+
export interface AddonPackageManifest {
|
|
290
|
+
/** Human-readable package name for UI display (e.g., "CamStack Vision") */
|
|
291
|
+
readonly displayName?: string;
|
|
292
|
+
readonly addons: readonly AddonDeclaration[];
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=addon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addon.d.ts","sourceRoot":"","sources":["../../src/interfaces/addon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5G,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM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CAC1B;AAED,yDAAyD;AACzD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,IAAI,SAAS,oBAAoB,EAAE,CAAA;CAC5C;AAED,uEAAuE;AACvE,MAAM,WAAW,QAAQ;IACvB,YAAY,IAAI,MAAM,CAAA;IACtB,UAAU,IAAI,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,qCAAqC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,iEAAiE;IACjE,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC7C,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,gGAAgG;IAChG,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACxD,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAA;CACjD;AAED,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAC7C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface NotificationRule {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly enabled: boolean;
|
|
5
|
+
readonly eventTypes: readonly string[];
|
|
6
|
+
readonly conditions: {
|
|
7
|
+
readonly deviceIds?: readonly string[];
|
|
8
|
+
readonly classNames?: readonly string[];
|
|
9
|
+
readonly zoneIds?: readonly string[];
|
|
10
|
+
readonly minConfidence?: number;
|
|
11
|
+
readonly source?: 'pipeline' | 'onboard' | 'any';
|
|
12
|
+
readonly schedule?: {
|
|
13
|
+
readonly days: readonly number[];
|
|
14
|
+
readonly startHour: number;
|
|
15
|
+
readonly endHour: number;
|
|
16
|
+
};
|
|
17
|
+
readonly cooldownSeconds?: number;
|
|
18
|
+
readonly minDwellSeconds?: number;
|
|
19
|
+
};
|
|
20
|
+
readonly outputs: readonly string[];
|
|
21
|
+
readonly template?: {
|
|
22
|
+
readonly title: string;
|
|
23
|
+
readonly body: string;
|
|
24
|
+
readonly imageMode: 'crop' | 'annotated' | 'full' | 'none';
|
|
25
|
+
};
|
|
26
|
+
readonly priority: 'low' | 'normal' | 'high' | 'critical';
|
|
27
|
+
}
|
|
28
|
+
export interface NotificationTestResult {
|
|
29
|
+
readonly ruleId: string;
|
|
30
|
+
readonly eventId: string;
|
|
31
|
+
readonly timestamp: number;
|
|
32
|
+
readonly wouldFire: boolean;
|
|
33
|
+
readonly reason?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface NotificationHistoryFilter {
|
|
36
|
+
readonly ruleId?: string;
|
|
37
|
+
readonly deviceId?: string;
|
|
38
|
+
readonly from?: number;
|
|
39
|
+
readonly to?: number;
|
|
40
|
+
readonly limit?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface NotificationHistoryEntry {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly ruleId: string;
|
|
45
|
+
readonly ruleName: string;
|
|
46
|
+
readonly eventId: string;
|
|
47
|
+
readonly timestamp: number;
|
|
48
|
+
readonly outputs: readonly string[];
|
|
49
|
+
readonly success: boolean;
|
|
50
|
+
readonly error?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface IAdvancedNotifier {
|
|
53
|
+
getRules(): readonly NotificationRule[];
|
|
54
|
+
upsertRule(rule: NotificationRule): void;
|
|
55
|
+
deleteRule(ruleId: string): void;
|
|
56
|
+
testRule(ruleId: string, lookbackMinutes: number): Promise<NotificationTestResult[]>;
|
|
57
|
+
getHistory(filter?: NotificationHistoryFilter): Promise<NotificationHistoryEntry[]>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=advanced-notifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advanced-notifier.d.ts","sourceRoot":"","sources":["../../src/interfaces/advanced-notifier.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;QACtC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;QACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;QACpC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;QAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,KAAK,CAAA;QAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAClB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;YAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;YAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;SACzB,CAAA;QACD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;QACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAClC,CAAA;IACD,QAAQ,CAAC,OA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CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,IAAI,SAAS,gBAAgB,EAAE,CAAA;IACvC,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACxC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAA;IACpF,UAAU,CAAC,MAAM,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAA;CACpF"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { TaskProgress } from './task-handler.js';
|
|
2
|
+
export type AgentCapability = 'decoder' | 'transcoder' | 'detector' | 'recorder';
|
|
3
|
+
export type RolePriority = 'primary' | 'backup' | 'overflow';
|
|
4
|
+
export interface CameraRoleAssignment {
|
|
5
|
+
cameraId: string;
|
|
6
|
+
role: AgentCapability;
|
|
7
|
+
agentId: string;
|
|
8
|
+
priority: RolePriority;
|
|
9
|
+
rtspUrl?: string;
|
|
10
|
+
detectionConfig?: {
|
|
11
|
+
modelId: string;
|
|
12
|
+
runtime: string;
|
|
13
|
+
confidence: number;
|
|
14
|
+
fps: number;
|
|
15
|
+
classes?: string[];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export type HubToAgentMessage = {
|
|
19
|
+
type: 'assign';
|
|
20
|
+
assignment: CameraRoleAssignment;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'unassign';
|
|
23
|
+
cameraId: string;
|
|
24
|
+
role: AgentCapability;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'recording.start';
|
|
27
|
+
cameraId: string;
|
|
28
|
+
rtspUrl: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'recording.stop';
|
|
31
|
+
cameraId: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'benchmark.run';
|
|
34
|
+
config: RemoteBenchmarkConfig;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'config.update';
|
|
37
|
+
addonId: string;
|
|
38
|
+
config: Record<string, unknown>;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'task.execute';
|
|
41
|
+
taskId: string;
|
|
42
|
+
taskType: string;
|
|
43
|
+
payload: unknown;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'task.cancel';
|
|
46
|
+
taskId: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'addon.install';
|
|
49
|
+
package: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: 'addon.uninstall';
|
|
53
|
+
package: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'addon.update';
|
|
56
|
+
package: string;
|
|
57
|
+
version?: string;
|
|
58
|
+
} | {
|
|
59
|
+
type: 'addon.restart';
|
|
60
|
+
} | {
|
|
61
|
+
type: 'ping';
|
|
62
|
+
};
|
|
63
|
+
export type AgentToHubMessage = {
|
|
64
|
+
type: 'register';
|
|
65
|
+
info: AgentRegistrationInfo;
|
|
66
|
+
} | {
|
|
67
|
+
type: 'heartbeat';
|
|
68
|
+
status: AgentRuntimeStatus;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'detection.result';
|
|
71
|
+
cameraId: string;
|
|
72
|
+
detections: DetectionResult[];
|
|
73
|
+
timestamp: number;
|
|
74
|
+
inferenceMs: number;
|
|
75
|
+
} | {
|
|
76
|
+
type: 'recording.segment';
|
|
77
|
+
cameraId: string;
|
|
78
|
+
segment: RecordingSegmentInfo;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'recording.status';
|
|
81
|
+
cameraId: string;
|
|
82
|
+
recording: boolean;
|
|
83
|
+
} | {
|
|
84
|
+
type: 'benchmark.progress';
|
|
85
|
+
event: BenchmarkStreamEvent;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'benchmark.result';
|
|
88
|
+
report: BenchmarkReport;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'task.result';
|
|
91
|
+
taskId: string;
|
|
92
|
+
success: boolean;
|
|
93
|
+
result?: unknown;
|
|
94
|
+
error?: string;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'task.progress';
|
|
97
|
+
taskId: string;
|
|
98
|
+
progress: TaskProgress;
|
|
99
|
+
} | {
|
|
100
|
+
type: 'addon.install-result';
|
|
101
|
+
package: string;
|
|
102
|
+
success: boolean;
|
|
103
|
+
version?: string;
|
|
104
|
+
error?: string;
|
|
105
|
+
} | {
|
|
106
|
+
type: 'addon.uninstall-result';
|
|
107
|
+
package: string;
|
|
108
|
+
success: boolean;
|
|
109
|
+
error?: string;
|
|
110
|
+
} | {
|
|
111
|
+
type: 'addon.update-result';
|
|
112
|
+
package: string;
|
|
113
|
+
success: boolean;
|
|
114
|
+
version?: string;
|
|
115
|
+
error?: string;
|
|
116
|
+
} | {
|
|
117
|
+
type: 'log';
|
|
118
|
+
level: string;
|
|
119
|
+
scope: string;
|
|
120
|
+
message: string;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'pong';
|
|
123
|
+
};
|
|
124
|
+
export declare const BINARY_FRAME_HEADER_SIZE = 29;
|
|
125
|
+
export declare const BINARY_FRAME_TYPE = 1;
|
|
126
|
+
export interface AgentRegistrationInfo {
|
|
127
|
+
id: string;
|
|
128
|
+
name: string;
|
|
129
|
+
capabilities: AgentCapability[];
|
|
130
|
+
host: string;
|
|
131
|
+
port: number;
|
|
132
|
+
platform: string;
|
|
133
|
+
arch: string;
|
|
134
|
+
cpuCores: number;
|
|
135
|
+
memoryMB: number;
|
|
136
|
+
gpuModel?: string;
|
|
137
|
+
pythonRuntimes: string[];
|
|
138
|
+
httpPort: number;
|
|
139
|
+
/** Task types this agent can handle (e.g., 'pipeline.decode', 'system.info') */
|
|
140
|
+
taskTypes?: string[];
|
|
141
|
+
/** Installed addons on this agent */
|
|
142
|
+
installedAddons?: string[];
|
|
143
|
+
}
|
|
144
|
+
export interface AgentRuntimeStatus {
|
|
145
|
+
activeCameras: number;
|
|
146
|
+
cpuPercent: number;
|
|
147
|
+
memoryPercent: number;
|
|
148
|
+
fps: Record<string, number>;
|
|
149
|
+
errors: string[];
|
|
150
|
+
}
|
|
151
|
+
export interface DetectionResult {
|
|
152
|
+
className: string;
|
|
153
|
+
score: number;
|
|
154
|
+
bbox: [number, number, number, number];
|
|
155
|
+
}
|
|
156
|
+
export interface RecordingSegmentInfo {
|
|
157
|
+
id: string;
|
|
158
|
+
startTime: number;
|
|
159
|
+
endTime: number;
|
|
160
|
+
duration: number;
|
|
161
|
+
sizeBytes: number;
|
|
162
|
+
path: string;
|
|
163
|
+
format: 'mp4' | 'ts';
|
|
164
|
+
}
|
|
165
|
+
export interface RemoteBenchmarkConfig {
|
|
166
|
+
runtime: string;
|
|
167
|
+
modelId?: string;
|
|
168
|
+
durationMs: number;
|
|
169
|
+
warmupMs: number;
|
|
170
|
+
inputWidth: number;
|
|
171
|
+
inputHeight: number;
|
|
172
|
+
}
|
|
173
|
+
export interface BenchmarkStreamEvent {
|
|
174
|
+
phase: 'warmup' | 'running';
|
|
175
|
+
iteration: number;
|
|
176
|
+
inferenceMs: number;
|
|
177
|
+
}
|
|
178
|
+
export interface BenchmarkReport {
|
|
179
|
+
runtime: string;
|
|
180
|
+
modelId?: string;
|
|
181
|
+
iterations: number;
|
|
182
|
+
meanMs: number;
|
|
183
|
+
p50Ms: number;
|
|
184
|
+
p95Ms: number;
|
|
185
|
+
p99Ms: number;
|
|
186
|
+
minMs: number;
|
|
187
|
+
maxMs: number;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=agent-protocol.d.ts.map
|