@opengeni/react 1.4.4 → 1.4.5-canary.37485542607001
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 +17 -6
- package/dist/artifacts.d.ts +1 -0
- package/dist/artifacts.js +22 -15
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-5EEAS3IU.js → browser-viewer-CV23VIHB.js} +8 -6
- package/dist/{chunk-XS67YG5R.js → chunk-4O7OE7ON.js} +45 -4
- package/dist/chunk-4O7OE7ON.js.map +1 -0
- package/dist/{chunk-JHTIMBOL.js → chunk-5JSUNNQN.js} +26 -4
- package/dist/{chunk-JHTIMBOL.js.map → chunk-5JSUNNQN.js.map} +1 -1
- package/dist/{chunk-QMMCJGFI.js → chunk-6BAMPGBV.js} +6 -3
- package/dist/chunk-6BAMPGBV.js.map +1 -0
- package/dist/{chunk-I6OY3MWC.js → chunk-6FOTSVWU.js} +2 -2
- package/dist/{chunk-LVS3MH5T.js → chunk-ATIRUHBZ.js} +128 -10
- package/dist/chunk-ATIRUHBZ.js.map +1 -0
- package/dist/chunk-BOFEQC6K.js +162 -0
- package/dist/chunk-BOFEQC6K.js.map +1 -0
- package/dist/{chunk-2OQA3CPB.js → chunk-CESBPQP5.js} +19 -5
- package/dist/chunk-CESBPQP5.js.map +1 -0
- package/dist/{chunk-YVFRBXST.js → chunk-GMNGUPMX.js} +2 -2
- package/dist/{chunk-PHBFJCEU.js → chunk-I5EGRXXG.js} +110 -7
- package/dist/chunk-I5EGRXXG.js.map +1 -0
- package/dist/{chunk-PBCZL4JP.js → chunk-INIZSNXT.js} +2 -2
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/chunk-JDJJMBB3.js +1883 -0
- package/dist/chunk-JDJJMBB3.js.map +1 -0
- package/dist/chunk-LHF6BVM4.js +83 -0
- package/dist/chunk-LHF6BVM4.js.map +1 -0
- package/dist/{chunk-C5BF4L26.js → chunk-LSMWZSCJ.js} +7 -7
- package/dist/chunk-LTKGTXUQ.js +174 -0
- package/dist/chunk-LTKGTXUQ.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-CVYCLFMH.js → chunk-PEHTX3V7.js} +19 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-R5R5RQQD.js +51 -0
- package/dist/chunk-R5R5RQQD.js.map +1 -0
- package/dist/{chunk-IYQCWGU5.js → chunk-RGTZ2VDR.js} +35 -62
- package/dist/chunk-RGTZ2VDR.js.map +1 -0
- package/dist/chunk-RI42H5IU.js +326 -0
- package/dist/chunk-RI42H5IU.js.map +1 -0
- package/dist/{chunk-EAOSEIXB.js → chunk-RRRS5D5T.js} +727 -1983
- package/dist/chunk-RRRS5D5T.js.map +1 -0
- package/dist/{chunk-JH7V627O.js → chunk-SHLZMAJN.js} +2 -11
- package/dist/chunk-SHLZMAJN.js.map +1 -0
- package/dist/{chunk-IUHHPMAX.js → chunk-SZOCY5VG.js} +18 -87
- package/dist/chunk-SZOCY5VG.js.map +1 -0
- package/dist/{chunk-L2J3PU7A.js → chunk-VYIPNDUZ.js} +29 -100
- package/dist/chunk-VYIPNDUZ.js.map +1 -0
- package/dist/{chunk-G6YRCIYJ.js → chunk-YK6QMGVL.js} +55 -60
- package/dist/chunk-YK6QMGVL.js.map +1 -0
- package/dist/chunk-ZIB4H5LN.js +101 -0
- package/dist/chunk-ZIB4H5LN.js.map +1 -0
- package/dist/client.d.ts +9 -3
- package/dist/clipboard.js +1 -1
- package/dist/components/browser-viewer.d.ts +6 -0
- package/dist/components/composer.d.ts +3 -69
- package/dist/components/human-input-form.d.ts +3 -32
- package/dist/components/markdown.d.ts +8 -0
- package/dist/components/model-policy-picker.d.ts +4 -37
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/provider-recovery-notice.d.ts +15 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-workspace.d.ts +13 -0
- package/dist/components/session-chrome.d.ts +5 -3
- package/dist/components/session-conversation.d.ts +15 -3
- package/dist/composer-messages.d.ts +74 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer.js +15 -10
- package/dist/{computer-viewer-ELNLZGHI.js → computer-viewer-K4CKYRX6.js} +4 -4
- package/dist/connect-setup.d.ts +2 -0
- package/dist/connect.d.ts +1 -1
- package/dist/connect.js +21 -6
- package/dist/connect.js.map +1 -1
- package/dist/{embedded-voice-NIL4RDX3.js → embedded-voice-K7SOZVVZ.js} +6 -4
- package/dist/{embedded-voice-NIL4RDX3.js.map → embedded-voice-K7SOZVVZ.js.map} +1 -1
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/use-client-config-flags.d.ts +6 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/human-input-model.d.ts +40 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +116 -73
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +5 -5
- package/dist/{latest-question-2POFPYNB.js → latest-question-27HGRPVF.js} +3 -3
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/provider-recovery.d.ts +49 -0
- package/dist/lib/transient-retry.d.ts +25 -0
- package/dist/machines.js +2 -2
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-picker-model.d.ts +111 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/{model-policy-picker-menu-WRNSRFQC.js → model-policy-picker-menu-I5KPC3D6.js} +6 -4
- package/dist/model-policy-picker-menu-I5KPC3D6.js.map +1 -0
- package/dist/model-policy.d.ts +10 -0
- package/dist/model-policy.js +5 -1
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/organization-model.d.ts +32 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/{platform-activity-row-PJJVATTZ.js → platform-activity-row-NJ47YBXW.js} +7 -84
- package/dist/platform-activity-row-NJ47YBXW.js.map +1 -0
- package/dist/queue-presentation-model.d.ts +72 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-67FS7FUI.js → queue-surface-implementation-YPJFQ3O6.js} +24 -252
- package/dist/queue-surface-implementation-YPJFQ3O6.js.map +1 -0
- package/dist/realtime.js +5 -3
- package/dist/{sandbox-files-34CJJNOY.js → sandbox-files-2DGDO6NI.js} +5 -5
- package/dist/sandbox-files-2DGDO6NI.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +23 -0
- package/dist/sandbox-label-model.js +28 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/session-agents-model.d.ts +10 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +46 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-feedback-model.d.ts +20 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +119 -0
- package/dist/session-list-model.js +244 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-status-model.d.ts +19 -0
- package/dist/session-ui.js +26 -17
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +8 -6
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +303 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/timeline/genie-copy.d.ts +3 -0
- package/dist/timeline/genie-loading.d.ts +11 -0
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/notice-presentation.d.ts +7 -0
- package/dist/timeline/patch-apply-command.d.ts +18 -0
- package/dist/timeline/platform-activity-presentation.d.ts +7 -0
- package/dist/timeline/presented-image.d.ts +6 -1
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +10 -1
- package/dist/timeline/retained-loaders.d.ts +1 -1
- package/dist/timeline/tool-presentation.d.ts +172 -0
- package/dist/timeline/turn-summary-model.d.ts +90 -0
- package/dist/timeline/turn-summary.d.ts +4 -74
- package/dist/timeline/work-presentation.d.ts +42 -0
- package/dist/timeline-model.d.ts +24 -0
- package/dist/timeline-model.js +152 -0
- package/dist/timeline-model.js.map +1 -0
- package/package.json +55 -3
- package/src/artifacts.ts +1 -0
- package/src/client.ts +9 -3
- package/src/components/browser-viewer.tsx +23 -2
- package/src/components/claude-mark.tsx +2 -1
- package/src/components/composer.tsx +8 -146
- package/src/components/grok-mark.tsx +2 -1
- package/src/components/human-input-form.tsx +13 -124
- package/src/components/markdown.tsx +19 -1
- package/src/components/message-timeline.tsx +45 -99
- package/src/components/model-mark.tsx +2 -1
- package/src/components/model-policy-picker-menu.tsx +30 -85
- package/src/components/model-policy-picker.tsx +20 -150
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/provider-recovery-notice.tsx +41 -0
- package/src/components/queue-surface-implementation.tsx +20 -349
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-workspace.tsx +17 -1
- package/src/components/session-chrome.tsx +114 -99
- package/src/components/session-conversation.tsx +55 -6
- package/src/components/session-status.tsx +17 -16
- package/src/composer-messages.ts +150 -0
- package/src/connect-setup.tsx +45 -11
- package/src/connect.ts +1 -1
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/use-client-config-flags.ts +8 -0
- package/src/hooks/use-goal.ts +66 -10
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/human-input-model.ts +147 -0
- package/src/index.ts +16 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/format.ts +7 -0
- package/src/lib/provider-recovery.ts +202 -0
- package/src/lib/transient-retry.ts +99 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +330 -0
- package/src/model-policy.ts +75 -5
- package/src/new-session-draft.ts +22 -0
- package/src/organization-model.ts +118 -0
- package/src/queue-presentation-model.ts +464 -0
- package/src/sandbox-label-model.ts +41 -0
- package/src/session-agents-model.ts +33 -0
- package/src/session-attention-model.ts +59 -0
- package/src/session-feedback-model.ts +95 -0
- package/src/session-list-model.ts +377 -0
- package/src/session-status-model.ts +62 -0
- package/src/testing/session-scenarios.ts +326 -0
- package/src/timeline/activity-rail.tsx +54 -24
- package/src/timeline/genie-copy.ts +19 -0
- package/src/timeline/genie-loading.tsx +15 -19
- package/src/timeline/index.ts +1 -0
- package/src/timeline/notice-presentation.ts +22 -0
- package/src/timeline/patch-apply-command.tsx +135 -0
- package/src/timeline/platform-activity-presentation.ts +122 -0
- package/src/timeline/platform-activity-row.tsx +6 -96
- package/src/timeline/presented-image.ts +16 -2
- package/src/timeline/projection.ts +12 -1
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +11 -1
- package/src/timeline/retained-loaders.ts +9 -4
- package/src/timeline/rolling-activity.tsx +7 -19
- package/src/timeline/tool-presentation.ts +1316 -0
- package/src/timeline/tool-renderers.tsx +254 -1024
- package/src/timeline/turn-summary-model.ts +338 -0
- package/src/timeline/turn-summary.tsx +21 -326
- package/src/timeline/work-presentation.ts +139 -0
- package/src/timeline-model.ts +108 -0
- package/styles/compiled.css +17 -4
- package/styles/connect.css +4 -0
- package/styles/responsive.css +11 -2
- package/dist/chunk-2OQA3CPB.js.map +0 -1
- package/dist/chunk-CVYCLFMH.js.map +0 -1
- package/dist/chunk-EAOSEIXB.js.map +0 -1
- package/dist/chunk-G6YRCIYJ.js.map +0 -1
- package/dist/chunk-HXYOSSQO.js +0 -117
- package/dist/chunk-HXYOSSQO.js.map +0 -1
- package/dist/chunk-IUHHPMAX.js.map +0 -1
- package/dist/chunk-IYQCWGU5.js.map +0 -1
- package/dist/chunk-JH7V627O.js.map +0 -1
- package/dist/chunk-L2J3PU7A.js.map +0 -1
- package/dist/chunk-LVS3MH5T.js.map +0 -1
- package/dist/chunk-PHBFJCEU.js.map +0 -1
- package/dist/chunk-QMMCJGFI.js.map +0 -1
- package/dist/chunk-XS67YG5R.js.map +0 -1
- package/dist/platform-activity-row-PJJVATTZ.js.map +0 -1
- package/dist/queue-surface-implementation-67FS7FUI.js.map +0 -1
- /package/dist/{browser-viewer-5EEAS3IU.js.map → browser-viewer-CV23VIHB.js.map} +0 -0
- /package/dist/{chunk-I6OY3MWC.js.map → chunk-6FOTSVWU.js.map} +0 -0
- /package/dist/{chunk-YVFRBXST.js.map → chunk-GMNGUPMX.js.map} +0 -0
- /package/dist/{chunk-PBCZL4JP.js.map → chunk-INIZSNXT.js.map} +0 -0
- /package/dist/{chunk-C5BF4L26.js.map → chunk-LSMWZSCJ.js.map} +0 -0
- /package/dist/{computer-viewer-ELNLZGHI.js.map → composer-messages.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-WRNSRFQC.js.map → computer-viewer-K4CKYRX6.js.map} +0 -0
- /package/dist/{latest-question-2POFPYNB.js.map → latest-question-27HGRPVF.js.map} +0 -0
- /package/dist/{sandbox-files-34CJJNOY.js.map → model-mark-paths.js.map} +0 -0
|
@@ -4,25 +4,26 @@ import {
|
|
|
4
4
|
} from "./chunk-B27E3V37.js";
|
|
5
5
|
import {
|
|
6
6
|
EmptyQueueStateSurface,
|
|
7
|
-
QUEUE_ITEM_CONTENT_UNAVAILABLE,
|
|
8
7
|
TimelineAnnotationCards,
|
|
9
8
|
TimelineAnnotationsChip,
|
|
10
|
-
queueItemContent,
|
|
11
9
|
requestQueueDraftEdit
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SHLZMAJN.js";
|
|
13
11
|
import {
|
|
14
12
|
TimelineAnnotationSourceRootContext
|
|
15
13
|
} from "./chunk-2HVLQ26H.js";
|
|
16
14
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
loadPierreDiffs,
|
|
16
|
+
pierreDiffsRevision,
|
|
17
|
+
subscribePierreDiffs
|
|
18
|
+
} from "./chunk-YSRBFJMQ.js";
|
|
19
|
+
import {
|
|
20
|
+
PatchApplyCommand,
|
|
19
21
|
useRetainedImageObjectUrl
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BOFEQC6K.js";
|
|
21
23
|
import {
|
|
22
24
|
approvalsFromRequiresAction,
|
|
23
25
|
conversationTimeline,
|
|
24
26
|
invokeOlderHistoryLoaderWithReceiptCapture,
|
|
25
|
-
isActionableHumanInputRequest,
|
|
26
27
|
projectPendingApprovals,
|
|
27
28
|
useFileAttachments,
|
|
28
29
|
useGoal,
|
|
@@ -31,18 +32,23 @@ import {
|
|
|
31
32
|
useSessionControl,
|
|
32
33
|
useSessionEvents,
|
|
33
34
|
useTurnQueue
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YK6QMGVL.js";
|
|
35
36
|
import {
|
|
36
37
|
buildTimeline,
|
|
37
38
|
groupTimeline
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import {
|
|
40
|
-
mcpToolLeaf,
|
|
41
|
-
toolDisplayName
|
|
42
|
-
} from "./chunk-T46QZH3E.js";
|
|
39
|
+
} from "./chunk-6BAMPGBV.js";
|
|
43
40
|
import {
|
|
44
41
|
OpenGeniProvider
|
|
45
42
|
} from "./chunk-PKCAYHDC.js";
|
|
43
|
+
import {
|
|
44
|
+
QUEUE_ITEM_CONTENT_UNAVAILABLE,
|
|
45
|
+
QUEUE_REPLACE_DRAFT_COPY,
|
|
46
|
+
countAuthoritativeQueuedTurns,
|
|
47
|
+
isAuthoritativeQueuedTurn,
|
|
48
|
+
queueItemContent,
|
|
49
|
+
queueNeighborAnchors,
|
|
50
|
+
queuedTurnPresentation
|
|
51
|
+
} from "./chunk-RI42H5IU.js";
|
|
46
52
|
import {
|
|
47
53
|
ActivityDisclosure,
|
|
48
54
|
BodyNote,
|
|
@@ -63,7 +69,7 @@ import {
|
|
|
63
69
|
useForcedDefaultOpen,
|
|
64
70
|
useTimelineSearchNavigation,
|
|
65
71
|
useTimelineSearchReveal
|
|
66
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-I5EGRXXG.js";
|
|
67
73
|
import {
|
|
68
74
|
prefersReducedMotion
|
|
69
75
|
} from "./chunk-OYQQJL3J.js";
|
|
@@ -75,10 +81,69 @@ import {
|
|
|
75
81
|
viewerLinkResolver
|
|
76
82
|
} from "./chunk-OGTTUYNT.js";
|
|
77
83
|
import {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
GENIE_PREPARING_PHRASES,
|
|
85
|
+
GENIE_WAITING_PHRASES,
|
|
86
|
+
QUESTION_NAV_MARGIN_PX,
|
|
87
|
+
SESSION_STATUS_PRESENTATION,
|
|
88
|
+
answersFromDrafts,
|
|
89
|
+
applyPatchPresentation,
|
|
90
|
+
askPresentation,
|
|
91
|
+
clusterIsSettled,
|
|
92
|
+
compactedLandmarkCount,
|
|
93
|
+
createToolRegistry,
|
|
94
|
+
createTurnSummaryContext,
|
|
95
|
+
defaultHumanInputFormMessages,
|
|
96
|
+
durationBetween,
|
|
97
|
+
emptyDraft,
|
|
98
|
+
execPresentation,
|
|
99
|
+
flattenActivityItems,
|
|
100
|
+
formatElapsed,
|
|
101
|
+
generatedImageReceipt,
|
|
102
|
+
genericToolIconKind,
|
|
103
|
+
genericToolPresentation,
|
|
104
|
+
initialDrafts,
|
|
105
|
+
isPreparingWork,
|
|
106
|
+
mediaPreviewFact,
|
|
107
|
+
noticeDisplayText,
|
|
108
|
+
noticeIsResolvedApproval,
|
|
109
|
+
noticeTone,
|
|
110
|
+
parseDisclosedTools,
|
|
111
|
+
parseSearchHits,
|
|
112
|
+
parseToolArgs,
|
|
113
|
+
pathBasename,
|
|
114
|
+
pathDirname,
|
|
115
|
+
questionNavTarget,
|
|
116
|
+
readableWorkDefaultOpen,
|
|
117
|
+
readableWorkShowsPreview,
|
|
118
|
+
readableWorkStatus,
|
|
119
|
+
resolveTurnSummaryFacets,
|
|
120
|
+
retainedScreenshotMetadata,
|
|
121
|
+
rollingActivityItem,
|
|
122
|
+
runOnPresentation,
|
|
123
|
+
screenshotDataUrl,
|
|
124
|
+
selectTurnSummaryFacets,
|
|
125
|
+
toolSearchPreview,
|
|
126
|
+
toolSearchQuery,
|
|
127
|
+
truncatePreview,
|
|
128
|
+
unwrapMcpOutput,
|
|
129
|
+
webSearchPresentation,
|
|
130
|
+
writeStdinPresentation
|
|
131
|
+
} from "./chunk-JDJJMBB3.js";
|
|
132
|
+
import {
|
|
133
|
+
workerRowTitle
|
|
134
|
+
} from "./chunk-ZIB4H5LN.js";
|
|
135
|
+
import {
|
|
136
|
+
isPatchFilename,
|
|
137
|
+
isRetainedImageContentType,
|
|
138
|
+
timelineGroupContainsPresentedImage
|
|
139
|
+
} from "./chunk-R5R5RQQD.js";
|
|
140
|
+
import {
|
|
141
|
+
isActionableHumanInputRequest
|
|
142
|
+
} from "./chunk-IZV5FTJC.js";
|
|
143
|
+
import {
|
|
144
|
+
mcpToolLeaf,
|
|
145
|
+
toolDisplayName
|
|
146
|
+
} from "./chunk-T46QZH3E.js";
|
|
82
147
|
import {
|
|
83
148
|
Actions,
|
|
84
149
|
AttachButton,
|
|
@@ -102,11 +167,14 @@ import {
|
|
|
102
167
|
StopButton,
|
|
103
168
|
Surface,
|
|
104
169
|
useChatComposerController
|
|
105
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-SZOCY5VG.js";
|
|
171
|
+
import {
|
|
172
|
+
ModelPolicyPicker
|
|
173
|
+
} from "./chunk-VYIPNDUZ.js";
|
|
106
174
|
import {
|
|
107
175
|
FILE_ONLY_MESSAGE_TEXT,
|
|
108
176
|
useComposer
|
|
109
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-INIZSNXT.js";
|
|
110
178
|
import {
|
|
111
179
|
LightboxProvider,
|
|
112
180
|
Tooltip,
|
|
@@ -114,21 +182,19 @@ import {
|
|
|
114
182
|
TooltipProvider,
|
|
115
183
|
TooltipTrigger
|
|
116
184
|
} from "./chunk-IEE7WCLN.js";
|
|
117
|
-
import {
|
|
118
|
-
ModelPolicyPicker
|
|
119
|
-
} from "./chunk-L2J3PU7A.js";
|
|
120
185
|
import {
|
|
121
186
|
projectPickerRows,
|
|
122
187
|
sortPickerRows
|
|
123
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-4O7OE7ON.js";
|
|
124
189
|
import {
|
|
190
|
+
currentProviderRecovery,
|
|
125
191
|
formatBytes,
|
|
126
192
|
formatClockTime,
|
|
127
193
|
formatRelativeTime,
|
|
128
|
-
|
|
194
|
+
providerRecoveryRetryingText,
|
|
129
195
|
truncate,
|
|
130
196
|
tryParseJson
|
|
131
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-ATIRUHBZ.js";
|
|
132
198
|
import {
|
|
133
199
|
allowanceLabels,
|
|
134
200
|
allowanceResetSentence,
|
|
@@ -154,32 +220,6 @@ import { useEffect, useId, useRef, useState } from "react";
|
|
|
154
220
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
155
221
|
var SkillReviewVerificationError = class extends Error {
|
|
156
222
|
};
|
|
157
|
-
var defaultHumanInputFormMessages = {
|
|
158
|
-
title: "Input required",
|
|
159
|
-
/** Multi-question chrome has no default subtitle; hosts may still override. */
|
|
160
|
-
description: "",
|
|
161
|
-
submit: "Send answers",
|
|
162
|
-
skip: "Skip",
|
|
163
|
-
submitting: "Submitting\u2026",
|
|
164
|
-
other: "Other",
|
|
165
|
-
deadlineLabel: "Expires",
|
|
166
|
-
formatDeadline,
|
|
167
|
-
required: "This question is required.",
|
|
168
|
-
otherRequired: "Enter a value for Other.",
|
|
169
|
-
minSelections: (count) => `Choose at least ${count} option${count === 1 ? "" : "s"}.`,
|
|
170
|
-
maxSelections: (count) => `Choose no more than ${count} option${count === 1 ? "" : "s"}.`,
|
|
171
|
-
optional: "Optional",
|
|
172
|
-
moreBelow: "More below",
|
|
173
|
-
questionCount: (count) => `${count} questions`,
|
|
174
|
-
collapse: "Collapse",
|
|
175
|
-
expand: "Expand",
|
|
176
|
-
selectionHint: (min, max) => {
|
|
177
|
-
if (min != null && max != null) return `Choose ${min}\u2013${max}.`;
|
|
178
|
-
if (min != null) return `Choose at least ${min}.`;
|
|
179
|
-
if (max != null) return `Choose up to ${max}.`;
|
|
180
|
-
return null;
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
223
|
function HumanInputForm(props) {
|
|
184
224
|
return /* @__PURE__ */ jsx(HumanInputRequestForm, { ...props }, props.request.id);
|
|
185
225
|
}
|
|
@@ -879,64 +919,6 @@ function QuestionControls({
|
|
|
879
919
|
error ? /* @__PURE__ */ jsx("p", { id: errorId, role: "alert", className: "text-og-xs text-og-status-failed", children: error }) : null
|
|
880
920
|
] });
|
|
881
921
|
}
|
|
882
|
-
function answersFromDrafts(questions, drafts, messageOverrides = {}) {
|
|
883
|
-
const messages = { ...defaultHumanInputFormMessages, ...messageOverrides };
|
|
884
|
-
const answers = [];
|
|
885
|
-
const errors = {};
|
|
886
|
-
for (const question of questions) {
|
|
887
|
-
const draft = drafts[question.id] ?? emptyDraft();
|
|
888
|
-
const values = question.kind === "text" ? draft.values.filter(Boolean) : draft.values;
|
|
889
|
-
const other = draft.otherSelected ? draft.other : "";
|
|
890
|
-
const hasOther = Boolean(other.trim());
|
|
891
|
-
const supplied = values.length + (hasOther ? 1 : 0);
|
|
892
|
-
if (question.kind !== "text" && draft.otherSelected && !hasOther) {
|
|
893
|
-
errors[question.id] = messages.otherRequired;
|
|
894
|
-
continue;
|
|
895
|
-
}
|
|
896
|
-
if (question.required && supplied === 0) {
|
|
897
|
-
errors[question.id] = messages.required;
|
|
898
|
-
continue;
|
|
899
|
-
}
|
|
900
|
-
if (question.kind !== "text") {
|
|
901
|
-
const min = question.validation?.minSelections;
|
|
902
|
-
const max = question.kind === "single_select" ? 1 : question.validation?.maxSelections;
|
|
903
|
-
if (min != null && supplied < min) {
|
|
904
|
-
errors[question.id] = messages.minSelections(min);
|
|
905
|
-
continue;
|
|
906
|
-
}
|
|
907
|
-
if (max != null && supplied > max) {
|
|
908
|
-
errors[question.id] = messages.maxSelections(max);
|
|
909
|
-
continue;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
if (supplied > 0) {
|
|
913
|
-
answers.push({
|
|
914
|
-
questionId: question.id,
|
|
915
|
-
values,
|
|
916
|
-
...hasOther ? { other } : {}
|
|
917
|
-
});
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
return { answers, errors };
|
|
921
|
-
}
|
|
922
|
-
function initialDrafts(questions) {
|
|
923
|
-
return Object.fromEntries(questions.map((question) => [question.id, emptyDraft()]));
|
|
924
|
-
}
|
|
925
|
-
function emptyDraft() {
|
|
926
|
-
return { values: [], other: "", otherSelected: false };
|
|
927
|
-
}
|
|
928
|
-
function formatDeadline(value) {
|
|
929
|
-
const date = new Date(value);
|
|
930
|
-
if (Number.isNaN(date.getTime())) return value;
|
|
931
|
-
const ms = date.getTime() - Date.now();
|
|
932
|
-
if (ms <= 0) return "deadline passed";
|
|
933
|
-
const minutes = Math.round(ms / 6e4);
|
|
934
|
-
if (minutes < 1) return "in under a minute";
|
|
935
|
-
if (minutes < 60) return `in ${minutes}m`;
|
|
936
|
-
const hours = Math.round(minutes / 60);
|
|
937
|
-
if (hours < 48) return `in ${hours}h`;
|
|
938
|
-
return date.toLocaleString();
|
|
939
|
-
}
|
|
940
922
|
|
|
941
923
|
// src/components/human-input-surface.tsx
|
|
942
924
|
import { useEffect as useEffect2, useMemo, useRef as useRef2 } from "react";
|
|
@@ -2017,514 +1999,6 @@ function useRecordedToolReview(approvalId) {
|
|
|
2017
1999
|
};
|
|
2018
2000
|
}
|
|
2019
2001
|
|
|
2020
|
-
// src/timeline/parsers.ts
|
|
2021
|
-
import {
|
|
2022
|
-
normalizeMcpOutput,
|
|
2023
|
-
parseGeneratedImageReceipt
|
|
2024
|
-
} from "@opengeni/sdk";
|
|
2025
|
-
function sandboxCommandExitCode(out) {
|
|
2026
|
-
const match = String(out ?? "").match(/Process exited with code (-?\d+)/);
|
|
2027
|
-
return match ? Number(match[1]) : null;
|
|
2028
|
-
}
|
|
2029
|
-
function parseExecBannerSessionId(out) {
|
|
2030
|
-
const text = String(out ?? "");
|
|
2031
|
-
const outputIdx = text.indexOf("\nOutput:\n");
|
|
2032
|
-
const banner = outputIdx >= 0 ? text.slice(0, outputIdx) : text.startsWith("Output:\n") ? "" : text;
|
|
2033
|
-
const match = banner.match(/Process running with session ID (\d+)/);
|
|
2034
|
-
if (!match) {
|
|
2035
|
-
return null;
|
|
2036
|
-
}
|
|
2037
|
-
const n = Number.parseInt(match[1], 10);
|
|
2038
|
-
return Number.isFinite(n) ? n : null;
|
|
2039
|
-
}
|
|
2040
|
-
function stripExecBanner(out) {
|
|
2041
|
-
const text = String(out ?? "");
|
|
2042
|
-
const marker = text.indexOf("\nOutput:\n");
|
|
2043
|
-
if (marker >= 0) {
|
|
2044
|
-
return text.slice(marker + "\nOutput:\n".length);
|
|
2045
|
-
}
|
|
2046
|
-
if (text.startsWith("Output:\n")) {
|
|
2047
|
-
return text.slice("Output:\n".length);
|
|
2048
|
-
}
|
|
2049
|
-
return text;
|
|
2050
|
-
}
|
|
2051
|
-
function execTruncated(out) {
|
|
2052
|
-
return /Total output lines:|\.{3}\d+ tokens truncated\.{3}|\[\.{3}\d+ characters truncated/.test(
|
|
2053
|
-
String(out ?? "")
|
|
2054
|
-
);
|
|
2055
|
-
}
|
|
2056
|
-
function isExecSessionLostBanner(out) {
|
|
2057
|
-
return /write_stdin failed: session not found: \d+/.test(String(out ?? ""));
|
|
2058
|
-
}
|
|
2059
|
-
function looksBinary(text) {
|
|
2060
|
-
return text.includes("\0") || text.startsWith("\x7FELF");
|
|
2061
|
-
}
|
|
2062
|
-
function controlCaret(printable) {
|
|
2063
|
-
return String(printable).replace(
|
|
2064
|
-
/[\u0000-\u001f]/g,
|
|
2065
|
-
(c) => `^${String.fromCharCode(c.charCodeAt(0) + 64)}`
|
|
2066
|
-
);
|
|
2067
|
-
}
|
|
2068
|
-
function v4aToGitFileDiff(op) {
|
|
2069
|
-
const status = op.type === "create_file" ? "added" : op.type === "delete_file" ? "deleted" : op.moveTo ? "renamed" : "modified";
|
|
2070
|
-
const oldPath = op.moveTo ? op.path : null;
|
|
2071
|
-
const path = op.moveTo || op.path;
|
|
2072
|
-
const hunks = [];
|
|
2073
|
-
let additions = 0;
|
|
2074
|
-
let deletions = 0;
|
|
2075
|
-
let sawHunkAnchor = false;
|
|
2076
|
-
if (op.type !== "delete_file") {
|
|
2077
|
-
const lines = (op.diff ?? "").split("\n");
|
|
2078
|
-
let cur = null;
|
|
2079
|
-
let oldNo = 1;
|
|
2080
|
-
let newNo = 1;
|
|
2081
|
-
for (const raw of lines) {
|
|
2082
|
-
if (raw.startsWith("@@")) {
|
|
2083
|
-
sawHunkAnchor = true;
|
|
2084
|
-
const match = raw.match(/-(\d+)(?:,\d+)?\s+\+(\d+)/);
|
|
2085
|
-
oldNo = match ? Number(match[1]) : 1;
|
|
2086
|
-
newNo = match ? Number(match[2]) : 1;
|
|
2087
|
-
cur = {
|
|
2088
|
-
oldStart: oldNo,
|
|
2089
|
-
oldLines: 0,
|
|
2090
|
-
newStart: newNo,
|
|
2091
|
-
newLines: 0,
|
|
2092
|
-
header: raw,
|
|
2093
|
-
lines: [{ type: "meta", oldNo: null, newNo: null, text: raw }]
|
|
2094
|
-
};
|
|
2095
|
-
hunks.push(cur);
|
|
2096
|
-
} else if (cur || op.type === "create_file") {
|
|
2097
|
-
if (!cur) {
|
|
2098
|
-
cur = {
|
|
2099
|
-
oldStart: 0,
|
|
2100
|
-
oldLines: 0,
|
|
2101
|
-
newStart: 1,
|
|
2102
|
-
newLines: 0,
|
|
2103
|
-
header: "",
|
|
2104
|
-
lines: []
|
|
2105
|
-
};
|
|
2106
|
-
hunks.push(cur);
|
|
2107
|
-
oldNo = 0;
|
|
2108
|
-
newNo = 1;
|
|
2109
|
-
}
|
|
2110
|
-
if (raw.startsWith("+")) {
|
|
2111
|
-
cur.lines.push({
|
|
2112
|
-
type: "add",
|
|
2113
|
-
oldNo: null,
|
|
2114
|
-
newNo: newNo++,
|
|
2115
|
-
text: raw.slice(1)
|
|
2116
|
-
});
|
|
2117
|
-
cur.newLines += 1;
|
|
2118
|
-
additions += 1;
|
|
2119
|
-
} else if (raw.startsWith("-")) {
|
|
2120
|
-
cur.lines.push({
|
|
2121
|
-
type: "del",
|
|
2122
|
-
oldNo: oldNo++,
|
|
2123
|
-
newNo: null,
|
|
2124
|
-
text: raw.slice(1)
|
|
2125
|
-
});
|
|
2126
|
-
cur.oldLines += 1;
|
|
2127
|
-
deletions += 1;
|
|
2128
|
-
} else {
|
|
2129
|
-
cur.lines.push({
|
|
2130
|
-
type: "context",
|
|
2131
|
-
oldNo: oldNo++,
|
|
2132
|
-
newNo: newNo++,
|
|
2133
|
-
text: raw.replace(/^ /, "")
|
|
2134
|
-
});
|
|
2135
|
-
cur.oldLines += 1;
|
|
2136
|
-
cur.newLines += 1;
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
if (op.type === "update_file" && !sawHunkAnchor && lines.some((l) => l.trim().length > 0)) {
|
|
2141
|
-
throw new Error("malformed V4A: no @@ hunk anchor");
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
return {
|
|
2145
|
-
path,
|
|
2146
|
-
oldPath,
|
|
2147
|
-
status,
|
|
2148
|
-
isBinary: false,
|
|
2149
|
-
isImage: false,
|
|
2150
|
-
additions,
|
|
2151
|
-
deletions,
|
|
2152
|
-
hunks,
|
|
2153
|
-
truncated: false
|
|
2154
|
-
};
|
|
2155
|
-
}
|
|
2156
|
-
var BEGIN_PATCH = "*** Begin Patch";
|
|
2157
|
-
var END_PATCH = "*** End Patch";
|
|
2158
|
-
var ADD_FILE = "*** Add File: ";
|
|
2159
|
-
var DELETE_FILE = "*** Delete File: ";
|
|
2160
|
-
var UPDATE_FILE = "*** Update File: ";
|
|
2161
|
-
var MOVE_TO = "*** Move to: ";
|
|
2162
|
-
var APPLY_PATCH_OP_TYPES = /* @__PURE__ */ new Set(["create_file", "update_file", "delete_file"]);
|
|
2163
|
-
function isRecord(value) {
|
|
2164
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2165
|
-
}
|
|
2166
|
-
function freeformApplyPatchOps(rawPatch) {
|
|
2167
|
-
return parseFreeformApplyPatch(rawPatch.trimStart());
|
|
2168
|
-
}
|
|
2169
|
-
function asApplyPatchOperation(value) {
|
|
2170
|
-
if (!isRecord(value)) return null;
|
|
2171
|
-
if (typeof value.type !== "string" || !APPLY_PATCH_OP_TYPES.has(value.type)) {
|
|
2172
|
-
return null;
|
|
2173
|
-
}
|
|
2174
|
-
if (typeof value.path !== "string" || !value.path) {
|
|
2175
|
-
return null;
|
|
2176
|
-
}
|
|
2177
|
-
const op = {
|
|
2178
|
-
type: value.type,
|
|
2179
|
-
path: value.path
|
|
2180
|
-
};
|
|
2181
|
-
if (typeof value.diff === "string") op.diff = value.diff;
|
|
2182
|
-
if (typeof value.moveTo === "string" && value.moveTo.length > 0) op.moveTo = value.moveTo;
|
|
2183
|
-
return op;
|
|
2184
|
-
}
|
|
2185
|
-
function parseStructuredOperations(payloads) {
|
|
2186
|
-
if (payloads.length === 0) return [];
|
|
2187
|
-
const operations = [];
|
|
2188
|
-
for (const payload of payloads) {
|
|
2189
|
-
const op = asApplyPatchOperation(payload);
|
|
2190
|
-
if (!op) return [];
|
|
2191
|
-
operations.push(op);
|
|
2192
|
-
}
|
|
2193
|
-
return operations;
|
|
2194
|
-
}
|
|
2195
|
-
function parseFreeformApplyPatch(rawPatch) {
|
|
2196
|
-
const lines = rawPatch.split(/\r?\n/);
|
|
2197
|
-
if (lines.at(-1) === "") lines.pop();
|
|
2198
|
-
if (lines[0] !== BEGIN_PATCH) return [];
|
|
2199
|
-
if (lines.length < 2 || lines.at(-1) !== END_PATCH) return [];
|
|
2200
|
-
const operations = [];
|
|
2201
|
-
let index = 1;
|
|
2202
|
-
while (index < lines.length - 1) {
|
|
2203
|
-
const line = lines[index];
|
|
2204
|
-
let parsed = null;
|
|
2205
|
-
if (line.startsWith(ADD_FILE)) parsed = parseAddFilePatch(lines, index);
|
|
2206
|
-
else if (line.startsWith(DELETE_FILE)) parsed = parseDeleteFilePatch(lines, index);
|
|
2207
|
-
else if (line.startsWith(UPDATE_FILE)) parsed = parseUpdateFilePatch(lines, index);
|
|
2208
|
-
else return [];
|
|
2209
|
-
if (!parsed || "error" in parsed) return [];
|
|
2210
|
-
operations.push(parsed.operation);
|
|
2211
|
-
index = parsed.nextIndex;
|
|
2212
|
-
}
|
|
2213
|
-
return operations.length > 0 ? operations : [];
|
|
2214
|
-
}
|
|
2215
|
-
function parsePatchHeader(line, prefix) {
|
|
2216
|
-
const path = line.slice(prefix.length).trim();
|
|
2217
|
-
return path || null;
|
|
2218
|
-
}
|
|
2219
|
-
function isFileOperationHeader(line) {
|
|
2220
|
-
return line.startsWith(ADD_FILE) || line.startsWith(DELETE_FILE) || line.startsWith(UPDATE_FILE);
|
|
2221
|
-
}
|
|
2222
|
-
function joinDiff(lines) {
|
|
2223
|
-
return `${lines.join("\n")}
|
|
2224
|
-
`;
|
|
2225
|
-
}
|
|
2226
|
-
function parseAddFilePatch(lines, index) {
|
|
2227
|
-
const path = parsePatchHeader(lines[index], ADD_FILE);
|
|
2228
|
-
if (!path) return { error: true };
|
|
2229
|
-
index += 1;
|
|
2230
|
-
const diffLines = [];
|
|
2231
|
-
while (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
2232
|
-
const line = lines[index];
|
|
2233
|
-
if (!line.startsWith("+")) return { error: true };
|
|
2234
|
-
diffLines.push(line);
|
|
2235
|
-
index += 1;
|
|
2236
|
-
}
|
|
2237
|
-
if (diffLines.length === 0) return { error: true };
|
|
2238
|
-
return {
|
|
2239
|
-
operation: { type: "create_file", path, diff: joinDiff(diffLines) },
|
|
2240
|
-
nextIndex: index
|
|
2241
|
-
};
|
|
2242
|
-
}
|
|
2243
|
-
function parseDeleteFilePatch(lines, index) {
|
|
2244
|
-
const path = parsePatchHeader(lines[index], DELETE_FILE);
|
|
2245
|
-
if (!path) return { error: true };
|
|
2246
|
-
index += 1;
|
|
2247
|
-
if (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
2248
|
-
return { error: true };
|
|
2249
|
-
}
|
|
2250
|
-
return { operation: { type: "delete_file", path }, nextIndex: index };
|
|
2251
|
-
}
|
|
2252
|
-
function parseUpdateFilePatch(lines, index) {
|
|
2253
|
-
const path = parsePatchHeader(lines[index], UPDATE_FILE);
|
|
2254
|
-
if (!path) return { error: true };
|
|
2255
|
-
index += 1;
|
|
2256
|
-
let moveTo;
|
|
2257
|
-
if (index < lines.length - 1 && lines[index].startsWith(MOVE_TO)) {
|
|
2258
|
-
const parsedMoveTo = parsePatchHeader(lines[index], MOVE_TO);
|
|
2259
|
-
if (!parsedMoveTo) return { error: true };
|
|
2260
|
-
moveTo = parsedMoveTo;
|
|
2261
|
-
index += 1;
|
|
2262
|
-
}
|
|
2263
|
-
const diffLines = [];
|
|
2264
|
-
while (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
2265
|
-
diffLines.push(lines[index]);
|
|
2266
|
-
index += 1;
|
|
2267
|
-
}
|
|
2268
|
-
if (diffLines.length === 0 && !moveTo) return { error: true };
|
|
2269
|
-
return {
|
|
2270
|
-
operation: {
|
|
2271
|
-
type: "update_file",
|
|
2272
|
-
path,
|
|
2273
|
-
diff: diffLines.length > 0 ? joinDiff(diffLines) : "",
|
|
2274
|
-
...moveTo ? { moveTo } : {}
|
|
2275
|
-
},
|
|
2276
|
-
nextIndex: index
|
|
2277
|
-
};
|
|
2278
|
-
}
|
|
2279
|
-
function applyPatchOps(raw) {
|
|
2280
|
-
if (raw == null) return [];
|
|
2281
|
-
if (typeof raw === "string") {
|
|
2282
|
-
const trimmed = raw.trimStart();
|
|
2283
|
-
if (trimmed.startsWith(BEGIN_PATCH)) return freeformApplyPatchOps(trimmed);
|
|
2284
|
-
const parsed = tryParseJson(trimmed);
|
|
2285
|
-
return parsed === void 0 ? [] : applyPatchOps(parsed);
|
|
2286
|
-
}
|
|
2287
|
-
if (Array.isArray(raw)) return parseStructuredOperations(raw);
|
|
2288
|
-
if (!isRecord(raw)) return [];
|
|
2289
|
-
if (typeof raw.patch === "string") return freeformApplyPatchOps(raw.patch);
|
|
2290
|
-
if (Array.isArray(raw.command)) {
|
|
2291
|
-
const [commandName, patch] = raw.command;
|
|
2292
|
-
if (commandName === "apply_patch" && typeof patch === "string") {
|
|
2293
|
-
return freeformApplyPatchOps(patch);
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
if (Array.isArray(raw.operations) && raw.operations.length > 0) {
|
|
2297
|
-
return parseStructuredOperations(raw.operations);
|
|
2298
|
-
}
|
|
2299
|
-
if (raw.operation !== void 0) {
|
|
2300
|
-
const op = asApplyPatchOperation(raw.operation);
|
|
2301
|
-
return op ? [op] : [];
|
|
2302
|
-
}
|
|
2303
|
-
const flat = asApplyPatchOperation(raw);
|
|
2304
|
-
return flat ? [flat] : [];
|
|
2305
|
-
}
|
|
2306
|
-
function applyPatchOpsFromToolItem(item) {
|
|
2307
|
-
const fromRaw = applyPatchOps(item.raw);
|
|
2308
|
-
if (fromRaw.length > 0) return fromRaw;
|
|
2309
|
-
if (isRecord(item.raw)) {
|
|
2310
|
-
const nested = item.raw.arguments ?? item.raw.input;
|
|
2311
|
-
if (nested !== void 0 && nested !== item.arguments) {
|
|
2312
|
-
const fromNested = applyPatchOps(nested);
|
|
2313
|
-
if (fromNested.length > 0) return fromNested;
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
if (item.arguments !== void 0 && item.arguments !== null) {
|
|
2317
|
-
return applyPatchOps(item.arguments);
|
|
2318
|
-
}
|
|
2319
|
-
return [];
|
|
2320
|
-
}
|
|
2321
|
-
function isApplyPatch(item) {
|
|
2322
|
-
const type = item.raw && typeof item.raw === "object" ? item.raw.type : void 0;
|
|
2323
|
-
if (type === "apply_patch_call") {
|
|
2324
|
-
return true;
|
|
2325
|
-
}
|
|
2326
|
-
const name = item.name;
|
|
2327
|
-
return name === "apply_patch_call" || name === "apply_patch" || name.endsWith("__apply_patch");
|
|
2328
|
-
}
|
|
2329
|
-
function parseToolArgs(args) {
|
|
2330
|
-
if (args == null) {
|
|
2331
|
-
return {};
|
|
2332
|
-
}
|
|
2333
|
-
if (typeof args === "string") {
|
|
2334
|
-
const parsed = tryParseJson(args);
|
|
2335
|
-
return parsed && typeof parsed === "object" ? parsed : {};
|
|
2336
|
-
}
|
|
2337
|
-
return typeof args === "object" ? args : {};
|
|
2338
|
-
}
|
|
2339
|
-
function tailPeek(text) {
|
|
2340
|
-
const trimmed = text.trim();
|
|
2341
|
-
if (!trimmed) {
|
|
2342
|
-
return "";
|
|
2343
|
-
}
|
|
2344
|
-
const lines = trimmed.split("\n");
|
|
2345
|
-
return lines[lines.length - 1] ?? "";
|
|
2346
|
-
}
|
|
2347
|
-
function unwrapMcpOutput(output) {
|
|
2348
|
-
const normalized = normalizeMcpOutput(output);
|
|
2349
|
-
return { text: normalized.text, isError: normalized.isError };
|
|
2350
|
-
}
|
|
2351
|
-
function screenshotDataUrl(out) {
|
|
2352
|
-
if (typeof out === "string") {
|
|
2353
|
-
if (out.startsWith("data:image")) {
|
|
2354
|
-
return out;
|
|
2355
|
-
}
|
|
2356
|
-
if (out.startsWith("{") || out.startsWith("[")) {
|
|
2357
|
-
const parsed = tryParseJson(out);
|
|
2358
|
-
if (parsed !== void 0 && parsed !== out) {
|
|
2359
|
-
return screenshotDataUrl(parsed);
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
return null;
|
|
2363
|
-
}
|
|
2364
|
-
if (Array.isArray(out)) {
|
|
2365
|
-
for (const entry of out) {
|
|
2366
|
-
const url = screenshotDataUrl(entry);
|
|
2367
|
-
if (url) {
|
|
2368
|
-
return url;
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
return null;
|
|
2372
|
-
}
|
|
2373
|
-
if (out === null || typeof out !== "object") {
|
|
2374
|
-
return null;
|
|
2375
|
-
}
|
|
2376
|
-
const record = out;
|
|
2377
|
-
const imageUrl = record.image_url ?? record.imageUrl;
|
|
2378
|
-
if (typeof imageUrl === "string" && imageUrl.startsWith("data:image")) {
|
|
2379
|
-
return imageUrl;
|
|
2380
|
-
}
|
|
2381
|
-
if (imageUrl && typeof imageUrl === "object") {
|
|
2382
|
-
const url = imageUrl.url;
|
|
2383
|
-
if (typeof url === "string" && url.startsWith("data:image")) {
|
|
2384
|
-
return url;
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
const image = record.image;
|
|
2388
|
-
if (image && typeof image === "object") {
|
|
2389
|
-
const mediaType = typeof image.mediaType === "string" ? image.mediaType : "image/png";
|
|
2390
|
-
const base64 = bytesToBase64(image.data);
|
|
2391
|
-
if (base64) {
|
|
2392
|
-
return `data:${mediaType};base64,${base64}`;
|
|
2393
|
-
}
|
|
2394
|
-
if (typeof image.data === "string" && image.data.length > 0) {
|
|
2395
|
-
return `data:${mediaType};base64,${image.data}`;
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
return null;
|
|
2399
|
-
}
|
|
2400
|
-
function retainedScreenshotMetadata(out) {
|
|
2401
|
-
if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
|
|
2402
|
-
const parsed = tryParseJson(out);
|
|
2403
|
-
if (parsed !== void 0 && parsed !== out) return retainedScreenshotMetadata(parsed);
|
|
2404
|
-
}
|
|
2405
|
-
if (Array.isArray(out)) {
|
|
2406
|
-
for (const entry of out) {
|
|
2407
|
-
const metadata = retainedScreenshotMetadata(entry);
|
|
2408
|
-
if (metadata) return metadata;
|
|
2409
|
-
}
|
|
2410
|
-
return null;
|
|
2411
|
-
}
|
|
2412
|
-
if (!out || typeof out !== "object") return null;
|
|
2413
|
-
const value = out;
|
|
2414
|
-
if (typeof value.artifactId !== "string" || typeof value.available !== "boolean") return null;
|
|
2415
|
-
if (!value.available) {
|
|
2416
|
-
return typeof value.reason === "string" ? value : null;
|
|
2417
|
-
}
|
|
2418
|
-
return (value.kind === "computer_screenshot" || value.kind === "browser_screenshot") && ["image/png", "image/jpeg", "image/webp"].includes(String(value.contentType)) && typeof value.originalBytes === "number" && typeof value.sha256 === "string" && value.dimensions !== null && typeof value.dimensions === "object" && value.retention !== null && typeof value.retention === "object" && value.retention.policy === "session_screenshot" ? value : null;
|
|
2419
|
-
}
|
|
2420
|
-
function generatedImageReceipt(out) {
|
|
2421
|
-
return parseGeneratedImageReceipt(out);
|
|
2422
|
-
}
|
|
2423
|
-
function mediaPreviewFact(out) {
|
|
2424
|
-
if (typeof out === "string" && (out.startsWith("{") || out.startsWith("["))) {
|
|
2425
|
-
const parsed = tryParseJson(out);
|
|
2426
|
-
if (parsed !== void 0 && parsed !== out) return mediaPreviewFact(parsed);
|
|
2427
|
-
}
|
|
2428
|
-
if (Array.isArray(out)) {
|
|
2429
|
-
for (const entry of out) {
|
|
2430
|
-
const preview = mediaPreviewFact(entry);
|
|
2431
|
-
if (preview) return preview;
|
|
2432
|
-
}
|
|
2433
|
-
return null;
|
|
2434
|
-
}
|
|
2435
|
-
if (!out || typeof out !== "object") return null;
|
|
2436
|
-
const record = out;
|
|
2437
|
-
if (record.type !== "media_preview" || typeof record.mediaType !== "string" || record.fullOutputAvailable !== false || typeof record.preview !== "string" || record.inlineBytes !== null && typeof record.inlineBytes !== "number") {
|
|
2438
|
-
return null;
|
|
2439
|
-
}
|
|
2440
|
-
return record;
|
|
2441
|
-
}
|
|
2442
|
-
function bytesToBase64(data) {
|
|
2443
|
-
const isByte = (n) => typeof n === "number" && Number.isInteger(n) && n >= 0 && n <= 255;
|
|
2444
|
-
let bytes = null;
|
|
2445
|
-
if (Array.isArray(data) && data.every(isByte)) {
|
|
2446
|
-
bytes = data;
|
|
2447
|
-
} else if (data && typeof data === "object") {
|
|
2448
|
-
const record = data;
|
|
2449
|
-
if (record.type === "Buffer" && Array.isArray(record.data) && record.data.every(isByte)) {
|
|
2450
|
-
bytes = record.data;
|
|
2451
|
-
} else {
|
|
2452
|
-
const keys = Object.keys(record);
|
|
2453
|
-
if (keys.length > 0 && keys.every((key) => /^\d+$/.test(key))) {
|
|
2454
|
-
const values = keys.sort((a, b) => Number(a) - Number(b)).map((key) => record[key]);
|
|
2455
|
-
if (values.every(isByte)) {
|
|
2456
|
-
bytes = values;
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
if (!bytes || bytes.length === 0) {
|
|
2462
|
-
return null;
|
|
2463
|
-
}
|
|
2464
|
-
try {
|
|
2465
|
-
let binary = "";
|
|
2466
|
-
const CHUNK = 32768;
|
|
2467
|
-
for (let i = 0; i < bytes.length; i += CHUNK) {
|
|
2468
|
-
binary += String.fromCharCode(...bytes.slice(i, i + CHUNK));
|
|
2469
|
-
}
|
|
2470
|
-
return typeof btoa === "function" ? btoa(binary) : Buffer.from(binary, "binary").toString("base64");
|
|
2471
|
-
} catch {
|
|
2472
|
-
return null;
|
|
2473
|
-
}
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
-
// src/timeline/registry.ts
|
|
2477
|
-
function rawTypeOf(item) {
|
|
2478
|
-
const raw = item.raw;
|
|
2479
|
-
if (raw && typeof raw === "object" && typeof raw.type === "string") {
|
|
2480
|
-
return raw.type;
|
|
2481
|
-
}
|
|
2482
|
-
return null;
|
|
2483
|
-
}
|
|
2484
|
-
function createToolRegistry(baseEntries, baseFallback, options = {}) {
|
|
2485
|
-
const entries = [...options.entries ?? [], ...baseEntries];
|
|
2486
|
-
const fallback2 = options.fallback ?? baseFallback;
|
|
2487
|
-
const byRawType = /* @__PURE__ */ new Map();
|
|
2488
|
-
const byName = /* @__PURE__ */ new Map();
|
|
2489
|
-
const byPrefixedLeaf = /* @__PURE__ */ new Map();
|
|
2490
|
-
for (const entry of entries) {
|
|
2491
|
-
if (entry.match === "rawType") {
|
|
2492
|
-
if (!byRawType.has(entry.type)) {
|
|
2493
|
-
byRawType.set(entry.type, entry.render);
|
|
2494
|
-
}
|
|
2495
|
-
} else if (!byName.has(entry.name)) {
|
|
2496
|
-
byName.set(entry.name, entry.render);
|
|
2497
|
-
}
|
|
2498
|
-
if (entry.match === "name" && entry.matchPrefixedLeaf !== false) {
|
|
2499
|
-
if (!byPrefixedLeaf.has(entry.name)) {
|
|
2500
|
-
byPrefixedLeaf.set(entry.name, entry.render);
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
const resolve = (item) => {
|
|
2505
|
-
const rawType = rawTypeOf(item);
|
|
2506
|
-
if (rawType) {
|
|
2507
|
-
const byType = byRawType.get(rawType);
|
|
2508
|
-
if (byType) {
|
|
2509
|
-
return byType;
|
|
2510
|
-
}
|
|
2511
|
-
}
|
|
2512
|
-
const exact = byName.get(item.name);
|
|
2513
|
-
if (exact) {
|
|
2514
|
-
return exact;
|
|
2515
|
-
}
|
|
2516
|
-
const leaf = mcpToolLeaf(item.name);
|
|
2517
|
-
if (leaf !== item.name) {
|
|
2518
|
-
const byLeaf = byPrefixedLeaf.get(leaf);
|
|
2519
|
-
if (byLeaf) {
|
|
2520
|
-
return byLeaf;
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
return fallback2;
|
|
2524
|
-
};
|
|
2525
|
-
return { resolve, fallback: fallback2 };
|
|
2526
|
-
}
|
|
2527
|
-
|
|
2528
2002
|
// src/lib/git-patch.ts
|
|
2529
2003
|
function gitFileDiffToPatch(file) {
|
|
2530
2004
|
const oldPath = file.oldPath ?? file.path;
|
|
@@ -2695,9 +2169,7 @@ function PlainPatch({ diff }) {
|
|
|
2695
2169
|
|
|
2696
2170
|
// src/timeline/tool-renderers.tsx
|
|
2697
2171
|
import { defaultUrlTransform } from "react-markdown";
|
|
2698
|
-
import {
|
|
2699
|
-
parseSandboxFileArtifactReceipt
|
|
2700
|
-
} from "@opengeni/sdk";
|
|
2172
|
+
import { parseSandboxFileArtifactReceipt } from "@opengeni/sdk";
|
|
2701
2173
|
import {
|
|
2702
2174
|
BoxIcon,
|
|
2703
2175
|
BrainCircuitIcon as BrainCircuitIcon2,
|
|
@@ -2792,7 +2264,7 @@ function RawPatch({ diff }) {
|
|
|
2792
2264
|
}
|
|
2793
2265
|
|
|
2794
2266
|
// src/timeline/tool-renderers.tsx
|
|
2795
|
-
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2267
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2796
2268
|
var ICON_SIZE = "size-3.5";
|
|
2797
2269
|
function RunningPreview({ children }) {
|
|
2798
2270
|
const compact = useContext4(CompactActivityContext);
|
|
@@ -2801,173 +2273,6 @@ function RunningPreview({ children }) {
|
|
|
2801
2273
|
/* @__PURE__ */ jsx9("span", { className: "min-w-0 truncate", children })
|
|
2802
2274
|
] });
|
|
2803
2275
|
}
|
|
2804
|
-
function withComputePreview(label, preview) {
|
|
2805
|
-
if (!label) {
|
|
2806
|
-
return preview;
|
|
2807
|
-
}
|
|
2808
|
-
return `on ${label} \xB7 ${preview}`;
|
|
2809
|
-
}
|
|
2810
|
-
function ExecRenderer({ item }) {
|
|
2811
|
-
const args = parseToolArgs(item.arguments);
|
|
2812
|
-
const cmd = typeof args.cmd === "string" ? args.cmd : "";
|
|
2813
|
-
const workdir = typeof args.workdir === "string" ? args.workdir : null;
|
|
2814
|
-
const running = item.status === "running";
|
|
2815
|
-
const out = item.output;
|
|
2816
|
-
const title = `$ ${cmd}`;
|
|
2817
|
-
const computeLabel = useTimelineComputeLabel();
|
|
2818
|
-
if (item.status === "failed" && out === void 0) {
|
|
2819
|
-
return /* @__PURE__ */ jsx9(
|
|
2820
|
-
ActivityDisclosure,
|
|
2821
|
-
{
|
|
2822
|
-
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2823
|
-
iconTone: "failed",
|
|
2824
|
-
title,
|
|
2825
|
-
titleMono: true,
|
|
2826
|
-
chip: { tone: "bad", text: "failed" },
|
|
2827
|
-
preview: withComputePreview(computeLabel, "output lost \u2014 NUL byte could not be stored"),
|
|
2828
|
-
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "output contained a NUL byte and could not be stored; the turn failed on this tool's output insert \u2014 no output event ever arrived." })
|
|
2829
|
-
}
|
|
2830
|
-
);
|
|
2831
|
-
}
|
|
2832
|
-
if (item.status === "failed" && (out == null || out === "")) {
|
|
2833
|
-
return /* @__PURE__ */ jsx9(
|
|
2834
|
-
ActivityDisclosure,
|
|
2835
|
-
{
|
|
2836
|
-
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2837
|
-
iconTone: "failed",
|
|
2838
|
-
title,
|
|
2839
|
-
titleMono: true,
|
|
2840
|
-
chip: { tone: "bad", text: "failed" },
|
|
2841
|
-
preview: withComputePreview(computeLabel, "tool call failed"),
|
|
2842
|
-
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: "the tool call failed with no output." })
|
|
2843
|
-
}
|
|
2844
|
-
);
|
|
2845
|
-
}
|
|
2846
|
-
if (running) {
|
|
2847
|
-
const streamed = typeof out === "string" ? stripExecBanner(out) : "";
|
|
2848
|
-
const runningPreview = streamed ? `${streamed.split("\n").length} lines` : "running\u2026";
|
|
2849
|
-
return /* @__PURE__ */ jsx9(
|
|
2850
|
-
ActivityDisclosure,
|
|
2851
|
-
{
|
|
2852
|
-
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2853
|
-
iconTone: "running",
|
|
2854
|
-
title,
|
|
2855
|
-
titleMono: true,
|
|
2856
|
-
running: true,
|
|
2857
|
-
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: withComputePreview(computeLabel, runningPreview) }),
|
|
2858
|
-
children: /* @__PURE__ */ jsx9(TermBlock, { command: null, workdir, output: streamed, live: true })
|
|
2859
|
-
}
|
|
2860
|
-
);
|
|
2861
|
-
}
|
|
2862
|
-
const text = typeof out === "string" ? out : stringifyPayload(out);
|
|
2863
|
-
const stripped = stripExecBanner(text);
|
|
2864
|
-
const bgSession = parseExecBannerSessionId(text);
|
|
2865
|
-
const exitCode = sandboxCommandExitCode(text);
|
|
2866
|
-
const binary = looksBinary(stripped);
|
|
2867
|
-
let chip;
|
|
2868
|
-
let iconTone = "muted";
|
|
2869
|
-
if (bgSession != null) {
|
|
2870
|
-
chip = { tone: "muted", text: `session ${bgSession}` };
|
|
2871
|
-
} else if (exitCode != null && exitCode !== 0) {
|
|
2872
|
-
chip = { tone: "bad", text: `exit ${exitCode}` };
|
|
2873
|
-
iconTone = "failed";
|
|
2874
|
-
}
|
|
2875
|
-
const peek = binary ? "binary output" : tailPeek(stripped) || "(no output)";
|
|
2876
|
-
const truncated = execTruncated(text);
|
|
2877
|
-
const preview = withComputePreview(computeLabel, truncated ? `\u22EF truncated \xB7 ${peek}` : peek);
|
|
2878
|
-
const body = binary ? "(binary output suppressed)" : stripped;
|
|
2879
|
-
return /* @__PURE__ */ jsxs6(
|
|
2880
|
-
ActivityDisclosure,
|
|
2881
|
-
{
|
|
2882
|
-
icon: /* @__PURE__ */ jsx9(TerminalIcon, { className: ICON_SIZE }),
|
|
2883
|
-
iconTone,
|
|
2884
|
-
title,
|
|
2885
|
-
titleMono: true,
|
|
2886
|
-
...chip ? { chip } : {},
|
|
2887
|
-
failed: item.status === "failed",
|
|
2888
|
-
cancelled: item.status === "cancelled",
|
|
2889
|
-
preview,
|
|
2890
|
-
children: [
|
|
2891
|
-
/* @__PURE__ */ jsx9(
|
|
2892
|
-
TermBlock,
|
|
2893
|
-
{
|
|
2894
|
-
command: null,
|
|
2895
|
-
workdir,
|
|
2896
|
-
output: body,
|
|
2897
|
-
failed: item.status === "failed" || exitCode != null && exitCode !== 0
|
|
2898
|
-
}
|
|
2899
|
-
),
|
|
2900
|
-
bgSession != null ? /* @__PURE__ */ jsxs6(BodyNote, { children: [
|
|
2901
|
-
"\u21B3 session ",
|
|
2902
|
-
bgSession,
|
|
2903
|
-
" \u2014 a later write_stdin can target this PTY."
|
|
2904
|
-
] }) : null
|
|
2905
|
-
]
|
|
2906
|
-
}
|
|
2907
|
-
);
|
|
2908
|
-
}
|
|
2909
|
-
function WriteStdinRenderer({ item }) {
|
|
2910
|
-
const args = parseToolArgs(item.arguments);
|
|
2911
|
-
const sessionId = typeof args.session_id === "string" || typeof args.session_id === "number" ? args.session_id : void 0;
|
|
2912
|
-
const running = item.status === "running";
|
|
2913
|
-
const text = typeof item.output === "string" ? item.output : stringifyPayload(item.output);
|
|
2914
|
-
const lost = isExecSessionLostBanner(text);
|
|
2915
|
-
const keys = controlCaret(typeof args.chars === "string" ? args.chars : "");
|
|
2916
|
-
const exitCode = sandboxCommandExitCode(text);
|
|
2917
|
-
const stripped = stripExecBanner(text);
|
|
2918
|
-
if (running) {
|
|
2919
|
-
return /* @__PURE__ */ jsx9(
|
|
2920
|
-
ActivityDisclosure,
|
|
2921
|
-
{
|
|
2922
|
-
icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
|
|
2923
|
-
iconTone: "running",
|
|
2924
|
-
title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
|
|
2925
|
-
titleMono: true,
|
|
2926
|
-
running: true,
|
|
2927
|
-
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "sending\u2026" }),
|
|
2928
|
-
children: /* @__PURE__ */ jsxs6(BodyNote, { children: [
|
|
2929
|
-
"sending input to session ",
|
|
2930
|
-
sessionId,
|
|
2931
|
-
"\u2026"
|
|
2932
|
-
] })
|
|
2933
|
-
}
|
|
2934
|
-
);
|
|
2935
|
-
}
|
|
2936
|
-
let chip;
|
|
2937
|
-
if (lost) {
|
|
2938
|
-
chip = { tone: "bad", text: "lost" };
|
|
2939
|
-
} else if (exitCode != null && exitCode !== 0) {
|
|
2940
|
-
chip = { tone: "bad", text: `exit ${exitCode}` };
|
|
2941
|
-
}
|
|
2942
|
-
return /* @__PURE__ */ jsx9(
|
|
2943
|
-
ActivityDisclosure,
|
|
2944
|
-
{
|
|
2945
|
-
icon: /* @__PURE__ */ jsx9(KeyboardIcon, { className: ICON_SIZE }),
|
|
2946
|
-
iconTone: lost ? "failed" : "muted",
|
|
2947
|
-
title: `session ${sessionId} \u2190 ${keys || "\u2205"}`,
|
|
2948
|
-
titleMono: true,
|
|
2949
|
-
...chip ? { chip } : {},
|
|
2950
|
-
failed: item.status === "failed",
|
|
2951
|
-
cancelled: item.status === "cancelled",
|
|
2952
|
-
preview: lost ? `session ${sessionId} PTY vanished` : tailPeek(stripped) || "sent",
|
|
2953
|
-
children: lost ? /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: stripped || text }) : /* @__PURE__ */ jsx9(TermBlock, { command: `write_stdin \u2192 session ${sessionId}`, output: stripped })
|
|
2954
|
-
}
|
|
2955
|
-
);
|
|
2956
|
-
}
|
|
2957
|
-
function verbForOp(op) {
|
|
2958
|
-
if (!op) {
|
|
2959
|
-
return "Edited";
|
|
2960
|
-
}
|
|
2961
|
-
return op.type === "create_file" ? "Created" : op.type === "delete_file" ? "Deleted" : op.moveTo ? "Renamed" : "Edited";
|
|
2962
|
-
}
|
|
2963
|
-
function basename(path) {
|
|
2964
|
-
const parts = path.split("/").filter(Boolean);
|
|
2965
|
-
return parts.length ? parts[parts.length - 1] : path;
|
|
2966
|
-
}
|
|
2967
|
-
function dirname(path) {
|
|
2968
|
-
const idx = path.lastIndexOf("/");
|
|
2969
|
-
return idx >= 0 ? path.slice(0, idx + 1) : "";
|
|
2970
|
-
}
|
|
2971
2276
|
function PathPreview({
|
|
2972
2277
|
path,
|
|
2973
2278
|
add,
|
|
@@ -2975,8 +2280,8 @@ function PathPreview({
|
|
|
2975
2280
|
}) {
|
|
2976
2281
|
return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 truncate font-og-mono", children: [
|
|
2977
2282
|
/* @__PURE__ */ jsxs6("span", { className: "truncate", children: [
|
|
2978
|
-
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children:
|
|
2979
|
-
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children:
|
|
2283
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: pathDirname(path) }),
|
|
2284
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: pathBasename(path) })
|
|
2980
2285
|
] }),
|
|
2981
2286
|
add != null || del != null ? /* @__PURE__ */ jsxs6("span", { className: "shrink-0 text-og-fg-subtle", children: [
|
|
2982
2287
|
add != null ? `+${add}` : "",
|
|
@@ -2985,133 +2290,180 @@ function PathPreview({
|
|
|
2985
2290
|
] }) : null
|
|
2986
2291
|
] });
|
|
2987
2292
|
}
|
|
2988
|
-
function
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
] }),
|
|
3046
|
-
/* @__PURE__ */ jsxs6("span", { className: "text-og-fg-subtle", children: [
|
|
3047
|
-
"+",
|
|
3048
|
-
add,
|
|
3049
|
-
" \u2212",
|
|
3050
|
-
del
|
|
3051
|
-
] })
|
|
3052
|
-
] }),
|
|
3053
|
-
children: ops.map((op, index) => {
|
|
3054
|
-
const file2 = parsed[index];
|
|
3055
|
-
const key = `${op.type}:${op.path}:${index}`;
|
|
3056
|
-
return file2 ? /* @__PURE__ */ jsx9(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs6("div", { children: [
|
|
3057
|
-
/* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
|
|
3058
|
-
/* @__PURE__ */ jsx9(RawPatch, { diff: op.diff ?? "" })
|
|
3059
|
-
] }, key);
|
|
3060
|
-
})
|
|
3061
|
-
}
|
|
3062
|
-
);
|
|
3063
|
-
}
|
|
3064
|
-
if (!firstOp) {
|
|
3065
|
-
return /* @__PURE__ */ jsx9(GenericRenderer, { item });
|
|
3066
|
-
}
|
|
3067
|
-
if (firstOp.type === "delete_file") {
|
|
3068
|
-
return /* @__PURE__ */ jsx9(
|
|
3069
|
-
ActivityDisclosure,
|
|
3070
|
-
{
|
|
3071
|
-
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
3072
|
-
iconTone: "failed",
|
|
3073
|
-
title: `Deleted ${basename(firstOp.path)}`,
|
|
3074
|
-
cancelled,
|
|
3075
|
-
preview: /* @__PURE__ */ jsx9(PathPreview, { path: firstOp.path }),
|
|
3076
|
-
children: /* @__PURE__ */ jsx9(BodyNote, { children: "File deleted \u2014 no diff to show." })
|
|
3077
|
-
}
|
|
3078
|
-
);
|
|
3079
|
-
}
|
|
3080
|
-
const file = safeParseOp(firstOp);
|
|
3081
|
-
if (!file) {
|
|
3082
|
-
return /* @__PURE__ */ jsx9(
|
|
3083
|
-
ActivityDisclosure,
|
|
3084
|
-
{
|
|
3085
|
-
icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: ICON_SIZE }),
|
|
3086
|
-
iconTone: "accent",
|
|
3087
|
-
title: `${verbForOp(firstOp)} ${basename(firstOp.path)}`,
|
|
3088
|
-
cancelled,
|
|
3089
|
-
preview: /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
|
|
3090
|
-
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: basename(firstOp.path) }),
|
|
3091
|
-
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: "malformed V4A" })
|
|
2293
|
+
function toolIcon(kind) {
|
|
2294
|
+
switch (kind) {
|
|
2295
|
+
case "terminal":
|
|
2296
|
+
return TerminalIcon;
|
|
2297
|
+
case "keyboard":
|
|
2298
|
+
return KeyboardIcon;
|
|
2299
|
+
case "file-diff":
|
|
2300
|
+
return FileDiffIcon;
|
|
2301
|
+
case "search":
|
|
2302
|
+
return SearchIcon;
|
|
2303
|
+
case "question":
|
|
2304
|
+
return MessageCircleQuestionIcon2;
|
|
2305
|
+
case "target":
|
|
2306
|
+
return TargetIcon;
|
|
2307
|
+
case "brain":
|
|
2308
|
+
return BrainCircuitIcon2;
|
|
2309
|
+
case "sessions":
|
|
2310
|
+
return MessagesSquareIcon;
|
|
2311
|
+
case "server":
|
|
2312
|
+
return ServerIcon;
|
|
2313
|
+
case "server-cog":
|
|
2314
|
+
return ServerCogIcon;
|
|
2315
|
+
case "calendar":
|
|
2316
|
+
return CalendarClockIcon;
|
|
2317
|
+
case "panels":
|
|
2318
|
+
return PanelsTopLeftIcon;
|
|
2319
|
+
case "share":
|
|
2320
|
+
return Share2Icon;
|
|
2321
|
+
case "message":
|
|
2322
|
+
return MessageSquareIcon;
|
|
2323
|
+
case "git":
|
|
2324
|
+
return FolderGitIcon;
|
|
2325
|
+
case "box":
|
|
2326
|
+
return BoxIcon;
|
|
2327
|
+
case "key":
|
|
2328
|
+
return KeyRoundIcon;
|
|
2329
|
+
case "file-search":
|
|
2330
|
+
return FileSearchIcon;
|
|
2331
|
+
case "package-search":
|
|
2332
|
+
return PackageSearchIcon;
|
|
2333
|
+
case "plug":
|
|
2334
|
+
return PlugIcon;
|
|
2335
|
+
case "wrench":
|
|
2336
|
+
return WrenchIcon;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
function presentedPreviewNode(preview) {
|
|
2340
|
+
switch (preview.kind) {
|
|
2341
|
+
case "text":
|
|
2342
|
+
return preview.running ? /* @__PURE__ */ jsx9(RunningPreview, { children: preview.text }) : preview.text;
|
|
2343
|
+
case "path":
|
|
2344
|
+
return /* @__PURE__ */ jsx9(PathPreview, { path: preview.path, add: preview.add, del: preview.del });
|
|
2345
|
+
case "files":
|
|
2346
|
+
return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
|
|
2347
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-og-fg-muted", children: [
|
|
2348
|
+
preview.count,
|
|
2349
|
+
" files"
|
|
3092
2350
|
] }),
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
2351
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-og-fg-subtle", children: [
|
|
2352
|
+
"+",
|
|
2353
|
+
preview.add,
|
|
2354
|
+
" \u2212",
|
|
2355
|
+
preview.del
|
|
2356
|
+
] })
|
|
2357
|
+
] });
|
|
2358
|
+
case "malformed":
|
|
2359
|
+
return /* @__PURE__ */ jsxs6("span", { className: "inline-flex items-center gap-2 font-og-mono", children: [
|
|
2360
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-muted", children: preview.name }),
|
|
2361
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: "malformed V4A" })
|
|
2362
|
+
] });
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
function PresentedBody({ body }) {
|
|
2366
|
+
switch (body.kind) {
|
|
2367
|
+
case "term":
|
|
2368
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2369
|
+
/* @__PURE__ */ jsx9(
|
|
2370
|
+
TermBlock,
|
|
2371
|
+
{
|
|
2372
|
+
command: body.command,
|
|
2373
|
+
...body.workdir !== null || body.command === null ? { workdir: body.workdir } : {},
|
|
2374
|
+
output: body.output,
|
|
2375
|
+
...body.live ? { live: true } : {},
|
|
2376
|
+
...body.failed !== void 0 ? { failed: body.failed } : {}
|
|
2377
|
+
}
|
|
2378
|
+
),
|
|
2379
|
+
body.note ? /* @__PURE__ */ jsx9(BodyNote, { children: body.note }) : null
|
|
2380
|
+
] });
|
|
2381
|
+
case "note":
|
|
2382
|
+
return body.tone ? /* @__PURE__ */ jsx9(BodyNote, { tone: body.tone, children: body.text }) : /* @__PURE__ */ jsx9(BodyNote, { children: body.text });
|
|
2383
|
+
case "payloads":
|
|
2384
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2385
|
+
body.note ? /* @__PURE__ */ jsx9("p", { className: "m-0 py-1 text-og-sm text-og-fg-muted", children: body.note }) : null,
|
|
2386
|
+
body.blocks.map(
|
|
2387
|
+
(block) => block.failed ? /* @__PURE__ */ jsx9(PayloadBlock, { label: block.label, value: block.value, failed: true }, block.label) : /* @__PURE__ */ jsx9(PayloadBlock, { label: block.label, value: block.value }, block.label)
|
|
2388
|
+
)
|
|
2389
|
+
] });
|
|
2390
|
+
case "patch":
|
|
2391
|
+
if (body.bare) {
|
|
2392
|
+
return /* @__PURE__ */ jsx9(RawPatch, { diff: body.files[0]?.diff ?? "" });
|
|
2393
|
+
}
|
|
2394
|
+
return /* @__PURE__ */ jsx9(Fragment3, { children: body.files.map(
|
|
2395
|
+
(entry) => entry.file ? /* @__PURE__ */ jsx9(ToolDiff, { files: [entry.file] }, entry.key) : /* @__PURE__ */ jsxs6("div", { children: [
|
|
2396
|
+
/* @__PURE__ */ jsx9("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: entry.path }),
|
|
2397
|
+
/* @__PURE__ */ jsx9(RawPatch, { diff: entry.diff })
|
|
2398
|
+
] }, entry.key)
|
|
2399
|
+
) });
|
|
2400
|
+
case "web-results":
|
|
2401
|
+
return /* @__PURE__ */ jsx9(WebSearchResults, { results: body.results });
|
|
3096
2402
|
}
|
|
2403
|
+
}
|
|
2404
|
+
function WebSearchResults({ results }) {
|
|
2405
|
+
const resultOccurrences = /* @__PURE__ */ new Map();
|
|
2406
|
+
const keyedResults = results?.map((result) => {
|
|
2407
|
+
const contentKey = `${result.domain}\0${result.title}\0${result.snippet}`;
|
|
2408
|
+
const occurrence = (resultOccurrences.get(contentKey) ?? 0) + 1;
|
|
2409
|
+
resultOccurrences.set(contentKey, occurrence);
|
|
2410
|
+
return { key: `${contentKey}\0${occurrence}`, result };
|
|
2411
|
+
});
|
|
2412
|
+
if (!keyedResults || !keyedResults.length) {
|
|
2413
|
+
return /* @__PURE__ */ jsx9(BodyNote, { children: "results folded into model context \u2014 no list available." });
|
|
2414
|
+
}
|
|
2415
|
+
return /* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-2", children: keyedResults.map(({ key, result }) => /* @__PURE__ */ jsxs6("li", { className: "flex gap-2.5", children: [
|
|
2416
|
+
/* @__PURE__ */ jsx9(GlobeIcon, { className: "mt-0.5 size-3.5 shrink-0 text-og-fg-subtle" }),
|
|
2417
|
+
/* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
2418
|
+
/* @__PURE__ */ jsxs6("p", { className: "truncate text-og-base text-og-fg", children: [
|
|
2419
|
+
result.title,
|
|
2420
|
+
" ",
|
|
2421
|
+
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: result.domain })
|
|
2422
|
+
] }),
|
|
2423
|
+
/* @__PURE__ */ jsx9("p", { className: "text-og-sm leading-5 text-og-fg-muted", children: result.snippet })
|
|
2424
|
+
] })
|
|
2425
|
+
] }, key)) });
|
|
2426
|
+
}
|
|
2427
|
+
function PresentedToolRow({ presentation: p }) {
|
|
2428
|
+
const Icon = toolIcon(p.icon);
|
|
3097
2429
|
return /* @__PURE__ */ jsx9(
|
|
3098
2430
|
ActivityDisclosure,
|
|
3099
2431
|
{
|
|
3100
|
-
icon: /* @__PURE__ */ jsx9(
|
|
3101
|
-
iconTone:
|
|
3102
|
-
title:
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
2432
|
+
icon: /* @__PURE__ */ jsx9(Icon, { className: ICON_SIZE }),
|
|
2433
|
+
iconTone: p.iconTone,
|
|
2434
|
+
title: p.title,
|
|
2435
|
+
...p.titleMono ? { titleMono: true } : {},
|
|
2436
|
+
...p.running ? { running: true } : {},
|
|
2437
|
+
...p.chip ? { chip: p.chip } : {},
|
|
2438
|
+
...p.failed !== void 0 ? { failed: p.failed } : {},
|
|
2439
|
+
...p.cancelled !== void 0 ? { cancelled: p.cancelled } : {},
|
|
2440
|
+
preview: p.preview ? presentedPreviewNode(p.preview) : void 0,
|
|
2441
|
+
children: /* @__PURE__ */ jsx9(PresentedBody, { body: p.body })
|
|
3106
2442
|
}
|
|
3107
2443
|
);
|
|
3108
2444
|
}
|
|
3109
|
-
function
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
}
|
|
2445
|
+
function ExecRenderer({ item }) {
|
|
2446
|
+
const computeLabel = useTimelineComputeLabel();
|
|
2447
|
+
return /* @__PURE__ */ jsx9(PresentedToolRow, { presentation: execPresentation(item, { computeLabel }) });
|
|
2448
|
+
}
|
|
2449
|
+
function WriteStdinRenderer({ item }) {
|
|
2450
|
+
return /* @__PURE__ */ jsx9(PresentedToolRow, { presentation: writeStdinPresentation(item) });
|
|
2451
|
+
}
|
|
2452
|
+
function ApplyPatchRenderer({ item }) {
|
|
2453
|
+
const presentation = applyPatchPresentation(item);
|
|
2454
|
+
return presentation ? /* @__PURE__ */ jsx9(PresentedToolRow, { presentation }) : /* @__PURE__ */ jsx9(GenericRenderer, { item });
|
|
2455
|
+
}
|
|
2456
|
+
function WebSearchRenderer({ item }) {
|
|
2457
|
+
return /* @__PURE__ */ jsx9(PresentedToolRow, { presentation: webSearchPresentation(item) });
|
|
2458
|
+
}
|
|
2459
|
+
function AskRenderer({ item }) {
|
|
2460
|
+
return /* @__PURE__ */ jsx9(PresentedToolRow, { presentation: askPresentation(item) });
|
|
2461
|
+
}
|
|
2462
|
+
function RunOnRenderer({ item }) {
|
|
2463
|
+
return /* @__PURE__ */ jsx9(PresentedToolRow, { presentation: runOnPresentation(item) });
|
|
2464
|
+
}
|
|
2465
|
+
function UnreviewedGenericRenderer({ item }) {
|
|
2466
|
+
return /* @__PURE__ */ jsx9(PresentedToolRow, { presentation: genericToolPresentation(item) });
|
|
3115
2467
|
}
|
|
3116
2468
|
function computerVerb(action) {
|
|
3117
2469
|
if (!action || !action.type) {
|
|
@@ -3643,7 +2995,15 @@ function SandboxFilePublishRenderer({ item, loadRetainedArtifact }) {
|
|
|
3643
2995
|
preview: formatBytes(receipt.artifact.originalBytes),
|
|
3644
2996
|
children: [
|
|
3645
2997
|
downloadButton,
|
|
3646
|
-
openLink
|
|
2998
|
+
openLink,
|
|
2999
|
+
isPatchFilename(receipt.filename) ? /* @__PURE__ */ jsx9(
|
|
3000
|
+
PatchApplyCommand,
|
|
3001
|
+
{
|
|
3002
|
+
artifact: receipt.artifact,
|
|
3003
|
+
filename: receipt.filename,
|
|
3004
|
+
load: loadRetainedArtifact
|
|
3005
|
+
}
|
|
3006
|
+
) : null
|
|
3647
3007
|
]
|
|
3648
3008
|
}
|
|
3649
3009
|
);
|
|
@@ -3812,97 +3172,6 @@ function retainedImageFilename(artifact) {
|
|
|
3812
3172
|
const extension = artifact.contentType === "image/jpeg" ? "jpg" : artifact.contentType === "image/webp" ? "webp" : "png";
|
|
3813
3173
|
return `${artifact.kind}-${artifact.artifactId}.${extension}`;
|
|
3814
3174
|
}
|
|
3815
|
-
function webSearchQueryFromArguments(args) {
|
|
3816
|
-
if (typeof args === "string") {
|
|
3817
|
-
const trimmed = args.trim();
|
|
3818
|
-
if (!trimmed) {
|
|
3819
|
-
return null;
|
|
3820
|
-
}
|
|
3821
|
-
try {
|
|
3822
|
-
return webSearchQueryFromArguments(JSON.parse(trimmed));
|
|
3823
|
-
} catch {
|
|
3824
|
-
return trimmed;
|
|
3825
|
-
}
|
|
3826
|
-
}
|
|
3827
|
-
if (!args || typeof args !== "object") {
|
|
3828
|
-
return null;
|
|
3829
|
-
}
|
|
3830
|
-
const record = args;
|
|
3831
|
-
if (typeof record.query === "string" && record.query.trim().length > 0) {
|
|
3832
|
-
return record.query;
|
|
3833
|
-
}
|
|
3834
|
-
if (Array.isArray(record.queries)) {
|
|
3835
|
-
const first = record.queries.find(
|
|
3836
|
-
(value) => typeof value === "string" && value.trim().length > 0
|
|
3837
|
-
);
|
|
3838
|
-
if (first) {
|
|
3839
|
-
return first;
|
|
3840
|
-
}
|
|
3841
|
-
}
|
|
3842
|
-
return null;
|
|
3843
|
-
}
|
|
3844
|
-
function WebSearchRenderer({ item }) {
|
|
3845
|
-
const raw = item.raw ?? {};
|
|
3846
|
-
const action = raw.providerData?.action ?? {};
|
|
3847
|
-
const actionType = action.type ?? "search";
|
|
3848
|
-
const queries = (action.queries ?? []).filter(
|
|
3849
|
-
(value) => typeof value === "string" && value.trim().length > 0
|
|
3850
|
-
);
|
|
3851
|
-
const searchQuery = (typeof action.query === "string" && action.query.trim().length > 0 ? action.query : null) ?? queries[0] ?? webSearchQueryFromArguments(item.arguments);
|
|
3852
|
-
const running = item.status === "running";
|
|
3853
|
-
const query = actionType === "open_page" ? action.url ?? "(page unavailable)" : actionType === "find_in_page" ? action.pattern && action.url ? `"${action.pattern}" in ${action.url}` : action.pattern ?? action.url ?? "(page unavailable)" : (
|
|
3854
|
-
// Codex often emits the live card before action.query/queries land;
|
|
3855
|
-
// don't flash the scary unavailable copy while still searching.
|
|
3856
|
-
searchQuery ?? (running ? "\u2026" : "(query unavailable)")
|
|
3857
|
-
);
|
|
3858
|
-
const variants = queries.length > 1 ? ` +${queries.length - 1} variants` : "";
|
|
3859
|
-
const runningTitle = actionType === "open_page" ? "Opening web page" : actionType === "find_in_page" ? "Searching within page" : "Searching the web";
|
|
3860
|
-
const completedTitle = actionType === "open_page" ? "Opened web page" : actionType === "find_in_page" ? "Searched within page" : "Searched the web";
|
|
3861
|
-
const rawResults = item.output?.results;
|
|
3862
|
-
const results = Array.isArray(rawResults) ? rawResults.filter((r) => !!r && typeof r === "object") : void 0;
|
|
3863
|
-
const resultOccurrences = /* @__PURE__ */ new Map();
|
|
3864
|
-
const keyedResults = results?.map((result) => {
|
|
3865
|
-
const contentKey = `${result.domain}\0${result.title}\0${result.snippet}`;
|
|
3866
|
-
const occurrence = (resultOccurrences.get(contentKey) ?? 0) + 1;
|
|
3867
|
-
resultOccurrences.set(contentKey, occurrence);
|
|
3868
|
-
return { key: `${contentKey}\0${occurrence}`, result };
|
|
3869
|
-
});
|
|
3870
|
-
if (running) {
|
|
3871
|
-
return /* @__PURE__ */ jsx9(
|
|
3872
|
-
ActivityDisclosure,
|
|
3873
|
-
{
|
|
3874
|
-
icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
|
|
3875
|
-
iconTone: "running",
|
|
3876
|
-
title: runningTitle,
|
|
3877
|
-
running: true,
|
|
3878
|
-
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: `${query}${variants}` }),
|
|
3879
|
-
children: /* @__PURE__ */ jsx9(BodyNote, { children: "searching\u2026 results fold into the model context (no output event)." })
|
|
3880
|
-
}
|
|
3881
|
-
);
|
|
3882
|
-
}
|
|
3883
|
-
return /* @__PURE__ */ jsx9(
|
|
3884
|
-
ActivityDisclosure,
|
|
3885
|
-
{
|
|
3886
|
-
icon: /* @__PURE__ */ jsx9(SearchIcon, { className: ICON_SIZE }),
|
|
3887
|
-
iconTone: "muted",
|
|
3888
|
-
title: completedTitle,
|
|
3889
|
-
preview: `${query}${variants}`,
|
|
3890
|
-
failed: item.status === "failed",
|
|
3891
|
-
cancelled: item.status === "cancelled",
|
|
3892
|
-
children: keyedResults && keyedResults.length ? /* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-2", children: keyedResults.map(({ key, result }) => /* @__PURE__ */ jsxs6("li", { className: "flex gap-2.5", children: [
|
|
3893
|
-
/* @__PURE__ */ jsx9(GlobeIcon, { className: "mt-0.5 size-3.5 shrink-0 text-og-fg-subtle" }),
|
|
3894
|
-
/* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
3895
|
-
/* @__PURE__ */ jsxs6("p", { className: "truncate text-og-base text-og-fg", children: [
|
|
3896
|
-
result.title,
|
|
3897
|
-
" ",
|
|
3898
|
-
/* @__PURE__ */ jsx9("span", { className: "text-og-fg-subtle", children: result.domain })
|
|
3899
|
-
] }),
|
|
3900
|
-
/* @__PURE__ */ jsx9("p", { className: "text-og-sm leading-5 text-og-fg-muted", children: result.snippet })
|
|
3901
|
-
] })
|
|
3902
|
-
] }, key)) }) : /* @__PURE__ */ jsx9(BodyNote, { children: "results folded into model context \u2014 no list available." })
|
|
3903
|
-
}
|
|
3904
|
-
);
|
|
3905
|
-
}
|
|
3906
3175
|
var VIEW_IMAGE_ERRORS = [
|
|
3907
3176
|
"was not found",
|
|
3908
3177
|
"is not a file",
|
|
@@ -3923,7 +3192,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
3923
3192
|
{
|
|
3924
3193
|
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
3925
3194
|
iconTone: "running",
|
|
3926
|
-
title: `View ${
|
|
3195
|
+
title: `View ${pathBasename(path)}`,
|
|
3927
3196
|
running: true,
|
|
3928
3197
|
preview: /* @__PURE__ */ jsx9(RunningPreview, { children: "reading\u2026" }),
|
|
3929
3198
|
media: /* @__PURE__ */ jsx9(MediaSkeleton, {}),
|
|
@@ -3934,7 +3203,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
3934
3203
|
const viewFailed = item.status === "failed";
|
|
3935
3204
|
const viewCancelled = item.status === "cancelled";
|
|
3936
3205
|
if (retained) {
|
|
3937
|
-
const title = `Viewed ${
|
|
3206
|
+
const title = `Viewed ${pathBasename(path)}`;
|
|
3938
3207
|
if (!retained.available) {
|
|
3939
3208
|
const state = retained.reason === "expired" || retained.reason === "deleted" ? retained.reason : "unavailable";
|
|
3940
3209
|
return /* @__PURE__ */ jsx9(
|
|
@@ -3981,7 +3250,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
3981
3250
|
{
|
|
3982
3251
|
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
3983
3252
|
iconTone: "failed",
|
|
3984
|
-
title: `View ${
|
|
3253
|
+
title: `View ${pathBasename(path)}`,
|
|
3985
3254
|
chip: { tone: "bad", text: tooBig ? "too large" : "error" },
|
|
3986
3255
|
preview: text,
|
|
3987
3256
|
children: /* @__PURE__ */ jsx9(BodyNote, { tone: "error", children: text })
|
|
@@ -3994,7 +3263,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
3994
3263
|
{
|
|
3995
3264
|
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
3996
3265
|
iconTone: viewFailed ? "failed" : "muted",
|
|
3997
|
-
title: `Viewed ${
|
|
3266
|
+
title: `Viewed ${pathBasename(path)}`,
|
|
3998
3267
|
failed: viewFailed,
|
|
3999
3268
|
cancelled: viewCancelled,
|
|
4000
3269
|
preview: path,
|
|
@@ -4008,7 +3277,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
4008
3277
|
{
|
|
4009
3278
|
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
4010
3279
|
iconTone: viewFailed ? "failed" : "muted",
|
|
4011
|
-
title: `Viewed ${
|
|
3280
|
+
title: `Viewed ${pathBasename(path)} \xB7 image omitted \xB7 not retained`,
|
|
4012
3281
|
failed: viewFailed,
|
|
4013
3282
|
cancelled: viewCancelled,
|
|
4014
3283
|
preview: "inline image omitted \xB7 not retained",
|
|
@@ -4027,7 +3296,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
4027
3296
|
{
|
|
4028
3297
|
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
4029
3298
|
iconTone: viewFailed ? "failed" : "muted",
|
|
4030
|
-
title: `Viewed ${
|
|
3299
|
+
title: `Viewed ${pathBasename(path)}`,
|
|
4031
3300
|
failed: viewFailed,
|
|
4032
3301
|
cancelled: viewCancelled,
|
|
4033
3302
|
preview: "(no image)",
|
|
@@ -4041,7 +3310,7 @@ function ViewImageRenderer({ item, loadRetainedScreenshot }) {
|
|
|
4041
3310
|
{
|
|
4042
3311
|
icon: /* @__PURE__ */ jsx9(ImageIcon, { className: ICON_SIZE }),
|
|
4043
3312
|
iconTone: viewFailed ? "failed" : "accent",
|
|
4044
|
-
title: `Viewed ${
|
|
3313
|
+
title: `Viewed ${pathBasename(path)}`,
|
|
4045
3314
|
failed: viewFailed,
|
|
4046
3315
|
cancelled: viewCancelled,
|
|
4047
3316
|
media: /* @__PURE__ */ jsx9(Thumbnail, { src: text, caption: path, alt: path }),
|
|
@@ -4099,92 +3368,6 @@ function SecretSetRenderer({ item }) {
|
|
|
4099
3368
|
}
|
|
4100
3369
|
);
|
|
4101
3370
|
}
|
|
4102
|
-
function splitToolWireName(name) {
|
|
4103
|
-
const boundary = name.indexOf("__");
|
|
4104
|
-
if (boundary <= 0) {
|
|
4105
|
-
return { name, source: null, leaf: name };
|
|
4106
|
-
}
|
|
4107
|
-
return {
|
|
4108
|
-
name,
|
|
4109
|
-
source: name.slice(0, boundary),
|
|
4110
|
-
leaf: name.slice(boundary + 2)
|
|
4111
|
-
};
|
|
4112
|
-
}
|
|
4113
|
-
function toolSearchQuery(item) {
|
|
4114
|
-
const fromArgs = parseToolArgs(item.arguments);
|
|
4115
|
-
if (typeof fromArgs.query === "string" && fromArgs.query.trim()) {
|
|
4116
|
-
return fromArgs.query.trim();
|
|
4117
|
-
}
|
|
4118
|
-
const raw = item.raw;
|
|
4119
|
-
if (raw && typeof raw === "object") {
|
|
4120
|
-
const rawArgs = raw.arguments;
|
|
4121
|
-
if (typeof rawArgs === "string" && rawArgs.trim()) {
|
|
4122
|
-
const parsed = tryParseJson(rawArgs);
|
|
4123
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
4124
|
-
const query = parsed.query;
|
|
4125
|
-
if (typeof query === "string" && query.trim()) {
|
|
4126
|
-
return query.trim();
|
|
4127
|
-
}
|
|
4128
|
-
}
|
|
4129
|
-
} else if (rawArgs && typeof rawArgs === "object" && !Array.isArray(rawArgs)) {
|
|
4130
|
-
const query = rawArgs.query;
|
|
4131
|
-
if (typeof query === "string" && query.trim()) {
|
|
4132
|
-
return query.trim();
|
|
4133
|
-
}
|
|
4134
|
-
}
|
|
4135
|
-
}
|
|
4136
|
-
return "";
|
|
4137
|
-
}
|
|
4138
|
-
function parseDisclosedTools(output) {
|
|
4139
|
-
if (output && typeof output === "object" && !Array.isArray(output)) {
|
|
4140
|
-
const tools = output.tools;
|
|
4141
|
-
if (Array.isArray(tools)) {
|
|
4142
|
-
return tools.map((tool) => {
|
|
4143
|
-
if (typeof tool === "string" && tool.trim()) {
|
|
4144
|
-
return splitToolWireName(tool.trim());
|
|
4145
|
-
}
|
|
4146
|
-
if (tool && typeof tool === "object" && typeof tool.name === "string") {
|
|
4147
|
-
const name = tool.name.trim();
|
|
4148
|
-
return name ? splitToolWireName(name) : null;
|
|
4149
|
-
}
|
|
4150
|
-
return null;
|
|
4151
|
-
}).filter((tool) => tool != null);
|
|
4152
|
-
}
|
|
4153
|
-
}
|
|
4154
|
-
const { text } = unwrapMcpOutput(output);
|
|
4155
|
-
const trimmed = text.trim();
|
|
4156
|
-
if (!trimmed) {
|
|
4157
|
-
return null;
|
|
4158
|
-
}
|
|
4159
|
-
if (/^no matching tools found\.?$/i.test(trimmed)) {
|
|
4160
|
-
return [];
|
|
4161
|
-
}
|
|
4162
|
-
const disclosed = trimmed.match(/^disclosed tools:\s*(.+)$/i);
|
|
4163
|
-
if (disclosed?.[1]) {
|
|
4164
|
-
return disclosed[1].split(",").map((part) => part.trim()).filter(Boolean).map(splitToolWireName);
|
|
4165
|
-
}
|
|
4166
|
-
const parsed = tryParseJson(trimmed);
|
|
4167
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
4168
|
-
return parseDisclosedTools(parsed);
|
|
4169
|
-
}
|
|
4170
|
-
return null;
|
|
4171
|
-
}
|
|
4172
|
-
function toolSearchPreview(tools, cancelled) {
|
|
4173
|
-
if (cancelled) {
|
|
4174
|
-
return void 0;
|
|
4175
|
-
}
|
|
4176
|
-
if (!tools) {
|
|
4177
|
-
return "Done";
|
|
4178
|
-
}
|
|
4179
|
-
if (tools.length === 0) {
|
|
4180
|
-
return "No matches";
|
|
4181
|
-
}
|
|
4182
|
-
if (tools.length === 1) {
|
|
4183
|
-
return tools[0].leaf;
|
|
4184
|
-
}
|
|
4185
|
-
const head = tools[0].leaf;
|
|
4186
|
-
return `${tools.length} tools \xB7 ${truncatePreview(head, 28)}`;
|
|
4187
|
-
}
|
|
4188
3371
|
function ToolSearchRenderer({ item }) {
|
|
4189
3372
|
const query = toolSearchQuery(item);
|
|
4190
3373
|
const icon = /* @__PURE__ */ jsx9(PackageSearchIcon, { className: ICON_SIZE });
|
|
@@ -4379,22 +3562,6 @@ function SetSessionTitleRenderer({ item }) {
|
|
|
4379
3562
|
}
|
|
4380
3563
|
);
|
|
4381
3564
|
}
|
|
4382
|
-
function parseSearchHits(outText) {
|
|
4383
|
-
const parsed = tryParseJson(outText);
|
|
4384
|
-
if (parsed == null) {
|
|
4385
|
-
return null;
|
|
4386
|
-
}
|
|
4387
|
-
const list = Array.isArray(parsed) ? parsed : parsed && typeof parsed === "object" && Array.isArray(parsed.results) ? parsed.results : parsed && typeof parsed === "object" && Array.isArray(parsed.hits) ? parsed.hits : null;
|
|
4388
|
-
if (!list) {
|
|
4389
|
-
return null;
|
|
4390
|
-
}
|
|
4391
|
-
return list.map((row) => {
|
|
4392
|
-
const r = row && typeof row === "object" ? row : {};
|
|
4393
|
-
const title = typeof r.title === "string" && r.title || typeof r.name === "string" && r.name || typeof r.documentTitle === "string" && r.documentTitle || typeof r.path === "string" && r.path || typeof r.id === "string" && r.id || "Result";
|
|
4394
|
-
const snippet = typeof r.snippet === "string" && r.snippet || typeof r.text === "string" && r.text || typeof r.content === "string" && r.content || "";
|
|
4395
|
-
return { title, snippet: truncatePreview(snippet, 160) };
|
|
4396
|
-
});
|
|
4397
|
-
}
|
|
4398
3565
|
function MemoryProposeRenderer({ item }) {
|
|
4399
3566
|
const args = parseToolArgs(item.arguments);
|
|
4400
3567
|
const text = typeof args.text === "string" ? args.text.trim() : "";
|
|
@@ -4445,307 +3612,54 @@ function MemoryProposeRenderer({ item }) {
|
|
|
4445
3612
|
}
|
|
4446
3613
|
);
|
|
4447
3614
|
}
|
|
4448
|
-
function
|
|
4449
|
-
const
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
}
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
}
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
}
|
|
4466
|
-
|
|
4467
|
-
const
|
|
4468
|
-
const
|
|
4469
|
-
const
|
|
4470
|
-
const
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
ActivityDisclosure,
|
|
4474
|
-
{
|
|
4475
|
-
icon,
|
|
4476
|
-
iconTone: "running",
|
|
4477
|
-
title,
|
|
4478
|
-
running: true,
|
|
4479
|
-
preview: preview ? /* @__PURE__ */ jsx9(RunningPreview, { children: preview }) : /* @__PURE__ */ jsx9(RunningPreview, { children: "Waiting\u2026" }),
|
|
4480
|
-
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
|
|
4481
|
-
}
|
|
4482
|
-
);
|
|
4483
|
-
}
|
|
4484
|
-
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
4485
|
-
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
4486
|
-
return /* @__PURE__ */ jsxs6(
|
|
4487
|
-
ActivityDisclosure,
|
|
4488
|
-
{
|
|
4489
|
-
icon,
|
|
4490
|
-
iconTone: "failed",
|
|
4491
|
-
title,
|
|
4492
|
-
chip: { tone: "bad", text: "error" },
|
|
4493
|
-
preview: truncatePreview(outText, 80) || preview || "Error",
|
|
4494
|
-
children: [
|
|
4495
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
4496
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
4497
|
-
]
|
|
4498
|
-
}
|
|
4499
|
-
);
|
|
4500
|
-
}
|
|
4501
|
-
return /* @__PURE__ */ jsxs6(
|
|
4502
|
-
ActivityDisclosure,
|
|
4503
|
-
{
|
|
4504
|
-
icon,
|
|
4505
|
-
iconTone: "muted",
|
|
4506
|
-
title,
|
|
4507
|
-
cancelled: item.status === "cancelled",
|
|
4508
|
-
preview: item.status === "cancelled" ? void 0 : preview ?? void 0,
|
|
4509
|
-
children: [
|
|
4510
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
4511
|
-
outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText }) : null
|
|
4512
|
-
]
|
|
4513
|
-
}
|
|
4514
|
-
);
|
|
4515
|
-
}
|
|
4516
|
-
function runOnTargetName(output) {
|
|
4517
|
-
const { text } = unwrapMcpOutput(output);
|
|
4518
|
-
const parsed = tryParseJson(text);
|
|
4519
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
4520
|
-
const name = parsed.targetName;
|
|
4521
|
-
if (typeof name === "string" && name.trim()) {
|
|
4522
|
-
return name.trim();
|
|
4523
|
-
}
|
|
4524
|
-
}
|
|
4525
|
-
return null;
|
|
4526
|
-
}
|
|
4527
|
-
function runOnOpPreview(args) {
|
|
4528
|
-
const op = args.op;
|
|
4529
|
-
if (!op || typeof op !== "object" || Array.isArray(op)) {
|
|
4530
|
-
return null;
|
|
4531
|
-
}
|
|
4532
|
-
const record = op;
|
|
4533
|
-
if (record.kind === "exec" && typeof record.cmd === "string" && record.cmd.trim()) {
|
|
4534
|
-
return `$ ${record.cmd.trim()}`;
|
|
4535
|
-
}
|
|
4536
|
-
if ((record.kind === "read" || record.kind === "write") && typeof record.path === "string" && record.path.trim()) {
|
|
4537
|
-
return truncatePreview(record.path.trim(), 72);
|
|
4538
|
-
}
|
|
4539
|
-
return null;
|
|
4540
|
-
}
|
|
4541
|
-
function RunOnRenderer({ item }) {
|
|
4542
|
-
const parsedArgs = parseToolArgs(item.arguments);
|
|
4543
|
-
const args = parsedArgs;
|
|
4544
|
-
const targetName = runOnTargetName(item.output);
|
|
4545
|
-
const title = targetName ? `Run on ${targetName}` : "Run on";
|
|
4546
|
-
const opPreview = runOnOpPreview(parsedArgs);
|
|
4547
|
-
const icon = /* @__PURE__ */ jsx9(ServerIcon, { className: ICON_SIZE });
|
|
4548
|
-
if (item.status === "running") {
|
|
4549
|
-
return /* @__PURE__ */ jsx9(
|
|
4550
|
-
ActivityDisclosure,
|
|
4551
|
-
{
|
|
4552
|
-
icon,
|
|
4553
|
-
iconTone: "running",
|
|
4554
|
-
title,
|
|
4555
|
-
running: true,
|
|
4556
|
-
preview: opPreview ? /* @__PURE__ */ jsx9(RunningPreview, { children: opPreview }) : /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }),
|
|
4557
|
-
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
|
|
4558
|
-
}
|
|
4559
|
-
);
|
|
4560
|
-
}
|
|
4561
|
-
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
4562
|
-
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
4563
|
-
return /* @__PURE__ */ jsxs6(
|
|
4564
|
-
ActivityDisclosure,
|
|
4565
|
-
{
|
|
4566
|
-
icon,
|
|
4567
|
-
iconTone: "failed",
|
|
4568
|
-
title,
|
|
4569
|
-
chip: { tone: "bad", text: "error" },
|
|
4570
|
-
preview: truncatePreview(outText, 80) || opPreview || "Error",
|
|
4571
|
-
children: [
|
|
4572
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
4573
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
4574
|
-
]
|
|
4575
|
-
}
|
|
4576
|
-
);
|
|
4577
|
-
}
|
|
4578
|
-
return /* @__PURE__ */ jsxs6(
|
|
4579
|
-
ActivityDisclosure,
|
|
4580
|
-
{
|
|
4581
|
-
icon,
|
|
4582
|
-
iconTone: "muted",
|
|
4583
|
-
title,
|
|
4584
|
-
cancelled: item.status === "cancelled",
|
|
4585
|
-
preview: item.status === "cancelled" ? void 0 : opPreview ?? void 0,
|
|
4586
|
-
children: [
|
|
4587
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
4588
|
-
outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText }) : null
|
|
4589
|
-
]
|
|
4590
|
-
}
|
|
4591
|
-
);
|
|
4592
|
-
}
|
|
4593
|
-
function GenericRenderer({ item }) {
|
|
4594
|
-
const reviewed = useHasToolReview(item.callId);
|
|
4595
|
-
if (reviewed && item.callId) return /* @__PURE__ */ jsx9(ReviewedGenericRenderer, { item });
|
|
4596
|
-
return /* @__PURE__ */ jsx9(UnreviewedGenericRenderer, { item });
|
|
4597
|
-
}
|
|
4598
|
-
var REVIEW_CHIP = {
|
|
4599
|
-
rejected: { tone: "interrupted", text: "declined" },
|
|
4600
|
-
cancelled: { tone: "interrupted", text: "not run" },
|
|
4601
|
-
expired: { tone: "interrupted", text: "expired" },
|
|
4602
|
-
stale: { tone: "interrupted", text: "not run" },
|
|
4603
|
-
revoked: { tone: "interrupted", text: "not run" },
|
|
4604
|
-
blocked: { tone: "interrupted", text: "blocked" },
|
|
4605
|
-
unknown: { tone: "bad", text: "outcome unknown" },
|
|
4606
|
-
partial: { tone: "bad", text: "partly done" },
|
|
4607
|
-
failed: { tone: "bad", text: "failed" }
|
|
4608
|
-
};
|
|
4609
|
-
function ReviewedGenericRenderer({ item }) {
|
|
4610
|
-
const { review, onViewDetails } = useRecordedToolReview(item.callId);
|
|
4611
|
-
if (!review) return /* @__PURE__ */ jsx9(UnreviewedGenericRenderer, { item });
|
|
4612
|
-
const icon = /* @__PURE__ */ jsx9(GenericToolIcon, { name: item.name });
|
|
4613
|
-
const waiting = review.status === "pending";
|
|
4614
|
-
const running = !waiting && (review.status === "executing" || review.status === "approved") && item.status === "running";
|
|
4615
|
-
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
4616
|
-
const chip = REVIEW_CHIP[review.status] ?? (isError && !running && !waiting ? { tone: "bad", text: "error" } : void 0);
|
|
4617
|
-
return /* @__PURE__ */ jsxs6(
|
|
4618
|
-
ActivityDisclosure,
|
|
4619
|
-
{
|
|
4620
|
-
icon,
|
|
4621
|
-
iconTone: chip?.tone === "bad" ? "failed" : waiting ? "accent" : "muted",
|
|
4622
|
-
title: review.title,
|
|
4623
|
-
running,
|
|
4624
|
-
chip,
|
|
4625
|
-
preview: waiting ? "Waiting for your approval" : running ? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }) : review.accountLabel ?? void 0,
|
|
4626
|
-
children: [
|
|
4627
|
-
/* @__PURE__ */ jsx9("div", { className: "py-1", "data-approval-id": item.callId, "data-review-origin": "history", children: /* @__PURE__ */ jsx9(
|
|
4628
|
-
ToolActionReviewCard,
|
|
4629
|
-
{
|
|
4630
|
-
bare: true,
|
|
4631
|
-
review: { ...review, availableActions: [] },
|
|
4632
|
-
onViewDetails
|
|
4633
|
-
}
|
|
4634
|
-
) }),
|
|
4635
|
-
outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText, failed: isError }) : null
|
|
4636
|
-
]
|
|
4637
|
-
}
|
|
4638
|
-
);
|
|
4639
|
-
}
|
|
4640
|
-
var BLOCKED_OUTPUT = /Connector action was not executed: blocked\b/;
|
|
4641
|
-
var UNCERTAIN_OUTPUT = /Connector action outcome is uncertain\b/;
|
|
4642
|
-
function UnreviewedGenericRenderer({ item }) {
|
|
4643
|
-
const running = item.status === "running";
|
|
4644
|
-
const args = parseToolArgs(item.arguments);
|
|
4645
|
-
const display = toolDisplayName(item.name, item.display);
|
|
4646
|
-
const icon = /* @__PURE__ */ jsx9(GenericToolIcon, { name: item.name });
|
|
4647
|
-
const goalPreview = goalToolPreview(item.name, args);
|
|
4648
|
-
if (running) {
|
|
4649
|
-
return /* @__PURE__ */ jsx9(
|
|
4650
|
-
ActivityDisclosure,
|
|
4651
|
-
{
|
|
4652
|
-
icon,
|
|
4653
|
-
iconTone: "running",
|
|
4654
|
-
title: display,
|
|
4655
|
-
running: true,
|
|
4656
|
-
preview: goalPreview ?? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }),
|
|
4657
|
-
children: /* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
|
|
4658
|
-
}
|
|
4659
|
-
);
|
|
4660
|
-
}
|
|
4661
|
-
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
4662
|
-
if (isError && BLOCKED_OUTPUT.test(outText)) {
|
|
4663
|
-
return /* @__PURE__ */ jsxs6(
|
|
4664
|
-
ActivityDisclosure,
|
|
4665
|
-
{
|
|
4666
|
-
icon,
|
|
4667
|
-
iconTone: "muted",
|
|
4668
|
-
title: display,
|
|
4669
|
-
chip: { tone: "interrupted", text: "blocked" },
|
|
4670
|
-
preview: "Blocked by your permission settings",
|
|
4671
|
-
children: [
|
|
4672
|
-
/* @__PURE__ */ jsx9("p", { className: "m-0 py-1 text-og-sm text-og-fg-muted", children: "Your permission settings block this action, so it did not run. You can change this in the integration's tool permissions." }),
|
|
4673
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
|
|
4674
|
-
]
|
|
4675
|
-
}
|
|
4676
|
-
);
|
|
4677
|
-
}
|
|
4678
|
-
if (isError && UNCERTAIN_OUTPUT.test(outText)) {
|
|
4679
|
-
return /* @__PURE__ */ jsxs6(
|
|
4680
|
-
ActivityDisclosure,
|
|
4681
|
-
{
|
|
4682
|
-
icon,
|
|
4683
|
-
iconTone: "failed",
|
|
4684
|
-
title: display,
|
|
4685
|
-
chip: { tone: "bad", text: "outcome unknown" },
|
|
4686
|
-
preview: "It may have run",
|
|
4687
|
-
children: [
|
|
4688
|
-
/* @__PURE__ */ jsx9("p", { className: "m-0 py-1 text-og-sm text-og-fg-muted", children: "This action may have run. Check the result in the connected app before trying again." }),
|
|
4689
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args })
|
|
4690
|
-
]
|
|
4691
|
-
}
|
|
4692
|
-
);
|
|
4693
|
-
}
|
|
4694
|
-
if ((isError || item.status === "failed") && item.status !== "cancelled") {
|
|
4695
|
-
return /* @__PURE__ */ jsxs6(
|
|
4696
|
-
ActivityDisclosure,
|
|
4697
|
-
{
|
|
4698
|
-
icon,
|
|
4699
|
-
iconTone: "failed",
|
|
4700
|
-
title: display,
|
|
4701
|
-
chip: { tone: "bad", text: "error" },
|
|
4702
|
-
preview: truncatePreview(outText, 80) || "Error",
|
|
4703
|
-
children: [
|
|
4704
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Arguments", value: args }),
|
|
4705
|
-
/* @__PURE__ */ jsx9(PayloadBlock, { label: "Error", value: outText, failed: true })
|
|
4706
|
-
]
|
|
4707
|
-
}
|
|
4708
|
-
);
|
|
4709
|
-
}
|
|
3615
|
+
function GenericRenderer({ item }) {
|
|
3616
|
+
const reviewed = useHasToolReview(item.callId);
|
|
3617
|
+
if (reviewed && item.callId) return /* @__PURE__ */ jsx9(ReviewedGenericRenderer, { item });
|
|
3618
|
+
return /* @__PURE__ */ jsx9(UnreviewedGenericRenderer, { item });
|
|
3619
|
+
}
|
|
3620
|
+
var REVIEW_CHIP = {
|
|
3621
|
+
rejected: { tone: "interrupted", text: "declined" },
|
|
3622
|
+
cancelled: { tone: "interrupted", text: "not run" },
|
|
3623
|
+
expired: { tone: "interrupted", text: "expired" },
|
|
3624
|
+
stale: { tone: "interrupted", text: "not run" },
|
|
3625
|
+
revoked: { tone: "interrupted", text: "not run" },
|
|
3626
|
+
blocked: { tone: "interrupted", text: "blocked" },
|
|
3627
|
+
unknown: { tone: "bad", text: "outcome unknown" },
|
|
3628
|
+
partial: { tone: "bad", text: "partly done" },
|
|
3629
|
+
failed: { tone: "bad", text: "failed" }
|
|
3630
|
+
};
|
|
3631
|
+
function ReviewedGenericRenderer({ item }) {
|
|
3632
|
+
const { review, onViewDetails } = useRecordedToolReview(item.callId);
|
|
3633
|
+
if (!review) return /* @__PURE__ */ jsx9(UnreviewedGenericRenderer, { item });
|
|
3634
|
+
const ReviewIcon = toolIcon(genericToolIconKind(item.name));
|
|
3635
|
+
const icon = /* @__PURE__ */ jsx9(ReviewIcon, { className: ICON_SIZE });
|
|
3636
|
+
const waiting = review.status === "pending";
|
|
3637
|
+
const running = !waiting && (review.status === "executing" || review.status === "approved") && item.status === "running";
|
|
3638
|
+
const { text: outText, isError } = unwrapMcpOutput(item.output);
|
|
3639
|
+
const chip = REVIEW_CHIP[review.status] ?? (isError && !running && !waiting ? { tone: "bad", text: "error" } : void 0);
|
|
4710
3640
|
return /* @__PURE__ */ jsxs6(
|
|
4711
3641
|
ActivityDisclosure,
|
|
4712
3642
|
{
|
|
4713
3643
|
icon,
|
|
4714
|
-
iconTone: "muted",
|
|
4715
|
-
title:
|
|
4716
|
-
|
|
4717
|
-
|
|
3644
|
+
iconTone: chip?.tone === "bad" ? "failed" : waiting ? "accent" : "muted",
|
|
3645
|
+
title: review.title,
|
|
3646
|
+
running,
|
|
3647
|
+
chip,
|
|
3648
|
+
preview: waiting ? "Waiting for your approval" : running ? /* @__PURE__ */ jsx9(RunningPreview, { children: "Running\u2026" }) : review.accountLabel ?? void 0,
|
|
4718
3649
|
children: [
|
|
4719
|
-
/* @__PURE__ */ jsx9(
|
|
4720
|
-
|
|
3650
|
+
/* @__PURE__ */ jsx9("div", { className: "py-1", "data-approval-id": item.callId, "data-review-origin": "history", children: /* @__PURE__ */ jsx9(
|
|
3651
|
+
ToolActionReviewCard,
|
|
3652
|
+
{
|
|
3653
|
+
bare: true,
|
|
3654
|
+
review: { ...review, availableActions: [] },
|
|
3655
|
+
onViewDetails
|
|
3656
|
+
}
|
|
3657
|
+
) }),
|
|
3658
|
+
outText ? /* @__PURE__ */ jsx9(PayloadBlock, { label: "Result", value: outText, failed: isError }) : null
|
|
4721
3659
|
]
|
|
4722
3660
|
}
|
|
4723
3661
|
);
|
|
4724
3662
|
}
|
|
4725
|
-
function goalToolPreview(name, args) {
|
|
4726
|
-
const leaf = mcpToolLeaf(name);
|
|
4727
|
-
if (leaf !== "goal_set" && leaf !== "goal_update" && leaf !== "goal_complete" && leaf !== "goal_pause" && leaf !== "wait_for_input") {
|
|
4728
|
-
return null;
|
|
4729
|
-
}
|
|
4730
|
-
const record = args && typeof args === "object" ? args : null;
|
|
4731
|
-
if (!record) {
|
|
4732
|
-
return null;
|
|
4733
|
-
}
|
|
4734
|
-
const text = typeof record.text === "string" ? record.text : typeof record.evidence === "string" ? record.evidence : typeof record.rationale === "string" ? record.rationale : typeof record.reason === "string" ? record.reason : typeof record.progressNote === "string" ? record.progressNote : null;
|
|
4735
|
-
return text ? truncatePreview(text, 90) : null;
|
|
4736
|
-
}
|
|
4737
|
-
function truncatePreview(text, max) {
|
|
4738
|
-
const cleaned = text.replace(/\s+/g, " ").trim();
|
|
4739
|
-
if (!cleaned) {
|
|
4740
|
-
return "";
|
|
4741
|
-
}
|
|
4742
|
-
return cleaned.length > max ? `${cleaned.slice(0, max - 1)}\u2026` : cleaned;
|
|
4743
|
-
}
|
|
4744
|
-
function GenericToolIcon({ name }) {
|
|
4745
|
-
const leaf = mcpToolLeaf(name);
|
|
4746
|
-
const Icon = leaf === "request_human_input" ? MessageCircleQuestionIcon2 : leaf.startsWith("goal_") ? TargetIcon : leaf.startsWith("memory_") || leaf === "preference_registry_summary" || leaf === "preference_registry_get" ? BrainCircuitIcon2 : leaf.startsWith("session_") || leaf === "sessions_list" || leaf === "set_session_title" || leaf === "set_other_session_title" ? MessagesSquareIcon : leaf.startsWith("sandbox") || leaf === "sandboxes_list" || leaf === "run_on" ? ServerIcon : leaf.startsWith("rig_") ? ServerCogIcon : leaf.startsWith("scheduled_") ? CalendarClockIcon : leaf.startsWith("artifacts_") ? PanelsTopLeftIcon : leaf.startsWith("social_") ? Share2Icon : leaf.startsWith("slack_") ? MessageSquareIcon : leaf.startsWith("github_") ? FolderGitIcon : leaf.startsWith("variable_") ? BoxIcon : leaf.startsWith("environment_") ? KeyRoundIcon : leaf.includes("document") || leaf.includes("knowledge") || leaf === "list_document_bases" ? FileSearchIcon : leaf === "tool_search" ? PackageSearchIcon : leaf.startsWith("skill_") ? PlugIcon : WrenchIcon;
|
|
4747
|
-
return /* @__PURE__ */ jsx9(Icon, { className: ICON_SIZE });
|
|
4748
|
-
}
|
|
4749
3663
|
function KnowledgeSaveRenderer({ item }) {
|
|
4750
3664
|
const output = unwrapMcpOutput(item.output);
|
|
4751
3665
|
const parsed = tryParseJson(output.text);
|
|
@@ -4887,24 +3801,10 @@ import { ThinkingOrb } from "thinking-orbs";
|
|
|
4887
3801
|
import { createContext as createContext4, useContext as useContext5, useEffect as useEffect7, useState as useState9 } from "react";
|
|
4888
3802
|
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4889
3803
|
var GenieLoadingOptionsContext = createContext4(void 0);
|
|
4890
|
-
var
|
|
4891
|
-
"
|
|
4892
|
-
"
|
|
4893
|
-
|
|
4894
|
-
"Summoning a little cleverness\u2026",
|
|
4895
|
-
"Checking the fine print on infinity\u2026",
|
|
4896
|
-
"Warming up the abracadabra\u2026",
|
|
4897
|
-
"Rearranging the stars\u2026",
|
|
4898
|
-
"Negotiating with the lamp\u2026",
|
|
4899
|
-
"Dusting off a thousand years\u2026",
|
|
4900
|
-
"Wishful thinking\u2026",
|
|
4901
|
-
"Decanting a little magic\u2026",
|
|
4902
|
-
"Finding the good stardust\u2026",
|
|
4903
|
-
"Fluffing the magic carpet\u2026",
|
|
4904
|
-
"Putting a wish into motion\u2026",
|
|
4905
|
-
"A little hocus. A little pocus\u2026"
|
|
4906
|
-
];
|
|
4907
|
-
var WAITING_PHRASES = ["Waiting for a response\u2026"];
|
|
3804
|
+
var EMBEDDED_GENIE_LOADING = {
|
|
3805
|
+
phrases: ["Thinking\u2026"],
|
|
3806
|
+
messages: { showDetails: "Show details" }
|
|
3807
|
+
};
|
|
4908
3808
|
function GenieLoading({
|
|
4909
3809
|
startedAt,
|
|
4910
3810
|
phase = "preparing",
|
|
@@ -4914,7 +3814,7 @@ function GenieLoading({
|
|
|
4914
3814
|
}) {
|
|
4915
3815
|
const options = useContext5(GenieLoadingOptionsContext);
|
|
4916
3816
|
const waiting = phase === "waiting";
|
|
4917
|
-
const phrases = options?.phrases?.length ? options.phrases : waiting ?
|
|
3817
|
+
const phrases = options?.phrases?.length ? options.phrases : waiting ? GENIE_WAITING_PHRASES : GENIE_PREPARING_PHRASES;
|
|
4918
3818
|
const theme = useThemeType(void 0);
|
|
4919
3819
|
const [phrase, setPhrase] = useState9(0);
|
|
4920
3820
|
const [showDetails, setShowDetails] = useState9(false);
|
|
@@ -5003,6 +3903,7 @@ function StartupDispatchDetails({ wait }) {
|
|
|
5003
3903
|
// src/timeline/activity-rail.tsx
|
|
5004
3904
|
import { ArrowRightIcon, BotIcon, BrainCircuitIcon as BrainCircuitIcon3, MessageSquareTextIcon } from "lucide-react";
|
|
5005
3905
|
import {
|
|
3906
|
+
Component,
|
|
5006
3907
|
createContext as createContext7,
|
|
5007
3908
|
lazy as lazy2,
|
|
5008
3909
|
Suspense as Suspense2,
|
|
@@ -5044,9 +3945,9 @@ function useSeenActivityIds() {
|
|
|
5044
3945
|
}
|
|
5045
3946
|
|
|
5046
3947
|
// src/timeline/activity-rail.tsx
|
|
5047
|
-
import { Fragment as
|
|
3948
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5048
3949
|
var LazyFleetDecisionRow = lazy2(() => import("./fleet-decision-row-SI63O5V4.js"));
|
|
5049
|
-
var LazyPlatformActivityRow = lazy2(() => import("./platform-activity-row-
|
|
3950
|
+
var LazyPlatformActivityRow = lazy2(() => import("./platform-activity-row-NJ47YBXW.js"));
|
|
5050
3951
|
function familyOf(item) {
|
|
5051
3952
|
if (item.kind === "tool-call") {
|
|
5052
3953
|
return item.name === "exec_command" || item.name === "write_stdin" ? "terminal" : item.name;
|
|
@@ -5204,7 +4105,7 @@ function ActivityNoteRow({ item }) {
|
|
|
5204
4105
|
className: "min-w-0 flex-1 text-og-sm text-og-fg-muted",
|
|
5205
4106
|
"data-og-search-item": item.id,
|
|
5206
4107
|
"data-og-annotation-source-key": item.annotationSource?.eventId,
|
|
5207
|
-
children: renderText ? renderText(item.text, item) : /* @__PURE__ */ jsx13(Markdown, { streaming: item.streaming, children: item.text })
|
|
4108
|
+
children: renderText ? renderText(item.text, item) : /* @__PURE__ */ jsx13(Markdown, { softLineBreaks: true, streaming: item.streaming, children: item.text })
|
|
5208
4109
|
}
|
|
5209
4110
|
)
|
|
5210
4111
|
] });
|
|
@@ -5232,14 +4133,14 @@ function renderActivity(item, toolRegistry, onOpenSession, onMemoryClick, loadRe
|
|
|
5232
4133
|
) });
|
|
5233
4134
|
case "tool-call": {
|
|
5234
4135
|
const Renderer = toolRegistry.resolve(item);
|
|
5235
|
-
return /* @__PURE__ */ jsx13(ToolCallTruncationProvider, { value: item.truncation ?? null, children: /* @__PURE__ */ jsx13(
|
|
4136
|
+
return /* @__PURE__ */ jsx13(ToolRowBoundary, { name: toolDisplayName(item.name), resetKeys: [item.status, Renderer], children: /* @__PURE__ */ jsx13(ToolCallTruncationProvider, { value: item.truncation ?? null, children: /* @__PURE__ */ jsx13(
|
|
5236
4137
|
Renderer,
|
|
5237
4138
|
{
|
|
5238
4139
|
item,
|
|
5239
4140
|
loadRetainedScreenshot,
|
|
5240
4141
|
loadRetainedArtifact
|
|
5241
4142
|
}
|
|
5242
|
-
) });
|
|
4143
|
+
) }) });
|
|
5243
4144
|
}
|
|
5244
4145
|
case "worker":
|
|
5245
4146
|
return /* @__PURE__ */ jsx13(WorkerRow, { item, onOpenSession });
|
|
@@ -5310,7 +4211,7 @@ function MemoryRow({
|
|
|
5310
4211
|
) : corrected && item.action === "updated" ? (
|
|
5311
4212
|
// Edited in place, no replacement record: the memory is still live, so
|
|
5312
4213
|
// show its current text — NOT the archived treatment.
|
|
5313
|
-
/* @__PURE__ */ jsxs9(
|
|
4214
|
+
/* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
5314
4215
|
/* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap text-og-base leading-6 text-og-fg-muted", children: item.preview }),
|
|
5315
4216
|
/* @__PURE__ */ jsx13(BodyNote, { tone: "muted", children: "Updated in place." })
|
|
5316
4217
|
] })
|
|
@@ -5346,7 +4247,7 @@ function WorkerRow({
|
|
|
5346
4247
|
const running = item.status === "running";
|
|
5347
4248
|
const failed = item.status === "failed";
|
|
5348
4249
|
const cancelled = item.status === "cancelled";
|
|
5349
|
-
const title = item
|
|
4250
|
+
const title = workerRowTitle(item);
|
|
5350
4251
|
if (compact) {
|
|
5351
4252
|
return /* @__PURE__ */ jsx13(
|
|
5352
4253
|
ActivityDisclosure,
|
|
@@ -5360,7 +4261,7 @@ function WorkerRow({
|
|
|
5360
4261
|
}
|
|
5361
4262
|
const sessionId = item.workerSessionId;
|
|
5362
4263
|
const deepLink = Boolean(sessionId) && Boolean(onOpenSession) && !failed && !cancelled;
|
|
5363
|
-
const inner = /* @__PURE__ */ jsxs9(
|
|
4264
|
+
const inner = /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
5364
4265
|
/* @__PURE__ */ jsx13("span", { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
5365
4266
|
/* @__PURE__ */ jsx13("span", { className: cn("mt-px shrink-0", failed ? "text-og-status-failed" : "text-og-accent"), children: /* @__PURE__ */ jsx13(BotIcon, { className: "size-3.5" }) }),
|
|
5366
4267
|
/* @__PURE__ */ jsxs9("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -5408,11 +4309,37 @@ function WorkerRow({
|
|
|
5408
4309
|
}
|
|
5409
4310
|
return /* @__PURE__ */ jsx13("div", { className: "flex items-start gap-2 px-1.5 py-1.5", children: inner });
|
|
5410
4311
|
}
|
|
4312
|
+
var ToolRowBoundary = class extends Component {
|
|
4313
|
+
state = { failed: false, resetKeys: this.props.resetKeys };
|
|
4314
|
+
static getDerivedStateFromError() {
|
|
4315
|
+
return { failed: true };
|
|
4316
|
+
}
|
|
4317
|
+
/** A new status or renderer for the row gets a fresh attempt. */
|
|
4318
|
+
static getDerivedStateFromProps(props, state) {
|
|
4319
|
+
const same = props.resetKeys.length === state.resetKeys.length && props.resetKeys.every((key, index) => Object.is(key, state.resetKeys[index]));
|
|
4320
|
+
return same ? null : { failed: false, resetKeys: props.resetKeys };
|
|
4321
|
+
}
|
|
4322
|
+
render() {
|
|
4323
|
+
if (!this.state.failed) return this.props.children;
|
|
4324
|
+
return /* @__PURE__ */ jsxs9(
|
|
4325
|
+
"div",
|
|
4326
|
+
{
|
|
4327
|
+
"data-testid": "tool-row-render-error",
|
|
4328
|
+
role: "status",
|
|
4329
|
+
className: "px-1.5 py-1.5 text-og-menu text-og-fg-subtle",
|
|
4330
|
+
children: [
|
|
4331
|
+
this.props.name,
|
|
4332
|
+
" \xB7 couldn't be displayed"
|
|
4333
|
+
]
|
|
4334
|
+
}
|
|
4335
|
+
);
|
|
4336
|
+
}
|
|
4337
|
+
};
|
|
5411
4338
|
|
|
5412
4339
|
// src/timeline/turn-summary.tsx
|
|
5413
4340
|
import { ChevronRightIcon as ChevronRightIcon3, CircleSlashIcon as CircleSlashIcon2, ShrinkIcon, TriangleAlertIcon } from "lucide-react";
|
|
5414
4341
|
import {
|
|
5415
|
-
Component,
|
|
4342
|
+
Component as Component2,
|
|
5416
4343
|
createContext as createContext9,
|
|
5417
4344
|
useContext as useContext10,
|
|
5418
4345
|
useEffect as useEffect9,
|
|
@@ -5441,20 +4368,11 @@ function inheritFoldRestingState(memory, targetKey, sourceKeys) {
|
|
|
5441
4368
|
}
|
|
5442
4369
|
|
|
5443
4370
|
// src/timeline/turn-summary.tsx
|
|
5444
|
-
import { Fragment as
|
|
4371
|
+
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5445
4372
|
var TurnSettleChromeContext = createContext9(false);
|
|
5446
4373
|
function useTurnSettleOpen() {
|
|
5447
4374
|
return useContext10(TurnSettleChromeContext);
|
|
5448
4375
|
}
|
|
5449
|
-
var BUILT_IN_TURN_SUMMARY_FACET_IDS = [
|
|
5450
|
-
"steps",
|
|
5451
|
-
"files",
|
|
5452
|
-
"commands",
|
|
5453
|
-
"screenshots",
|
|
5454
|
-
"memories",
|
|
5455
|
-
"compacted",
|
|
5456
|
-
"duration"
|
|
5457
|
-
];
|
|
5458
4376
|
var SETTLE_FOLD_BEAT_MS = 1100 * MOTION_INSPECT_SCALE;
|
|
5459
4377
|
var SETTLE_COLLAPSE_MS = 820 * MOTION_INSPECT_SCALE;
|
|
5460
4378
|
var DISCLOSE_MS = 120 * MOTION_INSPECT_SCALE;
|
|
@@ -5622,19 +4540,7 @@ function TurnSummary({
|
|
|
5622
4540
|
);
|
|
5623
4541
|
const statusKind = status?.kind;
|
|
5624
4542
|
const facets = useMemo4(
|
|
5625
|
-
() => facetDefinitions
|
|
5626
|
-
if (statusKind && (facet.id === "duration" || facet === BUILT_IN_TURN_SUMMARY_FACETS[0] && context.items.every(
|
|
5627
|
-
(item) => item.kind === "startup-phase" || item.kind === "agent-message"
|
|
5628
|
-
) || statusKind !== "worked" && facet.id !== "steps" && BUILT_IN_TURN_SUMMARY_FACET_IDS.includes(facet.id))) {
|
|
5629
|
-
return [];
|
|
5630
|
-
}
|
|
5631
|
-
try {
|
|
5632
|
-
const result = facet.summarize(context);
|
|
5633
|
-
return result && hasFacetContent(result.content) ? [{ facet, result }] : [];
|
|
5634
|
-
} catch {
|
|
5635
|
-
return [];
|
|
5636
|
-
}
|
|
5637
|
-
}),
|
|
4543
|
+
() => selectTurnSummaryFacets(facetDefinitions, context, statusKind),
|
|
5638
4544
|
[context, facetDefinitions, statusKind]
|
|
5639
4545
|
);
|
|
5640
4546
|
const liveShell = outcome === void 0 && open && !settlePhase && !bare;
|
|
@@ -5712,7 +4618,7 @@ function TurnSummary({
|
|
|
5712
4618
|
),
|
|
5713
4619
|
children: [
|
|
5714
4620
|
statusLine,
|
|
5715
|
-
liveHeader && !open && !status ? liveHeader : facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx14(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs10(
|
|
4621
|
+
liveHeader && !open && !status ? liveHeader : facets.map(({ facet, result }, index) => /* @__PURE__ */ jsx14(FacetRenderBoundary, { children: /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
5716
4622
|
index > 0 || statusLine ? " \xB7 " : null,
|
|
5717
4623
|
/* @__PURE__ */ jsxs10("span", { "aria-label": result.ariaLabel, title: result.title, children: [
|
|
5718
4624
|
result.icon ? /* @__PURE__ */ jsx14("span", { "aria-hidden": true, className: "mr-1 inline-flex align-[-0.125em]", children: result.icon }) : null,
|
|
@@ -5795,147 +4701,7 @@ function LiveElapsed({ since }) {
|
|
|
5795
4701
|
if (!Number.isFinite(startedAt)) return null;
|
|
5796
4702
|
return /* @__PURE__ */ jsx14("span", { className: "tabular-nums", children: ` \xB7 ${formatElapsed(Math.max(0, now - startedAt))}` });
|
|
5797
4703
|
}
|
|
5798
|
-
|
|
5799
|
-
const totalSeconds = Math.max(0, Math.floor(durationMs / 1e3));
|
|
5800
|
-
if (totalSeconds < 60) {
|
|
5801
|
-
return `${totalSeconds}s`;
|
|
5802
|
-
}
|
|
5803
|
-
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
5804
|
-
if (totalMinutes < 60) {
|
|
5805
|
-
const seconds = totalSeconds % 60;
|
|
5806
|
-
return seconds ? `${totalMinutes}m ${seconds}s` : `${totalMinutes}m`;
|
|
5807
|
-
}
|
|
5808
|
-
const hours = Math.floor(totalMinutes / 60);
|
|
5809
|
-
return `${hours}h ${String(totalMinutes % 60).padStart(2, "0")}m`;
|
|
5810
|
-
}
|
|
5811
|
-
function createTurnSummaryContext(items, outcome, failureText, durationMs, contextCompactionCount) {
|
|
5812
|
-
const itemSnapshot = Object.freeze([...items]);
|
|
5813
|
-
const toolCalls = Object.freeze(
|
|
5814
|
-
itemSnapshot.filter((item) => item.kind === "tool-call")
|
|
5815
|
-
);
|
|
5816
|
-
const settled = itemSnapshot.every((item) => {
|
|
5817
|
-
if (item.kind === "reasoning" || item.kind === "agent-message") {
|
|
5818
|
-
return !item.streaming;
|
|
5819
|
-
}
|
|
5820
|
-
if (item.kind === "tool-call" || item.kind === "worker" || item.kind === "sandbox" || item.kind === "startup-phase") {
|
|
5821
|
-
return item.status !== "running";
|
|
5822
|
-
}
|
|
5823
|
-
return true;
|
|
5824
|
-
});
|
|
5825
|
-
return Object.freeze({
|
|
5826
|
-
items: itemSnapshot,
|
|
5827
|
-
toolCalls,
|
|
5828
|
-
outcome,
|
|
5829
|
-
failureText,
|
|
5830
|
-
durationMs,
|
|
5831
|
-
settled,
|
|
5832
|
-
contextCompactionCount: Math.max(0, Math.floor(contextCompactionCount))
|
|
5833
|
-
});
|
|
5834
|
-
}
|
|
5835
|
-
var BUILT_IN_TURN_SUMMARY_FACETS = Object.freeze([
|
|
5836
|
-
{
|
|
5837
|
-
id: "steps",
|
|
5838
|
-
summarize: ({ items }) => {
|
|
5839
|
-
const count = items.filter(
|
|
5840
|
-
(item) => item.kind !== "startup-phase" && item.kind !== "agent-message"
|
|
5841
|
-
).length;
|
|
5842
|
-
return count ? { content: `${count} ${count === 1 ? "step" : "steps"}` } : items.some((item) => item.kind === "startup-phase") ? { content: "Preparation" } : null;
|
|
5843
|
-
}
|
|
5844
|
-
},
|
|
5845
|
-
{
|
|
5846
|
-
id: "files",
|
|
5847
|
-
summarize: ({ toolCalls }) => {
|
|
5848
|
-
let files = 0;
|
|
5849
|
-
for (const item of toolCalls) {
|
|
5850
|
-
if (isApplyPatch(item)) {
|
|
5851
|
-
files += applyPatchOpsFromToolItem(item).length;
|
|
5852
|
-
}
|
|
5853
|
-
}
|
|
5854
|
-
return files ? { content: `${files} ${files === 1 ? "file" : "files"} edited` } : null;
|
|
5855
|
-
}
|
|
5856
|
-
},
|
|
5857
|
-
{
|
|
5858
|
-
id: "commands",
|
|
5859
|
-
summarize: ({ toolCalls }) => {
|
|
5860
|
-
const commands = toolCalls.filter((item) => item.name === "exec_command").length;
|
|
5861
|
-
return commands ? { content: `${commands} ${commands === 1 ? "command" : "commands"}` } : null;
|
|
5862
|
-
}
|
|
5863
|
-
},
|
|
5864
|
-
{
|
|
5865
|
-
id: "screenshots",
|
|
5866
|
-
summarize: ({ toolCalls }) => {
|
|
5867
|
-
let screenshots = 0;
|
|
5868
|
-
for (const item of toolCalls) {
|
|
5869
|
-
const leaf = mcpToolLeaf(item.name);
|
|
5870
|
-
if ((rawTypeOf(item) === "computer_call" || item.name === "computer_call" || item.name === "computer_screenshot" || leaf === "browser_screenshot" || leaf === "browser_observe" || leaf === "browser_act") && (retainedScreenshotMetadata(item.output) !== null || screenshotDataUrl(item.output) !== null || mediaPreviewFact(item.output) !== null)) {
|
|
5871
|
-
screenshots += 1;
|
|
5872
|
-
}
|
|
5873
|
-
}
|
|
5874
|
-
return screenshots ? {
|
|
5875
|
-
content: `${screenshots} ${screenshots === 1 ? "screenshot" : "screenshots"}`
|
|
5876
|
-
} : null;
|
|
5877
|
-
}
|
|
5878
|
-
},
|
|
5879
|
-
{
|
|
5880
|
-
id: "memories",
|
|
5881
|
-
summarize: ({ items }) => {
|
|
5882
|
-
let saved = 0;
|
|
5883
|
-
let updated = 0;
|
|
5884
|
-
for (const item of items) {
|
|
5885
|
-
if (item.kind !== "memory") {
|
|
5886
|
-
continue;
|
|
5887
|
-
}
|
|
5888
|
-
if (item.variant === "corrected") {
|
|
5889
|
-
updated += 1;
|
|
5890
|
-
} else {
|
|
5891
|
-
saved += 1;
|
|
5892
|
-
}
|
|
5893
|
-
}
|
|
5894
|
-
const parts = [];
|
|
5895
|
-
if (saved) {
|
|
5896
|
-
parts.push(`${saved} ${saved === 1 ? "memory" : "memories"} saved`);
|
|
5897
|
-
}
|
|
5898
|
-
if (updated) {
|
|
5899
|
-
parts.push(`${updated} ${updated === 1 ? "memory" : "memories"} updated`);
|
|
5900
|
-
}
|
|
5901
|
-
return parts.length > 0 ? { content: parts.join(" \xB7 ") } : null;
|
|
5902
|
-
}
|
|
5903
|
-
},
|
|
5904
|
-
{
|
|
5905
|
-
id: "compacted",
|
|
5906
|
-
summarize: ({ contextCompactionCount }) => contextCompactionCount > 0 ? {
|
|
5907
|
-
content: contextCompactionCount === 1 ? "compacted" : `${contextCompactionCount} compacts`,
|
|
5908
|
-
ariaLabel: contextCompactionCount === 1 ? "Conversation history compacted" : `${contextCompactionCount} conversation history compactions`
|
|
5909
|
-
} : null
|
|
5910
|
-
},
|
|
5911
|
-
{
|
|
5912
|
-
id: "duration",
|
|
5913
|
-
summarize: ({ durationMs }) => {
|
|
5914
|
-
const duration = formatDurationFacet(durationMs);
|
|
5915
|
-
return duration ? { content: duration } : null;
|
|
5916
|
-
}
|
|
5917
|
-
}
|
|
5918
|
-
]);
|
|
5919
|
-
function resolveTurnSummaryFacets(configuration) {
|
|
5920
|
-
const requested = configuration?.replace ?? [
|
|
5921
|
-
...BUILT_IN_TURN_SUMMARY_FACETS.filter(
|
|
5922
|
-
(facet) => !configuration?.remove?.includes(facet.id)
|
|
5923
|
-
),
|
|
5924
|
-
...configuration?.add ?? []
|
|
5925
|
-
];
|
|
5926
|
-
const seen = /* @__PURE__ */ new Set();
|
|
5927
|
-
return requested.filter((facet) => {
|
|
5928
|
-
if (!facet.id || seen.has(facet.id)) {
|
|
5929
|
-
return false;
|
|
5930
|
-
}
|
|
5931
|
-
seen.add(facet.id);
|
|
5932
|
-
return true;
|
|
5933
|
-
});
|
|
5934
|
-
}
|
|
5935
|
-
function hasFacetContent(content) {
|
|
5936
|
-
return content !== null && content !== void 0 && content !== false && content !== "";
|
|
5937
|
-
}
|
|
5938
|
-
var FacetRenderBoundary = class extends Component {
|
|
4704
|
+
var FacetRenderBoundary = class extends Component2 {
|
|
5939
4705
|
state = { failed: false };
|
|
5940
4706
|
static getDerivedStateFromError() {
|
|
5941
4707
|
return { failed: true };
|
|
@@ -5944,22 +4710,6 @@ var FacetRenderBoundary = class extends Component {
|
|
|
5944
4710
|
return this.state.failed ? null : this.props.children;
|
|
5945
4711
|
}
|
|
5946
4712
|
};
|
|
5947
|
-
function formatDurationFacet(durationMs) {
|
|
5948
|
-
if (durationMs === void 0 || !Number.isFinite(durationMs) || durationMs < 1e3) {
|
|
5949
|
-
return null;
|
|
5950
|
-
}
|
|
5951
|
-
const totalSeconds = Math.floor(durationMs / 1e3);
|
|
5952
|
-
if (totalSeconds < 60) {
|
|
5953
|
-
return `${totalSeconds}s`;
|
|
5954
|
-
}
|
|
5955
|
-
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
5956
|
-
if (totalMinutes < 60) {
|
|
5957
|
-
return `${totalMinutes}m`;
|
|
5958
|
-
}
|
|
5959
|
-
const hours = Math.floor(totalMinutes / 60);
|
|
5960
|
-
const minutes = totalMinutes % 60;
|
|
5961
|
-
return `${hours}h ${String(minutes).padStart(2, "0")}m`;
|
|
5962
|
-
}
|
|
5963
4713
|
|
|
5964
4714
|
// src/components/user-message-body.tsx
|
|
5965
4715
|
import {
|
|
@@ -6344,15 +5094,15 @@ function UserMessageBody({
|
|
|
6344
5094
|
|
|
6345
5095
|
// src/timeline/retained-loaders.ts
|
|
6346
5096
|
function createWorkspaceRetainedArtifactLoader(client, workspaceId) {
|
|
6347
|
-
return async (artifact, signal) => {
|
|
6348
|
-
if (artifact.kind === "file") {
|
|
5097
|
+
return async (artifact, signal, options) => {
|
|
5098
|
+
if (artifact.kind === "file" && options?.prefer !== "url") {
|
|
6349
5099
|
const download2 = await client.downloadRetainedArtifact(workspaceId, artifact, { signal });
|
|
6350
5100
|
return download2.bytes;
|
|
6351
5101
|
}
|
|
6352
5102
|
const download = await client.createRetainedArtifactDownloadUrl(workspaceId, artifact, {
|
|
6353
5103
|
signal
|
|
6354
5104
|
});
|
|
6355
|
-
return { url: download.url };
|
|
5105
|
+
return { url: download.url, expiresAt: download.expiresAt };
|
|
6356
5106
|
};
|
|
6357
5107
|
}
|
|
6358
5108
|
function createSessionRetainedScreenshotLoader(client, workspaceId, sessionId) {
|
|
@@ -6453,52 +5203,52 @@ function GeneratedVideoPlayer({
|
|
|
6453
5203
|
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6454
5204
|
var SESSION_STATUS_META = {
|
|
6455
5205
|
queued: {
|
|
6456
|
-
label:
|
|
5206
|
+
label: SESSION_STATUS_PRESENTATION.queued.label,
|
|
6457
5207
|
dotClassName: "bg-og-status-queued",
|
|
6458
5208
|
badgeClassName: "text-og-fg-muted border-og-border bg-og-status-queued/10",
|
|
6459
|
-
pulse:
|
|
5209
|
+
pulse: SESSION_STATUS_PRESENTATION.queued.pulse
|
|
6460
5210
|
},
|
|
6461
5211
|
running: {
|
|
6462
|
-
label:
|
|
5212
|
+
label: SESSION_STATUS_PRESENTATION.running.label,
|
|
6463
5213
|
dotClassName: "bg-og-status-running",
|
|
6464
5214
|
badgeClassName: "text-og-status-running border-og-status-running/30 bg-og-status-running/10",
|
|
6465
|
-
pulse:
|
|
5215
|
+
pulse: SESSION_STATUS_PRESENTATION.running.pulse
|
|
6466
5216
|
},
|
|
6467
5217
|
recovering: {
|
|
6468
|
-
label:
|
|
5218
|
+
label: SESSION_STATUS_PRESENTATION.recovering.label,
|
|
6469
5219
|
dotClassName: "bg-og-status-running",
|
|
6470
5220
|
badgeClassName: "text-og-status-running border-og-status-running/30 bg-og-status-running/10",
|
|
6471
|
-
pulse:
|
|
5221
|
+
pulse: SESSION_STATUS_PRESENTATION.recovering.pulse
|
|
6472
5222
|
},
|
|
6473
5223
|
waiting_capacity: {
|
|
6474
|
-
label:
|
|
5224
|
+
label: SESSION_STATUS_PRESENTATION.waiting_capacity.label,
|
|
6475
5225
|
dotClassName: "bg-og-status-waiting",
|
|
6476
5226
|
badgeClassName: "text-og-status-waiting border-og-status-waiting/35 bg-og-status-waiting/10",
|
|
6477
|
-
pulse:
|
|
5227
|
+
pulse: SESSION_STATUS_PRESENTATION.waiting_capacity.pulse
|
|
6478
5228
|
},
|
|
6479
5229
|
idle: {
|
|
6480
|
-
label:
|
|
5230
|
+
label: SESSION_STATUS_PRESENTATION.idle.label,
|
|
6481
5231
|
dotClassName: "bg-og-status-idle",
|
|
6482
5232
|
badgeClassName: "text-og-status-idle border-og-status-idle/30 bg-og-status-idle/10",
|
|
6483
|
-
pulse:
|
|
5233
|
+
pulse: SESSION_STATUS_PRESENTATION.idle.pulse
|
|
6484
5234
|
},
|
|
6485
5235
|
requires_action: {
|
|
6486
|
-
label:
|
|
5236
|
+
label: SESSION_STATUS_PRESENTATION.requires_action.label,
|
|
6487
5237
|
dotClassName: "bg-og-status-waiting",
|
|
6488
5238
|
badgeClassName: "text-og-status-waiting border-og-status-waiting/35 bg-og-status-waiting/10",
|
|
6489
|
-
pulse:
|
|
5239
|
+
pulse: SESSION_STATUS_PRESENTATION.requires_action.pulse
|
|
6490
5240
|
},
|
|
6491
5241
|
failed: {
|
|
6492
|
-
label:
|
|
5242
|
+
label: SESSION_STATUS_PRESENTATION.failed.label,
|
|
6493
5243
|
dotClassName: "bg-og-status-failed",
|
|
6494
5244
|
badgeClassName: "text-og-status-failed border-og-status-failed/35 bg-og-status-failed/10",
|
|
6495
|
-
pulse:
|
|
5245
|
+
pulse: SESSION_STATUS_PRESENTATION.failed.pulse
|
|
6496
5246
|
},
|
|
6497
5247
|
cancelled: {
|
|
6498
|
-
label:
|
|
5248
|
+
label: SESSION_STATUS_PRESENTATION.cancelled.label,
|
|
6499
5249
|
dotClassName: "bg-og-status-cancelled",
|
|
6500
5250
|
badgeClassName: "text-og-fg-subtle border-og-border bg-og-status-cancelled/10",
|
|
6501
|
-
pulse:
|
|
5251
|
+
pulse: SESSION_STATUS_PRESENTATION.cancelled.pulse
|
|
6502
5252
|
}
|
|
6503
5253
|
};
|
|
6504
5254
|
function SessionStatus({ status, label, size = "md", className }) {
|
|
@@ -6549,51 +5299,35 @@ function RollingActivity({
|
|
|
6549
5299
|
const reduced = useReducedMotion2();
|
|
6550
5300
|
const [mounted, setMounted] = useState15(false);
|
|
6551
5301
|
useEffect11(() => setMounted(true), []);
|
|
6552
|
-
const
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
const active = work.filter(
|
|
6556
|
-
(item2) => item2.kind === "reasoning" ? item2.streaming : "status" in item2 && item2.status === "running"
|
|
6557
|
-
);
|
|
6558
|
-
const item = !mounted && previousItem && previousItem.kind !== "agent-message" ? previousItem : work.at(-1);
|
|
6559
|
-
if (!item) return null;
|
|
6560
|
-
const earlierCount = Math.max(
|
|
6561
|
-
0,
|
|
6562
|
-
work.findIndex((entry) => entry.id === item.id)
|
|
6563
|
-
);
|
|
5302
|
+
const selected = rollingActivityItem(items, previousItem, mounted);
|
|
5303
|
+
if (!selected) return null;
|
|
5304
|
+
const { item, earlierCount } = selected;
|
|
6564
5305
|
const fallback2 = /* @__PURE__ */ jsxs13("span", { className: "og-rolling-label", children: [
|
|
6565
5306
|
/* @__PURE__ */ jsx18(WrenchIcon2, { className: "size-3.5" }),
|
|
6566
5307
|
/* @__PURE__ */ jsx18("span", { children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : "Working" })
|
|
6567
5308
|
] });
|
|
6568
|
-
return /* @__PURE__ */ jsxs13(
|
|
6569
|
-
"span",
|
|
6570
|
-
{
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
},
|
|
6591
|
-
item.id
|
|
6592
|
-
) }) }),
|
|
6593
|
-
showCount && earlierCount > 0 ? /* @__PURE__ */ jsx18("span", { className: "og-rolling-count", children: `+${earlierCount} earlier` }) : null
|
|
6594
|
-
]
|
|
6595
|
-
}
|
|
6596
|
-
);
|
|
5309
|
+
return /* @__PURE__ */ jsxs13("span", { className: "og-rolling-status", "data-running": selected.running ? "true" : void 0, children: [
|
|
5310
|
+
/* @__PURE__ */ jsx18("span", { className: "sr-only", children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : item.kind === "reasoning" ? "Thinking" : "Working" }),
|
|
5311
|
+
/* @__PURE__ */ jsx18("span", { className: "og-rolling-window", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(AnimatePresence2, { initial: false, mode: "sync", children: /* @__PURE__ */ jsx18(
|
|
5312
|
+
motion2.span,
|
|
5313
|
+
{
|
|
5314
|
+
className: "og-rolling-face",
|
|
5315
|
+
initial: {
|
|
5316
|
+
opacity: 0,
|
|
5317
|
+
y: reduced ? 0 : 24
|
|
5318
|
+
},
|
|
5319
|
+
animate: { opacity: 1, y: 0 },
|
|
5320
|
+
exit: {
|
|
5321
|
+
opacity: 0,
|
|
5322
|
+
y: reduced ? 0 : -24
|
|
5323
|
+
},
|
|
5324
|
+
transition: { duration: reduced ? 0 : 0.4, ease: [0.22, 1, 0.36, 1] },
|
|
5325
|
+
children: /* @__PURE__ */ jsx18(CompactActivityContext.Provider, { value: true, children: /* @__PURE__ */ jsx18(Suspense3, { fallback: fallback2, children: renderActivity(item, toolRegistry, void 0, void 0, void 0, void 0) }) })
|
|
5326
|
+
},
|
|
5327
|
+
item.id
|
|
5328
|
+
) }) }),
|
|
5329
|
+
showCount && earlierCount > 0 ? /* @__PURE__ */ jsx18("span", { className: "og-rolling-count", children: `+${earlierCount} earlier` }) : null
|
|
5330
|
+
] });
|
|
6597
5331
|
}
|
|
6598
5332
|
|
|
6599
5333
|
// src/components/child-session-link.tsx
|
|
@@ -6667,7 +5401,7 @@ import {
|
|
|
6667
5401
|
import { AnimatePresence as AnimatePresence3, motion as motion3, useReducedMotion as useReducedMotion3 } from "motion/react";
|
|
6668
5402
|
import { Collapsible as Collapsible2 } from "radix-ui";
|
|
6669
5403
|
import {
|
|
6670
|
-
Component as
|
|
5404
|
+
Component as Component4,
|
|
6671
5405
|
Suspense as Suspense4,
|
|
6672
5406
|
createContext as createContext12,
|
|
6673
5407
|
lazy as lazy3,
|
|
@@ -6682,7 +5416,7 @@ import {
|
|
|
6682
5416
|
} from "react";
|
|
6683
5417
|
|
|
6684
5418
|
// src/components/timeline-anchor.tsx
|
|
6685
|
-
import { Component as
|
|
5419
|
+
import { Component as Component3 } from "react";
|
|
6686
5420
|
function timelineHasReader(scroller) {
|
|
6687
5421
|
if (!scroller) return false;
|
|
6688
5422
|
const focused = scroller.ownerDocument.activeElement;
|
|
@@ -6691,7 +5425,7 @@ function timelineHasReader(scroller) {
|
|
|
6691
5425
|
focused && focused !== scroller && scroller.contains(focused) || selection && !selection.isCollapsed && (scroller.contains(selection.anchorNode) || scroller.contains(selection.focusNode))
|
|
6692
5426
|
);
|
|
6693
5427
|
}
|
|
6694
|
-
var TimelineBeforeLayout = class extends
|
|
5428
|
+
var TimelineBeforeLayout = class extends Component3 {
|
|
6695
5429
|
getSnapshotBeforeUpdate() {
|
|
6696
5430
|
this.props.capture();
|
|
6697
5431
|
return null;
|
|
@@ -7238,7 +5972,7 @@ function machineInputSummaryIsUseful(kind, cleanedSummary) {
|
|
|
7238
5972
|
// src/timeline/allowance-exhausted-row.tsx
|
|
7239
5973
|
import { GaugeIcon } from "lucide-react";
|
|
7240
5974
|
import { createContext as createContext11, useContext as useContext12, useMemo as useMemo6 } from "react";
|
|
7241
|
-
import { Fragment as
|
|
5975
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7242
5976
|
var AllowancePresentationContext = createContext11({
|
|
7243
5977
|
render: void 0,
|
|
7244
5978
|
labels: allowanceLabels()
|
|
@@ -7284,16 +6018,15 @@ function AllowanceExhaustedRow({ refusal }) {
|
|
|
7284
6018
|
]
|
|
7285
6019
|
}
|
|
7286
6020
|
);
|
|
7287
|
-
return /* @__PURE__ */ jsx20(
|
|
6021
|
+
return /* @__PURE__ */ jsx20(Fragment6, { children: render?.(refusal, { labels, defaultRow }) ?? defaultRow });
|
|
7288
6022
|
}
|
|
7289
6023
|
|
|
7290
6024
|
// src/components/message-timeline.tsx
|
|
7291
|
-
import { Fragment as
|
|
6025
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7292
6026
|
var TimelineAnnotationSelection = lazy3(() => import("./timeline-annotation-selection-BI7QTPTZ.js"));
|
|
7293
6027
|
var TimelineAnnotationMarkers = lazy3(() => import("./timeline-annotation-markers-U3G66KUD.js"));
|
|
7294
6028
|
var PIN_THRESHOLD_PX = 48;
|
|
7295
6029
|
var JUMP_TO_LATEST_CATCHUP_DEBT_PX = 240;
|
|
7296
|
-
var QUESTION_NAV_MARGIN_PX = 12;
|
|
7297
6030
|
var NAV_BUTTON_CLASS = "pointer-events-auto relative inline-flex size-8 items-center justify-center rounded-full border border-og-border bg-og-surface-3/90 text-og-fg-muted shadow-og-md backdrop-blur hover:border-og-border-strong hover:text-og-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-og-accent pointer-coarse:before:absolute pointer-coarse:before:-inset-1.5 pointer-coarse:before:content-['']";
|
|
7298
6031
|
var NAV_FADE = {
|
|
7299
6032
|
initial: { opacity: 0 },
|
|
@@ -7377,19 +6110,16 @@ function contentTopOf(node, groupKey) {
|
|
|
7377
6110
|
}
|
|
7378
6111
|
return element.getBoundingClientRect().top - node.getBoundingClientRect().top + node.scrollTop;
|
|
7379
6112
|
}
|
|
7380
|
-
var QUESTION_NAV_HIDDEN_PX = 24;
|
|
7381
6113
|
function readQuestionNav(node) {
|
|
7382
6114
|
const view = node.getBoundingClientRect();
|
|
7383
|
-
const prompts = [...node.querySelectorAll("[data-og-prompt]")]
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
}
|
|
7392
|
-
return { key, belowHeader: workHeaderPinned(node, view) };
|
|
6115
|
+
const prompts = [...node.querySelectorAll("[data-og-prompt]")].flatMap((prompt) => {
|
|
6116
|
+
const key2 = prompt.dataset.ogGroupKey;
|
|
6117
|
+
if (!key2) return [];
|
|
6118
|
+
const bounds = prompt.getBoundingClientRect();
|
|
6119
|
+
return [{ key: key2, top: bounds.top, bottom: bounds.bottom }];
|
|
6120
|
+
});
|
|
6121
|
+
const key = questionNavTarget(prompts, { top: view.top, height: view.height });
|
|
6122
|
+
return key ? { key, belowHeader: workHeaderPinned(node, view) } : null;
|
|
7393
6123
|
}
|
|
7394
6124
|
function workHeaderPinned(node, view) {
|
|
7395
6125
|
for (const header of node.querySelectorAll(
|
|
@@ -7479,6 +6209,7 @@ function MessageTimeline({
|
|
|
7479
6209
|
Markdown,
|
|
7480
6210
|
{
|
|
7481
6211
|
searchTarget: searchItem?.id === item.id ? searchTarget : null,
|
|
6212
|
+
softLineBreaks: true,
|
|
7482
6213
|
streaming: item.kind === "agent-message" && item.streaming,
|
|
7483
6214
|
renderInteractiveBlock: item.kind === "agent-message" ? renderInteractiveBlock : void 0,
|
|
7484
6215
|
children: text
|
|
@@ -9199,7 +7930,7 @@ function cancelFrame(id) {
|
|
|
9199
7930
|
function timelineRenderResetKeysChanged(previous, next) {
|
|
9200
7931
|
return previous.length !== next.length || previous.some((key, index) => !Object.is(key, next[index]));
|
|
9201
7932
|
}
|
|
9202
|
-
var TimelineGroupRenderBoundary = class extends
|
|
7933
|
+
var TimelineGroupRenderBoundary = class extends Component4 {
|
|
9203
7934
|
state = {
|
|
9204
7935
|
failed: false,
|
|
9205
7936
|
resetKeys: this.props.resetKeys
|
|
@@ -9332,10 +8063,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
9332
8063
|
switch (group.kind) {
|
|
9333
8064
|
case "activity":
|
|
9334
8065
|
if (group.work) {
|
|
9335
|
-
const
|
|
9336
|
-
const preparing = !startupDetails && !startupDismissed && !group.work.endedAt && !group.work.waiting && phases.length > 0 && group.items.every(
|
|
9337
|
-
(item) => item.kind === "startup-phase" || item.kind === "reasoning" && !item.text.trim()
|
|
9338
|
-
) && !phases.some((item) => item.status === "failed" || item.status === "cancelled");
|
|
8066
|
+
const preparing = isPreparingWork(group, { startupDetails, startupDismissed });
|
|
9339
8067
|
if (preparing) {
|
|
9340
8068
|
return /* @__PURE__ */ jsx21(
|
|
9341
8069
|
ActivityRail,
|
|
@@ -9351,19 +8079,18 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
9351
8079
|
}
|
|
9352
8080
|
);
|
|
9353
8081
|
}
|
|
9354
|
-
const
|
|
9355
|
-
const status =
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
preview: containsPresentedImage ? void 0 : /* @__PURE__ */ jsx21(
|
|
8082
|
+
const workStatus = readableWorkStatus({ ...group, work: group.work });
|
|
8083
|
+
const status = workStatus.kind === "working" ? {
|
|
8084
|
+
...workStatus,
|
|
8085
|
+
preview: readableWorkShowsPreview(group) ? /* @__PURE__ */ jsx21(
|
|
9359
8086
|
RollingActivity,
|
|
9360
8087
|
{
|
|
9361
8088
|
items: group.items,
|
|
9362
8089
|
toolRegistry,
|
|
9363
8090
|
showCount: false
|
|
9364
8091
|
}
|
|
9365
|
-
)
|
|
9366
|
-
};
|
|
8092
|
+
) : void 0
|
|
8093
|
+
} : workStatus;
|
|
9367
8094
|
return (
|
|
9368
8095
|
// Marks this work row for the live-note fold (list keys can be carried
|
|
9369
8096
|
// over from an earlier row, so they are not the work id).
|
|
@@ -9375,7 +8102,7 @@ var TimelineGroupView = memo(function TimelineGroupView2({
|
|
|
9375
8102
|
outcome: group.outcome,
|
|
9376
8103
|
failureText: group.failureText,
|
|
9377
8104
|
foldKey: group.id,
|
|
9378
|
-
defaultOpen:
|
|
8105
|
+
defaultOpen: readableWorkDefaultOpen(group),
|
|
9379
8106
|
facets: turnSummary?.facets,
|
|
9380
8107
|
contextCompactionCount: compactedLandmarkCount(group.work.details),
|
|
9381
8108
|
onOpenStateChange: group.work.liveNoteIds?.length && reportLiveFold ? (open) => reportLiveFold(group.id, open) : void 0,
|
|
@@ -9607,13 +8334,8 @@ function renderFoldedGroups(groups, behavior, readableWork = false) {
|
|
|
9607
8334
|
timelineGroupKey(child)
|
|
9608
8335
|
));
|
|
9609
8336
|
}
|
|
9610
|
-
function compactedLandmarkCount(groups) {
|
|
9611
|
-
return groups.filter(
|
|
9612
|
-
(group) => group.kind === "item" && group.item.kind === "context-compaction" && group.item.phase === "compacted"
|
|
9613
|
-
).length;
|
|
9614
|
-
}
|
|
9615
8337
|
function FoldBody({ children }) {
|
|
9616
|
-
return /* @__PURE__ */ jsx21(
|
|
8338
|
+
return /* @__PURE__ */ jsx21(Fragment7, { children });
|
|
9617
8339
|
}
|
|
9618
8340
|
function TurnRailFrame({ children, compact = false }) {
|
|
9619
8341
|
return /* @__PURE__ */ jsx21(
|
|
@@ -9677,17 +8399,6 @@ function isAgentProgress(next) {
|
|
|
9677
8399
|
}
|
|
9678
8400
|
return next.kind === "activity" || next.kind === "turn" || next.kind === "item" && next.item.kind === "agent-message" && next.item.text.trim().length > 0;
|
|
9679
8401
|
}
|
|
9680
|
-
function clusterIsSettled(group) {
|
|
9681
|
-
return group.items.every((item) => {
|
|
9682
|
-
if (item.kind === "reasoning" || item.kind === "agent-message") {
|
|
9683
|
-
return !item.streaming;
|
|
9684
|
-
}
|
|
9685
|
-
if (item.kind === "memory" || item.kind === "fleet-decision") {
|
|
9686
|
-
return true;
|
|
9687
|
-
}
|
|
9688
|
-
return item.status !== "running";
|
|
9689
|
-
});
|
|
9690
|
-
}
|
|
9691
8402
|
function foldableActivityClusterCount(groups) {
|
|
9692
8403
|
let count = 0;
|
|
9693
8404
|
for (const child of groups) {
|
|
@@ -9697,17 +8408,6 @@ function foldableActivityClusterCount(groups) {
|
|
|
9697
8408
|
}
|
|
9698
8409
|
return count;
|
|
9699
8410
|
}
|
|
9700
|
-
function flattenActivityItems(groups) {
|
|
9701
|
-
const items = [];
|
|
9702
|
-
for (const group of groups) {
|
|
9703
|
-
if (group.kind === "activity") {
|
|
9704
|
-
items.push(...flattenActivityItems(group.work?.details ?? []), ...group.items);
|
|
9705
|
-
} else if (group.kind === "turn") {
|
|
9706
|
-
items.push(...flattenActivityItems(group.groups));
|
|
9707
|
-
}
|
|
9708
|
-
}
|
|
9709
|
-
return items;
|
|
9710
|
-
}
|
|
9711
8411
|
function collectAgentMessageText(groups) {
|
|
9712
8412
|
const parts = [];
|
|
9713
8413
|
for (const group of groups) {
|
|
@@ -9787,14 +8487,6 @@ function collectTurnCopyText(groups, trailingAgentText) {
|
|
|
9787
8487
|
}
|
|
9788
8488
|
return parts.join("\n\n");
|
|
9789
8489
|
}
|
|
9790
|
-
function durationBetween(startedAt, endedAt) {
|
|
9791
|
-
const started = Date.parse(startedAt);
|
|
9792
|
-
const ended = Date.parse(endedAt);
|
|
9793
|
-
if (!Number.isFinite(started) || !Number.isFinite(ended) || ended < started) {
|
|
9794
|
-
return void 0;
|
|
9795
|
-
}
|
|
9796
|
-
return ended - started;
|
|
9797
|
-
}
|
|
9798
8490
|
function TimelineRow({
|
|
9799
8491
|
item,
|
|
9800
8492
|
renderMessageActions,
|
|
@@ -9922,7 +8614,7 @@ function UserMessageRow({
|
|
|
9922
8614
|
${annotation.note}`).join("\n\n"),
|
|
9923
8615
|
label: "Copy message",
|
|
9924
8616
|
className: "w-fit max-w-full min-w-0",
|
|
9925
|
-
trailing: /* @__PURE__ */ jsxs15(
|
|
8617
|
+
trailing: /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
9926
8618
|
renderMessageActions?.(item),
|
|
9927
8619
|
/* @__PURE__ */ jsx21(MessageFooterTime, { occurredAt: item.occurredAt })
|
|
9928
8620
|
] }),
|
|
@@ -9932,7 +8624,7 @@ ${annotation.note}`).join("\n\n"),
|
|
|
9932
8624
|
{
|
|
9933
8625
|
"data-og-search-item": item.id,
|
|
9934
8626
|
"data-og-annotation-source-key": item.annotationSource?.eventId,
|
|
9935
|
-
children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx21(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx21(Markdown, { children: item.text }) })
|
|
8627
|
+
children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx21(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx21(Markdown, { softLineBreaks: true, children: item.text }) })
|
|
9936
8628
|
}
|
|
9937
8629
|
) : null,
|
|
9938
8630
|
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx21(
|
|
@@ -10083,7 +8775,7 @@ function AgentMessageRow({
|
|
|
10083
8775
|
renderMessageText
|
|
10084
8776
|
}) {
|
|
10085
8777
|
const enter = useEntranceAnimation();
|
|
10086
|
-
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx21(Markdown, { streaming: item.streaming, children: item.text });
|
|
8778
|
+
const body = renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx21(Markdown, { softLineBreaks: true, streaming: item.streaming, children: item.text });
|
|
10087
8779
|
return /* @__PURE__ */ jsx21(
|
|
10088
8780
|
CopyHoverFrame,
|
|
10089
8781
|
{
|
|
@@ -10091,7 +8783,7 @@ function AgentMessageRow({
|
|
|
10091
8783
|
label: "Copy message",
|
|
10092
8784
|
align: "start",
|
|
10093
8785
|
className: cn(enter && "animate-og-enter", "min-w-0 text-og-md leading-7 text-og-fg"),
|
|
10094
|
-
trailing: item.streaming ? null : /* @__PURE__ */ jsxs15(
|
|
8786
|
+
trailing: item.streaming ? null : /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
10095
8787
|
renderMessageActions?.(item),
|
|
10096
8788
|
/* @__PURE__ */ jsx21(MessageFooterTime, { occurredAt: item.occurredAt })
|
|
10097
8789
|
] }),
|
|
@@ -10484,8 +9176,9 @@ function NoticeRow({ item }) {
|
|
|
10484
9176
|
}
|
|
10485
9177
|
);
|
|
10486
9178
|
}
|
|
10487
|
-
const
|
|
10488
|
-
const
|
|
9179
|
+
const presentedTone = noticeTone(item);
|
|
9180
|
+
const resolvedApproval = noticeIsResolvedApproval(item);
|
|
9181
|
+
const tone = presentedTone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : presentedTone === "waiting" ? WAITING_PILL_CLASS : NEUTRAL_PILL;
|
|
10489
9182
|
return /* @__PURE__ */ jsxs15(
|
|
10490
9183
|
"div",
|
|
10491
9184
|
{
|
|
@@ -10503,7 +9196,7 @@ function NoticeRow({ item }) {
|
|
|
10503
9196
|
}
|
|
10504
9197
|
),
|
|
10505
9198
|
/* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
|
|
10506
|
-
/* @__PURE__ */ jsx21("span", { className: "whitespace-pre-wrap break-words", children:
|
|
9199
|
+
/* @__PURE__ */ jsx21("span", { className: "whitespace-pre-wrap break-words", children: noticeDisplayText(item) }),
|
|
10507
9200
|
item.details ? /* @__PURE__ */ jsxs15("details", { className: "mt-2 text-og-control", children: [
|
|
10508
9201
|
/* @__PURE__ */ jsx21("summary", { className: "cursor-pointer font-medium", children: item.details.label }),
|
|
10509
9202
|
/* @__PURE__ */ jsx21("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-og-sm bg-og-fg/5 p-2 font-mono", children: JSON.stringify(item.details.value, null, 2) })
|
|
@@ -10528,7 +9221,7 @@ function recordedWaitSummary(item) {
|
|
|
10528
9221
|
const target = agents > 0 ? ` for ${agents} ${agents === 1 ? "agent" : "agents"}` : "";
|
|
10529
9222
|
const waitedMs = item.waitEndedAt ? durationBetween(item.occurredAt, item.waitEndedAt) : void 0;
|
|
10530
9223
|
if (waitedMs !== void 0) {
|
|
10531
|
-
return /* @__PURE__ */ jsxs15(
|
|
9224
|
+
return /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
10532
9225
|
"Waited",
|
|
10533
9226
|
target,
|
|
10534
9227
|
" \xB7",
|
|
@@ -10538,7 +9231,7 @@ function recordedWaitSummary(item) {
|
|
|
10538
9231
|
}
|
|
10539
9232
|
const started = new Date(item.occurredAt);
|
|
10540
9233
|
const sameDay = started.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
10541
|
-
return /* @__PURE__ */ jsxs15(
|
|
9234
|
+
return /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
10542
9235
|
item.waitEndedAt ? "Waited" : "Waiting",
|
|
10543
9236
|
target,
|
|
10544
9237
|
" \xB7 since",
|
|
@@ -10721,7 +9414,7 @@ function authReasonLine(reason) {
|
|
|
10721
9414
|
import { Loader2Icon } from "lucide-react";
|
|
10722
9415
|
import { lazy as lazy4, Suspense as Suspense5 } from "react";
|
|
10723
9416
|
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10724
|
-
var loadQueueSurface = () => import("./queue-surface-implementation-
|
|
9417
|
+
var loadQueueSurface = () => import("./queue-surface-implementation-YPJFQ3O6.js");
|
|
10725
9418
|
var QueueSurface = createQueueSurface(loadQueueSurface);
|
|
10726
9419
|
function createQueueSurface(loadImplementation) {
|
|
10727
9420
|
const LazyQueueSurface = lazy4(async () => ({
|
|
@@ -10816,7 +9509,7 @@ import { LayoutGroup, motion as motion4 } from "motion/react";
|
|
|
10816
9509
|
import {
|
|
10817
9510
|
useImperativeHandle
|
|
10818
9511
|
} from "react";
|
|
10819
|
-
import { Fragment as
|
|
9512
|
+
import { Fragment as Fragment8, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10820
9513
|
function ChatComposer({
|
|
10821
9514
|
composer,
|
|
10822
9515
|
responsiveBasis,
|
|
@@ -10878,7 +9571,7 @@ function ChatComposer({
|
|
|
10878
9571
|
useImperativeHandle(focusRef, () => ({ focusInput: controller.focusInput }), [
|
|
10879
9572
|
controller.focusInput
|
|
10880
9573
|
]);
|
|
10881
|
-
return /* @__PURE__ */ jsx23(
|
|
9574
|
+
return /* @__PURE__ */ jsx23(Fragment8, { children: /* @__PURE__ */ jsxs17(Root, { controller, responsiveBasis, className, children: [
|
|
10882
9575
|
/* @__PURE__ */ jsxs17(Frame, { children: [
|
|
10883
9576
|
/* @__PURE__ */ jsx23(CommandPalette, {}),
|
|
10884
9577
|
/* @__PURE__ */ jsxs17(Surface, { className: surfaceClassName, children: [
|
|
@@ -10993,7 +9686,7 @@ import {
|
|
|
10993
9686
|
} from "lucide-react";
|
|
10994
9687
|
import { AnimatePresence as AnimatePresence4, motion as motion5, useReducedMotion as useReducedMotion4 } from "motion/react";
|
|
10995
9688
|
import { useEffect as useEffect13, useId as useId4, useMemo as useMemo8, useRef as useRef11, useState as useState18 } from "react";
|
|
10996
|
-
import { Fragment as
|
|
9689
|
+
import { Fragment as Fragment9, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10997
9690
|
var GOAL_LABEL = {
|
|
10998
9691
|
pursuing: "Pursuing",
|
|
10999
9692
|
waiting: "Waiting",
|
|
@@ -11061,26 +9754,6 @@ function sessionChromeGoalPillExplanation(state, record) {
|
|
|
11061
9754
|
}
|
|
11062
9755
|
return null;
|
|
11063
9756
|
}
|
|
11064
|
-
function queuedTurnPresentation(turn) {
|
|
11065
|
-
const realtimeDelegation = objectValue(turn.metadata.realtimeDelegation);
|
|
11066
|
-
const inputTranscript = realtimeDelegation?.inputTranscript;
|
|
11067
|
-
if (typeof inputTranscript === "string" && inputTranscript.trim()) {
|
|
11068
|
-
return { kind: "realtime_voice", text: inputTranscript.trim() };
|
|
11069
|
-
}
|
|
11070
|
-
if (objectValue(turn.metadata.realtimeTailFlush)) {
|
|
11071
|
-
return { kind: "realtime_voice_handoff", text: "Remaining voice context" };
|
|
11072
|
-
}
|
|
11073
|
-
return { kind: "prompt", text: turn.prompt };
|
|
11074
|
-
}
|
|
11075
|
-
function isSteeringTurn(turn) {
|
|
11076
|
-
return turn.metadata.delivery === "steer";
|
|
11077
|
-
}
|
|
11078
|
-
function isAuthoritativeQueuedTurn(turn, mutationFor) {
|
|
11079
|
-
return !isSteeringTurn(turn) && mutationFor(turn.id) !== "steer";
|
|
11080
|
-
}
|
|
11081
|
-
function countAuthoritativeQueuedTurns(turns, mutationFor) {
|
|
11082
|
-
return turns.filter((turn) => isAuthoritativeQueuedTurn(turn, mutationFor)).length;
|
|
11083
|
-
}
|
|
11084
9757
|
function isOptimisticQueuedMessage(message, queuedTurnIds, snapshot2) {
|
|
11085
9758
|
return message.delivery === "send" && message.destination === "queue" && (!message.turnId || !queuedTurnIds.has(message.turnId)) && !(message.turnId && message.appliedQueueVersion !== null && message.appliedQueueVersion !== void 0 && snapshot2 && snapshot2.version >= message.appliedQueueVersion);
|
|
11086
9759
|
}
|
|
@@ -11096,9 +9769,6 @@ function sessionChromeInitialActive(input) {
|
|
|
11096
9769
|
function sessionChromeShouldOfferQueue(input) {
|
|
11097
9770
|
return !input.controlled && input.active === null && !input.activityOpen && input.authoritativeQueuedCount >= 1 && !input.suppressed;
|
|
11098
9771
|
}
|
|
11099
|
-
function objectValue(value) {
|
|
11100
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
11101
|
-
}
|
|
11102
9772
|
function sessionChromeGoalPillState(goalStatus, continuation, sessionStatus) {
|
|
11103
9773
|
if (goalStatus === "completed") return "completed";
|
|
11104
9774
|
if (goalStatus === "paused") return "paused";
|
|
@@ -11466,6 +10136,12 @@ function SessionChrome({
|
|
|
11466
10136
|
};
|
|
11467
10137
|
}, [active, signals]);
|
|
11468
10138
|
const open = active !== null;
|
|
10139
|
+
const latestOptimisticQueued = optimisticQueued[optimisticQueued.length - 1];
|
|
10140
|
+
const latestQueuedTurn = queuedTurns[queuedTurns.length - 1];
|
|
10141
|
+
const queuePeek = queue.error || queue.mutationError ? null : latestOptimisticQueued ? { text: latestOptimisticQueued.text.trim() || null, turnId: null } : latestQueuedTurn ? {
|
|
10142
|
+
text: queuedTurnPresentation(latestQueuedTurn).text.trim() || null,
|
|
10143
|
+
turnId: latestQueuedTurn.id
|
|
10144
|
+
} : null;
|
|
11469
10145
|
if (signals.length === 0 && !stopping) return null;
|
|
11470
10146
|
const shellDuration = reduceMotion ? 0 : 0.22;
|
|
11471
10147
|
const crossfadeDuration = reduceMotion ? 0 : 0.18;
|
|
@@ -11654,10 +10330,32 @@ function SessionChrome({
|
|
|
11654
10330
|
queueArrivalNonce
|
|
11655
10331
|
) : null,
|
|
11656
10332
|
/* @__PURE__ */ jsx24("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
11657
|
-
/* @__PURE__ */ jsxs18(
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
10333
|
+
/* @__PURE__ */ jsxs18(
|
|
10334
|
+
"span",
|
|
10335
|
+
{
|
|
10336
|
+
className: cn(
|
|
10337
|
+
"font-medium text-og-fg",
|
|
10338
|
+
signal.id === "queue" && queuePeek?.text && !selected ? "shrink-0" : "min-w-0 truncate"
|
|
10339
|
+
),
|
|
10340
|
+
children: [
|
|
10341
|
+
signal.id === "goal" ? "Goal \xB7 " : null,
|
|
10342
|
+
signal.id === "goal" ? goalState === "pursuing" ? "Running" : signal.label : signal.id === "queue" ? queue.error || queue.mutationError ? signal.label : `${queuedTurns.length + optimisticQueued.length} queued` : signal.label
|
|
10343
|
+
]
|
|
10344
|
+
}
|
|
10345
|
+
),
|
|
10346
|
+
signal.id === "queue" && queuePeek?.text && !selected ? /* @__PURE__ */ jsx24(AnimatePresence4, { initial: false, mode: "popLayout", children: /* @__PURE__ */ jsx24(
|
|
10347
|
+
motion5.span,
|
|
10348
|
+
{
|
|
10349
|
+
"data-testid": "session-chrome-queue-peek",
|
|
10350
|
+
className: "min-w-0 max-w-[min(24rem,60vw)] truncate text-og-fg-muted",
|
|
10351
|
+
initial: reduceMotion ? false : { opacity: 0, y: 3 },
|
|
10352
|
+
animate: { opacity: 1, y: 0 },
|
|
10353
|
+
exit: { opacity: 0, transition: { duration: crossfadeDuration } },
|
|
10354
|
+
transition: { duration: crossfadeDuration, ease },
|
|
10355
|
+
children: queuePeek.text
|
|
10356
|
+
},
|
|
10357
|
+
queuePeek.text
|
|
10358
|
+
) }) : null
|
|
11661
10359
|
]
|
|
11662
10360
|
}
|
|
11663
10361
|
),
|
|
@@ -11683,16 +10381,18 @@ function SessionChrome({
|
|
|
11683
10381
|
children: /* @__PURE__ */ jsx24(Trash2Icon2, { className: "size-3" })
|
|
11684
10382
|
}
|
|
11685
10383
|
)
|
|
11686
|
-
] }) : signal.id === "queue" && canMutateQueue &&
|
|
10384
|
+
] }) : signal.id === "queue" && canMutateQueue && queuePeek && !selected ? /* @__PURE__ */ jsx24("div", { className: "flex shrink-0 items-center pr-1 pl-0.5", children: /* @__PURE__ */ jsx24(
|
|
11687
10385
|
IconAction,
|
|
11688
10386
|
{
|
|
11689
|
-
label: "Steer
|
|
10387
|
+
label: "Steer latest queued message",
|
|
11690
10388
|
analyticsAction: "steer",
|
|
11691
10389
|
text: "Steer",
|
|
11692
10390
|
tip: QUEUE_STEER_TIP,
|
|
11693
|
-
disabled: queue.mutating || Boolean(queue.mutationFor(
|
|
11694
|
-
onClick: () =>
|
|
11695
|
-
|
|
10391
|
+
disabled: !queuePeek.turnId || queue.mutating || Boolean(queue.mutationFor(queuePeek.turnId)),
|
|
10392
|
+
onClick: () => {
|
|
10393
|
+
if (queuePeek.turnId) void queue.steerTurn(queuePeek.turnId);
|
|
10394
|
+
},
|
|
10395
|
+
children: queuePeek.turnId && queue.mutationFor(queuePeek.turnId) === "steer" ? /* @__PURE__ */ jsx24(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx24(CornerDownRightIcon, { className: "size-3" })
|
|
11696
10396
|
}
|
|
11697
10397
|
) }) : null
|
|
11698
10398
|
]
|
|
@@ -11724,7 +10424,7 @@ function SessionChrome({
|
|
|
11724
10424
|
children: [
|
|
11725
10425
|
/* @__PURE__ */ jsx24(ActivityIcon, { className: "size-3.5" }),
|
|
11726
10426
|
/* @__PURE__ */ jsx24("span", { className: "sr-only", children: "Activity" }),
|
|
11727
|
-
commandsCount > 0 ? /* @__PURE__ */ jsxs18(
|
|
10427
|
+
commandsCount > 0 ? /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
11728
10428
|
/* @__PURE__ */ jsx24(
|
|
11729
10429
|
"span",
|
|
11730
10430
|
{
|
|
@@ -11975,8 +10675,7 @@ function QueuePanel({
|
|
|
11975
10675
|
const voice = presentation.kind !== "prompt";
|
|
11976
10676
|
const pending = mutationFor(turn.id);
|
|
11977
10677
|
const settling = !interactiveTurnIds.has(turn.id);
|
|
11978
|
-
const beforeUp
|
|
11979
|
-
const beforeDown = index < turns.length - 1 ? turns[index + 2]?.id ?? null : null;
|
|
10678
|
+
const { beforeUp, beforeDown } = queueNeighborAnchors(turns, index);
|
|
11980
10679
|
const showActions = !readOnly && (onEdit || onSteer || onRemove || onMove);
|
|
11981
10680
|
const confirmingReplace = replaceDraftFor === turn.id;
|
|
11982
10681
|
return /* @__PURE__ */ jsxs18(
|
|
@@ -12001,29 +10700,52 @@ function QueuePanel({
|
|
|
12001
10700
|
annotations: turn.annotations ?? []
|
|
12002
10701
|
}
|
|
12003
10702
|
),
|
|
12004
|
-
showActions ? /* @__PURE__ */ jsxs18("div", { className: "flex shrink-0 items-center gap-0.5
|
|
12005
|
-
|
|
12006
|
-
/* @__PURE__ */
|
|
10703
|
+
showActions ? /* @__PURE__ */ jsxs18("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
10704
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 max-sm:opacity-100", children: [
|
|
10705
|
+
onMove && turns.length > 1 ? /* @__PURE__ */ jsxs18(Fragment9, { children: [
|
|
10706
|
+
/* @__PURE__ */ jsx24(
|
|
10707
|
+
IconAction,
|
|
10708
|
+
{
|
|
10709
|
+
label: `Move queued prompt ${index + 1} up`,
|
|
10710
|
+
tip: "Move up",
|
|
10711
|
+
disabled: settling || pending !== null || index === 0,
|
|
10712
|
+
onClick: () => onMove(turn.id, beforeUp),
|
|
10713
|
+
children: /* @__PURE__ */ jsx24(ArrowUpIcon2, { className: "size-3" })
|
|
10714
|
+
}
|
|
10715
|
+
),
|
|
10716
|
+
/* @__PURE__ */ jsx24(
|
|
10717
|
+
IconAction,
|
|
10718
|
+
{
|
|
10719
|
+
label: `Move queued prompt ${index + 1} down`,
|
|
10720
|
+
tip: "Move down",
|
|
10721
|
+
disabled: settling || pending !== null || index >= turns.length - 1,
|
|
10722
|
+
onClick: () => onMove(turn.id, beforeDown),
|
|
10723
|
+
children: /* @__PURE__ */ jsx24(ArrowDownIcon2, { className: "size-3" })
|
|
10724
|
+
}
|
|
10725
|
+
)
|
|
10726
|
+
] }) : null,
|
|
10727
|
+
onEdit ? /* @__PURE__ */ jsx24(
|
|
12007
10728
|
IconAction,
|
|
12008
10729
|
{
|
|
12009
|
-
label: `
|
|
12010
|
-
tip:
|
|
12011
|
-
disabled: settling || pending !== null
|
|
12012
|
-
onClick: () =>
|
|
12013
|
-
children: /* @__PURE__ */ jsx24(
|
|
10730
|
+
label: `Edit queued prompt ${index + 1}`,
|
|
10731
|
+
tip: QUEUE_EDIT_TIP,
|
|
10732
|
+
disabled: settling || pending !== null,
|
|
10733
|
+
onClick: () => onEdit(turn),
|
|
10734
|
+
children: pending === "edit" ? /* @__PURE__ */ jsx24(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx24(PencilIcon, { className: "size-3" })
|
|
12014
10735
|
}
|
|
12015
|
-
),
|
|
12016
|
-
/* @__PURE__ */ jsx24(
|
|
10736
|
+
) : null,
|
|
10737
|
+
onRemove ? /* @__PURE__ */ jsx24(
|
|
12017
10738
|
IconAction,
|
|
12018
10739
|
{
|
|
12019
|
-
label: `
|
|
12020
|
-
tip:
|
|
12021
|
-
disabled: settling || pending !== null
|
|
12022
|
-
onClick: () =>
|
|
12023
|
-
|
|
10740
|
+
label: `Remove queued prompt ${index + 1}`,
|
|
10741
|
+
tip: QUEUE_DELETE_TIP,
|
|
10742
|
+
disabled: settling || pending !== null,
|
|
10743
|
+
onClick: () => onRemove(turn.id),
|
|
10744
|
+
danger: true,
|
|
10745
|
+
children: pending === "delete" ? /* @__PURE__ */ jsx24(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx24(Trash2Icon2, { className: "size-3" })
|
|
12024
10746
|
}
|
|
12025
|
-
)
|
|
12026
|
-
] })
|
|
10747
|
+
) : null
|
|
10748
|
+
] }),
|
|
12027
10749
|
onSteer ? /* @__PURE__ */ jsx24(
|
|
12028
10750
|
IconAction,
|
|
12029
10751
|
{
|
|
@@ -12035,33 +10757,12 @@ function QueuePanel({
|
|
|
12035
10757
|
onClick: () => onSteer(turn.id),
|
|
12036
10758
|
children: pending === "steer" ? /* @__PURE__ */ jsx24(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx24(CornerDownRightIcon, { className: "size-3" })
|
|
12037
10759
|
}
|
|
12038
|
-
) : null,
|
|
12039
|
-
onEdit ? /* @__PURE__ */ jsx24(
|
|
12040
|
-
IconAction,
|
|
12041
|
-
{
|
|
12042
|
-
label: `Edit queued prompt ${index + 1}`,
|
|
12043
|
-
tip: QUEUE_EDIT_TIP,
|
|
12044
|
-
disabled: settling || pending !== null,
|
|
12045
|
-
onClick: () => onEdit(turn),
|
|
12046
|
-
children: pending === "edit" ? /* @__PURE__ */ jsx24(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx24(PencilIcon, { className: "size-3" })
|
|
12047
|
-
}
|
|
12048
|
-
) : null,
|
|
12049
|
-
onRemove ? /* @__PURE__ */ jsx24(
|
|
12050
|
-
IconAction,
|
|
12051
|
-
{
|
|
12052
|
-
label: `Remove queued prompt ${index + 1}`,
|
|
12053
|
-
tip: QUEUE_DELETE_TIP,
|
|
12054
|
-
disabled: settling || pending !== null,
|
|
12055
|
-
onClick: () => onRemove(turn.id),
|
|
12056
|
-
danger: true,
|
|
12057
|
-
children: pending === "delete" ? /* @__PURE__ */ jsx24(Loader2Icon2, { className: "size-3 animate-og-spin" }) : /* @__PURE__ */ jsx24(Trash2Icon2, { className: "size-3" })
|
|
12058
|
-
}
|
|
12059
10760
|
) : null
|
|
12060
10761
|
] }) : null
|
|
12061
10762
|
] }),
|
|
12062
10763
|
confirmingReplace ? /* @__PURE__ */ jsxs18("div", { className: "rounded-og-sm border border-og-status-waiting/30 bg-og-status-waiting/10 p-2 text-og-xs text-og-fg", children: [
|
|
12063
|
-
/* @__PURE__ */ jsx24("p", { children:
|
|
12064
|
-
/* @__PURE__ */ jsx24("p", { className: "mt-0.5 text-og-fg-muted", children:
|
|
10764
|
+
/* @__PURE__ */ jsx24("p", { children: QUEUE_REPLACE_DRAFT_COPY.title }),
|
|
10765
|
+
/* @__PURE__ */ jsx24("p", { className: "mt-0.5 text-og-fg-muted", children: QUEUE_REPLACE_DRAFT_COPY.detail }),
|
|
12065
10766
|
/* @__PURE__ */ jsxs18("div", { className: "mt-2 flex justify-end gap-1.5", children: [
|
|
12066
10767
|
/* @__PURE__ */ jsx24(
|
|
12067
10768
|
"button",
|
|
@@ -12069,7 +10770,7 @@ function QueuePanel({
|
|
|
12069
10770
|
type: "button",
|
|
12070
10771
|
className: "rounded-og-sm px-2 py-1 font-medium hover:bg-og-surface-3/70 focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
12071
10772
|
onClick: onCancelReplace,
|
|
12072
|
-
children:
|
|
10773
|
+
children: QUEUE_REPLACE_DRAFT_COPY.keep
|
|
12073
10774
|
}
|
|
12074
10775
|
),
|
|
12075
10776
|
/* @__PURE__ */ jsx24(
|
|
@@ -12078,7 +10779,7 @@ function QueuePanel({
|
|
|
12078
10779
|
type: "button",
|
|
12079
10780
|
className: "rounded-og-sm border border-og-primary-border bg-og-primary text-og-primary-fg px-2 py-1 font-medium hover:bg-og-primary-hover focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
12080
10781
|
onClick: onConfirmReplace,
|
|
12081
|
-
children:
|
|
10782
|
+
children: QUEUE_REPLACE_DRAFT_COPY.replace
|
|
12082
10783
|
}
|
|
12083
10784
|
)
|
|
12084
10785
|
] })
|
|
@@ -12325,6 +11026,33 @@ function IconAction({
|
|
|
12325
11026
|
] });
|
|
12326
11027
|
}
|
|
12327
11028
|
|
|
11029
|
+
// src/components/provider-recovery-notice.tsx
|
|
11030
|
+
import { Clock3Icon } from "lucide-react";
|
|
11031
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11032
|
+
var PROVIDER_RECOVERY_NOTICE_DETAIL = "Your message is saved. Opengeni keeps retrying automatically for a few minutes.";
|
|
11033
|
+
function ProviderRecoveryNotice({
|
|
11034
|
+
recovery,
|
|
11035
|
+
detail,
|
|
11036
|
+
className
|
|
11037
|
+
}) {
|
|
11038
|
+
if (!recovery) return null;
|
|
11039
|
+
const secondary = detail === void 0 ? PROVIDER_RECOVERY_NOTICE_DETAIL : detail;
|
|
11040
|
+
return /* @__PURE__ */ jsxs19(
|
|
11041
|
+
"div",
|
|
11042
|
+
{
|
|
11043
|
+
className: cn("flex items-start gap-2 text-og-sm text-og-fg-muted", className),
|
|
11044
|
+
"data-og-provider-recovery": "",
|
|
11045
|
+
children: [
|
|
11046
|
+
/* @__PURE__ */ jsx25(Clock3Icon, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }),
|
|
11047
|
+
/* @__PURE__ */ jsxs19("div", { className: "min-w-0", role: "status", "aria-live": "polite", children: [
|
|
11048
|
+
/* @__PURE__ */ jsx25("p", { className: "font-medium text-og-fg", children: providerRecoveryRetryingText(recovery) }),
|
|
11049
|
+
secondary ? /* @__PURE__ */ jsx25("p", { className: "mt-0.5 text-og-xs", children: secondary }) : null
|
|
11050
|
+
] })
|
|
11051
|
+
]
|
|
11052
|
+
}
|
|
11053
|
+
);
|
|
11054
|
+
}
|
|
11055
|
+
|
|
12328
11056
|
// src/components/session-conversation.tsx
|
|
12329
11057
|
import {
|
|
12330
11058
|
resolveWorkspaceVoiceInputEnabled,
|
|
@@ -12352,7 +11080,8 @@ var INITIAL_FLAGS = {
|
|
|
12352
11080
|
sessionCreation: true,
|
|
12353
11081
|
archive: true,
|
|
12354
11082
|
voiceInput: null,
|
|
12355
|
-
realtimeVoice: false
|
|
11083
|
+
realtimeVoice: false,
|
|
11084
|
+
realtimeVoiceOffered: false
|
|
12356
11085
|
};
|
|
12357
11086
|
var configReads = /* @__PURE__ */ new WeakMap();
|
|
12358
11087
|
function readClientConfig(client) {
|
|
@@ -12385,7 +11114,8 @@ function useClientConfigFlags(client) {
|
|
|
12385
11114
|
sessionCreation: config.sessionCreation !== false,
|
|
12386
11115
|
archive: config.archive !== false,
|
|
12387
11116
|
voiceInput: config.voiceInput?.available === true ? config.voiceInput : null,
|
|
12388
|
-
realtimeVoice: config.realtimeVoice !== false
|
|
11117
|
+
realtimeVoice: config.realtimeVoice !== false,
|
|
11118
|
+
realtimeVoiceOffered: config.realtimeVoice === true
|
|
12389
11119
|
});
|
|
12390
11120
|
}
|
|
12391
11121
|
},
|
|
@@ -12446,7 +11176,7 @@ import {
|
|
|
12446
11176
|
OpenGeniBrowserClient
|
|
12447
11177
|
} from "@opengeni/sdk/browser";
|
|
12448
11178
|
import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef12, useState as useState21 } from "react";
|
|
12449
|
-
import { jsx as
|
|
11179
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
12450
11180
|
function proxyLoadErrorMessage(error) {
|
|
12451
11181
|
if (error instanceof OpenGeniApiError2 && error.status === 401 && error.code === "unauthenticated") {
|
|
12452
11182
|
const message = "Chat is unavailable right now. Ask an administrator for help.";
|
|
@@ -12515,12 +11245,12 @@ function SessionProxyScope({
|
|
|
12515
11245
|
};
|
|
12516
11246
|
}, [client, workspaceId]);
|
|
12517
11247
|
if (state.status === "error") {
|
|
12518
|
-
return /* @__PURE__ */
|
|
11248
|
+
return /* @__PURE__ */ jsx26("div", { role: "alert", className: "og-root p-3 text-og-sm text-og-danger", "data-og-proxy-error": "", children: state.message });
|
|
12519
11249
|
}
|
|
12520
11250
|
if (state.status === "loading") {
|
|
12521
|
-
return /* @__PURE__ */
|
|
11251
|
+
return /* @__PURE__ */ jsx26("div", { className: "og-root", "aria-busy": "true", "data-og-proxy-loading": "" });
|
|
12522
11252
|
}
|
|
12523
|
-
return /* @__PURE__ */
|
|
11253
|
+
return /* @__PURE__ */ jsx26(OpenGeniProvider, { client, workspaceId: state.workspaceId, children });
|
|
12524
11254
|
}
|
|
12525
11255
|
|
|
12526
11256
|
// src/lib/host-theme.ts
|
|
@@ -12864,7 +11594,7 @@ function useHostTheme(ref, options) {
|
|
|
12864
11594
|
}
|
|
12865
11595
|
|
|
12866
11596
|
// src/components/session-conversation.tsx
|
|
12867
|
-
import { Fragment as
|
|
11597
|
+
import { Fragment as Fragment10, jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
12868
11598
|
var DEFAULT_CONVERSATION_LABELS = {
|
|
12869
11599
|
retry: "Retry",
|
|
12870
11600
|
tryAgain: "Try again",
|
|
@@ -12876,9 +11606,9 @@ function SessionConversation({
|
|
|
12876
11606
|
fetch,
|
|
12877
11607
|
...props
|
|
12878
11608
|
}) {
|
|
12879
|
-
if (baseUrl === void 0) return /* @__PURE__ */
|
|
11609
|
+
if (baseUrl === void 0) return /* @__PURE__ */ jsx27(RetryingConversation, { ...props });
|
|
12880
11610
|
const { client, workspaceId, ...rest } = props;
|
|
12881
|
-
return /* @__PURE__ */
|
|
11611
|
+
return /* @__PURE__ */ jsx27(
|
|
12882
11612
|
SessionProxyScope,
|
|
12883
11613
|
{
|
|
12884
11614
|
baseUrl,
|
|
@@ -12886,13 +11616,13 @@ function SessionConversation({
|
|
|
12886
11616
|
client,
|
|
12887
11617
|
headers,
|
|
12888
11618
|
fetch,
|
|
12889
|
-
children: /* @__PURE__ */
|
|
11619
|
+
children: /* @__PURE__ */ jsx27(RetryingConversation, { ...rest })
|
|
12890
11620
|
}
|
|
12891
11621
|
);
|
|
12892
11622
|
}
|
|
12893
11623
|
function RetryingConversation(props) {
|
|
12894
11624
|
const [attempt, setAttempt] = useState23(0);
|
|
12895
|
-
return /* @__PURE__ */
|
|
11625
|
+
return /* @__PURE__ */ jsx27(
|
|
12896
11626
|
Conversation,
|
|
12897
11627
|
{
|
|
12898
11628
|
...props,
|
|
@@ -12913,7 +11643,8 @@ function Conversation({
|
|
|
12913
11643
|
allowanceExhaustedLabels,
|
|
12914
11644
|
attachments: attachmentsRequested = true,
|
|
12915
11645
|
voiceInput: voiceInputRequested = true,
|
|
12916
|
-
realtimeVoice:
|
|
11646
|
+
realtimeVoice: realtimeVoiceProp,
|
|
11647
|
+
genieLoading,
|
|
12917
11648
|
modelPicker,
|
|
12918
11649
|
modelPickerProps,
|
|
12919
11650
|
userMessageDisclosureLabels,
|
|
@@ -13014,6 +11745,20 @@ function Conversation({
|
|
|
13014
11745
|
if (feed.error) void feed.jumpToLatest();
|
|
13015
11746
|
};
|
|
13016
11747
|
const running = status === "running" || status === "recovering" || status === "waiting_capacity";
|
|
11748
|
+
const realtimeVoiceRequested = realtimeVoiceProp ?? config.realtimeVoiceOffered;
|
|
11749
|
+
const loadingOptions = useMemo10(() => embeddedGenieLoading(genieLoading), [genieLoading]);
|
|
11750
|
+
const providerRecovery = useMemo10(
|
|
11751
|
+
() => detail.session ? currentProviderRecovery(
|
|
11752
|
+
{
|
|
11753
|
+
id: detail.session.id,
|
|
11754
|
+
status,
|
|
11755
|
+
activeTurnId: detail.session.activeTurnId,
|
|
11756
|
+
effectiveControl: queue.effectiveControl ?? detail.session.effectiveControl ?? void 0
|
|
11757
|
+
},
|
|
11758
|
+
feed.events
|
|
11759
|
+
) : null,
|
|
11760
|
+
[detail.session, status, queue.effectiveControl, feed.events]
|
|
11761
|
+
);
|
|
13017
11762
|
const voiceModels = useRealtimeVoiceModels(
|
|
13018
11763
|
context.client,
|
|
13019
11764
|
context.workspaceId,
|
|
@@ -13021,7 +11766,7 @@ function Conversation({
|
|
|
13021
11766
|
);
|
|
13022
11767
|
const [voiceActive, setVoiceActive] = useState23(false);
|
|
13023
11768
|
const voiceControl = composer.effectiveControl ?? queue.effectiveControl ?? detail.session?.effectiveControl;
|
|
13024
|
-
const voice = voiceModels.length > 0 && status && !terminal && voiceControl ? /* @__PURE__ */
|
|
11769
|
+
const voice = voiceModels.length > 0 && status && !terminal && voiceControl ? /* @__PURE__ */ jsx27(Suspense6, { fallback: null, children: /* @__PURE__ */ jsx27(
|
|
13025
11770
|
LazyEmbeddedRealtimeVoice,
|
|
13026
11771
|
{
|
|
13027
11772
|
client: context.client,
|
|
@@ -13035,7 +11780,7 @@ function Conversation({
|
|
|
13035
11780
|
onVoiceActiveChange: setVoiceActive
|
|
13036
11781
|
}
|
|
13037
11782
|
) }) : null;
|
|
13038
|
-
return /* @__PURE__ */
|
|
11783
|
+
return /* @__PURE__ */ jsxs20(
|
|
13039
11784
|
"div",
|
|
13040
11785
|
{
|
|
13041
11786
|
className: cn(
|
|
@@ -13048,15 +11793,15 @@ function Conversation({
|
|
|
13048
11793
|
"data-og-host-theme": "",
|
|
13049
11794
|
"data-og-conversation": "",
|
|
13050
11795
|
children: [
|
|
13051
|
-
error && !loadFailed ? /* @__PURE__ */
|
|
11796
|
+
error && !loadFailed ? /* @__PURE__ */ jsxs20(
|
|
13052
11797
|
"div",
|
|
13053
11798
|
{
|
|
13054
11799
|
role: "alert",
|
|
13055
11800
|
className: "mx-auto flex w-full max-w-3xl shrink-0 items-center gap-3 rounded-og-md border border-og-status-failed/30 bg-og-status-failed/10 px-3 py-2 text-og-sm text-og-fg",
|
|
13056
11801
|
"data-og-conversation-error": "",
|
|
13057
11802
|
children: [
|
|
13058
|
-
/* @__PURE__ */
|
|
13059
|
-
/* @__PURE__ */
|
|
11803
|
+
/* @__PURE__ */ jsx27("span", { className: "min-w-0 flex-1", children: formatError(error) }),
|
|
11804
|
+
/* @__PURE__ */ jsx27(
|
|
13060
11805
|
"button",
|
|
13061
11806
|
{
|
|
13062
11807
|
type: "button",
|
|
@@ -13068,15 +11813,15 @@ function Conversation({
|
|
|
13068
11813
|
]
|
|
13069
11814
|
}
|
|
13070
11815
|
) : null,
|
|
13071
|
-
loadFailed ? /* @__PURE__ */
|
|
11816
|
+
loadFailed ? /* @__PURE__ */ jsxs20(
|
|
13072
11817
|
"div",
|
|
13073
11818
|
{
|
|
13074
11819
|
role: "alert",
|
|
13075
11820
|
className: "flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center",
|
|
13076
11821
|
"data-og-conversation-error": "",
|
|
13077
11822
|
children: [
|
|
13078
|
-
/* @__PURE__ */
|
|
13079
|
-
/* @__PURE__ */
|
|
11823
|
+
/* @__PURE__ */ jsx27("p", { className: "max-w-sm text-og-base text-og-fg-muted", children: formatError(feed.error) }),
|
|
11824
|
+
/* @__PURE__ */ jsx27(
|
|
13080
11825
|
"button",
|
|
13081
11826
|
{
|
|
13082
11827
|
type: "button",
|
|
@@ -13087,13 +11832,14 @@ function Conversation({
|
|
|
13087
11832
|
)
|
|
13088
11833
|
]
|
|
13089
11834
|
}
|
|
13090
|
-
) : /* @__PURE__ */
|
|
11835
|
+
) : /* @__PURE__ */ jsx27(
|
|
13091
11836
|
MessageTimeline,
|
|
13092
11837
|
{
|
|
13093
11838
|
renderMessageText,
|
|
13094
11839
|
resolveLink: links,
|
|
13095
11840
|
renderInteractiveBlock: renderInteractiveBlock === false ? void 0 : renderInteractiveBlock ?? defaultInteractiveBlock,
|
|
13096
11841
|
userMessageDisclosureLabels,
|
|
11842
|
+
genieLoading: loadingOptions,
|
|
13097
11843
|
renderAllowanceExhausted,
|
|
13098
11844
|
allowanceExhaustedLabels,
|
|
13099
11845
|
className: "isolate min-h-0 flex-1 overflow-hidden",
|
|
@@ -13119,14 +11865,14 @@ function Conversation({
|
|
|
13119
11865
|
questionNavMinViewportHeight: 320
|
|
13120
11866
|
}
|
|
13121
11867
|
),
|
|
13122
|
-
importedArchive ? /* @__PURE__ */
|
|
13123
|
-
/* @__PURE__ */
|
|
11868
|
+
importedArchive ? /* @__PURE__ */ jsx27("p", { className: "shrink-0 px-4 py-2 text-center text-sm text-og-muted", role: "status", children: "Archived conversation \xB7 Read only" }) : /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
11869
|
+
/* @__PURE__ */ jsxs20(
|
|
13124
11870
|
"div",
|
|
13125
11871
|
{
|
|
13126
11872
|
className: "relative z-20 min-h-0 max-h-[40%] shrink-0 overflow-y-auto empty:hidden",
|
|
13127
11873
|
"data-og-conversation-inputs": "",
|
|
13128
11874
|
children: [
|
|
13129
|
-
approvals.length > 0 && !terminal ? /* @__PURE__ */
|
|
11875
|
+
approvals.length > 0 && !terminal ? /* @__PURE__ */ jsx27(
|
|
13130
11876
|
ApprovalSurface,
|
|
13131
11877
|
{
|
|
13132
11878
|
className: "mx-auto max-w-3xl",
|
|
@@ -13141,7 +11887,14 @@ function Conversation({
|
|
|
13141
11887
|
error: control.error
|
|
13142
11888
|
}
|
|
13143
11889
|
) : null,
|
|
13144
|
-
/* @__PURE__ */
|
|
11890
|
+
/* @__PURE__ */ jsx27(
|
|
11891
|
+
ProviderRecoveryNotice,
|
|
11892
|
+
{
|
|
11893
|
+
className: "mx-auto max-w-3xl px-1",
|
|
11894
|
+
recovery: providerRecovery
|
|
11895
|
+
}
|
|
11896
|
+
),
|
|
11897
|
+
/* @__PURE__ */ jsx27(
|
|
13145
11898
|
HumanInputSurface,
|
|
13146
11899
|
{
|
|
13147
11900
|
className: "mx-auto max-w-3xl",
|
|
@@ -13156,7 +11909,7 @@ function Conversation({
|
|
|
13156
11909
|
decisionButtons: true
|
|
13157
11910
|
}
|
|
13158
11911
|
),
|
|
13159
|
-
/* @__PURE__ */
|
|
11912
|
+
/* @__PURE__ */ jsx27(
|
|
13160
11913
|
ConversationChrome,
|
|
13161
11914
|
{
|
|
13162
11915
|
sessionId,
|
|
@@ -13175,19 +11928,19 @@ function Conversation({
|
|
|
13175
11928
|
]
|
|
13176
11929
|
}
|
|
13177
11930
|
),
|
|
13178
|
-
/* @__PURE__ */
|
|
11931
|
+
/* @__PURE__ */ jsx27(
|
|
13179
11932
|
"div",
|
|
13180
11933
|
{
|
|
13181
11934
|
className: "relative z-20 mx-auto w-full max-w-3xl shrink-0",
|
|
13182
11935
|
"data-og-conversation-composer": "",
|
|
13183
|
-
children: /* @__PURE__ */
|
|
11936
|
+
children: /* @__PURE__ */ jsx27(
|
|
13184
11937
|
ChatComposer,
|
|
13185
11938
|
{
|
|
13186
11939
|
runControl: "stop",
|
|
13187
11940
|
running,
|
|
13188
11941
|
...composerProps,
|
|
13189
11942
|
...transcription && composerProps?.transcription === void 0 ? { transcription } : {},
|
|
13190
|
-
actionsStart: voice ? /* @__PURE__ */
|
|
11943
|
+
actionsStart: voice ? /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
13191
11944
|
composerProps?.actionsStart,
|
|
13192
11945
|
voice
|
|
13193
11946
|
] }) : composerProps?.actionsStart,
|
|
@@ -13195,7 +11948,7 @@ function Conversation({
|
|
|
13195
11948
|
composer,
|
|
13196
11949
|
attachments: uploadsEnabled ? files : void 0,
|
|
13197
11950
|
disabled: terminal || composerProps?.disabled,
|
|
13198
|
-
controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */
|
|
11951
|
+
controlsStart: composerProps?.controlsStart ?? (showModelPicker && composer.policy && /* @__PURE__ */ jsx27(
|
|
13199
11952
|
ModelPolicyPicker,
|
|
13200
11953
|
{
|
|
13201
11954
|
groupPresentation: modelPickerProps?.groupPresentation,
|
|
@@ -13228,10 +11981,19 @@ function Conversation({
|
|
|
13228
11981
|
}
|
|
13229
11982
|
);
|
|
13230
11983
|
}
|
|
11984
|
+
function embeddedGenieLoading(options) {
|
|
11985
|
+
if (!options) return EMBEDDED_GENIE_LOADING;
|
|
11986
|
+
return {
|
|
11987
|
+
...EMBEDDED_GENIE_LOADING,
|
|
11988
|
+
...options,
|
|
11989
|
+
phrases: options.phrases?.length ? options.phrases : EMBEDDED_GENIE_LOADING.phrases,
|
|
11990
|
+
messages: { ...EMBEDDED_GENIE_LOADING.messages, ...options.messages }
|
|
11991
|
+
};
|
|
11992
|
+
}
|
|
13231
11993
|
function ConversationChrome(props) {
|
|
13232
11994
|
const goals = props.client;
|
|
13233
11995
|
const canReachGoals = typeof goals.getGoal === "function" && typeof goals.updateGoal === "function" && typeof goals.deleteGoal === "function";
|
|
13234
|
-
return canReachGoals ? /* @__PURE__ */
|
|
11996
|
+
return canReachGoals ? /* @__PURE__ */ jsx27(GoalChrome, { ...props }) : /* @__PURE__ */ jsx27(SessionChrome, { ...props.chrome });
|
|
13235
11997
|
}
|
|
13236
11998
|
function GoalChrome({ sessionId, client, workspaceId, events, chrome }) {
|
|
13237
11999
|
const goal = useGoal(sessionId, {
|
|
@@ -13239,9 +12001,9 @@ function GoalChrome({ sessionId, client, workspaceId, events, chrome }) {
|
|
|
13239
12001
|
workspaceId,
|
|
13240
12002
|
events
|
|
13241
12003
|
});
|
|
13242
|
-
return /* @__PURE__ */
|
|
12004
|
+
return /* @__PURE__ */ jsx27(SessionChrome, { ...chrome, goal });
|
|
13243
12005
|
}
|
|
13244
|
-
var LazyEmbeddedRealtimeVoice = lazy5(() => import("./embedded-voice-
|
|
12006
|
+
var LazyEmbeddedRealtimeVoice = lazy5(() => import("./embedded-voice-K7SOZVVZ.js"));
|
|
13245
12007
|
var LazyChatInteractiveBlock = lazy5(
|
|
13246
12008
|
() => import("./chat-interactive-block-ZFHOKTMS.js").then((module) => ({
|
|
13247
12009
|
default: module.ChatInteractiveBlock
|
|
@@ -13269,7 +12031,7 @@ function useDefaultInteractiveBlock(client, workspaceId, sessionId, sitesAvailab
|
|
|
13269
12031
|
(block) => block.kind === "site" && !sitesAvailable ? (
|
|
13270
12032
|
// The proxy does not serve Sites: say so instead of offering a load
|
|
13271
12033
|
// that can only fail.
|
|
13272
|
-
/* @__PURE__ */
|
|
12034
|
+
/* @__PURE__ */ jsx27(
|
|
13273
12035
|
"div",
|
|
13274
12036
|
{
|
|
13275
12037
|
className: "rounded-og-md border border-og-border bg-og-surface-1 px-3 py-2 text-og-sm text-og-fg-muted",
|
|
@@ -13277,7 +12039,7 @@ function useDefaultInteractiveBlock(client, workspaceId, sessionId, sitesAvailab
|
|
|
13277
12039
|
children: sitePreviewUnavailable
|
|
13278
12040
|
}
|
|
13279
12041
|
)
|
|
13280
|
-
) : /* @__PURE__ */
|
|
12042
|
+
) : /* @__PURE__ */ jsx27(Suspense6, { fallback: /* @__PURE__ */ jsx27("span", { role: "status", children: "Loading preview\u2026" }), children: /* @__PURE__ */ jsx27(LazyChatInteractiveBlock, { workspaceId, client: scoped, ...block }) }),
|
|
13281
12043
|
[scoped, workspaceId, sitesAvailable, sitePreviewUnavailable]
|
|
13282
12044
|
);
|
|
13283
12045
|
}
|
|
@@ -13288,10 +12050,10 @@ function useRetainedLoaders(client, workspaceId, sessionId) {
|
|
|
13288
12050
|
const get = () => scoped ??= sessionScoped(base, sessionId);
|
|
13289
12051
|
return {
|
|
13290
12052
|
...typeof base.downloadRetainedArtifact === "function" && typeof base.createRetainedArtifactDownloadUrl === "function" ? {
|
|
13291
|
-
loadRetainedArtifact: (artifact, signal) => createWorkspaceRetainedArtifactLoader(
|
|
12053
|
+
loadRetainedArtifact: (artifact, signal, options) => createWorkspaceRetainedArtifactLoader(
|
|
13292
12054
|
get(),
|
|
13293
12055
|
workspaceId
|
|
13294
|
-
)(artifact, signal)
|
|
12056
|
+
)(artifact, signal, options)
|
|
13295
12057
|
} : {},
|
|
13296
12058
|
...typeof base.downloadRetainedScreenshot === "function" ? {
|
|
13297
12059
|
loadRetainedScreenshot: (artifact, signal) => createSessionRetainedScreenshotLoader(
|
|
@@ -13471,7 +12233,7 @@ function useWorkspaceSessions(options = {}) {
|
|
|
13471
12233
|
import { deriveSessionDisplayTitle } from "@opengeni/sdk";
|
|
13472
12234
|
import { ArchiveIcon, PencilIcon as PencilIcon2, PlusIcon } from "lucide-react";
|
|
13473
12235
|
import { useEffect as useEffect20, useRef as useRef15, useState as useState24 } from "react";
|
|
13474
|
-
import { jsx as
|
|
12236
|
+
import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
13475
12237
|
var DEFAULT_LABELS = {
|
|
13476
12238
|
heading: "Chats",
|
|
13477
12239
|
newChat: "New chat",
|
|
@@ -13553,16 +12315,16 @@ function SessionList({
|
|
|
13553
12315
|
onArchived?.(session.id);
|
|
13554
12316
|
});
|
|
13555
12317
|
const sessions = list.sessions;
|
|
13556
|
-
return /* @__PURE__ */
|
|
12318
|
+
return /* @__PURE__ */ jsxs21(
|
|
13557
12319
|
"nav",
|
|
13558
12320
|
{
|
|
13559
12321
|
className: cn("flex min-h-0 min-w-0 flex-col gap-1 text-og-fg", className),
|
|
13560
12322
|
"aria-label": labels.heading,
|
|
13561
12323
|
"data-og-session-list": "",
|
|
13562
12324
|
children: [
|
|
13563
|
-
/* @__PURE__ */
|
|
13564
|
-
/* @__PURE__ */
|
|
13565
|
-
onNewChat ? /* @__PURE__ */
|
|
12325
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between gap-2 px-2 pb-1 pt-2", children: [
|
|
12326
|
+
/* @__PURE__ */ jsx28("h2", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading }),
|
|
12327
|
+
onNewChat ? /* @__PURE__ */ jsxs21(
|
|
13566
12328
|
"button",
|
|
13567
12329
|
{
|
|
13568
12330
|
type: "button",
|
|
@@ -13570,22 +12332,22 @@ function SessionList({
|
|
|
13570
12332
|
className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-og-control text-og-fg hover:bg-og-surface-2",
|
|
13571
12333
|
"data-og-new-chat": "",
|
|
13572
12334
|
children: [
|
|
13573
|
-
/* @__PURE__ */
|
|
12335
|
+
/* @__PURE__ */ jsx28(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
13574
12336
|
labels.newChat
|
|
13575
12337
|
]
|
|
13576
12338
|
}
|
|
13577
12339
|
) : null
|
|
13578
12340
|
] }),
|
|
13579
|
-
error || list.error ? /* @__PURE__ */
|
|
13580
|
-
/* @__PURE__ */
|
|
13581
|
-
list.loading && sessions.length === 0 ? /* @__PURE__ */
|
|
13582
|
-
!list.loading && !list.error && sessions.length === 0 ? /* @__PURE__ */
|
|
12341
|
+
error || list.error ? /* @__PURE__ */ jsx28("p", { role: "alert", className: "px-2 text-og-xs text-og-status-failed", children: formatError(error ? error.cause : list.error) }) : null,
|
|
12342
|
+
/* @__PURE__ */ jsxs21("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-1 pb-2", children: [
|
|
12343
|
+
list.loading && sessions.length === 0 ? /* @__PURE__ */ jsx28("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.loading }) : null,
|
|
12344
|
+
!list.loading && !list.error && sessions.length === 0 ? /* @__PURE__ */ jsx28("li", { className: "px-2 py-2 text-og-xs text-og-fg-subtle", children: labels.empty }) : null,
|
|
13583
12345
|
sessions.map((session) => {
|
|
13584
12346
|
const selected = session.id === selectedSessionId;
|
|
13585
12347
|
const title = deriveSessionDisplayTitle(session);
|
|
13586
12348
|
if (editing?.id === session.id) {
|
|
13587
|
-
return /* @__PURE__ */
|
|
13588
|
-
/* @__PURE__ */
|
|
12349
|
+
return /* @__PURE__ */ jsx28("li", { children: /* @__PURE__ */ jsxs21("form", { onSubmit: saveTitle, className: "flex items-center gap-1 px-1 py-1", children: [
|
|
12350
|
+
/* @__PURE__ */ jsx28(
|
|
13589
12351
|
"input",
|
|
13590
12352
|
{
|
|
13591
12353
|
"aria-label": labels.rename,
|
|
@@ -13599,7 +12361,7 @@ function SessionList({
|
|
|
13599
12361
|
className: "min-w-0 flex-1 rounded-md border border-og-border bg-og-bg px-2 py-1 text-og-sm text-og-fg"
|
|
13600
12362
|
}
|
|
13601
12363
|
),
|
|
13602
|
-
/* @__PURE__ */
|
|
12364
|
+
/* @__PURE__ */ jsx28(
|
|
13603
12365
|
"button",
|
|
13604
12366
|
{
|
|
13605
12367
|
type: "submit",
|
|
@@ -13609,8 +12371,8 @@ function SessionList({
|
|
|
13609
12371
|
)
|
|
13610
12372
|
] }) }, session.id);
|
|
13611
12373
|
}
|
|
13612
|
-
return /* @__PURE__ */
|
|
13613
|
-
/* @__PURE__ */
|
|
12374
|
+
return /* @__PURE__ */ jsxs21("li", { className: "group relative", children: [
|
|
12375
|
+
/* @__PURE__ */ jsxs21(
|
|
13614
12376
|
"button",
|
|
13615
12377
|
{
|
|
13616
12378
|
type: "button",
|
|
@@ -13623,36 +12385,36 @@ function SessionList({
|
|
|
13623
12385
|
),
|
|
13624
12386
|
"data-og-session-row": "",
|
|
13625
12387
|
children: [
|
|
13626
|
-
/* @__PURE__ */
|
|
13627
|
-
/* @__PURE__ */
|
|
12388
|
+
/* @__PURE__ */ jsx28("span", { className: "w-full truncate pr-12 text-og-sm text-og-fg", children: title }),
|
|
12389
|
+
/* @__PURE__ */ jsx28("span", { className: "text-og-xs text-og-fg-subtle", children: formatRelativeTime(session.updatedAt) })
|
|
13628
12390
|
]
|
|
13629
12391
|
}
|
|
13630
12392
|
),
|
|
13631
|
-
/* @__PURE__ */
|
|
13632
|
-
rename ? /* @__PURE__ */
|
|
12393
|
+
/* @__PURE__ */ jsxs21("span", { className: "absolute right-1 top-1.5 hidden gap-0.5 group-focus-within:flex group-hover:flex pointer-coarse:flex", children: [
|
|
12394
|
+
rename ? /* @__PURE__ */ jsx28(
|
|
13633
12395
|
"button",
|
|
13634
12396
|
{
|
|
13635
12397
|
type: "button",
|
|
13636
12398
|
"aria-label": `${labels.rename}: ${title}`,
|
|
13637
12399
|
onClick: () => setEditing({ id: session.id, title: session.title ?? title }),
|
|
13638
12400
|
className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
|
|
13639
|
-
children: /* @__PURE__ */
|
|
12401
|
+
children: /* @__PURE__ */ jsx28(PencilIcon2, { className: "size-3.5", "aria-hidden": true })
|
|
13640
12402
|
}
|
|
13641
12403
|
) : null,
|
|
13642
|
-
canArchive ? /* @__PURE__ */
|
|
12404
|
+
canArchive ? /* @__PURE__ */ jsx28(
|
|
13643
12405
|
"button",
|
|
13644
12406
|
{
|
|
13645
12407
|
type: "button",
|
|
13646
12408
|
"aria-label": `${labels.archive}: ${title}`,
|
|
13647
12409
|
onClick: () => archiveSession(session),
|
|
13648
12410
|
className: "rounded p-1 text-og-fg-subtle hover:bg-og-surface-3 hover:text-og-fg",
|
|
13649
|
-
children: /* @__PURE__ */
|
|
12411
|
+
children: /* @__PURE__ */ jsx28(ArchiveIcon, { className: "size-3.5", "aria-hidden": true })
|
|
13650
12412
|
}
|
|
13651
12413
|
) : null
|
|
13652
12414
|
] })
|
|
13653
12415
|
] }, session.id);
|
|
13654
12416
|
}),
|
|
13655
|
-
list.nextCursor ? /* @__PURE__ */
|
|
12417
|
+
list.nextCursor ? /* @__PURE__ */ jsx28("li", { children: /* @__PURE__ */ jsx28(
|
|
13656
12418
|
"button",
|
|
13657
12419
|
{
|
|
13658
12420
|
type: "button",
|
|
@@ -13673,7 +12435,7 @@ import {
|
|
|
13673
12435
|
} from "@opengeni/sdk";
|
|
13674
12436
|
import { MenuIcon, XIcon as XIcon2 } from "lucide-react";
|
|
13675
12437
|
import { useCallback as useCallback8, useRef as useRef16, useState as useState25 } from "react";
|
|
13676
|
-
import { jsx as
|
|
12438
|
+
import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
13677
12439
|
var DEFAULT_LABELS2 = {
|
|
13678
12440
|
openChats: "Open chats",
|
|
13679
12441
|
closeChats: "Close chats",
|
|
@@ -13683,9 +12445,9 @@ var DEFAULT_LABELS2 = {
|
|
|
13683
12445
|
newChatUnavailable: "New chats are not enabled for this product."
|
|
13684
12446
|
};
|
|
13685
12447
|
function OpenGeniChat({ baseUrl, headers, fetch, ...props }) {
|
|
13686
|
-
if (baseUrl === void 0) return /* @__PURE__ */
|
|
12448
|
+
if (baseUrl === void 0) return /* @__PURE__ */ jsx29(Chat, { ...props });
|
|
13687
12449
|
const { client, workspaceId, ...rest } = props;
|
|
13688
|
-
return /* @__PURE__ */
|
|
12450
|
+
return /* @__PURE__ */ jsx29(
|
|
13689
12451
|
SessionProxyScope,
|
|
13690
12452
|
{
|
|
13691
12453
|
baseUrl,
|
|
@@ -13693,7 +12455,7 @@ function OpenGeniChat({ baseUrl, headers, fetch, ...props }) {
|
|
|
13693
12455
|
client,
|
|
13694
12456
|
headers,
|
|
13695
12457
|
fetch,
|
|
13696
|
-
children: /* @__PURE__ */
|
|
12458
|
+
children: /* @__PURE__ */ jsx29(Chat, { ...rest })
|
|
13697
12459
|
}
|
|
13698
12460
|
);
|
|
13699
12461
|
}
|
|
@@ -13753,7 +12515,7 @@ function Chat({
|
|
|
13753
12515
|
},
|
|
13754
12516
|
[context.client, context.workspaceId, createSession, labels.newChatUnavailable]
|
|
13755
12517
|
);
|
|
13756
|
-
const list = /* @__PURE__ */
|
|
12518
|
+
const list = /* @__PURE__ */ jsx29(
|
|
13757
12519
|
SessionList,
|
|
13758
12520
|
{
|
|
13759
12521
|
...scope,
|
|
@@ -13769,7 +12531,7 @@ function Chat({
|
|
|
13769
12531
|
className: "h-full"
|
|
13770
12532
|
}
|
|
13771
12533
|
);
|
|
13772
|
-
return /* @__PURE__ */
|
|
12534
|
+
return /* @__PURE__ */ jsxs22(
|
|
13773
12535
|
"div",
|
|
13774
12536
|
{
|
|
13775
12537
|
ref: root,
|
|
@@ -13782,7 +12544,7 @@ function Chat({
|
|
|
13782
12544
|
"data-og-host-theme": "",
|
|
13783
12545
|
"data-og-chat": "",
|
|
13784
12546
|
children: [
|
|
13785
|
-
/* @__PURE__ */
|
|
12547
|
+
/* @__PURE__ */ jsx29(
|
|
13786
12548
|
"aside",
|
|
13787
12549
|
{
|
|
13788
12550
|
className: "og-chat-sidebar min-h-0 w-64 shrink-0 flex-col border-r border-og-border",
|
|
@@ -13790,21 +12552,21 @@ function Chat({
|
|
|
13790
12552
|
children: list
|
|
13791
12553
|
}
|
|
13792
12554
|
),
|
|
13793
|
-
drawerOpen ? /* @__PURE__ */
|
|
13794
|
-
/* @__PURE__ */
|
|
13795
|
-
/* @__PURE__ */
|
|
12555
|
+
drawerOpen ? /* @__PURE__ */ jsxs22("div", { className: "og-chat-drawer absolute inset-0 z-30 flex", "data-og-chat-drawer": "", children: [
|
|
12556
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex h-full w-[min(20rem,85%)] flex-col border-r border-og-border bg-og-bg shadow-og-lg", children: [
|
|
12557
|
+
/* @__PURE__ */ jsx29("div", { className: "flex justify-end p-1", children: /* @__PURE__ */ jsx29(
|
|
13796
12558
|
"button",
|
|
13797
12559
|
{
|
|
13798
12560
|
type: "button",
|
|
13799
12561
|
"aria-label": labels.closeChats,
|
|
13800
12562
|
onClick: () => setDrawerOpen(false),
|
|
13801
12563
|
className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
|
|
13802
|
-
children: /* @__PURE__ */
|
|
12564
|
+
children: /* @__PURE__ */ jsx29(XIcon2, { className: "size-4", "aria-hidden": true })
|
|
13803
12565
|
}
|
|
13804
12566
|
) }),
|
|
13805
|
-
/* @__PURE__ */
|
|
12567
|
+
/* @__PURE__ */ jsx29("div", { className: "min-h-0 flex-1", children: list })
|
|
13806
12568
|
] }),
|
|
13807
|
-
/* @__PURE__ */
|
|
12569
|
+
/* @__PURE__ */ jsx29(
|
|
13808
12570
|
"button",
|
|
13809
12571
|
{
|
|
13810
12572
|
type: "button",
|
|
@@ -13814,9 +12576,9 @@ function Chat({
|
|
|
13814
12576
|
}
|
|
13815
12577
|
)
|
|
13816
12578
|
] }) : null,
|
|
13817
|
-
/* @__PURE__ */
|
|
13818
|
-
/* @__PURE__ */
|
|
13819
|
-
/* @__PURE__ */
|
|
12579
|
+
/* @__PURE__ */ jsxs22("main", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
12580
|
+
/* @__PURE__ */ jsxs22("div", { className: "og-chat-menu flex items-center gap-2 px-2 py-1", children: [
|
|
12581
|
+
/* @__PURE__ */ jsx29(
|
|
13820
12582
|
"button",
|
|
13821
12583
|
{
|
|
13822
12584
|
type: "button",
|
|
@@ -13825,12 +12587,12 @@ function Chat({
|
|
|
13825
12587
|
onClick: () => setDrawerOpen(true),
|
|
13826
12588
|
className: "rounded p-1.5 text-og-fg-muted hover:bg-og-surface-2",
|
|
13827
12589
|
"data-og-chat-menu": "",
|
|
13828
|
-
children: /* @__PURE__ */
|
|
12590
|
+
children: /* @__PURE__ */ jsx29(MenuIcon, { className: "size-4", "aria-hidden": true })
|
|
13829
12591
|
}
|
|
13830
12592
|
),
|
|
13831
|
-
/* @__PURE__ */
|
|
12593
|
+
/* @__PURE__ */ jsx29("span", { className: "text-og-sm font-semibold text-og-fg-muted", children: labels.heading })
|
|
13832
12594
|
] }),
|
|
13833
|
-
/* @__PURE__ */
|
|
12595
|
+
/* @__PURE__ */ jsx29("div", { className: "og-chat-main min-h-0 flex-1 px-3 pb-3 pt-1", children: selected ? /* @__PURE__ */ jsx29(
|
|
13834
12596
|
SessionConversation,
|
|
13835
12597
|
{
|
|
13836
12598
|
...conversationProps,
|
|
@@ -13839,7 +12601,7 @@ function Chat({
|
|
|
13839
12601
|
sessionId: selected,
|
|
13840
12602
|
height: "100%"
|
|
13841
12603
|
}
|
|
13842
|
-
) : /* @__PURE__ */
|
|
12604
|
+
) : /* @__PURE__ */ jsx29(
|
|
13843
12605
|
NewChat,
|
|
13844
12606
|
{
|
|
13845
12607
|
scope,
|
|
@@ -13962,7 +12724,7 @@ function NewChat({
|
|
|
13962
12724
|
error: null,
|
|
13963
12725
|
clearError: () => setError(null)
|
|
13964
12726
|
};
|
|
13965
|
-
return /* @__PURE__ */
|
|
12727
|
+
return /* @__PURE__ */ jsxs22(
|
|
13966
12728
|
"form",
|
|
13967
12729
|
{
|
|
13968
12730
|
onSubmit: (event) => {
|
|
@@ -13972,9 +12734,9 @@ function NewChat({
|
|
|
13972
12734
|
className: "mx-auto box-border flex h-full w-full max-w-3xl flex-col gap-4 p-3",
|
|
13973
12735
|
"data-og-new-chat-composer": "",
|
|
13974
12736
|
children: [
|
|
13975
|
-
/* @__PURE__ */
|
|
13976
|
-
labels.newChatTitle ? /* @__PURE__ */
|
|
13977
|
-
/* @__PURE__ */
|
|
12737
|
+
/* @__PURE__ */ jsx29("div", { "aria-hidden": true, className: "min-h-0 flex-[2]" }),
|
|
12738
|
+
labels.newChatTitle ? /* @__PURE__ */ jsx29("p", { className: "text-center text-og-md font-medium text-og-fg", children: labels.newChatTitle }) : null,
|
|
12739
|
+
/* @__PURE__ */ jsx29(
|
|
13978
12740
|
ChatComposer,
|
|
13979
12741
|
{
|
|
13980
12742
|
...composerProps,
|
|
@@ -13990,7 +12752,7 @@ function NewChat({
|
|
|
13990
12752
|
...composerProps?.inputProps
|
|
13991
12753
|
},
|
|
13992
12754
|
messages: { sendMessageAriaLabel: labels.send, ...composerProps?.messages },
|
|
13993
|
-
controlsStart: composerProps?.controlsStart ?? (policy ? /* @__PURE__ */
|
|
12755
|
+
controlsStart: composerProps?.controlsStart ?? (policy ? /* @__PURE__ */ jsx29(
|
|
13994
12756
|
ModelPolicyPicker,
|
|
13995
12757
|
{
|
|
13996
12758
|
groupPresentation: modelPickerProps?.groupPresentation,
|
|
@@ -14014,11 +12776,11 @@ function NewChat({
|
|
|
14014
12776
|
responsiveBasis: composerProps?.responsiveBasis ?? "container"
|
|
14015
12777
|
}
|
|
14016
12778
|
),
|
|
14017
|
-
!available ? /* @__PURE__ */
|
|
12779
|
+
!available ? /* @__PURE__ */ jsx29("p", { className: "text-center text-og-sm text-og-fg-muted", "data-og-new-chat-unavailable": "", children: labels.newChatUnavailable }) : error ? /* @__PURE__ */ jsx29("p", { role: "alert", className: "text-center text-og-sm text-og-status-failed", children: formatError(
|
|
14018
12780
|
error.cause,
|
|
14019
12781
|
error.cause instanceof Error && error.cause.message === labels.newChatUnavailable ? labels.newChatUnavailable : void 0
|
|
14020
12782
|
) }) : null,
|
|
14021
|
-
/* @__PURE__ */
|
|
12783
|
+
/* @__PURE__ */ jsx29("div", { "aria-hidden": true, className: "min-h-0 flex-[3]" })
|
|
14022
12784
|
]
|
|
14023
12785
|
}
|
|
14024
12786
|
);
|
|
@@ -14027,7 +12789,7 @@ function NewChat({
|
|
|
14027
12789
|
// src/components/session-commands-panel.tsx
|
|
14028
12790
|
import { ChevronRightIcon as ChevronRightIcon5, Loader2Icon as Loader2Icon3, SquareIcon } from "lucide-react";
|
|
14029
12791
|
import { useState as useState26 } from "react";
|
|
14030
|
-
import { jsx as
|
|
12792
|
+
import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
14031
12793
|
function SessionCommandsPanel({
|
|
14032
12794
|
commands: state,
|
|
14033
12795
|
readOnly = false
|
|
@@ -14049,11 +12811,11 @@ function SessionCommandsPanel({
|
|
|
14049
12811
|
setPending(null);
|
|
14050
12812
|
}
|
|
14051
12813
|
};
|
|
14052
|
-
return /* @__PURE__ */
|
|
14053
|
-
state.loading && active.length === 0 ? /* @__PURE__ */
|
|
14054
|
-
state.error ? /* @__PURE__ */
|
|
14055
|
-
/* @__PURE__ */
|
|
14056
|
-
/* @__PURE__ */
|
|
12814
|
+
return /* @__PURE__ */ jsxs23("div", { className: "space-y-2 text-og-xs", "data-og-session-commands": "", children: [
|
|
12815
|
+
state.loading && active.length === 0 ? /* @__PURE__ */ jsx30("p", { role: "status", className: "text-og-fg-muted", children: "Loading commands\u2026" }) : null,
|
|
12816
|
+
state.error ? /* @__PURE__ */ jsxs23("div", { role: "alert", className: "flex items-center justify-between gap-2 text-og-danger", children: [
|
|
12817
|
+
/* @__PURE__ */ jsx30("span", { children: "Commands unavailable." }),
|
|
12818
|
+
/* @__PURE__ */ jsx30(
|
|
14057
12819
|
"button",
|
|
14058
12820
|
{
|
|
14059
12821
|
type: "button",
|
|
@@ -14063,18 +12825,18 @@ function SessionCommandsPanel({
|
|
|
14063
12825
|
}
|
|
14064
12826
|
)
|
|
14065
12827
|
] }) : null,
|
|
14066
|
-
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */
|
|
14067
|
-
active.length > 0 ? /* @__PURE__ */
|
|
14068
|
-
/* @__PURE__ */
|
|
14069
|
-
/* @__PURE__ */
|
|
14070
|
-
/* @__PURE__ */
|
|
12828
|
+
!state.loading && !state.error && active.length === 0 ? /* @__PURE__ */ jsx30("p", { role: "status", className: "text-og-fg-muted", children: "No background commands running." }) : null,
|
|
12829
|
+
active.length > 0 ? /* @__PURE__ */ jsx30("ul", { className: "max-h-64 overflow-y-auto overscroll-contain divide-y divide-og-border/40", children: active.map((command) => /* @__PURE__ */ jsxs23("li", { className: "flex items-start gap-3 py-2 first:pt-0 last:pb-0", children: [
|
|
12830
|
+
/* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1", children: [
|
|
12831
|
+
/* @__PURE__ */ jsxs23("details", { className: "group/command", children: [
|
|
12832
|
+
/* @__PURE__ */ jsxs23(
|
|
14071
12833
|
"summary",
|
|
14072
12834
|
{
|
|
14073
12835
|
className: "flex cursor-pointer list-none items-center gap-1.5 rounded-og-sm font-mono text-og-fg outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
14074
12836
|
title: "Expand command",
|
|
14075
12837
|
children: [
|
|
14076
|
-
/* @__PURE__ */
|
|
14077
|
-
/* @__PURE__ */
|
|
12838
|
+
/* @__PURE__ */ jsx30(ChevronRightIcon5, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
|
|
12839
|
+
/* @__PURE__ */ jsx30(
|
|
14078
12840
|
"span",
|
|
14079
12841
|
{
|
|
14080
12842
|
className: "min-w-0 truncate",
|
|
@@ -14085,9 +12847,9 @@ function SessionCommandsPanel({
|
|
|
14085
12847
|
]
|
|
14086
12848
|
}
|
|
14087
12849
|
),
|
|
14088
|
-
/* @__PURE__ */
|
|
14089
|
-
/* @__PURE__ */
|
|
14090
|
-
/* @__PURE__ */
|
|
12850
|
+
/* @__PURE__ */ jsxs23("div", { className: "mt-2 space-y-1", children: [
|
|
12851
|
+
/* @__PURE__ */ jsx30("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
|
|
12852
|
+
/* @__PURE__ */ jsxs23(
|
|
14091
12853
|
"time",
|
|
14092
12854
|
{
|
|
14093
12855
|
className: "block text-og-fg-subtle",
|
|
@@ -14101,9 +12863,9 @@ function SessionCommandsPanel({
|
|
|
14101
12863
|
)
|
|
14102
12864
|
] })
|
|
14103
12865
|
] }),
|
|
14104
|
-
/* @__PURE__ */
|
|
12866
|
+
/* @__PURE__ */ jsx30("p", { className: "mt-1 text-og-fg-subtle", children: command.observationStatus === "unavailable" ? command.state === "stopping" ? "Stop requested \xB7 status unavailable" : "Command status unavailable" : command.state === "stopping" ? "Stopping\u2026" : "Running" })
|
|
14105
12867
|
] }),
|
|
14106
|
-
!readOnly ? /* @__PURE__ */
|
|
12868
|
+
!readOnly ? /* @__PURE__ */ jsxs23(
|
|
14107
12869
|
"button",
|
|
14108
12870
|
{
|
|
14109
12871
|
type: "button",
|
|
@@ -14112,13 +12874,13 @@ function SessionCommandsPanel({
|
|
|
14112
12874
|
onClick: () => void stop(command.id),
|
|
14113
12875
|
className: "inline-flex min-h-7 shrink-0 items-center gap-1 rounded-og-sm px-2 text-og-fg-muted outline-hidden hover:bg-og-surface-3/70 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:opacity-50 pointer-coarse:min-h-11",
|
|
14114
12876
|
children: [
|
|
14115
|
-
pending === command.id || command.state === "stopping" ? /* @__PURE__ */
|
|
12877
|
+
pending === command.id || command.state === "stopping" ? /* @__PURE__ */ jsx30(Loader2Icon3, { className: "size-3 animate-og-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx30(SquareIcon, { className: "size-3" }),
|
|
14116
12878
|
"Stop"
|
|
14117
12879
|
]
|
|
14118
12880
|
}
|
|
14119
12881
|
) : null
|
|
14120
12882
|
] }, command.id)) }) : null,
|
|
14121
|
-
error ? /* @__PURE__ */
|
|
12883
|
+
error ? /* @__PURE__ */ jsx30("p", { role: "alert", className: "text-og-danger", children: error }) : null
|
|
14122
12884
|
] });
|
|
14123
12885
|
}
|
|
14124
12886
|
|
|
@@ -14171,7 +12933,7 @@ function useSessionBackgroundCommands(sessionId, options = {}) {
|
|
|
14171
12933
|
}
|
|
14172
12934
|
|
|
14173
12935
|
// src/components/session-commands.tsx
|
|
14174
|
-
import { jsx as
|
|
12936
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
14175
12937
|
function SessionCommands({
|
|
14176
12938
|
sessionId,
|
|
14177
12939
|
readOnly = false,
|
|
@@ -14181,11 +12943,11 @@ function SessionCommands({
|
|
|
14181
12943
|
pollIntervalMs: 3e3,
|
|
14182
12944
|
...options
|
|
14183
12945
|
});
|
|
14184
|
-
return /* @__PURE__ */
|
|
12946
|
+
return /* @__PURE__ */ jsx31(SessionCommandsPanel, { commands, readOnly });
|
|
14185
12947
|
}
|
|
14186
12948
|
|
|
14187
12949
|
// src/timeline/startup-timings.tsx
|
|
14188
|
-
import { jsx as
|
|
12950
|
+
import { jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
14189
12951
|
var LABELS = {
|
|
14190
12952
|
queue: "Worker queue",
|
|
14191
12953
|
sandbox: "Sandbox",
|
|
@@ -14198,7 +12960,7 @@ var LABELS = {
|
|
|
14198
12960
|
};
|
|
14199
12961
|
function StartupTimings({ phases }) {
|
|
14200
12962
|
if (!phases.length)
|
|
14201
|
-
return /* @__PURE__ */
|
|
12963
|
+
return /* @__PURE__ */ jsx32("p", { className: "text-og-sm text-og-fg-subtle", children: "No startup timings recorded yet." });
|
|
14202
12964
|
const byTurn = /* @__PURE__ */ new Map();
|
|
14203
12965
|
for (const phase of phases) {
|
|
14204
12966
|
const group = byTurn.get(phase.turnId) ?? [];
|
|
@@ -14213,9 +12975,9 @@ function StartupTimings({ phases }) {
|
|
|
14213
12975
|
turnPhases[0].startedAt
|
|
14214
12976
|
)
|
|
14215
12977
|
})).sort((a, b) => b.startedAt.localeCompare(a.startedAt));
|
|
14216
|
-
return /* @__PURE__ */
|
|
14217
|
-
/* @__PURE__ */
|
|
14218
|
-
turns.map((turn, index) => /* @__PURE__ */
|
|
12978
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-3", children: [
|
|
12979
|
+
/* @__PURE__ */ jsx32("p", { className: "text-og-xs text-og-fg-subtle", children: "Each turn has its own startup. Phases can overlap; durations are not additive." }),
|
|
12980
|
+
turns.map((turn, index) => /* @__PURE__ */ jsx32(
|
|
14219
12981
|
StartupTurn,
|
|
14220
12982
|
{
|
|
14221
12983
|
...turn,
|
|
@@ -14232,53 +12994,53 @@ function StartupTurn({
|
|
|
14232
12994
|
latest
|
|
14233
12995
|
}) {
|
|
14234
12996
|
const status = phases.some((phase) => phase.status === "failed") ? "Failed" : phases.some((phase) => phase.status === "running") ? "In progress" : phases.some((phase) => phase.status === "cancelled") ? "Interrupted" : "Ready";
|
|
14235
|
-
return /* @__PURE__ */
|
|
14236
|
-
/* @__PURE__ */
|
|
14237
|
-
/* @__PURE__ */
|
|
14238
|
-
/* @__PURE__ */
|
|
12997
|
+
return /* @__PURE__ */ jsxs24("details", { open: latest, className: "group border-b border-og-border pb-3", children: [
|
|
12998
|
+
/* @__PURE__ */ jsxs24("summary", { className: "cursor-pointer rounded py-3 text-og-sm text-og-fg-muted focus-visible:outline-2 focus-visible:outline-og-accent", children: [
|
|
12999
|
+
/* @__PURE__ */ jsx32("span", { className: "font-medium", children: turnId === null ? "Unassigned events" : latest ? "Latest turn" : "Earlier turn" }),
|
|
13000
|
+
/* @__PURE__ */ jsx32("span", { className: "ml-2 text-og-xs text-og-fg-subtle", children: new Date(startedAt).toLocaleTimeString([], {
|
|
14239
13001
|
hour: "2-digit",
|
|
14240
13002
|
minute: "2-digit",
|
|
14241
13003
|
second: "2-digit"
|
|
14242
13004
|
}) }),
|
|
14243
|
-
/* @__PURE__ */
|
|
13005
|
+
/* @__PURE__ */ jsx32(
|
|
14244
13006
|
"span",
|
|
14245
13007
|
{
|
|
14246
13008
|
className: status === "Failed" ? "ml-2 text-og-xs text-og-status-failed" : "ml-2 text-og-xs text-og-fg-subtle",
|
|
14247
13009
|
children: status
|
|
14248
13010
|
}
|
|
14249
13011
|
),
|
|
14250
|
-
/* @__PURE__ */
|
|
13012
|
+
/* @__PURE__ */ jsx32("span", { className: "mt-1 block break-all pl-4 font-og-mono text-og-xs text-og-fg-subtle", children: turnId ?? "No turn ID recorded" })
|
|
14251
13013
|
] }),
|
|
14252
|
-
/* @__PURE__ */
|
|
14253
|
-
/* @__PURE__ */
|
|
13014
|
+
/* @__PURE__ */ jsxs24("div", { className: "pb-2", children: [
|
|
13015
|
+
/* @__PURE__ */ jsxs24("p", { className: "text-og-xs text-og-fg-subtle", children: [
|
|
14254
13016
|
"Started ",
|
|
14255
|
-
/* @__PURE__ */
|
|
13017
|
+
/* @__PURE__ */ jsx32("time", { dateTime: startedAt, children: new Date(startedAt).toLocaleString() })
|
|
14256
13018
|
] }),
|
|
14257
|
-
/* @__PURE__ */
|
|
14258
|
-
/* @__PURE__ */
|
|
13019
|
+
/* @__PURE__ */ jsx32("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs24("table", { className: "w-full text-left text-og-xs", children: [
|
|
13020
|
+
/* @__PURE__ */ jsxs24("caption", { className: "sr-only", children: [
|
|
14259
13021
|
"Startup phases for ",
|
|
14260
13022
|
turnId ?? "unassigned events"
|
|
14261
13023
|
] }),
|
|
14262
|
-
/* @__PURE__ */
|
|
14263
|
-
/* @__PURE__ */
|
|
14264
|
-
/* @__PURE__ */
|
|
14265
|
-
/* @__PURE__ */
|
|
13024
|
+
/* @__PURE__ */ jsx32("thead", { children: /* @__PURE__ */ jsxs24("tr", { className: "border-b border-og-border text-og-fg-subtle", children: [
|
|
13025
|
+
/* @__PURE__ */ jsx32("th", { scope: "col", className: "py-2 font-medium", children: "Phase" }),
|
|
13026
|
+
/* @__PURE__ */ jsx32("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Status" }),
|
|
13027
|
+
/* @__PURE__ */ jsx32("th", { scope: "col", className: "py-2 text-right font-medium", children: "Duration" })
|
|
14266
13028
|
] }) }),
|
|
14267
|
-
/* @__PURE__ */
|
|
13029
|
+
/* @__PURE__ */ jsx32("tbody", { children: phases.map((phase) => /* @__PURE__ */ jsxs24(
|
|
14268
13030
|
"tr",
|
|
14269
13031
|
{
|
|
14270
13032
|
className: "border-b border-og-border/40",
|
|
14271
13033
|
title: `Turn: ${phase.turnId ?? "unknown"} \xB7 Started: ${phase.startedAt}`,
|
|
14272
13034
|
children: [
|
|
14273
|
-
/* @__PURE__ */
|
|
14274
|
-
/* @__PURE__ */
|
|
13035
|
+
/* @__PURE__ */ jsx32("th", { scope: "row", className: "py-2.5 font-normal text-og-fg-muted", children: LABELS[phase.phase] }),
|
|
13036
|
+
/* @__PURE__ */ jsx32(
|
|
14275
13037
|
"td",
|
|
14276
13038
|
{
|
|
14277
13039
|
className: `px-3 py-2.5 ${phase.status === "failed" ? "text-og-status-failed" : "text-og-fg-subtle"}`,
|
|
14278
13040
|
children: phase.status === "running" ? "In progress" : phase.status
|
|
14279
13041
|
}
|
|
14280
13042
|
),
|
|
14281
|
-
/* @__PURE__ */
|
|
13043
|
+
/* @__PURE__ */ jsx32("td", { className: "py-2.5 text-right font-og-mono tabular-nums text-og-fg-muted", children: phase.durationMs === null ? "\u2014" : phase.durationMs < 1e3 ? `${Math.round(phase.durationMs)} ms` : `${(phase.durationMs / 1e3).toFixed(1)} s` })
|
|
14282
13044
|
]
|
|
14283
13045
|
},
|
|
14284
13046
|
phase.id
|
|
@@ -14289,9 +13051,7 @@ function StartupTurn({
|
|
|
14289
13051
|
}
|
|
14290
13052
|
|
|
14291
13053
|
export {
|
|
14292
|
-
defaultHumanInputFormMessages,
|
|
14293
13054
|
HumanInputForm,
|
|
14294
|
-
answersFromDrafts,
|
|
14295
13055
|
HumanInputSurface,
|
|
14296
13056
|
ToolActionReviewCard,
|
|
14297
13057
|
ToolActionReviewDetails,
|
|
@@ -14301,29 +13061,11 @@ export {
|
|
|
14301
13061
|
setStartupDetails,
|
|
14302
13062
|
useStartupDetails,
|
|
14303
13063
|
ToolReviewHistoryProvider,
|
|
14304
|
-
sandboxCommandExitCode,
|
|
14305
|
-
parseExecBannerSessionId,
|
|
14306
|
-
stripExecBanner,
|
|
14307
|
-
execTruncated,
|
|
14308
|
-
isExecSessionLostBanner,
|
|
14309
|
-
looksBinary,
|
|
14310
|
-
controlCaret,
|
|
14311
|
-
v4aToGitFileDiff,
|
|
14312
|
-
parseFreeformApplyPatch,
|
|
14313
|
-
applyPatchOps,
|
|
14314
|
-
applyPatchOpsFromToolItem,
|
|
14315
|
-
isApplyPatch,
|
|
14316
|
-
parseToolArgs,
|
|
14317
|
-
tailPeek,
|
|
14318
|
-
unwrapMcpOutput,
|
|
14319
|
-
rawTypeOf,
|
|
14320
|
-
createToolRegistry,
|
|
14321
13064
|
gitFileDiffToPatch,
|
|
14322
13065
|
PierreDiff,
|
|
14323
13066
|
defaultToolRegistry,
|
|
14324
13067
|
createDefaultToolRegistry,
|
|
14325
13068
|
ActivityRail,
|
|
14326
|
-
BUILT_IN_TURN_SUMMARY_FACET_IDS,
|
|
14327
13069
|
TurnSummary,
|
|
14328
13070
|
userMessageLikelyNeedsDisclosure,
|
|
14329
13071
|
UserMessageBody,
|
|
@@ -14344,6 +13086,8 @@ export {
|
|
|
14344
13086
|
sessionChromeGoalPillExplanation,
|
|
14345
13087
|
sessionChromeGoalPillState,
|
|
14346
13088
|
SessionChrome,
|
|
13089
|
+
PROVIDER_RECOVERY_NOTICE_DETAIL,
|
|
13090
|
+
ProviderRecoveryNotice,
|
|
14347
13091
|
SessionConversation,
|
|
14348
13092
|
useWorkspaceSessions,
|
|
14349
13093
|
SessionList,
|
|
@@ -14353,4 +13097,4 @@ export {
|
|
|
14353
13097
|
SessionCommands,
|
|
14354
13098
|
StartupTimings
|
|
14355
13099
|
};
|
|
14356
|
-
//# sourceMappingURL=chunk-
|
|
13100
|
+
//# sourceMappingURL=chunk-RRRS5D5T.js.map
|