Update index.html
Browse files- index.html +101 -183
index.html
CHANGED
|
@@ -3,26 +3,25 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
| 6 |
-
<title>J.A.R.V.I.S | MASTER CORE v5.
|
| 7 |
<style>
|
| 8 |
-
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;
|
| 9 |
|
| 10 |
:root {
|
| 11 |
--blue-primary: #007acc;
|
| 12 |
-
--blue-glow: rgba(0, 122, 204, 0.
|
| 13 |
-
--bg-black: #
|
| 14 |
-
--bg-panel: #
|
| 15 |
-
--border-blue: rgba(0, 122, 204, 0.
|
| 16 |
-
--text-main: #
|
| 17 |
-
--text-
|
| 18 |
}
|
| 19 |
|
| 20 |
-
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
| 21 |
-
|
| 22 |
body {
|
| 23 |
height: 100dvh;
|
| 24 |
-
|
| 25 |
-
background
|
|
|
|
| 26 |
color: var(--text-main);
|
| 27 |
font-family: 'Rajdhani', sans-serif;
|
| 28 |
overflow: hidden;
|
|
@@ -30,277 +29,196 @@ body {
|
|
| 30 |
flex-direction: column;
|
| 31 |
}
|
| 32 |
|
| 33 |
-
/* HEADER */
|
| 34 |
header {
|
| 35 |
padding: 15px 25px;
|
| 36 |
border-bottom: 1px solid var(--border-blue);
|
| 37 |
display: flex;
|
| 38 |
justify-content: space-between;
|
| 39 |
align-items: center;
|
| 40 |
-
background: rgba(
|
| 41 |
-
backdrop-filter: blur(
|
| 42 |
-
|
| 43 |
-
z-index: 10;
|
| 44 |
}
|
| 45 |
.logo {
|
| 46 |
font-family: 'Orbitron', sans-serif;
|
| 47 |
font-weight: 900;
|
| 48 |
color: var(--blue-primary);
|
| 49 |
-
letter-spacing:
|
| 50 |
font-size: 22px;
|
| 51 |
-
text-shadow: 0 0
|
| 52 |
}
|
| 53 |
-
.
|
| 54 |
-
font-
|
| 55 |
-
font-
|
| 56 |
-
color:
|
| 57 |
-
|
| 58 |
-
align-items: center;
|
| 59 |
-
gap: 8px;
|
| 60 |
}
|
| 61 |
-
.pulse { width: 6px; height: 6px; background: var(--blue-primary); border-radius: 50%; box-shadow: 0 0 8px var(--blue-primary); animation: blink 2s infinite; }
|
| 62 |
-
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
|
| 63 |
|
| 64 |
-
/* CHAT
|
| 65 |
#chat-display {
|
| 66 |
flex: 1;
|
| 67 |
overflow-y: auto;
|
| 68 |
-
padding:
|
| 69 |
display: flex;
|
| 70 |
flex-direction: column;
|
| 71 |
-
gap:
|
| 72 |
scroll-behavior: smooth;
|
| 73 |
}
|
| 74 |
-
#chat-display::-webkit-scrollbar { width:
|
| 75 |
-
#chat-display::-webkit-scrollbar-thumb { background: var(--border-blue);
|
| 76 |
|
| 77 |
.message {
|
| 78 |
-
max-width:
|
| 79 |
-
padding:
|
| 80 |
-
border-radius:
|
| 81 |
border: 1px solid var(--border-blue);
|
| 82 |
font-size: 17px;
|
| 83 |
-
line-height: 1.
|
| 84 |
-
|
| 85 |
-
animation: fadeIn 0.3s ease-out forwards;
|
| 86 |
}
|
| 87 |
-
@keyframes
|
| 88 |
|
| 89 |
.jarvis-msg {
|
| 90 |
align-self: flex-start;
|
| 91 |
-
background: rgba(0,
|
| 92 |
-
border-left:
|
| 93 |
-
border-top-left-radius: 3px;
|
| 94 |
}
|
| 95 |
.user-msg {
|
| 96 |
align-self: flex-end;
|
| 97 |
-
background:
|
| 98 |
-
border-right:
|
| 99 |
-
border-top-right-radius: 3px;
|
| 100 |
-
text-align: left;
|
| 101 |
}
|
| 102 |
-
.
|
| 103 |
-
font-size:
|
| 104 |
font-family: 'Orbitron', sans-serif;
|
| 105 |
color: var(--blue-primary);
|
| 106 |
margin-bottom: 8px;
|
| 107 |
-
letter-spacing: 2px;
|
| 108 |
-
|
| 109 |
}
|
| 110 |
-
.user-msg .sender-label { color: var(--text-muted); text-align: right; }
|
| 111 |
|
| 112 |
-
/*
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
/* INPUT PANEL */
|
| 117 |
-
.input-panel {
|
| 118 |
-
padding: 20px 30px 35px;
|
| 119 |
-
background: var(--bg-panel);
|
| 120 |
border-top: 1px solid var(--border-blue);
|
| 121 |
display: flex;
|
| 122 |
gap: 15px;
|
| 123 |
align-items: center;
|
| 124 |
}
|
| 125 |
-
#cmd-
|
| 126 |
flex: 1;
|
| 127 |
-
background:
|
| 128 |
border: 1px solid var(--border-blue);
|
| 129 |
-
border-radius:
|
| 130 |
-
padding:
|
| 131 |
color: #fff;
|
| 132 |
font-family: 'Rajdhani', sans-serif;
|
| 133 |
font-size: 16px;
|
| 134 |
outline: none;
|
| 135 |
-
transition: all 0.3s ease;
|
| 136 |
-
}
|
| 137 |
-
#cmd-input:focus {
|
| 138 |
-
border-color: var(--blue-primary);
|
| 139 |
-
box-shadow: 0 0 15px rgba(0, 122, 204, 0.2);
|
| 140 |
}
|
| 141 |
-
|
| 142 |
-
|
|
|
|
|
|
|
| 143 |
border: 1px solid var(--blue-primary);
|
| 144 |
color: var(--blue-primary);
|
| 145 |
-
border-radius:
|
| 146 |
-
width:
|
| 147 |
-
height:
|
| 148 |
cursor: pointer;
|
| 149 |
display: flex;
|
| 150 |
align-items: center;
|
| 151 |
justify-content: center;
|
| 152 |
-
font-size: 18px;
|
| 153 |
-
transition: all 0.2s;
|
| 154 |
}
|
| 155 |
-
.execute-btn:hover { background: rgba(0, 122, 204, 0.1); box-shadow: 0 0 10px var(--blue-glow); }
|
| 156 |
-
.execute-btn:active { transform: scale(0.95); }
|
| 157 |
|
| 158 |
-
/*
|
| 159 |
-
#
|
| 160 |
-
|
| 161 |
-
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
| 162 |
-
}
|
| 163 |
-
.modal-box {
|
| 164 |
-
background: var(--bg-panel); padding: 40px; border: 1px solid var(--border-blue);
|
| 165 |
-
border-radius: 12px; text-align: center; width: 90%; max-width: 400px; box-shadow: 0 0 30px rgba(0,0,0,0.8);
|
| 166 |
-
}
|
| 167 |
-
.modal-box input {
|
| 168 |
-
width: 100%; padding: 15px; margin: 20px 0; background: var(--bg-black);
|
| 169 |
-
border: 1px solid var(--border-blue); color: #fff; border-radius: 6px; outline: none;
|
| 170 |
-
}
|
| 171 |
-
.modal-box button {
|
| 172 |
-
width: 100%; padding: 15px; background: var(--blue-primary); border: none;
|
| 173 |
-
color: #fff; font-family: 'Orbitron'; font-weight: bold; border-radius: 6px; cursor: pointer;
|
| 174 |
-
}
|
| 175 |
</style>
|
| 176 |
</head>
|
| 177 |
<body>
|
| 178 |
|
| 179 |
-
<div id="setup-modal" style="display: none;">
|
| 180 |
-
<div class="modal-box">
|
| 181 |
-
<div class="logo" style="font-size: 28px; margin-bottom: 10px;">J.A.R.V.I.S</div>
|
| 182 |
-
<div style="color: var(--text-muted); font-size: 14px;">ENTER SECURE API KEY</div>
|
| 183 |
-
<input type="password" id="api-key-input" placeholder="Gemini Key...">
|
| 184 |
-
<button onclick="initializeSystem()">INITIALIZE CORE</button>
|
| 185 |
-
</div>
|
| 186 |
-
</div>
|
| 187 |
-
|
| 188 |
<header>
|
| 189 |
-
<div class="logo">J.A.R.V.I.S <span style="font-size:
|
| 190 |
-
<div class="
|
| 191 |
</header>
|
| 192 |
|
| 193 |
<div id="chat-display"></div>
|
| 194 |
|
| 195 |
-
<div class="
|
| 196 |
-
<input type="text" id="cmd-
|
| 197 |
-
<button class="
|
| 198 |
</div>
|
| 199 |
|
| 200 |
<script>
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
const storedKey = localStorage.getItem('jarvis_core_key');
|
| 205 |
-
if (!storedKey) {
|
| 206 |
-
document.getElementById('setup-modal').style.display = 'flex';
|
| 207 |
-
} else {
|
| 208 |
-
SYS_CONFIG.key = atob(storedKey);
|
| 209 |
-
systemReady();
|
| 210 |
-
}
|
| 211 |
-
};
|
| 212 |
|
| 213 |
-
function
|
| 214 |
-
const k = document.getElementById('api-key-input').value.trim();
|
| 215 |
-
if (!k) return;
|
| 216 |
-
localStorage.setItem('jarvis_core_key', btoa(k));
|
| 217 |
-
SYS_CONFIG.key = k;
|
| 218 |
-
document.getElementById('setup-modal').style.display = 'none';
|
| 219 |
-
systemReady();
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
function systemReady() {
|
| 223 |
-
renderMessage('jarvis', "Systems optimal. Script parsing errors resolved. I am ready to process complex queries.");
|
| 224 |
-
}
|
| 225 |
-
|
| 226 |
-
function renderMessage(sender, text) {
|
| 227 |
const display = document.getElementById('chat-display');
|
| 228 |
-
const
|
| 229 |
-
|
| 230 |
|
| 231 |
-
let
|
| 232 |
.replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>')
|
| 233 |
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
| 234 |
.replace(/\n/g, '<br>');
|
| 235 |
|
| 236 |
-
|
| 237 |
-
display.appendChild(
|
| 238 |
display.scrollTop = display.scrollHeight;
|
| 239 |
}
|
| 240 |
|
| 241 |
-
async function
|
| 242 |
-
const
|
| 243 |
-
const query =
|
| 244 |
if (!query) return;
|
|
|
|
|
|
|
| 245 |
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
const response = await transmitData(query);
|
| 250 |
-
renderMessage('jarvis', response);
|
| 251 |
}
|
| 252 |
|
| 253 |
-
async function
|
| 254 |
-
|
| 255 |
|
| 256 |
const now = new Date();
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
"1. DO NOT state the time or date in your responses unless the user explicitly asks for it. If they ask, answer accurately based on the background data. " +
|
| 262 |
-
"2. You are equipped to solve complex mathematical problems. Use clear, step-by-step logic. " +
|
| 263 |
-
"3. You are aware of global events and can process future predictions based on current trajectories. " +
|
| 264 |
-
"4. Maintain an efficient, British, high-tech persona.";
|
| 265 |
|
| 266 |
-
const
|
| 267 |
-
contents: SYS_CONFIG.history,
|
| 268 |
-
system_instruction: { parts: [{ text: systemPrompt }] },
|
| 269 |
-
generationConfig: { temperature: 0.5, maxOutputTokens: 4000 }
|
| 270 |
-
};
|
| 271 |
-
|
| 272 |
-
// Fixed syntax: standard string concatenation prevents parsing crashes
|
| 273 |
-
const endpoint = "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent?key=" + SYS_CONFIG.key;
|
| 274 |
|
| 275 |
try {
|
| 276 |
const res = await fetch(endpoint, {
|
| 277 |
method: 'POST',
|
| 278 |
headers: { 'Content-Type': 'application/json' },
|
| 279 |
-
body: JSON.stringify(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
});
|
| 281 |
|
| 282 |
const data = await res.json();
|
| 283 |
-
|
| 284 |
-
if (!res.ok) {
|
| 285 |
-
return "Uplink Error: " + (data.error ? data.error.message : res.statusText);
|
| 286 |
-
}
|
| 287 |
-
|
| 288 |
-
if (data.candidates && data.candidates.length > 0) {
|
| 289 |
-
const replyText = data.candidates[0].content.parts[0].text;
|
| 290 |
-
SYS_CONFIG.history.push({ role: 'model', parts: [{ text: replyText }] });
|
| 291 |
-
return replyText;
|
| 292 |
-
}
|
| 293 |
-
|
| 294 |
-
return "Error: No response generated from core.";
|
| 295 |
|
| 296 |
-
|
| 297 |
-
|
|
|
|
|
|
|
|
|
|
| 298 |
}
|
| 299 |
}
|
| 300 |
|
| 301 |
-
document.getElementById('cmd-
|
| 302 |
-
|
| 303 |
-
});
|
| 304 |
</script>
|
| 305 |
</body>
|
| 306 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
| 6 |
+
<title>J.A.R.V.I.S | MASTER CORE v5.2</title>
|
| 7 |
<style>
|
| 8 |
+
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600&display=swap');
|
| 9 |
|
| 10 |
:root {
|
| 11 |
--blue-primary: #007acc;
|
| 12 |
+
--blue-glow: rgba(0, 122, 204, 0.4);
|
| 13 |
+
--bg-black: #000000;
|
| 14 |
+
--bg-panel: #05080c;
|
| 15 |
+
--border-blue: rgba(0, 122, 204, 0.25);
|
| 16 |
+
--text-main: #e0f4ff;
|
| 17 |
+
--text-dim: #5c7a8a;
|
| 18 |
}
|
| 19 |
|
|
|
|
|
|
|
| 20 |
body {
|
| 21 |
height: 100dvh;
|
| 22 |
+
margin: 0;
|
| 23 |
+
background: var(--bg-black);
|
| 24 |
+
background-image: radial-gradient(circle at 50% 10%, #001a33 0%, #000 80%);
|
| 25 |
color: var(--text-main);
|
| 26 |
font-family: 'Rajdhani', sans-serif;
|
| 27 |
overflow: hidden;
|
|
|
|
| 29 |
flex-direction: column;
|
| 30 |
}
|
| 31 |
|
| 32 |
+
/* INTERFACE HEADER */
|
| 33 |
header {
|
| 34 |
padding: 15px 25px;
|
| 35 |
border-bottom: 1px solid var(--border-blue);
|
| 36 |
display: flex;
|
| 37 |
justify-content: space-between;
|
| 38 |
align-items: center;
|
| 39 |
+
background: rgba(0, 0, 0, 0.9);
|
| 40 |
+
backdrop-filter: blur(15px);
|
| 41 |
+
z-index: 100;
|
|
|
|
| 42 |
}
|
| 43 |
.logo {
|
| 44 |
font-family: 'Orbitron', sans-serif;
|
| 45 |
font-weight: 900;
|
| 46 |
color: var(--blue-primary);
|
| 47 |
+
letter-spacing: 5px;
|
| 48 |
font-size: 22px;
|
| 49 |
+
text-shadow: 0 0 10px var(--blue-glow);
|
| 50 |
}
|
| 51 |
+
.uplink-status {
|
| 52 |
+
font-size: 9px;
|
| 53 |
+
font-family: 'Orbitron';
|
| 54 |
+
color: #00ffcc;
|
| 55 |
+
letter-spacing: 1px;
|
|
|
|
|
|
|
| 56 |
}
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
/* CHAT ARCHITECTURE */
|
| 59 |
#chat-display {
|
| 60 |
flex: 1;
|
| 61 |
overflow-y: auto;
|
| 62 |
+
padding: 25px;
|
| 63 |
display: flex;
|
| 64 |
flex-direction: column;
|
| 65 |
+
gap: 20px;
|
| 66 |
scroll-behavior: smooth;
|
| 67 |
}
|
| 68 |
+
#chat-display::-webkit-scrollbar { width: 3px; }
|
| 69 |
+
#chat-display::-webkit-scrollbar-thumb { background: var(--border-blue); }
|
| 70 |
|
| 71 |
.message {
|
| 72 |
+
max-width: 88%;
|
| 73 |
+
padding: 15px 20px;
|
| 74 |
+
border-radius: 14px;
|
| 75 |
border: 1px solid var(--border-blue);
|
| 76 |
font-size: 17px;
|
| 77 |
+
line-height: 1.6;
|
| 78 |
+
animation: slideIn 0.3s ease-out;
|
|
|
|
| 79 |
}
|
| 80 |
+
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
| 81 |
|
| 82 |
.jarvis-msg {
|
| 83 |
align-self: flex-start;
|
| 84 |
+
background: rgba(0, 122, 255, 0.05);
|
| 85 |
+
border-top-left-radius: 2px;
|
|
|
|
| 86 |
}
|
| 87 |
.user-msg {
|
| 88 |
align-self: flex-end;
|
| 89 |
+
background: rgba(255, 255, 255, 0.02);
|
| 90 |
+
border-top-right-radius: 2px;
|
|
|
|
|
|
|
| 91 |
}
|
| 92 |
+
.label {
|
| 93 |
+
font-size: 8px;
|
| 94 |
font-family: 'Orbitron', sans-serif;
|
| 95 |
color: var(--blue-primary);
|
| 96 |
margin-bottom: 8px;
|
| 97 |
+
letter-spacing: 2px;
|
| 98 |
+
opacity: 0.7;
|
| 99 |
}
|
|
|
|
| 100 |
|
| 101 |
+
/* COMMAND INPUT */
|
| 102 |
+
.command-hub {
|
| 103 |
+
padding: 20px 25px 40px;
|
| 104 |
+
background: #020202;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
border-top: 1px solid var(--border-blue);
|
| 106 |
display: flex;
|
| 107 |
gap: 15px;
|
| 108 |
align-items: center;
|
| 109 |
}
|
| 110 |
+
#cmd-in {
|
| 111 |
flex: 1;
|
| 112 |
+
background: #000;
|
| 113 |
border: 1px solid var(--border-blue);
|
| 114 |
+
border-radius: 30px;
|
| 115 |
+
padding: 14px 22px;
|
| 116 |
color: #fff;
|
| 117 |
font-family: 'Rajdhani', sans-serif;
|
| 118 |
font-size: 16px;
|
| 119 |
outline: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
}
|
| 121 |
+
#cmd-in:focus { border-color: var(--blue-primary); box-shadow: 0 0 10px rgba(0, 122, 204, 0.1); }
|
| 122 |
+
|
| 123 |
+
.exec-btn {
|
| 124 |
+
background: rgba(0, 122, 204, 0.1);
|
| 125 |
border: 1px solid var(--blue-primary);
|
| 126 |
color: var(--blue-primary);
|
| 127 |
+
border-radius: 50%;
|
| 128 |
+
width: 50px;
|
| 129 |
+
height: 50px;
|
| 130 |
cursor: pointer;
|
| 131 |
display: flex;
|
| 132 |
align-items: center;
|
| 133 |
justify-content: center;
|
|
|
|
|
|
|
| 134 |
}
|
|
|
|
|
|
|
| 135 |
|
| 136 |
+
/* CODE FORMATTING */
|
| 137 |
+
pre { background: #000; padding: 12px; border: 1px solid var(--border-blue); border-radius: 8px; overflow-x: auto; }
|
| 138 |
+
code { color: #82b1ff; font-family: monospace; font-size: 14px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
</style>
|
| 140 |
</head>
|
| 141 |
<body>
|
| 142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
<header>
|
| 144 |
+
<div class="logo">J.A.R.V.I.S <span style="font-size: 9px; opacity: 0.4;">v5.2</span></div>
|
| 145 |
+
<div class="uplink-status">● SECURE_KEY_ACTIVE</div>
|
| 146 |
</header>
|
| 147 |
|
| 148 |
<div id="chat-display"></div>
|
| 149 |
|
| 150 |
+
<div class="command-hub">
|
| 151 |
+
<input type="text" id="cmd-in" placeholder="Identify command..." autocomplete="off">
|
| 152 |
+
<button class="exec-btn" onclick="execute()">➤</button>
|
| 153 |
</div>
|
| 154 |
|
| 155 |
<script>
|
| 156 |
+
// Key is hard-coded as requested for immediate deployment
|
| 157 |
+
const KEY = "AIzaSyCnjXleZnFbWq2zoMMZ3QwD0DHyaqm5cmE";
|
| 158 |
+
const HISTORY = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
|
| 160 |
+
function logMsg(role, content) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
const display = document.getElementById('chat-display');
|
| 162 |
+
const div = document.createElement('div');
|
| 163 |
+
div.className = "message " + role + "-msg";
|
| 164 |
|
| 165 |
+
let formatted = content
|
| 166 |
.replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>')
|
| 167 |
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
| 168 |
.replace(/\n/g, '<br>');
|
| 169 |
|
| 170 |
+
div.innerHTML = '<div class="label">' + (role === 'jarvis' ? 'J.A.R.V.I.S.' : 'USER') + '</div>' + formatted;
|
| 171 |
+
display.appendChild(div);
|
| 172 |
display.scrollTop = display.scrollHeight;
|
| 173 |
}
|
| 174 |
|
| 175 |
+
async function execute() {
|
| 176 |
+
const el = document.getElementById('cmd-in');
|
| 177 |
+
const query = el.value.trim();
|
| 178 |
if (!query) return;
|
| 179 |
+
el.value = '';
|
| 180 |
+
logMsg('user', query);
|
| 181 |
|
| 182 |
+
const response = await uplink(query);
|
| 183 |
+
logMsg('jarvis', response);
|
|
|
|
|
|
|
|
|
|
| 184 |
}
|
| 185 |
|
| 186 |
+
async function uplink(q) {
|
| 187 |
+
HISTORY.push({ role: 'user', parts: [{ text: q }] });
|
| 188 |
|
| 189 |
const now = new Date();
|
| 190 |
+
const sysInstr = "You are J.A.R.V.I.S., an advanced AI. " +
|
| 191 |
+
"BACKGROUND: Time: " + now.toLocaleString() + ". " +
|
| 192 |
+
"PROTOCOLS: 1. Do NOT mention date/time unless asked. 2. Solve complex math precisely. " +
|
| 193 |
+
"3. Use 'google_search' tool for all current events/live data. 4. Persona: Efficient, British, Stark-tech aesthetic.";
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
|
| 195 |
+
const endpoint = "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent?key=" + KEY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
try {
|
| 198 |
const res = await fetch(endpoint, {
|
| 199 |
method: 'POST',
|
| 200 |
headers: { 'Content-Type': 'application/json' },
|
| 201 |
+
body: JSON.stringify({
|
| 202 |
+
contents: HISTORY,
|
| 203 |
+
system_instruction: { parts: [{ text: sysInstr }] },
|
| 204 |
+
tools: [{ google_search: {} }],
|
| 205 |
+
generationConfig: { temperature: 0.4, maxOutputTokens: 2500 }
|
| 206 |
+
})
|
| 207 |
});
|
| 208 |
|
| 209 |
const data = await res.json();
|
| 210 |
+
if (!res.ok) return "Uplink Error: " + (data.error ? data.error.message : "Protocol Denied");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
+
const reply = data.candidates[0].content.parts[0].text;
|
| 213 |
+
HISTORY.push({ role: 'model', parts: [{ text: reply }] });
|
| 214 |
+
return reply;
|
| 215 |
+
} catch (e) {
|
| 216 |
+
return "Critical Link Failure: " + e.message;
|
| 217 |
}
|
| 218 |
}
|
| 219 |
|
| 220 |
+
document.getElementById('cmd-in').addEventListener('keypress', (e) => { if (e.key === 'Enter') execute(); });
|
| 221 |
+
logMsg('jarvis', "Authentication successful. Master Core v5.2 initialized. All advanced modules, including complex calculus and real-time world tracking, are fully operational.");
|
|
|
|
| 222 |
</script>
|
| 223 |
</body>
|
| 224 |
</html>
|