opc-agent 5.0.0-rc.9 → 5.0.0

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.
Files changed (357) hide show
  1. package/CHANGELOG.md +104 -4
  2. package/CONTRIBUTING.md +161 -22
  3. package/README.md +130 -122
  4. package/README.zh-CN.md +163 -71
  5. package/dist/channels/discord.d.ts.map +1 -1
  6. package/dist/channels/discord.js +3 -1
  7. package/dist/channels/discord.js.map +1 -1
  8. package/dist/channels/message-queue.d.ts +19 -0
  9. package/dist/channels/message-queue.d.ts.map +1 -0
  10. package/dist/channels/message-queue.js +59 -0
  11. package/dist/channels/message-queue.js.map +1 -0
  12. package/dist/channels/slack.d.ts.map +1 -1
  13. package/dist/channels/slack.js +3 -1
  14. package/dist/channels/slack.js.map +1 -1
  15. package/dist/channels/telegram.d.ts +7 -0
  16. package/dist/channels/telegram.d.ts.map +1 -1
  17. package/dist/channels/telegram.js +63 -32
  18. package/dist/channels/telegram.js.map +1 -1
  19. package/dist/channels/web.d.ts +3 -0
  20. package/dist/channels/web.d.ts.map +1 -1
  21. package/dist/channels/web.js +12 -2
  22. package/dist/channels/web.js.map +1 -1
  23. package/dist/channels/wechat.d.ts.map +1 -1
  24. package/dist/channels/wechat.js +3 -1
  25. package/dist/channels/wechat.js.map +1 -1
  26. package/dist/cli/agent.d.ts +3 -0
  27. package/dist/cli/agent.d.ts.map +1 -0
  28. package/dist/cli/agent.js +665 -0
  29. package/dist/cli/agent.js.map +1 -0
  30. package/dist/cli/index.d.ts +2 -0
  31. package/dist/cli/index.d.ts.map +1 -0
  32. package/dist/cli/index.js +29 -0
  33. package/dist/cli/index.js.map +1 -0
  34. package/dist/cli/mcp.d.ts +3 -0
  35. package/dist/cli/mcp.d.ts.map +1 -0
  36. package/dist/cli/mcp.js +143 -0
  37. package/dist/cli/mcp.js.map +1 -0
  38. package/dist/cli/misc.d.ts +3 -0
  39. package/dist/cli/misc.d.ts.map +1 -0
  40. package/dist/cli/misc.js +1219 -0
  41. package/dist/cli/misc.js.map +1 -0
  42. package/dist/cli/run.d.ts +3 -0
  43. package/dist/cli/run.d.ts.map +1 -0
  44. package/dist/cli/run.js +219 -0
  45. package/dist/cli/run.js.map +1 -0
  46. package/dist/cli/setup.d.ts +2 -0
  47. package/dist/cli/setup.d.ts.map +1 -1
  48. package/dist/cli/setup.js +333 -7
  49. package/dist/cli/setup.js.map +1 -1
  50. package/dist/cli/shared.d.ts +36 -0
  51. package/dist/cli/shared.d.ts.map +1 -0
  52. package/dist/cli/shared.js +196 -0
  53. package/dist/cli/shared.js.map +1 -0
  54. package/dist/cli/studio.d.ts +3 -0
  55. package/dist/cli/studio.d.ts.map +1 -0
  56. package/dist/cli/studio.js +31 -0
  57. package/dist/cli/studio.js.map +1 -0
  58. package/dist/cli/template.d.ts +3 -0
  59. package/dist/cli/template.d.ts.map +1 -0
  60. package/dist/cli/template.js +247 -0
  61. package/dist/cli/template.js.map +1 -0
  62. package/dist/cli.js +3 -2746
  63. package/dist/cli.js.map +1 -1
  64. package/dist/core/agent.d.ts +33 -0
  65. package/dist/core/agent.d.ts.map +1 -1
  66. package/dist/core/agent.js +414 -71
  67. package/dist/core/agent.js.map +1 -1
  68. package/dist/core/context-assembler.d.ts.map +1 -1
  69. package/dist/core/context-assembler.js +4 -1
  70. package/dist/core/context-assembler.js.map +1 -1
  71. package/dist/core/context-compressor.d.ts +29 -0
  72. package/dist/core/context-compressor.d.ts.map +1 -0
  73. package/dist/core/context-compressor.js +103 -0
  74. package/dist/core/context-compressor.js.map +1 -0
  75. package/dist/core/heartbeat-monitor.d.ts +18 -0
  76. package/dist/core/heartbeat-monitor.d.ts.map +1 -0
  77. package/dist/core/heartbeat-monitor.js +38 -0
  78. package/dist/core/heartbeat-monitor.js.map +1 -0
  79. package/dist/core/index.d.ts +4 -0
  80. package/dist/core/index.d.ts.map +1 -1
  81. package/dist/core/index.js +20 -0
  82. package/dist/core/index.js.map +1 -1
  83. package/dist/core/output-guard.d.ts +17 -0
  84. package/dist/core/output-guard.d.ts.map +1 -0
  85. package/dist/core/output-guard.js +134 -0
  86. package/dist/core/output-guard.js.map +1 -0
  87. package/dist/core/progressive-disclosure.d.ts +17 -0
  88. package/dist/core/progressive-disclosure.d.ts.map +1 -0
  89. package/dist/core/progressive-disclosure.js +34 -0
  90. package/dist/core/progressive-disclosure.js.map +1 -0
  91. package/dist/core/runtime.d.ts +4 -0
  92. package/dist/core/runtime.d.ts.map +1 -1
  93. package/dist/core/runtime.js +228 -39
  94. package/dist/core/runtime.js.map +1 -1
  95. package/dist/core/scheduler.d.ts +5 -0
  96. package/dist/core/scheduler.d.ts.map +1 -1
  97. package/dist/core/scheduler.js.map +1 -1
  98. package/dist/core/session-events.d.ts +15 -0
  99. package/dist/core/session-events.d.ts.map +1 -0
  100. package/dist/core/session-events.js +28 -0
  101. package/dist/core/session-events.js.map +1 -0
  102. package/dist/core/sub-agent.d.ts +16 -0
  103. package/dist/core/sub-agent.d.ts.map +1 -0
  104. package/dist/core/sub-agent.js +47 -0
  105. package/dist/core/sub-agent.js.map +1 -0
  106. package/dist/core/types.d.ts +6 -0
  107. package/dist/core/types.d.ts.map +1 -1
  108. package/dist/deepbrain/provider.d.ts +3 -0
  109. package/dist/deepbrain/provider.d.ts.map +1 -1
  110. package/dist/deepbrain/provider.js +12 -0
  111. package/dist/deepbrain/provider.js.map +1 -1
  112. package/dist/integrations/index.d.ts +3 -0
  113. package/dist/integrations/index.d.ts.map +1 -0
  114. package/dist/integrations/index.js +7 -0
  115. package/dist/integrations/index.js.map +1 -0
  116. package/dist/integrations/mcp-client.d.ts +20 -0
  117. package/dist/integrations/mcp-client.d.ts.map +1 -0
  118. package/dist/integrations/mcp-client.js +51 -0
  119. package/dist/integrations/mcp-client.js.map +1 -0
  120. package/dist/memory/evolve-engine.d.ts +6 -1
  121. package/dist/memory/evolve-engine.d.ts.map +1 -1
  122. package/dist/memory/evolve-engine.js +81 -36
  123. package/dist/memory/evolve-engine.js.map +1 -1
  124. package/dist/memory/hybrid-search.d.ts +22 -0
  125. package/dist/memory/hybrid-search.d.ts.map +1 -0
  126. package/dist/memory/hybrid-search.js +141 -0
  127. package/dist/memory/hybrid-search.js.map +1 -0
  128. package/dist/memory/index.d.ts +9 -0
  129. package/dist/memory/index.d.ts.map +1 -1
  130. package/dist/memory/index.js +23 -1
  131. package/dist/memory/index.js.map +1 -1
  132. package/dist/memory/insights-extractor.d.ts +14 -0
  133. package/dist/memory/insights-extractor.d.ts.map +1 -0
  134. package/dist/memory/insights-extractor.js +47 -0
  135. package/dist/memory/insights-extractor.js.map +1 -0
  136. package/dist/memory/session-search.d.ts +18 -0
  137. package/dist/memory/session-search.d.ts.map +1 -0
  138. package/dist/memory/session-search.js +52 -0
  139. package/dist/memory/session-search.js.map +1 -0
  140. package/dist/memory/sqlite-conversation-store.d.ts +16 -0
  141. package/dist/memory/sqlite-conversation-store.d.ts.map +1 -0
  142. package/dist/memory/sqlite-conversation-store.js +132 -0
  143. package/dist/memory/sqlite-conversation-store.js.map +1 -0
  144. package/dist/memory/sqlite-store.js +43 -43
  145. package/dist/providers/index.d.ts +16 -1
  146. package/dist/providers/index.d.ts.map +1 -1
  147. package/dist/providers/index.js +155 -14
  148. package/dist/providers/index.js.map +1 -1
  149. package/dist/providers/openai-compat.d.ts +1 -0
  150. package/dist/providers/openai-compat.d.ts.map +1 -1
  151. package/dist/providers/openai-compat.js +4 -2
  152. package/dist/providers/openai-compat.js.map +1 -1
  153. package/dist/publish/index.d.ts.map +1 -1
  154. package/dist/publish/index.js +16 -3
  155. package/dist/publish/index.js.map +1 -1
  156. package/dist/sandbox/index.d.ts +3 -0
  157. package/dist/sandbox/index.d.ts.map +1 -0
  158. package/dist/sandbox/index.js +8 -0
  159. package/dist/sandbox/index.js.map +1 -0
  160. package/dist/sandbox/manager.d.ts +31 -0
  161. package/dist/sandbox/manager.d.ts.map +1 -0
  162. package/dist/sandbox/manager.js +123 -0
  163. package/dist/sandbox/manager.js.map +1 -0
  164. package/dist/scheduler/cron-engine.d.ts.map +1 -1
  165. package/dist/scheduler/cron-engine.js +3 -1
  166. package/dist/scheduler/cron-engine.js.map +1 -1
  167. package/dist/schema/oad.d.ts +752 -202
  168. package/dist/schema/oad.d.ts.map +1 -1
  169. package/dist/schema/oad.js +36 -1
  170. package/dist/schema/oad.js.map +1 -1
  171. package/dist/security/index.d.ts +2 -0
  172. package/dist/security/index.d.ts.map +1 -1
  173. package/dist/security/index.js +3 -1
  174. package/dist/security/index.js.map +1 -1
  175. package/dist/security/injection-detector.d.ts +10 -0
  176. package/dist/security/injection-detector.d.ts.map +1 -0
  177. package/dist/security/injection-detector.js +63 -0
  178. package/dist/security/injection-detector.js.map +1 -0
  179. package/dist/skills/auto-learn.d.ts +5 -1
  180. package/dist/skills/auto-learn.d.ts.map +1 -1
  181. package/dist/skills/auto-learn.js +31 -3
  182. package/dist/skills/auto-learn.js.map +1 -1
  183. package/dist/skills/skill-loader.js +1 -1
  184. package/dist/skills/skill-loader.js.map +1 -1
  185. package/dist/studio/server.d.ts +8 -1
  186. package/dist/studio/server.d.ts.map +1 -1
  187. package/dist/studio/server.js +204 -24
  188. package/dist/studio/server.js.map +1 -1
  189. package/dist/studio-ui/index.html +767 -16
  190. package/dist/templates/ceo-coach/AGENTS.md +59 -0
  191. package/dist/templates/ceo-coach/CASES-100.md +547 -0
  192. package/dist/templates/ceo-coach/COLD-START.md +72 -0
  193. package/dist/templates/ceo-coach/EGO.md +39 -0
  194. package/dist/templates/ceo-coach/FRAMEWORKS.md +71 -0
  195. package/dist/templates/ceo-coach/HEARTBEAT.md +22 -0
  196. package/dist/templates/ceo-coach/IDENTITY.md +6 -0
  197. package/dist/templates/ceo-coach/KNOWLEDGE.md +201 -0
  198. package/dist/templates/ceo-coach/MEMORY.md +23 -0
  199. package/dist/templates/ceo-coach/ONBOARDING.md +41 -0
  200. package/dist/templates/ceo-coach/USER.md +8 -0
  201. package/dist/templates/ceo-coach/template.yaml +27 -0
  202. package/dist/templates/ceo-coach-socratic/AGENTS.md +21 -0
  203. package/dist/templates/ceo-coach-socratic/EGO.md +22 -0
  204. package/dist/templates/ceo-coach-socratic/KNOWLEDGE.md +21 -0
  205. package/dist/templates/ceo-coach-socratic/MEMORY.md +10 -0
  206. package/dist/templates/ceo-coach-socratic/USER.md +15 -0
  207. package/dist/templates/ceo-coach-socratic/template.yaml +21 -0
  208. package/dist/templates/data-analyst.js +1 -1
  209. package/dist/templates/data-analyst.js.map +1 -1
  210. package/dist/templates/quality-checker.d.ts +11 -0
  211. package/dist/templates/quality-checker.d.ts.map +1 -0
  212. package/dist/templates/quality-checker.js +115 -0
  213. package/dist/templates/quality-checker.js.map +1 -0
  214. package/dist/templates/teacher.js +1 -1
  215. package/dist/templates/teacher.js.map +1 -1
  216. package/dist/templates/template-provider.d.ts +38 -0
  217. package/dist/templates/template-provider.d.ts.map +1 -1
  218. package/dist/templates/template-provider.js +205 -3
  219. package/dist/templates/template-provider.js.map +1 -1
  220. package/dist/templates/test-runner.d.ts +27 -0
  221. package/dist/templates/test-runner.d.ts.map +1 -0
  222. package/dist/templates/test-runner.js.map +1 -0
  223. package/dist/tools/builtin/browser.d.ts.map +1 -1
  224. package/dist/tools/builtin/browser.js +114 -10
  225. package/dist/tools/builtin/browser.js.map +1 -1
  226. package/dist/tools/builtin/content-scanner.d.ts +7 -0
  227. package/dist/tools/builtin/content-scanner.d.ts.map +1 -0
  228. package/dist/tools/builtin/content-scanner.js +37 -0
  229. package/dist/tools/builtin/content-scanner.js.map +1 -0
  230. package/dist/tools/builtin/cron-manage.d.ts +10 -0
  231. package/dist/tools/builtin/cron-manage.d.ts.map +1 -0
  232. package/dist/tools/builtin/cron-manage.js +187 -0
  233. package/dist/tools/builtin/cron-manage.js.map +1 -0
  234. package/dist/tools/builtin/execute-code.d.ts +3 -0
  235. package/dist/tools/builtin/execute-code.d.ts.map +1 -0
  236. package/dist/tools/builtin/execute-code.js +124 -0
  237. package/dist/tools/builtin/execute-code.js.map +1 -0
  238. package/dist/tools/builtin/index.d.ts +12 -1
  239. package/dist/tools/builtin/index.d.ts.map +1 -1
  240. package/dist/tools/builtin/index.js +43 -4
  241. package/dist/tools/builtin/index.js.map +1 -1
  242. package/dist/tools/builtin/memory-manage.d.ts +13 -0
  243. package/dist/tools/builtin/memory-manage.d.ts.map +1 -0
  244. package/dist/tools/builtin/memory-manage.js +163 -0
  245. package/dist/tools/builtin/memory-manage.js.map +1 -0
  246. package/dist/tools/builtin/read-file.d.ts +3 -0
  247. package/dist/tools/builtin/read-file.d.ts.map +1 -0
  248. package/dist/tools/builtin/read-file.js +126 -0
  249. package/dist/tools/builtin/read-file.js.map +1 -0
  250. package/dist/tools/builtin/session-search.d.ts +3 -0
  251. package/dist/tools/builtin/session-search.d.ts.map +1 -0
  252. package/dist/tools/builtin/session-search.js +31 -0
  253. package/dist/tools/builtin/session-search.js.map +1 -0
  254. package/dist/tools/builtin/skill-filter.d.ts +3 -0
  255. package/dist/tools/builtin/skill-filter.d.ts.map +1 -0
  256. package/dist/tools/builtin/skill-filter.js +141 -0
  257. package/dist/tools/builtin/skill-filter.js.map +1 -0
  258. package/dist/tools/builtin/skill-manage.d.ts +13 -0
  259. package/dist/tools/builtin/skill-manage.d.ts.map +1 -0
  260. package/dist/tools/builtin/skill-manage.js +147 -0
  261. package/dist/tools/builtin/skill-manage.js.map +1 -0
  262. package/dist/tools/builtin/skill-to-tool.d.ts +6 -0
  263. package/dist/tools/builtin/skill-to-tool.d.ts.map +1 -0
  264. package/dist/tools/builtin/skill-to-tool.js +171 -0
  265. package/dist/tools/builtin/skill-to-tool.js.map +1 -0
  266. package/dist/tools/builtin/skill-writer.d.ts +3 -0
  267. package/dist/tools/builtin/skill-writer.d.ts.map +1 -0
  268. package/dist/tools/builtin/skill-writer.js +90 -0
  269. package/dist/tools/builtin/skill-writer.js.map +1 -0
  270. package/dist/tools/builtin/subagent.d.ts +7 -0
  271. package/dist/tools/builtin/subagent.d.ts.map +1 -0
  272. package/dist/tools/builtin/subagent.js +93 -0
  273. package/dist/tools/builtin/subagent.js.map +1 -0
  274. package/dist/tools/builtin/write-file.d.ts +3 -0
  275. package/dist/tools/builtin/write-file.d.ts.map +1 -0
  276. package/dist/tools/builtin/write-file.js +95 -0
  277. package/dist/tools/builtin/write-file.js.map +1 -0
  278. package/dist/tools/integrations/summarizer.js +1 -1
  279. package/dist/tools/integrations/summarizer.js.map +1 -1
  280. package/dist/tools/integrations/translator.js +1 -1
  281. package/dist/tools/integrations/translator.js.map +1 -1
  282. package/dist/tools/mcp-client.d.ts +14 -1
  283. package/dist/tools/mcp-client.d.ts.map +1 -1
  284. package/dist/tools/mcp-client.js +63 -1
  285. package/dist/tools/mcp-client.js.map +1 -1
  286. package/dist/tools/mcp-server.d.ts +21 -0
  287. package/dist/tools/mcp-server.d.ts.map +1 -0
  288. package/dist/tools/mcp-server.js +157 -0
  289. package/dist/tools/mcp-server.js.map +1 -0
  290. package/dist/tui/log-stream.d.ts +19 -0
  291. package/dist/tui/log-stream.d.ts.map +1 -0
  292. package/dist/tui/log-stream.js +45 -0
  293. package/dist/tui/log-stream.js.map +1 -0
  294. package/dist/utils/dynamic-import.js +5 -5
  295. package/dist/voice/stt.d.ts +4 -0
  296. package/dist/voice/stt.d.ts.map +1 -0
  297. package/dist/voice/stt.js +147 -0
  298. package/dist/voice/stt.js.map +1 -0
  299. package/dist/voice/tts.d.ts +10 -0
  300. package/dist/voice/tts.d.ts.map +1 -0
  301. package/dist/voice/tts.js +153 -0
  302. package/dist/voice/tts.js.map +1 -0
  303. package/dist/workflow/engine.d.ts +41 -0
  304. package/dist/workflow/engine.d.ts.map +1 -0
  305. package/dist/workflow/engine.js +147 -0
  306. package/dist/workflow/engine.js.map +1 -0
  307. package/dist/workflow/index.d.ts +3 -0
  308. package/dist/workflow/index.d.ts.map +1 -0
  309. package/dist/workflow/index.js +6 -0
  310. package/dist/workflow/index.js.map +1 -0
  311. package/examples/README.md +55 -10
  312. package/install.ps1 +144 -127
  313. package/install.sh +165 -154
  314. package/models.json +29 -164
  315. package/oad.yaml +15 -0
  316. package/package.json +67 -67
  317. package/scripts/install.ps1 +8 -0
  318. package/scripts/install.sh +11 -1
  319. package/scripts/postbuild.js +26 -8
  320. package/.opc/brain.db +0 -0
  321. package/.opc/memory.db +0 -0
  322. package/.opc/schedules.json +0 -904
  323. package/.opc/skills/auto-greet-user.md +0 -21
  324. package/.opc/skills/greeting.md +0 -11
  325. package/.opc/voice-tmp/tts-1776835848670.mp3 +0 -0
  326. package/.opc/voice-tmp/tts-1776835873696.mp3 +0 -0
  327. package/AUDIT-TASK.md +0 -96
  328. package/COMPETITIVE-GAP.md +0 -92
  329. package/STUDIO-FIX-5678.md +0 -57
  330. package/STUDIO-FIX-ALL.md +0 -101
  331. package/STUDIO-REWRITE-TASK.md +0 -76
  332. package/TASK-STUDIO.md +0 -200
  333. package/TASK.md +0 -36
  334. package/cc-err.txt +0 -0
  335. package/cc-err2.txt +0 -0
  336. package/cc-err3.txt +0 -0
  337. package/data/brain.db/deepbrain.sqlite +0 -0
  338. package/s-err.log +0 -0
  339. package/s-out.log +0 -6
  340. package/studio-dbg.log +0 -1
  341. package/studio-err.log +0 -12
  342. package/studio-out.log +0 -0
  343. package/templates/Dockerfile +0 -15
  344. package/templates/code-reviewer/README.md +0 -27
  345. package/templates/code-reviewer/oad.yaml +0 -41
  346. package/templates/customer-service/README.md +0 -22
  347. package/templates/customer-service/oad.yaml +0 -36
  348. package/templates/docker-compose.yml +0 -21
  349. package/templates/ecommerce-assistant/README.md +0 -45
  350. package/templates/ecommerce-assistant/oad.yaml +0 -47
  351. package/templates/knowledge-base/README.md +0 -28
  352. package/templates/knowledge-base/oad.yaml +0 -38
  353. package/templates/sales-assistant/README.md +0 -26
  354. package/templates/sales-assistant/oad.yaml +0 -43
  355. package/templates/tech-support/README.md +0 -43
  356. package/templates/tech-support/oad.yaml +0 -45
  357. package/tsconfig.json +0 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
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
+
22
+ ## [5.0.0-rc.14] - 2026-04-23
23
+
24
+ ### New Features
25
+ - **OutputGuard** — Unified output sanitization pipeline with 6 rules: PII scrubbing, prompt-injection echo suppression, `<think>` reasoning block stripping, model identity self-disclosure detection (Claude/GPT/Gemini/etc.), jailbreak echo filtering, and sensitive-key redaction. Integrated into all 6 active channels (Telegram, Web, WeChat, Feishu, Discord, Slack) with full streaming support.
26
+
27
+ ## [5.0.0-rc.13] - 2026-04-23
28
+
29
+ ### New Features
30
+ - **Hybrid FTS5 + Semantic Search** — DeepBrain now combines SQLite FTS5 full-text search with vector embeddings for higher-recall recall queries
31
+ - **Skill Platform Filter** — Skills declare supported platforms; runtime skips unsupported tools automatically
32
+ - **TUI LogStream** — Live structured log panel inside the terminal chat UI
33
+ - **MCPClient stub** — MCP client interface wired into runtime (server connectivity TBD)
34
+ - **WorkflowEngine** — DAG-based task orchestration with step dependencies and parallel branches
35
+ - **SandboxManager** — Isolated execution environment for untrusted code steps
36
+ - **Workstation Template system** — `opc init --template <id>` scaffolds a complete agent workspace (e.g. `opc init --template ceo-coach-socratic`)
37
+ - **7-layer System Prompt Assembly** — Layered prompt construction: base identity → EGO.md → SOUL.md → CONTEXT.md → memory → skills → conversation history
38
+ - **DeepBrain Auto-import** — Knowledge base is automatically populated on `opc brain learn`
39
+ - **DeepBrain Recall in Conversations** — Every conversation turn runs a semantic prefetch against DeepBrain and injects relevant memories into context
40
+
41
+ ## [5.0.0-rc.12] - 2026-04-22
42
+
43
+ ### New Features
44
+ - **FailoverProvider** — Automatic LLM provider failover with configurable priority order and circuit-breaker
45
+ - **HeartbeatMonitor** — Per-provider liveness probes; removes unhealthy providers from rotation
46
+ - **`create_skill` tool** — Agent self-writes new skills at runtime; persisted to disk and hot-reloaded
47
+ - **InsightsExtractor** — Structured extraction of entities, decisions, and action items from conversation turns
48
+ - **SubAgentManager** — Spawn, track, and aggregate results from parallel sub-agents
49
+ - **SessionEventEmitter** — Internal event bus for session lifecycle hooks (start, turn, end, error)
50
+ - **InjectionDetector** — Heuristic + pattern-based prompt injection detection layer
51
+ - **ProgressiveDisclosure** — Truncates lengthy tool outputs; exposes `show more` expansion in TUI
52
+ - **ContextCompressor V2** — Token-aware summarisation with configurable compression ratio and anchor preservation
53
+
54
+ ## [5.0.0-rc.11] - 2026-04-22
55
+
56
+ ### New Features
57
+ - **Provider Failover** — LLM provider switching on transient errors; retries with exponential back-off
58
+ - **Prompt Injection Detection** — Early-stage detection of adversarial inputs before they reach the model
59
+
60
+ ## [5.0.0-rc.10]
61
+
62
+ ### New Features
63
+ - **P1 Orchestration** — Memory prefetch/sync, context window guard (auto-truncation before overflow), cron job delivery to channels, DeepBrain recall wired into every turn
64
+
65
+ ## [5.0.0-rc.9]
66
+
67
+ ### New Features
68
+ - **P0 Orchestration** — SQLite conversation history persistence, context compaction (summarise-and-truncate), isolated cron scheduler
69
+ - **Pipe Mode Tool Loop** — `opc run --pipe` accepts newline-delimited JSON tasks; agent executes tool loop and writes JSON results to stdout
70
+ - **Skill Loader Integration** — Runtime discovers and loads skills from `~/.opc/skills/` and project-local `skills/` on startup
71
+
72
+ ## [5.0.0-rc.5]
73
+
74
+ ### Improvements
75
+ - **Banner v2** — High-fidelity ASCII-art splash with version and hardware stats
76
+ - **TUI Markdown Enhancement** — Tables, code fences, and inline styles rendered natively in terminal
77
+
78
+ ## [5.0.0-rc.3]
79
+
80
+ ### New Features
81
+ - **TUI Markdown Rendering** — Full CommonMark rendering in `opc chat` terminal UI
82
+
83
+ ## [5.0.0-rc.2]
84
+
85
+ ### New Features
86
+ - **Interactive Tool Calling** — Tools are confirmed and displayed live inside the TUI before execution
87
+
88
+ ## [5.0.0-rc.1] - 2026-04-20
89
+
90
+ ### Major Release — Complete v5 Rewrite
91
+ - All-in-one architecture merging **DeepBrain** (knowledge) + **AgentKits** (model routing) + **Workstation** (templates) into a single package
92
+ - 1114 tests passing
93
+ - TypeScript 5.x, CommonJS module format, Node.js 18+ required
94
+ - Declarative `oad.yaml` agent definition replaces legacy JSON config
95
+ - New self-evolution engine: L1 Experience Compile → L2 Memory Consolidate → L3 Skill Discovery → L4 Group Evolution
96
+
97
+ ## [5.0.0-alpha.1]
98
+
99
+ - Initial v5 alpha — early preview of the rewritten architecture
100
+
101
+ ---
102
+
3
103
  ## [4.2.0] - 2026-04-21
