@opengeni/react 0.29.0 → 0.33.1
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/dist/approvals.d.ts +14 -0
- package/dist/{chunk-M7X4JZOD.js → chunk-4QOQ2DSR.js} +8 -1
- package/dist/chunk-4QOQ2DSR.js.map +1 -0
- package/dist/{chunk-HQFPO7VX.js → chunk-7CJOAW3V.js} +24 -3
- package/dist/{chunk-HQFPO7VX.js.map → chunk-7CJOAW3V.js.map} +1 -1
- package/dist/{chunk-CSJBF3QJ.js → chunk-A2WITZTI.js} +377 -113
- package/dist/chunk-A2WITZTI.js.map +1 -0
- package/dist/{chunk-BC6RKIHS.js → chunk-GZ4KR67U.js} +11 -11
- package/dist/{chunk-AVLMIWYO.js → chunk-KZRUYCL4.js} +12 -6
- package/dist/chunk-KZRUYCL4.js.map +1 -0
- package/dist/{chunk-IPVOVOW6.js → chunk-MS3FBZ6A.js} +2539 -2174
- package/dist/chunk-MS3FBZ6A.js.map +1 -0
- package/dist/{chunk-OKXCECLG.js → chunk-TCCE5ZU5.js} +171 -22
- package/dist/chunk-TCCE5ZU5.js.map +1 -0
- package/dist/chunk-U255M5EZ.js +178 -0
- package/dist/chunk-U255M5EZ.js.map +1 -0
- package/dist/chunk-ZNNE2VES.js +6413 -0
- package/dist/chunk-ZNNE2VES.js.map +1 -0
- package/dist/client.d.ts +33 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/registry.d.ts +41 -0
- package/dist/commands/types.d.ts +85 -0
- package/dist/components/approval-surface.d.ts +28 -0
- package/dist/components/chat-composer.d.ts +51 -0
- package/dist/components/code-editor.d.ts +43 -0
- package/dist/components/command-palette.d.ts +25 -0
- package/dist/components/composer-transcription-control.d.ts +36 -0
- package/dist/components/composer.d.ts +277 -0
- package/dist/components/copy-button.d.ts +26 -0
- package/dist/components/desktop-viewer.d.ts +85 -0
- package/dist/components/diff-view.d.ts +38 -0
- package/dist/components/enrollment-consent.d.ts +33 -0
- package/dist/components/enrollment-device-flow.d.ts +27 -0
- package/dist/components/file-browser.d.ts +47 -0
- package/dist/components/fleet-tile.d.ts +18 -0
- package/dist/components/human-input-form.d.ts +47 -0
- package/dist/components/machine-card.d.ts +21 -0
- package/dist/components/machine-dock-bar.d.ts +31 -0
- package/dist/components/machine-health-pill.d.ts +9 -0
- package/dist/components/machine-metrics.d.ts +15 -0
- package/dist/components/machine-status-pill.d.ts +54 -0
- package/dist/components/machines/health.d.ts +25 -0
- package/dist/components/machines/machine-detail.d.ts +14 -0
- package/dist/components/machines/metric-history-chart.d.ts +24 -0
- package/dist/components/machines/metric-sparkline.d.ts +9 -0
- package/dist/components/machines/series.d.ts +24 -0
- package/dist/components/machines-dashboard.d.ts +30 -0
- package/dist/components/markdown.d.ts +31 -0
- package/dist/components/message-timeline.d.ts +98 -0
- package/dist/components/model-picker.d.ts +19 -0
- package/dist/components/pierre-diff.d.ts +34 -0
- package/dist/components/pierre-file.d.ts +27 -0
- package/dist/components/queue-draft-policy.d.ts +7 -0
- package/dist/components/queue-surface-implementation.d.ts +20 -0
- package/dist/components/queue-surface-state.d.ts +12 -0
- package/dist/components/queue-surface.d.ts +12 -0
- package/dist/components/sandbox-files.d.ts +49 -0
- package/dist/components/sandbox-terminal.d.ts +123 -0
- package/dist/components/sandbox-workspace.d.ts +128 -0
- package/dist/components/session-chrome.d.ts +70 -0
- package/dist/components/session-status.d.ts +25 -0
- package/dist/components/soften-streaming-markdown.d.ts +13 -0
- package/dist/components/stream-reveal.d.ts +37 -0
- package/dist/components/tip-follow.d.ts +139 -0
- package/dist/components/tooltip.d.ts +16 -0
- package/dist/components/workbench-changes.d.ts +34 -0
- package/dist/components/workspace-dock.d.ts +35 -0
- package/dist/composer.d.ts +11 -7
- package/dist/composer.js +9 -6
- package/dist/hooks/internal.d.ts +46 -0
- package/dist/hooks/use-available-models.d.ts +37 -0
- package/dist/hooks/use-billing-usage.d.ts +26 -0
- package/dist/hooks/use-codex-accounts.d.ts +69 -0
- package/dist/{use-composer-ClHy1rkL.d.ts → hooks/use-composer.d.ts} +16 -24
- package/dist/hooks/use-desktop-stream.d.ts +43 -0
- package/dist/hooks/use-environments.d.ts +35 -0
- package/dist/{use-file-attachments-BmT8WtqO.d.ts → hooks/use-file-attachments.d.ts} +6 -9
- package/dist/hooks/use-goal.d.ts +46 -0
- package/dist/hooks/use-human-input.d.ts +26 -0
- package/dist/hooks/use-last-started-turn-policy.d.ts +27 -0
- package/dist/hooks/use-machine-chip.d.ts +54 -0
- package/dist/hooks/use-machines.d.ts +81 -0
- package/dist/hooks/use-packs.d.ts +27 -0
- package/dist/hooks/use-relay-frame-stream.d.ts +53 -0
- package/dist/hooks/use-rigs.d.ts +87 -0
- package/dist/hooks/use-sandbox-files.d.ts +108 -0
- package/dist/hooks/use-sandbox-git.d.ts +58 -0
- package/dist/hooks/use-sandbox-terminal.d.ts +62 -0
- package/dist/hooks/use-scheduled-tasks.d.ts +15 -0
- package/dist/hooks/use-session-capabilities.d.ts +83 -0
- package/dist/hooks/use-session-control.d.ts +22 -0
- package/dist/hooks/use-session-events.d.ts +92 -0
- package/dist/hooks/use-session-lineage.d.ts +17 -0
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +23 -0
- package/dist/hooks/use-session.d.ts +23 -0
- package/dist/hooks/use-slash-commands.d.ts +66 -0
- package/dist/hooks/use-terminal-stream.d.ts +46 -0
- package/dist/hooks/use-transcription.d.ts +73 -0
- package/dist/hooks/use-turn-queue.d.ts +44 -0
- package/dist/hooks/use-voice-input.d.ts +25 -0
- package/dist/hooks/use-windowed-sections.d.ts +42 -0
- package/dist/hooks/use-workspace-capture.d.ts +49 -0
- package/dist/hooks/use-workspace-edit.d.ts +73 -0
- package/dist/hooks/use-workspace-sessions.d.ts +30 -0
- package/dist/hooks/use-workspaces.d.ts +22 -0
- package/dist/human-input.d.ts +18 -0
- package/dist/index.d.ts +144 -2119
- package/dist/index.js +421 -324
- package/dist/index.js.map +1 -1
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/format.d.ts +48 -0
- package/dist/lib/git-patch.d.ts +8 -0
- package/dist/lib/motion-inspect.d.ts +5 -0
- package/dist/lib/motion.d.ts +14 -0
- package/dist/lib/noto-sans-arabic-loader.d.ts +1 -0
- package/dist/lib/noto-sans-jp-loader.generated.d.ts +1 -0
- package/dist/lib/relay-wire.d.ts +30 -0
- package/dist/lib/use-portal-token-style.d.ts +9 -0
- package/dist/lib/use-theme-type.d.ts +5 -0
- package/dist/lib/use-unicode-fonts.d.ts +12 -0
- package/dist/lib/xterm-renderer.d.ts +19 -0
- package/dist/lib/xterm-theme.d.ts +75 -0
- package/dist/machines.d.ts +30 -413
- package/dist/machines.js +3 -3
- package/dist/model-policy.d.ts +32 -0
- package/dist/model-policy.js +33 -0
- package/dist/model-policy.js.map +1 -0
- package/dist/provider.d.ts +16 -0
- package/dist/{queue-surface-implementation-UQ535OKQ.js → queue-surface-implementation-THPAKGMD.js} +2 -2
- package/dist/{queue-surface-implementation-UQ535OKQ.js.map → queue-surface-implementation-THPAKGMD.js.map} +1 -1
- package/dist/session-context.d.ts +82 -0
- package/dist/session-ui.d.ts +10 -7
- package/dist/session-ui.js +9 -5
- package/dist/session.d.ts +28 -6
- package/dist/session.js +11 -11
- package/dist/timeline/activity-rail.d.ts +19 -0
- package/dist/timeline/disclosure-context.d.ts +14 -0
- package/dist/timeline/entrance.d.ts +14 -0
- package/dist/timeline/fleet-decision-projection.d.ts +9 -0
- package/dist/timeline/fleet-decision-row.d.ts +11 -0
- package/dist/timeline/fold-memory.d.ts +15 -0
- package/dist/timeline/index.d.ts +18 -0
- package/dist/timeline/parsers.d.ts +96 -0
- package/dist/timeline/projection.d.ts +38 -0
- package/dist/timeline/registry.d.ts +40 -0
- package/dist/timeline/screenshot-lightbox.d.ts +26 -0
- package/dist/timeline/seen-activity-ids.d.ts +2 -0
- package/dist/timeline/shared.d.ts +125 -0
- package/dist/timeline/tool-diff.d.ts +8 -0
- package/dist/timeline/tool-display-name.d.ts +10 -0
- package/dist/timeline/tool-renderers.d.ts +5 -0
- package/dist/timeline/turn-summary.d.ts +116 -0
- package/dist/{use-turn-queue-D_1a8W_l.d.ts → timeline/types.d.ts} +41 -69
- package/dist/types/machines.d.ts +11 -0
- package/package.json +8 -4
- package/src/client.ts +1 -0
- package/src/components/composer-transcription-control.tsx +278 -130
- package/src/components/composer.tsx +20 -15
- package/src/components/copy-button.tsx +127 -0
- package/src/components/markdown.tsx +231 -32
- package/src/components/message-timeline.tsx +1304 -378
- package/src/components/model-picker.tsx +83 -43
- package/src/components/queue-surface-implementation.tsx +1 -1
- package/src/components/session-chrome.tsx +942 -0
- package/src/components/soften-streaming-markdown.ts +205 -0
- package/src/components/stream-reveal.ts +195 -0
- package/src/components/tip-follow.ts +459 -0
- package/src/components/tooltip.tsx +103 -0
- package/src/composer.ts +6 -0
- package/src/hooks/internal.ts +30 -4
- package/src/hooks/use-available-models.ts +51 -4
- package/src/hooks/use-composer.ts +23 -3
- package/src/hooks/use-last-started-turn-policy.ts +95 -0
- package/src/hooks/use-session-events.ts +359 -5
- package/src/hooks/use-voice-input.ts +232 -0
- package/src/index.ts +47 -1
- package/src/lib/clipboard.ts +58 -0
- package/src/lib/format.ts +18 -0
- package/src/lib/motion-inspect.ts +5 -0
- package/src/lib/motion.ts +80 -0
- package/src/model-policy.ts +210 -0
- package/src/session-ui.ts +7 -0
- package/src/timeline/activity-rail.tsx +46 -7
- package/src/timeline/entrance.tsx +10 -0
- package/src/timeline/fold-memory.ts +52 -0
- package/src/timeline/index.ts +9 -1
- package/src/timeline/projection.ts +226 -41
- package/src/timeline/seen-activity-ids.ts +19 -0
- package/src/timeline/shared.tsx +1 -1
- package/src/timeline/tool-renderers.tsx +75 -6
- package/src/timeline/turn-summary.tsx +387 -97
- package/src/timeline/types.ts +21 -0
- package/styles/index.css +99 -7
- package/styles/tokens.css +44 -3
- package/dist/chunk-AVLMIWYO.js.map +0 -1
- package/dist/chunk-CSJBF3QJ.js.map +0 -1
- package/dist/chunk-IPVOVOW6.js.map +0 -1
- package/dist/chunk-M7X4JZOD.js.map +0 -1
- package/dist/chunk-OKXCECLG.js.map +0 -1
- package/dist/chunk-ZMNPFZWL.js +0 -3918
- package/dist/chunk-ZMNPFZWL.js.map +0 -1
- package/dist/composer-BMzimGTO.d.ts +0 -528
- package/dist/session-DaONt-dY.d.ts +0 -264
- package/dist/session-context-CAjlaeZb.d.ts +0 -84
- package/dist/session-ui-B5_roA95.d.ts +0 -259
- /package/dist/{chunk-BC6RKIHS.js.map → chunk-GZ4KR67U.js.map} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type CopyButtonProps = {
|
|
3
|
+
/** Plain text to copy, or a lazy getter (tables / late DOM). */
|
|
4
|
+
text: string | (() => string);
|
|
5
|
+
/** Accessible name + tooltip while idle. */
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* `always` — visible control.
|
|
10
|
+
* `group-hover` — parent must use `group/copy`; fades in on hover/focus.
|
|
11
|
+
*/
|
|
12
|
+
reveal?: "always" | "group-hover" | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Ghost icon copy control — no chrome box, no "Copy code" label.
|
|
16
|
+
* Copy → check flash. Hover-reveal via `group/copy` on a parent.
|
|
17
|
+
*/
|
|
18
|
+
export declare function CopyButton({ text, label, className, reveal, }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/** Hover-reveal chrome around a message / turn so {@link CopyButton} can fade in. */
|
|
20
|
+
export declare function CopyHoverFrame({ children, className, copyText, label, align, }: {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
copyText: string;
|
|
24
|
+
label: string;
|
|
25
|
+
align?: "start" | "end" | undefined;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { CapabilityUnavailableReason, DesktopRfbFactory, DesktopStreamCapability } from "@opengeni/sdk";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { DesktopWebSocketFactory } from "../hooks/use-relay-frame-stream";
|
|
4
|
+
export type DesktopViewerProps = {
|
|
5
|
+
/** The desktop cell of the negotiated capabilities (`capabilities.DesktopStream`). */
|
|
6
|
+
capability: DesktopStreamCapability | null;
|
|
7
|
+
/**
|
|
8
|
+
* Initial control mode. Default false (watch). When the user flips
|
|
9
|
+
* "Take control" the viewer drives input — but only if `capability.mode`
|
|
10
|
+
* permits it (server-gated; a read-only deployment disables the toggle).
|
|
11
|
+
* Pass a value to control it externally; omit to let the viewer own the state.
|
|
12
|
+
*/
|
|
13
|
+
interactive?: boolean | undefined;
|
|
14
|
+
/** Render the built-in Watching ⇄ Take control toggle (default true). */
|
|
15
|
+
showControlToggle?: boolean | undefined;
|
|
16
|
+
scaleViewport?: boolean | undefined;
|
|
17
|
+
/** Custom RFB factory (tests / a WebRTC swap). Defaults to lazy @novnc/novnc. */
|
|
18
|
+
rfbFactory?: DesktopRfbFactory | undefined;
|
|
19
|
+
/** Custom socket factory for the self-hosted `relay-frames` transport (tests).
|
|
20
|
+
* Defaults to `new WebSocket(url)`. Mirrors `rfbFactory`. */
|
|
21
|
+
webSocketFactory?: DesktopWebSocketFactory | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Consent gate for the un-redacted (and possibly shared) pixel plane. Rendered
|
|
24
|
+
* BEFORE connecting whenever the desktop requires acknowledgment that hasn't
|
|
25
|
+
* been given. Call `onAccept` to record consent (the host wires it to
|
|
26
|
+
* `client.acknowledgeStream` + a re-negotiate). When omitted, a default
|
|
27
|
+
* banner is shown.
|
|
28
|
+
*/
|
|
29
|
+
renderConsentGate?: ((onAccept: () => void, shared: boolean) => ReactNode) | undefined;
|
|
30
|
+
/** Called when the default consent gate's accept button is pressed. */
|
|
31
|
+
onAcknowledge?: (() => void) | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the host has the viewer attach engaged (i.e. the user has opted into
|
|
34
|
+
* watching — the parent's `watchDesktop`/`attachDesktop`). Drives the
|
|
35
|
+
* cold-state behaviour: when watching, a cold-but-warmable lease AUTO-WARMS
|
|
36
|
+
* (and re-warms when the box drains) instead of dead-ending. When omitted we
|
|
37
|
+
* infer it from a recorded consent (the default gate's accept), so the
|
|
38
|
+
* component still self-heals after the first acknowledgment.
|
|
39
|
+
*/
|
|
40
|
+
watching?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Request a (re)warm of the sandbox WITHOUT re-acknowledging (the consent has
|
|
43
|
+
* already been recorded — only the box drained). The host wires this to
|
|
44
|
+
* "engage the viewer attach + re-negotiate". Called automatically when a
|
|
45
|
+
* watched desktop is found cold-but-warmable, and behind the manual retry on
|
|
46
|
+
* the warming notice. Distinct from `onAcknowledge`, which is the FIRST,
|
|
47
|
+
* consent-bearing warm.
|
|
48
|
+
*/
|
|
49
|
+
onWarm?: (() => void) | undefined;
|
|
50
|
+
/** Shown when transport is null (headless backend / degraded / disabled). */
|
|
51
|
+
renderUnavailable?: ((reason: CapabilityUnavailableReason | null) => ReactNode) | undefined;
|
|
52
|
+
/** Shown while the box is cold/warming (no live address yet). */
|
|
53
|
+
renderWarming?: (() => ReactNode) | undefined;
|
|
54
|
+
/** Shown when the per-session viewer cap (429) was hit. */
|
|
55
|
+
renderViewerCap?: (() => ReactNode) | undefined;
|
|
56
|
+
/** Surface the 429 cap state from `useSessionCapabilities().viewerCapReached`. */
|
|
57
|
+
viewerCapReached?: boolean | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Connect watchdog (ms): if a live url is present but the RFB hasn't connected
|
|
60
|
+
* within this window, surface a "Couldn't connect" + Reconnect instead of an
|
|
61
|
+
* eternal idle scrim. Default 13000. 0 disables the watchdog.
|
|
62
|
+
*/
|
|
63
|
+
connectTimeoutMs?: number | undefined;
|
|
64
|
+
className?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The desktop surface: a noVNC client connecting to the Channel-B scoped tunnel
|
|
68
|
+
* URL from the capability doc. Owns the mount `<div ref>`, drives
|
|
69
|
+
* `useDesktopStream` (SSR-safe lazy RFB), and renders a real
|
|
70
|
+
* cold → warming → connecting → connected → error state machine with live
|
|
71
|
+
* feedback (spinners, transitions) — never a dead black box with stale text.
|
|
72
|
+
*
|
|
73
|
+
* The read-only vs interactive decision is enforced server-first
|
|
74
|
+
* (`capability.mode`): when the deployment advertises mode "interactive" the
|
|
75
|
+
* viewer can TAKE CONTROL and drive the mouse & keyboard into the box's :0; a
|
|
76
|
+
* "read-only" deployment disables the take-control affordance (graceful, with a
|
|
77
|
+
* reason).
|
|
78
|
+
*
|
|
79
|
+
* Warming: a cold-but-warmable lease (`reason: "lease_cold"`) is NOT a dead end.
|
|
80
|
+
* When the user is watching (consented), the viewer asks the host to (re)warm
|
|
81
|
+
* the box (`onWarm`) and shows a "Warming…" spinner; if the box later drains to
|
|
82
|
+
* cold it re-warms. Genuinely-unavailable surfaces (headless/policy/os/backend)
|
|
83
|
+
* keep a clear, static unavailable notice.
|
|
84
|
+
*/
|
|
85
|
+
export declare function DesktopViewer({ capability, interactive, showControlToggle, scaleViewport, rfbFactory, webSocketFactory, renderConsentGate, onAcknowledge, watching, onWarm, renderUnavailable, renderWarming, renderViewerCap, viewerCapReached, connectTimeoutMs, className, }: DesktopViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { GitFileDiff } from "@opengeni/sdk";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use {@link PierreDiff} directly. Retained only as a thin,
|
|
5
|
+
* back-compat alias that renders the Pierre (Shiki) renderer with a plain-text
|
|
6
|
+
* degrade. The old hand-rolled hunk renderer was removed in Workbench v2 — the
|
|
7
|
+
* workbench keeps exactly ONE diff renderer. This alias is removed next major.
|
|
8
|
+
*/
|
|
9
|
+
export type DiffTheme = {
|
|
10
|
+
addBackground?: string;
|
|
11
|
+
delBackground?: string;
|
|
12
|
+
contextBackground?: string;
|
|
13
|
+
metaForeground?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use {@link PierreDiff}. `theme`/`onSelectFile`/`emptyState` from the
|
|
17
|
+
* removed hand-rolled renderer are accepted for source compatibility and ignored;
|
|
18
|
+
* `fallback` still overrides the plain-text degrade.
|
|
19
|
+
*/
|
|
20
|
+
export type DiffViewProps = {
|
|
21
|
+
diff: GitFileDiff[];
|
|
22
|
+
fallback?: ReactNode | undefined;
|
|
23
|
+
layout?: "unified" | "split" | undefined;
|
|
24
|
+
themeType?: "dark" | "light" | undefined;
|
|
25
|
+
/** @deprecated line-background theming was part of the removed renderer. */
|
|
26
|
+
theme?: DiffTheme | undefined;
|
|
27
|
+
/** @deprecated the alias no longer renders a clickable file header. */
|
|
28
|
+
onSelectFile?: ((path: string) => void) | undefined;
|
|
29
|
+
isRepo?: boolean | undefined;
|
|
30
|
+
emptyState?: ReactNode | undefined;
|
|
31
|
+
className?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Use {@link PierreDiff} directly. Thin alias: renders `PierreDiff`
|
|
35
|
+
* (Shiki-highlighted, unified/split) with a plain-text fallback for a host
|
|
36
|
+
* without `@pierre/diffs`. Removed next major.
|
|
37
|
+
*/
|
|
38
|
+
export declare function DiffView({ diff, fallback, layout, themeType, isRepo, emptyState, className, }: DiffViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The machine identity surfaced to the approver, from the device-flow start. */
|
|
2
|
+
export type EnrollmentConsentMachine = {
|
|
3
|
+
/** Human-friendly name (hostname by default). */
|
|
4
|
+
machineName: string;
|
|
5
|
+
os: string;
|
|
6
|
+
arch: string;
|
|
7
|
+
/** The agent can offer a display (a real screen / Xvfb is available). */
|
|
8
|
+
canOfferDisplay: boolean;
|
|
9
|
+
/** The agent requests screen control (computer-use). */
|
|
10
|
+
requestsScreenControl: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** The phase of the approve page (drives the rendered panel). */
|
|
13
|
+
export type EnrollmentConsentPhase = "review" | "approving" | "approved" | "denied" | "error";
|
|
14
|
+
export type EnrollmentConsentProps = {
|
|
15
|
+
/** The short code the user typed / scanned (echoed back for confirmation). */
|
|
16
|
+
userCode: string;
|
|
17
|
+
machine: EnrollmentConsentMachine;
|
|
18
|
+
phase?: EnrollmentConsentPhase | undefined;
|
|
19
|
+
/** Approve with the chosen screen-control consent. */
|
|
20
|
+
onApprove?: ((allowScreenControl: boolean) => void) | undefined;
|
|
21
|
+
onDeny?: (() => void) | undefined;
|
|
22
|
+
/** Error message when phase === "error". */
|
|
23
|
+
errorMessage?: string | undefined;
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The user-facing APPROVE page for the device-flow enrollment: a LOUD,
|
|
28
|
+
* un-minimised whole-machine consent. Approving grants the agent FULL access to
|
|
29
|
+
* this machine — exec, files, terminal — and (when toggled) live screen control.
|
|
30
|
+
* The danger framing is deliberate (§18 hardening: whole-machine = loud consent),
|
|
31
|
+
* never buried. Renders review / approving / approved / denied / error phases.
|
|
32
|
+
*/
|
|
33
|
+
export declare function EnrollmentConsent({ userCode, machine, phase, onApprove, onDeny, errorMessage, className, }: EnrollmentConsentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** The poll state of an in-flight device-flow enrollment. */
|
|
2
|
+
export type DeviceFlowPhase = "pending" | "authorized" | "denied" | "expired" | "disabled";
|
|
3
|
+
export type EnrollmentDeviceFlowProps = {
|
|
4
|
+
/** The short user code the agent printed (shown big for the human to confirm). */
|
|
5
|
+
userCode: string;
|
|
6
|
+
/** Where the user approves — the same-origin device page. */
|
|
7
|
+
verificationUri: string;
|
|
8
|
+
/** The complete URI (code pre-filled) for a one-click / QR open. */
|
|
9
|
+
verificationUriComplete?: string | undefined;
|
|
10
|
+
/** The install one-liner the user ran (echoed for context). Optional. */
|
|
11
|
+
installCommand?: string | undefined;
|
|
12
|
+
phase?: DeviceFlowPhase | undefined;
|
|
13
|
+
/** Seconds remaining before the code expires (drives a quiet countdown). */
|
|
14
|
+
expiresInSeconds?: number | undefined;
|
|
15
|
+
onCopyCode?: (() => void) | undefined;
|
|
16
|
+
onCopyInstall?: (() => void) | undefined;
|
|
17
|
+
onOpenVerification?: (() => void) | undefined;
|
|
18
|
+
className?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The IN-SESSION device-flow panel: the agent (after the install one-liner) prints
|
|
22
|
+
* a short `userCode` + a `verificationUri`; this surfaces them so the user can open
|
|
23
|
+
* the approve page and confirm the code. Polls in the caller; this renders the
|
|
24
|
+
* pending → authorized/denied/expired progression with a connection pill. This is
|
|
25
|
+
* the FIRST step of the IA flow (device-flow → Machines list → attach/swap).
|
|
26
|
+
*/
|
|
27
|
+
export declare function EnrollmentDeviceFlow({ userCode, verificationUri, verificationUriComplete, installCommand, phase, expiresInSeconds, onCopyCode, onCopyInstall, onOpenVerification, className, }: EnrollmentDeviceFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { FileTreeNode, UseSandboxFilesResult } from "../hooks/use-sandbox-files";
|
|
3
|
+
export type FileBrowserProps = {
|
|
4
|
+
/** From `useSandboxFiles(...)`. */
|
|
5
|
+
result: UseSandboxFilesResult;
|
|
6
|
+
/**
|
|
7
|
+
* Rendered instead of the built-in tree when the file surface is unavailable
|
|
8
|
+
* (e.g. a `FileSystem.available === false` capability). Default: a quiet notice.
|
|
9
|
+
*/
|
|
10
|
+
fallback?: ReactNode | undefined;
|
|
11
|
+
/** Selection callback for the preview pane. */
|
|
12
|
+
onSelectFile?: ((path: string) => void) | undefined;
|
|
13
|
+
selectedPath?: string | undefined;
|
|
14
|
+
/** Render-prop to theme/replace a row entirely (the Pierre-swap escape hatch). */
|
|
15
|
+
renderNode?: ((node: FileTreeNode, depth: number, expanded: boolean) => ReactNode) | undefined;
|
|
16
|
+
/** Shown when the tree is empty (no files / not loaded yet). */
|
|
17
|
+
emptyState?: ReactNode | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Enable the file-manager affordances (toolbar, context menu, drag-drop move,
|
|
20
|
+
* inline rename, delete, new file/folder). Defaults to `true` when the hook
|
|
21
|
+
* exposes the mutation methods; pass `false` for a strictly read-only tree.
|
|
22
|
+
*/
|
|
23
|
+
editable?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Confirm a (recursive) delete before it runs. Return `false` to cancel.
|
|
26
|
+
* The default is an accessible, non-blocking confirmation dialog. Supply this
|
|
27
|
+
* callback to delegate confirmation to a host-owned dialog.
|
|
28
|
+
*/
|
|
29
|
+
confirmDelete?: ((node: FileTreeNode) => boolean | Promise<boolean>) | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The file MANAGER, fed by the FileSystem service via `useSandboxFiles`. This is
|
|
34
|
+
* a first-class editable tree (not a render-only view): lazy-expand with a
|
|
35
|
+
* spinner on the in-flight node, git-status tinting, full keyboard navigation,
|
|
36
|
+
* selection, and the mutating affordances wired straight to the hook —
|
|
37
|
+
*
|
|
38
|
+
* • drag-and-drop MOVE → `moveEntry(from, to)`
|
|
39
|
+
* • inline RENAME → `moveEntry(path, newPath)` (F2 / double-click / menu)
|
|
40
|
+
* • DELETE → `deleteEntry(path, recursive)` (Del / menu, confirmed)
|
|
41
|
+
* • NEW FILE / FOLDER → `createFile` / `createDir` (toolbar + menu), then open
|
|
42
|
+
* • right-click CONTEXT MENU
|
|
43
|
+
*
|
|
44
|
+
* `renderNode` is still honoured as the Pierre-swap escape hatch for the row
|
|
45
|
+
* chrome; the manager scaffolding (toolbar, dnd, menu, inline inputs) wraps it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Session } from "@opengeni/sdk";
|
|
2
|
+
export type FleetTileProps = {
|
|
3
|
+
session: Session;
|
|
4
|
+
/** Overrides the derived title (metadata.title/name, else the initial message). */
|
|
5
|
+
title?: string | undefined;
|
|
6
|
+
/** Extra line under the title — e.g. "drift check" or the worker's task. */
|
|
7
|
+
subtitle?: string | undefined;
|
|
8
|
+
onOpen?: ((session: Session) => void) | undefined;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
/** Best-effort display title for a session. */
|
|
12
|
+
export declare function sessionDisplayTitle(session: Session): string;
|
|
13
|
+
/**
|
|
14
|
+
* One session in the fleet/manager view: title, live status, model, and
|
|
15
|
+
* recency — dense but calm. Running sessions carry a breathing status dot
|
|
16
|
+
* and a faint accent edge so the live ones read at a glance.
|
|
17
|
+
*/
|
|
18
|
+
export declare function FleetTile({ session, title, subtitle, onOpen, className }: FleetTileProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { HumanInputAnswer, HumanInputQuestion, SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export type HumanInputAnswerDraft = {
|
|
4
|
+
values: string[];
|
|
5
|
+
other: string;
|
|
6
|
+
otherSelected: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type HumanInputFormMessages = {
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
submit: string;
|
|
12
|
+
skip: string;
|
|
13
|
+
submitting: string;
|
|
14
|
+
other: string;
|
|
15
|
+
deadlineLabel: string;
|
|
16
|
+
formatDeadline: (value: string) => string;
|
|
17
|
+
required: string;
|
|
18
|
+
minLength: (count: number) => string;
|
|
19
|
+
maxLength: (count: number) => string;
|
|
20
|
+
otherRequired: string;
|
|
21
|
+
minSelections: (count: number) => string;
|
|
22
|
+
maxSelections: (count: number) => string;
|
|
23
|
+
};
|
|
24
|
+
export declare const defaultHumanInputFormMessages: HumanInputFormMessages;
|
|
25
|
+
export type HumanInputFormProps = {
|
|
26
|
+
request: Pick<SessionHumanInputRequest, "id" | "questions" | "allowSkip" | "expiresAt">;
|
|
27
|
+
onSubmit: (response: SubmitHumanInputResponseRequest) => void | Promise<void>;
|
|
28
|
+
submitting?: boolean | undefined;
|
|
29
|
+
error?: string | null | undefined;
|
|
30
|
+
title?: ReactNode;
|
|
31
|
+
description?: ReactNode;
|
|
32
|
+
submitLabel?: string | undefined;
|
|
33
|
+
skipLabel?: string | undefined;
|
|
34
|
+
messages?: Partial<HumanInputFormMessages> | undefined;
|
|
35
|
+
autoFocus?: boolean | undefined;
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Styled but host-neutral renderer for one structured request. Hosts can use
|
|
40
|
+
* the headless `useHumanInputRequests` hook instead, or replace the title and
|
|
41
|
+
* description while retaining accessible field semantics and validation.
|
|
42
|
+
*/
|
|
43
|
+
export declare function HumanInputForm({ request, onSubmit, submitting, error, title, description, submitLabel, skipLabel, messages: messageOverrides, autoFocus, className, }: HumanInputFormProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare function answersFromDrafts(questions: HumanInputQuestion[], drafts: Record<string, HumanInputAnswerDraft>, messageOverrides?: Partial<HumanInputFormMessages>): {
|
|
45
|
+
answers: HumanInputAnswer[];
|
|
46
|
+
errors: Record<string, string>;
|
|
47
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MachineView, MetricSample } from "../types/machines";
|
|
2
|
+
export type MachineCardProps = {
|
|
3
|
+
machine: MachineView;
|
|
4
|
+
/** Attach/swap the session's active sandbox to this machine. */
|
|
5
|
+
onAttach?: ((machine: MachineView) => void) | undefined;
|
|
6
|
+
/** Whether an attach/swap is currently in flight (disables the affordance). */
|
|
7
|
+
attaching?: boolean | undefined;
|
|
8
|
+
/** Short recent history (e.g. 15m) — drives the card's CPU trend + preview. */
|
|
9
|
+
series?: MetricSample[] | undefined;
|
|
10
|
+
/** Open the full per-machine telemetry detail. Makes the whole card actionable. */
|
|
11
|
+
onOpenDetail?: ((machine: MachineView) => void) | undefined;
|
|
12
|
+
now?: number | undefined;
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* One machine in the Machines dashboard: name + kind + OS/arch, the fused HEALTH
|
|
17
|
+
* verdict, latest resource meters, a CPU trend that previews the history, live
|
|
18
|
+
* freshness, and attach/swap. The whole card opens the telemetry detail when
|
|
19
|
+
* `onOpenDetail` is wired. The session's active sandbox carries an accent edge.
|
|
20
|
+
*/
|
|
21
|
+
export declare function MachineCard({ machine, onAttach, attaching, series, onOpenDetail, now, className, }: MachineCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MachineKind, MachineState } from "../types/machines";
|
|
2
|
+
export type MachineDockBarProps = {
|
|
3
|
+
/** The active machine's display name. */
|
|
4
|
+
name: string;
|
|
5
|
+
kind: MachineKind;
|
|
6
|
+
state: MachineState;
|
|
7
|
+
/** Live sessions sharing this whole-machine lease (>1 ⇒ shared disclosure). */
|
|
8
|
+
sharedSessionCount?: number | undefined;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A slim bar that surfaces WHICH machine the dock surfaces (Files/Terminal/
|
|
13
|
+
* Desktop) are bound to + its connection status. Mounted above the dock tabs so
|
|
14
|
+
* the user always knows whether they are looking at the Modal box or their own
|
|
15
|
+
* machine, and whether it is online / reconnecting / offline. The surfaces below
|
|
16
|
+
* render IDENTICALLY regardless of backend — this bar is the only backend-aware
|
|
17
|
+
* chrome (the dock-parity contract: selfhosted == Modal for the surfaces).
|
|
18
|
+
*/
|
|
19
|
+
export declare function MachineDockBar({ name, kind, state, className }: MachineDockBarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export type SharedMachineDisclosureProps = {
|
|
21
|
+
sharedSessionCount: number;
|
|
22
|
+
/** Compact (inline strip) vs full (a notice block). */
|
|
23
|
+
density?: "compact" | "full" | undefined;
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The "shared — another session is on this machine" disclosure. Surfaced in the
|
|
28
|
+
* dock (and reused on the desktop take-control gate) so the user knows others are
|
|
29
|
+
* driving the same whole-machine lease. Render when `sharedSessionCount > 1`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SharedMachineDisclosure({ sharedSessionCount, density, className, }: SharedMachineDisclosureProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MachineState, MetricSample } from "../types/machines";
|
|
2
|
+
export type MachineHealthPillProps = {
|
|
3
|
+
state: MachineState;
|
|
4
|
+
metrics: MetricSample | null;
|
|
5
|
+
now?: number | undefined;
|
|
6
|
+
size?: "sm" | "md" | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare function MachineHealthPill({ state, metrics, now, size, className, }: MachineHealthPillProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MetricSample } from "../types/machines";
|
|
2
|
+
export type MachineMetricsProps = {
|
|
3
|
+
/** The latest metric sample, or null when the machine hasn't reported yet. */
|
|
4
|
+
metrics: MetricSample | null;
|
|
5
|
+
/** Compact (dashboard row) vs full (the dock detail). */
|
|
6
|
+
density?: "compact" | "full" | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Per-machine resource meters: CPU%, load average, memory, disk, and GPU when
|
|
11
|
+
* present. Renders the M2 `machine_metrics_latest` sample. When `metrics` is
|
|
12
|
+
* null the panel shows a quiet "no samples yet" placeholder (offline / just
|
|
13
|
+
* enrolled). GPU rows only render when `gpuUtilPct` is non-null.
|
|
14
|
+
*/
|
|
15
|
+
export declare function MachineMetrics({ metrics, density, className }: MachineMetricsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ConnectionStatus, type MachineState } from "../types/machines";
|
|
2
|
+
export type ConnectionStatusMeta = {
|
|
3
|
+
label: string;
|
|
4
|
+
dotClassName: string;
|
|
5
|
+
badgeClassName: string;
|
|
6
|
+
/** Live/transient states breathe; settled states hold still. */
|
|
7
|
+
pulse: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Token-backed meta for the three connection-status pill values. */
|
|
10
|
+
export declare const CONNECTION_STATUS_META: Record<ConnectionStatus, ConnectionStatusMeta>;
|
|
11
|
+
export type MachineStateBadgeMeta = {
|
|
12
|
+
label: string;
|
|
13
|
+
badgeClassName: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The non-connection state badges that ride ALONGSIDE the connection pill —
|
|
17
|
+
* `consent_required` / `display_unavailable` / `enrolling` describe a capability
|
|
18
|
+
* limitation, not reachability, so they render as their own tinted chip.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MACHINE_STATE_BADGE_META: Partial<Record<MachineState, MachineStateBadgeMeta>>;
|
|
21
|
+
export type ConnectionStatusPillProps = {
|
|
22
|
+
status: ConnectionStatus;
|
|
23
|
+
/** Override the label ("Online" -> "Connected", ...). */
|
|
24
|
+
label?: string | undefined;
|
|
25
|
+
size?: "sm" | "md" | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The connection-status pill (online / reconnecting / offline) surfaced across
|
|
30
|
+
* the Machines dashboard, the dock header, and the session timeline. Reconnecting
|
|
31
|
+
* breathes (the resiliency-as-headline blip), online/offline hold still.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ConnectionStatusPill({ status, label, size, className, }: ConnectionStatusPillProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export type ConnectionDotProps = {
|
|
35
|
+
status: ConnectionStatus;
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
/** Just the dot — for dense rows, the dock header, and timeline notices. */
|
|
39
|
+
export declare function ConnectionDot({ status, className }: ConnectionDotProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export type MachineStatusPillProps = {
|
|
41
|
+
/** The machine's full state — drives the connection pill + any state badge. */
|
|
42
|
+
state: MachineState;
|
|
43
|
+
/** How many live sessions share this lease (renders a "Shared" chip when >1). */
|
|
44
|
+
sharedSessionCount?: number | undefined;
|
|
45
|
+
size?: "sm" | "md" | undefined;
|
|
46
|
+
className?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The composite machine status surface: the connection pill PLUS any
|
|
50
|
+
* consent/display/enrolling badge PLUS a shared-in-use chip. One component the
|
|
51
|
+
* dashboard row, the dock header, and the timeline all reuse so the status
|
|
52
|
+
* language is identical everywhere.
|
|
53
|
+
*/
|
|
54
|
+
export declare function MachineStatusPill({ state, sharedSessionCount, size, className, }: MachineStatusPillProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MachineState, MetricSample } from "../../types/machines";
|
|
2
|
+
export type HealthLevel = "healthy" | "degraded" | "critical" | "offline" | "unknown";
|
|
3
|
+
export type HealthVerdict = {
|
|
4
|
+
level: HealthLevel;
|
|
5
|
+
/** Title-case label for the pill ("Healthy", "Under load", "Critical", …). */
|
|
6
|
+
label: string;
|
|
7
|
+
/** One short human clause naming the dominant cause ("Memory 94%", "No display"…). */
|
|
8
|
+
reason: string;
|
|
9
|
+
/** The latest sample is older than we'd expect from a live agent (~5s cadence). */
|
|
10
|
+
stale: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** Fold a machine's reachability + latest sample + wall-clock into one verdict. */
|
|
13
|
+
export declare function deriveHealth(state: MachineState, metrics: MetricSample | null, now?: number): HealthVerdict;
|
|
14
|
+
/**
|
|
15
|
+
* The token color ramp for a health level. Green/amber/red/grey is the
|
|
16
|
+
* universally-legible traffic model; we reserve it for the HEALTH verdict
|
|
17
|
+
* specifically (per-resource meters keep their own ramp in `machine-metrics`).
|
|
18
|
+
*/
|
|
19
|
+
export declare const HEALTH_TOKEN: Record<HealthLevel, {
|
|
20
|
+
text: string;
|
|
21
|
+
dot: string;
|
|
22
|
+
soft: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** Live/transient levels breathe; settled levels hold still. */
|
|
25
|
+
export declare function healthPulses(level: HealthLevel): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MachineView, MetricSample } from "../../types/machines";
|
|
2
|
+
import { type MetricWindow } from "./series";
|
|
3
|
+
export type MachineDetailProps = {
|
|
4
|
+
machine: MachineView;
|
|
5
|
+
/** Downsampled history for the active window (from `fetchSeries`). */
|
|
6
|
+
series: MetricSample[];
|
|
7
|
+
window: MetricWindow;
|
|
8
|
+
onWindowChange: (w: MetricWindow) => void;
|
|
9
|
+
loadingSeries?: boolean | undefined;
|
|
10
|
+
onBack?: (() => void) | undefined;
|
|
11
|
+
now?: number | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare function MachineDetail({ machine, series, window, onWindowChange, loadingSeries, onBack, now, className, }: MachineDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type SeriesPoint = {
|
|
2
|
+
t: number;
|
|
3
|
+
v: number | null;
|
|
4
|
+
};
|
|
5
|
+
export type MetricHistoryChartProps = {
|
|
6
|
+
points: SeriesPoint[];
|
|
7
|
+
/** Fixed ceiling (100 for %) or "auto" to fit the data with headroom. */
|
|
8
|
+
yMax?: number | "auto";
|
|
9
|
+
yMin?: number;
|
|
10
|
+
/** Format a value for the axis + readout (default: rounded + unit). */
|
|
11
|
+
format?: (v: number) => string;
|
|
12
|
+
unit?: string;
|
|
13
|
+
/** Stroke/fill hue — any CSS color; pass a token var to stay theme-safe. */
|
|
14
|
+
color?: string;
|
|
15
|
+
thresholds?: {
|
|
16
|
+
warn?: number | undefined;
|
|
17
|
+
crit?: number | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
height?: number;
|
|
20
|
+
/** Human range label for the empty state ("in the last hour"). */
|
|
21
|
+
rangeLabel?: string | undefined;
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare function MetricHistoryChart({ points, yMax, yMin, format, unit, color, thresholds, height, rangeLabel, className, }: MetricHistoryChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SeriesPoint } from "./metric-history-chart";
|
|
2
|
+
export type MetricSparklineProps = {
|
|
3
|
+
points: SeriesPoint[];
|
|
4
|
+
color?: string;
|
|
5
|
+
yMax?: number | "auto";
|
|
6
|
+
height?: number;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare function MetricSparkline({ points, color, yMax, height, className, }: MetricSparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MetricSample } from "../../types/machines";
|
|
2
|
+
import type { SeriesPoint } from "./metric-history-chart";
|
|
3
|
+
export type MetricWindow = "15m" | "1h" | "6h" | "24h";
|
|
4
|
+
export declare const METRIC_WINDOWS: MetricWindow[];
|
|
5
|
+
export declare const WINDOW_LABEL: Record<MetricWindow, string>;
|
|
6
|
+
export type MetricKey = "cpu" | "mem" | "disk" | "load" | "gpu";
|
|
7
|
+
export type MetricDef = {
|
|
8
|
+
key: MetricKey;
|
|
9
|
+
title: string;
|
|
10
|
+
unit: string;
|
|
11
|
+
yMax: number | "auto";
|
|
12
|
+
color: string;
|
|
13
|
+
thresholds?: {
|
|
14
|
+
warn?: number;
|
|
15
|
+
crit?: number;
|
|
16
|
+
};
|
|
17
|
+
pick: (s: MetricSample) => number | null;
|
|
18
|
+
/** Big current-value string for tiles/badges. */
|
|
19
|
+
current: (s: MetricSample) => string;
|
|
20
|
+
/** Optional sub-line under the current value. */
|
|
21
|
+
sub?: (s: MetricSample) => string | null;
|
|
22
|
+
};
|
|
23
|
+
export declare const METRICS: MetricDef[];
|
|
24
|
+
export declare function pointsFor(def: MetricDef, samples: MetricSample[]): SeriesPoint[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MachineView, MetricSample } from "../types/machines";
|
|
2
|
+
export type MachinesDashboardProps = {
|
|
3
|
+
machines: MachineView[];
|
|
4
|
+
/** The session's active sandbox id (drives the per-card "Active" marker). */
|
|
5
|
+
activeSandboxId?: string | null | undefined;
|
|
6
|
+
loading?: boolean | undefined;
|
|
7
|
+
error?: Error | null | undefined;
|
|
8
|
+
/** Attach/swap the session's active sandbox to a machine. */
|
|
9
|
+
onAttach?: ((machine: MachineView) => void) | undefined;
|
|
10
|
+
/** The sandbox id currently being attached/swapped to (disables that card). */
|
|
11
|
+
attachingSandboxId?: string | null | undefined;
|
|
12
|
+
/** Short recent history per machine (keyed by sandboxId) — drives card sparklines. */
|
|
13
|
+
seriesByMachine?: Record<string, MetricSample[]> | undefined;
|
|
14
|
+
/** Open the per-machine telemetry detail (makes each card actionable). */
|
|
15
|
+
onOpenDetail?: ((machine: MachineView) => void) | undefined;
|
|
16
|
+
/** Shared clock so freshness/relative times render consistently across cards. */
|
|
17
|
+
now?: number | undefined;
|
|
18
|
+
/** Open the enrollment flow (the "Enroll a machine" CTA). */
|
|
19
|
+
onEnroll?: (() => void) | undefined;
|
|
20
|
+
onRefresh?: (() => void) | undefined;
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The workspace Machines dashboard: the fleet of selfhosted enrollments + the
|
|
25
|
+
* session's managed sandbox, each with its connection-status pill, state badges,
|
|
26
|
+
* latest metrics, and an attach/swap affordance. Renders the empty state (no
|
|
27
|
+
* machines → enroll CTA), a load error, and the populated grid. The component
|
|
28
|
+
* is purely presentational — feed it `MachinesResponse` data via `useMachines`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function MachinesDashboard({ machines, activeSandboxId, loading, error, onAttach, attachingSandboxId, seriesByMachine, onOpenDetail, now, onEnroll, onRefresh, className, }: MachinesDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default renderer for chat message bodies in {@link MessageTimeline}.
|
|
3
|
+
*
|
|
4
|
+
* Agent (and user) messages arrive as GitHub-flavored markdown. This turns the
|
|
5
|
+
* raw text into styled HTML using `react-markdown` + `remark-gfm`, themed to the
|
|
6
|
+
* package's `og-*` design tokens so it reads as one cohesive dark surface — no
|
|
7
|
+
* stock Tailwind colors leak in.
|
|
8
|
+
*
|
|
9
|
+
* It re-parses on every render, which is exactly right for streaming: a body
|
|
10
|
+
* that is still arriving (an unterminated `**`, a half-open code fence, a table
|
|
11
|
+
* mid-row) renders as best-effort markdown and resolves cleanly as the rest of
|
|
12
|
+
* the tokens land. Consumers who want a different renderer can still pass
|
|
13
|
+
* `renderMessageText` to `MessageTimeline` to override this entirely.
|
|
14
|
+
*/
|
|
15
|
+
export type MarkdownProps = {
|
|
16
|
+
children: string;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* While true, newly arrived source fades in through tip ink (`.og-stream-ink`):
|
|
20
|
+
* an age window over each append batch — fast streams keep a large soft band,
|
|
21
|
+
* slow streams a tight tip. Paint-only: the DOM always holds the full truthful
|
|
22
|
+
* text. Once streaming ends and trailing ink settles, the body re-renders as
|
|
23
|
+
* plain markdown with a short local settle breath (no page-wide view
|
|
24
|
+
* transition — that blinked the whole document).
|
|
25
|
+
*/
|
|
26
|
+
streaming?: boolean | undefined;
|
|
27
|
+
};
|
|
28
|
+
declare function MarkdownImpl({ children, className, streaming }: MarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
/** Memoized so streaming re-renders of the parent don't re-parse settled bodies. */
|
|
30
|
+
export declare const Markdown: import("react").MemoExoticComponent<typeof MarkdownImpl>;
|
|
31
|
+
export {};
|