@theoremjs/react 0.3.5-next.1005.geaafb0b → 0.3.5-next.1007.g0511d99

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/README.md CHANGED
@@ -606,7 +606,7 @@ The composer bar has a selector for the model, its effort, and each option. When
606
606
 
607
607
  A tool call that runs on in the background after its reply ends shows as running, with "⋅ running in the background" after its name (`@theorem.transcript.tool_background`). The words go when the call's end reaches the transcript.
608
608
 
609
- A failed tool call in `ChatTranscript` shows its failure once: the row shows the message the model read, and the details show its `code`, `kind`, and `details`.
609
+ A failed tool call in `ChatTranscript` shows its failure in the person's wording: the row shows the failure's `error`, or "Failed" (`@theorem.transcript.tool_failed`) when it has none. The message the model read shows only in the call's details, with its `code`, `kind`, and `details`.
610
610
 
611
611
  `ChatTranscript` places `citation` blocks after the answer text by default (the Sources strip under the prose). Pass `bodyKindPlacement={{}}` when citations must stay in stream order between text segments (inline citations).
612
612
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/react",
3
- "version": "0.3.5-next.1005.geaafb0b",
3
+ "version": "0.3.5-next.1007.g0511d99",
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.1005.geaafb0b",
64
- "@theoremjs/web": "^0.3.5-next.1005.geaafb0b"
63
+ "@theoremjs/agents": "^0.3.5-next.1007.g0511d99",
64
+ "@theoremjs/web": "^0.3.5-next.1007.g0511d99"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@astryxdesign/core": {
@@ -477,12 +477,13 @@ function toolDuration(t, tool, shows) {
477
477
  function toolUsageStats(state, shows) {
478
478
  return shows.usage && state.tokens ? { stats: _jsx(Usage, { tokens: state.tokens }) } : {};
479
479
  }
480
- // why: The row already reads the failure's message, and `error` is the person's wording of the
481
- // same failure, so the detail holds only what the row does not say.
480
+ // why: The row reads the person's wording of the failure; the model's message, and the rest of the
481
+ // failure, show only in the call's detail.
482
482
  function failureDetail(failure) {
483
483
  return {
484
484
  code: failure.code,
485
485
  kind: failure.kind,
486
+ message: failure.message,
486
487
  ...(failure.details === undefined ? {} : { details: failure.details }),
487
488
  };
488
489
  }
@@ -490,19 +491,26 @@ function failureDetail(failure) {
490
491
  function rowDetail(t, tool, shows, result) {
491
492
  return shows.detail ? { resultDetail: toolDetail(t, tool, result) } : {};
492
493
  }
494
+ /** A failed call's row: the person's wording of its failure, and the rest in its detail. */
495
+ function failedToolItem(t, base, tool, state, shows) {
496
+ // why: A failure the server worded carries `error`; one saved before it did falls back to
497
+ // the transcript's own line, never to the model's message.
498
+ const said = state.failure.error ?? t('@theorem.transcript.tool_failed');
499
+ return {
500
+ ...base,
501
+ status: 'error',
502
+ target: said,
503
+ ...toolUsageStats(state, shows),
504
+ errorMessage: said,
505
+ ...rowDetail(t, tool, shows, _jsx(ShapedData, { value: failureDetail(state.failure), title: t('@theorem.transcript.tool_error') })),
506
+ };
507
+ }
493
508
  function toolCallItem(t, id, tool, shows) {
494
509
  const base = { key: id, name: toolCallLabel(tool) };
495
510
  const { state } = tool;
496
511
  switch (state?.phase) {
497
512
  case 'error':
498
- return {
499
- ...base,
500
- status: 'error',
501
- target: state.failure.message,
502
- ...toolUsageStats(state, shows),
503
- errorMessage: state.failure.message,
504
- ...rowDetail(t, tool, shows, _jsx(ShapedData, { value: failureDetail(state.failure), title: t('@theorem.transcript.tool_error') })),
505
- };
513
+ return failedToolItem(t, base, tool, state, shows);
506
514
  case 'complete':
507
515
  return {
508
516
  ...base,
package/ui/labels.d.ts CHANGED
@@ -293,6 +293,10 @@ export declare const THEOREM_UI_CATALOG: {
293
293
  readonly defaultMessage: "Output";
294
294
  readonly description: "A tool call's result, in its detail.";
295
295
  };
296
+ readonly '@theorem.transcript.tool_failed': {
297
+ readonly defaultMessage: "Failed";
298
+ readonly description: "A failed tool call, on its row, when the failure carries no wording of its own.";
299
+ };
296
300
  readonly '@theorem.transcript.tool_error': {
297
301
  readonly defaultMessage: "Error";
298
302
  readonly description: "A failed tool call's failure, in its detail.";
package/ui/labels.js CHANGED
@@ -277,6 +277,10 @@ export const THEOREM_UI_CATALOG = {
277
277
  defaultMessage: 'Output',
278
278
  description: "A tool call's result, in its detail.",
279
279
  },
280
+ '@theorem.transcript.tool_failed': {
281
+ defaultMessage: 'Failed',
282
+ description: 'A failed tool call, on its row, when the failure carries no wording of its own.',
283
+ },
280
284
  '@theorem.transcript.tool_error': {
281
285
  defaultMessage: 'Error',
282
286
  description: "A failed tool call's failure, in its detail.",