@camstack/types 1.2.403 → 1.2.405

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 (47) hide show
  1. package/dist/addon.js +2 -2
  2. package/dist/addon.mjs +2 -2
  3. package/dist/capabilities/index.d.ts +4 -3
  4. package/dist/capabilities/pipeline-analytics.cap.d.ts +27 -0
  5. package/dist/capabilities/pipeline-executor.cap.d.ts +0 -64
  6. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +68 -124
  7. package/dist/capabilities/platform-probe.cap.d.ts +34 -0
  8. package/dist/capabilities/schemas/package-llm-verdict.d.ts +14 -0
  9. package/dist/capabilities/schemas/zone-rule.d.ts +4 -0
  10. package/dist/capabilities/training.cap.d.ts +91 -71
  11. package/dist/capabilities/zone-rules.cap.d.ts +10 -0
  12. package/dist/client.js +2 -8
  13. package/dist/client.mjs +2 -8
  14. package/dist/enums/event-category.d.ts +2 -3
  15. package/dist/enums.js +1 -1
  16. package/dist/enums.mjs +1 -1
  17. package/dist/{event-category-7AwNbPjm.js → event-category-CXrwjC3e.js} +2 -3
  18. package/dist/{event-category-BfJwUd2S.mjs → event-category-fDPduoeC.mjs} +2 -3
  19. package/dist/generated/addon-api.d.ts +14 -56
  20. package/dist/generated/device-proxy.d.ts +1 -1
  21. package/dist/generated/method-access-map.d.ts +1 -1
  22. package/dist/generated/method-device-selectors.d.ts +2 -2
  23. package/dist/generated/system-proxy.d.ts +3 -3
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.js +2250 -1529
  26. package/dist/index.mjs +2197 -1528
  27. package/dist/interfaces/birth-decision-ledger.d.ts +3 -0
  28. package/dist/interfaces/pipeline-executor-capability.d.ts +2 -8
  29. package/dist/interfaces/platform.d.ts +7 -0
  30. package/dist/node-color.d.ts +1 -1
  31. package/dist/pipeline/auto-tune/accelerator-compute.d.ts +116 -0
  32. package/dist/pipeline/auto-tune/detector-performance.d.ts +5 -0
  33. package/dist/pipeline/auto-tune/hardware-class.d.ts +5 -4
  34. package/dist/pipeline/auto-tune/index.d.ts +1 -0
  35. package/dist/pipeline/auto-tune/plan-schemas.d.ts +108 -80
  36. package/dist/pipeline/auto-tune/recommend.d.ts +31 -9
  37. package/dist/pipeline/second-pass/index.d.ts +2 -0
  38. package/dist/pipeline/second-pass/motion-crop-plan.d.ts +183 -0
  39. package/dist/pipeline/second-pass/small-subject-recovery.d.ts +216 -0
  40. package/dist/pipeline/step-settings-layers.d.ts +7 -8
  41. package/dist/{sleep-Ch67uumJ.js → sleep-BKS4OPMo.js} +1 -4
  42. package/dist/{sleep-6AqUnQIT.mjs → sleep-CHIEEJkY.mjs} +1 -4
  43. package/dist/types/agent-pipeline-settings.d.ts +37 -70
  44. package/dist/types/camera-pipeline.d.ts +2 -2
  45. package/dist/types/detection.d.ts +15 -5
  46. package/dist/types/pipeline-step.d.ts +0 -16
  47. package/package.json +1 -1
