@theoremjs/react 0.3.5-next.998.g91798c5 → 0.3.5-next.999.gc01f07c

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.
@@ -108,7 +108,7 @@ export declare function workStatus(args: {
108
108
  * latest tool → body (while streaming too, so the answer streams formatted)
109
109
  * - No tools: thoughts still go to trace; remaining kinds → body
110
110
  * - Under `stepLayout: 'inline'`, nothing is traced: every block but the first gate is body, in
111
- * stream order, and thoughts that say nothing are dropped
111
+ * stream order; thoughts, and words before a call, that say nothing are dropped
112
112
  * - Body kinds then follow {@link ComposeAssistantTurnOptions.bodyKindPlacement}
113
113
  * (default: citations last)
114
114
  */
@@ -165,7 +165,7 @@ function classifyNonGateBlock(block, args, trace, body) {
165
165
  * latest tool → body (while streaming too, so the answer streams formatted)
166
166
  * - No tools: thoughts still go to trace; remaining kinds → body
167
167
  * - Under `stepLayout: 'inline'`, nothing is traced: every block but the first gate is body, in
168
- * stream order, and thoughts that say nothing are dropped
168
+ * stream order; thoughts, and words before a call, that say nothing are dropped
169
169
  * - Body kinds then follow {@link ComposeAssistantTurnOptions.bodyKindPlacement}
170
170
  * (default: citations last)
171
171
  */
@@ -177,8 +177,12 @@ export function composeAssistantTurn(blocks, options) {
177
177
  const nonGate = visible.filter((block) => block !== nextGate);
178
178
  const placement = options?.bodyKindPlacement ?? DEFAULT_BODY_KIND_PLACEMENT;
179
179
  if (options?.stepLayout === 'inline') {
180
- // why: In place, a step is a body row like the words around it; an empty thought says nothing.
181
- const body = nonGate.filter((block) => block.kind !== 'thought' || block.text.trim());
180
+ // why: In place, a step is a body row like the words around it. As in the trace, a thought or
181
+ // the words before a call that say nothing are dropped; the answer after the last call stays,
182
+ // empty while it starts streaming.
183
+ const lastToolIndex = lastToolIndexOf(nonGate);
184
+ const body = nonGate.filter((block, index) => !(block.kind === 'thought' || (block.kind === 'text' && index < lastToolIndex)) ||
185
+ block.text.trim());
182
186
  return {
183
187
  trace: [],
184
188
  gatedTools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/react",
3
- "version": "0.3.5-next.998.g91798c5",
3
+ "version": "0.3.5-next.999.gc01f07c",
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.998.g91798c5",
64
- "@theoremjs/web": "^0.3.5-next.998.g91798c5"
63
+ "@theoremjs/agents": "^0.3.5-next.999.gc01f07c",
64
+ "@theoremjs/web": "^0.3.5-next.999.gc01f07c"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@astryxdesign/core": {