From 03ba640b57defa9e5dc708483a659e125e0f629d Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Wed, 19 Aug 2026 18:28:52 -0400 Subject: [PATCH] open files for discord bot --- developer-guide/21-discord-bots.md | 5 +- kernel/bin/discord-bot | 1035 ++++++++++++++++- kernel/share/man/man.json | 2 +- .../bare-os-discord-commands-guest.cjs | 144 ++- .../bare-os-booter/test.bare-discord-initd.js | 141 +++ packages/bare-os-coreutils/CHANGELOG.md | 2 +- .../man/pages/discord-bot.json | 2 +- packages/bare-os-coreutils/src/discord-bot.js | 2 +- .../bare-os-seeder/kernel/bin/discord-bot | 1035 ++++++++++++++++- .../bare-os-seeder/kernel/share/man/man.json | 2 +- 10 files changed, 2253 insertions(+), 117 deletions(-) diff --git a/developer-guide/21-discord-bots.md b/developer-guide/21-discord-bots.md index 27619694..1636f3e9 100644 --- a/developer-guide/21-discord-bots.md +++ b/developer-guide/21-discord-bots.md @@ -335,6 +335,7 @@ discord-bot --help | `/edit` | `path` | Modal editor for `~/` and `/tmp` (≤20 000 chars, 5 fields). Save writes via VFS | | `/create` | `path` | Create a **new** file: path autocomplete, select menu, or custom path, then a contents modal. Refuses to overwrite (offers `/edit`) | | `/upload` | `file` **(required)**, optional `path` | Attach a file (Discord CDN). The bot then runs guest **`wget -O dest URL`** into the **`/r` cwd** (or `path` if given: a directory gets `path/filename`, a file path is `-O`). Writable trees only (`~/`, `/tmp`). 60s timeout. If `BARE_OS_HTTP_ALLOWLIST` is set, include `cdn.discordapp.com` and `media.discordapp.net` | +| `/open-file` | `path` **(required)** | Read a VFS file and post it as a Discord **attachment** (uploaded to the Discord CDN). The reply is **not** idle-deleted, so the CDN URL stays. Same read path rules as `/fs` (`~/`, `/tmp`, `/home`, `/proc`, `/etc`, `/var/log`, `/run`, `/share`, `/mnt`; no `..`; token files blocked). Relative names resolve against the `/r` cwd. Max **10 MiB**. Directories and empty files are refused. | | `/hdms` | `list` `help` `health` `hints` `show` `create` `add` `remove` `invite` `pair` | Full Hyperdrive manager (`ctx.runHdms` / `/bin/hdms`). Default **list** is an interactive HUD: pick a drive, show, browse `/mnt/