@wix/agent-skills 1.36.0 → 1.36.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 (776) hide show
  1. package/package.json +8 -3
  2. package/skills/wix-headless-kit/install/pins.json +1 -1
  3. package/skills/wix-manage/SKILL.md +3 -3
  4. package/skills/wix-manage/references/cms/cms-data-items-crud.md +78 -1
  5. package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +11 -11
  6. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +20 -51
  7. package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +4 -4
  8. package/skills/wix-base44-connector/SKILL.md +0 -437
  9. package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +0 -78
  10. package/skills/wix-base44-connector/scripts/utils.cjs +0 -466
  11. package/skills/wix-export/SKILL.md +0 -83
  12. package/skills/wix-harmony-editor/.publish-manifest.json +0 -8
  13. package/skills/wix-harmony-editor/COPY-SITE.md +0 -494
  14. package/skills/wix-harmony-editor/SKILL.md +0 -317
  15. package/skills/wix-harmony-editor/scripts/copy/build-description.mjs +0 -249
  16. package/skills/wix-harmony-editor/scripts/copy/check-description.mjs +0 -225
  17. package/skills/wix-harmony-editor/scripts/copy/check-mirror.mjs +0 -89
  18. package/skills/wix-harmony-editor/scripts/copy/compare-preview.mjs +0 -76
  19. package/skills/wix-harmony-editor/scripts/copy/deploy-description.mjs +0 -212
  20. package/skills/wix-harmony-editor/scripts/copy/desc-hash.mjs +0 -44
  21. package/skills/wix-harmony-editor/scripts/copy/editor-run.mjs +0 -45
  22. package/skills/wix-harmony-editor/scripts/copy/export-page.mjs +0 -53
  23. package/skills/wix-harmony-editor/scripts/copy/find-interactions.mjs +0 -76
  24. package/skills/wix-harmony-editor/scripts/copy/hide-scrollbars.mjs +0 -16
  25. package/skills/wix-harmony-editor/scripts/copy/import-media.mjs +0 -150
  26. package/skills/wix-harmony-editor/scripts/copy/link-url.mjs +0 -27
  27. package/skills/wix-harmony-editor/scripts/copy/lint-api.mjs +0 -56
  28. package/skills/wix-harmony-editor/scripts/copy/measure-source.mjs +0 -211
  29. package/skills/wix-harmony-editor/scripts/copy/merge-mirrors.mjs +0 -29
  30. package/skills/wix-harmony-editor/scripts/copy/mirror-site.mjs +0 -92
  31. package/skills/wix-harmony-editor/scripts/copy/mobile-stage.mjs +0 -56
  32. package/skills/wix-harmony-editor/scripts/copy/preview-widths.mjs +0 -73
  33. package/skills/wix-harmony-editor/scripts/copy/render-plate.mjs +0 -67
  34. package/skills/wix-harmony-editor/scripts/copy/serve-mirror.mjs +0 -102
  35. package/skills/wix-harmony-editor/scripts/copy/snapshot-capabilities.mjs +0 -40
  36. package/skills/wix-harmony-editor/scripts/copy/split-sections.mjs +0 -191
  37. package/skills/wix-harmony-editor/scripts/copy/upload-media-manager.mjs +0 -61
  38. package/skills/wix-harmony-editor/scripts/launch.sh +0 -359
  39. package/skills/wix-headless/SKILL.md +0 -151
  40. package/skills/wix-headless/references/AI_FEATURES.md +0 -178
  41. package/skills/wix-headless/references/CAPABILITIES.md +0 -117
  42. package/skills/wix-headless/references/CONTENT.md +0 -36
  43. package/skills/wix-headless/references/DESIGN.md +0 -55
  44. package/skills/wix-headless/references/DISCOVERY.md +0 -80
  45. package/skills/wix-headless/references/DOC_DISCOVERY.md +0 -43
  46. package/skills/wix-headless/references/FEEDBACK.md +0 -129
  47. package/skills/wix-headless/references/IMAGE_GENERATION.md +0 -80
  48. package/skills/wix-headless/references/SDK_HANDOFF.md +0 -108
  49. package/skills/wix-headless/references/SEED.md +0 -74
  50. package/skills/wix-headless/references/SETUP.md +0 -60
  51. package/skills/wix-headless/references/astro.md +0 -98
  52. package/skills/wix-headless/references/inline-recipes/experience-donations.md +0 -102
  53. package/skills/wix-headless/references/inline-recipes/experience-store.md +0 -49
  54. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +0 -196
  55. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +0 -590
  56. package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +0 -279
  57. package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +0 -163
  58. package/skills/wix-headless/references/inline-recipes/how-to-code-donations.md +0 -146
  59. package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +0 -203
  60. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +0 -696
  61. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +0 -124
  62. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +0 -160
  63. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +0 -118
  64. package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +0 -132
  65. package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +0 -126
  66. package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +0 -254
  67. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +0 -191
  68. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +0 -213
  69. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +0 -161
  70. package/skills/wix-headless/references/inline-recipes/setup-blog.md +0 -175
  71. package/skills/wix-headless/references/inline-recipes/setup-bookings.md +0 -232
  72. package/skills/wix-headless/references/inline-recipes/setup-cms.md +0 -200
  73. package/skills/wix-headless/references/inline-recipes/setup-donations.md +0 -15
  74. package/skills/wix-headless/references/inline-recipes/setup-events.md +0 -196
  75. package/skills/wix-headless/references/inline-recipes/setup-forms.md +0 -288
  76. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +0 -214
  77. package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +0 -155
  78. package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +0 -229
  79. package/skills/wix-headless/references/inline-recipes/setup-rentals.md +0 -254
  80. package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +0 -73
  81. package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +0 -197
  82. package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +0 -136
  83. package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +0 -152
  84. package/skills/wix-headless/references/managed/AUTHENTICATION.md +0 -71
  85. package/skills/wix-headless/references/managed/CONNECT.md +0 -74
  86. package/skills/wix-headless/references/managed/CREATE.md +0 -149
  87. package/skills/wix-headless/references/managed/DEPLOYMENT.md +0 -104
  88. package/skills/wix-headless/references/non-astro.md +0 -59
  89. package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +0 -22
  90. package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +0 -15
  91. package/skills/wix-headless/references/stripe/AUTHENTICATION.md +0 -55
  92. package/skills/wix-headless/references/stripe/DEPLOYMENT.md +0 -71
  93. package/skills/wix-headless/scripts/bootstrap.mjs +0 -156
  94. package/skills/wix-headless-replatform/.publish-manifest.json +0 -8
  95. package/skills/wix-headless-replatform/SKILL.md +0 -116
  96. package/skills/wix-headless-replatform/agents/openai.yaml +0 -6
  97. package/skills/wix-headless-replatform/references/control-and-visual-fidelity-contract.md +0 -43
  98. package/skills/wix-headless-replatform/references/extraction-schema.md +0 -187
  99. package/skills/wix-headless-replatform/references/interaction-runtime-contract.md +0 -137
  100. package/skills/wix-headless-replatform/references/layout-blueprint-contract.md +0 -41
  101. package/skills/wix-headless-replatform/references/output-contract.md +0 -93
  102. package/skills/wix-headless-replatform/references/post-build-gap-contract.md +0 -125
  103. package/skills/wix-headless-replatform/references/qa-checklist.md +0 -83
  104. package/skills/wix-headless-replatform/references/safety.md +0 -19
  105. package/skills/wix-headless-replatform/references/ui-normalization-contract.md +0 -70
  106. package/skills/wix-headless-replatform/references/workflow.md +0 -157
  107. package/skills/wix-headless-replatform/registry/README.md +0 -20
  108. package/skills/wix-headless-replatform/registry/approvals/button/shadcn-default-ac60ef5.json +0 -28
  109. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/button.tsx +0 -54
  110. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/capabilities.json +0 -60
  111. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/contract.md +0 -48
  112. package/skills/wix-headless-replatform/registry/licenses/shadcn-ui-ac60ef5-MIT.txt +0 -21
  113. package/skills/wix-headless-replatform/registry/registry.json +0 -36
  114. package/skills/wix-headless-replatform/resources/rp-facelift/SKILL.md +0 -32
  115. package/skills/wix-headless-replatform/resources/rp-project-context/SKILL.md +0 -62
  116. package/skills/wix-headless-replatform/resources/rp-qa-gap-loop/SKILL.md +0 -64
  117. package/skills/wix-headless-replatform/resources/rp-source-evidence/SKILL.md +0 -42
  118. package/skills/wix-headless-replatform/resources/rp-ui-implementation/SKILL.md +0 -73
  119. package/skills/wix-headless-replatform/schemas/build-plan.schema.json +0 -10
  120. package/skills/wix-headless-replatform/schemas/candidate.schema.json +0 -19
  121. package/skills/wix-headless-replatform/schemas/common.schema.json +0 -33
  122. package/skills/wix-headless-replatform/schemas/decision-patch.schema.json +0 -10
  123. package/skills/wix-headless-replatform/schemas/decision-request.schema.json +0 -10
  124. package/skills/wix-headless-replatform/schemas/extraction-gap.schema.json +0 -28
  125. package/skills/wix-headless-replatform/schemas/extraction-manifest.schema.json +0 -34
  126. package/skills/wix-headless-replatform/schemas/final-report.schema.json +0 -10
  127. package/skills/wix-headless-replatform/schemas/foundation.schema.json +0 -11
  128. package/skills/wix-headless-replatform/schemas/metadata.schema.json +0 -11
  129. package/skills/wix-headless-replatform/schemas/observation-packet.schema.json +0 -17
  130. package/skills/wix-headless-replatform/schemas/page-capture.schema.json +0 -11
  131. package/skills/wix-headless-replatform/schemas/page-resolution.schema.json +0 -33
  132. package/skills/wix-headless-replatform/schemas/shared-chrome.schema.json +0 -11
  133. package/skills/wix-headless-replatform/schemas/unit.schema.json +0 -40
  134. package/skills/wix-headless-replatform/scripts/assemble-extraction.mjs +0 -844
  135. package/skills/wix-headless-replatform/scripts/benchmark-extraction.mjs +0 -163
  136. package/skills/wix-headless-replatform/scripts/browser-extraction-preflight.mjs +0 -42
  137. package/skills/wix-headless-replatform/scripts/build-extracted-homepage.mjs +0 -228
  138. package/skills/wix-headless-replatform/scripts/clear-wix-starter.mjs +0 -87
  139. package/skills/wix-headless-replatform/scripts/create-wix-project.mjs +0 -505
  140. package/skills/wix-headless-replatform/scripts/discover-urls.mjs +0 -142
  141. package/skills/wix-headless-replatform/scripts/extract-assets.mjs +0 -140
  142. package/skills/wix-headless-replatform/scripts/extract-design-system.mjs +0 -637
  143. package/skills/wix-headless-replatform/scripts/extract-interactions.mjs +0 -1903
  144. package/skills/wix-headless-replatform/scripts/extract-page.mjs +0 -2461
  145. package/skills/wix-headless-replatform/scripts/extract-seo.mjs +0 -25
  146. package/skills/wix-headless-replatform/scripts/extract-tokens.mjs +0 -63
  147. package/skills/wix-headless-replatform/scripts/finalize-extraction-report.mjs +0 -126
  148. package/skills/wix-headless-replatform/scripts/finalize-gap-review.mjs +0 -180
  149. package/skills/wix-headless-replatform/scripts/finalize-gap-review.test.mjs +0 -98
  150. package/skills/wix-headless-replatform/scripts/finalize-migration-website.mjs +0 -103
  151. package/skills/wix-headless-replatform/scripts/generate-control-state-contract.mjs +0 -176
  152. package/skills/wix-headless-replatform/scripts/generate-design-md.mjs +0 -261
  153. package/skills/wix-headless-replatform/scripts/generate-extraction-validators.mjs +0 -25
  154. package/skills/wix-headless-replatform/scripts/generate-invoice-download-backend.mjs +0 -342
  155. package/skills/wix-headless-replatform/scripts/generate-layout-blueprint.mjs +0 -140
  156. package/skills/wix-headless-replatform/scripts/generate-repeater-cms.mjs +0 -22
  157. package/skills/wix-headless-replatform/scripts/generate-route-plan.mjs +0 -143
  158. package/skills/wix-headless-replatform/scripts/generate-scene-contract.mjs +0 -288
  159. package/skills/wix-headless-replatform/scripts/generate-ui-normalization.mjs +0 -266
  160. package/skills/wix-headless-replatform/scripts/generate-visual-assets.mjs +0 -111
  161. package/skills/wix-headless-replatform/scripts/lib/browser-tooling.mjs +0 -570
  162. package/skills/wix-headless-replatform/scripts/lib/common.mjs +0 -329
  163. package/skills/wix-headless-replatform/scripts/lib/component-capabilities.mjs +0 -121
  164. package/skills/wix-headless-replatform/scripts/lib/component-registry.mjs +0 -282
  165. package/skills/wix-headless-replatform/scripts/lib/content-boundary.mjs +0 -61
  166. package/skills/wix-headless-replatform/scripts/lib/extraction-contract.mjs +0 -374
  167. package/skills/wix-headless-replatform/scripts/lib/extraction-detectors.mjs +0 -243
  168. package/skills/wix-headless-replatform/scripts/lib/extraction-validators.generated.mjs +0 -1139
  169. package/skills/wix-headless-replatform/scripts/lib/font-contract.mjs +0 -326
  170. package/skills/wix-headless-replatform/scripts/lib/frontend-automation-state.mjs +0 -184
  171. package/skills/wix-headless-replatform/scripts/lib/gap-analysis.mjs +0 -396
  172. package/skills/wix-headless-replatform/scripts/lib/html-extract.mjs +0 -168
  173. package/skills/wix-headless-replatform/scripts/lib/interaction-bootstrap.mjs +0 -10
  174. package/skills/wix-headless-replatform/scripts/lib/interaction-runtime.mjs +0 -194
  175. package/skills/wix-headless-replatform/scripts/lib/interaction-timeline.mjs +0 -348
  176. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/classifiers.mjs +0 -141
  177. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/geometry.mjs +0 -43
  178. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/vocabulary.mjs +0 -18
  179. package/skills/wix-headless-replatform/scripts/lib/ui-normalization.css +0 -64
  180. package/skills/wix-headless-replatform/scripts/optimize-svg.mjs +0 -31
  181. package/skills/wix-headless-replatform/scripts/post-build-gap.mjs +0 -358
  182. package/skills/wix-headless-replatform/scripts/provision-repeater-cms.mjs +0 -25
  183. package/skills/wix-headless-replatform/scripts/record-gap-decision.mjs +0 -39
  184. package/skills/wix-headless-replatform/scripts/replay-extraction.mjs +0 -107
  185. package/skills/wix-headless-replatform/scripts/resolve-home-page.mjs +0 -96
  186. package/skills/wix-headless-replatform/scripts/site-clone.mjs +0 -658
  187. package/skills/wix-headless-replatform/scripts/validate-font-contract.mjs +0 -29
  188. package/skills/wix-headless-replatform/scripts/verify-interactions.mjs +0 -669
  189. package/skills/wix-headless-replatform/scripts/visual-qa.mjs +0 -370
  190. package/skills/wix-import/SKILL.md +0 -90
  191. package/skills/wix-replatform/.publish-manifest.json +0 -8
  192. package/skills/wix-replatform/CLI.md +0 -162
  193. package/skills/wix-replatform/README.md +0 -52
  194. package/skills/wix-replatform/SKILL.md +0 -238
  195. package/skills/wix-replatform/console/account.css +0 -1
  196. package/skills/wix-replatform/console/app.css +0 -1
  197. package/skills/wix-replatform/console/app.js +0 -117
  198. package/skills/wix-replatform/console/index.html +0 -4
  199. package/skills/wix-replatform/console/json.css +0 -11
  200. package/skills/wix-replatform/lib/agent-adapters/index.js +0 -71
  201. package/skills/wix-replatform/lib/app-page-routing.js +0 -75
  202. package/skills/wix-replatform/lib/artifact-freshness.js +0 -225
  203. package/skills/wix-replatform/lib/blocked-data-requests.js +0 -427
  204. package/skills/wix-replatform/lib/census-reconciliation.js +0 -426
  205. package/skills/wix-replatform/lib/completion-report.js +0 -1580
  206. package/skills/wix-replatform/lib/config-env.js +0 -133
  207. package/skills/wix-replatform/lib/confirmed-pictures.js +0 -212
  208. package/skills/wix-replatform/lib/dependency-readiness.js +0 -423
  209. package/skills/wix-replatform/lib/dependency-recovery.js +0 -21
  210. package/skills/wix-replatform/lib/destination-choice.js +0 -163
  211. package/skills/wix-replatform/lib/destination-handoff.js +0 -62
  212. package/skills/wix-replatform/lib/destination-http.js +0 -81
  213. package/skills/wix-replatform/lib/destination-route.js +0 -98
  214. package/skills/wix-replatform/lib/destination.js +0 -919
  215. package/skills/wix-replatform/lib/discovered-census.js +0 -231
  216. package/skills/wix-replatform/lib/discovered-set-status.js +0 -255
  217. package/skills/wix-replatform/lib/document-url-guard.js +0 -203
  218. package/skills/wix-replatform/lib/entity-qa-attestation.js +0 -339
  219. package/skills/wix-replatform/lib/entity-verification.js +0 -18
  220. package/skills/wix-replatform/lib/execution-capability.js +0 -120
  221. package/skills/wix-replatform/lib/execution-log.js +0 -170
  222. package/skills/wix-replatform/lib/execution-manifest.js +0 -203
  223. package/skills/wix-replatform/lib/execution-state.js +0 -195
  224. package/skills/wix-replatform/lib/expectations-ledger.js +0 -96
  225. package/skills/wix-replatform/lib/generated-plugin-handoff.js +0 -140
  226. package/skills/wix-replatform/lib/import-readiness-contract.js +0 -23
  227. package/skills/wix-replatform/lib/import-recovery.js +0 -1107
  228. package/skills/wix-replatform/lib/imported-redirect-targets.js +0 -608
  229. package/skills/wix-replatform/lib/internal-link-reconciliation.js +0 -166
  230. package/skills/wix-replatform/lib/link-audit.js +0 -173
  231. package/skills/wix-replatform/lib/link-census.js +0 -194
  232. package/skills/wix-replatform/lib/link-plan.js +0 -148
  233. package/skills/wix-replatform/lib/link-verification.js +0 -274
  234. package/skills/wix-replatform/lib/link-write-journal.js +0 -42
  235. package/skills/wix-replatform/lib/local-state.js +0 -1481
  236. package/skills/wix-replatform/lib/member-completion.js +0 -658
  237. package/skills/wix-replatform/lib/member-crosswalk.js +0 -69
  238. package/skills/wix-replatform/lib/member-outcome-registry.js +0 -265
  239. package/skills/wix-replatform/lib/migration-completion.js +0 -311
  240. package/skills/wix-replatform/lib/operator-identity.js +0 -47
  241. package/skills/wix-replatform/lib/orchestration-decisions.js +0 -248
  242. package/skills/wix-replatform/lib/orchestration-preflight.js +0 -525
  243. package/skills/wix-replatform/lib/orchestration-router.js +0 -698
  244. package/skills/wix-replatform/lib/orchestration-state.js +0 -631
  245. package/skills/wix-replatform/lib/order-reference-readiness.js +0 -30
  246. package/skills/wix-replatform/lib/payments-outcome-registry.js +0 -200
  247. package/skills/wix-replatform/lib/plugin-cms-fallback.js +0 -618
  248. package/skills/wix-replatform/lib/preservation-approval-stamp.js +0 -54
  249. package/skills/wix-replatform/lib/product-media-deferral.js +0 -96
  250. package/skills/wix-replatform/lib/progress-log.js +0 -240
  251. package/skills/wix-replatform/lib/progress-log.sh +0 -140
  252. package/skills/wix-replatform/lib/read-back-approval.js +0 -184
  253. package/skills/wix-replatform/lib/read-back-comparison.js +0 -136
  254. package/skills/wix-replatform/lib/read-back-contract.js +0 -243
  255. package/skills/wix-replatform/lib/read-back-extract.js +0 -118
  256. package/skills/wix-replatform/lib/read-back-gate.js +0 -734
  257. package/skills/wix-replatform/lib/read-back-reads.js +0 -94
  258. package/skills/wix-replatform/lib/read-back-state.js +0 -107
  259. package/skills/wix-replatform/lib/read-back-summary.js +0 -81
  260. package/skills/wix-replatform/lib/rerun-conflicts.js +0 -334
  261. package/skills/wix-replatform/lib/run-controller.js +0 -401
  262. package/skills/wix-replatform/lib/seo-outcome-registry.js +0 -45
  263. package/skills/wix-replatform/lib/setup-verification.js +0 -148
  264. package/skills/wix-replatform/lib/source-access.js +0 -231
  265. package/skills/wix-replatform/lib/source-coverage.js +0 -1130
  266. package/skills/wix-replatform/lib/source-secrets.js +0 -277
  267. package/skills/wix-replatform/lib/structured-link-patch.js +0 -59
  268. package/skills/wix-replatform/lib/task-state.js +0 -110
  269. package/skills/wix-replatform/lib/url-preservation-report.js +0 -319
  270. package/skills/wix-replatform/lib/url-preservation-state.js +0 -739
  271. package/skills/wix-replatform/lib/url-redirect-plan.js +0 -728
  272. package/skills/wix-replatform/lib/url-verification.js +0 -315
  273. package/skills/wix-replatform/lib/user-action-effects.js +0 -42
  274. package/skills/wix-replatform/lib/user-actions.js +0 -264
  275. package/skills/wix-replatform/lib/website-handoff.js +0 -1220
  276. package/skills/wix-replatform/lib/wix-client-callers.js +0 -54
  277. package/skills/wix-replatform/lib/wix-dashboard-url.js +0 -35
  278. package/skills/wix-replatform/lib/write-verification-state.js +0 -92
  279. package/skills/wix-replatform/lib/write-verification.js +0 -274
  280. package/skills/wix-replatform/resources/rp-destination/SKILL.md +0 -137
  281. package/skills/wix-replatform/resources/rp-discovery/SKILL.md +0 -357
  282. package/skills/wix-replatform/resources/rp-discovery/scripts/promote-source-coverage.js +0 -47
  283. package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +0 -1369
  284. package/skills/wix-replatform/resources/rp-execute-import/scripts/shipping-estimate-audit.js +0 -70
  285. package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +0 -482
  286. package/skills/wix-replatform/resources/rp-execute-setup/scripts/execute-setup.js +0 -442
  287. package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +0 -64
  288. package/skills/wix-replatform/resources/rp-execution-policy/SKILL.md +0 -112
  289. package/skills/wix-replatform/resources/rp-execution-policy/lib/coupon-currency-plan-report.js +0 -143
  290. package/skills/wix-replatform/resources/rp-execution-policy/lib/payments-report.js +0 -244
  291. package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +0 -3158
  292. package/skills/wix-replatform/resources/rp-mapper/SKILL.md +0 -947
  293. package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +0 -217
  294. package/skills/wix-replatform/resources/rp-mapper/lib/structure-bridge-planning.js +0 -303
  295. package/skills/wix-replatform/resources/rp-mapper/scripts/coverage-reconcile.js +0 -88
  296. package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +0 -148
  297. package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +0 -378
  298. package/skills/wix-replatform/resources/rp-preflight/SKILL.md +0 -40
  299. package/skills/wix-replatform/resources/rp-project-intake/SKILL.md +0 -55
  300. package/skills/wix-replatform/resources/rp-quick-runtime/SKILL.md +0 -60
  301. package/skills/wix-replatform/resources/rp-quick-runtime/lib/import-progress.js +0 -89
  302. package/skills/wix-replatform/resources/rp-quick-runtime/lib/limit-recovery.js +0 -36
  303. package/skills/wix-replatform/resources/rp-quick-shopify/SKILL.md +0 -123
  304. package/skills/wix-replatform/resources/rp-quick-shopify/quick-mode.json +0 -124
  305. package/skills/wix-replatform/resources/rp-quick-shopify/scripts/quick-mode.js +0 -522
  306. package/skills/wix-replatform/resources/rp-quick-woocommerce/SKILL.md +0 -56
  307. package/skills/wix-replatform/resources/rp-quick-woocommerce/quick-mode.json +0 -91
  308. package/skills/wix-replatform/resources/rp-quick-woocommerce/scripts/quick-mode.js +0 -255
  309. package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +0 -253
  310. package/skills/wix-replatform/resources/rp-setup-discovery/scripts/quick-setup-plan.js +0 -44
  311. package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +0 -481
  312. package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +0 -136
  313. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
  314. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +0 -310
  315. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +0 -1081
  316. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +0 -618
  317. package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +0 -969
  318. package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +0 -196
  319. package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +0 -66
  320. package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +0 -60
  321. package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +0 -95
  322. package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +0 -82
  323. package/skills/wix-replatform/resources/rp-source-inputs/SKILL.md +0 -66
  324. package/skills/wix-replatform/resources/rp-source-sfcc/SKILL.md +0 -153
  325. package/skills/wix-replatform/resources/rp-source-shopify/SKILL.md +0 -394
  326. package/skills/wix-replatform/resources/rp-source-shopify/lib/discovery-reads.js +0 -200
  327. package/skills/wix-replatform/resources/rp-source-shopify/lib/import-findings.js +0 -34
  328. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk-sqlite-worker.js +0 -44
  329. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk.js +0 -1470
  330. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-cli.js +0 -446
  331. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-gift-cards.js +0 -474
  332. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-protected-fields.js +0 -879
  333. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-session.js +0 -426
  334. package/skills/wix-replatform/resources/rp-source-shopify/queries/articles.graphql +0 -24
  335. package/skills/wix-replatform/resources/rp-source-shopify/queries/blogs.graphql +0 -18
  336. package/skills/wix-replatform/resources/rp-source-shopify/queries/collections.graphql +0 -40
  337. package/skills/wix-replatform/resources/rp-source-shopify/queries/customers.graphql +0 -76
  338. package/skills/wix-replatform/resources/rp-source-shopify/queries/delivery-profiles.graphql +0 -51
  339. package/skills/wix-replatform/resources/rp-source-shopify/queries/discounts.graphql +0 -35
  340. package/skills/wix-replatform/resources/rp-source-shopify/queries/files.graphql +0 -20
  341. package/skills/wix-replatform/resources/rp-source-shopify/queries/gift-cards.graphql +0 -18
  342. package/skills/wix-replatform/resources/rp-source-shopify/queries/inventory.graphql +0 -31
  343. package/skills/wix-replatform/resources/rp-source-shopify/queries/locations.graphql +0 -21
  344. package/skills/wix-replatform/resources/rp-source-shopify/queries/menus.graphql +0 -21
  345. package/skills/wix-replatform/resources/rp-source-shopify/queries/metaobjects.graphql +0 -30
  346. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-core.graphql +0 -150
  347. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-fulfillments.graphql +0 -36
  348. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-refunds.graphql +0 -48
  349. package/skills/wix-replatform/resources/rp-source-shopify/queries/pages.graphql +0 -20
  350. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-address.graphql +0 -8
  351. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-email.graphql +0 -6
  352. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-name.graphql +0 -8
  353. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-phone.graphql +0 -8
  354. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-address.graphql +0 -12
  355. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-email.graphql +0 -6
  356. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-name.graphql +0 -13
  357. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-phone.graphql +0 -13
  358. package/skills/wix-replatform/resources/rp-source-shopify/queries/products.graphql +0 -73
  359. package/skills/wix-replatform/resources/rp-source-shopify/queries/url-redirects.graphql +0 -13
  360. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-discovery.js +0 -693
  361. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-extract.js +0 -283
  362. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-gift-card-remedy.js +0 -191
  363. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-session-check.js +0 -115
  364. package/skills/wix-replatform/resources/rp-source-shopify/source-schema.example.json +0 -201
  365. package/skills/wix-replatform/resources/rp-source-wordpress/PLUGIN-READ-PLANS.md +0 -146
  366. package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +0 -970
  367. package/skills/wix-replatform/resources/rp-source-wordpress/lib/blocked-data-handlers.js +0 -73
  368. package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.js +0 -115
  369. package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.test-fixture.js +0 -91
  370. package/skills/wix-replatform/resources/rp-source-wordpress/lib/coupon-discovery.js +0 -440
  371. package/skills/wix-replatform/resources/rp-source-wordpress/lib/currency-gate.js +0 -125
  372. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.js +0 -252
  373. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.json +0 -183
  374. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-summary.mjs +0 -333
  375. package/skills/wix-replatform/resources/rp-source-wordpress/lib/invoice-discovery.js +0 -426
  376. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-disposition.js +0 -400
  377. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-entity-read-plan.js +0 -633
  378. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-knowledge.js +0 -1127
  379. package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.js +0 -194
  380. package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.json +0 -100
  381. package/skills/wix-replatform/resources/rp-source-wordpress/lib/sampled-ids-batch.js +0 -157
  382. package/skills/wix-replatform/resources/rp-source-wordpress/lib/secret-value-guard.js +0 -234
  383. package/skills/wix-replatform/resources/rp-source-wordpress/lib/store-currency.js +0 -101
  384. package/skills/wix-replatform/resources/rp-source-wordpress/lib/structure-bridge-reader.js +0 -755
  385. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.js +0 -1074
  386. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.test-fixture.js +0 -149
  387. package/skills/wix-replatform/resources/rp-source-wordpress/lib/woo-inventory.js +0 -25
  388. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +0 -444
  389. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-image-url.js +0 -186
  390. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-plugin-detect.js +0 -1422
  391. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-redirect-sources.js +0 -343
  392. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +0 -680
  393. package/skills/wix-replatform/resources/rp-source-wordpress/lib/yoast-product-seo-evidence.js +0 -272
  394. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/README.md +0 -373
  395. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/advanced-custom-fields.json +0 -101
  396. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/back-in-stock-notifier-for-woocommerce.json +0 -81
  397. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/capabilities-pending-decision.json +0 -128
  398. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/cms-fallback-eligible.json +0 -18
  399. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/contact-form-7.json +0 -104
  400. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/facebook-for-woocommerce.json +0 -44
  401. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/fingerprint-aliases.json +0 -49
  402. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/free-gifts-for-woocommerce.json +0 -94
  403. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/index.json +0 -863
  404. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mailpoet.json +0 -52
  405. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/membership-for-woocommerce.json +0 -161
  406. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mwb-bookings-for-woocommerce.json +0 -180
  407. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/no-migration-needed.json +0 -286
  408. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pricing-deals-for-woocommerce.json +0 -79
  409. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/product-extras-for-woocommerce.json +0 -120
  410. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pw-woocommerce-gift-cards.json +0 -128
  411. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/requires-development.json +0 -88
  412. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seo-by-rank-math.json +0 -80
  413. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seriously-simple-podcasting.json +0 -46
  414. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/strong-testimonials.json +0 -55
  415. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/subscriptions-for-woocommerce.json +0 -99
  416. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/tablepress.json +0 -55
  417. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/the-events-calendar.json +0 -160
  418. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/ti-woocommerce-wishlist.json +0 -81
  419. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-checkout-field-editor-pro.json +0 -60
  420. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-discount-rules.json +0 -74
  421. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-product-bundle.json +0 -75
  422. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-gift-cards.json +0 -60
  423. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-other-payment-gateway.json +0 -44
  424. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-pdf-invoices-packing-slips.json +0 -57
  425. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-product-addon.json +0 -141
  426. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-progressive-discounts.json +0 -54
  427. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wordpress-seo.json +0 -158
  428. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpc-composite-products.json +0 -97
  429. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpforms-lite.json +0 -86
  430. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/capture-store-settings.js +0 -90
  431. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge-validate.js +0 -51
  432. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge.js +0 -103
  433. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +0 -2409
  434. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-plugin-inventory.js +0 -273
  435. package/skills/wix-replatform/resources/rp-source-wordpress/secret-value-patterns.v1.json +0 -11
  436. package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +0 -71
  437. package/skills/wix-replatform/resources/rp-source-wordpress/sub-parts.json +0 -13
  438. package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +0 -1046
  439. package/skills/wix-replatform/resources/rp-target-wix/app-page-routing-capabilities.json +0 -36
  440. package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +0 -57
  441. package/skills/wix-replatform/resources/rp-target-wix/domains/SERVICE-PLUGINS.md +0 -322
  442. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/docs-survey.json +0 -70
  443. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +0 -29
  444. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +0 -71
  445. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +0 -83
  446. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +0 -95
  447. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +0 -66
  448. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/docs-survey.json +0 -332
  449. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/domain.json +0 -75
  450. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/booking.json +0 -181
  451. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service-add-on.json +0 -130
  452. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service.json +0 -180
  453. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/docs-survey.json +0 -161
  454. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +0 -25
  455. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +0 -67
  456. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +0 -75
  457. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +0 -41
  458. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/docs-survey.json +0 -204
  459. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +0 -27
  460. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +0 -275
  461. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +0 -105
  462. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +0 -77
  463. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/docs-survey.json +0 -297
  464. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +0 -44
  465. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/delivery-profile.json +0 -171
  466. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/discount-rule.json +0 -182
  467. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-applied-discount.json +0 -129
  468. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-invoice-document.json +0 -192
  469. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item-options.json +0 -123
  470. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +0 -85
  471. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-merchant-note.json +0 -112
  472. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-payment.json +0 -191
  473. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +0 -164
  474. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +0 -462
  475. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/pickup-location.json +0 -122
  476. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/shipping-option.json +0 -98
  477. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/wishlist-item.json +0 -86
  478. package/skills/wix-replatform/resources/rp-target-wix/domains/events/docs-survey.json +0 -128
  479. package/skills/wix-replatform/resources/rp-target-wix/domains/events/domain.json +0 -38
  480. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/category.json +0 -73
  481. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/event.json +0 -107
  482. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/registration-form.json +0 -89
  483. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/rsvp.json +0 -118
  484. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/ticket-definition.json +0 -93
  485. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/docs-survey.json +0 -86
  486. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/domain.json +0 -56
  487. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form-submission.json +0 -121
  488. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form.json +0 -134
  489. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/docs-survey.json +0 -41
  490. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/domain.json +0 -50
  491. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card-product.json +0 -87
  492. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card.json +0 -130
  493. package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +0 -1418
  494. package/skills/wix-replatform/resources/rp-target-wix/domains/media/docs-survey.json +0 -41
  495. package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +0 -24
  496. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +0 -75
  497. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +0 -71
  498. package/skills/wix-replatform/resources/rp-target-wix/domains/members/docs-survey.json +0 -119
  499. package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +0 -23
  500. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +0 -71
  501. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/custom-field.json +0 -82
  502. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member-about.json +0 -77
  503. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +0 -205
  504. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/docs-survey.json +0 -41
  505. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/domain.json +0 -46
  506. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan-order.json +0 -137
  507. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan.json +0 -133
  508. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/docs-survey.json +0 -7
  509. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/domain.json +0 -36
  510. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/amazon-shop-connect.json +0 -71
  511. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/ebay-shop-connect.json +0 -67
  512. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/google-youtube-connect.json +0 -72
  513. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/meta-catalog-connect.json +0 -74
  514. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/pinterest-catalog-connect.json +0 -69
  515. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/tiktok-catalog-connect.json +0 -61
  516. package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +0 -111
  517. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/docs-survey.json +0 -109
  518. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/domain.json +0 -73
  519. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/item-seo-tags.json +0 -148
  520. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/seo-pattern.json +0 -91
  521. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/site-seo-tags.json +0 -79
  522. package/skills/wix-replatform/resources/rp-target-wix/domains/site/docs-survey.json +0 -32
  523. package/skills/wix-replatform/resources/rp-target-wix/domains/site/domain.json +0 -49
  524. package/skills/wix-replatform/resources/rp-target-wix/domains/site/entities/business-contact.json +0 -103
  525. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/docs-survey.json +0 -203
  526. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +0 -42
  527. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/back-in-stock-request.json +0 -119
  528. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/brand.json +0 -111
  529. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +0 -81
  530. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +0 -241
  531. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +0 -118
  532. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-customization.json +0 -111
  533. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +0 -79
  534. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +0 -221
  535. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/promotion.json +0 -84
  536. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/review.json +0 -178
  537. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/subscription-product.json +0 -87
  538. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/docs-survey.json +0 -106
  539. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/domain.json +0 -64
  540. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/manual-tax-mapping.json +0 -119
  541. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-group.json +0 -94
  542. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-region.json +0 -113
  543. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-settings.json +0 -65
  544. package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +0 -64
  545. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-author-attribution.js +0 -165
  546. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-client.js +0 -60
  547. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-duplicates.js +0 -201
  548. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-ledger.js +0 -306
  549. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-report.js +0 -229
  550. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-stage.js +0 -55
  551. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build.js +0 -715
  552. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-media.js +0 -567
  553. package/skills/wix-replatform/resources/rp-target-wix/lib/bulk-results.js +0 -73
  554. package/skills/wix-replatform/resources/rp-target-wix/lib/contact-extended-fields.js +0 -194
  555. package/skills/wix-replatform/resources/rp-target-wix/lib/contact-import.js +0 -133
  556. package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +0 -150
  557. package/skills/wix-replatform/resources/rp-target-wix/lib/coupon-redemption-drift.js +0 -491
  558. package/skills/wix-replatform/resources/rp-target-wix/lib/customer-member.js +0 -104
  559. package/skills/wix-replatform/resources/rp-target-wix/lib/data-extension-schema.js +0 -673
  560. package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +0 -835
  561. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-balance-reconciliation.js +0 -119
  562. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-build.js +0 -566
  563. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-redemption-build.js +0 -249
  564. package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +0 -260
  565. package/skills/wix-replatform/resources/rp-target-wix/lib/order-applied-discount-build.js +0 -63
  566. package/skills/wix-replatform/resources/rp-target-wix/lib/order-buyer.js +0 -187
  567. package/skills/wix-replatform/resources/rp-target-wix/lib/order-channel-build.js +0 -64
  568. package/skills/wix-replatform/resources/rp-target-wix/lib/order-history.js +0 -1027
  569. package/skills/wix-replatform/resources/rp-target-wix/lib/order-invoice-contract.js +0 -90
  570. package/skills/wix-replatform/resources/rp-target-wix/lib/order-payment-mapping.js +0 -420
  571. package/skills/wix-replatform/resources/rp-target-wix/lib/pricing-plan-definition.js +0 -177
  572. package/skills/wix-replatform/resources/rp-target-wix/lib/product-import.js +0 -151
  573. package/skills/wix-replatform/resources/rp-target-wix/lib/product-seo.js +0 -723
  574. package/skills/wix-replatform/resources/rp-target-wix/lib/seo-redirects.js +0 -353
  575. package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-build.js +0 -1437
  576. package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-option-stage.js +0 -354
  577. package/skills/wix-replatform/resources/rp-target-wix/lib/store-config-build.js +0 -134
  578. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-category-attach.js +0 -221
  579. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-inventory.js +0 -248
  580. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +0 -321
  581. package/skills/wix-replatform/resources/rp-target-wix/lib/tax-build.js +0 -231
  582. package/skills/wix-replatform/resources/rp-target-wix/lib/url-mapper-transport.js +0 -28
  583. package/skills/wix-replatform/resources/rp-target-wix/lib/value-utils.js +0 -14
  584. package/skills/wix-replatform/resources/rp-target-wix/lib/variant-correlation.js +0 -34
  585. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +0 -388
  586. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +0 -255
  587. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +0 -6041
  588. package/skills/wix-replatform/resources/rp-target-wix/lib/write-verification.js +0 -3
  589. package/skills/wix-replatform/resources/rp-target-wix/scripts/docs-survey-sync.js +0 -150
  590. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +0 -69
  591. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +0 -100
  592. package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +0 -112
  593. package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +0 -484
  594. package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +0 -318
  595. package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +0 -2831
  596. package/skills/wix-replatform/resources/rp-telemetry/lib/transcript-digest.js +0 -318
  597. package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +0 -83
  598. package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +0 -243
  599. package/skills/wix-replatform/resources/rp-website-continuation/SKILL.md +0 -94
  600. package/skills/wix-replatform/scripts/artifact-freshness.js +0 -76
  601. package/skills/wix-replatform/scripts/census-reconciliation.js +0 -25
  602. package/skills/wix-replatform/scripts/cms-fallback.js +0 -89
  603. package/skills/wix-replatform/scripts/discovered-census.js +0 -26
  604. package/skills/wix-replatform/scripts/discovered-set-status.js +0 -33
  605. package/skills/wix-replatform/scripts/entity-qa-attestation.js +0 -130
  606. package/skills/wix-replatform/scripts/execution-health-check.js +0 -415
  607. package/skills/wix-replatform/scripts/execution-manifest-validate.js +0 -43
  608. package/skills/wix-replatform/scripts/execution-state-prepare.js +0 -128
  609. package/skills/wix-replatform/scripts/expectations-ledger.js +0 -44
  610. package/skills/wix-replatform/scripts/import-contract-verify.js +0 -183
  611. package/skills/wix-replatform/scripts/internal-link-audit.js +0 -90
  612. package/skills/wix-replatform/scripts/item-seo-tags-verify.js +0 -205
  613. package/skills/wix-replatform/scripts/migration-completion.js +0 -76
  614. package/skills/wix-replatform/scripts/orchestration-preflight.js +0 -67
  615. package/skills/wix-replatform/scripts/orchestration-route.js +0 -77
  616. package/skills/wix-replatform/scripts/orchestration-state.js +0 -381
  617. package/skills/wix-replatform/scripts/read-back-gate.js +0 -175
  618. package/skills/wix-replatform/scripts/replatform-console.js +0 -146
  619. package/skills/wix-replatform/scripts/replatform.js +0 -436
  620. package/skills/wix-replatform/scripts/source-secrets.js +0 -77
  621. package/skills/wix-replatform/scripts/url-redirects.js +0 -286
  622. package/skills/wix-replatform/scripts/user-action.js +0 -58
  623. package/skills/wix-replatform/scripts/website-handoff-generate.js +0 -64
  624. package/skills/wix-replatform/scripts/wix-dashboard-url.js +0 -54
  625. package/skills/wix-replatform/scripts/wix-destination.js +0 -143
  626. package/skills/wix-replatform/scripts/wix-headless-scaffold.js +0 -762
  627. package/skills/wix-vibe-headless/SKILL.md +0 -183
  628. package/skills/wix-vibe-headless/install/deploy.cjs +0 -221
  629. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +0 -35
  630. package/skills/wix-vibe-headless/platforms/README.md +0 -26
  631. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed-with-install.md +0 -127
  632. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +0 -121
  633. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +0 -87
  634. package/skills/wix-vibe-headless/platforms/base44.md +0 -148
  635. package/skills/wix-vibe-headless/platforms/generic.md +0 -132
  636. package/skills/wix-vibe-headless/references/_shared/nav/nav.tanstack.js +0 -30
  637. package/skills/wix-vibe-headless/references/_shared/routing.md +0 -86
  638. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +0 -270
  639. package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +0 -43
  640. package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +0 -25
  641. package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +0 -15
  642. package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +0 -35
  643. package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +0 -38
  644. package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +0 -40
  645. package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +0 -54
  646. package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +0 -65
  647. package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +0 -50
  648. package/skills/wix-vibe-headless/references/blog/app/rest/wix-blog.js +0 -217
  649. package/skills/wix-vibe-headless/references/blog/seed/SEED.md +0 -99
  650. package/skills/wix-vibe-headless/references/blog/seed/seed-blog.cjs +0 -269
  651. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +0 -342
  652. package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +0 -65
  653. package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +0 -67
  654. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +0 -47
  655. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +0 -13
  656. package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +0 -126
  657. package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +0 -128
  658. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +0 -110
  659. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +0 -58
  660. package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +0 -95
  661. package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +0 -94
  662. package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +0 -89
  663. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +0 -148
  664. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +0 -250
  665. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +0 -300
  666. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +0 -154
  667. package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.cjs +0 -333
  668. package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.cjs +0 -267
  669. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +0 -178
  670. package/skills/wix-vibe-headless/references/cms/app/collection.config.js +0 -31
  671. package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +0 -18
  672. package/skills/wix-vibe-headless/references/cms/app/rest/wix-cms.js +0 -231
  673. package/skills/wix-vibe-headless/references/cms/seed/SEED.md +0 -145
  674. package/skills/wix-vibe-headless/references/donations/INSTRUCTIONS.md +0 -88
  675. package/skills/wix-vibe-headless/references/donations/app/rest/wix-donations.js +0 -112
  676. package/skills/wix-vibe-headless/references/donations/seed/SEED.md +0 -11
  677. package/skills/wix-vibe-headless/references/donations/tests/donations.test.mjs +0 -258
  678. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +0 -267
  679. package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +0 -23
  680. package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +0 -43
  681. package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +0 -13
  682. package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +0 -29
  683. package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +0 -57
  684. package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +0 -78
  685. package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +0 -27
  686. package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +0 -54
  687. package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +0 -40
  688. package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +0 -81
  689. package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +0 -48
  690. package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +0 -36
  691. package/skills/wix-vibe-headless/references/events/app/rest/wix-events-browse.js +0 -136
  692. package/skills/wix-vibe-headless/references/events/app/rest/wix-events-registration.js +0 -187
  693. package/skills/wix-vibe-headless/references/events/seed/SEED.md +0 -103
  694. package/skills/wix-vibe-headless/references/events/seed/seed-events.cjs +0 -251
  695. package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +0 -487
  696. package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +0 -425
  697. package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +0 -187
  698. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +0 -238
  699. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +0 -108
  700. package/skills/wix-vibe-headless/references/forms/seed/SEED.md +0 -1836
  701. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +0 -328
  702. package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +0 -101
  703. package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +0 -33
  704. package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +0 -21
  705. package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +0 -29
  706. package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +0 -54
  707. package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +0 -77
  708. package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +0 -36
  709. package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +0 -32
  710. package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +0 -35
  711. package/skills/wix-vibe-headless/references/members/app/rest/wix-members-auth.js +0 -390
  712. package/skills/wix-vibe-headless/references/members/install/Register.jsx +0 -22
  713. package/skills/wix-vibe-headless/references/members/seed/SEED.md +0 -21
  714. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +0 -270
  715. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +0 -31
  716. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +0 -15
  717. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +0 -39
  718. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +0 -15
  719. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +0 -29
  720. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +0 -35
  721. package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +0 -27
  722. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +0 -25
  723. package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +0 -39
  724. package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +0 -27
  725. package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +0 -60
  726. package/skills/wix-vibe-headless/references/portfolio/app/rest/wix-portfolio.js +0 -223
  727. package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +0 -90
  728. package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.cjs +0 -236
  729. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +0 -280
  730. package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +0 -35
  731. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +0 -48
  732. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +0 -16
  733. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +0 -35
  734. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +0 -25
  735. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +0 -28
  736. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +0 -30
  737. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +0 -30
  738. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +0 -53
  739. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +0 -28
  740. package/skills/wix-vibe-headless/references/pricing-plans/app/rest/wix-pricing-plans.js +0 -157
  741. package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +0 -82
  742. package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.cjs +0 -251
  743. package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +0 -13
  744. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +0 -290
  745. package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +0 -81
  746. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +0 -71
  747. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +0 -43
  748. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +0 -21
  749. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +0 -72
  750. package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +0 -66
  751. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +0 -32
  752. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +0 -73
  753. package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +0 -28
  754. package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +0 -102
  755. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-menu.js +0 -224
  756. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +0 -218
  757. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-reservations.js +0 -107
  758. package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +0 -176
  759. package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.cjs +0 -452
  760. package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +0 -56
  761. package/skills/wix-vibe-headless/references/shared/app/lib/nav.js +0 -9
  762. package/skills/wix-vibe-headless/references/shared/app/rest/wix-client.js +0 -185
  763. package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +0 -8
  764. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +0 -471
  765. package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +0 -20
  766. package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +0 -167
  767. package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +0 -83
  768. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +0 -104
  769. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +0 -163
  770. package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +0 -83
  771. package/skills/wix-vibe-headless/references/storefront/app/hooks/useVariantOptions.js +0 -76
  772. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +0 -64
  773. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +0 -176
  774. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +0 -218
  775. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +0 -174
  776. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +0 -546
