@dudefactory/payload-plugin-content-planner 3.0.1 → 3.1.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/README.md +0 -1
- package/dist/collections/AuditLogs.d.ts +10 -0
- package/dist/collections/AuditLogs.js +93 -0
- package/dist/collections/ContentTasks.d.ts +11 -0
- package/dist/collections/ContentTasks.js +148 -59
- package/dist/collections/Performance.d.ts +12 -0
- package/dist/collections/Performance.js +142 -0
- package/dist/index.d.ts +26 -6
- package/dist/index.js +30 -7
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CollectionConfig } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Audit Logs Collection - The Agent Trace
|
|
4
|
+
*
|
|
5
|
+
* Essential for enterprise customers who want to see how the Agent decided on a headline,
|
|
6
|
+
* what APIs were called, what data was transformed, and when each step happened.
|
|
7
|
+
*
|
|
8
|
+
* This is read-only from the UI perspective. Agents append logs via MCP tools.
|
|
9
|
+
*/
|
|
10
|
+
export declare const auditLogsCollection: CollectionConfig;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.auditLogsCollection = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Audit Logs Collection - The Agent Trace
|
|
6
|
+
*
|
|
7
|
+
* Essential for enterprise customers who want to see how the Agent decided on a headline,
|
|
8
|
+
* what APIs were called, what data was transformed, and when each step happened.
|
|
9
|
+
*
|
|
10
|
+
* This is read-only from the UI perspective. Agents append logs via MCP tools.
|
|
11
|
+
*/
|
|
12
|
+
exports.auditLogsCollection = {
|
|
13
|
+
slug: 'cp-audit-logs',
|
|
14
|
+
admin: {
|
|
15
|
+
useAsTitle: 'action',
|
|
16
|
+
defaultColumns: ['action', 'task', 'timestamp', 'createdAt'],
|
|
17
|
+
group: 'Content Planning',
|
|
18
|
+
description: 'Agent execution trace. Read-only. Helps enterprise customers audit AI decisions.',
|
|
19
|
+
},
|
|
20
|
+
access: {
|
|
21
|
+
create: () => true, // Only via Agent/MCP
|
|
22
|
+
read: () => true,
|
|
23
|
+
update: () => false, // Immutable logs
|
|
24
|
+
delete: () => false, // Immutable logs
|
|
25
|
+
},
|
|
26
|
+
fields: [
|
|
27
|
+
{
|
|
28
|
+
name: 'task',
|
|
29
|
+
label: 'Related Content Task',
|
|
30
|
+
type: 'relationship',
|
|
31
|
+
relationTo: 'cp-content-tasks',
|
|
32
|
+
required: true,
|
|
33
|
+
admin: {
|
|
34
|
+
description: 'The content task this log entry belongs to.',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'action',
|
|
39
|
+
label: 'Action',
|
|
40
|
+
type: 'select',
|
|
41
|
+
required: true,
|
|
42
|
+
options: [
|
|
43
|
+
{ label: 'Task Started', value: 'task-started' },
|
|
44
|
+
{ label: 'Scraping URL', value: 'scraping-url' },
|
|
45
|
+
{ label: 'Generating Draft', value: 'generating-draft' },
|
|
46
|
+
{ label: 'Calling External API', value: 'calling-external-api' },
|
|
47
|
+
{ label: 'Image Generation', value: 'image-generation' },
|
|
48
|
+
{ label: 'SEO Optimization', value: 'seo-optimization' },
|
|
49
|
+
{ label: 'Review Submission', value: 'review-submission' },
|
|
50
|
+
{ label: 'Error Encountered', value: 'error-encountered' },
|
|
51
|
+
{ label: 'Task Completed', value: 'task-completed' },
|
|
52
|
+
{ label: 'Custom', value: 'custom' },
|
|
53
|
+
],
|
|
54
|
+
admin: {
|
|
55
|
+
description: 'What action the Agent performed at this step.',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'stepDescription',
|
|
60
|
+
label: 'Step Description',
|
|
61
|
+
type: 'text',
|
|
62
|
+
admin: {
|
|
63
|
+
description: 'Human-readable description of what happened (e.g., "Fetched blog post from myblog.com")',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'modelSnapshot',
|
|
68
|
+
label: 'Model Snapshot',
|
|
69
|
+
type: 'json',
|
|
70
|
+
admin: {
|
|
71
|
+
description: 'The prompt sent to the AI model and the response received. Crucial for debugging.',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'metadata',
|
|
76
|
+
label: 'Additional Metadata',
|
|
77
|
+
type: 'json',
|
|
78
|
+
admin: {
|
|
79
|
+
description: 'Any extra context: API responses, timing info, intermediate calculations, etc.',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'errorDetails',
|
|
84
|
+
label: 'Error Details',
|
|
85
|
+
type: 'textarea',
|
|
86
|
+
admin: {
|
|
87
|
+
rows: 4,
|
|
88
|
+
description: 'If action is "error-encountered", detailed error message and stack trace.',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
timestamps: true,
|
|
93
|
+
};
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
import { CollectionConfig } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Content Tasks Collection - The User Interface
|
|
4
|
+
*
|
|
5
|
+
* Where the user spends 10 seconds giving an order.
|
|
6
|
+
* Where the Agent spends 10 minutes executing it.
|
|
7
|
+
*
|
|
8
|
+
* Group structure:
|
|
9
|
+
* - User Inputs: title, instructions, taskType, priority
|
|
10
|
+
* - Agent Outputs: status, outputLink, lastError, reviewFeedback
|
|
11
|
+
* - System: agentMetadata, parentTask, customParams
|
|
12
|
+
*/
|
|
2
13
|
export declare const contentTasksCollection: CollectionConfig;
|
|
@@ -1,85 +1,174 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.contentTasksCollection = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Content Tasks Collection - The User Interface
|
|
6
|
+
*
|
|
7
|
+
* Where the user spends 10 seconds giving an order.
|
|
8
|
+
* Where the Agent spends 10 minutes executing it.
|
|
9
|
+
*
|
|
10
|
+
* Group structure:
|
|
11
|
+
* - User Inputs: title, instructions, taskType, priority
|
|
12
|
+
* - Agent Outputs: status, outputLink, lastError, reviewFeedback
|
|
13
|
+
* - System: agentMetadata, parentTask, customParams
|
|
14
|
+
*/
|
|
4
15
|
exports.contentTasksCollection = {
|
|
5
16
|
slug: 'cp-content-tasks',
|
|
6
17
|
admin: {
|
|
7
18
|
useAsTitle: 'title',
|
|
8
|
-
defaultColumns: ['title', '
|
|
19
|
+
defaultColumns: ['title', 'taskType', 'status', 'priority', 'createdAt'],
|
|
9
20
|
group: 'Content Planning',
|
|
10
21
|
},
|
|
11
22
|
fields: [
|
|
23
|
+
// ========== USER INPUTS ==========
|
|
12
24
|
{
|
|
13
|
-
|
|
14
|
-
label: '
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
type: 'collapsible',
|
|
26
|
+
label: 'User Inputs',
|
|
27
|
+
fields: [
|
|
28
|
+
{
|
|
29
|
+
name: 'title',
|
|
30
|
+
label: 'Task Title',
|
|
31
|
+
type: 'text',
|
|
32
|
+
required: true,
|
|
33
|
+
maxLength: 150,
|
|
34
|
+
admin: {
|
|
35
|
+
placeholder: 'e.g., Write a blog post about cigar festivals in Miami',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'instructions',
|
|
40
|
+
label: 'The Command',
|
|
41
|
+
type: 'textarea',
|
|
42
|
+
required: true,
|
|
43
|
+
admin: {
|
|
44
|
+
rows: 10,
|
|
45
|
+
placeholder: 'Detailed instructions for the Agent. e.g., "Write a blog post about cigar festivals in Miami. Include at least 3 events, 500 words, SEO keywords: cigars, Miami, festivals. Tone: conversational."',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'taskType',
|
|
50
|
+
label: 'Task Type',
|
|
51
|
+
type: 'select',
|
|
52
|
+
required: true,
|
|
53
|
+
options: [
|
|
54
|
+
{ label: 'New Content', value: 'new-content' },
|
|
55
|
+
{ label: 'Update SEO', value: 'update-seo' },
|
|
56
|
+
{ label: 'Translation', value: 'translation' },
|
|
57
|
+
{ label: 'Social Media', value: 'social-media' },
|
|
58
|
+
{ label: 'Research', value: 'research' },
|
|
59
|
+
],
|
|
60
|
+
defaultValue: 'new-content',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'priority',
|
|
64
|
+
label: 'Priority',
|
|
65
|
+
type: 'select',
|
|
66
|
+
required: true,
|
|
67
|
+
options: [
|
|
68
|
+
{ label: 'Low', value: 'low' },
|
|
69
|
+
{ label: 'Normal', value: 'normal' },
|
|
70
|
+
{ label: 'High', value: 'high' },
|
|
71
|
+
],
|
|
72
|
+
defaultValue: 'normal',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'deadline',
|
|
76
|
+
label: 'Deadline',
|
|
77
|
+
type: 'date',
|
|
78
|
+
required: false,
|
|
79
|
+
admin: {
|
|
80
|
+
placeholder: 'Optional: Set a deadline for this task',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
18
84
|
},
|
|
85
|
+
// ========== AGENT OUTPUTS ==========
|
|
19
86
|
{
|
|
20
|
-
|
|
21
|
-
label: '
|
|
22
|
-
type: 'textarea',
|
|
23
|
-
required: true,
|
|
87
|
+
type: 'collapsible',
|
|
88
|
+
label: 'Agent Outputs',
|
|
24
89
|
admin: {
|
|
25
|
-
|
|
90
|
+
description: 'Automatically populated by the Agent. Do not edit manually.',
|
|
26
91
|
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'status',
|
|
30
|
-
label: 'Status',
|
|
31
|
-
type: 'select',
|
|
32
|
-
required: true,
|
|
33
|
-
options: [
|
|
34
|
-
{ label: 'To Do', value: 'todo' },
|
|
35
|
-
{ label: 'In Progress', value: 'in-progress' },
|
|
36
|
-
{ label: 'In Review', value: 'review' },
|
|
37
|
-
{ label: 'Done', value: 'done' },
|
|
38
|
-
{ label: 'Blocked', value: 'blocked' },
|
|
39
|
-
],
|
|
40
|
-
defaultValue: 'todo',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'priority',
|
|
44
|
-
label: 'Priority',
|
|
45
|
-
type: 'select',
|
|
46
|
-
required: true,
|
|
47
|
-
options: [
|
|
48
|
-
{ label: 'Low', value: 'low' },
|
|
49
|
-
{ label: 'Normal', value: 'normal' },
|
|
50
|
-
{ label: 'High', value: 'high' },
|
|
51
|
-
],
|
|
52
|
-
defaultValue: 'normal',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'deadline',
|
|
56
|
-
label: 'Deadline',
|
|
57
|
-
type: 'date',
|
|
58
|
-
required: true,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'tags',
|
|
62
|
-
label: 'Tags',
|
|
63
|
-
type: 'array',
|
|
64
92
|
fields: [
|
|
65
93
|
{
|
|
66
|
-
name: '
|
|
67
|
-
|
|
94
|
+
name: 'status',
|
|
95
|
+
label: 'Status',
|
|
96
|
+
type: 'select',
|
|
97
|
+
required: true,
|
|
98
|
+
options: [
|
|
99
|
+
{ label: 'To Do', value: 'todo' },
|
|
100
|
+
{ label: 'In Progress', value: 'in-progress' },
|
|
101
|
+
{ label: 'In Review', value: 'review' },
|
|
102
|
+
{ label: 'Done', value: 'done' },
|
|
103
|
+
{ label: 'Failed', value: 'failed' },
|
|
104
|
+
],
|
|
105
|
+
defaultValue: 'todo',
|
|
106
|
+
admin: {
|
|
107
|
+
description: 'Set to "Failed" if the Agent encounters an error.',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'outputLink',
|
|
112
|
+
label: 'Output Link',
|
|
113
|
+
type: 'relationship',
|
|
114
|
+
relationTo: ['pages', 'posts', 'events'],
|
|
115
|
+
admin: {
|
|
116
|
+
description: 'Crucial: Points to the generated Post, Page, Event, or other content created by the Agent.',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'lastError',
|
|
121
|
+
label: 'Last Error',
|
|
122
|
+
type: 'textarea',
|
|
123
|
+
admin: {
|
|
124
|
+
rows: 4,
|
|
125
|
+
description: 'If status is "Failed", the Agent writes the technical error here.',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'reviewFeedback',
|
|
130
|
+
label: 'Review Feedback',
|
|
131
|
+
type: 'richText',
|
|
132
|
+
admin: {
|
|
133
|
+
description: 'User notes for the Agent to "try again". Leave blank if not in review.',
|
|
134
|
+
},
|
|
68
135
|
},
|
|
69
136
|
],
|
|
70
137
|
},
|
|
138
|
+
// ========== SYSTEM / AGENT METADATA ==========
|
|
71
139
|
{
|
|
72
|
-
|
|
73
|
-
label: '
|
|
74
|
-
type: 'textarea',
|
|
140
|
+
type: 'collapsible',
|
|
141
|
+
label: 'System & Configuration',
|
|
75
142
|
admin: {
|
|
76
|
-
|
|
143
|
+
description: 'Advanced settings for the Agent and system integration.',
|
|
77
144
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
145
|
+
fields: [
|
|
146
|
+
{
|
|
147
|
+
name: 'agentMetadata',
|
|
148
|
+
label: 'Agent Metadata',
|
|
149
|
+
type: 'json',
|
|
150
|
+
admin: {
|
|
151
|
+
description: 'Stores tokens consumed, model used, estimated cost, latency (ms). Auto-populated by Agent.',
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'parentTask',
|
|
156
|
+
label: 'Parent Task',
|
|
157
|
+
type: 'relationship',
|
|
158
|
+
relationTo: 'cp-content-tasks',
|
|
159
|
+
admin: {
|
|
160
|
+
description: 'Links to a parent Campaign, Epic, or meta-task if this is a subtask.',
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'customParams',
|
|
165
|
+
label: 'Custom Parameters',
|
|
166
|
+
type: 'json',
|
|
167
|
+
admin: {
|
|
168
|
+
description: 'The Escape Hatch: Use this if you need to pass data you forgot to add to the schema. Agent-writable.',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
83
172
|
},
|
|
84
173
|
],
|
|
85
174
|
timestamps: true,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectionConfig } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Performance Collection - Analytics & ROI Tracking
|
|
4
|
+
*
|
|
5
|
+
* Read-only for the user. Aggregates data by taskType to show:
|
|
6
|
+
* - Average tokens consumed per task type
|
|
7
|
+
* - Estimated costs (for billing / ROI calculations)
|
|
8
|
+
* - Success rates
|
|
9
|
+
*
|
|
10
|
+
* This helps customers calculate the ROI and efficiency of the plugin.
|
|
11
|
+
*/
|
|
12
|
+
export declare const performanceCollection: CollectionConfig;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.performanceCollection = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Performance Collection - Analytics & ROI Tracking
|
|
6
|
+
*
|
|
7
|
+
* Read-only for the user. Aggregates data by taskType to show:
|
|
8
|
+
* - Average tokens consumed per task type
|
|
9
|
+
* - Estimated costs (for billing / ROI calculations)
|
|
10
|
+
* - Success rates
|
|
11
|
+
*
|
|
12
|
+
* This helps customers calculate the ROI and efficiency of the plugin.
|
|
13
|
+
*/
|
|
14
|
+
exports.performanceCollection = {
|
|
15
|
+
slug: 'cp-performance',
|
|
16
|
+
admin: {
|
|
17
|
+
useAsTitle: 'taskType',
|
|
18
|
+
defaultColumns: [
|
|
19
|
+
'taskType',
|
|
20
|
+
'totalTasks',
|
|
21
|
+
'successCount',
|
|
22
|
+
'averageTokens',
|
|
23
|
+
'estimatedTotalCost',
|
|
24
|
+
],
|
|
25
|
+
group: 'Content Planning',
|
|
26
|
+
description: 'Analytics dashboard. Track token usage, costs, and success rates by task type. Read-only.',
|
|
27
|
+
},
|
|
28
|
+
access: {
|
|
29
|
+
create: () => true, // Only via Agent aggregation
|
|
30
|
+
read: () => true,
|
|
31
|
+
update: () => true, // Agent updates counts
|
|
32
|
+
delete: () => false, // Never delete analytics
|
|
33
|
+
},
|
|
34
|
+
fields: [
|
|
35
|
+
{
|
|
36
|
+
name: 'taskType',
|
|
37
|
+
label: 'Task Type',
|
|
38
|
+
type: 'select',
|
|
39
|
+
required: true,
|
|
40
|
+
unique: true,
|
|
41
|
+
options: [
|
|
42
|
+
{ label: 'New Content', value: 'new-content' },
|
|
43
|
+
{ label: 'Update SEO', value: 'update-seo' },
|
|
44
|
+
{ label: 'Translation', value: 'translation' },
|
|
45
|
+
{ label: 'Social Media', value: 'social-media' },
|
|
46
|
+
{ label: 'Research', value: 'research' },
|
|
47
|
+
{ label: 'All', value: 'all' },
|
|
48
|
+
],
|
|
49
|
+
admin: {
|
|
50
|
+
description: 'The type of task being tracked.',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'totalTasks',
|
|
55
|
+
label: 'Total Tasks',
|
|
56
|
+
type: 'number',
|
|
57
|
+
defaultValue: 0,
|
|
58
|
+
admin: {
|
|
59
|
+
description: 'Total number of tasks of this type completed.',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'successCount',
|
|
64
|
+
label: 'Successful Tasks',
|
|
65
|
+
type: 'number',
|
|
66
|
+
defaultValue: 0,
|
|
67
|
+
admin: {
|
|
68
|
+
description: 'Number of tasks that completed successfully (status: "done").',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'failureCount',
|
|
73
|
+
label: 'Failed Tasks',
|
|
74
|
+
type: 'number',
|
|
75
|
+
defaultValue: 0,
|
|
76
|
+
admin: {
|
|
77
|
+
description: 'Number of tasks that failed (status: "failed").',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'successRate',
|
|
82
|
+
label: 'Success Rate (%)',
|
|
83
|
+
type: 'number',
|
|
84
|
+
admin: {
|
|
85
|
+
description: 'Computed: (successCount / totalTasks) * 100. Read-only.',
|
|
86
|
+
readOnly: true,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'totalTokens',
|
|
91
|
+
label: 'Total Tokens Used',
|
|
92
|
+
type: 'number',
|
|
93
|
+
defaultValue: 0,
|
|
94
|
+
admin: {
|
|
95
|
+
description: 'Cumulative tokens consumed across all tasks of this type.',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'averageTokens',
|
|
100
|
+
label: 'Average Tokens Per Task',
|
|
101
|
+
type: 'number',
|
|
102
|
+
admin: {
|
|
103
|
+
description: 'Computed: totalTokens / totalTasks. Read-only.',
|
|
104
|
+
readOnly: true,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'estimatedTotalCost',
|
|
109
|
+
label: 'Estimated Total Cost ($)',
|
|
110
|
+
type: 'number',
|
|
111
|
+
admin: {
|
|
112
|
+
description: 'Based on token usage and current model pricing. Helpful for ROI calculation.',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'estimatedAverageCost',
|
|
117
|
+
label: 'Estimated Avg Cost Per Task ($)',
|
|
118
|
+
type: 'number',
|
|
119
|
+
admin: {
|
|
120
|
+
description: 'Computed: estimatedTotalCost / successCount. Read-only.',
|
|
121
|
+
readOnly: true,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'lastUpdated',
|
|
126
|
+
label: 'Last Updated',
|
|
127
|
+
type: 'date',
|
|
128
|
+
admin: {
|
|
129
|
+
description: 'When these metrics were last calculated.',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'metadata',
|
|
134
|
+
label: 'Metadata',
|
|
135
|
+
type: 'json',
|
|
136
|
+
admin: {
|
|
137
|
+
description: 'Additional context: model versions used, pricing assumptions, calculation method, etc.',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
timestamps: true,
|
|
142
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Config } from 'payload';
|
|
2
|
+
import { contentTasksCollection } from './collections/ContentTasks';
|
|
3
|
+
import { keywordsCollection } from './collections/Keywords';
|
|
4
|
+
import { instructionsCollection } from './collections/Instructions';
|
|
5
|
+
import { auditLogsCollection } from './collections/AuditLogs';
|
|
6
|
+
import { performanceCollection } from './collections/Performance';
|
|
2
7
|
import { generateInitInstruction, warmupInitialization, setupInstructions, generateContentTask, executeContentTask } from './mcp/prompts-handlers';
|
|
3
8
|
export declare const contentPlannerPrompts: ({
|
|
4
9
|
name: string;
|
|
@@ -124,28 +129,43 @@ export declare const contentPlannerPrompts: ({
|
|
|
124
129
|
};
|
|
125
130
|
})[];
|
|
126
131
|
export { generateInitInstruction, warmupInitialization, setupInstructions, generateContentTask, executeContentTask, };
|
|
132
|
+
export { contentTasksCollection, keywordsCollection, instructionsCollection, auditLogsCollection, performanceCollection, };
|
|
127
133
|
export interface ContentPlannerPluginConfig {
|
|
128
134
|
enabled?: boolean;
|
|
129
135
|
}
|
|
130
136
|
/**
|
|
131
137
|
* Payload Content Planner Plugin
|
|
132
138
|
*
|
|
133
|
-
* Extends your existing Payload
|
|
134
|
-
*
|
|
139
|
+
* Extends your existing Payload implementation with:
|
|
140
|
+
*
|
|
141
|
+
* **Core Collections:**
|
|
142
|
+
* - ContentTasks (cp-content-tasks): The user interface. Where users spend 10 seconds giving an order.
|
|
143
|
+
* - Keywords (cp-keywords): Reference data for content optimization.
|
|
144
|
+
* - Instructions (cp-instructions): Reusable agent instructions.
|
|
145
|
+
*
|
|
146
|
+
* **Agent Ledger Tables:**
|
|
147
|
+
* - AuditLogs (cp-audit-logs): Complete trace of agent execution. Essential for enterprise customers to audit AI decisions.
|
|
148
|
+
* - Performance (cp-performance): Analytics and ROI tracking. Shows token usage, costs, and success rates by task type.
|
|
149
|
+
*
|
|
150
|
+
* **Integration with MCP:**
|
|
135
151
|
* - MCP tools and prompts (register with your MCP plugin)
|
|
152
|
+
* - Each project installs independently. No cross-project sync.
|
|
136
153
|
*
|
|
137
|
-
*
|
|
154
|
+
* **Schema Notes:**
|
|
155
|
+
* - The schema is minimal for humans (one simple command) but extremely descriptive for Agents.
|
|
156
|
+
* - CustomParams in ContentTasks provides an escape hatch for future extensibility.
|
|
157
|
+
* - All fields are designed to prevent schema changes in production environments.
|
|
138
158
|
*
|
|
139
159
|
* Usage:
|
|
140
160
|
* ```typescript
|
|
141
161
|
* import { buildConfig } from 'payload/config'
|
|
142
|
-
* import { contentPlannerPlugin,
|
|
162
|
+
* import { contentPlannerPlugin, contentPlannerPrompts } from '@dudefactory/payload-plugin-content-planner'
|
|
143
163
|
*
|
|
144
164
|
* export default buildConfig({
|
|
145
165
|
* plugins: [
|
|
146
166
|
* contentPlannerPlugin({ enabled: true }),
|
|
147
|
-
* // Add to your existing MCP plugin:
|
|
148
|
-
* // mcpPlugin({
|
|
167
|
+
* // Add to your existing MCP plugin to enable agent execution:
|
|
168
|
+
* // mcpPlugin({ prompts: contentPlannerPrompts })
|
|
149
169
|
* ],
|
|
150
170
|
* })
|
|
151
171
|
* ```
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contentPlannerPlugin = exports.executeContentTask = exports.generateContentTask = exports.setupInstructions = exports.warmupInitialization = exports.generateInitInstruction = exports.contentPlannerPrompts = void 0;
|
|
3
|
+
exports.contentPlannerPlugin = exports.performanceCollection = exports.auditLogsCollection = exports.instructionsCollection = exports.keywordsCollection = exports.contentTasksCollection = exports.executeContentTask = exports.generateContentTask = exports.setupInstructions = exports.warmupInitialization = exports.generateInitInstruction = exports.contentPlannerPrompts = void 0;
|
|
4
4
|
const ContentTasks_1 = require("./collections/ContentTasks");
|
|
5
|
+
Object.defineProperty(exports, "contentTasksCollection", { enumerable: true, get: function () { return ContentTasks_1.contentTasksCollection; } });
|
|
5
6
|
const Keywords_1 = require("./collections/Keywords");
|
|
7
|
+
Object.defineProperty(exports, "keywordsCollection", { enumerable: true, get: function () { return Keywords_1.keywordsCollection; } });
|
|
6
8
|
const Instructions_1 = require("./collections/Instructions");
|
|
9
|
+
Object.defineProperty(exports, "instructionsCollection", { enumerable: true, get: function () { return Instructions_1.instructionsCollection; } });
|
|
10
|
+
const AuditLogs_1 = require("./collections/AuditLogs");
|
|
11
|
+
Object.defineProperty(exports, "auditLogsCollection", { enumerable: true, get: function () { return AuditLogs_1.auditLogsCollection; } });
|
|
12
|
+
const Performance_1 = require("./collections/Performance");
|
|
13
|
+
Object.defineProperty(exports, "performanceCollection", { enumerable: true, get: function () { return Performance_1.performanceCollection; } });
|
|
7
14
|
const prompts_handlers_1 = require("./mcp/prompts-handlers");
|
|
8
15
|
Object.defineProperty(exports, "generateInitInstruction", { enumerable: true, get: function () { return prompts_handlers_1.generateInitInstruction; } });
|
|
9
16
|
Object.defineProperty(exports, "warmupInitialization", { enumerable: true, get: function () { return prompts_handlers_1.warmupInitialization; } });
|
|
@@ -21,22 +28,36 @@ exports.contentPlannerPrompts = [
|
|
|
21
28
|
/**
|
|
22
29
|
* Payload Content Planner Plugin
|
|
23
30
|
*
|
|
24
|
-
* Extends your existing Payload
|
|
25
|
-
*
|
|
31
|
+
* Extends your existing Payload implementation with:
|
|
32
|
+
*
|
|
33
|
+
* **Core Collections:**
|
|
34
|
+
* - ContentTasks (cp-content-tasks): The user interface. Where users spend 10 seconds giving an order.
|
|
35
|
+
* - Keywords (cp-keywords): Reference data for content optimization.
|
|
36
|
+
* - Instructions (cp-instructions): Reusable agent instructions.
|
|
37
|
+
*
|
|
38
|
+
* **Agent Ledger Tables:**
|
|
39
|
+
* - AuditLogs (cp-audit-logs): Complete trace of agent execution. Essential for enterprise customers to audit AI decisions.
|
|
40
|
+
* - Performance (cp-performance): Analytics and ROI tracking. Shows token usage, costs, and success rates by task type.
|
|
41
|
+
*
|
|
42
|
+
* **Integration with MCP:**
|
|
26
43
|
* - MCP tools and prompts (register with your MCP plugin)
|
|
44
|
+
* - Each project installs independently. No cross-project sync.
|
|
27
45
|
*
|
|
28
|
-
*
|
|
46
|
+
* **Schema Notes:**
|
|
47
|
+
* - The schema is minimal for humans (one simple command) but extremely descriptive for Agents.
|
|
48
|
+
* - CustomParams in ContentTasks provides an escape hatch for future extensibility.
|
|
49
|
+
* - All fields are designed to prevent schema changes in production environments.
|
|
29
50
|
*
|
|
30
51
|
* Usage:
|
|
31
52
|
* ```typescript
|
|
32
53
|
* import { buildConfig } from 'payload/config'
|
|
33
|
-
* import { contentPlannerPlugin,
|
|
54
|
+
* import { contentPlannerPlugin, contentPlannerPrompts } from '@dudefactory/payload-plugin-content-planner'
|
|
34
55
|
*
|
|
35
56
|
* export default buildConfig({
|
|
36
57
|
* plugins: [
|
|
37
58
|
* contentPlannerPlugin({ enabled: true }),
|
|
38
|
-
* // Add to your existing MCP plugin:
|
|
39
|
-
* // mcpPlugin({
|
|
59
|
+
* // Add to your existing MCP plugin to enable agent execution:
|
|
60
|
+
* // mcpPlugin({ prompts: contentPlannerPrompts })
|
|
40
61
|
* ],
|
|
41
62
|
* })
|
|
42
63
|
* ```
|
|
@@ -53,6 +74,8 @@ const contentPlannerPlugin = (config = {}) => (incomingConfig) => {
|
|
|
53
74
|
ContentTasks_1.contentTasksCollection,
|
|
54
75
|
Keywords_1.keywordsCollection,
|
|
55
76
|
Instructions_1.instructionsCollection,
|
|
77
|
+
AuditLogs_1.auditLogsCollection,
|
|
78
|
+
Performance_1.performanceCollection,
|
|
56
79
|
],
|
|
57
80
|
};
|
|
58
81
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudefactory/payload-plugin-content-planner",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
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",
|
|
@@ -39,5 +39,6 @@
|
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
41
|
"url": "https://github.com/DudeFactory/payload-plugin-content-planner.git"
|
|
42
|
-
}
|
|
42
|
+
},
|
|
43
|
+
"packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a"
|
|
43
44
|
}
|