aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / docs / design / tools / make-screens.mjs
| 1 | // make-screens.mjs -- writes the plain first-run mockups (every screen except 04 and 05b) into the current directory. |
| 2 | // cd docs/design/screens && node ../tools/make-screens.mjs |
| 3 | import { writeFileSync } from "node:fs"; |
| 4 | const page = (file, title, tag, cls, body) => writeFileSync(file, `<!doctype html> |
| 5 | <html lang="en"> |
| 6 | <head> |
| 7 | <meta charset="utf-8"> |
| 8 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 9 | <title>${title}</title> |
| 10 | <link rel="stylesheet" href="screens.css"> |
| 11 | </head> |
| 12 | <body> |
| 13 | <div class="board ${cls}"> |
| 14 | <div class="tag">${tag}</div> |
| 15 | ${body.trim().split("\n").map((l) => " " + l).join("\n")} |
| 16 | </div> |
| 17 | <script src="allen-font.js"></script> |
| 18 | <script src="screen.js"></script> |
| 19 | </body> |
| 20 | </html> |
| 21 | `); |
| 22 | const says = (text, top, at, extra = "") => `<p class="says center rise" style="top: ${top}px"${at !== undefined ? ` data-at="${at}"` : ""} data-af="voice"${extra}>${text}</p>`; |
| 23 | const btns = (top, items) => `<div class="buttons" style="top: ${top}px">\n${items.map(([t, href, lit]) => ` <div class="button rise${lit ? " lit" : ""}" data-href="${href}"><span data-af="body">${t}</span></div>`).join("\n")}\n</div>`; |
| 24 | const choices = (top, items) => `<div class="choices" style="top: ${top}px" role="listbox">\n${items.map(([t, w, href, lit]) => ` <div class="choice rise${lit ? " lit" : ""}" data-href="${href}"><span data-af="body">${t}</span><span class="what" data-af="small">${w}</span><span class="key" data-af="small">Enter</span></div>`).join("\n")}\n</div>`; |
| 25 | const found = (top, rows) => `<div class="found" style="top: ${top}px">\n${rows.map(([l, v, cls = ""]) => ` <span class="label rise" data-af="body">${l}</span><span class="value rise ${cls}" data-af="body">${v}</span>`).join("\n")}\n</div>`; |
| 26 | const bar = (text, focus = false) => `<div class="bar rise${focus ? " focus" : ""}">${text}</div>`; |
| 27 | |
| 28 | page("01-power-on.html", "Screen 1: power on", "1 · power on (the maker's logo natively; a black window in aienos-run; we draw nothing)", "", `<span hidden data-href="02-night.html"></span>`); |
| 29 | |
| 30 | page("02-night.html", "Screen 2: the night", "2 · the night (still at 11.8 s; live reference: ../boot/night.html)", "", ` |
| 31 | <div class="board-still" style="position:absolute;inset:0;background:url('assets/night-11800.jpg') center/cover"></div> |
| 32 | <div class="buttons" style="top: 980px"><div class="button rise" data-href="../boot/night.html"><span data-af="small">Play the night with its sound</span></div><div class="button lit rise" data-href="03-allen-arrives.html"><span data-af="small">Next screen</span></div></div>`); |
| 33 | |
| 34 | page("03-allen-arrives.html", "Screen 3: Allen arrives", "3 · Allen arrives", "sky", ` |
| 35 | ${says("Hello. I'm Allen.", 640, 0)} |
| 36 | ${says("I'm going to look after this computer with you.", 690, 1400)} |
| 37 | ${bar('<span data-af="body">What would you like this computer to do best?</span>').replace('class="bar rise"', 'class="bar rise" data-at="3600"')} |
| 38 | <span class="not-now" hidden data-href="04-intent.html"></span> |
| 39 | <div class="buttons" style="top: 1100px"><div class="button lit" data-href="04-intent.html"><span data-af="small">next</span></div></div>`); |
| 40 | |
| 41 | page("03b-still-starting.html", "Screen 3, slow: still starting", "3 · slow step: what Allen says when a step passes its budget (here 5 s)", "sky", ` |
| 42 | ${says('Still starting. The disk is slow to answer.', 640, 0)} |
| 43 | <div class="center rise" style="position:absolute;left:0;right:0;top:700px"><span class="dot"></span></div>`); |
| 44 | |
| 45 | page("04b-something-else.html", "Screen 4: something else", "4 · something else: Allen says what he understood", "sky", ` |
| 46 | ${says("You want a quiet computer for writing. I'll keep things simple and save power.", 640, 0, ' data-wrap="900"')} |
| 47 | ${btns(760, [["That's right", "05-getting-to-know.html", true], ["Not quite", "04-intent.html"]])} |
| 48 | ${bar('<span class="typed" data-af="body">I mostly write, and I like it quiet</span><span class="caret"></span>', true)}`); |
| 49 | |
| 50 | page("05-getting-to-know.html", "Screen 5: getting to know this computer", "5 · getting to know this computer (example values; each line eases in as soon as it is known)", "sky", ` |
| 51 | ${says("Getting to know this computer.", 590, 0)} |
| 52 | ${found(652, [["Screen", "2560 by 1440, 144 times a second"], ["Graphics", "NVIDIA GeForce RTX 4070, 12 GB of its own memory"], ["Processor", "AMD Ryzen 7 7800X3D, 8 cores"], ["Memory", "32 GB"], ["Storage", "1 TB fast drive, 2 TB drive"], ["Network", "wired, connected"], ["Sound", "speakers and a microphone"], ["Keyboard and mouse", "working"]])} |
| 53 | <div class="rise" style="position:absolute;left:880px;top:928px"><span class="dot"></span></div> |
| 54 | <span class="not-now" hidden data-href="05b-what-allen-found.html"></span> |
| 55 | <div class="buttons" style="top: 1100px"><div class="button lit" data-href="05b-what-allen-found.html"><span data-af="small">next</span></div></div>`); |
| 56 | |
| 57 | page("06-consent.html", "Screen 6: the one consent", "6 · the one consent (the list holds only what changes the machine)", "sky", ` |
| 58 | ${says("Here's what I'd like to set up:", 560, 0)} |
| 59 | <div class="panel rise" style="left: 640px; top: 616px; width: 640px"> |
| 60 | <p data-af="body" style="margin: 4px 0 14px">Use my own drivers for the graphics, network and storage</p> |
| 61 | <p data-af="body" style="margin: 0 0 14px">Set your screen to 144 times a second</p> |
| 62 | <p data-af="body" style="margin: 0 0 14px">Run the AI on your graphics card</p> |
| 63 | <p data-af="body" style="margin: 0 0 18px">Build drivers for the 2 parts I can't drive yet</p> |
| 64 | <p data-af="small" style="color: var(--allen-colors-hint); margin: 0">I won't touch your other drives, and you can undo any of this.</p> |
| 65 | </div> |
| 66 | ${btns(880, [["Set it up", "07a-games.html", true], ["Show me each one", "06b-show-each.html"], ["Not now", "09-ready.html"]])}`); |
| 67 | |
| 68 | page("06b-show-each.html", "Screen 6: one at a time", "6 · show me each one (1 of 4)", "sky", ` |
| 69 | <p class="center rise" style="position:absolute;left:0;right:0;top:600px;color:var(--allen-colors-hint)" data-af="small">1 of 4</p> |
| 70 | ${says("Use my own drivers for the graphics, network and storage?", 640, 120, ' data-wrap="900"')} |
| 71 | ${btns(740, [["Yes", "06b-show-each.html", true], ["Skip", "06b-show-each.html"]])}`); |
| 72 | |
| 73 | page("07a-games.html", "Screen 7a: making games smoother", "7a · play games smoothly (example values; every number measured on this machine)", "sky", ` |
| 74 | ${says("Making games smoother.", 590, 0)} |
| 75 | ${found(652, [["Screen", "set to 144 times a second", ""], ["Graphics", "using my driver", ""], ["Processor", "keeping the fast cores free for the game", ""], ["Measured here", "118 frames a second in my test scene (before: 97)", ""]])} |
| 76 | <p class="center rise" style="position:absolute;left:0;right:0;top:820px;color:var(--allen-colors-hint)" data-af="body">I can't tune this graphics card's clock speed yet. I'm building a driver that can.</p> |
| 77 | ${btns(900, [["Next", "07b-ai-fit.html", true]])}`); |
| 78 | |
| 79 | page("07b-ai-fit.html", "Screen 7b: finding the best way to run an AI", "7b · run an AI model here (fit from the model's measured size, not a table)", "sky", ` |
| 80 | ${says("Finding the best way to run an AI here.", 590, 0)} |
| 81 | <p class="center rise" style="position:absolute;left:460px;width:1000px;top:660px;color:var(--allen-colors-primary)" data-af="body" data-wrap="1000">Your graphics card has 12 GB of its own memory. Models up to about 14 billion parameters fit on it. The 30 billion one fits if I share it with main memory, but it runs slower.</p> |
| 82 | ${btns(800, [["Next", "07c-one-found.html", true]])}`); |
| 83 | |
| 84 | page("07c-one-found.html", "Screen 7c: one model found", "7c · which AI: exactly one found (lit choice is taken after 10 s, and Allen says so)", "sky", ` |
| 85 | ${says("I found Qwen 30B on this computer. I'll use it.", 640, 0)} |
| 86 | ${btns(720, [["Use it", "09-ready.html", true], ["Choose another", "07c-several.html"]])} |
| 87 | <p class="center rise" style="position:absolute;left:0;right:0;top:796px;color:var(--allen-colors-faint)" data-af="small">I'll go with this in 10 seconds</p>`); |
| 88 | |
| 89 | page("07c-several.html", "Screen 7c: several found", "7c · which AI: several found (best fit first and lit)", "sky", ` |
| 90 | ${says("I found three. The first one fits this computer best.", 600, 0)} |
| 91 | ${choices(660, [["Qwen 30B", "Runs on your graphics card", "09-ready.html", true], ["Llama 8B", "Runs on your graphics card, quicker, shorter answers", "09-ready.html"], ["Qwen 27B on the Spark", "On the Spark next door, fast", "09-ready.html"], ["Connect my own", "Claude, ChatGPT or another service", "07c-connect.html"]])}`); |
| 92 | |
| 93 | page("07c-none.html", "Screen 7c: none found", "7c · which AI: none found", "sky", ` |
| 94 | ${says("I didn't find an AI model on this computer.", 620, 0)} |
| 95 | ${choices(690, [["Get one for me", "The 30B model, an 18 GB download", "09-ready.html", true], ["Connect my own", "Claude, ChatGPT or another service", "07c-connect.html"]])} |
| 96 | <p class="not-now center rise" style="top: 820px" data-af="small" data-href="09-ready.html">Not now</p>`); |
| 97 | |
| 98 | page("07c-connect.html", "Screen 7c: connect my own", "7c · connect my own: which service", "sky", ` |
| 99 | ${says("Which service?", 620, 0)} |
| 100 | ${btns(690, [["Claude", "07c-key.html", true], ["ChatGPT", "07c-key.html"], ["Another service", "07c-key.html"]])}`); |
| 101 | |
| 102 | page("07c-key.html", "Screen 7c: paste a key", "7c · paste your key (checking it with one short request)", "sky", ` |
| 103 | ${says("Paste your key for Claude. I'll keep it sealed on this computer and won't show it again.", 620, 0, ' data-wrap="900"')} |
| 104 | <p class="center rise" style="position:absolute;left:0;right:0;top:860px;color:var(--allen-colors-hint)" data-af="small">Checking the key <span class="dot" style="margin-left:10px"></span></p> |
| 105 | ${bar('<span class="typed" data-af="body">********************************</span><span class="caret"></span>', true)}`); |
| 106 | |
| 107 | page("07c-key-failed.html", "Screen 7c: the key did not work", "7c · the key did not work", "sky", ` |
| 108 | ${says("That key didn't work. Claude said the key isn't valid. Try again?", 620, 0, ' data-wrap="900"')} |
| 109 | ${btns(720, [["Try again", "07c-key.html", true], ["Use a different service", "07c-connect.html"]])}`); |
| 110 | |
| 111 | page("08-hardware.html", "Screen 8: setting up your hardware", "8 · setting up your hardware (six state words, nothing else)", "sky", ` |
| 112 | ${says("Setting up your hardware.", 590, 0)} |
| 113 | ${found(652, [["Graphics (AMD Radeon Pro 580)", "ready, my driver", "state"], ["Network (Broadcom)", "ready, my driver", "state"], ["Wi-Fi (Broadcom BCM4360)", "building a driver for it", "state"], ["Webcam", "ready, the maker's driver", "state"]])} |
| 114 | <p class="center rise" style="position:absolute;left:0;right:0;top:820px;color:var(--allen-colors-hint)" data-af="small">Building a driver can take a while. You can keep using the computer.</p> |
| 115 | ${bar('<span data-af="body">Speak to Allen</span>')}`); |
| 116 | |
| 117 | page("08b-turn-on.html", "Screen 8: the second consent", "8 · the second consent (only when a built driver is ready)", "sky", ` |
| 118 | ${says("I built a driver for your Wi-Fi and tested it without touching the real one. Turn it on?", 620, 0, ' data-wrap="900"')} |
| 119 | ${btns(740, [["Turn it on", "09-ready.html", true], ["Not now", "09-ready.html"]])}`); |
| 120 | |
| 121 | page("08c-put-back.html", "Screen 8: it failed, the old one is back", "8 · a built driver failed on the real device: Allen undoes it by himself", "sky", ` |
| 122 | ${says("That didn't work on the real Wi-Fi. I've put the old driver back, and I'll keep working on it.", 640, 0, ' data-wrap="900"')} |
| 123 | ${bar('<span data-af="body">Speak to Allen</span>')}`); |
| 124 | |
| 125 | page("09-ready.html", "Screen 9: Allen is ready", "9 · Allen is ready", "sky", ` |
| 126 | ${says("Allen is ready.", 600, 0)} |
| 127 | <p class="center rise" style="position:absolute;left:460px;width:1000px;top:664px;color:var(--allen-colors-hint)" data-af="body" data-wrap="1000">Games will use your screen at 144 times a second. Your AI is Qwen 30B, on your graphics card. I'm still building a driver for your Wi-Fi and I'll tell you when it's ready.</p> |
| 128 | ${says("Ask me anything, or tell me what you'd like to do.", 800, 900)} |
| 129 | ${bar('<span data-af="body">Speak to Allen</span><span class="caret"></span>', true)}`); |