4
104
 
5
105
  ### New Features
@@ -36,7 +136,7 @@
36
136
  ### CLI Commands
37
137
  init, chat, run, dev, start, stop, status, jobs, skills, info, build, test, analytics, brain, logs, score, search, deploy, publish, install, plugin, tool, workflow, migrate
38
138
 
39
- ## 1.4.0 (2026-04-18)
139
+ ## [1.4.0] - 2026-04-18
40
140
  - feat: wire Analytics into AgentRuntime (message timing, skill usage, error tracking)
41
141
  - feat: expose analytics snapshot on /health and /api/dashboard endpoints
42
142
  - feat: enhanced /health endpoint with agent name, version, uptime, memory type, skills, channels
@@ -44,16 +144,16 @@ init, chat, run, dev, start, stop, status, jobs, skills, info, build, test, anal
44
144
  - feat: WebChannel metadata setters (version, memory type, skills, channels, analytics provider)
45
145
  - feat: AgentRuntime.getAnalytics() and getConfig() accessors
46
146
 
47
- ## 1.3.1 (2026-04-17)
147
+ ## [1.3.1] - 2026-04-17
48
148
  - fix: remove residual DTV/marketplace references
49
149
  - fix: duplicate WatchPattern export
50
150
 
51
- ## 1.3.0 (2026-04-17)
151
+ ## [1.3.0] - 2026-04-17
52
152
  - feat: Traces collection (OpenTelemetry-style)
