skillfish 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/registry.js +6 -5
- package/package.json +1 -1
package/dist/lib/registry.js
CHANGED
|
@@ -105,6 +105,7 @@ export async function searchSkillsInRegistry(query, limit = 5) {
|
|
|
105
105
|
try {
|
|
106
106
|
const params = new URLSearchParams({
|
|
107
107
|
q: query,
|
|
108
|
+
type: 'skills',
|
|
108
109
|
limit: String(limit),
|
|
109
110
|
});
|
|
110
111
|
const res = await fetchWithRetry(`${REGISTRY_SEARCH_URL}?${params.toString()}`, {
|
|
@@ -134,7 +135,7 @@ export async function searchSkillsInRegistry(query, limit = 5) {
|
|
|
134
135
|
error: data.error || `Registry error: ${res.status}`,
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
|
-
if (!data.
|
|
138
|
+
if (!data.skills || !Array.isArray(data.skills)) {
|
|
138
139
|
return {
|
|
139
140
|
success: true,
|
|
140
141
|
results: [],
|
|
@@ -143,16 +144,16 @@ export async function searchSkillsInRegistry(query, limit = 5) {
|
|
|
143
144
|
}
|
|
144
145
|
// Validate and transform API response to our SearchResult format
|
|
145
146
|
// Filter out malformed items that are missing required string fields
|
|
146
|
-
const results = data.
|
|
147
|
+
const results = data.skills
|
|
147
148
|
.filter((item) => typeof item.name === 'string' &&
|
|
148
149
|
typeof item.slug === 'string' &&
|
|
149
150
|
typeof item.github === 'string')
|
|
150
151
|
.map((item) => ({
|
|
151
152
|
name: item.name,
|
|
152
153
|
slug: item.slug,
|
|
153
|
-
type:
|
|
154
|
-
owner: item.
|
|
155
|
-
ownerUrl: item.
|
|
154
|
+
type: 'skill',
|
|
155
|
+
owner: item.owner?.name ?? '',
|
|
156
|
+
ownerUrl: item.owner?.url ?? '',
|
|
156
157
|
github: item.github,
|
|
157
158
|
description: item.description ?? '',
|
|
158
159
|
stars: item.github_stars ?? 0,
|
package/package.json
CHANGED