@quikit/quikpilot-runner 9.3.0-rc.76 → 9.3.0-rc.77
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 +323 -319
- package/dist/index.js +494 -277
- package/dist/index.js.map +3 -3
- package/package.json +30 -30
package/dist/index.js
CHANGED
|
@@ -5106,24 +5106,24 @@ var require_base = __commonJS2({
|
|
|
5106
5106
|
}
|
|
5107
5107
|
exports2.augmentError = augmentError;
|
|
5108
5108
|
var Loc = class {
|
|
5109
|
-
constructor(
|
|
5110
|
-
this.line =
|
|
5109
|
+
constructor(line2, column) {
|
|
5110
|
+
this.line = line2;
|
|
5111
5111
|
this.column = column;
|
|
5112
5112
|
}
|
|
5113
5113
|
};
|
|
5114
5114
|
exports2.Loc = Loc;
|
|
5115
5115
|
function locationForIndex(pos) {
|
|
5116
|
-
let
|
|
5116
|
+
let line2 = 1;
|
|
5117
5117
|
let column = 1;
|
|
5118
5118
|
for (let i3 = 0; i3 < pos; i3++) {
|
|
5119
5119
|
if (exports2.input.charCodeAt(i3) === _charcodes.charCodes.lineFeed) {
|
|
5120
|
-
|
|
5120
|
+
line2++;
|
|
5121
5121
|
column = 1;
|
|
5122
5122
|
} else {
|
|
5123
5123
|
column++;
|
|
5124
5124
|
}
|
|
5125
5125
|
}
|
|
5126
|
-
return new Loc(
|
|
5126
|
+
return new Loc(line2, column);
|
|
5127
5127
|
}
|
|
5128
5128
|
exports2.locationForIndex = locationForIndex;
|
|
5129
5129
|
function initParser(inputCode, isJSXEnabledArg, isTypeScriptEnabledArg, isFlowEnabledArg) {
|
|
@@ -16961,20 +16961,20 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
16961
16961
|
const reader = new StringReader(input);
|
|
16962
16962
|
const scopes = [];
|
|
16963
16963
|
const stack = [];
|
|
16964
|
-
let
|
|
16964
|
+
let line2 = 0;
|
|
16965
16965
|
for (; reader.pos < length; reader.pos++) {
|
|
16966
|
-
|
|
16966
|
+
line2 = decodeInteger(reader, line2);
|
|
16967
16967
|
const column = decodeInteger(reader, 0);
|
|
16968
16968
|
if (!hasMoreVlq(reader, length)) {
|
|
16969
16969
|
const last = stack.pop();
|
|
16970
|
-
last[2] =
|
|
16970
|
+
last[2] = line2;
|
|
16971
16971
|
last[3] = column;
|
|
16972
16972
|
continue;
|
|
16973
16973
|
}
|
|
16974
16974
|
const kind = decodeInteger(reader, 0);
|
|
16975
16975
|
const fields = decodeInteger(reader, 0);
|
|
16976
16976
|
const hasName = fields & 1;
|
|
16977
|
-
const scope = hasName ? [
|
|
16977
|
+
const scope = hasName ? [line2, column, 0, 0, kind, decodeInteger(reader, 0)] : [line2, column, 0, 0, kind];
|
|
16978
16978
|
let vars = EMPTY2;
|
|
16979
16979
|
if (hasMoreVlq(reader, length)) {
|
|
16980
16980
|
vars = [];
|
|
@@ -17191,10 +17191,10 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17191
17191
|
state[1] = encodeInteger(writer, endColumn, state[1]);
|
|
17192
17192
|
return index;
|
|
17193
17193
|
}
|
|
17194
|
-
function catchupLine(writer, lastLine,
|
|
17194
|
+
function catchupLine(writer, lastLine, line2) {
|
|
17195
17195
|
do {
|
|
17196
17196
|
writer.write(semicolon);
|
|
17197
|
-
} while (++lastLine <
|
|
17197
|
+
} while (++lastLine < line2);
|
|
17198
17198
|
}
|
|
17199
17199
|
function decode(mappings) {
|
|
17200
17200
|
const { length } = mappings;
|
|
@@ -17207,7 +17207,7 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17207
17207
|
let namesIndex = 0;
|
|
17208
17208
|
do {
|
|
17209
17209
|
const semi = reader.indexOf(";");
|
|
17210
|
-
const
|
|
17210
|
+
const line2 = [];
|
|
17211
17211
|
let sorted = true;
|
|
17212
17212
|
let lastCol = 0;
|
|
17213
17213
|
genColumn = 0;
|
|
@@ -17229,17 +17229,17 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17229
17229
|
} else {
|
|
17230
17230
|
seg = [genColumn];
|
|
17231
17231
|
}
|
|
17232
|
-
|
|
17232
|
+
line2.push(seg);
|
|
17233
17233
|
reader.pos++;
|
|
17234
17234
|
}
|
|
17235
|
-
if (!sorted) sort(
|
|
17236
|
-
decoded.push(
|
|
17235
|
+
if (!sorted) sort(line2);
|
|
17236
|
+
decoded.push(line2);
|
|
17237
17237
|
reader.pos = semi + 1;
|
|
17238
17238
|
} while (reader.pos <= length);
|
|
17239
17239
|
return decoded;
|
|
17240
17240
|
}
|
|
17241
|
-
function sort(
|
|
17242
|
-
|
|
17241
|
+
function sort(line2) {
|
|
17242
|
+
line2.sort(sortComparator);
|
|
17243
17243
|
}
|
|
17244
17244
|
function sortComparator(a, b) {
|
|
17245
17245
|
return a[0] - b[0];
|
|
@@ -17251,12 +17251,12 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17251
17251
|
let sourceColumn = 0;
|
|
17252
17252
|
let namesIndex = 0;
|
|
17253
17253
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
17254
|
-
const
|
|
17254
|
+
const line2 = decoded[i3];
|
|
17255
17255
|
if (i3 > 0) writer.write(semicolon);
|
|
17256
|
-
if (
|
|
17256
|
+
if (line2.length === 0) continue;
|
|
17257
17257
|
let genColumn = 0;
|
|
17258
|
-
for (let j = 0; j <
|
|
17259
|
-
const segment =
|
|
17258
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17259
|
+
const segment = line2[j];
|
|
17260
17260
|
if (j > 0) writer.write(comma);
|
|
17261
17261
|
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
17262
17262
|
if (segment.length === 1) continue;
|
|
@@ -17570,17 +17570,17 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17570
17570
|
}
|
|
17571
17571
|
return mappings.length;
|
|
17572
17572
|
}
|
|
17573
|
-
function isSorted(
|
|
17574
|
-
for (let j = 1; j <
|
|
17575
|
-
if (
|
|
17573
|
+
function isSorted(line2) {
|
|
17574
|
+
for (let j = 1; j < line2.length; j++) {
|
|
17575
|
+
if (line2[j][COLUMN] < line2[j - 1][COLUMN]) {
|
|
17576
17576
|
return false;
|
|
17577
17577
|
}
|
|
17578
17578
|
}
|
|
17579
17579
|
return true;
|
|
17580
17580
|
}
|
|
17581
|
-
function sortSegments(
|
|
17582
|
-
if (!owned)
|
|
17583
|
-
return
|
|
17581
|
+
function sortSegments(line2, owned) {
|
|
17582
|
+
if (!owned) line2 = line2.slice();
|
|
17583
|
+
return line2.sort(sortComparator);
|
|
17584
17584
|
}
|
|
17585
17585
|
function sortComparator(a, b) {
|
|
17586
17586
|
return a[COLUMN] - b[COLUMN];
|
|
@@ -17588,9 +17588,9 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17588
17588
|
function buildBySources(decoded, memos) {
|
|
17589
17589
|
const sources = memos.map(() => []);
|
|
17590
17590
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
17591
|
-
const
|
|
17592
|
-
for (let j = 0; j <
|
|
17593
|
-
const seg =
|
|
17591
|
+
const line2 = decoded[i3];
|
|
17592
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17593
|
+
const seg = line2[j];
|
|
17594
17594
|
if (seg.length === 1) continue;
|
|
17595
17595
|
const sourceIndex2 = seg[SOURCES_INDEX];
|
|
17596
17596
|
const sourceLine = seg[SOURCE_LINE];
|
|
@@ -17603,8 +17603,8 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17603
17603
|
for (let i3 = 0; i3 < sources.length; i3++) {
|
|
17604
17604
|
const source = sources[i3];
|
|
17605
17605
|
for (let j = 0; j < source.length; j++) {
|
|
17606
|
-
const
|
|
17607
|
-
if (
|
|
17606
|
+
const line2 = source[j];
|
|
17607
|
+
if (line2) line2.sort(sortComparator);
|
|
17608
17608
|
}
|
|
17609
17609
|
}
|
|
17610
17610
|
return sources;
|
|
@@ -17665,11 +17665,11 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17665
17665
|
state.lastNeedle = needle;
|
|
17666
17666
|
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
17667
17667
|
}
|
|
17668
|
-
function
|
|
17668
|
+
function parse7(map) {
|
|
17669
17669
|
return typeof map === "string" ? JSON.parse(map) : map;
|
|
17670
17670
|
}
|
|
17671
17671
|
var FlattenMap = function(map, mapUrl) {
|
|
17672
|
-
const parsed =
|
|
17672
|
+
const parsed = parse7(map);
|
|
17673
17673
|
if (!("sections" in parsed)) {
|
|
17674
17674
|
return new TraceMap(parsed, mapUrl);
|
|
17675
17675
|
}
|
|
@@ -17733,7 +17733,7 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17733
17733
|
}
|
|
17734
17734
|
}
|
|
17735
17735
|
function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
|
|
17736
|
-
const parsed =
|
|
17736
|
+
const parsed = parse7(input);
|
|
17737
17737
|
if ("sections" in parsed) return recurse(...arguments);
|
|
17738
17738
|
const map = new TraceMap(parsed, mapUrl);
|
|
17739
17739
|
const sourcesOffset = sources.length;
|
|
@@ -17750,9 +17750,9 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17750
17750
|
if (lineI > stopLine) return;
|
|
17751
17751
|
const out2 = getLine(mappings, lineI);
|
|
17752
17752
|
const cOffset = i3 === 0 ? columnOffset : 0;
|
|
17753
|
-
const
|
|
17754
|
-
for (let j = 0; j <
|
|
17755
|
-
const seg =
|
|
17753
|
+
const line2 = decoded[i3];
|
|
17754
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17755
|
+
const seg = line2[j];
|
|
17756
17756
|
const column = cOffset + seg[COLUMN];
|
|
17757
17757
|
if (lineI === stopLine && column >= stopColumn) return;
|
|
17758
17758
|
if (seg.length === 1) {
|
|
@@ -17783,7 +17783,7 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17783
17783
|
constructor(map, mapUrl) {
|
|
17784
17784
|
const isString = typeof map === "string";
|
|
17785
17785
|
if (!isString && map._decodedMemo) return map;
|
|
17786
|
-
const parsed =
|
|
17786
|
+
const parsed = parse7(map);
|
|
17787
17787
|
const { version: version2, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
17788
17788
|
this.version = version2;
|
|
17789
17789
|
this.file = file;
|
|
@@ -17822,31 +17822,31 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17822
17822
|
var _a;
|
|
17823
17823
|
return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded));
|
|
17824
17824
|
}
|
|
17825
|
-
function traceSegment(map,
|
|
17825
|
+
function traceSegment(map, line2, column) {
|
|
17826
17826
|
const decoded = decodedMappings(map);
|
|
17827
|
-
if (
|
|
17828
|
-
const segments = decoded[
|
|
17827
|
+
if (line2 >= decoded.length) return null;
|
|
17828
|
+
const segments = decoded[line2];
|
|
17829
17829
|
const index = traceSegmentInternal(
|
|
17830
17830
|
segments,
|
|
17831
17831
|
cast(map)._decodedMemo,
|
|
17832
|
-
|
|
17832
|
+
line2,
|
|
17833
17833
|
column,
|
|
17834
17834
|
GREATEST_LOWER_BOUND
|
|
17835
17835
|
);
|
|
17836
17836
|
return index === -1 ? null : segments[index];
|
|
17837
17837
|
}
|
|
17838
17838
|
function originalPositionFor(map, needle) {
|
|
17839
|
-
let { line, column, bias } = needle;
|
|
17840
|
-
|
|
17841
|
-
if (
|
|
17839
|
+
let { line: line2, column, bias } = needle;
|
|
17840
|
+
line2--;
|
|
17841
|
+
if (line2 < 0) throw new Error(LINE_GTR_ZERO);
|
|
17842
17842
|
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
17843
17843
|
const decoded = decodedMappings(map);
|
|
17844
|
-
if (
|
|
17845
|
-
const segments = decoded[
|
|
17844
|
+
if (line2 >= decoded.length) return OMapping(null, null, null, null);
|
|
17845
|
+
const segments = decoded[line2];
|
|
17846
17846
|
const index = traceSegmentInternal(
|
|
17847
17847
|
segments,
|
|
17848
17848
|
cast(map)._decodedMemo,
|
|
17849
|
-
|
|
17849
|
+
line2,
|
|
17850
17850
|
column,
|
|
17851
17851
|
bias || GREATEST_LOWER_BOUND
|
|
17852
17852
|
);
|
|
@@ -17862,20 +17862,20 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17862
17862
|
);
|
|
17863
17863
|
}
|
|
17864
17864
|
function generatedPositionFor(map, needle) {
|
|
17865
|
-
const { source, line, column, bias } = needle;
|
|
17866
|
-
return generatedPosition(map, source,
|
|
17865
|
+
const { source, line: line2, column, bias } = needle;
|
|
17866
|
+
return generatedPosition(map, source, line2, column, bias || GREATEST_LOWER_BOUND, false);
|
|
17867
17867
|
}
|
|
17868
17868
|
function allGeneratedPositionsFor(map, needle) {
|
|
17869
|
-
const { source, line, column, bias } = needle;
|
|
17870
|
-
return generatedPosition(map, source,
|
|
17869
|
+
const { source, line: line2, column, bias } = needle;
|
|
17870
|
+
return generatedPosition(map, source, line2, column, bias || LEAST_UPPER_BOUND, true);
|
|
17871
17871
|
}
|
|
17872
17872
|
function eachMapping(map, cb) {
|
|
17873
17873
|
const decoded = decodedMappings(map);
|
|
17874
17874
|
const { names, resolvedSources } = map;
|
|
17875
17875
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
17876
|
-
const
|
|
17877
|
-
for (let j = 0; j <
|
|
17878
|
-
const seg =
|
|
17876
|
+
const line2 = decoded[i3];
|
|
17877
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17878
|
+
const seg = line2[j];
|
|
17879
17879
|
const generatedLine = i3 + 1;
|
|
17880
17880
|
const generatedColumn = seg[0];
|
|
17881
17881
|
let source = null;
|
|
@@ -17940,22 +17940,22 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17940
17940
|
ignoreList: map.ignoreList || map.x_google_ignoreList
|
|
17941
17941
|
};
|
|
17942
17942
|
}
|
|
17943
|
-
function OMapping(source,
|
|
17944
|
-
return { source, line, column, name: name2 };
|
|
17943
|
+
function OMapping(source, line2, column, name2) {
|
|
17944
|
+
return { source, line: line2, column, name: name2 };
|
|
17945
17945
|
}
|
|
17946
|
-
function GMapping(
|
|
17947
|
-
return { line, column };
|
|
17946
|
+
function GMapping(line2, column) {
|
|
17947
|
+
return { line: line2, column };
|
|
17948
17948
|
}
|
|
17949
|
-
function traceSegmentInternal(segments, memo,
|
|
17950
|
-
let index = memoizedBinarySearch(segments, column, memo,
|
|
17949
|
+
function traceSegmentInternal(segments, memo, line2, column, bias) {
|
|
17950
|
+
let index = memoizedBinarySearch(segments, column, memo, line2);
|
|
17951
17951
|
if (found) {
|
|
17952
17952
|
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
17953
17953
|
} else if (bias === LEAST_UPPER_BOUND) index++;
|
|
17954
17954
|
if (index === -1 || index === segments.length) return -1;
|
|
17955
17955
|
return index;
|
|
17956
17956
|
}
|
|
17957
|
-
function sliceGeneratedPositions(segments, memo,
|
|
17958
|
-
let min = traceSegmentInternal(segments, memo,
|
|
17957
|
+
function sliceGeneratedPositions(segments, memo, line2, column, bias) {
|
|
17958
|
+
let min = traceSegmentInternal(segments, memo, line2, column, GREATEST_LOWER_BOUND);
|
|
17959
17959
|
if (!found && bias === LEAST_UPPER_BOUND) min++;
|
|
17960
17960
|
if (min === -1 || min === segments.length) return [];
|
|
17961
17961
|
const matchedColumn = found ? column : segments[min][COLUMN];
|
|
@@ -17968,10 +17968,10 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17968
17968
|
}
|
|
17969
17969
|
return result;
|
|
17970
17970
|
}
|
|
17971
|
-
function generatedPosition(map, source,
|
|
17971
|
+
function generatedPosition(map, source, line2, column, bias, all) {
|
|
17972
17972
|
var _a, _b;
|
|
17973
|
-
|
|
17974
|
-
if (
|
|
17973
|
+
line2--;
|
|
17974
|
+
if (line2 < 0) throw new Error(LINE_GTR_ZERO);
|
|
17975
17975
|
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
17976
17976
|
const { sources, resolvedSources } = map;
|
|
17977
17977
|
let sourceIndex2 = sources.indexOf(source);
|
|
@@ -17979,11 +17979,11 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17979
17979
|
if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);
|
|
17980
17980
|
const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState));
|
|
17981
17981
|
const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos));
|
|
17982
|
-
const segments = generated[sourceIndex2][
|
|
17982
|
+
const segments = generated[sourceIndex2][line2];
|
|
17983
17983
|
if (segments == null) return all ? [] : GMapping(null, null);
|
|
17984
17984
|
const memo = bySourceMemos[sourceIndex2];
|
|
17985
|
-
if (all) return sliceGeneratedPositions(segments, memo,
|
|
17986
|
-
const index = traceSegmentInternal(segments, memo,
|
|
17985
|
+
if (all) return sliceGeneratedPositions(segments, memo, line2, column, bias);
|
|
17986
|
+
const index = traceSegmentInternal(segments, memo, line2, column, bias);
|
|
17987
17987
|
if (index === -1) return GMapping(null, null);
|
|
17988
17988
|
const segment = segments[index];
|
|
17989
17989
|
return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
|
|
@@ -18222,9 +18222,9 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18222
18222
|
const out2 = [];
|
|
18223
18223
|
const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);
|
|
18224
18224
|
for (let i3 = 0; i3 < mappings.length; i3++) {
|
|
18225
|
-
const
|
|
18226
|
-
for (let j = 0; j <
|
|
18227
|
-
const seg =
|
|
18225
|
+
const line2 = mappings[i3];
|
|
18226
|
+
for (let j = 0; j < line2.length; j++) {
|
|
18227
|
+
const seg = line2[j];
|
|
18228
18228
|
const generated = { line: i3 + 1, column: seg[COLUMN] };
|
|
18229
18229
|
let source = void 0;
|
|
18230
18230
|
let original = void 0;
|
|
@@ -18247,22 +18247,22 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18247
18247
|
_names: names
|
|
18248
18248
|
// _originalScopes: originalScopes,
|
|
18249
18249
|
} = cast2(map);
|
|
18250
|
-
const
|
|
18251
|
-
const index = getColumnIndex(
|
|
18250
|
+
const line2 = getIndex(mappings, genLine);
|
|
18251
|
+
const index = getColumnIndex(line2, genColumn);
|
|
18252
18252
|
if (!source) {
|
|
18253
|
-
if (skipable && skipSourceless(
|
|
18254
|
-
return insert(
|
|
18253
|
+
if (skipable && skipSourceless(line2, index)) return;
|
|
18254
|
+
return insert(line2, index, [genColumn]);
|
|
18255
18255
|
}
|
|
18256
18256
|
assert5(sourceLine);
|
|
18257
18257
|
assert5(sourceColumn);
|
|
18258
18258
|
const sourcesIndex = put(sources, source);
|
|
18259
18259
|
const namesIndex = name2 ? put(names, name2) : NO_NAME;
|
|
18260
18260
|
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
|
|
18261
|
-
if (skipable && skipSource(
|
|
18261
|
+
if (skipable && skipSource(line2, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
|
18262
18262
|
return;
|
|
18263
18263
|
}
|
|
18264
18264
|
return insert(
|
|
18265
|
-
|
|
18265
|
+
line2,
|
|
18266
18266
|
index,
|
|
18267
18267
|
name2 ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]
|
|
18268
18268
|
);
|
|
@@ -18275,10 +18275,10 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18275
18275
|
}
|
|
18276
18276
|
return arr[index];
|
|
18277
18277
|
}
|
|
18278
|
-
function getColumnIndex(
|
|
18279
|
-
let index =
|
|
18278
|
+
function getColumnIndex(line2, genColumn) {
|
|
18279
|
+
let index = line2.length;
|
|
18280
18280
|
for (let i3 = index - 1; i3 >= 0; index = i3--) {
|
|
18281
|
-
const current2 =
|
|
18281
|
+
const current2 = line2[i3];
|
|
18282
18282
|
if (genColumn >= current2[COLUMN]) break;
|
|
18283
18283
|
}
|
|
18284
18284
|
return index;
|
|
@@ -18300,14 +18300,14 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18300
18300
|
function putAll(setarr, array) {
|
|
18301
18301
|
for (let i3 = 0; i3 < array.length; i3++) put(setarr, array[i3]);
|
|
18302
18302
|
}
|
|
18303
|
-
function skipSourceless(
|
|
18303
|
+
function skipSourceless(line2, index) {
|
|
18304
18304
|
if (index === 0) return true;
|
|
18305
|
-
const prev =
|
|
18305
|
+
const prev = line2[index - 1];
|
|
18306
18306
|
return prev.length === 1;
|
|
18307
18307
|
}
|
|
18308
|
-
function skipSource(
|
|
18308
|
+
function skipSource(line2, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
|
18309
18309
|
if (index === 0) return false;
|
|
18310
|
-
const prev =
|
|
18310
|
+
const prev = line2[index - 1];
|
|
18311
18311
|
if (prev.length === 1) return false;
|
|
18312
18312
|
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
|
18313
18313
|
}
|
|
@@ -18359,26 +18359,26 @@ var require_computeSourceMap = __commonJS2({
|
|
|
18359
18359
|
tokenIndex++;
|
|
18360
18360
|
currentMapping = rawMappings[tokenIndex];
|
|
18361
18361
|
}
|
|
18362
|
-
let
|
|
18362
|
+
let line2 = 0;
|
|
18363
18363
|
let lineStart = 0;
|
|
18364
18364
|
if (currentMapping !== lineStart) {
|
|
18365
|
-
_genmapping.maybeAddSegment.call(void 0, map,
|
|
18365
|
+
_genmapping.maybeAddSegment.call(void 0, map, line2, 0, filePath, line2, 0);
|
|
18366
18366
|
}
|
|
18367
18367
|
for (let i3 = 0; i3 < generatedCode.length; i3++) {
|
|
18368
18368
|
if (i3 === currentMapping) {
|
|
18369
18369
|
const genColumn = currentMapping - lineStart;
|
|
18370
18370
|
const sourceColumn = sourceColumns[tokenIndex];
|
|
18371
|
-
_genmapping.maybeAddSegment.call(void 0, map,
|
|
18371
|
+
_genmapping.maybeAddSegment.call(void 0, map, line2, genColumn, filePath, line2, sourceColumn);
|
|
18372
18372
|
while ((currentMapping === i3 || currentMapping === void 0) && tokenIndex < rawMappings.length - 1) {
|
|
18373
18373
|
tokenIndex++;
|
|
18374
18374
|
currentMapping = rawMappings[tokenIndex];
|
|
18375
18375
|
}
|
|
18376
18376
|
}
|
|
18377
18377
|
if (generatedCode.charCodeAt(i3) === _charcodes.charCodes.lineFeed) {
|
|
18378
|
-
|
|
18378
|
+
line2++;
|
|
18379
18379
|
lineStart = i3 + 1;
|
|
18380
18380
|
if (currentMapping !== lineStart) {
|
|
18381
|
-
_genmapping.maybeAddSegment.call(void 0, map,
|
|
18381
|
+
_genmapping.maybeAddSegment.call(void 0, map, line2, 0, filePath, line2, 0);
|
|
18382
18382
|
}
|
|
18383
18383
|
}
|
|
18384
18384
|
}
|
|
@@ -24228,7 +24228,7 @@ var require_parser = __commonJS2({
|
|
|
24228
24228
|
}
|
|
24229
24229
|
};
|
|
24230
24230
|
exports2.File = File;
|
|
24231
|
-
function
|
|
24231
|
+
function parse7(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled) {
|
|
24232
24232
|
if (isFlowEnabled && isTypeScriptEnabled) {
|
|
24233
24233
|
throw new Error("Cannot combine flow and typescript plugins.");
|
|
24234
24234
|
}
|
|
@@ -24239,7 +24239,7 @@ var require_parser = __commonJS2({
|
|
|
24239
24239
|
}
|
|
24240
24240
|
return result;
|
|
24241
24241
|
}
|
|
24242
|
-
exports2.parse =
|
|
24242
|
+
exports2.parse = parse7;
|
|
24243
24243
|
}
|
|
24244
24244
|
});
|
|
24245
24245
|
|
|
@@ -27439,27 +27439,27 @@ var require_build = __commonJS2({
|
|
|
27439
27439
|
if (index < 0 || index > this.string.length) {
|
|
27440
27440
|
return null;
|
|
27441
27441
|
}
|
|
27442
|
-
var
|
|
27442
|
+
var line2 = 0;
|
|
27443
27443
|
var offsets = this.offsets;
|
|
27444
|
-
while (offsets[
|
|
27445
|
-
|
|
27444
|
+
while (offsets[line2 + 1] <= index) {
|
|
27445
|
+
line2++;
|
|
27446
27446
|
}
|
|
27447
|
-
var column = index - offsets[
|
|
27448
|
-
return { line, column };
|
|
27447
|
+
var column = index - offsets[line2];
|
|
27448
|
+
return { line: line2, column };
|
|
27449
27449
|
};
|
|
27450
27450
|
LinesAndColumns2.prototype.indexForLocation = function(location) {
|
|
27451
|
-
var
|
|
27452
|
-
if (
|
|
27451
|
+
var line2 = location.line, column = location.column;
|
|
27452
|
+
if (line2 < 0 || line2 >= this.offsets.length) {
|
|
27453
27453
|
return null;
|
|
27454
27454
|
}
|
|
27455
|
-
if (column < 0 || column > this.lengthOfLine(
|
|
27455
|
+
if (column < 0 || column > this.lengthOfLine(line2)) {
|
|
27456
27456
|
return null;
|
|
27457
27457
|
}
|
|
27458
|
-
return this.offsets[
|
|
27458
|
+
return this.offsets[line2] + column;
|
|
27459
27459
|
};
|
|
27460
|
-
LinesAndColumns2.prototype.lengthOfLine = function(
|
|
27461
|
-
var offset2 = this.offsets[
|
|
27462
|
-
var nextOffset =
|
|
27460
|
+
LinesAndColumns2.prototype.lengthOfLine = function(line2) {
|
|
27461
|
+
var offset2 = this.offsets[line2];
|
|
27462
|
+
var nextOffset = line2 === this.offsets.length - 1 ? this.string.length : this.offsets[line2 + 1];
|
|
27463
27463
|
return nextOffset - offset2;
|
|
27464
27464
|
};
|
|
27465
27465
|
return LinesAndColumns2;
|
|
@@ -28929,7 +28929,7 @@ function readTestHistory(input) {
|
|
|
28929
28929
|
}
|
|
28930
28930
|
}
|
|
28931
28931
|
if (!added || added.date === "" || added.date.length > MAX_HISTORY_DATE_CHARS) return { available: false };
|
|
28932
|
-
const changed = git3(["show", "--name-only", "--no-color", "--format=", added.sha]).split("\n").map((
|
|
28932
|
+
const changed = git3(["show", "--name-only", "--no-color", "--format=", added.sha]).split("\n").map((line2) => line2.trim()).filter((line2) => line2 !== "");
|
|
28933
28933
|
const others = changed.filter((file) => file !== input.path && file !== added.pathThen && file.length <= MAX_HISTORY_PATH_CHARS && !isTest(file));
|
|
28934
28934
|
return {
|
|
28935
28935
|
available: true,
|
|
@@ -28961,7 +28961,7 @@ function expectationTokens(code) {
|
|
|
28961
28961
|
function commentsOf(text3) {
|
|
28962
28962
|
const comments = [];
|
|
28963
28963
|
let code = "";
|
|
28964
|
-
let
|
|
28964
|
+
let line2 = 0;
|
|
28965
28965
|
let i3 = 0;
|
|
28966
28966
|
let quote = null;
|
|
28967
28967
|
while (i3 < text3.length) {
|
|
@@ -28970,12 +28970,12 @@ function commentsOf(text3) {
|
|
|
28970
28970
|
code += c;
|
|
28971
28971
|
if (c === "\\" && i3 + 1 < text3.length) {
|
|
28972
28972
|
code += text3[i3 + 1];
|
|
28973
|
-
if (text3[i3 + 1] === "\n")
|
|
28973
|
+
if (text3[i3 + 1] === "\n") line2 += 1;
|
|
28974
28974
|
i3 += 2;
|
|
28975
28975
|
continue;
|
|
28976
28976
|
}
|
|
28977
28977
|
if (c === quote) quote = null;
|
|
28978
|
-
if (c === "\n")
|
|
28978
|
+
if (c === "\n") line2 += 1;
|
|
28979
28979
|
i3 += 1;
|
|
28980
28980
|
continue;
|
|
28981
28981
|
}
|
|
@@ -28988,7 +28988,7 @@ function commentsOf(text3) {
|
|
|
28988
28988
|
if (c === "/" && text3[i3 + 1] === "/") {
|
|
28989
28989
|
let end = i3;
|
|
28990
28990
|
while (end < text3.length && text3[end] !== "\n") end += 1;
|
|
28991
|
-
comments.push({ line, text: text3.slice(i3 + 2, end) });
|
|
28991
|
+
comments.push({ line: line2, text: text3.slice(i3 + 2, end) });
|
|
28992
28992
|
i3 = end;
|
|
28993
28993
|
continue;
|
|
28994
28994
|
}
|
|
@@ -28996,16 +28996,16 @@ function commentsOf(text3) {
|
|
|
28996
28996
|
const close = text3.indexOf("*/", i3 + 2);
|
|
28997
28997
|
const stop2 = close === -1 ? text3.length : close + 2;
|
|
28998
28998
|
const body2 = text3.slice(i3 + 2, close === -1 ? text3.length : close);
|
|
28999
|
-
body2.split("\n").forEach((part, k) => comments.push({ line:
|
|
28999
|
+
body2.split("\n").forEach((part, k) => comments.push({ line: line2 + k, text: part }));
|
|
29000
29000
|
for (const ch of text3.slice(i3, stop2)) if (ch === "\n") {
|
|
29001
29001
|
code += "\n";
|
|
29002
|
-
|
|
29002
|
+
line2 += 1;
|
|
29003
29003
|
}
|
|
29004
29004
|
i3 = stop2;
|
|
29005
29005
|
continue;
|
|
29006
29006
|
}
|
|
29007
29007
|
code += c;
|
|
29008
|
-
if (c === "\n")
|
|
29008
|
+
if (c === "\n") line2 += 1;
|
|
29009
29009
|
i3 += 1;
|
|
29010
29010
|
}
|
|
29011
29011
|
return { comments, code };
|
|
@@ -29595,8 +29595,8 @@ function codePointToString(code) {
|
|
|
29595
29595
|
return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
|
|
29596
29596
|
}
|
|
29597
29597
|
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
29598
|
-
var Position = function Position2(
|
|
29599
|
-
this.line =
|
|
29598
|
+
var Position = function Position2(line2, col) {
|
|
29599
|
+
this.line = line2;
|
|
29600
29600
|
this.column = col;
|
|
29601
29601
|
};
|
|
29602
29602
|
Position.prototype.offset = function offset(n) {
|
|
@@ -29610,12 +29610,12 @@ var SourceLocation = function SourceLocation2(p, start3, end) {
|
|
|
29610
29610
|
}
|
|
29611
29611
|
};
|
|
29612
29612
|
function getLineInfo(input, offset2) {
|
|
29613
|
-
for (var
|
|
29613
|
+
for (var line2 = 1, cur = 0; ; ) {
|
|
29614
29614
|
var nextBreak = nextLineBreak(input, cur, offset2);
|
|
29615
29615
|
if (nextBreak < 0) {
|
|
29616
|
-
return new Position(
|
|
29616
|
+
return new Position(line2, offset2 - cur);
|
|
29617
29617
|
}
|
|
29618
|
-
++
|
|
29618
|
+
++line2;
|
|
29619
29619
|
cur = nextBreak;
|
|
29620
29620
|
}
|
|
29621
29621
|
}
|
|
@@ -35126,9 +35126,9 @@ function attempt(text3, sourceType) {
|
|
|
35126
35126
|
return null;
|
|
35127
35127
|
} catch (err2) {
|
|
35128
35128
|
const e = err2;
|
|
35129
|
-
const
|
|
35129
|
+
const line2 = typeof e.loc?.line === "number" ? e.loc.line : 1;
|
|
35130
35130
|
const column = typeof e.loc?.column === "number" ? e.loc.column : 0;
|
|
35131
|
-
return { message: typeof e.message === "string" ? e.message : "", line, column };
|
|
35131
|
+
return { message: typeof e.message === "string" ? e.message : "", line: line2, column };
|
|
35132
35132
|
}
|
|
35133
35133
|
}
|
|
35134
35134
|
function readingsFor(path, text3) {
|
|
@@ -35449,9 +35449,9 @@ function titleOf(call) {
|
|
|
35449
35449
|
return null;
|
|
35450
35450
|
}
|
|
35451
35451
|
function lineAt(text3, offset2) {
|
|
35452
|
-
let
|
|
35453
|
-
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10)
|
|
35454
|
-
return
|
|
35452
|
+
let line2 = 1;
|
|
35453
|
+
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10) line2++;
|
|
35454
|
+
return line2;
|
|
35455
35455
|
}
|
|
35456
35456
|
function locateTests(path, text3) {
|
|
35457
35457
|
const parsed = parseProgram(path, text3);
|
|
@@ -36736,7 +36736,7 @@ function listingForWire(listing, deniedPaths) {
|
|
|
36736
36736
|
var NON_TEXT_EXTENSION_RE = /\.(png|jpe?g|gif|webp|avif|ico|icns|bmp|tiff?|psd|mp[34]|m4a|mov|avi|webm|mkv|wav|ogg|flac|woff2?|ttf|otf|eot|pdf|zip|gz|tgz|bz2|xz|7z|rar|jar|war|wasm|exe|dll|so|dylib|pyc|class|o|a|sqlite3?|db)$/i;
|
|
36737
36737
|
function isGeneratedText(lf) {
|
|
36738
36738
|
let start3 = 0;
|
|
36739
|
-
for (let
|
|
36739
|
+
for (let line2 = 0; line2 < 5 && start3 <= lf.length; line2++) {
|
|
36740
36740
|
const end = lf.indexOf("\n", start3);
|
|
36741
36741
|
const text3 = end === -1 ? lf.slice(start3) : lf.slice(start3, end);
|
|
36742
36742
|
if (text3.includes("@generated") || text3.includes("DO NOT EDIT")) return true;
|
|
@@ -37518,9 +37518,9 @@ function kindOfKeyword(word) {
|
|
|
37518
37518
|
if (w === "module" || w === "namespace" || w === "mod") return "module";
|
|
37519
37519
|
return "other";
|
|
37520
37520
|
}
|
|
37521
|
-
function indentOf(
|
|
37521
|
+
function indentOf(line2) {
|
|
37522
37522
|
let n = 0;
|
|
37523
|
-
for (const ch of
|
|
37523
|
+
for (const ch of line2) {
|
|
37524
37524
|
if (ch === " ") n += 1;
|
|
37525
37525
|
else if (ch === " ") n += 4;
|
|
37526
37526
|
else break;
|
|
@@ -37531,11 +37531,11 @@ function keywordEntries(text3, only) {
|
|
|
37531
37531
|
const lines = text3.replace(/\r\n/g, "\n").split("\n");
|
|
37532
37532
|
const found = [];
|
|
37533
37533
|
for (let i3 = 0; i3 < lines.length; i3++) {
|
|
37534
|
-
const
|
|
37535
|
-
if (
|
|
37536
|
-
const m = KEYWORD_LINE.exec(
|
|
37534
|
+
const line2 = lines[i3];
|
|
37535
|
+
if (line2.length > 400) continue;
|
|
37536
|
+
const m = KEYWORD_LINE.exec(line2);
|
|
37537
37537
|
if (!m) continue;
|
|
37538
|
-
if (indentOf(
|
|
37538
|
+
if (indentOf(line2) > MAX_INDENT) continue;
|
|
37539
37539
|
const kind = kindOfKeyword(m[2]);
|
|
37540
37540
|
if (only && !only.has(m[2])) continue;
|
|
37541
37541
|
found.push({ indent: indentOf(m[1]), kind, name: clip2(m[3]), line: i3 + 1 });
|
|
@@ -37837,17 +37837,17 @@ function prepareReadFileV2(args2, env2, ledger) {
|
|
|
37837
37837
|
let endLine = s - 1;
|
|
37838
37838
|
let cutInsideLine = false;
|
|
37839
37839
|
for (let n = s; n <= windowEnd; n++) {
|
|
37840
|
-
const
|
|
37841
|
-
const cost =
|
|
37840
|
+
const line2 = `${n} ${lines[n - 1]}`;
|
|
37841
|
+
const cost = line2.length + (out2.length > 0 ? 1 : 0);
|
|
37842
37842
|
if (used + cost <= budget) {
|
|
37843
|
-
out2.push(
|
|
37843
|
+
out2.push(line2);
|
|
37844
37844
|
used += cost;
|
|
37845
37845
|
endLine = n;
|
|
37846
37846
|
continue;
|
|
37847
37847
|
}
|
|
37848
37848
|
if (out2.length === 0) {
|
|
37849
37849
|
const keep = Math.max(0, budget - 12);
|
|
37850
|
-
out2.push(`${
|
|
37850
|
+
out2.push(`${line2.slice(0, keep)}\u2026[line cut]`);
|
|
37851
37851
|
used = out2[0].length;
|
|
37852
37852
|
endLine = n;
|
|
37853
37853
|
cutInsideLine = true;
|
|
@@ -38002,10 +38002,10 @@ function definitionsIn(text3, name2, path, parsed) {
|
|
|
38002
38002
|
const lines = text3.split("\n");
|
|
38003
38003
|
const found = [];
|
|
38004
38004
|
for (let i3 = 0; i3 < lines.length; i3++) {
|
|
38005
|
-
const
|
|
38006
|
-
if (
|
|
38005
|
+
const line2 = lines[i3];
|
|
38006
|
+
if (line2.length > 600 || !line2.includes(name2)) continue;
|
|
38007
38007
|
for (const [re, kind] of rules) {
|
|
38008
|
-
if (re.test(
|
|
38008
|
+
if (re.test(line2)) {
|
|
38009
38009
|
found.push({ line: i3 + 1, kind });
|
|
38010
38010
|
break;
|
|
38011
38011
|
}
|
|
@@ -38325,10 +38325,10 @@ function prepareReadFile(args2, env2, ledger) {
|
|
|
38325
38325
|
let endLine = startLine - 1;
|
|
38326
38326
|
let truncated = false;
|
|
38327
38327
|
for (let n = startLine; n <= endWanted; n++) {
|
|
38328
|
-
const
|
|
38329
|
-
const cost =
|
|
38328
|
+
const line2 = `${n} ${lines[n - 1]}`;
|
|
38329
|
+
const cost = line2.length + (out2.length > 0 ? 1 : 0);
|
|
38330
38330
|
if (used + cost <= budget) {
|
|
38331
|
-
out2.push(
|
|
38331
|
+
out2.push(line2);
|
|
38332
38332
|
used += cost;
|
|
38333
38333
|
endLine = n;
|
|
38334
38334
|
continue;
|
|
@@ -38336,7 +38336,7 @@ function prepareReadFile(args2, env2, ledger) {
|
|
|
38336
38336
|
truncated = true;
|
|
38337
38337
|
if (out2.length === 0) {
|
|
38338
38338
|
const keep = Math.max(0, budget - CUT.length);
|
|
38339
|
-
out2.push(
|
|
38339
|
+
out2.push(line2.slice(0, keep) + CUT);
|
|
38340
38340
|
used = out2[0].length;
|
|
38341
38341
|
endLine = n;
|
|
38342
38342
|
}
|
|
@@ -38390,8 +38390,8 @@ function prepareListFiles(args2, env2) {
|
|
|
38390
38390
|
};
|
|
38391
38391
|
}
|
|
38392
38392
|
var WORD_CHAR = /[A-Za-z0-9_$]/;
|
|
38393
|
-
function lineMatches(
|
|
38394
|
-
const hay = ignoreCase ?
|
|
38393
|
+
function lineMatches(line2, needle, ignoreCase, wholeWord) {
|
|
38394
|
+
const hay = ignoreCase ? line2.toLowerCase() : line2;
|
|
38395
38395
|
let from = 0;
|
|
38396
38396
|
for (; ; ) {
|
|
38397
38397
|
const i3 = hay.indexOf(needle, from);
|
|
@@ -38403,10 +38403,10 @@ function lineMatches(line, needle, ignoreCase, wholeWord) {
|
|
|
38403
38403
|
from = i3 + 1;
|
|
38404
38404
|
}
|
|
38405
38405
|
}
|
|
38406
|
-
function excerpt(
|
|
38407
|
-
const t =
|
|
38406
|
+
function excerpt(line2, at2, max) {
|
|
38407
|
+
const t = line2.trim();
|
|
38408
38408
|
if (t.length <= max) return t;
|
|
38409
|
-
const lead =
|
|
38409
|
+
const lead = line2.length - line2.trimStart().length;
|
|
38410
38410
|
const pos = Math.max(0, at2 - lead);
|
|
38411
38411
|
const from = Math.max(0, Math.min(pos - 40, t.length - max));
|
|
38412
38412
|
const piece = t.slice(from, from + max);
|
|
@@ -40615,12 +40615,12 @@ function parseAssertionLocation(body2) {
|
|
|
40615
40615
|
let any;
|
|
40616
40616
|
while (any = ANY_LOCATION_RE.exec(text3)) {
|
|
40617
40617
|
const raw = any[1] ?? any[3];
|
|
40618
|
-
const
|
|
40619
|
-
if (!raw || !
|
|
40618
|
+
const line2 = any[2] ?? any[4];
|
|
40619
|
+
if (!raw || !line2) continue;
|
|
40620
40620
|
const shown = shownPath(raw);
|
|
40621
40621
|
if (DEPENDENCY_PATH_RE.test(`/${shown}`) || /^(?:https?|file):/i.test(shown)) continue;
|
|
40622
40622
|
if (shown.length > MAX_FAILURE_LOCATION) return null;
|
|
40623
|
-
return `${shown}:${
|
|
40623
|
+
return `${shown}:${line2}`;
|
|
40624
40624
|
}
|
|
40625
40625
|
return null;
|
|
40626
40626
|
}
|
|
@@ -41722,14 +41722,14 @@ var JS_TS_EXTENSION_RE = /\.(?:ts|tsx|js|jsx|mjs|cjs)$/;
|
|
|
41722
41722
|
var EXPORTED_SYMBOL_RE = /^export\s+(?:default\s+)?(?:async\s+)?(?:function\*?|class|const|let|var|interface|type|enum)\s+([A-Za-z_$][\w$]*)/gm;
|
|
41723
41723
|
function countRemovedLines(currentContent, newContent) {
|
|
41724
41724
|
const remaining = /* @__PURE__ */ new Map();
|
|
41725
|
-
for (const
|
|
41726
|
-
remaining.set(
|
|
41725
|
+
for (const line2 of newContent.split("\n")) {
|
|
41726
|
+
remaining.set(line2, (remaining.get(line2) ?? 0) + 1);
|
|
41727
41727
|
}
|
|
41728
41728
|
let removed = 0;
|
|
41729
|
-
for (const
|
|
41730
|
-
const count3 = remaining.get(
|
|
41729
|
+
for (const line2 of currentContent.split("\n")) {
|
|
41730
|
+
const count3 = remaining.get(line2) ?? 0;
|
|
41731
41731
|
if (count3 > 0) {
|
|
41732
|
-
remaining.set(
|
|
41732
|
+
remaining.set(line2, count3 - 1);
|
|
41733
41733
|
} else {
|
|
41734
41734
|
removed++;
|
|
41735
41735
|
}
|
|
@@ -42537,9 +42537,9 @@ function withRelatedNote(message, related) {
|
|
|
42537
42537
|
var sha = (s) => (0, import_node_crypto3.createHash)("sha256").update(s).digest("hex");
|
|
42538
42538
|
var LOCATION_SUFFIX = / \[at [^\]\r\n]{1,70}\]$/;
|
|
42539
42539
|
function firstLine(text3, where, max = MAX_MESSAGE_CHARS) {
|
|
42540
|
-
const
|
|
42541
|
-
if (
|
|
42542
|
-
const safe = scrubSecrets2(where ? `${
|
|
42540
|
+
const line2 = text3.split(LINE_BREAK).map((l) => l.replace(CONTROL_CHARS, "").trim()).find((l) => l.length > 0);
|
|
42541
|
+
if (line2 === void 0) return "";
|
|
42542
|
+
const safe = scrubSecrets2(where ? `${line2} [at ${where}]` : line2);
|
|
42543
42543
|
if (safe.length <= max) return safe;
|
|
42544
42544
|
const kept = LOCATION_SUFFIX.exec(safe);
|
|
42545
42545
|
if (kept) return `${safe.slice(0, kept.index).slice(0, max - kept[0].length - 1)}\u2026${kept[0]}`;
|
|
@@ -42629,10 +42629,10 @@ function testAnswerFrom(args2) {
|
|
|
42629
42629
|
listed.forEach((id, i3) => {
|
|
42630
42630
|
if (!own.has(id)) {
|
|
42631
42631
|
if (args2.approvedIds?.has(id) === true) {
|
|
42632
|
-
const
|
|
42633
|
-
if (
|
|
42634
|
-
messages[names[i3]] =
|
|
42635
|
-
left -=
|
|
42632
|
+
const line3 = firstLine(failureText.get(id) ?? "", failureWhere.get(id));
|
|
42633
|
+
if (line3 && line3.length <= left) {
|
|
42634
|
+
messages[names[i3]] = line3;
|
|
42635
|
+
left -= line3.length;
|
|
42636
42636
|
}
|
|
42637
42637
|
}
|
|
42638
42638
|
return;
|
|
@@ -42640,10 +42640,10 @@ function testAnswerFrom(args2) {
|
|
|
42640
42640
|
ownToCome -= 1;
|
|
42641
42641
|
const where = failureWhere.get(id);
|
|
42642
42642
|
const allowance = Math.min(MAX_WHOLE_MESSAGE_CHARS, left - ownToCome * MAX_MESSAGE_CHARS);
|
|
42643
|
-
const
|
|
42644
|
-
if (
|
|
42645
|
-
messages[names[i3]] =
|
|
42646
|
-
left -=
|
|
42643
|
+
const line2 = args2.harness === true && allowance > MAX_MESSAGE_CHARS ? wholeFailure(failureDetail.get(id) ?? failureText.get(id) ?? "", where, allowance) : firstLine(failureText.get(id) ?? "", where);
|
|
42644
|
+
if (line2) {
|
|
42645
|
+
messages[names[i3]] = line2;
|
|
42646
|
+
left -= line2.length;
|
|
42647
42647
|
}
|
|
42648
42648
|
});
|
|
42649
42649
|
const messageCount = Object.keys(messages).length;
|
|
@@ -43277,17 +43277,17 @@ function wholeNumber(n) {
|
|
|
43277
43277
|
}
|
|
43278
43278
|
function clampRefusedTurns(turns) {
|
|
43279
43279
|
const rows = [];
|
|
43280
|
-
let
|
|
43280
|
+
let cut2 = false;
|
|
43281
43281
|
for (const t of turns ?? []) {
|
|
43282
43282
|
if (rows.length >= MAX_RECORD_REFUSED_TURNS) {
|
|
43283
|
-
|
|
43283
|
+
cut2 = true;
|
|
43284
43284
|
break;
|
|
43285
43285
|
}
|
|
43286
|
-
if (t.rules.length > MAX_RECORD_REFUSED_RULES)
|
|
43286
|
+
if (t.rules.length > MAX_RECORD_REFUSED_RULES) cut2 = true;
|
|
43287
43287
|
const rules = [...new Set(t.rules.map(recordRuleWord))].slice(0, MAX_RECORD_REFUSED_RULES);
|
|
43288
43288
|
if (rules.length > 0) rows.push({ turn: wholeNumber(t.turn), rules });
|
|
43289
43289
|
}
|
|
43290
|
-
return { rows, cut };
|
|
43290
|
+
return { rows, cut: cut2 };
|
|
43291
43291
|
}
|
|
43292
43292
|
|
|
43293
43293
|
// src/codegenAttempts.ts
|
|
@@ -43415,10 +43415,10 @@ function testRunFrom(answer) {
|
|
|
43415
43415
|
for (const [name2, text3] of Object.entries(answer.messages)) {
|
|
43416
43416
|
const key = name2.slice(0, MAX_PREVIOUS_NAME_CHARS);
|
|
43417
43417
|
if (typeof text3 !== "string" || !listed.has(key) || Object.keys(messages).length >= MAX_PREVIOUS_TESTS) continue;
|
|
43418
|
-
const
|
|
43419
|
-
if (
|
|
43420
|
-
messages[key] =
|
|
43421
|
-
total +=
|
|
43418
|
+
const cut2 = text3.slice(0, Math.min(MAX_PREVIOUS_WHOLE_MESSAGE_CHARS, MAX_PREVIOUS_MESSAGES_TOTAL_CHARS - total));
|
|
43419
|
+
if (cut2.length > 0) {
|
|
43420
|
+
messages[key] = cut2;
|
|
43421
|
+
total += cut2.length;
|
|
43422
43422
|
}
|
|
43423
43423
|
}
|
|
43424
43424
|
if (Object.keys(messages).length > 0) run3.messages = messages;
|
|
@@ -43455,22 +43455,22 @@ var MAX_NAMED = 4;
|
|
|
43455
43455
|
var QUOTE_WIDTH = 50;
|
|
43456
43456
|
var TAIL = "Make `find` longer by adding the line before or after the place you mean, so it matches exactly once.";
|
|
43457
43457
|
function lineNumberAt(text3, index) {
|
|
43458
|
-
let
|
|
43459
|
-
for (let at2 = text3.indexOf("\n"); at2 !== -1 && at2 < index; at2 = text3.indexOf("\n", at2 + 1))
|
|
43460
|
-
return
|
|
43458
|
+
let line2 = 1;
|
|
43459
|
+
for (let at2 = text3.indexOf("\n"); at2 !== -1 && at2 < index; at2 = text3.indexOf("\n", at2 + 1)) line2 += 1;
|
|
43460
|
+
return line2;
|
|
43461
43461
|
}
|
|
43462
43462
|
function previousTextLine(text3, index) {
|
|
43463
43463
|
let end = (index === 0 ? 0 : text3.lastIndexOf("\n", index - 1) + 1) - 1;
|
|
43464
43464
|
while (end >= 0) {
|
|
43465
43465
|
const start3 = end === 0 ? 0 : text3.lastIndexOf("\n", end - 1) + 1;
|
|
43466
|
-
const
|
|
43467
|
-
if (
|
|
43466
|
+
const line2 = text3.slice(start3, end);
|
|
43467
|
+
if (line2.trim() !== "") return line2;
|
|
43468
43468
|
end = start3 - 1;
|
|
43469
43469
|
}
|
|
43470
43470
|
return null;
|
|
43471
43471
|
}
|
|
43472
|
-
function quoted(
|
|
43473
|
-
return
|
|
43472
|
+
function quoted(line2, width) {
|
|
43473
|
+
return line2.replace(/`/g, "").trim().slice(0, width).trimEnd();
|
|
43474
43474
|
}
|
|
43475
43475
|
function ambiguousPlacesMessage(lf, starts, total) {
|
|
43476
43476
|
const named2 = starts.slice(0, MAX_NAMED);
|
|
@@ -45442,12 +45442,12 @@ function existingTestVerdictLang(input) {
|
|
|
45442
45442
|
const matches = /* @__PURE__ */ new Map();
|
|
45443
45443
|
const failed = embed(baseline, after, matches);
|
|
45444
45444
|
if (failed) {
|
|
45445
|
-
let
|
|
45445
|
+
let line2 = failed.unit.line;
|
|
45446
45446
|
if (before !== null) {
|
|
45447
45447
|
const mapped = /* @__PURE__ */ new Map();
|
|
45448
|
-
if (embed(baseline, before, mapped) === null)
|
|
45448
|
+
if (embed(baseline, before, mapped) === null) line2 = mapped.get(failed.unit)?.line ?? line2;
|
|
45449
45449
|
}
|
|
45450
|
-
return { ok: false, why: failed.why, line };
|
|
45450
|
+
return { ok: false, why: failed.why, line: line2 };
|
|
45451
45451
|
}
|
|
45452
45452
|
const matched = new Set(matches.values());
|
|
45453
45453
|
const problem = newCodeLine(lang, spec, baseline, after, matched, matches);
|
|
@@ -45691,8 +45691,8 @@ var LEAD2 = {
|
|
|
45691
45691
|
affects_existing: "Your new code could change what the existing tests check"
|
|
45692
45692
|
};
|
|
45693
45693
|
var GUIDANCE2 = "Existing tests and the code they use must stay exactly as they are, in the same order. You may add new tests, new helper functions and new import lines, add a name to an existing import line, and fix tests you added yourself.";
|
|
45694
|
-
function existingTestMessage(why,
|
|
45695
|
-
return `${LEAD2[why]}${
|
|
45694
|
+
function existingTestMessage(why, line2) {
|
|
45695
|
+
return `${LEAD2[why]}${line2 === void 0 ? "" : ` (line ${line2})`}. ${GUIDANCE2}`;
|
|
45696
45696
|
}
|
|
45697
45697
|
function protectedAnswer(verdict) {
|
|
45698
45698
|
if (typeof verdict.line === "number") return { reason: verdict.why, message: existingTestMessage(verdict.why, verdict.line) };
|
|
@@ -45874,9 +45874,9 @@ function isCheck(call) {
|
|
|
45874
45874
|
return o.type === "CallExpression" && o.callee.type === "Identifier" && o.callee.name === "expect";
|
|
45875
45875
|
}
|
|
45876
45876
|
function lineAt3(text3, offset2) {
|
|
45877
|
-
let
|
|
45878
|
-
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10)
|
|
45879
|
-
return
|
|
45877
|
+
let line2 = 1;
|
|
45878
|
+
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10) line2++;
|
|
45879
|
+
return line2;
|
|
45880
45880
|
}
|
|
45881
45881
|
function findTests(path, text3) {
|
|
45882
45882
|
const parsed = parseProgram(path, text3);
|
|
@@ -45951,19 +45951,19 @@ function ownTestFloor(input) {
|
|
|
45951
45951
|
const beforeById = before ? groupById(before) : null;
|
|
45952
45952
|
for (const { test, nth } of own) {
|
|
45953
45953
|
const found = after.get(test.id)?.[nth];
|
|
45954
|
-
const
|
|
45955
|
-
if (!found) return { ok: false, why: "test_removed", line };
|
|
45956
|
-
if (found.skipped && !test.skipped || found.checks < test.checks) return { ok: false, why: "test_emptied", line };
|
|
45954
|
+
const line2 = beforeById?.get(test.id)?.[nth]?.line ?? test.line;
|
|
45955
|
+
if (!found) return { ok: false, why: "test_removed", line: line2 };
|
|
45956
|
+
if (found.skipped && !test.skipped || found.checks < test.checks) return { ok: false, why: "test_emptied", line: line2 };
|
|
45957
45957
|
}
|
|
45958
45958
|
return { ok: true };
|
|
45959
45959
|
} catch {
|
|
45960
45960
|
return { ok: true };
|
|
45961
45961
|
}
|
|
45962
45962
|
}
|
|
45963
|
-
function ownTestMessage(why,
|
|
45963
|
+
function ownTestMessage(why, line2) {
|
|
45964
45964
|
const keep = "Correct its expectation instead, and keep its name, its [id] and a real check of the case.";
|
|
45965
|
-
if (why === "test_removed") return `Your edit removes a test that was written earlier in this run (line ${
|
|
45966
|
-
return `Your edit leaves a test that was written earlier in this run with fewer checks, or skips it (line ${
|
|
45965
|
+
if (why === "test_removed") return `Your edit removes a test that was written earlier in this run (line ${line2}). ${keep}`;
|
|
45966
|
+
return `Your edit leaves a test that was written earlier in this run with fewer checks, or skips it (line ${line2}). ${keep}`;
|
|
45967
45967
|
}
|
|
45968
45968
|
var MAX_PATHS = 10;
|
|
45969
45969
|
var MAX_LINES = 20;
|
|
@@ -47023,8 +47023,8 @@ function firstFailure(path, code) {
|
|
|
47023
47023
|
return first;
|
|
47024
47024
|
}
|
|
47025
47025
|
function stoppedAtTag(text3, failure) {
|
|
47026
|
-
const
|
|
47027
|
-
return
|
|
47026
|
+
const line2 = text3.split("\n")[failure.line - 1] ?? "";
|
|
47027
|
+
return line2[failure.column] === "<";
|
|
47028
47028
|
}
|
|
47029
47029
|
var WORDS = {
|
|
47030
47030
|
duplicate_declaration: "a name declared twice",
|
|
@@ -47191,10 +47191,10 @@ function fitBlocks(blocks, paths, room) {
|
|
|
47191
47191
|
const lines = block.split("\n");
|
|
47192
47192
|
const head = [];
|
|
47193
47193
|
let size = 0;
|
|
47194
|
-
for (const
|
|
47195
|
-
if (size +
|
|
47196
|
-
head.push(
|
|
47197
|
-
size +=
|
|
47194
|
+
for (const line2 of lines) {
|
|
47195
|
+
if (size + line2.length + 1 + rest.length > room) break;
|
|
47196
|
+
head.push(line2);
|
|
47197
|
+
size += line2.length + 1;
|
|
47198
47198
|
}
|
|
47199
47199
|
return [...head, rest].join("\n").slice(0, room);
|
|
47200
47200
|
}
|
|
@@ -48081,8 +48081,8 @@ async function proveProposals(input) {
|
|
|
48081
48081
|
return { ran: false, evidence, stillFailing: [], unexplained: [] };
|
|
48082
48082
|
};
|
|
48083
48083
|
const endOf = (f, c) => {
|
|
48084
|
-
const
|
|
48085
|
-
return
|
|
48084
|
+
const line2 = newEndLineOf(f, c);
|
|
48085
|
+
return line2 === void 0 ? {} : { newEndLine: line2 };
|
|
48086
48086
|
};
|
|
48087
48087
|
if (files.length === 0 || input.run === null) return notChecked();
|
|
48088
48088
|
const proposed = files.map((f) => ({ targetPath: f.path, newContent: fileText(f.newLf, f.ending, f.bom) }));
|
|
@@ -48605,8 +48605,8 @@ function reviewLine(id, text3) {
|
|
|
48605
48605
|
const prefix = `[${id}] fails on the code as it is with: `;
|
|
48606
48606
|
const room = Math.min(MAX_QUOTE_CHARS, MAX_REFUSED_SENTENCE_CHARS - prefix.length);
|
|
48607
48607
|
if (room < MIN_QUOTE_CHARS) return null;
|
|
48608
|
-
const
|
|
48609
|
-
return
|
|
48608
|
+
const line2 = firstLine(text3, void 0, room);
|
|
48609
|
+
return line2.length > 0 ? `${prefix}${line2}` : null;
|
|
48610
48610
|
}
|
|
48611
48611
|
function reviewAnswer(lines) {
|
|
48612
48612
|
return { rules: ["done_rule"], violations: [...lines.slice(0, MAX_REVIEW_CASES), REVIEW_CLOSING], message: REVIEW_MESSAGE };
|
|
@@ -48762,24 +48762,48 @@ var NOTE_MESSAGES = {
|
|
|
48762
48762
|
closed: "This file is QuikPilot's own note of the database change, and it is not written in this step.",
|
|
48763
48763
|
content: "content must be a string."
|
|
48764
48764
|
};
|
|
48765
|
+
var MAX_SHOWN_NAMES = 2;
|
|
48766
|
+
var MAX_SHOWN_NAME_CHARS = 32;
|
|
48767
|
+
var MAX_UNCHECKED = 8;
|
|
48768
|
+
var MAX_UNCHECKED_CHARS = 200;
|
|
48769
|
+
function cleanName(name2) {
|
|
48770
|
+
return name2.replace(/[^\w$.\-]/g, "_").slice(0, MAX_UNCHECKED_CHARS);
|
|
48771
|
+
}
|
|
48772
|
+
function namesSentence(names) {
|
|
48773
|
+
const shown = names.slice(0, MAX_SHOWN_NAMES).map((n) => n.slice(0, MAX_SHOWN_NAME_CHARS));
|
|
48774
|
+
const more = names.length > shown.length ? ` and ${names.length - shown.length} more` : "";
|
|
48775
|
+
return `${NOT_RECORDED} the migration names ${shown.join(", ")}${more}, which no file this run could read shows. Read the file that defines the stored data, then write the whole note again with the names the repository uses.`;
|
|
48776
|
+
}
|
|
48765
48777
|
function namesNote(args2) {
|
|
48766
48778
|
if (!isRecord3(args2) || typeof args2.path !== "string") return false;
|
|
48767
48779
|
const n = normaliseToolPath(args2.path);
|
|
48768
48780
|
return n.ok && n.path === DATABASE_CHANGE_PATH;
|
|
48769
48781
|
}
|
|
48770
48782
|
var DatabaseChangeNote = class {
|
|
48771
|
-
constructor(partIds, inEffect) {
|
|
48783
|
+
constructor(partIds, inEffect, names) {
|
|
48772
48784
|
this.partIds = partIds;
|
|
48773
48785
|
this.inEffect = inEffect;
|
|
48786
|
+
this.names = names;
|
|
48774
48787
|
}
|
|
48775
48788
|
partIds;
|
|
48776
48789
|
inEffect;
|
|
48790
|
+
names;
|
|
48777
48791
|
text;
|
|
48778
48792
|
proposal;
|
|
48793
|
+
/** QUIKTR-2448: the one send-back for a name nothing readable shows has been used. */
|
|
48794
|
+
sentBack = false;
|
|
48779
48795
|
/** The proposal recorded in this loop, if any. */
|
|
48780
48796
|
recorded() {
|
|
48781
48797
|
return this.proposal;
|
|
48782
48798
|
}
|
|
48799
|
+
uncheckedNames(migration) {
|
|
48800
|
+
if (!this.names) return [];
|
|
48801
|
+
try {
|
|
48802
|
+
return this.names(migration).map(cleanName).filter((n) => n !== "");
|
|
48803
|
+
} catch {
|
|
48804
|
+
return [];
|
|
48805
|
+
}
|
|
48806
|
+
}
|
|
48783
48807
|
/** The result for a call on the note's path; `null` for any other call (it runs as it always did). */
|
|
48784
48808
|
handle(call, ledger, limits) {
|
|
48785
48809
|
if (!NOTE_TOOLS.has(call.name) || !namesNote(call.args)) return null;
|
|
@@ -48802,8 +48826,13 @@ var DatabaseChangeNote = class {
|
|
|
48802
48826
|
const read = readProposal(content, this.partIds);
|
|
48803
48827
|
if (!read.ok) return finish({ status: "bad_args", message: read.sentence });
|
|
48804
48828
|
if (this.text === content) return finish({ status: "no_effect", message: NOTE_MESSAGES.same });
|
|
48829
|
+
const unchecked = this.uncheckedNames(read.proposal.migration);
|
|
48830
|
+
if (unchecked.length > 0 && !this.sentBack) {
|
|
48831
|
+
this.sentBack = true;
|
|
48832
|
+
return finish({ status: "bad_args", message: namesSentence(unchecked) });
|
|
48833
|
+
}
|
|
48805
48834
|
this.text = content;
|
|
48806
|
-
this.proposal = read.proposal;
|
|
48835
|
+
this.proposal = unchecked.length > 0 ? { ...read.proposal, unchecked } : read.proposal;
|
|
48807
48836
|
if (ledger.writeChars !== void 0) ledger.writeChars += content.length;
|
|
48808
48837
|
return finish({ status: "ok", message: NOTE_MESSAGES.recorded, output: { path: DATABASE_CHANGE_PATH, parts: [...read.proposal.parts] } });
|
|
48809
48838
|
}
|
|
@@ -48813,7 +48842,7 @@ function finalDatabaseChange(proposal, tree) {
|
|
|
48813
48842
|
const changed = new Set(tree.changedFiles);
|
|
48814
48843
|
const included = (path) => path !== "" && changed.has(path) && insideWriteRoot(path, tree.writeRoot) && matchesDeniedPath(path, writeDenied(tree.deniedPaths)) === null;
|
|
48815
48844
|
const schemaFileIncluded = included(proposal.schemaFile);
|
|
48816
|
-
const schemaFileSeen = proposal.schemaFile
|
|
48845
|
+
const schemaFileSeen = proposal.schemaFile !== "" && (schemaFileIncluded || tree.readPaths.includes(proposal.schemaFile) && matchesDeniedPath(proposal.schemaFile, readDenied(tree.deniedPaths)) === null);
|
|
48817
48846
|
const text3 = (value, max) => tree.scrub(value).slice(0, max);
|
|
48818
48847
|
return {
|
|
48819
48848
|
parts: proposal.parts.map((id) => ({ id, name: tree.parts.find((p) => p.id === id)?.name ?? id })),
|
|
@@ -48829,7 +48858,8 @@ function finalDatabaseChange(proposal, tree) {
|
|
|
48829
48858
|
...proposal.apply !== void 0 ? { apply: text3(proposal.apply, MAX_APPLY_CHARS) } : {},
|
|
48830
48859
|
schemaFileIncluded,
|
|
48831
48860
|
migrationFileIncluded: included(proposal.migrationFile),
|
|
48832
|
-
schemaFileSeen
|
|
48861
|
+
schemaFileSeen,
|
|
48862
|
+
...proposal.unchecked && proposal.unchecked.length > 0 ? { namesUnchecked: proposal.unchecked.slice(0, MAX_UNCHECKED).map((n) => text3(n, MAX_UNCHECKED_CHARS)) } : {}
|
|
48833
48863
|
};
|
|
48834
48864
|
}
|
|
48835
48865
|
|
|
@@ -49016,6 +49046,36 @@ function partMissingSentence(missing, opts = {}) {
|
|
|
49016
49046
|
return `${start3} ${missing[0] ? item(missing[0], true) : ""}`.slice(0, MAX_REFUSED_SENTENCE_CHARS);
|
|
49017
49047
|
}
|
|
49018
49048
|
|
|
49049
|
+
// src/sameFailureHint.ts
|
|
49050
|
+
var MAX_NAMES = 2;
|
|
49051
|
+
var MAX_HINT_CHARS = 300;
|
|
49052
|
+
var SAME_FAILURE_TAIL = " If it should now pass, check the code; if it looks unrelated (say, a 500 from set-up the test lacks), compare its set-up with the tests around it.";
|
|
49053
|
+
var collapse = (text3) => text3.replace(/\s+/g, " ").trim();
|
|
49054
|
+
var line = (text3) => collapse(
|
|
49055
|
+
(text3.split("\n").find((l) => l.trim() !== "") ?? "").replace(/\s*\[at [^\]]*\]/g, "")
|
|
49056
|
+
);
|
|
49057
|
+
function titleOf3(id) {
|
|
49058
|
+
const at2 = id.indexOf("::");
|
|
49059
|
+
return collapse(at2 >= 0 ? id.slice(at2 + 2) : id);
|
|
49060
|
+
}
|
|
49061
|
+
var cut = (text3, max) => text3.length > max ? `${text3.slice(0, Math.max(1, max - 1))}\u2026` : text3;
|
|
49062
|
+
function sameFailureHint(before, now) {
|
|
49063
|
+
const same = Object.keys(now).filter((id) => {
|
|
49064
|
+
const was = line(before[id] ?? "");
|
|
49065
|
+
return was !== "" && was === line(now[id] ?? "");
|
|
49066
|
+
});
|
|
49067
|
+
if (same.length === 0) return null;
|
|
49068
|
+
const rest = same.length - Math.min(MAX_NAMES, same.length);
|
|
49069
|
+
const more = rest > 0 ? ` and ${rest} more` : "";
|
|
49070
|
+
const head = "Your change has not changed how ";
|
|
49071
|
+
const end = ` fails (same message as before).${SAME_FAILURE_TAIL}`;
|
|
49072
|
+
const shown = same.slice(0, MAX_NAMES);
|
|
49073
|
+
const room = MAX_HINT_CHARS - head.length - end.length - more.length - shown.length * 2 - (shown.length - 1) * 2;
|
|
49074
|
+
const each = Math.max(8, Math.floor(room / shown.length));
|
|
49075
|
+
const names = shown.map((id) => `"${cut(titleOf3(id), each)}"`).join(", ");
|
|
49076
|
+
return `${head}${names}${more}${end}`;
|
|
49077
|
+
}
|
|
49078
|
+
|
|
49019
49079
|
// src/codegenLoop.ts
|
|
49020
49080
|
var CODEGEN_LOOP_CONTRACT_VERSION = "codegen-loop-1";
|
|
49021
49081
|
var CODEGEN_LOOP_2_CONTRACT_VERSION = "codegen-loop-2";
|
|
@@ -49118,8 +49178,8 @@ function previousForLoop2(withSteps) {
|
|
|
49118
49178
|
if (!run3?.messages) return previous;
|
|
49119
49179
|
const messages = {};
|
|
49120
49180
|
for (const [name2, text3] of Object.entries(run3.messages)) {
|
|
49121
|
-
const
|
|
49122
|
-
if (
|
|
49181
|
+
const line2 = firstLine(text3);
|
|
49182
|
+
if (line2) messages[name2] = line2;
|
|
49123
49183
|
}
|
|
49124
49184
|
const { messages: _whole, ...rest } = run3;
|
|
49125
49185
|
void _whole;
|
|
@@ -49190,7 +49250,7 @@ async function runCodegenLoop(args2, deps) {
|
|
|
49190
49250
|
const keepOn = notesOn && keepWorkingFilesOn();
|
|
49191
49251
|
const featureOn = notesOn && args2.conflicts !== void 0 && args2.tests !== void 0 && args2.featureTestUpdates === true && args2.phase !== "tests" && !(args2.lane?.kind === "code" && args2.lane.amend !== void 0 && args2.lane.amend.length > 0);
|
|
49192
49252
|
const databaseOn = harness && args2.databaseChange !== void 0 && args2.databaseChange.closed !== true && args2.databaseChange.parts.length > 0 && args2.phase !== "tests" && !(args2.lane?.kind === "code" && args2.lane.amend !== void 0 && args2.lane.amend.length > 0);
|
|
49193
|
-
const note = args2.databaseChange !== void 0 ? new DatabaseChangeNote(args2.databaseChange.parts.map((p) => p.id), databaseOn) : null;
|
|
49253
|
+
const note = args2.databaseChange !== void 0 ? new DatabaseChangeNote(args2.databaseChange.parts.map((p) => p.id), databaseOn, args2.databaseChange.names) : null;
|
|
49194
49254
|
const handedChange = () => {
|
|
49195
49255
|
const recorded = note?.recorded();
|
|
49196
49256
|
return recorded ? { databaseChange: recorded } : {};
|
|
@@ -49343,10 +49403,10 @@ async function runCodegenLoop(args2, deps) {
|
|
|
49343
49403
|
let linesChanged = 0;
|
|
49344
49404
|
let linesSame = 0;
|
|
49345
49405
|
let linesGone = 0;
|
|
49346
|
-
for (const [id,
|
|
49406
|
+
for (const [id, line2] of reviewed.quoted) {
|
|
49347
49407
|
const again = reviewQuote(id);
|
|
49348
49408
|
if (again === null) linesGone += 1;
|
|
49349
|
-
else if (again ===
|
|
49409
|
+
else if (again === line2) linesSame += 1;
|
|
49350
49410
|
else linesChanged += 1;
|
|
49351
49411
|
}
|
|
49352
49412
|
log({
|
|
@@ -49819,8 +49879,8 @@ async function runCodegenLoop(args2, deps) {
|
|
|
49819
49879
|
const ids = args2.redCheckIds ?? [];
|
|
49820
49880
|
const quoted2 = /* @__PURE__ */ new Map();
|
|
49821
49881
|
for (const id of ids) {
|
|
49822
|
-
const
|
|
49823
|
-
if (
|
|
49882
|
+
const line2 = reviewQuote(id);
|
|
49883
|
+
if (line2 !== null) quoted2.set(id, line2);
|
|
49824
49884
|
}
|
|
49825
49885
|
const skip = isFinal ? "final_turn" : quoted2.size === 0 ? "no_message" : tests !== null && tests.runsLeft + tests.fileRunsLeft === 0 ? "no_runs_left" : null;
|
|
49826
49886
|
if (skip !== null) {
|
|
@@ -50007,6 +50067,10 @@ async function runCodegenLoop(args2, deps) {
|
|
|
50007
50067
|
throw new CodegenLoopFailure("executor_error", void 0, err2);
|
|
50008
50068
|
}
|
|
50009
50069
|
}
|
|
50070
|
+
if (featureOn && args2.seedOwnFailures && call.name === RUN_TESTS_TOOL && isTestAnswer(result.output) && result.output.messages) {
|
|
50071
|
+
const hint = sameFailureHint(args2.seedOwnFailures, result.output.messages);
|
|
50072
|
+
if (hint) result = { ...result, message: `${result.message ?? ""} ${hint}`.trim() };
|
|
50073
|
+
}
|
|
50010
50074
|
results.push(result);
|
|
50011
50075
|
if (call.name === "read_file" && isPlainObject3(call.args) && typeof call.args.path === "string" && (result.status === "ok" || result.status === "duplicate")) {
|
|
50012
50076
|
const entry = { id: call.id, turn, path: call.args.path, ...rangeOf(call.args) };
|
|
@@ -50117,7 +50181,7 @@ function frozenFailingTarget(failingTests, frozen, textOf2) {
|
|
|
50117
50181
|
}
|
|
50118
50182
|
function testBlock(text3, token) {
|
|
50119
50183
|
const lines = text3.split("\n");
|
|
50120
|
-
const at2 = lines.flatMap((
|
|
50184
|
+
const at2 = lines.flatMap((line2, n) => line2.includes(token) ? [n] : []);
|
|
50121
50185
|
if (at2.length !== 1) return null;
|
|
50122
50186
|
let end = at2[0] + 1;
|
|
50123
50187
|
while (end < lines.length && !QP_TOKEN.test(lines[end])) end += 1;
|
|
@@ -50235,6 +50299,9 @@ async function runPhases(i3) {
|
|
|
50235
50299
|
lane: { kind: "code", testPaths: i3.testPaths, frozen: tests.frozen },
|
|
50236
50300
|
seed: tests.results,
|
|
50237
50301
|
...tests.proposals ? { seedProposals: tests.proposals } : {},
|
|
50302
|
+
// QUIKTR-2446 part B: how the run's own tests failed on the code before the change (phase 1's last whole-suite run), for the one thing the
|
|
50303
|
+
// code phase tells the AI about it: a test that still fails the same way is not failing because of the change.
|
|
50304
|
+
...tests.answer?.messages && Object.keys(tests.answer.messages).length > 0 ? { seedOwnFailures: tests.answer.messages } : {},
|
|
50238
50305
|
...i3.parts && i3.parts.length > 0 ? { parts: i3.parts } : {},
|
|
50239
50306
|
keepOnGiveUp: true,
|
|
50240
50307
|
previousAttempt: keptChange(i3.attempt, "tests_written", tests.answer, tests.steps)
|
|
@@ -50415,16 +50482,16 @@ function pathOk(p) {
|
|
|
50415
50482
|
return typeof p === "string" && p.length > 0 && p.length <= MAX_RECORD_PATH_CHARS;
|
|
50416
50483
|
}
|
|
50417
50484
|
function buildCodegenLoopRecord(loop) {
|
|
50418
|
-
let
|
|
50485
|
+
let cut2 = false;
|
|
50419
50486
|
const room = (rows) => {
|
|
50420
50487
|
const kept = [];
|
|
50421
50488
|
for (const r of rows) {
|
|
50422
50489
|
if (kept.length >= MAX_RECORD_PATHS) {
|
|
50423
|
-
|
|
50490
|
+
cut2 = true;
|
|
50424
50491
|
break;
|
|
50425
50492
|
}
|
|
50426
50493
|
if (!pathOk(r.path)) {
|
|
50427
|
-
|
|
50494
|
+
cut2 = true;
|
|
50428
50495
|
continue;
|
|
50429
50496
|
}
|
|
50430
50497
|
kept.push(r);
|
|
@@ -50443,13 +50510,13 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50443
50510
|
const statusCounts = {};
|
|
50444
50511
|
for (const [k, v] of Object.entries(loop.statusCounts).slice(0, MAX_STATUS_KEYS)) {
|
|
50445
50512
|
if (k.length > 0 && k.length <= MAX_STATUS_KEY_CHARS) statusCounts[k] = whole3(v);
|
|
50446
|
-
else
|
|
50513
|
+
else cut2 = true;
|
|
50447
50514
|
}
|
|
50448
|
-
if (Object.keys(loop.statusCounts).length > MAX_STATUS_KEYS)
|
|
50515
|
+
if (Object.keys(loop.statusCounts).length > MAX_STATUS_KEYS) cut2 = true;
|
|
50449
50516
|
const reasoning = [];
|
|
50450
50517
|
for (const r of loop.reasoning) {
|
|
50451
50518
|
if (reasoning.length >= MAX_RECORD_REASONING_TURNS) {
|
|
50452
|
-
|
|
50519
|
+
cut2 = true;
|
|
50453
50520
|
break;
|
|
50454
50521
|
}
|
|
50455
50522
|
const text3 = typeof r.text === "string" ? r.text.trim() : "";
|
|
@@ -50460,7 +50527,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50460
50527
|
const testRuns = [];
|
|
50461
50528
|
for (const t of loop.testRuns ?? []) {
|
|
50462
50529
|
if (testRuns.length >= MAX_RECORD_TEST_RUNS) {
|
|
50463
|
-
|
|
50530
|
+
cut2 = true;
|
|
50464
50531
|
break;
|
|
50465
50532
|
}
|
|
50466
50533
|
testRuns.push({
|
|
@@ -50481,7 +50548,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50481
50548
|
const phases = [];
|
|
50482
50549
|
for (const ph of loop.phases ?? []) {
|
|
50483
50550
|
if (phases.length >= MAX_RECORD_PHASES) {
|
|
50484
|
-
|
|
50551
|
+
cut2 = true;
|
|
50485
50552
|
break;
|
|
50486
50553
|
}
|
|
50487
50554
|
if (!PHASES.has(ph.phase) || typeof ph.outcome !== "string" || ph.outcome.length === 0) continue;
|
|
@@ -50494,15 +50561,15 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50494
50561
|
});
|
|
50495
50562
|
}
|
|
50496
50563
|
const refused2 = clampRefusedTurns(loop.refusedTurns);
|
|
50497
|
-
if (refused2.cut)
|
|
50564
|
+
if (refused2.cut) cut2 = true;
|
|
50498
50565
|
const attempts = [];
|
|
50499
50566
|
for (const a of loop.attempts ?? []) {
|
|
50500
50567
|
if (attempts.length >= MAX_RECORD_ATTEMPTS) {
|
|
50501
|
-
|
|
50568
|
+
cut2 = true;
|
|
50502
50569
|
break;
|
|
50503
50570
|
}
|
|
50504
50571
|
if (!Number.isInteger(a.n) || a.n < 1 || a.n > MAX_RECORD_ATTEMPTS || typeof a.outcome !== "string" || a.outcome.length === 0) {
|
|
50505
|
-
|
|
50572
|
+
cut2 = true;
|
|
50506
50573
|
continue;
|
|
50507
50574
|
}
|
|
50508
50575
|
const reason = typeof a.reason === "string" ? a.reason.slice(0, MAX_STATUS_KEY_CHARS) : "";
|
|
@@ -50552,7 +50619,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50552
50619
|
...phases.length > 0 ? { phases } : {},
|
|
50553
50620
|
...healed ? { heal: healed } : {},
|
|
50554
50621
|
reasoning,
|
|
50555
|
-
...
|
|
50622
|
+
...cut2 ? { truncated: true } : {}
|
|
50556
50623
|
};
|
|
50557
50624
|
}
|
|
50558
50625
|
|
|
@@ -50708,8 +50775,8 @@ function pythonImports(file, text3, ix) {
|
|
|
50708
50775
|
const joined = rest ? import_node_path20.posix.join(base, rest.replace(/\./g, "/")) : base;
|
|
50709
50776
|
return [`${joined}.py`, `${joined}/__init__.py`].filter((p) => ix.set.has(p) && p !== file);
|
|
50710
50777
|
};
|
|
50711
|
-
for (const
|
|
50712
|
-
const from = /^[ \t]*from[ \t]+(\.*)([\w.]*)[ \t]+import[ \t]+(.+?)\s*$/.exec(
|
|
50778
|
+
for (const line2 of text3.split("\n")) {
|
|
50779
|
+
const from = /^[ \t]*from[ \t]+(\.*)([\w.]*)[ \t]+import[ \t]+(.+?)\s*$/.exec(line2);
|
|
50713
50780
|
if (from) {
|
|
50714
50781
|
const dots = from[1].length;
|
|
50715
50782
|
const mod = from[2];
|
|
@@ -50723,7 +50790,7 @@ function pythonImports(file, text3, ix) {
|
|
|
50723
50790
|
}
|
|
50724
50791
|
continue;
|
|
50725
50792
|
}
|
|
50726
|
-
const imp = /^[ \t]*import[ \t]+(.+?)\s*$/.exec(
|
|
50793
|
+
const imp = /^[ \t]*import[ \t]+(.+?)\s*$/.exec(line2);
|
|
50727
50794
|
if (imp) {
|
|
50728
50795
|
for (const part of imp[1].split(",")) {
|
|
50729
50796
|
const mod = part.trim().split(/\s+as\s+/)[0].trim();
|
|
@@ -50939,8 +51006,8 @@ function pairedTestPaths(codePath, listing, isTest = isTestTarget) {
|
|
|
50939
51006
|
const stem = m[1].toLowerCase();
|
|
50940
51007
|
const dir = dirOf2(codePath);
|
|
50941
51008
|
const parent = parentOf(dir);
|
|
50942
|
-
const
|
|
50943
|
-
const homes = /* @__PURE__ */ new Set([dir,
|
|
51009
|
+
const join18 = (d, leaf) => d === "" ? leaf : `${d}/${leaf}`;
|
|
51010
|
+
const homes = /* @__PURE__ */ new Set([dir, join18(dir, "__tests__"), join18(parent, "__tests__"), join18(parent, "tests"), join18(parent, "test")]);
|
|
50944
51011
|
const found = [];
|
|
50945
51012
|
for (const path of listing) {
|
|
50946
51013
|
if (!homes.has(dirOf2(path))) continue;
|
|
@@ -51320,7 +51387,7 @@ function buildCodegenLoopArgs(p, context = collectLoopContext({
|
|
|
51320
51387
|
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.tools2?.notes === true && p.conflicts && p.fixFirst === true && p.runScratch ? { runScratch: p.runScratch } : {},
|
|
51321
51388
|
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.tools2?.notes === true && p.conflicts && p.featureTestUpdates === true ? { featureTestUpdates: true } : {},
|
|
51322
51389
|
// QUIKTR-2445: the harness only (the loop decides where the key is in effect).
|
|
51323
|
-
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.databaseChange && p.databaseChange.length > 0 ? { databaseChange: { parts: p.databaseChange } } : {},
|
|
51390
|
+
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.databaseChange && p.databaseChange.length > 0 ? { databaseChange: { parts: p.databaseChange, ...p.databaseNames ? { names: p.databaseNames } : {} } } : {},
|
|
51324
51391
|
// An approved test change stands whatever version the AI Runtime speaks: a person decided it.
|
|
51325
51392
|
...p.approved && p.approved.length > 0 ? { approved: p.approved.map((r) => ({ targetPath: r.targetPath, newContent: r.newContent })) } : {}
|
|
51326
51393
|
};
|
|
@@ -51987,13 +52054,13 @@ var CALL_LINE_RE = /fetch\s*\(|\baxios\b|(?:\$|\bjQuery)\.(?:ajax|get|post|getJS
|
|
|
51987
52054
|
var NO_PATH = "(this file's route)";
|
|
51988
52055
|
function detectMentions(text3) {
|
|
51989
52056
|
const found = [];
|
|
51990
|
-
for (const
|
|
51991
|
-
const methodMatch = ROUTE_METHOD_RE.exec(
|
|
51992
|
-
const pathMatch = ROUTE_PATH_RE.exec(
|
|
51993
|
-
if (methodMatch && pathMatch && !CALL_LINE_RE.test(
|
|
52057
|
+
for (const line2 of text3.split("\n")) {
|
|
52058
|
+
const methodMatch = ROUTE_METHOD_RE.exec(line2);
|
|
52059
|
+
const pathMatch = ROUTE_PATH_RE.exec(line2);
|
|
52060
|
+
if (methodMatch && pathMatch && !CALL_LINE_RE.test(line2)) {
|
|
51994
52061
|
found.push({ method: methodMatch[1].toUpperCase(), path: pathMatch[0].replace(/:+$/, "") });
|
|
51995
52062
|
}
|
|
51996
|
-
const exportMatch = ROUTE_EXPORT_RE.exec(
|
|
52063
|
+
const exportMatch = ROUTE_EXPORT_RE.exec(line2);
|
|
51997
52064
|
if (exportMatch) {
|
|
51998
52065
|
found.push({ method: exportMatch[1].toUpperCase(), path: NO_PATH });
|
|
51999
52066
|
}
|
|
@@ -52012,9 +52079,9 @@ function surfaceCovers(surface, mention) {
|
|
|
52012
52079
|
}
|
|
52013
52080
|
function addedLines(before, after) {
|
|
52014
52081
|
const beforeLines = new Set(before.split("\n"));
|
|
52015
|
-
return after.split("\n").filter((
|
|
52082
|
+
return after.split("\n").filter((line2) => !beforeLines.has(line2)).join("\n");
|
|
52016
52083
|
}
|
|
52017
|
-
function checkApiScope(results, targets, apiChanges) {
|
|
52084
|
+
function checkApiScope(results, targets, apiChanges, existing) {
|
|
52018
52085
|
const targetsByPath = new Map(targets.map((t) => [t.path, t]));
|
|
52019
52086
|
const violations = [];
|
|
52020
52087
|
for (const { targetPath, newContent } of results) {
|
|
@@ -52035,6 +52102,7 @@ function checkApiScope(results, targets, apiChanges) {
|
|
|
52035
52102
|
}
|
|
52036
52103
|
for (const mention of detectMentions(scanned)) {
|
|
52037
52104
|
if (!apiChanges.some((c) => surfaceCovers(c.surface, mention))) {
|
|
52105
|
+
if (existing && mention.path !== NO_PATH && existing.has(mention)) continue;
|
|
52038
52106
|
violations.push({ file: targetPath, method: mention.method, path: mention.path });
|
|
52039
52107
|
}
|
|
52040
52108
|
}
|
|
@@ -52517,8 +52585,8 @@ function approvedTestsFailing(input) {
|
|
|
52517
52585
|
const examples = [];
|
|
52518
52586
|
for (const id of failingIds) {
|
|
52519
52587
|
if (examples.length >= MAX_MISFIT_EXAMPLES) break;
|
|
52520
|
-
const
|
|
52521
|
-
if (
|
|
52588
|
+
const line2 = firstLine(input.check.failureText.get(id) ?? "", void 0, MAX_MISFIT_EXAMPLE_CHARS);
|
|
52589
|
+
if (line2 && !examples.includes(line2)) examples.push(line2);
|
|
52522
52590
|
}
|
|
52523
52591
|
out2.push({ path: d.path, testTitle: d.testTitle, caseId: d.caseId, failingIds, failingRows, totalRows, examples });
|
|
52524
52592
|
}
|
|
@@ -52559,6 +52627,46 @@ function exitCodeFailedMessage() {
|
|
|
52559
52627
|
}
|
|
52560
52628
|
var EXIT_CODE_ONLY_NOTE = "The change was checked by the Test command's result only: it passed before and after the change, but no test report was found, so QuikPilot could not see individual tests or confirm that its new tests ran.";
|
|
52561
52629
|
|
|
52630
|
+
// src/existingRoutes.ts
|
|
52631
|
+
var import_node_child_process10 = require("node:child_process");
|
|
52632
|
+
var GREP_TIMEOUT_MS = 1e4;
|
|
52633
|
+
var MAX_HIT_LINES = 400;
|
|
52634
|
+
var MAX_OUTPUT_BYTES = 4e6;
|
|
52635
|
+
function anchorOf(path) {
|
|
52636
|
+
const pieces = path.split(/:[A-Za-z0-9_]+|\{[^}]+\}|\[[^\]]+\]/).filter((p) => p.length > 0);
|
|
52637
|
+
return pieces.sort((a, b) => b.length - a.length)[0] ?? "";
|
|
52638
|
+
}
|
|
52639
|
+
function routeAlreadyNamed(cwd, mention) {
|
|
52640
|
+
if (mention.path === NO_PATH) return false;
|
|
52641
|
+
const anchor = anchorOf(mention.path);
|
|
52642
|
+
if (anchor.length < 3) return false;
|
|
52643
|
+
const wanted = normalizePath(mention.path);
|
|
52644
|
+
let out2;
|
|
52645
|
+
try {
|
|
52646
|
+
out2 = (0, import_node_child_process10.execFileSync)("git", ["grep", "-I", "-n", "-F", "-e", anchor], {
|
|
52647
|
+
cwd,
|
|
52648
|
+
encoding: "utf8",
|
|
52649
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
52650
|
+
timeout: GREP_TIMEOUT_MS,
|
|
52651
|
+
maxBuffer: MAX_OUTPUT_BYTES
|
|
52652
|
+
});
|
|
52653
|
+
} catch {
|
|
52654
|
+
return false;
|
|
52655
|
+
}
|
|
52656
|
+
let seen = 0;
|
|
52657
|
+
for (const hit of out2.split("\n")) {
|
|
52658
|
+
if (hit === "") continue;
|
|
52659
|
+
if (++seen > MAX_HIT_LINES) return false;
|
|
52660
|
+
const m = /^(.*?):(\d+):(.*)$/.exec(hit);
|
|
52661
|
+
if (!m) continue;
|
|
52662
|
+
if (isTestFile(m[1])) continue;
|
|
52663
|
+
for (const found of detectMentions(m[3])) {
|
|
52664
|
+
if (found.path !== NO_PATH && found.method === mention.method && normalizePath(found.path) === wanted) return true;
|
|
52665
|
+
}
|
|
52666
|
+
}
|
|
52667
|
+
return false;
|
|
52668
|
+
}
|
|
52669
|
+
|
|
52562
52670
|
// src/testPlacementCheck.ts
|
|
52563
52671
|
function isDiscovered(targetPath, discoveredFiles) {
|
|
52564
52672
|
const normalized = targetPath.replace(/\\/g, "/");
|
|
@@ -52827,10 +52935,10 @@ function describeVanishedTests(vanished) {
|
|
|
52827
52935
|
var import_node_path24 = require("node:path");
|
|
52828
52936
|
|
|
52829
52937
|
// src/packageUse.ts
|
|
52830
|
-
var
|
|
52938
|
+
var import_node_child_process11 = require("node:child_process");
|
|
52831
52939
|
var PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
52832
52940
|
var FILE_TYPES = ["*.ts", "*.tsx", "*.js", "*.jsx", "*.mjs", "*.cjs", "*.mts", "*.cts"];
|
|
52833
|
-
var
|
|
52941
|
+
var GREP_TIMEOUT_MS2 = 1e4;
|
|
52834
52942
|
function importPattern(pkg) {
|
|
52835
52943
|
const escaped = pkg.replace(/[.]/g, "\\.");
|
|
52836
52944
|
return `(from|import|require)[[:space:]]*\\(?[[:space:]]*['"]${escaped}(/[^'"]*)?['"]`;
|
|
@@ -52839,10 +52947,10 @@ function packageImportedInWorkspace(pkg, root, cwd = process.cwd()) {
|
|
|
52839
52947
|
if (!PACKAGE_NAME.test(pkg)) return false;
|
|
52840
52948
|
const pathspecs = FILE_TYPES.map((type) => root ? `:(glob)${root}/**/${type}` : `:(glob)**/${type}`);
|
|
52841
52949
|
try {
|
|
52842
|
-
(0,
|
|
52950
|
+
(0, import_node_child_process11.execFileSync)("git", ["grep", "-q", "-E", "-e", importPattern(pkg), "--", ...pathspecs], {
|
|
52843
52951
|
cwd,
|
|
52844
52952
|
stdio: "ignore",
|
|
52845
|
-
timeout:
|
|
52953
|
+
timeout: GREP_TIMEOUT_MS2
|
|
52846
52954
|
});
|
|
52847
52955
|
return true;
|
|
52848
52956
|
} catch {
|
|
@@ -52897,7 +53005,13 @@ async function verifyChange(ctx, results, undoable) {
|
|
|
52897
53005
|
return fail(new Error(`QuikPilot's generated code imports packages this repository doesn't have \u2014 ${describeDependencyViolations(depCheck)}`));
|
|
52898
53006
|
}
|
|
52899
53007
|
stage = "scope";
|
|
52900
|
-
const scopeCheck = checkApiScope(results, targets, packet.design?.apiChanges ?? []
|
|
53008
|
+
const scopeCheck = checkApiScope(results, targets, packet.design?.apiChanges ?? [], {
|
|
53009
|
+
has: (mention) => {
|
|
53010
|
+
const named2 = routeAlreadyNamed(cwd, mention);
|
|
53011
|
+
if (named2) console.log(JSON.stringify({ event: "scope.existing_route", method: mention.method, path: mention.path }));
|
|
53012
|
+
return named2;
|
|
53013
|
+
}
|
|
53014
|
+
});
|
|
52901
53015
|
if (scopeCheck.blocked) {
|
|
52902
53016
|
return fail(new Error(`QuikPilot's generated code exceeds the approved design \u2014 ${describeScopeViolations(scopeCheck)}`));
|
|
52903
53017
|
}
|
|
@@ -53044,7 +53158,7 @@ ${violations.join("\n")}`);
|
|
|
53044
53158
|
}
|
|
53045
53159
|
|
|
53046
53160
|
// src/run.ts
|
|
53047
|
-
var
|
|
53161
|
+
var import_node_fs28 = require("node:fs");
|
|
53048
53162
|
|
|
53049
53163
|
// src/mapMode.ts
|
|
53050
53164
|
var MAP_ENV = "QUIKPILOT_MAP";
|
|
@@ -53117,9 +53231,9 @@ var cap = (s) => s.length <= MAX_ENTRY_CHARS ? s : `${s.slice(0, MAX_ENTRY_CHARS
|
|
|
53117
53231
|
var parentOf2 = (d) => d.includes("/") ? d.slice(0, d.lastIndexOf("/")) : "";
|
|
53118
53232
|
function clip5(text3, max) {
|
|
53119
53233
|
if (text3.length <= max) return { text: text3, truncated: false };
|
|
53120
|
-
const
|
|
53121
|
-
const nl =
|
|
53122
|
-
return { text: nl > max / 2 ?
|
|
53234
|
+
const cut2 = text3.slice(0, max);
|
|
53235
|
+
const nl = cut2.lastIndexOf("\n");
|
|
53236
|
+
return { text: nl > max / 2 ? cut2.slice(0, nl) : cut2, truncated: true };
|
|
53123
53237
|
}
|
|
53124
53238
|
function guidanceFiles(i3, perFile2, total) {
|
|
53125
53239
|
const tracked = new Set(i3.fullListing);
|
|
@@ -53282,18 +53396,18 @@ function pnpmWorkspacePatterns(text3) {
|
|
|
53282
53396
|
const out2 = [];
|
|
53283
53397
|
let inPackages = false;
|
|
53284
53398
|
for (const raw of text3.replace(/\r\n/g, "\n").split("\n")) {
|
|
53285
|
-
const
|
|
53286
|
-
if (/^packages\s*:/.test(
|
|
53399
|
+
const line2 = raw.replace(/\s+#.*$/, "");
|
|
53400
|
+
if (/^packages\s*:/.test(line2)) {
|
|
53287
53401
|
inPackages = true;
|
|
53288
53402
|
continue;
|
|
53289
53403
|
}
|
|
53290
53404
|
if (!inPackages) continue;
|
|
53291
|
-
const item = /^\s+-\s+(.+?)\s*$/.exec(
|
|
53405
|
+
const item = /^\s+-\s+(.+?)\s*$/.exec(line2);
|
|
53292
53406
|
if (item) {
|
|
53293
53407
|
out2.push(item[1].replace(/^["']|["']$/g, ""));
|
|
53294
53408
|
continue;
|
|
53295
53409
|
}
|
|
53296
|
-
if (
|
|
53410
|
+
if (line2.trim() !== "" && !/^\s/.test(line2)) inPackages = false;
|
|
53297
53411
|
}
|
|
53298
53412
|
return out2;
|
|
53299
53413
|
}
|
|
@@ -53611,14 +53725,14 @@ function writePhase0Marker(runId) {
|
|
|
53611
53725
|
}
|
|
53612
53726
|
|
|
53613
53727
|
// src/failureArtifact.ts
|
|
53614
|
-
var
|
|
53728
|
+
var import_node_child_process12 = require("node:child_process");
|
|
53615
53729
|
var import_node_fs25 = require("node:fs");
|
|
53616
53730
|
var import_node_path27 = require("node:path");
|
|
53617
53731
|
var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
53618
53732
|
var REPORT_COPY = "final-test-report.xml";
|
|
53619
53733
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
53620
53734
|
var MAX_FILES = 200;
|
|
53621
|
-
var RUNNER_VERSION = true ? "9.3.0-rc.
|
|
53735
|
+
var RUNNER_VERSION = true ? "9.3.0-rc.77" : "dev";
|
|
53622
53736
|
function safeDestination(base, repoPath) {
|
|
53623
53737
|
if (!repoPath || (0, import_node_path27.isAbsolute)(repoPath)) return null;
|
|
53624
53738
|
const destination = (0, import_node_path27.resolve)(base, repoPath);
|
|
@@ -53628,7 +53742,7 @@ function safeDestination(base, repoPath) {
|
|
|
53628
53742
|
}
|
|
53629
53743
|
var BUNDLE_FILE = "quikpilot-change.bundle";
|
|
53630
53744
|
function keepCommitBundle(repo, folder, branch) {
|
|
53631
|
-
const git3 = (args2) => (0,
|
|
53745
|
+
const git3 = (args2) => (0, import_node_child_process12.execFileSync)("git", args2, { cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
53632
53746
|
try {
|
|
53633
53747
|
if (git3(["rev-parse", "--abbrev-ref", "HEAD"]) !== branch) return null;
|
|
53634
53748
|
if (git3(["diff", "--name-only", "HEAD~1", "HEAD"]) === "") return null;
|
|
@@ -53700,12 +53814,12 @@ function writeFailureArtifact(input) {
|
|
|
53700
53814
|
}
|
|
53701
53815
|
|
|
53702
53816
|
// src/finalChange.ts
|
|
53703
|
-
var
|
|
53817
|
+
var import_node_child_process13 = require("node:child_process");
|
|
53704
53818
|
var import_node_fs26 = require("node:fs");
|
|
53705
53819
|
var import_node_path28 = require("node:path");
|
|
53706
53820
|
function changesAgainstBase(root, wanted) {
|
|
53707
53821
|
if (wanted.size === 0) return [];
|
|
53708
|
-
const status = (0,
|
|
53822
|
+
const status = (0, import_node_child_process13.execFileSync)("git", ["status", "--porcelain", "-z", "--untracked-files=all", "--no-renames"], {
|
|
53709
53823
|
cwd: root,
|
|
53710
53824
|
encoding: "utf8",
|
|
53711
53825
|
maxBuffer: 64 * 1024 * 1024
|
|
@@ -53723,6 +53837,108 @@ function changesAgainstBase(root, wanted) {
|
|
|
53723
53837
|
});
|
|
53724
53838
|
}
|
|
53725
53839
|
|
|
53840
|
+
// src/nameEvidence.ts
|
|
53841
|
+
var import_node_child_process14 = require("node:child_process");
|
|
53842
|
+
var import_node_fs27 = require("node:fs");
|
|
53843
|
+
var import_node_path29 = require("node:path");
|
|
53844
|
+
|
|
53845
|
+
// src/migrationNames.ts
|
|
53846
|
+
var PART = String.raw`(?:"[^"]+"|\x60[^\x60]+\x60|\[[^\]]+\]|[\w$]+)`;
|
|
53847
|
+
var IDENT4 = `${PART}(?:\\s*\\.\\s*${PART}){0,2}`;
|
|
53848
|
+
var ALTER = new RegExp(String.raw`\bALTER\s+TABLE\s+(?:IF\s+EXISTS\s+)?(?:ONLY\s+)?(${IDENT4})`, "gi");
|
|
53849
|
+
var CREATE = new RegExp(String.raw`\bCREATE\s+(?:(?:GLOBAL\s+|LOCAL\s+)?(?:TEMP(?:ORARY)?|UNLOGGED)\s+)?TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(${IDENT4})`, "gi");
|
|
53850
|
+
var INDEX = new RegExp(String.raw`\bCREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:CONCURRENTLY\s+)?(?:IF\s+NOT\s+EXISTS\s+)?(?:${IDENT4}\s+)?ON\s+(?:ONLY\s+)?(${IDENT4})`, "gi");
|
|
53851
|
+
var REFERENCES = new RegExp(String.raw`\bREFERENCES\s+(${IDENT4})`, "gi");
|
|
53852
|
+
var INSERT = new RegExp(String.raw`\bINSERT\s+INTO\s+(${IDENT4})`, "gi");
|
|
53853
|
+
var MAX_LABEL_CHARS = 60;
|
|
53854
|
+
function withoutComments(sql) {
|
|
53855
|
+
return sql.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/--[^\n]*/g, " ");
|
|
53856
|
+
}
|
|
53857
|
+
function parse6(raw) {
|
|
53858
|
+
const parts2 = [...raw.matchAll(new RegExp(PART, "g"))].map((m) => {
|
|
53859
|
+
const p = m[0];
|
|
53860
|
+
return /^["\x60\[]/.test(p) ? p.slice(1, -1) : p;
|
|
53861
|
+
});
|
|
53862
|
+
const table = parts2.at(-1);
|
|
53863
|
+
if (!table) return null;
|
|
53864
|
+
const schema = parts2.length >= 2 ? parts2.at(-2) : void 0;
|
|
53865
|
+
return schema ? { schema, table } : { table };
|
|
53866
|
+
}
|
|
53867
|
+
function namesOf2(re, sql) {
|
|
53868
|
+
return [...sql.matchAll(re)].flatMap((m) => {
|
|
53869
|
+
const n = parse6(m[1]);
|
|
53870
|
+
return n ? [n] : [];
|
|
53871
|
+
});
|
|
53872
|
+
}
|
|
53873
|
+
function tablesIn(migration) {
|
|
53874
|
+
const sql = withoutComments(migration);
|
|
53875
|
+
const created = new Set(namesOf2(CREATE, sql).map((n) => n.table));
|
|
53876
|
+
const seen = /* @__PURE__ */ new Set();
|
|
53877
|
+
const out2 = [];
|
|
53878
|
+
const referred = [...namesOf2(ALTER, sql), ...namesOf2(INDEX, sql), ...namesOf2(REFERENCES, sql), ...namesOf2(INSERT, sql)];
|
|
53879
|
+
const position = (n) => {
|
|
53880
|
+
const at2 = sql.indexOf(n.table);
|
|
53881
|
+
return at2 < 0 ? Number.MAX_SAFE_INTEGER : at2;
|
|
53882
|
+
};
|
|
53883
|
+
for (const name2 of referred.sort((a, b) => position(a) - position(b))) {
|
|
53884
|
+
if (created.has(name2.table)) continue;
|
|
53885
|
+
const key = `${name2.schema ?? ""}\0${name2.table}`;
|
|
53886
|
+
if (seen.has(key)) continue;
|
|
53887
|
+
seen.add(key);
|
|
53888
|
+
out2.push(name2);
|
|
53889
|
+
}
|
|
53890
|
+
return out2;
|
|
53891
|
+
}
|
|
53892
|
+
function nameLabel(name2) {
|
|
53893
|
+
const clean = (s) => s.replace(/[^\w$.\-]/g, "_");
|
|
53894
|
+
const label = name2.schema ? `${clean(name2.schema)}.${clean(name2.table)}` : clean(name2.table);
|
|
53895
|
+
return label.length > MAX_LABEL_CHARS ? label.slice(0, MAX_LABEL_CHARS) : label;
|
|
53896
|
+
}
|
|
53897
|
+
|
|
53898
|
+
// src/nameEvidence.ts
|
|
53899
|
+
var GREP_TIMEOUT_MS3 = 1e4;
|
|
53900
|
+
var MAX_FILES2 = 200;
|
|
53901
|
+
var MAX_FILE_BYTES2 = 2e6;
|
|
53902
|
+
var DOC_FILE = /\.(?:md|mdx|markdown|txt|rst|adoc|docx?)$/i;
|
|
53903
|
+
var escapeRegExp5 = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
53904
|
+
function filesNaming(word, ev, readable, denied) {
|
|
53905
|
+
let out2;
|
|
53906
|
+
try {
|
|
53907
|
+
out2 = (0, import_node_child_process14.execFileSync)("git", ["grep", "-l", "-I", "-w", "-F", "-e", word], {
|
|
53908
|
+
cwd: ev.cwd,
|
|
53909
|
+
encoding: "utf8",
|
|
53910
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
53911
|
+
timeout: GREP_TIMEOUT_MS3,
|
|
53912
|
+
maxBuffer: 4e6
|
|
53913
|
+
});
|
|
53914
|
+
} catch {
|
|
53915
|
+
return [];
|
|
53916
|
+
}
|
|
53917
|
+
return out2.split("\n").filter((f) => f !== "" && f !== DATABASE_CHANGE_PATH && !DOC_FILE.test(f) && (readable === null || readable.has(f)) && matchesDeniedPath(f, denied) === null).slice(0, MAX_FILES2);
|
|
53918
|
+
}
|
|
53919
|
+
function fileHasWord(cwd, file, word) {
|
|
53920
|
+
try {
|
|
53921
|
+
const path = (0, import_node_path29.join)(cwd, file);
|
|
53922
|
+
if ((0, import_node_fs27.statSync)(path).size > MAX_FILE_BYTES2) return false;
|
|
53923
|
+
return new RegExp(`(?<![\\w$])${escapeRegExp5(word)}(?![\\w$])`).test((0, import_node_fs27.readFileSync)(path, "utf8"));
|
|
53924
|
+
} catch {
|
|
53925
|
+
return false;
|
|
53926
|
+
}
|
|
53927
|
+
}
|
|
53928
|
+
function unfoundNames(names, ev) {
|
|
53929
|
+
const denied = readDenied(ev.deniedPaths);
|
|
53930
|
+
const readable = ev.readable ? new Set(ev.readable) : null;
|
|
53931
|
+
return names.filter((name2) => {
|
|
53932
|
+
const files = filesNaming(name2.table, ev, readable, denied);
|
|
53933
|
+
if (files.length === 0) return true;
|
|
53934
|
+
if (!name2.schema) return false;
|
|
53935
|
+
return !files.some((f) => fileHasWord(ev.cwd, f, name2.schema));
|
|
53936
|
+
});
|
|
53937
|
+
}
|
|
53938
|
+
function makeNameChecker(ev) {
|
|
53939
|
+
return (migration) => unfoundNames(tablesIn(migration), ev).map(nameLabel);
|
|
53940
|
+
}
|
|
53941
|
+
|
|
53726
53942
|
// src/testDiscovery.ts
|
|
53727
53943
|
var ABSENT = { report: "ABSENT" };
|
|
53728
53944
|
var DRIVE_RE = /^[A-Za-z]:\//;
|
|
@@ -54138,33 +54354,33 @@ var MAX_REASON_CHARS3 = 300;
|
|
|
54138
54354
|
var MAX_LOOP_READS = 50;
|
|
54139
54355
|
var MAX_FALLBACK_REASON_CHARS = 40;
|
|
54140
54356
|
function clampList(values, max, maxChars) {
|
|
54141
|
-
let
|
|
54357
|
+
let cut2 = false;
|
|
54142
54358
|
const kept = [];
|
|
54143
54359
|
for (const raw of values ?? []) {
|
|
54144
54360
|
const v = typeof raw === "string" ? raw.trim() : "";
|
|
54145
54361
|
if (v.length === 0) continue;
|
|
54146
54362
|
if (v.length > maxChars || kept.length >= max) {
|
|
54147
|
-
|
|
54363
|
+
cut2 = true;
|
|
54148
54364
|
continue;
|
|
54149
54365
|
}
|
|
54150
54366
|
kept.push(v);
|
|
54151
54367
|
}
|
|
54152
|
-
return { kept, cut };
|
|
54368
|
+
return { kept, cut: cut2 };
|
|
54153
54369
|
}
|
|
54154
54370
|
function wholeNumber2(n) {
|
|
54155
54371
|
return typeof n === "number" && Number.isInteger(n) && n >= 0 ? n : 0;
|
|
54156
54372
|
}
|
|
54157
54373
|
function clampLoop(loop) {
|
|
54158
|
-
let
|
|
54374
|
+
let cut2 = false;
|
|
54159
54375
|
const reads = [];
|
|
54160
54376
|
for (const r of loop.reads ?? []) {
|
|
54161
54377
|
if (reads.length >= MAX_LOOP_READS) {
|
|
54162
|
-
|
|
54378
|
+
cut2 = true;
|
|
54163
54379
|
break;
|
|
54164
54380
|
}
|
|
54165
54381
|
const path = typeof r.path === "string" ? r.path.trim() : "";
|
|
54166
54382
|
if (path.length === 0 || path.length > MAX_PATH_CHARS5) {
|
|
54167
|
-
|
|
54383
|
+
cut2 = true;
|
|
54168
54384
|
continue;
|
|
54169
54385
|
}
|
|
54170
54386
|
reads.push({
|
|
@@ -54176,7 +54392,7 @@ function clampLoop(loop) {
|
|
|
54176
54392
|
});
|
|
54177
54393
|
}
|
|
54178
54394
|
const refusedTurns = clampRefusedTurns(loop.refusedTurns);
|
|
54179
|
-
if (refusedTurns.cut)
|
|
54395
|
+
if (refusedTurns.cut) cut2 = true;
|
|
54180
54396
|
return {
|
|
54181
54397
|
turns: wholeNumber2(loop.turns),
|
|
54182
54398
|
toolCalls: wholeNumber2(loop.toolCalls),
|
|
@@ -54192,13 +54408,13 @@ function clampLoop(loop) {
|
|
|
54192
54408
|
...clampTotals(loop.usage) ? { usage: clampTotals(loop.usage) } : {},
|
|
54193
54409
|
reads,
|
|
54194
54410
|
...refusedTurns.rows.length > 0 ? { refusedTurns: refusedTurns.rows } : {},
|
|
54195
|
-
...
|
|
54411
|
+
...cut2 ? { truncated: true } : {}
|
|
54196
54412
|
};
|
|
54197
54413
|
}
|
|
54198
54414
|
function buildTargetingRecord(targeting, contextLog) {
|
|
54199
54415
|
let truncated = false;
|
|
54200
|
-
const note = (
|
|
54201
|
-
if (
|
|
54416
|
+
const note = (cut2) => {
|
|
54417
|
+
if (cut2) truncated = true;
|
|
54202
54418
|
};
|
|
54203
54419
|
if (targeting.outcome === "NO_TARGET") {
|
|
54204
54420
|
const record3 = { outcome: "NO_TARGET", targets: [], skippedCaseIds: [], codegenContext: [] };
|
|
@@ -54352,7 +54568,7 @@ async function run2(env2) {
|
|
|
54352
54568
|
await preloadLanguages(workspaceListing);
|
|
54353
54569
|
const readCheckoutText2 = (path) => {
|
|
54354
54570
|
try {
|
|
54355
|
-
return (0,
|
|
54571
|
+
return (0, import_node_fs28.readFileSync)(path, "utf8");
|
|
54356
54572
|
} catch {
|
|
54357
54573
|
return null;
|
|
54358
54574
|
}
|
|
@@ -54487,7 +54703,7 @@ async function run2(env2) {
|
|
|
54487
54703
|
);
|
|
54488
54704
|
}
|
|
54489
54705
|
const codegenMode = mapMode ? "loop-tests" : resolveCodegenMode(process.env, packet.codegenMode);
|
|
54490
|
-
const noteTaken = workspaceListing.includes(DATABASE_CHANGE_PATH) || scope.readListing.includes(DATABASE_CHANGE_PATH) || (0,
|
|
54706
|
+
const noteTaken = workspaceListing.includes(DATABASE_CHANGE_PATH) || scope.readListing.includes(DATABASE_CHANGE_PATH) || (0, import_node_fs28.existsSync)(DATABASE_CHANGE_PATH);
|
|
54491
54707
|
const proposals = designParts.length > 0 && codegenMode === "loop-tests" && !noteTaken;
|
|
54492
54708
|
if (designParts.some((p) => p.kind === "stored") && codegenMode === "loop-tests" && noteTaken) console.log(JSON.stringify({ event: "database_change.off", reason: "note_path_taken" }));
|
|
54493
54709
|
if (designParts.length > 0) {
|
|
@@ -54569,7 +54785,7 @@ async function run2(env2) {
|
|
|
54569
54785
|
...twoPhase ? { twoPhase: true, ...packet.requiredTestTypes ? { requiredTestTypes: packet.requiredTestTypes } : {} } : {},
|
|
54570
54786
|
...redReview ? { redReview: true } : {},
|
|
54571
54787
|
...codeParts.length > 0 ? { parts: codeParts } : {},
|
|
54572
|
-
...dbParts.length > 0 ? { databaseChange: dbParts } : {},
|
|
54788
|
+
...dbParts.length > 0 ? { databaseChange: dbParts, databaseNames: makeNameChecker({ cwd: process.cwd(), deniedPaths: packet.guardrails.deniedPaths, readable: scope.readListing }) } : {},
|
|
54573
54789
|
tests: {
|
|
54574
54790
|
root: process.cwd(),
|
|
54575
54791
|
command: packet.commands.test,
|
|
@@ -54760,7 +54976,8 @@ async function run2(env2) {
|
|
|
54760
54976
|
flagged: databaseChange.flagged,
|
|
54761
54977
|
schemaFileIncluded: databaseChange.schemaFileIncluded,
|
|
54762
54978
|
migrationFileIncluded: databaseChange.migrationFileIncluded,
|
|
54763
|
-
schemaFileSeen: databaseChange.schemaFileSeen
|
|
54979
|
+
schemaFileSeen: databaseChange.schemaFileSeen,
|
|
54980
|
+
namesUnchecked: databaseChange.namesUnchecked?.length ?? 0
|
|
54764
54981
|
})
|
|
54765
54982
|
);
|
|
54766
54983
|
}
|
|
@@ -54943,7 +55160,7 @@ async function runReadinessCheck(env2) {
|
|
|
54943
55160
|
// src/investigateFindings.ts
|
|
54944
55161
|
var VERDICTS = ["PRESENT", "NOT_PRESENT", "CANNOT_TELL", "NEW_BEHAVIOUR"];
|
|
54945
55162
|
var ROLES = ["entry_point", "faulty_function", "caller", "helper", "test", "other"];
|
|
54946
|
-
var
|
|
55163
|
+
var MAX_FILES3 = 12;
|
|
54947
55164
|
var MAX_CALL_PATH = 10;
|
|
54948
55165
|
var MAX_EVIDENCE = 8;
|
|
54949
55166
|
var MAX_SEARCHES = 5;
|
|
@@ -55056,7 +55273,7 @@ function verifyFindings(raw, ledger, ctx) {
|
|
|
55056
55273
|
dropped.files += 1;
|
|
55057
55274
|
continue;
|
|
55058
55275
|
}
|
|
55059
|
-
if (files.length >=
|
|
55276
|
+
if (files.length >= MAX_FILES3) continue;
|
|
55060
55277
|
const role = ROLES.includes(f.role) ? f.role : "other";
|
|
55061
55278
|
files.push({ path: f.path, role, symbols: symbolsOf(f.path, f.symbols) });
|
|
55062
55279
|
}
|