@assistant-ui/react 0.15.8 → 0.15.10

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