truecourse 0.7.0-next.8 → 0.7.0-next.9
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/cli.mjs +843 -588
- package/package.json +1 -1
- package/public/assets/index-B2b9Ua5r.css +1 -0
- package/public/assets/{index-D7hFPhQQ.js → index-T8VBc6FT.js} +213 -213
- package/public/index.html +2 -2
- package/roslyn-host/csharp-roslyn-host.dll +0 -0
- package/roslyn-host/csharp-roslyn-host.pdb +0 -0
- package/server.mjs +1078 -767
- package/public/assets/index-CMCPeAwv.css +0 -1
package/server.mjs
CHANGED
|
@@ -109,8 +109,8 @@ var require_package = __commonJS({
|
|
|
109
109
|
// node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js
|
|
110
110
|
var require_main = __commonJS({
|
|
111
111
|
"node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js"(exports, module) {
|
|
112
|
-
var
|
|
113
|
-
var
|
|
112
|
+
var fs68 = __require("fs");
|
|
113
|
+
var path75 = __require("path");
|
|
114
114
|
var os10 = __require("os");
|
|
115
115
|
var crypto6 = __require("crypto");
|
|
116
116
|
var packageJson = require_package();
|
|
@@ -218,7 +218,7 @@ var require_main = __commonJS({
|
|
|
218
218
|
if (options && options.path && options.path.length > 0) {
|
|
219
219
|
if (Array.isArray(options.path)) {
|
|
220
220
|
for (const filepath of options.path) {
|
|
221
|
-
if (
|
|
221
|
+
if (fs68.existsSync(filepath)) {
|
|
222
222
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
@@ -226,15 +226,15 @@ var require_main = __commonJS({
|
|
|
226
226
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
227
227
|
}
|
|
228
228
|
} else {
|
|
229
|
-
possibleVaultPath =
|
|
229
|
+
possibleVaultPath = path75.resolve(process.cwd(), ".env.vault");
|
|
230
230
|
}
|
|
231
|
-
if (
|
|
231
|
+
if (fs68.existsSync(possibleVaultPath)) {
|
|
232
232
|
return possibleVaultPath;
|
|
233
233
|
}
|
|
234
234
|
return null;
|
|
235
235
|
}
|
|
236
236
|
function _resolveHome(envPath) {
|
|
237
|
-
return envPath[0] === "~" ?
|
|
237
|
+
return envPath[0] === "~" ? path75.join(os10.homedir(), envPath.slice(1)) : envPath;
|
|
238
238
|
}
|
|
239
239
|
function _configVault(options) {
|
|
240
240
|
const debug2 = Boolean(options && options.debug);
|
|
@@ -251,7 +251,7 @@ var require_main = __commonJS({
|
|
|
251
251
|
return { parsed };
|
|
252
252
|
}
|
|
253
253
|
function configDotenv(options) {
|
|
254
|
-
const dotenvPath =
|
|
254
|
+
const dotenvPath = path75.resolve(process.cwd(), ".env");
|
|
255
255
|
let encoding = "utf8";
|
|
256
256
|
const debug2 = Boolean(options && options.debug);
|
|
257
257
|
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
@@ -275,13 +275,13 @@ var require_main = __commonJS({
|
|
|
275
275
|
}
|
|
276
276
|
let lastError;
|
|
277
277
|
const parsedAll = {};
|
|
278
|
-
for (const
|
|
278
|
+
for (const path76 of optionPaths) {
|
|
279
279
|
try {
|
|
280
|
-
const parsed = DotenvModule.parse(
|
|
280
|
+
const parsed = DotenvModule.parse(fs68.readFileSync(path76, { encoding }));
|
|
281
281
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
282
282
|
} catch (e) {
|
|
283
283
|
if (debug2) {
|
|
284
|
-
_debug(`Failed to load ${
|
|
284
|
+
_debug(`Failed to load ${path76} ${e.message}`);
|
|
285
285
|
}
|
|
286
286
|
lastError = e;
|
|
287
287
|
}
|
|
@@ -296,7 +296,7 @@ var require_main = __commonJS({
|
|
|
296
296
|
const shortPaths = [];
|
|
297
297
|
for (const filePath of optionPaths) {
|
|
298
298
|
try {
|
|
299
|
-
const relative2 =
|
|
299
|
+
const relative2 = path75.relative(process.cwd(), filePath);
|
|
300
300
|
shortPaths.push(relative2);
|
|
301
301
|
} catch (e) {
|
|
302
302
|
if (debug2) {
|
|
@@ -9509,11 +9509,11 @@ var require_mime_types = __commonJS({
|
|
|
9509
9509
|
}
|
|
9510
9510
|
return exts[0];
|
|
9511
9511
|
}
|
|
9512
|
-
function lookup(
|
|
9513
|
-
if (!
|
|
9512
|
+
function lookup(path75) {
|
|
9513
|
+
if (!path75 || typeof path75 !== "string") {
|
|
9514
9514
|
return false;
|
|
9515
9515
|
}
|
|
9516
|
-
var extension2 = extname("x." +
|
|
9516
|
+
var extension2 = extname("x." + path75).toLowerCase().substr(1);
|
|
9517
9517
|
if (!extension2) {
|
|
9518
9518
|
return false;
|
|
9519
9519
|
}
|
|
@@ -16491,11 +16491,11 @@ var require_server = __commonJS({
|
|
|
16491
16491
|
* @protected
|
|
16492
16492
|
*/
|
|
16493
16493
|
_computePath(options) {
|
|
16494
|
-
let
|
|
16494
|
+
let path75 = (options.path || "/engine.io").replace(/\/$/, "");
|
|
16495
16495
|
if (options.addTrailingSlash !== false) {
|
|
16496
|
-
|
|
16496
|
+
path75 += "/";
|
|
16497
16497
|
}
|
|
16498
|
-
return
|
|
16498
|
+
return path75;
|
|
16499
16499
|
}
|
|
16500
16500
|
/**
|
|
16501
16501
|
* Returns a list of available transports for upgrade given a certain transport.
|
|
@@ -16994,10 +16994,10 @@ var require_server = __commonJS({
|
|
|
16994
16994
|
* @param {Object} options
|
|
16995
16995
|
*/
|
|
16996
16996
|
attach(server, options = {}) {
|
|
16997
|
-
const
|
|
16997
|
+
const path75 = this._computePath(options);
|
|
16998
16998
|
const destroyUpgradeTimeout = options.destroyUpgradeTimeout || 1e3;
|
|
16999
16999
|
function check(req) {
|
|
17000
|
-
return
|
|
17000
|
+
return path75 === req.url.slice(0, path75.length);
|
|
17001
17001
|
}
|
|
17002
17002
|
const listeners = server.listeners("request").slice(0);
|
|
17003
17003
|
server.removeAllListeners("request");
|
|
@@ -17005,7 +17005,7 @@ var require_server = __commonJS({
|
|
|
17005
17005
|
server.on("listening", this.init.bind(this));
|
|
17006
17006
|
server.on("request", (req, res) => {
|
|
17007
17007
|
if (check(req)) {
|
|
17008
|
-
debug2('intercepting request for path "%s"',
|
|
17008
|
+
debug2('intercepting request for path "%s"', path75);
|
|
17009
17009
|
this.handleRequest(req, res);
|
|
17010
17010
|
} else {
|
|
17011
17011
|
let i = 0;
|
|
@@ -17844,8 +17844,8 @@ var require_userver = __commonJS({
|
|
|
17844
17844
|
* @param options
|
|
17845
17845
|
*/
|
|
17846
17846
|
attach(app, options = {}) {
|
|
17847
|
-
const
|
|
17848
|
-
app.any(
|
|
17847
|
+
const path75 = this._computePath(options);
|
|
17848
|
+
app.any(path75, this.handleRequest.bind(this)).ws(path75, {
|
|
17849
17849
|
compression: options.compression,
|
|
17850
17850
|
idleTimeout: options.idleTimeout,
|
|
17851
17851
|
maxBackpressure: options.maxBackpressure,
|
|
@@ -22270,7 +22270,7 @@ var require_dist2 = __commonJS({
|
|
|
22270
22270
|
var zlib_1 = __require("zlib");
|
|
22271
22271
|
var accepts = require_accepts();
|
|
22272
22272
|
var stream_1 = __require("stream");
|
|
22273
|
-
var
|
|
22273
|
+
var path75 = __require("path");
|
|
22274
22274
|
var engine_io_1 = require_engine_io();
|
|
22275
22275
|
var client_1 = require_client();
|
|
22276
22276
|
var events_1 = __require("events");
|
|
@@ -22465,7 +22465,7 @@ var require_dist2 = __commonJS({
|
|
|
22465
22465
|
res.writeHeader("cache-control", "public, max-age=0");
|
|
22466
22466
|
res.writeHeader("content-type", "application/" + (isMap ? "json" : "javascript") + "; charset=utf-8");
|
|
22467
22467
|
res.writeHeader("etag", expectedEtag);
|
|
22468
|
-
const filepath =
|
|
22468
|
+
const filepath = path75.join(__dirname, "../client-dist/", filename);
|
|
22469
22469
|
(0, uws_1.serveFile)(res, filepath);
|
|
22470
22470
|
});
|
|
22471
22471
|
}
|
|
@@ -22547,7 +22547,7 @@ var require_dist2 = __commonJS({
|
|
|
22547
22547
|
* @private
|
|
22548
22548
|
*/
|
|
22549
22549
|
static sendFile(filename, req, res) {
|
|
22550
|
-
const readStream = (0, fs_1.createReadStream)(
|
|
22550
|
+
const readStream = (0, fs_1.createReadStream)(path75.join(__dirname, "../client-dist/", filename));
|
|
22551
22551
|
const encoding = accepts(req).encodings(["br", "gzip", "deflate"]);
|
|
22552
22552
|
const onError2 = (err) => {
|
|
22553
22553
|
if (err) {
|
|
@@ -23506,8 +23506,8 @@ var init_parseUtil = __esm({
|
|
|
23506
23506
|
init_errors();
|
|
23507
23507
|
init_en();
|
|
23508
23508
|
makeIssue = (params) => {
|
|
23509
|
-
const { data, path:
|
|
23510
|
-
const fullPath = [...
|
|
23509
|
+
const { data, path: path75, errorMaps, issueData } = params;
|
|
23510
|
+
const fullPath = [...path75, ...issueData.path || []];
|
|
23511
23511
|
const fullIssue = {
|
|
23512
23512
|
...issueData,
|
|
23513
23513
|
path: fullPath
|
|
@@ -23815,11 +23815,11 @@ var init_types = __esm({
|
|
|
23815
23815
|
init_parseUtil();
|
|
23816
23816
|
init_util();
|
|
23817
23817
|
ParseInputLazyPath = class {
|
|
23818
|
-
constructor(parent, value,
|
|
23818
|
+
constructor(parent, value, path75, key4) {
|
|
23819
23819
|
this._cachedPath = [];
|
|
23820
23820
|
this.parent = parent;
|
|
23821
23821
|
this.data = value;
|
|
23822
|
-
this._path =
|
|
23822
|
+
this._path = path75;
|
|
23823
23823
|
this._key = key4;
|
|
23824
23824
|
}
|
|
23825
23825
|
get path() {
|
|
@@ -28410,11 +28410,8 @@ var init_guard = __esm({
|
|
|
28410
28410
|
});
|
|
28411
28411
|
|
|
28412
28412
|
// packages/shared/dist/spec/overlap-resolution.js
|
|
28413
|
-
function
|
|
28414
|
-
return
|
|
28415
|
-
const samePair = r.older === a && r.newer === b || r.older === b && r.newer === a;
|
|
28416
|
-
return samePair && (r.scope === void 0 || areas.includes(r.scope));
|
|
28417
|
-
});
|
|
28413
|
+
function normalizeQuote(text4) {
|
|
28414
|
+
return text4.replace(/[`*_~]/g, "").toLowerCase().replace(/\s+/g, " ").trim();
|
|
28418
28415
|
}
|
|
28419
28416
|
function dedupeCrossAreaOverlaps(entries) {
|
|
28420
28417
|
const byPair = /* @__PURE__ */ new Map();
|
|
@@ -28488,9 +28485,23 @@ function dedupeCrossAreaOverlaps(entries) {
|
|
|
28488
28485
|
});
|
|
28489
28486
|
return merged;
|
|
28490
28487
|
}
|
|
28488
|
+
function resolutionMatchesConflict(r, a, b, sections) {
|
|
28489
|
+
if (!samePair(r.docA, r.docB, a, b))
|
|
28490
|
+
return false;
|
|
28491
|
+
const rSide = (doc) => doc === r.docA ? { anchor: r.anchorA, quote: r.quoteA } : { anchor: r.anchorB, quote: r.quoteB };
|
|
28492
|
+
const cSide = (doc) => (sections ?? []).find((s) => s.doc === doc);
|
|
28493
|
+
const bothHaveQuotes = !!r.quoteA && !!r.quoteB && !!cSide(a)?.quote && !!cSide(b)?.quote;
|
|
28494
|
+
if (bothHaveQuotes) {
|
|
28495
|
+
const quoteMatch = (doc) => normalizeQuote(rSide(doc).quote ?? "") === normalizeQuote(cSide(doc)?.quote ?? "");
|
|
28496
|
+
return quoteMatch(a) && quoteMatch(b);
|
|
28497
|
+
}
|
|
28498
|
+
const anchorMatch = (doc) => anchorKey(rSide(doc).anchor) === anchorKey(cSide(doc)?.heading);
|
|
28499
|
+
return anchorMatch(a) && anchorMatch(b);
|
|
28500
|
+
}
|
|
28501
|
+
function matchResolution(decisions, a, b, sections) {
|
|
28502
|
+
return (decisions.conflictResolutions ?? []).find((r) => resolutionMatchesConflict(r, a, b, sections));
|
|
28503
|
+
}
|
|
28491
28504
|
function buildCorpusConflicts(corpus, decisions) {
|
|
28492
|
-
const userRelations = decisions.relations ?? [];
|
|
28493
|
-
const effectiveRels = [...corpus.relations, ...userRelations];
|
|
28494
28505
|
const excludes = new Set(decisions.manualExcludes ?? []);
|
|
28495
28506
|
const entries = [];
|
|
28496
28507
|
for (const area of corpus.areas)
|
|
@@ -28500,43 +28511,39 @@ function buildCorpusConflicts(corpus, decisions) {
|
|
|
28500
28511
|
const flagged = [];
|
|
28501
28512
|
for (const m of mergedOverlaps) {
|
|
28502
28513
|
const [a, b] = m.overlap.docs;
|
|
28503
|
-
const
|
|
28504
|
-
const userRelation = coveringRelationInAreas(userRelations, a, b, m.areas);
|
|
28514
|
+
const sections = m.overlap.sections ? [...m.overlap.sections] : void 0;
|
|
28505
28515
|
const excludedRef = excludes.has(a) ? a : excludes.has(b) ? b : void 0;
|
|
28516
|
+
const resolution = matchResolution(decisions, a, b, sections);
|
|
28506
28517
|
flagged.push({
|
|
28507
28518
|
area: m.area,
|
|
28508
28519
|
areas: m.areas,
|
|
28509
28520
|
a,
|
|
28510
28521
|
b,
|
|
28511
28522
|
note: m.overlap.note ?? "",
|
|
28512
|
-
|
|
28513
|
-
|
|
28514
|
-
...
|
|
28515
|
-
...
|
|
28516
|
-
...excludedRef ? { excludedRef } : {}
|
|
28523
|
+
...sections ? { sections } : {},
|
|
28524
|
+
resolved: excludedRef !== void 0 || resolution !== void 0,
|
|
28525
|
+
...excludedRef ? { excludedRef } : {},
|
|
28526
|
+
...resolution ? { resolution } : {}
|
|
28517
28527
|
});
|
|
28518
28528
|
}
|
|
28519
|
-
|
|
28520
|
-
const samePair = o.a === r.older && o.b === r.newer || o.a === r.newer && o.b === r.older;
|
|
28521
|
-
return samePair && (r.scope === void 0 || o.areas.includes(r.scope));
|
|
28522
|
-
});
|
|
28523
|
-
const synthesized = userRelations.filter((r) => !coversFlagged(r)).map((r) => ({
|
|
28524
|
-
area: r.scope ?? "",
|
|
28525
|
-
areas: r.scope ? [r.scope] : [],
|
|
28526
|
-
a: r.older,
|
|
28527
|
-
b: r.newer,
|
|
28528
|
-
note: r.note ?? "",
|
|
28529
|
-
resolved: true,
|
|
28530
|
-
synthesized: true,
|
|
28531
|
-
relation: r,
|
|
28532
|
-
userRelation: r
|
|
28533
|
-
}));
|
|
28534
|
-
return [...flagged, ...synthesized];
|
|
28529
|
+
return flagged;
|
|
28535
28530
|
}
|
|
28536
28531
|
function openConflicts(corpus, decisions) {
|
|
28537
28532
|
return buildCorpusConflicts(corpus, decisions).filter((c) => !c.resolved);
|
|
28538
28533
|
}
|
|
28539
|
-
|
|
28534
|
+
function suppressedClaims(corpus, decisions) {
|
|
28535
|
+
const out = [];
|
|
28536
|
+
for (const c of buildCorpusConflicts(corpus, decisions)) {
|
|
28537
|
+
const r = c.resolution;
|
|
28538
|
+
if (!r || r.verdict === "dismissed")
|
|
28539
|
+
continue;
|
|
28540
|
+
const loser = r.verdict === "a" ? { doc: r.docB, anchor: r.anchorB, quote: r.quoteB } : { doc: r.docA, anchor: r.anchorA, quote: r.quoteA };
|
|
28541
|
+
if (loser.quote && loser.quote.trim())
|
|
28542
|
+
out.push({ doc: loser.doc, anchor: loser.anchor, quote: loser.quote });
|
|
28543
|
+
}
|
|
28544
|
+
return out;
|
|
28545
|
+
}
|
|
28546
|
+
var PREAMBLE_PTR, NUL, unorderedPairKey, sectionPointerKeys, preambleCount, samePair, anchorKey;
|
|
28540
28547
|
var init_overlap_resolution = __esm({
|
|
28541
28548
|
"packages/shared/dist/spec/overlap-resolution.js"() {
|
|
28542
28549
|
"use strict";
|
|
@@ -28545,6 +28552,8 @@ var init_overlap_resolution = __esm({
|
|
|
28545
28552
|
unorderedPairKey = (a, b) => a < b ? `${a}${NUL}${b}` : `${b}${NUL}${a}`;
|
|
28546
28553
|
sectionPointerKeys = (ov) => (ov.sections ?? []).map((s) => `${s.doc}${NUL}${s.heading ?? PREAMBLE_PTR}`);
|
|
28547
28554
|
preambleCount = (ov) => (ov.sections ?? []).filter((s) => s.heading === null || s.heading === void 0).length;
|
|
28555
|
+
samePair = (a1, b1, a2, b2) => a1 === a2 && b1 === b2 || a1 === b2 && b1 === a2;
|
|
28556
|
+
anchorKey = (h) => h === null || h === void 0 ? null : h.replace(/[`*_~]/g, "").trim().toLowerCase();
|
|
28548
28557
|
}
|
|
28549
28558
|
});
|
|
28550
28559
|
|
|
@@ -28853,7 +28862,7 @@ var require_ignore = __commonJS({
|
|
|
28853
28862
|
// path matching.
|
|
28854
28863
|
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
28855
28864
|
// @returns {TestResult} true if a file is ignored
|
|
28856
|
-
test(
|
|
28865
|
+
test(path75, checkUnignored, mode) {
|
|
28857
28866
|
let ignored = false;
|
|
28858
28867
|
let unignored = false;
|
|
28859
28868
|
let matchedRule;
|
|
@@ -28862,7 +28871,7 @@ var require_ignore = __commonJS({
|
|
|
28862
28871
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
28863
28872
|
return;
|
|
28864
28873
|
}
|
|
28865
|
-
const matched = rule[mode].test(
|
|
28874
|
+
const matched = rule[mode].test(path75);
|
|
28866
28875
|
if (!matched) {
|
|
28867
28876
|
return;
|
|
28868
28877
|
}
|
|
@@ -28883,17 +28892,17 @@ var require_ignore = __commonJS({
|
|
|
28883
28892
|
var throwError2 = (message, Ctor) => {
|
|
28884
28893
|
throw new Ctor(message);
|
|
28885
28894
|
};
|
|
28886
|
-
var checkPath = (
|
|
28887
|
-
if (!isString(
|
|
28895
|
+
var checkPath = (path75, originalPath, doThrow) => {
|
|
28896
|
+
if (!isString(path75)) {
|
|
28888
28897
|
return doThrow(
|
|
28889
28898
|
`path must be a string, but got \`${originalPath}\``,
|
|
28890
28899
|
TypeError
|
|
28891
28900
|
);
|
|
28892
28901
|
}
|
|
28893
|
-
if (!
|
|
28902
|
+
if (!path75) {
|
|
28894
28903
|
return doThrow(`path must not be empty`, TypeError);
|
|
28895
28904
|
}
|
|
28896
|
-
if (checkPath.isNotRelative(
|
|
28905
|
+
if (checkPath.isNotRelative(path75)) {
|
|
28897
28906
|
const r = "`path.relative()`d";
|
|
28898
28907
|
return doThrow(
|
|
28899
28908
|
`path should be a ${r} string, but got "${originalPath}"`,
|
|
@@ -28902,7 +28911,7 @@ var require_ignore = __commonJS({
|
|
|
28902
28911
|
}
|
|
28903
28912
|
return true;
|
|
28904
28913
|
};
|
|
28905
|
-
var isNotRelative = (
|
|
28914
|
+
var isNotRelative = (path75) => REGEX_TEST_INVALID_PATH.test(path75);
|
|
28906
28915
|
checkPath.isNotRelative = isNotRelative;
|
|
28907
28916
|
checkPath.convert = (p) => p;
|
|
28908
28917
|
var Ignore = class {
|
|
@@ -28932,19 +28941,19 @@ var require_ignore = __commonJS({
|
|
|
28932
28941
|
}
|
|
28933
28942
|
// @returns {TestResult}
|
|
28934
28943
|
_test(originalPath, cache3, checkUnignored, slices) {
|
|
28935
|
-
const
|
|
28944
|
+
const path75 = originalPath && checkPath.convert(originalPath);
|
|
28936
28945
|
checkPath(
|
|
28937
|
-
|
|
28946
|
+
path75,
|
|
28938
28947
|
originalPath,
|
|
28939
28948
|
this._strictPathCheck ? throwError2 : RETURN_FALSE
|
|
28940
28949
|
);
|
|
28941
|
-
return this._t(
|
|
28950
|
+
return this._t(path75, cache3, checkUnignored, slices);
|
|
28942
28951
|
}
|
|
28943
|
-
checkIgnore(
|
|
28944
|
-
if (!REGEX_TEST_TRAILING_SLASH.test(
|
|
28945
|
-
return this.test(
|
|
28952
|
+
checkIgnore(path75) {
|
|
28953
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path75)) {
|
|
28954
|
+
return this.test(path75);
|
|
28946
28955
|
}
|
|
28947
|
-
const slices =
|
|
28956
|
+
const slices = path75.split(SLASH).filter(Boolean);
|
|
28948
28957
|
slices.pop();
|
|
28949
28958
|
if (slices.length) {
|
|
28950
28959
|
const parent = this._t(
|
|
@@ -28957,18 +28966,18 @@ var require_ignore = __commonJS({
|
|
|
28957
28966
|
return parent;
|
|
28958
28967
|
}
|
|
28959
28968
|
}
|
|
28960
|
-
return this._rules.test(
|
|
28969
|
+
return this._rules.test(path75, false, MODE_CHECK_IGNORE);
|
|
28961
28970
|
}
|
|
28962
|
-
_t(
|
|
28963
|
-
if (
|
|
28964
|
-
return cache3[
|
|
28971
|
+
_t(path75, cache3, checkUnignored, slices) {
|
|
28972
|
+
if (path75 in cache3) {
|
|
28973
|
+
return cache3[path75];
|
|
28965
28974
|
}
|
|
28966
28975
|
if (!slices) {
|
|
28967
|
-
slices =
|
|
28976
|
+
slices = path75.split(SLASH).filter(Boolean);
|
|
28968
28977
|
}
|
|
28969
28978
|
slices.pop();
|
|
28970
28979
|
if (!slices.length) {
|
|
28971
|
-
return cache3[
|
|
28980
|
+
return cache3[path75] = this._rules.test(path75, checkUnignored, MODE_IGNORE);
|
|
28972
28981
|
}
|
|
28973
28982
|
const parent = this._t(
|
|
28974
28983
|
slices.join(SLASH) + SLASH,
|
|
@@ -28976,29 +28985,29 @@ var require_ignore = __commonJS({
|
|
|
28976
28985
|
checkUnignored,
|
|
28977
28986
|
slices
|
|
28978
28987
|
);
|
|
28979
|
-
return cache3[
|
|
28988
|
+
return cache3[path75] = parent.ignored ? parent : this._rules.test(path75, checkUnignored, MODE_IGNORE);
|
|
28980
28989
|
}
|
|
28981
|
-
ignores(
|
|
28982
|
-
return this._test(
|
|
28990
|
+
ignores(path75) {
|
|
28991
|
+
return this._test(path75, this._ignoreCache, false).ignored;
|
|
28983
28992
|
}
|
|
28984
28993
|
createFilter() {
|
|
28985
|
-
return (
|
|
28994
|
+
return (path75) => !this.ignores(path75);
|
|
28986
28995
|
}
|
|
28987
28996
|
filter(paths) {
|
|
28988
28997
|
return makeArray(paths).filter(this.createFilter());
|
|
28989
28998
|
}
|
|
28990
28999
|
// @returns {TestResult}
|
|
28991
|
-
test(
|
|
28992
|
-
return this._test(
|
|
29000
|
+
test(path75) {
|
|
29001
|
+
return this._test(path75, this._testCache, true);
|
|
28993
29002
|
}
|
|
28994
29003
|
};
|
|
28995
29004
|
var factory = (options) => new Ignore(options);
|
|
28996
|
-
var isPathValid = (
|
|
29005
|
+
var isPathValid = (path75) => checkPath(path75 && checkPath.convert(path75), path75, RETURN_FALSE);
|
|
28997
29006
|
var setupWindows = () => {
|
|
28998
29007
|
const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/");
|
|
28999
29008
|
checkPath.convert = makePosix;
|
|
29000
29009
|
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
29001
|
-
checkPath.isNotRelative = (
|
|
29010
|
+
checkPath.isNotRelative = (path75) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path75) || isNotRelative(path75);
|
|
29002
29011
|
};
|
|
29003
29012
|
if (
|
|
29004
29013
|
// Detect `process` so that it can run in browsers.
|
|
@@ -30415,8 +30424,8 @@ var require_node2 = __commonJS({
|
|
|
30415
30424
|
}
|
|
30416
30425
|
break;
|
|
30417
30426
|
case "FILE":
|
|
30418
|
-
var
|
|
30419
|
-
stream2 = new
|
|
30427
|
+
var fs68 = __require("fs");
|
|
30428
|
+
stream2 = new fs68.SyncWriteStream(fd2, { autoClose: false });
|
|
30420
30429
|
stream2._type = "fs";
|
|
30421
30430
|
break;
|
|
30422
30431
|
case "PIPE":
|
|
@@ -38100,7 +38109,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
38100
38109
|
"node_modules/.pnpm/path-to-regexp@0.1.12/node_modules/path-to-regexp/index.js"(exports, module) {
|
|
38101
38110
|
module.exports = pathToRegexp;
|
|
38102
38111
|
var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
|
|
38103
|
-
function pathToRegexp(
|
|
38112
|
+
function pathToRegexp(path75, keys, options) {
|
|
38104
38113
|
options = options || {};
|
|
38105
38114
|
keys = keys || [];
|
|
38106
38115
|
var strict = options.strict;
|
|
@@ -38114,8 +38123,8 @@ var require_path_to_regexp = __commonJS({
|
|
|
38114
38123
|
var pos = 0;
|
|
38115
38124
|
var backtrack = "";
|
|
38116
38125
|
var m;
|
|
38117
|
-
if (
|
|
38118
|
-
while (m = MATCHING_GROUP_REGEXP.exec(
|
|
38126
|
+
if (path75 instanceof RegExp) {
|
|
38127
|
+
while (m = MATCHING_GROUP_REGEXP.exec(path75.source)) {
|
|
38119
38128
|
if (m[0][0] === "\\") continue;
|
|
38120
38129
|
keys.push({
|
|
38121
38130
|
name: m[1] || name++,
|
|
@@ -38123,18 +38132,18 @@ var require_path_to_regexp = __commonJS({
|
|
|
38123
38132
|
offset: m.index
|
|
38124
38133
|
});
|
|
38125
38134
|
}
|
|
38126
|
-
return
|
|
38135
|
+
return path75;
|
|
38127
38136
|
}
|
|
38128
|
-
if (Array.isArray(
|
|
38129
|
-
|
|
38137
|
+
if (Array.isArray(path75)) {
|
|
38138
|
+
path75 = path75.map(function(value) {
|
|
38130
38139
|
return pathToRegexp(value, keys, options).source;
|
|
38131
38140
|
});
|
|
38132
|
-
return new RegExp(
|
|
38141
|
+
return new RegExp(path75.join("|"), flags);
|
|
38133
38142
|
}
|
|
38134
|
-
if (typeof
|
|
38143
|
+
if (typeof path75 !== "string") {
|
|
38135
38144
|
throw new TypeError("path must be a string, array of strings, or regular expression");
|
|
38136
38145
|
}
|
|
38137
|
-
|
|
38146
|
+
path75 = path75.replace(
|
|
38138
38147
|
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
|
|
38139
38148
|
function(match4, slash, format, key4, capture, star3, optional, offset) {
|
|
38140
38149
|
if (match4[0] === "\\") {
|
|
@@ -38151,7 +38160,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
38151
38160
|
if (slash || format) {
|
|
38152
38161
|
backtrack = "";
|
|
38153
38162
|
} else {
|
|
38154
|
-
backtrack +=
|
|
38163
|
+
backtrack += path75.slice(pos, offset);
|
|
38155
38164
|
}
|
|
38156
38165
|
pos = offset + match4.length;
|
|
38157
38166
|
if (match4 === "*") {
|
|
@@ -38179,7 +38188,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
38179
38188
|
return result;
|
|
38180
38189
|
}
|
|
38181
38190
|
);
|
|
38182
|
-
while (m = MATCHING_GROUP_REGEXP.exec(
|
|
38191
|
+
while (m = MATCHING_GROUP_REGEXP.exec(path75)) {
|
|
38183
38192
|
if (m[0][0] === "\\") continue;
|
|
38184
38193
|
if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {
|
|
38185
38194
|
keys.splice(keysOffset + i, 0, {
|
|
@@ -38191,13 +38200,13 @@ var require_path_to_regexp = __commonJS({
|
|
|
38191
38200
|
}
|
|
38192
38201
|
i++;
|
|
38193
38202
|
}
|
|
38194
|
-
|
|
38203
|
+
path75 += strict ? "" : path75[path75.length - 1] === "/" ? "?" : "/?";
|
|
38195
38204
|
if (end2) {
|
|
38196
|
-
|
|
38197
|
-
} else if (
|
|
38198
|
-
|
|
38205
|
+
path75 += "$";
|
|
38206
|
+
} else if (path75[path75.length - 1] !== "/") {
|
|
38207
|
+
path75 += lookahead ? "(?=/|$)" : "(?:/|$)";
|
|
38199
38208
|
}
|
|
38200
|
-
return new RegExp("^" +
|
|
38209
|
+
return new RegExp("^" + path75, flags);
|
|
38201
38210
|
}
|
|
38202
38211
|
}
|
|
38203
38212
|
});
|
|
@@ -38210,19 +38219,19 @@ var require_layer = __commonJS({
|
|
|
38210
38219
|
var debug2 = require_src2()("express:router:layer");
|
|
38211
38220
|
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
|
|
38212
38221
|
module.exports = Layer;
|
|
38213
|
-
function Layer(
|
|
38222
|
+
function Layer(path75, options, fn) {
|
|
38214
38223
|
if (!(this instanceof Layer)) {
|
|
38215
|
-
return new Layer(
|
|
38224
|
+
return new Layer(path75, options, fn);
|
|
38216
38225
|
}
|
|
38217
|
-
debug2("new %o",
|
|
38226
|
+
debug2("new %o", path75);
|
|
38218
38227
|
var opts = options || {};
|
|
38219
38228
|
this.handle = fn;
|
|
38220
38229
|
this.name = fn.name || "<anonymous>";
|
|
38221
38230
|
this.params = void 0;
|
|
38222
38231
|
this.path = void 0;
|
|
38223
|
-
this.regexp = pathRegexp(
|
|
38224
|
-
this.regexp.fast_star =
|
|
38225
|
-
this.regexp.fast_slash =
|
|
38232
|
+
this.regexp = pathRegexp(path75, this.keys = [], opts);
|
|
38233
|
+
this.regexp.fast_star = path75 === "*";
|
|
38234
|
+
this.regexp.fast_slash = path75 === "/" && opts.end === false;
|
|
38226
38235
|
}
|
|
38227
38236
|
Layer.prototype.handle_error = function handle_error(error, req, res, next) {
|
|
38228
38237
|
var fn = this.handle;
|
|
@@ -38246,20 +38255,20 @@ var require_layer = __commonJS({
|
|
|
38246
38255
|
next(err);
|
|
38247
38256
|
}
|
|
38248
38257
|
};
|
|
38249
|
-
Layer.prototype.match = function match4(
|
|
38258
|
+
Layer.prototype.match = function match4(path75) {
|
|
38250
38259
|
var match5;
|
|
38251
|
-
if (
|
|
38260
|
+
if (path75 != null) {
|
|
38252
38261
|
if (this.regexp.fast_slash) {
|
|
38253
38262
|
this.params = {};
|
|
38254
38263
|
this.path = "";
|
|
38255
38264
|
return true;
|
|
38256
38265
|
}
|
|
38257
38266
|
if (this.regexp.fast_star) {
|
|
38258
|
-
this.params = { "0": decode_param(
|
|
38259
|
-
this.path =
|
|
38267
|
+
this.params = { "0": decode_param(path75) };
|
|
38268
|
+
this.path = path75;
|
|
38260
38269
|
return true;
|
|
38261
38270
|
}
|
|
38262
|
-
match5 = this.regexp.exec(
|
|
38271
|
+
match5 = this.regexp.exec(path75);
|
|
38263
38272
|
}
|
|
38264
38273
|
if (!match5) {
|
|
38265
38274
|
this.params = void 0;
|
|
@@ -38352,10 +38361,10 @@ var require_route = __commonJS({
|
|
|
38352
38361
|
var slice5 = Array.prototype.slice;
|
|
38353
38362
|
var toString2 = Object.prototype.toString;
|
|
38354
38363
|
module.exports = Route;
|
|
38355
|
-
function Route(
|
|
38356
|
-
this.path =
|
|
38364
|
+
function Route(path75) {
|
|
38365
|
+
this.path = path75;
|
|
38357
38366
|
this.stack = [];
|
|
38358
|
-
debug2("new %o",
|
|
38367
|
+
debug2("new %o", path75);
|
|
38359
38368
|
this.methods = {};
|
|
38360
38369
|
}
|
|
38361
38370
|
Route.prototype._handles_method = function _handles_method(method) {
|
|
@@ -38567,8 +38576,8 @@ var require_router = __commonJS({
|
|
|
38567
38576
|
if (++sync > 100) {
|
|
38568
38577
|
return setImmediate(next, err);
|
|
38569
38578
|
}
|
|
38570
|
-
var
|
|
38571
|
-
if (
|
|
38579
|
+
var path75 = getPathname(req);
|
|
38580
|
+
if (path75 == null) {
|
|
38572
38581
|
return done(layerError);
|
|
38573
38582
|
}
|
|
38574
38583
|
var layer;
|
|
@@ -38576,7 +38585,7 @@ var require_router = __commonJS({
|
|
|
38576
38585
|
var route;
|
|
38577
38586
|
while (match4 !== true && idx < stack2.length) {
|
|
38578
38587
|
layer = stack2[idx++];
|
|
38579
|
-
match4 = matchLayer(layer,
|
|
38588
|
+
match4 = matchLayer(layer, path75);
|
|
38580
38589
|
route = layer.route;
|
|
38581
38590
|
if (typeof match4 !== "boolean") {
|
|
38582
38591
|
layerError = layerError || match4;
|
|
@@ -38614,18 +38623,18 @@ var require_router = __commonJS({
|
|
|
38614
38623
|
} else if (route) {
|
|
38615
38624
|
layer.handle_request(req, res, next);
|
|
38616
38625
|
} else {
|
|
38617
|
-
trim_prefix(layer, layerError, layerPath,
|
|
38626
|
+
trim_prefix(layer, layerError, layerPath, path75);
|
|
38618
38627
|
}
|
|
38619
38628
|
sync = 0;
|
|
38620
38629
|
});
|
|
38621
38630
|
}
|
|
38622
|
-
function trim_prefix(layer, layerError, layerPath,
|
|
38631
|
+
function trim_prefix(layer, layerError, layerPath, path75) {
|
|
38623
38632
|
if (layerPath.length !== 0) {
|
|
38624
|
-
if (layerPath !==
|
|
38633
|
+
if (layerPath !== path75.slice(0, layerPath.length)) {
|
|
38625
38634
|
next(layerError);
|
|
38626
38635
|
return;
|
|
38627
38636
|
}
|
|
38628
|
-
var c =
|
|
38637
|
+
var c = path75[layerPath.length];
|
|
38629
38638
|
if (c && c !== "/" && c !== ".") return next(layerError);
|
|
38630
38639
|
debug2("trim prefix (%s) from url %s", layerPath, req.url);
|
|
38631
38640
|
removed = layerPath;
|
|
@@ -38703,7 +38712,7 @@ var require_router = __commonJS({
|
|
|
38703
38712
|
};
|
|
38704
38713
|
proto.use = function use(fn) {
|
|
38705
38714
|
var offset = 0;
|
|
38706
|
-
var
|
|
38715
|
+
var path75 = "/";
|
|
38707
38716
|
if (typeof fn !== "function") {
|
|
38708
38717
|
var arg = fn;
|
|
38709
38718
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -38711,7 +38720,7 @@ var require_router = __commonJS({
|
|
|
38711
38720
|
}
|
|
38712
38721
|
if (typeof arg !== "function") {
|
|
38713
38722
|
offset = 1;
|
|
38714
|
-
|
|
38723
|
+
path75 = fn;
|
|
38715
38724
|
}
|
|
38716
38725
|
}
|
|
38717
38726
|
var callbacks = flatten(slice5.call(arguments, offset));
|
|
@@ -38723,8 +38732,8 @@ var require_router = __commonJS({
|
|
|
38723
38732
|
if (typeof fn !== "function") {
|
|
38724
38733
|
throw new TypeError("Router.use() requires a middleware function but got a " + gettype(fn));
|
|
38725
38734
|
}
|
|
38726
|
-
debug2("use %o %s",
|
|
38727
|
-
var layer = new Layer(
|
|
38735
|
+
debug2("use %o %s", path75, fn.name || "<anonymous>");
|
|
38736
|
+
var layer = new Layer(path75, {
|
|
38728
38737
|
sensitive: this.caseSensitive,
|
|
38729
38738
|
strict: false,
|
|
38730
38739
|
end: false
|
|
@@ -38734,9 +38743,9 @@ var require_router = __commonJS({
|
|
|
38734
38743
|
}
|
|
38735
38744
|
return this;
|
|
38736
38745
|
};
|
|
38737
|
-
proto.route = function route(
|
|
38738
|
-
var route2 = new Route(
|
|
38739
|
-
var layer = new Layer(
|
|
38746
|
+
proto.route = function route(path75) {
|
|
38747
|
+
var route2 = new Route(path75);
|
|
38748
|
+
var layer = new Layer(path75, {
|
|
38740
38749
|
sensitive: this.caseSensitive,
|
|
38741
38750
|
strict: this.strict,
|
|
38742
38751
|
end: true
|
|
@@ -38746,8 +38755,8 @@ var require_router = __commonJS({
|
|
|
38746
38755
|
return route2;
|
|
38747
38756
|
};
|
|
38748
38757
|
methods.concat("all").forEach(function(method) {
|
|
38749
|
-
proto[method] = function(
|
|
38750
|
-
var route = this.route(
|
|
38758
|
+
proto[method] = function(path75) {
|
|
38759
|
+
var route = this.route(path75);
|
|
38751
38760
|
route[method].apply(route, slice5.call(arguments, 1));
|
|
38752
38761
|
return this;
|
|
38753
38762
|
};
|
|
@@ -38783,9 +38792,9 @@ var require_router = __commonJS({
|
|
|
38783
38792
|
}
|
|
38784
38793
|
return toString2.call(obj).replace(objectRegExp, "$1");
|
|
38785
38794
|
}
|
|
38786
|
-
function matchLayer(layer,
|
|
38795
|
+
function matchLayer(layer, path75) {
|
|
38787
38796
|
try {
|
|
38788
|
-
return layer.match(
|
|
38797
|
+
return layer.match(path75);
|
|
38789
38798
|
} catch (err) {
|
|
38790
38799
|
return err;
|
|
38791
38800
|
}
|
|
@@ -38903,13 +38912,13 @@ var require_view = __commonJS({
|
|
|
38903
38912
|
"node_modules/.pnpm/express@4.22.1/node_modules/express/lib/view.js"(exports, module) {
|
|
38904
38913
|
"use strict";
|
|
38905
38914
|
var debug2 = require_src2()("express:view");
|
|
38906
|
-
var
|
|
38907
|
-
var
|
|
38908
|
-
var dirname10 =
|
|
38909
|
-
var basename2 =
|
|
38910
|
-
var extname =
|
|
38911
|
-
var join11 =
|
|
38912
|
-
var resolve11 =
|
|
38915
|
+
var path75 = __require("path");
|
|
38916
|
+
var fs68 = __require("fs");
|
|
38917
|
+
var dirname10 = path75.dirname;
|
|
38918
|
+
var basename2 = path75.basename;
|
|
38919
|
+
var extname = path75.extname;
|
|
38920
|
+
var join11 = path75.join;
|
|
38921
|
+
var resolve11 = path75.resolve;
|
|
38913
38922
|
module.exports = View;
|
|
38914
38923
|
function View(name, options) {
|
|
38915
38924
|
var opts = options || {};
|
|
@@ -38938,17 +38947,17 @@ var require_view = __commonJS({
|
|
|
38938
38947
|
this.path = this.lookup(fileName);
|
|
38939
38948
|
}
|
|
38940
38949
|
View.prototype.lookup = function lookup(name) {
|
|
38941
|
-
var
|
|
38950
|
+
var path76;
|
|
38942
38951
|
var roots = [].concat(this.root);
|
|
38943
38952
|
debug2('lookup "%s"', name);
|
|
38944
|
-
for (var i = 0; i < roots.length && !
|
|
38953
|
+
for (var i = 0; i < roots.length && !path76; i++) {
|
|
38945
38954
|
var root = roots[i];
|
|
38946
38955
|
var loc = resolve11(root, name);
|
|
38947
38956
|
var dir = dirname10(loc);
|
|
38948
38957
|
var file = basename2(loc);
|
|
38949
|
-
|
|
38958
|
+
path76 = this.resolve(dir, file);
|
|
38950
38959
|
}
|
|
38951
|
-
return
|
|
38960
|
+
return path76;
|
|
38952
38961
|
};
|
|
38953
38962
|
View.prototype.render = function render(options, callback) {
|
|
38954
38963
|
debug2('render "%s"', this.path);
|
|
@@ -38956,21 +38965,21 @@ var require_view = __commonJS({
|
|
|
38956
38965
|
};
|
|
38957
38966
|
View.prototype.resolve = function resolve12(dir, file) {
|
|
38958
38967
|
var ext2 = this.ext;
|
|
38959
|
-
var
|
|
38960
|
-
var stat = tryStat(
|
|
38968
|
+
var path76 = join11(dir, file);
|
|
38969
|
+
var stat = tryStat(path76);
|
|
38961
38970
|
if (stat && stat.isFile()) {
|
|
38962
|
-
return
|
|
38971
|
+
return path76;
|
|
38963
38972
|
}
|
|
38964
|
-
|
|
38965
|
-
stat = tryStat(
|
|
38973
|
+
path76 = join11(dir, basename2(file, ext2), "index" + ext2);
|
|
38974
|
+
stat = tryStat(path76);
|
|
38966
38975
|
if (stat && stat.isFile()) {
|
|
38967
|
-
return
|
|
38976
|
+
return path76;
|
|
38968
38977
|
}
|
|
38969
38978
|
};
|
|
38970
|
-
function tryStat(
|
|
38971
|
-
debug2('stat "%s"',
|
|
38979
|
+
function tryStat(path76) {
|
|
38980
|
+
debug2('stat "%s"', path76);
|
|
38972
38981
|
try {
|
|
38973
|
-
return
|
|
38982
|
+
return fs68.statSync(path76);
|
|
38974
38983
|
} catch (e) {
|
|
38975
38984
|
return void 0;
|
|
38976
38985
|
}
|
|
@@ -39324,8 +39333,8 @@ var require_types = __commonJS({
|
|
|
39324
39333
|
// node_modules/.pnpm/mime@1.6.0/node_modules/mime/mime.js
|
|
39325
39334
|
var require_mime = __commonJS({
|
|
39326
39335
|
"node_modules/.pnpm/mime@1.6.0/node_modules/mime/mime.js"(exports, module) {
|
|
39327
|
-
var
|
|
39328
|
-
var
|
|
39336
|
+
var path75 = __require("path");
|
|
39337
|
+
var fs68 = __require("fs");
|
|
39329
39338
|
function Mime() {
|
|
39330
39339
|
this.types = /* @__PURE__ */ Object.create(null);
|
|
39331
39340
|
this.extensions = /* @__PURE__ */ Object.create(null);
|
|
@@ -39346,7 +39355,7 @@ var require_mime = __commonJS({
|
|
|
39346
39355
|
};
|
|
39347
39356
|
Mime.prototype.load = function(file) {
|
|
39348
39357
|
this._loading = file;
|
|
39349
|
-
var map2 = {}, content =
|
|
39358
|
+
var map2 = {}, content = fs68.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
|
|
39350
39359
|
lines.forEach(function(line) {
|
|
39351
39360
|
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
|
|
39352
39361
|
map2[fields.shift()] = fields;
|
|
@@ -39354,8 +39363,8 @@ var require_mime = __commonJS({
|
|
|
39354
39363
|
this.define(map2);
|
|
39355
39364
|
this._loading = null;
|
|
39356
39365
|
};
|
|
39357
|
-
Mime.prototype.lookup = function(
|
|
39358
|
-
var ext2 =
|
|
39366
|
+
Mime.prototype.lookup = function(path76, fallback) {
|
|
39367
|
+
var ext2 = path76.replace(/^.*[\.\/\\]/, "").toLowerCase();
|
|
39359
39368
|
return this.types[ext2] || fallback || this.default_type;
|
|
39360
39369
|
};
|
|
39361
39370
|
Mime.prototype.extension = function(mimeType) {
|
|
@@ -39468,33 +39477,33 @@ var require_send = __commonJS({
|
|
|
39468
39477
|
var escapeHtml = require_escape_html();
|
|
39469
39478
|
var etag = require_etag();
|
|
39470
39479
|
var fresh = require_fresh();
|
|
39471
|
-
var
|
|
39480
|
+
var fs68 = __require("fs");
|
|
39472
39481
|
var mime = require_mime();
|
|
39473
39482
|
var ms = require_ms();
|
|
39474
39483
|
var onFinished = require_on_finished();
|
|
39475
39484
|
var parseRange = require_range_parser();
|
|
39476
|
-
var
|
|
39485
|
+
var path75 = __require("path");
|
|
39477
39486
|
var statuses = require_statuses();
|
|
39478
39487
|
var Stream = __require("stream");
|
|
39479
39488
|
var util2 = __require("util");
|
|
39480
|
-
var extname =
|
|
39481
|
-
var join11 =
|
|
39482
|
-
var normalize8 =
|
|
39483
|
-
var resolve11 =
|
|
39484
|
-
var sep3 =
|
|
39489
|
+
var extname = path75.extname;
|
|
39490
|
+
var join11 = path75.join;
|
|
39491
|
+
var normalize8 = path75.normalize;
|
|
39492
|
+
var resolve11 = path75.resolve;
|
|
39493
|
+
var sep3 = path75.sep;
|
|
39485
39494
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
39486
39495
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
39487
39496
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
39488
39497
|
module.exports = send;
|
|
39489
39498
|
module.exports.mime = mime;
|
|
39490
|
-
function send(req,
|
|
39491
|
-
return new SendStream(req,
|
|
39499
|
+
function send(req, path76, options) {
|
|
39500
|
+
return new SendStream(req, path76, options);
|
|
39492
39501
|
}
|
|
39493
|
-
function SendStream(req,
|
|
39502
|
+
function SendStream(req, path76, options) {
|
|
39494
39503
|
Stream.call(this);
|
|
39495
39504
|
var opts = options || {};
|
|
39496
39505
|
this.options = opts;
|
|
39497
|
-
this.path =
|
|
39506
|
+
this.path = path76;
|
|
39498
39507
|
this.req = req;
|
|
39499
39508
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
39500
39509
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -39540,8 +39549,8 @@ var require_send = __commonJS({
|
|
|
39540
39549
|
this._index = index2;
|
|
39541
39550
|
return this;
|
|
39542
39551
|
}, "send.index: pass index as option");
|
|
39543
|
-
SendStream.prototype.root = function root(
|
|
39544
|
-
this._root = resolve11(String(
|
|
39552
|
+
SendStream.prototype.root = function root(path76) {
|
|
39553
|
+
this._root = resolve11(String(path76));
|
|
39545
39554
|
debug2("root %s", this._root);
|
|
39546
39555
|
return this;
|
|
39547
39556
|
};
|
|
@@ -39654,10 +39663,10 @@ var require_send = __commonJS({
|
|
|
39654
39663
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
39655
39664
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
39656
39665
|
};
|
|
39657
|
-
SendStream.prototype.redirect = function redirect(
|
|
39666
|
+
SendStream.prototype.redirect = function redirect(path76) {
|
|
39658
39667
|
var res = this.res;
|
|
39659
39668
|
if (hasListeners(this, "directory")) {
|
|
39660
|
-
this.emit("directory", res,
|
|
39669
|
+
this.emit("directory", res, path76);
|
|
39661
39670
|
return;
|
|
39662
39671
|
}
|
|
39663
39672
|
if (this.hasTrailingSlash()) {
|
|
@@ -39677,42 +39686,42 @@ var require_send = __commonJS({
|
|
|
39677
39686
|
SendStream.prototype.pipe = function pipe(res) {
|
|
39678
39687
|
var root = this._root;
|
|
39679
39688
|
this.res = res;
|
|
39680
|
-
var
|
|
39681
|
-
if (
|
|
39689
|
+
var path76 = decode(this.path);
|
|
39690
|
+
if (path76 === -1) {
|
|
39682
39691
|
this.error(400);
|
|
39683
39692
|
return res;
|
|
39684
39693
|
}
|
|
39685
|
-
if (~
|
|
39694
|
+
if (~path76.indexOf("\0")) {
|
|
39686
39695
|
this.error(400);
|
|
39687
39696
|
return res;
|
|
39688
39697
|
}
|
|
39689
39698
|
var parts;
|
|
39690
39699
|
if (root !== null) {
|
|
39691
|
-
if (
|
|
39692
|
-
|
|
39700
|
+
if (path76) {
|
|
39701
|
+
path76 = normalize8("." + sep3 + path76);
|
|
39693
39702
|
}
|
|
39694
|
-
if (UP_PATH_REGEXP.test(
|
|
39695
|
-
debug2('malicious path "%s"',
|
|
39703
|
+
if (UP_PATH_REGEXP.test(path76)) {
|
|
39704
|
+
debug2('malicious path "%s"', path76);
|
|
39696
39705
|
this.error(403);
|
|
39697
39706
|
return res;
|
|
39698
39707
|
}
|
|
39699
|
-
parts =
|
|
39700
|
-
|
|
39708
|
+
parts = path76.split(sep3);
|
|
39709
|
+
path76 = normalize8(join11(root, path76));
|
|
39701
39710
|
} else {
|
|
39702
|
-
if (UP_PATH_REGEXP.test(
|
|
39703
|
-
debug2('malicious path "%s"',
|
|
39711
|
+
if (UP_PATH_REGEXP.test(path76)) {
|
|
39712
|
+
debug2('malicious path "%s"', path76);
|
|
39704
39713
|
this.error(403);
|
|
39705
39714
|
return res;
|
|
39706
39715
|
}
|
|
39707
|
-
parts = normalize8(
|
|
39708
|
-
|
|
39716
|
+
parts = normalize8(path76).split(sep3);
|
|
39717
|
+
path76 = resolve11(path76);
|
|
39709
39718
|
}
|
|
39710
39719
|
if (containsDotFile(parts)) {
|
|
39711
39720
|
var access = this._dotfiles;
|
|
39712
39721
|
if (access === void 0) {
|
|
39713
39722
|
access = parts[parts.length - 1][0] === "." ? this._hidden ? "allow" : "ignore" : "allow";
|
|
39714
39723
|
}
|
|
39715
|
-
debug2('%s dotfile "%s"', access,
|
|
39724
|
+
debug2('%s dotfile "%s"', access, path76);
|
|
39716
39725
|
switch (access) {
|
|
39717
39726
|
case "allow":
|
|
39718
39727
|
break;
|
|
@@ -39726,13 +39735,13 @@ var require_send = __commonJS({
|
|
|
39726
39735
|
}
|
|
39727
39736
|
}
|
|
39728
39737
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
39729
|
-
this.sendIndex(
|
|
39738
|
+
this.sendIndex(path76);
|
|
39730
39739
|
return res;
|
|
39731
39740
|
}
|
|
39732
|
-
this.sendFile(
|
|
39741
|
+
this.sendFile(path76);
|
|
39733
39742
|
return res;
|
|
39734
39743
|
};
|
|
39735
|
-
SendStream.prototype.send = function send2(
|
|
39744
|
+
SendStream.prototype.send = function send2(path76, stat) {
|
|
39736
39745
|
var len = stat.size;
|
|
39737
39746
|
var options = this.options;
|
|
39738
39747
|
var opts = {};
|
|
@@ -39744,9 +39753,9 @@ var require_send = __commonJS({
|
|
|
39744
39753
|
this.headersAlreadySent();
|
|
39745
39754
|
return;
|
|
39746
39755
|
}
|
|
39747
|
-
debug2('pipe "%s"',
|
|
39748
|
-
this.setHeader(
|
|
39749
|
-
this.type(
|
|
39756
|
+
debug2('pipe "%s"', path76);
|
|
39757
|
+
this.setHeader(path76, stat);
|
|
39758
|
+
this.type(path76);
|
|
39750
39759
|
if (this.isConditionalGET()) {
|
|
39751
39760
|
if (this.isPreconditionFailure()) {
|
|
39752
39761
|
this.error(412);
|
|
@@ -39795,28 +39804,28 @@ var require_send = __commonJS({
|
|
|
39795
39804
|
res.end();
|
|
39796
39805
|
return;
|
|
39797
39806
|
}
|
|
39798
|
-
this.stream(
|
|
39807
|
+
this.stream(path76, opts);
|
|
39799
39808
|
};
|
|
39800
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
39809
|
+
SendStream.prototype.sendFile = function sendFile(path76) {
|
|
39801
39810
|
var i = 0;
|
|
39802
39811
|
var self2 = this;
|
|
39803
|
-
debug2('stat "%s"',
|
|
39804
|
-
|
|
39805
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
39812
|
+
debug2('stat "%s"', path76);
|
|
39813
|
+
fs68.stat(path76, function onstat(err, stat) {
|
|
39814
|
+
if (err && err.code === "ENOENT" && !extname(path76) && path76[path76.length - 1] !== sep3) {
|
|
39806
39815
|
return next(err);
|
|
39807
39816
|
}
|
|
39808
39817
|
if (err) return self2.onStatError(err);
|
|
39809
|
-
if (stat.isDirectory()) return self2.redirect(
|
|
39810
|
-
self2.emit("file",
|
|
39811
|
-
self2.send(
|
|
39818
|
+
if (stat.isDirectory()) return self2.redirect(path76);
|
|
39819
|
+
self2.emit("file", path76, stat);
|
|
39820
|
+
self2.send(path76, stat);
|
|
39812
39821
|
});
|
|
39813
39822
|
function next(err) {
|
|
39814
39823
|
if (self2._extensions.length <= i) {
|
|
39815
39824
|
return err ? self2.onStatError(err) : self2.error(404);
|
|
39816
39825
|
}
|
|
39817
|
-
var p =
|
|
39826
|
+
var p = path76 + "." + self2._extensions[i++];
|
|
39818
39827
|
debug2('stat "%s"', p);
|
|
39819
|
-
|
|
39828
|
+
fs68.stat(p, function(err2, stat) {
|
|
39820
39829
|
if (err2) return next(err2);
|
|
39821
39830
|
if (stat.isDirectory()) return next();
|
|
39822
39831
|
self2.emit("file", p, stat);
|
|
@@ -39824,7 +39833,7 @@ var require_send = __commonJS({
|
|
|
39824
39833
|
});
|
|
39825
39834
|
}
|
|
39826
39835
|
};
|
|
39827
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
39836
|
+
SendStream.prototype.sendIndex = function sendIndex(path76) {
|
|
39828
39837
|
var i = -1;
|
|
39829
39838
|
var self2 = this;
|
|
39830
39839
|
function next(err) {
|
|
@@ -39832,9 +39841,9 @@ var require_send = __commonJS({
|
|
|
39832
39841
|
if (err) return self2.onStatError(err);
|
|
39833
39842
|
return self2.error(404);
|
|
39834
39843
|
}
|
|
39835
|
-
var p = join11(
|
|
39844
|
+
var p = join11(path76, self2._index[i]);
|
|
39836
39845
|
debug2('stat "%s"', p);
|
|
39837
|
-
|
|
39846
|
+
fs68.stat(p, function(err2, stat) {
|
|
39838
39847
|
if (err2) return next(err2);
|
|
39839
39848
|
if (stat.isDirectory()) return next();
|
|
39840
39849
|
self2.emit("file", p, stat);
|
|
@@ -39843,10 +39852,10 @@ var require_send = __commonJS({
|
|
|
39843
39852
|
}
|
|
39844
39853
|
next();
|
|
39845
39854
|
};
|
|
39846
|
-
SendStream.prototype.stream = function stream(
|
|
39855
|
+
SendStream.prototype.stream = function stream(path76, options) {
|
|
39847
39856
|
var self2 = this;
|
|
39848
39857
|
var res = this.res;
|
|
39849
|
-
var stream2 =
|
|
39858
|
+
var stream2 = fs68.createReadStream(path76, options);
|
|
39850
39859
|
this.emit("stream", stream2);
|
|
39851
39860
|
stream2.pipe(res);
|
|
39852
39861
|
function cleanup() {
|
|
@@ -39861,10 +39870,10 @@ var require_send = __commonJS({
|
|
|
39861
39870
|
self2.emit("end");
|
|
39862
39871
|
});
|
|
39863
39872
|
};
|
|
39864
|
-
SendStream.prototype.type = function type2(
|
|
39873
|
+
SendStream.prototype.type = function type2(path76) {
|
|
39865
39874
|
var res = this.res;
|
|
39866
39875
|
if (res.getHeader("Content-Type")) return;
|
|
39867
|
-
var type3 = mime.lookup(
|
|
39876
|
+
var type3 = mime.lookup(path76);
|
|
39868
39877
|
if (!type3) {
|
|
39869
39878
|
debug2("no content-type");
|
|
39870
39879
|
return;
|
|
@@ -39873,9 +39882,9 @@ var require_send = __commonJS({
|
|
|
39873
39882
|
debug2("content-type %s", type3);
|
|
39874
39883
|
res.setHeader("Content-Type", type3 + (charset ? "; charset=" + charset : ""));
|
|
39875
39884
|
};
|
|
39876
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
39885
|
+
SendStream.prototype.setHeader = function setHeader(path76, stat) {
|
|
39877
39886
|
var res = this.res;
|
|
39878
|
-
this.emit("headers", res,
|
|
39887
|
+
this.emit("headers", res, path76, stat);
|
|
39879
39888
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
39880
39889
|
debug2("accept ranges");
|
|
39881
39890
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -39934,9 +39943,9 @@ var require_send = __commonJS({
|
|
|
39934
39943
|
}
|
|
39935
39944
|
return err instanceof Error ? createError2(status, err, { expose: false }) : createError2(status, err);
|
|
39936
39945
|
}
|
|
39937
|
-
function decode(
|
|
39946
|
+
function decode(path76) {
|
|
39938
39947
|
try {
|
|
39939
|
-
return decodeURIComponent(
|
|
39948
|
+
return decodeURIComponent(path76);
|
|
39940
39949
|
} catch (err) {
|
|
39941
39950
|
return -1;
|
|
39942
39951
|
}
|
|
@@ -40845,10 +40854,10 @@ var require_utils2 = __commonJS({
|
|
|
40845
40854
|
var querystring = __require("querystring");
|
|
40846
40855
|
exports.etag = createETagGenerator({ weak: false });
|
|
40847
40856
|
exports.wetag = createETagGenerator({ weak: true });
|
|
40848
|
-
exports.isAbsolute = function(
|
|
40849
|
-
if ("/" ===
|
|
40850
|
-
if (":" ===
|
|
40851
|
-
if ("\\\\" ===
|
|
40857
|
+
exports.isAbsolute = function(path75) {
|
|
40858
|
+
if ("/" === path75[0]) return true;
|
|
40859
|
+
if (":" === path75[1] && ("\\" === path75[2] || "/" === path75[2])) return true;
|
|
40860
|
+
if ("\\\\" === path75.substring(0, 2)) return true;
|
|
40852
40861
|
};
|
|
40853
40862
|
exports.flatten = deprecate.function(
|
|
40854
40863
|
flatten,
|
|
@@ -41059,7 +41068,7 @@ var require_application = __commonJS({
|
|
|
41059
41068
|
};
|
|
41060
41069
|
app.use = function use(fn) {
|
|
41061
41070
|
var offset = 0;
|
|
41062
|
-
var
|
|
41071
|
+
var path75 = "/";
|
|
41063
41072
|
if (typeof fn !== "function") {
|
|
41064
41073
|
var arg = fn;
|
|
41065
41074
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -41067,7 +41076,7 @@ var require_application = __commonJS({
|
|
|
41067
41076
|
}
|
|
41068
41077
|
if (typeof arg !== "function") {
|
|
41069
41078
|
offset = 1;
|
|
41070
|
-
|
|
41079
|
+
path75 = fn;
|
|
41071
41080
|
}
|
|
41072
41081
|
}
|
|
41073
41082
|
var fns = flatten(slice5.call(arguments, offset));
|
|
@@ -41078,12 +41087,12 @@ var require_application = __commonJS({
|
|
|
41078
41087
|
var router16 = this._router;
|
|
41079
41088
|
fns.forEach(function(fn2) {
|
|
41080
41089
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
41081
|
-
return router16.use(
|
|
41090
|
+
return router16.use(path75, fn2);
|
|
41082
41091
|
}
|
|
41083
|
-
debug2(".use app under %s",
|
|
41084
|
-
fn2.mountpath =
|
|
41092
|
+
debug2(".use app under %s", path75);
|
|
41093
|
+
fn2.mountpath = path75;
|
|
41085
41094
|
fn2.parent = this;
|
|
41086
|
-
router16.use(
|
|
41095
|
+
router16.use(path75, function mounted_app(req, res, next) {
|
|
41087
41096
|
var orig = req.app;
|
|
41088
41097
|
fn2.handle(req, res, function(err) {
|
|
41089
41098
|
setPrototypeOf(req, orig.request);
|
|
@@ -41095,9 +41104,9 @@ var require_application = __commonJS({
|
|
|
41095
41104
|
}, this);
|
|
41096
41105
|
return this;
|
|
41097
41106
|
};
|
|
41098
|
-
app.route = function route(
|
|
41107
|
+
app.route = function route(path75) {
|
|
41099
41108
|
this.lazyrouter();
|
|
41100
|
-
return this._router.route(
|
|
41109
|
+
return this._router.route(path75);
|
|
41101
41110
|
};
|
|
41102
41111
|
app.engine = function engine(ext2, fn) {
|
|
41103
41112
|
if (typeof fn !== "function") {
|
|
@@ -41148,7 +41157,7 @@ var require_application = __commonJS({
|
|
|
41148
41157
|
}
|
|
41149
41158
|
return this;
|
|
41150
41159
|
};
|
|
41151
|
-
app.path = function
|
|
41160
|
+
app.path = function path75() {
|
|
41152
41161
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
41153
41162
|
};
|
|
41154
41163
|
app.enabled = function enabled(setting) {
|
|
@@ -41164,19 +41173,19 @@ var require_application = __commonJS({
|
|
|
41164
41173
|
return this.set(setting, false);
|
|
41165
41174
|
};
|
|
41166
41175
|
methods.forEach(function(method) {
|
|
41167
|
-
app[method] = function(
|
|
41176
|
+
app[method] = function(path75) {
|
|
41168
41177
|
if (method === "get" && arguments.length === 1) {
|
|
41169
|
-
return this.set(
|
|
41178
|
+
return this.set(path75);
|
|
41170
41179
|
}
|
|
41171
41180
|
this.lazyrouter();
|
|
41172
|
-
var route = this._router.route(
|
|
41181
|
+
var route = this._router.route(path75);
|
|
41173
41182
|
route[method].apply(route, slice5.call(arguments, 1));
|
|
41174
41183
|
return this;
|
|
41175
41184
|
};
|
|
41176
41185
|
});
|
|
41177
|
-
app.all = function all(
|
|
41186
|
+
app.all = function all(path75) {
|
|
41178
41187
|
this.lazyrouter();
|
|
41179
|
-
var route = this._router.route(
|
|
41188
|
+
var route = this._router.route(path75);
|
|
41180
41189
|
var args = slice5.call(arguments, 1);
|
|
41181
41190
|
for (var i = 0; i < methods.length; i++) {
|
|
41182
41191
|
route[methods[i]].apply(route, args);
|
|
@@ -41357,7 +41366,7 @@ var require_request = __commonJS({
|
|
|
41357
41366
|
var subdomains2 = !isIP(hostname) ? hostname.split(".").reverse() : [hostname];
|
|
41358
41367
|
return subdomains2.slice(offset);
|
|
41359
41368
|
});
|
|
41360
|
-
defineGetter(req, "path", function
|
|
41369
|
+
defineGetter(req, "path", function path75() {
|
|
41361
41370
|
return parse2(this).pathname;
|
|
41362
41371
|
});
|
|
41363
41372
|
defineGetter(req, "hostname", function hostname() {
|
|
@@ -41440,7 +41449,7 @@ var require_response = __commonJS({
|
|
|
41440
41449
|
var http = __require("http");
|
|
41441
41450
|
var isAbsolute = require_utils2().isAbsolute;
|
|
41442
41451
|
var onFinished = require_on_finished();
|
|
41443
|
-
var
|
|
41452
|
+
var path75 = __require("path");
|
|
41444
41453
|
var statuses = require_statuses();
|
|
41445
41454
|
var merge2 = require_utils_merge();
|
|
41446
41455
|
var sign = require_cookie_signature().sign;
|
|
@@ -41449,9 +41458,9 @@ var require_response = __commonJS({
|
|
|
41449
41458
|
var setCharset = require_utils2().setCharset;
|
|
41450
41459
|
var cookie = require_cookie();
|
|
41451
41460
|
var send = require_send();
|
|
41452
|
-
var extname =
|
|
41461
|
+
var extname = path75.extname;
|
|
41453
41462
|
var mime = send.mime;
|
|
41454
|
-
var resolve11 =
|
|
41463
|
+
var resolve11 = path75.resolve;
|
|
41455
41464
|
var vary = require_vary();
|
|
41456
41465
|
var res = Object.create(http.ServerResponse.prototype);
|
|
41457
41466
|
module.exports = res;
|
|
@@ -41628,26 +41637,26 @@ var require_response = __commonJS({
|
|
|
41628
41637
|
this.type("txt");
|
|
41629
41638
|
return this.send(body);
|
|
41630
41639
|
};
|
|
41631
|
-
res.sendFile = function sendFile(
|
|
41640
|
+
res.sendFile = function sendFile(path76, options, callback) {
|
|
41632
41641
|
var done = callback;
|
|
41633
41642
|
var req = this.req;
|
|
41634
41643
|
var res2 = this;
|
|
41635
41644
|
var next = req.next;
|
|
41636
41645
|
var opts = options || {};
|
|
41637
|
-
if (!
|
|
41646
|
+
if (!path76) {
|
|
41638
41647
|
throw new TypeError("path argument is required to res.sendFile");
|
|
41639
41648
|
}
|
|
41640
|
-
if (typeof
|
|
41649
|
+
if (typeof path76 !== "string") {
|
|
41641
41650
|
throw new TypeError("path must be a string to res.sendFile");
|
|
41642
41651
|
}
|
|
41643
41652
|
if (typeof options === "function") {
|
|
41644
41653
|
done = options;
|
|
41645
41654
|
opts = {};
|
|
41646
41655
|
}
|
|
41647
|
-
if (!opts.root && !isAbsolute(
|
|
41656
|
+
if (!opts.root && !isAbsolute(path76)) {
|
|
41648
41657
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
41649
41658
|
}
|
|
41650
|
-
var pathname = encodeURI(
|
|
41659
|
+
var pathname = encodeURI(path76);
|
|
41651
41660
|
var file = send(req, pathname, opts);
|
|
41652
41661
|
sendfile(res2, file, opts, function(err) {
|
|
41653
41662
|
if (done) return done(err);
|
|
@@ -41657,7 +41666,7 @@ var require_response = __commonJS({
|
|
|
41657
41666
|
}
|
|
41658
41667
|
});
|
|
41659
41668
|
};
|
|
41660
|
-
res.sendfile = function(
|
|
41669
|
+
res.sendfile = function(path76, options, callback) {
|
|
41661
41670
|
var done = callback;
|
|
41662
41671
|
var req = this.req;
|
|
41663
41672
|
var res2 = this;
|
|
@@ -41667,7 +41676,7 @@ var require_response = __commonJS({
|
|
|
41667
41676
|
done = options;
|
|
41668
41677
|
opts = {};
|
|
41669
41678
|
}
|
|
41670
|
-
var file = send(req,
|
|
41679
|
+
var file = send(req, path76, opts);
|
|
41671
41680
|
sendfile(res2, file, opts, function(err) {
|
|
41672
41681
|
if (done) return done(err);
|
|
41673
41682
|
if (err && err.code === "EISDIR") return next();
|
|
@@ -41680,7 +41689,7 @@ var require_response = __commonJS({
|
|
|
41680
41689
|
res.sendfile,
|
|
41681
41690
|
"res.sendfile: Use res.sendFile instead"
|
|
41682
41691
|
);
|
|
41683
|
-
res.download = function download(
|
|
41692
|
+
res.download = function download(path76, filename, options, callback) {
|
|
41684
41693
|
var done = callback;
|
|
41685
41694
|
var name = filename;
|
|
41686
41695
|
var opts = options || null;
|
|
@@ -41697,7 +41706,7 @@ var require_response = __commonJS({
|
|
|
41697
41706
|
opts = filename;
|
|
41698
41707
|
}
|
|
41699
41708
|
var headers = {
|
|
41700
|
-
"Content-Disposition": contentDisposition(name ||
|
|
41709
|
+
"Content-Disposition": contentDisposition(name || path76)
|
|
41701
41710
|
};
|
|
41702
41711
|
if (opts && opts.headers) {
|
|
41703
41712
|
var keys = Object.keys(opts.headers);
|
|
@@ -41710,7 +41719,7 @@ var require_response = __commonJS({
|
|
|
41710
41719
|
}
|
|
41711
41720
|
opts = Object.create(opts);
|
|
41712
41721
|
opts.headers = headers;
|
|
41713
|
-
var fullPath = !opts.root ? resolve11(
|
|
41722
|
+
var fullPath = !opts.root ? resolve11(path76) : path76;
|
|
41714
41723
|
return this.sendFile(fullPath, opts, done);
|
|
41715
41724
|
};
|
|
41716
41725
|
res.contentType = res.type = function contentType(type2) {
|
|
@@ -42011,11 +42020,11 @@ var require_serve_static = __commonJS({
|
|
|
42011
42020
|
}
|
|
42012
42021
|
var forwardError = !fallthrough;
|
|
42013
42022
|
var originalUrl = parseUrl.original(req);
|
|
42014
|
-
var
|
|
42015
|
-
if (
|
|
42016
|
-
|
|
42023
|
+
var path75 = parseUrl(req).pathname;
|
|
42024
|
+
if (path75 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
42025
|
+
path75 = "";
|
|
42017
42026
|
}
|
|
42018
|
-
var stream = send(req,
|
|
42027
|
+
var stream = send(req, path75, opts);
|
|
42019
42028
|
stream.on("directory", onDirectory);
|
|
42020
42029
|
if (setHeaders) {
|
|
42021
42030
|
stream.on("headers", setHeaders);
|
|
@@ -42162,10 +42171,10 @@ var require_src3 = __commonJS({
|
|
|
42162
42171
|
var fs_1 = __require("fs");
|
|
42163
42172
|
var debug_1 = __importDefault(require_src());
|
|
42164
42173
|
var log2 = debug_1.default("@kwsites/file-exists");
|
|
42165
|
-
function check(
|
|
42166
|
-
log2(`checking %s`,
|
|
42174
|
+
function check(path75, isFile, isDirectory) {
|
|
42175
|
+
log2(`checking %s`, path75);
|
|
42167
42176
|
try {
|
|
42168
|
-
const stat = fs_1.statSync(
|
|
42177
|
+
const stat = fs_1.statSync(path75);
|
|
42169
42178
|
if (stat.isFile() && isFile) {
|
|
42170
42179
|
log2(`[OK] path represents a file`);
|
|
42171
42180
|
return true;
|
|
@@ -42185,8 +42194,8 @@ var require_src3 = __commonJS({
|
|
|
42185
42194
|
throw e;
|
|
42186
42195
|
}
|
|
42187
42196
|
}
|
|
42188
|
-
function exists2(
|
|
42189
|
-
return check(
|
|
42197
|
+
function exists2(path75, type2 = exports.READABLE) {
|
|
42198
|
+
return check(path75, (type2 & exports.FILE) > 0, (type2 & exports.FOLDER) > 0);
|
|
42190
42199
|
}
|
|
42191
42200
|
exports.exists = exists2;
|
|
42192
42201
|
exports.FILE = 1;
|
|
@@ -46039,18 +46048,18 @@ function extractRouterMount(callNode, filePath) {
|
|
|
46039
46048
|
const routerName = args[0]?.type === "identifier" ? args[0].text : null;
|
|
46040
46049
|
if (!routerName)
|
|
46041
46050
|
return null;
|
|
46042
|
-
let
|
|
46051
|
+
let path75 = "/";
|
|
46043
46052
|
for (const arg of args) {
|
|
46044
46053
|
if (arg.type === "keyword_argument") {
|
|
46045
46054
|
const key4 = arg.childForFieldName("name")?.text;
|
|
46046
46055
|
const value = arg.childForFieldName("value");
|
|
46047
46056
|
if ((key4 === "url_prefix" || key4 === "prefix") && value) {
|
|
46048
|
-
|
|
46057
|
+
path75 = value.text.replace(/^["']|["']$/g, "");
|
|
46049
46058
|
}
|
|
46050
46059
|
}
|
|
46051
46060
|
}
|
|
46052
46061
|
return {
|
|
46053
|
-
path:
|
|
46062
|
+
path: path75,
|
|
46054
46063
|
routerName,
|
|
46055
46064
|
location: {
|
|
46056
46065
|
filePath,
|
|
@@ -46074,11 +46083,11 @@ function extractChainedRoute(outerCall, filePath) {
|
|
|
46074
46083
|
const innerArgs = innerCall.childForFieldName("arguments");
|
|
46075
46084
|
if (!innerArgs)
|
|
46076
46085
|
return null;
|
|
46077
|
-
let
|
|
46086
|
+
let path75 = null;
|
|
46078
46087
|
let httpMethod = methodName3 === "route" ? "GET" : methodName3.toUpperCase();
|
|
46079
46088
|
for (const arg of innerArgs.namedChildren) {
|
|
46080
|
-
if (!
|
|
46081
|
-
|
|
46089
|
+
if (!path75 && arg.type === "string") {
|
|
46090
|
+
path75 = arg.text.replace(/^["']|["']$/g, "");
|
|
46082
46091
|
}
|
|
46083
46092
|
if (arg.type === "keyword_argument") {
|
|
46084
46093
|
const key4 = arg.childForFieldName("name")?.text;
|
|
@@ -46090,14 +46099,14 @@ function extractChainedRoute(outerCall, filePath) {
|
|
|
46090
46099
|
}
|
|
46091
46100
|
}
|
|
46092
46101
|
}
|
|
46093
|
-
if (!
|
|
46102
|
+
if (!path75)
|
|
46094
46103
|
return null;
|
|
46095
46104
|
const outerArgs = outerCall.childForFieldName("arguments");
|
|
46096
46105
|
const handlerArg = outerArgs?.namedChildren[0];
|
|
46097
46106
|
const handlerName = handlerArg?.type === "identifier" ? handlerArg.text : "anonymous";
|
|
46098
46107
|
return {
|
|
46099
46108
|
httpMethod,
|
|
46100
|
-
path:
|
|
46109
|
+
path: path75,
|
|
46101
46110
|
handlerName,
|
|
46102
46111
|
location: {
|
|
46103
46112
|
filePath,
|
|
@@ -46159,11 +46168,11 @@ function collectGroupPrefixes(root) {
|
|
|
46159
46168
|
const fn = child.childForFieldName("function");
|
|
46160
46169
|
if (fn?.type === "member_access_expression" && fn.childForFieldName("name")?.text === "MapGroup") {
|
|
46161
46170
|
const args = child.childForFieldName("arguments");
|
|
46162
|
-
const
|
|
46163
|
-
if (name &&
|
|
46171
|
+
const path75 = args ? extractFirstStringArg(args) : null;
|
|
46172
|
+
if (name && path75) {
|
|
46164
46173
|
const receiver = fn.childForFieldName("expression")?.text ?? "";
|
|
46165
46174
|
const parentPrefix = prefixes.get(receiver) ?? "";
|
|
46166
|
-
prefixes.set(name, joinRoute(parentPrefix,
|
|
46175
|
+
prefixes.set(name, joinRoute(parentPrefix, path75));
|
|
46167
46176
|
}
|
|
46168
46177
|
}
|
|
46169
46178
|
}
|
|
@@ -46187,9 +46196,9 @@ function extractClassRoutePrefix(classNode) {
|
|
|
46187
46196
|
continue;
|
|
46188
46197
|
const args = childOfType(attr, "attribute_argument_list");
|
|
46189
46198
|
if (args) {
|
|
46190
|
-
const
|
|
46191
|
-
if (
|
|
46192
|
-
return
|
|
46199
|
+
const path75 = extractFirstStringArg(args);
|
|
46200
|
+
if (path75)
|
|
46201
|
+
return path75;
|
|
46193
46202
|
}
|
|
46194
46203
|
}
|
|
46195
46204
|
}
|
|
@@ -46212,16 +46221,16 @@ function extractAttributeRoute(methodNode, filePath, classContext) {
|
|
|
46212
46221
|
httpMethod = method;
|
|
46213
46222
|
const args = childOfType(attr, "attribute_argument_list");
|
|
46214
46223
|
if (args) {
|
|
46215
|
-
const
|
|
46216
|
-
if (
|
|
46217
|
-
routePath =
|
|
46224
|
+
const path75 = extractFirstStringArg(args);
|
|
46225
|
+
if (path75)
|
|
46226
|
+
routePath = path75;
|
|
46218
46227
|
}
|
|
46219
46228
|
} else if (name === "Route" && !routePath) {
|
|
46220
46229
|
const args = childOfType(attr, "attribute_argument_list");
|
|
46221
46230
|
if (args) {
|
|
46222
|
-
const
|
|
46223
|
-
if (
|
|
46224
|
-
routePath =
|
|
46231
|
+
const path75 = extractFirstStringArg(args);
|
|
46232
|
+
if (path75)
|
|
46233
|
+
routePath = path75;
|
|
46225
46234
|
}
|
|
46226
46235
|
}
|
|
46227
46236
|
}
|
|
@@ -46255,12 +46264,12 @@ function extractMinimalApiRoute(callNode, filePath, groupPrefixes) {
|
|
|
46255
46264
|
const argsNode = callNode.childForFieldName("arguments");
|
|
46256
46265
|
if (!argsNode)
|
|
46257
46266
|
return null;
|
|
46258
|
-
const
|
|
46259
|
-
if (
|
|
46267
|
+
const path75 = extractFirstStringArg(argsNode);
|
|
46268
|
+
if (path75 === null)
|
|
46260
46269
|
return null;
|
|
46261
46270
|
const receiver = funcNode.childForFieldName("expression")?.text ?? "";
|
|
46262
46271
|
const prefix = groupPrefixes.get(receiver) ?? "";
|
|
46263
|
-
let fullPath = joinRoute(prefix,
|
|
46272
|
+
let fullPath = joinRoute(prefix, path75);
|
|
46264
46273
|
if (!fullPath.startsWith("/"))
|
|
46265
46274
|
fullPath = "/" + fullPath;
|
|
46266
46275
|
let handlerName = "anonymous";
|
|
@@ -46287,11 +46296,11 @@ function childOfType(node2, type2) {
|
|
|
46287
46296
|
}
|
|
46288
46297
|
return null;
|
|
46289
46298
|
}
|
|
46290
|
-
function joinRoute(prefix,
|
|
46299
|
+
function joinRoute(prefix, path75) {
|
|
46291
46300
|
const p = prefix.replace(/\/$/, "");
|
|
46292
|
-
const s =
|
|
46301
|
+
const s = path75.replace(/^\//, "");
|
|
46293
46302
|
if (!p)
|
|
46294
|
-
return
|
|
46303
|
+
return path75;
|
|
46295
46304
|
if (!s)
|
|
46296
46305
|
return p;
|
|
46297
46306
|
return `${p}/${s}`;
|
|
@@ -46400,8 +46409,8 @@ function extractRoute(methodName3, argsNode, filePath, callNode) {
|
|
|
46400
46409
|
const firstArg = argsNode.namedChild(0);
|
|
46401
46410
|
if (!firstArg)
|
|
46402
46411
|
return null;
|
|
46403
|
-
const
|
|
46404
|
-
if (!
|
|
46412
|
+
const path75 = extractStringLiteral(firstArg);
|
|
46413
|
+
if (!path75)
|
|
46405
46414
|
return null;
|
|
46406
46415
|
const argCount = argsNode.namedChildCount;
|
|
46407
46416
|
if (argCount < 2)
|
|
@@ -46414,7 +46423,7 @@ function extractRoute(methodName3, argsNode, filePath, callNode) {
|
|
|
46414
46423
|
return null;
|
|
46415
46424
|
return {
|
|
46416
46425
|
httpMethod: methodName3.toUpperCase(),
|
|
46417
|
-
path:
|
|
46426
|
+
path: path75,
|
|
46418
46427
|
handlerName,
|
|
46419
46428
|
location: {
|
|
46420
46429
|
filePath,
|
|
@@ -46431,8 +46440,8 @@ function extractMount(argsNode, filePath, callNode) {
|
|
|
46431
46440
|
const firstArg = argsNode.namedChild(0);
|
|
46432
46441
|
if (!firstArg)
|
|
46433
46442
|
return null;
|
|
46434
|
-
const
|
|
46435
|
-
if (!
|
|
46443
|
+
const path75 = extractStringLiteral(firstArg);
|
|
46444
|
+
if (!path75)
|
|
46436
46445
|
return null;
|
|
46437
46446
|
const secondArg = argsNode.namedChild(1);
|
|
46438
46447
|
if (!secondArg)
|
|
@@ -46441,7 +46450,7 @@ function extractMount(argsNode, filePath, callNode) {
|
|
|
46441
46450
|
if (!routerName)
|
|
46442
46451
|
return null;
|
|
46443
46452
|
return {
|
|
46444
|
-
path:
|
|
46453
|
+
path: path75,
|
|
46445
46454
|
routerName,
|
|
46446
46455
|
location: {
|
|
46447
46456
|
filePath,
|
|
@@ -48972,11 +48981,11 @@ function buildCSharpSymbolIndex(files, rootPath) {
|
|
|
48972
48981
|
byFullName.get(full).push(decl);
|
|
48973
48982
|
}
|
|
48974
48983
|
const stats = { resolvedRefs: 0, ambiguousRefs: 0 };
|
|
48975
|
-
function resolveQualified(
|
|
48976
|
-
const exact = byFullName.get(
|
|
48984
|
+
function resolveQualified(path75) {
|
|
48985
|
+
const exact = byFullName.get(path75);
|
|
48977
48986
|
if (exact)
|
|
48978
48987
|
return exact;
|
|
48979
|
-
const parts =
|
|
48988
|
+
const parts = path75.split(".");
|
|
48980
48989
|
for (let i = parts.length - 1; i > 0; i--) {
|
|
48981
48990
|
const prefix = parts.slice(0, i).join(".");
|
|
48982
48991
|
const found = byFullName.get(prefix);
|
|
@@ -48990,8 +48999,8 @@ function buildCSharpSymbolIndex(files, rootPath) {
|
|
|
48990
48999
|
const firstDot = ref.name.indexOf(".");
|
|
48991
49000
|
const head = ref.name.slice(0, firstDot);
|
|
48992
49001
|
const aliasTarget2 = aliases.get(head);
|
|
48993
|
-
const
|
|
48994
|
-
return resolveQualified(
|
|
49002
|
+
const path75 = aliasTarget2 ? `${aliasTarget2}${ref.name.slice(firstDot)}` : ref.name;
|
|
49003
|
+
return resolveQualified(path75).filter((d) => isDeclVisibleFrom(d, ctx.project, fileProjects.get(d.filePath)));
|
|
48995
49004
|
}
|
|
48996
49005
|
const aliasTarget = aliases.get(ref.name);
|
|
48997
49006
|
if (aliasTarget) {
|
|
@@ -52112,9 +52121,9 @@ function detectDockerComposeServices(rootPath, allFiles) {
|
|
|
52112
52121
|
];
|
|
52113
52122
|
let composePath2 = null;
|
|
52114
52123
|
for (const file of composeFiles) {
|
|
52115
|
-
const
|
|
52116
|
-
if (existsSync6(
|
|
52117
|
-
composePath2 =
|
|
52124
|
+
const path75 = join8(rootPath, file);
|
|
52125
|
+
if (existsSync6(path75)) {
|
|
52126
|
+
composePath2 = path75;
|
|
52118
52127
|
break;
|
|
52119
52128
|
}
|
|
52120
52129
|
}
|
|
@@ -55334,9 +55343,9 @@ function findSimpleCycles(component, componentSet, adjacency) {
|
|
|
55334
55343
|
for (const next of successors) {
|
|
55335
55344
|
if (!componentSet.has(next))
|
|
55336
55345
|
continue;
|
|
55337
|
-
if (next === start &&
|
|
55338
|
-
const chain = [...
|
|
55339
|
-
const minNode =
|
|
55346
|
+
if (next === start && path75.length >= 2) {
|
|
55347
|
+
const chain = [...path75, start];
|
|
55348
|
+
const minNode = path75.reduce((a, b) => a < b ? a : b);
|
|
55340
55349
|
if (minNode === start) {
|
|
55341
55350
|
cycles.push(chain);
|
|
55342
55351
|
}
|
|
@@ -55344,15 +55353,15 @@ function findSimpleCycles(component, componentSet, adjacency) {
|
|
|
55344
55353
|
}
|
|
55345
55354
|
if (!visited.has(next) && !seen.has(next)) {
|
|
55346
55355
|
visited.add(next);
|
|
55347
|
-
|
|
55356
|
+
path75.push(next);
|
|
55348
55357
|
dfs2(next);
|
|
55349
|
-
|
|
55358
|
+
path75.pop();
|
|
55350
55359
|
visited.delete(next);
|
|
55351
55360
|
}
|
|
55352
55361
|
}
|
|
55353
55362
|
};
|
|
55354
55363
|
var dfs = dfs2;
|
|
55355
|
-
const
|
|
55364
|
+
const path75 = [start];
|
|
55356
55365
|
const visited = /* @__PURE__ */ new Set([start]);
|
|
55357
55366
|
dfs2(start);
|
|
55358
55367
|
seen.add(start);
|
|
@@ -55374,7 +55383,7 @@ function findShortestCycle(start, componentSet, adjacency) {
|
|
|
55374
55383
|
visited.add(next);
|
|
55375
55384
|
}
|
|
55376
55385
|
while (queue.length > 0) {
|
|
55377
|
-
const { node: node2, path:
|
|
55386
|
+
const { node: node2, path: path75 } = queue.shift();
|
|
55378
55387
|
const nexts = adjacency.get(node2);
|
|
55379
55388
|
if (!nexts)
|
|
55380
55389
|
continue;
|
|
@@ -55382,11 +55391,11 @@ function findShortestCycle(start, componentSet, adjacency) {
|
|
|
55382
55391
|
if (!componentSet.has(next))
|
|
55383
55392
|
continue;
|
|
55384
55393
|
if (next === start) {
|
|
55385
|
-
return [...
|
|
55394
|
+
return [...path75, start];
|
|
55386
55395
|
}
|
|
55387
55396
|
if (!visited.has(next)) {
|
|
55388
55397
|
visited.add(next);
|
|
55389
|
-
queue.push({ node: next, path: [...
|
|
55398
|
+
queue.push({ node: next, path: [...path75, next] });
|
|
55390
55399
|
}
|
|
55391
55400
|
}
|
|
55392
55401
|
}
|
|
@@ -138154,14 +138163,14 @@ var init_missing_error_status_code = __esm({
|
|
|
138154
138163
|
});
|
|
138155
138164
|
|
|
138156
138165
|
// packages/analyzer/dist/rules/architecture/visitors/javascript/route-without-auth-middleware.js
|
|
138157
|
-
function isPublicPath(
|
|
138158
|
-
return PUBLIC_PATH_PATTERNS.some((re) => re.test(
|
|
138166
|
+
function isPublicPath(path75) {
|
|
138167
|
+
return PUBLIC_PATH_PATTERNS.some((re) => re.test(path75));
|
|
138159
138168
|
}
|
|
138160
|
-
function isUrlCredentialAuthedPath(
|
|
138161
|
-
return URL_CREDENTIAL_PARAMS.test(
|
|
138169
|
+
function isUrlCredentialAuthedPath(path75) {
|
|
138170
|
+
return URL_CREDENTIAL_PARAMS.test(path75);
|
|
138162
138171
|
}
|
|
138163
|
-
function isApiDocsPath(
|
|
138164
|
-
return API_DOCS_PATH.test(
|
|
138172
|
+
function isApiDocsPath(path75) {
|
|
138173
|
+
return API_DOCS_PATH.test(path75);
|
|
138165
138174
|
}
|
|
138166
138175
|
function isFrameworkRequestHandler(arg) {
|
|
138167
138176
|
if (!arg)
|
|
@@ -138310,14 +138319,14 @@ var init_route_without_auth_middleware = __esm({
|
|
|
138310
138319
|
return null;
|
|
138311
138320
|
const firstArg = args.namedChildren[0];
|
|
138312
138321
|
if (firstArg?.type === "string" || firstArg?.type === "template_string") {
|
|
138313
|
-
const
|
|
138314
|
-
if (isPublicPath(
|
|
138322
|
+
const path75 = firstArg.text.replace(/^['"`]|['"`]$/g, "");
|
|
138323
|
+
if (isPublicPath(path75))
|
|
138315
138324
|
return null;
|
|
138316
|
-
if (isUrlCredentialAuthedPath(
|
|
138325
|
+
if (isUrlCredentialAuthedPath(path75))
|
|
138317
138326
|
return null;
|
|
138318
|
-
if (isApiDocsPath(
|
|
138327
|
+
if (isApiDocsPath(path75))
|
|
138319
138328
|
return null;
|
|
138320
|
-
if (
|
|
138329
|
+
if (path75 === "*" || path75 === "(.*)" || path75 === "/*") {
|
|
138321
138330
|
if (isFrameworkRequestHandler(args.namedChildren[args.namedChildren.length - 1])) {
|
|
138322
138331
|
return null;
|
|
138323
138332
|
}
|
|
@@ -173216,11 +173225,11 @@ var require_form_data = __commonJS({
|
|
|
173216
173225
|
"use strict";
|
|
173217
173226
|
var CombinedStream = require_combined_stream();
|
|
173218
173227
|
var util2 = __require("util");
|
|
173219
|
-
var
|
|
173228
|
+
var path75 = __require("path");
|
|
173220
173229
|
var http = __require("http");
|
|
173221
173230
|
var https = __require("https");
|
|
173222
173231
|
var parseUrl = __require("url").parse;
|
|
173223
|
-
var
|
|
173232
|
+
var fs68 = __require("fs");
|
|
173224
173233
|
var Stream = __require("stream").Stream;
|
|
173225
173234
|
var crypto6 = __require("crypto");
|
|
173226
173235
|
var mime = require_mime_types();
|
|
@@ -173287,7 +173296,7 @@ var require_form_data = __commonJS({
|
|
|
173287
173296
|
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
173288
173297
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
173289
173298
|
} else {
|
|
173290
|
-
|
|
173299
|
+
fs68.stat(value.path, function(err, stat) {
|
|
173291
173300
|
if (err) {
|
|
173292
173301
|
callback(err);
|
|
173293
173302
|
return;
|
|
@@ -173344,11 +173353,11 @@ var require_form_data = __commonJS({
|
|
|
173344
173353
|
FormData2.prototype._getContentDisposition = function(value, options) {
|
|
173345
173354
|
var filename;
|
|
173346
173355
|
if (typeof options.filepath === "string") {
|
|
173347
|
-
filename =
|
|
173356
|
+
filename = path75.normalize(options.filepath).replace(/\\/g, "/");
|
|
173348
173357
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
173349
|
-
filename =
|
|
173358
|
+
filename = path75.basename(options.filename || value && (value.name || value.path));
|
|
173350
173359
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
173351
|
-
filename =
|
|
173360
|
+
filename = path75.basename(value.client._httpMessage.path || "");
|
|
173352
173361
|
}
|
|
173353
173362
|
if (filename) {
|
|
173354
173363
|
return 'filename="' + filename + '"';
|
|
@@ -174578,9 +174587,9 @@ var require_axios = __commonJS({
|
|
|
174578
174587
|
function removeBrackets(key4) {
|
|
174579
174588
|
return utils$1.endsWith(key4, "[]") ? key4.slice(0, -2) : key4;
|
|
174580
174589
|
}
|
|
174581
|
-
function renderKey(
|
|
174582
|
-
if (!
|
|
174583
|
-
return
|
|
174590
|
+
function renderKey(path75, key4, dots) {
|
|
174591
|
+
if (!path75) return key4;
|
|
174592
|
+
return path75.concat(key4).map(function each(token, i) {
|
|
174584
174593
|
token = removeBrackets(token);
|
|
174585
174594
|
return !dots && i ? "[" + token + "]" : token;
|
|
174586
174595
|
}).join(dots ? "." : "");
|
|
@@ -174628,13 +174637,13 @@ var require_axios = __commonJS({
|
|
|
174628
174637
|
}
|
|
174629
174638
|
return value;
|
|
174630
174639
|
}
|
|
174631
|
-
function defaultVisitor(value, key4,
|
|
174640
|
+
function defaultVisitor(value, key4, path75) {
|
|
174632
174641
|
let arr = value;
|
|
174633
174642
|
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
174634
|
-
formData.append(renderKey(
|
|
174643
|
+
formData.append(renderKey(path75, key4, dots), convertValue(value));
|
|
174635
174644
|
return false;
|
|
174636
174645
|
}
|
|
174637
|
-
if (value && !
|
|
174646
|
+
if (value && !path75 && typeof value === "object") {
|
|
174638
174647
|
if (utils$1.endsWith(key4, "{}")) {
|
|
174639
174648
|
key4 = metaTokens ? key4 : key4.slice(0, -2);
|
|
174640
174649
|
value = JSON.stringify(value);
|
|
@@ -174653,7 +174662,7 @@ var require_axios = __commonJS({
|
|
|
174653
174662
|
if (isVisitable(value)) {
|
|
174654
174663
|
return true;
|
|
174655
174664
|
}
|
|
174656
|
-
formData.append(renderKey(
|
|
174665
|
+
formData.append(renderKey(path75, key4, dots), convertValue(value));
|
|
174657
174666
|
return false;
|
|
174658
174667
|
}
|
|
174659
174668
|
const stack2 = [];
|
|
@@ -174662,16 +174671,16 @@ var require_axios = __commonJS({
|
|
|
174662
174671
|
convertValue,
|
|
174663
174672
|
isVisitable
|
|
174664
174673
|
});
|
|
174665
|
-
function build8(value,
|
|
174674
|
+
function build8(value, path75) {
|
|
174666
174675
|
if (utils$1.isUndefined(value)) return;
|
|
174667
174676
|
if (stack2.indexOf(value) !== -1) {
|
|
174668
|
-
throw Error("Circular reference detected in " +
|
|
174677
|
+
throw Error("Circular reference detected in " + path75.join("."));
|
|
174669
174678
|
}
|
|
174670
174679
|
stack2.push(value);
|
|
174671
174680
|
utils$1.forEach(value, function each(el, key4) {
|
|
174672
|
-
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key4) ? key4.trim() : key4,
|
|
174681
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key4) ? key4.trim() : key4, path75, exposedHelpers);
|
|
174673
174682
|
if (result === true) {
|
|
174674
|
-
build8(el,
|
|
174683
|
+
build8(el, path75 ? path75.concat(key4) : [key4]);
|
|
174675
174684
|
}
|
|
174676
174685
|
});
|
|
174677
174686
|
stack2.pop();
|
|
@@ -174860,7 +174869,7 @@ var require_axios = __commonJS({
|
|
|
174860
174869
|
};
|
|
174861
174870
|
function toURLEncodedForm(data, options) {
|
|
174862
174871
|
return toFormData(data, new platform.classes.URLSearchParams(), {
|
|
174863
|
-
visitor: function(value, key4,
|
|
174872
|
+
visitor: function(value, key4, path75, helpers) {
|
|
174864
174873
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
174865
174874
|
this.append(key4, value.toString("base64"));
|
|
174866
174875
|
return false;
|
|
@@ -174888,11 +174897,11 @@ var require_axios = __commonJS({
|
|
|
174888
174897
|
return obj;
|
|
174889
174898
|
}
|
|
174890
174899
|
function formDataToJSON(formData) {
|
|
174891
|
-
function buildPath(
|
|
174892
|
-
let name =
|
|
174900
|
+
function buildPath(path75, value, target, index) {
|
|
174901
|
+
let name = path75[index++];
|
|
174893
174902
|
if (name === "__proto__") return true;
|
|
174894
174903
|
const isNumericKey = Number.isFinite(+name);
|
|
174895
|
-
const isLast = index >=
|
|
174904
|
+
const isLast = index >= path75.length;
|
|
174896
174905
|
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
174897
174906
|
if (isLast) {
|
|
174898
174907
|
if (utils$1.hasOwnProp(target, name)) {
|
|
@@ -174905,7 +174914,7 @@ var require_axios = __commonJS({
|
|
|
174905
174914
|
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
174906
174915
|
target[name] = [];
|
|
174907
174916
|
}
|
|
174908
|
-
const result = buildPath(
|
|
174917
|
+
const result = buildPath(path75, value, target[name], index);
|
|
174909
174918
|
if (result && utils$1.isArray(target[name])) {
|
|
174910
174919
|
target[name] = arrayToObject(target[name]);
|
|
174911
174920
|
}
|
|
@@ -176223,9 +176232,9 @@ var require_axios = __commonJS({
|
|
|
176223
176232
|
auth = urlUsername + ":" + urlPassword;
|
|
176224
176233
|
}
|
|
176225
176234
|
auth && headers.delete("authorization");
|
|
176226
|
-
let
|
|
176235
|
+
let path75;
|
|
176227
176236
|
try {
|
|
176228
|
-
|
|
176237
|
+
path75 = buildURL(parsed.pathname + parsed.search, config2.params, config2.paramsSerializer).replace(/^\?/, "");
|
|
176229
176238
|
} catch (err) {
|
|
176230
176239
|
const customErr = new Error(err.message);
|
|
176231
176240
|
customErr.config = config2;
|
|
@@ -176235,7 +176244,7 @@ var require_axios = __commonJS({
|
|
|
176235
176244
|
}
|
|
176236
176245
|
headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
|
|
176237
176246
|
const options = {
|
|
176238
|
-
path:
|
|
176247
|
+
path: path75,
|
|
176239
176248
|
method,
|
|
176240
176249
|
headers: headers.toJSON(),
|
|
176241
176250
|
agents: {
|
|
@@ -176441,14 +176450,14 @@ var require_axios = __commonJS({
|
|
|
176441
176450
|
var cookies = platform.hasStandardBrowserEnv ? (
|
|
176442
176451
|
// Standard browser envs support document.cookie
|
|
176443
176452
|
{
|
|
176444
|
-
write(name, value, expires,
|
|
176453
|
+
write(name, value, expires, path75, domain, secure, sameSite) {
|
|
176445
176454
|
if (typeof document === "undefined") return;
|
|
176446
176455
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
176447
176456
|
if (utils$1.isNumber(expires)) {
|
|
176448
176457
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
176449
176458
|
}
|
|
176450
|
-
if (utils$1.isString(
|
|
176451
|
-
cookie.push(`path=${
|
|
176459
|
+
if (utils$1.isString(path75)) {
|
|
176460
|
+
cookie.push(`path=${path75}`);
|
|
176452
176461
|
}
|
|
176453
176462
|
if (utils$1.isString(domain)) {
|
|
176454
176463
|
cookie.push(`domain=${domain}`);
|
|
@@ -177600,8 +177609,8 @@ var require_windows = __commonJS({
|
|
|
177600
177609
|
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
|
|
177601
177610
|
module.exports = isexe;
|
|
177602
177611
|
isexe.sync = sync;
|
|
177603
|
-
var
|
|
177604
|
-
function checkPathExt(
|
|
177612
|
+
var fs68 = __require("fs");
|
|
177613
|
+
function checkPathExt(path75, options) {
|
|
177605
177614
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
177606
177615
|
if (!pathext) {
|
|
177607
177616
|
return true;
|
|
@@ -177612,25 +177621,25 @@ var require_windows = __commonJS({
|
|
|
177612
177621
|
}
|
|
177613
177622
|
for (var i = 0; i < pathext.length; i++) {
|
|
177614
177623
|
var p = pathext[i].toLowerCase();
|
|
177615
|
-
if (p &&
|
|
177624
|
+
if (p && path75.substr(-p.length).toLowerCase() === p) {
|
|
177616
177625
|
return true;
|
|
177617
177626
|
}
|
|
177618
177627
|
}
|
|
177619
177628
|
return false;
|
|
177620
177629
|
}
|
|
177621
|
-
function checkStat(stat,
|
|
177630
|
+
function checkStat(stat, path75, options) {
|
|
177622
177631
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
177623
177632
|
return false;
|
|
177624
177633
|
}
|
|
177625
|
-
return checkPathExt(
|
|
177634
|
+
return checkPathExt(path75, options);
|
|
177626
177635
|
}
|
|
177627
|
-
function isexe(
|
|
177628
|
-
|
|
177629
|
-
cb(er, er ? false : checkStat(stat,
|
|
177636
|
+
function isexe(path75, options, cb) {
|
|
177637
|
+
fs68.stat(path75, function(er, stat) {
|
|
177638
|
+
cb(er, er ? false : checkStat(stat, path75, options));
|
|
177630
177639
|
});
|
|
177631
177640
|
}
|
|
177632
|
-
function sync(
|
|
177633
|
-
return checkStat(
|
|
177641
|
+
function sync(path75, options) {
|
|
177642
|
+
return checkStat(fs68.statSync(path75), path75, options);
|
|
177634
177643
|
}
|
|
177635
177644
|
}
|
|
177636
177645
|
});
|
|
@@ -177640,14 +177649,14 @@ var require_mode = __commonJS({
|
|
|
177640
177649
|
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
|
|
177641
177650
|
module.exports = isexe;
|
|
177642
177651
|
isexe.sync = sync;
|
|
177643
|
-
var
|
|
177644
|
-
function isexe(
|
|
177645
|
-
|
|
177652
|
+
var fs68 = __require("fs");
|
|
177653
|
+
function isexe(path75, options, cb) {
|
|
177654
|
+
fs68.stat(path75, function(er, stat) {
|
|
177646
177655
|
cb(er, er ? false : checkStat(stat, options));
|
|
177647
177656
|
});
|
|
177648
177657
|
}
|
|
177649
|
-
function sync(
|
|
177650
|
-
return checkStat(
|
|
177658
|
+
function sync(path75, options) {
|
|
177659
|
+
return checkStat(fs68.statSync(path75), options);
|
|
177651
177660
|
}
|
|
177652
177661
|
function checkStat(stat, options) {
|
|
177653
177662
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -177671,7 +177680,7 @@ var require_mode = __commonJS({
|
|
|
177671
177680
|
// node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
177672
177681
|
var require_isexe = __commonJS({
|
|
177673
177682
|
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
177674
|
-
var
|
|
177683
|
+
var fs68 = __require("fs");
|
|
177675
177684
|
var core2;
|
|
177676
177685
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
177677
177686
|
core2 = require_windows();
|
|
@@ -177680,7 +177689,7 @@ var require_isexe = __commonJS({
|
|
|
177680
177689
|
}
|
|
177681
177690
|
module.exports = isexe;
|
|
177682
177691
|
isexe.sync = sync;
|
|
177683
|
-
function isexe(
|
|
177692
|
+
function isexe(path75, options, cb) {
|
|
177684
177693
|
if (typeof options === "function") {
|
|
177685
177694
|
cb = options;
|
|
177686
177695
|
options = {};
|
|
@@ -177690,7 +177699,7 @@ var require_isexe = __commonJS({
|
|
|
177690
177699
|
throw new TypeError("callback not provided");
|
|
177691
177700
|
}
|
|
177692
177701
|
return new Promise(function(resolve11, reject) {
|
|
177693
|
-
isexe(
|
|
177702
|
+
isexe(path75, options || {}, function(er, is) {
|
|
177694
177703
|
if (er) {
|
|
177695
177704
|
reject(er);
|
|
177696
177705
|
} else {
|
|
@@ -177699,7 +177708,7 @@ var require_isexe = __commonJS({
|
|
|
177699
177708
|
});
|
|
177700
177709
|
});
|
|
177701
177710
|
}
|
|
177702
|
-
core2(
|
|
177711
|
+
core2(path75, options || {}, function(er, is) {
|
|
177703
177712
|
if (er) {
|
|
177704
177713
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
177705
177714
|
er = null;
|
|
@@ -177709,9 +177718,9 @@ var require_isexe = __commonJS({
|
|
|
177709
177718
|
cb(er, is);
|
|
177710
177719
|
});
|
|
177711
177720
|
}
|
|
177712
|
-
function sync(
|
|
177721
|
+
function sync(path75, options) {
|
|
177713
177722
|
try {
|
|
177714
|
-
return core2.sync(
|
|
177723
|
+
return core2.sync(path75, options || {});
|
|
177715
177724
|
} catch (er) {
|
|
177716
177725
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
177717
177726
|
return false;
|
|
@@ -177727,7 +177736,7 @@ var require_isexe = __commonJS({
|
|
|
177727
177736
|
var require_which = __commonJS({
|
|
177728
177737
|
"node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
|
|
177729
177738
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
177730
|
-
var
|
|
177739
|
+
var path75 = __require("path");
|
|
177731
177740
|
var COLON = isWindows ? ";" : ":";
|
|
177732
177741
|
var isexe = require_isexe();
|
|
177733
177742
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -177765,7 +177774,7 @@ var require_which = __commonJS({
|
|
|
177765
177774
|
return opt.all && found.length ? resolve11(found) : reject(getNotFoundError(cmd));
|
|
177766
177775
|
const ppRaw = pathEnv[i];
|
|
177767
177776
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
177768
|
-
const pCmd =
|
|
177777
|
+
const pCmd = path75.join(pathPart, cmd);
|
|
177769
177778
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
177770
177779
|
resolve11(subStep(p, i, 0));
|
|
177771
177780
|
});
|
|
@@ -177792,7 +177801,7 @@ var require_which = __commonJS({
|
|
|
177792
177801
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
177793
177802
|
const ppRaw = pathEnv[i];
|
|
177794
177803
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
177795
|
-
const pCmd =
|
|
177804
|
+
const pCmd = path75.join(pathPart, cmd);
|
|
177796
177805
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
177797
177806
|
for (let j = 0; j < pathExt.length; j++) {
|
|
177798
177807
|
const cur = p + pathExt[j];
|
|
@@ -177840,7 +177849,7 @@ var require_path_key = __commonJS({
|
|
|
177840
177849
|
var require_resolveCommand = __commonJS({
|
|
177841
177850
|
"node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
177842
177851
|
"use strict";
|
|
177843
|
-
var
|
|
177852
|
+
var path75 = __require("path");
|
|
177844
177853
|
var which = require_which();
|
|
177845
177854
|
var getPathKey = require_path_key();
|
|
177846
177855
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -177858,7 +177867,7 @@ var require_resolveCommand = __commonJS({
|
|
|
177858
177867
|
try {
|
|
177859
177868
|
resolved = which.sync(parsed.command, {
|
|
177860
177869
|
path: env[getPathKey({ env })],
|
|
177861
|
-
pathExt: withoutPathExt ?
|
|
177870
|
+
pathExt: withoutPathExt ? path75.delimiter : void 0
|
|
177862
177871
|
});
|
|
177863
177872
|
} catch (e) {
|
|
177864
177873
|
} finally {
|
|
@@ -177867,7 +177876,7 @@ var require_resolveCommand = __commonJS({
|
|
|
177867
177876
|
}
|
|
177868
177877
|
}
|
|
177869
177878
|
if (resolved) {
|
|
177870
|
-
resolved =
|
|
177879
|
+
resolved = path75.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
177871
177880
|
}
|
|
177872
177881
|
return resolved;
|
|
177873
177882
|
}
|
|
@@ -177921,8 +177930,8 @@ var require_shebang_command = __commonJS({
|
|
|
177921
177930
|
if (!match4) {
|
|
177922
177931
|
return null;
|
|
177923
177932
|
}
|
|
177924
|
-
const [
|
|
177925
|
-
const binary2 =
|
|
177933
|
+
const [path75, argument] = match4[0].replace(/#! ?/, "").split(" ");
|
|
177934
|
+
const binary2 = path75.split("/").pop();
|
|
177926
177935
|
if (binary2 === "env") {
|
|
177927
177936
|
return argument;
|
|
177928
177937
|
}
|
|
@@ -177935,16 +177944,16 @@ var require_shebang_command = __commonJS({
|
|
|
177935
177944
|
var require_readShebang = __commonJS({
|
|
177936
177945
|
"node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
177937
177946
|
"use strict";
|
|
177938
|
-
var
|
|
177947
|
+
var fs68 = __require("fs");
|
|
177939
177948
|
var shebangCommand = require_shebang_command();
|
|
177940
177949
|
function readShebang(command) {
|
|
177941
177950
|
const size = 150;
|
|
177942
177951
|
const buffer = Buffer.alloc(size);
|
|
177943
177952
|
let fd;
|
|
177944
177953
|
try {
|
|
177945
|
-
fd =
|
|
177946
|
-
|
|
177947
|
-
|
|
177954
|
+
fd = fs68.openSync(command, "r");
|
|
177955
|
+
fs68.readSync(fd, buffer, 0, size, 0);
|
|
177956
|
+
fs68.closeSync(fd);
|
|
177948
177957
|
} catch (e) {
|
|
177949
177958
|
}
|
|
177950
177959
|
return shebangCommand(buffer.toString());
|
|
@@ -177957,7 +177966,7 @@ var require_readShebang = __commonJS({
|
|
|
177957
177966
|
var require_parse2 = __commonJS({
|
|
177958
177967
|
"node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
177959
177968
|
"use strict";
|
|
177960
|
-
var
|
|
177969
|
+
var path75 = __require("path");
|
|
177961
177970
|
var resolveCommand = require_resolveCommand();
|
|
177962
177971
|
var escape3 = require_escape();
|
|
177963
177972
|
var readShebang = require_readShebang();
|
|
@@ -177982,7 +177991,7 @@ var require_parse2 = __commonJS({
|
|
|
177982
177991
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
177983
177992
|
if (parsed.options.forceShell || needsShell) {
|
|
177984
177993
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
177985
|
-
parsed.command =
|
|
177994
|
+
parsed.command = path75.normalize(parsed.command);
|
|
177986
177995
|
parsed.command = escape3.command(parsed.command);
|
|
177987
177996
|
parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
|
|
177988
177997
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -178873,8 +178882,8 @@ var init_cli_provider = __esm({
|
|
|
178873
178882
|
this._repoId = repoId;
|
|
178874
178883
|
}
|
|
178875
178884
|
/** Set target repo path — used as cwd when spawning CLI so Read tool accesses the right files. */
|
|
178876
|
-
setRepoPath(
|
|
178877
|
-
this._repoPath =
|
|
178885
|
+
setRepoPath(path75) {
|
|
178886
|
+
this._repoPath = path75;
|
|
178878
178887
|
}
|
|
178879
178888
|
flushUsage() {
|
|
178880
178889
|
if (this._usageRecords.length === 0)
|
|
@@ -182166,11 +182175,11 @@ var require_baseGet = __commonJS({
|
|
|
182166
182175
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseGet.js"(exports, module) {
|
|
182167
182176
|
var castPath = require_castPath();
|
|
182168
182177
|
var toKey = require_toKey();
|
|
182169
|
-
function baseGet(object,
|
|
182170
|
-
|
|
182171
|
-
var index = 0, length =
|
|
182178
|
+
function baseGet(object, path75) {
|
|
182179
|
+
path75 = castPath(path75, object);
|
|
182180
|
+
var index = 0, length = path75.length;
|
|
182172
182181
|
while (object != null && index < length) {
|
|
182173
|
-
object = object[toKey(
|
|
182182
|
+
object = object[toKey(path75[index++])];
|
|
182174
182183
|
}
|
|
182175
182184
|
return index && index == length ? object : void 0;
|
|
182176
182185
|
}
|
|
@@ -182182,8 +182191,8 @@ var require_baseGet = __commonJS({
|
|
|
182182
182191
|
var require_get2 = __commonJS({
|
|
182183
182192
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/get.js"(exports, module) {
|
|
182184
182193
|
var baseGet = require_baseGet();
|
|
182185
|
-
function get(object,
|
|
182186
|
-
var result = object == null ? void 0 : baseGet(object,
|
|
182194
|
+
function get(object, path75, defaultValue) {
|
|
182195
|
+
var result = object == null ? void 0 : baseGet(object, path75);
|
|
182187
182196
|
return result === void 0 ? defaultValue : result;
|
|
182188
182197
|
}
|
|
182189
182198
|
module.exports = get;
|
|
@@ -182209,11 +182218,11 @@ var require_hasPath = __commonJS({
|
|
|
182209
182218
|
var isIndex = require_isIndex();
|
|
182210
182219
|
var isLength = require_isLength();
|
|
182211
182220
|
var toKey = require_toKey();
|
|
182212
|
-
function hasPath(object,
|
|
182213
|
-
|
|
182214
|
-
var index = -1, length =
|
|
182221
|
+
function hasPath(object, path75, hasFunc) {
|
|
182222
|
+
path75 = castPath(path75, object);
|
|
182223
|
+
var index = -1, length = path75.length, result = false;
|
|
182215
182224
|
while (++index < length) {
|
|
182216
|
-
var key4 = toKey(
|
|
182225
|
+
var key4 = toKey(path75[index]);
|
|
182217
182226
|
if (!(result = object != null && hasFunc(object, key4))) {
|
|
182218
182227
|
break;
|
|
182219
182228
|
}
|
|
@@ -182234,8 +182243,8 @@ var require_hasIn = __commonJS({
|
|
|
182234
182243
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/hasIn.js"(exports, module) {
|
|
182235
182244
|
var baseHasIn = require_baseHasIn();
|
|
182236
182245
|
var hasPath = require_hasPath();
|
|
182237
|
-
function hasIn(object,
|
|
182238
|
-
return object != null && hasPath(object,
|
|
182246
|
+
function hasIn(object, path75) {
|
|
182247
|
+
return object != null && hasPath(object, path75, baseHasIn);
|
|
182239
182248
|
}
|
|
182240
182249
|
module.exports = hasIn;
|
|
182241
182250
|
}
|
|
@@ -182253,13 +182262,13 @@ var require_baseMatchesProperty = __commonJS({
|
|
|
182253
182262
|
var toKey = require_toKey();
|
|
182254
182263
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
182255
182264
|
var COMPARE_UNORDERED_FLAG = 2;
|
|
182256
|
-
function baseMatchesProperty(
|
|
182257
|
-
if (isKey(
|
|
182258
|
-
return matchesStrictComparable(toKey(
|
|
182265
|
+
function baseMatchesProperty(path75, srcValue) {
|
|
182266
|
+
if (isKey(path75) && isStrictComparable(srcValue)) {
|
|
182267
|
+
return matchesStrictComparable(toKey(path75), srcValue);
|
|
182259
182268
|
}
|
|
182260
182269
|
return function(object) {
|
|
182261
|
-
var objValue = get(object,
|
|
182262
|
-
return objValue === void 0 && objValue === srcValue ? hasIn(object,
|
|
182270
|
+
var objValue = get(object, path75);
|
|
182271
|
+
return objValue === void 0 && objValue === srcValue ? hasIn(object, path75) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
182263
182272
|
};
|
|
182264
182273
|
}
|
|
182265
182274
|
module.exports = baseMatchesProperty;
|
|
@@ -182282,9 +182291,9 @@ var require_baseProperty = __commonJS({
|
|
|
182282
182291
|
var require_basePropertyDeep = __commonJS({
|
|
182283
182292
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_basePropertyDeep.js"(exports, module) {
|
|
182284
182293
|
var baseGet = require_baseGet();
|
|
182285
|
-
function basePropertyDeep(
|
|
182294
|
+
function basePropertyDeep(path75) {
|
|
182286
182295
|
return function(object) {
|
|
182287
|
-
return baseGet(object,
|
|
182296
|
+
return baseGet(object, path75);
|
|
182288
182297
|
};
|
|
182289
182298
|
}
|
|
182290
182299
|
module.exports = basePropertyDeep;
|
|
@@ -182298,8 +182307,8 @@ var require_property = __commonJS({
|
|
|
182298
182307
|
var basePropertyDeep = require_basePropertyDeep();
|
|
182299
182308
|
var isKey = require_isKey();
|
|
182300
182309
|
var toKey = require_toKey();
|
|
182301
|
-
function property(
|
|
182302
|
-
return isKey(
|
|
182310
|
+
function property(path75) {
|
|
182311
|
+
return isKey(path75) ? baseProperty(toKey(path75)) : basePropertyDeep(path75);
|
|
182303
182312
|
}
|
|
182304
182313
|
module.exports = property;
|
|
182305
182314
|
}
|
|
@@ -182361,8 +182370,8 @@ var require_has = __commonJS({
|
|
|
182361
182370
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/has.js"(exports, module) {
|
|
182362
182371
|
var baseHas = require_baseHas();
|
|
182363
182372
|
var hasPath = require_hasPath();
|
|
182364
|
-
function has(object,
|
|
182365
|
-
return object != null && hasPath(object,
|
|
182373
|
+
function has(object, path75) {
|
|
182374
|
+
return object != null && hasPath(object, path75, baseHas);
|
|
182366
182375
|
}
|
|
182367
182376
|
module.exports = has;
|
|
182368
182377
|
}
|
|
@@ -184636,14 +184645,14 @@ var require_baseSet = __commonJS({
|
|
|
184636
184645
|
var isIndex = require_isIndex();
|
|
184637
184646
|
var isObject2 = require_isObject();
|
|
184638
184647
|
var toKey = require_toKey();
|
|
184639
|
-
function baseSet(object,
|
|
184648
|
+
function baseSet(object, path75, value, customizer) {
|
|
184640
184649
|
if (!isObject2(object)) {
|
|
184641
184650
|
return object;
|
|
184642
184651
|
}
|
|
184643
|
-
|
|
184644
|
-
var index = -1, length =
|
|
184652
|
+
path75 = castPath(path75, object);
|
|
184653
|
+
var index = -1, length = path75.length, lastIndex = length - 1, nested = object;
|
|
184645
184654
|
while (nested != null && ++index < length) {
|
|
184646
|
-
var key4 = toKey(
|
|
184655
|
+
var key4 = toKey(path75[index]), newValue = value;
|
|
184647
184656
|
if (key4 === "__proto__" || key4 === "constructor" || key4 === "prototype") {
|
|
184648
184657
|
return object;
|
|
184649
184658
|
}
|
|
@@ -184651,7 +184660,7 @@ var require_baseSet = __commonJS({
|
|
|
184651
184660
|
var objValue = nested[key4];
|
|
184652
184661
|
newValue = customizer ? customizer(objValue, key4, nested) : void 0;
|
|
184653
184662
|
if (newValue === void 0) {
|
|
184654
|
-
newValue = isObject2(objValue) ? objValue : isIndex(
|
|
184663
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path75[index + 1]) ? [] : {};
|
|
184655
184664
|
}
|
|
184656
184665
|
}
|
|
184657
184666
|
assignValue(nested, key4, newValue);
|
|
@@ -184672,9 +184681,9 @@ var require_basePickBy = __commonJS({
|
|
|
184672
184681
|
function basePickBy(object, paths, predicate) {
|
|
184673
184682
|
var index = -1, length = paths.length, result = {};
|
|
184674
184683
|
while (++index < length) {
|
|
184675
|
-
var
|
|
184676
|
-
if (predicate(value,
|
|
184677
|
-
baseSet(result, castPath(
|
|
184684
|
+
var path75 = paths[index], value = baseGet(object, path75);
|
|
184685
|
+
if (predicate(value, path75)) {
|
|
184686
|
+
baseSet(result, castPath(path75, object), value);
|
|
184678
184687
|
}
|
|
184679
184688
|
}
|
|
184680
184689
|
return result;
|
|
@@ -184689,8 +184698,8 @@ var require_basePick = __commonJS({
|
|
|
184689
184698
|
var basePickBy = require_basePickBy();
|
|
184690
184699
|
var hasIn = require_hasIn();
|
|
184691
184700
|
function basePick(object, paths) {
|
|
184692
|
-
return basePickBy(object, paths, function(value,
|
|
184693
|
-
return hasIn(object,
|
|
184701
|
+
return basePickBy(object, paths, function(value, path75) {
|
|
184702
|
+
return hasIn(object, path75);
|
|
184694
184703
|
});
|
|
184695
184704
|
}
|
|
184696
184705
|
module.exports = basePick;
|
|
@@ -185744,15 +185753,15 @@ var require_parent_dummy_chains = __commonJS({
|
|
|
185744
185753
|
var node2 = g.node(v);
|
|
185745
185754
|
var edgeObj = node2.edgeObj;
|
|
185746
185755
|
var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);
|
|
185747
|
-
var
|
|
185756
|
+
var path75 = pathData.path;
|
|
185748
185757
|
var lca = pathData.lca;
|
|
185749
185758
|
var pathIdx = 0;
|
|
185750
|
-
var pathV =
|
|
185759
|
+
var pathV = path75[pathIdx];
|
|
185751
185760
|
var ascending = true;
|
|
185752
185761
|
while (v !== edgeObj.w) {
|
|
185753
185762
|
node2 = g.node(v);
|
|
185754
185763
|
if (ascending) {
|
|
185755
|
-
while ((pathV =
|
|
185764
|
+
while ((pathV = path75[pathIdx]) !== lca && g.node(pathV).maxRank < node2.rank) {
|
|
185756
185765
|
pathIdx++;
|
|
185757
185766
|
}
|
|
185758
185767
|
if (pathV === lca) {
|
|
@@ -185760,10 +185769,10 @@ var require_parent_dummy_chains = __commonJS({
|
|
|
185760
185769
|
}
|
|
185761
185770
|
}
|
|
185762
185771
|
if (!ascending) {
|
|
185763
|
-
while (pathIdx <
|
|
185772
|
+
while (pathIdx < path75.length - 1 && g.node(pathV = path75[pathIdx + 1]).minRank <= node2.rank) {
|
|
185764
185773
|
pathIdx++;
|
|
185765
185774
|
}
|
|
185766
|
-
pathV =
|
|
185775
|
+
pathV = path75[pathIdx];
|
|
185767
185776
|
}
|
|
185768
185777
|
g.setParent(v, pathV);
|
|
185769
185778
|
v = g.successors(v)[0];
|
|
@@ -187265,7 +187274,7 @@ var require_dagre = __commonJS({
|
|
|
187265
187274
|
// apps/dashboard/server/src/index.ts
|
|
187266
187275
|
init_env();
|
|
187267
187276
|
import { createServer } from "http";
|
|
187268
|
-
import
|
|
187277
|
+
import path74 from "node:path";
|
|
187269
187278
|
|
|
187270
187279
|
// node_modules/.pnpm/socket.io@4.8.3/node_modules/socket.io/wrapper.mjs
|
|
187271
187280
|
var import_dist = __toESM(require_dist2(), 1);
|
|
@@ -187550,9 +187559,9 @@ function getIO() {
|
|
|
187550
187559
|
// apps/dashboard/server/src/app.ts
|
|
187551
187560
|
var import_express16 = __toESM(require_express2(), 1);
|
|
187552
187561
|
var import_cors = __toESM(require_lib(), 1);
|
|
187553
|
-
import
|
|
187562
|
+
import fs67 from "node:fs";
|
|
187554
187563
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
187555
|
-
import
|
|
187564
|
+
import path73 from "node:path";
|
|
187556
187565
|
|
|
187557
187566
|
// apps/dashboard/server/src/middleware/error.ts
|
|
187558
187567
|
init_logger();
|
|
@@ -187760,7 +187769,7 @@ async function projectResolver(req, res, next) {
|
|
|
187760
187769
|
// apps/dashboard/server/src/routes/repos.ts
|
|
187761
187770
|
var import_express = __toESM(require_express2(), 1);
|
|
187762
187771
|
init_dist();
|
|
187763
|
-
import * as
|
|
187772
|
+
import * as fs61 from "fs";
|
|
187764
187773
|
|
|
187765
187774
|
// packages/core/dist/lib/errors.js
|
|
187766
187775
|
function createAppError(message, statusCode) {
|
|
@@ -187806,8 +187815,8 @@ function pathspec(...paths) {
|
|
|
187806
187815
|
cache.set(key4, paths);
|
|
187807
187816
|
return key4;
|
|
187808
187817
|
}
|
|
187809
|
-
function isPathSpec(
|
|
187810
|
-
return
|
|
187818
|
+
function isPathSpec(path75) {
|
|
187819
|
+
return path75 instanceof String && cache.has(path75);
|
|
187811
187820
|
}
|
|
187812
187821
|
function toPaths(pathSpec) {
|
|
187813
187822
|
return cache.get(pathSpec) || [];
|
|
@@ -187896,8 +187905,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
|
|
|
187896
187905
|
function forEachLineWithContent(input, callback) {
|
|
187897
187906
|
return toLinesWithContent(input, true).map((line) => callback(line));
|
|
187898
187907
|
}
|
|
187899
|
-
function folderExists(
|
|
187900
|
-
return (0, import_file_exists.exists)(
|
|
187908
|
+
function folderExists(path75) {
|
|
187909
|
+
return (0, import_file_exists.exists)(path75, import_file_exists.FOLDER);
|
|
187901
187910
|
}
|
|
187902
187911
|
function append(target, item) {
|
|
187903
187912
|
if (Array.isArray(target)) {
|
|
@@ -188301,8 +188310,8 @@ function checkIsRepoRootTask() {
|
|
|
188301
188310
|
commands,
|
|
188302
188311
|
format: "utf-8",
|
|
188303
188312
|
onError,
|
|
188304
|
-
parser(
|
|
188305
|
-
return /^\.(git)?$/.test(
|
|
188313
|
+
parser(path75) {
|
|
188314
|
+
return /^\.(git)?$/.test(path75.trim());
|
|
188306
188315
|
}
|
|
188307
188316
|
};
|
|
188308
188317
|
}
|
|
@@ -188736,11 +188745,11 @@ function parseGrep(grep) {
|
|
|
188736
188745
|
const paths = /* @__PURE__ */ new Set();
|
|
188737
188746
|
const results = {};
|
|
188738
188747
|
forEachLineWithContent(grep, (input) => {
|
|
188739
|
-
const [
|
|
188740
|
-
paths.add(
|
|
188741
|
-
(results[
|
|
188748
|
+
const [path75, line, preview] = input.split(NULL);
|
|
188749
|
+
paths.add(path75);
|
|
188750
|
+
(results[path75] = results[path75] || []).push({
|
|
188742
188751
|
line: asNumber(line),
|
|
188743
|
-
path:
|
|
188752
|
+
path: path75,
|
|
188744
188753
|
preview
|
|
188745
188754
|
});
|
|
188746
188755
|
});
|
|
@@ -189505,14 +189514,14 @@ var init_hash_object = __esm2({
|
|
|
189505
189514
|
init_task();
|
|
189506
189515
|
}
|
|
189507
189516
|
});
|
|
189508
|
-
function parseInit(bare,
|
|
189517
|
+
function parseInit(bare, path75, text4) {
|
|
189509
189518
|
const response = String(text4).trim();
|
|
189510
189519
|
let result;
|
|
189511
189520
|
if (result = initResponseRegex.exec(response)) {
|
|
189512
|
-
return new InitSummary(bare,
|
|
189521
|
+
return new InitSummary(bare, path75, false, result[1]);
|
|
189513
189522
|
}
|
|
189514
189523
|
if (result = reInitResponseRegex.exec(response)) {
|
|
189515
|
-
return new InitSummary(bare,
|
|
189524
|
+
return new InitSummary(bare, path75, true, result[1]);
|
|
189516
189525
|
}
|
|
189517
189526
|
let gitDir = "";
|
|
189518
189527
|
const tokens = response.split(" ");
|
|
@@ -189523,7 +189532,7 @@ function parseInit(bare, path74, text4) {
|
|
|
189523
189532
|
break;
|
|
189524
189533
|
}
|
|
189525
189534
|
}
|
|
189526
|
-
return new InitSummary(bare,
|
|
189535
|
+
return new InitSummary(bare, path75, /^re/i.test(response), gitDir);
|
|
189527
189536
|
}
|
|
189528
189537
|
var InitSummary;
|
|
189529
189538
|
var initResponseRegex;
|
|
@@ -189532,9 +189541,9 @@ var init_InitSummary = __esm2({
|
|
|
189532
189541
|
"src/lib/responses/InitSummary.ts"() {
|
|
189533
189542
|
"use strict";
|
|
189534
189543
|
InitSummary = class {
|
|
189535
|
-
constructor(bare,
|
|
189544
|
+
constructor(bare, path75, existing, gitDir) {
|
|
189536
189545
|
this.bare = bare;
|
|
189537
|
-
this.path =
|
|
189546
|
+
this.path = path75;
|
|
189538
189547
|
this.existing = existing;
|
|
189539
189548
|
this.gitDir = gitDir;
|
|
189540
189549
|
}
|
|
@@ -189546,7 +189555,7 @@ var init_InitSummary = __esm2({
|
|
|
189546
189555
|
function hasBareCommand(command) {
|
|
189547
189556
|
return command.includes(bareCommand);
|
|
189548
189557
|
}
|
|
189549
|
-
function initTask(bare = false,
|
|
189558
|
+
function initTask(bare = false, path75, customArgs) {
|
|
189550
189559
|
const commands = ["init", ...customArgs];
|
|
189551
189560
|
if (bare && !hasBareCommand(commands)) {
|
|
189552
189561
|
commands.splice(1, 0, bareCommand);
|
|
@@ -189555,7 +189564,7 @@ function initTask(bare = false, path74, customArgs) {
|
|
|
189555
189564
|
commands,
|
|
189556
189565
|
format: "utf-8",
|
|
189557
189566
|
parser(text4) {
|
|
189558
|
-
return parseInit(commands.includes("--bare"),
|
|
189567
|
+
return parseInit(commands.includes("--bare"), path75, text4);
|
|
189559
189568
|
}
|
|
189560
189569
|
};
|
|
189561
189570
|
}
|
|
@@ -190371,12 +190380,12 @@ var init_FileStatusSummary = __esm2({
|
|
|
190371
190380
|
"use strict";
|
|
190372
190381
|
fromPathRegex = /^(.+)\0(.+)$/;
|
|
190373
190382
|
FileStatusSummary = class {
|
|
190374
|
-
constructor(
|
|
190375
|
-
this.path =
|
|
190383
|
+
constructor(path75, index, working_dir) {
|
|
190384
|
+
this.path = path75;
|
|
190376
190385
|
this.index = index;
|
|
190377
190386
|
this.working_dir = working_dir;
|
|
190378
190387
|
if (index === "R" || working_dir === "R") {
|
|
190379
|
-
const detail = fromPathRegex.exec(
|
|
190388
|
+
const detail = fromPathRegex.exec(path75) || [null, path75, path75];
|
|
190380
190389
|
this.from = detail[2] || "";
|
|
190381
190390
|
this.path = detail[1] || "";
|
|
190382
190391
|
}
|
|
@@ -190407,14 +190416,14 @@ function splitLine(result, lineStr) {
|
|
|
190407
190416
|
default:
|
|
190408
190417
|
return;
|
|
190409
190418
|
}
|
|
190410
|
-
function data(index, workingDir,
|
|
190419
|
+
function data(index, workingDir, path75) {
|
|
190411
190420
|
const raw = `${index}${workingDir}`;
|
|
190412
190421
|
const handler = parsers6.get(raw);
|
|
190413
190422
|
if (handler) {
|
|
190414
|
-
handler(result,
|
|
190423
|
+
handler(result, path75);
|
|
190415
190424
|
}
|
|
190416
190425
|
if (raw !== "##" && raw !== "!!") {
|
|
190417
|
-
result.files.push(new FileStatusSummary(
|
|
190426
|
+
result.files.push(new FileStatusSummary(path75, index, workingDir));
|
|
190418
190427
|
}
|
|
190419
190428
|
}
|
|
190420
190429
|
}
|
|
@@ -190766,9 +190775,9 @@ var init_simple_git_api = __esm2({
|
|
|
190766
190775
|
next
|
|
190767
190776
|
);
|
|
190768
190777
|
}
|
|
190769
|
-
hashObject(
|
|
190778
|
+
hashObject(path75, write) {
|
|
190770
190779
|
return this._runTask(
|
|
190771
|
-
hashObjectTask(
|
|
190780
|
+
hashObjectTask(path75, write === true),
|
|
190772
190781
|
trailingFunctionArgument(arguments)
|
|
190773
190782
|
);
|
|
190774
190783
|
}
|
|
@@ -191122,8 +191131,8 @@ var init_branch = __esm2({
|
|
|
191122
191131
|
}
|
|
191123
191132
|
});
|
|
191124
191133
|
function toPath(input) {
|
|
191125
|
-
const
|
|
191126
|
-
return
|
|
191134
|
+
const path75 = input.trim().replace(/^["']|["']$/g, "");
|
|
191135
|
+
return path75 && normalize(path75);
|
|
191127
191136
|
}
|
|
191128
191137
|
var parseCheckIgnore;
|
|
191129
191138
|
var init_CheckIgnore = __esm2({
|
|
@@ -191408,8 +191417,8 @@ __export2(sub_module_exports, {
|
|
|
191408
191417
|
subModuleTask: () => subModuleTask,
|
|
191409
191418
|
updateSubModuleTask: () => updateSubModuleTask
|
|
191410
191419
|
});
|
|
191411
|
-
function addSubModuleTask(repo,
|
|
191412
|
-
return subModuleTask(["add", repo,
|
|
191420
|
+
function addSubModuleTask(repo, path75) {
|
|
191421
|
+
return subModuleTask(["add", repo, path75]);
|
|
191413
191422
|
}
|
|
191414
191423
|
function initSubModuleTask(customArgs) {
|
|
191415
191424
|
return subModuleTask(["init", ...customArgs]);
|
|
@@ -191723,8 +191732,8 @@ var require_git = __commonJS2({
|
|
|
191723
191732
|
}
|
|
191724
191733
|
return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
|
|
191725
191734
|
};
|
|
191726
|
-
Git2.prototype.submoduleAdd = function(repo,
|
|
191727
|
-
return this._runTask(addSubModuleTask2(repo,
|
|
191735
|
+
Git2.prototype.submoduleAdd = function(repo, path75, then) {
|
|
191736
|
+
return this._runTask(addSubModuleTask2(repo, path75), trailingFunctionArgument2(arguments));
|
|
191728
191737
|
};
|
|
191729
191738
|
Git2.prototype.submoduleUpdate = function(args, then) {
|
|
191730
191739
|
return this._runTask(
|
|
@@ -196995,6 +197004,26 @@ var RelationSchema = external_exports.object({
|
|
|
196995
197004
|
/** Optional human-readable rationale. */
|
|
196996
197005
|
note: external_exports.string().optional()
|
|
196997
197006
|
});
|
|
197007
|
+
var ConflictResolutionSchema = external_exports.object({
|
|
197008
|
+
/** Repo-relative path / DocRef of the first doc in the dispute. */
|
|
197009
|
+
docA: external_exports.string(),
|
|
197010
|
+
/** docA's conflicting section heading, or `null` for its preamble/lead. */
|
|
197011
|
+
anchorA: external_exports.string().nullable(),
|
|
197012
|
+
/** docA's verbatim disputed sentence, when the detector captured one. */
|
|
197013
|
+
quoteA: external_exports.string().optional(),
|
|
197014
|
+
/** Repo-relative path / DocRef of the second doc in the dispute. */
|
|
197015
|
+
docB: external_exports.string(),
|
|
197016
|
+
/** docB's conflicting section heading, or `null` for its preamble/lead. */
|
|
197017
|
+
anchorB: external_exports.string().nullable(),
|
|
197018
|
+
/** docB's verbatim disputed sentence, when the detector captured one. */
|
|
197019
|
+
quoteB: external_exports.string().optional(),
|
|
197020
|
+
/** Which side wins, or `dismissed` (not a real conflict). */
|
|
197021
|
+
verdict: external_exports.enum(["a", "b", "dismissed"]),
|
|
197022
|
+
/** ISO timestamp the resolution was recorded. */
|
|
197023
|
+
resolvedAt: external_exports.string(),
|
|
197024
|
+
/** Optional human-readable rationale. */
|
|
197025
|
+
note: external_exports.string().optional()
|
|
197026
|
+
});
|
|
196998
197027
|
var ManualAreaSchema = external_exports.object({
|
|
196999
197028
|
/** Repo-relative path / DocRef of the doc. */
|
|
197000
197029
|
doc: external_exports.string(),
|
|
@@ -197019,7 +197048,13 @@ var DecisionsFileSchema = external_exports.object({
|
|
|
197019
197048
|
/** User-authored doc→doc relations (replace/precedence/keep-both). */
|
|
197020
197049
|
relations: external_exports.array(RelationSchema).default([]),
|
|
197021
197050
|
/** User overrides of a doc's auto-assigned area tags. */
|
|
197022
|
-
manualAreas: external_exports.array(ManualAreaSchema).default([])
|
|
197051
|
+
manualAreas: external_exports.array(ManualAreaSchema).default([]),
|
|
197052
|
+
/**
|
|
197053
|
+
* SECTION-scoped conflict verdicts (plan item 31) — pick-a-side / dismissal on
|
|
197054
|
+
* one flagged disagreement, keyed by dispute identity. Optional with a `[]`
|
|
197055
|
+
* default so a decisions.json written before item 31 still parses.
|
|
197056
|
+
*/
|
|
197057
|
+
conflictResolutions: external_exports.array(ConflictResolutionSchema).default([])
|
|
197023
197058
|
});
|
|
197024
197059
|
|
|
197025
197060
|
// packages/spec-consolidator/dist/corpus-types.js
|
|
@@ -197959,6 +197994,7 @@ init_transport();
|
|
|
197959
197994
|
init_dist();
|
|
197960
197995
|
|
|
197961
197996
|
// packages/spec-consolidator/dist/pointer-verifier.js
|
|
197997
|
+
init_dist();
|
|
197962
197998
|
var MIN_MEANINGFUL_SCORE = 1.5;
|
|
197963
197999
|
var NEGLIGIBLE_RATIO = 0.25;
|
|
197964
198000
|
var STOPWORDS = /* @__PURE__ */ new Set([
|
|
@@ -198108,16 +198144,13 @@ function splitDocSections(body, drop) {
|
|
|
198108
198144
|
function headingKey(h) {
|
|
198109
198145
|
return h.replace(/[`*_~]/g, "").trim().toLowerCase();
|
|
198110
198146
|
}
|
|
198111
|
-
function normalizeForQuote(text4) {
|
|
198112
|
-
return text4.replace(/[`*_~]/g, "").toLowerCase().replace(/\s+/g, " ").trim();
|
|
198113
|
-
}
|
|
198114
198147
|
function locateQuote(sections, quote) {
|
|
198115
|
-
const needle =
|
|
198148
|
+
const needle = normalizeQuote(quote);
|
|
198116
198149
|
if (!needle)
|
|
198117
198150
|
return [];
|
|
198118
198151
|
const hits = [];
|
|
198119
198152
|
for (let i = 0; i < sections.length; i++) {
|
|
198120
|
-
if (
|
|
198153
|
+
if (normalizeQuote(sections[i].text).includes(needle))
|
|
198121
198154
|
hits.push(i);
|
|
198122
198155
|
}
|
|
198123
198156
|
return hits;
|
|
@@ -198194,7 +198227,6 @@ async function flagOverlaps(repoRoot, areas, docs, opts = {}) {
|
|
|
198194
198227
|
if (opts.enabled === false)
|
|
198195
198228
|
return result;
|
|
198196
198229
|
const byPath = new Map(docs.map((d) => [d.path, d]));
|
|
198197
|
-
const resolved = resolvedPairKeys(opts.relations ?? []);
|
|
198198
198230
|
const maxPairs = opts.maxPairsPerArea ?? DEFAULT_MAX_PAIRS_PER_AREA;
|
|
198199
198231
|
const vocab = opts.vocab;
|
|
198200
198232
|
const pairs2 = [];
|
|
@@ -198209,8 +198241,6 @@ async function flagOverlaps(repoRoot, areas, docs, opts = {}) {
|
|
|
198209
198241
|
const b = byPath.get(y);
|
|
198210
198242
|
if (!a || !b)
|
|
198211
198243
|
return;
|
|
198212
|
-
if (isResolved(resolved, area.id, x, y))
|
|
198213
|
-
return;
|
|
198214
198244
|
const key4 = x < y ? `${x}\0${y}` : `${y}\0${x}`;
|
|
198215
198245
|
if (seen.has(key4))
|
|
198216
198246
|
return;
|
|
@@ -198313,22 +198343,6 @@ async function examineOne(repoRoot, areaId, a, b, runner2) {
|
|
|
198313
198343
|
await writeCache3(repoRoot, cacheKey, verdict);
|
|
198314
198344
|
return verdict;
|
|
198315
198345
|
}
|
|
198316
|
-
function resolvedPairKeys(relations) {
|
|
198317
|
-
const set2 = /* @__PURE__ */ new Set();
|
|
198318
|
-
for (const r of relations) {
|
|
198319
|
-
if (r.scope)
|
|
198320
|
-
set2.add(scopedKey2(r.scope, r.older, r.newer));
|
|
198321
|
-
else
|
|
198322
|
-
set2.add(globalKey(r.older, r.newer));
|
|
198323
|
-
}
|
|
198324
|
-
return set2;
|
|
198325
|
-
}
|
|
198326
|
-
var sortedPair = (x, y) => [x, y].sort().join(" ");
|
|
198327
|
-
var globalKey = (x, y) => `* ${sortedPair(x, y)}`;
|
|
198328
|
-
var scopedKey2 = (scope, x, y) => `${scope} ${sortedPair(x, y)}`;
|
|
198329
|
-
function isResolved(set2, areaId, x, y) {
|
|
198330
|
-
return set2.has(globalKey(x, y)) || set2.has(scopedKey2(areaId, x, y));
|
|
198331
|
-
}
|
|
198332
198346
|
var OVERLAP_DETECTOR_SYSTEM_PROMPT = `You compare TWO documentation files that both cover the same AREA of a software system and decide whether they may DISAGREE.
|
|
198333
198347
|
|
|
198334
198348
|
${OUTPUT_ONLY_GUARDRAIL}
|
|
@@ -198641,12 +198655,12 @@ function prefilterDocs(docs, manualIncludes = []) {
|
|
|
198641
198655
|
if (reason)
|
|
198642
198656
|
reasons.set(doc.path, reason);
|
|
198643
198657
|
}
|
|
198644
|
-
for (const { path:
|
|
198645
|
-
reasons.set(
|
|
198658
|
+
for (const { path: path75, reason } of dedupeNearDuplicates(docs.filter((d) => !manualSet.has(d.path) && !reasons.has(d.path)))) {
|
|
198659
|
+
reasons.set(path75, reason);
|
|
198646
198660
|
}
|
|
198647
198661
|
return {
|
|
198648
198662
|
toClassify: docs.filter((d) => !reasons.has(d.path)),
|
|
198649
|
-
skipped: [...reasons].map(([
|
|
198663
|
+
skipped: [...reasons].map(([path75, reason]) => ({ path: path75, reason }))
|
|
198650
198664
|
};
|
|
198651
198665
|
}
|
|
198652
198666
|
async function planRelevanceWork(repoRoot, docs, manualIncludes = []) {
|
|
@@ -198964,7 +198978,6 @@ async function curate(repoRoot, opts = {}) {
|
|
|
198964
198978
|
const overlapsByArea = await flagOverlaps(repoRoot, grouped.areas, docs, {
|
|
198965
198979
|
runner: opts.overlapRunner,
|
|
198966
198980
|
enabled: opts.disableOverlapDetection !== true,
|
|
198967
|
-
relations,
|
|
198968
198981
|
vocab,
|
|
198969
198982
|
transport: opts.transport,
|
|
198970
198983
|
model: models.overlap,
|
|
@@ -199010,7 +199023,8 @@ var EMPTY_DECISIONS = {
|
|
|
199010
199023
|
manualIncludes: [],
|
|
199011
199024
|
manualExcludes: [],
|
|
199012
199025
|
relations: [],
|
|
199013
|
-
manualAreas: []
|
|
199026
|
+
manualAreas: [],
|
|
199027
|
+
conflictResolutions: []
|
|
199014
199028
|
};
|
|
199015
199029
|
function readCorpusDecisions(repoRoot) {
|
|
199016
199030
|
const file = path27.join(repoRoot, ".truecourse", "specs", "decisions.json");
|
|
@@ -199032,7 +199046,8 @@ var EMPTY_DECISIONS2 = {
|
|
|
199032
199046
|
manualIncludes: [],
|
|
199033
199047
|
manualExcludes: [],
|
|
199034
199048
|
relations: [],
|
|
199035
|
-
manualAreas: []
|
|
199049
|
+
manualAreas: [],
|
|
199050
|
+
conflictResolutions: []
|
|
199036
199051
|
};
|
|
199037
199052
|
function decisionsPath(repoRoot) {
|
|
199038
199053
|
return path28.join(repoRoot, ".truecourse", "specs", "decisions.json");
|
|
@@ -201213,13 +201228,13 @@ UnicodeChar.prototype.toFailure = function(grammar2) {
|
|
|
201213
201228
|
return new Failure(this, "a Unicode [" + this.categoryOrProp + "] character", "description");
|
|
201214
201229
|
};
|
|
201215
201230
|
Alt.prototype.toFailure = function(grammar2) {
|
|
201216
|
-
const
|
|
201217
|
-
const description = "(" +
|
|
201231
|
+
const fs68 = this.terms.map((t) => t.toFailure(grammar2));
|
|
201232
|
+
const description = "(" + fs68.join(" or ") + ")";
|
|
201218
201233
|
return new Failure(this, description, "description");
|
|
201219
201234
|
};
|
|
201220
201235
|
Seq.prototype.toFailure = function(grammar2) {
|
|
201221
|
-
const
|
|
201222
|
-
const description = "(" +
|
|
201236
|
+
const fs68 = this.factors.map((f2) => f2.toFailure(grammar2));
|
|
201237
|
+
const description = "(" + fs68.join(" ") + ")";
|
|
201223
201238
|
return new Failure(this, description, "description");
|
|
201224
201239
|
};
|
|
201225
201240
|
Iter.prototype.toFailure = function(grammar2) {
|
|
@@ -202938,9 +202953,9 @@ function buildGrammar2(match4, namespace, optOhmGrammarForTesting, options) {
|
|
|
202938
202953
|
decl.withSuperGrammar(namespace[superGrammarName]);
|
|
202939
202954
|
}
|
|
202940
202955
|
},
|
|
202941
|
-
Rule_define(n,
|
|
202956
|
+
Rule_define(n, fs68, d, _, b) {
|
|
202942
202957
|
currentRuleName = n.visit();
|
|
202943
|
-
currentRuleFormals =
|
|
202958
|
+
currentRuleFormals = fs68.children.map((c) => c.visit())[0] || [];
|
|
202944
202959
|
if (!decl.defaultStartRule && decl.ensureSuperGrammar() !== Grammar.ProtoBuiltInRules) {
|
|
202945
202960
|
decl.withDefaultStartRule(currentRuleName);
|
|
202946
202961
|
}
|
|
@@ -202949,9 +202964,9 @@ function buildGrammar2(match4, namespace, optOhmGrammarForTesting, options) {
|
|
|
202949
202964
|
const source = this.source.trimmed();
|
|
202950
202965
|
return decl.define(currentRuleName, currentRuleFormals, body, description, source);
|
|
202951
202966
|
},
|
|
202952
|
-
Rule_override(n,
|
|
202967
|
+
Rule_override(n, fs68, _, b) {
|
|
202953
202968
|
currentRuleName = n.visit();
|
|
202954
|
-
currentRuleFormals =
|
|
202969
|
+
currentRuleFormals = fs68.children.map((c) => c.visit())[0] || [];
|
|
202955
202970
|
const source = this.source.trimmed();
|
|
202956
202971
|
decl.ensureSuperGrammarRuleForOverriding(currentRuleName, source);
|
|
202957
202972
|
overriding = true;
|
|
@@ -202959,9 +202974,9 @@ function buildGrammar2(match4, namespace, optOhmGrammarForTesting, options) {
|
|
|
202959
202974
|
overriding = false;
|
|
202960
202975
|
return decl.override(currentRuleName, currentRuleFormals, body, null, source);
|
|
202961
202976
|
},
|
|
202962
|
-
Rule_extend(n,
|
|
202977
|
+
Rule_extend(n, fs68, _, b) {
|
|
202963
202978
|
currentRuleName = n.visit();
|
|
202964
|
-
currentRuleFormals =
|
|
202979
|
+
currentRuleFormals = fs68.children.map((c) => c.visit())[0] || [];
|
|
202965
202980
|
const body = b.visit();
|
|
202966
202981
|
const source = this.source.trimmed();
|
|
202967
202982
|
return decl.extend(currentRuleName, currentRuleFormals, body, null, source);
|
|
@@ -202988,8 +203003,8 @@ function buildGrammar2(match4, namespace, optOhmGrammarForTesting, options) {
|
|
|
202988
203003
|
return builder.alt(...args).withSource(this.source);
|
|
202989
203004
|
}
|
|
202990
203005
|
},
|
|
202991
|
-
Formals(opointy,
|
|
202992
|
-
return
|
|
203006
|
+
Formals(opointy, fs68, cpointy) {
|
|
203007
|
+
return fs68.visit();
|
|
202993
203008
|
},
|
|
202994
203009
|
Params(opointy, ps, cpointy) {
|
|
202995
203010
|
return ps.visit();
|
|
@@ -203135,8 +203150,8 @@ function initPrototypeParser(grammar2) {
|
|
|
203135
203150
|
formals: optFormals.children.map((c) => c.parse())[0] || []
|
|
203136
203151
|
};
|
|
203137
203152
|
},
|
|
203138
|
-
Formals(oparen,
|
|
203139
|
-
return
|
|
203153
|
+
Formals(oparen, fs68, cparen) {
|
|
203154
|
+
return fs68.asIteration().children.map((c) => c.parse());
|
|
203140
203155
|
},
|
|
203141
203156
|
name(first2, rest) {
|
|
203142
203157
|
return this.sourceString;
|
|
@@ -206284,8 +206299,8 @@ function parseAndResolve(files) {
|
|
|
206284
206299
|
const parsed = files.map((f2) => parseOne(f2.path, f2.source));
|
|
206285
206300
|
return resolve(parsed);
|
|
206286
206301
|
}
|
|
206287
|
-
function parseTcFile(
|
|
206288
|
-
return parseOne(
|
|
206302
|
+
function parseTcFile(path75, source) {
|
|
206303
|
+
return parseOne(path75, source);
|
|
206289
206304
|
}
|
|
206290
206305
|
|
|
206291
206306
|
// packages/contract-verifier/dist/conformance/index.js
|
|
@@ -207610,13 +207625,13 @@ function extractStarletteRoutesFromFile(filePath, source, tree) {
|
|
|
207610
207625
|
const identities = starletteIdentitiesForPath(rawPath);
|
|
207611
207626
|
const line = node2.startPosition.row + 1;
|
|
207612
207627
|
for (const method of methods) {
|
|
207613
|
-
for (const
|
|
207628
|
+
for (const path75 of identities) {
|
|
207614
207629
|
out.push({
|
|
207615
|
-
identity: `${method} ${
|
|
207630
|
+
identity: `${method} ${path75}`,
|
|
207616
207631
|
contract: {
|
|
207617
207632
|
protocol: "http",
|
|
207618
207633
|
method,
|
|
207619
|
-
path:
|
|
207634
|
+
path: path75,
|
|
207620
207635
|
responses: [],
|
|
207621
207636
|
tags: []
|
|
207622
207637
|
},
|
|
@@ -207794,14 +207809,14 @@ function parseRouteDecorator(dec, source, stringVars) {
|
|
|
207794
207809
|
const args = call.childForFieldName("arguments");
|
|
207795
207810
|
if (!args)
|
|
207796
207811
|
return null;
|
|
207797
|
-
let
|
|
207812
|
+
let path75 = null;
|
|
207798
207813
|
let successStatus = "200";
|
|
207799
207814
|
for (let i = 0; i < args.namedChildCount; i++) {
|
|
207800
207815
|
const a = args.namedChild(i);
|
|
207801
207816
|
if (!a)
|
|
207802
207817
|
continue;
|
|
207803
|
-
if (
|
|
207804
|
-
|
|
207818
|
+
if (path75 === null && a.type === "string")
|
|
207819
|
+
path75 = pyStr(a, source);
|
|
207805
207820
|
else if (a.type === "keyword_argument") {
|
|
207806
207821
|
const name = a.childForFieldName("name");
|
|
207807
207822
|
const value = a.childForFieldName("value");
|
|
@@ -207810,17 +207825,17 @@ function parseRouteDecorator(dec, source, stringVars) {
|
|
|
207810
207825
|
}
|
|
207811
207826
|
}
|
|
207812
207827
|
}
|
|
207813
|
-
if (
|
|
207828
|
+
if (path75 === null) {
|
|
207814
207829
|
const firstArg = args.namedChild(0);
|
|
207815
207830
|
if (firstArg?.type === "identifier") {
|
|
207816
207831
|
const resolved = stringVars.get(source.slice(firstArg.startIndex, firstArg.endIndex));
|
|
207817
207832
|
if (resolved !== void 0)
|
|
207818
|
-
|
|
207833
|
+
path75 = resolved;
|
|
207819
207834
|
}
|
|
207820
207835
|
}
|
|
207821
|
-
if (
|
|
207836
|
+
if (path75 === null)
|
|
207822
207837
|
return null;
|
|
207823
|
-
return { method, path:
|
|
207838
|
+
return { method, path: path75, routerVar, successStatus };
|
|
207824
207839
|
}
|
|
207825
207840
|
function extractResponses2(body, source, successStatus) {
|
|
207826
207841
|
const byStatus = /* @__PURE__ */ new Map();
|
|
@@ -207953,9 +207968,9 @@ function looksLikeModel(p, source) {
|
|
|
207953
207968
|
const text4 = source.slice(type2.startIndex, type2.endIndex);
|
|
207954
207969
|
return /^[A-Z]/.test(text4);
|
|
207955
207970
|
}
|
|
207956
|
-
function joinPath(prefix,
|
|
207971
|
+
function joinPath(prefix, path75) {
|
|
207957
207972
|
const a = prefix.replace(/\/$/, "");
|
|
207958
|
-
const b =
|
|
207973
|
+
const b = path75.startsWith("/") ? path75 : `/${path75}`;
|
|
207959
207974
|
return a + b || "/";
|
|
207960
207975
|
}
|
|
207961
207976
|
function callName(call, source) {
|
|
@@ -221906,8 +221921,8 @@ function canonicalIdentity(_kind, identity) {
|
|
|
221906
221921
|
let id = identity.trim().replace(/\s+/g, " ");
|
|
221907
221922
|
const op = HTTP_METHOD.exec(id);
|
|
221908
221923
|
if (op) {
|
|
221909
|
-
const
|
|
221910
|
-
id = `${op[1].toUpperCase()} ${
|
|
221924
|
+
const path75 = op[2].replace(/\/+$/, "").replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, "{$1}");
|
|
221925
|
+
id = `${op[1].toUpperCase()} ${path75}`;
|
|
221911
221926
|
}
|
|
221912
221927
|
return id;
|
|
221913
221928
|
}
|
|
@@ -225763,6 +225778,7 @@ function resolveFallbackModel(repoDir = resolveRepoDir(process.cwd())) {
|
|
|
225763
225778
|
}
|
|
225764
225779
|
|
|
225765
225780
|
// packages/core/dist/commands/spec-in-process.js
|
|
225781
|
+
init_dist();
|
|
225766
225782
|
init_transport();
|
|
225767
225783
|
|
|
225768
225784
|
// packages/core/dist/lib/llm-call-log.js
|
|
@@ -225980,8 +225996,8 @@ init_dist();
|
|
|
225980
225996
|
|
|
225981
225997
|
// packages/guard-generator/dist/section-plan.js
|
|
225982
225998
|
init_zod();
|
|
225983
|
-
import
|
|
225984
|
-
import
|
|
225999
|
+
import fs52 from "node:fs";
|
|
226000
|
+
import path54 from "node:path";
|
|
225985
226001
|
import { createHash as createHash14 } from "node:crypto";
|
|
225986
226002
|
init_dist();
|
|
225987
226003
|
|
|
@@ -226123,6 +226139,11 @@ function buildExtractUserPrompt(ctx) {
|
|
|
226123
226139
|
ctx.viewText,
|
|
226124
226140
|
'"""'
|
|
226125
226141
|
];
|
|
226142
|
+
if (ctx.suppressed && ctx.suppressed.length > 0) {
|
|
226143
|
+
lines.push("", "RESOLVED \u2014 STALE, DO NOT EXTRACT. A conflict resolution judged the following", "sentence(s) in this document stale (another document is authoritative here).", "Extract NO claim that asserts what any of them says \u2014 treat them as if absent:");
|
|
226144
|
+
for (const q of ctx.suppressed)
|
|
226145
|
+
lines.push(`- "${q}"`);
|
|
226146
|
+
}
|
|
226126
226147
|
if (ctx.correction) {
|
|
226127
226148
|
lines.push("", "CORRECTION \u2014 your previous response was NOT valid. You returned:", ctx.correction.invalidOutput, 'Return exactly ONE JSON object with "claims" and "untestable" arrays matching', 'the schema above, and NOTHING else. Every "driver" is one of cli|api|web|tui;', 'every "sectionAnchor" is an anchor copied verbatim from the outline.');
|
|
226128
226149
|
}
|
|
@@ -226291,17 +226312,127 @@ function buildRecipeUserPrompt(input) {
|
|
|
226291
226312
|
return lines.join("\n");
|
|
226292
226313
|
}
|
|
226293
226314
|
|
|
226294
|
-
// packages/guard-generator/dist/
|
|
226315
|
+
// packages/guard-generator/dist/suppression.js
|
|
226316
|
+
init_zod();
|
|
226317
|
+
init_dist();
|
|
226318
|
+
import fs51 from "node:fs";
|
|
226319
|
+
import path53 from "node:path";
|
|
226320
|
+
var OverlapSectionShape = external_exports.object({ doc: external_exports.string(), heading: external_exports.string().nullable().optional(), quote: external_exports.string().optional() }).passthrough();
|
|
226321
|
+
var OverlapShape = external_exports.object({
|
|
226322
|
+
docs: external_exports.tuple([external_exports.string(), external_exports.string()]),
|
|
226323
|
+
note: external_exports.string().optional(),
|
|
226324
|
+
sections: external_exports.array(OverlapSectionShape).optional(),
|
|
226325
|
+
areas: external_exports.array(external_exports.string()).optional()
|
|
226326
|
+
}).passthrough();
|
|
226327
|
+
var RelationShape = external_exports.object({ older: external_exports.string(), newer: external_exports.string(), scope: external_exports.string().optional() }).passthrough();
|
|
226295
226328
|
var CorpusShape2 = external_exports.object({
|
|
226329
|
+
areas: external_exports.array(external_exports.object({ id: external_exports.string(), overlaps: external_exports.array(OverlapShape).optional() }).passthrough()).optional(),
|
|
226330
|
+
relations: external_exports.array(RelationShape).optional()
|
|
226331
|
+
}).passthrough();
|
|
226332
|
+
var ConflictResolutionShape = external_exports.object({
|
|
226333
|
+
docA: external_exports.string(),
|
|
226334
|
+
anchorA: external_exports.string().nullable().optional(),
|
|
226335
|
+
quoteA: external_exports.string().optional(),
|
|
226336
|
+
docB: external_exports.string(),
|
|
226337
|
+
anchorB: external_exports.string().nullable().optional(),
|
|
226338
|
+
quoteB: external_exports.string().optional(),
|
|
226339
|
+
verdict: external_exports.enum(["a", "b", "dismissed"]),
|
|
226340
|
+
resolvedAt: external_exports.string().optional(),
|
|
226341
|
+
note: external_exports.string().optional()
|
|
226342
|
+
}).passthrough();
|
|
226343
|
+
var DecisionsShape = external_exports.object({
|
|
226344
|
+
relations: external_exports.array(RelationShape).optional(),
|
|
226345
|
+
manualExcludes: external_exports.array(external_exports.string()).optional(),
|
|
226346
|
+
conflictResolutions: external_exports.array(ConflictResolutionShape).optional()
|
|
226347
|
+
}).passthrough();
|
|
226348
|
+
function readJsonTolerant(file, schema2) {
|
|
226349
|
+
if (!fs51.existsSync(file))
|
|
226350
|
+
return void 0;
|
|
226351
|
+
try {
|
|
226352
|
+
const parsed = schema2.safeParse(JSON.parse(fs51.readFileSync(file, "utf-8")));
|
|
226353
|
+
return parsed.success ? parsed.data : void 0;
|
|
226354
|
+
} catch {
|
|
226355
|
+
return void 0;
|
|
226356
|
+
}
|
|
226357
|
+
}
|
|
226358
|
+
function readSuppressedClaims(repoRoot) {
|
|
226359
|
+
const specDir = path53.join(repoRoot, ".truecourse", "specs");
|
|
226360
|
+
const corpus = readJsonTolerant(path53.join(specDir, "corpus.json"), CorpusShape2);
|
|
226361
|
+
if (!corpus)
|
|
226362
|
+
return [];
|
|
226363
|
+
const decisions = readJsonTolerant(path53.join(specDir, "decisions.json"), DecisionsShape);
|
|
226364
|
+
const corpusLike = {
|
|
226365
|
+
areas: (corpus.areas ?? []).map((a) => ({
|
|
226366
|
+
id: a.id,
|
|
226367
|
+
overlaps: (a.overlaps ?? []).map((o) => ({
|
|
226368
|
+
docs: o.docs,
|
|
226369
|
+
note: o.note,
|
|
226370
|
+
sections: (o.sections ?? []).map((s) => ({ doc: s.doc, heading: s.heading ?? null, quote: s.quote })),
|
|
226371
|
+
areas: o.areas
|
|
226372
|
+
}))
|
|
226373
|
+
})),
|
|
226374
|
+
relations: corpus.relations ?? []
|
|
226375
|
+
};
|
|
226376
|
+
const decisionsLike = {
|
|
226377
|
+
relations: decisions?.relations ?? [],
|
|
226378
|
+
manualExcludes: decisions?.manualExcludes ?? [],
|
|
226379
|
+
conflictResolutions: (decisions?.conflictResolutions ?? []).map((r) => ({
|
|
226380
|
+
docA: r.docA,
|
|
226381
|
+
anchorA: r.anchorA ?? null,
|
|
226382
|
+
quoteA: r.quoteA,
|
|
226383
|
+
docB: r.docB,
|
|
226384
|
+
anchorB: r.anchorB ?? null,
|
|
226385
|
+
quoteB: r.quoteB,
|
|
226386
|
+
verdict: r.verdict,
|
|
226387
|
+
resolvedAt: r.resolvedAt,
|
|
226388
|
+
note: r.note
|
|
226389
|
+
}))
|
|
226390
|
+
};
|
|
226391
|
+
return suppressedClaims(corpusLike, decisionsLike);
|
|
226392
|
+
}
|
|
226393
|
+
function readSuppressionIndex(repoRoot) {
|
|
226394
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
226395
|
+
for (const claim of readSuppressedClaims(repoRoot)) {
|
|
226396
|
+
const list = map2.get(claim.doc);
|
|
226397
|
+
if (list)
|
|
226398
|
+
list.push(claim.quote);
|
|
226399
|
+
else
|
|
226400
|
+
map2.set(claim.doc, [claim.quote]);
|
|
226401
|
+
}
|
|
226402
|
+
return map2;
|
|
226403
|
+
}
|
|
226404
|
+
function suppressedQuotesIn(text4, docQuotes) {
|
|
226405
|
+
if (docQuotes.length === 0)
|
|
226406
|
+
return [];
|
|
226407
|
+
const haystack = normalizeQuote(text4);
|
|
226408
|
+
const seen = /* @__PURE__ */ new Set();
|
|
226409
|
+
const hits = [];
|
|
226410
|
+
for (const q of docQuotes) {
|
|
226411
|
+
const needle = normalizeQuote(q);
|
|
226412
|
+
if (!needle || seen.has(needle) || !haystack.includes(needle))
|
|
226413
|
+
continue;
|
|
226414
|
+
seen.add(needle);
|
|
226415
|
+
hits.push(q);
|
|
226416
|
+
}
|
|
226417
|
+
return hits.sort((a, b) => normalizeQuote(a) < normalizeQuote(b) ? -1 : 1);
|
|
226418
|
+
}
|
|
226419
|
+
function suppressionKey(quotes) {
|
|
226420
|
+
if (quotes.length === 0)
|
|
226421
|
+
return "";
|
|
226422
|
+
return [...quotes].map(normalizeQuote).sort().join("\0");
|
|
226423
|
+
}
|
|
226424
|
+
|
|
226425
|
+
// packages/guard-generator/dist/section-plan.js
|
|
226426
|
+
var CorpusShape3 = external_exports.object({
|
|
226296
226427
|
docs: external_exports.array(external_exports.object({ ref: external_exports.string(), areaTags: external_exports.array(external_exports.string()).optional() }).passthrough()).optional()
|
|
226297
226428
|
}).passthrough();
|
|
226298
226429
|
function readCorpusAreaTags(repoRoot) {
|
|
226299
|
-
const file =
|
|
226430
|
+
const file = path54.join(repoRoot, ".truecourse", "specs", "corpus.json");
|
|
226300
226431
|
const map2 = /* @__PURE__ */ new Map();
|
|
226301
|
-
if (!
|
|
226432
|
+
if (!fs52.existsSync(file))
|
|
226302
226433
|
return map2;
|
|
226303
226434
|
try {
|
|
226304
|
-
const parsed =
|
|
226435
|
+
const parsed = CorpusShape3.safeParse(JSON.parse(fs52.readFileSync(file, "utf-8")));
|
|
226305
226436
|
if (!parsed.success)
|
|
226306
226437
|
return map2;
|
|
226307
226438
|
for (const d of parsed.data.docs ?? [])
|
|
@@ -226310,29 +226441,35 @@ function readCorpusAreaTags(repoRoot) {
|
|
|
226310
226441
|
}
|
|
226311
226442
|
return map2;
|
|
226312
226443
|
}
|
|
226313
|
-
function generationInputsHash(fingerprint2, recipeFingerprint) {
|
|
226314
|
-
|
|
226444
|
+
function generationInputsHash(fingerprint2, recipeFingerprint, suppressionFingerprint = "") {
|
|
226445
|
+
const parts = [
|
|
226315
226446
|
fingerprint2,
|
|
226316
226447
|
recipeFingerprint,
|
|
226317
226448
|
String(GUARD_FORMAT_VERSION),
|
|
226318
226449
|
EXTRACT_PROMPT_FINGERPRINT2,
|
|
226319
226450
|
GENERATE_PROMPT_FINGERPRINT
|
|
226320
|
-
]
|
|
226451
|
+
];
|
|
226452
|
+
if (suppressionFingerprint)
|
|
226453
|
+
parts.push(suppressionFingerprint);
|
|
226454
|
+
return "sha256:" + createHash14("sha256").update(parts.join("\0")).digest("hex");
|
|
226321
226455
|
}
|
|
226322
226456
|
function hasGuardUniverse(repoRoot) {
|
|
226323
|
-
return
|
|
226457
|
+
return fs52.existsSync(path54.join(repoRoot, ".truecourse", "specs", "corpus.json"));
|
|
226324
226458
|
}
|
|
226325
226459
|
function planGuardWork(repoRoot, recipeFingerprint) {
|
|
226326
226460
|
const recipeFp = recipeFingerprint ?? computeRecipeFingerprint(repoRoot);
|
|
226327
|
-
const recipeMissing = !
|
|
226461
|
+
const recipeMissing = !fs52.existsSync(recipePath(repoRoot));
|
|
226328
226462
|
const hasUniverse = hasGuardUniverse(repoRoot);
|
|
226329
226463
|
const { indexes } = indexRepoDocs(repoRoot, []);
|
|
226330
226464
|
const areaTags = readCorpusAreaTags(repoRoot);
|
|
226465
|
+
const suppressionIndex = readSuppressionIndex(repoRoot);
|
|
226331
226466
|
const sections = [];
|
|
226332
226467
|
for (const [doc, index] of indexes) {
|
|
226333
|
-
const texts = extractSectionTexts(doc,
|
|
226468
|
+
const texts = extractSectionTexts(doc, fs52.readFileSync(path54.resolve(repoRoot, doc), "utf-8"));
|
|
226469
|
+
const docQuotes = suppressionIndex.get(doc) ?? [];
|
|
226334
226470
|
for (const s of index.sections) {
|
|
226335
226471
|
const t = texts.get(s.anchor);
|
|
226472
|
+
const fullText = t?.fullText ?? "";
|
|
226336
226473
|
sections.push({
|
|
226337
226474
|
doc,
|
|
226338
226475
|
anchor: s.anchor,
|
|
@@ -226340,8 +226477,9 @@ function planGuardWork(repoRoot, recipeFingerprint) {
|
|
|
226340
226477
|
headingText: s.headingText,
|
|
226341
226478
|
level: s.level,
|
|
226342
226479
|
ownText: t?.ownText ?? "",
|
|
226343
|
-
fullText
|
|
226344
|
-
areaTags: areaTags.get(doc) ?? []
|
|
226480
|
+
fullText,
|
|
226481
|
+
areaTags: areaTags.get(doc) ?? [],
|
|
226482
|
+
suppressionFingerprint: suppressionKey(suppressedQuotesIn(fullText, docQuotes))
|
|
226345
226483
|
});
|
|
226346
226484
|
}
|
|
226347
226485
|
}
|
|
@@ -226354,12 +226492,12 @@ function planGuardWork(repoRoot, recipeFingerprint) {
|
|
|
226354
226492
|
const key4 = `${s.doc}\0${s.anchor}`;
|
|
226355
226493
|
seen.add(key4);
|
|
226356
226494
|
const prior = byKey.get(key4);
|
|
226357
|
-
const inputsHash = generationInputsHash(s.fingerprint, recipeFp);
|
|
226495
|
+
const inputsHash = generationInputsHash(s.fingerprint, recipeFp, s.suppressionFingerprint);
|
|
226358
226496
|
if (!prior || prior.generationInputsHash !== inputsHash)
|
|
226359
226497
|
work.push(s);
|
|
226360
226498
|
}
|
|
226361
226499
|
const orphaned = (manifest?.sections ?? []).filter((e) => !seen.has(`${e.doc}\0${e.anchor}`));
|
|
226362
|
-
return { hasUniverse, sections, work, orphaned, recipeFingerprint: recipeFp, recipeMissing };
|
|
226500
|
+
return { hasUniverse, sections, work, orphaned, recipeFingerprint: recipeFp, recipeMissing, suppressionIndex };
|
|
226363
226501
|
}
|
|
226364
226502
|
function collectWorkDocs(repoRoot, plan) {
|
|
226365
226503
|
const workDocs = new Set(plan.work.map((s) => s.doc));
|
|
@@ -226375,8 +226513,9 @@ function collectWorkDocs(repoRoot, plan) {
|
|
|
226375
226513
|
}
|
|
226376
226514
|
return [...byDoc].map(([doc, sections]) => ({
|
|
226377
226515
|
doc,
|
|
226378
|
-
content:
|
|
226379
|
-
sections
|
|
226516
|
+
content: fs52.readFileSync(path54.resolve(repoRoot, doc), "utf-8"),
|
|
226517
|
+
sections,
|
|
226518
|
+
suppressedQuotes: plan.suppressionIndex.get(doc) ?? []
|
|
226380
226519
|
}));
|
|
226381
226520
|
}
|
|
226382
226521
|
|
|
@@ -226459,8 +226598,13 @@ function flattenZodError(error) {
|
|
|
226459
226598
|
// packages/guard-generator/dist/extract.js
|
|
226460
226599
|
var EXTRACT_CACHE_NAME2 = "guard/extract";
|
|
226461
226600
|
var EXTRACT_VIEW_BUDGET = 16e3;
|
|
226462
|
-
function viewCacheKey(viewText) {
|
|
226463
|
-
|
|
226601
|
+
function viewCacheKey(viewText, suppressed = []) {
|
|
226602
|
+
const base = `${EXTRACT_PROMPT_FINGERPRINT2}::${sha(viewText)}`;
|
|
226603
|
+
const suppression = suppressionKey(suppressed);
|
|
226604
|
+
return createHash15("sha256").update(suppression ? `${base}::${suppression}` : base).digest("hex");
|
|
226605
|
+
}
|
|
226606
|
+
function suppressedForView(doc, viewText) {
|
|
226607
|
+
return suppressedQuotesIn(viewText, doc.suppressedQuotes);
|
|
226464
226608
|
}
|
|
226465
226609
|
function sha(text4) {
|
|
226466
226610
|
return createHash15("sha256").update(text4).digest("hex");
|
|
@@ -226506,7 +226650,7 @@ function countExtractViews(doc) {
|
|
|
226506
226650
|
async function countUncachedExtractViews(repoRoot, doc) {
|
|
226507
226651
|
let n = 0;
|
|
226508
226652
|
for (const v of planViews(doc)) {
|
|
226509
|
-
if (!await getCacheEntry(repoRoot, EXTRACT_CACHE_NAME2, viewCacheKey(v.text)))
|
|
226653
|
+
if (!await getCacheEntry(repoRoot, EXTRACT_CACHE_NAME2, viewCacheKey(v.text, suppressedForView(doc, v.text))))
|
|
226510
226654
|
n++;
|
|
226511
226655
|
}
|
|
226512
226656
|
return n;
|
|
@@ -226515,7 +226659,7 @@ async function extractDocClaims(repoRoot, doc, runner2, limit, onView) {
|
|
|
226515
226659
|
const outline = outlineOf(doc.sections);
|
|
226516
226660
|
const views = planViews(doc);
|
|
226517
226661
|
const run = limit ?? ((fn) => fn());
|
|
226518
|
-
const attempts = await Promise.all(views.map((v) => run(() => extractView(repoRoot, doc.doc, outline, v, runner2)).then((got) => {
|
|
226662
|
+
const attempts = await Promise.all(views.map((v) => run(() => extractView(repoRoot, doc.doc, outline, v, suppressedForView(doc, v.text), runner2)).then((got) => {
|
|
226519
226663
|
onView?.();
|
|
226520
226664
|
return got;
|
|
226521
226665
|
})));
|
|
@@ -226536,15 +226680,21 @@ async function extractDocClaims(repoRoot, doc, runner2, limit, onView) {
|
|
|
226536
226680
|
return { ok: false, reason: firstError || "all extraction views failed" };
|
|
226537
226681
|
return { ok: true, data: snap(merged, doc.sections), complete: failedViews === 0, failedViews };
|
|
226538
226682
|
}
|
|
226539
|
-
async function extractView(repoRoot, docPath, outline, view, runner2) {
|
|
226540
|
-
const cacheKey = viewCacheKey(view.text);
|
|
226683
|
+
async function extractView(repoRoot, docPath, outline, view, suppressed, runner2) {
|
|
226684
|
+
const cacheKey = viewCacheKey(view.text, suppressed);
|
|
226541
226685
|
const cached = await getCacheEntry(repoRoot, EXTRACT_CACHE_NAME2, cacheKey);
|
|
226542
226686
|
if (cached) {
|
|
226543
226687
|
const parsed = DocExtractionSchema.safeParse(cached);
|
|
226544
226688
|
if (parsed.success)
|
|
226545
226689
|
return { data: parsed.data };
|
|
226546
226690
|
}
|
|
226547
|
-
const ctx = {
|
|
226691
|
+
const ctx = {
|
|
226692
|
+
doc: docPath,
|
|
226693
|
+
outline,
|
|
226694
|
+
viewText: view.text,
|
|
226695
|
+
view: view.view,
|
|
226696
|
+
...suppressed.length > 0 ? { suppressed } : {}
|
|
226697
|
+
};
|
|
226548
226698
|
const attempt = await callExtractWithReask(ctx, runner2);
|
|
226549
226699
|
if ("data" in attempt)
|
|
226550
226700
|
await setCacheEntry(repoRoot, EXTRACT_CACHE_NAME2, cacheKey, attempt.data);
|
|
@@ -226623,7 +226773,7 @@ function snap(raw, sections) {
|
|
|
226623
226773
|
|
|
226624
226774
|
// packages/guard-generator/dist/ground.js
|
|
226625
226775
|
init_zod();
|
|
226626
|
-
import
|
|
226776
|
+
import path55 from "node:path";
|
|
226627
226777
|
import { createHash as createHash16 } from "node:crypto";
|
|
226628
226778
|
var GROUND_CACHE_NAME = "guard/ground";
|
|
226629
226779
|
var PROBE_TIMEOUT_MS = 2e4;
|
|
@@ -226679,7 +226829,7 @@ function toProbeArgv(fragment, programNames) {
|
|
|
226679
226829
|
const tokens = fragment.trim().split(/\s+/).filter(Boolean);
|
|
226680
226830
|
if (tokens.length === 0)
|
|
226681
226831
|
return null;
|
|
226682
|
-
if (programNames.has(tokens[0]) || programNames.has(
|
|
226832
|
+
if (programNames.has(tokens[0]) || programNames.has(path55.basename(tokens[0])))
|
|
226683
226833
|
tokens.shift();
|
|
226684
226834
|
if (tokens.length === 0)
|
|
226685
226835
|
return [];
|
|
@@ -226700,7 +226850,7 @@ function programNamesOf(entry) {
|
|
|
226700
226850
|
return names;
|
|
226701
226851
|
}
|
|
226702
226852
|
function addName(set2, arg) {
|
|
226703
|
-
const base =
|
|
226853
|
+
const base = path55.basename(arg);
|
|
226704
226854
|
if (base)
|
|
226705
226855
|
set2.add(base);
|
|
226706
226856
|
const stem = base.replace(/\.[^.]+$/, "");
|
|
@@ -226762,9 +226912,9 @@ function truncate2(text4) {
|
|
|
226762
226912
|
}
|
|
226763
226913
|
|
|
226764
226914
|
// packages/guard-generator/dist/recipe-discovery.js
|
|
226765
|
-
import
|
|
226915
|
+
import fs53 from "node:fs";
|
|
226766
226916
|
import os7 from "node:os";
|
|
226767
|
-
import
|
|
226917
|
+
import path56 from "node:path";
|
|
226768
226918
|
import { createHash as createHash17 } from "node:crypto";
|
|
226769
226919
|
var RECIPE_CACHE_NAME = "guard/recipe";
|
|
226770
226920
|
var DISCOVERY_INPUTS = ["package.json", "pnpm-lock.yaml", "package-lock.json", "yarn.lock", "turbo.json"];
|
|
@@ -226818,13 +226968,13 @@ async function discoverRecipe(repoRoot, runner2) {
|
|
|
226818
226968
|
...proposal.env ? { env: proposal.env } : {}
|
|
226819
226969
|
};
|
|
226820
226970
|
const target = recipePath(repoRoot);
|
|
226821
|
-
|
|
226822
|
-
|
|
226971
|
+
fs53.mkdirSync(path56.dirname(target), { recursive: true });
|
|
226972
|
+
fs53.writeFileSync(target, JSON.stringify(recipe, null, 2) + "\n");
|
|
226823
226973
|
return {
|
|
226824
226974
|
status: "discovered",
|
|
226825
226975
|
recipe,
|
|
226826
226976
|
fingerprint: computeRecipeFingerprint(repoRoot),
|
|
226827
|
-
wrotePath:
|
|
226977
|
+
wrotePath: path56.relative(repoRoot, target)
|
|
226828
226978
|
};
|
|
226829
226979
|
}
|
|
226830
226980
|
async function proposeRecipeWithReask(input, runner2) {
|
|
@@ -226849,14 +226999,14 @@ async function proposeRecipeWithReask(input, runner2) {
|
|
|
226849
226999
|
return { error: `recipe proposal invalid after re-ask: ${flattenZodError(reParsed.error)}` };
|
|
226850
227000
|
}
|
|
226851
227001
|
function readDiscoveryInputs(repoRoot) {
|
|
226852
|
-
const pkgPath =
|
|
226853
|
-
const packageJson =
|
|
226854
|
-
const presentInputs = DISCOVERY_INPUTS.filter((f2) =>
|
|
227002
|
+
const pkgPath = path56.join(repoRoot, "package.json");
|
|
227003
|
+
const packageJson = fs53.existsSync(pkgPath) ? fs53.readFileSync(pkgPath, "utf-8") : "(no package.json)";
|
|
227004
|
+
const presentInputs = DISCOVERY_INPUTS.filter((f2) => fs53.existsSync(path56.join(repoRoot, f2)));
|
|
226855
227005
|
return { packageJson, presentInputs };
|
|
226856
227006
|
}
|
|
226857
227007
|
async function probeEntry(repoRoot, entry) {
|
|
226858
227008
|
const resolved = resolveEntry(repoRoot, entry);
|
|
226859
|
-
const cwd =
|
|
227009
|
+
const cwd = fs53.mkdtempSync(path56.join(os7.tmpdir(), "tc-guard-probe-"));
|
|
226860
227010
|
try {
|
|
226861
227011
|
for (const args of [["--help"], []]) {
|
|
226862
227012
|
const capture = await executeStep({
|
|
@@ -226873,7 +227023,7 @@ async function probeEntry(repoRoot, entry) {
|
|
|
226873
227023
|
reason: `entrypoint ${JSON.stringify(entry)} did not answer to \`--help\` or a bare invocation`
|
|
226874
227024
|
};
|
|
226875
227025
|
} finally {
|
|
226876
|
-
|
|
227026
|
+
fs53.rmSync(cwd, { recursive: true, force: true });
|
|
226877
227027
|
}
|
|
226878
227028
|
}
|
|
226879
227029
|
|
|
@@ -226920,8 +227070,8 @@ async function birthValidate(repoRoot, candidates, opts = {}) {
|
|
|
226920
227070
|
}
|
|
226921
227071
|
|
|
226922
227072
|
// packages/guard-generator/dist/serialize.js
|
|
226923
|
-
import
|
|
226924
|
-
import
|
|
227073
|
+
import fs54 from "node:fs";
|
|
227074
|
+
import path57 from "node:path";
|
|
226925
227075
|
init_dist();
|
|
226926
227076
|
function anchorLeaf(anchor) {
|
|
226927
227077
|
const segs = anchor.split("/").filter(Boolean);
|
|
@@ -226940,7 +227090,7 @@ function assignScenarioId(anchor, used) {
|
|
|
226940
227090
|
function areaOrDocSlug(section) {
|
|
226941
227091
|
if (section.areaTags.length > 0)
|
|
226942
227092
|
return slugifyHeading(section.areaTags[0]) || "area";
|
|
226943
|
-
const base =
|
|
227093
|
+
const base = path57.basename(section.doc).replace(/\.[^.]+$/, "");
|
|
226944
227094
|
return slugifyHeading(base) || "doc";
|
|
226945
227095
|
}
|
|
226946
227096
|
function buildScenario(section, raw, id) {
|
|
@@ -226963,15 +227113,15 @@ function scenarioFileIndex(repoRoot) {
|
|
|
226963
227113
|
const root = scenariosDir(repoRoot);
|
|
226964
227114
|
const map2 = /* @__PURE__ */ new Map();
|
|
226965
227115
|
const walk20 = (dir) => {
|
|
226966
|
-
if (!
|
|
227116
|
+
if (!fs54.existsSync(dir))
|
|
226967
227117
|
return;
|
|
226968
|
-
for (const entry of
|
|
226969
|
-
const full =
|
|
227118
|
+
for (const entry of fs54.readdirSync(dir, { withFileTypes: true })) {
|
|
227119
|
+
const full = path57.join(dir, entry.name);
|
|
226970
227120
|
if (entry.isDirectory())
|
|
226971
227121
|
walk20(full);
|
|
226972
227122
|
else if (entry.isFile() && /\.ya?ml$/i.test(entry.name)) {
|
|
226973
227123
|
try {
|
|
226974
|
-
const doc = jsYaml.load(
|
|
227124
|
+
const doc = jsYaml.load(fs54.readFileSync(full, "utf-8"));
|
|
226975
227125
|
if (doc && typeof doc.id === "string")
|
|
226976
227126
|
map2.set(doc.id, full);
|
|
226977
227127
|
} catch {
|
|
@@ -226989,18 +227139,18 @@ function serializeScenarioYaml(scenario) {
|
|
|
226989
227139
|
return jsYaml.dump(scenario, { lineWidth: -1, noRefs: true });
|
|
226990
227140
|
}
|
|
226991
227141
|
function writeScenarioFile(repoRoot, slug2, scenario) {
|
|
226992
|
-
const dir =
|
|
226993
|
-
|
|
226994
|
-
const file =
|
|
226995
|
-
|
|
226996
|
-
return
|
|
227142
|
+
const dir = path57.join(scenariosDir(repoRoot), slug2);
|
|
227143
|
+
fs54.mkdirSync(dir, { recursive: true });
|
|
227144
|
+
const file = path57.join(dir, `${scenario.id}.yaml`);
|
|
227145
|
+
fs54.writeFileSync(file, serializeScenarioYaml(scenario));
|
|
227146
|
+
return path57.relative(repoRoot, file);
|
|
226997
227147
|
}
|
|
226998
227148
|
function deleteScenarioFiles(repoRoot, ids) {
|
|
226999
227149
|
const index = scenarioFileIndex(repoRoot);
|
|
227000
227150
|
for (const id of ids) {
|
|
227001
227151
|
const file = index.get(id);
|
|
227002
|
-
if (file &&
|
|
227003
|
-
|
|
227152
|
+
if (file && fs54.existsSync(file))
|
|
227153
|
+
fs54.rmSync(file);
|
|
227004
227154
|
}
|
|
227005
227155
|
}
|
|
227006
227156
|
|
|
@@ -227220,7 +227370,7 @@ async function generateGuards(options) {
|
|
|
227220
227370
|
anchor: section.anchor,
|
|
227221
227371
|
fingerprint: section.fingerprint,
|
|
227222
227372
|
scenarioIds: scenarioIds.slice().sort(),
|
|
227223
|
-
generationInputsHash: generationInputsHash(section.fingerprint, recipeFingerprint),
|
|
227373
|
+
generationInputsHash: generationInputsHash(section.fingerprint, recipeFingerprint, section.suppressionFingerprint),
|
|
227224
227374
|
...classification ? { classification } : {}
|
|
227225
227375
|
});
|
|
227226
227376
|
settledKeys.add(k);
|
|
@@ -228127,8 +228277,8 @@ function routeContextInner(rules, fileAnalyses, fileContents) {
|
|
|
228127
228277
|
}
|
|
228128
228278
|
|
|
228129
228279
|
// packages/core/dist/services/llm/model-prices.js
|
|
228130
|
-
import
|
|
228131
|
-
import
|
|
228280
|
+
import fs55 from "node:fs";
|
|
228281
|
+
import path58 from "node:path";
|
|
228132
228282
|
var OPENROUTER_URL = "https://openrouter.ai/api/v1/models";
|
|
228133
228283
|
var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
228134
228284
|
var FETCH_TIMEOUT_MS = 8e3;
|
|
@@ -228144,11 +228294,11 @@ function tierOf(id) {
|
|
|
228144
228294
|
return s.includes("opus") ? "opus" : s.includes("sonnet") ? "sonnet" : s.includes("haiku") ? "haiku" : null;
|
|
228145
228295
|
}
|
|
228146
228296
|
function cacheFilePath() {
|
|
228147
|
-
return
|
|
228297
|
+
return path58.join(getGlobalDir(), "cache", CACHE_FILE);
|
|
228148
228298
|
}
|
|
228149
228299
|
function readCache7() {
|
|
228150
228300
|
try {
|
|
228151
|
-
const t = JSON.parse(
|
|
228301
|
+
const t = JSON.parse(fs55.readFileSync(cacheFilePath(), "utf-8"));
|
|
228152
228302
|
if (t && t.tiers && t.byId && typeof t.fetchedAt === "number")
|
|
228153
228303
|
return t;
|
|
228154
228304
|
} catch {
|
|
@@ -228157,8 +228307,8 @@ function readCache7() {
|
|
|
228157
228307
|
}
|
|
228158
228308
|
function writeCache7(t) {
|
|
228159
228309
|
try {
|
|
228160
|
-
|
|
228161
|
-
|
|
228310
|
+
fs55.mkdirSync(path58.dirname(cacheFilePath()), { recursive: true });
|
|
228311
|
+
fs55.writeFileSync(cacheFilePath(), JSON.stringify(t));
|
|
228162
228312
|
} catch {
|
|
228163
228313
|
}
|
|
228164
228314
|
}
|
|
@@ -228536,8 +228686,8 @@ function changedSubject(total, changed, noun) {
|
|
|
228536
228686
|
}
|
|
228537
228687
|
|
|
228538
228688
|
// packages/core/dist/commands/spec-in-process.js
|
|
228539
|
-
import
|
|
228540
|
-
import
|
|
228689
|
+
import fs60 from "node:fs";
|
|
228690
|
+
import path63 from "node:path";
|
|
228541
228691
|
import { createHash as createHash19, randomUUID as randomUUID21 } from "node:crypto";
|
|
228542
228692
|
|
|
228543
228693
|
// packages/core/dist/lib/repo-ref.js
|
|
@@ -228557,8 +228707,8 @@ async function repoRef(repoRoot, commitOverride) {
|
|
|
228557
228707
|
}
|
|
228558
228708
|
|
|
228559
228709
|
// packages/core/dist/lib/contract-store.js
|
|
228560
|
-
import
|
|
228561
|
-
import
|
|
228710
|
+
import fs56 from "node:fs";
|
|
228711
|
+
import path59 from "node:path";
|
|
228562
228712
|
var KIND_REL = {
|
|
228563
228713
|
contracts: [".truecourse", "contracts"],
|
|
228564
228714
|
// The inferred tree lives at contracts/_inferred (matches `writeInferred`).
|
|
@@ -228568,13 +228718,13 @@ function countTcFiles(dir) {
|
|
|
228568
228718
|
let n = 0;
|
|
228569
228719
|
let entries;
|
|
228570
228720
|
try {
|
|
228571
|
-
entries =
|
|
228721
|
+
entries = fs56.readdirSync(dir, { withFileTypes: true });
|
|
228572
228722
|
} catch {
|
|
228573
228723
|
return 0;
|
|
228574
228724
|
}
|
|
228575
228725
|
for (const e of entries) {
|
|
228576
228726
|
if (e.isDirectory())
|
|
228577
|
-
n += countTcFiles(
|
|
228727
|
+
n += countTcFiles(path59.join(dir, e.name));
|
|
228578
228728
|
else if (e.isFile() && e.name.endsWith(".tc"))
|
|
228579
228729
|
n += 1;
|
|
228580
228730
|
}
|
|
@@ -228585,7 +228735,7 @@ function walkTcRel(dir, excludeInferred) {
|
|
|
228585
228735
|
const walk20 = (rel) => {
|
|
228586
228736
|
let entries;
|
|
228587
228737
|
try {
|
|
228588
|
-
entries =
|
|
228738
|
+
entries = fs56.readdirSync(path59.join(dir, rel), { withFileTypes: true });
|
|
228589
228739
|
} catch {
|
|
228590
228740
|
return;
|
|
228591
228741
|
}
|
|
@@ -228609,50 +228759,50 @@ function safeResolve(root, rel) {
|
|
|
228609
228759
|
return null;
|
|
228610
228760
|
if (norm.split("/").some((s) => s === ".." || s === "." || s === ""))
|
|
228611
228761
|
return null;
|
|
228612
|
-
const base =
|
|
228613
|
-
const dest =
|
|
228614
|
-
if (dest !== base && !dest.startsWith(base +
|
|
228762
|
+
const base = path59.resolve(root);
|
|
228763
|
+
const dest = path59.resolve(base, norm);
|
|
228764
|
+
if (dest !== base && !dest.startsWith(base + path59.sep))
|
|
228615
228765
|
return null;
|
|
228616
228766
|
return dest;
|
|
228617
228767
|
}
|
|
228618
228768
|
var FileContractStore = class {
|
|
228619
228769
|
materializesInPlace = true;
|
|
228620
228770
|
async saveContracts(ref, kind, _sourceDir) {
|
|
228621
|
-
const dir =
|
|
228771
|
+
const dir = path59.join(ref.repoKey, ...KIND_REL[kind]);
|
|
228622
228772
|
return { manifest: {}, fileCount: countTcFiles(dir), objectsWritten: 0, manifestHash: "" };
|
|
228623
228773
|
}
|
|
228624
228774
|
async loadContracts(ref, kind) {
|
|
228625
|
-
const dir =
|
|
228626
|
-
if (!
|
|
228775
|
+
const dir = path59.join(ref.repoKey, ...KIND_REL[kind]);
|
|
228776
|
+
if (!fs56.existsSync(dir))
|
|
228627
228777
|
return null;
|
|
228628
228778
|
return { dir, cleanup: async () => {
|
|
228629
228779
|
} };
|
|
228630
228780
|
}
|
|
228631
228781
|
async hasContracts(ref, kind) {
|
|
228632
|
-
return
|
|
228782
|
+
return fs56.existsSync(path59.join(ref.repoKey, ...KIND_REL[kind]));
|
|
228633
228783
|
}
|
|
228634
228784
|
// The file impl reads the live repo tree, which is whatever is checked out —
|
|
228635
228785
|
// there is no per-commit history, so `commitSha` is ignored (OSS is latest).
|
|
228636
228786
|
async listContractFiles(repoKey, kind, _commitSha) {
|
|
228637
|
-
return walkTcRel(
|
|
228787
|
+
return walkTcRel(path59.join(repoKey, ...KIND_REL[kind]), kind === "contracts");
|
|
228638
228788
|
}
|
|
228639
228789
|
async readContractFile(repoKey, kind, relPath, _commitSha) {
|
|
228640
|
-
const dest = safeResolve(
|
|
228641
|
-
if (!dest || !
|
|
228790
|
+
const dest = safeResolve(path59.join(repoKey, ...KIND_REL[kind]), relPath);
|
|
228791
|
+
if (!dest || !fs56.existsSync(dest) || !fs56.statSync(dest).isFile())
|
|
228642
228792
|
return null;
|
|
228643
|
-
return
|
|
228793
|
+
return fs56.readFileSync(dest, "utf-8");
|
|
228644
228794
|
}
|
|
228645
228795
|
async putContractFile(ref, kind, relPath, content) {
|
|
228646
|
-
const dest = safeResolve(
|
|
228796
|
+
const dest = safeResolve(path59.join(ref.repoKey, ...KIND_REL[kind]), relPath);
|
|
228647
228797
|
if (!dest)
|
|
228648
228798
|
throw new Error(`[contract-store] unsafe contract path: ${relPath}`);
|
|
228649
|
-
|
|
228650
|
-
|
|
228799
|
+
fs56.mkdirSync(path59.dirname(dest), { recursive: true });
|
|
228800
|
+
fs56.writeFileSync(dest, content);
|
|
228651
228801
|
}
|
|
228652
228802
|
async deleteContractFile(ref, kind, relPath) {
|
|
228653
|
-
const dest = safeResolve(
|
|
228803
|
+
const dest = safeResolve(path59.join(ref.repoKey, ...KIND_REL[kind]), relPath);
|
|
228654
228804
|
if (dest)
|
|
228655
|
-
|
|
228805
|
+
fs56.rmSync(dest, { force: true });
|
|
228656
228806
|
}
|
|
228657
228807
|
// OSS/local has no workspace concept (mirrors the spec store). Writing throws
|
|
228658
228808
|
// (fail loud — a caller that reached here is mis-wired); reads are empty so an
|
|
@@ -228682,16 +228832,16 @@ var readWorkspaceContractFile = (ref, kind, relPath) => active9.readWorkspaceCon
|
|
|
228682
228832
|
var contractsMaterializeInPlace = () => active9.materializesInPlace;
|
|
228683
228833
|
|
|
228684
228834
|
// packages/core/dist/lib/repo-doc-reader.js
|
|
228685
|
-
import
|
|
228686
|
-
import
|
|
228835
|
+
import fs57 from "node:fs";
|
|
228836
|
+
import path60 from "node:path";
|
|
228687
228837
|
var fileRepoDocReader = async (repoKey, docPath) => {
|
|
228688
|
-
const root =
|
|
228689
|
-
const full =
|
|
228690
|
-
if (full !== root && !full.startsWith(root +
|
|
228838
|
+
const root = path60.resolve(repoKey);
|
|
228839
|
+
const full = path60.resolve(root, docPath);
|
|
228840
|
+
if (full !== root && !full.startsWith(root + path60.sep))
|
|
228691
228841
|
return null;
|
|
228692
|
-
if (!
|
|
228842
|
+
if (!fs57.existsSync(full) || !fs57.statSync(full).isFile())
|
|
228693
228843
|
return null;
|
|
228694
|
-
return
|
|
228844
|
+
return fs57.readFileSync(full, "utf-8");
|
|
228695
228845
|
};
|
|
228696
228846
|
var reader = fileRepoDocReader;
|
|
228697
228847
|
function readRepoDoc(repoKey, docPath, opts) {
|
|
@@ -228699,23 +228849,23 @@ function readRepoDoc(repoKey, docPath, opts) {
|
|
|
228699
228849
|
}
|
|
228700
228850
|
|
|
228701
228851
|
// packages/core/dist/lib/inferred-action-store.js
|
|
228702
|
-
import
|
|
228703
|
-
import
|
|
228852
|
+
import fs58 from "node:fs";
|
|
228853
|
+
import path61 from "node:path";
|
|
228704
228854
|
function actionsFile(repoKey) {
|
|
228705
|
-
return
|
|
228855
|
+
return path61.join(repoKey, ".truecourse", "specs", "inferred-actions.json");
|
|
228706
228856
|
}
|
|
228707
228857
|
var FileInferredActionStore = class {
|
|
228708
228858
|
read(repoKey) {
|
|
228709
228859
|
try {
|
|
228710
|
-
return JSON.parse(
|
|
228860
|
+
return JSON.parse(fs58.readFileSync(actionsFile(repoKey), "utf-8"));
|
|
228711
228861
|
} catch {
|
|
228712
228862
|
return [];
|
|
228713
228863
|
}
|
|
228714
228864
|
}
|
|
228715
228865
|
write(repoKey, actions) {
|
|
228716
228866
|
const file = actionsFile(repoKey);
|
|
228717
|
-
|
|
228718
|
-
|
|
228867
|
+
fs58.mkdirSync(path61.dirname(file), { recursive: true });
|
|
228868
|
+
fs58.writeFileSync(file, JSON.stringify(actions, null, 2) + "\n", "utf-8");
|
|
228719
228869
|
}
|
|
228720
228870
|
async setAction(repoKey, action) {
|
|
228721
228871
|
const next = this.read(repoKey).filter((a) => !(a.kind === action.kind && a.identity === action.identity));
|
|
@@ -228838,8 +228988,8 @@ async function reapplyPromoted(ref, decisions) {
|
|
|
228838
228988
|
}
|
|
228839
228989
|
|
|
228840
228990
|
// packages/core/dist/services/telemetry.service.js
|
|
228841
|
-
import
|
|
228842
|
-
import
|
|
228991
|
+
import fs59 from "node:fs";
|
|
228992
|
+
import path62 from "node:path";
|
|
228843
228993
|
import os9 from "node:os";
|
|
228844
228994
|
import crypto5 from "node:crypto";
|
|
228845
228995
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
@@ -229579,8 +229729,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname9(proce
|
|
|
229579
229729
|
return decodedFile;
|
|
229580
229730
|
};
|
|
229581
229731
|
}
|
|
229582
|
-
function normalizeWindowsPath(
|
|
229583
|
-
return
|
|
229732
|
+
function normalizeWindowsPath(path75) {
|
|
229733
|
+
return path75.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
229584
229734
|
}
|
|
229585
229735
|
var ReduceableCache = class {
|
|
229586
229736
|
constructor(_maxSize) {
|
|
@@ -229659,9 +229809,9 @@ async function addSourceContext(frames) {
|
|
|
229659
229809
|
LRU_FILE_CONTENTS_CACHE.reduce();
|
|
229660
229810
|
return frames;
|
|
229661
229811
|
}
|
|
229662
|
-
function getContextLinesFromFile(
|
|
229812
|
+
function getContextLinesFromFile(path75, ranges, output) {
|
|
229663
229813
|
return new Promise((resolve11) => {
|
|
229664
|
-
const stream = createReadStream(
|
|
229814
|
+
const stream = createReadStream(path75);
|
|
229665
229815
|
const lineReaded = createInterface({
|
|
229666
229816
|
input: stream
|
|
229667
229817
|
});
|
|
@@ -229679,7 +229829,7 @@ function getContextLinesFromFile(path74, ranges, output) {
|
|
|
229679
229829
|
let rangeStart = range2[0];
|
|
229680
229830
|
let rangeEnd = range2[1];
|
|
229681
229831
|
function onStreamError() {
|
|
229682
|
-
LRU_FILE_CONTENTS_FS_READ_FAILED.set(
|
|
229832
|
+
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path75, 1);
|
|
229683
229833
|
lineReaded.close();
|
|
229684
229834
|
lineReaded.removeAllListeners();
|
|
229685
229835
|
destroyStreamAndResolve();
|
|
@@ -229756,8 +229906,8 @@ function clearLineContext(frame) {
|
|
|
229756
229906
|
delete frame.context_line;
|
|
229757
229907
|
delete frame.post_context;
|
|
229758
229908
|
}
|
|
229759
|
-
function shouldSkipContextLinesForFile(
|
|
229760
|
-
return
|
|
229909
|
+
function shouldSkipContextLinesForFile(path75) {
|
|
229910
|
+
return path75.startsWith("node:") || path75.endsWith(".min.js") || path75.endsWith(".min.cjs") || path75.endsWith(".min.mjs") || path75.startsWith("data:");
|
|
229761
229911
|
}
|
|
229762
229912
|
function shouldSkipContextLinesForFrame(frame) {
|
|
229763
229913
|
if (frame.lineno !== void 0 && frame.lineno > MAX_CONTEXTLINES_LINENO) {
|
|
@@ -232629,12 +232779,12 @@ var DEFAULT_CONFIG = {
|
|
|
232629
232779
|
};
|
|
232630
232780
|
var POSTHOG_API_KEY = "phc_ys9Ykf49KmNqAC3fhq3jugTejc4BDqyKqRS8qRoYZYew";
|
|
232631
232781
|
function getTelemetryConfigPath() {
|
|
232632
|
-
return
|
|
232782
|
+
return path62.join(os9.homedir(), ".truecourse", "telemetry.json");
|
|
232633
232783
|
}
|
|
232634
232784
|
function readTelemetryConfig() {
|
|
232635
232785
|
const configPath = getTelemetryConfigPath();
|
|
232636
232786
|
try {
|
|
232637
|
-
const raw =
|
|
232787
|
+
const raw = fs59.readFileSync(configPath, "utf-8");
|
|
232638
232788
|
const parsed = JSON.parse(raw);
|
|
232639
232789
|
const config2 = { ...DEFAULT_CONFIG, ...parsed };
|
|
232640
232790
|
if (!config2.anonymousId) {
|
|
@@ -232654,17 +232804,17 @@ function readTelemetryConfig() {
|
|
|
232654
232804
|
}
|
|
232655
232805
|
function writeTelemetryConfig(partial) {
|
|
232656
232806
|
const configPath = getTelemetryConfigPath();
|
|
232657
|
-
const dir =
|
|
232658
|
-
|
|
232807
|
+
const dir = path62.dirname(configPath);
|
|
232808
|
+
fs59.mkdirSync(dir, { recursive: true });
|
|
232659
232809
|
let current;
|
|
232660
232810
|
try {
|
|
232661
|
-
const raw =
|
|
232811
|
+
const raw = fs59.readFileSync(configPath, "utf-8");
|
|
232662
232812
|
current = { ...DEFAULT_CONFIG, ...JSON.parse(raw) };
|
|
232663
232813
|
} catch {
|
|
232664
232814
|
current = { ...DEFAULT_CONFIG };
|
|
232665
232815
|
}
|
|
232666
232816
|
const merged = { ...current, ...partial };
|
|
232667
|
-
|
|
232817
|
+
fs59.writeFileSync(configPath, JSON.stringify(merged, null, 2) + "\n", "utf-8");
|
|
232668
232818
|
}
|
|
232669
232819
|
var posthogClient = null;
|
|
232670
232820
|
function isTelemetryEnabled() {
|
|
@@ -232723,7 +232873,7 @@ function detectLanguages(result) {
|
|
|
232723
232873
|
const languages = /* @__PURE__ */ new Set();
|
|
232724
232874
|
for (const service of result.services) {
|
|
232725
232875
|
for (const filePath of service.files) {
|
|
232726
|
-
const ext2 =
|
|
232876
|
+
const ext2 = path62.extname(filePath).toLowerCase();
|
|
232727
232877
|
const lang = EXTENSION_TO_LANGUAGE[ext2];
|
|
232728
232878
|
if (lang)
|
|
232729
232879
|
languages.add(lang);
|
|
@@ -232736,13 +232886,13 @@ function readToolVersion() {
|
|
|
232736
232886
|
if (cachedVersion)
|
|
232737
232887
|
return cachedVersion;
|
|
232738
232888
|
if (true) {
|
|
232739
|
-
cachedVersion = "0.7.0-next.
|
|
232889
|
+
cachedVersion = "0.7.0-next.9";
|
|
232740
232890
|
return cachedVersion;
|
|
232741
232891
|
}
|
|
232742
232892
|
try {
|
|
232743
232893
|
const here = fileURLToPath5(import.meta.url);
|
|
232744
|
-
const pkgPath =
|
|
232745
|
-
const pkg = JSON.parse(
|
|
232894
|
+
const pkgPath = path62.resolve(path62.dirname(here), "..", "..", "package.json");
|
|
232895
|
+
const pkg = JSON.parse(fs59.readFileSync(pkgPath, "utf-8"));
|
|
232746
232896
|
cachedVersion = String(pkg.version ?? "0.0.0");
|
|
232747
232897
|
} catch {
|
|
232748
232898
|
cachedVersion = "0.0.0";
|
|
@@ -232882,13 +233032,13 @@ function resolveTransport(options) {
|
|
|
232882
233032
|
}
|
|
232883
233033
|
return getDefaultTransport();
|
|
232884
233034
|
}
|
|
232885
|
-
var GENERATED_MARKER_REL =
|
|
233035
|
+
var GENERATED_MARKER_REL = path63.join(".truecourse", "contracts", "result.json");
|
|
232886
233036
|
function generatedMarkerPath(repoRoot) {
|
|
232887
|
-
return
|
|
233037
|
+
return path63.join(repoRoot, GENERATED_MARKER_REL);
|
|
232888
233038
|
}
|
|
232889
233039
|
function stampGeneratedMarker(repoRoot, summary) {
|
|
232890
233040
|
const file = generatedMarkerPath(repoRoot);
|
|
232891
|
-
|
|
233041
|
+
fs60.mkdirSync(path63.dirname(file), { recursive: true });
|
|
232892
233042
|
const body = {
|
|
232893
233043
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
232894
233044
|
written: summary?.written ?? 0,
|
|
@@ -232896,11 +233046,11 @@ function stampGeneratedMarker(repoRoot, summary) {
|
|
|
232896
233046
|
validationIssues: summary?.validationIssues ?? [],
|
|
232897
233047
|
enumerateFailures: summary?.enumerateFailures ?? []
|
|
232898
233048
|
};
|
|
232899
|
-
|
|
233049
|
+
fs60.writeFileSync(file, JSON.stringify(body, null, 2) + "\n");
|
|
232900
233050
|
}
|
|
232901
233051
|
function readGeneratedSummary(repoRoot) {
|
|
232902
233052
|
try {
|
|
232903
|
-
const raw = JSON.parse(
|
|
233053
|
+
const raw = JSON.parse(fs60.readFileSync(generatedMarkerPath(repoRoot), "utf-8"));
|
|
232904
233054
|
return {
|
|
232905
233055
|
generatedAt: typeof raw.generatedAt === "string" ? raw.generatedAt : "",
|
|
232906
233056
|
written: typeof raw.written === "number" ? raw.written : 0,
|
|
@@ -233034,22 +233184,22 @@ async function curateInProcess(repoRoot, options = {}) {
|
|
|
233034
233184
|
}
|
|
233035
233185
|
}
|
|
233036
233186
|
function buildPriorContracts(repoRoot) {
|
|
233037
|
-
const dir =
|
|
233038
|
-
if (!
|
|
233187
|
+
const dir = path63.join(repoRoot, ".truecourse", "contracts");
|
|
233188
|
+
if (!fs60.existsSync(dir))
|
|
233039
233189
|
return void 0;
|
|
233040
233190
|
const targets = [];
|
|
233041
233191
|
const bodyByKey = /* @__PURE__ */ new Map();
|
|
233042
233192
|
const walk20 = (d) => {
|
|
233043
|
-
for (const e of
|
|
233193
|
+
for (const e of fs60.readdirSync(d, { withFileTypes: true })) {
|
|
233044
233194
|
if (e.isDirectory()) {
|
|
233045
233195
|
if (e.name === "_inferred")
|
|
233046
233196
|
continue;
|
|
233047
|
-
walk20(
|
|
233197
|
+
walk20(path63.join(d, e.name));
|
|
233048
233198
|
} else if (e.name.endsWith(".tc")) {
|
|
233049
|
-
const abs =
|
|
233050
|
-
const src =
|
|
233199
|
+
const abs = path63.join(d, e.name);
|
|
233200
|
+
const src = fs60.readFileSync(abs, "utf-8");
|
|
233051
233201
|
try {
|
|
233052
|
-
const file = parser_ohm_exports.parseTcFile(
|
|
233202
|
+
const file = parser_ohm_exports.parseTcFile(path63.relative(dir, abs), src);
|
|
233053
233203
|
for (const key4 of resolver_exports.resolve([file]).index.keys()) {
|
|
233054
233204
|
const colon = key4.indexOf(":");
|
|
233055
233205
|
if (colon < 0)
|
|
@@ -233209,9 +233359,9 @@ function resolverHardError(result) {
|
|
|
233209
233359
|
const detail = reasons.length ? reasons.slice(0, 3).join("; ") : "duplicate or conflicting artifact identities";
|
|
233210
233360
|
return new Error(`Contract corpus failed to resolve \u2014 ${detail}`);
|
|
233211
233361
|
}
|
|
233212
|
-
var LEGACY_VERIFY_STATE_REL =
|
|
233362
|
+
var LEGACY_VERIFY_STATE_REL = path63.join(".truecourse", ".cache", "verifier", "verify-state.json");
|
|
233213
233363
|
function legacyVerifyStatePath(repoRoot) {
|
|
233214
|
-
return
|
|
233364
|
+
return path63.join(repoRoot, LEGACY_VERIFY_STATE_REL);
|
|
233215
233365
|
}
|
|
233216
233366
|
async function readVerifyState(repoRoot) {
|
|
233217
233367
|
const latest = await readVerifyLatest(repoRoot);
|
|
@@ -233249,13 +233399,13 @@ async function readVerifyRunState(repoRoot, runId) {
|
|
|
233249
233399
|
};
|
|
233250
233400
|
}
|
|
233251
233401
|
async function withContracts(repoRoot, options, tracker, fn) {
|
|
233252
|
-
const fallbackPath =
|
|
233402
|
+
const fallbackPath = path63.join(repoRoot, ".truecourse", "contracts");
|
|
233253
233403
|
const wsMat = options.workspaceOrgId ? await loadWorkspaceContracts({ workspaceOrgId: options.workspaceOrgId }, "contracts") : null;
|
|
233254
233404
|
let repoMat = null;
|
|
233255
233405
|
try {
|
|
233256
233406
|
let recorded;
|
|
233257
233407
|
if (options.contractsDir) {
|
|
233258
|
-
if (!
|
|
233408
|
+
if (!fs60.existsSync(options.contractsDir)) {
|
|
233259
233409
|
const err = new Error(`Contracts directory not found at ${options.contractsDir}. Run \`truecourse contracts generate\` first.`);
|
|
233260
233410
|
tracker?.error("load", err.message);
|
|
233261
233411
|
throw err;
|
|
@@ -233300,7 +233450,7 @@ async function verifyInProcess(repoRoot, options = {}) {
|
|
|
233300
233450
|
tracker?.start("compare");
|
|
233301
233451
|
tracker?.done("compare", `${result.drifts.length} drift${result.drifts.length === 1 ? "" : "s"}`);
|
|
233302
233452
|
if (options.ref) {
|
|
233303
|
-
result.drifts = result.drifts.map((d) => d.filePath &&
|
|
233453
|
+
result.drifts = result.drifts.map((d) => d.filePath && path63.isAbsolute(d.filePath) ? { ...d, filePath: path63.relative(repoRoot, d.filePath).split(path63.sep).join("/") } : d);
|
|
233304
233454
|
}
|
|
233305
233455
|
const verifiedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
233306
233456
|
const { branch, commitHash } = await gitMeta(repoRoot);
|
|
@@ -233344,7 +233494,7 @@ async function verifyInProcess(repoRoot, options = {}) {
|
|
|
233344
233494
|
bySeverity: summary.bySeverity
|
|
233345
233495
|
});
|
|
233346
233496
|
await deleteVerifyDiff(storeKey);
|
|
233347
|
-
|
|
233497
|
+
fs60.rmSync(legacyVerifyStatePath(repoRoot), { force: true });
|
|
233348
233498
|
}
|
|
233349
233499
|
const state = {
|
|
233350
233500
|
verifiedAt,
|
|
@@ -233392,7 +233542,7 @@ async function runWithStash(repoRoot, skipStash, tracker, fn) {
|
|
|
233392
233542
|
const status = await stashGit.status();
|
|
233393
233543
|
if (!status.isClean()) {
|
|
233394
233544
|
const gitRoot = (await stashGit.revparse(["--show-toplevel"])).trim();
|
|
233395
|
-
if (
|
|
233545
|
+
if (path63.resolve(repoRoot) === path63.resolve(gitRoot)) {
|
|
233396
233546
|
tracker?.detail?.("load", "Stashing pending changes...");
|
|
233397
233547
|
const res = await stashGit.stash(["push", "--include-untracked", "-m", "truecourse-verify-stash"]);
|
|
233398
233548
|
didStash = !res.includes("No local changes");
|
|
@@ -233494,7 +233644,7 @@ async function verifyDiffInProcess(repoRoot, options = {}) {
|
|
|
233494
233644
|
async function inferInProcess(repoRoot, options = {}) {
|
|
233495
233645
|
const startedAt = Date.now();
|
|
233496
233646
|
const codeDir = options.codeDir ?? autodetectCodeDir(repoRoot);
|
|
233497
|
-
let contractsDir = options.contractsDir ??
|
|
233647
|
+
let contractsDir = options.contractsDir ?? path63.join(repoRoot, ".truecourse", "contracts");
|
|
233498
233648
|
let releaseContracts = async () => {
|
|
233499
233649
|
};
|
|
233500
233650
|
if (!options.contractsDir && options.ref) {
|
|
@@ -233538,7 +233688,7 @@ async function persistInferred(repoRoot, options, contractsDir, codeDir, started
|
|
|
233538
233688
|
});
|
|
233539
233689
|
}
|
|
233540
233690
|
if (!options.dryRun && options.ref) {
|
|
233541
|
-
await saveContracts(options.ref, "contracts_inferred",
|
|
233691
|
+
await saveContracts(options.ref, "contracts_inferred", path63.join(contractsDir, "_inferred"));
|
|
233542
233692
|
}
|
|
233543
233693
|
const rendered = result.decisions.map((d) => renderDecision(d));
|
|
233544
233694
|
const decisionPaths = rendered.map((r) => r.relPath);
|
|
@@ -233569,8 +233719,8 @@ async function inferDiffInProcess(repoRoot, options = {}) {
|
|
|
233569
233719
|
return diffDecisions(head, base);
|
|
233570
233720
|
}
|
|
233571
233721
|
function autodetectCodeDir(repoRoot) {
|
|
233572
|
-
const codeSubdir =
|
|
233573
|
-
if (
|
|
233722
|
+
const codeSubdir = path63.join(repoRoot, "code");
|
|
233723
|
+
if (fs60.existsSync(codeSubdir) && fs60.statSync(codeSubdir).isDirectory()) {
|
|
233574
233724
|
return codeSubdir;
|
|
233575
233725
|
}
|
|
233576
233726
|
return repoRoot;
|
|
@@ -233580,7 +233730,8 @@ var EMPTY_DECISIONS3 = {
|
|
|
233580
233730
|
manualIncludes: [],
|
|
233581
233731
|
manualExcludes: [],
|
|
233582
233732
|
relations: [],
|
|
233583
|
-
manualAreas: []
|
|
233733
|
+
manualAreas: [],
|
|
233734
|
+
conflictResolutions: []
|
|
233584
233735
|
};
|
|
233585
233736
|
var DECISIONS_REF = "_repo";
|
|
233586
233737
|
var prDecisionsRef = (pr) => `_pr/${pr}`;
|
|
@@ -233634,7 +233785,12 @@ function mergeDecisions(base, overlay) {
|
|
|
233634
233785
|
...(base.manualAreas ?? []).filter((a) => !overlayAreaDocs.has(a.doc)),
|
|
233635
233786
|
...overlay.manualAreas ?? []
|
|
233636
233787
|
];
|
|
233637
|
-
|
|
233788
|
+
const overlayResKeys = new Set((overlay.conflictResolutions ?? []).map(conflictResolutionKey));
|
|
233789
|
+
const conflictResolutions = [
|
|
233790
|
+
...(base.conflictResolutions ?? []).filter((r) => !overlayResKeys.has(conflictResolutionKey(r))),
|
|
233791
|
+
...overlay.conflictResolutions ?? []
|
|
233792
|
+
];
|
|
233793
|
+
return { version: 1, manualIncludes, manualExcludes, relations, manualAreas, conflictResolutions };
|
|
233638
233794
|
}
|
|
233639
233795
|
function uniqueStrings(items) {
|
|
233640
233796
|
return [...new Set(items)];
|
|
@@ -233688,7 +233844,7 @@ async function recurateStoredCorpus(repoKey) {
|
|
|
233688
233844
|
const commitSha = await baselineSpecCommit(repoKey);
|
|
233689
233845
|
if (commitSha)
|
|
233690
233846
|
await saveSpec({ repoKey, commitSha }, "corpus", result.corpus);
|
|
233691
|
-
return { corpus: result.corpus, openConflicts: result.
|
|
233847
|
+
return { corpus: result.corpus, openConflicts: openConflicts(result.corpus, decisions).length };
|
|
233692
233848
|
}
|
|
233693
233849
|
async function baselineSpecCommit(repoKey) {
|
|
233694
233850
|
return (await readVerifyState(repoKey))?.commitHash ?? null;
|
|
@@ -233711,9 +233867,16 @@ async function recuratePrCorpus(repoKey, prHeadSha, prNumber) {
|
|
|
233711
233867
|
skipCorpusWrite: true
|
|
233712
233868
|
});
|
|
233713
233869
|
await saveSpec({ repoKey, commitSha: prHeadSha }, "corpus", result.corpus);
|
|
233714
|
-
return { corpus: result.corpus, openConflicts: result.
|
|
233870
|
+
return { corpus: result.corpus, openConflicts: openConflicts(result.corpus, decisions).length };
|
|
233715
233871
|
}
|
|
233716
233872
|
var relationKey = (r) => `${[r.older, r.newer].sort().join(" ")} ${r.scope ?? ""}`;
|
|
233873
|
+
var conflictResolutionKey = (r) => {
|
|
233874
|
+
const sides = [
|
|
233875
|
+
`${r.docA}#${r.anchorA ?? ""}`,
|
|
233876
|
+
`${r.docB}#${r.anchorB ?? ""}`
|
|
233877
|
+
].sort();
|
|
233878
|
+
return sides.join(" \0 ");
|
|
233879
|
+
};
|
|
233717
233880
|
function applyAddRelation(existing, input) {
|
|
233718
233881
|
if (input.older === input.newer) {
|
|
233719
233882
|
throw new Error("addRelation: older and newer must be different docs");
|
|
@@ -233726,20 +233889,22 @@ function applyAddRelation(existing, input) {
|
|
|
233726
233889
|
manualIncludes: existing.manualIncludes ?? [],
|
|
233727
233890
|
manualExcludes: existing.manualExcludes ?? [],
|
|
233728
233891
|
relations: [...dedup, relation],
|
|
233729
|
-
manualAreas: existing.manualAreas ?? []
|
|
233892
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233893
|
+
conflictResolutions: existing.conflictResolutions ?? []
|
|
233730
233894
|
};
|
|
233731
233895
|
}
|
|
233732
233896
|
function applyRemoveRelation(existing, input) {
|
|
233733
233897
|
const matches = (r) => {
|
|
233734
|
-
const
|
|
233735
|
-
return
|
|
233898
|
+
const samePair2 = r.older === input.older && r.newer === input.newer || r.older === input.newer && r.newer === input.older;
|
|
233899
|
+
return samePair2 && (input.scope === void 0 || r.scope === input.scope);
|
|
233736
233900
|
};
|
|
233737
233901
|
return {
|
|
233738
233902
|
version: 1,
|
|
233739
233903
|
manualIncludes: existing.manualIncludes ?? [],
|
|
233740
233904
|
manualExcludes: existing.manualExcludes ?? [],
|
|
233741
233905
|
relations: (existing.relations ?? []).filter((r) => !matches(r)),
|
|
233742
|
-
manualAreas: existing.manualAreas ?? []
|
|
233906
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233907
|
+
conflictResolutions: existing.conflictResolutions ?? []
|
|
233743
233908
|
};
|
|
233744
233909
|
}
|
|
233745
233910
|
function applyAddManualInclude(existing, docPath) {
|
|
@@ -233752,7 +233917,8 @@ function applyAddManualInclude(existing, docPath) {
|
|
|
233752
233917
|
manualIncludes: includes.includes(docPath) ? includes : [...includes, docPath],
|
|
233753
233918
|
manualExcludes: excludes.filter((p) => p !== docPath),
|
|
233754
233919
|
relations: existing.relations ?? [],
|
|
233755
|
-
manualAreas: existing.manualAreas ?? []
|
|
233920
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233921
|
+
conflictResolutions: existing.conflictResolutions ?? []
|
|
233756
233922
|
};
|
|
233757
233923
|
}
|
|
233758
233924
|
function applyRemoveManualInclude(existing, docPath) {
|
|
@@ -233761,7 +233927,8 @@ function applyRemoveManualInclude(existing, docPath) {
|
|
|
233761
233927
|
manualIncludes: (existing.manualIncludes ?? []).filter((p) => p !== docPath),
|
|
233762
233928
|
manualExcludes: existing.manualExcludes ?? [],
|
|
233763
233929
|
relations: existing.relations ?? [],
|
|
233764
|
-
manualAreas: existing.manualAreas ?? []
|
|
233930
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233931
|
+
conflictResolutions: existing.conflictResolutions ?? []
|
|
233765
233932
|
};
|
|
233766
233933
|
}
|
|
233767
233934
|
function applyAddManualExclude(existing, docPath) {
|
|
@@ -233774,7 +233941,8 @@ function applyAddManualExclude(existing, docPath) {
|
|
|
233774
233941
|
manualIncludes: includes.filter((p) => p !== docPath),
|
|
233775
233942
|
manualExcludes: excludes.includes(docPath) ? excludes : [...excludes, docPath],
|
|
233776
233943
|
relations: existing.relations ?? [],
|
|
233777
|
-
manualAreas: existing.manualAreas ?? []
|
|
233944
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233945
|
+
conflictResolutions: existing.conflictResolutions ?? []
|
|
233778
233946
|
};
|
|
233779
233947
|
}
|
|
233780
233948
|
function applyRemoveManualExclude(existing, docPath) {
|
|
@@ -233783,7 +233951,34 @@ function applyRemoveManualExclude(existing, docPath) {
|
|
|
233783
233951
|
manualIncludes: existing.manualIncludes ?? [],
|
|
233784
233952
|
manualExcludes: (existing.manualExcludes ?? []).filter((p) => p !== docPath),
|
|
233785
233953
|
relations: existing.relations ?? [],
|
|
233786
|
-
manualAreas: existing.manualAreas ?? []
|
|
233954
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233955
|
+
conflictResolutions: existing.conflictResolutions ?? []
|
|
233956
|
+
};
|
|
233957
|
+
}
|
|
233958
|
+
function applyAddConflictResolution(existing, input) {
|
|
233959
|
+
if (input.docA === input.docB) {
|
|
233960
|
+
throw new Error("addConflictResolution: docA and docB must be different docs");
|
|
233961
|
+
}
|
|
233962
|
+
const key4 = conflictResolutionKey(input);
|
|
233963
|
+
const dedup = (existing.conflictResolutions ?? []).filter((r) => conflictResolutionKey(r) !== key4);
|
|
233964
|
+
return {
|
|
233965
|
+
version: 1,
|
|
233966
|
+
manualIncludes: existing.manualIncludes ?? [],
|
|
233967
|
+
manualExcludes: existing.manualExcludes ?? [],
|
|
233968
|
+
relations: existing.relations ?? [],
|
|
233969
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233970
|
+
conflictResolutions: [...dedup, input]
|
|
233971
|
+
};
|
|
233972
|
+
}
|
|
233973
|
+
function applyRemoveConflictResolution(existing, input) {
|
|
233974
|
+
const key4 = conflictResolutionKey({ ...input, verdict: "dismissed", resolvedAt: "" });
|
|
233975
|
+
return {
|
|
233976
|
+
version: 1,
|
|
233977
|
+
manualIncludes: existing.manualIncludes ?? [],
|
|
233978
|
+
manualExcludes: existing.manualExcludes ?? [],
|
|
233979
|
+
relations: existing.relations ?? [],
|
|
233980
|
+
manualAreas: existing.manualAreas ?? [],
|
|
233981
|
+
conflictResolutions: (existing.conflictResolutions ?? []).filter((r) => conflictResolutionKey(r) !== key4)
|
|
233787
233982
|
};
|
|
233788
233983
|
}
|
|
233789
233984
|
async function addRelation(repoRoot, input, opts) {
|
|
@@ -233820,6 +234015,16 @@ async function removeManualExclude(repoRoot, docPath, opts) {
|
|
|
233820
234015
|
await storeDecisions(repoRoot, next, opts);
|
|
233821
234016
|
return next;
|
|
233822
234017
|
}
|
|
234018
|
+
async function addConflictResolution(repoRoot, input, opts) {
|
|
234019
|
+
const next = applyAddConflictResolution(await loadDecisions(repoRoot, opts), input);
|
|
234020
|
+
await storeDecisions(repoRoot, next, opts);
|
|
234021
|
+
return next;
|
|
234022
|
+
}
|
|
234023
|
+
async function removeConflictResolution(repoRoot, input, opts) {
|
|
234024
|
+
const next = applyRemoveConflictResolution(await loadDecisions(repoRoot, opts), input);
|
|
234025
|
+
await storeDecisions(repoRoot, next, opts);
|
|
234026
|
+
return next;
|
|
234027
|
+
}
|
|
233823
234028
|
|
|
233824
234029
|
// packages/core/dist/commands/repo-events.js
|
|
233825
234030
|
function pickLatestEvent(candidates, registryLastAnalyzed) {
|
|
@@ -233925,10 +234130,10 @@ router.post("/", async (req, res, next) => {
|
|
|
233925
234130
|
throw createAppError("Invalid request body: path is required", 400);
|
|
233926
234131
|
}
|
|
233927
234132
|
const repoPath = parsed.data.path;
|
|
233928
|
-
if (!
|
|
234133
|
+
if (!fs61.existsSync(repoPath)) {
|
|
233929
234134
|
throw createAppError(`Path does not exist: ${repoPath}`, 400);
|
|
233930
234135
|
}
|
|
233931
|
-
if (!
|
|
234136
|
+
if (!fs61.statSync(repoPath).isDirectory()) {
|
|
233932
234137
|
throw createAppError(`Path is not a directory: ${repoPath}`, 400);
|
|
233933
234138
|
}
|
|
233934
234139
|
const entry = await registerProject(repoPath);
|
|
@@ -234011,8 +234216,8 @@ router.delete("/:id", async (req, res, next) => {
|
|
|
234011
234216
|
throw createAppError("Project not found", 404);
|
|
234012
234217
|
}
|
|
234013
234218
|
const tcDir = getRepoTruecourseDir(entry.path);
|
|
234014
|
-
if (
|
|
234015
|
-
|
|
234219
|
+
if (fs61.existsSync(tcDir)) {
|
|
234220
|
+
fs61.rmSync(tcDir, { recursive: true, force: true });
|
|
234016
234221
|
}
|
|
234017
234222
|
await unregisterProject(slug2);
|
|
234018
234223
|
res.status(204).send();
|
|
@@ -234083,7 +234288,7 @@ var repos_default = router;
|
|
|
234083
234288
|
// apps/dashboard/server/src/routes/analyses.ts
|
|
234084
234289
|
var import_express2 = __toESM(require_express2(), 1);
|
|
234085
234290
|
init_dist();
|
|
234086
|
-
import
|
|
234291
|
+
import path67 from "node:path";
|
|
234087
234292
|
|
|
234088
234293
|
// packages/core/dist/config/current-project.js
|
|
234089
234294
|
async function resolveProjectForRequest(slug2) {
|
|
@@ -234099,7 +234304,7 @@ async function resolveProjectForRequest(slug2) {
|
|
|
234099
234304
|
// packages/core/dist/commands/analyze-core.js
|
|
234100
234305
|
init_logger();
|
|
234101
234306
|
import { randomUUID as randomUUID27 } from "node:crypto";
|
|
234102
|
-
import
|
|
234307
|
+
import path65 from "node:path";
|
|
234103
234308
|
|
|
234104
234309
|
// packages/core/dist/services/analyzer.service.js
|
|
234105
234310
|
init_logger();
|
|
@@ -234721,8 +234926,8 @@ async function enrichFlowWithLLM(repoPath, flowId) {
|
|
|
234721
234926
|
// packages/core/dist/services/violation-pipeline.service.js
|
|
234722
234927
|
init_dist3();
|
|
234723
234928
|
import { randomUUID as randomUUID26 } from "node:crypto";
|
|
234724
|
-
import
|
|
234725
|
-
import
|
|
234929
|
+
import fs62 from "node:fs";
|
|
234930
|
+
import path64 from "node:path";
|
|
234726
234931
|
init_provider();
|
|
234727
234932
|
|
|
234728
234933
|
// packages/core/dist/services/violation.service.js
|
|
@@ -235124,7 +235329,7 @@ function findCSharpProjectFiles(repoPath) {
|
|
|
235124
235329
|
return;
|
|
235125
235330
|
let entries;
|
|
235126
235331
|
try {
|
|
235127
|
-
entries =
|
|
235332
|
+
entries = fs62.readdirSync(dir, { withFileTypes: true });
|
|
235128
235333
|
} catch {
|
|
235129
235334
|
return;
|
|
235130
235335
|
}
|
|
@@ -235132,18 +235337,18 @@ function findCSharpProjectFiles(repoPath) {
|
|
|
235132
235337
|
if (e.isDirectory()) {
|
|
235133
235338
|
if (SKIP.has(e.name) || e.name.startsWith("."))
|
|
235134
235339
|
continue;
|
|
235135
|
-
walk20(
|
|
235340
|
+
walk20(path64.join(dir, e.name), depth + 1);
|
|
235136
235341
|
} else if (e.isFile()) {
|
|
235137
235342
|
if (e.name.endsWith(".sln") || e.name.endsWith(".slnx"))
|
|
235138
|
-
solutions.push(
|
|
235343
|
+
solutions.push(path64.join(dir, e.name));
|
|
235139
235344
|
else if (e.name.endsWith(".csproj"))
|
|
235140
|
-
projects.push(
|
|
235345
|
+
projects.push(path64.join(dir, e.name));
|
|
235141
235346
|
}
|
|
235142
235347
|
}
|
|
235143
235348
|
};
|
|
235144
235349
|
walk20(repoPath, 0);
|
|
235145
235350
|
if (solutions.length > 0) {
|
|
235146
|
-
solutions.sort((a, b) => a.split(
|
|
235351
|
+
solutions.sort((a, b) => a.split(path64.sep).length - b.split(path64.sep).length);
|
|
235147
235352
|
return [solutions[0]];
|
|
235148
235353
|
}
|
|
235149
235354
|
return projects;
|
|
@@ -235247,7 +235452,7 @@ async function runViolationPipeline(input) {
|
|
|
235247
235452
|
const enabledLlmCodeRules = enableLlmRules !== false ? allRules.filter((r) => (r.domain ? codeDomains.has(r.domain) : r.category === "code") && r.type === "llm" && r.prompt) : [];
|
|
235248
235453
|
const archLlmRules = allRules.filter((r) => r.type === "llm" && r.prompt && r.domain === "architecture").map((r) => ({ key: r.key, name: r.name, severity: r.severity, prompt: r.prompt, category: r.category }));
|
|
235249
235454
|
const dbSchemaLlmRules = allRules.filter((r) => r.type === "llm" && r.prompt && r.domain === "database" && r.category === "database").map((r) => ({ key: r.key, name: r.name, severity: r.severity, prompt: r.prompt, category: r.category }));
|
|
235250
|
-
const filesToScan = changedFileSet ? [...changedFileSet].map((relPath) => ({ filePath: relPath, resolve: true })) : (result.fileAnalyses || []).map((fa) => ({ filePath: fa.filePath, resolve: !
|
|
235455
|
+
const filesToScan = changedFileSet ? [...changedFileSet].map((relPath) => ({ filePath: relPath, resolve: true })) : (result.fileAnalyses || []).map((fa) => ({ filePath: fa.filePath, resolve: !path64.isAbsolute(fa.filePath) }));
|
|
235251
235456
|
const hasLlm = enabledLlm.length > 0;
|
|
235252
235457
|
if (hasLlm)
|
|
235253
235458
|
tracker?.start("scan", "Reading files...");
|
|
@@ -235259,10 +235464,10 @@ async function runViolationPipeline(input) {
|
|
|
235259
235464
|
const lang = detectLanguage(filePath);
|
|
235260
235465
|
if (!lang)
|
|
235261
235466
|
continue;
|
|
235262
|
-
const absPath = resolve11 ?
|
|
235263
|
-
if (!
|
|
235467
|
+
const absPath = resolve11 ? path64.resolve(repoPath, filePath) : path64.isAbsolute(filePath) ? filePath : path64.join(repoPath, filePath);
|
|
235468
|
+
if (!fs62.existsSync(absPath))
|
|
235264
235469
|
continue;
|
|
235265
|
-
const content =
|
|
235470
|
+
const content = fs62.readFileSync(absPath, "utf-8");
|
|
235266
235471
|
const lineCount = content.split("\n").length;
|
|
235267
235472
|
fileContents.set(changedFileSet ? absPath : filePath, { content, lineCount });
|
|
235268
235473
|
} catch {
|
|
@@ -235275,7 +235480,7 @@ async function runViolationPipeline(input) {
|
|
|
235275
235480
|
let typeQuery;
|
|
235276
235481
|
const enabledCodeKeys = new Set(enabledCodeRules.filter((r) => r.type === "deterministic" && r.enabled).map((r) => r.key));
|
|
235277
235482
|
if (hasTypeAwareVisitors(enabledCodeKeys)) {
|
|
235278
|
-
const tsFiles = filesToScan.filter(({ filePath: fp }) => /\.(ts|tsx|js|jsx)$/.test(fp)).map(({ filePath: fp, resolve: res }) => res ?
|
|
235483
|
+
const tsFiles = filesToScan.filter(({ filePath: fp }) => /\.(ts|tsx|js|jsx)$/.test(fp)).map(({ filePath: fp, resolve: res }) => res ? path64.resolve(repoPath, fp) : path64.isAbsolute(fp) ? fp : path64.join(repoPath, fp));
|
|
235279
235484
|
if (tsFiles.length > 0) {
|
|
235280
235485
|
const scoped = buildScopedCompilerOptions(repoPath);
|
|
235281
235486
|
typeQuery = createTypeQueryService(tsFiles, scoped, repoPath);
|
|
@@ -235369,7 +235574,7 @@ async function runViolationPipeline(input) {
|
|
|
235369
235574
|
const lang = detectLanguage(filePath);
|
|
235370
235575
|
if (!lang)
|
|
235371
235576
|
continue;
|
|
235372
|
-
const absPath = resolve11 ?
|
|
235577
|
+
const absPath = resolve11 ? path64.resolve(repoPath, filePath) : path64.isAbsolute(filePath) ? filePath : path64.join(repoPath, filePath);
|
|
235373
235578
|
const key4 = changedFileSet ? absPath : filePath;
|
|
235374
235579
|
const fc = fileContents.get(key4);
|
|
235375
235580
|
if (!fc)
|
|
@@ -235426,7 +235631,7 @@ async function runViolationPipeline(input) {
|
|
|
235426
235631
|
for (const { filePath, resolve: resolve11 } of filesToScan) {
|
|
235427
235632
|
if (detectLanguage(filePath) !== "csharp")
|
|
235428
235633
|
continue;
|
|
235429
|
-
const absPath = resolve11 ?
|
|
235634
|
+
const absPath = resolve11 ? path64.resolve(repoPath, filePath) : path64.isAbsolute(filePath) ? filePath : path64.join(repoPath, filePath);
|
|
235430
235635
|
const key4 = changedFileSet ? absPath : filePath;
|
|
235431
235636
|
const fc = fileContents.get(key4);
|
|
235432
235637
|
if (fc)
|
|
@@ -235465,26 +235670,26 @@ async function runViolationPipeline(input) {
|
|
|
235465
235670
|
const ruleByKey = new Map(enabledWorkspaceRules.map((r) => [r.key, r]));
|
|
235466
235671
|
const ruleKeys = enabledWorkspaceRules.map((r) => r.key);
|
|
235467
235672
|
for (const [pi, projectFile] of projectFiles.entries()) {
|
|
235468
|
-
startCsharpStep(projectFiles.length > 1 ? `Loading project ${pi + 1}/${projectFiles.length}: ${
|
|
235673
|
+
startCsharpStep(projectFiles.length > 1 ? `Loading project ${pi + 1}/${projectFiles.length}: ${path64.basename(projectFile)}\u2026` : `Loading project ${path64.basename(projectFile)}\u2026`);
|
|
235469
235674
|
let wsViolations;
|
|
235470
235675
|
try {
|
|
235471
235676
|
wsViolations = await runRoslynWorkspace(projectFile, ruleKeys);
|
|
235472
235677
|
} catch (err) {
|
|
235473
|
-
tracker?.error("csharp", `Project load failed: ${
|
|
235678
|
+
tracker?.error("csharp", `Project load failed: ${path64.basename(projectFile)}`);
|
|
235474
235679
|
if (err instanceof RoslynHostUnavailableError)
|
|
235475
235680
|
throw err;
|
|
235476
|
-
throw new Error(`Project-aware C# analysis failed for ${
|
|
235681
|
+
throw new Error(`Project-aware C# analysis failed for ${path64.basename(projectFile)}: ${err.message}. Restore the project (\`dotnet restore\`) and ensure its pinned .NET SDK is installed.`);
|
|
235477
235682
|
}
|
|
235478
235683
|
for (const v of wsViolations) {
|
|
235479
235684
|
const rule = ruleByKey.get(v.ruleKey);
|
|
235480
235685
|
if (!rule)
|
|
235481
235686
|
continue;
|
|
235482
|
-
const relPath =
|
|
235687
|
+
const relPath = path64.isAbsolute(v.path) ? path64.relative(repoPath, v.path) : v.path;
|
|
235483
235688
|
const fileKey = changedFileSet ? v.path : relPath;
|
|
235484
235689
|
let snippet2 = fileContents.get(fileKey)?.content.split("\n")[v.line - 1];
|
|
235485
235690
|
if (snippet2 === void 0) {
|
|
235486
235691
|
try {
|
|
235487
|
-
snippet2 =
|
|
235692
|
+
snippet2 = fs62.readFileSync(v.path, "utf-8").split("\n")[v.line - 1];
|
|
235488
235693
|
} catch {
|
|
235489
235694
|
snippet2 = "";
|
|
235490
235695
|
}
|
|
@@ -235511,11 +235716,11 @@ async function runViolationPipeline(input) {
|
|
|
235511
235716
|
}
|
|
235512
235717
|
log.info(`[Pipeline] Code scan: ${allCodeViolations.length} violations from ${filesToScan.length} files (${enabledCodeRules.length} det rules, ${enabledLlmCodeRules.length} LLM rules)`);
|
|
235513
235718
|
if (enabledCodeRules.some((r) => r.key === "bugs/deterministic/invalid-pyproject-toml")) {
|
|
235514
|
-
const pyprojectPath =
|
|
235515
|
-
if (
|
|
235719
|
+
const pyprojectPath = path64.join(repoPath, "pyproject.toml");
|
|
235720
|
+
if (fs62.existsSync(pyprojectPath)) {
|
|
235516
235721
|
try {
|
|
235517
235722
|
const { checkPyprojectToml: checkPyprojectToml2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports));
|
|
235518
|
-
const content =
|
|
235723
|
+
const content = fs62.readFileSync(pyprojectPath, "utf-8");
|
|
235519
235724
|
const tomlViolations = checkPyprojectToml2(pyprojectPath, content);
|
|
235520
235725
|
allCodeViolations.push(...tomlViolations);
|
|
235521
235726
|
} catch {
|
|
@@ -236348,7 +236553,7 @@ function processLlmCodeViolations(codeResult, validFilePaths, fileContents, allC
|
|
|
236348
236553
|
for (const v of codeResult.violations) {
|
|
236349
236554
|
let filePath = v.filePath;
|
|
236350
236555
|
if (!validFilePaths.has(filePath)) {
|
|
236351
|
-
const resolved =
|
|
236556
|
+
const resolved = path64.resolve(repoPath, filePath);
|
|
236352
236557
|
if (validFilePaths.has(resolved)) {
|
|
236353
236558
|
filePath = resolved;
|
|
236354
236559
|
} else {
|
|
@@ -236403,8 +236608,8 @@ function toUsageRecords(records) {
|
|
|
236403
236608
|
|
|
236404
236609
|
// packages/core/dist/commands/analyze-core.js
|
|
236405
236610
|
function toRepoRelative(filePath, codeDir) {
|
|
236406
|
-
if (
|
|
236407
|
-
return
|
|
236611
|
+
if (path65.isAbsolute(filePath) && (filePath === codeDir || filePath.startsWith(codeDir + path65.sep))) {
|
|
236612
|
+
return path65.relative(codeDir, filePath).split(path65.sep).join("/");
|
|
236408
236613
|
}
|
|
236409
236614
|
return filePath;
|
|
236410
236615
|
}
|
|
@@ -236458,7 +236663,7 @@ async function analyzeCore(project, options) {
|
|
|
236458
236663
|
const status = await stashGit.status();
|
|
236459
236664
|
if (!status.isClean()) {
|
|
236460
236665
|
const gitRoot = (await stashGit.revparse(["--show-toplevel"])).trim();
|
|
236461
|
-
const isSubdirectory =
|
|
236666
|
+
const isSubdirectory = path65.resolve(codeDir) !== path65.resolve(gitRoot);
|
|
236462
236667
|
if (!isSubdirectory) {
|
|
236463
236668
|
options.tracker?.detail("parse", "Stashing pending changes...");
|
|
236464
236669
|
options.onProgress?.({ detail: "Stashing pending changes to analyze committed state..." });
|
|
@@ -236529,7 +236734,7 @@ async function analyzeCore(project, options) {
|
|
|
236529
236734
|
options.tracker?.done("parse", `${result.services.length} services, ${result.fileAnalyses?.length ?? 0} files`);
|
|
236530
236735
|
const previousActiveViolations = latestBaseline ? latestBaseline.violations.filter((v) => branch == null || latestBaseline.analysis.branch == null || latestBaseline.analysis.branch === branch) : [];
|
|
236531
236736
|
const previousAnalysisId = latestBaseline?.analysis.id ?? null;
|
|
236532
|
-
const previousForDiff = previousActiveViolations.map((v) => v.filePath && !
|
|
236737
|
+
const previousForDiff = previousActiveViolations.map((v) => v.filePath && !path65.isAbsolute(v.filePath) ? { ...v, filePath: path65.resolve(codeDir, v.filePath) } : v);
|
|
236533
236738
|
const provider = options.provider ?? (effectiveLlmRules ? createLLMProvider(options.transport ?? getDefaultTransport()) : void 0);
|
|
236534
236739
|
if (provider) {
|
|
236535
236740
|
provider.setAnalysisId(analysisId);
|
|
@@ -236621,7 +236826,7 @@ function enforceLocationInvariant(violations) {
|
|
|
236621
236826
|
|
|
236622
236827
|
// packages/core/dist/commands/analyze-persist.js
|
|
236623
236828
|
init_logger();
|
|
236624
|
-
import
|
|
236829
|
+
import path66 from "node:path";
|
|
236625
236830
|
async function persistFullAnalysis(project, core2, startedAt) {
|
|
236626
236831
|
const filename = buildAnalysisFilename(core2.analysisId, core2.now);
|
|
236627
236832
|
const snapshot = {
|
|
@@ -236749,8 +236954,8 @@ function buildDiffSnapshot(repoPath, core2, baseline) {
|
|
|
236749
236954
|
const newViolations = pipelineResult.added.map(denormalize);
|
|
236750
236955
|
const latestById = new Map(baseline.violations.map((v) => [v.id, v]));
|
|
236751
236956
|
const resolvedViolations = pipelineResult.resolvedRefs.map((r) => latestById.get(r.id)).filter((v) => !!v);
|
|
236752
|
-
const changedAbs = new Set(changedFiles.map((c) =>
|
|
236753
|
-
const matchesChanged = (p) => !!p && (changedAbs.has(p) || changedAbs.has(
|
|
236957
|
+
const changedAbs = new Set(changedFiles.map((c) => path66.resolve(repoPath, c.path)));
|
|
236958
|
+
const matchesChanged = (p) => !!p && (changedAbs.has(p) || changedAbs.has(path66.resolve(repoPath, p)));
|
|
236754
236959
|
const affectedModules = graph.modules.filter((m) => matchesChanged(m.filePath));
|
|
236755
236960
|
const affectedModuleIdSet = new Set(affectedModules.map((m) => m.id));
|
|
236756
236961
|
const serviceNameById = new Map(graph.services.map((s) => [s.id, s.name]));
|
|
@@ -237047,7 +237252,7 @@ router2.post("/:id/analyses", async (req, res, next) => {
|
|
|
237047
237252
|
const trackerSteps = buildAnalysisSteps(effectiveCategories, effectiveLlmRules);
|
|
237048
237253
|
const tracker = createSocketTracker(id, trackerSteps);
|
|
237049
237254
|
pushLogger({
|
|
237050
|
-
filePath:
|
|
237255
|
+
filePath: path67.join(repo.path, ".truecourse/logs/analyze.log"),
|
|
237051
237256
|
tee: process.env.TRUECOURSE_DEV === "1"
|
|
237052
237257
|
});
|
|
237053
237258
|
try {
|
|
@@ -237313,7 +237518,7 @@ async function resolveStashDecisionForRoute(repoId, repoPath) {
|
|
|
237313
237518
|
const status = await git.status();
|
|
237314
237519
|
if (status.isClean()) return "stash";
|
|
237315
237520
|
const gitRoot = (await git.revparse(["--show-toplevel"])).trim();
|
|
237316
|
-
if (
|
|
237521
|
+
if (path67.resolve(repoPath) !== path67.resolve(gitRoot)) return "stash";
|
|
237317
237522
|
modifiedCount = status.modified.length + status.staged.length + status.deleted.length + status.created.length;
|
|
237318
237523
|
untrackedCount = status.not_added.length;
|
|
237319
237524
|
} catch {
|
|
@@ -237415,7 +237620,7 @@ var analyses_default = router2;
|
|
|
237415
237620
|
var import_express3 = __toESM(require_express2(), 1);
|
|
237416
237621
|
|
|
237417
237622
|
// packages/core/dist/config/ui-state.js
|
|
237418
|
-
import
|
|
237623
|
+
import fs63 from "node:fs";
|
|
237419
237624
|
var EMPTY_STATE = { positions: {}, collapsed: {} };
|
|
237420
237625
|
function scopeKey(branch, level) {
|
|
237421
237626
|
return `${branch || "HEAD"}/${level}`;
|
|
@@ -237423,10 +237628,10 @@ function scopeKey(branch, level) {
|
|
|
237423
237628
|
var FileUiStateStore = class {
|
|
237424
237629
|
async readUiState(repoDir) {
|
|
237425
237630
|
const file = getRepoUiStatePath(repoDir);
|
|
237426
|
-
if (!
|
|
237631
|
+
if (!fs63.existsSync(file))
|
|
237427
237632
|
return structuredClone(EMPTY_STATE);
|
|
237428
237633
|
try {
|
|
237429
|
-
const parsed = JSON.parse(
|
|
237634
|
+
const parsed = JSON.parse(fs63.readFileSync(file, "utf-8"));
|
|
237430
237635
|
return {
|
|
237431
237636
|
positions: parsed.positions ?? {},
|
|
237432
237637
|
collapsed: parsed.collapsed ?? {}
|
|
@@ -237437,7 +237642,7 @@ var FileUiStateStore = class {
|
|
|
237437
237642
|
}
|
|
237438
237643
|
async writeUiState(repoDir, state) {
|
|
237439
237644
|
ensureRepoTruecourseDir(repoDir);
|
|
237440
|
-
|
|
237645
|
+
fs63.writeFileSync(getRepoUiStatePath(repoDir), JSON.stringify(state, null, 2), "utf-8");
|
|
237441
237646
|
}
|
|
237442
237647
|
};
|
|
237443
237648
|
var active11 = new FileUiStateStore();
|
|
@@ -238320,8 +238525,8 @@ var graph_default = router3;
|
|
|
238320
238525
|
|
|
238321
238526
|
// apps/dashboard/server/src/routes/files.ts
|
|
238322
238527
|
var import_express4 = __toESM(require_express2(), 1);
|
|
238323
|
-
import
|
|
238324
|
-
import
|
|
238528
|
+
import fs64 from "node:fs";
|
|
238529
|
+
import path68 from "node:path";
|
|
238325
238530
|
var router4 = (0, import_express4.Router)();
|
|
238326
238531
|
router4.get("/:id/files", async (req, res, next) => {
|
|
238327
238532
|
try {
|
|
@@ -238350,28 +238555,28 @@ router4.get("/:id/file-content", async (req, res, next) => {
|
|
|
238350
238555
|
const ref = req.query.ref;
|
|
238351
238556
|
if (!filePath) throw createAppError('Missing "path" query parameter', 400);
|
|
238352
238557
|
const repo = await resolveProjectForRequest(id);
|
|
238353
|
-
const resolved =
|
|
238354
|
-
if (!resolved.startsWith(
|
|
238558
|
+
const resolved = path68.resolve(repo.path, filePath);
|
|
238559
|
+
if (!resolved.startsWith(path68.resolve(repo.path) + path68.sep) && resolved !== path68.resolve(repo.path)) {
|
|
238355
238560
|
throw createAppError("Path traversal not allowed", 403);
|
|
238356
238561
|
}
|
|
238357
238562
|
let content;
|
|
238358
238563
|
if (ref === "working-tree") {
|
|
238359
|
-
if (!
|
|
238360
|
-
const stat =
|
|
238564
|
+
if (!fs64.existsSync(resolved)) throw createAppError("File not found", 404);
|
|
238565
|
+
const stat = fs64.statSync(resolved);
|
|
238361
238566
|
if (!stat.isFile()) throw createAppError("Path is not a file", 400);
|
|
238362
|
-
content =
|
|
238567
|
+
content = fs64.readFileSync(resolved, "utf-8");
|
|
238363
238568
|
} else {
|
|
238364
238569
|
const git = await getGit(repo.path);
|
|
238365
238570
|
try {
|
|
238366
238571
|
content = await git.show([`HEAD:${filePath}`]);
|
|
238367
238572
|
} catch {
|
|
238368
|
-
if (!
|
|
238369
|
-
const stat =
|
|
238573
|
+
if (!fs64.existsSync(resolved)) throw createAppError("File not found", 404);
|
|
238574
|
+
const stat = fs64.statSync(resolved);
|
|
238370
238575
|
if (!stat.isFile()) throw createAppError("Path is not a file", 400);
|
|
238371
|
-
content =
|
|
238576
|
+
content = fs64.readFileSync(resolved, "utf-8");
|
|
238372
238577
|
}
|
|
238373
238578
|
}
|
|
238374
|
-
const ext2 =
|
|
238579
|
+
const ext2 = path68.extname(resolved).slice(1).toLowerCase();
|
|
238375
238580
|
const langMap = {
|
|
238376
238581
|
ts: "typescript",
|
|
238377
238582
|
tsx: "typescript",
|
|
@@ -238871,8 +239076,8 @@ var analytics_default = router9;
|
|
|
238871
239076
|
|
|
238872
239077
|
// apps/dashboard/server/src/routes/spec.ts
|
|
238873
239078
|
var import_express10 = __toESM(require_express2(), 1);
|
|
238874
|
-
import
|
|
238875
|
-
import
|
|
239079
|
+
import fs65 from "node:fs";
|
|
239080
|
+
import path69 from "node:path";
|
|
238876
239081
|
|
|
238877
239082
|
// packages/core/dist/lib/background-tasks.js
|
|
238878
239083
|
var runner = null;
|
|
@@ -238907,6 +239112,7 @@ async function corpusPayload(repoPath, ref, pr) {
|
|
|
238907
239112
|
userRelations: decisions.relations ?? [],
|
|
238908
239113
|
manualIncludes: decisions.manualIncludes ?? [],
|
|
238909
239114
|
manualExcludes: decisions.manualExcludes ?? [],
|
|
239115
|
+
conflictResolutions: decisions.conflictResolutions ?? [],
|
|
238910
239116
|
corpusCommit
|
|
238911
239117
|
};
|
|
238912
239118
|
}
|
|
@@ -238916,6 +239122,7 @@ function prCorpusPayload(repoPath, pr, ref, corpus) {
|
|
|
238916
239122
|
userRelations: decisions.relations ?? [],
|
|
238917
239123
|
manualIncludes: decisions.manualIncludes ?? [],
|
|
238918
239124
|
manualExcludes: decisions.manualExcludes ?? [],
|
|
239125
|
+
conflictResolutions: decisions.conflictResolutions ?? [],
|
|
238919
239126
|
corpusCommit: corpus ? ref : void 0
|
|
238920
239127
|
}));
|
|
238921
239128
|
}
|
|
@@ -238986,7 +239193,7 @@ router10.get(
|
|
|
238986
239193
|
res.status(400).json({ error: "Missing ?ref=<doc path>." });
|
|
238987
239194
|
return;
|
|
238988
239195
|
}
|
|
238989
|
-
if (
|
|
239196
|
+
if (path69.isAbsolute(ref) || ref.split(/[\\/]/).includes("..")) {
|
|
238990
239197
|
res.status(400).json({ error: "ref escapes the repository." });
|
|
238991
239198
|
return;
|
|
238992
239199
|
}
|
|
@@ -239235,6 +239442,92 @@ router10.delete(
|
|
|
239235
239442
|
}
|
|
239236
239443
|
}
|
|
239237
239444
|
);
|
|
239445
|
+
var CONFLICT_VERDICTS = ["a", "b", "dismissed"];
|
|
239446
|
+
async function mutateConflictResolution(repoPath, res, mutate) {
|
|
239447
|
+
if (!contractsMaterializeInPlace()) {
|
|
239448
|
+
await mutate();
|
|
239449
|
+
await recurateAndRegenIfResolved(repoPath);
|
|
239450
|
+
res.json(await corpusPayload(repoPath));
|
|
239451
|
+
return;
|
|
239452
|
+
}
|
|
239453
|
+
const decisions = await mutate();
|
|
239454
|
+
res.json({ conflictResolutions: decisions.conflictResolutions ?? [] });
|
|
239455
|
+
}
|
|
239456
|
+
async function applyConflictResolution(req, res, repoPath, mutate) {
|
|
239457
|
+
const parsed = parsePrScope(req);
|
|
239458
|
+
if ("error" in parsed) {
|
|
239459
|
+
res.status(400).json({ error: parsed.error });
|
|
239460
|
+
return;
|
|
239461
|
+
}
|
|
239462
|
+
if (parsed.scope) {
|
|
239463
|
+
await mutateSpecDecisionPr(repoPath, parsed.scope, res, mutate);
|
|
239464
|
+
return;
|
|
239465
|
+
}
|
|
239466
|
+
await mutateConflictResolution(repoPath, res, () => mutate());
|
|
239467
|
+
}
|
|
239468
|
+
router10.post(
|
|
239469
|
+
"/:id/spec/conflict-resolution",
|
|
239470
|
+
async (req, res, next) => {
|
|
239471
|
+
try {
|
|
239472
|
+
const repo = await resolveProjectForRequest(req.params.id);
|
|
239473
|
+
const body = req.body;
|
|
239474
|
+
if (!body.docA || !body.docB || body.docA === body.docB) {
|
|
239475
|
+
res.status(400).json({ error: "docA and docB are required and must differ." });
|
|
239476
|
+
return;
|
|
239477
|
+
}
|
|
239478
|
+
if (!body.verdict || !CONFLICT_VERDICTS.includes(body.verdict)) {
|
|
239479
|
+
res.status(400).json({ error: `verdict must be one of ${CONFLICT_VERDICTS.join(", ")}.` });
|
|
239480
|
+
return;
|
|
239481
|
+
}
|
|
239482
|
+
const resolution = {
|
|
239483
|
+
docA: body.docA,
|
|
239484
|
+
anchorA: body.anchorA ?? null,
|
|
239485
|
+
quoteA: body.quoteA,
|
|
239486
|
+
docB: body.docB,
|
|
239487
|
+
anchorB: body.anchorB ?? null,
|
|
239488
|
+
quoteB: body.quoteB,
|
|
239489
|
+
verdict: body.verdict,
|
|
239490
|
+
resolvedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
239491
|
+
note: body.note
|
|
239492
|
+
};
|
|
239493
|
+
await applyConflictResolution(
|
|
239494
|
+
req,
|
|
239495
|
+
res,
|
|
239496
|
+
repo.path,
|
|
239497
|
+
(opts) => addConflictResolution(repo.path, resolution, opts)
|
|
239498
|
+
);
|
|
239499
|
+
} catch (e) {
|
|
239500
|
+
next(e);
|
|
239501
|
+
}
|
|
239502
|
+
}
|
|
239503
|
+
);
|
|
239504
|
+
router10.delete(
|
|
239505
|
+
"/:id/spec/conflict-resolution",
|
|
239506
|
+
async (req, res, next) => {
|
|
239507
|
+
try {
|
|
239508
|
+
const repo = await resolveProjectForRequest(req.params.id);
|
|
239509
|
+
const body = req.body;
|
|
239510
|
+
if (!body.docA || !body.docB) {
|
|
239511
|
+
res.status(400).json({ error: "docA and docB are required." });
|
|
239512
|
+
return;
|
|
239513
|
+
}
|
|
239514
|
+
const input = {
|
|
239515
|
+
docA: body.docA,
|
|
239516
|
+
anchorA: body.anchorA ?? null,
|
|
239517
|
+
docB: body.docB,
|
|
239518
|
+
anchorB: body.anchorB ?? null
|
|
239519
|
+
};
|
|
239520
|
+
await applyConflictResolution(
|
|
239521
|
+
req,
|
|
239522
|
+
res,
|
|
239523
|
+
repo.path,
|
|
239524
|
+
(opts) => removeConflictResolution(repo.path, input, opts)
|
|
239525
|
+
);
|
|
239526
|
+
} catch (e) {
|
|
239527
|
+
next(e);
|
|
239528
|
+
}
|
|
239529
|
+
}
|
|
239530
|
+
);
|
|
239238
239531
|
router10.get(
|
|
239239
239532
|
"/:id/spec/staleness",
|
|
239240
239533
|
async (req, res, next) => {
|
|
@@ -239251,6 +239544,8 @@ router10.get(
|
|
|
239251
239544
|
verifyStale: false,
|
|
239252
239545
|
// EE re-curates on every decision, so decisions never outrun the corpus.
|
|
239253
239546
|
decisionsPending: false,
|
|
239547
|
+
// EE has no live tree — docs can't drift out from under the stored corpus.
|
|
239548
|
+
docsChanged: false,
|
|
239254
239549
|
hasCorpus: corpus !== null,
|
|
239255
239550
|
hasGenerated: contractFiles.length > 0,
|
|
239256
239551
|
hasVerified: verify2 !== null
|
|
@@ -239266,6 +239561,7 @@ router10.get(
|
|
|
239266
239561
|
contractsStale,
|
|
239267
239562
|
verifyStale,
|
|
239268
239563
|
decisionsPending: hasPendingDecisions(repo.path),
|
|
239564
|
+
docsChanged: hasChangedDocs(repo.path),
|
|
239269
239565
|
hasCorpus: corpusMtime !== null,
|
|
239270
239566
|
hasGenerated: generatedMtime !== null,
|
|
239271
239567
|
hasVerified: verifiedMtime !== null
|
|
@@ -239277,7 +239573,7 @@ router10.get(
|
|
|
239277
239573
|
);
|
|
239278
239574
|
function mtimeIfExists(file) {
|
|
239279
239575
|
try {
|
|
239280
|
-
return
|
|
239576
|
+
return fs65.statSync(file).mtimeMs;
|
|
239281
239577
|
} catch {
|
|
239282
239578
|
return null;
|
|
239283
239579
|
}
|
|
@@ -239286,7 +239582,7 @@ function hasPendingDecisions(repoPath) {
|
|
|
239286
239582
|
const decisionsMtime = mtimeIfExists(decisionsPath(repoPath));
|
|
239287
239583
|
if (decisionsMtime === null) return false;
|
|
239288
239584
|
try {
|
|
239289
|
-
const corpus = JSON.parse(
|
|
239585
|
+
const corpus = JSON.parse(fs65.readFileSync(corpusFilePath(repoPath), "utf8"));
|
|
239290
239586
|
const generatedAt = Date.parse(corpus.generatedAt ?? "");
|
|
239291
239587
|
if (Number.isNaN(generatedAt)) return false;
|
|
239292
239588
|
return decisionsMtime > generatedAt;
|
|
@@ -239294,6 +239590,21 @@ function hasPendingDecisions(repoPath) {
|
|
|
239294
239590
|
return false;
|
|
239295
239591
|
}
|
|
239296
239592
|
}
|
|
239593
|
+
function hasChangedDocs(repoPath) {
|
|
239594
|
+
try {
|
|
239595
|
+
const corpus = JSON.parse(fs65.readFileSync(corpusFilePath(repoPath), "utf8"));
|
|
239596
|
+
const generatedAt = Date.parse(corpus.generatedAt ?? "");
|
|
239597
|
+
if (Number.isNaN(generatedAt)) return false;
|
|
239598
|
+
for (const doc of corpus.docs ?? []) {
|
|
239599
|
+
if (!doc.ref) continue;
|
|
239600
|
+
const docMtime = mtimeIfExists(path69.join(repoPath, doc.ref));
|
|
239601
|
+
if (docMtime !== null && docMtime > generatedAt) return true;
|
|
239602
|
+
}
|
|
239603
|
+
return false;
|
|
239604
|
+
} catch {
|
|
239605
|
+
return false;
|
|
239606
|
+
}
|
|
239607
|
+
}
|
|
239297
239608
|
var spec_default = router10;
|
|
239298
239609
|
|
|
239299
239610
|
// apps/dashboard/server/src/routes/contracts.ts
|
|
@@ -239349,16 +239660,16 @@ async function effectiveContractFiles(repoKey, workspaceOrgId, commitSha) {
|
|
|
239349
239660
|
authored = await listContractFiles(repoKey, "contracts");
|
|
239350
239661
|
}
|
|
239351
239662
|
const promoted = new Set(await promotedContractPaths(repoKey));
|
|
239352
|
-
const out = authored.map((
|
|
239353
|
-
path:
|
|
239663
|
+
const out = authored.map((path75) => ({
|
|
239664
|
+
path: path75,
|
|
239354
239665
|
provenance: "repo",
|
|
239355
|
-
inferred: promoted.has(
|
|
239666
|
+
inferred: promoted.has(path75)
|
|
239356
239667
|
}));
|
|
239357
239668
|
if (workspaceOrgId) {
|
|
239358
239669
|
const repoSet = new Set(authored);
|
|
239359
239670
|
const ws = await listWorkspaceContractFiles({ workspaceOrgId }, "contracts");
|
|
239360
|
-
for (const
|
|
239361
|
-
if (!repoSet.has(
|
|
239671
|
+
for (const path75 of ws) {
|
|
239672
|
+
if (!repoSet.has(path75)) out.push({ path: path75, provenance: "workspace" });
|
|
239362
239673
|
}
|
|
239363
239674
|
}
|
|
239364
239675
|
return out;
|
|
@@ -239540,7 +239851,7 @@ var contracts_default = router11;
|
|
|
239540
239851
|
|
|
239541
239852
|
// apps/dashboard/server/src/routes/verify.ts
|
|
239542
239853
|
var import_express12 = __toESM(require_express2(), 1);
|
|
239543
|
-
import
|
|
239854
|
+
import path70 from "node:path";
|
|
239544
239855
|
|
|
239545
239856
|
// packages/core/dist/lib/workspace-doc-links.js
|
|
239546
239857
|
var resolver = null;
|
|
@@ -239680,7 +239991,7 @@ async function resolveVerifyStashDecision(repoId, repoPath) {
|
|
|
239680
239991
|
const status = await git.status();
|
|
239681
239992
|
if (status.isClean()) return "stash";
|
|
239682
239993
|
const gitRoot = (await git.revparse(["--show-toplevel"])).trim();
|
|
239683
|
-
if (
|
|
239994
|
+
if (path70.resolve(repoPath) !== path70.resolve(gitRoot)) return "stash";
|
|
239684
239995
|
modifiedCount = status.modified.length + status.staged.length + status.deleted.length + status.created.length;
|
|
239685
239996
|
untrackedCount = status.not_added.length;
|
|
239686
239997
|
} catch {
|
|
@@ -239901,12 +240212,12 @@ var verify_default = router12;
|
|
|
239901
240212
|
|
|
239902
240213
|
// apps/dashboard/server/src/routes/guard.ts
|
|
239903
240214
|
var import_express13 = __toESM(require_express2(), 1);
|
|
239904
|
-
import
|
|
240215
|
+
import path72 from "node:path";
|
|
239905
240216
|
init_dist();
|
|
239906
240217
|
|
|
239907
240218
|
// packages/core/dist/commands/guard-read.js
|
|
239908
|
-
import
|
|
239909
|
-
import
|
|
240219
|
+
import fs66 from "node:fs";
|
|
240220
|
+
import path71 from "node:path";
|
|
239910
240221
|
init_dist();
|
|
239911
240222
|
function composeDocCoverage(doc, content, sources) {
|
|
239912
240223
|
const { manifest, latest, result } = sources;
|
|
@@ -240074,11 +240385,11 @@ function listGuardScenarios(repoRoot) {
|
|
|
240074
240385
|
function headingTextIndex(repoRoot, docs) {
|
|
240075
240386
|
const map2 = /* @__PURE__ */ new Map();
|
|
240076
240387
|
for (const doc of new Set(docs)) {
|
|
240077
|
-
if (
|
|
240388
|
+
if (path71.isAbsolute(doc) || doc.split(/[\\/]/).includes(".."))
|
|
240078
240389
|
continue;
|
|
240079
240390
|
let content;
|
|
240080
240391
|
try {
|
|
240081
|
-
content =
|
|
240392
|
+
content = fs66.readFileSync(path71.join(repoRoot, doc), "utf-8");
|
|
240082
240393
|
} catch {
|
|
240083
240394
|
continue;
|
|
240084
240395
|
}
|
|
@@ -240136,13 +240447,13 @@ function scenarioFilesById(repoRoot) {
|
|
|
240136
240447
|
for (const file of collectYamlFiles(scenariosDir(repoRoot)).sort()) {
|
|
240137
240448
|
let parsed;
|
|
240138
240449
|
try {
|
|
240139
|
-
parsed = jsYaml.load(
|
|
240450
|
+
parsed = jsYaml.load(fs66.readFileSync(file, "utf-8"));
|
|
240140
240451
|
} catch {
|
|
240141
240452
|
continue;
|
|
240142
240453
|
}
|
|
240143
240454
|
const id = parsed?.id;
|
|
240144
240455
|
if (typeof id === "string" && !map2.has(id))
|
|
240145
|
-
map2.set(id,
|
|
240456
|
+
map2.set(id, path71.relative(repoRoot, file));
|
|
240146
240457
|
}
|
|
240147
240458
|
return map2;
|
|
240148
240459
|
}
|
|
@@ -240159,7 +240470,7 @@ function readGuardScenarioSource(repoRoot, id) {
|
|
|
240159
240470
|
for (const file of collectYamlFiles(scenariosDir(repoRoot))) {
|
|
240160
240471
|
let raw;
|
|
240161
240472
|
try {
|
|
240162
|
-
raw =
|
|
240473
|
+
raw = fs66.readFileSync(file, "utf-8");
|
|
240163
240474
|
} catch {
|
|
240164
240475
|
continue;
|
|
240165
240476
|
}
|
|
@@ -240170,7 +240481,7 @@ function readGuardScenarioSource(repoRoot, id) {
|
|
|
240170
240481
|
continue;
|
|
240171
240482
|
}
|
|
240172
240483
|
if (parsed && typeof parsed === "object" && parsed.id === id) {
|
|
240173
|
-
return { id, file:
|
|
240484
|
+
return { id, file: path71.relative(repoRoot, file), content: raw };
|
|
240174
240485
|
}
|
|
240175
240486
|
}
|
|
240176
240487
|
return null;
|
|
@@ -240178,27 +240489,27 @@ function readGuardScenarioSource(repoRoot, id) {
|
|
|
240178
240489
|
function readGuardEvidence(repoRoot, runId, scenarioId, file = "transcript.txt") {
|
|
240179
240490
|
if (!SAFE_SEGMENT.test(runId) || !SAFE_SEGMENT.test(file))
|
|
240180
240491
|
return null;
|
|
240181
|
-
const full =
|
|
240182
|
-
const runDir =
|
|
240183
|
-
if (full !== runDir && !full.startsWith(runDir +
|
|
240492
|
+
const full = path71.resolve(evidenceScenarioDir(repoRoot, runId, scenarioId), file);
|
|
240493
|
+
const runDir = path71.resolve(evidenceRunDir(repoRoot, runId));
|
|
240494
|
+
if (full !== runDir && !full.startsWith(runDir + path71.sep))
|
|
240184
240495
|
return null;
|
|
240185
|
-
if (!
|
|
240496
|
+
if (!fs66.existsSync(full) || !fs66.statSync(full).isFile())
|
|
240186
240497
|
return null;
|
|
240187
|
-
return
|
|
240498
|
+
return fs66.readFileSync(full, "utf-8");
|
|
240188
240499
|
}
|
|
240189
240500
|
function readGuardEvidenceAt(repoRoot, evidenceDir, file = "transcript.txt") {
|
|
240190
240501
|
if (!SAFE_SEGMENT.test(file))
|
|
240191
240502
|
return null;
|
|
240192
|
-
const evidenceRoot =
|
|
240193
|
-
const dir =
|
|
240194
|
-
if (dir !== evidenceRoot && !dir.startsWith(evidenceRoot +
|
|
240503
|
+
const evidenceRoot = path71.resolve(guardDir(repoRoot), "evidence");
|
|
240504
|
+
const dir = path71.resolve(repoRoot, evidenceDir);
|
|
240505
|
+
if (dir !== evidenceRoot && !dir.startsWith(evidenceRoot + path71.sep))
|
|
240195
240506
|
return null;
|
|
240196
|
-
const full =
|
|
240197
|
-
if (!full.startsWith(dir +
|
|
240507
|
+
const full = path71.resolve(dir, file);
|
|
240508
|
+
if (!full.startsWith(dir + path71.sep))
|
|
240198
240509
|
return null;
|
|
240199
|
-
if (!
|
|
240510
|
+
if (!fs66.existsSync(full) || !fs66.statSync(full).isFile())
|
|
240200
240511
|
return null;
|
|
240201
|
-
return
|
|
240512
|
+
return fs66.readFileSync(full, "utf-8");
|
|
240202
240513
|
}
|
|
240203
240514
|
function computeGuardStaleness(repoRoot) {
|
|
240204
240515
|
const corpusMtime = mtimeIfExists2(corpusFilePath(repoRoot));
|
|
@@ -240224,11 +240535,11 @@ function newestScenarioMtime(repoRoot) {
|
|
|
240224
240535
|
return newest;
|
|
240225
240536
|
}
|
|
240226
240537
|
function collectYamlFiles(dir) {
|
|
240227
|
-
if (!
|
|
240538
|
+
if (!fs66.existsSync(dir))
|
|
240228
240539
|
return [];
|
|
240229
240540
|
const out = [];
|
|
240230
|
-
for (const entry of
|
|
240231
|
-
const full =
|
|
240541
|
+
for (const entry of fs66.readdirSync(dir, { withFileTypes: true })) {
|
|
240542
|
+
const full = path71.join(dir, entry.name);
|
|
240232
240543
|
if (entry.isDirectory())
|
|
240233
240544
|
out.push(...collectYamlFiles(full));
|
|
240234
240545
|
else if (entry.isFile() && /\.ya?ml$/i.test(entry.name))
|
|
@@ -240238,16 +240549,16 @@ function collectYamlFiles(dir) {
|
|
|
240238
240549
|
}
|
|
240239
240550
|
function mtimeIfExists2(file) {
|
|
240240
240551
|
try {
|
|
240241
|
-
return
|
|
240552
|
+
return fs66.statSync(file).mtimeMs;
|
|
240242
240553
|
} catch {
|
|
240243
240554
|
return null;
|
|
240244
240555
|
}
|
|
240245
240556
|
}
|
|
240246
240557
|
function readJson(file, map2) {
|
|
240247
|
-
if (!
|
|
240558
|
+
if (!fs66.existsSync(file))
|
|
240248
240559
|
return null;
|
|
240249
240560
|
try {
|
|
240250
|
-
return map2(JSON.parse(
|
|
240561
|
+
return map2(JSON.parse(fs66.readFileSync(file, "utf-8")));
|
|
240251
240562
|
} catch {
|
|
240252
240563
|
return null;
|
|
240253
240564
|
}
|
|
@@ -240320,7 +240631,7 @@ router13.get("/:id/guard/coverage", async (req, res, next) => {
|
|
|
240320
240631
|
res.status(400).json({ error: "Missing ?doc=<doc path>." });
|
|
240321
240632
|
return;
|
|
240322
240633
|
}
|
|
240323
|
-
if (
|
|
240634
|
+
if (path72.isAbsolute(doc) || doc.split(/[\\/]/).includes("..")) {
|
|
240324
240635
|
res.status(400).json({ error: "doc escapes the repository." });
|
|
240325
240636
|
return;
|
|
240326
240637
|
}
|
|
@@ -240959,7 +241270,7 @@ var enterpriseAuthGate = async (req, res, next) => {
|
|
|
240959
241270
|
};
|
|
240960
241271
|
|
|
240961
241272
|
// apps/dashboard/server/src/app.ts
|
|
240962
|
-
var __dirname3 =
|
|
241273
|
+
var __dirname3 = path73.dirname(fileURLToPath6(import.meta.url));
|
|
240963
241274
|
function createApp(opts = {}) {
|
|
240964
241275
|
const app = (0, import_express16.default)();
|
|
240965
241276
|
app.use((0, import_cors.default)({ origin: true, credentials: true }));
|
|
@@ -240996,11 +241307,11 @@ function createApp(opts = {}) {
|
|
|
240996
241307
|
app.use("/api/rules", rules_default);
|
|
240997
241308
|
app.use(errorHandler);
|
|
240998
241309
|
if (opts.serveStatic !== false) {
|
|
240999
|
-
const staticDir =
|
|
241000
|
-
if (
|
|
241310
|
+
const staticDir = path73.join(__dirname3, "public");
|
|
241311
|
+
if (fs67.existsSync(staticDir)) {
|
|
241001
241312
|
app.use(import_express16.default.static(staticDir));
|
|
241002
241313
|
app.get("*", (_req, res) => {
|
|
241003
|
-
res.sendFile(
|
|
241314
|
+
res.sendFile(path73.join(staticDir, "index.html"));
|
|
241004
241315
|
});
|
|
241005
241316
|
}
|
|
241006
241317
|
}
|
|
@@ -241036,7 +241347,7 @@ var port = parseInt(process.env.PORT || "3001", 10);
|
|
|
241036
241347
|
async function main() {
|
|
241037
241348
|
const logDir = process.env.TRUECOURSE_LOG_DIR ?? getLogDir();
|
|
241038
241349
|
configureLogger({
|
|
241039
|
-
filePath:
|
|
241350
|
+
filePath: path74.join(logDir, "dashboard.log"),
|
|
241040
241351
|
tee: process.env.TRUECOURSE_DEV === "1"
|
|
241041
241352
|
});
|
|
241042
241353
|
if (wipeLegacyPostgresData()) {
|