Site assistant (Marty 2026-11-15): chat widget in the Viral Banner Blitz pop-art look on every page, CANNED + FACTS from this repo's code (loop 50, 10 verified visitors per shift, 150 network ad views per cycle recorded but not credited yet, 1 free post credit a day for network members, packs 10/$3 and 40/$10, look $2, split 30% introducer + 10% prize pot + 60% company, weekly boards; the pot's floor and cap are never stated), 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 170, smoke 249/249
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,7 @@ const safety = require('./safety');
|
||||
const networksso = require('./networksso');
|
||||
const shop = require('./shop');
|
||||
const promokit = require('./promokit'); // promo kit feed /api/promo-kit + the /promote page (2026-11-14)
|
||||
const chatbot = require('./chatbot'); // the site assistant (2026-11-15): chatcore.js + kb.js + the network knowledge base (netkb.js)
|
||||
const hubreport = require('./hubreport'); // network hub report by wallet (off unless HUB_ENABLED)
|
||||
const prize = require('./prize');
|
||||
const proof = require('./proof'); // trust pack: /ledger, /contract, Telegram card per purchase + line per prize payout (2026-11-14)
|
||||
@@ -229,6 +230,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' });
|
||||
@@ -568,6 +570,7 @@ function saveUpload(owner, buf, ext) {
|
||||
lsspins.init({ base: () => C.lsPartnerBase, members: () => store.members().filter(m => Date.now() - (m.lastSeen || m.joinedAt || 0) < 60 * 86400000)
|
||||
.sort((a, b) => (b.lastSeen || 0) - (a.lastSeen || 0)).slice(0, 400) });
|
||||
setInterval(() => { if (store.pruneVisits()) loop.rebuildIndex(); }, 3600000).unref();
|
||||
chatbot.init(); // after docstore.init: kb.json is a MySQL document
|
||||
server.listen(C.port, () => console.log('Viral Banner Blitz on :' + C.port + ' loop ' + C.loopSize + ', ' + C.perShift + ' visitors per shift, 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