@opengeni/react 7.0.0 → 7.1.0-canary.35916963870001

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 (68) hide show
  1. package/README.md +34 -0
  2. package/dist/approvals.d.ts +2 -1
  3. package/dist/{chunk-D5NOQPLR.js → chunk-CJCVYUKK.js} +25 -15
  4. package/dist/chunk-CJCVYUKK.js.map +1 -0
  5. package/dist/{chunk-IYUPN32E.js → chunk-DBPVUGQT.js} +6 -1
  6. package/dist/{chunk-IYUPN32E.js.map → chunk-DBPVUGQT.js.map} +1 -1
  7. package/dist/{chunk-JKLGJQO5.js → chunk-HJDDS2L6.js} +35 -15
  8. package/dist/chunk-HJDDS2L6.js.map +1 -0
  9. package/dist/{chunk-5GAL23FF.js → chunk-IOLPHOF4.js} +2 -5
  10. package/dist/chunk-IOLPHOF4.js.map +1 -0
  11. package/dist/{chunk-D7GAPJ3V.js → chunk-RAJYEBEG.js} +63 -30
  12. package/dist/chunk-RAJYEBEG.js.map +1 -0
  13. package/dist/{chunk-IP4BUBKH.js → chunk-TA4W6KBP.js} +24 -13
  14. package/dist/chunk-TA4W6KBP.js.map +1 -0
  15. package/dist/{chunk-UXE5SSNN.js → chunk-U56XI627.js} +2 -2
  16. package/dist/{chunk-JPHDWKZE.js → chunk-X7YDBAQD.js} +12 -7
  17. package/dist/chunk-X7YDBAQD.js.map +1 -0
  18. package/dist/{chunk-HJ5VJ4JB.js → chunk-ZA4K7YY2.js} +73 -15
  19. package/dist/chunk-ZA4K7YY2.js.map +1 -0
  20. package/dist/components/markdown.d.ts +2 -0
  21. package/dist/components/model-policy-picker.d.ts +17 -1
  22. package/dist/components/session-conversation.d.ts +3 -0
  23. package/dist/composer.d.ts +1 -1
  24. package/dist/composer.js +4 -4
  25. package/dist/connect.js +1 -1
  26. package/dist/hooks/use-session-events.d.ts +6 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +10 -13
  29. package/dist/index.js.map +1 -1
  30. package/dist/machines.js +1 -1
  31. package/dist/{model-policy-picker-menu-RVOQ4ZZG.js → model-policy-picker-menu-S3SF65AH.js} +4 -4
  32. package/dist/model-policy.js +1 -1
  33. package/dist/realtime.js +2 -2
  34. package/dist/session-ui.js +6 -6
  35. package/dist/session.js +2 -2
  36. package/dist/timeline/tool-display-name.d.ts +2 -1
  37. package/dist/timeline/types.d.ts +2 -1
  38. package/package.json +3 -3
  39. package/src/approvals.ts +8 -1
  40. package/src/components/approval-surface.tsx +12 -2
  41. package/src/components/machine-card.tsx +5 -5
  42. package/src/components/machine-dock-bar.tsx +1 -1
  43. package/src/components/machines/machine-detail.tsx +5 -2
  44. package/src/components/markdown.tsx +101 -55
  45. package/src/components/model-policy-picker-menu.tsx +131 -33
  46. package/src/components/model-policy-picker.tsx +61 -12
  47. package/src/components/session-commands-panel.tsx +8 -3
  48. package/src/components/session-conversation.tsx +5 -1
  49. package/src/composer.ts +1 -0
  50. package/src/hooks/use-last-started-turn-policy.ts +3 -7
  51. package/src/hooks/use-session-events.ts +32 -7
  52. package/src/index.ts +1 -0
  53. package/src/model-policy.ts +1 -4
  54. package/src/timeline/projection.ts +4 -0
  55. package/src/timeline/rolling-activity.tsx +4 -2
  56. package/src/timeline/tool-display-name.ts +8 -6
  57. package/src/timeline/tool-renderers.tsx +5 -3
  58. package/src/timeline/types.ts +2 -0
  59. package/styles/compiled.css +15 -0
  60. package/dist/chunk-5GAL23FF.js.map +0 -1
  61. package/dist/chunk-D5NOQPLR.js.map +0 -1
  62. package/dist/chunk-D7GAPJ3V.js.map +0 -1
  63. package/dist/chunk-HJ5VJ4JB.js.map +0 -1
  64. package/dist/chunk-IP4BUBKH.js.map +0 -1
  65. package/dist/chunk-JKLGJQO5.js.map +0 -1
  66. package/dist/chunk-JPHDWKZE.js.map +0 -1
  67. /package/dist/{chunk-UXE5SSNN.js.map → chunk-U56XI627.js.map} +0 -0
  68. /package/dist/{model-policy-picker-menu-RVOQ4ZZG.js.map → model-policy-picker-menu-S3SF65AH.js.map} +0 -0
