@c4a/extract 0.6.1 → 0.6.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/README.md +1 -1
- package/bin/c4a-extract-code.js +196 -346
- package/index.js +458 -375
- package/package.json +4 -1
package/index.js
CHANGED
|
@@ -320,26 +320,26 @@ var require_directives = __commonJS((exports) => {
|
|
|
320
320
|
return false;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
tagName(
|
|
324
|
-
if (
|
|
323
|
+
tagName(source, onError) {
|
|
324
|
+
if (source === "!")
|
|
325
325
|
return "!";
|
|
326
|
-
if (
|
|
327
|
-
onError(`Not a valid tag: ${
|
|
326
|
+
if (source[0] !== "!") {
|
|
327
|
+
onError(`Not a valid tag: ${source}`);
|
|
328
328
|
return null;
|
|
329
329
|
}
|
|
330
|
-
if (
|
|
331
|
-
const verbatim =
|
|
330
|
+
if (source[1] === "<") {
|
|
331
|
+
const verbatim = source.slice(2, -1);
|
|
332
332
|
if (verbatim === "!" || verbatim === "!!") {
|
|
333
|
-
onError(`Verbatim tags aren't resolved, so ${
|
|
333
|
+
onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
|
|
334
334
|
return null;
|
|
335
335
|
}
|
|
336
|
-
if (
|
|
336
|
+
if (source[source.length - 1] !== ">")
|
|
337
337
|
onError("Verbatim tags must end with a >");
|
|
338
338
|
return verbatim;
|
|
339
339
|
}
|
|
340
|
-
const [, handle, suffix] =
|
|
340
|
+
const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
|
|
341
341
|
if (!suffix)
|
|
342
|
-
onError(`The ${
|
|
342
|
+
onError(`The ${source} tag has no suffix`);
|
|
343
343
|
const prefix = this.tags[handle];
|
|
344
344
|
if (prefix) {
|
|
345
345
|
try {
|
|
@@ -350,8 +350,8 @@ var require_directives = __commonJS((exports) => {
|
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
if (handle === "!")
|
|
353
|
-
return
|
|
354
|
-
onError(`Could not resolve tag: ${
|
|
353
|
+
return source;
|
|
354
|
+
onError(`Could not resolve tag: ${source}`);
|
|
355
355
|
return null;
|
|
356
356
|
}
|
|
357
357
|
tagString(tag) {
|
|
@@ -423,21 +423,21 @@ var require_anchors = __commonJS((exports) => {
|
|
|
423
423
|
const sourceObjects = new Map;
|
|
424
424
|
let prevAnchors = null;
|
|
425
425
|
return {
|
|
426
|
-
onAnchor: (
|
|
427
|
-
aliasObjects.push(
|
|
426
|
+
onAnchor: (source) => {
|
|
427
|
+
aliasObjects.push(source);
|
|
428
428
|
prevAnchors ?? (prevAnchors = anchorNames(doc));
|
|
429
429
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
430
430
|
prevAnchors.add(anchor);
|
|
431
431
|
return anchor;
|
|
432
432
|
},
|
|
433
433
|
setAnchors: () => {
|
|
434
|
-
for (const
|
|
435
|
-
const ref = sourceObjects.get(
|
|
434
|
+
for (const source of aliasObjects) {
|
|
435
|
+
const ref = sourceObjects.get(source);
|
|
436
436
|
if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
|
|
437
437
|
ref.node.anchor = ref.anchor;
|
|
438
438
|
} else {
|
|
439
439
|
const error = new Error("Failed to resolve repeated object (this should not happen)");
|
|
440
|
-
error.source =
|
|
440
|
+
error.source = source;
|
|
441
441
|
throw error;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
@@ -571,9 +571,9 @@ var require_Alias = __commonJS((exports) => {
|
|
|
571
571
|
var toJS = require_toJS();
|
|
572
572
|
|
|
573
573
|
class Alias extends Node.NodeBase {
|
|
574
|
-
constructor(
|
|
574
|
+
constructor(source) {
|
|
575
575
|
super(identity.ALIAS);
|
|
576
|
-
this.source =
|
|
576
|
+
this.source = source;
|
|
577
577
|
Object.defineProperty(this, "tag", {
|
|
578
578
|
set() {
|
|
579
579
|
throw new Error("Alias nodes cannot have tags");
|
|
@@ -608,15 +608,15 @@ var require_Alias = __commonJS((exports) => {
|
|
|
608
608
|
if (!ctx)
|
|
609
609
|
return { source: this.source };
|
|
610
610
|
const { anchors: anchors2, doc, maxAliasCount } = ctx;
|
|
611
|
-
const
|
|
612
|
-
if (!
|
|
611
|
+
const source = this.resolve(doc, ctx);
|
|
612
|
+
if (!source) {
|
|
613
613
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
614
614
|
throw new ReferenceError(msg);
|
|
615
615
|
}
|
|
616
|
-
let data = anchors2.get(
|
|
616
|
+
let data = anchors2.get(source);
|
|
617
617
|
if (!data) {
|
|
618
|
-
toJS.toJS(
|
|
619
|
-
data = anchors2.get(
|
|
618
|
+
toJS.toJS(source, null, ctx);
|
|
619
|
+
data = anchors2.get(source);
|
|
620
620
|
}
|
|
621
621
|
if (data?.res === undefined) {
|
|
622
622
|
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
@@ -625,7 +625,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
625
625
|
if (maxAliasCount >= 0) {
|
|
626
626
|
data.count += 1;
|
|
627
627
|
if (data.aliasCount === 0)
|
|
628
|
-
data.aliasCount = getAliasCount(doc,
|
|
628
|
+
data.aliasCount = getAliasCount(doc, source, anchors2);
|
|
629
629
|
if (data.count * data.aliasCount > maxAliasCount) {
|
|
630
630
|
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
631
631
|
throw new ReferenceError(msg);
|
|
@@ -649,8 +649,8 @@ var require_Alias = __commonJS((exports) => {
|
|
|
649
649
|
}
|
|
650
650
|
function getAliasCount(doc, node2, anchors2) {
|
|
651
651
|
if (identity.isAlias(node2)) {
|
|
652
|
-
const
|
|
653
|
-
const anchor = anchors2 &&
|
|
652
|
+
const source = node2.resolve(doc);
|
|
653
|
+
const anchor = anchors2 && source && anchors2.get(source);
|
|
654
654
|
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
655
655
|
} else if (identity.isCollection(node2)) {
|
|
656
656
|
let count = 0;
|
|
@@ -1640,10 +1640,10 @@ var require_merge = __commonJS((exports) => {
|
|
|
1640
1640
|
mergeValue(ctx, map, value);
|
|
1641
1641
|
}
|
|
1642
1642
|
function mergeValue(ctx, map, value) {
|
|
1643
|
-
const
|
|
1644
|
-
if (!identity.isMap(
|
|
1643
|
+
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
1644
|
+
if (!identity.isMap(source))
|
|
1645
1645
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1646
|
-
const srcMap =
|
|
1646
|
+
const srcMap = source.toJSON(null, ctx, Map);
|
|
1647
1647
|
for (const [key, value2] of srcMap) {
|
|
1648
1648
|
if (map instanceof Map) {
|
|
1649
1649
|
if (!map.has(key))
|
|
@@ -2194,7 +2194,7 @@ var require_null = __commonJS((exports) => {
|
|
|
2194
2194
|
tag: "tag:yaml.org,2002:null",
|
|
2195
2195
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
2196
2196
|
resolve: () => new Scalar.Scalar(null),
|
|
2197
|
-
stringify: ({ source
|
|
2197
|
+
stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr
|
|
2198
2198
|
};
|
|
2199
2199
|
exports.nullTag = nullTag;
|
|
2200
2200
|
});
|
|
@@ -2208,11 +2208,11 @@ var require_bool = __commonJS((exports) => {
|
|
|
2208
2208
|
tag: "tag:yaml.org,2002:bool",
|
|
2209
2209
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
2210
2210
|
resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"),
|
|
2211
|
-
stringify({ source
|
|
2212
|
-
if (
|
|
2213
|
-
const sv =
|
|
2211
|
+
stringify({ source, value }, ctx) {
|
|
2212
|
+
if (source && boolTag.test.test(source)) {
|
|
2213
|
+
const sv = source[0] === "t" || source[0] === "T";
|
|
2214
2214
|
if (value === sv)
|
|
2215
|
-
return
|
|
2215
|
+
return source;
|
|
2216
2216
|
}
|
|
2217
2217
|
return value ? ctx.options.trueStr : ctx.options.falseStr;
|
|
2218
2218
|
}
|
|
@@ -2623,10 +2623,10 @@ var require_omap = __commonJS((exports) => {
|
|
|
2623
2623
|
// ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
2624
2624
|
var require_bool2 = __commonJS((exports) => {
|
|
2625
2625
|
var Scalar = require_Scalar();
|
|
2626
|
-
function boolStringify({ value, source
|
|
2626
|
+
function boolStringify({ value, source }, ctx) {
|
|
2627
2627
|
const boolObj = value ? trueTag : falseTag;
|
|
2628
|
-
if (
|
|
2629
|
-
return
|
|
2628
|
+
if (source && boolObj.test.test(source))
|
|
2629
|
+
return source;
|
|
2630
2630
|
return value ? ctx.options.trueStr : ctx.options.falseStr;
|
|
2631
2631
|
}
|
|
2632
2632
|
var trueTag = {
|
|
@@ -3839,7 +3839,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
3839
3839
|
let hasSpace = false;
|
|
3840
3840
|
let sep = "";
|
|
3841
3841
|
for (const token of end) {
|
|
3842
|
-
const { source
|
|
3842
|
+
const { source, type } = token;
|
|
3843
3843
|
switch (type) {
|
|
3844
3844
|
case "space":
|
|
3845
3845
|
hasSpace = true;
|
|
@@ -3847,7 +3847,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
3847
3847
|
case "comment": {
|
|
3848
3848
|
if (reqSpace && !hasSpace)
|
|
3849
3849
|
onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
3850
|
-
const cb =
|
|
3850
|
+
const cb = source.substring(1) || " ";
|
|
3851
3851
|
if (!comment)
|
|
3852
3852
|
comment = cb;
|
|
3853
3853
|
else
|
|
@@ -3857,13 +3857,13 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
3857
3857
|
}
|
|
3858
3858
|
case "newline":
|
|
3859
3859
|
if (comment)
|
|
3860
|
-
sep +=
|
|
3860
|
+
sep += source;
|
|
3861
3861
|
hasSpace = true;
|
|
3862
3862
|
break;
|
|
3863
3863
|
default:
|
|
3864
3864
|
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`);
|
|
3865
3865
|
}
|
|
3866
|
-
offset +=
|
|
3866
|
+
offset += source.length;
|
|
3867
3867
|
}
|
|
3868
3868
|
}
|
|
3869
3869
|
return { comment, offset };
|
|
@@ -4251,13 +4251,13 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4251
4251
|
onError(props[0], "IMPOSSIBLE", "Block scalar header not found");
|
|
4252
4252
|
return null;
|
|
4253
4253
|
}
|
|
4254
|
-
const { source
|
|
4255
|
-
const mode =
|
|
4254
|
+
const { source } = props[0];
|
|
4255
|
+
const mode = source[0];
|
|
4256
4256
|
let indent = 0;
|
|
4257
4257
|
let chomp = "";
|
|
4258
4258
|
let error = -1;
|
|
4259
|
-
for (let i = 1;i <
|
|
4260
|
-
const ch =
|
|
4259
|
+
for (let i = 1;i < source.length; ++i) {
|
|
4260
|
+
const ch = source[i];
|
|
4261
4261
|
if (!chomp && (ch === "-" || ch === "+"))
|
|
4262
4262
|
chomp = ch;
|
|
4263
4263
|
else {
|
|
@@ -4269,10 +4269,10 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4269
4269
|
}
|
|
4270
4270
|
}
|
|
4271
4271
|
if (error !== -1)
|
|
4272
|
-
onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${
|
|
4272
|
+
onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`);
|
|
4273
4273
|
let hasSpace = false;
|
|
4274
4274
|
let comment = "";
|
|
4275
|
-
let length =
|
|
4275
|
+
let length = source.length;
|
|
4276
4276
|
for (let i = 1;i < props.length; ++i) {
|
|
4277
4277
|
const token = props[i];
|
|
4278
4278
|
switch (token.type) {
|
|
@@ -4304,8 +4304,8 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4304
4304
|
}
|
|
4305
4305
|
return { mode, indent, chomp, comment, length };
|
|
4306
4306
|
}
|
|
4307
|
-
function splitLines(
|
|
4308
|
-
const split =
|
|
4307
|
+
function splitLines(source) {
|
|
4308
|
+
const split = source.split(/\n( *)/);
|
|
4309
4309
|
const first = split[0];
|
|
4310
4310
|
const m = first.match(/^( *)/);
|
|
4311
4311
|
const line0 = m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first];
|
|
@@ -4322,22 +4322,22 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4322
4322
|
var Scalar = require_Scalar();
|
|
4323
4323
|
var resolveEnd = require_resolve_end();
|
|
4324
4324
|
function resolveFlowScalar(scalar, strict, onError) {
|
|
4325
|
-
const { offset, type, source
|
|
4325
|
+
const { offset, type, source, end } = scalar;
|
|
4326
4326
|
let _type;
|
|
4327
4327
|
let value;
|
|
4328
4328
|
const _onError = (rel, code, msg) => onError(offset + rel, code, msg);
|
|
4329
4329
|
switch (type) {
|
|
4330
4330
|
case "scalar":
|
|
4331
4331
|
_type = Scalar.Scalar.PLAIN;
|
|
4332
|
-
value = plainValue(
|
|
4332
|
+
value = plainValue(source, _onError);
|
|
4333
4333
|
break;
|
|
4334
4334
|
case "single-quoted-scalar":
|
|
4335
4335
|
_type = Scalar.Scalar.QUOTE_SINGLE;
|
|
4336
|
-
value = singleQuotedValue(
|
|
4336
|
+
value = singleQuotedValue(source, _onError);
|
|
4337
4337
|
break;
|
|
4338
4338
|
case "double-quoted-scalar":
|
|
4339
4339
|
_type = Scalar.Scalar.QUOTE_DOUBLE;
|
|
4340
|
-
value = doubleQuotedValue(
|
|
4340
|
+
value = doubleQuotedValue(source, _onError);
|
|
4341
4341
|
break;
|
|
4342
4342
|
default:
|
|
4343
4343
|
onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
|
|
@@ -4345,10 +4345,10 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4345
4345
|
value: "",
|
|
4346
4346
|
type: null,
|
|
4347
4347
|
comment: "",
|
|
4348
|
-
range: [offset, offset +
|
|
4348
|
+
range: [offset, offset + source.length, offset + source.length]
|
|
4349
4349
|
};
|
|
4350
4350
|
}
|
|
4351
|
-
const valueEnd = offset +
|
|
4351
|
+
const valueEnd = offset + source.length;
|
|
4352
4352
|
const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
|
|
4353
4353
|
return {
|
|
4354
4354
|
value,
|
|
@@ -4357,9 +4357,9 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4357
4357
|
range: [offset, valueEnd, re.offset]
|
|
4358
4358
|
};
|
|
4359
4359
|
}
|
|
4360
|
-
function plainValue(
|
|
4360
|
+
function plainValue(source, onError) {
|
|
4361
4361
|
let badChar = "";
|
|
4362
|
-
switch (
|
|
4362
|
+
switch (source[0]) {
|
|
4363
4363
|
case "\t":
|
|
4364
4364
|
badChar = "a tab character";
|
|
4365
4365
|
break;
|
|
@@ -4371,25 +4371,25 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4371
4371
|
break;
|
|
4372
4372
|
case "|":
|
|
4373
4373
|
case ">": {
|
|
4374
|
-
badChar = `block scalar indicator ${
|
|
4374
|
+
badChar = `block scalar indicator ${source[0]}`;
|
|
4375
4375
|
break;
|
|
4376
4376
|
}
|
|
4377
4377
|
case "@":
|
|
4378
4378
|
case "`": {
|
|
4379
|
-
badChar = `reserved character ${
|
|
4379
|
+
badChar = `reserved character ${source[0]}`;
|
|
4380
4380
|
break;
|
|
4381
4381
|
}
|
|
4382
4382
|
}
|
|
4383
4383
|
if (badChar)
|
|
4384
4384
|
onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
|
|
4385
|
-
return foldLines(
|
|
4385
|
+
return foldLines(source);
|
|
4386
4386
|
}
|
|
4387
|
-
function singleQuotedValue(
|
|
4388
|
-
if (
|
|
4389
|
-
onError(
|
|
4390
|
-
return foldLines(
|
|
4387
|
+
function singleQuotedValue(source, onError) {
|
|
4388
|
+
if (source[source.length - 1] !== "'" || source.length === 1)
|
|
4389
|
+
onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
|
|
4390
|
+
return foldLines(source.slice(1, -1)).replace(/''/g, "'");
|
|
4391
4391
|
}
|
|
4392
|
-
function foldLines(
|
|
4392
|
+
function foldLines(source) {
|
|
4393
4393
|
let first, line;
|
|
4394
4394
|
try {
|
|
4395
4395
|
first = new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
@@ -4400,14 +4400,14 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4400
4400
|
first = /(.*?)[ \t]*\r?\n/sy;
|
|
4401
4401
|
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
4402
4402
|
}
|
|
4403
|
-
let match = first.exec(
|
|
4403
|
+
let match = first.exec(source);
|
|
4404
4404
|
if (!match)
|
|
4405
|
-
return
|
|
4405
|
+
return source;
|
|
4406
4406
|
let res = match[1];
|
|
4407
4407
|
let sep = " ";
|
|
4408
4408
|
let pos = first.lastIndex;
|
|
4409
4409
|
line.lastIndex = pos;
|
|
4410
|
-
while (match = line.exec(
|
|
4410
|
+
while (match = line.exec(source)) {
|
|
4411
4411
|
if (match[1] === "") {
|
|
4412
4412
|
if (sep === `
|
|
4413
4413
|
`)
|
|
@@ -4423,68 +4423,68 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4423
4423
|
}
|
|
4424
4424
|
const last = /[ \t]*(.*)/sy;
|
|
4425
4425
|
last.lastIndex = pos;
|
|
4426
|
-
match = last.exec(
|
|
4426
|
+
match = last.exec(source);
|
|
4427
4427
|
return res + sep + (match?.[1] ?? "");
|
|
4428
4428
|
}
|
|
4429
|
-
function doubleQuotedValue(
|
|
4429
|
+
function doubleQuotedValue(source, onError) {
|
|
4430
4430
|
let res = "";
|
|
4431
|
-
for (let i = 1;i <
|
|
4432
|
-
const ch =
|
|
4433
|
-
if (ch === "\r" &&
|
|
4431
|
+
for (let i = 1;i < source.length - 1; ++i) {
|
|
4432
|
+
const ch = source[i];
|
|
4433
|
+
if (ch === "\r" && source[i + 1] === `
|
|
4434
4434
|
`)
|
|
4435
4435
|
continue;
|
|
4436
4436
|
if (ch === `
|
|
4437
4437
|
`) {
|
|
4438
|
-
const { fold, offset } = foldNewline(
|
|
4438
|
+
const { fold, offset } = foldNewline(source, i);
|
|
4439
4439
|
res += fold;
|
|
4440
4440
|
i = offset;
|
|
4441
4441
|
} else if (ch === "\\") {
|
|
4442
|
-
let next =
|
|
4442
|
+
let next = source[++i];
|
|
4443
4443
|
const cc = escapeCodes[next];
|
|
4444
4444
|
if (cc)
|
|
4445
4445
|
res += cc;
|
|
4446
4446
|
else if (next === `
|
|
4447
4447
|
`) {
|
|
4448
|
-
next =
|
|
4448
|
+
next = source[i + 1];
|
|
4449
4449
|
while (next === " " || next === "\t")
|
|
4450
|
-
next =
|
|
4451
|
-
} else if (next === "\r" &&
|
|
4450
|
+
next = source[++i + 1];
|
|
4451
|
+
} else if (next === "\r" && source[i + 1] === `
|
|
4452
4452
|
`) {
|
|
4453
|
-
next =
|
|
4453
|
+
next = source[++i + 1];
|
|
4454
4454
|
while (next === " " || next === "\t")
|
|
4455
|
-
next =
|
|
4455
|
+
next = source[++i + 1];
|
|
4456
4456
|
} else if (next === "x" || next === "u" || next === "U") {
|
|
4457
4457
|
const length = { x: 2, u: 4, U: 8 }[next];
|
|
4458
|
-
res += parseCharCode(
|
|
4458
|
+
res += parseCharCode(source, i + 1, length, onError);
|
|
4459
4459
|
i += length;
|
|
4460
4460
|
} else {
|
|
4461
|
-
const raw =
|
|
4461
|
+
const raw = source.substr(i - 1, 2);
|
|
4462
4462
|
onError(i - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
|
|
4463
4463
|
res += raw;
|
|
4464
4464
|
}
|
|
4465
4465
|
} else if (ch === " " || ch === "\t") {
|
|
4466
4466
|
const wsStart = i;
|
|
4467
|
-
let next =
|
|
4467
|
+
let next = source[i + 1];
|
|
4468
4468
|
while (next === " " || next === "\t")
|
|
4469
|
-
next =
|
|
4469
|
+
next = source[++i + 1];
|
|
4470
4470
|
if (next !== `
|
|
4471
|
-
` && !(next === "\r" &&
|
|
4471
|
+
` && !(next === "\r" && source[i + 2] === `
|
|
4472
4472
|
`))
|
|
4473
|
-
res += i > wsStart ?
|
|
4473
|
+
res += i > wsStart ? source.slice(wsStart, i + 1) : ch;
|
|
4474
4474
|
} else {
|
|
4475
4475
|
res += ch;
|
|
4476
4476
|
}
|
|
4477
4477
|
}
|
|
4478
|
-
if (
|
|
4479
|
-
onError(
|
|
4478
|
+
if (source[source.length - 1] !== '"' || source.length === 1)
|
|
4479
|
+
onError(source.length, "MISSING_CHAR", 'Missing closing "quote');
|
|
4480
4480
|
return res;
|
|
4481
4481
|
}
|
|
4482
|
-
function foldNewline(
|
|
4482
|
+
function foldNewline(source, offset) {
|
|
4483
4483
|
let fold = "";
|
|
4484
|
-
let ch =
|
|
4484
|
+
let ch = source[offset + 1];
|
|
4485
4485
|
while (ch === " " || ch === "\t" || ch === `
|
|
4486
4486
|
` || ch === "\r") {
|
|
4487
|
-
if (ch === "\r" &&
|
|
4487
|
+
if (ch === "\r" && source[offset + 2] !== `
|
|
4488
4488
|
`)
|
|
4489
4489
|
break;
|
|
4490
4490
|
if (ch === `
|
|
@@ -4492,7 +4492,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4492
4492
|
fold += `
|
|
4493
4493
|
`;
|
|
4494
4494
|
offset += 1;
|
|
4495
|
-
ch =
|
|
4495
|
+
ch = source[offset + 1];
|
|
4496
4496
|
}
|
|
4497
4497
|
if (!fold)
|
|
4498
4498
|
fold = " ";
|
|
@@ -4519,12 +4519,12 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4519
4519
|
"\\": "\\",
|
|
4520
4520
|
"\t": "\t"
|
|
4521
4521
|
};
|
|
4522
|
-
function parseCharCode(
|
|
4523
|
-
const cc =
|
|
4522
|
+
function parseCharCode(source, offset, length, onError) {
|
|
4523
|
+
const cc = source.substr(offset, length);
|
|
4524
4524
|
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
|
|
4525
4525
|
const code = ok ? parseInt(cc, 16) : NaN;
|
|
4526
4526
|
if (isNaN(code)) {
|
|
4527
|
-
const raw =
|
|
4527
|
+
const raw = source.substr(offset - 2, length + 2);
|
|
4528
4528
|
onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
|
|
4529
4529
|
return raw;
|
|
4530
4530
|
}
|
|
@@ -4719,13 +4719,13 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
4719
4719
|
}
|
|
4720
4720
|
return node2;
|
|
4721
4721
|
}
|
|
4722
|
-
function composeAlias({ options }, { offset, source
|
|
4723
|
-
const alias = new Alias.Alias(
|
|
4722
|
+
function composeAlias({ options }, { offset, source, end }, onError) {
|
|
4723
|
+
const alias = new Alias.Alias(source.substring(1));
|
|
4724
4724
|
if (alias.source === "")
|
|
4725
4725
|
onError(offset, "BAD_ALIAS", "Alias cannot be an empty string");
|
|
4726
4726
|
if (alias.source.endsWith(":"))
|
|
4727
|
-
onError(offset +
|
|
4728
|
-
const valueEnd = offset +
|
|
4727
|
+
onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
|
|
4728
|
+
const valueEnd = offset + source.length;
|
|
4729
4729
|
const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
|
|
4730
4730
|
alias.range = [offset, valueEnd, re.offset];
|
|
4731
4731
|
if (re.comment)
|
|
@@ -4790,21 +4790,21 @@ var require_composer = __commonJS((exports) => {
|
|
|
4790
4790
|
return [src, src + 1];
|
|
4791
4791
|
if (Array.isArray(src))
|
|
4792
4792
|
return src.length === 2 ? src : [src[0], src[1]];
|
|
4793
|
-
const { offset, source
|
|
4794
|
-
return [offset, offset + (typeof
|
|
4793
|
+
const { offset, source } = src;
|
|
4794
|
+
return [offset, offset + (typeof source === "string" ? source.length : 1)];
|
|
4795
4795
|
}
|
|
4796
4796
|
function parsePrelude(prelude) {
|
|
4797
4797
|
let comment = "";
|
|
4798
4798
|
let atComment = false;
|
|
4799
4799
|
let afterEmptyLine = false;
|
|
4800
4800
|
for (let i = 0;i < prelude.length; ++i) {
|
|
4801
|
-
const
|
|
4802
|
-
switch (
|
|
4801
|
+
const source = prelude[i];
|
|
4802
|
+
switch (source[0]) {
|
|
4803
4803
|
case "#":
|
|
4804
4804
|
comment += (comment === "" ? "" : afterEmptyLine ? `
|
|
4805
4805
|
|
|
4806
4806
|
` : `
|
|
4807
|
-
`) + (
|
|
4807
|
+
`) + (source.substring(1) || " ");
|
|
4808
4808
|
atComment = true;
|
|
4809
4809
|
afterEmptyLine = false;
|
|
4810
4810
|
break;
|
|
@@ -4829,8 +4829,8 @@ var require_composer = __commonJS((exports) => {
|
|
|
4829
4829
|
this.prelude = [];
|
|
4830
4830
|
this.errors = [];
|
|
4831
4831
|
this.warnings = [];
|
|
4832
|
-
this.onError = (
|
|
4833
|
-
const pos = getErrorPos(
|
|
4832
|
+
this.onError = (source, code, message, warning) => {
|
|
4833
|
+
const pos = getErrorPos(source);
|
|
4834
4834
|
if (warning)
|
|
4835
4835
|
this.warnings.push(new errors2.YAMLWarning(pos, code, message));
|
|
4836
4836
|
else
|
|
@@ -4993,7 +4993,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
4993
4993
|
}
|
|
4994
4994
|
function createScalarToken(value, context) {
|
|
4995
4995
|
const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context;
|
|
4996
|
-
const
|
|
4996
|
+
const source = stringifyString.stringifyString({ type, value }, {
|
|
4997
4997
|
implicitKey,
|
|
4998
4998
|
indent: indent > 0 ? " ".repeat(indent) : "",
|
|
4999
4999
|
inFlow,
|
|
@@ -5003,13 +5003,13 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5003
5003
|
{ type: "newline", offset: -1, indent, source: `
|
|
5004
5004
|
` }
|
|
5005
5005
|
];
|
|
5006
|
-
switch (
|
|
5006
|
+
switch (source[0]) {
|
|
5007
5007
|
case "|":
|
|
5008
5008
|
case ">": {
|
|
5009
|
-
const he =
|
|
5009
|
+
const he = source.indexOf(`
|
|
5010
5010
|
`);
|
|
5011
|
-
const head =
|
|
5012
|
-
const body =
|
|
5011
|
+
const head = source.substring(0, he);
|
|
5012
|
+
const body = source.substring(he + 1) + `
|
|
5013
5013
|
`;
|
|
5014
5014
|
const props = [
|
|
5015
5015
|
{ type: "block-scalar-header", offset, indent, source: head }
|
|
@@ -5020,11 +5020,11 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5020
5020
|
return { type: "block-scalar", offset, indent, props, source: body };
|
|
5021
5021
|
}
|
|
5022
5022
|
case '"':
|
|
5023
|
-
return { type: "double-quoted-scalar", offset, indent, source
|
|
5023
|
+
return { type: "double-quoted-scalar", offset, indent, source, end };
|
|
5024
5024
|
case "'":
|
|
5025
|
-
return { type: "single-quoted-scalar", offset, indent, source
|
|
5025
|
+
return { type: "single-quoted-scalar", offset, indent, source, end };
|
|
5026
5026
|
default:
|
|
5027
|
-
return { type: "scalar", offset, indent, source
|
|
5027
|
+
return { type: "scalar", offset, indent, source, end };
|
|
5028
5028
|
}
|
|
5029
5029
|
}
|
|
5030
5030
|
function setScalarValue(token, value, context = {}) {
|
|
@@ -5050,32 +5050,32 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5050
5050
|
default:
|
|
5051
5051
|
type = "PLAIN";
|
|
5052
5052
|
}
|
|
5053
|
-
const
|
|
5053
|
+
const source = stringifyString.stringifyString({ type, value }, {
|
|
5054
5054
|
implicitKey: implicitKey || indent === null,
|
|
5055
5055
|
indent: indent !== null && indent > 0 ? " ".repeat(indent) : "",
|
|
5056
5056
|
inFlow,
|
|
5057
5057
|
options: { blockQuote: true, lineWidth: -1 }
|
|
5058
5058
|
});
|
|
5059
|
-
switch (
|
|
5059
|
+
switch (source[0]) {
|
|
5060
5060
|
case "|":
|
|
5061
5061
|
case ">":
|
|
5062
|
-
setBlockScalarValue(token,
|
|
5062
|
+
setBlockScalarValue(token, source);
|
|
5063
5063
|
break;
|
|
5064
5064
|
case '"':
|
|
5065
|
-
setFlowScalarValue(token,
|
|
5065
|
+
setFlowScalarValue(token, source, "double-quoted-scalar");
|
|
5066
5066
|
break;
|
|
5067
5067
|
case "'":
|
|
5068
|
-
setFlowScalarValue(token,
|
|
5068
|
+
setFlowScalarValue(token, source, "single-quoted-scalar");
|
|
5069
5069
|
break;
|
|
5070
5070
|
default:
|
|
5071
|
-
setFlowScalarValue(token,
|
|
5071
|
+
setFlowScalarValue(token, source, "scalar");
|
|
5072
5072
|
}
|
|
5073
5073
|
}
|
|
5074
|
-
function setBlockScalarValue(token,
|
|
5075
|
-
const he =
|
|
5074
|
+
function setBlockScalarValue(token, source) {
|
|
5075
|
+
const he = source.indexOf(`
|
|
5076
5076
|
`);
|
|
5077
|
-
const head =
|
|
5078
|
-
const body =
|
|
5077
|
+
const head = source.substring(0, he);
|
|
5078
|
+
const body = source.substring(he + 1) + `
|
|
5079
5079
|
`;
|
|
5080
5080
|
if (token.type === "block-scalar") {
|
|
5081
5081
|
const header = token.props[0];
|
|
@@ -5112,32 +5112,32 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5112
5112
|
}
|
|
5113
5113
|
return false;
|
|
5114
5114
|
}
|
|
5115
|
-
function setFlowScalarValue(token,
|
|
5115
|
+
function setFlowScalarValue(token, source, type) {
|
|
5116
5116
|
switch (token.type) {
|
|
5117
5117
|
case "scalar":
|
|
5118
5118
|
case "double-quoted-scalar":
|
|
5119
5119
|
case "single-quoted-scalar":
|
|
5120
5120
|
token.type = type;
|
|
5121
|
-
token.source =
|
|
5121
|
+
token.source = source;
|
|
5122
5122
|
break;
|
|
5123
5123
|
case "block-scalar": {
|
|
5124
5124
|
const end = token.props.slice(1);
|
|
5125
|
-
let oa =
|
|
5125
|
+
let oa = source.length;
|
|
5126
5126
|
if (token.props[0].type === "block-scalar-header")
|
|
5127
5127
|
oa -= token.props[0].source.length;
|
|
5128
5128
|
for (const tok of end)
|
|
5129
5129
|
tok.offset += oa;
|
|
5130
5130
|
delete token.props;
|
|
5131
|
-
Object.assign(token, { type, source
|
|
5131
|
+
Object.assign(token, { type, source, end });
|
|
5132
5132
|
break;
|
|
5133
5133
|
}
|
|
5134
5134
|
case "block-map":
|
|
5135
5135
|
case "block-seq": {
|
|
5136
|
-
const offset = token.offset +
|
|
5136
|
+
const offset = token.offset + source.length;
|
|
5137
5137
|
const nl = { type: "newline", offset, indent: token.indent, source: `
|
|
5138
5138
|
` };
|
|
5139
5139
|
delete token.items;
|
|
5140
|
-
Object.assign(token, { type, source
|
|
5140
|
+
Object.assign(token, { type, source, end: [nl] });
|
|
5141
5141
|
break;
|
|
5142
5142
|
}
|
|
5143
5143
|
default: {
|
|
@@ -5146,7 +5146,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5146
5146
|
for (const key of Object.keys(token))
|
|
5147
5147
|
if (key !== "type" && key !== "offset")
|
|
5148
5148
|
delete token[key];
|
|
5149
|
-
Object.assign(token, { type, indent, source
|
|
5149
|
+
Object.assign(token, { type, indent, source, end });
|
|
5150
5150
|
}
|
|
5151
5151
|
}
|
|
5152
5152
|
}
|
|
@@ -5297,8 +5297,8 @@ var require_cst = __commonJS((exports) => {
|
|
|
5297
5297
|
return JSON.stringify(token);
|
|
5298
5298
|
}
|
|
5299
5299
|
}
|
|
5300
|
-
function tokenType(
|
|
5301
|
-
switch (
|
|
5300
|
+
function tokenType(source) {
|
|
5301
|
+
switch (source) {
|
|
5302
5302
|
case BOM:
|
|
5303
5303
|
return "byte-order-mark";
|
|
5304
5304
|
case DOCUMENT:
|
|
@@ -5334,7 +5334,7 @@ var require_cst = __commonJS((exports) => {
|
|
|
5334
5334
|
case ",":
|
|
5335
5335
|
return "comma";
|
|
5336
5336
|
}
|
|
5337
|
-
switch (
|
|
5337
|
+
switch (source[0]) {
|
|
5338
5338
|
case " ":
|
|
5339
5339
|
case "\t":
|
|
5340
5340
|
return "space";
|
|
@@ -5410,11 +5410,11 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5410
5410
|
this.next = null;
|
|
5411
5411
|
this.pos = 0;
|
|
5412
5412
|
}
|
|
5413
|
-
*lex(
|
|
5414
|
-
if (
|
|
5415
|
-
if (typeof
|
|
5413
|
+
*lex(source, incomplete = false) {
|
|
5414
|
+
if (source) {
|
|
5415
|
+
if (typeof source !== "string")
|
|
5416
5416
|
throw TypeError("source is not a string");
|
|
5417
|
-
this.buffer = this.buffer ? this.buffer +
|
|
5417
|
+
this.buffer = this.buffer ? this.buffer + source : source;
|
|
5418
5418
|
this.lineEndPos = null;
|
|
5419
5419
|
}
|
|
5420
5420
|
this.atEnd = !incomplete;
|
|
@@ -6088,29 +6088,29 @@ var require_parser = __commonJS((exports) => {
|
|
|
6088
6088
|
this.lexer = new lexer.Lexer;
|
|
6089
6089
|
this.onNewLine = onNewLine;
|
|
6090
6090
|
}
|
|
6091
|
-
*parse(
|
|
6091
|
+
*parse(source, incomplete = false) {
|
|
6092
6092
|
if (this.onNewLine && this.offset === 0)
|
|
6093
6093
|
this.onNewLine(0);
|
|
6094
|
-
for (const lexeme of this.lexer.lex(
|
|
6094
|
+
for (const lexeme of this.lexer.lex(source, incomplete))
|
|
6095
6095
|
yield* this.next(lexeme);
|
|
6096
6096
|
if (!incomplete)
|
|
6097
6097
|
yield* this.end();
|
|
6098
6098
|
}
|
|
6099
|
-
*next(
|
|
6100
|
-
this.source =
|
|
6099
|
+
*next(source) {
|
|
6100
|
+
this.source = source;
|
|
6101
6101
|
if (node_process.env.LOG_TOKENS)
|
|
6102
|
-
console.log("|", cst.prettyToken(
|
|
6102
|
+
console.log("|", cst.prettyToken(source));
|
|
6103
6103
|
if (this.atScalar) {
|
|
6104
6104
|
this.atScalar = false;
|
|
6105
6105
|
yield* this.step();
|
|
6106
|
-
this.offset +=
|
|
6106
|
+
this.offset += source.length;
|
|
6107
6107
|
return;
|
|
6108
6108
|
}
|
|
6109
|
-
const type = cst.tokenType(
|
|
6109
|
+
const type = cst.tokenType(source);
|
|
6110
6110
|
if (!type) {
|
|
6111
|
-
const message = `Not a YAML token: ${
|
|
6112
|
-
yield* this.pop({ type: "error", offset: this.offset, message, source
|
|
6113
|
-
this.offset +=
|
|
6111
|
+
const message = `Not a YAML token: ${source}`;
|
|
6112
|
+
yield* this.pop({ type: "error", offset: this.offset, message, source });
|
|
6113
|
+
this.offset += source.length;
|
|
6114
6114
|
} else if (type === "scalar") {
|
|
6115
6115
|
this.atNewLine = false;
|
|
6116
6116
|
this.atScalar = true;
|
|
@@ -6123,17 +6123,17 @@ var require_parser = __commonJS((exports) => {
|
|
|
6123
6123
|
this.atNewLine = true;
|
|
6124
6124
|
this.indent = 0;
|
|
6125
6125
|
if (this.onNewLine)
|
|
6126
|
-
this.onNewLine(this.offset +
|
|
6126
|
+
this.onNewLine(this.offset + source.length);
|
|
6127
6127
|
break;
|
|
6128
6128
|
case "space":
|
|
6129
|
-
if (this.atNewLine &&
|
|
6130
|
-
this.indent +=
|
|
6129
|
+
if (this.atNewLine && source[0] === " ")
|
|
6130
|
+
this.indent += source.length;
|
|
6131
6131
|
break;
|
|
6132
6132
|
case "explicit-key-ind":
|
|
6133
6133
|
case "map-value-ind":
|
|
6134
6134
|
case "seq-item-ind":
|
|
6135
6135
|
if (this.atNewLine)
|
|
6136
|
-
this.indent +=
|
|
6136
|
+
this.indent += source.length;
|
|
6137
6137
|
break;
|
|
6138
6138
|
case "doc-mode":
|
|
6139
6139
|
case "flow-error-end":
|
|
@@ -6141,7 +6141,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6141
6141
|
default:
|
|
6142
6142
|
this.atNewLine = false;
|
|
6143
6143
|
}
|
|
6144
|
-
this.offset +=
|
|
6144
|
+
this.offset += source.length;
|
|
6145
6145
|
}
|
|
6146
6146
|
}
|
|
6147
6147
|
*end() {
|
|
@@ -6850,26 +6850,26 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6850
6850
|
const lineCounter$1 = options.lineCounter || prettyErrors && new lineCounter.LineCounter || null;
|
|
6851
6851
|
return { lineCounter: lineCounter$1, prettyErrors };
|
|
6852
6852
|
}
|
|
6853
|
-
function parseAllDocuments(
|
|
6853
|
+
function parseAllDocuments(source, options = {}) {
|
|
6854
6854
|
const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
|
|
6855
6855
|
const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
|
|
6856
6856
|
const composer$1 = new composer.Composer(options);
|
|
6857
|
-
const docs = Array.from(composer$1.compose(parser$1.parse(
|
|
6857
|
+
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
|
6858
6858
|
if (prettyErrors && lineCounter2)
|
|
6859
6859
|
for (const doc of docs) {
|
|
6860
|
-
doc.errors.forEach(errors2.prettifyError(
|
|
6861
|
-
doc.warnings.forEach(errors2.prettifyError(
|
|
6860
|
+
doc.errors.forEach(errors2.prettifyError(source, lineCounter2));
|
|
6861
|
+
doc.warnings.forEach(errors2.prettifyError(source, lineCounter2));
|
|
6862
6862
|
}
|
|
6863
6863
|
if (docs.length > 0)
|
|
6864
6864
|
return docs;
|
|
6865
6865
|
return Object.assign([], { empty: true }, composer$1.streamInfo());
|
|
6866
6866
|
}
|
|
6867
|
-
function parseDocument(
|
|
6867
|
+
function parseDocument(source, options = {}) {
|
|
6868
6868
|
const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
|
|
6869
6869
|
const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
|
|
6870
6870
|
const composer$1 = new composer.Composer(options);
|
|
6871
6871
|
let doc = null;
|
|
6872
|
-
for (const _doc of composer$1.compose(parser$1.parse(
|
|
6872
|
+
for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
|
|
6873
6873
|
if (!doc)
|
|
6874
6874
|
doc = _doc;
|
|
6875
6875
|
else if (doc.options.logLevel !== "silent") {
|
|
@@ -6878,8 +6878,8 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6878
6878
|
}
|
|
6879
6879
|
}
|
|
6880
6880
|
if (prettyErrors && lineCounter2) {
|
|
6881
|
-
doc.errors.forEach(errors2.prettifyError(
|
|
6882
|
-
doc.warnings.forEach(errors2.prettifyError(
|
|
6881
|
+
doc.errors.forEach(errors2.prettifyError(source, lineCounter2));
|
|
6882
|
+
doc.warnings.forEach(errors2.prettifyError(source, lineCounter2));
|
|
6883
6883
|
}
|
|
6884
6884
|
return doc;
|
|
6885
6885
|
}
|
|
@@ -7700,8 +7700,8 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
7700
7700
|
if (chars.length < 1) {
|
|
7701
7701
|
return;
|
|
7702
7702
|
}
|
|
7703
|
-
const
|
|
7704
|
-
return `${
|
|
7703
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
7704
|
+
return `${source}*`;
|
|
7705
7705
|
};
|
|
7706
7706
|
var repeatedExtglobRecursion = (pattern) => {
|
|
7707
7707
|
let depth = 0;
|
|
@@ -8487,19 +8487,19 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
8487
8487
|
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
8488
8488
|
if (!match)
|
|
8489
8489
|
return;
|
|
8490
|
-
const
|
|
8491
|
-
if (!
|
|
8490
|
+
const source2 = create(match[1]);
|
|
8491
|
+
if (!source2)
|
|
8492
8492
|
return;
|
|
8493
|
-
return
|
|
8493
|
+
return source2 + DOT_LITERAL + match[2];
|
|
8494
8494
|
}
|
|
8495
8495
|
}
|
|
8496
8496
|
};
|
|
8497
8497
|
const output = utils.removePrefix(input, state);
|
|
8498
|
-
let
|
|
8499
|
-
if (
|
|
8500
|
-
|
|
8498
|
+
let source = create(output);
|
|
8499
|
+
if (source && opts.strictSlashes !== true) {
|
|
8500
|
+
source += `${SLASH_LITERAL}?`;
|
|
8501
8501
|
}
|
|
8502
|
-
return
|
|
8502
|
+
return source;
|
|
8503
8503
|
};
|
|
8504
8504
|
module.exports = parse;
|
|
8505
8505
|
});
|
|
@@ -8607,11 +8607,11 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
8607
8607
|
const opts = options || {};
|
|
8608
8608
|
const prepend = opts.contains ? "" : "^";
|
|
8609
8609
|
const append = opts.contains ? "" : "$";
|
|
8610
|
-
let
|
|
8610
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
8611
8611
|
if (state && state.negated === true) {
|
|
8612
|
-
|
|
8612
|
+
source = `^(?!${source}).*$`;
|
|
8613
8613
|
}
|
|
8614
|
-
const regex = picomatch.toRegex(
|
|
8614
|
+
const regex = picomatch.toRegex(source, options);
|
|
8615
8615
|
if (returnState === true) {
|
|
8616
8616
|
regex.state = state;
|
|
8617
8617
|
}
|
|
@@ -8630,10 +8630,10 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
8630
8630
|
}
|
|
8631
8631
|
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
8632
8632
|
};
|
|
8633
|
-
picomatch.toRegex = (
|
|
8633
|
+
picomatch.toRegex = (source, options) => {
|
|
8634
8634
|
try {
|
|
8635
8635
|
const opts = options || {};
|
|
8636
|
-
return new RegExp(
|
|
8636
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
8637
8637
|
} catch (err) {
|
|
8638
8638
|
if (options && options.debug === true)
|
|
8639
8639
|
throw err;
|
|
@@ -8775,156 +8775,6 @@ var FactRelation;
|
|
|
8775
8775
|
FactRelation2["Supersedes"] = "supersedes";
|
|
8776
8776
|
FactRelation2["References"] = "references";
|
|
8777
8777
|
})(FactRelation ||= {});
|
|
8778
|
-
// ../core/src/types/serverConfig.ts
|
|
8779
|
-
var DEFAULT_SERVER_CONFIG = {
|
|
8780
|
-
server: {
|
|
8781
|
-
port: 5100,
|
|
8782
|
-
host: "::"
|
|
8783
|
-
},
|
|
8784
|
-
git_hosts: [],
|
|
8785
|
-
daemon_scheduler: {
|
|
8786
|
-
enabled: true,
|
|
8787
|
-
host: "localhost",
|
|
8788
|
-
port: 5110,
|
|
8789
|
-
workspace: "./data/daemon-workspace",
|
|
8790
|
-
max_daemons: 20
|
|
8791
|
-
},
|
|
8792
|
-
doc_db: {
|
|
8793
|
-
provider: "sqlite",
|
|
8794
|
-
sqlite: {
|
|
8795
|
-
path: "./data/c4a.db"
|
|
8796
|
-
},
|
|
8797
|
-
mongodb: {
|
|
8798
|
-
uri: "mongodb://localhost:27017/c4a?directConnection=true",
|
|
8799
|
-
database: "c4a"
|
|
8800
|
-
}
|
|
8801
|
-
},
|
|
8802
|
-
graph_db: {
|
|
8803
|
-
provider: "neo4j",
|
|
8804
|
-
neo4j: {
|
|
8805
|
-
uri: "bolt://localhost:7687",
|
|
8806
|
-
username: "neo4j",
|
|
8807
|
-
password: ""
|
|
8808
|
-
},
|
|
8809
|
-
nebulagraph: {
|
|
8810
|
-
uri: "localhost:9669",
|
|
8811
|
-
username: "root",
|
|
8812
|
-
password: "nebula",
|
|
8813
|
-
space: "c4a"
|
|
8814
|
-
},
|
|
8815
|
-
duckdb: {
|
|
8816
|
-
path: "./data/c4a-graph.duckdb"
|
|
8817
|
-
}
|
|
8818
|
-
},
|
|
8819
|
-
vector_db: {
|
|
8820
|
-
provider: "lancedb",
|
|
8821
|
-
collection_prefix: "c4a_",
|
|
8822
|
-
qdrant: {
|
|
8823
|
-
url: "http://localhost:6333",
|
|
8824
|
-
api_key: ""
|
|
8825
|
-
},
|
|
8826
|
-
milvus: {
|
|
8827
|
-
address: "localhost:19530"
|
|
8828
|
-
},
|
|
8829
|
-
lancedb: {
|
|
8830
|
-
path: "./data/lancedb"
|
|
8831
|
-
}
|
|
8832
|
-
},
|
|
8833
|
-
llm: {
|
|
8834
|
-
provider: "openai",
|
|
8835
|
-
openai: {
|
|
8836
|
-
api_key: "",
|
|
8837
|
-
base_url: "",
|
|
8838
|
-
default_model: "gpt-5.3-codex",
|
|
8839
|
-
wire_api: "chat"
|
|
8840
|
-
},
|
|
8841
|
-
anthropic: {
|
|
8842
|
-
api_key: "",
|
|
8843
|
-
base_url: "",
|
|
8844
|
-
default_model: "claude-opus-4-6"
|
|
8845
|
-
},
|
|
8846
|
-
google: {
|
|
8847
|
-
api_key: "",
|
|
8848
|
-
base_url: "",
|
|
8849
|
-
default_model: "gemini-3-pro-preview"
|
|
8850
|
-
}
|
|
8851
|
-
},
|
|
8852
|
-
task: {
|
|
8853
|
-
concurrency: {
|
|
8854
|
-
code_index: 2,
|
|
8855
|
-
doc_index: 2,
|
|
8856
|
-
remote_clone: 2,
|
|
8857
|
-
modeling: 1
|
|
8858
|
-
},
|
|
8859
|
-
default_timeout_ms: 150 * 60 * 1000,
|
|
8860
|
-
memory_ttl_ms: 48 * 60 * 60 * 1000,
|
|
8861
|
-
cleanup_interval_ms: 10 * 60 * 1000,
|
|
8862
|
-
log_max_entries: 500
|
|
8863
|
-
},
|
|
8864
|
-
indexing: {
|
|
8865
|
-
task_timeout_ms: 150 * 60 * 1000,
|
|
8866
|
-
file_timeout_ms: 15 * 60 * 1000
|
|
8867
|
-
},
|
|
8868
|
-
intent_router: {
|
|
8869
|
-
provider: "huggingface",
|
|
8870
|
-
huggingface: {
|
|
8871
|
-
model_id: "context4ai/intent-router-onnx",
|
|
8872
|
-
cache_dir: "./models/intent-router"
|
|
8873
|
-
},
|
|
8874
|
-
xenova: {
|
|
8875
|
-
model_id: "context4ai/intent-router-onnx",
|
|
8876
|
-
cache_dir: "./models/intent-router"
|
|
8877
|
-
}
|
|
8878
|
-
},
|
|
8879
|
-
embedding: {
|
|
8880
|
-
provider: "huggingface",
|
|
8881
|
-
huggingface: {
|
|
8882
|
-
model_id: "Xenova/all-MiniLM-L6-v2",
|
|
8883
|
-
dtype: "q8",
|
|
8884
|
-
cache_dir: "./models/embedding"
|
|
8885
|
-
},
|
|
8886
|
-
xenova: {
|
|
8887
|
-
model_id: "Xenova/bge-m3",
|
|
8888
|
-
dtype: "q8",
|
|
8889
|
-
cache_dir: "./models/embedding"
|
|
8890
|
-
},
|
|
8891
|
-
openai: {
|
|
8892
|
-
api_key: "",
|
|
8893
|
-
base_url: "",
|
|
8894
|
-
model_id: "text-embedding-3-small"
|
|
8895
|
-
},
|
|
8896
|
-
google: {
|
|
8897
|
-
api_key: "",
|
|
8898
|
-
model_id: "text-embedding-004"
|
|
8899
|
-
}
|
|
8900
|
-
},
|
|
8901
|
-
reranker: {
|
|
8902
|
-
enabled: false,
|
|
8903
|
-
provider: "huggingface",
|
|
8904
|
-
huggingface: {
|
|
8905
|
-
model_id: "onnx-community/bge-reranker-v2-m3-ONNX",
|
|
8906
|
-
dtype: "q8",
|
|
8907
|
-
cache_dir: "./models/reranker"
|
|
8908
|
-
},
|
|
8909
|
-
xenova: {
|
|
8910
|
-
model_id: "onnx-community/bge-reranker-v2-m3-ONNX",
|
|
8911
|
-
dtype: "q8",
|
|
8912
|
-
cache_dir: "./models/reranker"
|
|
8913
|
-
},
|
|
8914
|
-
max_rerank: 20
|
|
8915
|
-
}
|
|
8916
|
-
};
|
|
8917
|
-
// ../core/src/types/daemon.ts
|
|
8918
|
-
var CODE_PACKAGE_FILES = new Set([
|
|
8919
|
-
"package.json",
|
|
8920
|
-
"pyproject.toml",
|
|
8921
|
-
"setup.py",
|
|
8922
|
-
"go.mod",
|
|
8923
|
-
"cargo.toml",
|
|
8924
|
-
"pom.xml",
|
|
8925
|
-
"build.gradle",
|
|
8926
|
-
"build.gradle.kts"
|
|
8927
|
-
]);
|
|
8928
8778
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
8929
8779
|
var exports_external = {};
|
|
8930
8780
|
__export(exports_external, {
|
|
@@ -13651,9 +13501,9 @@ class ExtractionPluginRegistry {
|
|
|
13651
13501
|
register(plugin) {
|
|
13652
13502
|
this.#plugins.push(plugin);
|
|
13653
13503
|
}
|
|
13654
|
-
resolve(
|
|
13655
|
-
const declaredLanguage =
|
|
13656
|
-
const manifestLanguages = new Set(
|
|
13504
|
+
resolve(source) {
|
|
13505
|
+
const declaredLanguage = source.language?.toLowerCase();
|
|
13506
|
+
const manifestLanguages = new Set(source.manifests.flatMap((manifest) => MANIFEST_LANGUAGE_CANDIDATES[manifest.type] ?? []));
|
|
13657
13507
|
const candidates = this.#plugins.filter((plugin) => {
|
|
13658
13508
|
const pluginLanguages = plugin.languages.map((language) => language.toLowerCase());
|
|
13659
13509
|
if (declaredLanguage) {
|
|
@@ -13665,7 +13515,7 @@ class ExtractionPluginRegistry {
|
|
|
13665
13515
|
return pluginLanguages.some((language) => manifestLanguages.has(language));
|
|
13666
13516
|
});
|
|
13667
13517
|
for (const plugin of candidates) {
|
|
13668
|
-
if (plugin.canHandle(
|
|
13518
|
+
if (plugin.canHandle(source)) {
|
|
13669
13519
|
return plugin;
|
|
13670
13520
|
}
|
|
13671
13521
|
}
|
|
@@ -13721,7 +13571,189 @@ var generateSymbolDiff = (current, previous) => {
|
|
|
13721
13571
|
// src/documentEvidence.ts
|
|
13722
13572
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
13723
13573
|
import { createHash as createHash2 } from "node:crypto";
|
|
13724
|
-
|
|
13574
|
+
|
|
13575
|
+
// src/documentCaptureFidelity.ts
|
|
13576
|
+
var DOCUMENT_RESOURCE_SOURCE_MISSING_REASON_CODE = "document.resource.source-missing";
|
|
13577
|
+
var DOCUMENT_RESOURCE_PERMISSION_DENIED_REASON_CODE = "document.resource.permission-denied";
|
|
13578
|
+
function isNonBlockingDocumentResourceFailureReasonCode(code) {
|
|
13579
|
+
return code === DOCUMENT_RESOURCE_SOURCE_MISSING_REASON_CODE || code === DOCUMENT_RESOURCE_PERMISSION_DENIED_REASON_CODE;
|
|
13580
|
+
}
|
|
13581
|
+
function isRecord(value) {
|
|
13582
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13583
|
+
}
|
|
13584
|
+
function requiredString(value, field) {
|
|
13585
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
13586
|
+
throw new TypeError(`${field} must be a non-empty string`);
|
|
13587
|
+
}
|
|
13588
|
+
return value.trim();
|
|
13589
|
+
}
|
|
13590
|
+
function resourceAssetPath(value, field) {
|
|
13591
|
+
const path2 = requiredString(value, field);
|
|
13592
|
+
if (path2.startsWith("/") || path2.includes("\\") || path2.includes("\x00") || /^[a-zA-Z]:/u.test(path2)) {
|
|
13593
|
+
throw new TypeError(`${field} must be a POSIX relative path`);
|
|
13594
|
+
}
|
|
13595
|
+
const segments = path2.split("/");
|
|
13596
|
+
if (segments.some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
|
|
13597
|
+
throw new TypeError(`${field} must not contain empty, dot, or parent segments`);
|
|
13598
|
+
}
|
|
13599
|
+
return path2;
|
|
13600
|
+
}
|
|
13601
|
+
function counts(value, field) {
|
|
13602
|
+
if (!isRecord(value))
|
|
13603
|
+
throw new TypeError(`${field} must be an object`);
|
|
13604
|
+
const result = {};
|
|
13605
|
+
for (const [key, item] of Object.entries(value)) {
|
|
13606
|
+
if (key.trim().length === 0 || !Number.isInteger(item) || item < 0) {
|
|
13607
|
+
throw new TypeError(`${field}.${key} must be a non-negative integer`);
|
|
13608
|
+
}
|
|
13609
|
+
result[key] = item;
|
|
13610
|
+
}
|
|
13611
|
+
return result;
|
|
13612
|
+
}
|
|
13613
|
+
function skippedReasons(value, field) {
|
|
13614
|
+
if (!Array.isArray(value))
|
|
13615
|
+
throw new TypeError(`${field} must be an array`);
|
|
13616
|
+
return value.map((item, index) => {
|
|
13617
|
+
if (!isRecord(item))
|
|
13618
|
+
throw new TypeError(`${field}[${index}] must be an object`);
|
|
13619
|
+
if (!Number.isInteger(item.count) || item.count < 1) {
|
|
13620
|
+
throw new TypeError(`${field}[${index}] must include block_type, positive count, and reason`);
|
|
13621
|
+
}
|
|
13622
|
+
return {
|
|
13623
|
+
block_type: requiredString(item.block_type, `${field}[${index}].block_type`),
|
|
13624
|
+
count: item.count,
|
|
13625
|
+
reason: requiredString(item.reason, `${field}[${index}].reason`)
|
|
13626
|
+
};
|
|
13627
|
+
});
|
|
13628
|
+
}
|
|
13629
|
+
function fidelityIssues(value, field) {
|
|
13630
|
+
if (!Array.isArray(value))
|
|
13631
|
+
throw new TypeError(`${field} must be an array`);
|
|
13632
|
+
return value.map((item, index) => {
|
|
13633
|
+
if (!isRecord(item))
|
|
13634
|
+
throw new TypeError(`${field}[${index}] must be an object`);
|
|
13635
|
+
if (item.severity !== "warning" && item.severity !== "error" || !Number.isInteger(item.count) || item.count < 1) {
|
|
13636
|
+
throw new TypeError(`${field}[${index}] must include severity, code, block_type, positive count, and reason`);
|
|
13637
|
+
}
|
|
13638
|
+
return {
|
|
13639
|
+
severity: item.severity,
|
|
13640
|
+
impact: item.impact === "evidence" || item.impact === "projection" ? item.impact : item.severity === "error" ? "evidence" : "projection",
|
|
13641
|
+
code: requiredString(item.code, `${field}[${index}].code`),
|
|
13642
|
+
block_type: requiredString(item.block_type, `${field}[${index}].block_type`),
|
|
13643
|
+
count: item.count,
|
|
13644
|
+
reason: requiredString(item.reason, `${field}[${index}].reason`)
|
|
13645
|
+
};
|
|
13646
|
+
});
|
|
13647
|
+
}
|
|
13648
|
+
function parseDocumentCaptureFidelity(value, field) {
|
|
13649
|
+
if (value === undefined)
|
|
13650
|
+
return;
|
|
13651
|
+
if (!isRecord(value))
|
|
13652
|
+
throw new TypeError(`${field} must be an object`);
|
|
13653
|
+
if (value.status !== "complete" && value.status !== "warning" && value.status !== "error") {
|
|
13654
|
+
throw new TypeError(`${field}.status must be complete, warning, or error`);
|
|
13655
|
+
}
|
|
13656
|
+
const discovered = counts(value.discovered, `${field}.discovered`);
|
|
13657
|
+
const converted = counts(value.converted, `${field}.converted`);
|
|
13658
|
+
const skipped = skippedReasons(value.skipped, `${field}.skipped`);
|
|
13659
|
+
const issues = fidelityIssues(value.issues, `${field}.issues`);
|
|
13660
|
+
const countedBlockTypes = new Set([
|
|
13661
|
+
...Object.keys(discovered),
|
|
13662
|
+
...Object.keys(converted),
|
|
13663
|
+
...skipped.map((item) => item.block_type)
|
|
13664
|
+
]);
|
|
13665
|
+
for (const blockType of countedBlockTypes) {
|
|
13666
|
+
const discoveredCount = discovered[blockType] ?? 0;
|
|
13667
|
+
const skippedCount = skipped.filter((item) => item.block_type === blockType).reduce((sum, item) => sum + item.count, 0);
|
|
13668
|
+
if ((converted[blockType] ?? 0) + skippedCount !== discoveredCount) {
|
|
13669
|
+
throw new TypeError(`${field} does not close for ${blockType}: discovered ${discoveredCount}, converted ${converted[blockType] ?? 0}, skipped ${skippedCount}`);
|
|
13670
|
+
}
|
|
13671
|
+
}
|
|
13672
|
+
const evidenceStatus = issues.some((issue) => issue.impact === "evidence" && issue.severity === "error") ? "error" : "complete";
|
|
13673
|
+
const projectionIssues = issues.filter((issue) => issue.impact === "projection");
|
|
13674
|
+
const inferredProjectionStatus = projectionIssues.some((issue) => issue.severity === "error") ? "error" : projectionIssues.some((issue) => issue.code === "lark.capture.generic-projection") ? "generic" : projectionIssues.length > 0 ? "warning" : "complete";
|
|
13675
|
+
const projectionStatus = value.projection_status === "complete" || value.projection_status === "generic" || value.projection_status === "warning" || value.projection_status === "error" ? value.projection_status : inferredProjectionStatus;
|
|
13676
|
+
const status = evidenceStatus === "error" || projectionStatus === "error" ? "error" : issues.length > 0 ? "warning" : "complete";
|
|
13677
|
+
if (value.status !== status) {
|
|
13678
|
+
throw new TypeError(`${field}.status must be ${status} for its issues`);
|
|
13679
|
+
}
|
|
13680
|
+
if (value.evidence_status !== undefined && value.evidence_status !== evidenceStatus) {
|
|
13681
|
+
throw new TypeError(`${field}.evidence_status must be ${evidenceStatus} for its issues`);
|
|
13682
|
+
}
|
|
13683
|
+
if (value.projection_status !== undefined && value.projection_status !== inferredProjectionStatus) {
|
|
13684
|
+
throw new TypeError(`${field}.projection_status must be ${inferredProjectionStatus} for its issues`);
|
|
13685
|
+
}
|
|
13686
|
+
return {
|
|
13687
|
+
status,
|
|
13688
|
+
evidence_status: evidenceStatus,
|
|
13689
|
+
projection_status: projectionStatus,
|
|
13690
|
+
discovered,
|
|
13691
|
+
converted,
|
|
13692
|
+
skipped,
|
|
13693
|
+
issues
|
|
13694
|
+
};
|
|
13695
|
+
}
|
|
13696
|
+
function parseDocumentResourceMaterialization(value, field) {
|
|
13697
|
+
if (value === undefined)
|
|
13698
|
+
return;
|
|
13699
|
+
if (!isRecord(value))
|
|
13700
|
+
throw new TypeError(`${field} must be an object`);
|
|
13701
|
+
if (value.status !== "complete" && value.status !== "warning" && value.status !== "error") {
|
|
13702
|
+
throw new TypeError(`${field}.status must be complete, warning, or error`);
|
|
13703
|
+
}
|
|
13704
|
+
const discovered = counts(value.discovered, `${field}.discovered`);
|
|
13705
|
+
const materialized = counts(value.materialized, `${field}.materialized`);
|
|
13706
|
+
const referenceOnly = counts(value.reference_only, `${field}.reference_only`);
|
|
13707
|
+
const failed = counts(value.failed, `${field}.failed`);
|
|
13708
|
+
if (!Array.isArray(value.items))
|
|
13709
|
+
throw new TypeError(`${field}.items must be an array`);
|
|
13710
|
+
const items = value.items.map((item, index) => {
|
|
13711
|
+
if (!isRecord(item))
|
|
13712
|
+
throw new TypeError(`${field}.items[${index}] must be an object`);
|
|
13713
|
+
if (item.status !== "materialized" && item.status !== "reference-only" && item.status !== "failed") {
|
|
13714
|
+
throw new TypeError(`${field}.items[${index}].status is invalid`);
|
|
13715
|
+
}
|
|
13716
|
+
if (typeof item.required !== "boolean" || !Array.isArray(item.asset_paths) || item.asset_paths.some((path2) => typeof path2 !== "string" || path2.trim().length === 0)) {
|
|
13717
|
+
throw new TypeError(`${field}.items[${index}] must include required and asset_paths`);
|
|
13718
|
+
}
|
|
13719
|
+
const reasonCode = item.reason_code === undefined ? undefined : requiredString(item.reason_code, `${field}.items[${index}].reason_code`);
|
|
13720
|
+
const reason = item.reason === undefined ? undefined : requiredString(item.reason, `${field}.items[${index}].reason`);
|
|
13721
|
+
return {
|
|
13722
|
+
kind: requiredString(item.kind, `${field}.items[${index}].kind`),
|
|
13723
|
+
locator: requiredString(item.locator, `${field}.items[${index}].locator`),
|
|
13724
|
+
status: item.status,
|
|
13725
|
+
required: item.required,
|
|
13726
|
+
asset_paths: item.asset_paths.map((path2, pathIndex) => resourceAssetPath(path2, `${field}.items[${index}].asset_paths[${pathIndex}]`)),
|
|
13727
|
+
...reasonCode !== undefined ? { reason_code: reasonCode } : {},
|
|
13728
|
+
...reason !== undefined ? { reason } : {}
|
|
13729
|
+
};
|
|
13730
|
+
});
|
|
13731
|
+
const expectedStatus = items.some((item) => item.status === "failed" && item.required && !isNonBlockingDocumentResourceFailureReasonCode(item.reason_code)) ? "error" : items.some((item) => item.status === "failed") || items.some((item) => item.status === "reference-only" && item.kind === "poll" && item.reason?.includes("absent") === true) ? "warning" : "complete";
|
|
13732
|
+
if (value.status !== expectedStatus)
|
|
13733
|
+
throw new TypeError(`${field}.status must be ${expectedStatus} for its items`);
|
|
13734
|
+
const expected = (status) => {
|
|
13735
|
+
const map = new Map;
|
|
13736
|
+
for (const item of items) {
|
|
13737
|
+
if (status !== undefined && item.status !== status)
|
|
13738
|
+
continue;
|
|
13739
|
+
map.set(item.kind, (map.get(item.kind) ?? 0) + 1);
|
|
13740
|
+
}
|
|
13741
|
+
return Object.fromEntries([...map].sort(([left], [right]) => left.localeCompare(right)));
|
|
13742
|
+
};
|
|
13743
|
+
for (const [name, actual, wanted] of [
|
|
13744
|
+
["discovered", discovered, expected()],
|
|
13745
|
+
["materialized", materialized, expected("materialized")],
|
|
13746
|
+
["reference_only", referenceOnly, expected("reference-only")],
|
|
13747
|
+
["failed", failed, expected("failed")]
|
|
13748
|
+
]) {
|
|
13749
|
+
if (JSON.stringify(actual) !== JSON.stringify(wanted))
|
|
13750
|
+
throw new TypeError(`${field}.${name} does not match items`);
|
|
13751
|
+
}
|
|
13752
|
+
return { status: value.status, discovered, materialized, reference_only: referenceOnly, failed, items };
|
|
13753
|
+
}
|
|
13754
|
+
|
|
13755
|
+
// src/documentEvidence.ts
|
|
13756
|
+
var DOCUMENT_EVIDENCE_NORMALIZER_VERSION = "document-evidence-normalizer.v2";
|
|
13725
13757
|
var DOCUMENT_SNAPSHOT_MANIFEST_SCHEMA_VERSION = "document.snapshot.v2";
|
|
13726
13758
|
var DEFAULT_SOURCE_SPAN_HASH_LENGTH = 12;
|
|
13727
13759
|
var BOM = "\uFEFF";
|
|
@@ -13729,7 +13761,7 @@ var HASH_ID_RE = /^(?:sha256:)?[a-f0-9]{64}$/u;
|
|
|
13729
13761
|
var SOURCE_SPAN_HASH_RE = /^[a-f0-9]{8,64}$/u;
|
|
13730
13762
|
var DOCUMENT_SOURCE_SLUG_RE = /^[a-z0-9][a-z0-9._-]*$/u;
|
|
13731
13763
|
var DOCUMENT_SOURCE_BATCH_RE = /^\d{8}\/[a-z0-9][a-z0-9._-]*$/u;
|
|
13732
|
-
function
|
|
13764
|
+
function isRecord2(value) {
|
|
13733
13765
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
13734
13766
|
}
|
|
13735
13767
|
function bytesOf(value) {
|
|
@@ -13795,8 +13827,8 @@ function decodeSnapshotLocatorPath(path2) {
|
|
|
13795
13827
|
throw new TypeError(`invalid encoded snapshot locator path: ${path2}: ${message}`);
|
|
13796
13828
|
}
|
|
13797
13829
|
}
|
|
13798
|
-
function parseDocumentSourceLocator(
|
|
13799
|
-
const match = /^(file|lark):(.+)$/u.exec(
|
|
13830
|
+
function parseDocumentSourceLocator(source) {
|
|
13831
|
+
const match = /^(file|lark):(.+)$/u.exec(source);
|
|
13800
13832
|
if (match?.[1] === undefined || match[2] === undefined)
|
|
13801
13833
|
return null;
|
|
13802
13834
|
const segments = match[2].split("/");
|
|
@@ -14019,12 +14051,18 @@ function createDocumentSnapshotFileEntry(input) {
|
|
|
14019
14051
|
function createDocumentSnapshotManifest(input) {
|
|
14020
14052
|
const files = input.files.map(createDocumentSnapshotFileEntry);
|
|
14021
14053
|
const sourceName = normalizeDocumentSourceName(input.sourceName);
|
|
14054
|
+
const logicalFiles = [...input.files];
|
|
14055
|
+
for (const asset of input.assets ?? []) {
|
|
14056
|
+
if (asset.role !== "evidence" || asset.content_hash === undefined)
|
|
14057
|
+
continue;
|
|
14058
|
+
logicalFiles.push({ path: `@asset/${normalizeSnapshotRelativePath(asset.path)}`, bytes: asset.content_hash });
|
|
14059
|
+
}
|
|
14022
14060
|
return parseDocumentSnapshotManifest({
|
|
14023
14061
|
schema_version: DOCUMENT_SNAPSHOT_MANIFEST_SCHEMA_VERSION,
|
|
14024
14062
|
source_type: input.sourceType,
|
|
14025
14063
|
source_name: sourceName,
|
|
14026
14064
|
captured_at: input.capturedAt,
|
|
14027
|
-
snapshot_hash: computeLogicalRawHash(
|
|
14065
|
+
snapshot_hash: computeLogicalRawHash(logicalFiles),
|
|
14028
14066
|
normalizer_version: input.normalizerVersion ?? DOCUMENT_EVIDENCE_NORMALIZER_VERSION,
|
|
14029
14067
|
files,
|
|
14030
14068
|
...input.assets !== undefined ? { assets: input.assets } : {},
|
|
@@ -14032,7 +14070,7 @@ function createDocumentSnapshotManifest(input) {
|
|
|
14032
14070
|
});
|
|
14033
14071
|
}
|
|
14034
14072
|
function parseFileEntry(value, index) {
|
|
14035
|
-
if (!
|
|
14073
|
+
if (!isRecord2(value)) {
|
|
14036
14074
|
throw new TypeError(`snapshot manifest files[${index}] must be an object`);
|
|
14037
14075
|
}
|
|
14038
14076
|
if (typeof value.path !== "string") {
|
|
@@ -14060,7 +14098,7 @@ function parseFileEntry(value, index) {
|
|
|
14060
14098
|
};
|
|
14061
14099
|
}
|
|
14062
14100
|
function parseAssetEntry(value, index) {
|
|
14063
|
-
if (!
|
|
14101
|
+
if (!isRecord2(value)) {
|
|
14064
14102
|
throw new TypeError(`snapshot manifest assets[${index}] must be an object`);
|
|
14065
14103
|
}
|
|
14066
14104
|
if (typeof value.path !== "string") {
|
|
@@ -14068,18 +14106,20 @@ function parseAssetEntry(value, index) {
|
|
|
14068
14106
|
}
|
|
14069
14107
|
const contentHash2 = typeof value.content_hash === "string" && HASH_ID_RE.test(value.content_hash) ? normalizeHashId(value.content_hash) : undefined;
|
|
14070
14108
|
const mediaType = typeof value.media_type === "string" && value.media_type.trim().length > 0 ? value.media_type.trim() : undefined;
|
|
14071
|
-
const
|
|
14109
|
+
const role = value.role === "evidence" || value.role === "presentation" || value.role === "audit" ? value.role : undefined;
|
|
14110
|
+
const source = parseStringRecord(value.source, `snapshot manifest assets[${index}].source`);
|
|
14072
14111
|
return {
|
|
14073
14112
|
path: normalizeSnapshotRelativePath(value.path),
|
|
14074
14113
|
...contentHash2 !== undefined ? { content_hash: contentHash2 } : {},
|
|
14075
14114
|
...mediaType !== undefined ? { media_type: mediaType } : {},
|
|
14076
|
-
...
|
|
14115
|
+
...role !== undefined ? { role } : {},
|
|
14116
|
+
...source !== undefined ? { source } : {}
|
|
14077
14117
|
};
|
|
14078
14118
|
}
|
|
14079
14119
|
function parseStringRecord(value, field) {
|
|
14080
14120
|
if (value === undefined)
|
|
14081
14121
|
return;
|
|
14082
|
-
if (!
|
|
14122
|
+
if (!isRecord2(value)) {
|
|
14083
14123
|
throw new TypeError(`${field} must be an object`);
|
|
14084
14124
|
}
|
|
14085
14125
|
const result = {};
|
|
@@ -14126,7 +14166,7 @@ function optionalRouteFiles(value, field) {
|
|
|
14126
14166
|
throw new TypeError(`${field} must be an array`);
|
|
14127
14167
|
}
|
|
14128
14168
|
const result = value.map((item, index) => {
|
|
14129
|
-
if (!
|
|
14169
|
+
if (!isRecord2(item)) {
|
|
14130
14170
|
throw new TypeError(`${field}[${index}] must be an object`);
|
|
14131
14171
|
}
|
|
14132
14172
|
const path2 = optionalMetadataString(item.path, `${field}[${index}].path`);
|
|
@@ -14148,7 +14188,7 @@ function optionalRouteHints(value, field) {
|
|
|
14148
14188
|
throw new TypeError(`${field} must be an array`);
|
|
14149
14189
|
}
|
|
14150
14190
|
const result = value.map((item, index) => {
|
|
14151
|
-
if (!
|
|
14191
|
+
if (!isRecord2(item)) {
|
|
14152
14192
|
throw new TypeError(`${field}[${index}] must be an object`);
|
|
14153
14193
|
}
|
|
14154
14194
|
const documentPath = optionalMetadataString(item.documentPath, `${field}[${index}].documentPath`);
|
|
@@ -14165,15 +14205,47 @@ function optionalRouteHints(value, field) {
|
|
|
14165
14205
|
});
|
|
14166
14206
|
return result.length > 0 ? result : undefined;
|
|
14167
14207
|
}
|
|
14208
|
+
function captureReportMetadata(value) {
|
|
14209
|
+
if (value === undefined)
|
|
14210
|
+
return;
|
|
14211
|
+
if (!isRecord2(value))
|
|
14212
|
+
throw new TypeError("snapshot manifest metadata.capture.report must be an object");
|
|
14213
|
+
const path2 = optionalMetadataString(value.path, "snapshot manifest metadata.capture.report.path");
|
|
14214
|
+
if (path2 === undefined)
|
|
14215
|
+
throw new TypeError("snapshot manifest metadata.capture.report.path is required");
|
|
14216
|
+
const fidelityStatus = value.fidelityStatus;
|
|
14217
|
+
const evidenceStatus = value.evidenceStatus;
|
|
14218
|
+
const projectionStatus = value.projectionStatus;
|
|
14219
|
+
const resourceStatus = value.resourceStatus;
|
|
14220
|
+
if (fidelityStatus !== "complete" && fidelityStatus !== "warning" && fidelityStatus !== "error") {
|
|
14221
|
+
throw new TypeError("snapshot manifest metadata.capture.report.fidelityStatus is invalid");
|
|
14222
|
+
}
|
|
14223
|
+
if (evidenceStatus !== "complete" && evidenceStatus !== "error") {
|
|
14224
|
+
throw new TypeError("snapshot manifest metadata.capture.report.evidenceStatus is invalid");
|
|
14225
|
+
}
|
|
14226
|
+
if (projectionStatus !== "complete" && projectionStatus !== "generic" && projectionStatus !== "warning" && projectionStatus !== "error") {
|
|
14227
|
+
throw new TypeError("snapshot manifest metadata.capture.report.projectionStatus is invalid");
|
|
14228
|
+
}
|
|
14229
|
+
if (resourceStatus !== "complete" && resourceStatus !== "warning" && resourceStatus !== "error") {
|
|
14230
|
+
throw new TypeError("snapshot manifest metadata.capture.report.resourceStatus is invalid");
|
|
14231
|
+
}
|
|
14232
|
+
return {
|
|
14233
|
+
path: normalizeSnapshotRelativePath(path2),
|
|
14234
|
+
fidelityStatus,
|
|
14235
|
+
evidenceStatus,
|
|
14236
|
+
projectionStatus,
|
|
14237
|
+
resourceStatus
|
|
14238
|
+
};
|
|
14239
|
+
}
|
|
14168
14240
|
function parseManifestMetadata(value) {
|
|
14169
14241
|
if (value === undefined)
|
|
14170
14242
|
return;
|
|
14171
|
-
if (!
|
|
14243
|
+
if (!isRecord2(value)) {
|
|
14172
14244
|
throw new TypeError("snapshot manifest metadata must be an object");
|
|
14173
14245
|
}
|
|
14174
|
-
let
|
|
14246
|
+
let source;
|
|
14175
14247
|
if (value.source !== undefined) {
|
|
14176
|
-
if (!
|
|
14248
|
+
if (!isRecord2(value.source)) {
|
|
14177
14249
|
throw new TypeError("snapshot manifest metadata.source must be an object");
|
|
14178
14250
|
}
|
|
14179
14251
|
const url = optionalMetadataString(value.source.url, "snapshot manifest metadata.source.url");
|
|
@@ -14181,41 +14253,47 @@ function parseManifestMetadata(value) {
|
|
|
14181
14253
|
const wikiToken = optionalMetadataString(value.source.wikiToken, "snapshot manifest metadata.source.wikiToken");
|
|
14182
14254
|
const title = optionalMetadataString(value.source.title, "snapshot manifest metadata.source.title");
|
|
14183
14255
|
const revisionId = optionalMetadataString(value.source.revisionId, "snapshot manifest metadata.source.revisionId");
|
|
14184
|
-
|
|
14256
|
+
source = {
|
|
14185
14257
|
...url !== undefined ? { url } : {},
|
|
14186
14258
|
...docToken !== undefined ? { docToken } : {},
|
|
14187
14259
|
...wikiToken !== undefined ? { wikiToken } : {},
|
|
14188
14260
|
...title !== undefined ? { title } : {},
|
|
14189
14261
|
...revisionId !== undefined ? { revisionId } : {}
|
|
14190
14262
|
};
|
|
14191
|
-
if (Object.keys(
|
|
14192
|
-
|
|
14263
|
+
if (Object.keys(source).length === 0)
|
|
14264
|
+
source = undefined;
|
|
14193
14265
|
}
|
|
14194
14266
|
let capture;
|
|
14195
14267
|
if (value.capture !== undefined) {
|
|
14196
|
-
if (!
|
|
14268
|
+
if (!isRecord2(value.capture)) {
|
|
14197
14269
|
throw new TypeError("snapshot manifest metadata.capture must be an object");
|
|
14198
14270
|
}
|
|
14199
14271
|
const include = optionalMetadataStringArray(value.capture.include, "snapshot manifest metadata.capture.include");
|
|
14200
14272
|
const documentExtensions = optionalMetadataStringArray(value.capture.documentExtensions, "snapshot manifest metadata.capture.documentExtensions");
|
|
14201
14273
|
const routeFiles = optionalRouteFiles(value.capture.routeFiles, "snapshot manifest metadata.capture.routeFiles");
|
|
14202
14274
|
const routeHints = optionalRouteHints(value.capture.routeHints, "snapshot manifest metadata.capture.routeHints");
|
|
14275
|
+
const report = captureReportMetadata(value.capture.report);
|
|
14276
|
+
const fidelity = parseDocumentCaptureFidelity(value.capture.fidelity, "snapshot manifest metadata.capture.fidelity");
|
|
14277
|
+
const resourceMaterialization = parseDocumentResourceMaterialization(value.capture.resourceMaterialization, "snapshot manifest metadata.capture.resourceMaterialization");
|
|
14203
14278
|
capture = {
|
|
14204
14279
|
...include !== undefined ? { include } : {},
|
|
14205
14280
|
...documentExtensions !== undefined ? { documentExtensions } : {},
|
|
14206
14281
|
...routeFiles !== undefined ? { routeFiles } : {},
|
|
14207
|
-
...routeHints !== undefined ? { routeHints } : {}
|
|
14282
|
+
...routeHints !== undefined ? { routeHints } : {},
|
|
14283
|
+
...report !== undefined ? { report } : {},
|
|
14284
|
+
...fidelity !== undefined ? { fidelity } : {},
|
|
14285
|
+
...resourceMaterialization !== undefined ? { resourceMaterialization } : {}
|
|
14208
14286
|
};
|
|
14209
14287
|
if (Object.keys(capture).length === 0)
|
|
14210
14288
|
capture = undefined;
|
|
14211
14289
|
}
|
|
14212
|
-
return
|
|
14213
|
-
...
|
|
14290
|
+
return source !== undefined || capture !== undefined ? {
|
|
14291
|
+
...source !== undefined ? { source } : {},
|
|
14214
14292
|
...capture !== undefined ? { capture } : {}
|
|
14215
14293
|
} : {};
|
|
14216
14294
|
}
|
|
14217
14295
|
function parseDocumentSnapshotManifest(value) {
|
|
14218
|
-
if (!
|
|
14296
|
+
if (!isRecord2(value)) {
|
|
14219
14297
|
throw new TypeError("snapshot manifest must be an object");
|
|
14220
14298
|
}
|
|
14221
14299
|
if (value.schema_version !== DOCUMENT_SNAPSHOT_MANIFEST_SCHEMA_VERSION) {
|
|
@@ -14833,8 +14911,8 @@ var normalizeExtractionPaths = (extraction, entryDetection, modulePath, commitHa
|
|
|
14833
14911
|
entryDetection: prefixEntryDetectionPaths(entryDetection, modulePath),
|
|
14834
14912
|
extraction: prefixExtractionPaths(extraction, modulePath, commitHash)
|
|
14835
14913
|
});
|
|
14836
|
-
var extractLeadingJsDoc = (
|
|
14837
|
-
const match =
|
|
14914
|
+
var extractLeadingJsDoc = (source) => {
|
|
14915
|
+
const match = source.match(/^\s*\/\*\*([\s\S]*?)\*\//u);
|
|
14838
14916
|
if (!match?.[1])
|
|
14839
14917
|
return;
|
|
14840
14918
|
const doc = match[1].replace(/^\s*\* ?/gmu, "").replace(/\r\n?/gu, `
|
|
@@ -14985,10 +15063,10 @@ var normalizeDoc = (value) => {
|
|
|
14985
15063
|
`).replace(/[ \t]+$/gmu, "").trim();
|
|
14986
15064
|
return normalized.length > 0 ? normalized : undefined;
|
|
14987
15065
|
};
|
|
14988
|
-
var resolveVersion = (label,
|
|
15066
|
+
var resolveVersion = (label, source) => {
|
|
14989
15067
|
const canonical = typeof label === "string" ? canonicalizeCodeVersionLabel(label) : null;
|
|
14990
15068
|
if (canonical) {
|
|
14991
|
-
return { version_label: canonical, version_source:
|
|
15069
|
+
return { version_label: canonical, version_source: source ?? "package-json" };
|
|
14992
15070
|
}
|
|
14993
15071
|
return { version_label: FALLBACK_VERSION_LABEL, version_source: "fallback-0.0.1" };
|
|
14994
15072
|
};
|
|
@@ -15002,7 +15080,7 @@ var commonCommit = (rows) => {
|
|
|
15002
15080
|
const commits = new Set(rows.digests.map((row) => row.dir_commit).filter((commit) => commit && commit !== "unknown"));
|
|
15003
15081
|
return commits.size === 1 ? Array.from(commits)[0] : null;
|
|
15004
15082
|
};
|
|
15005
|
-
var metaText = (manifest,
|
|
15083
|
+
var metaText = (manifest, source, rows) => {
|
|
15006
15084
|
const digestByModule = new Map(rows.digests.map((row) => [row.module_path, row]));
|
|
15007
15085
|
const meta = {
|
|
15008
15086
|
schema_version: CODE_SNAPSHOT_META_SCHEMA_VERSION,
|
|
@@ -15028,7 +15106,7 @@ var metaText = (manifest, source2, rows) => {
|
|
|
15028
15106
|
code_snapshot_contract_version: manifest.code_snapshot_contract_version,
|
|
15029
15107
|
snapshot_content_hash: manifest.snapshot_content_hash,
|
|
15030
15108
|
toolchain: manifest.toolchain,
|
|
15031
|
-
version_policy:
|
|
15109
|
+
version_policy: source.version_policy,
|
|
15032
15110
|
...manifest.version_label ? { version_label: manifest.version_label } : {},
|
|
15033
15111
|
...manifest.version_source ? { version_source: manifest.version_source } : {},
|
|
15034
15112
|
head_commit: manifest.head_commit,
|
|
@@ -15191,7 +15269,7 @@ var buildCodeSnapshot = (input) => {
|
|
|
15191
15269
|
};
|
|
15192
15270
|
const snapshotContentHash = hashStable(sourceHashInput);
|
|
15193
15271
|
const dirty = rows.digests.some((row) => row.dirty);
|
|
15194
|
-
const
|
|
15272
|
+
const source = {
|
|
15195
15273
|
source_id: input.sourceId,
|
|
15196
15274
|
source_slug: input.sourceSlug,
|
|
15197
15275
|
source_type: "aspect-code",
|
|
@@ -15207,13 +15285,13 @@ var buildCodeSnapshot = (input) => {
|
|
|
15207
15285
|
const commonVersionLabel = commonVersionField(rows.digests, "version_label");
|
|
15208
15286
|
const commonVersionSource = commonVersionField(rows.digests, "version_source");
|
|
15209
15287
|
if (commonVersionLabel && commonVersionLabel !== "mixed") {
|
|
15210
|
-
|
|
15288
|
+
source.version_label = commonVersionLabel;
|
|
15211
15289
|
}
|
|
15212
15290
|
if (commonVersionSource) {
|
|
15213
|
-
|
|
15291
|
+
source.version_source = commonVersionSource;
|
|
15214
15292
|
}
|
|
15215
15293
|
const files = {
|
|
15216
|
-
"source.yaml": manifestText(
|
|
15294
|
+
"source.yaml": manifestText(source),
|
|
15217
15295
|
"digests.jsonl": jsonl(rows.digests),
|
|
15218
15296
|
"source-files.jsonl": jsonl(rows.sourceFiles),
|
|
15219
15297
|
"packages.jsonl": jsonl(rows.packages),
|
|
@@ -15231,9 +15309,9 @@ var buildCodeSnapshot = (input) => {
|
|
|
15231
15309
|
dirty,
|
|
15232
15310
|
script_hash: input.scriptHash,
|
|
15233
15311
|
toolchain: input.toolchain,
|
|
15234
|
-
version_policy:
|
|
15235
|
-
...
|
|
15236
|
-
...
|
|
15312
|
+
version_policy: source.version_policy,
|
|
15313
|
+
...source.version_label ? { version_label: source.version_label } : {},
|
|
15314
|
+
...source.version_source ? { version_source: source.version_source } : {},
|
|
15237
15315
|
snapshot_content_hash: snapshotContentHash,
|
|
15238
15316
|
...input.worktreeContentHash ? { worktree_content_hash: input.worktreeContentHash } : {},
|
|
15239
15317
|
module_count: rows.packages.length,
|
|
@@ -15244,7 +15322,7 @@ var buildCodeSnapshot = (input) => {
|
|
|
15244
15322
|
let converged = false;
|
|
15245
15323
|
for (let i = 0;i < 50; i++) {
|
|
15246
15324
|
files["manifest.json"] = manifestText(manifest);
|
|
15247
|
-
files["_meta.yaml"] = metaText(manifest,
|
|
15325
|
+
files["_meta.yaml"] = metaText(manifest, source, rows);
|
|
15248
15326
|
const totalBytes = Object.values(files).reduce((sum, content) => sum + byteLength(content), 0);
|
|
15249
15327
|
if (totalBytes === manifest.total_bytes) {
|
|
15250
15328
|
converged = true;
|
|
@@ -15256,8 +15334,8 @@ var buildCodeSnapshot = (input) => {
|
|
|
15256
15334
|
throw new Error("code snapshot manifest total_bytes did not converge");
|
|
15257
15335
|
}
|
|
15258
15336
|
files["manifest.json"] = manifestText(manifest);
|
|
15259
|
-
files["_meta.yaml"] = metaText(manifest,
|
|
15260
|
-
return { source
|
|
15337
|
+
files["_meta.yaml"] = metaText(manifest, source, rows);
|
|
15338
|
+
return { source, manifest, rows, files };
|
|
15261
15339
|
};
|
|
15262
15340
|
// src/runner.ts
|
|
15263
15341
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
@@ -15436,29 +15514,29 @@ var resetParser = () => {
|
|
|
15436
15514
|
parsedBytesSinceReset = 0;
|
|
15437
15515
|
parserDead = false;
|
|
15438
15516
|
};
|
|
15439
|
-
var tryParse = async (
|
|
15517
|
+
var tryParse = async (source, isTsx) => {
|
|
15440
15518
|
const { parser, tsLanguage, tsxLanguage } = await initParser();
|
|
15441
15519
|
parser.setLanguage(isTsx ? tsxLanguage : tsLanguage);
|
|
15442
|
-
const tree = parser.parse(
|
|
15443
|
-
parsedBytesSinceReset +=
|
|
15520
|
+
const tree = parser.parse(source);
|
|
15521
|
+
parsedBytesSinceReset += source.length;
|
|
15444
15522
|
if (tree.rootNode.hasError()) {
|
|
15445
15523
|
return null;
|
|
15446
15524
|
}
|
|
15447
15525
|
return tree;
|
|
15448
15526
|
};
|
|
15449
|
-
var parseFile = async (
|
|
15527
|
+
var parseFile = async (source, isTsx) => {
|
|
15450
15528
|
if (parserDead)
|
|
15451
15529
|
return null;
|
|
15452
15530
|
if (parsedBytesSinceReset > PARSER_RESET_THRESHOLD) {
|
|
15453
15531
|
resetParser();
|
|
15454
15532
|
}
|
|
15455
15533
|
try {
|
|
15456
|
-
return await tryParse(
|
|
15534
|
+
return await tryParse(source, isTsx);
|
|
15457
15535
|
} catch {
|
|
15458
15536
|
resetParser();
|
|
15459
15537
|
}
|
|
15460
15538
|
try {
|
|
15461
|
-
return await tryParse(
|
|
15539
|
+
return await tryParse(source, isTsx);
|
|
15462
15540
|
} catch (error) {
|
|
15463
15541
|
console.warn("[extract] Parser unrecoverable after retry, skipping remaining files:", error);
|
|
15464
15542
|
parserDead = true;
|
|
@@ -15542,6 +15620,8 @@ export {
|
|
|
15542
15620
|
parseFile,
|
|
15543
15621
|
parseDocumentSourceLocator,
|
|
15544
15622
|
parseDocumentSnapshotManifest,
|
|
15623
|
+
parseDocumentResourceMaterialization,
|
|
15624
|
+
parseDocumentCaptureFidelity,
|
|
15545
15625
|
normalizeSnapshotRelativePath,
|
|
15546
15626
|
normalizeRelativePath,
|
|
15547
15627
|
normalizeMarkdownDocument,
|
|
@@ -15555,6 +15635,7 @@ export {
|
|
|
15555
15635
|
loadRunnerPlugins,
|
|
15556
15636
|
jsonl,
|
|
15557
15637
|
isScanExcludedDir,
|
|
15638
|
+
isNonBlockingDocumentResourceFailureReasonCode,
|
|
15558
15639
|
initParser,
|
|
15559
15640
|
hashStable,
|
|
15560
15641
|
getGitCommitHash,
|
|
@@ -15599,6 +15680,8 @@ export {
|
|
|
15599
15680
|
ExtractionPluginRegistry,
|
|
15600
15681
|
ExtractionInputError,
|
|
15601
15682
|
DOCUMENT_SNAPSHOT_MANIFEST_SCHEMA_VERSION,
|
|
15683
|
+
DOCUMENT_RESOURCE_SOURCE_MISSING_REASON_CODE,
|
|
15684
|
+
DOCUMENT_RESOURCE_PERMISSION_DENIED_REASON_CODE,
|
|
15602
15685
|
DOCUMENT_EVIDENCE_NORMALIZER_VERSION,
|
|
15603
15686
|
DEFAULT_SOURCE_SPAN_HASH_LENGTH,
|
|
15604
15687
|
CODE_SNAPSHOT_META_SCHEMA_VERSION
|