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
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: release
# - build (ubuntu-latest): the Linux and Windows `agenthub` binaries.
# - darwin (macos-latest): the two macOS binaries, which need codesign (an ad-hoc signature). No secrets.
# - release: refuses to go on without all five binaries; adds SHA256SUMS and LICENSE and publishes the
# GitHub release. Nothing below runs without it, so a release is never partial.
# GitHub release, with notes from the tag's CHANGELOG.md entry (scripts/release-notes.mjs). Nothing below runs without it, so a release is never partial.
# - npm: @theagenthub/cli, @theagenthub/opencode and @theagenthub/pi, with npm's trusted publishing.
# - plugin-repo: the public plugin repo, with the PLUGINS_DEPLOY_KEY secret (docs/plugins.md).
# - image: the hub's Docker image on ghcr.io/division-software/theagenthub, for amd64 and arm64.
Expand Down Expand Up @@ -90,13 +90,16 @@ jobs:
run: sha256sum agenthub-* > SHA256SUMS
- name: License
run: cp LICENSE dist-bin/LICENSE
# The notes are the tag's CHANGELOG.md entry and the list of what the release publishes; no entry, no release.
- name: Notes
run: node scripts/release-notes.mjs "$GITHUB_REF_NAME" > "$RUNNER_TEMP/notes.md"
- name: Publish
run: |
if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" dist-bin/* --repo "$GITHUB_REPOSITORY" --clobber
gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --draft=false --latest
gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --draft=false --latest --notes-file "$RUNNER_TEMP/notes.md"
else
gh release create "$GITHUB_REF_NAME" dist-bin/* --repo "$GITHUB_REPOSITORY" --verify-tag --title "$GITHUB_REF_NAME" --generate-notes --latest
gh release create "$GITHUB_REF_NAME" dist-bin/* --repo "$GITHUB_REPOSITORY" --verify-tag --title "$GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/notes.md" --latest
fi
npm:
# Publishes with npm's trusted publishing: GitHub vouches for this workflow, job environment and repo
Expand Down
403 changes: 108 additions & 295 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ The image runs as the `node` user, applies migrations at startup, and stops clea

1. `curl https://<hub>/healthz` returns `{"ok":true}`.
2. Add the hub to a harness: `{"type": "http", "url": "https://<hub>/mcp"}`. The harness signs in through the browser the first time.
3. For notifications, each user runs `agenthub login --hub https://<hub>` and `agenthub hooks install claude-code` (or `codex`). See the README.
3. For notifications, each user runs `agenthub login --hub https://<hub>` and `agenthub hooks install claude-code` (or `codex`). See [Getting started](wiki/Getting-Started.md).
4. Each user's dashboard is at `https://<hub>/dashboard`, with no extra settings: they sign in with the code host and see their own agents ([wiki](wiki/Dashboard.md)). The hub's front page links to it.
298 changes: 298 additions & 0 deletions docs/hub-reference.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The sources live here, in [`plugins/`](../plugins/). Each release builds them in
- `agenthub notify` updates the CLI in the background when a newer release is out, unless `agenthub settings auto-update off`. With Claude Code's `auto_update` option off (it's on by default), the script sets `AGENTHUB_AUTO_UPDATE=0` to stop it in that plugin's sessions.
- If `agenthub hooks install <harness>` already put hooks in that harness's settings, `--plugin` makes notify and wait do nothing, so notices don't show twice. The CLI checks this, not the script. The session-start notice says how to remove the old ones.
- Windows needs Git for Windows, since the hooks run through `sh`.
- **`skills/agenthub/SKILL.md`**: the instructions from the README, so users don't paste them into `CLAUDE.md` or `AGENTS.md`.
- **`skills/agenthub/SKILL.md`**: the instructions from the [hub reference](hub-reference.md#harness-plugins), so users don't paste them into `CLAUDE.md` or `AGENTS.md`.

The hooks' notices need `agenthub login --hub <url>` once. The MCP tools in Claude Code and Codex sign in through the harness instead.

Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/Agent-Cards.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agent cards

Each agent on a project has a card that tells the others what it is and what it's doing, so they can route work to it. Teammates see cards in `list_agents`, and in the [admin panel](../../README.md#admin-panel) for hub operators.
Each agent on a project has a card that tells the others what it is and what it's doing, so they can route work to it. Teammates see cards in `list_agents`, and in the [admin panel](../hub-reference.md#admin-panel) for hub operators.

## Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/Setup-Without-Git.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ The CLI calls `git` only to read the remotes and the current branch. Without it,

## CI and headless agents

A CI job has no browser to sign in with. A project admin creates a bot client with `create_bot`, and the job gets tokens with the client-credentials grant. See [Bots for CI](../../README.md#bots-for-ci-and-headless-agents).
A CI job has no browser to sign in with. A project admin creates a bot client with `create_bot`, and the job gets tokens with the client-credentials grant. See [Bots for CI](../hub-reference.md#bots-for-ci-and-headless-agents).
74 changes: 74 additions & 0 deletions scripts/release-notes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env node
// The GitHub release's notes for a version: its CHANGELOG.md entry, then everything the release publishes
// (binaries, npm packages, plugins, the Docker image), so one page says where each part of it is.
//
// node scripts/release-notes.mjs v0.5.7 > notes.md
import { readFileSync } from "node:fs";

const REPO = "division-software/theagenthub";
const PLUGINS_REPO = "division-software/agenthub-plugins";
const IMAGE = "ghcr.io/division-software/theagenthub";
export const NPM_PACKAGES = ["@theagenthub/cli", "@theagenthub/opencode", "@theagenthub/pi"];
export const BINARIES = [
["macOS (Apple silicon)", "agenthub-darwin-arm64"],
["macOS (Intel)", "agenthub-darwin-x64"],
["Linux (x64)", "agenthub-linux-x64"],
["Linux (arm64)", "agenthub-linux-arm64"],
["Windows (x64, also on ARM)", "agenthub-windows-x64.exe"],
];

/** The body of `## <version>` in the changelog, without its heading; throws if there's none. */
export function changelogEntry(changelog, version) {
const v = version.replace(/^v/, "");
const lines = changelog.split("\n");
const start = lines.findIndex((l) => l.trim() === `## ${v}`);
if (start < 0) throw new Error(`CHANGELOG.md has no "## ${v}" entry`);
let end = lines.findIndex((l, i) => i > start && /^## /.test(l));
if (end < 0) end = lines.length;
return lines.slice(start + 1, end).join("\n").trim();
}

export function releaseNotes(changelog, version) {
const tag = version.startsWith("v") ? version : `v${version}`;
const v = tag.slice(1);
const download = (file) => `https://github.com/${REPO}/releases/download/${tag}/${file}`;
return [
changelogEntry(changelog, tag),
"",
"## What this release publishes",
"",
"**The `agenthub` CLI**, one file with Node built in. Install or update it with:",
"",
"```sh",
"curl -fsSL https://get.theagenthub.app | sh # macOS and Linux",
"irm https://get.theagenthub.app/install.ps1 | iex # Windows PowerShell",
"agenthub update # an installed CLI (it also updates itself)",
"```",
"",
"| Platform | Binary |",
"| --- | --- |",
...BINARIES.map(([label, file]) => `| ${label} | [\`${file}\`](${download(file)}) |`),
"",
`Each is listed in [\`SHA256SUMS\`](${download("SHA256SUMS")}), which the installer and \`agenthub update\` check.`,
"",
"**npm packages**",
"",
...NPM_PACKAGES.map((p) => `- [\`${p}@${v}\`](https://www.npmjs.com/package/${p}/v/${v})`),
"",
`**Plugins** for Claude Code, Codex, Copilot (CLI and VS Code) and Amp: [\`${PLUGINS_REPO}@${tag}\`](https://github.com/${PLUGINS_REPO}/tree/${tag}). OpenCode and pi use the npm packages above.`,
"",
`**The hub's Docker image**, for linux/amd64 and linux/arm64: \`${IMAGE}:${v}\` (also \`:latest\`). The hosted hub at https://hub.theagenthub.app runs this release.`,
"",
"Setup and upgrade steps are in the [wiki](https://wiki.theagenthub.app).",
"",
].join("\n");
}

if (import.meta.url === `file://${process.argv[1]}`) {
const version = process.argv[2];
if (!version) {
console.error("usage: node scripts/release-notes.mjs <version>");
process.exit(2);
}
process.stdout.write(releaseNotes(readFileSync(new URL("../CHANGELOG.md", import.meta.url), "utf8"), version));
}
39 changes: 39 additions & 0 deletions test/release-notes.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
// @ts-expect-error a plain .mjs script, without types
import { BINARIES, NPM_PACKAGES, changelogEntry, releaseNotes } from "../scripts/release-notes.mjs";

const CHANGELOG = "# Changelog\n\nIntro.\n\n## Unreleased\n\n- next\n\n## 1.2.3\n\nSummary.\n\n- **A change.**\n\n### Upgrading\n\n- Hub first.\n\n## 1.2.2\n\n- old\n";

describe("release notes", () => {
it("take the version's changelog entry, with or without the v", () => {
expect(changelogEntry(CHANGELOG, "v1.2.3")).toBe("Summary.\n\n- **A change.**\n\n### Upgrading\n\n- Hub first.");
expect(changelogEntry(CHANGELOG, "1.2.2")).toBe("- old");
expect(() => changelogEntry(CHANGELOG, "v9.9.9")).toThrow('no "## 9.9.9" entry');
});

it("list every binary, npm package, the plugins and the image at that version", () => {
const notes: string = releaseNotes(CHANGELOG, "v1.2.3");
expect(notes.startsWith("Summary.")).toBe(true);
for (const [, file] of BINARIES as Array<[string, string]>) expect(notes).toContain(`releases/download/v1.2.3/${file}`);
expect(notes).toContain("releases/download/v1.2.3/SHA256SUMS");
for (const p of NPM_PACKAGES as string[]) expect(notes).toContain(`https://www.npmjs.com/package/${p}/v/1.2.3`);
expect(notes).toContain("division-software/agenthub-plugins/tree/v1.2.3");
expect(notes).toContain("ghcr.io/division-software/theagenthub:1.2.3");
expect(notes).not.toContain("- old");
});

it("match the binaries release.yml requires and the packages the build publishes", () => {
const workflow = readFileSync(new URL("../.github/workflows/release.yml", import.meta.url), "utf8");
for (const [, file] of BINARIES as Array<[string, string]>) expect(workflow).toContain(file);
for (const dir of ["cli", "opencode", "pi"]) {
const pkg = JSON.parse(readFileSync(new URL(`../plugins/${dir}/package.json`, import.meta.url), "utf8")) as { name: string };
expect(NPM_PACKAGES).toContain(pkg.name);
}
});

it("exist for the version in package.json", () => {
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) as { version: string };
expect(() => changelogEntry(readFileSync(new URL("../CHANGELOG.md", import.meta.url), "utf8"), version)).not.toThrow();
});
});
4 changes: 2 additions & 2 deletions website/agents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* To add an agent, or to move one from "soon" to "supported", edit this list only;
* site.js builds the dropdown, the install step and the capability card from it.
* Keep it in step with the README ("CLI and harness hooks" and "Harness plugins").
* Keep it in step with docs/hub-reference.md ("CLI and harness hooks" and "Harness plugins").
*
* id short key, also used in the page's ?agent=<id> links (theagenthub.app/?agent=codex#start)
* name shown in the dropdown
Expand Down Expand Up @@ -52,7 +52,7 @@
});
const noWake = (n) => ["no", `${n} can't start a turn from outside. Run agenthub watch beside it.`];

// Planned capabilities, from the README's harness survey.
// Planned capabilities, from the harness survey in docs/hub-reference.md.
const hooksPlanned = {
plugin: ["soon", "One install for the MCP server, hooks and house rules."],
notices: ["soon", "Hooks will add new messages at session start, on prompts and after tool calls."],
Expand Down
Loading