@artemis-studio/plugin-sdk 2026.9.49 → 2026.9.50

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/index.js CHANGED
@@ -10,6 +10,7 @@ export const CONTRACT = outsideStudio('CONTRACT');
10
10
  export const CapabilityGate = outsideStudio('CapabilityGate');
11
11
  export const CodeEditor = outsideStudio('CodeEditor');
12
12
  export const ConfirmByTyping = outsideStudio('ConfirmByTyping');
13
+ export const DiagramView = outsideStudio('DiagramView');
13
14
  export const METRIC_RANGES = outsideStudio('METRIC_RANGES');
14
15
  export const MetricChart = outsideStudio('MetricChart');
15
16
  export const NAV_GROUPS = outsideStudio('NAV_GROUPS');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artemis-studio/plugin-sdk",
3
- "version": "2026.9.49",
3
+ "version": "2026.9.50",
4
4
  "description": "Build the UI of an Artemis Studio plugin: typings for the Studio APIs a plugin may use, and a Vite preset.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,6 +20,7 @@ export { gateFor, type GateVerdict } from '../ui/capabilityGate.ts';
20
20
  export { useMe } from '../kernel/auth/api.ts';
21
21
  export { CodeEditor, type CodeDiagnostic, type CodeEditorProps } from '../ui/CodeEditor.tsx';
22
22
  export { ConfirmByTyping } from '../ui/ConfirmByTyping.tsx';
23
+ export { DiagramView, type DiagramEdge, type DiagramNode, type DiagramViewProps } from '../ui/DiagramView.tsx';
23
24
  export { NodeOutcomeSummary, OutcomeSummary, type OutcomeRow } from '../ui/NodeOutcomeSummary.tsx';
24
25
  export { Pager } from '../ui/Pager.tsx';
25
26
  export { VirtualTable, type GridColumn } from '../ui/VirtualTable.tsx';
@@ -0,0 +1,25 @@
1
+ import { type DiagramEdge, type DiagramNode } from './diagram.ts';
2
+ export type { DiagramEdge, DiagramNode };
3
+ export interface DiagramViewProps {
4
+ nodes: DiagramNode[];
5
+ edges: DiagramEdge[];
6
+ selectedId?: string | null;
7
+ onSelect?: (id: string) => void;
8
+ /** Which way the arrows run. Default: down. */
9
+ direction?: 'DOWN' | 'RIGHT';
10
+ /** The frame's height in pixels. Default 480. */
11
+ height?: number;
12
+ /** Names the diagram for screen readers. */
13
+ 'aria-label': string;
14
+ }
15
+ /**
16
+ * A read-only diagram of boxes and arrows, laid out automatically (ELK layered, in a worker) and
17
+ * drawn in Studio's theme (ADR-0117). Nothing is dragged, connected or deleted: it shows a
18
+ * structure and reports which box was chosen.
19
+ *
20
+ * <p>The diagram is one tab stop. Arrow keys move between boxes in reading order, Enter or Space
21
+ * selects one, and the selection is announced. A box with a problem says so in words, on the box
22
+ * and in its accessible name, so colour is never the only signal. Positions change only when the
23
+ * boxes or arrows do, never when a label does.
24
+ */
25
+ export declare function DiagramView({ nodes, edges, selectedId, onSelect, direction, height, 'aria-label': ariaLabel, }: DiagramViewProps): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ /** The plain data `DiagramView` draws, and the words it reads out (ADR-0117). */
2
+ /** One box of a `DiagramView`. Everything is plain data, shown as text. */
3
+ export interface DiagramNode {
4
+ id: string;
5
+ /** The box's name, one line. */
6
+ label: string;
7
+ /** What kind of thing it is, in words ("Call a service"). Shown above the label. */
8
+ kind?: string;
9
+ /** A second line under the label ("inventory POST /reserve"). */
10
+ detail?: string;
11
+ /** Something is wrong with it: shown in words and colour, and read out with the node. */
12
+ state?: 'error' | 'warning';
13
+ /** Why, for a node with a state. */
14
+ reason?: string;
15
+ }
16
+ /** One arrow of a `DiagramView`, from `source` to `target`. */
17
+ export interface DiagramEdge {
18
+ id: string;
19
+ source: string;
20
+ target: string;
21
+ label?: string;
22
+ /** Drawn dashed: a secondary path. Its meaning belongs in its label. */
23
+ dashed?: boolean;
24
+ }
25
+ /** What positions depend on: which nodes exist and how they connect. A new label moves nothing. */
26
+ export declare function layoutSignature(nodes: DiagramNode[], edges: DiagramEdge[], direction: string): string;
27
+ /**
28
+ * The accessible name of a node: kind, label and detail, the labels of the arrows into it (which a
29
+ * screen reader otherwise never meets), and any problem.
30
+ */
31
+ export declare function nodeName(n: DiagramNode, via?: string[]): string;
@@ -0,0 +1,3 @@
1
+ import type { ElkNode } from 'elkjs/lib/elk-api';
2
+ /** Lay a graph out and return where each node goes. */
3
+ export declare function runLayout(graph: ElkNode): Promise<ElkNode>;