@opengeni/react 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +21 -1
  2. package/dist/artifacts.js +2 -2
  3. package/dist/artifacts.js.map +1 -1
  4. package/dist/{chunk-ERGYJIBB.js → chunk-AWZLIMKX.js} +2 -2
  5. package/dist/{chunk-ERGYJIBB.js.map → chunk-AWZLIMKX.js.map} +1 -1
  6. package/dist/{chunk-FZCP527Y.js → chunk-CJUO7J5Z.js} +2 -2
  7. package/dist/{chunk-742CZ3L3.js → chunk-H5X55XH7.js} +16 -200
  8. package/dist/chunk-H5X55XH7.js.map +1 -0
  9. package/dist/{chunk-PGSX7UCP.js → chunk-LJ2UTJJE.js} +1369 -785
  10. package/dist/chunk-LJ2UTJJE.js.map +1 -0
  11. package/dist/{chunk-CY7WK5FD.js → chunk-LN6TCXD3.js} +22 -1
  12. package/dist/chunk-LN6TCXD3.js.map +1 -0
  13. package/dist/{chunk-TMYGL6X5.js → chunk-MBMPHOMA.js} +71 -6
  14. package/dist/chunk-MBMPHOMA.js.map +1 -0
  15. package/dist/{chunk-RC6BZ44Q.js → chunk-OA6HFRQP.js} +2 -2
  16. package/dist/{chunk-WWEUO2PL.js → chunk-WZMYFJD3.js} +190 -11
  17. package/dist/chunk-WZMYFJD3.js.map +1 -0
  18. package/dist/components/composer-transcription-control.d.ts +3 -0
  19. package/dist/components/open-geni-chat.d.ts +6 -2
  20. package/dist/components/session-conversation.d.ts +25 -19
  21. package/dist/components/session-list.d.ts +4 -1
  22. package/dist/components/tool-action-review.d.ts +29 -2
  23. package/dist/components/tool-review-history.d.ts +8 -4
  24. package/dist/composer.js +1 -1
  25. package/dist/connect.js +1 -1
  26. package/dist/hooks/use-client-config-flags.d.ts +37 -0
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +21 -11
  29. package/dist/index.js.map +1 -1
  30. package/dist/{latest-question-YTOBHCWR.js → latest-question-GPYM2JNU.js} +3 -3
  31. package/dist/realtime/realtime-control.d.ts +2 -0
  32. package/dist/realtime.js +25 -4
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/session-capability-policy.d.ts +20 -1
  35. package/dist/session-ui.js +6 -6
  36. package/dist/session.js +6 -6
  37. package/dist/timeline/index.d.ts +2 -0
  38. package/dist/timeline/retained-loaders.d.ts +27 -0
  39. package/package.json +3 -3
  40. package/src/components/approval-surface.tsx +190 -79
  41. package/src/components/artifacts/session-artifact-viewer.tsx +4 -2
  42. package/src/components/composer-transcription-control.tsx +14 -0
  43. package/src/components/composer.tsx +1 -0
  44. package/src/components/open-geni-chat.tsx +53 -13
  45. package/src/components/session-conversation.tsx +229 -63
  46. package/src/components/session-list.tsx +9 -2
  47. package/src/components/tool-action-review.tsx +502 -239
  48. package/src/components/tool-review-history.tsx +18 -43
  49. package/src/hooks/use-client-config-flags.ts +102 -0
  50. package/src/hooks/use-session-events.ts +19 -16
  51. package/src/hooks/use-transcription.ts +6 -0
  52. package/src/hooks/use-voice-input.ts +6 -0
  53. package/src/index.ts +9 -0
  54. package/src/realtime/realtime-control.tsx +28 -1
  55. package/src/session-capability-policy.ts +119 -6
  56. package/src/timeline/index.ts +10 -0
  57. package/src/timeline/retained-loaders.ts +86 -0
  58. package/src/timeline/tool-display-name.ts +5 -1
  59. package/src/timeline/tool-renderers.tsx +143 -10
  60. package/styles/compiled.css +65 -21
  61. package/styles/tokens.css +1 -1
  62. package/dist/chunk-742CZ3L3.js.map +0 -1
  63. package/dist/chunk-CY7WK5FD.js.map +0 -1
  64. package/dist/chunk-PGSX7UCP.js.map +0 -1
  65. package/dist/chunk-TMYGL6X5.js.map +0 -1
  66. package/dist/chunk-WWEUO2PL.js.map +0 -1
  67. /package/dist/{chunk-FZCP527Y.js.map → chunk-CJUO7J5Z.js.map} +0 -0
  68. /package/dist/{chunk-RC6BZ44Q.js.map → chunk-OA6HFRQP.js.map} +0 -0
  69. /package/dist/{latest-question-YTOBHCWR.js.map → latest-question-GPYM2JNU.js.map} +0 -0
