@jiggai/kitchen-plugin-marketing 0.2.1

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.
@@ -0,0 +1,44 @@
1
+ (() => {
2
+ // src/tabs/accounts.tsx
3
+ function Accounts() {
4
+ return `
5
+ <div class="p-6">
6
+ <h2 class="text-2xl font-bold mb-4">Social Media Accounts</h2>
7
+ <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6">
8
+ <p class="text-yellow-800">\u{1F517} Connect and manage your social media accounts here!</p>
9
+ </div>
10
+
11
+ <div class="mb-6">
12
+ <h3 class="font-semibold text-lg mb-3">Add New Account</h3>
13
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
14
+ <button class="bg-blue-500 text-white p-4 rounded-lg hover:bg-blue-600 transition-colors">
15
+ <div class="text-xl mb-2">\u{1F426}</div>
16
+ <div>Twitter/X</div>
17
+ </button>
18
+ <button class="bg-pink-500 text-white p-4 rounded-lg hover:bg-pink-600 transition-colors">
19
+ <div class="text-xl mb-2">\u{1F4F7}</div>
20
+ <div>Instagram</div>
21
+ </button>
22
+ <button class="bg-red-500 text-white p-4 rounded-lg hover:bg-red-600 transition-colors">
23
+ <div class="text-xl mb-2">\u{1F3AC}</div>
24
+ <div>YouTube</div>
25
+ </button>
26
+ <button class="bg-purple-500 text-white p-4 rounded-lg hover:bg-purple-600 transition-colors">
27
+ <div class="text-xl mb-2">\u{1F3B5}</div>
28
+ <div>TikTok</div>
29
+ </button>
30
+ </div>
31
+ </div>
32
+
33
+ <div class="bg-white border rounded-lg p-6">
34
+ <h3 class="font-semibold text-lg mb-4">Connected Accounts</h3>
35
+ <div class="text-center py-8">
36
+ <div class="text-4xl mb-2">\u{1F50C}</div>
37
+ <p class="text-gray-600">No accounts connected yet</p>
38
+ <p class="text-sm text-gray-500">Click one of the platforms above to get started</p>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ `;
43
+ }
44
+ })();
@@ -0,0 +1,39 @@
1
+ (() => {
2
+ // src/tabs/analytics.tsx
3
+ function Analytics() {
4
+ return `
5
+ <div class="p-6">
6
+ <h2 class="text-2xl font-bold mb-4">Analytics</h2>
7
+ <div class="bg-purple-50 border border-purple-200 rounded-lg p-4 mb-6">
8
+ <p class="text-purple-800">\u{1F4CA} Analytics dashboard - track your content performance!</p>
9
+ </div>
10
+
11
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
12
+ <div class="bg-white border rounded-lg p-4">
13
+ <div class="text-2xl font-bold text-blue-600">0</div>
14
+ <div class="text-gray-600">Total Posts</div>
15
+ </div>
16
+ <div class="bg-white border rounded-lg p-4">
17
+ <div class="text-2xl font-bold text-green-600">0</div>
18
+ <div class="text-gray-600">Total Engagement</div>
19
+ </div>
20
+ <div class="bg-white border rounded-lg p-4">
21
+ <div class="text-2xl font-bold text-orange-600">0</div>
22
+ <div class="text-gray-600">New Followers</div>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="bg-white border rounded-lg p-6">
27
+ <h3 class="font-semibold text-lg mb-4">Engagement Over Time</h3>
28
+ <div class="h-64 bg-gray-50 rounded border flex items-center justify-center">
29
+ <div class="text-center">
30
+ <div class="text-4xl mb-2">\u{1F4C8}</div>
31
+ <p class="text-gray-600">Your engagement chart will appear here</p>
32
+ <p class="text-sm text-gray-500">Start publishing content to see analytics</p>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ `;
38
+ }
39
+ })();
@@ -0,0 +1,33 @@
1
+ (() => {
2
+ // src/tabs/content-calendar.tsx
3
+ function ContentCalendar() {
4
+ return `
5
+ <div class="p-6">
6
+ <h2 class="text-2xl font-bold mb-4">Content Calendar</h2>
7
+ <div class="bg-green-50 border border-green-200 rounded-lg p-4 mb-6">
8
+ <p class="text-green-800">\u{1F4C5} This is the Content Calendar tab - schedule and plan your content!</p>
9
+ </div>
10
+ <div class="bg-white border rounded-lg p-6">
11
+ <div class="grid grid-cols-7 gap-2 mb-4">
12
+ <div class="font-semibold text-center p-2">Sun</div>
13
+ <div class="font-semibold text-center p-2">Mon</div>
14
+ <div class="font-semibold text-center p-2">Tue</div>
15
+ <div class="font-semibold text-center p-2">Wed</div>
16
+ <div class="font-semibold text-center p-2">Thu</div>
17
+ <div class="font-semibold text-center p-2">Fri</div>
18
+ <div class="font-semibold text-center p-2">Sat</div>
19
+ </div>
20
+ <div class="grid grid-cols-7 gap-2">
21
+ ${Array.from({ length: 35 }, (_, i) => {
22
+ const day = i % 7 === 0 ? Math.floor(i / 7) + 1 : "";
23
+ return `<div class="border rounded p-2 h-20 ${day ? "bg-gray-50" : "bg-gray-100"}">
24
+ ${day ? `<div class="text-sm font-medium">${day}</div>` : ""}
25
+ </div>`;
26
+ }).join("")}
27
+ </div>
28
+ <p class="text-gray-500 text-sm mt-4">Scheduled posts would appear on their respective dates. Drag to reschedule!</p>
29
+ </div>
30
+ </div>
31
+ `;
32
+ }
33
+ })();
@@ -0,0 +1,29 @@
1
+ (() => {
2
+ // src/tabs/content-library.tsx
3
+ function ContentLibrary() {
4
+ return `
5
+ <div class="p-6">
6
+ <h2 class="text-2xl font-bold mb-4">Content Library</h2>
7
+ <div class="bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6">
8
+ <p class="text-blue-800">\u{1F389} Marketing Suite plugin is working! This is the Content Library tab.</p>
9
+ </div>
10
+ <div class="space-y-4">
11
+ <div class="bg-white border rounded-lg p-4">
12
+ <h3 class="font-semibold text-lg mb-2">Create New Post</h3>
13
+ <p class="text-gray-600">Your content creation tools would go here. You could add:</p>
14
+ <ul class="list-disc list-inside mt-2 text-gray-600">
15
+ <li>Rich text editor</li>
16
+ <li>Media upload</li>
17
+ <li>Platform selection (Twitter, Instagram, etc.)</li>
18
+ <li>Scheduling options</li>
19
+ </ul>
20
+ </div>
21
+ <div class="bg-white border rounded-lg p-4">
22
+ <h3 class="font-semibold text-lg mb-2">Recent Posts</h3>
23
+ <p class="text-gray-500 italic">No posts yet. Create your first post above!</p>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ `;
28
+ }
29
+ })();
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@jiggai/kitchen-plugin-marketing",
3
+ "version": "0.2.1",
4
+ "description": "Marketing Suite plugin for ClawKitchen",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist/",
8
+ "db/migrations/",
9
+ "scripts/kitchen-cli.js",
10
+ "README.md"
11
+ ],
12
+ "bin": {
13
+ "kitchen-plugin-marketing": "scripts/kitchen-cli.js",
14
+ "@jiggai/kitchen-plugin-marketing": "scripts/kitchen-cli.js"
15
+ },
16
+ "kitchenPlugin": {
17
+ "id": "marketing",
18
+ "name": "Marketing Suite",
19
+ "teamTypes": [
20
+ "marketing-team",
21
+ "claw-marketing-team"
22
+ ],
23
+ "tabs": [
24
+ {
25
+ "id": "content-library",
26
+ "label": "Content Library",
27
+ "icon": "library",
28
+ "bundle": "./dist/tabs/content-library.js"
29
+ },
30
+ {
31
+ "id": "content-calendar",
32
+ "label": "Content Calendar",
33
+ "icon": "calendar",
34
+ "bundle": "./dist/tabs/content-calendar.js"
35
+ },
36
+ {
37
+ "id": "analytics",
38
+ "label": "Analytics",
39
+ "icon": "chart",
40
+ "bundle": "./dist/tabs/analytics.js"
41
+ },
42
+ {
43
+ "id": "accounts",
44
+ "label": "Accounts",
45
+ "icon": "users",
46
+ "bundle": "./dist/tabs/accounts.js"
47
+ }
48
+ ],
49
+ "apiRoutes": "./dist/api/routes.js",
50
+ "migrations": "./db/migrations"
51
+ },
52
+ "scripts": {
53
+ "build": "node scripts/build.js",
54
+ "dev": "node scripts/dev.js",
55
+ "db:generate": "drizzle-kit generate:sqlite",
56
+ "db:migrate": "drizzle-kit push:sqlite",
57
+ "db:studio": "drizzle-kit studio",
58
+ "prepublishOnly": "npm run build",
59
+ "test": "echo \"No tests yet\" && exit 0"
60
+ },
61
+ "dependencies": {
62
+ "better-sqlite3": "^9.4.5",
63
+ "drizzle-orm": "^0.38.0",
64
+ "express": "^4.18.2",
65
+ "multer": "^1.4.4"
66
+ },
67
+ "devDependencies": {
68
+ "@types/better-sqlite3": "^7.6.10",
69
+ "@types/express": "^4.17.21",
70
+ "@types/multer": "^1.4.11",
71
+ "@types/node": "^20.0.0",
72
+ "drizzle-kit": "^0.20.0",
73
+ "esbuild": "^0.24.0",
74
+ "typescript": "^5.0.0"
75
+ }
76
+ }
@@ -0,0 +1,233 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Kitchen Plugin CLI Commands
5
+ *
6
+ * Usage:
7
+ * npx kitchen-plugin-marketing add <plugin-name>
8
+ * npx kitchen-plugin-marketing remove <plugin-name>
9
+ * npx kitchen-plugin-marketing list
10
+ * npx kitchen-plugin-marketing status
11
+ */
12
+
13
+ const { execSync } = require('child_process');
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+
17
+ function findKitchenDir() {
18
+ // Look for clawkitchen directory
19
+ const possiblePaths = [
20
+ path.join(process.cwd(), 'clawkitchen'),
21
+ path.join(process.cwd()),
22
+ path.join(process.env.HOME, 'clawkitchen'),
23
+ '/home/control/clawkitchen'
24
+ ];
25
+
26
+ for (const dir of possiblePaths) {
27
+ if (fs.existsSync(path.join(dir, 'package.json'))) {
28
+ const pkg = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8'));
29
+ if (pkg.name === 'clawkitchen' || pkg.name === 'kitchen' || pkg.kitchenPlugin === true) {
30
+ return dir;
31
+ }
32
+ }
33
+ }
34
+
35
+ return null;
36
+ }
37
+
38
+ function getInstalledPlugins(kitchenDir) {
39
+ try {
40
+ const packageJsonPath = path.join(kitchenDir, 'package.json');
41
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
42
+
43
+ const plugins = [];
44
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
45
+
46
+ for (const [name, version] of Object.entries(deps)) {
47
+ if (name.startsWith('kitchen-plugin-') || name.includes('kitchen-plugin')) {
48
+ plugins.push({ name, version: version.replace(/[\^~]/, '') });
49
+ }
50
+ }
51
+
52
+ return plugins;
53
+ } catch (error) {
54
+ return [];
55
+ }
56
+ }
57
+
58
+ async function addPlugin(pluginName) {
59
+ const kitchenDir = findKitchenDir();
60
+ if (!kitchenDir) {
61
+ console.error('❌ ClawKitchen directory not found');
62
+ console.error('Run this command from your ClawKitchen project directory');
63
+ process.exit(1);
64
+ }
65
+
66
+ console.log(`📦 Installing plugin: ${pluginName}`);
67
+ console.log(`📁 Kitchen directory: ${kitchenDir}`);
68
+
69
+ try {
70
+ // Install the plugin
71
+ process.chdir(kitchenDir);
72
+ execSync(`npm install ${pluginName}`, { stdio: 'inherit' });
73
+
74
+ console.log('✅ Plugin installed successfully!');
75
+ console.log('');
76
+ console.log('Next steps:');
77
+ console.log('1. Rebuild ClawKitchen: npm run build');
78
+ console.log('2. Restart gateway: openclaw gateway restart');
79
+ console.log('3. Check plugin status: npx kitchen-plugin-marketing status');
80
+
81
+ } catch (error) {
82
+ console.error('❌ Failed to install plugin:', error.message);
83
+ process.exit(1);
84
+ }
85
+ }
86
+
87
+ async function removePlugin(pluginName) {
88
+ const kitchenDir = findKitchenDir();
89
+ if (!kitchenDir) {
90
+ console.error('❌ ClawKitchen directory not found');
91
+ process.exit(1);
92
+ }
93
+
94
+ console.log(`🗑️ Removing plugin: ${pluginName}`);
95
+
96
+ try {
97
+ process.chdir(kitchenDir);
98
+ execSync(`npm uninstall ${pluginName}`, { stdio: 'inherit' });
99
+
100
+ console.log('✅ Plugin removed successfully!');
101
+ console.log('');
102
+ console.log('Next steps:');
103
+ console.log('1. Rebuild ClawKitchen: npm run build');
104
+ console.log('2. Restart gateway: openclaw gateway restart');
105
+
106
+ } catch (error) {
107
+ console.error('❌ Failed to remove plugin:', error.message);
108
+ process.exit(1);
109
+ }
110
+ }
111
+
112
+ function listPlugins() {
113
+ const kitchenDir = findKitchenDir();
114
+ if (!kitchenDir) {
115
+ console.error('❌ ClawKitchen directory not found');
116
+ process.exit(1);
117
+ }
118
+
119
+ console.log('📋 Installed Kitchen Plugins:');
120
+ console.log('');
121
+
122
+ const plugins = getInstalledPlugins(kitchenDir);
123
+
124
+ if (plugins.length === 0) {
125
+ console.log(' No kitchen plugins found');
126
+ console.log('');
127
+ console.log('💡 Install a plugin with:');
128
+ console.log(' npx kitchen-plugin-marketing add kitchen-plugin-marketing');
129
+ return;
130
+ }
131
+
132
+ plugins.forEach(plugin => {
133
+ console.log(` ✓ ${plugin.name} (${plugin.version})`);
134
+ });
135
+
136
+ console.log('');
137
+ console.log(`📁 Kitchen directory: ${kitchenDir}`);
138
+ }
139
+
140
+ function showStatus() {
141
+ const kitchenDir = findKitchenDir();
142
+ if (!kitchenDir) {
143
+ console.error('❌ ClawKitchen directory not found');
144
+ process.exit(1);
145
+ }
146
+
147
+ console.log('📊 Kitchen Plugin System Status:');
148
+ console.log('');
149
+
150
+ const plugins = getInstalledPlugins(kitchenDir);
151
+ console.log(`📦 Plugins installed: ${plugins.length}`);
152
+ console.log(`📁 Kitchen directory: ${kitchenDir}`);
153
+
154
+ // Check if Kitchen is built
155
+ const buildExists = fs.existsSync(path.join(kitchenDir, '.next'));
156
+ console.log(`🏗️ Kitchen built: ${buildExists ? 'Yes' : 'No'}`);
157
+
158
+ // Check gateway status
159
+ try {
160
+ execSync('openclaw health', { stdio: 'pipe' });
161
+ console.log('🟢 Gateway: Running');
162
+ } catch {
163
+ console.log('🔴 Gateway: Not running');
164
+ }
165
+
166
+ if (plugins.length > 0) {
167
+ console.log('');
168
+ console.log('Installed plugins:');
169
+ plugins.forEach(plugin => {
170
+ console.log(` • ${plugin.name}`);
171
+ });
172
+ }
173
+ }
174
+
175
+ function showHelp() {
176
+ console.log('🍳 Kitchen Plugin Manager');
177
+ console.log('');
178
+ console.log('Commands:');
179
+ console.log(' add <plugin> Install a kitchen plugin');
180
+ console.log(' remove <plugin> Remove a kitchen plugin');
181
+ console.log(' list List installed plugins');
182
+ console.log(' status Show system status');
183
+ console.log(' help Show this help');
184
+ console.log('');
185
+ console.log('Examples:');
186
+ console.log(' npx kitchen-plugin-marketing add kitchen-plugin-marketing');
187
+ console.log(' npx kitchen-plugin-marketing add @company/kitchen-plugin-crm');
188
+ console.log(' npx kitchen-plugin-marketing remove kitchen-plugin-marketing');
189
+ console.log(' npx kitchen-plugin-marketing list');
190
+ console.log(' npx kitchen-plugin-marketing status');
191
+ }
192
+
193
+ // Parse command line arguments
194
+ const [,, command, ...args] = process.argv;
195
+
196
+ switch (command) {
197
+ case 'add':
198
+ if (!args[0]) {
199
+ console.error('❌ Plugin name required');
200
+ console.error('Usage: npx kitchen-plugin-marketing add <plugin-name>');
201
+ process.exit(1);
202
+ }
203
+ addPlugin(args[0]);
204
+ break;
205
+
206
+ case 'remove':
207
+ if (!args[0]) {
208
+ console.error('❌ Plugin name required');
209
+ console.error('Usage: npx kitchen-plugin-marketing remove <plugin-name>');
210
+ process.exit(1);
211
+ }
212
+ removePlugin(args[0]);
213
+ break;
214
+
215
+ case 'list':
216
+ listPlugins();
217
+ break;
218
+
219
+ case 'status':
220
+ showStatus();
221
+ break;
222
+
223
+ case 'help':
224
+ case '--help':
225
+ case '-h':
226
+ showHelp();
227
+ break;
228
+
229
+ default:
230
+ console.error('❌ Unknown command:', command);
231
+ showHelp();
232
+ process.exit(1);
233
+ }