@opengeni/react 7.0.0 → 7.1.0-canary.35855175602001

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 (81) hide show
  1. package/README.md +34 -0
  2. package/dist/approvals.d.ts +2 -1
  3. package/dist/artifacts.js +17 -17
  4. package/dist/{browser-viewer-LGH4IP47.js → browser-viewer-MN7MOYQT.js} +5 -5
  5. package/dist/{chunk-YS24CFDI.js → chunk-2O2HXRGP.js} +7 -7
  6. package/dist/{chunk-IP4BUBKH.js → chunk-3LL47F4U.js} +28 -17
  7. package/dist/chunk-3LL47F4U.js.map +1 -0
  8. package/dist/{chunk-UXE5SSNN.js → chunk-4ACTWOOW.js} +8 -8
  9. package/dist/{chunk-IYUPN32E.js → chunk-DBPVUGQT.js} +6 -1
  10. package/dist/{chunk-IYUPN32E.js.map → chunk-DBPVUGQT.js.map} +1 -1
  11. package/dist/{chunk-5GAL23FF.js → chunk-IOLPHOF4.js} +2 -5
  12. package/dist/chunk-IOLPHOF4.js.map +1 -0
  13. package/dist/{chunk-JPHDWKZE.js → chunk-PFDNB3U7.js} +15 -10
  14. package/dist/chunk-PFDNB3U7.js.map +1 -0
  15. package/dist/{chunk-D7GAPJ3V.js → chunk-SHRCATV6.js} +67 -34
  16. package/dist/chunk-SHRCATV6.js.map +1 -0
  17. package/dist/{chunk-H5YGYNXS.js → chunk-TV5PP2PE.js} +11 -11
  18. package/dist/chunk-TV5PP2PE.js.map +1 -0
  19. package/dist/{chunk-PNAVEK2U.js → chunk-UQS7BGNQ.js} +12 -12
  20. package/dist/{chunk-JKLGJQO5.js → chunk-VI7HELBI.js} +40 -20
  21. package/dist/chunk-VI7HELBI.js.map +1 -0
  22. package/dist/{chunk-HJ5VJ4JB.js → chunk-WKFFRFJF.js} +73 -15
  23. package/dist/chunk-WKFFRFJF.js.map +1 -0
  24. package/dist/{chunk-D5NOQPLR.js → chunk-ZC2DK5SC.js} +75 -65
  25. package/dist/chunk-ZC2DK5SC.js.map +1 -0
  26. package/dist/components/markdown.d.ts +2 -0
  27. package/dist/components/model-policy-picker.d.ts +17 -1
  28. package/dist/components/session-conversation.d.ts +3 -0
  29. package/dist/composer.d.ts +1 -1
  30. package/dist/composer.js +7 -7
  31. package/dist/{computer-viewer-CTFCJVS7.js → computer-viewer-FX4WOZMX.js} +4 -4
  32. package/dist/connect.js +5 -5
  33. package/dist/hooks/use-session-events.d.ts +6 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.js +112 -115
  36. package/dist/index.js.map +1 -1
  37. package/dist/interaction.js +5 -5
  38. package/dist/machines.js +2 -2
  39. package/dist/{model-policy-picker-menu-RVOQ4ZZG.js → model-policy-picker-menu-AGXXJZ2B.js} +4 -4
  40. package/dist/model-policy.js +1 -1
  41. package/dist/realtime.js +5 -5
  42. package/dist/session-ui.js +12 -12
  43. package/dist/session.js +3 -3
  44. package/dist/timeline/tool-display-name.d.ts +2 -1
  45. package/dist/timeline/types.d.ts +2 -1
  46. package/package.json +3 -3
  47. package/src/approvals.ts +8 -1
  48. package/src/components/approval-surface.tsx +12 -2
  49. package/src/components/machine-card.tsx +5 -5
  50. package/src/components/machine-dock-bar.tsx +1 -1
  51. package/src/components/machines/machine-detail.tsx +5 -2
  52. package/src/components/markdown.tsx +101 -55
  53. package/src/components/model-policy-picker-menu.tsx +131 -33
  54. package/src/components/model-policy-picker.tsx +61 -12
  55. package/src/components/session-commands-panel.tsx +8 -3
  56. package/src/components/session-conversation.tsx +5 -1
  57. package/src/composer.ts +1 -0
  58. package/src/hooks/use-last-started-turn-policy.ts +3 -7
  59. package/src/hooks/use-session-events.ts +32 -7
  60. package/src/index.ts +1 -0
  61. package/src/model-policy.ts +1 -4
  62. package/src/timeline/projection.ts +4 -0
  63. package/src/timeline/rolling-activity.tsx +4 -2
  64. package/src/timeline/tool-display-name.ts +8 -6
  65. package/src/timeline/tool-renderers.tsx +5 -3
  66. package/src/timeline/types.ts +2 -0
  67. package/styles/compiled.css +15 -0
  68. package/dist/chunk-5GAL23FF.js.map +0 -1
  69. package/dist/chunk-D5NOQPLR.js.map +0 -1
  70. package/dist/chunk-D7GAPJ3V.js.map +0 -1
  71. package/dist/chunk-H5YGYNXS.js.map +0 -1
  72. package/dist/chunk-HJ5VJ4JB.js.map +0 -1
  73. package/dist/chunk-IP4BUBKH.js.map +0 -1
  74. package/dist/chunk-JKLGJQO5.js.map +0 -1
  75. package/dist/chunk-JPHDWKZE.js.map +0 -1
  76. /package/dist/{browser-viewer-LGH4IP47.js.map → browser-viewer-MN7MOYQT.js.map} +0 -0
  77. /package/dist/{chunk-YS24CFDI.js.map → chunk-2O2HXRGP.js.map} +0 -0
  78. /package/dist/{chunk-UXE5SSNN.js.map → chunk-4ACTWOOW.js.map} +0 -0
  79. /package/dist/{chunk-PNAVEK2U.js.map → chunk-UQS7BGNQ.js.map} +0 -0
  80. /package/dist/{computer-viewer-CTFCJVS7.js.map → computer-viewer-FX4WOZMX.js.map} +0 -0
  81. /package/dist/{model-policy-picker-menu-RVOQ4ZZG.js.map → model-policy-picker-menu-AGXXJZ2B.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  isSourcePlacementChangedError,
5
5
  useInteractionInterventions,
6
6
  useInteractionInvalidation
7
- } from "./chunk-H5YGYNXS.js";
7
+ } from "./chunk-TV5PP2PE.js";
8
8
  import {
9
9
  STREAM_CLOSE_REASON_NORMAL,
10
10
  STREAM_KIND_BROWSER,
@@ -15,21 +15,21 @@ import {
15
15
  encodeStreamOpen,
16
16
  interactionHostPlatform
17
17
  } from "./chunk-5YK2ZDIG.js";
18
- import {
19
- copyTextToClipboard
20
- } from "./chunk-JVYQRRC4.js";
21
18
  import {
22
19
  usePageLiveActivity
23
20
  } from "./chunk-KZ73RL76.js";
24
- import {
25
- formatBytes
26
- } from "./chunk-PLYRL5ER.js";
27
21
  import {
28
22
  useEmbeddedBrowserInteraction
29
23
  } from "./chunk-NEXLLTP4.js";
24
+ import {
25
+ formatBytes
26
+ } from "./chunk-PLYRL5ER.js";
30
27
  import {
31
28
  cn
32
29
  } from "./chunk-22KP6LR5.js";
30
+ import {
31
+ copyTextToClipboard
32
+ } from "./chunk-JVYQRRC4.js";
33
33
 
34
34
  // src/components/browser-viewer.tsx
35
35
  import { interactionControlFailureFromError } from "@opengeni/sdk/interaction";
@@ -3895,13 +3895,13 @@ function shortUrl(value) {
3895
3895
  }
3896
3896
 
3897
3897
  export {
3898
- useBrowserFrameStream,
3898
+ useSiteAuthConnections,
3899
3899
  useAttachedBrowsers,
3900
+ useBrowserSessions,
3900
3901
  useBrowserIdentities,
3901
- useBrowserDownloads,
3902
3902
  useBrowserSession,
3903
- useBrowserSessions,
3904
- useSiteAuthConnections,
3903
+ useBrowserDownloads,
3904
+ useBrowserFrameStream,
3905
3905
  BrowserViewer
3906
3906
  };
3907
- //# sourceMappingURL=chunk-PNAVEK2U.js.map
3907
+ //# sourceMappingURL=chunk-UQS7BGNQ.js.map
@@ -5,17 +5,17 @@ import {
5
5
  usePolledValue,
6
6
  useSessionEventTrigger
7
7
  } from "./chunk-KZ73RL76.js";
8
+ import {
9
+ useEmbeddedHumanInputSession,
10
+ useEmbeddedSession,
11
+ useEmbeddedSessionRead
12
+ } from "./chunk-NEXLLTP4.js";
8
13
  import {
9
14
  CREDIT_EXHAUSTION_MESSAGE,
10
15
  isCreditExhaustion,
11
16
  presentFailure,
12
17
  tryParseJson
13
18
  } from "./chunk-PLYRL5ER.js";
14
- import {
15
- useEmbeddedHumanInputSession,
16
- useEmbeddedSession,
17
- useEmbeddedSessionRead
18
- } from "./chunk-NEXLLTP4.js";
19
19
 
20
20
  // src/human-input.ts
21
21
  function isActionableHumanInputRequest(request, nowMs = Date.now()) {
@@ -72,12 +72,11 @@ function mcpToolLeaf(name) {
72
72
  function toolMatchesLeaf(wireName, leaf) {
73
73
  return wireName === leaf || wireName.endsWith(`__${leaf}`);
74
74
  }
75
- function toolDisplayName(name) {
76
- const phrase = mcpToolLeaf(name).replace(/[_-]+/g, " ").trim();
77
- if (!phrase) {
78
- return name;
79
- }
80
- return phrase.charAt(0).toUpperCase() + phrase.slice(1);
75
+ function toolDisplayName(name, display) {
76
+ if (!display && /^[a-f0-9]{64}$/.test(name)) return "Tool call";
77
+ const phrase = (display?.toolName ?? mcpToolLeaf(name)).replace(/[_-]+/g, " ").trim();
78
+ const title = display?.title ?? (phrase ? phrase.charAt(0).toUpperCase() + phrase.slice(1) : name);
79
+ return display?.accountLabel ? `${title} \u2014 ${display.accountLabel}` : title;
81
80
  }
82
81
 
83
82
  // src/older-history.ts
@@ -124,7 +123,8 @@ function createOlderHistoryLoadReceipt(load) {
124
123
 
125
124
  // src/timeline/projection.ts
126
125
  import {
127
- parseMediaGenerationResult
126
+ parseMediaGenerationResult,
127
+ parseToolDisplayMetadata
128
128
  } from "@opengeni/sdk";
129
129
 
130
130
  // src/timeline/fleet-decision-projection.ts
@@ -753,6 +753,7 @@ function buildTimeline(events, options = {}) {
753
753
  }
754
754
  case "agent.toolCall.created": {
755
755
  const name = typeof payload.name === "string" ? payload.name : "tool";
756
+ const display = parseToolDisplayMetadata(payload.display);
756
757
  const callId = typeof payload.id === "string" ? payload.id : null;
757
758
  const args = payload.arguments ?? null;
758
759
  closeStreamingTail();
@@ -782,6 +783,7 @@ function buildTimeline(events, options = {}) {
782
783
  (item) => item.kind === "tool-call" && item.callId === callId
783
784
  );
784
785
  if (existing) {
786
+ if (display) existing.display = display;
785
787
  if (args != null) {
786
788
  existing.arguments = args;
787
789
  }
@@ -798,6 +800,7 @@ function buildTimeline(events, options = {}) {
798
800
  turnId,
799
801
  callId,
800
802
  name,
803
+ ...display ? { display } : {},
801
804
  arguments: args,
802
805
  output: void 0,
803
806
  truncation: null,
@@ -2289,8 +2292,8 @@ var FOREGROUND_COMPACT_CATCHUP_MAX_GROUPS = 16;
2289
2292
  var FOREGROUND_COMPACT_CATCHUP_MAX_BYTES = 512 * 1024;
2290
2293
  var EMPTY_EVENTS = [];
2291
2294
  var encoder = new TextEncoder();
2292
- var SESSION_EVENT_BROWSER_MAX_BYTES = 8 * 1024 * 1024;
2293
- var SESSION_EVENT_BROWSER_MAX_COUNT = 1e4;
2295
+ var SESSION_EVENT_BROWSER_MAX_BYTES = 160 * 1024 * 1024;
2296
+ var SESSION_EVENT_BROWSER_MAX_COUNT = 2e5;
2294
2297
  var SESSION_EVENT_BROWSER_PENDING_MAX_BYTES = 1024 * 1024;
2295
2298
  var SESSION_EVENT_BROWSER_PENDING_MAX_COUNT = 256;
2296
2299
  var EMPTY_EVENT_WINDOW = {
@@ -2449,7 +2452,7 @@ function useSessionEvents(sessionId, options = {}) {
2449
2452
  setSessionStatusProjection(status);
2450
2453
  }
2451
2454
  const current = eventWindowRef.current;
2452
- const next = boundBrowserSessionEventWindow([...current.events, ...batch]);
2455
+ const next = appendBrowserSessionEventWindow(current, batch);
2453
2456
  const retained = {
2454
2457
  ...next,
2455
2458
  truncated: current.truncated || next.truncated
@@ -2486,7 +2489,7 @@ function useSessionEvents(sessionId, options = {}) {
2486
2489
  const current = eventWindowRef.current;
2487
2490
  assertAppendOrder(current.events, plan.events);
2488
2491
  const status = observeSessionStatus(plan.events, sessionStatusRef);
2489
- const next = boundBrowserSessionEventWindow([...current.events, ...plan.events]);
2492
+ const next = appendBrowserSessionEventWindow(current, plan.events);
2490
2493
  const retained = {
2491
2494
  ...next,
2492
2495
  truncated: current.truncated || next.truncated
@@ -2825,9 +2828,7 @@ function useSessionEvents(sessionId, options = {}) {
2825
2828
  assertAppendOrder(current.events, window.events);
2826
2829
  const status = observeSessionStatus(window.events, sessionStatusRef);
2827
2830
  const previousOldest = current.events[0]?.sequence ?? null;
2828
- const next = boundBrowserSessionEventWindow([...current.events, ...window.events], {
2829
- direction: "newest"
2830
- });
2831
+ const next = appendBrowserSessionEventWindow(current, window.events);
2831
2832
  const retained = {
2832
2833
  ...next,
2833
2834
  truncated: current.truncated || next.truncated || window.hasNewer
@@ -3056,6 +3057,25 @@ function boundBrowserSessionEventWindow(events, options = {}) {
3056
3057
  truncated: selected.length < safe.length
3057
3058
  };
3058
3059
  }
3060
+ function appendBrowserSessionEventWindow(current, batch, options = {}) {
3061
+ const maxBytes = Math.max(1024, options.maxBytes ?? SESSION_EVENT_BROWSER_MAX_BYTES);
3062
+ const maxCount = Math.max(1, Math.floor(options.maxCount ?? SESSION_EVENT_BROWSER_MAX_COUNT));
3063
+ const events = [...current.events, ...batch];
3064
+ let bytes = current.bytes;
3065
+ for (let index = 0; index < batch.length; index += 1) {
3066
+ bytes += browserJsonBytes(batch[index]) + (current.events.length + index > 0 ? 1 : 0);
3067
+ }
3068
+ let start = 0;
3069
+ while (events.length - start > 1 && (bytes > maxBytes || events.length - start > maxCount)) {
3070
+ bytes -= browserJsonBytes(events[start]) + 1;
3071
+ start += 1;
3072
+ }
3073
+ return {
3074
+ events: start === 0 ? events : events.slice(start),
3075
+ bytes,
3076
+ truncated: current.truncated || start > 0
3077
+ };
3078
+ }
3059
3079
  function browserJsonBytes(value) {
3060
3080
  return encoder.encode(JSON.stringify(value)).byteLength;
3061
3081
  }
@@ -3949,4 +3969,4 @@ export {
3949
3969
  useHumanInputRequests,
3950
3970
  conversationTimeline
3951
3971
  };
3952
- //# sourceMappingURL=chunk-JKLGJQO5.js.map
3972
+ //# sourceMappingURL=chunk-VI7HELBI.js.map