@pathmode/cli 2.1.2 → 2.1.3
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/index.js +25 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16884,6 +16884,7 @@ exports.readLocalIntents = readLocalIntents;
|
|
|
16884
16884
|
exports.readIntentMeta = readIntentMeta;
|
|
16885
16885
|
exports.readIntentFile = readIntentFile;
|
|
16886
16886
|
exports.parseIntentMarkdown = parseIntentMarkdown;
|
|
16887
|
+
exports.stripHtmlComments = stripHtmlComments;
|
|
16887
16888
|
const fs_1 = __importDefault(__nccwpck_require__(9896));
|
|
16888
16889
|
const path_1 = __importDefault(__nccwpck_require__(6928));
|
|
16889
16890
|
const gray_matter_1 = __importDefault(__nccwpck_require__(2702));
|
|
@@ -17039,7 +17040,7 @@ function frontmatterEdgeCases(v) {
|
|
|
17039
17040
|
}
|
|
17040
17041
|
function parseIntentMarkdown(content, fallbackId = 'intent') {
|
|
17041
17042
|
const { data, content: rawBody } = (0, gray_matter_1.default)(content);
|
|
17042
|
-
const body = stripFencedBlocks(rawBody);
|
|
17043
|
+
const body = stripHtmlComments(stripFencedBlocks(rawBody));
|
|
17043
17044
|
const sections = splitSections(body);
|
|
17044
17045
|
const parsedVerification = extractVerification(sections);
|
|
17045
17046
|
// The public schema allows verification as a flat string array; read it as manual checks
|
|
@@ -17122,6 +17123,28 @@ function stripFencedBlocks(body) {
|
|
|
17122
17123
|
}
|
|
17123
17124
|
return out.join('\n');
|
|
17124
17125
|
}
|
|
17126
|
+
/**
|
|
17127
|
+
* Remove HTML comments before any structural parsing. Template scaffolds ship guidance inside
|
|
17128
|
+
* `<!-- ... -->`, and it is invisible when the markdown renders, so a reader that treats it as
|
|
17129
|
+
* content is reading something the author never wrote.
|
|
17130
|
+
*
|
|
17131
|
+
* Found by running the published preflight over an untouched `pathmode-intent` scaffold: the
|
|
17132
|
+
* Objective section held only a comment explaining what an objective is, that comment named "a
|
|
17133
|
+
* role, a team, an operator, an agent", and those actor words carried it past
|
|
17134
|
+
* `isObjectiveSpecific`. The scaffold reported a PASSING objective nobody had written. A first-run
|
|
17135
|
+
* verdict that praises an empty template is worse than one that blocks, because it is confidently
|
|
17136
|
+
* wrong at exactly the moment a new user is deciding whether to trust the tool at all.
|
|
17137
|
+
*
|
|
17138
|
+
* Applied AFTER `stripFencedBlocks`, so a `<!--` appearing as example content inside a fence is
|
|
17139
|
+
* already gone and cannot open a comment that eats real prose. An unterminated comment swallows
|
|
17140
|
+
* the rest of the document, matching both the fence rule above and what a markdown renderer does:
|
|
17141
|
+
* the parser reads what the author sees.
|
|
17142
|
+
*/
|
|
17143
|
+
function stripHtmlComments(body) {
|
|
17144
|
+
const withoutClosed = body.replace(/<!--[\s\S]*?-->/g, '');
|
|
17145
|
+
const dangling = withoutClosed.indexOf('<!--');
|
|
17146
|
+
return dangling === -1 ? withoutClosed : withoutClosed.slice(0, dangling);
|
|
17147
|
+
}
|
|
17125
17148
|
function splitSections(body) {
|
|
17126
17149
|
const sections = new Map();
|
|
17127
17150
|
let current = null;
|
|
@@ -24620,7 +24643,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/dra
|
|
|
24620
24643
|
/***/ ((module) => {
|
|
24621
24644
|
|
|
24622
24645
|
"use strict";
|
|
24623
|
-
module.exports = {"rE":"2.1.
|
|
24646
|
+
module.exports = {"rE":"2.1.3"};
|
|
24624
24647
|
|
|
24625
24648
|
/***/ })
|
|
24626
24649
|
|