@zero-library/chat-copilot 1.0.7 → 1.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/index.cjs.js +77 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +22 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +80 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs.js
CHANGED
|
@@ -503,13 +503,6 @@ function createChatStore() {
|
|
|
503
503
|
const getModels = async () => {
|
|
504
504
|
const { data } = await config.services.request.fetchModelList();
|
|
505
505
|
config.models = data;
|
|
506
|
-
if (data?.length) {
|
|
507
|
-
setAgentModel({
|
|
508
|
-
providerName: data[0].providerName,
|
|
509
|
-
modelName: data[0].models[0].modelName,
|
|
510
|
-
reasoning: true
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
506
|
};
|
|
514
507
|
const setServices = ({ http, websocket } = {}) => {
|
|
515
508
|
const httpConfig = { baseURL: "/luya/v1", headers: { [TOKEN_KEY]: tokenManager.get() }, ...http?.config };
|
|
@@ -590,7 +583,7 @@ function createChatStore() {
|
|
|
590
583
|
loading: false
|
|
591
584
|
});
|
|
592
585
|
const setAgentModel = (model) => {
|
|
593
|
-
agent.model = model;
|
|
586
|
+
agent.model = { ...agent.model, ...model };
|
|
594
587
|
};
|
|
595
588
|
const getUserInput = async (agentId) => {
|
|
596
589
|
agent.loading = true;
|
|
@@ -605,6 +598,12 @@ function createChatStore() {
|
|
|
605
598
|
};
|
|
606
599
|
const setAgent = (agentInfo) => {
|
|
607
600
|
agent.agentInfo = agentInfo;
|
|
601
|
+
if (agentInfo.agentType === 2 /* AUTONOMOUS */) {
|
|
602
|
+
setAgentModel({
|
|
603
|
+
modelName: agent.agentInfo.spec?.model?.modelName || "",
|
|
604
|
+
providerName: agent.agentInfo.spec?.model?.providerName || ""
|
|
605
|
+
});
|
|
606
|
+
}
|
|
608
607
|
};
|
|
609
608
|
const setUserInput = (userInput) => {
|
|
610
609
|
if (config.params?.convMeta?.mode === CONV_MODE.PROD && agent.agentInfo.agentType === 1 /* FLOW */) {
|
|
@@ -619,6 +618,12 @@ function createChatStore() {
|
|
|
619
618
|
try {
|
|
620
619
|
const { data } = await config.services.request.fetchAgentInfo(id || "");
|
|
621
620
|
agent.agentInfo = data;
|
|
621
|
+
if (agent.agentInfo.agentType === 2 /* AUTONOMOUS */) {
|
|
622
|
+
setAgentModel({
|
|
623
|
+
modelName: agent.agentInfo.spec?.model?.modelName || "",
|
|
624
|
+
providerName: agent.agentInfo.spec?.model?.providerName || ""
|
|
625
|
+
});
|
|
626
|
+
}
|
|
622
627
|
config.hooks?.onAfterSwitchAgent?.(data);
|
|
623
628
|
} finally {
|
|
624
629
|
config.loading = false;
|
|
@@ -1940,7 +1945,10 @@ var styles_module_default3 = {
|
|
|
1940
1945
|
fileEdit: "styles_module_fileEdit",
|
|
1941
1946
|
fileEditHeader: "styles_module_fileEditHeader",
|
|
1942
1947
|
fileEditContent: "styles_module_fileEditContent",
|
|
1943
|
-
mdEdit: "styles_module_mdEdit"
|
|
1948
|
+
mdEdit: "styles_module_mdEdit",
|
|
1949
|
+
chart: "styles_module_chart",
|
|
1950
|
+
chartSkeleton: "styles_module_chartSkeleton",
|
|
1951
|
+
chartSkeletonIcon: "styles_module_chartSkeletonIcon"
|
|
1944
1952
|
};
|
|
1945
1953
|
var AppCard_default = ({ data, loading }) => {
|
|
1946
1954
|
const chatStore = useChatStore();
|
|
@@ -1958,6 +1966,65 @@ var AppCard_default = ({ data, loading }) => {
|
|
|
1958
1966
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-ellipsis", title: data.appName, children: data.appName })
|
|
1959
1967
|
] }) });
|
|
1960
1968
|
};
|
|
1969
|
+
var chartTypes = [
|
|
1970
|
+
"Line",
|
|
1971
|
+
"Column",
|
|
1972
|
+
"Bar",
|
|
1973
|
+
"Area",
|
|
1974
|
+
"Pie",
|
|
1975
|
+
"DualAxes",
|
|
1976
|
+
"Scatter",
|
|
1977
|
+
"WordCloud",
|
|
1978
|
+
"Funnel",
|
|
1979
|
+
"Heatmap",
|
|
1980
|
+
"Histogram",
|
|
1981
|
+
"Liquid",
|
|
1982
|
+
"BidirectionalBar",
|
|
1983
|
+
"Box",
|
|
1984
|
+
"Bullet",
|
|
1985
|
+
"CirclePacking",
|
|
1986
|
+
"Gauge",
|
|
1987
|
+
"Radar",
|
|
1988
|
+
"Rose",
|
|
1989
|
+
"Sankey",
|
|
1990
|
+
"Stock",
|
|
1991
|
+
"Sunburst",
|
|
1992
|
+
"Treemap",
|
|
1993
|
+
"Venn",
|
|
1994
|
+
"Waterfall",
|
|
1995
|
+
"MindMap",
|
|
1996
|
+
"Fishbone",
|
|
1997
|
+
"IndentedTree",
|
|
1998
|
+
"Dendrogram",
|
|
1999
|
+
"OrganizationChart",
|
|
2000
|
+
"FlowGraph",
|
|
2001
|
+
"FlowDirectionGraph",
|
|
2002
|
+
"NetworkGraph"
|
|
2003
|
+
// …如果还有其他图表也继续加
|
|
2004
|
+
];
|
|
2005
|
+
var CHART_COMPONENTS = Object.fromEntries(
|
|
2006
|
+
chartTypes.map((type) => [
|
|
2007
|
+
type,
|
|
2008
|
+
() => import('@ant-design/charts').then((mod) => ({
|
|
2009
|
+
default: mod[type]
|
|
2010
|
+
}))
|
|
2011
|
+
])
|
|
2012
|
+
);
|
|
2013
|
+
var Charts_default = ({ data, loading }) => {
|
|
2014
|
+
const { type, config } = data;
|
|
2015
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
|
|
2016
|
+
// Antd 骨架屏
|
|
2017
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default3.chartSkeleton, children: /* @__PURE__ */ jsxRuntime.jsx(icons.DotChartOutlined, { className: styles_module_default3.chartSkeletonIcon }) })
|
|
2018
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2019
|
+
common.LazyComponent,
|
|
2020
|
+
{
|
|
2021
|
+
type,
|
|
2022
|
+
...config,
|
|
2023
|
+
customComponents: CHART_COMPONENTS,
|
|
2024
|
+
unknownContent: /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { title: "\u4E0D\u652F\u6301\u7684\u56FE\u8868", description: `\u5F53\u524D\u56FE\u8868\u7C7B\u578B "${type}" \u6682\u672A\u5B9E\u73B0\uFF0C\u8BF7\u68C0\u67E5\u56FE\u8868\u7C7B\u578B\u662F\u5426\u6B63\u786E\u3002`, type: "warning", showIcon: true })
|
|
2025
|
+
}
|
|
2026
|
+
) });
|
|
2027
|
+
};
|
|
1961
2028
|
var CodeHighlight_default = ({ className, data }) => {
|
|
1962
2029
|
const lang = className?.match(/language-(\w+)/)?.[1] || "";
|
|
1963
2030
|
if (typeof data !== "string") return null;
|
|
@@ -2118,6 +2185,7 @@ var XMarkdown_default = ({ message: message3, components, content, ...rest }) =>
|
|
|
2118
2185
|
a: PreviewLink_default,
|
|
2119
2186
|
appcard: AppCard_default,
|
|
2120
2187
|
fileview: FileView_default,
|
|
2188
|
+
charts: Charts_default,
|
|
2121
2189
|
// indexquote: IndexQuote,
|
|
2122
2190
|
mdedit: MdEdit_default,
|
|
2123
2191
|
fileedit: FileEdit_default,
|