Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

2.4 KB
Raw Blame
#!/usr/bin/env node
// Writes docs/standalone-repos.md: every mirrored package with its repo, docs site
// and install command, read from the same package.json files the mirror sync uses.
// Usage: node scripts/gen-standalone-catalog.mjs [--owner nirholas]
import { readdirSync, readFileSync, existsSync, writeFileSync } from 'node:fs';
import { join, resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const logIdx = process.argv.indexOf('--log');
const mapping = new Map();
if (logIdx !== -1) {
	for (const line of readFileSync(process.argv[logIdx + 1], 'utf8').split('\n')) {
		const m = line.match(/^── (\S+)\s+\[(?:mcp|lib)\]\s+→\s+github\.com\/(\S+)/);
		if (m) mapping.set(m[1], m[2]);
	}
}
const OTHER_PROJECTS = /pump|metaplex|agenc|uniswap|jupiter|raydium|meteora|hyperliquid|sniper/i;
const rows = [];
for (const d of readdirSync(join(root, 'packages')).sort()) {
	const pj = join(root, 'packages', d, 'package.json');
	if (!existsSync(pj)) continue;
	const pkg = JSON.parse(readFileSync(pj, 'utf8'));
	const slug = mapping.get(pkg.name);
	if (pkg.private || !slug) continue;
	// Packages built around another crypto project stay out of the committed catalog until the owner approves naming them.
	if (OTHER_PROJECTS.test(`${pkg.name} ${pkg.description}`)) continue;
	const repo = slug.split('/')[1];
	const install = pkg.bin ? `npx -y ${pkg.name}` : `npm install ${pkg.name}`;
	const desc = (pkg.description || '').replace(/\s[\u2014\u2013]\s/g, ', ').replace(/[\u2014\u2013]/g, '-').replace(/\|/g, '/').replace(/\s+/g, ' ').split(/(?<=\.)\s/)[0].slice(0, 160);
	rows.push(`| [${pkg.name}](https://github.com/${slug}) | ${desc} | \`${install}\` | [docs](https://${slug.split('/')[0].toLowerCase()}.github.io/${repo}/) |`);
}
const out = `# Standalone repositories

Every publishable package in this monorepo is mirrored to its own repository with its own documentation site, so it can be found, starred, installed and cited on its own. The monorepo stays canonical; see [contributing](contributing.md) for how the mirrors are generated.

This table is generated by \`scripts/gen-standalone-catalog.mjs\` from each package's \`package.json\`.

| Package | What it does | Install | Site |
|---|---|---|---|
${rows.join('\n')}
`;
writeFileSync(join(root, 'docs', 'standalone-repos.md'), out);
console.log(`wrote docs/standalone-repos.md (${rows.length} packages)`);