magector 2.16.9 → 2.16.10

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/README.md CHANGED
@@ -1029,9 +1029,15 @@ lib/internal
1029
1029
  The `magento_trace_config` tool can show actual database config values alongside code analysis. Export your `core_config_data` table as JSON and place files in `.magector/config-data/`:
1030
1030
 
1031
1031
  ```bash
1032
- # Export from MySQL (one-time per environment)
1032
+ # MySQL 8.0+ with --json flag
1033
1033
  mysql -u user -p magento_db -e "SELECT scope, scope_id, path, value FROM core_config_data" --json > .magector/config-data/CZ-production.json
1034
1034
 
1035
+ # Older MySQL (no --json): pipe through python3
1036
+ mysql -u user -p magento_db -B -e "SELECT scope, scope_id, path, value FROM core_config_data" | \
1037
+ python3 -c "import sys,json; lines=sys.stdin.read().strip().split('\n'); h=lines[0].split('\t'); \
1038
+ rows=[dict(zip(h,l.split('\t'))) for l in lines[1:]]; [r.update({'scope_id':int(r['scope_id'])}) for r in rows]; \
1039
+ json.dump(rows,sys.stdout,indent=2)" > .magector/config-data/CZ-production.json
1040
+
1035
1041
  # Or from n8n/API/any tool that produces:
1036
1042
  # [{scope, scope_id, path, value}, ...]
1037
1043
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magector",
3
- "version": "2.16.9",
3
+ "version": "2.16.10",
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.16.9",
37
- "@magector/cli-linux-x64": "2.16.9",
38
- "@magector/cli-linux-arm64": "2.16.9",
39
- "@magector/cli-win32-x64": "2.16.9"
36
+ "@magector/cli-darwin-arm64": "2.16.10",
37
+ "@magector/cli-linux-x64": "2.16.10",
38
+ "@magector/cli-linux-arm64": "2.16.10",
39
+ "@magector/cli-win32-x64": "2.16.10"
40
40
  },
41
41
  "keywords": [
42
42
  "magento",
package/src/mcp-server.js CHANGED
@@ -3945,9 +3945,11 @@ function formatTraceConfigResult(result) {
3945
3945
  let hasData = false;
3946
3946
  try { hasData = existsSync(dataDir) && readdirSync(dataDir).some(f => f.endsWith('.json')); } catch {}
3947
3947
  if (!hasData) {
3948
- text += '### Actual Values\nNo config-data exports found. Export `core_config_data` to `.magector/config-data/{env}.json` (format: `[{scope, scope_id, path, value}, ...]`).\n\n';
3948
+ text += '### Actual Values\n**ACTION REQUIRED:** No config-data exports found. Ask the user to export `core_config_data` from their database and place the JSON file at `.magector/config-data/{country}-{environment}.json` (format: `[{scope, scope_id, path, value}, ...]`). Without this data, actual config values cannot be shown.\n\n';
3949
3949
  } else {
3950
- text += '### Actual Values\nNo matching values found in config-data exports.\n\n';
3950
+ // Show which environments ARE available so agent knows what's missing
3951
+ const availableEnvs = Object.keys(loadAllConfigData()).join(', ');
3952
+ text += `### Actual Values\nNo matching values found in available exports (${availableEnvs}). If you need values from a different environment, ask the user to provide the export.\n\n`;
3951
3953
  }
3952
3954
  }
3953
3955
 
@@ -4789,7 +4791,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
4789
4791
  },
4790
4792
  {
4791
4793
  name: 'magento_trace_config',
4792
- description: 'Trace a Magento config path end-to-end: finds system.xml admin definition (label, type, source_model), PHP classes that read the value, and actual DB values from config-data exports. Use when investigating config-driven behavior ("why is this feature enabled/disabled?", "what controls marketplace payment methods?"). Accepts either an exact config path or a keyword to search for.',
4794
+ description: 'Trace a Magento config path end-to-end: finds system.xml admin definition (label, type, source_model), PHP classes that read the value, and actual DB values from config-data exports. Use when investigating config-driven behavior ("why is this feature enabled/disabled?", "what controls marketplace payment methods?"). Accepts either an exact config path or a keyword to search for. IMPORTANT: If the output says no config-data exports are available, or if the analysis needs config values from a country/environment not yet exported, ask the user to provide the export. They can run a one-time MySQL query and place the JSON file in .magector/config-data/{country}-{environment}.json.',
4793
4795
  inputSchema: {
4794
4796
  type: 'object',
4795
4797
  properties: {