@superinterface/react 5.3.1-beta.6 → 5.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +183 -284
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +219 -320
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +131 -14
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +131 -14
- package/dist/server.js.map +1 -1
- package/dist/utils.cjs +3 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +3 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36894,19 +36894,14 @@ var require_lib4 = __commonJS({
|
|
|
36894
36894
|
}
|
|
36895
36895
|
});
|
|
36896
36896
|
// src/components/core/SuperinterfaceProvider/index.tsx
|
|
36897
|
-
import { useRef
|
|
36897
|
+
import { useRef } from "react";
|
|
36898
36898
|
// src/lib/misc/merge/index.ts
|
|
36899
36899
|
import _2 from "lodash";
|
|
36900
36900
|
// src/lib/misc/merge/customizer.ts
|
|
36901
36901
|
import _ from "lodash";
|
|
36902
|
-
var customizer = function(objectValue, srcValue
|
|
36903
|
-
if (_.isArray(objectValue))
|
|
36904
|
-
|
|
36905
|
-
}
|
|
36906
|
-
if (srcValue && (typeof srcValue === "undefined" ? "undefined" : _type_of(srcValue)) === "object" && "current" in srcValue && typeof key2 === "string" && key2.toLowerCase().includes("ref")) {
|
|
36907
|
-
return srcValue;
|
|
36908
|
-
}
|
|
36909
|
-
return void 0;
|
|
36902
|
+
var customizer = function(objectValue, srcValue) {
|
|
36903
|
+
if (!_.isArray(objectValue)) return;
|
|
36904
|
+
return srcValue;
|
|
36910
36905
|
};
|
|
36911
36906
|
// src/lib/misc/merge/index.ts
|
|
36912
36907
|
var merge = function merge2(obj) {
|
|
@@ -36945,7 +36940,9 @@ var set = function(_ref) {
|
|
|
36945
36940
|
var assistantId = _ref.assistantId, threadId = _ref.threadId;
|
|
36946
36941
|
return Cookies2.set(key({
|
|
36947
36942
|
assistantId: assistantId
|
|
36948
|
-
}), threadId
|
|
36943
|
+
}), threadId, {
|
|
36944
|
+
expires: 365
|
|
36945
|
+
});
|
|
36949
36946
|
};
|
|
36950
36947
|
// src/lib/threadIdStorage/cookieOptions/remove.ts
|
|
36951
36948
|
import Cookies3 from "js-cookie";
|
|
@@ -37060,26 +37057,17 @@ var SuperinterfaceProvider = function(_ref) {
|
|
|
37060
37057
|
var children = _ref.children, baseUrl2 = _ref.baseUrl, variables = _ref.variables, defaultOptions = _ref.defaultOptions, threadIdStorageOptions = _ref.threadIdStorageOptions;
|
|
37061
37058
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
37062
37059
|
var createMessageAbortControllerRef = useRef(null);
|
|
37063
|
-
var value =
|
|
37064
|
-
|
|
37065
|
-
|
|
37066
|
-
|
|
37067
|
-
|
|
37068
|
-
|
|
37069
|
-
|
|
37070
|
-
|
|
37071
|
-
|
|
37072
|
-
|
|
37073
|
-
|
|
37074
|
-
}));
|
|
37075
|
-
}, [
|
|
37076
|
-
superinterfaceContext,
|
|
37077
|
-
baseUrl2,
|
|
37078
|
-
variables,
|
|
37079
|
-
defaultOptions,
|
|
37080
|
-
threadIdStorageOptions,
|
|
37081
|
-
createMessageAbortControllerRef
|
|
37082
|
-
]);
|
|
37060
|
+
var value = merge(superinterfaceContext, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, baseUrl2 ? {
|
|
37061
|
+
baseUrl: baseUrl2
|
|
37062
|
+
} : {}), variables ? {
|
|
37063
|
+
variables: variables
|
|
37064
|
+
} : {}), defaultOptions ? {
|
|
37065
|
+
defaultOptions: defaultOptions
|
|
37066
|
+
} : {}), threadIdStorageOptions ? {
|
|
37067
|
+
threadIdStorageOptions: threadIdStorageOptions
|
|
37068
|
+
} : {}), {}, {
|
|
37069
|
+
createMessageAbortControllerRef: createMessageAbortControllerRef
|
|
37070
|
+
}));
|
|
37083
37071
|
return /* @__PURE__ */ _jsx(SuperinterfaceContext.Provider, {
|
|
37084
37072
|
value: value,
|
|
37085
37073
|
children: children
|
|
@@ -37092,7 +37080,7 @@ import { c as _c66 } from "react-compiler-runtime";
|
|
|
37092
37080
|
import { Flex as Flex18 } from "@radix-ui/themes";
|
|
37093
37081
|
// src/components/threads/Thread/Message/index.tsx
|
|
37094
37082
|
import { c as _c60 } from "react-compiler-runtime";
|
|
37095
|
-
import { useMemo as
|
|
37083
|
+
import { useMemo as useMemo10 } from "react";
|
|
37096
37084
|
import { Box as Box12 } from "@radix-ui/themes";
|
|
37097
37085
|
// src/components/runSteps/RunSteps/index.tsx
|
|
37098
37086
|
import { c as _c56 } from "react-compiler-runtime";
|
|
@@ -37545,7 +37533,7 @@ var ToolCallIcon = function(t0) {
|
|
|
37545
37533
|
};
|
|
37546
37534
|
// src/components/functions/FunctionBase/Content/index.tsx
|
|
37547
37535
|
import { c as _c12 } from "react-compiler-runtime";
|
|
37548
|
-
import { useMemo
|
|
37536
|
+
import { useMemo } from "react";
|
|
37549
37537
|
import { Code, Box } from "@radix-ui/themes";
|
|
37550
37538
|
// src/components/functions/FunctionBase/Content/lib/formattedJsonOrRaw.ts
|
|
37551
37539
|
var formattedJsonOrRaw = function(_ref) {
|
|
@@ -37990,7 +37978,7 @@ var FallbackToolCall = function(t0) {
|
|
|
37990
37978
|
};
|
|
37991
37979
|
// src/components/contents/TextContent.tsx
|
|
37992
37980
|
import { c as _c43 } from "react-compiler-runtime";
|
|
37993
|
-
import React, { useState as useState3, useEffect as useEffect2, useMemo as
|
|
37981
|
+
import React, { useState as useState3, useEffect as useEffect2, useMemo as useMemo9 } from "react";
|
|
37994
37982
|
import { Badge } from "@radix-ui/themes";
|
|
37995
37983
|
import { compile } from "@mdx-js/mdx";
|
|
37996
37984
|
import { MDXProvider, useMDXComponents } from "@mdx-js/react";
|
|
@@ -38212,7 +38200,8 @@ var UnorderedList = function(t0) {
|
|
|
38212
38200
|
var t1;
|
|
38213
38201
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38214
38202
|
t1 = {
|
|
38215
|
-
listStylePosition: "
|
|
38203
|
+
listStylePosition: "outside",
|
|
38204
|
+
listStyleType: "disc"
|
|
38216
38205
|
};
|
|
38217
38206
|
$[0] = t1;
|
|
38218
38207
|
} else {
|
|
@@ -38222,6 +38211,7 @@ var UnorderedList = function(t0) {
|
|
|
38222
38211
|
if ($[1] !== children) {
|
|
38223
38212
|
t22 = /* @__PURE__ */ _jsx21(Box4, {
|
|
38224
38213
|
pb: "3",
|
|
38214
|
+
pl: "5",
|
|
38225
38215
|
asChild: true,
|
|
38226
38216
|
children: /* @__PURE__ */ _jsx21("ul", {
|
|
38227
38217
|
style: t1,
|
|
@@ -38245,7 +38235,8 @@ var OrderedList = function(t0) {
|
|
|
38245
38235
|
var t1;
|
|
38246
38236
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38247
38237
|
t1 = {
|
|
38248
|
-
listStylePosition: "
|
|
38238
|
+
listStylePosition: "outside",
|
|
38239
|
+
listStyleType: "decimal"
|
|
38249
38240
|
};
|
|
38250
38241
|
$[0] = t1;
|
|
38251
38242
|
} else {
|
|
@@ -38255,6 +38246,7 @@ var OrderedList = function(t0) {
|
|
|
38255
38246
|
if ($[1] !== children) {
|
|
38256
38247
|
t22 = /* @__PURE__ */ _jsx22(Box5, {
|
|
38257
38248
|
pb: "3",
|
|
38249
|
+
pl: "5",
|
|
38258
38250
|
asChild: true,
|
|
38259
38251
|
children: /* @__PURE__ */ _jsx22("ol", {
|
|
38260
38252
|
style: t1,
|
|
@@ -38278,6 +38270,7 @@ var ListItem = function(t0) {
|
|
|
38278
38270
|
var t1;
|
|
38279
38271
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38280
38272
|
t1 = {
|
|
38273
|
+
display: "list-item",
|
|
38281
38274
|
wordBreak: "break-word"
|
|
38282
38275
|
};
|
|
38283
38276
|
$[0] = t1;
|
|
@@ -38288,6 +38281,7 @@ var ListItem = function(t0) {
|
|
|
38288
38281
|
if ($[1] !== children) {
|
|
38289
38282
|
t22 = /* @__PURE__ */ _jsx23(Box6, {
|
|
38290
38283
|
pb: "1",
|
|
38284
|
+
asChild: true,
|
|
38291
38285
|
children: /* @__PURE__ */ _jsx23("li", {
|
|
38292
38286
|
style: t1,
|
|
38293
38287
|
children: children
|
|
@@ -38354,13 +38348,13 @@ import { c as _c30 } from "react-compiler-runtime";
|
|
|
38354
38348
|
import { Code as RadixCode } from "@radix-ui/themes";
|
|
38355
38349
|
// src/components/suggestions/Suggestions/index.tsx
|
|
38356
38350
|
import { c as _c29 } from "react-compiler-runtime";
|
|
38357
|
-
import { useMemo as
|
|
38351
|
+
import { useMemo as useMemo6 } from "react";
|
|
38358
38352
|
// src/hooks/messages/useLatestMessage/index.ts
|
|
38359
38353
|
import { c as _c26 } from "react-compiler-runtime";
|
|
38360
|
-
import { useMemo as
|
|
38354
|
+
import { useMemo as useMemo3 } from "react";
|
|
38361
38355
|
// src/hooks/messages/useMessages/index.tsx
|
|
38362
38356
|
import { c as _c25 } from "react-compiler-runtime";
|
|
38363
|
-
import { useMemo as
|
|
38357
|
+
import { useMemo as useMemo2 } from "react";
|
|
38364
38358
|
import { useInfiniteQuery, useQueryClient } from "@tanstack/react-query";
|
|
38365
38359
|
// src/lib/threads/queryOptions/index.ts
|
|
38366
38360
|
import { infiniteQueryOptions } from "@tanstack/react-query";
|
|
@@ -38741,12 +38735,12 @@ var useLatestMessage = function() {
|
|
|
38741
38735
|
return t0;
|
|
38742
38736
|
};
|
|
38743
38737
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
38744
|
-
import { useMemo as
|
|
38738
|
+
import { useMemo as useMemo5 } from "react";
|
|
38745
38739
|
import { isEmpty } from "radash";
|
|
38746
38740
|
import { onlyText } from "react-children-utilities";
|
|
38747
38741
|
// src/hooks/messages/useIsMutatingMessage/index.ts
|
|
38748
38742
|
import { c as _c27 } from "react-compiler-runtime";
|
|
38749
|
-
import { useMemo as
|
|
38743
|
+
import { useMemo as useMemo4 } from "react";
|
|
38750
38744
|
import { useIsMutating } from "@tanstack/react-query";
|
|
38751
38745
|
var useIsMutatingMessage = function() {
|
|
38752
38746
|
var $ = _c27(2);
|
|
@@ -38777,7 +38771,7 @@ import { c as _c28 } from "react-compiler-runtime";
|
|
|
38777
38771
|
import { ArrowUpIcon } from "@radix-ui/react-icons";
|
|
38778
38772
|
import { Text as Text4, Button as Button2, Spinner } from "@radix-ui/themes";
|
|
38779
38773
|
// src/hooks/messages/useCreateMessage/index.ts
|
|
38780
|
-
import { useCallback
|
|
38774
|
+
import { useCallback } from "react";
|
|
38781
38775
|
import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
38782
38776
|
// src/hooks/messages/useCreateMessage/lib/mutationOptions/onMutate/index.ts
|
|
38783
38777
|
import { omit } from "radash";
|
|
@@ -40052,14 +40046,6 @@ var mutationFn = function(_ref) {
|
|
|
40052
40046
|
case 0:
|
|
40053
40047
|
abortController = new AbortController();
|
|
40054
40048
|
superinterfaceContext.createMessageAbortControllerRef.current = abortController;
|
|
40055
|
-
_state.label = 1;
|
|
40056
|
-
case 1:
|
|
40057
|
-
_state.trys.push([
|
|
40058
|
-
1,
|
|
40059
|
-
,
|
|
40060
|
-
10,
|
|
40061
|
-
11
|
|
40062
|
-
]);
|
|
40063
40049
|
return [
|
|
40064
40050
|
4,
|
|
40065
40051
|
fetch("".concat(superinterfaceContext.baseUrl, "/messages"), {
|
|
@@ -40071,31 +40057,31 @@ var mutationFn = function(_ref) {
|
|
|
40071
40057
|
signal: abortController.signal
|
|
40072
40058
|
})
|
|
40073
40059
|
];
|
|
40074
|
-
case
|
|
40060
|
+
case 1:
|
|
40075
40061
|
response = _state.sent();
|
|
40076
40062
|
if (!(response.status !== 200)) return [
|
|
40077
40063
|
3,
|
|
40078
|
-
|
|
40064
|
+
5
|
|
40079
40065
|
];
|
|
40080
|
-
_state.label =
|
|
40081
|
-
case
|
|
40066
|
+
_state.label = 2;
|
|
40067
|
+
case 2:
|
|
40082
40068
|
_state.trys.push([
|
|
40083
|
-
|
|
40084
|
-
|
|
40069
|
+
2,
|
|
40070
|
+
4,
|
|
40085
40071
|
,
|
|
40086
|
-
|
|
40072
|
+
5
|
|
40087
40073
|
]);
|
|
40088
40074
|
return [
|
|
40089
40075
|
4,
|
|
40090
40076
|
response.json()
|
|
40091
40077
|
];
|
|
40092
|
-
case
|
|
40078
|
+
case 3:
|
|
40093
40079
|
errorResponse = _state.sent();
|
|
40094
40080
|
throw new Error(errorResponse.error);
|
|
40095
|
-
case
|
|
40081
|
+
case 4:
|
|
40096
40082
|
error = _state.sent();
|
|
40097
40083
|
throw new Error("Failed to send your message, try again. If you are the owner, check the logs.");
|
|
40098
|
-
case
|
|
40084
|
+
case 5:
|
|
40099
40085
|
if (response.body == null) {
|
|
40100
40086
|
throw new Error("The response body is empty.");
|
|
40101
40087
|
}
|
|
@@ -40111,21 +40097,21 @@ var mutationFn = function(_ref) {
|
|
|
40111
40097
|
"messages",
|
|
40112
40098
|
threadContext.variables
|
|
40113
40099
|
];
|
|
40114
|
-
_state.label =
|
|
40115
|
-
case
|
|
40100
|
+
_state.label = 6;
|
|
40101
|
+
case 6:
|
|
40116
40102
|
if (!true) return [
|
|
40117
40103
|
3,
|
|
40118
|
-
|
|
40104
|
+
8
|
|
40119
40105
|
];
|
|
40120
40106
|
return [
|
|
40121
40107
|
4,
|
|
40122
40108
|
reader.read()
|
|
40123
40109
|
];
|
|
40124
|
-
case
|
|
40110
|
+
case 7:
|
|
40125
40111
|
_$_ref = _state.sent(), done = _$_ref.done, value = _$_ref.value;
|
|
40126
40112
|
if (done) return [
|
|
40127
40113
|
3,
|
|
40128
|
-
|
|
40114
|
+
8
|
|
40129
40115
|
];
|
|
40130
40116
|
handleResponse({
|
|
40131
40117
|
value: value,
|
|
@@ -40135,19 +40121,9 @@ var mutationFn = function(_ref) {
|
|
|
40135
40121
|
});
|
|
40136
40122
|
return [
|
|
40137
40123
|
3,
|
|
40138
|
-
|
|
40139
|
-
];
|
|
40140
|
-
case 9:
|
|
40141
|
-
return [
|
|
40142
|
-
3,
|
|
40143
|
-
11
|
|
40144
|
-
];
|
|
40145
|
-
case 10:
|
|
40146
|
-
superinterfaceContext.createMessageAbortControllerRef.current = null;
|
|
40147
|
-
return [
|
|
40148
|
-
7
|
|
40124
|
+
6
|
|
40149
40125
|
];
|
|
40150
|
-
case
|
|
40126
|
+
case 8:
|
|
40151
40127
|
return [
|
|
40152
40128
|
2
|
|
40153
40129
|
];
|
|
@@ -40274,20 +40250,12 @@ var useCreateMessage = function useCreateMessage2() {
|
|
|
40274
40250
|
var queryClient = useQueryClient2();
|
|
40275
40251
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
40276
40252
|
var threadContext = useSuperinterfaceContext();
|
|
40277
|
-
var
|
|
40278
|
-
|
|
40279
|
-
|
|
40280
|
-
|
|
40281
|
-
|
|
40282
|
-
|
|
40283
|
-
});
|
|
40284
|
-
}, [
|
|
40285
|
-
queryClient,
|
|
40286
|
-
threadContext,
|
|
40287
|
-
superinterfaceContext,
|
|
40288
|
-
onError
|
|
40289
|
-
]);
|
|
40290
|
-
var props = useMutation(options);
|
|
40253
|
+
var props = useMutation(mutationOptions({
|
|
40254
|
+
queryClient: queryClient,
|
|
40255
|
+
threadContext: threadContext,
|
|
40256
|
+
superinterfaceContext: superinterfaceContext,
|
|
40257
|
+
onError: onError
|
|
40258
|
+
}));
|
|
40291
40259
|
var createMessage = useCallback(function(variables) {
|
|
40292
40260
|
return props.mutateAsync(_objectSpread19(_objectSpread19({}, threadContext.variables), variables));
|
|
40293
40261
|
}, [
|
|
@@ -40536,7 +40504,7 @@ import { jsx as _jsx27 } from "react/jsx-runtime";
|
|
|
40536
40504
|
var Content4 = function(_ref) {
|
|
40537
40505
|
var children = _ref.children, className = _ref.className, style = _ref.style;
|
|
40538
40506
|
var isMutatingMessage = useIsMutatingMessage();
|
|
40539
|
-
var suggestions =
|
|
40507
|
+
var suggestions = useMemo5(function() {
|
|
40540
40508
|
return onlyText(children).split(/\r?\n/).filter(function(c2) {
|
|
40541
40509
|
return !isEmpty(c2);
|
|
40542
40510
|
}).map(function(c_0) {
|
|
@@ -40873,7 +40841,7 @@ var VolumeButton = function() {
|
|
|
40873
40841
|
};
|
|
40874
40842
|
// src/components/media/Time.tsx
|
|
40875
40843
|
import { c as _c34 } from "react-compiler-runtime";
|
|
40876
|
-
import { useState, useEffect, useMemo as
|
|
40844
|
+
import { useState, useEffect, useMemo as useMemo7 } from "react";
|
|
40877
40845
|
import { useMediaState as useMediaState3, useMediaRemote as useMediaRemote2 } from "@vidstack/react";
|
|
40878
40846
|
import { Slider as Slider2 } from "@radix-ui/themes";
|
|
40879
40847
|
import { jsx as _jsx33 } from "react/jsx-runtime";
|
|
@@ -41978,7 +41946,7 @@ var escapeInvalidTagNames = function(markdown) {
|
|
|
41978
41946
|
});
|
|
41979
41947
|
};
|
|
41980
41948
|
// ../../node_modules/react-error-boundary/dist/react-error-boundary.esm.js
|
|
41981
|
-
import { createContext as createContext5, Component, createElement, useContext as useContext9, useState as useState2, useMemo as
|
|
41949
|
+
import { createContext as createContext5, Component, createElement, useContext as useContext9, useState as useState2, useMemo as useMemo8, forwardRef } from "react";
|
|
41982
41950
|
var ErrorBoundaryContext = /* @__PURE__ */ createContext5(null);
|
|
41983
41951
|
var initialState = {
|
|
41984
41952
|
didCatch: false,
|
|
@@ -43175,160 +43143,97 @@ function _temp2(content2, index4) {
|
|
|
43175
43143
|
content: content2
|
|
43176
43144
|
}, index4);
|
|
43177
43145
|
}
|
|
43146
|
+
// src/components/threads/Thread/Message/lib/splitRunSteps.ts
|
|
43147
|
+
var splitRunSteps = function(_ref) {
|
|
43148
|
+
var messageId = _ref.messageId, runSteps = _ref.runSteps;
|
|
43149
|
+
if (!runSteps.length) return [
|
|
43150
|
+
[],
|
|
43151
|
+
[]
|
|
43152
|
+
];
|
|
43153
|
+
var messageCreationRunStepIndex = runSteps.findIndex(function(runStep) {
|
|
43154
|
+
if (runStep.step_details.type !== "message_creation") return;
|
|
43155
|
+
return runStep.step_details.message_creation.message_id === messageId;
|
|
43156
|
+
});
|
|
43157
|
+
if (messageCreationRunStepIndex === -1) {
|
|
43158
|
+
return [
|
|
43159
|
+
[],
|
|
43160
|
+
runSteps
|
|
43161
|
+
];
|
|
43162
|
+
}
|
|
43163
|
+
var nextRunStepIndex = runSteps.slice(0, messageCreationRunStepIndex).findLastIndex(function(runStep) {
|
|
43164
|
+
return runStep.step_details.type === "message_creation";
|
|
43165
|
+
});
|
|
43166
|
+
if (nextRunStepIndex === -1) {
|
|
43167
|
+
nextRunStepIndex = 0;
|
|
43168
|
+
}
|
|
43169
|
+
var laterRunSteps = runSteps.slice(nextRunStepIndex, messageCreationRunStepIndex);
|
|
43170
|
+
var prevRunStepIndex = runSteps.slice(messageCreationRunStepIndex + 1).findIndex(function(runStep) {
|
|
43171
|
+
return runStep.step_details.type === "message_creation";
|
|
43172
|
+
});
|
|
43173
|
+
var olderRunSteps;
|
|
43174
|
+
if (prevRunStepIndex === -1) {
|
|
43175
|
+
olderRunSteps = runSteps.slice(messageCreationRunStepIndex + 1);
|
|
43176
|
+
} else {
|
|
43177
|
+
olderRunSteps = runSteps.slice(messageCreationRunStepIndex + 1, messageCreationRunStepIndex + 1 + prevRunStepIndex);
|
|
43178
|
+
}
|
|
43179
|
+
return [
|
|
43180
|
+
olderRunSteps,
|
|
43181
|
+
laterRunSteps
|
|
43182
|
+
];
|
|
43183
|
+
};
|
|
43178
43184
|
// src/components/threads/Thread/Message/index.tsx
|
|
43179
43185
|
import { jsx as _jsx62, jsxs as _jsxs18 } from "react/jsx-runtime";
|
|
43180
43186
|
var Message = function(t0) {
|
|
43181
|
-
var $ = _c60(
|
|
43187
|
+
var $ = _c60(21);
|
|
43182
43188
|
var message = t0.message, className = t0.className, style = t0.style;
|
|
43183
43189
|
var t1;
|
|
43184
|
-
bb0: {
|
|
43185
|
-
if (!message.runSteps.length) {
|
|
43186
|
-
var _t;
|
|
43187
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43188
|
-
_t = [
|
|
43189
|
-
[],
|
|
43190
|
-
[]
|
|
43191
|
-
];
|
|
43192
|
-
$[0] = _t;
|
|
43193
|
-
} else {
|
|
43194
|
-
_t = $[0];
|
|
43195
|
-
}
|
|
43196
|
-
t1 = _t;
|
|
43197
|
-
break bb0;
|
|
43198
|
-
}
|
|
43199
|
-
var _t2;
|
|
43200
|
-
if ($[1] !== message.id) {
|
|
43201
|
-
_t2 = function(runStep) {
|
|
43202
|
-
if (runStep.step_details.type !== "message_creation") {
|
|
43203
|
-
return;
|
|
43204
|
-
}
|
|
43205
|
-
return runStep.step_details.message_creation.message_id === message.id;
|
|
43206
|
-
};
|
|
43207
|
-
$[1] = message.id;
|
|
43208
|
-
$[2] = _t2;
|
|
43209
|
-
} else {
|
|
43210
|
-
_t2 = $[2];
|
|
43211
|
-
}
|
|
43212
|
-
var messageCreationRunStepIndex = message.runSteps.findIndex(_t2);
|
|
43213
|
-
if (messageCreationRunStepIndex === -1) {
|
|
43214
|
-
var _t3;
|
|
43215
|
-
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43216
|
-
_t3 = [];
|
|
43217
|
-
$[3] = _t3;
|
|
43218
|
-
} else {
|
|
43219
|
-
_t3 = $[3];
|
|
43220
|
-
}
|
|
43221
|
-
var _t4;
|
|
43222
|
-
if ($[4] !== message.runSteps) {
|
|
43223
|
-
_t4 = [
|
|
43224
|
-
_t3,
|
|
43225
|
-
message.runSteps
|
|
43226
|
-
];
|
|
43227
|
-
$[4] = message.runSteps;
|
|
43228
|
-
$[5] = _t4;
|
|
43229
|
-
} else {
|
|
43230
|
-
_t4 = $[5];
|
|
43231
|
-
}
|
|
43232
|
-
t1 = _t4;
|
|
43233
|
-
break bb0;
|
|
43234
|
-
}
|
|
43235
|
-
var _t5;
|
|
43236
|
-
if ($[6] !== message.runSteps || $[7] !== messageCreationRunStepIndex) {
|
|
43237
|
-
var nextRunStepIndex = message.runSteps.slice(0, messageCreationRunStepIndex).findLastIndex(_temp3);
|
|
43238
|
-
if (nextRunStepIndex === -1) {
|
|
43239
|
-
nextRunStepIndex = 0;
|
|
43240
|
-
}
|
|
43241
|
-
_t5 = message.runSteps.slice(nextRunStepIndex, messageCreationRunStepIndex);
|
|
43242
|
-
$[6] = message.runSteps;
|
|
43243
|
-
$[7] = messageCreationRunStepIndex;
|
|
43244
|
-
$[8] = _t5;
|
|
43245
|
-
} else {
|
|
43246
|
-
_t5 = $[8];
|
|
43247
|
-
}
|
|
43248
|
-
var laterRunSteps = _t5;
|
|
43249
|
-
var _t6;
|
|
43250
|
-
if ($[9] !== message.runSteps || $[10] !== messageCreationRunStepIndex) {
|
|
43251
|
-
_t6 = message.runSteps.slice(messageCreationRunStepIndex + 1).findIndex(_temp22);
|
|
43252
|
-
$[9] = message.runSteps;
|
|
43253
|
-
$[10] = messageCreationRunStepIndex;
|
|
43254
|
-
$[11] = _t6;
|
|
43255
|
-
} else {
|
|
43256
|
-
_t6 = $[11];
|
|
43257
|
-
}
|
|
43258
|
-
var prevRunStepIndex = _t6;
|
|
43259
|
-
var olderRunSteps;
|
|
43260
|
-
if (prevRunStepIndex === -1) {
|
|
43261
|
-
var _t7;
|
|
43262
|
-
if ($[12] !== message.runSteps || $[13] !== messageCreationRunStepIndex) {
|
|
43263
|
-
_t7 = message.runSteps.slice(messageCreationRunStepIndex + 1);
|
|
43264
|
-
$[12] = message.runSteps;
|
|
43265
|
-
$[13] = messageCreationRunStepIndex;
|
|
43266
|
-
$[14] = _t7;
|
|
43267
|
-
} else {
|
|
43268
|
-
_t7 = $[14];
|
|
43269
|
-
}
|
|
43270
|
-
olderRunSteps = _t7;
|
|
43271
|
-
} else {
|
|
43272
|
-
var _t8;
|
|
43273
|
-
if ($[15] !== message.runSteps || $[16] !== messageCreationRunStepIndex || $[17] !== prevRunStepIndex) {
|
|
43274
|
-
_t8 = message.runSteps.slice(messageCreationRunStepIndex + 1, messageCreationRunStepIndex + prevRunStepIndex);
|
|
43275
|
-
$[15] = message.runSteps;
|
|
43276
|
-
$[16] = messageCreationRunStepIndex;
|
|
43277
|
-
$[17] = prevRunStepIndex;
|
|
43278
|
-
$[18] = _t8;
|
|
43279
|
-
} else {
|
|
43280
|
-
_t8 = $[18];
|
|
43281
|
-
}
|
|
43282
|
-
olderRunSteps = _t8;
|
|
43283
|
-
}
|
|
43284
|
-
var _t9;
|
|
43285
|
-
if ($[19] !== laterRunSteps || $[20] !== olderRunSteps) {
|
|
43286
|
-
_t9 = [
|
|
43287
|
-
olderRunSteps,
|
|
43288
|
-
laterRunSteps
|
|
43289
|
-
];
|
|
43290
|
-
$[19] = laterRunSteps;
|
|
43291
|
-
$[20] = olderRunSteps;
|
|
43292
|
-
$[21] = _t9;
|
|
43293
|
-
} else {
|
|
43294
|
-
_t9 = $[21];
|
|
43295
|
-
}
|
|
43296
|
-
t1 = _t9;
|
|
43297
|
-
}
|
|
43298
|
-
var _t1 = _sliced_to_array(t1, 2), olderRunSteps_0 = _t1[0], laterRunSteps_0 = _t1[1];
|
|
43299
43190
|
var t22;
|
|
43300
|
-
if ($[
|
|
43301
|
-
t22 = {
|
|
43191
|
+
if ($[0] !== message.id || $[1] !== message.runSteps) {
|
|
43192
|
+
t22 = splitRunSteps({
|
|
43193
|
+
messageId: message.id,
|
|
43194
|
+
runSteps: message.runSteps
|
|
43195
|
+
});
|
|
43196
|
+
$[0] = message.id;
|
|
43197
|
+
$[1] = message.runSteps;
|
|
43198
|
+
$[2] = t22;
|
|
43199
|
+
} else {
|
|
43200
|
+
t22 = $[2];
|
|
43201
|
+
}
|
|
43202
|
+
t1 = t22;
|
|
43203
|
+
var _t1 = _sliced_to_array(t1, 2), olderRunSteps = _t1[0], laterRunSteps = _t1[1];
|
|
43204
|
+
var t3;
|
|
43205
|
+
if ($[3] !== message) {
|
|
43206
|
+
t3 = {
|
|
43302
43207
|
message: message
|
|
43303
43208
|
};
|
|
43304
|
-
$[
|
|
43305
|
-
$[
|
|
43209
|
+
$[3] = message;
|
|
43210
|
+
$[4] = t3;
|
|
43306
43211
|
} else {
|
|
43307
|
-
|
|
43212
|
+
t3 = $[4];
|
|
43308
43213
|
}
|
|
43309
|
-
var
|
|
43310
|
-
if ($[
|
|
43311
|
-
|
|
43312
|
-
runSteps:
|
|
43214
|
+
var t4;
|
|
43215
|
+
if ($[5] !== olderRunSteps) {
|
|
43216
|
+
t4 = /* @__PURE__ */ _jsx62(RunSteps, {
|
|
43217
|
+
runSteps: olderRunSteps
|
|
43313
43218
|
});
|
|
43314
|
-
$[
|
|
43315
|
-
$[
|
|
43219
|
+
$[5] = olderRunSteps;
|
|
43220
|
+
$[6] = t4;
|
|
43316
43221
|
} else {
|
|
43317
|
-
|
|
43222
|
+
t4 = $[6];
|
|
43318
43223
|
}
|
|
43319
|
-
var
|
|
43320
|
-
if ($[
|
|
43321
|
-
|
|
43224
|
+
var t5;
|
|
43225
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43226
|
+
t5 = {
|
|
43322
43227
|
wordBreak: "break-word"
|
|
43323
43228
|
};
|
|
43324
|
-
$[
|
|
43229
|
+
$[7] = t5;
|
|
43325
43230
|
} else {
|
|
43326
|
-
|
|
43231
|
+
t5 = $[7];
|
|
43327
43232
|
}
|
|
43328
|
-
var
|
|
43329
|
-
if ($[
|
|
43330
|
-
|
|
43331
|
-
style:
|
|
43233
|
+
var t6;
|
|
43234
|
+
if ($[8] !== message) {
|
|
43235
|
+
t6 = /* @__PURE__ */ _jsxs18(Box12, {
|
|
43236
|
+
style: t5,
|
|
43332
43237
|
children: [
|
|
43333
43238
|
/* @__PURE__ */ _jsx62(Attachments, {
|
|
43334
43239
|
message: message
|
|
@@ -43338,67 +43243,61 @@ var Message = function(t0) {
|
|
|
43338
43243
|
})
|
|
43339
43244
|
]
|
|
43340
43245
|
});
|
|
43341
|
-
$[
|
|
43342
|
-
$[
|
|
43246
|
+
$[8] = message;
|
|
43247
|
+
$[9] = t6;
|
|
43343
43248
|
} else {
|
|
43344
|
-
|
|
43249
|
+
t6 = $[9];
|
|
43345
43250
|
}
|
|
43346
|
-
var
|
|
43347
|
-
if ($[
|
|
43348
|
-
|
|
43349
|
-
runSteps:
|
|
43251
|
+
var t7;
|
|
43252
|
+
if ($[10] !== laterRunSteps) {
|
|
43253
|
+
t7 = /* @__PURE__ */ _jsx62(RunSteps, {
|
|
43254
|
+
runSteps: laterRunSteps
|
|
43350
43255
|
});
|
|
43351
|
-
$[
|
|
43352
|
-
$[
|
|
43256
|
+
$[10] = laterRunSteps;
|
|
43257
|
+
$[11] = t7;
|
|
43353
43258
|
} else {
|
|
43354
|
-
|
|
43259
|
+
t7 = $[11];
|
|
43355
43260
|
}
|
|
43356
|
-
var
|
|
43357
|
-
if ($[
|
|
43358
|
-
|
|
43261
|
+
var t8;
|
|
43262
|
+
if ($[12] !== className || $[13] !== style || $[14] !== t4 || $[15] !== t6 || $[16] !== t7) {
|
|
43263
|
+
t8 = /* @__PURE__ */ _jsxs18(Box12, {
|
|
43359
43264
|
className: className,
|
|
43360
43265
|
style: style,
|
|
43361
43266
|
children: [
|
|
43362
|
-
|
|
43363
|
-
|
|
43364
|
-
|
|
43267
|
+
t4,
|
|
43268
|
+
t6,
|
|
43269
|
+
t7
|
|
43365
43270
|
]
|
|
43366
43271
|
});
|
|
43367
|
-
$[
|
|
43368
|
-
$[
|
|
43369
|
-
$[
|
|
43370
|
-
$[
|
|
43371
|
-
$[
|
|
43372
|
-
$[
|
|
43272
|
+
$[12] = className;
|
|
43273
|
+
$[13] = style;
|
|
43274
|
+
$[14] = t4;
|
|
43275
|
+
$[15] = t6;
|
|
43276
|
+
$[16] = t7;
|
|
43277
|
+
$[17] = t8;
|
|
43373
43278
|
} else {
|
|
43374
|
-
|
|
43279
|
+
t8 = $[17];
|
|
43375
43280
|
}
|
|
43376
|
-
var
|
|
43377
|
-
if ($[
|
|
43378
|
-
|
|
43379
|
-
value:
|
|
43380
|
-
children:
|
|
43281
|
+
var t9;
|
|
43282
|
+
if ($[18] !== t3 || $[19] !== t8) {
|
|
43283
|
+
t9 = /* @__PURE__ */ _jsx62(Provider, {
|
|
43284
|
+
value: t3,
|
|
43285
|
+
children: t8
|
|
43381
43286
|
});
|
|
43382
|
-
$[
|
|
43383
|
-
$[
|
|
43384
|
-
$[
|
|
43287
|
+
$[18] = t3;
|
|
43288
|
+
$[19] = t8;
|
|
43289
|
+
$[20] = t9;
|
|
43385
43290
|
} else {
|
|
43386
|
-
|
|
43291
|
+
t9 = $[20];
|
|
43387
43292
|
}
|
|
43388
|
-
return
|
|
43293
|
+
return t9;
|
|
43389
43294
|
};
|
|
43390
|
-
function _temp3(runStep_0) {
|
|
43391
|
-
return runStep_0.step_details.type === "message_creation";
|
|
43392
|
-
}
|
|
43393
|
-
function _temp22(runStep_1) {
|
|
43394
|
-
return runStep_1.step_details.type === "message_creation";
|
|
43395
|
-
}
|
|
43396
43295
|
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
43397
43296
|
import { c as _c62 } from "react-compiler-runtime";
|
|
43398
43297
|
import { useEffect as useEffect3 } from "react";
|
|
43399
43298
|
// src/hooks/messageGroups/useMessageGroups/index.ts
|
|
43400
43299
|
import { c as _c61 } from "react-compiler-runtime";
|
|
43401
|
-
import { useMemo as
|
|
43300
|
+
import { useMemo as useMemo11 } from "react";
|
|
43402
43301
|
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/index.ts
|
|
43403
43302
|
import _6 from "lodash";
|
|
43404
43303
|
import { last as last2 } from "radash";
|
|
@@ -43617,7 +43516,7 @@ var Content7 = function() {
|
|
|
43617
43516
|
};
|
|
43618
43517
|
// src/components/threads/Thread/Messages/Progress/index.tsx
|
|
43619
43518
|
import { c as _c63 } from "react-compiler-runtime";
|
|
43620
|
-
import { useMemo as
|
|
43519
|
+
import { useMemo as useMemo12 } from "react";
|
|
43621
43520
|
import { Box as Box13 } from "@radix-ui/themes";
|
|
43622
43521
|
import { jsx as _jsx64, jsxs as _jsxs19 } from "react/jsx-runtime";
|
|
43623
43522
|
var StartingSkeleton2 = function() {
|
|
@@ -44158,7 +44057,7 @@ Submit.Root = Root7;
|
|
|
44158
44057
|
Submit.Button = Button3;
|
|
44159
44058
|
// src/components/threads/Thread/MessageForm/Root/index.tsx
|
|
44160
44059
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
44161
|
-
import { useMemo as
|
|
44060
|
+
import { useMemo as useMemo13, useState as useState4, useCallback as useCallback3 } from "react";
|
|
44162
44061
|
import { useForm, FormProvider } from "react-hook-form";
|
|
44163
44062
|
import { Box as Box14 } from "@radix-ui/themes";
|
|
44164
44063
|
// src/components/threads/Thread/MessageForm/Root/lib/formOptions.ts
|
|
@@ -44256,7 +44155,7 @@ var Root8 = function(_ref) {
|
|
|
44256
44155
|
})
|
|
44257
44156
|
}).createMessage;
|
|
44258
44157
|
var isMutatingMessage = useIsMutatingMessage();
|
|
44259
|
-
var isFileLoading =
|
|
44158
|
+
var isFileLoading = useMemo13(function() {
|
|
44260
44159
|
return files.some(function(file) {
|
|
44261
44160
|
return isOptimistic({
|
|
44262
44161
|
id: file.id
|
|
@@ -44265,14 +44164,14 @@ var Root8 = function(_ref) {
|
|
|
44265
44164
|
}, [
|
|
44266
44165
|
files
|
|
44267
44166
|
]);
|
|
44268
|
-
var isLoading =
|
|
44167
|
+
var isLoading = useMemo13(function() {
|
|
44269
44168
|
return isMutatingMessage || isSubmitting;
|
|
44270
44169
|
}, [
|
|
44271
44170
|
isMutatingMessage,
|
|
44272
44171
|
isSubmitting
|
|
44273
44172
|
]);
|
|
44274
44173
|
var latestMessage = useLatestMessage().latestMessage;
|
|
44275
|
-
var isDisabled =
|
|
44174
|
+
var isDisabled = useMemo13(function() {
|
|
44276
44175
|
var _latestMessage$metada;
|
|
44277
44176
|
return !!(latestMessage !== null && latestMessage !== void 0 && (_latestMessage$metada = latestMessage.metadata) !== null && _latestMessage$metada !== void 0 && _latestMessage$metada.isBlocking) || !!isDisabledArg;
|
|
44278
44177
|
}, [
|
|
@@ -44394,7 +44293,7 @@ var usePrevious = function(state) {
|
|
|
44394
44293
|
return ref.current;
|
|
44395
44294
|
};
|
|
44396
44295
|
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
44397
|
-
import { useContext as useContext16, useMemo as
|
|
44296
|
+
import { useContext as useContext16, useMemo as useMemo14, useRef as useRef5, useEffect as useEffect6 } from "react";
|
|
44398
44297
|
// src/components/textareas/TextareaBase/index.tsx
|
|
44399
44298
|
import { c as _c68 } from "react-compiler-runtime";
|
|
44400
44299
|
import { forwardRef as forwardRef4 } from "react";
|
|
@@ -44613,7 +44512,7 @@ var Input = function(props) {
|
|
|
44613
44512
|
var assistantNameContext = useContext16(AssistantNameContext);
|
|
44614
44513
|
var register = useFormContext().register;
|
|
44615
44514
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
44616
|
-
var isSubmitDisabled =
|
|
44515
|
+
var isSubmitDisabled = useMemo14(function() {
|
|
44617
44516
|
return isDisabled || isLoading;
|
|
44618
44517
|
}, [
|
|
44619
44518
|
isDisabled,
|
|
@@ -45063,7 +44962,7 @@ var useCreateFile = function(t0) {
|
|
|
45063
44962
|
var t1;
|
|
45064
44963
|
if ($[0] !== t0) {
|
|
45065
44964
|
t1 = t0 === void 0 ? {
|
|
45066
|
-
onError:
|
|
44965
|
+
onError: _temp3
|
|
45067
44966
|
} : t0;
|
|
45068
44967
|
$[0] = t0;
|
|
45069
44968
|
$[1] = t1;
|
|
@@ -45073,7 +44972,7 @@ var useCreateFile = function(t0) {
|
|
|
45073
44972
|
var t22 = t1.onError;
|
|
45074
44973
|
var t3;
|
|
45075
44974
|
if ($[2] !== t22) {
|
|
45076
|
-
t3 = t22 === void 0 ?
|
|
44975
|
+
t3 = t22 === void 0 ? _temp22 : t22;
|
|
45077
44976
|
$[2] = t22;
|
|
45078
44977
|
$[3] = t3;
|
|
45079
44978
|
} else {
|
|
@@ -45132,8 +45031,8 @@ var useCreateFile = function(t0) {
|
|
|
45132
45031
|
}
|
|
45133
45032
|
return t6;
|
|
45134
45033
|
};
|
|
45135
|
-
function
|
|
45136
|
-
function
|
|
45034
|
+
function _temp3() {}
|
|
45035
|
+
function _temp22() {}
|
|
45137
45036
|
// src/hooks/files/useChangeFilesField/index.ts
|
|
45138
45037
|
function asyncGeneratorStep8(n4, t3, e3, r2, o2, a3, c2) {
|
|
45139
45038
|
try {
|
|
@@ -45788,7 +45687,7 @@ var ToastsProvider = function(t0) {
|
|
|
45788
45687
|
}
|
|
45789
45688
|
var t5;
|
|
45790
45689
|
if ($[4] !== toasts) {
|
|
45791
|
-
t5 = Array.from(toasts).map(
|
|
45690
|
+
t5 = Array.from(toasts).map(_temp4);
|
|
45792
45691
|
$[4] = toasts;
|
|
45793
45692
|
$[5] = t5;
|
|
45794
45693
|
} else {
|
|
@@ -45848,7 +45747,7 @@ var ToastsProvider = function(t0) {
|
|
|
45848
45747
|
}
|
|
45849
45748
|
return t8;
|
|
45850
45749
|
};
|
|
45851
|
-
function
|
|
45750
|
+
function _temp4(toast_0, index4) {
|
|
45852
45751
|
return /* @__PURE__ */ _jsx77(CustomToast, {
|
|
45853
45752
|
toast: toast_0
|
|
45854
45753
|
}, index4);
|
|
@@ -46059,7 +45958,7 @@ var useMessageContext = function() {
|
|
|
46059
45958
|
};
|
|
46060
45959
|
// src/hooks/assistants/useAssistant/index.ts
|
|
46061
45960
|
import { c as _c78 } from "react-compiler-runtime";
|
|
46062
|
-
import { useMemo as
|
|
45961
|
+
import { useMemo as useMemo15 } from "react";
|
|
46063
45962
|
import { useQuery } from "@tanstack/react-query";
|
|
46064
45963
|
// src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
|
|
46065
45964
|
import { queryOptions as tanstackQueryOptions } from "@tanstack/react-query";
|
|
@@ -46446,7 +46345,7 @@ var Root14 = function(t0) {
|
|
|
46446
46345
|
var t3;
|
|
46447
46346
|
if ($[2] !== setIsOpen) {
|
|
46448
46347
|
t3 = function() {
|
|
46449
|
-
return setIsOpen(
|
|
46348
|
+
return setIsOpen(_temp5);
|
|
46450
46349
|
};
|
|
46451
46350
|
$[2] = setIsOpen;
|
|
46452
46351
|
$[3] = t3;
|
|
@@ -46521,7 +46420,7 @@ var Trigger = function(args) {
|
|
|
46521
46420
|
};
|
|
46522
46421
|
Trigger.Root = Root14;
|
|
46523
46422
|
Trigger.Button = Button4;
|
|
46524
|
-
function
|
|
46423
|
+
function _temp5(prev) {
|
|
46525
46424
|
return !prev;
|
|
46526
46425
|
}
|
|
46527
46426
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
@@ -46550,7 +46449,7 @@ var Close = function() {
|
|
|
46550
46449
|
var t22;
|
|
46551
46450
|
if ($[2] !== setIsOpen) {
|
|
46552
46451
|
t22 = function() {
|
|
46553
|
-
return setIsOpen(
|
|
46452
|
+
return setIsOpen(_temp6);
|
|
46554
46453
|
};
|
|
46555
46454
|
$[2] = setIsOpen;
|
|
46556
46455
|
$[3] = t22;
|
|
@@ -46600,7 +46499,7 @@ var Close = function() {
|
|
|
46600
46499
|
}
|
|
46601
46500
|
return t5;
|
|
46602
46501
|
};
|
|
46603
|
-
function
|
|
46502
|
+
function _temp6(prev) {
|
|
46604
46503
|
return !prev;
|
|
46605
46504
|
}
|
|
46606
46505
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
@@ -46928,7 +46827,7 @@ var useAudioThreadContext = function() {
|
|
|
46928
46827
|
import { c as _c90 } from "react-compiler-runtime";
|
|
46929
46828
|
// src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
|
|
46930
46829
|
import { c as _c89 } from "react-compiler-runtime";
|
|
46931
|
-
import { useMemo as
|
|
46830
|
+
import { useMemo as useMemo18 } from "react";
|
|
46932
46831
|
// src/hooks/misc/usePermission/index.ts
|
|
46933
46832
|
import { c as _c86 } from "react-compiler-runtime";
|
|
46934
46833
|
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
@@ -47000,14 +46899,14 @@ var usePermission = function(permissionDesc) {
|
|
|
47000
46899
|
// src/hooks/audioThreads/useRecorder/index.ts
|
|
47001
46900
|
import dayjs3 from "dayjs";
|
|
47002
46901
|
import { useAudioCapture } from "@supercorp/use-audio-capture";
|
|
47003
|
-
import { useMemo as
|
|
46902
|
+
import { useMemo as useMemo16, useRef as useRef7, useState as useState8, useCallback as useCallback6, useEffect as useEffect9 } from "react";
|
|
47004
46903
|
import { useAudioPlayer } from "react-use-audio-player";
|
|
47005
46904
|
// src/hooks/misc/useInterval.ts
|
|
47006
46905
|
import { c as _c87 } from "react-compiler-runtime";
|
|
47007
46906
|
import { useEffect as useEffect8, useRef as useRef6 } from "react";
|
|
47008
46907
|
var useInterval = function(callback, delay) {
|
|
47009
46908
|
var $ = _c87(5);
|
|
47010
|
-
var savedCallback = useRef6(
|
|
46909
|
+
var savedCallback = useRef6(_temp7);
|
|
47011
46910
|
var t0;
|
|
47012
46911
|
if ($[0] !== callback) {
|
|
47013
46912
|
t0 = function() {
|
|
@@ -47044,7 +46943,7 @@ var useInterval = function(callback, delay) {
|
|
|
47044
46943
|
}
|
|
47045
46944
|
useEffect8(t1, t22);
|
|
47046
46945
|
};
|
|
47047
|
-
function
|
|
46946
|
+
function _temp7() {}
|
|
47048
46947
|
// src/hooks/audioThreads/useRecorder/index.ts
|
|
47049
46948
|
function ownKeys46(e3, r2) {
|
|
47050
46949
|
var t3 = Object.keys(e3);
|
|
@@ -47196,7 +47095,7 @@ var useRecorder = function(_ref) {
|
|
|
47196
47095
|
isInited,
|
|
47197
47096
|
mediaStream
|
|
47198
47097
|
]);
|
|
47199
|
-
var visualizationAnalyser =
|
|
47098
|
+
var visualizationAnalyser = useMemo16(function() {
|
|
47200
47099
|
if (!audioEngine) return null;
|
|
47201
47100
|
var result = audioEngine.audioContext.createAnalyser();
|
|
47202
47101
|
audioEngine.source.connect(result);
|
|
@@ -47204,7 +47103,7 @@ var useRecorder = function(_ref) {
|
|
|
47204
47103
|
}, [
|
|
47205
47104
|
audioEngine
|
|
47206
47105
|
]);
|
|
47207
|
-
var silenceAnalyser =
|
|
47106
|
+
var silenceAnalyser = useMemo16(function() {
|
|
47208
47107
|
if (!audioEngine) return null;
|
|
47209
47108
|
var result_0 = audioEngine.audioContext.createAnalyser();
|
|
47210
47109
|
result_0.minDecibels = -60;
|
|
@@ -47260,7 +47159,7 @@ var useRecorder = function(_ref) {
|
|
|
47260
47159
|
};
|
|
47261
47160
|
// src/hooks/audioThreads/useMessageAudio/index.ts
|
|
47262
47161
|
import { c as _c88 } from "react-compiler-runtime";
|
|
47263
|
-
import { useMemo as
|
|
47162
|
+
import { useMemo as useMemo17, useRef as useRef8, useState as useState9, useEffect as useEffect10, useCallback as useCallback7 } from "react";
|
|
47264
47163
|
// ../../node_modules/compromise/src/API/world.js
|
|
47265
47164
|
var methods = {
|
|
47266
47165
|
one: {},
|
|
@@ -73139,7 +73038,7 @@ var useMessageAudio = function(t0) {
|
|
|
73139
73038
|
} else {
|
|
73140
73039
|
t15 = $[55];
|
|
73141
73040
|
}
|
|
73142
|
-
useEffect10(
|
|
73041
|
+
useEffect10(_temp8, t15);
|
|
73143
73042
|
var _useState94 = _sliced_to_array(useState9(null), 2), audioEngine = _useState94[0], setAudioEngine = _useState94[1];
|
|
73144
73043
|
var isAudioEngineInited = useRef8(false);
|
|
73145
73044
|
var t16;
|
|
@@ -73223,7 +73122,7 @@ var useMessageAudio = function(t0) {
|
|
|
73223
73122
|
}
|
|
73224
73123
|
return t20;
|
|
73225
73124
|
};
|
|
73226
|
-
function
|
|
73125
|
+
function _temp8() {
|
|
73227
73126
|
if (isHtmlAudioSupported) {
|
|
73228
73127
|
var _Howler$_howls$;
|
|
73229
73128
|
if (!(Howler !== null && Howler !== void 0 && (_Howler$_howls$ = Howler._howls[0]) !== null && _Howler$_howls$ !== void 0 && (_Howler$_howls$ = _Howler$_howls$._sounds[0]) !== null && _Howler$_howls$ !== void 0 && _Howler$_howls$._node)) {
|
|
@@ -73376,7 +73275,7 @@ var useTtsAudioRuntime = function(t0) {
|
|
|
73376
73275
|
if ($[4] !== createMessageProps) {
|
|
73377
73276
|
t22 = {
|
|
73378
73277
|
isStopOnSilence: true,
|
|
73379
|
-
onStart:
|
|
73278
|
+
onStart: _temp9,
|
|
73380
73279
|
onStop: function() {
|
|
73381
73280
|
var _onStop = _asyncToGenerator11(function(_event, chunks3) {
|
|
73382
73281
|
var blob, audioContent;
|
|
@@ -73516,18 +73415,18 @@ var useTtsAudioRuntime = function(t0) {
|
|
|
73516
73415
|
t5 = t8;
|
|
73517
73416
|
return t5;
|
|
73518
73417
|
};
|
|
73519
|
-
function
|
|
73520
|
-
return
|
|
73418
|
+
function _temp9() {
|
|
73419
|
+
return _temp23.apply(this, arguments);
|
|
73521
73420
|
}
|
|
73522
|
-
function
|
|
73523
|
-
|
|
73421
|
+
function _temp23() {
|
|
73422
|
+
_temp23 = _asyncToGenerator11(function() {
|
|
73524
73423
|
return _ts_generator(this, function(_state) {
|
|
73525
73424
|
return [
|
|
73526
73425
|
2
|
|
73527
73426
|
];
|
|
73528
73427
|
});
|
|
73529
73428
|
});
|
|
73530
|
-
return
|
|
73429
|
+
return _temp23.apply(this, arguments);
|
|
73531
73430
|
}
|
|
73532
73431
|
// src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
|
|
73533
73432
|
import { jsx as _jsx87 } from "react/jsx-runtime";
|
|
@@ -73953,7 +73852,7 @@ var BarsVisualizer = function(_ref) {
|
|
|
73953
73852
|
};
|
|
73954
73853
|
// src/hooks/audioThreads/useStatus/index.ts
|
|
73955
73854
|
import { c as _c92 } from "react-compiler-runtime";
|
|
73956
|
-
import { useMemo as
|
|
73855
|
+
import { useMemo as useMemo19 } from "react";
|
|
73957
73856
|
var useStatus = function() {
|
|
73958
73857
|
var $ = _c92(2);
|
|
73959
73858
|
var audioRuntime = useAudioThreadContext().audioRuntime;
|
|
@@ -75166,7 +75065,7 @@ AudioThreadDialog.Root = Root13;
|
|
|
75166
75065
|
AudioThreadDialog.Trigger = Trigger;
|
|
75167
75066
|
AudioThreadDialog.Content = Content8;
|
|
75168
75067
|
// src/hooks/audioRuntimes/useWebrtcAudioRuntime/index.ts
|
|
75169
|
-
import { useEffect as useEffect13, useMemo as
|
|
75068
|
+
import { useEffect as useEffect13, useMemo as useMemo20, useRef as useRef9, useState as useState12 } from "react";
|
|
75170
75069
|
function asyncGeneratorStep12(n4, t3, e3, r2, o2, a3, c2) {
|
|
75171
75070
|
try {
|
|
75172
75071
|
var i3 = n4[a3](c2), u2 = i3.value;
|
|
@@ -75606,7 +75505,7 @@ var useWebrtcAudioRuntime = function() {
|
|
|
75606
75505
|
return _ref7.apply(this, arguments);
|
|
75607
75506
|
};
|
|
75608
75507
|
}();
|
|
75609
|
-
return
|
|
75508
|
+
return useMemo20(function() {
|
|
75610
75509
|
return {
|
|
75611
75510
|
webrtcAudioRuntime: {
|
|
75612
75511
|
user: {
|
|
@@ -75687,11 +75586,11 @@ var WebrtcAudioRuntimeProvider = function(t0) {
|
|
|
75687
75586
|
};
|
|
75688
75587
|
// src/components/gui/Gui/index.tsx
|
|
75689
75588
|
import { c as _c104 } from "react-compiler-runtime";
|
|
75690
|
-
import { useMemo as
|
|
75589
|
+
import { useMemo as useMemo23 } from "react";
|
|
75691
75590
|
import { Flex as Flex35, Card as Card5, Spinner as Spinner3 } from "@radix-ui/themes";
|
|
75692
75591
|
// src/hooks/messages/useLatestAssistantMessage/index.ts
|
|
75693
75592
|
import { c as _c102 } from "react-compiler-runtime";
|
|
75694
|
-
import { useMemo as
|
|
75593
|
+
import { useMemo as useMemo21 } from "react";
|
|
75695
75594
|
var useLatestAssistantMessage = function() {
|
|
75696
75595
|
var $ = _c102(4);
|
|
75697
75596
|
var _useMessages = useMessages(), messages2 = _useMessages.messages;
|
|
@@ -75699,7 +75598,7 @@ var useLatestAssistantMessage = function() {
|
|
|
75699
75598
|
var t1;
|
|
75700
75599
|
if ($[0] !== messages2) {
|
|
75701
75600
|
var _messages$find;
|
|
75702
|
-
t1 = (_messages$find = messages2.find(
|
|
75601
|
+
t1 = (_messages$find = messages2.find(_temp10)) !== null && _messages$find !== void 0 ? _messages$find : null;
|
|
75703
75602
|
$[0] = messages2;
|
|
75704
75603
|
$[1] = t1;
|
|
75705
75604
|
} else {
|
|
@@ -75718,13 +75617,13 @@ var useLatestAssistantMessage = function() {
|
|
|
75718
75617
|
t0 = t22;
|
|
75719
75618
|
return t0;
|
|
75720
75619
|
};
|
|
75721
|
-
function
|
|
75620
|
+
function _temp10(message) {
|
|
75722
75621
|
return message.role === "assistant";
|
|
75723
75622
|
}
|
|
75724
75623
|
// src/hooks/messages/useLatestAssistantMessageWithContent/index.ts
|
|
75725
75624
|
import { c as _c103 } from "react-compiler-runtime";
|
|
75726
75625
|
import { isEmpty as isEmpty3 } from "radash";
|
|
75727
|
-
import { useMemo as
|
|
75626
|
+
import { useMemo as useMemo22 } from "react";
|
|
75728
75627
|
var useLatestAssistantMessageWithContent = function() {
|
|
75729
75628
|
var $ = _c103(4);
|
|
75730
75629
|
var _useMessages = useMessages(), messages2 = _useMessages.messages;
|
|
@@ -75732,7 +75631,7 @@ var useLatestAssistantMessageWithContent = function() {
|
|
|
75732
75631
|
var t1;
|
|
75733
75632
|
if ($[0] !== messages2) {
|
|
75734
75633
|
var _messages$find;
|
|
75735
|
-
t1 = (_messages$find = messages2.find(
|
|
75634
|
+
t1 = (_messages$find = messages2.find(_temp24)) !== null && _messages$find !== void 0 ? _messages$find : null;
|
|
75736
75635
|
$[0] = messages2;
|
|
75737
75636
|
$[1] = t1;
|
|
75738
75637
|
} else {
|
|
@@ -75751,11 +75650,11 @@ var useLatestAssistantMessageWithContent = function() {
|
|
|
75751
75650
|
t0 = t22;
|
|
75752
75651
|
return t0;
|
|
75753
75652
|
};
|
|
75754
|
-
function
|
|
75653
|
+
function _temp11(content2) {
|
|
75755
75654
|
return content2.type === "text" && !isEmpty3(content2.text.value);
|
|
75756
75655
|
}
|
|
75757
|
-
function
|
|
75758
|
-
return message.role === "assistant" && message.content.some(
|
|
75656
|
+
function _temp24(message) {
|
|
75657
|
+
return message.role === "assistant" && message.content.some(_temp11);
|
|
75759
75658
|
}
|
|
75760
75659
|
// src/components/gui/Gui/index.tsx
|
|
75761
75660
|
import { jsx as _jsx99, jsxs as _jsxs37 } from "react/jsx-runtime";
|
|
@@ -75835,7 +75734,7 @@ var Progress2 = function(t0) {
|
|
|
75835
75734
|
var t22;
|
|
75836
75735
|
if ($[0] !== latestAssistantMessage.runSteps) {
|
|
75837
75736
|
var _latestAssistantMessa;
|
|
75838
|
-
t22 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(
|
|
75737
|
+
t22 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp12)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
|
|
75839
75738
|
$[0] = latestAssistantMessage.runSteps;
|
|
75840
75739
|
$[1] = t22;
|
|
75841
75740
|
} else {
|
|
@@ -75940,12 +75839,12 @@ var Gui = function() {
|
|
|
75940
75839
|
}
|
|
75941
75840
|
return t22;
|
|
75942
75841
|
};
|
|
75943
|
-
function
|
|
75842
|
+
function _temp12(rs) {
|
|
75944
75843
|
return rs.status === "in_progress";
|
|
75945
75844
|
}
|
|
75946
75845
|
// src/components/markdown/MarkdownProvider/index.tsx
|
|
75947
75846
|
import { c as _c105 } from "react-compiler-runtime";
|
|
75948
|
-
import { useMemo as
|
|
75847
|
+
import { useMemo as useMemo24 } from "react";
|
|
75949
75848
|
import { jsx as _jsx100 } from "react/jsx-runtime";
|
|
75950
75849
|
var _excluded9 = [
|
|
75951
75850
|
"children"
|
|
@@ -76412,7 +76311,7 @@ var ImageAvatar = function(t0) {
|
|
|
76412
76311
|
};
|
|
76413
76312
|
// src/components/iconAvatars/IconAvatar.tsx
|
|
76414
76313
|
import { c as _c110 } from "react-compiler-runtime";
|
|
76415
|
-
import { useMemo as
|
|
76314
|
+
import { useMemo as useMemo25 } from "react";
|
|
76416
76315
|
import { Avatar as Avatar5 } from "@radix-ui/themes";
|
|
76417
76316
|
// src/lib/iconAvatars/iconAvatarComponents.ts
|
|
76418
76317
|
import { BackpackIcon, RocketIcon, MagicWandIcon, CubeIcon, TargetIcon, DiscIcon, GlobeIcon, StarIcon, LightningBoltIcon as LightningBoltIcon2, FaceIcon, PersonIcon as PersonIcon2, HeartIcon } from "@radix-ui/react-icons";
|
|
@@ -76517,7 +76416,7 @@ var Avatar6 = function(t0) {
|
|
|
76517
76416
|
};
|
|
76518
76417
|
// src/components/components/ComponentsProvider.tsx
|
|
76519
76418
|
import { c as _c112 } from "react-compiler-runtime";
|
|
76520
|
-
import { useMemo as
|
|
76419
|
+
import { useMemo as useMemo26 } from "react";
|
|
76521
76420
|
import { jsx as _jsx107 } from "react/jsx-runtime";
|
|
76522
76421
|
var _excluded11 = [
|
|
76523
76422
|
"children"
|