@nexface/chat 0.1.21-alpha.0 → 0.1.21-alpha.2
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/assistant-runtime.js +14 -4
- package/dist/default-chat.js +192 -151
- package/dist/react.d.ts +6 -0
- package/dist/react.js +490 -92
- package/dist/session-coordinator.d.ts +23 -0
- package/dist/session-coordinator.js +139 -0
- package/dist/session-history.d.ts +29 -0
- package/dist/session-history.js +282 -0
- package/dist/storage.d.ts +3 -6
- package/dist/storage.js +50 -44
- package/dist/styles.css +5 -1
- package/dist/ui/thread-list.aui.d.ts +2 -1
- package/dist/ui/thread-list.aui.js +6 -2
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useLayoutEffect, useReducer, useRef, useState } from "react";
|
|
3
3
|
import { AssistantRuntimeProvider, MessageNotSentError, useExternalStoreRuntime, } from "@assistant-ui/react";
|
|
4
4
|
import { AssistantAttachments, toAssistantAttachment } from "./assistant-attachments.js";
|
|
5
|
-
import { assertChatSendable } from "./react.js";
|
|
5
|
+
import { assertChatSendable, sessionCommandResult } from "./react.js";
|
|
6
6
|
import { useVoiceInput } from "./voice/use-voice.js";
|
|
7
7
|
function parseToolArgs(text) {
|
|
8
8
|
try {
|
|
@@ -155,10 +155,20 @@ export function SessionRuntime({ id, chat, options, dictation, open = true, bloc
|
|
|
155
155
|
})),
|
|
156
156
|
onSwitchToNewThread: () => {
|
|
157
157
|
latest.current.createSession();
|
|
158
|
+
return sessionCommandResult(latest.current);
|
|
159
|
+
},
|
|
160
|
+
onSwitchToThread: (next) => {
|
|
161
|
+
latest.current.switchSession(next);
|
|
162
|
+
return sessionCommandResult(latest.current);
|
|
163
|
+
},
|
|
164
|
+
onRename: (target, title) => {
|
|
165
|
+
latest.current.renameSession(target, title);
|
|
166
|
+
return sessionCommandResult(latest.current);
|
|
167
|
+
},
|
|
168
|
+
onDelete: (target) => {
|
|
169
|
+
latest.current.deleteSession(target);
|
|
170
|
+
return sessionCommandResult(latest.current);
|
|
158
171
|
},
|
|
159
|
-
onSwitchToThread: (next) => latest.current.switchSession(next),
|
|
160
|
-
onRename: (target, title) => latest.current.renameSession(target, title),
|
|
161
|
-
onDelete: (target) => latest.current.deleteSession(target),
|
|
162
172
|
},
|
|
163
173
|
},
|
|
164
174
|
});
|