update to 0.2.0 stable #2

Merged
serversdown merged 51 commits from dev into main 2026-06-18 15:39:46 -04:00
2 changed files with 15 additions and 5 deletions
Showing only changes of commit fc06b24528 - Show all commits
+8 -3
View File
@@ -216,7 +216,7 @@ Schema:
"game": "NLH" | "PLO" | ...,
"stakes": "<e.g. 1/3, or null>",
"hero_pos": "<UTG|UTG1|MP|LJ|HJ|CO|BTN|SB|BB, hero's position>",
"hero_cards": ["Rs", ...], // rank+suit; suit one of s h d c; null if unknown
"hero_cards": ["As","Ax", ...], // rank+suit (s/h/d/c); 'x' suit if unknown e.g. "Ax"; "x" for a fully unknown card
"players": [ // every player mentioned, incl. hero
{"pos": "<position>", "stack": <number|null>, "name": <string|null>, "cards": [".."]|null}
],
@@ -230,8 +230,13 @@ Schema:
}
Rules: infer positions and street order sensibly. Amounts are plain numbers (no $). \
Normalize cards like "Ah","Td","9s". Use null/omit for anything not stated. Stay faithful \
to what's described — do not invent action that isn't implied."""
NEVER invent suits or cards. A card is rank+suit where suit is one of s/h/d/c; if the suit \
wasn't stated, use 'x' for the suit (e.g. "Ax","Kx","4x"); if a whole card wasn't stated, \
use "x". Examples: "AA with the ace of spades" -> hero_cards ["As","Ax"]; "AK on an A4x \
board" -> board ["Ax","4x","x"]. Each card is independent: a suit named for one card does \
NOT apply to another — e.g. your hole "ace of spades" is a different card from a board ace \
whose suit is unstated (that board ace is "Ax", not "As"). Use null/omit for non-card \
details not stated. Stay faithful to what's described — do not invent action that isn't implied."""
def _safe_json(s: str) -> dict | None:
+7 -2
View File
@@ -37,6 +37,8 @@
.card .r{font-size:1rem;}
.card.red{color:#c8102e;}
.card.back{background:#2a3550;color:#2a3550;}
.card.unknown{background:#2a3550;color:#7c879e;font-size:1.2rem;}
.card .nosuit{color:#9aa3b5;}
.seat{position:absolute;transform:translate(-50%,-50%);width:96px;text-align:center;
background:rgba(13,16,22,.85);border:1px solid var(--border);border-radius:10px;padding:5px 4px;}
@@ -84,9 +86,12 @@
function cardEl(code, sm){
if(!code) return '';
const m = String(code).trim().match(/^(10|[2-9TJQKA])\s*([shdc])$/i);
if(!m) return `<span class="card${sm?' sm':''}">${esc(code)}</span>`;
const c = String(code).trim();
if(c.toLowerCase()==='x') return `<span class="card${sm?' sm':''} unknown">?</span>`;
const m = c.match(/^(10|[2-9TJQKA])\s*([shdcx])$/i);
if(!m) return `<span class="card${sm?' sm':''}">${esc(c)}</span>`;
const r = m[1].toUpperCase().replace('10','T'); const s = m[2].toLowerCase();
if(s==='x') return `<span class="card${sm?' sm':''}"><span class="r">${r}</span><span class="nosuit">·</span></span>`;
return `<span class="card${sm?' sm':''}${RED.has(s)?' red':''}"><span class="r">${r}</span><span>${SUIT[s]}</span></span>`;
}
const cards = (arr, sm) => (arr||[]).map(c=>cardEl(c,sm)).join('');