@@ -1,2409 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('node:fs/promises');
4
- const path = require('node:path');
5
- const { randomUUID } = require('node:crypto');
6
- const { createProgressLogger, parseProgressArgs } = require('../../../lib/progress-log.js');
7
- const { readEnvFile } = require('../../../lib/config-env.js');
8
- const { buildWordPressCoverageRows, buildCoverageFile, ADAPTER_RAW_DIRS } = require('../../../lib/source-coverage.js');
9
-
10
- // Transport, auth, throttling, and pagination-header parsing live in the shared
11
- // adapter lib so the bulk-extract reader generated by rp-import-codegen inherits
12
- // the exact same discipline instead of re-deriving it.
13
- const {
14
- DEFAULT_TIMEOUT_MS,
15
- DEFAULT_RATE_LIMIT_RPM,
16
- DEFAULT_MAX_RETRIES,
17
- configureRateLimit,
18
- buildHeaders,
19
- normalizeBaseUrl,
20
- fetchJson,
21
- parseTotalHeader,
22
- } = require('../lib/wp-http.js');
23
- const {
24
- classifyRoutes,
25
- summarizeSkippedByCategory,
26
- buildRegisteredRestBases,
27
- defaultPluginRules,
28
- defaultQueryFor,
29
- defaultQueryReasonFor,
30
- } = require('../lib/wp-route-classifier.js');
31
- // Plugin awareness: detection runs before classification so profile routes are
32
- // in scope; embedded detection and Tier-B derivation run after sampling because they need
33
- // real record payloads and the accepted route set.
34
- const { gatherInventory, inventoryPayload } = require('./wp-plugin-inventory.js');
35
- // discover-structure/query-structure: the only source for entities whose
36
- // blocked[].fulfillment.kind is structure-bridge-plugin -- data with no REST route at all.
37
- const {
38
- discoverStructure, queryStructure, guardedValueColumns, violatesTierRule,
39
- discoverEavKeys, buildEavReadPlan,
40
- } = require('../lib/wix-wp-plugin-v2-client.js');
41
- const {
42
- pluginsRoot,
43
- loadProfiles,
44
- loadNoMigrationNeeded,
45
- loadRequiresDevelopment,
46
- loadPendingDecisions,
47
- loadFingerprintAliases,
48
- loadCmsFallbackEligible,
49
- CHILD_ROUTE_PLACEHOLDER,
50
- buildResponseEnvelopes,
51
- buildRequestOverrides,
52
- buildResponseFragmentGroups,
53
- buildRecordKeyFields,
54
- } = require('../lib/plugin-knowledge.js');
55
- const {
56
- buildDispositionRows,
57
- summarizeDispositions,
58
- } = require('../lib/plugin-disposition.js');
59
- const {
60
- cmsFallbackDecisionKeys,
61
- cmsFallbackDecisionShape,
62
- capabilityOfKey: cmsFallbackCapabilityOfKey,
63
- cmsFallbackResolutionInputs,
64
- cmsFallbackInputsDigest,
65
- detectedPluginsOf,
66
- } = require('../../../lib/plugin-cms-fallback.js');
67
- const {
68
- detectPlugins,
69
- describeProfiledEntity,
70
- collectRecordProperties,
71
- collectUnprofiledRoutes,
72
- collectCandidateNamespaces,
73
- deriveGenericEntities,
74
- classifyCoverage,
75
- coverageSummary,
76
- } = require('../lib/wp-plugin-detect.js');
77
- const {
78
- collectAllIds,
79
- queryInBatches,
80
- DEFAULT_BATCH_SIZE,
81
- } = require('../lib/sampled-ids-batch.js');
82
-
83
- const DEFAULT_SAMPLE_LIMIT = 3;
84
- let progress;
85
-
86
- function printUsage() {
87
- console.log(`Usage:
88
- node wp-discovery.js --base-url <url> --out-dir <dir> [auth options]
89
-
90
- Required:
91
- --base-url <url> WordPress site base URL, e.g. https://example.com
92
- --out-dir <dir> Directory to write discovery markdown files into
93
- --decisions <path> orchestration/decisions.json to read batched-ask answers from
94
- (default: <out-dir>/../../orchestration/decisions.json)
95
- --env-file <path> Load defaults from a project-local env file
96
-
97
- Reclassify without refetching (no source network calls):
98
- node wp-discovery.js --reclassify-coverage --out-dir <dir> [--decisions <path>]
99
- [--canonical-coverage <path>]
100
- Rebuilds <out-dir>/plugin-coverage.json from the stored plugin-inventory.json, the prior
101
- coverage's entityStats/review evidence, and the current profiles, registers, target
102
- knowledge and decisions. Also rewrites --canonical-coverage (default:
103
- <out-dir>/../../discovery/plugin-coverage.json when that directory exists). Exits 3 with
104
- outcome needs-full-discovery, writing nothing, when the stored evidence is incomplete.
105
-
106
- Authentication options:
107
- --username <name> WordPress username for Application Password auth
108
- --application-password <pw> WordPress Application Password
109
- --api-key <token> API key/token for custom auth setups
110
- --api-key-header <name> Header name for --api-key. Defaults to Authorization
111
- --auth-header <'Name: Value'> Add a raw HTTP header. Can be repeated.
112
-
113
- Optional:
114
- --sample-limit <n> Number of sample records per entity. Default: 3
115
- --timeout-ms <n> Request timeout in ms. Default: 60000
116
- --rate-limit-rpm <n> Max requests per minute. Default: 120
117
- --max-retries <n> Retries on 429/503 (honors Retry-After). Default: 3
118
- --commerce-mode <mode> WooCommerce read mode: public | authenticated.
119
- Defaults to public without auth, otherwise authenticated.
120
- --no-plugin-inventory Skip plugin detection, Tier-B derivation, and coverage.
121
- --no-html-fingerprint Skip the homepage fetch used for asset-path fingerprints.
122
- --include-namespace <ns> Only inspect a namespace. Can be repeated.
123
- --include-route <path> Force-sample a route. Can be repeated.
124
- --include-excluded-category <category>
125
- Force-sample an excluded category. Can be repeated.
126
- --exclude-route <path> Skip a route even if otherwise sampled. Can be repeated.
127
- --override-reason <text> Reason recorded for include/exclude overrides.
128
- --progress-log <path> Append progress NDJSON records to this file.
129
- --help Show this help text
130
-
131
- Examples:
132
- node wp-discovery.js \
133
- --base-url https://example.com \
134
- --out-dir migrations/acme/data/wp-discovery \
135
- --username admin \
136
- --application-password 'abcd efgh ijkl mnop'
137
-
138
- node wp-discovery.js \
139
- --base-url https://example.com \
140
- --out-dir migrations/acme/data/wp-discovery \
141
- --api-key $WP_API_KEY \
142
- --api-key-header X-API-Key
143
- `);
144
- }
145
-
146
- function parseArgs(argv) {
147
- const args = {
148
- authHeaders: [],
149
- includeNamespaces: [],
150
- includeRoutes: [],
151
- includeExcludedCategories: [],
152
- excludeRoutes: [],
153
- overrideReason: null,
154
- sampleLimit: DEFAULT_SAMPLE_LIMIT,
155
- timeoutMs: DEFAULT_TIMEOUT_MS,
156
- rateLimitRpm: DEFAULT_RATE_LIMIT_RPM,
157
- maxRetries: DEFAULT_MAX_RETRIES,
158
- commerceMode: null,
159
- pluginInventory: true,
160
- htmlFingerprint: true,
161
- };
162
-
163
- for (let i = 0; i < argv.length; i += 1) {
164
- const arg = argv[i];
165
- const next = argv[i + 1];
166
-
167
- switch (arg) {
168
- case '--help':
169
- case '-h':
170
- args.help = true;
171
- break;
172
- case '--base-url':
173
- args.baseUrl = next;
174
- i += 1;
175
- break;
176
- case '--out-dir':
177
- args.outDir = next;
178
- i += 1;
179
- break;
180
- case '--decisions':
181
- args.decisions = next;
182
- i += 1;
183
- break;
184
- case '--env-file':
185
- args.envFile = next;
186
- i += 1;
187
- break;
188
- case '--username':
189
- args.username = next;
190
- i += 1;
191
- break;
192
- case '--application-password':
193
- args.applicationPassword = next;
194
- i += 1;
195
- break;
196
- case '--api-key':
197
- args.apiKey = next;
198
- i += 1;
199
- break;
200
- case '--api-key-header':
201
- args.apiKeyHeader = next;
202
- i += 1;
203
- break;
204
- case '--auth-header':
205
- args.authHeaders.push(next);
206
- i += 1;
207
- break;
208
- case '--sample-limit':
209
- args.sampleLimit = Number.parseInt(next, 10);
210
- i += 1;
211
- break;
212
- case '--timeout-ms':
213
- args.timeoutMs = Number.parseInt(next, 10);
214
- i += 1;
215
- break;
216
- case '--rate-limit-rpm':
217
- args.rateLimitRpm = Number.parseInt(next, 10);
218
- i += 1;
219
- break;
220
- case '--max-retries':
221
- args.maxRetries = Number.parseInt(next, 10);
222
- i += 1;
223
- break;
224
- case '--commerce-mode':
225
- args.commerceMode = next;
226
- i += 1;
227
- break;
228
- case '--include-namespace':
229
- args.includeNamespaces.push(next);
230
- i += 1;
231
- break;
232
- case '--include-route':
233
- args.includeRoutes.push(next);
234
- i += 1;
235
- break;
236
- case '--include-excluded-category':
237
- args.includeExcludedCategories.push(next);
238
- i += 1;
239
- break;
240
- case '--exclude-route':
241
- args.excludeRoutes.push(next);
242
- i += 1;
243
- break;
244
- case '--override-reason':
245
- args.overrideReason = next;
246
- i += 1;
247
- break;
248
- case '--no-plugin-inventory':
249
- args.pluginInventory = false;
250
- break;
251
- case '--no-html-fingerprint':
252
- args.htmlFingerprint = false;
253
- break;
254
- case '--reclassify-coverage':
255
- args.reclassifyCoverage = true;
256
- break;
257
- case '--canonical-coverage':
258
- args.canonicalCoverage = next;
259
- i += 1;
260
- break;
261
- // Fixture-tree overrides for tests; both default to the installed skill.
262
- case '--plugins-root':
263
- args.pluginsRoot = next;
264
- i += 1;
265
- break;
266
- case '--target-knowledge-root':
267
- args.targetKnowledgeRoot = next;
268
- i += 1;
269
- break;
270
- default:
271
- if (arg.startsWith('--')) {
272
- throw new Error(`Unknown argument: ${arg}`);
273
- }
274
- }
275
- }
276
-
277
- if (!args.baseUrl) {
278
- args.baseUrl = process.env.WP_BASE_URL || process.env.WP_SITE_URL;
279
- }
280
- if (!args.outDir) {
281
- args.outDir = process.env.WP_DISCOVERY_OUT_DIR;
282
- }
283
- if (!args.apiKey) {
284
- args.apiKey = process.env.WP_API_KEY;
285
- }
286
- if (!args.apiKeyHeader) {
287
- args.apiKeyHeader = process.env.WP_API_KEY_HEADER;
288
- }
289
- if (!args.username) {
290
- args.username = process.env.WP_USERNAME;
291
- }
292
- if (!args.applicationPassword) {
293
- args.applicationPassword = process.env.WP_APPLICATION_PASSWORD;
294
- }
295
- if (!args.migrationKey) {
296
- args.migrationKey = process.env.WMH2_MIGRATION_KEY;
297
- }
298
- if (args.authHeaders.length === 0 && process.env.WP_AUTH_HEADER) {
299
- args.authHeaders.push(process.env.WP_AUTH_HEADER);
300
- }
301
-
302
- if (!Number.isFinite(args.sampleLimit) || args.sampleLimit < 1) {
303
- args.sampleLimit = DEFAULT_SAMPLE_LIMIT;
304
- }
305
- if (!Number.isFinite(args.timeoutMs) || args.timeoutMs < 1000) {
306
- args.timeoutMs = DEFAULT_TIMEOUT_MS;
307
- }
308
- if (!Number.isFinite(args.rateLimitRpm) || args.rateLimitRpm < 1) {
309
- args.rateLimitRpm = DEFAULT_RATE_LIMIT_RPM;
310
- }
311
- if (!Number.isFinite(args.maxRetries) || args.maxRetries < 0) {
312
- args.maxRetries = DEFAULT_MAX_RETRIES;
313
- }
314
- if (args.commerceMode !== 'public' && args.commerceMode !== 'authenticated') {
315
- args.commerceMode = (args.username && args.applicationPassword) || args.apiKey || args.authHeaders.length > 0
316
- ? 'authenticated'
317
- : 'public';
318
- }
319
-
320
- return args;
321
- }
322
-
323
- async function hydrateArgsFromEnvFile(args) {
324
- if (!args.envFile) {
325
- return args;
326
- }
327
-
328
- const envValues = await readEnvFile(path.resolve(args.envFile));
329
- if (!args.baseUrl && envValues.WP_BASE_URL) {
330
- args.baseUrl = envValues.WP_BASE_URL;
331
- }
332
- if (!args.username && envValues.WP_USERNAME) {
333
- args.username = envValues.WP_USERNAME;
334
- }
335
- if (!args.applicationPassword && envValues.WP_APPLICATION_PASSWORD) {
336
- args.applicationPassword = envValues.WP_APPLICATION_PASSWORD;
337
- }
338
- if (!args.migrationKey && envValues.WMH2_MIGRATION_KEY) {
339
- args.migrationKey = envValues.WMH2_MIGRATION_KEY;
340
- }
341
- if (!args.apiKey && envValues.WP_API_KEY) {
342
- args.apiKey = envValues.WP_API_KEY;
343
- }
344
- if (!args.apiKeyHeader && envValues.WP_API_KEY_HEADER) {
345
- args.apiKeyHeader = envValues.WP_API_KEY_HEADER;
346
- }
347
- if (args.authHeaders.length === 0 && envValues.WP_AUTH_HEADER) {
348
- args.authHeaders.push(envValues.WP_AUTH_HEADER);
349
- }
350
-
351
- return args;
352
- }
353
-
354
- function endpointMethods(endpoint) {
355
- const raw = endpoint?.methods;
356
- if (Array.isArray(raw)) {
357
- return raw.map(String);
358
- }
359
- if (typeof raw === 'string') {
360
- return raw.split(',').map((value) => value.trim()).filter(Boolean);
361
- }
362
- if (raw && typeof raw === 'object') {
363
- return Object.keys(raw);
364
- }
365
- return [];
366
- }
367
-
368
- function routeSegments(routePath) {
369
- return routePath.split('/').filter(Boolean);
370
- }
371
-
372
- function summarizeRelationships(record) {
373
- const links = record?._links;
374
- if (!links || typeof links !== 'object') {
375
- return [];
376
- }
377
- // HAL housekeeping rels carry no entity relationship signal.
378
- const ignored = new Set(['self', 'collection', 'about', 'curies']);
379
- const relationships = [];
380
-
381
- for (const [rel, entries] of Object.entries(links)) {
382
- if (ignored.has(rel)) {
383
- continue;
384
- }
385
- const list = Array.isArray(entries) ? entries : [entries];
386
- const hrefs = list.map((entry) => entry?.href).filter(Boolean);
387
- if (hrefs.length === 0) {
388
- continue;
389
- }
390
- relationships.push({
391
- rel,
392
- embeddable: list.some((entry) => entry?.embeddable === true),
393
- hrefs,
394
- });
395
- }
396
-
397
- return relationships;
398
- }
399
-
400
- function isParameterizedRoute(routePath) {
401
- return routePath.includes('(?P<');
402
- }
403
-
404
- function slugify(value) {
405
- return value
406
- .toLowerCase()
407
- .replace(/[^a-z0-9]+/g, '-')
408
- .replace(/^-+|-+$/g, '') || 'entity';
409
- }
410
-
411
- function summarizeAuthMode(args) {
412
- if (args.username && args.applicationPassword) {
413
- return 'basic-application-password';
414
- }
415
- if (args.apiKey) {
416
- return `api-key:${args.apiKeyHeader || 'Authorization'}`;
417
- }
418
- if (args.authHeaders.length > 0) {
419
- return 'custom-header';
420
- }
421
- return 'none';
422
- }
423
-
424
- function summarizeBridgeAuthMode(args, namespaces) {
425
- const hasWooCommerce = namespaces.some((namespace) => namespace.startsWith('wc/'));
426
- const hasRestCredential = Boolean(
427
- (args.username && args.applicationPassword) || args.apiKey || args.authHeaders.length > 0,
428
- );
429
- if (args.migrationKey) return 'migration-key';
430
- if (hasWooCommerce && hasRestCredential) return 'wordpress-rest-credential';
431
- if (hasRestCredential) return 'unavailable-without-woocommerce-capability';
432
- return 'none';
433
- }
434
-
435
- function chooseBridgeAuth({ migrationKey, timeoutMs }) {
436
- const useMigrationKey = Boolean(migrationKey);
437
- return {
438
- auth: useMigrationKey
439
- ? { type: 'migration-key', migrationKey, migrationId: randomUUID(), timeoutMs }
440
- : undefined,
441
- structureMethod: useMigrationKey ? 'POST' : 'GET',
442
- queryRoute: useMigrationKey ? '/wix-wp-plugin/v2/query' : '/wix-wp-plugin/v2/query/admin-key',
443
- };
444
- }
445
-
446
- function summarizeOverrides(args) {
447
- return {
448
- includeRoutes: args.includeRoutes,
449
- includeNamespaces: args.includeNamespaces,
450
- includeExcludedCategories: args.includeExcludedCategories,
451
- excludeRoutes: args.excludeRoutes,
452
- overrideReason: args.overrideReason,
453
- commerceMode: args.commerceMode,
454
- };
455
- }
456
-
457
- function deriveEntityCandidates(indexJson, includeNamespaces, requestOverrides = new Map()) {
458
- const routes = indexJson?.routes || {};
459
- const candidates = [];
460
-
461
- for (const [routePath, routeDefinition] of Object.entries(routes)) {
462
- if (!routePath.startsWith('/') || routePath === '/' || isParameterizedRoute(routePath)) {
463
- continue;
464
- }
465
-
466
- const segments = routeSegments(routePath);
467
- if (segments.length < 2) {
468
- continue;
469
- }
470
-
471
- const namespace = segments.slice(0, 2).join('/');
472
- if (includeNamespaces.length > 0 && !includeNamespaces.includes(namespace)) {
473
- continue;
474
- }
475
-
476
- const endpoints = Array.isArray(routeDefinition?.endpoints) ? routeDefinition.endpoints : [];
477
- // A profile may declare that this entity's real read path is not GET (see
478
- // plugin-knowledge.js buildRequestOverrides) — the declared method then stands in for
479
- // the GET-collection requirement below, generically for any plugin/entity.
480
- const requestOverride = requestOverrides.get(routePath) || null;
481
- const getEndpoint = requestOverride
482
- ? endpoints.find((endpoint) => endpointMethods(endpoint).includes(requestOverride.method))
483
- : endpoints.find((endpoint) => endpointMethods(endpoint).includes('GET'));
484
- if (!getEndpoint) {
485
- continue;
486
- }
487
-
488
- const entityName = segments[segments.length - 1];
489
- const supportsPagination = Boolean(getEndpoint?.args?.page || getEndpoint?.args?.per_page);
490
- const hasSchema = Boolean(getEndpoint?.schema || routeDefinition?.schema);
491
-
492
- // The generic shape heuristic (schema or pagination or 3+ path segments) exists to
493
- // filter out config/dashboard noise when nothing else vouches for a route. A profile
494
- // explicitly declaring a request override already is that vouching — same principle as
495
- // profile-declared routes outranking the classifier's shape rules.
496
- if (!requestOverride && !hasSchema && !supportsPagination && segments.length < 3) {
497
- continue;
498
- }
499
-
500
- // Derive the file name from the full path after the namespace so distinct
501
- // routes that share a last segment (e.g. /wp/v2/categories vs.
502
- // /wp/v2/block-patterns/categories) do not collide onto one file.
503
- const pathSlug = slugify(segments.slice(2).join('-')) || slugify(entityName);
504
-
505
- candidates.push({
506
- entityName,
507
- namespace,
508
- routePath,
509
- endpoints,
510
- getEndpoint,
511
- routeDefinition,
512
- supportsPagination,
513
- requestOverride,
514
- fileName: `${slugify(namespace)}--${pathSlug}.md`,
515
- });
516
- }
517
-
518
- const unique = new Map();
519
- for (const candidate of candidates) {
520
- const key = `${candidate.namespace}:${candidate.routePath}`;
521
- if (!unique.has(key)) {
522
- unique.set(key, candidate);
523
- }
524
- }
525
-
526
- return [...unique.values()].sort((a, b) => a.routePath.localeCompare(b.routePath));
527
- }
528
-
529
- // Finds every route named by a "$SAMPLED_IDS:<route>" placeholder anywhere
530
- // inside a requestOverride body, however deeply nested. A body may reference more than one
531
- // route (e.g. two independent id lists); collecting all of them, not just the first match, is
532
- // what lets the pagination+batch mechanism below (lib/sampled-ids-batch.js) discover every
533
- // route it must paginate to exhaustion rather than resolving one placeholder to []. Generic
534
- // body-walk, no field names baked in.
535
- function findSampledIdsDependencies(value, found = new Set()) {
536
- if (Array.isArray(value)) {
537
- for (const item of value) {
538
- findSampledIdsDependencies(item, found);
539
- }
540
- } else if (value && typeof value === 'object') {
541
- for (const nested of Object.values(value)) {
542
- findSampledIdsDependencies(nested, found);
543
- }
544
- } else if (typeof value === 'string') {
545
- const match = value.match(/^\$SAMPLED_IDS:(.+)$/);
546
- if (match) found.add(match[1]);
547
- }
548
- return found;
549
- }
550
-
551
- // Resolves a dot-path ("data.items", "data.meta.count") against a response body for a
552
- // responseEnvelope-declaring entity. Returns undefined on any missing/non-object segment
553
- // rather than throwing, so an envelope path that stops matching (a plugin update, a stale
554
- // profile) degrades to the safe fallback in inspectEntity instead of crashing the run.
555
- function getAtPath(value, dotPath) {
556
- return String(dotPath).split('.').reduce(
557
- (acc, key) => (acc && typeof acc === 'object' ? acc[key] : undefined),
558
- value,
559
- );
560
- }
561
-
562
- // Deep-resolves a profile-declared requestBody template against a batch's ids. `idsByRoute` is
563
- // a plain `{ route: string[] }` map — for the $SAMPLED_IDS mechanism this is
564
- // always the CURRENT BATCH's ids for the route being paginated, resolved fresh per batch, never
565
- // a fixed full list baked into one oversized request. Generic across any entity/route pair —
566
- // the placeholder names the OTHER route's ids it wants, nothing plugin-specific lives here.
567
- function resolveRequestBody(template, idsByRoute) {
568
- if (Array.isArray(template)) {
569
- return template.map((value) => resolveRequestBody(value, idsByRoute));
570
- }
571
- if (template && typeof template === 'object') {
572
- const resolved = {};
573
- for (const [key, value] of Object.entries(template)) {
574
- resolved[key] = resolveRequestBody(value, idsByRoute);
575
- }
576
- return resolved;
577
- }
578
- if (typeof template === 'string') {
579
- const match = template.match(/^\$SAMPLED_IDS:(.+)$/);
580
- if (match) {
581
- return (idsByRoute && idsByRoute[match[1]]) || [];
582
- }
583
- }
584
- return template;
585
- }
586
-
587
- // Envelope resolution + fragment-group reassembly, shared by the single-fetch path below and
588
- // by every batch of the paginate+batch path (lib/sampled-ids-batch.js) — one profile's response
589
- // shape must normalize the same way regardless of which path fetched it. Pushes discovery
590
- // notes only when `notes` is provided (batched callers pass it for the first batch only, since
591
- // the shape characteristic belongs to the endpoint, not to any one batch). Returns `{ ok,
592
- // records }`: `ok: false` means the payload did not resolve to an array after envelope
593
- // resolution (when declared) and fragment reassembly (when declared) — a genuine shape
594
- // mismatch, not "zero records" — and callers on the batched path must treat that as a failure
595
- // to defer on, never silently as an empty batch (an enveloped response whose itemsPath
596
- // mismatches would otherwise look like an authoritative, exact zero).
597
- function normalizeResponseRecords(payload, { envelope, fragmentGroupSize, notes } = {}) {
598
- let effectivePayload = payload;
599
- if (envelope) {
600
- const items = getAtPath(payload, envelope.itemsPath);
601
- if (Array.isArray(items)) {
602
- effectivePayload = items;
603
- } else if (notes) {
604
- notes.push(`responseEnvelope.itemsPath="${envelope.itemsPath}" did not resolve to an array on this response; falling back to the raw payload shape. The profile may be stale or the plugin version differs.`);
605
- }
606
- }
607
- if (fragmentGroupSize && Array.isArray(effectivePayload)) {
608
- const completeGroups = Math.floor(effectivePayload.length / fragmentGroupSize);
609
- const reassembled = [];
610
- for (let i = 0; i < completeGroups; i += 1) {
611
- reassembled.push(Object.assign({}, ...effectivePayload.slice(i * fragmentGroupSize, (i + 1) * fragmentGroupSize)));
612
- }
613
- if (notes && effectivePayload.length % fragmentGroupSize !== 0) {
614
- notes.push(`Response length ${effectivePayload.length} is not a multiple of the declared responseFragmentGroupSize=${fragmentGroupSize}; the trailing ${effectivePayload.length % fragmentGroupSize} fragment(s) were dropped rather than emitted as a broken record.`);
615
- }
616
- if (notes) {
617
- notes.push(`Response records were flattened into groups of ${fragmentGroupSize} single-key fragments (per profile responseFragmentGroupSize) and reassembled into one object per record.`);
618
- }
619
- effectivePayload = reassembled;
620
- }
621
- const ok = Array.isArray(effectivePayload);
622
- return { ok, records: ok ? effectivePayload : [] };
623
- }
624
-
625
- async function inspectEntity(baseUrl, headers, candidate, options) {
626
- const details = {
627
- entityName: candidate.entityName,
628
- namespace: candidate.namespace,
629
- routePath: candidate.routePath,
630
- fileName: candidate.fileName,
631
- classification: candidate.classification || null,
632
- methods: [...new Set(candidate.endpoints.flatMap(endpointMethods))].sort(),
633
- supportsPagination: candidate.supportsPagination,
634
- discoveryNotes: [],
635
- requestErrors: [],
636
- collectionArgs: candidate.getEndpoint?.args || null,
637
- schema: candidate.getEndpoint?.schema || candidate.routeDefinition?.schema || null,
638
- optionsSchema: null,
639
- sampleRecords: [],
640
- sampleRecordCount: 0,
641
- recordCount: null,
642
- inUse: null,
643
- relationships: [],
644
- responseShape: 'unknown',
645
- };
646
-
647
- const optionsResponse = await fetchJson(baseUrl, candidate.routePath, {
648
- headers,
649
- method: 'OPTIONS',
650
- timeoutMs: options.timeoutMs,
651
- progress: options.progress,
652
- progressContext: {
653
- step: 'inspect-endpoint',
654
- entity: candidate.routePath,
655
- },
656
- });
657
-
658
- if (optionsResponse.ok && optionsResponse.json) {
659
- const optionEndpoints = Array.isArray(optionsResponse.json?.endpoints) ? optionsResponse.json.endpoints : [];
660
- const getEndpoint = optionEndpoints.find((endpoint) => endpointMethods(endpoint).includes('GET'));
661
- if (getEndpoint?.args) {
662
- details.collectionArgs = getEndpoint.args;
663
- }
664
- if (optionsResponse.json?.schema) {
665
- details.optionsSchema = optionsResponse.json.schema;
666
- details.schema = optionsResponse.json.schema;
667
- } else if (getEndpoint?.schema) {
668
- details.optionsSchema = getEndpoint.schema;
669
- details.schema = getEndpoint.schema;
670
- }
671
- } else if (optionsResponse.status !== 404 && optionsResponse.status !== 405) {
672
- details.requestErrors.push({
673
- request: 'OPTIONS',
674
- routePath: candidate.routePath,
675
- status: optionsResponse.status,
676
- statusText: optionsResponse.statusText,
677
- url: optionsResponse.url,
678
- });
679
- }
680
-
681
- // A profile may declare that this entity's real read path is a non-GET request with a
682
- // JSON body — generic across any plugin/entity, not special-cased here.
683
- const requestOverride = options.requestOverride || null;
684
- const dependencyRoutes = requestOverride ? [...findSampledIdsDependencies(requestOverride.body)] : [];
685
-
686
- if (requestOverride && dependencyRoutes.length > 0) {
687
- // The $SAMPLED_IDS mechanism always means "paginate the dependency route to exhaustion,
688
- // then batch-query this route" — the dependency's record count is unknown, so
689
- // there is no bounded "small sample" variant that is safe to assume complete. This is the
690
- // ENTIRE meaning of a $SAMPLED_IDS placeholder now, in both discovery and any generated
691
- // reader (see rp-import-codegen's sourceMeta contract).
692
- return inspectDependentEntity(baseUrl, headers, candidate, options, details, requestOverride, dependencyRoutes);
693
- }
694
-
695
- let sampleResponse;
696
- if (requestOverride) {
697
- // A fixed-body override with no $SAMPLED_IDS placeholder — single request, unbounded by
698
- // definition since nothing here scales with another route's record count.
699
- const resolvedBody = resolveRequestBody(requestOverride.body, {});
700
- details.discoveryNotes.push(
701
- `Sampled via profile-declared ${requestOverride.method} request with a JSON body, not a plain GET collection.`,
702
- );
703
- sampleResponse = await fetchJson(baseUrl, candidate.routePath, {
704
- // `headers` is a real Headers instance (wp-http.js buildHeaders) — spreading it
705
- // would silently drop every entry including Authorization, since Headers is not a
706
- // plain object. Clone it properly instead.
707
- headers: (() => {
708
- const withBody = new Headers(headers);
709
- withBody.set('content-type', 'application/json');
710
- return withBody;
711
- })(),
712
- method: requestOverride.method,
713
- body: JSON.stringify(resolvedBody),
714
- timeoutMs: options.timeoutMs,
715
- progress: options.progress,
716
- progressContext: {
717
- step: 'inspect-endpoint',
718
- entity: candidate.routePath,
719
- },
720
- });
721
- } else {
722
- // Per-route default query (see ROUTE_DEFAULT_QUERY_RULES): some collection routes apply
723
- // a default filter when the caller sends none, so sampling with `per_page` alone reads a
724
- // subset and the plan under-counts. Paging is layered on top; a route with no rule is
725
- // unchanged.
726
- const defaultQuery = options.defaultQuery || {};
727
- const query = {
728
- ...defaultQuery,
729
- ...(candidate.supportsPagination ? { per_page: options.sampleLimit } : {}),
730
- };
731
- if (Object.keys(defaultQuery).length > 0) {
732
- const pairs = Object.entries(defaultQuery).map(([key, value]) => `${key}=${value}`).join('&');
733
- const reason = options.defaultQueryReason ? ` — ${options.defaultQueryReason}` : '';
734
- details.discoveryNotes.push(`Sampled with route default query ${pairs} so the full collection is counted${reason}. Generated readers must send the same parameters.`);
735
- }
736
-
737
- sampleResponse = await fetchJson(baseUrl, candidate.routePath, {
738
- headers,
739
- method: 'GET',
740
- query,
741
- timeoutMs: options.timeoutMs,
742
- progress: options.progress,
743
- progressContext: {
744
- step: 'inspect-endpoint',
745
- entity: candidate.routePath,
746
- },
747
- });
748
- }
749
-
750
- if (sampleResponse.ok) {
751
- const payload = sampleResponse.json;
752
- const totalFromHeader = parseTotalHeader(sampleResponse.headers);
753
-
754
- // responseEnvelope support: some plugin REST APIs (MailPoet's
755
- // /mailpoet/v1/* namespace, verified live 2026-08-11) wrap their records in a body path
756
- // instead of returning a flat array, and carry no X-WP-Total/X-WP-TotalPages headers —
757
- // the total lives inside the body too. Unwrap to the declared path and otherwise treat it
758
- // exactly like a flat array; a path that no longer resolves (stale profile, plugin
759
- // version drift) falls back to the raw payload rather than failing the run.
760
- const envelope = options.responseEnvelope || null;
761
- let effectivePayload = payload;
762
- let envelopeCount = null;
763
- if (envelope) {
764
- const items = getAtPath(payload, envelope.itemsPath);
765
- if (Array.isArray(items)) {
766
- effectivePayload = items;
767
- envelopeCount = envelope.countPath ? getAtPath(payload, envelope.countPath) : null;
768
- } else {
769
- details.discoveryNotes.push(`responseEnvelope.itemsPath="${envelope.itemsPath}" did not resolve to an array on this response; falling back to the raw payload shape. The profile may be stale or the plugin version differs.`);
770
- }
771
- }
772
-
773
- // responseFragmentGroupSize support: some plugin REST APIs (Back In Stock Notifier's
774
- // list_subscriber, verified live 2026-08-19) emit each logical record as N separate
775
- // single-key array entries in sequence instead of one merged object. Reassemble every N
776
- // entries into one record via Object.assign before anything downstream counts or samples
777
- // — a reader built from a stale sample would otherwise see 4x the real record count and a
778
- // schema missing whichever key happened to be sampled out of order. A trailing partial
779
- // group (malformed response, plugin bug) is dropped and noted rather than emitted broken.
780
- const fragmentGroupSize = options.responseFragmentGroupSize || null;
781
- if (fragmentGroupSize && Array.isArray(effectivePayload)) {
782
- effectivePayload = normalizeResponseRecords(effectivePayload, { fragmentGroupSize, notes: details.discoveryNotes }).records;
783
- }
784
-
785
- if (Array.isArray(effectivePayload)) {
786
- details.responseShape = envelope && effectivePayload !== payload ? 'enveloped-array' : 'array';
787
- details.sampleRecords = effectivePayload.slice(0, options.sampleLimit);
788
- details.sampleRecordCount = effectivePayload.length;
789
- const hasEnvelopeCount = typeof envelopeCount === 'number';
790
- details.recordCount = hasEnvelopeCount ? envelopeCount : (totalFromHeader !== null ? totalFromHeader : effectivePayload.length);
791
- details.inUse = details.recordCount > 0;
792
- if (details.responseShape === 'enveloped-array' && !hasEnvelopeCount) {
793
- details.discoveryNotes.push(`responseEnvelope has no working countPath (itemsPath="${envelope.itemsPath}"); recordCount reflects only the sampled page and may undercount the true total.`);
794
- } else if (details.responseShape === 'array' && totalFromHeader === null) {
795
- details.discoveryNotes.push('No X-WP-Total header returned; recordCount reflects only the sampled page and may undercount the true total.');
796
- }
797
- if (candidate.routePath.startsWith('/wc/store/v1/') && !Object.keys(sampleResponse.headers || {}).some((key) => key.toLowerCase() === 'x-wp-totalpages')) {
798
- details.discoveryNotes.push('WooCommerce Store API route does not advertise X-WP-TotalPages; generated readers must stop on a short page when bulk-extracting this entity.');
799
- }
800
- if (effectivePayload.length === 0) {
801
- details.discoveryNotes.push('Endpoint returned an empty array. The entity is advertised but appears unused (no records).');
802
- }
803
- } else if (effectivePayload && typeof effectivePayload === 'object') {
804
- details.responseShape = 'object';
805
- details.sampleRecords = [effectivePayload];
806
- details.sampleRecordCount = 1;
807
- details.recordCount = totalFromHeader !== null ? totalFromHeader : 1;
808
- details.inUse = details.recordCount > 0;
809
- } else {
810
- details.responseShape = typeof effectivePayload;
811
- details.discoveryNotes.push(`Endpoint returned a non-object payload of type ${typeof effectivePayload}.`);
812
- }
813
-
814
- const firstRecord = details.sampleRecords[0];
815
- if (firstRecord && typeof firstRecord === 'object') {
816
- details.relationships = summarizeRelationships(firstRecord);
817
- }
818
- } else {
819
- details.requestErrors.push({
820
- request: requestOverride ? requestOverride.method : 'GET',
821
- routePath: candidate.routePath,
822
- status: sampleResponse.status,
823
- statusText: sampleResponse.statusText,
824
- url: sampleResponse.url,
825
- body: sampleResponse.text ? sampleResponse.text.slice(0, 1000) : '',
826
- });
827
- }
828
-
829
- return details;
830
- }
831
-
832
- // Paginates every $SAMPLED_IDS dependency route to exhaustion, then batch-queries `candidate`'s
833
- // route — split out of inspectEntity because it is a fundamentally different shape
834
- // (two routes, many requests, an explicit fail/defer path) from a single-fetch inspection.
835
- // Assumes a single batching axis: when a body references more than one dependency route, only
836
- // the first drives batching (noted below) — no known profile needs two independent id lists
837
- // batched together, and this stays honest about that boundary rather than guessing a policy.
838
- async function inspectDependentEntity(baseUrl, headers, candidate, options, details, requestOverride, dependencyRoutes) {
839
- const batchRoute = dependencyRoutes[0];
840
- if (dependencyRoutes.length > 1) {
841
- details.discoveryNotes.push(
842
- `requestBody references multiple $SAMPLED_IDS routes (${dependencyRoutes.join(', ')}); only the first, ${batchRoute}, drives pagination/batching — a profile needing more than one independent id list is not yet supported generically.`,
843
- );
844
- }
845
-
846
- const paged = await collectAllIds({
847
- baseUrl,
848
- headers,
849
- route: batchRoute,
850
- timeoutMs: options.timeoutMs,
851
- progress: options.progress,
852
- });
853
- if (!paged.ok) {
854
- // Fail/defer explicitly: recordCount/inUse stay at their initial `null`, which
855
- // is this codebase's existing "unknown, not zero" signal, backed by a requestErrors entry
856
- // explaining exactly which page of which route failed — never a false empty or a silent
857
- // undercount from whatever ids were collected before the failure.
858
- details.requestErrors.push({
859
- request: 'GET',
860
- routePath: paged.failure.route,
861
- status: paged.failure.status,
862
- statusText: paged.failure.statusText,
863
- url: null,
864
- body: `Failed while paginating the $SAMPLED_IDS dependency route ${paged.failure.route} at page ${paged.failure.page}. ${candidate.routePath}'s record count and schema are unknown and must be treated as deferred, not reported as empty.`,
865
- });
866
- return details;
867
- }
868
-
869
- details.discoveryNotes.push(
870
- `Sampled via profile-declared ${requestOverride.method} request with a JSON body, against the FULL paginated id list of ${batchRoute} (${paged.ids.length} ids across ${Math.ceil(paged.ids.length / DEFAULT_BATCH_SIZE)} batches of up to ${DEFAULT_BATCH_SIZE}) rather than a fixed small sample.`,
871
- );
872
-
873
- let shapeNotesEmitted = false;
874
- const batched = await queryInBatches({
875
- baseUrl,
876
- headers,
877
- route: candidate.routePath,
878
- method: requestOverride.method,
879
- ids: paged.ids,
880
- recordKeyField: options.recordKeyField || 'id',
881
- buildBody: (batchIds) => resolveRequestBody(requestOverride.body, { [batchRoute]: batchIds.map(String) }),
882
- // Pass the RAW batch JSON through — response.json may be an enveloped object, not an
883
- // array, and normalizeResponseRecords (not this callback) is what unwraps it. Returning
884
- // its {ok, records} result unchanged is what lets queryInBatches distinguish "this batch's
885
- // response didn't match the declared shape" from "this batch legitimately matched zero
886
- // subscribers" and defer on the former instead of counting it as an exact zero.
887
- normalizeBatch: (rawJson) => {
888
- const normalized = normalizeResponseRecords(rawJson, {
889
- envelope: options.responseEnvelope,
890
- fragmentGroupSize: options.responseFragmentGroupSize,
891
- notes: shapeNotesEmitted ? null : details.discoveryNotes,
892
- });
893
- shapeNotesEmitted = true;
894
- return normalized;
895
- },
896
- timeoutMs: options.timeoutMs,
897
- progress: options.progress,
898
- });
899
- if (!batched.ok) {
900
- const shapeFailure = batched.failure.reason === 'invalid-shape';
901
- details.requestErrors.push({
902
- request: requestOverride.method,
903
- routePath: batched.failure.route,
904
- status: batched.failure.status,
905
- statusText: batched.failure.statusText,
906
- url: null,
907
- body: shapeFailure
908
- ? `Batch ${batched.failure.batchIndex + 1} (${batched.failure.batchSize} ids) returned a ${batched.failure.status} response that did not match the declared response shape (responseEnvelope/responseFragmentGroupSize). Batches already merged before this failure are discarded — ${candidate.routePath}'s record count and schema are unknown and must be treated as deferred, not reported as an exact zero.`
909
- : `Failed on batch ${batched.failure.batchIndex + 1} (${batched.failure.batchSize} ids). Batches already merged before this failure are discarded — ${candidate.routePath}'s record count and schema are unknown and must be treated as deferred, not reported as a partial undercount.`,
910
- });
911
- return details;
912
- }
913
-
914
- details.responseShape = 'array';
915
- details.sampleRecords = batched.records.slice(0, options.sampleLimit);
916
- details.sampleRecordCount = batched.records.length;
917
- // Exact, not an estimate: every dependency id was queried and every batch's records were
918
- // deduplicated, unlike the sampled-page count elsewhere in this function.
919
- details.recordCount = batched.records.length;
920
- details.inUse = details.recordCount > 0;
921
- details.discoveryNotes.push('recordCount reflects the full deduplicated merge across every batch of the complete dependency id list, not a sampled page — this total is exact.');
922
- if (batched.records.length === 0) {
923
- details.discoveryNotes.push('No records matched any batch across the full paginated dependency id list. The entity is advertised but appears unused (no records).');
924
- }
925
- const firstRecord = details.sampleRecords[0];
926
- if (firstRecord && typeof firstRecord === 'object') {
927
- details.relationships = summarizeRelationships(firstRecord);
928
- }
929
- return details;
930
- }
931
-
932
- function markdownJsonBlock(value) {
933
- if (value === null || value === undefined) {
934
- return '\n\n`Unavailable`';
935
- }
936
-
937
- return `\n\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
938
- }
939
-
940
- function renderEntityFile(details) {
941
- const errorLines = details.requestErrors.length > 0
942
- ? details.requestErrors.map((error) => `- ${error.request} ${error.routePath}: ${error.status} ${error.statusText}`).join('\n')
943
- : '- None';
944
-
945
- const notes = details.discoveryNotes.length > 0
946
- ? details.discoveryNotes.map((note) => `- ${note}`).join('\n')
947
- : '- None';
948
-
949
- const relationshipLines = details.relationships.length > 0
950
- ? details.relationships
951
- .map((relationship) => `- \`${relationship.rel}\`${relationship.embeddable ? ' (embeddable)' : ''} → ${relationship.hrefs.join(', ')}`)
952
- .join('\n')
953
- : '- None detected (no `_links` in sample record)';
954
-
955
- const recordCountLabel = details.recordCount === null ? 'unknown' : String(details.recordCount);
956
- const inUseLabel = details.inUse === null ? 'unknown' : details.inUse ? 'yes' : 'no (advertised but empty)';
957
- const classificationLines = details.classification
958
- ? `- Discovery category: \`${details.classification.category}\`\n` +
959
- `- Discovery rule: \`${details.classification.ruleId}\`\n` +
960
- `- Discovery reason: ${details.classification.reason}\n` +
961
- `- Included by override: \`${details.classification.includedByOverride ? 'yes' : 'no'}\`\n` +
962
- `- Excluded by override: \`${details.classification.excludedByOverride ? 'yes' : 'no'}\`\n`
963
- : '';
964
-
965
- return `# ${details.entityName}\n\n` +
966
- `- Namespace: \`${details.namespace}\`\n` +
967
- `- Route: \`${details.routePath}\`\n` +
968
- classificationLines +
969
- `- Methods: ${details.methods.map((method) => `\`${method}\``).join(', ') || '`unknown`'}\n` +
970
- `- Response shape: \`${details.responseShape}\`\n` +
971
- `- Record count: \`${recordCountLabel}\`\n` +
972
- `- In use: \`${inUseLabel}\`\n` +
973
- `- Sample records captured: ${details.sampleRecords.length}\n\n` +
974
- `## Notes\n${notes}\n\n` +
975
- `## Relationships\n${relationshipLines}\n\n` +
976
- `## Request Errors\n${errorLines}\n\n` +
977
- `## Schema${markdownJsonBlock(details.schema)}\n\n` +
978
- `## Collection Args${markdownJsonBlock(details.collectionArgs)}\n\n` +
979
- `## Sample Records${markdownJsonBlock(details.sampleRecords)}\n`;
980
- }
981
-
982
- function renderPluginSection(context) {
983
- if (!context.plugins) {
984
- return `## Plugin Coverage\n\nPlugin inventory was not run for this capture.\n\n`;
985
- }
986
-
987
- const { detection, coverage, summary, unprofiled } = context.plugins;
988
- const rows = coverage
989
- .map((row) => {
990
- const via = row.status === 'migration-planned' ? `${row.via} · ${row.confidence}` : '-';
991
- const blocked = (row.blocked || []).length > 0
992
- ? row.blocked.map((blocker) => `${blocker.kind}${blocker.declined ? ' (declined)' : ''}`).join(', ')
993
- : '-';
994
- return `| ${row.capability} | \`${row.status}\` | ${via} | ${row.recognized ? 'yes' : 'no'} | ${row.plugins.join(', ') || '-'} | \`${row.channel || 'none'}\` | ${blocked} | ${row.action ? row.action : '-'} |`;
995
- })
996
- .join('\n');
997
-
998
- const authNote = detection.pluginListAvailable
999
- ? ''
1000
- : `**\`GET /wp/v2/plugins\` was unavailable**, so installed-but-unprofiled plugins could not be enumerated. ` +
1001
- `Detection used REST namespaces, declared routes, registered types/taxonomies, and public asset paths only. ` +
1002
- `Re-run with an administrator credential for a complete plugin list.\n\n`;
1003
-
1004
- const installedRows = detection.installedButUnprofiled
1005
- .map((entry) => `- \`${entry.plugin}\`${entry.name ? ` (${entry.name})` : ''}${entry.active ? '' : ' — inactive'}`)
1006
- .join('\n') || '- None';
1007
-
1008
- const unprofiledRows = unprofiled
1009
- .map((entry) => `- \`${entry.namespace}\`: ${entry.routes.length} route(s) accepted by shape`)
1010
- .join('\n') || '- None';
1011
-
1012
- return `## Plugin Coverage\n\n` +
1013
- authNote +
1014
- `- Recognized plugins detected: ${detection.detected.length}\n` +
1015
- `- Derived entities (no profile): ${context.plugins.genericEntities.length}\n` +
1016
- `- Unprofiled namespaces: ${unprofiled.length}\n` +
1017
- `- Installed but unrecognized: ${detection.installedButUnprofiled.length}\n` +
1018
- `- Publicly fingerprinted (named, not enumerated): ${(detection.fingerprinted || []).length}\n` +
1019
- `- Capabilities by status: ${Object.entries(summary.byStatus).map(([status, count]) => `\`${status}\`: ${count}`).join(', ') || 'none'}\n\n` +
1020
- `| Capability | Status | Via | Recognized | Plugins | Channel | Blocked | Action needed |\n` +
1021
- `| --- | --- | --- | --- | --- | --- | --- | --- |\n` +
1022
- `${rows || '| None | - | - | - | - | - | - | - |'}\n\n` +
1023
- `### Installed but unprofiled\n\n${installedRows}\n\n` +
1024
- `### Unprofiled namespaces accepted by shape\n\n${unprofiledRows}\n\n` +
1025
- `Full coverage evidence: [plugin-coverage.json](./plugin-coverage.json) · ` +
1026
- `detection evidence: [plugin-inventory.json](./plugin-inventory.json)\n\n`;
1027
- }
1028
-
1029
- function renderIndexFile(context) {
1030
- const entityRows = context.entities.map((entity) => {
1031
- const status = entity.requestErrors.length > 0 ? 'partial' : 'ok';
1032
- const recordCountLabel = entity.recordCount === null ? '?' : String(entity.recordCount);
1033
- const inUseLabel = entity.inUse === null ? '?' : entity.inUse ? 'yes' : 'no';
1034
- return `| ${entity.entityName} | \`${entity.namespace}\` | \`${entity.routePath}\` | ${recordCountLabel} | ${inUseLabel} | ${entity.sampleRecords.length} | ${status} | [${entity.fileName}](./${entity.fileName}) |`;
1035
- }).join('\n');
1036
-
1037
- const errorLines = context.entities
1038
- .flatMap((entity) => entity.requestErrors.map((error) => `- ${entity.entityName}: ${error.request} ${error.routePath} -> ${error.status} ${error.statusText}`));
1039
- const skippedByCategoryLines = Object.entries(context.skippedByCategory || {})
1040
- .map(([category, count]) => `- \`${category}\`: ${count}`)
1041
- .join('\n') || '- None';
1042
- const overrideLines = [
1043
- `- Include routes: ${context.overrides.includeRoutes.map((route) => `\`${route}\``).join(', ') || '`none`'}`,
1044
- `- Include namespaces: ${context.overrides.includeNamespaces.map((namespace) => `\`${namespace}\``).join(', ') || '`none`'}`,
1045
- `- Include excluded categories: ${context.overrides.includeExcludedCategories.map((category) => `\`${category}\``).join(', ') || '`none`'}`,
1046
- `- Exclude routes: ${context.overrides.excludeRoutes.map((route) => `\`${route}\``).join(', ') || '`none`'}`,
1047
- `- Override reason: ${context.overrides.overrideReason ? context.overrides.overrideReason : '`none`'}`,
1048
- ].join('\n');
1049
-
1050
- const authGatedEntities = context.entities.filter((entity) =>
1051
- entity.requestErrors.some((error) => error.status === 401 || error.status === 403));
1052
- const authWarning = authGatedEntities.length > 0
1053
- ? `## ⚠️ Incomplete Capture (Authentication)\n\n` +
1054
- `${authGatedEntities.length} entit${authGatedEntities.length === 1 ? 'y' : 'ies'} returned 401/403 and ` +
1055
- `could not be captured` +
1056
- `${context.authMode === 'none' ? ' — this run used **no credentials**' : ` with auth mode \`${context.authMode}\` (insufficient scope)`}.\n` +
1057
- `Their \`recordCount\`/\`inUse\` are unreliable: an auth-gated entity can look empty or errored even when the site uses it heavily (e.g. WooCommerce orders/customers, drafts, private fields).\n` +
1058
- `Re-run with credentials for a complete and trustworthy capture.\n\n` +
1059
- `Auth-gated entities: ${authGatedEntities.map((entity) => `\`${entity.entityName}\``).join(', ')}\n\n`
1060
- : '';
1061
-
1062
- const pluginSection = renderPluginSection(context);
1063
-
1064
- return `# WordPress Discovery\n\n` +
1065
- `- Generated at: \`${context.generatedAt}\`\n` +
1066
- `- Base URL: \`${context.baseUrl}\`\n` +
1067
- `- REST root: \`${context.restRoot}\`\n` +
1068
- `- Auth mode: \`${context.authMode}\`\n` +
1069
- `- Advertised auth providers: ${context.authProviders.map((provider) => `\`${provider}\``).join(', ') || '`none`'}\n` +
1070
- `- Namespaces advertised: ${context.namespaces.map((namespace) => `\`${namespace}\``).join(', ') || '`none`'}\n` +
1071
- `- Advertised routes: ${context.totalAdvertisedRoutes}\n` +
1072
- `- Candidate routes after generic filtering: ${context.totalCandidateRoutes}\n` +
1073
- `- Sampled backend data/metadata routes: ${context.sampledRoutes}\n` +
1074
- `- Skipped routes: ${context.skippedRoutes}\n` +
1075
- `- Entities documented: ${context.entities.length}\n\n` +
1076
- authWarning +
1077
- `## Route Scope\n\n` +
1078
- `### Skipped Routes by Category\n\n${skippedByCategoryLines}\n\n` +
1079
- `### Overrides\n\n${overrideLines}\n\n` +
1080
- `Skipped route evidence: [skipped-routes.json](./skipped-routes.json)\n\n` +
1081
- pluginSection +
1082
- `## Discovery Summary\n\n` +
1083
- `| Entity | Namespace | Route | Records | In use | Samples | Status | File |\n` +
1084
- `| --- | --- | --- | ---: | --- | ---: | --- | --- |\n` +
1085
- `${entityRows || '| None | - | - | - | - | 0 | - | - |'}\n\n` +
1086
- `## Route Index Sample${markdownJsonBlock(context.routeIndexSample)}\n\n` +
1087
- `## Errors\n${errorLines.length > 0 ? errorLines.join('\n') : '- None'}\n`;
1088
- }
1089
-
1090
- function skippedRoutesPayload(context) {
1091
- return {
1092
- generatedAt: context.generatedAt,
1093
- totalAdvertisedRoutes: context.totalAdvertisedRoutes,
1094
- totalCandidateRoutes: context.totalCandidateRoutes,
1095
- sampledRoutes: context.sampledRoutes,
1096
- skippedRoutes: context.skippedRoutes,
1097
- overrides: context.overrides,
1098
- routes: context.classifications
1099
- .filter((classification) => classification.effectiveAction === 'skip')
1100
- .map((classification) => ({
1101
- routePath: classification.routePath,
1102
- namespace: classification.namespace,
1103
- category: classification.category,
1104
- reason: classification.reason,
1105
- ruleId: classification.ruleId,
1106
- sampleByDefault: classification.sampleByDefault,
1107
- canIncludeByOverride: classification.canIncludeByOverride,
1108
- includedByOverride: classification.includedByOverride,
1109
- excludedByOverride: classification.excludedByOverride,
1110
- effectiveAction: classification.effectiveAction,
1111
- duplicateOf: classification.duplicateOf,
1112
- overrideReason: classification.overrideReason,
1113
- })),
1114
- };
1115
- }
1116
-
1117
- // orchestration/decisions.json sits two levels above the discovery out-dir in the standard
1118
- // layout (migrations/<project>/data/wp-discovery); --decisions overrides. Missing or
1119
- // unparseable files mean "no answers yet", never an error — the ask may not have run.
1120
- function loadDecisions(args) {
1121
- const filePath = args.decisions
1122
- || (args.outDir ? path.resolve(args.outDir, '..', '..', 'orchestration', 'decisions.json') : null);
1123
- if (!filePath) return {};
1124
- try {
1125
- return JSON.parse(require('node:fs').readFileSync(filePath, 'utf8'));
1126
- } catch {
1127
- return {};
1128
- }
1129
- }
1130
-
1131
- // The batched ask (J1 step 9) records one decision per blocker under the key
1132
- // `pluginBlocker:<capability>:<kind>`; a value of `declined` (or `skipped`) marks it declined.
1133
- function applyBlockerDecisions(rows, decisions) {
1134
- for (const row of rows) {
1135
- for (const blocker of row.blocked || []) {
1136
- const entry = decisions[`pluginBlocker:${row.capability}:${blocker.kind}`];
1137
- if (entry && ['declined', 'skipped'].includes(entry.value)) blocker.declined = true;
1138
- }
1139
- }
1140
- }
1141
-
1142
- function loadTargetKnowledge(domainsDir = null) {
1143
- try {
1144
- const {
1145
- knowledgeRoot,
1146
- knowledgeSummary,
1147
- } = require('../../rp-target-wix/lib/domain-knowledge.js');
1148
- return knowledgeSummary(domainsDir || knowledgeRoot(path.resolve(__dirname, '..', '..', 'rp-target-wix')));
1149
- } catch (error) {
1150
- // A partial install must not break discovery; coverage then reports CMS/native-gap
1151
- // conservatively instead of resolving target refs.
1152
- return { knownRefs: new Set(), capabilityRefs: new Map(), verificationByRef: new Map(), loadError: error.message };
1153
- }
1154
- }
1155
-
1156
- // The record-count note a route's sample left (e.g. no X-WP-Total header), if any.
1157
- function countNoteOf(sampled) {
1158
- return (sampled.discoveryNotes || []).find((note) => /recordCount|undercount|record count/i.test(note)) || null;
1159
- }
1160
-
1161
- // Durable record counts and sample evidence, one key per route of every detected plugin's
1162
- // profile entities (null when the route was not sampled). This is what lets coverage be
1163
- // reclassified later without a source fetch and without silently dropping counts.
1164
- function buildEntityStats(detection, sampledByRoute) {
1165
- const stats = {};
1166
- for (const plugin of detection?.detected || []) {
1167
- for (const entity of plugin.entities || []) {
1168
- if (!entity.route) continue;
1169
- const sampled = sampledByRoute.get(entity.route);
1170
- stats[entity.route] = sampled ? {
1171
- recordCount: sampled.recordCount ?? null,
1172
- inUse: sampled.inUse ?? null,
1173
- sampleRecordCount: sampled.sampleRecordCount ?? (sampled.sampleRecords || []).length,
1174
- countNote: countNoteOf(sampled),
1175
- } : null;
1176
- }
1177
- }
1178
- return Object.fromEntries(Object.entries(stats).sort(([a], [b]) => a.localeCompare(b)));
1179
- }
1180
-
1181
- function entityStatsMap(entityStats) {
1182
- return new Map(Object.entries(entityStats || {}).filter(([, value]) => value && typeof value === 'object'));
1183
- }
1184
-
1185
- // Malformed `pluginCmsFallback:*` keys with no row to carry them (capability not detected, or
1186
- // not eligible): listed once at the top level so the mapping review can show them.
1187
- function cmsFallbackDecisionIssues(rows, decisions) {
1188
- const carried = new Set(rows.filter((row) => row.recognized && row.cmsFallback).map((row) => row.capability));
1189
- const issues = [];
1190
- for (const key of cmsFallbackDecisionKeys(decisions)) {
1191
- const shape = cmsFallbackDecisionShape(key, decisions[key]);
1192
- if (shape.ok || carried.has(cmsFallbackCapabilityOfKey(key))) continue;
1193
- issues.push({ key, problem: shape.problem });
1194
- }
1195
- return issues;
1196
- }
1197
-
1198
- function cmsFallbackDigestFor({ inventory, profiles, targetKnowledge, knowledgeDir, hints, decisions }) {
1199
- return cmsFallbackInputsDigest(cmsFallbackResolutionInputs({
1200
- detectedPlugins: detectedPluginsOf(inventory),
1201
- profiles,
1202
- targetKnowledge,
1203
- registers: {
1204
- cmsFallbackEligible: loadCmsFallbackEligible(knowledgeDir).capabilities || [],
1205
- requiresDevelopment: loadRequiresDevelopment(knowledgeDir).capabilities || [],
1206
- noMigrationNeeded: hints,
1207
- },
1208
- decisions,
1209
- }));
1210
- }
1211
-
1212
- // Plugin detection, Tier-B derivation, and coverage classification, run after sampling so
1213
- // record payloads are available for core-embedded plugins that add no REST route.
1214
- function buildPluginCoverage({ args, inventory, classifications, entities, allCandidates = [] }) {
1215
- const knowledgeDir = args.pluginsRoot ? path.resolve(args.pluginsRoot) : pluginsRoot(path.resolve(__dirname, '..'));
1216
- const profiles = loadProfiles(knowledgeDir);
1217
- const sampledRecordProperties = collectRecordProperties(entities);
1218
-
1219
- const detection = detectPlugins({
1220
- profiles,
1221
- restIndex: inventory.restIndex,
1222
- pluginList: inventory.detection.pluginListAvailable ? inventory.pluginList : null,
1223
- types: inventory.types,
1224
- taxonomies: inventory.taxonomies,
1225
- htmlSources: inventory.htmlSources || [],
1226
- sampledRecordProperties,
1227
- fingerprintAliases: loadFingerprintAliases(knowledgeDir),
1228
- });
1229
-
1230
- const sampledByRoute = new Map(entities.map((entity) => [entity.routePath, entity]));
1231
- const unprofiled = [
1232
- ...collectUnprofiledRoutes({ classifications, detection }),
1233
- ...collectCandidateNamespaces({ classifications, candidates: allCandidates, detection }),
1234
- ];
1235
- const genericEntities = deriveGenericEntities({
1236
- types: inventory.types,
1237
- taxonomies: inventory.taxonomies,
1238
- classifications,
1239
- detection,
1240
- sampledByRoute,
1241
- });
1242
-
1243
- const targetKnowledge = loadTargetKnowledge(args.targetKnowledgeRoot ? path.resolve(args.targetKnowledgeRoot) : null);
1244
- const hints = loadNoMigrationNeeded(knowledgeDir);
1245
- const decisions = loadDecisions(args);
1246
- const rows = classifyCoverage({
1247
- detection,
1248
- genericEntities,
1249
- unprofiledRoutes: unprofiled,
1250
- targetKnowledge,
1251
- entityStatsByRoute: sampledByRoute,
1252
- // Only human-signed verdicts may produce a requires-development status.
1253
- requiresDevelopmentEntries: loadRequiresDevelopment(knowledgeDir).capabilities || [],
1254
- // Working notes for profiled capabilities we have not placed yet.
1255
- pendingNotes: loadPendingDecisions(knowledgeDir).capabilities || [],
1256
- // Nothing-to-move verdicts, both tiers: the slug list resolves unprofiled plugins into
1257
- // rows (basis: list), and the signed capabilities[] register resolves profiled
1258
- // capabilities a human decided need no migration (basis: decision).
1259
- noMigrationNeeded: hints,
1260
- // CMS fallback: the signed eligibility register plus this run's merchant answers
1261
- // (`pluginCmsFallback:<capability>`). Neither alone plans a CMS write.
1262
- cmsFallbackEntries: loadCmsFallbackEligible(knowledgeDir).capabilities || [],
1263
- cmsFallbackDecisions: decisions,
1264
- });
1265
-
1266
- // Read back the batched-ask answers so a declined blocker renders as declined, never as
1267
- // unanswered. A declined blocker stays on the row — skipping is an answer, not silence.
1268
- applyBlockerDecisions(rows, decisions);
1269
-
1270
- // One row per installed plugin, for customer review and for debugging this run later.
1271
- const dispositionRows = buildDispositionRows({
1272
- detection,
1273
- coverage: rows,
1274
- profiles,
1275
- hints,
1276
- });
1277
-
1278
- return {
1279
- detection,
1280
- genericEntities,
1281
- unprofiled,
1282
- sampledRecordProperties,
1283
- coverage: rows,
1284
- summary: coverageSummary(rows),
1285
- disposition: dispositionRows,
1286
- dispositionSummary: summarizeDispositions(dispositionRows),
1287
- targetKnowledgeError: targetKnowledge.loadError || null,
1288
- entityStats: buildEntityStats(detection, sampledByRoute),
1289
- cmsFallbackDecisionIssues: cmsFallbackDecisionIssues(rows, decisions),
1290
- cmsFallbackDigest: cmsFallbackDigestFor({ inventory: detection, profiles, targetKnowledge, knowledgeDir, hints, decisions }),
1291
- };
1292
- }
1293
-
1294
- /**
1295
- * Rebuild plugin coverage with no source network calls, after a CMS-fallback answer or a change
1296
- * to what could resolve an in-scope capability. Inputs are durable artifacts only: the stored
1297
- * detection (plugin-inventory.json), the prior coverage's entityStats and review evidence (copied
1298
- * forward unchanged), and the CURRENT profiles, registers, target knowledge and decisions.
1299
- * Returns { outcome: 'needs-full-discovery', reason } instead of a payload whenever the stored
1300
- * evidence cannot carry every count; it never writes a row with counts silently dropped.
1301
- */
1302
- function reclassifyPluginCoverage({ prior, inventory, decisions = {}, pluginsRoot: pluginsDir = null, targetKnowledgeRoot = null, generatedAt = new Date().toISOString() }) {
1303
- if (!prior || !prior.entityStats || typeof prior.entityStats !== 'object' || Array.isArray(prior.entityStats)) {
1304
- return { outcome: 'needs-full-discovery', reason: 'prior plugin-coverage.json has no entityStats' };
1305
- }
1306
- if (!inventory || !Array.isArray(inventory.detected)) {
1307
- return { outcome: 'needs-full-discovery', reason: 'plugin-inventory.json is missing or has no detected[]' };
1308
- }
1309
- const knowledgeDir = pluginsDir || pluginsRoot(path.resolve(__dirname, '..'));
1310
- const profiles = loadProfiles(knowledgeDir);
1311
- const profileBySlug = new Map(profiles.map((profile) => [profile.plugin, profile]));
1312
- const targetKnowledge = loadTargetKnowledge(targetKnowledgeRoot);
1313
- const hints = loadNoMigrationNeeded(knowledgeDir);
1314
- const cmsFallbackEntries = loadCmsFallbackEligible(knowledgeDir).capabilities || [];
1315
- const requiresDevelopmentEntries = loadRequiresDevelopment(knowledgeDir).capabilities || [];
1316
-
1317
- const sampledRoutes = new Set(Object.keys(prior.entityStats).filter((route) => prior.entityStats[route]));
1318
- const detected = inventory.detected.map((stored) => {
1319
- const profile = profileBySlug.get(stored.plugin);
1320
- // A detected plugin whose profile left the repo keeps its capabilities but declares no
1321
- // entities, so nothing can resolve for it and no CMS plan survives.
1322
- if (!profile) return { ...stored, entities: [] };
1323
- return {
1324
- ...stored,
1325
- displayName: profile.displayName || stored.displayName,
1326
- capabilities: [...(profile.capabilities || [])],
1327
- profileVersion: profile.profileVersion || stored.profileVersion,
1328
- entities: (profile.entities || []).map((entity) => {
1329
- const described = describeProfiledEntity(entity, {
1330
- routes: sampledRoutes,
1331
- rawRoutes: {},
1332
- properties: new Set(),
1333
- apiBelowMinVersion: stored.apiBelowMinVersion === true,
1334
- });
1335
- const previous = (stored.entities || []).find((candidate) => candidate.entity === entity.entity
1336
- && candidate.channel === entity.channel && (candidate.route || null) === (entity.route || null));
1337
- return previous ? { ...described, channelStatus: previous.channelStatus } : described;
1338
- }),
1339
- };
1340
- });
1341
-
1342
- const inputs = cmsFallbackResolutionInputs({
1343
- detectedPlugins: detectedPluginsOf(inventory),
1344
- profiles,
1345
- targetKnowledge,
1346
- registers: { cmsFallbackEligible: cmsFallbackEntries, requiresDevelopment: requiresDevelopmentEntries, noMigrationNeeded: hints },
1347
- decisions,
1348
- });
1349
- for (const capability of Object.keys(inputs.capabilities)) {
1350
- for (const plugin of detected.filter((candidate) => (candidate.capabilities || []).includes(capability))) {
1351
- for (const entity of plugin.entities) {
1352
- if (entity.route && !Object.prototype.hasOwnProperty.call(prior.entityStats, entity.route)) {
1353
- return { outcome: 'needs-full-discovery', reason: `route ${entity.route} of ${plugin.plugin} (${capability}) has no stored entityStats` };
1354
- }
1355
- }
1356
- }
1357
- }
1358
-
1359
- const detection = {
1360
- pluginListAvailable: inventory.pluginListAvailable === true,
1361
- detected,
1362
- installedButUnprofiled: inventory.installedButUnprofiled || [],
1363
- fingerprinted: inventory.fingerprinted || [],
1364
- };
1365
- const rows = classifyCoverage({
1366
- detection,
1367
- genericEntities: prior.genericEntities || [],
1368
- unprofiledRoutes: prior.unprofiledRoutes || [],
1369
- targetKnowledge,
1370
- entityStatsByRoute: entityStatsMap(prior.entityStats),
1371
- requiresDevelopmentEntries,
1372
- pendingNotes: loadPendingDecisions(knowledgeDir).capabilities || [],
1373
- noMigrationNeeded: hints,
1374
- cmsFallbackEntries,
1375
- cmsFallbackDecisions: decisions,
1376
- });
1377
- applyBlockerDecisions(rows, decisions);
1378
- const disposition = buildDispositionRows({ detection, coverage: rows, profiles, hints });
1379
-
1380
- return {
1381
- outcome: 'reclassified',
1382
- payload: {
1383
- ...prior,
1384
- generatedAt,
1385
- summary: coverageSummary(rows),
1386
- perPluginSummary: summarizeDispositions(disposition),
1387
- capabilities: rows,
1388
- perPlugin: disposition,
1389
- cmsFallbackDecisionIssues: cmsFallbackDecisionIssues(rows, decisions),
1390
- inputs: { ...(prior.inputs || {}), cmsFallbackDigest: cmsFallbackInputsDigest(inputs), reclassifiedFrom: prior.generatedAt || null },
1391
- },
1392
- };
1393
- }
1394
-
1395
- async function runReclassifyCoverage(args) {
1396
- if (!args.outDir) throw new Error('--reclassify-coverage requires --out-dir (the raw discovery directory)');
1397
- const outDir = path.resolve(args.outDir);
1398
- const readOrNull = async (filePath) => {
1399
- try {
1400
- return JSON.parse(await fs.readFile(filePath, 'utf8'));
1401
- } catch {
1402
- return null;
1403
- }
1404
- };
1405
- const result = reclassifyPluginCoverage({
1406
- prior: await readOrNull(path.join(outDir, 'plugin-coverage.json')),
1407
- inventory: await readOrNull(path.join(outDir, 'plugin-inventory.json')),
1408
- decisions: loadDecisions({ ...args, outDir }),
1409
- pluginsRoot: args.pluginsRoot ? path.resolve(args.pluginsRoot) : null,
1410
- targetKnowledgeRoot: args.targetKnowledgeRoot ? path.resolve(args.targetKnowledgeRoot) : null,
1411
- });
1412
- if (result.outcome !== 'reclassified') return result;
1413
- const text = `${JSON.stringify(result.payload, null, 2)}\n`;
1414
- const targets = [path.join(outDir, 'plugin-coverage.json')];
1415
- const canonical = args.canonicalCoverage
1416
- ? path.resolve(args.canonicalCoverage)
1417
- : path.resolve(outDir, '..', '..', 'discovery', 'plugin-coverage.json');
1418
- let canonicalDirExists = Boolean(args.canonicalCoverage);
1419
- if (!canonicalDirExists) {
1420
- try {
1421
- canonicalDirExists = (await fs.stat(path.dirname(canonical))).isDirectory();
1422
- } catch {
1423
- canonicalDirExists = false;
1424
- }
1425
- }
1426
- if (canonicalDirExists) targets.push(canonical);
1427
- for (const target of targets) {
1428
- await fs.mkdir(path.dirname(target), { recursive: true });
1429
- const tempPath = `${target}.${process.pid}.tmp`;
1430
- await fs.writeFile(tempPath, text, 'utf8');
1431
- await fs.rename(tempPath, target);
1432
- }
1433
- return { outcome: 'reclassified', written: targets, cmsFallbackDigest: result.payload.inputs.cmsFallbackDigest };
1434
- }
1435
-
1436
- // plugin-rest-child support: a parent-scoped sub-resource (e.g.
1437
- // /wc/v3/orders/{parentId}/notes) cannot be listed on its own, so it is checked by
1438
- // substituting real ids from the already-sampled parent collection. Pure and exported so the
1439
- // id-picking and route-building logic is fixture-testable with no live site.
1440
-
1441
- // Candidate parent ids for a plugin-rest-child entity, drawn from its parent collection's
1442
- // already-sampled records and capped at a small representative count — this is a check, not
1443
- // an attempt at full coverage.
1444
- function pickChildSampleParentIds(parentEntity, limit) {
1445
- const records = parentEntity?.sampleRecords || [];
1446
- return records
1447
- .map((record) => (record && typeof record === 'object' ? record.id : undefined))
1448
- .filter((id) => id !== undefined && id !== null)
1449
- .slice(0, limit);
1450
- }
1451
-
1452
- function buildChildRoutePath(template, parentId) {
1453
- return template.replace(CHILD_ROUTE_PLACEHOLDER, encodeURIComponent(String(parentId)));
1454
- }
1455
-
1456
- function describeChildSample(sample) {
1457
- const label = `${sample.plugin} · ${sample.entity}`;
1458
- if (sample.parentsChecked === 0) {
1459
- return `${label}: no sampled ${sample.parentRoute} records were available to check ${sample.route} against.`;
1460
- }
1461
- return `${label}: checked ${sample.parentsChecked} sampled ${sample.parentRoute} record(s)' `
1462
- + `${sample.route} — ${sample.parentsWithRecords} of ${sample.parentsChecked} returned matching records `
1463
- + `(${sample.sampleRecords.length} sample record(s) total). Representative check only, not a full count.`;
1464
- }
1465
-
1466
- // Live per-parent sampling for every detected plugin-rest-child entity. Runs after the main
1467
- // sampling loop so `sampledByRoute` already holds real parent records to draw ids from.
1468
- async function sampleChildEntities({ baseUrl, headers, timeoutMs, sampleLimit, progress, detection, sampledByRoute }) {
1469
- const results = [];
1470
- const parentSampleLimit = Math.min(3, sampleLimit);
1471
-
1472
- for (const detected of detection?.detected || []) {
1473
- for (const entity of detected.entities) {
1474
- if (entity.channel !== 'plugin-rest-child' || entity.channelStatus !== 'available') continue;
1475
-
1476
- const parentEntity = sampledByRoute.get(entity.parentRoute);
1477
- const parentIds = pickChildSampleParentIds(parentEntity, parentSampleLimit);
1478
- if (parentIds.length === 0) {
1479
- results.push({
1480
- plugin: detected.plugin,
1481
- entity: entity.entity,
1482
- parentRoute: entity.parentRoute,
1483
- route: entity.route,
1484
- parentsChecked: 0,
1485
- parentsWithRecords: 0,
1486
- sampleRecords: [],
1487
- });
1488
- continue;
1489
- }
1490
-
1491
- const sampleRecords = [];
1492
- let parentsWithRecords = 0;
1493
- for (const parentId of parentIds) {
1494
- const childRoute = buildChildRoutePath(entity.route, parentId);
1495
- // eslint-disable-next-line no-await-in-loop -- each parent's sub-resource must be
1496
- // fetched under the shared rate limiter, one request at a time, like inspectEntity.
1497
- const response = await fetchJson(baseUrl, childRoute, {
1498
- headers,
1499
- method: 'GET',
1500
- timeoutMs,
1501
- progress,
1502
- progressContext: { step: 'sample-child-entity', entity: entity.entity },
1503
- });
1504
- if (response.ok && Array.isArray(response.json) && response.json.length > 0) {
1505
- parentsWithRecords += 1;
1506
- sampleRecords.push(...response.json.slice(0, Math.max(0, sampleLimit - sampleRecords.length)));
1507
- }
1508
- }
1509
-
1510
- results.push({
1511
- plugin: detected.plugin,
1512
- entity: entity.entity,
1513
- parentRoute: entity.parentRoute,
1514
- route: entity.route,
1515
- parentsChecked: parentIds.length,
1516
- parentsWithRecords,
1517
- sampleRecords,
1518
- });
1519
- }
1520
- }
1521
-
1522
- return results;
1523
- }
1524
-
1525
- // Pure -- no I/O -- so it can be unit-tested directly without mocking httpClient or the
1526
- // profile loader. Decides what query a structure-bridge-plugin entity's sample should
1527
- // run, or why none can be run at all. `table` is spread in LAST when a fulfillment declares its
1528
- // own sampleStructureRequest so a stray `table` key inside that declaration (which
1529
- // plugin-knowledge.js's validator already rejects at authoring time) can never silently
1530
- // redirect the query at a different table than this entity's fulfillment names -- this is
1531
- // the second, independent line of defense for that same invariant.
1532
- function resolveSampleStructureRequest(fulfillment, table, schema) {
1533
- if (fulfillment.sampleStructureRequest) {
1534
- return { sampleRequest: { ...fulfillment.sampleStructureRequest, table }, skippedReason: null };
1535
- }
1536
- if (schema.columns.length === 0) {
1537
- return {
1538
- sampleRequest: null,
1539
- skippedReason: 'discover-structure returned zero columns for this table -- cannot build a default sample. Unexpected for a real table; the fulfillment metadata or the live schema needs review.',
1540
- };
1541
- }
1542
- if (schema.columns.length > 50) {
1543
- return {
1544
- sampleRequest: null,
1545
- skippedReason: `this table has ${schema.columns.length} columns, more than wix-wp-plugin-v2's own 50-column select limit -- a default "every column" sample would silently drop ${schema.columns.length - 50} of them. This entity's fulfillment must declare an explicit sampleStructureRequest choosing which columns matter; there is no safe default for a table this wide.`,
1546
- };
1547
- }
1548
- // On a key/value table the guarded value column(s) are unreachable until the
1549
- // request pins the matching key column, so a default "select every column" sample is a
1550
- // request the plugin REFUSES with a 400 -- and a 400 here reads as "this table is broken"
1551
- // rather than "this sample was built wrong". Drop the guarded columns and sample the key
1552
- // names instead, which is the discovery tier and exactly what a mapper needs first: the
1553
- // real key list for whatever plugin this site runs.
1554
- const guarded = guardedValueColumns(schema.eavPair);
1555
- const sampleable = schema.columns.filter((column) => !guarded.includes(column.name));
1556
- if (sampleable.length === 0) {
1557
- return {
1558
- sampleRequest: null,
1559
- skippedReason: 'every column on this table is a guarded key/value column -- nothing can be sampled without naming specific keys first.',
1560
- };
1561
- }
1562
- if (guarded.length > 0) {
1563
- return {
1564
- sampleRequest: {
1565
- table,
1566
- select: sampleable.map((column) => ({ column: column.name })),
1567
- orderBy: [{ column: schema.eavPair.keyColumn, direction: 'asc' }],
1568
- },
1569
- skippedReason: null,
1570
- eavNote: `key/value table: ${guarded.join(', ')} omitted from this sample because wix-wp-plugin-v2 will not return a value until the request pins its key column (${schema.eavPair.keyColumn}). Read those with a scoped request naming the keys this sample reveals.`,
1571
- };
1572
- }
1573
- const primaryColumn = schema.columns.find((column) => column.key === 'primary') || schema.columns[0];
1574
- return {
1575
- sampleRequest: {
1576
- table,
1577
- select: schema.columns.map((column) => ({ column: column.name })),
1578
- orderBy: [{ column: primaryColumn.name, direction: 'asc' }],
1579
- },
1580
- skippedReason: null,
1581
- };
1582
- }
1583
-
1584
- // Every entity whose blocked[].fulfillment.kind is structure-bridge-plugin has
1585
- // no REST route at all -- the ONLY way to capture it is wix-wp-plugin-v2's own routes. Runs
1586
- // after plugin detection/coverage so it can skip a plugin that isn't actually active, and
1587
- // after the REST sampling passes so it never competes with them for the shared rate limit
1588
- // slot ordering. Never throws: a per-entity failure (plugin not installed, table renamed,
1589
- // wix-wp-plugin-v2 not installed at all) is recorded as a request error on that entity's own
1590
- // file, exactly like an auth-gated REST route already is -- it must not abort discovery.
1591
- /**
1592
- * Accumulates the per-read counts the client derives and files them with
1593
- * rp-telemetry once, at the end of the bridge pass.
1594
- *
1595
- * Wired HERE, in the real caller, rather than left as a hook nobody calls: `onSourceRead` with
1596
- * no production caller is telemetry that exists in the code and not in the data, which is
1597
- * indistinguishable from a run that read nothing. Failure to record is swallowed on purpose --
1598
- * telemetry must never be able to abort a discovery run, and this whole function is already
1599
- * built on "a per-entity failure is recorded, not thrown".
1600
- */
1601
- function makeSourceReadCollector(outDir) {
1602
- const totals = { discovery_queries: 0, scoped_queries: 0, tier_refusals: 0, redacted_values: 0 };
1603
- const discoveryTables = new Set();
1604
- const scopedTables = new Set();
1605
- return {
1606
- onSourceRead(counts) {
1607
- for (const key of Object.keys(totals)) totals[key] += counts[key] || 0;
1608
- for (const table of counts.discovery_tables || []) discoveryTables.add(table);
1609
- for (const table of counts.scoped_tables || []) scopedTables.add(table);
1610
- },
1611
- countTierRefusal() {
1612
- totals.tier_refusals += 1;
1613
- },
1614
- flush(progress) {
1615
- const payload = { ...totals };
1616
- if (discoveryTables.size > 0) payload.discovery_tables = [...discoveryTables].sort();
1617
- if (scopedTables.size > 0) payload.scoped_tables = [...scopedTables].sort();
1618
- if (Object.values(totals).every((n) => n === 0)) return;
1619
- try {
1620
- // outDir is <project>/discovery/wordpress; the project root is two levels up, the same
1621
- // derivation the decisions.json lookup above already uses.
1622
- const projectDir = path.resolve(outDir, '..', '..');
1623
- // eslint-disable-next-line global-require
1624
- require('../../rp-telemetry/lib/telemetry-recorder.js').sourceRead(projectDir, payload);
1625
- } catch (error) {
1626
- progress?.progress(`source-read telemetry not recorded: ${error.message}`, {
1627
- phase: 'discovery',
1628
- step: 'structure-bridge-plugin',
1629
- });
1630
- }
1631
- },
1632
- };
1633
- }
1634
-
1635
- async function sampleStructureBridgeEntities({ baseUrl, headers, migrationKey, namespaces, sampleLimit, timeoutMs, progress, detection, outDir }) {
1636
- if (!namespaces.includes('wix-wp-plugin/v2')) {
1637
- progress?.progress('wix-wp-plugin-v2 not detected on this site; skipping structure-bridge-plugin entities', {
1638
- phase: 'discovery',
1639
- step: 'structure-bridge-plugin',
1640
- });
1641
- return [];
1642
- }
1643
-
1644
- // Prefer the signed route whenever a migration key is configured, avoiding capability
1645
- // drift on the manage_woocommerce-gated route. Without a key, the ordinary route is usable
1646
- // only when WooCommerce is present (the source skill enforces that credential selection).
1647
- const bridge = chooseBridgeAuth({ migrationKey, timeoutMs });
1648
- const bridgeAuth = bridge.auth;
1649
- const bridgeStructureMethod = bridge.structureMethod;
1650
- const bridgeQueryRoute = bridge.queryRoute;
1651
-
1652
- const httpClient = {
1653
- async get(url, { params } = {}) {
1654
- const response = await fetchJson(baseUrl, '/wix-wp-plugin/v2/structure', {
1655
- headers, method: 'GET', query: params, timeoutMs, progress,
1656
- progressContext: { step: 'structure-bridge-discover', entity: params?.table },
1657
- });
1658
- if (!response.ok) {
1659
- const error = new Error(`HTTP ${response.status} ${response.statusText}`);
1660
- error.status = response.status;
1661
- throw error;
1662
- }
1663
- return { data: response.json };
1664
- },
1665
- async post(url, { body } = {}) {
1666
- const response = await fetchJson(baseUrl, '/wix-wp-plugin/v2/query/admin-key', {
1667
- headers, method: 'POST', body, timeoutMs, progress,
1668
- progressContext: { step: 'structure-bridge-query' },
1669
- });
1670
- if (!response.ok) {
1671
- const error = new Error(`HTTP ${response.status} ${response.statusText}`);
1672
- error.status = response.status;
1673
- throw error;
1674
- }
1675
- return { data: response.json };
1676
- },
1677
- };
1678
-
1679
- const detectedSlugs = new Set((detection?.detected || []).map((entry) => entry.plugin));
1680
- const profiles = loadProfiles(pluginsRoot(path.resolve(__dirname, '..')));
1681
- const results = [];
1682
-
1683
- const sourceReads = makeSourceReadCollector(outDir);
1684
-
1685
- for (const profile of profiles) {
1686
- if (!detectedSlugs.has(profile.plugin)) continue;
1687
- for (const entity of profile.entities || []) {
1688
- const blockedEntries = [
1689
- ...(entity.blocked || []),
1690
- ...((entity.pitfalls || []).flatMap((pitfall) => pitfall.blocked || [])),
1691
- ];
1692
- for (const blockedEntry of blockedEntries) {
1693
- const fulfillment = blockedEntry.fulfillment;
1694
- if (!fulfillment || fulfillment.kind !== 'structure-bridge-plugin' || fulfillment.handlerId !== 'wix-wp-plugin-v2') continue;
1695
-
1696
- const { table } = fulfillment;
1697
- const fileName = `${slugify('wix-wp-plugin/v2')}--${slugify(table)}.md`;
1698
- const notes = [
1699
- `Captured via wix-wp-plugin-v2's discover-structure (schema) and query-structure (sample rows), not the WordPress REST API -- this entity has no REST route at all (channel: ${entity.channel}).`,
1700
- `Source plugin: ${profile.plugin}.`,
1701
- ];
1702
- const requestErrors = [];
1703
- let schema = null;
1704
- let sampleRecords = [];
1705
- let recordCount = null;
1706
-
1707
- progress?.progress(`Inspecting structure-bridge-plugin table ${table}`, {
1708
- phase: 'discovery',
1709
- step: 'structure-bridge-plugin',
1710
- entity: table,
1711
- });
1712
-
1713
- try {
1714
- schema = await discoverStructure({ httpClient, siteBaseUrl: baseUrl, auth: bridgeAuth, table });
1715
- } catch (error) {
1716
- requestErrors.push({ request: bridgeStructureMethod, routePath: `/wix-wp-plugin/v2/structure?table=${table}`, status: error.status || 0, statusText: error.message });
1717
- notes.push(`discover-structure failed: ${error.message}. wix-wp-plugin-v2 may not be fully installed/authorized on this site, or ${table} may not exist -- this entity's fulfillment metadata may need review.`);
1718
- results.push({
1719
- entityName: entity.entity, namespace: 'wix-wp-plugin/v2', routePath: `/structure?table=${table}`,
1720
- classification: null, methods: ['GET'], responseShape: 'object', recordCount: null, inUse: null,
1721
- sampleRecords: [], discoveryNotes: notes, relationships: [], requestErrors, schema: null, collectionArgs: [], fileName,
1722
- });
1723
- continue;
1724
- }
1725
-
1726
- // The authoritative `table` is spread LAST so it always wins even if a declared
1727
- // sampleStructureRequest carried its own `table` key -- plugin-knowledge.js's
1728
- // validator already rejects that key at authoring time, but this ordering is the
1729
- // second, independent line of defense: a profile can never make this code query a
1730
- // different table than the one this entity's filename/notes say it describes.
1731
- const { sampleRequest, skippedReason: sampleSkippedReason, eavNote } = resolveSampleStructureRequest(fulfillment, table, schema);
1732
- // Surfaced to the mapper, not swallowed: "this table's values need a second, scoped
1733
- // read" is exactly the kind of thing that turns into a silent data gap if the sample
1734
- // merely looks a bit thin.
1735
- if (eavNote) notes.push(eavNote);
1736
- if (fulfillment.sampleStructureRequest) {
1737
- notes.push('This sample uses the fulfillment\'s own declared query, not a raw "select every column" dump -- see this entity\'s blocked[].resolution for why a raw sample is not safe here.');
1738
- }
1739
-
1740
- let queried = false;
1741
- if (sampleSkippedReason) {
1742
- notes.push(sampleSkippedReason);
1743
- } else {
1744
- try {
1745
- const response = await queryStructure({
1746
- httpClient, siteBaseUrl: baseUrl, auth: bridgeAuth, structureRequest: sampleRequest, limit: sampleLimit,
1747
- onSourceRead: sourceReads.onSourceRead,
1748
- });
1749
- sampleRecords = response.rows;
1750
- recordCount = response.pagingMetadata.total;
1751
- queried = true;
1752
- // A redaction is a finding about the SOURCE SITE -- it means a credential is
1753
- // stored somewhere nobody expected -- so it belongs in the discovery record
1754
- // rather than being noticed later as a value that looks oddly literal.
1755
- if (response.redactionMetadata.redactedValueCount > 0) {
1756
- notes.push(`${response.redactionMetadata.redactedValueCount} value(s) in ${response.redactionMetadata.redactedColumns.join(', ')} matched a credential shape and were returned as [REDACTED:secret-shaped]. This is a source-site finding, not a sampling error: something on this site keeps a secret in this column.`);
1757
- }
1758
- if (response.eavAccess) {
1759
- notes.push(`Key/value table, served in the ${response.eavAccess.tier} tier: key column ${response.eavAccess.keyColumn}, guarded value column(s) ${guardedValueColumns(response.eavAccess).join(', ')}.`);
1760
- }
1761
- } catch (error) {
1762
- requestErrors.push({ request: 'POST', routePath: bridgeQueryRoute, status: error.status || 0, statusText: error.message });
1763
- notes.push(`query-structure failed: ${error.message}. Schema above is still real; no sample rows could be captured this run.`);
1764
- // Count a tier refusal only when the REQUEST actually violates the tier rule.
1765
- // A 400 here can equally mean a nonexistent column (an outdated profile naming a
1766
- // column the site dropped), a malformed request, or a bad cursor -- the plugin
1767
- // uses one error for all of them on purpose, so that a refusal never discloses
1768
- // which column holds values. Deciding from the request instead keeps
1769
- // `tier_refusals` meaning "something tried to reach values it had not named".
1770
- if (error.status === 400 && violatesTierRule(sampleRequest, schema.eavPair)) {
1771
- sourceReads.countTierRefusal();
1772
- }
1773
- }
1774
- }
1775
-
1776
- // Persisted as a machine-readable sidecar (not just described in this file's own
1777
- // "Collection Args" prose) so rp-import-codegen can consume the EXACT request
1778
- // verbatim instead of re-deriving its own default at codegen time, which could
1779
- // drift from this one if the table's live schema changes in between (this is a normal reader,
1780
- // not a blocked-dependency snapshot). This filename is
1781
- // computed unconditionally (even when nothing gets written this run) so writeOutputs
1782
- // can clean up a STALE sidecar from a prior run when this run could not produce a
1783
- // fresh one -- publishing only happens when the query actually succeeded (`queried`),
1784
- // never merely because a request was built; a failed or skipped run must not leave a
1785
- // sidecar codegen would then trust as current.
1786
- const structureRequestArtifactFileName = `${slugify('wix-wp-plugin/v2')}--${slugify(table)}.structure-request.json`;
1787
- const structureRequestArtifact = queried
1788
- ? { fileName: structureRequestArtifactFileName, content: sampleRequest }
1789
- : null;
1790
-
1791
- // A key/value table needs a SECOND artifact, because the request above deliberately
1792
- // omits the guarded value columns -- a reader running it verbatim extracts key names
1793
- // and no values, which is the opposite of what this capability is for. The read plan
1794
- // is the executable second step: every distinct key, batched at the plugin's 50-key
1795
- // cap, each batch a complete runnable request.
1796
- const eavReadPlanFileName = `${slugify('wix-wp-plugin/v2')}--${slugify(table)}.eav-read-plan.json`;
1797
- let eavReadPlan = null;
1798
- // Deliberately NOT gated on `queried`. The ordinary sample is skipped for a table wider
1799
- // than the 50-column select cap (and fails for other reasons too), but key discovery
1800
- // selects exactly ONE column, so nothing that stopped the sample applies to it. Tying
1801
- // the two together meant a wide key/value table -- which a busy `postmeta` absolutely
1802
- // can be -- silently lost its only path to values.
1803
- if (schema.eavPair) {
1804
- try {
1805
- const pairs = [
1806
- { keyColumn: schema.eavPair.keyColumn, valueColumn: schema.eavPair.valueColumn },
1807
- ...(schema.eavPair.additionalPairs || []),
1808
- ];
1809
- // One key sweep PER PAIR: each value column answers only to its own key column, so
1810
- // one pair's key list cannot unlock another pair's values.
1811
- const keysByPair = {};
1812
- const countsByPair = {};
1813
- let anyTruncated = false;
1814
- let totalPages = 0;
1815
- for (const pair of pairs) {
1816
- // eslint-disable-next-line no-await-in-loop
1817
- const discovered = await discoverEavKeys({
1818
- httpClient, siteBaseUrl: baseUrl, auth: bridgeAuth, table, keyColumn: pair.keyColumn,
1819
- onSourceRead: sourceReads.onSourceRead,
1820
- });
1821
- keysByPair[pair.keyColumn] = discovered.keys;
1822
- countsByPair[pair.keyColumn] = discovered.keyCounts;
1823
- anyTruncated = anyTruncated || discovered.truncated;
1824
- totalPages += discovered.pages;
1825
- }
1826
- const content = buildEavReadPlan({
1827
- table, eavPair: schema.eavPair, schemaColumns: schema.columns, keysByPair, countsByPair, truncated: anyTruncated,
1828
- });
1829
- eavReadPlan = { fileName: eavReadPlanFileName, content };
1830
- notes.push(
1831
- `Key/value table: ${content.distinctKeyCount} distinct key(s) across ${pairs.length} pair(s), discovered over ${totalPages} page(s). `
1832
- + `Values are extracted by ${content.expectedBatches} scoped batch(es)`
1833
- + (content.expectedScopedRequests === null ? '' : ` (~${content.expectedScopedRequests} paginated request(s))`)
1834
- + ` carrying ${content.identityColumns.join(', ') || 'no'} identity column(s) -- `
1835
- + `see ${eavReadPlanFileName}, which rp-import-codegen runs verbatim.`
1836
- + (anyTruncated ? ' *** KEY LIST TRUNCATED: this extraction cannot be treated as whole-table. ***' : '')
1837
- + (content.droppedIdentityColumns.length === 0 ? ''
1838
- : ` *** WIDER THAN THE 50-COLUMN SELECT CAP: ${content.droppedIdentityColumns.length} column(s) are absent from every extracted row (${content.droppedIdentityColumns.join(', ')}). `
1839
- + 'Every row will be INCOMPLETE per record until the mapping narrows this table and the plan is regenerated with an explicit column choice. ***')
1840
- + (content.orderByIsUnique ? '' : ` *** No primary or NOT-NULL unique column: batches order by ${content.orderColumn}, which can tie, so paging is best-effort. ***`),
1841
- );
1842
- } catch (error) {
1843
- // Never fatal: the schema above is still real, and a discovery run must not abort
1844
- // because one table's key sweep failed.
1845
- notes.push(`Key discovery for the scoped-value read failed: ${error.message}. Values for this table cannot be extracted until this succeeds.`);
1846
- requestErrors.push({ request: 'POST', routePath: bridgeQueryRoute, status: error.status || 0, statusText: error.message });
1847
- }
1848
- }
1849
-
1850
- results.push({
1851
- entityName: entity.entity,
1852
- sourceEntityRef: `plugin.${profile.plugin}.${entity.entity}`,
1853
- sourceMeta: { plugin: profile.plugin, candidateTargetRefs: entity.candidateTargetRefs || [] },
1854
- namespace: 'wix-wp-plugin/v2',
1855
- routePath: `${bridgeAuth ? '/query' : '/query/admin-key'} (table=${table})`,
1856
- classification: null,
1857
- methods: ['POST'],
1858
- responseShape: 'object',
1859
- recordCount,
1860
- inUse: sampleRecords.length > 0,
1861
- sampleRecords,
1862
- discoveryNotes: notes,
1863
- relationships: [],
1864
- requestErrors,
1865
- schema,
1866
- // Not literally REST "collection args" (no such concept here) -- reusing this
1867
- // section to display the actual structureRequest this sample used (or an empty
1868
- // array when none was attempted), so a human reader can see (e.g.) that
1869
- // gift-card-activity's sample is an aggregate query, not a raw dump, without
1870
- // having to go read the plugin profile's JSON. The machine-readable copy
1871
- // consumers should actually parse is structureRequestArtifact below.
1872
- collectionArgs: sampleRequest ? [sampleRequest] : [],
1873
- fileName,
1874
- structureRequestArtifact,
1875
- structureRequestArtifactFileName,
1876
- eavReadPlan,
1877
- eavReadPlanFileName,
1878
- });
1879
- }
1880
- }
1881
- }
1882
-
1883
- // One telemetry write for the whole bridge pass, after every entity, so a resumed or
1884
- // partially-failed run still files what it actually read.
1885
- sourceReads.flush(progress);
1886
-
1887
- return results;
1888
- }
1889
-
1890
- // Everything this run advertised or attempted but did not capture as an entity
1891
- // (401/403, failed capture, a data route skipped by rule, an unsupported route surface). Always
1892
- // written, `rows: []` when there is nothing to report; rp-discovery refuses to promote without it.
1893
- function sourceCoveragePayload(context) {
1894
- return buildCoverageFile({
1895
- platform: 'wordpress',
1896
- adapter: 'wordpress',
1897
- generatedAt: context.generatedAt,
1898
- rows: buildWordPressCoverageRows({
1899
- entities: context.entities,
1900
- classifications: context.classifications,
1901
- rawDir: ADAPTER_RAW_DIRS.wordpress,
1902
- }),
1903
- });
1904
- }
1905
-
1906
- function pluginCoveragePayload(context) {
1907
- const plugins = context.plugins;
1908
- return {
1909
- generatedAt: context.generatedAt,
1910
- baseUrl: context.baseUrl,
1911
- authenticated: context.authMode !== 'none',
1912
- bridgeAuthMode: context.bridgeAuthMode,
1913
- pluginListAvailable: plugins.detection.pluginListAvailable,
1914
- notes: [
1915
- ...(context.pluginNotes || []),
1916
- ...(plugins.targetKnowledgeError
1917
- ? [`Wix target knowledge could not be loaded (${plugins.targetKnowledgeError}); target refs were not resolved.`]
1918
- : []),
1919
- ...(plugins.childSamples || []).map(describeChildSample),
1920
- ],
1921
- childSamples: plugins.childSamples || [],
1922
- summary: plugins.summary,
1923
- perPluginSummary: plugins.dispositionSummary,
1924
- // The status invariant: N installed plugins produce N per-plugin rows, recognized or not.
1925
- // Recorded here so the check is inspectable in the artifact, not just in tests.
1926
- statusInvariant: {
1927
- detectedRecognized: plugins.detection.detected.length,
1928
- installedButUnrecognized: plugins.detection.installedButUnprofiled.length,
1929
- genericEntities: plugins.genericEntities.length,
1930
- unprofiledNamespaces: plugins.unprofiled.length,
1931
- pluginListAvailable: plugins.detection.pluginListAvailable,
1932
- },
1933
- capabilities: plugins.coverage,
1934
- // One artifact, two views: the capability rows above are the contract;
1935
- // this per-plugin projection answers the question a merchant actually asks.
1936
- perPlugin: plugins.disposition,
1937
- genericEntities: plugins.genericEntities,
1938
- unprofiledRoutes: plugins.unprofiled,
1939
- // Durable per-route counts and sample evidence, so --reclassify-coverage never refetches.
1940
- entityStats: plugins.entityStats || {},
1941
- // Malformed pluginCmsFallback:* answers with no capability row to carry them.
1942
- cmsFallbackDecisionIssues: plugins.cmsFallbackDecisionIssues || [],
1943
- // The CMS-fallback resolution-input digest. rp-mapper copies it into mapping-plan.json and
1944
- // rp-setup-discovery into setup-plan.json; the router refuses any artifact that disagrees.
1945
- inputs: { cmsFallbackDigest: plugins.cmsFallbackDigest || null },
1946
- };
1947
- }
1948
-
1949
- async function ensureDir(dirPath) {
1950
- await fs.mkdir(dirPath, { recursive: true });
1951
- }
1952
-
1953
- async function writeOutputs(outDir, context, progress) {
1954
- await ensureDir(outDir);
1955
- const planProjectDir = context.projectDir ? path.resolve(context.projectDir)
1956
- : (path.basename(path.resolve(outDir)) === 'wp-discovery' && path.basename(path.dirname(path.resolve(outDir))) === 'data' ? path.resolve(outDir, '../..') : null);
1957
- if (planProjectDir) {
1958
- const { sha } = require('../lib/plugin-entity-read-plan.js');
1959
- for (const entity of context.entities) {
1960
- if (entity.sourceEntityRef && entity.namespace === 'wix-wp-plugin/v2') {
1961
- entity.fileName = `wix-wp-plugin-v2--${sha(entity.sourceEntityRef)}.md`;
1962
- entity.rawFile = entity.fileName;
1963
- }
1964
- }
1965
- }
1966
- await fs.writeFile(path.join(outDir, 'README.md'), renderIndexFile(context), 'utf8');
1967
- progress?.progress('Wrote WordPress discovery index', { phase: 'discovery', step: 'write-artifact', artifact: path.join(outDir, 'README.md') });
1968
- await fs.writeFile(
1969
- path.join(outDir, 'skipped-routes.json'),
1970
- `${JSON.stringify(skippedRoutesPayload(context), null, 2)}\n`,
1971
- 'utf8',
1972
- );
1973
- progress?.progress('Wrote WordPress skipped-route index', {
1974
- phase: 'discovery',
1975
- step: 'write-artifact',
1976
- artifact: path.join(outDir, 'skipped-routes.json'),
1977
- });
1978
- await fs.writeFile(
1979
- path.join(outDir, 'source-coverage.json'),
1980
- `${JSON.stringify(sourceCoveragePayload(context), null, 2)}\n`,
1981
- 'utf8',
1982
- );
1983
- progress?.progress('Wrote WordPress source coverage', {
1984
- phase: 'discovery',
1985
- step: 'write-artifact',
1986
- artifact: path.join(outDir, 'source-coverage.json'),
1987
- });
1988
-
1989
- if (context.plugins) {
1990
- await fs.writeFile(
1991
- path.join(outDir, 'plugin-inventory.json'),
1992
- `${JSON.stringify(inventoryPayload({
1993
- generatedAt: context.generatedAt,
1994
- baseUrl: context.baseUrl,
1995
- authenticated: context.authMode !== 'none',
1996
- detection: context.plugins.detection,
1997
- notes: context.pluginNotes || [],
1998
- unprofiled: context.plugins.unprofiled,
1999
- profileCount: context.pluginProfileCount,
2000
- }), null, 2)}\n`,
2001
- 'utf8',
2002
- );
2003
- progress?.progress('Wrote WordPress plugin inventory', {
2004
- phase: 'discovery',
2005
- step: 'write-artifact',
2006
- artifact: path.join(outDir, 'plugin-inventory.json'),
2007
- });
2008
- await fs.writeFile(
2009
- path.join(outDir, 'plugin-coverage.json'),
2010
- `${JSON.stringify(pluginCoveragePayload(context), null, 2)}\n`,
2011
- 'utf8',
2012
- );
2013
- progress?.progress('Wrote WordPress plugin coverage', {
2014
- phase: 'discovery',
2015
- step: 'write-artifact',
2016
- artifact: path.join(outDir, 'plugin-coverage.json'),
2017
- });
2018
- // Deliberately no plugin-disposition.md: the per-plugin view lives inside
2019
- // plugin-coverage.json (one coverage artifact, no second document).
2020
- }
2021
-
2022
- for (const entity of context.entities) {
2023
- if (entity.sourceEntityRef && entity.namespace === 'wix-wp-plugin/v2'
2024
- && planProjectDir) {
2025
- const plans = require('../lib/plugin-entity-read-plan.js');
2026
- const projectDir = planProjectDir;
2027
- try {
2028
- const artifact = entity.eavReadPlan || entity.structureRequestArtifact;
2029
- if (!artifact || !entity.schema) throw Object.assign(new Error('discovery could not produce a supported read recipe; inspect its storage evidence'), { code: 'plan-unavailable' });
2030
- const base = `data/wp-discovery/entity-read-plans/${plans.sha(entity.sourceEntityRef)}`;
2031
- const evidence = plans.writeJson(projectDir, `${base}/schema.json`, entity.schema);
2032
- const request = plans.writeJson(projectDir, `${base}/${entity.eavReadPlan ? 'eav-read-plan' : 'structure-request'}.json`, artifact.content);
2033
- plans.writePluginEntityReadPlan({ projectDir, siteBaseUrl: context.baseUrl, sourceEntity: entity,
2034
- plan: { schemaVersion: 1, sourceEntityRef: entity.sourceEntityRef, sourceIdentity: plans.sourceIdentity(context.baseUrl), evidenceRefs: [evidence],
2035
- components: [{ id: 'root', table: entity.schema.table, variant: entity.eavReadPlan ? 'eav' : 'single-request', schema: entity.schema,
2036
- readArtifacts: { [entity.eavReadPlan ? 'eavReadPlan' : 'structureRequest']: request }, scope: { where: artifact.content.where || [] } }],
2037
- assembly: { kind: 'identity', identityColumn: artifact.content.groupBy?.[0] || entity.schema.columns.find((column) => column.key === 'primary' || (column.key === 'unique' && column.nullable === false))?.name || '' },
2038
- cost: { expectedRequests: artifact.content.expectedScopedRequests ?? null } } });
2039
- } catch (error) {
2040
- plans.invalidatePluginEntityReadPlan({ projectDir, sourceEntityRef: entity.sourceEntityRef });
2041
- entity.sourceMeta = { ...entity.sourceMeta, extractionPlan: null };
2042
- plans.recordPluginExtractionDeferral({ projectDir, sourceEntityRef: entity.sourceEntityRef, code: error.code || 'plan-invalid', reason: error.message, producer: 'rp-source-wordpress/scripts/wp-discovery.js' });
2043
- entity.discoveryNotes.push(`Entity plan deferred: ${error.message}`);
2044
- }
2045
- }
2046
- const metadata = entity.sourceEntityRef ? `\n## Source binding\n\n${JSON.stringify({ sourceEntityRef: entity.sourceEntityRef, bridgeDesignated: true, sourceMeta: entity.sourceMeta }, null, 2)}\n` : '';
2047
- await fs.writeFile(path.join(outDir, entity.fileName), renderEntityFile(entity) + metadata, 'utf8');
2048
- progress?.progress(`Wrote WordPress discovery artifact for ${entity.entityName}`, {
2049
- phase: 'discovery',
2050
- step: 'write-artifact',
2051
- entity: entity.routePath,
2052
- artifact: path.join(outDir, entity.fileName),
2053
- });
2054
- // structure-bridge-plugin entities additionally persist the exact
2055
- // structureRequest their sample used, as machine-readable JSON alongside the
2056
- // human-readable markdown -- see sampleStructureBridgeEntities()'s own comment on why.
2057
- if (entity.structureRequestArtifact) {
2058
- const artifactPath = path.join(outDir, entity.structureRequestArtifact.fileName);
2059
- await fs.writeFile(artifactPath, `${JSON.stringify(entity.structureRequestArtifact.content, null, 2)}\n`, 'utf8');
2060
- progress?.progress(`Wrote structure-request artifact for ${entity.entityName}`, {
2061
- phase: 'discovery',
2062
- step: 'write-artifact',
2063
- entity: entity.routePath,
2064
- artifact: artifactPath,
2065
- });
2066
- } else if (entity.structureRequestArtifactFileName) {
2067
- // This run could not produce a fresh sidecar (query skipped or failed) -- delete any
2068
- // sidecar a PRIOR run left behind for this exact table, so rp-import-codegen can never
2069
- // consume a stale one and mistake it for this run's (non-existent) authoritative query.
2070
- const stalePath = path.join(outDir, entity.structureRequestArtifactFileName);
2071
- try {
2072
- await fs.unlink(stalePath);
2073
- progress?.progress(`Removed stale structure-request artifact for ${entity.entityName}`, {
2074
- phase: 'discovery',
2075
- step: 'write-artifact',
2076
- entity: entity.routePath,
2077
- artifact: stalePath,
2078
- });
2079
- } catch (error) {
2080
- if (error.code !== 'ENOENT') throw error;
2081
- }
2082
- }
2083
-
2084
- // Same publish-or-clean rule for the scoped-value read plan: a stale plan is worse than a
2085
- // missing one, because codegen would run it and produce a confidently wrong extraction
2086
- // against a key list the site no longer has.
2087
- if (entity.eavReadPlan) {
2088
- const planPath = path.join(outDir, entity.eavReadPlan.fileName);
2089
- await fs.writeFile(planPath, `${JSON.stringify(entity.eavReadPlan.content, null, 2)}\n`, 'utf8');
2090
- progress?.progress(`Wrote EAV read plan for ${entity.entityName}`, {
2091
- phase: 'discovery',
2092
- step: 'write-artifact',
2093
- entity: entity.routePath,
2094
- artifact: planPath,
2095
- });
2096
- } else if (entity.eavReadPlanFileName) {
2097
- try {
2098
- await fs.unlink(path.join(outDir, entity.eavReadPlanFileName));
2099
- } catch (error) {
2100
- if (error.code !== 'ENOENT') throw error;
2101
- }
2102
- }
2103
- }
2104
- }
2105
-
2106
- async function main() {
2107
- const parsed = parseProgressArgs(process.argv.slice(2));
2108
- progress = createProgressLogger({
2109
- script: 'skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js',
2110
- ...parsed.progress,
2111
- });
2112
- progress.start('WordPress discovery started', { phase: 'discovery' });
2113
-
2114
- const args = await hydrateArgsFromEnvFile(parseArgs(parsed.args));
2115
- if (args.help) {
2116
- printUsage();
2117
- progress.complete('WordPress discovery help shown', { phase: 'discovery', step: 'help' });
2118
- return;
2119
- }
2120
-
2121
- if (args.reclassifyCoverage) {
2122
- const result = await runReclassifyCoverage(args);
2123
- console.log(JSON.stringify({ ok: result.outcome === 'reclassified', ...result }, null, 2));
2124
- if (result.outcome !== 'reclassified') {
2125
- progress.warn('Plugin coverage reclassification needs a full discovery run', { phase: 'discovery', step: 'reclassify-coverage' });
2126
- process.exitCode = 3;
2127
- return;
2128
- }
2129
- progress.complete('Plugin coverage reclassified without refetching', { phase: 'discovery', step: 'reclassify-coverage' });
2130
- return;
2131
- }
2132
-
2133
- if (!args.baseUrl || !args.outDir) {
2134
- printUsage();
2135
- progress.error('Missing required WordPress discovery arguments', { phase: 'discovery' });
2136
- throw new Error('Missing required arguments: --base-url and --out-dir are required.');
2137
- }
2138
-
2139
- configureRateLimit({ rateLimitRpm: args.rateLimitRpm, maxRetries: args.maxRetries });
2140
-
2141
- const headers = buildHeaders(args);
2142
- const rootResponse = await fetchJson(args.baseUrl, '', {
2143
- headers,
2144
- method: 'GET',
2145
- timeoutMs: args.timeoutMs,
2146
- progress,
2147
- progressContext: { step: 'rest-index' },
2148
- });
2149
-
2150
- if (!rootResponse.ok || !rootResponse.json) {
2151
- throw new Error(`Failed to fetch WordPress REST index from ${rootResponse.url}: ${rootResponse.status} ${rootResponse.statusText}`);
2152
- }
2153
-
2154
- const indexJson = rootResponse.json;
2155
- const namespaces = Array.isArray(indexJson?.namespaces) ? indexJson.namespaces : [];
2156
- progress.progress('WordPress namespace enumeration completed', {
2157
- phase: 'discovery',
2158
- step: 'namespace-enumeration',
2159
- count: namespaces.length,
2160
- unit: 'namespaces',
2161
- });
2162
- // Plugin inventory pre-pass: runs before classification so profile-declared routes are
2163
- // already in scope when routes are classified.
2164
- let inventory = null;
2165
- if (args.pluginInventory) {
2166
- try {
2167
- const gathered = await gatherInventory({
2168
- baseUrl: args.baseUrl,
2169
- headers,
2170
- timeoutMs: args.timeoutMs,
2171
- htmlFingerprint: args.htmlFingerprint,
2172
- restIndex: indexJson,
2173
- logger: progress,
2174
- });
2175
- inventory = gathered;
2176
- progress.progress('WordPress plugin inventory completed', {
2177
- phase: 'discovery',
2178
- step: 'plugin-inventory',
2179
- count: gathered.detection.detected.length,
2180
- unit: 'plugins',
2181
- details: {
2182
- pluginListAvailable: gathered.detection.pluginListAvailable,
2183
- installedButUnprofiled: gathered.detection.installedButUnprofiled.length,
2184
- },
2185
- });
2186
- } catch (error) {
2187
- // Never fail discovery over the plugin pre-pass; record and continue.
2188
- progress.progress(`WordPress plugin inventory skipped: ${error.message}`, {
2189
- phase: 'discovery',
2190
- step: 'plugin-inventory',
2191
- });
2192
- }
2193
- }
2194
-
2195
- const requestOverrides = buildRequestOverrides(pluginsRoot(path.resolve(__dirname, '..')));
2196
- const candidates = deriveEntityCandidates(indexJson, args.includeNamespaces, requestOverrides);
2197
- progress.progress('WordPress endpoint candidates derived', {
2198
- phase: 'discovery',
2199
- step: 'derive-endpoints',
2200
- count: candidates.length,
2201
- unit: 'endpoints',
2202
- });
2203
- // Registered post types/taxonomies are positive evidence for classification, so the
2204
- // inventory pre-pass must run before this point (it fetches /wp/v2/types+taxonomies).
2205
- const classifications = classifyRoutes(candidates, {
2206
- ...summarizeOverrides(args),
2207
- registeredRestBases: inventory ? buildRegisteredRestBases({ types: inventory.types, taxonomies: inventory.taxonomies }) : null,
2208
- });
2209
- // classifyRoutes() loads the checked-in plugin profiles lazily via defaultPluginRules();
2210
- // a failed load degrades to zero plugin rules with no exception, so it must be surfaced
2211
- // here or every plugin-owned route silently falls through to generic/unsupported handling.
2212
- const pluginRulesError = defaultPluginRules().loadError || null;
2213
- if (pluginRulesError) {
2214
- progress.progress(`WordPress plugin route rules could not be loaded (${pluginRulesError}); plugin-owned routes will not be recognized this run.`, {
2215
- phase: 'discovery',
2216
- step: 'classify-endpoints',
2217
- });
2218
- }
2219
- const candidatesByRoute = new Map(candidates.map((candidate) => [candidate.routePath, candidate]));
2220
- const candidatesToInspect = classifications
2221
- .filter((classification) => ['sample', 'metadata'].includes(classification.effectiveAction))
2222
- .map((classification) => ({
2223
- ...candidatesByRoute.get(classification.routePath),
2224
- classification,
2225
- }));
2226
- const skippedByCategory = summarizeSkippedByCategory(classifications);
2227
- const skippedRoutes = classifications.filter((classification) => classification.effectiveAction === 'skip').length;
2228
- progress.progress('WordPress endpoint candidates classified', {
2229
- phase: 'discovery',
2230
- step: 'classify-endpoints',
2231
- count: candidatesToInspect.length,
2232
- total: candidates.length,
2233
- unit: 'endpoints',
2234
- details: {
2235
- sampledRoutes: candidatesToInspect.length,
2236
- skippedRoutes,
2237
- skippedByCategory,
2238
- },
2239
- });
2240
- const entities = [];
2241
- const responseEnvelopes = buildResponseEnvelopes(pluginsRoot(path.resolve(__dirname, '..')));
2242
- const responseFragmentGroups = buildResponseFragmentGroups(pluginsRoot(path.resolve(__dirname, '..')));
2243
- const recordKeyFields = buildRecordKeyFields(pluginsRoot(path.resolve(__dirname, '..')));
2244
-
2245
- for (let i = 0; i < candidatesToInspect.length; i += 1) {
2246
- const candidate = candidatesToInspect[i];
2247
- progress.progress(`Inspecting WordPress endpoint ${candidate.routePath}`, {
2248
- phase: 'discovery',
2249
- step: 'inspect-endpoint',
2250
- entity: candidate.routePath,
2251
- count: i + 1,
2252
- total: candidatesToInspect.length,
2253
- unit: 'endpoints',
2254
- percent: candidatesToInspect.length ? Math.round(((i + 1) / candidatesToInspect.length) * 100) : 100,
2255
- });
2256
- const details = await inspectEntity(args.baseUrl, headers, candidate, {
2257
- sampleLimit: args.sampleLimit,
2258
- timeoutMs: args.timeoutMs,
2259
- progress,
2260
- responseEnvelope: responseEnvelopes.get(candidate.routePath) || null,
2261
- responseFragmentGroupSize: responseFragmentGroups.get(candidate.routePath) || null,
2262
- recordKeyField: recordKeyFields.get(candidate.routePath) || null,
2263
- requestOverride: candidate.requestOverride,
2264
- defaultQuery: defaultQueryFor(candidate.routePath),
2265
- defaultQueryReason: defaultQueryReasonFor(candidate.routePath),
2266
- });
2267
- entities.push(details);
2268
- }
2269
-
2270
- // Second detection pass + Tier-B derivation + coverage. This is where plugins that add
2271
- // no REST route (Product Bundles, ACF, Yoast) become visible, because it looks at the
2272
- // record payload keys the sampling loop just collected.
2273
- let plugins = null;
2274
- if (inventory) {
2275
- plugins = buildPluginCoverage({ args, inventory, classifications, entities, allCandidates: candidates });
2276
- progress.progress('WordPress plugin coverage classified', {
2277
- phase: 'discovery',
2278
- step: 'plugin-coverage',
2279
- count: plugins.coverage.length,
2280
- unit: 'capabilities',
2281
- details: plugins.summary.byStatus,
2282
- });
2283
-
2284
- // Third pass: plugin-rest-child entities — a parent-scoped sub-resource
2285
- // (e.g. /wc/v3/orders/{parentId}/notes) cannot be listed on its own, so it is checked by
2286
- // substituting real ids from the parent collection this run already sampled.
2287
- const childSamples = await sampleChildEntities({
2288
- baseUrl: args.baseUrl,
2289
- headers,
2290
- timeoutMs: args.timeoutMs,
2291
- sampleLimit: args.sampleLimit,
2292
- progress,
2293
- detection: plugins.detection,
2294
- sampledByRoute: new Map(entities.map((entity) => [entity.routePath, entity])),
2295
- });
2296
- if (childSamples.length > 0) {
2297
- progress.progress('WordPress per-parent sub-resource sampling completed', {
2298
- phase: 'discovery',
2299
- step: 'sample-child-entity',
2300
- count: childSamples.length,
2301
- unit: 'entities',
2302
- });
2303
- }
2304
- plugins = { ...plugins, childSamples };
2305
-
2306
- // Fourth pass: structure-bridge-plugin entities -- data with no REST route
2307
- // at all, captured through wix-wp-plugin-v2 instead. Pushed into the same `entities`
2308
- // array so it flows through the existing per-entity markdown writer unchanged; run
2309
- // after detection/coverage so it can skip a plugin that isn't actually active.
2310
- const structureBridgeEntities = await sampleStructureBridgeEntities({
2311
- baseUrl: args.baseUrl,
2312
- headers,
2313
- migrationKey: args.migrationKey,
2314
- namespaces,
2315
- sampleLimit: args.sampleLimit,
2316
- timeoutMs: args.timeoutMs,
2317
- progress,
2318
- detection: plugins.detection,
2319
- outDir: args.outDir,
2320
- });
2321
- if (structureBridgeEntities.length > 0) {
2322
- progress.progress('wix-wp-plugin-v2 structure-bridge-plugin capture completed', {
2323
- phase: 'discovery',
2324
- step: 'structure-bridge-plugin',
2325
- count: structureBridgeEntities.length,
2326
- unit: 'entities',
2327
- });
2328
- }
2329
- entities.push(...structureBridgeEntities);
2330
- }
2331
-
2332
- const context = {
2333
- generatedAt: new Date().toISOString(),
2334
- baseUrl: normalizeBaseUrl(args.baseUrl),
2335
- restRoot: `${normalizeBaseUrl(args.baseUrl)}/wp-json`,
2336
- authMode: summarizeAuthMode(args),
2337
- bridgeAuthMode: summarizeBridgeAuthMode(args, namespaces),
2338
- authProviders: Object.keys(indexJson?.authentication || {}),
2339
- namespaces,
2340
- totalAdvertisedRoutes: Object.keys(indexJson?.routes || {}).length,
2341
- totalCandidateRoutes: candidates.length,
2342
- sampledRoutes: candidatesToInspect.length,
2343
- skippedRoutes,
2344
- skippedByCategory,
2345
- overrides: summarizeOverrides(args),
2346
- classifications,
2347
- routeIndexSample: Object.keys(indexJson?.routes || {}).slice(0, 50),
2348
- entities,
2349
- plugins,
2350
- pluginNotes: [
2351
- ...(inventory ? inventory.notes : ['Plugin inventory was disabled with --no-plugin-inventory.']),
2352
- ...(pluginRulesError
2353
- ? [`WordPress plugin route rules could not be loaded (${pluginRulesError}); plugin-owned routes were not recognized this run.`]
2354
- : []),
2355
- ],
2356
- pluginProfileCount: inventory ? inventory.profileCount : 0,
2357
- };
2358
-
2359
- await writeOutputs(args.outDir, context, progress);
2360
-
2361
- console.log(`Wrote ${entities.length + 1} markdown files and skipped-routes.json to ${args.outDir}`);
2362
- progress.complete('WordPress discovery completed', {
2363
- phase: 'discovery',
2364
- artifact: args.outDir,
2365
- count: entities.length,
2366
- unit: 'entities',
2367
- });
2368
- }
2369
-
2370
- if (require.main === module) {
2371
- main().catch((error) => {
2372
- console.error(error.stack || error.message);
2373
- if (progress) {
2374
- progress.error(error && error.message ? error.message : 'WordPress discovery failed', { phase: 'discovery' });
2375
- }
2376
- process.exitCode = 1;
2377
- });
2378
- }
2379
-
2380
- module.exports = {
2381
- parseArgs,
2382
- deriveEntityCandidates,
2383
- renderIndexFile,
2384
- renderPluginSection,
2385
- skippedRoutesPayload,
2386
- sourceCoveragePayload,
2387
- buildPluginCoverage,
2388
- pluginCoveragePayload,
2389
- buildEntityStats,
2390
- reclassifyPluginCoverage,
2391
- runReclassifyCoverage,
2392
- loadDecisions,
2393
- loadTargetKnowledge,
2394
- pickChildSampleParentIds,
2395
- buildChildRoutePath,
2396
- describeChildSample,
2397
- sampleChildEntities,
2398
- sampleStructureBridgeEntities,
2399
- resolveSampleStructureRequest,
2400
- writeOutputs,
2401
- getAtPath,
2402
- inspectEntity,
2403
- resolveRequestBody,
2404
- normalizeResponseRecords,
2405
- findSampledIdsDependencies,
2406
- summarizeAuthMode,
2407
- summarizeBridgeAuthMode,
2408
- chooseBridgeAuth,
2409
- };