anymorph 0.11.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 +39 -18
  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(),
@@ -12412,6 +12410,15 @@ var require_src = __commonJS({
12412
12410
  mode: CliGeoRunModeSchema2,
12413
12411
  signals: z.unknown(),
12414
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(),
12415
12422
  schemaCatalog: z.string(),
12416
12423
  manifest: CliGeoRunManifestSchema2
12417
12424
  }).strict();
@@ -22492,7 +22499,7 @@ import { join as join6, relative as relative2, resolve as resolve3 } from "node:
22492
22499
 
22493
22500
  // src/geo/package-writer.ts
22494
22501
  import { mkdir, writeFile } from "node:fs/promises";
22495
- import { join as join2 } from "node:path";
22502
+ import { dirname, join as join2 } from "node:path";
22496
22503
  async function writeGeoRunPackage(input) {
22497
22504
  const runDir = join2(input.repoPath, "agent", "runs", input.package.runId);
22498
22505
  const agentDir = join2(input.repoPath, "agent");
@@ -22501,6 +22508,7 @@ async function writeGeoRunPackage(input) {
22501
22508
  const artifactPaths = allowedArtifactPaths(input.package.runId);
22502
22509
  await mkdir(runDir, { recursive: true });
22503
22510
  await mkdir(agentDir, { recursive: true });
22511
+ await writeBrandAssets(input.repoPath, input.package.brandAssets);
22504
22512
  await writeJson(join2(agentDir, "workspace.json"), buildWorkspaceMetadata(input.package));
22505
22513
  await writeJson(join2(runDir, "manifest.json"), {
22506
22514
  ...isRecord(input.package.manifest) ? input.package.manifest : {},
@@ -22552,6 +22560,19 @@ async function writeGeoRunPackage(input) {
22552
22560
  });
22553
22561
  return { runDir };
22554
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
+ }
22555
22576
  function buildWorkspaceMetadata(pkg) {
22556
22577
  return {
22557
22578
  schemaVersion: 1,
@@ -23013,9 +23034,9 @@ var VFile = class {
23013
23034
  * @returns {undefined}
23014
23035
  * Nothing.
23015
23036
  */
23016
- set dirname(dirname2) {
23037
+ set dirname(dirname3) {
23017
23038
  assertPath(this.basename, "dirname");
23018
- this.path = default3.join(dirname2 || "", this.basename);
23039
+ this.path = default3.join(dirname3 || "", this.basename);
23019
23040
  }
23020
23041
  /**
23021
23042
  * Get the extname (including dot) (example: `'.js'`).
@@ -45424,7 +45445,7 @@ import {
45424
45445
  writeFile as writeFile2
45425
45446
  } from "node:fs/promises";
45426
45447
  import { homedir as homedir2 } from "node:os";
45427
- 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";
45428
45449
  import { fileURLToPath as fileURLToPath3 } from "node:url";
45429
45450
  import { promisify as promisify7 } from "node:util";
45430
45451
  var execFileAsync6 = promisify7(execFile7);
@@ -45515,7 +45536,7 @@ async function resolveSkillSourceDir(explicit) {
45515
45536
  );
45516
45537
  }
45517
45538
  async function resolveBundledSkillSourceDir(fromUrl = new URL(import.meta.url)) {
45518
- const moduleDir = dirname(fileURLToPath3(fromUrl));
45539
+ const moduleDir = dirname2(fileURLToPath3(fromUrl));
45519
45540
  const candidate = join4(moduleDir, BUNDLED_SKILLPACK_RELATIVE_PATH);
45520
45541
  if (await isDirectory(candidate)) return candidate;
45521
45542
  return null;
@@ -45558,7 +45579,7 @@ async function applyGeoScaffold(input, options) {
45558
45579
  }
45559
45580
  async function syncManagedDirectory(sourceDir, targetDir, changed) {
45560
45581
  await rm(targetDir, { recursive: true, force: true });
45561
- await mkdir3(dirname(targetDir), { recursive: true });
45582
+ await mkdir3(dirname2(targetDir), { recursive: true });
45562
45583
  await cp(sourceDir, targetDir, { recursive: true });
45563
45584
  changed.push(relative(process.cwd(), targetDir) || targetDir);
45564
45585
  }
@@ -45689,14 +45710,14 @@ async function listFiles(dir, base = "") {
45689
45710
  }
45690
45711
  async function writeIfMissing(path2, content3, changed) {
45691
45712
  if (await exists2(path2)) return;
45692
- await mkdir3(dirname(path2), { recursive: true });
45713
+ await mkdir3(dirname2(path2), { recursive: true });
45693
45714
  await writeFile2(path2, content3);
45694
45715
  changed.push(relative(process.cwd(), path2) || path2);
45695
45716
  }
45696
45717
  async function writeIfChanged(path2, content3, changed) {
45697
45718
  const current2 = await readFile(path2, "utf8").catch(() => null);
45698
45719
  if (current2 === content3) return;
45699
- await mkdir3(dirname(path2), { recursive: true });
45720
+ await mkdir3(dirname2(path2), { recursive: true });
45700
45721
  await writeFile2(path2, content3);
45701
45722
  changed.push(relative(process.cwd(), path2) || path2);
45702
45723
  }
@@ -45749,7 +45770,7 @@ async function downloadAuthenticatedSkillpack() {
45749
45770
  await mkdir3(cacheDir, { recursive: true });
45750
45771
  for (const file of payload.files) {
45751
45772
  const target = safeJoin(cacheDir, file.path);
45752
- await mkdir3(dirname(target), { recursive: true });
45773
+ await mkdir3(dirname2(target), { recursive: true });
45753
45774
  await writeFile2(target, file.content);
45754
45775
  }
45755
45776
  return join4(cacheDir, "skills");
@@ -45794,24 +45815,24 @@ function searchRoots() {
45794
45815
  let cwd = resolve2(process.cwd());
45795
45816
  for (; ; ) {
45796
45817
  roots.add(cwd);
45797
- const parent = dirname(cwd);
45818
+ const parent = dirname2(cwd);
45798
45819
  if (parent === cwd) break;
45799
45820
  cwd = parent;
45800
45821
  }
45801
- let here = dirname(fileURLToPath3(import.meta.url));
45822
+ let here = dirname2(fileURLToPath3(import.meta.url));
45802
45823
  for (; ; ) {
45803
45824
  roots.add(here);
45804
- const parent = dirname(here);
45825
+ const parent = dirname2(here);
45805
45826
  if (parent === here) break;
45806
45827
  here = parent;
45807
45828
  }
45808
45829
  return [...roots];
45809
45830
  }
45810
45831
  function rootScaffoldSourceDir(skillsSourceDir) {
45811
- return join4(dirname(skillsSourceDir), "scaffold");
45832
+ return join4(dirname2(skillsSourceDir), "scaffold");
45812
45833
  }
45813
45834
  function rootSharedSourceDir(skillsSourceDir) {
45814
- return join4(dirname(skillsSourceDir), "shared");
45835
+ return join4(dirname2(skillsSourceDir), "shared");
45815
45836
  }
45816
45837
  async function ensureDirectory(path2) {
45817
45838
  const s = await stat2(path2);
@@ -46698,7 +46719,7 @@ function printScaffoldError(prefix, err) {
46698
46719
 
46699
46720
  // src/index.ts
46700
46721
  var program2 = new Command();
46701
- program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.11.0");
46722
+ program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.12.0");
46702
46723
  program2.command("login").description("Sign in to your Anymorph account").addHelpText(
46703
46724
  "after",
46704
46725
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymorph",
3
- "version": "0.11.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,