@opengeni/react 6.0.0-canary.0 → 6.1.0-canary.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 (68) hide show
  1. package/README.md +17 -0
  2. package/dist/capability-catalog-row.d.ts +20 -0
  3. package/dist/{chunk-VRBL3F5E.js → chunk-5GAL23FF.js} +10 -2
  4. package/dist/{chunk-VRBL3F5E.js.map → chunk-5GAL23FF.js.map} +1 -1
  5. package/dist/{chunk-IHQII5WO.js → chunk-G5JFM6ZE.js} +29 -4
  6. package/dist/chunk-G5JFM6ZE.js.map +1 -0
  7. package/dist/{chunk-UMECRJRV.js → chunk-HJ5VJ4JB.js} +21 -12
  8. package/dist/chunk-HJ5VJ4JB.js.map +1 -0
  9. package/dist/{chunk-R4KRSFGA.js → chunk-IP4BUBKH.js} +3 -3
  10. package/dist/{chunk-CC7AVRIJ.js → chunk-KZ4QDBGM.js} +87 -14
  11. package/dist/chunk-KZ4QDBGM.js.map +1 -0
  12. package/dist/{chunk-PZ27MCZP.js → chunk-L5VJYZIW.js} +34 -4
  13. package/dist/chunk-L5VJYZIW.js.map +1 -0
  14. package/dist/{chunk-45XEUVTK.js → chunk-UWVY3OXF.js} +12 -5
  15. package/dist/chunk-UWVY3OXF.js.map +1 -0
  16. package/dist/components/message-timeline.d.ts +2 -2
  17. package/dist/composer.js +4 -4
  18. package/dist/connect-panel.d.ts +2 -1
  19. package/dist/connect-setup.d.ts +3 -1
  20. package/dist/connect.d.ts +1 -0
  21. package/dist/connect.js +620 -424
  22. package/dist/connect.js.map +1 -1
  23. package/dist/connection-catalog.d.ts +6 -1
  24. package/dist/connection-installed.d.ts +1 -0
  25. package/dist/connection-logo.d.ts +4 -2
  26. package/dist/discovery-cache.d.ts +5 -0
  27. package/dist/index.js +7 -7
  28. package/dist/{model-policy-picker-menu-3R336DP2.js → model-policy-picker-menu-RVOQ4ZZG.js} +4 -4
  29. package/dist/model-policy.d.ts +6 -2
  30. package/dist/model-policy.js +1 -1
  31. package/dist/plugin-discovery.d.ts +4 -0
  32. package/dist/realtime.js +2 -2
  33. package/dist/session-ui.js +6 -6
  34. package/dist/session.js +1 -1
  35. package/dist/skill-discovery.d.ts +11 -0
  36. package/dist/timeline/projection.d.ts +3 -1
  37. package/dist/timeline/turn-summary.d.ts +2 -2
  38. package/package.json +3 -3
  39. package/src/capability-catalog-row.tsx +94 -0
  40. package/src/components/markdown.tsx +32 -3
  41. package/src/components/message-timeline.tsx +88 -4
  42. package/src/components/model-picker.tsx +11 -3
  43. package/src/components/model-policy-picker-menu.tsx +10 -3
  44. package/src/components/session-conversation.tsx +1 -3
  45. package/src/components/session-status.tsx +2 -2
  46. package/src/connect-panel.tsx +19 -8
  47. package/src/connect-setup.tsx +49 -14
  48. package/src/connect.ts +6 -0
  49. package/src/connection-catalog.tsx +61 -39
  50. package/src/connection-installed.tsx +2 -0
  51. package/src/connection-logo.tsx +14 -10
  52. package/src/discovery-cache.ts +42 -0
  53. package/src/hooks/use-session-events.ts +24 -2
  54. package/src/model-policy.ts +21 -0
  55. package/src/plugin-details.tsx +8 -5
  56. package/src/plugin-discovery.tsx +87 -71
  57. package/src/skill-discovery.tsx +101 -56
  58. package/src/timeline/projection.ts +31 -1
  59. package/src/timeline/turn-summary.tsx +3 -3
  60. package/styles/compiled.css +27 -0
  61. package/styles/connect.css +56 -15
  62. package/dist/chunk-45XEUVTK.js.map +0 -1
  63. package/dist/chunk-CC7AVRIJ.js.map +0 -1
  64. package/dist/chunk-IHQII5WO.js.map +0 -1
  65. package/dist/chunk-PZ27MCZP.js.map +0 -1
  66. package/dist/chunk-UMECRJRV.js.map +0 -1
  67. /package/dist/{chunk-R4KRSFGA.js.map → chunk-IP4BUBKH.js.map} +0 -0
  68. /package/dist/{model-policy-picker-menu-3R336DP2.js.map → model-policy-picker-menu-RVOQ4ZZG.js.map} +0 -0
