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.
- package/CHANGELOG.md +104 -4
- package/CONTRIBUTING.md +161 -22
- package/README.md +130 -122
- package/README.zh-CN.md +163 -71
- package/dist/channels/discord.d.ts.map +1 -1
- package/dist/channels/discord.js +3 -1
- package/dist/channels/discord.js.map +1 -1
- package/dist/channels/message-queue.d.ts +19 -0
- package/dist/channels/message-queue.d.ts.map +1 -0
- package/dist/channels/message-queue.js +59 -0
- package/dist/channels/message-queue.js.map +1 -0
- package/dist/channels/slack.d.ts.map +1 -1
- package/dist/channels/slack.js +3 -1
- package/dist/channels/slack.js.map +1 -1
- package/dist/channels/telegram.d.ts +7 -0
- package/dist/channels/telegram.d.ts.map +1 -1
- package/dist/channels/telegram.js +63 -32
- package/dist/channels/telegram.js.map +1 -1
- package/dist/channels/web.d.ts +3 -0
- package/dist/channels/web.d.ts.map +1 -1
- package/dist/channels/web.js +12 -2
- package/dist/channels/web.js.map +1 -1
- package/dist/channels/wechat.d.ts.map +1 -1
- package/dist/channels/wechat.js +3 -1
- package/dist/channels/wechat.js.map +1 -1
- package/dist/cli/agent.d.ts +3 -0
- package/dist/cli/agent.d.ts.map +1 -0
- package/dist/cli/agent.js +665 -0
- package/dist/cli/agent.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +29 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/mcp.d.ts +3 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +143 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/misc.d.ts +3 -0
- package/dist/cli/misc.d.ts.map +1 -0
- package/dist/cli/misc.js +1219 -0
- package/dist/cli/misc.js.map +1 -0
- package/dist/cli/run.d.ts +3 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +219 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +333 -7
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/shared.d.ts +36 -0
- package/dist/cli/shared.d.ts.map +1 -0
- package/dist/cli/shared.js +196 -0
- package/dist/cli/shared.js.map +1 -0
- package/dist/cli/studio.d.ts +3 -0
- package/dist/cli/studio.d.ts.map +1 -0
- package/dist/cli/studio.js +31 -0
- package/dist/cli/studio.js.map +1 -0
- package/dist/cli/template.d.ts +3 -0
- package/dist/cli/template.d.ts.map +1 -0
- package/dist/cli/template.js +247 -0
- package/dist/cli/template.js.map +1 -0
- package/dist/cli.js +3 -2746
- package/dist/cli.js.map +1 -1
- package/dist/core/agent.d.ts +33 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +414 -71
- package/dist/core/agent.js.map +1 -1
- package/dist/core/context-assembler.d.ts.map +1 -1
- package/dist/core/context-assembler.js +4 -1
- package/dist/core/context-assembler.js.map +1 -1
- package/dist/core/context-compressor.d.ts +29 -0
- package/dist/core/context-compressor.d.ts.map +1 -0
- package/dist/core/context-compressor.js +103 -0
- package/dist/core/context-compressor.js.map +1 -0
- package/dist/core/heartbeat-monitor.d.ts +18 -0
- package/dist/core/heartbeat-monitor.d.ts.map +1 -0
- package/dist/core/heartbeat-monitor.js +38 -0
- package/dist/core/heartbeat-monitor.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +20 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/output-guard.d.ts +17 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +134 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/progressive-disclosure.d.ts +17 -0
- package/dist/core/progressive-disclosure.d.ts.map +1 -0
- package/dist/core/progressive-disclosure.js +34 -0
- package/dist/core/progressive-disclosure.js.map +1 -0
- package/dist/core/runtime.d.ts +4 -0
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +228 -39
- package/dist/core/runtime.js.map +1 -1
- package/dist/core/scheduler.d.ts +5 -0
- package/dist/core/scheduler.d.ts.map +1 -1
- package/dist/core/scheduler.js.map +1 -1
- package/dist/core/session-events.d.ts +15 -0
- package/dist/core/session-events.d.ts.map +1 -0
- package/dist/core/session-events.js +28 -0
- package/dist/core/session-events.js.map +1 -0
- package/dist/core/sub-agent.d.ts +16 -0
- package/dist/core/sub-agent.d.ts.map +1 -0
- package/dist/core/sub-agent.js +47 -0
- package/dist/core/sub-agent.js.map +1 -0
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/deepbrain/provider.d.ts +3 -0
- package/dist/deepbrain/provider.d.ts.map +1 -1
- package/dist/deepbrain/provider.js +12 -0
- package/dist/deepbrain/provider.js.map +1 -1
- package/dist/integrations/index.d.ts +3 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +7 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/mcp-client.d.ts +20 -0
- package/dist/integrations/mcp-client.d.ts.map +1 -0
- package/dist/integrations/mcp-client.js +51 -0
- package/dist/integrations/mcp-client.js.map +1 -0
- package/dist/memory/evolve-engine.d.ts +6 -1
- package/dist/memory/evolve-engine.d.ts.map +1 -1
- package/dist/memory/evolve-engine.js +81 -36
- package/dist/memory/evolve-engine.js.map +1 -1
- package/dist/memory/hybrid-search.d.ts +22 -0
- package/dist/memory/hybrid-search.d.ts.map +1 -0
- package/dist/memory/hybrid-search.js +141 -0
- package/dist/memory/hybrid-search.js.map +1 -0
- package/dist/memory/index.d.ts +9 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +23 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/insights-extractor.d.ts +14 -0
- package/dist/memory/insights-extractor.d.ts.map +1 -0
- package/dist/memory/insights-extractor.js +47 -0
- package/dist/memory/insights-extractor.js.map +1 -0
- package/dist/memory/session-search.d.ts +18 -0
- package/dist/memory/session-search.d.ts.map +1 -0
- package/dist/memory/session-search.js +52 -0
- package/dist/memory/session-search.js.map +1 -0
- package/dist/memory/sqlite-conversation-store.d.ts +16 -0
- package/dist/memory/sqlite-conversation-store.d.ts.map +1 -0
- package/dist/memory/sqlite-conversation-store.js +132 -0
- package/dist/memory/sqlite-conversation-store.js.map +1 -0
- package/dist/memory/sqlite-store.js +43 -43
- package/dist/providers/index.d.ts +16 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +155 -14
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai-compat.d.ts +1 -0
- package/dist/providers/openai-compat.d.ts.map +1 -1
- package/dist/providers/openai-compat.js +4 -2
- package/dist/providers/openai-compat.js.map +1 -1
- package/dist/publish/index.d.ts.map +1 -1
- package/dist/publish/index.js +16 -3
- package/dist/publish/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +3 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +8 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/manager.d.ts +31 -0
- package/dist/sandbox/manager.d.ts.map +1 -0
- package/dist/sandbox/manager.js +123 -0
- package/dist/sandbox/manager.js.map +1 -0
- 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 +752 -202
- package/dist/schema/oad.d.ts.map +1 -1
- package/dist/schema/oad.js +36 -1
- package/dist/schema/oad.js.map +1 -1
- package/dist/security/index.d.ts +2 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +3 -1
- package/dist/security/index.js.map +1 -1
- package/dist/security/injection-detector.d.ts +10 -0
- package/dist/security/injection-detector.d.ts.map +1 -0
- package/dist/security/injection-detector.js +63 -0
- package/dist/security/injection-detector.js.map +1 -0
- package/dist/skills/auto-learn.d.ts +5 -1
- package/dist/skills/auto-learn.d.ts.map +1 -1
- package/dist/skills/auto-learn.js +31 -3
- package/dist/skills/auto-learn.js.map +1 -1
- package/dist/skills/skill-loader.js +1 -1
- package/dist/skills/skill-loader.js.map +1 -1
- package/dist/studio/server.d.ts +8 -1
- package/dist/studio/server.d.ts.map +1 -1
- package/dist/studio/server.js +204 -24
- package/dist/studio/server.js.map +1 -1
- package/dist/studio-ui/index.html +767 -16
- package/dist/templates/ceo-coach/AGENTS.md +59 -0
- package/dist/templates/ceo-coach/CASES-100.md +547 -0
- package/dist/templates/ceo-coach/COLD-START.md +72 -0
- package/dist/templates/ceo-coach/EGO.md +39 -0
- package/dist/templates/ceo-coach/FRAMEWORKS.md +71 -0
- package/dist/templates/ceo-coach/HEARTBEAT.md +22 -0
- package/dist/templates/ceo-coach/IDENTITY.md +6 -0
- package/dist/templates/ceo-coach/KNOWLEDGE.md +201 -0
- package/dist/templates/ceo-coach/MEMORY.md +23 -0
- package/dist/templates/ceo-coach/ONBOARDING.md +41 -0
- package/dist/templates/ceo-coach/USER.md +8 -0
- package/dist/templates/ceo-coach/template.yaml +27 -0
- package/dist/templates/ceo-coach-socratic/AGENTS.md +21 -0
- package/dist/templates/ceo-coach-socratic/EGO.md +22 -0
- package/dist/templates/ceo-coach-socratic/KNOWLEDGE.md +21 -0
- package/dist/templates/ceo-coach-socratic/MEMORY.md +10 -0
- package/dist/templates/ceo-coach-socratic/USER.md +15 -0
- package/dist/templates/ceo-coach-socratic/template.yaml +21 -0
- package/dist/templates/data-analyst.js +1 -1
- package/dist/templates/data-analyst.js.map +1 -1
- package/dist/templates/quality-checker.d.ts +11 -0
- package/dist/templates/quality-checker.d.ts.map +1 -0
- package/dist/templates/quality-checker.js +115 -0
- package/dist/templates/quality-checker.js.map +1 -0
- package/dist/templates/teacher.js +1 -1
- package/dist/templates/teacher.js.map +1 -1
- package/dist/templates/template-provider.d.ts +38 -0
- package/dist/templates/template-provider.d.ts.map +1 -1
- package/dist/templates/template-provider.js +205 -3
- package/dist/templates/template-provider.js.map +1 -1
- package/dist/templates/test-runner.d.ts +27 -0
- package/dist/templates/test-runner.d.ts.map +1 -0
- package/dist/templates/test-runner.js.map +1 -0
- package/dist/tools/builtin/browser.d.ts.map +1 -1
- package/dist/tools/builtin/browser.js +114 -10
- package/dist/tools/builtin/browser.js.map +1 -1
- package/dist/tools/builtin/content-scanner.d.ts +7 -0
- package/dist/tools/builtin/content-scanner.d.ts.map +1 -0
- package/dist/tools/builtin/content-scanner.js +37 -0
- package/dist/tools/builtin/content-scanner.js.map +1 -0
- package/dist/tools/builtin/cron-manage.d.ts +10 -0
- package/dist/tools/builtin/cron-manage.d.ts.map +1 -0
- package/dist/tools/builtin/cron-manage.js +187 -0
- package/dist/tools/builtin/cron-manage.js.map +1 -0
- package/dist/tools/builtin/execute-code.d.ts +3 -0
- package/dist/tools/builtin/execute-code.d.ts.map +1 -0
- package/dist/tools/builtin/execute-code.js +124 -0
- package/dist/tools/builtin/execute-code.js.map +1 -0
- package/dist/tools/builtin/index.d.ts +12 -1
- package/dist/tools/builtin/index.d.ts.map +1 -1
- package/dist/tools/builtin/index.js +43 -4
- package/dist/tools/builtin/index.js.map +1 -1
- package/dist/tools/builtin/memory-manage.d.ts +13 -0
- package/dist/tools/builtin/memory-manage.d.ts.map +1 -0
- package/dist/tools/builtin/memory-manage.js +163 -0
- package/dist/tools/builtin/memory-manage.js.map +1 -0
- 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/session-search.d.ts +3 -0
- package/dist/tools/builtin/session-search.d.ts.map +1 -0
- package/dist/tools/builtin/session-search.js +31 -0
- package/dist/tools/builtin/session-search.js.map +1 -0
- package/dist/tools/builtin/skill-filter.d.ts +3 -0
- package/dist/tools/builtin/skill-filter.d.ts.map +1 -0
- package/dist/tools/builtin/skill-filter.js +141 -0
- package/dist/tools/builtin/skill-filter.js.map +1 -0
- package/dist/tools/builtin/skill-manage.d.ts +13 -0
- package/dist/tools/builtin/skill-manage.d.ts.map +1 -0
- package/dist/tools/builtin/skill-manage.js +147 -0
- package/dist/tools/builtin/skill-manage.js.map +1 -0
- package/dist/tools/builtin/skill-to-tool.d.ts +6 -0
- package/dist/tools/builtin/skill-to-tool.d.ts.map +1 -0
- package/dist/tools/builtin/skill-to-tool.js +171 -0
- package/dist/tools/builtin/skill-to-tool.js.map +1 -0
- package/dist/tools/builtin/skill-writer.d.ts +3 -0
- package/dist/tools/builtin/skill-writer.d.ts.map +1 -0
- package/dist/tools/builtin/skill-writer.js +90 -0
- package/dist/tools/builtin/skill-writer.js.map +1 -0
- package/dist/tools/builtin/subagent.d.ts +7 -0
- package/dist/tools/builtin/subagent.d.ts.map +1 -0
- package/dist/tools/builtin/subagent.js +93 -0
- package/dist/tools/builtin/subagent.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/tools/integrations/summarizer.js +1 -1
- package/dist/tools/integrations/summarizer.js.map +1 -1
- package/dist/tools/integrations/translator.js +1 -1
- package/dist/tools/integrations/translator.js.map +1 -1
- package/dist/tools/mcp-client.d.ts +14 -1
- package/dist/tools/mcp-client.d.ts.map +1 -1
- package/dist/tools/mcp-client.js +63 -1
- package/dist/tools/mcp-client.js.map +1 -1
- package/dist/tools/mcp-server.d.ts +21 -0
- package/dist/tools/mcp-server.d.ts.map +1 -0
- package/dist/tools/mcp-server.js +157 -0
- package/dist/tools/mcp-server.js.map +1 -0
- package/dist/tui/log-stream.d.ts +19 -0
- package/dist/tui/log-stream.d.ts.map +1 -0
- package/dist/tui/log-stream.js +45 -0
- package/dist/tui/log-stream.js.map +1 -0
- package/dist/utils/dynamic-import.js +5 -5
- package/dist/voice/stt.d.ts +4 -0
- package/dist/voice/stt.d.ts.map +1 -0
- package/dist/voice/stt.js +147 -0
- package/dist/voice/stt.js.map +1 -0
- package/dist/voice/tts.d.ts +10 -0
- package/dist/voice/tts.d.ts.map +1 -0
- package/dist/voice/tts.js +153 -0
- package/dist/voice/tts.js.map +1 -0
- package/dist/workflow/engine.d.ts +41 -0
- package/dist/workflow/engine.d.ts.map +1 -0
- package/dist/workflow/engine.js +147 -0
- package/dist/workflow/engine.js.map +1 -0
- package/dist/workflow/index.d.ts +3 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +6 -0
- package/dist/workflow/index.js.map +1 -0
- package/examples/README.md +55 -10
- package/install.ps1 +144 -127
- package/install.sh +165 -154
- package/models.json +29 -164
- package/oad.yaml +15 -0
- package/package.json +67 -67
- package/scripts/install.ps1 +8 -0
- package/scripts/install.sh +11 -1
- package/scripts/postbuild.js +26 -8
- package/.opc/brain.db +0 -0
- package/.opc/memory.db +0 -0
- package/.opc/schedules.json +0 -904
- package/.opc/skills/auto-greet-user.md +0 -21
- package/.opc/skills/greeting.md +0 -11
- package/.opc/voice-tmp/tts-1776835848670.mp3 +0 -0
- package/.opc/voice-tmp/tts-1776835873696.mp3 +0 -0
- 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/TASK.md +0 -36
- package/cc-err.txt +0 -0
- package/cc-err2.txt +0 -0
- package/cc-err3.txt +0 -0
- package/data/brain.db/deepbrain.sqlite +0 -0
- package/s-err.log +0 -0
- package/s-out.log +0 -6
- package/studio-dbg.log +0 -1
- package/studio-err.log +0 -12
- package/studio-out.log +0 -0
- 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/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
|
|
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
|
|
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
|
|
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
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
##
|
|
158
|
+
## Pull Request Checklist
|
|
26
159
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
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
|
|
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
|
|
3
|
+
# ⚡ OPC Agent
|
|
4
4
|
|
|
5
|
-
**Your AI
|
|
5
|
+
**Your own AI employee — local, private, gets smarter over time.**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[](https://www.npmjs.com/package/opc-agent)
|
|
7
|
+
[](https://www.npmjs.com/package/opc-agent)
|
|
10
8
|
[](LICENSE)
|
|
11
9
|
[](https://nodejs.org/)
|
|
10
|
+
[](tests/)
|
|
12
11
|
|
|
13
|
-
[
|
|
12
|
+
[中文文档](README.zh-CN.md)
|
|
14
13
|
|
|
15
14
|
</div>
|
|
16
15
|
|
|
17
16
|
---
|
|
18
17
|
|
|
19
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
46
|
+
### Windows
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
28
49
|
irm https://raw.githubusercontent.com/Deepleaper/opc-agent/main/install.ps1 | iex
|
|
29
50
|
```
|
|
30
51
|
|
|
31
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## ⚡ Get started in 30 seconds
|
|
63
|
+
|
|
64
|
+
### Step 1: Create your AI employee
|
|
41
65
|
|
|
42
66
|
```bash
|
|
43
|
-
opc
|
|
44
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
79
|
+
### More
|
|
66
80
|
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
86
|
+
---
|
|
88
87
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
##
|
|
110
|
+
## 🧠 Gets smarter over time
|
|
98
111
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
##
|
|
132
|
+
## 🎨 Studio Dashboard
|
|
114
133
|
|
|
115
|
-
|
|
134
|
+
```bash
|
|
135
|
+
opc studio
|
|
136
|
+
```
|
|
116
137
|
|
|
117
|
-
|
|
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
|
-
|
|
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
|
|
147
|
+
## 📖 Model support
|
|
148
|
+
|
|
149
|
+
### Local (zero cost)
|
|
128
150
|
|
|
129
|
-
|
|
130
|
-
Auto-detected and recommended based on your RAM:
|
|
151
|
+
Auto-recommended based on your RAM:
|
|
131
152
|
|
|
132
|
-
| RAM |
|
|
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 (
|
|
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
|
-
|
|
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
|
-
##
|
|
160
|
-
|
|
161
|
-
OPC Agent gets smarter over time through 4 layers of evolution:
|
|
169
|
+
## 📋 Commands
|
|
162
170
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
##
|
|
190
|
+
## 🔒 Privacy
|
|
173
191
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
|
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)**
|
|
219
|
+
**Built by [Deepleaper](https://www.deepleaper.com)**
|
|
212
220
|
|
|
213
|
-
⭐ Star this repo if
|
|
221
|
+
⭐ Star this repo if it helps you!
|
|
214
222
|
|
|
215
223
|
</div>
|