@theoremjs/react 0.3.4-next.419.g1bc04b7 → 0.3.4-next.421.g4bac1c7
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 +2 -0
- package/package.json +3 -3
- package/ui/TheoremChat.d.ts +8 -0
- package/ui/TheoremChat.js +3 -1
package/README.md
CHANGED
|
@@ -169,6 +169,8 @@ The profile, the keys, and the system prompt stay on the server. The browser rec
|
|
|
169
169
|
| `trace` | Shows the trace instead of the chat. Use it when your own control switches the view. The profile must record traces. |
|
|
170
170
|
| `conversation`, `conversationView`, `onConversationChange` | Resume a conversation that the server keeps, or open one you started. See below. |
|
|
171
171
|
| `initialText` | The text that the composer starts with. The user can send it or change it. The component reads it once, when it mounts. |
|
|
172
|
+
| `initialFiles` | The files that the composer starts with, staged to send. The component reads them once, when it mounts. |
|
|
173
|
+
| `initialPending` | The messages that the composer starts with set aside: queued, stashed, or steering, as `createComposerPendingMessage` from `@theoremjs/agents/interface` makes them. The component reads them once, when it mounts. |
|
|
172
174
|
| `chatRef` | Sends a message from your code. See below. |
|
|
173
175
|
| `composer` | `false` leaves the composer out. The chat is the transcript alone, and your own control sends through `chatRef`. Default: `true`. |
|
|
174
176
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/react",
|
|
3
|
-
"version": "0.3.4-next.
|
|
3
|
+
"version": "0.3.4-next.421.g4bac1c7",
|
|
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.4-next.
|
|
64
|
-
"@theoremjs/web": "^0.3.4-next.
|
|
63
|
+
"@theoremjs/agents": "^0.3.4-next.421.g4bac1c7",
|
|
64
|
+
"@theoremjs/web": "^0.3.4-next.421.g4bac1c7"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@astryxdesign/core": {
|
package/ui/TheoremChat.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DefinedTheme } from '@astryxdesign/core/theme';
|
|
2
|
+
import { type ComposerPendingMessage } from '@theoremjs/agents/interface';
|
|
2
3
|
import type { PageTools } from '@theoremjs/web/client';
|
|
3
4
|
import { type ConversationView, type HttpTransportOptions, type TheoremTransport } from '@theoremjs/web/client';
|
|
4
5
|
import { type ReactNode, type Ref } from 'react';
|
|
@@ -84,6 +85,13 @@ export type TheoremChatProps = {
|
|
|
84
85
|
conversationView?: ConversationView;
|
|
85
86
|
/** The text the composer starts with, for the user to send or change. Read once, when the chat mounts. */
|
|
86
87
|
initialText?: string;
|
|
88
|
+
/** The files the composer starts with, staged to send. Read once, when the chat mounts. */
|
|
89
|
+
initialFiles?: readonly File[];
|
|
90
|
+
/**
|
|
91
|
+
* The messages the composer starts with set aside: queued, stashed or steering, as
|
|
92
|
+
* `createComposerPendingMessage` makes them. Read once, when the chat mounts.
|
|
93
|
+
*/
|
|
94
|
+
initialPending?: readonly ComposerPendingMessage[];
|
|
87
95
|
/**
|
|
88
96
|
* Called with each new ref the host issues for the conversation: once the message posts, and
|
|
89
97
|
* again as the reply's runs are saved. Keep the latest to resume the chat later. `undefined`
|
package/ui/TheoremChat.js
CHANGED
|
@@ -53,7 +53,7 @@ function ChatComposerForChat({ chat, iface, placeholder, inputRef, }) {
|
|
|
53
53
|
void chat.handleSendNow(message);
|
|
54
54
|
} }));
|
|
55
55
|
}
|
|
56
|
-
function ChatBody({ transport, iface, placeholder, emptyState, density, maxWidth = DEFAULT_CHAT_MAX_WIDTH, scrollRef, trace, usage, className, style, conversation, conversationView, initialText, onConversationChange, chatRef, composer: hasComposer = true, slots, onSlotsChange, context, pageTools, onTurnEvent, }) {
|
|
56
|
+
function ChatBody({ transport, iface, placeholder, emptyState, density, maxWidth = DEFAULT_CHAT_MAX_WIDTH, scrollRef, trace, usage, className, style, conversation, conversationView, initialText, initialFiles, initialPending, onConversationChange, chatRef, composer: hasComposer = true, slots, onSlotsChange, context, pageTools, onTurnEvent, }) {
|
|
57
57
|
const t = useLabels();
|
|
58
58
|
const chat = useTheoremChat({
|
|
59
59
|
transport,
|
|
@@ -61,6 +61,8 @@ function ChatBody({ transport, iface, placeholder, emptyState, density, maxWidth
|
|
|
61
61
|
conversation,
|
|
62
62
|
conversationView,
|
|
63
63
|
initialText,
|
|
64
|
+
initialFiles,
|
|
65
|
+
initialPending,
|
|
64
66
|
onConversationChange,
|
|
65
67
|
slots,
|
|
66
68
|
onSlotsChange,
|