@theoremjs/react 0.3.5-next.1005.geaafb0b → 0.3.5-next.1008.gb45d164
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 +1 -1
- package/package.json +3 -3
- package/ui/ChatTranscript.js +18 -10
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
|
|
609
|
+
A failed tool call in `ChatTranscript` shows its failure in the person's wording: the row shows the failure's `error`, which the server words in the profile's labels. 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.
|
|
3
|
+
"version": "0.3.5-next.1008.gb45d164",
|
|
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.
|
|
64
|
-
"@theoremjs/web": "^0.3.5-next.
|
|
63
|
+
"@theoremjs/agents": "^0.3.5-next.1008.gb45d164",
|
|
64
|
+
"@theoremjs/web": "^0.3.5-next.1008.gb45d164"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@astryxdesign/core": {
|
package/ui/ChatTranscript.js
CHANGED
|
@@ -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
|
|
481
|
-
//
|
|
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: The server words every failure it hands the page, in the profile's labels; the row
|
|
497
|
+
// shows that wording, never the model's message.
|
|
498
|
+
const said = state.failure.error;
|
|
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,
|