My Agent Core Design - Runtime
Runtime API Core 对外提供统一事件流, 调用方消费事件并自行决定展示方式. CLI / Server 不直接依赖 provider 原始事件, 只消费 core 标准事件. AgentRuntime 支持 async context manager: async with AgentRuntime(...) as runtime: ......
Runtime API Core 对外提供统一事件流, 调用方消费事件并自行决定展示方式. CLI / Server 不直接依赖 provider 原始事件, 只消费 core 标准事件. AgentRuntime 支持 async context manager: async with AgentRuntime(...) as runtime: ......
Python Implementation Python 版本基线: Python 3.11+. 包管理使用 uv + pyproject.toml. Python distribution name 使用 soong-agent. import package name 继续使用 agent_core. CLI entry point 使用 agentcli. ...
Goal 目标形态是可复用的 agent core SDK, 不是只服务单个 CLI. 使用 Python 实现 agent core. 第一层 API 面向 CLI / Server / Web 等调用方, core 通过统一 event stream 暴露运行过程. MVP 第一阶段覆盖核心闭环: Loop, Provider Adapter, Tool Regist...
OpenCode 内置 Prompt 文件清单 不包含运行时外部来源,例如项目/全局 AGENTS.md、CLAUDE.md、CONTEXT.md、config instructions、MCP prompts、skills 内容、用户自定义 command 目录等。 Prompt 文件绝对路径 用处 加载代码位置绝对路径 ...
Tools 支持的内置工具 (coding-agent) read、bash、edit、write、grep、find、ls pi分为 core 和 coding-agent/tui 部分 Agent Tool Define runtime protocal /** * agent-core 运行时使用的工具协议。 * * ...
Loop loop = outer_loop + inner_loop outer_loop允许在inner_loop执行中, 接收getSteeringMessages(), Main loop logic /** * `agentLoop()` 与 `agentLoopContinue()` 共用的主循环骨架。 * * 可以把它理解成“两层循环”: * - 外层循...
Context Manage (in-Session Context) 使用session tree, 树形结构 支持message粒度branch(同一个session内) 支持从某个message fork一个新session, 或者创建一个空白session 使用JSONL持久化 核心代码位置 /assets/code/pi/context ...
Resource Agent Claude Howto (with epub) https://github.com/luongnv89/claude-howto Learn Claude Code https://learn.shareai.run/zh/ https://github.com/shareAI...
Query Loop Overview 伪代码调用关系 ts语法糖, 异步生成器, 边执行边抛输出 // 第一层 ask:SDK 入口,一次性调用 async function* ask(params) { const engine = new QueryEngine(config) yield* engine.submitMessage(params.prompt...
Multi Agent Sub-Agent 隔离 tool隔离 所有subagent通用黑名单 能派新sub agent的工具 能主动问用户问题的工具 能切换规划模式的工具 能停止其他任务的工具 自定义agent多套一层黑名单 后台异步agent走白名单 // src/tools/AgentTool...