53
153
  - feat: DeepBrain exporter
54
154
  - feat: brain/logs/score CLI commands
55
155
 
56
- ## 1.2.0
156
+ ## [1.2.0]
57
157
  - Initial public release
58
158
  - 11 channels, plugins, analytics
59
159
  - Declarative OAD configuration
package/CONTRIBUTING.md CHANGED
@@ -1,36 +1,175 @@
1
- # Contributing
1
+ # Contributing to OPC Agent
2
2
 
3
- Thanks for your interest in contributing!
3
+ Thanks for your interest in contributing! This guide covers everything you need to get started.
4
4
 
5
- ## Getting Started
5
+ ---
6
6
 
7
- 1. Fork the repo
8
- 2. Clone your fork
9
- 3. Install dependencies: `npm install`
10
- 4. Create a branch: `git checkout -b feat/my-feature`
11
- 5. Make your changes
12
- 6. Run tests: `npm test`
13
- 7. Commit: `git commit -m "feat: description"`
14
- 8. Push and open a PR
7
+ ## Development Setup
8
+
9
+ ```bash
10
+ # 1. Fork and clone
11
+ git clone https://github.com/Deepleaper/opc-agent.git
12
+ cd opc-agent
13
+
14
+ # 2. Install dependencies
15
+ npm install
16
+
17
+ # 3. Build (TypeScript → CommonJS)
18
+ npx tsc
19
+
20
+ # 4. Run tests
21
+ npx vitest run
22
+ ```
23
+
24
+ > **Note:** This is a **CommonJS** project (not ESM). All output goes to `dist/`. TypeScript 5.x is required. There are **no native dependencies** — the project uses `sql.js` (WASM) instead of `better-sqlite3` so it works on all platforms without compilation.
25
+
26
+ ---
27
+
28
+ ## Project Structure
29
+
30
+ ```
31
+ src/
32
+ core/ # Agent loop, runtime, session management, OutputGuard
33
+ channels/ # One file per channel: telegram.ts, web.ts, slack.ts, …
34
+ memory/ # DeepBrainMemoryStore, InMemoryStore, vector search
35
+ tools/ # Built-in tools (file ops, web fetch, shell exec, etc.)
36
+ schema/ # Zod schemas and shared TypeScript types
37
+ skills/ # Skill loader, BaseSkill, SkillPlatformFilter
38
+ evolution/ # L1–L4 self-evolution engine
39
+ workflow/ # WorkflowEngine, SandboxManager, SubAgentManager
40
+ cli/ # CLI entry point and command handlers
41
+
42
+ examples/ # Runnable usage examples
43
+ test/ # Test files, co-located with source or in test/
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Testing
49
+
50
+ The project has **1114+ tests** covering unit, integration, and end-to-end scenarios.
51
+
52
+ ```bash
53
+ # Run all tests
54
+ npx vitest run
55
+
56
+ # Run in watch mode during development
57
+ npx vitest
58
+
59
+ # Run a specific test file
60
+ npx vitest run src/core/output-guard.test.ts
61
+ ```
62
+
63
+ **Conventions:**
64
+ - Test files live next to the code they test (`foo.ts` → `foo.test.ts`) or under `test/`.
65
+ - Use `describe` / `it` / `expect` from Vitest — no Jest imports.
66
+ - Mock at the boundary: stub external HTTP calls and file I/O, but don't mock internal modules unless unavoidable.
67
+ - Every new feature or bug fix must include a corresponding test.
68
+
69
+ ---
70
+
71
+ ## Adding a Channel
72
+
73
+ Channels live in `src/channels/`. Each channel extends `BaseChannel` and plugs into the `AgentRuntime`.
74
+
75
+ 1. **Create the file**: `src/channels/my-channel.ts`
76
+
77
+ ```typescript
78
+ import { BaseChannel, type OutboundMessage } from '../core/base-channel';
79
+
80
+ export class MyChannel extends BaseChannel {
81
+ readonly name = 'my-channel';
82
+
83
+ async start(): Promise<void> {
84
+ // Connect to the external service
85
+ }
86
+
87
+ async stop(): Promise<void> {
88
+ // Disconnect cleanly
89
+ }
90
+
91
+ protected async send(message: OutboundMessage): Promise<void> {
92
+ // Deliver the message — OutputGuard has already run at this point
93
+ }
94
+ }
95
+ ```
96
+
97
+ 2. **Register it** in `src/core/runtime.ts` alongside existing channels.
98
+
99
+ 3. **Add a test** in `src/channels/my-channel.test.ts`.
100
+
101
+ 4. **Document it** in the CLI table in `README.md` and `README.zh-CN.md`.
102
+
103
+ > OutputGuard runs automatically on every message before `send()` is called — you do not need to add sanitization logic in your channel.
104
+
105
+ ---
106
+
107
+ ## Adding a Built-in Tool
108
+
109
+ Built-in tools live in `src/tools/`. Each tool implements the `BuiltinTool` interface and is auto-discovered at runtime.
110
+
111
+ 1. **Create the file**: `src/tools/my-tool.ts`
112
+
113
+ ```typescript
114
+ import { type BuiltinTool, type ToolResult } from '../schema/tool';
115
+
116
+ export const myTool: BuiltinTool = {
117
+ name: 'my_tool',
118
+ description: 'What this tool does, for the model to read',
119
+ parameters: {
120
+ type: 'object',
121
+ properties: {
122
+ input: { type: 'string', description: 'The input value' },
123
+ },
124
+ required: ['input'],
125
+ },
126
+ async execute(args: { input: string }): Promise<ToolResult> {
127
+ return { content: `Result: ${args.input}` };
128
+ },
129
+ };
130
+ ```
131
+
132
+ 2. **Export it** from `src/tools/index.ts`.
133
+
134
+ 3. **Add a test** in `src/tools/my-tool.test.ts`.
135
+
136
+ ---
15
137
 
16
138
  ## Commit Convention
17
139
 
18
- - `feat:` New feature
19
- - `fix:` Bug fix
20
- - `docs:` Documentation
21
- - `test:` Tests
22
- - `refactor:` Refactoring
23
- - `chore:` Build/tooling
140
+ | Prefix | Use for |
141
+ |--------|---------|
142
+ | `feat:` | New feature |
143
+ | `fix:` | Bug fix |
144
+ | `docs:` | Documentation only |
145
+ | `test:` | Tests only |
146
+ | `refactor:` | Code restructuring without behavior change |
147
+ | `chore:` | Build, tooling, dependencies |
148
+
149
+ Examples:
150
+ ```
151
+ feat: add WeChat Work channel
152
+ fix: OutputGuard false-positive on base64 strings
153
+ docs: add channel mini-guide to CONTRIBUTING
154
+ ```
155
+
156
+ ---
24
157
 
25
- ## Code Style
158
+ ## Pull Request Checklist
26
159
 
27
- - TypeScript
28
- - Run `npm run lint` before committing (if available)
160
+ - [ ] `npx tsc` passes with no errors
161
+ - [ ] `npx vitest run` all tests pass, new tests added
162
+ - [ ] No `.js` output files committed (build artifacts are gitignored)
163
+ - [ ] Docs updated if you added or changed a public API or CLI command
164
+
165
+ ---
29
166
 
30
167
  ## Questions?
31
168
 
32
- Open a Discussion or Issue.
169
+ Open a [Discussion](https://github.com/Deepleaper/opc-agent/discussions) for design questions or [Issues](https://github.com/Deepleaper/opc-agent/issues) for bugs.
170
+
171
+ ---
33
172
 
34
173
  ## License
35
174
 
36
- By contributing, you agree that your contributions will be licensed under Apache-2.0.
175
+ By contributing, you agree that your contributions will be licensed under **Apache-2.0**.
package/README.md CHANGED
@@ -1,190 +1,198 @@
1
1
  <div align="center">
2
2
 
3
- # ⚡ OPC Agent — 瞬知 Studio
3
+ # ⚡ OPC Agent
4
4
 
5
- **Your AI workforce, running locally. Zero cloud cost to start.**
5
+ **Your own AI employee local, private, gets smarter over time.**
6
6
 
7
- One computer. One command. Your own AI agents — learning, evolving, working 24/7.
8
-
9
- [![npm](https://img.shields.io/npm/v/opc-agent/alpha)](https://www.npmjs.com/package/opc-agent)
7
+ [![npm](https://img.shields.io/npm/v/opc-agent/alpha?label=opc-agent%40alpha)](https://www.npmjs.com/package/opc-agent)
10
8
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
11
9
  [![Node](https://img.shields.io/badge/Node.js-%3E%3D18-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
10
+ [![Tests](https://img.shields.io/badge/tests-1226%2B-brightgreen)](tests/)
12
11
 
13
- [Quick Start](#-quick-start) · [Features](#-features) · [Architecture](#-architecture) · [CLI](#-cli-commands) · [中文](README.zh-CN.md)
12
+ [中文文档](README.zh-CN.md)
14
13
 
15
14
  </div>
16
15
 
17
16
  ---
18
17
 
19
- ## 🚀 Quick Start
18
+ ## Why OPC Agent?
19
+
20
+ AI Agents are powerful, but hard to use for most people:
21
+
22
+ - **Expensive** — Cloud agents charge per token. Costs add up fast.
23
+ - **No memory** — Every conversation starts from scratch.
24
+ - **Data privacy** — Your chats and documents live on someone else's servers.
25
+ - **Can only chat** — Can't read files, search the web, or run code.
26
+
27
+ **OPC Agent fixes all of this:**
28
+
29
+ ✅ Runs locally, zero cost (powered by Ollama)<br>
30
+ ✅ Gets smarter over time (automatic learning & evolution)<br>
31
+ ✅ Your data stays on your machine<br>
32
+ ✅ Can read/write files, search the web, execute code, use tools
33
+
34
+ ---
35
+
36
+ ## 🚀 Install
20
37
 
21
- ### One-Line Install (recommended)
38
+ Pick your OS, copy one line:
39
+
40
+ ### macOS / Linux
22
41
 
23
42
  ```bash
24
- # macOS / Linux
25
43
  curl -fsSL https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.sh | bash
44
+ ```
26
45
 
27
- # Windows (PowerShell)
46
+ ### Windows
47
+
48
+ ```powershell
28
49
  irm https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.ps1 | iex
29
50
  ```
30
51
 
31
- This automatically installs Node.js, OPC Agent, Ollama, and a recommended AI model based on your hardware.
52
+ > The installer automatically sets up Node.js, OPC Agent, Ollama, and the best AI model for your hardware. No manual steps.
32
53
 
33
- ### Or install manually
54
+ ### Manual install
34
55
 
35
56
  ```bash
36
57
  npm install -g opc-agent@alpha
37
- opc setup # Interactive setup wizard
38
58
  ```
39
59
 
40
- ### Get started in 30 seconds
60
+ ---
61
+
62
+ ## ⚡ Get started in 30 seconds
63
+
64
+ ### Step 1: Create your AI employee
41
65
 
42
66
  ```bash
43
- opc chat # Chat in terminal
44
- opc studio # Open web UI → localhost:4000
45
- opc run # Start everything: Agent + Telegram + Web + Studio
67
+ opc init my-agent
68
+ cd my-agent
46
69
  ```
47
70
 
48
- ---
49
-
50
- ## ✨ Features
71
+ ### Step 2: Start chatting
51
72
 
52
- | Feature | Description |
53
- |---------|-------------|
54
- | 🧠 **Self-Evolving** | 4-layer evolution engine: Experience → Memory → Skills → Group knowledge |
55
- | 💰 **Zero Cost Start** | Runs 100% locally with Ollama. No API key needed. |
56
- | 🎨 **Studio UI** | Web-based management at localhost:4000 — models, channels, knowledge, templates |
57
- | 📱 **Multi-Channel** | Telegram, Web, WeChat, Feishu, Discord, Slack, Email |
58
- | 🔧 **40 Built-in Skills** | File ops, web search, code execution, image generation, and more |
59
- | 🤖 **A2A Protocol** | Agent-to-agent communication for multi-agent workflows |
60
- | 📦 **All-in-One** | DeepBrain (knowledge) + AgentKits (models) + Workstation (templates) |
61
- | 🔒 **Privacy First** | Your data stays on your machine. No telemetry. |
73
+ ```bash
74
+ opc chat
75
+ ```
62
76
 
63
- ---
77
+ That's it. Your AI employee is ready.
64
78
 
65
- ## 🏗 Architecture
79
+ ### More
66
80
 
67
- ```
68
- ┌──────────────────────────────────────────┐
69
- │ OPC Agent CLI │
70
- │ opc chat · opc studio · opc run │
71
- ├──────────────────────────────────────────┤
72
- │ Agent Loop │ Self-Evolution (L1-L4) │
73
- │ Context │ L1 Experience Compile │
74
- │ Assembly │ L2 Memory Consolidate │
75
- │ │ L3 Skill Discovery │
76
- │ │ L4 Group Evolution │
77
- ├──────────────────────────────────────────┤
78
- │ DeepBrain │ AgentKits │Workstation │
79
- │ (Knowledge) │ (Models) │(Templates) │
80
- │ SQLite+FTS5 │ Ollama/API │ Industry │
81
- ├──────────────────────────────────────────┤
82
- │ Channels │
83
- │ Telegram │ Web │ WeChat │ Feishu │ ... │
84
- └──────────────────────────────────────────┘
81
+ ```bash
82
+ opc studio # Web dashboard at localhost:4000
83
+ opc run # Start everything: chat + Telegram + web + dashboard
85
84
  ```
