@assistant-ui/react 0.5.79 → 0.5.80
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-KVXP3Q6K.js → chunk-BDPD5HCK.js} +26 -24
- package/dist/chunk-BDPD5HCK.js.map +1 -0
- package/dist/{chunk-SNNYBBO6.mjs → chunk-RRW3NW2F.mjs} +18 -16
- package/dist/chunk-RRW3NW2F.mjs.map +1 -0
- package/dist/edge.js +17 -15
- package/dist/edge.js.map +1 -1
- package/dist/edge.mjs +17 -15
- package/dist/edge.mjs.map +1 -1
- package/dist/index.js +54 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KVXP3Q6K.js.map +0 -1
- package/dist/chunk-SNNYBBO6.mjs.map +0 -1
package/dist/index.js
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
|
12
|
-
var
|
12
|
+
var _chunkBDPD5HCKjs = require('./chunk-BDPD5HCK.js');
|
13
13
|
|
14
14
|
|
15
15
|
var _chunkPZ5AY32Cjs = require('./chunk-PZ5AY32C.js');
|
@@ -3105,7 +3105,7 @@ var DefaultThreadComposerRuntimeCore = (_class8 = class extends BaseComposerRunt
|
|
3105
3105
|
var ProxyConfigProvider = (_class9 = class {constructor() { _class9.prototype.__init17.call(this); }
|
3106
3106
|
__init17() {this._providers = /* @__PURE__ */ new Set()}
|
3107
3107
|
getModelConfig() {
|
3108
|
-
return
|
3108
|
+
return _chunkBDPD5HCKjs.mergeModelConfigs.call(void 0, this._providers);
|
3109
3109
|
}
|
3110
3110
|
registerModelConfigProvider(provider) {
|
3111
3111
|
this._providers.add(provider);
|
@@ -3880,14 +3880,14 @@ function streamPartDecoderStream() {
|
|
3880
3880
|
controller.enqueue(decodeStreamPart(chunk));
|
3881
3881
|
}
|
3882
3882
|
});
|
3883
|
-
return new (0,
|
3883
|
+
return new (0, _chunkBDPD5HCKjs.PipeableTransformStream)((readable) => {
|
3884
3884
|
return readable.pipeThrough(new TextDecoderStream()).pipeThrough(chunkByLineStream()).pipeThrough(decodeStream);
|
3885
3885
|
});
|
3886
3886
|
}
|
3887
3887
|
|
3888
3888
|
// src/runtimes/edge/streams/utils/index.ts
|
3889
3889
|
var streamUtils = {
|
3890
|
-
streamPartEncoderStream:
|
3890
|
+
streamPartEncoderStream: _chunkBDPD5HCKjs.streamPartEncoderStream,
|
3891
3891
|
streamPartDecoderStream
|
3892
3892
|
};
|
3893
3893
|
|
@@ -3927,7 +3927,9 @@ function assistantDecoderStream() {
|
|
3927
3927
|
case "c" /* ToolCallDelta */: {
|
3928
3928
|
const { toolCallId, argsTextDelta } = value;
|
3929
3929
|
const toolName = toolCallNames.get(toolCallId);
|
3930
|
-
currentToolCall.
|
3930
|
+
if (_optionalChain([currentToolCall, 'optionalAccess', _192 => _192.id]) === toolCallId) {
|
3931
|
+
currentToolCall.argsText += argsTextDelta;
|
3932
|
+
}
|
3931
3933
|
controller.enqueue({
|
3932
3934
|
type: "tool-call-delta",
|
3933
3935
|
toolCallType: "function",
|
@@ -4026,8 +4028,8 @@ var EdgeChatAdapter = class {
|
|
4026
4028
|
credentials: _nullishCoalesce(this.options.credentials, () => ( "same-origin")),
|
4027
4029
|
body: JSON.stringify({
|
4028
4030
|
system: config.system,
|
4029
|
-
messages:
|
4030
|
-
tools: config.tools ?
|
4031
|
+
messages: _chunkBDPD5HCKjs.toCoreMessages.call(void 0, messages2),
|
4032
|
+
tools: config.tools ? _chunkBDPD5HCKjs.toLanguageModelTools.call(void 0, config.tools) : [],
|
4031
4033
|
...config.callSettings,
|
4032
4034
|
...config.config,
|
4033
4035
|
...this.options.body
|
@@ -4037,7 +4039,7 @@ var EdgeChatAdapter = class {
|
|
4037
4039
|
if (!result.ok) {
|
4038
4040
|
throw new Error(`Status ${result.status}: ${await result.text()}`);
|
4039
4041
|
}
|
4040
|
-
const stream = result.body.pipeThrough(streamPartDecoderStream()).pipeThrough(assistantDecoderStream()).pipeThrough(
|
4042
|
+
const stream = result.body.pipeThrough(streamPartDecoderStream()).pipeThrough(assistantDecoderStream()).pipeThrough(_chunkBDPD5HCKjs.toolResultStream.call(void 0, config.tools, abortSignal)).pipeThrough(_chunkBDPD5HCKjs.runResultStream.call(void 0, ));
|
4041
4043
|
let update;
|
4042
4044
|
for await (update of asAsyncIterable(stream)) {
|
4043
4045
|
yield update;
|
@@ -4069,7 +4071,7 @@ var useEdgeRuntime = (options) => {
|
|
4069
4071
|
};
|
4070
4072
|
|
4071
4073
|
// src/runtimes/local/shouldContinue.tsx
|
4072
|
-
var shouldContinue = (result) => _optionalChain([result, 'access',
|
4074
|
+
var shouldContinue = (result) => _optionalChain([result, 'access', _193 => _193.status, 'optionalAccess', _194 => _194.type]) === "requires-action" && result.status.reason === "tool-calls" && result.content.every((c) => c.type !== "tool-call" || !!c.result);
|
4073
4075
|
|
4074
4076
|
// src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx
|
4075
4077
|
var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
|
@@ -4089,7 +4091,7 @@ var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
|
|
4089
4091
|
return true;
|
4090
4092
|
}
|
4091
4093
|
getAttachmentAdapter() {
|
4092
|
-
return _optionalChain([this, 'access',
|
4094
|
+
return _optionalChain([this, 'access', _195 => _195.runtime, 'access', _196 => _196.adapters, 'optionalAccess', _197 => _197.attachments]);
|
4093
4095
|
}
|
4094
4096
|
|
4095
4097
|
|
@@ -4167,7 +4169,7 @@ var BaseThreadRuntimeCore = (_class12 = class {
|
|
4167
4169
|
return this._submittedFeedback[messageId];
|
4168
4170
|
}
|
4169
4171
|
submitFeedback({ messageId, type }) {
|
4170
|
-
const adapter = _optionalChain([this, 'access',
|
4172
|
+
const adapter = _optionalChain([this, 'access', _198 => _198.adapters, 'optionalAccess', _199 => _199.feedback]);
|
4171
4173
|
if (!adapter) throw new Error("Feedback adapter not configured");
|
4172
4174
|
const { message } = this.repository.getMessage(messageId);
|
4173
4175
|
adapter.submit({ message, type });
|
@@ -4177,10 +4179,10 @@ var BaseThreadRuntimeCore = (_class12 = class {
|
|
4177
4179
|
|
4178
4180
|
|
4179
4181
|
speak(messageId) {
|
4180
|
-
const adapter = _optionalChain([this, 'access',
|
4182
|
+
const adapter = _optionalChain([this, 'access', _200 => _200.adapters, 'optionalAccess', _201 => _201.speech]);
|
4181
4183
|
if (!adapter) throw new Error("Speech adapter not configured");
|
4182
4184
|
const { message } = this.repository.getMessage(messageId);
|
4183
|
-
_optionalChain([this, 'access',
|
4185
|
+
_optionalChain([this, 'access', _202 => _202._stopSpeaking, 'optionalCall', _203 => _203()]);
|
4184
4186
|
const utterance = adapter.speak(message);
|
4185
4187
|
const unsub = utterance.subscribe(() => {
|
4186
4188
|
if (utterance.status.type === "ended") {
|
@@ -4270,17 +4272,17 @@ var LocalThreadRuntimeCore = (_class13 = class extends BaseThreadRuntimeCore {
|
|
4270
4272
|
set options({ initialMessages, ...options }) {
|
4271
4273
|
this._options = options;
|
4272
4274
|
let hasUpdates = false;
|
4273
|
-
const canSpeak = _optionalChain([options, 'access',
|
4275
|
+
const canSpeak = _optionalChain([options, 'access', _204 => _204.adapters, 'optionalAccess', _205 => _205.speech]) !== void 0;
|
4274
4276
|
if (this.capabilities.speech !== canSpeak) {
|
4275
4277
|
this.capabilities.speech = canSpeak;
|
4276
4278
|
hasUpdates = true;
|
4277
4279
|
}
|
4278
|
-
const canAttach = _optionalChain([options, 'access',
|
4280
|
+
const canAttach = _optionalChain([options, 'access', _206 => _206.adapters, 'optionalAccess', _207 => _207.attachments]) !== void 0;
|
4279
4281
|
if (this.capabilities.attachments !== canAttach) {
|
4280
4282
|
this.capabilities.attachments = canAttach;
|
4281
4283
|
hasUpdates = true;
|
4282
4284
|
}
|
4283
|
-
const canFeedback = _optionalChain([options, 'access',
|
4285
|
+
const canFeedback = _optionalChain([options, 'access', _208 => _208.adapters, 'optionalAccess', _209 => _209.feedback]) !== void 0;
|
4284
4286
|
if (this.capabilities.feedback !== canFeedback) {
|
4285
4287
|
this.capabilities.feedback = canFeedback;
|
4286
4288
|
hasUpdates = true;
|
@@ -4316,13 +4318,13 @@ var LocalThreadRuntimeCore = (_class13 = class extends BaseThreadRuntimeCore {
|
|
4316
4318
|
}
|
4317
4319
|
async performRoundtrip(parentId, message) {
|
4318
4320
|
const messages2 = this.repository.getMessages();
|
4319
|
-
_optionalChain([this, 'access',
|
4321
|
+
_optionalChain([this, 'access', _210 => _210.abortController, 'optionalAccess', _211 => _211.abort, 'call', _212 => _212()]);
|
4320
4322
|
this.abortController = new AbortController();
|
4321
4323
|
const initialContent = message.content;
|
4322
|
-
const initialSteps = _optionalChain([message, 'access',
|
4323
|
-
const initalCustom = _optionalChain([message, 'access',
|
4324
|
+
const initialSteps = _optionalChain([message, 'access', _213 => _213.metadata, 'optionalAccess', _214 => _214.steps]);
|
4325
|
+
const initalCustom = _optionalChain([message, 'access', _215 => _215.metadata, 'optionalAccess', _216 => _216.custom]);
|
4324
4326
|
const updateMessage = (m) => {
|
4325
|
-
const newSteps = _optionalChain([m, 'access',
|
4327
|
+
const newSteps = _optionalChain([m, 'access', _217 => _217.metadata, 'optionalAccess', _218 => _218.steps]) || _optionalChain([m, 'access', _219 => _219.metadata, 'optionalAccess', _220 => _220.roundtrips]);
|
4326
4328
|
const steps2 = newSteps ? [..._nullishCoalesce(initialSteps, () => ( [])), ...newSteps] : void 0;
|
4327
4329
|
message = {
|
4328
4330
|
...message,
|
@@ -4334,7 +4336,7 @@ var LocalThreadRuntimeCore = (_class13 = class extends BaseThreadRuntimeCore {
|
|
4334
4336
|
metadata: {
|
4335
4337
|
...message.metadata,
|
4336
4338
|
...steps2 ? { roundtrips: steps2, steps: steps2 } : void 0,
|
4337
|
-
..._optionalChain([m, 'access',
|
4339
|
+
..._optionalChain([m, 'access', _221 => _221.metadata, 'optionalAccess', _222 => _222.custom]) ? {
|
4338
4340
|
custom: { ..._nullishCoalesce(initalCustom, () => ( {})), ...m.metadata.custom }
|
4339
4341
|
} : void 0
|
4340
4342
|
}
|
@@ -4344,7 +4346,7 @@ var LocalThreadRuntimeCore = (_class13 = class extends BaseThreadRuntimeCore {
|
|
4344
4346
|
this._notifySubscribers();
|
4345
4347
|
};
|
4346
4348
|
const maxSteps = this.options.maxSteps ? this.options.maxSteps : (_nullishCoalesce(this.options.maxToolRoundtrips, () => ( 1))) + 1;
|
4347
|
-
const steps = _nullishCoalesce(_optionalChain([message, 'access',
|
4349
|
+
const steps = _nullishCoalesce(_optionalChain([message, 'access', _223 => _223.metadata, 'optionalAccess', _224 => _224.steps, 'optionalAccess', _225 => _225.length]), () => ( 0));
|
4348
4350
|
if (steps >= maxSteps) {
|
4349
4351
|
updateMessage({
|
4350
4352
|
status: {
|
@@ -4396,7 +4398,7 @@ var LocalThreadRuntimeCore = (_class13 = class extends BaseThreadRuntimeCore {
|
|
4396
4398
|
return message;
|
4397
4399
|
}
|
4398
4400
|
cancelRun() {
|
4399
|
-
_optionalChain([this, 'access',
|
4401
|
+
_optionalChain([this, 'access', _226 => _226.abortController, 'optionalAccess', _227 => _227.abort, 'call', _228 => _228()]);
|
4400
4402
|
this.abortController = null;
|
4401
4403
|
}
|
4402
4404
|
addToolResult({
|
@@ -4468,7 +4470,7 @@ var LocalRuntimeCore = class extends BaseAssistantRuntimeCore {
|
|
4468
4470
|
const messages2 = fromCoreMessages(initialMessages);
|
4469
4471
|
this.thread.import({
|
4470
4472
|
messages: messages2.map((m, idx) => ({
|
4471
|
-
parentId: _nullishCoalesce(_optionalChain([messages2, 'access',
|
4473
|
+
parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _229 => _229[idx - 1], 'optionalAccess', _230 => _230.id]), () => ( null)),
|
4472
4474
|
message: m
|
4473
4475
|
}))
|
4474
4476
|
});
|
@@ -4608,7 +4610,7 @@ var fromThreadMessageLike = (like, fallbackId, fallbackStatus) => {
|
|
4608
4610
|
// src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx
|
4609
4611
|
var EMPTY_ARRAY2 = Object.freeze([]);
|
4610
4612
|
var hasUpcomingMessage = (isRunning, messages2) => {
|
4611
|
-
return isRunning && _optionalChain([messages2, 'access',
|
4613
|
+
return isRunning && _optionalChain([messages2, 'access', _231 => _231[messages2.length - 1], 'optionalAccess', _232 => _232.role]) !== "assistant";
|
4612
4614
|
};
|
4613
4615
|
var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntimeCore {
|
4614
4616
|
__init34() {this.assistantOptimisticId = null}
|
@@ -4664,11 +4666,11 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4664
4666
|
edit: this._store.onEdit !== void 0,
|
4665
4667
|
reload: this._store.onReload !== void 0,
|
4666
4668
|
cancel: this._store.onCancel !== void 0,
|
4667
|
-
speech: _optionalChain([this, 'access',
|
4668
|
-
unstable_copy: _optionalChain([this, 'access',
|
4669
|
+
speech: _optionalChain([this, 'access', _236 => _236._store, 'access', _237 => _237.adapters, 'optionalAccess', _238 => _238.speech]) !== void 0,
|
4670
|
+
unstable_copy: _optionalChain([this, 'access', _239 => _239._store, 'access', _240 => _240.unstable_capabilities, 'optionalAccess', _241 => _241.copy]) !== false,
|
4669
4671
|
// default true
|
4670
|
-
attachments: !!_optionalChain([this, 'access',
|
4671
|
-
feedback: !!_optionalChain([this, 'access',
|
4672
|
+
attachments: !!_optionalChain([this, 'access', _242 => _242.store, 'access', _243 => _243.adapters, 'optionalAccess', _244 => _244.attachments]),
|
4673
|
+
feedback: !!_optionalChain([this, 'access', _245 => _245.store, 'access', _246 => _246.adapters, 'optionalAccess', _247 => _247.feedback])
|
4672
4674
|
};
|
4673
4675
|
if (oldStore) {
|
4674
4676
|
if (oldStore.convertMessage !== store.convertMessage) {
|
@@ -4695,7 +4697,7 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4695
4697
|
for (let i = 0; i < messages2.length; i++) {
|
4696
4698
|
const message = messages2[i];
|
4697
4699
|
const parent = messages2[i - 1];
|
4698
|
-
this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
4700
|
+
this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _248 => _248.id]), () => ( null)), message);
|
4699
4701
|
}
|
4700
4702
|
if (this.assistantOptimisticId) {
|
4701
4703
|
this.repository.deleteMessage(this.assistantOptimisticId);
|
@@ -4703,7 +4705,7 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4703
4705
|
}
|
4704
4706
|
if (hasUpcomingMessage(isRunning, messages2)) {
|
4705
4707
|
this.assistantOptimisticId = this.repository.appendOptimisticMessage(
|
4706
|
-
_nullishCoalesce(_optionalChain([messages2, 'access',
|
4708
|
+
_nullishCoalesce(_optionalChain([messages2, 'access', _249 => _249.at, 'call', _250 => _250(-1), 'optionalAccess', _251 => _251.id]), () => ( null)),
|
4707
4709
|
{
|
4708
4710
|
role: "assistant",
|
4709
4711
|
content: []
|
@@ -4711,7 +4713,7 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4711
4713
|
);
|
4712
4714
|
}
|
4713
4715
|
this.repository.resetHead(
|
4714
|
-
_nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages2, 'access',
|
4716
|
+
_nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages2, 'access', _252 => _252.at, 'call', _253 => _253(-1), 'optionalAccess', _254 => _254.id]))), () => ( null))
|
4715
4717
|
);
|
4716
4718
|
this._messages = this.repository.getMessages();
|
4717
4719
|
this._notifySubscribers();
|
@@ -4723,7 +4725,7 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4723
4725
|
this.updateMessages(this.repository.getMessages());
|
4724
4726
|
}
|
4725
4727
|
async append(message) {
|
4726
|
-
if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access',
|
4728
|
+
if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _255 => _255.messages, 'access', _256 => _256.at, 'call', _257 => _257(-1), 'optionalAccess', _258 => _258.id]), () => ( null)))) {
|
4727
4729
|
if (!this._store.onEdit)
|
4728
4730
|
throw new Error("Runtime does not support editing messages.");
|
4729
4731
|
await this._store.onEdit(message);
|
@@ -4746,7 +4748,7 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4746
4748
|
}
|
4747
4749
|
let messages2 = this.repository.getMessages();
|
4748
4750
|
const previousMessage = messages2[messages2.length - 1];
|
4749
|
-
if (_optionalChain([previousMessage, 'optionalAccess',
|
4751
|
+
if (_optionalChain([previousMessage, 'optionalAccess', _259 => _259.role]) === "user" && previousMessage.id === _optionalChain([messages2, 'access', _260 => _260.at, 'call', _261 => _261(-1), 'optionalAccess', _262 => _262.id])) {
|
4750
4752
|
this.repository.deleteMessage(previousMessage.id);
|
4751
4753
|
if (!this.composer.text.trim()) {
|
4752
4754
|
this.composer.setText(getThreadMessageText(previousMessage));
|
@@ -4765,7 +4767,7 @@ var ExternalStoreThreadRuntimeCore = (_class15 = class extends BaseThreadRuntime
|
|
4765
4767
|
this._store.onAddToolResult(options);
|
4766
4768
|
}
|
4767
4769
|
__init39() {this.updateMessages = (messages2) => {
|
4768
|
-
_optionalChain([this, 'access',
|
4770
|
+
_optionalChain([this, 'access', _263 => _263._store, 'access', _264 => _264.setMessages, 'optionalCall', _265 => _265(
|
4769
4771
|
messages2.flatMap(getExternalStoreMessage).filter((m) => m != null)
|
4770
4772
|
)]);
|
4771
4773
|
}}
|
@@ -4985,18 +4987,18 @@ var DangerousInBrowserAdapter = class {
|
|
4985
4987
|
this.options = options;
|
4986
4988
|
}
|
4987
4989
|
async *run({ messages: messages2, abortSignal, config }) {
|
4988
|
-
const res = await
|
4990
|
+
const res = await _chunkBDPD5HCKjs.getEdgeRuntimeStream.call(void 0, {
|
4989
4991
|
options: this.options,
|
4990
4992
|
abortSignal,
|
4991
4993
|
requestData: {
|
4992
4994
|
system: config.system,
|
4993
|
-
messages:
|
4994
|
-
tools: config.tools ?
|
4995
|
+
messages: _chunkBDPD5HCKjs.toCoreMessages.call(void 0, messages2),
|
4996
|
+
tools: config.tools ? _chunkBDPD5HCKjs.toLanguageModelTools.call(void 0, config.tools) : [],
|
4995
4997
|
...config.callSettings,
|
4996
4998
|
...config.config
|
4997
4999
|
}
|
4998
5000
|
});
|
4999
|
-
const stream = res.pipeThrough(
|
5001
|
+
const stream = res.pipeThrough(_chunkBDPD5HCKjs.toolResultStream.call(void 0, config.tools, abortSignal)).pipeThrough(_chunkBDPD5HCKjs.runResultStream.call(void 0, ));
|
5000
5002
|
for await (const update of asAsyncIterable(stream)) {
|
5001
5003
|
yield update;
|
5002
5004
|
}
|
@@ -5216,7 +5218,7 @@ var ThreadConfigProvider = ({
|
|
5216
5218
|
}) => {
|
5217
5219
|
const hasAssistant = !!useAssistantRuntime({ optional: true });
|
5218
5220
|
const configProvider = config && Object.keys(_nullishCoalesce(config, () => ( {}))).length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
|
5219
|
-
if (!_optionalChain([config, 'optionalAccess',
|
5221
|
+
if (!_optionalChain([config, 'optionalAccess', _266 => _266.runtime])) return configProvider;
|
5220
5222
|
if (hasAssistant) {
|
5221
5223
|
throw new Error(
|
5222
5224
|
"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
|
@@ -5544,7 +5546,7 @@ var AssistantMessageContent = _react.forwardRef.call(void 0, ({ components: comp
|
|
5544
5546
|
{
|
5545
5547
|
components: {
|
5546
5548
|
...componentsProp,
|
5547
|
-
Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess',
|
5549
|
+
Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _267 => _267.Text]), () => ( components.Text)), () => ( content_part_default.Text)),
|
5548
5550
|
tools: toolsComponents
|
5549
5551
|
}
|
5550
5552
|
}
|
@@ -5655,7 +5657,7 @@ var useAttachmentSrc = () => {
|
|
5655
5657
|
const { file, src } = useAttachment((a) => {
|
5656
5658
|
if (a.type !== "image") return {};
|
5657
5659
|
if (a.file) return { file: a.file };
|
5658
|
-
const src2 = _optionalChain([a, 'access',
|
5660
|
+
const src2 = _optionalChain([a, 'access', _268 => _268.content, 'optionalAccess', _269 => _269.filter, 'call', _270 => _270((c) => c.type === "image"), 'access', _271 => _271[0], 'optionalAccess', _272 => _272.image]);
|
5659
5661
|
if (!src2) return {};
|
5660
5662
|
return { src: src2 };
|
5661
5663
|
});
|
@@ -5799,7 +5801,7 @@ var ComposerAttachments = ({ components }) => {
|
|
5799
5801
|
{
|
5800
5802
|
components: {
|
5801
5803
|
...components,
|
5802
|
-
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
5804
|
+
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _273 => _273.Attachment]), () => ( attachment_default))
|
5803
5805
|
}
|
5804
5806
|
}
|
5805
5807
|
) });
|
@@ -5927,7 +5929,7 @@ var ThreadWelcomeSuggestions = () => {
|
|
5927
5929
|
const suggestions2 = useThread((t) => t.suggestions);
|
5928
5930
|
const { welcome: { suggestions } = {} } = useThreadConfig();
|
5929
5931
|
const finalSuggestions = suggestions2.length ? suggestions2 : suggestions;
|
5930
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([finalSuggestions, 'optionalAccess',
|
5932
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([finalSuggestions, 'optionalAccess', _274 => _274.map, 'call', _275 => _275((suggestion, idx) => {
|
5931
5933
|
const key = `${suggestion.prompt}-${idx}`;
|
5932
5934
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestion, { suggestion }, key);
|
5933
5935
|
})]) });
|
@@ -6005,7 +6007,7 @@ var UserMessageContent = _react.forwardRef.call(void 0, ({ components, ...props
|
|
6005
6007
|
{
|
6006
6008
|
components: {
|
6007
6009
|
...components,
|
6008
|
-
Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6010
|
+
Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _276 => _276.Text]), () => ( content_part_default.Text))
|
6009
6011
|
}
|
6010
6012
|
}
|
6011
6013
|
) });
|
@@ -6022,7 +6024,7 @@ var UserMessageAttachments = ({
|
|
6022
6024
|
{
|
6023
6025
|
components: {
|
6024
6026
|
...components,
|
6025
|
-
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6027
|
+
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _277 => _277.Attachment]), () => ( attachment_default))
|
6026
6028
|
}
|
6027
6029
|
}
|
6028
6030
|
) }) });
|
@@ -6125,10 +6127,10 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
|
|
6125
6127
|
thread_exports.Messages,
|
6126
6128
|
{
|
6127
6129
|
components: {
|
6128
|
-
UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6129
|
-
EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6130
|
-
AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6131
|
-
SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6130
|
+
UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _278 => _278.UserMessage]), () => ( user_message_default)),
|
6131
|
+
EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _279 => _279.EditComposer]), () => ( edit_composer_default)),
|
6132
|
+
AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _280 => _280.AssistantMessage]), () => ( assistant_message_default)),
|
6133
|
+
SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _281 => _281.SystemMessage]), () => ( SystemMessage))
|
6132
6134
|
},
|
6133
6135
|
...rest
|
6134
6136
|
}
|
@@ -6139,7 +6141,7 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
|
|
6139
6141
|
ThreadMessages.displayName = "ThreadMessages";
|
6140
6142
|
var ThreadFollowupSuggestions = () => {
|
6141
6143
|
const suggestions = useThread((t) => t.suggestions);
|
6142
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, thread_exports.If, { empty: false, running: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "aui-thread-followup-suggestions", children: _optionalChain([suggestions, 'optionalAccess',
|
6144
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, thread_exports.If, { empty: false, running: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "aui-thread-followup-suggestions", children: _optionalChain([suggestions, 'optionalAccess', _282 => _282.map, 'call', _283 => _283((suggestion, idx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
6143
6145
|
thread_exports.Suggestion,
|
6144
6146
|
{
|
6145
6147
|
className: "aui-thread-followup-suggestion",
|
@@ -6372,5 +6374,5 @@ var assistant_modal_default = Object.assign(AssistantModal, exports12);
|
|
6372
6374
|
|
6373
6375
|
|
6374
6376
|
|
6375
|
-
exports.ActionBarPrimitive = actionBar_exports; exports.AssistantActionBar = assistant_action_bar_default; exports.AssistantMessage = assistant_message_default; exports.AssistantModal = assistant_modal_default; exports.AssistantModalPrimitive = assistantModal_exports; exports.AssistantRuntimeProvider = AssistantRuntimeProvider; exports.AttachmentPrimitive = attachment_exports; exports.AttachmentUI = attachment_default; exports.BranchPicker = branch_picker_default; exports.BranchPickerPrimitive = branchPicker_exports; exports.Composer = composer_default; exports.ComposerAttachment = attachment_default; exports.ComposerPrimitive = composer_exports; exports.CompositeAttachmentAdapter = CompositeAttachmentAdapter; exports.ContentPart = content_part_default; exports.ContentPartPrimitive = contentPart_exports; exports.EdgeChatAdapter = EdgeChatAdapter; exports.EditComposer = edit_composer_default; exports.INTERNAL = internal_exports; exports.MessagePrimitive = message_exports; exports.SimpleImageAttachmentAdapter = SimpleImageAttachmentAdapter; exports.SimpleTextAttachmentAdapter = SimpleTextAttachmentAdapter; exports.TextContentPartProvider = TextContentPartProvider; exports.Thread = thread_default; exports.ThreadConfigProvider = ThreadConfigProvider; exports.ThreadPrimitive = thread_exports; exports.ThreadWelcome = thread_welcome_default; exports.UserActionBar = user_action_bar_default; exports.UserMessage = user_message_default; exports.UserMessageAttachment = attachment_default; exports.WebSpeechSynthesisAdapter = WebSpeechSynthesisAdapter; exports.fromCoreMessage = fromCoreMessage; exports.fromCoreMessages = fromCoreMessages; exports.fromLanguageModelMessages = fromLanguageModelMessages; exports.fromLanguageModelTools = fromLanguageModelTools; exports.getExternalStoreMessage = getExternalStoreMessage; exports.makeAssistantTool = makeAssistantTool; exports.makeAssistantToolUI = makeAssistantToolUI; exports.streamUtils = streamUtils; exports.subscribeToMainThread = subscribeToMainThread; exports.toCoreMessage =
|
6377
|
+
exports.ActionBarPrimitive = actionBar_exports; exports.AssistantActionBar = assistant_action_bar_default; exports.AssistantMessage = assistant_message_default; exports.AssistantModal = assistant_modal_default; exports.AssistantModalPrimitive = assistantModal_exports; exports.AssistantRuntimeProvider = AssistantRuntimeProvider; exports.AttachmentPrimitive = attachment_exports; exports.AttachmentUI = attachment_default; exports.BranchPicker = branch_picker_default; exports.BranchPickerPrimitive = branchPicker_exports; exports.Composer = composer_default; exports.ComposerAttachment = attachment_default; exports.ComposerPrimitive = composer_exports; exports.CompositeAttachmentAdapter = CompositeAttachmentAdapter; exports.ContentPart = content_part_default; exports.ContentPartPrimitive = contentPart_exports; exports.EdgeChatAdapter = EdgeChatAdapter; exports.EditComposer = edit_composer_default; exports.INTERNAL = internal_exports; exports.MessagePrimitive = message_exports; exports.SimpleImageAttachmentAdapter = SimpleImageAttachmentAdapter; exports.SimpleTextAttachmentAdapter = SimpleTextAttachmentAdapter; exports.TextContentPartProvider = TextContentPartProvider; exports.Thread = thread_default; exports.ThreadConfigProvider = ThreadConfigProvider; exports.ThreadPrimitive = thread_exports; exports.ThreadWelcome = thread_welcome_default; exports.UserActionBar = user_action_bar_default; exports.UserMessage = user_message_default; exports.UserMessageAttachment = attachment_default; exports.WebSpeechSynthesisAdapter = WebSpeechSynthesisAdapter; exports.fromCoreMessage = fromCoreMessage; exports.fromCoreMessages = fromCoreMessages; exports.fromLanguageModelMessages = fromLanguageModelMessages; exports.fromLanguageModelTools = fromLanguageModelTools; exports.getExternalStoreMessage = getExternalStoreMessage; exports.makeAssistantTool = makeAssistantTool; exports.makeAssistantToolUI = makeAssistantToolUI; exports.streamUtils = streamUtils; exports.subscribeToMainThread = subscribeToMainThread; exports.toCoreMessage = _chunkBDPD5HCKjs.toCoreMessage; exports.toCoreMessages = _chunkBDPD5HCKjs.toCoreMessages; exports.toLanguageModelMessages = _chunkBDPD5HCKjs.toLanguageModelMessages; exports.toLanguageModelTools = _chunkBDPD5HCKjs.toLanguageModelTools; exports.useActionBarCopy = useActionBarCopy; exports.useActionBarEdit = useActionBarEdit; exports.useActionBarFeedbackNegative = useActionBarFeedbackNegative; exports.useActionBarFeedbackPositive = useActionBarFeedbackPositive; exports.useActionBarReload = useActionBarReload; exports.useActionBarSpeak = useActionBarSpeak; exports.useActionBarStopSpeaking = useActionBarStopSpeaking; exports.useAppendMessage = useAppendMessage; exports.useAssistantActions = useAssistantActions; exports.useAssistantActionsStore = useAssistantActionsStore; exports.useAssistantContext = useAssistantContext; exports.useAssistantInstructions = useAssistantInstructions; exports.useAssistantRuntime = useAssistantRuntime; exports.useAssistantRuntimeStore = useAssistantRuntimeStore; exports.useAssistantTool = useAssistantTool; exports.useAssistantToolUI = useAssistantToolUI; exports.useBranchPickerCount = useBranchPickerCount; exports.useBranchPickerNext = useBranchPickerNext; exports.useBranchPickerNumber = useBranchPickerNumber; exports.useBranchPickerPrevious = useBranchPickerPrevious; exports.useComposer = useComposer; exports.useComposerAddAttachment = useComposerAddAttachment; exports.useComposerCancel = useComposerCancel; exports.useComposerContext = useComposerContext; exports.useComposerIf = useComposerIf; exports.useComposerRuntime = useComposerRuntime; exports.useComposerSend = useComposerSend; exports.useComposerStore = useComposerStore; exports.useContentPart = useContentPart; exports.useContentPartContext = useContentPartContext; exports.useContentPartDisplay = useContentPartDisplay; exports.useContentPartImage = useContentPartImage; exports.useContentPartRuntime = useContentPartRuntime; exports.useContentPartStore = useContentPartStore; exports.useContentPartText = useContentPartText; exports.useDangerousInBrowserRuntime = useDangerousInBrowserRuntime; exports.useEdgeRuntime = useEdgeRuntime; exports.useEditComposer = useEditComposer; exports.useEditComposerStore = useEditComposerStore; exports.useExternalMessageConverter = useExternalMessageConverter; exports.useExternalStoreRuntime = useExternalStoreRuntime; exports.useLocalRuntime = useLocalRuntime; exports.useMessage = useMessage; exports.useMessageContext = useMessageContext; exports.useMessageIf = useMessageIf; exports.useMessageRuntime = useMessageRuntime; exports.useMessageStore = useMessageStore; exports.useMessageUtils = useMessageUtils; exports.useMessageUtilsStore = useMessageUtilsStore; exports.useSwitchToNewThread = useSwitchToNewThread; exports.useThread = useThread; exports.useThreadActions = useThreadActions; exports.useThreadActionsStore = useThreadActionsStore; exports.useThreadComposer = useThreadComposer; exports.useThreadComposerStore = useThreadComposerStore; exports.useThreadConfig = useThreadConfig; exports.useThreadContext = useThreadContext; exports.useThreadEmpty = useThreadEmpty; exports.useThreadIf = useThreadIf; exports.useThreadMessages = useThreadMessages; exports.useThreadMessagesStore = useThreadMessagesStore; exports.useThreadRuntime = useThreadRuntime; exports.useThreadRuntimeStore = useThreadRuntimeStore; exports.useThreadScrollToBottom = useThreadScrollToBottom; exports.useThreadStore = useThreadStore; exports.useThreadSuggestion = useThreadSuggestion; exports.useThreadViewport = useThreadViewport; exports.useThreadViewportStore = useThreadViewportStore; exports.useToolUIs = useToolUIs; exports.useToolUIsStore = useToolUIsStore;
|
6376
6378
|
//# sourceMappingURL=index.js.map
|