@camstack/ui-library 1.1.43 → 1.1.45

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.
@@ -17,8 +17,16 @@ export interface DeviceTypeControl {
17
17
  readonly HeroCard: (p: DeviceControlProps) => ReactNode;
18
18
  }
19
19
  /**
20
- * Exhaustive record over DeviceType. Omitting a member causes a
21
- * TypeScript build error (same pattern as DEVICE_TYPE_ACTIONS).
20
+ * Exhaustive record over DeviceType, DERIVED from the shared decision
21
+ * (`DEVICE_TYPE_CONTROL_KIND`) composed with the web `CONTROL_KIND_COMPONENTS`
22
+ * binding — so the type→control mapping can never diverge from the single
23
+ * source in `@camstack/types`. Preserved as a public export for consumers/tests
24
+ * that index it by `DeviceType`.
25
+ *
26
+ * The `Object.fromEntries` result is a `{ [k: string]: DeviceTypeControl }`;
27
+ * `Object.values(DeviceType)` (a string enum) yields exactly the enum's members,
28
+ * so the record is fully populated — the assertion narrows that documented
29
+ * enum-record projection boundary.
22
30
  */
23
31
  export declare const DEVICE_TYPE_CONTROL: Record<DeviceType, DeviceTypeControl>;
24
32
  /**
@@ -53,9 +61,10 @@ export declare const CONTROL_FILLS: Record<DeviceType, boolean>;
53
61
  */
54
62
  export type ControlPlacement = 'right' | 'center' | 'table';
55
63
  /**
56
- * Runtime-string-safe lookup: a device row's `type` crosses the wire
57
- * as a plain string, so an unrecognised value resolves to null instead
58
- * of indexing the registry with an unverified key.
64
+ * Runtime-string-safe lookup: a device row's `type` crosses the wire as a plain
65
+ * string. The type→control-kind DECISION is single-sourced in `@camstack/types`
66
+ * (`resolveDeviceControlKind`, null for an unrecognised type); this maps the
67
+ * resolved kind onto the web components.
59
68
  */
60
69
  export declare function resolveDeviceControl(type: string): DeviceTypeControl | null;
61
70
  /**
@@ -0,0 +1,33 @@
1
+ import { StepTreeNode } from './step-tree-master';
2
+ import { AgentColumn, CellState } from './pipeline-matrix-shared';
3
+ export type { AgentColumn, CellState } from './pipeline-matrix-shared';
4
+ /**
5
+ * Per-camera gate state for a step (node-independent). `zone-driven` steps
6
+ * (package-detection) sit OUTSIDE the gate — a badge, never a switch.
7
+ */
8
+ export type StepGate = {
9
+ readonly kind: 'gate';
10
+ readonly effectiveOn: boolean;
11
+ readonly defaultOn: boolean;
12
+ readonly explicit: boolean;
13
+ } | {
14
+ readonly kind: 'zone-driven';
15
+ };
16
+ export interface DeviceStepMatrixProps {
17
+ readonly tree: readonly StepTreeNode[];
18
+ readonly agents: readonly AgentColumn[];
19
+ readonly gateFor: (addonId: string) => StepGate;
20
+ readonly getCellState: (addonId: string, agentNodeId: string) => CellState;
21
+ readonly onCellClick: (addonId: string, agentNodeId: string) => void;
22
+ readonly selectedCell: {
23
+ readonly addonId: string;
24
+ readonly agentNodeId: string;
25
+ } | null;
26
+ /** `next: null` resets the gate to the catalog default (inherit). */
27
+ readonly onSetGate: (addonId: string, next: boolean | null) => void;
28
+ readonly gateBusy?: boolean;
29
+ /** Single-node fallback (B): which node the one column shows. */
30
+ readonly fallbackNodeId: string | null;
31
+ readonly onFallbackNodeChange: (nodeId: string) => void;
32
+ }
33
+ export declare function DeviceStepMatrix({ tree, agents, gateFor, getCellState, onCellClick, selectedCell, onSetGate, gateBusy, fallbackNodeId, onFallbackNodeChange, }: DeviceStepMatrixProps): import("react").JSX.Element;
@@ -9,6 +9,9 @@ export { AgentStepEditor } from './agent-step-editor';
9
9
  export type { AgentStepEditorProps, EditorMode } from './agent-step-editor';
10
10
  export { PipelineTreeMatrix } from './pipeline-tree-matrix';
11
11
  export type { PipelineTreeMatrixProps, AgentColumn, CellState } from './pipeline-tree-matrix';
12
+ export { DeviceStepMatrix } from './device-step-matrix';
13
+ export type { DeviceStepMatrixProps, StepGate } from './device-step-matrix';
14
+ export { shouldUseSingleNode } from './pipeline-matrix-shared';
12
15
  export { NodePicker } from './node-picker';
13
16
  export type { NodePickerProps } from './node-picker';
14
17
  export * from './status-badge';
