@camstack/types 1.2.258 → 1.2.260

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.
Files changed (46) hide show
  1. package/dist/addon.js +12 -2
  2. package/dist/addon.mjs +12 -2
  3. package/dist/capabilities/camera-streams.cap.d.ts +5 -5
  4. package/dist/capabilities/custom-model-registry.cap.d.ts +0 -12
  5. package/dist/capabilities/decoder.cap.d.ts +12 -12
  6. package/dist/capabilities/index.d.ts +3 -3
  7. package/dist/capabilities/load-contribution.cap.d.ts +2 -2
  8. package/dist/capabilities/model-convert.cap.d.ts +0 -6
  9. package/dist/capabilities/model-distributor.cap.d.ts +0 -12
  10. package/dist/capabilities/motion-detection.cap.d.ts +4 -4
  11. package/dist/capabilities/notification-rules.cap.d.ts +572 -18
  12. package/dist/capabilities/osd-manager.cap.d.ts +1 -1
  13. package/dist/capabilities/pipeline-analytics.cap.d.ts +50 -127
  14. package/dist/capabilities/pipeline-executor.cap.d.ts +78 -120
  15. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +16 -64
  16. package/dist/capabilities/pipeline-runner.cap.d.ts +18 -6
  17. package/dist/capabilities/platform-probe.cap.d.ts +4 -13
  18. package/dist/capabilities/recording-export.cap.d.ts +7 -7
  19. package/dist/capabilities/schemas/detection-shared.d.ts +4 -4
  20. package/dist/capabilities/schemas/streaming-shared.d.ts +8 -8
  21. package/dist/capabilities/stream-broker.cap.d.ts +9 -9
  22. package/dist/capabilities/system.cap.d.ts +2 -2
  23. package/dist/capabilities/vacuum-control.cap.d.ts +13 -13
  24. package/dist/capabilities/videoclips.cap.d.ts +5 -5
  25. package/dist/capabilities/webrtc-session.cap.d.ts +2 -2
  26. package/dist/generated/addon-api.d.ts +9 -9
  27. package/dist/generated/cap-input-defaults.d.ts +1 -1
  28. package/dist/generated/method-device-selectors.d.ts +1 -1
  29. package/dist/index.d.ts +4 -2
  30. package/dist/index.js +1785 -1406
  31. package/dist/index.mjs +1770 -1402
  32. package/dist/interfaces/event-bus.d.ts +1 -1
  33. package/dist/interfaces/pipeline-executor-capability.d.ts +15 -6
  34. package/dist/interfaces/platform.d.ts +2 -2
  35. package/dist/interfaces/stream-broker.d.ts +2 -2
  36. package/dist/notification/system-event-summary.d.ts +83 -0
  37. package/dist/notification/template-vars.d.ts +15 -0
  38. package/dist/{sleep-DtomDrRW.js → sleep-BDYxE1ax.js} +1 -1
  39. package/dist/{sleep-DU7mu4wb.mjs → sleep-BaRu0bS5.mjs} +1 -1
  40. package/dist/types/detection.d.ts +18 -0
  41. package/dist/types/models.d.ts +0 -19
  42. package/dist/types/pipeline-step.d.ts +9 -1
  43. package/dist/types/pipeline.d.ts +2 -1
  44. package/dist/utils/background-run-registry.d.ts +69 -0
  45. package/dist/utils/runtime-mapping.d.ts +9 -54
  46. package/package.json +1 -1
