mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-19 16:12:30 +00:00
This commit implements a progressive refactoring of the tool system to support plugin discovery, scoped loading, and protocol-driven runtime context injection. Key changes: - Add Tool ABC metadata (tool_name, _scopes) and ToolContext dataclass for dependency injection. - Introduce ToolLoader with pkgutil-based builtin discovery and entry_points-based third-party plugin loading. - Add scope filtering (core/subagent/memory) so different contexts load appropriate tool sets. - Introduce ContextAware protocol and RequestContext dataclass to replace hardcoded per-tool context injection in AgentLoop. - Add RuntimeState / MutableRuntimeState protocols to decouple MyTool from AgentLoop. - Migrate all built-in tools to declare scopes and implement create()/enabled() hooks. - Migrate MessageTool, SpawnTool, CronTool, and MyTool to ContextAware. - Refactor AgentLoop to use ToolLoader and protocol-driven context injection. - Refactor SubagentManager to use ToolLoader(scope="subagent") with per-run FileStates isolation. - Register all built-in tools via pyproject.toml entry_points. - Add comprehensive tests for loader scopes, entry_points, ContextAware, subagent tools, and runtime state sync.
100 lines
1.1 KiB
Plaintext
100 lines
1.1 KiB
Plaintext
# Project-specific
|
|
.worktrees/
|
|
.worktree/
|
|
.assets
|
|
.docs
|
|
.env
|
|
.web
|
|
.orion
|
|
|
|
# Claude / AI assistant artifacts
|
|
docs/superpowers/
|
|
docs/plans/
|
|
|
|
# webui (monorepo frontend)
|
|
webui/node_modules/
|
|
webui/dist/
|
|
webui/coverage/
|
|
webui/.vite/
|
|
*.tsbuildinfo
|
|
|
|
# Python bytecode & caches
|
|
*.pyc
|
|
*.pyo
|
|
*.pyd
|
|
*.pyw
|
|
*.pyz
|
|
__pycache__/
|
|
*.egg-info/
|
|
*.egg
|
|
.venv/
|
|
venv/
|
|
.pytest_cache/
|
|
.mypy_cache/
|
|
.ruff_cache/
|
|
.pytype/
|
|
.dmypy.json
|
|
dmypy.json
|
|
.tox/
|
|
.nox/
|
|
.hypothesis/
|
|
|
|
# Build & packaging
|
|
dist/
|
|
build/
|
|
*.manifest
|
|
*.spec
|
|
pip-wheel-metadata/
|
|
share/python-wheels/
|
|
|
|
# Test & coverage
|
|
.coverage
|
|
.coverage.*
|
|
htmlcov/
|
|
coverage.xml
|
|
*.cover
|
|
|
|
# Lock files (project policy)
|
|
poetry.lock
|
|
uv.lock
|
|
|
|
# Jupyter
|
|
.ipynb_checkpoints/
|
|
|
|
# macOS
|
|
.DS_Store
|
|
.AppleDouble
|
|
.LSOverride
|
|
|
|
# Windows
|
|
Thumbs.db
|
|
ehthumbs.db
|
|
Desktop.ini
|
|
|
|
# Linux
|
|
.directory
|
|
|
|
# Editors & IDEs (local workspace / user settings)
|
|
.vscode/
|
|
.cursor/
|
|
.idea/
|
|
.fleet/
|
|
*.code-workspace
|
|
*.sublime-project
|
|
*.sublime-workspace
|
|
*.swp
|
|
*.swo
|
|
*~
|
|
nano.*.save
|
|
|
|
# Environment & secrets (keep examples tracked if needed)
|
|
.env.*
|
|
!.env.example
|
|
|
|
# Logs & temp
|
|
*.log
|
|
logs/
|
|
tmp/
|
|
temp/
|
|
*.tmp
|