diff --git a/.gitignore b/.gitignore index 30bf97c..12cf31f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,13 +5,13 @@ plugins/*/data/** !plugins/*/data/**/ !plugins/*/data/**/.gitkeep .env -.env.* -!.env.example -.bot details.md -*.db -*.db-* -*.sqlite -*.sqlite-* -npm-debug.log -security-audit-*.json -security-audit-*.md +.env.* +!.env.example +.bot details.md +*.db +*.db-* +*.sqlite +*.sqlite-* +npm-debug.log +security-audit-*.json +security-audit-*.md diff --git a/codex-guidelines b/codex-guidelines index 41d7968..db7b290 100644 --- a/codex-guidelines +++ b/codex-guidelines @@ -112,8 +112,11 @@ Plugins (important) - Plugins should avoid core edits unless explicitly requested - Plugins receive `webhooks` for raw-body inbound endpoint registration and outbound webhook sending. See `docs/webhooks.md`. -- `web.addAssistantPanel({ id, view, stylesheet?, script?, role?, isVisible?, locals? })` - contributes a role-filtered sidebar pill/global panel above the user footer. +- `web.addAssistantPanel({ id, view, stylesheet?, script?, role?, getAvailability?(user), version?, locals? })` + registers a dynamically mounted sidebar pill/global panel above the user footer. + `getAvailability` may be async and must return `{ available, status?, reason_code? }`. + The core polls `/api/assistant-panels`, renders HTML only for available panels, and + returns a cleanup function that plugins should call when unloading. Current notable plugins - echonomy-framework: diff --git a/plugins/auto-vc/index.js b/plugins/auto-vc/index.js index 4c67e29..fe65643 100644 --- a/plugins/auto-vc/index.js +++ b/plugins/auto-vc/index.js @@ -1453,4 +1453,4 @@ async function sweepRooms(discordClient, db, state) { clearEmpty(state, channel.id); } } -} +} diff --git a/plugins/auto-vc/plugin.json b/plugins/auto-vc/plugin.json index 50bae97..543b303 100644 --- a/plugins/auto-vc/plugin.json +++ b/plugins/auto-vc/plugin.json @@ -4,4 +4,4 @@ "version": "0.1.5", "description": "Auto-create managed voice channels from lobby rooms.", "main": "index.js" -} +} diff --git a/plugins/echonomy-framework/index.js b/plugins/echonomy-framework/index.js index f0dc716..bfc3960 100644 --- a/plugins/echonomy-framework/index.js +++ b/plugins/echonomy-framework/index.js @@ -1,4 +1,4 @@ - + const path = require("path"); const fs = require("fs"); const crypto = require("crypto"); @@ -276,7 +276,7 @@ module.exports = { message: "Currency settings updated." }; res.redirect(`/plugins/${PLUGIN_ID}`); - }); + }); router.post("/settings/platforms", (req, res) => { if (!req.session.user?.isAdmin) { @@ -1209,7 +1209,7 @@ function registerCommands({ db, settings, commandRouter }) { }; rebuild(); return rebuild; -} +} async function handleCoinsCommand({ ctx, db, settings }) { const config = getConfig(db); @@ -1770,7 +1770,7 @@ function findUserByInternalName(db, name) { "SELECT id, internal_username FROM user_profiles WHERE lower(internal_username) = lower(?)" ) .get(name); -} +} function ensureAccount(db, userId) { db.prepare( @@ -2359,4 +2359,4 @@ function getTwitchTierMultiplier(tags, config) { return config.tiers.twitchSub; } return 1; -} +} diff --git a/plugins/echonomy-framework/test.txt b/plugins/echonomy-framework/test.txt index 9766475..0aee968 100644 --- a/plugins/echonomy-framework/test.txt +++ b/plugins/echonomy-framework/test.txt @@ -1 +1 @@ -ok +ok diff --git a/plugins/echonomy-framework/views/echonomy.ejs b/plugins/echonomy-framework/views/echonomy.ejs index a2ba899..b085bdc 100644 --- a/plugins/echonomy-framework/views/echonomy.ejs +++ b/plugins/echonomy-framework/views/echonomy.ejs @@ -1,4 +1,4 @@ - + <%- include("../../../src/web/views/partials/layout-top", { title }) %>