@contentrain/skills 0.9.0 → 0.9.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/skills",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "AI agent skills for Contentrain — workflow procedures, framework integration guides",
|
|
6
6
|
"type": "module",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"tsdown": "^0.21.0",
|
|
62
62
|
"typescript": "^5.7.0",
|
|
63
63
|
"vitest": "^3.0.0",
|
|
64
|
-
"@contentrain/mcp": "3.3.
|
|
65
|
-
"@contentrain/rules": "0.7.
|
|
66
|
-
"@contentrain/wp-import": "0.
|
|
64
|
+
"@contentrain/mcp": "3.3.2",
|
|
65
|
+
"@contentrain/rules": "0.7.2",
|
|
66
|
+
"@contentrain/wp-import": "0.3.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "tsdown src/index.ts --format esm,cjs --dts",
|
|
@@ -93,6 +93,8 @@ Create or update a model definition (upsert).
|
|
|
93
93
|
| `description` | string | No | Model description |
|
|
94
94
|
| `content_path` | string | No | Framework-relative path for content files |
|
|
95
95
|
| `locale_strategy` | string | No | `"file"` (default), `"suffix"`, `"directory"`, `"none"` |
|
|
96
|
+
| `form` | object | No | Runtime-owned public form settings (Studio). Not a tool input — an existing block is preserved across structural edits and named in `preserved_blocks` |
|
|
97
|
+
| `comments` | object | No | Runtime-owned public comments settings (Studio). Preserved the same way |
|
|
96
98
|
|
|
97
99
|
Notes:
|
|
98
100
|
- Upserts by model ID: existing model is updated, new model is created
|
|
@@ -68,7 +68,7 @@ Inferred types are a guess from one value. Check `meta_fields` and `acf_fields`
|
|
|
68
68
|
|
|
69
69
|
## What is not imported
|
|
70
70
|
|
|
71
|
-
Post types matching `attachment|nav_menu_item|wp_*|jp_*|pattern|revision|oembed_cache|customize_changeset|user_request|custom_css` are skipped and listed in `report.skipped_types
|
|
71
|
+
Post types matching `attachment|nav_menu_item|wp_*|jp_*|pattern|revision|oembed_cache|customize_changeset|user_request|custom_css` are skipped and listed in `report.skipped_types`, and so are theme / page-builder internals that store design rather than content: GeneratePress elements (`gp_elements`, `gp-elements`), GenerateBlocks styles (`gblocks_*`, `gblocks-*`), Elementor templates (`elementor_library`, `e-landing-page`) and form definitions (`wpcf7_contact_form`, `wpforms*`). Membership and other content-bearing CPTs stay; ACF field records stay too, since their cross-model parents are part of the lossless import. Attachments are not skipped content — they arrive as the `media` collection.
|
|
72
72
|
|
|
73
73
|
Also outside the import: themes, widgets, plugin settings, users' passwords and roles, and the media **files** themselves (only their metadata and URLs come across).
|
|
74
74
|
|
|
@@ -143,7 +143,7 @@ works bundled behaves the same on CDN.
|
|
|
143
143
|
| `in` | `.where('category', 'in', ['a','b'])` | In array |
|
|
144
144
|
| `contains` | `.where('tags', 'contains', 'vue')` | String/array contains |
|
|
145
145
|
|
|
146
|
-
### CDN Entry Metadata, Media &
|
|
146
|
+
### CDN Entry Metadata, Media, Forms & Comments
|
|
147
147
|
|
|
148
148
|
```typescript
|
|
149
149
|
// Entry metadata (status, publish_at, expire_at)
|
|
@@ -154,10 +154,16 @@ const media = client.media()
|
|
|
154
154
|
const asset = await media.asset('hero.jpg')
|
|
155
155
|
const url = media.url(asset, 'thumb')
|
|
156
156
|
|
|
157
|
-
// Forms (
|
|
157
|
+
// Forms — public /api/forms/v1, no API key (values go under `data`; captcha + honeypot beside it)
|
|
158
158
|
const form = client.form()
|
|
159
|
-
const config = await form.config('contact')
|
|
160
|
-
const result = await form.submit('contact', { name: 'Alice' })
|
|
159
|
+
const config = await form.config('contact') // fields keyed by id, captcha, captchaSiteKey, honeypotField
|
|
160
|
+
const result = await form.submit('contact', { name: 'Alice' }, { captchaToken, honeypot: '' })
|
|
161
|
+
// { success, message } | { success: false, errors: [{ field, message }] }; 403/404/429 throw ContentrainError
|
|
162
|
+
|
|
163
|
+
// Comments — public /api/comments/v1, approved comments only, body is plain text (render escaped)
|
|
164
|
+
const comments = client.comments()
|
|
165
|
+
const thread = await comments.thread('posts', entryId, { locale: 'en' })
|
|
166
|
+
await comments.submit('posts', entryId, { author: { name: 'Ada', email }, body: 'Great post', parentId }, { locale: 'en' })
|
|
161
167
|
|
|
162
168
|
// Conversation API (external AI content operations)
|
|
163
169
|
const conv = client.conversation()
|