BixPay card integration, phase 1 (Marty approved the copy 2026-10-29; docs/BIXPAY-INTEGRATION.md): gated by site config bixpayLive (off by default). Profile > BixPay card field (partner link validated: bix.ibportal.io/auth/register, e= token, a=1; the appId=3 card-customer link is refused with a message), bixpay.js resolver own > sponsor chain (10 levels) > company link (bixCompanyLink, seeded with Marty's partner link), every surface says whose link it is. Wallet tab card, one-week Overview announcement (24 h snooze), one sentence in TierPaid payout emails and the games' wallet nudges, Promo tools > BixPay tab (3 posts, email swipe, 4 text-only banners on the Spaces CDN, tracked link + per-member clicks), public guide /bixpay with masked app screenshots, chatbot canned answers + facts gated to 'coming soon' while off (KNOWLEDGE_DATE 2026-10-29). Clicks per surface via /go/bixpay in the admin Traffic tab; admin Overview counts members with a link; member card shows it; signed /api/partner/bixpay and the lssync profile row carry it for LinkSpin/CTB. accounts.bix_partner_link column (db.js alterSafe). Tests: qa/bixpay.test.cjs (17) + walk.mjs BixPay block; my.js/promo.js/admin.js ?v=20261029bx.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-29 07:56:49 -05:00
parent 6e1ab102f1
commit ed6febe0b8
29 changed files with 971 additions and 27 deletions
+34 -6
View File
@@ -24,7 +24,8 @@ const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro'
function init(opts) {
if (opts && typeof opts.gameLive === 'function') GAME_LIVE = opts.gameLive;
if (opts && typeof opts.refuelOn === 'function') REFUEL_ON = opts.refuelOn; DATA_DIR = opts.dataDir; chain = opts.chain; PASS_TIERS = typeof opts.passTiers === 'function' ? opts.passTiers : null; return kb.init({ dataDir: DATA_DIR, seeds: seeds() }); }
if (opts && typeof opts.refuelOn === 'function') REFUEL_ON = opts.refuelOn;
if (opts && typeof opts.bixLive === 'function') BIX_LIVE = opts.bixLive; DATA_DIR = opts.dataDir; chain = opts.chain; PASS_TIERS = typeof opts.passTiers === 'function' ? opts.passTiers : null; return kb.init({ dataDir: DATA_DIR, seeds: seeds() }); }
function key() {
if (process.env.OPENROUTER_API_KEY) return process.env.OPENROUTER_API_KEY.trim();
try { return fs.readFileSync(path.join(DATA_DIR, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; }
@@ -32,12 +33,30 @@ function key() {
function enabled() { return !!key(); }
// ---- canned answers: instant, free, always in voice ----
const KNOWLEDGE_DATE = '2026-10-28'; // bump whenever the canned answers / prompt are brought up to date
const KNOWLEDGE_DATE = '2026-10-29'; // bump whenever the canned answers / prompt are brought up to date
const SUPPORT_RE = /(contact|reach|email|e-mail|message|talk to|speak (to|with)|get hold of) (the )?(support|admin|administrator|owner|marty|staff|team at instantadpay|someone|a (human|person|real person))|support (email|address|ticket|team|desk)|help ?desk|(open|send|file|submit|raise) (a )?(support )?ticket|\b(human|real person|live (agent|person|chat|support))\b|customer (service|support)|support@|how (do|can) i get (help|support)/i;
const CANNED = [
{ id: 'support', title: 'Contact support or open a ticket', q: ['How do I contact support?', 'How do I talk to a real person?', 'How do I open a support ticket?'], tags: ['support', 'help', 'ticket', 'contact', 'help desk'],
re: SUPPORT_RE, handoff: true,
a: 'Open Help in your member dashboard (https://instantadpay.com/my#help) to send Marty a ticket, and his replies land right there and in your email. Not signed in or locked out? Use https://instantadpay.com/support, or email support@instantadpay.com. You can also tap "Send this to support" below and I will pass this chat along.' },
// BixPay Visa card (2026-10-29, docs/BIXPAY-INTEGRATION.md). Sits ahead of the Level 4 entry because that one also matches "3%".
// While site config bixpayLive is off, answer() swaps every bixpay-* hit for BIX_SOON_ANSWER. Never BIX's marketing claims (user
// counts, spend per day, valuations) as facts; the only fee we state is 3% per purchase, no load fee, see BIX's terms for the rest.
{ id: 'bixpay-link', title: 'Where to put my BixPay partner link', q: ['Where do I put my BixPay partner link?', 'How do I add my BIX link?', 'Which BixPay link do I paste, referral or partner?'], tags: ['bixpay', 'bix', 'partner link', 'profile', 'ib portal'],
re: /(bix|bixpay).*(partner link|my link|referral link|ib ?portal|paste|where do i (put|add|enter)|profile)|(partner link|ib ?portal).*(bix|bixpay)/i,
a: 'Members > Profile > BixPay card. Paste your PARTNER link there: in your BIX portal (bix.ibportal.io) open Profile and copy the link in the second box, the one labelled Partner. It looks like https://bix.ibportal.io/auth/register?e=...&a=1. The first box, the Bix referral link (it ends in appId=3), only makes a card customer, so the field refuses it and asks for the Partner one. Once saved, your Wallet card, your promo kit, the /bixpay guide opened from your links and the line in your payout emails all carry your link, and LinkSpin will read the same one.' },
{ id: 'bixpay-credit', title: 'Who gets the BixPay credit', q: ['Who gets credit when someone signs up for BixPay through my page?', 'Whose BixPay link is on my pages?', 'What does "Using: the network link" mean?'], tags: ['bixpay', 'bix', 'credit', 'sponsor', 'network link'],
re: /(bix|bixpay).*(credit|whose|who gets|sponsor.s link|network link|using:|my sponsor|upline)|(whose|who gets).*(bix|bixpay)/i,
a: 'The BixPay link on your pages is yours when you have saved your partner link in Profile. If you have not, it is the first sponsor up your line (up to ten levels) who has one, and if nobody has, it is the network link. Every BixPay card says which one is in play: "Using: your link", "Using: @name’s link" or "Using: the network link". Sign-ups are credited inside the BIX portal to whoever owns that link, directs and levels included; InstantAdPay does not count or pay BixPay sign-ups itself. Add your own link in Members > Profile > BixPay card so the credit is yours.' },
{ id: 'bixpay-load', title: 'Loading the BixPay card from POL', q: ['How do I load my BixPay card from POL?', 'Can I send POL to BixPay?', 'How do I fund the BixPay card?'], tags: ['bixpay', 'bix', 'fund', 'load', 'usdt', 'usdc', 'polygon', 'cash app'],
re: /(bix|bixpay).*(load|fund|top ?up|deposit|send pol|from pol|usdt|usdc|swap|cash ?app)|(load|fund|top ?up).*(bix|bixpay)/i,
a: 'The BixPay card spends USDT or USDC, so the step is POL to USDT or USDC first. Three ways: (1) swap your POL for USDT or USDC on any exchange or on-ramp you already use, then send it to your BixPay wallet on the Polygon network (open the BIX app, Wallet > Receive, pick USDT or USDC, and use the Polygon address); (2) in the US, Cash App can send crypto straight to the BixPay wallet; (3) BIX has said an in-app swap is coming, and we will add it here when it ships. Once the USDT or USDC is in the wallet, tap TOPUP on the card. No load fee; 3% per purchase; see BIX’s terms for other charges. The full walk-through with screenshots is at https://instantadpay.com/bixpay.' },
{ id: 'bixpay-card', title: 'How to get the BixPay card', q: ['How do I get the BixPay card?', 'How do I sign up for BixPay?', 'Is BixPay available in my state?'], tags: ['bixpay', 'bix', 'visa card', 'virtual card', 'sign up', 'states'],
re: /(bix|bixpay).*(get|sign ?up|join|order|apply|virtual|plastic|metal|state|country|available|how much|cost|price|\$9)|(get|sign ?up for|order).*(bix|bixpay)/i,
a: 'Open the BixPay card in your Wallet tab (Members > Wallet) and tap Get your BixPay card. That opens a partner sign-up link, so you join as a partner and the card and the referral plan come with it: 1) register in the BIX portal through the link, 2) download the BIX app and create your wallet, 3) in the app open Settings > Scan QR and scan the code in your portal profile to link the two, 4) Cards > Create Card for the $9.99 virtual Visa (plastic, metal and gold cards cost more). KYC is required for the card. In the US it is open in 31 states so far; not in your state yet? You can still get the wallet and build. Elsewhere availability varies by country. Guide: https://instantadpay.com/bixpay.' },
{ id: 'bixpay', title: 'What BixPay is', q: ['What is BixPay?', 'What is the BIX card?', 'Can I spend my POL with a Visa card?'], tags: ['bixpay', 'bix', 'visa', 'card', 'spend pol', 'wallet'],
re: /(bix|bixpay|bix card|visa card|debit card|spend (my )?(pol|crypto|earnings)|crypto card)/i,
a: 'BixPay is a self-custody wallet with a Visa card, made by BIX, a separate company. You send USDT or USDC to it on Polygon, load the card, and spend wherever Visa is accepted, including Apple Pay and Google Pay. Virtual cards from $9.99. 3% per purchase, no load fee; see BIX’s terms for other charges. InstantAdPay is not the card issuer; members who join BixPay as partners get their own partner link, and anyone who gets a card through their pages is credited to them in the BIX portal, up to ten levels deep. Where to find it: Members > Wallet (the card), Members > Profile (your partner link), Promo tools > BixPay (posts and banners), and the guide at https://instantadpay.com/bixpay. Crypto assets can lose value.' },
{ id: 'level4-override', title: 'The Level 4 override (3%)', q: ['What is the Level 4 override?', 'Do I earn from my fourth level?', 'How does the 3% override work?'], tags: ['override', 'level 4', 'fourth level', 'commission', 'payouts'],
re: /(level ?(4|four)|4th level|fourth level|override|3 ?%|three percent)/i,
a: 'The Level 4 override is 3% of every package bought four levels below you, paid by the company on top of the three levels the contract pays. It goes to the buyer’s 4th sponsor up if that member has 5 or more qualifying buyers (direct referrals who bought $20 or more, the same bar as level 3). If they do not have 5 yet, it moves up the line to the next member who does, up to 25 steps, and each purchase pays one override to one person. It is paid weekly in POL from a company wallet, every Monday after 9 AM Central for the Monday to Sunday week before, through the contract’s award function, so every payment has a Polygon link, and it shows in your Earnings as "Level 4 override". Weekly totals under 0.01 POL carry over to the next week. It counts purchases from the start date on, not earlier ones. It comes from the platform’s 20% share, so the 50/20/10 split does not change. What you earn depends on real purchases in your line; nothing is guaranteed.' },
@@ -241,7 +260,15 @@ function synFact() { const n = SYN_N(); return '- NETWORK RATE (live, Marty 2026
let REFUEL_ON = () => false;
// POL Miner (2026-10-28) follows site config gamesLive: until 'polminer' is in it the assistant only says it is coming soon
let GAME_LIVE = () => false;
const POLMINER_SOON_ANSWER = 'POL Miner, a dig-down mining game where rare Polygon crystals pay POL, is coming soon to the InstantAdPay games. It is not open yet; it will show up on your Games tab (Members > Games) and in the release notes when it launches.';
// BixPay (2026-10-29) follows site config bixpayLive: until it is on the assistant only says the card is coming soon
let BIX_LIVE = () => false;
const bixLive = () => { try { return !!BIX_LIVE(); } catch (e) { return false; } };
const isBixId = id => /^(c-)?bixpay(-[a-z]+)?$/.test(String(id || ''));
const BIX_SOON_ANSWER = 'A BixPay Visa card for spending POL is coming to InstantAdPay soon: a self-custody wallet with a Visa card, made by BIX, a separate company. It is not switched on here yet. When it is, it shows up on your Wallet tab, with a partner-link field in your Profile and a guide at instantadpay.com/bixpay, and the release notes will say so.';
function bixFact() { return bixLive()
? '- BIXPAY VISA CARD (LIVE, 2026-10-29): BixPay = a self-custody wallet + Visa card made by BIX, a SEPARATE company (not InstantAdPay). The member sends USDT or USDC to the BixPay wallet on Polygon, loads the card, spends wherever Visa is accepted incl. Apple Pay and Google Pay. Virtual card $9.99 (plastic, metal and gold cost more). The ONLY fee we state: 3% per purchase, no load fee; for anything else say "see BIX’s terms". US: open in 31 states so far; not in your state yet = you can still get the wallet and build; elsewhere availability varies by country; KYC required for the card. Funding POL -> card: (1) swap POL to USDT/USDC on any exchange or on-ramp, send on Polygon (app: Wallet > Receive > USDT or USDC > Polygon address); (2) US: Cash App can send crypto straight to the BixPay wallet; (3) an in-app swap is announced by BIX but NOT live: never say members can swap POL inside the app today. Sign-up steps: partner link -> register in the BIX portal (bix.ibportal.io) -> download the BIX app -> Settings > Scan QR to link app and portal -> Cards > Create Card ($9.99 virtual). Partner plan, plain words: BIX puts half of the 3% fee and of card sales into its partner plan, paid over ten levels (15% level 1, 10% level 2, 2.5% each on levels 3 to 10) plus a 5% pool; sign-ups and commissions are tracked and paid by BIX in the BIX portal, never by InstantAdPay; any worked example is hypothetical, not typical, and never a promise. Disputes: BIX accepts a dispute up to 120 days after a transaction posts; they can take 30 to 60 business days. WHERE: Members > Wallet (the card with Get your BixPay card + How it works), Members > Profile > BixPay card (the member pastes their PARTNER link from BIX portal > Profile > Partner, the second box; the referral link with appId=3 is refused), Promo tools > BixPay tab (3 posts, an email swipe, 4 text-only banners, all carrying the member’s link, plus the tab’s click count), the public guide https://instantadpay.com/bixpay (add ?ref=<username> and the page carries that member’s link), one sentence in payout emails. WHOSE LINK: the member’s own partner link, else the first sponsor up the chain (10 levels) with one, else the network link; every card says which ("Using: your link / @name’s link / the network link"). Compliance: InstantAdPay is not the card issuer and earns a referral commission when someone signs up through a partner link; crypto assets can lose value. NEVER repeat BIX marketing claims (user counts, cards issued, spend per day, valuations, "bigger than X") as facts; if asked, say those are BIX’s own claims and we have not verified them.\n'
: '- BIXPAY VISA CARD: COMING SOON, not switched on yet. If asked about BixPay, BIX, a crypto Visa card or spending POL with a card, say it is coming to the Wallet tab soon and nothing is live yet; never quote its fees, steps, links or the partner plan until it is on.\n'; }
const POLMINER_SOON_ANSWER ='POL Miner, a dig-down mining game where rare Polygon crystals pay POL, is coming soon to the InstantAdPay games. It is not open yet; it will show up on your Games tab (Members > Games) and in the release notes when it launches.';
const pmLive = () => { try { return !!GAME_LIVE('polminer'); } catch (e) { return false; } };
function polminerFact() { return pmLive() ? '- POL MINER (https://polminer.com, Members > Games): a free dig-down mining game. Dig, sell ore for coins, upgrade pick/lamp/cart/thruster, beat a drill boss every 30 m. Pink Polygon crystals pay a random POL amount the first time each one is dug out; each boss pays POL on its first win per account; first trips to 50/100/150/200 m pay POL. Coins never turn into POL. Guests can play and collect at sign-in. POL is paid automatically to the wallet linked on InstantAdPay. The SUPPLY pad opens a sponsored supply crate (full lamp + coins, never POL) after a short sponsor visit.\n' : '- POL MINER: COMING SOON, not open yet. Never send members to polminer.com; say it is coming soon to the Games tab.\n'; }
function refuelFact() { return REFUEL_ON() ? "- MONTHLY REFUEL STREAK (built 2026-10-24, switch refuelStreak): ONE streak per member across InstantAdPay and LinkSpin. Counted refuel = a NEW package of $20+ on InstantAdPay or $25+ on LinkSpin by one of the member's own positions. First one sets the member's own refuel day; next due 30 days after the last counted refuel; window opens 5 days before the due day; 5-day grace after it; Central time. Missing the grace resets the streak, except one free miss per 365 days. Bonus (purchased-grade ad credits on the site where bought, credit log 'Refuel streak'): one engine m1 +10%, m2 +15%, m3 +20%, m4+ +25%; both sites in the same cycle m1 +15%, m2 +20%, m3 +30%, m4+ +40% each (first site topped up to the both rate, difference only) plus a 100-credit Featured bonus on InstantAdPay at m4+ (purchased-grade credits, any format). Stacks on Five Dollar Friday / Wired Wednesday. Pit Stop: another $20+/$25+ package on a site already refueled this cycle, before the next window opens (the other site's first package in the cycle is the second engine instead) = half the current streak rate, once per site per cycle, not a counted refuel. Badges: Engine Started (first refuel), Refueled 3 / 6 / 12 months. ENGINE ROOM: unlocked by the first counted refuel (greyed 'Refuel to start your engine' before), IAP tab Engine Room + LinkSpin Ads screen panel, same data both sites: dials Fuel left (credits free + in campaigns on both sites vs this cycle's refuel credits incl. bonus, days left at the recent burn), Clicks this week (vs last week, clicks per 1,000 credits), Goals this month (conversion pixel conversions since the 1st Central vs the member's own goal); streak panel; warning lights (ads at 80%, ads out, refuel day coming, login slot open); six part lights (fuel, banner spin, spin link, page, testing, conversion tracking: green working, amber needs attention, grey not started with a Set it up link); one Next move button from simple rules. REFUEL KIT: each counted refuel unlocks the Central-month's members-only banner set for this site's own program (5 sizes, personalized server-side with @username + QR to the member's link; IAP: Promo tools card with Use in an IAP banner campaign; LinkSpin: Ads screen card with Load into my Banner Spin); kits stay usable after the month; streak month 3+ adds an animated GIF, month 6+ a BannerKitAI custom-banners credit (coming, entitlement saved). Reminders 5 days before, on the day, last call at the end of grace (email + on-site notice). The member's Refuel card (InstantAdPay Overview, LinkSpin Credits/Ads) shows refuel day, streak, next bonus, Pit Stop status. Either site alone keeps the streak (one-engine rates); both sites in one cycle = the bigger bonus; never say both are required. MEMBER GUIDE PAGE (public, 2026-10-24): /refuel on both sites (https://instantadpay.com/refuel and https://linkspin.app/refuel): the flow, the numbers, the member steps, leader coaching and FAQ; point members there for the full picture. Ad credits only, never cash; never promise income. No auto-billing: the member chooses every package. ROUTES (2026-10-25): LinkSpin menu item Refuel = https://linkspin.app/credits#refuel (the Refuel panel, scrolled to and highlighted); packages of $25+ there are marked counts for Refuel; https://linkspin.app/credits#buy = the package picker; https://linkspin.app/ads#engine = LinkSpin Engine Room. InstantAdPay Engine Room = https://instantadpay.com/my#engine; its Set up conversion tracking opens https://instantadpay.com/my#conversions (Campaigns > Conversion tracking card, same goals LinkSpin counts). Engine Room links that cross to LinkSpin (Banner Spin, spin link, page, testing, refuel LinkSpin) open LinkSpin with a note at the top naming the job, Step 1, a guide link and Back to InstantAdPay; same email signs in on both.\n" : '- MONTHLY REFUEL STREAK: built but NOT switched on yet. If asked, say it is coming and nothing counts toward it today; do not quote bonus rates or dates.\n'; }
@@ -251,7 +278,7 @@ function systemPrompt(kbBlock) {
FACTS:
- LEVEL 4 OVERRIDE (LIVE 2026-10-26, first payout Monday 2026-11-02): company-paid, off-chain decision, on-chain payment. 3% of every package purchase (the POL actually paid) goes to the buyer's 4th upline on the contract sponsor chain if that member's contract buyerCount is 5 or more (qualifying buyer = direct referral with a $20+ purchase, same bar as level 3); otherwise it hunts up to the next qualified upline, max 25 hops; the company account (#1) or no qualified upline = company keeps it; exactly one recipient per purchase. Paid weekly in POL every Monday after 9 AM Central for the previous Monday to Sunday Central week, from a company payer wallet via the contract's award(memberId), shown in Earnings as 'Level 4 override' with a Polygon link and announced by email and an on-site notice. Under 0.01 POL carries to the next week. Purchases from the start date only, no back pay. Funded from the platform's 20%; the contract split 50/20/10 is unchanged. Never promise amounts.
${passTiersFact()}${refuelFact()}${synFact()}${polminerFact()}- ROAD AGENT (LIVE 2026-10-15, https://roadagent.app): a night-highway shooter open to every member. Open the Games tab and tap Play on the Road Agent card, or go to roadagent.app and sign in with the InstantAdPay email. Drive the four-lane highway, shoot the hostiles (thug sedans, switchblades, gunner vans), spare the civilians, pull into the weapons truck for oil slicks, smoke and missiles. Clearing a sector for the first time pays POL to the wallet on the member's InstantAdPay account, plus a daily patrol reward; scrap buys garage upgrades. Fuel = a sponsor visit: before a run the player visits an advertiser's page (a FUEL STOP), which is a normal verified visit with the dwell timer and human check, charged to the advertiser like any visit; advertisers' existing visits campaigns are already in the rotation, nothing to set up; to get more traffic from the game, top up the visits campaign. Clickable Pause, Sound and Music buttons sit under the game (P / M / N keys also work), and the Run tab has an Invite a friend card with the member's roadagent.app/?ref=<username> link.
${passTiersFact()}${refuelFact()}${synFact()}${polminerFact()}${bixFact()}- ROAD AGENT (LIVE 2026-10-15, https://roadagent.app): a night-highway shooter open to every member. Open the Games tab and tap Play on the Road Agent card, or go to roadagent.app and sign in with the InstantAdPay email. Drive the four-lane highway, shoot the hostiles (thug sedans, switchblades, gunner vans), spare the civilians, pull into the weapons truck for oil slicks, smoke and missiles. Clearing a sector for the first time pays POL to the wallet on the member's InstantAdPay account, plus a daily patrol reward; scrap buys garage upgrades. Fuel = a sponsor visit: before a run the player visits an advertiser's page (a FUEL STOP), which is a normal verified visit with the dwell timer and human check, charged to the advertiser like any visit; advertisers' existing visits campaigns are already in the rotation, nothing to set up; to get more traffic from the game, top up the visits campaign. Clickable Pause, Sound and Music buttons sit under the game (P / M / N keys also work), and the Run tab has an Invite a friend card with the member's roadagent.app/?ref=<username> link.
- HELP DESK (LIVE 2026-10-16): members open Help in the dashboard (/my#help) to send Marty a support ticket (pick a category, a subject, the message, up to 2 screenshots), see each ticket's status (Open, Waiting on you, Closed) and read and answer his replies; a badge shows when he has replied, and replies also arrive by email. Anyone signed out or locked out uses the public form at https://instantadpay.com/support (name, email, category, subject, message) and gets an email with the ticket number (like IAP-1042) and a private link to view and reply, no sign-in needed. support@instantadpay.com also reaches Marty. Replying to a closed ticket opens it again. In this chat, "Send this to support" turns the conversation into a ticket. Only Marty answers, so replies are not instant; never promise a response time.
- PRESENTATION (2026-10-15): instantadpay.com/presentation is a public page (no sign-in) with the narrated InstantAdPay presentation, about six minutes, Marty's voice, captions in 6 languages (English, Italiano, Français, Español, Deutsch, Português) chosen with pills under the player. Sixteen parts: the platform, ad reach, the nine games that pay POL, the $20 split ($10 / $4 / $2 / $4 platform, same transaction), three rules, packages, the 2-then-5 unlock, pass-up, wide versus narrow ($800 vs $36, an illustration), Qualified Start, the Pipeline, LinkSpin (pre-launch Nov 1), one wallet across the network, the first week, and 'the target is five'. Share link: Members > Promo tools > 'Share the presentation' copies instantadpay.com/presentation?ref=<username>; ?ref sets the same 30-day sponsor cookie as the invite link, the page shows 'Shared with you by @name' with avatar and a Join button to /join/<username>. It is in the site menu as 'Presentation'. BUILD WIDE VIDEO: first card in Promo tools > Videos ('Build wide: watch the payments flow'), matched link ?v=wide.
- WIRED WEDNESDAY: every Wednesday, Central time (midnight to midnight), any ad package of $20 or more (Activation and up; no $10 pack exists) earns +25% bonus credits wired into the buyer's balance the moment the purchase settles, purchased-grade (usable on every format incl. login ads), credit log label "Wired Wednesday". First one: Wednesday 2026-09-30. Page: instantadpay.com/wednesday. Credits buy ad delivery, never money.
@@ -398,15 +425,16 @@ async function answerRaw(message, historyText) {
try { hit = await kb.fastPath(msg); } catch (e) { kbOk = false; console.error('kb fast path', e.message); }
if (hit && hit.id === 'refuel' && !REFUEL_ON()) return { reply: REFUEL_OFF_ANSWER, canned: true, kb: hit.id };
if (hit && (hit.id === 'polminer' || hit.id === 'c-polminer') && !pmLive()) return { reply: POLMINER_SOON_ANSWER, canned: true, kb: hit.id };
if (hit && isBixId(hit.id) && !bixLive()) return { reply: BIX_SOON_ANSWER, canned: true, kb: hit.id };
if (hit && (hit.id === 'network-rate' || hit.id === 'c-network-rate') && SYN_N() !== 4) return { reply: netRateAnswer(SYN_N()), canned: true, kb: hit.id };
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of CANNED) if (c.re.test(msg)) return c.id === 'refuel' && !REFUEL_ON() ? { reply: REFUEL_OFF_ANSWER, canned: true } : c.id === 'polminer' && !pmLive() ? { reply: POLMINER_SOON_ANSWER, canned: true } : c.id === 'network-rate' && SYN_N() !== 4 ? { reply: netRateAnswer(SYN_N()), canned: true } : Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of CANNED) if (c.re.test(msg)) return c.id === 'refuel' && !REFUEL_ON() ? { reply: REFUEL_OFF_ANSWER, canned: true } : c.id === 'polminer' && !pmLive() ? { reply: POLMINER_SOON_ANSWER, canned: true } : isBixId(c.id) && !bixLive() ? { reply: BIX_SOON_ANSWER, canned: true } : c.id === 'network-rate' && SYN_N() !== 4 ? { reply: netRateAnswer(SYN_N()), canned: true } : Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
// retrieval: the closest entries ride along in the system prompt (a short follow-up borrows words from the chat so far)
let kbBlock = '', kbIds = [];
try {
const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg;
const hits = await kb.context(query, 5);
const hitsOk = pmLive() ? hits : hits.filter(h => !/^(c-)?polminer$/.test(String(h.entry && h.entry.id))); // not live yet: keep its answer out of the prompt
const hitsOk = hits.filter(h => (pmLive() || !/^(c-)?polminer$/.test(String(h.entry && h.entry.id))) && (bixLive() || !isBixId(h.entry && h.entry.id))); // not live yet: keep its answer out of the prompt
kbBlock = kb.promptBlock(hitsOk); kbIds = hitsOk.map(h => h.entry.id);
} catch (e) { console.error('kb search', e.message); }
if (!enabled()) return { reply: 'Good question. The quick answers I have cover packages, payouts, qualification, and joining; for anything deeper, the plain-language contract review at https://instantadpay.com/contract covers most of it, or tap "Send this to support" and Marty will answer.', handoff: true };