@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
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import os from 'node:os'
|
|
3
3
|
import path from 'node:path'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
assertModuleNotGatedOff,
|
|
6
|
+
ensureModuleRegistration,
|
|
7
|
+
ModuleGatedOffError,
|
|
8
|
+
setModuleRegistrationSource,
|
|
9
|
+
prepareModuleRegistration,
|
|
10
|
+
prepareModuleRegistrationSource,
|
|
11
|
+
} from '../modules-config'
|
|
12
|
+
import { readEnabledModulesFromConfig } from '../resolver'
|
|
5
13
|
|
|
6
14
|
describe('modules-config', () => {
|
|
7
15
|
let tmpDir: string
|
|
@@ -14,6 +22,41 @@ describe('modules-config', () => {
|
|
|
14
22
|
fs.rmSync(tmpDir, { recursive: true, force: true })
|
|
15
23
|
})
|
|
16
24
|
|
|
25
|
+
it('preserves module locator when registering and ejecting', () => {
|
|
26
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
27
|
+
fs.writeFileSync(filePath, 'export const enabledModules = []\n')
|
|
28
|
+
ensureModuleRegistration(filePath, { id: 'consents', from: '@pkarw/consents', locator: 'github:pkarw/consents', packageName: '@pkarw/consents' })
|
|
29
|
+
expect(fs.readFileSync(filePath, 'utf8')).toContain("locator: 'github:pkarw/consents'")
|
|
30
|
+
setModuleRegistrationSource(filePath, 'consents', '@app')
|
|
31
|
+
expect(fs.readFileSync(filePath, 'utf8')).toContain("packageName: '@pkarw/consents'")
|
|
32
|
+
expect(fs.readFileSync(filePath, 'utf8')).toContain("locator: 'github:pkarw/consents'")
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('prepares add and eject config edits without writing the existing configuration', () => {
|
|
36
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
37
|
+
const source = 'export const enabledModules = []\n'
|
|
38
|
+
fs.writeFileSync(filePath, source)
|
|
39
|
+
|
|
40
|
+
const added = prepareModuleRegistration(source, { id: 'consents', from: 'consents_candidate' })
|
|
41
|
+
const ejected = prepareModuleRegistrationSource(added.source, 'consents', '@app', { packageName: '@publisher/consents', locator: 'npm:@publisher/consents' })
|
|
42
|
+
|
|
43
|
+
expect(added).toMatchObject({ changed: true, registeredAs: 'consents_candidate' })
|
|
44
|
+
expect(ejected).toContain("from: '@app'")
|
|
45
|
+
expect(ejected).toContain("packageName: '@publisher/consents'")
|
|
46
|
+
expect(ejected).toContain("locator: 'npm:@publisher/consents'")
|
|
47
|
+
expect(fs.readFileSync(filePath, 'utf8')).toBe(source)
|
|
48
|
+
expect(prepareModuleRegistration(added.source, { id: 'consents', from: 'consents_candidate' })).toEqual({ source: added.source, changed: false, registeredAs: 'consents_candidate' })
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('accepts quoted property names when preparing an existing registration update', () => {
|
|
52
|
+
const source = 'export const enabledModules = [{ "id": "consents", "from": "consents_candidate" }]\n'
|
|
53
|
+
|
|
54
|
+
const updated = prepareModuleRegistrationSource(source, 'consents', '@app')
|
|
55
|
+
|
|
56
|
+
expect(updated).toContain('"from": "@app"')
|
|
57
|
+
expect(updated).toContain('"id": "consents"')
|
|
58
|
+
})
|
|
59
|
+
|
|
17
60
|
it('adds a package-backed module without touching conditional pushes', () => {
|
|
18
61
|
const filePath = path.join(tmpDir, 'modules.ts')
|
|
19
62
|
fs.writeFileSync(
|
|
@@ -132,4 +175,413 @@ describe('modules-config', () => {
|
|
|
132
175
|
expect(updated).toContain("{ id: 'test_package', from: '@open-mercato/test-package' }")
|
|
133
176
|
expect(updated).toContain("enabledModules.push({ id: 'example_customers_sync', from: '@app' })")
|
|
134
177
|
})
|
|
178
|
+
|
|
179
|
+
describe('env-gated registrations', () => {
|
|
180
|
+
const flagNames = [
|
|
181
|
+
'OM_ENABLE_STORAGE_S3',
|
|
182
|
+
'OM_ENABLE_ENTERPRISE_MODULES',
|
|
183
|
+
'OM_ENABLE_ENTERPRISE_MODULES_SSO',
|
|
184
|
+
'OM_ENABLE_ENTERPRISE_MODULES_SECURITY',
|
|
185
|
+
'OM_ENABLE_ENTERPRISE_MODULES_AGENTS',
|
|
186
|
+
]
|
|
187
|
+
const originalEnv = Object.fromEntries(flagNames.map((name) => [name, process.env[name]]))
|
|
188
|
+
|
|
189
|
+
afterEach(() => {
|
|
190
|
+
for (const name of flagNames) {
|
|
191
|
+
if (originalEnv[name] === undefined) delete process.env[name]
|
|
192
|
+
else process.env[name] = originalEnv[name]
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
function writeGatedModulesFile(): string {
|
|
197
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
198
|
+
fs.writeFileSync(
|
|
199
|
+
filePath,
|
|
200
|
+
[
|
|
201
|
+
"import { parseBooleanWithDefault } from '@open-mercato/shared/lib/boolean'",
|
|
202
|
+
'',
|
|
203
|
+
'export const enabledModules = [',
|
|
204
|
+
" { id: 'auth', from: '@open-mercato/core' },",
|
|
205
|
+
']',
|
|
206
|
+
'',
|
|
207
|
+
'if (parseBooleanWithDefault(process.env.OM_ENABLE_STORAGE_S3, false)) {',
|
|
208
|
+
" enabledModules.push({ id: 'storage_s3', from: '@open-mercato/storage-s3' })",
|
|
209
|
+
'}',
|
|
210
|
+
'',
|
|
211
|
+
'const enterpriseModulesEnabled = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES, false)',
|
|
212
|
+
'const enterpriseSsoEnabled = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO, false)',
|
|
213
|
+
'',
|
|
214
|
+
'if (enterpriseModulesEnabled && enterpriseSsoEnabled) {',
|
|
215
|
+
" enabledModules.push({ id: 'sso', from: '@open-mercato/enterprise' })",
|
|
216
|
+
'}',
|
|
217
|
+
].join('\n'),
|
|
218
|
+
)
|
|
219
|
+
return filePath
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
it('refuses to add a second entry for a module gated by a disabled env flag and names the flag', () => {
|
|
223
|
+
delete process.env.OM_ENABLE_STORAGE_S3
|
|
224
|
+
const filePath = writeGatedModulesFile()
|
|
225
|
+
const before = fs.readFileSync(filePath, 'utf8')
|
|
226
|
+
|
|
227
|
+
expect(() =>
|
|
228
|
+
ensureModuleRegistration(filePath, { id: 'storage_s3', from: '@open-mercato/storage-s3' }),
|
|
229
|
+
).toThrow(/storage_s3.*OM_ENABLE_STORAGE_S3=true/s)
|
|
230
|
+
expect(fs.readFileSync(filePath, 'utf8')).toBe(before)
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
it('treats a gated module whose env flag is on as already registered', () => {
|
|
234
|
+
process.env.OM_ENABLE_STORAGE_S3 = 'true'
|
|
235
|
+
const filePath = writeGatedModulesFile()
|
|
236
|
+
const before = fs.readFileSync(filePath, 'utf8')
|
|
237
|
+
|
|
238
|
+
const result = ensureModuleRegistration(filePath, {
|
|
239
|
+
id: 'storage_s3',
|
|
240
|
+
from: '@open-mercato/storage-s3',
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
expect(result).toEqual({ changed: false, registeredAs: '@open-mercato/storage-s3' })
|
|
244
|
+
expect(fs.readFileSync(filePath, 'utf8')).toBe(before)
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
it('names only the env flags still off when a gate reads them through variables', () => {
|
|
248
|
+
process.env.OM_ENABLE_ENTERPRISE_MODULES = 'true'
|
|
249
|
+
delete process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO
|
|
250
|
+
const filePath = writeGatedModulesFile()
|
|
251
|
+
|
|
252
|
+
let message = ''
|
|
253
|
+
try {
|
|
254
|
+
ensureModuleRegistration(filePath, { id: 'sso', from: '@open-mercato/enterprise' })
|
|
255
|
+
} catch (error) {
|
|
256
|
+
message = error instanceof Error ? error.message : String(error)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
expect(message).toContain('OM_ENABLE_ENTERPRISE_MODULES_SSO=true')
|
|
260
|
+
expect(message).not.toContain('OM_ENABLE_ENTERPRISE_MODULES=true')
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
it('covers every env-gated module of the create-app template', () => {
|
|
264
|
+
for (const name of flagNames) {
|
|
265
|
+
delete process.env[name]
|
|
266
|
+
}
|
|
267
|
+
const templatePath = path.resolve(__dirname, '../../../../create-app/template/src/modules.ts')
|
|
268
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
269
|
+
fs.copyFileSync(templatePath, filePath)
|
|
270
|
+
const before = fs.readFileSync(filePath, 'utf8')
|
|
271
|
+
|
|
272
|
+
const gatedModules: Array<{ id: string; from: string; flag: RegExp }> = [
|
|
273
|
+
{ id: 'storage_s3', from: '@open-mercato/storage-s3', flag: /OM_ENABLE_STORAGE_S3=true/ },
|
|
274
|
+
{ id: 'record_locks', from: '@open-mercato/enterprise', flag: /OM_ENABLE_ENTERPRISE_MODULES=true/ },
|
|
275
|
+
{ id: 'system_status_overlays', from: '@open-mercato/enterprise', flag: /OM_ENABLE_ENTERPRISE_MODULES=true/ },
|
|
276
|
+
{ id: 'sso', from: '@open-mercato/enterprise', flag: /OM_ENABLE_ENTERPRISE_MODULES_SSO=true/ },
|
|
277
|
+
{ id: 'security', from: '@open-mercato/enterprise', flag: /OM_ENABLE_ENTERPRISE_MODULES_SECURITY=true/ },
|
|
278
|
+
{ id: 'agent_orchestrator', from: '@open-mercato/enterprise', flag: /OM_ENABLE_ENTERPRISE_MODULES_AGENTS=true/ },
|
|
279
|
+
]
|
|
280
|
+
|
|
281
|
+
for (const gated of gatedModules) {
|
|
282
|
+
expect(() => ensureModuleRegistration(filePath, { id: gated.id, from: gated.from })).toThrow(gated.flag)
|
|
283
|
+
}
|
|
284
|
+
expect(fs.readFileSync(filePath, 'utf8')).toBe(before)
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
it('never suggests a flag value it cannot vouch for', () => {
|
|
288
|
+
process.env.OM_ENABLE_STORAGE_S3 = 'true'
|
|
289
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
290
|
+
fs.writeFileSync(
|
|
291
|
+
filePath,
|
|
292
|
+
[
|
|
293
|
+
"import { parseBooleanWithDefault } from '@open-mercato/shared/lib/boolean'",
|
|
294
|
+
'',
|
|
295
|
+
'const enableS3 = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES, false)',
|
|
296
|
+
'const settings = { enableS3: false }',
|
|
297
|
+
'',
|
|
298
|
+
'export const enabledModules = []',
|
|
299
|
+
'',
|
|
300
|
+
'if (!parseBooleanWithDefault(process.env.OM_ENABLE_STORAGE_S3, false)) {',
|
|
301
|
+
" enabledModules.push({ id: 'negated', from: '@open-mercato/negated' })",
|
|
302
|
+
'}',
|
|
303
|
+
'',
|
|
304
|
+
'if (parseBooleanWithDefault(process.env.OM_ENABLE_STORAGE_S3, false)) {',
|
|
305
|
+
" enabledModules.push({ id: 'unrelated', from: '@open-mercato/unrelated' })",
|
|
306
|
+
'} else {',
|
|
307
|
+
" enabledModules.push({ id: 'fallback', from: '@open-mercato/fallback' })",
|
|
308
|
+
'}',
|
|
309
|
+
'',
|
|
310
|
+
'if (settings.enableS3) {',
|
|
311
|
+
" enabledModules.push({ id: 'property_gated', from: '@open-mercato/property-gated' })",
|
|
312
|
+
'}',
|
|
313
|
+
].join('\n'),
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
for (const id of ['negated', 'fallback', 'property_gated']) {
|
|
317
|
+
let message = ''
|
|
318
|
+
try {
|
|
319
|
+
ensureModuleRegistration(filePath, { id, from: `@open-mercato/${id.replace('_', '-')}` })
|
|
320
|
+
} catch (error) {
|
|
321
|
+
message = error instanceof Error ? error.message : String(error)
|
|
322
|
+
}
|
|
323
|
+
expect(message).toContain('Make that condition true to enable it.')
|
|
324
|
+
expect(message).not.toMatch(/=true/)
|
|
325
|
+
}
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
function readGatedOffError(filePath: string, id: string): ModuleGatedOffError {
|
|
329
|
+
try {
|
|
330
|
+
ensureModuleRegistration(filePath, { id, from: '@open-mercato/gated' })
|
|
331
|
+
} catch (error) {
|
|
332
|
+
if (error instanceof ModuleGatedOffError) return error
|
|
333
|
+
throw error
|
|
334
|
+
}
|
|
335
|
+
throw new Error(`[internal] expected module "${id}" to be gated off`)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function writeConditionFile(statements: string[]): string {
|
|
339
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
340
|
+
fs.writeFileSync(
|
|
341
|
+
filePath,
|
|
342
|
+
[
|
|
343
|
+
"import { parseBooleanWithDefault } from '@open-mercato/shared/lib/boolean'",
|
|
344
|
+
'',
|
|
345
|
+
'const enterpriseEnabled = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES, false)',
|
|
346
|
+
'const s3Disabled = !parseBooleanWithDefault(process.env.OM_ENABLE_STORAGE_S3, false)',
|
|
347
|
+
'',
|
|
348
|
+
'export const enabledModules = []',
|
|
349
|
+
'',
|
|
350
|
+
...statements,
|
|
351
|
+
].join('\n'),
|
|
352
|
+
)
|
|
353
|
+
return filePath
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
it.each([
|
|
357
|
+
[
|
|
358
|
+
'a negated operand inside &&',
|
|
359
|
+
['if (enterpriseEnabled && !parseBooleanWithDefault(process.env.OM_ENABLE_STORAGE_S3, false)) {'],
|
|
360
|
+
],
|
|
361
|
+
['a comparison inside &&', ["if (enterpriseEnabled && process.env.OM_ENABLE_STORAGE_S3 !== 'true') {"]],
|
|
362
|
+
['a negated variable inside &&', ['if (enterpriseEnabled && s3Disabled) {']],
|
|
363
|
+
['a variable the parser does not know', ['if (enterpriseEnabled && unknownFlag) {']],
|
|
364
|
+
['an || condition', ['if (enterpriseEnabled || parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO, false)) {']],
|
|
365
|
+
])('asks to make the condition true for %s', (_label, condition) => {
|
|
366
|
+
process.env.OM_ENABLE_STORAGE_S3 = 'true'
|
|
367
|
+
delete process.env.OM_ENABLE_ENTERPRISE_MODULES
|
|
368
|
+
delete process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO
|
|
369
|
+
const filePath = writeConditionFile([
|
|
370
|
+
...condition,
|
|
371
|
+
" enabledModules.push({ id: 'gated', from: '@open-mercato/gated' })",
|
|
372
|
+
'}',
|
|
373
|
+
])
|
|
374
|
+
|
|
375
|
+
const error = readGatedOffError(filePath, 'gated')
|
|
376
|
+
expect(error.message).toContain('Make that condition true to enable it.')
|
|
377
|
+
expect(error.message).not.toMatch(/=true/)
|
|
378
|
+
expect(error.envFlags).toEqual([])
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
it('keeps an inner condition unvouched when the outer condition is not understood', () => {
|
|
382
|
+
process.env.OM_ENABLE_STORAGE_S3 = 'true'
|
|
383
|
+
delete process.env.OM_ENABLE_ENTERPRISE_MODULES
|
|
384
|
+
const filePath = writeConditionFile([
|
|
385
|
+
'if (s3Disabled) {',
|
|
386
|
+
' if (enterpriseEnabled) {',
|
|
387
|
+
" enabledModules.push({ id: 'gated', from: '@open-mercato/gated' })",
|
|
388
|
+
' }',
|
|
389
|
+
'}',
|
|
390
|
+
])
|
|
391
|
+
|
|
392
|
+
const error = readGatedOffError(filePath, 'gated')
|
|
393
|
+
expect(error.message).toContain('Make that condition true to enable it.')
|
|
394
|
+
expect(error.envFlags).toEqual([])
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
it('names the flags of nested positive conditions', () => {
|
|
398
|
+
delete process.env.OM_ENABLE_ENTERPRISE_MODULES
|
|
399
|
+
delete process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO
|
|
400
|
+
const filePath = writeConditionFile([
|
|
401
|
+
'if (enterpriseEnabled) {',
|
|
402
|
+
' if (parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO, false)) {',
|
|
403
|
+
" enabledModules.push({ id: 'gated', from: '@open-mercato/gated' })",
|
|
404
|
+
' }',
|
|
405
|
+
'}',
|
|
406
|
+
])
|
|
407
|
+
|
|
408
|
+
const error = readGatedOffError(filePath, 'gated')
|
|
409
|
+
expect(error.envFlags).toEqual(['OM_ENABLE_ENTERPRISE_MODULES', 'OM_ENABLE_ENTERPRISE_MODULES_SSO'])
|
|
410
|
+
expect(error.message).toContain('OM_ENABLE_ENTERPRISE_MODULES=true and OM_ENABLE_ENTERPRISE_MODULES_SSO=true')
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
it('throws a ModuleGatedOffError carrying the flags for a gated template module', () => {
|
|
414
|
+
delete process.env.OM_ENABLE_STORAGE_S3
|
|
415
|
+
const templatePath = path.resolve(__dirname, '../../../../create-app/template/src/modules.ts')
|
|
416
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
417
|
+
fs.copyFileSync(templatePath, filePath)
|
|
418
|
+
|
|
419
|
+
let thrown: unknown
|
|
420
|
+
try {
|
|
421
|
+
assertModuleNotGatedOff(filePath, 'storage_s3')
|
|
422
|
+
} catch (error) {
|
|
423
|
+
thrown = error
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
expect(thrown).toBeInstanceOf(ModuleGatedOffError)
|
|
427
|
+
const gatedOff = thrown as ModuleGatedOffError
|
|
428
|
+
expect(gatedOff.code).toBe('MODULE_GATED_OFF')
|
|
429
|
+
expect(gatedOff.moduleId).toBe('storage_s3')
|
|
430
|
+
expect(gatedOff.envFlags).toEqual(['OM_ENABLE_STORAGE_S3'])
|
|
431
|
+
expect(gatedOff.message).toContain('OM_ENABLE_STORAGE_S3=true')
|
|
432
|
+
expect(() => assertModuleNotGatedOff(filePath, 'auth')).not.toThrow()
|
|
433
|
+
})
|
|
434
|
+
|
|
435
|
+
it('ignores inactive gated entries when switching the source of an active registration', () => {
|
|
436
|
+
delete process.env.OM_ENABLE_STORAGE_S3
|
|
437
|
+
const filePath = writeGatedModulesFile()
|
|
438
|
+
|
|
439
|
+
expect(() => setModuleRegistrationSource(filePath, 'storage_s3', '@app')).toThrow(
|
|
440
|
+
/Could not find module entry for "storage_s3"/,
|
|
441
|
+
)
|
|
442
|
+
expect(setModuleRegistrationSource(filePath, 'auth', '@app')).toEqual({ changed: true })
|
|
443
|
+
})
|
|
444
|
+
})
|
|
445
|
+
|
|
446
|
+
describe('preserves the rest of the file when appending a module', () => {
|
|
447
|
+
const appendEntry = (source: string): string => {
|
|
448
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
449
|
+
fs.writeFileSync(filePath, source)
|
|
450
|
+
const result = ensureModuleRegistration(filePath, {
|
|
451
|
+
id: 'storage_s3',
|
|
452
|
+
from: '@open-mercato/storage-s3',
|
|
453
|
+
})
|
|
454
|
+
expect(result.changed).toBe(true)
|
|
455
|
+
return fs.readFileSync(filePath, 'utf8')
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
it('keeps line comments, block comments, blank lines and commented-out entries', () => {
|
|
459
|
+
const source = [
|
|
460
|
+
'// Central place to enable modules.',
|
|
461
|
+
'export const enabledModules: ModuleEntry[] = [',
|
|
462
|
+
" { id: 'auth', from: '@open-mercato/core' },",
|
|
463
|
+
' // customer_groups stays disabled by default:',
|
|
464
|
+
' // enabling it needs extra harness coverage.',
|
|
465
|
+
" // { id: 'customer_groups', from: '@open-mercato/core' },",
|
|
466
|
+
'',
|
|
467
|
+
' /* Communication channels hub.',
|
|
468
|
+
' * Provider packages register adapters here. */',
|
|
469
|
+
" { id: 'communication_channels', from: '@open-mercato/core' }, // trailing note",
|
|
470
|
+
" // { id: 'cart', from: '@open-mercato/core' },",
|
|
471
|
+
']',
|
|
472
|
+
'',
|
|
473
|
+
"if (process.env.OM_ENABLE_ENTERPRISE_MODULES === 'true') {",
|
|
474
|
+
" // enterprise modules",
|
|
475
|
+
" enabledModules.push({ id: 'record_locks', from: '@open-mercato/enterprise' })",
|
|
476
|
+
'}',
|
|
477
|
+
'',
|
|
478
|
+
].join('\n')
|
|
479
|
+
|
|
480
|
+
const updated = appendEntry(source)
|
|
481
|
+
|
|
482
|
+
expect(updated).toBe(
|
|
483
|
+
source.replace(
|
|
484
|
+
" { id: 'communication_channels', from: '@open-mercato/core' }, // trailing note\n",
|
|
485
|
+
" { id: 'communication_channels', from: '@open-mercato/core' }, // trailing note\n" +
|
|
486
|
+
" { id: 'storage_s3', from: '@open-mercato/storage-s3' },\n",
|
|
487
|
+
),
|
|
488
|
+
)
|
|
489
|
+
})
|
|
490
|
+
|
|
491
|
+
it('adds a separating comma when the last element has none', () => {
|
|
492
|
+
const source = [
|
|
493
|
+
'export const enabledModules = [',
|
|
494
|
+
" { id: 'auth', from: '@open-mercato/core' } // no trailing comma",
|
|
495
|
+
' // closing comment',
|
|
496
|
+
']',
|
|
497
|
+
'',
|
|
498
|
+
].join('\n')
|
|
499
|
+
|
|
500
|
+
expect(appendEntry(source)).toBe(
|
|
501
|
+
[
|
|
502
|
+
'export const enabledModules = [',
|
|
503
|
+
" { id: 'auth', from: '@open-mercato/core' }, // no trailing comma",
|
|
504
|
+
" { id: 'storage_s3', from: '@open-mercato/storage-s3' }",
|
|
505
|
+
' // closing comment',
|
|
506
|
+
']',
|
|
507
|
+
'',
|
|
508
|
+
].join('\n'),
|
|
509
|
+
)
|
|
510
|
+
})
|
|
511
|
+
|
|
512
|
+
it('fills an empty array and keeps its comments', () => {
|
|
513
|
+
expect(appendEntry('export const enabledModules = []\n')).toBe(
|
|
514
|
+
"export const enabledModules = [\n { id: 'storage_s3', from: '@open-mercato/storage-s3' },\n]\n",
|
|
515
|
+
)
|
|
516
|
+
expect(
|
|
517
|
+
appendEntry('export const enabledModules = [\n // nothing yet\n]\n'),
|
|
518
|
+
).toBe(
|
|
519
|
+
"export const enabledModules = [\n // nothing yet\n { id: 'storage_s3', from: '@open-mercato/storage-s3' },\n]\n",
|
|
520
|
+
)
|
|
521
|
+
})
|
|
522
|
+
|
|
523
|
+
it('keeps CRLF line endings', () => {
|
|
524
|
+
const source = "export const enabledModules = [\r\n // core\r\n { id: 'auth', from: '@open-mercato/core' },\r\n]\r\n"
|
|
525
|
+
expect(appendEntry(source)).toBe(
|
|
526
|
+
"export const enabledModules = [\r\n // core\r\n { id: 'auth', from: '@open-mercato/core' },\r\n { id: 'storage_s3', from: '@open-mercato/storage-s3' },\r\n]\r\n",
|
|
527
|
+
)
|
|
528
|
+
})
|
|
529
|
+
|
|
530
|
+
it('handles a spread or a comma-less last element', () => {
|
|
531
|
+
expect(
|
|
532
|
+
appendEntry("export const enabledModules = [\n { id: 'auth' },\n ...officialModuleEntries,\n]\n"),
|
|
533
|
+
).toBe(
|
|
534
|
+
"export const enabledModules = [\n { id: 'auth' },\n ...officialModuleEntries,\n { id: 'storage_s3', from: '@open-mercato/storage-s3' },\n]\n",
|
|
535
|
+
)
|
|
536
|
+
expect(appendEntry("export const enabledModules = [\n { id: 'auth' }\n]\n")).toBe(
|
|
537
|
+
"export const enabledModules = [\n { id: 'auth' },\n { id: 'storage_s3', from: '@open-mercato/storage-s3' }\n]\n",
|
|
538
|
+
)
|
|
539
|
+
})
|
|
540
|
+
|
|
541
|
+
it('indents from the opening line when brackets share a line with elements', () => {
|
|
542
|
+
expect(appendEntry("export const enabledModules = [{ id: 'auth' }]\n")).toBe(
|
|
543
|
+
"export const enabledModules = [{ id: 'auth' },\n { id: 'storage_s3', from: '@open-mercato/storage-s3' }\n]\n",
|
|
544
|
+
)
|
|
545
|
+
expect(appendEntry("export const enabledModules = [\n { id: 'auth' },\n { id: 'directory' }]\n")).toBe(
|
|
546
|
+
"export const enabledModules = [\n { id: 'auth' },\n { id: 'directory' },\n { id: 'storage_s3', from: '@open-mercato/storage-s3' }\n]\n",
|
|
547
|
+
)
|
|
548
|
+
})
|
|
549
|
+
|
|
550
|
+
it('leaves the create-app template untouched apart from the new entry', () => {
|
|
551
|
+
const templatePath = path.resolve(__dirname, '../../../../create-app/template/src/modules.ts')
|
|
552
|
+
const source = fs.readFileSync(templatePath, 'utf8')
|
|
553
|
+
const filePath = path.join(tmpDir, 'modules.ts')
|
|
554
|
+
fs.writeFileSync(filePath, source)
|
|
555
|
+
const added = " { id: 'template_probe', from: '@open-mercato/template-probe' },\n"
|
|
556
|
+
|
|
557
|
+
expect(source).not.toContain('template_probe')
|
|
558
|
+
expect(
|
|
559
|
+
ensureModuleRegistration(filePath, { id: 'template_probe', from: '@open-mercato/template-probe' }).changed,
|
|
560
|
+
).toBe(true)
|
|
561
|
+
|
|
562
|
+
const updated = fs.readFileSync(filePath, 'utf8')
|
|
563
|
+
expect(updated.length).toBe(source.length + added.length)
|
|
564
|
+
expect(updated.replace(added, '')).toBe(source)
|
|
565
|
+
expect(updated.split('\n').filter((line) => line.trim().startsWith('//'))).toEqual(
|
|
566
|
+
source.split('\n').filter((line) => line.trim().startsWith('//')),
|
|
567
|
+
)
|
|
568
|
+
})
|
|
569
|
+
})
|
|
570
|
+
})
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
describe('module provenance updates', () => {
|
|
574
|
+
it('updates only top-level origin properties and preserves nested overrides', () => {
|
|
575
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'module-config-provenance-'))
|
|
576
|
+
const modulesPath = path.join(root, 'modules.ts')
|
|
577
|
+
try {
|
|
578
|
+
fs.writeFileSync(modulesPath, "export const enabledModules = [{ id: 'consents', overrides: { custom: { from: 'nested', locator: 'keep-locator', packageName: 'keep-package' } } }]\n")
|
|
579
|
+
setModuleRegistrationSource(modulesPath, 'consents', '@app', { locator: 'github:pkarw/consents', packageName: '@pkarw/consents' })
|
|
580
|
+
const source = fs.readFileSync(modulesPath, 'utf8')
|
|
581
|
+
expect(source).toContain("custom: { from: 'nested', locator: 'keep-locator', packageName: 'keep-package' }")
|
|
582
|
+
expect(readEnabledModulesFromConfig(modulesPath)).toEqual([{ id: 'consents', from: '@app', locator: 'github:pkarw/consents', packageName: '@pkarw/consents' }])
|
|
583
|
+
} finally {
|
|
584
|
+
fs.rmSync(root, { recursive: true, force: true })
|
|
585
|
+
}
|
|
586
|
+
})
|
|
135
587
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events'
|
|
2
|
-
import
|
|
2
|
+
import { ChildProcess } from 'node:child_process'
|
|
3
3
|
import type { ModuleWorker } from '@open-mercato/shared/modules/registry'
|
|
4
4
|
import {
|
|
5
5
|
startLazyWorkerSupervisor,
|
|
@@ -203,6 +203,150 @@ describe('startLazyWorkerSupervisor', () => {
|
|
|
203
203
|
expect((child as any).kill).toHaveBeenCalledWith('SIGTERM')
|
|
204
204
|
})
|
|
205
205
|
|
|
206
|
+
it.each(['shared', 'per-queue'] as const)(
|
|
207
|
+
'waits once per child for deferred exits in %s mode across repeated lifecycles',
|
|
208
|
+
async (spawnMode) => {
|
|
209
|
+
for (let cycle = 0; cycle < 3; cycle += 1) {
|
|
210
|
+
const children: ChildProcess[] = []
|
|
211
|
+
const spawnFn = jest.fn(() => {
|
|
212
|
+
const child = new ChildProcess()
|
|
213
|
+
jest.spyOn(child, 'kill').mockReturnValue(true)
|
|
214
|
+
children.push(child)
|
|
215
|
+
return child
|
|
216
|
+
})
|
|
217
|
+
const queueNames = Array.from({ length: 12 }, (_, index) => `queue-${index}`)
|
|
218
|
+
const onChildExit = jest.fn()
|
|
219
|
+
const handle = startLazyWorkerSupervisor({
|
|
220
|
+
mercatoBin: '/tmp/mercato',
|
|
221
|
+
appDir: '/tmp/app',
|
|
222
|
+
runtimeEnv: {},
|
|
223
|
+
workers: queueNames.map((queueName) => makeWorker(queueName)),
|
|
224
|
+
pollMs: 250,
|
|
225
|
+
restartOnUnexpectedExit: true,
|
|
226
|
+
spawnMode,
|
|
227
|
+
spawnFn,
|
|
228
|
+
probeFn: async (queueName, strategy) => readyProbe(queueName, strategy),
|
|
229
|
+
logger: silentLogger,
|
|
230
|
+
onChildExit,
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
await flushAsync(20)
|
|
234
|
+
expect(children).toHaveLength(spawnMode === 'shared' ? 1 : 12)
|
|
235
|
+
for (const queueName of queueNames) {
|
|
236
|
+
expect(handle.getActiveChild(queueName)).toBeDefined()
|
|
237
|
+
}
|
|
238
|
+
let closed = false
|
|
239
|
+
const closing = Promise.all([handle.close(), handle.close(), handle.done]).then(() => {
|
|
240
|
+
closed = true
|
|
241
|
+
})
|
|
242
|
+
try {
|
|
243
|
+
for (const child of children) {
|
|
244
|
+
expect(child.listenerCount('exit')).toBe(2)
|
|
245
|
+
expect(child.kill).toHaveBeenCalledTimes(1)
|
|
246
|
+
expect(child.kill).toHaveBeenCalledWith('SIGTERM')
|
|
247
|
+
}
|
|
248
|
+
await flushAsync(20)
|
|
249
|
+
expect(closed).toBe(false)
|
|
250
|
+
for (const child of children.slice(0, -1)) {
|
|
251
|
+
child.emit('exit', 0, null)
|
|
252
|
+
}
|
|
253
|
+
await flushAsync(20)
|
|
254
|
+
expect(closed).toBe(false)
|
|
255
|
+
} finally {
|
|
256
|
+
for (const child of children) {
|
|
257
|
+
if (child.listenerCount('exit') > 1) child.emit('exit', 0, null)
|
|
258
|
+
}
|
|
259
|
+
await closing
|
|
260
|
+
}
|
|
261
|
+
expect(closed).toBe(true)
|
|
262
|
+
expect(onChildExit).toHaveBeenCalledTimes(12)
|
|
263
|
+
expect(handle.startedQueues.size).toBe(12)
|
|
264
|
+
for (const queueName of queueNames) {
|
|
265
|
+
expect(handle.getActiveChild(queueName)).toBeUndefined()
|
|
266
|
+
}
|
|
267
|
+
await handle.close()
|
|
268
|
+
for (const child of children) {
|
|
269
|
+
expect(child.listenerCount('exit')).toBe(1)
|
|
270
|
+
expect(child.kill).toHaveBeenCalledTimes(1)
|
|
271
|
+
}
|
|
272
|
+
expect(spawnFn).toHaveBeenCalledTimes(spawnMode === 'shared' ? 1 : 12)
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
it.each([
|
|
278
|
+
{ exitCode: 0, signalCode: null },
|
|
279
|
+
{ exitCode: null, signalCode: 'SIGTERM' },
|
|
280
|
+
])('does not wait for an already-exited shared child (%j)', async (exitState) => {
|
|
281
|
+
const child = new ChildProcess()
|
|
282
|
+
const kill = jest.spyOn(child, 'kill').mockReturnValue(true)
|
|
283
|
+
const handle = startLazyWorkerSupervisor({
|
|
284
|
+
mercatoBin: '/tmp/mercato',
|
|
285
|
+
appDir: '/tmp/app',
|
|
286
|
+
runtimeEnv: {},
|
|
287
|
+
workers: Array.from({ length: 12 }, (_, index) => makeWorker(`queue-${index}`)),
|
|
288
|
+
pollMs: 250,
|
|
289
|
+
restartOnUnexpectedExit: false,
|
|
290
|
+
spawnMode: 'shared',
|
|
291
|
+
spawnFn: () => child,
|
|
292
|
+
probeFn: async (queueName, strategy) => readyProbe(queueName, strategy),
|
|
293
|
+
logger: silentLogger,
|
|
294
|
+
})
|
|
295
|
+
await flushAsync(20)
|
|
296
|
+
Object.assign(child, exitState)
|
|
297
|
+
|
|
298
|
+
await handle.close()
|
|
299
|
+
await handle.done
|
|
300
|
+
expect(child.listenerCount('exit')).toBe(1)
|
|
301
|
+
expect(kill).toHaveBeenCalledTimes(1)
|
|
302
|
+
expect(handle.getActiveChild('queue-0')).toBeUndefined()
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
it('keeps shutdown waiters bounded after repeated unexpected shared-worker restarts', async () => {
|
|
306
|
+
const children: ChildProcess[] = []
|
|
307
|
+
const spawnFn = jest.fn(() => {
|
|
308
|
+
const child = new ChildProcess()
|
|
309
|
+
jest.spyOn(child, 'kill').mockReturnValue(true)
|
|
310
|
+
children.push(child)
|
|
311
|
+
return child
|
|
312
|
+
})
|
|
313
|
+
const handle = startLazyWorkerSupervisor({
|
|
314
|
+
mercatoBin: '/tmp/mercato',
|
|
315
|
+
appDir: '/tmp/app',
|
|
316
|
+
runtimeEnv: {},
|
|
317
|
+
workers: Array.from({ length: 12 }, (_, index) => makeWorker(`queue-${index}`)),
|
|
318
|
+
pollMs: 250,
|
|
319
|
+
restartOnUnexpectedExit: true,
|
|
320
|
+
spawnMode: 'shared',
|
|
321
|
+
spawnFn,
|
|
322
|
+
probeFn: async (queueName, strategy) => readyProbe(queueName, strategy),
|
|
323
|
+
logger: silentLogger,
|
|
324
|
+
})
|
|
325
|
+
await flushAsync(40)
|
|
326
|
+
for (const restart of [0, 1, 2]) {
|
|
327
|
+
const child = children[restart]
|
|
328
|
+
expect(child.listenerCount('exit')).toBe(1)
|
|
329
|
+
Object.assign(child, { exitCode: 1 })
|
|
330
|
+
child.emit('exit', 1, null)
|
|
331
|
+
await flushAsync(100)
|
|
332
|
+
expect(spawnFn).toHaveBeenCalledTimes(restart + 2)
|
|
333
|
+
expect(child.kill).not.toHaveBeenCalled()
|
|
334
|
+
expect(handle.getActiveChild('queue-0')).toBe(children[restart + 1])
|
|
335
|
+
}
|
|
336
|
+
const lastChild = children[3]
|
|
337
|
+
const closing = handle.close()
|
|
338
|
+
try {
|
|
339
|
+
expect(lastChild.listenerCount('exit')).toBe(2)
|
|
340
|
+
expect(lastChild.kill).toHaveBeenCalledTimes(1)
|
|
341
|
+
} finally {
|
|
342
|
+
lastChild.emit('exit', null, 'SIGTERM')
|
|
343
|
+
await closing
|
|
344
|
+
}
|
|
345
|
+
await flushAsync(40)
|
|
346
|
+
expect(spawnFn).toHaveBeenCalledTimes(4)
|
|
347
|
+
for (const child of children) expect(child.listenerCount('exit')).toBe(1)
|
|
348
|
+
})
|
|
349
|
+
|
|
206
350
|
it('starts the shared worker with extra arguments when an embedded scheduler needs it', async () => {
|
|
207
351
|
const child = createFakeChild()
|
|
208
352
|
const spawnFn = jest.fn(() => child) as unknown as jest.MockedFunction<LazySupervisorSpawnFn>
|