acp-ts 1.0.1 → 1.0.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/cli.js +11 -11
- package/dist/server.js +5 -5
- package/package.json +1 -2
package/dist/cli.js
CHANGED
|
@@ -61,7 +61,7 @@ function update() {
|
|
|
61
61
|
const npm = getNpmCommand();
|
|
62
62
|
try {
|
|
63
63
|
// 获取最新版本号
|
|
64
|
-
const result = (0, child_process_1.spawnSync)(npm, ['view', '
|
|
64
|
+
const result = (0, child_process_1.spawnSync)(npm, ['view', 'acp-ts', 'version'], {
|
|
65
65
|
encoding: 'utf-8',
|
|
66
66
|
timeout: 30000
|
|
67
67
|
});
|
|
@@ -80,7 +80,7 @@ function update() {
|
|
|
80
80
|
console.log(`发现新版本 v${latestVersion},当前版本 v${currentVersion}`);
|
|
81
81
|
console.log('正在更新...');
|
|
82
82
|
// 执行全局更新
|
|
83
|
-
const installResult = (0, child_process_1.spawnSync)(npm, ['install', '-g', '
|
|
83
|
+
const installResult = (0, child_process_1.spawnSync)(npm, ['install', '-g', 'acp-ts@latest'], {
|
|
84
84
|
stdio: 'inherit',
|
|
85
85
|
shell: true
|
|
86
86
|
});
|
|
@@ -91,7 +91,7 @@ function update() {
|
|
|
91
91
|
// 可能是权限问题
|
|
92
92
|
if (!isWindows) {
|
|
93
93
|
console.log('\n更新失败,可能需要管理员权限,请尝试运行:');
|
|
94
|
-
console.log(' sudo npm install -g
|
|
94
|
+
console.log(' sudo npm install -g acp-ts@latest');
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
console.log('\n更新失败,请尝试以管理员身份运行命令提示符后重试');
|
|
@@ -114,7 +114,7 @@ for (let i = 0; i < args.length; i++) {
|
|
|
114
114
|
process.exit(0);
|
|
115
115
|
}
|
|
116
116
|
else if (args[i] === '-v' || args[i] === '--version') {
|
|
117
|
-
console.log(`
|
|
117
|
+
console.log(`acp-ts v${getVersion()}`);
|
|
118
118
|
process.exit(0);
|
|
119
119
|
}
|
|
120
120
|
else if (args[i] === '-p' || args[i] === '--port') {
|
|
@@ -127,11 +127,11 @@ for (let i = 0; i < args.length; i++) {
|
|
|
127
127
|
}
|
|
128
128
|
else if (args[i] === '-h' || args[i] === '--help') {
|
|
129
129
|
console.log(`
|
|
130
|
-
|
|
130
|
+
acp-ts - 智能体通信调试工具 v${getVersion()}
|
|
131
131
|
|
|
132
132
|
用法:
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
acp-ts [选项]
|
|
134
|
+
acp-ts update 更新到最新版本
|
|
135
135
|
|
|
136
136
|
选项:
|
|
137
137
|
-v, --version 显示版本号
|
|
@@ -140,12 +140,12 @@ agent-acp - 智能体通信调试工具 v${getVersion()}
|
|
|
140
140
|
-h, --help 显示帮助信息
|
|
141
141
|
|
|
142
142
|
安装:
|
|
143
|
-
npm install -g
|
|
143
|
+
npm install -g acp-ts
|
|
144
144
|
|
|
145
145
|
示例:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
acp-ts
|
|
147
|
+
acp-ts -p 8080
|
|
148
|
+
acp-ts update
|
|
149
149
|
`);
|
|
150
150
|
process.exit(0);
|
|
151
151
|
}
|
package/dist/server.js
CHANGED
|
@@ -68,7 +68,7 @@ const indexHtml = `<!DOCTYPE html>
|
|
|
68
68
|
<meta charset="UTF-8">
|
|
69
69
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
70
70
|
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
|
71
|
-
<title>
|
|
71
|
+
<title>acp-ts 智能体管理</title>
|
|
72
72
|
<style>
|
|
73
73
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
74
74
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; min-height: 100vh; display: flex; justify-content: center; align-items: center; }
|
|
@@ -103,7 +103,7 @@ const indexHtml = `<!DOCTYPE html>
|
|
|
103
103
|
</head>
|
|
104
104
|
<body>
|
|
105
105
|
<div class="container">
|
|
106
|
-
<h1>
|
|
106
|
+
<h1>acp-ts 智能体管理</h1>
|
|
107
107
|
|
|
108
108
|
<div class="aid-section" id="aidSection" style="display:none;">
|
|
109
109
|
<div class="aid-label">当前 AID</div>
|
|
@@ -232,7 +232,7 @@ const chatHtml = `<!DOCTYPE html>
|
|
|
232
232
|
<meta charset="UTF-8">
|
|
233
233
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
234
234
|
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
|
235
|
-
<title>
|
|
235
|
+
<title>acp-ts 聊天</title>
|
|
236
236
|
<style>
|
|
237
237
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
238
238
|
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; height: 100vh; display: flex; flex-direction: column; }
|
|
@@ -280,7 +280,7 @@ const chatHtml = `<!DOCTYPE html>
|
|
|
280
280
|
<body>
|
|
281
281
|
<div class="header">
|
|
282
282
|
<div>
|
|
283
|
-
<h1>
|
|
283
|
+
<h1>acp-ts 聊天</h1>
|
|
284
284
|
<div class="aid" id="myAid">加载中...</div>
|
|
285
285
|
</div>
|
|
286
286
|
<a href="/" class="back">返回</a>
|
|
@@ -866,7 +866,7 @@ function startServer(port, apiUrl) {
|
|
|
866
866
|
process.on('SIGINT', cleanup);
|
|
867
867
|
process.on('SIGTERM', cleanup);
|
|
868
868
|
server.listen(port, () => {
|
|
869
|
-
console.log(`\n
|
|
869
|
+
console.log(`\n acp-ts 调试服务已启动`);
|
|
870
870
|
console.log(` ─────────────────────────`);
|
|
871
871
|
console.log(` 本地地址: http://localhost:${port}`);
|
|
872
872
|
console.log(` API 服务: ${apiUrl}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acp-ts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "基于 WebSocket 的智能体通信库,提供智能体身份管理和实时通信功能",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@react-native-async-storage/async-storage": "^2.1.2",
|
|
35
35
|
"acp-ws-evol": "^1.0.0",
|
|
36
|
-
"agent-acp": "^1.0.0",
|
|
37
36
|
"axios": "^1.9.0",
|
|
38
37
|
"jsrsasign": "^11.1.0",
|
|
39
38
|
"mitt": "^3.0.1",
|