@wp-typia/project-tools 0.22.10 → 0.23.1

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 (155) hide show
  1. package/dist/runtime/ai-feature-artifacts.js +4 -1
  2. package/dist/runtime/block-generator-service-spec.js +2 -1
  3. package/dist/runtime/cli-add-block-json.js +5 -1
  4. package/dist/runtime/cli-add-collision.d.ts +25 -0
  5. package/dist/runtime/cli-add-collision.js +76 -0
  6. package/dist/runtime/cli-add-help.js +12 -2
  7. package/dist/runtime/cli-add-kind-ids.d.ts +1 -1
  8. package/dist/runtime/cli-add-kind-ids.js +3 -0
  9. package/dist/runtime/cli-add-types.d.ts +129 -0
  10. package/dist/runtime/cli-add-types.js +26 -0
  11. package/dist/runtime/cli-add-validation.d.ts +97 -1
  12. package/dist/runtime/cli-add-validation.js +313 -1
  13. package/dist/runtime/cli-add-workspace-ability-scaffold.js +4 -1
  14. package/dist/runtime/cli-add-workspace-admin-view-scaffold.js +79 -20
  15. package/dist/runtime/cli-add-workspace-admin-view-source.js +11 -2
  16. package/dist/runtime/cli-add-workspace-admin-view-templates-core-data.d.ts +34 -0
  17. package/dist/runtime/cli-add-workspace-admin-view-templates-core-data.js +483 -0
  18. package/dist/runtime/cli-add-workspace-admin-view-templates-default.d.ts +30 -0
  19. package/dist/runtime/cli-add-workspace-admin-view-templates-default.js +310 -0
  20. package/dist/runtime/cli-add-workspace-admin-view-templates-rest.d.ts +25 -0
  21. package/dist/runtime/cli-add-workspace-admin-view-templates-rest.js +124 -0
  22. package/dist/runtime/cli-add-workspace-admin-view-templates-settings.d.ts +34 -0
  23. package/dist/runtime/cli-add-workspace-admin-view-templates-settings.js +370 -0
  24. package/dist/runtime/cli-add-workspace-admin-view-templates-shared.d.ts +49 -0
  25. package/dist/runtime/cli-add-workspace-admin-view-templates-shared.js +259 -0
  26. package/dist/runtime/cli-add-workspace-admin-view-templates.d.ts +19 -10
  27. package/dist/runtime/cli-add-workspace-admin-view-templates.js +31 -971
  28. package/dist/runtime/cli-add-workspace-admin-view-types.d.ts +21 -0
  29. package/dist/runtime/cli-add-workspace-admin-view-types.js +22 -0
  30. package/dist/runtime/cli-add-workspace-ai-anchors.js +125 -32
  31. package/dist/runtime/cli-add-workspace-ai-source-emitters.js +17 -1
  32. package/dist/runtime/cli-add-workspace-contract-source-emitters.d.ts +15 -0
  33. package/dist/runtime/cli-add-workspace-contract-source-emitters.js +42 -0
  34. package/dist/runtime/cli-add-workspace-contract.d.ts +15 -0
  35. package/dist/runtime/cli-add-workspace-contract.js +65 -0
  36. package/dist/runtime/cli-add-workspace-integration-env.d.ts +26 -0
  37. package/dist/runtime/cli-add-workspace-integration-env.js +428 -0
  38. package/dist/runtime/cli-add-workspace-post-meta-anchors.d.ts +23 -0
  39. package/dist/runtime/cli-add-workspace-post-meta-anchors.js +244 -0
  40. package/dist/runtime/cli-add-workspace-post-meta-source-emitters.d.ts +63 -0
  41. package/dist/runtime/cli-add-workspace-post-meta-source-emitters.js +179 -0
  42. package/dist/runtime/cli-add-workspace-post-meta.d.ts +15 -0
  43. package/dist/runtime/cli-add-workspace-post-meta.js +107 -0
  44. package/dist/runtime/cli-add-workspace-rest-anchors.d.ts +9 -0
  45. package/dist/runtime/cli-add-workspace-rest-anchors.js +326 -21
  46. package/dist/runtime/cli-add-workspace-rest-generated.d.ts +9 -0
  47. package/dist/runtime/cli-add-workspace-rest-generated.js +158 -0
  48. package/dist/runtime/cli-add-workspace-rest-manual.d.ts +8 -0
  49. package/dist/runtime/cli-add-workspace-rest-manual.js +279 -0
  50. package/dist/runtime/cli-add-workspace-rest-php-templates.d.ts +24 -0
  51. package/dist/runtime/cli-add-workspace-rest-php-templates.js +678 -0
  52. package/dist/runtime/cli-add-workspace-rest-source-emitters.d.ts +98 -2
  53. package/dist/runtime/cli-add-workspace-rest-source-emitters.js +323 -29
  54. package/dist/runtime/cli-add-workspace-rest-types.d.ts +108 -0
  55. package/dist/runtime/cli-add-workspace-rest-types.js +1 -0
  56. package/dist/runtime/cli-add-workspace-rest.d.ts +3 -7
  57. package/dist/runtime/cli-add-workspace-rest.js +34 -481
  58. package/dist/runtime/cli-add-workspace.d.ts +15 -0
  59. package/dist/runtime/cli-add-workspace.js +15 -0
  60. package/dist/runtime/cli-add.d.ts +1 -1
  61. package/dist/runtime/cli-add.js +1 -1
  62. package/dist/runtime/cli-core.d.ts +3 -2
  63. package/dist/runtime/cli-core.js +3 -2
  64. package/dist/runtime/cli-diagnostics.d.ts +3 -1
  65. package/dist/runtime/cli-diagnostics.js +17 -5
  66. package/dist/runtime/cli-doctor-environment.js +1 -3
  67. package/dist/runtime/cli-doctor-workspace-bindings.js +4 -1
  68. package/dist/runtime/cli-doctor-workspace-block-addons.d.ts +12 -0
  69. package/dist/runtime/cli-doctor-workspace-block-addons.js +134 -0
  70. package/dist/runtime/cli-doctor-workspace-block-iframe.d.ts +9 -0
  71. package/dist/runtime/cli-doctor-workspace-block-iframe.js +228 -0
  72. package/dist/runtime/cli-doctor-workspace-block-metadata.d.ts +11 -0
  73. package/dist/runtime/cli-doctor-workspace-block-metadata.js +111 -0
  74. package/dist/runtime/cli-doctor-workspace-blocks.js +6 -424
  75. package/dist/runtime/cli-doctor-workspace-features-abilities.d.ts +11 -0
  76. package/dist/runtime/cli-doctor-workspace-features-abilities.js +112 -0
  77. package/dist/runtime/cli-doctor-workspace-features-admin-views.d.ts +11 -0
  78. package/dist/runtime/cli-doctor-workspace-features-admin-views.js +128 -0
  79. package/dist/runtime/cli-doctor-workspace-features-ai.d.ts +11 -0
  80. package/dist/runtime/cli-doctor-workspace-features-ai.js +57 -0
  81. package/dist/runtime/cli-doctor-workspace-features-editor-plugins.d.ts +11 -0
  82. package/dist/runtime/cli-doctor-workspace-features-editor-plugins.js +80 -0
  83. package/dist/runtime/cli-doctor-workspace-features-post-meta.d.ts +11 -0
  84. package/dist/runtime/cli-doctor-workspace-features-post-meta.js +77 -0
  85. package/dist/runtime/cli-doctor-workspace-features-rest.d.ts +11 -0
  86. package/dist/runtime/cli-doctor-workspace-features-rest.js +120 -0
  87. package/dist/runtime/cli-doctor-workspace-features.js +14 -369
  88. package/dist/runtime/cli-doctor-workspace-package.d.ts +25 -3
  89. package/dist/runtime/cli-doctor-workspace-package.js +35 -13
  90. package/dist/runtime/cli-doctor-workspace-shared.d.ts +2 -0
  91. package/dist/runtime/cli-doctor-workspace-shared.js +2 -0
  92. package/dist/runtime/cli-doctor-workspace.js +8 -3
  93. package/dist/runtime/cli-doctor.d.ts +52 -3
  94. package/dist/runtime/cli-doctor.js +79 -8
  95. package/dist/runtime/cli-help.js +10 -0
  96. package/dist/runtime/cli-init-package-json.js +4 -2
  97. package/dist/runtime/cli-init-templates.js +11 -1
  98. package/dist/runtime/cli-prompt.d.ts +16 -2
  99. package/dist/runtime/cli-prompt.js +29 -12
  100. package/dist/runtime/cli-scaffold.d.ts +2 -1
  101. package/dist/runtime/cli-scaffold.js +19 -10
  102. package/dist/runtime/contract-artifacts.d.ts +14 -0
  103. package/dist/runtime/contract-artifacts.js +15 -0
  104. package/dist/runtime/external-template-guards.js +4 -6
  105. package/dist/runtime/index.d.ts +2 -2
  106. package/dist/runtime/index.js +1 -1
  107. package/dist/runtime/json-utils.d.ts +62 -4
  108. package/dist/runtime/json-utils.js +78 -4
  109. package/dist/runtime/local-dev-presets.js +4 -1
  110. package/dist/runtime/migration-ui-capability.js +4 -1
  111. package/dist/runtime/migration-utils.js +4 -1
  112. package/dist/runtime/package-managers.js +6 -1
  113. package/dist/runtime/package-versions.js +6 -1
  114. package/dist/runtime/rest-resource-artifacts.d.ts +57 -1
  115. package/dist/runtime/rest-resource-artifacts.js +97 -1
  116. package/dist/runtime/scaffold-bootstrap.js +7 -2
  117. package/dist/runtime/scaffold-package-manager-files.js +5 -1
  118. package/dist/runtime/scaffold-repository-reference.js +4 -2
  119. package/dist/runtime/scaffold-template-variables.js +2 -1
  120. package/dist/runtime/scaffold.d.ts +18 -1
  121. package/dist/runtime/scaffold.js +55 -2
  122. package/dist/runtime/temp-roots.js +4 -1
  123. package/dist/runtime/template-layers.js +4 -1
  124. package/dist/runtime/template-registry.js +9 -3
  125. package/dist/runtime/template-render.d.ts +1 -1
  126. package/dist/runtime/template-render.js +1 -1
  127. package/dist/runtime/template-source-cache-markers.d.ts +37 -0
  128. package/dist/runtime/template-source-cache-markers.js +125 -0
  129. package/dist/runtime/template-source-cache.d.ts +1 -4
  130. package/dist/runtime/template-source-cache.js +16 -122
  131. package/dist/runtime/template-source-contracts.d.ts +2 -0
  132. package/dist/runtime/template-source-external.d.ts +4 -2
  133. package/dist/runtime/template-source-external.js +4 -2
  134. package/dist/runtime/template-source-normalization.js +2 -1
  135. package/dist/runtime/template-source-remote.d.ts +8 -4
  136. package/dist/runtime/template-source-remote.js +26 -9
  137. package/dist/runtime/template-source-seeds.js +10 -3
  138. package/dist/runtime/workspace-inventory-mutations.js +54 -4
  139. package/dist/runtime/workspace-inventory-parser-entries.d.ts +17 -0
  140. package/dist/runtime/workspace-inventory-parser-entries.js +157 -0
  141. package/dist/runtime/workspace-inventory-parser-validation.d.ts +104 -0
  142. package/dist/runtime/workspace-inventory-parser-validation.js +34 -0
  143. package/dist/runtime/workspace-inventory-parser.d.ts +3 -44
  144. package/dist/runtime/workspace-inventory-parser.js +7 -464
  145. package/dist/runtime/workspace-inventory-read.d.ts +9 -2
  146. package/dist/runtime/workspace-inventory-read.js +9 -2
  147. package/dist/runtime/workspace-inventory-section-descriptors.d.ts +19 -0
  148. package/dist/runtime/workspace-inventory-section-descriptors.js +435 -0
  149. package/dist/runtime/workspace-inventory-templates.d.ts +16 -1
  150. package/dist/runtime/workspace-inventory-templates.js +75 -4
  151. package/dist/runtime/workspace-inventory-types.d.ts +52 -2
  152. package/dist/runtime/workspace-inventory.d.ts +2 -2
  153. package/dist/runtime/workspace-inventory.js +1 -1
  154. package/dist/runtime/workspace-project.js +4 -6
  155. package/package.json +2 -2
