@rankcli/agent-runtime 0.0.28 → 0.0.29

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/dist/index.d.mts CHANGED
@@ -2988,6 +2988,14 @@ interface DeterministicFixInput {
2988
2988
  siteName: string;
2989
2989
  /** Monorepo app root, '' at the repository root. Every emitted path starts with it. */
2990
2990
  appRoot: string;
2991
+ /**
2992
+ * Where files served at the site root live, relative to appRoot. 'public/' for Vite, CRA
2993
+ * and most bundlers; '' for a static site that serves its directory as-is (GitHub Pages
2994
+ * from docs/), where a public/ subdirectory would simply never be served. Defaults to
2995
+ * 'public/' because that is the common case, but getting it wrong means committing a
2996
+ * robots.txt nobody can fetch.
2997
+ */
2998
+ publicDir?: string;
2991
2999
  /** Issue codes open on the audit; a fix is only offered for something actually reported. */
2992
3000
  issueCodes: Set<string> | string[];
2993
3001
  /** Current file contents, null when the file does not exist. */
package/dist/index.d.ts CHANGED
@@ -2988,6 +2988,14 @@ interface DeterministicFixInput {
2988
2988
  siteName: string;
2989
2989
  /** Monorepo app root, '' at the repository root. Every emitted path starts with it. */
2990
2990
  appRoot: string;
2991
+ /**
2992
+ * Where files served at the site root live, relative to appRoot. 'public/' for Vite, CRA
2993
+ * and most bundlers; '' for a static site that serves its directory as-is (GitHub Pages
2994
+ * from docs/), where a public/ subdirectory would simply never be served. Defaults to
2995
+ * 'public/' because that is the common case, but getting it wrong means committing a
2996
+ * robots.txt nobody can fetch.
2997
+ */
2998
+ publicDir?: string;
2991
2999
  /** Issue codes open on the audit; a fix is only offered for something actually reported. */
2992
3000
  issueCodes: Set<string> | string[];
2993
3001
  /** Current file contents, null when the file does not exist. */
package/dist/index.js CHANGED
@@ -32956,6 +32956,8 @@ function buildDeterministicFixes(input) {
32956
32956
  const codes = new Set(input.issueCodes);
32957
32957
  const has = (...wanted) => wanted.some((code) => codes.has(code));
32958
32958
  const root = input.appRoot || "";
32959
+ const publicDir = input.publicDir === void 0 ? "public/" : input.publicDir.replace(/\/?$/, input.publicDir ? "/" : "");
32960
+ const served = `${root}${publicDir}`;
32959
32961
  const files = [];
32960
32962
  const addressed = [];
32961
32963
  const base = input.siteUrl.replace(/\/$/, "");
@@ -32963,7 +32965,7 @@ function buildDeterministicFixes(input) {
32963
32965
  const description = input.description ?? metaDescriptionOf(input.existing.indexHtml);
32964
32966
  if (has("ROBOTS_TXT_MISSING", "AI_BOTS_BLOCKED", "AI_CRAWLERS_BLOCKED") && !input.existing.robotsTxt) {
32965
32967
  files.push({
32966
- path: `${root}public/robots.txt`,
32968
+ path: `${served}robots.txt`,
32967
32969
  content: generateAIFriendlyRobotsTxt(base),
32968
32970
  message: "fix(seo): add robots.txt allowing search and AI crawlers",
32969
32971
  action: "created"
@@ -32972,7 +32974,7 @@ function buildDeterministicFixes(input) {
32972
32974
  }
32973
32975
  if (has("SITEMAP_MISSING") && !input.existing.sitemapXml) {
32974
32976
  files.push({
32975
- path: `${root}public/sitemap.xml`,
32977
+ path: `${served}sitemap.xml`,
32976
32978
  content: sitemap(pages),
32977
32979
  message: "fix(seo): add sitemap.xml",
32978
32980
  action: "created"
@@ -32981,7 +32983,7 @@ function buildDeterministicFixes(input) {
32981
32983
  }
32982
32984
  if (has("LLMS_TXT_MISSING") && !input.existing.llmsTxt) {
32983
32985
  files.push({
32984
- path: `${root}public/llms.txt`,
32986
+ path: `${served}llms.txt`,
32985
32987
  content: llmsTxt(input.siteName, base, description, pages),
32986
32988
  message: "fix(seo): add llms.txt for AI assistants",
32987
32989
  action: "created"
@@ -33035,6 +33037,12 @@ function findAppRoot(files) {
33035
33037
  const best = candidates[0];
33036
33038
  return best === "" ? "" : `${best}/`;
33037
33039
  }
33040
+ const PAGES_MARKERS = ["CNAME", ".nojekyll", "404.html", "site.webmanifest"];
33041
+ const staticRoots = real.filter((f) => f === "index.html" || f.endsWith("/index.html")).map(directoryOf).filter((dir) => PAGES_MARKERS.some((marker) => real.includes(dir ? `${dir}/${marker}` : marker)));
33042
+ if (staticRoots.length > 0) {
33043
+ staticRoots.sort((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b));
33044
+ return staticRoots[0] === "" ? "" : `${staticRoots[0]}/`;
33045
+ }
33038
33046
  const nonRoot = [...packageDirs].filter((dir) => dir !== "");
33039
33047
  if (packageDirs.has("") || nonRoot.length === 0) return "";
33040
33048
  nonRoot.sort((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b));
package/dist/index.mjs CHANGED
@@ -29388,6 +29388,8 @@ function buildDeterministicFixes(input) {
29388
29388
  const codes = new Set(input.issueCodes);
29389
29389
  const has = (...wanted) => wanted.some((code) => codes.has(code));
29390
29390
  const root = input.appRoot || "";
29391
+ const publicDir = input.publicDir === void 0 ? "public/" : input.publicDir.replace(/\/?$/, input.publicDir ? "/" : "");
29392
+ const served = `${root}${publicDir}`;
29391
29393
  const files = [];
29392
29394
  const addressed = [];
29393
29395
  const base = input.siteUrl.replace(/\/$/, "");
@@ -29395,7 +29397,7 @@ function buildDeterministicFixes(input) {
29395
29397
  const description = input.description ?? metaDescriptionOf(input.existing.indexHtml);
29396
29398
  if (has("ROBOTS_TXT_MISSING", "AI_BOTS_BLOCKED", "AI_CRAWLERS_BLOCKED") && !input.existing.robotsTxt) {
29397
29399
  files.push({
29398
- path: `${root}public/robots.txt`,
29400
+ path: `${served}robots.txt`,
29399
29401
  content: generateAIFriendlyRobotsTxt(base),
29400
29402
  message: "fix(seo): add robots.txt allowing search and AI crawlers",
29401
29403
  action: "created"
@@ -29404,7 +29406,7 @@ function buildDeterministicFixes(input) {
29404
29406
  }
29405
29407
  if (has("SITEMAP_MISSING") && !input.existing.sitemapXml) {
29406
29408
  files.push({
29407
- path: `${root}public/sitemap.xml`,
29409
+ path: `${served}sitemap.xml`,
29408
29410
  content: sitemap(pages),
29409
29411
  message: "fix(seo): add sitemap.xml",
29410
29412
  action: "created"
@@ -29413,7 +29415,7 @@ function buildDeterministicFixes(input) {
29413
29415
  }
29414
29416
  if (has("LLMS_TXT_MISSING") && !input.existing.llmsTxt) {
29415
29417
  files.push({
29416
- path: `${root}public/llms.txt`,
29418
+ path: `${served}llms.txt`,
29417
29419
  content: llmsTxt(input.siteName, base, description, pages),
29418
29420
  message: "fix(seo): add llms.txt for AI assistants",
29419
29421
  action: "created"
@@ -29467,6 +29469,12 @@ function findAppRoot(files) {
29467
29469
  const best = candidates[0];
29468
29470
  return best === "" ? "" : `${best}/`;
29469
29471
  }
29472
+ const PAGES_MARKERS = ["CNAME", ".nojekyll", "404.html", "site.webmanifest"];
29473
+ const staticRoots = real.filter((f) => f === "index.html" || f.endsWith("/index.html")).map(directoryOf).filter((dir) => PAGES_MARKERS.some((marker) => real.includes(dir ? `${dir}/${marker}` : marker)));
29474
+ if (staticRoots.length > 0) {
29475
+ staticRoots.sort((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b));
29476
+ return staticRoots[0] === "" ? "" : `${staticRoots[0]}/`;
29477
+ }
29470
29478
  const nonRoot = [...packageDirs].filter((dir) => dir !== "");
29471
29479
  if (packageDirs.has("") || nonRoot.length === 0) return "";
29472
29480
  nonRoot.sort((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rankcli/agent-runtime",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "RankCLI agent runtime - executes SEO audits and fixes with AI",
5
5
  "homepage": "https://rankcli.dev",
6
6
  "main": "dist/index.js",