86
85
 
87
- ### How it works
86
+ ---
88
87
 
89
- 1. **You talk** Agent receives message via any channel
90
- 2. **Agent thinks** → Context assembly + tool selection + LLM reasoning
91
- 3. **Agent acts** Executes tools, calls APIs, generates content
92
- 4. **Agent learns** → Every interaction feeds the evolution engine
93
- 5. **Agent evolves** Knowledge distills upward: experience → memory → skills
88
+ ## What can it do?
89
+
90
+ OPC Agent isn't just a chatbot. It's an **AI employee that gets work done**:
91
+
92
+ | Capability | Details |
93
+ |-----------|---------|
94
+ | 💬 **Chat** | Terminal or web interface |
95
+ | 📁 **Read & write files** | Read your docs, write reports, organize notes |
96
+ | 🔍 **Web search** | Real-time search for up-to-date information |
97
+ | 🌐 **Read web pages** | Fetch and summarize any URL |
98
+ | 💻 **Execute code** | Run JavaScript, TypeScript, Python |
99
+ | 🧠 **Memory** | Remembers past conversations, gets smarter over time |
100
+ | 🔧 **MCP tool extensions** | Connect GitHub, databases, Slack, and more |
101
+ | 📱 **Telegram bot** | Add a bot token and chat via Telegram |
102
+ | 🎙 **Voice synthesis** | Text-to-speech via edge-tts |
103
+ | 👥 **Sub-agents** | Spawn parallel workers for complex tasks |
104
+ | 🔄 **Provider failover** | Circuit breaker, automatic retry with fallback |
105
+ | 📋 **20 workstation roles** | Pre-built templates: customer service, engineer, analyst, executive... |
106
+ | ⏰ **Scheduled tasks** | Cron jobs auto-registered from templates |
94
107
 
