feat: web_read (trafilatura), session_read, http_fetch max_chars
web_read(url, max_chars=16000) — fetches a URL and extracts clean article text via trafilatura, stripping ads/nav/boilerplate. Returns markdown. session_read(date) — reads a full session log by YYYY-MM-DD date; lists available dates if the requested one is not found. http_fetch gains a max_chars param (default 8192, max 32768) so the cap is configurable instead of hardcoded. Tool count: 45 → 47. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ from google.genai import types
|
||||
|
||||
# ── Callable imports ──────────────────────────────────────────────────────────
|
||||
|
||||
from tools.web import search as _web_search, http_fetch as _http_fetch
|
||||
from tools.web import search as _web_search, http_fetch as _http_fetch, web_read as _web_read
|
||||
from tools.ae_knowledge import (
|
||||
journal_list as _ae_journal_list,
|
||||
journal_search as _ae_journal_search,
|
||||
@@ -30,7 +30,7 @@ from tools.ae_knowledge import (
|
||||
journal_entry_prepend as _ae_journal_entry_prepend,
|
||||
)
|
||||
from tools.ae_tasks import task_list as _ae_task_list
|
||||
from tools.files import file_read as _file_read, file_list as _file_list, file_write as _file_write, session_search as _session_search
|
||||
from tools.files import file_read as _file_read, file_list as _file_list, file_write as _file_write, session_search as _session_search, session_read as _session_read
|
||||
from tools.system import (
|
||||
shell_exec as _shell_exec,
|
||||
claude_allow_dir as _claude_allow_dir,
|
||||
@@ -90,8 +90,8 @@ import tools.agents as _mod_agents
|
||||
# ── Tool categories — used by the Model Registry UI for grouped checkboxes ───
|
||||
|
||||
TOOL_CATEGORIES: dict[str, list[str]] = {
|
||||
"Web": ["web_search", "http_fetch"],
|
||||
"Files": ["file_read", "file_list", "file_write", "session_search"],
|
||||
"Web": ["web_search", "http_fetch", "web_read"],
|
||||
"Files": ["file_read", "file_list", "file_write", "session_read", "session_search"],
|
||||
"Shell": ["shell_exec", "claude_allow_dir"],
|
||||
"System": ["cortex_restart", "cortex_logs", "cortex_status", "cortex_update"],
|
||||
"Tasks": ["task_list", "task_create", "task_update", "task_complete"],
|
||||
@@ -116,6 +116,7 @@ TOOL_CATEGORIES: dict[str, list[str]] = {
|
||||
_CALLABLES: dict[str, callable] = {
|
||||
"web_search": _web_search,
|
||||
"http_fetch": _http_fetch,
|
||||
"web_read": _web_read,
|
||||
"ae_journal_list": _ae_journal_list,
|
||||
"ae_journal_search": _ae_journal_search,
|
||||
"ae_journal_entry_read": _ae_journal_entry_read,
|
||||
@@ -129,6 +130,7 @@ _CALLABLES: dict[str, callable] = {
|
||||
"file_read": _file_read,
|
||||
"file_list": _file_list,
|
||||
"file_write": _file_write,
|
||||
"session_read": _session_read,
|
||||
"session_search": _session_search,
|
||||
"shell_exec": _shell_exec,
|
||||
"claude_allow_dir": _claude_allow_dir,
|
||||
|
||||
Reference in New Issue
Block a user