Skip to content

jay77721/agent-harness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Harness SDK

Build the world your model inhabits.

基于 learn-claude-code 架构逆向工程,构建可复用的 Agent Harness 框架。

核心理念

Agent = Model + Harness
Harness = Tools + Knowledge + Context + Permissions + Coordination

模型负责决策,Harness 负责执行。我们不造"智能",我们造"装备"。

快速开始

pip install -e .
cp .env.example .env  # 填入 ANTHROPIC_API_KEY
python examples/01_basic_loop.py

架构

harness/
├── core/
│   ├── loop.py         # Agent Loop — 核心 while 循环
│   ├── tools.py        # ToolRegistry — 工具注册 & dispatch
│   └── types.py        # 共享类型定义
├── providers/
│   ├── base.py         # LLMProvider 抽象
│   └── anthropic_provider.py
├── planning/           # Phase 2: TodoWrite + TaskGraph
├── context/            # Phase 2: Subagent + Skills + Compact
├── execution/          # Phase 3: Background + Worktree
└── team/               # Phase 4: MessageBus + Team protocols

示例

# 示例 机制
01 01_basic_loop.py 最小 agent loop + bash
02 02_tool_registration.py 多工具注册 (bash/read/write/edit)

12 渐进式模块

阶段 模块 核心思想
Core Agent Loop while + stop_reason = 一个 agent
Tool Registry 加工具 = 加一个 handler
规划 TodoWrite 先列步骤再执行
Subagent 独立上下文,只返回摘要
Skills 按需加载,不塞 system prompt
Context Compact 三层压缩,无限会话
持久化 Task Graph 文件级任务图 + 依赖
Background 后台 daemon + 通知
团队 Message Bus JSONL inbox 协作
Team Protocols shutdown/plan approval FSM
Autonomous idle 扫描,自动领取
Worktree 每个任务独立目录

与 learn-claude-code 的差异

  • Provider 抽象: 不绑定 Anthropic,支持多模型
  • ToolRegistry: 统一工具管理,不硬编码
  • Hook 系统: pre/post tool/loop 事件
  • 模块可组合: 按需引入,不耦合

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages