File size: 5,757 Bytes
7d8aa82 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | <div align="center">
```
β² β²
βββββββ
ββββββββ
ββββββ
```
# SNAPKITTY BOT
### The SnapKitty fortress in your Discord server.
[](../LICENSE)
[](https://discord.gg/dugymT3rj)
[](https://www.typescriptlang.org)
[](https://prisma.io)
[](https://collectivekitty.com)
**[collectivekitty.com](https://collectivekitty.com) Β· [DEVFLOW-FINANCE](https://github.com/SNAPKITTYWEST/DEVFLOW-FINANCE) Β· [Invite Bot](https://discord.gg/dugymT3rj)**
</div>
---
## What This Is
SnapKitty Bot brings all 11 sovereign agents into Discord. Ask any agent a question, manage money pools, check your fundability tier, read the live Bifrost audit trail β all from slash commands.
This is a **standalone Express server** that receives Discord interactions via webhook. It connects to the same Neon PostgreSQL database as the main SnapKitty OS and routes `/ask` queries through the Ollama-powered reasoning engine at `collectivekitty.com`.
---
## Commands
| Command | What it does |
|---------|-------------|
| `/ask [agent] [message]` | Route any question to any of the 11 agents |
| `/pool create` | Create a named money pool |
| `/pool list` | See all active pools and balances |
| `/pool fund` | Add capital to a pool |
| `/pool close` | Archive a pool |
| `/tier` | Current fundability tier status and blockers |
| `/agents` | Full agent directory in plain English |
| `/status` | System health β Bifrost, DB, infrastructure |
| `/seal` | Last decision seal hash |
| `/audit` | Last 5 Bifrost events with risk scores |
| `/merkle` | Merkle root and WORM chain entry count |
---
## The 11 Agents
| Agent | Key | Domain |
|-------|-----|--------|
| **RELAY** | `bridge` | Human-Machine Bridge β start here |
| **AXIOM** | `finance` | GL Β· Triple-Entry Β· Money Pools |
| **VAULT** | `treasury` | Reserves Β· Payments Β· **Veto authority** |
| **NEXUS** | `crm` | Pipeline Β· Deals Β· Forecast |
| **FORGE** | `procurement` | Vendors Β· POs Β· Spend |
| **HERALD** | `bifrost` | Event Routing Β· Traces |
| **TENSOR** | `ml` | Risk Scoring Β· Anomaly Detection |
| **SENTINEL** | `risk` | Compliance Β· Threat Score |
| **LEDGE** | `auditor` | WORM Ledger Β· Audit Chain |
| **ATLAS** | `operator` | Health Β· **Tier gate authority** |
| **QUILL** | `scriptwriter` | Reports Β· Decks Β· Copy |
---
## Setup
### 1. Clone and install
```bash
git clone https://github.com/SNAPKITTYWEST/myapplication.git
cd myapplication
npm install
npx prisma generate
```
### 2. Configure environment
```bash
cp .env.example .env
```
Fill in `.env`:
```env
DISCORD_PUBLIC_KEY= # from Discord Developer Portal β your app β General Information
DISCORD_APP_ID= # same page
DISCORD_BOT_TOKEN= # Bot β Token
DATABASE_URL= # Neon PostgreSQL connection string
SNAPKITTY_API_URL=https://collectivekitty.com
PORT=3001
```
### 3. Register slash commands (once)
```bash
npm run register
```
### 4. Run the bot
```bash
# Development
npm run dev
# Production
npm run build && npm start
```
### 5. Connect to Discord
In the [Discord Developer Portal](https://discord.com/developers/applications):
- Go to **General Information** β set **Interactions Endpoint URL** to your server:
```
https://your-domain.com/interactions
```
- Discord will verify the endpoint with a PING. If it responds with PONG, you're live.
For local development, use [ngrok](https://ngrok.com) or [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) to expose `localhost:3001`.
---
## Architecture
```
Discord β POST /interactions
β
βββ verifyKey() β Ed25519 signature validation
β
βββ /ask β askAgent() β Ollama at collectivekitty.com β reply
βββ /pool β Prisma β Neon PostgreSQL β reply
βββ /tier β Prisma β live deal/vendor/pool counts β reply
βββ /status β Prisma β Bifrost event counts β reply
βββ /seal β Prisma β last BifrostEvent β reply
βββ /audit β Prisma β last 5 BifrostEvents β reply
```
The bot validates every Discord request with Ed25519 before processing. Unauthenticated requests are rejected with 401.
---
## Part of the SnapKitty Fortress
This bot is the **Discord interface layer** of the SnapKitty Sovereign OS.
The full system lives in [DEVFLOW-FINANCE](https://github.com/SNAPKITTYWEST/DEVFLOW-FINANCE):
- Rust core with SHA-256 WORM ledger and 5-tier state machine
- Next.js War Room where agents think out loud in real time
- Bifrost event pipeline, Plaid banking, Stripe Issuing
- Local Ollama LLM reasoning (no OpenAI dependency)
---
<div align="center">
*SnapKitty Sovereign OS β built in the open, proven in chain.*
**[collectivekitty.com](https://collectivekitty.com) Β· [DEVFLOW-FINANCE](https://github.com/SNAPKITTYWEST/DEVFLOW-FINANCE) Β· [Discord](https://discord.gg/dugymT3rj)**
</div>

|