@oscloudlab/vgen-agent-assistant 0.0.4 → 0.0.6

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.
Binary file
@@ -21509,6 +21509,7 @@ var msgType$1 = /* @__PURE__ */ ((msgType2) => {
21509
21509
  msgType2["RECOMMEND_VIDEO"] = "recommend_video";
21510
21510
  msgType2["LEARN_PATH_TREE"] = "learn_path_tree";
21511
21511
  msgType2["REL_LEARN_TASK"] = "rel_learn_task";
21512
+ msgType2["INVISIBLE_TEXT"] = "invisible_text";
21512
21513
  return msgType2;
21513
21514
  })(msgType$1 || {});
21514
21515
  var agentScene$1 = /* @__PURE__ */ ((agentScene2) => {
@@ -25600,6 +25601,9 @@ function sseForChat(config, events) {
25600
25601
  break;
25601
25602
  }
25602
25603
  }
25604
+ console.log("config.url", config.url);
25605
+ console.log("API_PREFIX_MAP", API_PREFIX_MAP);
25606
+ console.log("baseUrl", baseUrl);
25603
25607
  let fullUrl = `${baseUrl}${config.url}`;
25604
25608
  const token2 = localStorage.getItem(TOKEN);
25605
25609
  const tokenStr = getTokenFromCookie();
@@ -59477,7 +59481,7 @@ const MessageContent = (props) => {
59477
59481
  "div",
59478
59482
  {
59479
59483
  className: cn(
59480
- "w-full px-4 rounded-[24px] text-[13px] leading-relaxed shadow-sm",
59484
+ "w-full p-4 rounded-[24px] text-[13px] leading-relaxed shadow-sm",
59481
59485
  msg.role === "user" ? "bg-blue-600 text-white rounded-tr-none" : "bg-white text-gray-800 border border-gray-100 rounded-tl-none"
59482
59486
  ),
59483
59487
  children: [
@@ -61027,6 +61031,7 @@ const VgenAgent = forwardRef((props, ref) => {
61027
61031
  viewMode = "default",
61028
61032
  courseInfo,
61029
61033
  videoInfo,
61034
+ initPos,
61030
61035
  initStyle,
61031
61036
  hoverTip
61032
61037
  } = props;
@@ -61053,7 +61058,7 @@ const VgenAgent = forwardRef((props, ref) => {
61053
61058
  const [hasMoreBefore, setHasMoreBefore] = useState(false);
61054
61059
  const [oldestMessageId, setOldestMessageId] = useState(null);
61055
61060
  const [agentFormFields, setAgentFormFields] = useState([]);
61056
- const [enableGlobalSearch] = useState(false);
61061
+ const [enableGlobalSearch, setEnableGlobalSearch] = useState(false);
61057
61062
  const [isMoreActionsOpen, setIsMoreActionsOpen] = useState(false);
61058
61063
  const [quotedText, setQuotedText] = useState("");
61059
61064
  const [sessionList, setSessionList] = useState([]);
@@ -61103,7 +61108,13 @@ const VgenAgent = forwardRef((props, ref) => {
61103
61108
  currentPage: 1,
61104
61109
  pageSize: 20,
61105
61110
  dataBtype: 10,
61106
- dataId: videoInfo.recordId
61111
+ dataId: videoInfo.recordId,
61112
+ orders: [
61113
+ {
61114
+ key: "create_time",
61115
+ asc: false
61116
+ }
61117
+ ]
61107
61118
  }).then((res) => {
61108
61119
  if (!res.dataList.length) {
61109
61120
  createSession({
@@ -61112,6 +61123,7 @@ const VgenAgent = forwardRef((props, ref) => {
61112
61123
  dataId: videoInfo.recordId
61113
61124
  }).then((res2) => {
61114
61125
  setChatId(res2);
61126
+ sceneMsgSend(res2);
61115
61127
  toGetHistoryList(res2);
61116
61128
  });
61117
61129
  } else {
@@ -61833,6 +61845,20 @@ const VgenAgent = forwardRef((props, ref) => {
61833
61845
  }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-400", children: "暂无历史记录" }) })
61834
61846
  ] });
61835
61847
  }, [sessionList, chatId]);
61848
+ const sceneMsgSend = (chatIdHere) => {
61849
+ switch (viewMode) {
61850
+ case "video":
61851
+ saveMsg({
61852
+ role: "user",
61853
+ content: (videoInfo == null ? void 0 : videoInfo.description) || "",
61854
+ onlyPost: true,
61855
+ toPost: true,
61856
+ chatId: chatIdHere,
61857
+ messageType: msgType$1.INVISIBLE_TEXT
61858
+ });
61859
+ break;
61860
+ }
61861
+ };
61836
61862
  const addNewSession = () => {
61837
61863
  switch (viewMode) {
61838
61864
  case "video":
@@ -61842,6 +61868,7 @@ const VgenAgent = forwardRef((props, ref) => {
61842
61868
  dataId: videoInfo == null ? void 0 : videoInfo.recordId
61843
61869
  }).then((res) => {
61844
61870
  setChatId(res);
61871
+ sceneMsgSend(res);
61845
61872
  toGetHistoryList(res);
61846
61873
  getSessionListByBiz({
61847
61874
  currentPage: 1,
@@ -61888,12 +61915,23 @@ const VgenAgent = forwardRef((props, ref) => {
61888
61915
  },
61889
61916
  className: "fixed pointer-events-auto cursor-grab active:cursor-grabbing flex flex-col items-center justify-center group z-50",
61890
61917
  style: {
61891
- ...initStyle
61918
+ ...initPos
61892
61919
  },
61893
61920
  children: [
61894
61921
  /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: hoverTip || "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(motion.div, { className: "relative flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex flex-col items-center z-10", children: [
61895
61922
  /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: CookieLife, className: "w-24 h-24 select-none pointer-events-none", draggable: "false" }),
61896
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-7 bg-gradient-to-r from-blue-500 to-purple-600 text-white text-sm px-6 py-2 rounded-full font-bold shadow-lg shadow-blue-200 border border-white/30 whitespace-nowrap", children: "AI 学伴" })
61923
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
61924
+ "div",
61925
+ {
61926
+ className: "text-white text-[14px] px-6 py-2 rounded-full font-bold border border-white/30 whitespace-nowrap",
61927
+ style: {
61928
+ marginTop: "-28px",
61929
+ background: "linear-gradient(to right, #4461f2, #bc2df3)",
61930
+ boxShadow: "0 8px 20px rgba(68,97,242,0.3)"
61931
+ },
61932
+ children: "AI 学伴"
61933
+ }
61934
+ )
61897
61935
  ] }) }) }),
61898
61936
  /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})
61899
61937
  ]
@@ -61924,8 +61962,13 @@ const VgenAgent = forwardRef((props, ref) => {
61924
61962
  scale: 0.9,
61925
61963
  y: 50
61926
61964
  },
61927
- className: "fixed max-h-[90vh] pointer-events-auto w-[440px] h-[760px] bg-white rounded-2xl shadow-[0_20px_50px_rgba(0,0,0,0.15)] border border-gray-100 flex flex-col overflow-hidden cursor-default z-50",
61965
+ className: "fixed pointer-events-auto bg-white rounded-2xl border border-gray-100 flex flex-col overflow-hidden cursor-default z-50",
61928
61966
  style: {
61967
+ maxHeight: "90vh",
61968
+ width: "440px",
61969
+ height: "760px",
61970
+ boxShadow: "0 20px 50px rgba(0,0,0,0.15)",
61971
+ ...initPos,
61929
61972
  ...initStyle
61930
61973
  },
61931
61974
  children: [
@@ -62140,41 +62183,52 @@ const VgenAgent = forwardRef((props, ref) => {
62140
62183
  onClick: () => setIsMoreActionsOpen(false)
62141
62184
  }
62142
62185
  ),
62143
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute bottom-full right-0 mb-2 w-48 bg-white rounded-xl shadow-[0_10px_30px_rgba(0,0,0,0.2)] border border-gray-100 p-2 z-[60] animate-in fade-in slide-in-from-bottom-2 duration-200", children: [
62144
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] font-bold text-gray-400 px-2 py-1 mb-1 uppercase", children: "Vgen 进阶功能" }),
62145
- [
62146
- {
62147
- label: "生成学习路径",
62148
- desc: "帮我生成学习路径",
62149
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(GitBranch, { className: "w-3.5 h-3.5" }),
62150
- color: "text-blue-500"
62186
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
62187
+ "div",
62188
+ {
62189
+ className: "absolute mb-2 w-48 bg-white rounded-xl border border-gray-100 p-2 z-[60] animate-in fade-in slide-in-from-bottom-2 duration-200",
62190
+ style: {
62191
+ boxShadow: "0 10px 30px rgba(0,0,0,0.2)",
62192
+ right: "0",
62193
+ bottom: "30px"
62151
62194
  },
62152
- {
62153
- label: "AI智能出题",
62154
- desc: "帮我出三道练习题",
62155
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FileCode, { className: "w-3.5 h-3.5" }),
62156
- color: "text-indigo-500"
62157
- }
62158
- // {
62159
- // label: "能力测评",
62160
- // icon: <Trophy className="w-3.5 h-3.5" />,
62161
- // color: "text-amber-500",
62162
- // },
62163
- ].map((link2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
62164
- "button",
62165
- {
62166
- onClick: () => {
62167
- handleSend({ input: link2.desc });
62168
- },
62169
- className: "w-full flex items-center gap-2.5 px-2 py-2 rounded-lg hover:bg-gray-50 text-[12px] text-gray-600 transition-colors",
62170
- children: [
62171
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: link2.color, children: link2.icon }),
62195
+ children: [
62196
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] font-bold text-gray-400 px-2 py-1 mb-1 uppercase", children: "Vgen 进阶功能" }),
62197
+ [
62198
+ {
62199
+ label: "生成学习路径",
62200
+ desc: "帮我生成学习路径",
62201
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(GitBranch, { className: "w-3.5 h-3.5" }),
62202
+ color: "text-blue-500"
62203
+ },
62204
+ {
62205
+ label: "AI智能出题",
62206
+ desc: "帮我出三道练习题",
62207
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FileCode, { className: "w-3.5 h-3.5" }),
62208
+ color: "text-indigo-500"
62209
+ }
62210
+ // {
62211
+ // label: "能力测评",
62212
+ // icon: <Trophy className="w-3.5 h-3.5" />,
62213
+ // color: "text-amber-500",
62214
+ // },
62215
+ ].map((link2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
62216
+ "button",
62217
+ {
62218
+ onClick: () => {
62219
+ handleSend({ input: link2.desc });
62220
+ },
62221
+ className: "w-full flex items-center gap-2.5 px-2 py-2 rounded-lg hover:bg-gray-50 text-[12px] text-gray-600 transition-colors",
62222
+ children: [
62223
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: link2.color, children: link2.icon }),
62224
+ link2.label
62225
+ ]
62226
+ },
62172
62227
  link2.label
62173
- ]
62174
- },
62175
- link2.label
62176
- ))
62177
- ] })
62228
+ ))
62229
+ ]
62230
+ }
62231
+ )
62178
62232
  ] })
