@artemis-studio/plugin-sdk 2026.9.49 → 2026.9.51
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 +1 -0
- package/package.json +1 -1
- package/types/kernel/api/polling.d.ts +11 -24
- package/types/kernel/api/schema.d.ts +0 -38
- package/types/kernel/shell/ColorSchemeToggle.d.ts +8 -0
- package/types/kernel/shell/CommandPalette.d.ts +2 -3
- package/types/kernel/shell/useColorSchemeToggle.d.ts +5 -0
- package/types/sdk/index.d.ts +1 -0
- package/types/ui/DiagramView.d.ts +25 -0
- package/types/ui/diagram.d.ts +31 -0
- package/types/ui/graph/elk.d.ts +3 -0
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,17 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Query, type QueryClient } from '@tanstack/react-query';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Make TanStack's focus state mean "may refresh on its own": the tab is visible and
|
|
4
|
+
* refreshing is not paused. Called once, beside the `QueryClient`.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* ponytail: the interval is re-resolved when the *current* timer fires, so one
|
|
9
|
-
* further poll can land up to `ms` after pausing. Closing that gap means
|
|
10
|
-
* cancelling in-flight fetches, which throws away work the operator did not ask
|
|
11
|
-
* to discard and can leave a screen mid-update. Accepted and recorded in
|
|
12
|
-
* ADR-0055; revisit only if an operator can actually observe it.
|
|
6
|
+
* A side effect: the retryer also waits for focus, so a request that fails while
|
|
7
|
+
* paused retries on resume rather than during the pause.
|
|
13
8
|
*/
|
|
14
|
-
export declare function
|
|
9
|
+
export declare function installPauseSeam(): void;
|
|
15
10
|
/**
|
|
16
11
|
* `refetchOnMount` for the QueryClient default, so pausing covers opening a view
|
|
17
12
|
* and not only the intervals.
|
|
@@ -32,19 +27,11 @@ export declare function markPendingChange(): void;
|
|
|
32
27
|
export declare function usePollingPaused(): boolean;
|
|
33
28
|
export declare function usePendingChange(): boolean;
|
|
34
29
|
/**
|
|
35
|
-
* Refetch everything the current screen is observing
|
|
36
|
-
*
|
|
37
|
-
* `refetchType: 'active'` is the point: it refetches what is on the display and
|
|
38
|
-
* leaves the rest of the cache alone — the same scope the freshness indicator
|
|
39
|
-
* reports on, so the button and the label can never disagree.
|
|
40
|
-
*
|
|
41
|
-
* `cancelRefetch: false` is the other point. TanStack's default aborts the
|
|
42
|
-
* in-flight fetch and starts another, which is right after a mutation (the
|
|
43
|
-
* in-flight response is known-stale) and wrong for a refresh control (the
|
|
44
|
-
* in-flight response is exactly what was asked for). With it, a second activation
|
|
45
|
-
* joins the first instead of restarting it.
|
|
30
|
+
* Refetch everything the current screen is observing: what resuming does, because the
|
|
31
|
+
* first thing an operator needs after unpausing is current data.
|
|
46
32
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
33
|
+
* `refetchType: 'active'` scopes it to what is on the display, the same scope the
|
|
34
|
+
* freshness indicator reports on. `cancelRefetch: false` lets a fetch already in
|
|
35
|
+
* flight finish rather than aborting it for an identical one.
|
|
49
36
|
*/
|
|
50
37
|
export declare function refreshActiveQueries(qc: QueryClient): Promise<void>;
|
|
@@ -596,22 +596,6 @@ export interface paths {
|
|
|
596
596
|
patch?: never;
|
|
597
597
|
trace?: never;
|
|
598
598
|
};
|
|
599
|
-
"/api/v1/clusters/{clusterId}/rediscover": {
|
|
600
|
-
parameters: {
|
|
601
|
-
query?: never;
|
|
602
|
-
header?: never;
|
|
603
|
-
path?: never;
|
|
604
|
-
cookie?: never;
|
|
605
|
-
};
|
|
606
|
-
get?: never;
|
|
607
|
-
put?: never;
|
|
608
|
-
post: operations["rediscover"];
|
|
609
|
-
delete?: never;
|
|
610
|
-
options?: never;
|
|
611
|
-
head?: never;
|
|
612
|
-
patch?: never;
|
|
613
|
-
trace?: never;
|
|
614
|
-
};
|
|
615
599
|
"/api/v1/clusters/{clusterId}/queues": {
|
|
616
600
|
parameters: {
|
|
617
601
|
query?: never;
|
|
@@ -6669,28 +6653,6 @@ export interface operations {
|
|
|
6669
6653
|
};
|
|
6670
6654
|
};
|
|
6671
6655
|
};
|
|
6672
|
-
rediscover: {
|
|
6673
|
-
parameters: {
|
|
6674
|
-
query?: never;
|
|
6675
|
-
header?: never;
|
|
6676
|
-
path: {
|
|
6677
|
-
clusterId: string;
|
|
6678
|
-
};
|
|
6679
|
-
cookie?: never;
|
|
6680
|
-
};
|
|
6681
|
-
requestBody?: never;
|
|
6682
|
-
responses: {
|
|
6683
|
-
/** @description OK */
|
|
6684
|
-
200: {
|
|
6685
|
-
headers: {
|
|
6686
|
-
[name: string]: unknown;
|
|
6687
|
-
};
|
|
6688
|
-
content: {
|
|
6689
|
-
"*/*": components["schemas"]["TopologyView"];
|
|
6690
|
-
};
|
|
6691
|
-
};
|
|
6692
|
-
};
|
|
6693
|
-
};
|
|
6694
6656
|
queues: {
|
|
6695
6657
|
parameters: {
|
|
6696
6658
|
query: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Light or dark, from the header. Mantine's own manager remembers the choice in this
|
|
3
|
+
* browser; dark stays the first-visit default (`main.tsx`).
|
|
4
|
+
*
|
|
5
|
+
* The name says where the control goes, not where it is: an operator reading
|
|
6
|
+
* "Switch to light theme" knows what activating it will do.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ColorSchemeToggle(): import("react").JSX.Element;
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
* A view the operator may not open is still listed, disabled, with the reason: the rail shows it the
|
|
9
9
|
* same way.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* worse than not having one (ADR-0052).
|
|
11
|
+
* Pause and the colour scheme are here too, so every header control is reachable from the keyboard
|
|
12
|
+
* without a hotkey of its own (ADR-0052, ADR-0118).
|
|
14
13
|
*/
|
|
15
14
|
export declare function CommandPalette(): import("react").JSX.Element;
|
package/types/sdk/index.d.ts
CHANGED
|
@@ -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;
|