@actuate-media/plugin-ai 0.5.0 → 0.5.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/CHANGELOG.md +12 -0
- package/dist/__tests__/alt-text-prompt.test.d.ts +2 -0
- package/dist/__tests__/alt-text-prompt.test.d.ts.map +1 -0
- package/dist/__tests__/alt-text-prompt.test.js +15 -0
- package/dist/__tests__/alt-text-prompt.test.js.map +1 -0
- package/dist/media/alt-text-generator.d.ts.map +1 -1
- package/dist/media/alt-text-generator.js +25 -13
- package/dist/media/alt-text-generator.js.map +1 -1
- package/dist/media/alt-text-prompt.d.ts +6 -0
- package/dist/media/alt-text-prompt.d.ts.map +1 -0
- package/dist/media/alt-text-prompt.js +32 -0
- package/dist/media/alt-text-prompt.js.map +1 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @actuate-media/plugin-ai
|
|
2
2
|
|
|
3
|
+
## 0.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 041a228: Add the MIT `license` field to every published package (previously missing) and correct `repository.url` to `github.com/actuate-media/actuatecms` (13 packages carried the wrong org).
|
|
8
|
+
|
|
9
|
+
## 0.5.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4afb589: WCAG-aligned AI alt text: improved vision prompts, feature-gated `/ai/media-metadata` with `aiAltText` suggestions, post-upload auto-suggest in Media, MCP `generate_media_alt` tool, and validation warnings for static image paths outside the media library.
|
|
14
|
+
|
|
3
15
|
## 0.5.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alt-text-prompt.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/alt-text-prompt.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { normalizeGeneratedAltText } from '../media/alt-text-prompt.js';
|
|
3
|
+
describe('normalizeGeneratedAltText', () => {
|
|
4
|
+
it('returns empty for decorative', () => {
|
|
5
|
+
expect(normalizeGeneratedAltText('anything', true)).toBe('');
|
|
6
|
+
});
|
|
7
|
+
it('strips redundant "image of" prefix', () => {
|
|
8
|
+
expect(normalizeGeneratedAltText('Image of a red bicycle parked outside', false)).toBe('a red bicycle parked outside');
|
|
9
|
+
});
|
|
10
|
+
it('clamps to 125 characters', () => {
|
|
11
|
+
const long = 'a'.repeat(200);
|
|
12
|
+
expect(normalizeGeneratedAltText(long, false).length).toBeLessThanOrEqual(125);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=alt-text-prompt.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alt-text-prompt.test.js","sourceRoot":"","sources":["../../src/__tests__/alt-text-prompt.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAEvE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,yBAAyB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC9D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,yBAAyB,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CACpF,8BAA8B,CAC/B,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC5B,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAA;IAChF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alt-text-generator.d.ts","sourceRoot":"","sources":["../../src/media/alt-text-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"alt-text-generator.d.ts","sourceRoot":"","sources":["../../src/media/alt-text-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AASnE,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,CAAA;IACrD,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAA;CACpB;AAKD;;kDAEkD;AAClD,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,CAqExB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requireAIProvider } from '../providers/index.js';
|
|
2
|
+
import { ALT_TEXT_JSON_SHAPE, ALT_TEXT_SYSTEM_PROMPT, normalizeGeneratedAltText, } from './alt-text-prompt.js';
|
|
2
3
|
import { clampConfidence, stripJsonFences } from './json.js';
|
|
3
4
|
/** Max confidence we'll report for a text-only (no real image) heuristic. */
|
|
4
5
|
const HEURISTIC_MAX_CONFIDENCE = 0.4;
|
|
@@ -18,16 +19,11 @@ export async function generateAltText(imageUrl, context) {
|
|
|
18
19
|
]
|
|
19
20
|
.filter(Boolean)
|
|
20
21
|
.join('\n');
|
|
21
|
-
const jsonShape = `Return a JSON object with:
|
|
22
|
-
- "altText": concise, descriptive alt text (max 125 characters)
|
|
23
|
-
- "alternatives": array of 2 alternative alt text options
|
|
24
|
-
- "confidence": number 0-1 for how confident you are`;
|
|
25
|
-
const systemPrompt = 'You are an accessibility expert. Generate descriptive, concise alt text for images. Return valid JSON only.';
|
|
26
22
|
let result;
|
|
27
23
|
if (canSeeImage) {
|
|
28
|
-
const prompt = `Analyze the attached image and generate accessible alt text.\n\n${contextInfo ? `Context:\n${contextInfo}\n\n` : ''}${
|
|
24
|
+
const prompt = `Analyze the attached image and generate accessible alt text.\n\n${contextInfo ? `Context:\n${contextInfo}\n\n` : ''}${ALT_TEXT_JSON_SHAPE}`;
|
|
29
25
|
result = await ai.analyzeImage(context.image, prompt, {
|
|
30
|
-
systemPrompt,
|
|
26
|
+
systemPrompt: ALT_TEXT_SYSTEM_PROMPT,
|
|
31
27
|
maxTokens: 512,
|
|
32
28
|
temperature: 0.3,
|
|
33
29
|
});
|
|
@@ -35,17 +31,33 @@ export async function generateAltText(imageUrl, context) {
|
|
|
35
31
|
else {
|
|
36
32
|
// No vision: infer ONLY from context. Be explicit so the model doesn't
|
|
37
33
|
// fabricate visual detail it cannot possibly know.
|
|
38
|
-
const prompt = `You CANNOT see the image. Based only on the context below and the file name, suggest plausible accessible alt text, and report low confidence since the image was not analyzed.\n\n${contextInfo ? `Context:\n${contextInfo}\n` : ''}File: ${imageUrl}\n\n${
|
|
39
|
-
result = await ai.generateText(prompt, {
|
|
34
|
+
const prompt = `You CANNOT see the image. Based only on the context below and the file name, suggest plausible accessible alt text, set isDecorative false unless context clearly indicates ornamentation, and report low confidence since the image was not analyzed.\n\n${contextInfo ? `Context:\n${contextInfo}\n` : ''}File: ${imageUrl}\n\n${ALT_TEXT_JSON_SHAPE}`;
|
|
35
|
+
result = await ai.generateText(prompt, {
|
|
36
|
+
systemPrompt: ALT_TEXT_SYSTEM_PROMPT,
|
|
37
|
+
maxTokens: 512,
|
|
38
|
+
temperature: 0.3,
|
|
39
|
+
});
|
|
40
40
|
}
|
|
41
41
|
try {
|
|
42
42
|
const parsed = JSON.parse(stripJsonFences(result.text));
|
|
43
|
+
const isDecorative = parsed.isDecorative === true;
|
|
44
|
+
const altText = normalizeGeneratedAltText(parsed.altText ?? '', isDecorative);
|
|
43
45
|
const rawConfidence = clampConfidence(parsed.confidence, canSeeImage ? 0.7 : 0.3);
|
|
46
|
+
const alternatives = isDecorative
|
|
47
|
+
? []
|
|
48
|
+
: (Array.isArray(parsed.alternatives) ? parsed.alternatives : [])
|
|
49
|
+
.map((a) => normalizeGeneratedAltText(String(a ?? ''), false))
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.slice(0, 2);
|
|
44
52
|
return {
|
|
45
|
-
altText
|
|
46
|
-
isDecorative
|
|
47
|
-
confidence:
|
|
48
|
-
|
|
53
|
+
altText,
|
|
54
|
+
isDecorative,
|
|
55
|
+
confidence: isDecorative
|
|
56
|
+
? 1
|
|
57
|
+
: canSeeImage
|
|
58
|
+
? rawConfidence
|
|
59
|
+
: Math.min(rawConfidence, HEURISTIC_MAX_CONFIDENCE),
|
|
60
|
+
alternatives,
|
|
49
61
|
usedVision: canSeeImage,
|
|
50
62
|
};
|
|
51
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alt-text-generator.js","sourceRoot":"","sources":["../../src/media/alt-text-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OA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E,wBAAwB,CAAC;YACvD,YAAY;YACZ,UAAU,EAAE,WAAW;SACxB,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;IACjG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** WCAG-aligned alt-text guidance shared by vision and heuristic paths. */
|
|
2
|
+
export declare const ALT_TEXT_SYSTEM_PROMPT = "You are an accessibility specialist writing alt text for web images (WCAG 2.1 / W3C best practices).\n\nRules:\n- Describe what matters for the image's purpose in context \u2014 not every visual detail.\n- Be concise: target \u2264125 characters; never exceed 125.\n- Do NOT start with \"image of\", \"photo of\", \"picture of\", or \"graphic of\" \u2014 screen readers already announce it as an image.\n- Do NOT include file names, dimensions, or SEO keyword stuffing.\n- Include visible text in the image when it is essential to understanding.\n- For people: describe relevant appearance only when needed for context; avoid speculative identity or sensitive traits.\n- If the image is purely decorative (borders, spacers, visual flourish with no informational value), set isDecorative true and altText to \"\".\n- For functional images (icons/buttons), describe the action or destination, not the pixel art.\n- When page context is provided, prefer alt text that fits the surrounding content.\n\nReturn valid JSON only.";
|
|
3
|
+
export declare const ALT_TEXT_JSON_SHAPE = "Return a JSON object with:\n- \"altText\": string (empty when decorative)\n- \"isDecorative\": boolean\n- \"alternatives\": array of exactly 2 alternative alt text options (empty strings when decorative)\n- \"confidence\": number 0-1";
|
|
4
|
+
/** Normalize model output to publishing-ready alt text. */
|
|
5
|
+
export declare function normalizeGeneratedAltText(raw: string, isDecorative: boolean): string;
|
|
6
|
+
//# sourceMappingURL=alt-text-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alt-text-prompt.d.ts","sourceRoot":"","sources":["../../src/media/alt-text-prompt.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,kgCAaX,CAAA;AAExB,eAAO,MAAM,mBAAmB,8OAIL,CAAA;AAE3B,2DAA2D;AAC3D,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAOpF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** WCAG-aligned alt-text guidance shared by vision and heuristic paths. */
|
|
2
|
+
export const ALT_TEXT_SYSTEM_PROMPT = `You are an accessibility specialist writing alt text for web images (WCAG 2.1 / W3C best practices).
|
|
3
|
+
|
|
4
|
+
Rules:
|
|
5
|
+
- Describe what matters for the image's purpose in context — not every visual detail.
|
|
6
|
+
- Be concise: target ≤125 characters; never exceed 125.
|
|
7
|
+
- Do NOT start with "image of", "photo of", "picture of", or "graphic of" — screen readers already announce it as an image.
|
|
8
|
+
- Do NOT include file names, dimensions, or SEO keyword stuffing.
|
|
9
|
+
- Include visible text in the image when it is essential to understanding.
|
|
10
|
+
- For people: describe relevant appearance only when needed for context; avoid speculative identity or sensitive traits.
|
|
11
|
+
- If the image is purely decorative (borders, spacers, visual flourish with no informational value), set isDecorative true and altText to "".
|
|
12
|
+
- For functional images (icons/buttons), describe the action or destination, not the pixel art.
|
|
13
|
+
- When page context is provided, prefer alt text that fits the surrounding content.
|
|
14
|
+
|
|
15
|
+
Return valid JSON only.`;
|
|
16
|
+
export const ALT_TEXT_JSON_SHAPE = `Return a JSON object with:
|
|
17
|
+
- "altText": string (empty when decorative)
|
|
18
|
+
- "isDecorative": boolean
|
|
19
|
+
- "alternatives": array of exactly 2 alternative alt text options (empty strings when decorative)
|
|
20
|
+
- "confidence": number 0-1`;
|
|
21
|
+
/** Normalize model output to publishing-ready alt text. */
|
|
22
|
+
export function normalizeGeneratedAltText(raw, isDecorative) {
|
|
23
|
+
if (isDecorative)
|
|
24
|
+
return '';
|
|
25
|
+
let s = raw.trim();
|
|
26
|
+
s = s.replace(/^(an?\s+)?(image|photo|picture|graphic|screenshot)\s+of\s+/i, '');
|
|
27
|
+
s = s.replace(/\s+/g, ' ').trim();
|
|
28
|
+
if (s.length > 125)
|
|
29
|
+
s = `${s.slice(0, 122).trim()}…`;
|
|
30
|
+
return s;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=alt-text-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alt-text-prompt.js","sourceRoot":"","sources":["../../src/media/alt-text-prompt.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;wBAad,CAAA;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;2BAIR,CAAA;AAE3B,2DAA2D;AAC3D,MAAM,UAAU,yBAAyB,CAAC,GAAW,EAAE,YAAqB;IAC1E,IAAI,YAAY;QAAE,OAAO,EAAE,CAAA;IAC3B,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,6DAA6D,EAAE,EAAE,CAAC,CAAA;IAChF,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IACjC,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG;QAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,CAAA;IACpD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actuate-media/plugin-ai",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "git",
|
|
6
|
-
"url": "https://github.com/
|
|
7
|
+
"url": "https://github.com/actuate-media/actuatecms.git",
|
|
7
8
|
"directory": "packages/plugin-ai"
|
|
8
9
|
},
|
|
9
10
|
"publishConfig": {
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"@types/react": "^19.0.0",
|
|
28
29
|
"typescript": "^5.7.0",
|
|
29
30
|
"vitest": "^4.1.0",
|
|
30
|
-
"@actuate-media/cms-core": "0.
|
|
31
|
+
"@actuate-media/cms-core": "0.91.0"
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"@actuate-media/cms-core": ">=0.1.0",
|