@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
@@ -1,413 +1,30 @@
1
- import { MachineState, MetricSample, MachineView, MachineKind, MachinesResponse } from '@opengeni/sdk';
2
- export { MachineKind, MachineMetricsSeriesResponse, MachineState, MachineView, MachinesResponse, MetricSample } from '@opengeni/sdk';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { C as ClientOverride } from './session-context-CAjlaeZb.js';
5
-
6
- /**
7
- * The three connection-status pill values the UI surfaces across the dashboard,
8
- * the dock, and the timeline. `consent_required` / `display_unavailable` /
9
- * `enrolling` are NOT connection states — they map onto a connection state for
10
- * the pill and carry their own badge separately.
11
- */
12
- type ConnectionStatus = "online" | "reconnecting" | "offline";
13
- /** Project a machine `state` onto its connection-status pill value. */
14
- declare function connectionStatusForState(state: MachineState): ConnectionStatus;
15
-
16
- type ConnectionStatusMeta = {
17
- label: string;
18
- dotClassName: string;
19
- badgeClassName: string;
20
- /** Live/transient states breathe; settled states hold still. */
21
- pulse: boolean;
22
- };
23
- /** Token-backed meta for the three connection-status pill values. */
24
- declare const CONNECTION_STATUS_META: Record<ConnectionStatus, ConnectionStatusMeta>;
25
- type MachineStateBadgeMeta = {
26
- label: string;
27
- badgeClassName: string;
28
- };
29
- /**
30
- * The non-connection state badges that ride ALONGSIDE the connection pill —
31
- * `consent_required` / `display_unavailable` / `enrolling` describe a capability
32
- * limitation, not reachability, so they render as their own tinted chip.
33
- */
34
- declare const MACHINE_STATE_BADGE_META: Partial<Record<MachineState, MachineStateBadgeMeta>>;
35
- type ConnectionStatusPillProps = {
36
- status: ConnectionStatus;
37
- /** Override the label ("Online" -> "Connected", ...). */
38
- label?: string | undefined;
39
- size?: "sm" | "md" | undefined;
40
- className?: string | undefined;
41
- };
42
- /**
43
- * The connection-status pill (online / reconnecting / offline) surfaced across
44
- * the Machines dashboard, the dock header, and the session timeline. Reconnecting
45
- * breathes (the resiliency-as-headline blip), online/offline hold still.
46
- */
47
- declare function ConnectionStatusPill({ status, label, size, className, }: ConnectionStatusPillProps): react_jsx_runtime.JSX.Element;
48
- type ConnectionDotProps = {
49
- status: ConnectionStatus;
50
- className?: string | undefined;
51
- };
52
- /** Just the dot — for dense rows, the dock header, and timeline notices. */
53
- declare function ConnectionDot({ status, className }: ConnectionDotProps): react_jsx_runtime.JSX.Element;
54
- type MachineStatusPillProps = {
55
- /** The machine's full state — drives the connection pill + any state badge. */
56
- state: MachineState;
57
- /** How many live sessions share this lease (renders a "Shared" chip when >1). */
58
- sharedSessionCount?: number | undefined;
59
- size?: "sm" | "md" | undefined;
60
- className?: string | undefined;
61
- };
62
- /**
63
- * The composite machine status surface: the connection pill PLUS any
64
- * consent/display/enrolling badge PLUS a shared-in-use chip. One component the
65
- * dashboard row, the dock header, and the timeline all reuse so the status
66
- * language is identical everywhere.
67
- */
68
- declare function MachineStatusPill({ state, sharedSessionCount, size, className, }: MachineStatusPillProps): react_jsx_runtime.JSX.Element;
69
-
70
- type MachineMetricsProps = {
71
- /** The latest metric sample, or null when the machine hasn't reported yet. */
72
- metrics: MetricSample | null;
73
- /** Compact (dashboard row) vs full (the dock detail). */
74
- density?: "compact" | "full" | undefined;
75
- className?: string | undefined;
76
- };
77
- /**
78
- * Per-machine resource meters: CPU%, load average, memory, disk, and GPU when
79
- * present. Renders the M2 `machine_metrics_latest` sample. When `metrics` is
80
- * null the panel shows a quiet "no samples yet" placeholder (offline / just
81
- * enrolled). GPU rows only render when `gpuUtilPct` is non-null.
82
- */
83
- declare function MachineMetrics({ metrics, density, className }: MachineMetricsProps): react_jsx_runtime.JSX.Element;
84
-
85
- type MachineCardProps = {
86
- machine: MachineView;
87
- /** Attach/swap the session's active sandbox to this machine. */
88
- onAttach?: ((machine: MachineView) => void) | undefined;
89
- /** Whether an attach/swap is currently in flight (disables the affordance). */
90
- attaching?: boolean | undefined;
91
- /** Short recent history (e.g. 15m) — drives the card's CPU trend + preview. */
92
- series?: MetricSample[] | undefined;
93
- /** Open the full per-machine telemetry detail. Makes the whole card actionable. */
94
- onOpenDetail?: ((machine: MachineView) => void) | undefined;
95
- now?: number | undefined;
96
- className?: string | undefined;
97
- };
98
- /**
99
- * One machine in the Machines dashboard: name + kind + OS/arch, the fused HEALTH
100
- * verdict, latest resource meters, a CPU trend that previews the history, live
101
- * freshness, and attach/swap. The whole card opens the telemetry detail when
102
- * `onOpenDetail` is wired. The session's active sandbox carries an accent edge.
103
- */
104
- declare function MachineCard({ machine, onAttach, attaching, series, onOpenDetail, now, className, }: MachineCardProps): react_jsx_runtime.JSX.Element;
105
-
106
- type MachineHealthPillProps = {
107
- state: MachineState;
108
- metrics: MetricSample | null;
109
- now?: number | undefined;
110
- size?: "sm" | "md" | undefined;
111
- className?: string | undefined;
112
- };
113
- declare function MachineHealthPill({ state, metrics, now, size, className, }: MachineHealthPillProps): react_jsx_runtime.JSX.Element;
114
-
115
- type HealthLevel = "healthy" | "degraded" | "critical" | "offline" | "unknown";
116
- type HealthVerdict = {
117
- level: HealthLevel;
118
- /** Title-case label for the pill ("Healthy", "Under load", "Critical", …). */
119
- label: string;
120
- /** One short human clause naming the dominant cause ("Memory 94%", "No display"…). */
121
- reason: string;
122
- /** The latest sample is older than we'd expect from a live agent (~5s cadence). */
123
- stale: boolean;
124
- };
125
- /** Fold a machine's reachability + latest sample + wall-clock into one verdict. */
126
- declare function deriveHealth(state: MachineState, metrics: MetricSample | null, now?: number): HealthVerdict;
127
- /**
128
- * The token color ramp for a health level. Green/amber/red/grey is the
129
- * universally-legible traffic model; we reserve it for the HEALTH verdict
130
- * specifically (per-resource meters keep their own ramp in `machine-metrics`).
131
- */
132
- declare const HEALTH_TOKEN: Record<HealthLevel, {
133
- text: string;
134
- dot: string;
135
- soft: string;
136
- }>;
137
- /** Live/transient levels breathe; settled levels hold still. */
138
- declare function healthPulses(level: HealthLevel): boolean;
139
-
140
- type SeriesPoint = {
141
- t: number;
142
- v: number | null;
143
- };
144
- type MetricHistoryChartProps = {
145
- points: SeriesPoint[];
146
- /** Fixed ceiling (100 for %) or "auto" to fit the data with headroom. */
147
- yMax?: number | "auto";
148
- yMin?: number;
149
- /** Format a value for the axis + readout (default: rounded + unit). */
150
- format?: (v: number) => string;
151
- unit?: string;
152
- /** Stroke/fill hue — any CSS color; pass a token var to stay theme-safe. */
153
- color?: string;
154
- thresholds?: {
155
- warn?: number | undefined;
156
- crit?: number | undefined;
157
- } | undefined;
158
- height?: number;
159
- /** Human range label for the empty state ("in the last hour"). */
160
- rangeLabel?: string | undefined;
161
- className?: string | undefined;
162
- };
163
- declare function MetricHistoryChart({ points, yMax, yMin, format, unit, color, thresholds, height, rangeLabel, className, }: MetricHistoryChartProps): react_jsx_runtime.JSX.Element;
164
-
165
- type MetricSparklineProps = {
166
- points: SeriesPoint[];
167
- color?: string;
168
- yMax?: number | "auto";
169
- height?: number;
170
- className?: string | undefined;
171
- };
172
- declare function MetricSparkline({ points, color, yMax, height, className, }: MetricSparklineProps): react_jsx_runtime.JSX.Element;
173
-
174
- type MetricWindow = "15m" | "1h" | "6h" | "24h";
175
- declare const METRIC_WINDOWS: MetricWindow[];
176
- declare const WINDOW_LABEL: Record<MetricWindow, string>;
177
- type MetricKey = "cpu" | "mem" | "disk" | "load" | "gpu";
178
- type MetricDef = {
179
- key: MetricKey;
180
- title: string;
181
- unit: string;
182
- yMax: number | "auto";
183
- color: string;
184
- thresholds?: {
185
- warn?: number;
186
- crit?: number;
187
- };
188
- pick: (s: MetricSample) => number | null;
189
- /** Big current-value string for tiles/badges. */
190
- current: (s: MetricSample) => string;
191
- /** Optional sub-line under the current value. */
192
- sub?: (s: MetricSample) => string | null;
193
- };
194
- declare const METRICS: MetricDef[];
195
- declare function pointsFor(def: MetricDef, samples: MetricSample[]): SeriesPoint[];
196
-
197
- type MachineDetailProps = {
198
- machine: MachineView;
199
- /** Downsampled history for the active window (from `fetchSeries`). */
200
- series: MetricSample[];
201
- window: MetricWindow;
202
- onWindowChange: (w: MetricWindow) => void;
203
- loadingSeries?: boolean | undefined;
204
- onBack?: (() => void) | undefined;
205
- now?: number | undefined;
206
- className?: string | undefined;
207
- };
208
- declare function MachineDetail({ machine, series, window, onWindowChange, loadingSeries, onBack, now, className, }: MachineDetailProps): react_jsx_runtime.JSX.Element;
209
-
210
- type MachinesDashboardProps = {
211
- machines: MachineView[];
212
- /** The session's active sandbox id (drives the per-card "Active" marker). */
213
- activeSandboxId?: string | null | undefined;
214
- loading?: boolean | undefined;
215
- error?: Error | null | undefined;
216
- /** Attach/swap the session's active sandbox to a machine. */
217
- onAttach?: ((machine: MachineView) => void) | undefined;
218
- /** The sandbox id currently being attached/swapped to (disables that card). */
219
- attachingSandboxId?: string | null | undefined;
220
- /** Short recent history per machine (keyed by sandboxId) — drives card sparklines. */
221
- seriesByMachine?: Record<string, MetricSample[]> | undefined;
222
- /** Open the per-machine telemetry detail (makes each card actionable). */
223
- onOpenDetail?: ((machine: MachineView) => void) | undefined;
224
- /** Shared clock so freshness/relative times render consistently across cards. */
225
- now?: number | undefined;
226
- /** Open the enrollment flow (the "Enroll a machine" CTA). */
227
- onEnroll?: (() => void) | undefined;
228
- onRefresh?: (() => void) | undefined;
229
- className?: string | undefined;
230
- };
231
- /**
232
- * The workspace Machines dashboard: the fleet of selfhosted enrollments + the
233
- * session's managed sandbox, each with its connection-status pill, state badges,
234
- * latest metrics, and an attach/swap affordance. Renders the empty state (no
235
- * machines → enroll CTA), a load error, and the populated grid. The component
236
- * is purely presentational — feed it `MachinesResponse` data via `useMachines`.
237
- */
238
- declare function MachinesDashboard({ machines, activeSandboxId, loading, error, onAttach, attachingSandboxId, seriesByMachine, onOpenDetail, now, onEnroll, onRefresh, className, }: MachinesDashboardProps): react_jsx_runtime.JSX.Element;
239
-
240
- type MachineDockBarProps = {
241
- /** The active machine's display name. */
242
- name: string;
243
- kind: MachineKind;
244
- state: MachineState;
245
- /** Live sessions sharing this whole-machine lease (>1 ⇒ shared disclosure). */
246
- sharedSessionCount?: number | undefined;
247
- className?: string | undefined;
248
- };
249
- /**
250
- * A slim bar that surfaces WHICH machine the dock surfaces (Files/Terminal/
251
- * Desktop) are bound to + its connection status. Mounted above the dock tabs so
252
- * the user always knows whether they are looking at the Modal box or their own
253
- * machine, and whether it is online / reconnecting / offline. The surfaces below
254
- * render IDENTICALLY regardless of backend — this bar is the only backend-aware
255
- * chrome (the dock-parity contract: selfhosted == Modal for the surfaces).
256
- */
257
- declare function MachineDockBar({ name, kind, state, className }: MachineDockBarProps): react_jsx_runtime.JSX.Element;
258
- type SharedMachineDisclosureProps = {
259
- sharedSessionCount: number;
260
- /** Compact (inline strip) vs full (a notice block). */
261
- density?: "compact" | "full" | undefined;
262
- className?: string | undefined;
263
- };
264
- /**
265
- * The "shared — another session is on this machine" disclosure. Surfaced in the
266
- * dock (and reused on the desktop take-control gate) so the user knows others are
267
- * driving the same whole-machine lease. Render when `sharedSessionCount > 1`.
268
- */
269
- declare function SharedMachineDisclosure({ sharedSessionCount, density, className, }: SharedMachineDisclosureProps): react_jsx_runtime.JSX.Element;
270
-
271
- /** The poll state of an in-flight device-flow enrollment. */
272
- type DeviceFlowPhase = "pending" | "authorized" | "denied" | "expired" | "disabled";
273
- type EnrollmentDeviceFlowProps = {
274
- /** The short user code the agent printed (shown big for the human to confirm). */
275
- userCode: string;
276
- /** Where the user approves — the same-origin device page. */
277
- verificationUri: string;
278
- /** The complete URI (code pre-filled) for a one-click / QR open. */
279
- verificationUriComplete?: string | undefined;
280
- /** The install one-liner the user ran (echoed for context). Optional. */
281
- installCommand?: string | undefined;
282
- phase?: DeviceFlowPhase | undefined;
283
- /** Seconds remaining before the code expires (drives a quiet countdown). */
284
- expiresInSeconds?: number | undefined;
285
- onCopyCode?: (() => void) | undefined;
286
- onCopyInstall?: (() => void) | undefined;
287
- onOpenVerification?: (() => void) | undefined;
288
- className?: string | undefined;
289
- };
290
- /**
291
- * The IN-SESSION device-flow panel: the agent (after the install one-liner) prints
292
- * a short `userCode` + a `verificationUri`; this surfaces them so the user can open
293
- * the approve page and confirm the code. Polls in the caller; this renders the
294
- * pending → authorized/denied/expired progression with a connection pill. This is
295
- * the FIRST step of the IA flow (device-flow → Machines list → attach/swap).
296
- */
297
- declare function EnrollmentDeviceFlow({ userCode, verificationUri, verificationUriComplete, installCommand, phase, expiresInSeconds, onCopyCode, onCopyInstall, onOpenVerification, className, }: EnrollmentDeviceFlowProps): react_jsx_runtime.JSX.Element;
298
-
299
- /** The machine identity surfaced to the approver, from the device-flow start. */
300
- type EnrollmentConsentMachine = {
301
- /** Human-friendly name (hostname by default). */
302
- machineName: string;
303
- os: string;
304
- arch: string;
305
- /** The agent can offer a display (a real screen / Xvfb is available). */
306
- canOfferDisplay: boolean;
307
- /** The agent requests screen control (computer-use). */
308
- requestsScreenControl: boolean;
309
- };
310
- /** The phase of the approve page (drives the rendered panel). */
311
- type EnrollmentConsentPhase = "review" | "approving" | "approved" | "denied" | "error";
312
- type EnrollmentConsentProps = {
313
- /** The short code the user typed / scanned (echoed back for confirmation). */
314
- userCode: string;
315
- machine: EnrollmentConsentMachine;
316
- phase?: EnrollmentConsentPhase | undefined;
317
- /** Approve with the chosen screen-control consent. */
318
- onApprove?: ((allowScreenControl: boolean) => void) | undefined;
319
- onDeny?: (() => void) | undefined;
320
- /** Error message when phase === "error". */
321
- errorMessage?: string | undefined;
322
- className?: string | undefined;
323
- };
324
- /**
325
- * The user-facing APPROVE page for the device-flow enrollment: a LOUD,
326
- * un-minimised whole-machine consent. Approving grants the agent FULL access to
327
- * this machine — exec, files, terminal — and (when toggled) live screen control.
328
- * The danger framing is deliberate (§18 hardening: whole-machine = loud consent),
329
- * never buried. Renders review / approving / approved / denied / error phases.
330
- */
331
- declare function EnrollmentConsent({ userCode, machine, phase, onApprove, onDeny, errorMessage, className, }: EnrollmentConsentProps): react_jsx_runtime.JSX.Element;
332
-
333
- /**
334
- * The slice of the SDK client the Machines surface needs. The method NAMES +
335
- * SIGNATURES match M10's `OpenGeniClient` (`listMachines`, `machineMetricsSeries`)
336
- * so the real SDK client satisfies this surface DIRECTLY for the read paths — no
337
- * adapter needed. It is declared structurally (not a hard `OpenGeniClient` Pick)
338
- * so a test/demo/Geni-frontend client can stand in, keeping the hook dual-consumer
339
- * safe (works in apps/web AND the separate Geni frontend).
340
- *
341
- * The active-sandbox SWAP is now a typed SDK call (`swapActiveSandbox`, the M7
342
- * user-authenticated REST equivalent of the `sandbox_swap` MCP tool). The real
343
- * SDK client satisfies it structurally, so the default attach path is wired
344
- * WHENEVER a sessionId is in scope (the swap is session-scoped). `attachMachine`
345
- * stays an OPTIONAL escape hatch for a host that wants to supply its own swap
346
- * adapter; when neither it nor a sessionId is present, attach is a no-op and the
347
- * card hides the button.
348
- */
349
- type MachinesClientLike = {
350
- /** GET /v1/workspaces/:ws/machines — the dashboard list + active pointer. */
351
- listMachines: (workspaceId: string, options?: {
352
- sessionId?: string;
353
- signal?: AbortSignal;
354
- }) => Promise<MachinesResponse>;
355
- /** GET .../machines/:enrollmentId/metrics/series — the downsampled history. */
356
- machineMetricsSeries?: (workspaceId: string, enrollmentId: string, options?: {
357
- window?: "15m" | "1h" | "6h" | "24h";
358
- }) => Promise<MetricSample[]>;
359
- /**
360
- * POST .../sessions/:sessionId/active-sandbox — swap the session's active
361
- * sandbox to a machine. The default swap path; the real SDK client provides it.
362
- */
363
- swapActiveSandbox?: (workspaceId: string, sessionId: string, request: {
364
- target: string;
365
- }) => Promise<unknown>;
366
- /**
367
- * Host-supplied swap adapter (an escape hatch). When present it wins over the
368
- * default `swapActiveSandbox` path. Session-scoped, like the swap it backs.
369
- */
370
- attachMachine?: (workspaceId: string, sessionId: string, sandboxId: string) => Promise<unknown>;
371
- };
372
- type UseMachinesOptions = ClientOverride & {
373
- pollIntervalMs?: number | undefined;
374
- enabled?: boolean | undefined;
375
- /** Scope the list to a session (adds the synthetic Modal group box + pointer). */
376
- sessionId?: string | undefined;
377
- /**
378
- * Override the client with one implementing `MachinesClientLike`. Defaults to
379
- * the provider client cast to the surface (the real SDK client satisfies the
380
- * read paths). An app supplies an adapter to wire `attachMachine` (the swap).
381
- */
382
- machinesClient?: MachinesClientLike | undefined;
383
- };
384
- type UseMachinesResult = {
385
- machines: MachineView[];
386
- activeSandboxId: string | null;
387
- activeEpoch: number;
388
- loading: boolean;
389
- error: Error | null;
390
- refresh: () => Promise<void>;
391
- /** Attach/swap the session's active sandbox to a machine (returns the new pointer). */
392
- attach: (sandboxId: string) => Promise<boolean>;
393
- /** Whether the host wired an attach/swap path (drives the card affordance). */
394
- canAttach: boolean;
395
- /** Fetch a downsampled metric series for one enrolled machine. */
396
- fetchSeries: (enrollmentId: string, window?: "15m" | "1h" | "6h" | "24h") => Promise<MetricSample[]>;
397
- attaching: boolean;
398
- /** The sandbox id of the in-flight attach (for per-card spinner gating). */
399
- attachingSandboxId: string | null;
400
- mutationError: Error | null;
401
- clearMutationError: () => void;
402
- };
403
- /**
404
- * The workspace Machines fleet: the selfhosted enrollments + the session's Modal
405
- * box, each with latest metrics + state, plus the active-sandbox pointer. Polls
406
- * the M10 `GET /machines` endpoint and exposes attach/swap + a metric-series
407
- * fetch. Renders via `<MachinesDashboard>`. Dual-consumer safe: it reads only the
408
- * structural `MachinesClientLike` surface, so it works in apps/web AND the Geni
409
- * frontend (each provides its own client/adapter).
410
- */
411
- declare function useMachines(options?: UseMachinesOptions): UseMachinesResult;
412
-
413
- export { CONNECTION_STATUS_META, ConnectionDot, type ConnectionDotProps, type ConnectionStatus, type ConnectionStatusMeta, ConnectionStatusPill, type ConnectionStatusPillProps, type DeviceFlowPhase, EnrollmentConsent, type EnrollmentConsentMachine, type EnrollmentConsentPhase, type EnrollmentConsentProps, EnrollmentDeviceFlow, type EnrollmentDeviceFlowProps, HEALTH_TOKEN, type HealthLevel, type HealthVerdict, MACHINE_STATE_BADGE_META, METRICS, METRIC_WINDOWS, MachineCard, type MachineCardProps, MachineDetail, type MachineDetailProps, MachineDockBar, type MachineDockBarProps, MachineHealthPill, type MachineHealthPillProps, MachineMetrics, type MachineMetricsProps, type MachineStateBadgeMeta, MachineStatusPill, type MachineStatusPillProps, type MachinesClientLike, MachinesDashboard, type MachinesDashboardProps, type MetricDef, MetricHistoryChart, type MetricHistoryChartProps, type MetricKey, MetricSparkline, type MetricSparklineProps, type MetricWindow, type SeriesPoint, SharedMachineDisclosure, type SharedMachineDisclosureProps, type UseMachinesOptions, type UseMachinesResult, WINDOW_LABEL, connectionStatusForState, deriveHealth, healthPulses, pointsFor, useMachines };
1
+ export type { ConnectionStatus, MachineKind, MachineMetricsSeriesResponse, MachineState, MachineView, MachinesResponse, MetricSample, } from "./types/machines";
2
+ export { connectionStatusForState } from "./types/machines";
3
+ export { ConnectionDot, ConnectionStatusPill, MachineStatusPill, CONNECTION_STATUS_META, MACHINE_STATE_BADGE_META, } from "./components/machine-status-pill";
4
+ export type { ConnectionDotProps, ConnectionStatusMeta, ConnectionStatusPillProps, MachineStateBadgeMeta, MachineStatusPillProps, } from "./components/machine-status-pill";
5
+ export { MachineMetrics } from "./components/machine-metrics";
6
+ export type { MachineMetricsProps } from "./components/machine-metrics";
7
+ export { MachineCard } from "./components/machine-card";
8
+ export type { MachineCardProps } from "./components/machine-card";
9
+ export { MachineHealthPill } from "./components/machine-health-pill";
10
+ export type { MachineHealthPillProps } from "./components/machine-health-pill";
11
+ export { deriveHealth, HEALTH_TOKEN, healthPulses } from "./components/machines/health";
12
+ export type { HealthLevel, HealthVerdict } from "./components/machines/health";
13
+ export { MetricSparkline } from "./components/machines/metric-sparkline";
14
+ export type { MetricSparklineProps } from "./components/machines/metric-sparkline";
15
+ export { MetricHistoryChart } from "./components/machines/metric-history-chart";
16
+ export type { MetricHistoryChartProps, SeriesPoint, } from "./components/machines/metric-history-chart";
17
+ export { MachineDetail } from "./components/machines/machine-detail";
18
+ export type { MachineDetailProps } from "./components/machines/machine-detail";
19
+ export { METRICS, METRIC_WINDOWS, WINDOW_LABEL, pointsFor } from "./components/machines/series";
20
+ export type { MetricDef, MetricKey, MetricWindow } from "./components/machines/series";
21
+ export { MachinesDashboard } from "./components/machines-dashboard";
22
+ export type { MachinesDashboardProps } from "./components/machines-dashboard";
23
+ export { MachineDockBar, SharedMachineDisclosure } from "./components/machine-dock-bar";
24
+ export type { MachineDockBarProps, SharedMachineDisclosureProps, } from "./components/machine-dock-bar";
25
+ export { EnrollmentDeviceFlow } from "./components/enrollment-device-flow";
26
+ export type { DeviceFlowPhase, EnrollmentDeviceFlowProps, } from "./components/enrollment-device-flow";
27
+ export { EnrollmentConsent } from "./components/enrollment-consent";
28
+ export type { EnrollmentConsentMachine, EnrollmentConsentPhase, EnrollmentConsentProps, } from "./components/enrollment-consent";
29
+ export { useMachines } from "./hooks/use-machines";
30
+ export type { MachinesClientLike, UseMachinesOptions, UseMachinesResult, } from "./hooks/use-machines";
package/dist/machines.js CHANGED
@@ -24,10 +24,10 @@ import {
24
24
  healthPulses,
25
25
  pointsFor,
26
26
  useMachines
27
- } from "./chunk-BC6RKIHS.js";
27
+ } from "./chunk-GZ4KR67U.js";
28
+ import "./chunk-7CJOAW3V.js";
28
29
  import "./chunk-TK7G6XLT.js";
