Team Ai
Apppublic

Codenconquer247/code-conquer-agent

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
index.html141 linesDownload Raw Back to root
1<!doctype html>2<html lang="en">3<head>4<meta charset="utf-8">5<meta name="viewport" content="width=device-width,initial-scale=1">6<title>Code & Conquer Agent</title>7<style>8body{margin:0;background:#090c12;color:#f4f4f4;font-family:Arial,sans-serif}9main{max-width:820px;margin:auto;padding:22px}10h1{margin:0 0 6px}11small{color:#aaa}12#chat{min-height:420px;margin-top:18px;padding:14px;border:1px solid #303744;border-radius:16px;background:#121722;overflow:auto}13.msg{padding:11px 13px;margin:9px 0;border-radius:12px;white-space:pre-wrap;line-height:1.4}14.a{background:#202838;margin-right:18%}15.u{background:#e6b93c;color:#111;margin-left:18%}16.row{display:flex;gap:9px;margin-top:12px}17textarea{flex:1;background:#151b25;color:white;border:1px solid #384152;border-radius:12px;padding:12px;font-size:16px}18button{background:#e6b93c;border:0;border-radius:12px;padding:0 18px;font-weight:700}19#status{margin-top:10px;color:#d9b84f;font-size:14px}20</style>21</head>22<body>23<main>24<h1>Code & Conquer Agent</h1>25<small>Fast canon + Endevolution knowledge assistant</small>26<div id="status">Ready.</div>27<div id="chat"><div class="msg a">Hello. Ask me about Code & Conquer, Endevolution, or Selective Friction.</div></div>28<div class="row">29<textarea id="q" rows="3" placeholder="Ask something..."></textarea>30<button id="go">Send</button>31</div>32</main>33 34<script>35const KB = [36  {37    keys:["ai prime","prime","byte","glitch"],38    answer:"AI Prime is a unified entity associated with Byte and Glitch. Byte and Glitch are twins, and Glitch is a girl. AI Prime should not be treated as a permanent split personality."39  },40  {41    keys:["canon priority","canon","book 1","book one"],42    answer:"Canon priority: Book 1, Code and Conquer, is published and fixed. Book 2 uses the revised authoritative version. The Quantum King is the authoritative expanded prequel. Published Book 1 outranks conflicting material, and later approved revisions outrank earlier drafts."43  },44  {45    keys:["chromium","hadron"],46    answer:"Hadron is one world. Chromium is a neighboring kingdom on Hadron and is reached by land."47  },48  {49    keys:["arpaverse","arpa"],50    answer:"The Arpaverse is a network of worlds, not one physical place."51  },52  {53    keys:["codey","king codey"],54    answer:"King Codey is the Golden Compiler King."55  },56  {57    keys:["valeria","queen valeria"],58    answer:"Queen Valeria is associated with the Android Kingdom and is Aurora's mother."59  },60  {61    keys:["aurora"],62    answer:"Aurora is the daughter of King Codey and Queen Valeria."63  },64  {65    keys:["array"],66    answer:"Array is an ancient dragon mentor."67  },68  {69    keys:["nokia"],70    answer:"Nokia is a cobalt griffin and Array's wife."71  },72  {73    keys:["aaron"],74    answer:"AAron is the son of Array and Nokia."75  },76  {77    keys:["arrin","quantum king"],78    answer:"King Arrin is the Quantum King and Codey's father."79  },80  {81    keys:["synthea"],82    answer:"Queen Synthea is Arrin's queen."83  },84  {85    keys:["caesar","null"],86    answer:"Caesar eventually becomes Null. He is a legacy antagonist with a redemption arc."87  },88  {89    keys:["endevolution"],90    answer:"Endevolution describes regression caused by unexamined delegation of important human abilities to automated systems. Apparent system capacity can rise while human functional mastery falls. The goal is not to reject AI, but to preserve human understanding, judgment, skill, and responsibility."91  },92  {93    keys:["selective friction","student judgment","student audit","independent transfer"],94    answer:"Selective Friction uses this sequence: Student Judgment → AI Assistance → Student Audit → Independent Transfer. Students keep strategy selection, sanity checks, error detection, explanation, and judgment. AI handles targeted assistance and mechanical work. A correct AI answer must still be audited."95  }96];97 98const chat=document.querySelector("#chat");99const q=document.querySelector("#q");100const go=document.querySelector("#go");101 102function add(t,c){103  const d=document.createElement("div");104  d.className="msg "+c;105  d.textContent=t;106  chat.appendChild(d);107  chat.scrollTop=chat.scrollHeight;108}109 110function answer(text){111  const s=text.toLowerCase();112  let best=null, score=0;113  for(const item of KB){114    let n=0;115    for(const k of item.keys){116      if(s.includes(k)) n += k.length;117    }118    if(n>score){score=n;best=item;}119  }120  if(best) return best.answer;121  return "I don't have that in my current knowledge yet. Add it to my knowledge base instead of letting me invent canon.";122}123 124function ask(){125  const text=q.value.trim();126  if(!text)return;127  q.value="";128  add(text,"u");129  add(answer(text),"a");130}131 132go.onclick=ask;133q.addEventListener("keydown",e=>{134  if(e.key==="Enter"&&!e.shiftKey){135    e.preventDefault();136    ask();137  }138});139</script>140</body>141</html>