feat: scan workspace .agents/skills/ directories for skill imports
Add scanWorkspaceSkills method to skill service that iterates all workspace local paths for a company and imports SKILL.md files from .agents/skills/ subdirectories. Uses path.join for cross-platform compatibility (Windows/macOS/Linux). The scan runs automatically when skills are listed via IPC, with graceful error handling per workspace so one bad path does not block the entire listing. Also adds listWorkspaceLocalPaths to database for retrieving workspace paths by company.
This commit is contained in:
1 parent
831acc3b06
commit
3b756fd30d
3 files changed
+52
-1
No files matched your search
@@ -1182,6 +1182,13 @@ export class AppDatabase {
|
||||
return row ? { ...row, isPrimary: toBoolean(row.isPrimary) } : null;
|
||||
}
|
||||
|
||||
listWorkspaceLocalPaths(companyId: string): string[] {
|
||||
const rows = this.db
|
||||
.prepare("select local_path as localPath from workspaces where company_id = ? and local_path is not null")
|
||||
.all(companyId) as Array<{ localPath: string }>;
|
||||
return rows.map((r) => r.localPath).filter(Boolean);
|
||||
}
|
||||
|
||||
getAnyCompanyWorkspace(companyId: string): WorkspaceRecord | null {
|
||||
const row = this.db
|
||||
.prepare(
|
||||
|
||||
Reference in new issue
Block a user