29
- import "./chunk-HQFPO7VX.js";
30
- import "./chunk-M7X4JZOD.js";
30
+ import "./chunk-4QOQ2DSR.js";
31
31
  export {
32
32
  CONNECTION_STATUS_META,
33
33
  ConnectionDot,
@@ -0,0 +1,32 @@
1
+ import type { ClientModel, ReasoningEffort, WorkspaceModelCatalogModel } from "@opengeni/sdk";
2
+ export type PickerBillingClass = "opengeni_credits" | "codex_subscription" | "byok";
3
+ export type PickerModelRow = {
4
+ id: string;
5
+ label: string;
6
+ billingClass: PickerBillingClass;
7
+ billingClassLabel: string;
8
+ selectable: boolean;
9
+ unavailableReason: string | null;
10
+ provider: string;
11
+ providerLabel: string;
12
+ catalog: WorkspaceModelCatalogModel;
13
+ };
14
+ export type LatencyModeId = "standard" | "priority" | "fast";
15
+ export declare function billingClassForModel(model: ClientModel): PickerBillingClass;
16
+ export declare function billingClassLabel(billingClass: PickerBillingClass): string;
17
+ export declare function availabilityReasonLabel(reason: WorkspaceModelCatalogModel["availability"]["reason"]): string | null;
18
+ export declare function effortOptionsForModel(model: ClientModel): ReasoningEffort[];
19
+ export declare function defaultEffortForModel(model: ClientModel): ReasoningEffort;
20
+ export declare function coerceReasoningEffortForModel(model: ClientModel, effort: ReasoningEffort): ReasoningEffort;
21
+ export declare function runnableLatencyModesForModel(model: ClientModel): LatencyModeId[];
22
+ export declare function labelLatencyMode(mode: LatencyModeId): string;
23
+ export declare function payerSummaryForModel(model: ClientModel): string;
24
+ export declare function advancedSourceSummary(model: ClientModel): string | null;
25
+ export declare function projectPickerRows(models: WorkspaceModelCatalogModel[]): PickerModelRow[];
26
+ export declare function sortPickerRows(rows: PickerModelRow[]): PickerModelRow[];
27
+ export declare function findPickerRow(rows: PickerModelRow[], modelId: string): PickerModelRow | null;
28
+ export declare function groupPickerRowsByBillingClass(rows: PickerModelRow[]): Array<{
29
+ billingClass: PickerBillingClass;
30
+ label: string;
31
+ rows: PickerModelRow[];
32
+ }>;
@@ -0,0 +1,33 @@
1
+ import {
2
+ advancedSourceSummary,
3
+ availabilityReasonLabel,
4
+ billingClassForModel,
5
+ billingClassLabel,
6
+ coerceReasoningEffortForModel,
7
+ defaultEffortForModel,
8
+ effortOptionsForModel,
9
+ findPickerRow,
10
+ groupPickerRowsByBillingClass,
11
+ labelLatencyMode,
12
+ payerSummaryForModel,
13
+ projectPickerRows,
14
+ runnableLatencyModesForModel,
15
+ sortPickerRows
16
+ } from "./chunk-U255M5EZ.js";
17
+ export {
18
+ advancedSourceSummary,
19
+ availabilityReasonLabel,
20
+ billingClassForModel,
21
+ billingClassLabel,
22
+ coerceReasoningEffortForModel,
23
+ defaultEffortForModel,
24
+ effortOptionsForModel,
25
+ findPickerRow,
26
+ groupPickerRowsByBillingClass,
27
+ labelLatencyMode,
28
+ payerSummaryForModel,
29
+ projectPickerRows,
30
+ runnableLatencyModesForModel,
31
+ sortPickerRows
32
+ };
33
+ //# sourceMappingURL=model-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,16 @@
1
+ import { type WorkspaceControlEvent } from "@opengeni/sdk";
2
+ import { type ReactNode } from "react";
3
+ import type { SessionClientLike } from "./client";
4
+ export { useOpenGeni, useOpenGeniClient } from "./session-context";
5
+ export type { ClientOverride, OpenGeniContextValue } from "./session-context";
6
+ export type OpenGeniProviderProps = {
7
+ client: SessionClientLike;
8
+ workspaceId: string;
9
+ onWorkspaceControlEvent?: ((event: WorkspaceControlEvent) => void) | undefined;
10
+ children?: ReactNode;
11
+ };
12
+ /**
13
+ * Supplies the OpenGeni client + workspace to all hooks below it. Hooks also
14
+ * accept `{ client, workspaceId }` overrides per call for multi-workspace UIs.
15
+ */
16
+ export declare function OpenGeniProvider({ client, workspaceId, onWorkspaceControlEvent, children, }: OpenGeniProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -765,7 +765,7 @@ function SortableQueueRow({
765
765
  disabled: pending !== null,
766
766
  onClick: onSteer,
767
767
  "aria-label": `Steer queued prompt ${index + 1}`,
768
- title: "Make this the next direction",
768
+ title: "Steer \u2014 interrupt the current turn and send this message now",
769
769
  className: "inline-flex h-7 shrink-0 items-center justify-center gap-1 rounded-md px-2 text-xs font-medium text-fg outline-none transition-[background-color] hover:bg-surface-2 focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:opacity-50 pointer-coarse:min-h-[44px] pointer-coarse:min-w-[44px]",
770
770
  children: [
771
771
  pending === "steer" ? /* @__PURE__ */ jsx(Loader2Icon, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(ZapIcon, { className: "size-3.5" }),
@@ -919,4 +919,4 @@ export {
919
919
  QueueSurface,
920
920
  queueComposerCheckoutEnabled
921
921
  };
922
- //# sourceMappingURL=queue-surface-implementation-UQ535OKQ.js.map
922
+ //# sourceMappingURL=queue-surface-implementation-THPAKGMD.js.map