wp-typia 0.24.1 → 0.24.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.
@@ -37567,7 +37567,7 @@ function formatAddHelpText() {
37567
37567
  wp-typia add variation <name> --block <block-slug> [--dry-run]
37568
37568
  wp-typia add style <name> --block <block-slug> [--dry-run]
37569
37569
  wp-typia add transform <name> --from <namespace/block> --to <block-slug|namespace/block-slug> [--dry-run]
37570
- wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>|--tag <tag>...] [--thumbnail-url <url>] [--dry-run]
37570
+ wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>] [--tag <tag>...] [--thumbnail-url <url>] [--dry-run]
37571
37571
  wp-typia add binding-source <name> [--block <block-slug|namespace/block-slug> --attribute <attribute>] [--from-post-meta|--post-meta <post-meta> [--meta-path <field>]] [--dry-run]
37572
37572
  wp-typia add contract <name> [--type <ExportedTypeName>] [--dry-run]
37573
37573
  wp-typia add rest-resource <name> [--namespace <vendor/v1>] [--methods <${REST_RESOURCE_METHOD_IDS.join(",")}>] [--route-pattern <route-pattern>] [--permission-callback <callback>] [--controller-class <ClassName>] [--controller-extends <BaseClass>] [--dry-run]
@@ -37595,7 +37595,7 @@ Notes:
37595
37595
  \`add variation\` targets an existing block slug from \`scripts/block-config.ts\`.
37596
37596
  \`add style\` registers a Block Styles option for an existing generated block.
37597
37597
  \`add transform\` adds a block-to-block transform into an existing generated block.
37598
- \`add pattern\` scaffolds a namespaced PHP pattern shell under \`src/patterns/full/\` or \`src/patterns/sections/\` and records typed catalog metadata in \`PATTERNS\`; pass \`--catalog-title "Hero Photo"\` to override the generated catalog title, and pass \`--tags hero,landing\` or repeat \`--tag hero --tag landing\` to set catalog tags.
37598
+ \`add pattern\` scaffolds a namespaced PHP pattern shell under \`src/patterns/full/\` or \`src/patterns/sections/\` and records typed catalog metadata in \`PATTERNS\`; pass \`--catalog-title "Hero Photo"\` to override the generated catalog title, pass \`--tags hero,landing\` for a comma-separated tag list, and repeat \`--tag hero --tag landing\` for single tag values.
37599
37599
  \`add binding-source\` scaffolds shared PHP and editor registration under \`src/bindings/\`; pass \`--block\` and \`--attribute\` together to declare an end-to-end bindable attribute on an existing generated block. Pass \`--from-post-meta\` or \`--post-meta\` to generate a source backed by a typed post-meta contract; \`--meta-path\` selects one top-level field as the default binding arg.
37600
37600
  \`add contract\` registers a standalone TypeScript wire contract under \`src/contracts/\` and generates a stable JSON Schema artifact without creating PHP route glue.
37601
37601
  \`add rest-resource\` scaffolds plugin-level TypeScript REST contracts under \`src/rest/\` and PHP route glue under \`inc/rest/\`. Use \`--route-pattern\`, \`--permission-callback\`, \`--controller-class\`, and \`--controller-extends\` when an existing WordPress controller or permission model needs to own part of the generated route surface.
@@ -240181,17 +240181,21 @@ function resolvePatternScope(scope) {
240181
240181
  }
240182
240182
  throw new Error(`Pattern scope must be one of: ${PATTERN_CATALOG_SCOPE_IDS.join(", ")}.`);
240183
240183
  }
240184
- function normalizeOptionalSlug(label, value2, usage) {
240184
+ function normalizePatternSectionRole(value2) {
240185
240185
  if (value2 === undefined || value2.trim() === "") {
240186
240186
  return;
240187
240187
  }
240188
- return assertValidGeneratedSlug(label, normalizeBlockSlug(value2), usage);
240188
+ const sectionRole = normalizeBlockSlug(value2);
240189
+ if (!PATTERN_SECTION_ROLE_PATTERN.test(sectionRole)) {
240190
+ throw new Error("Pattern section role must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
240191
+ }
240192
+ return sectionRole;
240189
240193
  }
240190
240194
  function normalizePatternTags(tags) {
240191
240195
  const rawTags = typeof tags === "string" ? tags.split(",") : Array.isArray(tags) ? tags.flatMap((tag) => tag.split(",")) : [];
240192
240196
  const normalizedTags = rawTags.map((tag) => normalizeBlockSlug(tag)).filter((tag) => tag.length > 0);
240193
240197
  for (const tag of normalizedTags) {
240194
- if (!PATTERN_TAG_PATTERN2.test(tag)) {
240198
+ if (!PATTERN_TAG_PATTERN.test(tag)) {
240195
240199
  throw new Error(`Pattern tag "${tag}" must contain only lowercase letters, numbers, and hyphens.`);
240196
240200
  }
240197
240201
  }
@@ -240216,12 +240220,12 @@ function resolvePatternContentFile(patternSlug, patternScope, contentFile) {
240216
240220
  }
240217
240221
  function resolvePatternCatalogOptions(patternSlug, options) {
240218
240222
  const patternScope = resolvePatternScope(options.patternScope);
240219
- const sectionRole = normalizeOptionalSlug("Pattern section role", options.sectionRole, "wp-typia add pattern <name> --scope section --section-role <role>");
240223
+ const sectionRole = normalizePatternSectionRole(options.sectionRole);
240220
240224
  if (patternScope === "section" && !sectionRole) {
240221
- throw new Error("`wp-typia add pattern --scope section` requires --section-role <role>.");
240225
+ throw new Error("`wp-typia add pattern --scope section` requires --section-role <role> because section-scoped patterns need a typed catalog section role.");
240222
240226
  }
240223
240227
  if (patternScope !== "section" && sectionRole) {
240224
- throw new Error("`--section-role` requires `--scope section`.");
240228
+ throw new Error("`--section-role` only applies with `--scope section`. Use `--scope section --section-role <role>` or omit `--section-role` for full patterns.");
240225
240229
  }
240226
240230
  const title = options.catalogTitle && options.catalogTitle.trim() !== "" ? options.catalogTitle.trim() : toTitleCase(patternSlug);
240227
240231
  const thumbnailUrl = normalizePatternThumbnailUrl(options.thumbnailUrl);
@@ -240234,12 +240238,11 @@ function resolvePatternCatalogOptions(patternSlug, options) {
240234
240238
  title
240235
240239
  };
240236
240240
  }
240237
- var PATTERN_CONTENT_FILE_ROOT2 = "src/patterns/", PATTERN_TAG_PATTERN2;
240241
+ var PATTERN_CONTENT_FILE_ROOT2 = "src/patterns/";
240238
240242
  var init_cli_add_workspace_pattern_options = __esm(() => {
240239
240243
  init_cli_add_shared();
240240
240244
  init_pattern_catalog();
240241
240245
  init_string_case();
240242
- PATTERN_TAG_PATTERN2 = /^[a-z0-9][a-z0-9-]*$/u;
240243
240246
  });
240244
240247
 
240245
240248
  // ../wp-typia-project-tools/src/runtime/cli-add-workspace-pattern-source-emitters.ts
@@ -244141,10 +244144,13 @@ __export(exports_cli_add, {
244141
244144
  runAddAiFeatureCommand: () => runAddAiFeatureCommand,
244142
244145
  runAddAdminViewCommand: () => runAddAdminViewCommand,
244143
244146
  runAddAbilityCommand: () => runAddAbilityCommand,
244147
+ normalizeBlockSlug: () => normalizeBlockSlug,
244144
244148
  isAddBlockTemplateId: () => isAddBlockTemplateId,
244145
244149
  getWorkspaceBlockSelectOptionsAsync: () => getWorkspaceBlockSelectOptionsAsync,
244146
244150
  getWorkspaceBlockSelectOptions: () => getWorkspaceBlockSelectOptions,
244147
244151
  formatAddHelpText: () => formatAddHelpText,
244152
+ PATTERN_TAG_PATTERN: () => PATTERN_TAG_PATTERN,
244153
+ PATTERN_SECTION_ROLE_PATTERN: () => PATTERN_SECTION_ROLE_PATTERN,
244148
244154
  PATTERN_CATALOG_SCOPE_IDS: () => PATTERN_CATALOG_SCOPE_IDS,
244149
244155
  EDITOR_PLUGIN_SLOT_IDS: () => EDITOR_PLUGIN_SLOT_IDS,
244150
244156
  ADD_KIND_IDS: () => ADD_KIND_IDS,
@@ -299808,11 +299814,11 @@ var ADD_OPTION_METADATA = {
299808
299814
  type: "string"
299809
299815
  },
299810
299816
  scope: {
299811
- description: "Pattern catalog scope for pattern workflows (full or section).",
299817
+ description: "Pattern catalog scope for pattern workflows; one of full or section.",
299812
299818
  type: "string"
299813
299819
  },
299814
299820
  "section-role": {
299815
- description: "Typed section role for section-scoped pattern catalog entries.",
299821
+ description: "Typed section role for section-scoped pattern catalog entries; requires --scope section.",
299816
299822
  type: "string"
299817
299823
  },
299818
299824
  "secret-field": {
@@ -299856,12 +299862,12 @@ var ADD_OPTION_METADATA = {
299856
299862
  type: "string"
299857
299863
  },
299858
299864
  tags: {
299859
- description: "Comma-separated tags for typed pattern catalog entries; may be repeated.",
299865
+ description: "Comma-separated tags for typed pattern catalog entries; combine with repeatable --tag for single tags.",
299860
299866
  repeatable: true,
299861
299867
  type: "string"
299862
299868
  },
299863
299869
  tag: {
299864
- description: "Repeatable singular tag for typed pattern catalog entries.",
299870
+ description: "Repeatable single tag for typed pattern catalog entries; use --tags for comma-separated lists.",
299865
299871
  repeatable: true,
299866
299872
  type: "string"
299867
299873
  },
@@ -300350,6 +300356,13 @@ var NAME_ONLY_VISIBLE_FIELDS = [
300350
300356
  "kind",
300351
300357
  "name"
300352
300358
  ];
300359
+ var PATTERN_CATALOG_VISIBLE_FIELDS = [
300360
+ "kind",
300361
+ "name",
300362
+ "scope",
300363
+ "section-role",
300364
+ "catalog-title"
300365
+ ];
300353
300366
  var NAME_SOURCE_VISIBLE_FIELDS = [
300354
300367
  "kind",
300355
300368
  "name",
@@ -300820,6 +300833,15 @@ var contractAddKindEntry = defineAddKindRegistryEntry({
300820
300833
  init_cli_diagnostics();
300821
300834
  var CORE_VARIATION_MISSING_NAME_MESSAGE = "`wp-typia add core-variation` requires <name>. Usage: wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>.";
300822
300835
  var CORE_VARIATION_MISSING_BLOCK_MESSAGE = "`wp-typia add core-variation` requires <block-name>. Usage: wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>.";
300836
+ var CORE_VARIATION_BLOCK_NAME_PATTERN = /^[^/\s]+\/[^/\s]+$/u;
300837
+ function formatCoreVariationMissingPositionalNameMessage(blockName) {
300838
+ return [
300839
+ `\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
300840
+ "Usage: wp-typia add core-variation <block-name> <name>",
300841
+ "Alternative: wp-typia add core-variation <name> --block <namespace/block>"
300842
+ ].join(`
300843
+ `);
300844
+ }
300823
300845
  function resolveCoreVariationInputs(context) {
300824
300846
  const positionalTargetBlockName = context.positionalArgs?.[1];
300825
300847
  const positionalVariationName = context.positionalArgs?.[2];
@@ -300832,16 +300854,17 @@ function resolveCoreVariationInputs(context) {
300832
300854
  variationName: positionalVariationName
300833
300855
  };
300834
300856
  }
