@opengeni/react 1.4.5-canary.38533733713001 → 2.0.1

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.
@@ -3,7 +3,7 @@ import {
3
3
  isTimelineUserQuestion,
4
4
  isTurnExecutionEvidence,
5
5
  timelineQuestionPlacement
6
- } from "./chunk-KKSJE6P2.js";
6
+ } from "./chunk-HQN5AZFY.js";
7
7
  import "./chunk-3PVDYTTB.js";
8
8
  import "./chunk-QQ5UGGGE.js";
9
9
 
@@ -115,4 +115,4 @@ export {
115
115
  TIMELINE_TURN_ANCHOR_EVENT_TYPES,
116
116
  resolveLatestQuestion
117
117
  };
118
- //# sourceMappingURL=latest-question-MYLGMNDL.js.map
118
+ //# sourceMappingURL=latest-question-6WZQV23L.js.map
@@ -29,7 +29,7 @@ import {
29
29
  setStartupDetails,
30
30
  useStartupDetails,
31
31
  userMessageLikelyNeedsDisclosure
32
- } from "./chunk-JTY5Y7O4.js";
32
+ } from "./chunk-RRYCD3QD.js";
33
33
  import "./chunk-B27E3V37.js";
34
34
  import "./chunk-SHLZMAJN.js";
35
35
  import "./chunk-2HVLQ26H.js";
@@ -44,8 +44,8 @@ import {
44
44
  createOlderHistoryLoadReceipt,
45
45
  useNewConversation,
46
46
  useSessionConversation
47
- } from "./chunk-ROUV2WRM.js";
48
- import "./chunk-KKSJE6P2.js";
47
+ } from "./chunk-25YZS7TK.js";
48
+ import "./chunk-HQN5AZFY.js";
49
49
  import {
50
50
  OpenGeniProvider
51
51
  } from "./chunk-R5SBNG7S.js";