@@ -121,6 +121,9 @@ export declare const BirthDecisionRecordSchema: z.ZodObject<{
121
121
  decidedByBirthEvidence: z.ZodBoolean;
122
122
  bestScore: z.ZodNullable<z.ZodNumber>;
123
123
  appliedMinConfidence: z.ZodNullable<z.ZodNumber>;
124
+ detectorModelId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
125
+ detectorDeviceKey: z.ZodDefault<z.ZodNullable<z.ZodString>>;
126
+ detectorNodeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
124
127
  firstSeen: z.ZodNullable<z.ZodNumber>;
125
128
  motionOnsetAt: z.ZodNullable<z.ZodNumber>;
126
129
  birthLatencyMs: z.ZodNullable<z.ZodNumber>;
@@ -1,6 +1,6 @@
1
- import type { PipelineEngineChoice, PipelineConfig } from '../types/pipeline.js';
1
+ import type { PipelineEngineChoice } from '../types/pipeline.js';
2
2
  import type { PipelineExecutionPlane } from '../types/pipeline-step.js';
3
- import type { PipelineSchema, PipelineDefaultStep } from '../types/pipeline-schema.js';
3
+ import type { PipelineSchema } from '../types/pipeline-schema.js';
4
4
  import type { ModelFormat } from '../types/models.js';
5
5
  import type { FrameInput } from '../types/io.js';
6
6
  import type { FrameRef } from '../types/frame-view.js';
@@ -112,12 +112,6 @@ export interface IPipelineExecutorProvider {
112
112
  getSchema(engine?: PipelineEngineChoice): Promise<PipelineSchema>;
113
113
  /** Get all available engines probed on this agent */
114
114
  getAvailableEngines(): Promise<PipelineEngineChoice[]>;
115
- /** Build default step tree for an engine */
116
- getDefaultSteps(engine: PipelineEngineChoice): Promise<PipelineDefaultStep[]>;
117
- /** Compute this node's hardware-aware default step tree (null when the catalog yields no steps). */
118
- getGlobalSteps(): Promise<PipelineDefaultStep[] | null>;
119
- /** Get the runner-ready pipeline config */
120
- getGlobalPipelineConfig(): Promise<PipelineConfig | null>;
121
115
  /**
122
116
  * Gate B (pre-init config-correctness gate). PURE COMPUTE against this
123
117
  * node's `currentEngine.format` — resolves `steps` the same way the
@@ -1,4 +1,5 @@
1
1
  import type { InferenceDeviceDescriptor } from '../inference/runtime-capabilities.js';
2
+ import type { AcceleratorCompute } from '../pipeline/auto-tune/accelerator-compute.js';
2
3
  /** Hardware information detected at boot */
3
4
  export interface HardwareInfo {
4
5
  readonly platform: 'darwin' | 'linux' | 'win32';
@@ -9,6 +10,12 @@ export interface HardwareInfo {
9
10
  readonly availableRAM_MB: number;
10
11
  readonly gpu: GpuInfo | null;
11
12
  readonly npu: NpuInfo | null;
13
+ /**
14
+ * Per-accelerator compute the probe reported (D930). Absent when the probe
15
+ * did not run; an empty list means it ran and found no accelerator. A
16
+ * failed field inside an entry is null, never 0.
17
+ */
18
+ readonly accelerators?: readonly AcceleratorCompute[];
12
19
  /**
13
20
  * Coral Edge TPU hardware (USB and/or PCIe), when found. Optional so existing
14
21
  * HardwareInfo construction sites and older cross-node probe reports stay
@@ -1,7 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  /** Fixed cluster node palette ids (maps to `--color-node-*` theme tokens). */
3
3
  export declare const NODE_COLOR_IDS: readonly ['node-a', 'node-b', 'node-c', 'node-d', 'node-e', 'node-f', 'node-g', 'node-h'];
4
- export type NodeColorId = (typeof NODE_COLOR_IDS)[number];
5
4
  export declare const NodeColorIdSchema: z.ZodEnum<{
6
5
  "node-a": "node-a";
7
6
  "node-b": "node-b";
@@ -12,4 +11,5 @@ export declare const NodeColorIdSchema: z.ZodEnum<{
12
11
  "node-g": "node-g";
13
12
  "node-h": "node-h";
14
13
  }>;
14
+ export type NodeColorId = z.infer<typeof NodeColorIdSchema>;
15
15
  export declare function assignNodeColorId(nodeId: string): NodeColorId;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Capacity of an accelerator we have not measured (D930).
3
+ *
4
+ * The latency table stays the measured columns. A device that reports compute
5
+ * (OpenVINO GOPS, or execution units × clock, or compute units, or TOPS) is
6
+ * estimated from the nearest measured column of the same accelerator kind,
7
+ * scaled by the compute ratio and clamped. A node benchmark still replaces
8
+ * the estimate. A device that reports neither compute nor a known class stays
9
+ * `unknown`.
10
+ *
11
+ * A failed probe field is `null`, never `0` (D393): zero would be a compute
12
+ * ratio of zero and would size the device as if it could not run.
13
+ */
14
+ import { z } from 'zod';
15
+ import type { AcceleratorKind, HardwareClassId } from './plan-schemas.js';
16
+ import { type DetectorLatencyColumn, type DetectorPerfTable } from './detector-performance.js';
17
+ /**
18
+ * An unmeasured device is never estimated outside this band of its reference.
19
+ *
20
+ * Peak GOPS and detector latency do not move together: a 640 model is memory
21
+ * bound, a 320 model less so, and the N100→N305 public EU×clock ratio is
22
+ * about 2.2×. 2× is the widest that spread justifies without a measurement
23
+ * on the device; 0.5× is the symmetric floor so a tiny iGPU is not told it
24
+ * is many times slower than the weakest column we measured. A node benchmark
25
+ * replaces the estimate and is not clamped.
26
+ */
27
+ export declare const ESTIMATE_COMPUTE_RATIO_MIN = 0.5;
28
+ export declare const ESTIMATE_COMPUTE_RATIO_MAX = 2;
29
+ /**
30
+ * Within this of 1.0, a device whose class IS the reference is that measured
31
+ * machine (a probe clock a few percent off the spec), not a different chip.
32
+ * An unknown class is still estimated, so the plan says so.
33
+ */
34
+ export declare const REFERENCE_MATCH_FRACTION = 0.05;
35
+ /** N100 iGPU: 24 execution units, 750 MHz graphics max (Intel specification). */
36
+ export declare const N100_IGPU_EU = 24;
37
+ export declare const N100_IGPU_CLOCK_MHZ = 750;
38
+ /**
39
+ * Core Ultra 7 265K iGPU: 4 Xe-cores. OpenVINO's execution-unit count for
40
+ * Xe-LP is 16 per Xe-core, and the graphics max dynamic frequency is 2000 MHz.
41
+ * Used only to choose the nearest column for a chip that is not itself a
42
+ * Core Ultra — that class is the measurement and is never scaled.
43
+ */
44
+ export declare const CORE_ULTRA_265K_IGPU_EU = 64;
45
+ export declare const CORE_ULTRA_265K_IGPU_CLOCK_MHZ = 2000;
46
+ /** Phoenix / Hawk Point Radeon 780M: 12 compute units. */
47
+ export declare const PHOENIX_780M_CU = 12;
48
+ export declare const PrecisionGopsSchema: z.ZodObject<{
49
+ int8: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
50
+ fp16: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
51
+ }, z.core.$strip>;
52
+ export type PrecisionGops = z.infer<typeof PrecisionGopsSchema>;
53
+ /** What one accelerator device reported. Every failed query is null. */
54
+ export declare const AcceleratorComputeSchema: z.ZodObject<{
55
+ deviceKey: z.ZodString;
56
+ fullDeviceName: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
57
+ executionUnits: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
58
+ clockMHz: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
59
+ gops: z.ZodNullable<z.ZodObject<{
60
+ int8: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
61
+ fp16: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
62
+ }, z.core.$strip>>;
63
+ architecture: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
64
+ npuName: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
65
+ tops: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
66
+ vendor: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
67
+ webgpuArchitecture: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
68
+ webgpuDevice: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
69
+ computeUnits: z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | null, number | null>>;
70
+ }, z.core.$strip>;
71
+ export type AcceleratorCompute = z.infer<typeof AcceleratorComputeSchema>;
72
+ /** The unit a compute ratio is taken in. Two scores of different units are not compared. */
73
+ export type ComputeMetric = 'gops-int8' | 'gops-fp16' | 'eu-mhz' | 'cu' | 'tops';
74
+ export interface ComputeScore {
75
+ readonly metric: ComputeMetric;
76
+ readonly value: number;
77
+ }
78
+ /** The compute of one measured column, in the unit the probe reports. */
79
+ export interface ReferenceCompute {
80
+ readonly hardwareClass: HardwareClassId;
81
+ readonly accelerator: AcceleratorKind;
82
+ readonly score: ComputeScore;
83
+ }
84
+ /**
85
+ * Compute of the machines the latency columns were measured on.
86
+ * GOPS is preferred when a column carries it; none of these do yet — the
87
+ * boxes were measured before the probe reported `DEVICE_GOPS` — so the scale
88
+ * uses execution units × clock (Intel) or compute units (AMD) until a
89
+ * re-measure locks a GOPS figure on the column.
90
+ */
91
+ export declare const REFERENCE_COMPUTE: readonly ReferenceCompute[];
92
+ export interface ResolveLatencyInput {
93
+ readonly hardwareClass: HardwareClassId;
94
+ readonly accelerator: AcceleratorKind;
95
+ readonly report: AcceleratorCompute | null;
96
+ readonly perf?: DetectorPerfTable;
97
+ readonly references?: readonly ReferenceCompute[];
98
+ }
99
+ export interface ResolvedLatencyColumn {
100
+ readonly column: DetectorLatencyColumn;
101
+ /** Null when the column is the measurement itself. */
102
+ readonly estimatedFrom: HardwareClassId | null;
103
+ }
104
+ /** Parse a probe payload. `null` means the probe failed — not "no accelerators". */
105
+ export declare function parseAcceleratorFactsJson(raw: unknown): readonly AcceleratorCompute[] | null;
106
+ /** Scores in the order the estimate prefers. A non-positive field is absent. */
107
+ export declare function computeScores(report: AcceleratorCompute): readonly ComputeScore[];
108
+ /** True when this report can scale a measured column of `kind`. */
109
+ export declare function reportIsScalable(report: AcceleratorCompute, kind: AcceleratorKind, references?: readonly ReferenceCompute[]): boolean;
110
+ /**
111
+ * The latency column for one device. A measured class other than the N-series
112
+ * spread is returned unchanged — one class there is one measured machine.
113
+ * `intel-n-series` is the N100 column; a different reported compute scales it.
114
+ * An unknown class scales from the nearest reference of the same kind.
115
+ */
116
+ export declare function resolveLatencyColumn(input: ResolveLatencyInput): ResolvedLatencyColumn | null;
@@ -21,6 +21,11 @@ export interface DetectorLatencyCell {
21
21
  readonly fps: number;
22
22
  /** False for a cell derived from another column (scaled), not measured. */
23
23
  readonly measured: boolean;
24
+ /**
25
+ * Set when this cell was scaled from another class's measured column (D930).
26
+ * Absent on a measured cell and on a cell derived inside the same column.
27
+ */
28
+ readonly estimatedFrom?: HardwareClassId;
24
29
  }
25
30
  /** `modelId → cell` for one (hardware class, accelerator) column. */
26
31
  export type DetectorLatencyColumn = Readonly<Record<string, DetectorLatencyCell>>;
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Static hardware classification for the Auto tune recommender (D745).
2
+ * Static hardware classification for the Auto tune recommender (D745, D930).
3
3
  *
4
4
  * A node is classified from the facts its platform probe already reports —
5
5
  * `cpuModel`, `arch`, `gpu`, `npu` — never from a benchmark. The class picks a
6
- * column of the measured latency table (`detector-performance.ts`); a node
7
- * whose CPU matches no measured class is `unknown` and the recommender leaves
8
- * it alone, saying so.
6
+ * column of the measured latency table (`detector-performance.ts`). A CPU that
7
+ * matches no measured class is `unknown`: the recommender then scales from
8
+ * reported accelerator compute when the probe supplied it, and leaves the
9
+ * node alone only when it has neither.
9
10
  *
10
11
  * `cpuModel` is the host's CPU string even inside Docker (`os.cpus()`), which
11
12
  * is why it is the discriminator: "Intel(R) Core(TM) Ultra 7 265K",
@@ -5,5 +5,6 @@
5
5
  */
6
6
  export * from './hardware-class.js';
7
7
  export * from './detector-performance.js';
8
+ export * from './accelerator-compute.js';
8
9
  export * from './recommend.js';
9
10
  export * from './plan-schemas.js';
@@ -99,6 +99,16 @@ export declare const LatencySourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
99
99
  kind: z.ZodLiteral<"node-benchmark">;
100
100
  resultId: z.ZodString;
101
101
  measuredAtMs: z.ZodNumber;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ kind: z.ZodLiteral<"estimated">;
104
+ estimatedFrom: z.ZodEnum<{
105
+ "amd-phoenix": "amd-phoenix";
106
+ "apple-m-base": "apple-m-base";
107
+ "apple-m-pro": "apple-m-pro";
108
+ "intel-core-ultra": "intel-core-ultra";
109
+ "intel-n-series": "intel-n-series";
110
+ unknown: "unknown";
111
+ }>;
102
112
  }, z.core.$strip>], "kind">;
103
113
  export type LatencySource = z.infer<typeof LatencySourceSchema>;
104
114
  export declare const DeviceModelChoiceSchema: z.ZodObject<{
@@ -112,7 +122,25 @@ export declare const DeviceModelChoiceSchema: z.ZodObject<{
112
122
  kind: z.ZodLiteral<"node-benchmark">;
113
123
  resultId: z.ZodString;
114
124
  measuredAtMs: z.ZodNumber;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ kind: z.ZodLiteral<"estimated">;
127
+ estimatedFrom: z.ZodEnum<{
128
+ "amd-phoenix": "amd-phoenix";
129
+ "apple-m-base": "apple-m-base";
130
+ "apple-m-pro": "apple-m-pro";
131
+ "intel-core-ultra": "intel-core-ultra";
132
+ "intel-n-series": "intel-n-series";
133
+ unknown: "unknown";
134
+ }>;
115
135
  }, z.core.$strip>], "kind">>;
136
+ estimatedFrom: z.ZodOptional<z.ZodEnum<{
137
+ "amd-phoenix": "amd-phoenix";
138
+ "apple-m-base": "apple-m-base";
139
+ "apple-m-pro": "apple-m-pro";
140
+ "intel-core-ultra": "intel-core-ultra";
141
+ "intel-n-series": "intel-n-series";
142
+ unknown: "unknown";
143
+ }>>;
116
144
  capacitySessions: z.ZodNumber;
117
145
  personRecall: z.ZodNumber;
118
146
  }, z.core.$strip>;
@@ -141,7 +169,25 @@ export declare const DeviceRecommendationSchema: z.ZodObject<{
141
169
  kind: z.ZodLiteral<"node-benchmark">;
142
170
  resultId: z.ZodString;
143
171
  measuredAtMs: z.ZodNumber;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ kind: z.ZodLiteral<"estimated">;
174
+ estimatedFrom: z.ZodEnum<{
175
+ "amd-phoenix": "amd-phoenix";
176
+ "apple-m-base": "apple-m-base";
177
+ "apple-m-pro": "apple-m-pro";
178
+ "intel-core-ultra": "intel-core-ultra";
179
+ "intel-n-series": "intel-n-series";
180
+ unknown: "unknown";
181
+ }>;
144
182
  }, z.core.$strip>], "kind">>;
183
+ estimatedFrom: z.ZodOptional<z.ZodEnum<{
184
+ "amd-phoenix": "amd-phoenix";
185
+ "apple-m-base": "apple-m-base";
186
+ "apple-m-pro": "apple-m-pro";
187
+ "intel-core-ultra": "intel-core-ultra";
188
+ "intel-n-series": "intel-n-series";
189
+ unknown: "unknown";
190
+ }>>;
145
191
  capacitySessions: z.ZodNumber;
146
192
  personRecall: z.ZodNumber;
147
193
  }, z.core.$strip>>;
@@ -243,7 +289,25 @@ export declare const NodeRecommendationSchema: z.ZodObject<{
243
289
  kind: z.ZodLiteral<"node-benchmark">;
244
290
  resultId: z.ZodString;
245
291
  measuredAtMs: z.ZodNumber;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ kind: z.ZodLiteral<"estimated">;
294
+ estimatedFrom: z.ZodEnum<{
295
+ "amd-phoenix": "amd-phoenix";
296
+ "apple-m-base": "apple-m-base";
297
+ "apple-m-pro": "apple-m-pro";
298
+ "intel-core-ultra": "intel-core-ultra";
299
+ "intel-n-series": "intel-n-series";
300
+ unknown: "unknown";
301
+ }>;
246
302
  }, z.core.$strip>], "kind">>;
303
+ estimatedFrom: z.ZodOptional<z.ZodEnum<{
304
+ "amd-phoenix": "amd-phoenix";
305
+ "apple-m-base": "apple-m-base";
306
+ "apple-m-pro": "apple-m-pro";
307
+ "intel-core-ultra": "intel-core-ultra";
308
+ "intel-n-series": "intel-n-series";
309
+ unknown: "unknown";
310
+ }>>;
247
311
  capacitySessions: z.ZodNumber;
248
312
  personRecall: z.ZodNumber;