@@ -1,7 +1,29 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
1
2
  import type { ToolActionReview, ToolReviewDetailsPage } from "@opengeni/sdk";
2
3
  export type ToolReviewDetailsLoader = (review: ToolActionReview, path: string, offset: number) => Promise<ToolReviewDetailsPage>;
4
+ type Tone = "waiting" | "ok" | "failed" | "muted";
5
+ /** Shown when an older request's saved values are gone: approval is impossible, decline is not. */
6
+ export declare const UNRECOVERABLE_TEXT = "The details of this older request couldn't be recovered, so it can't be approved. Decline it to let the agent continue.";
7
+ /** Card chrome shared by the review, its loading state and its load failure. */
8
+ export declare function ToolReviewFrame({ tone, icon, eyebrow, title, titleId, subtitle, children, footer, bare, ...rest }: {
9
+ tone: Tone;
10
+ icon: ReactNode;
11
+ eyebrow: ReactNode;
12
+ title: ReactNode;
13
+ titleId?: string | undefined;
14
+ subtitle?: ReactNode;
15
+ children?: ReactNode;
16
+ footer?: ReactNode;
17
+ bare?: boolean | undefined;
18
+ } & Omit<HTMLAttributes<HTMLElement>, "title">): import("react").JSX.Element;
19
+ export declare function DeclineButton({ busy, submitting, label, onClick, }: {
20
+ busy: boolean;
21
+ submitting: boolean;
22
+ label?: string | undefined;
23
+ onClick: () => void;
24
+ }): import("react").JSX.Element;
3
25
  /** One host-neutral review. All callbacks refer to the immutable action; none can edit it. */
