@wix/agent-skills 1.33.0 → 1.34.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 +23 -0
- package/package.json +2 -2
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-export/SKILL.md +83 -0
- package/skills/wix-harmony-editor/.publish-manifest.json +8 -0
- package/skills/wix-harmony-editor/COPY-SITE.md +494 -0
- package/skills/wix-harmony-editor/SKILL.md +317 -0
- package/skills/wix-harmony-editor/scripts/copy/build-description.mjs +249 -0
- package/skills/wix-harmony-editor/scripts/copy/check-description.mjs +225 -0
- package/skills/wix-harmony-editor/scripts/copy/check-mirror.mjs +89 -0
- package/skills/wix-harmony-editor/scripts/copy/compare-preview.mjs +76 -0
- package/skills/wix-harmony-editor/scripts/copy/deploy-description.mjs +212 -0
- package/skills/wix-harmony-editor/scripts/copy/desc-hash.mjs +44 -0
- package/skills/wix-harmony-editor/scripts/copy/editor-run.mjs +45 -0
- package/skills/wix-harmony-editor/scripts/copy/export-page.mjs +53 -0
- package/skills/wix-harmony-editor/scripts/copy/find-interactions.mjs +76 -0
- package/skills/wix-harmony-editor/scripts/copy/hide-scrollbars.mjs +16 -0
- package/skills/wix-harmony-editor/scripts/copy/import-media.mjs +150 -0
- package/skills/wix-harmony-editor/scripts/copy/link-url.mjs +27 -0
- package/skills/wix-harmony-editor/scripts/copy/lint-api.mjs +56 -0
- package/skills/wix-harmony-editor/scripts/copy/measure-source.mjs +211 -0
- package/skills/wix-harmony-editor/scripts/copy/merge-mirrors.mjs +29 -0
- package/skills/wix-harmony-editor/scripts/copy/mirror-site.mjs +92 -0
- package/skills/wix-harmony-editor/scripts/copy/mobile-stage.mjs +56 -0
- package/skills/wix-harmony-editor/scripts/copy/preview-widths.mjs +73 -0
- package/skills/wix-harmony-editor/scripts/copy/render-plate.mjs +67 -0
- package/skills/wix-harmony-editor/scripts/copy/serve-mirror.mjs +102 -0
- package/skills/wix-harmony-editor/scripts/copy/snapshot-capabilities.mjs +40 -0
- package/skills/wix-harmony-editor/scripts/copy/split-sections.mjs +191 -0
- package/skills/wix-harmony-editor/scripts/copy/upload-media-manager.mjs +61 -0
- package/skills/wix-harmony-editor/scripts/launch.sh +359 -0
- package/skills/wix-headless/SKILL.md +7 -2
- package/skills/wix-headless/references/CAPABILITIES.md +6 -1
- package/skills/wix-headless/references/DISCOVERY.md +2 -1
- package/skills/wix-headless/references/SDK_HANDOFF.md +6 -1
- package/skills/wix-headless/references/SEED.md +3 -2
- package/skills/wix-headless/references/SETUP.md +1 -0
- package/skills/wix-headless/references/inline-recipes/experience-donations.md +102 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-donations.md +146 -0
- package/skills/wix-headless/references/inline-recipes/setup-donations.md +15 -0
- package/skills/wix-headless/references/managed/CREATE.md +1 -1
- package/skills/wix-headless-kit/SKILL.md +110 -21
- package/skills/wix-headless-kit/guides/api-run.md +15 -13
- package/skills/wix-headless-kit/guides/existing-site.md +31 -0
- package/skills/wix-headless-kit/guides/migration.md +49 -17
- package/skills/wix-headless-kit/install/agents-md.mjs +1 -1
- package/skills/wix-headless-kit/install/context.mjs +61 -6
- package/skills/wix-headless-kit/install/pins.json +1 -1
- package/skills/wix-headless-kit/install/setup.mjs +107 -12
- package/skills/wix-headless-replatform/.publish-manifest.json +8 -0
- package/skills/wix-headless-replatform/SKILL.md +116 -0
- package/skills/wix-headless-replatform/agents/openai.yaml +6 -0
- package/skills/wix-headless-replatform/references/control-and-visual-fidelity-contract.md +43 -0
- package/skills/wix-headless-replatform/references/extraction-schema.md +187 -0
- package/skills/wix-headless-replatform/references/interaction-runtime-contract.md +137 -0
- package/skills/wix-headless-replatform/references/layout-blueprint-contract.md +41 -0
- package/skills/wix-headless-replatform/references/output-contract.md +93 -0
- package/skills/wix-headless-replatform/references/post-build-gap-contract.md +125 -0
- package/skills/wix-headless-replatform/references/qa-checklist.md +83 -0
- package/skills/wix-headless-replatform/references/safety.md +19 -0
- package/skills/wix-headless-replatform/references/ui-normalization-contract.md +70 -0
- package/skills/wix-headless-replatform/references/workflow.md +157 -0
- package/skills/wix-headless-replatform/registry/README.md +20 -0
- package/skills/wix-headless-replatform/registry/approvals/button/shadcn-default-ac60ef5.json +28 -0
- package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/button.tsx +54 -0
- package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/capabilities.json +60 -0
- package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/contract.md +48 -0
- package/skills/wix-headless-replatform/registry/licenses/shadcn-ui-ac60ef5-MIT.txt +21 -0
- package/skills/wix-headless-replatform/registry/registry.json +36 -0
- package/skills/wix-headless-replatform/resources/rp-facelift/SKILL.md +32 -0
- package/skills/wix-headless-replatform/resources/rp-project-context/SKILL.md +62 -0
- package/skills/wix-headless-replatform/resources/rp-qa-gap-loop/SKILL.md +64 -0
- package/skills/wix-headless-replatform/resources/rp-source-evidence/SKILL.md +42 -0
- package/skills/wix-headless-replatform/resources/rp-ui-implementation/SKILL.md +73 -0
- package/skills/wix-headless-replatform/schemas/build-plan.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/candidate.schema.json +19 -0
- package/skills/wix-headless-replatform/schemas/common.schema.json +33 -0
- package/skills/wix-headless-replatform/schemas/decision-patch.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/decision-request.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/extraction-gap.schema.json +28 -0
- package/skills/wix-headless-replatform/schemas/extraction-manifest.schema.json +34 -0
- package/skills/wix-headless-replatform/schemas/final-report.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/foundation.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/metadata.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/observation-packet.schema.json +17 -0
- package/skills/wix-headless-replatform/schemas/page-capture.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/page-resolution.schema.json +33 -0
- package/skills/wix-headless-replatform/schemas/shared-chrome.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/unit.schema.json +40 -0
- package/skills/wix-headless-replatform/scripts/assemble-extraction.mjs +844 -0
- package/skills/wix-headless-replatform/scripts/benchmark-extraction.mjs +163 -0
- package/skills/wix-headless-replatform/scripts/browser-extraction-preflight.mjs +42 -0
- package/skills/wix-headless-replatform/scripts/build-extracted-homepage.mjs +228 -0
- package/skills/wix-headless-replatform/scripts/clear-wix-starter.mjs +87 -0
- package/skills/wix-headless-replatform/scripts/create-wix-project.mjs +505 -0
- package/skills/wix-headless-replatform/scripts/discover-urls.mjs +142 -0
- package/skills/wix-headless-replatform/scripts/extract-assets.mjs +140 -0
- package/skills/wix-headless-replatform/scripts/extract-design-system.mjs +637 -0
- package/skills/wix-headless-replatform/scripts/extract-interactions.mjs +1903 -0
- package/skills/wix-headless-replatform/scripts/extract-page.mjs +2461 -0
- package/skills/wix-headless-replatform/scripts/extract-seo.mjs +25 -0
- package/skills/wix-headless-replatform/scripts/extract-tokens.mjs +63 -0
- package/skills/wix-headless-replatform/scripts/finalize-extraction-report.mjs +126 -0
- package/skills/wix-headless-replatform/scripts/finalize-gap-review.mjs +180 -0
- package/skills/wix-headless-replatform/scripts/finalize-gap-review.test.mjs +98 -0
- package/skills/wix-headless-replatform/scripts/finalize-migration-website.mjs +103 -0
- package/skills/wix-headless-replatform/scripts/generate-control-state-contract.mjs +176 -0
- package/skills/wix-headless-replatform/scripts/generate-design-md.mjs +261 -0
- package/skills/wix-headless-replatform/scripts/generate-extraction-validators.mjs +25 -0
- package/skills/wix-headless-replatform/scripts/generate-invoice-download-backend.mjs +342 -0
- package/skills/wix-headless-replatform/scripts/generate-layout-blueprint.mjs +140 -0
- package/skills/wix-headless-replatform/scripts/generate-repeater-cms.mjs +22 -0
- package/skills/wix-headless-replatform/scripts/generate-route-plan.mjs +143 -0
- package/skills/wix-headless-replatform/scripts/generate-scene-contract.mjs +288 -0
- package/skills/wix-headless-replatform/scripts/generate-ui-normalization.mjs +266 -0
- package/skills/wix-headless-replatform/scripts/generate-visual-assets.mjs +111 -0
- package/skills/wix-headless-replatform/scripts/lib/browser-tooling.mjs +570 -0
- package/skills/wix-headless-replatform/scripts/lib/common.mjs +329 -0
- package/skills/wix-headless-replatform/scripts/lib/component-capabilities.mjs +121 -0
- package/skills/wix-headless-replatform/scripts/lib/component-registry.mjs +282 -0
- package/skills/wix-headless-replatform/scripts/lib/content-boundary.mjs +61 -0
- package/skills/wix-headless-replatform/scripts/lib/extraction-contract.mjs +374 -0
- package/skills/wix-headless-replatform/scripts/lib/extraction-detectors.mjs +243 -0
- package/skills/wix-headless-replatform/scripts/lib/extraction-validators.generated.mjs +1139 -0
- package/skills/wix-headless-replatform/scripts/lib/font-contract.mjs +326 -0
- package/skills/wix-headless-replatform/scripts/lib/frontend-automation-state.mjs +184 -0
- package/skills/wix-headless-replatform/scripts/lib/gap-analysis.mjs +396 -0
- package/skills/wix-headless-replatform/scripts/lib/html-extract.mjs +168 -0
- package/skills/wix-headless-replatform/scripts/lib/interaction-bootstrap.mjs +10 -0
- package/skills/wix-headless-replatform/scripts/lib/interaction-runtime.mjs +194 -0
- package/skills/wix-headless-replatform/scripts/lib/interaction-timeline.mjs +348 -0
- package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/classifiers.mjs +141 -0
- package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/geometry.mjs +43 -0
- package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/vocabulary.mjs +18 -0
- package/skills/wix-headless-replatform/scripts/lib/ui-normalization.css +64 -0
- package/skills/wix-headless-replatform/scripts/optimize-svg.mjs +31 -0
- package/skills/wix-headless-replatform/scripts/post-build-gap.mjs +358 -0
- package/skills/wix-headless-replatform/scripts/provision-repeater-cms.mjs +25 -0
- package/skills/wix-headless-replatform/scripts/record-gap-decision.mjs +39 -0
- package/skills/wix-headless-replatform/scripts/replay-extraction.mjs +107 -0
- package/skills/wix-headless-replatform/scripts/resolve-home-page.mjs +96 -0
- package/skills/wix-headless-replatform/scripts/site-clone.mjs +658 -0
- package/skills/wix-headless-replatform/scripts/validate-font-contract.mjs +29 -0
- package/skills/wix-headless-replatform/scripts/verify-interactions.mjs +669 -0
- package/skills/wix-headless-replatform/scripts/visual-qa.mjs +370 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +37 -24
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +49 -23
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +6 -5
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +5 -5
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +7 -3
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +2 -2
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +12 -9
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +49 -23
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +6 -5
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +5 -5
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +7 -3
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +2 -2
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +12 -9
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/rest/donate.ts +7 -3
- package/skills/wix-headless-templates/donations/seed/SEED.md +12 -7
- package/skills/wix-headless-templates/donations/tests/donation-contract.test.mjs +71 -0
- package/skills/wix-headless-templates/donations/tests/donation-form.test.cjs +137 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +28 -14
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +87 -5
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +9 -1
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +33 -4
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +100 -5
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +101 -15
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +35 -1
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +87 -5
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +9 -1
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +33 -4
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +100 -5
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +101 -15
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +35 -1
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +91 -14
- package/skills/wix-import/SKILL.md +90 -0
- package/skills/wix-manage/SKILL.md +38 -10
- package/skills/wix-manage/references/automations/actions.md +11 -11
- package/skills/wix-manage/references/automations/activation-status.md +6 -9
- package/skills/wix-manage/references/automations/api-catalog.md +48 -32
- package/skills/wix-manage/references/automations/automation-model.md +97 -22
- package/skills/wix-manage/references/automations/bracket-expressions.md +7 -7
- package/skills/wix-manage/references/automations/build-and-manage-automations.md +140 -309
- package/skills/wix-manage/references/automations/conditions.md +187 -0
- package/skills/wix-manage/references/automations/schemas-and-scheduling.md +191 -0
- package/skills/wix-manage/references/automations/special-actions.md +210 -0
- package/skills/wix-manage/references/automations/triggers.md +47 -10
- package/skills/wix-manage/references/automations/validation-and-verification.md +320 -0
- package/skills/wix-manage/references/custom-apps/use-app-tools.md +124 -0
- package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +2 -1
- package/skills/wix-manage/references/dashboard-navigation/routes.json +249 -0
- package/skills/wix-manage/references/donations/create-and-update-donation-campaigns.md +139 -0
- package/skills/wix-manage/references/events/create-wix-event.md +136 -73
- package/skills/wix-manage/references/events/events-dashboard-navigation.md +81 -0
- package/skills/wix-manage/references/events/manage-event-guests.md +366 -0
- package/skills/wix-manage/references/events/manage-event-tickets.md +293 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +313 -55
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +1 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +127 -8
- package/skills/wix-manage/references/stores/update-product-with-options.md +58 -2
- package/skills/wix-replatform/.publish-manifest.json +5 -5
- package/skills/wix-replatform/CLI.md +162 -0
- package/skills/wix-replatform/README.md +52 -0
- package/skills/wix-replatform/SKILL.md +229 -684
- package/skills/wix-replatform/console/account.css +1 -0
- package/skills/wix-replatform/console/app.css +1 -0
- package/skills/wix-replatform/console/app.js +117 -0
- package/skills/wix-replatform/console/index.html +4 -0
- package/skills/wix-replatform/console/json.css +11 -0
- package/skills/wix-replatform/lib/agent-adapters/index.js +71 -0
- package/skills/wix-replatform/lib/app-page-routing.js +75 -0
- package/skills/wix-replatform/lib/artifact-freshness.js +11 -1
- package/skills/wix-replatform/lib/blocked-data-requests.js +427 -0
- package/skills/wix-replatform/lib/census-reconciliation.js +426 -0
- package/skills/wix-replatform/lib/completion-report.js +1393 -13
- package/skills/wix-replatform/lib/config-env.js +85 -11
- package/skills/wix-replatform/lib/confirmed-pictures.js +212 -0
- package/skills/wix-replatform/lib/dependency-readiness.js +423 -0
- package/skills/wix-replatform/lib/dependency-recovery.js +21 -0
- package/skills/wix-replatform/lib/destination-choice.js +163 -0
- package/skills/wix-replatform/lib/destination-handoff.js +62 -0
- package/skills/wix-replatform/lib/destination-http.js +81 -0
- package/skills/wix-replatform/lib/destination-route.js +98 -0
- package/skills/wix-replatform/lib/destination.js +919 -0
- package/skills/wix-replatform/lib/discovered-census.js +231 -0
- package/skills/wix-replatform/lib/discovered-set-status.js +255 -0
- package/skills/wix-replatform/lib/document-url-guard.js +203 -0
- package/skills/wix-replatform/lib/entity-qa-attestation.js +339 -0
- package/skills/wix-replatform/lib/entity-verification.js +18 -0
- package/skills/wix-replatform/lib/execution-capability.js +120 -0
- package/skills/wix-replatform/lib/execution-log.js +170 -0
- package/skills/wix-replatform/lib/execution-manifest.js +20 -2
- package/skills/wix-replatform/lib/execution-state.js +22 -0
- package/skills/wix-replatform/lib/expectations-ledger.js +96 -0
- package/skills/wix-replatform/lib/generated-plugin-handoff.js +140 -0
- package/skills/wix-replatform/lib/import-readiness-contract.js +23 -0
- package/skills/wix-replatform/lib/import-recovery.js +800 -6
- package/skills/wix-replatform/lib/imported-redirect-targets.js +608 -0
- package/skills/wix-replatform/lib/internal-link-reconciliation.js +166 -0
- package/skills/wix-replatform/lib/link-audit.js +173 -0
- package/skills/wix-replatform/lib/link-census.js +194 -0
- package/skills/wix-replatform/lib/link-plan.js +148 -0
- package/skills/wix-replatform/lib/link-verification.js +274 -0
- package/skills/wix-replatform/lib/link-write-journal.js +42 -0
- package/skills/wix-replatform/lib/local-state.js +869 -30
- package/skills/wix-replatform/lib/member-completion.js +658 -0
- package/skills/wix-replatform/lib/member-crosswalk.js +69 -0
- package/skills/wix-replatform/lib/member-outcome-registry.js +265 -0
- package/skills/wix-replatform/lib/migration-completion.js +311 -0
- package/skills/wix-replatform/lib/operator-identity.js +47 -0
- package/skills/wix-replatform/lib/orchestration-decisions.js +248 -0
- package/skills/wix-replatform/lib/orchestration-preflight.js +401 -19
- package/skills/wix-replatform/lib/orchestration-router.js +608 -32
- package/skills/wix-replatform/lib/orchestration-state.js +188 -12
- package/skills/wix-replatform/lib/order-reference-readiness.js +30 -0
- package/skills/wix-replatform/lib/payments-outcome-registry.js +200 -0
- package/skills/wix-replatform/lib/plugin-cms-fallback.js +618 -0
- package/skills/wix-replatform/lib/preservation-approval-stamp.js +54 -0
- package/skills/wix-replatform/lib/product-media-deferral.js +96 -0
- package/skills/wix-replatform/lib/progress-log.js +19 -3
- package/skills/wix-replatform/lib/read-back-approval.js +184 -0
- package/skills/wix-replatform/lib/read-back-comparison.js +136 -0
- package/skills/wix-replatform/lib/read-back-contract.js +243 -0
- package/skills/wix-replatform/lib/read-back-extract.js +118 -0
- package/skills/wix-replatform/lib/read-back-gate.js +734 -0
- package/skills/wix-replatform/lib/read-back-reads.js +94 -0
- package/skills/wix-replatform/lib/read-back-state.js +107 -0
- package/skills/wix-replatform/lib/read-back-summary.js +81 -0
- package/skills/wix-replatform/lib/rerun-conflicts.js +334 -0
- package/skills/wix-replatform/lib/run-controller.js +401 -0
- package/skills/wix-replatform/lib/seo-outcome-registry.js +45 -0
- package/skills/wix-replatform/lib/setup-verification.js +148 -0
- package/skills/wix-replatform/lib/source-access.js +231 -0
- package/skills/wix-replatform/lib/source-coverage.js +1130 -0
- package/skills/wix-replatform/lib/source-secrets.js +277 -0
- package/skills/wix-replatform/lib/structured-link-patch.js +59 -0
- package/skills/wix-replatform/lib/task-state.js +110 -0
- package/skills/wix-replatform/lib/url-preservation-report.js +319 -0
- package/skills/wix-replatform/lib/url-preservation-state.js +349 -1
- package/skills/wix-replatform/lib/url-redirect-plan.js +728 -0
- package/skills/wix-replatform/lib/url-verification.js +315 -0
- package/skills/wix-replatform/lib/user-action-effects.js +42 -0
- package/skills/wix-replatform/lib/user-actions.js +264 -0
- package/skills/wix-replatform/lib/website-handoff.js +1220 -0
- package/skills/wix-replatform/lib/wix-client-callers.js +54 -0
- package/skills/wix-replatform/lib/wix-dashboard-url.js +35 -0
- package/skills/wix-replatform/lib/write-verification-state.js +92 -0
- package/skills/wix-replatform/lib/write-verification.js +274 -0
- package/skills/wix-replatform/resources/rp-destination/SKILL.md +137 -0
- package/skills/wix-replatform/resources/rp-discovery/SKILL.md +189 -16
- package/skills/wix-replatform/resources/rp-discovery/scripts/promote-source-coverage.js +47 -0
- package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +869 -29
- package/skills/wix-replatform/resources/rp-execute-import/scripts/shipping-estimate-audit.js +70 -0
- package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +195 -29
- package/skills/wix-replatform/resources/rp-execute-setup/scripts/execute-setup.js +442 -0
- package/skills/wix-replatform/resources/rp-execution-policy/SKILL.md +112 -0
- package/skills/wix-replatform/resources/rp-execution-policy/lib/coupon-currency-plan-report.js +143 -0
- package/skills/wix-replatform/resources/rp-execution-policy/lib/payments-report.js +244 -0
- package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +2082 -38
- package/skills/wix-replatform/resources/rp-mapper/SKILL.md +528 -11
- package/skills/wix-replatform/resources/rp-mapper/lib/structure-bridge-planning.js +303 -0
- package/skills/wix-replatform/resources/rp-mapper/scripts/coverage-reconcile.js +88 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +6 -5
- package/skills/wix-replatform/resources/rp-preflight/SKILL.md +40 -0
- package/skills/wix-replatform/resources/rp-project-intake/SKILL.md +55 -0
- package/skills/wix-replatform/resources/rp-quick-runtime/SKILL.md +60 -0
- package/skills/wix-replatform/resources/rp-quick-runtime/lib/import-progress.js +89 -0
- package/skills/wix-replatform/resources/rp-quick-runtime/lib/limit-recovery.js +36 -0
- package/skills/wix-replatform/resources/rp-quick-shopify/SKILL.md +123 -0
- package/skills/wix-replatform/resources/rp-quick-shopify/quick-mode.json +124 -0
- package/skills/wix-replatform/resources/rp-quick-shopify/scripts/quick-mode.js +522 -0
- package/skills/wix-replatform/resources/rp-quick-woocommerce/SKILL.md +56 -0
- package/skills/wix-replatform/resources/rp-quick-woocommerce/quick-mode.json +91 -0
- package/skills/wix-replatform/resources/rp-quick-woocommerce/scripts/quick-mode.js +255 -0
- package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +80 -10
- package/skills/wix-replatform/resources/rp-setup-discovery/scripts/quick-setup-plan.js +44 -0
- package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +3 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
- package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +21 -1
- package/skills/wix-replatform/resources/rp-source-inputs/SKILL.md +66 -0
- package/skills/wix-replatform/resources/rp-source-sfcc/SKILL.md +153 -0
- package/skills/wix-replatform/resources/rp-source-shopify/SKILL.md +394 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/discovery-reads.js +200 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/import-findings.js +34 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk-sqlite-worker.js +44 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk.js +1470 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-cli.js +446 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-gift-cards.js +474 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-protected-fields.js +879 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-session.js +426 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/articles.graphql +24 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/blogs.graphql +18 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/collections.graphql +40 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/customers.graphql +76 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/delivery-profiles.graphql +51 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/discounts.graphql +35 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/files.graphql +20 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/gift-cards.graphql +18 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/inventory.graphql +31 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/locations.graphql +21 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/menus.graphql +21 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/metaobjects.graphql +30 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-core.graphql +150 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-fulfillments.graphql +36 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-refunds.graphql +48 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/pages.graphql +20 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-address.graphql +8 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-email.graphql +6 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-name.graphql +8 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-phone.graphql +8 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-address.graphql +12 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-email.graphql +6 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-name.graphql +13 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-phone.graphql +13 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/products.graphql +73 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/url-redirects.graphql +13 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-discovery.js +693 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-extract.js +283 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-gift-card-remedy.js +191 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-session-check.js +115 -0
- package/skills/wix-replatform/resources/rp-source-shopify/source-schema.example.json +201 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/PLUGIN-READ-PLANS.md +146 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +736 -22
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/blocked-data-handlers.js +73 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.js +115 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.test-fixture.js +91 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/coupon-discovery.js +440 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/currency-gate.js +125 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.js +252 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.json +183 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-summary.mjs +333 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/invoice-discovery.js +426 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-disposition.js +400 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-entity-read-plan.js +633 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-knowledge.js +1127 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.js +194 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.json +100 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/sampled-ids-batch.js +157 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/secret-value-guard.js +234 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/store-currency.js +101 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/structure-bridge-reader.js +755 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.js +1074 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.test-fixture.js +149 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/woo-inventory.js +25 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +204 -9
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-image-url.js +186 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-plugin-detect.js +1422 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-redirect-sources.js +343 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +262 -26
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/yoast-product-seo-evidence.js +272 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/README.md +373 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/advanced-custom-fields.json +101 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/back-in-stock-notifier-for-woocommerce.json +81 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/capabilities-pending-decision.json +128 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/cms-fallback-eligible.json +18 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/contact-form-7.json +104 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/facebook-for-woocommerce.json +44 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/fingerprint-aliases.json +49 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/free-gifts-for-woocommerce.json +94 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/index.json +863 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mailpoet.json +52 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/membership-for-woocommerce.json +161 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mwb-bookings-for-woocommerce.json +180 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/no-migration-needed.json +286 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pricing-deals-for-woocommerce.json +79 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/product-extras-for-woocommerce.json +120 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pw-woocommerce-gift-cards.json +128 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/requires-development.json +88 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seo-by-rank-math.json +80 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seriously-simple-podcasting.json +46 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/strong-testimonials.json +55 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/subscriptions-for-woocommerce.json +99 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/tablepress.json +55 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/the-events-calendar.json +160 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/ti-woocommerce-wishlist.json +81 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-checkout-field-editor-pro.json +60 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-discount-rules.json +74 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-product-bundle.json +75 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-gift-cards.json +60 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-other-payment-gateway.json +44 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-pdf-invoices-packing-slips.json +57 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-product-addon.json +141 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-progressive-discounts.json +54 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wordpress-seo.json +158 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpc-composite-products.json +97 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpforms-lite.json +86 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/capture-store-settings.js +90 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge-validate.js +51 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge.js +103 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +1668 -33
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-plugin-inventory.js +273 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/secret-value-patterns.v1.json +11 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/sub-parts.json +13 -0
- package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +446 -32
- package/skills/wix-replatform/resources/rp-target-wix/app-page-routing-capabilities.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +38 -2
- package/skills/wix-replatform/resources/rp-target-wix/domains/SERVICE-PLUGINS.md +322 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/docs-survey.json +70 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -9
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +42 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +54 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +66 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +38 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/docs-survey.json +332 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/domain.json +75 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/booking.json +181 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service-add-on.json +130 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service.json +180 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/docs-survey.json +161 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +15 -4
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +39 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +47 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +7 -1
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/docs-survey.json +204 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +17 -4
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +159 -15
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +80 -12
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +48 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/docs-survey.json +306 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +30 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/delivery-profile.json +171 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/discount-rule.json +182 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-applied-discount.json +129 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-invoice-document.json +192 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item-options.json +123 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +60 -12
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-merchant-note.json +112 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-payment.json +191 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +140 -13
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +383 -18
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/pickup-location.json +122 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/shipping-option.json +98 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/wishlist-item.json +86 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/docs-survey.json +128 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/domain.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/category.json +73 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/event.json +107 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/registration-form.json +89 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/rsvp.json +118 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/ticket-definition.json +93 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/docs-survey.json +86 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/domain.json +56 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form-submission.json +121 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form.json +134 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/docs-survey.json +41 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/domain.json +50 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card-product.json +87 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card.json +130 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +914 -24
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/docs-survey.json +41 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -4
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +45 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +41 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/docs-survey.json +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -3
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +41 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/custom-field.json +82 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member-about.json +77 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +165 -13
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/docs-survey.json +41 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/domain.json +46 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan-order.json +137 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan.json +133 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/docs-survey.json +7 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/domain.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/amazon-shop-connect.json +71 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/ebay-shop-connect.json +67 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/google-youtube-connect.json +72 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/meta-catalog-connect.json +74 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/pinterest-catalog-connect.json +69 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/tiktok-catalog-connect.json +61 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +28 -1
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/docs-survey.json +109 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/domain.json +73 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/item-seo-tags.json +148 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/seo-pattern.json +91 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/site-seo-tags.json +79 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/site/docs-survey.json +32 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/site/domain.json +49 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/site/entities/business-contact.json +103 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/docs-survey.json +203 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +27 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/back-in-stock-request.json +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/brand.json +111 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +52 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +214 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +93 -13
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-customization.json +111 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +52 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +145 -14
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/promotion.json +84 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/review.json +178 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/subscription-product.json +87 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/docs-survey.json +106 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/domain.json +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/manual-tax-mapping.json +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-group.json +94 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-region.json +113 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-settings.json +65 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-author-attribution.js +165 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-client.js +60 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-duplicates.js +201 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-ledger.js +306 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-report.js +229 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-stage.js +55 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build.js +715 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-media.js +567 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/bulk-results.js +73 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contact-extended-fields.js +194 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contact-import.js +133 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +13 -4
- package/skills/wix-replatform/resources/rp-target-wix/lib/coupon-redemption-drift.js +491 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/customer-member.js +104 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/data-extension-schema.js +673 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +453 -2
- package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-balance-reconciliation.js +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-build.js +566 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-redemption-build.js +249 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-applied-discount-build.js +63 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-buyer.js +187 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-channel-build.js +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-history.js +1027 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-invoice-contract.js +90 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-payment-mapping.js +420 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/pricing-plan-definition.js +177 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/product-import.js +151 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/product-seo.js +723 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/seo-redirects.js +353 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-build.js +1437 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-option-stage.js +354 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/store-config-build.js +134 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-category-attach.js +221 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-inventory.js +248 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +86 -3
- package/skills/wix-replatform/resources/rp-target-wix/lib/tax-build.js +231 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/url-mapper-transport.js +28 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/value-utils.js +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/variant-correlation.js +34 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +166 -15
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +19 -2
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +4079 -257
- package/skills/wix-replatform/resources/rp-target-wix/lib/write-verification.js +3 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/docs-survey-sync.js +150 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +40 -2
- package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +6 -1
- package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +148 -8
- package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +83 -15
- package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1119 -215
- package/skills/wix-replatform/resources/rp-telemetry/lib/transcript-digest.js +318 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +2 -2
- package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +106 -4
- package/skills/wix-replatform/resources/rp-website-continuation/SKILL.md +94 -0
- package/skills/wix-replatform/scripts/census-reconciliation.js +25 -0
- package/skills/wix-replatform/scripts/cms-fallback.js +89 -0
- package/skills/wix-replatform/scripts/discovered-census.js +26 -0
- package/skills/wix-replatform/scripts/discovered-set-status.js +33 -0
- package/skills/wix-replatform/scripts/entity-qa-attestation.js +130 -0
- package/skills/wix-replatform/scripts/execution-health-check.js +415 -0
- package/skills/wix-replatform/scripts/execution-manifest-validate.js +1 -1
- package/skills/wix-replatform/scripts/execution-state-prepare.js +1 -1
- package/skills/wix-replatform/scripts/expectations-ledger.js +44 -0
- package/skills/wix-replatform/scripts/import-contract-verify.js +183 -0
- package/skills/wix-replatform/scripts/internal-link-audit.js +90 -0
- package/skills/wix-replatform/scripts/item-seo-tags-verify.js +205 -0
- package/skills/wix-replatform/scripts/migration-completion.js +76 -0
- package/skills/wix-replatform/scripts/orchestration-preflight.js +21 -2
- package/skills/wix-replatform/scripts/orchestration-route.js +32 -1
- package/skills/wix-replatform/scripts/orchestration-state.js +146 -10
- package/skills/wix-replatform/scripts/read-back-gate.js +175 -0
- package/skills/wix-replatform/scripts/replatform-console.js +146 -0
- package/skills/wix-replatform/scripts/replatform.js +436 -0
- package/skills/wix-replatform/scripts/source-secrets.js +77 -0
- package/skills/wix-replatform/scripts/url-redirects.js +286 -0
- package/skills/wix-replatform/scripts/user-action.js +58 -0
- package/skills/wix-replatform/scripts/website-handoff-generate.js +64 -0
- package/skills/wix-replatform/scripts/wix-dashboard-url.js +54 -0
- package/skills/wix-replatform/scripts/wix-destination.js +143 -0
- package/skills/wix-replatform/scripts/wix-headless-scaffold.js +762 -0
- package/skills/wix-vibe-headless/SKILL.md +7 -3
- package/skills/wix-vibe-headless/install/deploy.cjs +61 -34
- package/skills/wix-vibe-headless/platforms/base44.md +1 -0
- package/skills/wix-vibe-headless/references/donations/INSTRUCTIONS.md +88 -0
- package/skills/wix-vibe-headless/references/donations/app/rest/wix-donations.js +112 -0
- package/skills/wix-vibe-headless/references/donations/seed/SEED.md +11 -0
- package/skills/wix-vibe-headless/references/donations/tests/donations.test.mjs +258 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +5 -2
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +4 -1
- package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +67 -3
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-client.js +4 -3
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +0 -208
- package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +0 -330
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const fsp = require('node:fs/promises');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const crypto = require('node:crypto');
|
|
7
|
+
const capability = require('./execution-capability');
|
|
8
|
+
const local = require('./local-state');
|
|
9
|
+
const setup = require('./setup-verification');
|
|
10
|
+
const census = require('./census-reconciliation');
|
|
11
|
+
const recovery = require('./dependency-recovery');
|
|
12
|
+
const { readEntityMappings } = require('./website-handoff');
|
|
13
|
+
const evaluations = new WeakMap();
|
|
14
|
+
const evaluationGenerations = new WeakMap();
|
|
15
|
+
const grants = new WeakMap();
|
|
16
|
+
const indexes = new Map();
|
|
17
|
+
const subscriptions = new Map();
|
|
18
|
+
const PASS_FILE = 'state/readiness/task-passes.ndjson';
|
|
19
|
+
const MODES = new Set(['task-complete', 'per-record']);
|
|
20
|
+
const SELECTIVE = new Set(['full', 'entity', 'source-type', 'missing-only', 'failed-only', 'deferred-only', 'unresolved-only']);
|
|
21
|
+
const refPattern = /^[a-z0-9-]+\/[a-z0-9-]+$/;
|
|
22
|
+
const hash = bytes => crypto.createHash('sha256').update(bytes).digest('hex');
|
|
23
|
+
const equal = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
24
|
+
function evidenceReason(error) { return /^(?:dependency_|readiness_|mapping_plan_|entity_ref_|task_depends_on_|site_id_|plan_digest_)[a-zA-Z0-9_:\-/;,]+$/.test(error.message || '') ? error.message : error.code === 'ENOENT' || error.code === 'JOURNAL_MISSING' ? 'dependency-evidence-missing' : 'dependency-evidence-invalid'; }
|
|
25
|
+
function read(projectDir, file, fallback) {
|
|
26
|
+
try { return JSON.parse(fs.readFileSync(inside(projectDir, file), 'utf8')); }
|
|
27
|
+
catch (error) { if (error.code === 'ENOENT' && arguments.length === 3) return fallback; throw error; }
|
|
28
|
+
}
|
|
29
|
+
function inside(projectDir, file) {
|
|
30
|
+
const root = path.resolve(projectDir), absolute = path.resolve(root, file);
|
|
31
|
+
if (!absolute.startsWith(root + path.sep)) throw new Error('DEPENDENCY_PATH_OUTSIDE_PROJECT');
|
|
32
|
+
return absolute;
|
|
33
|
+
}
|
|
34
|
+
const digestCache = new Map(), snapshotCache = new Map();
|
|
35
|
+
function fileDigest(projectDir, file) { const absolute = inside(projectDir, file), stamp = statKey(absolute), prior = digestCache.get(absolute); if (prior?.stamp === stamp) return prior.digest; const digest = hash(fs.readFileSync(absolute)); digestCache.set(absolute, { stamp, digest }); return digest; }
|
|
36
|
+
function domain(ref) {
|
|
37
|
+
if (!refPattern.test(ref)) throw new Error(`entity_ref_unknown:${ref}`);
|
|
38
|
+
try { return JSON.parse(fs.readFileSync(path.join(__dirname, '../resources/rp-target-wix/domains', ref.split('/')[0], 'entities', ref.split('/')[1] + '.json'))); }
|
|
39
|
+
catch { throw new Error(`entity_ref_unknown:${ref}`); }
|
|
40
|
+
}
|
|
41
|
+
function transitiveRefs(refs, result = new Set()) {
|
|
42
|
+
for (const ref of refs) for (const dep of domain(ref).dependsOn || []) {
|
|
43
|
+
if (!result.has(dep)) { result.add(dep); transitiveRefs([dep], result); }
|
|
44
|
+
}
|
|
45
|
+
return [...result].sort();
|
|
46
|
+
}
|
|
47
|
+
function edgeMode(task, ref) {
|
|
48
|
+
const modes = task.entityRefs.map(entity => domain(entity).dependencyModes?.[ref] || 'task-complete');
|
|
49
|
+
return modes.every(mode => mode === 'per-record') ? 'per-record' : 'task-complete';
|
|
50
|
+
}
|
|
51
|
+
function bindDependencyProducers({ manifest, setupPlan, dispositions = {}, scopeRefs = [] }) {
|
|
52
|
+
const result = {}, errors = [], available = new Set(scopeRefs);
|
|
53
|
+
for (const task of manifest.tasks || []) for (const ref of task.entityRefs || []) { available.add(ref); try { domain(ref); } catch (e) { errors.push(e.message); } }
|
|
54
|
+
const imports = (manifest.tasks || []).filter(task => task.kind === 'import');
|
|
55
|
+
for (const task of imports) {
|
|
56
|
+
const refs = transitiveRefs(task.entityRefs || []);
|
|
57
|
+
if (!equal([...(task.dependencyRefs || [])].sort(), refs)) errors.push(`dependency_refs_mismatch:${task.id}`);
|
|
58
|
+
const edges = [];
|
|
59
|
+
for (const ref of refs) {
|
|
60
|
+
const producers = [];
|
|
61
|
+
for (const producer of imports) if ((producer.entityRefs || []).includes(ref)) producers.push({ kind: 'import-task', taskId: producer.id });
|
|
62
|
+
const stepIds = (setupPlan.steps || []).filter(step => (step.entityRefs || []).includes(ref)).map(step => step.id).sort();
|
|
63
|
+
if (stepIds.length) producers.push({ kind: 'setup-step', stepIds });
|
|
64
|
+
if (dispositions[ref]) producers.push({ kind: 'disposition', censusIds: dispositions[ref].censusIds, reconciliationSha256: dispositions[ref].reconciliationSha256 });
|
|
65
|
+
if (producers.length !== 1) { errors.push(`dependency_${producers.length ? 'multiply_bound' : 'unbound'}:${ref}`); continue; }
|
|
66
|
+
const mode = edgeMode(task, ref), producer = producers[0];
|
|
67
|
+
if (!MODES.has(mode) || mode === 'per-record' && producer.kind === 'setup-step') errors.push(`dependency_mode_invalid:${task.id}:${ref}`);
|
|
68
|
+
edges.push({ ref, mode, producer }); result[ref] = producer;
|
|
69
|
+
const emitted = (task.dependencyEdges || []).find(edge => edge.ref === ref);
|
|
70
|
+
if (!emitted) errors.push(`dependency_edge_missing:${task.id}:${ref}`);
|
|
71
|
+
else if (emitted.mode !== mode) errors.push(`dependency_edge_mode_mismatch:${task.id}:${ref}`);
|
|
72
|
+
else if (!equal(emitted.producer, producer)) errors.push(`dependency_edge_producer_mismatch:${task.id}:${ref}`);
|
|
73
|
+
}
|
|
74
|
+
if ((task.dependencyEdges || []).length !== refs.length) errors.push(`dependency_edge_coverage:${task.id}`);
|
|
75
|
+
const taskIds = [...new Set(edges.filter(edge => edge.producer.kind === 'import-task').map(edge => edge.producer.taskId))].sort();
|
|
76
|
+
if (!equal([...(task.dependsOn || [])].sort(), taskIds)) errors.push(`task_depends_on_mismatch:${task.id}`);
|
|
77
|
+
}
|
|
78
|
+
return { ok: errors.length === 0, errors, producers: result };
|
|
79
|
+
}
|
|
80
|
+
function validateAssociations({ plan, reconciliation }) {
|
|
81
|
+
const errors = [], bindings = new Map(), rows = new Map((reconciliation?.rows || []).map(row => [row.censusId, row]));
|
|
82
|
+
for (const binding of plan?.dependencyBindings || []) {
|
|
83
|
+
if (!refPattern.test(binding.ref) || bindings.has(binding.ref) || !Array.isArray(binding.censusIds) || !binding.censusIds.length || new Set(binding.censusIds).size !== binding.censusIds.length) {
|
|
84
|
+
errors.push(`dependency_binding_invalid:${binding.ref}`); continue;
|
|
85
|
+
}
|
|
86
|
+
try { domain(binding.ref); } catch (e) { errors.push(e.message); }
|
|
87
|
+
for (const id of binding.censusIds) if (!rows.has(id) || !rows.get(id).decisionRow) errors.push(`dependency_binding_census_unknown:${id}`);
|
|
88
|
+
bindings.set(binding.ref, binding.censusIds);
|
|
89
|
+
}
|
|
90
|
+
for (const row of readEntityMappings(plan)) {
|
|
91
|
+
const ids = row.censusIds || (row.sourceEntity ? [`entity:${row.sourceEntity}`] : []);
|
|
92
|
+
if (!row.targetRef || !refPattern.test(row.targetRef)) { errors.push('dependency_target_ref_missing'); continue; }
|
|
93
|
+
if (!bindings.has(row.targetRef) || ids.some(id => !bindings.get(row.targetRef).includes(id))) errors.push(`dependency_binding_incomplete:${row.targetRef}`);
|
|
94
|
+
}
|
|
95
|
+
const rules = [];
|
|
96
|
+
for (const row of rows.values()) for (const rule of row.dependencyFieldRules || []) {
|
|
97
|
+
const key = `${row.censusId}:${rule.dependentRef}:${rule.dependencyRef}:${rule.path}`;
|
|
98
|
+
const valid = ['omit', 'defer'].includes(rule.action) && typeof rule.path === 'string' && /^\w+(?:\[\])?(?:\.\w+(?:\[\])?)*$/.test(rule.path);
|
|
99
|
+
let known = false;
|
|
100
|
+
try { const d = domain(rule.dependentRef); known = (d.dependsOn || []).includes(rule.dependencyRef) && (d.dependencyReferenceFields?.[rule.dependencyRef] || []).includes(rule.path); } catch {}
|
|
101
|
+
if (!valid || !known || !bindings.get(rule.dependencyRef)?.includes(row.censusId) || rules.some(prior => prior.key.startsWith(`${row.censusId}:${rule.dependentRef}:${rule.dependencyRef}:`) && pathsOverlap(prior.path, rule.path))) errors.push(`dependency_field_rule_invalid:${key}`);
|
|
102
|
+
rules.push({ ...rule, censusId: row.censusId, key });
|
|
103
|
+
}
|
|
104
|
+
return { ok: errors.length === 0, errors, bindings, rules };
|
|
105
|
+
}
|
|
106
|
+
function pathsOverlap(a, b) { return a === b || a.startsWith(b + '.') || b.startsWith(a + '.'); }
|
|
107
|
+
function pathMatches(template, concrete) {
|
|
108
|
+
const escaped = template.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/\\\[\\\]/g, '\\[\\d+\\]');
|
|
109
|
+
return new RegExp('^' + escaped + '$').test(concrete);
|
|
110
|
+
}
|
|
111
|
+
async function loadDependencyDispositions(projectDir) {
|
|
112
|
+
const plan = read(projectDir, 'mapping/mapping-plan.json');
|
|
113
|
+
const reconciliation = await census.readReconciliation(projectDir);
|
|
114
|
+
if (!reconciliation || reconciliation.reviewOnly || reconciliation.errors?.length || !(await census.censusReconciliationFreshness(projectDir, reconciliation)).ok) throw new Error('dependency_reconciliation_invalid');
|
|
115
|
+
const validated = validateAssociations({ plan, reconciliation });
|
|
116
|
+
if (!validated.ok) throw new Error(validated.errors.join(';'));
|
|
117
|
+
const approved = await census.ownerApprovedCensusIds(projectDir), rows = new Map(reconciliation.rows.map(row => [row.censusId, row]));
|
|
118
|
+
const reconciliationSha256 = fileDigest(projectDir, 'mapping/review/census-reconciliation.json');
|
|
119
|
+
const dispositions = {};
|
|
120
|
+
for (const [ref, ids] of validated.bindings) if (ids.every(id => rows.get(id).state === 'excluded')) dispositions[ref] = {
|
|
121
|
+
censusIds: ids, reconciliationSha256, approved: ids.every(id => approved.has(id)),
|
|
122
|
+
rules: validated.rules.filter(rule => ids.includes(rule.censusId) && approved.has(rule.censusId)),
|
|
123
|
+
};
|
|
124
|
+
return { dispositions, ...validated, rows, approved, reconciliationSha256 };
|
|
125
|
+
}
|
|
126
|
+
function validateImportInputs(projectDir) {
|
|
127
|
+
const manifest = read(projectDir, 'execution/execution-manifest.json'), setupPlan = read(projectDir, 'setup/setup-plan.json');
|
|
128
|
+
const plan = read(projectDir, 'mapping/mapping-plan.json');
|
|
129
|
+
if (read(projectDir, 'orchestration/state.json', {})?.finalizedAt || read(projectDir, 'orchestration/website-handoff.json', {})?.finalizedAt) throw new Error('EXECUTION_REVIEW_ONLY');
|
|
130
|
+
if (manifest.mappingPlanDigest !== fileDigest(projectDir, 'mapping/mapping-plan.json')) throw new Error('mapping_plan_digest_mismatch');
|
|
131
|
+
const validation = require('./execution-manifest').validateManifest(manifest);
|
|
132
|
+
if (!validation.ok) throw new Error(validation.errors.join(';'));
|
|
133
|
+
return { manifest, setupPlan, plan };
|
|
134
|
+
}
|
|
135
|
+
function fingerprint(ctx) {
|
|
136
|
+
const files = ['execution/execution-manifest.json', 'mapping/mapping-plan.json', 'setup/setup-plan.json', 'setup/setup-verification.json', 'discovery/census.json', 'mapping/review/mapping-gaps.json', 'mapping/review/census-reconciliation.json', 'mapping/review/mapping-summary.md', 'orchestration/approvals.json'];
|
|
137
|
+
for (const task of ctx.manifest.tasks.filter(task => task.kind === 'import')) for (const source of task.sourceBindings || []) files.push(source.manifestPath, source.extractPath, ...(source.readPlanPath ? [source.readPlanPath] : []));
|
|
138
|
+
return hash(files.map(file => { try { return file + ':' + fileDigest(ctx.projectDir, file); } catch { return file + ':missing'; } }).join('\n'));
|
|
139
|
+
}
|
|
140
|
+
function statKey(file) { try { const stat = fs.statSync(file); return `${stat.ino}:${stat.size}:${stat.mtimeMs}:${stat.ctimeMs}`; } catch (e) { if (e.code === 'ENOENT') return 'missing'; throw e; } }
|
|
141
|
+
function ndjson(file) {
|
|
142
|
+
try { return fs.readFileSync(file, 'utf8').split(/\r?\n/).filter(Boolean).map(line => JSON.parse(line)); }
|
|
143
|
+
catch (e) { if (e.code === 'ENOENT') return []; throw e; }
|
|
144
|
+
}
|
|
145
|
+
async function evidenceIndex(ctx) {
|
|
146
|
+
const key = `${ctx.projectDir}:${ctx.siteId}:${ctx.dryRun}`, prior = indexes.get(key);
|
|
147
|
+
if (!subscriptions.has(ctx.projectDir)) subscriptions.set(ctx.projectDir, local.onCrosswalkChange(ctx.projectDir, event => {
|
|
148
|
+
for (const [cachedKey, cached] of indexes) if (cached.projectDir === ctx.projectDir && cached.dryRun === event.dryRun) {
|
|
149
|
+
if (cached.crosswalkStamp !== event.before) { indexes.delete(cachedKey); continue; }
|
|
150
|
+
for (const sourceKey of event.remove) { cached.crosswalk.delete(sourceKey); cached.changes.push(sourceKey); }
|
|
151
|
+
for (const row of event.updates) { cached.crosswalk.set(row.sourceStableKey, structuredClone(row)); cached.changes.push(row.sourceStableKey); }
|
|
152
|
+
cached.crosswalkStamp = event.after;
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
const crosswalkFile = ctx.dryRun ? local.dryRunCrosswalkPath(ctx.projectDir) : local.crosswalkPath(ctx.projectDir);
|
|
156
|
+
const crosswalkStamp = statKey(crosswalkFile), passStamp = statKey(inside(ctx.projectDir, PASS_FILE));
|
|
157
|
+
const index = prior || { attempts: new Map(), offset: 0, changes: [], summaries: new Map(), projectDir: ctx.projectDir, dryRun: ctx.dryRun, recovery: recovery.createRecoveryIndex(ctx.siteId), work: { journalRowsApplied: 0, dependencyKeysChecked: 0, waitingKeysProjected: 0 } };
|
|
158
|
+
let increment;
|
|
159
|
+
try { increment = await local.readAttemptJournalSince(ctx.projectDir, index.offset); } catch (error) { if (error.code !== 'JOURNAL_MISSING' || index.offset) throw error; increment = { rows: [], nextOffset: 0, size: 0 }; }
|
|
160
|
+
if (increment.truncated) { indexes.delete(key); return evidenceIndex(ctx); }
|
|
161
|
+
for (const row of increment.rows) { index.work.journalRowsApplied++; local.validateAttemptRow(row); index.attempts.set(row.sourceStableKey, row); recovery.applyRecoveryAttempt(index.recovery, row); index.changes.push(row.sourceStableKey); }
|
|
162
|
+
index.offset = increment.nextOffset;
|
|
163
|
+
if (increment.nextOffset !== increment.size) throw new Error('readiness_journal_incomplete_tail');
|
|
164
|
+
if (!prior || index.crosswalkStamp !== crosswalkStamp) {
|
|
165
|
+
const rows = ndjson(crosswalkFile);
|
|
166
|
+
for (const row of rows) (ctx.dryRun ? local.validateDryRunCrosswalkRow : local.validateCrosswalkRow)(row);
|
|
167
|
+
index.summaries.clear();
|
|
168
|
+
index.crosswalk = new Map(rows.map(row => [row.sourceStableKey, row])); index.crosswalkStamp = crosswalkStamp;
|
|
169
|
+
}
|
|
170
|
+
if (!prior || index.passStamp !== passStamp) { index.passes = ndjson(inside(ctx.projectDir, PASS_FILE)); index.passStamp = passStamp; for (const row of index.passes) validatePass(row); }
|
|
171
|
+
indexes.set(key, index); return index;
|
|
172
|
+
}
|
|
173
|
+
function validatePass(row) {
|
|
174
|
+
if (!row || row.schemaVersion !== 1 || !row.taskId || !row.runId || !row.siteId || !row.planVersion || !row.manifestDigest || !row.setupPlanDigest || !row.mappingPlanDigest || !row.sourceSnapshotDigests || !Array.isArray(row.entityRefs) || !SELECTIVE.has(row.selection?.mode) || typeof row.dryRun !== 'boolean' || !Number.isFinite(Date.parse(row.finishedAt))) throw new Error('readiness_pass_malformed');
|
|
175
|
+
return row;
|
|
176
|
+
}
|
|
177
|
+
function snapshots(ctx, task) {
|
|
178
|
+
const cacheKey = ctx.projectDir + ':' + task.id, stamp = JSON.stringify((task.sourceBindings || []).map(source => [source, statKey(inside(ctx.projectDir, source.manifestPath)), statKey(inside(ctx.projectDir, source.extractPath)), source.readPlanPath && statKey(inside(ctx.projectDir, source.readPlanPath))]));
|
|
179
|
+
if (snapshotCache.get(cacheKey)?.stamp === stamp) return snapshotCache.get(cacheKey).value;
|
|
180
|
+
if (!Array.isArray(task.sourceBindings) || !task.sourceBindings.length) throw new Error('dependency_source_binding_missing');
|
|
181
|
+
const digests = {}, keys = new Set(), censusByKey = new Map(), sourceByKey = new Map(); let rowsWritten = 0, snapshotTotal = 0;
|
|
182
|
+
for (const source of task.sourceBindings) {
|
|
183
|
+
if (!(task.entityRefs || []).includes(source.ref) || !source.sourceEntity || !source.keyField || !source.keyPrefix) throw new Error('dependency_source_binding_invalid');
|
|
184
|
+
const identity = JSON.stringify([source.ref, source.sourceEntity, source.censusId || `entity:${source.sourceEntity}`, source.keyField, source.keyPrefix, source.manifestPath, source.extractPath, source.readPlanPath || null]);
|
|
185
|
+
if (Object.hasOwn(digests, identity)) throw new Error('dependency_source_binding_duplicate');
|
|
186
|
+
const artifacts = { manifest: fileDigest(ctx.projectDir, source.manifestPath), extract: fileDigest(ctx.projectDir, source.extractPath), ...(source.readPlanPath ? { readPlan: fileDigest(ctx.projectDir, source.readPlanPath) } : {}) };
|
|
187
|
+
const extract = read(ctx.projectDir, source.manifestPath);
|
|
188
|
+
const records = ndjson(inside(ctx.projectDir, source.extractPath));
|
|
189
|
+
let total = extract.snapshotTotal;
|
|
190
|
+
if (extract.kind === 'eav-read-plan') {
|
|
191
|
+
if (!source.readPlanPath) throw new Error('dependency_extract_read_plan_missing');
|
|
192
|
+
const client = require('../resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client');
|
|
193
|
+
if (client.eavExtractionIsReusable(read(ctx.projectDir, source.readPlanPath), extract, { planFile: source.readPlanPath, ndjsonDigest: fileDigest(ctx.projectDir, source.extractPath), ndjsonRowCount: records.length }).length) throw new Error('dependency_extract_incomplete');
|
|
194
|
+
total = extract.rowsWritten; artifacts.readPlan = fileDigest(ctx.projectDir, source.readPlanPath);
|
|
195
|
+
}
|
|
196
|
+
if (!Number.isInteger(extract.rowsWritten) || !Number.isInteger(total) || extract.rowsWritten !== total || extract.rowsWritten < 0) throw new Error('dependency_extract_incomplete');
|
|
197
|
+
digests[identity] = artifacts;
|
|
198
|
+
if (records.length !== extract.rowsWritten) throw new Error('dependency_extract_count_mismatch');
|
|
199
|
+
for (const record of records) {
|
|
200
|
+
const id = valueAt(record, source.keyField);
|
|
201
|
+
if (id == null || typeof id === 'object') throw new Error('dependency_source_key_missing');
|
|
202
|
+
const key = source.keyPrefix + String(id);
|
|
203
|
+
if (keys.has(key)) throw new Error('dependency_source_key_duplicate');
|
|
204
|
+
keys.add(key); censusByKey.set(key, source.censusId || `entity:${source.sourceEntity}`); sourceByKey.set(key, { ...source, sourceId: String(id) });
|
|
205
|
+
}
|
|
206
|
+
rowsWritten += extract.rowsWritten; snapshotTotal += total;
|
|
207
|
+
}
|
|
208
|
+
const orderedDigests = Object.fromEntries(Object.entries(digests).sort(([a], [b]) => a.localeCompare(b)));
|
|
209
|
+
const value = { digests: orderedDigests, keys, censusByKey, sourceByKey, rowsWritten, snapshotTotal }; snapshotCache.set(cacheKey, { stamp, value }); return value;
|
|
210
|
+
}
|
|
211
|
+
function currentPass(ctx, task, snapshot, pass) {
|
|
212
|
+
return pass.taskId === task.id && pass.siteId === ctx.siteId && pass.dryRun === ctx.dryRun &&
|
|
213
|
+
pass.planVersion === ctx.manifest.planVersion && pass.manifestDigest === fileDigest(ctx.projectDir, 'execution/execution-manifest.json') &&
|
|
214
|
+
pass.setupPlanDigest === fileDigest(ctx.projectDir, 'setup/setup-plan.json') && pass.mappingPlanDigest === fileDigest(ctx.projectDir, 'mapping/mapping-plan.json') &&
|
|
215
|
+
equal(pass.sourceSnapshotDigests, snapshot.digests) && pass.selection.mode === 'full';
|
|
216
|
+
}
|
|
217
|
+
function keyReady(ctx, index, key, owner) {
|
|
218
|
+
index.work.dependencyKeysChecked++;
|
|
219
|
+
const attempt = index.attempts.get(key), row = index.crosswalk.get(key);
|
|
220
|
+
if ((attempt && attempt.siteId !== ctx.siteId) || (row && row.siteId !== ctx.siteId)) return { ready: false, foreign: true };
|
|
221
|
+
if (!attempt || !row || row.status !== 'imported' || !['imported', 'skipped_already_imported'].includes(attempt.status)) return { ready: false };
|
|
222
|
+
if (owner) {
|
|
223
|
+
const source = owner.snapshot.sourceByKey.get(key);
|
|
224
|
+
const types = source ? [source.ref, source.ref.split('/')[1], source.ref.replace('/', '-'), source.ref.replace('/', '.')] : [];
|
|
225
|
+
if (!source || owner.ref && source.ref !== owner.ref || attempt.writeSpecId !== owner.task.id || row.targetSystem !== 'wix' || row.sourceEntityType !== source.sourceEntity || String(row.sourceId) !== source.sourceId || !types.includes(row.targetEntityType) || !types.includes(attempt.targetEntityType)) return { ready: false, identity: false };
|
|
226
|
+
}
|
|
227
|
+
return { ready: true, row };
|
|
228
|
+
}
|
|
229
|
+
function readinessSummary(ctx, index, task, snapshot) {
|
|
230
|
+
let summary = index.summaries.get(task.id);
|
|
231
|
+
if (!summary || summary.snapshot !== snapshot) {
|
|
232
|
+
summary = { snapshot, ready: 0, foreign: 0, statuses: new Map(), offset: index.changes.length };
|
|
233
|
+
for (const key of snapshot.keys) { const status = keyReady(ctx, index, key, { task, snapshot }); summary.statuses.set(key, status); summary.ready += Number(status.ready); summary.foreign += Number(Boolean(status.foreign)); }
|
|
234
|
+
index.summaries.set(task.id, summary); return summary;
|
|
235
|
+
}
|
|
236
|
+
for (const key of new Set(index.changes.slice(summary.offset))) if (snapshot.keys.has(key)) {
|
|
237
|
+
const before = summary.statuses.get(key), after = keyReady(ctx, index, key, { task, snapshot });
|
|
238
|
+
summary.ready += Number(after.ready) - Number(before.ready); summary.foreign += Number(Boolean(after.foreign)) - Number(Boolean(before.foreign)); summary.statuses.set(key, after);
|
|
239
|
+
}
|
|
240
|
+
summary.offset = index.changes.length; return summary;
|
|
241
|
+
}
|
|
242
|
+
async function evaluateDependency({ ctx, ref, producer, index, dispositions }) {
|
|
243
|
+
const unknown = (reason, recovery) => ({ ref, producer, state: 'unknown', reasons: [reason], recovery });
|
|
244
|
+
try {
|
|
245
|
+
if (producer.kind === 'disposition') {
|
|
246
|
+
const disposition = dispositions[ref];
|
|
247
|
+
if (!disposition) return unknown('disposition_not_current', `obtain-disposition-approval:${ref}`);
|
|
248
|
+
return { ref, producer, state: disposition.approved ? 'excluded-approved' : 'excluded-unapproved', reasons: [], recovery: `obtain-disposition-approval:${ref}` };
|
|
249
|
+
}
|
|
250
|
+
if (producer.kind === 'setup-step') {
|
|
251
|
+
const receipt = read(ctx.projectDir, 'setup/setup-verification.json');
|
|
252
|
+
const validation = setup.validateSetupVerification({ verification: receipt, plan: ctx.setupPlan, planDigest: fileDigest(ctx.projectDir, 'setup/setup-plan.json'), siteId: ctx.siteId });
|
|
253
|
+
if (!validation.ok || receipt.dryRun !== ctx.dryRun) return unknown(validation.reasons.join(';') || 'dry_run_mismatch', `run-setup:${producer.stepIds[0]}`);
|
|
254
|
+
return { ref, producer, state: 'setup-passed', reasons: [], receipt };
|
|
255
|
+
}
|
|
256
|
+
const task = ctx.manifest.tasks.find(row => row.id === producer.taskId), snapshot = snapshots(ctx, task);
|
|
257
|
+
if (!index.passes.some(pass => currentPass(ctx, task, snapshot, pass))) return unknown('current_full_pass_missing', `run-import:${task.id}`);
|
|
258
|
+
const summary = readinessSummary(ctx, index, task, snapshot);
|
|
259
|
+
if (summary.foreign) return unknown('site_evidence_unbound_or_foreign', `reconcile-site:${task.id}`);
|
|
260
|
+
return { ref, producer, state: snapshot.rowsWritten === 0 && snapshot.snapshotTotal === 0 ? 'empty' : summary.ready === snapshot.keys.size ? 'complete' : 'partial',
|
|
261
|
+
reasons: [], recovery: `run-import:${task.id} --failed-only`, snapshot };
|
|
262
|
+
} catch (error) { return unknown(evidenceReason(error), `run-import:${producer.taskId || ''}`); }
|
|
263
|
+
}
|
|
264
|
+
function projectWaiting(ctx, index) {
|
|
265
|
+
if (!index) return read(ctx.projectDir, 'execution/dependency-readiness.json', { tasks: {} }).tasks?.[ctx.taskId]?.waiting || [];
|
|
266
|
+
index.work.waitingKeysProjected += index.recovery.byTask.get(ctx.taskId)?.size || 0;
|
|
267
|
+
return recovery.waitingForTask(index.recovery, ctx.taskId);
|
|
268
|
+
}
|
|
269
|
+
async function evaluateTask({ taskBinding }) {
|
|
270
|
+
const ctx = capability.requireKind(taskBinding, 'import-task');
|
|
271
|
+
const current = validateImportInputs(ctx.projectDir);
|
|
272
|
+
if (!equal(current.manifest, ctx.manifest) || !equal(current.setupPlan, ctx.setupPlan)) throw new Error('DEPENDENCY_INPUT_CHANGED');
|
|
273
|
+
let adapter, index, inputError;
|
|
274
|
+
try {
|
|
275
|
+
adapter = await loadDependencyDispositions(ctx.projectDir);
|
|
276
|
+
const binding = bindDependencyProducers({ manifest: ctx.manifest, setupPlan: ctx.setupPlan, dispositions: adapter.dispositions });
|
|
277
|
+
if (!binding.ok) throw new Error(binding.errors.join(';'));
|
|
278
|
+
index = await evidenceIndex(ctx);
|
|
279
|
+
} catch (error) { inputError = error; }
|
|
280
|
+
const dependencies = [];
|
|
281
|
+
for (const edge of ctx.task.dependencyEdges) dependencies.push(inputError ? { ...edge, state: 'unknown', reasons: [evidenceReason(inputError)], recovery: edge.producer.kind === 'setup-step' ? `run-setup:${edge.producer.stepIds[0]}` : edge.producer.kind === 'disposition' ? `obtain-disposition-approval:${edge.ref}` : `run-import:${edge.producer.taskId}` } : { ...await evaluateDependency({ ctx, ...edge, index, dispositions: adapter.dispositions }), mode: edge.mode });
|
|
282
|
+
if (inputError && !dependencies.length) throw inputError;
|
|
283
|
+
const blocked = dependencies.filter(dep => !['complete', 'empty', 'setup-passed', 'excluded-approved'].includes(dep.state) && !(dep.state === 'partial' && dep.mode === 'per-record'));
|
|
284
|
+
const waiting = projectWaiting(ctx, index);
|
|
285
|
+
const evaluation = Object.freeze({ taskId: ctx.taskId, blocked: blocked.map(({ receipt, snapshot, ...row }) => row), ok: blocked.length === 0, work: Object.freeze({ ...index?.work }) });
|
|
286
|
+
const generation = (evaluationGenerations.get(taskBinding) || 0) + 1; evaluationGenerations.set(taskBinding, generation);
|
|
287
|
+
evaluations.set(evaluation, { ctx, dependencies, index, adapter, stamp: fingerprint(ctx), taskBinding, generation });
|
|
288
|
+
const diagnostic = { waiting, schemaVersion: 1, siteId: ctx.siteId, taskId: ctx.taskId, blocked: evaluation.blocked,
|
|
289
|
+
affectedCount: ctx.task.population ?? null, operatorRole: 'Requires Import Operator',
|
|
290
|
+
action: `Inspect execution/dependency-readiness.json for task ${ctx.taskId}; resolve its prerequisite and resume only eligible deferred records. Do not resend existing orders.` };
|
|
291
|
+
const diagnosticFile = inside(ctx.projectDir, 'execution/dependency-readiness.json');
|
|
292
|
+
const previous = read(ctx.projectDir, 'execution/dependency-readiness.json', { tasks: {} });
|
|
293
|
+
await require('./orchestration-state').writeJsonAtomic(diagnosticFile, { schemaVersion: 1, tasks: { ...previous.tasks, [ctx.taskId]: diagnostic } });
|
|
294
|
+
if (blocked.length) await require('./execution-log').appendExecutionLog(ctx.projectDir, { runId: ctx.runId, phase: 'import', event: 'dependency-readiness-blocked', detail: JSON.stringify({ taskId: ctx.taskId, blocked: evaluation.blocked }), artifacts: ['execution/dependency-readiness.json'] });
|
|
295
|
+
return evaluation;
|
|
296
|
+
}
|
|
297
|
+
function expandPaths(payload, template) {
|
|
298
|
+
const result = [];
|
|
299
|
+
function visit(value, parts, prefix) {
|
|
300
|
+
if (!parts.length) { result.push(prefix); return; }
|
|
301
|
+
const [part, ...rest] = parts, array = part.endsWith('[]'), key = array ? part.slice(0, -2) : part;
|
|
302
|
+
const next = prefix ? prefix + '.' + key : key;
|
|
303
|
+
if (array) { if (Array.isArray(value?.[key])) value[key].forEach((entry, index) => visit(entry, rest, next + '[' + index + ']')); }
|
|
304
|
+
else if (value && Object.hasOwn(value, key)) visit(value[key], rest, next);
|
|
305
|
+
}
|
|
306
|
+
visit(payload, template.split('.'), ''); return result;
|
|
307
|
+
}
|
|
308
|
+
async function persistReferenceGap(ctx, sourceStableKey, code) {
|
|
309
|
+
const file = 'mapping/review/mapping-gaps.json', existing = read(ctx.projectDir, file, { gaps: [] });
|
|
310
|
+
const rows = Array.isArray(existing) ? existing : existing.gaps;
|
|
311
|
+
if (!Array.isArray(rows)) throw new Error('mapping_gaps_malformed');
|
|
312
|
+
const row = rows.find(row => row.code === code && row.taskId === ctx.taskId);
|
|
313
|
+
if (row) row.affectedSourceKeys = [...new Set([...(row.affectedSourceKeys || []), sourceStableKey])].sort();
|
|
314
|
+
else rows.push({ code, reasonCode: code, taskId: ctx.taskId, severity: 'blocker', affectedSourceKeys: [sourceStableKey],
|
|
315
|
+
action: 'Requires Import Operator. Review this source-key scope and the recorded reference-fidelity or shipping-cardinality blocker. Obtain the existing required owner decision or verified preserving mapping, regenerate and approve current mapping evidence, then resume only affected deferred records. Do not resend existing orders.' });
|
|
316
|
+
await require('./orchestration-state').writeJsonAtomic(inside(ctx.projectDir, file), existing);
|
|
317
|
+
}
|
|
318
|
+
function valueAt(payload, concrete) { return concrete.replace(/\[(\d+)\]/g, '.$1').split('.').reduce((value, key) => value?.[key], payload); }
|
|
319
|
+
function omitAt(payload, concrete) { const keys = concrete.replace(/\[(\d+)\]/g, '.$1').split('.'); const key = keys.pop(); const parent = keys.reduce((value, part) => value?.[part], payload); if (parent) delete parent[key]; }
|
|
320
|
+
async function gateBatch({ evaluation, records }) {
|
|
321
|
+
const state = evaluations.get(evaluation);
|
|
322
|
+
if (!state || state.stamp !== fingerprint(state.ctx) || evaluationGenerations.get(state.taskBinding) !== state.generation) throw new Error('DEPENDENCY_EVALUATION_STALE');
|
|
323
|
+
if (!evaluation.ok) throw Object.assign(new Error('DEPENDENCY_NOT_READY'), { diagnostic: evaluation });
|
|
324
|
+
const { ctx, dependencies, index, adapter } = state, send = [], defer = [], allowed = new Set();
|
|
325
|
+
for (const record of records) {
|
|
326
|
+
if (!record.sourceStableKey) throw new Error('DEPENDENCY_SOURCE_KEY_REQUIRED');
|
|
327
|
+
const references = [], omissions = []; let blocker;
|
|
328
|
+
const resolve = (ref, key, concrete, mode) => {
|
|
329
|
+
const fromSetup = mode === 'setup';
|
|
330
|
+
const dep = dependencies.find(dep => dep.ref === ref);
|
|
331
|
+
if (!dep || (fromSetup ? dep.mode !== 'task-complete' || dep.producer.kind !== 'setup-step' : mode === 'task' ? dep.mode !== 'task-complete' || dep.producer.kind !== 'import-task' || !['complete', 'empty'].includes(dep.state) : dep.mode !== 'per-record' || dep.producer.kind === 'setup-step')) throw new Error('REFERENCE_UNDECLARED');
|
|
332
|
+
if (!fromSetup && mode !== 'task' && !ctx.task.entityRefs.some(entityRef => (domain(entityRef).dependencyReferenceFields?.[ref] || []).some(template => pathMatches(template, concrete)))) throw new Error('REFERENCE_UNDECLARED');
|
|
333
|
+
if (fromSetup) {
|
|
334
|
+
const entries = dep.receipt.requirements.filter(req => dep.producer.stepIds.includes(req.id)).flatMap(req => req.referenceBindings || []);
|
|
335
|
+
const match = entries.find(binding => binding.ref === ref && binding.sourceStableKey === key && Object.keys(binding.values).some(template => pathMatches(template, concrete)));
|
|
336
|
+
const template = match && Object.keys(match.values).find(template => pathMatches(template, concrete));
|
|
337
|
+
if (!match || !template) { blocker = { ref, sourceStableKey: key, dependencyState: dep.state }; return undefined; }
|
|
338
|
+
const value = match.values[template]; references.push({ ref, sourceStableKey: key, path: concrete, targetId: value, producerKind: 'setup-step' }); return value;
|
|
339
|
+
}
|
|
340
|
+
if (dep.state === 'empty') { blocker = { ref, sourceStableKey: key, dependencyState: 'unknown' }; return undefined; }
|
|
341
|
+
const producerTask = ctx.manifest.tasks.find(task => task.id === dep.producer.taskId);
|
|
342
|
+
const snapshot = producerTask && snapshots(ctx, producerTask);
|
|
343
|
+
const source = snapshot?.sourceByKey.get(key);
|
|
344
|
+
const target = source?.ref === ref ? keyReady(ctx, index, key, { task: producerTask, snapshot, ref }) : { ready: false };
|
|
345
|
+
if (target.ready) {
|
|
346
|
+
if (producerTask?.verificationLevel === 'verified' && ['crm/contact', 'stores/product'].includes(ref) && !require('./write-verification').validReceipt(target.row.verification, { siteId: ctx.siteId, sourceKey: key, targetId: target.row.targetId })) {
|
|
347
|
+
blocker = { ref, sourceStableKey: key, dependencyState: 'imported-unverified' }; return undefined;
|
|
348
|
+
}
|
|
349
|
+
references.push({ ref, sourceStableKey: key, path: concrete, targetId: target.row.targetId }); return target.row.targetId;
|
|
350
|
+
}
|
|
351
|
+
const sourceTask = ctx.manifest.tasks.find(task => task.id === dep.producer.taskId);
|
|
352
|
+
const sourceLinks = [...(sourceTask?.sourceBindings || []), ...(ctx.task.dependencySourceBindings || [])];
|
|
353
|
+
const matches = sourceLinks.filter(source => source.ref === ref && typeof source.keyPrefix === 'string' && key.startsWith(source.keyPrefix));
|
|
354
|
+
const censusId = (source?.ref === ref && snapshot.censusByKey.get(key)) || (matches.length === 1 ? matches[0].censusId || `entity:${matches[0].sourceEntity}` : null);
|
|
355
|
+
const rule = adapter.rules.find(rule => rule.dependencyRef === ref && ctx.task.entityRefs.includes(rule.dependentRef) && rule.censusId === censusId && adapter.rows.get(censusId)?.state === 'excluded' && adapter.approved.has(censusId) && pathMatches(rule.path, concrete));
|
|
356
|
+
if (rule?.action === 'omit') { omissions.push(concrete); references.push({ ref, sourceStableKey: key, path: concrete, action: 'omit' }); return undefined; }
|
|
357
|
+
blocker = { reason: rule?.action === 'defer' ? 'dependency-not-ready' : (dep.state.startsWith('excluded') || adapter.rows.get(censusId)?.state === 'excluded') ? 'dependency-disposition-rule-missing' : 'dependency-not-ready', ref, sourceStableKey: key, dependencyState: dep.state };
|
|
358
|
+
return undefined;
|
|
359
|
+
};
|
|
360
|
+
try {
|
|
361
|
+
const payload = record.transform ? await record.transform({ resolveReference: (ref, key, concrete) => resolve(ref, key, concrete, 'record'), resolveTaskReference: (ref, key, concrete) => resolve(ref, key, concrete, 'task'), resolveSetupReference: (ref, key, concrete) => resolve(ref, key, concrete, 'setup') }) : record.payload;
|
|
362
|
+
if (payload?.deferred && typeof payload.reason === 'string') { blocker = { reason: payload.reason, dependencyState: 'unknown' }; await persistReferenceGap(ctx, record.sourceStableKey, payload.reason); }
|
|
363
|
+
for (const concrete of omissions) if (valueAt(payload, concrete) !== undefined) throw new Error('dependency-excluded-reference-present');
|
|
364
|
+
for (const targetRef of ctx.task.entityRefs) for (const [ref, templates] of Object.entries(domain(targetRef).dependencyReferenceFields || {})) for (const template of templates) for (const concrete of expandPaths(payload, template)) if (valueAt(payload, concrete) !== undefined && !references.some(reference => reference.ref === ref && reference.path === concrete)) throw new Error('dependency-reference-unresolved');
|
|
365
|
+
for (const ref of references.filter(ref => !ref.action)) if (valueAt(payload, ref.path) !== ref.targetId) throw new Error('dependency-reference-payload-mismatch');
|
|
366
|
+
if (blocker) defer.push({ ...record, deferral: { reason: 'dependency-not-ready', ...blocker } });
|
|
367
|
+
else { allowed.add(record.sourceStableKey); send.push({ ...record, payload, references }); }
|
|
368
|
+
} catch (error) { defer.push({ ...record, deferral: { reason: ['REFERENCE_UNDECLARED', 'dependency-excluded-reference-present', 'dependency-reference-payload-mismatch', 'dependency-reference-unresolved'].includes(error.message) ? error.message : 'dependency-transform-failed' } }); }
|
|
369
|
+
}
|
|
370
|
+
for (const record of defer) await local.appendAttempt(ctx.projectDir, { schemaVersion: 1, attemptId: crypto.randomUUID(), sourceStableKey: record.sourceStableKey, writeSpecId: ctx.taskId, operation: 'create', targetEntityType: ctx.task.entityRefs[0], status: 'deferred', runId: ctx.runId, phase: 'import', ts: new Date().toISOString(), deferral: record.deferral });
|
|
371
|
+
const projection = read(ctx.projectDir, 'execution/dependency-readiness.json', { tasks: {} });
|
|
372
|
+
if (projection.tasks?.[ctx.taskId]) { const currentIndex = await evidenceIndex(ctx); projection.tasks[ctx.taskId].waiting = projectWaiting(ctx, currentIndex); await require('./orchestration-state').writeJsonAtomic(inside(ctx.projectDir, 'execution/dependency-readiness.json'), projection); }
|
|
373
|
+
const payloads = new Map(send.map(record => [record.sourceStableKey, record.references.map(reference => Object.freeze({ ...reference }))]));
|
|
374
|
+
const grant = Object.freeze({ taskId: ctx.taskId, runId: ctx.runId, siteId: ctx.siteId });
|
|
375
|
+
grants.set(grant, { ctx, index, allowed, payloads, stamp: state.stamp, taskBinding: state.taskBinding, generation: state.generation });
|
|
376
|
+
return { send, defer, grant };
|
|
377
|
+
}
|
|
378
|
+
function verifyGrant(grant, clientContext, sourceStableKey, request, { auxiliary = false, partial = false } = {}) {
|
|
379
|
+
const stored = grants.get(grant);
|
|
380
|
+
if (stored && request && !auxiliary) {
|
|
381
|
+
const body = request.body?.order || request.body?.product || request.body?.contact || request.body;
|
|
382
|
+
for (const reference of stored.payloads.get(sourceStableKey) || []) { if (partial && !Object.hasOwn(body || {}, reference.path.split(/[.\[]/)[0])) continue; const value = valueAt(body, reference.path); if (reference.action === 'omit' ? value !== undefined : value !== reference.targetId) return false; }
|
|
383
|
+
}
|
|
384
|
+
return Boolean(stored && stored.ctx.taskId === clientContext.taskId && stored.ctx.runId === clientContext.runId && stored.ctx.siteId === clientContext.siteId && stored.allowed.has(sourceStableKey) && evaluationGenerations.get(stored.taskBinding) === stored.generation && stored.stamp === fingerprint(stored.ctx));
|
|
385
|
+
}
|
|
386
|
+
function verifyReferenceTargets(grant, ctx, key, ref, ids) {
|
|
387
|
+
const stored = grants.get(grant);
|
|
388
|
+
if (!verifyGrant(grant, ctx, key) || !Array.isArray(ids)) return false;
|
|
389
|
+
const expected = new Set((stored.payloads.get(key) || []).filter(row => row.ref === ref && !row.action).map(row => row.targetId));
|
|
390
|
+
return ids.length === expected.size && new Set(ids).size === ids.length && ids.every(id => expected.has(id));
|
|
391
|
+
}
|
|
392
|
+
function currentRecordTargetId(grant, clientContext, sourceStableKey) {
|
|
393
|
+
const stored = grants.get(grant);
|
|
394
|
+
if (!verifyGrant(grant, clientContext, sourceStableKey)) return null;
|
|
395
|
+
const current = keyReady(stored.ctx, stored.index, sourceStableKey, { task: stored.ctx.task, snapshot: snapshots(stored.ctx, stored.ctx.task) });
|
|
396
|
+
return current.ready ? current.row.targetId : null;
|
|
397
|
+
}
|
|
398
|
+
async function finishTaskPass({ taskBinding, selection = { mode: 'full' } }) {
|
|
399
|
+
const ctx = capability.requireKind(taskBinding, 'import-task');
|
|
400
|
+
if (!SELECTIVE.has(selection.mode)) throw new Error('readiness_selection_invalid');
|
|
401
|
+
const snapshot = snapshots(ctx, ctx.task);
|
|
402
|
+
const row = { schemaVersion: 1, taskId: ctx.taskId, entityRefs: ctx.task.entityRefs, runId: ctx.runId, planVersion: ctx.manifest.planVersion,
|
|
403
|
+
manifestDigest: fileDigest(ctx.projectDir, 'execution/execution-manifest.json'), setupPlanDigest: fileDigest(ctx.projectDir, 'setup/setup-plan.json'),
|
|
404
|
+
mappingPlanDigest: fileDigest(ctx.projectDir, 'mapping/mapping-plan.json'), siteId: ctx.siteId, sourceSnapshotDigests: snapshot.digests,
|
|
405
|
+
selection, dryRun: ctx.dryRun, finishedAt: new Date().toISOString() };
|
|
406
|
+
validatePass(row); const passPath = inside(ctx.projectDir, PASS_FILE); await fsp.mkdir(path.dirname(passPath), { recursive: true }); await fsp.appendFile(passPath, JSON.stringify(row) + '\n'); return row;
|
|
407
|
+
}
|
|
408
|
+
async function reconcileSiteEvidence({ taskBinding, readBack }) {
|
|
409
|
+
const ctx = capability.requireKind(taskBinding, 'import-task'), index = await evidenceIndex(ctx), snapshot = snapshots(ctx, ctx.task);
|
|
410
|
+
for (const key of snapshot.keys) {
|
|
411
|
+
const row = index.crosswalk.get(key);
|
|
412
|
+
if (!row || keyReady(ctx, index, key, { task: ctx.task, snapshot }).ready) continue;
|
|
413
|
+
let matched = null;
|
|
414
|
+
try { matched = await readBack({ targetId: row.targetId, sourceStableKey: key, siteId: ctx.siteId }); } catch {}
|
|
415
|
+
if (!matched || matched.matchesRecordedWrite !== true || !require('../resources/rp-target-wix/lib/wix-writers').validReadBackEvidence(matched.result, { siteId: ctx.siteId, targetId: row.targetId })) continue;
|
|
416
|
+
await local.updateCrosswalkRows(ctx.projectDir, [{ ...row, siteId: ctx.siteId, evidence: 'site-reconciled' }]);
|
|
417
|
+
const previous = index.attempts.get(key);
|
|
418
|
+
await local.appendAttempt(ctx.projectDir, { ...(previous || { schemaVersion: 1, sourceStableKey: key, writeSpecId: ctx.taskId, operation: 'create', targetEntityType: row.targetEntityType, runId: ctx.runId, phase: 'import' }), attemptId: crypto.randomUUID(), siteId: ctx.siteId, status: 'imported', evidence: 'site-reconciled', ts: new Date().toISOString() });
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
module.exports = { startImportRun: capability.startImportRun, bindTask: capability.bindTask, bindDependencyProducers,
|
|
422
|
+
validateImportInputs, validateAssociations, loadDependencyDispositions, evaluateTask, gateBatch,
|
|
423
|
+
verifyGrant, verifyReferenceTargets, currentRecordTargetId, finishTaskPass, reconcileSiteEvidence, validatePass, PASS_FILE, pathMatches, valueAt, expandPaths };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// A prerequisite deferral owns recovery until a confirmed terminal success. Admission,
|
|
4
|
+
// retries and uncertain writes preserve its lineage; never infer success from disappearance
|
|
5
|
+
// of the latest row's `deferral` field. This reducer is shared by runtime and cutover.
|
|
6
|
+
function createRecoveryIndex(siteId) { return { siteId, byTask: new Map() }; }
|
|
7
|
+
function applyRecoveryAttempt(index, row) {
|
|
8
|
+
if (row.siteId && index.siteId && row.siteId !== index.siteId) return;
|
|
9
|
+
let task = index.byTask.get(row.writeSpecId);
|
|
10
|
+
if (row.status === 'deferred' && row.deferral) {
|
|
11
|
+
if (!task) { task = new Map(); index.byTask.set(row.writeSpecId, task); }
|
|
12
|
+
task.set(row.sourceStableKey, { sourceStableKey: row.sourceStableKey, deferral: structuredClone(row.deferral), latestStatus: row.status });
|
|
13
|
+
} else if (task?.has(row.sourceStableKey)) {
|
|
14
|
+
if (['imported', 'skipped_already_imported'].includes(row.status) && (!index.siteId || row.siteId === index.siteId)) {
|
|
15
|
+
task.delete(row.sourceStableKey); if (!task.size) index.byTask.delete(row.writeSpecId);
|
|
16
|
+
} else task.get(row.sourceStableKey).latestStatus = row.status;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function waitingForTask(index, taskId) { return [...(index.byTask.get(taskId)?.values() || [])].map(row => structuredClone(row)); }
|
|
20
|
+
function foldRecoveryAttempts(rows, siteId) { const index = createRecoveryIndex(siteId); for (const row of rows) applyRecoveryAttempt(index, row); return index; }
|
|
21
|
+
module.exports = { createRecoveryIndex, applyRecoveryAttempt, waitingForTask, foldRecoveryAttempts };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// The destination site-type choice. Business type is part of the one
|
|
4
|
+
// site-type answer, never its own request, and both decisions are persisted in one write.
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const {
|
|
7
|
+
SITE_BUSINESS_TYPES,
|
|
8
|
+
SITE_TYPE_CHOICES,
|
|
9
|
+
SITE_TYPES,
|
|
10
|
+
getDecisionEntry,
|
|
11
|
+
} = require('./orchestration-decisions.js');
|
|
12
|
+
const { loadArtifacts, writeJsonAtomic, updateDecisionObject, nowIso } = require('./orchestration-state.js');
|
|
13
|
+
|
|
14
|
+
const KNOWN_BUSINESS_TYPES = Object.freeze(['store', 'bookings', 'other']);
|
|
15
|
+
|
|
16
|
+
const CHOICE_LABELS = Object.freeze({
|
|
17
|
+
headless: { label: 'Headless', description: 'A website developed in code (Wix Managed Headless).' },
|
|
18
|
+
studio: { label: 'Wix Studio', description: 'A website designed in the Wix Studio editor.' },
|
|
19
|
+
harmony_store: { label: 'Wix Harmony — store', description: 'Harmony editor; the business sells products.' },
|
|
20
|
+
harmony_bookings: { label: 'Wix Harmony — bookings/services', description: 'Harmony editor; the business sells appointments, classes or services.' },
|
|
21
|
+
harmony_other: { label: 'Wix Harmony — another kind of business', description: 'Harmony editor; neither a store nor a bookings business.' },
|
|
22
|
+
harmony: { label: 'Wix Harmony — not sure, start blank', description: 'Harmony editor, starting from the blank template.' },
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const CONTEXT_HARMONY_LABEL = { label: 'Wix Harmony', description: 'A website designed in the Wix Harmony editor.' };
|
|
26
|
+
|
|
27
|
+
// Validates and returns the decision pair a set of inputs describes. Throws on an unknown
|
|
28
|
+
// value, a business type for a non-Harmony site, or a CLI-style business type with no type.
|
|
29
|
+
function resolveSiteTypePair({ siteType, businessType = undefined, businessTypeSource = undefined, evidenceRef = null }) {
|
|
30
|
+
if (siteType === 'editor') throw new Error('site type "editor" is incomplete: choose studio or harmony');
|
|
31
|
+
if (!SITE_TYPES.includes(siteType)) throw new Error(`site type must be one of ${SITE_TYPES.join(', ')}`);
|
|
32
|
+
if (siteType !== 'harmony') {
|
|
33
|
+
if (businessType !== undefined && businessType !== null) throw new Error('a site business type is valid only with site type harmony');
|
|
34
|
+
return { siteType, businessType: null, businessTypeSource: null, evidenceRef: null };
|
|
35
|
+
}
|
|
36
|
+
const value = businessType === undefined || businessType === null || businessType === '' ? 'unknown' : businessType;
|
|
37
|
+
if (!SITE_BUSINESS_TYPES.includes(value)) throw new Error(`site business type must be one of ${SITE_BUSINESS_TYPES.join(', ')}`);
|
|
38
|
+
const source = businessTypeSource || 'user';
|
|
39
|
+
if (source === 'context' && (!KNOWN_BUSINESS_TYPES.includes(value) || !evidenceRef)) {
|
|
40
|
+
throw new Error('a context business type needs a known value and an evidence reference');
|
|
41
|
+
}
|
|
42
|
+
return { siteType, businessType: value, businessTypeSource: source, evidenceRef: source === 'context' ? evidenceRef : null };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Writes the pair into `decisions` (in memory). A different recorded pair is a conflict:
|
|
46
|
+
// changing the answer never silently retargets the destination.
|
|
47
|
+
function applySiteTypePair(decisions, pair, { rationale = null, timestamp = nowIso() } = {}) {
|
|
48
|
+
const existingType = getDecisionEntry(decisions, 'targetSiteType');
|
|
49
|
+
if (existingType) {
|
|
50
|
+
const existingBusiness = getDecisionEntry(decisions, 'targetSiteBusinessType');
|
|
51
|
+
const same = existingType.value === pair.siteType
|
|
52
|
+
&& (existingBusiness ? existingBusiness.value : null) === pair.businessType;
|
|
53
|
+
if (same) return { changed: false };
|
|
54
|
+
throw new Error(`site type conflicts with the recorded decision (${existingType.value}${existingBusiness ? `/${existingBusiness.value}` : ''}); a type change needs an explicit recovery decision`);
|
|
55
|
+
}
|
|
56
|
+
updateDecisionObject(decisions, 'targetSiteType', pair.siteType, { source: 'user', rationale, timestamp });
|
|
57
|
+
if (pair.siteType === 'harmony') {
|
|
58
|
+
updateDecisionObject(decisions, 'targetSiteBusinessType', pair.businessType, {
|
|
59
|
+
source: pair.businessTypeSource,
|
|
60
|
+
rationale,
|
|
61
|
+
timestamp,
|
|
62
|
+
evidenceRef: pair.evidenceRef,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return { changed: true };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// One atomic decisions.json write for the pair; never two writes the router could observe apart.
|
|
69
|
+
async function recordSiteTypeDecision(projectDir, input, options = {}) {
|
|
70
|
+
const pair = resolveSiteTypePair(input);
|
|
71
|
+
const artifacts = await loadArtifacts(projectDir);
|
|
72
|
+
if (!artifacts.decisions) throw new Error('orchestration decisions are not initialized');
|
|
73
|
+
const result = applySiteTypePair(artifacts.decisions, pair, options);
|
|
74
|
+
if (result.changed) await writeJsonAtomic(path.join(projectDir, 'orchestration', 'decisions.json'), artifacts.decisions);
|
|
75
|
+
return { ...pair, changed: result.changed };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// The durable request for a missing site type. With a context business type, Harmony
|
|
79
|
+
// collapses to one `harmony` choice that records the context value.
|
|
80
|
+
function siteTypeRequestInput({ contextBusinessType = null, evidenceRef = null, siteName = null } = {}) {
|
|
81
|
+
const fromContext = contextBusinessType && KNOWN_BUSINESS_TYPES.includes(contextBusinessType) && evidenceRef;
|
|
82
|
+
const ids = fromContext ? ['headless', 'studio', 'harmony'] : Object.keys(SITE_TYPE_CHOICES);
|
|
83
|
+
const choices = ids.map((id) => ({ id, ...(fromContext && id === 'harmony' ? CONTEXT_HARMONY_LABEL : CHOICE_LABELS[id]) }));
|
|
84
|
+
const context = [
|
|
85
|
+
'A Studio or Harmony site is created in the Wix account the Wix CLI is logged into; that account is shown for confirmation before anything is created.',
|
|
86
|
+
siteName ? `Its name will be "${siteName}".` : null,
|
|
87
|
+
fromContext ? `The business type is already known from the run (${contextBusinessType}).` : null,
|
|
88
|
+
].filter(Boolean).join(' ');
|
|
89
|
+
return {
|
|
90
|
+
kind: 'question',
|
|
91
|
+
stage: 'destination',
|
|
92
|
+
title: 'Choose the new site type',
|
|
93
|
+
prompt: `What kind of new Wix site should this migration create? This choice decides where the imported data will live and cannot be changed later as a setting. Headless is for a website developed in code; Studio and Harmony are websites designed in a Wix editor.${context ? ` ${context}` : ''}`,
|
|
94
|
+
response: { mode: 'choice', required: true },
|
|
95
|
+
choices,
|
|
96
|
+
effect: {
|
|
97
|
+
kind: 'decision',
|
|
98
|
+
key: 'targetSiteType',
|
|
99
|
+
choices: Object.fromEntries(ids.map((id) => [id, id])),
|
|
100
|
+
...(fromContext ? { contextBusinessType, evidenceRef } : {}),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Maps an answered site-type choice to the pair it records (used by the effect handler).
|
|
106
|
+
function pairForChoice(effect, choiceId) {
|
|
107
|
+
const mapped = SITE_TYPE_CHOICES[choiceId];
|
|
108
|
+
if (!mapped) throw new Error(`unknown site-type choice: ${choiceId}`);
|
|
109
|
+
if (mapped.siteType === 'harmony' && choiceId === 'harmony' && effect.contextBusinessType) {
|
|
110
|
+
return resolveSiteTypePair({ siteType: 'harmony', businessType: effect.contextBusinessType, businessTypeSource: 'context', evidenceRef: effect.evidenceRef });
|
|
111
|
+
}
|
|
112
|
+
return resolveSiteTypePair({ siteType: mapped.siteType, businessType: mapped.businessType, businessTypeSource: 'user' });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function isValidSiteTypeEffect(effect, choices) {
|
|
116
|
+
if (!effect || effect.kind !== 'decision' || effect.key !== 'targetSiteType') return false;
|
|
117
|
+
if (!effect.choices || typeof effect.choices !== 'object' || Array.isArray(effect.choices)) return false;
|
|
118
|
+
const entries = Object.entries(effect.choices);
|
|
119
|
+
if (!entries.length) return false;
|
|
120
|
+
if (!entries.every(([choice, value]) => choice === value && SITE_TYPE_CHOICES[choice] && choices.some((item) => item.id === choice))) return false;
|
|
121
|
+
if (effect.contextBusinessType !== undefined) {
|
|
122
|
+
if (!KNOWN_BUSINESS_TYPES.includes(effect.contextBusinessType) || typeof effect.evidenceRef !== 'string' || !effect.evidenceRef) return false;
|
|
123
|
+
if (entries.some(([choice]) => choice.startsWith('harmony_'))) return false;
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Scope guard for management_and_website with an Editor choice.
|
|
129
|
+
const EDITOR_WEBSITE_DECISIONS = Object.freeze(['management_only', 'separate_editor_handoff']);
|
|
130
|
+
|
|
131
|
+
function editorWebsiteRequestInput({ siteType }) {
|
|
132
|
+
return {
|
|
133
|
+
kind: 'question',
|
|
134
|
+
stage: 'destination',
|
|
135
|
+
title: 'Editor website is not built automatically',
|
|
136
|
+
prompt: `You asked for both the backend migration and the website, on a ${siteType === 'studio' ? 'Wix Studio' : 'Wix Harmony'} site. RePlatform has no supported automatic website migration for an Editor site: it creates the site and imports the business data, but the website itself is designed separately in the Wix editor. Choose whether to migrate the backend only, or to continue with the backend now and a separate Editor website handoff (the website stays outstanding and the migration is not reported complete until it is released).`,
|
|
137
|
+
response: { mode: 'choice', required: true },
|
|
138
|
+
choices: [
|
|
139
|
+
{ id: 'management_only', label: 'Backend only', description: 'Change the scope to management; no website work is owed by this run.' },
|
|
140
|
+
{ id: 'separate_editor_handoff', label: 'Backend now, Editor website separately', description: 'Keep the website obligation as an outstanding handoff for the site owner/designer.' },
|
|
141
|
+
],
|
|
142
|
+
effect: { kind: 'decision', key: 'editorWebsiteDecision', choices: { management_only: 'management_only', separate_editor_handoff: 'separate_editor_handoff' } },
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isValidEditorWebsiteEffect(effect, choices) {
|
|
147
|
+
if (!effect || effect.kind !== 'decision' || effect.key !== 'editorWebsiteDecision') return false;
|
|
148
|
+
const entries = Object.entries(effect.choices || {});
|
|
149
|
+
return entries.length > 0 && entries.every(([choice, value]) => choice === value && EDITOR_WEBSITE_DECISIONS.includes(choice) && choices.some((item) => item.id === choice));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
module.exports = {
|
|
153
|
+
EDITOR_WEBSITE_DECISIONS,
|
|
154
|
+
KNOWN_BUSINESS_TYPES,
|
|
155
|
+
applySiteTypePair,
|
|
156
|
+
editorWebsiteRequestInput,
|
|
157
|
+
isValidEditorWebsiteEffect,
|
|
158
|
+
isValidSiteTypeEffect,
|
|
159
|
+
pairForChoice,
|
|
160
|
+
recordSiteTypeDecision,
|
|
161
|
+
resolveSiteTypePair,
|
|
162
|
+
siteTypeRequestInput,
|
|
163
|
+
};
|