@gitsense/gsc-utils 0.2.34 → 0.2.35
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/dist/gsc-utils.cjs.js +41 -34
- package/dist/gsc-utils.esm.js +41 -34
- package/package.json +1 -1
- package/src/AnalysisBlockUtils.js +5 -2
- package/src/AnalyzerUtils/schemaLoader.js +36 -32
package/dist/gsc-utils.cjs.js
CHANGED
|
@@ -1426,7 +1426,10 @@ function parseOverviewMetadata$1(content) {
|
|
|
1426
1426
|
const lines = content.split('\n');
|
|
1427
1427
|
|
|
1428
1428
|
// Regex to capture "Field Name" and "Value" from lines like '* **Field Name: ** Value'
|
|
1429
|
-
const
|
|
1429
|
+
const fieldRegex1 = /^\*\s+\*\*([\w\s.-]+):\*\*\s+(.*)$/;
|
|
1430
|
+
const fieldRegex2 = /^\*\s+\*\*([\w\s.-]+)\*\*:\s+(.*)$/;
|
|
1431
|
+
const fieldRegex3 = /^.*?(Chat ID|Path).*:\s*(\d+)$/m;
|
|
1432
|
+
|
|
1430
1433
|
let foundList = false;
|
|
1431
1434
|
let currentKey = null; // For potential multi-line handling in the future
|
|
1432
1435
|
|
|
@@ -1442,7 +1445,7 @@ function parseOverviewMetadata$1(content) {
|
|
|
1442
1445
|
break;
|
|
1443
1446
|
}
|
|
1444
1447
|
|
|
1445
|
-
const match = trimmedLine.match(
|
|
1448
|
+
const match = trimmedLine.match(fieldRegex1) || trimmedLine.match(fieldRegex2) || trimmedLine.match(fieldRegex3);
|
|
1446
1449
|
|
|
1447
1450
|
if (match) {
|
|
1448
1451
|
foundList = true;
|
|
@@ -12137,13 +12140,13 @@ var saver = {
|
|
|
12137
12140
|
|
|
12138
12141
|
/**
|
|
12139
12142
|
* Component: AnalyzerUtils Schema Loader
|
|
12140
|
-
* Block-UUID:
|
|
12141
|
-
* Parent-UUID:
|
|
12142
|
-
* Version: 1.
|
|
12143
|
+
* Block-UUID: 20ac37ba-6ff7-462e-9e08-3204df118b03
|
|
12144
|
+
* Parent-UUID: bf25c501-f9e1-4e5b-ad22-9ed24ba50787
|
|
12145
|
+
* Version: 1.5.0
|
|
12143
12146
|
* Description: Provides utility functions for retrieving and deducing JSON schemas for analyzers.
|
|
12144
12147
|
* Language: JavaScript
|
|
12145
|
-
* Created-at:
|
|
12146
|
-
* Authors: Gemini 2.5 Flash (v1.0.0), Gemini 2.5 Pro (v1.1.0), Claude Haiku 4.5 (v1.2.0), Claude Haiku 4.5 (v1.3.0), Qwen 3 Coder 480B - Cerebras (v1.4.0), GLM-4.6 (v1.4.1)
|
|
12148
|
+
* Created-at: 2026-02-15T06:21:20.089Z
|
|
12149
|
+
* Authors: Gemini 2.5 Flash (v1.0.0), Gemini 2.5 Pro (v1.1.0), Claude Haiku 4.5 (v1.2.0), Claude Haiku 4.5 (v1.3.0), Qwen 3 Coder 480B - Cerebras (v1.4.0), GLM-4.6 (v1.4.1), GLM-4.7 (v1.5.0)
|
|
12147
12150
|
*/
|
|
12148
12151
|
|
|
12149
12152
|
const fs$5 = require$$0.promises;
|
|
@@ -12163,35 +12166,39 @@ const { preprocessJsonForValidation: preprocessJsonForValidation$3 } = jsonParse
|
|
|
12163
12166
|
function parseMetadataDefinitions(markdownContent) {
|
|
12164
12167
|
const definitions = new Map();
|
|
12165
12168
|
|
|
12166
|
-
// Match
|
|
12167
|
-
const
|
|
12168
|
-
|
|
12169
|
+
// Match both "### Fixed Metadata Definitions" and "### Custom Metadata Definitions" sections
|
|
12170
|
+
const sectionHeaders = ['### Fixed Metadata Definitions', '### Custom Metadata Definitions'];
|
|
12171
|
+
|
|
12172
|
+
for (const sectionHeader of sectionHeaders) {
|
|
12173
|
+
const sectionRegex = new RegExp(`${sectionHeader}\\s*([\\s\\S]*?)(?=\`\`\\|\\n##|\\n---)`);
|
|
12174
|
+
const match = markdownContent.match(sectionRegex);
|
|
12169
12175
|
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12176
|
+
if (!match || !match[1]) {
|
|
12177
|
+
continue;
|
|
12178
|
+
}
|
|
12173
12179
|
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
|
|
12192
|
-
|
|
12193
|
-
|
|
12194
|
-
|
|
12180
|
+
const definitionBlock = match[1];
|
|
12181
|
+
|
|
12182
|
+
// Regex to match both formats:
|
|
12183
|
+
// Format 1: * `fieldName` (type): description
|
|
12184
|
+
// Format 2: * fieldName (type): description
|
|
12185
|
+
// Capture groups:
|
|
12186
|
+
// Group 1: backtick-wrapped field name (if present)
|
|
12187
|
+
// Group 2: non-backtick field name (if present)
|
|
12188
|
+
// Group 3: field type
|
|
12189
|
+
// Group 4: description
|
|
12190
|
+
const lineRegex = /^\s*\*\s+(?:`([^`]+)`|([a-zA-Z0-9_-]+))\s+\(([^)]+)\):\s*(.+)/gm;
|
|
12191
|
+
|
|
12192
|
+
let lineMatch;
|
|
12193
|
+
while ((lineMatch = lineRegex.exec(definitionBlock)) !== null) {
|
|
12194
|
+
// Extract field name from either group 1 (backtick-wrapped) or group 2 (plain)
|
|
12195
|
+
const fieldName = (lineMatch[1] || lineMatch[2]).trim();
|
|
12196
|
+
const fieldType = lineMatch[3].trim();
|
|
12197
|
+
const description = lineMatch[4].trim();
|
|
12198
|
+
|
|
12199
|
+
if (fieldName && fieldType && description) {
|
|
12200
|
+
definitions.set(fieldName, { type: fieldType, description });
|
|
12201
|
+
}
|
|
12195
12202
|
}
|
|
12196
12203
|
}
|
|
12197
12204
|
|
package/dist/gsc-utils.esm.js
CHANGED
|
@@ -1424,7 +1424,10 @@ function parseOverviewMetadata$1(content) {
|
|
|
1424
1424
|
const lines = content.split('\n');
|
|
1425
1425
|
|
|
1426
1426
|
// Regex to capture "Field Name" and "Value" from lines like '* **Field Name: ** Value'
|
|
1427
|
-
const
|
|
1427
|
+
const fieldRegex1 = /^\*\s+\*\*([\w\s.-]+):\*\*\s+(.*)$/;
|
|
1428
|
+
const fieldRegex2 = /^\*\s+\*\*([\w\s.-]+)\*\*:\s+(.*)$/;
|
|
1429
|
+
const fieldRegex3 = /^.*?(Chat ID|Path).*:\s*(\d+)$/m;
|
|
1430
|
+
|
|
1428
1431
|
let foundList = false;
|
|
1429
1432
|
let currentKey = null; // For potential multi-line handling in the future
|
|
1430
1433
|
|
|
@@ -1440,7 +1443,7 @@ function parseOverviewMetadata$1(content) {
|
|
|
1440
1443
|
break;
|
|
1441
1444
|
}
|
|
1442
1445
|
|
|
1443
|
-
const match = trimmedLine.match(
|
|
1446
|
+
const match = trimmedLine.match(fieldRegex1) || trimmedLine.match(fieldRegex2) || trimmedLine.match(fieldRegex3);
|
|
1444
1447
|
|
|
1445
1448
|
if (match) {
|
|
1446
1449
|
foundList = true;
|
|
@@ -12135,13 +12138,13 @@ var saver = {
|
|
|
12135
12138
|
|
|
12136
12139
|
/**
|
|
12137
12140
|
* Component: AnalyzerUtils Schema Loader
|
|
12138
|
-
* Block-UUID:
|
|
12139
|
-
* Parent-UUID:
|
|
12140
|
-
* Version: 1.
|
|
12141
|
+
* Block-UUID: 20ac37ba-6ff7-462e-9e08-3204df118b03
|
|
12142
|
+
* Parent-UUID: bf25c501-f9e1-4e5b-ad22-9ed24ba50787
|
|
12143
|
+
* Version: 1.5.0
|
|
12141
12144
|
* Description: Provides utility functions for retrieving and deducing JSON schemas for analyzers.
|
|
12142
12145
|
* Language: JavaScript
|
|
12143
|
-
* Created-at:
|
|
12144
|
-
* Authors: Gemini 2.5 Flash (v1.0.0), Gemini 2.5 Pro (v1.1.0), Claude Haiku 4.5 (v1.2.0), Claude Haiku 4.5 (v1.3.0), Qwen 3 Coder 480B - Cerebras (v1.4.0), GLM-4.6 (v1.4.1)
|
|
12146
|
+
* Created-at: 2026-02-15T06:21:20.089Z
|
|
12147
|
+
* Authors: Gemini 2.5 Flash (v1.0.0), Gemini 2.5 Pro (v1.1.0), Claude Haiku 4.5 (v1.2.0), Claude Haiku 4.5 (v1.3.0), Qwen 3 Coder 480B - Cerebras (v1.4.0), GLM-4.6 (v1.4.1), GLM-4.7 (v1.5.0)
|
|
12145
12148
|
*/
|
|
12146
12149
|
|
|
12147
12150
|
const fs$5 = require$$0.promises;
|
|
@@ -12161,35 +12164,39 @@ const { preprocessJsonForValidation: preprocessJsonForValidation$3 } = jsonParse
|
|
|
12161
12164
|
function parseMetadataDefinitions(markdownContent) {
|
|
12162
12165
|
const definitions = new Map();
|
|
12163
12166
|
|
|
12164
|
-
// Match
|
|
12165
|
-
const
|
|
12166
|
-
|
|
12167
|
+
// Match both "### Fixed Metadata Definitions" and "### Custom Metadata Definitions" sections
|
|
12168
|
+
const sectionHeaders = ['### Fixed Metadata Definitions', '### Custom Metadata Definitions'];
|
|
12169
|
+
|
|
12170
|
+
for (const sectionHeader of sectionHeaders) {
|
|
12171
|
+
const sectionRegex = new RegExp(`${sectionHeader}\\s*([\\s\\S]*?)(?=\`\`\\|\\n##|\\n---)`);
|
|
12172
|
+
const match = markdownContent.match(sectionRegex);
|
|
12167
12173
|
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12174
|
+
if (!match || !match[1]) {
|
|
12175
|
+
continue;
|
|
12176
|
+
}
|
|
12171
12177
|
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
|
|
12192
|
-
|
|
12178
|
+
const definitionBlock = match[1];
|
|
12179
|
+
|
|
12180
|
+
// Regex to match both formats:
|
|
12181
|
+
// Format 1: * `fieldName` (type): description
|
|
12182
|
+
// Format 2: * fieldName (type): description
|
|
12183
|
+
// Capture groups:
|
|
12184
|
+
// Group 1: backtick-wrapped field name (if present)
|
|
12185
|
+
// Group 2: non-backtick field name (if present)
|
|
12186
|
+
// Group 3: field type
|
|
12187
|
+
// Group 4: description
|
|
12188
|
+
const lineRegex = /^\s*\*\s+(?:`([^`]+)`|([a-zA-Z0-9_-]+))\s+\(([^)]+)\):\s*(.+)/gm;
|
|
12189
|
+
|
|
12190
|
+
let lineMatch;
|
|
12191
|
+
while ((lineMatch = lineRegex.exec(definitionBlock)) !== null) {
|
|
12192
|
+
// Extract field name from either group 1 (backtick-wrapped) or group 2 (plain)
|
|
12193
|
+
const fieldName = (lineMatch[1] || lineMatch[2]).trim();
|
|
12194
|
+
const fieldType = lineMatch[3].trim();
|
|
12195
|
+
const description = lineMatch[4].trim();
|
|
12196
|
+
|
|
12197
|
+
if (fieldName && fieldType && description) {
|
|
12198
|
+
definitions.set(fieldName, { type: fieldType, description });
|
|
12199
|
+
}
|
|
12193
12200
|
}
|
|
12194
12201
|
}
|
|
12195
12202
|
|
package/package.json
CHANGED
|
@@ -60,7 +60,10 @@ function parseOverviewMetadata(content) {
|
|
|
60
60
|
const lines = content.split('\n');
|
|
61
61
|
|
|
62
62
|
// Regex to capture "Field Name" and "Value" from lines like '* **Field Name: ** Value'
|
|
63
|
-
const
|
|
63
|
+
const fieldRegex1 = /^\*\s+\*\*([\w\s.-]+):\*\*\s+(.*)$/;
|
|
64
|
+
const fieldRegex2 = /^\*\s+\*\*([\w\s.-]+)\*\*:\s+(.*)$/;
|
|
65
|
+
const fieldRegex3 = /^.*?(Chat ID|Path).*:\s*(\d+)$/m;
|
|
66
|
+
|
|
64
67
|
let foundList = false;
|
|
65
68
|
let currentKey = null; // For potential multi-line handling in the future
|
|
66
69
|
|
|
@@ -76,7 +79,7 @@ function parseOverviewMetadata(content) {
|
|
|
76
79
|
break;
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
const match = trimmedLine.match(
|
|
82
|
+
const match = trimmedLine.match(fieldRegex1) || trimmedLine.match(fieldRegex2) || trimmedLine.match(fieldRegex3)
|
|
80
83
|
|
|
81
84
|
if (match) {
|
|
82
85
|
foundList = true;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Component: AnalyzerUtils Schema Loader
|
|
3
|
-
* Block-UUID:
|
|
4
|
-
* Parent-UUID:
|
|
5
|
-
* Version: 1.
|
|
3
|
+
* Block-UUID: 20ac37ba-6ff7-462e-9e08-3204df118b03
|
|
4
|
+
* Parent-UUID: bf25c501-f9e1-4e5b-ad22-9ed24ba50787
|
|
5
|
+
* Version: 1.5.0
|
|
6
6
|
* Description: Provides utility functions for retrieving and deducing JSON schemas for analyzers.
|
|
7
7
|
* Language: JavaScript
|
|
8
|
-
* Created-at:
|
|
9
|
-
* Authors: Gemini 2.5 Flash (v1.0.0), Gemini 2.5 Pro (v1.1.0), Claude Haiku 4.5 (v1.2.0), Claude Haiku 4.5 (v1.3.0), Qwen 3 Coder 480B - Cerebras (v1.4.0), GLM-4.6 (v1.4.1)
|
|
8
|
+
* Created-at: 2026-02-15T06:21:20.089Z
|
|
9
|
+
* Authors: Gemini 2.5 Flash (v1.0.0), Gemini 2.5 Pro (v1.1.0), Claude Haiku 4.5 (v1.2.0), Claude Haiku 4.5 (v1.3.0), Qwen 3 Coder 480B - Cerebras (v1.4.0), GLM-4.6 (v1.4.1), GLM-4.7 (v1.5.0)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
|
|
@@ -27,35 +27,39 @@ const { preprocessJsonForValidation } = require('./jsonParser');
|
|
|
27
27
|
function parseMetadataDefinitions(markdownContent) {
|
|
28
28
|
const definitions = new Map();
|
|
29
29
|
|
|
30
|
-
// Match
|
|
31
|
-
const
|
|
32
|
-
|
|
30
|
+
// Match both "### Fixed Metadata Definitions" and "### Custom Metadata Definitions" sections
|
|
31
|
+
const sectionHeaders = ['### Fixed Metadata Definitions', '### Custom Metadata Definitions'];
|
|
32
|
+
|
|
33
|
+
for (const sectionHeader of sectionHeaders) {
|
|
34
|
+
const sectionRegex = new RegExp(`${sectionHeader}\\s*([\\s\\S]*?)(?=\`\`\\|\\n##|\\n---)`);
|
|
35
|
+
const match = markdownContent.match(sectionRegex);
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
if (!match || !match[1]) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
const definitionBlock = match[1];
|
|
42
|
+
|
|
43
|
+
// Regex to match both formats:
|
|
44
|
+
// Format 1: * `fieldName` (type): description
|
|
45
|
+
// Format 2: * fieldName (type): description
|
|
46
|
+
// Capture groups:
|
|
47
|
+
// Group 1: backtick-wrapped field name (if present)
|
|
48
|
+
// Group 2: non-backtick field name (if present)
|
|
49
|
+
// Group 3: field type
|
|
50
|
+
// Group 4: description
|
|
51
|
+
const lineRegex = /^\s*\*\s+(?:`([^`]+)`|([a-zA-Z0-9_-]+))\s+\(([^)]+)\):\s*(.+)/gm;
|
|
52
|
+
|
|
53
|
+
let lineMatch;
|
|
54
|
+
while ((lineMatch = lineRegex.exec(definitionBlock)) !== null) {
|
|
55
|
+
// Extract field name from either group 1 (backtick-wrapped) or group 2 (plain)
|
|
56
|
+
const fieldName = (lineMatch[1] || lineMatch[2]).trim();
|
|
57
|
+
const fieldType = lineMatch[3].trim();
|
|
58
|
+
const description = lineMatch[4].trim();
|
|
59
|
+
|
|
60
|
+
if (fieldName && fieldType && description) {
|
|
61
|
+
definitions.set(fieldName, { type: fieldType, description });
|
|
62
|
+
}
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
|