@opengeni/react 0.13.0 → 0.20.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 (113) hide show
  1. package/README.md +129 -23
  2. package/dist/chunk-6BXBGJ3B.js +1956 -0
  3. package/dist/chunk-6BXBGJ3B.js.map +1 -0
  4. package/dist/chunk-6UT5OC3P.js +2133 -0
  5. package/dist/chunk-6UT5OC3P.js.map +1 -0
  6. package/dist/chunk-EBTT3MYN.js +92 -0
  7. package/dist/chunk-EBTT3MYN.js.map +1 -0
  8. package/dist/chunk-HHFA4AFX.js +425 -0
  9. package/dist/chunk-HHFA4AFX.js.map +1 -0
  10. package/dist/chunk-LAZ2A743.js +2393 -0
  11. package/dist/chunk-LAZ2A743.js.map +1 -0
  12. package/dist/chunk-MRSECXRP.js +563 -0
  13. package/dist/chunk-MRSECXRP.js.map +1 -0
  14. package/dist/chunk-TK7G6XLT.js +18 -0
  15. package/dist/chunk-TK7G6XLT.js.map +1 -0
  16. package/dist/composer-DvUaa5ki.d.ts +585 -0
  17. package/dist/composer.d.ts +6 -0
  18. package/dist/composer.js +56 -0
  19. package/dist/composer.js.map +1 -0
  20. package/dist/index.d.ts +642 -1080
  21. package/dist/index.js +7672 -8005
  22. package/dist/index.js.map +1 -1
  23. package/dist/machines.d.ts +412 -3
  24. package/dist/machines.js +25 -1
  25. package/dist/noto-sans-arabic-loader-IA2T4X2A.js +21 -0
  26. package/dist/noto-sans-arabic-loader-IA2T4X2A.js.map +1 -0
  27. package/dist/noto-sans-jp-loader.generated-HFGLYBR3.js +292 -0
  28. package/dist/noto-sans-jp-loader.generated-HFGLYBR3.js.map +1 -0
  29. package/dist/queue-surface-implementation-NQMV2ML3.js +890 -0
  30. package/dist/queue-surface-implementation-NQMV2ML3.js.map +1 -0
  31. package/dist/session-Gd4iVPYw.d.ts +425 -0
  32. package/dist/session-context-DIFFlXKc.d.ts +52 -0
  33. package/dist/session.d.ts +4 -0
  34. package/dist/session.js +50 -0
  35. package/dist/session.js.map +1 -0
  36. package/dist/use-composer-BCfm4mzX.d.ts +112 -0
  37. package/package.json +23 -4
  38. package/src/approvals.ts +5 -3
  39. package/src/client.ts +50 -1
  40. package/src/components/approval-surface.tsx +198 -0
  41. package/src/components/chat-composer.tsx +104 -751
  42. package/src/components/code-editor.tsx +104 -26
  43. package/src/components/command-palette.tsx +8 -2
  44. package/src/components/composer-transcription-control.tsx +211 -0
  45. package/src/components/composer.tsx +1536 -0
  46. package/src/components/desktop-viewer.tsx +3 -3
  47. package/src/components/enrollment-consent.tsx +2 -2
  48. package/src/components/file-browser.tsx +367 -29
  49. package/src/components/human-input-form.tsx +417 -0
  50. package/src/components/machine-card.tsx +82 -16
  51. package/src/components/machine-health-pill.tsx +68 -0
  52. package/src/components/machine-metrics.tsx +10 -24
  53. package/src/components/machines/health.ts +146 -0
  54. package/src/components/machines/machine-detail.tsx +220 -0
  55. package/src/components/machines/metric-history-chart.tsx +298 -0
  56. package/src/components/machines/metric-sparkline.tsx +76 -0
  57. package/src/components/machines/series.ts +113 -0
  58. package/src/components/machines-dashboard.tsx +16 -4
  59. package/src/components/message-timeline.tsx +15 -7
  60. package/src/components/model-picker.tsx +12 -3
  61. package/src/components/pierre-diff.tsx +32 -6
  62. package/src/components/queue-surface-implementation.tsx +1041 -0
  63. package/src/components/queue-surface-state.tsx +94 -0
  64. package/src/components/queue-surface.tsx +60 -0
  65. package/src/components/sandbox-files.tsx +230 -21
  66. package/src/components/sandbox-terminal.tsx +8 -2
  67. package/src/components/sandbox-workspace.tsx +489 -135
  68. package/src/components/session-status.tsx +0 -6
  69. package/src/components/workbench-changes.tsx +145 -50
  70. package/src/components/workspace-dock.tsx +329 -68
  71. package/src/composer.ts +60 -0
  72. package/src/hooks/internal.ts +115 -34
  73. package/src/hooks/use-composer.ts +635 -74
  74. package/src/hooks/use-human-input.ts +131 -0
  75. package/src/hooks/use-machine-chip.ts +2 -2
  76. package/src/hooks/use-machines.ts +27 -11
  77. package/src/hooks/use-sandbox-files.ts +310 -62
  78. package/src/hooks/use-sandbox-git.ts +154 -40
  79. package/src/hooks/use-sandbox-terminal.ts +28 -6
  80. package/src/hooks/use-session-capabilities.ts +38 -9
  81. package/src/hooks/use-session-control.ts +43 -15
  82. package/src/hooks/use-session-events.ts +523 -48
  83. package/src/hooks/use-session-lineage.ts +15 -6
  84. package/src/hooks/use-session.ts +10 -2
  85. package/src/hooks/use-slash-commands.ts +38 -38
  86. package/src/hooks/use-transcription.ts +757 -0
  87. package/src/hooks/use-turn-queue.ts +273 -77
  88. package/src/hooks/use-windowed-sections.ts +2 -2
  89. package/src/hooks/use-workspace-capture.ts +146 -40
  90. package/src/hooks/use-workspace-edit.ts +50 -14
  91. package/src/hooks/use-workspace-sessions.ts +3 -0
  92. package/src/human-input.ts +72 -0
  93. package/src/index.ts +88 -12
  94. package/src/lib/noto-sans-arabic-loader.ts +21 -0
  95. package/src/lib/noto-sans-jp-loader.generated.ts +295 -0
  96. package/src/lib/use-portal-token-style.ts +51 -0
  97. package/src/lib/use-unicode-fonts.ts +57 -0
  98. package/src/machines.ts +16 -0
  99. package/src/provider.tsx +163 -41
  100. package/src/session-context.ts +135 -0
  101. package/src/session.ts +79 -0
  102. package/src/timeline/parsers.ts +78 -6
  103. package/src/timeline/projection.ts +36 -6
  104. package/src/timeline/tool-renderers.tsx +41 -0
  105. package/src/timeline/turn-summary.tsx +2 -2
  106. package/src/timeline/types.ts +16 -8
  107. package/styles/index.css +78 -0
  108. package/styles/index.d.ts +2 -0
  109. package/styles/tokens.css +11 -6
  110. package/styles/tokens.d.ts +2 -0
  111. package/dist/chunk-NFYVQWIB.js +0 -1377
  112. package/dist/chunk-NFYVQWIB.js.map +0 -1
  113. package/dist/machines-CnlMb7E-.d.ts +0 -329
