@optima-chat/optima-agent 0.1.0 → 0.1.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/README.md +57 -0
- package/package.json +7 -2
- package/.claude/settings.local.json +0 -13
package/README.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
基于 [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) 的电商运营 AI 助手。
|
|
4
4
|
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @optima-chat/optima-agent
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 认证
|
|
12
|
+
|
|
13
|
+
设置环境变量(推荐):
|
|
14
|
+
```bash
|
|
15
|
+
export ANTHROPIC_API_KEY=your-api-key
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
或使用 Claude Code 的认证(`~/.claude/`)。
|
|
19
|
+
|
|
5
20
|
## 架构
|
|
6
21
|
|
|
7
22
|
```
|
|
@@ -57,6 +72,48 @@ optima serve --port 3000
|
|
|
57
72
|
| optima-scout | scout-cli | 选品调研 |
|
|
58
73
|
| bi-cli | bi-cli | 数据分析 |
|
|
59
74
|
|
|
75
|
+
## 配置
|
|
76
|
+
|
|
77
|
+
在项目根目录创建配置文件:
|
|
78
|
+
|
|
79
|
+
**OPTIMA.json** - 配置选项
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
83
|
+
"maxTurns": 50,
|
|
84
|
+
"theme": "dark"
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**OPTIMA.md** - 自定义 System Prompt
|
|
89
|
+
```markdown
|
|
90
|
+
# 项目规则
|
|
91
|
+
|
|
92
|
+
- 使用简体中文
|
|
93
|
+
- 优先使用现有库存
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## API
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { OptimaAgent } from '@optima-chat/optima-agent';
|
|
100
|
+
|
|
101
|
+
const agent = new OptimaAgent({
|
|
102
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
103
|
+
maxTurns: 50,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// 单次对话
|
|
107
|
+
for await (const event of agent.chat('查看商品列表')) {
|
|
108
|
+
if (event.type === 'text') {
|
|
109
|
+
console.log(event.text);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// 重置会话
|
|
114
|
+
agent.reset();
|
|
115
|
+
```
|
|
116
|
+
|
|
60
117
|
## 文档
|
|
61
118
|
|
|
62
119
|
- [技术设计](./docs/design/README.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optima-chat/optima-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "基于 Claude Agent SDK 的电商运营 AI 助手",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -37,8 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@anthropic-ai/claude-agent-sdk": "^0.1.55",
|
|
40
|
+
"@optima-chat/bi-cli": "^0.2.0",
|
|
41
|
+
"@optima-chat/comfy-cli": "^0.7.2",
|
|
42
|
+
"@optima-chat/commerce-cli": "^1.5.0",
|
|
43
|
+
"@optima-chat/google-ads-cli": "^0.4.0",
|
|
44
|
+
"@optima-chat/scout-cli": "^0.1.10",
|
|
40
45
|
"gray-matter": "^4.0.3",
|
|
41
|
-
"ink": "^
|
|
46
|
+
"ink": "^5.2.1",
|
|
42
47
|
"ink-spinner": "^5.0.0",
|
|
43
48
|
"ink-text-input": "^6.0.0",
|
|
44
49
|
"react": "^19.2.0",
|