249
313
  }, z.core.$strip>>;
@@ -381,33 +445,15 @@ export declare const NodeDeviceChangeSchema: z.ZodObject<{
381
445
  keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
382
446
  }, z.core.$strip>>>;
383
447
  }, z.core.$strip>;
384
- export declare const CameraOverrideClearSchema: z.ZodObject<{
385
- deviceId: z.ZodNumber;
386
- source: z.ZodEnum<{
387
- "step-override": "step-override";
388
- wholesale: "wholesale";
389
- }>;
390
- nodeId: z.ZodString;
391
- deviceKey: z.ZodNullable<z.ZodString>;
392
- stepId: z.ZodString;
393
- modelIdBefore: z.ZodNullable<z.ZodString>;
394
- keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
395
- }, z.core.$strip>;
396
- export declare const DetectorStoreClearSchema: z.ZodObject<{
397
- deviceId: z.ZodNumber;
398
- keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
399
- }, z.core.$strip>;
448
+ /**
449
+ * Every model and model-bound threshold lives on the accelerator that runs it
450
+ * (D927), so the plan writes node / device entries only — there is no camera
451
+ * layer for it to clear.
452
+ */
400
453
  export declare const AutoTuneWarningSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
401
- kind: z.ZodLiteral<"detector-store-cluster-wide">;
402
- skippedNodes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
403
- }, z.core.$strip>, z.ZodObject<{
404
- kind: z.ZodLiteral<"detector-store-unreadable">;
405
- error: z.ZodString;
406
- }, z.core.$strip>, z.ZodObject<{
407
454
  kind: z.ZodLiteral<"custom-pin-kept">;
408
455
  nodeId: z.ZodString;
409
- deviceKey: z.ZodNullable<z.ZodString>;
410
- deviceId: z.ZodNullable<z.ZodNumber>;
456
+ deviceKey: z.ZodString;
411
457
  modelId: z.ZodString;
412
458
  }, z.core.$strip>, z.ZodObject<{
413
459
  kind: z.ZodLiteral<"custom-registry-unreadable">;
@@ -463,7 +509,25 @@ export declare const AutoTunePlanSchema: z.ZodObject<{
463
509
  kind: z.ZodLiteral<"node-benchmark">;
464
510
  resultId: z.ZodString;
465
511
  measuredAtMs: z.ZodNumber;
512
+ }, z.core.$strip>, z.ZodObject<{
513
+ kind: z.ZodLiteral<"estimated">;
514
+ estimatedFrom: z.ZodEnum<{
515
+ "amd-phoenix": "amd-phoenix";
516
+ "apple-m-base": "apple-m-base";
517
+ "apple-m-pro": "apple-m-pro";
518
+ "intel-core-ultra": "intel-core-ultra";
519
+ "intel-n-series": "intel-n-series";
520
+ unknown: "unknown";
521
+ }>;
466
522
  }, z.core.$strip>], "kind">>;
