@mcp-consultant-tools/azure-devops 30.0.0-beta.18 → 30.0.0-beta.19
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.
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parse annotated body sections from a synced markdown file.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A `##` line is a section boundary ONLY when the first non-empty line that
|
|
5
|
+
* follows it is `<!-- ado-field: REFNAME -->`. Any other `##` line is treated
|
|
6
|
+
* as part of the surrounding annotated section's content — this prevents
|
|
7
|
+
* silent truncation of fields (e.g. Repro Steps) when the field body legitimately
|
|
8
|
+
* contains `##` text.
|
|
9
|
+
*
|
|
10
|
+
* Anything before the first annotated section is the prose preamble.
|
|
8
11
|
*/
|
|
9
12
|
export interface AnnotatedSection {
|
|
10
13
|
/** ADO reference name this section maps to. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-parser.d.ts","sourceRoot":"","sources":["../../src/sync/annotation-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"annotation-parser.d.ts","sourceRoot":"","sources":["../../src/sync/annotation-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,qDAAqD;IACrD,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CAsDrE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parse annotated body sections from a synced markdown file.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A `##` line is a section boundary ONLY when the first non-empty line that
|
|
5
|
+
* follows it is `<!-- ado-field: REFNAME -->`. Any other `##` line is treated
|
|
6
|
+
* as part of the surrounding annotated section's content — this prevents
|
|
7
|
+
* silent truncation of fields (e.g. Repro Steps) when the field body legitimately
|
|
8
|
+
* contains `##` text.
|
|
9
|
+
*
|
|
10
|
+
* Anything before the first annotated section is the prose preamble.
|
|
8
11
|
*/
|
|
9
12
|
const SECTION_HEADING_RE = /^##\s+(.+?)\s*$/;
|
|
10
13
|
const ANNOTATION_RE = /^<!--\s*ado-field:\s*([A-Za-z0-9_.\-]+)\s*-->$/;
|
|
@@ -15,50 +18,49 @@ const ANNOTATION_RE = /^<!--\s*ado-field:\s*([A-Za-z0-9_.\-]+)\s*-->$/;
|
|
|
15
18
|
export function parseAnnotations(body) {
|
|
16
19
|
const lines = body.split('\n');
|
|
17
20
|
const annotated = [];
|
|
18
|
-
|
|
19
|
-
//
|
|
21
|
+
// Section boundaries: only `##` headings whose next non-empty line is an
|
|
22
|
+
// `<!-- ado-field: REFNAME -->` annotation. All other `##` lines are
|
|
23
|
+
// treated as content of whatever annotated section currently encloses them.
|
|
20
24
|
const sections = [];
|
|
21
25
|
for (let i = 0; i < lines.length; i++) {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
const headingMatch = lines[i].match(SECTION_HEADING_RE);
|
|
27
|
+
if (!headingMatch)
|
|
28
|
+
continue;
|
|
29
|
+
let probe = i + 1;
|
|
30
|
+
while (probe < lines.length && lines[probe].trim() === '')
|
|
31
|
+
probe++;
|
|
32
|
+
if (probe >= lines.length)
|
|
33
|
+
continue;
|
|
34
|
+
const annotationMatch = lines[probe].trim().match(ANNOTATION_RE);
|
|
35
|
+
if (!annotationMatch)
|
|
36
|
+
continue;
|
|
37
|
+
sections.push({
|
|
38
|
+
headingLine: i,
|
|
39
|
+
annotationLine: probe,
|
|
40
|
+
heading: headingMatch[1].trim(),
|
|
41
|
+
refname: annotationMatch[1],
|
|
42
|
+
});
|
|
26
43
|
}
|
|
27
|
-
//
|
|
28
|
-
const preambleEnd = sections.length > 0 ? sections[0].
|
|
44
|
+
// Preamble = everything before the first annotated `##` heading.
|
|
45
|
+
const preambleEnd = sections.length > 0 ? sections[0].headingLine : lines.length;
|
|
29
46
|
const preamble = lines.slice(0, preambleEnd).join('\n').trim();
|
|
30
47
|
for (let idx = 0; idx < sections.length; idx++) {
|
|
31
48
|
const current = sections[idx];
|
|
32
49
|
const next = sections[idx + 1];
|
|
33
|
-
const bodyStart = current.
|
|
34
|
-
const bodyEnd = next ? next.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Annotated section: content is everything AFTER the annotation line.
|
|
43
|
-
const content = lines.slice(firstNonEmpty + 1, bodyEnd).join('\n');
|
|
44
|
-
annotated.push({
|
|
45
|
-
refname: annotationMatch[1],
|
|
46
|
-
content: stripTrailingSeparators(content).trim(),
|
|
47
|
-
heading: current.heading,
|
|
48
|
-
lineIndex: current.lineIndex,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// Local-only section: everything between this heading and the next.
|
|
53
|
-
const content = lines.slice(bodyStart, bodyEnd).join('\n');
|
|
54
|
-
localOnly.push({
|
|
55
|
-
heading: current.heading,
|
|
56
|
-
content: stripTrailingSeparators(content).trim(),
|
|
57
|
-
lineIndex: current.lineIndex,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
50
|
+
const bodyStart = current.annotationLine + 1;
|
|
51
|
+
const bodyEnd = next ? next.headingLine : lines.length;
|
|
52
|
+
const content = lines.slice(bodyStart, bodyEnd).join('\n');
|
|
53
|
+
annotated.push({
|
|
54
|
+
refname: current.refname,
|
|
55
|
+
content: stripTrailingSeparators(content).trim(),
|
|
56
|
+
heading: current.heading,
|
|
57
|
+
lineIndex: current.headingLine,
|
|
58
|
+
});
|
|
60
59
|
}
|
|
61
|
-
|
|
60
|
+
// Local-only sections no longer exist under the annotation-strict model.
|
|
61
|
+
// The field is kept on the result for backward compatibility with callers
|
|
62
|
+
// that destructure it.
|
|
63
|
+
return { annotated, localOnly: [], preamble };
|
|
62
64
|
}
|
|
63
65
|
/**
|
|
64
66
|
* Build an annotated `##` section as a string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-parser.js","sourceRoot":"","sources":["../../src/sync/annotation-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"annotation-parser.js","sourceRoot":"","sources":["../../src/sync/annotation-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA+BH,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,aAAa,GAAG,gDAAgD,CAAC;AAEvE;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK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AAC,OAAe;IAC9C,oFAAoF;IACpF,OAAO,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-consultant-tools/azure-devops",
|
|
3
|
-
"version": "30.0.0-beta.
|
|
3
|
+
"version": "30.0.0-beta.19",
|
|
4
4
|
"description": "MCP server for Azure DevOps integration - wikis, work items, pull requests, and variable group read access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|