@@ -0,0 +1,69 @@
1
+ import { ReactNode } from 'react';
2
+ import { PipelineSlot } from '@camstack/types';
3
+ import { StepTreeNode } from './step-tree-master';
4
+ export interface AgentColumn {
5
+ readonly agentNodeId: string;
6
+ readonly engineLabel: string;
7
+ }
8
+ /**
9
+ * A single (step, node) cell's rendered state.
10
+ * - `enabled` — the node runs a model for this step (chip + optional `ovr`).
11
+ * - `disabled` — cluster-default off (used by the per-node matrix only).
12
+ * - `skip` — #33: gated ON for the camera but this node has no compatible
13
+ * model — a visible amber status, never silent.
14
+ * - `na` — not applicable on this node.
15
+ */
16
+ export type CellState = {
17
+ readonly kind: 'enabled';
18
+ readonly modelId: string;
19
+ readonly overridden?: boolean;
20
+ } | {
21
+ readonly kind: 'disabled';
22
+ readonly overridden?: boolean;
23
+ } | {
24
+ readonly kind: 'na';
25
+ } | {
26
+ readonly kind: 'skip';
27
+ };
28
+ /**
29
+ * Fixed column geometry (rem). Both matrices use CSS-grid STATIC track widths
30
+ * so a cell's content (a status chip, a long model id) can never resize a
31
+ * column or shift its neighbours — content truncates WITHIN the fixed track.
32
+ * This kills the "table dances when the last column's status changes" jitter.
33
+ */
34
+ export declare const AGENT_COL_REM = 13;
35
+ export declare const REM_PX = 16;
36
+ export declare const AGENT_COL_PX: number;
37
+ export interface FlatRow {
38
+ readonly node: StepTreeNode;
39
+ readonly depth: number;
40
+ }
41
+ export declare function flattenTree(nodes: readonly StepTreeNode[]): readonly FlatRow[];
42
+ /**
43
+ * Layout decision for the responsive A↔B switch. Pure so it can be unit-tested
44
+ * in isolation from the DOM.
45
+ *
46
+ * Returns `true` (single-node fallback) when there is MORE than one node but
47
+ * the container is too narrow to show the step column plus at least TWO node
48
+ * columns side by side. An unmeasured container (`width <= 0`) defaults to the
49
+ * wide matrix so there is no first-paint flash into the fallback.
50
+ */
51
+ export declare function shouldUseSingleNode(width: number, nodeCount: number, stepColPx: number, agentColPx?: number): boolean;
52
+ export declare function SlotHeading({ slot }: {
53
+ readonly slot: PipelineSlot;
54
+ }): import("react").JSX.Element;
55
+ export declare function ClassChips({ inputs, outputs, }: {
56
+ readonly inputs: readonly string[];
57
+ readonly outputs: readonly string[];
58
+ }): import("react").JSX.Element | null;
59
+ /** Step label (slot heading + addon name + class chips), shared by both views. */
60
+ export declare function StepLabel({ node }: {
61
+ readonly node: StepTreeNode;
62
+ }): import("react").JSX.Element;
63
+ /**
64
+ * Cell content. Width-stable: the status dot is `shrink-0` (reserved space) and
65
+ * the model id truncates inside a `min-w-0` flex row, so a longer model id never
66
+ * widens the cell — it ellipsises instead.
67
+ */
68
+ export declare function renderCellContent(state: CellState): ReactNode;
69
+ export declare function cellButtonClass(state: CellState, isSelected: boolean, extra?: string): string;
@@ -1,18 +1,6 @@
1
1
  import { StepTreeNode } from './step-tree-master';
2
- export interface AgentColumn {
3
- readonly agentNodeId: string;
4
- readonly engineLabel: string;
5
- }
6
- export type CellState = {
7
- readonly kind: 'enabled';
8
- readonly modelId: string;
9
- readonly overridden?: boolean;
10
- } | {
11
- readonly kind: 'disabled';
12
- readonly overridden?: boolean;
13
- } | {
14
- readonly kind: 'na';
15
- };
2
+ import { AgentColumn, CellState } from './pipeline-matrix-shared';
3
+ export type { AgentColumn, CellState } from './pipeline-matrix-shared';
16
4
  export interface PipelineTreeMatrixProps {
17
5
  readonly tree: readonly StepTreeNode[];
18
6
  readonly agents: readonly AgentColumn[];
@@ -1129,6 +1129,8 @@ export declare const usePipelineOrchestratorSetAgentDetectWeight: typeof trpc.pi
1129
1129
  export declare const usePipelineOrchestratorSetAgentCapabilities: typeof trpc.pipelineOrchestrator.setAgentCapabilities.useMutation;
1130
1130
  /** Generated alias around `trpc.pipelineOrchestrator.setAgentReachableHost.useMutation`. */
1131
1131
  export declare const usePipelineOrchestratorSetAgentReachableHost: typeof trpc.pipelineOrchestrator.setAgentReachableHost.useMutation;
1132
+ /** Generated alias around `trpc.pipelineOrchestrator.setAgentInferenceDevices.useMutation`. */
1133
+ export declare const usePipelineOrchestratorSetAgentInferenceDevices: typeof trpc.pipelineOrchestrator.setAgentInferenceDevices.useMutation;
1132
1134
  /** Generated alias around `trpc.pipelineOrchestrator.resetNodePipelineDefaults.useMutation`. */
1133
1135
  export declare const usePipelineOrchestratorResetNodePipelineDefaults: typeof trpc.pipelineOrchestrator.resetNodePipelineDefaults.useMutation;
1134
1136
  /** Generated alias around `trpc.pipelineOrchestrator.getCameraSettings.useQuery`. */