{"_id":"@agentkitai/agentgate-discord","name":"@agentkitai/agentgate-discord","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.3":{"name":"@agentkitai/agentgate-discord","version":"0.0.3","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"discord.js":"^14.14.1","dotenv":"^16.4.5","@agentkitai/agentgate-core":"0.1.0"},"devDependencies":{"@types/node":"^22.10.2","tsx":"^4.19.2","vitest":"^3.2.6"},"scripts":{"build":"tsc","dev":"tsx watch src/index.ts","start":"node dist/index.js","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"_id":"@agentkitai/agentgate-discord@0.0.3","description":"Discord bot integration for AgentGate - receive approval requests and make decisions directly from Discord.","_integrity":"sha512-5srsOLRhvL+O6XGZ3enjZAvn41lQ0tP7CfF0k2dYx9wWoh0ZRSUsLwtHEavoNsN/muC/M7+Ct5JXMcsb79vyUQ==","_resolved":"C:\\Users\\amitp\\AppData\\Local\\Temp\\94055de9aad1b6e335f1cf45727b6959\\agentkitai-agentgate-discord-0.0.3.tgz","_from":"file:agentkitai-agentgate-discord-0.0.3.tgz","_nodeVersion":"24.12.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-5srsOLRhvL+O6XGZ3enjZAvn41lQ0tP7CfF0k2dYx9wWoh0ZRSUsLwtHEavoNsN/muC/M7+Ct5JXMcsb79vyUQ==","shasum":"e39d5575540aa97783c522542351f447b57cdfa4","tarball":"https://registry.npmjs.org/@agentkitai/agentgate-discord/-/agentgate-discord-0.0.3.tgz","fileCount":15,"unpackedSize":35707,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHR4FLtQS8prqszQEfoXx+CCWVM64EbFdcEgd3O8ADCAAiAHWsSb7J0I3YpG2eOSX1LS/yZASyhcCYHZ/VwY1GQgog=="}]},"_npmUser":{"name":"amit-paz","email":"amit.paz@gmail.com"},"directories":{},"maintainers":[{"name":"amit-paz","email":"amit.paz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agentgate-discord_0.0.3_1782494674517_0.6685283702958009"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-26T17:24:34.369Z","0.0.3":"2026-06-26T17:24:34.672Z","modified":"2026-06-26T17:24:34.879Z"},"maintainers":[{"name":"amit-paz","email":"amit.paz@gmail.com"}],"description":"Discord bot integration for AgentGate - receive approval requests and make decisions directly from Discord.","readme":"# @agentkitai/agentgate-discord\r\n\r\nDiscord bot integration for AgentGate - receive approval requests and make decisions directly from Discord.\r\n\r\n## Features\r\n\r\n- 📬 Rich embeds for approval requests with all details\r\n- 🔗 One-click approve/deny links (no authentication required)\r\n- 🔘 Interactive buttons for approve/deny (requires bot interaction)\r\n- ⚡ Real-time updates when decisions are made\r\n- 🎨 Color-coded urgency levels\r\n\r\n## Installation\r\n\r\n```bash\r\npnpm add @agentkitai/agentgate-discord\r\n# or\r\nnpm install @agentkitai/agentgate-discord\r\n```\r\n\r\n## Configuration\r\n\r\nSet the following environment variables:\r\n\r\n| Variable | Required | Description |\r\n|----------|----------|-------------|\r\n| `DISCORD_BOT_TOKEN` | ✅ | Discord bot token (from Discord Developer Portal) |\r\n| `AGENTGATE_URL` | ❌ | AgentGate server URL (default: `http://localhost:3000`) |\r\n| `DISCORD_CHANNEL_ID` | ❌ | Default channel ID for notifications |\r\n| `DISCORD_INCLUDE_LINKS` | ❌ | Include one-click links (default: `true`) |\r\n\r\n## Usage\r\n\r\n### Standalone Mode\r\n\r\nRun the bot as a standalone service:\r\n\r\n```bash\r\n# With environment variables\r\nDISCORD_BOT_TOKEN=your-token AGENTGATE_URL=http://localhost:3000 pnpm start\r\n\r\n# Or with .env file\r\npnpm start\r\n```\r\n\r\n### Programmatic Usage\r\n\r\n```typescript\r\nimport { createDiscordBot } from '@agentkitai/agentgate-discord';\r\n\r\nconst bot = createDiscordBot({\r\n  token: process.env.DISCORD_BOT_TOKEN!,\r\n  agentgateUrl: 'http://localhost:3000',\r\n  defaultChannelId: '123456789012345678',\r\n  includeDecisionLinks: true,\r\n});\r\n\r\nawait bot.start();\r\n\r\n// Send an approval request to a specific channel\r\nconst messageId = await bot.sendApprovalRequest(\r\n  {\r\n    id: 'req-123',\r\n    action: 'delete_file',\r\n    params: { path: '/important/file.txt' },\r\n    context: { user: 'agent-1' },\r\n    urgency: 'high',\r\n    status: 'pending',\r\n    createdAt: new Date(),\r\n    updatedAt: new Date(),\r\n  },\r\n  '987654321098765432'\r\n);\r\n\r\n// Graceful shutdown\r\nprocess.on('SIGINT', () => bot.stop());\r\n```\r\n\r\n## Discord Bot Setup\r\n\r\n1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)\r\n2. Create a new application\r\n3. Go to \"Bot\" section and create a bot\r\n4. Copy the bot token\r\n5. Enable the required intents (Message Content is optional)\r\n6. Go to \"OAuth2\" → \"URL Generator\"\r\n7. Select scopes: `bot`, `applications.commands`\r\n8. Select permissions: `Send Messages`, `Embed Links`, `Use External Emojis`\r\n9. Use the generated URL to invite the bot to your server\r\n\r\n## Message Format\r\n\r\nThe bot sends rich embeds with:\r\n\r\n- **Action**: The requested action name\r\n- **Urgency**: Color-coded urgency level (🔴 Critical, 🟠 High, 🟡 Normal, 🟢 Low)\r\n- **Request ID**: Unique identifier\r\n- **Parameters**: JSON-formatted parameters (if any)\r\n- **Context**: Additional context (if any)\r\n- **One-Click Links**: Direct approve/deny URLs (if enabled)\r\n\r\nInteractive buttons allow users to approve or deny directly from Discord.\r\n\r\n## Integration with AgentGate Server\r\n\r\nThe bot integrates with AgentGate's notification system. Configure the server to send notifications to Discord:\r\n\r\n```bash\r\n# Server environment variables\r\nDISCORD_BOT_TOKEN=your-token\r\nDISCORD_DEFAULT_CHANNEL=123456789012345678\r\nCHANNEL_ROUTES='[{\"channel\":\"discord\",\"target\":\"123456789012345678\",\"enabled\":true}]'\r\n```\r\n\r\n## API\r\n\r\n### `createDiscordBot(options)`\r\n\r\nCreates a new Discord bot instance.\r\n\r\n**Options:**\r\n- `token` (string, required): Discord bot token\r\n- `agentgateUrl` (string, required): AgentGate server URL\r\n- `defaultChannelId` (string, optional): Default channel for notifications\r\n- `includeDecisionLinks` (boolean, optional): Include one-click links (default: true)\r\n\r\n**Returns:** `DiscordBot` instance\r\n\r\n### `DiscordBot`\r\n\r\n- `client`: The underlying Discord.js Client\r\n- `start()`: Start the bot\r\n- `stop()`: Stop the bot\r\n- `sendApprovalRequest(request, channelId, options?)`: Send an approval request\r\n\r\n### Helper Functions\r\n\r\n```typescript\r\nimport {\r\n  buildApprovalEmbed,\r\n  buildDecidedEmbed,\r\n  buildActionRow,\r\n  getUrgencyEmoji,\r\n  getUrgencyColor,\r\n  EMBED_COLORS,\r\n} from '@agentkitai/agentgate-discord';\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","_rev":"1-4f43002121bd64255067679d7983171c"}