62179
62233
  ] })
62180
62234
  ] }) }),
@@ -62197,19 +62251,28 @@ const VgenAgent = forwardRef((props, ref) => {
62197
62251
  )
62198
62252
  ] }),
62199
62253
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex items-center gap-2", children: [
62200
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full px-4 pb-1 pt-1.5 bg-white rounded-[12px] cursor-text border border-gray-100 focus-within:border-blue-200 transition-all overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62201
- TagsTextarea,
62254
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
62255
+ "div",
62202
62256
  {
62203
- minHeight: 30,
62204
- maxHeight: 120,
62205
- onChange: tagsTextareaValueChange,
62206
- placeholder: inputPlaceholder,
62207
- sendMsg: () => {
62208
- handleSend({ input: inputValue });
62257
+ className: "w-full px-4 pb-1 pt-1.5 bg-white rounded-[12px] cursor-text border border-gray-100 focus-within:border-blue-200 transition-all overflow-hidden",
62258
+ style: {
62259
+ paddingTop: "6px"
62209
62260
  },
62210
- ref: tagsTextareaRef
62261
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62262
+ TagsTextarea,
62263
+ {
62264
+ minHeight: 30,
62265
+ maxHeight: 120,
62266
+ onChange: tagsTextareaValueChange,
62267
+ placeholder: inputPlaceholder,
62268
+ sendMsg: () => {
62269
+ handleSend({ input: inputValue });
62270
+ },
62271
+ ref: tagsTextareaRef
62272
+ }
62273
+ )
62211
62274
  }
62212
- ) }),
62275
+ ),
62213
62276
  answerIsDone ? /* @__PURE__ */ jsxRuntimeExports.jsx(
62214
62277
  Button,
62215
62278
  {
Binary file