opc-agent 5.0.0-rc.21 → 5.0.0-rc.23
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/CHANGELOG.md +19 -0
- package/README.md +115 -147
- package/README.zh-CN.md +122 -142
- package/TASK.md +38 -42
- package/dist/cli.js +22 -31
- package/dist/cli.js.map +1 -1
- package/dist/core/agent.d.ts +9 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +23 -0
- package/dist/core/agent.js.map +1 -1
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +9 -0
- package/dist/core/runtime.js.map +1 -1
- package/dist/core/types.d.ts +1 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/scheduler/cron-engine.d.ts.map +1 -1
- package/dist/scheduler/cron-engine.js +3 -1
- package/dist/scheduler/cron-engine.js.map +1 -1
- package/dist/schema/oad.d.ts +155 -18
- package/dist/schema/oad.d.ts.map +1 -1
- package/dist/schema/oad.js +8 -1
- package/dist/schema/oad.js.map +1 -1
- package/dist/tools/builtin/index.d.ts +2 -0
- package/dist/tools/builtin/index.d.ts.map +1 -1
- package/dist/tools/builtin/index.js +8 -2
- package/dist/tools/builtin/index.js.map +1 -1
- package/dist/tools/builtin/read-file.d.ts +3 -0
- package/dist/tools/builtin/read-file.d.ts.map +1 -0
- package/dist/tools/builtin/read-file.js +126 -0
- package/dist/tools/builtin/read-file.js.map +1 -0
- package/dist/tools/builtin/write-file.d.ts +3 -0
- package/dist/tools/builtin/write-file.d.ts.map +1 -0
- package/dist/tools/builtin/write-file.js +95 -0
- package/dist/tools/builtin/write-file.js.map +1 -0
- package/dist/voice/tts.d.ts +8 -0
- package/dist/voice/tts.d.ts.map +1 -0
- package/dist/voice/tts.js +145 -0
- package/dist/voice/tts.js.map +1 -0
- package/package.json +1 -1
- package/AUDIT-TASK.md +0 -96
- package/COMPETITIVE-GAP.md +0 -92
- package/STUDIO-FIX-5678.md +0 -57
- package/STUDIO-FIX-ALL.md +0 -101
- package/STUDIO-REWRITE-TASK.md +0 -76
- package/TASK-STUDIO.md +0 -200
- package/templates/Dockerfile +0 -15
- package/templates/code-reviewer/README.md +0 -27
- package/templates/code-reviewer/oad.yaml +0 -41
- package/templates/customer-service/README.md +0 -22
- package/templates/customer-service/oad.yaml +0 -36
- package/templates/docker-compose.yml +0 -21
- package/templates/ecommerce-assistant/README.md +0 -45
- package/templates/ecommerce-assistant/oad.yaml +0 -47
- package/templates/knowledge-base/README.md +0 -28
- package/templates/knowledge-base/oad.yaml +0 -38
- package/templates/sales-assistant/README.md +0 -26
- package/templates/sales-assistant/oad.yaml +0 -43
- package/templates/tech-support/README.md +0 -43
- package/templates/tech-support/oad.yaml +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.0.0-rc.22] - 2026-04-24
|
|
4
|
+
|
|
5
|
+
### New Features
|
|
6
|
+
- **read_file / write_file** — Agent 可以直接读写本地文件,支持路径安全检查(防止逃逸 workspace)、100KB 读取上限、二进制检测、append 模式
|
|
7
|
+
- **语音合成 (Voice Reply)** — 集成 edge-tts,双通道实现(Python CLI + WebSocket 直连微软服务 fallback),默认中文语音 `zh-CN-XiaoxiaoNeural`
|
|
8
|
+
- **`opc voice test "<文字>"`** — CLI 语音测试命令
|
|
9
|
+
- **OAD Schema 扩展** — voice.tts 配置新增默认值(provider=edge-tts, voice=zh-CN-XiaoxiaoNeural, speed=1.0)
|
|
10
|
+
|
|
11
|
+
## [5.0.0-rc.21] - 2026-04-24
|
|
12
|
+
|
|
13
|
+
### New Features
|
|
14
|
+
- **MCP 完整集成** — MCPClientManager(连接外部 MCP Server)+ MCPServer(暴露 OPC Agent builtin tools 给外部 MCP Client)+ CLI `opc mcp list/test/serve`
|
|
15
|
+
- **spawn_subagents** — 并行子代理工具,支持多任务并行执行
|
|
16
|
+
- **Ollama Embedding Hybrid Search** — DeepBrain 语义搜索(FTS5 + Ollama cosine similarity)
|
|
17
|
+
- **execute_code** — JS/TS/Python 沙箱执行
|
|
18
|
+
- **Skill→Tool** — 自动将 Skill 文件转换为可调用的 Tool
|
|
19
|
+
- **Provider Failover 增强** — 含 gpt-4o-mini → Ollama-first 默认值修复
|
|
20
|
+
- **handleMessageStream pipeline 修复**
|
|
21
|
+
|
|
3
22
|
## [5.0.0-rc.14] - 2026-04-23
|
|
4
23
|
|
|
5
24
|
### New Features
|
package/README.md
CHANGED
|
@@ -1,218 +1,188 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
# ⚡ OPC Agent
|
|
3
|
+
# ⚡ OPC Agent
|
|
4
4
|
|
|
5
|
-
**Your AI
|
|
6
|
-
|
|
7
|
-
One computer. One command. Your own AI agents — learning, evolving, working 24/7.
|
|
5
|
+
**Your own AI employee — local, private, gets smarter over time.**
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/opc-agent)
|
|
10
8
|
[](LICENSE)
|
|
11
9
|
[](https://nodejs.org/)
|
|
12
|
-
[](CONTRIBUTING.md)
|
|
13
10
|
|
|
14
|
-
[
|
|
11
|
+
[中文文档](README.zh-CN.md)
|
|
15
12
|
|
|
16
13
|
</div>
|
|
17
14
|
|
|
18
15
|
---
|
|
19
16
|
|
|
20
|
-
##
|
|
17
|
+
## Why OPC Agent?
|
|
18
|
+
|
|
19
|
+
AI Agents are powerful, but hard to use for most people:
|
|
20
|
+
|
|
21
|
+
- **Expensive** — Cloud agents charge per token. Costs add up fast.
|
|
22
|
+
- **No memory** — Every conversation starts from scratch.
|
|
23
|
+
- **Data privacy** — Your chats and documents live on someone else's servers.
|
|
24
|
+
- **Can only chat** — Can't read files, search the web, or run code.
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
**OPC Agent fixes all of this:**
|
|
27
|
+
|
|
28
|
+
✅ Runs locally, zero cost (powered by Ollama)<br>
|
|
29
|
+
✅ Gets smarter over time (automatic learning & evolution)<br>
|
|
30
|
+
✅ Your data stays on your machine<br>
|
|
31
|
+
✅ Can read/write files, search the web, execute code, use tools
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 Install
|
|
36
|
+
|
|
37
|
+
Pick your OS, copy one line:
|
|
38
|
+
|
|
39
|
+
### macOS / Linux
|
|
23
40
|
|
|
24
41
|
```bash
|
|
25
|
-
# macOS / Linux
|
|
26
42
|
curl -fsSL https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.sh | bash
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Windows
|
|
27
46
|
|
|
28
|
-
|
|
47
|
+
```powershell
|
|
29
48
|
irm https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.ps1 | iex
|
|
30
49
|
```
|
|
31
50
|
|
|
32
|
-
|
|
51
|
+
> The installer automatically sets up Node.js, OPC Agent, Ollama, and the best AI model for your hardware. No manual steps.
|
|
33
52
|
|
|
34
|
-
###
|
|
53
|
+
### Manual install
|
|
35
54
|
|
|
36
55
|
```bash
|
|
37
56
|
npm install -g opc-agent@alpha
|
|
38
|
-
opc setup # Interactive setup wizard
|
|
39
57
|
```
|
|
40
58
|
|
|
41
|
-
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ⚡ Get started in 30 seconds
|
|
62
|
+
|
|
63
|
+
### Step 1: Create your AI employee
|
|
42
64
|
|
|
43
65
|
```bash
|
|
44
|
-
opc
|
|
45
|
-
|
|
46
|
-
opc run # Start everything: Agent + Telegram + Web + Studio
|
|
66
|
+
opc init my-agent
|
|
67
|
+
cd my-agent
|
|
47
68
|
```
|
|
48
69
|
|
|
49
|
-
|
|
70
|
+
### Step 2: Start chatting
|
|
50
71
|
|
|
51
|
-
|
|
72
|
+
```bash
|
|
73
|
+
opc chat
|
|
74
|
+
```
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
That's it. Your AI employee is ready.
|
|
54
77
|
|
|
55
|
-
|
|
56
|
-
- **Workstation Templates** — `opc init --template ceo-coach-socratic` scaffolds a fully-configured agent workspace in seconds. More templates in the registry.
|
|
57
|
-
- **Provider Failover** — Automatic LLM failover across OpenAI, Anthropic, Ollama, and others. Circuit-breaker + heartbeat monitoring. No dropped requests.
|
|
58
|
-
- **7-Layer System Prompt** — Context assembly is now deterministic and layered: base identity → EGO.md → SOUL.md → CONTEXT.md → memory → skills → history.
|
|
59
|
-
- **DeepBrain Recall** — Semantic memory is prefetched and injected into every conversation turn automatically.
|
|
60
|
-
- **Hybrid Search** — DeepBrain combines FTS5 full-text and vector semantic search for higher-recall knowledge retrieval.
|
|
61
|
-
- **1114+ tests passing** — Up from 204 in v2.
|
|
78
|
+
### More
|
|
62
79
|
|
|
63
|
-
|
|
80
|
+
```bash
|
|
81
|
+
opc studio # Web dashboard at localhost:4000
|
|
82
|
+
opc run # Start everything: chat + Telegram + web + dashboard
|
|
83
|
+
```
|
|
64
84
|
|
|
65
85
|
---
|
|
66
86
|
|
|
67
|
-
##
|
|
87
|
+
## What can it do?
|
|
68
88
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
89
|
+
OPC Agent isn't just a chatbot. It's an **AI employee that gets work done**:
|
|
90
|
+
|
|
91
|
+
| Capability | Details |
|
|
92
|
+
|-----------|---------|
|
|
93
|
+
| 💬 **Chat** | Terminal or web interface |
|
|
94
|
+
| 📁 **Read & write files** | Read your docs, write reports, organize notes |
|
|
95
|
+
| 🔍 **Web search** | Real-time search for up-to-date information |
|
|
96
|
+
| 🌐 **Read web pages** | Fetch and summarize any URL |
|
|
97
|
+
| 💻 **Execute code** | Run JavaScript, TypeScript, Python |
|
|
98
|
+
| 🧠 **Memory** | Remembers past conversations, gets smarter over time |
|
|
99
|
+
| 🔧 **MCP tool extensions** | Connect GitHub, databases, Slack, and more |
|
|
100
|
+
| 📱 **Telegram bot** | Add a bot token and chat via Telegram |
|
|
101
|
+
| 🎙 **Voice synthesis** | Text-to-speech via edge-tts |
|
|
102
|
+
| 👥 **Sub-agents** | Spawn parallel workers for complex tasks |
|
|
82
103
|
|
|
83
104
|
---
|
|
84
105
|
|
|
85
|
-
##
|
|
106
|
+
## 🧠 Gets smarter over time
|
|
107
|
+
|
|
108
|
+
This is what makes OPC Agent different: **it evolves.**
|
|
86
109
|
|
|
87
110
|
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
├──────────────────────────────────────────────────────┤
|
|
98
|
-
│ DeepBrain │ AgentKits │ Workstation │
|
|
99
|
-
│ (Knowledge) │ (Models + │ (Templates) │
|
|
100
|
-
│ SQLite+FTS5+Vector │ Failover) │ opc init │
|
|
101
|
-
├──────────────────────────────────────────────────────┤
|
|
102
|
-
│ Channels (OutputGuard applied to all) │
|
|
103
|
-
│ Telegram │ Web │ WeChat │ Feishu │ Discord │ Slack │
|
|
104
|
-
└──────────────────────────────────────────────────────┘
|
|
111
|
+
You chat with your AI
|
|
112
|
+
↓
|
|
113
|
+
AI extracts knowledge from the conversation ← automatic
|
|
114
|
+
↓
|
|
115
|
+
Knowledge is saved to a local database ← on your machine
|
|
116
|
+
↓
|
|
117
|
+
Next conversation references that knowledge ← it remembers
|
|
118
|
+
↓
|
|
119
|
+
Knowledge gradually refines and improves ← gets better over time
|
|
105
120
|
```
|
|
106
121
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
1. **You talk** → Agent receives message via any channel
|
|
110
|
-
2. **Agent thinks** → 7-layer context assembly + tool selection + LLM reasoning
|
|
111
|
-
3. **Agent acts** → Executes tools, calls APIs, generates content
|
|
112
|
-
4. **OutputGuard** → Sanitizes response through 6 rules before delivery
|
|
113
|
-
5. **Agent learns** → Every interaction feeds the evolution engine
|
|
114
|
-
6. **Agent evolves** → Knowledge distills upward: experience → memory → skills
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## 💻 CLI Commands
|
|
119
|
-
|
|
120
|
-
| Command | Description |
|
|
121
|
-
|---------|-------------|
|
|
122
|
-
| `opc setup` | Interactive setup wizard |
|
|
123
|
-
| `opc init [name]` | Create new agent project |
|
|
124
|
-
| `opc init --template <id>` | Scaffold agent from template (e.g. `ceo-coach-socratic`) |
|
|
125
|
-
| `opc chat` | Terminal chat with agent |
|
|
126
|
-
| `opc studio` | Open Studio web UI (port 4000) |
|
|
127
|
-
| `opc run` | Start all services (Agent + channels + Studio) |
|
|
128
|
-
| `opc brain stats` | Show knowledge base statistics |
|
|
129
|
-
| `opc brain recall <query>` | Semantic search in knowledge |
|
|
130
|
-
| `opc brain learn <file>` | Import document into knowledge |
|
|
131
|
-
| `opc doctor` | Diagnose installation issues |
|
|
122
|
+
All learning runs on local Ollama models. **Zero cost.**
|
|
132
123
|
|
|
133
124
|
---
|
|
134
125
|
|
|
135
|
-
##
|
|
126
|
+
## 🎨 Studio Dashboard
|
|
136
127
|
|
|
137
|
-
|
|
128
|
+
```bash
|
|
129
|
+
opc studio
|
|
130
|
+
```
|
|
138
131
|
|
|
139
|
-
|
|
140
|
-
- **Channels** — Configure Telegram bot, WeChat, Feishu, etc.
|
|
141
|
-
- **Knowledge** — Drag & drop documents, manage DeepBrain
|
|
142
|
-
- **Templates** — Browse industry/job/workstation templates
|
|
143
|
-
- **Agent Settings** — Edit personality, skills, model assignments
|
|
132
|
+
Open `localhost:4000` in your browser to:
|
|
144
133
|
|
|
145
|
-
|
|
134
|
+
- **Models** — Switch AI models (local or cloud)
|
|
135
|
+
- **Channels** — Configure Telegram bot
|
|
136
|
+
- **Knowledge** — See what your agent has learned
|
|
137
|
+
- **Settings** — Customize personality, skills, behavior
|
|
146
138
|
|
|
147
139
|
---
|
|
148
140
|
|
|
149
|
-
## 📖 Model
|
|
141
|
+
## 📖 Model support
|
|
142
|
+
|
|
143
|
+
### Local (zero cost)
|
|
150
144
|
|
|
151
|
-
|
|
152
|
-
Auto-detected and recommended based on your RAM:
|
|
145
|
+
Auto-recommended based on your RAM:
|
|
153
146
|
|
|
154
|
-
| RAM |
|
|
155
|
-
|
|
147
|
+
| RAM | Model | Download |
|
|
148
|
+
|-----|-------|----------|
|
|
156
149
|
| ≤3 GB | qwen2.5:0.5b | 400MB |
|
|
157
150
|
| ≤7 GB | qwen2.5:1.5b | 1.0GB |
|
|
158
151
|
| ≤15 GB | qwen2.5:7b | 4.7GB |
|
|
159
152
|
| ≤31 GB | qwen2.5:14b | 9.0GB |
|
|
160
153
|
| 32+ GB | qwen2.5:32b | 19GB |
|
|
161
154
|
|
|
162
|
-
### Cloud (
|
|
163
|
-
Configure in Studio → Models: OpenAI, DeepSeek, Anthropic, Qwen, Google Gemini
|
|
155
|
+
### Cloud (optional)
|
|
164
156
|
|
|
165
|
-
|
|
157
|
+
Add API keys in Studio: OpenAI, DeepSeek, Anthropic, Qwen, Google Gemini
|
|
166
158
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
## 🌐 Multi-Channel
|
|
170
|
-
|
|
171
|
-
| Channel | Setup |
|
|
172
|
-
|---------|-------|
|
|
173
|
-
| 💬 Web Chat | Built-in, localhost:3000 |
|
|
174
|
-
| 📱 Telegram | Add bot token in Studio |
|
|
175
|
-
| 💬 WeChat | Add app credentials in Studio |
|
|
176
|
-
| 🐦 Feishu | Add app credentials in Studio |
|
|
177
|
-
| 🎮 Discord | Add bot token in Studio |
|
|
178
|
-
| 💼 Slack | Add bot token in Studio |
|
|
179
|
-
| 📧 Email | Add SMTP config in Studio |
|
|
180
|
-
|
|
181
|
-
All channels run OutputGuard on every outbound message.
|
|
159
|
+
Automatic failover — if one provider goes down, the next one takes over.
|
|
182
160
|
|
|
183
161
|
---
|
|
184
162
|
|
|
185
|
-
##
|
|
186
|
-
|
|
187
|
-
OPC Agent gets smarter over time through 4 layers of evolution:
|
|
163
|
+
## 📋 Commands
|
|
188
164
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
165
|
+
| Command | What it does |
|
|
166
|
+
|---------|-------------|
|
|
167
|
+
| `opc init [name]` | Create an AI employee |
|
|
168
|
+
| `opc chat` | Chat in terminal |
|
|
169
|
+
| `opc studio` | Open web dashboard |
|
|
170
|
+
| `opc run` | Start all services |
|
|
171
|
+
| `opc brain stats` | Knowledge base status |
|
|
172
|
+
| `opc brain recall "query"` | Search knowledge |
|
|
173
|
+
| `opc brain learn file.md` | Import a document |
|
|
174
|
+
| `opc voice test "hello"` | Test voice synthesis |
|
|
175
|
+
| `opc mcp list` | List connected tools |
|
|
176
|
+
| `opc doctor` | Diagnose issues |
|
|
195
177
|
|
|
196
178
|
---
|
|
197
179
|
|
|
198
|
-
##
|
|
180
|
+
## 🔒 Privacy
|
|
199
181
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
my-agent/ # Agent workspace
|
|
206
|
-
EGO.md # Agent personality
|
|
207
|
-
SOUL.md # Tone and values
|
|
208
|
-
CONTEXT.md # Project context
|
|
209
|
-
DEEPBRAIN.md # Knowledge summary
|
|
210
|
-
oad.yaml # Agent definition
|
|
211
|
-
.opc/
|
|
212
|
-
brain.db # Knowledge database (SQLite + FTS5 + vector)
|
|
213
|
-
skills/ # Auto-generated skills
|
|
214
|
-
evolution/ # Evolution logs
|
|
215
|
-
```
|
|
182
|
+
- All data stored locally on your machine
|
|
183
|
+
- No telemetry
|
|
184
|
+
- Local Ollama models never touch the cloud
|
|
185
|
+
- Your knowledge, conversations, and files stay private
|
|
216
186
|
|
|
217
187
|
---
|
|
218
188
|
|
|
@@ -223,11 +193,9 @@ git clone https://github.com/Deepleaper/opc-agent.git
|
|
|
223
193
|
cd opc-agent
|
|
224
194
|
npm install
|
|
225
195
|
npx tsc # Build
|
|
226
|
-
npx vitest run # Test
|
|
196
|
+
npx vitest run # Test
|
|
227
197
|
```
|
|
228
198
|
|
|
229
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide.
|
|
230
|
-
|
|
231
199
|
---
|
|
232
200
|
|
|
233
201
|
## 📄 License
|
|
@@ -238,8 +206,8 @@ Apache-2.0 © [Deepleaper](https://github.com/Deepleaper)
|
|
|
238
206
|
|
|
239
207
|
<div align="center">
|
|
240
208
|
|
|
241
|
-
**Built by [Deepleaper](https://www.deepleaper.com)**
|
|
209
|
+
**Built by [Deepleaper](https://www.deepleaper.com)**
|
|
242
210
|
|
|
243
|
-
⭐ Star this repo if
|
|
211
|
+
⭐ Star this repo if it helps you!
|
|
244
212
|
|
|
245
213
|
</div>
|