@opengeni/react 0.44.5 → 0.46.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 +3 -0
- package/dist/{chunk-L3EWO3UK.js → chunk-3PB7MIT6.js} +243 -22
- package/dist/chunk-3PB7MIT6.js.map +1 -0
- package/dist/{chunk-EHSYZ4KP.js → chunk-FGZUCXZF.js} +2 -2
- package/dist/{chunk-EHSYZ4KP.js.map → chunk-FGZUCXZF.js.map} +1 -1
- package/dist/{chunk-LYRJUU5V.js → chunk-LGVMUIRV.js} +543 -200
- package/dist/chunk-LGVMUIRV.js.map +1 -0
- package/dist/components/user-message-body.d.ts +36 -0
- package/dist/composer.js +2 -2
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/realtime.js +4 -4
- package/dist/realtime.js.map +1 -1
- package/dist/session-ui.d.ts +2 -0
- package/dist/session-ui.js +7 -3
- package/package.json +2 -2
- package/src/components/composer.tsx +4 -4
- package/src/components/copy-button.tsx +1 -1
- package/src/components/markdown.tsx +1 -1
- package/src/components/message-timeline.tsx +134 -25
- package/src/components/model-picker.tsx +1 -1
- package/src/components/model-policy-picker.tsx +1 -1
- package/src/components/user-message-body.tsx +341 -0
- package/src/hooks/use-codex-accounts.ts +1 -1
- package/src/hooks/use-voice-input.ts +320 -19
- package/src/index.ts +2 -0
- package/src/realtime/realtime-control.tsx +3 -3
- package/src/session-ui.ts +2 -0
- package/src/timeline/activity-rail.tsx +1 -1
- package/src/timeline/shared.tsx +3 -3
- package/src/timeline/turn-summary.tsx +4 -4
- package/dist/chunk-L3EWO3UK.js.map +0 -1
- package/dist/chunk-LYRJUU5V.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type RestoreDisclosureAnchor = (() => void) | null;
|
|
3
|
+
export type UserMessageDisclosureContextValue = {
|
|
4
|
+
expandedByMessageId: Map<string, boolean>;
|
|
5
|
+
beginChange: (messageBody: HTMLElement, disclosureControl: HTMLElement) => RestoreDisclosureAnchor;
|
|
6
|
+
};
|
|
7
|
+
export declare function UserMessageDisclosureProvider({ value, children, }: {
|
|
8
|
+
value: UserMessageDisclosureContextValue;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Deterministic first-paint fallback for runtimes without layout measurement.
|
|
13
|
+
* Real browsers replace this estimate with the rendered-height decision in the
|
|
14
|
+
* first layout effect. The complete text always remains mounted either way.
|
|
15
|
+
*/
|
|
16
|
+
export declare function userMessageLikelyNeedsDisclosure(text: string): boolean;
|
|
17
|
+
export type UserMessageBodyProps = {
|
|
18
|
+
/** Durable timeline item id. Expansion memory is keyed by this value. */
|
|
19
|
+
messageId: string;
|
|
20
|
+
/** Complete source text. Used only for the deterministic measurement fallback. */
|
|
21
|
+
text: string;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Lossless disclosure boundary for already-sent user-message text.
|
|
27
|
+
*
|
|
28
|
+
* The full rendered subtree always remains in the DOM. A real browser decides
|
|
29
|
+
* whether disclosure is needed from rendered height (including Markdown
|
|
30
|
+
* structure and wrapping); the source-text heuristic is only a deterministic
|
|
31
|
+
* fallback for SSR/test environments without layout. Timeline-owned context
|
|
32
|
+
* remembers expansion per durable message id and preserves the reader's scroll
|
|
33
|
+
* anchor when height changes.
|
|
34
|
+
*/
|
|
35
|
+
export declare function UserMessageBody({ messageId, text, children, className }: UserMessageBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
package/dist/composer.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
useChatComposer,
|
|
38
38
|
useChatComposerController,
|
|
39
39
|
useVoiceInput
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3PB7MIT6.js";
|
|
41
41
|
import "./chunk-HFO4ERGQ.js";
|
|
42
42
|
import "./chunk-EB67J347.js";
|
|
43
43
|
import {
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
PickerBackHeader,
|
|
49
49
|
PickerNavRow,
|
|
50
50
|
defaultModelPolicyPickerMessages
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-FGZUCXZF.js";
|
|
52
52
|
import "./chunk-EKZH6IDG.js";
|
|
53
53
|
import "./chunk-23EJ676W.js";
|
|
54
54
|
import "./chunk-U3CSCMWA.js";
|
|
@@ -2,7 +2,7 @@ import type { ClientVoiceInputConfig, OpenGeniClient } from "@opengeni/sdk";
|
|
|
2
2
|
import { type VoiceRecordingStore } from "../voice-recording-store";
|
|
3
3
|
export type VoiceInputStatus = "idle" | "requesting-permission" | "recording" | "saving" | "transcribing" | "recovered" | "transcript-ready" | "error";
|
|
4
4
|
export type UseVoiceInputOptions = {
|
|
5
|
-
client:
|
|
5
|
+
client: VoiceInputClient | null;
|
|
6
6
|
workspaceId: string;
|
|
7
7
|
capability: ClientVoiceInputConfig | null;
|
|
8
8
|
enabled: boolean;
|
|
@@ -16,6 +16,8 @@ export type UseVoiceInputOptions = {
|
|
|
16
16
|
createOwnerId?: (() => string) | undefined;
|
|
17
17
|
now?: (() => Date) | undefined;
|
|
18
18
|
};
|
|
19
|
+
type ResumableVoiceInputClient = Pick<OpenGeniClient, "createTranscriptionRecording" | "getTranscriptionRecording" | "uploadTranscriptionRecordingChunk" | "finalizeTranscriptionRecording" | "processNextTranscriptionRecordingSegment" | "discardTranscriptionRecording">;
|
|
20
|
+
type VoiceInputClient = Pick<OpenGeniClient, "transcribeAudio"> & Partial<ResumableVoiceInputClient>;
|
|
19
21
|
export type UseVoiceInputResult = {
|
|
20
22
|
status: VoiceInputStatus;
|
|
21
23
|
error: string | null;
|
|
@@ -43,4 +45,9 @@ export declare const VOICE_RECORDING_TIMESLICE_MILLISECONDS = 5000;
|
|
|
43
45
|
export declare const VOICE_RECORDING_OWNER_HEARTBEAT_MILLISECONDS = 5000;
|
|
44
46
|
export declare const VOICE_RECORDING_OWNER_STALE_MILLISECONDS = 30000;
|
|
45
47
|
export declare const VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS = 600;
|
|
48
|
+
export declare const VOICE_RECORDING_RESUMABLE_CLIENT_MAX_DURATION_SECONDS: number;
|
|
49
|
+
export declare const VOICE_RECORDING_RECOVERY_STATUS_POLL_MILLISECONDS = 2000;
|
|
50
|
+
export declare const VOICE_RECORDING_RECOVERY_MAX_MUTATION_DELAY_MILLISECONDS = 30000;
|
|
51
|
+
export declare function transcriptionRecoveryMutationDelayMilliseconds(retryAfterMilliseconds: number | undefined, attempt: number, random?: () => number): number;
|
|
46
52
|
export declare function useVoiceInput({ client, workspaceId, capability, enabled, value, setValue, focusInput, disabled, createRecordingStore, createRecordingId, createOwnerId, now, }: UseVoiceInputOptions): UseVoiceInputResult;
|
|
53
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,8 @@ export { advancedSourceSummary, availabilityReasonLabel, billingClassForModel, b
|
|
|
113
113
|
export type { LatencyModeId, PickerBillingClass, PickerModelRow } from "./model-policy";
|
|
114
114
|
export { MessageTimeline, TimelineRow } from "./components/message-timeline";
|
|
115
115
|
export type { MessageTimelineProps } from "./components/message-timeline";
|
|
116
|
+
export { UserMessageBody, userMessageLikelyNeedsDisclosure } from "./components/user-message-body";
|
|
117
|
+
export type { UserMessageBodyProps } from "./components/user-message-body";
|
|
116
118
|
export { Markdown } from "./components/markdown";
|
|
117
119
|
export { CopyButton, CopyHoverFrame } from "./components/copy-button";
|
|
118
120
|
export { copyTextToClipboard, tableElementToTsv } from "./lib/clipboard";
|
package/dist/index.js
CHANGED
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
Thumbnail,
|
|
81
81
|
TimelineRow,
|
|
82
82
|
TurnSummary,
|
|
83
|
+
UserMessageBody,
|
|
83
84
|
answersFromDrafts,
|
|
84
85
|
applyPatchOps,
|
|
85
86
|
applyPatchOpsFromToolItem,
|
|
@@ -108,8 +109,9 @@ import {
|
|
|
108
109
|
useLightbox,
|
|
109
110
|
useLightboxOptional,
|
|
110
111
|
useThemeType,
|
|
112
|
+
userMessageLikelyNeedsDisclosure,
|
|
111
113
|
v4aToGitFileDiff
|
|
112
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-LGVMUIRV.js";
|
|
113
115
|
import "./chunk-VCBFUSUZ.js";
|
|
114
116
|
import {
|
|
115
117
|
buildTimeline,
|
|
@@ -171,7 +173,7 @@ import {
|
|
|
171
173
|
useSlashCommands,
|
|
172
174
|
useTranscription,
|
|
173
175
|
useVoiceInput
|
|
174
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-3PB7MIT6.js";
|
|
175
177
|
import {
|
|
176
178
|
FILE_ONLY_MESSAGE_TEXT,
|
|
177
179
|
composeSendInput,
|
|
@@ -192,7 +194,7 @@ import {
|
|
|
192
194
|
PickerBackHeader,
|
|
193
195
|
PickerNavRow,
|
|
194
196
|
defaultModelPolicyPickerMessages
|
|
195
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-FGZUCXZF.js";
|
|
196
198
|
import {
|
|
197
199
|
useOpenGeni,
|
|
198
200
|
useOpenGeniClient
|
|
@@ -8358,7 +8360,7 @@ function isCodexAccountEvent(event) {
|
|
|
8358
8360
|
}
|
|
8359
8361
|
var EMPTY_SETTINGS = {
|
|
8360
8362
|
rotationEnabled: false,
|
|
8361
|
-
rotationStrategy: "
|
|
8363
|
+
rotationStrategy: "sharded",
|
|
8362
8364
|
activeCredentialId: null
|
|
8363
8365
|
};
|
|
8364
8366
|
var EMPTY_STATE = {
|
|
@@ -8537,6 +8539,7 @@ export {
|
|
|
8537
8539
|
TooltipProvider,
|
|
8538
8540
|
TooltipTrigger,
|
|
8539
8541
|
TurnSummary,
|
|
8542
|
+
UserMessageBody,
|
|
8540
8543
|
VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS,
|
|
8541
8544
|
VOICE_RECORDING_OWNER_HEARTBEAT_MILLISECONDS,
|
|
8542
8545
|
VOICE_RECORDING_OWNER_STALE_MILLISECONDS,
|
|
@@ -8695,6 +8698,7 @@ export {
|
|
|
8695
8698
|
useWorkspaceModelCatalog,
|
|
8696
8699
|
useWorkspaceSessions,
|
|
8697
8700
|
useWorkspaces,
|
|
8701
|
+
userMessageLikelyNeedsDisclosure,
|
|
8698
8702
|
v4aToGitFileDiff,
|
|
8699
8703
|
xtermThemeFromTokens
|
|
8700
8704
|
};
|