@hanzo/rooms 0.1.78 → 0.1.79
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/dist/Chat.js +9 -2
- package/package.json +3 -3
package/dist/Chat.js
CHANGED
|
@@ -757,8 +757,14 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
757
757
|
if (kept && kept !== open) {
|
|
758
758
|
written.current.add(kept);
|
|
759
759
|
reopen(kept);
|
|
760
|
+
// THE SERVER TITLES A THREAD FROM ITS FIRST TURN, block and all: a turn
|
|
761
|
+
// that carried files or a plugin's words is renamed to the words alone.
|
|
762
|
+
const first = chat.messages.find((m) => m.role === "user");
|
|
763
|
+
const read = first ? told(words(first.content)) : null;
|
|
764
|
+
if (read?.carried)
|
|
765
|
+
void ai.threads.update(kept, { title: read.text.trim().slice(0, 80) || "Files" }).catch(() => { });
|
|
760
766
|
}
|
|
761
|
-
}, [kept, open, reopen]);
|
|
767
|
+
}, [kept, open, reopen]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
762
768
|
// The thread's turns, replaced wholesale or through an updater. `set` is the
|
|
763
769
|
// hook's own state setter, so it takes either.
|
|
764
770
|
const apply = useRef(set);
|
|
@@ -1181,7 +1187,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1181
1187
|
// The files held for this message, as bytes, for a plugin that reads them (PDF).
|
|
1182
1188
|
const bytes = await Promise.all(files.filter((h) => h.href).map(async (h) => new File([await (await fetch(h.href)).blob()], h.name, { type: h.type })));
|
|
1183
1189
|
const got = await carry.prep({ text, files: bytes, thread: open ?? "" }, new AbortController().signal);
|
|
1184
|
-
|
|
1190
|
+
// An answer of a plugin's own (a deck) is the answer, whatever else was prepared.
|
|
1191
|
+
if (got.reply)
|
|
1185
1192
|
return answered(text, got.reply);
|
|
1186
1193
|
deliver(text, got.system ?? "");
|
|
1187
1194
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/rooms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.79",
|
|
4
4
|
"description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@hanzo/ai": ">=0.6.23",
|
|
51
51
|
"@hanzo/appearance": ">=0.2.6",
|
|
52
|
-
"@hanzo/build": ">=0.2.
|
|
52
|
+
"@hanzo/build": ">=0.2.66",
|
|
53
53
|
"@hanzo/composer": ">=0.2.0",
|
|
54
54
|
"@hanzo/event": ">=0.3.56",
|
|
55
55
|
"@hanzo/gui": "^8.3.5",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@hanzo/ai": "0.6.23",
|
|
69
69
|
"@hanzo/appearance": "0.2.8",
|
|
70
|
-
"@hanzo/build": "0.2.
|
|
70
|
+
"@hanzo/build": "0.2.66",
|
|
71
71
|
"@hanzo/composer": "0.2.0",
|
|
72
72
|
"@hanzo/design": "0.5.34",
|
|
73
73
|
"@hanzo/event": "0.3.56",
|