Commit Graph

32 Commits

Author SHA1 Message Date
zhaoxi 6792ad5485 fix(frontend): 将 toolsets 加入 AgentTab 类型联合,修复 TS2367 编译错误
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 18:29:16 +00:00
zhaoxi ac363bc6bc fix(toolset): 启动时自动补种系统工具集,工具集页面移至智能体侧边栏
- init_state_machine 启动时检查 DB 并补种 system_basic/system_chat/system_workflow
- 修复 postgres facade 缺少 is_system/category 参数的问题
- 前端工具集从"插件"独立为侧边栏"工具集"tab,位于智能体和插件之间

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 18:25:43 +00:00
zhaoxi 0e57c5cf16 feat(toolset): 工具系统重构为 toolset 统一管理,新增系统预置工具集
将工具管理从"agent 挂单个 tool"改为"agent 挂 toolset"模式:
- 三个系统预置工具集(system_basic/system_chat/system_workflow)入 DB
- 新增 send_file 工具(系统对话工具集)、修复 approval actor 调用 bug
- 后端 agent 加载全部走 toolset 链路,移除 load_tools_from_list
- 前端工具集中心卡片展示 + agent 配置改为 toolset 多选
- resource API 增加 category 过滤与系统 toolset 保护

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 18:03:49 +00:00
zhaoxi d39c80743d fix: regulatory 对话模式改用 event_stream_handler 修复工具调用截断,优化节点 prompt 和日志展示
- regulatory_node: stream_working 从 run_stream 改为 agent.run + event_stream_handler,
  解决工具调用后文本被截断的问题;添加 PartStartEvent 处理修复首字丢失
- consciousness_node: prompt 重写为三模式(生成/执行/报告),强调禁止编造 agent_id
- workflow API: _merge_runtime_status 暴露步骤输出内容(workflow_log 第三元素)
- 前端日志: 系统日志改为终端滚动样式,工作流步骤可展开查看输出

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 13:19:52 +00:00
zhaoxi ad5da2a118 fix: 工作流引擎接受 ForregulatoryNode 类型返回,修复最后一步失败
consciousness_node 在总结步骤返回 ForregulatoryNode 类型,但工作流引擎
只认 ForWorkflow 导致最后一步标记 failed。现在两种类型都被正确处理。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 09:18:40 +00:00
zhaoxi b61524e5d9 fix: chat stream 走 regulatory agent 支持工具调用,修复 workflow ValidationError
1. chat.py stream 端点改为调用 regulatory_node.stream_working()(pydantic-ai
   run_stream),支持工具调用 + 逐 token 流式输出
2. regulatory_node 新增 stream_working 方法,通过 asyncio.Queue 推送 token
3. ConsciousnessNodeDeps.available_skills 加默认值 None,修复 ForWorkflowInput/
   ForregulatoryInput 路径的 ValidationError

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 07:37:59 +00:00
zhaoxi 6f1bc27101 feat: v0.1.1 迭代——人设外键重构、Chat UI优化、意识节点防幻觉、日志双视图
1. 人设外键重构:persona_template 成为 system_prompt 唯一权威来源,
   agent/系统节点通过 persona_id FK 引用,含数据迁移脚本
