@artemis-studio/plugin-sdk 2026.9.45 → 2026.9.46
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
|
@@ -8,6 +8,7 @@ export const ActionMenuItem = outsideStudio('ActionMenuItem');
|
|
|
8
8
|
export const ApiError = outsideStudio('ApiError');
|
|
9
9
|
export const CONTRACT = outsideStudio('CONTRACT');
|
|
10
10
|
export const CapabilityGate = outsideStudio('CapabilityGate');
|
|
11
|
+
export const CodeEditor = outsideStudio('CodeEditor');
|
|
11
12
|
export const ConfirmByTyping = outsideStudio('ConfirmByTyping');
|
|
12
13
|
export const METRIC_RANGES = outsideStudio('METRIC_RANGES');
|
|
13
14
|
export const MetricChart = outsideStudio('MetricChart');
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import type { AnyRoute } from '@tanstack/react-router';
|
|
|
5
5
|
import type { NavGroupId } from './nav/groups.ts';
|
|
6
6
|
import type { SlotContributions } from './slots.ts';
|
|
7
7
|
/** The extension contract version, shared with the backend's `Contract.VERSION` (ADR-0070). */
|
|
8
|
-
export declare const CONTRACT =
|
|
8
|
+
export declare const CONTRACT = 3;
|
|
9
9
|
/** The module ids the backend manifest reports. A frontend feature uses the same id as its backend module. */
|
|
10
10
|
export declare const FEATURE_IDS: readonly ["security", "audit", "settings", "stream", "broker", "clusters", "governance", "scrape", "mcp", "queues", "resources", "messages", "routing", "metrics", "alerting", "events", "rr", "sql", "brokerconfig", "flow", "triage", "bulk", "transfer", "setupreview", "apitokens", "plugins", "identity-local", "identity-oidc"];
|
|
11
11
|
export type FeatureId = (typeof FEATURE_IDS)[number];
|
package/types/sdk/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { ActionMenuItem } from '../ui/ActionMenuItem.tsx';
|
|
|
18
18
|
export { CapabilityGate } from '../ui/CapabilityGate.tsx';
|
|
19
19
|
export { gateFor, type GateVerdict } from '../ui/capabilityGate.ts';
|
|
20
20
|
export { useMe } from '../kernel/auth/api.ts';
|
|
21
|
+
export { CodeEditor, type CodeDiagnostic, type CodeEditorProps } from '../ui/CodeEditor.tsx';
|
|
21
22
|
export { ConfirmByTyping } from '../ui/ConfirmByTyping.tsx';
|
|
22
23
|
export { NodeOutcomeSummary, OutcomeSummary, type OutcomeRow } from '../ui/NodeOutcomeSummary.tsx';
|
|
23
24
|
export { Pager } from '../ui/Pager.tsx';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CodeDiagnostic } from './codeDiagnostics.ts';
|
|
2
|
+
export type { CodeDiagnostic };
|
|
3
|
+
export interface CodeEditorProps {
|
|
4
|
+
value: string;
|
|
5
|
+
/** Omitted, the editor is read-only. */
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
language: 'yaml' | 'json';
|
|
8
|
+
diagnostics?: CodeDiagnostic[];
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
/** The visible label, which is also the editor's accessible name. */
|
|
11
|
+
label: string;
|
|
12
|
+
minHeight?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A document editor for YAML or JSON: CodeMirror with line numbers and a lint
|
|
16
|
+
* gutter, coloured from `theme.css` like the SQL console. It validates nothing
|
|
17
|
+
* itself. The caller passes the server's diagnostics, which are marked at their
|
|
18
|
+
* line and column and summarised in a live region, so a screen reader hears
|
|
19
|
+
* that the document has problems without hunting for the marks.
|
|
20
|
+
*/
|
|
21
|
+
export declare function CodeEditor({ value, onChange, language, diagnostics, readOnly, label, minHeight, }: CodeEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Diagnostic } from '@codemirror/lint';
|
|
2
|
+
import type { EditorState } from '@codemirror/state';
|
|
3
|
+
/** A problem at a 1-based line and column, as a server validator reports it. */
|
|
4
|
+
export interface CodeDiagnostic {
|
|
5
|
+
line: number;
|
|
6
|
+
column: number;
|
|
7
|
+
message: string;
|
|
8
|
+
severity: 'error' | 'warning';
|
|
9
|
+
}
|
|
10
|
+
/** A 1-based line and column, clamped into the document, as a one-character range. */
|
|
11
|
+
export declare function toCodeMirror(state: EditorState, d: CodeDiagnostic): Diagnostic;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HighlightStyle } from "@codemirror/language";
|
|
2
|
+
/**
|
|
3
|
+
* Every colour comes from `theme.css`, so the editor follows the colour scheme
|
|
4
|
+
* with the rest of the console and neither scheme is inferred from the other
|
|
5
|
+
* (non-negotiable #6). Four token roles: an identifier deliberately stays body
|
|
6
|
+
* text, so the eye lands on what was typed rather than on the syntax.
|
|
7
|
+
*/
|
|
8
|
+
export declare const codeHighlight: HighlightStyle;
|
|
9
|
+
export declare const codeTheme: import("@codemirror/state").Extension;
|