@actuate-media/plugin-ai 0.4.0 → 0.5.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/CHANGELOG.md ADDED
@@ -0,0 +1,205 @@
1
+ # @actuate-media/plugin-ai
2
+
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bf00622: Add a GEO "key takeaway" field — a concise, citable 1-2 sentence page summary
8
+ for generative answer engines.
9
+ - Editable in the document SEO panel and the SEO Operations Center, each with an
10
+ AI Generate button.
11
+ - New `generateKeyTakeaway()` in plugin-ai and a `keyTakeaway` branch on
12
+ `POST /ai/seo/generate-field`.
13
+ - Rendered automatically as the Schema.org `abstract` on the page/article node,
14
+ as a meta-description fallback, and as the preferred `llms.txt` description.
15
+ - Stored as `data.keyTakeaway` (or `pageSettings.keyTakeaway`).
16
+
17
+ ## 0.4.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 854152d: Developer experience improvements from external-consumer feedback:
22
+ - Every published package now ships its `CHANGELOG.md` in the npm tarball, and packages that were missing a `README.md` (cli, cms-admin, cms-core, import, platform-vercel, all plugins, sections-react) now have one — so release notes and usage docs are visible on npmjs.com and in `node_modules`.
23
+ - New client-safe form validation entry point: `@actuate-media/cms-core/forms/client` exports `validateFormFieldClient()`, `validateFormValuesClient()`, visibility/conditional helpers, and the exact `FORM_EMAIL_RE` / `FORM_PHONE_RE` regexes the server enforces — zero Node dependencies, so public-site forms can mirror server rules without reimplementing them. The server validator now imports the same primitives, so client and server can never drift.
24
+
25
+ ## 0.4.0
26
+
27
+ ### Minor Changes
28
+
29
+ - 01eef99: AI reliability & safety hardening from the production-readiness audit.
30
+ - **New optional `analyzeImage` provider capability (multimodal vision).** OpenAI and Anthropic providers implement it; callers feature-detect and fall back to a text-only heuristic. Previously "vision" features (alt-text, auto-tagging) only received a URL string and hallucinated their output.
31
+ - **Safe-search now fails closed.** `autoTagImage` returns `isSafe: false` when the model output can't be confidently parsed as safe, instead of defaulting to safe.
32
+ - **Hard timeouts on every provider request.** All `fetch` calls use `AbortSignal.timeout`, so a hung upstream connection can no longer hold a serverless function open indefinitely.
33
+ - **Prompt-injection isolation.** Untrusted free-text is wrapped in delimited fences across the writing assistant, translator, meta-generator, and content-generator paths.
34
+ - **Library-level input/token caps** clamp oversized input and output-token budgets even when a route-level cap is bypassed.
35
+ - **Provider error bodies are truncated** before being surfaced in thrown error messages.
36
+ - `proofread` output is validated against the allowed change-type enum.
37
+
38
+ ## 0.3.0
39
+
40
+ ### Minor Changes
41
+
42
+ - 313a23f: Add Slice F — AI quality pass.
43
+
44
+ `plugin-ai` exposes a new `auditDocument()` composer that combines SEO,
45
+ readability (Flesch-Kincaid / Gunning Fog / SMOG averaged + remapped to a
46
+ 0-100 score), accessibility, and freshness scoring into a single
47
+ composite grade with prioritized actionable issues. The composer is
48
+ deterministic — it never calls an LLM — so it's cheap enough to invoke
49
+ on every save or debounced keystroke.
50
+
51
+ `cms-core` adds two HTTP endpoints:
52
+ - `POST /ai/audit-document` — runs the composite audit against a stored
53
+ document (`{ collection, id }`) or ad-hoc content. Honors field-level
54
+ access control when loading from the DB.
55
+ - `POST /ai/suggest-internal-links` — scans published documents for
56
+ phrases the supplied content could link to, returning ranked
57
+ anchor-text + target-URL suggestions. Optionally scopes to a single
58
+ collection.
59
+
60
+ `mcp-server` exposes both endpoints as MCP tools (`audit_document` and
61
+ `suggest_internal_links`) so AI agents can grade drafts and propose
62
+ internal links before publish.
63
+
64
+ Docs: `docs/ai-quality-audit.md`.
65
+
66
+ ## 0.2.1
67
+
68
+ ### Patch Changes
69
+
70
+ - 4433301: Phase 2 Slice D — Content Relations & References.
71
+ - **cms-core**: runtime support for the `relationship` field type — referential validation and opt-in depth-1 population.
72
+ - **Validation**: every create/update verifies that referenced IDs point at live (non-deleted) documents in the declared target collection(s). Broken references fail with a precise error (`Relation field "author" references document "team-x42" which does not exist in collection "team".`). Updates only re-validate fields the caller actually touched.
73
+ - **Population**: pass `?populate=author,relatedPosts` (or `*`) on `GET /collections/:slug/:id` and `GET /resolve` to expand stored IDs into `{ id, collection, title, slug, status, data }` summaries. Batches by target collection (≤ 1 query per collection per request); soft-deleted refs fall back to raw IDs.
74
+ - **Presets**: new `relationField()` and `relatedDocsField()` helpers. Built-in collection presets now wire `posts.relatedPosts → posts`, `case-studies.services → services` (the `locations.servicesOffered → services` relation continues unchanged).
75
+ - **Multi-target**: `relationTo: ['posts', 'case-studies']` continues to work — validator accepts a doc if it lives in any target.
76
+ - Public API: `validateRelations`, `populateRelations`, `collectRelationRefs`, `parsePopulateParam`, `buildRelationLookup`, plus types `RelationLookup`, `RelationSummary`, `PopulateOptions`.
77
+ - **plugin-ai**: the document content generator now skips `relationship` fields when building the LLM prompt (the model can't know your document IDs) and accepts ID strings only on output. Prevents the AI from inventing broken references that the validator would then reject.
78
+ - **23 new tests** in `cms-core/src/__tests__/fields/relations.test.ts` covering ref collection, validation, population, populate-param parsing, multi-target relations, and array-nested relations. Full suite: 620 cms-core tests passing.
79
+ - **Docs**: new `docs/relations.md` (declaration, validation, populate, admin UI, common patterns), `?populate=` documented in `docs/api-reference.md` for both `/collections/:slug/:id` and `/resolve`.
80
+ - **Admin UI**: the existing `RelationshipField` picker continues to work — search, multi-select, status badges, "Create new" shortcut. No changes required.
81
+
82
+ ## 0.2.0
83
+
84
+ ### Minor Changes
85
+
86
+ - e6a18b5: Phase 2 Slice C — AI Content Authoring for any collection.
87
+ - **plugin-ai**: new `generateDocumentContent()` helper that maps a prompt onto a collection's field schema and returns structured field data ready to persist. Supports tone, target audience, brand voice profile, and existing-content context. Coerces LLM output to declared field types (numbers, booleans, dates, select options, array items) and drops fields the schema doesn't declare.
88
+ - **cms-core**: new `POST /collections/:slug/ai-create` endpoint — the non-page counterpart to `/page-builder/create`. Generates a complete document for any collection, persists as draft, optionally publishes via a follow-up update when the caller has admin scope. Refuses page-builder collections (use `/page-builder/create` instead). Hard caps prompt at 4000 chars and shares the per-user 20/hour AI rate-limit bucket. Returns a `warning` field when create succeeds but publish is denied.
89
+ - **mcp-server**: six new tools — `create_in_collection` (generic) plus per-type sugar tools `create_blog_post`, `create_case_study` (with `clientName` / `industry` hints), `create_service` (`category` hint), `create_location` (`cityState` hint), and `create_team_member` (`name` / `role` hints). Each per-type tool targets the conventional collection slug shipped by the cms-core collection presets, with an explicit `collection` override for sites using custom slugs.
90
+ - 19 new tests (10 unit tests in plugin-ai for the content generator, 9 integration tests in cms-core for the API endpoint covering auth, validation, persistence, publish flow, and the page-builder refusal path).
91
+ - Docs: updated `docs/api-reference.md` with the new endpoint, `docs/mcp.md` and `packages/mcp-server/README.md` with the new tools and example agent prompts.
92
+
93
+ ## 0.1.0
94
+
95
+ ### Minor Changes
96
+
97
+ - c3c55c7: Add AI-powered page generation pipeline with prompt-to-page workflow.
98
+
99
+ **cms-core**: AI pipeline types (GenerationContext, GenerationStep, StepResult, GenerationResult), prompt template builders for structure/content/SEO/accessibility steps, deterministic accessibility auto-fix engine (auditAccessibility, fixAccessibility), and API endpoints for /page-builder/generate, /page-builder/generate-block, /page-builder/audit-a11y, and /page-builder/fix-a11y.
100
+
101
+ **plugin-ai**: Multi-step generatePage() pipeline that runs structure → content → SEO → accessibility steps sequentially via AIProvider, with validation retry, graceful fallback, progress callbacks, and token tracking. Single-block generateBlockContent() for context-aware content generation.
102
+
103
+ **cms-admin**: AI Generate Dialog with prompt input, tone selection, step toggles, business context fields, real-time generation progress, and step-by-step review with accept/regenerate flow. AI Block Assist button for one-click content generation per block. AI button integrated into the builder toolbar.
104
+
105
+ ## 0.0.11
106
+
107
+ ### Patch Changes
108
+
109
+ - b5de8dd: Fix ESM module resolution and dependency duplication issues reported during consumer integration.
110
+ - Add "default" export condition to all platform and plugin packages so they resolve correctly from require() contexts (fixes ERR_PACKAGE_PATH_NOT_EXPORTED in next.config.ts and serverless functions).
111
+ - Move @actuate-media/cms-core from direct dependencies to peerDependencies across all packages to prevent duplicate installations when consumer version ranges don't exactly match the pinned version.
112
+ - Add "prepack" lifecycle script to create-actuate-cms to guarantee dist/ is built before npm publishes the package (fixes empty dist/ in v0.4.0).
113
+
114
+ ## 0.0.10
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies [54c7a3b]
119
+ - @actuate-media/cms-core@0.6.0
120
+
121
+ ## 0.0.9
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies [c08cf8b]
126
+ - Updated dependencies [80aa939]
127
+ - @actuate-media/cms-core@0.5.0
128
+
129
+ ## 0.0.8
130
+
131
+ ### Patch Changes
132
+
133
+ - Updated dependencies [f2cf7d7]
134
+ - @actuate-media/cms-core@0.4.0
135
+
136
+ ## 0.0.7
137
+
138
+ ### Patch Changes
139
+
140
+ - Updated dependencies [0621037]
141
+ - @actuate-media/cms-core@0.3.1
142
+
143
+ ## 0.0.6
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [4e3a5eb]
148
+ - @actuate-media/cms-core@0.3.0
149
+
150
+ ## 0.0.5
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies
155
+ - @actuate-media/cms-core@0.2.3
156
+
157
+ ## 0.0.4
158
+
159
+ ### Patch Changes
160
+
161
+ - Updated dependencies
162
+ - @actuate-media/cms-core@0.2.2
163
+
164
+ ## 0.0.3
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies
169
+ - @actuate-media/cms-core@0.2.1
170
+
171
+ ## 0.0.2
172
+
173
+ ### Patch Changes
174
+
175
+ - 3fd38a2: Fix all 13 integration issues discovered during MaidPro.co deployment
176
+
177
+ **cms-core:**
178
+ - Add .js extensions to all ESM relative imports (58 files)
179
+ - Replace workspace:\* with versioned deps in all packages
180
+ - Add sideEffects:false for proper tree-shaking
181
+ - Subpath exports (/config, /api, /middleware, /next) avoid barrel side effects
182
+ - Stats/search routes use safeCount/safeFindMany for missing Prisma models
183
+ - Ship prisma/cms-schema.prisma with all required CMS models
184
+ - Accept both CMS_SECRET and CMS_SESSION_SECRET with clear error messages
185
+ - Fix hardcoded /admin paths in OAuth flow (now uses getAdminPath())
186
+ - Loosen withActuateCMS and createCMSMiddleware parameter types
187
+ - Auto-inject transpilePackages and serverExternalPackages in withActuateCMS
188
+ - Unify PluginDefinition with ActuatePlugin interface
189
+
190
+ **cms-admin:**
191
+ - Scope all 40+ CSS theme variables to .actuate-admin instead of :root
192
+ - ThemeProvider applies dark class to .actuate-admin, not document.documentElement
193
+ - Scaffold uses (admin)/(site) route groups for full CSS/script isolation
194
+ - Sidebar branding supports custom logo via config.admin.branding
195
+
196
+ **platform-vercel:**
197
+ - Email adapter accepts both `from` and `defaultFrom`
198
+
199
+ **All plugin/platform packages:**
200
+ - Fix ESM .js extensions in compiled output
201
+ - Replace workspace:\* with ^0.1.0 for publishable deps
202
+
203
+ - Updated dependencies [682dac7]
204
+ - Updated dependencies [3fd38a2]
205
+ - @actuate-media/cms-core@0.2.0
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @actuate-media/plugin-ai
2
+
3
+ AI features for [Actuate CMS](https://github.com/actuate-media/actuatecms) —
4
+ governed model routing, inline co-author actions, and AI-assisted content
5
+ tooling.
6
+
7
+ ```bash
8
+ npm install @actuate-media/plugin-ai
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { aiPlugin } from '@actuate-media/plugin-ai'
15
+
16
+ export default defineConfig({
17
+ plugins: [aiPlugin()],
18
+ // ...
19
+ })
20
+ ```
21
+
22
+ ## Release notes
23
+
24
+ See [CHANGELOG.md](./CHANGELOG.md) (shipped with the package) or the
25
+ [GitHub releases](https://github.com/actuate-media/actuatecms/releases).
26
+
27
+ ## License
28
+
29
+ MIT
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=meta-generator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-generator.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/meta-generator.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { generateKeyTakeaway } from '../writing/meta-generator.js';
3
+ function makeProvider(responseText) {
4
+ return {
5
+ async generateText() {
6
+ return { text: responseText, usage: { promptTokens: 0, completionTokens: 0 } };
7
+ },
8
+ async generateEmbedding() {
9
+ return [];
10
+ },
11
+ async *streamText() {
12
+ yield responseText;
13
+ },
14
+ };
15
+ }
16
+ describe('generateKeyTakeaway', () => {
17
+ it('returns a trimmed, unquoted takeaway', async () => {
18
+ const provider = makeProvider('"Choose hiking boots by terrain, fit, and waterproofing."');
19
+ const out = await generateKeyTakeaway('Long article about hiking boots...', 240, provider);
20
+ expect(out).toBe('Choose hiking boots by terrain, fit, and waterproofing.');
21
+ });
22
+ it('truncates to the max length', async () => {
23
+ const provider = makeProvider('x'.repeat(500));
24
+ const out = await generateKeyTakeaway('content', 240, provider);
25
+ expect(out.length).toBe(240);
26
+ });
27
+ });
28
+ //# sourceMappingURL=meta-generator.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-generator.test.js","sourceRoot":"","sources":["../../src/__tests__/meta-generator.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAGlE,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO;QACL,KAAK,CAAC,YAAY;YAChB,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAA;QAChF,CAAC;QACD,KAAK,CAAC,iBAAiB;YACrB,OAAO,EAAE,CAAA;QACX,CAAC;QACD,KAAK,CAAC,CAAC,UAAU;YACf,MAAM,YAAY,CAAA;QACpB,CAAC;KACF,CAAA;AACH,CAAC;AAED,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,QAAQ,GAAG,YAAY,CAAC,2DAA2D,CAAC,CAAA;QAC1F,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,oCAAoC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;QAC1F,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAA;IAC7E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QAC9C,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;QAC/D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export { buildBrandProfile } from './brand/profile-builder.js';
16
16
  export { checkConsistency } from './brand/consistency-checker.js';
17
17
  export { generate, expand, compress, rewrite, proofread } from './writing/assistant.js';
18
18
  export { getSuggestions } from './writing/inline-suggestions.js';
19
- export { generateMetaDescription, generateExcerpt, generateTitle, } from './writing/meta-generator.js';
19
+ export { generateMetaDescription, generateExcerpt, generateKeyTakeaway, generateTitle, } from './writing/meta-generator.js';
20
20
  export { generateDocumentContent } from './writing/content-generator.js';
21
21
  export type { GenerateDocumentInput, GenerateDocumentResult, DocumentGenerationContext, CollectionShape, FieldShape, } from './writing/content-generator.js';
22
22
  export { suggestInternalLinks } from './links/smart-links.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAMpF,O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M,EAAE,oBAAoB,CAAC,CAAA;IAClD,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;KAAE,CAAC,CAAA;CACxF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,aAAa,CAuB/D"}
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ export { buildBrandProfile } from './brand/profile-builder.js';
16
16
  export { checkConsistency } from './brand/consistency-checker.js';
17
17
  export { generate, expand, compress, rewrite, proofread } from './writing/assistant.js';
18
18
  export { getSuggestions } from './writing/inline-suggestions.js';
19
- export { generateMetaDescription, generateExcerpt, generateTitle, } from './writing/meta-generator.js';
19
+ export { generateMetaDescription, generateExcerpt, generateKeyTakeaway, generateTitle, } from './writing/meta-generator.js';
20
20
  export { generateDocumentContent } from './writing/content-generator.js';
21
21
  export { suggestInternalLinks } from './links/smart-links.js';
22
22
  export { autoTagImage } from './media/auto-tagger.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEtE,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,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ChB,WAAW,EAAE,aAAa;QAC1B,aAAa,EAAE;YACb,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE;YAC7D,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE;YACxD,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE;YACrE,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,eAAe,EAAE;SAChF;QACD,KAAK,EAAE,OAAO;KACf,CAAA;AACH,CAAC"}
@@ -8,6 +8,12 @@ export interface TitleOptions {
8
8
  export declare function generateMetaDescription(content: string, maxLength?: number, provider?: AIProvider): Promise<string>;
9
9
  /** Generates a concise excerpt from content. */
10
10
  export declare function generateExcerpt(content: string, maxLength?: number, provider?: AIProvider): Promise<string>;
11
+ /**
12
+ * Generates a GEO "key takeaway" — a single self-contained 1-2 sentence summary
13
+ * that an AI answer engine can extract and cite verbatim. Unlike a meta
14
+ * description (written to earn a click), this is written to be quoted.
15
+ */
16
+ export declare function generateKeyTakeaway(content: string, maxLength?: number, provider?: AIProvider): Promise<string>;
11
17
  /** Generates title options from content in the given style. */
12
18
  export declare function generateTitle(content: string, options?: TitleOptions): Promise<string[]>;
13
19
  //# sourceMappingURL=meta-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta-generator.d.ts","sourceRoot":"","sources":["../../src/writing/meta-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAOvD,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,aAAa,GAAG,UAAU,GAAG,eAAe,CAAA;IACpD,QAAQ,CAAC,EAAE,UAAU,CAAA;CACtB;AAED,+DAA+D;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O,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAuB9F"}
@@ -27,6 +27,23 @@ export async function generateExcerpt(content, maxLength = 300, provider) {
27
27
  .trim()
28
28
  .slice(0, maxLength);
29
29
  }
30
+ /**
31
+ * Generates a GEO "key takeaway" — a single self-contained 1-2 sentence summary
32
+ * that an AI answer engine can extract and cite verbatim. Unlike a meta
33
+ * description (written to earn a click), this is written to be quoted.
34
+ */
35
+ export async function generateKeyTakeaway(content, maxLength = 240, provider) {
36
+ const ai = provider ?? requireAIProvider();
37
+ const result = await ai.generateText(`Write a single self-contained key takeaway (maximum ${maxLength} characters, 1-2 sentences) that directly states what the following content is about, so an AI assistant can quote it verbatim when answering a user. Be factual and specific — no marketing fluff.\n\n${fenceUntrusted(content.slice(0, 3000), 'CONTENT')}`, {
38
+ systemPrompt: `You are a generative-engine-optimization specialist. Write only the takeaway text, no quotes or labels. ${FENCE_NOTE}`,
39
+ maxTokens: 200,
40
+ temperature: 0.3,
41
+ });
42
+ return result.text
43
+ .replace(/^["']|["']$/g, '')
44
+ .trim()
45
+ .slice(0, maxLength);
46
+ }
30
47
  /** Generates title options from content in the given style. */
31
48
  export async function generateTitle(content, options) {
32
49
  const ai = options?.provider ?? requireAIProvider();
@@ -1 +1 @@
1
- {"version":3,"file":"meta-generator.js","sourceRoot":"","sources":["../../src/writing/meta-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9D,MAAM,UAAU,GACd,4GAA4G,CAAA;AAQ9G,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAe,EACf,YAAoB,GAAG,EACvB,QAAqB;IAErB,MAAM,EAAE,GAAG,QAAQ,IAAI,iBAAiB,EAAE,CAAA;IAE1C,MAAM,MAAM,GA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AAC,CAAA;AACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actuate-media/plugin-ai",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/actuatecms/actuatecms.git",
@@ -20,13 +20,14 @@
20
20
  "main": "./dist/index.js",
21
21
  "types": "./dist/index.d.ts",
22
22
  "files": [
23
- "dist"
23
+ "dist",
24
+ "CHANGELOG.md"
24
25
  ],
25
26
  "devDependencies": {
26
27
  "@types/react": "^19.0.0",
27
28
  "typescript": "^5.7.0",
28
29
  "vitest": "^4.1.0",
29
- "@actuate-media/cms-core": "0.52.0"
30
+ "@actuate-media/cms-core": "0.67.0"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "@actuate-media/cms-core": ">=0.1.0",