@duyquangnvx/create-agent-cli 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/bin.js +45 -16
- package/package.json +2 -2
- package/template/CHANGELOG.md +1 -1
- package/template/skills/{{binName}}/references/setup.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ What changed in each release of `@duyquangnvx/agent-cli` (the Runtime) and `@duy
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## v0.8.0 (2026-10-20)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Breaking:** `update` shows only the Upgrade steps of a skipped release whose CHANGELOG section lists them under `### Upgrade from v<version>`, under `upgrade steps for <version>:`. A release whose only step is `Nothing to do.` is left out, and one without the heading still shows its whole section under `changes in <version>:`.
|
|
12
|
+
- **Breaking:** each entry of `upgrades` in `update --json` is `{ version, steps }` or `{ version, notes }`.
|
|
13
|
+
- The scaffolded template's CHANGELOG asks each release from the second on to hold `### Upgrade from v<the release below>`, and its setup reference tells the agent to do the steps `update` prints. The agent-cli skill's shipping reference explains the convention.
|
|
14
|
+
|
|
7
15
|
## v0.7.0 (2026-10-20)
|
|
8
16
|
|
|
9
17
|
### Added
|
package/dist/bin.js
CHANGED
|
@@ -7554,8 +7554,20 @@ var RunControl = class {
|
|
|
7554
7554
|
}
|
|
7555
7555
|
};
|
|
7556
7556
|
//#endregion
|
|
7557
|
-
//#region ../agent-cli/dist/built-ins/
|
|
7557
|
+
//#region ../agent-cli/dist/built-ins/upgrades.js
|
|
7558
|
+
/** A skipped release's Upgrade steps, or its whole section when it lists none. */
|
|
7559
|
+
const upgradeSchema = union([object({
|
|
7560
|
+
version: string(),
|
|
7561
|
+
steps: array(string())
|
|
7562
|
+
}), object({
|
|
7563
|
+
version: string(),
|
|
7564
|
+
notes: string()
|
|
7565
|
+
})]);
|
|
7558
7566
|
const RELEASE_HEADING = /^## v?(\S+)/;
|
|
7567
|
+
const UPGRADE_HEADING = /^### Upgrade from v\S+$/;
|
|
7568
|
+
const HEADING = /^#{1,6} /;
|
|
7569
|
+
const ITEM = /^[-*] /;
|
|
7570
|
+
const NOTHING_TO_DO = /^nothing to do\.?$/i;
|
|
7559
7571
|
function releasesIn(changelog) {
|
|
7560
7572
|
const releases = [];
|
|
7561
7573
|
let current;
|
|
@@ -7570,16 +7582,33 @@ function releasesIn(changelog) {
|
|
|
7570
7582
|
if (current !== void 0) releases.push(current);
|
|
7571
7583
|
} else current?.lines.push(line);
|
|
7572
7584
|
}
|
|
7573
|
-
return releases
|
|
7585
|
+
return releases;
|
|
7586
|
+
}
|
|
7587
|
+
function listedSteps(lines) {
|
|
7588
|
+
const start = lines.findIndex((line) => UPGRADE_HEADING.test(line.trimEnd()));
|
|
7589
|
+
if (start === -1) return [];
|
|
7590
|
+
const end = lines.findIndex((line, i) => i > start && HEADING.test(line));
|
|
7591
|
+
const body = lines.slice(start + 1, end === -1 ? void 0 : end).filter((line) => line.trim() !== "");
|
|
7592
|
+
const starts = body.flatMap((line, i) => ITEM.test(line) ? [i] : []);
|
|
7593
|
+
return starts.map((first, i) => body.slice(first, starts[i + 1]).map((line) => line.trim()).join(" ").replace(ITEM, ""));
|
|
7594
|
+
}
|
|
7595
|
+
function upgradeOf({ version, lines }) {
|
|
7596
|
+
const listed = listedSteps(lines);
|
|
7597
|
+
if (listed.length === 0) return [{
|
|
7574
7598
|
version,
|
|
7575
7599
|
notes: lines.join("\n").trim()
|
|
7576
|
-
}
|
|
7600
|
+
}];
|
|
7601
|
+
const todo = listed.filter((step) => !NOTHING_TO_DO.test(step));
|
|
7602
|
+
return todo.length === 0 ? [] : [{
|
|
7603
|
+
version,
|
|
7604
|
+
steps: todo
|
|
7605
|
+
}];
|
|
7577
7606
|
}
|
|
7578
7607
|
/**
|
|
7579
|
-
* What
|
|
7580
|
-
* `packageDir`; none when the package ships no CHANGELOG.
|
|
7608
|
+
* What each release after `from` up to `to` asks of the operator, oldest first, from the
|
|
7609
|
+
* CHANGELOG.md in `packageDir`; none when the package ships no CHANGELOG.
|
|
7581
7610
|
*/
|
|
7582
|
-
async function
|
|
7611
|
+
async function upgradesOf(packageDir, from, to) {
|
|
7583
7612
|
let changelog;
|
|
7584
7613
|
try {
|
|
7585
7614
|
changelog = await readFile(join(packageDir, "CHANGELOG.md"), "utf8");
|
|
@@ -7587,7 +7616,7 @@ async function upgradeNotes(packageDir, from, to) {
|
|
|
7587
7616
|
if (isMissingFile(error)) return [];
|
|
7588
7617
|
throw error;
|
|
7589
7618
|
}
|
|
7590
|
-
return releasesIn(changelog).filter(({ version }) => compareVersions(version, from) > 0 && compareVersions(version, to) <= 0).sort((a, b) => compareVersions(a.version, b.version));
|
|
7619
|
+
return releasesIn(changelog).filter(({ version }) => compareVersions(version, from) > 0 && compareVersions(version, to) <= 0).sort((a, b) => compareVersions(a.version, b.version)).flatMap(upgradeOf);
|
|
7591
7620
|
}
|
|
7592
7621
|
//#endregion
|
|
7593
7622
|
//#region ../agent-cli/dist/built-ins/update.js
|
|
@@ -7598,18 +7627,18 @@ const updateSchema = object({
|
|
|
7598
7627
|
version: string(),
|
|
7599
7628
|
prefix: string()
|
|
7600
7629
|
}).nullable(),
|
|
7601
|
-
upgrades: array(
|
|
7602
|
-
version: string(),
|
|
7603
|
-
notes: string()
|
|
7604
|
-
})),
|
|
7630
|
+
upgrades: array(upgradeSchema),
|
|
7605
7631
|
next: array(string())
|
|
7606
7632
|
});
|
|
7607
7633
|
function nothingToInstall({ from, latest }) {
|
|
7608
7634
|
return standingOf(from, latest) === "current" ? `already on ${from}, the latest release: nothing to install` : `${from} is newer than the latest release ${latest}: nothing to install`;
|
|
7609
7635
|
}
|
|
7636
|
+
function renderUpgrade(upgrade) {
|
|
7637
|
+
return "steps" in upgrade ? [`\nupgrade steps for ${upgrade.version}:`, ...upgrade.steps.map((step) => `- ${step}`)].join("\n") : `\nchanges in ${upgrade.version}:\n${upgrade.notes}`;
|
|
7638
|
+
}
|
|
7610
7639
|
function renderUpdate(cli, install, update) {
|
|
7611
7640
|
const { installed } = update;
|
|
7612
|
-
const head = installed === null ? [nothingToInstall(update)] : [`installed ${install.package}@${installed.version} with the npm under ${installed.prefix}, replacing ${update.from}`, ...update.upgrades.map(
|
|
7641
|
+
const head = installed === null ? [nothingToInstall(update)] : [`installed ${install.package}@${installed.version} with the npm under ${installed.prefix}, replacing ${update.from}`, ...update.upgrades.map(renderUpgrade)];
|
|
7613
7642
|
const next = update.next.map((command) => `next: ${command}, so the ${cli.name} skill describes ${update.latest}`);
|
|
7614
7643
|
return (next.length === 0 ? head : [
|
|
7615
7644
|
...head,
|
|
@@ -7672,7 +7701,7 @@ function updateCommand(cli, install, { bin, node }) {
|
|
|
7672
7701
|
version: latest,
|
|
7673
7702
|
prefix
|
|
7674
7703
|
},
|
|
7675
|
-
upgrades: await
|
|
7704
|
+
upgrades: await upgradesOf(plan.packageDir, from, latest),
|
|
7676
7705
|
next: await skillNext(cli, latest, ctx)
|
|
7677
7706
|
};
|
|
7678
7707
|
if (ctx.signal.aborted) {
|
|
@@ -9408,14 +9437,14 @@ async function runProcess(cli) {
|
|
|
9408
9437
|
}
|
|
9409
9438
|
//#endregion
|
|
9410
9439
|
//#region package.json
|
|
9411
|
-
var version$1 = "0.
|
|
9440
|
+
var version$1 = "0.8.0";
|
|
9412
9441
|
var description = "Creates a new Agent CLI repository wired to @duyquangnvx/agent-cli.";
|
|
9413
9442
|
//#endregion
|
|
9414
9443
|
//#region src/build.ts
|
|
9415
9444
|
const build = {
|
|
9416
|
-
"sha": "
|
|
9445
|
+
"sha": "d2cc610",
|
|
9417
9446
|
"dirty": false,
|
|
9418
|
-
"builtAt": "2026-10-
|
|
9447
|
+
"builtAt": "2026-10-20T09:33:37.544Z"
|
|
9419
9448
|
};
|
|
9420
9449
|
//#endregion
|
|
9421
9450
|
//#region src/steps.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duyquangnvx/create-agent-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Creates a new Agent CLI repository wired to @duyquangnvx/agent-cli.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@duyquangnvx/agent-cli": "0.
|
|
22
|
+
"@duyquangnvx/agent-cli": "0.8.0",
|
|
23
23
|
"tsdown": "0.23.0",
|
|
24
24
|
"zod": "4.6.7"
|
|
25
25
|
},
|
package/template/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
What changed in each release of `{{packageName}}`, newest first, in the format of [Keep a Changelog 2.0](https://keepachangelog.com/en/2.0.0/). Each change lands under `## Unreleased` as it merges, grouped under `### Added`, `### Changed`, `### Fixed` or `### Removed`. A breaking change starts with `**Breaking:**` and names what breaks: a Command, a flag, a `--json` field, an exit code or the skill. A release turns `## Unreleased` into `## vX.Y.Z (YYYY-MM-DD)`.
|
|
3
|
+
What changed in each release of `{{packageName}}`, newest first, in the format of [Keep a Changelog 2.0](https://keepachangelog.com/en/2.0.0/). Each change lands under `## Unreleased` as it merges, grouped under `### Added`, `### Changed`, `### Fixed` or `### Removed`. A breaking change starts with `**Breaking:**` and names what breaks: a Command, a flag, a `--json` field, an exit code or the skill. A release turns `## Unreleased` into `## vX.Y.Z (YYYY-MM-DD)`. From the second release on, a release holds `### Upgrade from v<the release below>` listing what someone upgrading must do, or `- Nothing to do.`.
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
@@ -32,7 +32,7 @@ This installs the CLI. The user has installed this skill already.
|
|
|
32
32
|
## Update
|
|
33
33
|
|
|
34
34
|
1. Run `{{binName}} update --dry-run` to see the version it would install. If it fails to reach the registry, the sandbox refused the host, as [Sandbox](#sandbox) says: go on to the next step.
|
|
35
|
-
2. Ask the user to type `! {{binName}} update`; never run it yourself. It installs the latest release and prints
|
|
35
|
+
2. Ask the user to type `! {{binName}} update`; never run it yourself. It installs the latest release and prints, for each release since the version it replaced, oldest first, the upgrade steps it asks of the user, or its whole notes when it lists none: under `--json`, each entry of `upgrades` holds `steps` or `notes`. Do each step, oldest first, and any the notes give.
|
|
36
36
|
3. Hand the user each line in `next` to type with `!`: they bring this skill to the version `update` installed, or to the latest release when it installed nothing, as `doctor`'s `skill` row would. Load this skill again after, as [Check](#check) says.
|
|
37
37
|
4. Confirm the new version with `{{binName}} --version`.
|
|
38
38
|
|