@@ -408,10 +408,13 @@ function timelineAnnotationToolOutputText(output) {
408
408
  const text = (marker >= 0 ? raw.slice(marker + "\nOutput:\n".length) : raw.startsWith("Output:\n") ? raw.slice("Output:\n".length) : raw).replace(TIMELINE_ANNOTATION_ANSI_SEQUENCE, "");
409
409
  return text.length > 0 ? text : null;
410
410
  }
411
- function buildTimeline(events) {
411
+ function buildTimeline(events, options = {}) {
412
412
  const items = [];
413
413
  const prescan = prescanTurnAnchors(events);
414
414
  const ordered = orderTimelineEvents(events, prescan);
415
+ let completeHistoryPrefix = options.partialStart !== true;
416
+ const knownMessagePrefixTurns = /* @__PURE__ */ new Set();
417
+ const incompleteMessageKeys = /* @__PURE__ */ new Set();
415
418
  const pendingWaitOutcomeByTurn = /* @__PURE__ */ new Map();
416
419
  const latestAgentResponseByTurn = /* @__PURE__ */ new Map();
417
420
  const identifiedMessages = /* @__PURE__ */ new Map();
@@ -529,6 +532,11 @@ function buildTimeline(events) {
529
532
  for (const event of ordered) {
530
533
  const payload = asRecord2(event.payload);
531
534
  const turnId = event.turnId ?? null;
535
+ if (event.type === "session.created") {
536
+ completeHistoryPrefix = true;
537
+ } else if (event.type === "turn.started" || event.type === "user.message" && payload.delivery !== "steer" && payload.routing !== "accepted_for_steering") {
538
+ knownMessagePrefixTurns.add(turnId);
539
+ }
532
540
  startupEvent = event;
533
541
  startupTurnId = turnId;
534
542
  startupAttemptId = (typeof event.turnAttemptId === "string" ? event.turnAttemptId : null) ?? stringValue(payload.attemptId);
@@ -618,6 +626,10 @@ function buildTimeline(events) {
618
626
  }
619
627
  const messageId = stringValue(payload.messageId);
620
628
  const messageKey = messageId ? JSON.stringify([turnId, messageId]) : null;
629
+ if (!completeHistoryPrefix && !knownMessagePrefixTurns.has(turnId) || messageKey && incompleteMessageKeys.has(messageKey)) {
630
+ if (messageKey) incompleteMessageKeys.add(messageKey);
631
+ break;
632
+ }
621
633
  const identified = messageKey ? identifiedMessages.get(messageKey) : void 0;
622
634
  if (identified) {
623
635
  if (identified.annotationSource?.eventType !== "agent.message.completed") {
@@ -657,6 +669,7 @@ function buildTimeline(events) {
657
669
  break;
658
670
  }
659
671
  case "agent.message.completed": {
672
+ knownMessagePrefixTurns.add(turnId);
660
673
  const text = stringValue(payload.text);
661
674
  const messageId = stringValue(payload.messageId);
662
675
  const messageKey = messageId ? JSON.stringify([turnId, messageId]) : null;
@@ -2271,6 +2284,7 @@ function useSessionEvents(sessionId, options = {}) {
2271
2284
  const [eventWindow, setEventWindow] = useState(EMPTY_EVENT_WINDOW);
2272
2285
  const [connectionState, setConnectionState] = useState("idle");
2273
2286
  const [error, setError] = useState(null);
2287
+ const [newerError, setNewerError] = useState(null);
2274
2288
  const [hasOlder, setHasOlder] = useState(false);
2275
2289
  const [hasNewer, setHasNewer] = useState(false);
2276
2290
  const [sessionStatusProjection, setSessionStatusProjection] = useState(
@@ -2308,6 +2322,7 @@ function useSessionEvents(sessionId, options = {}) {
2308
2322
  const [stateStreamKey, setStateStreamKey] = useState(streamKey);
2309
2323
  useEffect(() => {
2310
2324
  navigationGenerationRef.current += 1;
2325
+ setNewerError(null);
2311
2326
  loadingOlderRef.current = false;
2312
2327
  loadingNewerRef.current = false;
2313
2328
  loadingOldestRef.current = false;
@@ -2720,6 +2735,7 @@ function useSessionEvents(sessionId, options = {}) {
2720
2735
  initialWindowLoadedRef.current = true;
2721
2736
  viewModeRef.current = "history";
2722
2737
  loadingOldestRef.current = false;
2738
+ setNewerError(null);
2723
2739
  startTransition(() => {
2724
2740
  if (status !== void 0) {
2725
2741
  setSessionStatusProjection(status);
@@ -2764,6 +2780,7 @@ function useSessionEvents(sessionId, options = {}) {
2764
2780
  return false;
2765
2781
  }
2766
2782
  if (window.events.length === 0) {
2783
+ setNewerError(null);
2767
2784
  hasNewerRef.current = false;
2768
2785
  setHasNewer(false);
2769
2786
  streamResumeSequenceRef.current = afterSequence;
@@ -2806,6 +2823,7 @@ function useSessionEvents(sessionId, options = {}) {
2806
2823
  resumeLive = true;
2807
2824
  }
2808
2825
  loadingNewerRef.current = false;
2826
+ setNewerError(null);
2809
2827
  startTransition(() => {
2810
2828
  if (status !== void 0) {
2811
2829
  setSessionStatusProjection(status);
@@ -2821,6 +2839,12 @@ function useSessionEvents(sessionId, options = {}) {
2821
2839
  });
2822
2840
  published = true;
2823
2841
  return newer;
2842
+ } catch (reason) {
2843
+ if (navigationGenerationRef.current !== generation) {
2844
+ return false;
2845
+ }
2846
+ setNewerError(reason instanceof Error ? reason : new Error(String(reason)));
2847
+ throw reason;
2824
2848
  } finally {
2825
2849
  if (!published && navigationGenerationRef.current === generation) {
2826
2850
  loadingNewerRef.current = false;
@@ -2834,6 +2858,7 @@ function useSessionEvents(sessionId, options = {}) {
2834
2858
  }
2835
2859
  loadingLatestRef.current = true;
2836
2860
  setLoadingLatest(true);
2861
+ setNewerError(null);
2837
2862
  let published = false;
2838
2863
  try {
2839
2864
  streamAbortRef.current?.abort();
@@ -2866,7 +2891,12 @@ function useSessionEvents(sessionId, options = {}) {
2866
2891
  }, [after, sessionId]);
2867
2892
  const identityMatches = stateStreamKey === streamKey;
2868
2893
  const visibleEvents = identityMatches ? eventWindow.events : EMPTY_EVENTS;
2869
- const timeline = useMemo(() => buildTimeline(visibleEvents), [visibleEvents]);
2894
+ const timeline = useMemo(
2895
+ () => buildTimeline(visibleEvents, {
2896
+ partialStart: hasOlder || eventWindow.truncated || after > 0
2897
+ }),
2898
+ [visibleEvents, hasOlder, eventWindow.truncated, after]
2899
+ );
2870
2900
  return {
2871
2901
  events: visibleEvents,
2872
2902
  timeline,
@@ -2887,7 +2917,7 @@ function useSessionEvents(sessionId, options = {}) {
2887
2917
  loadOldest,
2888
2918
  loadingLatest: !identityMatches ? false : loadingLatest,
2889
2919
  jumpToLatest,
2890
- error: identityMatches ? error : null
2920
+ error: identityMatches ? newerError ?? error : null
2891
2921
  };
2892
2922
  }
2893
2923
  function boundBrowserSessionEventWindow(events, options = {}) {
@@ -3756,4 +3786,4 @@ export {
3756
3786
  isHumanInputEvent,
3757
3787
  useHumanInputRequests
3758
3788
  };
3759
- //# sourceMappingURL=chunk-PZ27MCZP.js.map
3789
+ //# sourceMappingURL=chunk-L5VJYZIW.js.map