From d55b347752561edddc7b739f59eaf5595fa6cfb9 Mon Sep 17 00:00:00 2001 From: showxu <10173746+showxu@users.noreply.github.com> Date: Sun, 29 Nov 2026 00:16:08 +0800 Subject: [PATCH] docs: present App and CLI installation on the website --- README.md | 15 ++--- scripts/markdown.mjs | 16 +++--- scripts/render-site.mjs | 54 ++++++++++++++---- scripts/render-site.test.mjs | 33 +++++++++++ site.json | 4 ++ sources.json | 21 ++++--- sources/app/README.md | 82 +++++++++++++++++++++++++++ sources/standard/profile/catalog.json | 17 +++++- src/site.css | 3 + tests/site.spec.js | 20 ++++++- 10 files changed, 230 insertions(+), 35 deletions(-) create mode 100644 sources/app/README.md diff --git a/README.md b/README.md index d756176..3e08927 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ This repository builds the [agents website](https://agents-tools.github.io/) and its [CLI reference](https://agents-tools.github.io/docs/cli/). It owns layout, navigation and section -headings. All product text and artwork are derived from pinned revisions of the organization catalog -and CLI documentation; Markdown is rendered at build time. The built site serves its fonts and -images locally and requires no JavaScript. +headings. The site renders product text and artwork at build time from pinned revisions of the +organization catalog and the CLI and App documentation. The built site serves its fonts and images +locally and requires no JavaScript. ## Develop @@ -80,7 +80,7 @@ edit these files by hand. ```sh npm run sources:update -npm run sources:update -- --cli --core --standard +npm run sources:update -- --cli --app --core --standard npm run sources:check ``` @@ -94,9 +94,10 @@ The organization catalog supplies the promise, secondary line, description, mark and outcomes, footer links and maintainer line. Its images are raw GitHub URLs; the site serves only their vendored copies, so each must be listed in `sources.json` (the CLI and core logos are vendored from their repositories). The CLI README supplies Install, Usage and the demo's alternative text; -its demo SVGs supply Quick look. The CLI reference supplies `/docs/cli/`. Source-relative Markdown -links point to the owning revision on GitHub, except links to the CLI reference, which resolve -locally. Headings use GitHub-compatible anchors. +its demo SVGs supply Quick look. The App README supplies installation instructions for the macOS +App. The CLI reference supplies `/docs/cli/`. Source-relative Markdown links point to the owning +revision on GitHub, except links to the CLI reference, which resolve locally. Headings use +GitHub-compatible anchors. The organization supplies the variable font and its license; the CLI supplies the social preview. Fonts are converted using the lockfile-pinned `wawoff2` WebAssembly encoder; `sources:check` diff --git a/scripts/markdown.mjs b/scripts/markdown.mjs index 1845756..19f24a2 100644 --- a/scripts/markdown.mjs +++ b/scripts/markdown.mjs @@ -5,7 +5,7 @@ import { site } from "./site.mjs"; export const markdown = new MarkdownIt({ html: false }); export const escape = markdown.utils.escapeHtml; -export function section(source, title) { +export function section(source, title, { heading = null } = {}) { const tokens = markdown.parse(source, {}); const start = tokens.findIndex( (token, index) => @@ -15,10 +15,10 @@ export function section(source, title) { const end = tokens.findIndex( (token, index) => index > start && token.type === "heading_open" && token.tag === "h2", ); - return source - .split("\n") - .slice(tokens[start].map[0], end < 0 ? undefined : tokens[end].map[0]) - .join("\n"); + const lines = source.split("\n"); + const endLine = end < 0 ? undefined : tokens[end].map[0]; + if (heading) return [`## ${heading}`, ...lines.slice(tokens[start].map[1], endLine)].join("\n"); + return lines.slice(tokens[start].map[0], endLine).join("\n"); } export function rewriteLink(href, { repository, revision, path, anchors }) { @@ -32,17 +32,19 @@ export function rewriteLink(href, { repository, revision, path, anchors }) { return `https://github.com/${repository}/blob/${revision}/${sourcePath}${target.search}${target.hash}`; } -export function renderMarkdown(source, identity, { inline = false } = {}) { +export function renderMarkdown(source, identity, { inline = false, headingOffset = 0 } = {}) { const tokens = inline ? markdown.parseInline(source, {}) : markdown.parse(source, {}); const slugger = new GithubSlugger(); const headings = []; for (let index = 0; index < tokens.length; index++) { if (tokens[index].type !== "heading_open") continue; + const level = Math.min(6, Number(tokens[index].tag.slice(1)) + headingOffset); + tokens[index].tag = tokens[index + 2].tag = `h${level}`; const inline = tokens[index + 1]; const text = inline.children.map((child) => child.content).join(""); const id = slugger.slug(text); tokens[index].attrSet("id", id); - headings.push({ id, text, level: Number(tokens[index].tag.slice(1)) }); + headings.push({ id, text, level }); } const anchors = new Set(headings.map(({ id }) => id)); function visit(token) { diff --git a/scripts/render-site.mjs b/scripts/render-site.mjs index 5c0dfd7..a4fefce 100644 --- a/scripts/render-site.mjs +++ b/scripts/render-site.mjs @@ -74,7 +74,7 @@ function svgDimensions(source, theme) { return dimensions; } -export function renderSite({ manifest, catalog, readme, reference, demoSvgs }) { +export function renderSite({ manifest, catalog, readme, appReadme, reference, demoSvgs }) { const mark = vendoredImage(manifest, catalog.mark); for (const { url } of Object.values(catalog.navigation)) validateHttps(url, "navigation"); if (catalog.maintainer) validateHttps(catalog.maintainer.url, "maintainer"); @@ -87,7 +87,7 @@ export function renderSite({ manifest, catalog, readme, reference, demoSvgs }) { icons.set(name, vendoredImage(manifest, icon)); } - const { standard, cli } = site.sources; + const { standard, cli, app } = site.sources; const catalogSource = manifest.files.find( (entry) => entry.repository === standard.repository && entry.path === "profile/catalog.json", ); @@ -100,7 +100,30 @@ export function renderSite({ manifest, catalog, readme, reference, demoSvgs }) { path, label, }); - const install = renderMarkdown(section(readme, "Install"), identity("README.md", "Install")); + const cliInstall = renderMarkdown( + section(readme, "Install", app ? { heading: "CLI" } : {}), + identity("README.md", app ? "CLI installation" : "Install"), + { headingOffset: app ? 1 : 0 }, + ); + let install = cliInstall.html; + if (app) { + const appSource = manifest.files.find( + (entry) => entry.repository === app.repository && entry.path === "README.md", + ); + if (!appSource) throw new Error(`Missing ${app.repository} README source in sources.json`); + const appInstall = renderMarkdown( + section(appReadme, "Install", { heading: "macOS App" }), + { + repository: appSource.repository, + revision: appSource.revision, + path: appSource.path, + label: "macOS App installation", + }, + { headingOffset: 1 }, + ); + install = `

Install

${appInstall.html}${cliInstall.html}`; + } + const installation = `
${install}
`; const usage = renderMarkdown(section(readme, "Usage"), identity("README.md", "Usage")); const docs = renderMarkdown( reference, @@ -178,18 +201,19 @@ export function renderSite({ manifest, catalog, readme, reference, demoSvgs }) { \n`; } + const quickLook = `

Quick look

+ +
+ + ${escape(demoAlt)} +
`; + const home = page( "/", title, `

${escape(title)}

${escape(catalog.secondary)}

-

Quick look

- -
- - ${escape(demoAlt)} -
-
${install.html}
+ ${app ? installation + quickLook : quickLook + installation}
${usage.html}

Repositories

${catalog.groups.map((group) => `

${escape(group.title)}

    ${group.repositories.map(({ name, outcome }) => `
  • ${imageTag(icons.get(name), 32, "")}
    ${escape(name)}

    ${escape(outcome)}

  • `).join("")}
`).join("")}
@@ -213,12 +237,20 @@ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.ur const manifest = JSON.parse(await readFile("sources.json", "utf8")); const catalog = JSON.parse(await readFile("sources/standard/profile/catalog.json", "utf8")); const readme = await readFile("sources/cli/README.md", "utf8"); + const appReadme = site.sources.app ? await readFile("sources/app/README.md", "utf8") : undefined; const reference = await readFile("sources/cli/Documentation/Reference/CLI.md", "utf8"); const demoSvgs = { light: await readFile(`sources/cli/${DEMO_DIRECTORY}/terminal-light.svg`, "utf8"), dark: await readFile(`sources/cli/${DEMO_DIRECTORY}/terminal-dark.svg`, "utf8"), }; - const { home, documentation } = renderSite({ manifest, catalog, readme, reference, demoSvgs }); + const { home, documentation } = renderSite({ + manifest, + catalog, + readme, + appReadme, + reference, + demoSvgs, + }); await rm(".build/site", { recursive: true, force: true }); for (const [path, html] of [ ["index.html", home], diff --git a/scripts/render-site.test.mjs b/scripts/render-site.test.mjs index 9f675c0..43950e3 100644 --- a/scripts/render-site.test.mjs +++ b/scripts/render-site.test.mjs @@ -9,6 +9,7 @@ const inputs = { manifest: JSON.parse(await readFile("sources.json", "utf8")), catalog: JSON.parse(await readFile("sources/standard/profile/catalog.json", "utf8")), readme: await readFile("sources/cli/README.md", "utf8"), + appReadme: site.sources.app ? await readFile("sources/app/README.md", "utf8") : undefined, reference: await readFile("sources/cli/Documentation/Reference/CLI.md", "utf8"), demoSvgs: { light: await readFile("sources/cli/.github/assets/terminal/terminal-light.svg", "utf8"), @@ -253,3 +254,35 @@ test("serves vendored files at paths without hidden segments", () => { for (const [, path] of html.matchAll(/(?:src|srcset|href|content)="(\/[^"]*)"/g)) assert.ok(!path.split("/").some((segment) => segment.startsWith(".")), path); }); + +test( + "renders the macOS App and CLI instructions together under Install", + { skip: !site.sources.app }, + () => { + const candidate = structuredClone(inputs); + candidate.appReadme = + "## Install\n[Signed download](Documentation/Release.md)\n### Requirements\nmacOS 15 or later"; + const document = parse(renderSite(candidate).home); + const install = elements(document, "section").find((node) => + node.attrs.some(({ name, value }) => name === "aria-labelledby" && value === "install"), + ); + assert.deepEqual( + elements(install, "h3").map((heading) => heading.childNodes[0].value), + ["macOS App", "CLI"], + ); + assert.equal(elements(install, "h4")[0].childNodes[0].value, "Requirements"); + const revision = candidate.manifest.files.find( + ({ repository }) => repository === site.sources.app.repository, + ).revision; + assert.ok( + elements(install, "a").some((link) => + link.attrs.some( + ({ name, value }) => + name === "href" && + value === + `https://github.com/${site.sources.app.repository}/blob/${revision}/Documentation/Release.md`, + ), + ), + ); + }, +); diff --git a/site.json b/site.json index 7c352bc..c5bc6c9 100644 --- a/site.json +++ b/site.json @@ -24,6 +24,10 @@ "LICENSE" ] }, + "app": { + "repository": "agents-tools/app", + "paths": ["README.md"] + }, "core": { "repository": "agents-tools/core", "paths": [".github/assets/logo/logo.svg", "LICENSE"] diff --git a/sources.json b/sources.json index 864d3eb..ba49232 100644 --- a/sources.json +++ b/sources.json @@ -3,28 +3,28 @@ "files": [ { "repository": "agents-tools/.github", - "revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0", + "revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3", "path": "profile/catalog.json", "file": "sources/standard/profile/catalog.json", - "sha256": "74df9b8154643e8b6227c6c6b899b3d8ee8abfada8959a787c5c8b2f3f5d6133" + "sha256": "7835a660ee898c12d4109a93e5397b88a996273a3cd2f5618a9d6dbcb424bc64" }, { "repository": "agents-tools/.github", - "revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0", + "revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3", "path": "profile/assets/icon.png", "file": "sources/standard/profile/assets/icon.png", "sha256": "58981839dd6ad3f2c1f5ed4273a64563d95f29925b210c338e76216238a73825" }, { "repository": "agents-tools/.github", - "revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0", + "revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3", "path": ".github/design/fonts/GoogleSansCode[MONO,wght].ttf", "file": "sources/standard/.github/design/fonts/GoogleSansCode[MONO,wght].ttf", "sha256": "74642762fae66d5883077794a763e1086394b8cb72f2623e456e06359dc5c64b" }, { "repository": "agents-tools/.github", - "revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0", + "revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3", "path": ".github/design/fonts/GoogleSansCode[MONO,wght].ttf", "file": "sources/standard/.github/design/fonts/GoogleSansCode[MONO,wght].woff2", "sha256": "ed98cac89efbca1e09b896baf1a48dd95f9feacfa7118d59efa1ad2ab692b924", @@ -32,7 +32,7 @@ }, { "repository": "agents-tools/.github", - "revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0", + "revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3", "path": ".github/design/fonts/OFL.txt", "file": "sources/standard/.github/design/fonts/OFL.txt", "sha256": "58d145732eea7ee61940a7eccecad160772b8621171b69b62183a5c7eb967740", @@ -41,7 +41,7 @@ }, { "repository": "agents-tools/.github", - "revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0", + "revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3", "path": "LICENSE", "file": "sources/standard/LICENSE", "sha256": "e5161d00bc83bb836971bd3db25271351663b8aa8928eb1b15b58f3c47ccdbeb" @@ -95,6 +95,13 @@ "file": "sources/cli/LICENSE", "sha256": "e5161d00bc83bb836971bd3db25271351663b8aa8928eb1b15b58f3c47ccdbeb" }, + { + "repository": "agents-tools/app", + "revision": "172a9a5435d1eaf2e114e4d6dd381295e543795a", + "path": "README.md", + "file": "sources/app/README.md", + "sha256": "9d3dc02a307c677b65fda9affb550f015a247c06b7de7c102a23c87e4390fcff" + }, { "repository": "agents-tools/core", "revision": "d4e5a4da09e044aa6526cdadd508bcf7a94309a1", diff --git a/sources/app/README.md b/sources/app/README.md new file mode 100644 index 0000000..909c502 --- /dev/null +++ b/sources/app/README.md @@ -0,0 +1,82 @@ +

+ + agents organization mark + +

+ +

Agents App

+ +

+ Manage agent skills, instructions, and configuration in a native macOS app. +

+ +

+ Check · + Latest release +

+ +

+ Install · + Quick start · + Features · + Development +

+ +## Install + +Agents App requires macOS 15 or later and supports Apple silicon and Intel Macs. + +```sh +brew install --cask agents-tools/tap/agents-app +``` + +You can also download the notarized universal ZIP from the +[latest GitHub release](https://github.com/agents-tools/app/releases/latest). +Unzip it, move `Agents App.app` to Applications, and open it. The release also +provides a SHA-256 checksum for the ZIP. + +## Quick start + +1. Open **Agents App** and select **User Configuration** in the scope picker to + work with user-level configuration. If you see **Import User Configuration**, + choose **Review Import…** to preview the sources, skills, and instructions + available from an existing `agents.json`. +2. For a project, open **Scope Actions**, choose **Add Project…**, and select + the project directory. Pick that project in the scope picker to inspect and + manage its configuration. The project list is stored in app preferences. +3. Open **Skills** to browse the selected scope. Choose **Add from Source…** to + inspect a source and select the content you want. Review the proposed + changes, then apply them. Open **Instructions & Rules** to + inspect instruction mappings and preview or copy named prompts. + +## Features + +- Browse skills and configuration by client, inspect installed components, and + check deployment status and diagnostics. +- Edit declarations in forms, review updates and removals, or restore content + from the lockfile. Create a local skill or project instructions from a preview. +- Subscribe to sources, inspect file differences, and mark reviewed content as + read. Import supported configuration through a review step. +- Inspect MCP server settings and choose **Test Connection…** to test a server. + From **Overview**, choose **Detect Clients…** to inspect installed clients, + observed versions, PATH coverage, and configuration locations. +- Back up and restore local sessions and configuration for Codex, Claude Code, + and Gemini CLI, with optional project configuration. +- Use optional on-device assistance on macOS 26 or later to explain selected + skills and configuration changes, translate skill descriptions, or summarize + updates when the system model is available. + +## Development + +Open `Agents.xcodeproj` in Xcode 27 and select the `AgentsApp` scheme. The +project uses Swift 6, includes app, unit-test, and UI-test targets, and pins +[Agents Core](https://github.com/agents-tools/core) to a full commit. That +revision must be available for package resolution. Local Debug builds use ad +hoc signing. + +- [Application behavior](Documentation/Application.md) covers data ownership, + action boundaries, and operation lifetime. +- [Release procedure](Documentation/Release.md) covers signing, notarization, + publication, and distribution verification. +- [Agents CLI](https://github.com/agents-tools/cli) documents the command-line + interface. diff --git a/sources/standard/profile/catalog.json b/sources/standard/profile/catalog.json index 0bfc2f7..7d14696 100644 --- a/sources/standard/profile/catalog.json +++ b/sources/standard/profile/catalog.json @@ -28,8 +28,13 @@ } }, "quickstart": { - "title": "Get started", + "title": "Install Agents", "commands": [ + "# macOS app", + "brew install --cask agents-tools/tap/agents-app", + "# Or open the latest release to download the macOS app", + "open https://github.com/agents-tools/app/releases/latest", + "# Command-line tool", "brew install agents-tools/tap/agents", "agents skills add owner/repo name", "agents skills list" @@ -39,6 +44,14 @@ { "title": "Use agents", "repositories": [ + { + "name": "app", + "outcome": "Manage agent configuration on macOS 15 or later and review changes before applying them.", + "icon": "https://raw.githubusercontent.com/agents-tools/.github/HEAD/profile/assets/icon.png", + "kind": "tool", + "title": "Agents App", + "about": "Native macOS app for managing agent configuration." + }, { "name": "cli", "outcome": "The agents command: add skills and instructions from local paths, Git repositories or well-known indexes, write them for each agent, restore them from the lock and watch sources for changes.", @@ -75,7 +88,7 @@ "repositories": [ { "name": "homebrew-tap", - "outcome": "Install agents with Homebrew.", + "outcome": "Install the Agents macOS app and command-line tool with Homebrew.", "icon": "https://raw.githubusercontent.com/agents-tools/.github/HEAD/profile/assets/icon.png", "kind": "distribution", "title": "homebrew-tap", diff --git a/src/site.css b/src/site.css index 3e2f39b..84e8058 100644 --- a/src/site.css +++ b/src/site.css @@ -321,6 +321,9 @@ blockquote { pre { padding: 16px; } + .installation pre { + white-space: pre-wrap; + } .repository-group { grid-template-columns: minmax(0, 1fr); gap: 12px; diff --git a/tests/site.spec.js b/tests/site.spec.js index 6ef2349..9a1fbbb 100644 --- a/tests/site.spec.js +++ b/tests/site.spec.js @@ -76,7 +76,25 @@ for (const path of ["/", "/docs/cli/"]) { } else { expect(scrolling.scrollWidth).toBe(scrolling.width); } - await expect(page.locator("#install + p")).toHaveText(installLead); + if (site.sources.app) { + const install = page.getByRole("region", { name: "Install", exact: true }); + await expect(install.getByRole("heading", { name: "macOS App" })).toBeVisible(); + await expect(install.locator("#cli + p")).toHaveText(installLead); + await expect( + install.getByText("brew install --cask agents-tools/tap/agents-app"), + ).toBeVisible(); + await expect(install.getByText("brew install agents-tools/tap/agents")).toBeVisible(); + await expect( + install.locator( + `a[href="https://github.com/${site.sources.app.repository}/releases/latest"]`, + ), + ).toBeVisible(); + await expect( + page.locator(`.repositories a[href="https://github.com/${site.sources.app.repository}"]`), + ).toBeVisible(); + } else { + await expect(page.locator("#install + p")).toHaveText(installLead); + } await expect(page.locator(".repositories li")).toHaveCount( catalog.groups.flatMap((group) => group.repositories).length, );