@wix/agent-skills 1.15.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -7
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +4 -1
- package/skills/wix-app/references/APP_TOOLS.md +134 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +1 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +0 -10
- package/skills/wix-app/references/DATA_COLLECTION.md +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -9
- package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
- package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +2 -2
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +172 -0
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +138 -0
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +23 -2
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +29 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +27 -2
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +5 -3
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +18 -1
- package/skills/wix-app/references/editor-react-component/PARTS.md +15 -2
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -3
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +13 -9
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +4 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +3 -1
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +4 -0
- package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +54 -0
- package/skills/wix-app/references/stores/QUERY.md +32 -0
- package/skills/wix-docs/SKILL.md +35 -3
- package/skills/wix-headless/SKILL.md +3 -1
- package/skills/wix-headless/references/CONTENT.md +36 -0
- package/skills/wix-headless/references/DESIGN.md +54 -0
- package/skills/wix-headless/references/DISCOVERY.md +24 -0
- package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +32 -23
- package/skills/wix-headless/references/managed/CONNECT.md +1 -1
- package/skills/wix-headless/references/managed/CREATE.md +14 -0
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +25 -0
- package/skills/wix-manage/SKILL.md +123 -7
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
- package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
- package/skills/wix-manage/references/blog/blog-dashboard-navigation.md +56 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +31 -6
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -1
- package/skills/wix-manage/references/bookings/bookings-dashboard-navigation.md +63 -0
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +10 -1
- package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +31 -3
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +287 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +27 -1
- package/skills/wix-manage/references/contacts/contacts-dashboard-navigation.md +46 -0
- package/skills/wix-manage/references/contacts/create-a-contact.md +82 -0
- package/skills/wix-manage/references/contacts/update-a-contact.md +119 -0
- package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +82 -0
- package/skills/wix-manage/references/dashboard-navigation/routes.json +1733 -0
- package/skills/wix-manage/references/domains/domains-dashboard-navigation.md +32 -0
- package/skills/wix-manage/references/ecommerce/ecom-pricing.md +4 -4
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-manage/references/ecommerce/gift-cards/ecom-gift-cards-goal-sell-gift-cards.md +338 -0
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-discount-rule.md +42 -78
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-bundle-and-save.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-stock-mover.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-upsell-boost.md +1 -1
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +90 -92
- package/skills/wix-manage/references/events/create-wix-event.md +176 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +174 -0
- package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/get-paid/get-paid-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/google-ads/billing-and-payment.md +80 -0
- package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +212 -0
- package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +110 -0
- package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +25 -0
- package/skills/wix-manage/references/google-ads/install-and-create-account.md +155 -0
- package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +63 -0
- package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +155 -0
- package/skills/wix-manage/references/marketing/marketing-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +99 -1
- package/skills/wix-manage/references/pricing-plans/pricing-plans-dashboard-navigation.md +45 -0
- package/skills/wix-manage/references/restaurants/restaurants-dashboard-navigation.md +68 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +94 -125
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +48 -9
- package/skills/wix-manage/references/site-properties/site-properties-dashboard-navigation.md +31 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +52 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +2 -25
- package/skills/wix-manage/references/sites/site-import.md +163 -190
- package/skills/wix-manage/references/sites/sites-dashboard-navigation.md +29 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +17 -1
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +26 -8
- package/skills/wix-manage/references/stores/stores-dashboard-navigation.md +65 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +39 -7
- package/skills/wix-replatform/.publish-manifest.json +8 -0
- package/skills/wix-replatform/SKILL.md +693 -0
- package/skills/wix-replatform/lib/artifact-freshness.js +215 -0
- package/skills/wix-replatform/lib/completion-report.js +200 -0
- package/skills/wix-replatform/lib/config-env.js +59 -0
- package/skills/wix-replatform/lib/execution-manifest.js +185 -0
- package/skills/wix-replatform/lib/execution-state.js +173 -0
- package/skills/wix-replatform/lib/import-recovery.js +313 -0
- package/skills/wix-replatform/lib/local-state.js +642 -0
- package/skills/wix-replatform/lib/orchestration-preflight.js +143 -0
- package/skills/wix-replatform/lib/orchestration-router.js +122 -0
- package/skills/wix-replatform/lib/orchestration-state.js +455 -0
- package/skills/wix-replatform/lib/progress-log.js +224 -0
- package/skills/wix-replatform/lib/progress-log.sh +140 -0
- package/skills/wix-replatform/lib/url-preservation-state.js +391 -0
- package/skills/wix-replatform/resources/rp-discovery/SKILL.md +184 -0
- package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +529 -0
- package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +316 -0
- package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +64 -0
- package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +1114 -0
- package/skills/wix-replatform/resources/rp-mapper/SKILL.md +430 -0
- package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +217 -0
- package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +148 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +378 -0
- package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +183 -0
- package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +478 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +136 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +310 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +1081 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +618 -0
- package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +949 -0
- package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +196 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +66 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +60 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +95 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +82 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +256 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +249 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +444 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +774 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +71 -0
- package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +632 -0
- package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +330 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +39 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +131 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +97 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +528 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +53 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +84 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +25 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +90 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +141 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +384 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +260 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +237 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +2219 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +31 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +100 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +107 -0
- package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +344 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +250 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1927 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +83 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +141 -0
- package/skills/wix-replatform/scripts/artifact-freshness.js +76 -0
- package/skills/wix-replatform/scripts/execution-manifest-validate.js +43 -0
- package/skills/wix-replatform/scripts/execution-state-prepare.js +128 -0
- package/skills/wix-replatform/scripts/orchestration-preflight.js +48 -0
- package/skills/wix-replatform/scripts/orchestration-route.js +46 -0
- package/skills/wix-replatform/scripts/orchestration-state.js +245 -0
- package/skills/wix-vibe-headless/SKILL.md +48 -25
- package/skills/wix-vibe-headless/install/deploy.cjs +95 -0
- package/skills/wix-vibe-headless/install/pin-agents-md.cjs +34 -0
- package/skills/wix-vibe-headless/platforms/README.md +8 -4
- package/skills/wix-vibe-headless/platforms/base44.md +133 -98
- package/skills/wix-vibe-headless/platforms/generic.md +99 -64
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +230 -119
- package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +25 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +35 -0
- package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +38 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +40 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +54 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +65 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +50 -0
- package/skills/wix-vibe-headless/references/blog/seed/SEED.md +103 -0
- package/skills/wix-vibe-headless/references/blog/seed/seed-blog.js +270 -0
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +260 -149
- package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +65 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +47 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +126 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +108 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +58 -0
- package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +95 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +94 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +89 -0
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-checkout.js → app/rest/wix-bookings-checkout.js} +1 -1
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-services.js → app/rest/wix-bookings-services.js} +87 -11
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +117 -0
- package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.js +333 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +169 -147
- package/skills/wix-vibe-headless/references/cms/app/collection.config.js +31 -0
- package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +18 -0
- package/skills/wix-vibe-headless/references/cms/{wix-cms.js → app/rest/wix-cms.js} +47 -2
- package/skills/wix-vibe-headless/references/cms/seed/SEED.md +145 -0
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +228 -131
- package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +23 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +29 -0
- package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +57 -0
- package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +78 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +27 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +54 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +40 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +81 -0
- package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +48 -0
- package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +36 -0
- package/skills/wix-vibe-headless/references/events/{wix-events-browse.js → app/rest/wix-events-browse.js} +1 -1
- package/skills/wix-vibe-headless/references/events/seed/SEED.md +107 -0
- package/skills/wix-vibe-headless/references/events/seed/seed-events.js +251 -0
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +276 -188
- package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +101 -0
- package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +33 -0
- package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +21 -0
- package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +29 -0
- package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +54 -0
- package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +77 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +36 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +32 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +35 -0
- package/skills/wix-vibe-headless/references/members/{wix-members-auth.js → app/rest/wix-members-auth.js} +6 -3
- package/skills/wix-vibe-headless/references/members/install/Register.jsx +22 -0
- package/skills/wix-vibe-headless/references/members/seed/SEED.md +22 -0
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +233 -104
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +31 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +29 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +35 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +25 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +60 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +94 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.js +236 -0
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +240 -117
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +48 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +16 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +25 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +53 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +86 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.js +251 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +248 -124
- package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +81 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +71 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +43 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +21 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +60 -0
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +63 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +32 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +73 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +28 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +102 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +180 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.js +452 -0
- package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +56 -0
- package/skills/wix-vibe-headless/references/shared/{wix-client.js → app/rest/wix-client.js} +6 -8
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +6 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +263 -157
- package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +20 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +150 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +167 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +51 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +54 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +119 -0
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +71 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +109 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +98 -0
- package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +27 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +139 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/Shop.jsx +75 -0
- package/skills/wix-vibe-headless/references/storefront/{wix-store-cart.js → app/rest/wix-store-cart.js} +1 -1
- package/skills/wix-vibe-headless/references/storefront/{wix-store-catalog.js → app/rest/wix-store-catalog.js} +20 -1
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +111 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +299 -0
- /package/skills/wix-vibe-headless/references/blog/{wix-blog.js → app/rest/wix-blog.js} +0 -0
- /package/skills/wix-vibe-headless/references/events/{wix-events-registration.js → app/rest/wix-events-registration.js} +0 -0
- /package/skills/wix-vibe-headless/references/portfolio/{wix-portfolio.js → app/rest/wix-portfolio.js} +0 -0
- /package/skills/wix-vibe-headless/references/pricing-plans/{wix-pricing-plans.js → app/rest/wix-pricing-plans.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-menu.js → app/rest/wix-restaurants-menu.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-ordering.js → app/rest/wix-restaurants-ordering.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-reservations.js → app/rest/wix-restaurants-reservations.js} +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const crypto = require('node:crypto');
|
|
6
|
+
|
|
7
|
+
const SCHEMA_VERSION = 1;
|
|
8
|
+
|
|
9
|
+
const DEFAULT_ARTIFACTS = {
|
|
10
|
+
sourceSchema: 'source-schema.json',
|
|
11
|
+
mappingPlan: 'mapping/mapping-plan.json',
|
|
12
|
+
setupVerification: 'setup/setup-verification.json',
|
|
13
|
+
generatedImportCode: 'src/import',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function sha256Text(text) {
|
|
17
|
+
return crypto.createHash('sha256').update(text).digest('hex');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function fileHash(filePath) {
|
|
21
|
+
if (!fs.existsSync(filePath)) return null;
|
|
22
|
+
const stat = fs.statSync(filePath);
|
|
23
|
+
if (!stat.isFile()) return null;
|
|
24
|
+
return sha256Text(fs.readFileSync(filePath));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function directoryHash(dirPath) {
|
|
28
|
+
if (!fs.existsSync(dirPath)) return null;
|
|
29
|
+
const entries = listFilesRecursive(dirPath)
|
|
30
|
+
.map((file) => {
|
|
31
|
+
const relative = path.relative(dirPath, file).replace(/\\/g, '/');
|
|
32
|
+
return `${relative}\0${fileHash(file)}`;
|
|
33
|
+
})
|
|
34
|
+
.join('\n');
|
|
35
|
+
return sha256Text(entries);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function listFilesRecursive(root) {
|
|
39
|
+
const files = [];
|
|
40
|
+
const entries = fs.readdirSync(root, { withFileTypes: true })
|
|
41
|
+
.filter((entry) => !entry.name.startsWith('.'))
|
|
42
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
const fullPath = path.join(root, entry.name);
|
|
45
|
+
if (entry.isDirectory()) {
|
|
46
|
+
files.push(...listFilesRecursive(fullPath));
|
|
47
|
+
} else if (entry.isFile()) {
|
|
48
|
+
files.push(fullPath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return files;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function hashArtifact(projectDir, relativePath) {
|
|
55
|
+
if (!relativePath) return null;
|
|
56
|
+
const absolute = path.resolve(projectDir, relativePath);
|
|
57
|
+
if (!fs.existsSync(absolute)) return null;
|
|
58
|
+
const stat = fs.statSync(absolute);
|
|
59
|
+
if (stat.isDirectory()) return directoryHash(absolute);
|
|
60
|
+
if (stat.isFile()) return fileHash(absolute);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function targetLedgerRevision(domainsDir) {
|
|
65
|
+
if (!domainsDir || !fs.existsSync(domainsDir)) return null;
|
|
66
|
+
return directoryHash(domainsDir);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function createFreshnessMetadata({
|
|
70
|
+
projectDir,
|
|
71
|
+
domainsDir,
|
|
72
|
+
artifactPaths = DEFAULT_ARTIFACTS,
|
|
73
|
+
generatedImportCodeRevision = null,
|
|
74
|
+
createdAt = new Date().toISOString(),
|
|
75
|
+
} = {}) {
|
|
76
|
+
if (!projectDir) throw new Error('projectDir is required');
|
|
77
|
+
return {
|
|
78
|
+
schemaVersion: SCHEMA_VERSION,
|
|
79
|
+
createdAt,
|
|
80
|
+
artifacts: {
|
|
81
|
+
sourceSchema: {
|
|
82
|
+
path: artifactPaths.sourceSchema || DEFAULT_ARTIFACTS.sourceSchema,
|
|
83
|
+
sha256: hashArtifact(projectDir, artifactPaths.sourceSchema || DEFAULT_ARTIFACTS.sourceSchema),
|
|
84
|
+
},
|
|
85
|
+
mappingPlan: {
|
|
86
|
+
path: artifactPaths.mappingPlan || DEFAULT_ARTIFACTS.mappingPlan,
|
|
87
|
+
sha256: hashArtifact(projectDir, artifactPaths.mappingPlan || DEFAULT_ARTIFACTS.mappingPlan),
|
|
88
|
+
},
|
|
89
|
+
setupVerification: {
|
|
90
|
+
path: artifactPaths.setupVerification || DEFAULT_ARTIFACTS.setupVerification,
|
|
91
|
+
sha256: hashArtifact(projectDir, artifactPaths.setupVerification || DEFAULT_ARTIFACTS.setupVerification),
|
|
92
|
+
},
|
|
93
|
+
generatedImportCode: {
|
|
94
|
+
path: artifactPaths.generatedImportCode || DEFAULT_ARTIFACTS.generatedImportCode,
|
|
95
|
+
sha256: hashArtifact(projectDir, artifactPaths.generatedImportCode || DEFAULT_ARTIFACTS.generatedImportCode),
|
|
96
|
+
revision: generatedImportCodeRevision,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
targetContractLedger: {
|
|
100
|
+
path: domainsDir || null,
|
|
101
|
+
revision: targetLedgerRevision(domainsDir),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function compareFreshnessMetadata(current, recorded) {
|
|
107
|
+
const changes = [];
|
|
108
|
+
if (!recorded || typeof recorded !== 'object') {
|
|
109
|
+
return { ok: false, stale: true, changes: [{ field: 'metadata', reason: 'missing' }] };
|
|
110
|
+
}
|
|
111
|
+
if (recorded.schemaVersion !== SCHEMA_VERSION) {
|
|
112
|
+
changes.push({ field: 'schemaVersion', expected: SCHEMA_VERSION, actual: recorded.schemaVersion });
|
|
113
|
+
}
|
|
114
|
+
for (const name of Object.keys(current.artifacts || {})) {
|
|
115
|
+
const currentEntry = current.artifacts[name] || {};
|
|
116
|
+
const recordedEntry = (recorded.artifacts && recorded.artifacts[name]) || {};
|
|
117
|
+
if (currentEntry.sha256 !== recordedEntry.sha256) {
|
|
118
|
+
changes.push({
|
|
119
|
+
field: `artifacts.${name}.sha256`,
|
|
120
|
+
path: currentEntry.path || recordedEntry.path || null,
|
|
121
|
+
expected: recordedEntry.sha256 || null,
|
|
122
|
+
actual: currentEntry.sha256 || null,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if (name === 'generatedImportCode' && currentEntry.revision !== recordedEntry.revision) {
|
|
126
|
+
changes.push({
|
|
127
|
+
field: 'artifacts.generatedImportCode.revision',
|
|
128
|
+
expected: recordedEntry.revision || null,
|
|
129
|
+
actual: currentEntry.revision || null,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const currentLedger = current.targetContractLedger || {};
|
|
134
|
+
const recordedLedger = recorded.targetContractLedger || {};
|
|
135
|
+
if (currentLedger.revision !== recordedLedger.revision) {
|
|
136
|
+
changes.push({
|
|
137
|
+
field: 'targetContractLedger.revision',
|
|
138
|
+
path: currentLedger.path || recordedLedger.path || null,
|
|
139
|
+
expected: recordedLedger.revision || null,
|
|
140
|
+
actual: currentLedger.revision || null,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return { ok: changes.length === 0, stale: changes.length > 0, changes };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function validateImportPlanFreshness({
|
|
147
|
+
projectDir,
|
|
148
|
+
domainsDir,
|
|
149
|
+
metadataPath = 'execution/review/import-plan.freshness.json',
|
|
150
|
+
artifactPaths = DEFAULT_ARTIFACTS,
|
|
151
|
+
generatedImportCodeRevision = null,
|
|
152
|
+
} = {}) {
|
|
153
|
+
const absoluteMetadataPath = path.resolve(projectDir, metadataPath);
|
|
154
|
+
const current = createFreshnessMetadata({
|
|
155
|
+
projectDir,
|
|
156
|
+
domainsDir,
|
|
157
|
+
artifactPaths,
|
|
158
|
+
generatedImportCodeRevision,
|
|
159
|
+
});
|
|
160
|
+
if (!fs.existsSync(absoluteMetadataPath)) {
|
|
161
|
+
return {
|
|
162
|
+
ok: false,
|
|
163
|
+
stale: true,
|
|
164
|
+
current,
|
|
165
|
+
recorded: null,
|
|
166
|
+
changes: [{ field: metadataPath, reason: 'missing' }],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const recorded = JSON.parse(fs.readFileSync(absoluteMetadataPath, 'utf8'));
|
|
170
|
+
const comparison = compareFreshnessMetadata(current, recorded);
|
|
171
|
+
return { ...comparison, current, recorded };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function writeFreshnessMetadata(filePath, metadata) {
|
|
175
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
176
|
+
fs.writeFileSync(filePath, `${JSON.stringify(metadata, null, 2)}\n`);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function renderImportPlanDelta({ staleResult, generatedAt = new Date().toISOString() }) {
|
|
180
|
+
const lines = [
|
|
181
|
+
'# Import Plan Delta',
|
|
182
|
+
'',
|
|
183
|
+
`Generated: ${generatedAt}`,
|
|
184
|
+
'',
|
|
185
|
+
'The approved import plan is stale relative to current artifacts.',
|
|
186
|
+
'',
|
|
187
|
+
'## Changed Assumptions',
|
|
188
|
+
'',
|
|
189
|
+
];
|
|
190
|
+
for (const change of staleResult.changes || []) {
|
|
191
|
+
const pathPart = change.path ? ` (${change.path})` : '';
|
|
192
|
+
const reasonPart = change.reason ? `: ${change.reason}` : '';
|
|
193
|
+
lines.push(`- ${change.field}${pathPart}${reasonPart}`);
|
|
194
|
+
}
|
|
195
|
+
lines.push('', 'Regenerate `execution/review/import-plan.md` or accept this delta before live writes/final reporting.');
|
|
196
|
+
return `${lines.join('\n')}\n`;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function writeImportPlanDelta(filePath, staleResult) {
|
|
200
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
201
|
+
fs.writeFileSync(filePath, renderImportPlanDelta({ staleResult }));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
module.exports = {
|
|
205
|
+
SCHEMA_VERSION,
|
|
206
|
+
DEFAULT_ARTIFACTS,
|
|
207
|
+
createFreshnessMetadata,
|
|
208
|
+
compareFreshnessMetadata,
|
|
209
|
+
validateImportPlanFreshness,
|
|
210
|
+
writeFreshnessMetadata,
|
|
211
|
+
renderImportPlanDelta,
|
|
212
|
+
writeImportPlanDelta,
|
|
213
|
+
hashArtifact,
|
|
214
|
+
targetLedgerRevision,
|
|
215
|
+
};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const COMPLETION_STATUS = [
|
|
4
|
+
'aborted',
|
|
5
|
+
'incomplete_with_mismatches',
|
|
6
|
+
'incomplete_with_failures',
|
|
7
|
+
'complete_with_deferred_records',
|
|
8
|
+
'complete_with_recovered_records',
|
|
9
|
+
'complete_with_warnings',
|
|
10
|
+
'complete',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const STATUS_RANK = new Map(COMPLETION_STATUS.map((status, index) => [status, index]));
|
|
14
|
+
|
|
15
|
+
function count(value, field) {
|
|
16
|
+
if (value === undefined || value === null) {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
20
|
+
throw new Error(`${field} must be a non-negative integer`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function requireString(value, field) {
|
|
26
|
+
if (!value || typeof value !== 'string') {
|
|
27
|
+
throw new Error(`${field} must be a non-empty string`);
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function asArray(value, field) {
|
|
33
|
+
if (value === undefined || value === null) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
if (!Array.isArray(value)) {
|
|
37
|
+
throw new Error(`${field} must be an array`);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function hasCount(rows, field) {
|
|
43
|
+
return rows.some((row) => row[field] > 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function worseStatus(left, right) {
|
|
47
|
+
const leftRank = STATUS_RANK.has(left) ? STATUS_RANK.get(left) : STATUS_RANK.get('complete');
|
|
48
|
+
const rightRank = STATUS_RANK.has(right) ? STATUS_RANK.get(right) : STATUS_RANK.get('complete');
|
|
49
|
+
return leftRank <= rightRank ? left : right;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function chooseCompletionStatus(input = {}) {
|
|
53
|
+
const statuses = asArray(input.statuses, 'statuses');
|
|
54
|
+
let selected = input.defaultStatus || 'complete';
|
|
55
|
+
if (!STATUS_RANK.has(selected)) {
|
|
56
|
+
throw new Error(`unknown completion status: ${selected}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
for (const status of statuses) {
|
|
60
|
+
if (!STATUS_RANK.has(status)) {
|
|
61
|
+
throw new Error(`unknown completion status: ${status}`);
|
|
62
|
+
}
|
|
63
|
+
selected = worseStatus(selected, status);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (input.aborted) {
|
|
67
|
+
selected = worseStatus(selected, 'aborted');
|
|
68
|
+
}
|
|
69
|
+
if (input.hasMismatches) {
|
|
70
|
+
selected = worseStatus(selected, 'incomplete_with_mismatches');
|
|
71
|
+
}
|
|
72
|
+
if (input.hasFailures) {
|
|
73
|
+
selected = worseStatus(selected, 'incomplete_with_failures');
|
|
74
|
+
}
|
|
75
|
+
if (input.hasDeferred) {
|
|
76
|
+
selected = worseStatus(selected, 'complete_with_deferred_records');
|
|
77
|
+
}
|
|
78
|
+
if (input.hasRecoveredRecords) {
|
|
79
|
+
selected = worseStatus(selected, 'complete_with_recovered_records');
|
|
80
|
+
}
|
|
81
|
+
if (input.hasWarnings) {
|
|
82
|
+
selected = worseStatus(selected, 'complete_with_warnings');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return selected;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function normalizeCompletenessRow(row, index = 0) {
|
|
89
|
+
if (!row || typeof row !== 'object' || Array.isArray(row)) {
|
|
90
|
+
throw new Error(`entityCompleteness[${index}] must be an object`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const entity = requireString(row.entity, `entityCompleteness[${index}].entity`);
|
|
94
|
+
const subtype = row.subtype === undefined || row.subtype === null ? 'all' : requireString(row.subtype, `entityCompleteness[${index}].subtype`);
|
|
95
|
+
const extracted = count(row.extracted, `${entity}/${subtype}.extracted`);
|
|
96
|
+
const inScope = count(row.inScope, `${entity}/${subtype}.inScope`);
|
|
97
|
+
const attempted = count(row.attempted, `${entity}/${subtype}.attempted`);
|
|
98
|
+
const imported = count(row.imported, `${entity}/${subtype}.imported`);
|
|
99
|
+
const alreadyPresentByCrosswalk = count(
|
|
100
|
+
row.alreadyPresentByCrosswalk === undefined ? row.alreadyPresent : row.alreadyPresentByCrosswalk,
|
|
101
|
+
`${entity}/${subtype}.alreadyPresentByCrosswalk`
|
|
102
|
+
);
|
|
103
|
+
const deferred = count(row.deferred, `${entity}/${subtype}.deferred`);
|
|
104
|
+
const failed = count(row.failed, `${entity}/${subtype}.failed`);
|
|
105
|
+
const skippedOutOfScope = count(row.skippedOutOfScope, `${entity}/${subtype}.skippedOutOfScope`);
|
|
106
|
+
const unexpectedSkipped = count(
|
|
107
|
+
row.unexpectedSkipped === undefined ? row.skippedInScope : row.unexpectedSkipped,
|
|
108
|
+
`${entity}/${subtype}.unexpectedSkipped`
|
|
109
|
+
);
|
|
110
|
+
const reconciled = imported + alreadyPresentByCrosswalk + deferred + failed;
|
|
111
|
+
const expectedReconciled = inScope;
|
|
112
|
+
const mismatch = reconciled !== expectedReconciled || unexpectedSkipped > 0;
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
entity,
|
|
116
|
+
subtype,
|
|
117
|
+
extracted,
|
|
118
|
+
inScope,
|
|
119
|
+
attempted,
|
|
120
|
+
imported,
|
|
121
|
+
alreadyPresentByCrosswalk,
|
|
122
|
+
deferred,
|
|
123
|
+
failed,
|
|
124
|
+
skippedOutOfScope,
|
|
125
|
+
unexpectedSkipped,
|
|
126
|
+
reconciled,
|
|
127
|
+
expectedReconciled,
|
|
128
|
+
mismatch,
|
|
129
|
+
reasons: Array.isArray(row.reasons) ? row.reasons : [],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function headlineForRow(row) {
|
|
134
|
+
const parts = [];
|
|
135
|
+
if (row.mismatch) {
|
|
136
|
+
parts.push(`mismatch ${row.reconciled}/${row.expectedReconciled}`);
|
|
137
|
+
}
|
|
138
|
+
if (row.deferred > 0) {
|
|
139
|
+
parts.push(`${row.deferred} deferred`);
|
|
140
|
+
}
|
|
141
|
+
if (row.failed > 0) {
|
|
142
|
+
parts.push(`${row.failed} failed`);
|
|
143
|
+
}
|
|
144
|
+
if (row.unexpectedSkipped > 0) {
|
|
145
|
+
parts.push(`${row.unexpectedSkipped} unexpected skipped`);
|
|
146
|
+
}
|
|
147
|
+
if (!parts.length) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
entity: row.entity,
|
|
152
|
+
subtype: row.subtype,
|
|
153
|
+
message: `${row.entity}/${row.subtype}: ${parts.join(', ')}`,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function createCompletionReport(input = {}) {
|
|
158
|
+
const entityCompleteness = asArray(input.entityCompleteness, 'entityCompleteness')
|
|
159
|
+
.map((row, index) => normalizeCompletenessRow(row, index));
|
|
160
|
+
const mismatches = entityCompleteness.filter((row) => row.mismatch);
|
|
161
|
+
const headline = entityCompleteness.map(headlineForRow).filter(Boolean);
|
|
162
|
+
const warnings = asArray(input.warnings, 'warnings');
|
|
163
|
+
const recoveryActions = asArray(input.recoveryActions, 'recoveryActions');
|
|
164
|
+
const status = chooseCompletionStatus({
|
|
165
|
+
statuses: input.statuses,
|
|
166
|
+
aborted: input.aborted,
|
|
167
|
+
hasMismatches: mismatches.length > 0,
|
|
168
|
+
hasFailures: hasCount(entityCompleteness, 'failed'),
|
|
169
|
+
hasDeferred: hasCount(entityCompleteness, 'deferred'),
|
|
170
|
+
hasRecoveredRecords: recoveryActions.length > 0 || Boolean(input.hasRecoveredRecords),
|
|
171
|
+
hasWarnings: warnings.length > 0 || Boolean(input.hasWarnings),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
schemaVersion: 1,
|
|
176
|
+
runId: input.runId || null,
|
|
177
|
+
status,
|
|
178
|
+
headline,
|
|
179
|
+
entityCompleteness,
|
|
180
|
+
mismatches: mismatches.map((row) => ({
|
|
181
|
+
entity: row.entity,
|
|
182
|
+
subtype: row.subtype,
|
|
183
|
+
expectedReconciled: row.expectedReconciled,
|
|
184
|
+
reconciled: row.reconciled,
|
|
185
|
+
unexpectedSkipped: row.unexpectedSkipped,
|
|
186
|
+
})),
|
|
187
|
+
warnings,
|
|
188
|
+
recoveryActions,
|
|
189
|
+
artifacts: input.artifacts || {},
|
|
190
|
+
destinations: input.destinations || {},
|
|
191
|
+
urlPreservation: input.urlPreservation || null,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
module.exports = {
|
|
196
|
+
COMPLETION_STATUS,
|
|
197
|
+
chooseCompletionStatus,
|
|
198
|
+
createCompletionReport,
|
|
199
|
+
normalizeCompletenessRow,
|
|
200
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs/promises');
|
|
4
|
+
|
|
5
|
+
function parseEnvText(text) {
|
|
6
|
+
const values = {};
|
|
7
|
+
const lines = String(text).split(/\r?\n/);
|
|
8
|
+
for (const rawLine of lines) {
|
|
9
|
+
const line = rawLine.trim();
|
|
10
|
+
if (!line || line.startsWith('#')) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const idx = line.indexOf('=');
|
|
14
|
+
if (idx === -1) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const key = line.slice(0, idx).trim();
|
|
18
|
+
const value = line.slice(idx + 1);
|
|
19
|
+
values[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return values;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function readEnvFile(filePath) {
|
|
25
|
+
const raw = await fs.readFile(filePath, 'utf8');
|
|
26
|
+
return parseEnvText(raw);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function statEnvKeys(filePath, requiredKeys) {
|
|
30
|
+
try {
|
|
31
|
+
const values = await readEnvFile(filePath);
|
|
32
|
+
const keys = {};
|
|
33
|
+
for (const key of requiredKeys) {
|
|
34
|
+
if (!(key in values)) {
|
|
35
|
+
keys[key] = 'missing';
|
|
36
|
+
} else if (String(values[key]).trim() === '') {
|
|
37
|
+
keys[key] = 'blank';
|
|
38
|
+
} else {
|
|
39
|
+
keys[key] = 'present';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { exists: true, keys };
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (error && error.code === 'ENOENT') {
|
|
45
|
+
const keys = {};
|
|
46
|
+
for (const key of requiredKeys) {
|
|
47
|
+
keys[key] = 'missing';
|
|
48
|
+
}
|
|
49
|
+
return { exists: false, keys };
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = {
|
|
56
|
+
parseEnvText,
|
|
57
|
+
readEnvFile,
|
|
58
|
+
statEnvKeys,
|
|
59
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SCHEMA_VERSION = 1;
|
|
4
|
+
|
|
5
|
+
const TASK_KIND = new Set(['setup', 'extract', 'import']);
|
|
6
|
+
const TASK_STATUS = new Set(['pending', 'running', 'completed', 'blocked', 'failed', 'skipped']);
|
|
7
|
+
const CROSSWALK_AUTHORITY = new Set(['local']);
|
|
8
|
+
const CMS_MIRROR_MODE = new Set(['none', 'download', 'upload', 'download-and-upload']);
|
|
9
|
+
const URL_PRESERVATION_PATHS = [
|
|
10
|
+
'basePathsPath',
|
|
11
|
+
'ledgerPath',
|
|
12
|
+
'redirectsPath',
|
|
13
|
+
'unresolvedPath',
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
function createManifest({ projectId, planVersion, tasks = [], generatedArtifacts = [], llmHandoff = null, timestamp = new Date().toISOString() }) {
|
|
17
|
+
return {
|
|
18
|
+
schemaVersion: SCHEMA_VERSION,
|
|
19
|
+
projectId,
|
|
20
|
+
planVersion,
|
|
21
|
+
generatedAt: timestamp,
|
|
22
|
+
generatedArtifacts,
|
|
23
|
+
tasks,
|
|
24
|
+
llmHandoff,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function validateManifest(manifest) {
|
|
29
|
+
const errors = [];
|
|
30
|
+
if (!manifest || typeof manifest !== 'object') {
|
|
31
|
+
errors.push('manifest must be an object');
|
|
32
|
+
return { ok: false, errors };
|
|
33
|
+
}
|
|
34
|
+
if (manifest.schemaVersion !== SCHEMA_VERSION) {
|
|
35
|
+
errors.push(`schemaVersion must be ${SCHEMA_VERSION}`);
|
|
36
|
+
}
|
|
37
|
+
if (!manifest.projectId || typeof manifest.projectId !== 'string') {
|
|
38
|
+
errors.push('projectId must be a non-empty string');
|
|
39
|
+
}
|
|
40
|
+
if (!manifest.planVersion || typeof manifest.planVersion !== 'string') {
|
|
41
|
+
errors.push('planVersion must be a non-empty string');
|
|
42
|
+
}
|
|
43
|
+
if (!Array.isArray(manifest.generatedArtifacts)) {
|
|
44
|
+
errors.push('generatedArtifacts must be an array');
|
|
45
|
+
}
|
|
46
|
+
if (!Array.isArray(manifest.tasks) || manifest.tasks.length === 0) {
|
|
47
|
+
errors.push('tasks must be a non-empty array');
|
|
48
|
+
} else {
|
|
49
|
+
const ids = new Set();
|
|
50
|
+
for (const task of manifest.tasks) {
|
|
51
|
+
if (!task || typeof task !== 'object') {
|
|
52
|
+
errors.push('task must be an object');
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (!task.id || typeof task.id !== 'string') {
|
|
56
|
+
errors.push('task.id must be a non-empty string');
|
|
57
|
+
} else if (ids.has(task.id)) {
|
|
58
|
+
errors.push(`duplicate task id: ${task.id}`);
|
|
59
|
+
} else {
|
|
60
|
+
ids.add(task.id);
|
|
61
|
+
}
|
|
62
|
+
if (!TASK_KIND.has(task.kind)) {
|
|
63
|
+
errors.push(`task.kind invalid for ${task.id || '<unknown>'}`);
|
|
64
|
+
}
|
|
65
|
+
if (task.status && !TASK_STATUS.has(task.status)) {
|
|
66
|
+
errors.push(`task.status invalid for ${task.id || '<unknown>'}`);
|
|
67
|
+
}
|
|
68
|
+
if (!Array.isArray(task.dependsOn)) {
|
|
69
|
+
errors.push(`task.dependsOn must be an array for ${task.id || '<unknown>'}`);
|
|
70
|
+
}
|
|
71
|
+
if (!Array.isArray(task.artifactRefs)) {
|
|
72
|
+
errors.push(`task.artifactRefs must be an array for ${task.id || '<unknown>'}`);
|
|
73
|
+
}
|
|
74
|
+
validateUrlPreservation(task, errors);
|
|
75
|
+
if (task.kind === 'import') {
|
|
76
|
+
validateImportTaskState(task, errors);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { ok: errors.length === 0, errors };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function validateUrlPreservation(task, errors) {
|
|
84
|
+
if (task.urlPreservation === undefined) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const label = task.id || '<unknown>';
|
|
88
|
+
if (task.kind !== 'import') {
|
|
89
|
+
errors.push(`task.urlPreservation is only allowed for import tasks in ${label}`);
|
|
90
|
+
}
|
|
91
|
+
const policy = task.urlPreservation;
|
|
92
|
+
if (!policy || typeof policy !== 'object' || Array.isArray(policy)) {
|
|
93
|
+
errors.push(`task.urlPreservation must be an object for ${label}`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (policy.enabled !== undefined && typeof policy.enabled !== 'boolean') {
|
|
97
|
+
errors.push(`task.urlPreservation.enabled must be a boolean for ${label}`);
|
|
98
|
+
}
|
|
99
|
+
if (policy.applyRedirects === true) {
|
|
100
|
+
errors.push(`task.urlPreservation.applyRedirects must be false until website-builder redirect application is supported for ${label}`);
|
|
101
|
+
}
|
|
102
|
+
if (policy.applyRedirects !== undefined && typeof policy.applyRedirects !== 'boolean') {
|
|
103
|
+
errors.push(`task.urlPreservation.applyRedirects must be a boolean for ${label}`);
|
|
104
|
+
}
|
|
105
|
+
if (policy.enabled === true) {
|
|
106
|
+
for (const field of URL_PRESERVATION_PATHS) {
|
|
107
|
+
if (!policy[field] || typeof policy[field] !== 'string') {
|
|
108
|
+
errors.push(`task.urlPreservation.${field} required when enabled for ${label}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (policy.applyRedirects !== false) {
|
|
112
|
+
errors.push(`task.urlPreservation.applyRedirects must be false when enabled for ${label}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function hasServerAssignedNativeTargetIds(task) {
|
|
118
|
+
return task.targetIdAssignment === 'server' ||
|
|
119
|
+
task.targetIdAssignment === 'server-assigned' ||
|
|
120
|
+
task.nativeTargetIds === 'server-assigned' ||
|
|
121
|
+
task.targetIdsServerAssigned === true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function validateCmsMirror(task, state, errors) {
|
|
125
|
+
if (!state.cmsMirror || typeof state.cmsMirror !== 'object') {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const mode = state.cmsMirror.mode;
|
|
129
|
+
if (!CMS_MIRROR_MODE.has(mode)) {
|
|
130
|
+
errors.push(`task.state.cmsMirror.mode invalid for ${task.id || '<unknown>'}`);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (mode !== 'none') {
|
|
134
|
+
if (!state.cmsMirror.collectionId || typeof state.cmsMirror.collectionId !== 'string') {
|
|
135
|
+
errors.push(`task.state.cmsMirror.collectionId required when CMS mirror is enabled for ${task.id || '<unknown>'}`);
|
|
136
|
+
}
|
|
137
|
+
if (!state.cmsMirror.setupRequirementId || typeof state.cmsMirror.setupRequirementId !== 'string') {
|
|
138
|
+
errors.push(`task.state.cmsMirror.setupRequirementId required when CMS mirror is enabled for ${task.id || '<unknown>'}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function validateImportTaskState(task, errors) {
|
|
144
|
+
const state = task.state;
|
|
145
|
+
if (!state || typeof state !== 'object') {
|
|
146
|
+
if (hasServerAssignedNativeTargetIds(task)) {
|
|
147
|
+
errors.push(`task.state required for server-assigned native target IDs in ${task.id || '<unknown>'}`);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (state.crosswalkAuthority === 'cms') {
|
|
152
|
+
errors.push(`task.state.crosswalkAuthority must not be cms for ${task.id || '<unknown>'}`);
|
|
153
|
+
}
|
|
154
|
+
if (state.crosswalkAuthority !== undefined && !CROSSWALK_AUTHORITY.has(state.crosswalkAuthority)) {
|
|
155
|
+
errors.push(`task.state.crosswalkAuthority invalid for ${task.id || '<unknown>'}`);
|
|
156
|
+
}
|
|
157
|
+
if (hasServerAssignedNativeTargetIds(task) && (!state.crosswalkPath || typeof state.crosswalkPath !== 'string')) {
|
|
158
|
+
errors.push(`task.state.crosswalkPath required for server-assigned native target IDs in ${task.id || '<unknown>'}`);
|
|
159
|
+
}
|
|
160
|
+
if (state.attemptJournalPath !== undefined && typeof state.attemptJournalPath !== 'string') {
|
|
161
|
+
errors.push(`task.state.attemptJournalPath must be a string for ${task.id || '<unknown>'}`);
|
|
162
|
+
}
|
|
163
|
+
validateCmsMirror(task, state, errors);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function nextPendingTask(manifest, completedIds = new Set()) {
|
|
167
|
+
const done = completedIds instanceof Set ? completedIds : new Set(completedIds || []);
|
|
168
|
+
for (const task of manifest.tasks || []) {
|
|
169
|
+
if (task.status === 'completed' || done.has(task.id)) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const deps = Array.isArray(task.dependsOn) ? task.dependsOn : [];
|
|
173
|
+
if (deps.every((dep) => done.has(dep))) {
|
|
174
|
+
return task;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
module.exports = {
|
|
181
|
+
SCHEMA_VERSION,
|
|
182
|
+
createManifest,
|
|
183
|
+
validateManifest,
|
|
184
|
+
nextPendingTask,
|
|
185
|
+
};
|