Commit Graph

41 Commits

Author SHA1 Message Date
renjianbo
3c102ed5f9 feat: #27 插件系统 — 第三方节点扩展
- NodePlugin 模型: manifest规范(name/version/node_type/inputs_schema/outputs_schema)
- plugin_loader 服务: manifest校验、代码加载/卸载、沙箱执行(subprocess隔离+超时30s)
- plugins API: CRUD、启用/禁用、市场浏览、安装计数、沙箱测试执行
- PluginMarket.vue: 插件市场上传/浏览/安装/启用禁用/删除/测试
- 注册 register_external_tool 到 tool_registry,供工作流编辑器使用

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-06 21:44:45 +08:00
renjianbo
1b5f9deb44 feat: #36 主控台/应用商店 — 模板一键执行与模板市场一键安装
- MainConsole.vue: 完全重写为应用商店主控台,支持分类筛选、参数表单、一键执行、进度轮询、结果下载
- TemplateMarket.vue: 新增"一键安装"和"快速执行"按钮,优化业务用户体验
- platform_templates.py: 新增模板执行API(POST execute + GET progress),支持Celery异步/同步回退

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-06 21:30:58 +08:00
renjianbo
fa13ffe479 fix: 修复人参果agent主动消息循环+创建人参果1号
- renshenguo_ws_handler: 注入7条行为约束规则,禁止agent在无用户输入时主动发消息
- renshenguo2_ws_handler: 新增人参果1号 WS handler(行为约束版)
- renshenguo2_app_service: 新增人参果1号飞书消息服务
- config.py/main.py: 注册RENSHENGUO2配置和长连接启动

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-06 21:13:44 +08:00
renjianbo
eabf90c496 feat: add AI学习助手 agent (KG+RAG ideal) and renshenguo feishu bot
- Add AI学习助手 agent creation script with all 39 tools, 3-layer KG+RAG memory
- Add renshenguo (人参果) feishu bot integration (app_service + ws_handler)
- Register renshenguo WS client in main.py startup
- Add RENSHENGUO_APP_ID / RENSHENGUO_APP_SECRET / RENSHENGUO_AGENT_ID config
- Reorganize docs from root into docs/ subdirectories
- Move startup scripts to scripts/startup/
- Various backend optimizations and tool improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-06 01:37:13 +08:00
renjianbo
f33bc461ff fix: resolve Feishu cross-app notification routing bug
Implement per-app open_id storage via user_feishu_open_ids table with
union_id-based cross-app user identification. WS handlers now auto-capture
open_id+union_id and resolve/associate user accounts. Schedule notifications
route through the correct bot's open_id instead of always falling back to 苹果.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-06 00:36:40 +08:00
renjianbo
3dd098482e fix: compute_next_run naive datetime treated as local time instead of UTC
When datetime.utcnow() (naive) was passed as after=, astimezone() treated
it as system-local time (Beijing), causing next_run_at to be calculated
incorrectly. Now naive datetimes are explicitly localized to UTC first.

Also replaced deprecated datetime.utcnow() with aware UTC equivalent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 09:20:14 +08:00
renjianbo
0606137d57 fix: schedule timezone bug + missing notifications + celery beat startup
- Timezone: compute_next_run now correctly interprets cron in the schedule's
  configured timezone (e.g., "0 8 * * *" with Asia/Shanghai = 8AM Beijing, not UTC)
- Notifications: agent_tasks now reuses pre-created execution records and calls
  notify_schedule_result on completion, so non-workflow agent schedules get
  DB notifications + Feishu webhook + Feishu app messages
- Duplicate execution: execute_agent_task accepts optional execution_id to reuse
  the record created by schedule_service instead of creating a second one
- Celery Beat: added to restart_backend_celery.ps1, stop_aiagent.ps1, and
  docker-compose.dev.yml; fixed repo-root path resolution in all PS1 scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 08:57:00 +08:00
renjianbo
592bca4f39 feat: Phase 4 - LLM/Agent fallback chain, cross-agent knowledge sharing, async agent execution
- 4.1 Fallback chain: LLM fallback_llm config in AgentLLMConfig, retry with alternate model on API failure; Agent fallback_agent in DAG nodes
- 4.2 Knowledge sharing: GlobalKnowledge model with embedding-based semantic search, auto-extraction of tool names as tags after execution
- 4.3 Async execution: execute_agent_task fully implemented with AgentRuntime, scheduler dual-path for workflow/non-workflow agents

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 00:27:54 +08:00
renjianbo
7e00b027d4 feat: Phase 3 - parallel execution, progress reporting, result caching + AgentChat bug fixes
Phase 3 能力:
- DAG 并行执行 (workflow_engine): asyncio.gather 并行执行就绪节点
- Debate 并行 (orchestrator): for 循环改为 asyncio.gather
- 粒度进度上报 (workflow_engine + tasks + websocket): Redis 推送 + DB 降级
- 工具结果缓存 (tool_manager): 确定性工具默认开启缓存
- LLM 响应缓存 (core): messages[-4:] + model 哈希,5min TTL

