@theoremjs/react 0.3.5-next.1010.g514118e → 0.3.5-next.1011.gfbc6c42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/react",
3
- "version": "0.3.5-next.1010.g514118e",
3
+ "version": "0.3.5-next.1011.gfbc6c42",
4
4
  "description": "React bindings for Theorem: headless hooks + transport, an Astryx chat UI, and a Web-standard server handler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -60,8 +60,8 @@
60
60
  "@stylexjs/stylex": "0.19.0",
61
61
  "react": "^19.0.0",
62
62
  "react-dom": "^19.0.0",
63
- "@theoremjs/agents": "^0.3.5-next.1010.g514118e",
64
- "@theoremjs/web": "^0.3.5-next.1010.g514118e"
63
+ "@theoremjs/agents": "^0.3.5-next.1011.gfbc6c42",
64
+ "@theoremjs/web": "^0.3.5-next.1011.gfbc6c42"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@astryxdesign/core": {
@@ -66,6 +66,12 @@ export type ChatTranscriptProps = {
66
66
  * the time ("Worked"); any other reply shows none.
67
67
  */
68
68
  showWorkStatus?: boolean;
69
+ /**
70
+ * Whether a reply whose model call failed part-way, and went on from the words it had shown,
71
+ * shows the profile's notice above its words ("This reply was interrupted and picked up where it
72
+ * left off."). Default: true.
73
+ */
74
+ showResumedNotice?: boolean;
69
75
  /** The profile's labels (`iface.labels`): a stopped turn says why in its words. */
70
76
  labels?: LabelOverrides;
71
77
  };
@@ -44,6 +44,8 @@ const ShowToolData = createContext(true);
44
44
  const ShowToolDurations = createContext(true);
45
45
  /** Whether a reply shows its work status (`ChatTranscriptProps.showWorkStatus`). */
46
46
  const ShowWorkStatus = createContext(true);
47
+ /** Whether a reply that went on after its call failed shows its notice (`ChatTranscriptProps.showResumedNotice`). */
48
+ const ShowResumedNotice = createContext(true);
47
49
  /** What the transcript's props say a tool call's row shows. */
48
50
  function useToolRowShows() {
49
51
  return {
@@ -436,9 +438,15 @@ function BodyBlock({ block, streaming }) {
436
438
  return _jsx(ThoughtLine, { text: block.text, streaming: streaming });
437
439
  return _jsx(ResultBlock, { block: block });
438
440
  }
439
- /** Non-streaming answer rows: errors, structured output, and media. Citations coalesce in bodyRows. */
441
+ /**
442
+ * Non-streaming answer rows: structured output, media, and the notice of a reply that went on after
443
+ * its call failed. Errors show on the message's status; citations coalesce in bodyRows.
444
+ */
440
445
  function ResultBlock({ block }) {
446
+ const showResumed = useContext(ShowResumedNotice);
441
447
  switch (block.kind) {
448
+ case 'resumed':
449
+ return showResumed ? (_jsx(Text, { size: "sm", color: "secondary", children: block.message })) : null;
442
450
  case 'error':
443
451
  case 'citation':
444
452
  return null;
@@ -710,7 +718,7 @@ function isBareFailure(group) {
710
718
  }
711
719
  /** Theorem transcript blocks rendered as Astryx chat messages. */
712
720
  export function ChatTranscript(props) {
713
- return (_jsx(TheoremLabelsProvider, { children: _jsx(ShowUsage.Provider, { value: props.usage === true, children: _jsx(ShowToolData.Provider, { value: props.showToolData !== false, children: _jsx(ShowToolDurations.Provider, { value: props.showToolDurations !== false, children: _jsx(ShowWorkStatus.Provider, { value: props.showWorkStatus !== false, children: _jsx(ChatTranscriptBody, { ...props }) }) }) }) }) }));
721
+ return (_jsx(TheoremLabelsProvider, { children: _jsx(ShowUsage.Provider, { value: props.usage === true, children: _jsx(ShowToolData.Provider, { value: props.showToolData !== false, children: _jsx(ShowToolDurations.Provider, { value: props.showToolDurations !== false, children: _jsx(ShowWorkStatus.Provider, { value: props.showWorkStatus !== false, children: _jsx(ShowResumedNotice.Provider, { value: props.showResumedNotice !== false, children: _jsx(ChatTranscriptBody, { ...props }) }) }) }) }) }) }));
714
722
  }
715
723
  function ChatTranscriptBody({ blocks, handle, streaming = false, delivery, onToolDecision, answering = null, onAuthenticated, emptyState, dividers, imageOutput, bodyKindPlacement, stepLayout, labels, clock, }) {
716
724
  const groups = useMemo(() => groupTranscriptBlocks(blocks, dividers && new Set(Object.keys(dividers))), [blocks, dividers]);
@@ -34,6 +34,7 @@ export function transcriptBlockCopyText(t, block) {
34
34
  case 'error':
35
35
  return block.message;
36
36
  case 'guardrail':
37
+ case 'resumed':
37
38
  case 'late-results':
38
39
  case 'turn-done':
39
40
  return '';