2. Chat UI:去掉底部AI提示、加号改为弹出菜单、新建对话乐观跳转
3. 意识节点:无可用worker时禁止编造agent_id,只能自行完成或拒绝
4. 日志页面:双tab布局(系统日志 + 工作流日志列表选择)
5. 其他:SSE流式聊天、对话删除/重命名、standalone模式修复

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 06:18:47 +00:00
zhaoxi e3b8686d45 chore: 将 stardomain 加入主项目依赖
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 12:10:46 +00:00
zhaoxi 0bbd08638c feat(stardomain): 实现完整的沙箱执行引擎(local + Docker 双模式)
local 模式通过 tokio::process 真实执行命令,Docker 模式通过 bollard 创建容器运行,
两种模式均支持超时强杀、输出捕获和策略过滤。同时提供同步和异步 Python 接口。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 11:07:39 +00:00
zhaoxi 32bdbe77ff feat: 新增 stardomain 沙箱子项目脚手架(Docker + Rust 过滤层)
提供统一沙箱运行时,支持 local/sandbox 两种模式切换。Rust 层负责命令和代码的策略过滤,
Docker 层负责实际的进程隔离。包含三种预设策略:agent_exec / tool_run / untrusted。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 10:07:30 +00:00
zhaoxi 6932294ddd chore: 将 viceroy (Skill安装工具) 合并至 subprojects 统一管理
撤销独立仓库,直接纳入 KiloStar monorepo 的 subprojects/ 目录下。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 08:23:02 +00:00
zhaoxi 8f1398c591 feat: 人设模板系统、节点调度标签、pydantic-settings收敛、错误处理增强
新增persona_template表和CRUD API,BaseIndividualModel增加node_affinity和template_origin_id字段,
WorkerCluster支持多集群Ray资源调度,环境变量收敛到pydantic-settings统一校验,
数据库异常转换为结构化BusinessError/RetryableError,系统节点支持custom_system_prompt。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 06:07:46 +00:00
zhaoxi f3a92a793e feat(agent): 移除control_node实例化,新增系统节点命名与人设管理前端
当前阶段只保留regulatory+consciousness两个系统节点,control_node代码保留但不再实例化。
系统节点新增display_name字段支持自定义显示名称,前端新增人设管理Tab支持模板CRUD。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 06:03:28 +00:00
zhaoxi 9a7a5edd6e refactor(standalone): 收敛 _STANDALONE 判断到 standalone_proxy 单一来源
各模块不再各自读 os.environ,统一从 standalone_proxy._STANDALONE 导入,
环境变量只在一处决定模式,减少散落的重复逻辑。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 01:55:40 +00:00
zhaoxi 457d12834f feat(standalone): 新增单机模式,KILOSTAR_MODE=standalone 时去掉 Ray 依赖
通过 StandaloneProxy 适配层让 .remote() 调用在单机模式下透明降级为
asyncio 协程调用,7 个 Actor 和 workflow task 均可在纯 asyncio 环境运行,
启动快、资源占用低。分布式模式行为完全不变。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-03 15:52:41 +00:00
zhaoxi 76a67e8237 feat(config): 统一配置加载入口,启动时校验所有YAML配置
将分散的 config.yml、workflow.yaml、sandbox.yaml 加载逻辑统一到 AppConfig 模型,
启动时一次性校验,失败则 fast-fail。sandbox.py 改为从统一配置取值,消除重复加载。
同时修复 onebot 测试并新增14个统一配置测试(总测试 285→300)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 13:52:03 +00:00
zhaoxi 80174acaae feat(security): 新增工具沙箱安全机制
为所有工具插件添加沙箱拦截层,防止危险的文件访问、Shell命令和Python代码执行。
包含配置文件、核心校验逻辑及31个单元测试。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 12:09:15 +00:00
zhaoxi a53ffebe0e feat: 新增工具插件、系统日志、workflow配置及前端优化
1. 新增工具插件(edit_file, python_executor, search_file, shell_executor, write_file)
2. 新增系统事件日志模块和API
3. 新增workflow配置文件和详情API
4. 前端增加SSE、错误边界、设置引导等组件
5. 优化认证加密、速率限制、配置加载等工具模块
6. 删除废弃的cluster和health API
7. 补充单元测试和集成测试

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 07:34:43 +00:00
zhaoxi f04fef916f style(frontend):优化前端效果
1.对于UI的配色和布局进行了优化
2026-06-01 03:30:30 +00:00
zhaoxi 99520c69d7 feat(system):优化后端
1.新增后端测试
2.增加了后端的加密
3.增加了i18n(国际化)
2026-05-31 15:39:34 +00:00
zhaoxi affe460180 feat(frontend):优化前端页面设计 2026-05-29 16:44:17 +00:00
zhaoxi a83c5fa5bd style(agent): 调整agent结构 2026-05-18 05:33:11 +00:00
zhaoxi 6f6879dfab feat(provider):增加google,anthropic供应商
1.增加更多的模型供应商
2026-05-15 08:06:10 +08:00
zhaoxi 78bd6adc48 feat: workflow和chat分离
1,增加了创建workflow的页面
2.删除了event
2026-05-14 15:51:28 +00:00
zhaoxi c0e4fd34ae refactor: 修复sqlmodel的问题
* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Move workflow_engine inside workflow package to keep core root clean
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Move workflow_engine inside workflow package to keep core root clean
- Replace sqlmodel with pure sqlalchemy mappings globally
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>
2026-05-12 22:52:19 +08:00
zhaoxi ff1ede47a0 Refactor Workflow and Chat Architecture (#68)
* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Move workflow_engine inside workflow package to keep core root clean
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>
2026-05-12 15:47:17 +08:00
zhaoxi ee9bbbf676 style: 项目重构
1.项目改名为kilostar(千星)
2.后端部分进行大规模重构
3.node功能进行大规模重新设计
2026-05-11 15:29:16 +00:00
zhaoxi 2d8571dee3 style: 移动 2026-05-08 18:34:02 +08:00
zhaoxi 209ba45477 refactor(core): decouple actors and remove workflow templates (#67)
Removes the deprecated `workflow_template` concept entirely across both backend API routers, internal logic handling within the `supervisory_node` and `consciousness_node`, and front-end components. Enables `consciousness_node` to work autonomously.

Also refactors core package structure to enforce the "one python package, one Ray Actor" architectural rule. `GlobalWorkflowManager`, `WorkflowRunningEngine`, `PostgresDatabase`, and `WorkerCluster` have been moved to their own top-level decoupled package directories with properly exported `__init__.py` modules. Test suites have been relocated and import paths updated across the system.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>
2026-05-06 15:05:47 +08:00
zhaoxi b3ea4cd8d9 style(api): 重构api架构 2026-05-05 20:33:18 +08:00
zhaoxi d30c7e37a6 chore(release): v0.1.1-alpha
##前端美化和bug修复
#### 💄 美化
- **前端美化**:对于整个前端效果进行了重新设计,现在的前端看起来会更立体。

#### 🐛 修复
- **前端演示**:修复了前端展示workflow列表的bug,但是workflow的具体条目显示由于序列化导致仍然有问题。 
- **密钥修复**:对于secret_key现在在使用默认情况时,会强制生成一个安全的密钥。
2026-05-04 16:38:21 +08:00
zhaoxi d84212f780 chore: initial commit for Pretor v0.1.0-alpha
正式发布 Pretor 平台的首个 alpha 版本。本项目旨在构建一个基于分布式架构的多智能体协同工作流水线。

核心功能实现:
1. 建立基于 BaseIndividual 的动态插件加载机制。
2. 实现三类核心 worker_individual 子个体。
3. 集成 Ray 框架支持分布式集群调度。
4. 基于 PostgreSQL 的全量持久化存储方案。
5. 提供完整的 FastAPI 后端与 React 前端交互界面。
2026-04-29 10:09:07 +08:00