@assistant-ui/react 0.15.7 → 0.15.9
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/LICENSE +21 -0
- package/dist/client/ExternalThread.d.ts +3 -1
- package/dist/client/ExternalThread.d.ts.map +1 -1
- package/dist/client/ExternalThread.js +524 -335
- package/dist/client/ExternalThread.js.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.d.ts +1 -0
- package/dist/legacy-runtime/cloud/auiV0.d.ts.map +1 -1
- package/dist/legacy-runtime/cloud/auiV0.js +2 -1
- package/dist/legacy-runtime/cloud/auiV0.js.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +2 -0
- package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
- package/dist/unstable/useLiveCompletionAdapter.js +32 -7
- package/dist/unstable/useLiveCompletionAdapter.js.map +1 -1
- package/dist/utils/useToolArgsFieldStatus.d.ts +2 -2
- package/package.json +13 -15
- package/src/client/ExternalThread.ts +172 -9
- package/src/legacy-runtime/cloud/auiV0.ts +8 -1
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransport.spec.md +1 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.test.tsx +79 -0
- package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.ts +2 -0
- package/src/tests/external-thread-feedback.test.tsx +204 -0
- package/src/tests/external-thread-speech.test.tsx +328 -0
- package/src/unstable/useLiveCompletionAdapter.test.tsx +90 -0
- package/src/unstable/useLiveCompletionAdapter.ts +32 -7
|
@@ -16,8 +16,8 @@ const derivePartStatus = (message, partIndex, part) => {
|
|
|
16
16
|
return toMessagePartStatus(message, partIndex, part);
|
|
17
17
|
};
|
|
18
18
|
const useMessageClient = (t0) => {
|
|
19
|
-
const $ = c(
|
|
20
|
-
const { message, index, parentId, onEdit, onReload, queue, branches, onRespondToToolApproval, onAddToolResult, onResumeToolCall, attachmentAdapter } = t0;
|
|
19
|
+
const $ = c(71);
|
|
20
|
+
const { message, index, parentId, onEdit, onReload, queue, branches, onRespondToToolApproval, onAddToolResult, onResumeToolCall, attachmentAdapter, submittedFeedback, onSubmitFeedback, speech, onSpeak, onStopSpeaking } = t0;
|
|
21
21
|
const [isCopied, setIsCopied] = useState(false);
|
|
22
22
|
const [isHovering, setIsHovering] = useState(false);
|
|
23
23
|
const [isEditing, setIsEditing] = useState(false);
|
|
@@ -121,127 +121,145 @@ const useMessageClient = (t0) => {
|
|
|
121
121
|
const branchNumber = branchIndex === -1 ? 1 : branchIndex + 1;
|
|
122
122
|
const branchCount = branchIndex === -1 ? 1 : branchIds.length;
|
|
123
123
|
let t9;
|
|
124
|
-
if ($[25] !== message
|
|
125
|
-
t9 = message.
|
|
126
|
-
$[25] = message.attachments;
|
|
127
|
-
$[26] = t9;
|
|
128
|
-
} else t9 = $[26];
|
|
129
|
-
let t10;
|
|
130
|
-
if ($[27] !== branchCount || $[28] !== branchNumber || $[29] !== composerClient.state || $[30] !== index || $[31] !== isCopied || $[32] !== isHovering || $[33] !== message || $[34] !== parentId || $[35] !== partClients.state || $[36] !== t9) {
|
|
131
|
-
t10 = {
|
|
124
|
+
if ($[25] !== message || $[26] !== submittedFeedback) {
|
|
125
|
+
t9 = submittedFeedback && message.role === "assistant" ? {
|
|
132
126
|
...message,
|
|
133
|
-
|
|
127
|
+
metadata: {
|
|
128
|
+
...message.metadata,
|
|
129
|
+
submittedFeedback: { type: submittedFeedback }
|
|
130
|
+
}
|
|
131
|
+
} : message;
|
|
132
|
+
$[25] = message;
|
|
133
|
+
$[26] = submittedFeedback;
|
|
134
|
+
$[27] = t9;
|
|
135
|
+
} else t9 = $[27];
|
|
136
|
+
const messageWithFeedback = t9;
|
|
137
|
+
let t10;
|
|
138
|
+
if ($[28] !== message.attachments) {
|
|
139
|
+
t10 = message.attachments ?? [];
|
|
140
|
+
$[28] = message.attachments;
|
|
141
|
+
$[29] = t10;
|
|
142
|
+
} else t10 = $[29];
|
|
143
|
+
let t11;
|
|
144
|
+
if ($[30] !== branchCount || $[31] !== branchNumber || $[32] !== composerClient.state || $[33] !== index || $[34] !== isCopied || $[35] !== isHovering || $[36] !== messageWithFeedback || $[37] !== parentId || $[38] !== partClients.state || $[39] !== speech || $[40] !== t10) {
|
|
145
|
+
t11 = {
|
|
146
|
+
...messageWithFeedback,
|
|
147
|
+
attachments: t10,
|
|
134
148
|
parentId,
|
|
135
149
|
isLast: false,
|
|
136
150
|
branchNumber,
|
|
137
151
|
branchCount,
|
|
138
|
-
speech
|
|
152
|
+
speech,
|
|
139
153
|
parts: partClients.state,
|
|
140
154
|
isCopied,
|
|
141
155
|
isHovering,
|
|
142
156
|
index,
|
|
143
157
|
composer: composerClient.state
|
|
144
158
|
};
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if ($[38] !== state) {
|
|
160
|
-
t11 = () => state;
|
|
161
|
-
$[38] = state;
|
|
162
|
-
$[39] = t11;
|
|
163
|
-
} else t11 = $[39];
|
|
159
|
+
$[30] = branchCount;
|
|
160
|
+
$[31] = branchNumber;
|
|
161
|
+
$[32] = composerClient.state;
|
|
162
|
+
$[33] = index;
|
|
163
|
+
$[34] = isCopied;
|
|
164
|
+
$[35] = isHovering;
|
|
165
|
+
$[36] = messageWithFeedback;
|
|
166
|
+
$[37] = parentId;
|
|
167
|
+
$[38] = partClients.state;
|
|
168
|
+
$[39] = speech;
|
|
169
|
+
$[40] = t10;
|
|
170
|
+
$[41] = t11;
|
|
171
|
+
} else t11 = $[41];
|
|
172
|
+
const state = t11;
|
|
164
173
|
let t12;
|
|
165
|
-
if ($[
|
|
166
|
-
t12 = () =>
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
} else t12 = $[
|
|
174
|
+
if ($[42] !== state) {
|
|
175
|
+
t12 = () => state;
|
|
176
|
+
$[42] = state;
|
|
177
|
+
$[43] = t12;
|
|
178
|
+
} else t12 = $[43];
|
|
170
179
|
let t13;
|
|
171
|
-
if ($[
|
|
172
|
-
t13 = () =>
|
|
180
|
+
if ($[44] !== composerClient.methods) {
|
|
181
|
+
t13 = () => composerClient.methods;
|
|
182
|
+
$[44] = composerClient.methods;
|
|
183
|
+
$[45] = t13;
|
|
184
|
+
} else t13 = $[45];
|
|
185
|
+
let t14;
|
|
186
|
+
if ($[46] !== onReload) {
|
|
187
|
+
t14 = () => {
|
|
173
188
|
onReload?.();
|
|
174
189
|
};
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
} else
|
|
178
|
-
let
|
|
179
|
-
if ($[
|
|
180
|
-
|
|
181
|
-
const { position, branchId } =
|
|
190
|
+
$[46] = onReload;
|
|
191
|
+
$[47] = t14;
|
|
192
|
+
} else t14 = $[47];
|
|
193
|
+
let t15;
|
|
194
|
+
if ($[48] !== branchIds || $[49] !== branchIndex || $[50] !== branches || $[51] !== message.id) {
|
|
195
|
+
t15 = (t16) => {
|
|
196
|
+
const { position, branchId } = t16;
|
|
182
197
|
if (!branches) return;
|
|
183
198
|
const target = branchId ?? (branchIndex === -1 ? void 0 : position === "previous" ? branchIds[branchIndex - 1] : position === "next" ? branchIds[branchIndex + 1] : void 0);
|
|
184
199
|
if (target !== void 0 && target !== message.id) branches.switchToBranch(target);
|
|
185
200
|
};
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
} else
|
|
192
|
-
let t15;
|
|
193
|
-
if ($[49] !== message) {
|
|
194
|
-
t15 = () => getThreadMessageText(message);
|
|
195
|
-
$[49] = message;
|
|
196
|
-
$[50] = t15;
|
|
197
|
-
} else t15 = $[50];
|
|
201
|
+
$[48] = branchIds;
|
|
202
|
+
$[49] = branchIndex;
|
|
203
|
+
$[50] = branches;
|
|
204
|
+
$[51] = message.id;
|
|
205
|
+
$[52] = t15;
|
|
206
|
+
} else t15 = $[52];
|
|
198
207
|
let t16;
|
|
199
|
-
if ($[
|
|
200
|
-
t16 = (
|
|
208
|
+
if ($[53] !== message) {
|
|
209
|
+
t16 = () => getThreadMessageText(message);
|
|
210
|
+
$[53] = message;
|
|
211
|
+
$[54] = t16;
|
|
212
|
+
} else t16 = $[54];
|
|
213
|
+
let t17;
|
|
214
|
+
if ($[55] !== partClients || $[56] !== state) {
|
|
215
|
+
t17 = (selector) => {
|
|
201
216
|
if ("index" in selector) return partClients.get(selector);
|
|
202
217
|
const partIndex = state.parts.findIndex((p) => p.type === "tool-call" && p.toolCallId === selector.toolCallId);
|
|
203
218
|
return partClients.get({ index: partIndex });
|
|
204
219
|
};
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
} else
|
|
209
|
-
let
|
|
210
|
-
if ($[
|
|
211
|
-
|
|
220
|
+
$[55] = partClients;
|
|
221
|
+
$[56] = state;
|
|
222
|
+
$[57] = t17;
|
|
223
|
+
} else t17 = $[57];
|
|
224
|
+
let t18;
|
|
225
|
+
if ($[58] !== attachmentClients) {
|
|
226
|
+
t18 = (selector_0) => {
|
|
212
227
|
if ("id" in selector_0) return attachmentClients.get({ key: selector_0.id });
|
|
213
228
|
return attachmentClients.get(selector_0);
|
|
214
229
|
};
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
} else
|
|
218
|
-
let
|
|
219
|
-
if ($[
|
|
220
|
-
|
|
221
|
-
getState:
|
|
222
|
-
composer:
|
|
230
|
+
$[58] = attachmentClients;
|
|
231
|
+
$[59] = t18;
|
|
232
|
+
} else t18 = $[59];
|
|
233
|
+
let t19;
|
|
234
|
+
if ($[60] !== onSpeak || $[61] !== onStopSpeaking || $[62] !== onSubmitFeedback || $[63] !== t12 || $[64] !== t13 || $[65] !== t14 || $[66] !== t15 || $[67] !== t16 || $[68] !== t17 || $[69] !== t18) {
|
|
235
|
+
t19 = {
|
|
236
|
+
getState: t12,
|
|
237
|
+
composer: t13,
|
|
223
238
|
delete: _temp3,
|
|
224
|
-
reload:
|
|
225
|
-
speak:
|
|
226
|
-
stopSpeaking:
|
|
227
|
-
submitFeedback:
|
|
228
|
-
switchToBranch:
|
|
229
|
-
getCopyText:
|
|
230
|
-
part:
|
|
231
|
-
attachment:
|
|
239
|
+
reload: t14,
|
|
240
|
+
speak: onSpeak,
|
|
241
|
+
stopSpeaking: onStopSpeaking,
|
|
242
|
+
submitFeedback: onSubmitFeedback,
|
|
243
|
+
switchToBranch: t15,
|
|
244
|
+
getCopyText: t16,
|
|
245
|
+
part: t17,
|
|
246
|
+
attachment: t18,
|
|
232
247
|
setIsCopied,
|
|
233
248
|
setIsHovering
|
|
234
249
|
};
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
|
|
244
|
-
|
|
250
|
+
$[60] = onSpeak;
|
|
251
|
+
$[61] = onStopSpeaking;
|
|
252
|
+
$[62] = onSubmitFeedback;
|
|
253
|
+
$[63] = t12;
|
|
254
|
+
$[64] = t13;
|
|
255
|
+
$[65] = t14;
|
|
256
|
+
$[66] = t15;
|
|
257
|
+
$[67] = t16;
|
|
258
|
+
$[68] = t17;
|
|
259
|
+
$[69] = t18;
|
|
260
|
+
$[70] = t19;
|
|
261
|
+
} else t19 = $[70];
|
|
262
|
+
return t19;
|
|
245
263
|
};
|
|
246
264
|
const MessageClient = resource(useMessageClient);
|
|
247
265
|
const usePartResource = (t0) => {
|
|
@@ -402,7 +420,7 @@ const useComposerClientResource = (t0) => {
|
|
|
402
420
|
if ($[2] !== message || $[3] !== setAttachments || $[4] !== setRole || $[5] !== setText) {
|
|
403
421
|
t4 = () => {
|
|
404
422
|
if (message) {
|
|
405
|
-
const messageText = message.content.filter(
|
|
423
|
+
const messageText = message.content.filter(_temp4).map(_temp5).join("\n\n");
|
|
406
424
|
setText(messageText);
|
|
407
425
|
setRole(message.role);
|
|
408
426
|
setAttachments(message.attachments ?? []);
|
|
@@ -457,7 +475,7 @@ const useComposerClientResource = (t0) => {
|
|
|
457
475
|
if ($[19] !== attachmentAdapter) {
|
|
458
476
|
t8 = async (removed) => {
|
|
459
477
|
if (!attachmentAdapter) return;
|
|
460
|
-
await Promise.all(removed.filter(
|
|
478
|
+
await Promise.all(removed.filter(_temp6).map((a_1) => attachmentAdapter.remove(a_1)));
|
|
461
479
|
};
|
|
462
480
|
$[19] = attachmentAdapter;
|
|
463
481
|
$[20] = t8;
|
|
@@ -723,8 +741,8 @@ const useComposerClientResource = (t0) => {
|
|
|
723
741
|
send: t19,
|
|
724
742
|
cancel: onCancel,
|
|
725
743
|
beginEdit: t20,
|
|
726
|
-
startDictation:
|
|
727
|
-
stopDictation:
|
|
744
|
+
startDictation: _temp7,
|
|
745
|
+
stopDictation: _temp8,
|
|
728
746
|
setQuote,
|
|
729
747
|
queueItem: t21
|
|
730
748
|
};
|
|
@@ -746,6 +764,57 @@ const useComposerClientResource = (t0) => {
|
|
|
746
764
|
return t22;
|
|
747
765
|
};
|
|
748
766
|
const ComposerClientResource = resource(useComposerClientResource);
|
|
767
|
+
const createSpeechController = (notify) => {
|
|
768
|
+
let session;
|
|
769
|
+
const clear = () => {
|
|
770
|
+
if (!session) return;
|
|
771
|
+
session.cancel();
|
|
772
|
+
session = void 0;
|
|
773
|
+
notify(void 0);
|
|
774
|
+
};
|
|
775
|
+
return {
|
|
776
|
+
speak: (adapter, message) => {
|
|
777
|
+
clear();
|
|
778
|
+
const utterance = adapter.speak(getThreadMessageText(message));
|
|
779
|
+
let unsub;
|
|
780
|
+
unsub = utterance.subscribe(() => {
|
|
781
|
+
if (utterance.status.type === "ended") {
|
|
782
|
+
unsub?.();
|
|
783
|
+
session = void 0;
|
|
784
|
+
notify(void 0);
|
|
785
|
+
} else notify({
|
|
786
|
+
messageId: message.id,
|
|
787
|
+
status: utterance.status
|
|
788
|
+
});
|
|
789
|
+
});
|
|
790
|
+
if (utterance.status.type === "ended") {
|
|
791
|
+
unsub();
|
|
792
|
+
notify(void 0);
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
session = {
|
|
796
|
+
messageId: message.id,
|
|
797
|
+
cancel: () => {
|
|
798
|
+
unsub();
|
|
799
|
+
utterance.cancel();
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
notify({
|
|
803
|
+
messageId: message.id,
|
|
804
|
+
status: utterance.status
|
|
805
|
+
});
|
|
806
|
+
},
|
|
807
|
+
stop: () => {
|
|
808
|
+
if (!session) throw new Error("No message is being spoken");
|
|
809
|
+
clear();
|
|
810
|
+
},
|
|
811
|
+
stopMessage: (messageId) => {
|
|
812
|
+
if (session?.messageId !== messageId) throw new Error("Message is not being spoken");
|
|
813
|
+
clear();
|
|
814
|
+
},
|
|
815
|
+
dispose: clear
|
|
816
|
+
};
|
|
817
|
+
};
|
|
749
818
|
const dedupeMessagesById = (messages) => {
|
|
750
819
|
const seenIds = /* @__PURE__ */ new Set();
|
|
751
820
|
const deduped = [];
|
|
@@ -761,8 +830,8 @@ const dedupeMessagesById = (messages) => {
|
|
|
761
830
|
return deduped.length === messages.length ? messages : deduped.reverse();
|
|
762
831
|
};
|
|
763
832
|
const useExternalThread = (t0) => {
|
|
764
|
-
const $ = c(
|
|
765
|
-
const { messages: messagesProp, isRunning: t1, isLoading: t2, state: threadState, extras, isSendDisabled: t3, onNew, onEdit, onReload, onStartRun, onCancel, onResume, onAddToolResult, onResumeToolCall, onLoadExternalState, attachmentAdapter, queue, branches, onRespondToToolApproval } = t0;
|
|
833
|
+
const $ = c(106);
|
|
834
|
+
const { messages: messagesProp, isRunning: t1, isLoading: t2, state: threadState, extras, isSendDisabled: t3, onNew, onEdit, onReload, onStartRun, onCancel, onResume, onAddToolResult, onResumeToolCall, onLoadExternalState, attachmentAdapter, feedbackAdapter, speechAdapter, queue, branches, onRespondToToolApproval } = t0;
|
|
766
835
|
const isRunning = t1 === void 0 ? false : t1;
|
|
767
836
|
const isLoading = t2 === void 0 ? false : t2;
|
|
768
837
|
const isSendDisabled = t3 === void 0 ? false : t3;
|
|
@@ -774,98 +843,216 @@ const useExternalThread = (t0) => {
|
|
|
774
843
|
} else t4 = $[1];
|
|
775
844
|
const messages = t4;
|
|
776
845
|
let t5;
|
|
777
|
-
if ($[2]
|
|
778
|
-
t5 =
|
|
779
|
-
|
|
846
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
847
|
+
t5 = {};
|
|
848
|
+
$[2] = t5;
|
|
849
|
+
} else t5 = $[2];
|
|
850
|
+
const [submittedFeedback, setSubmittedFeedback] = useState(t5);
|
|
851
|
+
let t6;
|
|
852
|
+
if ($[3] !== submittedFeedback) {
|
|
853
|
+
t6 = (msg) => {
|
|
854
|
+
const entry = submittedFeedback[msg.id];
|
|
855
|
+
return entry && msg.metadata.submittedFeedback?.type === entry.external ? entry.type : void 0;
|
|
856
|
+
};
|
|
857
|
+
$[3] = submittedFeedback;
|
|
858
|
+
$[4] = t6;
|
|
859
|
+
} else t6 = $[4];
|
|
860
|
+
const feedbackFor = t6;
|
|
861
|
+
let t7;
|
|
862
|
+
let t8;
|
|
863
|
+
if ($[5] !== messages) {
|
|
864
|
+
t7 = () => {
|
|
865
|
+
setSubmittedFeedback((prev) => {
|
|
866
|
+
const live = Object.entries(prev).filter((t9) => {
|
|
867
|
+
const [id, entry_0] = t9;
|
|
868
|
+
const msg_0 = messages.find((m) => m.id === id);
|
|
869
|
+
return !!msg_0 && msg_0.metadata.submittedFeedback?.type === entry_0.external;
|
|
870
|
+
});
|
|
871
|
+
return live.length === Object.keys(prev).length ? prev : Object.fromEntries(live);
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
t8 = [messages];
|
|
875
|
+
$[5] = messages;
|
|
876
|
+
$[6] = t7;
|
|
877
|
+
$[7] = t8;
|
|
878
|
+
} else {
|
|
879
|
+
t7 = $[6];
|
|
880
|
+
t8 = $[7];
|
|
881
|
+
}
|
|
882
|
+
useEffect(t7, t8);
|
|
883
|
+
let t9;
|
|
884
|
+
if ($[8] !== feedbackAdapter) {
|
|
885
|
+
t9 = (message, t10) => {
|
|
886
|
+
const { type } = t10;
|
|
887
|
+
if (!feedbackAdapter) throw new Error("Feedback adapter not configured");
|
|
888
|
+
feedbackAdapter.submit({
|
|
889
|
+
message,
|
|
890
|
+
type
|
|
891
|
+
});
|
|
892
|
+
if (message.role === "assistant") setSubmittedFeedback((prev_0) => ({
|
|
893
|
+
...prev_0,
|
|
894
|
+
[message.id]: {
|
|
895
|
+
type,
|
|
896
|
+
external: message.metadata.submittedFeedback?.type
|
|
897
|
+
}
|
|
898
|
+
}));
|
|
899
|
+
};
|
|
900
|
+
$[8] = feedbackAdapter;
|
|
901
|
+
$[9] = t9;
|
|
902
|
+
} else t9 = $[9];
|
|
903
|
+
const handleSubmitFeedback = t9;
|
|
904
|
+
const [speechState, setSpeech] = useState(void 0);
|
|
905
|
+
let t10;
|
|
906
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
907
|
+
t10 = () => createSpeechController(setSpeech);
|
|
908
|
+
$[10] = t10;
|
|
909
|
+
} else t10 = $[10];
|
|
910
|
+
const [speechController] = useState(t10);
|
|
911
|
+
const hasSpeechAdapter = !!speechAdapter;
|
|
912
|
+
const speech = hasSpeechAdapter ? speechState : void 0;
|
|
913
|
+
let t11;
|
|
914
|
+
let t12;
|
|
915
|
+
if ($[11] !== hasSpeechAdapter || $[12] !== speechController) {
|
|
916
|
+
t11 = () => {
|
|
917
|
+
if (!hasSpeechAdapter) speechController.dispose();
|
|
918
|
+
};
|
|
919
|
+
t12 = [hasSpeechAdapter, speechController];
|
|
920
|
+
$[11] = hasSpeechAdapter;
|
|
921
|
+
$[12] = speechController;
|
|
922
|
+
$[13] = t11;
|
|
923
|
+
$[14] = t12;
|
|
924
|
+
} else {
|
|
925
|
+
t11 = $[13];
|
|
926
|
+
t12 = $[14];
|
|
927
|
+
}
|
|
928
|
+
useEffect(t11, t12);
|
|
929
|
+
let t13;
|
|
930
|
+
let t14;
|
|
931
|
+
if ($[15] !== speechController) {
|
|
932
|
+
t13 = () => () => speechController.dispose();
|
|
933
|
+
t14 = [speechController];
|
|
934
|
+
$[15] = speechController;
|
|
935
|
+
$[16] = t13;
|
|
936
|
+
$[17] = t14;
|
|
937
|
+
} else {
|
|
938
|
+
t13 = $[16];
|
|
939
|
+
t14 = $[17];
|
|
940
|
+
}
|
|
941
|
+
useEffect(t13, t14);
|
|
942
|
+
let t15;
|
|
943
|
+
if ($[18] !== speechAdapter || $[19] !== speechController) {
|
|
944
|
+
t15 = (message_0) => {
|
|
945
|
+
if (!speechAdapter) throw new Error("Speech adapter not configured");
|
|
946
|
+
speechController.speak(speechAdapter, message_0);
|
|
947
|
+
};
|
|
948
|
+
$[18] = speechAdapter;
|
|
949
|
+
$[19] = speechController;
|
|
950
|
+
$[20] = t15;
|
|
951
|
+
} else t15 = $[20];
|
|
952
|
+
const handleSpeak = t15;
|
|
953
|
+
let t16;
|
|
954
|
+
if ($[21] !== messages || $[22] !== onReload) {
|
|
955
|
+
t16 = (messageId) => {
|
|
956
|
+
const messageIndex = messages.findIndex((m_0) => m_0.id === messageId);
|
|
780
957
|
if (messageIndex === -1) return;
|
|
781
958
|
const parentId = messageIndex > 0 ? messages[messageIndex - 1].id : null;
|
|
782
959
|
onReload?.(parentId);
|
|
783
960
|
};
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
$[
|
|
787
|
-
} else
|
|
788
|
-
const handleReload =
|
|
789
|
-
let
|
|
790
|
-
if ($[
|
|
791
|
-
|
|
961
|
+
$[21] = messages;
|
|
962
|
+
$[22] = onReload;
|
|
963
|
+
$[23] = t16;
|
|
964
|
+
} else t16 = $[23];
|
|
965
|
+
const handleReload = t16;
|
|
966
|
+
let t17;
|
|
967
|
+
if ($[24] !== attachmentAdapter || $[25] !== branches || $[26] !== feedbackFor || $[27] !== handleReload || $[28] !== handleSpeak || $[29] !== handleSubmitFeedback || $[30] !== messages || $[31] !== onAddToolResult || $[32] !== onEdit || $[33] !== onRespondToToolApproval || $[34] !== onResumeToolCall || $[35] !== queue || $[36] !== speech || $[37] !== speechController) {
|
|
968
|
+
t17 = messages.map((msg_1, index) => {
|
|
792
969
|
const props = {
|
|
793
|
-
message:
|
|
970
|
+
message: msg_1,
|
|
794
971
|
index,
|
|
795
972
|
parentId: index > 0 ? messages[index - 1].id : null,
|
|
796
|
-
onReload: () => handleReload(
|
|
973
|
+
onReload: () => handleReload(msg_1.id),
|
|
797
974
|
queue,
|
|
798
975
|
branches,
|
|
799
976
|
onRespondToToolApproval,
|
|
800
977
|
onAddToolResult,
|
|
801
978
|
onResumeToolCall,
|
|
802
|
-
attachmentAdapter
|
|
979
|
+
attachmentAdapter,
|
|
980
|
+
submittedFeedback: feedbackFor(msg_1),
|
|
981
|
+
onSubmitFeedback: (feedback) => handleSubmitFeedback(msg_1, feedback),
|
|
982
|
+
speech: speech?.messageId === msg_1.id ? speech : void 0,
|
|
983
|
+
onSpeak: () => handleSpeak(msg_1),
|
|
984
|
+
onStopSpeaking: () => speechController.stopMessage(msg_1.id)
|
|
803
985
|
};
|
|
804
986
|
if (onEdit) props.onEdit = onEdit;
|
|
805
|
-
return withKey(
|
|
987
|
+
return withKey(msg_1.id, MessageClient(props));
|
|
806
988
|
});
|
|
807
|
-
$[
|
|
808
|
-
$[
|
|
809
|
-
$[
|
|
810
|
-
$[
|
|
811
|
-
$[
|
|
812
|
-
$[
|
|
813
|
-
$[
|
|
814
|
-
$[
|
|
815
|
-
$[
|
|
816
|
-
$[
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
989
|
+
$[24] = attachmentAdapter;
|
|
990
|
+
$[25] = branches;
|
|
991
|
+
$[26] = feedbackFor;
|
|
992
|
+
$[27] = handleReload;
|
|
993
|
+
$[28] = handleSpeak;
|
|
994
|
+
$[29] = handleSubmitFeedback;
|
|
995
|
+
$[30] = messages;
|
|
996
|
+
$[31] = onAddToolResult;
|
|
997
|
+
$[32] = onEdit;
|
|
998
|
+
$[33] = onRespondToToolApproval;
|
|
999
|
+
$[34] = onResumeToolCall;
|
|
1000
|
+
$[35] = queue;
|
|
1001
|
+
$[36] = speech;
|
|
1002
|
+
$[37] = speechController;
|
|
1003
|
+
$[38] = t17;
|
|
1004
|
+
} else t17 = $[38];
|
|
1005
|
+
const messageClients = useClientLookup(t17);
|
|
1006
|
+
let t18;
|
|
1007
|
+
if ($[39] !== onCancel) {
|
|
1008
|
+
t18 = () => {
|
|
822
1009
|
onCancel?.();
|
|
823
1010
|
};
|
|
824
|
-
$[
|
|
825
|
-
$[
|
|
826
|
-
} else
|
|
827
|
-
const handleCancelRun =
|
|
828
|
-
let
|
|
829
|
-
if ($[
|
|
830
|
-
|
|
1011
|
+
$[39] = onCancel;
|
|
1012
|
+
$[40] = t18;
|
|
1013
|
+
} else t18 = $[40];
|
|
1014
|
+
const handleCancelRun = t18;
|
|
1015
|
+
let t19;
|
|
1016
|
+
if ($[41] !== messages || $[42] !== onNew) {
|
|
1017
|
+
t19 = (message_1) => {
|
|
831
1018
|
onNew?.({
|
|
832
|
-
...
|
|
1019
|
+
...message_1,
|
|
833
1020
|
parentId: messages.at(-1)?.id ?? null
|
|
834
1021
|
});
|
|
835
1022
|
};
|
|
836
|
-
$[
|
|
837
|
-
$[
|
|
838
|
-
$[
|
|
839
|
-
} else
|
|
840
|
-
const handleSendNew =
|
|
841
|
-
let
|
|
842
|
-
if ($[
|
|
843
|
-
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
846
|
-
} else
|
|
847
|
-
const headId =
|
|
848
|
-
let
|
|
849
|
-
if ($[
|
|
850
|
-
|
|
1023
|
+
$[41] = messages;
|
|
1024
|
+
$[42] = onNew;
|
|
1025
|
+
$[43] = t19;
|
|
1026
|
+
} else t19 = $[43];
|
|
1027
|
+
const handleSendNew = t19;
|
|
1028
|
+
let t20;
|
|
1029
|
+
if ($[44] !== messages) {
|
|
1030
|
+
t20 = messages.at(-1)?.id ?? null;
|
|
1031
|
+
$[44] = messages;
|
|
1032
|
+
$[45] = t20;
|
|
1033
|
+
} else t20 = $[45];
|
|
1034
|
+
const headId = t20;
|
|
1035
|
+
let t21;
|
|
1036
|
+
if ($[46] !== headId || $[47] !== queue) {
|
|
1037
|
+
t21 = queue && {
|
|
851
1038
|
...queue,
|
|
852
|
-
enqueue: (
|
|
853
|
-
...
|
|
854
|
-
parentId:
|
|
1039
|
+
enqueue: (message_2) => queue.enqueue({
|
|
1040
|
+
...message_2,
|
|
1041
|
+
parentId: message_2.parentId ?? headId
|
|
855
1042
|
}),
|
|
856
|
-
steer: (
|
|
857
|
-
...
|
|
858
|
-
parentId:
|
|
1043
|
+
steer: (message_3) => queue.steer({
|
|
1044
|
+
...message_3,
|
|
1045
|
+
parentId: message_3.parentId ?? headId
|
|
859
1046
|
})
|
|
860
1047
|
};
|
|
861
|
-
$[
|
|
862
|
-
$[
|
|
863
|
-
$[
|
|
864
|
-
} else
|
|
865
|
-
const composerQueue =
|
|
866
|
-
let
|
|
867
|
-
if ($[
|
|
868
|
-
|
|
1048
|
+
$[46] = headId;
|
|
1049
|
+
$[47] = queue;
|
|
1050
|
+
$[48] = t21;
|
|
1051
|
+
} else t21 = $[48];
|
|
1052
|
+
const composerQueue = t21;
|
|
1053
|
+
let t22;
|
|
1054
|
+
if ($[49] !== attachmentAdapter || $[50] !== composerQueue || $[51] !== handleCancelRun || $[52] !== handleSendNew || $[53] !== isRunning || $[54] !== isSendDisabled) {
|
|
1055
|
+
t22 = ComposerClientResource({
|
|
869
1056
|
type: "thread",
|
|
870
1057
|
isEditing: true,
|
|
871
1058
|
canCancel: isRunning,
|
|
@@ -875,39 +1062,41 @@ const useExternalThread = (t0) => {
|
|
|
875
1062
|
queue: composerQueue,
|
|
876
1063
|
attachmentAdapter
|
|
877
1064
|
});
|
|
878
|
-
$[
|
|
879
|
-
$[
|
|
880
|
-
$[
|
|
881
|
-
$[
|
|
882
|
-
$[
|
|
883
|
-
$[
|
|
884
|
-
$[
|
|
885
|
-
} else
|
|
886
|
-
const composerClient = useClientResource(
|
|
1065
|
+
$[49] = attachmentAdapter;
|
|
1066
|
+
$[50] = composerQueue;
|
|
1067
|
+
$[51] = handleCancelRun;
|
|
1068
|
+
$[52] = handleSendNew;
|
|
1069
|
+
$[53] = isRunning;
|
|
1070
|
+
$[54] = isSendDisabled;
|
|
1071
|
+
$[55] = t22;
|
|
1072
|
+
} else t22 = $[55];
|
|
1073
|
+
const composerClient = useClientResource(t22);
|
|
887
1074
|
const hasQueue = !!queue;
|
|
888
1075
|
const hasBranches = !!branches;
|
|
889
1076
|
const hasEdit = !!onEdit;
|
|
890
1077
|
const hasReload = !!onReload;
|
|
891
1078
|
const hasAttachments = !!attachmentAdapter;
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1079
|
+
const hasFeedback = !!feedbackAdapter;
|
|
1080
|
+
const hasSpeech = !!speechAdapter;
|
|
1081
|
+
let t23;
|
|
1082
|
+
if ($[56] !== messageClients.state) {
|
|
1083
|
+
t23 = messageClients.state.map(_temp9);
|
|
1084
|
+
$[56] = messageClients.state;
|
|
1085
|
+
$[57] = t23;
|
|
1086
|
+
} else t23 = $[57];
|
|
1087
|
+
const messageStates = t23;
|
|
1088
|
+
const t24 = messages.length === 0;
|
|
1089
|
+
let t25;
|
|
1090
|
+
if ($[58] !== hasAttachments || $[59] !== hasBranches || $[60] !== hasEdit || $[61] !== hasFeedback || $[62] !== hasQueue || $[63] !== hasReload || $[64] !== hasSpeech || $[65] !== isRunning) {
|
|
1091
|
+
t25 = {
|
|
903
1092
|
edit: hasEdit,
|
|
904
1093
|
delete: false,
|
|
905
1094
|
reload: hasReload,
|
|
906
1095
|
refetchThread: false,
|
|
907
1096
|
cancel: isRunning,
|
|
908
|
-
speech:
|
|
1097
|
+
speech: hasSpeech,
|
|
909
1098
|
attachments: hasAttachments,
|
|
910
|
-
feedback:
|
|
1099
|
+
feedback: hasFeedback,
|
|
911
1100
|
voice: false,
|
|
912
1101
|
switchToBranch: hasBranches,
|
|
913
1102
|
switchBranchDuringRun: false,
|
|
@@ -915,68 +1104,71 @@ const useExternalThread = (t0) => {
|
|
|
915
1104
|
dictation: false,
|
|
916
1105
|
queue: hasQueue
|
|
917
1106
|
};
|
|
918
|
-
$[
|
|
919
|
-
$[
|
|
920
|
-
$[
|
|
921
|
-
$[
|
|
922
|
-
$[
|
|
923
|
-
$[
|
|
924
|
-
$[
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
1107
|
+
$[58] = hasAttachments;
|
|
1108
|
+
$[59] = hasBranches;
|
|
1109
|
+
$[60] = hasEdit;
|
|
1110
|
+
$[61] = hasFeedback;
|
|
1111
|
+
$[62] = hasQueue;
|
|
1112
|
+
$[63] = hasReload;
|
|
1113
|
+
$[64] = hasSpeech;
|
|
1114
|
+
$[65] = isRunning;
|
|
1115
|
+
$[66] = t25;
|
|
1116
|
+
} else t25 = $[66];
|
|
1117
|
+
let t26;
|
|
1118
|
+
if ($[67] !== threadState) {
|
|
1119
|
+
t26 = threadState ?? {};
|
|
1120
|
+
$[67] = threadState;
|
|
1121
|
+
$[68] = t26;
|
|
1122
|
+
} else t26 = $[68];
|
|
1123
|
+
let t27;
|
|
1124
|
+
if ($[69] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1125
|
+
t27 = [];
|
|
1126
|
+
$[69] = t27;
|
|
1127
|
+
} else t27 = $[69];
|
|
1128
|
+
let t28;
|
|
1129
|
+
if ($[70] !== composerClient.state || $[71] !== extras || $[72] !== isLoading || $[73] !== isRunning || $[74] !== messageStates || $[75] !== speech || $[76] !== t24 || $[77] !== t25 || $[78] !== t26) {
|
|
1130
|
+
t28 = {
|
|
1131
|
+
isEmpty: t24,
|
|
941
1132
|
isDisabled: false,
|
|
942
1133
|
isLoading,
|
|
943
1134
|
isRunning,
|
|
944
|
-
capabilities:
|
|
1135
|
+
capabilities: t25,
|
|
945
1136
|
messages: messageStates,
|
|
946
|
-
state:
|
|
947
|
-
suggestions:
|
|
1137
|
+
state: t26,
|
|
1138
|
+
suggestions: t27,
|
|
948
1139
|
extras,
|
|
949
|
-
speech
|
|
1140
|
+
speech,
|
|
950
1141
|
voice: void 0,
|
|
951
1142
|
composer: composerClient.state
|
|
952
1143
|
};
|
|
953
|
-
$[
|
|
954
|
-
$[
|
|
955
|
-
$[
|
|
956
|
-
$[
|
|
957
|
-
$[
|
|
958
|
-
$[
|
|
959
|
-
$[
|
|
960
|
-
$[
|
|
961
|
-
$[
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
$[
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
$[
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1144
|
+
$[70] = composerClient.state;
|
|
1145
|
+
$[71] = extras;
|
|
1146
|
+
$[72] = isLoading;
|
|
1147
|
+
$[73] = isRunning;
|
|
1148
|
+
$[74] = messageStates;
|
|
1149
|
+
$[75] = speech;
|
|
1150
|
+
$[76] = t24;
|
|
1151
|
+
$[77] = t25;
|
|
1152
|
+
$[78] = t26;
|
|
1153
|
+
$[79] = t28;
|
|
1154
|
+
} else t28 = $[79];
|
|
1155
|
+
const state = t28;
|
|
1156
|
+
let t29;
|
|
1157
|
+
if ($[80] !== state) {
|
|
1158
|
+
t29 = () => state;
|
|
1159
|
+
$[80] = state;
|
|
1160
|
+
$[81] = t29;
|
|
1161
|
+
} else t29 = $[81];
|
|
1162
|
+
let t30;
|
|
1163
|
+
if ($[82] !== composerClient.methods) {
|
|
1164
|
+
t30 = () => composerClient.methods;
|
|
1165
|
+
$[82] = composerClient.methods;
|
|
1166
|
+
$[83] = t30;
|
|
1167
|
+
} else t30 = $[83];
|
|
1168
|
+
let t31;
|
|
1169
|
+
if ($[84] !== messages || $[85] !== onNew || $[86] !== queue) {
|
|
1170
|
+
t31 = (message_4) => {
|
|
1171
|
+
const appendMessage = typeof message_4 === "string" ? {
|
|
980
1172
|
createdAt: /* @__PURE__ */ new Date(),
|
|
981
1173
|
parentId: messages.at(-1)?.id ?? null,
|
|
982
1174
|
sourceId: null,
|
|
@@ -984,99 +1176,100 @@ const useExternalThread = (t0) => {
|
|
|
984
1176
|
role: "user",
|
|
985
1177
|
content: [{
|
|
986
1178
|
type: "text",
|
|
987
|
-
text:
|
|
1179
|
+
text: message_4
|
|
988
1180
|
}],
|
|
989
1181
|
attachments: [],
|
|
990
1182
|
metadata: { custom: {} }
|
|
991
1183
|
} : {
|
|
992
|
-
createdAt:
|
|
993
|
-
parentId:
|
|
994
|
-
sourceId:
|
|
995
|
-
role:
|
|
996
|
-
content:
|
|
997
|
-
attachments:
|
|
998
|
-
metadata:
|
|
999
|
-
runConfig:
|
|
1000
|
-
startRun:
|
|
1184
|
+
createdAt: message_4.createdAt ?? /* @__PURE__ */ new Date(),
|
|
1185
|
+
parentId: message_4.parentId ?? messages.at(-1)?.id ?? null,
|
|
1186
|
+
sourceId: message_4.sourceId ?? null,
|
|
1187
|
+
role: message_4.role ?? "user",
|
|
1188
|
+
content: message_4.content,
|
|
1189
|
+
attachments: message_4.attachments ?? [],
|
|
1190
|
+
metadata: message_4.metadata ?? { custom: {} },
|
|
1191
|
+
runConfig: message_4.runConfig ?? {},
|
|
1192
|
+
startRun: message_4.startRun
|
|
1001
1193
|
};
|
|
1002
1194
|
if (queue) queue.enqueue(appendMessage);
|
|
1003
1195
|
else onNew?.(appendMessage);
|
|
1004
1196
|
};
|
|
1005
|
-
$[
|
|
1006
|
-
$[
|
|
1007
|
-
$[
|
|
1008
|
-
$[
|
|
1009
|
-
} else
|
|
1010
|
-
let
|
|
1011
|
-
if ($[
|
|
1012
|
-
|
|
1197
|
+
$[84] = messages;
|
|
1198
|
+
$[85] = onNew;
|
|
1199
|
+
$[86] = queue;
|
|
1200
|
+
$[87] = t31;
|
|
1201
|
+
} else t31 = $[87];
|
|
1202
|
+
let t32;
|
|
1203
|
+
if ($[88] !== onStartRun) {
|
|
1204
|
+
t32 = () => {
|
|
1013
1205
|
onStartRun?.();
|
|
1014
1206
|
};
|
|
1015
|
-
$[
|
|
1016
|
-
$[
|
|
1017
|
-
} else
|
|
1018
|
-
let
|
|
1019
|
-
if ($[
|
|
1020
|
-
|
|
1207
|
+
$[88] = onStartRun;
|
|
1208
|
+
$[89] = t32;
|
|
1209
|
+
} else t32 = $[89];
|
|
1210
|
+
let t33;
|
|
1211
|
+
if ($[90] !== onResume) {
|
|
1212
|
+
t33 = () => {
|
|
1021
1213
|
if (!onResume) throw new Error("Runtime does not support resuming runs (onResume is not set).");
|
|
1022
1214
|
onResume();
|
|
1023
1215
|
};
|
|
1024
|
-
$[
|
|
1025
|
-
$[
|
|
1026
|
-
} else
|
|
1027
|
-
let
|
|
1028
|
-
if ($[
|
|
1029
|
-
|
|
1216
|
+
$[90] = onResume;
|
|
1217
|
+
$[91] = t33;
|
|
1218
|
+
} else t33 = $[91];
|
|
1219
|
+
let t34;
|
|
1220
|
+
if ($[92] !== onLoadExternalState) {
|
|
1221
|
+
t34 = (state_0) => {
|
|
1030
1222
|
if (!onLoadExternalState) throw new Error("Runtime does not support importing external states (onLoadExternalState is not set).");
|
|
1031
1223
|
onLoadExternalState(state_0);
|
|
1032
1224
|
};
|
|
1033
|
-
$[
|
|
1034
|
-
$[
|
|
1035
|
-
} else
|
|
1036
|
-
let
|
|
1037
|
-
if ($[
|
|
1038
|
-
|
|
1225
|
+
$[92] = onLoadExternalState;
|
|
1226
|
+
$[93] = t34;
|
|
1227
|
+
} else t34 = $[93];
|
|
1228
|
+
let t35;
|
|
1229
|
+
if ($[94] !== messageClients) {
|
|
1230
|
+
t35 = (selector) => {
|
|
1039
1231
|
if ("id" in selector) return messageClients.get({ key: selector.id });
|
|
1040
1232
|
return messageClients.get(selector);
|
|
1041
1233
|
};
|
|
1042
|
-
$[
|
|
1043
|
-
$[
|
|
1044
|
-
} else
|
|
1045
|
-
let
|
|
1046
|
-
if ($[
|
|
1047
|
-
|
|
1048
|
-
getState:
|
|
1049
|
-
composer:
|
|
1050
|
-
append:
|
|
1051
|
-
deleteMessage:
|
|
1052
|
-
startRun:
|
|
1053
|
-
resumeRun:
|
|
1234
|
+
$[94] = messageClients;
|
|
1235
|
+
$[95] = t35;
|
|
1236
|
+
} else t35 = $[95];
|
|
1237
|
+
let t36;
|
|
1238
|
+
if ($[96] !== handleCancelRun || $[97] !== speechController.stop || $[98] !== t29 || $[99] !== t30 || $[100] !== t31 || $[101] !== t32 || $[102] !== t33 || $[103] !== t34 || $[104] !== t35) {
|
|
1239
|
+
t36 = {
|
|
1240
|
+
getState: t29,
|
|
1241
|
+
composer: t30,
|
|
1242
|
+
append: t31,
|
|
1243
|
+
deleteMessage: _temp0,
|
|
1244
|
+
startRun: t32,
|
|
1245
|
+
resumeRun: t33,
|
|
1054
1246
|
cancelRun: handleCancelRun,
|
|
1055
|
-
importExternalState:
|
|
1056
|
-
getModelContext:
|
|
1057
|
-
export:
|
|
1058
|
-
import:
|
|
1059
|
-
reset:
|
|
1060
|
-
message:
|
|
1061
|
-
stopSpeaking:
|
|
1062
|
-
connectVoice:
|
|
1063
|
-
disconnectVoice:
|
|
1064
|
-
getVoiceVolume:
|
|
1065
|
-
subscribeVoiceVolume:
|
|
1066
|
-
muteVoice:
|
|
1067
|
-
unmuteVoice:
|
|
1247
|
+
importExternalState: t34,
|
|
1248
|
+
getModelContext: _temp1,
|
|
1249
|
+
export: _temp10,
|
|
1250
|
+
import: _temp11,
|
|
1251
|
+
reset: _temp12,
|
|
1252
|
+
message: t35,
|
|
1253
|
+
stopSpeaking: speechController.stop,
|
|
1254
|
+
connectVoice: _temp13,
|
|
1255
|
+
disconnectVoice: _temp14,
|
|
1256
|
+
getVoiceVolume: _temp15,
|
|
1257
|
+
subscribeVoiceVolume: _temp17,
|
|
1258
|
+
muteVoice: _temp18,
|
|
1259
|
+
unmuteVoice: _temp19
|
|
1068
1260
|
};
|
|
1069
|
-
$[
|
|
1070
|
-
$[
|
|
1071
|
-
$[
|
|
1072
|
-
$[
|
|
1073
|
-
$[
|
|
1074
|
-
$[
|
|
1075
|
-
$[
|
|
1076
|
-
$[
|
|
1077
|
-
$[
|
|
1078
|
-
|
|
1079
|
-
|
|
1261
|
+
$[96] = handleCancelRun;
|
|
1262
|
+
$[97] = speechController.stop;
|
|
1263
|
+
$[98] = t29;
|
|
1264
|
+
$[99] = t30;
|
|
1265
|
+
$[100] = t31;
|
|
1266
|
+
$[101] = t32;
|
|
1267
|
+
$[102] = t33;
|
|
1268
|
+
$[103] = t34;
|
|
1269
|
+
$[104] = t35;
|
|
1270
|
+
$[105] = t36;
|
|
1271
|
+
} else t36 = $[105];
|
|
1272
|
+
return t36;
|
|
1080
1273
|
};
|
|
1081
1274
|
const ExternalThread = resource(useExternalThread);
|
|
1082
1275
|
attachTransformScopes(useExternalThread, (scopes, parent) => {
|
|
@@ -1113,50 +1306,46 @@ function _temp2(attachment) {
|
|
|
1113
1306
|
}));
|
|
1114
1307
|
}
|
|
1115
1308
|
function _temp3() {}
|
|
1116
|
-
function _temp4() {
|
|
1117
|
-
function _temp5() {}
|
|
1118
|
-
function _temp6() {}
|
|
1119
|
-
function _temp7(part) {
|
|
1309
|
+
function _temp4(part) {
|
|
1120
1310
|
return part.type === "text";
|
|
1121
1311
|
}
|
|
1122
|
-
function
|
|
1312
|
+
function _temp5(part_0) {
|
|
1123
1313
|
return "text" in part_0 ? part_0.text : "";
|
|
1124
1314
|
}
|
|
1125
|
-
function
|
|
1315
|
+
function _temp6(a_0) {
|
|
1126
1316
|
return a_0.status.type !== "complete";
|
|
1127
1317
|
}
|
|
1128
|
-
function
|
|
1129
|
-
function
|
|
1130
|
-
function
|
|
1318
|
+
function _temp7() {}
|
|
1319
|
+
function _temp8() {}
|
|
1320
|
+
function _temp9(s, idx, arr) {
|
|
1131
1321
|
return {
|
|
1132
1322
|
...s,
|
|
1133
1323
|
isLast: idx === arr.length - 1
|
|
1134
1324
|
};
|
|
1135
1325
|
}
|
|
1136
|
-
function
|
|
1137
|
-
function
|
|
1326
|
+
function _temp0() {}
|
|
1327
|
+
function _temp1() {
|
|
1138
1328
|
return {
|
|
1139
1329
|
tools: {},
|
|
1140
1330
|
config: {}
|
|
1141
1331
|
};
|
|
1142
1332
|
}
|
|
1143
|
-
function
|
|
1333
|
+
function _temp10() {
|
|
1144
1334
|
return { messages: [] };
|
|
1145
1335
|
}
|
|
1336
|
+
function _temp11() {}
|
|
1337
|
+
function _temp12() {}
|
|
1338
|
+
function _temp13() {}
|
|
1146
1339
|
function _temp14() {}
|
|
1147
|
-
function _temp15() {
|
|
1148
|
-
function _temp16() {}
|
|
1149
|
-
function _temp17() {}
|
|
1150
|
-
function _temp18() {}
|
|
1151
|
-
function _temp19() {
|
|
1340
|
+
function _temp15() {
|
|
1152
1341
|
return 0;
|
|
1153
1342
|
}
|
|
1154
|
-
function
|
|
1155
|
-
function
|
|
1156
|
-
return
|
|
1343
|
+
function _temp16() {}
|
|
1344
|
+
function _temp17() {
|
|
1345
|
+
return _temp16;
|
|
1157
1346
|
}
|
|
1158
|
-
function
|
|
1159
|
-
function
|
|
1347
|
+
function _temp18() {}
|
|
1348
|
+
function _temp19() {}
|
|
1160
1349
|
//#endregion
|
|
1161
1350
|
export { ExternalThread };
|
|
1162
1351
|
|