@lovelybunch/api 1.0.69 → 1.0.71-alpha.0
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/storage/file-storage.d.ts +1 -0
- package/dist/lib/storage/file-storage.js +16 -1
- package/dist/routes/api/v1/ai/index.js +2 -0
- package/dist/routes/api/v1/ai/route.js +468 -170
- package/dist/routes/api/v1/ai/tools.d.ts +17 -0
- package/dist/routes/api/v1/ai/tools.js +926 -0
- package/dist/routes/api/v1/mcp/index.js +410 -184
- package/dist/routes/api/v1/resources/generate/route.d.ts +1 -1
- package/dist/routes/api/v1/resources/generate/route.js +66 -16
- package/package.json +4 -4
- package/static/assets/index-B2wygg2W.css +33 -0
- package/static/assets/index-CYlVRUG2.js +969 -0
- package/static/index.html +2 -2
- package/static/assets/index-CfRmV6nM.css +0 -33
- package/static/assets/index-DzYTksNb.js +0 -969
|
@@ -162,7 +162,7 @@ export class FileStorageAdapter {
|
|
|
162
162
|
return this.frontmatterToCP(data, body);
|
|
163
163
|
}));
|
|
164
164
|
// Apply filters
|
|
165
|
-
|
|
165
|
+
let filtered = proposals.filter(cp => {
|
|
166
166
|
if (!cp)
|
|
167
167
|
return false;
|
|
168
168
|
if (filter?.status && cp.status !== filter.status)
|
|
@@ -178,6 +178,21 @@ export class FileStorageAdapter {
|
|
|
178
178
|
}
|
|
179
179
|
return true;
|
|
180
180
|
}).filter(Boolean);
|
|
181
|
+
// Apply search filter using Fuse.js for fuzzy matching
|
|
182
|
+
if (filter?.search && filter.search.trim()) {
|
|
183
|
+
const fuse = new Fuse(filtered, {
|
|
184
|
+
keys: [
|
|
185
|
+
{ name: 'intent', weight: 2 },
|
|
186
|
+
{ name: 'content', weight: 1 },
|
|
187
|
+
{ name: 'author.name', weight: 0.5 },
|
|
188
|
+
{ name: 'metadata.tags', weight: 1 }
|
|
189
|
+
],
|
|
190
|
+
threshold: 0.4,
|
|
191
|
+
includeScore: true
|
|
192
|
+
});
|
|
193
|
+
filtered = fuse.search(filter.search).map(result => result.item);
|
|
194
|
+
}
|
|
195
|
+
return filtered;
|
|
181
196
|
}
|
|
182
197
|
catch (error) {
|
|
183
198
|
if (error.code === 'ENOENT')
|