@@ -0,0 +1,435 @@
1
+ import { MANUAL_REST_CONTRACT_AUTH_IDS, MANUAL_REST_CONTRACT_HTTP_METHOD_IDS, REST_RESOURCE_METHOD_IDS, } from "./cli-add-shared.js";
2
+ import { ABILITY_CONFIG_ENTRY_MARKER, ABILITIES_CONST_SECTION, ABILITIES_INTERFACE_SECTION, ADMIN_VIEW_CONFIG_ENTRY_MARKER, ADMIN_VIEWS_CONST_SECTION, ADMIN_VIEWS_INTERFACE_SECTION, AI_FEATURES_CONST_SECTION, AI_FEATURES_INTERFACE_SECTION, AI_FEATURE_CONFIG_ENTRY_MARKER, BINDING_SOURCES_CONST_SECTION, BINDING_SOURCES_INTERFACE_SECTION, BINDING_SOURCE_CONFIG_ENTRY_MARKER, BLOCK_CONFIG_ENTRY_MARKER, BLOCK_STYLES_CONST_SECTION, BLOCK_STYLES_INTERFACE_SECTION, BLOCK_STYLE_CONFIG_ENTRY_MARKER, BLOCK_TRANSFORMS_CONST_SECTION, BLOCK_TRANSFORMS_INTERFACE_SECTION, BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER, CONTRACTS_CONST_SECTION, CONTRACTS_INTERFACE_SECTION, CONTRACT_CONFIG_ENTRY_MARKER, EDITOR_PLUGINS_CONST_SECTION, EDITOR_PLUGINS_INTERFACE_SECTION, EDITOR_PLUGIN_CONFIG_ENTRY_MARKER, PATTERNS_CONST_SECTION, PATTERNS_INTERFACE_SECTION, PATTERN_CONFIG_ENTRY_MARKER, POST_META_CONFIG_ENTRY_MARKER, POST_META_CONST_SECTION, POST_META_INTERFACE_SECTION, REST_RESOURCES_CONST_SECTION, REST_RESOURCES_INTERFACE_SECTION, REST_RESOURCE_CONFIG_ENTRY_MARKER, VARIATIONS_CONST_SECTION, VARIATIONS_INTERFACE_SECTION, VARIATION_CONFIG_ENTRY_MARKER, } from "./workspace-inventory-templates.js";
3
+ import { defineInventoryEntryParser, } from "./workspace-inventory-parser-validation.js";
4
+ /**
5
+ * Descriptor for the required `BLOCKS` inventory section.
6
+ *
7
+ * Runtime readers use its `parse` contract to require the exported `BLOCKS`
8
+ * array and validate required block entry fields; mutation helpers use its
9
+ * `append` marker to insert generated block entries without duplicating section
10
+ * knowledge.
11
+ */
12
+ export const BLOCK_INVENTORY_SECTION = {
13
+ append: {
14
+ marker: BLOCK_CONFIG_ENTRY_MARKER,
15
+ optionKey: "blockEntries",
16
+ },
17
+ parse: {
18
+ entriesKey: "blocks",
19
+ entry: defineInventoryEntryParser()({
20
+ entryName: "BLOCKS",
21
+ fields: [
22
+ { key: "apiTypesFile" },
23
+ { key: "attributeTypeName" },
24
+ { key: "openApiFile" },
25
+ { key: "slug", required: true },
26
+ { key: "typesFile", required: true },
27
+ ],
28
+ }),
29
+ exportName: "BLOCKS",
30
+ required: true,
31
+ },
32
+ };
33
+ /**
34
+ * Descriptors for optional workspace inventory sections beyond `BLOCKS`.
35
+ *
36
+ * Each descriptor centralizes append markers, exported interface/value repair
37
+ * sections, parser entry metadata such as `entriesKey` and `entryName`, and
38
+ * optional section flags so add, doctor, read, and mutation flows share one
39
+ * runtime contract when adding new inventory domains.
40
+ */
41
+ export const INVENTORY_SECTIONS = [
42
+ {
43
+ append: {
44
+ marker: VARIATION_CONFIG_ENTRY_MARKER,
45
+ optionKey: "variationEntries",
46
+ },
47
+ interface: {
48
+ name: "WorkspaceVariationConfig",
49
+ section: VARIATIONS_INTERFACE_SECTION,
50
+ },
51
+ parse: {
52
+ entriesKey: "variations",
53
+ entry: defineInventoryEntryParser()({
54
+ entryName: "VARIATIONS",
55
+ fields: [
56
+ { key: "block", required: true },
57
+ { key: "file", required: true },
58
+ { key: "slug", required: true },
59
+ ],
60
+ }),
61
+ hasSectionKey: "hasVariationsSection",
62
+ },
63
+ value: {
64
+ name: "VARIATIONS",
65
+ section: VARIATIONS_CONST_SECTION,
66
+ },
67
+ },
68
+ {
69
+ append: {
70
+ marker: BLOCK_STYLE_CONFIG_ENTRY_MARKER,
71
+ optionKey: "blockStyleEntries",
72
+ },
73
+ interface: {
74
+ name: "WorkspaceBlockStyleConfig",
75
+ section: BLOCK_STYLES_INTERFACE_SECTION,
76
+ },
77
+ parse: {
78
+ entriesKey: "blockStyles",
79
+ entry: defineInventoryEntryParser()({
80
+ entryName: "BLOCK_STYLES",
81
+ fields: [
82
+ { key: "block", required: true },
83
+ { key: "file", required: true },
84
+ { key: "slug", required: true },
85
+ ],
86
+ }),
87
+ hasSectionKey: "hasBlockStylesSection",
88
+ },
89
+ value: {
90
+ name: "BLOCK_STYLES",
91
+ section: BLOCK_STYLES_CONST_SECTION,
92
+ },
93
+ },
94
+ {
95
+ append: {
96
+ marker: BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER,
97
+ optionKey: "blockTransformEntries",
98
+ },
99
+ interface: {
100
+ name: "WorkspaceBlockTransformConfig",
101
+ section: BLOCK_TRANSFORMS_INTERFACE_SECTION,
102
+ },
103
+ parse: {
104
+ entriesKey: "blockTransforms",
105
+ entry: defineInventoryEntryParser()({
106
+ entryName: "BLOCK_TRANSFORMS",
107
+ fields: [
108
+ { key: "block", required: true },
109
+ { key: "file", required: true },
110
+ { key: "from", required: true },
111
+ { key: "slug", required: true },
112
+ { key: "to", required: true },
113
+ ],
114
+ }),
115
+ hasSectionKey: "hasBlockTransformsSection",
116
+ },
117
+ value: {
118
+ name: "BLOCK_TRANSFORMS",
119
+ section: BLOCK_TRANSFORMS_CONST_SECTION,
120
+ },
121
+ },
122
+ {
123
+ append: {
124
+ marker: PATTERN_CONFIG_ENTRY_MARKER,
125
+ optionKey: "patternEntries",
126
+ },
127
+ interface: {
128
+ name: "WorkspacePatternConfig",
129
+ section: PATTERNS_INTERFACE_SECTION,
130
+ },
131
+ parse: {
132
+ entriesKey: "patterns",
133
+ entry: defineInventoryEntryParser()({
134
+ entryName: "PATTERNS",
135
+ fields: [
136
+ { key: "file", required: true },
137
+ { key: "slug", required: true },
138
+ ],
139
+ }),
140
+ hasSectionKey: "hasPatternsSection",
141
+ },
142
+ value: {
143
+ name: "PATTERNS",
144
+ section: PATTERNS_CONST_SECTION,
145
+ },
146
+ },
147
+ {
148
+ append: {
149
+ marker: BINDING_SOURCE_CONFIG_ENTRY_MARKER,
150
+ optionKey: "bindingSourceEntries",
151
+ },
152
+ interface: {
153
+ name: "WorkspaceBindingSourceConfig",
154
+ section: BINDING_SOURCES_INTERFACE_SECTION,
155
+ },
156
+ parse: {
157
+ entriesKey: "bindingSources",
158
+ entry: defineInventoryEntryParser()({
159
+ entryName: "BINDING_SOURCES",
160
+ fields: [
161
+ { key: "attribute" },
162
+ { key: "block" },
163
+ { key: "editorFile", required: true },
164
+ { key: "serverFile", required: true },
165
+ { key: "slug", required: true },
166
+ ],
167
+ }),
168
+ hasSectionKey: "hasBindingSourcesSection",
169
+ },
170
+ value: {
171
+ name: "BINDING_SOURCES",
172
+ section: BINDING_SOURCES_CONST_SECTION,
173
+ },
174
+ },
175
+ {
176
+ append: {
177
+ marker: CONTRACT_CONFIG_ENTRY_MARKER,
178
+ optionKey: "contractEntries",
179
+ },
180
+ interface: {
181
+ name: "WorkspaceContractConfig",
182
+ section: CONTRACTS_INTERFACE_SECTION,
183
+ },
184
+ parse: {
185
+ entriesKey: "contracts",
186
+ entry: defineInventoryEntryParser()({
187
+ entryName: "CONTRACTS",
188
+ fields: [
189
+ { key: "schemaFile", required: true },
190
+ { key: "slug", required: true },
191
+ { key: "sourceTypeName", required: true },
192
+ { key: "typesFile", required: true },
193
+ ],
194
+ }),
195
+ hasSectionKey: "hasContractsSection",
196
+ },
197
+ value: {
198
+ name: "CONTRACTS",
199
+ section: CONTRACTS_CONST_SECTION,
200
+ },
201
+ },
202
+ {
203
+ append: {
204
+ marker: REST_RESOURCE_CONFIG_ENTRY_MARKER,
205
+ optionKey: "restResourceEntries",
206
+ },
207
+ interface: {
208
+ name: "WorkspaceRestResourceConfig",
209
+ section: REST_RESOURCES_INTERFACE_SECTION,
210
+ },
211
+ parse: {
212
+ entriesKey: "restResources",
213
+ entry: defineInventoryEntryParser()({
214
+ entryName: "REST_RESOURCES",
215
+ fields: [
216
+ { key: "apiFile", required: true },
217
+ {
218
+ key: "auth",
219
+ validate: (value, context) => {
220
+ if (typeof value === "string" &&
221
+ !MANUAL_REST_CONTRACT_AUTH_IDS.includes(value)) {
222
+ throw new Error(`${context.entryName}[${context.elementIndex}].${context.key} must be one of: ${MANUAL_REST_CONTRACT_AUTH_IDS.join(", ")}.`);
223
+ }
224
+ },
225
+ },
226
+ { key: "bodyTypeName" },
227
+ { key: "clientFile", required: true },
228
+ { key: "controllerClass" },
229
+ { key: "controllerExtends" },
230
+ { key: "dataFile" },
231
+ {
232
+ key: "method",
233
+ validate: (value, context) => {
234
+ if (typeof value === "string" &&
235
+ !MANUAL_REST_CONTRACT_HTTP_METHOD_IDS.includes(value)) {
236
+ throw new Error(`${context.entryName}[${context.elementIndex}].${context.key} must be one of: ${MANUAL_REST_CONTRACT_HTTP_METHOD_IDS.join(", ")}.`);
237
+ }
238
+ },
239
+ },
240
+ {
241
+ key: "methods",
242
+ kind: "stringArray",
243
+ required: true,
244
+ validate: (value, context) => {
245
+ const methods = Array.isArray(value) ? value : [];
246
+ const invalidMethods = methods.filter((method) => !REST_RESOURCE_METHOD_IDS.includes(method));
247
+ if (invalidMethods.length > 0) {
248
+ throw new Error(`${context.entryName}[${context.elementIndex}].${context.key} includes unsupported values: ${invalidMethods.join(", ")}.`);
249
+ }
250
+ },
251
+ },
252
+ {
253
+ key: "mode",
254
+ validate: (value, context) => {
255
+ if (typeof value === "string" &&
256
+ value !== "generated" &&
257
+ value !== "manual") {
258
+ throw new Error(`${context.entryName}[${context.elementIndex}].${context.key} must be generated or manual.`);
259
+ }
260
+ },
261
+ },
262
+ { key: "namespace", required: true },
263
+ { key: "openApiFile", required: true },
264
+ { key: "pathPattern" },
265
+ { key: "permissionCallback" },
266
+ { key: "phpFile" },
267
+ { key: "queryTypeName" },
268
+ { key: "responseTypeName" },
269
+ { key: "routePattern" },
270
+ { key: "secretFieldName" },
271
+ { key: "secretPreserveOnEmpty", kind: "boolean" },
272
+ { key: "secretStateFieldName" },
273
+ { key: "slug", required: true },
274
+ { key: "typesFile", required: true },
275
+ { key: "validatorsFile", required: true },
276
+ ],
277
+ }),
278
+ hasSectionKey: "hasRestResourcesSection",
279
+ },
280
+ value: {
281
+ name: "REST_RESOURCES",
282
+ section: REST_RESOURCES_CONST_SECTION,
283
+ },
284
+ },
285
+ {
286
+ append: {
287
+ marker: POST_META_CONFIG_ENTRY_MARKER,
288
+ optionKey: "postMetaEntries",
289
+ },
290
+ interface: {
291
+ name: "WorkspacePostMetaConfig",
292
+ section: POST_META_INTERFACE_SECTION,
293
+ },
294
+ parse: {
295
+ entriesKey: "postMeta",
296
+ entry: defineInventoryEntryParser()({
297
+ entryName: "POST_META",
298
+ fields: [
299
+ { key: "metaKey", required: true },
300
+ { key: "phpFile", required: true },
301
+ { key: "postType", required: true },
302
+ { key: "schemaFile", required: true },
303
+ { key: "showInRest", kind: "boolean", required: true },
304
+ { key: "slug", required: true },
305
+ { key: "sourceTypeName", required: true },
306
+ { key: "typesFile", required: true },
307
+ ],
308
+ }),
309
+ hasSectionKey: "hasPostMetaSection",
310
+ },
311
+ value: {
312
+ name: "POST_META",
313
+ section: POST_META_CONST_SECTION,
314
+ },
315
+ },
316
+ {
317
+ append: {
318
+ marker: ABILITY_CONFIG_ENTRY_MARKER,
319
+ optionKey: "abilityEntries",
320
+ },
321
+ interface: {
322
+ name: "WorkspaceAbilityConfig",
323
+ section: ABILITIES_INTERFACE_SECTION,
324
+ },
325
+ parse: {
326
+ entriesKey: "abilities",
327
+ entry: defineInventoryEntryParser()({
328
+ entryName: "ABILITIES",
329
+ fields: [
330
+ { key: "clientFile", required: true },
331
+ { key: "configFile", required: true },
332
+ { key: "dataFile", required: true },
333
+ { key: "inputSchemaFile", required: true },
334
+ { key: "inputTypeName", required: true },
335
+ { key: "outputSchemaFile", required: true },
336
+ { key: "outputTypeName", required: true },
337
+ { key: "phpFile", required: true },
338
+ { key: "slug", required: true },
339
+ { key: "typesFile", required: true },
340
+ ],
341
+ }),
342
+ hasSectionKey: "hasAbilitiesSection",
343
+ },
344
+ value: {
345
+ name: "ABILITIES",
346
+ section: ABILITIES_CONST_SECTION,
347
+ },
348
+ },
349
+ {
350
+ append: {
351
+ marker: AI_FEATURE_CONFIG_ENTRY_MARKER,
352
+ optionKey: "aiFeatureEntries",
353
+ },
354
+ interface: {
355
+ name: "WorkspaceAiFeatureConfig",
356
+ section: AI_FEATURES_INTERFACE_SECTION,
357
+ },
358
+ parse: {
359
+ entriesKey: "aiFeatures",
360
+ entry: defineInventoryEntryParser()({
361
+ entryName: "AI_FEATURES",
362
+ fields: [
363
+ { key: "aiSchemaFile", required: true },
364
+ { key: "apiFile", required: true },
365
+ { key: "clientFile", required: true },
366
+ { key: "dataFile", required: true },
367
+ { key: "namespace", required: true },
368
+ { key: "openApiFile", required: true },
369
+ { key: "phpFile", required: true },
370
+ { key: "slug", required: true },
371
+ { key: "typesFile", required: true },
372
+ { key: "validatorsFile", required: true },
373
+ ],
374
+ }),
375
+ hasSectionKey: "hasAiFeaturesSection",
376
+ },
377
+ value: {
378
+ name: "AI_FEATURES",
379
+ section: AI_FEATURES_CONST_SECTION,
380
+ },
381
+ },
382
+ {
383
+ append: {
384
+ marker: ADMIN_VIEW_CONFIG_ENTRY_MARKER,
385
+ optionKey: "adminViewEntries",
386
+ },
387
+ interface: {
388
+ name: "WorkspaceAdminViewConfig",
389
+ section: ADMIN_VIEWS_INTERFACE_SECTION,
390
+ },
391
+ parse: {
392
+ entriesKey: "adminViews",
393
+ entry: defineInventoryEntryParser()({
394
+ entryName: "ADMIN_VIEWS",
395
+ fields: [
396
+ { key: "file", required: true },
397
+ { key: "phpFile", required: true },
398
+ { key: "slug", required: true },
399
+ { key: "source" },
400
+ ],
401
+ }),
402
+ hasSectionKey: "hasAdminViewsSection",
403
+ },
404
+ value: {
405
+ name: "ADMIN_VIEWS",
406
+ section: ADMIN_VIEWS_CONST_SECTION,
407
+ },
408
+ },
409
+ {
410
+ append: {
411
+ marker: EDITOR_PLUGIN_CONFIG_ENTRY_MARKER,
412
+ optionKey: "editorPluginEntries",
413
+ },
414
+ interface: {
415
+ name: "WorkspaceEditorPluginConfig",
416
+ section: EDITOR_PLUGINS_INTERFACE_SECTION,
417
+ },
418
+ parse: {
419
+ entriesKey: "editorPlugins",
420
+ entry: defineInventoryEntryParser()({
421
+ entryName: "EDITOR_PLUGINS",
422
+ fields: [
423
+ { key: "file", required: true },
424
+ { key: "slug", required: true },
425
+ { key: "slot", required: true },
426
+ ],
427
+ }),
428
+ hasSectionKey: "hasEditorPluginsSection",
429
+ },
430
+ value: {
431
+ name: "EDITOR_PLUGINS",
432
+ section: EDITOR_PLUGINS_CONST_SECTION,
433
+ },
434
+ },
435
+ ];
@@ -4,7 +4,12 @@ export declare const BLOCK_STYLE_CONFIG_ENTRY_MARKER = "\t// wp-typia add style
4
4
  export declare const BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER = "\t// wp-typia add transform entries";
