@camstack/types 1.2.259 → 1.2.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon/base-addon.d.ts +9 -1
- package/dist/addon.js +15 -7
- package/dist/addon.mjs +15 -7
- package/dist/capabilities/camera-streams.cap.d.ts +5 -5
- package/dist/capabilities/capability-definition.d.ts +9 -0
- package/dist/capabilities/custom-model-registry.cap.d.ts +18 -12
- package/dist/capabilities/decoder.cap.d.ts +12 -12
- package/dist/capabilities/device-extension.cap.d.ts +370 -0
- package/dist/capabilities/device-manager.cap.d.ts +45 -5
- package/dist/capabilities/doorbell.cap.d.ts +41 -0
- package/dist/capabilities/embedding-encoder.cap.d.ts +175 -0
- package/dist/capabilities/index.d.ts +17 -14
- package/dist/capabilities/llm-runtime.cap.d.ts +4 -4
- package/dist/capabilities/llm-shared.d.ts +6 -6
- package/dist/capabilities/llm.cap.d.ts +6 -6
- package/dist/capabilities/load-contribution.cap.d.ts +2 -2
- package/dist/capabilities/model-convert.cap.d.ts +9 -6
- package/dist/capabilities/model-distributor.cap.d.ts +18 -12
- package/dist/capabilities/motion-detection.cap.d.ts +4 -4
- package/dist/capabilities/notification-rules.cap.d.ts +603 -31
- package/dist/capabilities/osd-manager.cap.d.ts +7 -7
- package/dist/capabilities/pipeline-analytics.cap.d.ts +130 -129
- package/dist/capabilities/pipeline-executor.cap.d.ts +78 -120
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +78 -65
- package/dist/capabilities/pipeline-runner.cap.d.ts +30 -6
- package/dist/capabilities/platform-probe.cap.d.ts +4 -13
- package/dist/capabilities/recording-export.cap.d.ts +7 -7
- package/dist/capabilities/schemas/detection-shared.d.ts +4 -4
- package/dist/capabilities/schemas/streaming-shared.d.ts +8 -8
- package/dist/capabilities/stream-broker.cap.d.ts +9 -9
- package/dist/capabilities/system.cap.d.ts +2 -2
- package/dist/capabilities/vacuum-control.cap.d.ts +13 -13
- package/dist/capabilities/vector-store.cap.d.ts +14 -0
- package/dist/capabilities/videoclips.cap.d.ts +5 -5
- package/dist/capabilities/webrtc-session.cap.d.ts +2 -2
- package/dist/device-extension/index.d.ts +3 -0
- package/dist/device-extension/slot-descriptor.d.ts +62 -0
- package/dist/device-extension/slot-provider.d.ts +68 -0
- package/dist/generated/addon-api.d.ts +59 -9
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/device-proxy.d.ts +7 -7
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/extension-slots.d.ts +39 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +4 -2
- package/dist/index.d.ts +8 -3
- package/dist/index.js +3125 -1792
- package/dist/index.mjs +3049 -1788
- package/dist/interfaces/addon.d.ts +41 -0
- package/dist/interfaces/event-bus.d.ts +11 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts +15 -6
- package/dist/interfaces/platform.d.ts +2 -2
- package/dist/interfaces/stream-broker.d.ts +2 -2
- package/dist/node.d.ts +1 -0
- package/dist/node.js +73 -7
- package/dist/node.mjs +73 -8
- package/dist/notification/system-event-summary.d.ts +83 -0
- package/dist/notification/template-vars.d.ts +15 -0
- package/dist/pipeline/cluster-model-scope.d.ts +59 -3
- package/dist/{sleep-DU7mu4wb.mjs → sleep-BXv0ZcRa.mjs} +49 -33
- package/dist/{sleep-DtomDrRW.js → sleep-QxyLiUId.js} +54 -32
- package/dist/storage/atomic-write.d.ts +25 -0
- package/dist/types/clip-model.d.ts +64 -0
- package/dist/types/detection.d.ts +9 -0
- package/dist/types/models.d.ts +18 -19
- package/dist/types/pipeline-step.d.ts +9 -1
- package/dist/types/pipeline.d.ts +2 -1
- package/dist/utils/background-run-registry.d.ts +69 -0
- package/dist/utils/runtime-mapping.d.ts +9 -54
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ export interface IPipelineStep {
|
|
|
13
13
|
readonly definition: StepDefinition;
|
|
14
14
|
getConfigSchema(): readonly ConfigField[];
|
|
15
15
|
}
|
|
16
|
-
export type PostprocessorType = 'yolo' | 'ssd' | 'rfdetr' | 'yolonas' | 'yolo-seg' | 'scrfd' | 'arcface' | 'clip' | 'softmax' | 'ctc' | 'plate-slots' | 'saliency' | 'yamnet';
|
|
16
|
+
export type PostprocessorType = 'yolo' | 'ssd' | 'rfdetr' | 'yolonas' | 'yolo-seg' | 'scrfd' | 'yunet' | 'arcface' | 'clip' | 'softmax' | 'ctc' | 'plate-slots' | 'saliency' | 'yamnet';
|
|
17
17
|
export interface StepDefinition {
|
|
18
18
|
/** Unique step identifier (e.g., 'object-detection', 'face-detection') */
|
|
19
19
|
readonly id: string;
|
|
@@ -350,9 +350,17 @@ export type TraceVerbosity = 'off' | 'summary' | 'full';
|
|
|
350
350
|
* and served per-track via a separate detail-subtree call instead.
|
|
351
351
|
*/
|
|
352
352
|
export type PipelineExecutionPlane = 'full' | 'frame';
|
|
353
|
+
/**
|
|
354
|
+
* Why a frame is being run. `'replay'` is a session replay (D646): the camera's
|
|
355
|
+
* own tree over STORED pixels. Its log lines say so, and its drop sampling is
|
|
356
|
+
* kept apart from the live camera's — a replay must never use up the live
|
|
357
|
+
* first-example budget or read as a live line. Absent = `'live'`.
|
|
358
|
+
*/
|
|
359
|
+
export type PipelineRunOccasion = 'live' | 'replay';
|
|
353
360
|
export interface PipelineRunOptions {
|
|
354
361
|
readonly traceVerbosity?: TraceVerbosity;
|
|
355
362
|
readonly plane?: PipelineExecutionPlane;
|
|
363
|
+
readonly occasion?: PipelineRunOccasion;
|
|
356
364
|
}
|
|
357
365
|
export interface StepTrace {
|
|
358
366
|
readonly stepId: string;
|
package/dist/types/pipeline.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export type PipelineSlot = 'detector' | 'cropper' | 'classifier' | 'refiner' | '
|
|
|
6
6
|
* User picks this; all pipeline steps run within it.
|
|
7
7
|
*/
|
|
8
8
|
export interface PipelineEngineChoice {
|
|
9
|
-
|
|
9
|
+
/** Every model runs in a Python pool; the `'node'` runtime is gone. */
|
|
10
|
+
readonly runtime: 'python';
|
|
10
11
|
readonly backend: string;
|
|
11
12
|
readonly format: ModelFormat;
|
|
12
13
|
/** Target hardware device within the backend (e.g., 'cpu', 'gpu', 'npu', 'ane', 'auto', 'all') */
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start-then-poll for work that outlives one request.
|
|
3
|
+
*
|
|
4
|
+
* An addon's custom action rides the UDS addon-call plane, whose request
|
|
5
|
+
* timeout is 60 s (`DEFAULT_UDS_REQUEST_TIMEOUT_MS`) and which a custom action
|
|
6
|
+
* cannot raise. A run longer than that used to be ABANDONED by its caller
|
|
7
|
+
* while it kept running — the capacity ramp moved to fire-and-poll for exactly
|
|
8
|
+
* that reason, and every other long benchmark run had to follow (D646). This is
|
|
9
|
+
* the one shape they share: `start` validates nothing about the work itself, it
|
|
10
|
+
* registers it, answers at once with a `running` receipt, and the caller polls
|
|
11
|
+
* `status` for progress and, eventually, the result or the named failure.
|
|
12
|
+
*
|
|
13
|
+
* In RAM on purpose. A run belongs to the process that runs it; a restart ends
|
|
14
|
+
* it, and a finished run's result is the caller's to persist if it matters.
|
|
15
|
+
* The registry keeps a BOUNDED number of finished runs so a page reopened after
|
|
16
|
+
* the run ended can still read it, and it never drops a run that is still
|
|
17
|
+
* going.
|
|
18
|
+
*/
|
|
19
|
+
/** Where a run is. `aborted` keeps whatever result the work returned after the signal. */
|
|
20
|
+
export type BackgroundRunState = 'running' | 'done' | 'failed' | 'aborted';
|
|
21
|
+
export interface BackgroundRunStatus<TProgress, TResult> {
|
|
22
|
+
readonly runId: string;
|
|
23
|
+
readonly state: BackgroundRunState;
|
|
24
|
+
readonly startedAtMs: number;
|
|
25
|
+
/** `null` while running. */
|
|
26
|
+
readonly finishedAtMs: number | null;
|
|
27
|
+
/** The last progress the work reported; `null` until it reports any. */
|
|
28
|
+
readonly progress: TProgress | null;
|
|
29
|
+
/** Present once the work resolved (`done`, or `aborted` with what it had). */
|
|
30
|
+
readonly result: TResult | null;
|
|
31
|
+
/** The failure, verbatim — present iff `state === 'failed'`. */
|
|
32
|
+
readonly error: string | null;
|
|
33
|
+
}
|
|
34
|
+
/** What the work receives: how to be told to stop, and how to say how far it got. */
|
|
35
|
+
export interface BackgroundRunContext<TProgress> {
|
|
36
|
+
readonly signal: AbortSignal;
|
|
37
|
+
report(progress: TProgress): void;
|
|
38
|
+
}
|
|
39
|
+
export interface BackgroundRunRegistryOptions<TProgress, TResult> {
|
|
40
|
+
/** Runs allowed at once. A start beyond it is REFUSED, never queued. */
|
|
41
|
+
readonly maxConcurrent: number;
|
|
42
|
+
/** Finished runs remembered for a late poll. */
|
|
43
|
+
readonly keepFinished: number;
|
|
44
|
+
readonly now?: () => number;
|
|
45
|
+
/** Called once per run when it leaves `running` — the caller's hook to log or persist. */
|
|
46
|
+
readonly onSettled?: (status: BackgroundRunStatus<TProgress, TResult>) => void;
|
|
47
|
+
}
|
|
48
|
+
export declare class BackgroundRunRegistry<TProgress, TResult> {
|
|
49
|
+
private readonly opts;
|
|
50
|
+
private readonly runs;
|
|
51
|
+
private readonly now;
|
|
52
|
+
constructor(opts: BackgroundRunRegistryOptions<TProgress, TResult>);
|
|
53
|
+
/** Runs still going. */
|
|
54
|
+
get runningCount(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Register and start `work`. Returns the `running` receipt immediately.
|
|
57
|
+
* Throws only for a refusal the caller must see (duplicate id, busy) — a
|
|
58
|
+
* failure of the work itself lands in `status`, never here.
|
|
59
|
+
*/
|
|
60
|
+
start(runId: string, work: (ctx: BackgroundRunContext<TProgress>) => Promise<TResult>): BackgroundRunStatus<TProgress, TResult>;
|
|
61
|
+
status(runId: string): BackgroundRunStatus<TProgress, TResult> | null;
|
|
62
|
+
/** Running runs first (newest start first), then finished ones (newest finish first). */
|
|
63
|
+
list(): readonly BackgroundRunStatus<TProgress, TResult>[];
|
|
64
|
+
/** Signal a running run to stop. `false` for an unknown or already finished run. */
|
|
65
|
+
abort(runId: string): boolean;
|
|
66
|
+
/** Abort every running run (shutdown). */
|
|
67
|
+
abortAll(): void;
|
|
68
|
+
private prune;
|
|
69
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Canonical runtime/backend/format mapping utilities.
|
|
3
3
|
*
|
|
4
4
|
* This is the SINGLE SOURCE OF TRUTH for mapping between:
|
|
5
|
-
* - Pipeline config (runtime: '
|
|
5
|
+
* - Pipeline config (runtime: 'python', backend: 'cpu'|'coreml'|'openvino'|...)
|
|
6
6
|
* - DetectionRuntime ('onnx'|'coreml'|'pytorch'|'openvino'|'tflite')
|
|
7
7
|
* - ModelFormat ('onnx'|'coreml'|'openvino'|'tflite'|'pt')
|
|
8
8
|
*
|
|
@@ -10,22 +10,17 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { ModelFormat } from '../types/models.js';
|
|
12
12
|
import type { DetectionRuntime } from '../types/config.js';
|
|
13
|
-
/** Pipeline-level runtime: 'node' (ONNX Runtime in Node.js) or 'python' (Python inference) */
|
|
14
|
-
export type PipelineRuntime = 'node' | 'python';
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* because onnxruntime-node loads .onnx and uses execution providers internally.
|
|
20
|
-
*
|
|
21
|
-
* Python backends use their native format.
|
|
14
|
+
* Pipeline-level runtime. Only `'python'`: every model runs in a Python pool.
|
|
15
|
+
* The `'node'` runtime (onnxruntime-node in the addon process) is gone, and
|
|
16
|
+
* with it the node-backend → format map that turned `coreml` into `.onnx`.
|
|
22
17
|
*/
|
|
23
|
-
|
|
18
|
+
export type PipelineRuntime = 'python';
|
|
24
19
|
/**
|
|
25
20
|
* DEVICE-POOL backend → model format — the SSOT for the multi-device inference
|
|
26
|
-
* DESCRIPTOR path (Python per-device pools),
|
|
27
|
-
*
|
|
28
|
-
* onnxruntime-node's CoreML EP
|
|
21
|
+
* DESCRIPTOR path (Python per-device pools), distinct from the former BACKEND_TO_FORMAT,
|
|
22
|
+
* which was the removed NODE runtime map (where `coreml → onnx` because
|
|
23
|
+
* onnxruntime-node's CoreML EP loaded `.onnx`). A device pool runs the
|
|
29
24
|
* backend NATIVELY, so `coreml → coreml` and `edgetpu → tflite`. Consumed by
|
|
30
25
|
* `resolveDeviceEngine` (addon-pipeline) and the orchestrator's
|
|
31
26
|
* `parseDeviceKey`/`getNodeInferenceDevices` — the previously-duplicated
|
|
@@ -46,46 +41,6 @@ declare const RUNTIME_TO_FORMAT: Readonly<Record<DetectionRuntime, ModelFormat>>
|
|
|
46
41
|
* Map a Python backend to the Python inference script name.
|
|
47
42
|
*/
|
|
48
43
|
declare const PYTHON_SCRIPT: Readonly<Record<string, string>>;
|
|
49
|
-
/**
|
|
50
|
-
* Resolve pipeline config (runtime + backend) to a DetectionRuntime.
|
|
51
|
-
*
|
|
52
|
-
* Pipeline config uses two levels:
|
|
53
|
-
* runtime: 'node' | 'python'
|
|
54
|
-
* backend: 'cpu' | 'coreml' | 'cuda' | 'openvino' | 'pytorch' | ...
|
|
55
|
-
*
|
|
56
|
-
* Addons expect a DetectionRuntime:
|
|
57
|
-
* 'onnx' | 'coreml' | 'pytorch' | 'openvino' | 'tflite'
|
|
58
|
-
*
|
|
59
|
-
* Mapping rules:
|
|
60
|
-
* node + any backend → 'onnx' (onnxruntime-node handles backend via EP)
|
|
61
|
-
* python + coreml → 'coreml' (native .mlpackage via coremltools)
|
|
62
|
-
* python + openvino → 'openvino'
|
|
63
|
-
* python + pytorch → 'pytorch'
|
|
64
|
-
* python + onnx-py → 'onnx'
|
|
65
|
-
* python + <other> → backend as-is
|
|
66
|
-
*/
|
|
67
|
-
export declare function resolveDetectionRuntime(pipelineRuntime: PipelineRuntime | string, backend: string): DetectionRuntime;
|
|
68
|
-
/**
|
|
69
|
-
* Resolve pipeline config (runtime + backend) to a ModelFormat.
|
|
70
|
-
*
|
|
71
|
-
* Determines which model file format is needed (.onnx, .mlpackage, etc.)
|
|
72
|
-
*/
|
|
73
|
-
export declare function resolveModelFormat(pipelineRuntime: PipelineRuntime | string, backend: string): ModelFormat;
|
|
74
|
-
/**
|
|
75
|
-
* Resolve pipeline runtime string to 'auto' | DetectionRuntime for addon consumption.
|
|
76
|
-
* Used when building addon addonConfig from pipeline step config.
|
|
77
|
-
*
|
|
78
|
-
* 'python' + 'coreml' → 'coreml'
|
|
79
|
-
* 'node' + 'coreml' → 'onnx'
|
|
80
|
-
* 'node' + 'cpu' → 'onnx'
|
|
81
|
-
* 'auto' → 'auto'
|
|
82
|
-
*/
|
|
83
|
-
export declare function resolveAddonRuntime(pipelineRuntime: string | undefined, backend: string | undefined): DetectionRuntime | 'auto';
|
|
84
|
-
/**
|
|
85
|
-
* Get the model format needed for a given backend.
|
|
86
|
-
* Convenience wrapper for backend-only lookup (e.g., UI components).
|
|
87
|
-
*/
|
|
88
|
-
export declare function formatForBackend(backend: string): ModelFormat;
|
|
89
44
|
/**
|
|
90
45
|
* Get the model format for a given DetectionRuntime.
|
|
91
46
|
*/
|
|
@@ -100,4 +55,4 @@ export declare function pythonScriptForBackend(backend: string): string | undefi
|
|
|
100
55
|
* 'coreml', 'pytorch', 'openvino' need Python; 'onnx' and 'tflite' don't.
|
|
101
56
|
*/
|
|
102
57
|
export declare function requiresPython(runtime: DetectionRuntime | string): boolean;
|
|
103
|
-
export {
|
|
58
|
+
export { DEVICE_BACKEND_TO_FORMAT, deviceBackendToFormat, RUNTIME_TO_FORMAT, PYTHON_SCRIPT };
|