{"_id":"@agentkitai/agentgate-slack","name":"@agentkitai/agentgate-slack","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@agentkitai/agentgate-slack","version":"0.0.1","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"@slack/bolt":"^4.1.0","@slack/types":"^2.19.0","dotenv":"^16.4.5","@agentkitai/agentgate-core":"0.1.0"},"devDependencies":{"@types/node":"^22.10.2","@vitest/coverage-v8":"^3.2.6","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-slack@0.0.1","description":"Slack bot integration for AgentGate human approvals.","_integrity":"sha512-rjdwlHCuRyI/9yr8SQ1U9UZaxkZwEXgiD2M/HOors89BhVUe8Q5H0B1rsJP0aW9Vrgg4XZpCNUIxQcVbgEeiOg==","_resolved":"C:\\Users\\amitp\\AppData\\Local\\Temp\\74c4bc9d727f0f91d0e077c58866322f\\agentkitai-agentgate-slack-0.0.1.tgz","_from":"file:agentkitai-agentgate-slack-0.0.1.tgz","_nodeVersion":"24.12.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-rjdwlHCuRyI/9yr8SQ1U9UZaxkZwEXgiD2M/HOors89BhVUe8Q5H0B1rsJP0aW9Vrgg4XZpCNUIxQcVbgEeiOg==","shasum":"8eeccf03c0688916c9b918c5e801bbafe1c04616","tarball":"https://registry.npmjs.org/@agentkitai/agentgate-slack/-/agentgate-slack-0.0.1.tgz","fileCount":15,"unpackedSize":34632,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCBQCo2I+5+G/ilA6WNNxgrvPjmurJqe+20nVazIZ7ilwIhAOVGYZEyB41SLqy8EUcxvmaRzS9QKmT+7hHGogxjZTo3"}]},"_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-slack_0.0.1_1782494687178_0.6432226646583523"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-26T17:24:47.034Z","0.0.1":"2026-06-26T17:24:47.332Z","modified":"2026-06-26T17:24:47.596Z"},"maintainers":[{"name":"amit-paz","email":"amit.paz@gmail.com"}],"description":"Slack bot integration for AgentGate human approvals.","readme":"# @agentkitai/agentgate-slack\r\n\r\nSlack bot integration for AgentGate human approvals.\r\n\r\n## Features\r\n\r\n- 🔔 Sends formatted approval request messages with Block Kit\r\n- ✅ Interactive Approve/Deny buttons\r\n- 🔄 Updates messages after decision\r\n- 📦 Can be used as a library or standalone service\r\n\r\n## Installation\r\n\r\n```bash\r\npnpm add @agentkitai/agentgate-slack\r\n```\r\n\r\n## Slack App Setup\r\n\r\n### 1. Create a Slack App\r\n\r\n1. Go to [api.slack.com/apps](https://api.slack.com/apps)\r\n2. Click **Create New App** → **From scratch**\r\n3. Name it (e.g., \"AgentGate Approvals\") and select your workspace\r\n\r\n### 2. Configure Bot Scopes\r\n\r\nNavigate to **OAuth & Permissions** and add these Bot Token Scopes:\r\n\r\n- `chat:write` - Send messages\r\n- `chat:write.public` - Send to channels the bot isn't a member of\r\n- `commands` - (Optional) For future slash commands\r\n\r\n### 3. Enable Interactivity\r\n\r\nNavigate to **Interactivity & Shortcuts**:\r\n\r\n1. Toggle **Interactivity** to **On**\r\n2. Set **Request URL** to your bot's URL:\r\n   - For local development with ngrok: `https://your-ngrok-url.ngrok.io/slack/events`\r\n   - For production: `https://your-server.com/slack/events`\r\n\r\n### 4. Install to Workspace\r\n\r\n1. Go to **Install App** in the sidebar\r\n2. Click **Install to Workspace**\r\n3. Authorize the requested permissions\r\n\r\n### 5. Get Credentials\r\n\r\nAfter installation, you'll need:\r\n\r\n- **Bot Token** (`xoxb-...`) - Found in **OAuth & Permissions**\r\n- **Signing Secret** - Found in **Basic Information** → **App Credentials**\r\n\r\n## Usage\r\n\r\n### As a Library\r\n\r\n```typescript\r\nimport { createSlackBot } from '@agentkitai/agentgate-slack';\r\n\r\nconst bot = createSlackBot({\r\n  token: process.env.SLACK_BOT_TOKEN!,\r\n  signingSecret: process.env.SLACK_SIGNING_SECRET!,\r\n  agentgateUrl: 'http://localhost:3000',\r\n  defaultChannel: '#approvals',\r\n  port: 3001,\r\n});\r\n\r\nawait bot.start();\r\n\r\n// Send an approval request\r\nawait bot.sendApprovalRequest(request, '#approvals');\r\n```\r\n\r\n### Standalone Service\r\n\r\nSet environment variables and run:\r\n\r\n```bash\r\n# Required\r\nexport SLACK_BOT_TOKEN=xoxb-your-token\r\nexport SLACK_SIGNING_SECRET=your-signing-secret\r\n\r\n# Optional\r\nexport AGENTGATE_URL=http://localhost:3000  # default\r\nexport AGENTGATE_API_KEY=your-api-key       # recommended for authenticated API calls\r\nexport SLACK_BOT_PORT=3001                  # default\r\nexport SLACK_DEFAULT_CHANNEL=#approvals\r\n\r\n# Run\r\npnpm start\r\n```\r\n\r\nOr with a `.env` file:\r\n\r\n```env\r\nSLACK_BOT_TOKEN=xoxb-your-token\r\nSLACK_SIGNING_SECRET=your-signing-secret\r\nAGENTGATE_URL=http://localhost:3000\r\nAGENTGATE_API_KEY=your-api-key\r\nSLACK_BOT_PORT=3001\r\nSLACK_DEFAULT_CHANNEL=#approvals\r\n```\r\n\r\n## Environment Variables\r\n\r\n| Variable | Required | Default | Description |\r\n|----------|----------|---------|-------------|\r\n| `SLACK_BOT_TOKEN` | Yes | - | Slack bot token (xoxb-...) |\r\n| `SLACK_SIGNING_SECRET` | Yes | - | Slack app signing secret |\r\n| `AGENTGATE_URL` | No | `http://localhost:3000` | AgentGate server URL |\r\n| `AGENTGATE_API_KEY` | Recommended | - | API key for AgentGate API authentication |\r\n| `SLACK_BOT_PORT` | No | `3001` | Port for the bot to listen on |\r\n| `SLACK_DEFAULT_CHANNEL` | No | - | Default channel for notifications |\r\n\r\n## Message Format\r\n\r\nApproval requests are formatted using Slack Block Kit:\r\n\r\n```\r\n🔔 Approval Request\r\n━━━━━━━━━━━━━━━━━━━━\r\nAction: send_email\r\nUrgency: 🟡 normal\r\nRequest ID: req_123abc\r\nCreated: 2024-01-15T10:30:00Z\r\n\r\nParameters:\r\n{\r\n  \"to\": \"user@example.com\",\r\n  \"subject\": \"Hello\"\r\n}\r\n\r\n📋 Context: {\"agent\": \"email-agent\"}\r\n━━━━━━━━━━━━━━━━━━━━\r\n[✅ Approve] [❌ Deny]\r\n[🔗 Approve (one-click)] [🔗 Deny (one-click)]\r\n⏰ One-click links expire: 2024-01-16T10:30:00Z\r\n```\r\n\r\nThe message includes two types of buttons:\r\n- **Interactive buttons**: Work with the Slack bot to approve/deny via the API\r\n- **One-click link buttons**: Open in browser for direct approval/denial (useful for mobile or when bot is unavailable)\r\n\r\nAfter a decision, the message updates to show:\r\n\r\n```\r\n✅ Request Approved\r\n━━━━━━━━━━━━━━━━━━━━\r\nAction: send_email\r\nDecision: Approved by @username\r\n```\r\n\r\n## API Integration\r\n\r\nThe bot communicates with AgentGate server via:\r\n\r\n```\r\nPOST /api/requests/:id/decide\r\n{\r\n  \"decision\": \"approved\" | \"denied\",\r\n  \"decidedBy\": \"slack_user_id\"\r\n}\r\n```\r\n\r\n## Local Development\r\n\r\nFor local development, use [ngrok](https://ngrok.com/) to expose your bot:\r\n\r\n```bash\r\n# Terminal 1: Start the bot\r\npnpm dev\r\n\r\n# Terminal 2: Expose with ngrok\r\nngrok http 3001\r\n```\r\n\r\nThen update your Slack app's Request URL with the ngrok URL.\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","_rev":"1-09a06340f1cdee235d46826fec1d279c"}