anymorph 0.14.0 → 0.16.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.
- package/dist/index.js +158 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12211,22 +12211,120 @@ var require_cms_theme_tokens = __commonJS({
|
|
|
12211
12211
|
}
|
|
12212
12212
|
});
|
|
12213
12213
|
|
|
12214
|
+
// node_modules/.pnpm/@anymorph+shared-contracts@file+..+shared-contracts/node_modules/@anymorph/shared-contracts/src/geo-agent-runner.cjs
|
|
12215
|
+
var require_geo_agent_runner = __commonJS({
|
|
12216
|
+
"node_modules/.pnpm/@anymorph+shared-contracts@file+..+shared-contracts/node_modules/@anymorph/shared-contracts/src/geo-agent-runner.cjs"(exports, module) {
|
|
12217
|
+
var yaml = require_js_yaml();
|
|
12218
|
+
var { z } = require_zod();
|
|
12219
|
+
var GeoAgentExecutorRuntimeSchema2 = z.enum(["fake", "claude", "codex", "cline"]);
|
|
12220
|
+
var GeoAgentExecutorProviderSchema2 = z.enum(["anthropic", "openai", "openrouter", "custom"]);
|
|
12221
|
+
var GeoAgentSubmitModeSchema2 = z.enum(["dry_run", "commit_only", "pull_request"]);
|
|
12222
|
+
var GeoAgentJobStatusSchema2 = z.enum([
|
|
12223
|
+
"queued",
|
|
12224
|
+
"claimed",
|
|
12225
|
+
"preparing",
|
|
12226
|
+
"running",
|
|
12227
|
+
"validating",
|
|
12228
|
+
"pr_opened",
|
|
12229
|
+
"commit_pushed",
|
|
12230
|
+
"dry_run_succeeded",
|
|
12231
|
+
"failed",
|
|
12232
|
+
"cancelled",
|
|
12233
|
+
"stale"
|
|
12234
|
+
]);
|
|
12235
|
+
var GeoAgentMinMaxSchema2 = z.object({
|
|
12236
|
+
min: z.number().int().nonnegative(),
|
|
12237
|
+
max: z.number().int().nonnegative()
|
|
12238
|
+
}).strict().refine((value) => value.min <= value.max, {
|
|
12239
|
+
message: "min must be less than or equal to max"
|
|
12240
|
+
});
|
|
12241
|
+
var GeoAgentExecutorSchema2 = z.object({
|
|
12242
|
+
runtime: GeoAgentExecutorRuntimeSchema2,
|
|
12243
|
+
provider: GeoAgentExecutorProviderSchema2,
|
|
12244
|
+
model: z.string().trim().min(1).optional(),
|
|
12245
|
+
timeoutMinutes: GeoAgentMinMaxSchema2
|
|
12246
|
+
}).strict();
|
|
12247
|
+
var GeoAgentLimitsSchema2 = z.object({
|
|
12248
|
+
brandOwned: GeoAgentMinMaxSchema2,
|
|
12249
|
+
geoPages: GeoAgentMinMaxSchema2,
|
|
12250
|
+
thirdParty: GeoAgentMinMaxSchema2
|
|
12251
|
+
}).strict();
|
|
12252
|
+
var GeoAgentGitSchema2 = z.object({
|
|
12253
|
+
baseBranch: z.string().trim().min(1).default("main"),
|
|
12254
|
+
branchPrefix: z.string().trim().min(1).default("geo-agent"),
|
|
12255
|
+
submit: z.object({
|
|
12256
|
+
mode: GeoAgentSubmitModeSchema2.default("dry_run")
|
|
12257
|
+
}).strict()
|
|
12258
|
+
}).strict();
|
|
12259
|
+
var GeoAgentArtifactsSchema2 = z.object({
|
|
12260
|
+
requireMdx: z.boolean().default(true),
|
|
12261
|
+
requireActionsJson: z.boolean().default(true),
|
|
12262
|
+
runRoot: z.string().trim().min(1).default("agent/runs")
|
|
12263
|
+
}).strict();
|
|
12264
|
+
var GeoAgentJobSpecSchema2 = z.object({
|
|
12265
|
+
version: z.literal(1),
|
|
12266
|
+
tenant: z.string().trim().min(1),
|
|
12267
|
+
runName: z.string().trim().min(1).optional(),
|
|
12268
|
+
executor: GeoAgentExecutorSchema2,
|
|
12269
|
+
limits: GeoAgentLimitsSchema2,
|
|
12270
|
+
git: GeoAgentGitSchema2,
|
|
12271
|
+
artifacts: GeoAgentArtifactsSchema2
|
|
12272
|
+
}).strict().superRefine((spec, ctx) => {
|
|
12273
|
+
if (spec.limits.geoPages.min > 0 && !spec.artifacts.requireMdx) {
|
|
12274
|
+
ctx.addIssue({
|
|
12275
|
+
code: z.ZodIssueCode.custom,
|
|
12276
|
+
path: ["artifacts", "requireMdx"],
|
|
12277
|
+
message: "geoPages.min > 0 requires artifacts.requireMdx=true"
|
|
12278
|
+
});
|
|
12279
|
+
}
|
|
12280
|
+
});
|
|
12281
|
+
var GeoAgentJobEventSchema2 = z.object({
|
|
12282
|
+
level: z.enum(["debug", "info", "warn", "error"]),
|
|
12283
|
+
source: z.string().trim().min(1),
|
|
12284
|
+
stepId: z.string().trim().min(1).optional(),
|
|
12285
|
+
eventType: z.string().trim().min(1),
|
|
12286
|
+
message: z.string().optional(),
|
|
12287
|
+
data: z.record(z.string(), z.unknown()).optional(),
|
|
12288
|
+
ts: z.string().datetime().optional()
|
|
12289
|
+
}).strict();
|
|
12290
|
+
var GeoAgentJobArtifactSchema2 = z.object({
|
|
12291
|
+
kind: z.string().trim().min(1),
|
|
12292
|
+
path: z.string().trim().min(1),
|
|
12293
|
+
sha256: z.string().trim().min(1).optional(),
|
|
12294
|
+
sizeBytes: z.number().int().nonnegative().optional(),
|
|
12295
|
+
data: z.record(z.string(), z.unknown()).optional()
|
|
12296
|
+
}).strict();
|
|
12297
|
+
function parseGeoAgentJobSpecYaml2(yamlText) {
|
|
12298
|
+
const parsed = yaml.load(yamlText);
|
|
12299
|
+
return GeoAgentJobSpecSchema2.parse(parsed);
|
|
12300
|
+
}
|
|
12301
|
+
module.exports = {
|
|
12302
|
+
GeoAgentExecutorRuntimeSchema: GeoAgentExecutorRuntimeSchema2,
|
|
12303
|
+
GeoAgentExecutorProviderSchema: GeoAgentExecutorProviderSchema2,
|
|
12304
|
+
GeoAgentSubmitModeSchema: GeoAgentSubmitModeSchema2,
|
|
12305
|
+
GeoAgentJobStatusSchema: GeoAgentJobStatusSchema2,
|
|
12306
|
+
GeoAgentMinMaxSchema: GeoAgentMinMaxSchema2,
|
|
12307
|
+
GeoAgentExecutorSchema: GeoAgentExecutorSchema2,
|
|
12308
|
+
GeoAgentLimitsSchema: GeoAgentLimitsSchema2,
|
|
12309
|
+
GeoAgentGitSchema: GeoAgentGitSchema2,
|
|
12310
|
+
GeoAgentArtifactsSchema: GeoAgentArtifactsSchema2,
|
|
12311
|
+
GeoAgentJobSpecSchema: GeoAgentJobSpecSchema2,
|
|
12312
|
+
GeoAgentJobEventSchema: GeoAgentJobEventSchema2,
|
|
12313
|
+
GeoAgentJobArtifactSchema: GeoAgentJobArtifactSchema2,
|
|
12314
|
+
parseGeoAgentJobSpecYaml: parseGeoAgentJobSpecYaml2
|
|
12315
|
+
};
|
|
12316
|
+
}
|
|
12317
|
+
});
|
|
12318
|
+
|
|
12214
12319
|
// node_modules/.pnpm/@anymorph+shared-contracts@file+..+shared-contracts/node_modules/@anymorph/shared-contracts/src/index.cjs
|
|
12215
12320
|
var require_src = __commonJS({
|
|
12216
12321
|
"node_modules/.pnpm/@anymorph+shared-contracts@file+..+shared-contracts/node_modules/@anymorph/shared-contracts/src/index.cjs"(exports, module) {
|
|
12217
12322
|
var { z } = require_zod();
|
|
12218
12323
|
var cmsFrontmatter = require_cms_frontmatter();
|
|
12219
12324
|
var cmsThemeTokens = require_cms_theme_tokens();
|
|
12325
|
+
var geoAgentRunner = require_geo_agent_runner();
|
|
12220
12326
|
var HOSTNAME_LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;
|
|
12221
12327
|
var CMS_MDX_COMPONENT_CONTRACTS2 = Object.freeze({
|
|
12222
|
-
ArticleHeader: Object.freeze({
|
|
12223
|
-
reserved: true,
|
|
12224
|
-
reason: "ArticleHeader is renderer-owned and must be derived from frontmatter/meta, not authored in MDX."
|
|
12225
|
-
}),
|
|
12226
|
-
RelatedContent: Object.freeze({
|
|
12227
|
-
reserved: true,
|
|
12228
|
-
reason: "RelatedContent is backend-owned and must be derived from related page data, not authored in MDX."
|
|
12229
|
-
}),
|
|
12230
12328
|
Callout: Object.freeze({
|
|
12231
12329
|
props: Object.freeze({
|
|
12232
12330
|
tone: Object.freeze({
|
|
@@ -12253,22 +12351,10 @@ var require_src = __commonJS({
|
|
|
12253
12351
|
}
|
|
12254
12352
|
function validateCmsMdxComponentContracts2(mdx) {
|
|
12255
12353
|
const issues = [];
|
|
12256
|
-
checkReservedComponents(mdx, issues);
|
|
12257
12354
|
checkRequiredComponentProps(mdx, issues);
|
|
12258
12355
|
checkEnumComponentProps(mdx, issues);
|
|
12259
12356
|
return issues;
|
|
12260
12357
|
}
|
|
12261
|
-
function checkReservedComponents(mdx, issues) {
|
|
12262
|
-
for (const [component, contract] of Object.entries(CMS_MDX_COMPONENT_CONTRACTS2)) {
|
|
12263
|
-
if (!contract.reserved) continue;
|
|
12264
|
-
if (!findComponentAttrs(mdx, component).length) continue;
|
|
12265
|
-
issues.push({
|
|
12266
|
-
code: "reserved_component",
|
|
12267
|
-
component,
|
|
12268
|
-
message: `<${component}> is renderer/backend-owned and must not be authored in MDX. ${contract.reason ?? ""}`.trim()
|
|
12269
|
-
});
|
|
12270
|
-
}
|
|
12271
|
-
}
|
|
12272
12358
|
function checkRequiredComponentProps(mdx, issues) {
|
|
12273
12359
|
for (const [component, contract] of Object.entries(CMS_MDX_COMPONENT_CONTRACTS2)) {
|
|
12274
12360
|
if (!Array.isArray(contract.requiredProps) || contract.requiredProps.length === 0) continue;
|
|
@@ -12309,8 +12395,40 @@ var require_src = __commonJS({
|
|
|
12309
12395
|
}
|
|
12310
12396
|
}
|
|
12311
12397
|
}
|
|
12398
|
+
function repairCmsMdxComponentContracts2(mdx) {
|
|
12399
|
+
let out = mdx;
|
|
12400
|
+
for (const [component, contract] of Object.entries(CMS_MDX_COMPONENT_CONTRACTS2)) {
|
|
12401
|
+
if (!contract.props) continue;
|
|
12402
|
+
for (const [prop, propContract] of Object.entries(contract.props)) {
|
|
12403
|
+
if (!Array.isArray(propContract.allowedValues)) continue;
|
|
12404
|
+
if (typeof propContract.defaultValue !== "string") continue;
|
|
12405
|
+
out = repairEnumComponentProp(
|
|
12406
|
+
out,
|
|
12407
|
+
component,
|
|
12408
|
+
prop,
|
|
12409
|
+
propContract.allowedValues,
|
|
12410
|
+
propContract.defaultValue
|
|
12411
|
+
);
|
|
12412
|
+
}
|
|
12413
|
+
}
|
|
12414
|
+
return out;
|
|
12415
|
+
}
|
|
12416
|
+
var TAG_BODY = `(?:"[^"]*"|'[^']*'|\\{[^}]*\\}|[^>])*?`;
|
|
12417
|
+
function repairEnumComponentProp(mdx, component, prop, allowedValues, defaultValue) {
|
|
12418
|
+
const tagPattern = new RegExp(`<${escapeRegExp(component)}\\b${TAG_BODY}\\s*/?>`, "gs");
|
|
12419
|
+
const propValuePattern = new RegExp(
|
|
12420
|
+
`((?:^|\\s)${escapeRegExp(prop)}\\s*=\\s*)(?:"[^"]*"|'[^']*'|\\{\\s*["'][^"']*["']\\s*\\})`,
|
|
12421
|
+
"s"
|
|
12422
|
+
);
|
|
12423
|
+
return mdx.replace(tagPattern, (tag) => {
|
|
12424
|
+
const value = readStaticJsxStringProp(tag, prop);
|
|
12425
|
+
if (value === null) return tag;
|
|
12426
|
+
if (allowedValues.includes(value)) return tag;
|
|
12427
|
+
return tag.replace(propValuePattern, `$1"${defaultValue}"`);
|
|
12428
|
+
});
|
|
12429
|
+
}
|
|
12312
12430
|
function findComponentAttrs(mdx, component) {
|
|
12313
|
-
const tagPattern = new RegExp(`<${escapeRegExp(component)}\\b(
|
|
12431
|
+
const tagPattern = new RegExp(`<${escapeRegExp(component)}\\b(${TAG_BODY})\\s*/?>`, "gs");
|
|
12314
12432
|
const attrs = [];
|
|
12315
12433
|
let match = tagPattern.exec(mdx);
|
|
12316
12434
|
while (match !== null) {
|
|
@@ -12321,7 +12439,7 @@ var require_src = __commonJS({
|
|
|
12321
12439
|
}
|
|
12322
12440
|
function readStaticJsxStringProp(attrs, prop) {
|
|
12323
12441
|
const propPattern = new RegExp(
|
|
12324
|
-
|
|
12442
|
+
`(?:^|\\s)${escapeRegExp(prop)}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|\\{\\s*["']([^"']*)["']\\s*\\})`,
|
|
12325
12443
|
"s"
|
|
12326
12444
|
);
|
|
12327
12445
|
const match = propPattern.exec(attrs);
|
|
@@ -13571,8 +13689,10 @@ var require_src = __commonJS({
|
|
|
13571
13689
|
validateCmsThemeTokens: cmsThemeTokens.validateCmsThemeTokens,
|
|
13572
13690
|
CMS_MDX_COMPONENT_CONTRACTS: CMS_MDX_COMPONENT_CONTRACTS2,
|
|
13573
13691
|
validateCmsMdxComponentContracts: validateCmsMdxComponentContracts2,
|
|
13692
|
+
repairCmsMdxComponentContracts: repairCmsMdxComponentContracts2,
|
|
13574
13693
|
CMS_RELATED_CONTENT_TITLE_BY_LANG: CMS_RELATED_CONTENT_TITLE_BY_LANG2,
|
|
13575
|
-
getCmsRelatedContentTitle: getCmsRelatedContentTitle2
|
|
13694
|
+
getCmsRelatedContentTitle: getCmsRelatedContentTitle2,
|
|
13695
|
+
...geoAgentRunner
|
|
13576
13696
|
};
|
|
13577
13697
|
}
|
|
13578
13698
|
});
|
|
@@ -22591,8 +22711,22 @@ var normalizeCmsThemeTokens = import_index2.default.normalizeCmsThemeTokens;
|
|
|
22591
22711
|
var validateCmsThemeTokens = import_index2.default.validateCmsThemeTokens;
|
|
22592
22712
|
var CMS_MDX_COMPONENT_CONTRACTS = import_index2.default.CMS_MDX_COMPONENT_CONTRACTS;
|
|
22593
22713
|
var validateCmsMdxComponentContracts = import_index2.default.validateCmsMdxComponentContracts;
|
|
22714
|
+
var repairCmsMdxComponentContracts = import_index2.default.repairCmsMdxComponentContracts;
|
|
22594
22715
|
var CMS_RELATED_CONTENT_TITLE_BY_LANG = import_index2.default.CMS_RELATED_CONTENT_TITLE_BY_LANG;
|
|
22595
22716
|
var getCmsRelatedContentTitle = import_index2.default.getCmsRelatedContentTitle;
|
|
22717
|
+
var GeoAgentExecutorRuntimeSchema = import_index2.default.GeoAgentExecutorRuntimeSchema;
|
|
22718
|
+
var GeoAgentExecutorProviderSchema = import_index2.default.GeoAgentExecutorProviderSchema;
|
|
22719
|
+
var GeoAgentSubmitModeSchema = import_index2.default.GeoAgentSubmitModeSchema;
|
|
22720
|
+
var GeoAgentJobStatusSchema = import_index2.default.GeoAgentJobStatusSchema;
|
|
22721
|
+
var GeoAgentMinMaxSchema = import_index2.default.GeoAgentMinMaxSchema;
|
|
22722
|
+
var GeoAgentExecutorSchema = import_index2.default.GeoAgentExecutorSchema;
|
|
22723
|
+
var GeoAgentLimitsSchema = import_index2.default.GeoAgentLimitsSchema;
|
|
22724
|
+
var GeoAgentGitSchema = import_index2.default.GeoAgentGitSchema;
|
|
22725
|
+
var GeoAgentArtifactsSchema = import_index2.default.GeoAgentArtifactsSchema;
|
|
22726
|
+
var GeoAgentJobSpecSchema = import_index2.default.GeoAgentJobSpecSchema;
|
|
22727
|
+
var GeoAgentJobEventSchema = import_index2.default.GeoAgentJobEventSchema;
|
|
22728
|
+
var GeoAgentJobArtifactSchema = import_index2.default.GeoAgentJobArtifactSchema;
|
|
22729
|
+
var parseGeoAgentJobSpecYaml = import_index2.default.parseGeoAgentJobSpecYaml;
|
|
22596
22730
|
var reasonTagSchema = import_index2.default.reasonTagSchema;
|
|
22597
22731
|
var reasonClassSchema = import_index2.default.reasonClassSchema;
|
|
22598
22732
|
var REASON_TAG_CLASS = import_index2.default.REASON_TAG_CLASS;
|
|
@@ -46923,7 +47057,7 @@ function printScaffoldError(prefix, err) {
|
|
|
46923
47057
|
|
|
46924
47058
|
// src/index.ts
|
|
46925
47059
|
var program2 = new Command();
|
|
46926
|
-
program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.
|
|
47060
|
+
program2.name("anymorph").description("Check AI visibility and run local GEO strategy workflows").version("0.16.0");
|
|
46927
47061
|
program2.command("login").description("Sign in to your Anymorph account").addHelpText(
|
|
46928
47062
|
"after",
|
|
46929
47063
|
`
|