mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-21 20:06:06 +00:00
fix(tools): support skill mount root discovery
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import fnmatch
|
||||
import json
|
||||
import os
|
||||
|
||||
@@ -908,6 +909,23 @@ else:
|
||||
path = str(parameters.get('path', '/workspace') or '/workspace')
|
||||
self.ap.logger.info(f'glob tool invoked: query_id={query.query_id} pattern={pattern} path={path}')
|
||||
|
||||
if path.rstrip('/') == skill_loader.SKILL_MOUNT_PREFIX:
|
||||
skill_names = set(skill_loader.get_visible_skills(self.ap, query))
|
||||
skill_names.update(skill_loader.get_activated_skills(query))
|
||||
matches = [
|
||||
skill_loader.get_virtual_skill_mount_path(skill_name)
|
||||
for skill_name in sorted(skill_names)
|
||||
if fnmatch.fnmatchcase(skill_name, pattern)
|
||||
]
|
||||
return {
|
||||
'ok': True,
|
||||
'matches': matches,
|
||||
'preview': '\n'.join(matches),
|
||||
'total': len(matches),
|
||||
'truncated': False,
|
||||
'truncated_by': None,
|
||||
}
|
||||
|
||||
host_path, selected_skill = self._resolve_host_path(
|
||||
query,
|
||||
path,
|
||||
|
||||
Reference in New Issue
Block a user