@dudefactory/payload-plugin-content-planner 3.1.1 → 3.1.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/README.md CHANGED
@@ -26,13 +26,29 @@ In your Payload config:
26
26
  import { buildConfig } from 'payload/config';
27
27
  import {
28
28
  contentPlannerPlugin,
29
+ createContentTasksCollection,
30
+ createInstructionsCollection,
29
31
  contentPlannerTools,
30
32
  contentPlannerPrompts,
31
33
  } from '@dudefactory/payload-plugin-content-planner';
32
34
 
35
+ // Define which MCP tools are available in your system
36
+ const availableMcpTools = [
37
+ 'createPosts',
38
+ 'createPublicEvents',
39
+ 'createFactories',
40
+ ];
41
+
33
42
  export default buildConfig({
34
43
  plugins: [
35
- contentPlannerPlugin({ enabled: true }),
44
+ contentPlannerPlugin({
45
+ enabled: true,
46
+ // Pass collection factory functions with your available tools
47
+ collections: {
48
+ contentTasks: createContentTasksCollection(['posts', 'public-events']),
49
+ instructions: createInstructionsCollection(availableMcpTools),
50
+ },
51
+ }),
36
52
 
37
53
  // Add tools/prompts to your MCP plugin
38
54
  mcpPlugin({
@@ -67,9 +83,12 @@ export default buildConfig({
67
83
  ### Instructions
68
84
 
69
85
  - `title` - Guideline name
70
- - `type` - Tone, Style, Terminology, etc.
71
- - `content` - The actual guideline
72
- - `active` - Whether agents use it
86
+ - `type` - Tone, Style, Terminology, Format, MCP Prompt, etc.
87
+ - `category` - Optional grouping (e.g., "SEO", "Tone")
88
+ - `toolScope` - Optional. Scope to a specific MCP tool (e.g., "createPosts"). Leave blank to apply to all tools.
89
+ - `content` - The actual guideline text
90
+ - `examples` - Optional examples for complex guidelines
91
+ - `active` - Whether agents use this instruction
73
92
 
74
93
  ## MCP Tools
75
94
 
@@ -1,2 +1,13 @@
1
1
  import { CollectionConfig } from 'payload';
2
+ /**
3
+ * Instructions Collection - Content Planning Guidelines
4
+ *
5
+ * Store reusable instructions that guide content creation.
6
+ * Filter by tool scope to apply instructions to specific MCP tools.
7
+ *
8
+ * @param availableMcpTools - Array of MCP tool names available for scoping instructions
9
+ * (e.g. ['createPosts', 'createPublicEvents']). Pass the names of every MCP tool
10
+ * the Agent can execute. Defaults to [] when omitted.
11
+ */
12
+ export declare function createInstructionsCollection(availableMcpTools?: string[]): CollectionConfig;
2
13
  export declare const instructionsCollection: CollectionConfig;
@@ -1,67 +1,96 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.instructionsCollection = void 0;
4
- exports.instructionsCollection = {
5
- slug: 'cp-instructions',
6
- admin: {
7
- useAsTitle: 'title',
8
- defaultColumns: ['title', 'type', 'category'],
9
- group: 'Content Planning',
10
- },
11
- fields: [
12
- {
13
- name: 'title',
14
- label: 'Instruction Title',
15
- type: 'text',
16
- required: true,
4
+ exports.createInstructionsCollection = createInstructionsCollection;
5
+ /**
6
+ * Instructions Collection - Content Planning Guidelines
7
+ *
8
+ * Store reusable instructions that guide content creation.
9
+ * Filter by tool scope to apply instructions to specific MCP tools.
10
+ *
11
+ * @param availableMcpTools - Array of MCP tool names available for scoping instructions
12
+ * (e.g. ['createPosts', 'createPublicEvents']). Pass the names of every MCP tool
13
+ * the Agent can execute. Defaults to [] when omitted.
14
+ */
15
+ function createInstructionsCollection(availableMcpTools = []) {
16
+ return {
17
+ slug: 'cp-instructions',
18
+ admin: {
19
+ useAsTitle: 'title',
20
+ defaultColumns: ['title', 'type', 'category'],
21
+ group: 'Content Planning',
17
22
  },
18
- {
19
- name: 'type',
20
- label: 'Type',
21
- type: 'select',
22
- required: true,
23
- options: [
24
- { label: 'Tone & Voice', value: 'tone-voice' },
25
- { label: 'Writing Style', value: 'writing-style' },
26
- { label: 'Quality Standards', value: 'quality-standards' },
27
- { label: 'Industry Terminology', value: 'terminology' },
28
- { label: 'Brand Guidelines', value: 'brand-guidelines' },
29
- { label: 'Content Format', value: 'content-format' },
30
- { label: 'MCP Prompt', value: 'mcp-prompt' },
31
- { label: 'Other', value: 'other' },
32
- ],
33
- },
34
- {
35
- name: 'category',
36
- label: 'Category',
37
- type: 'text',
38
- },
39
- {
40
- name: 'content',
41
- label: 'Instruction Content',
42
- type: 'textarea',
43
- required: true,
44
- admin: {
45
- rows: 12,
23
+ fields: [
24
+ {
25
+ name: 'title',
26
+ label: 'Instruction Title',
27
+ type: 'text',
28
+ required: true,
46
29
  },
47
- },
48
- {
49
- name: 'examples',
50
- label: 'Examples',
51
- type: 'array',
52
- fields: [
53
- {
54
- name: 'example',
55
- type: 'textarea',
30
+ {
31
+ name: 'type',
32
+ label: 'Type',
33
+ type: 'select',
34
+ required: true,
35
+ options: [
36
+ { label: 'Tone & Voice', value: 'tone-voice' },
37
+ { label: 'Writing Style', value: 'writing-style' },
38
+ { label: 'Quality Standards', value: 'quality-standards' },
39
+ { label: 'Industry Terminology', value: 'terminology' },
40
+ { label: 'Brand Guidelines', value: 'brand-guidelines' },
41
+ { label: 'Content Format', value: 'content-format' },
42
+ { label: 'MCP Prompt', value: 'mcp-prompt' },
43
+ { label: 'Other', value: 'other' },
44
+ ],
45
+ },
46
+ {
47
+ name: 'category',
48
+ label: 'Category',
49
+ type: 'text',
50
+ },
51
+ {
52
+ name: 'toolScope',
53
+ label: 'Tool Scope',
54
+ type: 'select',
55
+ options: availableMcpTools.map((tool) => ({
56
+ label: tool,
57
+ value: tool,
58
+ })),
59
+ admin: {
60
+ description: 'Optional. Enter the exact MCP tool name this instruction applies to (e.g. createPosts, createPublicEvents). Leave blank to apply to ALL collections.',
61
+ placeholder: 'e.g. createPosts',
56
62
  },
57
- ],
58
- },
59
- {
60
- name: 'active',
61
- label: 'Active (Use in MCP)',
62
- type: 'checkbox',
63
- defaultValue: true,
64
- },
65
- ],
66
- timestamps: true,
67
- };
63
+ },
64
+ {
65
+ name: 'content',
66
+ label: 'Instruction Content',
67
+ type: 'textarea',
68
+ required: true,
69
+ admin: {
70
+ rows: 12,
71
+ },
72
+ },
73
+ {
74
+ name: 'examples',
75
+ label: 'Examples',
76
+ type: 'array',
77
+ fields: [
78
+ {
79
+ name: 'example',
80
+ type: 'textarea',
81
+ },
82
+ ],
83
+ },
84
+ {
85
+ name: 'active',
86
+ label: 'Active (Use in MCP)',
87
+ type: 'checkbox',
88
+ defaultValue: true,
89
+ },
90
+ ],
91
+ timestamps: true,
92
+ };
93
+ }
94
+ // Backwards-compatible named export — uses [] as default fallback.
95
+ // Prefer using createInstructionsCollection() directly via the plugin config.
96
+ exports.instructionsCollection = createInstructionsCollection();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudefactory/payload-plugin-content-planner",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Payload CMS plugin that extends MCP with content planning collections and data sources",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",