opc-agent 1.0.0 โ†’ 1.1.1

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to OPC Agent will be documented in this file.
4
4
 
5
+ ## [1.1.0] - 2026-04-16
6
+
7
+ ### Added
8
+ - **Feishu/Lark Channel**: Full Feishu bot integration with event subscription webhook, tenant access token caching, text & interactive card messaging, group + P2P support. Also works with Lark international via `apiBase` config. (`src/channels/feishu.ts`)
9
+ - **Discord Channel**: Discord bot via Gateway WebSocket with auto-reconnect, heartbeat, message content intent, and 2000-char message splitting. (`src/channels/discord.ts`)
10
+ - **ProcessWatcher**: Background process output monitoring with regex pattern matching โ€” watch stdout/stderr for specific patterns (errors, "server ready", build completion) and get instant callbacks without polling. Supports `once` patterns, match history, and dynamic pattern add/remove. Inspired by Hermes Agent's `watch_patterns`. (`src/core/watch.ts`)
11
+
5
12
  ## [0.2.0] - 2026-04-15
6
13
 
7
14
  ### Added
package/README.md CHANGED
@@ -1,39 +1,46 @@
1
1
  <p align="center">
2
2
  <h1 align="center">๐Ÿค– OPC Agent</h1>
3
+ <p align="center"><strong>ๅผ€ๆ”พๆ™บ่ƒฝไฝ“ๆก†ๆžถ โ€” ๆž„ๅปบใ€ๆต‹่ฏ•ใ€่ฟ่กŒไผไธš็บง AI ๆ™บ่ƒฝไฝ“</strong></p>
3
4
  <p align="center"><strong>Open Agent Framework โ€” Build, test, and run AI Agents for business workstations</strong></p>
4
5
  <p align="center">
5
6
  <a href="https://www.npmjs.com/package/opc-agent"><img src="https://img.shields.io/npm/v/opc-agent?color=blue" alt="npm"></a>
6
- <a href="https://github.com/anthropic-lab/opc-agent/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="license"></a>
7
- <a href="https://github.com/anthropic-lab/opc-agent/actions"><img src="https://img.shields.io/badge/tests-passing-brightgreen" alt="tests"></a>
7
+ <a href="https://github.com/Deepleaper/opc-agent/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="license"></a>
8
+ <a href="https://github.com/Deepleaper/opc-agent/actions"><img src="https://img.shields.io/badge/tests-passing-brightgreen" alt="tests"></a>
8
9
  <a href="https://www.npmjs.com/package/opc-agent"><img src="https://img.shields.io/npm/dm/opc-agent?color=orange" alt="downloads"></a>
9
10
  </p>
11
+ <p align="center">
12
+ <a href="#-ไธญๆ–‡ๆ–‡ๆกฃ">๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡</a> ยท <a href="#-english-documentation">๐Ÿ‡บ๐Ÿ‡ธ English</a> ยท <a href="./README.zh-CN.md">ๅฎŒๆ•ดไธญๆ–‡ๆ–‡ๆกฃ</a>
13
+ </p>
10
14
  </p>
11
15
 
12
16
  ---
13
17
 
14
- OPC Agent is a **TypeScript-first framework** for building production AI agents. Define your agent in a single YAML file (OAD โ€” Open Agent Definition), connect any LLM provider, deploy to any channel.
18
+ # ๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ๆ–‡ๆกฃ
15
19
 
16
- ## โšก Quick Start (30 seconds)
20
+ OPC Agent ๆ˜ฏไธ€ไธช **TypeScript ไผ˜ๅ…ˆ็š„ๅผ€ๆ”พๆ™บ่ƒฝไฝ“ๆก†ๆžถ**๏ผŒ็”ฑ[่ทƒ็›Ÿ็ง‘ๆŠ€ (Deepleaper)](https://www.deepleaper.com) ๅผ€ๅ‘ใ€‚็”จไธ€ไธช YAML ๆ–‡ไปถๅฎšไน‰ๆ™บ่ƒฝไฝ“๏ผŒๆŽฅๅ…ฅไปปๆ„ๅคง่ฏญ่จ€ๆจกๅž‹๏ผŒไธ€้”ฎ้ƒจ็ฝฒๅˆฐๅคšไธชๆธ ้“ใ€‚ๅผ€็ฎฑๅณ็”จ๏ผŒ็”Ÿไบงๅฏ็”จใ€‚
21
+
22
+ ## โšก ๅฟซ้€Ÿๅผ€ๅง‹๏ผˆ30 ็ง’๏ผ‰
17
23
 
18
24
  ```bash
19
- # Install
25
+ # ๅฎ‰่ฃ…
20
26
  npm install -g opc-agent
21
27
 
22
- # Create your first agent
28
+ # ๅˆ›ๅปบไฝ ็š„็ฌฌไธ€ไธชๆ™บ่ƒฝไฝ“
23
29
  opc init my-agent
24
30
  cd my-agent
25
31
 
26
- # Run it
32
+ # ๅฏๅŠจ
27
33
  opc run
28
34
  ```
29
35
 
30
- Your agent is now live at `http://localhost:3000` with a beautiful web chat UI.
36
+ ๆ™บ่ƒฝไฝ“ๅทฒๅœจ `http://localhost:3000` ไธŠ่ฟ่กŒ๏ผŒ่‡ชๅธฆ Web ๅฏน่ฏ็•Œ้ขใ€‚
31
37
 
32
- ## โœจ Features
38
+ ## โœจ ๅŠŸ่ƒฝ็‰นๆ€ง
39
+
40
+ ### ๐Ÿ”Œ ๅคšๆจกๅž‹ไพ›ๅบ”ๅ•†
33
41
 
34
- ### ๐Ÿ”Œ Multi-Provider LLM Support
35
42
  ```yaml
36
- # oad.yaml
43
+ # oad.yaml โ€” ๆ™บ่ƒฝไฝ“ๅฎšไน‰ๆ–‡ไปถ
37
44
  spec:
38
45
  provider:
39
46
  default: deepseek
@@ -41,81 +48,239 @@ spec:
41
48
  model: deepseek-chat
42
49
  ```
43
50
 
44
- Supports **OpenAI**, **DeepSeek**, **Anthropic**, **Qwen**, **Ollama** (local), and any OpenAI-compatible API.
51
+ ๆ”ฏๆŒ **DeepSeek**ใ€**้€šไน‰ๅƒ้—ฎ (Qwen)**ใ€**OpenAI**ใ€**Anthropic**ใ€**Ollama**๏ผˆๆœฌๅœฐ้ƒจ็ฝฒ๏ผ‰๏ผŒไปฅๅŠไปปไฝ•ๅ…ผๅฎน OpenAI ๆŽฅๅฃ็š„ๆœๅŠกใ€‚
52
+
53
+ ### ๐Ÿ“ก ๅคšๆธ ้“้ƒจ็ฝฒ
45
54
 
46
- ### ๐Ÿ“ก Multi-Channel Deployment
47
55
  ```yaml
48
56
  spec:
49
57
  channels:
50
- - type: web # Beautiful chat UI
58
+ - type: web # Web ๅฏน่ฏ็•Œ้ข
51
59
  port: 3000
52
- - type: telegram # Telegram bot
53
- - type: websocket # Real-time WebSocket
54
- - type: slack # Slack integration
55
- - type: email # Email channel
56
- - type: wechat # WeChat Official Account
57
- - type: voice # Voice (STT/TTS)
58
- - type: webhook # Incoming webhooks
60
+ - type: telegram # Telegram ๆœบๅ™จไบบ
61
+ - type: websocket # ๅฎžๆ—ถ WebSocket
62
+ - type: slack # Slack ้›†ๆˆ
63
+ - type: email # ้‚ฎไปถๆธ ้“
64
+ - type: wechat # ๅพฎไฟกๅ…ฌไผ—ๅท
65
+ - type: feishu # ้ฃžไนฆ
66
+ - type: voice # ่ฏญ้Ÿณ๏ผˆSTT/TTS๏ผ‰
67
+ - type: webhook # Webhook ๅ›ž่ฐƒ
59
68
  ```
60
69
 
61
- ### ๐Ÿง  Knowledge Base (RAG)
70
+ ### ๐Ÿง  ็Ÿฅ่ฏ†ๅบ“๏ผˆRAG๏ผ‰
71
+
62
72
  ```typescript
63
73
  import { KnowledgeBase } from 'opc-agent';
64
74
 
65
75
  const kb = new KnowledgeBase('./docs');
66
- await kb.addFile('product-manual.pdf');
67
- // Agent automatically uses KB for context
76
+ await kb.addFile('ไบงๅ“ๆ‰‹ๅ†Œ.pdf');
77
+ // ๆ™บ่ƒฝไฝ“่‡ชๅŠจไฝฟ็”จ็Ÿฅ่ฏ†ๅบ“ๅขžๅผบๅ›ž็ญ”
78
+ ```
79
+
80
+ ### ๐ŸŽญ ๅคšๆ™บ่ƒฝไฝ“็ผ–ๆŽ’
81
+
82
+ ```typescript
83
+ import { Orchestrator } from 'opc-agent';
84
+
85
+ const orchestrator = new Orchestrator({
86
+ agents: [ๅˆ†่ฏŠๆ™บ่ƒฝไฝ“, ้”€ๅ”ฎๆ™บ่ƒฝไฝ“, ๅฎขๆœๆ™บ่ƒฝไฝ“],
87
+ strategy: 'route-by-intent', // ๆŒ‰ๆ„ๅ›พ่ทฏ็”ฑ
88
+ });
89
+ ```
90
+
91
+ ### ๐Ÿงช ๅ†…็ฝฎๆต‹่ฏ•ๆก†ๆžถ
92
+
93
+ ```bash
94
+ opc test # ่ฟ่กŒๆต‹่ฏ•็”จไพ‹
95
+ opc test --watch # ็›‘ๅฌๆจกๅผ
96
+ ```
97
+
98
+ ```yaml
99
+ # ๅœจ oad.yaml ไธญๅฎšไน‰ๆต‹่ฏ•
100
+ spec:
101
+ testing:
102
+ cases:
103
+ - name: ้—ฎๅ€™ๆต‹่ฏ•
104
+ input: "ไฝ ๅฅฝ"
105
+ expect:
106
+ contains: ["ไฝ ๅฅฝ", "ๅธฎ"]
107
+ maxLatencyMs: 5000
68
108
  ```
69
109
 
70
- ### ๐Ÿ”ง Plugin System
110
+ ### ๐Ÿ”ง ๆ’ไปถ็ณป็ปŸ
111
+
71
112
  ```yaml
72
113
  spec:
73
114
  plugins:
74
- - name: logging
75
- - name: analytics
76
- - name: rate-limit
115
+ - name: logging # ๆ—ฅๅฟ—
116
+ - name: analytics # ๆ•ฐๆฎๅˆ†ๆž
117
+ - name: rate-limit # ้™ๆต
77
118
  config: { maxPerMinute: 60 }
78
119
  ```
79
120
 
80
- Built-in plugins: `logging`, `analytics`, `rate-limit`. Custom plugins support lifecycle hooks: `onInit`, `onMessage`, `onResponse`, `onError`, `onShutdown`.
121
+ ### ๐Ÿ”’ ๅฎ‰ๅ…จ็‰นๆ€ง
122
+
123
+ - ่พ“ๅ…ฅๆถˆๆฏ’๏ผˆ้˜ฒ XSSใ€ๆณจๅ…ฅๆ”ปๅ‡ป๏ผ‰
124
+ - API Key ่ฝฎๆข็ฎก็†
125
+ - CORS ้…็ฝฎ
126
+ - ๅฎ‰ๅ…จๅ“ๅบ”ๅคด
127
+ - ไผš่ฏ้š”็ฆป็š„่ฎค่ฏไธญ้—ดไปถ
128
+
129
+ ### ๐Ÿ“Š ็›‘ๆŽงไธŽๅˆ†ๆž
130
+
131
+ - `/api/health` โ€” ๅฅๅบทๆฃ€ๆŸฅ
132
+ - `/api/metrics` โ€” Prometheus ๅ…ผๅฎนๆŒ‡ๆ ‡
133
+ - `/api/dashboard` โ€” ๅฎžๆ—ถไปช่กจ็›˜
134
+ - ๅฏน่ฏๅฏผๅ‡บ๏ผˆJSON / Markdown / CSV๏ผ‰
135
+
136
+ ## ๐Ÿ—๏ธ ๆžถๆž„
137
+
138
+ ```
139
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
140
+ โ”‚ OAD (YAML ๅฎšไน‰ๆ–‡ไปถ) โ”‚
141
+ โ”‚ ๆ™บ่ƒฝไฝ“ๅฎšไน‰ไธŽ้…็ฝฎ โ”‚
142
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
143
+ โ”‚ โ”‚
144
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
145
+ โ”‚ โ”‚ ๆธ ้“ๅฑ‚ โ”‚ โ”‚ ๆ’ไปถๅฑ‚ โ”‚ โ”‚ ๅฎ‰ๅ…จๅฑ‚ โ”‚ โ”‚
146
+ โ”‚ โ”‚ Web, TG, โ”‚ โ”‚ ๆ—ฅๅฟ—, โ”‚ โ”‚ ๆถˆๆฏ’, โ”‚ โ”‚
147
+ โ”‚ โ”‚ WS,Slack โ”‚ โ”‚ ๅˆ†ๆž โ”‚ โ”‚ CORS, ่ฎค่ฏ โ”‚ โ”‚
148
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
149
+ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
150
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
151
+ โ”‚ โ”‚ ๆ™บ่ƒฝไฝ“่ฟ่กŒๆ—ถ (Runtime) โ”‚ โ”‚
152
+ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚
153
+ โ”‚ โ”‚ โ”‚ ่ฎฐๅฟ† โ”‚ โ”‚ ๆŠ€่ƒฝ โ”‚ โ”‚ ็Ÿฅ่ฏ†ๅบ“ โ”‚ โ”‚ โ”‚
154
+ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
155
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
156
+ โ”‚ โ”‚ โ”‚
157
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
158
+ โ”‚ โ”‚ ๅคง่ฏญ่จ€ๆจกๅž‹ไพ›ๅบ”ๅ•† โ”‚ โ”‚
159
+ โ”‚ โ”‚ DeepSeek ยท ้€šไน‰ๅƒ้—ฎ ยท OpenAI ยท Ollama โ”‚ โ”‚
160
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
161
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
162
+ ```
163
+
164
+ ## ๐Ÿ“‹ ๆจกๆฟๅˆ—่กจ
165
+
166
+ | ๆจกๆฟ | ่ฏดๆ˜Ž | ้€‚็”จๅœบๆ™ฏ |
167
+ |------|------|---------|
168
+ | `customer-service` | ๅฎขๆœๆ™บ่ƒฝไฝ“ | FAQ ๆŸฅ่ฏข + ไบบๅทฅ่ฝฌๆŽฅ |
169
+ | `sales-assistant` | ้”€ๅ”ฎๅŠฉๆ‰‹ | ไบงๅ“้—ฎ็ญ” + ็บฟ็ดขๆ•่Žท |
170
+ | `knowledge-base` | ็Ÿฅ่ฏ†ๅบ“้—ฎ็ญ” | RAG ่ฏญไน‰ๆฃ€็ดข |
171
+ | `code-reviewer` | ไปฃ็ ๅฎกๆŸฅ | Bug ๆฃ€ๆต‹ + ้ฃŽๆ ผๆฃ€ๆŸฅ |
172
+ | `hr-recruiter` | HR ๆ‹›่˜ๅŠฉๆ‰‹ | ็ฎ€ๅކ็ญ›้€‰ + ้ข่ฏ•ๅฎ‰ๆŽ’ |
173
+ | `project-manager` | ้กน็›ฎ็ฎก็† | ไปปๅŠก่ทŸ่ธช + ไผš่ฎฎ็บช่ฆ |
174
+ | `content-writer` | ๅ†…ๅฎนๅˆ›ไฝœ | ๅšๅฎข + ็คพๅช’ + SEO |
175
+ | `legal-assistant` | ๆณ•ๅŠกๅŠฉๆ‰‹ | ๅˆๅŒๅฎกๆŸฅ + ๅˆ่ง„ๆฃ€ๆŸฅ |
176
+ | `financial-advisor` | ่ดขๅŠก้กพ้—ฎ | ้ข„็ฎ—็ฎก็† + ๆ”ฏๅ‡บ่ฟฝ่ธช |
177
+ | `executive-assistant` | ่กŒๆ”ฟๅŠฉ็† | ๆ—ฅ็จ‹ + ้‚ฎไปถ + ไผš่ฎฎ |
178
+ | `data-analyst` | ๆ•ฐๆฎๅˆ†ๆžๅธˆ | ๆ•ฐๆฎๆŸฅ่ฏข + ๅฏ่ง†ๅŒ– |
179
+ | `teacher` | ๆ•™ๅญฆๅŠฉๆ‰‹ | ่ฏพ็จ‹่ฎพ่ฎก + ๅ‡บ้ข˜ |
180
+
181
+ ## ๐Ÿš€ ้ƒจ็ฝฒๆŒ‡ๅ—
81
182
 
82
- ### ๐Ÿ”’ Security
83
- - Input sanitization (XSS, injection prevention)
84
- - API key rotation & management
85
- - CORS configuration
86
- - Helmet-style security headers
87
- - Content Security Policy
88
- - Auth middleware with session isolation
183
+ ### Docker ้ƒจ็ฝฒ
89
184
 
90
- ### ๐Ÿงช Agent Testing
91
185
  ```bash
92
- opc test # Run test cases
93
- opc test --watch # Watch mode
186
+ # ๆฏไธช opc init ้กน็›ฎ่‡ชๅธฆ Dockerfile
187
+ docker compose up -d
94
188
  ```
95
189
 
96
- ```yaml
97
- # tests/greeting.yaml
98
- - input: "Hello"
99
- expect:
100
- contains: ["hello", "hi"]
101
- maxLatencyMs: 5000
190
+ ### ้ƒจ็ฝฒๅˆฐ OpenClaw
191
+
192
+ ```bash
193
+ opc deploy --target openclaw
102
194
  ```
103
195
 
104
- ### ๐ŸŽญ Multi-Agent Orchestration
196
+ ### ้ƒจ็ฝฒๅˆฐ Hermes ไบ‘
197
+
198
+ ```bash
199
+ opc deploy --target hermes
200
+ ```
201
+
202
+ ## ๐Ÿ“– CLI ๅ‘ฝไปคๅ‚่€ƒ
203
+
204
+ | ๅ‘ฝไปค | ่ฏดๆ˜Ž |
205
+ |------|------|
206
+ | `opc init [name]` | ๅˆ›ๅปบๆ–ฐๆ™บ่ƒฝไฝ“้กน็›ฎ |
207
+ | `opc run` | ๅฏๅŠจๆ™บ่ƒฝไฝ“ |
208
+ | `opc dev` | ๅผ€ๅ‘ๆจกๅผ๏ผˆ็ƒญ้‡่ฝฝ๏ผ‰ |
209
+ | `opc test` | ่ฟ่กŒๆต‹่ฏ•็”จไพ‹ |
210
+ | `opc chat` | ๅ‘ฝไปค่กŒไบคไบ’ๅฏน่ฏ |
211
+ | `opc build` | ๆ ก้ชŒ OAD ้…็ฝฎ |
212
+ | `opc deploy` | ้ƒจ็ฝฒๆ™บ่ƒฝไฝ“ |
213
+ | `opc analytics` | ๆŸฅ็œ‹ๆ•ฐๆฎๅˆ†ๆž |
214
+ | `opc kb add <file>` | ๆทปๅŠ ็Ÿฅ่ฏ†ๅบ“ๆ–‡ไปถ |
215
+ | `opc kb search <query>` | ๆœ็ดข็Ÿฅ่ฏ†ๅบ“ |
216
+
217
+ ## ๐Ÿ”— API ๅ‚่€ƒ
218
+
105
219
  ```typescript
106
- import { Orchestrator } from 'opc-agent';
220
+ import { AgentRuntime, KnowledgeBase, Orchestrator } from 'opc-agent';
107
221
 
108
- const orchestrator = new Orchestrator({
109
- agents: [triageAgent, salesAgent, supportAgent],
110
- strategy: 'route-by-intent',
111
- });
222
+ // ๅฏๅŠจๆ™บ่ƒฝไฝ“
223
+ const runtime = new AgentRuntime();
224
+ await runtime.loadConfig('oad.yaml');
225
+ await runtime.initialize();
226
+ await runtime.start();
227
+ ```
228
+
229
+ ่ฏฆ็ป† API ๆ–‡ๆกฃ่ฏทๆŸฅ็œ‹ [SDK ๅ‚่€ƒ](https://deepleaper.github.io/opc-agent/api/sdk)ใ€‚
230
+
231
+ ## ๐Ÿค ่ดก็ŒฎๆŒ‡ๅ—
232
+
233
+ ๆฌข่ฟŽๅ‚ไธŽ่ดก็Œฎ๏ผ
234
+
235
+ 1. Fork ๆœฌไป“ๅบ“
236
+ 2. ๅˆ›ๅปบๅŠŸ่ƒฝๅˆ†ๆ”ฏ๏ผš`git checkout -b feat/my-feature`
237
+ 3. ็ผ–ๅ†™ไปฃ็ ๅ’Œๆต‹่ฏ•
238
+ 4. ่ฟ่กŒๆต‹่ฏ•๏ผš`npm test`
239
+ 5. ๆไบค Pull Request
240
+
241
+ ### ๆœฌๅœฐๅผ€ๅ‘
242
+
243
+ ```bash
244
+ git clone https://github.com/Deepleaper/opc-agent.git
245
+ cd opc-agent
246
+ npm install
247
+ npm run build
248
+ npm test
249
+ ```
250
+
251
+ ---
252
+
253
+ # ๐Ÿ‡บ๐Ÿ‡ธ English Documentation
254
+
255
+ OPC Agent is a **TypeScript-first framework** for building production AI agents by [Deepleaper](https://www.deepleaper.com). Define your agent in a single YAML file (OAD โ€” Open Agent Definition), connect any LLM provider, deploy to any channel.
256
+
257
+ ## โšก Quick Start (30 seconds)
258
+
259
+ ```bash
260
+ # Install
261
+ npm install -g opc-agent
262
+
263
+ # Create your first agent
264
+ opc init my-agent
265
+ cd my-agent
266
+
267
+ # Run it
268
+ opc run
112
269
  ```
113
270
 
114
- ### ๐Ÿ“Š Built-in Analytics & Monitoring
115
- - `/api/health` โ€” Health check
116
- - `/api/metrics` โ€” Prometheus-compatible metrics
117
- - `/api/dashboard` โ€” Real-time dashboard UI
118
- - Conversation export (JSON, Markdown, CSV)
271
+ Your agent is now live at `http://localhost:3000` with a beautiful web chat UI.
272
+
273
+ ## โœจ Features
274
+
275
+ - ๐Ÿ”Œ **Multi-Provider LLM** โ€” DeepSeek, Qwen, OpenAI, Anthropic, Ollama, any OpenAI-compatible API
276
+ - ๐Ÿ“ก **Multi-Channel** โ€” Web, Telegram, Slack, WebSocket, Email, WeChat, Feishu, Voice, Webhook
277
+ - ๐Ÿง  **Knowledge Base (RAG)** โ€” Add files, auto-retrieve for context
278
+ - ๐ŸŽญ **Multi-Agent Orchestration** โ€” Route by intent, compose agent teams
279
+ - ๐Ÿงช **Built-in Testing** โ€” YAML-defined test cases, latency assertions
280
+ - ๐Ÿ”ง **Plugin System** โ€” Logging, analytics, rate limiting, custom hooks
281
+ - ๐Ÿ”’ **Security** โ€” Input sanitization, CORS, auth, session isolation
282
+ - ๐Ÿ“Š **Analytics & Monitoring** โ€” Health checks, Prometheus metrics, real-time dashboard
283
+ - ๐Ÿ“‹ **12 Templates** โ€” Customer service, sales, knowledge base, code review, and more
119
284
 
120
285
  ## ๐Ÿ—๏ธ Architecture
121
286
 
@@ -124,23 +289,18 @@ const orchestrator = new Orchestrator({
124
289
  โ”‚ OAD (YAML) โ”‚
125
290
  โ”‚ Agent Definition & Config โ”‚
126
291
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
127
- โ”‚ โ”‚
128
292
  โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
129
293
  โ”‚ โ”‚ Channels โ”‚ โ”‚ Plugins โ”‚ โ”‚ Security โ”‚ โ”‚
130
- โ”‚ โ”‚ web,tg, โ”‚ โ”‚ logging, โ”‚ โ”‚ sanitize, โ”‚ โ”‚
131
- โ”‚ โ”‚ ws,slack โ”‚ โ”‚ analyticsโ”‚ โ”‚ CORS, auth โ”‚ โ”‚
132
294
  โ”‚ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
133
- โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
134
295
  โ”‚ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
135
296
  โ”‚ โ”‚ Agent Runtime โ”‚ โ”‚
136
297
  โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚
137
298
  โ”‚ โ”‚ โ”‚ Memory โ”‚ โ”‚ Skills โ”‚ โ”‚ Knowledge โ”‚ โ”‚ โ”‚
138
299
  โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
139
300
  โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
140
- โ”‚ โ”‚ โ”‚
141
301
  โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
142
302
  โ”‚ โ”‚ LLM Providers โ”‚ โ”‚
143
- โ”‚ โ”‚ OpenAI ยท DeepSeek ยท Anthropic ยท Ollama โ”‚ โ”‚
303
+ โ”‚ โ”‚ DeepSeek ยท Qwen ยท OpenAI ยท Anthropic โ”‚ โ”‚
144
304
  โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
145
305
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
146
306
  ```
@@ -151,39 +311,23 @@ const orchestrator = new Orchestrator({
151
311
  |---------|-------------|
152
312
  | `opc init [name]` | Create a new agent project |
153
313
  | `opc run` | Start the agent |
154
- | `opc dev` | Start in development mode (auto-reload) |
314
+ | `opc dev` | Development mode (hot-reload) |
155
315
  | `opc test` | Run agent test cases |
156
- | `opc validate` | Validate OAD configuration |
157
- | `opc deploy hermes` | Deploy to Hermes cloud |
158
- | `opc plugin list` | List available plugins |
159
- | `opc plugin add <name>` | Add a plugin to config |
160
- | `opc migrate` | Migrate OAD to latest schema |
161
- | `opc marketplace publish` | Publish to marketplace |
316
+ | `opc chat` | Interactive CLI chat |
317
+ | `opc build` | Validate OAD configuration |
318
+ | `opc deploy` | Deploy agent |
319
+ | `opc analytics` | View analytics |
320
+ | `opc kb add <file>` | Add knowledge base file |
321
+ | `opc kb search <query>` | Search knowledge base |
162
322
 
163
323
  ## ๐Ÿค Contributing
164
324
 
165
- We welcome contributions! Here's how:
166
-
167
- 1. Fork the repository
168
- 2. Create a feature branch: `git checkout -b feat/my-feature`
169
- 3. Make your changes with tests
170
- 4. Run tests: `npm test`
171
- 5. Submit a pull request
172
-
173
- ### Development Setup
174
-
175
- ```bash
176
- git clone https://github.com/anthropic-lab/opc-agent.git
177
- cd opc-agent
178
- npm install
179
- npm run build
180
- npm test
181
- ```
325
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
182
326
 
183
327
  ## ๐Ÿ“„ License
184
328
 
185
- [Apache License 2.0](LICENSE) โ€” Use it freely in commercial and open source projects.
329
+ [Apache License 2.0](LICENSE) โ€” Free for commercial and open source use.
186
330
 
187
331
  ---
188
332
 
189
- <p align="center">Built with โค๏ธ by the OPC team</p>
333
+ <p align="center">Built with โค๏ธ by <a href="https://www.deepleaper.com">Deepleaper ่ทƒ็›Ÿ็ง‘ๆŠ€</a></p>