@mhmdreza-rafiei/agentry 0.3.1 → 0.3.2

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.
@@ -7,7 +7,7 @@ import http from "node:http";
7
7
  function fetchUrl(url, maxRedirects = 5) {
8
8
  return new Promise((resolve, reject) => {
9
9
  const req = (url.startsWith("https://") ? https : http).get(url, { headers: {
10
- "User-Agent": "agentry/0.3.1 (+https://github.com/mhmdreza-rafiei/agentry)",
10
+ "User-Agent": "agentry/0.3.2 (+https://github.com/mhmdreza-rafiei/agentry)",
11
11
  Accept: "text/html,application/xhtml+xml,text/plain,text/markdown,application/json,*/*"
12
12
  } }, (res) => {
13
13
  if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
package/dist/cli.mjs CHANGED
@@ -16,7 +16,7 @@ import { determineAgent } from "@vercel/detect-agent";
16
16
  import { stripVTControlCharacters } from "node:util";
17
17
  import { Writable } from "node:stream";
18
18
  var name = "@mhmdreza-rafiei/agentry";
19
- var version = "0.3.1";
19
+ var version = "0.3.2";
20
20
  const ARTIFACT_KINDS = [
21
21
  "skill",
22
22
  "rule",
@@ -1499,6 +1499,24 @@ async function selectAgents(message, universal, others, detectedNames = []) {
1499
1499
  for (const u of universal) if (!out.some((a) => a.name === u.name)) out.unshift(u);
1500
1500
  return out;
1501
1501
  }
1502
+ function showFoundArtifacts(artifacts, title = artifacts.length === 1 ? "Found artifact" : `Found ${artifacts.length} artifacts`) {
1503
+ blank();
1504
+ const bar = c.dim("│");
1505
+ const corner = c.dim("└");
1506
+ log(`${sky("◆")} ${c.bold(title)}`);
1507
+ log(bar);
1508
+ const maxItems = 12;
1509
+ const shown = artifacts.slice(0, maxItems);
1510
+ for (const a of shown) {
1511
+ const desc = (a.description || "").replace(/\s+/g, " ").trim().slice(0, 56);
1512
+ log(`${bar} ${sky("•")} ${c.bold(`${a.kind}/${a.id}`)}`);
1513
+ if (desc) log(`${bar} ${c.dim(desc)}`);
1514
+ }
1515
+ if (artifacts.length > maxItems) log(`${bar} ${c.dim(`… +${artifacts.length - maxItems} more artifacts`)}`);
1516
+ log(bar);
1517
+ log(`${corner} ${c.dim(`${artifacts.length} artifact${artifacts.length === 1 ? "" : "s"} ready`)}`);
1518
+ blank();
1519
+ }
1502
1520
  function installSummary(artifacts, agents, scopeLabel) {
1503
1521
  blank();
1504
1522
  const bar = c.dim("│");
@@ -1526,9 +1544,8 @@ function installSummary(artifacts, agents, scopeLabel) {
1526
1544
  log(`${bar} ${c.bold("Artifacts")} ${artifacts.length} selected`);
1527
1545
  log(bar);
1528
1546
  for (const a of artifacts) {
1529
- const desc = (a.description || "").replace(/\s+/g, " ").trim().slice(0, 52);
1547
+ (a.description || "").replace(/\s+/g, " ").trim().slice(0, 52);
1530
1548
  log(`${bar} ${sky("•")} ${c.bold(`${a.kind}/${a.id}`)}`);
1531
- if (desc) log(`${bar} ${c.dim(desc)}`);
1532
1549
  }
1533
1550
  log(bar);
1534
1551
  log(`${corner} ${c.dim("Review before use — artifacts run with full agent permissions.")}`);
@@ -1571,8 +1588,9 @@ async function cmdAdd(kind, source, selector, opts) {
1571
1588
  }
1572
1589
  await delayQuiet(320);
1573
1590
  blank();
1591
+ showFoundArtifacts(artifacts);
1574
1592
  if (opts.dryRun) {
1575
- preview(artifacts, await resolveAgentList(opts, "install"));
1593
+ preview(artifacts, await resolveAgentList(opts, "install", true));
1576
1594
  return;
1577
1595
  }
1578
1596
  let chosen = artifacts;
@@ -1615,8 +1633,6 @@ async function cmdAddProfile(name, source, opts) {
1615
1633
  const { file, profile } = loadProfile(name);
1616
1634
  const repo = source || (profile.artifacts.skills[0]?.source ?? profile.artifacts.rules[0]?.source);
1617
1635
  if (!repo) throw new Error(`No source given and ${file} lists none. Try: agentry add profile ${name} author/repo`);
1618
- const agentList = await resolveAgentList(opts, "install");
1619
- if (!await ensureInstallScope(opts, "install")) return;
1620
1636
  const { root, cleanup } = await resolveSourceWithUi(repo, opts);
1621
1637
  try {
1622
1638
  const artifacts = [];
@@ -1633,16 +1649,19 @@ async function cmdAddProfile(name, source, opts) {
1633
1649
  if (ref.source) src.cleanup();
1634
1650
  }
1635
1651
  }
1652
+ showFoundArtifacts(artifacts, `Profile: ${name}`);
1636
1653
  if (opts.dryRun) {
1637
- preview(artifacts, agentList);
1654
+ preview(artifacts, await resolveAgentList(opts, "install", true));
1638
1655
  return;
1639
1656
  }
1657
+ const agentList = await resolveAgentList(opts, "install");
1658
+ if (!await ensureInstallScope(opts, "install")) return;
1640
1659
  installAll(artifacts, opts, agentList, repo);
1641
1660
  } finally {
1642
1661
  cleanup();
1643
1662
  }
1644
1663
  }
1645
- async function resolveAgentList(opts, action = "install") {
1664
+ async function resolveAgentList(opts, action = "install", nonInteractive = false) {
1646
1665
  if (opts.all) return listAgents();
1647
1666
  if (opts.agents.length) {
1648
1667
  const { agents, unknown } = resolveAgents(opts.agents);
@@ -1654,7 +1673,7 @@ async function resolveAgentList(opts, action = "install") {
1654
1673
  const visibleUniversal = getVisibleUniversalAgents();
1655
1674
  const others = getNonUniversalAgents();
1656
1675
  const detectedOthers = detected.filter((n) => others.some((o) => o.name === n));
1657
- if (isQuiet() || opts.yes) {
1676
+ if (isQuiet() || opts.yes || nonInteractive) {
1658
1677
  const picked = detectedOthers.length ? detectedOthers : ["cursor"];
1659
1678
  return [...universal, ...others.filter((o) => picked.includes(o.name))];
1660
1679
  }
@@ -1879,6 +1898,7 @@ async function cmdUpdateAssets(kind, arg1, arg2, opts) {
1879
1898
  warn(`Nothing found in ${source}.`);
1880
1899
  return;
1881
1900
  }
1901
+ showFoundArtifacts(artifacts, "Found artifacts to update");
1882
1902
  let chosen = artifacts;
1883
1903
  if (!selector && artifacts.length > 1 && !opts.all && !opts.yes && !isQuiet()) {
1884
1904
  const noun = kind === "all" ? "artifacts" : `${kind}s`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhmdreza-rafiei/agentry",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "One CLI to install agents, skills, rules, and profiles onto AI coding agents — portable AI/agent tooling.",
5
5
  "type": "module",
6
6
  "bin": {