523
+ estimatedFrom: z.ZodOptional<z.ZodEnum<{
524
+ "amd-phoenix": "amd-phoenix";
525
+ "apple-m-base": "apple-m-base";
526
+ "apple-m-pro": "apple-m-pro";
527
+ "intel-core-ultra": "intel-core-ultra";
528
+ "intel-n-series": "intel-n-series";
529
+ unknown: "unknown";
530
+ }>>;
467
531
  capacitySessions: z.ZodNumber;
468
532
  personRecall: z.ZodNumber;
469
533
  }, z.core.$strip>>;
@@ -596,33 +660,10 @@ export declare const AutoTunePlanSchema: z.ZodObject<{
596
660
  keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
597
661
  }, z.core.$strip>>>;
598
662
  }, z.core.$strip>>>;
599
- cameraClears: z.ZodReadonly<z.ZodArray<z.ZodObject<{
600
- deviceId: z.ZodNumber;
601
- source: z.ZodEnum<{
602
- "step-override": "step-override";
603
- wholesale: "wholesale";
604
- }>;
605
- nodeId: z.ZodString;
606
- deviceKey: z.ZodNullable<z.ZodString>;
607
- stepId: z.ZodString;
608
- modelIdBefore: z.ZodNullable<z.ZodString>;
609
- keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
610
- }, z.core.$strip>>>;
611
- detectorStoreClears: z.ZodReadonly<z.ZodArray<z.ZodObject<{
612
- deviceId: z.ZodNumber;
613
- keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
614
- }, z.core.$strip>>>;
615
663
  warnings: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