300835
- if (context.name?.includes("/") && !readOptionalStrictStringFlag(context.flags, "block")) {
300836
- throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, CORE_VARIATION_MISSING_NAME_MESSAGE);
300857
+ const targetBlockFlag = readOptionalStrictStringFlag(context.flags, "block");
300858
+ const missingPositionalNameTarget = context.name !== undefined && positionalTargetBlockName === context.name && CORE_VARIATION_BLOCK_NAME_PATTERN.test(context.name) ? context.name : undefined;
300859
+ if (missingPositionalNameTarget && !targetBlockFlag) {
300860
+ throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, formatCoreVariationMissingPositionalNameMessage(missingPositionalNameTarget));
300837
300861
  }
300838
300862
  const variationName = requireAddKindName(context, CORE_VARIATION_MISSING_NAME_MESSAGE);
300839
- const targetBlockName = readOptionalStrictStringFlag(context.flags, "block");
300840
- if (!targetBlockName) {
300863
+ if (!targetBlockFlag) {
300841
300864
  throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, CORE_VARIATION_MISSING_BLOCK_MESSAGE);
300842
300865
  }
300843
300866
  return {
300844
- targetBlockName,
300867
+ targetBlockName: targetBlockFlag,
300845
300868
  variationName
300846
300869
  };
