@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
|
@@ -144,6 +144,66 @@ describe('resolver enterprise module toggle', () => {
|
|
|
144
144
|
expect(modules).toEqual([{ id: 'customers', from: '@open-mercato/core' }])
|
|
145
145
|
})
|
|
146
146
|
|
|
147
|
+
it('keeps one registration per module id and warns about duplicates', () => {
|
|
148
|
+
process.env.OM_ENABLE_ENTERPRISE_MODULES = 'true'
|
|
149
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'resolver-duplicate-'))
|
|
150
|
+
fs.mkdirSync(path.join(tempDir, 'src'), { recursive: true })
|
|
151
|
+
fs.writeFileSync(
|
|
152
|
+
path.join(tempDir, 'src', 'modules.ts'),
|
|
153
|
+
`
|
|
154
|
+
import { parseBooleanWithDefault } from '@open-mercato/shared/lib/boolean'
|
|
155
|
+
|
|
156
|
+
export const enabledModules = [
|
|
157
|
+
{ id: 'customers', from: '@open-mercato/core' },
|
|
158
|
+
{ id: 'record_locks', from: '@open-mercato/enterprise' },
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
if (parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES, false)) {
|
|
162
|
+
enabledModules.push({ id: 'record_locks', from: '@open-mercato/enterprise' })
|
|
163
|
+
}
|
|
164
|
+
`,
|
|
165
|
+
'utf8',
|
|
166
|
+
)
|
|
167
|
+
const warn = jest.spyOn(console, 'warn').mockImplementation(() => {})
|
|
168
|
+
|
|
169
|
+
try {
|
|
170
|
+
const modules = createResolver(tempDir).loadEnabledModules()
|
|
171
|
+
expect(modules.filter((entry) => entry.id === 'record_locks')).toHaveLength(1)
|
|
172
|
+
expect(modules.map((entry) => entry.id)).toEqual(['customers', 'record_locks'])
|
|
173
|
+
expect(warn).toHaveBeenCalledWith(expect.stringContaining('Module "record_locks" is registered more than once'))
|
|
174
|
+
} finally {
|
|
175
|
+
warn.mockRestore()
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
it('carries the full dev bootstrap mark from a dropped duplicate onto the kept registration', () => {
|
|
180
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'resolver-duplicate-bootstrap-'))
|
|
181
|
+
fs.mkdirSync(path.join(tempDir, 'src'), { recursive: true })
|
|
182
|
+
fs.writeFileSync(
|
|
183
|
+
path.join(tempDir, 'src', 'modules.ts'),
|
|
184
|
+
`
|
|
185
|
+
export const enabledModules = [
|
|
186
|
+
{ id: 'events', from: '@open-mercato/events' },
|
|
187
|
+
{ id: 'events', from: '@open-mercato/events', overrides: { cli: { start: null } } },
|
|
188
|
+
{ id: 'queue', from: '@open-mercato/core', overrides: { workers: { 'queue:process': null } } },
|
|
189
|
+
{ id: 'queue', from: '@open-mercato/core' },
|
|
190
|
+
]
|
|
191
|
+
`,
|
|
192
|
+
'utf8',
|
|
193
|
+
)
|
|
194
|
+
const warn = jest.spyOn(console, 'warn').mockImplementation(() => {})
|
|
195
|
+
|
|
196
|
+
try {
|
|
197
|
+
expect(createResolver(tempDir).loadEnabledModules()).toEqual([
|
|
198
|
+
{ id: 'events', from: '@open-mercato/events', devSupervisorRequiresFullBootstrap: true },
|
|
199
|
+
{ id: 'queue', from: '@open-mercato/core', devSupervisorRequiresFullBootstrap: true },
|
|
200
|
+
])
|
|
201
|
+
expect(warn).toHaveBeenCalledWith(expect.stringContaining('Module "events" is registered more than once'))
|
|
202
|
+
} finally {
|
|
203
|
+
warn.mockRestore()
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
|
|
147
207
|
it('parses modules.ts statically without executing runtime side effects', () => {
|
|
148
208
|
delete (globalThis as Record<string, unknown>).__resolver_evaluated__
|
|
149
209
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'resolver-enterprise-'))
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import os from 'node:os'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import { createResolver } from '../resolver'
|
|
5
|
+
|
|
6
|
+
describe('installed package paths in monorepos', () => {
|
|
7
|
+
let root: string
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
root = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'resolver-packages-')))
|
|
10
|
+
fs.mkdirSync(path.join(root, 'packages', 'core', 'src', 'modules'), { recursive: true })
|
|
11
|
+
fs.writeFileSync(path.join(root, 'packages', 'core', 'package.json'), JSON.stringify({ name: '@open-mercato/core' }))
|
|
12
|
+
fs.mkdirSync(path.join(root, 'node_modules', '@open-mercato'), { recursive: true })
|
|
13
|
+
fs.symlinkSync(path.join(root, 'packages', 'core'), path.join(root, 'node_modules', '@open-mercato', 'core'))
|
|
14
|
+
fs.mkdirSync(path.join(root, 'apps', 'mercato', 'src'), { recursive: true })
|
|
15
|
+
fs.writeFileSync(path.join(root, 'apps', 'mercato', 'package.json'), JSON.stringify({ name: 'app' }))
|
|
16
|
+
})
|
|
17
|
+
afterEach(() => fs.rmSync(root, { recursive: true, force: true }))
|
|
18
|
+
|
|
19
|
+
it.each(['@pkarw/consents', '@open-mercato/consents', 'consents'])('resolves installed package %s without falling back to core', (packageName) => {
|
|
20
|
+
const packageRoot = path.join(root, 'node_modules', packageName)
|
|
21
|
+
fs.mkdirSync(path.join(packageRoot, 'dist', 'modules', 'consents'), { recursive: true })
|
|
22
|
+
fs.writeFileSync(path.join(packageRoot, 'package.json'), JSON.stringify({ name: packageName }))
|
|
23
|
+
const resolver = createResolver(path.join(root, 'apps', 'mercato'))
|
|
24
|
+
expect(resolver.isMonorepo()).toBe(true)
|
|
25
|
+
expect(resolver.getPackageRoot(packageName)).toBe(packageRoot)
|
|
26
|
+
expect(resolver.getModulePaths({ id: 'consents', from: packageName }).pkgBase).toBe(path.join(packageRoot, 'dist', 'modules', 'consents'))
|
|
27
|
+
expect(resolver.getModulePaths({ id: 'customers', from: '@open-mercato/core' }).pkgBase).toBe(path.join(root, 'packages', 'core', 'src', 'modules', 'customers'))
|
|
28
|
+
})
|
|
29
|
+
})
|
|
@@ -164,7 +164,7 @@ describe('mercato telemetry init', () => {
|
|
|
164
164
|
|
|
165
165
|
const pkg = JSON.parse(read('package.json'))
|
|
166
166
|
expect(pkg.dependencies['@open-mercato/telemetry']).toBe('1.2.3')
|
|
167
|
-
expect(pkg.optionalDependencies['bullmq-otel']).toBe('^
|
|
167
|
+
expect(pkg.optionalDependencies['bullmq-otel']).toBe('^2.0.1')
|
|
168
168
|
|
|
169
169
|
expect(read('.env.example')).toContain('TELEMETRY_BACKEND')
|
|
170
170
|
expect(read('.env.example')).toContain('OTEL_EXPORTER_OTLP_ENDPOINT')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { quotePostgresIdentifier } from '../identifiers'
|
|
2
|
+
|
|
3
|
+
describe('quotePostgresIdentifier', () => {
|
|
4
|
+
it.each([
|
|
5
|
+
['a plain name', 'open_mercato', '"open_mercato"'],
|
|
6
|
+
['case, digits, and hyphens', 'Open-Mercato_123', '"Open-Mercato_123"'],
|
|
7
|
+
['a single embedded quote', 'open"mercato', '"open""mercato"'],
|
|
8
|
+
['multiple embedded quotes', 'open""mercato"db', '"open""""mercato""db"'],
|
|
9
|
+
['a dotted name as one identifier', 'schema.table', '"schema.table"'],
|
|
10
|
+
['Unicode characters', 'zażółć_数据库', '"zażółć_数据库"'],
|
|
11
|
+
[
|
|
12
|
+
'SQL-like contents as one identifier',
|
|
13
|
+
'database"; DROP DATABASE postgres;--',
|
|
14
|
+
'"database""; DROP DATABASE postgres;--"',
|
|
15
|
+
],
|
|
16
|
+
])('quotes %s without changing its contents', (_description, identifier, expected) => {
|
|
17
|
+
expect(quotePostgresIdentifier(identifier)).toBe(expected)
|
|
18
|
+
})
|
|
19
|
+
})
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import os from 'node:os'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import { EntitySchema } from '@mikro-orm/core'
|
|
5
|
+
import { Migrator } from '@mikro-orm/migrations'
|
|
6
|
+
import { MikroORM } from '@mikro-orm/postgresql'
|
|
7
|
+
import { ExactDecimalType } from '@open-mercato/shared/lib/db/exactDecimalType'
|
|
8
|
+
import { preserveUnconstrainedNumericSnapshots } from '../numeric-snapshots'
|
|
9
|
+
|
|
10
|
+
class SnapshotProbeMigrator extends Migrator {
|
|
11
|
+
writeSnapshot() {
|
|
12
|
+
return this.storeCurrentSchema()
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe('unconstrained numeric migration snapshots', () => {
|
|
17
|
+
let orm: MikroORM
|
|
18
|
+
let migrationsPath: string
|
|
19
|
+
|
|
20
|
+
beforeAll(async () => {
|
|
21
|
+
migrationsPath = fs.mkdtempSync(path.join(os.tmpdir(), 'numeric-snapshots-'))
|
|
22
|
+
orm = await MikroORM.init({
|
|
23
|
+
entities: [new EntitySchema({
|
|
24
|
+
name: 'NumericSnapshotProbe',
|
|
25
|
+
tableName: 'numeric_snapshot_probes',
|
|
26
|
+
properties: {
|
|
27
|
+
id: { type: 'uuid', primary: true },
|
|
28
|
+
amount: { type: ExactDecimalType, columnType: 'numeric' },
|
|
29
|
+
rate: { type: ExactDecimalType },
|
|
30
|
+
percentage: { type: 'decimal', precision: 7, scale: 4 },
|
|
31
|
+
},
|
|
32
|
+
})],
|
|
33
|
+
dbName: 'numeric_snapshot_probe',
|
|
34
|
+
connect: false,
|
|
35
|
+
extensions: [Migrator],
|
|
36
|
+
migrations: {
|
|
37
|
+
path: migrationsPath,
|
|
38
|
+
pathTs: migrationsPath,
|
|
39
|
+
snapshotName: '.snapshot-probe',
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
preserveUnconstrainedNumericSnapshots(orm.em.getDriver().getPlatform())
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
afterAll(async () => {
|
|
46
|
+
await orm?.close(true)
|
|
47
|
+
if (migrationsPath) fs.rmSync(migrationsPath, { recursive: true, force: true })
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('preserves bare numeric aliases and delegates bounded and other types', () => {
|
|
51
|
+
const platform = orm.em.getDriver().getPlatform()
|
|
52
|
+
|
|
53
|
+
expect(platform.normalizeColumnType('numeric', {})).toBe('numeric')
|
|
54
|
+
expect(platform.normalizeColumnType('decimal', {})).toBe('numeric')
|
|
55
|
+
expect(platform.normalizeColumnType('numeric', { precision: 7, scale: 4 })).toBe('numeric(7,4)')
|
|
56
|
+
expect(platform.normalizeColumnType('numeric(7,4)', { precision: 7, scale: 4 })).toBe('numeric(7,4)')
|
|
57
|
+
expect(platform.normalizeColumnType('numeric', { precision: 7 })).toBe('numeric(7,0)')
|
|
58
|
+
expect(platform.normalizeColumnType('numeric', { scale: 4 })).toBe('numeric(10,4)')
|
|
59
|
+
expect(platform.normalizeColumnType('integer', {})).toBe('int')
|
|
60
|
+
expect(platform.normalizeColumnType('varchar', { length: 50 })).toBe('varchar(50)')
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('writes actual numeric snapshot columns and produces no migration on repeated generation', async () => {
|
|
64
|
+
const migrator = new SnapshotProbeMigrator(orm.em)
|
|
65
|
+
await migrator.writeSnapshot()
|
|
66
|
+
|
|
67
|
+
const snapshot: {
|
|
68
|
+
tables: { columns: Record<string, { type: string; precision: number | null; scale: number | null }> }[]
|
|
69
|
+
} = JSON.parse(fs.readFileSync(path.join(migrationsPath, '.snapshot-probe.json'), 'utf8'))
|
|
70
|
+
const columns = snapshot.tables[0].columns
|
|
71
|
+
|
|
72
|
+
expect(columns.amount).toMatchObject({ type: 'numeric', precision: null, scale: null })
|
|
73
|
+
expect(columns.rate).toMatchObject({ type: 'numeric', precision: null, scale: null })
|
|
74
|
+
expect(columns.percentage).toMatchObject({ type: 'numeric(7,4)', precision: 7, scale: 4 })
|
|
75
|
+
expect(await orm.migrator.create()).toMatchObject({ fileName: '', diff: { up: [], down: [] } })
|
|
76
|
+
expect(await orm.migrator.create()).toMatchObject({ fileName: '', diff: { up: [], down: [] } })
|
|
77
|
+
expect(fs.readdirSync(migrationsPath)).toEqual(['.snapshot-probe.json'])
|
|
78
|
+
})
|
|
79
|
+
})
|
package/src/lib/db/commands.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { PostgreSqlDriver } from '@mikro-orm/postgresql'
|
|
|
9
9
|
import { getSslConfig } from '@open-mercato/shared/lib/db/ssl'
|
|
10
10
|
import type { PackageResolver, ModuleEntry } from '../resolver'
|
|
11
11
|
import { quotePostgresIdentifier } from './identifiers'
|
|
12
|
+
import { preserveUnconstrainedNumericSnapshots } from './numeric-snapshots'
|
|
12
13
|
import {
|
|
13
14
|
checkEncryptionMapBackfills,
|
|
14
15
|
isEncryptionBackfillCheckEnabled,
|
|
@@ -400,6 +401,7 @@ export async function dbGenerate(resolver: PackageResolver, options: DbOptions =
|
|
|
400
401
|
})
|
|
401
402
|
|
|
402
403
|
try {
|
|
404
|
+
preserveUnconstrainedNumericSnapshots(orm.em.getDriver().getPlatform())
|
|
403
405
|
const diff = await orm.migrator.create(undefined, false, createInitialMigration)
|
|
404
406
|
if (diff && diff.fileName) {
|
|
405
407
|
try {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Platform } from '@mikro-orm/core'
|
|
2
|
+
|
|
3
|
+
export function preserveUnconstrainedNumericSnapshots(platform: Pick<Platform, 'normalizeColumnType'>): void {
|
|
4
|
+
const normalizeColumnType = platform.normalizeColumnType.bind(platform)
|
|
5
|
+
|
|
6
|
+
platform.normalizeColumnType = (type, options) => {
|
|
7
|
+
if (/^(numeric|decimal)$/i.test(type) && options.precision == null && options.scale == null) {
|
|
8
|
+
return 'numeric'
|
|
9
|
+
}
|
|
10
|
+
return normalizeColumnType(type, options)
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/lib/eject.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import fs from 'node:fs'
|
|
3
|
-
import { setModuleRegistrationSource } from './modules-config'
|
|
3
|
+
import { prepareModuleRegistrationSource, setModuleRegistrationSource } from './modules-config'
|
|
4
4
|
import type { PackageResolver, ModuleEntry } from './resolver'
|
|
5
|
-
import { resolveInstalledOfficialModulePackage } from './module-package'
|
|
5
|
+
import { isModulePackageExportError, resolveInstalledOfficialModulePackage, resolveInstalledPackageRoot } from './module-package'
|
|
6
|
+
import { normalizeModuleLocator } from '@open-mercato/shared/modules/module-locators'
|
|
7
|
+
import { getEnabledModuleIdentities } from './module-identity'
|
|
6
8
|
|
|
7
9
|
type ModuleMetadata = {
|
|
8
10
|
ejectable?: boolean
|
|
@@ -178,8 +180,8 @@ export function copyDirRecursive(src: string, dest: string): void {
|
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
export function updateModulesTs(modulesPath: string, moduleId: string): void {
|
|
182
|
-
setModuleRegistrationSource(modulesPath, moduleId, '@app')
|
|
183
|
+
export function updateModulesTs(modulesPath: string, moduleId: string, provenance?: Pick<ModuleEntry, 'locator' | 'packageName'>): void {
|
|
184
|
+
setModuleRegistrationSource(modulesPath, moduleId, '@app', provenance)
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
export type EjectableModule = {
|
|
@@ -239,7 +241,8 @@ function resolveModuleSource(
|
|
|
239
241
|
description: modulePackage.moduleInfo.description,
|
|
240
242
|
},
|
|
241
243
|
}
|
|
242
|
-
} catch {
|
|
244
|
+
} catch (error) {
|
|
245
|
+
if (isModulePackageExportError(error)) throw error
|
|
243
246
|
return { pkgBase, metadata: fallbackMetadata }
|
|
244
247
|
}
|
|
245
248
|
}
|
|
@@ -268,7 +271,9 @@ export function listEjectableModules(resolver: PackageResolver): EjectableModule
|
|
|
268
271
|
|
|
269
272
|
export function ejectModule(resolver: PackageResolver, moduleId: string): void {
|
|
270
273
|
const modules = resolver.loadEnabledModules()
|
|
271
|
-
const
|
|
274
|
+
const identities = getEnabledModuleIdentities(resolver, modules)
|
|
275
|
+
const matches = modules.filter((module: ModuleEntry) => module.id === moduleId)
|
|
276
|
+
const entry = matches[0]
|
|
272
277
|
|
|
273
278
|
if (!entry) {
|
|
274
279
|
throw new Error(
|
|
@@ -302,13 +307,26 @@ export function ejectModule(resolver: PackageResolver, moduleId: string): void {
|
|
|
302
307
|
if (fs.existsSync(appBase)) {
|
|
303
308
|
throw new Error(
|
|
304
309
|
`Destination directory already exists: ${appBase}. ` +
|
|
305
|
-
`
|
|
310
|
+
`Keep the existing local source and review the destination conflict before ejecting.`,
|
|
306
311
|
)
|
|
307
312
|
}
|
|
308
313
|
|
|
314
|
+
const locators = identities.find((identity) => identity.id === moduleId)?.locators ?? []
|
|
315
|
+
const packageRoot = resolveInstalledPackageRoot(resolver, entry.from || '@open-mercato/core')
|
|
316
|
+
const manifest: unknown = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'))
|
|
317
|
+
const packageName = manifest && typeof manifest === 'object' && 'name' in manifest && typeof manifest.name === 'string'
|
|
318
|
+
? manifest.name
|
|
319
|
+
: undefined
|
|
320
|
+
if (!packageName || normalizeModuleLocator(`npm:${packageName}`) !== `npm:${packageName}`) {
|
|
321
|
+
throw new Error(`Cannot retain source provenance for module "${moduleId}": the installed package manifest has no valid name.`)
|
|
322
|
+
}
|
|
323
|
+
const locator = locators.find((identity) => identity.startsWith('github:')) ?? locators.find((identity) => identity.startsWith('npm:'))
|
|
324
|
+
const provenance = { ...(packageName ? { packageName } : {}), ...(locator ? { locator } : {}) }
|
|
325
|
+
const modulesPath = resolver.getModulesConfigPath()
|
|
326
|
+
const originalConfig = fs.readFileSync(modulesPath, 'utf8')
|
|
327
|
+
const updatedConfig = prepareModuleRegistrationSource(originalConfig, moduleId, '@app', provenance)
|
|
328
|
+
|
|
309
329
|
copyDirRecursive(pkgBase, appBase)
|
|
310
330
|
rewriteCrossModuleImports(pkgBase, appBase, moduleId, entry.from || '@open-mercato/core')
|
|
311
|
-
|
|
312
|
-
const modulesPath = resolver.getModulesConfigPath()
|
|
313
|
-
updateModulesTs(modulesPath, moduleId)
|
|
331
|
+
fs.writeFileSync(modulesPath, updatedConfig)
|
|
314
332
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import { parseEnv } from 'node:util'
|
|
4
|
+
|
|
5
|
+
// Mirrors scripts/dev-env-file.mjs: .env.example ships no tenant encryption key
|
|
6
|
+
// (#7231), so a .env materialized from it gets a unique machine-local key once.
|
|
7
|
+
const GENERATED_SECRET_KEYS = ['TENANT_DATA_ENCRYPTION_FALLBACK_KEY'] as const
|
|
8
|
+
|
|
9
|
+
export function fillEmptyEnvSecrets(
|
|
10
|
+
content: string,
|
|
11
|
+
randomSource: (size: number) => Buffer = randomBytes,
|
|
12
|
+
): string {
|
|
13
|
+
const example = parseEnv(content)
|
|
14
|
+
const keyNames = ['TENANT_DATA_ENCRYPTION_FALLBACK_KEY', 'TENANT_DATA_ENCRYPTION_KEY']
|
|
15
|
+
const configured = keyNames.some((key) =>
|
|
16
|
+
[process.env[key], example[key]].some((value) =>
|
|
17
|
+
(value ?? '').trim().replace(/^['"]|['"]$/g, '').trim().length > 0))
|
|
18
|
+
if (configured) return content
|
|
19
|
+
let next = content
|
|
20
|
+
for (const key of GENERATED_SECRET_KEYS) {
|
|
21
|
+
const pattern = new RegExp(`^(${key}=)[ \\t]*(\\r?)$`, 'm')
|
|
22
|
+
next = next.replace(pattern, (_match, prefix: string, lineEnd: string) =>
|
|
23
|
+
`${prefix}${randomSource(32).toString('hex')}${lineEnd}`)
|
|
24
|
+
}
|
|
25
|
+
return next
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function createEnvFileFromExample(examplePath: string, envPath: string): void {
|
|
29
|
+
const content = fs.readFileSync(examplePath, 'utf8')
|
|
30
|
+
fs.writeFileSync(envPath, fillEmptyEnvSecrets(content), { flag: 'wx' })
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Evaluate application modules in a disposable process, never in the watcher.
|
|
5
|
+
* Native ESM keeps every cache-busted module revision until its process exits;
|
|
6
|
+
* a fresh process also observes edits to unchanged modules' imported dependencies.
|
|
7
|
+
*/
|
|
8
|
+
export async function runGenerateChildProcess(options: {
|
|
9
|
+
mercatoBin: string
|
|
10
|
+
cwd: string
|
|
11
|
+
env?: NodeJS.ProcessEnv
|
|
12
|
+
quiet?: boolean
|
|
13
|
+
}): Promise<void> {
|
|
14
|
+
const args = [options.mercatoBin, 'generate', 'all']
|
|
15
|
+
if (options.quiet) args.push('--quiet')
|
|
16
|
+
|
|
17
|
+
await new Promise<void>((resolve, reject) => {
|
|
18
|
+
const child = spawn(process.execPath, args, {
|
|
19
|
+
cwd: options.cwd,
|
|
20
|
+
env: options.env ?? process.env,
|
|
21
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
22
|
+
})
|
|
23
|
+
child.once('error', reject)
|
|
24
|
+
// Wait for close, not just exit: generation and inherited stream cleanup
|
|
25
|
+
// must finish before another cycle or supervisor restart can proceed.
|
|
26
|
+
child.once('close', (code, signal) => {
|
|
27
|
+
if (code === 0) resolve()
|
|
28
|
+
else reject(new Error(
|
|
29
|
+
signal
|
|
30
|
+
? `Generator process terminated by ${signal}`
|
|
31
|
+
: `Generator process exited with code ${code ?? 'unknown'}`,
|
|
32
|
+
))
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
}
|
|
@@ -221,6 +221,79 @@ describe('createAgentFilesExtension', () => {
|
|
|
221
221
|
).toThrow(/malformed SAMPLE\.json/)
|
|
222
222
|
})
|
|
223
223
|
|
|
224
|
+
function writeAgentMd(appBase: string, extraFrontmatter: string[]): string {
|
|
225
|
+
const agentDir = path.join(appBase, 'agents', 'deals_health_check')
|
|
226
|
+
fs.writeFileSync(
|
|
227
|
+
path.join(agentDir, 'AGENT.md'),
|
|
228
|
+
[
|
|
229
|
+
'---',
|
|
230
|
+
'id: deals.health_check',
|
|
231
|
+
'label: Deal health check',
|
|
232
|
+
'description: Assess a deal.',
|
|
233
|
+
...extraFrontmatter,
|
|
234
|
+
'---',
|
|
235
|
+
'You assess a deal.',
|
|
236
|
+
].join('\n'),
|
|
237
|
+
'utf8',
|
|
238
|
+
)
|
|
239
|
+
return agentDir
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function readManifest(root: string): string {
|
|
243
|
+
return fs.readFileSync(
|
|
244
|
+
path.join(root, 'packages/enterprise/src/modules/agent_orchestrator/generated/file-agents.generated.ts'),
|
|
245
|
+
'utf8',
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
it('emits inline-list requiredFeatures into the manifest (deduped)', () => {
|
|
250
|
+
const fixture = makeRepoFixture()
|
|
251
|
+
repoRoot = fixture.repoRoot
|
|
252
|
+
writeAgentMd(fixture.appBase, ['requiredFeatures: [deals.health.run, customers.deals.view, deals.health.run]'])
|
|
253
|
+
|
|
254
|
+
const extension = createAgentFilesExtension()
|
|
255
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase))
|
|
256
|
+
extension.generateOutput()
|
|
257
|
+
|
|
258
|
+
const manifest = readManifest(repoRoot)
|
|
259
|
+
expect(manifest).toContain('requiredFeatures: ["deals.health.run","customers.deals.view"],')
|
|
260
|
+
expect(manifest).toContain(' requiredFeatures?: string[]')
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
it('emits block-list requiredFeatures into the manifest', () => {
|
|
264
|
+
const fixture = makeRepoFixture()
|
|
265
|
+
repoRoot = fixture.repoRoot
|
|
266
|
+
writeAgentMd(fixture.appBase, ['requiredFeatures:', ' - deals.health.run', ' - customers.*'])
|
|
267
|
+
|
|
268
|
+
const extension = createAgentFilesExtension()
|
|
269
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase))
|
|
270
|
+
extension.generateOutput()
|
|
271
|
+
|
|
272
|
+
expect(readManifest(repoRoot)).toContain('requiredFeatures: ["deals.health.run","customers.*"],')
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
it('omits requiredFeatures from a descriptor that declares none', () => {
|
|
276
|
+
const fixture = makeRepoFixture()
|
|
277
|
+
repoRoot = fixture.repoRoot
|
|
278
|
+
|
|
279
|
+
const extension = createAgentFilesExtension()
|
|
280
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase))
|
|
281
|
+
extension.generateOutput()
|
|
282
|
+
|
|
283
|
+
expect(readManifest(repoRoot)).not.toContain('requiredFeatures: [')
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
it('fails generation on a malformed requiredFeatures entry', () => {
|
|
287
|
+
const fixture = makeRepoFixture()
|
|
288
|
+
repoRoot = fixture.repoRoot
|
|
289
|
+
writeAgentMd(fixture.appBase, ['requiredFeatures: [deals health run]'])
|
|
290
|
+
|
|
291
|
+
const extension = createAgentFilesExtension()
|
|
292
|
+
expect(() =>
|
|
293
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase)),
|
|
294
|
+
).toThrow(/invalid requiredFeatures entry "deals health run"/)
|
|
295
|
+
})
|
|
296
|
+
|
|
224
297
|
it('emits an agent FACTS.json into the manifest as facts', () => {
|
|
225
298
|
const fixture = makeRepoFixture()
|
|
226
299
|
repoRoot = fixture.repoRoot
|
|
@@ -266,6 +339,78 @@ describe('createAgentFilesExtension', () => {
|
|
|
266
339
|
).toThrow(/malformed FACTS\.json/)
|
|
267
340
|
})
|
|
268
341
|
|
|
342
|
+
it('emits an agent GOVERNANCE.json into the manifest as governance', () => {
|
|
343
|
+
const fixture = makeRepoFixture()
|
|
344
|
+
repoRoot = fixture.repoRoot
|
|
345
|
+
const agentDir = path.join(fixture.appBase, 'agents', 'deals_health_check')
|
|
346
|
+
const governance = {
|
|
347
|
+
principal: { roleFeatures: ['customers.deals.view'], toolAcl: 'intersect' },
|
|
348
|
+
untrustedInputs: [{ label: 'Notes', path: 'deal.notes' }],
|
|
349
|
+
modelSettings: { temperature: 0 },
|
|
350
|
+
}
|
|
351
|
+
fs.writeFileSync(path.join(agentDir, 'GOVERNANCE.json'), JSON.stringify(governance), 'utf8')
|
|
352
|
+
|
|
353
|
+
const extension = createAgentFilesExtension()
|
|
354
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase))
|
|
355
|
+
extension.generateOutput()
|
|
356
|
+
|
|
357
|
+
const manifest = fs.readFileSync(
|
|
358
|
+
path.join(repoRoot, 'packages/enterprise/src/modules/agent_orchestrator/generated/file-agents.generated.ts'),
|
|
359
|
+
'utf8',
|
|
360
|
+
)
|
|
361
|
+
expect(manifest).toContain(
|
|
362
|
+
'governance: {"principal":{"roleFeatures":["customers.deals.view"],"toolAcl":"intersect"},"modelSettings":{"temperature":0},"untrustedInputs":[{"label":"Notes","path":"deal.notes"}]}',
|
|
363
|
+
)
|
|
364
|
+
expect(manifest).toContain('export type FileAgentGovernance')
|
|
365
|
+
expect(manifest).toContain('"path":"GOVERNANCE.json"')
|
|
366
|
+
})
|
|
367
|
+
|
|
368
|
+
it('omits governance when GOVERNANCE.json is an empty object', () => {
|
|
369
|
+
const fixture = makeRepoFixture()
|
|
370
|
+
repoRoot = fixture.repoRoot
|
|
371
|
+
const agentDir = path.join(fixture.appBase, 'agents', 'deals_health_check')
|
|
372
|
+
fs.writeFileSync(path.join(agentDir, 'GOVERNANCE.json'), '{}', 'utf8')
|
|
373
|
+
|
|
374
|
+
const extension = createAgentFilesExtension()
|
|
375
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase))
|
|
376
|
+
extension.generateOutput()
|
|
377
|
+
|
|
378
|
+
const manifest = fs.readFileSync(
|
|
379
|
+
path.join(repoRoot, 'packages/enterprise/src/modules/agent_orchestrator/generated/file-agents.generated.ts'),
|
|
380
|
+
'utf8',
|
|
381
|
+
)
|
|
382
|
+
expect(manifest).not.toContain('governance: {')
|
|
383
|
+
})
|
|
384
|
+
|
|
385
|
+
it.each([
|
|
386
|
+
['an unknown key', { allowedActions: [] }, /unknown key "allowedActions"/],
|
|
387
|
+
['a non-array integrity', { integrity: { id: 'x' } }, /"integrity" must be an array/],
|
|
388
|
+
['a non-object principal', { principal: ['customers.deals.view'] }, /"principal" must be an object/],
|
|
389
|
+
['a top-level array', [], /expected a JSON object/],
|
|
390
|
+
])('fails generation on a GOVERNANCE.json with %s', (_label, content, message) => {
|
|
391
|
+
const fixture = makeRepoFixture()
|
|
392
|
+
repoRoot = fixture.repoRoot
|
|
393
|
+
const agentDir = path.join(fixture.appBase, 'agents', 'deals_health_check')
|
|
394
|
+
fs.writeFileSync(path.join(agentDir, 'GOVERNANCE.json'), JSON.stringify(content), 'utf8')
|
|
395
|
+
|
|
396
|
+
const extension = createAgentFilesExtension()
|
|
397
|
+
expect(() =>
|
|
398
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase)),
|
|
399
|
+
).toThrow(message)
|
|
400
|
+
})
|
|
401
|
+
|
|
402
|
+
it('fails generation on a GOVERNANCE.json that is not valid JSON', () => {
|
|
403
|
+
const fixture = makeRepoFixture()
|
|
404
|
+
repoRoot = fixture.repoRoot
|
|
405
|
+
const agentDir = path.join(fixture.appBase, 'agents', 'deals_health_check')
|
|
406
|
+
fs.writeFileSync(path.join(agentDir, 'GOVERNANCE.json'), '{ principal: ', 'utf8')
|
|
407
|
+
|
|
408
|
+
const extension = createAgentFilesExtension()
|
|
409
|
+
expect(() =>
|
|
410
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase)),
|
|
411
|
+
).toThrow(/malformed GOVERNANCE\.json/)
|
|
412
|
+
})
|
|
413
|
+
|
|
269
414
|
it('fails generation on a malformed agent dir (missing OUTCOME.md)', () => {
|
|
270
415
|
const fixture = makeRepoFixture()
|
|
271
416
|
repoRoot = fixture.repoRoot
|
|
@@ -397,6 +542,39 @@ describe('createAgentFilesExtension', () => {
|
|
|
397
542
|
).toThrow(/unsupported keyword "oneOf"/)
|
|
398
543
|
})
|
|
399
544
|
|
|
545
|
+
it('warns, without failing, about an OUTCOME.md object that declares no properties (A-2)', () => {
|
|
546
|
+
const fixture = makeRepoFixture()
|
|
547
|
+
const agentDir = path.join(fixture.appBase, 'agents', 'deals_health_check')
|
|
548
|
+
fs.writeFileSync(
|
|
549
|
+
path.join(agentDir, 'OUTCOME.md'),
|
|
550
|
+
[
|
|
551
|
+
'---',
|
|
552
|
+
'kind: research',
|
|
553
|
+
'---',
|
|
554
|
+
'```json',
|
|
555
|
+
JSON.stringify({
|
|
556
|
+
type: 'object',
|
|
557
|
+
properties: { summary: { type: 'string' }, meta: { type: 'object' }, rows: { type: 'array', items: { type: 'object' } } },
|
|
558
|
+
}),
|
|
559
|
+
'```',
|
|
560
|
+
].join('\n'),
|
|
561
|
+
'utf8',
|
|
562
|
+
)
|
|
563
|
+
const warn = jest.spyOn(console, 'warn').mockImplementation(() => {})
|
|
564
|
+
try {
|
|
565
|
+
const extension = createAgentFilesExtension()
|
|
566
|
+
expect(() =>
|
|
567
|
+
extension.scanModule(createScanContext('agent_examples', fixture.appBase, fixture.pkgBase)),
|
|
568
|
+
).not.toThrow()
|
|
569
|
+
const messages = warn.mock.calls.map((call) => String(call[0]))
|
|
570
|
+
expect(messages.some((message) => message.includes('the object at $.meta declares no properties'))).toBe(true)
|
|
571
|
+
expect(messages.some((message) => message.includes('the object at $.rows[] declares no properties'))).toBe(true)
|
|
572
|
+
expect(messages.some((message) => message.includes('$.summary'))).toBe(false)
|
|
573
|
+
} finally {
|
|
574
|
+
warn.mockRestore()
|
|
575
|
+
}
|
|
576
|
+
})
|
|
577
|
+
|
|
400
578
|
it('fails generation when an OUTCOME.md schema node has no supported type (M2)', () => {
|
|
401
579
|
const fixture = makeRepoFixture()
|
|
402
580
|
const agentDir = path.join(fixture.appBase, 'agents', 'deals_health_check')
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import os from 'node:os'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import ts from 'typescript-js'
|
|
5
|
+
import type { ModuleEntry, PackageResolver } from '../../resolver'
|
|
6
|
+
import { generateModuleRegistry } from '../module-registry'
|
|
7
|
+
|
|
8
|
+
const REPO_ROOT = path.resolve(__dirname, '../../../../../..')
|
|
9
|
+
let fixtureRoot: string
|
|
10
|
+
|
|
11
|
+
function write(relative: string, content: string): void {
|
|
12
|
+
const target = path.join(fixtureRoot, relative)
|
|
13
|
+
fs.mkdirSync(path.dirname(target), { recursive: true })
|
|
14
|
+
fs.writeFileSync(target, content)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
beforeEach(() => { fixtureRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'attachment-access-generator-')) })
|
|
18
|
+
afterEach(() => fs.rmSync(fixtureRoot, { recursive: true, force: true }))
|
|
19
|
+
|
|
20
|
+
it.each([false, true])('discovers nested attachment policies and removes disabled adopters (standalone=%s)', async (standalone) => {
|
|
21
|
+
const packageRoot = standalone ? 'node_modules/fixture' : 'packages/core'
|
|
22
|
+
const moduleRoot = `${packageRoot}/${standalone ? 'dist' : 'src'}/modules`
|
|
23
|
+
const extension = standalone ? 'js' : 'ts'
|
|
24
|
+
const source = fs.readFileSync(path.join(REPO_ROOT, 'packages/core/src/modules/attachments/generators.ts'), 'utf8')
|
|
25
|
+
const compiled = ts.transpileModule(source, {
|
|
26
|
+
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 },
|
|
27
|
+
}).outputText
|
|
28
|
+
write(`${moduleRoot}/attachments/generators.${extension}`, compiled)
|
|
29
|
+
write(`${moduleRoot}/documents/data/attachment-access.${extension}`, 'export const attachmentAccessResolvers = []; export const protectedAttachmentTargets = []')
|
|
30
|
+
write(`${moduleRoot}/clinical/data/attachment-access.${extension}`, 'export const attachmentAccessResolvers = []')
|
|
31
|
+
const outputDir = path.join(fixtureRoot, '.mercato/generated')
|
|
32
|
+
const entries: ModuleEntry[] = [
|
|
33
|
+
{ id: 'attachments', from: '@open-mercato/core' },
|
|
34
|
+
{ id: 'documents', from: '@open-mercato/documents' },
|
|
35
|
+
{ id: 'clinical', from: '@open-mercato/core' },
|
|
36
|
+
]
|
|
37
|
+
const resolver: PackageResolver = {
|
|
38
|
+
isMonorepo: () => !standalone,
|
|
39
|
+
getRootDir: () => fixtureRoot,
|
|
40
|
+
getAppDir: () => fixtureRoot,
|
|
41
|
+
getOutputDir: () => outputDir,
|
|
42
|
+
getModulesConfigPath: () => path.join(fixtureRoot, 'src/modules.ts'),
|
|
43
|
+
discoverPackages: () => [],
|
|
44
|
+
loadEnabledModules: () => entries,
|
|
45
|
+
getModulePaths: (entry) => ({
|
|
46
|
+
appBase: path.join(fixtureRoot, 'src/modules', entry.id),
|
|
47
|
+
pkgBase: path.join(fixtureRoot, moduleRoot, entry.id),
|
|
48
|
+
}),
|
|
49
|
+
getModuleImportBase: (entry) => ({
|
|
50
|
+
appBase: `@/modules/${entry.id}`,
|
|
51
|
+
pkgBase: `${entry.from}/modules/${entry.id}`,
|
|
52
|
+
}),
|
|
53
|
+
getPackageOutputDir: () => outputDir,
|
|
54
|
+
getPackageRoot: () => path.join(fixtureRoot, packageRoot),
|
|
55
|
+
}
|
|
56
|
+
const first = await generateModuleRegistry({ resolver, quiet: true })
|
|
57
|
+
expect(first.errors).toEqual([])
|
|
58
|
+
const read = (name: string) => fs.readFileSync(path.join(outputDir, name), 'utf8')
|
|
59
|
+
const registry = read('attachment-access.generated.ts')
|
|
60
|
+
expect(registry).toContain('@open-mercato/documents/modules/documents/data/attachment-access')
|
|
61
|
+
expect(registry).toContain('protectedAttachmentTargets')
|
|
62
|
+
expect(registry.indexOf("moduleId: 'documents'")).toBeLessThan(registry.indexOf("moduleId: 'clinical'"))
|
|
63
|
+
expect(read('bootstrap-registrations.generated.ts')).toContain('registerAttachmentAccessResolvers(attachmentAccessEntries)')
|
|
64
|
+
|
|
65
|
+
entries.splice(1, 1)
|
|
66
|
+
const second = await generateModuleRegistry({ resolver, quiet: true })
|
|
67
|
+
expect(second.errors).toEqual([])
|
|
68
|
+
expect(read('attachment-access.generated.ts')).not.toContain('documents/data/attachment-access')
|
|
69
|
+
expect(read('attachment-access.generated.ts')).toContain('clinical/data/attachment-access')
|
|
70
|
+
})
|