sapiens-mcp 1.113.0 → 1.113.1
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/tools/carrossel.js +21 -5
- package/package.json +1 -1
package/dist/tools/carrossel.js
CHANGED
|
@@ -144,19 +144,35 @@ export async function carrossel(args) {
|
|
|
144
144
|
// pessoa pode escolher as fotos antes mesmo de conectar a conta.
|
|
145
145
|
if (args.action === "search_images") {
|
|
146
146
|
const limit = args.limit ?? 12;
|
|
147
|
-
const
|
|
147
|
+
const buscar = (search) => convexQuery("stock:getImages", {
|
|
148
148
|
limit,
|
|
149
|
-
...(
|
|
149
|
+
...(search ? { search } : {}),
|
|
150
150
|
...(args.orientation ? { orientation: args.orientation } : {}),
|
|
151
151
|
});
|
|
152
|
+
// O texto de busca do banco guarda o acento como foi escrito: as tags
|
|
153
|
+
// automáticas vêm sem ("xicara de cafe") e as manuais com ("cinemático").
|
|
154
|
+
// Quem pede "café" não achava nada. Busca as duas formas e junta.
|
|
155
|
+
const termo = args.query?.trim() || undefined;
|
|
156
|
+
const semAcento = termo?.normalize("NFD").replace(/[̀-ͯ]/g, "");
|
|
157
|
+
const listas = await Promise.all(termo && semAcento && semAcento !== termo ? [buscar(semAcento), buscar(termo)] : [buscar(termo)]);
|
|
158
|
+
const vistos = new Set();
|
|
159
|
+
const fotos = listas
|
|
160
|
+
.flat()
|
|
161
|
+
.filter((f) => f && !vistos.has(f._id) && vistos.add(f._id))
|
|
162
|
+
.slice(0, limit);
|
|
163
|
+
// Resposta enxuta: quem lê é o Claude da pessoa, e cada foto do banco traz
|
|
164
|
+
// dezenas de tags (inglês, português, artista parecido, carimbo do tagger).
|
|
165
|
+
const RUIDO = /autotagger|similar artist|artista similar/i;
|
|
152
166
|
return {
|
|
153
167
|
custo: 0,
|
|
154
168
|
total: fotos.length,
|
|
155
|
-
fotos:
|
|
169
|
+
fotos: fotos.map((f) => ({
|
|
156
170
|
id: f._id,
|
|
157
171
|
title: f.title,
|
|
158
|
-
description: f.description
|
|
159
|
-
|
|
172
|
+
description: f.description
|
|
173
|
+
? String(f.description).replace(/^#\s*Description\s*/i, "").slice(0, 240)
|
|
174
|
+
: null,
|
|
175
|
+
tags: (f.tags ?? []).filter((t) => !RUIDO.test(t)).slice(0, 10),
|
|
160
176
|
width: f.width ?? null,
|
|
161
177
|
height: f.height ?? null,
|
|
162
178
|
thumbnailUrl: f.thumbnailUrl ?? f.url,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sapiens-mcp",
|
|
3
|
-
"version": "1.113.
|
|
3
|
+
"version": "1.113.1",
|
|
4
4
|
"mcpName": "com.sapiensinteticos/sapiens",
|
|
5
5
|
"description": "MCP server pra operar o Sapiens Sintéticos (sapiensinteticos.com) pelo Claude Code: gerar imagem, escrever artigo, voz, música e mais, na sua conta. Login pelo código de sapiensinteticos.com/conectar-claude. mcprush.com-bd2545268b8471cdb213c674",
|
|
6
6
|
"type": "module",
|