@camstack/types 0.1.2 → 0.1.4
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/index.js +744 -550
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +777 -529
- package/dist/index.mjs.map +1 -1
- 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 +169 -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,25 @@
|
|
|
1
|
+
export interface BoundingBox {
|
|
2
|
+
readonly x: number;
|
|
3
|
+
readonly y: number;
|
|
4
|
+
readonly w: number;
|
|
5
|
+
readonly h: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Landmark {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
readonly label?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FrameInput {
|
|
13
|
+
readonly data: Buffer;
|
|
14
|
+
readonly format: 'jpeg' | 'rgb' | 'yuv420';
|
|
15
|
+
readonly width: number;
|
|
16
|
+
readonly height: number;
|
|
17
|
+
readonly timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AudioChunkInput {
|
|
20
|
+
readonly data: Float32Array;
|
|
21
|
+
readonly sampleRate: number;
|
|
22
|
+
readonly channels: number;
|
|
23
|
+
readonly timestamp: number;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/types/io.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface LabelDefinition {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly category?: string;
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly icon?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ClassMapDefinition {
|
|
9
|
+
readonly mapping: Readonly<Record<string, string>>;
|
|
10
|
+
readonly preserveOriginal: boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/types/labels.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CACnC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { BoundingBox } from './io.js';
|
|
2
|
+
import type { ObjectState } from './tracked.js';
|
|
3
|
+
import type { DetectionEvent } from './events.js';
|
|
4
|
+
import type { PipelineStatus } from './pipeline.js';
|
|
5
|
+
export interface TrackedObjectSummary {
|
|
6
|
+
readonly trackId: string;
|
|
7
|
+
readonly class: string;
|
|
8
|
+
readonly originalClass: string;
|
|
9
|
+
readonly state: ObjectState;
|
|
10
|
+
readonly bbox: BoundingBox;
|
|
11
|
+
readonly velocity: {
|
|
12
|
+
readonly dx: number;
|
|
13
|
+
readonly dy: number;
|
|
14
|
+
};
|
|
15
|
+
readonly dwellTimeMs: number;
|
|
16
|
+
readonly inZones: readonly string[];
|
|
17
|
+
readonly identity?: string;
|
|
18
|
+
readonly plateText?: string;
|
|
19
|
+
readonly subClass?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ZoneLiveState {
|
|
22
|
+
readonly zoneId: string;
|
|
23
|
+
readonly zoneName: string;
|
|
24
|
+
readonly occupied: boolean;
|
|
25
|
+
readonly objectCount: number;
|
|
26
|
+
readonly objectsByClass: Readonly<Record<string, number>>;
|
|
27
|
+
readonly trackIds: readonly string[];
|
|
28
|
+
readonly avgDwellTimeMs: number;
|
|
29
|
+
readonly totalEntrancesToday: number;
|
|
30
|
+
readonly totalExitsToday: number;
|
|
31
|
+
readonly loiteringTracks: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
export interface CameraLiveState {
|
|
34
|
+
readonly deviceId: string;
|
|
35
|
+
readonly lastFrameTimestamp: number;
|
|
36
|
+
readonly activeObjects: number;
|
|
37
|
+
readonly movingObjects: number;
|
|
38
|
+
readonly stationaryObjects: number;
|
|
39
|
+
readonly objectCounts: Readonly<Record<string, number>>;
|
|
40
|
+
readonly tracks: readonly TrackedObjectSummary[];
|
|
41
|
+
readonly zones: readonly ZoneLiveState[];
|
|
42
|
+
readonly lastEvent?: DetectionEvent;
|
|
43
|
+
readonly pipelineStatus: readonly PipelineStatus[];
|
|
44
|
+
readonly avgPipelineMs: number;
|
|
45
|
+
readonly currentFps: number;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=live-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-state.d.ts","sourceRoot":"","sources":["../../src/types/live-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAA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AC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAA;IACnC,QAAQ,CAAC,cAAc,EAAE,SAAS,cAAc,EAAE,CAAA;IAClD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { LabelDefinition, ClassMapDefinition } from './labels.js';
|
|
2
|
+
export type ModelFormat = 'onnx' | 'coreml' | 'openvino' | 'tflite' | 'pt';
|
|
3
|
+
export type ModelOutputFormat = 'yolo' | 'ssd' | 'embedding' | 'classification' | 'ocr' | 'segmentation';
|
|
4
|
+
export interface ModelFormatEntry {
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly sizeMB: number;
|
|
7
|
+
/** Whether this format is a directory bundle (e.g., .mlpackage) rather than a single file */
|
|
8
|
+
readonly isDirectory?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* For directory formats: list of files relative to the directory root.
|
|
11
|
+
* The downloader fetches each file from `{url}/{file}` and saves to `{modelDir}/{file}`.
|
|
12
|
+
* If omitted for a directory format, the downloader probes HuggingFace API (slower).
|
|
13
|
+
*/
|
|
14
|
+
readonly files?: readonly string[];
|
|
15
|
+
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
16
|
+
readonly runtimes?: readonly ('node' | 'python')[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
20
|
+
* The downloader fetches from `url` and saves to `{modelsDir}/{filename}`.
|
|
21
|
+
*/
|
|
22
|
+
export interface ModelExtraFile {
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly filename: string;
|
|
25
|
+
readonly sizeMB: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ModelCatalogEntry {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly formats: Partial<Readonly<Record<ModelFormat, ModelFormatEntry>>>;
|
|
32
|
+
readonly inputSize: {
|
|
33
|
+
readonly width: number;
|
|
34
|
+
readonly height: number;
|
|
35
|
+
};
|
|
36
|
+
readonly labels: readonly LabelDefinition[];
|
|
37
|
+
readonly inputLayout?: 'nchw' | 'nhwc';
|
|
38
|
+
readonly inputNormalization?: 'zero-one' | 'imagenet' | 'none';
|
|
39
|
+
/**
|
|
40
|
+
* Auxiliary files required at runtime (labels JSON, charset dict, etc.).
|
|
41
|
+
* Downloaded into the same modelsDir alongside the model file.
|
|
42
|
+
*/
|
|
43
|
+
readonly extraFiles?: readonly ModelExtraFile[];
|
|
44
|
+
}
|
|
45
|
+
export interface DetectionModel {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly labels: readonly string[];
|
|
49
|
+
readonly inputSize: {
|
|
50
|
+
readonly width: number;
|
|
51
|
+
readonly height: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface ModelDownloadOptions {
|
|
55
|
+
readonly url: string;
|
|
56
|
+
readonly fallbackUrls?: readonly string[];
|
|
57
|
+
readonly destDir: string;
|
|
58
|
+
readonly filename?: string;
|
|
59
|
+
readonly expectedSha256?: string;
|
|
60
|
+
readonly onProgress?: (downloaded: number, total: number) => void;
|
|
61
|
+
}
|
|
62
|
+
export interface ModelDownloadResult {
|
|
63
|
+
readonly filePath: string;
|
|
64
|
+
readonly downloadedBytes: number;
|
|
65
|
+
readonly fromCache: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface CustomModelMetadata {
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly inputSize: {
|
|
70
|
+
readonly width: number;
|
|
71
|
+
readonly height: number;
|
|
72
|
+
};
|
|
73
|
+
readonly labels: readonly LabelDefinition[];
|
|
74
|
+
readonly classMap?: ClassMapDefinition;
|
|
75
|
+
readonly inputLayout?: 'nchw' | 'nhwc';
|
|
76
|
+
readonly inputNormalization?: 'zero-one' | 'imagenet' | 'none';
|
|
77
|
+
readonly outputFormat: ModelOutputFormat;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/types/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEtE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAA;AAC1E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,gBAAgB,GAAG,KAAK,GAAG,cAAc,CAAA;AAExG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAA;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B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QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACvE,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAC3C,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAA;IAC9D,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAA;CACzC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { PipelineSlot } from './pipeline.js';
|
|
2
|
+
import type { ModelFormat } from './models.js';
|
|
3
|
+
export interface PipelineAddonSchema {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly slot: PipelineSlot;
|
|
7
|
+
readonly inputClasses: readonly string[];
|
|
8
|
+
readonly outputClasses: readonly string[];
|
|
9
|
+
/** Which child slots this addon can host (e.g. detector hosts cropper/classifier) */
|
|
10
|
+
readonly childSlots: readonly PipelineSlot[];
|
|
11
|
+
/** Available models with download status per format */
|
|
12
|
+
readonly models: readonly PipelineModelOption[];
|
|
13
|
+
readonly defaultModelId: string;
|
|
14
|
+
readonly defaultConfidence: number;
|
|
15
|
+
/** Best runtime for this addon on this agent — resolved by PlatformScorer */
|
|
16
|
+
readonly defaultRuntime: string;
|
|
17
|
+
/** Best backend for this addon on this agent — resolved by PlatformScorer */
|
|
18
|
+
readonly defaultBackend: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PipelineModelOption {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly formats: Partial<Readonly<Record<ModelFormat, {
|
|
24
|
+
downloaded: boolean;
|
|
25
|
+
sizeMB: number;
|
|
26
|
+
}>>>;
|
|
27
|
+
}
|
|
28
|
+
export interface PipelineSlotSchema {
|
|
29
|
+
readonly id: PipelineSlot;
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly priority: number;
|
|
32
|
+
/** Which slot is the parent (null for root detectors) */
|
|
33
|
+
readonly parentSlot: PipelineSlot | null;
|
|
34
|
+
readonly addons: readonly PipelineAddonSchema[];
|
|
35
|
+
}
|
|
36
|
+
export interface PipelineSchema {
|
|
37
|
+
readonly slots: readonly PipelineSlotSchema[];
|
|
38
|
+
}
|
|
39
|
+
/** A fully-resolved pipeline step with all defaults from PlatformScorer */
|
|
40
|
+
export interface PipelineDefaultStep {
|
|
41
|
+
readonly addonId: string;
|
|
42
|
+
readonly addonName: string;
|
|
43
|
+
readonly slot: PipelineSlot;
|
|
44
|
+
readonly inputClasses: readonly string[];
|
|
45
|
+
readonly outputClasses: readonly string[];
|
|
46
|
+
readonly enabled: boolean;
|
|
47
|
+
readonly agentId: string;
|
|
48
|
+
readonly runtime: string;
|
|
49
|
+
readonly backend: string;
|
|
50
|
+
readonly modelId: string;
|
|
51
|
+
readonly confidence: number;
|
|
52
|
+
readonly classFilters: readonly string[];
|
|
53
|
+
readonly children: readonly PipelineDefaultStep[];
|
|
54
|
+
}
|
|
55
|
+
export interface PipelineTemplateStep {
|
|
56
|
+
readonly addonId: string;
|
|
57
|
+
readonly enabled: boolean;
|
|
58
|
+
readonly agentId: string;
|
|
59
|
+
readonly runtime: string;
|
|
60
|
+
readonly backend: string;
|
|
61
|
+
readonly modelId: string;
|
|
62
|
+
readonly confidence: number;
|
|
63
|
+
readonly classFilters: readonly string[];
|
|
64
|
+
readonly children: readonly PipelineTemplateStep[];
|
|
65
|
+
}
|
|
66
|
+
export interface PipelineTemplate {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly createdAt: string;
|
|
70
|
+
readonly updatedAt: string;
|
|
71
|
+
readonly steps: readonly PipelineTemplateStep[];
|
|
72
|
+
}
|
|
73
|
+
export interface TemplateValidationResult {
|
|
74
|
+
readonly valid: boolean;
|
|
75
|
+
readonly steps: readonly PipelineTemplateStep[];
|
|
76
|
+
readonly warnings: readonly string[];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=pipeline-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-schema.d.ts","sourceRoot":"","sources":["../../src/types/pipeline-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAI9C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,qFAAqF;IACrF,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAA;IAC5C,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAA;IAC/C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;C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AAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAClD;AAID,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAA;CACnD;AAID,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAA;CAChD;AAID,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DetectorOutput, CropperOutput, ClassifierOutput, RefinerOutput } from './detection.js';
|
|
2
|
+
export type PipelineSlot = 'detector' | 'cropper' | 'classifier' | 'refiner';
|
|
3
|
+
export interface PipelineNode {
|
|
4
|
+
readonly step: string;
|
|
5
|
+
readonly addon: string;
|
|
6
|
+
readonly configOverride?: Readonly<Record<string, unknown>>;
|
|
7
|
+
readonly children?: readonly PipelineNode[];
|
|
8
|
+
}
|
|
9
|
+
export interface PipelineConfig {
|
|
10
|
+
readonly video: readonly PipelineNode[];
|
|
11
|
+
readonly audio?: PipelineNode;
|
|
12
|
+
}
|
|
13
|
+
export interface PipelineStatus {
|
|
14
|
+
readonly addon: string;
|
|
15
|
+
readonly slot: PipelineSlot;
|
|
16
|
+
readonly state: 'initializing' | 'ready' | 'running' | 'error';
|
|
17
|
+
readonly error?: string;
|
|
18
|
+
readonly lastRunMs?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface StepError {
|
|
21
|
+
readonly code: string;
|
|
22
|
+
readonly message: string;
|
|
23
|
+
readonly childrenSkipped: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface StepResult {
|
|
26
|
+
readonly addon: string;
|
|
27
|
+
readonly slot: PipelineSlot;
|
|
28
|
+
readonly output: DetectorOutput | CropperOutput | ClassifierOutput | RefinerOutput;
|
|
29
|
+
readonly parentResultId?: string;
|
|
30
|
+
readonly resultId: string;
|
|
31
|
+
readonly inferenceMs: number;
|
|
32
|
+
readonly preprocessMs: number;
|
|
33
|
+
readonly totalMs: number;
|
|
34
|
+
readonly error?: StepError;
|
|
35
|
+
}
|
|
36
|
+
export interface PipelineResult {
|
|
37
|
+
readonly results: readonly StepResult[];
|
|
38
|
+
readonly totalMs: number;
|
|
39
|
+
readonly timings: Readonly<Record<string, number>>;
|
|
40
|
+
readonly frameTimestamp: number;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/types/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEpG,MAAM,MAAM,YAAY,GA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,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BoundingBox } from './io.js';
|
|
2
|
+
import type { SpatialDetection } from './detection.js';
|
|
3
|
+
export type ObjectState = 'entering' | 'moving' | 'stationary' | 'leaving' | 'loitering';
|
|
4
|
+
export interface TrackedDetection extends SpatialDetection {
|
|
5
|
+
readonly trackId: string;
|
|
6
|
+
readonly trackAge: number;
|
|
7
|
+
readonly velocity?: {
|
|
8
|
+
readonly dx: number;
|
|
9
|
+
readonly dy: number;
|
|
10
|
+
};
|
|
11
|
+
readonly path: readonly BoundingBox[];
|
|
12
|
+
}
|
|
13
|
+
export interface TrackedObjectState {
|
|
14
|
+
readonly trackId: string;
|
|
15
|
+
readonly state: ObjectState;
|
|
16
|
+
readonly stationarySince?: number;
|
|
17
|
+
readonly enteredAt: number;
|
|
18
|
+
readonly totalDistancePx: number;
|
|
19
|
+
readonly dwellTimeMs: number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tracked.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracked.d.ts","sourceRoot":"","sources":["../../src/types/tracked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,CAAA;AAExF,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAChE,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAA;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Zone purpose per pipeline stage */
|
|
2
|
+
export type ZoneMode = 'include' | 'exclude' | 'monitor';
|
|
3
|
+
/** Motion event source for a camera */
|
|
4
|
+
export type MotionSource = 'sensor' | 'stream' | 'smart';
|
|
5
|
+
/** A polygon zone with independent motion/detection behavior */
|
|
6
|
+
export interface CameraZone {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** Polygon vertices as fraction of frame (0–1) */
|
|
10
|
+
readonly polygon: readonly {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
}[];
|
|
14
|
+
/** Zone purpose for motion detection stage */
|
|
15
|
+
readonly motionMode: ZoneMode;
|
|
16
|
+
/** Zone purpose for pipeline detection stage */
|
|
17
|
+
readonly detectionMode: ZoneMode;
|
|
18
|
+
/** Minimum overlap fraction (0–1) for bbox/mask to count as "in zone" */
|
|
19
|
+
readonly overlapThreshold: number;
|
|
20
|
+
/** Use segmentation mask for overlap when available (vs bbox only) */
|
|
21
|
+
readonly preferMask: boolean;
|
|
22
|
+
/** Only apply to these detection classes (empty/undefined = all) */
|
|
23
|
+
readonly classFilter?: readonly string[];
|
|
24
|
+
/** Seconds of no movement before emitting stationary alert for this zone */
|
|
25
|
+
readonly stationaryAlertSeconds?: number;
|
|
26
|
+
/** Visual color for UI rendering */
|
|
27
|
+
readonly color: string;
|
|
28
|
+
}
|
|
29
|
+
/** Per-camera zone configuration */
|
|
30
|
+
export interface CameraZoneConfig {
|
|
31
|
+
readonly deviceId: string;
|
|
32
|
+
readonly zones: readonly CameraZone[];
|
|
33
|
+
/** Auto-generate rectangular border exclusion zone */
|
|
34
|
+
readonly autoBorderExclude: {
|
|
35
|
+
readonly enabled: boolean;
|
|
36
|
+
/** Fraction of frame edge to exclude (0–0.2 typical) */
|
|
37
|
+
readonly percent: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Zone membership annotation on a detection */
|
|
41
|
+
export interface DetectionZoneMembership {
|
|
42
|
+
readonly zoneId: string;
|
|
43
|
+
readonly zoneName: string;
|
|
44
|
+
/** Overlap fraction 0–1 */
|
|
45
|
+
readonly overlap: number;
|
|
46
|
+
readonly mode: ZoneMode;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=zones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zones.d.ts","sourceRoot":"","sources":["../../src/types/zones.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAExD,uCAAuC;AACvC,MAAM,MAAM,YAAY,GAAG,QAAQ,GAA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EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosine-similarity.d.ts","sourceRoot":"","sources":["../../src/utils/cosine-similarity.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAYzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hf-url.d.ts","sourceRoot":"","sources":["../../src/utils/hf-url.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "tsup",
|
|
38
|
+
"build": "tsup && tsc --declaration --emitDeclarationOnly --outDir dist --skipLibCheck",
|
|
39
39
|
"dev": "tsup --watch",
|
|
40
40
|
"typecheck": "tsc --noEmit",
|
|
41
41
|
"test": "vitest run",
|
|
42
42
|
"test:watch": "vitest"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@trpc/server": "^11.16.0",
|
|
45
46
|
"tsup": "^8.0.0",
|
|
46
47
|
"typescript": "~5.9.0",
|
|
47
48
|
"vitest": "^3.0.0"
|