package/dist/session.js CHANGED
@@ -24,14 +24,14 @@ import {
24
24
  useSessionConversation,
25
25
  useSessionEvents,
26
26
  useTurnQueue
27
- } from "./chunk-ROUV2WRM.js";
27
+ } from "./chunk-25YZS7TK.js";
28
28
  import {
29
29
  buildTimeline,
30
30
  creditExhaustedFromEvents,
31
31
  extractSessionRef,
32
32
  groupTimeline,
33
33
  sessionStatusFromEvents
34
- } from "./chunk-KKSJE6P2.js";
34
+ } from "./chunk-HQN5AZFY.js";
35
35
  import {
36
36
  humanInputRequestFromEvent,
37
37
  projectPendingHumanInputRequests
@@ -1,6 +1,14 @@
1
1
  import type { ContextCompactionItem } from "./types.js";
2
2
  /** Headline for a compaction that could not produce a checkpoint. */
3
3
  export declare const COMPACTION_FAILURE_TITLE = "Couldn\u2019t compact conversation history";
4
+ /**
5
+ * Headline for a compaction cut short by its own attempt's cancellation (for
6
+ * example a worker restarting during a deploy). Not a failure: the recovered
7
+ * attempt checks again and compacts if the history still needs it.
8
+ */
9
+ export declare const COMPACTION_INTERRUPTED_TITLE = "Compaction interrupted";
10
+ /** Headline for a settled `skipped` compaction landmark. */
11
+ export declare function compactionSkipTitle(reason: string | null): string;
4
12
  /** Why a definitive provider rejection repeats; shown behind Details. */
5
13
  export declare const COMPACTION_REJECTION_NOTE = "The provider rejects this request the same way until the conversation changes.";
6
14
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/react",
3
- "version": "1.4.5-canary.38533733713001",
3
+ "version": "2.0.1",
4
4
  "description": "React hooks and styled components for Opengeni: live session streaming, chat composer, message timeline, session status, and fleet views — token-themed (CSS variables), dark-first, built on Tailwind v4 + Radix + Motion.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -213,8 +213,8 @@
213
213
  "@dnd-kit/utilities": "3.2.2",
214
214
  "@fontsource-variable/noto-sans-arabic": "5.2.10",
215
215
  "@fontsource-variable/noto-sans-jp": "5.2.10",
216
- "@opengeni/connect": "1.4.5-canary.38533733713001",
217
- "@opengeni/sdk": "1.4.5-canary.38533733713001",
216
+ "@opengeni/connect": "2.0.1",
217
+ "@opengeni/sdk": "2.0.1",
218
218
  "clsx": "^2.1.1",
219
219
  "dequal": "2.0.3",
220
220
  "lucide-react": "^1.8.0",
@@ -235,7 +235,7 @@
235
235
  "@codemirror/lang-markdown": "^6.0.0",
236
236
  "@codemirror/lang-python": "^6.0.0",
237
237
  "@novnc/novnc": "^1.7.0",
238
- "@opengeni/artifact-tool": "^1.0.0",
238
+ "@opengeni/artifact-tool": "^2.0.0",
239
239
  "@pierre/diffs": "^1.2.11",
240
240
  "@uiw/react-codemirror": "^4.23.0",
241
241
  "@xterm/addon-fit": "^0.11.0",
@@ -26,9 +26,9 @@ import { GenieLoadingOptionsContext, type GenieLoadingOptions } from "../timelin
26
26
  import { ChildSessionLink } from "./child-session-link";
27
27
  import { useStartupDetails } from "../timeline/startup-preference";
28
28
  import {
29
- COMPACTION_FAILURE_TITLE,
30
29
  compactionFailureDetails,
31
30
  compactionSkipSubtitle,
31
+ compactionSkipTitle,
32
32
  } from "../timeline/compaction-copy";
33
33
  import type {
34
34
  DraftTimelineAnnotation,
@@ -4234,7 +4234,7 @@ function CompactionRow({ item }: { item: ContextCompactionItem }) {
4234
4234
  ? before && after
4235
4235
  ? `Conversation history compacted · ~${before} → ~${after} estimated history tokens`
4236
4236
  : "Conversation history compacted"
4237
- : COMPACTION_FAILURE_TITLE;
4237
+ : compactionSkipTitle(item.skipReason);
4238
4238
  const subtitle =
4239
4239
  item.phase === "compacted"
4240
4240
  ? "Chat history above is unchanged"
@@ -109,6 +109,9 @@ const useDockLayoutEffect = typeof window === "undefined" ? useEffect : useLayou
109
109
  */
110
110
  const DOCK_OVERLAY_BREAKPOINT = 1024;
111
111
 
112
+ /** The panel group's layout while the dock is closed. */
113
+ const CLOSED_LAYOUT: Layout = { primary: 100, dock: 0 };
114
+
112
115
  /** SSR-safe `(max-width: …)` match; false until mounted, then live. */
113
116
  function useIsNarrow(maxWidth: number): boolean {
114
117
  const [narrow, setNarrow] = useState(false);
@@ -161,6 +164,8 @@ export function WorkspaceDock({
161
164
  // dismiss it; standalone usage keeps the thin reopen rail as well.
162
165
  const hostControlled = collapsedProp !== undefined;
163
166
  const previousCollapsedRef = useRef(collapsed);
167
+ const collapsedNowRef = useRef(collapsed);
168
+ collapsedNowRef.current = collapsed;
164
169
 
165
170
  // Persisted layout (width split) keyed by autoSaveId.
166
171
  const { defaultLayout, onLayoutChanged } = useDefaultLayout({
@@ -170,6 +175,11 @@ export function WorkspaceDock({
170
175
  });
171
176
  const expandedDefaultLayout =
172
177
  defaultLayout && (defaultLayout.dock ?? 0) > 1 ? defaultLayout : undefined;
178
+ // A panel group reads its starting layout once, when it mounts (on first
179
+ // render, and again whenever the window widens out of the overlay). A
180
+ // closed dock starts closed, so it never shows its saved width for a frame
181
+ // or keeps it as an invisible column.
182
+ const mountLayout = collapsed ? CLOSED_LAYOUT : expandedDefaultLayout;
173
183
  const lastExpandedSizeRef = useRef(expandedDefaultLayout?.dock ?? defaultSize);
174
184
  const layoutIdentityRef = useRef(autoSaveId);
175
185
  if (layoutIdentityRef.current !== autoSaveId) {
@@ -220,6 +230,13 @@ export function WorkspaceDock({
220
230
  }
221
231
  }, [collapsedProp, dockPanelRef]);
222
232
 
233
+ // Widening past the overlay breakpoint mounts a fresh panel group at its
234
+ // saved split. A closed dock must stay closed there, not hold its old width
235
+ // as an invisible column beside the chat.
236
+ useDockLayoutEffect(() => {
237
+ if (!narrow && collapsedNowRef.current) dockPanelRef.current?.collapse();
238
+ }, [narrow, dockPanelRef]);
239
+
223
240
  // Treat the narrow overlay like a real modal: remember the external opener,
224
241
  // move focus into the selected tab, and restore it on close. The standalone
225
242
  // desktop dock instead focuses its newly-visible reopen rail after collapse.
@@ -453,7 +470,7 @@ export function WorkspaceDock({
453
470
  <Group
454
471
  orientation="horizontal"
455
472
  className="min-h-0 flex-1"
456
- {...(expandedDefaultLayout ? { defaultLayout: expandedDefaultLayout } : {})}
473
+ {...(mountLayout ? { defaultLayout: mountLayout } : {})}
457
474
  onLayoutChanged={persistExpandedLayout}
458
475
  >
459
476
  <Panel id="primary" minSize="30%" className="min-h-0 min-w-0">
@@ -3,6 +3,18 @@ import type { ContextCompactionItem } from "./types";
3
3
  /** Headline for a compaction that could not produce a checkpoint. */
4
4
  export const COMPACTION_FAILURE_TITLE = "Couldn’t compact conversation history";
5
5
 
6
+ /**
7
+ * Headline for a compaction cut short by its own attempt's cancellation (for
8
+ * example a worker restarting during a deploy). Not a failure: the recovered
9
+ * attempt checks again and compacts if the history still needs it.
10
+ */
11
+ export const COMPACTION_INTERRUPTED_TITLE = "Compaction interrupted";
12
+
13
+ /** Headline for a settled `skipped` compaction landmark. */
14
+ export function compactionSkipTitle(reason: string | null): string {
15
+ return reason === "interrupted" ? COMPACTION_INTERRUPTED_TITLE : COMPACTION_FAILURE_TITLE;
16
+ }
17
+
6
18
  /** Why a definitive provider rejection repeats; shown behind Details. */
7
19
  export const COMPACTION_REJECTION_NOTE =
8
20
  "The provider rejects this request the same way until the conversation changes.";
@@ -25,6 +37,8 @@ export function compactionSkipSubtitle(
25
37
  return "Checkpoint exceeds this model's context budget. Chat history is unchanged.";
26
38
  case "replacement_unchanged":
27
39
  return "Checkpoint made no progress";
40
+ case "interrupted":
41
+ return "It will retry if still needed. Chat history is unchanged.";
28
42
  case "summarization_failed":
29
43
  return providerRejection
30
44
  ? "Chat history is unchanged. If your next message fails too, start a new session."