@opengeni/react 0.28.2 → 0.32.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.
Files changed (208) hide show
  1. package/dist/approvals.d.ts +14 -0
  2. package/dist/{chunk-M7X4JZOD.js → chunk-4QOQ2DSR.js} +8 -1
  3. package/dist/chunk-4QOQ2DSR.js.map +1 -0
  4. package/dist/{chunk-HQFPO7VX.js → chunk-7CJOAW3V.js} +24 -3
  5. package/dist/{chunk-HQFPO7VX.js.map → chunk-7CJOAW3V.js.map} +1 -1
  6. package/dist/{chunk-PMSGE233.js → chunk-A2WITZTI.js} +377 -113
  7. package/dist/chunk-A2WITZTI.js.map +1 -0
  8. package/dist/{chunk-BC6RKIHS.js → chunk-GZ4KR67U.js} +11 -11
  9. package/dist/{chunk-4F2YLLHP.js → chunk-KZRUYCL4.js} +14 -17
  10. package/dist/chunk-KZRUYCL4.js.map +1 -0
  11. package/dist/{chunk-OCHBZ2X7.js → chunk-TCCE5ZU5.js} +192 -28
  12. package/dist/chunk-TCCE5ZU5.js.map +1 -0
  13. package/dist/chunk-U255M5EZ.js +178 -0
  14. package/dist/chunk-U255M5EZ.js.map +1 -0
  15. package/dist/{chunk-XVVQP7A4.js → chunk-WY2QN2CX.js} +2539 -2174
  16. package/dist/chunk-WY2QN2CX.js.map +1 -0
  17. package/dist/chunk-ZNNE2VES.js +6413 -0
  18. package/dist/chunk-ZNNE2VES.js.map +1 -0
  19. package/dist/client.d.ts +33 -0
  20. package/dist/commands/index.d.ts +3 -0
  21. package/dist/commands/registry.d.ts +41 -0
  22. package/dist/commands/types.d.ts +85 -0
  23. package/dist/components/approval-surface.d.ts +28 -0
  24. package/dist/components/chat-composer.d.ts +51 -0
  25. package/dist/components/code-editor.d.ts +43 -0
  26. package/dist/components/command-palette.d.ts +25 -0
  27. package/dist/components/composer-transcription-control.d.ts +36 -0
  28. package/dist/components/composer.d.ts +277 -0
  29. package/dist/components/copy-button.d.ts +26 -0
  30. package/dist/components/desktop-viewer.d.ts +85 -0
  31. package/dist/components/diff-view.d.ts +38 -0
  32. package/dist/components/enrollment-consent.d.ts +33 -0
  33. package/dist/components/enrollment-device-flow.d.ts +27 -0
  34. package/dist/components/file-browser.d.ts +47 -0
  35. package/dist/components/fleet-tile.d.ts +18 -0
  36. package/dist/components/human-input-form.d.ts +47 -0
  37. package/dist/components/machine-card.d.ts +21 -0
  38. package/dist/components/machine-dock-bar.d.ts +31 -0
  39. package/dist/components/machine-health-pill.d.ts +9 -0
  40. package/dist/components/machine-metrics.d.ts +15 -0
  41. package/dist/components/machine-status-pill.d.ts +54 -0
  42. package/dist/components/machines/health.d.ts +25 -0
  43. package/dist/components/machines/machine-detail.d.ts +14 -0
  44. package/dist/components/machines/metric-history-chart.d.ts +24 -0
  45. package/dist/components/machines/metric-sparkline.d.ts +9 -0
  46. package/dist/components/machines/series.d.ts +24 -0
  47. package/dist/components/machines-dashboard.d.ts +30 -0
  48. package/dist/components/markdown.d.ts +31 -0
  49. package/dist/components/message-timeline.d.ts +98 -0
  50. package/dist/components/model-picker.d.ts +19 -0
  51. package/dist/components/pierre-diff.d.ts +34 -0
  52. package/dist/components/pierre-file.d.ts +27 -0
  53. package/dist/components/queue-draft-policy.d.ts +7 -0
  54. package/dist/components/queue-surface-implementation.d.ts +20 -0
  55. package/dist/components/queue-surface-state.d.ts +12 -0
  56. package/dist/components/queue-surface.d.ts +12 -0
  57. package/dist/components/sandbox-files.d.ts +49 -0
  58. package/dist/components/sandbox-terminal.d.ts +123 -0
  59. package/dist/components/sandbox-workspace.d.ts +128 -0
  60. package/dist/components/session-chrome.d.ts +70 -0
  61. package/dist/components/session-status.d.ts +25 -0
  62. package/dist/components/soften-streaming-markdown.d.ts +13 -0
  63. package/dist/components/stream-reveal.d.ts +37 -0
  64. package/dist/components/tip-follow.d.ts +139 -0
  65. package/dist/components/tooltip.d.ts +16 -0
  66. package/dist/components/workbench-changes.d.ts +34 -0
  67. package/dist/components/workspace-dock.d.ts +35 -0
  68. package/dist/composer.d.ts +11 -7
  69. package/dist/composer.js +9 -6
  70. package/dist/hooks/internal.d.ts +46 -0
  71. package/dist/hooks/use-available-models.d.ts +37 -0
  72. package/dist/hooks/use-billing-usage.d.ts +26 -0
  73. package/dist/hooks/use-codex-accounts.d.ts +69 -0
  74. package/dist/{use-composer-ClHy1rkL.d.ts → hooks/use-composer.d.ts} +16 -24
  75. package/dist/hooks/use-desktop-stream.d.ts +43 -0
  76. package/dist/hooks/use-environments.d.ts +35 -0
  77. package/dist/{use-file-attachments-BmT8WtqO.d.ts → hooks/use-file-attachments.d.ts} +6 -9
  78. package/dist/hooks/use-goal.d.ts +46 -0
  79. package/dist/hooks/use-human-input.d.ts +26 -0
  80. package/dist/hooks/use-last-started-turn-policy.d.ts +27 -0
  81. package/dist/hooks/use-machine-chip.d.ts +54 -0
  82. package/dist/hooks/use-machines.d.ts +81 -0
  83. package/dist/hooks/use-packs.d.ts +27 -0
  84. package/dist/hooks/use-relay-frame-stream.d.ts +53 -0
  85. package/dist/hooks/use-rigs.d.ts +87 -0
  86. package/dist/hooks/use-sandbox-files.d.ts +108 -0
  87. package/dist/hooks/use-sandbox-git.d.ts +58 -0
  88. package/dist/hooks/use-sandbox-terminal.d.ts +62 -0
  89. package/dist/hooks/use-scheduled-tasks.d.ts +15 -0
  90. package/dist/hooks/use-session-capabilities.d.ts +83 -0
  91. package/dist/hooks/use-session-control.d.ts +22 -0
  92. package/dist/hooks/use-session-events.d.ts +92 -0
  93. package/dist/hooks/use-session-lineage.d.ts +17 -0
  94. package/dist/hooks/use-session-mcp-approval-policy.d.ts +23 -0
  95. package/dist/hooks/use-session.d.ts +23 -0
  96. package/dist/hooks/use-slash-commands.d.ts +66 -0
  97. package/dist/hooks/use-terminal-stream.d.ts +46 -0
  98. package/dist/hooks/use-transcription.d.ts +73 -0
  99. package/dist/hooks/use-turn-queue.d.ts +44 -0
  100. package/dist/hooks/use-voice-input.d.ts +25 -0
  101. package/dist/hooks/use-windowed-sections.d.ts +42 -0
  102. package/dist/hooks/use-workspace-capture.d.ts +49 -0
  103. package/dist/hooks/use-workspace-edit.d.ts +73 -0
  104. package/dist/hooks/use-workspace-sessions.d.ts +30 -0
  105. package/dist/hooks/use-workspaces.d.ts +22 -0
  106. package/dist/human-input.d.ts +18 -0
  107. package/dist/index.d.ts +144 -2119
  108. package/dist/index.js +421 -324
  109. package/dist/index.js.map +1 -1
  110. package/dist/lib/clipboard.d.ts +7 -0
  111. package/dist/lib/cn.d.ts +3 -0
  112. package/dist/lib/format.d.ts +48 -0
  113. package/dist/lib/git-patch.d.ts +8 -0
  114. package/dist/lib/motion-inspect.d.ts +5 -0
  115. package/dist/lib/motion.d.ts +14 -0
  116. package/dist/lib/noto-sans-arabic-loader.d.ts +1 -0
  117. package/dist/lib/noto-sans-jp-loader.generated.d.ts +1 -0
  118. package/dist/lib/relay-wire.d.ts +30 -0
  119. package/dist/lib/use-portal-token-style.d.ts +9 -0
  120. package/dist/lib/use-theme-type.d.ts +5 -0
  121. package/dist/lib/use-unicode-fonts.d.ts +12 -0
  122. package/dist/lib/xterm-renderer.d.ts +19 -0
  123. package/dist/lib/xterm-theme.d.ts +75 -0
  124. package/dist/machines.d.ts +30 -413
  125. package/dist/machines.js +3 -3
  126. package/dist/model-policy.d.ts +32 -0
  127. package/dist/model-policy.js +33 -0
  128. package/dist/model-policy.js.map +1 -0
  129. package/dist/provider.d.ts +16 -0
  130. package/dist/{queue-surface-implementation-UQ535OKQ.js → queue-surface-implementation-THPAKGMD.js} +2 -2
  131. package/dist/{queue-surface-implementation-UQ535OKQ.js.map → queue-surface-implementation-THPAKGMD.js.map} +1 -1
  132. package/dist/session-context.d.ts +82 -0
  133. package/dist/session-ui.d.ts +10 -7
  134. package/dist/session-ui.js +9 -5
  135. package/dist/session.d.ts +28 -6
  136. package/dist/session.js +11 -11
  137. package/dist/timeline/activity-rail.d.ts +19 -0
  138. package/dist/timeline/disclosure-context.d.ts +14 -0
  139. package/dist/timeline/entrance.d.ts +14 -0
  140. package/dist/timeline/fleet-decision-projection.d.ts +9 -0
  141. package/dist/timeline/fleet-decision-row.d.ts +11 -0
  142. package/dist/timeline/fold-memory.d.ts +15 -0
  143. package/dist/timeline/index.d.ts +18 -0
  144. package/dist/timeline/parsers.d.ts +96 -0
  145. package/dist/timeline/projection.d.ts +38 -0
  146. package/dist/timeline/registry.d.ts +40 -0
  147. package/dist/timeline/screenshot-lightbox.d.ts +26 -0
  148. package/dist/timeline/seen-activity-ids.d.ts +2 -0
  149. package/dist/timeline/shared.d.ts +125 -0
  150. package/dist/timeline/tool-diff.d.ts +8 -0
  151. package/dist/timeline/tool-display-name.d.ts +10 -0
  152. package/dist/timeline/tool-renderers.d.ts +5 -0
  153. package/dist/timeline/turn-summary.d.ts +116 -0
  154. package/dist/{use-turn-queue-Drm_ypue.d.ts → timeline/types.d.ts} +57 -67
  155. package/dist/types/machines.d.ts +11 -0
  156. package/package.json +8 -4
  157. package/src/client.ts +1 -0
  158. package/src/components/composer-transcription-control.tsx +278 -130
  159. package/src/components/composer.tsx +20 -15
  160. package/src/components/copy-button.tsx +127 -0
  161. package/src/components/markdown.tsx +231 -32
  162. package/src/components/message-timeline.tsx +1382 -378
  163. package/src/components/model-picker.tsx +83 -43
  164. package/src/components/queue-surface-implementation.tsx +1 -1
  165. package/src/components/session-chrome.tsx +942 -0
  166. package/src/components/soften-streaming-markdown.ts +205 -0
  167. package/src/components/stream-reveal.ts +195 -0
  168. package/src/components/tip-follow.ts +459 -0
  169. package/src/components/tooltip.tsx +103 -0
  170. package/src/composer.ts +6 -0
  171. package/src/hooks/internal.ts +30 -4
  172. package/src/hooks/use-available-models.ts +51 -4
  173. package/src/hooks/use-composer.ts +24 -18
  174. package/src/hooks/use-last-started-turn-policy.ts +95 -0
  175. package/src/hooks/use-session-events.ts +359 -5
  176. package/src/hooks/use-voice-input.ts +232 -0
  177. package/src/index.ts +49 -1
  178. package/src/lib/clipboard.ts +58 -0
  179. package/src/lib/format.ts +18 -0
  180. package/src/lib/motion-inspect.ts +5 -0
  181. package/src/lib/motion.ts +80 -0
  182. package/src/model-policy.ts +210 -0
  183. package/src/session-ui.ts +7 -0
  184. package/src/session.ts +2 -0
  185. package/src/timeline/activity-rail.tsx +46 -7
  186. package/src/timeline/entrance.tsx +10 -0
  187. package/src/timeline/fold-memory.ts +52 -0
  188. package/src/timeline/index.ts +11 -1
  189. package/src/timeline/projection.ts +252 -47
  190. package/src/timeline/seen-activity-ids.ts +19 -0
  191. package/src/timeline/shared.tsx +1 -1
  192. package/src/timeline/tool-renderers.tsx +75 -6
  193. package/src/timeline/turn-summary.tsx +387 -97
  194. package/src/timeline/types.ts +47 -0
  195. package/styles/index.css +99 -7
  196. package/styles/tokens.css +44 -3
  197. package/dist/chunk-4F2YLLHP.js.map +0 -1
  198. package/dist/chunk-M7X4JZOD.js.map +0 -1
  199. package/dist/chunk-OCHBZ2X7.js.map +0 -1
  200. package/dist/chunk-PMSGE233.js.map +0 -1
  201. package/dist/chunk-WAA247AB.js +0 -3858
  202. package/dist/chunk-WAA247AB.js.map +0 -1
  203. package/dist/chunk-XVVQP7A4.js.map +0 -1
  204. package/dist/composer-BMzimGTO.d.ts +0 -528
  205. package/dist/session-C3tIXLim.d.ts +0 -264
  206. package/dist/session-context-CAjlaeZb.d.ts +0 -84
  207. package/dist/session-ui-B_7cfN5u.d.ts +0 -259
  208. /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 {};