botholomew 0.8.10 → 0.9.5
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/package.json +1 -1
- package/src/chat/agent.ts +7 -3
- package/src/commands/context.ts +223 -373
- package/src/commands/tools.ts +100 -11
- package/src/context/describer.ts +3 -118
- package/src/context/drives.ts +110 -0
- package/src/context/fetcher.ts +11 -1
- package/src/context/ingest.ts +13 -10
- package/src/context/refresh.ts +39 -24
- package/src/context/url-utils.ts +0 -23
- package/src/db/context.ts +195 -119
- package/src/db/embeddings.ts +35 -16
- package/src/db/sql/13-drive-paths.sql +49 -0
- package/src/tools/context/list-drives.ts +36 -0
- package/src/tools/context/refresh.ts +41 -23
- package/src/tools/context/search.ts +8 -3
- package/src/tools/dir/create.ts +14 -11
- package/src/tools/dir/size.ts +3 -2
- package/src/tools/dir/tree.ts +57 -17
- package/src/tools/file/copy.ts +14 -8
- package/src/tools/file/count-lines.ts +6 -3
- package/src/tools/file/delete.ts +12 -5
- package/src/tools/file/edit.ts +5 -3
- package/src/tools/file/exists.ts +25 -3
- package/src/tools/file/info.ts +90 -18
- package/src/tools/file/move.ts +15 -16
- package/src/tools/file/read.ts +79 -5
- package/src/tools/file/write.ts +29 -12
- package/src/tools/registry.ts +2 -2
- package/src/tools/search/grep.ts +44 -11
- package/src/tools/search/semantic.ts +7 -3
- package/src/tui/components/ContextPanel.tsx +73 -35
- package/src/tui/markdown.ts +2 -3
- package/src/worker/prompt.ts +5 -2
- package/src/tools/dir/list.ts +0 -89
package/package.json
CHANGED
package/src/chat/agent.ts
CHANGED
|
@@ -37,6 +37,7 @@ const CHAT_TOOL_NAMES = new Set([
|
|
|
37
37
|
"context_info",
|
|
38
38
|
"context_refresh",
|
|
39
39
|
"context_tree",
|
|
40
|
+
"context_list_drives",
|
|
40
41
|
"search_grep",
|
|
41
42
|
"search_semantic",
|
|
42
43
|
"list_threads",
|
|
@@ -87,8 +88,9 @@ export async function buildChatSystemPrompt(
|
|
|
87
88
|
if (results.length > 0) {
|
|
88
89
|
prompt += "## Relevant Context\n";
|
|
89
90
|
for (const r of results) {
|
|
90
|
-
const
|
|
91
|
-
|
|
91
|
+
const ref =
|
|
92
|
+
r.drive && r.path ? `${r.drive}:${r.path}` : r.context_item_id;
|
|
93
|
+
prompt += `### ${r.title} (${ref})\n`;
|
|
92
94
|
if (r.chunk_content) {
|
|
93
95
|
prompt += `${r.chunk_content.slice(0, 1000)}\n`;
|
|
94
96
|
}
|
|
@@ -103,7 +105,7 @@ export async function buildChatSystemPrompt(
|
|
|
103
105
|
prompt += `## Instructions
|
|
104
106
|
You are Botholomew, an AI agent personified by a wise owl. This is your interactive chat interface. Help the user manage tasks, review results from background worker activity, search context, and answer questions.
|
|
105
107
|
You do NOT execute long-running work directly — enqueue tasks for a background worker instead using create_task, and spawn a worker via spawn_worker when the user wants the task run now.
|
|
106
|
-
Use the available tools to look up tasks, threads, schedules, and context when the user asks about them. Context items
|
|
108
|
+
Use the available tools to look up tasks, threads, schedules, and context when the user asks about them. Context items live under a drive (disk / url / agent / google-docs / github / …); use \`context_list_drives\` to discover which drives have content, then \`context_tree\`, \`context_info\`, \`context_search\`, or \`context_refresh\` as needed.
|
|
107
109
|
When multiple tool calls are independent of each other (i.e., one does not depend on the result of another), call them all in a single response. They will be executed in parallel, which is faster than calling them one at a time.
|
|
108
110
|
You can update the agent's beliefs and goals files when the user asks you to.
|
|
109
111
|
Format your responses using Markdown. Use headings, bold, italic, lists, and code blocks to make your responses clear and well-structured.
|
|
@@ -113,6 +115,8 @@ Format your responses using Markdown. Use headings, bold, italic, lists, and cod
|
|
|
113
115
|
prompt += `
|
|
114
116
|
## External Tools (MCP)
|
|
115
117
|
|
|
118
|
+
Before reaching for MCP tools to **find** information, check local context first — content from Drive, Gmail, GitHub, URLs, and prior agent runs is often already ingested. Use \`search_semantic\` (semantic) or \`context_search\` (keyword) across drives, then \`context_read\` / \`context_tree\` to drill in. Only fall through to \`mcp_exec\` when the data is fresh, write-side (sending an email, creating an issue), or genuinely missing locally.
|
|
119
|
+
|
|
116
120
|
You have access to external tools via MCP servers. Before calling any MCP tool you haven't used yet this session, you MUST fetch its schema first:
|
|
117
121
|
|
|
118
122
|
1. Discover tools with \`mcp_search\` (preferred — semantic) or \`mcp_list_tools\`.
|