Site assistant (Marty 2026-11-15): chat widget in the 5xYourTeam draft-night look on every page, CANNED + FACTS from this repo's code (position $10 one time, 5 picks, sponsor 25% + L2-5 5% + pot 10% + company 45%, pass-up 20 places, Monday 7 PM Central draft, earned order, 3-day return, 48 h hold, 10 open picks, no contact data), retrieval over the shared network knowledge base on the hub (netkb.js, home entries boosted, another site named = its answer), reasoning off, account problems hand off to network support. chatbot.test 187, unit 62/62, smoke 160/160, iap-tank 35/35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,7 @@ const tank = require('./tankpool');
|
||||
const networksso = require('./networksso');
|
||||
const shop = require('./shop');
|
||||
const promokit = require('./promokit');
|
||||
const chatbot = require('./chatbot'); // the site assistant (2026-11-15): chatcore.js + kb.js + the network knowledge base (netkb.js)
|
||||
const hubreport = require('./hubreport');
|
||||
const hubpeople = require('./hubpeople');
|
||||
const hubline = require('./hubline');
|
||||
@@ -211,6 +212,7 @@ const server = http.createServer(async (req, res) => {
|
||||
try {
|
||||
if (req.method === 'GET' && (p.startsWith('/sso/') || p === '/api/sso/status') && await networksso.handle(req, res, u)) return;
|
||||
if ((p === '/api/promo-kit' || p === '/promote') && promokit.handle(req, res, u, sendFile)) return;
|
||||
if ((p.startsWith('/api/chat') || p.startsWith('/api/admin/kb')) && await chatbot.handle(req, res, p, u, { json, readBody, isAdmin })) return;
|
||||
|
||||
if (req.method === 'GET' || req.method === 'HEAD') {
|
||||
if (p === '/health') return json(res, 200, { ok: true, store: docstore.isOn() ? 'mysql' : 'files', tank: C.tankMode });
|
||||
@@ -459,6 +461,7 @@ const server = http.createServer(async (req, res) => {
|
||||
shop.init(C);
|
||||
const loop = () => league.tick().catch(e => console.error('league tick', e.message)).finally(() => setTimeout(loop, C.draft.tickMs).unref());
|
||||
setTimeout(loop, 300).unref();
|
||||
chatbot.init(); // after docstore.init: kb.json is a MySQL document
|
||||
server.listen(C.port, () => console.log('5xYourTeam on :' + C.port + ', position $' + C.position.usd + ', tank ' + C.tankMode + ', store: ' + (docstore.isOn() ? 'MySQL documents' : 'files (prototype mode)')));
|
||||
})().catch(e => { console.error('start failed:', e.message); process.exit(1); });
|
||||
process.on('SIGINT', () => { store.flush(); process.exit(0); });
|
||||
|
||||
Reference in New Issue
Block a user