@assistant-ui/react 0.15.4 → 0.15.5

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 (58) hide show
  1. package/dist/client/ExternalThread.d.ts.map +1 -1
  2. package/dist/client/ExternalThread.js +383 -368
  3. package/dist/client/ExternalThread.js.map +1 -1
  4. package/dist/context/providers/MessageProvider.js +15 -34
  5. package/dist/context/providers/MessageProvider.js.map +1 -1
  6. package/dist/index.d.ts +3 -3
  7. package/dist/index.js +2 -2
  8. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts +6 -1
  9. package/dist/legacy-runtime/AssistantRuntimeProvider.d.ts.map +1 -1
  10. package/dist/legacy-runtime/AssistantRuntimeProvider.js +10 -8
  11. package/dist/legacy-runtime/AssistantRuntimeProvider.js.map +1 -1
  12. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.d.ts.map +1 -1
  13. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js +8 -1
  14. package/dist/legacy-runtime/runtime-cores/assistant-transport/runManager.js.map +1 -1
  15. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts +5 -1
  16. package/dist/legacy-runtime/runtime-cores/assistant-transport/types.d.ts.map +1 -1
  17. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.d.ts.map +1 -1
  18. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js +44 -3
  19. package/dist/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.js.map +1 -1
  20. package/dist/primitives/actionBar/ActionBarExportMarkdown.js +1 -1
  21. package/dist/primitives/actionBar/ActionBarExportMarkdown.js.map +1 -1
  22. package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -1
  23. package/dist/primitives/attachment/AttachmentThumb.js +17 -14
  24. package/dist/primitives/attachment/AttachmentThumb.js.map +1 -1
  25. package/dist/primitives/composer/ComposerInput.js +1 -0
  26. package/dist/primitives/composer/ComposerInput.js.map +1 -1
  27. package/dist/primitives/queueItem/QueueItemText.d.ts.map +1 -1
  28. package/dist/primitives/queueItem/QueueItemText.js +10 -4
  29. package/dist/primitives/queueItem/QueueItemText.js.map +1 -1
  30. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.d.ts.map +1 -1
  31. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js +5 -4
  32. package/dist/primitives/selectionToolbar/SelectionToolbarRoot.js.map +1 -1
  33. package/dist/utils/createActionButton.js +1 -1
  34. package/dist/utils/createActionButton.js.map +1 -1
  35. package/dist/utils/useToolArgsFieldStatus.d.ts +2 -2
  36. package/package.json +6 -6
  37. package/src/client/ExternalThread.ts +28 -16
  38. package/src/context/providers/MessageProvider.tsx +8 -6
  39. package/src/index.ts +5 -1
  40. package/src/legacy-runtime/AssistantRuntimeProvider.tsx +13 -3
  41. package/src/legacy-runtime/runtime-cores/assistant-transport/runManager.ts +14 -1
  42. package/src/legacy-runtime/runtime-cores/assistant-transport/transport-scheduling.test.ts +38 -0
  43. package/src/legacy-runtime/runtime-cores/assistant-transport/types.ts +5 -1
  44. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransport.spec.md +7 -0
  45. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.test.tsx +290 -0
  46. package/src/legacy-runtime/runtime-cores/assistant-transport/useAssistantTransportRuntime.ts +62 -1
  47. package/src/primitives/actionBar/ActionBarExportMarkdown.tsx +1 -1
  48. package/src/primitives/attachment/AttachmentThumb.test.tsx +70 -0
  49. package/src/primitives/attachment/AttachmentThumb.tsx +8 -4
  50. package/src/primitives/composer/ComposerInput.test.tsx +53 -2
  51. package/src/primitives/composer/ComposerInput.tsx +3 -0
  52. package/src/primitives/queueItem/QueueItemText.tsx +8 -2
  53. package/src/primitives/selectionToolbar/SelectionToolbarRoot.test.tsx +74 -0
  54. package/src/primitives/selectionToolbar/SelectionToolbarRoot.tsx +3 -3
  55. package/src/tests/external-thread-parity.test.tsx +9 -4
  56. package/src/tests/local-runtime-queue.test.tsx +199 -6
  57. package/src/utils/createActionButton.test.tsx +18 -0
  58. package/src/utils/createActionButton.tsx +1 -1
@@ -16,7 +16,7 @@ const derivePartStatus = (message, partIndex, part) => {
16
16
  return toMessagePartStatus(message, partIndex, part);
17
17
  };