5
5
  export declare const PATTERN_CONFIG_ENTRY_MARKER = "\t// wp-typia add pattern entries";
6
6
  export declare const BINDING_SOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add binding-source entries";
7
+ export declare const CONTRACT_CONFIG_ENTRY_MARKER = "\t// wp-typia add contract entries";
7
8
  export declare const REST_RESOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add rest-resource entries";
9
+ /**
10
+ * Marker used to append generated post-meta entries into `POST_META`.
11
+ */
12
+ export declare const POST_META_CONFIG_ENTRY_MARKER = "\t// wp-typia add post-meta entries";
8
13
  export declare const ABILITY_CONFIG_ENTRY_MARKER = "\t// wp-typia add ability entries";
9
14
  export declare const AI_FEATURE_CONFIG_ENTRY_MARKER = "\t// wp-typia add ai-feature entries";
10
15
  export declare const ADMIN_VIEW_CONFIG_ENTRY_MARKER = "\t// wp-typia add admin-view entries";
@@ -22,8 +27,18 @@ export declare const PATTERNS_INTERFACE_SECTION = "\n\nexport interface Workspac
22
27
  export declare const PATTERNS_CONST_SECTION = "\n\nexport const PATTERNS: WorkspacePatternConfig[] = [\n\t// wp-typia add pattern entries\n];\n";
