@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,401 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// The runner deliberately owns only process supervision and presentation. Routing, receipts,
|
|
4
|
+
// and migration mutations remain owned by the existing skill artifacts.
|
|
5
|
+
const fs = require('node:fs/promises');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const crypto = require('node:crypto');
|
|
8
|
+
const { loadArtifacts, initArtifacts, writeJsonAtomic, updateDecisionObject, transitionRun } = require('./orchestration-state.js');
|
|
9
|
+
const { determineNextStep } = require('./orchestration-router.js');
|
|
10
|
+
const { validateMigrationCompletion, loadMigrationCompletionInputs } = require('./migration-completion.js');
|
|
11
|
+
const { listUserActions, readUserAction } = require('./user-actions.js');
|
|
12
|
+
const { applySiteTypePair, resolveSiteTypePair } = require('./destination-choice.js');
|
|
13
|
+
const { chooseAdapter, launch, requestCancel } = require('./agent-adapters/index.js');
|
|
14
|
+
const { readTaskState, writeTaskState, createTaskState, selectRoute, startRoute, waitForInput, startDirectAgent, finishDirectAgent, recordWorker, finishCurrent, reconcileTaskState } = require('./task-state.js');
|
|
15
|
+
|
|
16
|
+
const SCHEMA_VERSION = 1;
|
|
17
|
+
const RUNNER_DIR = ['state', 'runner'];
|
|
18
|
+
|
|
19
|
+
const iso = () => new Date().toISOString();
|
|
20
|
+
const runId = () => `rpr_${crypto.randomUUID()}`;
|
|
21
|
+
const runnerDir = (projectDir) => path.join(projectDir, ...RUNNER_DIR);
|
|
22
|
+
const activePath = (projectDir) => path.join(runnerDir(projectDir), 'active.json');
|
|
23
|
+
const historyPath = (projectDir, id) => path.join(runnerDir(projectDir), 'runs', `${id}.json`);
|
|
24
|
+
const defaultEventsPath = (projectDir) => path.join(runnerDir(projectDir), 'events.ndjson');
|
|
25
|
+
const cancelPath = (projectDir) => path.join(runnerDir(projectDir), 'cancel-request.json');
|
|
26
|
+
|
|
27
|
+
async function readJson(filePath) {
|
|
28
|
+
try { return JSON.parse(await fs.readFile(filePath, 'utf8')); } catch (error) { if (error.code === 'ENOENT') return null; throw error; }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function ensureInitialArtifacts(projectDir) {
|
|
32
|
+
const artifacts = await loadArtifacts(projectDir);
|
|
33
|
+
if (artifacts.run) return artifacts;
|
|
34
|
+
return initArtifacts(projectDir);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function safeRelative(projectDir, item) {
|
|
38
|
+
const relative = path.relative(projectDir, item);
|
|
39
|
+
return relative && !relative.startsWith('..') && !path.isAbsolute(relative) ? relative.replaceAll(path.sep, '/') : null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function appendLine(filePath, value) {
|
|
43
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
44
|
+
await fs.appendFile(filePath, `${JSON.stringify(value)}\n`, 'utf8');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function findRun(rootDir, id) {
|
|
48
|
+
if (!/^rpr_[0-9a-f-]+$/.test(id)) return null;
|
|
49
|
+
// Projects normally sit one level beneath the migrations root. A bounded recursive
|
|
50
|
+
// lookup also keeps existing runs observable after a project was nested accidentally.
|
|
51
|
+
const pending = [{ directory: rootDir, depth: 0 }];
|
|
52
|
+
while (pending.length) {
|
|
53
|
+
const { directory, depth } = pending.pop();
|
|
54
|
+
const direct = await readJson(historyPath(directory, id));
|
|
55
|
+
if (direct) return direct;
|
|
56
|
+
if (depth >= 3) continue;
|
|
57
|
+
let entries;
|
|
58
|
+
try { entries = await fs.readdir(directory, { withFileTypes: true }); } catch { continue; }
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
if (entry.isDirectory() && !['state', 'orchestration', 'completion', 'execution', 'website'].includes(entry.name)) {
|
|
61
|
+
pending.push({ directory: path.join(directory, entry.name), depth: depth + 1 });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function readActive(projectDir) { return readJson(activePath(projectDir)); }
|
|
69
|
+
|
|
70
|
+
async function applyInvocationInputs(projectDir, inputs) {
|
|
71
|
+
const artifacts = await ensureInitialArtifacts(projectDir);
|
|
72
|
+
const decisions = artifacts.decisions;
|
|
73
|
+
const mappings = {
|
|
74
|
+
sourceUrl: inputs.sourceUrl,
|
|
75
|
+
sourceMode: inputs.sourceMode,
|
|
76
|
+
fileInputPaths: inputs.fileInputPaths,
|
|
77
|
+
deliveryMode: inputs.deliveryMode,
|
|
78
|
+
targetSiteStrategy: inputs.destination,
|
|
79
|
+
managementImportMode: inputs.managementImportMode,
|
|
80
|
+
...(inputs.oneClick ? { automationMode: 'one_click' } : {}),
|
|
81
|
+
...(inputs.dryRun ? { dryRun: true } : {}),
|
|
82
|
+
};
|
|
83
|
+
let changed = false;
|
|
84
|
+
for (const [key, value] of Object.entries(mappings)) {
|
|
85
|
+
if (value === undefined) continue;
|
|
86
|
+
const existing = decisions[key] && decisions[key].value;
|
|
87
|
+
if (existing !== undefined && JSON.stringify(existing) !== JSON.stringify(value)) {
|
|
88
|
+
throw new Error(`CLI input conflicts with existing user decision: ${key}`);
|
|
89
|
+
}
|
|
90
|
+
if (existing === undefined) { updateDecisionObject(decisions, key, value, { source: 'user' }); changed = true; }
|
|
91
|
+
}
|
|
92
|
+
// The site-type pair lands in the same single decisions write. A Harmony
|
|
93
|
+
// flag with no business type records `unknown` (source not_asked) and raises no request.
|
|
94
|
+
if (inputs.siteType !== undefined) {
|
|
95
|
+
const pair = resolveSiteTypePair({
|
|
96
|
+
siteType: inputs.siteType,
|
|
97
|
+
businessType: inputs.siteType === 'harmony' ? (inputs.siteBusinessType || 'unknown') : inputs.siteBusinessType,
|
|
98
|
+
businessTypeSource: inputs.siteType === 'harmony' && !inputs.siteBusinessType ? 'not_asked' : 'user',
|
|
99
|
+
});
|
|
100
|
+
try {
|
|
101
|
+
if (applySiteTypePair(decisions, pair, { rationale: 'replatform CLI --site-type' }).changed) changed = true;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
throw new Error(`CLI input conflicts with existing user decision: targetSiteType (${error.message})`);
|
|
104
|
+
}
|
|
105
|
+
} else if (inputs.siteBusinessType !== undefined) {
|
|
106
|
+
throw new Error('site-business-type is valid only with --site-type harmony');
|
|
107
|
+
}
|
|
108
|
+
if (changed) await writeJsonAtomic(path.join(projectDir, 'orchestration', 'decisions.json'), decisions);
|
|
109
|
+
return artifacts;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async function resumeStaleTelemetry(projectDir) {
|
|
113
|
+
try {
|
|
114
|
+
const { resumeIfStale } = require('../resources/rp-telemetry/lib/telemetry-recorder.js');
|
|
115
|
+
return await resumeIfStale(projectDir, { trigger: 'supervisor' });
|
|
116
|
+
} catch (error) {
|
|
117
|
+
return { resumed: false, reason: 'error', trigger: 'supervisor', error: String((error && error.message) || error) };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function bootstrap(projectDir) {
|
|
122
|
+
// Only this already-validated absolute path is variable. Intake values stay in artifacts.
|
|
123
|
+
return `Use the installed wix-replatform skill for the migration project at ${projectDir}. Read durable orchestration artifacts and the latest accepted CLI invocation, route, then perform only the selected stage. Do not claim completion from prose. When human input or review is required, create a durable user action and end this turn; never use an interactive question UI or wait for terminal input.`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// A pending action is intentionally included in the normalized stream. A consumer must be
|
|
127
|
+
// able to render and answer a checkpoint from JSONL alone, without first reading a project file.
|
|
128
|
+
// Keep this to operator-facing fields; do not expose effects or a later answer here.
|
|
129
|
+
function userActionSummary(request) {
|
|
130
|
+
return {
|
|
131
|
+
requestId: request.requestId,
|
|
132
|
+
kind: request.kind,
|
|
133
|
+
stage: request.stage,
|
|
134
|
+
title: request.title,
|
|
135
|
+
prompt: request.prompt,
|
|
136
|
+
response: request.response,
|
|
137
|
+
choices: request.choices,
|
|
138
|
+
artifactRefs: request.artifactRefs,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function makeResult({ id, projectDir, outcome, adapter = null, route = null, completion = null, nextAction = null, request = null }) {
|
|
143
|
+
return {
|
|
144
|
+
schemaVersion: SCHEMA_VERSION,
|
|
145
|
+
runId: id,
|
|
146
|
+
project: path.basename(projectDir),
|
|
147
|
+
outcome,
|
|
148
|
+
agent: adapter ? { id: adapter.id, version: adapter.version || null, sessionId: null } : null,
|
|
149
|
+
router: route ? { state: route.nextState, reason: route.reason, nextResource: route.nextResource || null } : null,
|
|
150
|
+
completion: { validated: Boolean(completion && completion.ok), artifact: completion && completion.ok ? 'completion/migration-completion.json' : null },
|
|
151
|
+
artifacts: request ? request.artifactRefs.map((ref) => ref.path) : [],
|
|
152
|
+
...(request ? {
|
|
153
|
+
requestId: request.requestId,
|
|
154
|
+
kind: request.kind,
|
|
155
|
+
choices: request.choices,
|
|
156
|
+
userAction: userActionSummary(request),
|
|
157
|
+
} : {}),
|
|
158
|
+
nextAction,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function exitCode(result) {
|
|
163
|
+
return ({ completed: 0, waiting_for_user: 3, blocked: 4, canceled: 5, interrupted: 5, timed_out: 6 })[result.outcome] ?? 1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
class RunController {
|
|
167
|
+
constructor(projectDir, options = {}) {
|
|
168
|
+
this.projectDir = path.resolve(projectDir);
|
|
169
|
+
this.options = { agent: 'auto', maxAgentTurns: 12, maxNoProgressContinuations: 1, gracePeriodMs: 60000, ...options };
|
|
170
|
+
this.id = options.runId || runId();
|
|
171
|
+
this.eventFiles = new Set([options.eventsFile || defaultEventsPath(this.projectDir)]);
|
|
172
|
+
this.vendorEventsPath = options.vendorEvents || null;
|
|
173
|
+
this.lastObservationAt = Date.now();
|
|
174
|
+
this.child = null;
|
|
175
|
+
this.adapter = null;
|
|
176
|
+
this.taskState = null;
|
|
177
|
+
this.closed = false;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async emit(type, state, message, extra = {}) {
|
|
181
|
+
const event = { schemaVersion: SCHEMA_VERSION, eventId: `evt_${crypto.randomUUID()}`, timestamp: iso(), runId: this.id, type, state, message, ...extra };
|
|
182
|
+
for (const filePath of this.eventFiles) await appendLine(filePath, event);
|
|
183
|
+
this.options.onEvent?.(event);
|
|
184
|
+
return event;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async writeRecord(patch = {}) {
|
|
188
|
+
// `startedAt` and `telemetryResume` are carried on the controller and included in every
|
|
189
|
+
// write, because the record is rebuilt from scratch each time. `startedAt` in active.json is
|
|
190
|
+
// what an explicit telemetry `start` inside this run reads to join the session this run
|
|
191
|
+
// opened (one supervisor process is one telemetry session).
|
|
192
|
+
const record = { schemaVersion: SCHEMA_VERSION, runId: this.id, projectDir: this.projectDir, pid: process.pid, childPid: this.child?.pid || null, adapter: this.adapter ? { id: this.adapter.id, version: this.adapter.version || null } : null, eventPath: [...this.eventFiles][0], status: 'running', updatedAt: iso(), ...(this.startedAt ? { startedAt: this.startedAt } : {}), ...(this.telemetryResume ? { telemetryResume: this.telemetryResume } : {}), ...patch };
|
|
193
|
+
await fs.mkdir(path.dirname(historyPath(this.projectDir, this.id)), { recursive: true });
|
|
194
|
+
await writeJsonAtomic(historyPath(this.projectDir, this.id), record);
|
|
195
|
+
if (!this.closed) await writeJsonAtomic(activePath(this.projectDir), record);
|
|
196
|
+
return record;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
async updateTasks(change) {
|
|
200
|
+
if (!this.taskState) return null;
|
|
201
|
+
change(this.taskState);
|
|
202
|
+
this.taskState = await writeTaskState(this.projectDir, this.taskState);
|
|
203
|
+
return this.taskState;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async recordInvocation() {
|
|
207
|
+
const filePath = path.join(this.projectDir, 'orchestration', 'cli-invocations.ndjson');
|
|
208
|
+
const safe = ['agent', 'sourceUrl', 'sourceMode', 'fileInputPaths', 'deliveryMode', 'destination', 'managementImportMode', 'siteType', 'siteBusinessType', 'oneClick', 'dryRun'].reduce((out, key) => {
|
|
209
|
+
if (this.options[key] !== undefined) out[key] = this.options[key]; return out;
|
|
210
|
+
}, {});
|
|
211
|
+
await appendLine(filePath, { schemaVersion: SCHEMA_VERSION, runId: this.id, acceptedAt: iso(), options: safe });
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async cancellationRequested() { return readJson(cancelPath(this.projectDir)); }
|
|
215
|
+
|
|
216
|
+
async setOrchestrationCancellation(status) {
|
|
217
|
+
const artifacts = await loadArtifacts(this.projectDir);
|
|
218
|
+
if (!artifacts.run) return;
|
|
219
|
+
const run = transitionRun(artifacts.run, { state: status, activePhase: 'orchestration', status, needsUserInput: false, needsLlm: false });
|
|
220
|
+
await writeJsonAtomic(path.join(this.projectDir, 'orchestration', 'run.json'), run);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async finish(result) {
|
|
224
|
+
if (this.closed) return result;
|
|
225
|
+
this.closed = true;
|
|
226
|
+
await this.updateTasks((state) => finishCurrent(state, result.outcome === 'waiting_for_user' ? 'waiting_for_input' : result.outcome === 'timed_out' ? 'interrupted' : result.outcome));
|
|
227
|
+
await this.emit('result', result.outcome, 'Run result.', { result });
|
|
228
|
+
await this.writeRecord({ status: result.outcome, result, endedAt: iso() });
|
|
229
|
+
try { await fs.unlink(activePath(this.projectDir)); } catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
230
|
+
return result;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
async waitForChild() {
|
|
234
|
+
return new Promise((resolve) => this.child.once('close', (code, signal) => resolve({ code, signal })));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async run() {
|
|
238
|
+
await fs.mkdir(this.projectDir, { recursive: true });
|
|
239
|
+
const alreadyActive = await readActive(this.projectDir);
|
|
240
|
+
if (alreadyActive && alreadyActive.runId !== this.id && alreadyActive.status === 'running') {
|
|
241
|
+
throw new Error(`project already has an active run: ${alreadyActive.runId}`);
|
|
242
|
+
}
|
|
243
|
+
await applyInvocationInputs(this.projectDir, this.options);
|
|
244
|
+
const existing = await loadArtifacts(this.projectDir);
|
|
245
|
+
if (this.options.resume && ['canceled', 'interrupted', 'cancel_requested'].includes(existing.run?.status)) {
|
|
246
|
+
const resumed = transitionRun(existing.run, { state: 'initialized', activePhase: 'orchestration', status: 'running', needsUserInput: false, needsLlm: false });
|
|
247
|
+
await writeJsonAtomic(path.join(this.projectDir, 'orchestration', 'run.json'), resumed);
|
|
248
|
+
try { await fs.unlink(cancelPath(this.projectDir)); } catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
249
|
+
}
|
|
250
|
+
// Once per supervisor process, before the first loop iteration: a supervisor start is a new
|
|
251
|
+
// execution, so an open telemetry journal records a new session (or joins one opened in the
|
|
252
|
+
// last minute). Never from the loop, the router or `status`. Fail-soft and silent: the
|
|
253
|
+
// result lives only in this run's record, never in the event stream or on screen.
|
|
254
|
+
this.startedAt = iso();
|
|
255
|
+
this.telemetryResume = await resumeStaleTelemetry(this.projectDir);
|
|
256
|
+
await this.recordInvocation();
|
|
257
|
+
await this.writeRecord();
|
|
258
|
+
const persistedTaskState = await readTaskState(this.projectDir);
|
|
259
|
+
this.taskState = persistedTaskState?.runId === this.id ? await reconcileTaskState(this.projectDir, persistedTaskState) : createTaskState(this.id);
|
|
260
|
+
await writeTaskState(this.projectDir, this.taskState);
|
|
261
|
+
await this.emit('started', 'running', 'Supervisor started.', { evidence: { kind: 'process', ref: String(process.pid) } });
|
|
262
|
+
const started = Date.now();
|
|
263
|
+
this.startedAtMs = started;
|
|
264
|
+
let turns = 0;
|
|
265
|
+
let sameRoute = 0;
|
|
266
|
+
let priorRoute = null;
|
|
267
|
+
while (turns <= this.options.maxAgentTurns) {
|
|
268
|
+
const cancellation = await this.cancellationRequested();
|
|
269
|
+
if (cancellation) return this.cancel(cancellation);
|
|
270
|
+
if (this.options.wallTimeoutMs && Date.now() - started > this.options.wallTimeoutMs) {
|
|
271
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'timed_out', nextAction: 'Resume with replatform resume <project> after investigating the timeout.' }));
|
|
272
|
+
}
|
|
273
|
+
const pending = await listUserActions(this.projectDir, { status: 'pending' });
|
|
274
|
+
if (pending.length) {
|
|
275
|
+
const request = await readUserAction(this.projectDir, pending[0].requestId);
|
|
276
|
+
await this.updateTasks((state) => waitForInput(state, request));
|
|
277
|
+
const route = { nextState: 'awaiting_user_action', reason: 'pending_user_action', nextResource: null };
|
|
278
|
+
await this.emit('user_action_requested', 'waiting_for_user', request.prompt, {
|
|
279
|
+
requestId: request.requestId,
|
|
280
|
+
title: request.title,
|
|
281
|
+
userAction: userActionSummary(request),
|
|
282
|
+
evidence: { kind: 'user_action', ref: `orchestration/user-actions/${request.requestId}.json` },
|
|
283
|
+
});
|
|
284
|
+
await this.emit('waiting_for_user', 'waiting_for_user', 'Waiting for a durable user action answer.', { requestId: request.requestId });
|
|
285
|
+
const response = request.response.mode === 'choice'
|
|
286
|
+
? `--choice <${request.choices.map((choice) => choice.id).join('|')}>`
|
|
287
|
+
: request.response.mode === 'text' ? '--text "<answer>"' : '--acknowledge';
|
|
288
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'waiting_for_user', route, request, nextAction: `replatform answer --project ${this.projectDir} --request-id ${request.requestId} ${response} --continue` }));
|
|
289
|
+
}
|
|
290
|
+
const artifacts = await loadArtifacts(this.projectDir);
|
|
291
|
+
const route = await determineNextStep(this.projectDir, artifacts);
|
|
292
|
+
await this.updateTasks((state) => selectRoute(state, route));
|
|
293
|
+
await this.emit('routed', 'running', route.reason, { evidence: { kind: 'router', ref: route.nextResource || route.reason }, route });
|
|
294
|
+
if (!route.ok) return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'failed', route, nextAction: 'Inspect orchestration artifacts and repair the reported validation error.' }));
|
|
295
|
+
if (route.nextState === 'completed') {
|
|
296
|
+
const completionInputs = await loadMigrationCompletionInputs(this.projectDir);
|
|
297
|
+
const completion = validateMigrationCompletion(completionInputs.completion, completionInputs);
|
|
298
|
+
if (completion.ok) return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'completed', route, completion }));
|
|
299
|
+
}
|
|
300
|
+
if (['blocked', 'canceled', 'interrupted', 'cancel_requested'].includes(route.nextState)) {
|
|
301
|
+
const outcome = route.nextState === 'cancel_requested' ? 'interrupted' : route.nextState;
|
|
302
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome, route, nextAction: route.nextState === 'blocked' ? 'Inspect the route reason and satisfy the named prerequisite.' : 'Use replatform resume <project> when ready.' }));
|
|
303
|
+
}
|
|
304
|
+
const routeKey = `${route.nextState}:${route.reason}:${route.nextResource || ''}`;
|
|
305
|
+
sameRoute = routeKey === priorRoute ? sameRoute + 1 : 0;
|
|
306
|
+
priorRoute = routeKey;
|
|
307
|
+
if (sameRoute > this.options.maxNoProgressContinuations) {
|
|
308
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'blocked', route, nextAction: 'The selected stage made no durable progress; inspect its artifacts before resuming.' }));
|
|
309
|
+
}
|
|
310
|
+
if (turns >= this.options.maxAgentTurns) return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'timed_out', route, nextAction: 'Maximum agent turns reached; resume after inspecting artifacts.' }));
|
|
311
|
+
if (!this.adapter) {
|
|
312
|
+
this.adapter = chooseAdapter(this.options.agent, { agentPath: this.options.agentPath });
|
|
313
|
+
if (!this.adapter.ok) return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'failed', route, nextAction: 'Run replatform doctor and authenticate an installed supported agent.' }));
|
|
314
|
+
}
|
|
315
|
+
turns += 1;
|
|
316
|
+
let directAgentId = null;
|
|
317
|
+
this.child = launch(this.adapter.id, { cwd: this.projectDir, executablePath: this.options.agentPath, prompt: bootstrap(this.projectDir), onWorker: async (worker) => {
|
|
318
|
+
let accepted = false;
|
|
319
|
+
await this.updateTasks((state) => { const task = state.tasks.find((item) => item.state === 'running'); accepted = Boolean(task) && recordWorker(state, task.taskId, this.adapter.id, worker); });
|
|
320
|
+
if (!accepted) await this.emit('protocol_error', 'running', 'Ignored malformed agent worker report.', { evidence: { kind: 'adapter_protocol', ref: this.adapter.id } });
|
|
321
|
+
}, onEvent: async (event) => {
|
|
322
|
+
this.lastObservationAt = Date.now();
|
|
323
|
+
if (this.vendorEventsPath && event.type === 'vendor_event') await appendLine(this.vendorEventsPath, event.raw);
|
|
324
|
+
await this.emit(event.type === 'vendor_event' ? 'progress' : 'progress', 'running', 'Observed agent output.', { evidence: { kind: event.type, ref: this.adapter.id } });
|
|
325
|
+
} });
|
|
326
|
+
await this.updateTasks((state) => {
|
|
327
|
+
const task = startRoute(state, route);
|
|
328
|
+
directAgentId = startDirectAgent(state, task, this.adapter.id, this.child.pid).agentId;
|
|
329
|
+
});
|
|
330
|
+
await this.writeRecord({ childPid: this.child.pid, childProcessGroup: this.child.pid });
|
|
331
|
+
await this.emit('agent_started', 'running', `Started ${this.adapter.id} agent turn.`, { evidence: { kind: 'process', ref: String(this.child.pid) } });
|
|
332
|
+
const childDone = this.waitForChild();
|
|
333
|
+
const heartbeat = this.options.statusIntervalMs ? setInterval(async () => {
|
|
334
|
+
const elapsed = Date.now() - this.lastObservationAt;
|
|
335
|
+
if (elapsed >= this.options.statusIntervalMs) await this.emit('heartbeat', 'running', 'Agent process is alive; no newer progress was observed.', { lastObservedAt: new Date(this.lastObservationAt).toISOString(), elapsedSinceObservationMs: elapsed, evidence: { kind: 'process', ref: String(this.child?.pid) } });
|
|
336
|
+
}, Math.max(1000, this.options.statusIntervalMs)) : null;
|
|
337
|
+
let finished = null;
|
|
338
|
+
// A second terminal communicates through the durable request file. Polling that
|
|
339
|
+
// file is intentionally mundane: it works for foreground and detached ownership
|
|
340
|
+
// without introducing a daemon socket or an interactive stdin channel.
|
|
341
|
+
while (!finished) {
|
|
342
|
+
finished = await Promise.race([
|
|
343
|
+
childDone,
|
|
344
|
+
new Promise((resolve) => setTimeout(() => resolve(null), 500)),
|
|
345
|
+
]);
|
|
346
|
+
if (!finished && await this.cancellationRequested()) {
|
|
347
|
+
if (heartbeat) clearInterval(heartbeat);
|
|
348
|
+
return this.cancel(await this.cancellationRequested());
|
|
349
|
+
}
|
|
350
|
+
const wallExpired = this.options.wallTimeoutMs && Date.now() - this.startedAtMs > this.options.wallTimeoutMs;
|
|
351
|
+
const idleExpired = this.options.idleTimeoutMs && Date.now() - this.lastObservationAt > this.options.idleTimeoutMs;
|
|
352
|
+
if (!finished && (wallExpired || idleExpired)) {
|
|
353
|
+
if (heartbeat) clearInterval(heartbeat);
|
|
354
|
+
requestCancel(this.child);
|
|
355
|
+
const stopped = await Promise.race([childDone, new Promise((resolve) => setTimeout(() => resolve(null), this.options.gracePeriodMs))]);
|
|
356
|
+
if (!stopped) {
|
|
357
|
+
try { process.kill(-this.child.pid, 'SIGKILL'); } catch { this.child.kill('SIGKILL'); }
|
|
358
|
+
}
|
|
359
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'timed_out', route, nextAction: wallExpired ? 'The configured wall-clock timeout elapsed; inspect diagnostics and resume.' : 'Agent made no observable progress before the idle timeout; inspect diagnostics and resume.' }));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (heartbeat) clearInterval(heartbeat);
|
|
363
|
+
this.child = null;
|
|
364
|
+
await this.updateTasks((state) => finishDirectAgent(state, directAgentId, finished.code === 0 ? 'completed' : 'failed'));
|
|
365
|
+
if (finished.code !== 0) return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'failed', route, nextAction: `Agent exited with ${finished.code ?? finished.signal}; inspect vendor diagnostics and resume.` }));
|
|
366
|
+
}
|
|
367
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'timed_out' }));
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
async cancel(request) {
|
|
371
|
+
await this.setOrchestrationCancellation('cancel_requested');
|
|
372
|
+
await this.emit('cancel_requested', 'cancel_requested', request.reason || 'Cancellation requested.');
|
|
373
|
+
if (!this.child) {
|
|
374
|
+
await this.setOrchestrationCancellation('canceled');
|
|
375
|
+
await this.emit('canceled', 'canceled', 'Cancellation confirmed; no active child remained.');
|
|
376
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'canceled', nextAction: 'Use replatform resume <project> when ready.' }));
|
|
377
|
+
}
|
|
378
|
+
requestCancel(this.child);
|
|
379
|
+
const grace = request.gracePeriodMs || this.options.gracePeriodMs;
|
|
380
|
+
const done = await Promise.race([this.waitForChild(), new Promise((resolve) => setTimeout(() => resolve(null), grace))]);
|
|
381
|
+
if (done) {
|
|
382
|
+
await this.setOrchestrationCancellation('canceled');
|
|
383
|
+
await this.emit('canceled', 'canceled', 'Agent exited during cancellation grace period.');
|
|
384
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'canceled' }));
|
|
385
|
+
}
|
|
386
|
+
try { process.kill(-this.child.pid, 'SIGKILL'); } catch { this.child.kill('SIGKILL'); }
|
|
387
|
+
await this.setOrchestrationCancellation('interrupted');
|
|
388
|
+
await this.emit('interrupted', 'interrupted', 'Agent required forced termination.');
|
|
389
|
+
return this.finish(makeResult({ id: this.id, projectDir: this.projectDir, outcome: 'interrupted' }));
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
async function requestCancellation(projectDir, { reason = 'canceled by operator', gracePeriodMs = 60000 } = {}) {
|
|
394
|
+
const active = await readActive(projectDir);
|
|
395
|
+
if (!active || active.status !== 'running') throw new Error('no controllable active run exists');
|
|
396
|
+
const request = { schemaVersion: SCHEMA_VERSION, runId: active.runId, requestedAt: iso(), reason, gracePeriodMs };
|
|
397
|
+
await writeJsonAtomic(cancelPath(projectDir), request);
|
|
398
|
+
return { active, request };
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
module.exports = { SCHEMA_VERSION, RunController, runnerDir, activePath, historyPath, defaultEventsPath, readActive, findRun, requestCancellation, applyInvocationInputs, makeResult, exitCode, safeRelative, readJson, userActionSummary };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Every product-SEO stage outcome, in one frozen place that both the SEO stage
|
|
4
|
+
// (rp-target-wix/lib/product-seo.js) and the completion report import, so the stage cannot
|
|
5
|
+
// report a code the report has no line for (the same reason payments-outcome-registry.js exists).
|
|
6
|
+
|
|
7
|
+
// Rows with any of these outcomes keep the run from reporting product SEO complete.
|
|
8
|
+
const SEO_BLOCKING_OUTCOMES = Object.freeze([
|
|
9
|
+
'seo_disposition_required',
|
|
10
|
+
'focus_keywords_disposition_required',
|
|
11
|
+
'canonical_pending_policy',
|
|
12
|
+
'seo_write_unverified',
|
|
13
|
+
'seo_inheritance_unverified',
|
|
14
|
+
'seo_resolution_unverified',
|
|
15
|
+
'seo_conflict',
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
// Owner-dispositioned or owner-kept outcomes. They stay visible in the final report as counts,
|
|
19
|
+
// but they are decisions the owner made, not open work, so they do not block completion.
|
|
20
|
+
const SEO_ACCEPTED_OUTCOMES = Object.freeze([
|
|
21
|
+
'seo_disposition_accepted_gap',
|
|
22
|
+
'seo_materialized',
|
|
23
|
+
'focus_keywords_accepted_gap',
|
|
24
|
+
'seo_conflict_kept_wix',
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
const SEO_OUTCOMES = Object.freeze([...SEO_BLOCKING_OUTCOMES, ...SEO_ACCEPTED_OUTCOMES]);
|
|
28
|
+
|
|
29
|
+
// What the owner or operator does next, per outcome. Rendered by the completion report instead
|
|
30
|
+
// of the generic "re-run the stage" line, because most of these need a decision, not a retry.
|
|
31
|
+
const SEO_OUTCOME_ACTIONS = Object.freeze({
|
|
32
|
+
seo_disposition_required: 'Product SEO is held: the source shows SEO for these products but cannot prove which fields the merchant overrode. Supply the raw Yoast evidence, or choose omit (inherit Wix patterns and record the loss) or materialize (write the rendered title/description as item overrides).',
|
|
33
|
+
focus_keywords_disposition_required: 'Yoast focus keyphrases have no verified Wix product write path. Supply evidence of a verified path later, or accept the loss (omit) for these products.',
|
|
34
|
+
canonical_pending_policy: 'These products carry a canonical URL that is not their own source permalink. It is not written until an approved canonical policy is supplied.',
|
|
35
|
+
seo_write_unverified: 'A product SEO write did not read back as an item override. The next run reconciles that write from its journal and read-back; it is never re-sent blindly.',
|
|
36
|
+
seo_inheritance_unverified: 'A field that should inherit Wix\'s pattern still has an item-level tag. No write happened; the next run re-verifies. The stray tag is removed only through a partial update or when the owner asks.',
|
|
37
|
+
seo_resolution_unverified: 'Wix resolved SEO tags could not be read for these products. The next run re-verifies them.',
|
|
38
|
+
seo_conflict: 'These products changed in Wix since the last import. Choose override (write the source SEO over the Wix edit) or keep (leave the Wix values).',
|
|
39
|
+
seo_disposition_accepted_gap: 'The owner chose omit: these products inherit Wix SEO patterns and the source overrides are an accepted loss.',
|
|
40
|
+
seo_materialized: 'The owner chose materialize: the rendered source title/description were written as item overrides.',
|
|
41
|
+
focus_keywords_accepted_gap: 'The owner accepted the loss of Yoast focus keyphrases for these products.',
|
|
42
|
+
seo_conflict_kept_wix: 'The owner chose to keep the Wix SEO values for these products over the source values.',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
module.exports = { SEO_BLOCKING_OUTCOMES, SEO_ACCEPTED_OUTCOMES, SEO_OUTCOMES, SEO_OUTCOME_ACTIONS };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Shared by execute-setup.js (which writes setup/setup-verification.json and self-checks
|
|
4
|
+
// its own output before publishing it) and orchestration-router.js (which gates on it). A
|
|
5
|
+
// candidate file is trusted only if it passes every check here — schema shape, a genuinely
|
|
6
|
+
// usable plan to compare against, full coverage with no duplicate or missing ids, and a
|
|
7
|
+
// plan-digest match — so a hand-authored, partial, malformed, or stale file can never be
|
|
8
|
+
// mistaken for a genuine success receipt.
|
|
9
|
+
|
|
10
|
+
const SCHEMA_VERSION = 1;
|
|
11
|
+
const fs = require('node:fs');
|
|
12
|
+
const path = require('node:path');
|
|
13
|
+
let reviewedReferencePaths;
|
|
14
|
+
function knownReferencePath(ref, targetPath) {
|
|
15
|
+
if (!reviewedReferencePaths) {
|
|
16
|
+
reviewedReferencePaths = new Map(); const root = path.join(__dirname, '../resources/rp-target-wix/domains');
|
|
17
|
+
for (const domain of fs.readdirSync(root, { withFileTypes: true }).filter(entry => entry.isDirectory())) {
|
|
18
|
+
const entities = path.join(root, domain.name, 'entities'); if (!fs.existsSync(entities)) continue;
|
|
19
|
+
for (const file of fs.readdirSync(entities).filter(file => file.endsWith('.json'))) { const definition = JSON.parse(fs.readFileSync(path.join(entities, file))); for (const [dependencyRef, paths] of Object.entries(definition.dependencyReferenceFields || {})) { if (!reviewedReferencePaths.has(dependencyRef)) reviewedReferencePaths.set(dependencyRef, new Set()); for (const value of paths) reviewedReferencePaths.get(dependencyRef).add(value); } }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return reviewedReferencePaths.get(ref)?.has(targetPath) === true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Collects each item's `id`, flagging (via callbacks, not thrown errors — callers decide how
|
|
26
|
+
// severe a given issue is) any item with a missing/non-string id or a duplicate of an id
|
|
27
|
+
// already seen. Duplicate ids are dropped from the returned list entirely, never silently
|
|
28
|
+
// treated as "one occurrence satisfies both".
|
|
29
|
+
function normalizeIds(items, { onMissing, onDuplicate }) {
|
|
30
|
+
const ids = [];
|
|
31
|
+
const seen = new Set();
|
|
32
|
+
for (const item of items) {
|
|
33
|
+
const id = item && item.id;
|
|
34
|
+
if (!id || typeof id !== 'string') {
|
|
35
|
+
onMissing(item);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (seen.has(id)) {
|
|
39
|
+
onDuplicate(id);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
seen.add(id);
|
|
43
|
+
ids.push(id);
|
|
44
|
+
}
|
|
45
|
+
return ids;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// A plan with no genuinely usable `steps` array (missing entirely, not an array, or the
|
|
49
|
+
// plan itself isn't an object) can never be treated as "zero requirements" — that would let
|
|
50
|
+
// a malformed plan vacuously satisfy an empty receipt. Reject it outright instead.
|
|
51
|
+
function validatePlanShape(plan) {
|
|
52
|
+
if (!plan || typeof plan !== 'object' || !Array.isArray(plan.steps)) {
|
|
53
|
+
return { ok: false, reasons: ['plan_missing_or_invalid'], stepIds: [] };
|
|
54
|
+
}
|
|
55
|
+
const reasons = [];
|
|
56
|
+
if (plan.schemaVersion !== SCHEMA_VERSION) reasons.push('plan_schema_version_mismatch');
|
|
57
|
+
const stepIds = normalizeIds(plan.steps, {
|
|
58
|
+
onMissing: () => reasons.push('plan_step_missing_id'),
|
|
59
|
+
onDuplicate: (id) => reasons.push(`plan_duplicate_step_id:${id}`),
|
|
60
|
+
});
|
|
61
|
+
const allKeys = new Set();
|
|
62
|
+
for (const step of plan.steps) for (const key of step.referenceKeys || []) for (const targetPath of key.paths || []) { const identity = key.ref + ':' + key.sourceStableKey + ':' + targetPath; if (!(step.entityRefs || []).includes(key.ref) || !knownReferencePath(key.ref, targetPath) || allKeys.has(identity)) reasons.push('plan_reference_invalid:' + step.id); allKeys.add(identity); }
|
|
63
|
+
return { ok: reasons.length === 0, reasons, stepIds };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// `rp-execute-setup/scripts/execute-setup.js` reads requirements at every
|
|
67
|
+
// consumer as `Array.isArray(x) ? x : x?.requirements`, so exactly two shapes are usable: a
|
|
68
|
+
// bare array, or a non-array object whose `requirements` is an array. Anything else (an
|
|
69
|
+
// object carrying only `items`, or neither key) is one the executor silently treats as "no
|
|
70
|
+
// requirements"; the router blocks it instead. `schemaVersion` is not read.
|
|
71
|
+
function validateSetupRequirementsShape(value) {
|
|
72
|
+
if (Array.isArray(value)) return { ok: true, errors: [] };
|
|
73
|
+
if (value && typeof value === 'object' && Array.isArray(value.requirements)) return { ok: true, errors: [] };
|
|
74
|
+
return { ok: false, errors: ['setup requirements must be an array or an object with a requirements array'] };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function validateSetupVerification({ verification, plan, planDigest, siteId }) {
|
|
78
|
+
if (!verification || typeof verification !== 'object') {
|
|
79
|
+
return { ok: false, reasons: ['missing_or_invalid_verification'] };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const reasons = [];
|
|
83
|
+
if (siteId && !verification.siteId) reasons.push('site_id_missing');
|
|
84
|
+
else if (siteId && verification.siteId !== siteId) reasons.push('site_id_mismatch');
|
|
85
|
+
|
|
86
|
+
if (verification.schemaVersion !== SCHEMA_VERSION) {
|
|
87
|
+
reasons.push('schema_version_mismatch');
|
|
88
|
+
}
|
|
89
|
+
if (!Array.isArray(verification.requirements)) {
|
|
90
|
+
return { ok: false, reasons: [...reasons, 'missing_requirements_array'] };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const planShape = validatePlanShape(plan);
|
|
94
|
+
if (planShape.reasons.includes('plan_missing_or_invalid')) {
|
|
95
|
+
// No usable plan to compare coverage against at all — never fall back to "nothing was
|
|
96
|
+
// required, so an empty receipt counts as full coverage".
|
|
97
|
+
return { ok: false, reasons: [...reasons, ...planShape.reasons] };
|
|
98
|
+
}
|
|
99
|
+
reasons.push(...planShape.reasons);
|
|
100
|
+
|
|
101
|
+
const nonPassed = verification.requirements.filter((requirement) => !requirement || requirement.status !== 'passed');
|
|
102
|
+
for (const requirement of nonPassed) {
|
|
103
|
+
reasons.push(`non_passed_requirement:${(requirement && requirement.id) || 'unknown'}`);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const verifiedIds = normalizeIds(verification.requirements, {
|
|
107
|
+
onMissing: () => reasons.push('verification_requirement_missing_id'),
|
|
108
|
+
onDuplicate: (id) => reasons.push(`duplicate_verification_requirement:${id}`),
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const planIdSet = new Set(planShape.stepIds);
|
|
112
|
+
const verifiedIdSet = new Set(verifiedIds);
|
|
113
|
+
for (const id of planIdSet) {
|
|
114
|
+
if (!verifiedIdSet.has(id)) reasons.push(`missing_requirement:${id}`);
|
|
115
|
+
}
|
|
116
|
+
for (const id of verifiedIdSet) {
|
|
117
|
+
if (!planIdSet.has(id)) reasons.push(`unexpected_requirement:${id}`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!planDigest) {
|
|
121
|
+
reasons.push('plan_digest_unavailable');
|
|
122
|
+
} else if (verification.planDigest !== planDigest) {
|
|
123
|
+
reasons.push('plan_digest_mismatch');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
for (const step of plan.steps) {
|
|
127
|
+
const requirement = verification.requirements.find(row => row.id === step.id);
|
|
128
|
+
reasons.push(...validateReferenceBindings(step, requirement?.referenceBindings));
|
|
129
|
+
}
|
|
130
|
+
return { ok: reasons.length === 0, reasons };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function validateReferenceBindings(step, bindings) {
|
|
134
|
+
const declarations = step.referenceKeys || [], errors = [], seen = new Set();
|
|
135
|
+
if (!Array.isArray(declarations) || bindings !== undefined && !Array.isArray(bindings)) return ['setup_reference_shape_invalid'];
|
|
136
|
+
for (const declaration of declarations) {
|
|
137
|
+
if (!(step.entityRefs || []).includes(declaration.ref) || !declaration.sourceStableKey || !Array.isArray(declaration.paths) || !declaration.paths.length || new Set(declaration.paths).size !== declaration.paths.length) errors.push('setup_reference_declaration_invalid:' + step.id);
|
|
138
|
+
const matches = (bindings || []).filter(row => row.ref === declaration.ref && row.sourceStableKey === declaration.sourceStableKey);
|
|
139
|
+
if (matches.length !== 1) { errors.push('setup_reference_coverage:' + step.id); continue; }
|
|
140
|
+
const row = matches[0];
|
|
141
|
+
if (typeof row.targetId !== 'string' || !row.targetId || !row.values || JSON.stringify(Object.keys(row.values).sort()) !== JSON.stringify([...declaration.paths].sort()) || Object.values(row.values).some(value => typeof value !== 'string' || !value)) errors.push('setup_reference_values_invalid:' + step.id);
|
|
142
|
+
for (const targetPath of declaration.paths) { if (!knownReferencePath(declaration.ref, targetPath)) errors.push('setup_reference_path_unknown:' + step.id); const key = declaration.ref + ':' + declaration.sourceStableKey + ':' + targetPath; if (seen.has(key)) errors.push('setup_reference_duplicate:' + step.id); seen.add(key); }
|
|
143
|
+
}
|
|
144
|
+
for (const binding of bindings || []) if (!declarations.some(row => row.ref === binding.ref && row.sourceStableKey === binding.sourceStableKey)) errors.push('setup_reference_unexpected:' + step.id);
|
|
145
|
+
return errors;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
module.exports = { validateReferenceBindings, SCHEMA_VERSION, validatePlanShape, validateSetupRequirementsShape, validateSetupVerification };
|