95
108
  ---
96
109
 
97
- ## 💻 CLI Commands
110
+ ## 🧠 Gets smarter over time
98
111
 
99
- | Command | Description |
100
- |---------|-------------|
101
- | `opc setup` | Interactive setup wizard |
102
- | `opc init [name]` | Create new agent project |
103
- | `opc chat` | Terminal chat with agent |
104
- | `opc studio` | Open Studio web UI (port 4000) |
105
- | `opc run` | Start all services (Agent + channels + Studio) |
106
- | `opc brain stats` | Show knowledge base statistics |
107
- | `opc brain recall <query>` | Semantic search in knowledge |
108
- | `opc brain learn <file>` | Import document into knowledge |
109
- | `opc doctor` | Diagnose installation issues |
112
+ This is what makes OPC Agent different: **it evolves.**
113
+
114
+ ```
115
+ You chat with your AI
116
+
117
+ AI extracts knowledge from the conversation ← automatic
118
+
119
+ Knowledge is saved to a local database ← on your machine
120
+
121
+ Next conversation references that knowledge ← it remembers
122
+
123
+ Knowledge gradually refines and improves ← gets better over time
124
+ ```
125
+
126
+ All learning runs on local Ollama models. **Zero cost.**
127
+
128
+ Knowledge is organized in three layers: **industry → job → workstation** — precise context for every role.
110
129
 
