@agentage/cli 0.71.0 → 0.73.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.
@@ -6,6 +6,7 @@ import { hostClient } from '../../lib/daemon/host-client.js';
6
6
  import { CliError } from '../../lib/json-output.js';
7
7
  import { loadKitTool } from './kit-tool.js';
8
8
  import { confirmed, report, summaryOf, terminalIo } from './lifecycle.js';
9
+ import { OWN_TEMPLATES } from './create-source.js';
9
10
  import { ignoreLocal } from './up-local.js';
10
11
  import { buildPackage, newerKitLine, npmIn } from './package-build.js';
11
12
  export const createInstallDeps = {
@@ -67,10 +68,9 @@ export const installCreated = async (folder, install, deps = createInstallDeps)
67
68
  console.log(url ? ` url ${url}` : ' url none answers yet: agentage extension list');
68
69
  return { installed, url };
69
70
  };
70
- const OWN_TEMPLATE = 'agentage/extension-template';
71
71
  // Another repo, or a branch of ours, is code nobody reviewed for you: its build script runs here.
72
72
  export const trustFrom = async (from, opts, io = terminalIo()) => {
73
- if (from === OWN_TEMPLATE)
73
+ if (OWN_TEMPLATES.includes(from))
74
74
  return;
75
75
  console.error(`template ${from}: code from that repo will be built and run on this machine`);
76
76
  if (opts.yes)
@@ -0,0 +1,10 @@
1
+ export declare const TEMPLATE = "agentage/kit:template";
2
+ export declare const OWN_TEMPLATES: string[];
3
+ export declare const fromRefusal: (from: string) => string;
4
+ export declare const repoRef: (from: string) => {
5
+ repo: string;
6
+ ref?: string;
7
+ folder?: string;
8
+ };
9
+ export declare const removeOwn: (path: string) => void;
10
+ export declare const clone: (url: string, from: string, dir: string) => Promise<void>;
@@ -0,0 +1,80 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { lstatSync, mkdtempSync, readdirSync, renameSync, rmSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { promisify } from 'node:util';
5
+ import { holdSignals } from '../../core/loader/dispose.js';
6
+ const run = promisify(execFile);
7
+ // The kit repo holds the template in its folder template/; the old repo held it at its root.
8
+ export const TEMPLATE = 'agentage/kit:template';
9
+ export const OWN_TEMPLATES = [
10
+ TEMPLATE,
11
+ 'agentage/platform:template',
12
+ 'agentage/extension-template',
13
+ ];
14
+ // owner/repo, then #branch and :folder, each optional: nothing that can pass for a flag or leave the repo.
15
+ const FROM = /^[\w.-]+\/[\w.-]+(?:#\w[\w./-]*)?(?::\w[\w.-]*(?:\/\w[\w.-]*)*)?$/;
16
+ export const fromRefusal = (from) => !FROM.test(from) || from.includes('..')
17
+ ? `--from ${from}: owner/repo, owner/repo#branch, either with :folder`
18
+ : '';
19
+ // --from owner/repo[#branch][:folder], checked by fromRefusal() first; a git ref has no `:`.
20
+ export const repoRef = (from) => {
21
+ const [head = from, folder] = from.split(':');
22
+ const [repo = head, ref] = head.split('#');
23
+ return { repo, ...(ref && { ref }), ...(folder && { folder }) };
24
+ };
25
+ // Bounded; git's own first line says why (no repo, no network, no access).
26
+ const gitClone = (url, from, into) => {
27
+ const { ref } = repoRef(from);
28
+ const branch = ref ? ['--branch', ref] : [];
29
+ const env = { ...process.env, GIT_TERMINAL_PROMPT: '0' };
30
+ return run('git', ['clone', '-q', '--depth', '1', ...branch, url, into], {
31
+ env,
32
+ timeout: 120_000,
33
+ }).catch((err) => {
34
+ const why = (err.stderr?.trim() || err.message).split('\n')[0];
35
+ throw new Error(`cannot clone template ${from}: ${why}`);
36
+ });
37
+ };
38
+ // Real folders on the whole path: a link could point the move and the rewrite outside the repo.
39
+ const takeFolder = (into, folder, from, dir) => {
40
+ const steps = folder.split('/').map((_, at, all) => join(into, ...all.slice(0, at + 1)));
41
+ if (!steps.every((step) => lstatSync(step, { throwIfNoEntry: false })?.isDirectory()))
42
+ throw new Error(`cannot clone template ${from}: no folder ${folder} in the repo`);
43
+ renameSync(join(into, folder), dir);
44
+ };
45
+ // No link at all (the kit's template has none); walked by hand, as a recursive readdir follows links in a loop.
46
+ const refuseLinks = (dir, from) => {
47
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
48
+ const path = join(dir, entry.name);
49
+ if (entry.isSymbolicLink())
50
+ throw new Error(`template ${from}: a symbolic link ${path}`);
51
+ if (entry.isDirectory())
52
+ refuseLinks(path, from);
53
+ }
54
+ };
55
+ // Removes only what this run made; also the Ctrl-C path, so it never throws.
56
+ export const removeOwn = (path) => rmSync(path, { recursive: true, force: true });
57
+ // A fresh name beside the new folder (a rename across disks fails), so no folder of yours is reused.
58
+ const cloneFolder = (dir, folder) => folder ? mkdtempSync(`.${dir}.clone-`) : dir;
59
+ // With :folder only that folder stays; a signal during the clone removes this run's folders, then exits as it would.
60
+ export const clone = async (url, from, dir) => {
61
+ const { folder } = repoRef(from);
62
+ const into = cloneFolder(dir, folder);
63
+ const release = holdSignals(async () => [into, dir].forEach(removeOwn));
64
+ try {
65
+ await gitClone(url, from, into);
66
+ if (folder)
67
+ takeFolder(into, folder, from, dir);
68
+ removeOwn(join(dir, '.git'));
69
+ refuseLinks(dir, from);
70
+ }
71
+ catch (err) {
72
+ removeOwn(dir);
73
+ throw err;
74
+ }
75
+ finally {
76
+ release();
77
+ if (folder)
78
+ removeOwn(into);
79
+ }
80
+ };
@@ -1,7 +1,8 @@
1
1
  import { type Command } from 'commander';
2
2
  import { installCreated } from './create-install.js';
3
+ import { TEMPLATE } from './create-source.js';
3
4
  import { type ConfirmIo } from './lifecycle.js';
4
- export declare const TEMPLATE = "agentage/extension-template";
5
+ export { TEMPLATE };
5
6
  export declare const PARTS: string[];
6
7
  export interface ExtensionCreateOptions {
7
8
  id: string;
@@ -1,20 +1,16 @@
1
- import { execFile } from 'node:child_process';
2
1
  import { existsSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
3
2
  import { join } from 'node:path';
4
- import { promisify } from 'node:util';
5
3
  import {} from 'commander';
6
4
  import { addJson, CliError } from '../../lib/json-output.js';
7
5
  import { installCreated, trustFrom } from './create-install.js';
6
+ import { clone, fromRefusal, repoRef, TEMPLATE } from './create-source.js';
8
7
  import { terminalIo } from './lifecycle.js';
9
- const run = promisify(execFile);
10
- export const TEMPLATE = 'agentage/extension-template';
8
+ export { TEMPLATE };
11
9
  export const PARTS = ['pages', 'ui', 'api', 'mcp', 'worker', 'store', 'cli', 'app'];
12
10
  const ROUTED = ['pages', 'ui', 'api', 'mcp'];
13
11
  // `_` is a separator here, so `template__echo` is the id too.
14
12
  const WORD = /(?<![A-Za-z0-9])template(?![A-Za-z0-9])/g;
15
13
  const LOCK = 'package-lock.json';
16
- // owner/repo, optionally #branch: a git ref that cannot pass for a flag or leave the repo.
17
- const FROM = /^[\w.-]+\/[\w.-]+(?:#\w[\w./-]*)?$/;
18
14
  // What else goes with a dropped part: manifest keys the kit refuses without it, the store's SQL, the contract file of api and mcp.
19
15
  const PRUNE = {
20
16
  cli: { keys: [['agentage', 'commands']] },
@@ -33,8 +29,8 @@ const refusal = ({ id, parts, from = TEMPLATE }, kept) => {
33
29
  return `id ${id} is a part name: pick another id`;
34
30
  if (!kept.some((part) => ROUTED.includes(part)))
35
31
  return `an extension needs at least one of ${ROUTED.join(', ')}`;
36
- if (!FROM.test(from) || from.includes('..'))
37
- return `--from ${from}: owner/repo or owner/repo#branch`;
32
+ if (fromRefusal(from))
33
+ return fromRefusal(from);
38
34
  return existsSync(`extension-${id}`)
39
35
  ? `extension-${id} exists: pick another id or remove it`
40
36
  : '';
@@ -54,6 +50,8 @@ const drop = (dir, kept) => {
54
50
  delete parent[path.at(-1) ?? ''];
55
51
  }
56
52
  }
53
+ // The new repo is the folder itself: a monorepo path of the template would point into nothing.
54
+ delete pkg['repository']?.['directory'];
57
55
  save(join(dir, 'package.json'), pkg);
58
56
  };
59
57
  // Every word `template` in a text file or a file name is the id: package name, host, contract.
@@ -82,26 +80,6 @@ const renameLock = (dir, id) => {
82
80
  Object.assign(at, { name });
83
81
  save(join(dir, LOCK), lock);
84
82
  };
85
- // --from owner/repo[#branch], checked by refusal() first.
86
- const repoRef = (from) => {
87
- const [repo = from, ref] = from.split('#');
88
- return { repo, ...(ref && { ref }) };
89
- };
90
- // Bounded, a partial folder removed; git's own first line says why (no repo, no network, no access).
91
- const clone = async (url, from, dir) => {
92
- const { ref } = repoRef(from);
93
- const branch = ref ? ['--branch', ref] : [];
94
- const env = { ...process.env, GIT_TERMINAL_PROMPT: '0' };
95
- await run('git', ['clone', '-q', '--depth', '1', ...branch, url, dir], {
96
- env,
97
- timeout: 120_000,
98
- }).catch((err) => {
99
- rmSync(dir, { recursive: true, force: true });
100
- const why = (err.stderr?.trim() || err.message).split('\n')[0];
101
- throw new Error(`cannot clone template ${from}: ${why}`);
102
- });
103
- rmSync(join(dir, '.git'), { recursive: true, force: true });
104
- };
105
83
  const CI = join('.github', 'workflows', 'ci.yml');
106
84
  const FLOOR = /MIN_EXECUTED: '\d+'/;
107
85
  const LOWERED = " ci MIN_EXECUTED is 1: after the first green run, set it to the gate's count";
@@ -132,14 +110,14 @@ const shape = (dir, from, id, kept) => {
132
110
  };
133
111
  const printNext = (dir, from, id, kept) => {
134
112
  const kit = String(json(join(dir, 'package.json'))['dependencies']?.['@agentage/extension'] ?? '?');
135
- const { repo, ref } = repoRef(from);
113
+ const { repo, ref, folder } = repoRef(from);
136
114
  const branch = ref ? `branch ${ref}` : 'default branch';
137
- console.log(` template ${repo} (${branch}, kit ${kit.replace(/^[\^~]/, '')})`);
115
+ console.log(` template ${repo}${folder ? `:${folder}` : ''} (${branch}, kit ${kit.replace(/^[\^~]/, '')})`);
138
116
  console.log(` kept ${kept.join(', ')}`);
139
117
  console.log(` id ${id} · host ${id}.next.agentage.io · contract ${id}.mcpc.json`);
140
118
  console.log(` next cd ${dir} && agentage extension up`);
141
119
  };
142
- // Clones the template's default branch (or the #branch of --from) into ./extension-<id> as a new working copy, no history;
120
+ // Clones the template's default branch (or the #branch of --from; only its :folder) into ./extension-<id>, no history;
143
121
  // then installs its dependencies, builds it and (unless --no-install) gives it to the daemon.
144
122
  export const runExtensionCreate = async (opts, url = (from) => `https://github.com/${from}`, after = installCreated, io = terminalIo()) => {
145
123
  const { id, from = TEMPLATE } = opts;
@@ -161,6 +139,6 @@ export const addCreate = (group, create) => addJson(group
161
139
  .description('Create ./extension-<id> from the extension template with the parts named')
162
140
  .argument('<id>', 'the extension id, also its host and contract name')
163
141
  .argument('[parts...]', `parts to keep (default: all eight): ${PARTS.join(', ')}`)
164
- .option('--from <owner/repo[#branch]>', `the template repo (default: ${TEMPLATE})`)
142
+ .option('--from <owner/repo[#branch][:folder]>', `the template repo and folder (default: ${TEMPLATE})`)
165
143
  .option('--no-install', 'build the folder, but do not give it to the daemon')
166
144
  .option('--yes', 'run code from another --from repo or branch without asking')).action((id, parts, o) => create({ id, parts, ...o }));
@@ -2,6 +2,7 @@ import { join } from 'node:path';
2
2
  import { CliError } from '../../lib/json-output.js';
3
3
  import { writeCiCopy } from './release-folders.js';
4
4
  import { imagesOf, releaseGuard } from './release-guard.js';
5
+ import { amber, npmRefusal } from './release-npm.js';
5
6
  import { fetchTags, git, planRelease } from './release-plan.js';
6
7
  import { rowsOf, summary } from './release-summary.js';
7
8
  import { attach, buildImages, fail, idChecks, npmVersion, onMaster, publish, PUBLISH_SECONDS, scoped, step, takeSecrets, } from './release-steps.js';
@@ -55,9 +56,11 @@ const prepare = async (s, p) => {
55
56
  step(`version: ${p.id} is ${p.version} in this CI copy only`);
56
57
  return pkg;
57
58
  };
58
- const npmStep = async (s, run, dir, pkg) => {
59
+ const npmStep = async (s, run, { dir, pkg, refusal }) => {
59
60
  if (pkg['private'] === true)
60
61
  return step('npm: private package, not published');
62
+ if (refusal)
63
+ return amber(`npm: ${refusal}`);
61
64
  const push = scoped(s.deps.exec(dir, PUBLISH_SECONDS), s.secrets);
62
65
  await publish(run, push, pkg, s.secrets['npm']?.['NPM_TOKEN']);
63
66
  };
@@ -72,16 +75,19 @@ const imagesStep = async (s, p, run, pkg) => {
72
75
  return built ? buildImages(dir, oneImage, s.deps.tool, committedBut(s)) : [];
73
76
  };
74
77
  // The record is the "released" marker: it goes up only after npm has the version.
75
- const releaseOne = async (s, p) => {
78
+ const releaseOne = async (s, p, row) => {
76
79
  const pkg = await prepare(s, p);
77
80
  const dir = join(s.root, p.rel);
78
81
  const run = scoped(s.deps.exec(dir, s.timeout), s.secrets);
79
82
  const isPrivate = pkg['private'] === true;
80
- if (!isPrivate)
83
+ const refusal = isPrivate ? undefined : await npmRefusal(run, s.repo, pkg);
84
+ if (refusal)
85
+ row.result = 'released, AMBER: npm skipped';
86
+ if (!isPrivate && !refusal)
81
87
  await npmVersion(run);
82
88
  await createTag(s, p.tag);
83
89
  const records = await imagesStep(s, p, run, pkg);
84
- await npmStep(s, run, dir, pkg);
90
+ await npmStep(s, run, { dir, pkg, refusal });
85
91
  if (records.length > 0)
86
92
  await attach(run, p.tag, s.repo, records, s.sha);
87
93
  return {
@@ -89,7 +95,7 @@ const releaseOne = async (s, p) => {
89
95
  version: p.version,
90
96
  tag: p.tag,
91
97
  built: records.length > 0,
92
- published: !isPrivate,
98
+ published: !isPrivate && !refusal,
93
99
  };
94
100
  };
95
101
  // Every changed extension is tried; its folder then no longer counts as a change for the next build.
@@ -98,7 +104,7 @@ const releaseAll = async (s, plan) => {
98
104
  const rows = rowsOf(plan.refused, 'refused');
99
105
  for (const p of plan.changed) {
100
106
  const row = { id: p.id, version: p.version, result: 'released' };
101
- await releaseOne(s, p).then((r) => void released.push(r), (err) => Object.assign(row, { result: 'failed', err }));
107
+ await releaseOne(s, p, row).then((r) => void released.push(r), (err) => Object.assign(row, { result: 'failed', err }));
102
108
  s.written.push(p.rel);
103
109
  rows.push(row);
104
110
  }
@@ -0,0 +1,17 @@
1
+ type Rule = {
2
+ re: RegExp;
3
+ keep: boolean;
4
+ };
5
+ export declare const DEFAULT_IGNORE: string[];
6
+ export declare const ALWAYS_COUNTS: string[];
7
+ export declare const IGNORE_FILE = ".release-ignore";
8
+ export declare const globToRegex: (glob: string) => RegExp;
9
+ export declare const parseIgnore: (text: string) => Rule[];
10
+ export declare const isIgnored: (rules: Rule[], path: string) => boolean;
11
+ export type Sorted = {
12
+ counted: string[];
13
+ ignored: string[];
14
+ };
15
+ export declare const sortChanged: (root: string, rel: string, diff: string) => Promise<Sorted>;
16
+ export declare const firstFive: (files: string[]) => string;
17
+ export {};
@@ -0,0 +1,73 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ // Anchored at the folder root: a deeper .md or docs/ may be served by the site or the image.
4
+ export const DEFAULT_IGNORE = [
5
+ '/*.md',
6
+ '/docs/**',
7
+ '/.github/**',
8
+ '/.repo-doctor.yml',
9
+ '/.gitignore',
10
+ '/.prettierrc*',
11
+ '/.editorconfig',
12
+ '/LICENSE',
13
+ ];
14
+ // What goes into the image always counts, whatever an ignore pattern says.
15
+ export const ALWAYS_COUNTS = ['/package.json', '/package-lock.json', '/src/**', '/Dockerfile*'];
16
+ export const IGNORE_FILE = '.release-ignore';
17
+ const TOKENS = {
18
+ '**/': '(?:.*/)?',
19
+ '/**': '(?:/.*)?',
20
+ '**': '.*',
21
+ '*': '[^/]*',
22
+ '?': '[^/]',
23
+ };
24
+ // Gitignore-style: a pattern with a slash is anchored to the folder, one without matches any depth.
25
+ export const globToRegex = (glob) => {
26
+ const bare = glob.replace(/\/$/, '');
27
+ const anchored = bare.includes('/');
28
+ const body = bare
29
+ .replace(/^\//, '')
30
+ .replace(/\*\*\/|\/\*\*|\*\*|\*|\?|[.+^${}()|[\]\\]/g, (t) => TOKENS[t] ?? `\\${t}`);
31
+ return new RegExp(`^${anchored ? '' : '(?:.*/)?'}${body}$`);
32
+ };
33
+ const ruleOf = (line) => {
34
+ const keep = line.startsWith('!');
35
+ return { re: globToRegex(keep ? line.slice(1) : line), keep };
36
+ };
37
+ export const parseIgnore = (text) => text
38
+ .split('\n')
39
+ .map((l) => l.trim())
40
+ .filter((l) => l !== '' && !l.startsWith('#'))
41
+ .map(ruleOf);
42
+ // The path and each folder above it: `docs` also matches `docs/a.md`.
43
+ const candidates = (path) => path.split('/').map((_, i, parts) => parts.slice(0, i + 1).join('/'));
44
+ const hits = (re, path) => candidates(path).some((p) => re.test(p));
45
+ // The last matching rule wins, as in .gitignore.
46
+ export const isIgnored = (rules, path) => {
47
+ if (ALWAYS_COUNTS.some((g) => hits(globToRegex(g), path)))
48
+ return false;
49
+ let ignored = false;
50
+ for (const rule of rules)
51
+ if (hits(rule.re, path))
52
+ ignored = !rule.keep;
53
+ return ignored;
54
+ };
55
+ const rulesAt = async (dir) => {
56
+ const text = await readFile(join(dir, IGNORE_FILE), 'utf8').catch(() => '');
57
+ return parseIgnore([...DEFAULT_IGNORE, text].join('\n'));
58
+ };
59
+ // `diff` names files from the repo root; the patterns read them from the extension folder.
60
+ export const sortChanged = async (root, rel, diff) => {
61
+ const rules = await rulesAt(join(root, rel));
62
+ const prefix = rel === '.' ? '' : `${rel}/`;
63
+ const files = diff.split('\0').filter(Boolean);
64
+ const local = files.map((f) => f.slice(prefix.length));
65
+ return {
66
+ counted: local.filter((f) => !isIgnored(rules, f)),
67
+ ignored: local.filter((f) => isIgnored(rules, f)),
68
+ };
69
+ };
70
+ export const firstFive = (files) => {
71
+ const more = files.length > 5 ? ` and ${files.length - 5} more` : '';
72
+ return `${files.slice(0, 5).join(', ')}${more}`;
73
+ };
@@ -0,0 +1,5 @@
1
+ import type { ExtensionPackage } from '@agentage/extension/tool';
2
+ import type { Exec } from './release-guard.js';
3
+ export declare const OPT_IN = "agentagePublishFromPrivateRepo";
4
+ export declare const amber: (line: string) => void;
5
+ export declare const npmRefusal: (run: Exec, repo: string, pkg: ExtensionPackage) => Promise<string | undefined>;
@@ -0,0 +1,22 @@
1
+ import { fail, step } from './release-steps.js';
2
+ // The kit refuses unknown keys under `agentage`: the opt-in is a top-level package.json key.
3
+ export const OPT_IN = 'agentagePublishFromPrivateRepo';
4
+ export const amber = (line) => console.log(`AMBER ${line}`);
5
+ const optedIn = (pkg) => {
6
+ const config = pkg['publishConfig'];
7
+ return config?.access === 'public' && pkg[OPT_IN] === true;
8
+ };
9
+ const howTo = `set publishConfig.access to "public" and ${OPT_IN} to true to publish it`;
10
+ // Only a repo GitHub names public, or an opt-in, goes to npm; no clear answer stops the release.
11
+ export const npmRefusal = async (run, repo, pkg) => {
12
+ const read = await run('gh', ['api', `repos/${repo}`, '--jq', '.private']);
13
+ const answer = read.out.trim();
14
+ if (read.ok && answer === 'false')
15
+ return undefined;
16
+ if (!read.ok || answer !== 'true')
17
+ fail(`npm: cannot read whether ${repo} is private (${read.err || answer || 'no answer'})`);
18
+ if (!optedIn(pkg))
19
+ return `${repo} is a private repo: npm skipped; ${howTo}`;
20
+ step(`npm: ${repo} is private, ${pkg.name} opts in to public npm`);
21
+ return undefined;
22
+ };
@@ -1,5 +1,6 @@
1
1
  import { dateVersion, lastTag, newestTags, tagOf } from './release-date.js';
2
2
  import { extensionFolders } from './release-folders.js';
3
+ import { firstFive, sortChanged } from './release-ignore.js';
3
4
  import { RECORD } from './release-guard.js';
4
5
  import { fail, step } from './release-steps.js';
5
6
  // A build that always fails stops here: no new tag after this many tags in a row with no record.
@@ -42,15 +43,21 @@ const unrecorded = async (c, f, tags) => {
42
43
  // From the last tag, not the push range: a run the concurrency group dropped is caught up here.
43
44
  const whyOf = async (c, f, tags, last) => {
44
45
  if (!last)
45
- return `has no ${f.id}@* tag yet`;
46
+ return { why: `has no ${f.id}@* tag yet`, ignored: [] };
46
47
  const missing = await unrecorded(c, f, tags);
47
- const diff = await git(c.run, ['diff', '--name-only', last, c.sha, '--', f.rel], 'changed');
48
- if (diff.trim())
49
- return `differs from ${last}`;
48
+ // No renames: a move from src/ to docs/ names the src/ path; -z keeps odd names exact.
49
+ const args = ['diff', '--name-only', '-z', '--no-renames', last, c.sha, '--', f.rel];
50
+ const { counted, ignored } = await sortChanged(c.root, f.rel, await git(c.run, args, 'changed'));
51
+ if (counted.length > 0)
52
+ return { why: `differs from ${last} in ${firstFive(counted)}`, ignored };
50
53
  // A release that failed after its tag: the next commit releases it with a new N.
51
54
  if (missing[0] === last)
52
- return `equals ${last}, which has no record`;
53
- return undefined;
55
+ return { why: `equals ${last}, which has no record`, ignored };
56
+ return { ignored };
57
+ };
58
+ const sameAs = (f, last, ignored) => {
59
+ const only = ignored.length > 0 ? `; only ignored files changed: ${firstFive(ignored)}` : '';
60
+ step(`unchanged: ${f.id} (${f.rel}) is the same as ${String(last)}${only}`);
54
61
  };
55
62
  // A re-run of an old commit must not give older code a higher version than its last tag.
56
63
  const inHistory = async (c, last, at) => {
@@ -72,10 +79,10 @@ const planOne = async (c, f) => {
72
79
  return planned(f, last.slice(f.id.length + 1), `${last} is on this commit: resume it`);
73
80
  if (last)
74
81
  await inHistory(c, last, at);
75
- const why = await whyOf(c, f, tags, last);
82
+ const { why, ignored } = await whyOf(c, f, tags, last);
76
83
  if (why)
77
84
  return planned(f, dateVersion(f.id, tags, c.now), why);
78
- step(`unchanged: ${f.id} (${f.rel}) is the same as ${String(last)}`);
85
+ sameAs(f, last, ignored);
79
86
  return undefined;
80
87
  };
81
88
  // One refused extension never stops the plan of the others.
@@ -55,6 +55,6 @@ export const addRelease = (group, release) => {
55
55
  .description('Release an extension from its v* tag in CI: guard, images, one image, records, npm package')
56
56
  .option('--dir <path>', 'the extension package folder (default: the current folder)')
57
57
  .option('--timeout <seconds>', 'bound on each git, GitHub and npm check (default: 60; npm publish: 300)', Number)
58
- .option('--changed', 'each extension (root or extensions/*) whose folder changed since its last <id>@* tag; each keeps its own package-lock.json, shared root files never trigger a release')
58
+ .option('--changed', 'each extension (root or extensions/*) whose folder changed since its last <id>@* tag; root docs/**, root *.md, .github/** and repo config (plus .release-ignore patterns) never trigger a release, package.json, the lock, src/** and Dockerfile* always do; a private repo skips npm unless the package opts in')
59
59
  .option('--dry-run', 'with --changed: print what it would release, change nothing')).action(release);
60
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/cli",
3
- "version": "0.71.0",
3
+ "version": "0.73.0",
4
4
  "description": "The agentage CLI - connect this machine to agentage from the terminal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",