23
28
  export declare const BINDING_SOURCES_INTERFACE_SECTION = "\n\nexport interface WorkspaceBindingSourceConfig {\n\tattribute?: string;\n\tblock?: string;\n\teditorFile: string;\n\tserverFile: string;\n\tslug: string;\n}\n";
24
29
  export declare const BINDING_SOURCES_CONST_SECTION = "\n\nexport const BINDING_SOURCES: WorkspaceBindingSourceConfig[] = [\n\t// wp-typia add binding-source entries\n];\n";
25
- export declare const REST_RESOURCES_INTERFACE_SECTION = "\n\nexport interface WorkspaceRestResourceConfig {\n\tapiFile: string;\n\tclientFile: string;\n\tdataFile: string;\n\tmethods: Array< 'list' | 'read' | 'create' | 'update' | 'delete' >;\n\tnamespace: string;\n\topenApiFile: string;\n\tphpFile: string;\n\trestManifest?: ReturnType<\n\t\ttypeof import( '@wp-typia/block-runtime/metadata-core' ).defineEndpointManifest\n\t>;\n\tslug: string;\n\ttypesFile: string;\n\tvalidatorsFile: string;\n}\n";
30
+ export declare const CONTRACTS_INTERFACE_SECTION = "\n\nexport interface WorkspaceContractConfig {\n\tschemaFile: string;\n\tslug: string;\n\tsourceTypeName: string;\n\ttypesFile: string;\n}\n";
31
+ export declare const CONTRACTS_CONST_SECTION = "\n\nexport const CONTRACTS: WorkspaceContractConfig[] = [\n\t// wp-typia add contract entries\n];\n";
32
+ export declare const REST_RESOURCES_INTERFACE_SECTION = "\n\nexport interface WorkspaceRestResourceBaseConfig {\n\tapiFile: string;\n\tauth?: 'authenticated' | 'public' | 'public-write-protected';\n\tbodyTypeName?: string;\n\tclientFile: string;\n\tcontrollerClass?: string;\n\tcontrollerExtends?: string;\n\tnamespace: string;\n\topenApiFile: string;\n\tpermissionCallback?: string;\n\trestManifest?: ReturnType<\n\t\ttypeof import( '@wp-typia/block-runtime/metadata-core' ).defineEndpointManifest\n\t>;\n\tsecretFieldName?: string;\n\tsecretPreserveOnEmpty?: boolean;\n\tsecretStateFieldName?: string;\n\tslug: string;\n\ttypesFile: string;\n\tvalidatorsFile: string;\n}\n\nexport interface GeneratedWorkspaceRestResourceConfig extends WorkspaceRestResourceBaseConfig {\n\tdataFile: string;\n\tmethods: Array< 'list' | 'read' | 'create' | 'update' | 'delete' >;\n\tmode?: 'generated';\n\tphpFile: string;\n\troutePattern?: string;\n}\n\nexport interface ManualWorkspaceRestResourceConfig extends WorkspaceRestResourceBaseConfig {\n\tmethod: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT';\n\tmethods: [];\n\tmode: 'manual';\n\tpathPattern: string;\n\tqueryTypeName: string;\n\tresponseTypeName: string;\n}\n\nexport type WorkspaceRestResourceConfig =\n\t| GeneratedWorkspaceRestResourceConfig\n\t| ManualWorkspaceRestResourceConfig;\n";
26
33
  export declare const REST_RESOURCES_CONST_SECTION = "\n\nexport const REST_RESOURCES: WorkspaceRestResourceConfig[] = [\n\t// wp-typia add rest-resource entries\n];\n";
