@opengeni/react 6.1.0 → 7.0.0-canary.35625901699001
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 +83 -2
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +1 -1
- package/dist/artifacts-presentation.js +1 -1
- package/dist/artifacts-spreadsheet.js +1 -1
- package/dist/artifacts.js +3 -3
- package/dist/{browser-viewer-NTD6UIPR.js → browser-viewer-LGH4IP47.js} +3 -3
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/{chunk-NOSYBS2D.js → chunk-2VHARTBL.js} +2 -1
- package/dist/{chunk-VRBL3F5E.js → chunk-5GAL23FF.js} +10 -2
- package/dist/{chunk-VRBL3F5E.js.map → chunk-5GAL23FF.js.map} +1 -1
- package/dist/chunk-5UONOQ3Y.js +635 -0
- package/dist/chunk-5UONOQ3Y.js.map +1 -0
- package/dist/{chunk-NYESIADM.js → chunk-AKOMC3VO.js} +3 -3
- package/dist/chunk-AKOMC3VO.js.map +1 -0
- package/dist/chunk-BRM6FVZA.js +302 -0
- package/dist/chunk-BRM6FVZA.js.map +1 -0
- package/dist/{chunk-KANFU34B.js → chunk-DBPVUGQT.js} +11 -2
- package/dist/chunk-DBPVUGQT.js.map +1 -0
- package/dist/chunk-FHIGTPME.js +1589 -0
- package/dist/chunk-FHIGTPME.js.map +1 -0
- package/dist/{chunk-5M6VTFJ5.js → chunk-GBPCZH3Y.js} +2 -2
- package/dist/{chunk-YBM6CQRU.js → chunk-GEN54DU5.js} +4 -4
- package/dist/{chunk-UMECRJRV.js → chunk-HJ5VJ4JB.js} +21 -12
- package/dist/chunk-HJ5VJ4JB.js.map +1 -0
- package/dist/{chunk-R4KRSFGA.js → chunk-IP4BUBKH.js} +3 -3
- package/dist/{chunk-NLTS7JHI.js → chunk-JPHDWKZE.js} +5 -5
- package/dist/{chunk-TDSEILUH.js → chunk-MI6ALLLD.js} +1297 -1535
- package/dist/chunk-MI6ALLLD.js.map +1 -0
- package/dist/{chunk-ICA6R6TW.js → chunk-OWHPKAOV.js} +28 -20
- package/dist/chunk-OWHPKAOV.js.map +1 -0
- package/dist/{chunk-24M4YBCL.js → chunk-PNAVEK2U.js} +4 -4
- package/dist/{chunk-L2NBTKRX.js → chunk-TXCBE32L.js} +203 -19
- package/dist/chunk-TXCBE32L.js.map +1 -0
- package/dist/{chunk-45XEUVTK.js → chunk-UXE5SSNN.js} +293 -463
- package/dist/chunk-UXE5SSNN.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-VR4Z73EU.js} +203 -9
- package/dist/chunk-VR4Z73EU.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-XMXRI5JK.js} +65 -18
- package/dist/chunk-XMXRI5JK.js.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/chat-composer.d.ts +13 -3
- package/dist/components/markdown.d.ts +6 -3
- package/dist/components/message-timeline.d.ts +7 -2
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/session-capability-frame.d.ts +24 -0
- package/dist/components/session-chrome.d.ts +1 -2
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +3 -0
- package/dist/components/session-mcp-capability-card.d.ts +22 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/composer.js +7 -7
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +5 -0
- package/dist/connect-chooser.d.ts +6 -0
- package/dist/connect-panel.d.ts +9 -2
- package/dist/connect-setup.d.ts +5 -1
- package/dist/connect.d.ts +5 -21
- package/dist/connect.js +1268 -584
- package/dist/connect.js.map +1 -1
- package/dist/connection-catalog.d.ts +6 -1
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +1 -0
- package/dist/connection-logo.d.ts +5 -2
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/hooks/use-codex-accounts.d.ts +11 -5
- package/dist/hooks/use-connect.d.ts +22 -0
- package/dist/hooks/use-session-events.d.ts +5 -0
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-workspace-sessions.d.ts +2 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +771 -793
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +2 -2
- package/dist/machines.js +2 -2
- package/dist/mcp-connection-status.d.ts +14 -0
- package/dist/{model-policy-picker-menu-3R336DP2.js → model-policy-picker-menu-RVOQ4ZZG.js} +4 -4
- package/dist/model-policy.d.ts +6 -2
- package/dist/model-policy.js +1 -1
- package/dist/{platform-activity-row-DUE2W74J.js → platform-activity-row-HLOH7FW4.js} +9 -4
- package/dist/platform-activity-row-HLOH7FW4.js.map +1 -0
- package/dist/plugin-discovery.d.ts +6 -0
- package/dist/{queue-surface-implementation-LK3S4BIW.js → queue-surface-implementation-3RIFK2BS.js} +4 -4
- package/dist/realtime.js +22 -22
- package/dist/realtime.js.map +1 -1
- package/dist/session-auth-recommendation.d.ts +5 -0
- package/dist/session-capability-policy.d.ts +12 -0
- package/dist/session-ui.d.ts +2 -0
- package/dist/session-ui.js +14 -12
- package/dist/session.d.ts +1 -0
- package/dist/session.js +6 -4
- package/dist/skill-discovery.d.ts +11 -0
- package/dist/timeline/compaction-copy.d.ts +10 -0
- package/dist/timeline/projection.d.ts +3 -1
- package/dist/timeline/tool-display-name.d.ts +2 -1
- package/dist/timeline/turn-summary.d.ts +2 -2
- package/dist/timeline/types.d.ts +24 -2
- package/dist/{timeline-annotation-markers-DRSTLEM6.js → timeline-annotation-markers-OY6OWR3V.js} +2 -2
- package/dist/{timeline-annotation-selection-IHLUGVND.js → timeline-annotation-selection-BOXA2TIN.js} +2 -2
- package/dist/{timeline-annotations-dialog-6Q53N5FG.js → timeline-annotations-dialog-RGY3MHL3.js} +3 -3
- package/package.json +3 -3
- package/src/approvals.ts +8 -1
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +94 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +0 -9
- package/src/components/approval-surface.tsx +12 -2
- package/src/components/artifacts/document-editor.tsx +63 -6
- package/src/components/artifacts/presentation-editor.tsx +214 -9
- package/src/components/artifacts/spreadsheet-canvas.ts +3 -8
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +10 -11
- package/src/components/chat-composer.tsx +26 -3
- package/src/components/composer.tsx +10 -4
- package/src/components/human-input-form.tsx +12 -2
- package/src/components/markdown.tsx +133 -9
- package/src/components/message-timeline.tsx +104 -36
- package/src/components/model-picker.tsx +11 -3
- package/src/components/model-policy-picker-menu.tsx +10 -3
- package/src/components/preview-loading.tsx +154 -0
- package/src/components/sandbox-workspace.tsx +20 -36
- package/src/components/session-capability-frame.tsx +163 -0
- package/src/components/session-chrome.tsx +46 -77
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +97 -0
- package/src/components/session-conversation.tsx +10 -5
- package/src/components/session-mcp-capability-card.tsx +532 -0
- package/src/components/session-status.tsx +2 -2
- package/src/components/timeline-anchor.tsx +9 -8
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/user-message-body.tsx +7 -0
- package/src/connect-account-identity.tsx +34 -0
- package/src/connect-accounts.tsx +114 -52
- package/src/connect-chooser.tsx +171 -39
- package/src/connect-panel.tsx +73 -9
- package/src/connect-setup.tsx +72 -25
- package/src/connect.ts +13 -22
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +61 -39
- package/src/connection-discovery.tsx +235 -0
- package/src/connection-installed.tsx +2 -0
- package/src/connection-logo.tsx +18 -10
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/conversation-timeline.ts +1 -0
- package/src/discovery-cache.ts +42 -0
- package/src/hooks/use-codex-accounts.ts +33 -14
- package/src/hooks/use-composer.ts +4 -5
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-session-events.ts +114 -1
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-workspace-sessions.ts +10 -0
- package/src/index.ts +22 -2
- package/src/mcp-connection-status.ts +35 -0
- package/src/model-policy.ts +21 -0
- package/src/plugin-details.tsx +8 -5
- package/src/plugin-discovery.tsx +92 -72
- package/src/realtime/realtime-control.tsx +6 -8
- package/src/session-auth-recommendation.ts +48 -0
- package/src/session-capability-policy.ts +83 -0
- package/src/session-ui.ts +2 -0
- package/src/session.ts +1 -0
- package/src/skill-discovery.tsx +101 -56
- package/src/timeline/compaction-copy.ts +40 -0
- package/src/timeline/platform-activity-row.tsx +8 -3
- package/src/timeline/projection.ts +78 -2
- package/src/timeline/rolling-activity.tsx +4 -2
- package/src/timeline/shared.tsx +6 -1
- package/src/timeline/startup-timings.tsx +1 -1
- package/src/timeline/tool-display-name.ts +8 -6
- package/src/timeline/tool-renderers.tsx +5 -3
- package/src/timeline/turn-summary.tsx +17 -3
- package/src/timeline/types.ts +24 -2
- package/styles/compiled.css +325 -27
- package/styles/connect.css +90 -15
- package/styles/index.css +46 -0
- package/styles/session-capability.css +42 -0
- package/dist/chunk-45XEUVTK.js.map +0 -1
- package/dist/chunk-HQV2I5HV.js +0 -124
- package/dist/chunk-HQV2I5HV.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-IHQII5WO.js +0 -886
- package/dist/chunk-IHQII5WO.js.map +0 -1
- package/dist/chunk-KANFU34B.js.map +0 -1
- package/dist/chunk-L2NBTKRX.js.map +0 -1
- package/dist/chunk-NYESIADM.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-TDSEILUH.js.map +0 -1
- package/dist/chunk-UMECRJRV.js.map +0 -1
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/platform-activity-row-DUE2W74J.js.map +0 -1
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-NTD6UIPR.js.map → browser-viewer-LGH4IP47.js.map} +0 -0
- /package/dist/{chunk-NOSYBS2D.js.map → chunk-2VHARTBL.js.map} +0 -0
- /package/dist/{chunk-5M6VTFJ5.js.map → chunk-GBPCZH3Y.js.map} +0 -0
- /package/dist/{chunk-YBM6CQRU.js.map → chunk-GEN54DU5.js.map} +0 -0
- /package/dist/{chunk-R4KRSFGA.js.map → chunk-IP4BUBKH.js.map} +0 -0
- /package/dist/{chunk-NLTS7JHI.js.map → chunk-JPHDWKZE.js.map} +0 -0
- /package/dist/{chunk-24M4YBCL.js.map → chunk-PNAVEK2U.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-3R336DP2.js.map → model-policy-picker-menu-RVOQ4ZZG.js.map} +0 -0
- /package/dist/{queue-surface-implementation-LK3S4BIW.js.map → queue-surface-implementation-3RIFK2BS.js.map} +0 -0
- /package/dist/{timeline-annotation-markers-DRSTLEM6.js.map → timeline-annotation-markers-OY6OWR3V.js.map} +0 -0
- /package/dist/{timeline-annotation-selection-IHLUGVND.js.map → timeline-annotation-selection-BOXA2TIN.js.map} +0 -0
- /package/dist/{timeline-annotations-dialog-6Q53N5FG.js.map → timeline-annotations-dialog-RGY3MHL3.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -28,7 +28,14 @@ import {
|
|
|
28
28
|
healthPulses,
|
|
29
29
|
pointsFor,
|
|
30
30
|
useMachines
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JPHDWKZE.js";
|
|
32
|
+
import {
|
|
33
|
+
McpConnectionCard,
|
|
34
|
+
SessionCapabilityFrame,
|
|
35
|
+
SessionMcpCapabilityCard,
|
|
36
|
+
attachSessionCapability,
|
|
37
|
+
completeSessionCapabilityOAuth
|
|
38
|
+
} from "./chunk-5UONOQ3Y.js";
|
|
32
39
|
import {
|
|
33
40
|
DesktopViewer,
|
|
34
41
|
useDesktopStream,
|
|
@@ -44,35 +51,27 @@ import {
|
|
|
44
51
|
} from "./chunk-5YK2ZDIG.js";
|
|
45
52
|
import {
|
|
46
53
|
ModelPolicyPickerMenu
|
|
47
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-HJ5VJ4JB.js";
|
|
48
55
|
import {
|
|
49
|
-
ActivityDisclosure,
|
|
50
56
|
ActivityRail,
|
|
51
57
|
ApprovalSurface,
|
|
52
58
|
BUILT_IN_TURN_SUMMARY_FACET_IDS,
|
|
53
|
-
BodyNote,
|
|
54
59
|
ChatComposer,
|
|
55
|
-
DisclosureDefaultsProvider,
|
|
56
60
|
GeneratedVideoPlayer,
|
|
57
61
|
HumanInputForm,
|
|
58
62
|
HumanInputSurface,
|
|
59
63
|
KnowledgeActivityProvider,
|
|
60
|
-
MediaEmpty,
|
|
61
|
-
MediaSkeleton,
|
|
62
64
|
MessageTimeline,
|
|
63
|
-
PayloadBlock,
|
|
64
65
|
PierreDiff,
|
|
65
66
|
QueueSurface,
|
|
66
67
|
SESSION_STATUS_META,
|
|
67
|
-
ScreenshotFigure,
|
|
68
68
|
SessionChrome,
|
|
69
|
+
SessionCommands,
|
|
69
70
|
SessionCommandsPanel,
|
|
70
71
|
SessionConversation,
|
|
71
72
|
SessionStatus,
|
|
72
73
|
StartupTimings,
|
|
73
74
|
StatusDot,
|
|
74
|
-
TermBlock,
|
|
75
|
-
Thumbnail,
|
|
76
75
|
TimelineRow,
|
|
77
76
|
TurnSummary,
|
|
78
77
|
UserMessageBody,
|
|
@@ -103,28 +102,38 @@ import {
|
|
|
103
102
|
tailPeek,
|
|
104
103
|
unwrapMcpOutput,
|
|
105
104
|
useAvailableModels,
|
|
105
|
+
useSessionBackgroundCommands,
|
|
106
106
|
useStartupDetails,
|
|
107
107
|
useThemeType,
|
|
108
108
|
useWorkspaceModelCatalog,
|
|
109
109
|
userMessageLikelyNeedsDisclosure,
|
|
110
110
|
v4aToGitFileDiff
|
|
111
|
-
} from "./chunk-
|
|
112
|
-
import "./chunk-
|
|
113
|
-
import "./chunk-
|
|
111
|
+
} from "./chunk-MI6ALLLD.js";
|
|
112
|
+
import "./chunk-GEN54DU5.js";
|
|
113
|
+
import "./chunk-GBPCZH3Y.js";
|
|
114
114
|
import "./chunk-ZYRGEKWS.js";
|
|
115
|
-
import "./chunk-NOSYBS2D.js";
|
|
116
115
|
import {
|
|
117
116
|
OpenGeniProvider
|
|
118
117
|
} from "./chunk-PAJU5KKL.js";
|
|
119
118
|
import {
|
|
119
|
+
ActivityDisclosure,
|
|
120
|
+
BodyNote,
|
|
120
121
|
CopyButton,
|
|
121
122
|
CopyHoverFrame,
|
|
123
|
+
DisclosureDefaultsProvider,
|
|
122
124
|
Markdown,
|
|
125
|
+
MediaEmpty,
|
|
126
|
+
MediaSkeleton,
|
|
127
|
+
PayloadBlock,
|
|
128
|
+
ScreenshotFigure,
|
|
129
|
+
TermBlock,
|
|
130
|
+
Thumbnail,
|
|
123
131
|
prefersReducedMotion,
|
|
124
132
|
retainedImageId,
|
|
125
133
|
sandboxFileLocationFromHref,
|
|
126
134
|
sandboxFilePathFromHref
|
|
127
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-FHIGTPME.js";
|
|
136
|
+
import "./chunk-2VHARTBL.js";
|
|
128
137
|
import {
|
|
129
138
|
copyTextToClipboard,
|
|
130
139
|
tableElementToTsv
|
|
@@ -134,7 +143,6 @@ import {
|
|
|
134
143
|
ComposerTranscriptionControl,
|
|
135
144
|
INITIAL_TRANSCRIPTION_CONTROL_STATE,
|
|
136
145
|
IndexedDbVoiceRecordingStore,
|
|
137
|
-
LightboxProvider,
|
|
138
146
|
ModelPicker,
|
|
139
147
|
OPEN_WORKSTREAM_CONTROL_EVENT,
|
|
140
148
|
VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS,
|
|
@@ -159,18 +167,19 @@ import {
|
|
|
159
167
|
planVoiceRecordingChunkCommit,
|
|
160
168
|
prepareVoiceRecordingChunk,
|
|
161
169
|
transitionTranscriptionControl,
|
|
162
|
-
useLightbox,
|
|
163
|
-
useLightboxOptional,
|
|
164
170
|
useSlashCommands,
|
|
165
171
|
useTranscription,
|
|
166
172
|
useVoiceInput
|
|
167
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-UXE5SSNN.js";
|
|
168
174
|
import {
|
|
175
|
+
LightboxProvider,
|
|
169
176
|
Tooltip,
|
|
170
177
|
TooltipContent,
|
|
171
178
|
TooltipProvider,
|
|
172
|
-
TooltipTrigger
|
|
173
|
-
|
|
179
|
+
TooltipTrigger,
|
|
180
|
+
useLightbox,
|
|
181
|
+
useLightboxOptional
|
|
182
|
+
} from "./chunk-BRM6FVZA.js";
|
|
174
183
|
import "./chunk-WYWRYUNQ.js";
|
|
175
184
|
import {
|
|
176
185
|
BillingClassMark,
|
|
@@ -179,7 +188,7 @@ import {
|
|
|
179
188
|
PickerBackHeader,
|
|
180
189
|
PickerNavRow,
|
|
181
190
|
defaultModelPolicyPickerMessages
|
|
182
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-IP4BUBKH.js";
|
|
183
192
|
import {
|
|
184
193
|
usePortalTokenSource,
|
|
185
194
|
usePortalTokenStyle
|
|
@@ -196,7 +205,7 @@ import {
|
|
|
196
205
|
useSessionControl,
|
|
197
206
|
useSessionLineage,
|
|
198
207
|
useSessionMcpApprovalPolicy
|
|
199
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-DBPVUGQT.js";
|
|
200
209
|
import {
|
|
201
210
|
SESSION_EVENT_BROWSER_MAX_BYTES,
|
|
202
211
|
SESSION_EVENT_BROWSER_MAX_COUNT,
|
|
@@ -204,6 +213,7 @@ import {
|
|
|
204
213
|
SESSION_EVENT_BROWSER_PENDING_MAX_COUNT,
|
|
205
214
|
boundBrowserSessionEventWindow,
|
|
206
215
|
buildTimeline,
|
|
216
|
+
conversationTimeline,
|
|
207
217
|
createOlderHistoryLoadReceipt,
|
|
208
218
|
creditExhaustedFromEvents,
|
|
209
219
|
extractSessionRef,
|
|
@@ -219,14 +229,20 @@ import {
|
|
|
219
229
|
useSession,
|
|
220
230
|
useSessionEvents,
|
|
221
231
|
useTurnQueue
|
|
222
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-TXCBE32L.js";
|
|
223
233
|
import {
|
|
224
234
|
FILE_ONLY_MESSAGE_TEXT,
|
|
225
235
|
composeSendInput,
|
|
226
236
|
shouldSteerOnKey,
|
|
227
237
|
shouldSubmitOnKey,
|
|
228
238
|
useComposer
|
|
229
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-AKOMC3VO.js";
|
|
240
|
+
import {
|
|
241
|
+
useMutationRunner,
|
|
242
|
+
usePageLiveActivity,
|
|
243
|
+
usePolledValue,
|
|
244
|
+
useSessionEventTrigger
|
|
245
|
+
} from "./chunk-KZ73RL76.js";
|
|
230
246
|
import {
|
|
231
247
|
COMPOSER_PAYMENT_REQUIRED_MESSAGE,
|
|
232
248
|
CREDIT_EXHAUSTION_MESSAGE,
|
|
@@ -241,12 +257,6 @@ import {
|
|
|
241
257
|
truncate,
|
|
242
258
|
tryParseJson
|
|
243
259
|
} from "./chunk-PLYRL5ER.js";
|
|
244
|
-
import {
|
|
245
|
-
useMutationRunner,
|
|
246
|
-
usePageLiveActivity,
|
|
247
|
-
usePolledValue,
|
|
248
|
-
useSessionEventTrigger
|
|
249
|
-
} from "./chunk-KZ73RL76.js";
|
|
250
260
|
import {
|
|
251
261
|
useOpenGeni,
|
|
252
262
|
useOpenGeniClient
|
|
@@ -269,11 +279,115 @@ import {
|
|
|
269
279
|
projectPickerRows,
|
|
270
280
|
runnableLatencyModesForModel,
|
|
271
281
|
sortPickerRows
|
|
272
|
-
} from "./chunk-
|
|
282
|
+
} from "./chunk-5GAL23FF.js";
|
|
273
283
|
import {
|
|
274
284
|
cn
|
|
275
285
|
} from "./chunk-22KP6LR5.js";
|
|
276
286
|
|
|
287
|
+
// src/session-auth-recommendation.ts
|
|
288
|
+
function sessionAuthRecommendation(item, catalog) {
|
|
289
|
+
if (item.authoritySource === "host" || item.reason === "unsupported_auth" || item.reason === "resource_scope_unavailable")
|
|
290
|
+
return void 0;
|
|
291
|
+
if (item.capability) return item;
|
|
292
|
+
const recoveryServerId = item.canonicalServerId ?? item.serverId;
|
|
293
|
+
const matches = catalog.filter(
|
|
294
|
+
(candidate) => recoveryServerId !== null && candidate.runtime.mcpServerId === recoveryServerId && recoveryServerId !== "opengeni" || item.connectionId !== null && candidate.connectionRef?.connectionId === item.connectionId
|
|
295
|
+
);
|
|
296
|
+
if (matches.length !== 1) return void 0;
|
|
297
|
+
const entry = matches[0];
|
|
298
|
+
const personalAccess = item.reason === "personal_authority_unavailable";
|
|
299
|
+
if (personalAccess && ((item.connectionSubjectScope ?? entry.connectionRef?.subjectScope) !== "subject" || entry.connectionRef?.authoritySource === "host"))
|
|
300
|
+
return void 0;
|
|
301
|
+
return {
|
|
302
|
+
...item,
|
|
303
|
+
capability: {
|
|
304
|
+
id: entry.id,
|
|
305
|
+
name: entry.name,
|
|
306
|
+
kind: entry.kind,
|
|
307
|
+
source: entry.source,
|
|
308
|
+
action: "connect",
|
|
309
|
+
rationale: personalAccess ? "Review permission to use your personal account in this conversation." : "Reconnect this integration to use its tools in this conversation.",
|
|
310
|
+
requiredVariables: []
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// src/components/session-connection-request.tsx
|
|
316
|
+
import { useEffect, useRef, useState } from "react";
|
|
317
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
318
|
+
function SessionConnectionRequest(props) {
|
|
319
|
+
const [client, setClient] = useState(props.client);
|
|
320
|
+
const [generation, setGeneration] = useState(0);
|
|
321
|
+
if (client !== props.client) {
|
|
322
|
+
setClient(props.client);
|
|
323
|
+
setGeneration(generation + 1);
|
|
324
|
+
}
|
|
325
|
+
return /* @__PURE__ */ jsx(
|
|
326
|
+
ScopedRequest,
|
|
327
|
+
{
|
|
328
|
+
...props
|
|
329
|
+
},
|
|
330
|
+
`${generation}:${props.workspaceId}:${props.sessionId}:${props.request.id}`
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
function ScopedRequest({ request, ...props }) {
|
|
334
|
+
const [resolved, setResolved] = useState(null);
|
|
335
|
+
const [error, setError] = useState(null);
|
|
336
|
+
const [retry, setRetry] = useState(0);
|
|
337
|
+
const requestRef = useRef(request);
|
|
338
|
+
requestRef.current = request;
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
let current = true;
|
|
341
|
+
const event = requestRef.current;
|
|
342
|
+
setResolved(null);
|
|
343
|
+
setError(null);
|
|
344
|
+
void props.client.listCapabilities(props.workspaceId).then((catalog) => {
|
|
345
|
+
if (!current) return;
|
|
346
|
+
const recommendation = sessionAuthRecommendation(event, catalog.items);
|
|
347
|
+
const candidate = catalog.items.find(
|
|
348
|
+
(entry) => entry.id === recommendation?.capability?.id
|
|
349
|
+
);
|
|
350
|
+
if (!recommendation || candidate?.kind !== "mcp" || candidate.authKind !== "oauth2") {
|
|
351
|
+
setError(
|
|
352
|
+
"This request could not be matched to one available OAuth integration. Review its connection settings before continuing."
|
|
353
|
+
);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
setResolved(recommendation);
|
|
357
|
+
}).catch(() => {
|
|
358
|
+
if (current)
|
|
359
|
+
setError("Couldn't load connection details. Retry to check the current integration.");
|
|
360
|
+
});
|
|
361
|
+
return () => {
|
|
362
|
+
current = false;
|
|
363
|
+
};
|
|
364
|
+
}, [
|
|
365
|
+
props.client,
|
|
366
|
+
props.workspaceId,
|
|
367
|
+
request.id,
|
|
368
|
+
request.serverId,
|
|
369
|
+
request.connectionId,
|
|
370
|
+
request.authoritySource,
|
|
371
|
+
request.reason,
|
|
372
|
+
request.capability?.id,
|
|
373
|
+
retry
|
|
374
|
+
]);
|
|
375
|
+
if (!resolved?.capability)
|
|
376
|
+
return /* @__PURE__ */ jsxs("div", { className: "og-session-capability-setup", children: [
|
|
377
|
+
/* @__PURE__ */ jsx("p", { role: error ? "alert" : "status", children: error ?? "Loading connection details\u2026" }),
|
|
378
|
+
error ? /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setRetry((value) => value + 1), children: "Retry" }) : null
|
|
379
|
+
] });
|
|
380
|
+
return /* @__PURE__ */ jsx(
|
|
381
|
+
SessionMcpCapabilityCard,
|
|
382
|
+
{
|
|
383
|
+
...props,
|
|
384
|
+
capabilityId: resolved.capability.id,
|
|
385
|
+
name: resolved.capability.name,
|
|
386
|
+
rationale: resolved.capability.rationale
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
|
|
277
391
|
// src/hooks/use-video-artifact-playback.ts
|
|
278
392
|
import { useMemo } from "react";
|
|
279
393
|
function useVideoArtifactPlaybackLoader(options = {}) {
|
|
@@ -327,7 +441,7 @@ function filePathVisibility(nodes, path, predicate, parent = null, depth = 0) {
|
|
|
327
441
|
}
|
|
328
442
|
|
|
329
443
|
// src/hooks/use-last-started-turn-policy.ts
|
|
330
|
-
import { useCallback, useEffect } from "react";
|
|
444
|
+
import { useCallback, useEffect as useEffect2 } from "react";
|
|
331
445
|
function isLastStartedTurnPolicyEvent(event) {
|
|
332
446
|
return event.type === "turn.started";
|
|
333
447
|
}
|
|
@@ -358,10 +472,10 @@ function useLastStartedTurnPolicy(sessionId, options = {}) {
|
|
|
358
472
|
pollIntervalMs: options.pollIntervalMs,
|
|
359
473
|
enabled
|
|
360
474
|
});
|
|
361
|
-
|
|
475
|
+
useEffect2(() => {
|
|
362
476
|
if (enabled && workspaceControlEvent) void refresh();
|
|
363
477
|
}, [enabled, refresh, workspaceControlEvent]);
|
|
364
|
-
|
|
478
|
+
useEffect2(() => {
|
|
365
479
|
if (!sessionId || !enabled) return;
|
|
366
480
|
return registerSessionReconciler(sessionId, "last-started-turn-policy", refresh);
|
|
367
481
|
}, [enabled, refresh, registerSessionReconciler, sessionId]);
|
|
@@ -406,7 +520,7 @@ function useScheduledTasks(options = {}) {
|
|
|
406
520
|
}
|
|
407
521
|
|
|
408
522
|
// src/hooks/use-workspace-sessions.ts
|
|
409
|
-
import { useCallback as useCallback3, useEffect as
|
|
523
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
410
524
|
function useWorkspaceSessions(options = {}) {
|
|
411
525
|
const { client, workspaceId } = useOpenGeni(options);
|
|
412
526
|
const limit = options.limit;
|
|
@@ -415,9 +529,11 @@ function useWorkspaceSessions(options = {}) {
|
|
|
415
529
|
const search = options.search;
|
|
416
530
|
const pinsOnly = options.pinsOnly;
|
|
417
531
|
const archivedOnly = options.archivedOnly;
|
|
532
|
+
const sortBy = options.sortBy;
|
|
533
|
+
const archiveStatus = options.archiveStatus;
|
|
418
534
|
const enabled = options.enabled ?? true;
|
|
419
|
-
const nextReadRevision =
|
|
420
|
-
const nextReadGeneration =
|
|
535
|
+
const nextReadRevision = useRef2(0);
|
|
536
|
+
const nextReadGeneration = useRef2(0);
|
|
421
537
|
const beginRead = options.beginRead;
|
|
422
538
|
const queryKey = [
|
|
423
539
|
workspaceId,
|
|
@@ -426,11 +542,13 @@ function useWorkspaceSessions(options = {}) {
|
|
|
426
542
|
cursor ?? "",
|
|
427
543
|
search ?? "",
|
|
428
544
|
pinsOnly ? "1" : "",
|
|
429
|
-
archivedOnly ? "archived" : "active"
|
|
545
|
+
archivedOnly ? "archived" : "active",
|
|
546
|
+
sortBy ?? "",
|
|
547
|
+
archiveStatus ?? ""
|
|
430
548
|
].join("\0");
|
|
431
|
-
const previousQueryKey =
|
|
549
|
+
const previousQueryKey = useRef2(queryKey);
|
|
432
550
|
const queryKeyTransition = previousQueryKey.current !== queryKey;
|
|
433
|
-
|
|
551
|
+
useEffect3(() => {
|
|
434
552
|
previousQueryKey.current = queryKey;
|
|
435
553
|
}, [queryKey]);
|
|
436
554
|
const load = useCallback3(
|
|
@@ -443,6 +561,8 @@ function useWorkspaceSessions(options = {}) {
|
|
|
443
561
|
...search !== void 0 ? { search } : {},
|
|
444
562
|
...pinsOnly ? { pinsOnly: true } : {},
|
|
445
563
|
...archivedOnly ? { archivedOnly: true } : {},
|
|
564
|
+
...sortBy ? { sortBy } : {},
|
|
565
|
+
...archiveStatus ? { archiveStatus } : {},
|
|
446
566
|
signal
|
|
447
567
|
});
|
|
448
568
|
return {
|
|
@@ -462,6 +582,8 @@ function useWorkspaceSessions(options = {}) {
|
|
|
462
582
|
search,
|
|
463
583
|
pinsOnly,
|
|
464
584
|
archivedOnly,
|
|
585
|
+
sortBy,
|
|
586
|
+
archiveStatus,
|
|
465
587
|
queryKey
|
|
466
588
|
]
|
|
467
589
|
);
|
|
@@ -492,59 +614,11 @@ function useWorkspaceSessions(options = {}) {
|
|
|
492
614
|
};
|
|
493
615
|
}
|
|
494
616
|
|
|
495
|
-
// src/hooks/use-session-background-commands.ts
|
|
496
|
-
import { useCallback as useCallback4, useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
497
|
-
function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
498
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
499
|
-
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
500
|
-
const load = useCallback4(
|
|
501
|
-
async (signal) => {
|
|
502
|
-
if (!sessionId) return { commands: [] };
|
|
503
|
-
if (!client.listSessionBackgroundCommands) {
|
|
504
|
-
throw new Error("The configured OpenGeni client does not support background commands");
|
|
505
|
-
}
|
|
506
|
-
return await client.listSessionBackgroundCommands(workspaceId, sessionId, { signal });
|
|
507
|
-
},
|
|
508
|
-
[client, workspaceId, sessionId]
|
|
509
|
-
);
|
|
510
|
-
const state = usePolledValue(load, {
|
|
511
|
-
enabled,
|
|
512
|
-
pollIntervalMs: options.pollIntervalMs
|
|
513
|
-
});
|
|
514
|
-
const refresh = state.refresh;
|
|
515
|
-
const generation = useRef2(0);
|
|
516
|
-
useEffect3(() => {
|
|
517
|
-
generation.current += 1;
|
|
518
|
-
return () => {
|
|
519
|
-
generation.current += 1;
|
|
520
|
-
};
|
|
521
|
-
}, [client, workspaceId, sessionId, enabled]);
|
|
522
|
-
const cancel = useCallback4(
|
|
523
|
-
async (commandId) => {
|
|
524
|
-
if (!sessionId) return;
|
|
525
|
-
if (!client.cancelSessionBackgroundCommand) {
|
|
526
|
-
throw new Error("The configured OpenGeni client does not support background commands");
|
|
527
|
-
}
|
|
528
|
-
const ticket = generation.current;
|
|
529
|
-
await client.cancelSessionBackgroundCommand(workspaceId, sessionId, commandId);
|
|
530
|
-
if (enabled && ticket === generation.current) await refresh();
|
|
531
|
-
},
|
|
532
|
-
[client, workspaceId, sessionId, refresh, enabled]
|
|
533
|
-
);
|
|
534
|
-
return {
|
|
535
|
-
commands: state.data?.commands ?? [],
|
|
536
|
-
loading: state.loading,
|
|
537
|
-
error: state.error,
|
|
538
|
-
refresh,
|
|
539
|
-
cancel
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
|
|
543
617
|
// src/hooks/use-environments.ts
|
|
544
|
-
import { useCallback as
|
|
618
|
+
import { useCallback as useCallback4, useMemo as useMemo2 } from "react";
|
|
545
619
|
function useVariableSets(options = {}) {
|
|
546
620
|
const { client, workspaceId } = useOpenGeni(options);
|
|
547
|
-
const load =
|
|
621
|
+
const load = useCallback4(
|
|
548
622
|
async () => await client.listVariableSets(workspaceId),
|
|
549
623
|
[client, workspaceId]
|
|
550
624
|
);
|
|
@@ -553,7 +627,7 @@ function useVariableSets(options = {}) {
|
|
|
553
627
|
enabled: options.enabled
|
|
554
628
|
});
|
|
555
629
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
556
|
-
const create =
|
|
630
|
+
const create = useCallback4(
|
|
557
631
|
async (request) => {
|
|
558
632
|
const result = await run(() => client.createVariableSet(workspaceId, request));
|
|
559
633
|
if (result) {
|
|
@@ -563,7 +637,7 @@ function useVariableSets(options = {}) {
|
|
|
563
637
|
},
|
|
564
638
|
[client, workspaceId, run, refresh]
|
|
565
639
|
);
|
|
566
|
-
const update =
|
|
640
|
+
const update = useCallback4(
|
|
567
641
|
async (variableSetId, request) => {
|
|
568
642
|
const result = await run(() => client.updateVariableSet(workspaceId, variableSetId, request));
|
|
569
643
|
if (result) {
|
|
@@ -573,7 +647,7 @@ function useVariableSets(options = {}) {
|
|
|
573
647
|
},
|
|
574
648
|
[client, workspaceId, run, refresh]
|
|
575
649
|
);
|
|
576
|
-
const remove =
|
|
650
|
+
const remove = useCallback4(
|
|
577
651
|
async (variableSetId) => {
|
|
578
652
|
const result = await run(async () => {
|
|
579
653
|
await client.deleteVariableSet(workspaceId, variableSetId);
|
|
@@ -586,11 +660,11 @@ function useVariableSets(options = {}) {
|
|
|
586
660
|
},
|
|
587
661
|
[client, workspaceId, run, refresh]
|
|
588
662
|
);
|
|
589
|
-
const readVariable =
|
|
663
|
+
const readVariable = useCallback4(
|
|
590
664
|
async (variableSetId, name) => await run(() => client.getVariableSetVariable(workspaceId, variableSetId, name)),
|
|
591
665
|
[client, workspaceId, run]
|
|
592
666
|
);
|
|
593
|
-
const setVariable =
|
|
667
|
+
const setVariable = useCallback4(
|
|
594
668
|
async (variableSetId, name, value) => {
|
|
595
669
|
const result = await run(
|
|
596
670
|
() => client.setVariableSetVariable(workspaceId, variableSetId, name, value)
|
|
@@ -602,7 +676,7 @@ function useVariableSets(options = {}) {
|
|
|
602
676
|
},
|
|
603
677
|
[client, workspaceId, run, refresh]
|
|
604
678
|
);
|
|
605
|
-
const deleteVariable =
|
|
679
|
+
const deleteVariable = useCallback4(
|
|
606
680
|
async (variableSetId, name) => {
|
|
607
681
|
const result = await run(async () => {
|
|
608
682
|
await client.deleteVariableSetVariable(workspaceId, variableSetId, name);
|
|
@@ -654,7 +728,7 @@ function useEnvironments(options = {}) {
|
|
|
654
728
|
}
|
|
655
729
|
|
|
656
730
|
// src/hooks/use-channels.ts
|
|
657
|
-
import { useCallback as
|
|
731
|
+
import { useCallback as useCallback5, useMemo as useMemo3, useSyncExternalStore } from "react";
|
|
658
732
|
|
|
659
733
|
// src/hooks/channel-cache.ts
|
|
660
734
|
var EMPTY_CHANNELS = [];
|
|
@@ -730,7 +804,7 @@ function useChannels(options = {}) {
|
|
|
730
804
|
const { client, workspaceId } = useOpenGeni(options);
|
|
731
805
|
const cache = useMemo3(() => channelCacheFor(client, workspaceId), [client, workspaceId]);
|
|
732
806
|
const snapshot = useSyncExternalStore(cache.subscribe, cache.getSnapshot, cache.getSnapshot);
|
|
733
|
-
const load =
|
|
807
|
+
const load = useCallback5(async () => {
|
|
734
808
|
const ticket = cache.beginLoad();
|
|
735
809
|
const channels = await client.listChannels(workspaceId);
|
|
736
810
|
cache.acceptLoad(ticket, channels);
|
|
@@ -741,7 +815,7 @@ function useChannels(options = {}) {
|
|
|
741
815
|
enabled: options.enabled
|
|
742
816
|
});
|
|
743
817
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner(cache);
|
|
744
|
-
const create =
|
|
818
|
+
const create = useCallback5(
|
|
745
819
|
async (request) => {
|
|
746
820
|
const result = await run(() => client.createChannel(workspaceId, request));
|
|
747
821
|
if (result) {
|
|
@@ -752,7 +826,7 @@ function useChannels(options = {}) {
|
|
|
752
826
|
},
|
|
753
827
|
[cache, client, workspaceId, run, refresh]
|
|
754
828
|
);
|
|
755
|
-
const update =
|
|
829
|
+
const update = useCallback5(
|
|
756
830
|
async (channelId, request) => {
|
|
757
831
|
const result = await run(() => client.updateChannel(workspaceId, channelId, request));
|
|
758
832
|
if (result) {
|
|
@@ -762,7 +836,7 @@ function useChannels(options = {}) {
|
|
|
762
836
|
},
|
|
763
837
|
[client, workspaceId, run, refresh]
|
|
764
838
|
);
|
|
765
|
-
const remove =
|
|
839
|
+
const remove = useCallback5(
|
|
766
840
|
async (channelId) => {
|
|
767
841
|
const result = await run(async () => {
|
|
768
842
|
await client.deleteChannel(workspaceId, channelId);
|
|
@@ -775,7 +849,7 @@ function useChannels(options = {}) {
|
|
|
775
849
|
},
|
|
776
850
|
[client, workspaceId, run, refresh]
|
|
777
851
|
);
|
|
778
|
-
const reorder =
|
|
852
|
+
const reorder = useCallback5(
|
|
779
853
|
async (channelIds) => {
|
|
780
854
|
const result = await run(() => client.reorderChannels(workspaceId, { channelIds }));
|
|
781
855
|
if (result) await refresh();
|
|
@@ -783,7 +857,7 @@ function useChannels(options = {}) {
|
|
|
783
857
|
},
|
|
784
858
|
[client, workspaceId, run, refresh]
|
|
785
859
|
);
|
|
786
|
-
const moveSession =
|
|
860
|
+
const moveSession = useCallback5(
|
|
787
861
|
async (sessionId, channelId) => {
|
|
788
862
|
return await run(() => client.updateSessionChannel(workspaceId, sessionId, { channelId }));
|
|
789
863
|
},
|
|
@@ -808,16 +882,16 @@ function useChannels(options = {}) {
|
|
|
808
882
|
}
|
|
809
883
|
|
|
810
884
|
// src/hooks/use-rigs.ts
|
|
811
|
-
import { useCallback as
|
|
885
|
+
import { useCallback as useCallback6 } from "react";
|
|
812
886
|
function useRigs(options = {}) {
|
|
813
887
|
const { client, workspaceId } = useOpenGeni(options);
|
|
814
|
-
const load =
|
|
888
|
+
const load = useCallback6(async () => await client.listRigs(workspaceId), [client, workspaceId]);
|
|
815
889
|
const { data, loading, error, refresh } = usePolledValue(load, {
|
|
816
890
|
pollIntervalMs: options.pollIntervalMs,
|
|
817
891
|
enabled: options.enabled
|
|
818
892
|
});
|
|
819
893
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
820
|
-
const create =
|
|
894
|
+
const create = useCallback6(
|
|
821
895
|
async (request) => {
|
|
822
896
|
const result = await run(() => client.createRig(workspaceId, request));
|
|
823
897
|
if (result) {
|
|
@@ -827,7 +901,7 @@ function useRigs(options = {}) {
|
|
|
827
901
|
},
|
|
828
902
|
[client, workspaceId, run, refresh]
|
|
829
903
|
);
|
|
830
|
-
const update =
|
|
904
|
+
const update = useCallback6(
|
|
831
905
|
async (rigId, request) => {
|
|
832
906
|
const result = await run(() => client.updateRig(workspaceId, rigId, request));
|
|
833
907
|
if (result) {
|
|
@@ -837,7 +911,7 @@ function useRigs(options = {}) {
|
|
|
837
911
|
},
|
|
838
912
|
[client, workspaceId, run, refresh]
|
|
839
913
|
);
|
|
840
|
-
const remove =
|
|
914
|
+
const remove = useCallback6(
|
|
841
915
|
async (rigId) => {
|
|
842
916
|
const result = await run(async () => {
|
|
843
917
|
await client.deleteRig(workspaceId, rigId);
|
|
@@ -850,13 +924,13 @@ function useRigs(options = {}) {
|
|
|
850
924
|
},
|
|
851
925
|
[client, workspaceId, run, refresh]
|
|
852
926
|
);
|
|
853
|
-
const listVersions =
|
|
927
|
+
const listVersions = useCallback6(
|
|
854
928
|
async (rigId) => {
|
|
855
929
|
return await run(() => client.listRigVersions(workspaceId, rigId));
|
|
856
930
|
},
|
|
857
931
|
[client, workspaceId, run]
|
|
858
932
|
);
|
|
859
|
-
const activateVersion =
|
|
933
|
+
const activateVersion = useCallback6(
|
|
860
934
|
async (rigId, versionId) => {
|
|
861
935
|
const result = await run(() => client.activateRigVersion(workspaceId, rigId, versionId));
|
|
862
936
|
if (result) {
|
|
@@ -866,13 +940,13 @@ function useRigs(options = {}) {
|
|
|
866
940
|
},
|
|
867
941
|
[client, workspaceId, run, refresh]
|
|
868
942
|
);
|
|
869
|
-
const listChanges =
|
|
943
|
+
const listChanges = useCallback6(
|
|
870
944
|
async (rigId) => {
|
|
871
945
|
return await run(() => client.listRigChanges(workspaceId, rigId));
|
|
872
946
|
},
|
|
873
947
|
[client, workspaceId, run]
|
|
874
948
|
);
|
|
875
|
-
const proposeChange =
|
|
949
|
+
const proposeChange = useCallback6(
|
|
876
950
|
async (rigId, request) => {
|
|
877
951
|
const result = await run(() => client.proposeRigChange(workspaceId, rigId, request));
|
|
878
952
|
if (result) {
|
|
@@ -901,7 +975,7 @@ function useRigs(options = {}) {
|
|
|
901
975
|
}
|
|
902
976
|
function useRig(rigId, options = {}) {
|
|
903
977
|
const { client, workspaceId } = useOpenGeni(options);
|
|
904
|
-
const load =
|
|
978
|
+
const load = useCallback6(
|
|
905
979
|
async () => await client.getRig(workspaceId, rigId),
|
|
906
980
|
[client, workspaceId, rigId]
|
|
907
981
|
);
|
|
@@ -910,7 +984,7 @@ function useRig(rigId, options = {}) {
|
|
|
910
984
|
enabled: options.enabled
|
|
911
985
|
});
|
|
912
986
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
913
|
-
const update =
|
|
987
|
+
const update = useCallback6(
|
|
914
988
|
async (request) => {
|
|
915
989
|
const result = await run(() => client.updateRig(workspaceId, rigId, request));
|
|
916
990
|
if (result) {
|
|
@@ -920,14 +994,14 @@ function useRig(rigId, options = {}) {
|
|
|
920
994
|
},
|
|
921
995
|
[client, workspaceId, rigId, run, refresh]
|
|
922
996
|
);
|
|
923
|
-
const remove =
|
|
997
|
+
const remove = useCallback6(async () => {
|
|
924
998
|
const result = await run(async () => {
|
|
925
999
|
await client.deleteRig(workspaceId, rigId);
|
|
926
1000
|
return true;
|
|
927
1001
|
});
|
|
928
1002
|
return result === true;
|
|
929
1003
|
}, [client, workspaceId, rigId, run]);
|
|
930
|
-
const activateVersion =
|
|
1004
|
+
const activateVersion = useCallback6(
|
|
931
1005
|
async (versionId) => {
|
|
932
1006
|
const result = await run(() => client.activateRigVersion(workspaceId, rigId, versionId));
|
|
933
1007
|
if (result) {
|
|
@@ -937,7 +1011,7 @@ function useRig(rigId, options = {}) {
|
|
|
937
1011
|
},
|
|
938
1012
|
[client, workspaceId, rigId, run, refresh]
|
|
939
1013
|
);
|
|
940
|
-
const proposeChange =
|
|
1014
|
+
const proposeChange = useCallback6(
|
|
941
1015
|
async (request) => {
|
|
942
1016
|
const result = await run(() => client.proposeRigChange(workspaceId, rigId, request));
|
|
943
1017
|
if (result) {
|
|
@@ -947,7 +1021,7 @@ function useRig(rigId, options = {}) {
|
|
|
947
1021
|
},
|
|
948
1022
|
[client, workspaceId, rigId, run, refresh]
|
|
949
1023
|
);
|
|
950
|
-
const verifyChange =
|
|
1024
|
+
const verifyChange = useCallback6(
|
|
951
1025
|
async (changeId) => {
|
|
952
1026
|
const result = await run(() => client.verifyRigChange(workspaceId, rigId, changeId));
|
|
953
1027
|
if (result) {
|
|
@@ -957,7 +1031,7 @@ function useRig(rigId, options = {}) {
|
|
|
957
1031
|
},
|
|
958
1032
|
[client, workspaceId, rigId, run, refresh]
|
|
959
1033
|
);
|
|
960
|
-
const promoteChange =
|
|
1034
|
+
const promoteChange = useCallback6(
|
|
961
1035
|
async (changeId) => {
|
|
962
1036
|
const result = await run(() => client.promoteRigChange(workspaceId, rigId, changeId));
|
|
963
1037
|
if (result) {
|
|
@@ -967,7 +1041,7 @@ function useRig(rigId, options = {}) {
|
|
|
967
1041
|
},
|
|
968
1042
|
[client, workspaceId, rigId, run, refresh]
|
|
969
1043
|
);
|
|
970
|
-
const verify =
|
|
1044
|
+
const verify = useCallback6(async () => {
|
|
971
1045
|
return await run(() => client.verifyRig(workspaceId, rigId));
|
|
972
1046
|
}, [client, workspaceId, rigId, run]);
|
|
973
1047
|
return {
|
|
@@ -989,7 +1063,7 @@ function useRig(rigId, options = {}) {
|
|
|
989
1063
|
}
|
|
990
1064
|
function useRigVersions(rigId, options = {}) {
|
|
991
1065
|
const { client, workspaceId } = useOpenGeni(options);
|
|
992
|
-
const load =
|
|
1066
|
+
const load = useCallback6(
|
|
993
1067
|
async () => await client.listRigVersions(workspaceId, rigId),
|
|
994
1068
|
[client, workspaceId, rigId]
|
|
995
1069
|
);
|
|
@@ -1006,7 +1080,7 @@ function useRigVersions(rigId, options = {}) {
|
|
|
1006
1080
|
}
|
|
1007
1081
|
function useRigChanges(rigId, options = {}) {
|
|
1008
1082
|
const { client, workspaceId } = useOpenGeni(options);
|
|
1009
|
-
const load =
|
|
1083
|
+
const load = useCallback6(
|
|
1010
1084
|
async () => await client.listRigChanges(workspaceId, rigId),
|
|
1011
1085
|
[client, workspaceId, rigId]
|
|
1012
1086
|
);
|
|
@@ -1022,110 +1096,17 @@ function useRigChanges(rigId, options = {}) {
|
|
|
1022
1096
|
};
|
|
1023
1097
|
}
|
|
1024
1098
|
|
|
1025
|
-
// src/hooks/use-packs.ts
|
|
1026
|
-
import { useCallback as useCallback8 } from "react";
|
|
1027
|
-
var EMPTY_INSTALLATIONS = [];
|
|
1028
|
-
function usePacks(options = {}) {
|
|
1029
|
-
const { client, workspaceId } = useOpenGeni(options);
|
|
1030
|
-
const load = useCallback8(async () => await client.listPacks(workspaceId), [client, workspaceId]);
|
|
1031
|
-
const { data, loading, error, refresh } = usePolledValue(load, {
|
|
1032
|
-
pollIntervalMs: options.pollIntervalMs,
|
|
1033
|
-
enabled: options.enabled
|
|
1034
|
-
});
|
|
1035
|
-
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
1036
|
-
const register = useCallback8(
|
|
1037
|
-
async (manifest) => {
|
|
1038
|
-
const result = await run(() => client.registerPack(workspaceId, manifest));
|
|
1039
|
-
if (result) {
|
|
1040
|
-
await refresh();
|
|
1041
|
-
}
|
|
1042
|
-
return result;
|
|
1043
|
-
},
|
|
1044
|
-
[client, workspaceId, run, refresh]
|
|
1045
|
-
);
|
|
1046
|
-
const enable = useCallback8(
|
|
1047
|
-
async (packId, request = {}) => {
|
|
1048
|
-
const result = await run(() => client.enablePack(workspaceId, packId, request));
|
|
1049
|
-
if (result) {
|
|
1050
|
-
await refresh();
|
|
1051
|
-
}
|
|
1052
|
-
return result;
|
|
1053
|
-
},
|
|
1054
|
-
[client, workspaceId, run, refresh]
|
|
1055
|
-
);
|
|
1056
|
-
const previewInstallation = useCallback8(
|
|
1057
|
-
async (packId, request = {}) => await run(() => client.previewPackInstallation(workspaceId, packId, request)),
|
|
1058
|
-
[client, workspaceId, run]
|
|
1059
|
-
);
|
|
1060
|
-
const install = useCallback8(
|
|
1061
|
-
async (packId, request) => {
|
|
1062
|
-
const result = await run(() => client.installPack(workspaceId, packId, request));
|
|
1063
|
-
if (result) await refresh();
|
|
1064
|
-
return result;
|
|
1065
|
-
},
|
|
1066
|
-
[client, workspaceId, run, refresh]
|
|
1067
|
-
);
|
|
1068
|
-
const previewUninstall = useCallback8(
|
|
1069
|
-
async (packId) => await run(() => client.previewPackUninstall(workspaceId, packId)),
|
|
1070
|
-
[client, workspaceId, run]
|
|
1071
|
-
);
|
|
1072
|
-
const uninstall = useCallback8(
|
|
1073
|
-
async (packId, request) => {
|
|
1074
|
-
const result = await run(() => client.uninstallPack(workspaceId, packId, request));
|
|
1075
|
-
if (result) await refresh();
|
|
1076
|
-
return result;
|
|
1077
|
-
},
|
|
1078
|
-
[client, workspaceId, run, refresh]
|
|
1079
|
-
);
|
|
1080
|
-
const remove = useCallback8(
|
|
1081
|
-
async (packId) => {
|
|
1082
|
-
const result = await run(async () => {
|
|
1083
|
-
await client.deletePack(workspaceId, packId);
|
|
1084
|
-
return true;
|
|
1085
|
-
});
|
|
1086
|
-
if (result) {
|
|
1087
|
-
await refresh();
|
|
1088
|
-
}
|
|
1089
|
-
return result === true;
|
|
1090
|
-
},
|
|
1091
|
-
[client, workspaceId, run, refresh]
|
|
1092
|
-
);
|
|
1093
|
-
const installations = data?.installations ?? EMPTY_INSTALLATIONS;
|
|
1094
|
-
const installationFor = useCallback8(
|
|
1095
|
-
(packId) => installations.find((installation) => installation.packId === packId) ?? null,
|
|
1096
|
-
[installations]
|
|
1097
|
-
);
|
|
1098
|
-
return {
|
|
1099
|
-
packs: data?.packs ?? [],
|
|
1100
|
-
installations,
|
|
1101
|
-
installationFor,
|
|
1102
|
-
loading,
|
|
1103
|
-
error,
|
|
1104
|
-
refresh,
|
|
1105
|
-
register,
|
|
1106
|
-
enable,
|
|
1107
|
-
previewInstallation,
|
|
1108
|
-
install,
|
|
1109
|
-
previewUninstall,
|
|
1110
|
-
uninstall,
|
|
1111
|
-
remove,
|
|
1112
|
-
mutating,
|
|
1113
|
-
mutationError,
|
|
1114
|
-
clearMutationError
|
|
1115
|
-
};
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
1099
|
// src/hooks/use-workspaces.ts
|
|
1119
|
-
import { useCallback as
|
|
1100
|
+
import { useCallback as useCallback7 } from "react";
|
|
1120
1101
|
function useWorkspaces(options = {}) {
|
|
1121
1102
|
const client = useOpenGeniClient(options);
|
|
1122
|
-
const load =
|
|
1103
|
+
const load = useCallback7(async () => await client.listWorkspaces(), [client]);
|
|
1123
1104
|
const { data, loading, error, refresh } = usePolledValue(load, {
|
|
1124
1105
|
pollIntervalMs: options.pollIntervalMs,
|
|
1125
1106
|
enabled: options.enabled
|
|
1126
1107
|
});
|
|
1127
1108
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
1128
|
-
const create =
|
|
1109
|
+
const create = useCallback7(
|
|
1129
1110
|
async (request) => {
|
|
1130
1111
|
const result = await run(() => client.createWorkspace(request));
|
|
1131
1112
|
if (result) {
|
|
@@ -1135,7 +1116,7 @@ function useWorkspaces(options = {}) {
|
|
|
1135
1116
|
},
|
|
1136
1117
|
[client, run, refresh]
|
|
1137
1118
|
);
|
|
1138
|
-
const update =
|
|
1119
|
+
const update = useCallback7(
|
|
1139
1120
|
async (workspaceId, request) => {
|
|
1140
1121
|
const result = await run(() => client.updateWorkspace(workspaceId, request));
|
|
1141
1122
|
if (result) {
|
|
@@ -1159,12 +1140,12 @@ function useWorkspaces(options = {}) {
|
|
|
1159
1140
|
}
|
|
1160
1141
|
|
|
1161
1142
|
// src/hooks/use-billing-usage.ts
|
|
1162
|
-
import { useCallback as
|
|
1143
|
+
import { useCallback as useCallback8 } from "react";
|
|
1163
1144
|
function useBillingUsage(options = {}) {
|
|
1164
1145
|
const client = useOpenGeniClient(options);
|
|
1165
1146
|
const accountId = options.accountId;
|
|
1166
1147
|
const workspaceId = options.workspaceId;
|
|
1167
|
-
const load =
|
|
1148
|
+
const load = useCallback8(
|
|
1168
1149
|
async () => await client.getBillingUsage({
|
|
1169
1150
|
...accountId !== void 0 ? { accountId } : {},
|
|
1170
1151
|
...workspaceId !== void 0 ? { workspaceId } : {}
|
|
@@ -1189,7 +1170,7 @@ import {
|
|
|
1189
1170
|
OpenGeniApiError,
|
|
1190
1171
|
applyUrlRotation
|
|
1191
1172
|
} from "@opengeni/sdk";
|
|
1192
|
-
import { useCallback as
|
|
1173
|
+
import { useCallback as useCallback9, useEffect as useEffect4, useRef as useRef3, useState as useState2 } from "react";
|
|
1193
1174
|
|
|
1194
1175
|
// src/lib/sandbox-liveness.ts
|
|
1195
1176
|
function sandboxAcceptsLiveIo(liveness) {
|
|
@@ -1228,18 +1209,18 @@ function useSessionCapabilities(sessionId, options = {}) {
|
|
|
1228
1209
|
const warmingPollMs = options.warmingPollMs ?? 1500;
|
|
1229
1210
|
const warmingDeadlineMs = options.warmingDeadlineMs ?? 3e4;
|
|
1230
1211
|
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${enabled}`;
|
|
1231
|
-
const [capabilities, setCapabilities] =
|
|
1232
|
-
const [state, setState] =
|
|
1233
|
-
const [error, setError] =
|
|
1234
|
-
const [acknowledgmentRequired, setAcknowledgmentRequired] =
|
|
1235
|
-
const [viewerCapReached, setViewerCapReached] =
|
|
1236
|
-
const [viewerId, setViewerId] =
|
|
1237
|
-
const [stateIdentity, setStateIdentity] =
|
|
1238
|
-
const [nonce, setNonce] =
|
|
1212
|
+
const [capabilities, setCapabilities] = useState2(null);
|
|
1213
|
+
const [state, setState] = useState2("idle");
|
|
1214
|
+
const [error, setError] = useState2(null);
|
|
1215
|
+
const [acknowledgmentRequired, setAcknowledgmentRequired] = useState2(null);
|
|
1216
|
+
const [viewerCapReached, setViewerCapReached] = useState2(false);
|
|
1217
|
+
const [viewerId, setViewerId] = useState2(null);
|
|
1218
|
+
const [stateIdentity, setStateIdentity] = useState2(identityKey);
|
|
1219
|
+
const [nonce, setNonce] = useState2(0);
|
|
1239
1220
|
const epochRef = useRef3(0);
|
|
1240
1221
|
const viewerIdRef = useRef3(null);
|
|
1241
1222
|
const previousIdentityRef = useRef3(identityKey);
|
|
1242
|
-
const renegotiate =
|
|
1223
|
+
const renegotiate = useCallback9(() => {
|
|
1243
1224
|
setNonce((n) => n + 1);
|
|
1244
1225
|
}, []);
|
|
1245
1226
|
useEffect4(() => {
|
|
@@ -1514,7 +1495,7 @@ import {
|
|
|
1514
1495
|
ttydResizeFrame,
|
|
1515
1496
|
TtydServerCommand
|
|
1516
1497
|
} from "@opengeni/sdk";
|
|
1517
|
-
import { useCallback as
|
|
1498
|
+
import { useCallback as useCallback10, useEffect as useEffect5, useMemo as useMemo4, useRef as useRef4, useState as useState3 } from "react";
|
|
1518
1499
|
var MAX_PENDING_TERMINAL_INPUT_CODE_UNITS = 64 * 1024;
|
|
1519
1500
|
var TERMINAL_CONNECT_EXPIRY_SKEW_MS = 5e3;
|
|
1520
1501
|
var TERMINAL_RECONNECT_INITIAL_MS = 100;
|
|
@@ -1580,8 +1561,8 @@ function closeSocket(socket) {
|
|
|
1580
1561
|
}
|
|
1581
1562
|
function useTerminalStream(options) {
|
|
1582
1563
|
const { capability, onOutput, onTitle, onReconnectNeeded, initialCols, initialRows } = options;
|
|
1583
|
-
const [status, setStatus] =
|
|
1584
|
-
const [reconnectGeneration, setReconnectGeneration] =
|
|
1564
|
+
const [status, setStatus] = useState3("closed");
|
|
1565
|
+
const [reconnectGeneration, setReconnectGeneration] = useState3(0);
|
|
1585
1566
|
const wsRef = useRef4(null);
|
|
1586
1567
|
const pendingInputRef = useRef4("");
|
|
1587
1568
|
const socketFailedRef = useRef4(false);
|
|
@@ -1827,7 +1808,7 @@ function useTerminalStream(options) {
|
|
|
1827
1808
|
closeSocket(socket);
|
|
1828
1809
|
};
|
|
1829
1810
|
}, [transport, url, token, expiresAt, reconnectGeneration]);
|
|
1830
|
-
const write =
|
|
1811
|
+
const write = useCallback10((data) => {
|
|
1831
1812
|
const currentTransport = transportRef.current;
|
|
1832
1813
|
const ws = wsRef.current;
|
|
1833
1814
|
if (ws && ws.readyState === WebSocket.OPEN && socketAuthenticatedRef.current) {
|
|
@@ -1855,7 +1836,7 @@ function useTerminalStream(options) {
|
|
|
1855
1836
|
pendingInputRef.current += data;
|
|
1856
1837
|
}
|
|
1857
1838
|
}, []);
|
|
1858
|
-
const resize =
|
|
1839
|
+
const resize = useCallback10((cols, rows) => {
|
|
1859
1840
|
if (cols <= 0 || rows <= 0) return;
|
|
1860
1841
|
sizeRef.current = { cols, rows };
|
|
1861
1842
|
const ws = wsRef.current;
|
|
@@ -1866,7 +1847,7 @@ function useTerminalStream(options) {
|
|
|
1866
1847
|
}
|
|
1867
1848
|
}
|
|
1868
1849
|
}, []);
|
|
1869
|
-
const disconnect =
|
|
1850
|
+
const disconnect = useCallback10(() => {
|
|
1870
1851
|
const ws = wsRef.current;
|
|
1871
1852
|
wsRef.current = null;
|
|
1872
1853
|
pendingInputRef.current = "";
|
|
@@ -1884,7 +1865,7 @@ function useTerminalStream(options) {
|
|
|
1884
1865
|
|
|
1885
1866
|
// src/hooks/use-sandbox-terminal.ts
|
|
1886
1867
|
import { OpenGeniApiError as OpenGeniApiError2 } from "@opengeni/sdk";
|
|
1887
|
-
import { useCallback as
|
|
1868
|
+
import { useCallback as useCallback11, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef5, useState as useState4 } from "react";
|
|
1888
1869
|
function useSandboxTerminal(sessionId, options) {
|
|
1889
1870
|
const { client, workspaceId } = useOpenGeni(options);
|
|
1890
1871
|
const includeAgentFirehose = options.includeAgentFirehose ?? true;
|
|
@@ -1892,10 +1873,10 @@ function useSandboxTerminal(sessionId, options) {
|
|
|
1892
1873
|
const ptyFilter = options.ptyId;
|
|
1893
1874
|
const liveness = options.liveness;
|
|
1894
1875
|
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${interactive}\0${ptyFilter ?? ""}`;
|
|
1895
|
-
const [openedPtyId, setOpenedPtyId] =
|
|
1896
|
-
const [openError, setOpenError] =
|
|
1897
|
-
const [stateIdentity, setStateIdentity] =
|
|
1898
|
-
const [reopenNonce, setReopenNonce] =
|
|
1876
|
+
const [openedPtyId, setOpenedPtyId] = useState4(null);
|
|
1877
|
+
const [openError, setOpenError] = useState4(null);
|
|
1878
|
+
const [stateIdentity, setStateIdentity] = useState4(identityKey);
|
|
1879
|
+
const [reopenNonce, setReopenNonce] = useState4(0);
|
|
1899
1880
|
const currentIdentityRef = useRef5(identityKey);
|
|
1900
1881
|
currentIdentityRef.current = identityKey;
|
|
1901
1882
|
useEffect6(() => {
|
|
@@ -2000,7 +1981,7 @@ function useSandboxTerminal(sessionId, options) {
|
|
|
2000
1981
|
});
|
|
2001
1982
|
};
|
|
2002
1983
|
}, [client, workspaceId, sessionId, activePtyId, canWrite, openedPtyId, identityKey]);
|
|
2003
|
-
const close =
|
|
1984
|
+
const close = useCallback11(() => {
|
|
2004
1985
|
if (!activePtyId || !sessionId) return;
|
|
2005
1986
|
void client.terminalPtyClose(workspaceId, sessionId, { ptyId: activePtyId }).catch(() => {
|
|
2006
1987
|
});
|
|
@@ -2016,7 +1997,7 @@ function useSandboxTerminal(sessionId, options) {
|
|
|
2016
1997
|
}
|
|
2017
1998
|
|
|
2018
1999
|
// src/hooks/use-sandbox-files.ts
|
|
2019
|
-
import { useCallback as
|
|
2000
|
+
import { useCallback as useCallback12, useEffect as useEffect7, useMemo as useMemo6, useRef as useRef6, useState as useState5 } from "react";
|
|
2020
2001
|
var CapturedFileUnavailableError = class extends Error {
|
|
2021
2002
|
constructor(path, reason) {
|
|
2022
2003
|
super(
|
|
@@ -2271,16 +2252,16 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2271
2252
|
acceptsEventReadsRef.current = acceptsEventReads;
|
|
2272
2253
|
const hasLiveIoFence = options.liveness !== void 0;
|
|
2273
2254
|
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${rootPath}\0${repoPathsKey}\0${routeEpoch ?? ""}\0${routeRoot ?? ""}`;
|
|
2274
|
-
const [tree, setTree] =
|
|
2255
|
+
const [tree, setTree] = useState5([]);
|
|
2275
2256
|
const treeRef = useRef6([]);
|
|
2276
|
-
const [loading, setLoading] =
|
|
2277
|
-
const [expandingPaths, setExpandingPaths] =
|
|
2278
|
-
const [error, setError] =
|
|
2279
|
-
const [gitSummary, setGitSummary] =
|
|
2280
|
-
const [gitLoading, setGitLoading] =
|
|
2281
|
-
const [contentRevision, setContentRevision] =
|
|
2282
|
-
const [stateIdentity, setStateIdentity] =
|
|
2283
|
-
const [source, setSource] =
|
|
2257
|
+
const [loading, setLoading] = useState5(false);
|
|
2258
|
+
const [expandingPaths, setExpandingPaths] = useState5(/* @__PURE__ */ new Set());
|
|
2259
|
+
const [error, setError] = useState5(null);
|
|
2260
|
+
const [gitSummary, setGitSummary] = useState5(null);
|
|
2261
|
+
const [gitLoading, setGitLoading] = useState5(false);
|
|
2262
|
+
const [contentRevision, setContentRevision] = useState5(0);
|
|
2263
|
+
const [stateIdentity, setStateIdentity] = useState5(identityKey);
|
|
2264
|
+
const [source, setSource] = useState5(null);
|
|
2284
2265
|
const sourceRef = useRef6(null);
|
|
2285
2266
|
const statusRef = useRef6(/* @__PURE__ */ new Map());
|
|
2286
2267
|
const refreshGenerationRef = useRef6(0);
|
|
@@ -2297,7 +2278,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2297
2278
|
const ownRevisionsRef = useRef6(/* @__PURE__ */ new Set());
|
|
2298
2279
|
const onMutationError = options.onMutationError;
|
|
2299
2280
|
treeRef.current = tree;
|
|
2300
|
-
const applyStatus =
|
|
2281
|
+
const applyStatus = useCallback12((nodes) => {
|
|
2301
2282
|
const overlay = statusRef.current;
|
|
2302
2283
|
const walk = (list) => {
|
|
2303
2284
|
let changed = false;
|
|
@@ -2320,7 +2301,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2320
2301
|
};
|
|
2321
2302
|
return walk(nodes);
|
|
2322
2303
|
}, []);
|
|
2323
|
-
const refresh =
|
|
2304
|
+
const refresh = useCallback12(async () => {
|
|
2324
2305
|
if (!sessionId) return;
|
|
2325
2306
|
refreshAbortRef.current?.abort();
|
|
2326
2307
|
const refreshAbort = new AbortController();
|
|
@@ -2404,7 +2385,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2404
2385
|
if (refreshAbortRef.current === refreshAbort) refreshAbortRef.current = null;
|
|
2405
2386
|
}
|
|
2406
2387
|
}, [client, workspaceId, sessionId, rootPath, repoPaths, route, applyStatus]);
|
|
2407
|
-
const seedFromCapture =
|
|
2388
|
+
const seedFromCapture = useCallback12(
|
|
2408
2389
|
(manifest) => {
|
|
2409
2390
|
const overlay = /* @__PURE__ */ new Map();
|
|
2410
2391
|
for (const file of manifest.files) {
|
|
@@ -2432,7 +2413,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2432
2413
|
},
|
|
2433
2414
|
[applyStatus]
|
|
2434
2415
|
);
|
|
2435
|
-
const expand =
|
|
2416
|
+
const expand = useCallback12(
|
|
2436
2417
|
async (path) => {
|
|
2437
2418
|
if (!sessionId) return;
|
|
2438
2419
|
if (source === "capture" && capture) return;
|
|
@@ -2469,7 +2450,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2469
2450
|
},
|
|
2470
2451
|
[client, workspaceId, sessionId, capture, source, route, applyStatus]
|
|
2471
2452
|
);
|
|
2472
|
-
const readFile =
|
|
2453
|
+
const readFile = useCallback12(
|
|
2473
2454
|
async (path, requestOptions = {}) => {
|
|
2474
2455
|
if (!sessionId) throw new Error("no session");
|
|
2475
2456
|
const identitySignal = identityAbortRef.current.signal;
|
|
@@ -2549,7 +2530,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2549
2530
|
},
|
|
2550
2531
|
[client, workspaceId, sessionId, capture, source, route]
|
|
2551
2532
|
);
|
|
2552
|
-
const reconcilePath =
|
|
2533
|
+
const reconcilePath = useCallback12(
|
|
2553
2534
|
async (path, requestSignal) => {
|
|
2554
2535
|
if (!sessionId) return;
|
|
2555
2536
|
const identityGeneration = identityGenerationRef.current;
|
|
@@ -2578,7 +2559,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2578
2559
|
},
|
|
2579
2560
|
[client, workspaceId, sessionId, rootPath, route, applyStatus]
|
|
2580
2561
|
);
|
|
2581
|
-
const reconcilePaths =
|
|
2562
|
+
const reconcilePaths = useCallback12(
|
|
2582
2563
|
async (requestedPaths, requestSignal) => {
|
|
2583
2564
|
if (!sessionId) return;
|
|
2584
2565
|
const identityGeneration = identityGenerationRef.current;
|
|
@@ -2625,7 +2606,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2625
2606
|
},
|
|
2626
2607
|
[client, workspaceId, sessionId, rootPath, route, applyStatus]
|
|
2627
2608
|
);
|
|
2628
|
-
const runOptimistic =
|
|
2609
|
+
const runOptimistic = useCallback12(
|
|
2629
2610
|
async (opName, apply, op, reconcileParents) => {
|
|
2630
2611
|
const identityGeneration = identityGenerationRef.current;
|
|
2631
2612
|
const snapshot = treeRef.current;
|
|
@@ -2655,7 +2636,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2655
2636
|
},
|
|
2656
2637
|
[applyStatus, reconcilePath, onMutationError]
|
|
2657
2638
|
);
|
|
2658
|
-
const writeFile =
|
|
2639
|
+
const writeFile = useCallback12(
|
|
2659
2640
|
async (path, content, writeOptions = {}) => {
|
|
2660
2641
|
if (!sessionId) throw new Error("no session");
|
|
2661
2642
|
const identityGeneration = identityGenerationRef.current;
|
|
@@ -2702,7 +2683,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2702
2683
|
},
|
|
2703
2684
|
[client, workspaceId, sessionId, tree, rootPath, route, runOptimistic]
|
|
2704
2685
|
);
|
|
2705
|
-
const createFile =
|
|
2686
|
+
const createFile = useCallback12(
|
|
2706
2687
|
async (path) => {
|
|
2707
2688
|
if (!sessionId) throw new Error("no session");
|
|
2708
2689
|
const parent = parentWithinTree(path, rootPath);
|
|
@@ -2726,7 +2707,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2726
2707
|
},
|
|
2727
2708
|
[client, workspaceId, sessionId, rootPath, route, runOptimistic]
|
|
2728
2709
|
);
|
|
2729
|
-
const createDir =
|
|
2710
|
+
const createDir = useCallback12(
|
|
2730
2711
|
async (path) => {
|
|
2731
2712
|
if (!sessionId) throw new Error("no session");
|
|
2732
2713
|
const parent = parentWithinTree(path, rootPath);
|
|
@@ -2749,7 +2730,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2749
2730
|
},
|
|
2750
2731
|
[client, workspaceId, sessionId, rootPath, route, runOptimistic]
|
|
2751
2732
|
);
|
|
2752
|
-
const deleteEntry =
|
|
2733
|
+
const deleteEntry = useCallback12(
|
|
2753
2734
|
async (path, recursive = false) => {
|
|
2754
2735
|
if (!sessionId) throw new Error("no session");
|
|
2755
2736
|
await runOptimistic(
|
|
@@ -2765,7 +2746,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2765
2746
|
},
|
|
2766
2747
|
[client, workspaceId, sessionId, rootPath, route, runOptimistic]
|
|
2767
2748
|
);
|
|
2768
|
-
const moveEntry =
|
|
2749
|
+
const moveEntry = useCallback12(
|
|
2769
2750
|
async (path, newPath, opts) => {
|
|
2770
2751
|
if (!sessionId) throw new Error("no session");
|
|
2771
2752
|
const from = parentWithinTree(path, rootPath);
|
|
@@ -2862,7 +2843,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2862
2843
|
refresh,
|
|
2863
2844
|
seedFromCapture
|
|
2864
2845
|
]);
|
|
2865
|
-
const refreshGitOverlay =
|
|
2846
|
+
const refreshGitOverlay = useCallback12(
|
|
2866
2847
|
async (requestSignal) => {
|
|
2867
2848
|
if (!sessionId) return;
|
|
2868
2849
|
const identityGeneration = identityGenerationRef.current;
|
|
@@ -2899,7 +2880,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2899
2880
|
},
|
|
2900
2881
|
[client, workspaceId, sessionId, repoPaths, rootPath, applyStatus]
|
|
2901
2882
|
);
|
|
2902
|
-
const performEventReconcile =
|
|
2883
|
+
const performEventReconcile = useCallback12(async () => {
|
|
2903
2884
|
const parents = pendingParentsRef.current;
|
|
2904
2885
|
pendingParentsRef.current = /* @__PURE__ */ new Set();
|
|
2905
2886
|
const wantGit = pendingGitRef.current;
|
|
@@ -2911,7 +2892,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
2911
2892
|
}, [reconcilePaths, refreshGitOverlay]);
|
|
2912
2893
|
const performEventReconcileRef = useRef6(performEventReconcile);
|
|
2913
2894
|
performEventReconcileRef.current = performEventReconcile;
|
|
2914
|
-
const reconcilePendingEvents =
|
|
2895
|
+
const reconcilePendingEvents = useCallback12(async () => {
|
|
2915
2896
|
eventReconcilePendingRef.current = true;
|
|
2916
2897
|
const existing = eventReconcileInFlightRef.current;
|
|
2917
2898
|
if (existing) return await existing;
|
|
@@ -3032,7 +3013,7 @@ function useSandboxFiles(sessionId, options = {}) {
|
|
|
3032
3013
|
}
|
|
3033
3014
|
|
|
3034
3015
|
// src/hooks/use-sandbox-git.ts
|
|
3035
|
-
import { useCallback as
|
|
3016
|
+
import { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMemo7, useRef as useRef7, useState as useState6 } from "react";
|
|
3036
3017
|
function normalizeRoot2(root) {
|
|
3037
3018
|
const normalized = root.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
3038
3019
|
return normalized === "." ? "" : normalized;
|
|
@@ -3108,17 +3089,17 @@ function useSandboxGit(sessionId, options = {}) {
|
|
|
3108
3089
|
acceptsEventReadsRef.current = acceptsEventReads;
|
|
3109
3090
|
const hasLiveIoFence = options.liveness !== void 0;
|
|
3110
3091
|
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${repoPathsKey}\0${workspaceWide}\0${comparison}`;
|
|
3111
|
-
const [diff, setDiff] =
|
|
3112
|
-
const [branch, setBranch] =
|
|
3113
|
-
const [isRepo, setIsRepo] =
|
|
3114
|
-
const [ahead, setAhead] =
|
|
3115
|
-
const [behind, setBehind] =
|
|
3116
|
-
const [repoRoots, setRepoRoots] =
|
|
3117
|
-
const [source, setSource] =
|
|
3092
|
+
const [diff, setDiff] = useState6([]);
|
|
3093
|
+
const [branch, setBranch] = useState6(null);
|
|
3094
|
+
const [isRepo, setIsRepo] = useState6(false);
|
|
3095
|
+
const [ahead, setAhead] = useState6(0);
|
|
3096
|
+
const [behind, setBehind] = useState6(0);
|
|
3097
|
+
const [repoRoots, setRepoRoots] = useState6([]);
|
|
3098
|
+
const [source, setSource] = useState6(null);
|
|
3118
3099
|
const sourceRef = useRef7(null);
|
|
3119
|
-
const [loading, setLoading] =
|
|
3120
|
-
const [error, setError] =
|
|
3121
|
-
const [stateIdentity, setStateIdentity] =
|
|
3100
|
+
const [loading, setLoading] = useState6(false);
|
|
3101
|
+
const [error, setError] = useState6(null);
|
|
3102
|
+
const [stateIdentity, setStateIdentity] = useState6(identityKey);
|
|
3122
3103
|
const refreshGenerationRef = useRef7(0);
|
|
3123
3104
|
const refreshAbortRef = useRef7(null);
|
|
3124
3105
|
const refreshInFlightRef = useRef7(null);
|
|
@@ -3126,7 +3107,7 @@ function useSandboxGit(sessionId, options = {}) {
|
|
|
3126
3107
|
const refreshWorkerEpochRef = useRef7(0);
|
|
3127
3108
|
const lastChangeRef = useRef7(0);
|
|
3128
3109
|
const eventRefreshTimerRef = useRef7(null);
|
|
3129
|
-
const performRefresh =
|
|
3110
|
+
const performRefresh = useCallback13(async () => {
|
|
3130
3111
|
if (!sessionId) return;
|
|
3131
3112
|
const refreshAbort = new AbortController();
|
|
3132
3113
|
refreshAbortRef.current = refreshAbort;
|
|
@@ -3240,7 +3221,7 @@ function useSandboxGit(sessionId, options = {}) {
|
|
|
3240
3221
|
]);
|
|
3241
3222
|
const performRefreshRef = useRef7(performRefresh);
|
|
3242
3223
|
performRefreshRef.current = performRefresh;
|
|
3243
|
-
const refresh =
|
|
3224
|
+
const refresh = useCallback13(async () => {
|
|
3244
3225
|
refreshPendingRef.current = true;
|
|
3245
3226
|
const existing = refreshInFlightRef.current;
|
|
3246
3227
|
if (existing) return await existing;
|
|
@@ -3258,7 +3239,7 @@ function useSandboxGit(sessionId, options = {}) {
|
|
|
3258
3239
|
if (refreshInFlightRef.current === run) refreshInFlightRef.current = null;
|
|
3259
3240
|
}
|
|
3260
3241
|
}, []);
|
|
3261
|
-
const seedFromCapture =
|
|
3242
|
+
const seedFromCapture = useCallback13(
|
|
3262
3243
|
(manifest) => {
|
|
3263
3244
|
const repositories = workspaceWide ? manifest.repos : [repoForPath(manifest, repoPath)].filter(Boolean);
|
|
3264
3245
|
if (comparison === "branch" && repositories.some((repo) => repo.branchDiff === void 0)) {
|
|
@@ -3417,7 +3398,7 @@ function useSandboxGit(sessionId, options = {}) {
|
|
|
3417
3398
|
}
|
|
3418
3399
|
|
|
3419
3400
|
// src/hooks/use-workspace-capture.ts
|
|
3420
|
-
import { useCallback as
|
|
3401
|
+
import { useCallback as useCallback14, useEffect as useEffect9, useRef as useRef8, useState as useState7 } from "react";
|
|
3421
3402
|
var REVISION_CAPTURED = "workspace.revision.captured";
|
|
3422
3403
|
var REVISION_DEGRADED = "workspace.revision.degraded";
|
|
3423
3404
|
var MANIFEST_FETCH_TIMEOUT_MS = 15e3;
|
|
@@ -3456,18 +3437,18 @@ function useWorkspaceCapture(sessionId, options = {}) {
|
|
|
3456
3437
|
const { client, workspaceId } = useOpenGeni(options);
|
|
3457
3438
|
const enabled = (options.enabled ?? true) && Boolean(sessionId);
|
|
3458
3439
|
const identityKey = `${workspaceId}\0${sessionId ?? ""}`;
|
|
3459
|
-
const [capture, setCapture] =
|
|
3460
|
-
const [available, setAvailable] =
|
|
3461
|
-
const [degradedReason, setDegradedReason] =
|
|
3462
|
-
const [fileCount, setFileCount] =
|
|
3463
|
-
const [loading, setLoading] =
|
|
3464
|
-
const [error, setError] =
|
|
3465
|
-
const [announcedRevision, setAnnouncedRevision] =
|
|
3466
|
-
const [stateIdentity, setStateIdentity] =
|
|
3440
|
+
const [capture, setCapture] = useState7(null);
|
|
3441
|
+
const [available, setAvailable] = useState7(false);
|
|
3442
|
+
const [degradedReason, setDegradedReason] = useState7(null);
|
|
3443
|
+
const [fileCount, setFileCount] = useState7(null);
|
|
3444
|
+
const [loading, setLoading] = useState7(false);
|
|
3445
|
+
const [error, setError] = useState7(null);
|
|
3446
|
+
const [announcedRevision, setAnnouncedRevision] = useState7(null);
|
|
3447
|
+
const [stateIdentity, setStateIdentity] = useState7(identityKey);
|
|
3467
3448
|
const generationRef = useRef8(0);
|
|
3468
3449
|
const requestAbortRef = useRef8(null);
|
|
3469
3450
|
const lastSeqRef = useRef8(0);
|
|
3470
|
-
const refresh =
|
|
3451
|
+
const refresh = useCallback14(async () => {
|
|
3471
3452
|
if (!sessionId) return;
|
|
3472
3453
|
requestAbortRef.current?.abort();
|
|
3473
3454
|
const requestAbort = new AbortController();
|
|
@@ -3612,7 +3593,7 @@ function useWorkspaceCapture(sessionId, options = {}) {
|
|
|
3612
3593
|
}
|
|
3613
3594
|
|
|
3614
3595
|
// src/hooks/use-workspace-edit.ts
|
|
3615
|
-
import { useCallback as
|
|
3596
|
+
import { useCallback as useCallback15, useEffect as useEffect10, useMemo as useMemo8, useRef as useRef9, useState as useState8 } from "react";
|
|
3616
3597
|
function isLive(liveness) {
|
|
3617
3598
|
return sandboxAcceptsLiveIo(liveness);
|
|
3618
3599
|
}
|
|
@@ -3629,12 +3610,12 @@ function useWorkspaceEdit(sessionId, options = {}) {
|
|
|
3629
3610
|
const live = isLive(options.liveness);
|
|
3630
3611
|
const offline = options.offline === true;
|
|
3631
3612
|
const identityKey = `${workspaceId}\0${sessionId ?? ""}\0${path ?? ""}\0${routeEpoch ?? ""}\0${routeRoot ?? ""}`;
|
|
3632
|
-
const [buffer, setBuffer] =
|
|
3633
|
-
const [wantsWarm, setWantsWarm] =
|
|
3634
|
-
const [flush, setFlush] =
|
|
3635
|
-
const [conflict, setConflict] =
|
|
3636
|
-
const [error, setError] =
|
|
3637
|
-
const [stateIdentity, setStateIdentity] =
|
|
3613
|
+
const [buffer, setBuffer] = useState8(null);
|
|
3614
|
+
const [wantsWarm, setWantsWarm] = useState8(false);
|
|
3615
|
+
const [flush, setFlush] = useState8("idle");
|
|
3616
|
+
const [conflict, setConflict] = useState8(null);
|
|
3617
|
+
const [error, setError] = useState8(null);
|
|
3618
|
+
const [stateIdentity, setStateIdentity] = useState8(identityKey);
|
|
3638
3619
|
const onWarmRequested = options.onWarmRequested;
|
|
3639
3620
|
const bufferRef = useRef9(null);
|
|
3640
3621
|
bufferRef.current = buffer;
|
|
@@ -3661,7 +3642,7 @@ function useWorkspaceEdit(sessionId, options = {}) {
|
|
|
3661
3642
|
readAbortRef.current = null;
|
|
3662
3643
|
};
|
|
3663
3644
|
}, [identityKey]);
|
|
3664
|
-
const edit =
|
|
3645
|
+
const edit = useCallback15(
|
|
3665
3646
|
(content) => {
|
|
3666
3647
|
if (stateIdentity !== identityKey) return;
|
|
3667
3648
|
if (offline) return;
|
|
@@ -3677,7 +3658,7 @@ function useWorkspaceEdit(sessionId, options = {}) {
|
|
|
3677
3658
|
},
|
|
3678
3659
|
[offline, live, onWarmRequested, stateIdentity, identityKey]
|
|
3679
3660
|
);
|
|
3680
|
-
const doFlush =
|
|
3661
|
+
const doFlush = useCallback15(
|
|
3681
3662
|
async (force) => {
|
|
3682
3663
|
if (stateIdentity !== identityKey) return;
|
|
3683
3664
|
if (!sessionId || !path) return;
|
|
@@ -3739,10 +3720,10 @@ function useWorkspaceEdit(sessionId, options = {}) {
|
|
|
3739
3720
|
if (flush === "flushed" || flush === "conflict" || flush === "flushing") return;
|
|
3740
3721
|
void doFlush(false);
|
|
3741
3722
|
}, [offline, live, buffer, flush, doFlush]);
|
|
3742
|
-
const overwrite =
|
|
3723
|
+
const overwrite = useCallback15(async () => {
|
|
3743
3724
|
await doFlush(true);
|
|
3744
3725
|
}, [doFlush]);
|
|
3745
|
-
const discard =
|
|
3726
|
+
const discard = useCallback15(() => {
|
|
3746
3727
|
setBuffer(null);
|
|
3747
3728
|
setWantsWarm(false);
|
|
3748
3729
|
setFlush("idle");
|
|
@@ -3858,7 +3839,7 @@ function useMachineChip(input) {
|
|
|
3858
3839
|
|
|
3859
3840
|
// src/components/fleet-tile.tsx
|
|
3860
3841
|
import { deriveSessionDisplayTitle } from "@opengeni/sdk";
|
|
3861
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3842
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3862
3843
|
var SESSION_METADATA_TITLE_KEYS = ["title", "name"];
|
|
3863
3844
|
function sessionDisplayTitle(session) {
|
|
3864
3845
|
return deriveSessionDisplayTitle(session, { metadataKeys: SESSION_METADATA_TITLE_KEYS });
|
|
@@ -3866,7 +3847,7 @@ function sessionDisplayTitle(session) {
|
|
|
3866
3847
|
function FleetTile({ session, title, subtitle, onOpen, className }) {
|
|
3867
3848
|
const running = session.status === "running" || session.status === "queued";
|
|
3868
3849
|
const needsYou = session.status === "requires_action";
|
|
3869
|
-
return /* @__PURE__ */
|
|
3850
|
+
return /* @__PURE__ */ jsxs2(
|
|
3870
3851
|
"button",
|
|
3871
3852
|
{
|
|
3872
3853
|
type: "button",
|
|
@@ -3882,7 +3863,7 @@ function FleetTile({ session, title, subtitle, onOpen, className }) {
|
|
|
3882
3863
|
className
|
|
3883
3864
|
),
|
|
3884
3865
|
children: [
|
|
3885
|
-
/* @__PURE__ */
|
|
3866
|
+
/* @__PURE__ */ jsx2(
|
|
3886
3867
|
"span",
|
|
3887
3868
|
{
|
|
3888
3869
|
"aria-hidden": true,
|
|
@@ -3892,16 +3873,16 @@ function FleetTile({ session, title, subtitle, onOpen, className }) {
|
|
|
3892
3873
|
)
|
|
3893
3874
|
}
|
|
3894
3875
|
),
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3876
|
+
/* @__PURE__ */ jsxs2("span", { className: "flex w-full items-start justify-between gap-3", children: [
|
|
3877
|
+
/* @__PURE__ */ jsx2("span", { className: "line-clamp-2 min-w-0 text-og-base font-medium leading-snug text-og-fg", children: title ?? sessionDisplayTitle(session) }),
|
|
3878
|
+
/* @__PURE__ */ jsx2(SessionStatus, { status: session.status, size: "sm", className: "mt-px" })
|
|
3898
3879
|
] }),
|
|
3899
|
-
subtitle ? /* @__PURE__ */
|
|
3900
|
-
/* @__PURE__ */
|
|
3901
|
-
/* @__PURE__ */
|
|
3902
|
-
/* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
/* @__PURE__ */
|
|
3880
|
+
subtitle ? /* @__PURE__ */ jsx2("span", { className: "line-clamp-1 text-og-sm text-og-fg-muted", children: subtitle }) : null,
|
|
3881
|
+
/* @__PURE__ */ jsxs2("span", { className: "mt-auto flex w-full items-center gap-2 text-og-xs text-og-fg-subtle", children: [
|
|
3882
|
+
/* @__PURE__ */ jsx2("span", { className: "font-og-mono", children: session.id.slice(0, 8) }),
|
|
3883
|
+
/* @__PURE__ */ jsx2("span", { "aria-hidden": true, children: "\xB7" }),
|
|
3884
|
+
/* @__PURE__ */ jsx2("span", { className: "truncate", children: session.model }),
|
|
3885
|
+
/* @__PURE__ */ jsx2("span", { className: "ml-auto shrink-0", title: session.updatedAt, children: formatRelativeTime(session.updatedAt) })
|
|
3905
3886
|
] })
|
|
3906
3887
|
]
|
|
3907
3888
|
}
|
|
@@ -3909,7 +3890,7 @@ function FleetTile({ session, title, subtitle, onOpen, className }) {
|
|
|
3909
3890
|
}
|
|
3910
3891
|
|
|
3911
3892
|
// src/components/sandbox-terminal.tsx
|
|
3912
|
-
import { useEffect as useEffect11, useLayoutEffect, useRef as useRef10, useState as
|
|
3893
|
+
import { useEffect as useEffect11, useLayoutEffect, useRef as useRef10, useState as useState9 } from "react";
|
|
3913
3894
|
|
|
3914
3895
|
// src/lib/xterm-theme.ts
|
|
3915
3896
|
var DARK_ANSI = {
|
|
@@ -4062,7 +4043,7 @@ async function attachRenderer(prefer, loaders, onTier) {
|
|
|
4062
4043
|
}
|
|
4063
4044
|
|
|
4064
4045
|
// src/components/sandbox-terminal.tsx
|
|
4065
|
-
import { jsx as
|
|
4046
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4066
4047
|
function terminalSurfaceState(input) {
|
|
4067
4048
|
if (!input.ready) return "loading";
|
|
4068
4049
|
if (input.acceptsInput) return "interactive";
|
|
@@ -4111,9 +4092,9 @@ function SandboxTerminal({
|
|
|
4111
4092
|
const writtenRef = useRef10(/* @__PURE__ */ new Set());
|
|
4112
4093
|
const wroteFirehoseRef = useRef10(false);
|
|
4113
4094
|
const bootActiveRef = useRef10(false);
|
|
4114
|
-
const [ready, setReady] =
|
|
4115
|
-
const [inputReady, setInputReady] =
|
|
4116
|
-
const [activated, setActivated] =
|
|
4095
|
+
const [ready, setReady] = useState9(false);
|
|
4096
|
+
const [inputReady, setInputReady] = useState9(false);
|
|
4097
|
+
const [activated, setActivated] = useState9(false);
|
|
4117
4098
|
const ptyDescriptor = terminalCapability?.transport === "pty-ws" || terminalCapability?.transport === "relay-pty";
|
|
4118
4099
|
const ptyAttachable = terminalCanAcquirePty(terminalCapability);
|
|
4119
4100
|
const {
|
|
@@ -4359,10 +4340,10 @@ function SandboxTerminal({
|
|
|
4359
4340
|
observer?.disconnect();
|
|
4360
4341
|
};
|
|
4361
4342
|
}, [ready]);
|
|
4362
|
-
return /* @__PURE__ */
|
|
4363
|
-
showHeader && /* @__PURE__ */
|
|
4364
|
-
/* @__PURE__ */
|
|
4365
|
-
/* @__PURE__ */
|
|
4343
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("relative flex h-full w-full flex-col overflow-hidden", className), children: [
|
|
4344
|
+
showHeader && /* @__PURE__ */ jsxs3("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-og-border px-2 py-1 text-og-xs text-og-fg-subtle", children: [
|
|
4345
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
4346
|
+
/* @__PURE__ */ jsx3(
|
|
4366
4347
|
"span",
|
|
4367
4348
|
{
|
|
4368
4349
|
className: cn(
|
|
@@ -4371,13 +4352,13 @@ function SandboxTerminal({
|
|
|
4371
4352
|
)
|
|
4372
4353
|
}
|
|
4373
4354
|
),
|
|
4374
|
-
/* @__PURE__ */
|
|
4355
|
+
/* @__PURE__ */ jsxs3("span", { className: "truncate font-og-mono", children: [
|
|
4375
4356
|
"pty: ",
|
|
4376
4357
|
shell ?? "shell"
|
|
4377
4358
|
] })
|
|
4378
4359
|
] }),
|
|
4379
|
-
/* @__PURE__ */
|
|
4380
|
-
terminalModeLabel && /* @__PURE__ */
|
|
4360
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex shrink-0 items-center gap-2", children: [
|
|
4361
|
+
terminalModeLabel && /* @__PURE__ */ jsx3(
|
|
4381
4362
|
"span",
|
|
4382
4363
|
{
|
|
4383
4364
|
className: "rounded-og-sm bg-og-surface-2 px-1.5 py-0.5 text-og-xs uppercase tracking-wide",
|
|
@@ -4385,7 +4366,7 @@ function SandboxTerminal({
|
|
|
4385
4366
|
children: terminalModeLabel
|
|
4386
4367
|
}
|
|
4387
4368
|
),
|
|
4388
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__PURE__ */ jsx3(
|
|
4389
4370
|
"button",
|
|
4390
4371
|
{
|
|
4391
4372
|
type: "button",
|
|
@@ -4400,15 +4381,15 @@ function SandboxTerminal({
|
|
|
4400
4381
|
)
|
|
4401
4382
|
] })
|
|
4402
4383
|
] }),
|
|
4403
|
-
/* @__PURE__ */
|
|
4384
|
+
/* @__PURE__ */ jsxs3(
|
|
4404
4385
|
"div",
|
|
4405
4386
|
{
|
|
4406
4387
|
className: "relative min-h-0 flex-1 bg-og-bg p-3",
|
|
4407
4388
|
onPointerDownCapture: handleActivate,
|
|
4408
4389
|
onFocusCapture: handleActivate,
|
|
4409
4390
|
children: [
|
|
4410
|
-
!ready && (placeholder ?? /* @__PURE__ */
|
|
4411
|
-
/* @__PURE__ */
|
|
4391
|
+
!ready && (placeholder ?? /* @__PURE__ */ jsx3(TerminalPlaceholder, {})),
|
|
4392
|
+
/* @__PURE__ */ jsx3(
|
|
4412
4393
|
"div",
|
|
4413
4394
|
{
|
|
4414
4395
|
ref: containerRef,
|
|
@@ -4468,7 +4449,7 @@ function ensureXtermBaseCss() {
|
|
|
4468
4449
|
document.head.appendChild(style);
|
|
4469
4450
|
}
|
|
4470
4451
|
function TerminalPlaceholder() {
|
|
4471
|
-
return /* @__PURE__ */
|
|
4452
|
+
return /* @__PURE__ */ jsx3("div", { className: "absolute inset-0 flex items-center justify-center text-og-sm text-og-fg-subtle", children: "Loading terminal\u2026" });
|
|
4472
4453
|
}
|
|
4473
4454
|
|
|
4474
4455
|
// src/components/file-browser.tsx
|
|
@@ -4484,13 +4465,13 @@ import {
|
|
|
4484
4465
|
Trash2Icon
|
|
4485
4466
|
} from "lucide-react";
|
|
4486
4467
|
import {
|
|
4487
|
-
useCallback as
|
|
4468
|
+
useCallback as useCallback16,
|
|
4488
4469
|
useEffect as useEffect13,
|
|
4489
4470
|
useId,
|
|
4490
4471
|
useLayoutEffect as useLayoutEffect2,
|
|
4491
4472
|
useMemo as useMemo11,
|
|
4492
4473
|
useRef as useRef11,
|
|
4493
|
-
useState as
|
|
4474
|
+
useState as useState10
|
|
4494
4475
|
} from "react";
|
|
4495
4476
|
import { AlertDialog } from "radix-ui";
|
|
4496
4477
|
import { VList } from "virtua";
|
|
@@ -4523,7 +4504,7 @@ function collectUnicodeContent(values) {
|
|
|
4523
4504
|
}
|
|
4524
4505
|
|
|
4525
4506
|
// src/components/file-browser.tsx
|
|
4526
|
-
import { Fragment, jsx as
|
|
4507
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
4527
4508
|
var STATUS_TINT = {
|
|
4528
4509
|
added: "text-og-status-idle",
|
|
4529
4510
|
modified: "text-og-status-running",
|
|
@@ -4601,17 +4582,17 @@ function FileBrowser({
|
|
|
4601
4582
|
confirmDelete,
|
|
4602
4583
|
className
|
|
4603
4584
|
}) {
|
|
4604
|
-
const [expanded, setExpanded] =
|
|
4605
|
-
const [loadingPaths, setLoadingPaths] =
|
|
4606
|
-
const [active, setActive] =
|
|
4607
|
-
const [draftCreate, setDraftCreate] =
|
|
4608
|
-
const [draftRename, setDraftRename] =
|
|
4609
|
-
const [dragOver, setDragOver] =
|
|
4610
|
-
const [menu, setMenu] =
|
|
4611
|
-
const [pendingDelete, setPendingDelete] =
|
|
4612
|
-
const [busy, setBusy] =
|
|
4613
|
-
const [coarsePointer, setCoarsePointer] =
|
|
4614
|
-
const [revealRequest, setRevealRequest] =
|
|
4585
|
+
const [expanded, setExpanded] = useState10(/* @__PURE__ */ new Set());
|
|
4586
|
+
const [loadingPaths, setLoadingPaths] = useState10(/* @__PURE__ */ new Set());
|
|
4587
|
+
const [active, setActive] = useState10(null);
|
|
4588
|
+
const [draftCreate, setDraftCreate] = useState10(null);
|
|
4589
|
+
const [draftRename, setDraftRename] = useState10(null);
|
|
4590
|
+
const [dragOver, setDragOver] = useState10(null);
|
|
4591
|
+
const [menu, setMenu] = useState10(null);
|
|
4592
|
+
const [pendingDelete, setPendingDelete] = useState10(null);
|
|
4593
|
+
const [busy, setBusy] = useState10(false);
|
|
4594
|
+
const [coarsePointer, setCoarsePointer] = useState10(false);
|
|
4595
|
+
const [revealRequest, setRevealRequest] = useState10(null);
|
|
4615
4596
|
const handledRevealRequestRef = useRef11(null);
|
|
4616
4597
|
const attemptedRevealPathsRef = useRef11(/* @__PURE__ */ new Set());
|
|
4617
4598
|
const treeId = useId();
|
|
@@ -4620,7 +4601,7 @@ function FileBrowser({
|
|
|
4620
4601
|
const deleteReturnFocusRef = useRef11(null);
|
|
4621
4602
|
const vlistRef = useRef11(null);
|
|
4622
4603
|
const portalTokenStyle = usePortalTokenStyle(container.source);
|
|
4623
|
-
const getTreeElement =
|
|
4604
|
+
const getTreeElement = useCallback16(
|
|
4624
4605
|
() => typeof document === "undefined" ? null : document.getElementById(treeId),
|
|
4625
4606
|
[treeId]
|
|
4626
4607
|
);
|
|
@@ -4663,7 +4644,7 @@ function FileBrowser({
|
|
|
4663
4644
|
useEffect13(() => {
|
|
4664
4645
|
if (active !== null && visibleActive === null) setActive(null);
|
|
4665
4646
|
}, [active, visibleActive]);
|
|
4666
|
-
const expand =
|
|
4647
|
+
const expand = useCallback16(
|
|
4667
4648
|
async (path) => {
|
|
4668
4649
|
const node = findNode(visibleTree, path);
|
|
4669
4650
|
if (node && node.kind === "dir" && node.children === void 0) {
|
|
@@ -4681,7 +4662,7 @@ function FileBrowser({
|
|
|
4681
4662
|
},
|
|
4682
4663
|
[result, visibleTree]
|
|
4683
4664
|
);
|
|
4684
|
-
const open =
|
|
4665
|
+
const open = useCallback16(
|
|
4685
4666
|
(path) => {
|
|
4686
4667
|
setExpanded((prev) => new Set(prev).add(path));
|
|
4687
4668
|
void expand(path);
|
|
@@ -4710,7 +4691,7 @@ function FileBrowser({
|
|
|
4710
4691
|
attemptedRevealPathsRef.current.add(frontier);
|
|
4711
4692
|
void expand(frontier);
|
|
4712
4693
|
}, [expand, loadingPaths, result.expandingPaths, revealRequest, visibleTree]);
|
|
4713
|
-
const toggle =
|
|
4694
|
+
const toggle = useCallback16(
|
|
4714
4695
|
async (node) => {
|
|
4715
4696
|
if (node.kind !== "dir") return;
|
|
4716
4697
|
const isOpen = expanded.has(node.path);
|
|
@@ -4785,7 +4766,7 @@ function FileBrowser({
|
|
|
4785
4766
|
const cursorIndex = cursor ? rowIndexByPath.get(cursor) ?? -1 : -1;
|
|
4786
4767
|
const activeDescendantId = cursorIndex >= 0 ? `${treeId}-item-${cursorIndex}` : void 0;
|
|
4787
4768
|
const supportsMutation = editable && result.source === "live" && result.error === null && !result.loading;
|
|
4788
|
-
const performDelete =
|
|
4769
|
+
const performDelete = useCallback16(
|
|
4789
4770
|
async (node) => {
|
|
4790
4771
|
if (!supportsMutation) return;
|
|
4791
4772
|
const recursive = node.kind === "dir";
|
|
@@ -4799,7 +4780,7 @@ function FileBrowser({
|
|
|
4799
4780
|
},
|
|
4800
4781
|
[supportsMutation, result]
|
|
4801
4782
|
);
|
|
4802
|
-
const runDelete =
|
|
4783
|
+
const runDelete = useCallback16(
|
|
4803
4784
|
async (node, returnFocus) => {
|
|
4804
4785
|
if (!supportsMutation) return;
|
|
4805
4786
|
setMenu(null);
|
|
@@ -4812,7 +4793,7 @@ function FileBrowser({
|
|
|
4812
4793
|
},
|
|
4813
4794
|
[supportsMutation, confirmDelete, performDelete]
|
|
4814
4795
|
);
|
|
4815
|
-
const closePendingDelete =
|
|
4796
|
+
const closePendingDelete = useCallback16(
|
|
4816
4797
|
(restoreTrigger) => {
|
|
4817
4798
|
const returnTarget = restoreTrigger ? deleteReturnFocusRef.current : getTreeElement();
|
|
4818
4799
|
deleteReturnFocusRef.current = null;
|
|
@@ -4826,7 +4807,7 @@ function FileBrowser({
|
|
|
4826
4807
|
},
|
|
4827
4808
|
[getTreeElement]
|
|
4828
4809
|
);
|
|
4829
|
-
const commitCreate =
|
|
4810
|
+
const commitCreate = useCallback16(
|
|
4830
4811
|
async (name) => {
|
|
4831
4812
|
const draft = draftCreate;
|
|
4832
4813
|
setDraftCreate(null);
|
|
@@ -4851,7 +4832,7 @@ function FileBrowser({
|
|
|
4851
4832
|
},
|
|
4852
4833
|
[draftCreate, supportsMutation, result, open, onSelectFile]
|
|
4853
4834
|
);
|
|
4854
|
-
const commitRename =
|
|
4835
|
+
const commitRename = useCallback16(
|
|
4855
4836
|
async (name) => {
|
|
4856
4837
|
const draft = draftRename;
|
|
4857
4838
|
setDraftRename(null);
|
|
@@ -4874,7 +4855,7 @@ function FileBrowser({
|
|
|
4874
4855
|
},
|
|
4875
4856
|
[draftRename, supportsMutation, result, selectedPath, active, onSelectFile, visibleTree]
|
|
4876
4857
|
);
|
|
4877
|
-
const startCreate =
|
|
4858
|
+
const startCreate = useCallback16(
|
|
4878
4859
|
(kind) => {
|
|
4879
4860
|
if (!supportsMutation) return;
|
|
4880
4861
|
const anchor = cursor ? findNode(visibleTree, cursor) : void 0;
|
|
@@ -4886,7 +4867,7 @@ function FileBrowser({
|
|
|
4886
4867
|
},
|
|
4887
4868
|
[supportsMutation, cursor, open, visibleTree]
|
|
4888
4869
|
);
|
|
4889
|
-
const startRename =
|
|
4870
|
+
const startRename = useCallback16(
|
|
4890
4871
|
(node) => {
|
|
4891
4872
|
if (!supportsMutation) return;
|
|
4892
4873
|
setDraftCreate(null);
|
|
@@ -4895,7 +4876,7 @@ function FileBrowser({
|
|
|
4895
4876
|
},
|
|
4896
4877
|
[supportsMutation]
|
|
4897
4878
|
);
|
|
4898
|
-
const onDropOnto =
|
|
4879
|
+
const onDropOnto = useCallback16(
|
|
4899
4880
|
async (targetDir, sourcePath) => {
|
|
4900
4881
|
setDragOver(null);
|
|
4901
4882
|
if (!supportsMutation || !sourcePath) return;
|
|
@@ -4919,7 +4900,7 @@ function FileBrowser({
|
|
|
4919
4900
|
},
|
|
4920
4901
|
[supportsMutation, result, selectedPath, active, onSelectFile, visibleTree]
|
|
4921
4902
|
);
|
|
4922
|
-
const onKeyDown =
|
|
4903
|
+
const onKeyDown = useCallback16(
|
|
4923
4904
|
(e) => {
|
|
4924
4905
|
if (draftCreate || draftRename) return;
|
|
4925
4906
|
if (flatRows.length === 0) return;
|
|
@@ -5058,7 +5039,7 @@ function FileBrowser({
|
|
|
5058
5039
|
const renderNodeRow = (node, depth) => {
|
|
5059
5040
|
const isOpen = expanded.has(node.path);
|
|
5060
5041
|
if (renderNode) {
|
|
5061
|
-
return /* @__PURE__ */
|
|
5042
|
+
return /* @__PURE__ */ jsx4("div", { children: renderNode(node, depth, isOpen) });
|
|
5062
5043
|
}
|
|
5063
5044
|
const isDir = node.kind === "dir";
|
|
5064
5045
|
const isSelected = node.path === selectedPath || node.path === active;
|
|
@@ -5068,7 +5049,7 @@ function FileBrowser({
|
|
|
5068
5049
|
const isDropTarget = dragOver === (isDir ? node.path : parentOf2(node.path));
|
|
5069
5050
|
const dropDir = isDir ? node.path : parentOf2(node.path);
|
|
5070
5051
|
const treePosition = treePositionByPath.get(node.path);
|
|
5071
|
-
return /* @__PURE__ */
|
|
5052
|
+
return /* @__PURE__ */ jsx4(
|
|
5072
5053
|
"div",
|
|
5073
5054
|
{
|
|
5074
5055
|
id: `${treeId}-item-${rowIndexByPath.get(node.path) ?? 0}`,
|
|
@@ -5094,7 +5075,7 @@ function FileBrowser({
|
|
|
5094
5075
|
const src = e.dataTransfer.getData("text/og-path");
|
|
5095
5076
|
void onDropOnto(dropDir, src);
|
|
5096
5077
|
} : void 0,
|
|
5097
|
-
children: isRenaming ? /* @__PURE__ */
|
|
5078
|
+
children: isRenaming ? /* @__PURE__ */ jsx4(
|
|
5098
5079
|
InlineInput,
|
|
5099
5080
|
{
|
|
5100
5081
|
depth,
|
|
@@ -5103,7 +5084,7 @@ function FileBrowser({
|
|
|
5103
5084
|
onCommit: (name) => void commitRename(name),
|
|
5104
5085
|
onCancel: () => setDraftRename(null)
|
|
5105
5086
|
}
|
|
5106
|
-
) : /* @__PURE__ */
|
|
5087
|
+
) : /* @__PURE__ */ jsxs4(
|
|
5107
5088
|
"button",
|
|
5108
5089
|
{
|
|
5109
5090
|
type: "button",
|
|
@@ -5137,7 +5118,7 @@ function FileBrowser({
|
|
|
5137
5118
|
),
|
|
5138
5119
|
style: { paddingLeft: `${depth * 12 + 4}px` },
|
|
5139
5120
|
children: [
|
|
5140
|
-
isDir ? /* @__PURE__ */
|
|
5121
|
+
isDir ? /* @__PURE__ */ jsx4(
|
|
5141
5122
|
ChevronRightIcon,
|
|
5142
5123
|
{
|
|
5143
5124
|
className: cn(
|
|
@@ -5146,10 +5127,10 @@ function FileBrowser({
|
|
|
5146
5127
|
isLoading && "text-og-accent"
|
|
5147
5128
|
)
|
|
5148
5129
|
}
|
|
5149
|
-
) : /* @__PURE__ */
|
|
5150
|
-
isDir ? /* @__PURE__ */
|
|
5151
|
-
/* @__PURE__ */
|
|
5152
|
-
supportsMutation && /* @__PURE__ */
|
|
5130
|
+
) : /* @__PURE__ */ jsx4("span", { className: "inline-block w-3 shrink-0" }),
|
|
5131
|
+
isDir ? /* @__PURE__ */ jsx4(FolderIcon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx4(FileIcon, { className: "size-3.5 shrink-0" }),
|
|
5132
|
+
/* @__PURE__ */ jsx4("span", { className: "truncate", children: node.name }),
|
|
5133
|
+
supportsMutation && /* @__PURE__ */ jsx4(
|
|
5153
5134
|
"span",
|
|
5154
5135
|
{
|
|
5155
5136
|
role: "button",
|
|
@@ -5177,7 +5158,7 @@ function FileBrowser({
|
|
|
5177
5158
|
case "node":
|
|
5178
5159
|
return renderNodeRow(item.node, item.depth);
|
|
5179
5160
|
case "create":
|
|
5180
|
-
return /* @__PURE__ */
|
|
5161
|
+
return /* @__PURE__ */ jsx4(
|
|
5181
5162
|
InlineInput,
|
|
5182
5163
|
{
|
|
5183
5164
|
depth: item.depth,
|
|
@@ -5188,14 +5169,14 @@ function FileBrowser({
|
|
|
5188
5169
|
}
|
|
5189
5170
|
);
|
|
5190
5171
|
case "skeleton":
|
|
5191
|
-
return /* @__PURE__ */
|
|
5172
|
+
return /* @__PURE__ */ jsx4(
|
|
5192
5173
|
"div",
|
|
5193
5174
|
{
|
|
5194
5175
|
role: "group",
|
|
5195
5176
|
"aria-hidden": true,
|
|
5196
5177
|
style: { paddingLeft: `${item.depth * 12 + 4}px` },
|
|
5197
5178
|
className: "space-y-1 py-1",
|
|
5198
|
-
children: [0, 1, 2].map((i) => /* @__PURE__ */
|
|
5179
|
+
children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx4(
|
|
5199
5180
|
"div",
|
|
5200
5181
|
{
|
|
5201
5182
|
className: "h-2.5 animate-pulse rounded-og-sm bg-og-surface-2",
|
|
@@ -5206,14 +5187,14 @@ function FileBrowser({
|
|
|
5206
5187
|
}
|
|
5207
5188
|
);
|
|
5208
5189
|
case "residue":
|
|
5209
|
-
return /* @__PURE__ */
|
|
5190
|
+
return /* @__PURE__ */ jsxs4(
|
|
5210
5191
|
"div",
|
|
5211
5192
|
{
|
|
5212
5193
|
style: { paddingLeft: `${item.depth * 12 + 4}px` },
|
|
5213
5194
|
className: "flex items-center gap-1.5 py-0.5 pr-1 text-og-xs italic text-og-fg-subtle",
|
|
5214
5195
|
children: [
|
|
5215
|
-
/* @__PURE__ */
|
|
5216
|
-
/* @__PURE__ */
|
|
5196
|
+
/* @__PURE__ */ jsx4("span", { className: "inline-block w-3 shrink-0" }),
|
|
5197
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 truncate", children: "contents on machine \u2014 open when live" })
|
|
5217
5198
|
]
|
|
5218
5199
|
}
|
|
5219
5200
|
);
|
|
@@ -5239,18 +5220,18 @@ function FileBrowser({
|
|
|
5239
5220
|
(current) => current?.path === revealRequest.path && current.requestId === revealRequest.requestId ? null : current
|
|
5240
5221
|
);
|
|
5241
5222
|
}, [renderItems, revealRequest, treeId, usesVirtualTree]);
|
|
5242
|
-
return /* @__PURE__ */
|
|
5243
|
-
showToolbar && /* @__PURE__ */
|
|
5223
|
+
return /* @__PURE__ */ jsxs4("div", { className: cn("flex min-h-0 min-w-0 flex-col", className), children: [
|
|
5224
|
+
showToolbar && /* @__PURE__ */ jsxs4(
|
|
5244
5225
|
"div",
|
|
5245
5226
|
{
|
|
5246
5227
|
role: "toolbar",
|
|
5247
5228
|
"aria-label": "File actions",
|
|
5248
5229
|
className: "flex shrink-0 flex-wrap items-center gap-0.5 border-b border-og-border px-1 py-1",
|
|
5249
5230
|
children: [
|
|
5250
|
-
supportsMutation ? /* @__PURE__ */
|
|
5251
|
-
/* @__PURE__ */
|
|
5252
|
-
/* @__PURE__ */
|
|
5253
|
-
/* @__PURE__ */
|
|
5231
|
+
supportsMutation ? /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
5232
|
+
/* @__PURE__ */ jsx4(ToolbarButton, { label: "New file", onClick: () => startCreate("file"), disabled: busy, children: /* @__PURE__ */ jsx4(FilePlusIcon, { className: "size-3.5" }) }),
|
|
5233
|
+
/* @__PURE__ */ jsx4(ToolbarButton, { label: "New folder", onClick: () => startCreate("dir"), disabled: busy, children: /* @__PURE__ */ jsx4(FolderPlusIcon, { className: "size-3.5" }) }),
|
|
5234
|
+
/* @__PURE__ */ jsx4(
|
|
5254
5235
|
ToolbarButton,
|
|
5255
5236
|
{
|
|
5256
5237
|
label: "Rename",
|
|
@@ -5259,10 +5240,10 @@ function FileBrowser({
|
|
|
5259
5240
|
if (node) startRename(node);
|
|
5260
5241
|
},
|
|
5261
5242
|
disabled: busy || !cursor,
|
|
5262
|
-
children: /* @__PURE__ */
|
|
5243
|
+
children: /* @__PURE__ */ jsx4(PencilIcon, { className: "size-3.5" })
|
|
5263
5244
|
}
|
|
5264
5245
|
),
|
|
5265
|
-
/* @__PURE__ */
|
|
5246
|
+
/* @__PURE__ */ jsx4(
|
|
5266
5247
|
ToolbarButton,
|
|
5267
5248
|
{
|
|
5268
5249
|
label: "Delete",
|
|
@@ -5271,24 +5252,24 @@ function FileBrowser({
|
|
|
5271
5252
|
if (node) void runDelete(node, event.currentTarget);
|
|
5272
5253
|
},
|
|
5273
5254
|
disabled: busy || !cursor,
|
|
5274
|
-
children: /* @__PURE__ */
|
|
5255
|
+
children: /* @__PURE__ */ jsx4(Trash2Icon, { className: "size-3.5" })
|
|
5275
5256
|
}
|
|
5276
5257
|
)
|
|
5277
5258
|
] }) : null,
|
|
5278
|
-
/* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5259
|
+
/* @__PURE__ */ jsx4("span", { className: "ml-auto" }),
|
|
5260
|
+
/* @__PURE__ */ jsx4(
|
|
5280
5261
|
ToolbarButton,
|
|
5281
5262
|
{
|
|
5282
5263
|
label: "Refresh",
|
|
5283
5264
|
onClick: () => void result.refresh(),
|
|
5284
5265
|
disabled: busy || result.loading,
|
|
5285
|
-
children: /* @__PURE__ */
|
|
5266
|
+
children: /* @__PURE__ */ jsx4(RefreshCwIcon, { className: cn("size-3.5", result.loading && "animate-spin") })
|
|
5286
5267
|
}
|
|
5287
5268
|
)
|
|
5288
5269
|
]
|
|
5289
5270
|
}
|
|
5290
5271
|
),
|
|
5291
|
-
showDegradedTree ? /* @__PURE__ */
|
|
5272
|
+
showDegradedTree ? /* @__PURE__ */ jsxs4(
|
|
5292
5273
|
"div",
|
|
5293
5274
|
{
|
|
5294
5275
|
role: "status",
|
|
@@ -5296,9 +5277,9 @@ function FileBrowser({
|
|
|
5296
5277
|
"data-opengeni-files-degraded": true,
|
|
5297
5278
|
className: "flex shrink-0 items-center gap-2 border-b border-og-status-running/30 bg-og-status-running/10 px-2 py-1.5 text-og-xs text-og-fg-muted",
|
|
5298
5279
|
children: [
|
|
5299
|
-
/* @__PURE__ */
|
|
5300
|
-
/* @__PURE__ */
|
|
5301
|
-
/* @__PURE__ */
|
|
5280
|
+
/* @__PURE__ */ jsx4(TriangleAlertIcon, { className: "size-3.5 shrink-0 text-og-status-running", "aria-hidden": true }),
|
|
5281
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: result.source === "capture" ? "Live files are temporarily unavailable. Showing the latest captured revision." : "Live refresh failed. Showing the last loaded files." }),
|
|
5282
|
+
/* @__PURE__ */ jsxs4(
|
|
5302
5283
|
"button",
|
|
5303
5284
|
{
|
|
5304
5285
|
type: "button",
|
|
@@ -5306,7 +5287,7 @@ function FileBrowser({
|
|
|
5306
5287
|
disabled: result.loading,
|
|
5307
5288
|
className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm border border-og-border bg-og-surface-1 px-2 font-medium text-og-fg transition-colors hover:border-og-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
|
|
5308
5289
|
children: [
|
|
5309
|
-
/* @__PURE__ */
|
|
5290
|
+
/* @__PURE__ */ jsx4(
|
|
5310
5291
|
RefreshCwIcon,
|
|
5311
5292
|
{
|
|
5312
5293
|
className: cn("size-3", result.loading && "animate-spin motion-reduce:animate-none"),
|
|
@@ -5320,7 +5301,7 @@ function FileBrowser({
|
|
|
5320
5301
|
]
|
|
5321
5302
|
}
|
|
5322
5303
|
) : null,
|
|
5323
|
-
/* @__PURE__ */
|
|
5304
|
+
/* @__PURE__ */ jsx4(
|
|
5324
5305
|
"div",
|
|
5325
5306
|
{
|
|
5326
5307
|
ref: container.ref,
|
|
@@ -5346,9 +5327,9 @@ function FileBrowser({
|
|
|
5346
5327
|
dragOver === "" && "ring-1 ring-inset ring-og-accent"
|
|
5347
5328
|
),
|
|
5348
5329
|
"data-opengeni-file-tree": true,
|
|
5349
|
-
children: showErrorEmpty ? /* @__PURE__ */
|
|
5350
|
-
/* @__PURE__ */
|
|
5351
|
-
/* @__PURE__ */
|
|
5330
|
+
children: showErrorEmpty ? /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-start gap-2 p-2 text-og-sm text-og-fg-subtle", children: [
|
|
5331
|
+
/* @__PURE__ */ jsx4("div", { children: fallback ?? `Could not load files: ${result.error?.message ?? "refresh the file list to try again"}` }),
|
|
5332
|
+
/* @__PURE__ */ jsxs4(
|
|
5352
5333
|
"button",
|
|
5353
5334
|
{
|
|
5354
5335
|
type: "button",
|
|
@@ -5356,7 +5337,7 @@ function FileBrowser({
|
|
|
5356
5337
|
disabled: result.loading,
|
|
5357
5338
|
className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2 py-1 text-og-xs font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
|
|
5358
5339
|
children: [
|
|
5359
|
-
/* @__PURE__ */
|
|
5340
|
+
/* @__PURE__ */ jsx4(
|
|
5360
5341
|
RefreshCwIcon,
|
|
5361
5342
|
{
|
|
5362
5343
|
className: cn("size-3.5", result.loading && "animate-spin"),
|
|
@@ -5367,7 +5348,7 @@ function FileBrowser({
|
|
|
5367
5348
|
]
|
|
5368
5349
|
}
|
|
5369
5350
|
)
|
|
5370
|
-
] }) : showEmpty ? /* @__PURE__ */
|
|
5351
|
+
] }) : showEmpty ? /* @__PURE__ */ jsx4("div", { className: "p-2 text-og-sm text-og-fg-subtle", children: emptyState ?? "This directory is empty" }) : !usesVirtualTree ? /* @__PURE__ */ jsx4(
|
|
5371
5352
|
"div",
|
|
5372
5353
|
{
|
|
5373
5354
|
id: treeId,
|
|
@@ -5377,13 +5358,13 @@ function FileBrowser({
|
|
|
5377
5358
|
"aria-multiselectable": false,
|
|
5378
5359
|
tabIndex: 0,
|
|
5379
5360
|
className: "min-h-0 min-w-0 flex-1 overflow-auto outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
|
|
5380
|
-
children: renderItems.map((item) => /* @__PURE__ */
|
|
5361
|
+
children: renderItems.map((item) => /* @__PURE__ */ jsx4("div", { className: "min-w-0", children: renderItem(item) }, itemKey(item)))
|
|
5381
5362
|
}
|
|
5382
5363
|
) : (
|
|
5383
5364
|
// Virtualized: only the rows in/near the viewport mount, so a 3k-node
|
|
5384
5365
|
// tree stays responsive. The flat item list already carries the
|
|
5385
5366
|
// expanded subtree + synthetic (create/skeleton/residue) rows.
|
|
5386
|
-
/* @__PURE__ */
|
|
5367
|
+
/* @__PURE__ */ jsx4(
|
|
5387
5368
|
VList,
|
|
5388
5369
|
{
|
|
5389
5370
|
ref: vlistRef,
|
|
@@ -5396,13 +5377,13 @@ function FileBrowser({
|
|
|
5396
5377
|
className: "min-h-0 flex-1 outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent",
|
|
5397
5378
|
itemSize: coarsePointer ? 44 : 28,
|
|
5398
5379
|
ssrCount: Math.min(32, renderItems.length),
|
|
5399
|
-
children: renderItems.map((item) => /* @__PURE__ */
|
|
5380
|
+
children: renderItems.map((item) => /* @__PURE__ */ jsx4("div", { className: "min-w-0", children: renderItem(item) }, itemKey(item)))
|
|
5400
5381
|
}
|
|
5401
5382
|
)
|
|
5402
5383
|
)
|
|
5403
5384
|
}
|
|
5404
5385
|
),
|
|
5405
|
-
menu && menu.node && /* @__PURE__ */
|
|
5386
|
+
menu && menu.node && /* @__PURE__ */ jsx4(
|
|
5406
5387
|
ContextMenu,
|
|
5407
5388
|
{
|
|
5408
5389
|
node: menu.node,
|
|
@@ -5418,7 +5399,7 @@ function FileBrowser({
|
|
|
5418
5399
|
}
|
|
5419
5400
|
}
|
|
5420
5401
|
),
|
|
5421
|
-
pendingDelete ? /* @__PURE__ */
|
|
5402
|
+
pendingDelete ? /* @__PURE__ */ jsx4(
|
|
5422
5403
|
DeleteDialog,
|
|
5423
5404
|
{
|
|
5424
5405
|
node: pendingDelete,
|
|
@@ -5442,7 +5423,7 @@ function DeleteDialog({
|
|
|
5442
5423
|
onConfirm
|
|
5443
5424
|
}) {
|
|
5444
5425
|
const cancelRef = useRef11(null);
|
|
5445
|
-
const [open, setOpen] =
|
|
5426
|
+
const [open, setOpen] = useState10(true);
|
|
5446
5427
|
const closeIntentRef = useRef11("cancel");
|
|
5447
5428
|
const settledRef = useRef11(false);
|
|
5448
5429
|
const settleTimerRef = useRef11(null);
|
|
@@ -5468,7 +5449,7 @@ function DeleteDialog({
|
|
|
5468
5449
|
},
|
|
5469
5450
|
[]
|
|
5470
5451
|
);
|
|
5471
|
-
return /* @__PURE__ */
|
|
5452
|
+
return /* @__PURE__ */ jsx4(
|
|
5472
5453
|
AlertDialog.Root,
|
|
5473
5454
|
{
|
|
5474
5455
|
open,
|
|
@@ -5478,9 +5459,9 @@ function DeleteDialog({
|
|
|
5478
5459
|
scheduleSettle();
|
|
5479
5460
|
}
|
|
5480
5461
|
},
|
|
5481
|
-
children: /* @__PURE__ */
|
|
5482
|
-
/* @__PURE__ */
|
|
5483
|
-
/* @__PURE__ */
|
|
5462
|
+
children: /* @__PURE__ */ jsxs4(AlertDialog.Portal, { container: typeof document === "undefined" ? null : document.body, children: [
|
|
5463
|
+
/* @__PURE__ */ jsx4(AlertDialog.Overlay, { className: "og-root fixed inset-0 z-[100] bg-black/45 backdrop-blur-[2px]" }),
|
|
5464
|
+
/* @__PURE__ */ jsxs4(
|
|
5484
5465
|
AlertDialog.Content,
|
|
5485
5466
|
{
|
|
5486
5467
|
className: "og-root fixed left-1/2 top-1/2 z-[101] max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-sm -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-og-lg border border-og-border-strong bg-og-surface-1 p-4 text-og-fg shadow-2xl outline-hidden",
|
|
@@ -5502,22 +5483,22 @@ function DeleteDialog({
|
|
|
5502
5483
|
}
|
|
5503
5484
|
},
|
|
5504
5485
|
children: [
|
|
5505
|
-
/* @__PURE__ */
|
|
5506
|
-
/* @__PURE__ */
|
|
5507
|
-
/* @__PURE__ */
|
|
5508
|
-
/* @__PURE__ */
|
|
5486
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-start gap-3", children: [
|
|
5487
|
+
/* @__PURE__ */ jsx4("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-og-status-failed/12 text-og-status-failed", children: /* @__PURE__ */ jsx4(Trash2Icon, { className: "size-4", "aria-hidden": true }) }),
|
|
5488
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0", children: [
|
|
5489
|
+
/* @__PURE__ */ jsxs4(AlertDialog.Title, { className: "text-og-sm font-semibold", children: [
|
|
5509
5490
|
"Delete ",
|
|
5510
5491
|
node.kind === "dir" ? "folder" : "file",
|
|
5511
5492
|
"?"
|
|
5512
5493
|
] }),
|
|
5513
|
-
/* @__PURE__ */
|
|
5514
|
-
/* @__PURE__ */
|
|
5494
|
+
/* @__PURE__ */ jsxs4(AlertDialog.Description, { className: "mt-1 text-og-sm leading-relaxed text-og-fg-muted", children: [
|
|
5495
|
+
/* @__PURE__ */ jsx4("span", { className: "break-all font-og-mono text-og-fg", children: node.path }),
|
|
5515
5496
|
node.kind === "dir" ? " and everything inside it will be permanently removed." : " will be permanently removed."
|
|
5516
5497
|
] })
|
|
5517
5498
|
] })
|
|
5518
5499
|
] }),
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5500
|
+
/* @__PURE__ */ jsxs4("div", { className: "mt-4 flex justify-end gap-2", children: [
|
|
5501
|
+
/* @__PURE__ */ jsx4(AlertDialog.Cancel, { asChild: true, children: /* @__PURE__ */ jsx4(
|
|
5521
5502
|
"button",
|
|
5522
5503
|
{
|
|
5523
5504
|
ref: cancelRef,
|
|
@@ -5530,7 +5511,7 @@ function DeleteDialog({
|
|
|
5530
5511
|
children: "Cancel"
|
|
5531
5512
|
}
|
|
5532
5513
|
) }),
|
|
5533
|
-
/* @__PURE__ */
|
|
5514
|
+
/* @__PURE__ */ jsx4(AlertDialog.Action, { asChild: true, children: /* @__PURE__ */ jsx4(
|
|
5534
5515
|
"button",
|
|
5535
5516
|
{
|
|
5536
5517
|
type: "button",
|
|
@@ -5556,7 +5537,7 @@ function ToolbarButton({
|
|
|
5556
5537
|
disabled,
|
|
5557
5538
|
children
|
|
5558
5539
|
}) {
|
|
5559
|
-
return /* @__PURE__ */
|
|
5540
|
+
return /* @__PURE__ */ jsx4(
|
|
5560
5541
|
"button",
|
|
5561
5542
|
{
|
|
5562
5543
|
type: "button",
|
|
@@ -5580,7 +5561,7 @@ function InlineInput({
|
|
|
5580
5561
|
onCommit,
|
|
5581
5562
|
onCancel
|
|
5582
5563
|
}) {
|
|
5583
|
-
const [value, setValue] =
|
|
5564
|
+
const [value, setValue] = useState10(initialValue);
|
|
5584
5565
|
const ref = useRef11(null);
|
|
5585
5566
|
const doneRef = useRef11(false);
|
|
5586
5567
|
useEffect13(() => {
|
|
@@ -5597,15 +5578,15 @@ function InlineInput({
|
|
|
5597
5578
|
if (commit) onCommit(value);
|
|
5598
5579
|
else onCancel();
|
|
5599
5580
|
};
|
|
5600
|
-
return /* @__PURE__ */
|
|
5581
|
+
return /* @__PURE__ */ jsxs4(
|
|
5601
5582
|
"div",
|
|
5602
5583
|
{
|
|
5603
5584
|
className: "flex items-center gap-1 px-1 py-0.5",
|
|
5604
5585
|
style: { paddingLeft: `${depth * 12 + 4}px` },
|
|
5605
5586
|
children: [
|
|
5606
|
-
/* @__PURE__ */
|
|
5607
|
-
kind === "dir" ? /* @__PURE__ */
|
|
5608
|
-
/* @__PURE__ */
|
|
5587
|
+
/* @__PURE__ */ jsx4("span", { className: "inline-block w-3 shrink-0" }),
|
|
5588
|
+
kind === "dir" ? /* @__PURE__ */ jsx4(FolderIcon, { className: "size-3.5 shrink-0" }) : /* @__PURE__ */ jsx4(FileIcon, { className: "size-3.5 shrink-0" }),
|
|
5589
|
+
/* @__PURE__ */ jsx4(
|
|
5609
5590
|
"input",
|
|
5610
5591
|
{
|
|
5611
5592
|
ref,
|
|
@@ -5677,7 +5658,7 @@ function ContextMenu({
|
|
|
5677
5658
|
event.stopPropagation();
|
|
5678
5659
|
items[next]?.focus();
|
|
5679
5660
|
};
|
|
5680
|
-
const item = (label, icon, onClick, danger) => /* @__PURE__ */
|
|
5661
|
+
const item = (label, icon, onClick, danger) => /* @__PURE__ */ jsxs4(
|
|
5681
5662
|
"button",
|
|
5682
5663
|
{
|
|
5683
5664
|
type: "button",
|
|
@@ -5697,7 +5678,7 @@ function ContextMenu({
|
|
|
5697
5678
|
]
|
|
5698
5679
|
}
|
|
5699
5680
|
);
|
|
5700
|
-
return /* @__PURE__ */
|
|
5681
|
+
return /* @__PURE__ */ jsxs4(
|
|
5701
5682
|
"div",
|
|
5702
5683
|
{
|
|
5703
5684
|
ref: menuRef,
|
|
@@ -5712,13 +5693,13 @@ function ContextMenu({
|
|
|
5712
5693
|
"bg-og-surface-1"
|
|
5713
5694
|
),
|
|
5714
5695
|
children: [
|
|
5715
|
-
isDir && /* @__PURE__ */
|
|
5716
|
-
item("New file", /* @__PURE__ */
|
|
5717
|
-
item("New folder", /* @__PURE__ */
|
|
5718
|
-
/* @__PURE__ */
|
|
5696
|
+
isDir && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
5697
|
+
item("New file", /* @__PURE__ */ jsx4(FilePlusIcon, { className: "size-3.5" }), onNewFile),
|
|
5698
|
+
item("New folder", /* @__PURE__ */ jsx4(FolderPlusIcon, { className: "size-3.5" }), onNewFolder),
|
|
5699
|
+
/* @__PURE__ */ jsx4("div", { role: "separator", className: "my-1 h-px bg-og-border" })
|
|
5719
5700
|
] }),
|
|
5720
|
-
item("Rename", /* @__PURE__ */
|
|
5721
|
-
item("Delete", /* @__PURE__ */
|
|
5701
|
+
item("Rename", /* @__PURE__ */ jsx4(PencilIcon, { className: "size-3.5" }), onRename),
|
|
5702
|
+
item("Delete", /* @__PURE__ */ jsx4(Trash2Icon, { className: "size-3.5" }), onDelete, true)
|
|
5722
5703
|
]
|
|
5723
5704
|
}
|
|
5724
5705
|
);
|
|
@@ -5728,18 +5709,18 @@ function ContextMenu({
|
|
|
5728
5709
|
import { ArrowUpRightIcon, FileWarningIcon, HistoryIcon } from "lucide-react";
|
|
5729
5710
|
import {
|
|
5730
5711
|
Component,
|
|
5731
|
-
useCallback as
|
|
5712
|
+
useCallback as useCallback18,
|
|
5732
5713
|
useEffect as useEffect15,
|
|
5733
5714
|
useId as useId2,
|
|
5734
5715
|
useLayoutEffect as useLayoutEffect3,
|
|
5735
5716
|
useMemo as useMemo13,
|
|
5736
5717
|
useRef as useRef13,
|
|
5737
|
-
useState as
|
|
5718
|
+
useState as useState12
|
|
5738
5719
|
} from "react";
|
|
5739
5720
|
import { VList as VList2 } from "virtua";
|
|
5740
5721
|
|
|
5741
5722
|
// src/hooks/use-windowed-sections.ts
|
|
5742
|
-
import { useCallback as
|
|
5723
|
+
import { useCallback as useCallback17, useEffect as useEffect14, useMemo as useMemo12, useRef as useRef12, useState as useState11 } from "react";
|
|
5743
5724
|
function computeWindowRange(heights, scrollTop, viewport, overscan) {
|
|
5744
5725
|
const n = heights.length;
|
|
5745
5726
|
if (n === 0) return { start: 0, end: 0 };
|
|
@@ -5771,7 +5752,7 @@ function computeWindowRange(heights, scrollTop, viewport, overscan) {
|
|
|
5771
5752
|
function useWindowedSections(opts) {
|
|
5772
5753
|
const { count, estimateHeight, overscan = 3 } = opts;
|
|
5773
5754
|
const scrollRef = useRef12(null);
|
|
5774
|
-
const [heights, setHeights] =
|
|
5755
|
+
const [heights, setHeights] = useState11(
|
|
5775
5756
|
() => Array.from({ length: count }, (_, i) => estimateHeight(i))
|
|
5776
5757
|
);
|
|
5777
5758
|
useEffect14(() => {
|
|
@@ -5782,11 +5763,11 @@ function useWindowedSections(opts) {
|
|
|
5782
5763
|
}, [count, estimateHeight]);
|
|
5783
5764
|
const heightsRef = useRef12(heights);
|
|
5784
5765
|
heightsRef.current = heights;
|
|
5785
|
-
const [range, setRange] =
|
|
5766
|
+
const [range, setRange] = useState11(() => ({
|
|
5786
5767
|
start: 0,
|
|
5787
5768
|
end: Math.min(count, overscan + 1)
|
|
5788
5769
|
}));
|
|
5789
|
-
const recompute =
|
|
5770
|
+
const recompute = useCallback17(() => {
|
|
5790
5771
|
const el = scrollRef.current;
|
|
5791
5772
|
if (!el) return;
|
|
5792
5773
|
const next = computeWindowRange(heightsRef.current, el.scrollTop, el.clientHeight, overscan);
|
|
@@ -5813,7 +5794,7 @@ function useWindowedSections(opts) {
|
|
|
5813
5794
|
if (raf && typeof cancelAnimationFrame === "function") cancelAnimationFrame(raf);
|
|
5814
5795
|
};
|
|
5815
5796
|
}, [recompute, count]);
|
|
5816
|
-
const measure =
|
|
5797
|
+
const measure = useCallback17((index, height) => {
|
|
5817
5798
|
if (height <= 0) return;
|
|
5818
5799
|
setHeights((prev) => {
|
|
5819
5800
|
if (Math.abs((prev[index] ?? 0) - height) < 1) return prev;
|
|
@@ -5831,7 +5812,7 @@ function useWindowedSections(opts) {
|
|
|
5831
5812
|
useEffect14(() => {
|
|
5832
5813
|
recompute();
|
|
5833
5814
|
}, [offsets, recompute]);
|
|
5834
|
-
const scrollToIndex =
|
|
5815
|
+
const scrollToIndex = useCallback17(
|
|
5835
5816
|
(index) => {
|
|
5836
5817
|
const el = scrollRef.current;
|
|
5837
5818
|
if (!el) return;
|
|
@@ -5851,7 +5832,7 @@ function useWindowedSections(opts) {
|
|
|
5851
5832
|
}
|
|
5852
5833
|
|
|
5853
5834
|
// src/components/workbench-changes.tsx
|
|
5854
|
-
import { jsx as
|
|
5835
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
5855
5836
|
var GROUP_THRESHOLD = 20;
|
|
5856
5837
|
var OVERSCAN = 2;
|
|
5857
5838
|
var HEADER_PX = 30;
|
|
@@ -5969,7 +5950,7 @@ var ChangesRailVList = class extends Component {
|
|
|
5969
5950
|
this.listHandle = handle;
|
|
5970
5951
|
};
|
|
5971
5952
|
render() {
|
|
5972
|
-
return /* @__PURE__ */
|
|
5953
|
+
return /* @__PURE__ */ jsx5("div", { ref: this.setHost, "data-opengeni-changes-rail": true, className: this.props.className, children: /* @__PURE__ */ jsx5(
|
|
5973
5954
|
VList2,
|
|
5974
5955
|
{
|
|
5975
5956
|
ref: this.setListHandle,
|
|
@@ -6034,11 +6015,11 @@ function WorkbenchChanges({
|
|
|
6034
6015
|
className
|
|
6035
6016
|
}) {
|
|
6036
6017
|
const rootRef = useRef13(null);
|
|
6037
|
-
const [compact, setCompact] =
|
|
6038
|
-
const [coarsePointer, setCoarsePointer] =
|
|
6018
|
+
const [compact, setCompact] = useState12(false);
|
|
6019
|
+
const [coarsePointer, setCoarsePointer] = useState12(false);
|
|
6039
6020
|
const resolvedTheme = useThemeType(themeType);
|
|
6040
|
-
const [layout, setLayout] =
|
|
6041
|
-
const [activePath, setActivePath] =
|
|
6021
|
+
const [layout, setLayout] = useState12("unified");
|
|
6022
|
+
const [activePath, setActivePath] = useState12(null);
|
|
6042
6023
|
const pickerId = useId2();
|
|
6043
6024
|
const unicodeFontPaths = useMemo13(
|
|
6044
6025
|
() => diff.flatMap((file) => file.oldPath ? [file.path, file.oldPath] : [file.path]),
|
|
@@ -6077,7 +6058,7 @@ function WorkbenchChanges({
|
|
|
6077
6058
|
}, []);
|
|
6078
6059
|
const additions = useMemo13(() => diff.reduce((sum, f) => sum + f.additions, 0), [diff]);
|
|
6079
6060
|
const deletions = useMemo13(() => diff.reduce((sum, f) => sum + f.deletions, 0), [diff]);
|
|
6080
|
-
const estimateHeight =
|
|
6061
|
+
const estimateHeight = useCallback18(
|
|
6081
6062
|
(index) => {
|
|
6082
6063
|
const file = orderedFiles[index];
|
|
6083
6064
|
return file ? estimateSectionHeight(file) : HEADER_PX + LINE_PX;
|
|
@@ -6089,14 +6070,14 @@ function WorkbenchChanges({
|
|
|
6089
6070
|
estimateHeight,
|
|
6090
6071
|
overscan: OVERSCAN
|
|
6091
6072
|
});
|
|
6092
|
-
const jumpTo =
|
|
6073
|
+
const jumpTo = useCallback18(
|
|
6093
6074
|
(index) => {
|
|
6094
6075
|
setActivePath(orderedFiles[index]?.path ?? null);
|
|
6095
6076
|
windowed.scrollToIndex(index);
|
|
6096
6077
|
},
|
|
6097
6078
|
[orderedFiles, windowed]
|
|
6098
6079
|
);
|
|
6099
|
-
const onPaneScroll =
|
|
6080
|
+
const onPaneScroll = useCallback18(() => {
|
|
6100
6081
|
const el = windowed.scrollRef.current;
|
|
6101
6082
|
if (!el) {
|
|
6102
6083
|
return;
|
|
@@ -6119,14 +6100,14 @@ function WorkbenchChanges({
|
|
|
6119
6100
|
}, [windowed.scrollRef, onPaneScroll]);
|
|
6120
6101
|
const sourceBadge = describeSource(source, capturedAt, captureRevision ?? null);
|
|
6121
6102
|
const activeFile = orderedFiles[activeIndex] ?? orderedFiles[0];
|
|
6122
|
-
return /* @__PURE__ */
|
|
6103
|
+
return /* @__PURE__ */ jsxs5(
|
|
6123
6104
|
"div",
|
|
6124
6105
|
{
|
|
6125
6106
|
ref: rootRef,
|
|
6126
6107
|
className: cn("flex h-full min-h-0 min-w-0 flex-col", className),
|
|
6127
6108
|
"data-workbench-changes-layout": compact ? "compact" : "rail",
|
|
6128
6109
|
children: [
|
|
6129
|
-
/* @__PURE__ */
|
|
6110
|
+
/* @__PURE__ */ jsxs5(
|
|
6130
6111
|
"div",
|
|
6131
6112
|
{
|
|
6132
6113
|
className: cn(
|
|
@@ -6134,7 +6115,7 @@ function WorkbenchChanges({
|
|
|
6134
6115
|
compact && source === "capture" && "flex-col items-stretch gap-1.5 py-2"
|
|
6135
6116
|
),
|
|
6136
6117
|
children: [
|
|
6137
|
-
/* @__PURE__ */
|
|
6118
|
+
/* @__PURE__ */ jsxs5(
|
|
6138
6119
|
"span",
|
|
6139
6120
|
{
|
|
6140
6121
|
role: "status",
|
|
@@ -6147,18 +6128,18 @@ function WorkbenchChanges({
|
|
|
6147
6128
|
" ",
|
|
6148
6129
|
diff.length === 1 ? "file" : "files",
|
|
6149
6130
|
" changed",
|
|
6150
|
-
/* @__PURE__ */
|
|
6131
|
+
/* @__PURE__ */ jsxs5("span", { "data-contrast-audited": true, className: "ml-2 text-og-status-idle", children: [
|
|
6151
6132
|
"+",
|
|
6152
6133
|
additions
|
|
6153
6134
|
] }),
|
|
6154
|
-
/* @__PURE__ */
|
|
6135
|
+
/* @__PURE__ */ jsxs5("span", { "data-contrast-audited": true, className: "ml-1 text-og-status-failed", children: [
|
|
6155
6136
|
"\u2212",
|
|
6156
6137
|
deletions
|
|
6157
6138
|
] })
|
|
6158
6139
|
]
|
|
6159
6140
|
}
|
|
6160
6141
|
),
|
|
6161
|
-
/* @__PURE__ */
|
|
6142
|
+
/* @__PURE__ */ jsxs5(
|
|
6162
6143
|
"div",
|
|
6163
6144
|
{
|
|
6164
6145
|
className: cn(
|
|
@@ -6166,18 +6147,18 @@ function WorkbenchChanges({
|
|
|
6166
6147
|
compact && source === "capture" && "self-start"
|
|
6167
6148
|
),
|
|
6168
6149
|
children: [
|
|
6169
|
-
compact ? null : /* @__PURE__ */
|
|
6170
|
-
/* @__PURE__ */
|
|
6150
|
+
compact ? null : /* @__PURE__ */ jsx5(LayoutToggle, { layout, onChange: setLayout }),
|
|
6151
|
+
/* @__PURE__ */ jsx5(SourceBadge, { source, capturedAt, label: sourceBadge })
|
|
6171
6152
|
]
|
|
6172
6153
|
}
|
|
6173
6154
|
)
|
|
6174
6155
|
]
|
|
6175
6156
|
}
|
|
6176
6157
|
),
|
|
6177
|
-
compact ? /* @__PURE__ */
|
|
6178
|
-
/* @__PURE__ */
|
|
6179
|
-
/* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6158
|
+
compact ? /* @__PURE__ */ jsxs5("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
6159
|
+
/* @__PURE__ */ jsxs5("div", { className: "shrink-0 border-b border-og-border bg-og-surface-1 p-2", children: [
|
|
6160
|
+
/* @__PURE__ */ jsx5("label", { className: "sr-only", htmlFor: pickerId, children: "Changed file" }),
|
|
6161
|
+
/* @__PURE__ */ jsx5(
|
|
6181
6162
|
"select",
|
|
6182
6163
|
{
|
|
6183
6164
|
id: pickerId,
|
|
@@ -6190,11 +6171,11 @@ function WorkbenchChanges({
|
|
|
6190
6171
|
title: activeFile?.path,
|
|
6191
6172
|
"data-compact-file-picker": true,
|
|
6192
6173
|
className: "h-11 w-full rounded-og-md border border-og-border bg-og-bg px-3 font-og-mono text-og-sm text-og-fg outline-hidden transition-colors focus:border-og-accent focus:ring-2 focus:ring-og-accent-soft",
|
|
6193
|
-
children: orderedFiles.map((file, index) => /* @__PURE__ */
|
|
6174
|
+
children: orderedFiles.map((file, index) => /* @__PURE__ */ jsx5("option", { value: index, children: compactFileLabel(file) }, file.path))
|
|
6194
6175
|
}
|
|
6195
6176
|
)
|
|
6196
6177
|
] }),
|
|
6197
|
-
/* @__PURE__ */
|
|
6178
|
+
/* @__PURE__ */ jsx5(
|
|
6198
6179
|
"div",
|
|
6199
6180
|
{
|
|
6200
6181
|
"aria-label": "Changed file diff",
|
|
@@ -6202,7 +6183,7 @@ function WorkbenchChanges({
|
|
|
6202
6183
|
"data-opengeni-changes-pane": true,
|
|
6203
6184
|
role: "region",
|
|
6204
6185
|
tabIndex: 0,
|
|
6205
|
-
children: activeFile ? /* @__PURE__ */
|
|
6186
|
+
children: activeFile ? /* @__PURE__ */ jsx5(
|
|
6206
6187
|
DiffSection,
|
|
6207
6188
|
{
|
|
6208
6189
|
file: activeFile,
|
|
@@ -6213,8 +6194,8 @@ function WorkbenchChanges({
|
|
|
6213
6194
|
) : null
|
|
6214
6195
|
}
|
|
6215
6196
|
)
|
|
6216
|
-
] }) : /* @__PURE__ */
|
|
6217
|
-
/* @__PURE__ */
|
|
6197
|
+
] }) : /* @__PURE__ */ jsxs5("div", { className: "flex min-h-0 flex-1", children: [
|
|
6198
|
+
/* @__PURE__ */ jsx5(
|
|
6218
6199
|
ChangesRailVList,
|
|
6219
6200
|
{
|
|
6220
6201
|
rowCount: rows.length,
|
|
@@ -6222,18 +6203,18 @@ function WorkbenchChanges({
|
|
|
6222
6203
|
files: orderedFiles,
|
|
6223
6204
|
className: "w-[clamp(12rem,28%,15rem)] shrink-0 border-r border-og-border bg-og-surface-1/35",
|
|
6224
6205
|
children: rows.map(
|
|
6225
|
-
(row) => row.kind === "group" ? /* @__PURE__ */
|
|
6206
|
+
(row) => row.kind === "group" ? /* @__PURE__ */ jsxs5(
|
|
6226
6207
|
"div",
|
|
6227
6208
|
{
|
|
6228
6209
|
"data-rail-group": true,
|
|
6229
6210
|
className: "flex items-center gap-1.5 px-2 pb-0.5 pt-2 text-og-xs font-medium uppercase tracking-wide text-og-fg-subtle",
|
|
6230
6211
|
children: [
|
|
6231
|
-
/* @__PURE__ */
|
|
6232
|
-
/* @__PURE__ */
|
|
6212
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate", children: row.label }),
|
|
6213
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0", children: row.count })
|
|
6233
6214
|
]
|
|
6234
6215
|
},
|
|
6235
6216
|
`g:${row.label}`
|
|
6236
|
-
) : /* @__PURE__ */
|
|
6217
|
+
) : /* @__PURE__ */ jsx5(
|
|
6237
6218
|
RailFileRow,
|
|
6238
6219
|
{
|
|
6239
6220
|
file: row.file,
|
|
@@ -6246,7 +6227,7 @@ function WorkbenchChanges({
|
|
|
6246
6227
|
)
|
|
6247
6228
|
}
|
|
6248
6229
|
),
|
|
6249
|
-
/* @__PURE__ */
|
|
6230
|
+
/* @__PURE__ */ jsx5(
|
|
6250
6231
|
"div",
|
|
6251
6232
|
{
|
|
6252
6233
|
ref: windowed.scrollRef,
|
|
@@ -6255,15 +6236,15 @@ function WorkbenchChanges({
|
|
|
6255
6236
|
"data-opengeni-changes-pane": true,
|
|
6256
6237
|
role: "region",
|
|
6257
6238
|
tabIndex: 0,
|
|
6258
|
-
children: /* @__PURE__ */
|
|
6239
|
+
children: /* @__PURE__ */ jsx5("div", { style: { position: "relative", height: windowed.totalHeight }, children: orderedFiles.map((file, index) => {
|
|
6259
6240
|
if (index < windowed.range.start || index >= windowed.range.end) return null;
|
|
6260
|
-
return /* @__PURE__ */
|
|
6241
|
+
return /* @__PURE__ */ jsx5(
|
|
6261
6242
|
MeasuredSection,
|
|
6262
6243
|
{
|
|
6263
6244
|
index,
|
|
6264
6245
|
top: windowed.offsets[index] ?? 0,
|
|
6265
6246
|
onMeasure: windowed.measure,
|
|
6266
|
-
children: /* @__PURE__ */
|
|
6247
|
+
children: /* @__PURE__ */ jsx5(
|
|
6267
6248
|
DiffSection,
|
|
6268
6249
|
{
|
|
6269
6250
|
file,
|
|
@@ -6289,19 +6270,19 @@ function SourceBadge({
|
|
|
6289
6270
|
label
|
|
6290
6271
|
}) {
|
|
6291
6272
|
if (source === "capture" && capturedAt) {
|
|
6292
|
-
return /* @__PURE__ */
|
|
6273
|
+
return /* @__PURE__ */ jsxs5(
|
|
6293
6274
|
"span",
|
|
6294
6275
|
{
|
|
6295
6276
|
className: "inline-flex items-center gap-1 rounded-og-xs border border-og-border px-1.5 py-px text-og-xs text-og-fg-muted",
|
|
6296
6277
|
title: new Date(capturedAt).toLocaleString(),
|
|
6297
6278
|
children: [
|
|
6298
|
-
/* @__PURE__ */
|
|
6279
|
+
/* @__PURE__ */ jsx5(HistoryIcon, { className: "size-3 shrink-0 text-og-status-running", "aria-hidden": true }),
|
|
6299
6280
|
label
|
|
6300
6281
|
]
|
|
6301
6282
|
}
|
|
6302
6283
|
);
|
|
6303
6284
|
}
|
|
6304
|
-
return /* @__PURE__ */
|
|
6285
|
+
return /* @__PURE__ */ jsx5("span", { className: "rounded-og-xs bg-og-surface-2 px-1.5 py-px text-og-xs text-og-fg-subtle", children: label });
|
|
6305
6286
|
}
|
|
6306
6287
|
function describeSource(source, capturedAt, revision) {
|
|
6307
6288
|
if (source !== "capture" || !capturedAt) return "Live diff";
|
|
@@ -6316,7 +6297,7 @@ function RailFileRow({
|
|
|
6316
6297
|
}) {
|
|
6317
6298
|
const repoPrefix = file.repoRoot ? `${file.repoRoot}/` : null;
|
|
6318
6299
|
const shown = grouped ? file.repoRoot !== void 0 ? repoPrefix && file.path.startsWith(repoPrefix) ? file.path.slice(repoPrefix.length) : file.path : file.path.slice(file.path.indexOf("/") + 1) || file.path : file.path;
|
|
6319
|
-
return /* @__PURE__ */
|
|
6300
|
+
return /* @__PURE__ */ jsxs5(
|
|
6320
6301
|
"button",
|
|
6321
6302
|
{
|
|
6322
6303
|
type: "button",
|
|
@@ -6330,7 +6311,7 @@ function RailFileRow({
|
|
|
6330
6311
|
active && "bg-og-accent-soft text-og-fg before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-r-full before:bg-og-accent"
|
|
6331
6312
|
),
|
|
6332
6313
|
children: [
|
|
6333
|
-
/* @__PURE__ */
|
|
6314
|
+
/* @__PURE__ */ jsx5(
|
|
6334
6315
|
"span",
|
|
6335
6316
|
{
|
|
6336
6317
|
"data-contrast-audited": true,
|
|
@@ -6338,13 +6319,13 @@ function RailFileRow({
|
|
|
6338
6319
|
children: STATUS_LETTER[file.status]
|
|
6339
6320
|
}
|
|
6340
6321
|
),
|
|
6341
|
-
/* @__PURE__ */
|
|
6342
|
-
/* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6322
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 flex-1 truncate", children: shown }),
|
|
6323
|
+
/* @__PURE__ */ jsxs5("span", { className: "ml-auto flex shrink-0 items-center gap-1 pl-1 font-og-mono text-og-xs", children: [
|
|
6324
|
+
/* @__PURE__ */ jsxs5("span", { "data-contrast-audited": true, className: "text-og-status-idle", children: [
|
|
6344
6325
|
"+",
|
|
6345
6326
|
file.additions
|
|
6346
6327
|
] }),
|
|
6347
|
-
/* @__PURE__ */
|
|
6328
|
+
/* @__PURE__ */ jsxs5("span", { "data-contrast-audited": true, className: "text-og-status-failed", children: [
|
|
6348
6329
|
"\u2212",
|
|
6349
6330
|
file.deletions
|
|
6350
6331
|
] })
|
|
@@ -6369,7 +6350,7 @@ function MeasuredSection({
|
|
|
6369
6350
|
ro?.observe(el);
|
|
6370
6351
|
return () => ro?.disconnect();
|
|
6371
6352
|
}, [index, onMeasure]);
|
|
6372
|
-
return /* @__PURE__ */
|
|
6353
|
+
return /* @__PURE__ */ jsx5(
|
|
6373
6354
|
"div",
|
|
6374
6355
|
{
|
|
6375
6356
|
ref,
|
|
@@ -6388,37 +6369,37 @@ function DiffSection({
|
|
|
6388
6369
|
}) {
|
|
6389
6370
|
if (isGuarded(file)) {
|
|
6390
6371
|
const renamed = file.oldPath && file.oldPath !== file.path;
|
|
6391
|
-
return /* @__PURE__ */
|
|
6392
|
-
/* @__PURE__ */
|
|
6393
|
-
/* @__PURE__ */
|
|
6394
|
-
/* @__PURE__ */
|
|
6395
|
-
/* @__PURE__ */
|
|
6372
|
+
return /* @__PURE__ */ jsxs5("section", { className: "border-b border-og-border pb-1", children: [
|
|
6373
|
+
/* @__PURE__ */ jsxs5("header", { className: "flex items-center justify-between gap-2 bg-og-surface-1 px-3 py-1.5 text-og-sm", children: [
|
|
6374
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate font-og-mono text-og-xs", children: renamed ? `${file.oldPath} \u2192 ${file.path}` : file.path }),
|
|
6375
|
+
/* @__PURE__ */ jsxs5("span", { className: "flex shrink-0 items-center gap-2 font-og-mono text-og-xs", children: [
|
|
6376
|
+
/* @__PURE__ */ jsxs5("span", { className: "text-og-status-idle", children: [
|
|
6396
6377
|
"+",
|
|
6397
6378
|
file.additions
|
|
6398
6379
|
] }),
|
|
6399
|
-
/* @__PURE__ */
|
|
6380
|
+
/* @__PURE__ */ jsxs5("span", { className: "text-og-status-failed", children: [
|
|
6400
6381
|
"\u2212",
|
|
6401
6382
|
file.deletions
|
|
6402
6383
|
] })
|
|
6403
6384
|
] })
|
|
6404
6385
|
] }),
|
|
6405
|
-
/* @__PURE__ */
|
|
6386
|
+
/* @__PURE__ */ jsx5(GuardBody, { file, ...onOpenFile ? { onOpenFile } : {} })
|
|
6406
6387
|
] });
|
|
6407
6388
|
}
|
|
6408
|
-
return /* @__PURE__ */
|
|
6389
|
+
return /* @__PURE__ */ jsx5("section", { "data-pierre-section": true, className: "border-b border-og-border pb-2", children: /* @__PURE__ */ jsx5(PierreDiff, { diff: [file], layout, themeType, className: "px-1" }) });
|
|
6409
6390
|
}
|
|
6410
6391
|
function GuardBody({
|
|
6411
6392
|
file,
|
|
6412
6393
|
onOpenFile
|
|
6413
6394
|
}) {
|
|
6414
6395
|
const reason = file.isBinary ? "Binary file" : "Diff too large to show here";
|
|
6415
|
-
return /* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6417
|
-
/* @__PURE__ */
|
|
6396
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-2 px-3 py-3 text-og-sm text-og-fg-subtle", children: [
|
|
6397
|
+
/* @__PURE__ */ jsx5(FileWarningIcon, { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
6398
|
+
/* @__PURE__ */ jsxs5("span", { className: "min-w-0 flex-1", children: [
|
|
6418
6399
|
reason,
|
|
6419
6400
|
"."
|
|
6420
6401
|
] }),
|
|
6421
|
-
onOpenFile ? /* @__PURE__ */
|
|
6402
|
+
onOpenFile ? /* @__PURE__ */ jsxs5(
|
|
6422
6403
|
"button",
|
|
6423
6404
|
{
|
|
6424
6405
|
type: "button",
|
|
@@ -6426,7 +6407,7 @@ function GuardBody({
|
|
|
6426
6407
|
className: "inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-og-sm border border-og-border px-2 py-1 text-og-xs font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:bg-og-surface-2 hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent pointer-coarse:min-h-11",
|
|
6427
6408
|
children: [
|
|
6428
6409
|
"Open in Files",
|
|
6429
|
-
/* @__PURE__ */
|
|
6410
|
+
/* @__PURE__ */ jsx5(ArrowUpRightIcon, { className: "size-3.5", "aria-hidden": true })
|
|
6430
6411
|
]
|
|
6431
6412
|
}
|
|
6432
6413
|
) : null
|
|
@@ -6436,7 +6417,7 @@ function LayoutToggle({
|
|
|
6436
6417
|
layout,
|
|
6437
6418
|
onChange
|
|
6438
6419
|
}) {
|
|
6439
|
-
return /* @__PURE__ */
|
|
6420
|
+
return /* @__PURE__ */ jsx5("div", { className: "inline-flex items-center rounded-og-sm border border-og-border p-0.5", children: ["unified", "split"].map((value) => /* @__PURE__ */ jsx5(
|
|
6440
6421
|
"button",
|
|
6441
6422
|
{
|
|
6442
6423
|
type: "button",
|
|
@@ -6452,7 +6433,7 @@ function LayoutToggle({
|
|
|
6452
6433
|
}
|
|
6453
6434
|
|
|
6454
6435
|
// src/components/diff-view.tsx
|
|
6455
|
-
import { jsx as
|
|
6436
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
6456
6437
|
function DiffView({
|
|
6457
6438
|
diff,
|
|
6458
6439
|
fallback,
|
|
@@ -6463,9 +6444,9 @@ function DiffView({
|
|
|
6463
6444
|
className
|
|
6464
6445
|
}) {
|
|
6465
6446
|
if (diff.length === 0) {
|
|
6466
|
-
return /* @__PURE__ */
|
|
6447
|
+
return /* @__PURE__ */ jsx6("div", { className: cn("p-3 text-og-sm text-og-fg-subtle", className), children: emptyState ?? (isRepo ? "No changes" : "No repository mounted") });
|
|
6467
6448
|
}
|
|
6468
|
-
return /* @__PURE__ */
|
|
6449
|
+
return /* @__PURE__ */ jsx6(
|
|
6469
6450
|
PierreDiff,
|
|
6470
6451
|
{
|
|
6471
6452
|
diff,
|
|
@@ -6482,9 +6463,9 @@ import {
|
|
|
6482
6463
|
lazy,
|
|
6483
6464
|
Suspense,
|
|
6484
6465
|
useEffect as useEffect16,
|
|
6485
|
-
useState as
|
|
6466
|
+
useState as useState13
|
|
6486
6467
|
} from "react";
|
|
6487
|
-
import { jsx as
|
|
6468
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
6488
6469
|
var LazyFile = lazy(async () => {
|
|
6489
6470
|
const mod = await import("@pierre/diffs/react");
|
|
6490
6471
|
return { default: mod.File };
|
|
@@ -6499,7 +6480,7 @@ function PierreFile({
|
|
|
6499
6480
|
fallback,
|
|
6500
6481
|
className
|
|
6501
6482
|
}) {
|
|
6502
|
-
const [failed, setFailed] =
|
|
6483
|
+
const [failed, setFailed] = useState13(false);
|
|
6503
6484
|
useEffect16(() => {
|
|
6504
6485
|
let cancelled = false;
|
|
6505
6486
|
void import("@pierre/diffs/react").catch(() => {
|
|
@@ -6511,7 +6492,7 @@ function PierreFile({
|
|
|
6511
6492
|
}, []);
|
|
6512
6493
|
const name = path.split("/").filter(Boolean).pop() ?? path;
|
|
6513
6494
|
if (failed) {
|
|
6514
|
-
return /* @__PURE__ */
|
|
6495
|
+
return /* @__PURE__ */ jsx7("div", { className, children: fallback ?? /* @__PURE__ */ jsx7(PlainFile, { name, contents }) });
|
|
6515
6496
|
}
|
|
6516
6497
|
const options = {
|
|
6517
6498
|
overflow: "scroll",
|
|
@@ -6533,7 +6514,7 @@ function PierreFile({
|
|
|
6533
6514
|
"--diffs-font-size": "var(--og-code-font-size)",
|
|
6534
6515
|
"--diffs-line-height": "var(--og-code-line-height)"
|
|
6535
6516
|
};
|
|
6536
|
-
return /* @__PURE__ */
|
|
6517
|
+
return /* @__PURE__ */ jsx7("div", { className: cn("min-w-0", className), "data-opengeni-pierre-file": true, style: pierreVars, children: /* @__PURE__ */ jsx7(Suspense, { fallback: loading ?? /* @__PURE__ */ jsx7(FileSkeleton, {}), children: /* @__PURE__ */ jsx7(
|
|
6537
6518
|
LazyFile,
|
|
6538
6519
|
{
|
|
6539
6520
|
file: { name, contents },
|
|
@@ -6543,7 +6524,7 @@ function PierreFile({
|
|
|
6543
6524
|
) }) });
|
|
6544
6525
|
}
|
|
6545
6526
|
function PlainFile({ name, contents }) {
|
|
6546
|
-
return /* @__PURE__ */
|
|
6527
|
+
return /* @__PURE__ */ jsx7(
|
|
6547
6528
|
"pre",
|
|
6548
6529
|
{
|
|
6549
6530
|
className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg",
|
|
@@ -6553,19 +6534,19 @@ function PlainFile({ name, contents }) {
|
|
|
6553
6534
|
);
|
|
6554
6535
|
}
|
|
6555
6536
|
function FileSkeleton() {
|
|
6556
|
-
return /* @__PURE__ */
|
|
6537
|
+
return /* @__PURE__ */ jsx7("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "Loading file\u2026" });
|
|
6557
6538
|
}
|
|
6558
6539
|
|
|
6559
6540
|
// src/components/code-editor.tsx
|
|
6560
6541
|
import { Loader2Icon, SaveIcon } from "lucide-react";
|
|
6561
6542
|
import {
|
|
6562
|
-
useCallback as
|
|
6543
|
+
useCallback as useCallback19,
|
|
6563
6544
|
useEffect as useEffect17,
|
|
6564
6545
|
useMemo as useMemo14,
|
|
6565
6546
|
useRef as useRef14,
|
|
6566
|
-
useState as
|
|
6547
|
+
useState as useState14
|
|
6567
6548
|
} from "react";
|
|
6568
|
-
import { jsx as
|
|
6549
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
6569
6550
|
var LANGUAGE_LOADERS = {
|
|
6570
6551
|
javascript: async () => (await import("@codemirror/lang-javascript")).javascript({ jsx: true, typescript: true }),
|
|
6571
6552
|
json: async () => (await import("@codemirror/lang-json")).json(),
|
|
@@ -6635,17 +6616,17 @@ function CodeEditor({
|
|
|
6635
6616
|
fallback,
|
|
6636
6617
|
className
|
|
6637
6618
|
}) {
|
|
6638
|
-
const [failed, setFailed] =
|
|
6639
|
-
const [bundle, setBundle] =
|
|
6640
|
-
const [buffer, setBuffer] =
|
|
6619
|
+
const [failed, setFailed] = useState14(false);
|
|
6620
|
+
const [bundle, setBundle] = useState14(null);
|
|
6621
|
+
const [buffer, setBuffer] = useState14(() => ({
|
|
6641
6622
|
path,
|
|
6642
6623
|
value: initialContents,
|
|
6643
6624
|
baseline: initialContents
|
|
6644
6625
|
}));
|
|
6645
6626
|
const { value, baseline } = buffer;
|
|
6646
|
-
const [saving, setSaving] =
|
|
6647
|
-
const [saveError, setSaveError] =
|
|
6648
|
-
const [savedTick, setSavedTick] =
|
|
6627
|
+
const [saving, setSaving] = useState14(false);
|
|
6628
|
+
const [saveError, setSaveError] = useState14(null);
|
|
6629
|
+
const [savedTick, setSavedTick] = useState14(false);
|
|
6649
6630
|
const saveInFlightRef = useRef14(false);
|
|
6650
6631
|
const dirty = value !== baseline;
|
|
6651
6632
|
const saveConflict = saveError !== null && saveError.code === "file_write_conflict";
|
|
@@ -6658,7 +6639,7 @@ function CodeEditor({
|
|
|
6658
6639
|
setSaveError(null);
|
|
6659
6640
|
setSavedTick(false);
|
|
6660
6641
|
}, [path]);
|
|
6661
|
-
const noteEdit =
|
|
6642
|
+
const noteEdit = useCallback19(
|
|
6662
6643
|
(next) => {
|
|
6663
6644
|
setBuffer((current) => ({ ...current, value: next }));
|
|
6664
6645
|
setSavedTick(false);
|
|
@@ -6712,7 +6693,7 @@ function CodeEditor({
|
|
|
6712
6693
|
}, [langKey]);
|
|
6713
6694
|
const saveRef = useRef14(() => {
|
|
6714
6695
|
});
|
|
6715
|
-
const save =
|
|
6696
|
+
const save = useCallback19(async () => {
|
|
6716
6697
|
if (readOnly || saveInFlightRef.current) return;
|
|
6717
6698
|
const snapshot = value;
|
|
6718
6699
|
if (snapshot === baseline) return;
|
|
@@ -6733,7 +6714,7 @@ function CodeEditor({
|
|
|
6733
6714
|
setSaving(false);
|
|
6734
6715
|
}
|
|
6735
6716
|
}, [readOnly, value, baseline, onSave, path]);
|
|
6736
|
-
const overwrite =
|
|
6717
|
+
const overwrite = useCallback19(async () => {
|
|
6737
6718
|
if (readOnly || !onOverwrite || saveInFlightRef.current) return;
|
|
6738
6719
|
const snapshot = value;
|
|
6739
6720
|
if (snapshot === baseline) return;
|
|
@@ -6770,14 +6751,14 @@ function CodeEditor({
|
|
|
6770
6751
|
return exts;
|
|
6771
6752
|
}, [bundle]);
|
|
6772
6753
|
const Editor = bundle?.Editor;
|
|
6773
|
-
const reload =
|
|
6754
|
+
const reload = useCallback19(() => {
|
|
6774
6755
|
setBuffer({ path, value: initialContents, baseline: initialContents });
|
|
6775
6756
|
editIntentFiredRef.current = false;
|
|
6776
6757
|
setSaveError(null);
|
|
6777
6758
|
setSavedTick(false);
|
|
6778
6759
|
onReload?.();
|
|
6779
6760
|
}, [initialContents, onReload, path]);
|
|
6780
|
-
return /* @__PURE__ */
|
|
6761
|
+
return /* @__PURE__ */ jsxs6(
|
|
6781
6762
|
"div",
|
|
6782
6763
|
{
|
|
6783
6764
|
className: cn("flex h-full min-h-0 flex-col", className),
|
|
@@ -6785,8 +6766,8 @@ function CodeEditor({
|
|
|
6785
6766
|
"data-opengeni-editor-dirty": dirty ? "true" : "false",
|
|
6786
6767
|
style: editorVars,
|
|
6787
6768
|
children: [
|
|
6788
|
-
/* @__PURE__ */
|
|
6789
|
-
/* @__PURE__ */
|
|
6769
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex min-h-9 shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1", children: [
|
|
6770
|
+
/* @__PURE__ */ jsx8(
|
|
6790
6771
|
"span",
|
|
6791
6772
|
{
|
|
6792
6773
|
className: cn(
|
|
@@ -6796,12 +6777,12 @@ function CodeEditor({
|
|
|
6796
6777
|
title: readOnly ? "read-only" : dirty ? "unsaved changes" : "saved"
|
|
6797
6778
|
}
|
|
6798
6779
|
),
|
|
6799
|
-
/* @__PURE__ */
|
|
6780
|
+
/* @__PURE__ */ jsxs6("span", { className: "truncate font-og-mono text-og-xs text-og-fg-muted", children: [
|
|
6800
6781
|
fileName,
|
|
6801
6782
|
dirty && !readOnly ? " \u2022" : ""
|
|
6802
6783
|
] }),
|
|
6803
|
-
/* @__PURE__ */
|
|
6804
|
-
saveError && !saveConflict && /* @__PURE__ */
|
|
6784
|
+
/* @__PURE__ */ jsxs6("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
6785
|
+
saveError && !saveConflict && /* @__PURE__ */ jsx8(
|
|
6805
6786
|
"span",
|
|
6806
6787
|
{
|
|
6807
6788
|
className: "max-w-[220px] truncate text-og-xs text-og-status-failed",
|
|
@@ -6809,8 +6790,8 @@ function CodeEditor({
|
|
|
6809
6790
|
children: saveError.message
|
|
6810
6791
|
}
|
|
6811
6792
|
),
|
|
6812
|
-
!saveError && savedTick && !dirty && /* @__PURE__ */
|
|
6813
|
-
readOnly ? /* @__PURE__ */
|
|
6793
|
+
!saveError && savedTick && !dirty && /* @__PURE__ */ jsx8("span", { className: "text-og-xs text-og-status-idle", children: "Saved" }),
|
|
6794
|
+
readOnly ? /* @__PURE__ */ jsx8("span", { className: "text-og-xs uppercase tracking-wide text-og-fg-subtle", children: "Read-only" }) : !saveConflict ? /* @__PURE__ */ jsxs6(
|
|
6814
6795
|
"button",
|
|
6815
6796
|
{
|
|
6816
6797
|
type: "button",
|
|
@@ -6822,26 +6803,26 @@ function CodeEditor({
|
|
|
6822
6803
|
),
|
|
6823
6804
|
title: "Save (\u2318/Ctrl+S)",
|
|
6824
6805
|
children: [
|
|
6825
|
-
saving ? /* @__PURE__ */
|
|
6806
|
+
saving ? /* @__PURE__ */ jsx8(Loader2Icon, { className: "size-3 animate-spin" }) : /* @__PURE__ */ jsx8(SaveIcon, { className: "size-3" }),
|
|
6826
6807
|
"Save"
|
|
6827
6808
|
]
|
|
6828
6809
|
}
|
|
6829
6810
|
) : null
|
|
6830
6811
|
] })
|
|
6831
6812
|
] }),
|
|
6832
|
-
saveConflict ? /* @__PURE__ */
|
|
6813
|
+
saveConflict ? /* @__PURE__ */ jsxs6(
|
|
6833
6814
|
"div",
|
|
6834
6815
|
{
|
|
6835
6816
|
className: "flex shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-og-status-failed/25 bg-og-status-failed/8 px-2 py-2",
|
|
6836
6817
|
role: "alert",
|
|
6837
6818
|
children: [
|
|
6838
|
-
/* @__PURE__ */
|
|
6839
|
-
/* @__PURE__ */
|
|
6819
|
+
/* @__PURE__ */ jsxs6("div", { className: "min-w-[12rem] flex-1 text-og-xs text-og-fg-muted", children: [
|
|
6820
|
+
/* @__PURE__ */ jsx8("span", { className: "font-medium text-og-status-failed", children: "File changed on machine." }),
|
|
6840
6821
|
" ",
|
|
6841
6822
|
"Reloading discards your edits; overwriting replaces the live version."
|
|
6842
6823
|
] }),
|
|
6843
|
-
/* @__PURE__ */
|
|
6844
|
-
onReload ? /* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ jsxs6("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
|
|
6825
|
+
onReload ? /* @__PURE__ */ jsx8(
|
|
6845
6826
|
"button",
|
|
6846
6827
|
{
|
|
6847
6828
|
type: "button",
|
|
@@ -6852,7 +6833,7 @@ function CodeEditor({
|
|
|
6852
6833
|
children: "Reload live"
|
|
6853
6834
|
}
|
|
6854
6835
|
) : null,
|
|
6855
|
-
onOverwrite ? /* @__PURE__ */
|
|
6836
|
+
onOverwrite ? /* @__PURE__ */ jsx8(
|
|
6856
6837
|
"button",
|
|
6857
6838
|
{
|
|
6858
6839
|
type: "button",
|
|
@@ -6866,7 +6847,7 @@ function CodeEditor({
|
|
|
6866
6847
|
]
|
|
6867
6848
|
}
|
|
6868
6849
|
) : null,
|
|
6869
|
-
/* @__PURE__ */
|
|
6850
|
+
/* @__PURE__ */ jsx8("div", { className: "min-h-0 flex-1 overflow-auto", children: failed ? fallback ?? /* @__PURE__ */ jsx8(
|
|
6870
6851
|
PlainTextarea,
|
|
6871
6852
|
{
|
|
6872
6853
|
value,
|
|
@@ -6874,7 +6855,7 @@ function CodeEditor({
|
|
|
6874
6855
|
onChange: noteEdit,
|
|
6875
6856
|
onSave: () => void save()
|
|
6876
6857
|
}
|
|
6877
|
-
) : Editor ? /* @__PURE__ */
|
|
6858
|
+
) : Editor ? /* @__PURE__ */ jsx8(
|
|
6878
6859
|
Editor,
|
|
6879
6860
|
{
|
|
6880
6861
|
value,
|
|
@@ -6887,7 +6868,7 @@ function CodeEditor({
|
|
|
6887
6868
|
className: "og-cm-editor min-h-full text-og-sm",
|
|
6888
6869
|
onChange: readOnly ? void 0 : noteEdit
|
|
6889
6870
|
}
|
|
6890
|
-
) : loading ?? /* @__PURE__ */
|
|
6871
|
+
) : loading ?? /* @__PURE__ */ jsx8(EditorSkeleton, {}) })
|
|
6891
6872
|
]
|
|
6892
6873
|
}
|
|
6893
6874
|
);
|
|
@@ -6902,7 +6883,7 @@ function PlainTextarea({
|
|
|
6902
6883
|
onChange,
|
|
6903
6884
|
onSave
|
|
6904
6885
|
}) {
|
|
6905
|
-
return /* @__PURE__ */
|
|
6886
|
+
return /* @__PURE__ */ jsx8(
|
|
6906
6887
|
"textarea",
|
|
6907
6888
|
{
|
|
6908
6889
|
value,
|
|
@@ -6921,14 +6902,14 @@ function PlainTextarea({
|
|
|
6921
6902
|
);
|
|
6922
6903
|
}
|
|
6923
6904
|
function EditorSkeleton() {
|
|
6924
|
-
return /* @__PURE__ */
|
|
6905
|
+
return /* @__PURE__ */ jsx8("div", { className: "p-3 text-og-sm text-og-fg-subtle", children: "Loading editor\u2026" });
|
|
6925
6906
|
}
|
|
6926
6907
|
|
|
6927
6908
|
// src/components/sandbox-files.tsx
|
|
6928
6909
|
import { FileCode2Icon, FileWarningIcon as FileWarningIcon2, LoaderCircleIcon } from "lucide-react";
|
|
6929
|
-
import { useCallback as
|
|
6910
|
+
import { useCallback as useCallback20, useEffect as useEffect18, useRef as useRef15, useState as useState15 } from "react";
|
|
6930
6911
|
import { Group, Panel, Separator } from "react-resizable-panels";
|
|
6931
|
-
import { Fragment as Fragment2, jsx as
|
|
6912
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6932
6913
|
function SandboxFiles({
|
|
6933
6914
|
files,
|
|
6934
6915
|
git,
|
|
@@ -6951,12 +6932,12 @@ function SandboxFiles({
|
|
|
6951
6932
|
themeType,
|
|
6952
6933
|
className
|
|
6953
6934
|
}) {
|
|
6954
|
-
const [selected, setSelected] =
|
|
6955
|
-
const [editMode, setEditMode] =
|
|
6956
|
-
const [focusLine, setFocusLine] =
|
|
6957
|
-
const [treeRevealRequest, setTreeRevealRequest] =
|
|
6958
|
-
const [liveRequestedPath, setLiveRequestedPath] =
|
|
6959
|
-
const [viewReloadRevision, setViewReloadRevision] =
|
|
6935
|
+
const [selected, setSelected] = useState15(() => initialSelectedPath ?? null);
|
|
6936
|
+
const [editMode, setEditMode] = useState15(false);
|
|
6937
|
+
const [focusLine, setFocusLine] = useState15(null);
|
|
6938
|
+
const [treeRevealRequest, setTreeRevealRequest] = useState15(null);
|
|
6939
|
+
const [liveRequestedPath, setLiveRequestedPath] = useState15(null);
|
|
6940
|
+
const [viewReloadRevision, setViewReloadRevision] = useState15(0);
|
|
6960
6941
|
const viewerScrollRef = useRef15(null);
|
|
6961
6942
|
const pendingRequestRef = useRef15(null);
|
|
6962
6943
|
const handledRequestRef = useRef15(null);
|
|
@@ -7008,7 +6989,7 @@ function SandboxFiles({
|
|
|
7008
6989
|
requestedPathReady
|
|
7009
6990
|
]);
|
|
7010
6991
|
const rootRef = useRef15(null);
|
|
7011
|
-
const [wide, setWide] =
|
|
6992
|
+
const [wide, setWide] = useState15(false);
|
|
7012
6993
|
useEffect18(() => {
|
|
7013
6994
|
const el = rootRef.current;
|
|
7014
6995
|
if (!el) return;
|
|
@@ -7051,7 +7032,7 @@ function SandboxFiles({
|
|
|
7051
7032
|
viewerScrollRef.current.scrollTop = 0;
|
|
7052
7033
|
}
|
|
7053
7034
|
}, [focusLine, viewReloadRevision]);
|
|
7054
|
-
const selectFile =
|
|
7035
|
+
const selectFile = useCallback20(
|
|
7055
7036
|
(path) => {
|
|
7056
7037
|
if (pendingRequestRef.current !== null) {
|
|
7057
7038
|
handledRequestRef.current = pendingRequestRef.current;
|
|
@@ -7072,45 +7053,45 @@ function SandboxFiles({
|
|
|
7072
7053
|
const captureFileUnavailable = fileView.error instanceof CapturedFileUnavailableError ? fileView.error : null;
|
|
7073
7054
|
const waitingForSelectedFile = !workspaceError && liveRequestedPath === viewPath && (!liveWorkspaceReady || files.loading) && captureFileUnavailable !== null;
|
|
7074
7055
|
if (workspaceError && !liveWorkspaceReady && files.source !== "capture") {
|
|
7075
|
-
return /* @__PURE__ */
|
|
7076
|
-
/* @__PURE__ */
|
|
7077
|
-
onWakeWorkspace ? /* @__PURE__ */
|
|
7056
|
+
return /* @__PURE__ */ jsxs7(Notice, { className, title: "Could not open live workspace", announce: "alert", children: [
|
|
7057
|
+
/* @__PURE__ */ jsx9("p", { children: workspaceError.message }),
|
|
7058
|
+
onWakeWorkspace ? /* @__PURE__ */ jsx9(WakeButton, { onClick: onWakeWorkspace, children: "Retry live workspace" }) : null
|
|
7078
7059
|
] });
|
|
7079
7060
|
}
|
|
7080
7061
|
if (workspaceResting || workspaceWaking) {
|
|
7081
|
-
return /* @__PURE__ */
|
|
7062
|
+
return /* @__PURE__ */ jsx9("div", { className: cn("h-full", className), "data-opengeni-workspace-resting": true, children: /* @__PURE__ */ jsxs7(
|
|
7082
7063
|
Notice,
|
|
7083
7064
|
{
|
|
7084
|
-
icon: workspaceWaking ? /* @__PURE__ */
|
|
7065
|
+
icon: workspaceWaking ? /* @__PURE__ */ jsx9(
|
|
7085
7066
|
LoaderCircleIcon,
|
|
7086
7067
|
{
|
|
7087
7068
|
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
7088
7069
|
"aria-hidden": true
|
|
7089
7070
|
}
|
|
7090
|
-
) : /* @__PURE__ */
|
|
7071
|
+
) : /* @__PURE__ */ jsx9(FileCode2Icon, { className: "size-5", "aria-hidden": true }),
|
|
7091
7072
|
title: workspaceWaking ? "Waking workspace" : "Workspace is resting",
|
|
7092
7073
|
announce: "status",
|
|
7093
7074
|
children: [
|
|
7094
|
-
/* @__PURE__ */
|
|
7095
|
-
!workspaceWaking && onWakeWorkspace ? /* @__PURE__ */
|
|
7075
|
+
/* @__PURE__ */ jsx9("p", { children: workspaceWaking ? "Connecting to the live file system\u2026" : "No captured revision is available yet. Wake the sandbox to browse its current files." }),
|
|
7076
|
+
!workspaceWaking && onWakeWorkspace ? /* @__PURE__ */ jsx9(WakeButton, { onClick: onWakeWorkspace, children: "Open live workspace" }) : null
|
|
7096
7077
|
]
|
|
7097
7078
|
}
|
|
7098
7079
|
) });
|
|
7099
7080
|
}
|
|
7100
7081
|
if (!fileSystemAvailable) {
|
|
7101
|
-
return /* @__PURE__ */
|
|
7082
|
+
return /* @__PURE__ */ jsx9(
|
|
7102
7083
|
Notice,
|
|
7103
7084
|
{
|
|
7104
7085
|
className,
|
|
7105
|
-
icon: /* @__PURE__ */
|
|
7086
|
+
icon: /* @__PURE__ */ jsx9(FileWarningIcon2, { className: "size-5", "aria-hidden": true }),
|
|
7106
7087
|
title: "Files unavailable",
|
|
7107
7088
|
announce: "alert",
|
|
7108
7089
|
children: "This sandbox does not expose a file system."
|
|
7109
7090
|
}
|
|
7110
7091
|
);
|
|
7111
7092
|
}
|
|
7112
|
-
return /* @__PURE__ */
|
|
7113
|
-
/* @__PURE__ */
|
|
7093
|
+
return /* @__PURE__ */ jsxs7("div", { ref: rootRef, className: cn("flex h-full min-h-0 min-w-0 flex-col", className), children: [
|
|
7094
|
+
/* @__PURE__ */ jsx9(
|
|
7114
7095
|
GitHeader,
|
|
7115
7096
|
{
|
|
7116
7097
|
loading: Boolean(files.loading || files.gitLoading || files.source === null || git?.loading) && files.gitSummary === null,
|
|
@@ -7124,13 +7105,13 @@ function SandboxFiles({
|
|
|
7124
7105
|
}
|
|
7125
7106
|
}
|
|
7126
7107
|
),
|
|
7127
|
-
/* @__PURE__ */
|
|
7108
|
+
/* @__PURE__ */ jsxs7(
|
|
7128
7109
|
Group,
|
|
7129
7110
|
{
|
|
7130
7111
|
orientation: wide ? "horizontal" : "vertical",
|
|
7131
7112
|
className: cn("min-h-0 flex-1", wide ? "flex-row" : "flex-col"),
|
|
7132
7113
|
children: [
|
|
7133
|
-
/* @__PURE__ */
|
|
7114
|
+
/* @__PURE__ */ jsx9(
|
|
7134
7115
|
Panel,
|
|
7135
7116
|
{
|
|
7136
7117
|
id: "sandbox-files-tree",
|
|
@@ -7138,7 +7119,7 @@ function SandboxFiles({
|
|
|
7138
7119
|
minSize: wide ? "180px" : "120px",
|
|
7139
7120
|
maxSize: wide ? "60%" : "70%",
|
|
7140
7121
|
className: "flex min-h-0 min-w-0 flex-col",
|
|
7141
|
-
children: /* @__PURE__ */
|
|
7122
|
+
children: /* @__PURE__ */ jsx9(
|
|
7142
7123
|
FileBrowser,
|
|
7143
7124
|
{
|
|
7144
7125
|
result: files,
|
|
@@ -7156,7 +7137,7 @@ function SandboxFiles({
|
|
|
7156
7137
|
)
|
|
7157
7138
|
}
|
|
7158
7139
|
),
|
|
7159
|
-
/* @__PURE__ */
|
|
7140
|
+
/* @__PURE__ */ jsx9(
|
|
7160
7141
|
Separator,
|
|
7161
7142
|
{
|
|
7162
7143
|
"aria-label": "Resize file tree",
|
|
@@ -7168,15 +7149,15 @@ function SandboxFiles({
|
|
|
7168
7149
|
)
|
|
7169
7150
|
}
|
|
7170
7151
|
),
|
|
7171
|
-
/* @__PURE__ */
|
|
7152
|
+
/* @__PURE__ */ jsxs7(
|
|
7172
7153
|
Panel,
|
|
7173
7154
|
{
|
|
7174
7155
|
id: "sandbox-files-viewer",
|
|
7175
7156
|
minSize: wide ? "240px" : "160px",
|
|
7176
7157
|
className: cn("flex min-h-0 min-w-0 flex-col", !wide && "border-t border-og-border"),
|
|
7177
7158
|
children: [
|
|
7178
|
-
/* @__PURE__ */
|
|
7179
|
-
/* @__PURE__ */
|
|
7159
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1", children: [
|
|
7160
|
+
/* @__PURE__ */ jsx9(
|
|
7180
7161
|
"span",
|
|
7181
7162
|
{
|
|
7182
7163
|
"data-opengeni-selected-file": true,
|
|
@@ -7184,7 +7165,7 @@ function SandboxFiles({
|
|
|
7184
7165
|
children: selected ? focusLine !== null ? `${selected}:${focusLine}` : selected : "No file selected"
|
|
7185
7166
|
}
|
|
7186
7167
|
),
|
|
7187
|
-
canEdit && /* @__PURE__ */
|
|
7168
|
+
canEdit && /* @__PURE__ */ jsx9(
|
|
7188
7169
|
Segmented,
|
|
7189
7170
|
{
|
|
7190
7171
|
options: [
|
|
@@ -7196,13 +7177,13 @@ function SandboxFiles({
|
|
|
7196
7177
|
}
|
|
7197
7178
|
)
|
|
7198
7179
|
] }),
|
|
7199
|
-
/* @__PURE__ */
|
|
7180
|
+
/* @__PURE__ */ jsx9(
|
|
7200
7181
|
"div",
|
|
7201
7182
|
{
|
|
7202
7183
|
ref: viewerScrollRef,
|
|
7203
7184
|
className: "min-h-0 flex-1 overflow-auto",
|
|
7204
7185
|
"data-opengeni-file-viewer-scroll": true,
|
|
7205
|
-
children: viewPath ? showEditor && fileView.content !== null ? /* @__PURE__ */
|
|
7186
|
+
children: viewPath ? showEditor && fileView.content !== null ? /* @__PURE__ */ jsx9(
|
|
7206
7187
|
CodeEditor,
|
|
7207
7188
|
{
|
|
7208
7189
|
path: viewPath,
|
|
@@ -7215,13 +7196,13 @@ function SandboxFiles({
|
|
|
7215
7196
|
className: "h-full"
|
|
7216
7197
|
},
|
|
7217
7198
|
viewPath
|
|
7218
|
-
) : workspaceError && (liveRequestedPath === viewPath || requestedPath === viewPath) && !liveWorkspaceReady ? /* @__PURE__ */
|
|
7219
|
-
/* @__PURE__ */
|
|
7220
|
-
onWakeWorkspace ? /* @__PURE__ */
|
|
7221
|
-
] }) : waitingForSelectedFile ? /* @__PURE__ */
|
|
7199
|
+
) : workspaceError && (liveRequestedPath === viewPath || requestedPath === viewPath) && !liveWorkspaceReady ? /* @__PURE__ */ jsxs7(Notice, { title: "Could not open live file", announce: "alert", children: [
|
|
7200
|
+
/* @__PURE__ */ jsx9("p", { children: workspaceError.message }),
|
|
7201
|
+
onWakeWorkspace ? /* @__PURE__ */ jsx9(WakeButton, { onClick: onWakeWorkspace, children: "Retry live file" }) : null
|
|
7202
|
+
] }) : waitingForSelectedFile ? /* @__PURE__ */ jsxs7(
|
|
7222
7203
|
Notice,
|
|
7223
7204
|
{
|
|
7224
|
-
icon: /* @__PURE__ */
|
|
7205
|
+
icon: /* @__PURE__ */ jsx9(
|
|
7225
7206
|
LoaderCircleIcon,
|
|
7226
7207
|
{
|
|
7227
7208
|
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
@@ -7236,9 +7217,9 @@ function SandboxFiles({
|
|
|
7236
7217
|
" when the live file system is ready\u2026"
|
|
7237
7218
|
]
|
|
7238
7219
|
}
|
|
7239
|
-
) : captureFileUnavailable ? /* @__PURE__ */
|
|
7240
|
-
/* @__PURE__ */
|
|
7241
|
-
onWakeWorkspace ? /* @__PURE__ */
|
|
7220
|
+
) : captureFileUnavailable ? /* @__PURE__ */ jsxs7(Notice, { icon: /* @__PURE__ */ jsx9(FileCode2Icon, { className: "size-5", "aria-hidden": true }), title: "On machine", children: [
|
|
7221
|
+
/* @__PURE__ */ jsx9("p", { children: captureFileUnavailable.reason === "too-large" ? "This file is larger than the captured preview limit." : captureFileUnavailable.reason === "content-missing" ? "The captured copy is no longer available." : "This file was indexed, but it was not changed in the captured turn." }),
|
|
7222
|
+
onWakeWorkspace ? /* @__PURE__ */ jsx9(
|
|
7242
7223
|
WakeButton,
|
|
7243
7224
|
{
|
|
7244
7225
|
onClick: () => {
|
|
@@ -7249,64 +7230,64 @@ function SandboxFiles({
|
|
|
7249
7230
|
children: liveWorkspaceReady ? "Retry live file" : "Open live file"
|
|
7250
7231
|
}
|
|
7251
7232
|
) : null
|
|
7252
|
-
] }) : fileView.error ? /* @__PURE__ */
|
|
7233
|
+
] }) : fileView.error ? /* @__PURE__ */ jsxs7(Notice, { announce: "alert", children: [
|
|
7253
7234
|
"Could not open ",
|
|
7254
7235
|
viewPath,
|
|
7255
7236
|
": ",
|
|
7256
7237
|
fileView.error.message
|
|
7257
|
-
] }) : fileView.loading ? /* @__PURE__ */
|
|
7238
|
+
] }) : fileView.loading ? /* @__PURE__ */ jsxs7(Notice, { announce: "status", children: [
|
|
7258
7239
|
"Loading ",
|
|
7259
7240
|
viewPath,
|
|
7260
7241
|
"\u2026"
|
|
7261
|
-
] }) : fileView.imageUrl ? /* @__PURE__ */
|
|
7242
|
+
] }) : fileView.imageUrl ? /* @__PURE__ */ jsx9(
|
|
7262
7243
|
RasterFilePreview,
|
|
7263
7244
|
{
|
|
7264
7245
|
src: fileView.imageUrl,
|
|
7265
7246
|
path: viewPath
|
|
7266
7247
|
},
|
|
7267
7248
|
fileView.imageUrl
|
|
7268
|
-
) : fileView.isBinary ? /* @__PURE__ */
|
|
7249
|
+
) : fileView.isBinary ? /* @__PURE__ */ jsxs7(Notice, { children: [
|
|
7269
7250
|
viewPath,
|
|
7270
7251
|
" is a binary file (",
|
|
7271
7252
|
fileView.sizeBytes ?? 0,
|
|
7272
7253
|
" bytes)."
|
|
7273
|
-
] }) : fileView.content !== null ? /* @__PURE__ */
|
|
7274
|
-
fileView.truncated && /* @__PURE__ */
|
|
7254
|
+
] }) : fileView.content !== null ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
7255
|
+
fileView.truncated && /* @__PURE__ */ jsxs7("div", { className: "border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-status-running", children: [
|
|
7275
7256
|
"Large file \u2014 showing a truncated preview (",
|
|
7276
7257
|
fileView.sizeBytes ?? 0,
|
|
7277
7258
|
" bytes loaded). Editing is disabled to avoid corrupting the file."
|
|
7278
7259
|
] }),
|
|
7279
|
-
usePierre && focusLine === null ? /* @__PURE__ */
|
|
7260
|
+
usePierre && focusLine === null ? /* @__PURE__ */ jsx9(
|
|
7280
7261
|
PierreFile,
|
|
7281
7262
|
{
|
|
7282
7263
|
path: viewPath,
|
|
7283
7264
|
contents: fileView.content,
|
|
7284
7265
|
themeType: resolvedTheme,
|
|
7285
|
-
fallback: /* @__PURE__ */
|
|
7266
|
+
fallback: /* @__PURE__ */ jsx9("pre", { className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg", children: fileView.content }),
|
|
7286
7267
|
className: "p-1"
|
|
7287
7268
|
},
|
|
7288
7269
|
`${viewPath}:${viewReloadRevision}`
|
|
7289
|
-
) : focusLine !== null ? /* @__PURE__ */
|
|
7270
|
+
) : focusLine !== null ? /* @__PURE__ */ jsx9(
|
|
7290
7271
|
LineNumberedFile,
|
|
7291
7272
|
{
|
|
7292
7273
|
path: viewPath,
|
|
7293
7274
|
contents: fileView.content,
|
|
7294
7275
|
focusLine
|
|
7295
7276
|
}
|
|
7296
|
-
) : /* @__PURE__ */
|
|
7297
|
-
] }) : /* @__PURE__ */
|
|
7277
|
+
) : /* @__PURE__ */ jsx9("pre", { className: "overflow-auto whitespace-pre p-2 font-og-mono text-og-sm text-og-fg", children: fileView.content })
|
|
7278
|
+
] }) : /* @__PURE__ */ jsxs7(Notice, { announce: "status", children: [
|
|
7298
7279
|
"Loading ",
|
|
7299
7280
|
viewPath,
|
|
7300
7281
|
"\u2026"
|
|
7301
7282
|
] }) : (
|
|
7302
7283
|
// Nothing selected — the tree shows the whole workspace; pick a file.
|
|
7303
|
-
requestedPath && !requestedPathReady ? workspaceError ? /* @__PURE__ */
|
|
7304
|
-
/* @__PURE__ */
|
|
7305
|
-
onWakeWorkspace ? /* @__PURE__ */
|
|
7306
|
-
] }) : /* @__PURE__ */
|
|
7284
|
+
requestedPath && !requestedPathReady ? workspaceError ? /* @__PURE__ */ jsxs7(Notice, { title: "Could not open live file", announce: "alert", children: [
|
|
7285
|
+
/* @__PURE__ */ jsx9("p", { children: workspaceError.message }),
|
|
7286
|
+
onWakeWorkspace ? /* @__PURE__ */ jsx9(WakeButton, { onClick: onWakeWorkspace, children: "Retry live file" }) : null
|
|
7287
|
+
] }) : /* @__PURE__ */ jsxs7(
|
|
7307
7288
|
Notice,
|
|
7308
7289
|
{
|
|
7309
|
-
icon: /* @__PURE__ */
|
|
7290
|
+
icon: /* @__PURE__ */ jsx9(
|
|
7310
7291
|
LoaderCircleIcon,
|
|
7311
7292
|
{
|
|
7312
7293
|
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
@@ -7321,7 +7302,7 @@ function SandboxFiles({
|
|
|
7321
7302
|
" when the live workspace is ready\u2026"
|
|
7322
7303
|
]
|
|
7323
7304
|
}
|
|
7324
|
-
) : /* @__PURE__ */
|
|
7305
|
+
) : /* @__PURE__ */ jsx9(Notice, { icon: /* @__PURE__ */ jsx9(FileCode2Icon, { className: "size-5", "aria-hidden": true }), title: "Choose a file", children: "Select a file in the tree to preview it." })
|
|
7325
7306
|
)
|
|
7326
7307
|
}
|
|
7327
7308
|
)
|
|
@@ -7334,7 +7315,7 @@ function SandboxFiles({
|
|
|
7334
7315
|
] });
|
|
7335
7316
|
}
|
|
7336
7317
|
function WakeButton({ children, onClick }) {
|
|
7337
|
-
return /* @__PURE__ */
|
|
7318
|
+
return /* @__PURE__ */ jsx9(
|
|
7338
7319
|
"button",
|
|
7339
7320
|
{
|
|
7340
7321
|
type: "button",
|
|
@@ -7358,14 +7339,14 @@ function LineNumberedFile({
|
|
|
7358
7339
|
behavior: prefersReducedMotion() ? "auto" : "smooth"
|
|
7359
7340
|
});
|
|
7360
7341
|
}, [path, focusLine, contents]);
|
|
7361
|
-
return /* @__PURE__ */
|
|
7342
|
+
return /* @__PURE__ */ jsxs7(
|
|
7362
7343
|
"div",
|
|
7363
7344
|
{
|
|
7364
7345
|
className: "h-full min-h-0 overflow-auto font-og-mono text-og-sm text-og-fg",
|
|
7365
7346
|
role: "region",
|
|
7366
7347
|
"aria-label": inRange ? `${path} at line ${focusLine}` : path,
|
|
7367
7348
|
children: [
|
|
7368
|
-
!inRange ? /* @__PURE__ */
|
|
7349
|
+
!inRange ? /* @__PURE__ */ jsxs7(
|
|
7369
7350
|
"p",
|
|
7370
7351
|
{
|
|
7371
7352
|
className: "border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted",
|
|
@@ -7377,10 +7358,10 @@ function LineNumberedFile({
|
|
|
7377
7358
|
]
|
|
7378
7359
|
}
|
|
7379
7360
|
) : null,
|
|
7380
|
-
/* @__PURE__ */
|
|
7361
|
+
/* @__PURE__ */ jsx9("div", { children: lines.map((text, index) => {
|
|
7381
7362
|
const lineNumber = index + 1;
|
|
7382
7363
|
const focused = inRange && lineNumber === focusLine;
|
|
7383
|
-
return /* @__PURE__ */
|
|
7364
|
+
return /* @__PURE__ */ jsxs7(
|
|
7384
7365
|
"div",
|
|
7385
7366
|
{
|
|
7386
7367
|
ref: focused ? targetRef : void 0,
|
|
@@ -7389,8 +7370,8 @@ function LineNumberedFile({
|
|
|
7389
7370
|
"aria-current": focused ? "location" : void 0,
|
|
7390
7371
|
className: cn("flex gap-3 px-2 py-0.5 leading-6", focused && "bg-og-accent-soft"),
|
|
7391
7372
|
children: [
|
|
7392
|
-
/* @__PURE__ */
|
|
7393
|
-
/* @__PURE__ */
|
|
7373
|
+
/* @__PURE__ */ jsx9("span", { className: "w-11 shrink-0 select-none text-right tabular-nums text-og-fg-subtle", children: lineNumber }),
|
|
7374
|
+
/* @__PURE__ */ jsx9("pre", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: text || " " })
|
|
7394
7375
|
]
|
|
7395
7376
|
},
|
|
7396
7377
|
lineNumber
|
|
@@ -7402,28 +7383,28 @@ function LineNumberedFile({
|
|
|
7402
7383
|
}
|
|
7403
7384
|
function GitHeader({ git, loading }) {
|
|
7404
7385
|
if (loading) {
|
|
7405
|
-
return /* @__PURE__ */
|
|
7386
|
+
return /* @__PURE__ */ jsxs7(
|
|
7406
7387
|
"div",
|
|
7407
7388
|
{
|
|
7408
7389
|
className: "flex shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-sm text-og-fg-muted",
|
|
7409
7390
|
role: "status",
|
|
7410
7391
|
"aria-live": "polite",
|
|
7411
7392
|
children: [
|
|
7412
|
-
/* @__PURE__ */
|
|
7393
|
+
/* @__PURE__ */ jsx9(
|
|
7413
7394
|
LoaderCircleIcon,
|
|
7414
7395
|
{
|
|
7415
7396
|
className: "size-3.5 shrink-0 animate-spin motion-reduce:animate-none",
|
|
7416
7397
|
"aria-hidden": true
|
|
7417
7398
|
}
|
|
7418
7399
|
),
|
|
7419
|
-
/* @__PURE__ */
|
|
7400
|
+
/* @__PURE__ */ jsx9("span", { children: "Loading repository\u2026" })
|
|
7420
7401
|
]
|
|
7421
7402
|
}
|
|
7422
7403
|
);
|
|
7423
7404
|
}
|
|
7424
7405
|
const dirty = git.dirtyCount > 0;
|
|
7425
|
-
return /* @__PURE__ */
|
|
7426
|
-
/* @__PURE__ */
|
|
7406
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-1 px-2 py-1 text-og-sm", children: [
|
|
7407
|
+
/* @__PURE__ */ jsx9(
|
|
7427
7408
|
"span",
|
|
7428
7409
|
{
|
|
7429
7410
|
"aria-hidden": "true",
|
|
@@ -7433,19 +7414,19 @@ function GitHeader({ git, loading }) {
|
|
|
7433
7414
|
)
|
|
7434
7415
|
}
|
|
7435
7416
|
),
|
|
7436
|
-
/* @__PURE__ */
|
|
7437
|
-
/* @__PURE__ */
|
|
7438
|
-
(git.ahead > 0 || git.behind > 0) && /* @__PURE__ */
|
|
7439
|
-
git.ahead > 0 && /* @__PURE__ */
|
|
7417
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: dirty ? `Uncommitted changes in ${git.dirtyCount} files` : "No uncommitted changes" }),
|
|
7418
|
+
/* @__PURE__ */ jsx9("span", { className: "truncate font-og-mono text-og-fg", children: git.repoCount > 1 ? `${git.repoCount} repositories` : git.branch ?? (git.isRepo ? "(detached)" : "no repo") }),
|
|
7419
|
+
(git.ahead > 0 || git.behind > 0) && /* @__PURE__ */ jsxs7("span", { className: "flex shrink-0 items-center gap-1.5 text-og-xs text-og-fg-subtle", children: [
|
|
7420
|
+
git.ahead > 0 && /* @__PURE__ */ jsxs7("span", { "data-contrast-audited": true, children: [
|
|
7440
7421
|
"\u2191",
|
|
7441
7422
|
git.ahead
|
|
7442
7423
|
] }),
|
|
7443
|
-
git.behind > 0 && /* @__PURE__ */
|
|
7424
|
+
git.behind > 0 && /* @__PURE__ */ jsxs7("span", { "data-contrast-audited": true, children: [
|
|
7444
7425
|
"\u2193",
|
|
7445
7426
|
git.behind
|
|
7446
7427
|
] })
|
|
7447
7428
|
] }),
|
|
7448
|
-
dirty && /* @__PURE__ */
|
|
7429
|
+
dirty && /* @__PURE__ */ jsxs7(
|
|
7449
7430
|
"span",
|
|
7450
7431
|
{
|
|
7451
7432
|
"aria-hidden": "true",
|
|
@@ -7464,7 +7445,7 @@ function Segmented({
|
|
|
7464
7445
|
value,
|
|
7465
7446
|
onChange
|
|
7466
7447
|
}) {
|
|
7467
|
-
return /* @__PURE__ */
|
|
7448
|
+
return /* @__PURE__ */ jsx9("div", { className: "flex flex-wrap items-center rounded-og-sm border border-og-border p-0.5", children: options.map((opt) => /* @__PURE__ */ jsx9(
|
|
7468
7449
|
"button",
|
|
7469
7450
|
{
|
|
7470
7451
|
type: "button",
|
|
@@ -7480,7 +7461,7 @@ function Segmented({
|
|
|
7480
7461
|
}
|
|
7481
7462
|
function useFileView(path, readFile, reloadRevision = 0) {
|
|
7482
7463
|
const previousPathRef = useRef15(null);
|
|
7483
|
-
const [state, setState] =
|
|
7464
|
+
const [state, setState] = useState15({
|
|
7484
7465
|
content: null,
|
|
7485
7466
|
isBinary: false,
|
|
7486
7467
|
truncated: false,
|
|
@@ -7556,12 +7537,12 @@ function rasterImageUrl(path, content) {
|
|
|
7556
7537
|
return mime ? `data:${mime};base64,${content}` : null;
|
|
7557
7538
|
}
|
|
7558
7539
|
function RasterFilePreview({ src, path }) {
|
|
7559
|
-
const [failed, setFailed] =
|
|
7560
|
-
return failed ? /* @__PURE__ */
|
|
7540
|
+
const [failed, setFailed] = useState15(false);
|
|
7541
|
+
return failed ? /* @__PURE__ */ jsxs7(Notice, { title: "Image preview unavailable", announce: "alert", children: [
|
|
7561
7542
|
"Could not decode ",
|
|
7562
7543
|
path,
|
|
7563
7544
|
" as an image."
|
|
7564
|
-
] }) : /* @__PURE__ */
|
|
7545
|
+
] }) : /* @__PURE__ */ jsx9(
|
|
7565
7546
|
"img",
|
|
7566
7547
|
{
|
|
7567
7548
|
src,
|
|
@@ -7590,7 +7571,7 @@ function Notice({
|
|
|
7590
7571
|
title,
|
|
7591
7572
|
announce
|
|
7592
7573
|
}) {
|
|
7593
|
-
return /* @__PURE__ */
|
|
7574
|
+
return /* @__PURE__ */ jsx9(
|
|
7594
7575
|
"div",
|
|
7595
7576
|
{
|
|
7596
7577
|
role: announce,
|
|
@@ -7600,10 +7581,10 @@ function Notice({
|
|
|
7600
7581
|
"flex h-full items-center justify-center p-4 text-center text-og-sm text-og-fg-subtle",
|
|
7601
7582
|
className
|
|
7602
7583
|
),
|
|
7603
|
-
children: /* @__PURE__ */
|
|
7604
|
-
icon ? /* @__PURE__ */
|
|
7605
|
-
title ? /* @__PURE__ */
|
|
7606
|
-
/* @__PURE__ */
|
|
7584
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "flex max-w-sm flex-col items-center gap-2.5", children: [
|
|
7585
|
+
icon ? /* @__PURE__ */ jsx9("span", { className: "grid size-10 place-items-center rounded-og-lg border border-og-border bg-og-surface-1 text-og-fg-muted shadow-sm", children: icon }) : null,
|
|
7586
|
+
title ? /* @__PURE__ */ jsx9("p", { className: "font-medium text-og-fg", children: title }) : null,
|
|
7587
|
+
/* @__PURE__ */ jsx9("div", { "data-contrast-audited": true, className: "leading-5", children })
|
|
7607
7588
|
] })
|
|
7608
7589
|
}
|
|
7609
7590
|
);
|
|
@@ -7611,12 +7592,12 @@ function Notice({
|
|
|
7611
7592
|
|
|
7612
7593
|
// src/components/workspace-dock.tsx
|
|
7613
7594
|
import {
|
|
7614
|
-
useCallback as
|
|
7595
|
+
useCallback as useCallback21,
|
|
7615
7596
|
useEffect as useEffect19,
|
|
7616
7597
|
useId as useId3,
|
|
7617
7598
|
useLayoutEffect as useLayoutEffect4,
|
|
7618
7599
|
useRef as useRef16,
|
|
7619
|
-
useState as
|
|
7600
|
+
useState as useState16
|
|
7620
7601
|
} from "react";
|
|
7621
7602
|
import {
|
|
7622
7603
|
ChevronsLeftRightIcon,
|
|
@@ -7632,7 +7613,7 @@ import {
|
|
|
7632
7613
|
useDefaultLayout,
|
|
7633
7614
|
usePanelRef
|
|
7634
7615
|
} from "react-resizable-panels";
|
|
7635
|
-
import { Fragment as Fragment3, jsx as
|
|
7616
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
7636
7617
|
var SERVER_LAYOUT_STORAGE = {
|
|
7637
7618
|
getItem: () => null,
|
|
7638
7619
|
setItem: () => {
|
|
@@ -7649,7 +7630,7 @@ function getLayoutStorage() {
|
|
|
7649
7630
|
var useDockLayoutEffect = typeof window === "undefined" ? useEffect19 : useLayoutEffect4;
|
|
7650
7631
|
var DOCK_OVERLAY_BREAKPOINT = 1024;
|
|
7651
7632
|
function useIsNarrow(maxWidth) {
|
|
7652
|
-
const [narrow, setNarrow] =
|
|
7633
|
+
const [narrow, setNarrow] = useState16(false);
|
|
7653
7634
|
useDockLayoutEffect(() => {
|
|
7654
7635
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
7655
7636
|
return;
|
|
@@ -7688,9 +7669,9 @@ function WorkspaceDock({
|
|
|
7688
7669
|
const returnFocusRef = useRef16(null);
|
|
7689
7670
|
const initialNarrowFocusRef = useRef16(false);
|
|
7690
7671
|
const dockPanelRef = usePanelRef();
|
|
7691
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
7692
|
-
const [maximized, setMaximized] =
|
|
7693
|
-
const [internalTab, setInternalTab] =
|
|
7672
|
+
const [internalCollapsed, setInternalCollapsed] = useState16(false);
|
|
7673
|
+
const [maximized, setMaximized] = useState16(false);
|
|
7674
|
+
const [internalTab, setInternalTab] = useState16(tabs[0]?.id ?? "");
|
|
7694
7675
|
const collapsed = collapsedProp ?? internalCollapsed;
|
|
7695
7676
|
const hostControlled = collapsedProp !== void 0;
|
|
7696
7677
|
const previousCollapsedRef = useRef16(collapsed);
|
|
@@ -7706,7 +7687,7 @@ function WorkspaceDock({
|
|
|
7706
7687
|
layoutIdentityRef.current = autoSaveId;
|
|
7707
7688
|
lastExpandedSizeRef.current = expandedDefaultLayout?.dock ?? defaultSize;
|
|
7708
7689
|
}
|
|
7709
|
-
const persistExpandedLayout =
|
|
7690
|
+
const persistExpandedLayout = useCallback21(
|
|
7710
7691
|
(layout, meta) => {
|
|
7711
7692
|
const dockSize = layout.dock ?? 0;
|
|
7712
7693
|
if (dockSize <= 1) return;
|
|
@@ -7720,14 +7701,14 @@ function WorkspaceDock({
|
|
|
7720
7701
|
const firstTabId = tabs[0]?.id ?? "";
|
|
7721
7702
|
const requestedTabIsValid = tabIds.includes(requestedTab);
|
|
7722
7703
|
const current = requestedTabIsValid ? requestedTab : firstTabId;
|
|
7723
|
-
const setTab =
|
|
7704
|
+
const setTab = useCallback21(
|
|
7724
7705
|
(id) => {
|
|
7725
7706
|
setInternalTab(id);
|
|
7726
7707
|
onActiveTabChange?.(id);
|
|
7727
7708
|
},
|
|
7728
7709
|
[onActiveTabChange]
|
|
7729
7710
|
);
|
|
7730
|
-
const setCollapsed =
|
|
7711
|
+
const setCollapsed = useCallback21(
|
|
7731
7712
|
(next) => {
|
|
7732
7713
|
setInternalCollapsed((previous) => previous === next ? previous : next);
|
|
7733
7714
|
onCollapsedChange?.(next);
|
|
@@ -7799,11 +7780,11 @@ function WorkspaceDock({
|
|
|
7799
7780
|
setTab(firstTabId);
|
|
7800
7781
|
}
|
|
7801
7782
|
}, [firstTabId, requestedTabIsValid, setTab]);
|
|
7802
|
-
const collapse =
|
|
7783
|
+
const collapse = useCallback21(() => {
|
|
7803
7784
|
dockPanelRef.current?.collapse();
|
|
7804
7785
|
setCollapsed(true);
|
|
7805
7786
|
}, [dockPanelRef, setCollapsed]);
|
|
7806
|
-
const expand =
|
|
7787
|
+
const expand = useCallback21(() => {
|
|
7807
7788
|
dockPanelRef.current?.expand();
|
|
7808
7789
|
setCollapsed(false);
|
|
7809
7790
|
}, [dockPanelRef, setCollapsed]);
|
|
@@ -7851,8 +7832,8 @@ function WorkspaceDock({
|
|
|
7851
7832
|
return () => window.removeEventListener("keydown", onKey);
|
|
7852
7833
|
}, [maximized, narrow, collapsed, collapse]);
|
|
7853
7834
|
if (narrow) {
|
|
7854
|
-
return /* @__PURE__ */
|
|
7855
|
-
/* @__PURE__ */
|
|
7835
|
+
return /* @__PURE__ */ jsxs8("div", { ref: rootRef, className: cn("relative flex h-full min-h-0 w-full min-w-0", className), children: [
|
|
7836
|
+
/* @__PURE__ */ jsx10(
|
|
7856
7837
|
"div",
|
|
7857
7838
|
{
|
|
7858
7839
|
"data-workspace-primary": true,
|
|
@@ -7862,7 +7843,7 @@ function WorkspaceDock({
|
|
|
7862
7843
|
children: primary
|
|
7863
7844
|
}
|
|
7864
7845
|
),
|
|
7865
|
-
/* @__PURE__ */
|
|
7846
|
+
/* @__PURE__ */ jsx10(
|
|
7866
7847
|
"div",
|
|
7867
7848
|
{
|
|
7868
7849
|
"data-workspace-surface": true,
|
|
@@ -7880,7 +7861,7 @@ function WorkspaceDock({
|
|
|
7880
7861
|
paddingTop: "env(safe-area-inset-top)",
|
|
7881
7862
|
paddingBottom: "env(safe-area-inset-bottom)"
|
|
7882
7863
|
},
|
|
7883
|
-
children: /* @__PURE__ */
|
|
7864
|
+
children: /* @__PURE__ */ jsx10(
|
|
7884
7865
|
DockChrome,
|
|
7885
7866
|
{
|
|
7886
7867
|
tabs,
|
|
@@ -7888,12 +7869,12 @@ function WorkspaceDock({
|
|
|
7888
7869
|
onTab: setTab,
|
|
7889
7870
|
leading: mobileLeadingControl,
|
|
7890
7871
|
accessory: headerAccessory,
|
|
7891
|
-
controls: /* @__PURE__ */
|
|
7872
|
+
controls: /* @__PURE__ */ jsx10(ChromeButton, { onClick: collapse, title: "Hide workspace", label: "Hide workspace", children: /* @__PURE__ */ jsx10(XIcon, { className: "size-4" }) })
|
|
7892
7873
|
}
|
|
7893
7874
|
)
|
|
7894
7875
|
}
|
|
7895
7876
|
),
|
|
7896
|
-
collapsed && !hostControlled ? /* @__PURE__ */
|
|
7877
|
+
collapsed && !hostControlled ? /* @__PURE__ */ jsx10(
|
|
7897
7878
|
"button",
|
|
7898
7879
|
{
|
|
7899
7880
|
ref: reopenRef,
|
|
@@ -7903,34 +7884,34 @@ function WorkspaceDock({
|
|
|
7903
7884
|
"aria-label": "Open workspace",
|
|
7904
7885
|
className: "absolute right-3 top-3 z-30 inline-flex size-11 items-center justify-center rounded-og-md border border-og-border bg-og-surface-1 text-og-fg-muted shadow-lg transition-colors hover:border-og-border-strong hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
|
|
7905
7886
|
style: { marginTop: "env(safe-area-inset-top)" },
|
|
7906
|
-
children: /* @__PURE__ */
|
|
7887
|
+
children: /* @__PURE__ */ jsx10(ChevronsLeftRightIcon, { className: "size-4", "aria-hidden": true })
|
|
7907
7888
|
}
|
|
7908
7889
|
) : null
|
|
7909
7890
|
] });
|
|
7910
7891
|
}
|
|
7911
|
-
const dockChrome = /* @__PURE__ */
|
|
7892
|
+
const dockChrome = /* @__PURE__ */ jsx10(
|
|
7912
7893
|
DockChrome,
|
|
7913
7894
|
{
|
|
7914
7895
|
tabs,
|
|
7915
7896
|
current,
|
|
7916
7897
|
onTab: setTab,
|
|
7917
7898
|
accessory: headerAccessory,
|
|
7918
|
-
controls: /* @__PURE__ */
|
|
7919
|
-
/* @__PURE__ */
|
|
7899
|
+
controls: /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
7900
|
+
/* @__PURE__ */ jsx10(
|
|
7920
7901
|
ChromeButton,
|
|
7921
7902
|
{
|
|
7922
7903
|
onClick: () => setMaximized((m) => !m),
|
|
7923
7904
|
title: maximized ? "Restore (Esc)" : "Maximize",
|
|
7924
7905
|
label: maximized ? "Restore dock" : "Maximize dock",
|
|
7925
|
-
children: maximized ? /* @__PURE__ */
|
|
7906
|
+
children: maximized ? /* @__PURE__ */ jsx10(Minimize2Icon, { className: "size-3.5" }) : /* @__PURE__ */ jsx10(Maximize2Icon, { className: "size-3.5" })
|
|
7926
7907
|
}
|
|
7927
7908
|
),
|
|
7928
|
-
hostControlled && !showCollapseControl ? null : /* @__PURE__ */
|
|
7909
|
+
hostControlled && !showCollapseControl ? null : /* @__PURE__ */ jsx10(ChromeButton, { onClick: collapse, title: "Hide workspace", label: "Hide workspace", children: /* @__PURE__ */ jsx10(PanelRightCloseIcon, { className: "size-3.5" }) })
|
|
7929
7910
|
] })
|
|
7930
7911
|
}
|
|
7931
7912
|
);
|
|
7932
|
-
return /* @__PURE__ */
|
|
7933
|
-
/* @__PURE__ */
|
|
7913
|
+
return /* @__PURE__ */ jsxs8("div", { ref: rootRef, className: cn("relative flex h-full min-h-0 w-full min-w-0", className), children: [
|
|
7914
|
+
/* @__PURE__ */ jsxs8(
|
|
7934
7915
|
Group2,
|
|
7935
7916
|
{
|
|
7936
7917
|
orientation: "horizontal",
|
|
@@ -7938,7 +7919,7 @@ function WorkspaceDock({
|
|
|
7938
7919
|
...expandedDefaultLayout ? { defaultLayout: expandedDefaultLayout } : {},
|
|
7939
7920
|
onLayoutChanged: persistExpandedLayout,
|
|
7940
7921
|
children: [
|
|
7941
|
-
/* @__PURE__ */
|
|
7922
|
+
/* @__PURE__ */ jsx10(Panel2, { id: "primary", minSize: "30%", className: "min-h-0 min-w-0", children: /* @__PURE__ */ jsx10(
|
|
7942
7923
|
"div",
|
|
7943
7924
|
{
|
|
7944
7925
|
"data-workspace-primary": true,
|
|
@@ -7948,8 +7929,8 @@ function WorkspaceDock({
|
|
|
7948
7929
|
children: primary
|
|
7949
7930
|
}
|
|
7950
7931
|
) }),
|
|
7951
|
-
!collapsed && /* @__PURE__ */
|
|
7952
|
-
/* @__PURE__ */
|
|
7932
|
+
!collapsed && /* @__PURE__ */ jsx10(Separator2, { className: "group relative z-10 w-1.5 shrink-0 outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-og-accent max-[1023px]:-mx-[19px] max-[1023px]:w-11 pointer-coarse:-mx-[19px] pointer-coarse:w-11", children: /* @__PURE__ */ jsx10("span", { className: "absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-og-border transition-colors group-hover:bg-og-accent group-focus-visible:bg-og-accent group-data-[separator-state=dragging]:bg-og-accent" }) }),
|
|
7933
|
+
/* @__PURE__ */ jsx10(
|
|
7953
7934
|
Panel2,
|
|
7954
7935
|
{
|
|
7955
7936
|
id: "dock",
|
|
@@ -7967,7 +7948,7 @@ function WorkspaceDock({
|
|
|
7967
7948
|
}
|
|
7968
7949
|
},
|
|
7969
7950
|
className: "min-h-0 min-w-0",
|
|
7970
|
-
children: /* @__PURE__ */
|
|
7951
|
+
children: /* @__PURE__ */ jsx10(
|
|
7971
7952
|
"div",
|
|
7972
7953
|
{
|
|
7973
7954
|
"data-workspace-surface": true,
|
|
@@ -7988,7 +7969,7 @@ function WorkspaceDock({
|
|
|
7988
7969
|
]
|
|
7989
7970
|
}
|
|
7990
7971
|
),
|
|
7991
|
-
collapsed && !maximized && !hostControlled && /* @__PURE__ */
|
|
7972
|
+
collapsed && !maximized && !hostControlled && /* @__PURE__ */ jsx10(
|
|
7992
7973
|
"button",
|
|
7993
7974
|
{
|
|
7994
7975
|
ref: reopenRef,
|
|
@@ -7996,7 +7977,7 @@ function WorkspaceDock({
|
|
|
7996
7977
|
onClick: expand,
|
|
7997
7978
|
title: "Open workspace",
|
|
7998
7979
|
className: "absolute inset-y-0 right-0 flex w-6 shrink-0 items-center justify-center border-l border-og-border bg-og-surface-1 text-og-fg-subtle hover:text-og-fg",
|
|
7999
|
-
children: /* @__PURE__ */
|
|
7980
|
+
children: /* @__PURE__ */ jsx10(ChevronsLeftRightIcon, { className: "size-3.5" })
|
|
8000
7981
|
}
|
|
8001
7982
|
)
|
|
8002
7983
|
] });
|
|
@@ -8007,7 +7988,7 @@ function ChromeButton({
|
|
|
8007
7988
|
label,
|
|
8008
7989
|
children
|
|
8009
7990
|
}) {
|
|
8010
|
-
return /* @__PURE__ */
|
|
7991
|
+
return /* @__PURE__ */ jsx10(
|
|
8011
7992
|
"button",
|
|
8012
7993
|
{
|
|
8013
7994
|
type: "button",
|
|
@@ -8028,11 +8009,11 @@ function DockChrome({
|
|
|
8028
8009
|
controls
|
|
8029
8010
|
}) {
|
|
8030
8011
|
const chromeRef = useRef16(null);
|
|
8031
|
-
const [compact, setCompact] =
|
|
8012
|
+
const [compact, setCompact] = useState16(false);
|
|
8032
8013
|
const active = tabs.find((t) => t.id === current) ?? tabs[0];
|
|
8033
8014
|
const tabsetId = useId3();
|
|
8034
8015
|
const tabRefs = useRef16([]);
|
|
8035
|
-
const [visitedTabs, setVisitedTabs] =
|
|
8016
|
+
const [visitedTabs, setVisitedTabs] = useState16(() => /* @__PURE__ */ new Set());
|
|
8036
8017
|
const activeId = active?.id ?? "";
|
|
8037
8018
|
useDockLayoutEffect(() => {
|
|
8038
8019
|
const node = chromeRef.current;
|
|
@@ -8079,7 +8060,7 @@ function DockChrome({
|
|
|
8079
8060
|
event.preventDefault();
|
|
8080
8061
|
activateTab(nextIndex);
|
|
8081
8062
|
};
|
|
8082
|
-
return /* @__PURE__ */
|
|
8063
|
+
return /* @__PURE__ */ jsxs8(
|
|
8083
8064
|
"div",
|
|
8084
8065
|
{
|
|
8085
8066
|
ref: chromeRef,
|
|
@@ -8087,13 +8068,13 @@ function DockChrome({
|
|
|
8087
8068
|
"data-compact": compact ? "true" : void 0,
|
|
8088
8069
|
className: "flex h-full min-h-0 min-w-0 flex-col",
|
|
8089
8070
|
children: [
|
|
8090
|
-
/* @__PURE__ */
|
|
8091
|
-
/* @__PURE__ */
|
|
8092
|
-
/* @__PURE__ */
|
|
8093
|
-
/* @__PURE__ */
|
|
8071
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-h-10 shrink-0 items-center gap-2 border-b border-og-border px-2 max-[1023px]:min-h-12", children: [
|
|
8072
|
+
/* @__PURE__ */ jsx10("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: leading ?? /* @__PURE__ */ jsx10("span", { className: "hidden truncate text-og-sm font-semibold text-og-fg max-[1023px]:inline", children: "Workspace" }) }),
|
|
8073
|
+
/* @__PURE__ */ jsx10("div", { className: "min-w-0 shrink text-og-fg-muted", children: accessory }),
|
|
8074
|
+
/* @__PURE__ */ jsx10("div", { className: "flex shrink-0 items-center gap-0.5 text-og-fg-subtle", children: controls })
|
|
8094
8075
|
] }),
|
|
8095
|
-
/* @__PURE__ */
|
|
8096
|
-
/* @__PURE__ */
|
|
8076
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-h-0 min-w-0 flex-1", children: [
|
|
8077
|
+
/* @__PURE__ */ jsx10(
|
|
8097
8078
|
"div",
|
|
8098
8079
|
{
|
|
8099
8080
|
className: cn(
|
|
@@ -8105,7 +8086,7 @@ function DockChrome({
|
|
|
8105
8086
|
"aria-orientation": "vertical",
|
|
8106
8087
|
children: tabs.map((tab, index) => {
|
|
8107
8088
|
const tabName = tab.ariaLabel ?? (typeof tab.label === "string" ? tab.label : tab.id);
|
|
8108
|
-
return /* @__PURE__ */
|
|
8089
|
+
return /* @__PURE__ */ jsxs8(
|
|
8109
8090
|
"button",
|
|
8110
8091
|
{
|
|
8111
8092
|
ref: (node) => {
|
|
@@ -8127,7 +8108,7 @@ function DockChrome({
|
|
|
8127
8108
|
tab.id === current ? "bg-og-accent-soft text-og-fg shadow-[inset_2px_0_0_var(--og-color-accent)]" : "text-og-fg-subtle hover:bg-og-surface-2 hover:text-og-fg"
|
|
8128
8109
|
),
|
|
8129
8110
|
children: [
|
|
8130
|
-
tab.icon ? /* @__PURE__ */
|
|
8111
|
+
tab.icon ? /* @__PURE__ */ jsx10(
|
|
8131
8112
|
"span",
|
|
8132
8113
|
{
|
|
8133
8114
|
className: "flex size-4 shrink-0 items-center justify-center [&>svg]:size-4",
|
|
@@ -8135,8 +8116,8 @@ function DockChrome({
|
|
|
8135
8116
|
children: tab.icon
|
|
8136
8117
|
}
|
|
8137
8118
|
) : null,
|
|
8138
|
-
!compact || !tab.icon ? /* @__PURE__ */
|
|
8139
|
-
tab.badge ? /* @__PURE__ */
|
|
8119
|
+
!compact || !tab.icon ? /* @__PURE__ */ jsx10("span", { "data-contrast-audited": true, className: "min-w-0 flex-1 truncate", children: tab.label }) : null,
|
|
8120
|
+
tab.badge ? /* @__PURE__ */ jsx10(
|
|
8140
8121
|
"span",
|
|
8141
8122
|
{
|
|
8142
8123
|
className: cn("shrink-0", compact && "absolute -right-0.5 -top-0.5 scale-90"),
|
|
@@ -8150,10 +8131,10 @@ function DockChrome({
|
|
|
8150
8131
|
})
|
|
8151
8132
|
}
|
|
8152
8133
|
),
|
|
8153
|
-
/* @__PURE__ */
|
|
8134
|
+
/* @__PURE__ */ jsx10("div", { className: "min-h-0 min-w-0 flex-1 overflow-hidden", children: tabs.length > 0 ? tabs.map((tab, index) => {
|
|
8154
8135
|
const selected = tab.id === activeId;
|
|
8155
8136
|
const shouldMount = selected || visitedTabs.has(tab.id);
|
|
8156
|
-
return /* @__PURE__ */
|
|
8137
|
+
return /* @__PURE__ */ jsx10(
|
|
8157
8138
|
"div",
|
|
8158
8139
|
{
|
|
8159
8140
|
id: `${tabsetId}-panel-${index}`,
|
|
@@ -8165,7 +8146,7 @@ function DockChrome({
|
|
|
8165
8146
|
},
|
|
8166
8147
|
tab.id
|
|
8167
8148
|
);
|
|
8168
|
-
}) : /* @__PURE__ */
|
|
8149
|
+
}) : /* @__PURE__ */ jsx10("div", { className: "h-full min-h-0 min-w-0", "aria-label": "Workspace", role: "tabpanel" }) })
|
|
8169
8150
|
] })
|
|
8170
8151
|
]
|
|
8171
8152
|
}
|
|
@@ -8176,11 +8157,11 @@ function DockChrome({
|
|
|
8176
8157
|
import {
|
|
8177
8158
|
lazy as lazy2,
|
|
8178
8159
|
Suspense as Suspense2,
|
|
8179
|
-
useCallback as
|
|
8160
|
+
useCallback as useCallback22,
|
|
8180
8161
|
useEffect as useEffect20,
|
|
8181
8162
|
useMemo as useMemo15,
|
|
8182
8163
|
useRef as useRef17,
|
|
8183
|
-
useState as
|
|
8164
|
+
useState as useState17
|
|
8184
8165
|
} from "react";
|
|
8185
8166
|
import {
|
|
8186
8167
|
CircleCheckIcon,
|
|
@@ -8194,9 +8175,9 @@ import {
|
|
|
8194
8175
|
SquareTerminalIcon,
|
|
8195
8176
|
TriangleAlertIcon as TriangleAlertIcon2
|
|
8196
8177
|
} from "lucide-react";
|
|
8197
|
-
import { jsx as
|
|
8178
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
8198
8179
|
var LazyBrowserViewer = lazy2(async () => {
|
|
8199
|
-
const { BrowserViewer } = await import("./browser-viewer-
|
|
8180
|
+
const { BrowserViewer } = await import("./browser-viewer-LGH4IP47.js");
|
|
8200
8181
|
return { default: BrowserViewer };
|
|
8201
8182
|
});
|
|
8202
8183
|
var LazyComputerViewer = lazy2(async () => {
|
|
@@ -8229,24 +8210,12 @@ function sourceDrivenDefaultTab(hasChanges, changesEnabled, filesEnabled) {
|
|
|
8229
8210
|
if (changesEnabled) return WORKBENCH_TAB_CHANGES;
|
|
8230
8211
|
return null;
|
|
8231
8212
|
}
|
|
8232
|
-
function captureDegradedMessage(reason) {
|
|
8233
|
-
switch (reason) {
|
|
8234
|
-
case "repository_discovery_timed_out":
|
|
8235
|
-
return "Workspace capture is incomplete because repository discovery timed out. Live files remain authoritative.";
|
|
8236
|
-
case "repository_discovery_result_limit_exceeded":
|
|
8237
|
-
return "Workspace capture is incomplete because the repository limit was exceeded. Live files remain authoritative.";
|
|
8238
|
-
case "repository_read_unavailable":
|
|
8239
|
-
return "Workspace capture is incomplete because repository changes could not be read. Live files remain authoritative.";
|
|
8240
|
-
default:
|
|
8241
|
-
return "Workspace capture is incomplete because repository discovery failed. Live files remain authoritative.";
|
|
8242
|
-
}
|
|
8243
|
-
}
|
|
8244
8213
|
function WorkbenchSurfaceLoading({ name }) {
|
|
8245
|
-
return /* @__PURE__ */
|
|
8214
|
+
return /* @__PURE__ */ jsx11(
|
|
8246
8215
|
CenteredState,
|
|
8247
8216
|
{
|
|
8248
|
-
icon: /* @__PURE__ */
|
|
8249
|
-
children: /* @__PURE__ */
|
|
8217
|
+
icon: /* @__PURE__ */ jsx11(LoaderCircleIcon2, { className: "size-5 animate-spin motion-reduce:animate-none", "aria-hidden": true }),
|
|
8218
|
+
children: /* @__PURE__ */ jsxs9("p", { className: "text-og-sm font-medium text-og-fg", children: [
|
|
8250
8219
|
"Opening ",
|
|
8251
8220
|
name
|
|
8252
8221
|
] })
|
|
@@ -8357,7 +8326,7 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8357
8326
|
const terminalEnabled = surfaceSet.has(WORKBENCH_TAB_TERMINAL);
|
|
8358
8327
|
const browserEnabled = surfaceSet.has(WORKBENCH_TAB_BROWSER);
|
|
8359
8328
|
const desktopEnabled = surfaceSet.has(WORKBENCH_TAB_DESKTOP);
|
|
8360
|
-
const createLinkedComputer =
|
|
8329
|
+
const createLinkedComputer = useCallback22(
|
|
8361
8330
|
async (name, placement) => {
|
|
8362
8331
|
const response = await client.createComputerSession(workspaceId, {
|
|
8363
8332
|
operationId: crypto.randomUUID(),
|
|
@@ -8382,13 +8351,13 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8382
8351
|
const filesActive = resolvedActiveTab === WORKBENCH_TAB_FILES;
|
|
8383
8352
|
const turnInFlight = workspaceTurnInFlight(events);
|
|
8384
8353
|
const surfaceIdentity = WORKBENCH_SURFACES.filter((surface) => surfaceSet.has(surface)).join(",");
|
|
8385
|
-
const [storedWarmIntents, setStoredWarmIntents] =
|
|
8354
|
+
const [storedWarmIntents, setStoredWarmIntents] = useState17(
|
|
8386
8355
|
() => emptyWarmIntents(sessionId)
|
|
8387
8356
|
);
|
|
8388
8357
|
const warmIntents = storedWarmIntents.sessionId === sessionId ? storedWarmIntents : emptyWarmIntents(sessionId);
|
|
8389
8358
|
const { warmTerminal, warmFiles } = warmIntents;
|
|
8390
8359
|
const filesWarmRequested = warmFiles || Boolean(requestedFilePath);
|
|
8391
|
-
const requestWarmIntent =
|
|
8360
|
+
const requestWarmIntent = useCallback22(
|
|
8392
8361
|
(intent) => {
|
|
8393
8362
|
setStoredWarmIntents((previous) => {
|
|
8394
8363
|
const current = previous.sessionId === sessionId ? previous : emptyWarmIntents(sessionId);
|
|
@@ -8454,19 +8423,6 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8454
8423
|
if (advertised.length > 0) return advertised;
|
|
8455
8424
|
return captureState.capture?.repos.map((repo) => repo.root) ?? [];
|
|
8456
8425
|
}, [capabilities?.Git.repos, captureState.capture]);
|
|
8457
|
-
const notifiedCaptureDegradedReason = useRef17({
|
|
8458
|
-
sessionId,
|
|
8459
|
-
reason: null
|
|
8460
|
-
});
|
|
8461
|
-
if (notifiedCaptureDegradedReason.current.sessionId !== sessionId) {
|
|
8462
|
-
notifiedCaptureDegradedReason.current = { sessionId, reason: null };
|
|
8463
|
-
}
|
|
8464
|
-
useEffect20(() => {
|
|
8465
|
-
const reason = captureState.degradedReason;
|
|
8466
|
-
if (!reason || notifiedCaptureDegradedReason.current.reason === reason) return;
|
|
8467
|
-
notifiedCaptureDegradedReason.current = { sessionId, reason };
|
|
8468
|
-
onNotify?.({ kind: "error", message: captureDegradedMessage(reason) });
|
|
8469
|
-
}, [sessionId, captureState.degradedReason, onNotify]);
|
|
8470
8426
|
const files = useSandboxFiles(sessionId, {
|
|
8471
8427
|
events,
|
|
8472
8428
|
// No passive Channel-A reads while cold, even after a conclusive capture
|
|
@@ -8491,10 +8447,10 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8491
8447
|
message: `Could not ${op}: ${error.message}`
|
|
8492
8448
|
})
|
|
8493
8449
|
});
|
|
8494
|
-
const [storedChangesComparison, setStoredChangesComparison] =
|
|
8450
|
+
const [storedChangesComparison, setStoredChangesComparison] = useState17(null);
|
|
8495
8451
|
const captureSupportsBranch = captureState.capture !== null && captureState.capture.repos.length > 0 && captureState.capture.repos.every((repo) => repo.branchDiff !== void 0);
|
|
8496
8452
|
const changesComparison = storedChangesComparison?.sessionId === sessionId ? storedChangesComparison.value : liveWorkspaceExpected || captureSupportsBranch ? "branch" : "working";
|
|
8497
|
-
const setChangesComparison =
|
|
8453
|
+
const setChangesComparison = useCallback22(
|
|
8498
8454
|
(value) => setStoredChangesComparison({ sessionId, value }),
|
|
8499
8455
|
[sessionId]
|
|
8500
8456
|
);
|
|
@@ -8516,7 +8472,7 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8516
8472
|
setStoredChangesComparison({ sessionId, value: "working" });
|
|
8517
8473
|
}
|
|
8518
8474
|
}, [changesComparison, git.error, sessionId, storedChangesComparison?.sessionId]);
|
|
8519
|
-
const [xtermTheme, setXtermTheme] =
|
|
8475
|
+
const [xtermTheme, setXtermTheme] = useState17(void 0);
|
|
8520
8476
|
useEffect20(() => {
|
|
8521
8477
|
if (!terminalEnabled || typeof document === "undefined") return;
|
|
8522
8478
|
const derive = () => setXtermTheme(xtermThemeFromTokens());
|
|
@@ -8570,15 +8526,16 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8570
8526
|
list.push({
|
|
8571
8527
|
id: WORKBENCH_TAB_CHANGES,
|
|
8572
8528
|
label: "Changes",
|
|
8573
|
-
icon: /* @__PURE__ */
|
|
8574
|
-
badge: dirtyCount > 0 ? /* @__PURE__ */
|
|
8575
|
-
content: /* @__PURE__ */
|
|
8529
|
+
icon: /* @__PURE__ */ jsx11(GitCompareArrowsIcon, {}),
|
|
8530
|
+
badge: dirtyCount > 0 ? /* @__PURE__ */ jsx11(DirtyBadge, { count: dirtyCount }) : void 0,
|
|
8531
|
+
content: /* @__PURE__ */ jsx11(
|
|
8576
8532
|
ChangesTabBody,
|
|
8577
8533
|
{
|
|
8578
8534
|
git,
|
|
8579
8535
|
comparison: changesComparison,
|
|
8580
8536
|
onComparisonChange: setChangesComparison,
|
|
8581
8537
|
captureAvailable,
|
|
8538
|
+
captureDegraded: captureState.degradedReason !== null,
|
|
8582
8539
|
captureRevision: captureState.revision,
|
|
8583
8540
|
capturePending,
|
|
8584
8541
|
liveWorkspaceExpected,
|
|
@@ -8600,8 +8557,8 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8600
8557
|
list.push({
|
|
8601
8558
|
id: WORKBENCH_TAB_FILES,
|
|
8602
8559
|
label: "Files",
|
|
8603
|
-
icon: /* @__PURE__ */
|
|
8604
|
-
content: /* @__PURE__ */
|
|
8560
|
+
icon: /* @__PURE__ */ jsx11(FileCode2Icon2, {}),
|
|
8561
|
+
content: /* @__PURE__ */ jsx11(
|
|
8605
8562
|
SandboxFiles,
|
|
8606
8563
|
{
|
|
8607
8564
|
files,
|
|
@@ -8637,8 +8594,8 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8637
8594
|
list.push({
|
|
8638
8595
|
id: WORKBENCH_TAB_TERMINAL,
|
|
8639
8596
|
label: "Terminal",
|
|
8640
|
-
icon: /* @__PURE__ */
|
|
8641
|
-
content: /* @__PURE__ */
|
|
8597
|
+
icon: /* @__PURE__ */ jsx11(SquareTerminalIcon, {}),
|
|
8598
|
+
content: /* @__PURE__ */ jsx11("div", { className: "h-full bg-og-bg p-1", children: /* @__PURE__ */ jsx11(
|
|
8642
8599
|
SandboxTerminal,
|
|
8643
8600
|
{
|
|
8644
8601
|
result: terminal,
|
|
@@ -8658,8 +8615,8 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8658
8615
|
list.push({
|
|
8659
8616
|
id: WORKBENCH_TAB_BROWSER,
|
|
8660
8617
|
label: "Browser",
|
|
8661
|
-
icon: /* @__PURE__ */
|
|
8662
|
-
content: /* @__PURE__ */
|
|
8618
|
+
icon: /* @__PURE__ */ jsx11(Globe2Icon, {}),
|
|
8619
|
+
content: /* @__PURE__ */ jsx11(Suspense2, { fallback: /* @__PURE__ */ jsx11(WorkbenchSurfaceLoading, { name: "Browser" }), children: /* @__PURE__ */ jsx11(
|
|
8663
8620
|
LazyBrowserViewer,
|
|
8664
8621
|
{
|
|
8665
8622
|
client,
|
|
@@ -8683,8 +8640,8 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8683
8640
|
list.push({
|
|
8684
8641
|
id: WORKBENCH_TAB_DESKTOP,
|
|
8685
8642
|
label: "Desktop",
|
|
8686
|
-
icon: /* @__PURE__ */
|
|
8687
|
-
content: /* @__PURE__ */
|
|
8643
|
+
icon: /* @__PURE__ */ jsx11(MonitorIcon, {}),
|
|
8644
|
+
content: /* @__PURE__ */ jsx11(Suspense2, { fallback: /* @__PURE__ */ jsx11(WorkbenchSurfaceLoading, { name: "Desktop" }), children: /* @__PURE__ */ jsx11(
|
|
8688
8645
|
LazyComputerViewer,
|
|
8689
8646
|
{
|
|
8690
8647
|
client,
|
|
@@ -8712,6 +8669,7 @@ function useSandboxWorkspaceTabs(options) {
|
|
|
8712
8669
|
browserEnabled,
|
|
8713
8670
|
desktopEnabled,
|
|
8714
8671
|
captureAvailable,
|
|
8672
|
+
captureState.degradedReason,
|
|
8715
8673
|
dirtyCount,
|
|
8716
8674
|
warmTerminal,
|
|
8717
8675
|
requestedFilePath,
|
|
@@ -8798,9 +8756,9 @@ function SandboxWorkspace(props) {
|
|
|
8798
8756
|
maxSize,
|
|
8799
8757
|
className
|
|
8800
8758
|
} = props;
|
|
8801
|
-
const [storedSelection, setStoredSelection] =
|
|
8802
|
-
const [requestedFile, setRequestedFile] =
|
|
8803
|
-
const [requestedComputer, setRequestedComputer] =
|
|
8759
|
+
const [storedSelection, setStoredSelection] = useState17(null);
|
|
8760
|
+
const [requestedFile, setRequestedFile] = useState17(null);
|
|
8761
|
+
const [requestedComputer, setRequestedComputer] = useState17(null);
|
|
8804
8762
|
const nextFileRequestId = useRef17(0);
|
|
8805
8763
|
const nextComputerRequestId = useRef17(0);
|
|
8806
8764
|
const selectedTab = storedSelection?.sessionId === sessionId ? storedSelection.tab : null;
|
|
@@ -8826,7 +8784,7 @@ function SandboxWorkspace(props) {
|
|
|
8826
8784
|
onCollapsedChange
|
|
8827
8785
|
]);
|
|
8828
8786
|
const activeTabHint = selectedTab ?? initialTab ?? leadingTabs?.[0]?.id ?? null;
|
|
8829
|
-
const openFile =
|
|
8787
|
+
const openFile = useCallback22(
|
|
8830
8788
|
(path, line) => {
|
|
8831
8789
|
setRequestedFile({
|
|
8832
8790
|
sessionId,
|
|
@@ -8848,7 +8806,7 @@ function SandboxWorkspace(props) {
|
|
|
8848
8806
|
handledOpenFileRequestId.current = openFileRequest.requestId;
|
|
8849
8807
|
openFile(openFileRequest.path, openFileRequest.line);
|
|
8850
8808
|
}, [openFile, openFileRequest]);
|
|
8851
|
-
const openComputer =
|
|
8809
|
+
const openComputer = useCallback22(
|
|
8852
8810
|
(computerSessionId) => {
|
|
8853
8811
|
nextComputerRequestId.current += 1;
|
|
8854
8812
|
setRequestedComputer({
|
|
@@ -8897,7 +8855,7 @@ function SandboxWorkspace(props) {
|
|
|
8897
8855
|
const tabs = [...leadingTabs ?? [], ...workbenchTabs, ...trailingTabs ?? []];
|
|
8898
8856
|
const preferredTab = selectedTab ?? defaultTab;
|
|
8899
8857
|
const activeTab = preferredTab && tabs.some((tab) => tab.id === preferredTab) ? preferredTab : tabs[0]?.id;
|
|
8900
|
-
const selectTab =
|
|
8858
|
+
const selectTab = useCallback22(
|
|
8901
8859
|
(tab) => {
|
|
8902
8860
|
setStoredSelection({ sessionId, tab });
|
|
8903
8861
|
onActiveTabChange?.(tab);
|
|
@@ -8908,7 +8866,7 @@ function SandboxWorkspace(props) {
|
|
|
8908
8866
|
if (selectedTab !== null || defaultTab === null) return;
|
|
8909
8867
|
setStoredSelection({ sessionId, tab: defaultTab });
|
|
8910
8868
|
}, [defaultTab, selectedTab, sessionId]);
|
|
8911
|
-
return /* @__PURE__ */
|
|
8869
|
+
return /* @__PURE__ */ jsx11(
|
|
8912
8870
|
WorkspaceDock,
|
|
8913
8871
|
{
|
|
8914
8872
|
primary,
|
|
@@ -8916,7 +8874,7 @@ function SandboxWorkspace(props) {
|
|
|
8916
8874
|
...activeTab !== void 0 ? { activeTab } : {},
|
|
8917
8875
|
onActiveTabChange: selectTab,
|
|
8918
8876
|
...machine.enabled ? {
|
|
8919
|
-
headerAccessory: /* @__PURE__ */
|
|
8877
|
+
headerAccessory: /* @__PURE__ */ jsx11(MachineStateChip, { chip: machine.chip })
|
|
8920
8878
|
} : {},
|
|
8921
8879
|
...mobileLeadingControl !== void 0 ? { mobileLeadingControl } : {},
|
|
8922
8880
|
...collapsed !== void 0 ? { collapsed } : {},
|
|
@@ -8931,7 +8889,7 @@ function SandboxWorkspace(props) {
|
|
|
8931
8889
|
);
|
|
8932
8890
|
}
|
|
8933
8891
|
function DirtyBadge({ count }) {
|
|
8934
|
-
return /* @__PURE__ */
|
|
8892
|
+
return /* @__PURE__ */ jsx11("span", { className: "rounded-og-xs bg-og-accent-soft px-1 text-og-xs text-og-fg-muted", children: count });
|
|
8935
8893
|
}
|
|
8936
8894
|
function chipDotClass(state) {
|
|
8937
8895
|
if (state === "live") return "bg-og-status-running";
|
|
@@ -8939,27 +8897,27 @@ function chipDotClass(state) {
|
|
|
8939
8897
|
return "bg-og-fg-subtle";
|
|
8940
8898
|
}
|
|
8941
8899
|
function MachineStateChip({ chip }) {
|
|
8942
|
-
return /* @__PURE__ */
|
|
8900
|
+
return /* @__PURE__ */ jsxs9(
|
|
8943
8901
|
"div",
|
|
8944
8902
|
{
|
|
8945
8903
|
role: "status",
|
|
8946
8904
|
"aria-label": `Machine: ${chip.label}`,
|
|
8947
8905
|
className: "inline-flex min-h-7 min-w-0 items-center gap-1.5 px-2 py-1 text-og-xs font-medium text-og-fg-muted max-[1023px]:min-h-11 pointer-coarse:min-h-11",
|
|
8948
8906
|
children: [
|
|
8949
|
-
/* @__PURE__ */
|
|
8907
|
+
/* @__PURE__ */ jsx11(
|
|
8950
8908
|
"span",
|
|
8951
8909
|
{
|
|
8952
8910
|
className: cn("size-1.5 shrink-0 rounded-full", chipDotClass(chip.state)),
|
|
8953
8911
|
"aria-hidden": true
|
|
8954
8912
|
}
|
|
8955
8913
|
),
|
|
8956
|
-
/* @__PURE__ */
|
|
8914
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 max-w-[11rem] truncate", children: chip.label })
|
|
8957
8915
|
]
|
|
8958
8916
|
}
|
|
8959
8917
|
);
|
|
8960
8918
|
}
|
|
8961
8919
|
function DockActionButton({ onClick, children }) {
|
|
8962
|
-
return /* @__PURE__ */
|
|
8920
|
+
return /* @__PURE__ */ jsx11(
|
|
8963
8921
|
"button",
|
|
8964
8922
|
{
|
|
8965
8923
|
type: "button",
|
|
@@ -8974,12 +8932,12 @@ function ChangesTabBody({
|
|
|
8974
8932
|
onComparisonChange,
|
|
8975
8933
|
...props
|
|
8976
8934
|
}) {
|
|
8977
|
-
return /* @__PURE__ */
|
|
8978
|
-
/* @__PURE__ */
|
|
8935
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
8936
|
+
/* @__PURE__ */ jsx11("div", { className: "flex shrink-0 items-center gap-1 border-b border-og-border bg-og-surface-1 px-2 py-1.5", children: [
|
|
8979
8937
|
["branch", "Branch"],
|
|
8980
8938
|
["working", "Uncommitted"],
|
|
8981
8939
|
["staged", "Staged"]
|
|
8982
|
-
].map(([value, label]) => /* @__PURE__ */
|
|
8940
|
+
].map(([value, label]) => /* @__PURE__ */ jsx11(
|
|
8983
8941
|
"button",
|
|
8984
8942
|
{
|
|
8985
8943
|
type: "button",
|
|
@@ -8993,13 +8951,14 @@ function ChangesTabBody({
|
|
|
8993
8951
|
},
|
|
8994
8952
|
value
|
|
8995
8953
|
)) }),
|
|
8996
|
-
/* @__PURE__ */
|
|
8954
|
+
/* @__PURE__ */ jsx11("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx11(ChangesTabContent, { comparison, ...props }) })
|
|
8997
8955
|
] });
|
|
8998
8956
|
}
|
|
8999
8957
|
function ChangesTabContent({
|
|
9000
8958
|
git,
|
|
9001
8959
|
comparison,
|
|
9002
8960
|
captureAvailable,
|
|
8961
|
+
captureDegraded,
|
|
9003
8962
|
captureRevision,
|
|
9004
8963
|
capturePending,
|
|
9005
8964
|
liveWorkspaceExpected,
|
|
@@ -9012,8 +8971,8 @@ function ChangesTabContent({
|
|
|
9012
8971
|
}) {
|
|
9013
8972
|
const diff = git.diff;
|
|
9014
8973
|
if (diff.length > 0) {
|
|
9015
|
-
return /* @__PURE__ */
|
|
9016
|
-
git.error ? /* @__PURE__ */
|
|
8974
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
8975
|
+
git.error ? /* @__PURE__ */ jsxs9(
|
|
9017
8976
|
"div",
|
|
9018
8977
|
{
|
|
9019
8978
|
role: "status",
|
|
@@ -9021,9 +8980,9 @@ function ChangesTabContent({
|
|
|
9021
8980
|
"data-opengeni-changes-degraded": true,
|
|
9022
8981
|
className: "flex shrink-0 items-center gap-2 border-b border-og-status-running/30 bg-og-status-running/10 px-2 py-1.5 text-og-xs text-og-fg-muted",
|
|
9023
8982
|
children: [
|
|
9024
|
-
/* @__PURE__ */
|
|
9025
|
-
/* @__PURE__ */
|
|
9026
|
-
/* @__PURE__ */
|
|
8983
|
+
/* @__PURE__ */ jsx11(TriangleAlertIcon2, { className: "size-3.5 shrink-0 text-og-status-running", "aria-hidden": true }),
|
|
8984
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 flex-1", children: git.source === "capture" ? "Live changes are temporarily unavailable. Showing the latest captured revision." : "Live refresh failed. Showing the last loaded changes." }),
|
|
8985
|
+
/* @__PURE__ */ jsxs9(
|
|
9027
8986
|
"button",
|
|
9028
8987
|
{
|
|
9029
8988
|
type: "button",
|
|
@@ -9031,7 +8990,7 @@ function ChangesTabContent({
|
|
|
9031
8990
|
disabled: git.loading,
|
|
9032
8991
|
className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm border border-og-border bg-og-surface-1 px-2 font-medium text-og-fg transition-colors hover:border-og-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
|
|
9033
8992
|
children: [
|
|
9034
|
-
/* @__PURE__ */
|
|
8993
|
+
/* @__PURE__ */ jsx11(
|
|
9035
8994
|
RefreshCwIcon2,
|
|
9036
8995
|
{
|
|
9037
8996
|
className: cn("size-3", git.loading && "animate-spin motion-reduce:animate-none"),
|
|
@@ -9045,7 +9004,7 @@ function ChangesTabContent({
|
|
|
9045
9004
|
]
|
|
9046
9005
|
}
|
|
9047
9006
|
) : null,
|
|
9048
|
-
/* @__PURE__ */
|
|
9007
|
+
/* @__PURE__ */ jsx11("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx11(
|
|
9049
9008
|
WorkbenchChanges,
|
|
9050
9009
|
{
|
|
9051
9010
|
diff,
|
|
@@ -9058,20 +9017,20 @@ function ChangesTabContent({
|
|
|
9058
9017
|
] });
|
|
9059
9018
|
}
|
|
9060
9019
|
if (capabilitiesError && !captureAvailable) {
|
|
9061
|
-
return /* @__PURE__ */
|
|
9062
|
-
/* @__PURE__ */
|
|
9063
|
-
/* @__PURE__ */
|
|
9064
|
-
/* @__PURE__ */
|
|
9065
|
-
/* @__PURE__ */
|
|
9020
|
+
return /* @__PURE__ */ jsxs9(CenteredState, { icon: /* @__PURE__ */ jsx11(TriangleAlertIcon2, { className: "size-5", "aria-hidden": true }), tone: "danger", children: [
|
|
9021
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm font-medium text-og-fg", children: "Sandbox unavailable" }),
|
|
9022
|
+
/* @__PURE__ */ jsx11("p", { "data-contrast-audited": true, className: "text-og-sm leading-5 text-og-fg-muted", children: capabilitiesError.message || "Couldn't reach the sandbox for this session." }),
|
|
9023
|
+
/* @__PURE__ */ jsxs9(DockActionButton, { onClick: onRetry, children: [
|
|
9024
|
+
/* @__PURE__ */ jsx11(RefreshCwIcon2, { className: "size-3" }),
|
|
9066
9025
|
"Retry"
|
|
9067
9026
|
] })
|
|
9068
9027
|
] });
|
|
9069
9028
|
}
|
|
9070
9029
|
if ((capturePending || capabilitiesState === "negotiating") && !captureAvailable && !workspaceWaking) {
|
|
9071
|
-
return /* @__PURE__ */
|
|
9030
|
+
return /* @__PURE__ */ jsxs9(
|
|
9072
9031
|
CenteredState,
|
|
9073
9032
|
{
|
|
9074
|
-
icon: /* @__PURE__ */
|
|
9033
|
+
icon: /* @__PURE__ */ jsx11(
|
|
9075
9034
|
LoaderCircleIcon2,
|
|
9076
9035
|
{
|
|
9077
9036
|
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
@@ -9079,28 +9038,29 @@ function ChangesTabContent({
|
|
|
9079
9038
|
}
|
|
9080
9039
|
),
|
|
9081
9040
|
children: [
|
|
9082
|
-
/* @__PURE__ */
|
|
9083
|
-
/* @__PURE__ */
|
|
9041
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm font-medium text-og-fg", children: "Connecting workspace" }),
|
|
9042
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: "Looking for the latest files and changes\u2026" })
|
|
9084
9043
|
]
|
|
9085
9044
|
}
|
|
9086
9045
|
);
|
|
9087
9046
|
}
|
|
9088
9047
|
if (!liveWorkspaceExpected && (comparison !== "working" || !captureAvailable)) {
|
|
9089
|
-
|
|
9048
|
+
const previewUnavailable = captureDegraded && !captureAvailable && comparison !== "staged";
|
|
9049
|
+
return /* @__PURE__ */ jsxs9(
|
|
9090
9050
|
CenteredState,
|
|
9091
9051
|
{
|
|
9092
|
-
icon: workspaceWaking ? /* @__PURE__ */
|
|
9052
|
+
icon: workspaceWaking ? /* @__PURE__ */ jsx11(
|
|
9093
9053
|
LoaderCircleIcon2,
|
|
9094
9054
|
{
|
|
9095
9055
|
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
9096
9056
|
"aria-hidden": true
|
|
9097
9057
|
}
|
|
9098
|
-
) : /* @__PURE__ */
|
|
9058
|
+
) : previewUnavailable ? /* @__PURE__ */ jsx11(TriangleAlertIcon2, { className: "size-5", "aria-hidden": true }) : /* @__PURE__ */ jsx11(CpuIcon, { className: "size-5", "aria-hidden": true }),
|
|
9099
9059
|
children: [
|
|
9100
|
-
/* @__PURE__ */
|
|
9101
|
-
/* @__PURE__ */
|
|
9102
|
-
!workspaceWaking ? /* @__PURE__ */
|
|
9103
|
-
/* @__PURE__ */
|
|
9060
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm font-medium text-og-fg", children: workspaceWaking ? "Waking workspace" : previewUnavailable ? "Saved changes preview is unavailable" : "Workspace is resting" }),
|
|
9061
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: workspaceWaking ? "Connecting to the live working tree\u2026" : previewUnavailable ? "Open the live workspace to view current changes." : comparison === "branch" ? "Wake the sandbox to compare this branch with the remote default branch." : comparison === "staged" ? "Wake the sandbox to inspect staged changes." : "No captured revision is available yet. Wake the sandbox to inspect uncommitted changes." }),
|
|
9062
|
+
!workspaceWaking ? /* @__PURE__ */ jsxs9(DockActionButton, { onClick: onWake, children: [
|
|
9063
|
+
/* @__PURE__ */ jsx11(CpuIcon, { className: "size-3" }),
|
|
9104
9064
|
"Open live workspace"
|
|
9105
9065
|
] }) : null
|
|
9106
9066
|
]
|
|
@@ -9108,10 +9068,10 @@ function ChangesTabContent({
|
|
|
9108
9068
|
);
|
|
9109
9069
|
}
|
|
9110
9070
|
if (git.loading && git.source === null) {
|
|
9111
|
-
return /* @__PURE__ */
|
|
9071
|
+
return /* @__PURE__ */ jsxs9(
|
|
9112
9072
|
CenteredState,
|
|
9113
9073
|
{
|
|
9114
|
-
icon: /* @__PURE__ */
|
|
9074
|
+
icon: /* @__PURE__ */ jsx11(
|
|
9115
9075
|
LoaderCircleIcon2,
|
|
9116
9076
|
{
|
|
9117
9077
|
className: "size-5 animate-spin motion-reduce:animate-none",
|
|
@@ -9119,15 +9079,15 @@ function ChangesTabContent({
|
|
|
9119
9079
|
}
|
|
9120
9080
|
),
|
|
9121
9081
|
children: [
|
|
9122
|
-
/* @__PURE__ */
|
|
9123
|
-
/* @__PURE__ */
|
|
9082
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm font-medium text-og-fg", children: "Loading workspace" }),
|
|
9083
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: "Reading the current working tree\u2026" })
|
|
9124
9084
|
]
|
|
9125
9085
|
}
|
|
9126
9086
|
);
|
|
9127
9087
|
}
|
|
9128
|
-
return /* @__PURE__ */
|
|
9129
|
-
/* @__PURE__ */
|
|
9130
|
-
/* @__PURE__ */
|
|
9088
|
+
return /* @__PURE__ */ jsxs9(CenteredState, { icon: /* @__PURE__ */ jsx11(CircleCheckIcon, { className: "size-5", "aria-hidden": true }), tone: "success", children: [
|
|
9089
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm font-medium text-og-fg", children: comparison === "branch" ? "No branch changes" : comparison === "staged" ? "No staged changes" : "No uncommitted changes" }),
|
|
9090
|
+
/* @__PURE__ */ jsx11("p", { className: "text-og-sm leading-5 text-og-fg-subtle", children: comparison === "branch" ? "This branch matches the remote default branch." : comparison === "staged" ? "Stage files to review the next commit here." : "Local edits not yet committed will appear here." })
|
|
9131
9091
|
] });
|
|
9132
9092
|
}
|
|
9133
9093
|
function CenteredState({
|
|
@@ -9135,15 +9095,15 @@ function CenteredState({
|
|
|
9135
9095
|
icon,
|
|
9136
9096
|
tone = "neutral"
|
|
9137
9097
|
}) {
|
|
9138
|
-
return /* @__PURE__ */
|
|
9098
|
+
return /* @__PURE__ */ jsx11(
|
|
9139
9099
|
"div",
|
|
9140
9100
|
{
|
|
9141
9101
|
role: tone === "danger" ? "alert" : "status",
|
|
9142
9102
|
"aria-atomic": "true",
|
|
9143
9103
|
"aria-live": tone === "danger" ? "assertive" : "polite",
|
|
9144
9104
|
className: "grid h-full place-items-center p-6 text-center",
|
|
9145
|
-
children: /* @__PURE__ */
|
|
9146
|
-
icon ? /* @__PURE__ */
|
|
9105
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "flex max-w-sm flex-col items-center gap-2.5", children: [
|
|
9106
|
+
icon ? /* @__PURE__ */ jsx11(
|
|
9147
9107
|
"span",
|
|
9148
9108
|
{
|
|
9149
9109
|
className: cn(
|
|
@@ -9162,7 +9122,7 @@ function CenteredState({
|
|
|
9162
9122
|
}
|
|
9163
9123
|
|
|
9164
9124
|
// src/hooks/use-codex-accounts.ts
|
|
9165
|
-
import { useCallback as
|
|
9125
|
+
import { useCallback as useCallback23, useState as useState18 } from "react";
|
|
9166
9126
|
function isCodexAccountEvent(event) {
|
|
9167
9127
|
return [
|
|
9168
9128
|
"codex.credential.selected",
|
|
@@ -9173,7 +9133,9 @@ function isCodexAccountEvent(event) {
|
|
|
9173
9133
|
"codex.capacity.superseded",
|
|
9174
9134
|
"turn.completed",
|
|
9175
9135
|
"turn.failed",
|
|
9176
|
-
"turn.cancelled"
|
|
9136
|
+
"turn.cancelled",
|
|
9137
|
+
"turn.requires_action",
|
|
9138
|
+
"session.status.changed"
|
|
9177
9139
|
].includes(event.type);
|
|
9178
9140
|
}
|
|
9179
9141
|
var EMPTY_SETTINGS = {
|
|
@@ -9182,6 +9144,7 @@ var EMPTY_SETTINGS = {
|
|
|
9182
9144
|
activeCredentialId: null
|
|
9183
9145
|
};
|
|
9184
9146
|
var EMPTY_STATE = {
|
|
9147
|
+
currentAccount: null,
|
|
9185
9148
|
currentSelection: null,
|
|
9186
9149
|
accounts: [],
|
|
9187
9150
|
activeAccountId: null,
|
|
@@ -9194,22 +9157,27 @@ function useCodexAccounts(options = {}) {
|
|
|
9194
9157
|
const codexClient = options.codexClient ?? client;
|
|
9195
9158
|
const sessionId = options.sessionId;
|
|
9196
9159
|
const sharedEvents = options.events;
|
|
9197
|
-
const load =
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9160
|
+
const load = useCallback23(async () => {
|
|
9161
|
+
if (sessionId) {
|
|
9162
|
+
if (!codexClient.listSessionCodexAccounts)
|
|
9163
|
+
throw new Error("Session Codex account projection is unavailable");
|
|
9164
|
+
return await codexClient.listSessionCodexAccounts(workspaceId, sessionId);
|
|
9165
|
+
}
|
|
9166
|
+
const acc = await codexClient.listCodexAccounts(workspaceId);
|
|
9201
9167
|
return {
|
|
9202
|
-
currentSelection:
|
|
9168
|
+
currentSelection: null,
|
|
9169
|
+
currentAccount: null,
|
|
9203
9170
|
accounts: acc.accounts,
|
|
9204
9171
|
activeAccountId: acc.activeAccountId,
|
|
9205
9172
|
settings: acc.settings,
|
|
9206
|
-
pinnedAccountId:
|
|
9207
|
-
lastAccountId:
|
|
9173
|
+
pinnedAccountId: null,
|
|
9174
|
+
lastAccountId: null
|
|
9208
9175
|
};
|
|
9209
9176
|
}, [codexClient, workspaceId, sessionId]);
|
|
9210
9177
|
const {
|
|
9211
9178
|
data: loadedData,
|
|
9212
9179
|
loading,
|
|
9180
|
+
error,
|
|
9213
9181
|
refresh
|
|
9214
9182
|
} = usePolledValue(load, {
|
|
9215
9183
|
pollIntervalMs: options.pollIntervalMs,
|
|
@@ -9217,8 +9185,8 @@ function useCodexAccounts(options = {}) {
|
|
|
9217
9185
|
});
|
|
9218
9186
|
const { run: runMutation, mutating: pinning, mutationError } = useMutationRunner();
|
|
9219
9187
|
const { run: runUsageMutation, mutating: refreshingUsage } = useMutationRunner();
|
|
9220
|
-
const [pinningTarget, setPinningTarget] =
|
|
9221
|
-
const [switchReceipt, setSwitchReceipt] =
|
|
9188
|
+
const [pinningTarget, setPinningTarget] = useState18(null);
|
|
9189
|
+
const [switchReceipt, setSwitchReceipt] = useState18(null);
|
|
9222
9190
|
useSessionEventTrigger(
|
|
9223
9191
|
client,
|
|
9224
9192
|
workspaceId,
|
|
@@ -9230,7 +9198,7 @@ function useCodexAccounts(options = {}) {
|
|
|
9230
9198
|
...sharedEvents !== void 0 ? { events: sharedEvents } : {}
|
|
9231
9199
|
}
|
|
9232
9200
|
);
|
|
9233
|
-
const pin =
|
|
9201
|
+
const pin = useCallback23(
|
|
9234
9202
|
async (target) => {
|
|
9235
9203
|
if (!sessionId || !codexClient.pinSessionCodexAccount) {
|
|
9236
9204
|
return false;
|
|
@@ -9248,7 +9216,7 @@ function useCodexAccounts(options = {}) {
|
|
|
9248
9216
|
},
|
|
9249
9217
|
[codexClient, workspaceId, sessionId, runMutation, refresh]
|
|
9250
9218
|
);
|
|
9251
|
-
const refreshUsage =
|
|
9219
|
+
const refreshUsage = useCallback23(async () => {
|
|
9252
9220
|
if (!codexClient.refreshCodexUsage) {
|
|
9253
9221
|
return false;
|
|
9254
9222
|
}
|
|
@@ -9259,9 +9227,10 @@ function useCodexAccounts(options = {}) {
|
|
|
9259
9227
|
if (result) await refresh();
|
|
9260
9228
|
return result === true;
|
|
9261
9229
|
}, [codexClient, workspaceId, runUsageMutation, refresh]);
|
|
9262
|
-
const data = loadedData ?? EMPTY_STATE;
|
|
9230
|
+
const data = (sessionId && error ? null : loadedData) ?? EMPTY_STATE;
|
|
9263
9231
|
const effectiveAccountId = data.pinnedAccountId ?? data.activeAccountId;
|
|
9264
9232
|
return {
|
|
9233
|
+
currentAccount: data.currentAccount,
|
|
9265
9234
|
currentSelection: data.currentSelection,
|
|
9266
9235
|
switchAppliedTo: switchReceipt?.sessionId === sessionId ? switchReceipt?.appliedTo ?? null : null,
|
|
9267
9236
|
accounts: data.accounts,
|
|
@@ -9271,6 +9240,7 @@ function useCodexAccounts(options = {}) {
|
|
|
9271
9240
|
lastAccountId: data.lastAccountId,
|
|
9272
9241
|
settings: data.settings,
|
|
9273
9242
|
loading,
|
|
9243
|
+
error,
|
|
9274
9244
|
refresh,
|
|
9275
9245
|
refreshUsage,
|
|
9276
9246
|
refreshingUsage,
|
|
@@ -9282,7 +9252,7 @@ function useCodexAccounts(options = {}) {
|
|
|
9282
9252
|
}
|
|
9283
9253
|
|
|
9284
9254
|
// src/hooks/use-supergrok-accounts.ts
|
|
9285
|
-
import { useCallback as
|
|
9255
|
+
import { useCallback as useCallback24 } from "react";
|
|
9286
9256
|
var EMPTY = {
|
|
9287
9257
|
accounts: [],
|
|
9288
9258
|
activeAccountId: null,
|
|
@@ -9295,7 +9265,7 @@ var EMPTY = {
|
|
|
9295
9265
|
function useSuperGrokAccounts(options = {}) {
|
|
9296
9266
|
const { client, workspaceId } = useOpenGeni(options);
|
|
9297
9267
|
const supergrokClient = options.supergrokClient ?? client;
|
|
9298
|
-
const load =
|
|
9268
|
+
const load = useCallback24(
|
|
9299
9269
|
async () => await supergrokClient.listSuperGrokAccounts(workspaceId),
|
|
9300
9270
|
[supergrokClient, workspaceId]
|
|
9301
9271
|
);
|
|
@@ -9304,7 +9274,7 @@ function useSuperGrokAccounts(options = {}) {
|
|
|
9304
9274
|
pollIntervalMs: options.pollIntervalMs
|
|
9305
9275
|
});
|
|
9306
9276
|
const { run, mutating: activating, mutationError } = useMutationRunner();
|
|
9307
|
-
const activate =
|
|
9277
|
+
const activate = useCallback24(
|
|
9308
9278
|
async (accountId) => {
|
|
9309
9279
|
if (!supergrokClient.activateSuperGrokAccount) return false;
|
|
9310
9280
|
const result = await run(async () => {
|
|
@@ -9379,6 +9349,7 @@ export {
|
|
|
9379
9349
|
MachineStatusPill,
|
|
9380
9350
|
MachinesDashboard,
|
|
9381
9351
|
Markdown,
|
|
9352
|
+
McpConnectionCard,
|
|
9382
9353
|
MediaEmpty,
|
|
9383
9354
|
MediaSkeleton,
|
|
9384
9355
|
MessageTimeline,
|
|
@@ -9405,9 +9376,13 @@ export {
|
|
|
9405
9376
|
SandboxTerminal,
|
|
9406
9377
|
SandboxWorkspace,
|
|
9407
9378
|
ScreenshotFigure,
|
|
9379
|
+
SessionCapabilityFrame,
|
|
9408
9380
|
SessionChrome,
|
|
9381
|
+
SessionCommands,
|
|
9409
9382
|
SessionCommandsPanel,
|
|
9383
|
+
SessionConnectionRequest,
|
|
9410
9384
|
SessionConversation,
|
|
9385
|
+
SessionMcpCapabilityCard,
|
|
9411
9386
|
SessionStatus,
|
|
9412
9387
|
SharedMachineDisclosure,
|
|
9413
9388
|
StartupTimings,
|
|
@@ -9446,6 +9421,7 @@ export {
|
|
|
9446
9421
|
applyPatchOpsFromToolItem,
|
|
9447
9422
|
approvalsFromRequiresAction,
|
|
9448
9423
|
argHint,
|
|
9424
|
+
attachSessionCapability,
|
|
9449
9425
|
availabilityReasonLabel,
|
|
9450
9426
|
billingClassForModel,
|
|
9451
9427
|
billingClassLabel,
|
|
@@ -9453,10 +9429,12 @@ export {
|
|
|
9453
9429
|
buildTimeline,
|
|
9454
9430
|
cn,
|
|
9455
9431
|
coerceReasoningEffortForModel,
|
|
9432
|
+
completeSessionCapabilityOAuth,
|
|
9456
9433
|
composeSendInput,
|
|
9457
9434
|
composerSubmissionErrorMessage,
|
|
9458
9435
|
connectionStatusForState,
|
|
9459
9436
|
controlCaret,
|
|
9437
|
+
conversationTimeline,
|
|
9460
9438
|
copyTextToClipboard,
|
|
9461
9439
|
createDefaultToolRegistry,
|
|
9462
9440
|
createEmbeddedSessionClient,
|
|
@@ -9528,6 +9506,7 @@ export {
|
|
|
9528
9506
|
sandboxCommandExitCode,
|
|
9529
9507
|
sandboxFileLocationFromHref,
|
|
9530
9508
|
sandboxFilePathFromHref,
|
|
9509
|
+
sessionAuthRecommendation,
|
|
9531
9510
|
sessionChromeGoalPillExplanation,
|
|
9532
9511
|
sessionChromeGoalPillLabel,
|
|
9533
9512
|
sessionChromeGoalPillState,
|
|
@@ -9563,7 +9542,6 @@ export {
|
|
|
9563
9542
|
useMachines,
|
|
9564
9543
|
useOpenGeni,
|
|
9565
9544
|
useOpenGeniClient,
|
|
9566
|
-
usePacks,
|
|
9567
9545
|
usePageLiveActivity,
|
|
9568
9546
|
useRelayFrameStream,
|
|
9569
9547
|
useRig,
|