@agentscope-ai/chat 1.1.28 → 1.1.29

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/bin/cli.bundle.js CHANGED
@@ -3063,12 +3063,15 @@ async function startServer() {
3063
3063
  host: "127.0.0.1"
3064
3064
  },
3065
3065
  resolve: {
3066
- dedupe: ["react", "react-dom"],
3067
3066
  alias: {
3068
3067
  "@agentscope-ai/chat": path.resolve(projectRoot, "lib/index.js")
3069
3068
  }
3070
3069
  },
3070
+ // 将 React 标记为外部依赖,使用 UMD 全局变量
3071
3071
  build: {
3072
+ rollupOptions: {
3073
+ external: ["react", "react-dom", "react/jsx-runtime", "react-dom/client"]
3074
+ },
3072
3075
  commonjsOptions: {
3073
3076
  include: [/node_modules/],
3074
3077
  transformMixedEsModules: true
package/bin/cli.js CHANGED
@@ -38,13 +38,15 @@ async function startServer() {
38
38
  host: '127.0.0.1',
39
39
  },
40
40
  resolve: {
41
- dedupe: ['react', 'react-dom'],
42
41
  alias: {
43
42
  '@agentscope-ai/chat': path.resolve(projectRoot, 'lib/index.js'),
44
43
  }
45
44
  },
46
-
45
+ // 将 React 标记为外部依赖,使用 UMD 全局变量
47
46
  build: {
47
+ rollupOptions: {
48
+ external: ['react', 'react-dom', 'react/jsx-runtime', 'react-dom/client'],
49
+ },
48
50
  commonjsOptions: {
49
51
  include: [/node_modules/],
50
52
  transformMixedEsModules: true
package/bin/client.js CHANGED
@@ -1,8 +1,7 @@
1
- import * as React from 'react';
2
- import * as ReactDOM from 'react-dom/client';
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
3
  import Chat from '../lib/AgentScopeRuntimeWebUI/starter';
4
4
 
5
-
6
5
  // 从 window 对象获取配置
7
6
  const config = window.__AGENTSCOPE_CONFIG__ || {};
8
7
 
package/bin/template.html CHANGED
@@ -4,6 +4,9 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>AgentScope Runtime WebUI</title>
7
+ <!-- 使用 UMD 版本的 React,避免依赖 node_modules -->
8
+ <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
9
+ <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
7
10
  <style>
8
11
  * {
9
12
  margin: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/chat",
3
- "version": "1.1.28",
3
+ "version": "1.1.29",
4
4
  "description": "a free and open-source chat framework for building excellent LLM-powered chat experiences",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": [
@@ -105,9 +105,7 @@
105
105
  "xstate": "^5.19.4",
106
106
  "zustand": "^5.0.3",
107
107
  "vite": "^5.4.11",
108
- "antd": "^5.18.0",
109
- "react": "^18.0.0",
110
- "react-dom": "^18.0.0"
108
+ "antd": "^5.18.0"
111
109
  },
112
110
  "devDependencies": {
113
111
  "@agentscope-ai/dumi-theme-spark": "0.0.98",
@@ -125,6 +123,8 @@
125
123
  "dumi": "^2.4.13",
126
124
  "esbuild": "^0.19.12",
127
125
  "eslint": "^8.23.0",
126
+ "react": "^18.0.0",
127
+ "react-dom": "^18.0.0",
128
128
  "father": "^4.1.0",
129
129
  "husky": "^8.0.1",
130
130
  "lint-staged": "^13.0.3",