34
+ /**
35
+ * Template inserted when repairing `WorkspacePostMetaConfig` in block-config.
36
+ */
37
+ export declare const POST_META_INTERFACE_SECTION = "\n\nexport interface WorkspacePostMetaConfig {\n\tmetaKey: string;\n\tphpFile: string;\n\tpostType: string;\n\tschemaFile: string;\n\tshowInRest: boolean;\n\tslug: string;\n\tsourceTypeName: string;\n\ttypesFile: string;\n}\n";
38
+ /**
39
+ * Template inserted when repairing the `POST_META` inventory array.
40
+ */
41
+ export declare const POST_META_CONST_SECTION = "\n\nexport const POST_META: WorkspacePostMetaConfig[] = [\n\t// wp-typia add post-meta entries\n];\n";
27
42
  export declare const WORKSPACE_COMPATIBILITY_CONFIG_FIELD = "\tcompatibility?: {\n\t\thardMinimums: {\n\t\t\tphp?: string;\n\t\t\twordpress?: string;\n\t\t};\n\t\tmode: 'baseline' | 'optional' | 'required';\n\t\toptionalFeatureIds: string[];\n\t\toptionalFeatures: string[];\n\t\trequiredFeatureIds: string[];\n\t\trequiredFeatures: string[];\n\t\truntimeGates: string[];\n\t};\n";
