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:
+9
-1
@@ -87,7 +87,7 @@ const ENV = Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA,
|
||||
LOOP_SIZE: '5', VISITORS_PER_SHIFT: '3', VIEWS_PER_CYCLE: '150', VISIT_SECONDS: '2', VISITS_PER_IP_DAY: '2', LINK_PROBE: '0', NETWORK_LOOKUP_URL: 'http://127.0.0.1:' + (PORT + 1) + '/api/network/member',
|
||||
NETWORK_SSO_SECRET: SSO_SECRET, IAP_URL: 'https://iap.invalid', LS_URL: 'https://ls.invalid', LS_PARTNER_URL: 'http://127.0.0.1:' + LS_PORT, LS_SPINS_FIRST_MS: '300', LS_SPINS_EVERY_MS: '700',
|
||||
CONTRACT_ADDRESS: SHOP, CHAIN_RPC: 'http://127.0.0.1:' + CHAIN_PORT, KEEPER_KEY: KEEPER_PK, SHOP_START_BLOCK: '1', SHOP_CONFIRMATIONS: '0', SHOP_POLL_MS: '200',
|
||||
HUB_ENABLED: '1', HUB_URL: 'http://127.0.0.1:' + HUB_PORT, HUB_SECRET, HUB_SITE: 'vbb', HUB_TICK_MS: '300', HUB_DOWN_MS: '400' });
|
||||
HUB_ENABLED: '1', NETKB: '0', HUB_URL: 'http://127.0.0.1:' + HUB_PORT, HUB_SECRET, HUB_SITE: 'vbb', HUB_TICK_MS: '300', HUB_DOWN_MS: '400' });
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||
let pass = 0, fail = 0; let srv = null;
|
||||
const ok = (cond, what, extra) => { if (cond) { pass++; console.log(' ok ' + what); } else { fail++; console.log(' FAIL ' + what + (extra !== undefined ? ' -> ' + JSON.stringify(extra).slice(0, 400) : '')); } };
|
||||
@@ -211,6 +211,14 @@ async function main() {
|
||||
r = await anon.req('/sitemap.xml'); ok((await r.text()).includes('/promote'), 'sitemap lists /promote');
|
||||
}
|
||||
r = await anon.req('/api/my'); ok(r.status === 401, '/api/my needs sign-in');
|
||||
// the site assistant (2026-11-15): widget on every page, canned answers without AI, account problems hand off, admin KB behind the token
|
||||
{ const home = await (await anon.req('/')).text();
|
||||
ok(/<script src="\/assets\/chat\.js\?v=\d+" defer><\/script>/.test(home) && (await anon.req('/assets/chat.js')).status === 200 && (await anon.req('/assets/chat.css')).status === 200, 'chat widget on the page, its script and styles served'); }
|
||||
{ const cr = await anon.req('/api/chat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: 'How much are the packages?' }) }); const cj = await cr.json();
|
||||
ok(cr.status === 200 && cj.canned && /\$3/.test(cj.reply) && /\$10/.test(cj.reply), 'chat: canned packages answer', cj); }
|
||||
{ const cr = await anon.req('/api/chat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: 'my credits did not show up' }) }); const cj = await cr.json();
|
||||
ok(cj.handoff === true && /^https:\/\/instantadpay\.com\/support\?from=vbb/.test(cj.support || ''), 'chat: account problem hands off to network support', cj); }
|
||||
ok((await anon.req('/api/admin/kb')).status === 401, 'admin KB needs the token');
|
||||
|
||||
console.log('4. members: wallet sign-in and network sign-in');
|
||||
const A = await walletMember();
|
||||
|
||||
Reference in New Issue
Block a user