@opengeni/react 0.12.0 → 0.15.0

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 (94) hide show
  1. package/README.md +20 -14
  2. package/dist/chunk-TOJR776I.js +2280 -0
  3. package/dist/chunk-TOJR776I.js.map +1 -0
  4. package/dist/index.d.ts +1040 -363
  5. package/dist/index.js +10938 -6281
  6. package/dist/index.js.map +1 -1
  7. package/dist/{machines-BeZ3bD3t.d.ts → machines-BpdwuQcD.d.ts} +134 -14
  8. package/dist/machines.d.ts +1 -1
  9. package/dist/machines.js +23 -1
  10. package/package.json +20 -12
  11. package/src/approvals.ts +16 -4
  12. package/src/client.ts +41 -5
  13. package/src/commands/index.ts +1 -7
  14. package/src/commands/registry.ts +46 -12
  15. package/src/components/chat-composer.tsx +417 -69
  16. package/src/components/code-editor.tsx +28 -36
  17. package/src/components/command-palette.tsx +26 -5
  18. package/src/components/desktop-viewer.tsx +29 -16
  19. package/src/components/diff-view.tsx +27 -189
  20. package/src/components/enrollment-consent.tsx +28 -10
  21. package/src/components/enrollment-device-flow.tsx +8 -5
  22. package/src/components/file-browser.tsx +190 -56
  23. package/src/components/fleet-tile.tsx +13 -4
  24. package/src/components/machine-card.tsx +93 -15
  25. package/src/components/machine-dock-bar.tsx +20 -8
  26. package/src/components/machine-health-pill.tsx +68 -0
  27. package/src/components/machine-metrics.tsx +28 -19
  28. package/src/components/machine-status-pill.tsx +26 -5
  29. package/src/components/machines/health.ts +146 -0
  30. package/src/components/machines/machine-detail.tsx +220 -0
  31. package/src/components/machines/metric-history-chart.tsx +298 -0
  32. package/src/components/machines/metric-sparkline.tsx +76 -0
  33. package/src/components/machines/series.ts +113 -0
  34. package/src/components/machines-dashboard.tsx +21 -3
  35. package/src/components/markdown.tsx +39 -9
  36. package/src/components/message-timeline.tsx +633 -109
  37. package/src/components/pierre-diff.tsx +83 -15
  38. package/src/components/pierre-file.tsx +10 -9
  39. package/src/components/queue-surface.tsx +578 -0
  40. package/src/components/sandbox-files.tsx +193 -225
  41. package/src/components/sandbox-terminal.tsx +256 -88
  42. package/src/components/sandbox-workspace.tsx +957 -0
  43. package/src/components/session-status.tsx +22 -2
  44. package/src/components/workbench-changes.tsx +585 -0
  45. package/src/components/workspace-dock.tsx +213 -59
  46. package/src/hooks/internal.ts +5 -2
  47. package/src/hooks/use-available-models.ts +7 -2
  48. package/src/hooks/use-billing-usage.ts +4 -1
  49. package/src/hooks/use-codex-accounts.ts +74 -44
  50. package/src/hooks/use-composer.ts +414 -63
  51. package/src/hooks/use-environments.ts +92 -47
  52. package/src/hooks/use-file-attachments.ts +101 -55
  53. package/src/hooks/use-goal.ts +52 -16
  54. package/src/hooks/use-machine-chip.ts +134 -0
  55. package/src/hooks/use-machines.ts +34 -16
  56. package/src/hooks/use-packs.ts +24 -19
  57. package/src/hooks/use-relay-frame-stream.ts +5 -2
  58. package/src/hooks/use-rigs.ts +335 -0
  59. package/src/hooks/use-sandbox-files.ts +213 -39
  60. package/src/hooks/use-sandbox-git.ts +188 -11
  61. package/src/hooks/use-sandbox-terminal.ts +18 -14
  62. package/src/hooks/use-scheduled-tasks.ts +10 -2
  63. package/src/hooks/use-session-capabilities.ts +77 -20
  64. package/src/hooks/use-session-control.ts +50 -23
  65. package/src/hooks/use-session-events.ts +50 -21
  66. package/src/hooks/use-session-lineage.ts +128 -0
  67. package/src/hooks/use-session.ts +53 -30
  68. package/src/hooks/use-slash-commands.ts +6 -4
  69. package/src/hooks/use-turn-queue.ts +202 -147
  70. package/src/hooks/use-windowed-sections.ts +204 -0
  71. package/src/hooks/use-workspace-capture.ts +233 -0
  72. package/src/hooks/use-workspace-edit.ts +231 -0
  73. package/src/hooks/use-workspace-sessions.ts +48 -5
  74. package/src/hooks/use-workspaces.ts +18 -15
  75. package/src/index.ts +133 -23
  76. package/src/lib/format.ts +3 -3
  77. package/src/lib/xterm-renderer.ts +65 -0
  78. package/src/lib/xterm-theme.ts +224 -18
  79. package/src/machines.ts +29 -3
  80. package/src/provider.tsx +195 -6
  81. package/src/timeline/activity-rail.tsx +213 -54
  82. package/src/timeline/disclosure-context.tsx +12 -2
  83. package/src/timeline/index.ts +21 -2
  84. package/src/timeline/parsers.ts +87 -16
  85. package/src/timeline/projection.ts +412 -87
  86. package/src/timeline/shared.tsx +111 -24
  87. package/src/timeline/tool-diff.tsx +24 -20
  88. package/src/timeline/tool-renderers.tsx +98 -21
  89. package/src/timeline/turn-summary.tsx +76 -23
  90. package/src/timeline/types.ts +96 -12
  91. package/styles/index.css +22 -0
  92. package/styles/tokens.css +2 -2
  93. package/dist/chunk-5TIXRCSI.js +0 -1291
  94. package/dist/chunk-5TIXRCSI.js.map +0 -1
