diff --git a/README.md b/README.md index 593669f37..56d5bbc63 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Each major subsystem has a `SCORE.md` — the process knowledge for authors and ## Home - **Tangled** (canonical): https://tangled.org/aesthetic.computer/core -- **GitHub** (mirror): https://github.com/whistlegraph/aesthetic-computer +- **GitHub** (deprecated read-only mirror): https://github.com/whistlegraph/aesthetic-computer Self-hosted on `knot.aesthetic.computer`. diff --git a/USER-GUIDE.md b/USER-GUIDE.md index 7074c8b72..75f965e14 100644 --- a/USER-GUIDE.md +++ b/USER-GUIDE.md @@ -89,6 +89,6 @@ Aesthetic Computer includes KidLisp, a minimal Lisp dialect for creating generat [1] Recent HN discussion on `notepat` here: https://news.ycombinator.com/item?id=41526754 -[2] The AC Story: https://github.com/whistlegraph/aesthetic-computer/blob/main/STORY.md - -[3] Write a Piece: https://github.com/whistlegraph/aesthetic-computer/blob/main/WRITE-A-PIECE.md +[2] The AC Story: STORY.md + +[3] Write a Piece: WRITE-A-PIECE.md diff --git a/system/netlify/functions/api-docs.mjs b/system/netlify/functions/api-docs.mjs index a6ca7e888..dcdde0890 100644 --- a/system/netlify/functions/api-docs.mjs +++ b/system/netlify/functions/api-docs.mjs @@ -15,7 +15,7 @@ export async function handler(event, context) { description: "Model Context Protocol server for AI assistants (Claude, GPT-4, etc.) to interact with aesthetic.computer APIs", package: "@aesthetic.computer/mcp", install: "npx @aesthetic.computer/mcp", - repository: "https://github.com/whistlegraph/aesthetic-computer/tree/main/mcp-server", + repository: "https://tangled.org/aesthetic.computer/core/tree/main/mcp-server", tools: [ { @@ -942,7 +942,7 @@ function generateHTML(docs) {
@@ -952,7 +952,7 @@ function generateHTML(docs) {${docs.mcp.description}
package: ${docs.mcp.package}
install: ${docs.mcp.install}
${encode(desc)}
Aesthetic Computer is an open creative computing platform for making art, games, and tools in the browser using JavaScript and KidLisp. Navigate by typing a piece name (e.g. "painting", "line", "wand", "prompt") into the command prompt and pressing Enter. See llms.txt for full documentation: https://aesthetic.computer/llms.txt
-Source code: https://github.com/whistlegraph/aesthetic-computer | Pieces (programs): https://github.com/whistlegraph/aesthetic-computer/tree/main/system/public/aesthetic.computer/disks | Runtime: https://github.com/whistlegraph/aesthetic-computer/tree/main/system/public/aesthetic.computer/lib
+Source code: https://tangled.org/aesthetic.computer/core | Pieces (programs): https://tangled.org/aesthetic.computer/core/tree/main/system/public/aesthetic.computer/disks | Runtime: https://tangled.org/aesthetic.computer/core/tree/main/system/public/aesthetic.computer/lib
diff --git a/system/netlify/functions/version.mjs b/system/netlify/functions/version.mjs index 2a5b47132..94aab2af6 100644 --- a/system/netlify/functions/version.mjs +++ b/system/netlify/functions/version.mjs @@ -9,6 +9,9 @@ import { promisify } from "util"; const execFileAsync = promisify(execFile); const GIT_REMOTE_OVERRIDE = process.env.VERSION_GIT_REMOTE || ""; const GIT_BRANCH = process.env.VERSION_GIT_BRANCH || "main"; +const TANGLED_REPO_URL = + process.env.VERSION_TANGLED_REPO_URL || + "https://knot.aesthetic.computer/aesthetic.computer/core"; const RECENT_COMMIT_COUNT = 10; const HISTORY_SCAN_LIMIT = 50; @@ -112,41 +115,30 @@ async function getLatestFromTangled(repoRoot, deployedCommit) { }; } -async function getLatestFromGitHub(deployedCommit) { - const res = await fetch( - "https://api.github.com/repos/whistlegraph/aesthetic-computer/commits?per_page=50", - { - headers: { - "User-Agent": "aesthetic-computer", - Accept: "application/vnd.github.v3+json", - }, - } +async function getLatestFromTangledMirror(deployedCommit) { + const output = await git( + ["ls-remote", TANGLED_REPO_URL, `refs/heads/${GIT_BRANCH}`], + process.cwd(), ); - - if (!res.ok) { - throw new Error(`GitHub API returned ${res.status}`); - } - - const commits = await res.json(); - const latestCommit = commits[0]?.sha; - - let behindBy = 0; - if (deployedCommit !== "unknown" && latestCommit) { - const idx = commits.findIndex((c) => - c.sha.startsWith(deployedCommit.slice(0, 7)) - ); - behindBy = idx === -1 ? HISTORY_SCAN_LIMIT : idx; - } + const latestCommit = output.split(/\s+/)[0] || ""; + const behindBy = + deployedCommit !== "unknown" && + latestCommit && + latestCommit.startsWith(deployedCommit.slice(0, 7)) + ? 0 + : HISTORY_SCAN_LIMIT; return { latestCommit, behindBy, - recentCommits: commits.slice(0, RECENT_COMMIT_COUNT).map((c) => ({ - hash: c.sha.slice(0, 7), - message: c.commit?.message?.split("\n")[0]?.slice(0, 60) || "no message", - author: c.commit?.author?.name || c.author?.login || "unknown", - date: c.commit?.author?.date, - })), + recentCommits: latestCommit + ? [{ + hash: latestCommit.slice(0, 7), + message: "latest on Tangled", + author: "tangled.org/aesthetic.computer/core", + date: null, + }] + : [], }; } @@ -180,7 +172,7 @@ export default async (request) => { recentCommits, } = repoRoot ? await getLatestFromTangled(repoRoot, deployedCommit) - : await getLatestFromGitHub(deployedCommit); + : await getLatestFromTangledMirror(deployedCommit); const status = behindBy === 0 ? "current" : "behind"; diff --git a/system/public/aesthetic.computer/disks/prompt.mjs b/system/public/aesthetic.computer/disks/prompt.mjs index 9a1c99998..e215e7a58 100644 --- a/system/public/aesthetic.computer/disks/prompt.mjs +++ b/system/public/aesthetic.computer/disks/prompt.mjs @@ -747,37 +747,16 @@ async function boot({ // Fetch git commit/version status with long-poll for deploy detection const fetchVersion = async () => { try { - // On localhost, fetch GitHub directly to show latest remote commit - if (location.hostname === "localhost" || location.hostname === "127.0.0.1") { - const ghRes = await fetch( - "https://api.github.com/repos/whistlegraph/aesthetic-computer/commits?per_page=10", - { headers: { Accept: "application/vnd.github.v3+json" } } - ); - if (ghRes.ok) { - const commits = await ghRes.json(); - const currentHash = commits[0]?.sha?.slice(0, 7); - versionInfo = { - deployed: currentHash || "dev", - latest: currentHash, - status: "local", - }; - // Extract commits for uniticker (local dev mode) - recentCommits = commits.map(c => ({ - hash: c.sha.slice(0, 7), - message: c.commit?.message?.split("\n")[0]?.slice(0, 60) || "no message", - author: c.commit?.author?.name || c.author?.login || "unknown", - date: c.commit?.author?.date, - })); - } else { - versionInfo = { deployed: "dev", status: "local" }; - recentCommits = []; - } - needsPaint(); - return; - } const res = await fetch("/api/version"); if (!res.ok) throw new Error(`HTTP ${res.status}`); versionInfo = await res.json(); + if (location.hostname === "localhost" || location.hostname === "127.0.0.1") { + versionInfo = { + ...versionInfo, + deployed: versionInfo.deployed === "unknown" ? "dev" : versionInfo.deployed, + status: "local", + }; + } // Store recent commits from the version API recentCommits = versionInfo.recentCommits || []; needsPaint(); @@ -3863,12 +3842,12 @@ async function halt($, text) { makeFlash($); return true; } else if (text.toLowerCase() === "github" || text === "gh") { - const githubUrl = "https://github.com/digitpain/aesthetic.computer"; - if (!openExternalFromIframe(githubUrl)) jump(githubUrl); + const repoUrl = "https://tangled.org/aesthetic.computer/core"; + if (!openExternalFromIframe(repoUrl)) jump(repoUrl); makeFlash($); return true; } else if (text.toLowerCase() === "score") { - const scoreUrl = "https://github.com/whistlegraph/aesthetic-computer/blob/main/SCORE.md"; + const scoreUrl = "https://tangled.org/aesthetic.computer/core/tree/main/SCORE.md"; if (!openExternalFromIframe(scoreUrl)) jump(scoreUrl); makeFlash($); return true; diff --git a/system/public/aesthetic.computer/lib/headers.mjs b/system/public/aesthetic.computer/lib/headers.mjs index 2e431d3ae..dbde3c8e1 100644 --- a/system/public/aesthetic.computer/lib/headers.mjs +++ b/system/public/aesthetic.computer/lib/headers.mjs @@ -354,11 +354,11 @@ export function headers(isDarkMode) { ); console.log( - `%cContribute on %cGitHub%c at %chttps://github.com/whistlegraph/aesthetic-computer`, + `%cContribute on %cTangled%c at %chttps://tangled.org/aesthetic.computer/core`, "color: #6c757d; font-size: 10px;", - "color: #343a40; font-weight: bold; font-size: 10px;", + "color: #28a745; font-weight: bold; font-size: 10px;", "color: #6c757d; font-size: 10px;", - "color: #6c757d; font-size: 10px; text-decoration: underline;" + "color: #28a745; font-size: 10px; text-decoration: underline;" ); } }