anymorph 0.10.0 → 0.12.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.
Files changed (2) hide show
  1. package/dist/index.js +55 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11962,8 +11962,7 @@ var require_cms_frontmatter = __commonJS({
11962
11962
  slug: z.string().optional(),
11963
11963
  path: z.string().optional(),
11964
11964
  lang: z.string().optional(),
11965
- heroImage: z.string().optional(),
11966
- thumbnailImage: z.string().optional()
11965
+ heroImage: z.string().optional()
11967
11966
  }).passthrough();
11968
11967
  var CmsPageTypeSchema2 = z.enum([
11969
11968
  "product",
@@ -11985,7 +11984,6 @@ var require_cms_frontmatter = __commonJS({
11985
11984
  slug: z.string().min(1),
11986
11985
  lang: z.string().min(1),
11987
11986
  heroImage: z.string().min(1),
11988
- thumbnailImage: z.string().min(1).optional(),
11989
11987
  pageType: CmsPageTypeSchema2,
11990
11988
  pageRole: z.enum(["HUB", "SPOKE", "UNKNOWN"]),
11991
11989
  intentId: z.string().min(1).optional(),
@@ -12242,6 +12240,17 @@ var require_src = __commonJS({
12242
12240
  reason: "CTA renders title + description side-by-side with the button; missing description leaves the column empty."
12243
12241
  })
12244
12242
  });
12243
+ var CMS_RELATED_CONTENT_TITLE_BY_LANG2 = Object.freeze({
12244
+ en: "Related reading",
12245
+ ko: "\uD568\uAED8 \uC77D\uC73C\uBA74 \uC88B\uC740 \uAE00",
12246
+ ja: "\u95A2\u9023\u8A18\u4E8B",
12247
+ zh: "\u76F8\u5173\u9605\u8BFB",
12248
+ "zh-TW": "\u76F8\u95DC\u95B1\u8B80",
12249
+ th: "\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E17\u0E35\u0E48\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E02\u0E49\u0E2D\u0E07"
12250
+ });
12251
+ function getCmsRelatedContentTitle2(lang) {
12252
+ return CMS_RELATED_CONTENT_TITLE_BY_LANG2[lang] ?? CMS_RELATED_CONTENT_TITLE_BY_LANG2.en;
12253
+ }
12245
12254
  function validateCmsMdxComponentContracts2(mdx) {
12246
12255
  const issues = [];
12247
12256
  checkReservedComponents(mdx, issues);
@@ -12401,6 +12410,15 @@ var require_src = __commonJS({
12401
12410
  mode: CliGeoRunModeSchema2,
12402
12411
  signals: z.unknown(),
12403
12412
  systemContext: z.unknown(),
12413
+ brandAssets: z.object({
12414
+ hash: z.string().min(1),
12415
+ files: z.array(
12416
+ z.object({
12417
+ path: z.string().min(1),
12418
+ content: z.string()
12419
+ }).strict()
12420
+ ).default([])
12421
+ }).strict().optional(),
12404
12422
  schemaCatalog: z.string(),
12405
12423
  manifest: CliGeoRunManifestSchema2
12406
12424
  }).strict();
@@ -13451,7 +13469,9 @@ var require_src = __commonJS({
13451
13469
  normalizeCmsThemeTokens: cmsThemeTokens.normalizeCmsThemeTokens,
13452
13470
  validateCmsThemeTokens: cmsThemeTokens.validateCmsThemeTokens,
13453
13471
  CMS_MDX_COMPONENT_CONTRACTS: CMS_MDX_COMPONENT_CONTRACTS2,
13454
- validateCmsMdxComponentContracts: validateCmsMdxComponentContracts2
13472
+ validateCmsMdxComponentContracts: validateCmsMdxComponentContracts2,
13473
+ CMS_RELATED_CONTENT_TITLE_BY_LANG: CMS_RELATED_CONTENT_TITLE_BY_LANG2,
13474
+ getCmsRelatedContentTitle: getCmsRelatedContentTitle2
13455
13475
  };
13456
13476
  }
13457
13477
  });
@@ -22463,6 +22483,8 @@ var normalizeCmsThemeTokens = import_index2.default.normalizeCmsThemeTokens;
22463
22483
  var validateCmsThemeTokens = import_index2.default.validateCmsThemeTokens;
22464
22484
  var CMS_MDX_COMPONENT_CONTRACTS = import_index2.default.CMS_MDX_COMPONENT_CONTRACTS;
22465
22485
  var validateCmsMdxComponentContracts = import_index2.default.validateCmsMdxComponentContracts;
22486
+ var CMS_RELATED_CONTENT_TITLE_BY_LANG = import_index2.default.CMS_RELATED_CONTENT_TITLE_BY_LANG;
22487
+ var getCmsRelatedContentTitle = import_index2.default.getCmsRelatedContentTitle;
22466
22488
  var reasonTagSchema = import_index2.default.reasonTagSchema;
22467
22489
  var reasonClassSchema = import_index2.default.reasonClassSchema;
22468
22490
  var REASON_TAG_CLASS = import_index2.default.REASON_TAG_CLASS;
@@ -22477,7 +22499,7 @@ import { join as join6, relative as relative2, resolve as resolve3 } from "node:
22477
22499
 
22478
22500
  // src/geo/package-writer.ts
22479
22501
  import { mkdir, writeFile } from "node:fs/promises";
22480
- import { join as join2 } from "node:path";
22502
+ import { dirname, join as join2 } from "node:path";
22481
22503
  async function writeGeoRunPackage(input) {
22482
22504
  const runDir = join2(input.repoPath, "agent", "runs", input.package.runId);
22483
22505
  const agentDir = join2(input.repoPath, "agent");
@@ -22486,6 +22508,7 @@ async function writeGeoRunPackage(input) {
22486
22508
  const artifactPaths = allowedArtifactPaths(input.package.runId);
22487
22509
  await mkdir(runDir, { recursive: true });
22488
22510
  await mkdir(agentDir, { recursive: true });
22511
+ await writeBrandAssets(input.repoPath, input.package.brandAssets);
22489
22512
  await writeJson(join2(agentDir, "workspace.json"), buildWorkspaceMetadata(input.package));
22490
22513
  await writeJson(join2(runDir, "manifest.json"), {
22491
22514
  ...isRecord(input.package.manifest) ? input.package.manifest : {},
@@ -22537,6 +22560,19 @@ async function writeGeoRunPackage(input) {
22537
22560
  });
22538
22561
  return { runDir };
22539
22562
  }
22563
+ async function writeBrandAssets(repoPath, brandAssets) {
22564
+ if (!brandAssets?.files?.length) return;
22565
+ for (const file of brandAssets.files) {
22566
+ if (!isManagedBrandAssetPath(file.path)) continue;
22567
+ const target = join2(repoPath, file.path);
22568
+ await mkdir(dirname(target), { recursive: true });
22569
+ await writeFile(target, `${file.content.replace(/\s*$/, "")}
22570
+ `, "utf8");
22571
+ }
22572
+ }
22573
+ function isManagedBrandAssetPath(path2) {
22574
+ return path2 === "agent/BRAND.md" || path2 === "agent/BRAND_RULES.md" || /^agent\/BRAND_VOICE\.[a-z][a-z0-9-]*\.md$/i.test(path2);
22575
+ }
22540
22576
  function buildWorkspaceMetadata(pkg) {
22541
22577
  return {
22542
22578
  schemaVersion: 1,
@@ -22998,9 +23034,9 @@ var VFile = class {
22998
23034
  * @returns {undefined}
22999
23035
  * Nothing.
23000
23036
  */
23001
- set dirname(dirname2) {
23037
+ set dirname(dirname3) {
23002
23038
  assertPath(this.basename, "dirname");
23003
- this.path = default3.join(dirname2 || "", this.basename);
23039
+ this.path = default3.join(dirname3 || "", this.basename);
23004
23040
  }
23005
23041
  /**
23006
23042
  * Get the extname (including dot) (example: `'.js'`).
@@ -45409,7 +45445,7 @@ import {
45409
45445
  writeFile as writeFile2
45410
45446
  } from "node:fs/promises";
45411
45447
  import { homedir as homedir2 } from "node:os";
45412
- import { dirname, join as join4, relative, resolve as resolve2 } from "node:path";
45448
+ import { dirname as dirname2, join as join4, relative, resolve as resolve2 } from "node:path";
45413
45449
  import { fileURLToPath as fileURLToPath3 } from "node:url";
45414
45450
  import { promisify as promisify7 } from "node:util";
45415
45451
  var execFileAsync6 = promisify7(execFile7);
@@ -45500,7 +45536,7 @@ async function resolveSkillSourceDir(explicit) {
45500
45536
  );
45501
45537
  }
45502
45538
  async function resolveBundledSkillSourceDir(fromUrl = new URL(import.meta.url)) {
45503
- const moduleDir = dirname(fileURLToPath3(fromUrl));
45539
+ const moduleDir = dirname2(fileURLToPath3(fromUrl));
45504
45540
  const candidate = join4(moduleDir, BUNDLED_SKILLPACK_RELATIVE_PATH);
45505
45541
  if (await isDirectory(candidate)) return candidate;
45506
45542
  return null;
@@ -45543,7 +45579,7 @@ async function applyGeoScaffold(input, options) {
45543
45579
  }
45544
45580
  async function syncManagedDirectory(sourceDir, targetDir, changed) {
45545
45581
  await rm(targetDir, { recursive: true, force: true });
45546
- await mkdir3(dirname(targetDir), { recursive: true });
45582
+ await mkdir3(dirname2(targetDir), { recursive: true });
45547
45583
  await cp(sourceDir, targetDir, { recursive: true });
45548
45584
  changed.push(relative(process.cwd(), targetDir) || targetDir);
45549
45585
  }
@@ -45674,14 +45710,14 @@ async function listFiles(dir, base = "") {
45674
45710
  }
45675
45711
  async function writeIfMissing(path2, content3, changed) {
45676
45712
  if (await exists2(path2)) return;
45677
- await mkdir3(dirname(path2), { recursive: true });
45713
+ await mkdir3(dirname2(path2), { recursive: true });
45678
45714
  await writeFile2(path2, content3);
45679
45715
  changed.push(relative(process.cwd(), path2) || path2);
45680
45716
  }
45681
45717
  async function writeIfChanged(path2, content3, changed) {
45682
45718
  const current2 = await readFile(path2, "utf8").catch(() => null);
45683
45719
  if (current2 === content3) return;
45684
- await mkdir3(dirname(path2), { recursive: true });
45720
+ await mkdir3(dirname2(path2), { recursive: true });
45685
45721
  await writeFile2(path2, content3);
45686
45722
  changed.push(relative(process.cwd(), path2) || path2);
45687
45723
  }
@@ -45734,7 +45770,7 @@ async function downloadAuthenticatedSkillpack() {
45734
45770
  await mkdir3(cacheDir, { recursive: true });
45735
45771
  for (const file of payload.files) {
45736
45772
  const target = safeJoin(cacheDir, file.path);
45737
- await mkdir3(dirname(target), { recursive: true });
45773
+ await mkdir3(dirname2(target), { recursive: true });
45738
45774
  await writeFile2(target, file.content);
45739
45775
  }
45740
45776
  return join4(cacheDir, "skills");
@@ -45779,24 +45815,24 @@ function searchRoots() {
45779
45815
  let cwd = resolve2(process.cwd());
45780
45816
  for (; ; ) {
45781
45817
  roots.add(cwd);
45782
- const parent = dirname(cwd);
45818
+ const parent = dirname2(cwd);
45783
45819
  if (parent === cwd) break;
45784
45820
  cwd = parent;
45785
45821
  }
45786
- let here = dirname(fileURLToPath3(import.meta.url));
45822
+ let here = dirname2(fileURLToPath3(import.meta.url));
45787
45823
  for (; ; ) {
45788
45824
  roots.add(here);
45789
- const parent = dirname(here);
45825
+ const parent = dirname2(here);
45790
45826
  if (parent === here) break;
45791
45827
  here = parent;
45792
45828
  }
45793
45829
  return [...roots];
45794
45830
  }
45795
45831
  function rootScaffoldSourceDir(skillsSourceDir) {
45796
- return join4(dirname(skillsSourceDir), "scaffold");
45832
+ return join4(dirname2(skillsSourceDir), "scaffold");
45797
45833
  }
45798
45834
  function rootSharedSourceDir(skillsSourceDir) {
45799
- return join4(dirname(skillsSourceDir), "shared");
45835
+ return join4(dirname2(skillsSourceDir), "shared");
45800
45836
  }
45801
45837
  async function ensureDirectory(path2) {
45802
45838
  const s = await stat2(path2);
@@ -46683,7 +46719,7 @@ function printScaffoldError(prefix, err) {
46683
46719
 
46684
46720
  // src/index.ts
46685
46721
  var program2 = new Command();
46686
- program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.10.0");
46722
+ program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.12.0");
46687
46723
  program2.command("login").description("Sign in to your Anymorph account").addHelpText(
46688
46724
  "after",
46689
46725
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymorph",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Check your brand's AI visibility across ChatGPT, Perplexity, Gemini, and more",
5
5
  "type": "module",
6
6
  "private": false,