Skip to content

Commit fd9f982

Browse files
authoredand pushed
Merge pull request #675 from jamesmontemagno/agents/agent-changelog-release-notes
Add Agent changelog and automatic release notes
2 parents 5afcac2 + 8ad5f21 commit fd9f982

13 files changed

Lines changed: 454 additions & 61 deletions

File tree

‎.github/copilot-instructions.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ Do not mix platform-specific implementation patterns:
3232

3333
## Agent API Coverage
3434

35-
- Treat agent access as part of every new or changed user-facing capability on both platforms. In the same change, expose its meaningful actions and state through Agent Control so agents can use it autonomously without relying on UI interaction.
36-
- Add or update commands and schemas in `shared/automation/commands.json`, then implement and advertise them in the macOS and Windows automation handlers wherever the feature exists. Do not invent cross-platform feature parity: an unsupported platform must return `not_supported` and must not advertise the command.
37-
- Ensure the shared CLI and MCP server expose the capability with the correct schema. Update relevant Skills, `docs/agent-integration.md`, and examples when workflows change; test the contract, platform behavior, errors, and CLI/MCP exposure as appropriate.
35+
- Do not assume that every new or changed app capability belongs in Agent Control or the Agent CLI. First evaluate whether agent access is safe, meaningful, and likely to help an autonomous agent; consider security, least-privilege scopes, approvals, OS permissions, platform support, and whether UI-only configuration is intentional.
36+
- If the value or safety is ambiguous, ask the user whether to add Agent API coverage instead of silently exposing or omitting it. This is especially important for destructive, purchase, account, or permission-sensitive actions.
37+
- When Agent API coverage is explicitly requested or clearly warranted, add or update commands and schemas in `shared/automation/commands.json`, then implement and advertise them in the macOS and Windows automation handlers wherever the feature exists. Do not invent cross-platform feature parity: an unsupported platform must return `not_supported` and must not advertise the command.
38+
- Ensure the shared CLI and MCP server expose the capability with the correct schema only when it belongs in the Agent API. Update relevant Skills, `docs/agent-integration.md`, and examples when workflows change; test the contract, platform behavior, errors, and CLI/MCP exposure as appropriate.
3839
- Preserve opt-in Agent Control, pairing, least-privilege scopes, sensitive-action approvals, audit logging, path restrictions, OS permissions, and Pro/Store requirements. Never bypass these protections to make a feature autonomous.
39-
- If a capability cannot be safely or meaningfully exposed, explain the limitation and get user direction rather than silently omitting agent support.
40+
- If a capability cannot be safely or meaningfully exposed, explain the limitation and get user direction rather than silently omitting or bypassing agent support.
41+
- If the Agent CLI, MCP server, plugin, or shared automation contract changes, update `agent/CHANGELOG.md` under `## Unreleased` with the user-visible CLI/plugin/MCP/contract change.
4042

4143
## Build and Validate
4244

@@ -96,7 +98,8 @@ dotnet test windows/tests/TinyClips.Core.Tests/TinyClips.Core.Tests.csproj -c De
9698
- Update changelog for the affected platform:
9799
- root [CHANGELOG.md](../CHANGELOG.md) for mac/shared changes
98100
- [windows/CHANGELOG.md](../windows/CHANGELOG.md) for Windows app changes
101+
- [agent/CHANGELOG.md](../agent/CHANGELOG.md) for Agent CLI, MCP, plugin, or shared automation contract changes
99102
- Preserve accessibility quality gates:
100103
- mac: VoiceOver + keyboard for affected flows
101104
- windows: keyboard navigation and accessible names for new/changed controls
102-
- Confirm new and changed capabilities have agent API coverage, tests, and relevant documentation on each supported platform.
105+
- For any new or changed capability, decide whether Agent API coverage is warranted. Confirm it when added, ask the user when ambiguous, and document intentional UI-only or unsupported behavior.

