Add skill enable controls and data factory SQL skill
This commit is contained in:
@@ -20,6 +20,11 @@ if TYPE_CHECKING:
|
||||
from .agent_runtime import LocalCodingAgent
|
||||
|
||||
|
||||
ALWAYS_ENABLED_HIDDEN_SKILL_NAMES = frozenset(
|
||||
{'update-config', 'verify', 'simplify', 'debug'}
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class BundledSkill:
|
||||
"""A bundled skill definition."""
|
||||
@@ -265,6 +270,7 @@ def find_bundled_skill(name: str, cwd: Path | str | None = None) -> BundledSkill
|
||||
def format_skills_for_system_prompt(
|
||||
max_chars: int = 8000,
|
||||
cwd: Path | str | None = None,
|
||||
enabled_skill_names: tuple[str, ...] | set[str] | None = None,
|
||||
) -> str:
|
||||
"""Format bundled skills for inclusion in system-reminder messages.
|
||||
|
||||
@@ -272,10 +278,17 @@ def format_skills_for_system_prompt(
|
||||
"""
|
||||
lines = ['Available skills (invoke via Skill tool):']
|
||||
char_count = len(lines[0])
|
||||
enabled_names = (
|
||||
{name.strip().lower() for name in enabled_skill_names if name.strip()}
|
||||
if enabled_skill_names is not None
|
||||
else None
|
||||
)
|
||||
|
||||
for skill in get_bundled_skills(cwd):
|
||||
if not skill.user_invocable:
|
||||
continue
|
||||
if enabled_names is not None and skill.name.lower() not in enabled_names:
|
||||
continue
|
||||
entry = f'- {skill.name}: {skill.description}'
|
||||
if skill.when_to_use:
|
||||
entry += f' When to use: {skill.when_to_use}'
|
||||
|
||||
Reference in New Issue
Block a user