@opengeni/react 1.2.1-canary.37222177070001 → 1.3.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.
- package/README.md +31 -0
- package/dist/{chunk-4OTO7KBK.js → chunk-PGSX7UCP.js} +2062 -1489
- package/dist/chunk-PGSX7UCP.js.map +1 -0
- package/dist/{chunk-X34BSY2R.js → chunk-WWEUO2PL.js} +60 -60
- package/dist/chunk-WWEUO2PL.js.map +1 -0
- package/dist/components/approval-surface.d.ts +11 -13
- package/dist/components/open-geni-chat.d.ts +21 -6
- package/dist/components/session-conversation.d.ts +18 -1
- package/dist/components/session-proxy-scope.d.ts +16 -2
- package/dist/components/tool-action-review.d.ts +20 -0
- package/dist/components/tool-review-history.d.ts +21 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/session-ui.d.ts +4 -1
- package/dist/session-ui.js +8 -2
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +1 -1
- package/package.json +3 -3
- package/src/components/approval-surface.tsx +263 -245
- package/src/components/open-geni-chat.tsx +197 -64
- package/src/components/session-conversation.tsx +26 -7
- package/src/components/session-proxy-scope.tsx +47 -7
- package/src/components/tool-action-review.tsx +386 -0
- package/src/components/tool-review-history.tsx +113 -0
- package/src/index.ts +9 -1
- package/src/session-ui.ts +9 -1
- package/src/timeline/tool-renderers.tsx +7 -0
- package/styles/compiled.css +33 -13
- package/dist/chunk-4OTO7KBK.js.map +0 -1
- package/dist/chunk-X34BSY2R.js.map +0 -1
package/README.md
CHANGED
|
@@ -98,6 +98,14 @@ import "@opengeni/react/compiled.css";
|
|
|
98
98
|
// or one conversation: <SessionConversation baseUrl="/api/opengeni" sessionId={sessionId} />
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
Bearer-token apps pass `headers` (a function runs per request) or a custom
|
|
102
|
+
`fetch`; a `client` passed with `baseUrl` replaces the one the component
|
|
103
|
+
creates:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<OpenGeniChat baseUrl="/api/opengeni" headers={() => ({ Authorization: `Bearer ${getToken()}` })} />
|
|
107
|
+
```
|
|
108
|
+
|
|
101
109
|
The provider form keeps working, for example for several components sharing one
|
|
102
110
|
client or the headless hooks:
|
|
103
111
|
|
|
@@ -1383,3 +1391,26 @@ Copy and the timestamp for user messages and completed assistant messages.
|
|
|
1383
1391
|
The host owns feedback, fork authorization, and mutations; streaming assistant
|
|
1384
1392
|
messages omit this slot. Use the `group/copy` hover/focus state and preserve
|
|
1385
1393
|
visible touch targets when styling actions.
|
|
1394
|
+
|
|
1395
|
+
### Portable action reviews
|
|
1396
|
+
|
|
1397
|
+
`ApprovalSurface` accepts `loadReview(approval)` and `onViewDetails(review, path)`;
|
|
1398
|
+
load the versioned facts with `client.getToolActionReview`. It shows one selected
|
|
1399
|
+
action, counts and bounded fields instead of raw argument JSON. Keep
|
|
1400
|
+
`selectedApprovalId` and `onSelectedApprovalChange` in the host if a full-page
|
|
1401
|
+
detail route unmounts the surface, so returning cannot silently select a different
|
|
1402
|
+
action. The native `onApprove` / `onReject` identity is unchanged and duplicate
|
|
1403
|
+
submission is fenced until authoritative events remove the request.
|
|
1404
|
+
|
|
1405
|
+
Render `ToolActionReviewDetails` on the host's normal page with
|
|
1406
|
+
`client.getToolReviewDetails`, passing the review's `actionDigest`, path and offset.
|
|
1407
|
+
Details are immutable, authenticated, paginated, and redact protected values.
|
|
1408
|
+
Restore focus to the original `data-review-path` button on return. No web-app
|
|
1409
|
+
imports, iframe, second confirmation, or nested scrolling pane is required.
|
|
1410
|
+
The standalone fallback retains bounded details for older SDK approvals.
|
|
1411
|
+
|
|
1412
|
+
Wrap `MessageTimeline` in `ToolReviewHistoryProvider` with its visible events,
|
|
1413
|
+
authenticated `load(approvalId)` callback and `onViewDetails` to keep recorded
|
|
1414
|
+
reviews readable inside the corresponding tool activity. Historical receipts
|
|
1415
|
+
never render decision buttons. The same semantic tokens support light/dark
|
|
1416
|
+
embeds; `demo/approval-review.html` is the synthetic state gallery.
|