@opengeni/react 3.8.0-canary.1 → 4.0.1-canary.1
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 +10 -24
- package/dist/artifacts.js +7 -7
- package/dist/{browser-viewer-SS46LUAC.js → browser-viewer-NTD6UIPR.js} +3 -3
- package/dist/{chunk-VEPNNDNG.js → chunk-24M4YBCL.js} +4 -4
- package/dist/{chunk-ELIYWBZR.js → chunk-BV5A4OTE.js} +4 -4
- package/dist/{chunk-7W6PVVTK.js → chunk-CQG7YUJB.js} +2582 -1037
- package/dist/chunk-CQG7YUJB.js.map +1 -0
- package/dist/{chunk-BXJOQFCD.js → chunk-HUMIRRYI.js} +84 -221
- package/dist/chunk-HUMIRRYI.js.map +1 -0
- package/dist/{chunk-7BWFU6H4.js → chunk-Z7WBDB4E.js} +395 -287
- package/dist/chunk-Z7WBDB4E.js.map +1 -0
- package/dist/components/human-input-form.d.ts +3 -1
- package/dist/components/human-input-surface.d.ts +3 -2
- package/dist/components/markdown-table-layout.d.ts +9 -0
- package/dist/components/session-conversation.d.ts +2 -0
- package/dist/composer.js +2 -3
- package/dist/{computer-viewer-FWEZISW4.js → computer-viewer-7TEZC6Y2.js} +3 -3
- package/dist/hooks/use-codex-accounts.d.ts +11 -1
- package/dist/hooks/use-session-events.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +44 -34
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +3 -3
- package/dist/markdown-table-layout-3Z3AWBY7.js +71 -0
- package/dist/markdown-table-layout-3Z3AWBY7.js.map +1 -0
- package/dist/older-history.d.ts +3 -2
- package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-27LKAWZD.js} +2 -2
- package/dist/platform-activity-row-27LKAWZD.js.map +1 -0
- package/dist/realtime.js +3 -3
- package/dist/session-ui.js +6 -9
- package/dist/session.js +1 -1
- package/dist/timeline/types.d.ts +3 -0
- package/package.json +2 -6
- package/src/components/human-input-form.tsx +185 -53
- package/src/components/human-input-surface.tsx +3 -0
- package/src/components/markdown-table-layout.ts +85 -0
- package/src/components/markdown.tsx +20 -2
- package/src/components/message-timeline.tsx +47 -7
- package/src/components/session-commands-panel.tsx +7 -1
- package/src/components/session-conversation.tsx +4 -1
- package/src/hooks/use-codex-accounts.ts +32 -5
- package/src/hooks/use-session-events.ts +16 -277
- package/src/index.ts +0 -1
- package/src/older-history.ts +22 -4
- package/src/timeline/platform-activity-row.tsx +4 -1
- package/src/timeline/projection.ts +99 -9
- package/src/timeline/types.ts +3 -0
- package/dist/chat.d.ts +0 -37
- package/dist/chat.js +0 -315
- package/dist/chat.js.map +0 -1
- package/dist/chunk-7BWFU6H4.js.map +0 -1
- package/dist/chunk-7W6PVVTK.js.map +0 -1
- package/dist/chunk-BXJOQFCD.js.map +0 -1
- package/dist/chunk-HQV2I5HV.js +0 -124
- package/dist/chunk-HQV2I5HV.js.map +0 -1
- package/dist/chunk-YAIPFO5D.js +0 -1416
- package/dist/chunk-YAIPFO5D.js.map +0 -1
- package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
- package/src/chat.tsx +0 -393
- /package/dist/{browser-viewer-SS46LUAC.js.map → browser-viewer-NTD6UIPR.js.map} +0 -0
- /package/dist/{chunk-VEPNNDNG.js.map → chunk-24M4YBCL.js.map} +0 -0
- /package/dist/{chunk-ELIYWBZR.js.map → chunk-BV5A4OTE.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → computer-viewer-7TEZC6Y2.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HumanInputAnswer, HumanInputQuestion, SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
1
|
+
import type { HumanInputAnswer, HumanInputQuestion, SkillRecord, SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
export type HumanInputAnswerDraft = {
|
|
4
4
|
values: string[];
|
|
@@ -28,6 +28,8 @@ export type HumanInputFormMessages = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const defaultHumanInputFormMessages: HumanInputFormMessages;
|
|
30
30
|
export type HumanInputFormProps = {
|
|
31
|
+
/** Scoped immutable revision reader. Saving a Skill fails closed without its full preview. */
|
|
32
|
+
loadSkillReview?: ((reference: NonNullable<HumanInputQuestion["skillReview"]>) => Promise<SkillRecord>) | undefined;
|
|
31
33
|
request: Pick<SessionHumanInputRequest, "id" | "questions" | "allowSkip" | "expiresAt">;
|
|
32
34
|
onSubmit: (response: SubmitHumanInputResponseRequest) => void | Promise<void>;
|
|
33
35
|
submitting?: boolean | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SessionHumanInputRequest, SubmitHumanInputResponseRequest } from "@opengeni/sdk";
|
|
2
|
-
import { type HumanInputFormMessages } from "./human-input-form.js";
|
|
2
|
+
import { type HumanInputFormMessages, type HumanInputFormProps } from "./human-input-form.js";
|
|
3
3
|
export type HumanInputSurfaceProps = {
|
|
4
|
+
loadSkillReview?: HumanInputFormProps["loadSkillReview"];
|
|
4
5
|
requests: SessionHumanInputRequest[];
|
|
5
6
|
onSubmit: (requestId: string, response: SubmitHumanInputResponseRequest) => void | Promise<void>;
|
|
6
7
|
respondingRequestId?: string | null | undefined;
|
|
@@ -16,4 +17,4 @@ export type HumanInputSurfaceProps = {
|
|
|
16
17
|
* settles the active request and the next remaining set advances automatically
|
|
17
18
|
* when the authoritative pending list updates.
|
|
18
19
|
*/
|
|
19
|
-
export declare function HumanInputSurface({ requests, onSubmit, respondingRequestId, error, messages, className, autoFocus, }: HumanInputSurfaceProps): import("react").JSX.Element | null;
|
|
20
|
+
export declare function HumanInputSurface({ requests, onSubmit, loadSkillReview, respondingRequestId, error, messages, className, autoFocus, }: HumanInputSurfaceProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function markdownTableWidth({ columnLeft, columnWidth, contentLeft, contentRight, preferredWidth, }: {
|
|
2
|
+
columnLeft: number;
|
|
3
|
+
columnWidth: number;
|
|
4
|
+
contentLeft: number;
|
|
5
|
+
contentRight: number;
|
|
6
|
+
preferredWidth: number;
|
|
7
|
+
}): number;
|
|
8
|
+
/** Loaded only for assistant tables. Keep prose and nested scroll owners intact. */
|
|
9
|
+
export declare function observeMarkdownTableLayout(wrapper: HTMLDivElement, table: HTMLTableElement): (() => void) | undefined;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
2
|
import { type ClientOverride } from "../session-context.js";
|
|
3
3
|
import { type ChatComposerProps } from "./chat-composer.js";
|
|
4
|
+
import { type HumanInputSurfaceProps } from "./human-input-surface.js";
|
|
4
5
|
export type SessionConversationProps = ClientOverride & {
|
|
5
6
|
sessionId: string;
|
|
7
|
+
loadSkillReview?: HumanInputSurfaceProps["loadSkillReview"];
|
|
6
8
|
className?: string;
|
|
7
9
|
/** Defaults to filling the host. The host owns available height. */
|
|
8
10
|
height?: CSSProperties["height"];
|
package/dist/composer.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
useChatComposer,
|
|
41
41
|
useChatComposerController,
|
|
42
42
|
useVoiceInput
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-Z7WBDB4E.js";
|
|
44
44
|
import {
|
|
45
45
|
BillingClassMark,
|
|
46
46
|
ModelPolicyPicker,
|
|
@@ -49,12 +49,11 @@ import {
|
|
|
49
49
|
PickerNavRow,
|
|
50
50
|
defaultModelPolicyPickerMessages
|
|
51
51
|
} from "./chunk-R4KRSFGA.js";
|
|
52
|
+
import "./chunk-VZTQ73XT.js";
|
|
52
53
|
import "./chunk-6J56T3MG.js";
|
|
53
54
|
import "./chunk-PLYRL5ER.js";
|
|
54
55
|
import "./chunk-KZ73RL76.js";
|
|
55
56
|
import "./chunk-NEXLLTP4.js";
|
|
56
|
-
import "./chunk-HQV2I5HV.js";
|
|
57
|
-
import "./chunk-VZTQ73XT.js";
|
|
58
57
|
import "./chunk-VRBL3F5E.js";
|
|
59
58
|
import "./chunk-22KP6LR5.js";
|
|
60
59
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComputerViewer,
|
|
3
3
|
computerKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BV5A4OTE.js";
|
|
5
5
|
import "./chunk-H5YGYNXS.js";
|
|
6
6
|
import "./chunk-4MDLEHXL.js";
|
|
7
7
|
import "./chunk-5YK2ZDIG.js";
|
|
8
|
+
import "./chunk-JVYQRRC4.js";
|
|
8
9
|
import "./chunk-KZ73RL76.js";
|
|
9
10
|
import "./chunk-NEXLLTP4.js";
|
|
10
|
-
import "./chunk-JVYQRRC4.js";
|
|
11
11
|
import "./chunk-22KP6LR5.js";
|
|
12
12
|
export {
|
|
13
13
|
ComputerViewer,
|
|
14
14
|
computerKey
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=computer-viewer-
|
|
16
|
+
//# sourceMappingURL=computer-viewer-7TEZC6Y2.js.map
|
|
@@ -15,9 +15,14 @@ export type CodexAccountsClientLike = {
|
|
|
15
15
|
getSession?: (workspaceId: string, sessionId: string) => Promise<{
|
|
16
16
|
codexPinnedCredentialId?: string | null;
|
|
17
17
|
codexLastCredentialId?: string | null;
|
|
18
|
+
codexCurrentSelection?: {
|
|
19
|
+
credentialId: string | null;
|
|
20
|
+
waiting: boolean;
|
|
21
|
+
} | null;
|
|
18
22
|
}>;
|
|
19
23
|
pinSessionCodexAccount?: (workspaceId: string, sessionId: string, target: string) => Promise<{
|
|
20
24
|
pinned: string;
|
|
25
|
+
appliedTo?: "waiting_turn" | "next_turn";
|
|
21
26
|
}>;
|
|
22
27
|
/** Optional (absent ⇒ the card hides live refresh): batched live /wham/usage refresh. */
|
|
23
28
|
refreshCodexUsage?: (workspaceId: string) => Promise<{
|
|
@@ -37,8 +42,13 @@ export type UseCodexAccountsResult = {
|
|
|
37
42
|
activeAccountId: string | null;
|
|
38
43
|
/** The session's PINNED account (null ⇒ following workspace active). */
|
|
39
44
|
pinnedAccountId: string | null;
|
|
40
|
-
/**
|
|
45
|
+
/** Current preference only; automatic allocation can choose another account. */
|
|
41
46
|
effectiveAccountId: string | null;
|
|
47
|
+
currentSelection: {
|
|
48
|
+
credentialId: string | null;
|
|
49
|
+
waiting: boolean;
|
|
50
|
+
} | null;
|
|
51
|
+
switchAppliedTo: "waiting_turn" | "next_turn" | null;
|
|
42
52
|
/** The account the session's last turn ACTUALLY ran on (the "Running on:" source). */
|
|
43
53
|
lastAccountId: string | null;
|
|
44
54
|
settings: CodexRotationSettings;
|
|
@@ -65,7 +65,6 @@ export type UseSessionEventsResult = {
|
|
|
65
65
|
};
|
|
66
66
|
export declare const SESSION_EVENT_BROWSER_MAX_BYTES: number;
|
|
67
67
|
export declare const SESSION_EVENT_BROWSER_MAX_COUNT = 10000;
|
|
68
|
-
export declare const SESSION_EVENT_BROWSER_SINGLE_EVENT_MAX_BYTES: number;
|
|
69
68
|
export declare const SESSION_EVENT_BROWSER_PENDING_MAX_BYTES: number;
|
|
70
69
|
export declare const SESSION_EVENT_BROWSER_PENDING_MAX_COUNT = 256;
|
|
71
70
|
export type BrowserSessionEventWindow = {
|
|
@@ -86,7 +85,8 @@ export declare function useSessionEvents(sessionId: string | null | undefined, o
|
|
|
86
85
|
* deliberately separate from durable history and transport paging: when a
|
|
87
86
|
* backward page evicts the live tail, the hook enters bounded history mode and
|
|
88
87
|
* preserves the highest-ever-observed sequence separately for forward paging.
|
|
89
|
-
* The source event remains durable in PostgreSQL throughout.
|
|
88
|
+
* The source event remains durable in PostgreSQL throughout. An event larger
|
|
89
|
+
* than the byte target is retained alone, never replaced by a lossy preview.
|
|
90
90
|
*/
|
|
91
91
|
export declare function boundBrowserSessionEventWindow(events: readonly SessionEvent[], options?: {
|
|
92
92
|
maxBytes?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { filePathVisibility, visibleFileTree } from "./file-node-visibility.js";
|
|
|
11
11
|
export type { FileNodeVisibilityContext, FileNodeVisibilityPredicate, FilePathVisibility, } from "./file-node-visibility.js";
|
|
12
12
|
export { useSession, isTitleEvent } from "./hooks/use-session.js";
|
|
13
13
|
export type { UseSessionOptions, UseSessionResult } from "./hooks/use-session.js";
|
|
14
|
-
export { SESSION_EVENT_BROWSER_MAX_BYTES, SESSION_EVENT_BROWSER_MAX_COUNT, SESSION_EVENT_BROWSER_PENDING_MAX_BYTES, SESSION_EVENT_BROWSER_PENDING_MAX_COUNT,
|
|
14
|
+
export { SESSION_EVENT_BROWSER_MAX_BYTES, SESSION_EVENT_BROWSER_MAX_COUNT, SESSION_EVENT_BROWSER_PENDING_MAX_BYTES, SESSION_EVENT_BROWSER_PENDING_MAX_COUNT, boundBrowserSessionEventWindow, useSessionEvents, } from "./hooks/use-session-events.js";
|
|
15
15
|
export { createOlderHistoryLoadReceipt } from "./older-history.js";
|
|
16
16
|
export type { BrowserSessionEventWindow, SessionEventsConnectionState, UseSessionEventsOptions, UseSessionEventsResult, } from "./hooks/use-session-events.js";
|
|
17
17
|
export type { OlderHistoryLoader, OlderHistoryLoadReceipt } from "./older-history.js";
|
package/dist/index.js
CHANGED
|
@@ -51,9 +51,13 @@ import {
|
|
|
51
51
|
BUILT_IN_TURN_SUMMARY_FACET_IDS,
|
|
52
52
|
BodyNote,
|
|
53
53
|
ChatComposer,
|
|
54
|
+
CopyButton,
|
|
55
|
+
CopyHoverFrame,
|
|
54
56
|
DisclosureDefaultsProvider,
|
|
55
57
|
GeneratedVideoPlayer,
|
|
58
|
+
HumanInputForm,
|
|
56
59
|
HumanInputSurface,
|
|
60
|
+
Markdown,
|
|
57
61
|
MediaEmpty,
|
|
58
62
|
MediaSkeleton,
|
|
59
63
|
MessageTimeline,
|
|
@@ -72,11 +76,13 @@ import {
|
|
|
72
76
|
TimelineRow,
|
|
73
77
|
TurnSummary,
|
|
74
78
|
UserMessageBody,
|
|
79
|
+
answersFromDrafts,
|
|
75
80
|
applyPatchOps,
|
|
76
81
|
applyPatchOpsFromToolItem,
|
|
77
82
|
controlCaret,
|
|
78
83
|
createDefaultToolRegistry,
|
|
79
84
|
createToolRegistry,
|
|
85
|
+
defaultHumanInputFormMessages,
|
|
80
86
|
defaultToolRegistry,
|
|
81
87
|
execTruncated,
|
|
82
88
|
gitFileDiffToPatch,
|
|
@@ -86,8 +92,11 @@ import {
|
|
|
86
92
|
parseExecBannerSessionId,
|
|
87
93
|
parseFreeformApplyPatch,
|
|
88
94
|
parseToolArgs,
|
|
95
|
+
prefersReducedMotion,
|
|
89
96
|
rawTypeOf,
|
|
90
97
|
sandboxCommandExitCode,
|
|
98
|
+
sandboxFileLocationFromHref,
|
|
99
|
+
sandboxFilePathFromHref,
|
|
91
100
|
sessionChromeGoalPillExplanation,
|
|
92
101
|
sessionChromeGoalPillLabel,
|
|
93
102
|
sessionChromeGoalPillState,
|
|
@@ -99,7 +108,7 @@ import {
|
|
|
99
108
|
useWorkspaceModelCatalog,
|
|
100
109
|
userMessageLikelyNeedsDisclosure,
|
|
101
110
|
v4aToGitFileDiff
|
|
102
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-CQG7YUJB.js";
|
|
103
112
|
import "./chunk-YBM6CQRU.js";
|
|
104
113
|
import "./chunk-5M6VTFJ5.js";
|
|
105
114
|
import "./chunk-ZYRGEKWS.js";
|
|
@@ -107,6 +116,10 @@ import "./chunk-NOSYBS2D.js";
|
|
|
107
116
|
import {
|
|
108
117
|
OpenGeniProvider
|
|
109
118
|
} from "./chunk-PAJU5KKL.js";
|
|
119
|
+
import {
|
|
120
|
+
copyTextToClipboard,
|
|
121
|
+
tableElementToTsv
|
|
122
|
+
} from "./chunk-JVYQRRC4.js";
|
|
110
123
|
import {
|
|
111
124
|
CommandPalette,
|
|
112
125
|
ComposerTranscriptionControl,
|
|
@@ -115,6 +128,10 @@ import {
|
|
|
115
128
|
LightboxProvider,
|
|
116
129
|
ModelPicker,
|
|
117
130
|
OPEN_WORKSTREAM_CONTROL_EVENT,
|
|
131
|
+
Tooltip,
|
|
132
|
+
TooltipContent,
|
|
133
|
+
TooltipProvider,
|
|
134
|
+
TooltipTrigger,
|
|
118
135
|
VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS,
|
|
119
136
|
VOICE_RECORDING_OWNER_HEARTBEAT_MILLISECONDS,
|
|
120
137
|
VOICE_RECORDING_OWNER_STALE_MILLISECONDS,
|
|
@@ -142,7 +159,7 @@ import {
|
|
|
142
159
|
useSlashCommands,
|
|
143
160
|
useTranscription,
|
|
144
161
|
useVoiceInput
|
|
145
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-Z7WBDB4E.js";
|
|
146
163
|
import {
|
|
147
164
|
BillingClassMark,
|
|
148
165
|
ModelPolicyPicker,
|
|
@@ -151,6 +168,10 @@ import {
|
|
|
151
168
|
PickerNavRow,
|
|
152
169
|
defaultModelPolicyPickerMessages
|
|
153
170
|
} from "./chunk-R4KRSFGA.js";
|
|
171
|
+
import {
|
|
172
|
+
usePortalTokenSource,
|
|
173
|
+
usePortalTokenStyle
|
|
174
|
+
} from "./chunk-VZTQ73XT.js";
|
|
154
175
|
import {
|
|
155
176
|
approvalsFromRequiresAction,
|
|
156
177
|
createEmbeddedSessionClient,
|
|
@@ -169,7 +190,6 @@ import {
|
|
|
169
190
|
SESSION_EVENT_BROWSER_MAX_COUNT,
|
|
170
191
|
SESSION_EVENT_BROWSER_PENDING_MAX_BYTES,
|
|
171
192
|
SESSION_EVENT_BROWSER_PENDING_MAX_COUNT,
|
|
172
|
-
SESSION_EVENT_BROWSER_SINGLE_EVENT_MAX_BYTES,
|
|
173
193
|
boundBrowserSessionEventWindow,
|
|
174
194
|
buildTimeline,
|
|
175
195
|
createOlderHistoryLoadReceipt,
|
|
@@ -187,7 +207,7 @@ import {
|
|
|
187
207
|
useSession,
|
|
188
208
|
useSessionEvents,
|
|
189
209
|
useTurnQueue
|
|
190
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-HUMIRRYI.js";
|
|
191
211
|
import {
|
|
192
212
|
FILE_ONLY_MESSAGE_TEXT,
|
|
193
213
|
composeSendInput,
|
|
@@ -219,31 +239,6 @@ import {
|
|
|
219
239
|
useOpenGeni,
|
|
220
240
|
useOpenGeniClient
|
|
221
241
|
} from "./chunk-NEXLLTP4.js";
|
|
222
|
-
import {
|
|
223
|
-
CopyButton,
|
|
224
|
-
CopyHoverFrame,
|
|
225
|
-
HumanInputForm,
|
|
226
|
-
Markdown,
|
|
227
|
-
answersFromDrafts,
|
|
228
|
-
defaultHumanInputFormMessages,
|
|
229
|
-
prefersReducedMotion,
|
|
230
|
-
sandboxFileLocationFromHref,
|
|
231
|
-
sandboxFilePathFromHref
|
|
232
|
-
} from "./chunk-YAIPFO5D.js";
|
|
233
|
-
import {
|
|
234
|
-
copyTextToClipboard,
|
|
235
|
-
tableElementToTsv
|
|
236
|
-
} from "./chunk-JVYQRRC4.js";
|
|
237
|
-
import {
|
|
238
|
-
Tooltip,
|
|
239
|
-
TooltipContent,
|
|
240
|
-
TooltipProvider,
|
|
241
|
-
TooltipTrigger
|
|
242
|
-
} from "./chunk-HQV2I5HV.js";
|
|
243
|
-
import {
|
|
244
|
-
usePortalTokenSource,
|
|
245
|
-
usePortalTokenStyle
|
|
246
|
-
} from "./chunk-VZTQ73XT.js";
|
|
247
242
|
import {
|
|
248
243
|
advancedSourceSummary,
|
|
249
244
|
availabilityReasonLabel,
|
|
@@ -8331,11 +8326,11 @@ import {
|
|
|
8331
8326
|
} from "lucide-react";
|
|
8332
8327
|
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
8333
8328
|
var LazyBrowserViewer = lazy2(async () => {
|
|
8334
|
-
const { BrowserViewer } = await import("./browser-viewer-
|
|
8329
|
+
const { BrowserViewer } = await import("./browser-viewer-NTD6UIPR.js");
|
|
8335
8330
|
return { default: BrowserViewer };
|
|
8336
8331
|
});
|
|
8337
8332
|
var LazyComputerViewer = lazy2(async () => {
|
|
8338
|
-
const { ComputerViewer } = await import("./computer-viewer-
|
|
8333
|
+
const { ComputerViewer } = await import("./computer-viewer-7TEZC6Y2.js");
|
|
8339
8334
|
return { default: ComputerViewer };
|
|
8340
8335
|
});
|
|
8341
8336
|
var WORKBENCH_TAB_CHANGES = "changes";
|
|
@@ -9277,7 +9272,16 @@ function CenteredState({
|
|
|
9277
9272
|
// src/hooks/use-codex-accounts.ts
|
|
9278
9273
|
import { useCallback as useCallback25, useState as useState18 } from "react";
|
|
9279
9274
|
function isCodexAccountEvent(event) {
|
|
9280
|
-
return
|
|
9275
|
+
return [
|
|
9276
|
+
"codex.account.switched",
|
|
9277
|
+
"codex.account.selection.changed",
|
|
9278
|
+
"codex.capacity.waiting",
|
|
9279
|
+
"codex.capacity.resumed",
|
|
9280
|
+
"codex.capacity.superseded",
|
|
9281
|
+
"turn.completed",
|
|
9282
|
+
"turn.failed",
|
|
9283
|
+
"turn.cancelled"
|
|
9284
|
+
].includes(event.type);
|
|
9281
9285
|
}
|
|
9282
9286
|
var EMPTY_SETTINGS = {
|
|
9283
9287
|
rotationEnabled: false,
|
|
@@ -9285,6 +9289,7 @@ var EMPTY_SETTINGS = {
|
|
|
9285
9289
|
activeCredentialId: null
|
|
9286
9290
|
};
|
|
9287
9291
|
var EMPTY_STATE = {
|
|
9292
|
+
currentSelection: null,
|
|
9288
9293
|
accounts: [],
|
|
9289
9294
|
activeAccountId: null,
|
|
9290
9295
|
settings: EMPTY_SETTINGS,
|
|
@@ -9301,6 +9306,7 @@ function useCodexAccounts(options = {}) {
|
|
|
9301
9306
|
const sessionP = sessionId && codexClient.getSession ? codexClient.getSession(workspaceId, sessionId).catch(() => null) : Promise.resolve(null);
|
|
9302
9307
|
const [acc, session] = await Promise.all([accountsP, sessionP]);
|
|
9303
9308
|
return {
|
|
9309
|
+
currentSelection: session?.codexCurrentSelection ?? null,
|
|
9304
9310
|
accounts: acc.accounts,
|
|
9305
9311
|
activeAccountId: acc.activeAccountId,
|
|
9306
9312
|
settings: acc.settings,
|
|
@@ -9319,6 +9325,7 @@ function useCodexAccounts(options = {}) {
|
|
|
9319
9325
|
const { run: runMutation, mutating: pinning, mutationError } = useMutationRunner();
|
|
9320
9326
|
const { run: runUsageMutation, mutating: refreshingUsage } = useMutationRunner();
|
|
9321
9327
|
const [pinningTarget, setPinningTarget] = useState18(null);
|
|
9328
|
+
const [switchReceipt, setSwitchReceipt] = useState18(null);
|
|
9322
9329
|
useSessionEventTrigger(
|
|
9323
9330
|
client,
|
|
9324
9331
|
workspaceId,
|
|
@@ -9336,8 +9343,10 @@ function useCodexAccounts(options = {}) {
|
|
|
9336
9343
|
return false;
|
|
9337
9344
|
}
|
|
9338
9345
|
setPinningTarget(target);
|
|
9346
|
+
setSwitchReceipt(null);
|
|
9339
9347
|
const result = await runMutation(async () => {
|
|
9340
|
-
await codexClient.pinSessionCodexAccount(workspaceId, sessionId, target);
|
|
9348
|
+
const receipt = await codexClient.pinSessionCodexAccount(workspaceId, sessionId, target);
|
|
9349
|
+
setSwitchReceipt({ sessionId, appliedTo: receipt.appliedTo ?? "next_turn" });
|
|
9341
9350
|
return true;
|
|
9342
9351
|
});
|
|
9343
9352
|
setPinningTarget(null);
|
|
@@ -9360,6 +9369,8 @@ function useCodexAccounts(options = {}) {
|
|
|
9360
9369
|
const data = loadedData ?? EMPTY_STATE;
|
|
9361
9370
|
const effectiveAccountId = data.pinnedAccountId ?? data.activeAccountId;
|
|
9362
9371
|
return {
|
|
9372
|
+
currentSelection: data.currentSelection,
|
|
9373
|
+
switchAppliedTo: switchReceipt?.sessionId === sessionId ? switchReceipt?.appliedTo ?? null : null,
|
|
9363
9374
|
accounts: data.accounts,
|
|
9364
9375
|
activeAccountId: data.activeAccountId,
|
|
9365
9376
|
pinnedAccountId: data.pinnedAccountId,
|
|
@@ -9495,7 +9506,6 @@ export {
|
|
|
9495
9506
|
SESSION_EVENT_BROWSER_MAX_COUNT,
|
|
9496
9507
|
SESSION_EVENT_BROWSER_PENDING_MAX_BYTES,
|
|
9497
9508
|
SESSION_EVENT_BROWSER_PENDING_MAX_COUNT,
|
|
9498
|
-
SESSION_EVENT_BROWSER_SINGLE_EVENT_MAX_BYTES,
|
|
9499
9509
|
SESSION_STATUS_META,
|
|
9500
9510
|
SandboxFiles,
|
|
9501
9511
|
SandboxTerminal,
|