@llmindset/hf-mcp 0.3.0 → 0.3.2
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/docs-search/docs-semantic-search.d.ts.map +1 -1
- package/dist/docs-search/docs-semantic-search.js +7 -1
- package/dist/docs-search/docs-semantic-search.js.map +1 -1
- package/dist/hub-inspect.d.ts +2 -2
- package/dist/hub-inspect.d.ts.map +1 -1
- package/dist/hub-inspect.js +1 -1
- package/dist/hub-inspect.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/repo-search.d.ts +46 -0
- package/dist/repo-search.d.ts.map +1 -0
- package/dist/repo-search.js +310 -0
- package/dist/repo-search.js.map +1 -0
- package/dist/repo-search.test.d.ts +2 -0
- package/dist/repo-search.test.d.ts.map +1 -0
- package/dist/repo-search.test.js +130 -0
- package/dist/repo-search.test.js.map +1 -0
- package/dist/tool-ids.d.ts +6 -5
- package/dist/tool-ids.d.ts.map +1 -1
- package/dist/tool-ids.js +9 -14
- package/dist/tool-ids.js.map +1 -1
- package/package.json +2 -2
- package/src/docs-search/docs-semantic-search.ts +8 -1
- package/src/hub-inspect.ts +2 -2
- package/src/index.ts +1 -0
- package/src/repo-search.test.ts +155 -0
- package/src/repo-search.ts +414 -0
- package/src/tool-ids.ts +10 -14
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HfApiCall } from './hf-api-call.js';
|
|
3
|
+
import { formatDate, formatNumber } from './utilities.js';
|
|
4
|
+
import type { ToolResult } from './types/tool-result.js';
|
|
5
|
+
|
|
6
|
+
const TAGS_TO_RETURN = 20;
|
|
7
|
+
const TOKEN_CAP = 12_500;
|
|
8
|
+
const CHARS_PER_TOKEN = 3;
|
|
9
|
+
const MAX_OUTPUT_CHARS = TOKEN_CAP * CHARS_PER_TOKEN;
|
|
10
|
+
|
|
11
|
+
const REPO_TYPES = ['model', 'dataset', 'space'] as const;
|
|
12
|
+
export type RepoType = (typeof REPO_TYPES)[number];
|
|
13
|
+
|
|
14
|
+
const REPO_TYPE_LABELS: Record<RepoType, string> = {
|
|
15
|
+
model: 'Models',
|
|
16
|
+
dataset: 'Datasets',
|
|
17
|
+
space: 'Spaces',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const DEFAULT_REPO_TYPES: RepoType[] = ['model', 'dataset'];
|
|
21
|
+
|
|
22
|
+
export const REPO_SEARCH_TOOL_CONFIG = {
|
|
23
|
+
name: 'hub_repo_search',
|
|
24
|
+
description:
|
|
25
|
+
'Search Hugging Face repositories with a shared query interface. ' +
|
|
26
|
+
'You can target models, datasets, spaces, or aggregate across multiple repo types in one call. ' +
|
|
27
|
+
'Use space_search for semantic-first discovery of Spaces. ' +
|
|
28
|
+
'Include links to repositories in your response.',
|
|
29
|
+
schema: z.object({
|
|
30
|
+
query: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Search term. Leave blank and specify sort + limit to browse trending or recent repositories.'),
|
|
34
|
+
repo_types: z
|
|
35
|
+
.array(z.enum(REPO_TYPES))
|
|
36
|
+
.min(1)
|
|
37
|
+
.max(3)
|
|
38
|
+
.optional()
|
|
39
|
+
.default(DEFAULT_REPO_TYPES)
|
|
40
|
+
.describe(
|
|
41
|
+
'Repository types to search. Defaults to ["model", "dataset"]. space uses keyword search via /api/spaces.'
|
|
42
|
+
),
|
|
43
|
+
author: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Organization or user namespace to filter by (e.g. 'google', 'meta-llama', 'huggingface')."),
|
|
47
|
+
filters: z
|
|
48
|
+
.array(z.string())
|
|
49
|
+
.optional()
|
|
50
|
+
.describe(
|
|
51
|
+
'Optional hub filter tags. Applied to each selected repo type (e.g. ["text-generation"], ["language:en"], ["mcp-server"]).'
|
|
52
|
+
),
|
|
53
|
+
sort: z
|
|
54
|
+
.enum(['trendingScore', 'downloads', 'likes', 'createdAt', 'lastModified'])
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Sort order (descending): trendingScore, downloads, likes, createdAt, lastModified'),
|
|
57
|
+
limit: z
|
|
58
|
+
.number()
|
|
59
|
+
.min(1)
|
|
60
|
+
.max(100)
|
|
61
|
+
.optional()
|
|
62
|
+
.default(20)
|
|
63
|
+
.describe('Maximum number of results to return per selected repo type'),
|
|
64
|
+
}),
|
|
65
|
+
annotations: {
|
|
66
|
+
title: 'Repo Search',
|
|
67
|
+
destructiveHint: false,
|
|
68
|
+
readOnlyHint: true,
|
|
69
|
+
openWorldHint: true,
|
|
70
|
+
},
|
|
71
|
+
} as const;
|
|
72
|
+
|
|
73
|
+
export type RepoSearchParams = z.infer<typeof REPO_SEARCH_TOOL_CONFIG.schema>;
|
|
74
|
+
|
|
75
|
+
interface RepoApiParams {
|
|
76
|
+
search?: string;
|
|
77
|
+
author?: string;
|
|
78
|
+
filter?: string;
|
|
79
|
+
sort?: string;
|
|
80
|
+
direction?: string;
|
|
81
|
+
limit?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface RepoResultBase {
|
|
85
|
+
id: string;
|
|
86
|
+
author?: string | null;
|
|
87
|
+
likes?: number;
|
|
88
|
+
downloads?: number;
|
|
89
|
+
trendingScore?: number;
|
|
90
|
+
private?: boolean;
|
|
91
|
+
tags?: string[];
|
|
92
|
+
createdAt?: string;
|
|
93
|
+
lastModified?: string | null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface ModelRepoResult extends RepoResultBase {
|
|
97
|
+
pipeline_tag?: string;
|
|
98
|
+
library_name?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface DatasetRepoResult extends RepoResultBase {
|
|
102
|
+
description?: string;
|
|
103
|
+
gated?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface SpaceRepoResult extends RepoResultBase {
|
|
107
|
+
title?: string | null;
|
|
108
|
+
emoji?: string | null;
|
|
109
|
+
sdk?: string;
|
|
110
|
+
shortDescription?: string;
|
|
111
|
+
ai_short_description?: string;
|
|
112
|
+
disabled?: boolean | null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
type RepoSearchResult = ModelRepoResult | DatasetRepoResult | SpaceRepoResult;
|
|
116
|
+
|
|
117
|
+
interface RepoSearchBatchResult {
|
|
118
|
+
repoType: RepoType;
|
|
119
|
+
results: RepoSearchResult[];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Service for searching Hugging Face repositories with shared parameters.
|
|
124
|
+
*
|
|
125
|
+
* Uses listing endpoints:
|
|
126
|
+
* - /api/models
|
|
127
|
+
* - /api/datasets
|
|
128
|
+
* - /api/spaces
|
|
129
|
+
*/
|
|
130
|
+
export class RepoSearchTool extends HfApiCall<Record<string, string>, unknown> {
|
|
131
|
+
constructor(hfToken?: string) {
|
|
132
|
+
super('https://huggingface.co/api', hfToken);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async searchWithParams(params: Partial<RepoSearchParams>): Promise<ToolResult> {
|
|
136
|
+
try {
|
|
137
|
+
const repoTypes = normalizeRepoTypes(params.repo_types);
|
|
138
|
+
const apiParams = this.toApiParams(params);
|
|
139
|
+
|
|
140
|
+
const searchBatches = await Promise.all(
|
|
141
|
+
repoTypes.map(async (repoType): Promise<RepoSearchBatchResult> => {
|
|
142
|
+
const results = await this.searchByType(repoType, apiParams);
|
|
143
|
+
return { repoType, results };
|
|
144
|
+
})
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const totalResults = searchBatches.reduce((sum, batch) => sum + batch.results.length, 0);
|
|
148
|
+
if (totalResults === 0) {
|
|
149
|
+
return {
|
|
150
|
+
formatted: `No repositories found for the given criteria.`,
|
|
151
|
+
totalResults: 0,
|
|
152
|
+
resultsShared: 0,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return formatSearchResults(searchBatches, params, repoTypes);
|
|
157
|
+
} catch (error) {
|
|
158
|
+
if (error instanceof Error) {
|
|
159
|
+
throw new Error(`Failed to search repositories: ${error.message}`);
|
|
160
|
+
}
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private toApiParams(params: Partial<RepoSearchParams>): RepoApiParams {
|
|
166
|
+
const apiParams: RepoApiParams = {};
|
|
167
|
+
|
|
168
|
+
if (params.query) {
|
|
169
|
+
apiParams.search = params.query;
|
|
170
|
+
}
|
|
171
|
+
if (params.author) {
|
|
172
|
+
apiParams.author = params.author;
|
|
173
|
+
}
|
|
174
|
+
if (params.filters && params.filters.length > 0) {
|
|
175
|
+
apiParams.filter = params.filters.join(',');
|
|
176
|
+
}
|
|
177
|
+
if (params.sort) {
|
|
178
|
+
apiParams.sort = params.sort;
|
|
179
|
+
apiParams.direction = '-1';
|
|
180
|
+
}
|
|
181
|
+
if (params.limit) {
|
|
182
|
+
apiParams.limit = params.limit.toString();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return apiParams;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private async searchByType(repoType: RepoType, params: RepoApiParams): Promise<RepoSearchResult[]> {
|
|
189
|
+
const endpoint = repoType === 'model' ? 'models' : repoType === 'dataset' ? 'datasets' : 'spaces';
|
|
190
|
+
const url = new URL(`${this.apiUrl}/${endpoint}`);
|
|
191
|
+
|
|
192
|
+
if (params.search !== undefined) {
|
|
193
|
+
url.searchParams.set('search', params.search);
|
|
194
|
+
}
|
|
195
|
+
if (params.author !== undefined) {
|
|
196
|
+
url.searchParams.set('author', params.author);
|
|
197
|
+
}
|
|
198
|
+
if (params.filter !== undefined) {
|
|
199
|
+
url.searchParams.set('filter', params.filter);
|
|
200
|
+
}
|
|
201
|
+
if (params.sort !== undefined) {
|
|
202
|
+
url.searchParams.set('sort', params.sort);
|
|
203
|
+
}
|
|
204
|
+
if (params.direction !== undefined) {
|
|
205
|
+
url.searchParams.set('direction', params.direction);
|
|
206
|
+
}
|
|
207
|
+
if (params.limit !== undefined) {
|
|
208
|
+
url.searchParams.set('limit', params.limit);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return this.fetchFromApi<RepoSearchResult[]>(url);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function normalizeRepoTypes(repoTypes: RepoType[] | undefined): RepoType[] {
|
|
216
|
+
if (!repoTypes || repoTypes.length === 0) {
|
|
217
|
+
return [...DEFAULT_REPO_TYPES];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const seen = new Set<RepoType>();
|
|
221
|
+
const normalized: RepoType[] = [];
|
|
222
|
+
|
|
223
|
+
for (const repoType of repoTypes) {
|
|
224
|
+
if (!seen.has(repoType)) {
|
|
225
|
+
seen.add(repoType);
|
|
226
|
+
normalized.push(repoType);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return normalized.length > 0 ? normalized : [...DEFAULT_REPO_TYPES];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function formatSearchResults(
|
|
234
|
+
searchBatches: RepoSearchBatchResult[],
|
|
235
|
+
params: Partial<RepoSearchParams>,
|
|
236
|
+
repoTypes: RepoType[]
|
|
237
|
+
): ToolResult {
|
|
238
|
+
const lines: string[] = [];
|
|
239
|
+
const totalResults = searchBatches.reduce((sum, batch) => sum + batch.results.length, 0);
|
|
240
|
+
let resultsShared = 0;
|
|
241
|
+
let truncated = false;
|
|
242
|
+
|
|
243
|
+
const tryAppendLines = (nextLines: string[]): boolean => {
|
|
244
|
+
const candidate = [...lines, ...nextLines].join('\n');
|
|
245
|
+
if (candidate.length > MAX_OUTPUT_CHARS) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
lines.push(...nextLines);
|
|
250
|
+
return true;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
const searchTerms: string[] = [];
|
|
254
|
+
if (params.query) searchTerms.push(`query "${params.query}"`);
|
|
255
|
+
if (params.author) searchTerms.push(`author "${params.author}"`);
|
|
256
|
+
if (params.filters && params.filters.length > 0) searchTerms.push(`filters [${params.filters.join(', ')}]`);
|
|
257
|
+
if (params.sort) searchTerms.push(`sorted by ${params.sort} (descending)`);
|
|
258
|
+
|
|
259
|
+
const repoTypesText = repoTypes.map((repoType) => REPO_TYPE_LABELS[repoType].toLowerCase()).join(', ');
|
|
260
|
+
const searchDesc = searchTerms.length > 0 ? ` matching ${searchTerms.join(', ')}` : '';
|
|
261
|
+
if (!tryAppendLines([`Found ${totalResults.toString()} repositories across ${repoTypesText}${searchDesc}.`, ''])) {
|
|
262
|
+
truncated = true;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
outer: for (const batch of searchBatches) {
|
|
266
|
+
if (truncated) {
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const sectionLabel = REPO_TYPE_LABELS[batch.repoType];
|
|
271
|
+
if (!tryAppendLines([`## ${sectionLabel} (${batch.results.length.toString()})`, ''])) {
|
|
272
|
+
truncated = true;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (batch.results.length === 0) {
|
|
277
|
+
if (!tryAppendLines([`No ${sectionLabel.toLowerCase()} matched this query.`, ''])) {
|
|
278
|
+
truncated = true;
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
for (const result of batch.results) {
|
|
285
|
+
const repoLines: string[] = [];
|
|
286
|
+
appendRepoResult(repoLines, batch.repoType, result);
|
|
287
|
+
|
|
288
|
+
if (!tryAppendLines(repoLines)) {
|
|
289
|
+
truncated = true;
|
|
290
|
+
break outer;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
resultsShared += 1;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (truncated) {
|
|
298
|
+
const truncationLines = [
|
|
299
|
+
'',
|
|
300
|
+
`⚠️ Results truncated at approximately ${TOKEN_CAP.toLocaleString()} tokens (${MAX_OUTPUT_CHARS.toLocaleString()} characters).`,
|
|
301
|
+
`Included ${resultsShared.toString()} of ${totalResults.toString()} repositories. Narrow the query, reduce limit, or filter repo_types to see more.`,
|
|
302
|
+
];
|
|
303
|
+
|
|
304
|
+
while (lines.length > 0 && [...lines, ...truncationLines].join('\n').length > MAX_OUTPUT_CHARS) {
|
|
305
|
+
lines.pop();
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if ([...lines, ...truncationLines].join('\n').length <= MAX_OUTPUT_CHARS) {
|
|
309
|
+
lines.push(...truncationLines);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return {
|
|
314
|
+
formatted: lines.join('\n'),
|
|
315
|
+
totalResults,
|
|
316
|
+
resultsShared,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function appendRepoResult(lines: string[], repoType: RepoType, result: RepoSearchResult): void {
|
|
321
|
+
const heading = repoType === 'space' ? getSpaceHeading(result) : result.id;
|
|
322
|
+
lines.push(`### ${heading}`);
|
|
323
|
+
lines.push('');
|
|
324
|
+
|
|
325
|
+
if (repoType === 'dataset') {
|
|
326
|
+
const dataset = result as DatasetRepoResult;
|
|
327
|
+
if (dataset.description) {
|
|
328
|
+
const trimmed = dataset.description.substring(0, 200);
|
|
329
|
+
lines.push(`${trimmed}${dataset.description.length > 200 ? '...' : ''}`);
|
|
330
|
+
lines.push('');
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (repoType === 'space') {
|
|
335
|
+
const space = result as SpaceRepoResult;
|
|
336
|
+
const description = space.shortDescription || space.ai_short_description;
|
|
337
|
+
if (description) {
|
|
338
|
+
lines.push(description);
|
|
339
|
+
lines.push('');
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const info: string[] = [];
|
|
344
|
+
if (result.author) info.push(`**Author:** ${result.author}`);
|
|
345
|
+
|
|
346
|
+
if (repoType === 'model') {
|
|
347
|
+
const model = result as ModelRepoResult;
|
|
348
|
+
if (model.pipeline_tag) info.push(`**Task:** ${model.pipeline_tag}`);
|
|
349
|
+
if (model.library_name) info.push(`**Library:** ${model.library_name}`);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (repoType === 'space') {
|
|
353
|
+
const space = result as SpaceRepoResult;
|
|
354
|
+
if (space.sdk) info.push(`**SDK:** ${space.sdk}`);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (typeof result.downloads === 'number') info.push(`**Downloads:** ${formatNumber(result.downloads)}`);
|
|
358
|
+
if (typeof result.likes === 'number') info.push(`**Likes:** ${result.likes.toString()}`);
|
|
359
|
+
if (typeof result.trendingScore === 'number') info.push(`**Trending Score:** ${result.trendingScore.toString()}`);
|
|
360
|
+
|
|
361
|
+
if (info.length > 0) {
|
|
362
|
+
lines.push(info.join(' | '));
|
|
363
|
+
lines.push('');
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (result.tags && result.tags.length > 0) {
|
|
367
|
+
lines.push(`**Tags:** ${result.tags.slice(0, TAGS_TO_RETURN).join(', ')}`);
|
|
368
|
+
if (result.tags.length > TAGS_TO_RETURN) {
|
|
369
|
+
lines.push(`*and ${(result.tags.length - TAGS_TO_RETURN).toString()} more...*`);
|
|
370
|
+
}
|
|
371
|
+
lines.push('');
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const status: string[] = [];
|
|
375
|
+
if (result.private) status.push('🔐 Private');
|
|
376
|
+
if (repoType === 'dataset' && (result as DatasetRepoResult).gated) status.push('🔒 Gated');
|
|
377
|
+
if (repoType === 'space' && (result as SpaceRepoResult).disabled) status.push('⛔ Disabled');
|
|
378
|
+
|
|
379
|
+
if (status.length > 0) {
|
|
380
|
+
lines.push(status.join(' | '));
|
|
381
|
+
lines.push('');
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (result.createdAt) {
|
|
385
|
+
lines.push(`**Created:** ${formatDate(result.createdAt)}`);
|
|
386
|
+
}
|
|
387
|
+
if (result.lastModified && result.lastModified !== result.createdAt) {
|
|
388
|
+
lines.push(`**Last Modified:** ${formatDate(result.lastModified)}`);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
lines.push(`**Link:** [${getRepoLink(repoType, result.id)}](${getRepoLink(repoType, result.id)})`);
|
|
392
|
+
lines.push('');
|
|
393
|
+
lines.push('---');
|
|
394
|
+
lines.push('');
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function getSpaceHeading(result: RepoSearchResult): string {
|
|
398
|
+
const space = result as SpaceRepoResult;
|
|
399
|
+
const title = space.title?.trim();
|
|
400
|
+
if (title && title.length > 0) {
|
|
401
|
+
return `${title} (\`${result.id}\`)`;
|
|
402
|
+
}
|
|
403
|
+
return result.id;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function getRepoLink(repoType: RepoType, id: string): string {
|
|
407
|
+
if (repoType === 'dataset') {
|
|
408
|
+
return `https://hf.co/datasets/${id}`;
|
|
409
|
+
}
|
|
410
|
+
if (repoType === 'space') {
|
|
411
|
+
return `https://hf.co/spaces/${id}`;
|
|
412
|
+
}
|
|
413
|
+
return `https://hf.co/${id}`;
|
|
414
|
+
}
|
package/src/tool-ids.ts
CHANGED
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
MODEL_DETAIL_TOOL_CONFIG,
|
|
10
10
|
MODEL_DETAIL_PROMPT_CONFIG,
|
|
11
11
|
PAPER_SEARCH_TOOL_CONFIG,
|
|
12
|
+
REPO_SEARCH_TOOL_CONFIG,
|
|
12
13
|
DATASET_SEARCH_TOOL_CONFIG,
|
|
13
14
|
DATASET_DETAIL_TOOL_CONFIG,
|
|
14
15
|
DATASET_DETAIL_PROMPT_CONFIG,
|
|
15
|
-
|
|
16
|
+
HUB_REPO_DETAILS_TOOL_CONFIG,
|
|
16
17
|
DUPLICATE_SPACE_TOOL_CONFIG,
|
|
17
18
|
SPACE_INFO_TOOL_CONFIG,
|
|
18
19
|
SPACE_FILES_TOOL_CONFIG,
|
|
@@ -28,11 +29,12 @@ import {
|
|
|
28
29
|
// Extract tool IDs from their configs (single source of truth)
|
|
29
30
|
export const SPACE_SEARCH_TOOL_ID = SEMANTIC_SEARCH_TOOL_CONFIG.name;
|
|
30
31
|
export const MODEL_SEARCH_TOOL_ID = MODEL_SEARCH_TOOL_CONFIG.name;
|
|
32
|
+
export const REPO_SEARCH_TOOL_ID = REPO_SEARCH_TOOL_CONFIG.name;
|
|
31
33
|
export const MODEL_DETAIL_TOOL_ID = MODEL_DETAIL_TOOL_CONFIG.name;
|
|
32
34
|
export const PAPER_SEARCH_TOOL_ID = PAPER_SEARCH_TOOL_CONFIG.name;
|
|
33
35
|
export const DATASET_SEARCH_TOOL_ID = DATASET_SEARCH_TOOL_CONFIG.name;
|
|
34
36
|
export const DATASET_DETAIL_TOOL_ID = DATASET_DETAIL_TOOL_CONFIG.name;
|
|
35
|
-
export const
|
|
37
|
+
export const HUB_REPO_DETAILS_TOOL_ID = HUB_REPO_DETAILS_TOOL_CONFIG.name;
|
|
36
38
|
export const DUPLICATE_SPACE_TOOL_ID = DUPLICATE_SPACE_TOOL_CONFIG.name;
|
|
37
39
|
export const SPACE_INFO_TOOL_ID = SPACE_INFO_TOOL_CONFIG.name;
|
|
38
40
|
export const SPACE_FILES_TOOL_ID = SPACE_FILES_TOOL_CONFIG.name;
|
|
@@ -50,11 +52,12 @@ export const DYNAMIC_SPACE_TOOL_ID = DYNAMIC_SPACE_TOOL_CONFIG.name;
|
|
|
50
52
|
export const ALL_BUILTIN_TOOL_IDS = [
|
|
51
53
|
SPACE_SEARCH_TOOL_ID,
|
|
52
54
|
MODEL_SEARCH_TOOL_ID,
|
|
55
|
+
REPO_SEARCH_TOOL_ID,
|
|
53
56
|
MODEL_DETAIL_TOOL_ID,
|
|
54
57
|
PAPER_SEARCH_TOOL_ID,
|
|
55
58
|
DATASET_SEARCH_TOOL_ID,
|
|
56
59
|
DATASET_DETAIL_TOOL_ID,
|
|
57
|
-
|
|
60
|
+
HUB_REPO_DETAILS_TOOL_ID,
|
|
58
61
|
DUPLICATE_SPACE_TOOL_ID,
|
|
59
62
|
SPACE_INFO_TOOL_ID,
|
|
60
63
|
SPACE_FILES_TOOL_ID,
|
|
@@ -66,13 +69,7 @@ export const ALL_BUILTIN_TOOL_IDS = [
|
|
|
66
69
|
] as const;
|
|
67
70
|
// Grouped tool IDs for bouquet configurations
|
|
68
71
|
export const TOOL_ID_GROUPS = {
|
|
69
|
-
search: [
|
|
70
|
-
SPACE_SEARCH_TOOL_ID,
|
|
71
|
-
MODEL_SEARCH_TOOL_ID,
|
|
72
|
-
DATASET_SEARCH_TOOL_ID,
|
|
73
|
-
PAPER_SEARCH_TOOL_ID,
|
|
74
|
-
DOCS_SEMANTIC_SEARCH_TOOL_ID,
|
|
75
|
-
] as const,
|
|
72
|
+
search: [SPACE_SEARCH_TOOL_ID, REPO_SEARCH_TOOL_ID, PAPER_SEARCH_TOOL_ID, DOCS_SEMANTIC_SEARCH_TOOL_ID] as const,
|
|
76
73
|
spaces: [
|
|
77
74
|
SPACE_SEARCH_TOOL_ID,
|
|
78
75
|
DUPLICATE_SPACE_TOOL_ID,
|
|
@@ -80,14 +77,13 @@ export const TOOL_ID_GROUPS = {
|
|
|
80
77
|
SPACE_FILES_TOOL_ID,
|
|
81
78
|
USE_SPACE_TOOL_ID,
|
|
82
79
|
] as const,
|
|
83
|
-
detail: [MODEL_DETAIL_TOOL_ID, DATASET_DETAIL_TOOL_ID,
|
|
80
|
+
detail: [MODEL_DETAIL_TOOL_ID, DATASET_DETAIL_TOOL_ID, HUB_REPO_DETAILS_TOOL_ID] as const,
|
|
84
81
|
docs: [DOCS_SEMANTIC_SEARCH_TOOL_ID, DOC_FETCH_TOOL_ID] as const,
|
|
85
82
|
hf_api: [
|
|
86
83
|
SPACE_SEARCH_TOOL_ID,
|
|
87
|
-
|
|
88
|
-
DATASET_SEARCH_TOOL_ID,
|
|
84
|
+
REPO_SEARCH_TOOL_ID,
|
|
89
85
|
PAPER_SEARCH_TOOL_ID,
|
|
90
|
-
|
|
86
|
+
HUB_REPO_DETAILS_TOOL_ID,
|
|
91
87
|
DOCS_SEMANTIC_SEARCH_TOOL_ID,
|
|
92
88
|
// HF_JOBS_TOOL_ID,
|
|
93
89
|
] as const,
|