4
- export declare function ToolActionReviewCard({ review, onApprove, onReject, submitting, disabled, onViewDetails, pendingLabel, rejectLabel, }: {
26
+ export declare function ToolActionReviewCard({ review, onApprove, onReject, submitting, disabled, onViewDetails, pendingLabel, rejectLabel, bare, }: {
5
27
  review: ToolActionReview;
6
28
  onApprove?: (() => void) | undefined;
7
29
  onReject?: (() => void) | undefined;
@@ -10,11 +32,16 @@ export declare function ToolActionReviewCard({ review, onApprove, onReject, subm
10
32
  onViewDetails?: ((path: string) => void) | undefined;
11
33
  pendingLabel?: string | undefined;
12
34
  rejectLabel?: string | undefined;
35
+ /** Render without card chrome, e.g. inside an expanded timeline row. */
36
+ bare?: boolean | undefined;
13
37
  }): import("react").JSX.Element;
14
38
  /** Full-page detail content: hosts choose navigation, never a nested scrolling panel. */
15
- export declare function ToolActionReviewDetails({ review, path: initialPath, load, onBack, }: {
39
+ export declare function ToolActionReviewDetails({ review, path: initialPath, load, onBack, manageFocus, }: {
16
40
  review: ToolActionReview;
17
41
  path?: string;
18
42
  load: ToolReviewDetailsLoader;
19
43
  onBack: () => void;
44
+ /** Hosts rendering simultaneous previews can retain their own focus. */
45
+ manageFocus?: boolean;
20
46
  }): import("react").JSX.Element;
47
+ export {};
@@ -14,8 +14,12 @@ export declare function ToolReviewHistoryProvider({ events, load, onViewDetails,
14
14
  children: ReactNode;
15
15
  }): import("react").JSX.Element;
16
16
  export declare function useHasToolReview(approvalId: string | null): boolean;
17
- /** Recorded calls have details, never another decision button. */
18
- export declare function ToolReviewHistoryReceipt({ approvalId }: {
19
- approvalId: string;
20
- }): import("react").JSX.Element | null;
17
+ /**
18
+ * The saved review for one recorded call, or null while it loads or when it is
19
+ * unavailable (callers then keep their ordinary tool row).
20
+ */
21
+ export declare function useRecordedToolReview(approvalId: string | null): {
22
+ review: ToolActionReview | null;
23
+ onViewDetails: ((path: string) => void) | undefined;
24
+ };
21
25
  export {};
package/dist/composer.js CHANGED
@@ -41,7 +41,7 @@ import {
41
41
  useChatComposer,
42
42
  useChatComposerController,
43
43
  useVoiceInput
44
- } from "./chunk-CY7WK5FD.js";
44
+ } from "./chunk-LN6TCXD3.js";
45
45
  import "./chunk-RSI7XYXL.js";
46
46
  import "./chunk-BRM6FVZA.js";
47
47
  import {
package/dist/connect.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  McpConnectionCard,
4
4
  mcpConnectionDiscoveryState,
5
5
  useConnect
6
- } from "./chunk-TMYGL6X5.js";
6
+ } from "./chunk-MBMPHOMA.js";
7
7
  import {
8
8
  Markdown
9
9
  } from "./chunk-I7IWRQLN.js";
@@ -0,0 +1,37 @@
1
+ import type { ClientVoiceInputConfig, ReasoningEffort } from "@opengeni/sdk";
2
+ /** The client-config fields the stock conversation and chat read. */
3
+ export type ClientConfigFlagsSource = {
4
+ getClientConfig: () => Promise<{
5
+ fileUploads?: {
6
+ enabled?: boolean;
7
+ };
8
+ modelSelection?: boolean | undefined;
9
+ sandboxFiles?: boolean | undefined;
10
+ defaultReasoningEffort?: ReasoningEffort | undefined;
11
+ artifacts?: unknown;
12
+ sessionCreation?: boolean | undefined;
13
+ archive?: boolean | undefined;
14
+ voiceInput?: ClientVoiceInputConfig | undefined;
15
+ }>;
16
+ };
17
+ export type ClientConfigFlags = {
18
+ /** Whether the config has loaded. Proxy capability flags stay `true` until it says otherwise. */
19
+ loaded: boolean;
20
+ uploads: boolean;
21
+ modelSelection: boolean;
22
+ sandboxFiles: boolean;
23
+ defaultReasoningEffort: ReasoningEffort | null;
24
+ /**
25
+ * Inline Site previews and the artifact viewer. `false` only when a session
26
+ * proxy says it does not serve them; native deployments omit the flag.
27
+ */
28
+ artifacts: boolean;
29
+ /** Browser chat creation. `false` only when a session proxy has no `createSession` hook. */
30
+ sessionCreation: boolean;
31
+ /** Chat archive/restore. `false` only when a session proxy disables it. */
32
+ archive: boolean;
33
+ /** Native voice input when the deployment can transcribe, else null. */
34
+ voiceInput: ClientVoiceInputConfig | null;
35
+ };
36
+ /** Deployment and session-proxy capabilities from the client config. */
37
+ export declare function useClientConfigFlags(client: Partial<ClientConfigFlagsSource> | ClientConfigFlagsSource): ClientConfigFlags;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { sessionAuthRecommendation } from "./session-auth-recommendation.js";
2
2
  export { SessionConnectionRequest, type SessionConnectionRequestProps, } from "./components/session-connection-request.js";
3
3
  export { SessionMcpCapabilityCard, McpConnectionCard, type McpConnectionCardProps, type SessionMcpCapabilityCardProps, } from "./components/session-mcp-capability-card.js";
4
4
  export { SessionCapabilityFrame, type SessionCapabilityFrameProps, } from "./components/session-capability-frame.js";
5
- export { attachSessionCapability, completeSessionCapabilityOAuth, } from "./session-capability-policy.js";
5
+ export { attachSessionCapability, completeSessionCapabilityOAuth, prepareSessionCapabilityAccess, applySessionCapabilityAccess, type SessionCapabilityAccessPlan, } from "./session-capability-policy.js";
6
6
  export { retainedImageId } from "./components/markdown.js";
7
7
  export type { EmbeddedBrowserInteractionClientLike, EmbeddedComputerInteractionClientLike, EmbeddedFileAttachmentClientLike, EmbeddedGoalClientLike, EmbeddedHumanInputSessionClientLike, EmbeddedInteractionClientLike, EmbeddedSessionEventClientLike, EmbeddedSessionLineageClientLike, EmbeddedSessionMcpApprovalPolicyClientLike, EmbeddedSessionReadClientLike, EmbeddedSessionClientLike, SessionClientLike, } from "./client.js";
8
8
  export { OpenGeniProvider } from "./provider.js";
@@ -104,8 +104,8 @@ export { HumanInputSurface } from "./components/human-input-surface.js";
104
104
  export type { HumanInputSurfaceProps } from "./components/human-input-surface.js";
105
105
  export { buildTimeline, creditExhaustedFromEvents, extractSessionRef, groupTimeline, sessionStatusFromEvents, toolDisplayName, } from "./timeline/index.js";
106
106
  export type { GroupTimelineOptions, ActivityItem, AgentMessageItem, AuthNeededItem, ContextCompactionItem, GoalItem, HumanInputAnswerSummary, HumanInputItem, MachineInputBatchItem, MachineInputMember, NoticeItem, ReasoningItem, SandboxItem, SessionStatusItem, TimelineGroup, TimelineItem, TurnEndItem, ToolCallItem, UserMessageItem, WorkerItem, } from "./timeline/index.js";
107
- export { createDefaultToolRegistry, createToolRegistry, defaultToolRegistry, rawTypeOf, } from "./timeline/index.js";
108
- export type { CreateToolRegistryOptions, RetainedArtifactLoader, RetainedScreenshotLoader, VideoArtifactPlaybackLoader, ToolRegistry, ToolRegistryEntry, ToolRenderer, ToolRendererProps, } from "./timeline/index.js";
107
+ export { createDefaultToolRegistry, createSessionRetainedScreenshotLoader, createToolRegistry, createWorkspaceRetainedArtifactLoader, createWorkspaceRetainedVideoLoader, defaultToolRegistry, rawTypeOf, } from "./timeline/index.js";
108
+ export type { CreateToolRegistryOptions, RetainedArtifactLoader, RetainedArtifactLoaderClient, RetainedScreenshotLoader, RetainedScreenshotLoaderClient, RetainedVideoLoaderClient, VideoArtifactPlaybackLoader, ToolRegistry, ToolRegistryEntry, ToolRenderer, ToolRendererProps, } from "./timeline/index.js";
109
109
  export { ActivityDisclosure, ActivityRail, BodyNote, DisclosureDefaultsProvider, LightboxProvider, MediaEmpty, MediaSkeleton, PayloadBlock, ScreenshotFigure, TermBlock, Thumbnail, TurnSummary, BUILT_IN_TURN_SUMMARY_FACET_IDS, useLightbox, useLightboxOptional, } from "./timeline/index.js";
110
110
  export type { ActivityDisclosureProps, ActivityRailProps, DisclosureChip, BuiltInTurnSummaryFacetId, TurnOutcome, TurnSummaryContext, TurnSummaryFacet, TurnSummaryFacetConfiguration, TurnSummaryFacetResult, TurnSummaryOptions, TurnSummaryProps, TurnSummaryStatus, LightboxControlLabels, } from "./timeline/index.js";
111
111
  export { applyPatchOps, applyPatchOpsFromToolItem, controlCaret, execTruncated, isApplyPatch, isExecSessionLostBanner, looksBinary, parseExecBannerSessionId, parseFreeformApplyPatch, parseToolArgs, sandboxCommandExitCode, stripExecBanner, tailPeek, unwrapMcpOutput, v4aToGitFileDiff, } from "./timeline/index.js";
package/dist/index.js CHANGED
@@ -11,13 +11,11 @@ import {
11
11
  } from "./chunk-YM2DE7BQ.js";
12
12
  import {
13
13
  createEmbeddedSessionClient,
14
- isGoalEvent,
15
14
  isLineageRefreshEvent,
16
15
  isSessionMcpApprovalPolicyEvent,
17
- useGoal,
18
16
  useSessionLineage,
19
17
  useSessionMcpApprovalPolicy
20
- } from "./chunk-742CZ3L3.js";
18
+ } from "./chunk-H5X55XH7.js";
21
19
  import {
22
20
  CONNECTION_STATUS_META,
23
21
  ConnectionDot,
@@ -82,7 +80,10 @@ import {
82
80
  applyPatchOpsFromToolItem,
83
81
  controlCaret,
84
82
  createDefaultToolRegistry,
83
+ createSessionRetainedScreenshotLoader,
85
84
  createToolRegistry,
85
+ createWorkspaceRetainedArtifactLoader,
86
+ createWorkspaceRetainedVideoLoader,
86
87
  defaultApprovalSurfaceMessages,
87
88
  defaultHumanInputFormMessages,
88
89
  defaultToolRegistry,
@@ -110,14 +111,14 @@ import {
110
111
  useWorkspaceSessions,
111
112
  userMessageLikelyNeedsDisclosure,
112
113
  v4aToGitFileDiff
113
- } from "./chunk-PGSX7UCP.js";
114
+ } from "./chunk-LJ2UTJJE.js";
114
115
  import {
115
116
  useThemeType
116
117
  } from "./chunk-UK4TINKT.js";
117
118
  import "./chunk-J2QWVSQY.js";
118
119
  import "./chunk-C5X5AJXK.js";
119
120
  import "./chunk-ZYRGEKWS.js";
120
- import "./chunk-FZCP527Y.js";
121
+ import "./chunk-CJUO7J5Z.js";
121
122
  import {
122
123
  ArtifactLabelsProvider,
123
124
  DEFAULT_ARTIFACT_LABELS
@@ -132,28 +133,30 @@ import {
132
133
  conversationTimeline,
133
134
  createOlderHistoryLoadReceipt,
134
135
  humanInputRequestFromEvent,
136
+ isGoalEvent,
135
137
  isHumanInputEvent,
136
138
  isTitleEvent,
137
139
  isTurnQueueEvent,
138
140
  projectPendingApprovals,
139
141
  projectPendingHumanInputRequests,
140
142
  useFileAttachments,
143
+ useGoal,
141
144
  useHumanInputRequests,
142
145
  useSession,
143
146
  useSessionControl,
144
147
  useSessionEvents,
145
148
  useTurnQueue
146
- } from "./chunk-WWEUO2PL.js";
149
+ } from "./chunk-WZMYFJD3.js";
147
150
  import {
148
151
  buildTimeline,
149
152
  creditExhaustedFromEvents,
150
153
  extractSessionRef,
151
154
  groupTimeline,
152
155
  sessionStatusFromEvents
153
- } from "./chunk-RC6BZ44Q.js";
156
+ } from "./chunk-OA6HFRQP.js";
154
157
  import {
155
158
  toolDisplayName
156
- } from "./chunk-ERGYJIBB.js";
159
+ } from "./chunk-AWZLIMKX.js";
157
160
  import {
158
161
  OpenGeniProvider
159
162
  } from "./chunk-3CTRFMAK.js";
@@ -161,9 +164,11 @@ import {
161
164
  McpConnectionCard,
162
165
  SessionCapabilityFrame,
163
166
  SessionMcpCapabilityCard,
167
+ applySessionCapabilityAccess,
164
168
  attachSessionCapability,
165
- completeSessionCapabilityOAuth
166
- } from "./chunk-TMYGL6X5.js";
169
+ completeSessionCapabilityOAuth,
170
+ prepareSessionCapabilityAccess
171
+ } from "./chunk-MBMPHOMA.js";
167
172
  import {
168
173
  ActivityDisclosure,
169
174
  BodyNote,
@@ -238,7 +243,7 @@ import {
238
243
  useSlashCommands,
239
244
  useTranscription,
240
245
  useVoiceInput
241
- } from "./chunk-CY7WK5FD.js";
246
+ } from "./chunk-LN6TCXD3.js";
242
247
  import {
243
248
  FILE_ONLY_MESSAGE_TEXT,
244
249
  composeSendInput,
@@ -5054,6 +5059,7 @@ export {
5054
5059
  appendFinalTranscript,
5055
5060
  applyPatchOps,
5056
5061
  applyPatchOpsFromToolItem,
5062
+ applySessionCapabilityAccess,
5057
5063
  approvalsFromRequiresAction,
5058
5064
  argHint,
5059
5065
  attachSessionCapability,
@@ -5075,8 +5081,11 @@ export {
5075
5081
  createDefaultToolRegistry,
5076
5082
  createEmbeddedSessionClient,
5077
5083
  createOlderHistoryLoadReceipt,
5084
+ createSessionRetainedScreenshotLoader,
5078
5085
  createToolRegistry,
5079
5086
  createVoiceRecordingManifest,
5087
+ createWorkspaceRetainedArtifactLoader,
5088
+ createWorkspaceRetainedVideoLoader,
5080
5089
  creditExhaustedFromEvents,
5081
5090
  defaultApprovalSurfaceMessages,
5082
5091
  defaultChatComposerMessages,
@@ -5138,6 +5147,7 @@ export {
5138
5147
  payerSummaryForModel,
5139
5148
  planVoiceRecordingChunkCommit,
5140
5149
  pointsFor,
5150
+ prepareSessionCapabilityAccess,
5141
5151
  prepareVoiceRecordingChunk,
5142
5152
  presentFailure,
5143
5153
  projectClientModelRows,