magector 2.9.0 → 2.9.1
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/package.json +5 -5
- package/src/mcp-server.js +77 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magector",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "Semantic code search for Magento 2 — index, search, MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/mcp-server.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"ruvector": "^0.1.96"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@magector/cli-darwin-arm64": "2.9.
|
|
37
|
-
"@magector/cli-linux-x64": "2.9.
|
|
38
|
-
"@magector/cli-linux-arm64": "2.9.
|
|
39
|
-
"@magector/cli-win32-x64": "2.9.
|
|
36
|
+
"@magector/cli-darwin-arm64": "2.9.1",
|
|
37
|
+
"@magector/cli-linux-x64": "2.9.1",
|
|
38
|
+
"@magector/cli-linux-arm64": "2.9.1",
|
|
39
|
+
"@magector/cli-win32-x64": "2.9.1"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"magento",
|
package/src/mcp-server.js
CHANGED
|
@@ -1855,6 +1855,83 @@ const ERROR_PATTERNS = [
|
|
|
1855
1855
|
type: 'invalid_plugin_method',
|
|
1856
1856
|
extract: (m) => ({ class: m[1], type: m[2], method: m[3] }),
|
|
1857
1857
|
suggestion: (ctx) => `Plugin method ${ctx.type}${ctx.method} in ${ctx.class} doesn't match any public method on the target class. Check method name spelling.`
|
|
1858
|
+
},
|
|
1859
|
+
// ── Business logic / configuration patterns ──
|
|
1860
|
+
{
|
|
1861
|
+
pattern: /rule\s+(?:did\s+)?not\s+(?:match|apply|work)|(?:sales|cart|price)\s*rule.*(?:not\s+applied|didn'?t\s+match|failed)/i,
|
|
1862
|
+
type: 'rule_not_matching',
|
|
1863
|
+
extract: () => ({}),
|
|
1864
|
+
suggestion: () => [
|
|
1865
|
+
'Sales/cart price rule not matching. Check BOTH code AND configuration:',
|
|
1866
|
+
'',
|
|
1867
|
+
'**Configuration checks (most common cause):**',
|
|
1868
|
+
'- Rule Actions tab: are ALL required shipping methods selected?',
|
|
1869
|
+
'- Rule Conditions: does the cart actually meet ALL conditions (customer group, subtotal threshold, date range)?',
|
|
1870
|
+
'- Rule status: is it Active? Check date range (from/to).',
|
|
1871
|
+
'- Rule priority/stop processing: is a higher-priority rule stopping this one?',
|
|
1872
|
+
'- Coupon: if coupon-based, was the correct coupon applied?',
|
|
1873
|
+
'- Website scope: is the rule assigned to the correct website?',
|
|
1874
|
+
'',
|
|
1875
|
+
'**Code checks (less common):**',
|
|
1876
|
+
'- Custom condition types: check classes extending AbstractCondition in vendor/',
|
|
1877
|
+
'- Plugins on Magento\\SalesRule\\Model\\Utility::canProcessRule() that may skip rules',
|
|
1878
|
+
'- Plugins on Magento\\SalesRule\\Model\\Rule\\Condition\\Address::validate()',
|
|
1879
|
+
'- DI preference overrides on Condition\\Address (e.g., marketplace container conditions)',
|
|
1880
|
+
'- The condition_type stored in conditions_serialized — does the PHP class exist and validate correctly?',
|
|
1881
|
+
'',
|
|
1882
|
+
'Use magento_grep to find: custom conditions, plugins on validate/canProcessRule, and DI preferences on Address.',
|
|
1883
|
+
'',
|
|
1884
|
+
'**Ask the user for DB data:**',
|
|
1885
|
+
'SELECT rule_id, name, conditions_serialized, actions_serialized, is_active, from_date, to_date',
|
|
1886
|
+
'FROM salesrule WHERE rule_id = <ID>;',
|
|
1887
|
+
'This lets you verify the exact condition_type classes and action configuration without guessing.'
|
|
1888
|
+
].join('\n')
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
pattern: /free\s*shipping.*(?:not|didn'?t|did\s+not)\s+(?:apply|work|match)|(?:not|didn'?t)\s+(?:get|receive)\s+free\s*shipping/i,
|
|
1892
|
+
type: 'free_shipping_not_applied',
|
|
1893
|
+
extract: () => ({}),
|
|
1894
|
+
suggestion: () => [
|
|
1895
|
+
'Free shipping not applied. Most common causes:',
|
|
1896
|
+
'',
|
|
1897
|
+
'**1. Rule Actions — shipping method not selected (MOST COMMON)**',
|
|
1898
|
+
' The free shipping rule must have the specific shipping method checked in Actions.',
|
|
1899
|
+
' If "home delivery" is not selected but the customer chose home delivery → rule won\'t apply.',
|
|
1900
|
+
'',
|
|
1901
|
+
'**2. Condition threshold mismatch**',
|
|
1902
|
+
' Check which subtotal attribute the condition uses: base_subtotal, subtotal_incl_tax,',
|
|
1903
|
+
' drmax_free_shipping_price (custom). Each calculates differently (with/without tax, discounts).',
|
|
1904
|
+
'',
|
|
1905
|
+
'**3. Custom condition type**',
|
|
1906
|
+
' Container attributes (SubtotalWithDiscountInclTax) aggregate per shop type.',
|
|
1907
|
+
' If condition uses :1p suffix instead of :whole, only 1P items count.',
|
|
1908
|
+
'',
|
|
1909
|
+
'**4. Plugin interference**',
|
|
1910
|
+
' Check plugins on Utility::canProcessRule() and Carrier::collectRates().',
|
|
1911
|
+
'',
|
|
1912
|
+
'Start with: check the rule\'s Actions tab in admin for shipping method selection.',
|
|
1913
|
+
'',
|
|
1914
|
+
'**Ask the user for DB data:**',
|
|
1915
|
+
'SELECT rule_id, name, conditions_serialized, actions_serialized, simple_free_shipping',
|
|
1916
|
+
'FROM salesrule WHERE rule_id = <ID>;',
|
|
1917
|
+
'The actions_serialized will show which shipping methods are enabled for free shipping.'
|
|
1918
|
+
].join('\n')
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
pattern: /(?:condition|rule|promotion|discount).*(?:custom|type).*(?:not|fail|wrong|weird|unexpected)/i,
|
|
1922
|
+
type: 'custom_condition_issue',
|
|
1923
|
+
extract: () => ({}),
|
|
1924
|
+
suggestion: () => [
|
|
1925
|
+
'Possible custom condition type issue. Investigate:',
|
|
1926
|
+
'',
|
|
1927
|
+
'**1. Check the rule configuration FIRST** — most "condition not working" bugs are misconfiguration.',
|
|
1928
|
+
'**2. Find custom condition classes:** grep for "extends AbstractCondition" in vendor/',
|
|
1929
|
+
'**3. Check DI preference on Condition\\Address** — marketplace modules often override validate().',
|
|
1930
|
+
'**4. Check if new attributes are registered in the Address override\'s switch/mapping.**',
|
|
1931
|
+
'**5. Verify condition_type in DB:** the serialized condition must reference an existing PHP class.',
|
|
1932
|
+
'',
|
|
1933
|
+
'If code analysis finds no bugs, the root cause is likely rule configuration in admin panel.'
|
|
1934
|
+
].join('\n')
|
|
1858
1935
|
}
|
|
1859
1936
|
];
|
|
1860
1937
|
|