gabriel / muse public
feat BREAKING task/shell-lang-support #1 / 1
gabriel · 64 days ago · Apr 12, 2026 · Diff

feat: add bash/zsh tree-sitter grammar support and per-repo language config

- Add `name` field to LangSpec TypedDict (user-facing language identifier) and update all 13 existing specs - Add _BASH_SPEC covering .sh, .bash, .zsh, .plugin.zsh extensions via tree-sitter-bash (zsh is a strict backward-compatible superset of bash at the AST level); extracts function_definition and variable_assignment - Add `shell` optional extra to pyproject.toml (tree-sitter-bash>=0.23.3); include in `muse[all]` - Add CodeConfig dataclass + load_code_config() to read [code] languages list from .muse/code_config.toml; returns defaults on any error - Add _LANGUAGE_FILTER global + configure_language_filter() so callers (muse code commands) can restrict active grammars per-repo at startup - Add reset_adapter_cache() for test isolation (clears _ADAPTERS_CACHE, _SEM_EXT_CACHE, and promoted module attrs) - Add _BUILTIN_ADAPTER_NAMES frozenset to enable filtering built-in adapters (python, markdown, html, toml) by name alongside tree-sitter - Update _adapters() to respect _LANGUAGE_FILTER for both built-in and tree-sitter adapters - Update _framework.py module docstring to document [code] section - Add tests/test_code_language_config.py: 57 tests covering LangSpec.name, _BASH_SPEC, CodeConfig, load_code_config, configure_language_filter, reset_adapter_cache, and adapter_for_path shell routing - Add TestBashAdapter (18 tests) to tests/test_code_plugin.py covering function/variable extraction, content IDs, extension routing, and graceful skip when tree-sitter-bash is not installed - Regenerate docs/reference/type-contracts.md (LangSpec gains name field)

sha256:49941276913b80f63c92b9da2c610aacb9d828182caf8c317a6ed73eb25d861d sha
sha256:cc128bf0aeb7aa57327d6dc6aa01b298b457877c5d93761ec13c07d07fa10f15 snapshot
← Older Oldest on task/shell-lang-support
All commits
Newer → Latest on task/shell-lang-support

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:49941276913b80f63c92b9da2c610aacb9d828182caf8c317a6ed73eb25d861d --body "your comment"