616
- kind: z.ZodLiteral<"detector-store-cluster-wide">;
617
- skippedNodes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
618
- }, z.core.$strip>, z.ZodObject<{
619
- kind: z.ZodLiteral<"detector-store-unreadable">;
620
- error: z.ZodString;
621
- }, z.core.$strip>, z.ZodObject<{
622
664
  kind: z.ZodLiteral<"custom-pin-kept">;
623
665
  nodeId: z.ZodString;
624
- deviceKey: z.ZodNullable<z.ZodString>;
625
- deviceId: z.ZodNullable<z.ZodNumber>;
666
+ deviceKey: z.ZodString;
626
667
  modelId: z.ZodString;
627
668
  }, z.core.$strip>, z.ZodObject<{
628
669
  kind: z.ZodLiteral<"custom-registry-unreadable">;
@@ -636,8 +677,6 @@ export declare const AutoTuneApplyInputSchema: z.ZodObject<{
636
677
  }, z.core.$strip>;
637
678
  export declare const AutoTunePhaseResultSchema: z.ZodObject<{
638
679
  phase: z.ZodEnum<{
639
- "camera-overrides": "camera-overrides";
640
- "detector-thresholds": "detector-thresholds";
641
680
  download: "download";
642
681
  "node-models": "node-models";
643
682
  redispatch: "redispatch";
@@ -650,8 +689,6 @@ export declare const AutoTuneApplyResultSchema: z.ZodDiscriminatedUnion<[z.ZodOb
650
689
  planHash: z.ZodString;
651
690
  phases: z.ZodReadonly<z.ZodArray<z.ZodObject<{
652
691
  phase: z.ZodEnum<{
653
- "camera-overrides": "camera-overrides";
654
- "detector-thresholds": "detector-thresholds";
655
692
  download: "download";
656
693
  "node-models": "node-models";
657
694
  redispatch: "redispatch";
@@ -663,8 +700,6 @@ export declare const AutoTuneApplyResultSchema: z.ZodDiscriminatedUnion<[z.ZodOb
663
700
  kind: z.ZodLiteral<"aborted">;
664
701
  phases: z.ZodReadonly<z.ZodArray<z.ZodObject<{
665
702
  phase: z.ZodEnum<{
666
- "camera-overrides": "camera-overrides";
667
- "detector-thresholds": "detector-thresholds";
668
703
  download: "download";
669
704
  "node-models": "node-models";
670
705
  redispatch: "redispatch";
@@ -720,7 +755,25 @@ export declare const AutoTuneApplyResultSchema: z.ZodDiscriminatedUnion<[z.ZodOb
720
755
  kind: z.ZodLiteral<"node-benchmark">;
721
756
  resultId: z.ZodString;
722
757
  measuredAtMs: z.ZodNumber;
758
+ }, z.core.$strip>, z.ZodObject<{
759
+ kind: z.ZodLiteral<"estimated">;
760
+ estimatedFrom: z.ZodEnum<{
761
+ "amd-phoenix": "amd-phoenix";
762
+ "apple-m-base": "apple-m-base";
763
+ "apple-m-pro": "apple-m-pro";
764
+ "intel-core-ultra": "intel-core-ultra";
765
+ "intel-n-series": "intel-n-series";
766
+ unknown: "unknown";
767
+ }>;
723
768
  }, z.core.$strip>], "kind">>;
769
+ estimatedFrom: z.ZodOptional<z.ZodEnum<{
770
+ "amd-phoenix": "amd-phoenix";
771
+ "apple-m-base": "apple-m-base";
772
+ "apple-m-pro": "apple-m-pro";
773
+ "intel-core-ultra": "intel-core-ultra";
774
+ "intel-n-series": "intel-n-series";
775
+ unknown: "unknown";
776
+ }>>;
724
777
  capacitySessions: z.ZodNumber;
725
778
  personRecall: z.ZodNumber;
726
779
  }, z.core.$strip>>;
@@ -853,33 +906,10 @@ export declare const AutoTuneApplyResultSchema: z.ZodDiscriminatedUnion<[z.ZodOb
853
906
  keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
854
907
  }, z.core.$strip>>>;
855
908
  }, z.core.$strip>>>;
856
- cameraClears: z.ZodReadonly<z.ZodArray<z.ZodObject<{
857
- deviceId: z.ZodNumber;
858
- source: z.ZodEnum<{
859
- "step-override": "step-override";
860
- wholesale: "wholesale";
861
- }>;
862
- nodeId: z.ZodString;
863
- deviceKey: z.ZodNullable<z.ZodString>;
864
- stepId: z.ZodString;
865
- modelIdBefore: z.ZodNullable<z.ZodString>;
866
- keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
867
- }, z.core.$strip>>>;
868
- detectorStoreClears: z.ZodReadonly<z.ZodArray<z.ZodObject<{
869
- deviceId: z.ZodNumber;
870
- keys: z.ZodReadonly<z.ZodArray<z.ZodString>>;
871
- }, z.core.$strip>>>;
872
909
  warnings: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
873
- kind: z.ZodLiteral<"detector-store-cluster-wide">;
874
- skippedNodes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
875
- }, z.core.$strip>, z.ZodObject<{
876
- kind: z.ZodLiteral<"detector-store-unreadable">;
877
- error: z.ZodString;
878
- }, z.core.$strip>, z.ZodObject<{
879
910
  kind: z.ZodLiteral<"custom-pin-kept">;
880
911
  nodeId: z.ZodString;
881
- deviceKey: z.ZodNullable<z.ZodString>;
882
- deviceId: z.ZodNullable<z.ZodNumber>;
912
+ deviceKey: z.ZodString;
883
913
  modelId: z.ZodString;
884
914
  }, z.core.$strip>, z.ZodObject<{
885
915
  kind: z.ZodLiteral<"custom-registry-unreadable">;
@@ -898,8 +928,6 @@ export type AutoTuneApplyInput = z.infer<typeof AutoTuneApplyInputSchema>;
898
928
  export type AutoTuneApplyResult = z.infer<typeof AutoTuneApplyResultSchema>;
899
929
  export type AutoTunePhaseResult = z.infer<typeof AutoTunePhaseResultSchema>;
900
930
  export type AutoTuneWarning = z.infer<typeof AutoTuneWarningSchema>;
901
- export type DetectorStoreClear = z.infer<typeof DetectorStoreClearSchema>;
902
- export type AutoTuneCameraOverrideClear = z.infer<typeof CameraOverrideClearSchema>;
903
931
  export type AutoTuneNodeDeviceChange = z.infer<typeof NodeDeviceChangeSchema>;
904
932
  export type HardwareClassId = z.infer<typeof HardwareClassIdSchema>;
905
933
  export type AcceleratorKind = z.infer<typeof AcceleratorKindSchema>;
@@ -7,18 +7,21 @@
7
7
  * Per node:
8
8
  * 1. Classify the hardware (`classifyInferenceHardware`). An unknown class,
9
9
  * an offline node or a node with nothing to recommend is left untouched —
10
- * unless the node has its own measurements (below).
11
- * 1b. MEASURED ON THE NODE BEATS THE TABLE (D791): a fresh node benchmark
12
- * result for (device, model) replaces the table's cell, and the choice
13
- * names it as its source. A node of unknown hardware with measurements is
14
- * recommended from them alone.
10
+ * unless the node has its own measurements (below) or a device reported
11
+ * compute that can be scaled from a measured column (D930).
12
+ * 1b. MEASURED ON THE NODE BEATS THE TABLE (D791), and the table beats an
13
+ * estimate: a fresh node benchmark result for (device, model) replaces
14
+ * whatever cell the class or the compute scale produced. A node of
15
+ * unknown hardware with measurements is recommended from them alone.
15
16
  * 2. The node's ACCELERATORS (NPU, iGPU, Neural Engine) that are enabled and
16
17
  * available share ONE model — so a camera's floors never flip with the
17
18
  * device the balancer rotated it onto. A candidate must have a build for
18
19
  * every accelerator's format and a latency cell for each.
19
20
  * 3. A candidate FITS a device when the device sustains at least
20
21
  * `minSessionsPerDevice` parallel sessions with it:
21
- * ⌊fps × (1 − headroom) / camera fps⌋ ≥ minSessionsPerDevice.
22
+ * ⌊fps × factor × (1 − headroom) / camera fps⌋ ≥ minSessionsPerDevice.
23
+ * factor is 1 at 10 fps; below that an Intel iGPU uses the measured
24
+ * overlap (D930).
22
25
  * 4. Among candidates that fit everywhere, the most accurate wins (person
23
26
  * recall at the shipped floor); within `RECALL_TIE` of the best, the
24
27
  * fastest wins. That IS the step-down order the data gives: the first
@@ -37,7 +40,7 @@
37
40
  import type { HardwareInfo } from '../../interfaces/platform.js';
38
41
  import type { ModelFormat } from '../../types/models.js';
39
42
  import { type DetectorPerfTable } from './detector-performance.js';
40
- import { type NodeRecommendation } from './plan-schemas.js';
43
+ import { type AcceleratorKind, type NodeRecommendation } from './plan-schemas.js';
41
44
  /** The family the cluster runs. */
42
45
  export declare const AUTO_TUNE_FAMILY = "yolov9";
43
46
  /**
@@ -51,8 +54,27 @@ export declare const RECALL_TIE = 0.02;
51
54
  export declare const DEFAULT_HEADROOM = 0.4;
52
55
  /** Detection rate a session is counted at when no camera says otherwise. */
53
56
  export declare const DEFAULT_CAMERA_FPS = 10;
54
- /** Parallel sessions one device sustains at `fps` with `headroom` kept free. */
55
- export declare function capacitySessionsOf(fps: number, headroom: number, cameraFps: number): number;
57
+ /**
58
+ * Camera rate at which serial `1000/p50` matched the cameras that held
59
+ * (N100 iGPU, 2026-10-24). Below this the second InferRequest's overlap
60
+ * becomes extra sessions; at and above it the serial ceiling is the count.
61
+ */
62
+ export declare const SERIAL_CAPACITY_CAMERA_FPS = 10;
63
+ /**
64
+ * Aggregate throughput ÷ serial throughput when the frame interval is wide
65
+ * enough to hide the second request. intel-igpu is the N100 measurement
66
+ * (~1.4× under LATENCY with 2 InferRequests). Every other kind stays 1
67
+ * until it is measured the same way.
68
+ */
69
+ export declare const AGGREGATE_THROUGHPUT_BY_KIND: Readonly<Partial<Record<AcceleratorKind, number>>>;
70
+ /** The overlap factor for this kind at this camera rate. 1 at {@link SERIAL_CAPACITY_CAMERA_FPS} and above. */
71
+ export declare function aggregateThroughputFactor(kind: AcceleratorKind, cameraFps: number): number;
72
+ /**
73
+ * Parallel sessions one device sustains at `fps` with `headroom` kept free.
74
+ * `aggregateFactor` is the kind's overlap (1 unless the caller measured
75
+ * extra throughput at this camera rate).
76
+ */
77
+ export declare function capacitySessionsOf(fps: number, headroom: number, cameraFps: number, aggregateFactor?: number): number;
56
78
  /** A latency measured on the node itself (a fresh node benchmark result, D791). */
57
79
  export interface MeasuredLatencyCell {
58
80
  readonly p50Ms: number;
@@ -0,0 +1,2 @@
1
+ export * from './small-subject-recovery.js';
2
+ export * from './motion-crop-plan.js';