300847
300870
  }
@@ -301020,10 +301043,12 @@ var integrationEnvAddKindEntry = defineAddKindRegistryEntry({
301020
301043
  supportsDryRun: true,
301021
301044
  usage: "wp-typia add integration-env <name> [--wp-env] [--release-zip] [--service <none|docker-compose>] [--dry-run]",
301022
301045
  visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS,
301023
- hiddenBooleanSubmitFields: ["wp-env", "release-zip"]
301046
+ hiddenBooleanSubmitFields: ["wp-env", "release-zip"],
301047
+ hiddenStringSubmitFields: ["service"]
301024
301048
  });
301025
301049
 
301026
301050
  // src/add-kinds/pattern.ts
301051
+ init_cli_diagnostics();
301027
301052
  var PATTERN_MISSING_NAME_MESSAGE = "`wp-typia add pattern` requires <name>. Usage: wp-typia add pattern <name>.";
301028
301053
  var patternAddKindEntry = defineAddKindRegistryEntry({
301029
301054
  completion: {
@@ -301039,19 +301064,12 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
301039
301064
  title: "Added workspace pattern"
301040
301065
  },
301041
301066
  description: "Add a PHP block pattern shell",
301042
- hiddenStringSubmitFields: [
301043
- "catalog-title",
301044
- "scope",
301045
- "section-role",
301046
- "tag",
301047
- "tags",
301048
- "thumbnail-url"
301049
- ],
301067
+ hiddenStringSubmitFields: ["tag", "tags", "thumbnail-url"],
301050
301068
  nameLabel: "Pattern name",
301051
301069
  async prepareExecution(context) {
301052
301070
  const name2 = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
301053
- const scope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
301054
- const sectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
301071
+ const scope = resolvePatternScopeFlag(context);
301072
+ const sectionRole = resolvePatternSectionRoleFlag(context, scope);
301055
301073
  const catalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
301056
301074
  const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
301057
301075
  const thumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
@@ -301076,9 +301094,42 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
301076
301094
  },
301077
301095
  sortOrder: 60,
301078
301096
  supportsDryRun: true,
301079
- usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>|--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
301080
- visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS
301097
+ usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>] [--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
301098
+ visibleFieldNames: () => PATTERN_CATALOG_VISIBLE_FIELDS
301081
301099
  });
