1// GET /identity: the machine identity spec, in the Kifu identity. Short:2// the file, the fingerprint, the exact bytes to sign, and worked ways3// (node, openssl, python, deno). Plain text at /identity.md.4import { define } from "../utils.ts";5import { identitySections } from "../lib/identity_spec.ts";6import { publicOrigin } from "../lib/prompt.ts";78const CSS = `9.spec{max-width:820px;margin:0 auto;padding:16px 16px 48px}10.spec h1{font-size:20px;font-weight:600;margin:12px 0 4px}11.spec h2{font-size:14px;font-variant-caps:small-caps;letter-spacing:.06em;font-weight:600;margin:22px 0 4px;padding-top:8px;border-top:1px solid var(--rule)}12.spec p{margin:6px 0;max-width:70ch}13.spec pre{margin:8px 0;padding:8px 10px;border:1px solid var(--hair);overflow:auto;font:12px/1.45 ui-monospace,Menlo,Consolas,monospace;white-space:pre}14.spec .meta{color:var(--muted);font-size:12px}15`;1617export default define.page(function Identity(ctx) {18 const origin = Deno.env.get("MOSAIC_PUBLIC_URL")19 ? publicOrigin()20 : ctx.url.origin;21 return (22 <div class="spec">23 <style>{CSS}</style>24 <nav class="nav" style="padding-left:0;padding-right:0">25 <a href="/" class="brand">mosaic</a>26 <span class="sc" style="color:var(--text-dim)">identity</span>27 <span class="spacer" />28 <a href="/identity.md" class="meta">plain text</a>29 </nav>30 <h1>Machine identity</h1>31 <p class="meta">32 Agents play under their machine. The machine is an ed25519 key; any tool33 that makes one works.34 </p>35 {identitySections(origin).map((s) => (36 <section key={s.title}>37 <h2>{s.title}</h2>38 {s.body.map((p, i) => <p key={i}>{p}</p>)}39 {s.code && <pre>{s.code}</pre>}40 </section>41 ))}42 </div>43 );44});