@skyphusion/sidvicious-exe 0.2.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 ADDED
@@ -0,0 +1,230 @@
1
+ # SidVicious_exe
2
+
3
+ ![SidVicious_exe](assets/banner.svg)
4
+
5
+ **SidVicious_exe** is a punk rock Discord roadie for web search and image generation. Talk to it naturally, ask it to look stuff up, or crank out visuals. Everything runs on the unified Cloudflare API.
6
+
7
+ > Brand kit: the square mark lives at [`assets/avatar.svg`](assets/avatar.svg); the header above is [`assets/banner.svg`](assets/banner.svg). Both are hand-authored, dependency-free SVG (the editable source). For direct upload to Discord (which needs raster), use [`assets/avatar.png`](assets/avatar.png) as the application icon and [`assets/banner.png`](assets/banner.png) for the header.
8
+
9
+ The punk personality is intentional. It reflects the author's view of how a good AI roadie should act: direct, honest, useful, and free of corporate sycophancy. No "I'd be happy to help!", no filler, no talking down to people. Just someone with attitude who actually delivers.
10
+
11
+ We call it a roadie, not a bot. A bot is a vending machine; this is a collaborator with a job to do.
12
+
13
+ ---
14
+
15
+ ## Features
16
+
17
+ - **Punk rock roadie personality** -- raw, direct, irreverent. Helpful underneath the leather jacket.
18
+ - **Claude via Cloudflare** -- Anthropic SDK pointed at the AI Gateway native Anthropic path (`gateway.ai.cloudflare.com/v1/{account}/{gateway}/anthropic`); ollama fallback when `CF_API_TOKEN` is unset
19
+ - **Vision input** -- paste images into the channel; Claude reads them (up to 3 per message, 4 MB each)
20
+ - **Web search + deep research** -- Brave Search, Tavily, and Cloudflare Browser Rendering via the search Worker
21
+ - **Knowledge base** -- `!learn <text or URL>` indexes references into Vectorize
22
+ - **Image generation** -- Workers AI (FLUX, Phoenix, SDXL) and AI Gateway models (GPT Image, Recraft, and more) via `/ai/run`
23
+ - **D1 session state** -- conversation history persists across restarts (optional)
24
+ - **Slash commands** -- `/image`, `/model`, `/learn`, `/reset`
25
+
26
+ ---
27
+
28
+ ## Architecture
29
+
30
+ ```
31
+ Discord channel
32
+ |
33
+ bot.mjs
34
+ |
35
+ +-- gateway.ai.cloudflare.com/v1/{id}/{gateway}/anthropic
36
+ | --> Claude (anthropic/claude-sonnet-4-6)
37
+ |
38
+ +-- api.cloudflare.com/client/v4/accounts/{id}/ai/run
39
+ | --> Workers AI + Gateway image models
40
+ |
41
+ +-- D1 (optional) session history
42
+ |
43
+ +-- sidvicious-search Worker (optional)
44
+ web_search, research, fetch_page, knowledge
45
+
46
+ Chat routes through the AI Gateway (gateway id: skyphusion-llm); one CF_API_TOKEN covers it all.
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Install from npm (no clone needed)
52
+
53
+ ```bash
54
+ npx @skyphusion/sidvicious-exe # or: npm i -g @skyphusion/sidvicious-exe && sidvicious
55
+ ```
56
+
57
+ The package ships the roadie only (`bot.mjs` + `lib/`); configure it with the same env vars
58
+ as below (`.env` in the working directory is honored). **What is NOT on npm:** the
59
+ `search-worker/` Cloudflare Worker -- deploy that from this repo with wrangler and point
60
+ `SEARCH_WORKER_URL` at it (search/knowledge tools stay off without it, everything else
61
+ works). For a long-running deployment prefer the Docker stack below. Behavior contract:
62
+ [docs/BEHAVIOR.md](docs/BEHAVIOR.md); pre-release manual checklist: [docs/SMOKE.md](docs/SMOKE.md).
63
+
64
+ ## Setup
65
+
66
+ ### 1. Discord application
67
+
68
+ Create an application at the [Discord Developer Portal](https://discord.com/developers/applications):
69
+
70
+ - Privileged Gateway Intents: **MESSAGE CONTENT** on
71
+ - OAuth2 scopes: `bot`, `applications.commands` (Discord's terminology for app integrations)
72
+ - Permissions: Send Messages, Read Message History, Attach Files
73
+
74
+ ### 2. Cloudflare credentials
75
+
76
+ ```bash
77
+ wrangler whoami # copy account id -> CF_ACCOUNT_ID
78
+ wrangler auth token # copy token -> CF_API_TOKEN
79
+ ```
80
+
81
+ Your API token needs **AI Gateway** permission. Add **D1 Edit** if you want session persistence.
82
+
83
+ Create a D1 database (optional):
84
+
85
+ ```bash
86
+ wrangler d1 create sidvicious-sessions # copy id -> CF_D1_DATABASE_ID
87
+ ```
88
+
89
+ ### 3. Run the roadie
90
+
91
+ ```bash
92
+ cp .env.example .env # fill in DISCORD_TOKEN, CF_ACCOUNT_ID, CF_API_TOKEN
93
+ npm install
94
+ npm run roadie
95
+ ```
96
+
97
+ That's it for chat + images. The default gateway name is `skyphusion-llm`.
98
+
99
+ ### 4. Search worker (optional)
100
+
101
+ ```bash
102
+ cd search-worker && npm install
103
+ npx wrangler vectorize create sidvicious-knowledge --dimensions=1024 --metric=cosine
104
+ npx wrangler secret put BRAVE_API_KEY
105
+ npx wrangler secret put TAVILY_API_KEY
106
+ npx wrangler secret put SEARCH_SECRET
107
+ npm run deploy
108
+ ```
109
+
110
+ Add `SEARCH_WORKER_URL` and `SEARCH_SECRET` to your `.env`.
111
+
112
+ ---
113
+
114
+ ## Deployment
115
+
116
+ Two supported paths: a bind-mount Compose stack (the house pattern on a Docker host) and a
117
+ self-contained Docker image.
118
+
119
+ ### Compose stack (Docker host, bind-mount)
120
+
121
+ The stack runs `node:24` against the repo bind-mounted at `/app`, doing `npm ci` then
122
+ `node bot.mjs` on every start. Env is wired from `stacks/.env`.
123
+
124
+ ```bash
125
+ # one-time: clone + secrets on the deploy host
126
+ ssh <deploy-user>@<deploy-host> "
127
+ cd ~/dev && git clone git@github.com:SkyPhusion/SidVicious_exe.git
128
+ cp ~/dev/SidVicious_exe/.env.example ~/dev/SidVicious_exe/stacks/.env # then fill it in
129
+ "
130
+
131
+ # deploy / redeploy after code changes
132
+ rsync -az <repo-checkout>/ <deploy-user>@<deploy-host>:~/dev/SidVicious_exe/ \
133
+ --exclude node_modules --exclude .git --exclude stacks/.env --exclude .env
134
+ ssh <deploy-user>@<deploy-host> "cd ~/dev/SidVicious_exe/stacks && docker compose -p sidvicious -f compose.prod.yml up -d --force-recreate sidvicious"
135
+
136
+ # logs
137
+ ssh <deploy-user>@<deploy-host> "docker compose -p sidvicious -f ~/dev/SidVicious_exe/stacks/compose.prod.yml logs -f"
138
+ ```
139
+
140
+ The deploy, redeploy, and logs commands are also kept in the header of `stacks/compose.prod.yml`.
141
+
142
+ ### Standalone image (Dockerfile)
143
+
144
+ For a buildable, portable image (no repo bind-mount), use the included `Dockerfile`
145
+ (`node:24-slim`, runtime deps only, non-root `node` user):
146
+
147
+ ```bash
148
+ cp .env.example stacks/.env # fill in values
149
+ docker build -t sidvicious .
150
+ docker run -d --name sidvicious --restart unless-stopped --env-file stacks/.env sidvicious
151
+ docker logs -f sidvicious
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Environment variables
157
+
158
+ | Variable | Required | Description |
159
+ |----------|----------|-------------|
160
+ | `DISCORD_TOKEN` | yes | Discord application token |
161
+ | `CF_ACCOUNT_ID` | yes* | Cloudflare account ID |
162
+ | `CF_API_TOKEN` | yes* | API token (alias: `CF_AIG_TOKEN`) |
163
+ | `CF_AIG_GATEWAY_ID` | no | Gateway name (default: `skyphusion-llm`) |
164
+ | `DISCORD_MODEL` | no | Chat model (default: `anthropic/claude-sonnet-4-6`) |
165
+ | `DISCORD_CHANNEL_IDS` | no | Channels to listen in (empty = DMs + @mentions) |
166
+ | `CF_D1_DATABASE_ID` | no | D1 database for session persistence |
167
+ | `SEARCH_WORKER_URL` | no | Search Worker URL |
168
+ | `SEARCH_SECRET` | no | Search Worker auth secret |
169
+
170
+ \* Omit both `CF_API_TOKEN` and `CF_ACCOUNT_ID` to use ollama instead (chat only, no images).
171
+
172
+ ---
173
+
174
+ ## Commands
175
+
176
+ | Command | Slash | Description |
177
+ |---------|-------|-------------|
178
+ | `!image <prompt>` | `/image` | Generate an image |
179
+ | `!model [name]` | `/model` | List or switch image model |
180
+ | `!learn <text or URL>` | `/learn` | Index into knowledge base |
181
+ | `!reset` | `/reset` | Clear conversation history |
182
+
183
+ **Image model aliases:** `flux-schnell`, `flux2-fast`, `flux2`, `flux2-dev`, `phoenix`, `lucid`, `dreamshaper`, `sdxl`, `gpt-image`, `recraft`, `nano-banana`
184
+
185
+ ---
186
+
187
+ ## Ollama fallback
188
+
189
+ 1. Omit `CF_API_TOKEN`.
190
+ 2. Set `OLLAMA_BASE_URL` and `DISCORD_MODEL` (e.g. `qwen3:8b`).
191
+
192
+ Tool use (search, image gen) requires the Cloudflare backend.
193
+
194
+ ## Credits
195
+
196
+ **Conrad Rockenhaus** ([SkyPhusion](https://github.com/SkyPhusion)) -- direction and wiring. SidVicious_exe is forked from [Slate](https://github.com/skyphusion-labs/slate), with the film/render features stripped out and a punk-rock personality added.
197
+
198
+ **Claude Sonnet 4.6** (Anthropic) -- operating as *Strummer*, SkyPhusion's AI crew member. Built the shared chat-and-search foundation this fork inherits: CF AI Gateway integration (native Anthropic SDK path), the Anthropic tool-use loop, the Brave + Tavily + CF Browser Rendering search pipeline, the Cloudflare Vectorize knowledge base, Discord vision input, the slash command system, and D1 session persistence. SidVicious_exe keeps that core (chat, image generation, web search, and the knowledge base) and drops the Vivijure-specific pieces. This project is an example of the SkyPhusion AI-collaborative development model -- human vision, AI execution, shipped together.
199
+
200
+ ---
201
+
202
+ ## Who this is for
203
+
204
+ Discord communities that want a punk-rock AI collaborator (search, images, knowledge base) without the corporate tone. Self-host on Cloudflare; bring your own keys.
205
+
206
+ ## Links
207
+
208
+ - **Forked from:** [slate](https://github.com/skyphusion-labs/slate) (film stack stripped out)
209
+ - **Skyphusion Labs:** https://skyphusion.org · **Org:** https://github.com/skyphusion-labs
210
+ - **Related:** [prism](https://github.com/skyphusion-labs/prism) (multimodal playground)
211
+
212
+ ## Contributing
213
+
214
+ Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the development
215
+ setup, code style (no em-dashes; minimal dependencies), and the PR workflow. Security reports go
216
+ through [SECURITY.md](SECURITY.md), not public issues.
217
+
218
+ ---
219
+
220
+ ## Using SidVicious_exe (Terms & Privacy)
221
+
222
+ SidVicious_exe is a Discord application that reads message content in the channels it joins. By using it you
223
+ agree to the [Terms of Service](TERMS.md); how it handles your data (and the third-party services
224
+ involved) is described in the [Privacy Policy](PRIVACY.md).
225
+
226
+ ---
227
+
228
+ ## License
229
+
230
+ AGPL-3.0. See [LICENSE](LICENSE).