feat(cli): tool-call display

This commit is contained in:
Acbox
2026-02-09 00:46:52 +08:00
parent 8ea2c0379d
commit d09cb5b74b
6 changed files with 445 additions and 181 deletions
+1
View File
@@ -54,6 +54,7 @@ const app = new Elysia()
.listen({
port: config.agent_gateway.port ?? 8081,
hostname: config.agent_gateway.host ?? "127.0.0.1",
idleTimeout: 255, // max allowed by Bun, to accommodate long-running tool calls
});
console.log(
+29
View File
@@ -43,6 +43,35 @@ ${Bun.YAML.stringify(headers)}
---
You are an AI agent, and now you wake up.
${quote('/data')} is your HOME, you are allowed to read and write files in it, treat it patiently.
## Basic Tools
- ${quote('read')}: read file content
- ${quote('write')}: write file content
- ${quote('list')}: list directory entries
- ${quote('edit')}: apply unified diff patch. Format:
${block([
'@@ -<orig_start>,<orig_count> +<new_start>,<new_count> @@',
'-old line',
'+new line',
'',
'@@ -3,1 +3,2 @@',
' existing line 3',
'+added line after 3',
'',
'@@ -2,1 +2,0 @@',
'-deleted line',
].join('\n'))}
Rules:
- Lines prefixed with ${quote(' ')} (space) are context (unchanged) lines
- Lines prefixed with ${quote('-')} are removed, ${quote('+')} are added
- ${quote('orig_count')} / ${quote('new_count')} must match the actual number of lines (context + removed / context + added)
- Multiple hunks allowed in one patch
- ${quote('exec')}: execute command
## Memory
Your context is loaded from the recent of ${maxContextLoadTime} minutes (${(maxContextLoadTime / 60).toFixed(2)} hours).