@oscloudlab/vgen-agent-assistant 0.0.6 → 0.0.8
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/types/src/components/VgenAgent/components/MessageContent.d.ts +1 -0
- package/dist/types/src/components/VgenAgent/type.d.ts +1 -0
- package/dist/vgen-agent-assistant.es.js +91 -47
- package/dist/vgen-agent-assistant.es.js.gz +0 -0
- package/dist/vgen-agent-assistant.umd.js +8 -8
- package/dist/vgen-agent-assistant.umd.js.gz +0 -0
- package/package.json +1 -1
|
@@ -21927,36 +21927,71 @@ const msgTypeSceneMap = {
|
|
|
21927
21927
|
]: "form_learn_task"
|
|
21928
21928
|
/* FROM_LEARN_TASK */
|
|
21929
21929
|
};
|
|
21930
|
-
const
|
|
21931
|
-
|
|
21932
|
-
"
|
|
21933
|
-
|
|
21934
|
-
"
|
|
21935
|
-
|
|
21936
|
-
"
|
|
21937
|
-
|
|
21938
|
-
"
|
|
21939
|
-
|
|
21940
|
-
"
|
|
21941
|
-
|
|
21942
|
-
"
|
|
21943
|
-
|
|
21944
|
-
"
|
|
21945
|
-
|
|
21946
|
-
"
|
|
21947
|
-
|
|
21948
|
-
"
|
|
21949
|
-
|
|
21950
|
-
"/
|
|
21951
|
-
|
|
21952
|
-
"
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
"
|
|
21957
|
-
|
|
21958
|
-
|
|
21959
|
-
|
|
21930
|
+
const devEnvUrl$1 = {
|
|
21931
|
+
"VITE_BASE_API_URL": "https://gw-test.cloudlab.top/ai-agent-app",
|
|
21932
|
+
"VITE_BASE_RUNNER_API_URL": "https://runner-test.cloudlab.top",
|
|
21933
|
+
"VITE_BASE_CLOUD_LAB_URL": "https://lab-test.cloudlab.top",
|
|
21934
|
+
"VITE_BASE_RUNNER": "https://run-test.cloudlab.top",
|
|
21935
|
+
"VITE_BASE_QUIZ": "https://quiz-test.cloudlab.top",
|
|
21936
|
+
"VITE_BASE_VIDEO_LICENSE": "https://openapi-test.cloudlab.top",
|
|
21937
|
+
"VITE_BASE_AI_AGENT_URL": "https://gw-test.cloudlab.top",
|
|
21938
|
+
"VITE_BASE_VGEN_API_URL": "https://vgen-server-test.cloudlab.top",
|
|
21939
|
+
"VITE_BASE_VGEN_BLOG_URL": "https://vblog-test.cloudlab.top",
|
|
21940
|
+
"VITE_BASE_VGEN_NEW_AGENT": "https://v-agent-test.cloudlab.top",
|
|
21941
|
+
"VITE_BASE_CLOUD_WS_URL": "wss://lab-test.cloudlab.top",
|
|
21942
|
+
"VITE_BASE_AI_ENGINE_URL": "https://ai-engine-test.cloudlab.top",
|
|
21943
|
+
"VITE_BASE_CLOUD_MSG_URL": "https://api-test.cloudlab.top",
|
|
21944
|
+
"VITE_BASE_CLOUD_GATEWAY_URL": "https://gateway-test.cloudlab.top",
|
|
21945
|
+
"VITE_BASE_TBOX_ENTERPRISE_URL": "https://b.tbox.cn",
|
|
21946
|
+
"VITE_BASE_TBOX_COMMUNITY_URL": "https://www.tbox.cn",
|
|
21947
|
+
"VITE_BASE_VGEN_URL": "https://vgen-test.cloudlab.top",
|
|
21948
|
+
"VITE_BASE_VGEN_BLOG_LABCODE": "linux1",
|
|
21949
|
+
"VITE_BASE_VGEN_BLOG_CODE": "KiBjHH",
|
|
21950
|
+
"VITE_BASE_VGEN_BLOG_LINK": "https://linux1.test.cloudlab.top/os/KiBjHH",
|
|
21951
|
+
"VITE_BASE_WS_URL_PTY": "wss://pty-test.cloudlab.top",
|
|
21952
|
+
"VITE_BASE_API_URL_PTY": "https://pty-test.cloudlab.top",
|
|
21953
|
+
"VITE_BASE_CODE_PTY_NAMESPACE": "pty-test"
|
|
21954
|
+
};
|
|
21955
|
+
const proEnvUrl = {
|
|
21956
|
+
"VITE_BASE_RUNNER_API_URL": "https://runner.cloudlab.top",
|
|
21957
|
+
"VITE_BASE_CLOUD_LAB_URL": "https://lab.cloudlab.top",
|
|
21958
|
+
"VITE_BASE_RUNNER": "https://run.cloudlab.top",
|
|
21959
|
+
"VITE_BASE_QUIZ": "https://quiz.cloudlab.top",
|
|
21960
|
+
"VITE_BASE_VIDEO_LICENSE": "https://open-api.cloudlab.top",
|
|
21961
|
+
"VITE_BASE_AI_AGENT_URL": "https://gw.cloudlab.top",
|
|
21962
|
+
"VITE_BASE_VGEN_API_URL": "https://vgen-server.cloudlab.top",
|
|
21963
|
+
"VITE_BASE_VGEN_BLOG_URL": "https://vblog.cloudlab.top",
|
|
21964
|
+
"VITE_BASE_VGEN_NEW_AGENT": "https://v-agent.cloudlab.top",
|
|
21965
|
+
"VITE_BASE_CLOUD_WS_URL": "wss://lab.cloudlab.top",
|
|
21966
|
+
"VITE_BASE_AI_ENGINE_URL": "https://ai-engine.cloudlab.top",
|
|
21967
|
+
"VITE_BASE_CLOUD_MSG_URL": "https://api.cloudlab.top",
|
|
21968
|
+
"VITE_BASE_CLOUD_GATEWAY_URL": "https://gateway.cloudlab.top",
|
|
21969
|
+
"VITE_BASE_TBOX_ENTERPRISE_URL": "https://b.tbox.cn",
|
|
21970
|
+
"VITE_BASE_TBOX_COMMUNITY_URL": "https://www.tbox.cn",
|
|
21971
|
+
"VITE_BASE_VGEN_URL": "https://vgen.cloudlab.top",
|
|
21972
|
+
"VITE_BASE_VGEN_BLOG_LABCODE": "cloudlab",
|
|
21973
|
+
"VITE_BASE_VGEN_BLOG_CODE": "k891b1",
|
|
21974
|
+
"VITE_BASE_VGEN_BLOG_LINK": "https://cloudlab.beta.cloudlab.top/os/k891b1",
|
|
21975
|
+
"VITE_BASE_WS_URL_PTY": "wss://pty.cloudlab.top",
|
|
21976
|
+
"VITE_BASE_API_URL_PTY": "https://pty.cloudlab.top",
|
|
21977
|
+
"VITE_BASE_CODE_PTY_NAMESPACE": "pty-prod"
|
|
21978
|
+
};
|
|
21979
|
+
const API_PREFIX_MAP = (isDev) => {
|
|
21980
|
+
return {
|
|
21981
|
+
"/api/v1.0": isDev ? devEnvUrl$1.VITE_BASE_VGEN_API_URL : proEnvUrl.VITE_BASE_VGEN_API_URL,
|
|
21982
|
+
"/api/v0.3": isDev ? devEnvUrl$1.VITE_BASE_CLOUD_LAB_URL : proEnvUrl.VITE_BASE_CLOUD_LAB_URL,
|
|
21983
|
+
"/vod": isDev ? devEnvUrl$1.VITE_BASE_VIDEO_LICENSE : proEnvUrl.VITE_BASE_VIDEO_LICENSE,
|
|
21984
|
+
"/ai-agent-app": isDev ? devEnvUrl$1.VITE_BASE_AI_AGENT_URL : proEnvUrl.VITE_BASE_AI_AGENT_URL,
|
|
21985
|
+
"/message/user": isDev ? devEnvUrl$1.VITE_BASE_CLOUD_MSG_URL : proEnvUrl.VITE_BASE_CLOUD_MSG_URL,
|
|
21986
|
+
"/chat": isDev ? devEnvUrl$1.VITE_BASE_VGEN_NEW_AGENT : proEnvUrl.VITE_BASE_VGEN_NEW_AGENT,
|
|
21987
|
+
"/saas/chat": isDev ? devEnvUrl$1.VITE_BASE_VGEN_NEW_AGENT : proEnvUrl.VITE_BASE_VGEN_NEW_AGENT,
|
|
21988
|
+
"/scene": isDev ? devEnvUrl$1.VITE_BASE_VGEN_NEW_AGENT : proEnvUrl.VITE_BASE_VGEN_NEW_AGENT,
|
|
21989
|
+
"/api/start": isDev ? devEnvUrl$1.VITE_BASE_API_URL_PTY : proEnvUrl.VITE_BASE_API_URL_PTY,
|
|
21990
|
+
"/api/release": isDev ? devEnvUrl$1.VITE_BASE_API_URL_PTY : proEnvUrl.VITE_BASE_API_URL_PTY,
|
|
21991
|
+
"/cmd/template": isDev ? devEnvUrl$1.VITE_BASE_API_URL_PTY : proEnvUrl.VITE_BASE_API_URL_PTY,
|
|
21992
|
+
"/api/v1/": isDev ? devEnvUrl$1.VITE_BASE_AI_ENGINE_URL : proEnvUrl.VITE_BASE_AI_ENGINE_URL,
|
|
21993
|
+
"/api/v2/": isDev ? devEnvUrl$1.VITE_BASE_CLOUD_GATEWAY_URL : proEnvUrl.VITE_BASE_CLOUD_GATEWAY_URL
|
|
21994
|
+
};
|
|
21960
21995
|
};
|
|
21961
21996
|
const currentFeatures = [
|
|
21962
21997
|
{
|
|
@@ -25509,15 +25544,16 @@ const axiosInstance = axios.create({
|
|
|
25509
25544
|
});
|
|
25510
25545
|
axiosInstance.interceptors.request.use(
|
|
25511
25546
|
(config) => {
|
|
25547
|
+
var _a2;
|
|
25512
25548
|
const { url } = config;
|
|
25513
|
-
for (const [prefix2, baseURL] of Object.entries(API_PREFIX_MAP)) {
|
|
25549
|
+
for (const [prefix2, baseURL] of Object.entries(API_PREFIX_MAP(window.isRunInDev))) {
|
|
25514
25550
|
if (url == null ? void 0 : url.startsWith(prefix2)) {
|
|
25515
25551
|
config.baseURL = baseURL;
|
|
25516
25552
|
break;
|
|
25517
25553
|
}
|
|
25518
25554
|
}
|
|
25519
25555
|
if (!config.baseURL) {
|
|
25520
|
-
config.baseURL = API_PREFIX_MAP.
|
|
25556
|
+
config.baseURL = (_a2 = API_PREFIX_MAP(window.isRunInDev)) == null ? void 0 : _a2["/api/v1.0"];
|
|
25521
25557
|
}
|
|
25522
25558
|
const tokenStr = getTokenFromCookie();
|
|
25523
25559
|
const token2 = localStorage.getItem(TOKEN) || tokenStr;
|
|
@@ -25595,15 +25631,12 @@ axiosInstance.interceptors.response.use(
|
|
|
25595
25631
|
function sseForChat(config, events) {
|
|
25596
25632
|
var _a2;
|
|
25597
25633
|
let baseUrl = "";
|
|
25598
|
-
for (const [prefix2, baseURL] of Object.entries(API_PREFIX_MAP)) {
|
|
25634
|
+
for (const [prefix2, baseURL] of Object.entries(API_PREFIX_MAP(window.isRunInDev))) {
|
|
25599
25635
|
if ((_a2 = config.url) == null ? void 0 : _a2.startsWith(prefix2)) {
|
|
25600
25636
|
baseUrl = baseURL;
|
|
25601
25637
|
break;
|
|
25602
25638
|
}
|
|
25603
25639
|
}
|
|
25604
|
-
console.log("config.url", config.url);
|
|
25605
|
-
console.log("API_PREFIX_MAP", API_PREFIX_MAP);
|
|
25606
|
-
console.log("baseUrl", baseUrl);
|
|
25607
25640
|
let fullUrl = `${baseUrl}${config.url}`;
|
|
25608
25641
|
const token2 = localStorage.getItem(TOKEN);
|
|
25609
25642
|
const tokenStr = getTokenFromCookie();
|
|
@@ -59160,7 +59193,8 @@ const MessageContent = (props) => {
|
|
|
59160
59193
|
toCheckVideo,
|
|
59161
59194
|
recommendVideos,
|
|
59162
59195
|
handleSend,
|
|
59163
|
-
isTaskPage
|
|
59196
|
+
isTaskPage,
|
|
59197
|
+
isDev
|
|
59164
59198
|
} = props;
|
|
59165
59199
|
const [sessionToKnowledgeModalVisible, setSessionToKnowledgeModalVisible] = useState(false);
|
|
59166
59200
|
const [sessionToKnowledgeLoading, setSessionToKnowledgeLoading] = useState(false);
|
|
@@ -59263,8 +59297,11 @@ const MessageContent = (props) => {
|
|
|
59263
59297
|
setConfirmAnalyzeModalVisible == null ? void 0 : setConfirmAnalyzeModalVisible(true);
|
|
59264
59298
|
setAnalyzeMsgShouldSave == null ? void 0 : setAnalyzeMsgShouldSave(true);
|
|
59265
59299
|
};
|
|
59300
|
+
const vgenBaseUrl = useMemo$1(() => {
|
|
59301
|
+
return isDev ? devEnvUrl$1.VITE_BASE_VGEN_URL : proEnvUrl.VITE_BASE_VGEN_URL;
|
|
59302
|
+
}, [isDev, devEnvUrl$1, proEnvUrl]);
|
|
59266
59303
|
const toCheckStudyPath = (extraInfo) => {
|
|
59267
|
-
const url = `${
|
|
59304
|
+
const url = `${vgenBaseUrl}/editStudyPath/${extraInfo.id}`;
|
|
59268
59305
|
window.open(url, "_blank");
|
|
59269
59306
|
};
|
|
59270
59307
|
const toEditTask = (extraInfo) => {
|
|
@@ -59279,10 +59316,10 @@ const MessageContent = (props) => {
|
|
|
59279
59316
|
message.loading("视频获取中...");
|
|
59280
59317
|
const { viewDetail, shareUserId, recordId } = video;
|
|
59281
59318
|
if (viewDetail) {
|
|
59282
|
-
const url = `${
|
|
59319
|
+
const url = `${vgenBaseUrl}/mainPage?recordId=${recordId}`;
|
|
59283
59320
|
window.open(url, "_blank");
|
|
59284
59321
|
} else {
|
|
59285
|
-
const url = `${
|
|
59322
|
+
const url = `${vgenBaseUrl}/mainPage?recordId=${recordId}&fromShare=true&shareUserId=${shareUserId}`;
|
|
59286
59323
|
window.open(url, "_blank");
|
|
59287
59324
|
}
|
|
59288
59325
|
};
|
|
@@ -59481,8 +59518,8 @@ const MessageContent = (props) => {
|
|
|
59481
59518
|
"div",
|
|
59482
59519
|
{
|
|
59483
59520
|
className: cn(
|
|
59484
|
-
"w-full
|
|
59485
|
-
msg.role === "user" ? "bg-blue-600 text-white rounded-tr-none" : "bg-white text-gray-800 border border-gray-100 rounded-tl-none"
|
|
59521
|
+
"w-full px-4 rounded-[24px] text-[13px] leading-relaxed shadow-sm",
|
|
59522
|
+
msg.role === "user" ? "bg-blue-600 text-white rounded-tr-none" : "py-4 bg-white text-gray-800 border border-gray-100 rounded-tl-none"
|
|
59486
59523
|
),
|
|
59487
59524
|
children: [
|
|
59488
59525
|
msg.messageType === msgType.NODE && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 py-2 whitespace-pre-wrap break-words", children: msg.content }),
|
|
@@ -59827,7 +59864,7 @@ const MessageContent = (props) => {
|
|
|
59827
59864
|
"button",
|
|
59828
59865
|
{
|
|
59829
59866
|
onClick: () => {
|
|
59830
|
-
const url = `${
|
|
59867
|
+
const url = `${vgenBaseUrl}/studyMap/${extraInfo.id}`;
|
|
59831
59868
|
window.open(url, "_blank");
|
|
59832
59869
|
},
|
|
59833
59870
|
className: "bg-blue-600 hover:bg-blue-700 text-white rounded-xl h-9 px-4 font-bold text-xs gap-2",
|
|
@@ -59845,7 +59882,7 @@ const MessageContent = (props) => {
|
|
|
59845
59882
|
"button",
|
|
59846
59883
|
{
|
|
59847
59884
|
onClick: () => {
|
|
59848
|
-
const url = `${
|
|
59885
|
+
const url = `${vgenBaseUrl}/knowledgeDetailPage/${extraInfo.knowledgeId}`;
|
|
59849
59886
|
window.open(url, "_blank");
|
|
59850
59887
|
},
|
|
59851
59888
|
className: "bg-blue-600 hover:bg-blue-700 text-white rounded-xl h-9 px-4 font-bold text-xs gap-2",
|
|
@@ -61033,7 +61070,8 @@ const VgenAgent = forwardRef((props, ref) => {
|
|
|
61033
61070
|
videoInfo,
|
|
61034
61071
|
initPos,
|
|
61035
61072
|
initStyle,
|
|
61036
|
-
hoverTip
|
|
61073
|
+
hoverTip,
|
|
61074
|
+
isDev
|
|
61037
61075
|
} = props;
|
|
61038
61076
|
const [isLogin, setIsLogin] = useState(false);
|
|
61039
61077
|
const [isAiPanelOpen, setIsAiPanelOpen] = useState(false);
|
|
@@ -61069,6 +61107,11 @@ const VgenAgent = forwardRef((props, ref) => {
|
|
|
61069
61107
|
useImperativeHandle(ref, () => ({
|
|
61070
61108
|
setQuotedText: (val) => setQuotedText(val)
|
|
61071
61109
|
}));
|
|
61110
|
+
useEffect(() => {
|
|
61111
|
+
if (typeof window !== "undefined") {
|
|
61112
|
+
window.isRunInDev = isDev;
|
|
61113
|
+
}
|
|
61114
|
+
}, [isDev]);
|
|
61072
61115
|
useEffect(() => {
|
|
61073
61116
|
localStorage.setItem(TOKEN, token2);
|
|
61074
61117
|
toGetUserInfo();
|
|
@@ -61664,7 +61707,7 @@ const VgenAgent = forwardRef((props, ref) => {
|
|
|
61664
61707
|
const toCheckKnowledgeCard = (extraInfo) => {
|
|
61665
61708
|
};
|
|
61666
61709
|
const toCheckQuestions = (extraInfo) => {
|
|
61667
|
-
const url = `${
|
|
61710
|
+
const url = `${isDev ? devEnvUrl.VITE_BASE_VGEN_URL : proEnvUrl.VITE_BASE_VGEN_URL}?batchId=${extraInfo.batchId}&toPractice=true`;
|
|
61668
61711
|
window.open(url, "_blank");
|
|
61669
61712
|
};
|
|
61670
61713
|
const renderGeneratedResources = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 max-h-72 overflow-y-auto p-1 custom-scrollbar", children: generatedResources.length > 0 ? generatedResources.map((res) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -62073,7 +62116,8 @@ const VgenAgent = forwardRef((props, ref) => {
|
|
|
62073
62116
|
toCheckQuestions,
|
|
62074
62117
|
toCheckVideo,
|
|
62075
62118
|
recommendVideos,
|
|
62076
|
-
handleSend
|
|
62119
|
+
handleSend,
|
|
62120
|
+
isDev
|
|
62077
62121
|
}
|
|
62078
62122
|
) })
|
|
62079
62123
|
}
|
|
Binary file
|