@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
package/src/mercato.ts
CHANGED
|
@@ -9,7 +9,9 @@ export { getCliModules, hasCliModules, registerCliModules }
|
|
|
9
9
|
import { parseBooleanToken } from '@open-mercato/shared/lib/boolean'
|
|
10
10
|
import { getSslConfig } from '@open-mercato/shared/lib/db/ssl'
|
|
11
11
|
import { getRedisUrl, getRedisUrlOrThrow, parseRedisUrl } from '@open-mercato/shared/lib/redis/connection'
|
|
12
|
-
import {
|
|
12
|
+
import { formatInitSummary } from './lib/init-summary'
|
|
13
|
+
import { resolveInitDerivedSecrets, resolveInitSuperadminCredentials } from './lib/init-secrets'
|
|
14
|
+
import { decideExistingDatabase, formatSkipIfInitializedMessage } from './lib/init-existing-database'
|
|
13
15
|
import {
|
|
14
16
|
resolveAutoSpawnWorkersMode,
|
|
15
17
|
resolveLazySpawnMode,
|
|
@@ -34,11 +36,13 @@ import {
|
|
|
34
36
|
startInProcessGenerateWatcher,
|
|
35
37
|
type GenerateWatcherHandle,
|
|
36
38
|
} from './lib/in-process-generate-watcher'
|
|
39
|
+
import { runGenerateChildProcess } from './lib/generate-child-process'
|
|
37
40
|
import {
|
|
38
41
|
resolveGenerateWatcherMode,
|
|
39
42
|
type GenerateWatcherMode,
|
|
40
43
|
} from './lib/in-process-generate-watcher-mode'
|
|
41
44
|
import { parseModuleInstallArgs } from './lib/module-install-args'
|
|
45
|
+
import type { ModuleCommandResult } from './lib/module-install'
|
|
42
46
|
import { resolveNextBuildIdCandidate } from './lib/next-build-id'
|
|
43
47
|
import { acquireServerStartLock } from './lib/server-start-lock'
|
|
44
48
|
import { assertSingleInstanceStrategies } from './lib/single-instance-strategy-guard'
|
|
@@ -231,6 +235,39 @@ function formatCliFailureMessage(modName: string, cmdName: string, error: unknow
|
|
|
231
235
|
return fallbackMessage
|
|
232
236
|
}
|
|
233
237
|
|
|
238
|
+
// Options that carry key material or credentials in every command that accepts them, so the
|
|
239
|
+
// echoed command line must never reproduce their values: argv is world-readable through
|
|
240
|
+
// `ps`/`/proc`, and this line additionally lands in terminal scrollback and CI logs.
|
|
241
|
+
const SENSITIVE_MODULE_CLI_OPTIONS = new Set([
|
|
242
|
+
'--old-key',
|
|
243
|
+
'--oldKey',
|
|
244
|
+
'--password',
|
|
245
|
+
'--api-key',
|
|
246
|
+
'--apiKey',
|
|
247
|
+
])
|
|
248
|
+
|
|
249
|
+
// `--key` is ambiguous: it is a base64 encryption key in `seeds encrypt|decrypt|load` but a
|
|
250
|
+
// custom-field key in `entities add-field`, so it is redacted only where it means a secret.
|
|
251
|
+
const SENSITIVE_MODULE_CLI_OPTIONS_BY_COMMAND = new Map<string, string[]>([
|
|
252
|
+
['seeds:encrypt', ['--key']],
|
|
253
|
+
['seeds:decrypt', ['--key']],
|
|
254
|
+
['seeds:load', ['--key']],
|
|
255
|
+
])
|
|
256
|
+
|
|
257
|
+
function redactSensitiveModuleCliArgs(args: string[], commandKey: string): string[] {
|
|
258
|
+
const sensitive = new Set(SENSITIVE_MODULE_CLI_OPTIONS)
|
|
259
|
+
for (const option of SENSITIVE_MODULE_CLI_OPTIONS_BY_COMMAND.get(commandKey) ?? []) sensitive.add(option)
|
|
260
|
+
return args.map((argument, index) => {
|
|
261
|
+
const separatorIndex = argument.indexOf('=')
|
|
262
|
+
if (separatorIndex > 0) {
|
|
263
|
+
const option = argument.slice(0, separatorIndex)
|
|
264
|
+
if (sensitive.has(option)) return `${option}=****`
|
|
265
|
+
}
|
|
266
|
+
if (index > 0 && sensitive.has(args[index - 1]!)) return '****'
|
|
267
|
+
return argument
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
|
|
234
271
|
function formatInitFailureMessage(error: unknown): string {
|
|
235
272
|
const fallbackMessage = getFallbackErrorMessage(error)
|
|
236
273
|
const databaseIssue = detectDatabaseConnectionIssue(error)
|
|
@@ -267,7 +304,7 @@ async function ensureDatabaseExists(dbUrl: string): Promise<boolean> {
|
|
|
267
304
|
|
|
268
305
|
console.log(` Database "${dbName}" does not exist. Attempting to create it...`)
|
|
269
306
|
try {
|
|
270
|
-
await adminClient.query(`CREATE DATABASE
|
|
307
|
+
await adminClient.query(`CREATE DATABASE ${quotePostgresIdentifier(dbName)}`)
|
|
271
308
|
console.log(` Database "${dbName}" created successfully.`)
|
|
272
309
|
return true
|
|
273
310
|
} catch (createError: unknown) {
|
|
@@ -326,8 +363,14 @@ async function ensureEnvLoaded(options: { createIfMissing?: boolean; quiet?: boo
|
|
|
326
363
|
) {
|
|
327
364
|
const examplePath = path.join(appDir, '.env.example')
|
|
328
365
|
if (fs.existsSync(examplePath)) {
|
|
329
|
-
|
|
330
|
-
|
|
366
|
+
const { createEnvFileFromExample } = await import('./lib/env-example.js')
|
|
367
|
+
createEnvFileFromExample(examplePath, envPath)
|
|
368
|
+
console.log('')
|
|
369
|
+
console.log('⚠️ No .env was found, so one was created from .env.example.')
|
|
370
|
+
console.log(` ${envPath}`)
|
|
371
|
+
console.log(' A unique tenant encryption key was generated; keep it — data encrypted with it is unreadable without it.')
|
|
372
|
+
console.log(' It carries the example placeholders — review DATABASE_URL and secrets before continuing.')
|
|
373
|
+
console.log('')
|
|
331
374
|
}
|
|
332
375
|
}
|
|
333
376
|
if (fs.existsSync(envPath)) {
|
|
@@ -339,10 +382,19 @@ async function ensureEnvLoaded(options: { createIfMissing?: boolean; quiet?: boo
|
|
|
339
382
|
// Resolver might fail during early init, fall back to default behavior
|
|
340
383
|
}
|
|
341
384
|
|
|
342
|
-
//
|
|
385
|
+
// Preserve dotenv/config's environment/argv options in the cwd fallback.
|
|
386
|
+
const previousDotenvQuiet = process.env.DOTENV_CONFIG_QUIET
|
|
343
387
|
try {
|
|
388
|
+
if (quietDotenv) process.env.DOTENV_CONFIG_QUIET = 'true'
|
|
344
389
|
await import('dotenv/config')
|
|
345
|
-
} catch {
|
|
390
|
+
} catch {
|
|
391
|
+
// Environment loading remains best effort.
|
|
392
|
+
} finally {
|
|
393
|
+
if (quietDotenv) {
|
|
394
|
+
if (previousDotenvQuiet === undefined) delete process.env.DOTENV_CONFIG_QUIET
|
|
395
|
+
else process.env.DOTENV_CONFIG_QUIET = previousDotenvQuiet
|
|
396
|
+
}
|
|
397
|
+
}
|
|
346
398
|
}
|
|
347
399
|
|
|
348
400
|
function resolveInstalledBinary(baseDirs: string[], relativeBinPath: string): string {
|
|
@@ -674,6 +726,22 @@ function ensureNextBuildIdInConfiguredDistDir(appDir: string): void {
|
|
|
674
726
|
)
|
|
675
727
|
}
|
|
676
728
|
|
|
729
|
+
function printModuleCommandResult(result: ModuleCommandResult, alreadyEnabledNote?: string): void {
|
|
730
|
+
if (!result.registrationChanged) {
|
|
731
|
+
console.log(`\nℹ️ Module "${result.moduleId}" from "${result.from}" is already enabled in modules.ts. Nothing to change.`)
|
|
732
|
+
if (alreadyEnabledNote) {
|
|
733
|
+
console.log(alreadyEnabledNote)
|
|
734
|
+
}
|
|
735
|
+
console.log('')
|
|
736
|
+
return
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
console.log(`\n✅ Module "${result.moduleId}" enabled from ${result.from}.\n`)
|
|
740
|
+
console.log('Next steps:')
|
|
741
|
+
console.log(' 1. Review generated files if needed: .mercato/generated/')
|
|
742
|
+
console.log(' 2. Start dev: yarn dev')
|
|
743
|
+
}
|
|
744
|
+
|
|
677
745
|
async function handleDirectEjectCommand(args: string[]): Promise<number> {
|
|
678
746
|
const { createResolver } = await import('./lib/resolver')
|
|
679
747
|
const { listEjectableModules, ejectModule } = await import('./lib/eject')
|
|
@@ -775,12 +843,7 @@ async function runPostGenerateStructuralInvalidation(quiet: boolean): Promise<vo
|
|
|
775
843
|
}
|
|
776
844
|
}
|
|
777
845
|
|
|
778
|
-
/**
|
|
779
|
-
* Generator suite invoked by both `mercato generate all` and the in-process
|
|
780
|
-
* generate watcher embedded in `mercato server dev`. Hoisted to module scope
|
|
781
|
-
* so the watcher embedded in the server lifecycle can reuse the same closure
|
|
782
|
-
* without re-importing the closure-scoped version inside `buildBaseModules`.
|
|
783
|
-
*/
|
|
846
|
+
/** Full one-shot suite; long-lived watchers invoke this in a disposable CLI process. */
|
|
784
847
|
async function runGeneratorSuite(quiet: boolean): Promise<boolean> {
|
|
785
848
|
const { createResolver } = await import('./lib/resolver')
|
|
786
849
|
const {
|
|
@@ -816,6 +879,17 @@ async function runGeneratorSuiteWithStructuralInvalidation(quiet: boolean): Prom
|
|
|
816
879
|
await runPostGenerateStructuralInvalidation(quiet)
|
|
817
880
|
}
|
|
818
881
|
|
|
882
|
+
async function runWatchGeneratorSuite(): Promise<void> {
|
|
883
|
+
// Keep resolver setup behind command dispatch; other CLI modes do not need it.
|
|
884
|
+
const { resolveEnvironment } = await import('./lib/resolver')
|
|
885
|
+
const { rootDir, appDir } = resolveEnvironment()
|
|
886
|
+
await runGenerateChildProcess({
|
|
887
|
+
mercatoBin: resolveInstalledBinary([rootDir, appDir], '@open-mercato/cli/bin/mercato'),
|
|
888
|
+
cwd: process.cwd(),
|
|
889
|
+
quiet: true,
|
|
890
|
+
})
|
|
891
|
+
}
|
|
892
|
+
|
|
819
893
|
/**
|
|
820
894
|
* Builds the event-gated structural fingerprint runtime used by generate
|
|
821
895
|
* watchers. Filesystem events mark the tree dirty; the existing full content
|
|
@@ -894,14 +968,74 @@ async function buildAllModules(): Promise<Module[]> {
|
|
|
894
968
|
return all
|
|
895
969
|
}
|
|
896
970
|
|
|
971
|
+
export function isHelpRequest(args: string[]): boolean {
|
|
972
|
+
return args.some((arg) => arg === '--help' || arg === '-h')
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
// Top-level commands that return before the module dispatcher and therefore never reach its
|
|
976
|
+
// generic help branch. Without an entry here, `mercato init --help` runs a full install.
|
|
977
|
+
const TOP_LEVEL_COMMAND_HELP: Record<string, string[]> = {
|
|
978
|
+
init: [
|
|
979
|
+
'Usage: mercato init [--reinstall|-r] [--skip-if-initialized] [--no-examples] [--no-demo-users] [--stresstest [--lite] [--count=<n>]]',
|
|
980
|
+
'Initializes this app: installs dependencies, runs generators, applies migrations and seeds data.',
|
|
981
|
+
],
|
|
982
|
+
'agentic:init': [
|
|
983
|
+
'Usage: mercato agentic:init [--force]',
|
|
984
|
+
'Scaffolds the agentic harness (AGENTS.md, .ai/ config and skills) into this app.',
|
|
985
|
+
],
|
|
986
|
+
'seed:defaults': [
|
|
987
|
+
'Usage: mercato seed:defaults [--module <moduleId>]',
|
|
988
|
+
'Runs every enabled module\'s seedDefaults hook, or only the named module\'s.',
|
|
989
|
+
],
|
|
990
|
+
'umes:list': [
|
|
991
|
+
'Usage: mercato umes:list',
|
|
992
|
+
'Lists the extension points every enabled module declares.',
|
|
993
|
+
],
|
|
994
|
+
'umes:inspect': [
|
|
995
|
+
'Usage: mercato umes:inspect --module <moduleId>',
|
|
996
|
+
'Prints the extension surface a single module declares.',
|
|
997
|
+
],
|
|
998
|
+
'umes:check': [
|
|
999
|
+
'Usage: mercato umes:check',
|
|
1000
|
+
'Validates declared extension points against the modules that implement them.',
|
|
1001
|
+
],
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// A help invocation must never materialize .env from .env.example — asking what the flags are
|
|
1005
|
+
// should not mutate the working tree, least of all with the example's placeholder DATABASE_URL.
|
|
1006
|
+
// `module search` and `module info` only read the catalog, so they never create .env either, and
|
|
1007
|
+
// their output stays clean: dotenv prints its `injected env` line on stdout, which breaks
|
|
1008
|
+
// `--json | jq` and agents that parse the tools@1 contract. Any `--json` run stays quiet.
|
|
1009
|
+
export function resolveEnvBootstrapOptions(parts: string[]): { createIfMissing: boolean; quiet: boolean } {
|
|
1010
|
+
const first = parts[0]
|
|
1011
|
+
const opaqueEnvCommand = first === 'deploy' || first === 'telemetry'
|
|
1012
|
+
const readOnlyModuleCommand = first === 'module' && (parts[1] === 'search' || parts[1] === 'info')
|
|
1013
|
+
const jsonOutput = parts.includes('--json')
|
|
1014
|
+
const quietGeneration = first === 'generate' && (parts.includes('--quiet') || parts.includes('-q'))
|
|
1015
|
+
const helpRequested = isHelpRequest(parts)
|
|
1016
|
+
return {
|
|
1017
|
+
createIfMissing: !helpRequested && !opaqueEnvCommand && !readOnlyModuleCommand,
|
|
1018
|
+
quiet: helpRequested || opaqueEnvCommand || readOnlyModuleCommand || jsonOutput || quietGeneration,
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
897
1022
|
export async function run(argv = process.argv) {
|
|
898
1023
|
const [, , ...parts] = argv
|
|
899
1024
|
const [first, second, ...remaining] = parts
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1025
|
+
const quietGeneration = first === 'generate' && (parts.includes('--quiet') || parts.includes('-q'))
|
|
1026
|
+
// Help must never have side effects: it must not create .env, and must not fall through
|
|
1027
|
+
// to the command it is asking about.
|
|
1028
|
+
const helpRequested = isHelpRequest(parts)
|
|
1029
|
+
await ensureEnvLoaded(resolveEnvBootstrapOptions(parts))
|
|
1030
|
+
|
|
1031
|
+
// Object.hasOwn, not a truthiness check: the map is indexed with raw user input, and an
|
|
1032
|
+
// inherited Object.prototype member (`constructor`, `toString`, …) would otherwise pass the
|
|
1033
|
+
// guard and then fail to iterate instead of reporting the module as not found.
|
|
1034
|
+
if (helpRequested && first && Object.hasOwn(TOP_LEVEL_COMMAND_HELP, first)) {
|
|
1035
|
+
for (const line of TOP_LEVEL_COMMAND_HELP[first]) console.log(` ${line}`)
|
|
1036
|
+
return 0
|
|
1037
|
+
}
|
|
1038
|
+
|
|
905
1039
|
// Handle init command directly
|
|
906
1040
|
if (first === 'init') {
|
|
907
1041
|
const { execSync } = await import('child_process')
|
|
@@ -917,7 +1051,10 @@ export async function run(argv = process.argv) {
|
|
|
917
1051
|
} else if (process.env.OM_INIT_REINSTALL) {
|
|
918
1052
|
delete process.env.OM_INIT_REINSTALL
|
|
919
1053
|
}
|
|
1054
|
+
const skipIfInitialized = initArgs.includes('--skip-if-initialized')
|
|
1055
|
+
const credentials = skipIfInitialized && !reinstall ? undefined : resolveInitSuperadminCredentials(initArgs)
|
|
920
1056
|
const skipExamples = initArgs.includes('--no-examples')
|
|
1057
|
+
const skipDemoUsers = initArgs.includes('--no-demo-users')
|
|
921
1058
|
const stressTestEnabled =
|
|
922
1059
|
initArgs.includes('--stresstest') || initArgs.includes('--stress-test')
|
|
923
1060
|
const stressTestLite =
|
|
@@ -958,6 +1095,7 @@ export async function run(argv = process.argv) {
|
|
|
958
1095
|
}
|
|
959
1096
|
console.log(`🔄 Reinstall mode: ${reinstall ? 'enabled' : 'disabled'}`)
|
|
960
1097
|
console.log(`🎨 Example content: ${skipExamples ? 'skipped (--no-examples)' : 'enabled'}`)
|
|
1098
|
+
console.log(`👤 Demo accounts (admin@/employee@): ${skipDemoUsers ? 'skipped (--no-demo-users)' : 'enabled'}`)
|
|
961
1099
|
console.log(
|
|
962
1100
|
`🏋️ Stress test dataset: ${
|
|
963
1101
|
stressTestEnabled
|
|
@@ -1068,7 +1206,12 @@ export async function run(argv = process.argv) {
|
|
|
1068
1206
|
'SELECT COUNT(*)::text AS count FROM users',
|
|
1069
1207
|
)
|
|
1070
1208
|
const existingUsersCount = Number.parseInt(countResult.rows?.[0]?.count ?? '0', 10)
|
|
1071
|
-
|
|
1209
|
+
const existingDatabase = decideExistingDatabase(existingUsersCount, skipIfInitialized)
|
|
1210
|
+
if (existingDatabase === 'skip') {
|
|
1211
|
+
for (const line of formatSkipIfInitializedMessage(existingUsersCount, dbUrl)) console.log(line)
|
|
1212
|
+
return 0
|
|
1213
|
+
}
|
|
1214
|
+
if (existingDatabase === 'abort') {
|
|
1072
1215
|
console.error(
|
|
1073
1216
|
`❌ Initialization aborted: found ${existingUsersCount} existing user(s) in the database.`,
|
|
1074
1217
|
)
|
|
@@ -1087,6 +1230,8 @@ export async function run(argv = process.argv) {
|
|
|
1087
1230
|
}
|
|
1088
1231
|
}
|
|
1089
1232
|
|
|
1233
|
+
const { email, password, skipPasswordPolicy } = credentials ?? resolveInitSuperadminCredentials(initArgs)
|
|
1234
|
+
|
|
1090
1235
|
// Step 1: Run generators directly (no process spawn)
|
|
1091
1236
|
console.log('🔧 Preparing modules (registry, entities, DI)...')
|
|
1092
1237
|
const { createResolver } = await import('./lib/resolver')
|
|
@@ -1135,36 +1280,40 @@ export async function run(argv = process.argv) {
|
|
|
1135
1280
|
}
|
|
1136
1281
|
return fallback
|
|
1137
1282
|
}
|
|
1138
|
-
const readEnvDefault = (key: string) => {
|
|
1139
|
-
const value = process.env[key]
|
|
1140
|
-
if (typeof value === 'string' && value.trim().length > 0) return value.trim()
|
|
1141
|
-
return undefined
|
|
1142
|
-
}
|
|
1143
|
-
const defaultEmail = readEnvDefault('OM_INIT_SUPERADMIN_EMAIL') ?? 'superadmin@acme.com'
|
|
1144
|
-
const defaultPassword = readEnvDefault('OM_INIT_SUPERADMIN_PASSWORD') ?? 'secret'
|
|
1145
1283
|
const orgName = findArgValue(['--org=', '--orgName='], 'Acme Corp')
|
|
1146
|
-
const email = findArgValue(['--email='], defaultEmail)
|
|
1147
|
-
const password = findArgValue(['--password='], defaultPassword)
|
|
1148
1284
|
const derivedSecrets = resolveInitDerivedSecrets({ email, env: process.env })
|
|
1149
1285
|
const adminEmailDerived = derivedSecrets.adminEmail
|
|
1150
1286
|
const employeeEmailDerived = derivedSecrets.employeeEmail
|
|
1151
|
-
if (adminEmailDerived && derivedSecrets.adminPassword) {
|
|
1287
|
+
if (!skipDemoUsers && adminEmailDerived && derivedSecrets.adminPassword) {
|
|
1152
1288
|
process.env.OM_INIT_ADMIN_PASSWORD = derivedSecrets.adminPassword
|
|
1153
1289
|
}
|
|
1154
|
-
if (employeeEmailDerived && derivedSecrets.employeePassword) {
|
|
1290
|
+
if (!skipDemoUsers && employeeEmailDerived && derivedSecrets.employeePassword) {
|
|
1155
1291
|
process.env.OM_INIT_EMPLOYEE_PASSWORD = derivedSecrets.employeePassword
|
|
1156
1292
|
}
|
|
1293
|
+
// Symmetrical with the passwords above: setupInitialTenant derives admin/employee
|
|
1294
|
+
// emails from a hardcoded DEFAULT_DERIVED_EMAIL_DOMAIN ('acme.com') when these are
|
|
1295
|
+
// unset, so without this the summary banner (which reads adminEmailDerived/
|
|
1296
|
+
// employeeEmailDerived directly) and the actually-seeded accounts silently disagree
|
|
1297
|
+
// for any --email domain other than acme.com (#5806). Skip when --no-demo-users
|
|
1298
|
+
// (no accounts are created) or when the derived address equals the superadmin's
|
|
1299
|
+
// own email — otherwise deactivateDemoUsersIfSelfOnboardingEnabled would treat
|
|
1300
|
+
// the superadmin as a demo account and lock them out.
|
|
1301
|
+
const primaryEmailLower = email.trim().toLowerCase()
|
|
1302
|
+
if (
|
|
1303
|
+
!skipDemoUsers &&
|
|
1304
|
+
adminEmailDerived &&
|
|
1305
|
+
adminEmailDerived.trim().toLowerCase() !== primaryEmailLower
|
|
1306
|
+
) {
|
|
1307
|
+
process.env.OM_INIT_ADMIN_EMAIL = adminEmailDerived
|
|
1308
|
+
}
|
|
1309
|
+
if (
|
|
1310
|
+
!skipDemoUsers &&
|
|
1311
|
+
employeeEmailDerived &&
|
|
1312
|
+
employeeEmailDerived.trim().toLowerCase() !== primaryEmailLower
|
|
1313
|
+
) {
|
|
1314
|
+
process.env.OM_INIT_EMPLOYEE_EMAIL = employeeEmailDerived
|
|
1315
|
+
}
|
|
1157
1316
|
const roles = findArgValue(['--roles='], 'superadmin,admin,employee')
|
|
1158
|
-
const skipPasswordPolicyRaw = initArgs.find((arg) =>
|
|
1159
|
-
arg === '--skip-password-policy' ||
|
|
1160
|
-
arg.startsWith('--skip-password-policy=') ||
|
|
1161
|
-
arg === '--allow-weak-password' ||
|
|
1162
|
-
arg.startsWith('--allow-weak-password=')
|
|
1163
|
-
)
|
|
1164
|
-
const skipPasswordPolicy = skipPasswordPolicyRaw
|
|
1165
|
-
? parseBooleanToken(skipPasswordPolicyRaw.split('=')[1] ?? 'true') ?? true
|
|
1166
|
-
: true
|
|
1167
|
-
|
|
1168
1317
|
console.log('🔐 Setting up RBAC and users...')
|
|
1169
1318
|
// Run auth setup command via CLI
|
|
1170
1319
|
const setupArgs = [
|
|
@@ -1172,12 +1321,15 @@ export async function run(argv = process.argv) {
|
|
|
1172
1321
|
'--email', email,
|
|
1173
1322
|
'--password', password,
|
|
1174
1323
|
'--roles', roles,
|
|
1324
|
+
]
|
|
1325
|
+
if (!skipDemoUsers) {
|
|
1175
1326
|
// `mercato init` is the dev/demo bootstrap flow — it explicitly wants
|
|
1176
1327
|
// the derived admin@/employee@ demo accounts. Standalone callers of
|
|
1177
1328
|
// `mercato auth setup` must opt in themselves; without this flag the
|
|
1178
1329
|
// setup command no longer seeds those accounts by default.
|
|
1179
|
-
|
|
1180
|
-
|
|
1330
|
+
// `--no-demo-users` opts a caller (e.g. a production `init`) out of them.
|
|
1331
|
+
setupArgs.push('--include-demo-users')
|
|
1332
|
+
}
|
|
1181
1333
|
if (skipPasswordPolicy) {
|
|
1182
1334
|
setupArgs.push('--skip-password-policy')
|
|
1183
1335
|
}
|
|
@@ -1331,27 +1483,22 @@ export async function run(argv = process.argv) {
|
|
|
1331
1483
|
createdPasswords.set(value.toLowerCase(), passwordValue)
|
|
1332
1484
|
}
|
|
1333
1485
|
pushUser('Superadmin', '👑', email, password)
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
console.log('🎉 App initialization complete!\n')
|
|
1338
|
-
console.log('╔══════════════════════════════════════════════════════════════╗')
|
|
1339
|
-
console.log('║ 🚀 You\'re now ready to start development! ║')
|
|
1340
|
-
console.log('║ ║')
|
|
1341
|
-
console.log('║ Start the dev server: ║')
|
|
1342
|
-
console.log('║ yarn dev ║')
|
|
1343
|
-
console.log('║ ║')
|
|
1344
|
-
console.log('║ Users created: ║')
|
|
1345
|
-
for (const entry of createdUsers) {
|
|
1346
|
-
const label = `${entry.icon} ${entry.label}:`
|
|
1347
|
-
const labelPad = padByCodePointWidth(label, 13)
|
|
1348
|
-
const entryPassword = createdPasswords.get(entry.email.toLowerCase()) ?? password
|
|
1349
|
-
console.log(`║ ${labelPad}${entry.email.padEnd(42)} ║`)
|
|
1350
|
-
console.log(`║ Password: ${entryPassword.padEnd(44)} ║`)
|
|
1486
|
+
if (!skipDemoUsers) {
|
|
1487
|
+
pushUser('Admin', '🧰', adminEmailDerived, adminPasswordOverride ?? password)
|
|
1488
|
+
pushUser('Employee', '👷', employeeEmailDerived, employeePasswordOverride ?? password)
|
|
1351
1489
|
}
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1490
|
+
const summaryColor = parseBooleanToken(process.env.OM_INIT_SUMMARY_COLOR)
|
|
1491
|
+
const summaryColumns = Number(process.env.OM_INIT_SUMMARY_COLUMNS ?? process.stdout.columns)
|
|
1492
|
+
const summary = formatInitSummary({
|
|
1493
|
+
users: createdUsers.map((entry) => ({
|
|
1494
|
+
...entry,
|
|
1495
|
+
password: createdPasswords.get(entry.email.toLowerCase()) ?? password,
|
|
1496
|
+
})),
|
|
1497
|
+
autoStart: parseBooleanToken(process.env.OM_INIT_DEV_AUTOSTART) === true,
|
|
1498
|
+
columns: summaryColumns,
|
|
1499
|
+
color: process.env.NO_COLOR === undefined && (summaryColor ?? (Boolean(process.stdout.isTTY) || parseBooleanToken(process.env.FORCE_COLOR) === true)),
|
|
1500
|
+
})
|
|
1501
|
+
for (const line of summary) console.log(line)
|
|
1355
1502
|
|
|
1356
1503
|
return 0
|
|
1357
1504
|
} catch (error: unknown) {
|
|
@@ -1387,13 +1534,22 @@ export async function run(argv = process.argv) {
|
|
|
1387
1534
|
const commandArgs = remaining.filter(Boolean)
|
|
1388
1535
|
|
|
1389
1536
|
if (!subcommand || subcommand === 'help' || subcommand === '--help' || subcommand === '-h') {
|
|
1390
|
-
console.log('Usage: yarn mercato module <add|enable|eject> ...')
|
|
1537
|
+
console.log('Usage: yarn mercato module <add|enable|eject|search|info> ...')
|
|
1391
1538
|
console.log(' yarn mercato module add <packageSpec> [--module <moduleId>] [--eject] [--allow-third-party]')
|
|
1392
1539
|
console.log(' yarn mercato module enable <packageName> [--module <moduleId>] [--eject] [--allow-third-party]')
|
|
1393
1540
|
console.log(' yarn mercato module eject <moduleId>')
|
|
1541
|
+
console.log(' yarn mercato module search [<query>] [--category <id>] [--kind <kind>] [--all-lines] [--limit <n>] [--json]')
|
|
1542
|
+
console.log(' yarn mercato module info <package-or-module-id> [--json]')
|
|
1394
1543
|
return 0
|
|
1395
1544
|
}
|
|
1396
1545
|
|
|
1546
|
+
if (subcommand === 'search' || subcommand === 'info') {
|
|
1547
|
+
const { runModuleSearch, runModuleInfo } = await import('./lib/module-search')
|
|
1548
|
+
const { readEnabledModules } = await import('./lib/modules-config')
|
|
1549
|
+
const deps = { readEnabledModules }
|
|
1550
|
+
return subcommand === 'search' ? await runModuleSearch(commandArgs, deps) : await runModuleInfo(commandArgs, deps)
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1397
1553
|
if (subcommand === 'add') {
|
|
1398
1554
|
const { createResolver } = await import('./lib/resolver')
|
|
1399
1555
|
const { addOfficialModule } = await import('./lib/module-install')
|
|
@@ -1405,10 +1561,7 @@ export async function run(argv = process.argv) {
|
|
|
1405
1561
|
}
|
|
1406
1562
|
|
|
1407
1563
|
const result = await addOfficialModule(createResolver(), packageSpec, eject, moduleId ?? undefined, allowThirdParty)
|
|
1408
|
-
|
|
1409
|
-
console.log('Next steps:')
|
|
1410
|
-
console.log(' 1. Review generated files if needed: .mercato/generated/')
|
|
1411
|
-
console.log(' 2. Start dev: yarn dev')
|
|
1564
|
+
printModuleCommandResult(result, 'If yarn add changed the package version, run "yarn mercato generate" to refresh generated files.')
|
|
1412
1565
|
return 0
|
|
1413
1566
|
}
|
|
1414
1567
|
|
|
@@ -1423,10 +1576,7 @@ export async function run(argv = process.argv) {
|
|
|
1423
1576
|
const { enableOfficialModule } = await import('./lib/module-install')
|
|
1424
1577
|
const { moduleId, eject, allowThirdParty } = parseModuleInstallArgs(commandArgs)
|
|
1425
1578
|
const result = await enableOfficialModule(createResolver(), packageName, moduleId ?? undefined, eject, allowThirdParty)
|
|
1426
|
-
|
|
1427
|
-
console.log('Next steps:')
|
|
1428
|
-
console.log(' 1. Review generated files if needed: .mercato/generated/')
|
|
1429
|
-
console.log(' 2. Start dev: yarn dev')
|
|
1579
|
+
printModuleCommandResult(result)
|
|
1430
1580
|
return 0
|
|
1431
1581
|
}
|
|
1432
1582
|
|
|
@@ -1633,6 +1783,8 @@ export async function run(argv = process.argv) {
|
|
|
1633
1783
|
cli: [
|
|
1634
1784
|
{
|
|
1635
1785
|
command: 'railway',
|
|
1786
|
+
// Parses --help/-h itself and prints railwayDeployHelp() without deploying.
|
|
1787
|
+
handlesHelp: true,
|
|
1636
1788
|
run: async (args: string[]) => {
|
|
1637
1789
|
const { runRailwayDeploy } = await import('./lib/deploy/railway/index')
|
|
1638
1790
|
await runRailwayDeploy(args)
|
|
@@ -1904,9 +2056,9 @@ export async function run(argv = process.argv) {
|
|
|
1904
2056
|
run: async (args: string[]) => {
|
|
1905
2057
|
const quiet = args.includes('--quiet') || args.includes('-q')
|
|
1906
2058
|
|
|
1907
|
-
console.log('Running all generators...')
|
|
2059
|
+
if (!quiet) console.log('Running all generators...')
|
|
1908
2060
|
await runGeneratorSuiteWithStructuralInvalidation(quiet)
|
|
1909
|
-
console.log('All generators completed.')
|
|
2061
|
+
if (!quiet) console.log('All generators completed.')
|
|
1910
2062
|
},
|
|
1911
2063
|
},
|
|
1912
2064
|
{
|
|
@@ -1924,9 +2076,7 @@ export async function run(argv = process.argv) {
|
|
|
1924
2076
|
skipInitial,
|
|
1925
2077
|
quiet,
|
|
1926
2078
|
...generateWatchRuntime,
|
|
1927
|
-
runGenerators:
|
|
1928
|
-
await runGeneratorSuiteWithStructuralInvalidation(true)
|
|
1929
|
-
},
|
|
2079
|
+
runGenerators: runWatchGeneratorSuite,
|
|
1930
2080
|
})
|
|
1931
2081
|
|
|
1932
2082
|
const shutdownSignals: NodeJS.Signals[] = ['SIGINT', 'SIGTERM']
|
|
@@ -2001,6 +2151,7 @@ export async function run(argv = process.argv) {
|
|
|
2001
2151
|
cli: [
|
|
2002
2152
|
{
|
|
2003
2153
|
command: 'generate',
|
|
2154
|
+
help: 'Generates a migration per module from the current ORM entities and refreshes each\nmodule\'s .snapshot-open-mercato.json. Writes files only — nothing is applied.',
|
|
2004
2155
|
run: async () => {
|
|
2005
2156
|
const { createResolver } = await import('./lib/resolver')
|
|
2006
2157
|
const { dbGenerate } = await import('./lib/db')
|
|
@@ -2010,6 +2161,7 @@ export async function run(argv = process.argv) {
|
|
|
2010
2161
|
},
|
|
2011
2162
|
{
|
|
2012
2163
|
command: 'migrate',
|
|
2164
|
+
help: 'Applies every pending migration to the database DATABASE_URL points at.\nThis mutates the database — check .env before running it.',
|
|
2013
2165
|
run: async () => {
|
|
2014
2166
|
const { createResolver } = await import('./lib/resolver')
|
|
2015
2167
|
const { dbMigrate } = await import('./lib/db')
|
|
@@ -2019,6 +2171,7 @@ export async function run(argv = process.argv) {
|
|
|
2019
2171
|
},
|
|
2020
2172
|
{
|
|
2021
2173
|
command: 'greenfield',
|
|
2174
|
+
help: 'Drops and recreates the schema from scratch, then re-applies every migration.\nDestroys all data. Pass --yes (-y) to skip the confirmation prompt.',
|
|
2022
2175
|
run: async (args: string[]) => {
|
|
2023
2176
|
const { createResolver } = await import('./lib/resolver')
|
|
2024
2177
|
const { dbGreenfield } = await import('./lib/db')
|
|
@@ -2172,7 +2325,7 @@ export async function run(argv = process.argv) {
|
|
|
2172
2325
|
)
|
|
2173
2326
|
const nextProcess = spawn('node', nextDevCommand.args, {
|
|
2174
2327
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
2175
|
-
env: runtimeEnv,
|
|
2328
|
+
env: { ...runtimeEnv, NODE_ENV: 'development' },
|
|
2176
2329
|
cwd: appDir,
|
|
2177
2330
|
})
|
|
2178
2331
|
processes.push(nextProcess)
|
|
@@ -2392,12 +2545,10 @@ export async function run(argv = process.argv) {
|
|
|
2392
2545
|
})
|
|
2393
2546
|
|
|
2394
2547
|
if (generateWatcherMode === 'in-process') {
|
|
2395
|
-
//
|
|
2396
|
-
//
|
|
2397
|
-
//
|
|
2398
|
-
|
|
2399
|
-
// sidecar with `OM_DEV_GENERATE_WATCH_MODE=legacy` if needed.
|
|
2400
|
-
console.log('[server] In-process generate watcher enabled — structural changes will regenerate without a sidecar process.')
|
|
2548
|
+
// Keep the event watcher here, but evaluate each generation in
|
|
2549
|
+
// a fresh one-shot child so imported module revisions do not
|
|
2550
|
+
// accumulate in this long-lived supervisor.
|
|
2551
|
+
console.log('[server] In-process generate watcher enabled — structural changes regenerate in a one-shot child.')
|
|
2401
2552
|
const generateWatchRuntime = await createGenerateWatchRuntime()
|
|
2402
2553
|
activeGenerateWatcher = startInProcessGenerateWatcher({
|
|
2403
2554
|
// `--skip-initial` equivalent: `yarn dev` always runs an
|
|
@@ -2408,9 +2559,7 @@ export async function run(argv = process.argv) {
|
|
|
2408
2559
|
skipInitial: true,
|
|
2409
2560
|
quiet: false,
|
|
2410
2561
|
...generateWatchRuntime,
|
|
2411
|
-
runGenerators:
|
|
2412
|
-
await runGeneratorSuiteWithStructuralInvalidation(true)
|
|
2413
|
-
},
|
|
2562
|
+
runGenerators: runWatchGeneratorSuite,
|
|
2414
2563
|
})
|
|
2415
2564
|
} else {
|
|
2416
2565
|
console.log('[server] Legacy out-of-process generate watcher selected via OM_DEV_GENERATE_WATCH_MODE=legacy — expect the dev orchestrator to spawn `mercato generate watch --skip-initial`.')
|
|
@@ -2650,7 +2799,7 @@ export async function run(argv = process.argv) {
|
|
|
2650
2799
|
|
|
2651
2800
|
if (appCli.length) all.push({ id: 'app', cli: appCli } as any)
|
|
2652
2801
|
|
|
2653
|
-
const quietBanner = process.env.OM_CLI_QUIET === '1'
|
|
2802
|
+
const quietBanner = process.env.OM_CLI_QUIET === '1' || quietGeneration
|
|
2654
2803
|
const banner = '🧩 Open Mercato CLI'
|
|
2655
2804
|
if (!quietBanner) {
|
|
2656
2805
|
const header = [
|
|
@@ -2689,25 +2838,49 @@ export async function run(argv = process.argv) {
|
|
|
2689
2838
|
console.log(pad(`Commands for "${modName}": ${mod.cli.map((c) => c.command).join(', ')}`))
|
|
2690
2839
|
return 1
|
|
2691
2840
|
}
|
|
2841
|
+
// A help flag in the command slot (`mercato db --help`) asks what this module offers.
|
|
2842
|
+
if (isHelpRequest([cmdName])) {
|
|
2843
|
+
console.log(pad(`Usage: ✨ mercato ${modName} <command> [args]`))
|
|
2844
|
+
console.log(pad(`Commands for "${modName}": ${mod.cli.map((c) => c.command).join(', ')}`))
|
|
2845
|
+
return 0
|
|
2846
|
+
}
|
|
2692
2847
|
const cmd = mod.cli.find((c) => c.command === cmdName)
|
|
2693
2848
|
if (!cmd) {
|
|
2694
2849
|
console.error(`🤔 Unknown command "${cmdName}". Available: ${mod.cli.map((c) => c.command).join(', ')}`)
|
|
2695
2850
|
return 1
|
|
2696
2851
|
}
|
|
2697
2852
|
|
|
2698
|
-
|
|
2853
|
+
// `--help` must describe the command, never run it. Commands that parse the flag themselves
|
|
2854
|
+
// opt out via `handlesHelp` so their own richer usage text still wins.
|
|
2855
|
+
if (isHelpRequest(rest) && !cmd.handlesHelp) {
|
|
2856
|
+
console.log(pad(`Usage: ✨ mercato ${modName} ${cmdName} [args]`))
|
|
2857
|
+
if (cmd.help) {
|
|
2858
|
+
console.log('')
|
|
2859
|
+
for (const line of cmd.help.split('\n')) console.log(pad(line))
|
|
2860
|
+
}
|
|
2861
|
+
console.log('')
|
|
2862
|
+
console.log(pad(`Commands for "${modName}": ${mod.cli.map((c) => c.command).join(', ')}`))
|
|
2863
|
+
return 0
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
if (!quietGeneration) console.log('')
|
|
2699
2867
|
const started = Date.now()
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2868
|
+
if (!quietGeneration) {
|
|
2869
|
+
const commandArgs = modName === 'deploy' && cmdName === 'railway'
|
|
2870
|
+
? (await import('./lib/deploy/railway/options')).redactRailwayCliArgs(rest)
|
|
2871
|
+
: rest
|
|
2872
|
+
const loggedArgs = redactSensitiveModuleCliArgs(commandArgs, `${modName}:${cmdName}`)
|
|
2873
|
+
console.log(`🚀 Running ${modName}:${cmdName} ${loggedArgs.join(' ')}`)
|
|
2874
|
+
}
|
|
2704
2875
|
try {
|
|
2705
|
-
await
|
|
2706
|
-
|
|
2876
|
+
const commandExitCode = await runWithCapturedExitCode(async () => {
|
|
2877
|
+
await cmd.run(rest)
|
|
2878
|
+
})
|
|
2879
|
+
if (!quietGeneration && (modName !== 'deploy' || cmdName !== 'railway')) {
|
|
2707
2880
|
const ms = Date.now() - started
|
|
2708
2881
|
console.log(`⏱️ Done in ${ms}ms`)
|
|
2709
2882
|
}
|
|
2710
|
-
return
|
|
2883
|
+
return commandExitCode
|
|
2711
2884
|
} catch (e: any) {
|
|
2712
2885
|
console.error(`💥 Failed: ${formatCliFailureMessage(modName, cmdName, e)}`)
|
|
2713
2886
|
return 1
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module 'cross-spawn' {
|
|
2
|
-
import type { spawn as spawnFunction } from 'node:child_process'
|
|
2
|
+
import type { spawn as spawnFunction, spawnSync } from 'node:child_process'
|
|
3
3
|
|
|
4
|
-
const spawn: typeof spawnFunction
|
|
4
|
+
const spawn: typeof spawnFunction & { sync: typeof spawnSync }
|
|
5
5
|
|
|
6
6
|
export default spawn
|
|
7
7
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
|
|
4
|
-
const packageRoot = path.resolve(__dirname, '..', '..', '..')
|
|
5
|
-
const distDir = path.join(packageRoot, 'dist')
|
|
6
|
-
|
|
7
|
-
// build.mjs publishes dist/agentic by assembling dist/agentic.staging and swapping it in with two
|
|
8
|
-
// renames (#5104). dist/ ships with the package, so a staging tree the build forgot to swap in would
|
|
9
|
-
// be published, and a surviving dist/agentic.previous would mean the swap never completed. The same
|
|
10
|
-
// invariant is asserted from the Playwright side in __integration__/TC-INT-008.spec.ts, but CI's
|
|
11
|
-
// integration scope skips that suite for a diff confined to packages/cli/**, which is exactly the
|
|
12
|
-
// diff that can break the build script — so the guard also lives here, in the jest suite the
|
|
13
|
-
// affected-package filter always runs for such a diff.
|
|
14
|
-
//
|
|
15
|
-
// The cli `test` script is plain jest and never builds first, so an unbuilt package skips instead of
|
|
16
|
-
// failing a clean local checkout. CI's test job downloads the build-artifacts that prepare's
|
|
17
|
-
// `yarn build:packages` produced, so packages/cli/dist is present there and the assertion always
|
|
18
|
-
// runs against the tree the package would publish.
|
|
19
|
-
const describeBuiltPackage = fs.existsSync(distDir) ? describe : describe.skip
|
|
20
|
-
|
|
21
|
-
describeBuiltPackage('cli build artifacts', () => {
|
|
22
|
-
it.each(['agentic.staging', 'agentic.previous'])(
|
|
23
|
-
'leaves no dist/%s behind after a completed build',
|
|
24
|
-
(leftover) => {
|
|
25
|
-
expect(fs.existsSync(path.join(distDir, leftover))).toBe(false)
|
|
26
|
-
},
|
|
27
|
-
)
|
|
28
|
-
})
|