Network Weekend (Marty 2026-11-17): 2 free post credits a day Fri 11-27 00:00 CT to Tue 12-01 00:00 CT, live VBBShop SKU values on every page and in the chatbot, the network ribbon
weekend.js: the date gate (WEEKEND_NOW test clock), FREE_CREDITS_PER_DAY stays 1. chainskus.js: skus() read every 60 s, so the $10 pack shows what the contract credits (50 once the owner signs setSku, 40 before or after). netdeals.js + /assets/netweekend.js: /api/network-deals and the ribbon; the VBB line is built from live values and drops itself if there is nothing true to say. chatcore render hook, chatbot FACTS/CANNED from live values with a dated weekend fact. qa/weekend.test.mjs 33 pass, chatbot 182, smoke 268. common.js?v=10, my.js?v=6, packages.js?v=2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -28,6 +28,8 @@ function key() {
|
||||
try { return fs.readFileSync(path.join(S.dataDir, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; }
|
||||
}
|
||||
const enabled = () => !!key();
|
||||
// optional per-site rewrite of an instant answer at answer time (2026-11-17, Network Weekend: live chain numbers and dated deals)
|
||||
const R = t => { try { return S && typeof S.render === 'function' ? S.render(t) : t; } catch (e) { return t; } };
|
||||
|
||||
// CANNED + FAQ in the shape kb.js stores (order keeps the first-match-wins sequence)
|
||||
function seeds() {
|
||||
@@ -129,14 +131,14 @@ async function answerRaw(message, historyText) {
|
||||
if (hit && other.length && !hit.handoff) hit = null;
|
||||
} catch (e) { kbOk = false; console.error('kb fast path', e.message); }
|
||||
// a hand-off (support, one person's account problem) always answers from its exact pattern, before anything else
|
||||
if (hit && hit.handoff) return { reply: hit.answer, canned: true, kb: hit.id, handoff: true };
|
||||
if (hit && hit.handoff) return { reply: R(hit.answer), canned: true, kb: hit.id, handoff: true };
|
||||
// then meaning (2026-11-16, netkb.route): the hub's semantic match over the network KB answers, keeps or overrules the
|
||||
// pattern hit, and picks the prompt context. Hub or model slow or down: null, and the pattern + BM25 path below runs as before.
|
||||
let sem = null;
|
||||
if (kbOk) { try { sem = await netkb.route(msg, { fast: hit, own: await kb.own(), prefer: other }); } catch (e) { sem = null; } }
|
||||
if (sem) hit = sem.hit;
|
||||
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
|
||||
if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
|
||||
if (hit) return Object.assign({ reply: R(hit.answer), canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
|
||||
if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: R(c.a), canned: true }, c.handoff ? { handoff: true } : {});
|
||||
let kbBlock = '', kbIds = [], hits = [];
|
||||
try {
|
||||
const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg;
|
||||
|
||||
Reference in New Issue
Block a user