28
43
  export declare const ABILITIES_INTERFACE_SECTION = "\n\nexport interface WorkspaceAbilityConfig {\n\tclientFile: string;\n\tcompatibility?: {\n\t\thardMinimums: {\n\t\t\tphp?: string;\n\t\t\twordpress?: string;\n\t\t};\n\t\tmode: 'baseline' | 'optional' | 'required';\n\t\toptionalFeatureIds: string[];\n\t\toptionalFeatures: string[];\n\t\trequiredFeatureIds: string[];\n\t\trequiredFeatures: string[];\n\t\truntimeGates: string[];\n\t};\n\tconfigFile: string;\n\tdataFile: string;\n\tinputSchemaFile: string;\n\tinputTypeName: string;\n\toutputSchemaFile: string;\n\toutputTypeName: string;\n\tphpFile: string;\n\tslug: string;\n\ttypesFile: string;\n}\n";
29
44
  export declare const ABILITIES_CONST_SECTION = "\n\nexport const ABILITIES: WorkspaceAbilityConfig[] = [\n\t// wp-typia add ability entries\n];\n";
@@ -4,7 +4,12 @@ export const BLOCK_STYLE_CONFIG_ENTRY_MARKER = "\t// wp-typia add style entries"
4
4
  export const BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER = "\t// wp-typia add transform entries";
