@camstack/types 0.1.1 → 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 -3053
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +377 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +369 -7
- 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 +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 +16 -5
- package/dist/index.d.mts +0 -3053
|
@@ -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;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE;QAAE,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E,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,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAA;AAE5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,cAAc,CAAC,EAAE,Q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AQ,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,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExD,gEAAgE;AAChE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,SAAS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tD,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,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"camstack",
|
|
7
|
+
"types",
|
|
8
|
+
"typescript",
|
|
9
|
+
"camera",
|
|
10
|
+
"detection",
|
|
11
|
+
"nvr"
|
|
12
|
+
],
|
|
6
13
|
"license": "MIT",
|
|
7
14
|
"repository": {
|
|
8
15
|
"type": "git",
|
|
@@ -21,17 +28,21 @@
|
|
|
21
28
|
"import": "./dist/catalogs/index.mjs",
|
|
22
29
|
"require": "./dist/catalogs/index.js",
|
|
23
30
|
"types": "./dist/catalogs/index.d.ts"
|
|
24
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
25
33
|
},
|
|
26
|
-
"files": [
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
27
37
|
"scripts": {
|
|
28
|
-
"build": "tsup",
|
|
38
|
+
"build": "tsup && tsc --declaration --emitDeclarationOnly --outDir dist --skipLibCheck",
|
|
29
39
|
"dev": "tsup --watch",
|
|
30
40
|
"typecheck": "tsc --noEmit",
|
|
31
41
|
"test": "vitest run",
|
|
32
42
|
"test:watch": "vitest"
|
|
33
43
|
},
|
|
34
44
|
"devDependencies": {
|
|
45
|
+
"@trpc/server": "^11.16.0",
|
|
35
46
|
"tsup": "^8.0.0",
|
|
36
47
|
"typescript": "~5.9.0",
|
|
37
48
|
"vitest": "^3.0.0"
|