‎.github/extensions/tinyclips-release-hub/release-data.mjs‎

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { execFile } from "node:child_process";
2-
import { mkdtemp, readFile, rm } from "node:fs/promises";
2+
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
33
import { tmpdir } from "node:os";
44
import { dirname, resolve } from "node:path";
55
import { fileURLToPath } from "node:url";
@@ -57,7 +57,7 @@ function platformConfig(platform) {
5757
}
5858
if (platform === "agent") {
5959
return {
60-
changelog: "CHANGELOG.md",
60+
changelog: "agent/CHANGELOG.md",
6161
unreleasedHeading: "## Unreleased",
6262
workflow: "agent-release.yml",
6363
};
@@ -127,8 +127,11 @@ function extractSection(markdown, heading) {
127127
}
128128

129129
function releaseHeadingMatches(line, platform, version) {
130-
if (platform === "mac") {
131-
return line === `## ${version}` || line.startsWith(`## ${version} -`);
130+
if (platform === "mac" || platform === "agent") {
131+
const headingVersion = platform === "agent" && version.startsWith("agent-v")
132+
? version.slice("agent-v".length)
133+
: version;
134+
return line === `## ${headingVersion}` || line.startsWith(`## ${headingVersion} -`);
132135
}
133136
return line === `## [${version}]` || line.startsWith(`## [${version}] -`);
134137
}
@@ -153,6 +156,34 @@ function countNotes(markdown) {
153156
return markdown.split(/\r?\n/).filter((line) => line.trim().startsWith("- ")).length;
154157
}
155158

159+
function archiveAgentUnreleasedNotes(markdown, version) {
160+
const lines = markdown.split(/\r?\n/);
161+
const start = lines.findIndex((line) => line.trim() === "## Unreleased");
162+
if (start < 0) {
163+
throw new Error("agent/CHANGELOG.md has no ## Unreleased section.");
164+
}
165+
const end = lines.findIndex((line, index) => index > start && line.startsWith("## "));
166+
const sectionEnd = end < 0 ? lines.length : end;
167+
const body = lines.slice(start + 1, sectionEnd).join("\n").trim();
168+
if (countNotes(body) === 0) {
169+
return markdown;
170+
}
171+
if (lines.some((line) => line.trim() === `## ${version}` || line.trim().startsWith(`## ${version} - `))) {
172+
throw new Error(`agent/CHANGELOG.md already contains a ${version} release section.`);
173+
}
174+
const date = new Date().toISOString().slice(0, 10);
175+
const updated = [
176+
...lines.slice(0, start + 1),
177+
"",
178+
`## ${version} - ${date}`,
179+
"",
180+
...body.split(/\r?\n/),
181+
"",
182+
...lines.slice(sectionEnd),
183+
];
184+
return updated.join("\n");
185+
}
186+
156187
function repositoryWebUrl(remoteUrl) {
157188
const githubPath = remoteUrl.match(/github\.com(?::|\/)([^/]+\/[^/]+?)(?:\.git)?$/)?.[1];
158189
return githubPath ? `https://github.com/${githubPath.replace(/\.git$/, "")}` : null;
@@ -904,8 +935,23 @@ export async function performReleaseAction(action, input) {
904935
await run("git", ["switch", "--quiet", "-c", releaseBranch(input.tag), head], { cwd: checkout });
905936
await run("git", ["remote", "set-url", "origin", remoteUrl], { cwd: checkout });
906937
await run("node", ["agent/scripts/bump-version.mjs", input.tag.slice("agent-v".length)], { cwd: checkout });
907-
await run("git", ["add", "agent/src/TinyClips.Cli/TinyClips.Cli.csproj", "plugin.json", "agent/src/TinyClips.Cli/.mcp/server.json"], { cwd: checkout });
908-
await run("git", ["-c", `user.name=${authorName}`, "-c", `user.email=${authorEmail}`, "commit", "-m", `Bump agent version for ${input.tag}\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>`], { cwd: checkout });
938+
const changelogPath = resolve(checkout, "agent/CHANGELOG.md");
939+
const changelog = await readFile(changelogPath, "utf8");
940+
const archivedChangelog = archiveAgentUnreleasedNotes(
941+
changelog,
942+
input.tag.slice("agent-v".length),
943+
);
944+
if (archivedChangelog !== changelog) {
945+
await writeFile(changelogPath, archivedChangelog);
946+
}
947+
await run("git", [
948+
"add",
949+
"agent/CHANGELOG.md",
950+
"agent/src/TinyClips.Cli/TinyClips.Cli.csproj",
951+
"plugin.json",
952+
"agent/src/TinyClips.Cli/.mcp/server.json",
953+
], { cwd: checkout });
954+
await run("git", ["-c", `user.name=${authorName}`, "-c", `user.email=${authorEmail}`, "commit", "-m", `Bump agent version for ${input.tag}\n\nCo-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>`], { cwd: checkout });
909955
await run("git", ["push", `--force-with-lease=refs/heads/${releaseBranch(input.tag)}:`, "origin", `HEAD:refs/heads/${releaseBranch(input.tag)}`], { cwd: checkout });
910956
await run("gh", [
911957
"pr", "create", "--base", "main", "--head", releaseBranch(input.tag),

0 commit comments

Comments
 (0)