AgentChat bug 修复 (Gitea #1-#5):
- #1 SSE 降级重复空消息: fallback POST 前移除占位消息
- #2 streamTimeout 泄漏: while 正常退出后 clearTimeout
- #3 loading 闪烁: final/error 事件中提前设 loading=false
- #4 SSE 事件类型对齐: 确认匹配,未知类型加 console.warn
- #5 retryMessage 流式残留: 重试时清理占位消息

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 00:00:51 +08:00
renjianbo
f3cb35c460 feat: Phase 2 - Orchestrator workflow node + tool-level human approval
2.1 Orchestrator in workflow:
- New run_orchestrator_node() in workflow_integration.py loads agents from DB,
  supports route/sequential/debate/pipeline modes
- New 'orchestrator' node type in workflow_engine.py execute_node dispatch

2.2 Tool-level human approval:
- AgentToolConfig extended with require_approval, approval_timeout_ms,
  approval_default fields
- New ApprovalManager (approval_manager.py) with asyncio.Event-based
  create/wait_for_decision/resolve pattern
- AgentRuntime run() and run_stream() intercept tool execution,
  wait for approval decision before executing
- New POST /api/v1/approval/{id}/resolve REST endpoint
- Frontend: approval_required SSE event handling, approval dialog UI
  with approve/deny/skip buttons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 23:17:59 +08:00
renjianbo
d895922438 fix: inject agent_id into system prompt for all WS handlers + enhance schedule_delete
- All 5 WS handlers (lingxi/feishu/orange/suyao/tiantian) now inject agent_id
  into LLM system prompt so agents know their own ID for schedule_list calls
- schedule_delete_tool now supports agent_id parameter for ownership checks
  and bulk delete by agent_id
- SCHEDULE_DELETE_SCHEMA updated: required fields now empty, supports
  both schedule_id and agent_id params

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 22:31:11 +08:00
renjianbo
b8b01254ca feat: Phase 1 - output quality verification + node-level auto-retry
- Add enterprise_review tool (35th builtin) for LLM-based quality assessment
- Add evaluator workflow node type for quality gating in DAG
- Add AgentRuntime built-in self-review with auto-correction loop
- Rewrite error_handler node from stub to real retry mechanism
- Add engine-level per-node retry with configurable max_retries/delay/on_exhausted
- Add AgentExtension model for extension tracking
- Enhance validation in agent_create_tool and tool_register_tool
- Update 全能助手 system prompt with self-evolution workflow
- Docs: 缺失能力.md and 解决缺失能力计划.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 22:05:28 +08:00
renjianbo
244ed31274 feat: add 10 new tools + agent self-evolution system (31 tools total)
New tools (10):
- code_execute: Python/JS sandbox execution
- git_operation: Git read-only operations (log/diff/blame/status)
- web_search: DuckDuckGo web search
- pdf_generate: Markdown to PDF/HTML report generation
- project_scaffold: Project template generator (fastapi/vue/react)
- task_plan: Task decomposition and progress tracking
- excel_process: Excel read/write with chart support
- browser_use: Headless browser control (playwright)
- docker_manage: Docker container management (read-only)
- deploy_push: File deployment (copy/rsync)

Self-evolution tools:
- agent_create: Dynamically create specialized sub-agents at runtime
- tool_register: Dynamically register HTTP tools at runtime

Documentation:
- Add 使用文档.md with full tool reference and project examples
- Update 创建agent.md (19→31 tools, add self-evolution chapter)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 22:29:28 +08:00
renjianbo
de415ca310 feat: add Prompt template library, agent_call inter-agent tool, and RAG memory
- New PromptTemplatePicker component for browsing 13 preset prompt templates
- AgentConfig.vue: "Load from library" button for system prompt
- Agents.vue: "Create from Prompt template" entry with agent node + RAG memory
- seed_prompt_templates.py: 13 preset templates (客服/研发/教育/内容/分析/创意/健康医疗)
- agent_call tool: agents can delegate tasks to other agents (19th builtin tool)
- Created 全能助手 (general orchestrator) and 家庭医生助手 agents
- Switch template-created agents from type:llm to type:agent for full ReAct + RAG

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 21:57:30 +08:00
renjianbo
1c83b6284f feat: add 灵犀 Feishu bot + fix agent schedule system + default all tools
- Add 灵犀学习助手 Feishu bot (lingxi_app_service + lingxi_ws_handler)
- Fix agent_schedule_service missing AgentSchedule import (Celery Beat)
- Fix scene_templates default enable_tools=False → True
- Fix workflow_engine LLM node: empty tools list now = all tools (consistent with agent node)
- Add 创建agent.md guide document

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 00:20:29 +08:00
renjianbo
d3a00ebae5 feat: add 甜甜 Feishu bot for 苏瑶3号 knowledge-graph agent
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 21:53:36 +08:00
renjianbo
a924486f26 feat: add Suyao Feishu bot and per-agent memory config support
- Create suyao_app_service.py and suyao_ws_handler.py for 苏瑶 Feishu bot
- Add SUYAO_APP_ID/SUYAO_APP_SECRET/SUYAO_AGENT_ID config fields
- Fix node config extraction bug (n.get("config") → n.get("data")) in all WS handlers
- Add _build_memory_config_from_node() to support per-agent memory settings
  (max_history_messages, vector_memory_top_k, persist_to_db, etc.)
- Create 苏瑶1号 (Plan A: long context), 苏瑶2号 (Plan B: emotion tracking),
  苏瑶3号 (Plan C: knowledge graph + RAG) agents with different memory strategies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 21:44:47 +08:00
renjianbo
68fbadae76 feat: add 8 builtin tools, AgentSchedules management page, Celery Beat integration
- Add 3 schedule tools (create/list/delete) and 5 utility tools (crypto, random, email, URL, regex)
- Add frontend AgentSchedules.vue page with full CRUD, cron presets, manual trigger
- Integrate Celery Beat for automatic schedule execution
- Update startup scripts with Celery Beat launch
- Fix schedule list API to show all schedules for admin users
- Add celrybeat-schedule.* to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 19:14:25 +08:00
renjianbo
7ee80c74b2 feat: 集成飞书通知和机器人对话系统
- 新增通知系统 (notifications 表、服务、API)
- 新增飞书定时任务结果推送 (webhook + 应用消息)
- 新增飞书应用消息发送服务 (feishu_app_service)
- 新增飞书 WebSocket 长连接事件监听 (苹果应用)
- 新增飞书账号绑定/解绑 API
- 新增橙子飞书机器人 (独立 WS 连接,固定路由到橙子助手 Agent)
- 执行记录添加 schedule_id,用户添加飞书绑定字段

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 16:17:49 +08:00
renjianbo
0bbf68d5bb feat: 实现 Agent 定时任务系统 — 按 cron 表达式周期执行 Agent
- 新增 AgentSchedule 模型、CRUD API、调度服务
- 集成 Celery Beat 每分钟检查到期任务并自动触发执行
- 支持手动触发、cron 表达式解析、执行状态跟踪
- 依赖: croniter (cron 表达式解析)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 12:14:37 +08:00
renjianbo
e3802eff60 feat: 实现 Agent 自主学习 — 从历史执行中优化工具选择
- 新增 AgentLearningPattern 模型和 agent_learning_service 服务
- 执行前注入历史学习模式到 system prompt 作为工具选择建议
- 执行后自动提取工具序列并保存/累计学习模式
- 支持任务分类(11类)、关键词提取、工具序列合并、有效性评分
- 集成到 AgentRuntime.run()/run_stream(),支持 bare chat 和 Agent 模式

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 12:04:00 +08:00
renjianbo
5423aca684 feat: 新增 Pipeline 流水线编排模式 (Planner→Executor→Reviewer)
新增第四种编排模式 pipeline,实现规划→执行→审查的自动化流水线:
- Planner 自动将问题拆解为 2-5 步 JSON 执行计划
- Executor 使用用户配置的 Agent 逐步骤执行
- Reviewer 审查全部输出并交付最终答案
- 前端编排模式选择器新增"流水线模式"选项
- 更新完善自主 AI Agent 改造完成情况文档

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 11:03:51 +08:00
renjianbo
7aba0f9bc5 fix: 修复 Agent 流式对话无响应和工具 schema 兼容性问题
- 在 `run_stream()` LLM 调用前 yield `think` 事件,前端即时显示"思考中..."
- 修复 tool schema 规范化逻辑:`{"function":{...}}` 格式缺少 `type` 字段导致 LLM API 拒绝
- 启动时从数据库加载自定义工具(`load_tools_from_db`),解决重启后工具丢失
- 前端 SSE 添加 60s 超时保护,任何事件类型均触发 `receivedFirstEvent`
- 流式失败自动降级到非流式 POST
- 添加 `scripts/seed_coding_agent.py` 和 `scripts/test_coding_agent.py`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 00:38:41 +08:00
renjianbo
4c1b5b29ad fix: 工具市场 categories 路由被 /{tool_id} 拦截
- 为 tool_id 路径参数添加 UUID 格式校验 (pattern)
- 修复 update_tool 参数顺序问题(有默认值参数在后)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 23:00:47 +08:00
renjianbo
7b9e0826de feat: 向量记忆 RAG、工具市场、SSE 流式响应、前端集成与测试覆盖
- 新增 embedding_service(语义检索)、knowledge_service(RAG)、text_chunker、document_parser
- 新增 tool_registry(自定义工具注册表)并完善工具市场 API(CRUD + code/http 执行)
- 新增 agent_vector_memory / knowledge_base 模型及对应数据库表
- 实现 SSE 流式响应与 Agent 预算控制
- AgentChat.vue 集成 MainLayout 导航布局
- 完善测试体系:7 个新测试文件共 110 个测试覆盖
- 修复 conftest.py SQLite 内存数据库连接隔离问题

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 22:30:46 +08:00
renjianbo
036f533881 feat: Agent 监控与编排、仪表盘/配置页及文档更新
- agent_runtime: orchestrator、core/memory/schemas 调整
- agent_monitoring API、service、agent_llm_log 模型与 database 注册
- 前端 AgentDashboard、AgentConfig、Agents/MainLayout/路由与 AgentChat
- 文档:(红头)项目核心文档汇总、自主AI Agent改造完成情况、AI agent改造计划

Made-with: Cursor
2026-05-01 19:32:59 +08:00
renjianbo
09467568ec feat: Agent 运行时、对话 API、作业助手与引擎修复及前端执行超时
- agent_runtime 模块与 agent_chat API,前端 AgentChat 视图与路由对接
- workflow_engine: code 节点命名空间与 json 引用修复
- llm_service: 工具调用 extra_body(如 DeepSeek)
- create_homework_manager_agent / _3 脚本与测试脚本扩展
- frontend: WORKFLOW_EXECUTION_HTTP_TIMEOUT_MS、AgentChatPreview/MainLayout 等
- 文档:架构说明与自主 Agent 改造完成情况

Made-with: Cursor
2026-05-01 11:31:48 +08:00
renjianbo
4366312946 feat: DeepSeek v4 模型对齐、作业助手脚本与 Agent 对比测试
- 前端 WorkflowEditor/ModelConfigs/NodeTemplates:deepseek-v4-flash、v4-pro,弃用提示
- llm_service 默认 deepseek-v4-flash;workflow_engine 等与模型配置注入
- 作业管理脚本支持 AGENT_NAME 与 v4-pro;新增 compare_homework_agents 脚本
- 文档重命名为 (红头)项目核心文档汇总.md 并更新 DeepSeek 说明

Made-with: Cursor
2026-04-30 00:57:13 +08:00
renjianbo
cadeb2dc32 fix: 修复热点摘要超长上下文并统一 Windows 启动文档
为 http_request 增加响应体截断与头部精简,避免门户首页触发 LLM 上下文超限;同时新增政务/媒体及教育批量 Agent 脚本,并将 Windows 启停说明合并为唯一指南,补充本次超时故障复盘与标准重启流程。

Made-with: Cursor
2026-04-30 00:10:19 +08:00
renjianbo
63b54116a5 图片上传识别功能 2026-04-13 22:52:36 +08:00
renjianbo
df4fab1e6e feat: Agent 批量测试、作业助手与上传预览;Windows 启动脚本与文档- 新增 run_agent_test_cases 与示例 JSON、(红头)agent测试用例文档
- 扩展 test_agent_execution(--homework、UTF-8 控制台)
- 后端:uploads 预览、file_read、工作流与对话落盘等
- 前端:AgentChatPreview 与设计器相关调整
- 忽略 redis二进制、agent_workspaces、uploads、tessdata 等本机产物

Made-with: Cursor
2026-04-13 20:17:18 +08:00
renjianbo
0608161c82 feat: 完善企业场景多线路由与执行稳定性
补齐平台模板与场景 DSL、预算控制、执行看板和企业场景脚本,增强 Windows 启动/迁移与前端代理和聊天会话记忆,修复执行创建阶段 500 与异步链路排障体验。

Made-with: Cursor
2026-04-09 21:58:53 +08:00
renjianbo
bd3f8be781 feat: 工作流记忆与内置工具、知你客服脚本、Agent管理技能展示与能力配置、文档与Windows启动脚本;忽略 redis_temp 二进制目录
Made-with: Cursor
2026-04-08 11:44:24 +08:00
rjb
9d3198f6bc 知你客服 2026-03-06 22:31:41 +08:00
rjb
171a6edf94 工具 2026-01-23 09:49:45 +08:00
rjb
f7702f4e72 ss 2026-01-22 09:59:02 +08:00
rjb
b8f340401a 自动布局 2026-01-20 18:05:31 +08:00
rjb
d59f015362 android应用 2026-01-20 11:03:55 +08:00
rjb
f6568f252a 处理agent答非所问的问题 2026-01-20 09:40:16 +08:00
rjb
e4aa6cdb79 工作流动画效果 2026-01-19 17:52:29 +08:00
rjb
6674060f2f 第一次提交 2026-01-19 00:09:36 +08:00