v0.0.32: system bots config — persist across data wipes, welcome screen
Server: - --bots-config <path> loads JSON array of system bots on startup - Bots auto-created if missing, aliases restored on every start - Bot list stored in DB for welcome screen (system:bot_list key) - GET /v1/bot/list returns system bots (public, no auth) Welcome screen: - Web + TUI show available bots on first login - "Available bots: @helpbot — featherChat help, @codebot — Coding..." - Clickable in web (via address detection) Config: bots.example.json with 10 suggested bots Usage: warzone-server --enable-bots --bots-config bots.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,7 +50,7 @@ async fn pwa_manifest() -> impl IntoResponse {
|
||||
|
||||
async fn service_worker() -> impl IntoResponse {
|
||||
([(header::CONTENT_TYPE, "application/javascript")], r##"
|
||||
const CACHE = 'wz-v13';
|
||||
const CACHE = 'wz-v14';
|
||||
const SHELL = ['/', '/wasm/warzone_wasm.js', '/wasm/warzone_wasm_bg.wasm', '/icon.svg', '/manifest.json'];
|
||||
|
||||
self.addEventListener('install', e => {
|
||||
@@ -251,7 +251,7 @@ let pollTimer = null;
|
||||
let ws = null; // WebSocket connection
|
||||
let wasmReady = false;
|
||||
|
||||
const VERSION = '0.0.31';
|
||||
const VERSION = '0.0.32';
|
||||
let DEBUG = true; // toggle with /debug command
|
||||
|
||||
// ── Receipt tracking ──
|
||||
@@ -924,6 +924,20 @@ async function enterChat() {
|
||||
addSys('v' + VERSION + ' | DM: paste peer fingerprint or @alias above');
|
||||
addSys('/alias · /g · /gleave · /gkick · /gmembers · /glist · /friend · /file · /info');
|
||||
|
||||
// Show system bots if available
|
||||
try {
|
||||
const botResp = await fetch(SERVER + '/v1/bot/list');
|
||||
const botData = await botResp.json();
|
||||
if (botData.ok && botData.bots && botData.bots.length > 0) {
|
||||
addSys('');
|
||||
addSys('Available bots:');
|
||||
for (const b of botData.bots) {
|
||||
addSys(' @' + b.name + ' — ' + b.description);
|
||||
}
|
||||
addSys('Message a bot: /peer @botname');
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
const savedPeer = localStorage.getItem('wz-peer');
|
||||
if (savedPeer) {
|
||||
$peerInput.value = savedPeer;
|
||||
|
||||
Reference in New Issue
Block a user