package/README.md CHANGED
@@ -45,16 +45,19 @@ import {
45
45
  ChatComposer,
46
46
  MessageTimeline,
47
47
  OpenGeniProvider,
48
+ QueueSurface,
48
49
  SessionStatus,
49
50
  useComposer,
50
51
  useSessionEvents,
52
+ useTurnQueue,
51
53
  } from "@opengeni/react";
52
54
 
53
55
  const client = new OpenGeniClient({ baseUrl: "/api/opengeni" }); // proxy through your API
54
56
 
55
57
  function OpsChannel({ sessionId }: { sessionId: string }) {
56
58
  const { timeline, sessionStatus, hasOlder, loadingOlder, loadOlder } = useSessionEvents(sessionId);
57
- const composer = useComposer(sessionId);
59
+ const queue = useTurnQueue(sessionId);
60
+ const composer = useComposer(sessionId, { effectiveControl: queue.effectiveControl });
58
61
  return (
59
62
  <div className="flex h-full flex-col">
60
63
  {sessionStatus ? <SessionStatus status={sessionStatus} /> : null}
@@ -66,7 +69,8 @@ function OpsChannel({ sessionId }: { sessionId: string }) {
66
69
  onLoadOlder={() => void loadOlder()}
67
70
  className="min-h-0 flex-1"
68
71
  />
69
- <ChatComposer composer={composer} status={sessionStatus} />
72
+ <QueueSurface queue={queue} composer={composer} />
73
+ <ChatComposer composer={composer} effectiveControl={queue.effectiveControl} />
70
74
  </div>
71
75
  );
72
76
  }
@@ -90,27 +94,29 @@ export function App() {
90
94
  older-history controls (`hasOlder`, `loadingOlder`, `loadOlder`). Pass
91
95
  `replay: "full"` to opt back into full replay; a nonzero `after` keeps the
92
96
  previous resume semantics.
93
- - `useComposer(sessionId, { sendExtras, defaultMode })` — draft/send/interrupt
94
- state plus the compose-time **queue-vs-steer** choice (`mode`/`setMode`,
95
- default `"queue"`): queue stacks the message behind the running turn, steer
96
- interrupts and injects it now. Drafts survive failed sends; each draft
97
- reuses one `clientEventId` across retries so the server dedupes.
97
+ - `useComposer(sessionId, { sendExtras, effectiveControl })` — revisioned private
98
+ draft, Send, Steer, and workstream Pause/Resume state. `send()` appends in
99
+ visible queue order; `steer()` supersedes the current direction. Drafts
100
+ autosave with optimistic concurrency, survive failed sends, and reuse one
101
+ `clientEventId` across retries so the server dedupes.
98
102
  `sendExtras` (object or function evaluated at send time) merges
99
103
  resources/tools/model/reasoningEffort into every message. All human input is
100
104
  plain chat text by design; approvals flow as control events
101
105
  (`useSessionControl`), not bespoke widgets.
102
- - `useTurnQueue(sessionId, { events })` — the live turn queue: `queue` (queued
103
- turns in execution order), `activeTurn`, and optimistic `editTurn` /
104
- `reorderTurns` / `removeTurn` that reconcile with the server (failed
105
- mutations roll back via refetch). Live-updates on `turn.*` events — pass the
106
+ - `useTurnQueue(sessionId, { events })` — the one server-authoritative human
107
+ prompt queue with `moveTurn`, crash-safe `editTurn`, identity-preserving
108
+ `steerTurn`, and `removeTurn`. Mutations carry observed revisions and conflicts
109
+ refetch server truth. Live-updates on `turn.*` and `session.queue.*` events — pass the
106
110
  `events` log from `useSessionEvents` to reuse its stream, or let it tail the
107
111
  session itself.
108
112
  - `useGoal(sessionId, { events })` — goal state + autonomy counters
109
113
  (`autoContinuations`, `noProgressStreak`) with `pause(rationale?)` /
110
114
  `resume()`. Goal-less sessions yield `goal: null`. Live-updates on `goal.*`
111
115
  events.
112
- - `useSessionControl(sessionId)` — `interrupt(reason?)` and
113
- `approve`/`reject(approvalId, message?)` for `requires_action` approvals.
116
+ - `useSessionControl(sessionId)` — durable `pause(reason?)` / `resume(reason?)`
117
+ workstream controls and `approve`/`reject(approvalId, message?)` for
118
+ `requires_action` approvals. Pause is recursive control state, not lifecycle
119
+ status or queue work; Resume creates no message.
114
120
  - `useSession(sessionId)` — fetch one session (optional polling) with
115
121
  `updateTitle(title)` (rename) and live title-patching on `session.title_set`.
116
122
  - `useFileAttachments()` — the composer's attach flow: stages files, drives the
@@ -123,7 +129,7 @@ export function App() {
123
129
  handlers) behind `CommandPalette`.
124
130
  - `useWorkspaceSessions()` / `useScheduledTasks()` — workspace lists for
125
131
  fleet/manager views (optional polling).
126
- - `useEnvironments()` — workspace environments with create/update/remove and
132
+ - `useVariable sets()` — workspace variable sets with create/update/remove and
127
133
  write-only `setVariable`/`deleteVariable` (values never come back on reads).
128
134
  - `usePacks()` — capability packs + installations with
129
135
  register/enable/remove and `installationFor(packId)`.