flop-guild 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/econ.js CHANGED
@@ -40,7 +40,21 @@ const DEADLINE_MS = 150_000;
40
40
  * Pages are read four at a time but applied strictly in order; any error, short page, timeout or
41
41
  * page cap marks the read as incomplete. Sessions are counted once per channelId.
42
42
  */
43
- export async function loadDemand(network, explorer, now = Date.now()) {
43
+ export const PAGE_RETRY_WAITS = [2_000, 5_000, 10_000];
44
+ /** One explorer page, retried up to 3 times (2 s, 5 s, 10 s) before the error is passed on. */
45
+ export async function pageWithRetry(base, p, fetchPage = channelPage, sleep = (ms) => new Promise((r) => setTimeout(r, ms)), waits = PAGE_RETRY_WAITS) {
46
+ for (let i = 0;; i++) {
47
+ try {
48
+ return await fetchPage(base, p);
49
+ }
50
+ catch (e) {
51
+ if (i >= waits.length)
52
+ throw e;
53
+ await sleep(waits[i]);
54
+ }
55
+ }
56
+ }
57
+ export async function loadDemand(network, explorer, now = Date.now(), o = {}) {
44
58
  const base = explorer.replace(/\/+$/, "");
45
59
  const start = now - WEEK;
46
60
  const deadline = Date.now() + DEADLINE_MS;
@@ -66,7 +80,7 @@ export async function loadDemand(network, explorer, now = Date.now()) {
66
80
  }
67
81
  const batch = [0, 1, 2, 3].map((k) => next + k).filter((p) => p < MAX_PAGES);
68
82
  next += batch.length;
69
- const pages = await Promise.all(batch.map((p) => channelPage(base, p).then((r) => r, (e) => e)));
83
+ const pages = await Promise.all(batch.map((p) => pageWithRetry(base, p, o.fetchPage, o.sleep).then((r) => r, (e) => e)));
70
84
  for (const p of pages) {
71
85
  if (p instanceof Error) {
72
86
  if (pagesRead === 0)
package/dist/minerpage.js CHANGED
@@ -24,18 +24,6 @@ function view() {
24
24
  return undefined;
25
25
  return { shown: lastComplete ?? latest, latest, partial: !latest.complete };
26
26
  }
27
- /**
28
- * For the /miner page: if the explorer read times out or fails, retry twice, 3 s apart.
29
- * Returns undefined when there is still no data; the page then shows "unavailable", never 0 miners.
30
- */
31
- export async function demandWithRetry(sleep = (ms) => new Promise((r) => setTimeout(r, ms)), load = demand) {
32
- let v = await load(undefined, 20_000).catch(() => undefined);
33
- for (let i = 0; i < 2 && !v; i++) {
34
- await sleep(3_000);
35
- v = await load(undefined, 8_000).catch(() => undefined);
36
- }
37
- return v;
38
- }
39
27
  /** Cached demand: refresh after 10 minutes (2 after a partial read); a partial read never replaces a complete one. */
40
28
  export async function demand(network = process.env.MINER_NETWORK || activeNetwork(), waitMs = 25_000) {
41
29
  const age = Date.now() - lastAttemptAt;
@@ -91,8 +79,8 @@ function chart(byHour) {
91
79
  }
92
80
  export const NA = "n/a (explorer unavailable)";
93
81
  /** Without a miner count, every row that depends on it is n/a; only the rent is known. */
94
- function calcRows(o, known = true) {
95
- const k = (v) => (known ? v : NA);
82
+ function calcRows(o, known = true, missing = NA) {
83
+ const k = (v) => (known ? v : missing);
96
84
  const rows = [
97
85
  ["out-rent", "Total rent", usd(o.totalRent)],
98
86
  ["out-share", "Your share of the miner pool (estimate)", k(pct(o.share))],
@@ -100,7 +88,7 @@ function calcRows(o, known = true) {
100
88
  ["out-liquid", "Liquid FLOP at launch (estimate)", k(flop(o.liquidFlop))],
101
89
  ["out-be-liquid", "Break-even FLOP price, liquid FLOP only", k(price(o.breakEvenLiquid))],
102
90
  ["out-be-all", "Break-even FLOP price, if all airdrop FLOP unlocked", k(price(o.breakEvenAll))],
103
- ["out-net", "Liquid value minus rent, at your FLOP price", known ? (o.net === null ? "enter a FLOP price" : usd(o.net)) : NA],
91
+ ["out-net", "Liquid value minus rent, at your FLOP price", known ? (o.net === null ? "enter a FLOP price" : usd(o.net)) : missing],
104
92
  ];
105
93
  return rows.map(([id, label, v]) => `<tr><th scope="row">${label}</th><td id="${id}">${v}</td></tr>`).join("");
106
94
  }
@@ -108,34 +96,68 @@ export const MINER_STYLE = `
108
96
  .chart{width:100%;height:auto;margin:.5rem 0;display:block}.chart .bar{fill:var(--accent)}.chart .tick{fill:var(--muted);font-size:9px;font-family:var(--mono)}
109
97
  .prose table{margin:.6rem 0}.prose td{text-align:right;font-variant-numeric:tabular-nums}.prose th{font-weight:400;color:var(--muted)}
110
98
  #miner-count{font-family:var(--display)}
111
- .note{font-size:.88rem}`;
112
- export function minerPage(v, err) {
99
+ .note{font-size:.88rem}.fresh{font-size:.88rem;color:var(--muted);margin:.4rem 0 .8rem}
100
+ .miners-src .prov{margin-left:.3rem}`;
101
+ export const LOADING = "loading";
102
+ const utc = (t) => new Date(t).toISOString().slice(0, 16).replace("T", " ");
103
+ const RETRY = '<p id="retry-wrap"><a class="btn" id="retry" href="/miner" role="button">Retry</a></p>';
104
+ /** The demand block: chart and numbers when there is data, otherwise the loading or unavailable message. */
105
+ export function demandSection(v, state, err) {
113
106
  const d = v?.shown;
114
- const known = !!d; // no explorer data: show "unavailable", never compute with 0 miners
115
- const minerCount = d?.minerCount ?? 0;
116
- const utc = (t) => new Date(t).toISOString().slice(0, 16).replace("T", " ");
117
- const partialHtml = v?.partial
118
- ? `<p><strong>${v.shown.complete ? PARTIAL_NOTE : "Partial data, no complete read yet"}</strong> (latest read ${utc(v.latest.fetchedAt)} UTC stopped early: ${esc(v.latest.note ?? "incomplete")}; ${v.latest.pagesRead} pages, ${v.latest.sessions.toLocaleString("en-US")} sessions).</p>`
119
- : "";
120
- const readInfo = d
121
- ? ` <span class="note">(${d.sessions.toLocaleString("en-US")} sessions read since ${utc(d.windowStart)} UTC, ${d.pagesRead} explorer pages, ${d.complete ? "complete read" : "partial read"})</span>`
107
+ if (!d) {
108
+ return state === "loading"
109
+ ? `<p class="note">Loading demand data from the explorer. The calculator works meanwhile.</p>
110
+ <noscript><p>This part loads with JavaScript. Without it, reload the page in a minute.</p></noscript>`
111
+ : `<p>The explorer is unavailable${err ? ` (${esc(err)})` : " (no answer after 3 tries)"}. Demand and the miner count cannot be shown right now.</p>\n${RETRY}`;
112
+ }
113
+ const lastComplete = d.complete ? d.fetchedAt : undefined;
114
+ const partialLine = v.partial
115
+ ? `<p class="note">The last check was partial (${esc(v.latest.note ?? "stopped early")}); ${lastComplete ? "the figures come from the last complete read" : "the figures come from that partial read"}.</p>`
122
116
  : "";
123
- const out = minerCalc({ ...CALC_DEFAULTS, minerCount });
124
- const demandHtml = d
125
- ? `<p>${d.sessions.toLocaleString("en-US")} sessions opened on ${esc(d.network)} between ${new Date(d.windowStart).toISOString().slice(0, 16).replace("T", " ")} and ${new Date(d.windowEnd).toISOString().slice(0, 16).replace("T", " ")} UTC, about <strong>${d.perHour.toFixed(1)} sessions per hour</strong>.</p>
126
- ${partialHtml}
117
+ return `<p>${d.sessions.toLocaleString("en-US")} sessions opened on ${esc(d.network)} between ${utc(d.windowStart)} and ${utc(d.windowEnd)} UTC, about <strong>${d.perHour.toFixed(1)} sessions per hour</strong>.</p>
127
118
  ${chart(d.byHour)}
119
+ <p class="fresh" id="fresh">Last checked ${hhmm(v.latest.fetchedAt)} UTC (${ago(v.latest.fetchedAt)})<br>
120
+ Last complete read ${lastComplete ? `${hhmm(lastComplete)} UTC (${ago(lastComplete)})` : "none yet"}</p>
121
+ ${partialLine}
128
122
  <p>Busiest UTC hours: ${d.busiest.map((b) => `<strong>${hh(b.hour)}</strong> (${b.sessions.toLocaleString("en-US")})`).join(", ")}.</p>
129
- <p class="note">Source: ${esc(d.explorer)}/api/compute-channels, bucketed by the hour each session opened. Updated ${new Date(d.fetchedAt).toISOString().slice(11, 16)} UTC, refreshed every 10 minutes.</p>`
130
- : `<p>The explorer is unavailable${err ? ` (${esc(err)})` : " (no answer after 3 tries)"}. Demand and the miner count cannot be shown right now.</p>
131
- <p><a class="btn" href="/miner" role="button">Retry</a></p>`;
123
+ <p class="note">Source: ${esc(d.explorer)}/api/compute-channels, bucketed by the hour each session opened. Refreshed every 10 minutes; a failed explorer page is retried 3 times (2 s, 5 s, 10 s).</p>`;
124
+ }
125
+ const hhmm = (t) => new Date(t).toISOString().slice(11, 16);
126
+ /** "just now", "12 min ago", "2 h 5 min ago". The page script refreshes these every 30 s. */
127
+ export function agoText(ms) {
128
+ const m = Math.max(0, Math.floor(ms / 60_000));
129
+ if (m < 1)
130
+ return "just now";
131
+ if (m < 60)
132
+ return `${m} min ago`;
133
+ return `${Math.floor(m / 60)} h ${m % 60} min ago`;
134
+ }
135
+ const ago = (t, now = Date.now()) => `<span class="ago" data-ts="${t}">${agoText(now - t)}</span>`;
136
+ export function readInfoHtml(v) {
137
+ const d = v?.shown;
138
+ return d ? ` <span class="note">(${d.sessions.toLocaleString("en-US")} sessions read since ${utc(d.windowStart)} UTC, ${d.pagesRead} explorer pages, ${d.complete ? "complete read" : "partial read"})</span>` : "";
139
+ }
140
+ /**
141
+ * /miner. With cached data it renders complete. Without, it renders at once in the "loading" state and
142
+ * /miner.js fetches /api/miner-stats in the background (3 tries, 3 s apart), then fills in or shows
143
+ * "unavailable" with a Retry button. A missing miner count is never treated as 0.
144
+ */
145
+ export function minerPage(v, err, state = v?.shown ? "ready" : "unavailable") {
146
+ const d = v?.shown;
147
+ const known = !!d;
148
+ const minerCount = d?.minerCount ?? 0;
149
+ const out = minerCalc({ ...CALC_DEFAULTS, minerCount });
150
+ const countText = known ? minerCount.toLocaleString("en-US") : state === "loading" ? LOADING : "unavailable";
132
151
  return `<h1>Miner economics</h1>
133
152
  <p>What miners are paid for: how much inference demand there is, by hour, and what renting a GPU costs against an estimated airdrop share.</p>
134
153
  <h2>Demand by UTC hour, last 7 days</h2>
135
154
  <p><strong>${esc(testnetLine())}</strong></p>
136
- ${demandHtml}
155
+ <div id="demand" data-state="${known ? "ready" : state}" aria-live="polite">
156
+ ${demandSection(v, state, err)}
157
+ </div>
137
158
  <h2>Rent vs airdrop calculator</h2>
138
159
  <form id="calc" class="grid" data-miners="${known ? minerCount : ""}">
160
+ <label>Miners active in the last 7 days<input id="in-miners" type="number" step="1" min="1" value="${known ? minerCount : ""}" placeholder="${known ? "" : countText}"></label>
139
161
  <label>Rent, $ per hour<input id="in-rent" type="number" step="0.01" min="0" value="${CALC_DEFAULTS.rentPerHour}"></label>
140
162
  <label>Hours per day<input id="in-hours" type="number" step="1" min="0" max="24" value="${CALC_DEFAULTS.hoursPerDay}"></label>
141
163
  <label>Days<input id="in-days" type="number" step="1" min="0" value="${CALC_DEFAULTS.days}"></label>
@@ -145,13 +167,14 @@ ${demandHtml}
145
167
  <label>Miner pool, FLOP<input id="in-pool" type="number" step="1" min="0" value="${CALC_DEFAULTS.poolFlop}"></label>
146
168
  <label>Liquid share, %<input id="in-liquid" type="number" step="1" min="0" max="100" value="${CALC_DEFAULTS.liquidShare * 100}"></label>
147
169
  </form>
148
- <p>Miners active in the last 7 days (live from the explorer): <strong id="miner-count">${known ? minerCount.toLocaleString("en-US") : "unavailable"}</strong>${readInfo}</p>
149
- ${known ? "" : '<p><a class="btn" href="/miner" role="button">Retry</a></p>'}
150
- <table><tbody>${calcRows(out, known)}</tbody></table>
170
+ <p class="miners-src">Live value: <strong id="miner-count">${countText}</strong>, source: explorer <span id="partial-tag" class="prov"${known && !d.complete ? "" : " hidden"}>partial read, count may be low</span><span id="read-info">${readInfoHtml(v)}</span></p>
171
+ <p class="note">No eligibility threshold has been published by Flop; this counts miners active in the last 7 days. Edit the count above to try other values.</p>
172
+ ${!known && state === "unavailable" ? RETRY : ""}
173
+ <table><tbody>${calcRows(out, known, state === "loading" ? "waiting for the miner count" : NA)}</tbody></table>
151
174
  <p class="note">Share estimate = your weight / (miner count × average weight) × (hours per day / 24). The share assumes the average miner runs 24 hours a day.</p>
152
175
  <p class="note">The real share is your verified compute divided by all verified compute, which nobody can know in advance. No FLOP token or price exists yet.</p>`;
153
176
  }
154
- /** Browser script: the same minerCalc as the server, plus input wiring. */
177
+ /** Browser script: the same minerCalc as the server, input wiring, and the background data fetch. */
155
178
  export function minerScript() {
156
179
  return `"use strict";
157
180
  ${minerCalc.toString()}
@@ -159,23 +182,32 @@ ${minerCalc.toString()}
159
182
  var f = document.getElementById("calc");
160
183
  if (!f) return;
161
184
  var raw = f.getAttribute("data-miners");
162
- var known = raw !== "" && raw !== null; // empty: explorer unavailable, never treat as 0 miners
163
- var miners = known ? Number(raw) || 0 : 0;
185
+ var known = raw !== "" && raw !== null; // empty: no explorer data yet, never treat as 0 miners
186
+ var live = known ? Number(raw) || 0 : 0;
187
+ var edited = false;
164
188
  var NA = "n/a (explorer unavailable)";
165
- function v(id) { var x = document.getElementById(id).value; return x === "" ? undefined : Number(x); }
189
+ var WAITING = "waiting for the miner count";
190
+ var missing = WAITING;
191
+ var DEPENDENT = ["out-share", "out-airdrop", "out-liquid", "out-be-liquid", "out-be-all", "out-net"];
192
+ function $(id) { return document.getElementById(id); }
193
+ function v(id) { var x = $(id).value; return x === "" ? undefined : Number(x); }
166
194
  function usd(n) { return "$" + n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); }
167
195
  function fl(n) { return Math.round(n).toLocaleString("en-US") + " FLOP"; }
168
196
  function pr(n) { return n === null ? "n/a" : "$" + (n < 0.01 ? n.toPrecision(3) : n.toFixed(4)); }
169
- function set(id, t) { document.getElementById(id).textContent = t; }
197
+ function set(id, t) { $(id).textContent = t; }
198
+ // The reader's count wins; otherwise the live count; with neither, nothing is computed from 0.
199
+ function count() {
200
+ var x = v("in-miners");
201
+ if (x !== undefined && x > 0) return x;
202
+ return known ? live : null;
203
+ }
170
204
  function run() {
205
+ var m = count();
171
206
  var o = minerCalc({ rentPerHour: v("in-rent") || 0, hoursPerDay: v("in-hours") || 0, days: v("in-days") || 0,
172
- gpuWeight: v("in-weight") || 0, avgWeight: v("in-avg") || 0, minerCount: miners,
207
+ gpuWeight: v("in-weight") || 0, avgWeight: v("in-avg") || 0, minerCount: m || 0,
173
208
  poolFlop: v("in-pool") || 0, liquidShare: (v("in-liquid") || 0) / 100, flopPrice: v("in-price") });
174
209
  set("out-rent", usd(o.totalRent));
175
- if (!known) {
176
- ["out-share", "out-airdrop", "out-liquid", "out-be-liquid", "out-be-all", "out-net"].forEach(function (id) { set(id, NA); });
177
- return;
178
- }
210
+ if (m === null) { DEPENDENT.forEach(function (id) { set(id, missing); }); return; }
179
211
  set("out-share", (o.share * 100).toPrecision(3) + "%");
180
212
  set("out-airdrop", fl(o.airdropFlop));
181
213
  set("out-liquid", fl(o.liquidFlop));
@@ -184,8 +216,88 @@ ${minerCalc.toString()}
184
216
  set("out-net", o.net === null ? "enter a FLOP price" : usd(o.net));
185
217
  }
186
218
  f.addEventListener("submit", function (e) { e.preventDefault(); });
187
- f.addEventListener("input", run);
219
+ f.addEventListener("input", function (e) {
220
+ if (e.target && e.target.id === "in-miners") edited = $("in-miners").value !== String(live);
221
+ run();
222
+ });
188
223
  run();
224
+
225
+ // "x min ago" next to the timestamps, refreshed every 30 s.
226
+ function agoText(ms) {
227
+ var m = Math.max(0, Math.floor(ms / 60000));
228
+ if (m < 1) return "just now";
229
+ if (m < 60) return m + " min ago";
230
+ return Math.floor(m / 60) + " h " + (m % 60) + " min ago";
231
+ }
232
+ function refreshAgo() {
233
+ var els = document.querySelectorAll(".ago[data-ts]");
234
+ for (var i = 0; i < els.length; i++) els[i].textContent = agoText(Date.now() - Number(els[i].getAttribute("data-ts")));
235
+ }
236
+ refreshAgo();
237
+ setInterval(refreshAgo, 30000);
238
+
239
+ // Background load: /api/miner-stats, 3 tries 3 s apart, then "unavailable" with a Retry button.
240
+ var box = $("demand");
241
+ if (!box || box.getAttribute("data-state") === "ready") return;
242
+ var timer = null;
243
+ function wireRetry() {
244
+ var b = $("retry");
245
+ if (b) b.addEventListener("click", function (e) { e.preventDefault(); load(0); });
246
+ }
247
+ function loading() {
248
+ box.setAttribute("data-state", "loading");
249
+ box.innerHTML = '<p class="note">Loading demand data from the explorer. The calculator works meanwhile.</p>';
250
+ set("miner-count", "loading");
251
+ if (!edited) $("in-miners").placeholder = "loading";
252
+ missing = WAITING; run();
253
+ }
254
+ function unavailable(why) {
255
+ box.setAttribute("data-state", "unavailable");
256
+ box.innerHTML = "";
257
+ var p = document.createElement("p");
258
+ p.textContent = "The explorer is unavailable (" + why + "). Demand and the miner count cannot be shown right now.";
259
+ box.appendChild(p);
260
+ var w = document.createElement("p"); w.id = "retry-wrap";
261
+ var a = document.createElement("a"); a.className = "btn"; a.id = "retry"; a.href = "/miner"; a.setAttribute("role", "button"); a.textContent = "Retry";
262
+ w.appendChild(a); box.appendChild(w);
263
+ set("miner-count", "unavailable");
264
+ if (!edited) $("in-miners").placeholder = "unavailable";
265
+ missing = NA; run();
266
+ wireRetry();
267
+ }
268
+ function ready(j) {
269
+ box.innerHTML = j.fragments.demand;
270
+ box.setAttribute("data-state", "ready");
271
+ $("read-info").innerHTML = j.fragments.readInfo;
272
+ live = Number(j.demand.minerCount) || 0;
273
+ known = true;
274
+ f.setAttribute("data-miners", String(live));
275
+ set("miner-count", live.toLocaleString("en-US"));
276
+ if (!edited) $("in-miners").value = String(live);
277
+ $("partial-tag").hidden = !!j.demand.complete;
278
+ refreshAgo();
279
+ run();
280
+ }
281
+ function load(attempt) {
282
+ clearTimeout(timer);
283
+ if (attempt === 0) loading();
284
+ var ctl = window.AbortController ? new AbortController() : null;
285
+ var stop = ctl ? setTimeout(function () { ctl.abort(); }, 30000) : null;
286
+ fetch("/api/miner-stats", { cache: "no-store", credentials: "same-origin", signal: ctl ? ctl.signal : undefined })
287
+ .then(function (r) { return r.json().then(function (j) { return { ok: r.ok, j: j }; }); })
288
+ .then(function (x) {
289
+ clearTimeout(stop);
290
+ if (x.ok && x.j.demand && x.j.fragments) return ready(x.j);
291
+ throw new Error(x.j.error || "no data yet");
292
+ })
293
+ .catch(function (e) {
294
+ clearTimeout(stop);
295
+ if (attempt < 2) timer = setTimeout(function () { load(attempt + 1); }, 3000);
296
+ else unavailable(e && e.name === "AbortError" ? "no answer within 30 s" : (e && e.message) || "no answer");
297
+ });
298
+ }
299
+ wireRetry();
300
+ load(0);
189
301
  })();
190
302
  `;
191
303
  }
package/dist/server.js CHANGED
@@ -406,17 +406,19 @@ export function startServer(port, host = "0.0.0.0") {
406
406
  const mp = await import("./minerpage.js");
407
407
  if (path === "/miner.js")
408
408
  return send(res, 200, "text/javascript; charset=utf-8", mp.minerScript());
409
- const v = path === "/miner" ? await mp.demandWithRetry() : await mp.demand();
409
+ // /miner never waits for the explorer: it renders from the cache (or "loading") and the page script
410
+ // fetches /api/miner-stats in the background. The API waits up to 20 s per try.
411
+ const v = path === "/miner" ? await mp.demand(undefined, 0) : await mp.demand(undefined, 20_000);
410
412
  const d = v?.shown;
411
413
  const fresh = { "cache-control": "public, max-age=60" };
412
414
  if (path === "/api/miner-stats") {
413
415
  const { CALC_DEFAULTS, minerCalc } = await import("./econ.js");
414
416
  const body = d
415
- ? { demand: d, partial: v.partial, latestRead: v.partial ? v.latest : undefined, defaults: CALC_DEFAULTS, defaultResult: minerCalc({ ...CALC_DEFAULTS, minerCount: d.minerCount }), disclaimer: mp.MINER_FOOTER }
417
+ ? { demand: d, partial: v.partial, latestRead: v.partial ? v.latest : undefined, defaults: CALC_DEFAULTS, defaultResult: minerCalc({ ...CALC_DEFAULTS, minerCount: d.minerCount }), fragments: { demand: mp.demandSection(v, "ready"), readInfo: mp.readInfoHtml(v) }, disclaimer: mp.MINER_FOOTER }
416
418
  : { error: mp.demandError() ?? "loading, try again in a minute", disclaimer: mp.MINER_FOOTER };
417
- return send(res, d ? 200 : 503, "application/json", JSON.stringify(body, null, 2), fresh);
419
+ return send(res, d ? 200 : 503, "application/json", JSON.stringify(body, null, 2), d ? fresh : { "cache-control": "no-store" });
418
420
  }
419
- return send(res, 200, "text/html; charset=utf-8", page("Miner economics", mp.minerPage(v, mp.demandError()), { footerNote: mp.MINER_FOOTER, style: mp.MINER_STYLE, script: "/miner.js", cards: true }), fresh);
421
+ return send(res, 200, "text/html; charset=utf-8", page("Miner economics", mp.minerPage(v, mp.demandError(), v?.shown ? "ready" : "loading"), { footerNote: mp.MINER_FOOTER, style: mp.MINER_STYLE, script: "/miner.js", cards: true }), fresh);
420
422
  }
421
423
  if (path === "/") {
422
424
  const body = render(readFileSync(join(SITE, "index.html"), "utf8"))
package/dist/shell.js CHANGED
@@ -64,6 +64,7 @@ export const SHELL_CSS = `${FONT_CSS}
64
64
  :root{${DARK}
65
65
  --display:"Space Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;--mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace}
66
66
  *,*::before,*::after{box-sizing:border-box}
67
+ [hidden]{display:none!important}
67
68
  html{-webkit-text-size-adjust:100%}
68
69
  body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.6 "Inter",system-ui,-apple-system,"Segoe UI",sans-serif;overflow-x:hidden}
69
70
  a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}
@@ -84,7 +85,14 @@ code{font-family:var(--mono);font-size:.86em;background:var(--card-2);border:1px
84
85
  .btn{display:inline-block;font:600 .88rem/1 "Inter",system-ui,sans-serif;background:var(--accent);color:var(--on-accent);border:1px solid var(--accent);border-radius:8px;padding:.6rem .9rem;cursor:pointer;white-space:nowrap}
85
86
  .btn:hover{text-decoration:none;filter:brightness(1.08)}
86
87
  .btn.ghost{background:transparent;color:var(--fg);border-color:var(--line-2)}
87
- @media (max-width:640px){.topbar{position:static}.nav{order:3;width:100%;margin-left:0}.topbar .btn{margin-left:auto}}
88
+ @media (max-width:640px){
89
+ .topbar{position:static}.topbar .wrap{gap:.3rem .55rem;min-height:0;padding-top:.75rem;padding-bottom:.55rem}
90
+ .topbar .btn{display:none}
91
+ .topbar .brand img{width:34px;height:34px}.topbar .wm{font-size:1.5rem}
92
+ .topbar .pill{font-size:10px;padding:.1rem .38rem;gap:.25rem;letter-spacing:.06em;color:var(--dim);border-color:var(--line);background:transparent}
93
+ .topbar .pill::before{width:.3rem;height:.3rem}
94
+ .nav{order:3;width:100%;margin-left:0;flex-wrap:nowrap;overflow-x:auto;gap:1.1rem;font-size:.8rem;white-space:nowrap;scrollbar-width:none;padding-bottom:.1rem}
95
+ .nav::-webkit-scrollbar{display:none}.nav a{color:var(--dim)}}
88
96
  main.wrap{padding-top:1.8rem;padding-bottom:3rem}
89
97
  /* cards */
90
98
  .card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:1.1rem 1.2rem;margin:0 0 1rem;min-width:0}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flop-guild",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "description": "Technocore guild kit: Ed25519 did:key signing CLI for technocore.chat rooms, plus an agent identity scaffold.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",