@@ -1260,7 +1260,7 @@ export interface EventCatalog {
1260
1260
  readonly engine: PipelineEngineChoice;
1261
1261
  readonly modelsLoaded: readonly string[];
1262
1262
  readonly inUseByCameras: readonly number[];
1263
- readonly kind: 'runtime' | 'warm-override' | 'device-pool';
1263
+ readonly kind: 'runtime' | 'device-pool';
1264
1264
  readonly poolPid: number | null;
1265
1265
  readonly idleMs: number | null;
1266
1266
  readonly idleTtlMs: number | null;
@@ -33,14 +33,12 @@ export interface PipelineStepInput {
33
33
  * - `imageBase64`: one-shot benchmark (ImageTab "Run")
34
34
  * - `referenceImage`: named file from the reference-image store
35
35
  *
36
- * `engine` + `deviceId` are optional contextual hints — the executor uses
37
- * `deviceId` for per-device overrides and traces, and `engine` to select
38
- * the factory (when absent, falls back to the executor's persisted
39
- * selection during the migration window).
36
+ * `deviceId` is an optional contextual hint — the executor uses it for
37
+ * per-device overrides and traces. There is no `engine` (D646): the pool is
38
+ * the node's own engine, or the `deviceKey` pool when one is named.
40
39
  */
41
40
  export interface PipelineRunInput {
42
41
  readonly steps: readonly PipelineStepInput[];
43
- readonly engine?: PipelineEngineChoice;
44
42
  readonly frame?: FrameInput;
45
43
  /** Same-process lazy source; never forwarded over UDS/Moleculer. */
46
44
  readonly frameRef?: FrameRef;
@@ -93,6 +91,16 @@ export interface PipelineRunInput {
93
91
  * mutually-exclusive image inputs. Absent ⇒ tile-crop children.
94
92
  */
95
93
  readonly nativeCropRef?: NativeCropRef;
94
+ /**
95
+ * Offline REPLAY of stored media for `deviceId` (D56, D646). The call runs
96
+ * the camera's structure — its detection-stage zone gate and per-device
97
+ * overrides, exactly as a live frame — over a recorded image, and it is
98
+ * PINNED: every executing step runs the model it names on the `deviceKey`
99
+ * pool it names, or the call refuses (`model-not-servable` /
100
+ * `device-not-servable`) before any pool is touched. Nothing is emitted on
101
+ * the camera's live trace stream. Absent ⇒ unchanged behaviour.
102
+ */
103
+ readonly replay?: true;
96
104
  }
97
105
  /**
98
106
  * Singleton capability provided by the pipeline-executor addon.
@@ -121,6 +129,8 @@ export interface IPipelineExecutorProvider {
121
129
  */
122
130
  validatePipeline(input: {
123
131
  readonly steps: readonly PipelineStepInput[];
132
+ /** Validate against this device pool's format; absent ⇒ the node default. */
133
+ readonly deviceKey?: string;
124
134
  }): Promise<PipelineValidationResult>;
125
135
  /** Get the currently selected engine (bootstrap default on the node). */
126
136
  getSelectedEngine(): Promise<PipelineEngineChoice>;
@@ -172,7 +182,6 @@ export interface IPipelineExecutorProvider {
172
182
  */
173
183
  runPipelineBatch(input: {
174
184
  readonly steps: readonly PipelineStepInput[];
175
- readonly engine?: PipelineEngineChoice;
176
185
  readonly frames: readonly FrameInput[];
177
186
  readonly deviceId?: number;
178
187
  readonly sessionId?: string;
@@ -47,7 +47,7 @@ export interface CoralInfo {
47
47
  }
48
48
  /** A probed backend with availability and score */
49
49
  export interface PlatformScore {
50
- readonly runtime: 'node' | 'python';
50
+ readonly runtime: 'python';
51
51
  readonly backend: string;
52
52
  readonly format: 'onnx' | 'coreml' | 'openvino' | 'tflite';
53
53
  readonly score: number;
@@ -77,7 +77,7 @@ export interface ModelRequirement {
77
77
  /** Resolved config — the tripletta chosen by the scorer for an addon */
78
78
  export interface ResolvedInferenceConfig {
79
79
  readonly modelId: string;
80
- readonly runtime: 'node' | 'python';
80
+ readonly runtime: 'python';
81
81
  readonly backend: string;
82
82
  readonly format: import('../types/models.js').ModelFormat;
83
83
  readonly reason: string;
@@ -18,11 +18,11 @@ export declare const DecoderSessionConfigSchema: z.ZodObject<{
18
18
  codec: z.ZodString;
19
19
  maxFps: z.ZodDefault<z.ZodNumber>;
20
20
  outputFormat: z.ZodDefault<z.ZodEnum<{
21
- rgb: "rgb";
22
- gray: "gray";
23
21
  jpeg: "jpeg";
22
+ rgb: "rgb";
24
23
  bgr: "bgr";
25
24
  yuv420: "yuv420";
25
+ gray: "gray";
26
26
  }>>;
27
27
  scale: z.ZodDefault<z.ZodNumber>;
28
28
  width: z.ZodOptional<z.ZodNumber>;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The STATE SUMMARY delivery of a system-event rule (D647): which rules may use
3
+ * it, and how an editor presents its schedule. One module, read by the hub's
4
+ * save guard, the notification centre's scheduler and both rule editors.
5
+ *
6
+ * A `device-events` or `system` rule may say `systemEventDelivery: { mode:
7
+ * 'summary', schedule }`: it then sends nothing per event, and at the END of
8
+ * each window of `schedule` it sends the current state of its kinds. The alarm
9
+ * stays instant (an alarm summarised at 08:00 is an alarm nobody heard), and a
10
+ * `mixed` rule is read-only (D637), so neither may carry it.
11
+ *
12
+ * Pure: no clock, no I/O.
13
+ */
14
+ import type { NcDelivery, NcRuleActions, NcSchedule, NcSystemEventCondition, NcSystemEventDelivery } from '../capabilities/notification-rules.cap.js';
15
+ import { type NcSystemEventFamily } from './system-event-families.js';
16
+ /** The families a rule may summarise. The alarm is not one of them. */
17
+ export declare const NC_SYSTEM_EVENT_SUMMARY_FAMILIES: readonly NcSystemEventFamily[];
18
+ /** The part of a rule the summary delivery is judged on. */
19
+ export interface NcSystemEventDeliverySubject {
20
+ readonly delivery: NcDelivery;
21
+ readonly conditions: {
22
+ readonly systemEvent?: NcSystemEventCondition;
23
+ };
24
+ readonly systemEventDelivery?: NcSystemEventDelivery;
25
+ readonly schedule?: NcSchedule;
26
+ readonly actions?: NcRuleActions;
27
+ }
28
+ export type NcSystemEventDeliveryProblem = {
29
+ readonly code: 'not-a-system-rule';
30
+ readonly delivery: NcDelivery;
31
+ } | {
32
+ readonly code: 'family-not-summarisable';
33
+ readonly family: NcSystemEventFamily | 'mixed';
34
+ } | {
35
+ readonly code: 'empty-schedule';
36
+ } | {
37
+ readonly code: 'degenerate-window';
38
+ readonly index: number;
39
+ } | {
40
+ readonly code: 'schedule-beside-summary';
41
+ } | {
42
+ readonly code: 'actions-beside-summary';
43
+ };
44
+ /** The summary's schedule, or `null` for any rule that is not a summary system rule. */
45
+ export declare function systemEventSummaryScheduleOf(rule: Pick<NcSystemEventDeliverySubject, 'delivery' | 'systemEventDelivery'>): NcSchedule | null;
46
+ /** Absent and `instant` are the same answer: a notification per event. */
47
+ export declare function isSystemEventSummaryRule(rule: Pick<NcSystemEventDeliverySubject, 'delivery' | 'systemEventDelivery'>): boolean;
48
+ /**
49
+ * Why the hub refuses this rule's delivery. Empty = accepted. An instant rule
50
+ * (absent or `{ mode: 'instant' }`) is never refused here.
51
+ *
52
+ * Beside a summary, two fields are refused because they would do nothing:
53
+ * the rule's own `schedule` (the summary's schedule is the send time; a second
54
+ * active-hours gate would silently empty it) and `actions` (a summary is not a
55
+ * match, so nothing would ever run them).
56
+ */
57
+ export declare function systemEventDeliveryProblems(rule: NcSystemEventDeliverySubject): readonly NcSystemEventDeliveryProblem[];
58
+ export declare function describeSystemEventDeliveryProblem(problem: NcSystemEventDeliveryProblem): string;
59
+ /** One send time as an editor presents it: the days it is sent on, and the minute. */
60
+ export interface NcSummarySendTime {
61
+ readonly days: readonly number[];
62
+ /** Minute of the day, 0–1439. */
63
+ readonly minute: number;
64
+ }
65
+ /**
66
+ * A send time is a ONE-MINUTE window that closes at that minute: the summary is
67
+ * sent when a window ends. Midnight starts the window at 23:59 of the day
68
+ * BEFORE, because a window's `days` are the days it STARTS on.
69
+ */
70
+ export declare function scheduleForSendTimes(times: readonly NcSummarySendTime[], timezone?: string): NcSchedule;
71
+ /**
72
+ * The send times a schedule stands for, or `null` when it is not a list of
73
+ * one-minute windows (an inverted or a longer window): the editor then shows
74
+ * the raw windows and says the summary is sent when each one ENDS.
75
+ */
76
+ export declare function sendTimesOfSchedule(schedule: NcSchedule): readonly NcSummarySendTime[] | null;
77
+ /**
78
+ * Does a custom BODY carry the summary's content (`{{summaryText}}` or a
79
+ * section variable)? A body that does not would send a summary with nothing
80
+ * in it; the hub then appends `{{summaryText}}` and the admin warns (review
81
+ * M3). An absent or blank body uses the hub's own wording, which does.
82
+ */
83
+ export declare function templateCarriesSummary(body: string | undefined): boolean;
@@ -36,6 +36,21 @@ export declare const NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS: readonly NcSystem
36
36
  * rule an installed viewer can author, which is exactly true.
37
37
  */
38
38
  export declare function servedTemplateVars(): NcTemplateVarDescriptor[];
39
+ /**
40
+ * Is this descriptor held back from the SERVED catalog as a whole (D647)?
41
+ * A summary-only variable is: an installed viewer does not read the delivery
42
+ * axis, and would offer it on every instant system rule. The admin, built
43
+ * from the workspace, restores it from its own `NC_TEMPLATE_VARS`.
44
+ */
45
+ export declare function isHeldBackTemplateVar(d: NcTemplateVarDescriptor): boolean;
46
+ /**
47
+ * Does a descriptor have a value on a system rule of this DELIVERY (D647)?
48
+ * Read only for a system rule kind. An absent axis is `instant` for a
49
+ * descriptor that names `systemEventKinds` (a per-event fact: a summary row
50
+ * has no one device, node or package) and BOTH for one that does not
51
+ * (`{{rule}}`, `{{time}}`).
52
+ */
53
+ export declare function templateVarDeliveryApplies(d: NcTemplateVarDescriptor, ctx: NcTemplateVarContext): boolean;
39
54
  /**
40
55
  * Does a descriptor declared for `declared` kinds have a value for a rule of
41
56
  * `kind`?
@@ -3748,6 +3748,7 @@ function createDeviceProxy(api, binding, opts) {
3748
3748
  listDeviceMutes: (input) => dispatch("notification-rules", "notificationRules", "listDeviceMutes", "query", input),
3749
3749
  setDeviceMuted: (input) => dispatch("notification-rules", "notificationRules", "setDeviceMuted", "mutation", input),
3750
3750
  testRule: (input) => dispatch("notification-rules", "notificationRules", "testRule", "mutation", input),
3751
+ previewStateSummary: (input) => dispatch("notification-rules", "notificationRules", "previewStateSummary", "mutation", input),
3751
3752
  getConditionCatalog: (input) => dispatch("notification-rules", "notificationRules", "getConditionCatalog", "query", input),
3752
3753
  getTemplateCatalog: (input) => dispatch("notification-rules", "notificationRules", "getTemplateCatalog", "query", input),
3753
3754
  previewTemplate: (input) => dispatch("notification-rules", "notificationRules", "previewTemplate", "mutation", input),
@@ -3837,7 +3838,6 @@ function createDeviceProxy(api, binding, opts) {
3837
3838
  deselectRetrainFrame: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deselectRetrainFrame", "mutation", input),
3838
3839
  getRetrainFrameImage: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getRetrainFrameImage", "query", input),
3839
3840
  proposeRetrainAnnotations: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "proposeRetrainAnnotations", "mutation", input),
3840
- runReplayFrameProcessor: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "runReplayFrameProcessor", "mutation", input),
3841
3841
  listRetrainAnnotations: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listRetrainAnnotations", "query", input),
3842
3842
  saveRetrainAnnotations: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "saveRetrainAnnotations", "mutation", input),
3843
3843
  completeRetrainTrack: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "completeRetrainTrack", "mutation", input),
@@ -3748,6 +3748,7 @@ function createDeviceProxy(api, binding, opts) {
3748
3748
  listDeviceMutes: (input) => dispatch("notification-rules", "notificationRules", "listDeviceMutes", "query", input),
3749
3749
  setDeviceMuted: (input) => dispatch("notification-rules", "notificationRules", "setDeviceMuted", "mutation", input),
3750
3750
  testRule: (input) => dispatch("notification-rules", "notificationRules", "testRule", "mutation", input),
3751
+ previewStateSummary: (input) => dispatch("notification-rules", "notificationRules", "previewStateSummary", "mutation", input),
3751
3752
  getConditionCatalog: (input) => dispatch("notification-rules", "notificationRules", "getConditionCatalog", "query", input),
3752
3753
  getTemplateCatalog: (input) => dispatch("notification-rules", "notificationRules", "getTemplateCatalog", "query", input),
3753
3754
  previewTemplate: (input) => dispatch("notification-rules", "notificationRules", "previewTemplate", "mutation", input),
@@ -3837,7 +3838,6 @@ function createDeviceProxy(api, binding, opts) {
3837
3838
  deselectRetrainFrame: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "deselectRetrainFrame", "mutation", input),
3838
3839
  getRetrainFrameImage: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "getRetrainFrameImage", "query", input),
3839
3840
  proposeRetrainAnnotations: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "proposeRetrainAnnotations", "mutation", input),
3840
- runReplayFrameProcessor: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "runReplayFrameProcessor", "mutation", input),
3841
3841
  listRetrainAnnotations: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "listRetrainAnnotations", "query", input),
3842
3842
  saveRetrainAnnotations: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "saveRetrainAnnotations", "mutation", input),
3843
3843
  completeRetrainTrack: (input) => dispatch("pipeline-analytics", "pipelineAnalytics", "completeRetrainTrack", "mutation", input),
@@ -412,6 +412,15 @@ export interface ObjectDetection extends DetectionBase {
412
412
  * Present iff the face path cut its aligned crop from a native surface.
413
413
  */
414
414
  readonly nativeFaceShortSidePx?: number;
415
+ /**
416
+ * The five facial landmarks the face detector regressed for THIS `face`
417
+ * detail, in the same absolute pixel space as `bbox` (D644). Only a face
418
+ * detail carries them; never inherited onto the parent.
419
+ */
420
+ readonly landmarks?: readonly {
421
+ readonly x: number;
422
+ readonly y: number;
423
+ }[];
415
424
  }
416
425
  /** Audio detection — flat, time-localised within the window. */
417
426
  export interface AudioDetection extends DetectionBase {
@@ -505,6 +514,15 @@ export interface FrameResult {
505
514
  readonly shed?: true;
506
515
  /** Which bound shed the frame (e.g. `'worker-in-flight-cap'`). Present iff `shed` is. */
507
516
  readonly shedReason?: string;
517
+ /**
518
+ * The model the ROOT detector ACTUALLY ran for this frame — after the
519
+ * executor's format resolution, so a substituted model is named as what
520
+ * ran, not as what was asked (`object-detection` when it runs, else the
521
+ * first enabled root). Stamped by `pipelineExecutor.runPipeline`; absent on
522
+ * a frame no pipeline root produced (a camera's onboard detector). A stored
523
+ * track keeps it so a later replay can name the original model (D646).
524
+ */
525
+ readonly rootModelId?: string;
508
526
  readonly debug?: FrameDebug;
509
527
  }
510
528
  /**
@@ -22,7 +22,6 @@ export declare const ModelFormatEntrySchema: z.ZodObject<{
22
22
  isDirectory: z.ZodOptional<z.ZodBoolean>;
23
23
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
24
24
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
25
- node: "node";
26
25
  python: "python";
27
26
  }>>>>;
28
27
  }, z.core.$strip>;
@@ -50,7 +49,6 @@ export declare const ModelFormatsSchema: z.ZodObject<{
50
49
  isDirectory: z.ZodOptional<z.ZodBoolean>;
51
50
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
52
51
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
53
- node: "node";
54
52
  python: "python";
55
53
  }>>>>;
56
54
  }, z.core.$strip>>;
@@ -60,7 +58,6 @@ export declare const ModelFormatsSchema: z.ZodObject<{
60
58
  isDirectory: z.ZodOptional<z.ZodBoolean>;
61
59
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
62
60
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
63
- node: "node";
64
61
  python: "python";
65
62
  }>>>>;
66
63
  }, z.core.$strip>>;
@@ -70,7 +67,6 @@ export declare const ModelFormatsSchema: z.ZodObject<{
70
67
  isDirectory: z.ZodOptional<z.ZodBoolean>;
71
68
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
72
69
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
73
- node: "node";
74
70
  python: "python";
75
71
  }>>>>;
76
72
  }, z.core.$strip>>;
@@ -80,7 +76,6 @@ export declare const ModelFormatsSchema: z.ZodObject<{
80
76
  isDirectory: z.ZodOptional<z.ZodBoolean>;
81
77
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
82
78
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
83
- node: "node";
84
79
  python: "python";
85
80
  }>>>>;
86
81
  }, z.core.$strip>>;
@@ -90,7 +85,6 @@ export declare const ModelFormatsSchema: z.ZodObject<{
90
85
  isDirectory: z.ZodOptional<z.ZodBoolean>;
91
86
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
92
87
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
93
- node: "node";
94
88
  python: "python";
95
89
  }>>>>;
96
90
  }, z.core.$strip>>;
@@ -100,7 +94,6 @@ export declare const ModelFormatsSchema: z.ZodObject<{
100
94
  isDirectory: z.ZodOptional<z.ZodBoolean>;
101
95
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
102
96
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
103
- node: "node";
104
97
  python: "python";
105
98
  }>>>>;
106
99
  }, z.core.$strip>>;
@@ -164,7 +157,6 @@ export declare const ModelCatalogEntrySchema: z.ZodObject<{
164
157
  isDirectory: z.ZodOptional<z.ZodBoolean>;
165
158
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
166
159
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
167
- node: "node";
168
160
  python: "python";
169
161
  }>>>>;
170
162
  }, z.core.$strip>>;
@@ -174,7 +166,6 @@ export declare const ModelCatalogEntrySchema: z.ZodObject<{
174
166
  isDirectory: z.ZodOptional<z.ZodBoolean>;
175
167
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
176
168
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
177
- node: "node";
178
169
  python: "python";
179
170
  }>>>>;
180
171
  }, z.core.$strip>>;
@@ -184,7 +175,6 @@ export declare const ModelCatalogEntrySchema: z.ZodObject<{
184
175
  isDirectory: z.ZodOptional<z.ZodBoolean>;
185
176
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
186
177
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
187
- node: "node";
188
178
  python: "python";
189
179
  }>>>>;
190
180
  }, z.core.$strip>>;
@@ -194,7 +184,6 @@ export declare const ModelCatalogEntrySchema: z.ZodObject<{
194
184
  isDirectory: z.ZodOptional<z.ZodBoolean>;
195
185
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
196
186
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
197
- node: "node";
198
187
  python: "python";
199
188
  }>>>>;
200
189
  }, z.core.$strip>>;
@@ -204,7 +193,6 @@ export declare const ModelCatalogEntrySchema: z.ZodObject<{
204
193
  isDirectory: z.ZodOptional<z.ZodBoolean>;
205
194
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
206
195
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
207
- node: "node";
208
196
  python: "python";
209
197
  }>>>>;
210
198
  }, z.core.$strip>>;
@@ -214,7 +202,6 @@ export declare const ModelCatalogEntrySchema: z.ZodObject<{
214
202
  isDirectory: z.ZodOptional<z.ZodBoolean>;
215
203
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
216
204
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
217
- node: "node";
218
205
  python: "python";
219
206
  }>>>>;
220
207
  }, z.core.$strip>>;
@@ -411,7 +398,6 @@ export declare const ConvertResultSchema: z.ZodObject<{
411
398
  isDirectory: z.ZodOptional<z.ZodBoolean>;
412
399
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
413
400
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
414
- node: "node";
415
401
  python: "python";
416
402
  }>>>>;
417
403
  }, z.core.$strip>>;
@@ -421,7 +407,6 @@ export declare const ConvertResultSchema: z.ZodObject<{
421
407
  isDirectory: z.ZodOptional<z.ZodBoolean>;
422
408
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
423
409
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
424
- node: "node";
425
410
  python: "python";
426
411
  }>>>>;
427
412
  }, z.core.$strip>>;
@@ -431,7 +416,6 @@ export declare const ConvertResultSchema: z.ZodObject<{
431
416
  isDirectory: z.ZodOptional<z.ZodBoolean>;
432
417
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
433
418
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
434
- node: "node";
435
419
  python: "python";
436
420
  }>>>>;
437
421
  }, z.core.$strip>>;
@@ -441,7 +425,6 @@ export declare const ConvertResultSchema: z.ZodObject<{
441
425
  isDirectory: z.ZodOptional<z.ZodBoolean>;
442
426
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
443
427
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
444
- node: "node";
445
428
  python: "python";
446
429
  }>>>>;
447
430
  }, z.core.$strip>>;
@@ -451,7 +434,6 @@ export declare const ConvertResultSchema: z.ZodObject<{
451
434
  isDirectory: z.ZodOptional<z.ZodBoolean>;
452
435
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
453
436
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
454
- node: "node";
455
437
  python: "python";
456
438
  }>>>>;
457
439
  }, z.core.$strip>>;
@@ -461,7 +443,6 @@ export declare const ConvertResultSchema: z.ZodObject<{
461
443
  isDirectory: z.ZodOptional<z.ZodBoolean>;
462
444
  files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
463
445
  runtimes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
464
- node: "node";
465
446
  python: "python";
466
447
  }>>>>;
467
448
  }, z.core.$strip>>;
@@ -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;
@@ -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
- readonly runtime: 'node' | 'python';
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: 'node'|'python', backend: 'cpu'|'coreml'|'cuda'|...)
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
- * Map a backend ID to the model format it requires.
17
- *
18
- * Node.js backends (cpu, coreml, cuda, tensorrt) all use ONNX format
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
- declare const BACKEND_TO_FORMAT: Readonly<Record<string, ModelFormat>>;
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), distinct from {@link BACKEND_TO_FORMAT}
27
- * above which is the legacy NODE runtime map (where `coreml → onnx` because
28
- * onnxruntime-node's CoreML EP loads `.onnx`). Here a device pool runs the
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 { BACKEND_TO_FORMAT, DEVICE_BACKEND_TO_FORMAT, deviceBackendToFormat, RUNTIME_TO_FORMAT, PYTHON_SCRIPT, };
58
+ export { DEVICE_BACKEND_TO_FORMAT, deviceBackendToFormat, RUNTIME_TO_FORMAT, PYTHON_SCRIPT };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.258",
3
+ "version": "1.2.260",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",