# tool-chest.toml — Personal Agentic Workspace config
#
# This is the single place to configure the whole workspace.
# Edit this file; scripts and launchers read from it automatically.
#
# SECRETS never go here. API keys and tokens stay in your shell environment
# (SPB-03/09). This file only holds non-secret preferences and paths.
#
# Required shell environment variables (set in your shell profile, not here):
#   ANYTYPE_OPENAPI_MCP_HEADERS  — JSON string for Anytype MCP auth:
#     export ANYTYPE_OPENAPI_MCP_HEADERS='{"Authorization":"Bearer <key>","Anytype-Version":"2025-11-08"}'
#
# Optional shell overrides (take precedence over values below):
#   LOCAL_AGENT_MODEL  — override the model without editing this file
#   LOCAL_AGENT_DB     — override the SQLite store path

[workspace]
title = "Personal Agentic Workspace"

# ── local-agent ──────────────────────────────────────────────────────────────
[local_agent]

# SQLite store path. Uncomment and set to override the default.
# Default: ~/.local/share/local-agent/store.db
# db = "~/.local/share/local-agent/store.db"

# Default graph traversal depth for `la who TEAM`.
who_depth = 2

[local_agent.chat]
# LLM-powered chat capture via Ollama + Claude Code.
# Disabled by default — requires a machine with >= 16 GB RAM and a capable GPU.
# Even small models (7B) are too slow for interactive use on a low-power laptop.
# Enable on a machine that can handle it by setting enabled = true and choosing a model.
#
# Recommended sizing:
#   16 GB RAM → mistral:7b or llama3.1
#   24 GB RAM → mistral-nemo or deepseek-r1:7b
enabled = false
model = "mistral:7b"

[local_agent.ollama]
# Ollama server URL. Change only if you run Ollama on a non-default port.
base_url = "http://localhost:11434"

# Context window size in tokens. Claude Code needs >= 64k.
# Build a custom model variant with this window using:
#   ollama create local-agent-chat -f local-agent/Modelfile
context_window = 65536

# ── MCP servers ───────────────────────────────────────────────────────────────
# Single source of truth for MCP server definitions.
#
# `.mcp.json` (Claude Code) and `.cursor/mcp.json` (Cursor) are BOTH GENERATED
# from this section — the two clients use incompatible interpolation syntax, so
# they cannot share one file. Edit here, then run `make mcp-config`.
# `make mcp-check` fails when the generated files drift from this section.
#
# Placeholders, translated to each client's dialect:
#   @env:NAME   value of environment variable NAME (secrets stay in your shell,
#               never in this file — SPB-03/09)
#   @root       absolute path to this repo
#
# scope = "user"     also installable outside this repo, via `make mcp-install-user`
# scope = "project"  only loads while working inside tool-chest

[mcp.anytype]
# Anytype MCP per https://developers.anytype.io/docs/examples/featured/mcp/
# Token lives in ANYTYPE_OPENAPI_MCP_HEADERS in your shell profile. Example:
#   export ANYTYPE_OPENAPI_MCP_HEADERS='{"Authorization":"Bearer <key>","Anytype-Version":"2025-11-08"}'
scope = "project"
command = "npx"
args = ["-y", "@anyproto/anytype-mcp"]
env.ANYTYPE_API_BASE_URL = "@env:ANYTYPE_API_BASE_URL"
env.OPENAPI_MCP_HEADERS = "@env:ANYTYPE_OPENAPI_MCP_HEADERS"

[mcp.library]
scope = "user"
command = "uv"
args = ["run", "--directory", "@root/library", "library", "serve"]
env.PYTHONPATH = "@root/library/src:@root"
env.LIBRARY_HOOKS_MODULE = "integrations.library.hooks"

[mcp.research]
scope = "user"
command = "uv"
args = ["run", "--directory", "@root/research", "research", "serve"]
env.PYTHONPATH = "@root/research/src:@root"

# ── anytype ───────────────────────────────────────────────────────────────────
[anytype]
# Anytype Local API base URL.
# Default port: 31009. CLI mode typically uses: 31012.
api_base_url = "http://127.0.0.1:31009"

# ── library (calibre-librarian) ────────────────────────────────────────────────
[library]
# Calibre library path on disk.
calibre_library = "~/reference-library"

# Index all EPUBs in calibre_library (use tag/query filters for a mixed library).
scope_all = true

# Scope filter — only books matching this scope are indexed.
# include_tags = ["agent-reference"]
# exclude_tags = ["Fantasy", "Fiction"]
# include_query = 'tags:"=agent-reference" and formats:epub'

# ── research (anthropic-research) ──────────────────────────────────────────────
[research]
# Local archive of Anthropic's published research (https://www.anthropic.com/research).
# Defaults work out of the box; uncomment to override.
# archive_dir = "~/reference-archive/anthropic-research"
# db = "~/.local/share/research/index.db"
# include_pdfs = true    # download + index Anthropic-hosted full-paper PDFs
# fetch_delay = 1.0      # seconds between requests (polite crawling)
