@open-mercato/cli 0.9.1-develop.7575.1.8480826a9b → 0.10.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/.turbo/turbo-build.log +16 -2
- package/build.mjs +1 -0
- package/dist/agentic/claude-code/mcp.json.example +5 -1
- package/dist/agentic/codex/mcp.json.example +3 -0
- package/dist/agentic/cursor/mcp.json.example +4 -1
- package/dist/agentic/github-copilot/mcp.json.example +5 -1
- package/dist/agentic/guides/ai-workflows.md +1 -0
- package/dist/agentic/guides/architecture.md +9 -5
- package/dist/agentic/guides/customers-calendar.md +57 -0
- package/dist/agentic/guides/extensions.md +2 -0
- package/dist/agentic/guides/module-facts.json +25282 -6677
- package/dist/agentic/guides/module-facts.v2.json +25371 -6677
- package/dist/agentic/guides/module-tool.md +56 -0
- package/dist/agentic/guides/modules/agent_orchestrator/acl-features.md +2 -1
- package/dist/agentic/guides/modules/agent_orchestrator/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/agent_orchestrator/backend-pages.md +3 -0
- package/dist/agentic/guides/modules/agent_orchestrator/cli-commands.md +4 -0
- package/dist/agentic/guides/modules/agent_orchestrator/contribution-resolutions.md +6 -0
- package/dist/agentic/guides/modules/agent_orchestrator/di-registrations-rich.md +32 -32
- package/dist/agentic/guides/modules/agent_orchestrator/di-service-tokens.md +14 -14
- package/dist/agentic/guides/modules/agent_orchestrator/domain-commands.md +3 -0
- package/dist/agentic/guides/modules/agent_orchestrator/events.md +30 -29
- package/dist/agentic/guides/modules/agent_orchestrator/exact-override-targets.md +104 -35
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +17 -6
- package/dist/agentic/guides/modules/agent_orchestrator/setup.md +1 -1
- package/dist/agentic/guides/modules/agent_orchestrator/umes-contributions.md +6 -0
- package/dist/agentic/guides/modules/agent_orchestrator/umes-hosts.md +2 -1
- package/dist/agentic/guides/modules/agent_orchestrator/workers.md +2 -0
- package/dist/agentic/guides/modules/ai_assistant/acl-features.md +4 -1
- package/dist/agentic/guides/modules/ai_assistant/ai-tools-mcp-capabilities.md +1 -0
- package/dist/agentic/guides/modules/ai_assistant/backend-pages.md +4 -0
- package/dist/agentic/guides/modules/ai_assistant/cli-commands.md +1 -0
- package/dist/agentic/guides/modules/ai_assistant/contribution-resolutions.md +3 -0
- package/dist/agentic/guides/modules/ai_assistant/di-registrations-rich.md +5 -3
- package/dist/agentic/guides/modules/ai_assistant/di-service-tokens.md +4 -2
- package/dist/agentic/guides/modules/ai_assistant/encryption.md +3 -0
- package/dist/agentic/guides/modules/ai_assistant/entities.md +3 -0
- package/dist/agentic/guides/modules/ai_assistant/events.md +9 -8
- package/dist/agentic/guides/modules/ai_assistant/exact-override-targets.md +23 -6
- package/dist/agentic/guides/modules/ai_assistant/index.md +9 -9
- package/dist/agentic/guides/modules/ai_assistant/notifications.md +1 -0
- package/dist/agentic/guides/modules/ai_assistant/setup.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/umes-contributions.md +3 -0
- package/dist/agentic/guides/modules/ai_assistant/umes-hosts.md +4 -0
- package/dist/agentic/guides/modules/ai_assistant/workers.md +2 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/attachments/ai-tools-mcp-capabilities.md +11 -0
- package/dist/agentic/guides/modules/attachments/backend-pages.md +1 -0
- package/dist/agentic/guides/modules/attachments/cli-commands.md +1 -0
- package/dist/agentic/guides/modules/attachments/contribution-resolutions.md +13 -0
- package/dist/agentic/guides/modules/attachments/di-registrations-rich.md +6 -6
- package/dist/agentic/guides/modules/attachments/di-service-tokens.md +5 -5
- package/dist/agentic/guides/modules/attachments/domain-commands.md +11 -0
- package/dist/agentic/guides/modules/attachments/encryption.md +12 -0
- package/dist/agentic/guides/modules/attachments/entities.md +2 -0
- package/dist/agentic/guides/modules/attachments/events.md +3 -3
- package/dist/agentic/guides/modules/attachments/exact-override-targets.md +17 -7
- package/dist/agentic/guides/modules/attachments/generator-plugins.md +11 -0
- package/dist/agentic/guides/modules/attachments/index.md +13 -5
- package/dist/agentic/guides/modules/attachments/search-entities.md +11 -0
- package/dist/agentic/guides/modules/attachments/setup.md +1 -1
- package/dist/agentic/guides/modules/attachments/umes-contributions.md +13 -0
- package/dist/agentic/guides/modules/attachments/umes-hosts.md +4 -0
- package/dist/agentic/guides/modules/attachments/workers.md +2 -0
- package/dist/agentic/guides/modules/audit_logs/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/audit_logs/incoming-installed-contributions.md +12 -0
- package/dist/agentic/guides/modules/audit_logs/index.md +4 -2
- package/dist/agentic/guides/modules/auth/events.md +12 -12
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/events.md +3 -3
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/events.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/acl-features.md +12 -0
- package/dist/agentic/guides/modules/carrier_inpost/contribution-resolutions.md +13 -0
- package/dist/agentic/guides/modules/carrier_inpost/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/carrier_inpost/exact-override-targets.md +16 -0
- package/dist/agentic/guides/modules/carrier_inpost/index.md +18 -0
- package/dist/agentic/guides/modules/carrier_inpost/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/carrier_inpost/setup.md +11 -0
- package/dist/agentic/guides/modules/carrier_inpost/umes-contributions.md +13 -0
- package/dist/agentic/guides/modules/cart/acl-features.md +19 -0
- package/dist/agentic/guides/modules/cart/contribution-resolutions.md +24 -0
- package/dist/agentic/guides/modules/cart/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/cart/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/cart/domain-commands.md +24 -0
- package/dist/agentic/guides/modules/cart/encryption.md +11 -0
- package/dist/agentic/guides/modules/cart/entities.md +15 -0
- package/dist/agentic/guides/modules/cart/events.md +35 -0
- package/dist/agentic/guides/modules/cart/exact-override-targets.md +27 -0
- package/dist/agentic/guides/modules/cart/index.md +25 -0
- package/dist/agentic/guides/modules/cart/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/cart/setup.md +11 -0
- package/dist/agentic/guides/modules/cart/umes-contributions.md +24 -0
- package/dist/agentic/guides/modules/cart/umes-hosts.md +40 -0
- package/dist/agentic/guides/modules/cart/workers.md +14 -0
- package/dist/agentic/guides/modules/catalog/acl-features.md +3 -1
- package/dist/agentic/guides/modules/catalog/active-extension-bindings.md +3 -3
- package/dist/agentic/guides/modules/catalog/cli-commands.md +1 -0
- package/dist/agentic/guides/modules/catalog/contribution-resolutions.md +2 -0
- package/dist/agentic/guides/modules/catalog/di-registrations-rich.md +7 -4
- package/dist/agentic/guides/modules/catalog/di-service-tokens.md +4 -1
- package/dist/agentic/guides/modules/catalog/entities.md +1 -0
- package/dist/agentic/guides/modules/catalog/events.md +18 -18
- package/dist/agentic/guides/modules/catalog/exact-override-targets.md +12 -4
- package/dist/agentic/guides/modules/catalog/index.md +6 -6
- package/dist/agentic/guides/modules/catalog/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/catalog/umes-contributions.md +2 -0
- package/dist/agentic/guides/modules/catalog/umes-hosts.md +1 -0
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/channel_smtp/acl-features.md +12 -0
- package/dist/agentic/guides/modules/channel_smtp/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/channel_smtp/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/channel_smtp/exact-override-targets.md +16 -0
- package/dist/agentic/guides/modules/channel_smtp/index.md +18 -0
- package/dist/agentic/guides/modules/channel_smtp/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/channel_smtp/setup.md +11 -0
- package/dist/agentic/guides/modules/channel_smtp/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/checkout/events.md +16 -16
- package/dist/agentic/guides/modules/checkout/exact-override-targets.md +5 -4
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/setup.md +1 -1
- package/dist/agentic/guides/modules/checkout/workers.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/events.md +17 -17
- package/dist/agentic/guides/modules/communication_channels/exact-override-targets.md +5 -4
- package/dist/agentic/guides/modules/communication_channels/index.md +2 -2
- package/dist/agentic/guides/modules/communication_channels/setup.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/workers.md +2 -2
- package/dist/agentic/guides/modules/configs/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/currencies/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/currencies/events.md +6 -6
- package/dist/agentic/guides/modules/currencies/exact-override-targets.md +1 -0
- package/dist/agentic/guides/modules/currencies/index.md +4 -2
- package/dist/agentic/guides/modules/customer_accounts/active-extension-bindings.md +1 -0
- package/dist/agentic/guides/modules/customer_accounts/contribution-resolutions.md +2 -2
- package/dist/agentic/guides/modules/customer_accounts/domain-commands.md +11 -0
- package/dist/agentic/guides/modules/customer_accounts/events.md +27 -26
- package/dist/agentic/guides/modules/customer_accounts/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/incoming-installed-contributions.md +13 -0
- package/dist/agentic/guides/modules/customer_accounts/index.md +6 -4
- package/dist/agentic/guides/modules/customer_accounts/umes-contributions.md +2 -2
- package/dist/agentic/guides/modules/customer_accounts/umes-hosts.md +1 -0
- package/dist/agentic/guides/modules/customer_groups/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/contribution-resolutions.md +2 -2
- package/dist/agentic/guides/modules/customer_groups/events.md +7 -7
- package/dist/agentic/guides/modules/customer_groups/incoming-installed-contributions.md +11 -0
- package/dist/agentic/guides/modules/customer_groups/index.md +3 -2
- package/dist/agentic/guides/modules/customer_groups/umes-contributions.md +2 -2
- package/dist/agentic/guides/modules/customers/active-extension-bindings.md +12 -13
- package/dist/agentic/guides/modules/customers/di-registrations-rich.md +6 -3
- package/dist/agentic/guides/modules/customers/encryption.md +1 -1
- package/dist/agentic/guides/modules/customers/events.md +51 -51
- package/dist/agentic/guides/modules/customers/exact-override-targets.md +6 -3
- package/dist/agentic/guides/modules/customers/incoming-installed-contributions.md +12 -8
- package/dist/agentic/guides/modules/customers/index.md +12 -4
- package/dist/agentic/guides/modules/customers/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/customers/umes-hosts.md +48 -0
- package/dist/agentic/guides/modules/dashboards/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/di-registrations-rich.md +8 -8
- package/dist/agentic/guides/modules/data_sync/di-service-tokens.md +4 -4
- package/dist/agentic/guides/modules/data_sync/events.md +4 -4
- package/dist/agentic/guides/modules/data_sync/exact-override-targets.md +8 -8
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/events.md +5 -5
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/events.md +3 -3
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/directory/contribution-resolutions.md +1 -0
- package/dist/agentic/guides/modules/directory/events.md +6 -6
- package/dist/agentic/guides/modules/directory/exact-override-targets.md +1 -0
- package/dist/agentic/guides/modules/directory/incoming-installed-contributions.md +4 -0
- package/dist/agentic/guides/modules/directory/index.md +2 -2
- package/dist/agentic/guides/modules/directory/umes-contributions.md +1 -0
- package/dist/agentic/guides/modules/documents/contribution-resolutions.md +3 -3
- package/dist/agentic/guides/modules/documents/events.md +15 -15
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/documents/umes-contributions.md +5 -5
- package/dist/agentic/guides/modules/ecommerce/acl-features.md +15 -0
- package/dist/agentic/guides/modules/ecommerce/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/ecommerce/backend-pages.md +12 -0
- package/dist/agentic/guides/modules/ecommerce/contribution-resolutions.md +33 -0
- package/dist/agentic/guides/modules/ecommerce/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/ecommerce/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/ecommerce/entities.md +13 -0
- package/dist/agentic/guides/modules/ecommerce/events.md +22 -0
- package/dist/agentic/guides/modules/ecommerce/exact-override-targets.md +42 -0
- package/dist/agentic/guides/modules/ecommerce/index.md +26 -0
- package/dist/agentic/guides/modules/ecommerce/notifications.md +12 -0
- package/dist/agentic/guides/modules/ecommerce/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/ecommerce/search-entities.md +11 -0
- package/dist/agentic/guides/modules/ecommerce/setup.md +11 -0
- package/dist/agentic/guides/modules/ecommerce/umes-contributions.md +33 -0
- package/dist/agentic/guides/modules/ecommerce/umes-hosts.md +27 -0
- package/dist/agentic/guides/modules/entities/contribution-resolutions.md +14 -0
- package/dist/agentic/guides/modules/entities/exact-override-targets.md +4 -0
- package/dist/agentic/guides/modules/entities/index.md +5 -3
- package/dist/agentic/guides/modules/entities/umes-contributions.md +14 -0
- package/dist/agentic/guides/modules/eudr/events.md +23 -23
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/events.md +18 -18
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/forms/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/acl-features.md +12 -0
- package/dist/agentic/guides/modules/gateway_autopay/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/gateway_autopay/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/gateway_autopay/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/gateway_autopay/exact-override-targets.md +17 -0
- package/dist/agentic/guides/modules/gateway_autopay/index.md +19 -0
- package/dist/agentic/guides/modules/gateway_autopay/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/gateway_autopay/setup.md +11 -0
- package/dist/agentic/guides/modules/gateway_autopay/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/gateway_stripe/di-registrations-rich.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/acl-features.md +12 -0
- package/dist/agentic/guides/modules/gateway_tpay/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/gateway_tpay/contribution-resolutions.md +13 -0
- package/dist/agentic/guides/modules/gateway_tpay/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/gateway_tpay/exact-override-targets.md +20 -0
- package/dist/agentic/guides/modules/gateway_tpay/index.md +20 -0
- package/dist/agentic/guides/modules/gateway_tpay/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/gateway_tpay/setup.md +11 -0
- package/dist/agentic/guides/modules/gateway_tpay/umes-contributions.md +13 -0
- package/dist/agentic/guides/modules/gateway_tpay/workers.md +11 -0
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/events.md +13 -13
- package/dist/agentic/guides/modules/inbox_ops/index.md +2 -2
- package/dist/agentic/guides/modules/integrations/di-registrations-rich.md +9 -8
- package/dist/agentic/guides/modules/integrations/di-service-tokens.md +5 -4
- package/dist/agentic/guides/modules/integrations/events.md +4 -4
- package/dist/agentic/guides/modules/integrations/exact-override-targets.md +12 -10
- package/dist/agentic/guides/modules/integrations/incoming-installed-contributions.md +11 -0
- package/dist/agentic/guides/modules/integrations/index.md +3 -2
- package/dist/agentic/guides/modules/integrations/setup.md +1 -1
- package/dist/agentic/guides/modules/messages/entities.md +2 -0
- package/dist/agentic/guides/modules/messages/events.md +9 -9
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/messages/umes-hosts.md +2 -0
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/di-registrations-rich.md +4 -4
- package/dist/agentic/guides/modules/payment_gateways/di-service-tokens.md +2 -2
- package/dist/agentic/guides/modules/payment_gateways/events.md +9 -9
- package/dist/agentic/guides/modules/payment_gateways/exact-override-targets.md +5 -4
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/setup.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/events.md +3 -3
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/planner/events.md +6 -6
- package/dist/agentic/guides/modules/planner/exact-override-targets.md +3 -3
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/planner/setup.md +1 -1
- package/dist/agentic/guides/modules/portal/exact-override-targets.md +1 -0
- package/dist/agentic/guides/modules/portal/frontend-pages.md +1 -0
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/portal/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/progress/events.md +6 -6
- package/dist/agentic/guides/modules/progress/index.md +2 -2
- package/dist/agentic/guides/modules/promotions/acl-features.md +18 -0
- package/dist/agentic/guides/modules/promotions/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/promotions/backend-pages.md +16 -0
- package/dist/agentic/guides/modules/promotions/contribution-resolutions.md +18 -0
- package/dist/agentic/guides/modules/promotions/di-registrations-rich.md +15 -0
- package/dist/agentic/guides/modules/promotions/di-service-tokens.md +15 -0
- package/dist/agentic/guides/modules/promotions/domain-commands.md +23 -0
- package/dist/agentic/guides/modules/promotions/entities.md +19 -0
- package/dist/agentic/guides/modules/promotions/events.md +24 -0
- package/dist/agentic/guides/modules/promotions/exact-override-targets.md +41 -0
- package/dist/agentic/guides/modules/promotions/index.md +26 -0
- package/dist/agentic/guides/modules/promotions/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/promotions/setup.md +11 -0
- package/dist/agentic/guides/modules/promotions/umes-contributions.md +18 -0
- package/dist/agentic/guides/modules/promotions/umes-hosts.md +33 -0
- package/dist/agentic/guides/modules/promotions/workers.md +12 -0
- package/dist/agentic/guides/modules/push_notifications/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/push_notifications/events.md +2 -2
- package/dist/agentic/guides/modules/push_notifications/index.md +3 -2
- package/dist/agentic/guides/modules/query_index/events.md +8 -8
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/events.md +10 -10
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/events.md +15 -15
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/active-extension-bindings.md +5 -0
- package/dist/agentic/guides/modules/sales/di-registrations-rich.md +30 -30
- package/dist/agentic/guides/modules/sales/di-service-tokens.md +5 -5
- package/dist/agentic/guides/modules/sales/domain-commands.md +1 -0
- package/dist/agentic/guides/modules/sales/events.md +44 -44
- package/dist/agentic/guides/modules/sales/exact-override-targets.md +30 -30
- package/dist/agentic/guides/modules/sales/incoming-installed-contributions.md +3 -1
- package/dist/agentic/guides/modules/sales/index.md +4 -4
- package/dist/agentic/guides/modules/sales/umes-hosts.md +5 -2
- package/dist/agentic/guides/modules/scheduler/events.md +4 -4
- package/dist/agentic/guides/modules/scheduler/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/workers.md +1 -1
- package/dist/agentic/guides/modules/search/events.md +1 -1
- package/dist/agentic/guides/modules/search/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/search/workers.md +1 -1
- package/dist/agentic/guides/modules/security/contribution-resolutions.md +2 -0
- package/dist/agentic/guides/modules/security/events.md +22 -21
- package/dist/agentic/guides/modules/security/exact-override-targets.md +2 -0
- package/dist/agentic/guides/modules/security/index.md +2 -2
- package/dist/agentic/guides/modules/security/notifications.md +1 -0
- package/dist/agentic/guides/modules/security/umes-contributions.md +2 -0
- package/dist/agentic/guides/modules/security/umes-hosts.md +1 -0
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/contribution-resolutions.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/events.md +7 -7
- package/dist/agentic/guides/modules/shipping_carriers/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/umes-contributions.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/workers.md +1 -1
- package/dist/agentic/guides/modules/sso/di-registrations-rich.md +8 -7
- package/dist/agentic/guides/modules/sso/di-service-tokens.md +7 -6
- package/dist/agentic/guides/modules/sso/events.md +12 -12
- package/dist/agentic/guides/modules/sso/exact-override-targets.md +8 -7
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/active-extension-bindings.md +5 -3
- package/dist/agentic/guides/modules/staff/backend-pages.md +1 -0
- package/dist/agentic/guides/modules/staff/cli-commands.md +1 -0
- package/dist/agentic/guides/modules/staff/contribution-resolutions.md +23 -0
- package/dist/agentic/guides/modules/staff/di-registrations-rich.md +8 -8
- package/dist/agentic/guides/modules/staff/domain-commands.md +2 -0
- package/dist/agentic/guides/modules/staff/encryption.md +1 -0
- package/dist/agentic/guides/modules/staff/entities.md +3 -0
- package/dist/agentic/guides/modules/staff/events.md +75 -70
- package/dist/agentic/guides/modules/staff/exact-override-targets.md +99 -12
- package/dist/agentic/guides/modules/staff/frontend-pages.md +3 -0
- package/dist/agentic/guides/modules/staff/index.md +26 -13
- package/dist/agentic/guides/modules/staff/notifications.md +4 -0
- package/dist/agentic/guides/modules/staff/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/staff/setup.md +1 -1
- package/dist/agentic/guides/modules/staff/umes-contributions.md +24 -1
- package/dist/agentic/guides/modules/staff/umes-hosts.md +9 -0
- package/dist/agentic/guides/modules/storage_s3/di-registrations-rich.md +3 -3
- package/dist/agentic/guides/modules/storage_s3/di-service-tokens.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/exact-override-targets.md +3 -3
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/active-extension-bindings.md +1 -1
- package/dist/agentic/guides/modules/translations/events.md +2 -2
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/contribution-resolutions.md +2 -2
- package/dist/agentic/guides/modules/warranty_claims/events.md +14 -14
- package/dist/agentic/guides/modules/warranty_claims/exact-override-targets.md +5 -4
- package/dist/agentic/guides/modules/warranty_claims/index.md +2 -2
- package/dist/agentic/guides/modules/warranty_claims/setup.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/umes-contributions.md +2 -2
- package/dist/agentic/guides/modules/warranty_claims/workers.md +1 -1
- package/dist/agentic/guides/modules/webhooks/events.md +12 -12
- package/dist/agentic/guides/modules/webhooks/exact-override-targets.md +2 -2
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/workers.md +2 -2
- package/dist/agentic/guides/modules/wms/acl-features.md +3 -1
- package/dist/agentic/guides/modules/wms/backend-pages.md +4 -0
- package/dist/agentic/guides/modules/wms/contribution-resolutions.md +7 -1
- package/dist/agentic/guides/modules/wms/custom-entities.md +3 -0
- package/dist/agentic/guides/modules/wms/domain-commands.md +16 -0
- package/dist/agentic/guides/modules/wms/entities.md +3 -0
- package/dist/agentic/guides/modules/wms/events.md +40 -28
- package/dist/agentic/guides/modules/wms/exact-override-targets.md +10 -0
- package/dist/agentic/guides/modules/wms/host-extension-points.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +14 -10
- package/dist/agentic/guides/modules/wms/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/wms/search-entities.md +2 -0
- package/dist/agentic/guides/modules/wms/umes-contributions.md +7 -1
- package/dist/agentic/guides/modules/wms/umes-diagnostics.md +2 -0
- package/dist/agentic/guides/modules/wms/umes-hosts.md +54 -0
- package/dist/agentic/guides/modules/workflows/contribution-resolutions.md +3 -3
- package/dist/agentic/guides/modules/workflows/events.md +32 -32
- package/dist/agentic/guides/modules/workflows/exact-override-targets.md +2 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/workflows/setup.md +1 -1
- package/dist/agentic/guides/modules/workflows/umes-contributions.md +3 -3
- package/dist/agentic/guides/production-deployment.md +82 -0
- package/dist/agentic/guides/reference-module-facts.json +819 -33
- package/dist/agentic/guides/reference-modules/example/active-extension-bindings.md +2 -0
- package/dist/agentic/guides/reference-modules/example/contribution-resolutions.md +15 -4
- package/dist/agentic/guides/reference-modules/example/di-registrations-rich.md +3 -2
- package/dist/agentic/guides/reference-modules/example/di-service-tokens.md +1 -1
- package/dist/agentic/guides/reference-modules/example/events.md +5 -5
- package/dist/agentic/guides/reference-modules/example/exact-override-targets.md +21 -11
- package/dist/agentic/guides/reference-modules/example/index.md +4 -4
- package/dist/agentic/guides/reference-modules/example/setup.md +1 -1
- package/dist/agentic/guides/reference-modules/example/umes-contributions.md +16 -5
- package/dist/agentic/guides/reference-modules/example/umes-hosts.md +1 -0
- package/dist/agentic/guides/template-tool.md +38 -0
- package/dist/agentic/guides/testing-debugging.md +2 -2
- package/dist/agentic/guides/upstream/AGENTS.md +3 -3
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +343 -206
- package/dist/agentic/guides/upstream/manifest.json +3 -3
- package/dist/agentic/shared/AGENTS.md.template +16 -10
- package/dist/agentic/shared/ai/harness/README.md +10 -2
- package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
- package/dist/agentic/shared/ai/harness/cases.json +639 -44
- package/dist/agentic/shared/ai/harness/cases.schema.json +4 -4
- package/dist/agentic/shared/ai/harness/design-system-inventory.json +63 -3
- package/dist/agentic/shared/ai/harness/source-link-inventory.json +516 -8
- package/dist/agentic/shared/ai/harness/validators.json +1 -1
- package/dist/agentic/shared/ai/qa/tests/playwright.config.ts +1 -0
- package/dist/agentic/shared/ai/skills/om-auto-upgrade-0.9.0-to-0.10.0/SKILL.md +269 -0
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/SKILL.md +6 -5
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/surface-selector.md +27 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/integrity-and-concurrency.md +1 -1
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/sensitive-data.md +13 -1
- package/dist/agentic/shared/ai/skills/om-find-module/SKILL.md +52 -0
- package/dist/agentic/shared/ai/skills/om-help/references/task-families.md +1 -0
- package/dist/agentic/shared/ai/skills/om-implement-spec/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +1 -1
- package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +2 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/api-and-domain.md +7 -5
- package/dist/agentic/shared/ai/skills/om-setup-ci/SKILL.md +42 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/scripts/setup-ci.mjs +525 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/scripts/verify-semgrep-rules.mjs +54 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/docs/README.md +463 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/actions/gitleaks/action.yml +25 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/actions/playwright/action.yml +31 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/actions/setup/action.yml +55 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/dependabot.yml +27 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/workflows/audit.yml +193 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/workflows/ci.yml +477 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/workflows/codeql.yml +63 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/github/workflows/security.yml +254 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/scripts/ci/audit-ci-allowlist.json +4 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/scripts/ci/audit-ci.mjs +283 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/scripts/ci/semgrep/open-mercato.fixture.txt +89 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/scripts/ci/semgrep/open-mercato.yml +146 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/scripts/ci/time-bomb-scanner.mjs +286 -0
- package/dist/agentic/shared/ai/skills/om-setup-ci/templates/scripts/ci/zap-rules.tsv +11 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +1 -1
- package/dist/agentic/shared/ai/skills/tiers.json +5 -2
- package/dist/agentic/shared/ai/trackers/github.md +314 -44
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +78 -9
- package/dist/agentic/shared/scripts/execution-sandbox.mjs +9 -7
- package/dist/agentic/shared/scripts/run-agent-harness-release.mjs +3 -3
- package/dist/bin.js +2 -0
- package/dist/bin.js.map +2 -2
- package/dist/i18n/de.json +4 -0
- package/dist/i18n/en.json +4 -0
- package/dist/i18n/es.json +4 -0
- package/dist/i18n/ko.json +4 -0
- package/dist/i18n/pl.json +4 -0
- package/dist/lib/__fixtures__/module-search/built-in.json +235 -0
- package/dist/lib/__fixtures__/module-search/catalog-parity.json +4076 -0
- package/dist/lib/__fixtures__/module-search/modules-index.json +1980 -0
- package/dist/lib/__fixtures__/official-module-package/package.json +33 -0
- package/dist/lib/__integration__/TC-INT-007.spec.js +241 -21
- package/dist/lib/__integration__/TC-INT-007.spec.js.map +2 -2
- package/dist/lib/__integration__/TC-INT-009.spec.js +267 -0
- package/dist/lib/__integration__/TC-INT-009.spec.js.map +7 -0
- package/dist/lib/db/commands.js +2 -0
- package/dist/lib/db/commands.js.map +2 -2
- package/dist/lib/db/numeric-snapshots.js +13 -0
- package/dist/lib/db/numeric-snapshots.js.map +7 -0
- package/dist/lib/eject.js +25 -9
- package/dist/lib/eject.js.map +2 -2
- package/dist/lib/env-example.js +25 -0
- package/dist/lib/env-example.js.map +7 -0
- package/dist/lib/generate-child-process.js +23 -0
- package/dist/lib/generate-child-process.js.map +7 -0
- package/dist/lib/generators/ast/imports.js +9 -4
- package/dist/lib/generators/ast/imports.js.map +2 -2
- package/dist/lib/generators/entity-ids.js +12 -12
- package/dist/lib/generators/entity-ids.js.map +2 -2
- package/dist/lib/generators/extensions/agent-files.js +119 -4
- package/dist/lib/generators/extensions/agent-files.js.map +2 -2
- package/dist/lib/generators/module-di.js +8 -9
- package/dist/lib/generators/module-di.js.map +2 -2
- package/dist/lib/generators/module-entities.js +8 -9
- package/dist/lib/generators/module-entities.js.map +2 -2
- package/dist/lib/generators/module-facts.js +7 -5
- package/dist/lib/generators/module-facts.js.map +2 -2
- package/dist/lib/generators/module-override-targets.js +6 -1
- package/dist/lib/generators/module-override-targets.js.map +2 -2
- package/dist/lib/generators/module-package-sources.js +6 -4
- package/dist/lib/generators/module-package-sources.js.map +2 -2
- package/dist/lib/generators/module-registry.js +157 -144
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/generators/openapi.js +9 -2
- package/dist/lib/generators/openapi.js.map +2 -2
- package/dist/lib/generators/source-exports.js +73 -0
- package/dist/lib/generators/source-exports.js.map +7 -0
- package/dist/lib/in-process-generate-watcher.js +11 -5
- package/dist/lib/in-process-generate-watcher.js.map +2 -2
- package/dist/lib/init-existing-database.js +26 -0
- package/dist/lib/init-existing-database.js.map +7 -0
- package/dist/lib/init-secrets.js +33 -1
- package/dist/lib/init-secrets.js.map +2 -2
- package/dist/lib/init-summary.js +44 -0
- package/dist/lib/init-summary.js.map +7 -0
- package/dist/lib/module-github.js +98 -0
- package/dist/lib/module-github.js.map +7 -0
- package/dist/lib/module-identity.js +131 -0
- package/dist/lib/module-identity.js.map +7 -0
- package/dist/lib/module-inspection.js +124 -0
- package/dist/lib/module-inspection.js.map +7 -0
- package/dist/lib/module-install.js +186 -19
- package/dist/lib/module-install.js.map +3 -3
- package/dist/lib/module-package.js +205 -15
- package/dist/lib/module-package.js.map +2 -2
- package/dist/lib/module-search-args.js +97 -0
- package/dist/lib/module-search-args.js.map +7 -0
- package/dist/lib/module-search-index.js +681 -0
- package/dist/lib/module-search-index.js.map +7 -0
- package/dist/lib/module-search.js +727 -0
- package/dist/lib/module-search.js.map +7 -0
- package/dist/lib/modules-config.js +210 -66
- package/dist/lib/modules-config.js.map +2 -2
- package/dist/lib/queue-worker-supervisor.js +3 -0
- package/dist/lib/queue-worker-supervisor.js.map +2 -2
- package/dist/lib/resolver.js +54 -35
- package/dist/lib/resolver.js.map +2 -2
- package/dist/lib/telemetry-init.js +1 -1
- package/dist/lib/telemetry-init.js.map +1 -1
- package/dist/lib/testing/integration-discovery.js +61 -21
- package/dist/lib/testing/integration-discovery.js.map +2 -2
- package/dist/lib/testing/integration.js +35 -4
- package/dist/lib/testing/integration.js.map +2 -2
- package/dist/mercato.js +209 -79
- package/dist/mercato.js.map +2 -2
- package/jest.config.cjs +1 -1
- package/package.json +9 -9
- package/src/__tests__/documented-queue-subcommands.test.ts +63 -0
- package/src/__tests__/mercato.test.ts +905 -0
- package/src/bin.ts +5 -0
- package/src/i18n/de.json +4 -0
- package/src/i18n/en.json +4 -0
- package/src/i18n/es.json +4 -0
- package/src/i18n/ko.json +4 -0
- package/src/i18n/pl.json +4 -0
- package/src/lib/__fixtures__/module-search/README.md +97 -0
- package/src/lib/__fixtures__/module-search/built-in.json +235 -0
- package/src/lib/__fixtures__/module-search/catalog-parity.json +4076 -0
- package/src/lib/__fixtures__/module-search/modules-index.json +1980 -0
- package/src/lib/__fixtures__/official-module-package/dist/modules/test_package/widgets/injection/test/widget.js +1 -0
- package/src/lib/__integration__/TC-INT-007.spec.ts +259 -21
- package/src/lib/__integration__/TC-INT-009.spec.ts +279 -0
- package/src/lib/__tests__/agentic-setup.ownership.test.ts +4 -0
- package/src/lib/__tests__/bin-next-subpath-hook.test.ts +25 -0
- package/src/lib/__tests__/eject.test.ts +98 -4
- package/src/lib/__tests__/env-example.test.ts +58 -0
- package/src/lib/__tests__/generate-child-process.test.ts +185 -0
- package/src/lib/__tests__/generate-quiet-entrypoint.test.ts +47 -0
- package/src/lib/__tests__/in-process-generate-watcher.test.ts +91 -0
- package/src/lib/__tests__/init-existing-database.test.ts +27 -0
- package/src/lib/__tests__/init-secrets.test.ts +85 -1
- package/src/lib/__tests__/init-summary.test.ts +50 -0
- package/src/lib/__tests__/module-github.test.ts +108 -0
- package/src/lib/__tests__/module-identity.test.ts +144 -0
- package/src/lib/__tests__/module-inspection.test.ts +195 -0
- package/src/lib/__tests__/module-install.test.ts +614 -19
- package/src/lib/__tests__/module-package.test.ts +154 -0
- package/src/lib/__tests__/module-search.test.ts +1040 -0
- package/src/lib/__tests__/modules-config.test.ts +453 -1
- package/src/lib/__tests__/queue-worker-supervisor.test.ts +145 -1
- package/src/lib/__tests__/resolver.enterprise.test.ts +60 -0
- package/src/lib/__tests__/resolver.packages.test.ts +29 -0
- package/src/lib/__tests__/telemetry-init.test.ts +1 -1
- package/src/lib/db/__tests__/identifiers.test.ts +19 -0
- package/src/lib/db/__tests__/numeric-snapshots.test.ts +79 -0
- package/src/lib/db/commands.ts +2 -0
- package/src/lib/db/numeric-snapshots.ts +12 -0
- package/src/lib/eject.ts +28 -10
- package/src/lib/env-example.ts +31 -0
- package/src/lib/generate-child-process.ts +35 -0
- package/src/lib/generators/__tests__/agent-files-extension.test.ts +178 -0
- package/src/lib/generators/__tests__/attachment-access.test.ts +70 -0
- package/src/lib/generators/__tests__/module-extension-activations.test.ts +42 -18
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +9 -8
- package/src/lib/generators/__tests__/module-facts.owned-contracts.test.ts +5 -1
- package/src/lib/generators/__tests__/module-id-collisions.test.ts +146 -0
- package/src/lib/generators/__tests__/module-override-targets.test.ts +8 -2
- package/src/lib/generators/__tests__/module-package-sources.test.ts +26 -6
- package/src/lib/generators/__tests__/module-registry-requires-enforcement.test.ts +130 -0
- package/src/lib/generators/__tests__/module-requirements.test.ts +56 -0
- package/src/lib/generators/__tests__/module-requires.test.ts +242 -0
- package/src/lib/generators/__tests__/module-subset.test.ts +103 -0
- package/src/lib/generators/__tests__/openapi.test.ts +24 -0
- package/src/lib/generators/ast/imports.ts +14 -4
- package/src/lib/generators/entity-ids.ts +12 -12
- package/src/lib/generators/extensions/agent-files.ts +154 -4
- package/src/lib/generators/module-di.ts +8 -9
- package/src/lib/generators/module-entities.ts +8 -9
- package/src/lib/generators/module-facts.ts +9 -5
- package/src/lib/generators/module-override-targets.ts +6 -1
- package/src/lib/generators/module-package-sources.ts +7 -5
- package/src/lib/generators/module-registry.ts +224 -182
- package/src/lib/generators/openapi.ts +10 -2
- package/src/lib/generators/source-exports.ts +93 -0
- package/src/lib/in-process-generate-watcher.ts +14 -6
- package/src/lib/init-existing-database.ts +24 -0
- package/src/lib/init-secrets.ts +37 -0
- package/src/lib/init-summary.ts +54 -0
- package/src/lib/module-github.ts +109 -0
- package/src/lib/module-identity.ts +145 -0
- package/src/lib/module-inspection.ts +133 -0
- package/src/lib/module-install.ts +214 -22
- package/src/lib/module-package.ts +243 -16
- package/src/lib/module-search-args.ts +116 -0
- package/src/lib/module-search-index.ts +1037 -0
- package/src/lib/module-search.ts +1013 -0
- package/src/lib/modules-config.ts +278 -80
- package/src/lib/queue-worker-supervisor.ts +3 -0
- package/src/lib/resolver.ts +58 -40
- package/src/lib/telemetry-init.ts +1 -1
- package/src/lib/testing/__tests__/integration-discovery.test.ts +89 -0
- package/src/lib/testing/__tests__/integration.test.ts +55 -0
- package/src/lib/testing/integration-discovery.ts +101 -32
- package/src/lib/testing/integration.ts +36 -4
- package/src/mercato.ts +267 -94
- package/src/types/cross-spawn.d.ts +2 -2
- package/src/lib/__tests__/agentic-build-artifacts.test.ts +0 -28
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
2
|
+
const panelStyle = "\x1B[48;2;57;62;70m\x1B[38;2;238;238;238m";
|
|
3
|
+
const reset = "\x1B[0m";
|
|
4
|
+
function cellWidth(value) {
|
|
5
|
+
if (new RegExp("\\p{Extended_Pictographic}|\\p{Regional_Indicator}|[\\u1100-\\u115f\\u2329\\u232a\\u2e80-\\ua4cf\\uac00-\\ud7a3\\uf900-\\ufaff\\ufe10-\\ufe19\\ufe30-\\ufe6f\\uff01-\\uff60\\uffe0-\\uffe6]", "u").test(value)) return 2;
|
|
6
|
+
return new RegExp("^\\p{Mark}+$", "u").test(value) ? 0 : 1;
|
|
7
|
+
}
|
|
8
|
+
function wrapLine(line, width) {
|
|
9
|
+
const wrapped = [];
|
|
10
|
+
let current = "";
|
|
11
|
+
let currentWidth = 0;
|
|
12
|
+
for (const { segment } of segmenter.segment(line)) {
|
|
13
|
+
const segmentWidth = cellWidth(segment);
|
|
14
|
+
if (currentWidth + segmentWidth > width && current) {
|
|
15
|
+
wrapped.push(current);
|
|
16
|
+
current = "";
|
|
17
|
+
currentWidth = 0;
|
|
18
|
+
}
|
|
19
|
+
current += segment;
|
|
20
|
+
currentWidth += segmentWidth;
|
|
21
|
+
}
|
|
22
|
+
wrapped.push(current);
|
|
23
|
+
return wrapped;
|
|
24
|
+
}
|
|
25
|
+
function formatInitSummary({ users, autoStart, columns = 80, color = false }) {
|
|
26
|
+
const width = Number.isFinite(columns) && columns >= 8 ? Math.floor(columns) : 80;
|
|
27
|
+
const lines = ["", "\u{1F511} DEVELOPMENT ACCOUNTS", ""];
|
|
28
|
+
for (const user of users) {
|
|
29
|
+
lines.push(`${user.icon} ${user.label}`, ` Email: ${user.email}`, ` Password: ${user.password}`, "");
|
|
30
|
+
}
|
|
31
|
+
lines.push(...autoStart ? ["\u{1F680} The dev server will start automatically.", " Next time, run: yarn dev"] : ["\u{1F680} Start the dev server: yarn dev"]);
|
|
32
|
+
lines.push("");
|
|
33
|
+
const rule = "\u2501".repeat(width);
|
|
34
|
+
const content = lines.flatMap((line) => wrapLine(line, width - 4).map((part) => ` ${part}`));
|
|
35
|
+
return [rule, ...content, rule].map((line) => {
|
|
36
|
+
if (!color) return line;
|
|
37
|
+
const visibleWidth = [...segmenter.segment(line)].reduce((total, { segment }) => total + cellWidth(segment), 0);
|
|
38
|
+
return `${panelStyle}${line}${" ".repeat(Math.max(0, width - visibleWidth))}${reset}`;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
formatInitSummary
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=init-summary.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/init-summary.ts"],
|
|
4
|
+
"sourcesContent": ["type InitSummaryUser = { icon: string; label: string; email: string; password: string }\n\ntype InitSummaryOptions = {\n users: InitSummaryUser[]\n autoStart: boolean\n columns?: number\n color?: boolean\n}\n\nconst segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' })\nconst panelStyle = '\\u001b[48;2;57;62;70m\\u001b[38;2;238;238;238m'\nconst reset = '\\u001b[0m'\n\nfunction cellWidth(value: string): number {\n if (/\\p{Extended_Pictographic}|\\p{Regional_Indicator}|[\\u1100-\\u115f\\u2329\\u232a\\u2e80-\\ua4cf\\uac00-\\ud7a3\\uf900-\\ufaff\\ufe10-\\ufe19\\ufe30-\\ufe6f\\uff01-\\uff60\\uffe0-\\uffe6]/u.test(value)) return 2\n return /^\\p{Mark}+$/u.test(value) ? 0 : 1\n}\n\nfunction wrapLine(line: string, width: number): string[] {\n const wrapped: string[] = []\n let current = ''\n let currentWidth = 0\n for (const { segment } of segmenter.segment(line)) {\n const segmentWidth = cellWidth(segment)\n if (currentWidth + segmentWidth > width && current) {\n wrapped.push(current)\n current = ''\n currentWidth = 0\n }\n current += segment\n currentWidth += segmentWidth\n }\n wrapped.push(current)\n return wrapped\n}\n\nexport function formatInitSummary({ users, autoStart, columns = 80, color = false }: InitSummaryOptions): string[] {\n const width = Number.isFinite(columns) && columns >= 8 ? Math.floor(columns) : 80\n const lines = ['', '\uD83D\uDD11 DEVELOPMENT ACCOUNTS', '']\n for (const user of users) {\n lines.push(`${user.icon} ${user.label}`, ` Email: ${user.email}`, ` Password: ${user.password}`, '')\n }\n lines.push(...(autoStart\n ? ['\uD83D\uDE80 The dev server will start automatically.', ' Next time, run: yarn dev']\n : ['\uD83D\uDE80 Start the dev server: yarn dev']))\n lines.push('')\n const rule = '\u2501'.repeat(width)\n const content = lines.flatMap((line) => wrapLine(line, width - 4).map((part) => ` ${part}`))\n return [rule, ...content, rule].map((line) => {\n if (!color) return line\n const visibleWidth = [...segmenter.segment(line)].reduce((total, { segment }) => total + cellWidth(segment), 0)\n return `${panelStyle}${line}${' '.repeat(Math.max(0, width - visibleWidth))}${reset}`\n })\n}\n"],
|
|
5
|
+
"mappings": "AASA,MAAM,YAAY,IAAI,KAAK,UAAU,MAAM,EAAE,aAAa,WAAW,CAAC;AACtE,MAAM,aAAa;AACnB,MAAM,QAAQ;AAEd,SAAS,UAAU,OAAuB;AACxC,MAAI,WAAC,+LAAwK,GAAC,EAAC,KAAK,KAAK,EAAG,QAAO;AACnM,SAAO,WAAC,gBAAY,GAAC,EAAC,KAAK,KAAK,IAAI,IAAI;AAC1C;AAEA,SAAS,SAAS,MAAc,OAAyB;AACvD,QAAM,UAAoB,CAAC;AAC3B,MAAI,UAAU;AACd,MAAI,eAAe;AACnB,aAAW,EAAE,QAAQ,KAAK,UAAU,QAAQ,IAAI,GAAG;AACjD,UAAM,eAAe,UAAU,OAAO;AACtC,QAAI,eAAe,eAAe,SAAS,SAAS;AAClD,cAAQ,KAAK,OAAO;AACpB,gBAAU;AACV,qBAAe;AAAA,IACjB;AACA,eAAW;AACX,oBAAgB;AAAA,EAClB;AACA,UAAQ,KAAK,OAAO;AACpB,SAAO;AACT;AAEO,SAAS,kBAAkB,EAAE,OAAO,WAAW,UAAU,IAAI,QAAQ,MAAM,GAAiC;AACjH,QAAM,QAAQ,OAAO,SAAS,OAAO,KAAK,WAAW,IAAI,KAAK,MAAM,OAAO,IAAI;AAC/E,QAAM,QAAQ,CAAC,IAAI,kCAA2B,EAAE;AAChD,aAAW,QAAQ,OAAO;AACxB,UAAM,KAAK,GAAG,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,iBAAiB,KAAK,KAAK,IAAI,iBAAiB,KAAK,QAAQ,IAAI,EAAE;AAAA,EAC9G;AACA,QAAM,KAAK,GAAI,YACX,CAAC,sDAA+C,6BAA6B,IAC7E,CAAC,0CAAmC,CAAE;AAC1C,QAAM,KAAK,EAAE;AACb,QAAM,OAAO,SAAI,OAAO,KAAK;AAC7B,QAAM,UAAU,MAAM,QAAQ,CAAC,SAAS,SAAS,MAAM,QAAQ,CAAC,EAAE,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;AAC5F,SAAO,CAAC,MAAM,GAAG,SAAS,IAAI,EAAE,IAAI,CAAC,SAAS;AAC5C,QAAI,CAAC,MAAO,QAAO;AACnB,UAAM,eAAe,CAAC,GAAG,UAAU,QAAQ,IAAI,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,MAAM,QAAQ,UAAU,OAAO,GAAG,CAAC;AAC9G,WAAO,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,OAAO,KAAK,IAAI,GAAG,QAAQ,YAAY,CAAC,CAAC,GAAG,KAAK;AAAA,EACrF,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { assertModulePackageExports, parsePackageNameFromSpec } from "./module-package.js";
|
|
3
|
+
function githubApi(endpoint, cwd) {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(execFileSync("gh", ["api", endpoint], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 6e4, maxBuffer: 16 * 1024 * 1024 }));
|
|
6
|
+
} catch {
|
|
7
|
+
throw new Error(`Cannot read GitHub repository metadata at ${endpoint}. Check the locator and access with "gh auth login". No package was installed.`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function record(value) {
|
|
11
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
12
|
+
}
|
|
13
|
+
function resolveGithubModuleTarget(input, cwd, options = {}) {
|
|
14
|
+
let normalized = input.trim().replace(/^(?:(?:git\+)?https?:\/\/github\.com\/)+/i, "").replace(/^github\.com\//i, "").replace(/^github:/i, "").replace(/^git@github\.com:/i, "").replace(/^(?:git\+)?ssh:\/\/(?:git@)?github\.com\//i, "");
|
|
15
|
+
const hash = normalized.indexOf("#");
|
|
16
|
+
const separator = hash < 0 ? normalized.lastIndexOf("@") : hash;
|
|
17
|
+
const requestedRef = separator < 0 ? void 0 : normalized.slice(separator + 1);
|
|
18
|
+
if (requestedRef !== void 0 && !/^[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/.test(requestedRef)) {
|
|
19
|
+
throw new Error("Invalid GitHub revision. No package was installed.");
|
|
20
|
+
}
|
|
21
|
+
normalized = (separator < 0 ? normalized : normalized.slice(0, separator)).replace(/\/$/, "").replace(/\.git$/i, "");
|
|
22
|
+
if (/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(normalized)) {
|
|
23
|
+
const login = record(githubApi("user", cwd)).login;
|
|
24
|
+
if (typeof login !== "string" || !/^[A-Za-z0-9][A-Za-z0-9-]*$/.test(login)) {
|
|
25
|
+
throw new Error("Cannot determine your GitHub account. Use owner/repository or a full GitHub URL.");
|
|
26
|
+
}
|
|
27
|
+
normalized = `${login}/${normalized}`;
|
|
28
|
+
}
|
|
29
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9-]*\/[A-Za-z0-9][A-Za-z0-9._-]*$/.test(normalized)) {
|
|
30
|
+
throw new Error("Unsupported GitHub locator. Use github:owner/repository, a repository URL, or owner/repository.");
|
|
31
|
+
}
|
|
32
|
+
const repository = normalized.toLowerCase();
|
|
33
|
+
const ref = requestedRef ?? record(githubApi(`repos/${repository}`, cwd)).default_branch;
|
|
34
|
+
if (typeof ref !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/.test(ref)) {
|
|
35
|
+
throw new Error("Cannot determine a valid GitHub revision. Use a repository locator with #branch, #tag, or #commit.");
|
|
36
|
+
}
|
|
37
|
+
const sha = record(githubApi(`repos/${repository}/commits/${encodeURIComponent(ref)}`, cwd)).sha;
|
|
38
|
+
if (typeof sha !== "string" || !/^[0-9a-f]{40}$/.test(sha)) {
|
|
39
|
+
throw new Error(`Cannot resolve ${repository} to an immutable commit. No package was installed.`);
|
|
40
|
+
}
|
|
41
|
+
const contents = record(githubApi(`repos/${repository}/contents/package.json?ref=${sha}`, cwd));
|
|
42
|
+
if (contents.encoding !== "base64" || typeof contents.content !== "string") {
|
|
43
|
+
throw new Error(`Repository ${repository} has no readable package.json. No package was installed.`);
|
|
44
|
+
}
|
|
45
|
+
let manifest;
|
|
46
|
+
try {
|
|
47
|
+
manifest = record(JSON.parse(Buffer.from(contents.content, "base64").toString("utf8")));
|
|
48
|
+
} catch {
|
|
49
|
+
throw new Error(`Repository ${repository} has invalid package.json. No package was installed.`);
|
|
50
|
+
}
|
|
51
|
+
const packageName = manifest.name;
|
|
52
|
+
if (typeof packageName !== "string" || !/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/.test(packageName) || parsePackageNameFromSpec(packageName) !== packageName) {
|
|
53
|
+
throw new Error(`Repository ${repository} has no valid npm package name. No package was installed.`);
|
|
54
|
+
}
|
|
55
|
+
const tree = record(githubApi(`repos/${repository}/git/trees/${sha}?recursive=1`, cwd));
|
|
56
|
+
if (!Array.isArray(tree.tree) || tree.truncated === true) {
|
|
57
|
+
throw new Error(`Cannot enumerate modules in ${repository}. No package was installed.`);
|
|
58
|
+
}
|
|
59
|
+
const moduleIds = Array.from(new Set(tree.tree.flatMap((entry) => {
|
|
60
|
+
const filePath = record(entry).path;
|
|
61
|
+
const match = typeof filePath === "string" ? /^src\/modules\/([a-z0-9]+(?:_[a-z0-9]+)*)\/index\.ts$/.exec(filePath) : null;
|
|
62
|
+
return match ? [match[1]] : [];
|
|
63
|
+
})));
|
|
64
|
+
if (moduleIds.length === 0) throw new Error(`Repository ${repository} has no module descriptors in src/modules/. No package was installed.`);
|
|
65
|
+
const files = tree.tree.flatMap((entry) => {
|
|
66
|
+
const filePath = record(entry).path;
|
|
67
|
+
if (typeof filePath !== "string") return [];
|
|
68
|
+
const compiledPath = /^src\/modules\/.+\.tsx?$/.test(filePath) ? filePath.replace(/^src\//, "dist/").replace(/\.tsx?$/, ".js") : void 0;
|
|
69
|
+
return compiledPath ? [filePath, compiledPath] : [filePath];
|
|
70
|
+
});
|
|
71
|
+
const requiredModuleIds = /* @__PURE__ */ new Set([
|
|
72
|
+
...options.moduleId ? [options.moduleId] : moduleIds.length === 1 ? moduleIds : [],
|
|
73
|
+
...(options.enabledModules ?? []).filter((entry) => (entry.from ?? "@open-mercato/core") === packageName).map((entry) => entry.id)
|
|
74
|
+
]);
|
|
75
|
+
const sourceCache = /* @__PURE__ */ new Map();
|
|
76
|
+
const readSource = (relativePath) => {
|
|
77
|
+
const cached = sourceCache.get(relativePath);
|
|
78
|
+
if (cached !== void 0) return cached;
|
|
79
|
+
const encodedPath = relativePath.split("/").map(encodeURIComponent).join("/");
|
|
80
|
+
const file = record(githubApi(`repos/${repository}/contents/${encodedPath}?ref=${sha}`, cwd));
|
|
81
|
+
if (file.encoding !== "base64" || typeof file.content !== "string" || file.content.length > 2 * 1024 * 1024) {
|
|
82
|
+
throw new Error(`Cannot inspect module source in ${repository} at the selected commit. No package was installed.`);
|
|
83
|
+
}
|
|
84
|
+
const source = Buffer.from(file.content, "base64").toString("utf8");
|
|
85
|
+
if (Buffer.byteLength(source, "utf8") > 1024 * 1024) throw new Error(`Module source inspection limit exceeded in ${repository}. No package was installed.`);
|
|
86
|
+
sourceCache.set(relativePath, source);
|
|
87
|
+
return source;
|
|
88
|
+
};
|
|
89
|
+
for (const moduleId of requiredModuleIds) {
|
|
90
|
+
if (!moduleIds.includes(moduleId)) continue;
|
|
91
|
+
assertModulePackageExports(manifest, packageName, moduleId, files, readSource);
|
|
92
|
+
}
|
|
93
|
+
return { packageName, packageSpec: `${packageName}@github:${repository}#${sha}`, moduleIds, locator: `github:${repository}` };
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
resolveGithubModuleTarget
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=module-github.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/module-github.ts"],
|
|
4
|
+
"sourcesContent": ["import { execFileSync } from 'node:child_process'\nimport { assertModulePackageExports, parsePackageNameFromSpec } from './module-package'\n\nexport type GithubModuleTarget = {\n packageName: string\n packageSpec: string\n moduleIds: string[]\n locator: string\n}\n\nfunction githubApi(endpoint: string, cwd: string): unknown {\n try {\n return JSON.parse(execFileSync('gh', ['api', endpoint], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60_000, maxBuffer: 16 * 1024 * 1024 })) as unknown\n } catch {\n throw new Error(`Cannot read GitHub repository metadata at ${endpoint}. Check the locator and access with \"gh auth login\". No package was installed.`)\n }\n}\n\nfunction record(value: unknown): Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nexport function resolveGithubModuleTarget(input: string, cwd: string, options: { moduleId?: string; enabledModules?: readonly { id: string; from?: string }[] } = {}): GithubModuleTarget {\n let normalized = input.trim()\n .replace(/^(?:(?:git\\+)?https?:\\/\\/github\\.com\\/)+/i, '')\n .replace(/^github\\.com\\//i, '')\n .replace(/^github:/i, '')\n .replace(/^git@github\\.com:/i, '')\n .replace(/^(?:git\\+)?ssh:\\/\\/(?:git@)?github\\.com\\//i, '')\n const hash = normalized.indexOf('#')\n const separator = hash < 0 ? normalized.lastIndexOf('@') : hash\n const requestedRef = separator < 0 ? undefined : normalized.slice(separator + 1)\n if (requestedRef !== undefined && !/^[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/.test(requestedRef)) {\n throw new Error('Invalid GitHub revision. No package was installed.')\n }\n normalized = (separator < 0 ? normalized : normalized.slice(0, separator)).replace(/\\/$/, '').replace(/\\.git$/i, '')\n if (/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(normalized)) {\n const login = record(githubApi('user', cwd)).login\n if (typeof login !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9-]*$/.test(login)) {\n throw new Error('Cannot determine your GitHub account. Use owner/repository or a full GitHub URL.')\n }\n normalized = `${login}/${normalized}`\n }\n if (!/^[A-Za-z0-9][A-Za-z0-9-]*\\/[A-Za-z0-9][A-Za-z0-9._-]*$/.test(normalized)) {\n throw new Error('Unsupported GitHub locator. Use github:owner/repository, a repository URL, or owner/repository.')\n }\n const repository = normalized.toLowerCase()\n const ref = requestedRef ?? record(githubApi(`repos/${repository}`, cwd)).default_branch\n if (typeof ref !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._/-]{0,254}$/.test(ref)) {\n throw new Error('Cannot determine a valid GitHub revision. Use a repository locator with #branch, #tag, or #commit.')\n }\n const sha = record(githubApi(`repos/${repository}/commits/${encodeURIComponent(ref)}`, cwd)).sha\n if (typeof sha !== 'string' || !/^[0-9a-f]{40}$/.test(sha)) {\n throw new Error(`Cannot resolve ${repository} to an immutable commit. No package was installed.`)\n }\n const contents = record(githubApi(`repos/${repository}/contents/package.json?ref=${sha}`, cwd))\n if (contents.encoding !== 'base64' || typeof contents.content !== 'string') {\n throw new Error(`Repository ${repository} has no readable package.json. No package was installed.`)\n }\n let manifest: Record<string, unknown>\n try {\n manifest = record(JSON.parse(Buffer.from(contents.content, 'base64').toString('utf8')))\n } catch {\n throw new Error(`Repository ${repository} has invalid package.json. No package was installed.`)\n }\n const packageName = manifest.name\n if (typeof packageName !== 'string' || !/^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/.test(packageName) || parsePackageNameFromSpec(packageName) !== packageName) {\n throw new Error(`Repository ${repository} has no valid npm package name. No package was installed.`)\n }\n const tree = record(githubApi(`repos/${repository}/git/trees/${sha}?recursive=1`, cwd))\n if (!Array.isArray(tree.tree) || tree.truncated === true) {\n throw new Error(`Cannot enumerate modules in ${repository}. No package was installed.`)\n }\n const moduleIds = Array.from(new Set(tree.tree.flatMap((entry: unknown) => {\n const filePath = record(entry).path\n const match = typeof filePath === 'string' ? /^src\\/modules\\/([a-z0-9]+(?:_[a-z0-9]+)*)\\/index\\.ts$/.exec(filePath) : null\n return match ? [match[1]] : []\n })))\n if (moduleIds.length === 0) throw new Error(`Repository ${repository} has no module descriptors in src/modules/. No package was installed.`)\n const files = tree.tree.flatMap((entry: unknown) => {\n const filePath = record(entry).path\n if (typeof filePath !== 'string') return []\n const compiledPath = /^src\\/modules\\/.+\\.tsx?$/.test(filePath) ? filePath.replace(/^src\\//, 'dist/').replace(/\\.tsx?$/, '.js') : undefined\n return compiledPath ? [filePath, compiledPath] : [filePath]\n })\n const requiredModuleIds = new Set([\n ...(options.moduleId ? [options.moduleId] : moduleIds.length === 1 ? moduleIds : []),\n ...(options.enabledModules ?? []).filter((entry) => (entry.from ?? '@open-mercato/core') === packageName).map((entry) => entry.id),\n ])\n const sourceCache = new Map<string, string>()\n const readSource = (relativePath: string): string => {\n const cached = sourceCache.get(relativePath)\n if (cached !== undefined) return cached\n const encodedPath = relativePath.split('/').map(encodeURIComponent).join('/')\n const file = record(githubApi(`repos/${repository}/contents/${encodedPath}?ref=${sha}`, cwd))\n if (file.encoding !== 'base64' || typeof file.content !== 'string' || file.content.length > 2 * 1024 * 1024) {\n throw new Error(`Cannot inspect module source in ${repository} at the selected commit. No package was installed.`)\n }\n const source = Buffer.from(file.content, 'base64').toString('utf8')\n if (Buffer.byteLength(source, 'utf8') > 1024 * 1024) throw new Error(`Module source inspection limit exceeded in ${repository}. No package was installed.`)\n sourceCache.set(relativePath, source)\n return source\n }\n for (const moduleId of requiredModuleIds) {\n if (!moduleIds.includes(moduleId)) continue\n assertModulePackageExports(manifest, packageName, moduleId, files, readSource)\n }\n return { packageName, packageSpec: `${packageName}@github:${repository}#${sha}`, moduleIds, locator: `github:${repository}` }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B,gCAAgC;AASrE,SAAS,UAAU,UAAkB,KAAsB;AACzD,MAAI;AACF,WAAO,KAAK,MAAM,aAAa,MAAM,CAAC,OAAO,QAAQ,GAAG,EAAE,KAAK,UAAU,QAAQ,OAAO,CAAC,UAAU,QAAQ,MAAM,GAAG,SAAS,KAAQ,WAAW,KAAK,OAAO,KAAK,CAAC,CAAC;AAAA,EACrK,QAAQ;AACN,UAAM,IAAI,MAAM,6CAA6C,QAAQ,gFAAgF;AAAA,EACvJ;AACF;AAEA,SAAS,OAAO,OAAyC;AACvD,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAmC,CAAC;AACpH;AAEO,SAAS,0BAA0B,OAAe,KAAa,UAA4F,CAAC,GAAuB;AACxL,MAAI,aAAa,MAAM,KAAK,EACzB,QAAQ,6CAA6C,EAAE,EACvD,QAAQ,mBAAmB,EAAE,EAC7B,QAAQ,aAAa,EAAE,EACvB,QAAQ,sBAAsB,EAAE,EAChC,QAAQ,8CAA8C,EAAE;AAC3D,QAAM,OAAO,WAAW,QAAQ,GAAG;AACnC,QAAM,YAAY,OAAO,IAAI,WAAW,YAAY,GAAG,IAAI;AAC3D,QAAM,eAAe,YAAY,IAAI,SAAY,WAAW,MAAM,YAAY,CAAC;AAC/E,MAAI,iBAAiB,UAAa,CAAC,sCAAsC,KAAK,YAAY,GAAG;AAC3F,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;A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A0B,WAAW,EAAE,IAAI,CAAC,UAAU,MAAM,EAAE;AAAA,EACnI,CAAC;AACD,QAAM,cAAc,oBAAI,IAAoB;AAC5C,QAAM,aAAa,CAAC,iBAAiC;AACnD,UAAM,SAAS,YAAY,IAAI,YAAY;AAC3C,QAAI,WAAW,OAAW,QAAO;AACjC,UAAM,cAAc,aAAa,MAAM,GAAG,EAAE,IAAI,kBAAkB,EAAE,KAAK,GAAG;AAC5E,UAAM,OAAO,OAAO,UAAU,SAAS,UAAU,aAAa,WAAW,QAAQ,GAAG,IAAI,GAAG,CAAC;AAC5F,QAAI,KAAK,aAAa,YAAY,OAAO,KAAK,YAAY,YAAY,KAAK,QAAQ,SAAS,IAAI,OAAO,MAAM;AAC3G,YAAM,IAAI,MAAM,mCAAmC,UAAU,oDAAoD;AAAA,IACnH;AACA,UAAM,SAAS,OAAO,KAAK,KAAK,SAAS,QAAQ,EAAE,SAAS,MAAM;AAClE,QAAI,OAAO,WAAW,QAAQ,MAAM,IAAI,OAAO,KAAM,OAAM,IAAI,MAAM,8CAA8C,UAAU,6BAA6B;AAC1J,gBAAY,IAAI,cAAc,MAAM;AACpC,WAAO;AAAA,EACT;AACA,aAAW,YAAY,mBAAmB;AACxC,QAAI,CAAC,UAAU,SAAS,QAAQ,EAAG;AACnC,+BAA2B,UAAU,aAAa,UAAU,OAAO,UAAU;AAAA,EAC/E;AACA,SAAO,EAAE,aAAa,aAAa,GAAG,WAAW,WAAW,UAAU,IAAI,GAAG,IAAI,WAAW,SAAS,UAAU,UAAU,GAAG;AAC9H;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import ts from "typescript-js";
|
|
4
|
+
import { normalizeModuleLocator } from "@open-mercato/shared/modules/module-locators";
|
|
5
|
+
import { readEnabledModules } from "./modules-config.js";
|
|
6
|
+
function readJson(filePath) {
|
|
7
|
+
try {
|
|
8
|
+
const value = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
9
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
10
|
+
} catch {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function readMetadataLocator(moduleBase) {
|
|
15
|
+
const indexPath = ["index.ts", "index.js"].map((name) => path.join(moduleBase, name)).find((candidate) => fs.existsSync(candidate));
|
|
16
|
+
if (!indexPath) return void 0;
|
|
17
|
+
const source = ts.createSourceFile(indexPath, fs.readFileSync(indexPath, "utf8"), ts.ScriptTarget.Latest, true);
|
|
18
|
+
let locator;
|
|
19
|
+
function visit(node) {
|
|
20
|
+
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === "metadata" && node.initializer) {
|
|
21
|
+
let initializer = node.initializer;
|
|
22
|
+
while (ts.isAsExpression(initializer) || ts.isSatisfiesExpression(initializer) || ts.isParenthesizedExpression(initializer)) initializer = initializer.expression;
|
|
23
|
+
if (ts.isObjectLiteralExpression(initializer)) {
|
|
24
|
+
for (const property of initializer.properties) {
|
|
25
|
+
if (ts.isPropertyAssignment(property) && (ts.isIdentifier(property.name) || ts.isStringLiteralLike(property.name)) && property.name.text === "locator" && ts.isStringLiteralLike(property.initializer)) locator = property.initializer.text;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
ts.forEachChild(node, visit);
|
|
30
|
+
}
|
|
31
|
+
visit(source);
|
|
32
|
+
return locator;
|
|
33
|
+
}
|
|
34
|
+
function sourceLocator(value) {
|
|
35
|
+
if (typeof value !== "string") return void 0;
|
|
36
|
+
const locator = normalizeModuleLocator(value);
|
|
37
|
+
return locator?.startsWith("npm:") || locator?.startsWith("github:") ? locator : void 0;
|
|
38
|
+
}
|
|
39
|
+
function installedDependencyLocator(specifier, canonicalName) {
|
|
40
|
+
if (typeof specifier !== "string") return void 0;
|
|
41
|
+
if (/^(?:github:|github\.com\/|(?:git\+)?https?:\/\/github\.com\/|git@github\.com:|(?:git\+)?ssh:\/\/|[a-z0-9][a-z0-9-]*\/[a-z0-9._-]+(?:[#@]|$))/i.test(specifier)) {
|
|
42
|
+
const locator = sourceLocator(specifier);
|
|
43
|
+
return locator?.startsWith("github:") ? locator : void 0;
|
|
44
|
+
}
|
|
45
|
+
if (specifier.startsWith("npm:")) {
|
|
46
|
+
const aliasTarget = specifier.match(/^npm:(@[^/]+\/[^@]+|[^@]+)(?:@.+)?$/)?.[1];
|
|
47
|
+
return aliasTarget ? sourceLocator(`npm:${aliasTarget}`) : void 0;
|
|
48
|
+
}
|
|
49
|
+
if (!canonicalName || /^(?:[a-z][a-z0-9+.-]*:|[./]|https?:)/i.test(specifier)) return void 0;
|
|
50
|
+
return sourceLocator(`npm:${canonicalName}`);
|
|
51
|
+
}
|
|
52
|
+
function assertDeclaredIdentity(entry, observedLocator, canonicalName) {
|
|
53
|
+
const binding = entry.from ?? "@open-mercato/core";
|
|
54
|
+
if (entry.packageName && canonicalName && entry.packageName !== canonicalName) {
|
|
55
|
+
throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${binding}': declared package '${entry.packageName}' disagrees with installed package '${canonicalName}'. Restore the intended binding or correct src/modules.ts, then regenerate.`);
|
|
56
|
+
}
|
|
57
|
+
const declaredLocator = sourceLocator(entry.locator);
|
|
58
|
+
if (declaredLocator && observedLocator && declaredLocator !== observedLocator) {
|
|
59
|
+
throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${binding}': declared origin '${declaredLocator}' disagrees with observed origin '${observedLocator}'. Disable the old provider before replacing it, then regenerate.`);
|
|
60
|
+
}
|
|
61
|
+
if (declaredLocator?.startsWith("npm:") && canonicalName && declaredLocator !== sourceLocator(`npm:${canonicalName}`)) {
|
|
62
|
+
throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${binding}': declared origin '${declaredLocator}' disagrees with installed package '${canonicalName}'. Correct src/modules.ts to select the intended provider, then regenerate.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function readModuleLocators(entry, resolver, appManifest, packageManifests) {
|
|
66
|
+
const from = entry.from ?? "@open-mercato/core";
|
|
67
|
+
if (from === "@app") {
|
|
68
|
+
const retainedLocator = sourceLocator(entry.locator ?? readMetadataLocator(resolver.getModulePaths(entry).appBase));
|
|
69
|
+
assertDeclaredIdentity(entry, retainedLocator, entry.packageName);
|
|
70
|
+
return retainedLocator ? [retainedLocator] : [];
|
|
71
|
+
}
|
|
72
|
+
let manifest = packageManifests.get(from);
|
|
73
|
+
if (!manifest) {
|
|
74
|
+
manifest = readJson(path.join(resolver.getPackageRoot(from), "package.json"));
|
|
75
|
+
packageManifests.set(from, manifest);
|
|
76
|
+
}
|
|
77
|
+
const canonicalName = typeof manifest.name === "string" ? manifest.name : void 0;
|
|
78
|
+
const observedLocators = /* @__PURE__ */ new Set();
|
|
79
|
+
for (const section of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
80
|
+
const dependencies = appManifest[section];
|
|
81
|
+
if (!dependencies || typeof dependencies !== "object" || Array.isArray(dependencies)) continue;
|
|
82
|
+
const specifier = dependencies[from];
|
|
83
|
+
const locator2 = installedDependencyLocator(specifier, canonicalName);
|
|
84
|
+
if (locator2?.startsWith("npm:") && canonicalName !== from && typeof specifier === "string" && !specifier.startsWith("npm:")) {
|
|
85
|
+
throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${from}': installed package '${canonicalName}' does not match the dependency binding. Restore the intended package or declare an explicit npm alias, then regenerate.`);
|
|
86
|
+
}
|
|
87
|
+
if (locator2) observedLocators.add(locator2);
|
|
88
|
+
}
|
|
89
|
+
if (observedLocators.size > 1) {
|
|
90
|
+
throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${from}': dependency sections declare conflicting origins. Keep one provider for this binding in package.json, then regenerate.`);
|
|
91
|
+
}
|
|
92
|
+
const observedLocator = [...observedLocators][0];
|
|
93
|
+
if (observedLocator?.startsWith("npm:") && canonicalName && observedLocator !== sourceLocator(`npm:${canonicalName}`)) {
|
|
94
|
+
throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${from}': dependency origin '${observedLocator}' disagrees with installed package '${canonicalName}'. Restore the intended package through the package manager, then regenerate.`);
|
|
95
|
+
}
|
|
96
|
+
assertDeclaredIdentity(entry, observedLocator, canonicalName);
|
|
97
|
+
const locator = observedLocator ?? sourceLocator(entry.locator);
|
|
98
|
+
return locator ? [locator] : [];
|
|
99
|
+
}
|
|
100
|
+
function getModuleLocators(entry, resolver) {
|
|
101
|
+
return readModuleLocators(entry, resolver, readJson(path.join(resolver.getAppDir(), "package.json")), /* @__PURE__ */ new Map());
|
|
102
|
+
}
|
|
103
|
+
function assertUniqueEnabledModuleIds(enabledModules, resolver) {
|
|
104
|
+
const byId = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const entry of enabledModules) {
|
|
106
|
+
const existing = byId.get(entry.id);
|
|
107
|
+
if (existing) {
|
|
108
|
+
const describe = (provider) => {
|
|
109
|
+
const binding = provider.from ?? "@open-mercato/core";
|
|
110
|
+
const source = sourceLocator(provider.locator);
|
|
111
|
+
return binding === "@app" ? `@app (${resolver.getModulePaths(provider).appBase})${source ? `, origin ${source}` : ""}` : `binding '${binding}'${source ? `, origin ${source}` : ""}`;
|
|
112
|
+
};
|
|
113
|
+
throw new Error(`[generate] Duplicate enabled module ID '${entry.id}': ${describe(existing)} and ${describe(entry)}. Keep one provider in src/modules.ts, then run yarn mercato generate. Installing under another package alias does not allow both module IDs to run.`);
|
|
114
|
+
}
|
|
115
|
+
byId.set(entry.id, entry);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function getEnabledModuleIdentities(resolver, enabledModules = resolver.loadEnabledModules()) {
|
|
119
|
+
const modulesPath = typeof resolver.getModulesConfigPath === "function" ? resolver.getModulesConfigPath() : path.join(resolver.getAppDir(), "src", "modules.ts");
|
|
120
|
+
if (fs.existsSync(modulesPath)) assertUniqueEnabledModuleIds(readEnabledModules(modulesPath), resolver);
|
|
121
|
+
assertUniqueEnabledModuleIds(enabledModules, resolver);
|
|
122
|
+
const appManifest = readJson(path.join(resolver.getAppDir(), "package.json"));
|
|
123
|
+
const packageManifests = /* @__PURE__ */ new Map();
|
|
124
|
+
return enabledModules.map((entry) => ({ id: entry.id, locators: readModuleLocators(entry, resolver, appManifest, packageManifests) }));
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
assertUniqueEnabledModuleIds,
|
|
128
|
+
getEnabledModuleIdentities,
|
|
129
|
+
getModuleLocators
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=module-identity.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/module-identity.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport ts from 'typescript-js'\nimport { normalizeModuleLocator, type ModuleIdentity } from '@open-mercato/shared/modules/module-locators'\nimport type { ModuleEntry, PackageResolver } from './resolver'\nimport { readEnabledModules } from './modules-config'\n\nfunction readJson(filePath: string): Record<string, unknown> {\n try {\n const value: unknown = JSON.parse(fs.readFileSync(filePath, 'utf8'))\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n } catch {\n return {}\n }\n}\n\nfunction readMetadataLocator(moduleBase: string): string | undefined {\n const indexPath = ['index.ts', 'index.js'].map((name) => path.join(moduleBase, name)).find((candidate) => fs.existsSync(candidate))\n if (!indexPath) return undefined\n const source = ts.createSourceFile(indexPath, fs.readFileSync(indexPath, 'utf8'), ts.ScriptTarget.Latest, true)\n let locator: string | undefined\n function visit(node: ts.Node): void {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === 'metadata' && node.initializer) {\n let initializer = node.initializer\n while (ts.isAsExpression(initializer) || ts.isSatisfiesExpression(initializer) || ts.isParenthesizedExpression(initializer)) initializer = initializer.expression\n if (ts.isObjectLiteralExpression(initializer)) {\n for (const property of initializer.properties) {\n if (ts.isPropertyAssignment(property) && (ts.isIdentifier(property.name) || ts.isStringLiteralLike(property.name)) && property.name.text === 'locator' && ts.isStringLiteralLike(property.initializer)) locator = property.initializer.text\n }\n }\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return locator\n}\n\nfunction sourceLocator(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const locator = normalizeModuleLocator(value)\n return locator?.startsWith('npm:') || locator?.startsWith('github:') ? locator : undefined\n}\n\nfunction installedDependencyLocator(specifier: unknown, canonicalName: string | undefined): string | undefined {\n if (typeof specifier !== 'string') return undefined\n if (/^(?:github:|github\\.com\\/|(?:git\\+)?https?:\\/\\/github\\.com\\/|git@github\\.com:|(?:git\\+)?ssh:\\/\\/|[a-z0-9][a-z0-9-]*\\/[a-z0-9._-]+(?:[#@]|$))/i.test(specifier)) {\n const locator = sourceLocator(specifier)\n return locator?.startsWith('github:') ? locator : undefined\n }\n if (specifier.startsWith('npm:')) {\n const aliasTarget = specifier.match(/^npm:(@[^/]+\\/[^@]+|[^@]+)(?:@.+)?$/)?.[1]\n return aliasTarget ? sourceLocator(`npm:${aliasTarget}`) : undefined\n }\n if (!canonicalName || /^(?:[a-z][a-z0-9+.-]*:|[./]|https?:)/i.test(specifier)) return undefined\n return sourceLocator(`npm:${canonicalName}`)\n}\n\nfunction assertDeclaredIdentity(entry: ModuleEntry, observedLocator: string | undefined, canonicalName: string | undefined): void {\n const binding = entry.from ?? '@open-mercato/core'\n if (entry.packageName && canonicalName && entry.packageName !== canonicalName) {\n throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${binding}': declared package '${entry.packageName}' disagrees with installed package '${canonicalName}'. Restore the intended binding or correct src/modules.ts, then regenerate.`)\n }\n const declaredLocator = sourceLocator(entry.locator)\n if (declaredLocator && observedLocator && declaredLocator !== observedLocator) {\n throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${binding}': declared origin '${declaredLocator}' disagrees with observed origin '${observedLocator}'. Disable the old provider before replacing it, then regenerate.`)\n }\n if (declaredLocator?.startsWith('npm:') && canonicalName && declaredLocator !== sourceLocator(`npm:${canonicalName}`)) {\n throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${binding}': declared origin '${declaredLocator}' disagrees with installed package '${canonicalName}'. Correct src/modules.ts to select the intended provider, then regenerate.`)\n }\n}\n\nfunction readModuleLocators(\n entry: ModuleEntry,\n resolver: PackageResolver,\n appManifest: Record<string, unknown>,\n packageManifests: Map<string, Record<string, unknown>>,\n): string[] {\n const from = entry.from ?? '@open-mercato/core'\n if (from === '@app') {\n const retainedLocator = sourceLocator(entry.locator ?? readMetadataLocator(resolver.getModulePaths(entry).appBase))\n assertDeclaredIdentity(entry, retainedLocator, entry.packageName)\n return retainedLocator ? [retainedLocator] : []\n }\n\n let manifest = packageManifests.get(from)\n if (!manifest) {\n manifest = readJson(path.join(resolver.getPackageRoot(from), 'package.json'))\n packageManifests.set(from, manifest)\n }\n const canonicalName = typeof manifest.name === 'string' ? manifest.name : undefined\n const observedLocators = new Set<string>()\n for (const section of ['dependencies', 'devDependencies', 'optionalDependencies']) {\n const dependencies = appManifest[section]\n if (!dependencies || typeof dependencies !== 'object' || Array.isArray(dependencies)) continue\n const specifier = (dependencies as Record<string, unknown>)[from]\n const locator = installedDependencyLocator(specifier, canonicalName)\n if (locator?.startsWith('npm:') && canonicalName !== from && typeof specifier === 'string' && !specifier.startsWith('npm:')) {\n throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${from}': installed package '${canonicalName}' does not match the dependency binding. Restore the intended package or declare an explicit npm alias, then regenerate.`)\n }\n if (locator) observedLocators.add(locator)\n }\n if (observedLocators.size > 1) {\n throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${from}': dependency sections declare conflicting origins. Keep one provider for this binding in package.json, then regenerate.`)\n }\n const observedLocator = [...observedLocators][0]\n if (observedLocator?.startsWith('npm:') && canonicalName && observedLocator !== sourceLocator(`npm:${canonicalName}`)) {\n throw new Error(`[modules] Cannot resolve module '${entry.id}' from binding '${from}': dependency origin '${observedLocator}' disagrees with installed package '${canonicalName}'. Restore the intended package through the package manager, then regenerate.`)\n }\n assertDeclaredIdentity(entry, observedLocator, canonicalName)\n const locator = observedLocator ?? sourceLocator(entry.locator)\n return locator ? [locator] : []\n}\n\nexport function getModuleLocators(entry: ModuleEntry, resolver: PackageResolver): string[] {\n return readModuleLocators(entry, resolver, readJson(path.join(resolver.getAppDir(), 'package.json')), new Map())\n}\n\nexport function assertUniqueEnabledModuleIds(enabledModules: readonly ModuleEntry[], resolver: PackageResolver): void {\n const byId = new Map<string, ModuleEntry>()\n for (const entry of enabledModules) {\n const existing = byId.get(entry.id)\n if (existing) {\n const describe = (provider: ModuleEntry): string => {\n const binding = provider.from ?? '@open-mercato/core'\n const source = sourceLocator(provider.locator)\n return binding === '@app'\n ? `@app (${resolver.getModulePaths(provider).appBase})${source ? `, origin ${source}` : ''}`\n : `binding '${binding}'${source ? `, origin ${source}` : ''}`\n }\n throw new Error(`[generate] Duplicate enabled module ID '${entry.id}': ${describe(existing)} and ${describe(entry)}. Keep one provider in src/modules.ts, then run yarn mercato generate. Installing under another package alias does not allow both module IDs to run.`)\n }\n byId.set(entry.id, entry)\n }\n}\n\nexport function getEnabledModuleIdentities(resolver: PackageResolver, enabledModules: readonly ModuleEntry[] = resolver.loadEnabledModules()): ModuleIdentity[] {\n const modulesPath = typeof resolver.getModulesConfigPath === 'function'\n ? resolver.getModulesConfigPath()\n : path.join(resolver.getAppDir(), 'src', 'modules.ts')\n if (fs.existsSync(modulesPath)) assertUniqueEnabledModuleIds(readEnabledModules(modulesPath), resolver)\n assertUniqueEnabledModuleIds(enabledModules, resolver)\n const appManifest = readJson(path.join(resolver.getAppDir(), 'package.json'))\n const packageManifests = new Map<string, Record<string, unknown>>()\n return enabledModules.map((entry) => ({ id: entry.id, locators: readModuleLocators(entry, resolver, appManifest, packageManifests) }))\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OA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AW,EAAG,8BAA6B,mBAAmB,WAAW,GAAG,QAAQ;AACtG,+BAA6B,gBAAgB,QAAQ;AACrD,QAAM,cAAc,SAAS,KAAK,KAAK,SAAS,UAAU,GAAG,cAAc,CAAC;AAC5E,QAAM,mBAAmB,oBAAI,IAAqC;AAClE,SAAO,eAAe,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,IAAI,UAAU,mBAAmB,OAAO,UAAU,aAAa,gBAAgB,EAAE,EAAE;AACvI;",
|
|
6
|
+
"names": ["locator"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import spawn from "cross-spawn";
|
|
6
|
+
import { assertModulePackageExports, isModulePackageExportError } from "./module-package.js";
|
|
7
|
+
function record(value) {
|
|
8
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
9
|
+
}
|
|
10
|
+
function inspectFiles(manifest, packageName, files, requiredModuleIds, readSource) {
|
|
11
|
+
if (manifest.name !== packageName) throw new Error(`Inspected package does not match "${packageName}". No package was installed.`);
|
|
12
|
+
const moduleIds = [...new Set(files.flatMap((file) => {
|
|
13
|
+
const match = /^src\/modules\/([a-z0-9]+(?:_[a-z0-9]+)*)\/index\.ts$/.exec(file);
|
|
14
|
+
return match && files.includes(`dist/modules/${match[1]}/index.js`) ? [match[1]] : [];
|
|
15
|
+
}))];
|
|
16
|
+
const checkedModuleIds = requiredModuleIds.length ? requiredModuleIds : moduleIds.length === 1 ? moduleIds : [];
|
|
17
|
+
for (const moduleId of checkedModuleIds) {
|
|
18
|
+
if (!moduleIds.includes(moduleId)) throw new Error(`Package "${packageName}" is missing source or compiled descriptors for "${moduleId}". No package was installed.`);
|
|
19
|
+
assertModulePackageExports(manifest, packageName, moduleId, files, readSource);
|
|
20
|
+
}
|
|
21
|
+
if (moduleIds.length === 0) throw new Error(`Package "${packageName}" is missing source or compiled module descriptors. Build the package before retrying. No package was installed.`);
|
|
22
|
+
return { moduleIds, ...typeof manifest.version === "string" ? { version: manifest.version } : {} };
|
|
23
|
+
}
|
|
24
|
+
function inspectArchive(archive, packageName, requiredModuleIds) {
|
|
25
|
+
const manifest = record(JSON.parse(execFileSync("tar", ["-xOf", archive, "package/package.json"], { encoding: "utf8", timeout: 15e3 })));
|
|
26
|
+
const files = execFileSync("tar", ["-tf", archive], { encoding: "utf8", timeout: 15e3, maxBuffer: 16 * 1024 * 1024 }).split("\n").filter((file) => file.startsWith("package/")).map((file) => file.slice("package/".length));
|
|
27
|
+
return inspectFiles(manifest, packageName, files, requiredModuleIds, (relativePath) => execFileSync("tar", ["-xOf", archive, `package/${relativePath}`], { encoding: "utf8", timeout: 15e3, maxBuffer: 1024 * 1024 }));
|
|
28
|
+
}
|
|
29
|
+
function packageFiles(packageRoot, relativeDir = "") {
|
|
30
|
+
return fs.readdirSync(path.join(packageRoot, relativeDir), { withFileTypes: true }).flatMap((entry) => {
|
|
31
|
+
if (entry.name === "node_modules" || entry.name.startsWith(".")) return [];
|
|
32
|
+
const relativePath = path.posix.join(relativeDir, entry.name);
|
|
33
|
+
return entry.isDirectory() ? packageFiles(packageRoot, relativePath) : entry.isFile() ? [relativePath] : [];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function isModernYarnProject(appDir) {
|
|
37
|
+
let directory = appDir;
|
|
38
|
+
while (true) {
|
|
39
|
+
if (fs.existsSync(path.join(directory, ".yarnrc.yml"))) return true;
|
|
40
|
+
const manifestPath = path.join(directory, "package.json");
|
|
41
|
+
if (fs.existsSync(manifestPath)) {
|
|
42
|
+
const manifest = record(JSON.parse(fs.readFileSync(manifestPath, "utf8")));
|
|
43
|
+
if (typeof manifest.packageManager === "string" && /^yarn@(?:[2-9]|[1-9][0-9]+)\./.test(manifest.packageManager)) return true;
|
|
44
|
+
}
|
|
45
|
+
const parent = path.dirname(directory);
|
|
46
|
+
if (parent === directory) return false;
|
|
47
|
+
directory = parent;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function yarnNpmConfiguration(appDir, packageName, temporaryDir) {
|
|
51
|
+
if (!isModernYarnProject(appDir)) return [];
|
|
52
|
+
const settings = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const setting of ["npmRegistryServer", "npmScopes", "npmRegistries", "npmAuthToken", "npmAuthIdent"]) {
|
|
54
|
+
const result = spawn.sync(process.platform === "win32" ? "yarn.cmd" : "yarn", ["config", "get", setting, "--json", "--no-redacted"], {
|
|
55
|
+
cwd: appDir,
|
|
56
|
+
encoding: "utf8",
|
|
57
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
58
|
+
timeout: 15e3
|
|
59
|
+
});
|
|
60
|
+
if (result.error || result.status !== 0) throw new Error("Cannot inspect project package registry configuration");
|
|
61
|
+
settings.set(setting, JSON.parse(result.stdout));
|
|
62
|
+
}
|
|
63
|
+
const scope = packageName.startsWith("@") ? packageName.slice(1).split("/")[0] : void 0;
|
|
64
|
+
const scopeSettings = scope ? record(record(settings.get("npmScopes"))[scope]) : {};
|
|
65
|
+
const registry = typeof scopeSettings.npmRegistryServer === "string" ? scopeSettings.npmRegistryServer : settings.get("npmRegistryServer");
|
|
66
|
+
if (typeof registry !== "string") throw new Error("Missing project package registry");
|
|
67
|
+
const registryUrl = new URL(registry);
|
|
68
|
+
if (!["http:", "https:"].includes(registryUrl.protocol) || registryUrl.username || registryUrl.password) throw new Error("Invalid project package registry");
|
|
69
|
+
const registryKey = `//${registryUrl.host}${registryUrl.pathname}`.replace(/\/$/, "");
|
|
70
|
+
const registries = record(settings.get("npmRegistries"));
|
|
71
|
+
const registrySettings = record(registries[registry.replace(/\/$/, "")] ?? registries[registryKey] ?? registries[`${registryKey}/`]);
|
|
72
|
+
const auth = scopeSettings.npmAuthToken || scopeSettings.npmAuthIdent ? scopeSettings : registrySettings.npmAuthToken || registrySettings.npmAuthIdent ? registrySettings : { npmAuthToken: settings.get("npmAuthToken"), npmAuthIdent: settings.get("npmAuthIdent") };
|
|
73
|
+
const userConfig = process.env.NPM_CONFIG_USERCONFIG ?? process.env.npm_config_userconfig ?? path.join(os.homedir(), ".npmrc");
|
|
74
|
+
const existingConfig = fs.existsSync(userConfig) ? fs.readFileSync(userConfig, "utf8") : "";
|
|
75
|
+
const lines = [existingConfig, `registry=${JSON.stringify(registry)}`];
|
|
76
|
+
if (scope) lines.push(`@${scope}:registry=${JSON.stringify(registry)}`);
|
|
77
|
+
if (typeof auth.npmAuthToken === "string" && auth.npmAuthToken) lines.push(`${registryKey}/:_authToken=${JSON.stringify(auth.npmAuthToken)}`);
|
|
78
|
+
else if (typeof auth.npmAuthIdent === "string" && auth.npmAuthIdent) lines.push(`${registryKey}/:_auth=${Buffer.from(auth.npmAuthIdent).toString("base64")}`);
|
|
79
|
+
const configPath = path.join(temporaryDir, "inspection.npmrc");
|
|
80
|
+
fs.writeFileSync(configPath, `${lines.join("\n")}
|
|
81
|
+
`, { mode: 384 });
|
|
82
|
+
return ["--userconfig", configPath, "--registry", registry, ...scope ? [`--@${scope}:registry=${registry}`] : []];
|
|
83
|
+
}
|
|
84
|
+
function inspectNpmModuleTarget(packageSpec, packageName, appDir, requiredModuleIds = []) {
|
|
85
|
+
const filePrefix = `${packageName}@file:`;
|
|
86
|
+
if (packageSpec.startsWith(filePrefix)) {
|
|
87
|
+
const packageRoot = path.resolve(appDir, packageSpec.slice(filePrefix.length));
|
|
88
|
+
if (fs.statSync(packageRoot).isFile()) return { packageName, packageSpec, ...inspectArchive(packageRoot, packageName, requiredModuleIds) };
|
|
89
|
+
const manifest = record(JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")));
|
|
90
|
+
const inspected = inspectFiles(manifest, packageName, packageFiles(packageRoot), requiredModuleIds, (relativePath) => fs.readFileSync(path.join(packageRoot, relativePath), "utf8"));
|
|
91
|
+
return { packageName, packageSpec, ...inspected };
|
|
92
|
+
}
|
|
93
|
+
const temporaryDir = fs.mkdtempSync(path.join(os.tmpdir(), "mercato-module-inspection-"));
|
|
94
|
+
let inspectionStep = "read the project registry configuration";
|
|
95
|
+
try {
|
|
96
|
+
const configurationArgs = yarnNpmConfiguration(appDir, packageName, temporaryDir);
|
|
97
|
+
inspectionStep = "fetch the exact npm artifact";
|
|
98
|
+
const packedProcess = spawn.sync(process.platform === "win32" ? "npm.cmd" : "npm", ["pack", packageSpec, "--ignore-scripts", "--json", "--pack-destination", temporaryDir, ...configurationArgs], {
|
|
99
|
+
cwd: appDir,
|
|
100
|
+
encoding: "utf8",
|
|
101
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
102
|
+
timeout: 6e4,
|
|
103
|
+
maxBuffer: 16 * 1024 * 1024
|
|
104
|
+
});
|
|
105
|
+
if (packedProcess.error || packedProcess.status !== 0) throw new Error("Artifact inspection failed");
|
|
106
|
+
inspectionStep = "parse the npm artifact response";
|
|
107
|
+
const packages = JSON.parse(packedProcess.stdout);
|
|
108
|
+
const packed = record(Array.isArray(packages) ? packages[0] : void 0);
|
|
109
|
+
if (packed.name !== packageName || typeof packed.version !== "string" || !/^[0-9A-Za-z.+-]+$/.test(packed.version) || typeof packed.filename !== "string" || path.basename(packed.filename) !== packed.filename) throw new Error("Invalid packed manifest");
|
|
110
|
+
inspectionStep = "validate the packed module artifact";
|
|
111
|
+
const inspected = inspectArchive(path.join(temporaryDir, packed.filename), packageName, requiredModuleIds);
|
|
112
|
+
if (inspected.version !== packed.version) throw new Error("Packed artifact version disagrees with resolution");
|
|
113
|
+
return { packageName, packageSpec, ...inspected, locator: `npm:${packageName}` };
|
|
114
|
+
} catch (error) {
|
|
115
|
+
const safeDetail = isModulePackageExportError(error) && error instanceof Error ? ` ${error.message}` : "";
|
|
116
|
+
throw new Error(`Cannot inspect the exact module artifact for "${packageName}" while trying to ${inspectionStep}.${safeDetail} Check project registry credentials, package access and shipped src/dist module descriptors before retrying. No package was installed.`);
|
|
117
|
+
} finally {
|
|
118
|
+
fs.rmSync(temporaryDir, { recursive: true, force: true });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
inspectNpmModuleTarget
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=module-inspection.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/lib/module-inspection.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'node:fs'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { execFileSync } from 'node:child_process'\nimport spawn from 'cross-spawn'\nimport { assertModulePackageExports, isModulePackageExportError } from './module-package'\n\nexport type InspectedModuleTarget = {\n packageName: string\n packageSpec: string\n moduleIds: string[]\n locator?: string\n version?: string\n}\n\ntype ArtifactInspection = { moduleIds: string[]; version?: string }\n\nfunction record(value: unknown): Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction inspectFiles(manifest: Record<string, unknown>, packageName: string, files: string[], requiredModuleIds: readonly string[], readSource: (relativePath: string) => string): ArtifactInspection {\n if (manifest.name !== packageName) throw new Error(`Inspected package does not match \"${packageName}\". No package was installed.`)\n const moduleIds = [...new Set(files.flatMap((file) => {\n const match = /^src\\/modules\\/([a-z0-9]+(?:_[a-z0-9]+)*)\\/index\\.ts$/.exec(file)\n return match && files.includes(`dist/modules/${match[1]}/index.js`) ? [match[1]] : []\n }))]\n const checkedModuleIds = requiredModuleIds.length ? requiredModuleIds : moduleIds.length === 1 ? moduleIds : []\n for (const moduleId of checkedModuleIds) {\n if (!moduleIds.includes(moduleId)) throw new Error(`Package \"${packageName}\" is missing source or compiled descriptors for \"${moduleId}\". No package was installed.`)\n assertModulePackageExports(manifest, packageName, moduleId, files, readSource)\n }\n if (moduleIds.length === 0) throw new Error(`Package \"${packageName}\" is missing source or compiled module descriptors. Build the package before retrying. No package was installed.`)\n return { moduleIds, ...(typeof manifest.version === 'string' ? { version: manifest.version } : {}) }\n}\n\nfunction inspectArchive(archive: string, packageName: string, requiredModuleIds: readonly string[]): ArtifactInspection {\n const manifest = record(JSON.parse(execFileSync('tar', ['-xOf', archive, 'package/package.json'], { encoding: 'utf8', timeout: 15_000 })))\n const files = execFileSync('tar', ['-tf', archive], { encoding: 'utf8', timeout: 15_000, maxBuffer: 16 * 1024 * 1024 }).split('\\n').filter((file) => file.startsWith('package/')).map((file) => file.slice('package/'.length))\n return inspectFiles(manifest, packageName, files, requiredModuleIds, (relativePath) => execFileSync('tar', ['-xOf', archive, `package/${relativePath}`], { encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 }))\n}\n\nfunction packageFiles(packageRoot: string, relativeDir = ''): string[] {\n return fs.readdirSync(path.join(packageRoot, relativeDir), { withFileTypes: true }).flatMap((entry) => {\n if (entry.name === 'node_modules' || entry.name.startsWith('.')) return []\n const relativePath = path.posix.join(relativeDir, entry.name)\n return entry.isDirectory() ? packageFiles(packageRoot, relativePath) : entry.isFile() ? [relativePath] : []\n })\n}\n\nfunction isModernYarnProject(appDir: string): boolean {\n let directory = appDir\n while (true) {\n if (fs.existsSync(path.join(directory, '.yarnrc.yml'))) return true\n const manifestPath = path.join(directory, 'package.json')\n if (fs.existsSync(manifestPath)) {\n const manifest = record(JSON.parse(fs.readFileSync(manifestPath, 'utf8')))\n if (typeof manifest.packageManager === 'string' && /^yarn@(?:[2-9]|[1-9][0-9]+)\\./.test(manifest.packageManager)) return true\n }\n const parent = path.dirname(directory)\n if (parent === directory) return false\n directory = parent\n }\n}\n\nfunction yarnNpmConfiguration(appDir: string, packageName: string, temporaryDir: string): string[] {\n if (!isModernYarnProject(appDir)) return []\n const settings = new Map<string, unknown>()\n for (const setting of ['npmRegistryServer', 'npmScopes', 'npmRegistries', 'npmAuthToken', 'npmAuthIdent']) {\n const result = spawn.sync(process.platform === 'win32' ? 'yarn.cmd' : 'yarn', ['config', 'get', setting, '--json', '--no-redacted'], {\n cwd: appDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 15_000,\n })\n if (result.error || result.status !== 0) throw new Error('Cannot inspect project package registry configuration')\n settings.set(setting, JSON.parse(result.stdout))\n }\n const scope = packageName.startsWith('@') ? packageName.slice(1).split('/')[0] : undefined\n const scopeSettings = scope ? record(record(settings.get('npmScopes'))[scope]) : {}\n const registry = typeof scopeSettings.npmRegistryServer === 'string' ? scopeSettings.npmRegistryServer : settings.get('npmRegistryServer')\n if (typeof registry !== 'string') throw new Error('Missing project package registry')\n const registryUrl = new URL(registry)\n if (!['http:', 'https:'].includes(registryUrl.protocol) || registryUrl.username || registryUrl.password) throw new Error('Invalid project package registry')\n const registryKey = `//${registryUrl.host}${registryUrl.pathname}`.replace(/\\/$/, '')\n const registries = record(settings.get('npmRegistries'))\n const registrySettings = record(registries[registry.replace(/\\/$/, '')] ?? registries[registryKey] ?? registries[`${registryKey}/`])\n const auth = scopeSettings.npmAuthToken || scopeSettings.npmAuthIdent ? scopeSettings\n : registrySettings.npmAuthToken || registrySettings.npmAuthIdent ? registrySettings\n : { npmAuthToken: settings.get('npmAuthToken'), npmAuthIdent: settings.get('npmAuthIdent') }\n const userConfig = process.env.NPM_CONFIG_USERCONFIG ?? process.env.npm_config_userconfig ?? path.join(os.homedir(), '.npmrc')\n const existingConfig = fs.existsSync(userConfig) ? fs.readFileSync(userConfig, 'utf8') : ''\n const lines = [existingConfig, `registry=${JSON.stringify(registry)}`]\n if (scope) lines.push(`@${scope}:registry=${JSON.stringify(registry)}`)\n if (typeof auth.npmAuthToken === 'string' && auth.npmAuthToken) lines.push(`${registryKey}/:_authToken=${JSON.stringify(auth.npmAuthToken)}`)\n else if (typeof auth.npmAuthIdent === 'string' && auth.npmAuthIdent) lines.push(`${registryKey}/:_auth=${Buffer.from(auth.npmAuthIdent).toString('base64')}`)\n const configPath = path.join(temporaryDir, 'inspection.npmrc')\n fs.writeFileSync(configPath, `${lines.join('\\n')}\\n`, { mode: 0o600 })\n return ['--userconfig', configPath, '--registry', registry, ...(scope ? [`--@${scope}:registry=${registry}`] : [])]\n}\n\nexport function inspectNpmModuleTarget(packageSpec: string, packageName: string, appDir: string, requiredModuleIds: readonly string[] = []): InspectedModuleTarget {\n const filePrefix = `${packageName}@file:`\n if (packageSpec.startsWith(filePrefix)) {\n const packageRoot = path.resolve(appDir, packageSpec.slice(filePrefix.length))\n if (fs.statSync(packageRoot).isFile()) return { packageName, packageSpec, ...inspectArchive(packageRoot, packageName, requiredModuleIds) }\n const manifest = record(JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8')))\n const inspected = inspectFiles(manifest, packageName, packageFiles(packageRoot), requiredModuleIds, (relativePath) => fs.readFileSync(path.join(packageRoot, relativePath), 'utf8'))\n return { packageName, packageSpec, ...inspected }\n }\n\n const temporaryDir = fs.mkdtempSync(path.join(os.tmpdir(), 'mercato-module-inspection-'))\n let inspectionStep = 'read the project registry configuration'\n try {\n const configurationArgs = yarnNpmConfiguration(appDir, packageName, temporaryDir)\n inspectionStep = 'fetch the exact npm artifact'\n const packedProcess = spawn.sync(process.platform === 'win32' ? 'npm.cmd' : 'npm', ['pack', packageSpec, '--ignore-scripts', '--json', '--pack-destination', temporaryDir, ...configurationArgs], {\n cwd: appDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60_000, maxBuffer: 16 * 1024 * 1024,\n })\n if (packedProcess.error || packedProcess.status !== 0) throw new Error('Artifact inspection failed')\n inspectionStep = 'parse the npm artifact response'\n const packages: unknown = JSON.parse(packedProcess.stdout)\n const packed = record(Array.isArray(packages) ? packages[0] : undefined)\n if (packed.name !== packageName || typeof packed.version !== 'string' || !/^[0-9A-Za-z.+-]+$/.test(packed.version)\n || typeof packed.filename !== 'string' || path.basename(packed.filename) !== packed.filename) throw new Error('Invalid packed manifest')\n inspectionStep = 'validate the packed module artifact'\n const inspected = inspectArchive(path.join(temporaryDir, packed.filename), packageName, requiredModuleIds)\n if (inspected.version !== packed.version) throw new Error('Packed artifact version disagrees with resolution')\n return { packageName, packageSpec, ...inspected, locator: `npm:${packageName}` }\n } catch (error) {\n const safeDetail = isModulePackageExportError(error) && error instanceof Error ? ` ${error.message}` : ''\n throw new Error(`Cannot inspect the exact module artifact for \"${packageName}\" while trying to ${inspectionStep}.${safeDetail} Check project registry credentials, package access and shipped src/dist module descriptors before retrying. No package was installed.`)\n } finally {\n fs.rmSync(temporaryDir, { recursive: true, force: true })\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,4BAA4B,kCAAkC;AAYvE,SAAS,OAAO,OAAyC;AACvD,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAmC,CAAC;AACpH;AAEA,SAAS,aAAa,UAAmC,aAAqB,OAAiB,mBAAsC,YAAkE;AACrM,MAAI,SAAS,SAAS,YAAa,OAAM,IAAI,MAAM,qCAAqC,WAAW,8BAA8B;AACjI,QAAM,YAAY,CAAC,GAAG,IAAI,IAAI,MAAM,QAAQ,CAAC,SAAS;AACpD,UAAM,QAAQ,wDAAwD,KAAK,IAAI;AAC/E,WAAO,SAAS,MAAM,SAAS,gBAAgB,MAAM,CAAC,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;AAAA,EACtF,CAAC,CAAC,CAAC;AACH,QAAM,mBAAmB,kBAAkB,SAAS,oBAAoB,UAAU,WAAW,IAAI,YAAY,CAAC;AAC9G,aAAW,YAAY,kBAAkB;AACvC,QAAI,CAAC,UAAU,SAAS,QAAQ,EAAG,OAAM,IAAI,MAAM,YAAY,WAAW,oDAAoD,QAAQ,8BAA8B;AACpK,+BAA2B,UAAU,aAAa,UAAU,OAAO,UAAU;AAAA,EAC/E;AACA,MAAI,UAAU,WAAW,EAAG,OAAM,IAAI,MAAM,YA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