Coverage for src/keel/capabilities.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-18 12:05 +0000

1"""Static capability vocabulary shared by config, extensions, and runtime detection.""" 

2 

3from __future__ import annotations 

4 

5KNOWN_CAPABILITIES: tuple[str, ...] = ( 

6 "shell", 

7 "git", 

8 "gh", 

9 "gh-auth", 

10 "github-mcp", 

11 "subagents", 

12 "parallel-subagents", 

13 "browser", 

14 "adb", 

15 "firebase", 

16 "filesystem-write", 

17 "worktree", 

18 "release-publish", 

19 "secret-access", 

20 "api-token", 

21 "production-adjacent", 

22 "private-setup", 

23) 

24 

25 

26def validate_names(names: tuple[str, ...] | list[str], *, source: str) -> list[str]: 

27 """Return errors for unknown capability names.""" 

28 

29 known = set(KNOWN_CAPABILITIES) 

30 errors: list[str] = [] 

31 for name in names: 

32 if name not in known: 

33 errors.append( 

34 f"{source}: unknown capability {name!r}; valid: {', '.join(KNOWN_CAPABILITIES)}" 

35 ) 

36 return errors