5
5
  export const PATTERN_CONFIG_ENTRY_MARKER = "\t// wp-typia add pattern entries";
6
6
  export const BINDING_SOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add binding-source entries";
7
+ export const CONTRACT_CONFIG_ENTRY_MARKER = "\t// wp-typia add contract entries";
7
8
  export const REST_RESOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add rest-resource entries";
9
+ /**
10
+ * Marker used to append generated post-meta entries into `POST_META`.
11
+ */
12
+ export const POST_META_CONFIG_ENTRY_MARKER = "\t// wp-typia add post-meta entries";
8
13
  export const ABILITY_CONFIG_ENTRY_MARKER = "\t// wp-typia add ability entries";
9
14
  export const AI_FEATURE_CONFIG_ENTRY_MARKER = "\t// wp-typia add ai-feature entries";
10
15
  export const ADMIN_VIEW_CONFIG_ENTRY_MARKER = "\t// wp-typia add admin-view entries";
@@ -85,23 +90,64 @@ export const BINDING_SOURCES: WorkspaceBindingSourceConfig[] = [
85
90
  \t// wp-typia add binding-source entries
86
91
  ];
87
92
  `;
93
+ export const CONTRACTS_INTERFACE_SECTION = `
94
+
95
+ export interface WorkspaceContractConfig {
96
+ \tschemaFile: string;
97
+ \tslug: string;
98
+ \tsourceTypeName: string;
99
+ \ttypesFile: string;
100
+ }
101
+ `;
102
+ export const CONTRACTS_CONST_SECTION = `
103
+
104
+ export const CONTRACTS: WorkspaceContractConfig[] = [
105
+ \t// wp-typia add contract entries
106
+ ];
107
+ `;
88
108
  export const REST_RESOURCES_INTERFACE_SECTION = `
89
109
 