package/README.md CHANGED
@@ -681,6 +681,10 @@ state remains application-owned; durable draft and session state remain in
681
681
  callback return type. Custom loaders can use `createOlderHistoryLoadReceipt`
682
682
  and call `markCommitted` immediately before publishing their accepted older
683
683
  window.
684
+ - Browser retention limits are exported as `SESSION_EVENT_BROWSER_MAX_BYTES`
685
+ and `SESSION_EVENT_BROWSER_MAX_COUNT`; they do not change fetch page sizes.
686
+ Live appends reuse the retained window's byte total, measuring only incoming
687
+ and evicted events. History still pages when either retention limit is reached.
684
688
  - Newer history uses `hasNewer`, `loadingNewer`, and `loadNewer`. A failed
685
689
  `loadNewer()` preserves the retained events and cursors, exposes the original
686
690
  failure through `error`, and still rejects for the caller to handle. Pass
@@ -987,6 +991,36 @@ can translate its search, current-selection, empty-result, attachment-warning, a
987
991
  thinking labels through `messages`, and override payment descriptions through
988
992
  `messages.billingHints`.
989
993
 
994
+ Hosts can rebrand the full picker without replacing its interaction logic:
995
+
996
+ ```tsx
997
+ <ModelPolicyPicker
998
+ {...pickerProps}
999
+ groupPresentation={{
1000
+ opengeni_credits: {
1001
+ label: "Acme Assist",
1002
+ icon: <AcmeMark aria-hidden="true" />,
1003
+ description: "Provided by your workspace",
1004
+ },
1005
+ codex_subscription: { description: null },
1006
+ }}
1007
+ />
1008
+ ```
1009
+
1010
+ `groupPresentation` is a partial map keyed by `PickerBillingClass`. Labels apply
1011
+ to group headings, search, and trigger-icon accessibility. Icons apply to both
1012
+ the menu and trigger; supply decorative, non-interactive content (SVG or image)
1013
+ that fits the existing 14px slot. Explicit `null` hides an icon or description;
1014
+ omitted fields retain defaults. Descriptions override `messages.billingHints`,
1015
+ can also be shown for the deployment-provided group, and are searchable. Existing
1016
+ `rows[].billingClassLabel` remains the fallback when no label override is supplied.
1017
+ This is presentation only: model IDs, billing, ordering, availability and callbacks
1018
+ are unchanged. The type `ModelPolicyPickerGroupPresentation` is exported from
1019
+ both `@opengeni/react` and `@opengeni/react/composer`. The native `ModelPicker`
1020
+ is a separate control; this API targets the full `ModelPolicyPicker` shown above.
1021
+
1022
+ For a rendered example, open the composer-responsive demo with `?branding=host`.
1023
+
990
1024
  Subscription descriptions appear once per provider group. Free models carry a
991
1025
  Free badge. Pass `hasImageAttachments` for the current draft to show an image
992
1026
  compatibility warning only when the selected model cannot view those images.
@@ -1,9 +1,10 @@
1
- import type { SessionEvent } from "@opengeni/sdk";
1
+ import { type ToolDisplayMetadata, type SessionEvent } from "@opengeni/sdk";
2
2
  export type PendingApproval = {
3
3
  /** The id to send back via `user.approvalDecision` (`approvalId`). */
4
4
  id: string;
5
5
  /** Tool/function name awaiting the decision. */
6
6
  name: string;
7
+ display?: ToolDisplayMetadata;
7
8
  arguments?: unknown;
8
9
  /** The raw approval entry from the `session.requiresAction` payload. */
9
10
  raw?: unknown;
@@ -28,7 +28,7 @@ import {
28
28
  useForcedDefaultOpen,
29
29
  useTimelineSearchNavigation,
30
30
  useTimelineSearchReveal
31
- } from "./chunk-D7GAPJ3V.js";
31
+ } from "./chunk-RAJYEBEG.js";
32
32
  import {
33
33
  Actions,
34
34
  AttachButton,
@@ -51,7 +51,7 @@ import {
51
51
  Status,
52
52
  Surface,
53
53
  useChatComposerController
54
- } from "./chunk-UXE5SSNN.js";
54
+ } from "./chunk-U56XI627.js";
55
55
  import {
56
56
  LightboxProvider,
57
57
  Tooltip,
@@ -65,7 +65,7 @@ import {
65
65
  } from "./chunk-WYWRYUNQ.js";
66
66
  import {
67
67
  ModelPolicyPicker
68
- } from "./chunk-IP4BUBKH.js";
68
+ } from "./chunk-TA4W6KBP.js";
69
69
  import {
70
70
  buildTimeline,
71
71
  conversationTimeline,
@@ -78,7 +78,7 @@ import {
78
78
  useSession,
79
79
  useSessionEvents,
80
80
  useTurnQueue
81
- } from "./chunk-JKLGJQO5.js";
81
+ } from "./chunk-HJDDS2L6.js";
82
82
  import {
83
83
  useComposer
84
84
  } from "./chunk-AKOMC3VO.js";
