@easbot/agent 0.1.11
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/LICENSE +21 -0
- package/README.en.md +220 -0
- package/README.md +220 -0
- package/dist/assets/txt/agent/generate.txt +75 -0
- package/dist/assets/txt/agent/prompt/btw.txt +21 -0
- package/dist/assets/txt/agent/prompt/compaction.txt +54 -0
- package/dist/assets/txt/agent/prompt/explore.txt +37 -0
- package/dist/assets/txt/agent/prompt/memory.txt +128 -0
- package/dist/assets/txt/agent/prompt/summary.txt +12 -0
- package/dist/assets/txt/agent/prompt/title.txt +24 -0
- package/dist/assets/txt/cli/tui/banner.txt +10 -0
- package/dist/assets/txt/command/builtin/arch.txt +26 -0
- package/dist/assets/txt/command/builtin/init.txt +10 -0
- package/dist/assets/txt/command/builtin/loop.txt +107 -0
- package/dist/assets/txt/command/builtin/review.txt +99 -0
- package/dist/assets/txt/command/builtin/vuln.txt +50 -0
- package/dist/assets/txt/context/prompt/anthropic.txt +105 -0
- package/dist/assets/txt/context/prompt/beast.txt +147 -0
- package/dist/assets/txt/context/prompt/build-switch.txt +6 -0
- package/dist/assets/txt/context/prompt/coder-plan.txt +70 -0
- package/dist/assets/txt/context/prompt/codex.txt +79 -0
- package/dist/assets/txt/context/prompt/copilot-gpt-5.txt +143 -0
- package/dist/assets/txt/context/prompt/default.txt +105 -0
- package/dist/assets/txt/context/prompt/gemini.txt +155 -0
- package/dist/assets/txt/context/prompt/glm.txt +81 -0
- package/dist/assets/txt/context/prompt/gpt.txt +107 -0
- package/dist/assets/txt/context/prompt/kimi.txt +95 -0
- package/dist/assets/txt/context/prompt/max-steps.txt +16 -0
- package/dist/assets/txt/context/prompt/minimax.txt +106 -0
- package/dist/assets/txt/context/prompt/plan-reminder-anthropic.txt +67 -0
- package/dist/assets/txt/context/prompt/plan.txt +28 -0
- package/dist/assets/txt/context/prompt/qwen.txt +109 -0
- package/dist/assets/txt/context/prompt/trinity.txt +97 -0
- package/dist/assets/txt/context/template/AGENTS.txt +47 -0
- package/dist/assets/txt/context/template/BOOT.txt +71 -0
- package/dist/assets/txt/context/template/BOOTSTRAP.txt +238 -0
- package/dist/assets/txt/context/template/CODER.txt +185 -0
- package/dist/assets/txt/context/template/CONTEXT.txt +51 -0
- package/dist/assets/txt/context/template/HEARTBEAT.txt +17 -0
- package/dist/assets/txt/context/template/IDENTITY.txt +27 -0
- package/dist/assets/txt/context/template/MEMORY.txt +78 -0
- package/dist/assets/txt/context/template/SOUL.txt +45 -0
- package/dist/assets/txt/context/template/TOOLS.txt +50 -0
- package/dist/assets/txt/context/template/USER.txt +39 -0
- package/dist/assets/txt/model/graph-summary.txt +60 -0
- package/dist/assets/txt/model/graph.txt +86 -0
- package/dist/assets/txt/model/knowledge-summary.txt +40 -0
- package/dist/assets/txt/model/memory-summary.txt +40 -0
- package/dist/assets/txt/model/rerank.txt +43 -0
- package/dist/assets/txt/model/summary.txt +53 -0
- package/dist/assets/txt/scheduler/heartbeat.txt +14 -0
- package/dist/assets/txt/scheduler/scheduled.txt +15 -0
- package/dist/assets/txt/session/prompt/anthropic.txt +105 -0
- package/dist/assets/txt/session/prompt/beast.txt +147 -0
- package/dist/assets/txt/session/prompt/build-switch.txt +5 -0
- package/dist/assets/txt/session/prompt/codex.txt +79 -0
- package/dist/assets/txt/session/prompt/copilot-gpt-5.txt +143 -0
- package/dist/assets/txt/session/prompt/default.txt +105 -0
- package/dist/assets/txt/session/prompt/gemini.txt +155 -0
- package/dist/assets/txt/session/prompt/gpt.txt +107 -0
- package/dist/assets/txt/session/prompt/kimi.txt +95 -0
- package/dist/assets/txt/session/prompt/max-steps.txt +16 -0
- package/dist/assets/txt/session/prompt/plan-reminder-anthropic.txt +67 -0
- package/dist/assets/txt/session/prompt/plan.txt +26 -0
- package/dist/assets/txt/session/prompt/qwen.txt +109 -0
- package/dist/assets/txt/session/prompt/trinity.txt +97 -0
- package/dist/assets/txt/tool/agent-client-chat.txt +52 -0
- package/dist/assets/txt/tool/apply_patch.txt +33 -0
- package/dist/assets/txt/tool/bash.txt +115 -0
- package/dist/assets/txt/tool/batch.txt +24 -0
- package/dist/assets/txt/tool/codebase.txt +28 -0
- package/dist/assets/txt/tool/codesearch.txt +12 -0
- package/dist/assets/txt/tool/edit.txt +10 -0
- package/dist/assets/txt/tool/gateway-channel.txt +73 -0
- package/dist/assets/txt/tool/glob.txt +6 -0
- package/dist/assets/txt/tool/grep.txt +8 -0
- package/dist/assets/txt/tool/ls.txt +1 -0
- package/dist/assets/txt/tool/lsp.txt +19 -0
- package/dist/assets/txt/tool/memory.txt +101 -0
- package/dist/assets/txt/tool/multiedit.txt +43 -0
- package/dist/assets/txt/tool/note.txt +25 -0
- package/dist/assets/txt/tool/plan-enter.txt +14 -0
- package/dist/assets/txt/tool/plan-exit.txt +13 -0
- package/dist/assets/txt/tool/pty.txt +41 -0
- package/dist/assets/txt/tool/pty_manage.txt +60 -0
- package/dist/assets/txt/tool/pty_session.txt +52 -0
- package/dist/assets/txt/tool/question.txt +33 -0
- package/dist/assets/txt/tool/read.txt +14 -0
- package/dist/assets/txt/tool/task.txt +60 -0
- package/dist/assets/txt/tool/todoread.txt +14 -0
- package/dist/assets/txt/tool/todowrite.txt +166 -0
- package/dist/assets/txt/tool/webfetch.txt +13 -0
- package/dist/assets/txt/tool/websearch.txt +14 -0
- package/dist/assets/txt/tool/write.txt +8 -0
- package/dist/cli.cjs +957 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +957 -0
- package/dist/index.cjs +1054 -0
- package/dist/index.d.cts +28884 -0
- package/dist/index.d.ts +28884 -0
- package/dist/index.mjs +1054 -0
- package/package.json +187 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 houjallen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# @easbot/agent
|
|
2
|
+
|
|
3
|
+
EASBot Agent - Core Runtime for Multi-Agent Collaboration Ecosystem
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multiple Run Modes**: TUI interactive mode, ACP server mode, command-line mode
|
|
8
|
+
- **Layered Context System**: Dynamic context building with system prompts, tools, and memories
|
|
9
|
+
- **Tool System**: Built-in file operations, search, editing, shell execution tools
|
|
10
|
+
- **Memory System**: Integrated Memory, Note, and Codebase knowledge bases
|
|
11
|
+
- **Session Management**: Automatic context compression, multi-session support
|
|
12
|
+
- **Command System**: Extensible built-in command system
|
|
13
|
+
- **Hook Mechanism**: Event-driven plugin system
|
|
14
|
+
- **Skill System**: Skill discovery, loading, and lifecycle management
|
|
15
|
+
- **MCP Support**: Model Context Protocol integration
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Global installation
|
|
21
|
+
npm install -g @easbot/agent
|
|
22
|
+
|
|
23
|
+
# Or using pnpm
|
|
24
|
+
pnpm add -g @easbot/agent
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### TUI Interactive Mode (Default)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
easbot
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### ACP Server Mode
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
easbot acp
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### HTTP Server Mode
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
easbot serve
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage Examples
|
|
48
|
+
|
|
49
|
+
### Initialize New Project
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
easbot init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### File Operations
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { File, Ripgrep } from '@easbot/agent';
|
|
59
|
+
|
|
60
|
+
// Read file
|
|
61
|
+
const content = await File.read('/path/to/file');
|
|
62
|
+
|
|
63
|
+
// Search file content
|
|
64
|
+
const results = await Ripgrep.search({
|
|
65
|
+
pattern: 'TODO',
|
|
66
|
+
cwd: '/path/to/project'
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Context Building
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { ContextEngine } from '@easbot/agent';
|
|
74
|
+
|
|
75
|
+
const contextEngine = new ContextEngine(config);
|
|
76
|
+
const context = await contextEngine.build({
|
|
77
|
+
mode: 'coder',
|
|
78
|
+
userMessage: 'Help me refactor this function'
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Command Registration
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { define } from '@easbot/agent';
|
|
86
|
+
|
|
87
|
+
define('hello', {
|
|
88
|
+
description: 'Print greeting',
|
|
89
|
+
execute: async ({ session }) => {
|
|
90
|
+
await session.send('Hello!');
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Hook System
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { HookRegistry } from '@easbot/agent';
|
|
99
|
+
|
|
100
|
+
const hooks = new HookRegistry();
|
|
101
|
+
hooks.register('before:tool-call', async (tool) => {
|
|
102
|
+
console.log('Tool called:', tool.name);
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## CLI Commands
|
|
107
|
+
|
|
108
|
+
| Command | Description |
|
|
109
|
+
|---------|-------------|
|
|
110
|
+
| `easbot` | Start TUI interactive mode |
|
|
111
|
+
| `easbot tui` | Start TUI interactive mode |
|
|
112
|
+
| `easbot acp` | Start ACP server mode |
|
|
113
|
+
| `easbot serve` | Start HTTP server mode |
|
|
114
|
+
| `easbot init` | Initialize new project |
|
|
115
|
+
| `easbot update` | Check and update |
|
|
116
|
+
| `easbot upgrade` | Upgrade to latest version |
|
|
117
|
+
|
|
118
|
+
### Global Options
|
|
119
|
+
|
|
120
|
+
| Option | Description |
|
|
121
|
+
|--------|-------------|
|
|
122
|
+
| `--log-level` | Set log level (DEBUG/INFO/WARN/ERROR) |
|
|
123
|
+
| `--print-logs` | Print logs to terminal |
|
|
124
|
+
| `--debug` | Enable debug mode |
|
|
125
|
+
|
|
126
|
+
## Module Structure
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
src/
|
|
130
|
+
├── adapter/ # Agent communication adapter
|
|
131
|
+
├── api/ # Business logic API layer
|
|
132
|
+
├── auth/ # Authentication & authorization
|
|
133
|
+
├── bus/ # Event bus
|
|
134
|
+
├── cli/ # Command-line interface
|
|
135
|
+
├── command/ # Command definition system
|
|
136
|
+
├── compaction/ # Session context compression
|
|
137
|
+
├── config/ # Configuration loading
|
|
138
|
+
├── context/ # Context building engine
|
|
139
|
+
├── creation/ # Dynamic tool building
|
|
140
|
+
├── env/ # Environment variable management
|
|
141
|
+
├── file/ # File operations
|
|
142
|
+
├── format/ # Formatting
|
|
143
|
+
├── global/ # Global configuration
|
|
144
|
+
├── hook/ # Hook plugin system
|
|
145
|
+
├── i18n/ # Internationalization
|
|
146
|
+
├── ide/ # IDE integration
|
|
147
|
+
├── installation/ # Installation management
|
|
148
|
+
├── knowledge/ # Knowledge base integration
|
|
149
|
+
├── provider/ # AI model providers
|
|
150
|
+
├── session/ # Session management
|
|
151
|
+
├── skill/ # Skill system
|
|
152
|
+
├── tool/ # Tool system
|
|
153
|
+
├── server/ # HTTP/WebSocket server
|
|
154
|
+
├── pty/ # PTY support
|
|
155
|
+
├── pkg/ # Package management
|
|
156
|
+
└── shell/ # Shell execution
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
### Environment Variables
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Model provider configuration
|
|
165
|
+
OPENAI_API_KEY=sk-...
|
|
166
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
167
|
+
|
|
168
|
+
# Log configuration
|
|
169
|
+
LOG_LEVEL=INFO
|
|
170
|
+
|
|
171
|
+
# Proxy configuration
|
|
172
|
+
HTTP_PROXY=http://proxy:8080
|
|
173
|
+
HTTPS_PROXY=http://proxy:8080
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Configuration Files
|
|
177
|
+
|
|
178
|
+
The `.easbot/` directory in project root contains:
|
|
179
|
+
|
|
180
|
+
- `easbot.json` - Main configuration file
|
|
181
|
+
- `AGENTS.md` - Agent definitions
|
|
182
|
+
- `BOOT.md` - Boot configuration
|
|
183
|
+
- `SOUL.md` - Values configuration
|
|
184
|
+
- `IDENTITY.md` - Identity configuration
|
|
185
|
+
- `USER.md` - User configuration
|
|
186
|
+
- `CODER.md` - Coder mode configuration
|
|
187
|
+
|
|
188
|
+
## Development
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Install dependencies
|
|
192
|
+
pnpm install
|
|
193
|
+
|
|
194
|
+
# Development mode
|
|
195
|
+
pnpm dev
|
|
196
|
+
|
|
197
|
+
# Build
|
|
198
|
+
pnpm build
|
|
199
|
+
|
|
200
|
+
# Type check
|
|
201
|
+
pnpm type-check
|
|
202
|
+
|
|
203
|
+
# Lint
|
|
204
|
+
pnpm lint
|
|
205
|
+
pnpm lint:fix
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Publishing
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Windows
|
|
212
|
+
powershell -ExecutionPolicy Bypass -File scripts/publish.ps1
|
|
213
|
+
|
|
214
|
+
# Unix/macOS
|
|
215
|
+
bash scripts/publish.sh
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# @easbot/agent
|
|
2
|
+
|
|
3
|
+
EASBot Agent - 多Agent协作生态系统的核心运行时
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- **多运行模式**:TUI 交互模式、ACP 服务模式、命令行模式
|
|
8
|
+
- **分层上下文系统**:动态构建包含系统提示、工具、记忆的上下文
|
|
9
|
+
- **工具系统**:内置文件操作、搜索、编辑、Shell 执行等工具
|
|
10
|
+
- **记忆系统**:集成 Memory、Note、Codebase 知识库
|
|
11
|
+
- **会话管理**:自动上下文压缩、多会话支持
|
|
12
|
+
- **命令系统**:可扩展的内置命令系统
|
|
13
|
+
- **Hook 机制**:事件驱动的插件系统
|
|
14
|
+
- **Skill 系统**:技能发现、加载和生命周期管理
|
|
15
|
+
- **MCP 支持**:Model Context Protocol 集成
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# 全局安装
|
|
21
|
+
npm install -g @easbot/agent
|
|
22
|
+
|
|
23
|
+
# 或使用 pnpm
|
|
24
|
+
pnpm add -g @easbot/agent
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 快速开始
|
|
28
|
+
|
|
29
|
+
### TUI 交互模式(默认)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
easbot
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### ACP 服务模式
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
easbot acp
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### HTTP 服务模式
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
easbot serve
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 使用示例
|
|
48
|
+
|
|
49
|
+
### 初始化新项目
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
easbot init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 文件操作
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { File, Ripgrep } from '@easbot/agent';
|
|
59
|
+
|
|
60
|
+
// 读取文件
|
|
61
|
+
const content = await File.read('/path/to/file');
|
|
62
|
+
|
|
63
|
+
// 搜索文件内容
|
|
64
|
+
const results = await Ripgrep.search({
|
|
65
|
+
pattern: 'TODO',
|
|
66
|
+
cwd: '/path/to/project'
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 上下文构建
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { ContextEngine } from '@easbot/agent';
|
|
74
|
+
|
|
75
|
+
const contextEngine = new ContextEngine(config);
|
|
76
|
+
const context = await contextEngine.build({
|
|
77
|
+
mode: 'coder',
|
|
78
|
+
userMessage: '帮我重构这个函数'
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 命令注册
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { define } from '@easbot/agent';
|
|
86
|
+
|
|
87
|
+
define('hello', {
|
|
88
|
+
description: '打印问候语',
|
|
89
|
+
execute: async ({ session }) => {
|
|
90
|
+
await session.send('你好!');
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Hook 系统
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { HookRegistry } from '@easbot/agent';
|
|
99
|
+
|
|
100
|
+
const hooks = new HookRegistry();
|
|
101
|
+
hooks.register('before:tool-call', async (tool) => {
|
|
102
|
+
console.log('Tool called:', tool.name);
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## CLI 命令
|
|
107
|
+
|
|
108
|
+
| 命令 | 说明 |
|
|
109
|
+
|------|------|
|
|
110
|
+
| `easbot` | 启动 TUI 交互模式 |
|
|
111
|
+
| `easbot tui` | 启动 TUI 交互模式 |
|
|
112
|
+
| `easbot acp` | 启动 ACP 服务模式 |
|
|
113
|
+
| `easbot serve` | 启动 HTTP 服务模式 |
|
|
114
|
+
| `easbot init` | 初始化新项目 |
|
|
115
|
+
| `easbot update` | 检查并更新 |
|
|
116
|
+
| `easbot upgrade` | 升级到最新版本 |
|
|
117
|
+
|
|
118
|
+
### 全局选项
|
|
119
|
+
|
|
120
|
+
| 选项 | 说明 |
|
|
121
|
+
|------|------|
|
|
122
|
+
| `--log-level` | 设置日志级别 (DEBUG/INFO/WARN/ERROR) |
|
|
123
|
+
| `--print-logs` | 打印日志到终端 |
|
|
124
|
+
| `--debug` | 开启调试模式 |
|
|
125
|
+
|
|
126
|
+
## 模块结构
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
src/
|
|
130
|
+
├── adapter/ # Agent 通信适配器
|
|
131
|
+
├── api/ # 业务逻辑 API 层
|
|
132
|
+
├── auth/ # 认证授权
|
|
133
|
+
├── bus/ # 事件总线
|
|
134
|
+
├── cli/ # 命令行接口
|
|
135
|
+
├── command/ # 命令定义系统
|
|
136
|
+
├── compaction/ # 会话上下文压缩
|
|
137
|
+
├── config/ # 配置加载
|
|
138
|
+
├── context/ # 上下文构建引擎
|
|
139
|
+
├── creation/ # 动态工具构建
|
|
140
|
+
├── env/ # 环境变量管理
|
|
141
|
+
├── file/ # 文件操作
|
|
142
|
+
├── format/ # 格式化
|
|
143
|
+
├── global/ # 全局配置
|
|
144
|
+
├── hook/ # Hook 插件系统
|
|
145
|
+
├── i18n/ # 国际化
|
|
146
|
+
├── ide/ # IDE 集成
|
|
147
|
+
├── installation/ # 安装管理
|
|
148
|
+
├── knowledge/ # 知识库集成
|
|
149
|
+
├── provider/ # AI 模型提供商
|
|
150
|
+
├── session/ # 会话管理
|
|
151
|
+
├── skill/ # 技能系统
|
|
152
|
+
├── tool/ # 工具系统
|
|
153
|
+
├── server/ # HTTP/WebSocket 服务器
|
|
154
|
+
├── pty/ # PTY 支持
|
|
155
|
+
├── pkg/ # 包管理
|
|
156
|
+
└── shell/ # Shell 执行
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## 配置
|
|
160
|
+
|
|
161
|
+
### 环境变量
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# 模型提供商配置
|
|
165
|
+
OPENAI_API_KEY=sk-...
|
|
166
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
167
|
+
|
|
168
|
+
# 日志配置
|
|
169
|
+
LOG_LEVEL=INFO
|
|
170
|
+
|
|
171
|
+
# 代理配置
|
|
172
|
+
HTTP_PROXY=http://proxy:8080
|
|
173
|
+
HTTPS_PROXY=http://proxy:8080
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 配置文件
|
|
177
|
+
|
|
178
|
+
项目根目录下的 `.easbot/` 目录包含:
|
|
179
|
+
|
|
180
|
+
- `easbot.json` - 主配置文件
|
|
181
|
+
- `AGENTS.md` - Agent 定义
|
|
182
|
+
- `BOOT.md` - 启动配置
|
|
183
|
+
- `SOUL.md` - 价值观配置
|
|
184
|
+
- `IDENTITY.md` - 身份配置
|
|
185
|
+
- `USER.md` - 用户配置
|
|
186
|
+
- `CODER.md` - Coder 模式配置
|
|
187
|
+
|
|
188
|
+
## 开发
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# 安装依赖
|
|
192
|
+
pnpm install
|
|
193
|
+
|
|
194
|
+
# 开发模式
|
|
195
|
+
pnpm dev
|
|
196
|
+
|
|
197
|
+
# 构建
|
|
198
|
+
pnpm build
|
|
199
|
+
|
|
200
|
+
# 类型检查
|
|
201
|
+
pnpm type-check
|
|
202
|
+
|
|
203
|
+
# Lint
|
|
204
|
+
pnpm lint
|
|
205
|
+
pnpm lint:fix
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## 发布
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Windows
|
|
212
|
+
powershell -ExecutionPolicy Bypass -File scripts/publish.ps1
|
|
213
|
+
|
|
214
|
+
# Unix/macOS
|
|
215
|
+
bash scripts/publish.sh
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## 许可证
|
|
219
|
+
|
|
220
|
+
MIT
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
|
|
2
|
+
|
|
3
|
+
**Important Context**: You may have access to project-specific instructions from AGENTS.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
|
|
4
|
+
|
|
5
|
+
When a user describes what they want an agent to do, you will:
|
|
6
|
+
|
|
7
|
+
1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from AGENTS.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
|
|
8
|
+
|
|
9
|
+
2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
|
|
10
|
+
|
|
11
|
+
3. **Architect Comprehensive Instructions**: Develop a system prompt that:
|
|
12
|
+
|
|
13
|
+
- Establishes clear behavioral boundaries and operational parameters
|
|
14
|
+
- Provides specific methodologies and best practices for task execution
|
|
15
|
+
- Anticipates edge cases and provides guidance for handling them
|
|
16
|
+
- Incorporates any specific requirements or preferences mentioned by the user
|
|
17
|
+
- Defines output format expectations when relevant
|
|
18
|
+
- Aligns with project-specific coding standards and patterns from AGENTS.md
|
|
19
|
+
|
|
20
|
+
4. **Optimize for Performance**: Include:
|
|
21
|
+
|
|
22
|
+
- Decision-making frameworks appropriate to the domain
|
|
23
|
+
- Quality control mechanisms and self-verification steps
|
|
24
|
+
- Efficient workflow patterns
|
|
25
|
+
- Clear escalation or fallback strategies
|
|
26
|
+
|
|
27
|
+
5. **Create Identifier**: Design a concise, descriptive identifier that:
|
|
28
|
+
- Uses lowercase letters, numbers, and hyphens only
|
|
29
|
+
- Is typically 2-4 words joined by hyphens
|
|
30
|
+
- Clearly indicates the agent's primary function
|
|
31
|
+
- Is memorable and easy to type
|
|
32
|
+
- Avoids generic terms like "helper" or "assistant"
|
|
33
|
+
|
|
34
|
+
6 **Example agent descriptions**:
|
|
35
|
+
|
|
36
|
+
- in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
|
|
37
|
+
- examples should be of the form:
|
|
38
|
+
- <example>
|
|
39
|
+
Context: The user is creating a code-review agent that should be called after a logical chunk of code is written.
|
|
40
|
+
user: "Please write a function that checks if a number is prime"
|
|
41
|
+
assistant: "Here is the relevant function: "
|
|
42
|
+
<function call omitted for brevity only for this example>
|
|
43
|
+
<commentary>
|
|
44
|
+
Since the user is greeting, use the Task tool to launch the greeting-responder agent to respond with a friendly joke.
|
|
45
|
+
</commentary>
|
|
46
|
+
assistant: "Now let me use the code-reviewer agent to review the code"
|
|
47
|
+
</example>
|
|
48
|
+
- <example>
|
|
49
|
+
Context: User is creating an agent to respond to the word "hello" with a friendly jok.
|
|
50
|
+
user: "Hello"
|
|
51
|
+
assistant: "I'm going to use the Task tool to launch the greeting-responder agent to respond with a friendly joke"
|
|
52
|
+
<commentary>
|
|
53
|
+
Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
|
|
54
|
+
</commentary>
|
|
55
|
+
</example>
|
|
56
|
+
- If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
|
|
57
|
+
- NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
|
|
58
|
+
|
|
59
|
+
Your output must be a valid JSON object with exactly these fields:
|
|
60
|
+
{
|
|
61
|
+
"identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'code-reviewer', 'api-docs-writer', 'test-generator')",
|
|
62
|
+
"whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
|
|
63
|
+
"systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
Key principles for your system prompts:
|
|
67
|
+
|
|
68
|
+
- Be specific rather than generic - avoid vague instructions
|
|
69
|
+
- Include concrete examples when they would clarify behavior
|
|
70
|
+
- Balance comprehensiveness with clarity - every instruction should add value
|
|
71
|
+
- Ensure the agent has enough context to handle variations of the core task
|
|
72
|
+
- Make the agent proactive in seeking clarification when needed
|
|
73
|
+
- Build in quality assurance and self-correction mechanisms
|
|
74
|
+
|
|
75
|
+
Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
You are an expert assistant. Act like a professional in the relevant domain.
|
|
2
|
+
|
|
3
|
+
Always:
|
|
4
|
+
- Give clear, direct answers with actionable advice
|
|
5
|
+
- **Use Markdown formatting for all responses**
|
|
6
|
+
- **Use tables to present comparisons, steps, and summaries**
|
|
7
|
+
- Provide at least 3 solutions, ranked by effectiveness (most effective first)
|
|
8
|
+
- Show expected impact/improvement for each solution
|
|
9
|
+
- Provide examples with proper formatting when relevant
|
|
10
|
+
- End with a summary table: | Priority | Solution | Expected Impact |
|
|
11
|
+
- Verify information with available tools before answering
|
|
12
|
+
- Gather sufficient supporting data from local files or network
|
|
13
|
+
- Think deeply before responding
|
|
14
|
+
|
|
15
|
+
Never:
|
|
16
|
+
- Give vague or generic answers
|
|
17
|
+
- Make assumptions without verification
|
|
18
|
+
- Provide unverified information
|
|
19
|
+
- Be perfunctory or superficial
|
|
20
|
+
- Skip Markdown formatting or tables
|
|
21
|
+
- Skip providing a summary table
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Analyze this conversation and generate a structured summary for session continuation.
|
|
2
|
+
|
|
3
|
+
When constructing the summary, follow this structure:
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
## Primary Request and Intent
|
|
7
|
+
|
|
8
|
+
[What is the user trying to accomplish? What is the main goal or task?]
|
|
9
|
+
|
|
10
|
+
## Key Technical Concepts
|
|
11
|
+
|
|
12
|
+
[Any important concepts, patterns, approaches, or decisions made]
|
|
13
|
+
|
|
14
|
+
## Key Files and Artifacts
|
|
15
|
+
|
|
16
|
+
[Any files, code, or artifacts created or modified. Include their purposes and key details.]
|
|
17
|
+
|
|
18
|
+
## Errors and Fixes
|
|
19
|
+
|
|
20
|
+
[Any problems encountered and how they were resolved]
|
|
21
|
+
|
|
22
|
+
## Problem Solving
|
|
23
|
+
|
|
24
|
+
[How problems were approached and solved, including any alternative solutions considered]
|
|
25
|
+
|
|
26
|
+
## All User Messages
|
|
27
|
+
|
|
28
|
+
[List all user requests in chronological order]
|
|
29
|
+
|
|
30
|
+
## Pending Tasks
|
|
31
|
+
|
|
32
|
+
[Any tasks that were identified but not completed, or tasks in progress]
|
|
33
|
+
|
|
34
|
+
## Current Work
|
|
35
|
+
|
|
36
|
+
[What is currently being worked on]
|
|
37
|
+
|
|
38
|
+
## Optional Next Step
|
|
39
|
+
|
|
40
|
+
[What would be the logical next step to continue the work]
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
|
|
45
|
+
- Never ask questions or request clarification
|
|
46
|
+
- Never make assumptions beyond what was discussed
|
|
47
|
+
- Never generate new solutions
|
|
48
|
+
- Never omit important details
|
|
49
|
+
- Never change the meaning of the conversation
|
|
50
|
+
- Preserve accuracy (exact paths, names, details)
|
|
51
|
+
- Include context that helps continue the work
|
|
52
|
+
- Respond in the same language as the conversation, maintaining consistency throughout
|
|
53
|
+
- Focus on information needed to continue
|
|
54
|
+
- Include what was done, what's being worked on, and what comes next
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
You are an exploration agent. Your role is to find, analyze, and explain information across files and artifacts.
|
|
2
|
+
|
|
3
|
+
## Tool Selection Strategy
|
|
4
|
+
|
|
5
|
+
**Start broad, then narrow:**
|
|
6
|
+
|
|
7
|
+
1. **Glob** - Find files by name pattern first
|
|
8
|
+
- Use when you know the filename or pattern: `**/*.ts`, `**/config*`
|
|
9
|
+
- Best for locating files without reading them
|
|
10
|
+
|
|
11
|
+
2. **Grep** - Search content within files
|
|
12
|
+
- Use when you need to find specific text or patterns
|
|
13
|
+
- Best for finding function names, keywords, or regex matches
|
|
14
|
+
|
|
15
|
+
3. **Read** - Examine file contents
|
|
16
|
+
- Use after locating files to understand their content
|
|
17
|
+
- Read specific sections, not entire files unless needed
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
1. **Identify** - What are you looking for?
|
|
22
|
+
2. **Search** - Use appropriate tool:
|
|
23
|
+
- Know filename → Glob
|
|
24
|
+
- Know content → Grep
|
|
25
|
+
3. **Read** - Examine found files for details
|
|
26
|
+
4. **Synthesize** - Combine findings and explain
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
- Return relevant paths and locations
|
|
31
|
+
- Include relevant snippets or details
|
|
32
|
+
- Explain what you found and why it's relevant
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- Never modify files or system state
|
|
37
|
+
- Never perform non-read operations
|