111
130
  ---
112
131
 
113
- ## 🔧 Configuration
132
+ ## 🎨 Studio Dashboard
114
133
 
115
- After `opc setup`, all configuration lives in Studio UI (localhost:4000):
134
+ ```bash
135
+ opc studio
136
+ ```
116
137
 
117
- - **Models** Switch between Ollama models, add cloud API keys
118
- - **Channels** — Configure Telegram bot, WeChat, Feishu, etc.
119
- - **Knowledge** — Drag & drop documents, manage DeepBrain
120
- - **Templates** — Browse industry/job/workstation templates
121
- - **Agent Settings** — Edit personality, skills, model assignments
138
+ Open `localhost:4000` in your browser to:
122
139
 
123
- Config files: `~/.opc/config.json` (global), `oad.yaml` (per agent)
140
+ - **Models** Switch AI models (local or cloud)
141
+ - **Channels** — Configure Telegram bot
142
+ - **Knowledge** — See what your agent has learned
143
+ - **Settings** — Customize personality, skills, behavior
124
144
 
125
145
  ---
126
146
 
127
- ## 📖 Model Support
147
+ ## 📖 Model support
148
+
149
+ ### Local (zero cost)
128
150
 
129
- ### Local (Ollama) Zero Cost
130
- Auto-detected and recommended based on your RAM:
151
+ Auto-recommended based on your RAM:
131
152
 
