Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
882c3f8
pulse-atlas-expand-to-honeycomb
kojibai Jan 1, 2026
3aaed69
Improve honeycomb embed sync and 3D depth
kojibai Jan 1, 2026
811808f
Merge pull request #174 from kojibai/codex/integrate-sigilhoneycomb-e…
kojibai Jan 1, 2026
1222d3a
Optimize honeycomb sigil rendering
kojibai Jan 1, 2026
788b0a8
Add lightweight sigil shapes to honeycomb
kojibai Jan 1, 2026
40a1896
Enable 3D honeycomb view and chakra shapes
kojibai Jan 1, 2026
e6cc703
Fix honeycomb CSS selector
kojibai Jan 1, 2026
6f03441
Polish honeycomb glyphs and mobile popover
kojibai Jan 1, 2026
6149e99
38.3.1
kojibai Jan 1, 2026
4414351
Merge pull request #175 from kojibai/codex/optimize-sigil-honeycomb-e…
kojibai Jan 1, 2026
bdc8795
Merge pull request #176 from kojibai/pulse-atlas-expand-to-honeycomb
kojibai Jan 1, 2026
97c5f28
v38.3.2
kojibai Jan 1, 2026
a208d98
Reduce edge requests with build bundling and caching
kojibai Jan 1, 2026
e231568
v38.3.3
kojibai Jan 1, 2026
13c5c81
Merge pull request #178 from kojibai/codex/clarify-edge-requests-and-…
kojibai Jan 1, 2026
912cbd5
Adjust caching headers for json assets
kojibai Jan 1, 2026
977a652
Merge pull request #179 from kojibai/codex/fix-unknown-at-rule-@prope…
kojibai Jan 1, 2026
dc506f2
Limit honeycomb explorer to internal data
kojibai Jan 1, 2026
9c4a969
Merge pull request #180 from kojibai/codex/restrict-sigil-honeycomb-e…
kojibai Jan 1, 2026
651d046
v38.4.0
kojibai Jan 1, 2026
1c6d27e
v38.4.3
kojibai Jan 1, 2026
7f60431
v38.4.4
kojibai Jan 1, 2026
b2fea36
Optimize Sigil Explorer mobile loading
kojibai Jan 1, 2026
c8c761d
v38.4.5
kojibai Jan 1, 2026
06adec3
Merge pull request #182 from kojibai/codex/fix-and-optimize-sigil-exp…
kojibai Jan 1, 2026
8a082ee
Fix story recorder dot styling bleed
kojibai Jan 1, 2026
dedc4cf
Merge pull request #183 from kojibai/codex/fix-large-square-around-dots
kojibai Jan 1, 2026
92ec68d
v38.4.6
kojibai Jan 1, 2026
7993e63
v38.4.7 (REVERTED BACK TO 38.2.0
kojibai Jan 1, 2026
3cafae7
v38.4.8
kojibai Jan 1, 2026
b5e0047
v38.9.1
kojibai Jan 1, 2026
ac1b752
38.9.5
kojibai Jan 1, 2026
c8c87bd
Fix invalid base URL usage in SigilExplorer
kojibai Jan 1, 2026
d05ae57
Merge pull request #184 from kojibai/codex/fix-url-construction-error…
kojibai Jan 1, 2026
e72e9e5
Add lahmahtor API route for proxy
kojibai Jan 1, 2026
aa98095
Merge pull request #186 from kojibai/codex/set-up-api-url-for-lahmahtor
kojibai Jan 1, 2026
adce39f
v38.9.6
kojibai Jan 1, 2026
ac071f0
v38.9.7
kojibai Jan 1, 2026
fe2e198
Merge branch 'main' into 38.9.7
kojibai Jan 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions api/lahmahtor/[[...path]].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { handleLahmahtorProxy } from "../proxy/lahmahtorProxy.mjs";

function buildRequestUrl(req) {
const host = req.headers?.host ? `http://${req.headers.host}` : "http://localhost";
return new URL(req.url || "/", host);
}

export default async function handler(req, res) {
const url = buildRequestUrl(req);
await handleLahmahtorProxy(req, res, url);
}

export const config = {
runtime: "nodejs",
};
112 changes: 112 additions & 0 deletions api/proxy/lahmahtorProxy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// api/proxy/lahmahtorProxy.mjs
const PRIMARY = "https://m.kai.ac";
const BACKUP = "https://memory.kaiklok.com";

const FAILOVER_TIMEOUT_MS = 8000;

function shouldFailoverStatus(status) {
if (status === 0) return true; // network/unknown
if (status === 404) return true; // route missing on one base
if (status === 408 || status === 429) return true;
if (status >= 500) return true;
return false;
}

async function readRaw(req) {
const chunks = [];
for await (const chunk of req) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
return chunks.length ? Buffer.concat(chunks) : Buffer.alloc(0);
}

function copyUpstreamHeaders(upHeaders, res) {
for (const [k, v] of upHeaders.entries()) {
const key = k.toLowerCase();
// skip hop-by-hop / unsafe
if (key === "set-cookie") continue;
if (key === "connection") continue;
if (key === "transfer-encoding") continue;
res.setHeader(k, v);
}
}

async function fetchWithTimeout(url, init) {
const controller = new AbortController();
const t = setTimeout(() => controller.abort(), FAILOVER_TIMEOUT_MS);
try {
const res = await fetch(url, { ...init, signal: controller.signal });
return res;
} finally {
clearTimeout(t);
}
}

async function proxyOnce(base, req, upstreamPath, rawBody) {
const url = base + upstreamPath;

// forward minimal safe headers
const headers = new Headers();
for (const [k, v] of Object.entries(req.headers)) {
if (!v) continue;
const key = k.toLowerCase();
if (key === "host") continue;
if (key === "connection") continue;
if (key === "content-length") continue;
headers.set(k, Array.isArray(v) ? v.join(",") : v);
}

const method = (req.method || "GET").toUpperCase();
const body = method === "GET" || method === "HEAD" ? undefined : rawBody;

return fetchWithTimeout(url, {
method,
headers,
body,
redirect: "manual",
});
}

/**
* Same-origin handler:
* /api/lahmahtor/* -> https://align.kaiklok.com/* (failover to https://m.phi.network/*)
*/
export async function handleLahmahtorProxy(req, res, url) {
const method = (req.method || "GET").toUpperCase();

// Strip /api/lahmahtor prefix
const upstreamPath = url.pathname.replace(/^\/api\/lahmahtor/, "") + (url.search || "");
const path = upstreamPath.startsWith("/") ? upstreamPath : `/${upstreamPath}`;

const rawBody = method === "GET" || method === "HEAD" ? Buffer.alloc(0) : await readRaw(req);

let primaryRes = null;
try {
primaryRes = await proxyOnce(PRIMARY, req, path, rawBody);
} catch {
primaryRes = null;
}

let finalRes = primaryRes;

if (!finalRes || shouldFailoverStatus(finalRes.status)) {
try {
const backupRes = await proxyOnce(BACKUP, req, path, rawBody);
// Prefer backup if primary missing/unreachable OR backup ok
if (!finalRes || backupRes.ok) finalRes = backupRes;
} catch {
// keep whatever we had
}
}

if (!finalRes) {
res.statusCode = 502;
res.setHeader("Content-Type", "application/json");
res.end(JSON.stringify({ ok: false, error: "lahmahtor_upstream_unreachable" }));
return;
}

res.statusCode = finalRes.status;
copyUpstreamHeaders(finalRes.headers, res);

const buf = Buffer.from(await finalRes.arrayBuffer());
res.end(buf);
}
1 change: 1 addition & 0 deletions dist/assets/EternalKlock-C1Jyi7s7.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions dist/assets/EternalKlock-CQ5bLrcj.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/assets/EternalKlock-ChZkW6ax.js

This file was deleted.

29 changes: 0 additions & 29 deletions dist/assets/EternalKlock-D0X_3jhx.js

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions dist/assets/KaiVohApp-5YpSzMzY.js

Large diffs are not rendered by default.

88 changes: 0 additions & 88 deletions dist/assets/KaiVohApp-B06WTM5F.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/assets/KaiVohApp-Brroi08x.css

This file was deleted.

1 change: 1 addition & 0 deletions dist/assets/KaiVohApp-DKKSrc21.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading