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

9 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-02 20:26 +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 "providers", 

22 "review-vendors", 

23 "production-adjacent", 

24 "private-setup", 

25) 

26 

27 

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

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

30 

31 known = set(KNOWN_CAPABILITIES) 

32 errors: list[str] = [] 

33 for name in names: 

34 if name not in known: 

35 errors.append( 

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

37 ) 

38 return errors