132
- | RAM | Recommended Model | Size |
133
- |-----|------------------|------|
153
+ | RAM | Model | Download |
154
+ |-----|-------|----------|
134
155
  | ≤3 GB | qwen2.5:0.5b | 400MB |
135
156
  | ≤7 GB | qwen2.5:1.5b | 1.0GB |
136
157
  | ≤15 GB | qwen2.5:7b | 4.7GB |
137
158
  | ≤31 GB | qwen2.5:14b | 9.0GB |
138
159
  | 32+ GB | qwen2.5:32b | 19GB |
139
160
 
140
- ### Cloud (via AgentKits)
141
- Configure in Studio → Models: OpenAI, DeepSeek, Anthropic, Qwen, Google Gemini
161
+ ### Cloud (optional)
142
162
 
143
- ---
163
+ Add API keys in Studio: OpenAI, DeepSeek, Anthropic, Qwen, Google Gemini
144
164
 
145
- ## 🌐 Multi-Channel
146
-
147
- | Channel | Setup |
148
- |---------|-------|
149
- | 💬 Web Chat | Built-in, localhost:3000 |
150
- | 📱 Telegram | Add bot token in Studio |
151
- | 💬 WeChat | Add app credentials in Studio |
152
- | 🐦 Feishu | Add app credentials in Studio |
153
- | 🎮 Discord | Add bot token in Studio |
154
- | 💼 Slack | Add bot token in Studio |
155
- | 📧 Email | Add SMTP config in Studio |
165
+ Automatic failover with circuit breaker — if one provider goes down, the next one takes over instantly.
156
166
 
157
167
  ---
158
168
 
159
- ## 🧬 Self-Evolution
160
-
161
- OPC Agent gets smarter over time through 4 layers of evolution:
169
+ ## 📋 Commands
162
170
 
163
- - **L1 Experience Compilation**: Raw interactions → structured insights (local Ollama)
164
- - **L2 — Memory Consolidation**: Insights → refined knowledge (cloud AgentKits)
165
- - **L3 Skill Discovery**: Patterns auto-generated skills (cloud AgentKits)
166
- - **L4 Group Evolution**: Individual knowledge → shared wisdom (local Ollama)
167
-
168
- All L1/L4 processing runs locally at zero cost. L2/L3 uses cloud models for higher quality.
171
+ | Command | What it does |
172
+ |---------|-------------|
173
+ | `opc init [name]` | Create an AI employee |
174
+ | `opc chat` | Chat in terminal |
175
+ | `opc studio` | Open web dashboard |
176
+ | `opc run` | Start all services |
177
+ | `opc brain stats` | Knowledge base status |
178
+ | `opc brain recall "query"` | Search knowledge |
179
+ | `opc brain learn file.md` | Import a document |
180
+ | `opc voice test "hello"` | Test voice synthesis |
181
+ | `opc mcp list` | List connected tools |
182
+ | `opc doctor` | Diagnose issues |
183
+ | `opc init --role <name>` | Create from workstation template |
184
+ | `opc init --list-roles` | See available roles |
185
+ | `opc template check <path>` | Validate template quality |
186
+ | `opc template test <path>` | Run template tests |
169
187
 
170
188
  ---
171
189
 
172
- ## 📦 Project Structure
190
+ ## 🔒 Privacy
173
191
 
174
- ```
175
- ~/.opc/ # Global config
176
- config.json # Settings
177
- agents/ # Agent data
178
-
179
- my-agent/ # Agent workspace
180
- EGO.md # Agent personality
181
- DEEPBRAIN.md # Knowledge summary
182
- oad.yaml # Agent definition
183
- .opc/
184
- brain.db # Knowledge database
185
- skills/ # Auto-generated skills
186
- evolution/ # Evolution logs
187
- ```
192
+ - All data stored locally on your machine
193
+ - No telemetry
194
+ - Local Ollama models never touch the cloud
195
+ - Your knowledge, conversations, and files stay private
188
196
 
189
197
  ---
190
198
 
@@ -195,7 +203,7 @@ git clone https://github.com/Deepleaper/opc-agent.git
195
203
  cd opc-agent
196
204
  npm install
197
205
  npx tsc # Build
198
- npx vitest run # Test (1100+ tests)
206
+ npx vitest run # Test
199
207
  ```
200
208
 
201
209
  ---
@@ -208,8 +216,8 @@ Apache-2.0 © [Deepleaper](https://github.com/Deepleaper)
208
216
 
209
217
  <div align="center">
210
218
 
211
- **Built by [Deepleaper](https://www.deepleaper.com)** — Making AI work for everyone.
219
+ **Built by [Deepleaper](https://www.deepleaper.com)**
212
220
 
213
- ⭐ Star this repo if OPC Agent helps you!
221
+ ⭐ Star this repo if it helps you!
214
222
 
215
223
  </div>