@@ -100,7 +100,7 @@ import {
100
100
  import {
101
101
  projectPickerRows,
102
102
  sortPickerRows
103
- } from "./chunk-5GAL23FF.js";
103
+ } from "./chunk-IOLPHOF4.js";
104
104
  import {
105
105
  cn
106
106
  } from "./chunk-22KP6LR5.js";
@@ -857,7 +857,7 @@ var defaultApprovalSurfaceMessages = {
857
857
  reject: "Reject",
858
858
  approving: "Approving\u2026",
859
859
  rejecting: "Rejecting\u2026",
860
- formatToolName: (name) => name.replaceAll("_", " ").replaceAll(".", " \u203A ")
860
+ formatToolName: (name) => name.includes("__") || /^[a-f0-9]{64}$/.test(name) ? toolDisplayName(name) : name.replaceAll("_", " ").replaceAll(".", " \u203A ")
861
861
  };
862
862
  var APPROVAL_ARGUMENT_PREVIEW_CHARACTERS = 4e3;
863
863
  function approvalArgumentsPreview(value) {
@@ -946,7 +946,8 @@ function ApprovalSurface({
946
946
  className: "rounded-og-md border border-og-border bg-og-surface-1 p-3",
947
947
  children: [
948
948
  renderApproval ? renderApproval(approval) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
949
- /* @__PURE__ */ jsx3("p", { className: "text-og-sm font-medium text-og-fg", children: messages.formatToolName(approval.name) }),
949
+ /* @__PURE__ */ jsx3("p", { className: "text-og-sm font-medium text-og-fg", children: approval.display?.title ?? messages.formatToolName(approval.display?.toolName ?? approval.name) }),
950
+ approval.display?.accountLabel ? /* @__PURE__ */ jsx3("p", { className: "mt-1 break-words text-og-xs text-og-fg-muted", children: approval.display.accountLabel }) : null,
950
951
  argumentsPreview !== null ? /* @__PURE__ */ jsx3("pre", { className: "mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-og-sm bg-og-surface-2 p-2 font-mono text-og-xs text-og-fg-muted", children: argumentsPreview }) : null
951
952
  ] }),
952
953
  /* @__PURE__ */ jsxs2("div", { className: "mt-3 flex flex-wrap justify-end gap-2", children: [
@@ -3225,7 +3226,7 @@ function ToolSearchRenderer({ item }) {
3225
3226
  function DocsSearchRenderer({ item }) {
3226
3227
  const args = parseToolArgs(item.arguments);
3227
3228
  const query = typeof args.query === "string" ? args.query.trim() : "";
3228
- const title = query ? `Search \u201C${truncatePreview(query, 48)}\u201D` : toolDisplayName(item.name);
3229
+ const title = query ? `Search \u201C${truncatePreview(query, 48)}\u201D` : toolDisplayName(item.name, item.display);
3229
3230
  const running = item.status === "running";
3230
3231
  if (running) {
3231
3232
  return /* @__PURE__ */ jsx7(
@@ -3281,7 +3282,7 @@ function DocsSearchRenderer({ item }) {
3281
3282
  function SetSessionTitleRenderer({ item }) {
3282
3283
  const args = parseToolArgs(item.arguments);
3283
3284
  const titleArg = typeof args.title === "string" ? args.title.trim() : "";
3284
- const display = toolDisplayName(item.name);
3285
+ const display = toolDisplayName(item.name, item.display);
3285
3286
  const previewTitle = titleArg ? truncatePreview(titleArg, 72) : "";
3286
3287
  const icon = /* @__PURE__ */ jsx7(MessagesSquareIcon, { className: ICON_SIZE });
3287
3288
  if (item.status === "running") {
@@ -3553,7 +3554,7 @@ function RunOnRenderer({ item }) {
3553
3554
  function GenericRenderer({ item }) {
3554
3555
  const running = item.status === "running";
3555
3556
  const args = parseToolArgs(item.arguments);
3556
- const display = toolDisplayName(item.name);
3557
+ const display = toolDisplayName(item.name, item.display);
3557
3558
  const icon = /* @__PURE__ */ jsx7(GenericToolIcon, { name: item.name });
3558
3559
  const goalPreview = goalToolPreview(item.name, args);
3559
3560
  if (running) {
@@ -5222,7 +5223,7 @@ function RollingActivity({
5222
5223
  );
5223
5224
  const fallback2 = /* @__PURE__ */ jsxs11("span", { className: "og-rolling-label", children: [
5224
5225
  /* @__PURE__ */ jsx15(WrenchIcon2, { className: "size-3.5" }),
5225
- /* @__PURE__ */ jsx15("span", { children: item.kind === "tool-call" ? toolDisplayName(item.name) : "Working" })
5226
+ /* @__PURE__ */ jsx15("span", { children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : "Working" })
5226
5227
  ] });
5227
5228
  return /* @__PURE__ */ jsxs11(
5228
5229
  "span",
@@ -5230,7 +5231,7 @@ function RollingActivity({
5230
5231
  className: "og-rolling-status",
5231
5232
  "data-running": active.some((entry) => entry.id === item.id) ? "true" : void 0,
5232
5233
  children: [
5233
- /* @__PURE__ */ jsx15("span", { className: "sr-only", children: item.kind === "tool-call" ? toolDisplayName(item.name) : item.kind === "reasoning" ? "Thinking" : "Working" }),
5234
+ /* @__PURE__ */ jsx15("span", { className: "sr-only", children: item.kind === "tool-call" ? toolDisplayName(item.name, item.display) : item.kind === "reasoning" ? "Thinking" : "Working" }),
5234
5235
  /* @__PURE__ */ jsx15("span", { className: "og-rolling-window", "aria-hidden": "true", children: /* @__PURE__ */ jsx15(AnimatePresence2, { initial: false, mode: "sync", children: /* @__PURE__ */ jsx15(
5235
5236
  motion2.span,
5236
5237
  {
@@ -10204,6 +10205,7 @@ function SessionConversation(props) {
10204
10205
  }
10205
10206
  function Conversation({
10206
10207
  sessionId,
10208
+ renderMessageText,
10207
10209
  userMessageDisclosureLabels,
10208
10210
  loadSkillReview,
10209
10211
  client,
@@ -10247,6 +10249,7 @@ function Conversation({
10247
10249
  /* @__PURE__ */ jsx21(
10248
10250
  MessageTimeline,
10249
10251
  {
10252
+ renderMessageText,
10250
10253
  userMessageDisclosureLabels,
10251
10254
  className: "min-h-0 flex-1",
10252
10255
  items: conversationTimeline(feed.timeline, queue, composer),
@@ -10370,12 +10373,19 @@ function SessionCommandsPanel({
10370
10373
  title: "Expand command",
10371
10374
  children: [
10372
10375
  /* @__PURE__ */ jsx22(ChevronRightIcon3, { className: "size-3 shrink-0 text-og-fg-subtle transition-transform group-open/command:rotate-90" }),
10373
- /* @__PURE__ */ jsx22("span", { className: "truncate", children: command.commandPreview || "Background command" })
10376
+ /* @__PURE__ */ jsx22(
10377
+ "span",
10378
+ {
10379
+ className: "min-w-0 truncate",
10380
+ title: command.commandText ?? (command.commandPreview || "Background command"),
10381
+ children: command.commandText ?? (command.commandPreview || "Background command")
10382
+ }
10383
+ )
10374
10384
  ]
10375
10385
  }
10376
10386
  ),
10377
10387
  /* @__PURE__ */ jsxs17("div", { className: "mt-2 space-y-1", children: [
10378
- /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandPreview || "Background command" }),
10388
+ /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap break-all font-mono text-og-fg-muted", children: command.commandText ?? (command.commandPreview || "Background command") }),
10379
10389
  /* @__PURE__ */ jsxs17(
10380
10390
  "time",
10381
10391
  {
@@ -10634,4 +10644,4 @@ export {
10634
10644
  SessionCommands,
10635
10645
  StartupTimings
10636
10646
  };
10637
- //# sourceMappingURL=chunk-D5NOQPLR.js.map
10647
+ //# sourceMappingURL=chunk-CJCVYUKK.js.map