90
- export interface WorkspaceRestResourceConfig {
110
+ export interface WorkspaceRestResourceBaseConfig {
91
111
  \tapiFile: string;
112
+ \tauth?: 'authenticated' | 'public' | 'public-write-protected';
113
+ \tbodyTypeName?: string;
92
114
  \tclientFile: string;
93
- \tdataFile: string;
94
- \tmethods: Array< 'list' | 'read' | 'create' | 'update' | 'delete' >;
115
+ \tcontrollerClass?: string;
116
+ \tcontrollerExtends?: string;
95
117
  \tnamespace: string;
96
118
  \topenApiFile: string;
97
- \tphpFile: string;
119
+ \tpermissionCallback?: string;
98
120
  \trestManifest?: ReturnType<
99
121
  \t\ttypeof import( '@wp-typia/block-runtime/metadata-core' ).defineEndpointManifest
100
122
  \t>;
123
+ \tsecretFieldName?: string;
124
+ \tsecretPreserveOnEmpty?: boolean;
125
+ \tsecretStateFieldName?: string;
101
126
  \tslug: string;
102
127
  \ttypesFile: string;
103
128
  \tvalidatorsFile: string;
104
129
  }
130
+
131
+ export interface GeneratedWorkspaceRestResourceConfig extends WorkspaceRestResourceBaseConfig {
132
+ \tdataFile: string;
133
+ \tmethods: Array< 'list' | 'read' | 'create' | 'update' | 'delete' >;
134
+ \tmode?: 'generated';
135
+ \tphpFile: string;
136
+ \troutePattern?: string;
137
+ }
138
+
139
+ export interface ManualWorkspaceRestResourceConfig extends WorkspaceRestResourceBaseConfig {
140
+ \tmethod: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT';
141
+ \tmethods: [];
142
+ \tmode: 'manual';
143
+ \tpathPattern: string;
144
+ \tqueryTypeName: string;
145
+ \tresponseTypeName: string;
146
+ }
147
+
148
+ export type WorkspaceRestResourceConfig =
149
+ \t| GeneratedWorkspaceRestResourceConfig
150
+ \t| ManualWorkspaceRestResourceConfig;
105
151
  `;
106
152
  export const REST_RESOURCES_CONST_SECTION = `
107
153
 
@@ -109,6 +155,31 @@ export const REST_RESOURCES: WorkspaceRestResourceConfig[] = [
109
155
  \t// wp-typia add rest-resource entries
110
156
  ];
111
157
  `;
158
+ /**
159
+ * Template inserted when repairing `WorkspacePostMetaConfig` in block-config.
160
+ */
161
+ export const POST_META_INTERFACE_SECTION = `
162
+
163
+ export interface WorkspacePostMetaConfig {
164
+ \tmetaKey: string;
165
+ \tphpFile: string;
166
+ \tpostType: string;
167
+ \tschemaFile: string;
168
+ \tshowInRest: boolean;
169
+ \tslug: string;
170
+ \tsourceTypeName: string;
171
+ \ttypesFile: string;
172
+ }
173
+ `;
174
+ /**
175
+ * Template inserted when repairing the `POST_META` inventory array.
176
+ */
177
+ export const POST_META_CONST_SECTION = `
178
+
179
+ export const POST_META: WorkspacePostMetaConfig[] = [
180
+ \t// wp-typia add post-meta entries
181
+ ];
182
+ `;
112
183
  export const WORKSPACE_COMPATIBILITY_CONFIG_FIELD = `\tcompatibility?: {
113
184
  \t\thardMinimums: {
114
185
  \t\t\tphp?: string;
@@ -33,6 +33,19 @@ export interface WorkspaceBindingSourceInventoryEntry {
33
33
  serverFile: string;
34
34
  slug: string;
35
35
  }
36
+ /**
37
+ * Standalone TypeScript contract entry parsed from `scripts/block-config.ts`.
38
+ *
39
+ * These contracts generate JSON Schema artifacts without owning a WordPress REST
40
+ * route, so smoke tests and external integrations can reference stable schema
41
+ * names from the workspace inventory.
42
+ */
43
+ export interface WorkspaceContractInventoryEntry {
44
+ schemaFile: string;
45
+ slug: string;
46
+ sourceTypeName: string;
47
+ typesFile: string;
48
+ }
36
49
  /**
37
50
  * REST-resource entry parsed from `scripts/block-config.ts`.
38
51
  *
@@ -42,16 +55,47 @@ export interface WorkspaceBindingSourceInventoryEntry {
42
55
  */
43
56
  export interface WorkspaceRestResourceInventoryEntry {
44
57
  apiFile: string;
58
+ auth?: string;
59
+ bodyTypeName?: string;
45
60
  clientFile: string;
46
- dataFile: string;
61
+ controllerClass?: string;
62
+ controllerExtends?: string;
63
+ dataFile?: string;
64
+ method?: string;
47
65
  methods: string[];
66
+ mode?: "generated" | "manual";
48
67
  namespace: string;
49
68
  openApiFile: string;
50
- phpFile: string;
69
+ pathPattern?: string;
70
+ permissionCallback?: string;
71
+ phpFile?: string;
72
+ queryTypeName?: string;
73
+ responseTypeName?: string;
74
+ routePattern?: string;
75
+ secretFieldName?: string;
76
+ secretPreserveOnEmpty?: boolean;
77
+ secretStateFieldName?: string;
51
78
  slug: string;
52
79
  typesFile: string;
53
80
  validatorsFile: string;
54
81
  }
82
+ /**
83
+ * Post-meta contract entry parsed from `scripts/block-config.ts`.
84
+ *
85
+ * The TypeScript source and schema artifact define the persisted meta value
86
+ * shape, while the PHP file registers the matching WordPress post-meta key for
87
+ * the declared post type scope.
88
+ */
89
+ export interface WorkspacePostMetaInventoryEntry {
90
+ metaKey: string;
91
+ phpFile: string;
92
+ postType: string;
93
+ schemaFile: string;
94
+ showInRest: boolean;
95
+ slug: string;
96
+ sourceTypeName: string;
97
+ typesFile: string;
98
+ }
55
99
  /**
56
100
  * Ability entry parsed from `scripts/block-config.ts`.
57
101
  *
@@ -124,6 +168,7 @@ export interface WorkspaceInventory {
124
168
  blocks: WorkspaceBlockInventoryEntry[];
125
169
  blockStyles: WorkspaceBlockStyleInventoryEntry[];
126
170
  blockTransforms: WorkspaceBlockTransformInventoryEntry[];
171
+ contracts: WorkspaceContractInventoryEntry[];
127
172
  abilities: WorkspaceAbilityInventoryEntry[];
128
173
  aiFeatures: WorkspaceAiFeatureInventoryEntry[];
129
174
  hasAbilitiesSection: boolean;
@@ -132,12 +177,15 @@ export interface WorkspaceInventory {
132
177
  hasAiFeaturesSection: boolean;
133
178
  hasBlockStylesSection: boolean;
134
179
  hasBlockTransformsSection: boolean;
180
+ hasContractsSection: boolean;
135
181
  hasEditorPluginsSection: boolean;
136
182
  hasPatternsSection: boolean;
183
+ hasPostMetaSection: boolean;
137
184
  hasRestResourcesSection: boolean;
138
185
  hasVariationsSection: boolean;
139
186
  editorPlugins: WorkspaceEditorPluginInventoryEntry[];
140
187
  patterns: WorkspacePatternInventoryEntry[];
188
+ postMeta: WorkspacePostMetaInventoryEntry[];
141
189
  restResources: WorkspaceRestResourceInventoryEntry[];
142
190
  source: string;
143
191
  variations: WorkspaceVariationInventoryEntry[];
@@ -162,8 +210,10 @@ export type WorkspaceInventoryUpdateOptions = {
162
210
  blockStyleEntries?: string[];
163
211
  blockTransformEntries?: string[];
164
212
  bindingSourceEntries?: string[];
213
+ contractEntries?: string[];
165
214
  editorPluginEntries?: string[];
166
215
  patternEntries?: string[];
216
+ postMetaEntries?: string[];
167
217
  restResourceEntries?: string[];
168
218
  transformSource?: (source: string) => string;
169
219
  variationEntries?: string[];