diff --git a/electron/gateway/clawhub.ts b/electron/gateway/clawhub.ts index 25cb2686a..e2366349b 100644 --- a/electron/gateway/clawhub.ts +++ b/electron/gateway/clawhub.ts @@ -163,7 +163,7 @@ export class ClawHubService { // Format could be: slug vversion description (score) // Or sometimes: slug vversion description - const match = cleanLine.match(/^(\S+)\s+v?(\d+\.\S+)\s+(.+)$/); + let match = cleanLine.match(/^(\S+)\s+v?(\d+\.\S+)\s+(.+)$/); if (match) { const slug = match[1]; const version = match[2]; @@ -179,6 +179,24 @@ export class ClawHubService { description, }; } + + // Fallback for new clawhub search format without version: + // slug name/description (score) + match = cleanLine.match(/^(\S+)\s+(.+)$/); + if (match) { + const slug = match[1]; + let description = match[2]; + + // Clean up score if present at the end + description = description.replace(/\(\d+\.\d+\)$/, '').trim(); + + return { + slug, + name: slug, + version: 'latest', // Fallback version since it's not provided + description, + }; + } return null; }).filter((s): s is ClawHubSkillResult => s !== null); } catch (error) {