301100
+ function createInvalidPatternArgumentError(message) {
301101
+ return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, message);
301102
+ }
301103
+ function createMissingPatternArgumentError(message) {
301104
+ return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, message);
301105
+ }
301106
+ function resolvePatternScopeFlag(context) {
301107
+ const scope = readOptionalLooseStringFlag(context.flags, "scope");
301108
+ if (!scope) {
301109
+ return;
301110
+ }
301111
+ if (context.addRuntime.PATTERN_CATALOG_SCOPE_IDS.includes(scope)) {
301112
+ return scope;
301113
+ }
301114
+ throw createInvalidPatternArgumentError(`\`--scope\` must be one of: ${context.addRuntime.PATTERN_CATALOG_SCOPE_IDS.join(", ")}. Usage: wp-typia add pattern <name> --scope <full|section>.`);
301115
+ }
301116
+ function resolvePatternSectionRoleFlag(context, scope) {
301117
+ const sectionRole = readOptionalLooseStringFlag(context.flags, "section-role");
301118
+ if (scope === "section" && sectionRole === undefined) {
301119
+ throw createMissingPatternArgumentError("`wp-typia add pattern --scope section` requires --section-role <role> because section-scoped patterns need a typed catalog section role.");
301120
+ }
301121
+ if (scope !== "section" && sectionRole !== undefined) {
301122
+ throw createInvalidPatternArgumentError("`--section-role` only applies with `--scope section`. Use `--scope section --section-role <role>` or omit `--section-role` for full patterns.");
301123
+ }
301124
+ const normalizedSectionRole = sectionRole === undefined ? undefined : context.addRuntime.normalizeBlockSlug(sectionRole);
301125
+ if (normalizedSectionRole && !context.addRuntime.PATTERN_SECTION_ROLE_PATTERN.test(normalizedSectionRole)) {
301126
+ throw createInvalidPatternArgumentError("`--section-role` must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
301127
+ }
301128
+ if (sectionRole !== undefined && !normalizedSectionRole) {
301129
+ throw createInvalidPatternArgumentError("`--section-role` must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
301130
+ }
301131
+ return normalizedSectionRole;
301132
+ }
301082
301133
  function collectStringFlagValues(value2) {
301083
301134
  if (typeof value2 === "string") {
301084
301135
  return [value2];
@@ -301093,13 +301144,7 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
301093
301144
  ...collectStringFlagValues(tagsFlag),
301094
301145
  ...collectStringFlagValues(tagFlag)
301095
301146
  ];
301096
- if (tags.length === 0) {
301097
- return;
301098
- }
301099
- if (tags.length === 1) {
301100
- return tags[0];
301101
- }
301102
- return tags;
301147
+ return tags.length > 0 ? tags : undefined;
301103
301148
  }
301104
301149
 
301105
301150
  // src/add-kinds/post-meta.ts
@@ -301849,7 +301894,7 @@ function buildStructuredInitSuccessPayload(plan) {
301849
301894
  // package.json
301850
301895
  var package_default2 = {
301851
301896
  name: "wp-typia",
301852
- version: "0.24.1",
301897
+ version: "0.24.2",
301853
301898
  description: "Canonical CLI package for wp-typia scaffolding and project workflows",
301854
301899
  packageManager: "bun@1.3.11",
301855
301900
  type: "module",
@@ -301919,7 +301964,7 @@ var package_default2 = {
301919
301964
  "@bunli/tui": "0.6.0",
301920
301965
  "@bunli/utils": "0.6.0",
301921
301966
  "@wp-typia/api-client": "^0.4.5",
301922
- "@wp-typia/project-tools": "0.24.1",
301967
+ "@wp-typia/project-tools": "0.24.2",
301923
301968
  "better-result": "^2.7.0",
301924
301969
  react: "^19.2.5",
301925
301970
  "react-dom": "^19.2.5",
@@ -304307,4 +304352,4 @@ export {
304307
304352
  cli
304308
304353
  };
304309
304354
 
304310
- //# debugId=2782AF044AA7C53F64756E2164756E21
304355
+ //# debugId=EDC8802048054A1E64756E2164756E21
@@ -14,11 +14,11 @@ import {
14
14
  isOmittableBuiltInTemplateLayerDir,
15
15
  resolveBuiltInTemplateSource,
16
16
  resolveBuiltInTemplateSourceFromLayerDirs
17
- } from "./cli-gaq29kzp.js";
17
+ } from "./cli-vxd8eyax.js";
18
18
  import {
19
19
  DEFAULT_WORDPRESS_ENV_VERSION,
20
20
  getPackageVersions
21
- } from "./cli-zjw3eqfj.js";
21
+ } from "./cli-wfvf3tv1.js";
22
22
  import {
23
23
  BUILTIN_BLOCK_METADATA_VERSION,
24
24
  COMPOUND_CHILD_BLOCK_METADATA_DEFAULTS,
@@ -36,7 +36,7 @@ import {
36
36
  } from "./cli-8hxf9qw6.js";
37
37
  import {
38
38
  seedProjectMigrations
39
- } from "./cli-fzhkqzc7.js";
39
+ } from "./cli-6ys6d16y.js";
40
40
  import {
41
41
  ensureMigrationDirectories,
42
42
  isPlainObject,
@@ -63,7 +63,7 @@ import {
63
63
  toTitleCase,
64
64
  validateBlockSlug,
65
65
  validateNamespace
66
- } from "./cli-h2v72j8q.js";
66
+ } from "./cli-kbqztfkt.js";
67
67
  import {
68
68
  createManagedTempRoot
69
69
  } from "./cli-t73q5aqz.js";
@@ -14,7 +14,7 @@ import {
14
14
  // package.json
15
15
  var package_default = {
16
16
  name: "wp-typia",
17
- version: "0.24.1",
17
+ version: "0.24.2",
18
18
  description: "Canonical CLI package for wp-typia scaffolding and project workflows",
19
19
  packageManager: "bun@1.3.11",
20
20
  type: "module",
@@ -84,7 +84,7 @@ var package_default = {
84
84
  "@bunli/tui": "0.6.0",
85
85
  "@bunli/utils": "0.6.0",
86
86
  "@wp-typia/api-client": "^0.4.5",
87
- "@wp-typia/project-tools": "0.24.1",
87
+ "@wp-typia/project-tools": "0.24.2",
88
88
  "better-result": "^2.7.0",
89
89
  react: "^19.2.5",
90
90
  "react-dom": "^19.2.5",
@@ -286,11 +286,11 @@ var ADD_OPTION_METADATA = {
286
286
  type: "string"
287
287
  },
288
288
  scope: {
289
- description: "Pattern catalog scope for pattern workflows (full or section).",
289
+ description: "Pattern catalog scope for pattern workflows; one of full or section.",
290
290
  type: "string"
291
291
  },
292
292
  "section-role": {
293
- description: "Typed section role for section-scoped pattern catalog entries.",
293
+ description: "Typed section role for section-scoped pattern catalog entries; requires --scope section.",
294
294
  type: "string"
295
295
  },
296
296
  "secret-field": {
@@ -334,12 +334,12 @@ var ADD_OPTION_METADATA = {
334
334
  type: "string"
335
335
  },
336
336
  tags: {
337
- description: "Comma-separated tags for typed pattern catalog entries; may be repeated.",
337
+ description: "Comma-separated tags for typed pattern catalog entries; combine with repeatable --tag for single tags.",
338
338
  repeatable: true,
339
339
  type: "string"
340
340
  },
341
341
  tag: {
342
- description: "Repeatable singular tag for typed pattern catalog entries.",
342
+ description: "Repeatable single tag for typed pattern catalog entries; use --tags for comma-separated lists.",
343
343
  repeatable: true,
344
344
  type: "string"
345
345
  },
@@ -635,22 +635,32 @@ var COMMAND_ROUTING_METADATA = buildArgvWalkerRoutingMetadata(ALL_COMMAND_OPTION
635
635
  function createMissingOptionValueError(optionLabel) {
636
636
  return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, `\`${optionLabel}\` requires a value.`);
637
637
  }
638
- function extractKnownOptionValuesFromArgv(argv, options) {
638
+ function createUnknownOptionError(optionLabel) {
639
+ return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `Unknown option \`${optionLabel}\`.`);
640
+ }
641
+ function walkArgvOptions(argv, options) {
639
642
  const flags = {};
640
643
  const nextArgv = [];
641
- const optionNames = new Set(options.optionNames);
644
+ const booleanOptionNames = new Set(options.parser.booleanOptionNames);
645
+ const optionNames = new Set(options.optionNames ?? []);
646
+ for (const optionName of options.extraBooleanOptionNames ?? []) {
647
+ booleanOptionNames.add(optionName);
648
+ }
642
649
  for (let index = 0;index < argv.length; index += 1) {
643
650
  const arg = argv[index];
644
651
  if (!arg) {
645
652
  continue;
646
653
  }
647
654
  if (arg === "--") {
648
- nextArgv.push(...argv.slice(index));
655
+ nextArgv.push(...argv.slice(index + (options.strict ? 1 : 0)));
649
656
  break;
650
657
  }
651
658
  if (arg.length === 2 && arg.startsWith("-")) {
652
659
  const shortFlag = options.parser.shortFlagMap.get(arg.slice(1));
653
- if (!shortFlag || !optionNames.has(shortFlag.name)) {
660
+ if (!shortFlag || !options.strict && !optionNames.has(shortFlag.name)) {
661
+ if (options.strict) {
662
+ throw createUnknownOptionError(arg);
663
+ }
654
664
  nextArgv.push(arg);
655
665
  continue;
656
666
  }
@@ -675,15 +685,18 @@ function extractKnownOptionValuesFromArgv(argv, options) {
675
685
  const separatorIndex = option.indexOf("=");
676
686
  const rawName = separatorIndex === -1 ? option : option.slice(0, separatorIndex);
677
687
  const inlineValue = separatorIndex === -1 ? undefined : option.slice(separatorIndex + 1);
678
- if (!optionNames.has(rawName)) {
688
+ if (!options.strict && !optionNames.has(rawName)) {
679
689
  nextArgv.push(arg);
680
690
  continue;
681
691
  }
682
- if (options.parser.booleanOptionNames.has(rawName)) {
692
+ if (booleanOptionNames.has(rawName)) {
683
693
  flags[rawName] = true;
684
694
  continue;
685
695
  }
686
696
  if (!options.parser.stringOptionNames.has(rawName)) {
697
+ if (options.strict) {
698
+ throw createUnknownOptionError(`--${rawName}`);
699
+ }
687
700
  nextArgv.push(arg);
688
701
  continue;
689
702
  }
@@ -710,6 +723,9 @@ function extractKnownOptionValuesFromArgv(argv, options) {
710
723
  index += 1;
711
724
  continue;
712
725
  }
726
+ if (arg.startsWith("-") && options.strict) {
727
+ throw createUnknownOptionError(arg);
728
+ }
713
729
  nextArgv.push(arg);
714
730
  }
715
731
  return {
@@ -717,6 +733,13 @@ function extractKnownOptionValuesFromArgv(argv, options) {
717
733
  flags
718
734
  };
719
735
  }
736
+ function extractKnownOptionValuesFromArgv(argv, options) {
737
+ return walkArgvOptions(argv, {
738
+ optionNames: options.optionNames,
739
+ parser: options.parser,
740
+ strict: false
741
+ });
742
+ }
720
743
  function resolveCommandOptionValues(metadata, options) {
721
744
  const resolved = {};
722
745
  const optionNames = options.optionNames ?? Object.keys(metadata);
@@ -1205,4 +1228,4 @@ function createPlugin(input) {
1205
1228
  }
1206
1229
  export { createPlugin, package_default, collectPositionalIndexes, findFirstPositionalIndex, ADD_OPTION_METADATA, CREATE_OPTION_METADATA, DOCTOR_OPTION_METADATA, GLOBAL_OPTION_METADATA, INIT_OPTION_METADATA, MCP_OPTION_METADATA, MIGRATE_OPTION_METADATA, SYNC_OPTION_METADATA, TEMPLATES_OPTION_METADATA, COMMAND_OPTION_METADATA_BY_GROUP, ALL_COMMAND_OPTION_METADATA, buildCommandOptions, collectOptionNamesByType, buildCommandOptionParser, COMMAND_ROUTING_METADATA, createMissingOptionValueError, extractKnownOptionValuesFromArgv, resolveCommandOptionValues, normalizeCliOutputFormatArgv, validateCliOutputFormatArgv, prefersStructuredCliOutput, emitCliDiagnosticFailure, writeStructuredCliDiagnosticError, formatAddKindList, formatAddKindUsagePlaceholder, WP_TYPIA_CANONICAL_CREATE_USAGE, WP_TYPIA_RESERVED_TOP_LEVEL_COMMAND_NAMES, WP_TYPIA_TOP_LEVEL_COMMAND_NAMES, WP_TYPIA_COMMAND_OPTION_GROUP_NAMES_BY_TOP_LEVEL_COMMAND, WP_TYPIA_CONFIG_SOURCES, mergeWpTypiaUserConfig, loadWpTypiaUserConfigFromSource, loadWpTypiaUserConfig, getCreateDefaults, getAddBlockDefaults, getMcpSchemaSources };
1207
1230
 
1208
- //# debugId=C72B79CCBF0C2E7664756E2164756E21
1231
+ //# debugId=6550DDC468E315F664756E2164756E21
@@ -47,7 +47,7 @@ import {
47
47
  } from "./cli-e4bwd81c.js";
48
48
  import {
49
49
  readWorkspaceInventory
50
- } from "./cli-h2v72j8q.js";
50
+ } from "./cli-kbqztfkt.js";
51
51
  import {
52
52
  getInvalidWorkspaceProjectReason,
53
53
  tryResolveWorkspaceProject
@@ -24,7 +24,7 @@ import {
24
24
  scaffoldProject,
25
25
  syncPersistenceRestArtifacts,
26
26
  updatePluginHeaderCompatibility
27
- } from "./cli-4ah8dawy.js";
27
+ } from "./cli-4eqznv15.js";
28
28
  import {
29
29
  parseTemplateLocator,
30
30
  require_semver
@@ -53,7 +53,7 @@ import {
53
53
  loadPostMetaBindingFields,
54
54
  maskTypeScriptCommentsAndLiterals
55
55
  } from "./cli-z48frc8t.js";
56
- import"./cli-gaq29kzp.js";
56
+ import"./cli-vxd8eyax.js";
57
57
  import {
58
58
  DEFAULT_WORDPRESS_ABILITIES_VERSION,
59
59
  DEFAULT_WORDPRESS_CORE_ABILITIES_VERSION,
@@ -63,13 +63,13 @@ import {
63
63
  DEFAULT_WP_TYPIA_DATAVIEWS_VERSION,
64
64
  getPackageVersions,
65
65
  resolveManagedPackageVersionRange
66
- } from "./cli-zjw3eqfj.js";
66
+ } from "./cli-wfvf3tv1.js";
67
67
  import {
68
68
  SHARED_WORKSPACE_TEMPLATE_ROOT
69
69
  } from "./cli-8hxf9qw6.js";
70
70
  import {
71
71
  snapshotProjectVersion
72
- } from "./cli-fzhkqzc7.js";
72
+ } from "./cli-6ys6d16y.js";
73
73
  import {
74
74
  ensureMigrationDirectories,
75
75
  parseMigrationConfig,
@@ -80,6 +80,8 @@ import {
80
80
  ADD_BLOCK_TEMPLATE_IDS,
81
81
  EDITOR_PLUGIN_SLOT_IDS,
82
82
  PATTERN_CATALOG_SCOPE_IDS,
83
+ PATTERN_SECTION_ROLE_PATTERN,
84
+ PATTERN_TAG_PATTERN,
83
85
  appendWorkspaceInventoryEntries,
84
86
  assertAbilityDoesNotExist,
85
87
  assertAdminViewDoesNotExist,
@@ -144,7 +146,7 @@ import {
144
146
  toPascalCase,
145
147
  toSnakeCase,
146
148
  toTitleCase
147
- } from "./cli-h2v72j8q.js";
149
+ } from "./cli-kbqztfkt.js";
148
150
  import"./cli-cvxvcw7c.js";
149
151
  import {
150
152
  createManagedTempRoot
@@ -6901,7 +6903,6 @@ function ${patternRegistrationFunctionName}() {
6901
6903
  // ../wp-typia-project-tools/src/runtime/cli-add-workspace-pattern-options.ts
6902
6904
  import path19 from "path";
6903
6905
  var PATTERN_CONTENT_FILE_ROOT = "src/patterns/";
6904
- var PATTERN_TAG_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
6905
6906
  function assertValidPatternRelativePath(label, value, usage) {
6906
6907
  const normalizedPath = value.trim().replace(/\\/gu, "/");
6907
6908
  if (normalizedPath.length === 0 || path19.isAbsolute(normalizedPath) || normalizedPath.split("/").includes("..") || /[<>:"|?*\u0000-\u001F]/u.test(normalizedPath)) {
@@ -6934,11 +6935,15 @@ function resolvePatternScope(scope) {
6934
6935
  }
6935
6936
  throw new Error(`Pattern scope must be one of: ${PATTERN_CATALOG_SCOPE_IDS.join(", ")}.`);
6936
6937
  }
6937
- function normalizeOptionalSlug(label, value, usage) {
6938
+ function normalizePatternSectionRole(value) {
6938
6939
  if (value === undefined || value.trim() === "") {
6939
6940
  return;
6940
6941
  }
6941
- return assertValidGeneratedSlug(label, normalizeBlockSlug(value), usage);
6942
+ const sectionRole = normalizeBlockSlug(value);
6943
+ if (!PATTERN_SECTION_ROLE_PATTERN.test(sectionRole)) {
6944
+ throw new Error("Pattern section role must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
6945
+ }
6946
+ return sectionRole;
6942
6947
  }
6943
6948
  function normalizePatternTags(tags) {
6944
6949
  const rawTags = typeof tags === "string" ? tags.split(",") : Array.isArray(tags) ? tags.flatMap((tag) => tag.split(",")) : [];
@@ -6969,12 +6974,12 @@ function resolvePatternContentFile(patternSlug, patternScope, contentFile) {
6969
6974
  }
6970
6975
  function resolvePatternCatalogOptions(patternSlug, options) {
6971
6976
  const patternScope = resolvePatternScope(options.patternScope);
6972
- const sectionRole = normalizeOptionalSlug("Pattern section role", options.sectionRole, "wp-typia add pattern <name> --scope section --section-role <role>");
6977
+ const sectionRole = normalizePatternSectionRole(options.sectionRole);
6973
6978
  if (patternScope === "section" && !sectionRole) {
6974
- throw new Error("`wp-typia add pattern --scope section` requires --section-role <role>.");
6979
+ throw new Error("`wp-typia add pattern --scope section` requires --section-role <role> because section-scoped patterns need a typed catalog section role.");
6975
6980
  }
6976
6981
  if (patternScope !== "section" && sectionRole) {
6977
- throw new Error("`--section-role` requires `--scope section`.");
6982
+ throw new Error("`--section-role` only applies with `--scope section`. Use `--scope section --section-role <role>` or omit `--section-role` for full patterns.");
6978
6983
  }
6979
6984
  const title = options.catalogTitle && options.catalogTitle.trim() !== "" ? options.catalogTitle.trim() : toTitleCase(patternSlug);
6980
6985
  const thumbnailUrl = normalizePatternThumbnailUrl(options.thumbnailUrl);
@@ -10639,14 +10644,17 @@ export {
10639
10644
  runAddAiFeatureCommand,
10640
10645
  runAddAdminViewCommand,
10641
10646
  runAddAbilityCommand,
10647
+ normalizeBlockSlug,
10642
10648
  isAddBlockTemplateId,
10643
10649
  getWorkspaceBlockSelectOptionsAsync,
10644
10650
  getWorkspaceBlockSelectOptions,
10645
10651
  formatAddHelpText,
10652
+ PATTERN_TAG_PATTERN,
10653
+ PATTERN_SECTION_ROLE_PATTERN,
10646
10654
  PATTERN_CATALOG_SCOPE_IDS,
10647
10655
  EDITOR_PLUGIN_SLOT_IDS,
10648
10656
  ADD_KIND_IDS,
10649
10657
  ADD_BLOCK_TEMPLATE_IDS
10650
10658
  };
10651
10659
 
10652
- //# debugId=FE26DE542557245464756E2164756E21
10660
+ //# debugId=3EDD3B6180967F3A64756E2164756E21
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  getBuiltInTemplateLayerDirs,
13
13
  isOmittableBuiltInTemplateLayerDir
14
- } from "./cli-gaq29kzp.js";
14
+ } from "./cli-vxd8eyax.js";
15
15
  import {
16
16
  isBuiltInTemplateId,
17
17
  listTemplates
@@ -33,7 +33,7 @@ import {
33
33
  resolveEditorPluginSlotAlias,
34
34
  resolvePatternCatalogContentFile,
35
35
  validatePatternCatalog
36
- } from "./cli-h2v72j8q.js";
36
+ } from "./cli-kbqztfkt.js";
37
37
  import"./cli-cvxvcw7c.js";
38
38
  import"./cli-t73q5aqz.js";
39
39
  import"./cli-bajwv85z.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getPackageVersions
4
- } from "./cli-zjw3eqfj.js";
4
+ } from "./cli-wfvf3tv1.js";
5
5
  import"./cli-8hxf9qw6.js";
6
6
  import {
7
7
  discoverMigrationInitLayout
@@ -13,7 +13,7 @@ import {
13
13
  snapshotWorkspaceFiles,
14
14
  toPascalCase,
15
15
  updateWorkspaceInventorySource
16
- } from "./cli-h2v72j8q.js";
16
+ } from "./cli-kbqztfkt.js";
17
17
  import"./cli-cvxvcw7c.js";
18
18
  import"./cli-bajwv85z.js";
19
19
  import {