@agentforge-io/connectors-higgsfield 1.0.0 → 1.0.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/skills.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * word of the prompt. Pure module: no I/O, no network, no spend.
5
5
  */
6
6
  /** Bump on ANY change to a skill's text, model, aspect or the palette / hard-rule wording: jobs record it. */
7
- export declare const SKILLS_RULES_VERSION = "2026-12-01.4";
7
+ export declare const SKILLS_RULES_VERSION = "2026-12-01.5";
8
8
  export declare const SKILL_SLUGS: readonly ["product-cart", "ugc-model", "minimal-poster", "gravity-defying", "hero-offert", "cleanfly"];
9
9
  export type SkillSlug = (typeof SKILL_SLUGS)[number];
10
10
  /** alpha_master = the catalog master (generate, remove background, 2048 PNG with alpha). scene = a finished picture. */
@@ -86,7 +86,7 @@ export declare function describePalette(palette: unknown): string[];
86
86
  */
87
87
  export declare function paletteDirective(palette: unknown, output?: SkillOutput): string;
88
88
  export declare const NOTE_MAX_LENGTH = 140;
89
- /** Strips quotes, newlines, control chars and URLs; collapses spaces. Pure. */
89
+ /** Strips quotes, newlines, control and invisible format chars and URLs; collapses spaces. Pure. */
90
90
  export declare function sanitizeNote(note: string): string;
91
91
  /** Returns the sanitized note ('' when empty). Throws NOTE_TOO_LONG / NOTE_NOT_ALLOWED. */
92
92
  export declare function assertNote(note: unknown): string;
package/dist/skills.js CHANGED
@@ -21,7 +21,7 @@ const rules_1 = require("./rules");
21
21
  * word of the prompt. Pure module: no I/O, no network, no spend.
22
22
  */
23
23
  /** Bump on ANY change to a skill's text, model, aspect or the palette / hard-rule wording: jobs record it. */
24
- exports.SKILLS_RULES_VERSION = '2026-12-01.4';
24
+ exports.SKILLS_RULES_VERSION = '2026-12-01.5';
25
25
  exports.SKILL_SLUGS = [
26
26
  'product-cart',
27
27
  'ugc-model',
@@ -411,11 +411,34 @@ function paletteDirective(palette, output = 'scene') {
411
411
  // Owner note (D14)
412
412
  // ---------------------------------------------------------------------------------------------
413
413
  exports.NOTE_MAX_LENGTH = 140;
414
- const TEXT_REQUEST_RE = /\b(text|texts|texto|textos|word|words|palabra|palabras|letter|letters|letra|letras|headline|slogan|eslogan|caption|titulo|title|price|prices|precio|precios|discount|descuento|logo|logos|badge|sticker|watermark|marca de agua|number|numbers|numero|numeros|percent|porcentaje|write|writing|escribe|escribir|font|tipograf\w*)\b/i;
415
- /** Strips quotes, newlines, control chars and URLs; collapses spaces. Pure. */
414
+ /**
415
+ * Words (accent-folded, lowercase) that ask for rendered writing, brands or numbers, or try to steer the rules.
416
+ * Matched as whole words on the folded note; `\w*` suffixes catch plurals and conjugations.
417
+ */
418
+ const TEXT_REQUEST_RE = new RegExp('(?:^|[^\\p{L}])(' +
419
+ [
420
+ 'texts?', 'textos?', 'words?', 'palabras?', 'letters?', 'letras?', 'lettering', 'letrero\\w*', 'rotul\\w*',
421
+ 'headlines?', 'titulos?', 'titles?', 'slogans?', 'eslogan\\w*', 'captions?', 'leyendas?', 'frases?', 'phrases?',
422
+ 'typograph\\w*', 'tipograf\\w*', 'fonts?', 'fuentes?', 'inscript\\w*', 'inscripcion\\w*',
423
+ 'signs?', 'signage', 'carteles?', 'cartel', 'banners?', 'pancartas?', 'labels?', 'etiquetas?',
424
+ 'brands?', 'marcas?', 'logos?', 'logotipos?', 'badges?', 'insignias?', 'stickers?', 'pegatinas?', 'watermarks?',
425
+ 'prices?', 'precios?', 'discounts?', 'descuentos?', 'offers?', 'ofertas?', 'promo\\w*', 'rebajas?', 'gratis', 'free',
426
+ 'numbers?', 'numeros?', 'digits?', 'digitos?', 'percent\\w*', 'porcentajes?', 'por ciento',
427
+ 'write\\w*', 'written', 'escrib\\w*', 'escrit\\w*', 'reading', 'saying', 'says', 'dice', 'diga\\w*', 'que diga',
428
+ 'ignore\\w*', 'ignora\\w*', 'rules?', 'reglas?', 'instructions?', 'instrucciones', 'override', 'prompt\\w*',
429
+ ].join('|') +
430
+ ')(?=$|[^\\p{L}])', 'iu');
431
+ /** Anything but letters (any script, accents included), spaces and `, . -` is refused: no digits, %, $, €, symbols. */
432
+ const NOTE_ALLOWED_CHARS_RE = /^[\p{L}\p{M} ,.\-]*$/u;
433
+ /** Lowercase, accents removed: what the word list is matched against. */
434
+ function foldNote(note) {
435
+ return note.normalize('NFD').replace(/\p{M}/gu, '').toLowerCase();
436
+ }
437
+ /** Strips quotes, newlines, control and invisible format chars and URLs; collapses spaces. Pure. */
416
438
  function sanitizeNote(note) {
417
439
  return note
418
440
  .normalize('NFKC')
441
+ .replace(/\p{Cf}/gu, '')
419
442
  .replace(/https?:\/\/\S+|www\.\S+|\b[a-z0-9-]+(?:\.[a-z0-9-]+)*\.(?:com|net|org|io|co|app|dev|ai|me|ly|shop|store)\b\S*/gi, ' ')
420
443
  .replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g, ' ')
421
444
  .replace(/["'`´“”‘’«»„‟‹›]/g, '')
@@ -432,8 +455,8 @@ function assertNote(note) {
432
455
  throw new SkillRequestError('NOTE_TOO_LONG', `note is limited to ${exports.NOTE_MAX_LENGTH} characters`);
433
456
  }
434
457
  const clean = sanitizeNote(note);
435
- if (TEXT_REQUEST_RE.test(clean)) {
436
- throw new SkillRequestError('NOTE_NOT_ALLOWED', 'the note cannot ask for text, prices, logos or numbers in the image');
458
+ if (!NOTE_ALLOWED_CHARS_RE.test(clean) || TEXT_REQUEST_RE.test(foldNote(clean))) {
459
+ throw new SkillRequestError('NOTE_NOT_ALLOWED', 'the note describes style only: no text, numbers, prices, brands, logos, symbols or instructions about the rules');
437
460
  }
438
461
  return clean;
439
462
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/connectors-higgsfield",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Higgsfield connector for AgentForge — OAuth public client (CIMD + PKCE) over the Higgsfield MCP server, with a typed MCP client, versioned catalog-photo rules, and read-only agent tools (balance, job status). Nothing here spends credits on its own.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",