mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-29 07:20:43 +00:00
lib/layers.ts is the product: six layers and the Record, each with the operations api.hanzo.ai serves for it (checked against hanzoai/cloud openapi.yaml), a request to paste, docs and the site's own pages. /products, /products/<layer>, the home band, the header's Product menu and the footer row all read it. - Header: Product, Developers, Research, Pricing, Enterprise. - Memory leads with /v1/graph: assert, read, resolve, diff, answer. - /sql, /kv, /docdb, /vector and the old /products/<category> addresses forward through one MOVED table in lib/publish. - /affiliate and /oss state apps/affiliate's and apps/author's own rates; the second pages for the same programmes forward to them. - No real-person faces on agents, no Lux or Zoo partner logos. - Orphans linked, dead links and private-repo links removed; sitemap gate and nav spec hold both. Co-authored-by: Hanzo Dev <[email protected]>
15 lines
645 B
TypeScript
15 lines
645 B
TypeScript
import oss from './data/oss.json' with { type: 'json' }
|
|
|
|
/**
|
|
* Whether a reader can open github.com/<owner>/<name>: it is one of our public
|
|
* repositories, as scripts/sync-oss.mjs lists them. A private repository
|
|
* answers a reader with a 404, so a link to one is a dead link.
|
|
*/
|
|
export const opens = (full: string): boolean => oss.public.includes(full)
|
|
|
|
/** A GitHub link a reader can open: the repository when it is public, the fallback otherwise. */
|
|
export function openable(url: string, fallback: string): string {
|
|
const repo = /^https:\/\/github\.com\/([^/]+\/[^/?#]+)/.exec(url)?.[1]
|
|
return repo && !opens(repo) ? fallback : url
|
|
}
|