Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -80,7 +80,7 @@ edit these files by hand.

```sh
npm run sources:update
npm run sources:update -- --cli <full-sha> --core <full-sha> --standard <full-sha>
npm run sources:update -- --cli <full-sha> --app <full-sha> --core <full-sha> --standard <full-sha>
npm run sources:check
```

Expand All @@ -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`
Expand Down
16 changes: 9 additions & 7 deletions scripts/markdown.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand All @@ -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 }) {
Expand All @@ -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) {
Expand Down
54 changes: 43 additions & 11 deletions scripts/render-site.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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",
);
Expand All @@ -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 = `<h2 id="install">Install</h2>${appInstall.html}${cliInstall.html}`;
}
const installation = `<section class="section prose${app ? " installation" : ""}" aria-labelledby="install">${install}</section>`;
const usage = renderMarkdown(section(readme, "Usage"), identity("README.md", "Usage"));
const docs = renderMarkdown(
reference,
Expand Down Expand Up @@ -178,18 +201,19 @@ export function renderSite({ manifest, catalog, readme, reference, demoSvgs }) {
</html>\n`;
}

const quickLook = `<section class="section quick-look"><h2 id="quick-look">Quick look</h2>
<!-- html-validate-disable-next prefer-native-element: The region is the section's keyboard scroll container. -->
<div class="quick-look-frame" tabindex="0" role="region" aria-labelledby="quick-look"><picture>
<source media="(prefers-color-scheme: dark)" srcset="${escape(`${demo}terminal-dark.svg`)}">
<img src="${escape(`${demo}terminal-light.svg`)}" width="${demoSize.width}" height="${demoSize.height}" alt="${escape(demoAlt)}" fetchpriority="high">
</picture></div></section>`;

const home = page(
"/",
title,
`
<div class="hero"><h1>${escape(title)}</h1><p class="lede">${escape(catalog.secondary)}</p></div>
<section class="section quick-look"><h2 id="quick-look">Quick look</h2>
<!-- html-validate-disable-next prefer-native-element: The region is the section's keyboard scroll container. -->
<div class="quick-look-frame" tabindex="0" role="region" aria-labelledby="quick-look"><picture>
<source media="(prefers-color-scheme: dark)" srcset="${escape(`${demo}terminal-dark.svg`)}">
<img src="${escape(`${demo}terminal-light.svg`)}" width="${demoSize.width}" height="${demoSize.height}" alt="${escape(demoAlt)}" fetchpriority="high">
</picture></div></section>
<section class="section prose" aria-labelledby="install">${install.html}</section>
${app ? installation + quickLook : quickLook + installation}
<section class="section prose" aria-labelledby="usage">${usage.html}</section>
<section class="section" aria-labelledby="repositories"><h2 id="repositories">Repositories</h2>
<div class="repositories">${catalog.groups.map((group) => `<section class="repository-group"><h3>${escape(group.title)}</h3><ul>${group.repositories.map(({ name, outcome }) => `<li>${imageTag(icons.get(name), 32, "")}<div><a class="repository-name" href="${escape(`https://github.com/${owner}/${name}`)}">${escape(name)}</a><p>${escape(outcome)}</p></div></li>`).join("")}</ul></section>`).join("")}</div>
Expand All @@ -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],
Expand Down
33 changes: 33 additions & 0 deletions scripts/render-site.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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`,
),
),
);
},
);
4 changes: 4 additions & 0 deletions site.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
21 changes: 14 additions & 7 deletions sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@
"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",
"transform": "wawoff2@2.0.1"
},
{
"repository": "agents-tools/.github",
"revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0",
"revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3",
"path": ".github/design/fonts/OFL.txt",
"file": "sources/standard/.github/design/fonts/OFL.txt",
"sha256": "58d145732eea7ee61940a7eccecad160772b8621171b69b62183a5c7eb967740",
Expand All @@ -41,7 +41,7 @@
},
{
"repository": "agents-tools/.github",
"revision": "fae9f2f9e50ba2ad717bb27e5be7b1df2594a3b0",
"revision": "da6e2ff53ad1bb2bf3807fece3282fcf94c603a3",
"path": "LICENSE",
"file": "sources/standard/LICENSE",
"sha256": "e5161d00bc83bb836971bd3db25271351663b8aa8928eb1b15b58f3c47ccdbeb"
Expand Down Expand Up @@ -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",
Expand Down
82 changes: 82 additions & 0 deletions sources/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<p align="center">
<a href="https://github.com/agents-tools/app">
<img src="https://raw.githubusercontent.com/agents-tools/.github/fc8a2fc1b9d5dcea39788d0c70cd35dded2673ea/profile/assets/icon.png" width="160" alt="agents organization mark">
</a>
</p>

<h1 align="center">Agents App</h1>

<p align="center">
Manage agent skills, instructions, and configuration in a native macOS app.
</p>

<p align="center">
<a href="https://github.com/agents-tools/app/actions/workflows/check.yml"><img src="https://github.com/agents-tools/app/actions/workflows/check.yml/badge.svg?branch=master" alt="Check"></a> ·
<a href="https://github.com/agents-tools/app/releases/latest">Latest release</a>
</p>

<p align="center">
<a href="#install">Install</a> ·
<a href="#quick-start">Quick start</a> ·
<a href="#features">Features</a> ·
<a href="#development">Development</a>
</p>

## 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.
Loading
Loading