@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.
- package/README.md +129 -23
- package/dist/chunk-6BXBGJ3B.js +1956 -0
- package/dist/chunk-6BXBGJ3B.js.map +1 -0
- package/dist/chunk-6UT5OC3P.js +2133 -0
- package/dist/chunk-6UT5OC3P.js.map +1 -0
- package/dist/chunk-EBTT3MYN.js +92 -0
- package/dist/chunk-EBTT3MYN.js.map +1 -0
- package/dist/chunk-HHFA4AFX.js +425 -0
- package/dist/chunk-HHFA4AFX.js.map +1 -0
- package/dist/chunk-LAZ2A743.js +2393 -0
- package/dist/chunk-LAZ2A743.js.map +1 -0
- package/dist/chunk-MRSECXRP.js +563 -0
- package/dist/chunk-MRSECXRP.js.map +1 -0
- package/dist/chunk-TK7G6XLT.js +18 -0
- package/dist/chunk-TK7G6XLT.js.map +1 -0
- package/dist/composer-DvUaa5ki.d.ts +585 -0
- package/dist/composer.d.ts +6 -0
- package/dist/composer.js +56 -0
- package/dist/composer.js.map +1 -0
- package/dist/index.d.ts +642 -1080
- package/dist/index.js +7672 -8005
- package/dist/index.js.map +1 -1
- package/dist/machines.d.ts +412 -3
- package/dist/machines.js +25 -1
- package/dist/noto-sans-arabic-loader-IA2T4X2A.js +21 -0
- package/dist/noto-sans-arabic-loader-IA2T4X2A.js.map +1 -0
- package/dist/noto-sans-jp-loader.generated-HFGLYBR3.js +292 -0
- package/dist/noto-sans-jp-loader.generated-HFGLYBR3.js.map +1 -0
- package/dist/queue-surface-implementation-NQMV2ML3.js +890 -0
- package/dist/queue-surface-implementation-NQMV2ML3.js.map +1 -0
- package/dist/session-Gd4iVPYw.d.ts +425 -0
- package/dist/session-context-DIFFlXKc.d.ts +52 -0
- package/dist/session.d.ts +4 -0
- package/dist/session.js +50 -0
- package/dist/session.js.map +1 -0
- package/dist/use-composer-BCfm4mzX.d.ts +112 -0
- package/package.json +23 -4
- package/src/approvals.ts +5 -3
- package/src/client.ts +50 -1
- package/src/components/approval-surface.tsx +198 -0
- package/src/components/chat-composer.tsx +104 -751
- package/src/components/code-editor.tsx +104 -26
- package/src/components/command-palette.tsx +8 -2
- package/src/components/composer-transcription-control.tsx +211 -0
- package/src/components/composer.tsx +1536 -0
- package/src/components/desktop-viewer.tsx +3 -3
- package/src/components/enrollment-consent.tsx +2 -2
- package/src/components/file-browser.tsx +367 -29
- package/src/components/human-input-form.tsx +417 -0
- package/src/components/machine-card.tsx +82 -16
- package/src/components/machine-health-pill.tsx +68 -0
- package/src/components/machine-metrics.tsx +10 -24
- package/src/components/machines/health.ts +146 -0
- package/src/components/machines/machine-detail.tsx +220 -0
- package/src/components/machines/metric-history-chart.tsx +298 -0
- package/src/components/machines/metric-sparkline.tsx +76 -0
- package/src/components/machines/series.ts +113 -0
- package/src/components/machines-dashboard.tsx +16 -4
- package/src/components/message-timeline.tsx +15 -7
- package/src/components/model-picker.tsx +12 -3
- package/src/components/pierre-diff.tsx +32 -6
- package/src/components/queue-surface-implementation.tsx +1041 -0
- package/src/components/queue-surface-state.tsx +94 -0
- package/src/components/queue-surface.tsx +60 -0
- package/src/components/sandbox-files.tsx +230 -21
- package/src/components/sandbox-terminal.tsx +8 -2
- package/src/components/sandbox-workspace.tsx +489 -135
- package/src/components/session-status.tsx +0 -6
- package/src/components/workbench-changes.tsx +145 -50
- package/src/components/workspace-dock.tsx +329 -68
- package/src/composer.ts +60 -0
- package/src/hooks/internal.ts +115 -34
- package/src/hooks/use-composer.ts +635 -74
- package/src/hooks/use-human-input.ts +131 -0
- package/src/hooks/use-machine-chip.ts +2 -2
- package/src/hooks/use-machines.ts +27 -11
- package/src/hooks/use-sandbox-files.ts +310 -62
- package/src/hooks/use-sandbox-git.ts +154 -40
- package/src/hooks/use-sandbox-terminal.ts +28 -6
- package/src/hooks/use-session-capabilities.ts +38 -9
- package/src/hooks/use-session-control.ts +43 -15
- package/src/hooks/use-session-events.ts +523 -48
- package/src/hooks/use-session-lineage.ts +15 -6
- package/src/hooks/use-session.ts +10 -2
- package/src/hooks/use-slash-commands.ts +38 -38
- package/src/hooks/use-transcription.ts +757 -0
- package/src/hooks/use-turn-queue.ts +273 -77
- package/src/hooks/use-windowed-sections.ts +2 -2
- package/src/hooks/use-workspace-capture.ts +146 -40
- package/src/hooks/use-workspace-edit.ts +50 -14
- package/src/hooks/use-workspace-sessions.ts +3 -0
- package/src/human-input.ts +72 -0
- package/src/index.ts +88 -12
- package/src/lib/noto-sans-arabic-loader.ts +21 -0
- package/src/lib/noto-sans-jp-loader.generated.ts +295 -0
- package/src/lib/use-portal-token-style.ts +51 -0
- package/src/lib/use-unicode-fonts.ts +57 -0
- package/src/machines.ts +16 -0
- package/src/provider.tsx +163 -41
- package/src/session-context.ts +135 -0
- package/src/session.ts +79 -0
- package/src/timeline/parsers.ts +78 -6
- package/src/timeline/projection.ts +36 -6
- package/src/timeline/tool-renderers.tsx +41 -0
- package/src/timeline/turn-summary.tsx +2 -2
- package/src/timeline/types.ts +16 -8
- package/styles/index.css +78 -0
- package/styles/index.d.ts +2 -0
- package/styles/tokens.css +11 -6
- package/styles/tokens.d.ts +2 -0
- package/dist/chunk-NFYVQWIB.js +0 -1377
- package/dist/chunk-NFYVQWIB.js.map +0 -1
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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")
|