@praveencs/agent 0.9.29 → 0.10.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 +55 -9
- package/ROADMAP.md +42 -50
- package/agent-skills/README.md +192 -0
- package/agent-skills/plugins/aws/plugin.json +22 -0
- package/agent-skills/plugins/aws/skills/aws-manager.md +17 -0
- package/agent-skills/plugins/aws/tools/aws.js +152 -0
- package/agent-skills/plugins/discord/plugin.json +22 -0
- package/agent-skills/plugins/discord/skills/discord-manager.md +15 -0
- package/agent-skills/plugins/discord/tools/discord.js +150 -0
- package/agent-skills/plugins/docker/plugin.json +21 -0
- package/agent-skills/plugins/docker/skills/docker-manager.md +15 -0
- package/agent-skills/plugins/docker/tools/docker.js +135 -0
- package/agent-skills/plugins/firebase/plugin.json +22 -0
- package/agent-skills/plugins/firebase/skills/firebase-manager.md +14 -0
- package/agent-skills/plugins/firebase/tools/firebase.js +157 -0
- package/agent-skills/plugins/github/plugin.json +23 -0
- package/agent-skills/plugins/github/skills/github-manager.md +15 -0
- package/agent-skills/plugins/github/tools/github.js +133 -0
- package/agent-skills/plugins/huggingface/plugin.json +22 -0
- package/agent-skills/plugins/huggingface/skills/huggingface-manager.md +16 -0
- package/agent-skills/plugins/huggingface/tools/huggingface.js +149 -0
- package/agent-skills/plugins/linear/plugin.json +22 -0
- package/agent-skills/plugins/linear/skills/linear-manager.md +16 -0
- package/agent-skills/plugins/linear/tools/linear.js +199 -0
- package/agent-skills/plugins/mongodb/plugin.json +21 -0
- package/agent-skills/plugins/mongodb/skills/mongodb-manager.md +14 -0
- package/agent-skills/plugins/mongodb/tools/mongodb.js +123 -0
- package/agent-skills/plugins/notion/plugin.json +22 -0
- package/agent-skills/plugins/notion/skills/notion-manager.md +16 -0
- package/agent-skills/plugins/notion/tools/notion.js +158 -0
- package/agent-skills/plugins/openai/plugin.json +23 -0
- package/agent-skills/plugins/openai/skills/openai-manager.md +15 -0
- package/agent-skills/plugins/openai/tools/openai.js +137 -0
- package/agent-skills/plugins/resend/plugin.json +21 -0
- package/agent-skills/plugins/resend/skills/resend-manager.md +15 -0
- package/agent-skills/plugins/resend/tools/resend.js +102 -0
- package/agent-skills/plugins/slack/plugin.json +22 -0
- package/agent-skills/plugins/slack/skills/slack-manager.md +15 -0
- package/agent-skills/plugins/slack/tools/slack.js +168 -0
- package/agent-skills/plugins/stripe/plugin.json +22 -0
- package/agent-skills/plugins/stripe/skills/stripe-manager.md +16 -0
- package/agent-skills/plugins/stripe/tools/stripe.js +174 -0
- package/agent-skills/plugins/supabase/plugin.json +22 -0
- package/agent-skills/plugins/supabase/skills/supabase-manager.md +16 -0
- package/agent-skills/plugins/supabase/tools/supabase.js +153 -0
- package/agent-skills/plugins/telegram/plugin.json +21 -0
- package/agent-skills/plugins/telegram/skills/telegram-manager.md +14 -0
- package/agent-skills/plugins/telegram/tools/telegram.js +131 -0
- package/agent-skills/plugins/vercel/plugin.json +22 -0
- package/agent-skills/plugins/vercel/skills/vercel-manager.md +15 -0
- package/agent-skills/plugins/vercel/tools/vercel.js +145 -0
- package/agent-skills/registry.json +675 -0
- package/agent-skills/skills/api-tester/prompt.md +27 -0
- package/agent-skills/skills/api-tester/skill.json +16 -0
- package/agent-skills/skills/backup/prompt.md +12 -0
- package/agent-skills/skills/backup/skill.json +1 -0
- package/agent-skills/skills/code-review/prompt.md +29 -0
- package/agent-skills/skills/code-review/skill.json +18 -0
- package/agent-skills/skills/create-note/prompt.md +21 -0
- package/agent-skills/skills/create-note/skill.json +15 -0
- package/agent-skills/skills/cron-scheduler/prompt.md +25 -0
- package/agent-skills/skills/cron-scheduler/skill.json +1 -0
- package/agent-skills/skills/db-query/prompt.md +12 -0
- package/agent-skills/skills/db-query/skill.json +1 -0
- package/agent-skills/skills/docker-deploy/prompt.md +21 -0
- package/agent-skills/skills/docker-deploy/skill.json +16 -0
- package/agent-skills/skills/file-organizer/prompt.md +32 -0
- package/agent-skills/skills/file-organizer/skill.json +19 -0
- package/agent-skills/skills/git-commit/prompt.md +21 -0
- package/agent-skills/skills/git-commit/skill.json +17 -0
- package/agent-skills/skills/log-analyzer/prompt.md +16 -0
- package/agent-skills/skills/log-analyzer/skill.json +1 -0
- package/agent-skills/skills/npm-publish/prompt.md +24 -0
- package/agent-skills/skills/npm-publish/skill.json +20 -0
- package/agent-skills/skills/open-vscode/prompt.md +8 -0
- package/agent-skills/skills/open-vscode/skill.json +15 -0
- package/agent-skills/skills/project-scaffold/prompt.md +43 -0
- package/agent-skills/skills/project-scaffold/skill.json +17 -0
- package/agent-skills/skills/send-email/prompt.md +19 -0
- package/agent-skills/skills/send-email/send.js +60 -0
- package/agent-skills/skills/send-email/skill.json +16 -0
- package/agent-skills/skills/system-monitor/prompt.md +27 -0
- package/agent-skills/skills/system-monitor/skill.json +15 -0
- package/agent-skills/skills/web-search/prompt.md +26 -0
- package/agent-skills/skills/web-search/skill.json +16 -0
- package/dist/src/cli/commands/desktop.d.ts +3 -0
- package/dist/src/cli/commands/desktop.d.ts.map +1 -0
- package/dist/src/cli/commands/desktop.js +80 -0
- package/dist/src/cli/commands/desktop.js.map +1 -0
- package/dist/src/cli/commands/multimodal.d.ts +3 -0
- package/dist/src/cli/commands/multimodal.d.ts.map +1 -0
- package/dist/src/cli/commands/multimodal.js +78 -0
- package/dist/src/cli/commands/multimodal.js.map +1 -0
- package/dist/src/cli/commands/plugins.d.ts.map +1 -1
- package/dist/src/cli/commands/plugins.js +63 -12
- package/dist/src/cli/commands/plugins.js.map +1 -1
- package/dist/src/cli/commands/sandbox.d.ts +3 -0
- package/dist/src/cli/commands/sandbox.d.ts.map +1 -0
- package/dist/src/cli/commands/sandbox.js +89 -0
- package/dist/src/cli/commands/sandbox.js.map +1 -0
- package/dist/src/cli/commands/skills.d.ts.map +1 -1
- package/dist/src/cli/commands/skills.js +52 -121
- package/dist/src/cli/commands/skills.js.map +1 -1
- package/dist/src/cli/commands/swarm.d.ts +3 -0
- package/dist/src/cli/commands/swarm.d.ts.map +1 -0
- package/dist/src/cli/commands/swarm.js +120 -0
- package/dist/src/cli/commands/swarm.js.map +1 -0
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +8 -0
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/config/defaults.d.ts.map +1 -1
- package/dist/src/config/defaults.js +42 -0
- package/dist/src/config/defaults.js.map +1 -1
- package/dist/src/config/loader.d.ts +4 -0
- package/dist/src/config/loader.d.ts.map +1 -1
- package/dist/src/config/loader.js +27 -6
- package/dist/src/config/loader.js.map +1 -1
- package/dist/src/config/schema.d.ts +261 -0
- package/dist/src/config/schema.d.ts.map +1 -1
- package/dist/src/config/schema.js +58 -0
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/desktop/engine.d.ts +42 -0
- package/dist/src/desktop/engine.d.ts.map +1 -0
- package/dist/src/desktop/engine.js +77 -0
- package/dist/src/desktop/engine.js.map +1 -0
- package/dist/src/desktop/index.d.ts +6 -0
- package/dist/src/desktop/index.d.ts.map +1 -0
- package/dist/src/desktop/index.js +6 -0
- package/dist/src/desktop/index.js.map +1 -0
- package/dist/src/desktop/input.d.ts +20 -0
- package/dist/src/desktop/input.d.ts.map +1 -0
- package/dist/src/desktop/input.js +160 -0
- package/dist/src/desktop/input.js.map +1 -0
- package/dist/src/desktop/screen.d.ts +17 -0
- package/dist/src/desktop/screen.d.ts.map +1 -0
- package/dist/src/desktop/screen.js +120 -0
- package/dist/src/desktop/screen.js.map +1 -0
- package/dist/src/desktop/types.d.ts +50 -0
- package/dist/src/desktop/types.d.ts.map +1 -0
- package/dist/src/desktop/types.js +10 -0
- package/dist/src/desktop/types.js.map +1 -0
- package/dist/src/hub/lockfile.d.ts +29 -0
- package/dist/src/hub/lockfile.d.ts.map +1 -0
- package/dist/src/hub/lockfile.js +72 -0
- package/dist/src/hub/lockfile.js.map +1 -0
- package/dist/src/hub/publisher.d.ts +13 -0
- package/dist/src/hub/publisher.d.ts.map +1 -0
- package/dist/src/hub/publisher.js +159 -0
- package/dist/src/hub/publisher.js.map +1 -0
- package/dist/src/hub/registry.d.ts +40 -0
- package/dist/src/hub/registry.d.ts.map +1 -0
- package/dist/src/hub/registry.js +123 -0
- package/dist/src/hub/registry.js.map +1 -0
- package/dist/src/multimodal/engine.d.ts +33 -0
- package/dist/src/multimodal/engine.d.ts.map +1 -0
- package/dist/src/multimodal/engine.js +63 -0
- package/dist/src/multimodal/engine.js.map +1 -0
- package/dist/src/multimodal/index.d.ts +7 -0
- package/dist/src/multimodal/index.d.ts.map +1 -0
- package/dist/src/multimodal/index.js +7 -0
- package/dist/src/multimodal/index.js.map +1 -0
- package/dist/src/multimodal/tts.d.ts +11 -0
- package/dist/src/multimodal/tts.d.ts.map +1 -0
- package/dist/src/multimodal/tts.js +48 -0
- package/dist/src/multimodal/tts.js.map +1 -0
- package/dist/src/multimodal/types.d.ts +55 -0
- package/dist/src/multimodal/types.d.ts.map +1 -0
- package/dist/src/multimodal/types.js +20 -0
- package/dist/src/multimodal/types.js.map +1 -0
- package/dist/src/multimodal/vision.d.ts +15 -0
- package/dist/src/multimodal/vision.d.ts.map +1 -0
- package/dist/src/multimodal/vision.js +98 -0
- package/dist/src/multimodal/vision.js.map +1 -0
- package/dist/src/multimodal/voice.d.ts +11 -0
- package/dist/src/multimodal/voice.d.ts.map +1 -0
- package/dist/src/multimodal/voice.js +43 -0
- package/dist/src/multimodal/voice.js.map +1 -0
- package/dist/src/plans/types.d.ts +18 -18
- package/dist/src/plugins/loader.d.ts.map +1 -1
- package/dist/src/plugins/loader.js +10 -0
- package/dist/src/plugins/loader.js.map +1 -1
- package/dist/src/sandbox/docker.d.ts +42 -0
- package/dist/src/sandbox/docker.d.ts.map +1 -0
- package/dist/src/sandbox/docker.js +131 -0
- package/dist/src/sandbox/docker.js.map +1 -0
- package/dist/src/sandbox/engine.d.ts +50 -0
- package/dist/src/sandbox/engine.d.ts.map +1 -0
- package/dist/src/sandbox/engine.js +133 -0
- package/dist/src/sandbox/engine.js.map +1 -0
- package/dist/src/sandbox/index.d.ts +5 -0
- package/dist/src/sandbox/index.d.ts.map +1 -0
- package/dist/src/sandbox/index.js +5 -0
- package/dist/src/sandbox/index.js.map +1 -0
- package/dist/src/sandbox/types.d.ts +41 -0
- package/dist/src/sandbox/types.d.ts.map +1 -0
- package/dist/src/sandbox/types.js +12 -0
- package/dist/src/sandbox/types.js.map +1 -0
- package/dist/src/scripts/types.d.ts +2 -2
- package/dist/src/server/app.d.ts.map +1 -1
- package/dist/src/server/app.js +133 -0
- package/dist/src/server/app.js.map +1 -1
- package/dist/src/skills/loader.d.ts.map +1 -1
- package/dist/src/skills/loader.js +10 -0
- package/dist/src/skills/loader.js.map +1 -1
- package/dist/src/swarm/bus.d.ts +27 -0
- package/dist/src/swarm/bus.d.ts.map +1 -0
- package/dist/src/swarm/bus.js +64 -0
- package/dist/src/swarm/bus.js.map +1 -0
- package/dist/src/swarm/index.d.ts +6 -0
- package/dist/src/swarm/index.d.ts.map +1 -0
- package/dist/src/swarm/index.js +6 -0
- package/dist/src/swarm/index.js.map +1 -0
- package/dist/src/swarm/orchestrator.d.ts +79 -0
- package/dist/src/swarm/orchestrator.d.ts.map +1 -0
- package/dist/src/swarm/orchestrator.js +271 -0
- package/dist/src/swarm/orchestrator.js.map +1 -0
- package/dist/src/swarm/roles.d.ts +18 -0
- package/dist/src/swarm/roles.d.ts.map +1 -0
- package/dist/src/swarm/roles.js +83 -0
- package/dist/src/swarm/roles.js.map +1 -0
- package/dist/src/swarm/types.d.ts +58 -0
- package/dist/src/swarm/types.d.ts.map +1 -0
- package/dist/src/swarm/types.js +10 -0
- package/dist/src/swarm/types.js.map +1 -0
- package/dist/src/tools/core/cmd.d.ts.map +1 -1
- package/dist/src/tools/core/cmd.js +28 -0
- package/dist/src/tools/core/cmd.js.map +1 -1
- package/dist/src/utils/paths.d.ts +4 -4
- package/dist/src/utils/paths.d.ts.map +1 -1
- package/dist/src/utils/paths.js +8 -8
- package/dist/src/utils/paths.js.map +1 -1
- package/docs/DOCUMENTATION.md +137 -0
- package/package.json +4 -2
- package/studio/README.md +73 -0
- package/studio/eslint.config.js +23 -0
- package/studio/index.html +13 -0
- package/studio/package-lock.json +4350 -0
- package/studio/package.json +44 -0
- package/studio/postcss.config.js +6 -0
- package/studio/public/vite.svg +1 -0
- package/studio/src/App.tsx +243 -0
- package/studio/src/assets/react.svg +1 -0
- package/studio/src/components/Capabilities.tsx +80 -0
- package/studio/src/components/CommandsManager.tsx +94 -0
- package/studio/src/components/CostDashboard.tsx +182 -0
- package/studio/src/components/CredentialCapture.tsx +196 -0
- package/studio/src/components/CredentialsManager.tsx +257 -0
- package/studio/src/components/DaemonPanel.tsx +91 -0
- package/studio/src/components/DesktopPanel.tsx +118 -0
- package/studio/src/components/GoalTemplates.tsx +190 -0
- package/studio/src/components/GoalsPanel.tsx +235 -0
- package/studio/src/components/MemoryExplorer.tsx +152 -0
- package/studio/src/components/MultimodalPanel.tsx +150 -0
- package/studio/src/components/NotificationsPanel.tsx +175 -0
- package/studio/src/components/PluginsManager.tsx +60 -0
- package/studio/src/components/SandboxPanel.tsx +118 -0
- package/studio/src/components/ScriptsManager.tsx +269 -0
- package/studio/src/components/SkillsManager.tsx +123 -0
- package/studio/src/components/SwarmPanel.tsx +149 -0
- package/studio/src/components/TaskStreaming.tsx +189 -0
- package/studio/src/components/Terminal.tsx +200 -0
- package/studio/src/index.css +51 -0
- package/studio/src/main.tsx +13 -0
- package/studio/tailwind.config.js +47 -0
- package/studio/tsconfig.app.json +28 -0
- package/studio/tsconfig.json +7 -0
- package/studio/tsconfig.node.json +26 -0
- package/studio/vite.config.ts +7 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discord automation tool.
|
|
3
|
+
* Provides messaging, channel management, and webhook support via the Discord REST API (v10).
|
|
4
|
+
*/
|
|
5
|
+
export async function execute(params) {
|
|
6
|
+
const { action, ...args } = params;
|
|
7
|
+
const token = process.env.DISCORD_BOT_TOKEN;
|
|
8
|
+
|
|
9
|
+
if (!token && action !== 'send_webhook') {
|
|
10
|
+
throw new Error('DISCORD_BOT_TOKEN environment variable is not set. Create a bot at https://discord.com/developers/applications');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const headers = {
|
|
14
|
+
'Content-Type': 'application/json',
|
|
15
|
+
'Authorization': `Bot ${token}`,
|
|
16
|
+
'User-Agent': 'praveencs-agent-runtime (https://github.com/praveencs87/agent, 1.0.0)'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
async function discordFetch(method, endpoint, body = null) {
|
|
20
|
+
const url = `https://discord.com/api/v10${endpoint}`;
|
|
21
|
+
const options = { method, headers };
|
|
22
|
+
if (body) options.body = JSON.stringify(body);
|
|
23
|
+
|
|
24
|
+
const res = await fetch(url, options);
|
|
25
|
+
if (res.status === 204) return { success: true };
|
|
26
|
+
|
|
27
|
+
const data = await res.json();
|
|
28
|
+
if (!res.ok) {
|
|
29
|
+
throw new Error(`Discord API Error (${res.status}): ${JSON.stringify(data)}`);
|
|
30
|
+
}
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
switch (action) {
|
|
36
|
+
// --- MESSAGING ---
|
|
37
|
+
case 'send_message':
|
|
38
|
+
return await discordFetch('POST', `/channels/${args.channel_id}/messages`, {
|
|
39
|
+
content: args.content,
|
|
40
|
+
embeds: args.embeds || undefined
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
case 'edit_message':
|
|
44
|
+
return await discordFetch('PATCH', `/channels/${args.channel_id}/messages/${args.message_id}`, {
|
|
45
|
+
content: args.content
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
case 'delete_message':
|
|
49
|
+
return await discordFetch('DELETE', `/channels/${args.channel_id}/messages/${args.message_id}`);
|
|
50
|
+
|
|
51
|
+
case 'get_messages':
|
|
52
|
+
return await discordFetch('GET', `/channels/${args.channel_id}/messages?limit=${args.limit || 50}`);
|
|
53
|
+
|
|
54
|
+
// --- WEBHOOKS (no bot token needed) ---
|
|
55
|
+
case 'send_webhook': {
|
|
56
|
+
if (!args.webhook_url) throw new Error('webhook_url is required for send_webhook');
|
|
57
|
+
const res = await fetch(args.webhook_url, {
|
|
58
|
+
method: 'POST',
|
|
59
|
+
headers: { 'Content-Type': 'application/json' },
|
|
60
|
+
body: JSON.stringify({
|
|
61
|
+
content: args.content,
|
|
62
|
+
username: args.username || 'Agent Bot',
|
|
63
|
+
embeds: args.embeds || undefined
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
if (!res.ok) throw new Error(`Webhook Error (${res.status})`);
|
|
67
|
+
return { success: true };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// --- CHANNELS ---
|
|
71
|
+
case 'list_channels':
|
|
72
|
+
return await discordFetch('GET', `/guilds/${args.guild_id}/channels`);
|
|
73
|
+
|
|
74
|
+
case 'create_channel':
|
|
75
|
+
return await discordFetch('POST', `/guilds/${args.guild_id}/channels`, {
|
|
76
|
+
name: args.name,
|
|
77
|
+
type: args.type || 0, // 0 = text, 2 = voice
|
|
78
|
+
topic: args.topic,
|
|
79
|
+
parent_id: args.parent_id
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
case 'delete_channel':
|
|
83
|
+
return await discordFetch('DELETE', `/channels/${args.channel_id}`);
|
|
84
|
+
|
|
85
|
+
// --- GUILDS (SERVERS) ---
|
|
86
|
+
case 'get_guild':
|
|
87
|
+
return await discordFetch('GET', `/guilds/${args.guild_id}?with_counts=true`);
|
|
88
|
+
|
|
89
|
+
case 'list_members':
|
|
90
|
+
return await discordFetch('GET', `/guilds/${args.guild_id}/members?limit=${args.limit || 100}`);
|
|
91
|
+
|
|
92
|
+
// --- ROLES ---
|
|
93
|
+
case 'list_roles':
|
|
94
|
+
return await discordFetch('GET', `/guilds/${args.guild_id}/roles`);
|
|
95
|
+
|
|
96
|
+
case 'add_role':
|
|
97
|
+
return await discordFetch('PUT', `/guilds/${args.guild_id}/members/${args.user_id}/roles/${args.role_id}`);
|
|
98
|
+
|
|
99
|
+
case 'remove_role':
|
|
100
|
+
return await discordFetch('DELETE', `/guilds/${args.guild_id}/members/${args.user_id}/roles/${args.role_id}`);
|
|
101
|
+
|
|
102
|
+
// --- REACTIONS ---
|
|
103
|
+
case 'add_reaction':
|
|
104
|
+
return await discordFetch('PUT', `/channels/${args.channel_id}/messages/${args.message_id}/reactions/${encodeURIComponent(args.emoji)}/@me`);
|
|
105
|
+
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`Unknown action: ${action}`);
|
|
108
|
+
}
|
|
109
|
+
} catch (err) {
|
|
110
|
+
return { error: err.message, stack: err.stack };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const definition = {
|
|
115
|
+
name: 'discord',
|
|
116
|
+
description: 'Interact with Discord to send messages, manage channels and roles, use webhooks, and moderate servers. Requires DISCORD_BOT_TOKEN (except for webhooks).',
|
|
117
|
+
parameters: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
required: ['action'],
|
|
120
|
+
properties: {
|
|
121
|
+
action: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
description: 'The Discord operation to perform',
|
|
124
|
+
enum: [
|
|
125
|
+
'send_message', 'edit_message', 'delete_message', 'get_messages',
|
|
126
|
+
'send_webhook',
|
|
127
|
+
'list_channels', 'create_channel', 'delete_channel',
|
|
128
|
+
'get_guild', 'list_members',
|
|
129
|
+
'list_roles', 'add_role', 'remove_role',
|
|
130
|
+
'add_reaction'
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
channel_id: { type: 'string', description: 'Discord channel ID (snowflake)' },
|
|
134
|
+
guild_id: { type: 'string', description: 'Discord server/guild ID (snowflake)' },
|
|
135
|
+
message_id: { type: 'string', description: 'Message ID (snowflake)' },
|
|
136
|
+
user_id: { type: 'string', description: 'User ID (snowflake)' },
|
|
137
|
+
role_id: { type: 'string', description: 'Role ID (snowflake)' },
|
|
138
|
+
content: { type: 'string', description: 'Message text content' },
|
|
139
|
+
embeds: { type: 'array', description: 'Array of Discord embed objects for rich messages' },
|
|
140
|
+
webhook_url: { type: 'string', description: 'Full Discord webhook URL' },
|
|
141
|
+
username: { type: 'string', description: 'Override username for webhook messages' },
|
|
142
|
+
name: { type: 'string', description: 'Channel name (for creation)' },
|
|
143
|
+
type: { type: 'number', description: 'Channel type: 0=text, 2=voice, 4=category' },
|
|
144
|
+
topic: { type: 'string', description: 'Channel topic' },
|
|
145
|
+
parent_id: { type: 'string', description: 'Parent category ID for channel creation' },
|
|
146
|
+
emoji: { type: 'string', description: 'Emoji for reactions (e.g., "👍" or "custom_emoji:123")' },
|
|
147
|
+
limit: { type: 'number', description: 'Max results to return' }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docker",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Build images, run containers, manage compose stacks, and view logs with Docker.",
|
|
5
|
+
"author": "Praveen",
|
|
6
|
+
"category": "DevOps & Cloud",
|
|
7
|
+
"tags": [
|
|
8
|
+
"docker",
|
|
9
|
+
"containers",
|
|
10
|
+
"devops",
|
|
11
|
+
"compose"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
"tools": [
|
|
15
|
+
"tools/docker.js"
|
|
16
|
+
],
|
|
17
|
+
"skills": [
|
|
18
|
+
"skills/docker-manager.md"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Docker Manager
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
This skill enables you to manage Docker containers, images, volumes, and compose stacks.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. Use `action: "ps"` to list running containers. Add `all: true` to include stopped ones.
|
|
8
|
+
2. To run a container: `action: "run"` with `image`, optional `name`, `ports` (e.g., `["8080:80"]`), `env_vars`, and `volumes`.
|
|
9
|
+
3. For Docker Compose, use `compose_up` / `compose_down` with `cwd` pointing to the directory containing `docker-compose.yml`.
|
|
10
|
+
4. To view container logs: `action: "logs"` with `container` name/ID and optional `tail` (lines).
|
|
11
|
+
5. To execute a command inside a running container: `action: "exec"` with `container` and `command`.
|
|
12
|
+
6. Docker must be installed and the daemon running. Verify with `docker info`.
|
|
13
|
+
|
|
14
|
+
## Input Variables
|
|
15
|
+
{{input}}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docker automation tool.
|
|
3
|
+
* Manages containers, images, volumes, and compose stacks via the Docker CLI.
|
|
4
|
+
*/
|
|
5
|
+
import { execFile } from 'node:child_process';
|
|
6
|
+
import { promisify } from 'node:util';
|
|
7
|
+
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
|
|
10
|
+
async function dockerCli(args, cwd) {
|
|
11
|
+
try {
|
|
12
|
+
const { stdout, stderr } = await execFileAsync('docker', args, {
|
|
13
|
+
timeout: 60000,
|
|
14
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
15
|
+
cwd: cwd || process.cwd(),
|
|
16
|
+
env: process.env,
|
|
17
|
+
shell: true
|
|
18
|
+
});
|
|
19
|
+
try { return JSON.parse(stdout); } catch { return { output: stdout.trim(), stderr: stderr.trim() }; }
|
|
20
|
+
} catch (err) {
|
|
21
|
+
throw new Error(`Docker Error: ${err.stderr || err.message}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function execute(params) {
|
|
26
|
+
const { action, ...args } = params;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
switch (action) {
|
|
30
|
+
// --- CONTAINERS ---
|
|
31
|
+
case 'ps':
|
|
32
|
+
return await dockerCli(['ps', '--format', 'json', ...(args.all ? ['-a'] : [])]);
|
|
33
|
+
|
|
34
|
+
case 'run':
|
|
35
|
+
return await dockerCli([
|
|
36
|
+
'run', '-d',
|
|
37
|
+
...(args.name ? ['--name', args.name] : []),
|
|
38
|
+
...(args.ports ? args.ports.flatMap(p => ['-p', p]) : []),
|
|
39
|
+
...(args.env_vars ? args.env_vars.flatMap(e => ['-e', e]) : []),
|
|
40
|
+
...(args.volumes ? args.volumes.flatMap(v => ['-v', v]) : []),
|
|
41
|
+
args.image
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
case 'stop':
|
|
45
|
+
return await dockerCli(['stop', args.container]);
|
|
46
|
+
|
|
47
|
+
case 'rm':
|
|
48
|
+
return await dockerCli(['rm', ...(args.force ? ['-f'] : []), args.container]);
|
|
49
|
+
|
|
50
|
+
case 'logs':
|
|
51
|
+
return await dockerCli(['logs', '--tail', String(args.tail || 100), args.container]);
|
|
52
|
+
|
|
53
|
+
case 'exec':
|
|
54
|
+
return await dockerCli(['exec', args.container, ...args.command.split(' ')]);
|
|
55
|
+
|
|
56
|
+
// --- IMAGES ---
|
|
57
|
+
case 'images':
|
|
58
|
+
return await dockerCli(['images', '--format', 'json']);
|
|
59
|
+
|
|
60
|
+
case 'build':
|
|
61
|
+
return await dockerCli([
|
|
62
|
+
'build', '-t', args.tag,
|
|
63
|
+
...(args.file ? ['-f', args.file] : []),
|
|
64
|
+
args.context || '.'
|
|
65
|
+
], args.cwd);
|
|
66
|
+
|
|
67
|
+
case 'pull':
|
|
68
|
+
return await dockerCli(['pull', args.image]);
|
|
69
|
+
|
|
70
|
+
case 'rmi':
|
|
71
|
+
return await dockerCli(['rmi', ...(args.force ? ['-f'] : []), args.image]);
|
|
72
|
+
|
|
73
|
+
// --- VOLUMES ---
|
|
74
|
+
case 'volume_ls':
|
|
75
|
+
return await dockerCli(['volume', 'ls', '--format', 'json']);
|
|
76
|
+
|
|
77
|
+
case 'volume_create':
|
|
78
|
+
return await dockerCli(['volume', 'create', args.name]);
|
|
79
|
+
|
|
80
|
+
// --- COMPOSE ---
|
|
81
|
+
case 'compose_up':
|
|
82
|
+
return await dockerCli(['compose', 'up', '-d', ...(args.build ? ['--build'] : [])], args.cwd);
|
|
83
|
+
|
|
84
|
+
case 'compose_down':
|
|
85
|
+
return await dockerCli(['compose', 'down', ...(args.volumes ? ['-v'] : [])], args.cwd);
|
|
86
|
+
|
|
87
|
+
case 'compose_ps':
|
|
88
|
+
return await dockerCli(['compose', 'ps', '--format', 'json'], args.cwd);
|
|
89
|
+
|
|
90
|
+
case 'compose_logs':
|
|
91
|
+
return await dockerCli(['compose', 'logs', '--tail', String(args.tail || 100)], args.cwd);
|
|
92
|
+
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Unknown action: ${action}`);
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
return { error: err.message, stack: err.stack };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const definition = {
|
|
102
|
+
name: 'docker',
|
|
103
|
+
description: 'Manage Docker containers, images, volumes, and compose stacks. Requires Docker CLI installed.',
|
|
104
|
+
parameters: {
|
|
105
|
+
type: 'object',
|
|
106
|
+
required: ['action'],
|
|
107
|
+
properties: {
|
|
108
|
+
action: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
description: 'The Docker operation to perform',
|
|
111
|
+
enum: [
|
|
112
|
+
'ps', 'run', 'stop', 'rm', 'logs', 'exec',
|
|
113
|
+
'images', 'build', 'pull', 'rmi',
|
|
114
|
+
'volume_ls', 'volume_create',
|
|
115
|
+
'compose_up', 'compose_down', 'compose_ps', 'compose_logs'
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
container: { type: 'string', description: 'Container ID or name' },
|
|
119
|
+
image: { type: 'string', description: 'Docker image name (e.g., nginx:latest)' },
|
|
120
|
+
name: { type: 'string', description: 'Container or volume name' },
|
|
121
|
+
tag: { type: 'string', description: 'Image tag for build (e.g., myapp:v1)' },
|
|
122
|
+
ports: { type: 'array', items: { type: 'string' }, description: 'Port mappings (e.g., ["8080:80"])' },
|
|
123
|
+
env_vars: { type: 'array', items: { type: 'string' }, description: 'Environment vars (e.g., ["NODE_ENV=prod"])' },
|
|
124
|
+
volumes: { type: 'array', items: { type: 'string' }, description: 'Volume mounts (e.g., ["./data:/data"])' },
|
|
125
|
+
command: { type: 'string', description: 'Command to exec inside container' },
|
|
126
|
+
context: { type: 'string', description: 'Build context path (default: .)' },
|
|
127
|
+
file: { type: 'string', description: 'Dockerfile path' },
|
|
128
|
+
cwd: { type: 'string', description: 'Working directory for compose commands' },
|
|
129
|
+
tail: { type: 'number', description: 'Number of log lines to show' },
|
|
130
|
+
all: { type: 'boolean', description: 'Show all containers (including stopped)' },
|
|
131
|
+
force: { type: 'boolean', description: 'Force remove' },
|
|
132
|
+
build: { type: 'boolean', description: 'Rebuild images on compose up' }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "firebase",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Manage Firestore documents, Auth users, and Cloud Storage on Firebase.",
|
|
5
|
+
"author": "Praveen",
|
|
6
|
+
"category": "Databases & Backend",
|
|
7
|
+
"tags": [
|
|
8
|
+
"firebase",
|
|
9
|
+
"firestore",
|
|
10
|
+
"google",
|
|
11
|
+
"baas",
|
|
12
|
+
"auth"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
"tools": [
|
|
16
|
+
"tools/firebase.js"
|
|
17
|
+
],
|
|
18
|
+
"skills": [
|
|
19
|
+
"skills/firebase-manager.md"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Firebase Manager
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
This skill enables you to manage Firestore documents, Auth users, and Cloud Storage on Firebase.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. For Firestore operations, provide `collection` and `doc_id`. Documents are automatically converted to Firestore's internal format.
|
|
8
|
+
2. To write data, use `action: "set_doc"` with `data` as a plain JSON object. Nested objects and arrays are supported.
|
|
9
|
+
3. Auth operations require `FIREBASE_API_KEY`. Storage and Firestore may need `FIREBASE_TOKEN` or `GOOGLE_ACCESS_TOKEN`.
|
|
10
|
+
4. Storage uses the default bucket `<project-id>.appspot.com`. Override with the `bucket` parameter.
|
|
11
|
+
5. Required env vars: `FIREBASE_PROJECT_ID` (always), `FIREBASE_API_KEY` (for auth), `FIREBASE_TOKEN` (for authenticated operations).
|
|
12
|
+
|
|
13
|
+
## Input Variables
|
|
14
|
+
{{input}}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firebase automation tool.
|
|
3
|
+
* Provides Firestore CRUD, Auth management, and Storage via the Firebase REST API.
|
|
4
|
+
*/
|
|
5
|
+
export async function execute(params) {
|
|
6
|
+
const { action, ...args } = params;
|
|
7
|
+
const projectId = process.env.FIREBASE_PROJECT_ID;
|
|
8
|
+
const apiKey = process.env.FIREBASE_API_KEY;
|
|
9
|
+
|
|
10
|
+
if (!projectId) {
|
|
11
|
+
throw new Error('FIREBASE_PROJECT_ID environment variable is not set.');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const token = process.env.FIREBASE_TOKEN || process.env.GOOGLE_ACCESS_TOKEN;
|
|
15
|
+
|
|
16
|
+
async function firestoreFetch(method, path, body = null) {
|
|
17
|
+
const url = `https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents${path}`;
|
|
18
|
+
const headers = { 'Content-Type': 'application/json' };
|
|
19
|
+
if (token) headers['Authorization'] = `Bearer ${token}`;
|
|
20
|
+
if (apiKey) headers['x-goog-api-key'] = apiKey;
|
|
21
|
+
|
|
22
|
+
const options = { method, headers };
|
|
23
|
+
if (body) options.body = JSON.stringify(body);
|
|
24
|
+
|
|
25
|
+
const res = await fetch(url, options);
|
|
26
|
+
const data = await res.json();
|
|
27
|
+
if (!res.ok) throw new Error(`Firestore Error (${res.status}): ${JSON.stringify(data.error || data)}`);
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Convert JS object to Firestore Value format */
|
|
32
|
+
function toFirestoreValue(val) {
|
|
33
|
+
if (val === null) return { nullValue: null };
|
|
34
|
+
if (typeof val === 'string') return { stringValue: val };
|
|
35
|
+
if (typeof val === 'number') return Number.isInteger(val) ? { integerValue: String(val) } : { doubleValue: val };
|
|
36
|
+
if (typeof val === 'boolean') return { booleanValue: val };
|
|
37
|
+
if (Array.isArray(val)) return { arrayValue: { values: val.map(toFirestoreValue) } };
|
|
38
|
+
if (typeof val === 'object') {
|
|
39
|
+
const fields = {};
|
|
40
|
+
for (const [k, v] of Object.entries(val)) fields[k] = toFirestoreValue(v);
|
|
41
|
+
return { mapValue: { fields } };
|
|
42
|
+
}
|
|
43
|
+
return { stringValue: String(val) };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function toFirestoreFields(obj) {
|
|
47
|
+
const fields = {};
|
|
48
|
+
for (const [k, v] of Object.entries(obj)) fields[k] = toFirestoreValue(v);
|
|
49
|
+
return fields;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
switch (action) {
|
|
54
|
+
// --- FIRESTORE ---
|
|
55
|
+
case 'get_doc':
|
|
56
|
+
return await firestoreFetch('GET', `/${args.collection}/${args.doc_id}`);
|
|
57
|
+
|
|
58
|
+
case 'list_docs':
|
|
59
|
+
return await firestoreFetch('GET', `/${args.collection}?pageSize=${args.limit || 20}`);
|
|
60
|
+
|
|
61
|
+
case 'set_doc':
|
|
62
|
+
return await firestoreFetch('PATCH', `/${args.collection}/${args.doc_id}`, {
|
|
63
|
+
fields: toFirestoreFields(args.data || {})
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
case 'delete_doc':
|
|
67
|
+
return await firestoreFetch('DELETE', `/${args.collection}/${args.doc_id}`);
|
|
68
|
+
|
|
69
|
+
// --- AUTH (Identity Toolkit) ---
|
|
70
|
+
case 'list_users': {
|
|
71
|
+
if (!apiKey) throw new Error('FIREBASE_API_KEY required for auth operations');
|
|
72
|
+
const res = await fetch(
|
|
73
|
+
`https://identitytoolkit.googleapis.com/v1/projects/${projectId}/accounts:batchGet`,
|
|
74
|
+
{
|
|
75
|
+
method: 'POST',
|
|
76
|
+
headers: {
|
|
77
|
+
'Content-Type': 'application/json',
|
|
78
|
+
'Authorization': `Bearer ${token}`
|
|
79
|
+
},
|
|
80
|
+
body: JSON.stringify({ maxResults: args.limit || 20 })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
return await res.json();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
case 'create_user': {
|
|
87
|
+
if (!apiKey) throw new Error('FIREBASE_API_KEY required for auth operations');
|
|
88
|
+
const res = await fetch(
|
|
89
|
+
`https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${apiKey}`,
|
|
90
|
+
{
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: { 'Content-Type': 'application/json' },
|
|
93
|
+
body: JSON.stringify({
|
|
94
|
+
email: args.email,
|
|
95
|
+
password: args.password,
|
|
96
|
+
returnSecureToken: false
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
return await res.json();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// --- STORAGE ---
|
|
104
|
+
case 'list_files': {
|
|
105
|
+
const bucket = args.bucket || `${projectId}.appspot.com`;
|
|
106
|
+
const prefix = args.prefix ? `&prefix=${encodeURIComponent(args.prefix)}` : '';
|
|
107
|
+
const res = await fetch(
|
|
108
|
+
`https://storage.googleapis.com/storage/v1/b/${bucket}/o?maxResults=${args.limit || 20}${prefix}`,
|
|
109
|
+
{ headers: token ? { 'Authorization': `Bearer ${token}` } : {} }
|
|
110
|
+
);
|
|
111
|
+
return await res.json();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
case 'delete_file': {
|
|
115
|
+
const bucket = args.bucket || `${projectId}.appspot.com`;
|
|
116
|
+
const res = await fetch(
|
|
117
|
+
`https://storage.googleapis.com/storage/v1/b/${bucket}/o/${encodeURIComponent(args.path)}`,
|
|
118
|
+
{
|
|
119
|
+
method: 'DELETE',
|
|
120
|
+
headers: token ? { 'Authorization': `Bearer ${token}` } : {}
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
if (!res.ok) throw new Error(`Storage Error: ${res.status}`);
|
|
124
|
+
return { success: true };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
default:
|
|
128
|
+
throw new Error(`Unknown action: ${action}`);
|
|
129
|
+
}
|
|
130
|
+
} catch (err) {
|
|
131
|
+
return { error: err.message, stack: err.stack };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export const definition = {
|
|
136
|
+
name: 'firebase',
|
|
137
|
+
description: 'Manage Firestore docs, Auth users, and Cloud Storage on Firebase. Requires FIREBASE_PROJECT_ID.',
|
|
138
|
+
parameters: {
|
|
139
|
+
type: 'object',
|
|
140
|
+
required: ['action'],
|
|
141
|
+
properties: {
|
|
142
|
+
action: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
enum: ['get_doc', 'list_docs', 'set_doc', 'delete_doc', 'list_users', 'create_user', 'list_files', 'delete_file']
|
|
145
|
+
},
|
|
146
|
+
collection: { type: 'string', description: 'Firestore collection path' },
|
|
147
|
+
doc_id: { type: 'string', description: 'Document ID' },
|
|
148
|
+
data: { type: 'object', description: 'Document data for set_doc' },
|
|
149
|
+
email: { type: 'string', description: 'Email for user creation' },
|
|
150
|
+
password: { type: 'string', description: 'Password for user creation' },
|
|
151
|
+
bucket: { type: 'string', description: 'Storage bucket (default: <project>.appspot.com)' },
|
|
152
|
+
path: { type: 'string', description: 'File path in storage' },
|
|
153
|
+
prefix: { type: 'string', description: 'File prefix filter' },
|
|
154
|
+
limit: { type: 'number', description: 'Max results' }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "github",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Advanced GitHub automation: manage repositories, pull requests, advanced search, and CI/CD workflows.",
|
|
5
|
+
"author": "Praveen",
|
|
6
|
+
"category": "Git & Version Control",
|
|
7
|
+
"tags": [
|
|
8
|
+
"github",
|
|
9
|
+
"git",
|
|
10
|
+
"ci",
|
|
11
|
+
"vcs",
|
|
12
|
+
"actions",
|
|
13
|
+
"workflows"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"tools": [
|
|
17
|
+
"tools/github.js"
|
|
18
|
+
],
|
|
19
|
+
"skills": [
|
|
20
|
+
"skills/github-manager.md"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# GitHub Manager
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
This skill grants you the ability to interact with the GitHub API to manage repositories, search code globally, execute CI/CD workflows, and handle pull requests or issues.
|
|
5
|
+
|
|
6
|
+
## Instructions
|
|
7
|
+
1. When asked to perform GitHub operations, identify the appropriate `action` from the `github` tool.
|
|
8
|
+
2. Ensure you have the required parameters (`owner`, `repo`) extracted from the user's prompt or context.
|
|
9
|
+
3. If searching for code across a repository, construct advanced search queries. For example, to find usages of `express` in `praveencs87/agent`, use: `action: "search_code", query: "express repo:praveencs87/agent"`.
|
|
10
|
+
4. To dispatch a GitHub Action workflow, use `dispatch_workflow` and specify the `workflow_id` (either the numeric ID or the filename like `build.yml`). You can pass custom inputs if required.
|
|
11
|
+
5. If the user asks you to list or manage repos, issues, or PRs, fill out the corresponding title and body fields clearly.
|
|
12
|
+
6. The `github` tool requires `GITHUB_TOKEN` to be set in the environment. If the tool returns an error about authentication, inform the user they need to export it.
|
|
13
|
+
|
|
14
|
+
## Input Variables
|
|
15
|
+
{{input}}
|