18
18
  const useMessageClient = (t0) => {
19
- const $ = c(65);
19
+ const $ = c(64);
20
20
  const { message, index, parentId, onEdit, onReload, queue, branches, onRespondToToolApproval, onAddToolResult, onResumeToolCall, attachmentAdapter } = t0;
21
21
  const [isCopied, setIsCopied] = useState(false);
22
22
  const [isHovering, setIsHovering] = useState(false);
@@ -68,9 +68,8 @@ const useMessageClient = (t0) => {
68
68
  } else t5 = $[10];
69
69
  const handleCancelEdit = t5;
70
70
  let t6;
71
- if ($[11] !== message.id || $[12] !== onEdit || $[13] !== parentId || $[14] !== queue) {
71
+ if ($[11] !== message.id || $[12] !== onEdit || $[13] !== parentId) {
72
72
  t6 = (msg) => {
73
- queue?.clear("edit");
74
73
  onEdit?.({
75
74
  ...msg,
76
75
  parentId,
@@ -81,12 +80,11 @@ const useMessageClient = (t0) => {
81
80
  $[11] = message.id;
82
81
  $[12] = onEdit;
83
82
  $[13] = parentId;
84
- $[14] = queue;
85
- $[15] = t6;
86
- } else t6 = $[15];
83
+ $[14] = t6;
84
+ } else t6 = $[14];
87
85
  const handleSendEdit = t6;
88
86
  let t7;
89
- if ($[16] !== attachmentAdapter || $[17] !== handleSendEdit || $[18] !== isEditing || $[19] !== message || $[20] !== queue) {
87
+ if ($[15] !== attachmentAdapter || $[16] !== handleSendEdit || $[17] !== isEditing || $[18] !== message || $[19] !== queue) {
90
88
  t7 = ComposerClientResource({
91
89
  type: "edit",
92
90
  isEditing,
@@ -98,38 +96,38 @@ const useMessageClient = (t0) => {
98
96
  queue,
99
97
  attachmentAdapter
100
98
  });
101
- $[16] = attachmentAdapter;
102
- $[17] = handleSendEdit;
103
- $[18] = isEditing;
104
- $[19] = message;
105
- $[20] = queue;
106
- $[21] = t7;
107
- } else t7 = $[21];
99
+ $[15] = attachmentAdapter;
100
+ $[16] = handleSendEdit;
101
+ $[17] = isEditing;
102
+ $[18] = message;
103
+ $[19] = queue;
104
+ $[20] = t7;
105
+ } else t7 = $[20];
108
106
  const composerClient = useClientResource(t7);
109
107
  let branchIds;
110
108
  let t8;
111
- if ($[22] !== branches || $[23] !== message.id) {
109
+ if ($[21] !== branches || $[22] !== message.id) {
112
110
  branchIds = branches?.getBranches(message.id) ?? EMPTY_BRANCH_IDS;
113
111
  t8 = branchIds.indexOf(message.id);
114
- $[22] = branches;
115
- $[23] = message.id;
116
- $[24] = branchIds;
117
- $[25] = t8;
112
+ $[21] = branches;
113
+ $[22] = message.id;
114
+ $[23] = branchIds;
115
+ $[24] = t8;
118
116
  } else {
119
- branchIds = $[24];
120
- t8 = $[25];
117
+ branchIds = $[23];
118
+ t8 = $[24];
121
119
  }
122
120
  const branchIndex = t8;
123
121
  const branchNumber = branchIndex === -1 ? 1 : branchIndex + 1;
124
122
  const branchCount = branchIndex === -1 ? 1 : branchIds.length;
125
123
  let t9;
126
- if ($[26] !== message.attachments) {
124
+ if ($[25] !== message.attachments) {
127
125
  t9 = message.attachments ?? [];
128
- $[26] = message.attachments;
129
- $[27] = t9;
130
- } else t9 = $[27];
126
+ $[25] = message.attachments;
127
+ $[26] = t9;
128
+ } else t9 = $[26];
131
129
  let t10;
132
- if ($[28] !== branchCount || $[29] !== branchNumber || $[30] !== composerClient.state || $[31] !== index || $[32] !== isCopied || $[33] !== isHovering || $[34] !== message || $[35] !== parentId || $[36] !== partClients.state || $[37] !== t9) {
130
+ if ($[27] !== branchCount || $[28] !== branchNumber || $[29] !== composerClient.state || $[30] !== index || $[31] !== isCopied || $[32] !== isHovering || $[33] !== message || $[34] !== parentId || $[35] !== partClients.state || $[36] !== t9) {
133
131
  t10 = {
134
132
  ...message,
135
133
  attachments: t9,
@@ -144,81 +142,81 @@ const useMessageClient = (t0) => {
144
142
  index,
145
143
  composer: composerClient.state
146
144
  };
147
- $[28] = branchCount;
148
- $[29] = branchNumber;
149
- $[30] = composerClient.state;
150
- $[31] = index;
151
- $[32] = isCopied;
152
- $[33] = isHovering;
153
- $[34] = message;
154
- $[35] = parentId;
155
- $[36] = partClients.state;
156
- $[37] = t9;
157
- $[38] = t10;
158
- } else t10 = $[38];
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];
159
157
  const state = t10;
160
158
  let t11;
161
- if ($[39] !== state) {
159
+ if ($[38] !== state) {
162
160
  t11 = () => state;
163
- $[39] = state;
164
- $[40] = t11;
165
- } else t11 = $[40];
161
+ $[38] = state;
162
+ $[39] = t11;
163
+ } else t11 = $[39];
166
164
  let t12;
167
- if ($[41] !== composerClient.methods) {
165
+ if ($[40] !== composerClient.methods) {
168
166
  t12 = () => composerClient.methods;
169
- $[41] = composerClient.methods;
170
- $[42] = t12;
171
- } else t12 = $[42];
167
+ $[40] = composerClient.methods;
168
+ $[41] = t12;
169
+ } else t12 = $[41];
172
170
  let t13;
173
- if ($[43] !== onReload) {
171
+ if ($[42] !== onReload) {
174
172
  t13 = () => {
175
173
  onReload?.();
176
174
  };
177
- $[43] = onReload;
178
- $[44] = t13;
179
- } else t13 = $[44];
175
+ $[42] = onReload;
176
+ $[43] = t13;
177
+ } else t13 = $[43];
180
178
  let t14;
181
- if ($[45] !== branchIds || $[46] !== branchIndex || $[47] !== branches || $[48] !== message.id) {
179
+ if ($[44] !== branchIds || $[45] !== branchIndex || $[46] !== branches || $[47] !== message.id) {
182
180
  t14 = (t15) => {
183
181
  const { position, branchId } = t15;
184
182
  if (!branches) return;
185
183
  const target = branchId ?? (branchIndex === -1 ? void 0 : position === "previous" ? branchIds[branchIndex - 1] : position === "next" ? branchIds[branchIndex + 1] : void 0);
186
184
  if (target !== void 0 && target !== message.id) branches.switchToBranch(target);
187
185
  };
188
- $[45] = branchIds;
189
- $[46] = branchIndex;
190
- $[47] = branches;
191
- $[48] = message.id;
192
- $[49] = t14;
193
- } else t14 = $[49];
186
+ $[44] = branchIds;
187
+ $[45] = branchIndex;
188
+ $[46] = branches;
189
+ $[47] = message.id;
190
+ $[48] = t14;
191
+ } else t14 = $[48];
194
192
  let t15;
195
- if ($[50] !== message) {
193
+ if ($[49] !== message) {
196
194
  t15 = () => getThreadMessageText(message);
197
- $[50] = message;
198
- $[51] = t15;
199
- } else t15 = $[51];
195
+ $[49] = message;
196
+ $[50] = t15;
197
+ } else t15 = $[50];
200
198
  let t16;
201
- if ($[52] !== partClients || $[53] !== state) {
199
+ if ($[51] !== partClients || $[52] !== state) {
202
200
  t16 = (selector) => {
203
201
  if ("index" in selector) return partClients.get(selector);
204
202
  const partIndex = state.parts.findIndex((p) => p.type === "tool-call" && p.toolCallId === selector.toolCallId);
205
203
  return partClients.get({ index: partIndex });
206
204
  };
207
- $[52] = partClients;
208
- $[53] = state;
209
- $[54] = t16;
210
- } else t16 = $[54];
205
+ $[51] = partClients;
206
+ $[52] = state;
207
+ $[53] = t16;
208
+ } else t16 = $[53];
211
209
  let t17;
212
- if ($[55] !== attachmentClients) {
210
+ if ($[54] !== attachmentClients) {
213
211
  t17 = (selector_0) => {
214
212
  if ("id" in selector_0) return attachmentClients.get({ key: selector_0.id });
215
213
  return attachmentClients.get(selector_0);
216
214
  };
217
- $[55] = attachmentClients;
218
- $[56] = t17;
219
- } else t17 = $[56];
215
+ $[54] = attachmentClients;
216
+ $[55] = t17;
217
+ } else t17 = $[55];
220
218
  let t18;
221
- if ($[57] !== t11 || $[58] !== t12 || $[59] !== t13 || $[60] !== t14 || $[61] !== t15 || $[62] !== t16 || $[63] !== t17) {
219
+ if ($[56] !== t11 || $[57] !== t12 || $[58] !== t13 || $[59] !== t14 || $[60] !== t15 || $[61] !== t16 || $[62] !== t17) {
222
220
  t18 = {
223
221
  getState: t11,
224
222
  composer: t12,
@@ -234,15 +232,15 @@ const useMessageClient = (t0) => {
234
232
  setIsCopied,
235
233
  setIsHovering
236
234
  };
237
- $[57] = t11;
238
- $[58] = t12;
239
- $[59] = t13;
240
- $[60] = t14;
241
- $[61] = t15;
242
- $[62] = t16;
243
- $[63] = t17;
244
- $[64] = t18;
245
- } else t18 = $[64];
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];
246
244
  return t18;
247
245
  };
248
246
  const MessageClient = resource(useMessageClient);
@@ -340,10 +338,14 @@ const useAttachmentResource = ({ attachment, onRemove }) => {
340
338
  };
341
339
  };
342
340
  const AttachmentResource = resource(useAttachmentResource);
343
- const useQueueItemClient = ({ item, onSteer, onRemove }) => {
341
+ const useQueueItemClient = ({ item, onMove, onRemove }) => {
344
342
  return {
345
343
  getState: () => item,
346
- steer: onSteer,
344
+ steer: () => onMove({
345
+ lane: "steer",
346
+ insertAfter: null
347
+ }),
348
+ move: onMove,
347
349
  remove: onRemove
348
350
  };
349
351
  };
@@ -378,7 +380,7 @@ const useLiveState = (initial) => {
378
380
  return t1;
379
381
  };
380
382
  const useComposerClientResource = (t0) => {
381
- const $ = c(96);
383
+ const $ = c(99);
382
384
  const { type, isEditing, canCancel, isSendDisabled: t1, onCancel, onBeginEdit, onSend, message, queue, attachmentAdapter } = t0;
383
385
  const isSendDisabled = t1 === void 0 ? false : t1;
384
386
  const [text, setText, textRef] = useLiveState("");
@@ -476,77 +478,85 @@ const useComposerClientResource = (t0) => {
476
478
  $[22] = t9;
477
479
  } else t9 = $[22];
478
480
  const upsertAttachment = t9;
479
- const queueItems = queue?.items ?? EMPTY_QUEUE_ITEMS;
481
+ const steerItems = queue?.steerItems ?? EMPTY_QUEUE_ITEMS;
482
+ const laneItems = queue?.items ?? EMPTY_QUEUE_ITEMS;
480
483
  let t10;
481
- if ($[23] !== queue || $[24] !== queueItems) {
482
- let t11;
483
- if ($[26] !== queue) {
484
- t11 = (item) => withKey(item.id, QueueItemClient({
485
- item,
486
- onSteer: () => queue?.steer(item.id),
487
- onRemove: () => queue?.remove(item.id)
488
- }));
489
- $[26] = queue;
490
- $[27] = t11;
491
- } else t11 = $[27];
492
- t10 = queueItems.map(t11);
493
- $[23] = queue;
494
- $[24] = queueItems;
484
+ if ($[23] !== laneItems || $[24] !== steerItems) {
485
+ t10 = steerItems.length === 0 ? laneItems : laneItems.length === 0 ? steerItems : [...steerItems, ...laneItems];
486
+ $[23] = laneItems;
487
+ $[24] = steerItems;
495
488
  $[25] = t10;
496
489
  } else t10 = $[25];
497
- const queueItemClients = useClientLookup(t10);
498
- attachmentAdapter?.accept;
490
+ const queueItems = t10;
499
491
  let t11;
500
- if ($[28] !== attachments.length || $[29] !== text) {
501
- t11 = !text.trim() && !attachments.length;
502
- $[28] = attachments.length;
503
- $[29] = text;
504
- $[30] = t11;
505
- } else t11 = $[30];
506
- const isEmpty = t11;
507
- const t12 = isEditing && !isEmpty && !isSendDisabled;
508
- const t13 = attachmentAdapter?.accept ?? "*";
509
- let t14;
510
- if ($[31] !== attachmentClients.state || $[32] !== canCancel || $[33] !== isEditing || $[34] !== isEmpty || $[35] !== queueItems || $[36] !== quote || $[37] !== role || $[38] !== runConfig || $[39] !== t12 || $[40] !== t13 || $[41] !== text || $[42] !== type) {
511
- t14 = {
512
- text,
513
- role,
514
- attachments: attachmentClients.state,
515
- runConfig,
516
- isEditing,
517
- canCancel,
518
- canSend: t12,
519
- attachmentAccept: t13,
520
- isEmpty,
521
- type,
522
- dictation: void 0,
523
- quote,
524
- queue: queueItems
492
+ if ($[26] !== queue || $[27] !== queueItems) {
493
+ let t12;
494
+ if ($[29] !== queue) {
495
+ t12 = (item) => withKey(item.id, QueueItemClient({
496
+ item,
497
+ onMove: (placement) => queue?.move(item.id, placement),
498
+ onRemove: () => queue?.remove(item.id)
499
+ }));
500
+ $[29] = queue;
501
+ $[30] = t12;
502
+ } else t12 = $[30];
503
+ t11 = queueItems.map(t12);
504
+ $[26] = queue;
505
+ $[27] = queueItems;
506
+ $[28] = t11;
507
+ } else t11 = $[28];
508
+ const queueItemClients = useClientLookup(t11);
509
+ let t12;
510
+ if ($[31] !== attachmentAdapter?.accept || $[32] !== attachmentClients.state || $[33] !== attachments.length || $[34] !== canCancel || $[35] !== isEditing || $[36] !== isSendDisabled || $[37] !== queueItems || $[38] !== quote || $[39] !== role || $[40] !== runConfig || $[41] !== text || $[42] !== type) {
511
+ t12 = () => {
512
+ const isEmpty = !text.trim() && !attachments.length;
513
+ return {
514
+ text,
515
+ role,
516
+ attachments: attachmentClients.state,
517
+ runConfig,
518
+ isEditing,
519
+ canCancel,
520
+ canSend: isEditing && !isEmpty && !isSendDisabled,
521
+ attachmentAccept: attachmentAdapter?.accept ?? "*",
522
+ isEmpty,
523
+ type,
524
+ dictation: void 0,
525
+ quote,
526
+ queue: queueItems
527
+ };
525
528
  };
526
- $[31] = attachmentClients.state;
527
- $[32] = canCancel;
528
- $[33] = isEditing;
529
- $[34] = isEmpty;
530
- $[35] = queueItems;
531
- $[36] = quote;
532
- $[37] = role;
533
- $[38] = runConfig;
534
- $[39] = t12;
535
- $[40] = t13;
529
+ $[31] = attachmentAdapter?.accept;
530
+ $[32] = attachmentClients.state;
531
+ $[33] = attachments.length;
532
+ $[34] = canCancel;
533
+ $[35] = isEditing;
534
+ $[36] = isSendDisabled;
535
+ $[37] = queueItems;
536
+ $[38] = quote;
537
+ $[39] = role;
538
+ $[40] = runConfig;
536
539
  $[41] = text;
537
540
  $[42] = type;
538
- $[43] = t14;
539
- } else t14 = $[43];
540
- const state = t14;
541
+ $[43] = t12;
542
+ } else t12 = $[43];
543
+ attachmentAdapter?.accept;
544
+ let t13;
545
+ if ($[44] !== t12) {
546
+ t13 = t12();
547
+ $[44] = t12;
548
+ $[45] = t13;
549
+ } else t13 = $[45];
550
+ const state = t13;
551
+ let t14;
552
+ if ($[46] !== state) {
553
+ t14 = () => state;
554
+ $[46] = state;
555
+ $[47] = t14;
556
+ } else t14 = $[47];
541
557
  let t15;
542
- if ($[44] !== state) {
543
- t15 = () => state;
544
- $[44] = state;
545
- $[45] = t15;
546
- } else t15 = $[45];
547
- let t16;
548
- if ($[46] !== attachmentAdapter || $[47] !== setAttachments || $[48] !== upsertAttachment) {
549
- t16 = async (fileOrAttachment) => {
558
+ if ($[48] !== attachmentAdapter || $[49] !== setAttachments || $[50] !== upsertAttachment) {
559
+ t15 = async (fileOrAttachment) => {
550
560
  if (attachmentAdapter) {
551
561
  const file = isCreateAttachment(fileOrAttachment) ? {
552
562
  name: fileOrAttachment.name,
@@ -581,35 +591,35 @@ const useComposerClientResource = (t0) => {
581
591
  setAttachments((prev_2) => [...prev_2, newAttachment_0]);
582
592
  }
583
593
  };
584
- $[46] = attachmentAdapter;
585
- $[47] = setAttachments;
586
- $[48] = upsertAttachment;
587
- $[49] = t16;
588
- } else t16 = $[49];
589
- let t17;
590
- if ($[50] !== attachmentsRef || $[51] !== removePendingAttachments || $[52] !== setAttachments) {
591
- t17 = async () => {
594
+ $[48] = attachmentAdapter;
595
+ $[49] = setAttachments;
596
+ $[50] = upsertAttachment;
597
+ $[51] = t15;
598
+ } else t15 = $[51];
599
+ let t16;
600
+ if ($[52] !== attachmentsRef || $[53] !== removePendingAttachments || $[54] !== setAttachments) {
601
+ t16 = async () => {
592
602
  const removed_0 = attachmentsRef.current;
593
603
  setAttachments([]);
594
604
  await removePendingAttachments(removed_0);
595
605
  };
596
- $[50] = attachmentsRef;
597
- $[51] = removePendingAttachments;
598
- $[52] = setAttachments;
599
- $[53] = t17;
600
- } else t17 = $[53];
601
- let t18;
602
- if ($[54] !== attachmentClients) {
603
- t18 = (selector) => {
606
+ $[52] = attachmentsRef;
607
+ $[53] = removePendingAttachments;
608
+ $[54] = setAttachments;
609
+ $[55] = t16;
610
+ } else t16 = $[55];
611
+ let t17;
612
+ if ($[56] !== attachmentClients) {
613
+ t17 = (selector) => {
604
614
  if ("id" in selector) return attachmentClients.get({ key: selector.id });
605
615
  return attachmentClients.get(selector);
606
616
  };
607
- $[54] = attachmentClients;
608
- $[55] = t18;
609
- } else t18 = $[55];
610
- let t19;
611
- if ($[56] !== attachmentsRef || $[57] !== removePendingAttachments || $[58] !== setAttachments || $[59] !== setQuote || $[60] !== setRole || $[61] !== setRunConfig || $[62] !== setText) {
612
- t19 = async () => {
617
+ $[56] = attachmentClients;
618
+ $[57] = t17;
619
+ } else t17 = $[57];
620
+ let t18;
621
+ if ($[58] !== attachmentsRef || $[59] !== removePendingAttachments || $[60] !== setAttachments || $[61] !== setQuote || $[62] !== setRole || $[63] !== setRunConfig || $[64] !== setText) {
622
+ t18 = async () => {
613
623
  const removed_1 = attachmentsRef.current;
614
624
  setText("");
615
625
  setRole("user");
@@ -618,18 +628,18 @@ const useComposerClientResource = (t0) => {
618
628
  setQuote(void 0);
619
629
  await removePendingAttachments(removed_1);
620
630
  };
621
- $[56] = attachmentsRef;
622
- $[57] = removePendingAttachments;
623
- $[58] = setAttachments;
624
- $[59] = setQuote;
625
- $[60] = setRole;
626
- $[61] = setRunConfig;
627
- $[62] = setText;
628
- $[63] = t19;
629
- } else t19 = $[63];
630
- let t20;
631
- if ($[64] !== attachmentAdapter || $[65] !== attachmentsRef || $[66] !== isEditing || $[67] !== isSendDisabled || $[68] !== onSend || $[69] !== queue || $[70] !== quoteRef || $[71] !== roleRef || $[72] !== runConfigRef || $[73] !== setAttachments || $[74] !== setQuote || $[75] !== setText || $[76] !== textRef) {
632
- t20 = (opts) => {
631
+ $[58] = attachmentsRef;
632
+ $[59] = removePendingAttachments;
633
+ $[60] = setAttachments;
634
+ $[61] = setQuote;
635
+ $[62] = setRole;
636
+ $[63] = setRunConfig;
637
+ $[64] = setText;
638
+ $[65] = t18;
639
+ } else t18 = $[65];
640
+ let t19;
641
+ if ($[66] !== attachmentAdapter || $[67] !== attachmentsRef || $[68] !== canCancel || $[69] !== isEditing || $[70] !== isSendDisabled || $[71] !== onSend || $[72] !== queue || $[73] !== quoteRef || $[74] !== roleRef || $[75] !== runConfigRef || $[76] !== setAttachments || $[77] !== setQuote || $[78] !== setText || $[79] !== textRef) {
642
+ t19 = (opts) => {
633
643
  const currentQuote = quoteRef.current;
634
644
  const currentText = textRef.current;
635
645
  const currentAttachments = attachmentsRef.current;
@@ -653,7 +663,8 @@ const useComposerClientResource = (t0) => {
653
663
  startRun: opts?.startRun,
654
664
  metadata: { custom: { ...currentQuote ? { quote: currentQuote } : {} } }
655
665
  };
656
- if (queue) queue.enqueue(composedMessage, { steer: opts?.steer ?? false });
666
+ if (queue) if (opts?.steer ?? canCancel) queue.steer(composedMessage);
667
+ else queue.enqueue(composedMessage);
657
668
  else onSend?.(composedMessage);
658
669
  };
659
670
  if (attachmentAdapter && currentAttachments.length > 0) Promise.all(currentAttachments.map((attachment_1) => attachment_1.status.type === "complete" ? attachment_1 : attachmentAdapter.send(attachment_1))).then(dispatch, (error) => {
@@ -664,70 +675,74 @@ const useComposerClientResource = (t0) => {
664
675
  });
665
676
  else dispatch(currentAttachments);
666
677
  };
667
- $[64] = attachmentAdapter;
668
- $[65] = attachmentsRef;
669
- $[66] = isEditing;
670
- $[67] = isSendDisabled;
671
- $[68] = onSend;
672
- $[69] = queue;
673
- $[70] = quoteRef;
674
- $[71] = roleRef;
675
- $[72] = runConfigRef;
676
- $[73] = setAttachments;
677
- $[74] = setQuote;
678
- $[75] = setText;
679
- $[76] = textRef;
680
- $[77] = t20;
681
- } else t20 = $[77];
682
- let t21;
683
- if ($[78] !== onBeginEdit) {
684
- t21 = () => {
678
+ $[66] = attachmentAdapter;
679
+ $[67] = attachmentsRef;
680
+ $[68] = canCancel;
681
+ $[69] = isEditing;
682
+ $[70] = isSendDisabled;
683
+ $[71] = onSend;
684
+ $[72] = queue;
685
+ $[73] = quoteRef;
686
+ $[74] = roleRef;
687
+ $[75] = runConfigRef;
688
+ $[76] = setAttachments;
689
+ $[77] = setQuote;
690
+ $[78] = setText;
691
+ $[79] = textRef;
692
+ $[80] = t19;
693
+ } else t19 = $[80];
694
+ let t20;
695
+ if ($[81] !== onBeginEdit) {
696
+ t20 = () => {
685
697
  onBeginEdit?.();
686
698
  };
687
- $[78] = onBeginEdit;
688
- $[79] = t21;
689
- } else t21 = $[79];
699
+ $[81] = onBeginEdit;
700
+ $[82] = t20;
701
+ } else t20 = $[82];
702
+ let t21;
703
+ if ($[83] !== queueItemClients) {
704
+ t21 = (selector_0) => {
705
+ if ("id" in selector_0) return queueItemClients.get({ key: selector_0.id });
706
+ return queueItemClients.get(selector_0);
707
+ };
708
+ $[83] = queueItemClients;
709
+ $[84] = t21;
710
+ } else t21 = $[84];
690
711
  let t22;
691
- if ($[80] !== queueItemClients) {
692
- t22 = (selector_0) => queueItemClients.get(selector_0);
693
- $[80] = queueItemClients;
694
- $[81] = t22;
695
- } else t22 = $[81];
696
- let t23;
697
- if ($[82] !== onCancel || $[83] !== setQuote || $[84] !== setRole || $[85] !== setRunConfig || $[86] !== setText || $[87] !== t15 || $[88] !== t16 || $[89] !== t17 || $[90] !== t18 || $[91] !== t19 || $[92] !== t20 || $[93] !== t21 || $[94] !== t22) {
698
- t23 = {
699
- getState: t15,
712
+ if ($[85] !== onCancel || $[86] !== setQuote || $[87] !== setRole || $[88] !== setRunConfig || $[89] !== setText || $[90] !== t14 || $[91] !== t15 || $[92] !== t16 || $[93] !== t17 || $[94] !== t18 || $[95] !== t19 || $[96] !== t20 || $[97] !== t21) {
713
+ t22 = {
714
+ getState: t14,
700
715
  setText,
701
716
  setRole,
702
717
  setRunConfig,
703
- addAttachment: t16,
704
- clearAttachments: t17,
705
- attachment: t18,
706
- reset: t19,
707
- send: t20,
718
+ addAttachment: t15,
719
+ clearAttachments: t16,
720
+ attachment: t17,
721
+ reset: t18,
722
+ send: t19,
708
723
  cancel: onCancel,
709
- beginEdit: t21,
724
+ beginEdit: t20,
710
725
  startDictation: _temp0,
711
726
  stopDictation: _temp1,
712
727
  setQuote,
713
- queueItem: t22
728
+ queueItem: t21
714
729
  };
715
- $[82] = onCancel;
716
- $[83] = setQuote;
717
- $[84] = setRole;
718
- $[85] = setRunConfig;
719
- $[86] = setText;
720
- $[87] = t15;
721
- $[88] = t16;
722
- $[89] = t17;
723
- $[90] = t18;
724
- $[91] = t19;
725
- $[92] = t20;
726
- $[93] = t21;
727
- $[94] = t22;
728
- $[95] = t23;
729
- } else t23 = $[95];
730
- return t23;
730
+ $[85] = onCancel;
731
+ $[86] = setQuote;
732
+ $[87] = setRole;
733
+ $[88] = setRunConfig;
734
+ $[89] = setText;
735
+ $[90] = t14;
736
+ $[91] = t15;
737
+ $[92] = t16;
738
+ $[93] = t17;
739
+ $[94] = t18;
740
+ $[95] = t19;
741
+ $[96] = t20;
742
+ $[97] = t21;
743
+ $[98] = t22;
744
+ } else t22 = $[98];
745
+ return t22;
731
746
  };
732
747
  const ComposerClientResource = resource(useComposerClientResource);
733
748
  const dedupeMessagesById = (messages) => {
@@ -745,7 +760,7 @@ const dedupeMessagesById = (messages) => {
745
760
  return deduped.length === messages.length ? messages : deduped.reverse();
746
761
  };
747
762
  const useExternalThread = (t0) => {
748
- const $ = c(80);
763
+ const $ = c(78);
749
764
  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;
750
765
  const isRunning = t1 === void 0 ? false : t1;
751
766
  const isLoading = t2 === void 0 ? false : t2;
@@ -758,22 +773,20 @@ const useExternalThread = (t0) => {
758
773
  } else t4 = $[1];
759
774
  const messages = t4;
760
775
  let t5;
761
- if ($[2] !== messages || $[3] !== onReload || $[4] !== queue) {
776
+ if ($[2] !== messages || $[3] !== onReload) {
762
777
  t5 = (messageId) => {
763
778
  const messageIndex = messages.findIndex((m) => m.id === messageId);
764
779
  if (messageIndex === -1) return;
765
780
  const parentId = messageIndex > 0 ? messages[messageIndex - 1].id : null;
766
- queue?.clear("reload");
767
781
  onReload?.(parentId);
768
782
  };
769
783
  $[2] = messages;
770
784
  $[3] = onReload;
771
- $[4] = queue;
772
- $[5] = t5;
773
- } else t5 = $[5];
785
+ $[4] = t5;
786
+ } else t5 = $[4];
774
787
  const handleReload = t5;
775
788
  let t6;
776
- if ($[6] !== attachmentAdapter || $[7] !== branches || $[8] !== handleReload || $[9] !== messages || $[10] !== onAddToolResult || $[11] !== onEdit || $[12] !== onRespondToToolApproval || $[13] !== onResumeToolCall || $[14] !== queue) {
789
+ if ($[5] !== attachmentAdapter || $[6] !== branches || $[7] !== handleReload || $[8] !== messages || $[9] !== onAddToolResult || $[10] !== onEdit || $[11] !== onRespondToToolApproval || $[12] !== onResumeToolCall || $[13] !== queue) {
777
790
  t6 = messages.map((msg, index) => {
778
791
  const props = {
779
792
  message: msg,
@@ -790,65 +803,67 @@ const useExternalThread = (t0) => {
790
803
  if (onEdit) props.onEdit = onEdit;
791
804
  return withKey(msg.id, MessageClient(props));
792
805
  });
793
- $[6] = attachmentAdapter;
794
- $[7] = branches;
795
- $[8] = handleReload;
796
- $[9] = messages;
797
- $[10] = onAddToolResult;
798
- $[11] = onEdit;
799
- $[12] = onRespondToToolApproval;
800
- $[13] = onResumeToolCall;
801
- $[14] = queue;
802
- $[15] = t6;
803
- } else t6 = $[15];
806
+ $[5] = attachmentAdapter;
807
+ $[6] = branches;
808
+ $[7] = handleReload;
809
+ $[8] = messages;
810
+ $[9] = onAddToolResult;
811
+ $[10] = onEdit;
812
+ $[11] = onRespondToToolApproval;
813
+ $[12] = onResumeToolCall;
814
+ $[13] = queue;
815
+ $[14] = t6;
816
+ } else t6 = $[14];
804
817
  const messageClients = useClientLookup(t6);
805
818
  let t7;
806
- if ($[16] !== onCancel || $[17] !== queue) {
819
+ if ($[15] !== onCancel) {
807
820
  t7 = () => {
808
- queue?.clear("cancel-run");
809
821
  onCancel?.();
810
822
  };
811
- $[16] = onCancel;
812
- $[17] = queue;
813
- $[18] = t7;
814
- } else t7 = $[18];
823
+ $[15] = onCancel;
824
+ $[16] = t7;
825
+ } else t7 = $[16];
815
826
  const handleCancelRun = t7;
816
827
  let t8;
817
- if ($[19] !== messages || $[20] !== onNew) {
828
+ if ($[17] !== messages || $[18] !== onNew) {
818
829
  t8 = (message) => {
819
830
  onNew?.({
820
831
  ...message,
821
832
  parentId: messages.at(-1)?.id ?? null
822
833
  });
823
834
  };
824
- $[19] = messages;
825
- $[20] = onNew;
826
- $[21] = t8;
827
- } else t8 = $[21];
835
+ $[17] = messages;
836
+ $[18] = onNew;
837
+ $[19] = t8;
838
+ } else t8 = $[19];
828
839
  const handleSendNew = t8;
829
840
  let t9;
830
- if ($[22] !== messages) {
841
+ if ($[20] !== messages) {
831
842
  t9 = messages.at(-1)?.id ?? null;
832
- $[22] = messages;
833
- $[23] = t9;
834
- } else t9 = $[23];
843
+ $[20] = messages;
844
+ $[21] = t9;
845
+ } else t9 = $[21];
835
846
  const headId = t9;
836
847
  let t10;
837
- if ($[24] !== headId || $[25] !== queue) {
848
+ if ($[22] !== headId || $[23] !== queue) {
838
849
  t10 = queue && {
839
850
  ...queue,
840
- enqueue: (message_0, options) => queue.enqueue({
851
+ enqueue: (message_0) => queue.enqueue({
841
852
  ...message_0,
842
853
  parentId: message_0.parentId ?? headId
843
- }, options)
854
+ }),
855
+ steer: (message_1) => queue.steer({
856
+ ...message_1,
857
+ parentId: message_1.parentId ?? headId
858
+ })
844
859
  };
845
- $[24] = headId;
846
- $[25] = queue;
847
- $[26] = t10;
848
- } else t10 = $[26];
860
+ $[22] = headId;
861
+ $[23] = queue;
862
+ $[24] = t10;
863
+ } else t10 = $[24];
849
864
  const composerQueue = t10;
850
865
  let t11;
851
- if ($[27] !== attachmentAdapter || $[28] !== composerQueue || $[29] !== handleCancelRun || $[30] !== handleSendNew || $[31] !== isRunning || $[32] !== isSendDisabled) {
866
+ if ($[25] !== attachmentAdapter || $[26] !== composerQueue || $[27] !== handleCancelRun || $[28] !== handleSendNew || $[29] !== isRunning || $[30] !== isSendDisabled) {
852
867
  t11 = ComposerClientResource({
853
868
  type: "thread",
854
869
  isEditing: true,
@@ -859,14 +874,14 @@ const useExternalThread = (t0) => {
859
874
  queue: composerQueue,
860
875
  attachmentAdapter
861
876
  });
862
- $[27] = attachmentAdapter;
863
- $[28] = composerQueue;
864
- $[29] = handleCancelRun;
865
- $[30] = handleSendNew;
866
- $[31] = isRunning;
867
- $[32] = isSendDisabled;
868
- $[33] = t11;
869
- } else t11 = $[33];
877
+ $[25] = attachmentAdapter;
878
+ $[26] = composerQueue;
879
+ $[27] = handleCancelRun;
880
+ $[28] = handleSendNew;
881
+ $[29] = isRunning;
882
+ $[30] = isSendDisabled;
883
+ $[31] = t11;
884
+ } else t11 = $[31];
870
885
  const composerClient = useClientResource(t11);
871
886
  const hasQueue = !!queue;
872
887
  const hasBranches = !!branches;
@@ -874,15 +889,15 @@ const useExternalThread = (t0) => {
874
889
  const hasReload = !!onReload;
875
890
  const hasAttachments = !!attachmentAdapter;
876
891
  let t12;
877
- if ($[34] !== messageClients.state) {
892
+ if ($[32] !== messageClients.state) {
878
893
  t12 = messageClients.state.map(_temp10);
879
- $[34] = messageClients.state;
880
- $[35] = t12;
881
- } else t12 = $[35];
894
+ $[32] = messageClients.state;
895
+ $[33] = t12;
896
+ } else t12 = $[33];
882
897
  const messageStates = t12;
883
898
  const t13 = messages.length === 0;
884
899
  let t14;
885
- if ($[36] !== hasAttachments || $[37] !== hasBranches || $[38] !== hasEdit || $[39] !== hasQueue || $[40] !== hasReload || $[41] !== isRunning) {
900
+ if ($[34] !== hasAttachments || $[35] !== hasBranches || $[36] !== hasEdit || $[37] !== hasQueue || $[38] !== hasReload || $[39] !== isRunning) {
886
901
  t14 = {
887
902
  edit: hasEdit,
888
903
  delete: false,
@@ -899,27 +914,27 @@ const useExternalThread = (t0) => {
899
914
  dictation: false,
900
915
  queue: hasQueue
901
916
  };
902
- $[36] = hasAttachments;
903
- $[37] = hasBranches;
904
- $[38] = hasEdit;
905
- $[39] = hasQueue;
906
- $[40] = hasReload;
907
- $[41] = isRunning;
908
- $[42] = t14;
909
- } else t14 = $[42];
917
+ $[34] = hasAttachments;
918
+ $[35] = hasBranches;
919
+ $[36] = hasEdit;
920
+ $[37] = hasQueue;
921
+ $[38] = hasReload;
922
+ $[39] = isRunning;
923
+ $[40] = t14;
924
+ } else t14 = $[40];
910
925
  let t15;
911
- if ($[43] !== threadState) {
926
+ if ($[41] !== threadState) {
912
927
  t15 = threadState ?? {};
913
- $[43] = threadState;
914
- $[44] = t15;
915
- } else t15 = $[44];
928
+ $[41] = threadState;
929
+ $[42] = t15;
930
+ } else t15 = $[42];
916
931
  let t16;
917
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
932
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
918
933
  t16 = [];
919
- $[45] = t16;
920
- } else t16 = $[45];
934
+ $[43] = t16;
935
+ } else t16 = $[43];
921
936
  let t17;
922
- if ($[46] !== composerClient.state || $[47] !== extras || $[48] !== isLoading || $[49] !== isRunning || $[50] !== messageStates || $[51] !== t13 || $[52] !== t14 || $[53] !== t15) {
937
+ if ($[44] !== composerClient.state || $[45] !== extras || $[46] !== isLoading || $[47] !== isRunning || $[48] !== messageStates || $[49] !== t13 || $[50] !== t14 || $[51] !== t15) {
923
938
  t17 = {
924
939
  isEmpty: t13,
925
940
  isDisabled: false,
@@ -934,33 +949,33 @@ const useExternalThread = (t0) => {
934
949
  voice: void 0,
935
950
  composer: composerClient.state
936
951
  };
937
- $[46] = composerClient.state;
938
- $[47] = extras;
939
- $[48] = isLoading;
940
- $[49] = isRunning;
941
- $[50] = messageStates;
942
- $[51] = t13;
943
- $[52] = t14;
944
- $[53] = t15;
945
- $[54] = t17;
946
- } else t17 = $[54];
952
+ $[44] = composerClient.state;
953
+ $[45] = extras;
954
+ $[46] = isLoading;
955
+ $[47] = isRunning;
956
+ $[48] = messageStates;
957
+ $[49] = t13;
958
+ $[50] = t14;
959
+ $[51] = t15;
960
+ $[52] = t17;
961
+ } else t17 = $[52];
947
962
  const state = t17;
948
963
  let t18;
949
- if ($[55] !== state) {
964
+ if ($[53] !== state) {
950
965
  t18 = () => state;
951
- $[55] = state;
952
- $[56] = t18;
953
- } else t18 = $[56];
966
+ $[53] = state;
967
+ $[54] = t18;
968
+ } else t18 = $[54];
954
969
  let t19;
955
- if ($[57] !== composerClient.methods) {
970
+ if ($[55] !== composerClient.methods) {
956
971
  t19 = () => composerClient.methods;
957
- $[57] = composerClient.methods;
958
- $[58] = t19;
959
- } else t19 = $[58];
972
+ $[55] = composerClient.methods;
973
+ $[56] = t19;
974
+ } else t19 = $[56];
960
975
  let t20;
961
- if ($[59] !== messages || $[60] !== onNew || $[61] !== queue) {
962
- t20 = (message_1) => {
963
- const appendMessage = typeof message_1 === "string" ? {
976
+ if ($[57] !== messages || $[58] !== onNew || $[59] !== queue) {
977
+ t20 = (message_2) => {
978
+ const appendMessage = typeof message_2 === "string" ? {
964
979
  createdAt: /* @__PURE__ */ new Date(),
965
980
  parentId: messages.at(-1)?.id ?? null,
966
981
  sourceId: null,
@@ -968,66 +983,66 @@ const useExternalThread = (t0) => {
968
983
  role: "user",
969
984
  content: [{
970
985
  type: "text",
971
- text: message_1
986
+ text: message_2
972
987
  }],
973
988
  attachments: [],
974
989
  metadata: { custom: {} }
975
990
  } : {
976
- createdAt: message_1.createdAt ?? /* @__PURE__ */ new Date(),
977
- parentId: message_1.parentId ?? messages.at(-1)?.id ?? null,
978
- sourceId: message_1.sourceId ?? null,
979
- role: message_1.role ?? "user",
980
- content: message_1.content,
981
- attachments: message_1.attachments ?? [],
982
- metadata: message_1.metadata ?? { custom: {} },
983
- runConfig: message_1.runConfig ?? {},
984
- startRun: message_1.startRun
991
+ createdAt: message_2.createdAt ?? /* @__PURE__ */ new Date(),
992
+ parentId: message_2.parentId ?? messages.at(-1)?.id ?? null,
993
+ sourceId: message_2.sourceId ?? null,
994
+ role: message_2.role ?? "user",
995
+ content: message_2.content,
996
+ attachments: message_2.attachments ?? [],
997
+ metadata: message_2.metadata ?? { custom: {} },
998
+ runConfig: message_2.runConfig ?? {},
999
+ startRun: message_2.startRun
985
1000
  };
986
- if (queue) queue.enqueue(appendMessage, { steer: false });
1001
+ if (queue) queue.enqueue(appendMessage);
987
1002
  else onNew?.(appendMessage);
988
1003
  };
989
- $[59] = messages;
990
- $[60] = onNew;
991
- $[61] = queue;
992
- $[62] = t20;
993
- } else t20 = $[62];
1004
+ $[57] = messages;
1005
+ $[58] = onNew;
1006
+ $[59] = queue;
1007
+ $[60] = t20;
1008
+ } else t20 = $[60];
994
1009
  let t21;
995
- if ($[63] !== onStartRun) {
1010
+ if ($[61] !== onStartRun) {
996
1011
  t21 = () => {
997
1012
  onStartRun?.();
998
1013
  };
999
- $[63] = onStartRun;
1000
- $[64] = t21;
1001
- } else t21 = $[64];
1014
+ $[61] = onStartRun;
1015
+ $[62] = t21;
1016
+ } else t21 = $[62];
1002
1017
  let t22;
1003
- if ($[65] !== onResume) {
1018
+ if ($[63] !== onResume) {
1004
1019
  t22 = () => {
1005
1020
  if (!onResume) throw new Error("Runtime does not support resuming runs (onResume is not set).");
1006
1021
  onResume();
1007
1022
  };
1008
- $[65] = onResume;
1009
- $[66] = t22;
1010
- } else t22 = $[66];
1023
+ $[63] = onResume;
1024
+ $[64] = t22;
1025
+ } else t22 = $[64];
1011
1026
  let t23;
1012
- if ($[67] !== onLoadExternalState) {
1027
+ if ($[65] !== onLoadExternalState) {
1013
1028
  t23 = (state_0) => {
1014
1029
  if (!onLoadExternalState) throw new Error("Runtime does not support importing external states (onLoadExternalState is not set).");
1015
1030
  onLoadExternalState(state_0);
1016
1031
  };
1017
- $[67] = onLoadExternalState;
1018
- $[68] = t23;
1019
- } else t23 = $[68];
1032
+ $[65] = onLoadExternalState;
1033
+ $[66] = t23;
1034
+ } else t23 = $[66];
1020
1035
  let t24;
1021
- if ($[69] !== messageClients) {
1036
+ if ($[67] !== messageClients) {
1022
1037
  t24 = (selector) => {
1023
1038
  if ("id" in selector) return messageClients.get({ key: selector.id });
1024
1039
  return messageClients.get(selector);
1025
1040
  };
1026
- $[69] = messageClients;
1027
- $[70] = t24;
1028
- } else t24 = $[70];
1041
+ $[67] = messageClients;
1042
+ $[68] = t24;
1043
+ } else t24 = $[68];
1029
1044
  let t25;
1030
- if ($[71] !== handleCancelRun || $[72] !== t18 || $[73] !== t19 || $[74] !== t20 || $[75] !== t21 || $[76] !== t22 || $[77] !== t23 || $[78] !== t24) {
1045
+ if ($[69] !== handleCancelRun || $[70] !== t18 || $[71] !== t19 || $[72] !== t20 || $[73] !== t21 || $[74] !== t22 || $[75] !== t23 || $[76] !== t24) {
1031
1046
  t25 = {
1032
1047
  getState: t18,
1033
1048
  composer: t19,
@@ -1050,16 +1065,16 @@ const useExternalThread = (t0) => {
1050
1065
  muteVoice: _temp22,
1051
1066
  unmuteVoice: _temp23
1052
1067
  };
1053
- $[71] = handleCancelRun;
1054
- $[72] = t18;
1055
- $[73] = t19;
1056
- $[74] = t20;
1057
- $[75] = t21;
1058
- $[76] = t22;
1059
- $[77] = t23;
1060
- $[78] = t24;
1061
- $[79] = t25;
1062
- } else t25 = $[79];
1068
+ $[69] = handleCancelRun;
1069
+ $[70] = t18;
1070
+ $[71] = t19;
1071
+ $[72] = t20;
1072
+ $[73] = t21;
1073
+ $[74] = t22;
1074
+ $[75] = t23;
1075
+ $[76] = t24;
1076
+ $[77] = t25;
1077
+ } else t25 = $[77];
1063
1078
  return t25;
1064
1079
  };
1065
1080
  const ExternalThread = resource(useExternalThread);