@assistant-ui/react 0.5.83 → 0.5.85
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +161 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -120
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -464,22 +464,20 @@ var useSwitchToNewThread = () => {
|
|
464
464
|
var useAssistantTool = (tool) => {
|
465
465
|
const assistantRuntime = useAssistantRuntime();
|
466
466
|
const toolUIsStore = useToolUIsStore();
|
467
|
+
_react.useEffect.call(void 0, () => {
|
468
|
+
return tool.render ? toolUIsStore.getState().setToolUI(tool.toolName, tool.render) : void 0;
|
469
|
+
}, [toolUIsStore, tool.toolName, tool.render]);
|
467
470
|
_react.useEffect.call(void 0, () => {
|
468
471
|
const { toolName, render, ...rest } = tool;
|
469
472
|
const config = {
|
470
473
|
tools: {
|
471
|
-
[
|
474
|
+
[toolName]: rest
|
472
475
|
}
|
473
476
|
};
|
474
|
-
|
477
|
+
return assistantRuntime.registerModelConfigProvider({
|
475
478
|
getModelConfig: () => config
|
476
479
|
});
|
477
|
-
|
478
|
-
return () => {
|
479
|
-
unsub1();
|
480
|
-
_optionalChain([unsub2, 'optionalCall', _10 => _10()]);
|
481
|
-
};
|
482
|
-
}, [assistantRuntime, toolUIsStore, tool]);
|
480
|
+
}, [assistantRuntime, tool]);
|
483
481
|
};
|
484
482
|
|
485
483
|
// src/model-config/makeAssistantTool.tsx
|
@@ -498,9 +496,8 @@ var useAssistantToolUI = (tool) => {
|
|
498
496
|
const toolUIsStore = useToolUIsStore();
|
499
497
|
_react.useEffect.call(void 0, () => {
|
500
498
|
if (!tool) return;
|
501
|
-
|
502
|
-
|
503
|
-
}, [toolUIsStore, tool]);
|
499
|
+
return toolUIsStore.getState().setToolUI(tool.toolName, tool.render);
|
500
|
+
}, [toolUIsStore, _optionalChain([tool, 'optionalAccess', _10 => _10.toolName]), _optionalChain([tool, 'optionalAccess', _11 => _11.render])]);
|
504
501
|
};
|
505
502
|
|
506
503
|
// src/model-config/makeAssistantToolUI.tsx
|
@@ -527,6 +524,20 @@ var useAssistantInstructions = (instruction) => {
|
|
527
524
|
}, [assistantRuntime, instruction]);
|
528
525
|
};
|
529
526
|
|
527
|
+
// src/model-config/useInlineRender.tsx
|
528
|
+
|
529
|
+
|
530
|
+
var useInlineRender = (toolUI) => {
|
531
|
+
const [useToolUI] = _react.useState.call(void 0, () => _zustand.create.call(void 0, () => toolUI));
|
532
|
+
_react.useEffect.call(void 0, () => {
|
533
|
+
useToolUI.setState(toolUI);
|
534
|
+
});
|
535
|
+
return _react.useCallback.call(void 0, (args) => {
|
536
|
+
const toolUI2 = useToolUI();
|
537
|
+
return toolUI2(args);
|
538
|
+
}, []);
|
539
|
+
};
|
540
|
+
|
530
541
|
// src/primitive-hooks/actionBar/useActionBarCopy.tsx
|
531
542
|
|
532
543
|
var useActionBarCopy = ({
|
@@ -739,7 +750,7 @@ var useComposerAddAttachment = () => {
|
|
739
750
|
input.accept = attachmentAccept;
|
740
751
|
}
|
741
752
|
input.onchange = (e) => {
|
742
|
-
const file = _optionalChain([e, 'access',
|
753
|
+
const file = _optionalChain([e, 'access', _12 => _12.target, 'access', _13 => _13.files, 'optionalAccess', _14 => _14[0]]);
|
743
754
|
if (!file) return;
|
744
755
|
composerRuntime.addAttachment(file);
|
745
756
|
};
|
@@ -815,7 +826,7 @@ var useMessageIf = (props) => {
|
|
815
826
|
return false;
|
816
827
|
if (props.hasContent === true && content.length === 0) return false;
|
817
828
|
if (props.hasContent === false && content.length > 0) return false;
|
818
|
-
if (props.submittedFeedback !== void 0 && (_nullishCoalesce(_optionalChain([submittedFeedback, 'optionalAccess',
|
829
|
+
if (props.submittedFeedback !== void 0 && (_nullishCoalesce(_optionalChain([submittedFeedback, 'optionalAccess', _15 => _15.type]), () => ( null))) !== props.submittedFeedback)
|
819
830
|
return false;
|
820
831
|
return true;
|
821
832
|
}
|
@@ -949,7 +960,7 @@ var ActionBarPrimitiveCopy = _react.forwardRef.call(void 0, ({ copiedDuration, o
|
|
949
960
|
ref: forwardedRef,
|
950
961
|
disabled: disabled || !callback,
|
951
962
|
onClick: _primitive.composeEventHandlers.call(void 0, onClick, () => {
|
952
|
-
_optionalChain([callback, 'optionalCall',
|
963
|
+
_optionalChain([callback, 'optionalCall', _16 => _16()]);
|
953
964
|
})
|
954
965
|
}
|
955
966
|
);
|
@@ -981,7 +992,7 @@ var createActionButton = (displayName, useActionButton, forwardProps = []) => {
|
|
981
992
|
ref: forwardedRef,
|
982
993
|
disabled: primitiveProps.disabled || !callback,
|
983
994
|
onClick: _primitive.composeEventHandlers.call(void 0, primitiveProps.onClick, () => {
|
984
|
-
_optionalChain([callback, 'optionalCall',
|
995
|
+
_optionalChain([callback, 'optionalCall', _17 => _17()]);
|
985
996
|
})
|
986
997
|
}
|
987
998
|
);
|
@@ -1030,7 +1041,7 @@ var ActionBarPrimitiveStopSpeaking = _react.forwardRef.call(void 0, (props, ref)
|
|
1030
1041
|
...props,
|
1031
1042
|
ref,
|
1032
1043
|
onClick: _primitive.composeEventHandlers.call(void 0, props.onClick, () => {
|
1033
|
-
_optionalChain([callback, 'optionalCall',
|
1044
|
+
_optionalChain([callback, 'optionalCall', _18 => _18()]);
|
1034
1045
|
})
|
1035
1046
|
}
|
1036
1047
|
);
|
@@ -1044,7 +1055,7 @@ ActionBarPrimitiveStopSpeaking.displayName = "ActionBarPrimitive.StopSpeaking";
|
|
1044
1055
|
|
1045
1056
|
var ActionBarPrimitiveFeedbackPositive = _react.forwardRef.call(void 0, ({ onClick, disabled, ...props }, forwardedRef) => {
|
1046
1057
|
const isSubmitted = useMessage(
|
1047
|
-
(u) => _optionalChain([u, 'access',
|
1058
|
+
(u) => _optionalChain([u, 'access', _19 => _19.submittedFeedback, 'optionalAccess', _20 => _20.type]) === "positive"
|
1048
1059
|
);
|
1049
1060
|
const callback = useActionBarFeedbackPositive();
|
1050
1061
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
@@ -1056,7 +1067,7 @@ var ActionBarPrimitiveFeedbackPositive = _react.forwardRef.call(void 0, ({ onCli
|
|
1056
1067
|
ref: forwardedRef,
|
1057
1068
|
disabled: disabled || !callback,
|
1058
1069
|
onClick: _primitive.composeEventHandlers.call(void 0, onClick, () => {
|
1059
|
-
_optionalChain([callback, 'optionalCall',
|
1070
|
+
_optionalChain([callback, 'optionalCall', _21 => _21()]);
|
1060
1071
|
})
|
1061
1072
|
}
|
1062
1073
|
);
|
@@ -1070,7 +1081,7 @@ ActionBarPrimitiveFeedbackPositive.displayName = "ActionBarPrimitive.FeedbackPos
|
|
1070
1081
|
|
1071
1082
|
var ActionBarPrimitiveFeedbackNegative = _react.forwardRef.call(void 0, ({ onClick, disabled, ...props }, forwardedRef) => {
|
1072
1083
|
const isSubmitted = useMessage(
|
1073
|
-
(u) => _optionalChain([u, 'access',
|
1084
|
+
(u) => _optionalChain([u, 'access', _22 => _22.submittedFeedback, 'optionalAccess', _23 => _23.type]) === "negative"
|
1074
1085
|
);
|
1075
1086
|
const callback = useActionBarFeedbackNegative();
|
1076
1087
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
@@ -1082,7 +1093,7 @@ var ActionBarPrimitiveFeedbackNegative = _react.forwardRef.call(void 0, ({ onCli
|
|
1082
1093
|
ref: forwardedRef,
|
1083
1094
|
disabled: disabled || !callback,
|
1084
1095
|
onClick: _primitive.composeEventHandlers.call(void 0, onClick, () => {
|
1085
|
-
_optionalChain([callback, 'optionalCall',
|
1096
|
+
_optionalChain([callback, 'optionalCall', _24 => _24()]);
|
1086
1097
|
})
|
1087
1098
|
}
|
1088
1099
|
);
|
@@ -1240,7 +1251,7 @@ var AttachmentContext = _react.createContext.call(void 0,
|
|
1240
1251
|
);
|
1241
1252
|
function useAttachmentContext(options) {
|
1242
1253
|
const context = _react.useContext.call(void 0, AttachmentContext);
|
1243
|
-
if (!_optionalChain([options, 'optionalAccess',
|
1254
|
+
if (!_optionalChain([options, 'optionalAccess', _25 => _25.optional]) && !context)
|
1244
1255
|
throw new Error(
|
1245
1256
|
"This component must be used within a ComposerPrimitive.Attachments or MessagePrimitive.Attachments component."
|
1246
1257
|
);
|
@@ -1521,7 +1532,7 @@ var withSmoothContextProvider = (Component) => {
|
|
1521
1532
|
};
|
1522
1533
|
function useSmoothContext(options) {
|
1523
1534
|
const context = _react.useContext.call(void 0, SmoothContext);
|
1524
|
-
if (!_optionalChain([options, 'optionalAccess',
|
1535
|
+
if (!_optionalChain([options, 'optionalAccess', _26 => _26.optional]) && !context)
|
1525
1536
|
throw new Error(
|
1526
1537
|
"This component must be used within a SmoothContextProvider."
|
1527
1538
|
);
|
@@ -1742,7 +1753,7 @@ var BaseSubject = (_class2 = class {constructor() { _class2.prototype.__init5.ca
|
|
1742
1753
|
if (this._connection) return;
|
1743
1754
|
this._connection = this._connect();
|
1744
1755
|
} else {
|
1745
|
-
_optionalChain([this, 'access',
|
1756
|
+
_optionalChain([this, 'access', _27 => _27._connection, 'optionalCall', _28 => _28()]);
|
1746
1757
|
this._connection = void 0;
|
1747
1758
|
}
|
1748
1759
|
}
|
@@ -1847,36 +1858,36 @@ var EMPTY_ARRAY = Object.freeze([]);
|
|
1847
1858
|
var getThreadComposerState = (runtime) => {
|
1848
1859
|
return Object.freeze({
|
1849
1860
|
type: "thread",
|
1850
|
-
isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1851
|
-
canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1852
|
-
isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1853
|
-
text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1854
|
-
attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1855
|
-
value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1856
|
-
setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1857
|
-
setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1861
|
+
isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _29 => _29.isEditing]), () => ( false)),
|
1862
|
+
canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _30 => _30.canCancel]), () => ( false)),
|
1863
|
+
isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _31 => _31.isEmpty]), () => ( true)),
|
1864
|
+
text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _32 => _32.text]), () => ( "")),
|
1865
|
+
attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _33 => _33.attachments]), () => ( EMPTY_ARRAY)),
|
1866
|
+
value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _34 => _34.text]), () => ( "")),
|
1867
|
+
setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _35 => _35.setText, 'access', _36 => _36.bind, 'call', _37 => _37(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1868
|
+
setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _38 => _38.setText, 'access', _39 => _39.bind, 'call', _40 => _40(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1858
1869
|
// edit: beginEdit,
|
1859
|
-
send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1860
|
-
cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1861
|
-
reset: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1862
|
-
addAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1863
|
-
removeAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1870
|
+
send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _41 => _41.send, 'access', _42 => _42.bind, 'call', _43 => _43(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1871
|
+
cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _44 => _44.cancel, 'access', _45 => _45.bind, 'call', _46 => _46(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1872
|
+
reset: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _47 => _47.reset, 'access', _48 => _48.bind, 'call', _49 => _49(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1873
|
+
addAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _50 => _50.addAttachment, 'access', _51 => _51.bind, 'call', _52 => _52(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1874
|
+
removeAttachment: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _53 => _53.removeAttachment, 'access', _54 => _54.bind, 'call', _55 => _55(runtime)]), () => ( METHOD_NOT_SUPPORTED))
|
1864
1875
|
});
|
1865
1876
|
};
|
1866
1877
|
var getEditComposerState = (runtime, beginEdit) => {
|
1867
1878
|
return Object.freeze({
|
1868
1879
|
type: "edit",
|
1869
|
-
isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1870
|
-
canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1871
|
-
isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1872
|
-
text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1873
|
-
attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1874
|
-
value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1875
|
-
setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1876
|
-
setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1880
|
+
isEditing: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _56 => _56.isEditing]), () => ( false)),
|
1881
|
+
canCancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _57 => _57.canCancel]), () => ( false)),
|
1882
|
+
isEmpty: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _58 => _58.isEmpty]), () => ( true)),
|
1883
|
+
text: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _59 => _59.text]), () => ( "")),
|
1884
|
+
attachments: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _60 => _60.attachments]), () => ( EMPTY_ARRAY)),
|
1885
|
+
value: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _61 => _61.text]), () => ( "")),
|
1886
|
+
setValue: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _62 => _62.setText, 'access', _63 => _63.bind, 'call', _64 => _64(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1887
|
+
setText: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _65 => _65.setText, 'access', _66 => _66.bind, 'call', _67 => _67(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1877
1888
|
edit: beginEdit,
|
1878
|
-
send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1879
|
-
cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess',
|
1889
|
+
send: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _68 => _68.send, 'access', _69 => _69.bind, 'call', _70 => _70(runtime)]), () => ( METHOD_NOT_SUPPORTED)),
|
1890
|
+
cancel: _nullishCoalesce(_optionalChain([runtime, 'optionalAccess', _71 => _71.cancel, 'access', _72 => _72.bind, 'call', _73 => _73(runtime)]), () => ( METHOD_NOT_SUPPORTED))
|
1880
1891
|
});
|
1881
1892
|
};
|
1882
1893
|
var ComposerRuntimeImpl = class {
|
@@ -1992,7 +2003,7 @@ var ThreadComposerRuntimeImpl = class extends ComposerRuntimeImpl {
|
|
1992
2003
|
this._getState = stateBinding.getState.bind(stateBinding);
|
1993
2004
|
}
|
1994
2005
|
get attachments() {
|
1995
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
2006
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _74 => _74.getState, 'call', _75 => _75(), 'optionalAccess', _76 => _76.attachments]), () => ( EMPTY_ARRAY));
|
1996
2007
|
}
|
1997
2008
|
getState() {
|
1998
2009
|
return this._getState();
|
@@ -2102,19 +2113,19 @@ var NestedSubscriptionSubject = class extends BaseSubject {
|
|
2102
2113
|
this.notifySubscribers();
|
2103
2114
|
};
|
2104
2115
|
let lastState = this.binding.getState();
|
2105
|
-
let innerUnsubscribe = _optionalChain([lastState, 'optionalAccess',
|
2116
|
+
let innerUnsubscribe = _optionalChain([lastState, 'optionalAccess', _77 => _77.subscribe, 'call', _78 => _78(callback)]);
|
2106
2117
|
const onRuntimeUpdate = () => {
|
2107
2118
|
const newState = this.binding.getState();
|
2108
2119
|
if (newState === lastState) return;
|
2109
2120
|
lastState = newState;
|
2110
|
-
_optionalChain([innerUnsubscribe, 'optionalCall',
|
2111
|
-
innerUnsubscribe = _optionalChain([this, 'access',
|
2121
|
+
_optionalChain([innerUnsubscribe, 'optionalCall', _79 => _79()]);
|
2122
|
+
innerUnsubscribe = _optionalChain([this, 'access', _80 => _80.binding, 'access', _81 => _81.getState, 'call', _82 => _82(), 'optionalAccess', _83 => _83.subscribe, 'call', _84 => _84(callback)]);
|
2112
2123
|
callback();
|
2113
2124
|
};
|
2114
2125
|
const outerUnsubscribe = this.outerSubscribe(onRuntimeUpdate);
|
2115
2126
|
return () => {
|
2116
|
-
_optionalChain([outerUnsubscribe, 'optionalCall',
|
2117
|
-
_optionalChain([innerUnsubscribe, 'optionalCall',
|
2127
|
+
_optionalChain([outerUnsubscribe, 'optionalCall', _85 => _85()]);
|
2128
|
+
_optionalChain([innerUnsubscribe, 'optionalCall', _86 => _86()]);
|
2118
2129
|
};
|
2119
2130
|
}
|
2120
2131
|
};
|
@@ -2193,7 +2204,7 @@ var MessageRuntimeImpl = class {
|
|
2193
2204
|
const state = this._core.getState();
|
2194
2205
|
if (!state) throw new Error("Message is not available");
|
2195
2206
|
const thread = this._threadBinding.getState();
|
2196
|
-
if (_optionalChain([thread, 'access',
|
2207
|
+
if (_optionalChain([thread, 'access', _87 => _87.speech, 'optionalAccess', _88 => _88.messageId]) === state.id) {
|
2197
2208
|
this._threadBinding.getState().stopSpeaking();
|
2198
2209
|
} else {
|
2199
2210
|
throw new Error("Message is not being spoken");
|
@@ -2286,7 +2297,7 @@ var MessageRuntimeImpl = class {
|
|
2286
2297
|
},
|
2287
2298
|
getState: () => {
|
2288
2299
|
const attachments = this.getState().attachments;
|
2289
|
-
const attachment = _optionalChain([attachments, 'optionalAccess',
|
2300
|
+
const attachment = _optionalChain([attachments, 'optionalAccess', _89 => _89[idx]]);
|
2290
2301
|
if (!attachment) return SKIP_UPDATE;
|
2291
2302
|
return {
|
2292
2303
|
...attachment,
|
@@ -2369,7 +2380,7 @@ var MessageContentPartImpl = ({
|
|
2369
2380
|
};
|
2370
2381
|
var MessageContentPart = _react.memo.call(void 0,
|
2371
2382
|
MessageContentPartImpl,
|
2372
|
-
(prev, next) => prev.partIndex === next.partIndex && _optionalChain([prev, 'access',
|
2383
|
+
(prev, next) => prev.partIndex === next.partIndex && _optionalChain([prev, 'access', _90 => _90.components, 'optionalAccess', _91 => _91.Text]) === _optionalChain([next, 'access', _92 => _92.components, 'optionalAccess', _93 => _93.Text]) && _optionalChain([prev, 'access', _94 => _94.components, 'optionalAccess', _95 => _95.Image]) === _optionalChain([next, 'access', _96 => _96.components, 'optionalAccess', _97 => _97.Image]) && _optionalChain([prev, 'access', _98 => _98.components, 'optionalAccess', _99 => _99.UI]) === _optionalChain([next, 'access', _100 => _100.components, 'optionalAccess', _101 => _101.UI]) && _optionalChain([prev, 'access', _102 => _102.components, 'optionalAccess', _103 => _103.tools]) === _optionalChain([next, 'access', _104 => _104.components, 'optionalAccess', _105 => _105.tools])
|
2373
2384
|
);
|
2374
2385
|
var MessagePrimitiveContent = ({
|
2375
2386
|
components
|
@@ -2435,11 +2446,11 @@ var getComponent = (components, attachment) => {
|
|
2435
2446
|
const type = attachment.type;
|
2436
2447
|
switch (type) {
|
2437
2448
|
case "image":
|
2438
|
-
return _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
2449
|
+
return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _106 => _106.Image]), () => ( _optionalChain([components, 'optionalAccess', _107 => _107.Attachment])));
|
2439
2450
|
case "document":
|
2440
|
-
return _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
2451
|
+
return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _108 => _108.Document]), () => ( _optionalChain([components, 'optionalAccess', _109 => _109.Attachment])));
|
2441
2452
|
case "file":
|
2442
|
-
return _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
2453
|
+
return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _110 => _110.File]), () => ( _optionalChain([components, 'optionalAccess', _111 => _111.Attachment])));
|
2443
2454
|
default:
|
2444
2455
|
const _exhaustiveCheck = type;
|
2445
2456
|
throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
|
@@ -2462,7 +2473,7 @@ var MessageAttachmentImpl = ({ components, attachmentIndex }) => {
|
|
2462
2473
|
};
|
2463
2474
|
var MessageAttachment = _react.memo.call(void 0,
|
2464
2475
|
MessageAttachmentImpl,
|
2465
|
-
(prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access',
|
2476
|
+
(prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access', _112 => _112.components, 'optionalAccess', _113 => _113.Image]) === _optionalChain([next, 'access', _114 => _114.components, 'optionalAccess', _115 => _115.Image]) && _optionalChain([prev, 'access', _116 => _116.components, 'optionalAccess', _117 => _117.Document]) === _optionalChain([next, 'access', _118 => _118.components, 'optionalAccess', _119 => _119.Document]) && _optionalChain([prev, 'access', _120 => _120.components, 'optionalAccess', _121 => _121.File]) === _optionalChain([next, 'access', _122 => _122.components, 'optionalAccess', _123 => _123.File]) && _optionalChain([prev, 'access', _124 => _124.components, 'optionalAccess', _125 => _125.Attachment]) === _optionalChain([next, 'access', _126 => _126.components, 'optionalAccess', _127 => _127.Attachment])
|
2466
2477
|
);
|
2467
2478
|
var MessagePrimitiveAttachments = ({ components }) => {
|
2468
2479
|
const attachmentsCount = useMessage(({ message }) => {
|
@@ -2588,7 +2599,7 @@ var ComposerPrimitiveInput = _react.forwardRef.call(void 0,
|
|
2588
2599
|
const { isRunning } = threadRuntime.getState();
|
2589
2600
|
if (!isRunning) {
|
2590
2601
|
e.preventDefault();
|
2591
|
-
_optionalChain([textareaRef, 'access',
|
2602
|
+
_optionalChain([textareaRef, 'access', _128 => _128.current, 'optionalAccess', _129 => _129.closest, 'call', _130 => _130("form"), 'optionalAccess', _131 => _131.requestSubmit, 'call', _132 => _132()]);
|
2592
2603
|
}
|
2593
2604
|
}
|
2594
2605
|
};
|
@@ -2662,11 +2673,11 @@ var getComponent2 = (components, attachment) => {
|
|
2662
2673
|
const type = attachment.type;
|
2663
2674
|
switch (type) {
|
2664
2675
|
case "image":
|
2665
|
-
return _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
2676
|
+
return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _133 => _133.Image]), () => ( _optionalChain([components, 'optionalAccess', _134 => _134.Attachment])));
|
2666
2677
|
case "document":
|
2667
|
-
return _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
2678
|
+
return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _135 => _135.Document]), () => ( _optionalChain([components, 'optionalAccess', _136 => _136.Attachment])));
|
2668
2679
|
case "file":
|
2669
|
-
return _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
2680
|
+
return _nullishCoalesce(_optionalChain([components, 'optionalAccess', _137 => _137.File]), () => ( _optionalChain([components, 'optionalAccess', _138 => _138.Attachment])));
|
2670
2681
|
default:
|
2671
2682
|
const _exhaustiveCheck = type;
|
2672
2683
|
throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`);
|
@@ -2689,7 +2700,7 @@ var ComposerAttachmentImpl = ({ components, attachmentIndex }) => {
|
|
2689
2700
|
};
|
2690
2701
|
var ComposerAttachment = _react.memo.call(void 0,
|
2691
2702
|
ComposerAttachmentImpl,
|
2692
|
-
(prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access',
|
2703
|
+
(prev, next) => prev.attachmentIndex === next.attachmentIndex && _optionalChain([prev, 'access', _139 => _139.components, 'optionalAccess', _140 => _140.Image]) === _optionalChain([next, 'access', _141 => _141.components, 'optionalAccess', _142 => _142.Image]) && _optionalChain([prev, 'access', _143 => _143.components, 'optionalAccess', _144 => _144.Document]) === _optionalChain([next, 'access', _145 => _145.components, 'optionalAccess', _146 => _146.Document]) && _optionalChain([prev, 'access', _147 => _147.components, 'optionalAccess', _148 => _148.File]) === _optionalChain([next, 'access', _149 => _149.components, 'optionalAccess', _150 => _150.File]) && _optionalChain([prev, 'access', _151 => _151.components, 'optionalAccess', _152 => _152.Attachment]) === _optionalChain([next, 'access', _153 => _153.components, 'optionalAccess', _154 => _154.Attachment])
|
2693
2704
|
);
|
2694
2705
|
var ComposerPrimitiveAttachments = ({ components }) => {
|
2695
2706
|
const attachmentsCount = useComposer((s) => s.attachments.length);
|
@@ -3033,7 +3044,7 @@ var subscribeToMainThread = (runtime, callback) => {
|
|
3033
3044
|
let first = true;
|
3034
3045
|
let cleanup;
|
3035
3046
|
const inner = () => {
|
3036
|
-
_optionalChain([cleanup, 'optionalCall',
|
3047
|
+
_optionalChain([cleanup, 'optionalCall', _155 => _155()]);
|
3037
3048
|
cleanup = runtime.threadManager.mainThread.subscribe(callback);
|
3038
3049
|
if (!first) {
|
3039
3050
|
callback();
|
@@ -3044,7 +3055,7 @@ var subscribeToMainThread = (runtime, callback) => {
|
|
3044
3055
|
inner();
|
3045
3056
|
return () => {
|
3046
3057
|
unsubscribe();
|
3047
|
-
_optionalChain([cleanup, 'optionalCall',
|
3058
|
+
_optionalChain([cleanup, 'optionalCall', _156 => _156()]);
|
3048
3059
|
};
|
3049
3060
|
};
|
3050
3061
|
|
@@ -3059,13 +3070,13 @@ var ProxyConfigProvider = (_class5 = class {constructor() { _class5.prototype.__
|
|
3059
3070
|
}
|
3060
3071
|
registerModelConfigProvider(provider) {
|
3061
3072
|
this._providers.add(provider);
|
3062
|
-
const unsubscribe = _optionalChain([provider, 'access',
|
3073
|
+
const unsubscribe = _optionalChain([provider, 'access', _157 => _157.subscribe, 'optionalCall', _158 => _158(() => {
|
3063
3074
|
this.notifySubscribers();
|
3064
3075
|
})]);
|
3065
3076
|
this.notifySubscribers();
|
3066
3077
|
return () => {
|
3067
3078
|
this._providers.delete(provider);
|
3068
|
-
_optionalChain([unsubscribe, 'optionalCall',
|
3079
|
+
_optionalChain([unsubscribe, 'optionalCall', _159 => _159()]);
|
3069
3080
|
this.notifySubscribers();
|
3070
3081
|
};
|
3071
3082
|
}
|
@@ -3110,7 +3121,7 @@ var isAttachmentComplete = (a) => a.status.type === "complete";
|
|
3110
3121
|
var BaseComposerRuntimeCore = (_class7 = class {constructor() { _class7.prototype.__init12.call(this);_class7.prototype.__init13.call(this);_class7.prototype.__init14.call(this);_class7.prototype.__init15.call(this); }
|
3111
3122
|
__init12() {this.isEditing = true}
|
3112
3123
|
getAttachmentAccept() {
|
3113
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
3124
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _160 => _160.getAttachmentAdapter, 'call', _161 => _161(), 'optionalAccess', _162 => _162.accept]), () => ( "*"));
|
3114
3125
|
}
|
3115
3126
|
__init13() {this._attachments = []}
|
3116
3127
|
set attachments(value) {
|
@@ -3142,7 +3153,7 @@ var BaseComposerRuntimeCore = (_class7 = class {constructor() { _class7.prototyp
|
|
3142
3153
|
this.attachments.map(async (a) => {
|
3143
3154
|
if (isAttachmentComplete(a)) return a;
|
3144
3155
|
const result = await adapter.send(a);
|
3145
|
-
if (_optionalChain([result, 'access',
|
3156
|
+
if (_optionalChain([result, 'access', _163 => _163.status, 'optionalAccess', _164 => _164.type]) !== "complete") {
|
3146
3157
|
result.status = { type: "complete" };
|
3147
3158
|
}
|
3148
3159
|
return result;
|
@@ -3201,7 +3212,7 @@ var DefaultThreadComposerRuntimeCore = (_class8 = class extends BaseComposerRunt
|
|
3201
3212
|
return super.attachments;
|
3202
3213
|
}
|
3203
3214
|
getAttachmentAdapter() {
|
3204
|
-
return _optionalChain([this, 'access',
|
3215
|
+
return _optionalChain([this, 'access', _165 => _165.runtime, 'access', _166 => _166.adapters, 'optionalAccess', _167 => _167.attachments]);
|
3205
3216
|
}
|
3206
3217
|
connect() {
|
3207
3218
|
return this.runtime.subscribe(() => {
|
@@ -3214,7 +3225,7 @@ var DefaultThreadComposerRuntimeCore = (_class8 = class extends BaseComposerRunt
|
|
3214
3225
|
async handleSend(message) {
|
3215
3226
|
this.runtime.append({
|
3216
3227
|
...message,
|
3217
|
-
parentId: _nullishCoalesce(_optionalChain([this, 'access',
|
3228
|
+
parentId: _nullishCoalesce(_optionalChain([this, 'access', _168 => _168.runtime, 'access', _169 => _169.messages, 'access', _170 => _170.at, 'call', _171 => _171(-1), 'optionalAccess', _172 => _172.id]), () => ( null))
|
3218
3229
|
});
|
3219
3230
|
}
|
3220
3231
|
async cancel() {
|
@@ -3333,7 +3344,7 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
|
|
3333
3344
|
}
|
3334
3345
|
}
|
3335
3346
|
getMessages() {
|
3336
|
-
const messages2 = new Array(_nullishCoalesce(_optionalChain([this, 'access',
|
3347
|
+
const messages2 = new Array(_nullishCoalesce(_optionalChain([this, 'access', _173 => _173.head, 'optionalAccess', _174 => _174.level]), () => ( 0)));
|
3337
3348
|
for (let current = this.head; current; current = current.prev) {
|
3338
3349
|
messages2[current.level] = current.current;
|
3339
3350
|
}
|
@@ -3371,7 +3382,7 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
|
|
3371
3382
|
"MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui."
|
3372
3383
|
);
|
3373
3384
|
return {
|
3374
|
-
parentId: _nullishCoalesce(_optionalChain([message, 'access',
|
3385
|
+
parentId: _nullishCoalesce(_optionalChain([message, 'access', _175 => _175.prev, 'optionalAccess', _176 => _176.current, 'access', _177 => _177.id]), () => ( null)),
|
3375
3386
|
message: message.current
|
3376
3387
|
};
|
3377
3388
|
}
|
@@ -3455,11 +3466,11 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
|
|
3455
3466
|
for (const [, message] of this.messages) {
|
3456
3467
|
exportItems.push({
|
3457
3468
|
message: message.current,
|
3458
|
-
parentId: _nullishCoalesce(_optionalChain([message, 'access',
|
3469
|
+
parentId: _nullishCoalesce(_optionalChain([message, 'access', _178 => _178.prev, 'optionalAccess', _179 => _179.current, 'access', _180 => _180.id]), () => ( null))
|
3459
3470
|
});
|
3460
3471
|
}
|
3461
3472
|
return {
|
3462
|
-
headId: _nullishCoalesce(_optionalChain([this, 'access',
|
3473
|
+
headId: _nullishCoalesce(_optionalChain([this, 'access', _181 => _181.head, 'optionalAccess', _182 => _182.current, 'access', _183 => _183.id]), () => ( null)),
|
3463
3474
|
messages: exportItems
|
3464
3475
|
};
|
3465
3476
|
}
|
@@ -3467,7 +3478,7 @@ var MessageRepository = (_class9 = class {constructor() { _class9.prototype.__in
|
|
3467
3478
|
for (const { message, parentId } of messages2) {
|
3468
3479
|
this.addOrUpdateMessage(parentId, message);
|
3469
3480
|
}
|
3470
|
-
this.resetHead(_nullishCoalesce(_nullishCoalesce(headId, () => ( _optionalChain([messages2, 'access',
|
3481
|
+
this.resetHead(_nullishCoalesce(_nullishCoalesce(headId, () => ( _optionalChain([messages2, 'access', _184 => _184.at, 'call', _185 => _185(-1), 'optionalAccess', _186 => _186.message, 'access', _187 => _187.id]))), () => ( null)));
|
3471
3482
|
}
|
3472
3483
|
}, _class9);
|
3473
3484
|
|
@@ -3571,7 +3582,7 @@ TooltipIconButton.displayName = "TooltipIconButton";
|
|
3571
3582
|
var toAppendMessage = (messages2, message) => {
|
3572
3583
|
if (typeof message === "string") {
|
3573
3584
|
return {
|
3574
|
-
parentId: _nullishCoalesce(_optionalChain([messages2, 'access',
|
3585
|
+
parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _188 => _188.at, 'call', _189 => _189(-1), 'optionalAccess', _190 => _190.id]), () => ( null)),
|
3575
3586
|
role: "user",
|
3576
3587
|
content: [{ type: "text", text: message }],
|
3577
3588
|
attachments: []
|
@@ -3581,7 +3592,7 @@ var toAppendMessage = (messages2, message) => {
|
|
3581
3592
|
return message;
|
3582
3593
|
}
|
3583
3594
|
return {
|
3584
|
-
parentId: _nullishCoalesce(_nullishCoalesce(message.parentId, () => ( _optionalChain([messages2, 'access',
|
3595
|
+
parentId: _nullishCoalesce(_nullishCoalesce(message.parentId, () => ( _optionalChain([messages2, 'access', _191 => _191.at, 'call', _192 => _192(-1), 'optionalAccess', _193 => _193.id]))), () => ( null)),
|
3585
3596
|
role: _nullishCoalesce(message.role, () => ( "user")),
|
3586
3597
|
content: message.content,
|
3587
3598
|
attachments: _nullishCoalesce(message.attachments, () => ( []))
|
@@ -3593,7 +3604,7 @@ var getThreadState = (runtime) => {
|
|
3593
3604
|
threadId: runtime.threadId,
|
3594
3605
|
capabilities: runtime.capabilities,
|
3595
3606
|
isDisabled: runtime.isDisabled,
|
3596
|
-
isRunning: _optionalChain([lastMessage, 'optionalAccess',
|
3607
|
+
isRunning: _optionalChain([lastMessage, 'optionalAccess', _194 => _194.role]) !== "assistant" ? false : lastMessage.status.type === "running",
|
3597
3608
|
messages: runtime.messages,
|
3598
3609
|
suggestions: runtime.suggestions,
|
3599
3610
|
extras: runtime.extras,
|
@@ -3771,7 +3782,7 @@ var ThreadRuntimeImpl = (_class10 = class {
|
|
3771
3782
|
if (!message) return void 0;
|
3772
3783
|
return {
|
3773
3784
|
message,
|
3774
|
-
parentId: _nullishCoalesce(_optionalChain([messages2, 'access',
|
3785
|
+
parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _195 => _195[idx - 1], 'optionalAccess', _196 => _196.id]), () => ( null))
|
3775
3786
|
};
|
3776
3787
|
}
|
3777
3788
|
);
|
@@ -3800,12 +3811,12 @@ var ThreadRuntimeImpl = (_class10 = class {
|
|
3800
3811
|
return {
|
3801
3812
|
...message,
|
3802
3813
|
message,
|
3803
|
-
isLast: _optionalChain([messages2, 'access',
|
3814
|
+
isLast: _optionalChain([messages2, 'access', _197 => _197.at, 'call', _198 => _198(-1), 'optionalAccess', _199 => _199.id]) === message.id,
|
3804
3815
|
parentId,
|
3805
3816
|
branches,
|
3806
3817
|
branchNumber: branches.indexOf(message.id) + 1,
|
3807
3818
|
branchCount: branches.length,
|
3808
|
-
speech: _optionalChain([speechState, 'optionalAccess',
|
3819
|
+
speech: _optionalChain([speechState, 'optionalAccess', _200 => _200.messageId]) === message.id ? speechState : void 0,
|
3809
3820
|
submittedFeedback
|
3810
3821
|
};
|
3811
3822
|
},
|
@@ -3989,7 +4000,7 @@ var fromLanguageModelMessages = (lm, { mergeSteps }) => {
|
|
3989
4000
|
});
|
3990
4001
|
if (mergeSteps) {
|
3991
4002
|
const previousMessage = messages2[messages2.length - 1];
|
3992
|
-
if (_optionalChain([previousMessage, 'optionalAccess',
|
4003
|
+
if (_optionalChain([previousMessage, 'optionalAccess', _201 => _201.role]) === "assistant") {
|
3993
4004
|
previousMessage.content.push(...newContent);
|
3994
4005
|
break;
|
3995
4006
|
}
|
@@ -4002,7 +4013,7 @@ var fromLanguageModelMessages = (lm, { mergeSteps }) => {
|
|
4002
4013
|
}
|
4003
4014
|
case "tool": {
|
4004
4015
|
const previousMessage = messages2[messages2.length - 1];
|
4005
|
-
if (_optionalChain([previousMessage, 'optionalAccess',
|
4016
|
+
if (_optionalChain([previousMessage, 'optionalAccess', _202 => _202.role]) !== "assistant")
|
4006
4017
|
throw new Error(
|
4007
4018
|
"A tool message must be preceded by an assistant message."
|
4008
4019
|
);
|
@@ -4132,7 +4143,7 @@ function assistantDecoderStream() {
|
|
4132
4143
|
case "c" /* ToolCallDelta */: {
|
4133
4144
|
const { toolCallId, argsTextDelta } = value;
|
4134
4145
|
const toolName = toolCallNames.get(toolCallId);
|
4135
|
-
if (_optionalChain([currentToolCall, 'optionalAccess',
|
4146
|
+
if (_optionalChain([currentToolCall, 'optionalAccess', _203 => _203.id]) === toolCallId) {
|
4136
4147
|
currentToolCall.argsText += argsTextDelta;
|
4137
4148
|
}
|
4138
4149
|
controller.enqueue({
|
@@ -4276,7 +4287,7 @@ var useEdgeRuntime = (options) => {
|
|
4276
4287
|
};
|
4277
4288
|
|
4278
4289
|
// src/runtimes/local/shouldContinue.tsx
|
4279
|
-
var shouldContinue = (result) => _optionalChain([result, 'access',
|
4290
|
+
var shouldContinue = (result) => _optionalChain([result, 'access', _204 => _204.status, 'optionalAccess', _205 => _205.type]) === "requires-action" && result.status.reason === "tool-calls" && result.content.every((c) => c.type !== "tool-call" || !!c.result);
|
4280
4291
|
|
4281
4292
|
// src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx
|
4282
4293
|
var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
|
@@ -4296,7 +4307,7 @@ var DefaultEditComposerRuntimeCore = class extends BaseComposerRuntimeCore {
|
|
4296
4307
|
return true;
|
4297
4308
|
}
|
4298
4309
|
getAttachmentAdapter() {
|
4299
|
-
return _optionalChain([this, 'access',
|
4310
|
+
return _optionalChain([this, 'access', _206 => _206.runtime, 'access', _207 => _207.adapters, 'optionalAccess', _208 => _208.attachments]);
|
4300
4311
|
}
|
4301
4312
|
|
4302
4313
|
|
@@ -4377,7 +4388,7 @@ var BaseThreadRuntimeCore = (_class11 = class {
|
|
4377
4388
|
return this._submittedFeedback[messageId];
|
4378
4389
|
}
|
4379
4390
|
submitFeedback({ messageId, type }) {
|
4380
|
-
const adapter = _optionalChain([this, 'access',
|
4391
|
+
const adapter = _optionalChain([this, 'access', _209 => _209.adapters, 'optionalAccess', _210 => _210.feedback]);
|
4381
4392
|
if (!adapter) throw new Error("Feedback adapter not configured");
|
4382
4393
|
const { message } = this.repository.getMessage(messageId);
|
4383
4394
|
adapter.submit({ message, type });
|
@@ -4387,10 +4398,10 @@ var BaseThreadRuntimeCore = (_class11 = class {
|
|
4387
4398
|
|
4388
4399
|
|
4389
4400
|
speak(messageId) {
|
4390
|
-
const adapter = _optionalChain([this, 'access',
|
4401
|
+
const adapter = _optionalChain([this, 'access', _211 => _211.adapters, 'optionalAccess', _212 => _212.speech]);
|
4391
4402
|
if (!adapter) throw new Error("Speech adapter not configured");
|
4392
4403
|
const { message } = this.repository.getMessage(messageId);
|
4393
|
-
_optionalChain([this, 'access',
|
4404
|
+
_optionalChain([this, 'access', _213 => _213._stopSpeaking, 'optionalCall', _214 => _214()]);
|
4394
4405
|
const utterance = adapter.speak(getThreadMessageText(message));
|
4395
4406
|
const unsub = utterance.subscribe(() => {
|
4396
4407
|
if (utterance.status.type === "ended") {
|
@@ -4425,7 +4436,7 @@ var BaseThreadRuntimeCore = (_class11 = class {
|
|
4425
4436
|
__init26() {this._eventSubscribers = /* @__PURE__ */ new Map()}
|
4426
4437
|
unstable_on(event, callback) {
|
4427
4438
|
if (event === "model-config-update") {
|
4428
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
4439
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _215 => _215.configProvider, 'access', _216 => _216.subscribe, 'optionalCall', _217 => _217(callback)]), () => ( (() => {
|
4429
4440
|
})));
|
4430
4441
|
}
|
4431
4442
|
const subscribers = this._eventSubscribers.get(event);
|
@@ -4472,17 +4483,17 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
|
|
4472
4483
|
if (this._options === options) return;
|
4473
4484
|
this._options = options;
|
4474
4485
|
let hasUpdates = false;
|
4475
|
-
const canSpeak = _optionalChain([options, 'access',
|
4486
|
+
const canSpeak = _optionalChain([options, 'access', _218 => _218.adapters, 'optionalAccess', _219 => _219.speech]) !== void 0;
|
4476
4487
|
if (this.capabilities.speech !== canSpeak) {
|
4477
4488
|
this.capabilities.speech = canSpeak;
|
4478
4489
|
hasUpdates = true;
|
4479
4490
|
}
|
4480
|
-
const canAttach = _optionalChain([options, 'access',
|
4491
|
+
const canAttach = _optionalChain([options, 'access', _220 => _220.adapters, 'optionalAccess', _221 => _221.attachments]) !== void 0;
|
4481
4492
|
if (this.capabilities.attachments !== canAttach) {
|
4482
4493
|
this.capabilities.attachments = canAttach;
|
4483
4494
|
hasUpdates = true;
|
4484
4495
|
}
|
4485
|
-
const canFeedback = _optionalChain([options, 'access',
|
4496
|
+
const canFeedback = _optionalChain([options, 'access', _222 => _222.adapters, 'optionalAccess', _223 => _223.feedback]) !== void 0;
|
4486
4497
|
if (this.capabilities.feedback !== canFeedback) {
|
4487
4498
|
this.capabilities.feedback = canFeedback;
|
4488
4499
|
hasUpdates = true;
|
@@ -4518,13 +4529,13 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
|
|
4518
4529
|
}
|
4519
4530
|
async performRoundtrip(parentId, message) {
|
4520
4531
|
const messages2 = this.repository.getMessages();
|
4521
|
-
_optionalChain([this, 'access',
|
4532
|
+
_optionalChain([this, 'access', _224 => _224.abortController, 'optionalAccess', _225 => _225.abort, 'call', _226 => _226()]);
|
4522
4533
|
this.abortController = new AbortController();
|
4523
4534
|
const initialContent = message.content;
|
4524
|
-
const initialSteps = _optionalChain([message, 'access',
|
4525
|
-
const initalCustom = _optionalChain([message, 'access',
|
4535
|
+
const initialSteps = _optionalChain([message, 'access', _227 => _227.metadata, 'optionalAccess', _228 => _228.steps]);
|
4536
|
+
const initalCustom = _optionalChain([message, 'access', _229 => _229.metadata, 'optionalAccess', _230 => _230.custom]);
|
4526
4537
|
const updateMessage = (m) => {
|
4527
|
-
const newSteps = _optionalChain([m, 'access',
|
4538
|
+
const newSteps = _optionalChain([m, 'access', _231 => _231.metadata, 'optionalAccess', _232 => _232.steps]) || _optionalChain([m, 'access', _233 => _233.metadata, 'optionalAccess', _234 => _234.roundtrips]);
|
4528
4539
|
const steps2 = newSteps ? [..._nullishCoalesce(initialSteps, () => ( [])), ...newSteps] : void 0;
|
4529
4540
|
message = {
|
4530
4541
|
...message,
|
@@ -4536,7 +4547,7 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
|
|
4536
4547
|
metadata: {
|
4537
4548
|
...message.metadata,
|
4538
4549
|
...steps2 ? { roundtrips: steps2, steps: steps2 } : void 0,
|
4539
|
-
..._optionalChain([m, 'access',
|
4550
|
+
..._optionalChain([m, 'access', _235 => _235.metadata, 'optionalAccess', _236 => _236.custom]) ? {
|
4540
4551
|
custom: { ..._nullishCoalesce(initalCustom, () => ( {})), ...m.metadata.custom }
|
4541
4552
|
} : void 0
|
4542
4553
|
}
|
@@ -4546,7 +4557,7 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
|
|
4546
4557
|
this._notifySubscribers();
|
4547
4558
|
};
|
4548
4559
|
const maxSteps = this._options.maxSteps ? this._options.maxSteps : (_nullishCoalesce(this._options.maxToolRoundtrips, () => ( 1))) + 1;
|
4549
|
-
const steps = _nullishCoalesce(_optionalChain([message, 'access',
|
4560
|
+
const steps = _nullishCoalesce(_optionalChain([message, 'access', _237 => _237.metadata, 'optionalAccess', _238 => _238.steps, 'optionalAccess', _239 => _239.length]), () => ( 0));
|
4550
4561
|
if (steps >= maxSteps) {
|
4551
4562
|
updateMessage({
|
4552
4563
|
status: {
|
@@ -4598,7 +4609,7 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
|
|
4598
4609
|
return message;
|
4599
4610
|
}
|
4600
4611
|
cancelRun() {
|
4601
|
-
_optionalChain([this, 'access',
|
4612
|
+
_optionalChain([this, 'access', _240 => _240.abortController, 'optionalAccess', _241 => _241.abort, 'call', _242 => _242()]);
|
4602
4613
|
this.abortController = null;
|
4603
4614
|
}
|
4604
4615
|
addToolResult({
|
@@ -4640,7 +4651,14 @@ var LocalThreadRuntimeCore = (_class12 = class extends BaseThreadRuntimeCore {
|
|
4640
4651
|
var LocalThreadManagerRuntimeCore = (_class13 = class {
|
4641
4652
|
constructor(_threadFactory) {;_class13.prototype.__init31.call(this);_class13.prototype.__init32.call(this);_class13.prototype.__init33.call(this);_class13.prototype.__init34.call(this);
|
4642
4653
|
this._threadFactory = _threadFactory;
|
4643
|
-
|
4654
|
+
const threadId = generateId();
|
4655
|
+
this._threadData.set(threadId, {
|
4656
|
+
data: { messages: [] },
|
4657
|
+
metadata: { threadId },
|
4658
|
+
isArchived: false
|
4659
|
+
});
|
4660
|
+
this._threads = [{ threadId }];
|
4661
|
+
this._mainThread = this._threadFactory(threadId, { messages: [] });
|
4644
4662
|
}
|
4645
4663
|
__init31() {this._threadData = /* @__PURE__ */ new Map()}
|
4646
4664
|
__init32() {this._threads = []}
|
@@ -4663,17 +4681,21 @@ var LocalThreadManagerRuntimeCore = (_class13 = class {
|
|
4663
4681
|
this._performThreadSwitch(thread);
|
4664
4682
|
}
|
4665
4683
|
switchToNewThread() {
|
4666
|
-
|
4667
|
-
|
4684
|
+
const threadId = generateId();
|
4685
|
+
this._threadData.set(threadId, {
|
4686
|
+
data: { messages: [] },
|
4687
|
+
metadata: { threadId },
|
4688
|
+
isArchived: false
|
4689
|
+
});
|
4690
|
+
this._threads = [{ threadId }];
|
4691
|
+
const thread = this._threadFactory(threadId, { messages: [] });
|
4668
4692
|
this._performThreadSwitch(thread);
|
4669
4693
|
}
|
4670
4694
|
_performThreadSwitch(newThreadCore) {
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4674
|
-
|
4675
|
-
data.data = exprt;
|
4676
|
-
}
|
4695
|
+
const data = this._threadData.get(this._mainThread.threadId);
|
4696
|
+
if (!data) throw new Error("Thread not found");
|
4697
|
+
const exprt = this._mainThread.export();
|
4698
|
+
data.data = exprt;
|
4677
4699
|
this._mainThread._notifyEventSubscribers("switched-away");
|
4678
4700
|
this._mainThread = newThreadCore;
|
4679
4701
|
newThreadCore._notifyEventSubscribers("switched-to");
|
@@ -4746,7 +4768,7 @@ var getExportFromInitialMessages = (initialMessages) => {
|
|
4746
4768
|
const messages2 = fromCoreMessages(initialMessages);
|
4747
4769
|
return {
|
4748
4770
|
messages: messages2.map((m, idx) => ({
|
4749
|
-
parentId: _nullishCoalesce(_optionalChain([messages2, 'access',
|
4771
|
+
parentId: _nullishCoalesce(_optionalChain([messages2, 'access', _243 => _243[idx - 1], 'optionalAccess', _244 => _244.id]), () => ( null)),
|
4750
4772
|
message: m
|
4751
4773
|
}))
|
4752
4774
|
};
|
@@ -4857,7 +4879,7 @@ var ExternalStoreThreadManagerRuntimeCore = (_class14 = class {
|
|
4857
4879
|
this._notifySubscribers();
|
4858
4880
|
}
|
4859
4881
|
switchToThread(threadId) {
|
4860
|
-
if (_optionalChain([this, 'access',
|
4882
|
+
if (_optionalChain([this, 'access', _245 => _245._mainThread, 'optionalAccess', _246 => _246.threadId]) === threadId) return;
|
4861
4883
|
const onSwitchToThread = this.adapter.onSwitchToThread;
|
4862
4884
|
if (!onSwitchToThread)
|
4863
4885
|
throw new Error(
|
@@ -5012,7 +5034,7 @@ var fromThreadMessageLike = (like, fallbackId, fallbackStatus) => {
|
|
5012
5034
|
// src/runtimes/external-store/ExternalStoreThreadRuntimeCore.tsx
|
5013
5035
|
var EMPTY_ARRAY3 = Object.freeze([]);
|
5014
5036
|
var hasUpcomingMessage = (isRunning, messages2) => {
|
5015
|
-
return isRunning && _optionalChain([messages2, 'access',
|
5037
|
+
return isRunning && _optionalChain([messages2, 'access', _247 => _247[messages2.length - 1], 'optionalAccess', _248 => _248.role]) !== "assistant";
|
5016
5038
|
};
|
5017
5039
|
var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntimeCore {
|
5018
5040
|
__init37() {this.assistantOptimisticId = null}
|
@@ -5065,11 +5087,11 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5065
5087
|
edit: this._store.onEdit !== void 0,
|
5066
5088
|
reload: this._store.onReload !== void 0,
|
5067
5089
|
cancel: this._store.onCancel !== void 0,
|
5068
|
-
speech: _optionalChain([this, 'access',
|
5069
|
-
unstable_copy: _optionalChain([this, 'access',
|
5090
|
+
speech: _optionalChain([this, 'access', _252 => _252._store, 'access', _253 => _253.adapters, 'optionalAccess', _254 => _254.speech]) !== void 0,
|
5091
|
+
unstable_copy: _optionalChain([this, 'access', _255 => _255._store, 'access', _256 => _256.unstable_capabilities, 'optionalAccess', _257 => _257.copy]) !== false,
|
5070
5092
|
// default true
|
5071
|
-
attachments: !!_optionalChain([this, 'access',
|
5072
|
-
feedback: !!_optionalChain([this, 'access',
|
5093
|
+
attachments: !!_optionalChain([this, 'access', _258 => _258._store, 'access', _259 => _259.adapters, 'optionalAccess', _260 => _260.attachments]),
|
5094
|
+
feedback: !!_optionalChain([this, 'access', _261 => _261._store, 'access', _262 => _262.adapters, 'optionalAccess', _263 => _263.feedback])
|
5073
5095
|
};
|
5074
5096
|
if (oldStore) {
|
5075
5097
|
if (oldStore.convertMessage !== store.convertMessage) {
|
@@ -5096,7 +5118,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5096
5118
|
for (let i = 0; i < messages2.length; i++) {
|
5097
5119
|
const message = messages2[i];
|
5098
5120
|
const parent = messages2[i - 1];
|
5099
|
-
this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
5121
|
+
this.repository.addOrUpdateMessage(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _264 => _264.id]), () => ( null)), message);
|
5100
5122
|
}
|
5101
5123
|
if (this.assistantOptimisticId) {
|
5102
5124
|
this.repository.deleteMessage(this.assistantOptimisticId);
|
@@ -5104,7 +5126,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5104
5126
|
}
|
5105
5127
|
if (hasUpcomingMessage(isRunning, messages2)) {
|
5106
5128
|
this.assistantOptimisticId = this.repository.appendOptimisticMessage(
|
5107
|
-
_nullishCoalesce(_optionalChain([messages2, 'access',
|
5129
|
+
_nullishCoalesce(_optionalChain([messages2, 'access', _265 => _265.at, 'call', _266 => _266(-1), 'optionalAccess', _267 => _267.id]), () => ( null)),
|
5108
5130
|
{
|
5109
5131
|
role: "assistant",
|
5110
5132
|
content: []
|
@@ -5112,7 +5134,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5112
5134
|
);
|
5113
5135
|
}
|
5114
5136
|
this.repository.resetHead(
|
5115
|
-
_nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages2, 'access',
|
5137
|
+
_nullishCoalesce(_nullishCoalesce(this.assistantOptimisticId, () => ( _optionalChain([messages2, 'access', _268 => _268.at, 'call', _269 => _269(-1), 'optionalAccess', _270 => _270.id]))), () => ( null))
|
5116
5138
|
);
|
5117
5139
|
this._messages = this.repository.getMessages();
|
5118
5140
|
this._notifySubscribers();
|
@@ -5124,7 +5146,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5124
5146
|
this.updateMessages(this.repository.getMessages());
|
5125
5147
|
}
|
5126
5148
|
async append(message) {
|
5127
|
-
if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access',
|
5149
|
+
if (message.parentId !== (_nullishCoalesce(_optionalChain([this, 'access', _271 => _271.messages, 'access', _272 => _272.at, 'call', _273 => _273(-1), 'optionalAccess', _274 => _274.id]), () => ( null)))) {
|
5128
5150
|
if (!this._store.onEdit)
|
5129
5151
|
throw new Error("Runtime does not support editing messages.");
|
5130
5152
|
await this._store.onEdit(message);
|
@@ -5147,7 +5169,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5147
5169
|
}
|
5148
5170
|
let messages2 = this.repository.getMessages();
|
5149
5171
|
const previousMessage = messages2[messages2.length - 1];
|
5150
|
-
if (_optionalChain([previousMessage, 'optionalAccess',
|
5172
|
+
if (_optionalChain([previousMessage, 'optionalAccess', _275 => _275.role]) === "user" && previousMessage.id === _optionalChain([messages2, 'access', _276 => _276.at, 'call', _277 => _277(-1), 'optionalAccess', _278 => _278.id])) {
|
5151
5173
|
this.repository.deleteMessage(previousMessage.id);
|
5152
5174
|
if (!this.composer.text.trim()) {
|
5153
5175
|
this.composer.setText(getThreadMessageText(previousMessage));
|
@@ -5166,7 +5188,7 @@ var ExternalStoreThreadRuntimeCore = (_class16 = class extends BaseThreadRuntime
|
|
5166
5188
|
this._store.onAddToolResult(options);
|
5167
5189
|
}
|
5168
5190
|
__init42() {this.updateMessages = (messages2) => {
|
5169
|
-
_optionalChain([this, 'access',
|
5191
|
+
_optionalChain([this, 'access', _279 => _279._store, 'access', _280 => _280.setMessages, 'optionalCall', _281 => _281(
|
5170
5192
|
messages2.flatMap(getExternalStoreMessage).filter((m) => m != null)
|
5171
5193
|
)]);
|
5172
5194
|
}}
|
@@ -5178,7 +5200,7 @@ var getThreadManagerAdapter = (store) => {
|
|
5178
5200
|
threadId: store.threadId,
|
5179
5201
|
onSwitchToNewThread: store.onSwitchToNewThread,
|
5180
5202
|
onSwitchToThread: store.onSwitchToThread,
|
5181
|
-
..._optionalChain([store, 'access',
|
5203
|
+
..._optionalChain([store, 'access', _282 => _282.adapters, 'optionalAccess', _283 => _283.threadManager])
|
5182
5204
|
};
|
5183
5205
|
};
|
5184
5206
|
var ExternalStoreRuntimeCore = class extends BaseAssistantRuntimeCore {
|
@@ -5600,7 +5622,7 @@ var ThreadConfigProvider = ({
|
|
5600
5622
|
}) => {
|
5601
5623
|
const hasAssistant = !!useAssistantRuntime({ optional: true });
|
5602
5624
|
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 });
|
5603
|
-
if (!_optionalChain([config, 'optionalAccess',
|
5625
|
+
if (!_optionalChain([config, 'optionalAccess', _284 => _284.runtime])) return configProvider;
|
5604
5626
|
if (hasAssistant) {
|
5605
5627
|
throw new Error(
|
5606
5628
|
"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed."
|
@@ -5928,7 +5950,7 @@ var AssistantMessageContent = _react.forwardRef.call(void 0, ({ components: comp
|
|
5928
5950
|
{
|
5929
5951
|
components: {
|
5930
5952
|
...componentsProp,
|
5931
|
-
Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess',
|
5953
|
+
Text: _nullishCoalesce(_nullishCoalesce(_optionalChain([componentsProp, 'optionalAccess', _285 => _285.Text]), () => ( components.Text)), () => ( content_part_default.Text)),
|
5932
5954
|
tools: toolsComponents
|
5933
5955
|
}
|
5934
5956
|
}
|
@@ -6039,7 +6061,7 @@ var useAttachmentSrc = () => {
|
|
6039
6061
|
const { file, src } = useAttachment((a) => {
|
6040
6062
|
if (a.type !== "image") return {};
|
6041
6063
|
if (a.file) return { file: a.file };
|
6042
|
-
const src2 = _optionalChain([a, 'access',
|
6064
|
+
const src2 = _optionalChain([a, 'access', _286 => _286.content, 'optionalAccess', _287 => _287.filter, 'call', _288 => _288((c) => c.type === "image"), 'access', _289 => _289[0], 'optionalAccess', _290 => _290.image]);
|
6043
6065
|
if (!src2) return {};
|
6044
6066
|
return { src: src2 };
|
6045
6067
|
});
|
@@ -6183,7 +6205,7 @@ var ComposerAttachments = ({ components }) => {
|
|
6183
6205
|
{
|
6184
6206
|
components: {
|
6185
6207
|
...components,
|
6186
|
-
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6208
|
+
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _291 => _291.Attachment]), () => ( attachment_default))
|
6187
6209
|
}
|
6188
6210
|
}
|
6189
6211
|
) });
|
@@ -6316,7 +6338,7 @@ var ThreadWelcomeSuggestions = () => {
|
|
6316
6338
|
const suggestions2 = useThread((t) => t.suggestions);
|
6317
6339
|
const { welcome: { suggestions } = {} } = useThreadConfig();
|
6318
6340
|
const finalSuggestions = suggestions2.length ? suggestions2 : suggestions;
|
6319
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([finalSuggestions, 'optionalAccess',
|
6341
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestionContainer, { children: _optionalChain([finalSuggestions, 'optionalAccess', _292 => _292.map, 'call', _293 => _293((suggestion, idx) => {
|
6320
6342
|
const key = `${suggestion.prompt}-${idx}`;
|
6321
6343
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadWelcomeSuggestion, { suggestion }, key);
|
6322
6344
|
})]) });
|
@@ -6394,7 +6416,7 @@ var UserMessageContent = _react.forwardRef.call(void 0, ({ components, ...props
|
|
6394
6416
|
{
|
6395
6417
|
components: {
|
6396
6418
|
...components,
|
6397
|
-
Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6419
|
+
Text: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _294 => _294.Text]), () => ( content_part_default.Text))
|
6398
6420
|
}
|
6399
6421
|
}
|
6400
6422
|
) });
|
@@ -6411,7 +6433,7 @@ var UserMessageAttachments = ({
|
|
6411
6433
|
{
|
6412
6434
|
components: {
|
6413
6435
|
...components,
|
6414
|
-
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6436
|
+
Attachment: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _295 => _295.Attachment]), () => ( attachment_default))
|
6415
6437
|
}
|
6416
6438
|
}
|
6417
6439
|
) }) });
|
@@ -6514,10 +6536,10 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
|
|
6514
6536
|
thread_exports.Messages,
|
6515
6537
|
{
|
6516
6538
|
components: {
|
6517
|
-
UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6518
|
-
EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6519
|
-
AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6520
|
-
SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess',
|
6539
|
+
UserMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _296 => _296.UserMessage]), () => ( user_message_default)),
|
6540
|
+
EditComposer: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _297 => _297.EditComposer]), () => ( edit_composer_default)),
|
6541
|
+
AssistantMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _298 => _298.AssistantMessage]), () => ( assistant_message_default)),
|
6542
|
+
SystemMessage: _nullishCoalesce(_optionalChain([components, 'optionalAccess', _299 => _299.SystemMessage]), () => ( SystemMessage))
|
6521
6543
|
},
|
6522
6544
|
...rest
|
6523
6545
|
}
|
@@ -6528,7 +6550,7 @@ var ThreadMessages = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ..
|
|
6528
6550
|
ThreadMessages.displayName = "ThreadMessages";
|
6529
6551
|
var ThreadFollowupSuggestions = () => {
|
6530
6552
|
const suggestions = useThread((t) => t.suggestions);
|
6531
|
-
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',
|
6553
|
+
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', _300 => _300.map, 'call', _301 => _301((suggestion, idx) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
6532
6554
|
thread_exports.Suggestion,
|
6533
6555
|
{
|
6534
6556
|
className: "aui-thread-followup-suggestion",
|
@@ -6763,5 +6785,6 @@ var assistant_modal_default = Object.assign(AssistantModal, exports12);
|
|
6763
6785
|
|
6764
6786
|
|
6765
6787
|
|
6766
|
-
|
6788
|
+
|
6789
|
+
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 = _chunkC6UZOY5Ajs.toCoreMessage; exports.toCoreMessages = _chunkC6UZOY5Ajs.toCoreMessages; exports.toLanguageModelMessages = _chunkC6UZOY5Ajs.toLanguageModelMessages; exports.toLanguageModelTools = _chunkC6UZOY5Ajs.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.useInlineRender = useInlineRender; 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.useThreadManager = useThreadManager; exports.useThreadMessages = useThreadMessages; exports.useThreadMessagesStore = useThreadMessagesStore; exports.useThreadModelConfig = useThreadModelConfig; 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;
|
6767
6790
|
//# sourceMappingURL=index.js.map
|