@@ -78,6 +78,20 @@ export function PierreDiff({
78
78
  className,
79
79
  }: PierreDiffProps) {
80
80
  const [failed, setFailed] = useState(false);
81
+ const [forcedColors, setForcedColors] = useState(false);
82
+
83
+ // Pierre's rich renderer distinguishes additions/deletions primarily through
84
+ // foreground and background colors inside a shadow root. In Windows forced-
85
+ // colors mode those paints intentionally collapse, so expose the literal
86
+ // unified patch (+/- markers) instead of leaving changed lines ambiguous.
87
+ useEffect(() => {
88
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
89
+ const query = window.matchMedia("(forced-colors: active)");
90
+ const update = () => setForcedColors(query.matches);
91
+ update();
92
+ query.addEventListener?.("change", update);
93
+ return () => query.removeEventListener?.("change", update);
94
+ }, []);
81
95
 
82
96
  // Probe the import once so a hard failure (peer missing) shows `fallback`
83
97
  // rather than a Suspense boundary that never resolves. Skipped when `plain`.
@@ -92,11 +106,18 @@ export function PierreDiff({
92
106
  };
93
107
  }, [plain]);
94
108
 
95
- if (plain || failed) {
109
+ if (plain || failed || forcedColors) {
96
110
  // `plain` opts out of highlighting; `failed` = `@pierre/diffs` not installed.
97
111
  // Render the caller's fallback, or a plain (unhighlighted) patch dump — NOT a
98
112
  // second hunk renderer. One highlighted renderer (Pierre) + a text degrade.
99
- return <div className={className}>{fallback ?? <PlainPatch diff={diff} />}</div>;
113
+ return (
114
+ <div
115
+ className={className}
116
+ data-opengeni-plain-diff={forcedColors ? "forced-colors" : "fallback"}
117
+ >
118
+ {fallback ?? <PlainPatch diff={diff} />}
119
+ </div>
120
+ );
100
121
  }
101
122
 
102
123
  // Default to the dark theme: the host UI is dark-first, and Pierre's own
@@ -131,13 +152,15 @@ export function PierreDiff({
131
152
  "--diffs-fg-number-addition-override": "var(--og-color-status-idle)",
132
153
  "--diffs-fg-number-deletion-override": "var(--og-color-status-failed)",
133
154
  "--diffs-bg-addition-override":
134
- "color-mix(in oklch, var(--og-color-status-idle) 12%, var(--og-color-bg))",
155
+ "color-mix(in oklab, var(--og-color-status-idle) 12%, var(--og-color-bg))",
135
156
  "--diffs-bg-deletion-override":
136
- "color-mix(in oklch, var(--og-color-status-failed) 12%, var(--og-color-bg))",
157
+ "color-mix(in oklab, var(--og-color-status-failed) 12%, var(--og-color-bg))",
137
158
  "--diffs-bg-addition-emphasis-override":
138
- "color-mix(in oklch, var(--og-color-status-idle) 22%, var(--og-color-bg))",
159
+ "color-mix(in oklab, var(--og-color-status-idle) 22%, var(--og-color-bg))",
139
160
  "--diffs-bg-deletion-emphasis-override":
140
- "color-mix(in oklch, var(--og-color-status-failed) 22%, var(--og-color-bg))",
161
+ "color-mix(in oklab, var(--og-color-status-failed) 22%, var(--og-color-bg))",
162
+ "--diffs-header-font-family": "var(--og-font-sans)",
163
+ "--diffs-font-family": "var(--og-font-mono)",
141
164
  "--diffs-font-size": "var(--og-code-font-size)",
142
165
  "--diffs-line-height": "var(--og-code-line-height)",
143
166
  } as CSSProperties;
@@ -177,7 +200,10 @@ function PlainPatch({ diff }: { diff: GitFileDiff[] }) {
177
200
  {diff.map((file) => (
178
201
  <pre
179
202
  key={file.path}
203
+ aria-label={`Diff for ${file.path}`}
180
204
  className="mb-2 overflow-auto whitespace-pre rounded-og-sm border border-og-border bg-og-bg/60 p-2.5 font-og-mono text-og-xs leading-5"
205
+ role="region"
206
+ tabIndex={0}
181
207
  >
182
208
  {gitFileDiffToPatch(file)
183
209
  .split("\n")