pullfrog 0.1.94 → 0.1.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cli.mjs +889 -1113
- package/dist/external.d.ts +1 -1
- package/dist/index.js +881 -1105
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal.js +59 -20
- package/dist/mcp/comment.d.ts +3 -0
- package/dist/models.d.ts +5 -5
- package/dist/toolState.d.ts +6 -4
- package/dist/utils/github.d.ts +1 -1
- package/dist/utils/patchWorkflowRunFields.d.ts +8 -1
- package/dist/utils/runContext.d.ts +8 -0
- package/dist/utils/runContextData.d.ts +2 -0
- package/dist/utils/runStatusCheck.d.ts +11 -0
- package/dist/utils/statusChecks.d.ts +2 -1
- package/dist/utils/subprocess.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1415,9 +1415,9 @@ var require_timers = __commonJS({
|
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
1417
|
var Timeout = class {
|
|
1418
|
-
constructor(callback,
|
|
1418
|
+
constructor(callback, delay3, opaque) {
|
|
1419
1419
|
this.callback = callback;
|
|
1420
|
-
this.delay =
|
|
1420
|
+
this.delay = delay3;
|
|
1421
1421
|
this.opaque = opaque;
|
|
1422
1422
|
this.state = -2;
|
|
1423
1423
|
this.refresh();
|
|
@@ -1436,8 +1436,8 @@ var require_timers = __commonJS({
|
|
|
1436
1436
|
}
|
|
1437
1437
|
};
|
|
1438
1438
|
module.exports = {
|
|
1439
|
-
setTimeout(callback,
|
|
1440
|
-
return
|
|
1439
|
+
setTimeout(callback, delay3, opaque) {
|
|
1440
|
+
return delay3 < 1e3 ? setTimeout(callback, delay3, opaque) : new Timeout(callback, delay3, opaque);
|
|
1441
1441
|
},
|
|
1442
1442
|
clearTimeout(timeout) {
|
|
1443
1443
|
if (timeout instanceof Timeout) {
|
|
@@ -3682,7 +3682,7 @@ var require_util2 = __commonJS({
|
|
|
3682
3682
|
"use strict";
|
|
3683
3683
|
var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants2();
|
|
3684
3684
|
var { getGlobalOrigin } = require_global();
|
|
3685
|
-
var { performance:
|
|
3685
|
+
var { performance: performance9 } = __require("perf_hooks");
|
|
3686
3686
|
var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();
|
|
3687
3687
|
var assert3 = __require("assert");
|
|
3688
3688
|
var { isUint8Array } = __require("util/types");
|
|
@@ -3845,7 +3845,7 @@ var require_util2 = __commonJS({
|
|
|
3845
3845
|
}
|
|
3846
3846
|
}
|
|
3847
3847
|
function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) {
|
|
3848
|
-
return
|
|
3848
|
+
return performance9.now();
|
|
3849
3849
|
}
|
|
3850
3850
|
function createOpaqueTimingInfo(timingInfo) {
|
|
3851
3851
|
return {
|
|
@@ -5717,7 +5717,7 @@ var require_request = __commonJS({
|
|
|
5717
5717
|
method,
|
|
5718
5718
|
body,
|
|
5719
5719
|
headers,
|
|
5720
|
-
query,
|
|
5720
|
+
query: query2,
|
|
5721
5721
|
idempotent,
|
|
5722
5722
|
blocking,
|
|
5723
5723
|
upgrade,
|
|
@@ -5794,7 +5794,7 @@ var require_request = __commonJS({
|
|
|
5794
5794
|
this.completed = false;
|
|
5795
5795
|
this.aborted = false;
|
|
5796
5796
|
this.upgrade = upgrade || null;
|
|
5797
|
-
this.path =
|
|
5797
|
+
this.path = query2 ? util2.buildURL(path4, query2) : path4;
|
|
5798
5798
|
this.origin = origin;
|
|
5799
5799
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
5800
5800
|
this.blocking = blocking == null ? false : blocking;
|
|
@@ -10508,13 +10508,13 @@ var require_mock_utils = __commonJS({
|
|
|
10508
10508
|
}
|
|
10509
10509
|
}
|
|
10510
10510
|
function buildKey(opts) {
|
|
10511
|
-
const { path: path4, method, body, headers, query } = opts;
|
|
10511
|
+
const { path: path4, method, body, headers, query: query2 } = opts;
|
|
10512
10512
|
return {
|
|
10513
10513
|
path: path4,
|
|
10514
10514
|
method,
|
|
10515
10515
|
body,
|
|
10516
10516
|
headers,
|
|
10517
|
-
query
|
|
10517
|
+
query: query2
|
|
10518
10518
|
};
|
|
10519
10519
|
}
|
|
10520
10520
|
function generateKeyValues(data) {
|
|
@@ -10541,7 +10541,7 @@ var require_mock_utils = __commonJS({
|
|
|
10541
10541
|
if (mockDispatch2.data.callback) {
|
|
10542
10542
|
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
|
10543
10543
|
}
|
|
10544
|
-
const { data: { statusCode, data, headers, trailers, error: error49 }, delay:
|
|
10544
|
+
const { data: { statusCode, data, headers, trailers, error: error49 }, delay: delay3, persist } = mockDispatch2;
|
|
10545
10545
|
const { timesInvoked, times } = mockDispatch2;
|
|
10546
10546
|
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
|
10547
10547
|
mockDispatch2.pending = timesInvoked < times;
|
|
@@ -10550,10 +10550,10 @@ var require_mock_utils = __commonJS({
|
|
|
10550
10550
|
handler2.onError(error49);
|
|
10551
10551
|
return true;
|
|
10552
10552
|
}
|
|
10553
|
-
if (typeof
|
|
10553
|
+
if (typeof delay3 === "number" && delay3 > 0) {
|
|
10554
10554
|
setTimeout(() => {
|
|
10555
10555
|
handleReply(this[kDispatches]);
|
|
10556
|
-
},
|
|
10556
|
+
}, delay3);
|
|
10557
10557
|
} else {
|
|
10558
10558
|
handleReply(this[kDispatches]);
|
|
10559
10559
|
}
|
|
@@ -26388,8 +26388,8 @@ var require_coerce = __commonJS({
|
|
|
26388
26388
|
const minor = match3[3] || "0";
|
|
26389
26389
|
const patch = match3[4] || "0";
|
|
26390
26390
|
const prerelease = options.includePrerelease && match3[5] ? `-${match3[5]}` : "";
|
|
26391
|
-
const
|
|
26392
|
-
return parse6(`${major}.${minor}.${patch}${prerelease}${
|
|
26391
|
+
const build4 = options.includePrerelease && match3[6] ? `+${match3[6]}` : "";
|
|
26392
|
+
return parse6(`${major}.${minor}.${patch}${prerelease}${build4}`, options);
|
|
26393
26393
|
};
|
|
26394
26394
|
module.exports = coerce;
|
|
26395
26395
|
}
|
|
@@ -40308,9 +40308,9 @@ var require_timers2 = __commonJS({
|
|
|
40308
40308
|
* before the specified function or code is executed.
|
|
40309
40309
|
* @param {*} arg
|
|
40310
40310
|
*/
|
|
40311
|
-
constructor(callback,
|
|
40311
|
+
constructor(callback, delay3, arg) {
|
|
40312
40312
|
this._onTimeout = callback;
|
|
40313
|
-
this._idleTimeout =
|
|
40313
|
+
this._idleTimeout = delay3;
|
|
40314
40314
|
this._timerArg = arg;
|
|
40315
40315
|
this.refresh();
|
|
40316
40316
|
}
|
|
@@ -40355,8 +40355,8 @@ var require_timers2 = __commonJS({
|
|
|
40355
40355
|
* when the timer expires.
|
|
40356
40356
|
* @returns {NodeJS.Timeout|FastTimer}
|
|
40357
40357
|
*/
|
|
40358
|
-
setTimeout(callback,
|
|
40359
|
-
return
|
|
40358
|
+
setTimeout(callback, delay3, arg) {
|
|
40359
|
+
return delay3 <= RESOLUTION_MS ? setTimeout(callback, delay3, arg) : new FastTimer(callback, delay3, arg);
|
|
40360
40360
|
},
|
|
40361
40361
|
/**
|
|
40362
40362
|
* The clearTimeout method cancels an instantiated Timer previously created
|
|
@@ -40382,8 +40382,8 @@ var require_timers2 = __commonJS({
|
|
|
40382
40382
|
* when the timer expires.
|
|
40383
40383
|
* @returns {FastTimer}
|
|
40384
40384
|
*/
|
|
40385
|
-
setFastTimeout(callback,
|
|
40386
|
-
return new FastTimer(callback,
|
|
40385
|
+
setFastTimeout(callback, delay3, arg) {
|
|
40386
|
+
return new FastTimer(callback, delay3, arg);
|
|
40387
40387
|
},
|
|
40388
40388
|
/**
|
|
40389
40389
|
* The clearTimeout method cancels an instantiated FastTimer previously
|
|
@@ -40409,8 +40409,8 @@ var require_timers2 = __commonJS({
|
|
|
40409
40409
|
* @deprecated
|
|
40410
40410
|
* @param {number} [delay=0] The delay in milliseconds to add to the now value.
|
|
40411
40411
|
*/
|
|
40412
|
-
tick(
|
|
40413
|
-
fastNow +=
|
|
40412
|
+
tick(delay3 = 0) {
|
|
40413
|
+
fastNow += delay3 - RESOLUTION_MS + 1;
|
|
40414
40414
|
onTick();
|
|
40415
40415
|
onTick();
|
|
40416
40416
|
},
|
|
@@ -42234,7 +42234,7 @@ var require_request3 = __commonJS({
|
|
|
42234
42234
|
method,
|
|
42235
42235
|
body,
|
|
42236
42236
|
headers,
|
|
42237
|
-
query,
|
|
42237
|
+
query: query2,
|
|
42238
42238
|
idempotent,
|
|
42239
42239
|
blocking,
|
|
42240
42240
|
upgrade,
|
|
@@ -42326,7 +42326,7 @@ var require_request3 = __commonJS({
|
|
|
42326
42326
|
this.completed = false;
|
|
42327
42327
|
this.aborted = false;
|
|
42328
42328
|
this.upgrade = upgrade || null;
|
|
42329
|
-
this.path =
|
|
42329
|
+
this.path = query2 ? serializePathWithQuery(path4, query2) : path4;
|
|
42330
42330
|
this.origin = origin;
|
|
42331
42331
|
this.protocol = getProtocolFromUrlString(origin);
|
|
42332
42332
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -45129,7 +45129,7 @@ var require_util9 = __commonJS({
|
|
|
45129
45129
|
var { redirectStatusSet, referrerPolicyTokens, badPortsSet } = require_constants9();
|
|
45130
45130
|
var { getGlobalOrigin } = require_global3();
|
|
45131
45131
|
var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
|
|
45132
|
-
var { performance:
|
|
45132
|
+
var { performance: performance9 } = __require("node:perf_hooks");
|
|
45133
45133
|
var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util8();
|
|
45134
45134
|
var assert3 = __require("node:assert");
|
|
45135
45135
|
var { isUint8Array } = __require("node:util/types");
|
|
@@ -45284,7 +45284,7 @@ var require_util9 = __commonJS({
|
|
|
45284
45284
|
};
|
|
45285
45285
|
}
|
|
45286
45286
|
function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) {
|
|
45287
|
-
return coarsenTime(
|
|
45287
|
+
return coarsenTime(performance9.now(), crossOriginIsolatedCapability);
|
|
45288
45288
|
}
|
|
45289
45289
|
function createOpaqueTimingInfo(timingInfo) {
|
|
45290
45290
|
return {
|
|
@@ -46893,21 +46893,21 @@ var require_client_h1 = __commonJS({
|
|
|
46893
46893
|
this.connection = "";
|
|
46894
46894
|
this.maxResponseSize = client2[kMaxResponseSize];
|
|
46895
46895
|
}
|
|
46896
|
-
setTimeout(
|
|
46897
|
-
if (
|
|
46896
|
+
setTimeout(delay3, type2) {
|
|
46897
|
+
if (delay3 !== this.timeoutValue || type2 & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) {
|
|
46898
46898
|
if (this.timeout) {
|
|
46899
46899
|
timers.clearTimeout(this.timeout);
|
|
46900
46900
|
this.timeout = null;
|
|
46901
46901
|
}
|
|
46902
|
-
if (
|
|
46902
|
+
if (delay3) {
|
|
46903
46903
|
if (type2 & USE_FAST_TIMER) {
|
|
46904
|
-
this.timeout = timers.setFastTimeout(onParserTimeout,
|
|
46904
|
+
this.timeout = timers.setFastTimeout(onParserTimeout, delay3, this.timeoutWeakRef);
|
|
46905
46905
|
} else {
|
|
46906
|
-
this.timeout = setTimeout(onParserTimeout,
|
|
46906
|
+
this.timeout = setTimeout(onParserTimeout, delay3, this.timeoutWeakRef);
|
|
46907
46907
|
this.timeout?.unref();
|
|
46908
46908
|
}
|
|
46909
46909
|
}
|
|
46910
|
-
this.timeoutValue =
|
|
46910
|
+
this.timeoutValue = delay3;
|
|
46911
46911
|
} else if (this.timeout) {
|
|
46912
46912
|
if (this.timeout.refresh) {
|
|
46913
46913
|
this.timeout.refresh();
|
|
@@ -52901,11 +52901,11 @@ var require_mock_utils2 = __commonJS({
|
|
|
52901
52901
|
}
|
|
52902
52902
|
return true;
|
|
52903
52903
|
}
|
|
52904
|
-
function normalizeSearchParams(
|
|
52905
|
-
if (typeof
|
|
52906
|
-
return
|
|
52904
|
+
function normalizeSearchParams(query2) {
|
|
52905
|
+
if (typeof query2 !== "string") {
|
|
52906
|
+
return query2;
|
|
52907
52907
|
}
|
|
52908
|
-
const originalQp = new URLSearchParams(
|
|
52908
|
+
const originalQp = new URLSearchParams(query2);
|
|
52909
52909
|
const normalizedQp = new URLSearchParams();
|
|
52910
52910
|
for (let [key, value2] of originalQp.entries()) {
|
|
52911
52911
|
key = key.replace("[]", "");
|
|
@@ -53013,13 +53013,13 @@ var require_mock_utils2 = __commonJS({
|
|
|
53013
53013
|
return path4;
|
|
53014
53014
|
}
|
|
53015
53015
|
function buildKey(opts) {
|
|
53016
|
-
const { path: path4, method, body, headers, query } = opts;
|
|
53016
|
+
const { path: path4, method, body, headers, query: query2 } = opts;
|
|
53017
53017
|
return {
|
|
53018
53018
|
path: path4,
|
|
53019
53019
|
method,
|
|
53020
53020
|
body,
|
|
53021
53021
|
headers,
|
|
53022
|
-
query
|
|
53022
|
+
query: query2
|
|
53023
53023
|
};
|
|
53024
53024
|
}
|
|
53025
53025
|
function generateKeyValues(data) {
|
|
@@ -53056,7 +53056,7 @@ var require_mock_utils2 = __commonJS({
|
|
|
53056
53056
|
if (mockDispatch2.data.callback) {
|
|
53057
53057
|
mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) };
|
|
53058
53058
|
}
|
|
53059
|
-
const { data: { statusCode, data, headers, trailers, error: error49 }, delay:
|
|
53059
|
+
const { data: { statusCode, data, headers, trailers, error: error49 }, delay: delay3, persist } = mockDispatch2;
|
|
53060
53060
|
const { timesInvoked, times } = mockDispatch2;
|
|
53061
53061
|
mockDispatch2.consumed = !persist && timesInvoked >= times;
|
|
53062
53062
|
mockDispatch2.pending = timesInvoked < times;
|
|
@@ -53079,11 +53079,11 @@ var require_mock_utils2 = __commonJS({
|
|
|
53079
53079
|
handler2.onError(err);
|
|
53080
53080
|
}
|
|
53081
53081
|
handler2.onConnect?.(abort, null);
|
|
53082
|
-
if (typeof
|
|
53082
|
+
if (typeof delay3 === "number" && delay3 > 0) {
|
|
53083
53083
|
timer = setTimeout(() => {
|
|
53084
53084
|
timer = null;
|
|
53085
53085
|
handleReply(this[kDispatches]);
|
|
53086
|
-
},
|
|
53086
|
+
}, delay3);
|
|
53087
53087
|
} else {
|
|
53088
53088
|
handleReply(this[kDispatches]);
|
|
53089
53089
|
}
|
|
@@ -53453,13 +53453,13 @@ var require_mock_call_history = __commonJS({
|
|
|
53453
53453
|
function makeFilterCalls(parameterName) {
|
|
53454
53454
|
return (parameterValue, logs) => {
|
|
53455
53455
|
if (typeof parameterValue === "string" || parameterValue == null) {
|
|
53456
|
-
return logs.filter((
|
|
53457
|
-
return
|
|
53456
|
+
return logs.filter((log2) => {
|
|
53457
|
+
return log2[parameterName] === parameterValue;
|
|
53458
53458
|
});
|
|
53459
53459
|
}
|
|
53460
53460
|
if (parameterValue instanceof RegExp) {
|
|
53461
|
-
return logs.filter((
|
|
53462
|
-
return parameterValue.test(
|
|
53461
|
+
return logs.filter((log2) => {
|
|
53462
|
+
return parameterValue.test(log2[parameterName]);
|
|
53463
53463
|
});
|
|
53464
53464
|
}
|
|
53465
53465
|
throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`);
|
|
@@ -53554,8 +53554,8 @@ var require_mock_call_history = __commonJS({
|
|
|
53554
53554
|
return this.logs.filter(criteria);
|
|
53555
53555
|
}
|
|
53556
53556
|
if (criteria instanceof RegExp) {
|
|
53557
|
-
return this.logs.filter((
|
|
53558
|
-
return criteria.test(
|
|
53557
|
+
return this.logs.filter((log2) => {
|
|
53558
|
+
return criteria.test(log2.toString());
|
|
53559
53559
|
});
|
|
53560
53560
|
}
|
|
53561
53561
|
if (typeof criteria === "object" && criteria !== null) {
|
|
@@ -53605,13 +53605,13 @@ var require_mock_call_history = __commonJS({
|
|
|
53605
53605
|
this.logs = [];
|
|
53606
53606
|
}
|
|
53607
53607
|
[kMockCallHistoryAddLog](requestInit) {
|
|
53608
|
-
const
|
|
53609
|
-
this.logs.push(
|
|
53610
|
-
return
|
|
53608
|
+
const log2 = new MockCallHistoryLog(requestInit);
|
|
53609
|
+
this.logs.push(log2);
|
|
53610
|
+
return log2;
|
|
53611
53611
|
}
|
|
53612
53612
|
*[Symbol.iterator]() {
|
|
53613
|
-
for (const
|
|
53614
|
-
yield
|
|
53613
|
+
for (const log2 of this.calls()) {
|
|
53614
|
+
yield log2;
|
|
53615
53615
|
}
|
|
53616
53616
|
}
|
|
53617
53617
|
};
|
|
@@ -56023,18 +56023,18 @@ var require_cache2 = __commonJS({
|
|
|
56023
56023
|
}
|
|
56024
56024
|
}
|
|
56025
56025
|
}
|
|
56026
|
-
function makeDeduplicationKey(
|
|
56026
|
+
function makeDeduplicationKey(cacheKey3, excludeHeaders) {
|
|
56027
56027
|
const headers = {};
|
|
56028
|
-
if (
|
|
56029
|
-
const sortedHeaders = Object.keys(
|
|
56028
|
+
if (cacheKey3.headers) {
|
|
56029
|
+
const sortedHeaders = Object.keys(cacheKey3.headers).sort();
|
|
56030
56030
|
for (const header of sortedHeaders) {
|
|
56031
56031
|
if (excludeHeaders?.has(header.toLowerCase())) {
|
|
56032
56032
|
continue;
|
|
56033
56033
|
}
|
|
56034
|
-
headers[header] =
|
|
56034
|
+
headers[header] = cacheKey3.headers[header];
|
|
56035
56035
|
}
|
|
56036
56036
|
}
|
|
56037
|
-
return JSON.stringify([
|
|
56037
|
+
return JSON.stringify([cacheKey3.origin, cacheKey3.method, cacheKey3.path, headers]);
|
|
56038
56038
|
}
|
|
56039
56039
|
module.exports = {
|
|
56040
56040
|
makeCacheKey,
|
|
@@ -56608,7 +56608,7 @@ var require_cache_handler = __commonJS({
|
|
|
56608
56608
|
}
|
|
56609
56609
|
}
|
|
56610
56610
|
}
|
|
56611
|
-
function getSameOriginPath(
|
|
56611
|
+
function getSameOriginPath(cacheKey3, location) {
|
|
56612
56612
|
if (typeof location !== "string") {
|
|
56613
56613
|
return void 0;
|
|
56614
56614
|
}
|
|
@@ -56616,8 +56616,8 @@ var require_cache_handler = __commonJS({
|
|
|
56616
56616
|
let requestUrl;
|
|
56617
56617
|
let locationUrl;
|
|
56618
56618
|
try {
|
|
56619
|
-
originUrl = new URL(
|
|
56620
|
-
requestUrl = new URL(
|
|
56619
|
+
originUrl = new URL(cacheKey3.origin);
|
|
56620
|
+
requestUrl = new URL(cacheKey3.path, originUrl);
|
|
56621
56621
|
locationUrl = new URL(location, requestUrl);
|
|
56622
56622
|
} catch {
|
|
56623
56623
|
return void 0;
|
|
@@ -56627,38 +56627,38 @@ var require_cache_handler = __commonJS({
|
|
|
56627
56627
|
}
|
|
56628
56628
|
return locationUrl.pathname + locationUrl.search;
|
|
56629
56629
|
}
|
|
56630
|
-
function deleteCachedUri(store,
|
|
56630
|
+
function deleteCachedUri(store, cacheKey3, path4) {
|
|
56631
56631
|
deleteCachedValue(store, {
|
|
56632
|
-
...
|
|
56632
|
+
...cacheKey3,
|
|
56633
56633
|
path: path4
|
|
56634
56634
|
});
|
|
56635
56635
|
for (let i = 0; i < util2.safeHTTPMethods.length; i++) {
|
|
56636
56636
|
const method = util2.safeHTTPMethods[i];
|
|
56637
|
-
if (method !==
|
|
56637
|
+
if (method !== cacheKey3.method) {
|
|
56638
56638
|
deleteCachedValue(store, {
|
|
56639
|
-
...
|
|
56639
|
+
...cacheKey3,
|
|
56640
56640
|
method,
|
|
56641
56641
|
path: path4
|
|
56642
56642
|
});
|
|
56643
56643
|
}
|
|
56644
56644
|
}
|
|
56645
56645
|
}
|
|
56646
|
-
function deleteLocationTargets(store,
|
|
56646
|
+
function deleteLocationTargets(store, cacheKey3, headerValue) {
|
|
56647
56647
|
if (headerValue === void 0) {
|
|
56648
56648
|
return;
|
|
56649
56649
|
}
|
|
56650
56650
|
const values = Array.isArray(headerValue) ? headerValue : [headerValue];
|
|
56651
56651
|
for (let i = 0; i < values.length; i++) {
|
|
56652
|
-
const path4 = getSameOriginPath(
|
|
56652
|
+
const path4 = getSameOriginPath(cacheKey3, values[i]);
|
|
56653
56653
|
if (path4 !== void 0) {
|
|
56654
|
-
deleteCachedUri(store,
|
|
56654
|
+
deleteCachedUri(store, cacheKey3, path4);
|
|
56655
56655
|
}
|
|
56656
56656
|
}
|
|
56657
56657
|
}
|
|
56658
|
-
function invalidateUnsafeRequest(store,
|
|
56659
|
-
deleteCachedUri(store,
|
|
56660
|
-
deleteLocationTargets(store,
|
|
56661
|
-
deleteLocationTargets(store,
|
|
56658
|
+
function invalidateUnsafeRequest(store, cacheKey3, resHeaders) {
|
|
56659
|
+
deleteCachedUri(store, cacheKey3, cacheKey3.path);
|
|
56660
|
+
deleteLocationTargets(store, cacheKey3, resHeaders.location);
|
|
56661
|
+
deleteLocationTargets(store, cacheKey3, resHeaders["content-location"]);
|
|
56662
56662
|
}
|
|
56663
56663
|
var CacheHandler = class {
|
|
56664
56664
|
/**
|
|
@@ -56690,11 +56690,11 @@ var require_cache_handler = __commonJS({
|
|
|
56690
56690
|
* @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey
|
|
56691
56691
|
* @param {import('../../types/dispatcher.d.ts').default.DispatchHandler} handler
|
|
56692
56692
|
*/
|
|
56693
|
-
constructor({ store, type: type2, cacheByDefault },
|
|
56693
|
+
constructor({ store, type: type2, cacheByDefault }, cacheKey3, handler2) {
|
|
56694
56694
|
this.#store = store;
|
|
56695
56695
|
this.#cacheType = type2;
|
|
56696
56696
|
this.#cacheByDefault = cacheByDefault;
|
|
56697
|
-
this.#cacheKey =
|
|
56697
|
+
this.#cacheKey = cacheKey3;
|
|
56698
56698
|
this.#handler = handler2;
|
|
56699
56699
|
}
|
|
56700
56700
|
onRequestStart(controller, context) {
|
|
@@ -56887,15 +56887,15 @@ var require_cache_handler = __commonJS({
|
|
|
56887
56887
|
this.#handler.onResponseError?.(controller, err);
|
|
56888
56888
|
}
|
|
56889
56889
|
};
|
|
56890
|
-
function deleteCachedValue(store,
|
|
56890
|
+
function deleteCachedValue(store, cacheKey3) {
|
|
56891
56891
|
try {
|
|
56892
|
-
store.delete(
|
|
56892
|
+
store.delete(cacheKey3)?.catch?.(noop4);
|
|
56893
56893
|
} catch {
|
|
56894
56894
|
}
|
|
56895
56895
|
}
|
|
56896
|
-
function deleteCachedValueIfNotModified(statusCode, store,
|
|
56896
|
+
function deleteCachedValueIfNotModified(statusCode, store, cacheKey3) {
|
|
56897
56897
|
if (statusCode === 304) {
|
|
56898
|
-
deleteCachedValue(store,
|
|
56898
|
+
deleteCachedValue(store, cacheKey3);
|
|
56899
56899
|
}
|
|
56900
56900
|
}
|
|
56901
56901
|
function revalidationResponseDisallowsCachedReuse(cacheType, resHeaders, cacheControlDirectives) {
|
|
@@ -57461,9 +57461,9 @@ var require_cache3 = __commonJS({
|
|
|
57461
57461
|
function revalidationResponseUpdatesCacheControl(headers) {
|
|
57462
57462
|
return headers["cache-control"] !== void 0;
|
|
57463
57463
|
}
|
|
57464
|
-
function deleteCachedValue(store,
|
|
57464
|
+
function deleteCachedValue(store, cacheKey3) {
|
|
57465
57465
|
try {
|
|
57466
|
-
store.delete(
|
|
57466
|
+
store.delete(cacheKey3)?.catch?.(nop);
|
|
57467
57467
|
} catch {
|
|
57468
57468
|
}
|
|
57469
57469
|
}
|
|
@@ -57515,7 +57515,7 @@ var require_cache3 = __commonJS({
|
|
|
57515
57515
|
const staleWhileRevalidateExpiry = result.staleAt + staleWhileRevalidate * 1e3;
|
|
57516
57516
|
return now <= staleWhileRevalidateExpiry;
|
|
57517
57517
|
}
|
|
57518
|
-
function handleUncachedResponse(dispatch, globalOpts,
|
|
57518
|
+
function handleUncachedResponse(dispatch, globalOpts, cacheKey3, handler2, opts, reqCacheControl) {
|
|
57519
57519
|
if (reqCacheControl?.["only-if-cached"]) {
|
|
57520
57520
|
let aborted3 = false;
|
|
57521
57521
|
try {
|
|
@@ -57543,7 +57543,7 @@ var require_cache3 = __commonJS({
|
|
|
57543
57543
|
}
|
|
57544
57544
|
return true;
|
|
57545
57545
|
}
|
|
57546
|
-
return dispatch(opts, new CacheHandler(globalOpts,
|
|
57546
|
+
return dispatch(opts, new CacheHandler(globalOpts, cacheKey3, handler2));
|
|
57547
57547
|
}
|
|
57548
57548
|
function sendCachedValue(handler2, opts, result, age, context, isStale2) {
|
|
57549
57549
|
const stream = util2.isStream(result.body) ? result.body : Readable2.from(result.body ?? []);
|
|
@@ -57599,20 +57599,20 @@ var require_cache3 = __commonJS({
|
|
|
57599
57599
|
});
|
|
57600
57600
|
}
|
|
57601
57601
|
}
|
|
57602
|
-
function handleResult2(dispatch, globalOpts,
|
|
57602
|
+
function handleResult2(dispatch, globalOpts, cacheKey3, handler2, opts, reqCacheControl, result) {
|
|
57603
57603
|
if (!result) {
|
|
57604
|
-
return handleUncachedResponse(dispatch, globalOpts,
|
|
57604
|
+
return handleUncachedResponse(dispatch, globalOpts, cacheKey3, handler2, opts, reqCacheControl);
|
|
57605
57605
|
}
|
|
57606
57606
|
if (globalOpts.type === "shared" && Object.hasOwn(result.headers, "set-cookie")) {
|
|
57607
57607
|
if (util2.isStream(result.body)) {
|
|
57608
57608
|
result.body.on("error", nop).destroy();
|
|
57609
57609
|
}
|
|
57610
|
-
deleteCachedValue(globalOpts.store,
|
|
57611
|
-
return handleUncachedResponse(dispatch, globalOpts,
|
|
57610
|
+
deleteCachedValue(globalOpts.store, cacheKey3);
|
|
57611
|
+
return handleUncachedResponse(dispatch, globalOpts, cacheKey3, handler2, opts, reqCacheControl);
|
|
57612
57612
|
}
|
|
57613
57613
|
const now = Date.now();
|
|
57614
57614
|
if (now > result.deleteAt) {
|
|
57615
|
-
return dispatch(opts, new CacheHandler(globalOpts,
|
|
57615
|
+
return dispatch(opts, new CacheHandler(globalOpts, cacheKey3, handler2));
|
|
57616
57616
|
}
|
|
57617
57617
|
const age = Math.round((now - result.cachedAt) / 1e3);
|
|
57618
57618
|
const requestMaxAgeExpired = reqCacheControl?.["max-age"] !== void 0 && age >= reqCacheControl["max-age"];
|
|
@@ -57620,7 +57620,7 @@ var require_cache3 = __commonJS({
|
|
|
57620
57620
|
const revalidate = requestMaxAgeExpired || needsRevalidation(result, reqCacheControl, opts);
|
|
57621
57621
|
if (stale || revalidate) {
|
|
57622
57622
|
if (util2.isStream(opts.body) && util2.bodyLength(opts.body) !== 0) {
|
|
57623
|
-
return dispatch(opts, new CacheHandler(globalOpts,
|
|
57623
|
+
return dispatch(opts, new CacheHandler(globalOpts, cacheKey3, handler2));
|
|
57624
57624
|
}
|
|
57625
57625
|
if (!revalidate && withinStaleWhileRevalidateWindow(result, globalOpts.type)) {
|
|
57626
57626
|
sendCachedValue(handler2, opts, result, age, null, true);
|
|
@@ -57631,7 +57631,7 @@ var require_cache3 = __commonJS({
|
|
|
57631
57631
|
...opts,
|
|
57632
57632
|
headers: headers2
|
|
57633
57633
|
},
|
|
57634
|
-
new CacheHandler(globalOpts,
|
|
57634
|
+
new CacheHandler(globalOpts, cacheKey3, {
|
|
57635
57635
|
// Silent handler that just updates the cache
|
|
57636
57636
|
onRequestStart() {
|
|
57637
57637
|
},
|
|
@@ -57671,11 +57671,11 @@ var require_cache3 = __commonJS({
|
|
|
57671
57671
|
if (util2.isStream(result.body)) {
|
|
57672
57672
|
result.body.on("error", nop).destroy();
|
|
57673
57673
|
}
|
|
57674
|
-
deleteCachedValue(globalOpts.store,
|
|
57675
|
-
return dispatch(opts, new CacheHandler(globalOpts,
|
|
57674
|
+
deleteCachedValue(globalOpts.store, cacheKey3);
|
|
57675
|
+
return dispatch(opts, new CacheHandler(globalOpts, cacheKey3, handler2));
|
|
57676
57676
|
}
|
|
57677
57677
|
if (revalidationResponseUpdatesCacheControl(headers2)) {
|
|
57678
|
-
deleteCachedValue(globalOpts.store,
|
|
57678
|
+
deleteCachedValue(globalOpts.store, cacheKey3);
|
|
57679
57679
|
}
|
|
57680
57680
|
}
|
|
57681
57681
|
sendCachedValue(handler2, opts, result, age, context, stale);
|
|
@@ -57683,7 +57683,7 @@ var require_cache3 = __commonJS({
|
|
|
57683
57683
|
result.body.on("error", nop).destroy();
|
|
57684
57684
|
}
|
|
57685
57685
|
},
|
|
57686
|
-
new CacheHandler(globalOpts,
|
|
57686
|
+
new CacheHandler(globalOpts, cacheKey3, handler2),
|
|
57687
57687
|
withinStaleIfErrorThreshold
|
|
57688
57688
|
)
|
|
57689
57689
|
);
|
|
@@ -57758,16 +57758,16 @@ var require_cache3 = __commonJS({
|
|
|
57758
57758
|
if (reqCacheControl?.["no-store"]) {
|
|
57759
57759
|
return dispatch(opts2, handler2);
|
|
57760
57760
|
}
|
|
57761
|
-
const
|
|
57761
|
+
const cacheKey3 = makeCacheKey(opts2);
|
|
57762
57762
|
if (!arrayIncludes(util2.safeHTTPMethods, opts2.method)) {
|
|
57763
|
-
return dispatch(opts2, new CacheHandler(globalOpts,
|
|
57763
|
+
return dispatch(opts2, new CacheHandler(globalOpts, cacheKey3, handler2));
|
|
57764
57764
|
}
|
|
57765
|
-
const result = store.get(
|
|
57765
|
+
const result = store.get(cacheKey3);
|
|
57766
57766
|
if (result && typeof result.then === "function") {
|
|
57767
57767
|
return result.then((result2) => handleResult2(
|
|
57768
57768
|
dispatch,
|
|
57769
57769
|
globalOpts,
|
|
57770
|
-
|
|
57770
|
+
cacheKey3,
|
|
57771
57771
|
handler2,
|
|
57772
57772
|
opts2,
|
|
57773
57773
|
reqCacheControl,
|
|
@@ -57777,7 +57777,7 @@ var require_cache3 = __commonJS({
|
|
|
57777
57777
|
return handleResult2(
|
|
57778
57778
|
dispatch,
|
|
57779
57779
|
globalOpts,
|
|
57780
|
-
|
|
57780
|
+
cacheKey3,
|
|
57781
57781
|
handler2,
|
|
57782
57782
|
opts2,
|
|
57783
57783
|
reqCacheControl,
|
|
@@ -58670,8 +58670,8 @@ var require_deduplicate = __commonJS({
|
|
|
58670
58670
|
}
|
|
58671
58671
|
}
|
|
58672
58672
|
}
|
|
58673
|
-
const
|
|
58674
|
-
const dedupeKey = makeDeduplicationKey(
|
|
58673
|
+
const cacheKey3 = makeCacheKey(opts2);
|
|
58674
|
+
const dedupeKey = makeDeduplicationKey(cacheKey3, excludeHeaderNamesSet);
|
|
58675
58675
|
const pendingHandler = pendingRequests.get(dedupeKey);
|
|
58676
58676
|
if (pendingHandler) {
|
|
58677
58677
|
if (pendingHandler.addWaitingHandler(handler2)) {
|
|
@@ -75565,7 +75565,7 @@ var require_fast_uri = __commonJS({
|
|
|
75565
75565
|
normalizeString(uri, options);
|
|
75566
75566
|
} else if (typeof uri === "object") {
|
|
75567
75567
|
uri = /** @type {T} */
|
|
75568
|
-
parse6(
|
|
75568
|
+
parse6(serialize2(uri, options), options);
|
|
75569
75569
|
}
|
|
75570
75570
|
return uri;
|
|
75571
75571
|
}
|
|
@@ -75600,13 +75600,13 @@ var require_fast_uri = __commonJS({
|
|
|
75600
75600
|
throw new Error(resolved.error);
|
|
75601
75601
|
}
|
|
75602
75602
|
schemelessOptions.skipEscape = true;
|
|
75603
|
-
return
|
|
75603
|
+
return serialize2(resolved, schemelessOptions);
|
|
75604
75604
|
}
|
|
75605
75605
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
75606
75606
|
const target = {};
|
|
75607
75607
|
if (!skipNormalization) {
|
|
75608
|
-
base = parse6(
|
|
75609
|
-
relative = parse6(
|
|
75608
|
+
base = parse6(serialize2(base, options), options);
|
|
75609
|
+
relative = parse6(serialize2(relative, options), options);
|
|
75610
75610
|
}
|
|
75611
75611
|
options = options || {};
|
|
75612
75612
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -75660,7 +75660,7 @@ var require_fast_uri = __commonJS({
|
|
|
75660
75660
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
75661
75661
|
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
|
|
75662
75662
|
}
|
|
75663
|
-
function
|
|
75663
|
+
function serialize2(cmpts, opts) {
|
|
75664
75664
|
const component = {
|
|
75665
75665
|
host: cmpts.host,
|
|
75666
75666
|
scheme: cmpts.scheme,
|
|
@@ -75914,7 +75914,7 @@ var require_fast_uri = __commonJS({
|
|
|
75914
75914
|
function normalizeStringWithStatus(uri, opts) {
|
|
75915
75915
|
const { parsed: parsed2, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
75916
75916
|
return {
|
|
75917
|
-
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri :
|
|
75917
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize2(parsed2, opts),
|
|
75918
75918
|
malformedAuthorityOrPort,
|
|
75919
75919
|
malformedPercentEncoding,
|
|
75920
75920
|
malformedSchemeSpecific,
|
|
@@ -75928,7 +75928,7 @@ var require_fast_uri = __commonJS({
|
|
|
75928
75928
|
}
|
|
75929
75929
|
let value2;
|
|
75930
75930
|
try {
|
|
75931
|
-
value2 = typeof uri === "string" ? uri :
|
|
75931
|
+
value2 = typeof uri === "string" ? uri : serialize2(uri, opts);
|
|
75932
75932
|
} catch {
|
|
75933
75933
|
return void 0;
|
|
75934
75934
|
}
|
|
@@ -75941,7 +75941,7 @@ var require_fast_uri = __commonJS({
|
|
|
75941
75941
|
resolve: resolve3,
|
|
75942
75942
|
resolveComponent,
|
|
75943
75943
|
equal,
|
|
75944
|
-
serialize,
|
|
75944
|
+
serialize: serialize2,
|
|
75945
75945
|
parse: parse6
|
|
75946
75946
|
};
|
|
75947
75947
|
module.exports = fastUri;
|
|
@@ -76276,8 +76276,8 @@ var require_core2 = __commonJS({
|
|
|
76276
76276
|
return this;
|
|
76277
76277
|
}
|
|
76278
76278
|
case "object": {
|
|
76279
|
-
const
|
|
76280
|
-
this._cache.delete(
|
|
76279
|
+
const cacheKey3 = schemaKeyRef;
|
|
76280
|
+
this._cache.delete(cacheKey3);
|
|
76281
76281
|
let id = schemaKeyRef[this.opts.schemaId];
|
|
76282
76282
|
if (id) {
|
|
76283
76283
|
id = (0, resolve_1.normalizeId)(id);
|
|
@@ -76442,11 +76442,11 @@ var require_core2 = __commonJS({
|
|
|
76442
76442
|
Ajv5.ValidationError = validation_error_1.default;
|
|
76443
76443
|
Ajv5.MissingRefError = ref_error_1.default;
|
|
76444
76444
|
exports.default = Ajv5;
|
|
76445
|
-
function checkOptions(checkOpts, options, msg,
|
|
76445
|
+
function checkOptions(checkOpts, options, msg, log2 = "error") {
|
|
76446
76446
|
for (const key in checkOpts) {
|
|
76447
76447
|
const opt = key;
|
|
76448
76448
|
if (opt in options)
|
|
76449
|
-
this.logger[
|
|
76449
|
+
this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
76450
76450
|
}
|
|
76451
76451
|
}
|
|
76452
76452
|
function getSchEnv(keyRef) {
|
|
@@ -79498,384 +79498,6 @@ var init_index_DoHiaFQM = __esm({
|
|
|
79498
79498
|
}
|
|
79499
79499
|
});
|
|
79500
79500
|
|
|
79501
|
-
// node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js
|
|
79502
|
-
var require_object_hash = __commonJS({
|
|
79503
|
-
"node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js"(exports, module) {
|
|
79504
|
-
"use strict";
|
|
79505
|
-
var crypto5 = __require("crypto");
|
|
79506
|
-
exports = module.exports = objectHash;
|
|
79507
|
-
function objectHash(object5, options) {
|
|
79508
|
-
options = applyDefaults(object5, options);
|
|
79509
|
-
return hash3(object5, options);
|
|
79510
|
-
}
|
|
79511
|
-
exports.sha1 = function(object5) {
|
|
79512
|
-
return objectHash(object5);
|
|
79513
|
-
};
|
|
79514
|
-
exports.keys = function(object5) {
|
|
79515
|
-
return objectHash(object5, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
|
|
79516
|
-
};
|
|
79517
|
-
exports.MD5 = function(object5) {
|
|
79518
|
-
return objectHash(object5, { algorithm: "md5", encoding: "hex" });
|
|
79519
|
-
};
|
|
79520
|
-
exports.keysMD5 = function(object5) {
|
|
79521
|
-
return objectHash(object5, { algorithm: "md5", encoding: "hex", excludeValues: true });
|
|
79522
|
-
};
|
|
79523
|
-
var hashes = crypto5.getHashes ? crypto5.getHashes().slice() : ["sha1", "md5"];
|
|
79524
|
-
hashes.push("passthrough");
|
|
79525
|
-
var encodings = ["buffer", "hex", "binary", "base64"];
|
|
79526
|
-
function applyDefaults(object5, sourceOptions) {
|
|
79527
|
-
sourceOptions = sourceOptions || {};
|
|
79528
|
-
var options = {};
|
|
79529
|
-
options.algorithm = sourceOptions.algorithm || "sha1";
|
|
79530
|
-
options.encoding = sourceOptions.encoding || "hex";
|
|
79531
|
-
options.excludeValues = sourceOptions.excludeValues ? true : false;
|
|
79532
|
-
options.algorithm = options.algorithm.toLowerCase();
|
|
79533
|
-
options.encoding = options.encoding.toLowerCase();
|
|
79534
|
-
options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true;
|
|
79535
|
-
options.respectType = sourceOptions.respectType === false ? false : true;
|
|
79536
|
-
options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
|
|
79537
|
-
options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
|
|
79538
|
-
options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true;
|
|
79539
|
-
options.unorderedSets = sourceOptions.unorderedSets === false ? false : true;
|
|
79540
|
-
options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true;
|
|
79541
|
-
options.replacer = sourceOptions.replacer || void 0;
|
|
79542
|
-
options.excludeKeys = sourceOptions.excludeKeys || void 0;
|
|
79543
|
-
if (typeof object5 === "undefined") {
|
|
79544
|
-
throw new Error("Object argument required.");
|
|
79545
|
-
}
|
|
79546
|
-
for (var i = 0; i < hashes.length; ++i) {
|
|
79547
|
-
if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {
|
|
79548
|
-
options.algorithm = hashes[i];
|
|
79549
|
-
}
|
|
79550
|
-
}
|
|
79551
|
-
if (hashes.indexOf(options.algorithm) === -1) {
|
|
79552
|
-
throw new Error('Algorithm "' + options.algorithm + '" not supported. supported values: ' + hashes.join(", "));
|
|
79553
|
-
}
|
|
79554
|
-
if (encodings.indexOf(options.encoding) === -1 && options.algorithm !== "passthrough") {
|
|
79555
|
-
throw new Error('Encoding "' + options.encoding + '" not supported. supported values: ' + encodings.join(", "));
|
|
79556
|
-
}
|
|
79557
|
-
return options;
|
|
79558
|
-
}
|
|
79559
|
-
function isNativeFunction(f) {
|
|
79560
|
-
if (typeof f !== "function") {
|
|
79561
|
-
return false;
|
|
79562
|
-
}
|
|
79563
|
-
var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
|
|
79564
|
-
return exp.exec(Function.prototype.toString.call(f)) != null;
|
|
79565
|
-
}
|
|
79566
|
-
function hash3(object5, options) {
|
|
79567
|
-
var hashingStream;
|
|
79568
|
-
if (options.algorithm !== "passthrough") {
|
|
79569
|
-
hashingStream = crypto5.createHash(options.algorithm);
|
|
79570
|
-
} else {
|
|
79571
|
-
hashingStream = new PassThrough();
|
|
79572
|
-
}
|
|
79573
|
-
if (typeof hashingStream.write === "undefined") {
|
|
79574
|
-
hashingStream.write = hashingStream.update;
|
|
79575
|
-
hashingStream.end = hashingStream.update;
|
|
79576
|
-
}
|
|
79577
|
-
var hasher = typeHasher(options, hashingStream);
|
|
79578
|
-
hasher.dispatch(object5);
|
|
79579
|
-
if (!hashingStream.update) {
|
|
79580
|
-
hashingStream.end("");
|
|
79581
|
-
}
|
|
79582
|
-
if (hashingStream.digest) {
|
|
79583
|
-
return hashingStream.digest(options.encoding === "buffer" ? void 0 : options.encoding);
|
|
79584
|
-
}
|
|
79585
|
-
var buf = hashingStream.read();
|
|
79586
|
-
if (options.encoding === "buffer") {
|
|
79587
|
-
return buf;
|
|
79588
|
-
}
|
|
79589
|
-
return buf.toString(options.encoding);
|
|
79590
|
-
}
|
|
79591
|
-
exports.writeToStream = function(object5, options, stream) {
|
|
79592
|
-
if (typeof stream === "undefined") {
|
|
79593
|
-
stream = options;
|
|
79594
|
-
options = {};
|
|
79595
|
-
}
|
|
79596
|
-
options = applyDefaults(object5, options);
|
|
79597
|
-
return typeHasher(options, stream).dispatch(object5);
|
|
79598
|
-
};
|
|
79599
|
-
function typeHasher(options, writeTo, context) {
|
|
79600
|
-
context = context || [];
|
|
79601
|
-
var write2 = function(str) {
|
|
79602
|
-
if (writeTo.update) {
|
|
79603
|
-
return writeTo.update(str, "utf8");
|
|
79604
|
-
} else {
|
|
79605
|
-
return writeTo.write(str, "utf8");
|
|
79606
|
-
}
|
|
79607
|
-
};
|
|
79608
|
-
return {
|
|
79609
|
-
dispatch: function(value2) {
|
|
79610
|
-
if (options.replacer) {
|
|
79611
|
-
value2 = options.replacer(value2);
|
|
79612
|
-
}
|
|
79613
|
-
var type2 = typeof value2;
|
|
79614
|
-
if (value2 === null) {
|
|
79615
|
-
type2 = "null";
|
|
79616
|
-
}
|
|
79617
|
-
return this["_" + type2](value2);
|
|
79618
|
-
},
|
|
79619
|
-
_object: function(object5) {
|
|
79620
|
-
var pattern = /\[object (.*)\]/i;
|
|
79621
|
-
var objString = Object.prototype.toString.call(object5);
|
|
79622
|
-
var objType = pattern.exec(objString);
|
|
79623
|
-
if (!objType) {
|
|
79624
|
-
objType = "unknown:[" + objString + "]";
|
|
79625
|
-
} else {
|
|
79626
|
-
objType = objType[1];
|
|
79627
|
-
}
|
|
79628
|
-
objType = objType.toLowerCase();
|
|
79629
|
-
var objectNumber = null;
|
|
79630
|
-
if ((objectNumber = context.indexOf(object5)) >= 0) {
|
|
79631
|
-
return this.dispatch("[CIRCULAR:" + objectNumber + "]");
|
|
79632
|
-
} else {
|
|
79633
|
-
context.push(object5);
|
|
79634
|
-
}
|
|
79635
|
-
if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object5)) {
|
|
79636
|
-
write2("buffer:");
|
|
79637
|
-
return write2(object5);
|
|
79638
|
-
}
|
|
79639
|
-
if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
|
|
79640
|
-
if (this["_" + objType]) {
|
|
79641
|
-
this["_" + objType](object5);
|
|
79642
|
-
} else if (options.ignoreUnknown) {
|
|
79643
|
-
return write2("[" + objType + "]");
|
|
79644
|
-
} else {
|
|
79645
|
-
throw new Error('Unknown object type "' + objType + '"');
|
|
79646
|
-
}
|
|
79647
|
-
} else {
|
|
79648
|
-
var keys = Object.keys(object5);
|
|
79649
|
-
if (options.unorderedObjects) {
|
|
79650
|
-
keys = keys.sort();
|
|
79651
|
-
}
|
|
79652
|
-
if (options.respectType !== false && !isNativeFunction(object5)) {
|
|
79653
|
-
keys.splice(0, 0, "prototype", "__proto__", "constructor");
|
|
79654
|
-
}
|
|
79655
|
-
if (options.excludeKeys) {
|
|
79656
|
-
keys = keys.filter(function(key) {
|
|
79657
|
-
return !options.excludeKeys(key);
|
|
79658
|
-
});
|
|
79659
|
-
}
|
|
79660
|
-
write2("object:" + keys.length + ":");
|
|
79661
|
-
var self2 = this;
|
|
79662
|
-
return keys.forEach(function(key) {
|
|
79663
|
-
self2.dispatch(key);
|
|
79664
|
-
write2(":");
|
|
79665
|
-
if (!options.excludeValues) {
|
|
79666
|
-
self2.dispatch(object5[key]);
|
|
79667
|
-
}
|
|
79668
|
-
write2(",");
|
|
79669
|
-
});
|
|
79670
|
-
}
|
|
79671
|
-
},
|
|
79672
|
-
_array: function(arr, unordered) {
|
|
79673
|
-
unordered = typeof unordered !== "undefined" ? unordered : options.unorderedArrays !== false;
|
|
79674
|
-
var self2 = this;
|
|
79675
|
-
write2("array:" + arr.length + ":");
|
|
79676
|
-
if (!unordered || arr.length <= 1) {
|
|
79677
|
-
return arr.forEach(function(entry) {
|
|
79678
|
-
return self2.dispatch(entry);
|
|
79679
|
-
});
|
|
79680
|
-
}
|
|
79681
|
-
var contextAdditions = [];
|
|
79682
|
-
var entries = arr.map(function(entry) {
|
|
79683
|
-
var strm = new PassThrough();
|
|
79684
|
-
var localContext = context.slice();
|
|
79685
|
-
var hasher = typeHasher(options, strm, localContext);
|
|
79686
|
-
hasher.dispatch(entry);
|
|
79687
|
-
contextAdditions = contextAdditions.concat(localContext.slice(context.length));
|
|
79688
|
-
return strm.read().toString();
|
|
79689
|
-
});
|
|
79690
|
-
context = context.concat(contextAdditions);
|
|
79691
|
-
entries.sort();
|
|
79692
|
-
return this._array(entries, false);
|
|
79693
|
-
},
|
|
79694
|
-
_date: function(date6) {
|
|
79695
|
-
return write2("date:" + date6.toJSON());
|
|
79696
|
-
},
|
|
79697
|
-
_symbol: function(sym) {
|
|
79698
|
-
return write2("symbol:" + sym.toString());
|
|
79699
|
-
},
|
|
79700
|
-
_error: function(err) {
|
|
79701
|
-
return write2("error:" + err.toString());
|
|
79702
|
-
},
|
|
79703
|
-
_boolean: function(bool) {
|
|
79704
|
-
return write2("bool:" + bool.toString());
|
|
79705
|
-
},
|
|
79706
|
-
_string: function(string6) {
|
|
79707
|
-
write2("string:" + string6.length + ":");
|
|
79708
|
-
write2(string6.toString());
|
|
79709
|
-
},
|
|
79710
|
-
_function: function(fn2) {
|
|
79711
|
-
write2("fn:");
|
|
79712
|
-
if (isNativeFunction(fn2)) {
|
|
79713
|
-
this.dispatch("[native]");
|
|
79714
|
-
} else {
|
|
79715
|
-
this.dispatch(fn2.toString());
|
|
79716
|
-
}
|
|
79717
|
-
if (options.respectFunctionNames !== false) {
|
|
79718
|
-
this.dispatch("function-name:" + String(fn2.name));
|
|
79719
|
-
}
|
|
79720
|
-
if (options.respectFunctionProperties) {
|
|
79721
|
-
this._object(fn2);
|
|
79722
|
-
}
|
|
79723
|
-
},
|
|
79724
|
-
_number: function(number6) {
|
|
79725
|
-
return write2("number:" + number6.toString());
|
|
79726
|
-
},
|
|
79727
|
-
_xml: function(xml) {
|
|
79728
|
-
return write2("xml:" + xml.toString());
|
|
79729
|
-
},
|
|
79730
|
-
_null: function() {
|
|
79731
|
-
return write2("Null");
|
|
79732
|
-
},
|
|
79733
|
-
_undefined: function() {
|
|
79734
|
-
return write2("Undefined");
|
|
79735
|
-
},
|
|
79736
|
-
_regexp: function(regex4) {
|
|
79737
|
-
return write2("regex:" + regex4.toString());
|
|
79738
|
-
},
|
|
79739
|
-
_uint8array: function(arr) {
|
|
79740
|
-
write2("uint8array:");
|
|
79741
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79742
|
-
},
|
|
79743
|
-
_uint8clampedarray: function(arr) {
|
|
79744
|
-
write2("uint8clampedarray:");
|
|
79745
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79746
|
-
},
|
|
79747
|
-
_int8array: function(arr) {
|
|
79748
|
-
write2("int8array:");
|
|
79749
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79750
|
-
},
|
|
79751
|
-
_uint16array: function(arr) {
|
|
79752
|
-
write2("uint16array:");
|
|
79753
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79754
|
-
},
|
|
79755
|
-
_int16array: function(arr) {
|
|
79756
|
-
write2("int16array:");
|
|
79757
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79758
|
-
},
|
|
79759
|
-
_uint32array: function(arr) {
|
|
79760
|
-
write2("uint32array:");
|
|
79761
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79762
|
-
},
|
|
79763
|
-
_int32array: function(arr) {
|
|
79764
|
-
write2("int32array:");
|
|
79765
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79766
|
-
},
|
|
79767
|
-
_float32array: function(arr) {
|
|
79768
|
-
write2("float32array:");
|
|
79769
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79770
|
-
},
|
|
79771
|
-
_float64array: function(arr) {
|
|
79772
|
-
write2("float64array:");
|
|
79773
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
79774
|
-
},
|
|
79775
|
-
_arraybuffer: function(arr) {
|
|
79776
|
-
write2("arraybuffer:");
|
|
79777
|
-
return this.dispatch(new Uint8Array(arr));
|
|
79778
|
-
},
|
|
79779
|
-
_url: function(url4) {
|
|
79780
|
-
return write2("url:" + url4.toString(), "utf8");
|
|
79781
|
-
},
|
|
79782
|
-
_map: function(map2) {
|
|
79783
|
-
write2("map:");
|
|
79784
|
-
var arr = Array.from(map2);
|
|
79785
|
-
return this._array(arr, options.unorderedSets !== false);
|
|
79786
|
-
},
|
|
79787
|
-
_set: function(set2) {
|
|
79788
|
-
write2("set:");
|
|
79789
|
-
var arr = Array.from(set2);
|
|
79790
|
-
return this._array(arr, options.unorderedSets !== false);
|
|
79791
|
-
},
|
|
79792
|
-
_file: function(file2) {
|
|
79793
|
-
write2("file:");
|
|
79794
|
-
return this.dispatch([file2.name, file2.size, file2.type, file2.lastModfied]);
|
|
79795
|
-
},
|
|
79796
|
-
_blob: function() {
|
|
79797
|
-
if (options.ignoreUnknown) {
|
|
79798
|
-
return write2("[blob]");
|
|
79799
|
-
}
|
|
79800
|
-
throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
|
|
79801
|
-
},
|
|
79802
|
-
_domwindow: function() {
|
|
79803
|
-
return write2("domwindow");
|
|
79804
|
-
},
|
|
79805
|
-
_bigint: function(number6) {
|
|
79806
|
-
return write2("bigint:" + number6.toString());
|
|
79807
|
-
},
|
|
79808
|
-
/* Node.js standard native objects */
|
|
79809
|
-
_process: function() {
|
|
79810
|
-
return write2("process");
|
|
79811
|
-
},
|
|
79812
|
-
_timer: function() {
|
|
79813
|
-
return write2("timer");
|
|
79814
|
-
},
|
|
79815
|
-
_pipe: function() {
|
|
79816
|
-
return write2("pipe");
|
|
79817
|
-
},
|
|
79818
|
-
_tcp: function() {
|
|
79819
|
-
return write2("tcp");
|
|
79820
|
-
},
|
|
79821
|
-
_udp: function() {
|
|
79822
|
-
return write2("udp");
|
|
79823
|
-
},
|
|
79824
|
-
_tty: function() {
|
|
79825
|
-
return write2("tty");
|
|
79826
|
-
},
|
|
79827
|
-
_statwatcher: function() {
|
|
79828
|
-
return write2("statwatcher");
|
|
79829
|
-
},
|
|
79830
|
-
_securecontext: function() {
|
|
79831
|
-
return write2("securecontext");
|
|
79832
|
-
},
|
|
79833
|
-
_connection: function() {
|
|
79834
|
-
return write2("connection");
|
|
79835
|
-
},
|
|
79836
|
-
_zlib: function() {
|
|
79837
|
-
return write2("zlib");
|
|
79838
|
-
},
|
|
79839
|
-
_context: function() {
|
|
79840
|
-
return write2("context");
|
|
79841
|
-
},
|
|
79842
|
-
_nodescript: function() {
|
|
79843
|
-
return write2("nodescript");
|
|
79844
|
-
},
|
|
79845
|
-
_httpparser: function() {
|
|
79846
|
-
return write2("httpparser");
|
|
79847
|
-
},
|
|
79848
|
-
_dataview: function() {
|
|
79849
|
-
return write2("dataview");
|
|
79850
|
-
},
|
|
79851
|
-
_signal: function() {
|
|
79852
|
-
return write2("signal");
|
|
79853
|
-
},
|
|
79854
|
-
_fsevent: function() {
|
|
79855
|
-
return write2("fsevent");
|
|
79856
|
-
},
|
|
79857
|
-
_tlswrap: function() {
|
|
79858
|
-
return write2("tlswrap");
|
|
79859
|
-
}
|
|
79860
|
-
};
|
|
79861
|
-
}
|
|
79862
|
-
function PassThrough() {
|
|
79863
|
-
return {
|
|
79864
|
-
buf: "",
|
|
79865
|
-
write: function(b) {
|
|
79866
|
-
this.buf += b;
|
|
79867
|
-
},
|
|
79868
|
-
end: function(b) {
|
|
79869
|
-
this.buf += b;
|
|
79870
|
-
},
|
|
79871
|
-
read: function() {
|
|
79872
|
-
return this.buf;
|
|
79873
|
-
}
|
|
79874
|
-
};
|
|
79875
|
-
}
|
|
79876
|
-
}
|
|
79877
|
-
});
|
|
79878
|
-
|
|
79879
79501
|
// node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/light.js
|
|
79880
79502
|
var require_light = __commonJS({
|
|
79881
79503
|
"node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/light.js"(exports, module) {
|
|
@@ -100092,7 +99714,7 @@ var require_node = __commonJS({
|
|
|
100092
99714
|
var tty = __require("tty");
|
|
100093
99715
|
var util2 = __require("util");
|
|
100094
99716
|
exports.init = init;
|
|
100095
|
-
exports.log =
|
|
99717
|
+
exports.log = log2;
|
|
100096
99718
|
exports.formatArgs = formatArgs2;
|
|
100097
99719
|
exports.save = save;
|
|
100098
99720
|
exports.load = load;
|
|
@@ -100227,7 +99849,7 @@ var require_node = __commonJS({
|
|
|
100227
99849
|
}
|
|
100228
99850
|
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
100229
99851
|
}
|
|
100230
|
-
function
|
|
99852
|
+
function log2(...args2) {
|
|
100231
99853
|
return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args2) + "\n");
|
|
100232
99854
|
}
|
|
100233
99855
|
function save(namespaces) {
|
|
@@ -104358,6 +103980,17 @@ var providers = {
|
|
|
104358
103980
|
// see the big-pickle note above (#1077).
|
|
104359
103981
|
isFree: true
|
|
104360
103982
|
},
|
|
103983
|
+
// Zen's FREE stealth preview (listed 2026-10-01), the fifth promo. Zen
|
|
103984
|
+
// has not published its data terms yet, so the description claims none.
|
|
103985
|
+
"fledge-alpha": {
|
|
103986
|
+
displayName: "Fledge Alpha",
|
|
103987
|
+
description: "Stealth preview, free for a limited time",
|
|
103988
|
+
resolve: "opencode/fledge-alpha-free",
|
|
103989
|
+
effort: ["low", "high", "max"],
|
|
103990
|
+
// free to run, still gated on the provider's own OPENCODE_API_KEY —
|
|
103991
|
+
// see the big-pickle note above (#1077).
|
|
103992
|
+
isFree: true
|
|
103993
|
+
},
|
|
104361
103994
|
// Zen's live free MiMo, and the second free row in a menu that big-pickle
|
|
104362
103995
|
// was alone in since `mimo-v2-pro-free` lost its model.
|
|
104363
103996
|
mimo: {
|
|
@@ -104420,7 +104053,11 @@ var providers = {
|
|
|
104420
104053
|
"glm-flash": {
|
|
104421
104054
|
displayName: "GLM Flash",
|
|
104422
104055
|
resolve: "opencode-go/glm-5.3-flash",
|
|
104423
|
-
|
|
104056
|
+
// the Go endpoint intermittently rejects reasoning_effort ("native reasoning
|
|
104057
|
+
// control reasoning_effort is not allowed") mid-run, despite models.dev
|
|
104058
|
+
// advertising a ladder — so this route sends none.
|
|
104059
|
+
effort: [],
|
|
104060
|
+
openRouterEffort: ["low", "high", "max"],
|
|
104424
104061
|
openRouterResolve: "openrouter/z-ai/glm-5.3-flash"
|
|
104425
104062
|
},
|
|
104426
104063
|
// legacy alias — the slug pinned a version instead of a brand tier and
|
|
@@ -104876,7 +104513,7 @@ var providers = {
|
|
|
104876
104513
|
"deepseek-pro": {
|
|
104877
104514
|
displayName: "DeepSeek Pro",
|
|
104878
104515
|
resolve: "vercel/deepseek/deepseek-v4-pro-0813",
|
|
104879
|
-
effort: ["none", "high", "max"]
|
|
104516
|
+
effort: ["none", "low", "high", "max"]
|
|
104880
104517
|
},
|
|
104881
104518
|
// the gateway's bare `deepseek-v4-flash` is the April preview — the same
|
|
104882
104519
|
// fork trap as OpenRouter, with `deepseek-v4-flash-0731` beside it — so
|
|
@@ -104884,7 +104521,7 @@ var providers = {
|
|
|
104884
104521
|
"deepseek-flash": {
|
|
104885
104522
|
displayName: "DeepSeek Flash",
|
|
104886
104523
|
resolve: "vercel/deepseek/deepseek-v4.1-flash",
|
|
104887
|
-
effort: ["none", "high", "max"]
|
|
104524
|
+
effort: ["none", "low", "high", "max"]
|
|
104888
104525
|
},
|
|
104889
104526
|
glm: {
|
|
104890
104527
|
displayName: "GLM",
|
|
@@ -105090,13 +104727,13 @@ for (const [name, ladder] of Object.entries({ ...PROVIDER_LADDERS, router: ROUTE
|
|
|
105090
104727
|
if (terminal.size < 2) throw new Error(`${name} ladder runs every tier on ${[...terminal][0]}`);
|
|
105091
104728
|
}
|
|
105092
104729
|
var OSS_MODEL_ALLOWLIST = [
|
|
105093
|
-
"deepseek/deepseek-flash",
|
|
105094
|
-
"openai/gpt-luna",
|
|
105095
|
-
"openrouter/minimax-m2.5",
|
|
105096
104730
|
// opt-in: 0.86x the old default on the measured mix, and Meta trains on the
|
|
105097
104731
|
// traffic — fine for public code on headless runs, the human decided
|
|
105098
104732
|
// 2026-09-11. unmeasured on a real run; not the default until it is.
|
|
105099
|
-
"meta/muse-spark-contributor"
|
|
104733
|
+
"meta/muse-spark-contributor",
|
|
104734
|
+
"deepseek/deepseek-flash",
|
|
104735
|
+
"openai/gpt-luna",
|
|
104736
|
+
"openrouter/minimax-m2.5"
|
|
105100
104737
|
];
|
|
105101
104738
|
var OSS_RECOMMENDED_MODEL = AUTO_TIER_TARGET[AUTO_EFFICIENT];
|
|
105102
104739
|
function ossFundedModelNames() {
|
|
@@ -105972,7 +105609,7 @@ var import_semver = __toESM(require_semver2(), 1);
|
|
|
105972
105609
|
// package.json
|
|
105973
105610
|
var package_default = {
|
|
105974
105611
|
name: "pullfrog",
|
|
105975
|
-
version: "0.1.
|
|
105612
|
+
version: "0.1.96",
|
|
105976
105613
|
cliContractVersion: "1",
|
|
105977
105614
|
type: "module",
|
|
105978
105615
|
bin: {
|
|
@@ -106038,7 +105675,7 @@ var package_default = {
|
|
|
106038
105675
|
undici: "^7.22.0",
|
|
106039
105676
|
vitest: "^4.0.17",
|
|
106040
105677
|
yaml: "^2.8.2",
|
|
106041
|
-
yes: "0.
|
|
105678
|
+
yes: "0.2.3",
|
|
106042
105679
|
zod: "4.3.6"
|
|
106043
105680
|
},
|
|
106044
105681
|
repository: {
|
|
@@ -106206,6 +105843,9 @@ function trackChild(options) {
|
|
|
106206
105843
|
function untrackChild(child) {
|
|
106207
105844
|
activeChildren.delete(child);
|
|
106208
105845
|
}
|
|
105846
|
+
function isTrackedChild(child) {
|
|
105847
|
+
return activeChildren.has(child);
|
|
105848
|
+
}
|
|
106209
105849
|
function killTrackedChildren() {
|
|
106210
105850
|
for (const entry of activeChildren) {
|
|
106211
105851
|
const child = entry[0];
|
|
@@ -106219,6 +105859,7 @@ function killTrackedChildren() {
|
|
|
106219
105859
|
}
|
|
106220
105860
|
child.kill("SIGKILL");
|
|
106221
105861
|
}
|
|
105862
|
+
activeChildren.clear();
|
|
106222
105863
|
}
|
|
106223
105864
|
var handlersInstalled = false;
|
|
106224
105865
|
function installSignalHandler() {
|
|
@@ -106941,7 +106582,7 @@ ${PR_SUMMARY_FORMAT}`
|
|
|
106941
106582
|
|
|
106942
106583
|
Follow these rules:
|
|
106943
106584
|
- note: the first create_pull_request_review submission may error with a one-time diff-coverage nudge listing unread TOC regions. retry the same call to proceed \u2014 optionally after reading the listed ranges. the pre-flight will not block again this session.
|
|
106944
|
-
- IF NO NEW ISSUES, NON-SUBSTANTIVE CHANGES ONLY (trivial formatting, import reordering, comment tweaks): do NOT submit a review. Instead call \`${t("report_progress")}\` with a 1-2 sentence note explaining no review was warranted (e.g. "No new issues. Changes since last review are formatting-only."). this leaves a visible signal that the run completed.
|
|
106585
|
+
- IF NO NEW ISSUES, NON-SUBSTANTIVE CHANGES ONLY (trivial formatting, import reordering, comment tweaks): do NOT submit a review. Instead call \`${t("report_progress")}\` with \`no_review_needed: true\` and a 1-2 sentence note explaining no review was warranted (e.g. "No new issues. Changes since last review are formatting-only."). this leaves a visible signal that the run completed.
|
|
106945
106586
|
- ELSE IF NEW CRITICAL ISSUES (blocks merge \u2014 bugs, security, data loss, broken core flows): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> [!CAUTION]\\n> This PR introduces ...\`, followed by the PR summary using the default format below.
|
|
106946
106587
|
- ELSE IF NEW MUST-ADDRESS NON-CRITICAL FINDINGS (real consequences if shipped \u2014 incorrect behavior, missing validation, regressions the author should fix before merge): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> [!IMPORTANT]\\n> ...\`, followed by the PR summary using the default format below. Do NOT use this tier for nits, style preferences, or "consider also" suggestions.
|
|
106947
106588
|
- ELSE IF NEW MINOR SUGGESTIONS ONLY (low-stakes findings, or Nitpicks only): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> \u2139\uFE0F No critical issues \u2014 minor suggestions inline.\\n\\n\` (vary the wording after \u2139\uFE0F to fit the review), followed by the PR summary using the default format below.
|
|
@@ -107102,7 +106743,7 @@ function buildUnsubmittedReviewPrompt(mode) {
|
|
|
107102
106743
|
"",
|
|
107103
106744
|
"do exactly one of:",
|
|
107104
106745
|
"- if you have findings: call `create_pull_request_review` now with your aggregated review (body + inline comments). the first call may error once with a diff-coverage nudge \u2014 retry the same call to proceed.",
|
|
107105
|
-
"- if there are genuinely no actionable findings since the last review (e.g. only formatting / comment / lockfile changes): call `report_progress` with a 1-2 sentence summary explaining that no review was warranted.",
|
|
106746
|
+
"- if there are genuinely no actionable findings since the last review (e.g. only formatting / comment / lockfile changes): call `report_progress` with `no_review_needed: true` and a 1-2 sentence summary explaining that no review was warranted.",
|
|
107106
106747
|
"",
|
|
107107
106748
|
"do NOT stop again until one of those tools has been called successfully."
|
|
107108
106749
|
].join("\n");
|
|
@@ -108083,6 +107724,8 @@ var claude = agent({
|
|
|
108083
107724
|
PWD: repoDir
|
|
108084
107725
|
};
|
|
108085
107726
|
env2.CLAUDE_CODE_AUTO_COMPACT_WINDOW ||= "500000";
|
|
107727
|
+
env2.CLAUDE_CODE_ENABLE_TODO_TOOLS = "1";
|
|
107728
|
+
env2.CLAUDE_CODE_ENABLE_TASKS = "0";
|
|
108086
107729
|
if (isBedrockRoute) {
|
|
108087
107730
|
env2.CLAUDE_CODE_USE_BEDROCK = "1";
|
|
108088
107731
|
}
|
|
@@ -111322,6 +110965,7 @@ var codex = agent({
|
|
|
111322
110965
|
// agents/opencode.ts
|
|
111323
110966
|
import { spawn as nodeSpawn2 } from "node:child_process";
|
|
111324
110967
|
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync6 } from "node:fs";
|
|
110968
|
+
import { totalmem } from "node:os";
|
|
111325
110969
|
import { join as join7 } from "node:path";
|
|
111326
110970
|
import { performance as performance7 } from "node:perf_hooks";
|
|
111327
110971
|
|
|
@@ -111599,13 +111243,13 @@ var defaultPathSerializer = ({ path: path4, url: _url3 }) => {
|
|
|
111599
111243
|
}
|
|
111600
111244
|
return url4;
|
|
111601
111245
|
};
|
|
111602
|
-
var getUrl = ({ baseUrl, path: path4, query, querySerializer, url: _url3 }) => {
|
|
111246
|
+
var getUrl = ({ baseUrl, path: path4, query: query2, querySerializer, url: _url3 }) => {
|
|
111603
111247
|
const pathUrl = _url3.startsWith("/") ? _url3 : `/${_url3}`;
|
|
111604
111248
|
let url4 = (baseUrl ?? "") + pathUrl;
|
|
111605
111249
|
if (path4) {
|
|
111606
111250
|
url4 = defaultPathSerializer({ path: path4, url: url4 });
|
|
111607
111251
|
}
|
|
111608
|
-
let search2 =
|
|
111252
|
+
let search2 = query2 ? querySerializer(query2) : "";
|
|
111609
111253
|
if (search2.startsWith("?")) {
|
|
111610
111254
|
search2 = search2.substring(1);
|
|
111611
111255
|
}
|
|
@@ -116673,9 +116317,9 @@ function rewrite(request2, values) {
|
|
|
116673
116317
|
const value2 = pick2(request2.headers.get(name), key === "directory" ? values.directory : values.workspace, key === "directory" ? encodeURIComponent : void 0);
|
|
116674
116318
|
if (!value2)
|
|
116675
116319
|
continue;
|
|
116676
|
-
for (const
|
|
116677
|
-
if (!url4.searchParams.has(
|
|
116678
|
-
url4.searchParams.set(
|
|
116320
|
+
for (const query2 of url4.pathname.startsWith("/api/") ? [key, `location[${key}]`] : [key]) {
|
|
116321
|
+
if (!url4.searchParams.has(query2)) {
|
|
116322
|
+
url4.searchParams.set(query2, value2);
|
|
116679
116323
|
}
|
|
116680
116324
|
}
|
|
116681
116325
|
changed = true;
|
|
@@ -117195,11 +116839,12 @@ function bootOpencodeServer(params) {
|
|
|
117195
116839
|
log.debug(`[opencode serve] ${text}`);
|
|
117196
116840
|
});
|
|
117197
116841
|
let closed = false;
|
|
116842
|
+
let exitCause;
|
|
117198
116843
|
const close = async () => {
|
|
117199
116844
|
if (closed) return;
|
|
117200
116845
|
closed = true;
|
|
117201
116846
|
untrackChild(proc);
|
|
117202
|
-
if (proc.pid &&
|
|
116847
|
+
if (proc.pid && proc.exitCode === null && proc.signalCode === null) {
|
|
117203
116848
|
try {
|
|
117204
116849
|
process.kill(-proc.pid, "SIGTERM");
|
|
117205
116850
|
} catch {
|
|
@@ -117233,7 +116878,7 @@ function bootOpencodeServer(params) {
|
|
|
117233
116878
|
if (match3?.[1]) {
|
|
117234
116879
|
resolved = true;
|
|
117235
116880
|
log.info(`\xBB opencode server up: ${match3[1]}`);
|
|
117236
|
-
resolve3({ baseUrl: match3[1], proc, close, recentStderr });
|
|
116881
|
+
resolve3({ baseUrl: match3[1], proc, close, recentStderr, exitCause: () => exitCause });
|
|
117237
116882
|
}
|
|
117238
116883
|
}
|
|
117239
116884
|
const lines = text.split("\n");
|
|
@@ -117250,6 +116895,11 @@ function bootOpencodeServer(params) {
|
|
|
117250
116895
|
reject(new Error(`failed to spawn opencode serve: ${err.message}`));
|
|
117251
116896
|
}
|
|
117252
116897
|
});
|
|
116898
|
+
proc.once("exit", (code, signal) => {
|
|
116899
|
+
if (!resolved || !isTrackedChild(proc)) return;
|
|
116900
|
+
exitCause = describeServerExit(code, signal);
|
|
116901
|
+
log.warning(withServerStderr(`\xBB ${exitCause}`, recentStderr));
|
|
116902
|
+
});
|
|
117253
116903
|
proc.once("close", (code, signal) => {
|
|
117254
116904
|
if (!resolved) {
|
|
117255
116905
|
const tail = recentStderr.slice(-5).join("\n");
|
|
@@ -117283,6 +116933,12 @@ function withServerStderr(message, recentStderr) {
|
|
|
117283
116933
|
opencode server stderr:
|
|
117284
116934
|
${tail}` : message;
|
|
117285
116935
|
}
|
|
116936
|
+
function describeServerExit(code, signal) {
|
|
116937
|
+
if (signal !== "SIGKILL") return `opencode server exited mid-run (${signal ?? `code ${code}`})`;
|
|
116938
|
+
const limit = process.constrainedMemory();
|
|
116939
|
+
const memoryGb = ((limit > 0 ? Math.min(limit, totalmem()) : totalmem()) / 1024 ** 3).toFixed(1);
|
|
116940
|
+
return `opencode server was killed (SIGKILL) mid-run, usually by the kernel OOM killer \u2014 this runner has ${memoryGb} GB of memory`;
|
|
116941
|
+
}
|
|
117286
116942
|
function newTurn() {
|
|
117287
116943
|
return {
|
|
117288
116944
|
finalText: "",
|
|
@@ -117508,7 +117164,8 @@ async function runPromptTurn(ctx, params) {
|
|
|
117508
117164
|
costUsd: usage.costUsd
|
|
117509
117165
|
});
|
|
117510
117166
|
}
|
|
117511
|
-
const
|
|
117167
|
+
const cause = ctx.serverExitCause() ?? ctx.diagnostic.lastProviderError;
|
|
117168
|
+
const diagnosis = cause ? ` \u2014 likely cause: ${cause}` : "";
|
|
117512
117169
|
if (networkError) {
|
|
117513
117170
|
return {
|
|
117514
117171
|
success: false,
|
|
@@ -117826,6 +117483,7 @@ var opencode = agent({
|
|
|
117826
117483
|
loggedToolCallIDs: /* @__PURE__ */ new Set(),
|
|
117827
117484
|
mcpToolCalls: 0,
|
|
117828
117485
|
recentStderr: server.recentStderr,
|
|
117486
|
+
serverExitCause: server.exitCause,
|
|
117829
117487
|
diagnostic: {
|
|
117830
117488
|
label: "Pullfrog",
|
|
117831
117489
|
recentStderr: server.recentStderr,
|
|
@@ -123256,10 +122914,10 @@ function getMatch(pattern, exp) {
|
|
|
123256
122914
|
}
|
|
123257
122915
|
function parseQuery(pattern, options = {}) {
|
|
123258
122916
|
return pattern.replace(/\\\|/g, ESCAPED_PIPE).split(OR_TOKEN).map((item) => {
|
|
123259
|
-
const
|
|
122917
|
+
const query2 = tokenize(item.replace(/\u0000/g, "|").trim()).filter((item2) => item2 && !!item2.trim());
|
|
123260
122918
|
const results = [];
|
|
123261
|
-
for (let i = 0, len =
|
|
123262
|
-
const queryItem =
|
|
122919
|
+
for (let i = 0, len = query2.length; i < len; i += 1) {
|
|
122920
|
+
const queryItem = query2[i];
|
|
123263
122921
|
let found = false;
|
|
123264
122922
|
let idx = -1;
|
|
123265
122923
|
while (!found && ++idx < matchersLen) {
|
|
@@ -123307,8 +122965,8 @@ var ExtendedSearch = class {
|
|
|
123307
122965
|
return options.useExtendedSearch;
|
|
123308
122966
|
}
|
|
123309
122967
|
searchIn(text) {
|
|
123310
|
-
const
|
|
123311
|
-
if (!
|
|
122968
|
+
const query2 = this.query;
|
|
122969
|
+
if (!query2) return {
|
|
123312
122970
|
isMatch: false,
|
|
123313
122971
|
score: 1
|
|
123314
122972
|
};
|
|
@@ -123319,8 +122977,8 @@ var ExtendedSearch = class {
|
|
|
123319
122977
|
const allIndices = [];
|
|
123320
122978
|
let totalScore = 0;
|
|
123321
122979
|
let hasInverse = false;
|
|
123322
|
-
for (let i = 0, qLen =
|
|
123323
|
-
const searchers =
|
|
122980
|
+
for (let i = 0, qLen = query2.length; i < qLen; i += 1) {
|
|
122981
|
+
const searchers = query2[i];
|
|
123324
122982
|
allIndices.length = 0;
|
|
123325
122983
|
numMatches = 0;
|
|
123326
122984
|
hasInverse = false;
|
|
@@ -123376,26 +123034,26 @@ var KeyType = {
|
|
|
123376
123034
|
PATH: "$path",
|
|
123377
123035
|
PATTERN: "$val"
|
|
123378
123036
|
};
|
|
123379
|
-
var isExpression = (
|
|
123380
|
-
var isPath = (
|
|
123381
|
-
var isLeaf = (
|
|
123382
|
-
var convertToExplicit = (
|
|
123383
|
-
function parse3(
|
|
123384
|
-
const next2 = (
|
|
123385
|
-
if (isString(
|
|
123037
|
+
var isExpression = (query2) => !!(query2[LogicalOperator.AND] || query2[LogicalOperator.OR]);
|
|
123038
|
+
var isPath = (query2) => !!query2[KeyType.PATH];
|
|
123039
|
+
var isLeaf = (query2) => !isArray2(query2) && isObject2(query2) && !isExpression(query2);
|
|
123040
|
+
var convertToExplicit = (query2) => ({ [LogicalOperator.AND]: Object.keys(query2).map((key) => ({ [key]: query2[key] })) });
|
|
123041
|
+
function parse3(query2, options, { auto = true } = {}) {
|
|
123042
|
+
const next2 = (query3) => {
|
|
123043
|
+
if (isString(query3)) {
|
|
123386
123044
|
const obj = {
|
|
123387
123045
|
keyId: null,
|
|
123388
|
-
pattern:
|
|
123046
|
+
pattern: query3
|
|
123389
123047
|
};
|
|
123390
|
-
if (auto) obj.searcher = createSearcher(
|
|
123048
|
+
if (auto) obj.searcher = createSearcher(query3, options);
|
|
123391
123049
|
return obj;
|
|
123392
123050
|
}
|
|
123393
|
-
const keys = Object.keys(
|
|
123394
|
-
const isQueryPath = isPath(
|
|
123395
|
-
if (!isQueryPath && keys.length > 1 && !isExpression(
|
|
123396
|
-
if (isLeaf(
|
|
123397
|
-
const key = isQueryPath ?
|
|
123398
|
-
const pattern = isQueryPath ?
|
|
123051
|
+
const keys = Object.keys(query3);
|
|
123052
|
+
const isQueryPath = isPath(query3);
|
|
123053
|
+
if (!isQueryPath && keys.length > 1 && !isExpression(query3)) return next2(convertToExplicit(query3));
|
|
123054
|
+
if (isLeaf(query3)) {
|
|
123055
|
+
const key = isQueryPath ? query3[KeyType.PATH] : keys[0];
|
|
123056
|
+
const pattern = isQueryPath ? query3[KeyType.PATTERN] : query3[key];
|
|
123399
123057
|
if (!isString(pattern)) throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
|
|
123400
123058
|
const obj = {
|
|
123401
123059
|
keyId: createKeyId(key),
|
|
@@ -123409,15 +123067,15 @@ function parse3(query, options, { auto = true } = {}) {
|
|
|
123409
123067
|
operator: keys[0]
|
|
123410
123068
|
};
|
|
123411
123069
|
keys.forEach((key) => {
|
|
123412
|
-
const value2 =
|
|
123070
|
+
const value2 = query3[key];
|
|
123413
123071
|
if (isArray2(value2)) value2.forEach((item) => {
|
|
123414
123072
|
node2.children.push(next2(item));
|
|
123415
123073
|
});
|
|
123416
123074
|
});
|
|
123417
123075
|
return node2;
|
|
123418
123076
|
};
|
|
123419
|
-
if (!isExpression(
|
|
123420
|
-
return next2(
|
|
123077
|
+
if (!isExpression(query2)) query2 = convertToExplicit(query2);
|
|
123078
|
+
return next2(query2);
|
|
123421
123079
|
}
|
|
123422
123080
|
function computeScoreSingle(matches, { ignoreFieldNorm = Config3.ignoreFieldNorm }) {
|
|
123423
123081
|
let totalScore = 1;
|
|
@@ -123713,13 +123371,13 @@ var Fuse = class {
|
|
|
123713
123371
|
this._lastQuery = null;
|
|
123714
123372
|
this._lastSearcher = null;
|
|
123715
123373
|
}
|
|
123716
|
-
_getSearcher(
|
|
123717
|
-
if (this._lastQuery ===
|
|
123718
|
-
const searcher = createSearcher(
|
|
123374
|
+
_getSearcher(query2) {
|
|
123375
|
+
if (this._lastQuery === query2) return this._lastSearcher;
|
|
123376
|
+
const searcher = createSearcher(query2, this._invertedIndex ? {
|
|
123719
123377
|
...this.options,
|
|
123720
123378
|
_invertedIndex: this._invertedIndex
|
|
123721
123379
|
} : this.options);
|
|
123722
|
-
this._lastQuery =
|
|
123380
|
+
this._lastQuery = query2;
|
|
123723
123381
|
this._lastSearcher = searcher;
|
|
123724
123382
|
return searcher;
|
|
123725
123383
|
}
|
|
@@ -123788,10 +123446,10 @@ var Fuse = class {
|
|
|
123788
123446
|
_normalizedKeys() {
|
|
123789
123447
|
return this._myIndex.keys.map((key) => this._keyStore.get(key.id) || key);
|
|
123790
123448
|
}
|
|
123791
|
-
search(
|
|
123449
|
+
search(query2, options) {
|
|
123792
123450
|
const { limit = -1 } = options || {};
|
|
123793
123451
|
const { includeMatches, includeScore, shouldSort, sortFn, ignoreFieldNorm } = this.options;
|
|
123794
|
-
if (isString(
|
|
123452
|
+
if (isString(query2) && !query2.trim()) {
|
|
123795
123453
|
let docs = this._docs.map((item, idx) => ({
|
|
123796
123454
|
item,
|
|
123797
123455
|
refIndex: idx
|
|
@@ -123799,25 +123457,25 @@ var Fuse = class {
|
|
|
123799
123457
|
if (isNumber(limit) && limit > -1) docs = docs.slice(0, limit);
|
|
123800
123458
|
return docs;
|
|
123801
123459
|
}
|
|
123802
|
-
const useHeap = shouldSort && isNumber(limit) && limit > 0 && isString(
|
|
123460
|
+
const useHeap = shouldSort && isNumber(limit) && limit > 0 && isString(query2);
|
|
123803
123461
|
const comparator = sortFn;
|
|
123804
123462
|
const stable = (a, b) => comparator(a, b) || a.idx - b.idx;
|
|
123805
123463
|
let results;
|
|
123806
123464
|
if (useHeap) {
|
|
123807
123465
|
const heap = new MaxHeap(limit, stable);
|
|
123808
|
-
if (isString(this._docs[0])) this._searchStringList(
|
|
123466
|
+
if (isString(this._docs[0])) this._searchStringList(query2, {
|
|
123809
123467
|
heap,
|
|
123810
123468
|
ignoreFieldNorm
|
|
123811
123469
|
});
|
|
123812
|
-
else this._searchObjectList(
|
|
123470
|
+
else this._searchObjectList(query2, {
|
|
123813
123471
|
heap,
|
|
123814
123472
|
ignoreFieldNorm
|
|
123815
123473
|
});
|
|
123816
123474
|
results = heap.extractSorted();
|
|
123817
123475
|
} else {
|
|
123818
|
-
results = isString(
|
|
123476
|
+
results = isString(query2) ? isString(this._docs[0]) ? this._searchStringList(query2) : this._searchObjectList(query2) : this._searchLogical(query2);
|
|
123819
123477
|
computeScore(results, { ignoreFieldNorm });
|
|
123820
|
-
if (shouldSort) results.sort(isString(
|
|
123478
|
+
if (shouldSort) results.sort(isString(query2) ? stable : comparator);
|
|
123821
123479
|
if (isNumber(limit) && limit > -1) results = results.slice(0, limit);
|
|
123822
123480
|
}
|
|
123823
123481
|
return format(results, this._docs, {
|
|
@@ -123825,8 +123483,8 @@ var Fuse = class {
|
|
|
123825
123483
|
includeScore
|
|
123826
123484
|
});
|
|
123827
123485
|
}
|
|
123828
|
-
_searchStringList(
|
|
123829
|
-
const searcher = this._getSearcher(
|
|
123486
|
+
_searchStringList(query2, { heap, ignoreFieldNorm } = {}) {
|
|
123487
|
+
const searcher = this._getSearcher(query2);
|
|
123830
123488
|
const requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === "all";
|
|
123831
123489
|
const { records } = this._myIndex;
|
|
123832
123490
|
const results = heap ? null : [];
|
|
@@ -123861,8 +123519,8 @@ var Fuse = class {
|
|
|
123861
123519
|
});
|
|
123862
123520
|
return results;
|
|
123863
123521
|
}
|
|
123864
|
-
_searchLogical(
|
|
123865
|
-
const expression = parse3(
|
|
123522
|
+
_searchLogical(query2) {
|
|
123523
|
+
const expression = parse3(query2, this.options);
|
|
123866
123524
|
const keys = this._normalizedKeys();
|
|
123867
123525
|
const evaluate = (node2, item, idx) => {
|
|
123868
123526
|
if (!("children" in node2)) {
|
|
@@ -123922,8 +123580,8 @@ var Fuse = class {
|
|
|
123922
123580
|
});
|
|
123923
123581
|
return results;
|
|
123924
123582
|
}
|
|
123925
|
-
_searchObjectList(
|
|
123926
|
-
const searcher = this._getSearcher(
|
|
123583
|
+
_searchObjectList(query2, { heap, ignoreFieldNorm } = {}) {
|
|
123584
|
+
const searcher = this._getSearcher(query2);
|
|
123927
123585
|
const requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === "all";
|
|
123928
123586
|
const { records } = this._myIndex;
|
|
123929
123587
|
const keys = this._normalizedKeys();
|
|
@@ -124150,10 +123808,10 @@ var getPattern = (label, next2) => {
|
|
|
124150
123808
|
if (label === "*") return "*";
|
|
124151
123809
|
const match3 = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
124152
123810
|
if (match3) {
|
|
124153
|
-
const
|
|
124154
|
-
if (!patternCache[
|
|
124155
|
-
if (match3[2]) patternCache[
|
|
124156
|
-
|
|
123811
|
+
const cacheKey3 = `${label}#${next2}`;
|
|
123812
|
+
if (!patternCache[cacheKey3]) {
|
|
123813
|
+
if (match3[2]) patternCache[cacheKey3] = next2 && next2[0] !== ":" && next2[0] !== "*" ? [
|
|
123814
|
+
cacheKey3,
|
|
124157
123815
|
match3[1],
|
|
124158
123816
|
new RegExp(`^${match3[2]}(?=/${next2})`)
|
|
124159
123817
|
] : [
|
|
@@ -124161,13 +123819,13 @@ var getPattern = (label, next2) => {
|
|
|
124161
123819
|
match3[1],
|
|
124162
123820
|
new RegExp(`^${match3[2]}$`)
|
|
124163
123821
|
];
|
|
124164
|
-
else patternCache[
|
|
123822
|
+
else patternCache[cacheKey3] = [
|
|
124165
123823
|
label,
|
|
124166
123824
|
match3[1],
|
|
124167
123825
|
true
|
|
124168
123826
|
];
|
|
124169
123827
|
}
|
|
124170
|
-
return patternCache[
|
|
123828
|
+
return patternCache[cacheKey3];
|
|
124171
123829
|
}
|
|
124172
123830
|
return null;
|
|
124173
123831
|
};
|
|
@@ -134656,9 +134314,9 @@ var require_schemes2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134656
134314
|
wsComponent.secure = void 0;
|
|
134657
134315
|
}
|
|
134658
134316
|
if (wsComponent.resourceName) {
|
|
134659
|
-
const [path4,
|
|
134317
|
+
const [path4, query2] = wsComponent.resourceName.split("?");
|
|
134660
134318
|
wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
|
|
134661
|
-
wsComponent.query =
|
|
134319
|
+
wsComponent.query = query2;
|
|
134662
134320
|
wsComponent.resourceName = void 0;
|
|
134663
134321
|
}
|
|
134664
134322
|
wsComponent.fragment = void 0;
|
|
@@ -134763,21 +134421,21 @@ var require_fast_uri2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134763
134421
|
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils6();
|
|
134764
134422
|
const { SCHEMES, getSchemeHandler } = require_schemes2();
|
|
134765
134423
|
function normalize3(uri, options) {
|
|
134766
|
-
if (typeof uri === "string") uri =
|
|
134767
|
-
else if (typeof uri === "object") uri = parse6(
|
|
134424
|
+
if (typeof uri === "string") uri = serialize2(parse6(uri, options), options);
|
|
134425
|
+
else if (typeof uri === "object") uri = parse6(serialize2(uri, options), options);
|
|
134768
134426
|
return uri;
|
|
134769
134427
|
}
|
|
134770
134428
|
function resolve3(baseURI, relativeURI, options) {
|
|
134771
134429
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
134772
134430
|
const resolved = resolveComponent(parse6(baseURI, schemelessOptions), parse6(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
134773
134431
|
schemelessOptions.skipEscape = true;
|
|
134774
|
-
return
|
|
134432
|
+
return serialize2(resolved, schemelessOptions);
|
|
134775
134433
|
}
|
|
134776
134434
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
134777
134435
|
const target = {};
|
|
134778
134436
|
if (!skipNormalization) {
|
|
134779
|
-
base = parse6(
|
|
134780
|
-
relative = parse6(
|
|
134437
|
+
base = parse6(serialize2(base, options), options);
|
|
134438
|
+
relative = parse6(serialize2(relative, options), options);
|
|
134781
134439
|
}
|
|
134782
134440
|
options = options || {};
|
|
134783
134441
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -134821,27 +134479,27 @@ var require_fast_uri2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134821
134479
|
function equal(uriA, uriB, options) {
|
|
134822
134480
|
if (typeof uriA === "string") {
|
|
134823
134481
|
uriA = unescape(uriA);
|
|
134824
|
-
uriA =
|
|
134482
|
+
uriA = serialize2(normalizeComponentEncoding(parse6(uriA, options), true), {
|
|
134825
134483
|
...options,
|
|
134826
134484
|
skipEscape: true
|
|
134827
134485
|
});
|
|
134828
|
-
} else if (typeof uriA === "object") uriA =
|
|
134486
|
+
} else if (typeof uriA === "object") uriA = serialize2(normalizeComponentEncoding(uriA, true), {
|
|
134829
134487
|
...options,
|
|
134830
134488
|
skipEscape: true
|
|
134831
134489
|
});
|
|
134832
134490
|
if (typeof uriB === "string") {
|
|
134833
134491
|
uriB = unescape(uriB);
|
|
134834
|
-
uriB =
|
|
134492
|
+
uriB = serialize2(normalizeComponentEncoding(parse6(uriB, options), true), {
|
|
134835
134493
|
...options,
|
|
134836
134494
|
skipEscape: true
|
|
134837
134495
|
});
|
|
134838
|
-
} else if (typeof uriB === "object") uriB =
|
|
134496
|
+
} else if (typeof uriB === "object") uriB = serialize2(normalizeComponentEncoding(uriB, true), {
|
|
134839
134497
|
...options,
|
|
134840
134498
|
skipEscape: true
|
|
134841
134499
|
});
|
|
134842
134500
|
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
134843
134501
|
}
|
|
134844
|
-
function
|
|
134502
|
+
function serialize2(cmpts, opts) {
|
|
134845
134503
|
const component = {
|
|
134846
134504
|
host: cmpts.host,
|
|
134847
134505
|
scheme: cmpts.scheme,
|
|
@@ -134944,7 +134602,7 @@ var require_fast_uri2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134944
134602
|
resolve: resolve3,
|
|
134945
134603
|
resolveComponent,
|
|
134946
134604
|
equal,
|
|
134947
|
-
serialize,
|
|
134605
|
+
serialize: serialize2,
|
|
134948
134606
|
parse: parse6
|
|
134949
134607
|
};
|
|
134950
134608
|
module.exports = fastUri;
|
|
@@ -135273,8 +134931,8 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
135273
134931
|
return this;
|
|
135274
134932
|
}
|
|
135275
134933
|
case "object": {
|
|
135276
|
-
const
|
|
135277
|
-
this._cache.delete(
|
|
134934
|
+
const cacheKey3 = schemaKeyRef;
|
|
134935
|
+
this._cache.delete(cacheKey3);
|
|
135278
134936
|
let id = schemaKeyRef[this.opts.schemaId];
|
|
135279
134937
|
if (id) {
|
|
135280
134938
|
id = (0, resolve_1.normalizeId)(id);
|
|
@@ -135417,10 +135075,10 @@ var require_core$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
135417
135075
|
Ajv5.ValidationError = validation_error_1.default;
|
|
135418
135076
|
Ajv5.MissingRefError = ref_error_1.default;
|
|
135419
135077
|
exports.default = Ajv5;
|
|
135420
|
-
function checkOptions(checkOpts, options, msg,
|
|
135078
|
+
function checkOptions(checkOpts, options, msg, log2 = "error") {
|
|
135421
135079
|
for (const key in checkOpts) {
|
|
135422
135080
|
const opt = key;
|
|
135423
|
-
if (opt in options) this.logger[
|
|
135081
|
+
if (opt in options) this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
135424
135082
|
}
|
|
135425
135083
|
}
|
|
135426
135084
|
function getSchEnv(keyRef) {
|
|
@@ -148941,9 +148599,9 @@ var require_schemes3 = /* @__PURE__ */ __commonJSMin2(((exports, module) => {
|
|
|
148941
148599
|
wsComponent.secure = void 0;
|
|
148942
148600
|
}
|
|
148943
148601
|
if (wsComponent.resourceName) {
|
|
148944
|
-
const [path4,
|
|
148602
|
+
const [path4, query2] = wsComponent.resourceName.split("?");
|
|
148945
148603
|
wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
|
|
148946
|
-
wsComponent.query =
|
|
148604
|
+
wsComponent.query = query2;
|
|
148947
148605
|
wsComponent.resourceName = void 0;
|
|
148948
148606
|
}
|
|
148949
148607
|
wsComponent.fragment = void 0;
|
|
@@ -149048,21 +148706,21 @@ var require_fast_uri3 = /* @__PURE__ */ __commonJSMin2(((exports, module) => {
|
|
|
149048
148706
|
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils7();
|
|
149049
148707
|
const { SCHEMES, getSchemeHandler } = require_schemes3();
|
|
149050
148708
|
function normalize3(uri, options) {
|
|
149051
|
-
if (typeof uri === "string") uri =
|
|
149052
|
-
else if (typeof uri === "object") uri = parse6(
|
|
148709
|
+
if (typeof uri === "string") uri = serialize2(parse6(uri, options), options);
|
|
148710
|
+
else if (typeof uri === "object") uri = parse6(serialize2(uri, options), options);
|
|
149053
148711
|
return uri;
|
|
149054
148712
|
}
|
|
149055
148713
|
function resolve3(baseURI, relativeURI, options) {
|
|
149056
148714
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
149057
148715
|
const resolved = resolveComponent(parse6(baseURI, schemelessOptions), parse6(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
149058
148716
|
schemelessOptions.skipEscape = true;
|
|
149059
|
-
return
|
|
148717
|
+
return serialize2(resolved, schemelessOptions);
|
|
149060
148718
|
}
|
|
149061
148719
|
function resolveComponent(base, relative, options, skipNormalization) {
|
|
149062
148720
|
const target = {};
|
|
149063
148721
|
if (!skipNormalization) {
|
|
149064
|
-
base = parse6(
|
|
149065
|
-
relative = parse6(
|
|
148722
|
+
base = parse6(serialize2(base, options), options);
|
|
148723
|
+
relative = parse6(serialize2(relative, options), options);
|
|
149066
148724
|
}
|
|
149067
148725
|
options = options || {};
|
|
149068
148726
|
if (!options.tolerant && relative.scheme) {
|
|
@@ -149106,27 +148764,27 @@ var require_fast_uri3 = /* @__PURE__ */ __commonJSMin2(((exports, module) => {
|
|
|
149106
148764
|
function equal(uriA, uriB, options) {
|
|
149107
148765
|
if (typeof uriA === "string") {
|
|
149108
148766
|
uriA = unescape(uriA);
|
|
149109
|
-
uriA =
|
|
148767
|
+
uriA = serialize2(normalizeComponentEncoding(parse6(uriA, options), true), {
|
|
149110
148768
|
...options,
|
|
149111
148769
|
skipEscape: true
|
|
149112
148770
|
});
|
|
149113
|
-
} else if (typeof uriA === "object") uriA =
|
|
148771
|
+
} else if (typeof uriA === "object") uriA = serialize2(normalizeComponentEncoding(uriA, true), {
|
|
149114
148772
|
...options,
|
|
149115
148773
|
skipEscape: true
|
|
149116
148774
|
});
|
|
149117
148775
|
if (typeof uriB === "string") {
|
|
149118
148776
|
uriB = unescape(uriB);
|
|
149119
|
-
uriB =
|
|
148777
|
+
uriB = serialize2(normalizeComponentEncoding(parse6(uriB, options), true), {
|
|
149120
148778
|
...options,
|
|
149121
148779
|
skipEscape: true
|
|
149122
148780
|
});
|
|
149123
|
-
} else if (typeof uriB === "object") uriB =
|
|
148781
|
+
} else if (typeof uriB === "object") uriB = serialize2(normalizeComponentEncoding(uriB, true), {
|
|
149124
148782
|
...options,
|
|
149125
148783
|
skipEscape: true
|
|
149126
148784
|
});
|
|
149127
148785
|
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
149128
148786
|
}
|
|
149129
|
-
function
|
|
148787
|
+
function serialize2(cmpts, opts) {
|
|
149130
148788
|
const component = {
|
|
149131
148789
|
host: cmpts.host,
|
|
149132
148790
|
scheme: cmpts.scheme,
|
|
@@ -149229,7 +148887,7 @@ var require_fast_uri3 = /* @__PURE__ */ __commonJSMin2(((exports, module) => {
|
|
|
149229
148887
|
resolve: resolve3,
|
|
149230
148888
|
resolveComponent,
|
|
149231
148889
|
equal,
|
|
149232
|
-
serialize,
|
|
148890
|
+
serialize: serialize2,
|
|
149233
148891
|
parse: parse6
|
|
149234
148892
|
};
|
|
149235
148893
|
module.exports = fastUri;
|
|
@@ -149558,8 +149216,8 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
149558
149216
|
return this;
|
|
149559
149217
|
}
|
|
149560
149218
|
case "object": {
|
|
149561
|
-
const
|
|
149562
|
-
this._cache.delete(
|
|
149219
|
+
const cacheKey3 = schemaKeyRef;
|
|
149220
|
+
this._cache.delete(cacheKey3);
|
|
149563
149221
|
let id = schemaKeyRef[this.opts.schemaId];
|
|
149564
149222
|
if (id) {
|
|
149565
149223
|
id = (0, resolve_1.normalizeId)(id);
|
|
@@ -149702,10 +149360,10 @@ var require_core$32 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
149702
149360
|
Ajv5.ValidationError = validation_error_1.default;
|
|
149703
149361
|
Ajv5.MissingRefError = ref_error_1.default;
|
|
149704
149362
|
exports.default = Ajv5;
|
|
149705
|
-
function checkOptions(checkOpts, options, msg,
|
|
149363
|
+
function checkOptions(checkOpts, options, msg, log2 = "error") {
|
|
149706
149364
|
for (const key in checkOpts) {
|
|
149707
149365
|
const opt = key;
|
|
149708
|
-
if (opt in options) this.logger[
|
|
149366
|
+
if (opt in options) this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`);
|
|
149709
149367
|
}
|
|
149710
149368
|
}
|
|
149711
149369
|
function getSchEnv(keyRef) {
|
|
@@ -160398,7 +160056,7 @@ var require_depd = /* @__PURE__ */ __commonJSMin3(((exports, module) => {
|
|
|
160398
160056
|
if (!namespace) throw new TypeError("argument namespace is required");
|
|
160399
160057
|
var file2 = callSiteLocation(getStack()[1])[0];
|
|
160400
160058
|
function deprecate$1(message) {
|
|
160401
|
-
|
|
160059
|
+
log2.call(deprecate$1, message);
|
|
160402
160060
|
}
|
|
160403
160061
|
deprecate$1._file = file2;
|
|
160404
160062
|
deprecate$1._ignored = isignored(namespace);
|
|
@@ -160420,7 +160078,7 @@ var require_depd = /* @__PURE__ */ __commonJSMin3(((exports, module) => {
|
|
|
160420
160078
|
if (process.traceDeprecation) return true;
|
|
160421
160079
|
return containsNamespace(process.env.TRACE_DEPRECATION || "", namespace);
|
|
160422
160080
|
}
|
|
160423
|
-
function
|
|
160081
|
+
function log2(message, site) {
|
|
160424
160082
|
var haslisteners = eehaslisteners(process, "deprecation");
|
|
160425
160083
|
if (!haslisteners && this._ignored) return;
|
|
160426
160084
|
var caller;
|
|
@@ -160526,7 +160184,7 @@ var require_depd = /* @__PURE__ */ __commonJSMin3(((exports, module) => {
|
|
|
160526
160184
|
var args2 = createArgumentsString(fn2.length);
|
|
160527
160185
|
var site = callSiteLocation(getStack()[1]);
|
|
160528
160186
|
site.name = fn2.name;
|
|
160529
|
-
return new Function("fn", "log", "deprecate", "message", "site", '"use strict"\nreturn function (' + args2 + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn2,
|
|
160187
|
+
return new Function("fn", "log", "deprecate", "message", "site", '"use strict"\nreturn function (' + args2 + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn2, log2, this, message, site);
|
|
160530
160188
|
}
|
|
160531
160189
|
function wrapproperty(obj, prop, message) {
|
|
160532
160190
|
if (!obj || typeof obj !== "object" && typeof obj !== "function") throw new TypeError("argument obj must be object");
|
|
@@ -160540,11 +160198,11 @@ var require_depd = /* @__PURE__ */ __commonJSMin3(((exports, module) => {
|
|
|
160540
160198
|
var get2 = descriptor.get;
|
|
160541
160199
|
var set2 = descriptor.set;
|
|
160542
160200
|
if (typeof get2 === "function") descriptor.get = function getter() {
|
|
160543
|
-
|
|
160201
|
+
log2.call(deprecate$1, message, site);
|
|
160544
160202
|
return get2.apply(this, arguments);
|
|
160545
160203
|
};
|
|
160546
160204
|
if (typeof set2 === "function") descriptor.set = function setter() {
|
|
160547
|
-
|
|
160205
|
+
log2.call(deprecate$1, message, site);
|
|
160548
160206
|
return set2.apply(this, arguments);
|
|
160549
160207
|
};
|
|
160550
160208
|
Object.defineProperty(obj, prop, descriptor);
|
|
@@ -171592,7 +171250,7 @@ ${error49 instanceof Error ? error49.stack : JSON.stringify(error49)}`
|
|
|
171592
171250
|
);
|
|
171593
171251
|
}
|
|
171594
171252
|
};
|
|
171595
|
-
const
|
|
171253
|
+
const log2 = {
|
|
171596
171254
|
debug: (message, context) => {
|
|
171597
171255
|
this.#server.sendLoggingMessage({
|
|
171598
171256
|
data: {
|
|
@@ -171660,7 +171318,7 @@ ${error49 instanceof Error ? error49.stack : JSON.stringify(error49)}`
|
|
|
171660
171318
|
client: {
|
|
171661
171319
|
version: this.#server.getClientVersion()
|
|
171662
171320
|
},
|
|
171663
|
-
log:
|
|
171321
|
+
log: log2,
|
|
171664
171322
|
reportProgress: reportProgress2,
|
|
171665
171323
|
requestId: typeof request2.params?._meta?.requestId === "string" ? request2.params._meta.requestId : void 0,
|
|
171666
171324
|
session: this.#auth,
|
|
@@ -174522,8 +174180,8 @@ var createNode = ({ id, kind, inner, meta: meta3, $: $2, ignoreCache }) => {
|
|
|
174522
174180
|
let innerJson = {};
|
|
174523
174181
|
for (const [k2, v] of innerEntries) {
|
|
174524
174182
|
const keyImpl = impl.keys[k2];
|
|
174525
|
-
const
|
|
174526
|
-
innerJson[k2] =
|
|
174183
|
+
const serialize2 = keyImpl.serialize ?? (keyImpl.child ? serializeListableChild : defaultValueSerializer);
|
|
174184
|
+
innerJson[k2] = serialize2(v);
|
|
174527
174185
|
if (keyImpl.child === true) {
|
|
174528
174186
|
const listableNode = v;
|
|
174529
174187
|
if (isArray(listableNode))
|
|
@@ -174745,8 +174403,8 @@ var defaultableMorphCache = {};
|
|
|
174745
174403
|
var getDefaultableMorph = (node2) => {
|
|
174746
174404
|
if (!node2.hasDefault())
|
|
174747
174405
|
return;
|
|
174748
|
-
const
|
|
174749
|
-
return defaultableMorphCache[
|
|
174406
|
+
const cacheKey3 = `{${node2.compiledKey}: ${node2.value.id} = ${defaultValueSerializer(node2.default)}}`;
|
|
174407
|
+
return defaultableMorphCache[cacheKey3] ??= computeDefaultValueMorph(node2.key, node2.value, node2.default);
|
|
174750
174408
|
};
|
|
174751
174409
|
var computeDefaultValueMorph = (key, value2, defaultInput) => {
|
|
174752
174410
|
if (typeof defaultInput === "function") {
|
|
@@ -176919,15 +176577,15 @@ var getDefaultableMorphs = (node2) => {
|
|
|
176919
176577
|
if (!node2.defaultables)
|
|
176920
176578
|
return [];
|
|
176921
176579
|
const morphs = [];
|
|
176922
|
-
let
|
|
176580
|
+
let cacheKey3 = "[";
|
|
176923
176581
|
const lastDefaultableIndex = node2.prefixLength + node2.defaultablesLength - 1;
|
|
176924
176582
|
for (let i = node2.prefixLength; i <= lastDefaultableIndex; i++) {
|
|
176925
176583
|
const [elementNode, defaultValue] = node2.defaultables[i - node2.prefixLength];
|
|
176926
176584
|
morphs.push(computeDefaultValueMorph(i, elementNode, defaultValue));
|
|
176927
|
-
|
|
176585
|
+
cacheKey3 += `${i}: ${elementNode.id} = ${defaultValueSerializer(defaultValue)}, `;
|
|
176928
176586
|
}
|
|
176929
|
-
|
|
176930
|
-
return defaultableMorphsCache[
|
|
176587
|
+
cacheKey3 += "]";
|
|
176588
|
+
return defaultableMorphsCache[cacheKey3] ??= morphs;
|
|
176931
176589
|
};
|
|
176932
176590
|
var Sequence = {
|
|
176933
176591
|
implementation: implementation21,
|
|
@@ -177617,40 +177275,40 @@ var StructureNode = class extends BaseConstraint {
|
|
|
177617
177275
|
};
|
|
177618
177276
|
var defaultableMorphsCache2 = {};
|
|
177619
177277
|
var constructStructuralMorphCacheKey = (node2) => {
|
|
177620
|
-
let
|
|
177278
|
+
let cacheKey3 = "";
|
|
177621
177279
|
for (let i = 0; i < node2.defaultable.length; i++)
|
|
177622
|
-
|
|
177280
|
+
cacheKey3 += node2.defaultable[i].defaultValueMorphRef;
|
|
177623
177281
|
if (node2.sequence?.defaultValueMorphsReference)
|
|
177624
|
-
|
|
177282
|
+
cacheKey3 += node2.sequence?.defaultValueMorphsReference;
|
|
177625
177283
|
if (node2.undeclared === "delete") {
|
|
177626
|
-
|
|
177284
|
+
cacheKey3 += "delete !(";
|
|
177627
177285
|
if (node2.required)
|
|
177628
177286
|
for (const n of node2.required)
|
|
177629
|
-
|
|
177287
|
+
cacheKey3 += n.compiledKey + " | ";
|
|
177630
177288
|
if (node2.optional)
|
|
177631
177289
|
for (const n of node2.optional)
|
|
177632
|
-
|
|
177290
|
+
cacheKey3 += n.compiledKey + " | ";
|
|
177633
177291
|
if (node2.index)
|
|
177634
177292
|
for (const index of node2.index)
|
|
177635
|
-
|
|
177293
|
+
cacheKey3 += index.signature.id + " | ";
|
|
177636
177294
|
if (node2.sequence) {
|
|
177637
177295
|
if (node2.sequence.maxLength === null)
|
|
177638
|
-
|
|
177296
|
+
cacheKey3 += intrinsic.nonNegativeIntegerString.id;
|
|
177639
177297
|
else {
|
|
177640
177298
|
for (let i = 0; i < node2.sequence.tuple.length; i++)
|
|
177641
|
-
|
|
177299
|
+
cacheKey3 += i + " | ";
|
|
177642
177300
|
}
|
|
177643
177301
|
}
|
|
177644
|
-
|
|
177302
|
+
cacheKey3 += ")";
|
|
177645
177303
|
}
|
|
177646
|
-
return
|
|
177304
|
+
return cacheKey3;
|
|
177647
177305
|
};
|
|
177648
177306
|
var getPossibleMorph = (node2) => {
|
|
177649
|
-
const
|
|
177650
|
-
if (!
|
|
177307
|
+
const cacheKey3 = constructStructuralMorphCacheKey(node2);
|
|
177308
|
+
if (!cacheKey3)
|
|
177651
177309
|
return void 0;
|
|
177652
|
-
if (defaultableMorphsCache2[
|
|
177653
|
-
return defaultableMorphsCache2[
|
|
177310
|
+
if (defaultableMorphsCache2[cacheKey3])
|
|
177311
|
+
return defaultableMorphsCache2[cacheKey3];
|
|
177654
177312
|
const $arkStructuralMorph = (data, ctx) => {
|
|
177655
177313
|
for (let i = 0; i < node2.defaultable.length; i++) {
|
|
177656
177314
|
if (!(node2.defaultable[i].key in data))
|
|
@@ -177667,7 +177325,7 @@ var getPossibleMorph = (node2) => {
|
|
|
177667
177325
|
}
|
|
177668
177326
|
return data;
|
|
177669
177327
|
};
|
|
177670
|
-
return defaultableMorphsCache2[
|
|
177328
|
+
return defaultableMorphsCache2[cacheKey3] = $arkStructuralMorph;
|
|
177671
177329
|
};
|
|
177672
177330
|
var precompileMorphs = (js, node2) => {
|
|
177673
177331
|
const requiresContext = node2.defaultable.some((node3) => node3.defaultValueMorph.length === 2) || node2.sequence?.defaultValueMorphs.some((morph) => morph.length === 2);
|
|
@@ -180072,10 +179730,22 @@ var schema = ark.schema;
|
|
|
180072
179730
|
var define2 = ark.define;
|
|
180073
179731
|
var declare = ark.declare;
|
|
180074
179732
|
|
|
180075
|
-
// node_modules/.pnpm/yes@0.
|
|
180076
|
-
import { performance as performance8 } from "node:perf_hooks";
|
|
179733
|
+
// node_modules/.pnpm/yes@0.2.3_typescript@5.9.3/node_modules/yes/dist/index.js
|
|
180077
179734
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
180078
179735
|
|
|
179736
|
+
// node_modules/.pnpm/yes@0.2.3_typescript@5.9.3/node_modules/yes/dist/cache/adapter.js
|
|
179737
|
+
var AdapterError = class extends Error {
|
|
179738
|
+
method;
|
|
179739
|
+
/** the full store key, or the op's prefix when the call covered many keys. never the raw input. */
|
|
179740
|
+
key;
|
|
179741
|
+
constructor(method, key, cause) {
|
|
179742
|
+
super(`cache ${method} failed for ${key}: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
|
|
179743
|
+
this.name = "AdapterError";
|
|
179744
|
+
this.method = method;
|
|
179745
|
+
this.key = key;
|
|
179746
|
+
}
|
|
179747
|
+
};
|
|
179748
|
+
|
|
180079
179749
|
// node_modules/.pnpm/lru-cache@11.5.3/node_modules/lru-cache/dist/esm/node/index.min.js
|
|
180080
179750
|
import { tracingChannel as G, channel as P } from "node:diagnostics_channel";
|
|
180081
179751
|
var S = P("lru-cache:metrics");
|
|
@@ -180661,72 +180331,87 @@ var I = class d2 {
|
|
|
180661
180331
|
}
|
|
180662
180332
|
};
|
|
180663
180333
|
|
|
180664
|
-
// node_modules/.pnpm/yes@0.
|
|
180665
|
-
|
|
180666
|
-
|
|
180667
|
-
|
|
180668
|
-
|
|
180669
|
-
|
|
180670
|
-
|
|
180671
|
-
|
|
180672
|
-
|
|
180673
|
-
|
|
180674
|
-
|
|
180675
|
-
|
|
180676
|
-
|
|
180677
|
-
|
|
180678
|
-
|
|
180679
|
-
});
|
|
180680
|
-
} catch (error49) {
|
|
180681
|
-
throw new Error(`cache key cannot be hashed: ${error49 instanceof Error ? error49.message : String(error49)}`);
|
|
180682
|
-
}
|
|
180334
|
+
// node_modules/.pnpm/yes@0.2.3_typescript@5.9.3/node_modules/yes/dist/cache/memory.js
|
|
180335
|
+
function memory({ maxItems = 1e3 } = {}) {
|
|
180336
|
+
const store = new I({ max: maxItems });
|
|
180337
|
+
return {
|
|
180338
|
+
get: (key) => store.get(key),
|
|
180339
|
+
peek: (key) => store.peek(key),
|
|
180340
|
+
// the TTL rides on each entry, so ops with different lifetimes can share one store
|
|
180341
|
+
set: (key, entry, ttlMs) => store.set(key, entry, { ttl: ttlMs }),
|
|
180342
|
+
delete: (keys) => {
|
|
180343
|
+
for (const key of keys)
|
|
180344
|
+
store.delete(key);
|
|
180345
|
+
},
|
|
180346
|
+
// a snapshot, so deleting while iterating is safe
|
|
180347
|
+
list: (prefix) => [...store.entries()].filter(([key]) => key.startsWith(prefix))
|
|
180348
|
+
};
|
|
180683
180349
|
}
|
|
180684
|
-
|
|
180685
|
-
|
|
180686
|
-
|
|
180350
|
+
|
|
180351
|
+
// node_modules/.pnpm/yes@0.2.3_typescript@5.9.3/node_modules/yes/dist/key.js
|
|
180352
|
+
import { hash as hash2 } from "node:crypto";
|
|
180353
|
+
function hashKey(value2) {
|
|
180354
|
+
return hash2("sha1", canonical(value2));
|
|
180687
180355
|
}
|
|
180688
|
-
|
|
180689
|
-
|
|
180690
|
-
if (error49 === null || typeof error49 !== "object")
|
|
180691
|
-
return void 0;
|
|
180692
|
-
const source = error49;
|
|
180693
|
-
const headers = source.response?.headers ?? source.headers;
|
|
180694
|
-
if (headers === null || typeof headers !== "object")
|
|
180695
|
-
return void 0;
|
|
180696
|
-
return headers;
|
|
180356
|
+
function canonical(value2) {
|
|
180357
|
+
return serialize(value2, 0);
|
|
180697
180358
|
}
|
|
180698
|
-
function
|
|
180699
|
-
|
|
180700
|
-
|
|
180701
|
-
|
|
180702
|
-
|
|
180703
|
-
|
|
180704
|
-
|
|
180705
|
-
|
|
180706
|
-
|
|
180707
|
-
|
|
180708
|
-
|
|
180709
|
-
|
|
180710
|
-
|
|
180711
|
-
|
|
180712
|
-
|
|
180713
|
-
|
|
180714
|
-
|
|
180715
|
-
|
|
180716
|
-
|
|
180717
|
-
|
|
180359
|
+
function cacheKey2(value2) {
|
|
180360
|
+
if (value2 === null)
|
|
180361
|
+
throw new Error("null cannot be part of a cache key");
|
|
180362
|
+
return value2 === void 0 ? "~void" : hashKey(value2);
|
|
180363
|
+
}
|
|
180364
|
+
function serialize(value2, depth) {
|
|
180365
|
+
switch (typeof value2) {
|
|
180366
|
+
case "number":
|
|
180367
|
+
if (Number.isFinite(value2))
|
|
180368
|
+
return String(value2);
|
|
180369
|
+
throw new Error(`${value2} cannot be part of a cache key`);
|
|
180370
|
+
case "string":
|
|
180371
|
+
case "boolean":
|
|
180372
|
+
return JSON.stringify(value2);
|
|
180373
|
+
case "undefined":
|
|
180374
|
+
throw new Error("undefined cannot be part of a cache key, except as an object property");
|
|
180375
|
+
case "object":
|
|
180376
|
+
break;
|
|
180377
|
+
default:
|
|
180378
|
+
throw new Error(`a ${typeof value2} cannot be part of a cache key`);
|
|
180718
180379
|
}
|
|
180719
|
-
|
|
180380
|
+
if (value2 === null)
|
|
180381
|
+
return "null";
|
|
180382
|
+
if (depth++ === 64)
|
|
180383
|
+
throw new Error("an input nested more than 64 levels deep, or circular");
|
|
180384
|
+
if (Array.isArray(value2)) {
|
|
180385
|
+
let out2 = "[";
|
|
180386
|
+
for (let i = 0; i < value2.length; i++)
|
|
180387
|
+
out2 += `${i ? "," : ""}${serialize(value2[i], depth)}`;
|
|
180388
|
+
return `${out2}]`;
|
|
180389
|
+
}
|
|
180390
|
+
const proto = Object.getPrototypeOf(value2);
|
|
180391
|
+
if (proto !== Object.prototype && proto !== null) {
|
|
180392
|
+
const name = proto.constructor?.name || "class instance";
|
|
180393
|
+
throw new Error(`a ${name} cannot be part of a cache key: only JSON data can`);
|
|
180394
|
+
}
|
|
180395
|
+
let out = "";
|
|
180396
|
+
for (const key of Object.keys(value2).sort()) {
|
|
180397
|
+
const v = value2[key];
|
|
180398
|
+
if (v !== void 0)
|
|
180399
|
+
out += `${out ? "," : ""}${JSON.stringify(key)}:${serialize(v, depth)}`;
|
|
180400
|
+
}
|
|
180401
|
+
return `{${out}}`;
|
|
180402
|
+
}
|
|
180403
|
+
|
|
180404
|
+
// node_modules/.pnpm/yes@0.2.3_typescript@5.9.3/node_modules/yes/dist/index.js
|
|
180405
|
+
function delay2(schedule, attempt) {
|
|
180406
|
+
const d3 = schedule[attempt - 1];
|
|
180407
|
+
return d3 === void 0 ? -1 : Math.round(d3 / 2 + Math.random() * d3 / 2);
|
|
180720
180408
|
}
|
|
180721
180409
|
var ValidationError = class extends Error {
|
|
180722
|
-
|
|
180723
|
-
issues;
|
|
180410
|
+
name = "ValidationError";
|
|
180724
180411
|
constructor(result) {
|
|
180725
|
-
const
|
|
180726
|
-
super(message);
|
|
180727
|
-
this.
|
|
180728
|
-
this.result = result;
|
|
180729
|
-
this.issues = result.issues;
|
|
180412
|
+
const { message } = result;
|
|
180413
|
+
super(typeof message === "string" ? message : `validation failed: ${result.issues.map((i) => i.message).join(", ")}`);
|
|
180414
|
+
Object.assign(this, { result, issues: result.issues });
|
|
180730
180415
|
}
|
|
180731
180416
|
};
|
|
180732
180417
|
async function assertSchema(schema2, value2) {
|
|
@@ -180735,204 +180420,212 @@ async function assertSchema(schema2, value2) {
|
|
|
180735
180420
|
throw new ValidationError(result);
|
|
180736
180421
|
return result.value;
|
|
180737
180422
|
}
|
|
180738
|
-
|
|
180739
|
-
|
|
180740
|
-
|
|
180741
|
-
|
|
180742
|
-
|
|
180743
|
-
|
|
180744
|
-
|
|
180745
|
-
|
|
180746
|
-
|
|
180747
|
-
|
|
180748
|
-
|
|
180749
|
-
|
|
180750
|
-
|
|
180751
|
-
|
|
180752
|
-
|
|
180753
|
-
|
|
180754
|
-
const
|
|
180755
|
-
|
|
180756
|
-
}
|
|
180757
|
-
|
|
180758
|
-
|
|
180759
|
-
|
|
180760
|
-
|
|
180761
|
-
|
|
180762
|
-
|
|
180763
|
-
const keyMap = shouldCache ? new I({
|
|
180764
|
-
max: options.maxItems ?? 1e3,
|
|
180765
|
-
ttl: options.ttl
|
|
180766
|
-
}) : null;
|
|
180767
|
-
const inFlightPromises = /* @__PURE__ */ new Map();
|
|
180768
|
-
const namePrefix = options.name ? `[${options.name}] ` : "";
|
|
180769
|
-
const defaultCacheHit = options.cacheHit === null ? () => {
|
|
180770
|
-
} : options.cacheHit ?? (() => {
|
|
180771
|
-
if (options.name && shouldCache)
|
|
180772
|
-
log2.prod(`${namePrefix}cache hit`);
|
|
180773
|
-
});
|
|
180774
|
-
const defaultCacheMiss = options.cacheMiss === null ? () => {
|
|
180775
|
-
} : options.cacheMiss ?? (() => {
|
|
180776
|
-
if (options.name && shouldCache)
|
|
180777
|
-
log2.prod(`${namePrefix}cache miss`);
|
|
180778
|
-
});
|
|
180779
|
-
const keyInput = (value2) => {
|
|
180780
|
-
if (!schemas.input)
|
|
180781
|
-
return value2;
|
|
180782
|
-
const result = schemas.input["~standard"].validate(value2);
|
|
180783
|
-
return result instanceof Promise || result.issues ? value2 : result.value;
|
|
180784
|
-
};
|
|
180785
|
-
const cachedFn = async (rawInput, ctx) => {
|
|
180786
|
-
const input = schemas.input ? await assertSchema(schemas.input, rawInput) : rawInput;
|
|
180787
|
-
let key;
|
|
180423
|
+
function op(options) {
|
|
180424
|
+
return build3(options, true);
|
|
180425
|
+
}
|
|
180426
|
+
function build3(options, cacheMethods) {
|
|
180427
|
+
const { name, input: inputSchema, output: outputSchema, run, dedupe, ttl, cache: adapter } = options;
|
|
180428
|
+
const { retry } = options;
|
|
180429
|
+
const delayFor = Array.isArray(retry) ? (_, attempt) => delay2(retry, attempt) : retry;
|
|
180430
|
+
if (ttl !== void 0 && typeof ttl !== "function" && !isLifetime(ttl)) {
|
|
180431
|
+
throw new TypeError(`yes.op: ttl must be a positive number of milliseconds, got ${ttl}`);
|
|
180432
|
+
}
|
|
180433
|
+
const lifetime = typeof ttl === "function" ? ttl : () => ttl;
|
|
180434
|
+
if (adapter && (!name || name.includes(":"))) {
|
|
180435
|
+
throw new TypeError(`yes.op: an op with a cache adapter needs a name without ":", got ${JSON.stringify(name)}`);
|
|
180436
|
+
}
|
|
180437
|
+
if (adapter && ttl === void 0)
|
|
180438
|
+
throw new TypeError(`yes.op: a cache adapter does nothing without a ttl`);
|
|
180439
|
+
const store = ttl === void 0 ? void 0 : adapter ?? memory({ maxItems: options.maxItems });
|
|
180440
|
+
const prefix = adapter ? `yes:${name}:` : "";
|
|
180441
|
+
const label = name ? `[${name}] ` : "";
|
|
180442
|
+
const logCache = (event) => () => {
|
|
180443
|
+
if (name && store && process.env.NODE_ENV === "production")
|
|
180444
|
+
console.log(`${label}cache ${event}`);
|
|
180445
|
+
};
|
|
180446
|
+
const { cacheHit = logCache("hit"), cacheMiss = logCache("miss") } = options;
|
|
180447
|
+
const keyOf = (input) => {
|
|
180788
180448
|
try {
|
|
180789
|
-
|
|
180449
|
+
return cacheKey2(input);
|
|
180790
180450
|
} catch (error49) {
|
|
180791
|
-
|
|
180792
|
-
throw new Error(`failed to create cache key${namePrefix ? ` for ${options.name}` : ""}: ${errorMessage}`);
|
|
180793
|
-
}
|
|
180794
|
-
const startTime = performance8.now();
|
|
180795
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
180796
|
-
log2.debug(`${namePrefix}[${timestamp}] cache lookup started`, { key });
|
|
180797
|
-
if (shouldCache && lruCache) {
|
|
180798
|
-
const cached4 = lruCache.get(key);
|
|
180799
|
-
if (cached4 !== void 0) {
|
|
180800
|
-
if (keyMap?.get(key) === void 0)
|
|
180801
|
-
keyMap?.set(key, input);
|
|
180802
|
-
const runtime = performance8.now() - startTime;
|
|
180803
|
-
log2.debug(`${namePrefix}[${timestamp}] cache hit (from lru)`, {
|
|
180804
|
-
key,
|
|
180805
|
-
runtime: `${Math.round(runtime)}ms`
|
|
180806
|
-
});
|
|
180807
|
-
defaultCacheHit(key);
|
|
180808
|
-
return cached4;
|
|
180809
|
-
}
|
|
180451
|
+
throw new Error(`${label}${error49.message}. dedupe and ttl key the input, and a query always dedupes; a write is yes.mutation, which never keys.`, { cause: error49 });
|
|
180810
180452
|
}
|
|
180811
|
-
|
|
180812
|
-
|
|
180813
|
-
|
|
180814
|
-
|
|
180815
|
-
|
|
180816
|
-
|
|
180817
|
-
|
|
180818
|
-
|
|
180819
|
-
|
|
180820
|
-
|
|
180821
|
-
|
|
180822
|
-
|
|
180823
|
-
|
|
180824
|
-
|
|
180825
|
-
|
|
180826
|
-
|
|
180827
|
-
|
|
180828
|
-
|
|
180829
|
-
|
|
180830
|
-
|
|
180831
|
-
|
|
180832
|
-
lruCache.set(key, result);
|
|
180833
|
-
keyMap?.set(key, input);
|
|
180834
|
-
}
|
|
180835
|
-
log2.debug(`${namePrefix}[${timestamp}] function executed successfully`, {
|
|
180836
|
-
key,
|
|
180837
|
-
runtime: `${Math.round(execRuntime2)}ms`,
|
|
180838
|
-
attempt: attempt + 1,
|
|
180839
|
-
cached: shouldCache && result !== null && result !== void 0 && !skip
|
|
180840
|
-
});
|
|
180841
|
-
return result;
|
|
180842
|
-
} catch (error49) {
|
|
180843
|
-
if (error49 instanceof ValidationError || options.rethrow?.(error49))
|
|
180844
|
-
throw error49;
|
|
180845
|
-
lastError = error49;
|
|
180846
|
-
const isLastAttempt = attempt >= retries.length;
|
|
180847
|
-
if (isLastAttempt) {
|
|
180848
|
-
if (namePrefix) {
|
|
180849
|
-
log2.info(`${namePrefix}attempt ${attempt + 1}/${retries.length + 1} failed, no more retries`);
|
|
180850
|
-
log2.info(`${namePrefix}`, { key, error: error49, attempt });
|
|
180851
|
-
} else {
|
|
180852
|
-
log2.info(`attempt ${attempt + 1}/${retries.length + 1} failed, no more retries`);
|
|
180853
|
-
log2.info({ key, error: error49, attempt });
|
|
180854
|
-
}
|
|
180855
|
-
} else {
|
|
180856
|
-
let delay2 = retries[attempt];
|
|
180857
|
-
if (options.retryAfter) {
|
|
180858
|
-
const extract = options.retryAfter === true ? retryAfterMs : options.retryAfter;
|
|
180859
|
-
const hint = extract(error49);
|
|
180860
|
-
if (hint !== void 0) {
|
|
180861
|
-
const cap = options.retryAfterCap ?? DEFAULT_RETRY_AFTER_CAP_MS;
|
|
180862
|
-
delay2 = Math.max(delay2, Math.min(cap, hint));
|
|
180863
|
-
}
|
|
180864
|
-
}
|
|
180865
|
-
delay2 = jitter(delay2);
|
|
180866
|
-
if (namePrefix) {
|
|
180867
|
-
log2.info(`${namePrefix}attempt ${attempt + 1}/${retries.length + 1} failed, retrying in ${delay2}ms`);
|
|
180868
|
-
log2.info(`${namePrefix}`, { key, error: error49, attempt });
|
|
180869
|
-
} else {
|
|
180870
|
-
log2.info(`attempt ${attempt + 1}/${retries.length + 1} failed, retrying in ${delay2}ms`);
|
|
180871
|
-
log2.info({ key, error: error49, attempt });
|
|
180872
|
-
}
|
|
180873
|
-
await sleep2(delay2);
|
|
180453
|
+
};
|
|
180454
|
+
const report = (attempt, message, error49, key) => {
|
|
180455
|
+
console.log(`${label}attempt ${attempt} ${message}`);
|
|
180456
|
+
const data = key === void 0 ? { error: error49, attempt } : { key, error: error49, attempt };
|
|
180457
|
+
console.log(...label ? [label, data] : [data]);
|
|
180458
|
+
};
|
|
180459
|
+
const attempts = async (input, ctx, key, trace) => {
|
|
180460
|
+
for (let attempt = 1; ; attempt++) {
|
|
180461
|
+
try {
|
|
180462
|
+
const returned = await run(input, ctx);
|
|
180463
|
+
const result = outputSchema ? await assertSchema(outputSchema, returned) : returned;
|
|
180464
|
+
trace?.(`run resolved on attempt ${attempt}`);
|
|
180465
|
+
return result;
|
|
180466
|
+
} catch (thrown) {
|
|
180467
|
+
let error49 = thrown;
|
|
180468
|
+
let wait = -1;
|
|
180469
|
+
if (delayFor && !(error49 instanceof ValidationError)) {
|
|
180470
|
+
try {
|
|
180471
|
+
wait = delayFor(error49, attempt);
|
|
180472
|
+
} catch (stop2) {
|
|
180473
|
+
error49 = stop2;
|
|
180874
180474
|
}
|
|
180875
180475
|
}
|
|
180476
|
+
if (wait >= 0) {
|
|
180477
|
+
report(attempt, `failed, retrying in ${wait}ms`, error49, key);
|
|
180478
|
+
await sleep2(wait);
|
|
180479
|
+
continue;
|
|
180480
|
+
}
|
|
180481
|
+
if (attempt > 1)
|
|
180482
|
+
report(attempt, "failed, not retrying", error49, key);
|
|
180483
|
+
trace?.(`run failed on attempt ${attempt}`, { error: error49 });
|
|
180484
|
+
throw error49;
|
|
180876
180485
|
}
|
|
180877
|
-
const execRuntime = performance8.now() - execStartTime;
|
|
180878
|
-
log2.debug(`${namePrefix}[${timestamp}] function failed after all retries`, {
|
|
180879
|
-
key,
|
|
180880
|
-
runtime: `${Math.round(execRuntime)}ms`,
|
|
180881
|
-
attempts: retries.length + 1,
|
|
180882
|
-
error: lastError instanceof Error ? lastError.message : lastError
|
|
180883
|
-
});
|
|
180884
|
-
throw lastError;
|
|
180885
|
-
})();
|
|
180886
|
-
inFlightPromises.set(key, promise2);
|
|
180887
|
-
try {
|
|
180888
|
-
return await promise2;
|
|
180889
|
-
} finally {
|
|
180890
|
-
inFlightPromises.delete(key);
|
|
180891
180486
|
}
|
|
180892
180487
|
};
|
|
180893
|
-
|
|
180894
|
-
|
|
180895
|
-
|
|
180896
|
-
|
|
180488
|
+
const hit = (key, trace, from, value2) => {
|
|
180489
|
+
trace?.(`cache hit (${from})`);
|
|
180490
|
+
cacheHit?.(key);
|
|
180491
|
+
return value2;
|
|
180492
|
+
};
|
|
180493
|
+
const inFlight = /* @__PURE__ */ new Map();
|
|
180494
|
+
const call = async (rawInput, ctx) => {
|
|
180495
|
+
const input = inputSchema ? await assertSchema(inputSchema, rawInput) : rawInput;
|
|
180496
|
+
if (!dedupe && !store)
|
|
180497
|
+
return attempts(input, ctx, void 0, debugTrace(label));
|
|
180498
|
+
const key = keyOf(input);
|
|
180499
|
+
const trace = debugTrace(label, key);
|
|
180500
|
+
const shared = inFlight.get(key);
|
|
180501
|
+
if (shared)
|
|
180502
|
+
return hit(key, trace, "in-flight", shared);
|
|
180503
|
+
const fullKey = prefix + key;
|
|
180504
|
+
const read2 = store && callAdapter("get", fullKey, () => store.get(fullKey));
|
|
180505
|
+
const entry = freshEntry(read2);
|
|
180506
|
+
if (entry)
|
|
180507
|
+
return hit(key, trace, "from store", entry.value);
|
|
180508
|
+
const promise2 = (async () => {
|
|
180509
|
+
const stored = isThenable(read2) ? freshEntry(await read2) : void 0;
|
|
180510
|
+
if (stored)
|
|
180511
|
+
return hit(key, trace, "from store", stored.value);
|
|
180512
|
+
trace?.("cache miss, running");
|
|
180513
|
+
cacheMiss?.(key);
|
|
180514
|
+
const result = await attempts(input, ctx, key, trace);
|
|
180515
|
+
const ms = store && !options.skipCache?.(result) && result != null && !(result instanceof Error) && lifetime(result);
|
|
180516
|
+
if (store && isLifetime(ms)) {
|
|
180517
|
+
const created = Date.now();
|
|
180897
180518
|
try {
|
|
180898
|
-
|
|
180519
|
+
await store.set(fullKey, { value: result, created, expires: created + ms, input }, ms);
|
|
180899
180520
|
} catch (error49) {
|
|
180900
|
-
|
|
180901
|
-
throw new Error(`failed to hash cache key for clear()${namePrefix ? ` in ${options.name}` : ""}: ${errorMessage}`);
|
|
180521
|
+
console.error(`${label}cache write failed, returning the result uncached`, new AdapterError("set", fullKey, error49));
|
|
180902
180522
|
}
|
|
180903
|
-
lruCache.delete(stringKey);
|
|
180904
|
-
keyMap.delete(stringKey);
|
|
180905
|
-
} else {
|
|
180906
|
-
lruCache.clear();
|
|
180907
|
-
keyMap.clear();
|
|
180908
180523
|
}
|
|
180524
|
+
return result;
|
|
180525
|
+
})();
|
|
180526
|
+
if (!dedupe)
|
|
180527
|
+
return promise2;
|
|
180528
|
+
inFlight.set(key, promise2);
|
|
180529
|
+
return promise2.finally(() => inFlight.delete(key));
|
|
180530
|
+
};
|
|
180531
|
+
if (!cacheMethods)
|
|
180532
|
+
return call;
|
|
180533
|
+
const withKey = (input, use) => {
|
|
180534
|
+
const toKey = (result2) => use(prefix + keyOf(result2 && !result2.issues ? result2.value : input));
|
|
180535
|
+
const result = inputSchema?.["~standard"].validate(input);
|
|
180536
|
+
return result instanceof Promise ? result.then(toKey) : toKey(result);
|
|
180537
|
+
};
|
|
180538
|
+
return Object.assign(call, {
|
|
180539
|
+
clear: async (input) => {
|
|
180540
|
+
if (!store)
|
|
180541
|
+
return;
|
|
180542
|
+
if (input === void 0)
|
|
180543
|
+
await sweep(store, prefix, () => true);
|
|
180544
|
+
else
|
|
180545
|
+
await withKey(input, (key) => callAdapter("delete", key, () => store.delete([key])));
|
|
180546
|
+
},
|
|
180547
|
+
// the memory store peeks, so asking whether a key is cached does not change which key is evicted next
|
|
180548
|
+
has: async (input) => !!store && !!freshEntry(await withKey(input, (key) => callAdapter("get", key, () => "peek" in store ? store.peek(key) : store.get(key)))),
|
|
180549
|
+
// not `async`: on the memory store a predicate that throws throws here, not in a promise nobody awaits
|
|
180550
|
+
invalidate: (match3) => {
|
|
180551
|
+
const accepts = typeof match3 === "function" ? match3 : fieldsMatch(match3);
|
|
180552
|
+
return Promise.resolve(store ? sweep(store, prefix, accepts) : 0);
|
|
180909
180553
|
}
|
|
180910
|
-
};
|
|
180911
|
-
|
|
180912
|
-
|
|
180913
|
-
|
|
180914
|
-
|
|
180915
|
-
|
|
180916
|
-
|
|
180917
|
-
|
|
180918
|
-
|
|
180919
|
-
|
|
180920
|
-
|
|
180921
|
-
}
|
|
180922
|
-
|
|
180923
|
-
|
|
180924
|
-
|
|
180554
|
+
});
|
|
180555
|
+
}
|
|
180556
|
+
function query(options) {
|
|
180557
|
+
return op({ ...options, dedupe: true });
|
|
180558
|
+
}
|
|
180559
|
+
function mutation({ dedupe: _dedupe, ttl: _ttl, cache: _cache, ...options }) {
|
|
180560
|
+
return build3(options, false);
|
|
180561
|
+
}
|
|
180562
|
+
function debugTrace(label, key) {
|
|
180563
|
+
if (process.env.LOG_LEVEL !== "debug")
|
|
180564
|
+
return;
|
|
180565
|
+
const prefix = `${label}[${(/* @__PURE__ */ new Date()).toISOString()}]`;
|
|
180566
|
+
const start = performance.now();
|
|
180567
|
+
return (message, data) => console.log(`${prefix} ${message} +${Math.round(performance.now() - start)}ms`, { ...key && { key }, ...data });
|
|
180568
|
+
}
|
|
180569
|
+
var isLifetime = (ms) => typeof ms === "number" && ms > 0 && Number.isFinite(ms);
|
|
180570
|
+
function fieldsMatch(partial3) {
|
|
180571
|
+
const fields = Object.entries(partial3).map(([field, value2]) => [
|
|
180572
|
+
field,
|
|
180573
|
+
value2 === void 0 ? void 0 : canonical(value2)
|
|
180574
|
+
]);
|
|
180575
|
+
return (input) => typeof input === "object" && input !== null && fields.every(([field, value2]) => {
|
|
180576
|
+
const actual = input[field];
|
|
180577
|
+
return actual === void 0 ? value2 === void 0 : value2 !== void 0 && canonical(actual) === value2;
|
|
180578
|
+
});
|
|
180579
|
+
}
|
|
180580
|
+
var isThenable = (value2) => typeof value2?.then === "function";
|
|
180581
|
+
function freshEntry(value2) {
|
|
180582
|
+
return typeof value2?.expires === "number" && value2.expires > Date.now() && "value" in value2 ? value2 : void 0;
|
|
180583
|
+
}
|
|
180584
|
+
function callAdapter(method, key, run) {
|
|
180585
|
+
try {
|
|
180586
|
+
const result = run();
|
|
180587
|
+
if (!isThenable(result))
|
|
180588
|
+
return result;
|
|
180589
|
+
return result.then(void 0, (error49) => {
|
|
180590
|
+
throw new AdapterError(method, key, error49);
|
|
180591
|
+
});
|
|
180592
|
+
} catch (error49) {
|
|
180593
|
+
throw new AdapterError(method, key, error49);
|
|
180594
|
+
}
|
|
180595
|
+
}
|
|
180596
|
+
function sweep(store, prefix, match3) {
|
|
180597
|
+
const purge = (listed2) => {
|
|
180598
|
+
const now = Date.now();
|
|
180599
|
+
const keys = [];
|
|
180925
180600
|
let count = 0;
|
|
180926
|
-
for (const [
|
|
180927
|
-
if (
|
|
180928
|
-
|
|
180929
|
-
|
|
180601
|
+
for (const [key, { input, expires }] of listed2) {
|
|
180602
|
+
if (!(expires > now))
|
|
180603
|
+
keys.push(key);
|
|
180604
|
+
else if (match3(input)) {
|
|
180605
|
+
keys.push(key);
|
|
180930
180606
|
count++;
|
|
180931
180607
|
}
|
|
180932
180608
|
}
|
|
180933
|
-
|
|
180609
|
+
const remove = (from) => {
|
|
180610
|
+
if (from >= keys.length)
|
|
180611
|
+
return count;
|
|
180612
|
+
const deleted = callAdapter("delete", prefix, () => store.delete(keys.slice(from, from + 1e3)));
|
|
180613
|
+
return isThenable(deleted) ? Promise.resolve(deleted).then(() => remove(from + 1e3)) : remove(from + 1e3);
|
|
180614
|
+
};
|
|
180615
|
+
return remove(0);
|
|
180934
180616
|
};
|
|
180935
|
-
|
|
180617
|
+
const listed = callAdapter("list", prefix, () => {
|
|
180618
|
+
const listed2 = store.list(prefix);
|
|
180619
|
+
if (Array.isArray(listed2))
|
|
180620
|
+
return listed2;
|
|
180621
|
+
return (async () => {
|
|
180622
|
+
const items = [];
|
|
180623
|
+
for await (const item of await listed2)
|
|
180624
|
+
items.push(item);
|
|
180625
|
+
return items;
|
|
180626
|
+
})();
|
|
180627
|
+
});
|
|
180628
|
+
return Array.isArray(listed) ? purge(listed) : listed.then(purge);
|
|
180936
180629
|
}
|
|
180937
180630
|
|
|
180938
180631
|
// utils/progressComment.ts
|
|
@@ -182718,7 +182411,7 @@ function ShellTool(ctx) {
|
|
|
182718
182411
|
return tool({
|
|
182719
182412
|
name: "shell",
|
|
182720
182413
|
timeoutMs: 12e4,
|
|
182721
|
-
description: `Execute shell commands securely. Environment is filtered to remove API keys and secrets.
|
|
182414
|
+
description: `Execute shell commands securely.${ctx.payload.shell === "restricted" ? " Environment is filtered to remove API keys and secrets." : ""}
|
|
182722
182415
|
|
|
182723
182416
|
Example: \`shell({ command: "pnpm test", description: "run the test suite" })\`.
|
|
182724
182417
|
|
|
@@ -184563,7 +184256,7 @@ async function fetchWrapper(requestOptions) {
|
|
|
184563
184256
|
"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
|
|
184564
184257
|
);
|
|
184565
184258
|
}
|
|
184566
|
-
const
|
|
184259
|
+
const log2 = requestOptions.request?.log || console;
|
|
184567
184260
|
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
184568
184261
|
const body = isPlainObject8(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
|
|
184569
184262
|
const requestHeaders = Object.fromEntries(
|
|
@@ -184621,7 +184314,7 @@ async function fetchWrapper(requestOptions) {
|
|
|
184621
184314
|
if ("deprecation" in responseHeaders) {
|
|
184622
184315
|
const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
|
|
184623
184316
|
const deprecationLink = matches && matches.pop();
|
|
184624
|
-
|
|
184317
|
+
log2.warn(
|
|
184625
184318
|
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
|
|
184626
184319
|
);
|
|
184627
184320
|
}
|
|
@@ -184759,9 +184452,9 @@ var NON_VARIABLE_OPTIONS = [
|
|
|
184759
184452
|
];
|
|
184760
184453
|
var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
|
|
184761
184454
|
var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
|
184762
|
-
function graphql(request2,
|
|
184455
|
+
function graphql(request2, query2, options) {
|
|
184763
184456
|
if (options) {
|
|
184764
|
-
if (typeof
|
|
184457
|
+
if (typeof query2 === "string" && "query" in options) {
|
|
184765
184458
|
return Promise.reject(
|
|
184766
184459
|
new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
|
|
184767
184460
|
);
|
|
@@ -184775,7 +184468,7 @@ function graphql(request2, query, options) {
|
|
|
184775
184468
|
);
|
|
184776
184469
|
}
|
|
184777
184470
|
}
|
|
184778
|
-
const parsedOptions = typeof
|
|
184471
|
+
const parsedOptions = typeof query2 === "string" ? Object.assign({ query: query2 }, options) : query2;
|
|
184779
184472
|
const requestOptions = Object.keys(
|
|
184780
184473
|
parsedOptions
|
|
184781
184474
|
).reduce((result, key) => {
|
|
@@ -184810,8 +184503,8 @@ function graphql(request2, query, options) {
|
|
|
184810
184503
|
}
|
|
184811
184504
|
function withDefaults3(request2, newDefaults) {
|
|
184812
184505
|
const newRequest2 = request2.defaults(newDefaults);
|
|
184813
|
-
const newApi = (
|
|
184814
|
-
return graphql(newRequest2,
|
|
184506
|
+
const newApi = (query2, options) => {
|
|
184507
|
+
return graphql(newRequest2, query2, options);
|
|
184815
184508
|
};
|
|
184816
184509
|
return Object.assign(newApi, {
|
|
184817
184510
|
defaults: withDefaults3.bind(null, newRequest2),
|
|
@@ -187655,16 +187348,17 @@ function translateIdTokenError(error49) {
|
|
|
187655
187348
|
if (!status) return error49;
|
|
187656
187349
|
return new TokenExchangeError(Number(status), error49.message);
|
|
187657
187350
|
}
|
|
187658
|
-
var mintIdToken =
|
|
187659
|
-
async () => {
|
|
187351
|
+
var mintIdToken = query({
|
|
187352
|
+
run: async () => {
|
|
187660
187353
|
try {
|
|
187661
187354
|
return await core4.getIDToken(OIDC_AUDIENCE);
|
|
187662
187355
|
} catch (error49) {
|
|
187663
187356
|
throw translateIdTokenError(error49);
|
|
187664
187357
|
}
|
|
187665
187358
|
},
|
|
187666
|
-
|
|
187667
|
-
|
|
187359
|
+
ttl: 6e4,
|
|
187360
|
+
name: "OIDC ID token"
|
|
187361
|
+
});
|
|
187668
187362
|
async function acquireTokenViaOIDC(opts) {
|
|
187669
187363
|
const oidcToken = opts?.oidc ? await fetchIdTokenFromStash(opts.oidc) : await mintIdToken();
|
|
187670
187364
|
const repos = [...opts?.repos ?? []];
|
|
@@ -187822,10 +187516,10 @@ function isTransientTokenError(error49) {
|
|
|
187822
187516
|
}
|
|
187823
187517
|
async function acquireNewToken(opts) {
|
|
187824
187518
|
if (opts?.oidc || isOIDCAvailable()) {
|
|
187825
|
-
return await
|
|
187519
|
+
return await mutation({
|
|
187520
|
+
run: () => acquireTokenViaOIDC(opts),
|
|
187826
187521
|
name: "token exchange",
|
|
187827
|
-
|
|
187828
|
-
rethrow: (error49) => !isTransientTokenError(error49)
|
|
187522
|
+
retry: (error49, attempt) => isTransientTokenError(error49) ? delay2([1e3, 2e3], attempt) : -1
|
|
187829
187523
|
})();
|
|
187830
187524
|
}
|
|
187831
187525
|
if (process.env.GITHUB_ACTIONS === "true") {
|
|
@@ -188159,19 +187853,19 @@ async function pushWithRetry(args2, token, refreshGitToken, cwd = process.cwd())
|
|
|
188159
187853
|
if ((kind === "transient" || kind === "transient-auth") && attempt < TRANSIENT_RETRY_DELAYS_MS.length) {
|
|
188160
187854
|
if (kind === "transient-auth" && refreshGitToken) {
|
|
188161
187855
|
currentToken = await refreshGitToken(currentToken);
|
|
188162
|
-
const
|
|
187856
|
+
const delay4 = Math.round(1e3 * (0.75 + Math.random() * 0.5));
|
|
188163
187857
|
log.info(
|
|
188164
|
-
`push attempt ${attempt + 1} failed (auth), re-minted token, retrying in ${
|
|
187858
|
+
`push attempt ${attempt + 1} failed (auth), re-minted token, retrying in ${delay4}ms: ${msg.slice(0, 300)}`
|
|
188165
187859
|
);
|
|
188166
|
-
await new Promise((r) => setTimeout(r,
|
|
187860
|
+
await new Promise((r) => setTimeout(r, delay4));
|
|
188167
187861
|
continue;
|
|
188168
187862
|
}
|
|
188169
187863
|
const baseDelay = TRANSIENT_RETRY_DELAYS_MS[attempt] ?? 5e3;
|
|
188170
|
-
const
|
|
187864
|
+
const delay3 = Math.round(baseDelay * (0.75 + Math.random() * 0.5));
|
|
188171
187865
|
log.info(
|
|
188172
|
-
`push attempt ${attempt + 1} failed (transient), retrying in ${
|
|
187866
|
+
`push attempt ${attempt + 1} failed (transient), retrying in ${delay3}ms: ${msg.slice(0, 300)}`
|
|
188173
187867
|
);
|
|
188174
|
-
await new Promise((r) => setTimeout(r,
|
|
187868
|
+
await new Promise((r) => setTimeout(r, delay3));
|
|
188175
187869
|
continue;
|
|
188176
187870
|
}
|
|
188177
187871
|
throw err;
|
|
@@ -188896,6 +188590,112 @@ function isTransientOctokitError(error49) {
|
|
|
188896
188590
|
return isTransientNetworkError(error49);
|
|
188897
188591
|
}
|
|
188898
188592
|
|
|
188593
|
+
// utils/runContext.ts
|
|
188594
|
+
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
188595
|
+
var START_KEY = randomUUID5();
|
|
188596
|
+
var defaultSettings = {
|
|
188597
|
+
model: null,
|
|
188598
|
+
effort: null,
|
|
188599
|
+
modes: [],
|
|
188600
|
+
setupScript: null,
|
|
188601
|
+
postCheckoutScript: null,
|
|
188602
|
+
prepushScript: null,
|
|
188603
|
+
stopScript: null,
|
|
188604
|
+
push: "restricted",
|
|
188605
|
+
shell: "restricted",
|
|
188606
|
+
prApproveEnabled: false,
|
|
188607
|
+
reviewDrafts: false,
|
|
188608
|
+
autoMergeEnabled: false,
|
|
188609
|
+
codexAgent: false,
|
|
188610
|
+
signedCommits: false,
|
|
188611
|
+
repoIntelligence: false,
|
|
188612
|
+
progressComments: true,
|
|
188613
|
+
statusChecks: true,
|
|
188614
|
+
approvalCheck: false,
|
|
188615
|
+
modeInstructions: {},
|
|
188616
|
+
learnings: null,
|
|
188617
|
+
learningsHeadings: [],
|
|
188618
|
+
envAllowlist: null,
|
|
188619
|
+
xrepoBrief: null,
|
|
188620
|
+
xrepoLearnings: null,
|
|
188621
|
+
xrepoLearningsHeadings: []
|
|
188622
|
+
};
|
|
188623
|
+
var defaultRunContext = {
|
|
188624
|
+
settings: defaultSettings,
|
|
188625
|
+
apiToken: "",
|
|
188626
|
+
oss: false,
|
|
188627
|
+
plan: "none"
|
|
188628
|
+
};
|
|
188629
|
+
var unknownSecretsRunContext = {
|
|
188630
|
+
...defaultRunContext,
|
|
188631
|
+
secretsUnavailable: true
|
|
188632
|
+
};
|
|
188633
|
+
async function fetchRunContext(params) {
|
|
188634
|
+
const timeoutMs = 3e4;
|
|
188635
|
+
const controller = new AbortController();
|
|
188636
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
188637
|
+
try {
|
|
188638
|
+
const headers = {
|
|
188639
|
+
Authorization: `Bearer ${params.token}`,
|
|
188640
|
+
"X-Pullfrog-Credential-Pools": "1"
|
|
188641
|
+
};
|
|
188642
|
+
if (params.oidcToken) {
|
|
188643
|
+
headers["X-GitHub-OIDC-Token"] = params.oidcToken;
|
|
188644
|
+
}
|
|
188645
|
+
const query2 = new URLSearchParams({ start: START_KEY });
|
|
188646
|
+
if (params.runType) query2.set("type", params.runType);
|
|
188647
|
+
if (params.plainPrompt) query2.set("prompt", "plain");
|
|
188648
|
+
if (params.routedTier) query2.set("tier", params.routedTier);
|
|
188649
|
+
const search2 = query2.toString();
|
|
188650
|
+
const response = await apiFetch({
|
|
188651
|
+
path: `/api/repo/${params.repoContext.owner}/${params.repoContext.name}/run-context${search2 ? `?${search2}` : ""}`,
|
|
188652
|
+
headers,
|
|
188653
|
+
signal: controller.signal
|
|
188654
|
+
});
|
|
188655
|
+
clearTimeout(timeoutId);
|
|
188656
|
+
if (response.status === 402) {
|
|
188657
|
+
const body = await response.json().catch(() => null);
|
|
188658
|
+
const reason = typeof body === "object" && body !== null && "reason" in body ? body.reason : null;
|
|
188659
|
+
const commercialRefused = reason === "subscription_unpaid" || reason === "subscription_ended" ? reason : "commercial";
|
|
188660
|
+
return { ...defaultRunContext, commercialRefused };
|
|
188661
|
+
}
|
|
188662
|
+
if (!response.ok) {
|
|
188663
|
+
return response.status >= 500 ? unknownSecretsRunContext : defaultRunContext;
|
|
188664
|
+
}
|
|
188665
|
+
const data = await response.json();
|
|
188666
|
+
if (data === null) {
|
|
188667
|
+
return defaultRunContext;
|
|
188668
|
+
}
|
|
188669
|
+
return {
|
|
188670
|
+
settings: {
|
|
188671
|
+
...defaultSettings,
|
|
188672
|
+
...data.settings,
|
|
188673
|
+
modes: data.settings?.modes ?? [],
|
|
188674
|
+
setupScript: data.settings?.setupScript ?? null,
|
|
188675
|
+
postCheckoutScript: data.settings?.postCheckoutScript ?? null,
|
|
188676
|
+
prepushScript: data.settings?.prepushScript ?? null,
|
|
188677
|
+
stopScript: data.settings?.stopScript ?? null,
|
|
188678
|
+
learningsHeadings: data.settings?.learningsHeadings ?? [],
|
|
188679
|
+
xrepoBrief: data.settings?.xrepoBrief ?? null,
|
|
188680
|
+
xrepoLearnings: data.settings?.xrepoLearnings ?? null,
|
|
188681
|
+
xrepoLearningsHeadings: data.settings?.xrepoLearningsHeadings ?? []
|
|
188682
|
+
},
|
|
188683
|
+
apiToken: data.apiToken,
|
|
188684
|
+
oss: data.oss ?? false,
|
|
188685
|
+
plan: data.plan ?? "none",
|
|
188686
|
+
proxyModel: data.proxyModel,
|
|
188687
|
+
dbSecrets: data.dbSecrets,
|
|
188688
|
+
credentialAccess: data.credentialAccess,
|
|
188689
|
+
secretsUnavailable: data.secretsUnavailable,
|
|
188690
|
+
routerUnfunded: data.routerUnfunded,
|
|
188691
|
+
trialFallback: data.trialFallback
|
|
188692
|
+
};
|
|
188693
|
+
} catch {
|
|
188694
|
+
clearTimeout(timeoutId);
|
|
188695
|
+
return unknownSecretsRunContext;
|
|
188696
|
+
}
|
|
188697
|
+
}
|
|
188698
|
+
|
|
188899
188699
|
// utils/patchWorkflowRunFields.ts
|
|
188900
188700
|
var STRING_KEYS = [
|
|
188901
188701
|
"prNodeId",
|
|
@@ -188914,6 +188714,7 @@ var NUMBER_KEYS = [
|
|
|
188914
188714
|
"cacheWriteTokens",
|
|
188915
188715
|
"costUsd"
|
|
188916
188716
|
];
|
|
188717
|
+
var FLAG_KEYS = ["reviewSkipped"];
|
|
188917
188718
|
async function patchWorkflowRunFields(ctx, fields) {
|
|
188918
188719
|
if (ctx.runId === void 0 || !ctx.apiToken) return;
|
|
188919
188720
|
if (ctx.toolState.workflowRunUnclaimed) return;
|
|
@@ -188930,10 +188731,17 @@ async function patchWorkflowRunFields(ctx, fields) {
|
|
|
188930
188731
|
body[key] = value2;
|
|
188931
188732
|
}
|
|
188932
188733
|
}
|
|
188734
|
+
for (const key of FLAG_KEYS) {
|
|
188735
|
+
if (fields[key]) body[key] = true;
|
|
188736
|
+
}
|
|
188737
|
+
if (fields.succeeded !== void 0) body.succeeded = fields.succeeded;
|
|
188933
188738
|
if (Object.keys(body).length === 0) return;
|
|
188739
|
+
body.startKey = START_KEY;
|
|
188740
|
+
const runAttempt = Number(process.env.GITHUB_RUN_ATTEMPT);
|
|
188741
|
+
if (Number.isInteger(runAttempt) && runAttempt >= 1) body.runAttempt = runAttempt;
|
|
188934
188742
|
try {
|
|
188935
|
-
await
|
|
188936
|
-
async () => {
|
|
188743
|
+
await mutation({
|
|
188744
|
+
run: async () => {
|
|
188937
188745
|
const response = await apiFetch({
|
|
188938
188746
|
path: `/api/workflow-run/${ctx.runId}`,
|
|
188939
188747
|
method: "PATCH",
|
|
@@ -188944,17 +188752,18 @@ async function patchWorkflowRunFields(ctx, fields) {
|
|
|
188944
188752
|
body: JSON.stringify(body),
|
|
188945
188753
|
signal: AbortSignal.timeout(1e4)
|
|
188946
188754
|
});
|
|
188947
|
-
if (response.status === 404)
|
|
188755
|
+
if (response.status === 404) {
|
|
188756
|
+
ctx.toolState.workflowRunUnclaimed = true;
|
|
188757
|
+
log.info(`\xBB Pullfrog has no record of run ${ctx.runId}; skipping run metadata updates`);
|
|
188758
|
+
return;
|
|
188759
|
+
}
|
|
188948
188760
|
if (!response.ok) throw new Error(`PATCH workflow-run: ${response.status}`);
|
|
188949
188761
|
},
|
|
188950
|
-
|
|
188951
|
-
|
|
188952
|
-
|
|
188953
|
-
|
|
188954
|
-
|
|
188955
|
-
rethrow: (error49) => !isTransientNetworkError(error49)
|
|
188956
|
-
}
|
|
188957
|
-
)();
|
|
188762
|
+
// only retry transient network errors; explicit HTTP failures throw
|
|
188763
|
+
// a status-bearing message and should fail fast.
|
|
188764
|
+
retry: (error49, attempt) => isTransientNetworkError(error49) ? delay2([2e3, 4e3], attempt) : -1,
|
|
188765
|
+
name: "patchWorkflowRunFields"
|
|
188766
|
+
})();
|
|
188958
188767
|
} catch (error49) {
|
|
188959
188768
|
log.warning(`patchWorkflowRunFields failed: ${error49}`);
|
|
188960
188769
|
}
|
|
@@ -189127,6 +188936,9 @@ var ReportProgress = type({
|
|
|
189127
188936
|
body: type.string.describe("the progress update content to share"),
|
|
189128
188937
|
"target_plan_comment?": type("boolean").describe(
|
|
189129
188938
|
"for revising an existing plan comment ONLY. set to true only when the PlanEdit checklist from select_mode tells you to (i.e. a prior plan comment was found for this issue). NEVER set on the initial plan post \u2014 the initial plan reuses the run's progress comment and is posted by calling report_progress without this flag."
|
|
188939
|
+
),
|
|
188940
|
+
"no_review_needed?": type("boolean").describe(
|
|
188941
|
+
"IncrementalReview only: true when you judged the new commits need no review, never for a blocker."
|
|
189130
188942
|
)
|
|
189131
188943
|
});
|
|
189132
188944
|
async function reportProgress(ctx, params) {
|
|
@@ -189254,6 +189066,9 @@ function ReportProgressTool(ctx) {
|
|
|
189254
189066
|
description: 'Share progress on the associated GitHub issue/PR. The first call creates a comment; subsequent calls update it in place. Example: `report_progress({ body: "Implemented the auth check and added tests." })`. Call this at the end of every run with a brief final summary (1-3 sentences) unless the mode guidance instructs otherwise. The current task list is automatically appended in a collapsible section \u2014 do not restate individual steps.',
|
|
189255
189067
|
parameters: ReportProgress,
|
|
189256
189068
|
execute: execute(async (params) => {
|
|
189069
|
+
if (params.no_review_needed) {
|
|
189070
|
+
ctx.toolState.noReviewNeededSha = primaryRepoState(ctx.toolState).checkoutSha;
|
|
189071
|
+
}
|
|
189257
189072
|
if (ctx.toolState.standaloneCommentId !== void 0 && !params.target_plan_comment) {
|
|
189258
189073
|
ctx.toolState.lastProgressBody = params.body;
|
|
189259
189074
|
return {
|
|
@@ -189785,18 +189600,15 @@ function CreatePullRequestReviewTool(ctx) {
|
|
|
189785
189600
|
}
|
|
189786
189601
|
let result;
|
|
189787
189602
|
try {
|
|
189788
|
-
result = await
|
|
189789
|
-
() => body ? createAndSubmitWithFooter(ctx, params, {
|
|
189603
|
+
result = await mutation({
|
|
189604
|
+
run: () => body ? createAndSubmitWithFooter(ctx, params, {
|
|
189790
189605
|
body,
|
|
189791
189606
|
approved: approved ?? false,
|
|
189792
189607
|
hasComments: (params.comments?.length ?? 0) > 0
|
|
189793
189608
|
}) : createReviewWithStrandedRecovery(ctx, params),
|
|
189794
|
-
|
|
189795
|
-
|
|
189796
|
-
|
|
189797
|
-
name: "review submission"
|
|
189798
|
-
}
|
|
189799
|
-
)();
|
|
189609
|
+
retry: (error49, attempt) => isTransientReviewError(error49) ? delay2(TRANSIENT_REVIEW_RETRY_DELAYS_MS, attempt) : -1,
|
|
189610
|
+
name: "review submission"
|
|
189611
|
+
})();
|
|
189800
189612
|
} catch (err) {
|
|
189801
189613
|
if (ctx.toolState.approval) ctx.toolState.approval.wouldApprove = false;
|
|
189802
189614
|
if (isTransientReviewError(err)) {
|
|
@@ -190469,8 +190281,8 @@ async function checkoutPrBranch(pr, params) {
|
|
|
190469
190281
|
if (!alreadyOnBranch) {
|
|
190470
190282
|
$("git", ["checkout", "-B", pr.baseRef, `origin/${pr.baseRef}`], { log: false });
|
|
190471
190283
|
log.debug(`\xBB fetching PR #${pr.number} (${localBranch})...`);
|
|
190472
|
-
await
|
|
190473
|
-
async () => {
|
|
190284
|
+
await mutation({
|
|
190285
|
+
run: async () => {
|
|
190474
190286
|
try {
|
|
190475
190287
|
await $gitFetchWithDeepen(
|
|
190476
190288
|
["--no-tags", "origin", `+pull/${pr.number}/head:${localBranch}`],
|
|
@@ -190485,12 +190297,9 @@ async function checkoutPrBranch(pr, params) {
|
|
|
190485
190297
|
throw e;
|
|
190486
190298
|
}
|
|
190487
190299
|
},
|
|
190488
|
-
|
|
190489
|
-
|
|
190490
|
-
|
|
190491
|
-
rethrow: (e) => !PULL_REF_MISSING_PATTERN.test(e instanceof Error ? e.message : String(e))
|
|
190492
|
-
}
|
|
190493
|
-
)();
|
|
190300
|
+
retry: (error49, attempt) => PULL_REF_MISSING_PATTERN.test(error49 instanceof Error ? error49.message : String(error49)) ? delay2(PULL_REF_RETRY_DELAYS_MS, attempt) : -1,
|
|
190301
|
+
name: `pull/${pr.number}/head fetch`
|
|
190302
|
+
})();
|
|
190494
190303
|
$("git", ["checkout", localBranch], { log: false });
|
|
190495
190304
|
log.debug(`\xBB checked out PR #${pr.number}`);
|
|
190496
190305
|
repoState.checkoutSha = $("git", ["rev-parse", "HEAD"], { log: false }).trim();
|
|
@@ -191167,7 +190976,7 @@ function ReopenCurrentTool(ctx) {
|
|
|
191167
190976
|
}
|
|
191168
190977
|
|
|
191169
190978
|
// prep/index.ts
|
|
191170
|
-
import { performance as
|
|
190979
|
+
import { performance as performance8 } from "node:perf_hooks";
|
|
191171
190980
|
|
|
191172
190981
|
// prep/installNodeDependencies.ts
|
|
191173
190982
|
import { existsSync as existsSync8 } from "node:fs";
|
|
@@ -191626,7 +191435,7 @@ var installPythonDependencies = {
|
|
|
191626
191435
|
var prepSteps = [installNodeDependencies, installPythonDependencies];
|
|
191627
191436
|
async function runPrepPhase(options) {
|
|
191628
191437
|
log.debug("\xBB starting prep phase...");
|
|
191629
|
-
const startTime =
|
|
191438
|
+
const startTime = performance8.now();
|
|
191630
191439
|
const results = [];
|
|
191631
191440
|
const preDirty = await dirtyTrackedPaths();
|
|
191632
191441
|
try {
|
|
@@ -191648,7 +191457,7 @@ async function runPrepPhase(options) {
|
|
|
191648
191457
|
} finally {
|
|
191649
191458
|
await restoreDirtiedSince({ before: preDirty, actor: "prep" });
|
|
191650
191459
|
}
|
|
191651
|
-
const totalDurationMs =
|
|
191460
|
+
const totalDurationMs = performance8.now() - startTime;
|
|
191652
191461
|
log.debug(`\xBB prep phase completed (${Math.round(totalDurationMs)}ms)`);
|
|
191653
191462
|
return results;
|
|
191654
191463
|
}
|
|
@@ -192836,8 +192645,8 @@ function buildThreadBlocks(threads, filePatchMap, reviewId) {
|
|
|
192836
192645
|
}
|
|
192837
192646
|
return threadBlocks;
|
|
192838
192647
|
}
|
|
192839
|
-
var fetchAllReviewThreads =
|
|
192840
|
-
async (key, ctx) => {
|
|
192648
|
+
var fetchAllReviewThreads = query({
|
|
192649
|
+
run: async (key, ctx) => {
|
|
192841
192650
|
const threads = [];
|
|
192842
192651
|
let cursor = null;
|
|
192843
192652
|
for (let page = 0; page < 50; page += 1) {
|
|
@@ -192854,21 +192663,21 @@ var fetchAllReviewThreads = op(
|
|
|
192854
192663
|
}
|
|
192855
192664
|
return threads;
|
|
192856
192665
|
},
|
|
192857
|
-
|
|
192858
|
-
|
|
192859
|
-
|
|
192860
|
-
|
|
192666
|
+
ttl: 6e4,
|
|
192667
|
+
name: "reviewThreads"
|
|
192668
|
+
});
|
|
192669
|
+
var fetchPrFiles = query({
|
|
192670
|
+
run: async (key, ctx) => ctx.octokit.paginate(ctx.octokit.rest.pulls.listFiles, {
|
|
192861
192671
|
owner: key.owner,
|
|
192862
192672
|
repo: key.name,
|
|
192863
192673
|
pull_number: key.pullNumber,
|
|
192864
192674
|
per_page: 100
|
|
192865
192675
|
}),
|
|
192866
|
-
|
|
192867
|
-
|
|
192676
|
+
ttl: 6e4,
|
|
192677
|
+
name: "prFiles"
|
|
192678
|
+
});
|
|
192868
192679
|
function invalidateReviewThreadCache(repo) {
|
|
192869
|
-
fetchAllReviewThreads.invalidate(
|
|
192870
|
-
(cached4) => cached4.owner === repo.owner && cached4.name === repo.name
|
|
192871
|
-
);
|
|
192680
|
+
fetchAllReviewThreads.invalidate({ owner: repo.owner, name: repo.name });
|
|
192872
192681
|
}
|
|
192873
192682
|
async function getReviewThreads(input) {
|
|
192874
192683
|
const allThreads = structuredClone(
|
|
@@ -193595,7 +193404,7 @@ function buildCommonTools(ctx, outputSchema) {
|
|
|
193595
193404
|
if (isStandalone || outputSchema) {
|
|
193596
193405
|
tools.push(SetOutputTool(ctx, outputSchema));
|
|
193597
193406
|
}
|
|
193598
|
-
if (ctx.payload.shell
|
|
193407
|
+
if (ctx.payload.shell !== "disabled") {
|
|
193599
193408
|
tools.push(ShellTool(ctx));
|
|
193600
193409
|
tools.push(KillBackgroundTool(ctx));
|
|
193601
193410
|
}
|
|
@@ -194427,11 +194236,11 @@ function formatBillingErrorSummary(error49, owner) {
|
|
|
194427
194236
|
}
|
|
194428
194237
|
if (error49.code === "router_monthly_limit") {
|
|
194429
194238
|
return [
|
|
194430
|
-
"**Pullfrog Router
|
|
194239
|
+
"**Pullfrog Router is out of credit, and the monthly spend limit blocks the next auto-reload.**",
|
|
194431
194240
|
"",
|
|
194432
|
-
"
|
|
194241
|
+
"Top up by hand, ask your admin to raise the cap, or wait for it to reset at 00:00 UTC on the 1st.",
|
|
194433
194242
|
"",
|
|
194434
|
-
`[Adjust limit \u2192](${billingConsoleUrl(owner)})`
|
|
194243
|
+
`[Top up balance \u2192](${billingConsoleUrl(owner)}) \xB7 [Adjust limit \u2192](${billingConsoleUrl(owner)})`
|
|
194435
194244
|
].join("\n");
|
|
194436
194245
|
}
|
|
194437
194246
|
if (error49.code === "commercial_plan_required") {
|
|
@@ -194718,7 +194527,13 @@ var codexUsageSchema = external_exports.object({
|
|
|
194718
194527
|
limit_reached: external_exports.boolean(),
|
|
194719
194528
|
primary_window: codexWindowSchema,
|
|
194720
194529
|
secondary_window: codexWindowSchema
|
|
194721
|
-
}).optional()
|
|
194530
|
+
}).optional(),
|
|
194531
|
+
credits: external_exports.object({
|
|
194532
|
+
has_credits: external_exports.boolean().optional(),
|
|
194533
|
+
unlimited: external_exports.boolean().optional(),
|
|
194534
|
+
overage_limit_reached: external_exports.boolean().optional()
|
|
194535
|
+
}).nullish(),
|
|
194536
|
+
spend_control: external_exports.object({ reached: external_exports.boolean().optional() }).nullish()
|
|
194722
194537
|
});
|
|
194723
194538
|
var unknown4 = { status: "unknown" };
|
|
194724
194539
|
async function readSubscriptionEndpoint(input) {
|
|
@@ -194761,9 +194576,12 @@ async function probeSubscription(input) {
|
|
|
194761
194576
|
const body = await response.json().catch(() => null);
|
|
194762
194577
|
if (!codex2) return unknown4;
|
|
194763
194578
|
const parsed2 = codexUsageSchema.safeParse(body);
|
|
194764
|
-
|
|
194765
|
-
|
|
194579
|
+
if (!parsed2.success || !parsed2.data.rate_limit) return unknown4;
|
|
194580
|
+
const limit = parsed2.data.rate_limit;
|
|
194766
194581
|
if (limit.allowed && !limit.limit_reached) return { status: "usable" };
|
|
194582
|
+
const credits = parsed2.data.credits;
|
|
194583
|
+
if ((credits?.has_credits || credits?.unlimited) && !credits.overage_limit_reached && !parsed2.data.spend_control?.reached)
|
|
194584
|
+
return { status: "usable" };
|
|
194767
194585
|
const windows = [limit.primary_window, limit.secondary_window];
|
|
194768
194586
|
const full = windows.filter((window2) => (window2?.used_percent ?? 0) >= 100);
|
|
194769
194587
|
const resets = (full.length ? full : windows).flatMap(
|
|
@@ -194811,15 +194629,24 @@ async function probeInference(input) {
|
|
|
194811
194629
|
const error49 = external_exports.object({ error: external_exports.object({ code: external_exports.string() }) }).safeParse(await response.json().catch(() => null));
|
|
194812
194630
|
return error49.success && error49.data.error.code === "insufficient_quota" ? { status: "exhausted", detail: "refused with 429: insufficient quota", resetAt: void 0 } : unknown4;
|
|
194813
194631
|
}
|
|
194632
|
+
if (response?.status === 401 || response?.status === 403)
|
|
194633
|
+
return {
|
|
194634
|
+
status: "rejected",
|
|
194635
|
+
detail: `rejected with ${response.status}${await providerReason(response)}`
|
|
194636
|
+
};
|
|
194814
194637
|
await response?.body?.cancel();
|
|
194815
194638
|
if (!response) return unknown4;
|
|
194816
194639
|
if (response.ok) return { status: "usable" };
|
|
194817
|
-
if (response.status === 401 || response.status === 403)
|
|
194818
|
-
return { status: "rejected", detail: `rejected with ${response.status}` };
|
|
194819
194640
|
if (response.status === 402)
|
|
194820
194641
|
return { status: "exhausted", detail: "refused with 402", resetAt: void 0 };
|
|
194821
194642
|
return unknown4;
|
|
194822
194643
|
}
|
|
194644
|
+
async function providerReason(response) {
|
|
194645
|
+
const body = external_exports.object({ error: external_exports.union([external_exports.string(), external_exports.object({ message: external_exports.string() })]) }).safeParse(await response.json().catch(() => null));
|
|
194646
|
+
if (!body.success) return "";
|
|
194647
|
+
const error49 = body.data.error;
|
|
194648
|
+
return `: ${(typeof error49 === "string" ? error49 : error49.message).slice(0, 300)}`;
|
|
194649
|
+
}
|
|
194823
194650
|
|
|
194824
194651
|
// utils/credentialPool.ts
|
|
194825
194652
|
var receipts = {};
|
|
@@ -194828,8 +194655,8 @@ function saveReceipts() {
|
|
|
194828
194655
|
for (const receipt of Object.values(receipts)) maskSecret(receipt);
|
|
194829
194656
|
saveSecretState("credential_receipts", JSON.stringify(receipts));
|
|
194830
194657
|
}
|
|
194831
|
-
var select =
|
|
194832
|
-
async (input) => {
|
|
194658
|
+
var select = mutation({
|
|
194659
|
+
run: async (input) => {
|
|
194833
194660
|
const response = await apiFetch({
|
|
194834
194661
|
path: "/api/runtime/credentials",
|
|
194835
194662
|
method: "POST",
|
|
@@ -194847,11 +194674,8 @@ var select = op(
|
|
|
194847
194674
|
});
|
|
194848
194675
|
return selectedCredentialSchema.parse(await response.json());
|
|
194849
194676
|
},
|
|
194850
|
-
|
|
194851
|
-
|
|
194852
|
-
rethrow: (error49) => error49 instanceof Error && typeof error49.cause === "number" && error49.cause >= 400 && error49.cause < 500
|
|
194853
|
-
}
|
|
194854
|
-
);
|
|
194677
|
+
retry: (error49, attempt) => error49 instanceof Error && typeof error49.cause === "number" && error49.cause >= 400 && error49.cause < 500 ? -1 : delay2([250, 1e3], attempt)
|
|
194678
|
+
});
|
|
194855
194679
|
function subscriptionForModel(model) {
|
|
194856
194680
|
if (!model.includes("/")) return null;
|
|
194857
194681
|
const provider2 = getModelProvider(model);
|
|
@@ -194914,12 +194738,14 @@ async function selectConfiguredCredential(input) {
|
|
|
194914
194738
|
const subscription = subscriptionForModel(model);
|
|
194915
194739
|
const names = getModelEnvVars(model).filter((name) => name !== subscription);
|
|
194916
194740
|
if (subscription) names.unshift(subscription);
|
|
194741
|
+
const opencodePinned = process.env.PULLFROG_AGENT?.trim() === "opencode";
|
|
194742
|
+
const presentable = (name) => canInstallSubscription(name) && !(opencodePinned && CLAUDE_CODE_ONLY_CREDENTIALS.includes(name));
|
|
194917
194743
|
const candidates = access.candidates.filter(
|
|
194918
|
-
(candidate) => names.includes(candidate.name) &&
|
|
194744
|
+
(candidate) => names.includes(candidate.name) && presentable(candidate.name)
|
|
194919
194745
|
);
|
|
194920
194746
|
if (!candidates.length) return false;
|
|
194921
194747
|
const options = [
|
|
194922
|
-
...names.filter((name) => workflowCredentials[name] &&
|
|
194748
|
+
...names.filter((name) => workflowCredentials[name] && presentable(name)).map((name) => ({ name, candidate: void 0 })),
|
|
194923
194749
|
...candidates.map((candidate) => ({ name: candidate.name, candidate }))
|
|
194924
194750
|
].sort((a, b) => Number(b.name === subscription) - Number(a.name === subscription));
|
|
194925
194751
|
const refused = [];
|
|
@@ -194976,7 +194802,7 @@ function activate(input) {
|
|
|
194976
194802
|
}
|
|
194977
194803
|
|
|
194978
194804
|
// utils/gitAuthServer.ts
|
|
194979
|
-
import { randomUUID as
|
|
194805
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
194980
194806
|
import { writeFileSync as writeFileSync14 } from "node:fs";
|
|
194981
194807
|
import { createServer as createServer3 } from "node:http";
|
|
194982
194808
|
import { join as join24 } from "node:path";
|
|
@@ -195034,7 +194860,7 @@ async function startGitAuthServer(tmpdir3) {
|
|
|
195034
194860
|
const port = rawAddr.port;
|
|
195035
194861
|
log.debug(`git auth server listening on 127.0.0.1:${port}`);
|
|
195036
194862
|
function register7(token) {
|
|
195037
|
-
const code =
|
|
194863
|
+
const code = randomUUID6();
|
|
195038
194864
|
codes.set(code, { token, state: "active" });
|
|
195039
194865
|
return code;
|
|
195040
194866
|
}
|
|
@@ -195046,7 +194872,7 @@ async function startGitAuthServer(tmpdir3) {
|
|
|
195046
194872
|
entry.timeout.unref();
|
|
195047
194873
|
}
|
|
195048
194874
|
function writeAskpassScript(code) {
|
|
195049
|
-
const scriptId =
|
|
194875
|
+
const scriptId = randomUUID6();
|
|
195050
194876
|
const scriptName = `askpass-${scriptId}.js`;
|
|
195051
194877
|
const scriptPath = join24(tmpdir3, scriptName);
|
|
195052
194878
|
const content = [
|
|
@@ -195137,13 +194963,10 @@ function getShellInstructions(shell, t) {
|
|
|
195137
194963
|
|
|
195138
194964
|
Shell command execution is DISABLED. Do not attempt to run shell commands.`;
|
|
195139
194965
|
case "restricted":
|
|
195140
|
-
return `### Shell commands
|
|
195141
|
-
|
|
195142
|
-
Use the \`${t("shell")}\` MCP tool for all shell command execution. This tool provides a secure environment with filtered credentials. Do NOT use any native shell tool \u2014 it is disabled for security. For long-running processes (dev servers, watchers), use \`shell({ command, background: true })\`. Use \`${t("kill_background")}\` to stop background processes.`;
|
|
195143
194966
|
case "enabled":
|
|
195144
194967
|
return `### Shell commands
|
|
195145
194968
|
|
|
195146
|
-
Use
|
|
194969
|
+
Use the \`${t("shell")}\` MCP tool for all shell command execution.${shell === "restricted" ? " This tool provides a secure environment with filtered credentials. Do NOT use any native shell tool \u2014 it is disabled for security." : ""} For long-running processes (dev servers, watchers), use \`shell({ command, background: true })\`. Use \`${t("kill_background")}\` to stop background processes.`;
|
|
195147
194970
|
default: {
|
|
195148
194971
|
const _exhaustive = shell;
|
|
195149
194972
|
return _exhaustive;
|
|
@@ -196288,8 +196111,8 @@ async function mintProxyKey(ctx) {
|
|
|
196288
196111
|
try {
|
|
196289
196112
|
const headers = await buildProxyTokenHeaders(ctx);
|
|
196290
196113
|
if (!headers) return null;
|
|
196291
|
-
const response = await
|
|
196292
|
-
async () => {
|
|
196114
|
+
const response = await mutation({
|
|
196115
|
+
run: async () => {
|
|
196293
196116
|
const r = await apiFetch({ path: "/api/proxy-token", method: "POST", headers });
|
|
196294
196117
|
if (r.status >= 500) {
|
|
196295
196118
|
const body = await r.json().catch(() => null);
|
|
@@ -196299,12 +196122,9 @@ async function mintProxyKey(ctx) {
|
|
|
196299
196122
|
}
|
|
196300
196123
|
return r;
|
|
196301
196124
|
},
|
|
196302
|
-
|
|
196303
|
-
|
|
196304
|
-
|
|
196305
|
-
rethrow: (error49) => !(error49 instanceof TransientError)
|
|
196306
|
-
}
|
|
196307
|
-
)();
|
|
196125
|
+
name: "proxy key mint",
|
|
196126
|
+
retry: (error49, attempt) => error49 instanceof TransientError ? delay2([1e3, 2e3], attempt) : -1
|
|
196127
|
+
})();
|
|
196308
196128
|
if (response.status === 402) {
|
|
196309
196129
|
const body = await response.json().catch(() => null);
|
|
196310
196130
|
throw new BillingError(body?.error ?? "insufficient balance", {
|
|
@@ -196337,10 +196157,10 @@ async function buildProxyTokenHeaders(ctx) {
|
|
|
196337
196157
|
const fundingSource = ctx.fundingSource;
|
|
196338
196158
|
if (ctx.oidcCredentials) {
|
|
196339
196159
|
const creds = ctx.oidcCredentials;
|
|
196340
|
-
const oidcToken = await
|
|
196160
|
+
const oidcToken = await query({
|
|
196161
|
+
run: () => fetchIdTokenFromStash(creds),
|
|
196341
196162
|
name: "ID token mint",
|
|
196342
|
-
|
|
196343
|
-
rethrow: (error49) => !isTransientTokenError(error49)
|
|
196163
|
+
retry: (error49, attempt) => isTransientTokenError(error49) ? delay2([1e3, 2e3], attempt) : -1
|
|
196344
196164
|
})();
|
|
196345
196165
|
return {
|
|
196346
196166
|
Authorization: `Bearer ${oidcToken}`,
|
|
@@ -196587,109 +196407,6 @@ ${collapsible}` : output;
|
|
|
196587
196407
|
};
|
|
196588
196408
|
}
|
|
196589
196409
|
|
|
196590
|
-
// utils/runContext.ts
|
|
196591
|
-
var defaultSettings = {
|
|
196592
|
-
model: null,
|
|
196593
|
-
effort: null,
|
|
196594
|
-
modes: [],
|
|
196595
|
-
setupScript: null,
|
|
196596
|
-
postCheckoutScript: null,
|
|
196597
|
-
prepushScript: null,
|
|
196598
|
-
stopScript: null,
|
|
196599
|
-
push: "restricted",
|
|
196600
|
-
shell: "restricted",
|
|
196601
|
-
prApproveEnabled: false,
|
|
196602
|
-
reviewDrafts: false,
|
|
196603
|
-
autoMergeEnabled: false,
|
|
196604
|
-
codexAgent: false,
|
|
196605
|
-
signedCommits: false,
|
|
196606
|
-
repoIntelligence: false,
|
|
196607
|
-
progressComments: true,
|
|
196608
|
-
statusChecks: true,
|
|
196609
|
-
approvalCheck: false,
|
|
196610
|
-
modeInstructions: {},
|
|
196611
|
-
learnings: null,
|
|
196612
|
-
learningsHeadings: [],
|
|
196613
|
-
envAllowlist: null,
|
|
196614
|
-
xrepoBrief: null,
|
|
196615
|
-
xrepoLearnings: null,
|
|
196616
|
-
xrepoLearningsHeadings: []
|
|
196617
|
-
};
|
|
196618
|
-
var defaultRunContext = {
|
|
196619
|
-
settings: defaultSettings,
|
|
196620
|
-
apiToken: "",
|
|
196621
|
-
oss: false,
|
|
196622
|
-
plan: "none"
|
|
196623
|
-
};
|
|
196624
|
-
var unknownSecretsRunContext = {
|
|
196625
|
-
...defaultRunContext,
|
|
196626
|
-
secretsUnavailable: true
|
|
196627
|
-
};
|
|
196628
|
-
async function fetchRunContext(params) {
|
|
196629
|
-
const timeoutMs = 3e4;
|
|
196630
|
-
const controller = new AbortController();
|
|
196631
|
-
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
196632
|
-
try {
|
|
196633
|
-
const headers = {
|
|
196634
|
-
Authorization: `Bearer ${params.token}`,
|
|
196635
|
-
"X-Pullfrog-Credential-Pools": "1"
|
|
196636
|
-
};
|
|
196637
|
-
if (params.oidcToken) {
|
|
196638
|
-
headers["X-GitHub-OIDC-Token"] = params.oidcToken;
|
|
196639
|
-
}
|
|
196640
|
-
const query = new URLSearchParams();
|
|
196641
|
-
if (params.runType) query.set("type", params.runType);
|
|
196642
|
-
if (params.routedTier) query.set("tier", params.routedTier);
|
|
196643
|
-
const search2 = query.toString();
|
|
196644
|
-
const response = await apiFetch({
|
|
196645
|
-
path: `/api/repo/${params.repoContext.owner}/${params.repoContext.name}/run-context${search2 ? `?${search2}` : ""}`,
|
|
196646
|
-
headers,
|
|
196647
|
-
signal: controller.signal
|
|
196648
|
-
});
|
|
196649
|
-
clearTimeout(timeoutId);
|
|
196650
|
-
if (response.status === 402) {
|
|
196651
|
-
const body = await response.json().catch(() => null);
|
|
196652
|
-
const reason = typeof body === "object" && body !== null && "reason" in body ? body.reason : null;
|
|
196653
|
-
const commercialRefused = reason === "subscription_unpaid" || reason === "subscription_ended" ? reason : "commercial";
|
|
196654
|
-
return { ...defaultRunContext, commercialRefused };
|
|
196655
|
-
}
|
|
196656
|
-
if (!response.ok) {
|
|
196657
|
-
return response.status >= 500 ? unknownSecretsRunContext : defaultRunContext;
|
|
196658
|
-
}
|
|
196659
|
-
const data = await response.json();
|
|
196660
|
-
if (data === null) {
|
|
196661
|
-
return defaultRunContext;
|
|
196662
|
-
}
|
|
196663
|
-
return {
|
|
196664
|
-
settings: {
|
|
196665
|
-
...defaultSettings,
|
|
196666
|
-
...data.settings,
|
|
196667
|
-
modes: data.settings?.modes ?? [],
|
|
196668
|
-
setupScript: data.settings?.setupScript ?? null,
|
|
196669
|
-
postCheckoutScript: data.settings?.postCheckoutScript ?? null,
|
|
196670
|
-
prepushScript: data.settings?.prepushScript ?? null,
|
|
196671
|
-
stopScript: data.settings?.stopScript ?? null,
|
|
196672
|
-
learningsHeadings: data.settings?.learningsHeadings ?? [],
|
|
196673
|
-
xrepoBrief: data.settings?.xrepoBrief ?? null,
|
|
196674
|
-
xrepoLearnings: data.settings?.xrepoLearnings ?? null,
|
|
196675
|
-
xrepoLearningsHeadings: data.settings?.xrepoLearningsHeadings ?? []
|
|
196676
|
-
},
|
|
196677
|
-
apiToken: data.apiToken,
|
|
196678
|
-
oss: data.oss ?? false,
|
|
196679
|
-
plan: data.plan ?? "none",
|
|
196680
|
-
proxyModel: data.proxyModel,
|
|
196681
|
-
dbSecrets: data.dbSecrets,
|
|
196682
|
-
credentialAccess: data.credentialAccess,
|
|
196683
|
-
secretsUnavailable: data.secretsUnavailable,
|
|
196684
|
-
routerUnfunded: data.routerUnfunded,
|
|
196685
|
-
trialFallback: data.trialFallback
|
|
196686
|
-
};
|
|
196687
|
-
} catch {
|
|
196688
|
-
clearTimeout(timeoutId);
|
|
196689
|
-
return unknownSecretsRunContext;
|
|
196690
|
-
}
|
|
196691
|
-
}
|
|
196692
|
-
|
|
196693
196410
|
// utils/runContextData.ts
|
|
196694
196411
|
async function resolveRunContextData(params) {
|
|
196695
196412
|
const actionRef = process.env.GITHUB_ACTION_REF;
|
|
@@ -196699,23 +196416,25 @@ async function resolveRunContextData(params) {
|
|
|
196699
196416
|
const repoContext = parseRepoContext();
|
|
196700
196417
|
let oidcToken;
|
|
196701
196418
|
try {
|
|
196702
|
-
oidcToken = await
|
|
196419
|
+
oidcToken = await query({
|
|
196420
|
+
run: () => mintIdToken(),
|
|
196703
196421
|
name: "OIDC mint",
|
|
196704
|
-
|
|
196422
|
+
retry: process.env.ACTIONS_ID_TOKEN_REQUEST_URL ? [200, 1e3] : []
|
|
196705
196423
|
})();
|
|
196706
196424
|
} catch {
|
|
196707
196425
|
}
|
|
196708
196426
|
const [repoResponse, runContext] = await Promise.all([
|
|
196709
|
-
|
|
196427
|
+
query({
|
|
196428
|
+
run: () => params.octokit.repos.get({ owner: repoContext.owner, repo: repoContext.name }),
|
|
196710
196429
|
name: "repos.get",
|
|
196711
|
-
|
|
196712
|
-
rethrow: (error49) => !isTransientOctokitError(error49)
|
|
196430
|
+
retry: (error49, attempt) => isTransientOctokitError(error49) ? delay2([100, 500], attempt) : -1
|
|
196713
196431
|
})(),
|
|
196714
196432
|
fetchRunContext({
|
|
196715
196433
|
token: params.token,
|
|
196716
196434
|
repoContext,
|
|
196717
196435
|
oidcToken,
|
|
196718
196436
|
runType: params.runType,
|
|
196437
|
+
plainPrompt: params.plainPrompt,
|
|
196719
196438
|
routedTier: params.routedTier
|
|
196720
196439
|
})
|
|
196721
196440
|
]);
|
|
@@ -197252,17 +196971,14 @@ async function autoMergeAfterApprove(ctx) {
|
|
|
197252
196971
|
});
|
|
197253
196972
|
if (hasBlockingHumanReview(reviews)) return skip("human changes requested");
|
|
197254
196973
|
try {
|
|
197255
|
-
await
|
|
197256
|
-
() => ctx.octokit.graphql(ENABLE_AUTO_MERGE, {
|
|
196974
|
+
await mutation({
|
|
196975
|
+
run: () => ctx.octokit.graphql(ENABLE_AUTO_MERGE, {
|
|
197257
196976
|
pullRequestId: pr.data.node_id,
|
|
197258
196977
|
headSha
|
|
197259
196978
|
}),
|
|
197260
|
-
|
|
197261
|
-
|
|
197262
|
-
|
|
197263
|
-
rethrow: (error49) => !isTransientOctokitError(error49)
|
|
197264
|
-
}
|
|
197265
|
-
)();
|
|
196979
|
+
name: "enablePullRequestAutoMerge",
|
|
196980
|
+
retry: (error49, attempt) => isTransientOctokitError(error49) ? delay2([500, 2e3], attempt) : -1
|
|
196981
|
+
})();
|
|
197266
196982
|
log.info(`autoMerge: pr=#${pullNumber} @ ${headSha.slice(0, 7)} \u2192 native auto-merge enabled`);
|
|
197267
196983
|
await comment(
|
|
197268
196984
|
"> \u2705 Approved \u2014 auto-merge enabled; GitHub will merge once required checks pass."
|
|
@@ -197300,7 +197016,17 @@ async function autoMergeAfterApprove(ctx) {
|
|
|
197300
197016
|
var RE_REVIEW_PREAMBLE = "Incrementally re-review the new commits on this pull request. Use the IncrementalReview mode.";
|
|
197301
197017
|
async function postReviewCleanup(ctx) {
|
|
197302
197018
|
const review = ctx.toolState.review;
|
|
197303
|
-
if (!review)
|
|
197019
|
+
if (!review) {
|
|
197020
|
+
const checkoutSha = primaryRepoState(ctx.toolState).checkoutSha;
|
|
197021
|
+
if (ctx.toolState.selectedMode === "IncrementalReview" && checkoutSha) {
|
|
197022
|
+
await patchWorkflowRunFields(ctx, { reviewSkipped: true });
|
|
197023
|
+
await bestEffort(
|
|
197024
|
+
() => dispatchFollowUpReReview(ctx, checkoutSha),
|
|
197025
|
+
"follow-up re-review dispatch"
|
|
197026
|
+
);
|
|
197027
|
+
}
|
|
197028
|
+
return;
|
|
197029
|
+
}
|
|
197304
197030
|
delete ctx.toolState.review;
|
|
197305
197031
|
await bestEffort(() => reportReviewNodeId(ctx, { nodeId: review.nodeId }), "reportReviewNodeId");
|
|
197306
197032
|
if (review.reviewedSha) {
|
|
@@ -197353,20 +197079,17 @@ async function dispatchFollowUpReReview(ctx, reviewedSha) {
|
|
|
197353
197079
|
eventInstructions: RE_REVIEW_PREAMBLE,
|
|
197354
197080
|
event
|
|
197355
197081
|
};
|
|
197356
|
-
await
|
|
197357
|
-
() => ctx.octokit.rest.actions.createWorkflowDispatch({
|
|
197082
|
+
await mutation({
|
|
197083
|
+
run: () => ctx.octokit.rest.actions.createWorkflowDispatch({
|
|
197358
197084
|
owner: ctx.repo.owner,
|
|
197359
197085
|
repo: ctx.repo.name,
|
|
197360
197086
|
workflow_id: getCurrentWorkflowFilename(),
|
|
197361
197087
|
ref: pr.data.base.repo.default_branch,
|
|
197362
197088
|
inputs: { prompt: JSON.stringify(payload) }
|
|
197363
197089
|
}),
|
|
197364
|
-
|
|
197365
|
-
|
|
197366
|
-
|
|
197367
|
-
rethrow: (error49) => !isTransientOctokitError(error49)
|
|
197368
|
-
}
|
|
197369
|
-
)();
|
|
197090
|
+
name: "reReviewDispatch",
|
|
197091
|
+
retry: (error49, attempt) => isTransientOctokitError(error49) ? delay2([500, 2e3], attempt) : -1
|
|
197092
|
+
})();
|
|
197370
197093
|
}
|
|
197371
197094
|
function getCurrentWorkflowFilename() {
|
|
197372
197095
|
const ref = process.env.GITHUB_WORKFLOW_REF ?? "";
|
|
@@ -197376,6 +197099,7 @@ function getCurrentWorkflowFilename() {
|
|
|
197376
197099
|
|
|
197377
197100
|
// utils/runStatusCheck.ts
|
|
197378
197101
|
var RUN_STATUS_CHECK_NAME = "pullfrog";
|
|
197102
|
+
var GITHUB_ACTIONS_APP_SLUG = "github-actions";
|
|
197379
197103
|
var APPROVAL_CHECK_NAME = "pullfrog-approval";
|
|
197380
197104
|
function parseCheckRunId(raw2) {
|
|
197381
197105
|
if (!raw2?.id) return void 0;
|
|
@@ -197429,7 +197153,12 @@ function terminalOutput(params) {
|
|
|
197429
197153
|
const review = params.reviewUrl ? `
|
|
197430
197154
|
|
|
197431
197155
|
[View the review Pullfrog posted \u2192](${params.reviewUrl})` : "";
|
|
197432
|
-
if (params.conclusion === "success")
|
|
197156
|
+
if (params.conclusion === "success") {
|
|
197157
|
+
const note = params.note ? `
|
|
197158
|
+
|
|
197159
|
+
${params.note}` : "";
|
|
197160
|
+
return { title: base.title, summary: base.summary + review + note };
|
|
197161
|
+
}
|
|
197433
197162
|
return {
|
|
197434
197163
|
title: base.title,
|
|
197435
197164
|
summary: base.summary + logsLine(params.detailsUrl) + review + disableCheckLine(params.owner, params.repo)
|
|
@@ -197447,7 +197176,8 @@ async function finalizeRunStatusCheck(params) {
|
|
|
197447
197176
|
owner: params.owner,
|
|
197448
197177
|
repo: params.repo,
|
|
197449
197178
|
detailsUrl: params.detailsUrl,
|
|
197450
|
-
reviewUrl: params.reviewUrl
|
|
197179
|
+
reviewUrl: params.reviewUrl,
|
|
197180
|
+
note: params.note
|
|
197451
197181
|
})
|
|
197452
197182
|
};
|
|
197453
197183
|
if (params.detailsUrl) updateParams.details_url = params.detailsUrl;
|
|
@@ -197466,7 +197196,8 @@ async function createTerminalRunStatusCheck(params) {
|
|
|
197466
197196
|
owner: params.owner,
|
|
197467
197197
|
repo: params.repo,
|
|
197468
197198
|
detailsUrl: params.detailsUrl,
|
|
197469
|
-
reviewUrl: params.reviewUrl
|
|
197199
|
+
reviewUrl: params.reviewUrl,
|
|
197200
|
+
note: params.note
|
|
197470
197201
|
})
|
|
197471
197202
|
};
|
|
197472
197203
|
if (params.detailsUrl) createParams.details_url = params.detailsUrl;
|
|
@@ -197482,6 +197213,8 @@ async function reportStatusChecks(ctx, params) {
|
|
|
197482
197213
|
if (checkRunId === void 0 && !ctx.payload.runStatusCheck && !ctx.payload.approvalCheck) return;
|
|
197483
197214
|
const conclusion = params.runSucceeded ? "success" : "failure";
|
|
197484
197215
|
const detailsUrl = ctx.runId ? `https://github.com/${ctx.repo.owner}/${ctx.repo.name}/actions/runs/${ctx.runId}` : void 0;
|
|
197216
|
+
const approval = ctx.toolState.approval;
|
|
197217
|
+
const note = event.silent && !approval?.url ? ctx.toolState.lastProgressBody : void 0;
|
|
197485
197218
|
if (checkRunId !== void 0) {
|
|
197486
197219
|
await finalizeRunStatusCheck({
|
|
197487
197220
|
octokit: ctx.octokit,
|
|
@@ -197490,11 +197223,12 @@ async function reportStatusChecks(ctx, params) {
|
|
|
197490
197223
|
checkRunId,
|
|
197491
197224
|
conclusion,
|
|
197492
197225
|
detailsUrl,
|
|
197493
|
-
reviewUrl:
|
|
197226
|
+
reviewUrl: approval?.url,
|
|
197227
|
+
note
|
|
197494
197228
|
}).then(() => log.info(`\xBB finalized ${RUN_STATUS_CHECK_NAME} check (${conclusion})`)).catch((err) => log.debug(`status checks: ${RUN_STATUS_CHECK_NAME} finalize failed: ${err}`));
|
|
197495
197229
|
}
|
|
197496
|
-
const
|
|
197497
|
-
const needsApprovalCheck = ctx.payload.approvalCheck && params.runSucceeded && approval;
|
|
197230
|
+
const carriesApproval = !approval && ctx.toolState.selectedMode === "IncrementalReview";
|
|
197231
|
+
const needsApprovalCheck = ctx.payload.approvalCheck && params.runSucceeded && (approval !== void 0 || carriesApproval);
|
|
197498
197232
|
const needsFallbackRunCheck = ctx.payload.runStatusCheck && checkRunId === void 0;
|
|
197499
197233
|
if (!needsApprovalCheck && !needsFallbackRunCheck) return;
|
|
197500
197234
|
let headSha;
|
|
@@ -197517,25 +197251,64 @@ async function reportStatusChecks(ctx, params) {
|
|
|
197517
197251
|
headSha: primaryRepoState(ctx.toolState).checkoutSha ?? headSha,
|
|
197518
197252
|
conclusion,
|
|
197519
197253
|
detailsUrl,
|
|
197520
|
-
reviewUrl:
|
|
197254
|
+
reviewUrl: approval?.url,
|
|
197255
|
+
note
|
|
197521
197256
|
}).then(() => log.info(`\xBB posted ${RUN_STATUS_CHECK_NAME} check (${conclusion})`)).catch((err) => log.debug(`status checks: ${RUN_STATUS_CHECK_NAME} post failed: ${err}`));
|
|
197522
197257
|
}
|
|
197523
|
-
if (!needsApprovalCheck
|
|
197258
|
+
if (!needsApprovalCheck) return;
|
|
197259
|
+
const verdict = approval ? { wouldApprove: approval.wouldApprove, sha: approval.sha ?? headSha, carriedLine: "" } : await carriedApproval(ctx, pullNumber).catch((err) => {
|
|
197260
|
+
log.debug(`status checks: ${APPROVAL_CHECK_NAME} carry-forward failed: ${err}`);
|
|
197261
|
+
return void 0;
|
|
197262
|
+
});
|
|
197263
|
+
if (!verdict) return;
|
|
197524
197264
|
const createParams = {
|
|
197525
197265
|
owner: ctx.repo.owner,
|
|
197526
197266
|
repo: ctx.repo.name,
|
|
197527
197267
|
name: APPROVAL_CHECK_NAME,
|
|
197528
|
-
head_sha:
|
|
197268
|
+
head_sha: verdict.sha,
|
|
197529
197269
|
status: "completed",
|
|
197530
|
-
conclusion:
|
|
197270
|
+
conclusion: verdict.wouldApprove ? "success" : "failure",
|
|
197531
197271
|
output: {
|
|
197532
|
-
title:
|
|
197533
|
-
summary:
|
|
197272
|
+
title: verdict.wouldApprove ? "Pullfrog would approve" : "Pullfrog would not approve",
|
|
197273
|
+
summary: (verdict.wouldApprove ? "Pullfrog has no outstanding review feedback on this PR." : "Pullfrog has outstanding review feedback or requested changes on this PR.") + verdict.carriedLine
|
|
197534
197274
|
}
|
|
197535
197275
|
};
|
|
197536
197276
|
if (detailsUrl) createParams.details_url = detailsUrl;
|
|
197537
197277
|
await ctx.octokit.rest.checks.create(createParams).then(() => log.info(`\xBB posted ${APPROVAL_CHECK_NAME} check`)).catch((err) => log.debug(`status checks: ${APPROVAL_CHECK_NAME} post failed: ${err}`));
|
|
197538
197278
|
}
|
|
197279
|
+
async function carriedApproval(ctx, pullNumber) {
|
|
197280
|
+
const primary = primaryRepoState(ctx.toolState);
|
|
197281
|
+
if (!primary.beforeSha || !primary.checkoutSha) return void 0;
|
|
197282
|
+
if (await latestApprovalConclusion(ctx, primary.checkoutSha) !== void 0) return void 0;
|
|
197283
|
+
const prior = await latestApprovalConclusion(ctx, primary.beforeSha);
|
|
197284
|
+
if (prior === void 0) return void 0;
|
|
197285
|
+
const from = primary.beforeSha.slice(0, 7);
|
|
197286
|
+
if (prior !== "success") {
|
|
197287
|
+
const carriedLine = `
|
|
197288
|
+
|
|
197289
|
+
No review covered this commit, so the verdict on ${from} carries forward.`;
|
|
197290
|
+
return { wouldApprove: false, sha: primary.checkoutSha, carriedLine };
|
|
197291
|
+
}
|
|
197292
|
+
if (ctx.toolState.noReviewNeededSha !== primary.checkoutSha) return void 0;
|
|
197293
|
+
return {
|
|
197294
|
+
wouldApprove: await countOutstandingPullfrogThreads(ctx, pullNumber) === 0,
|
|
197295
|
+
sha: primary.checkoutSha,
|
|
197296
|
+
carriedLine: `
|
|
197297
|
+
|
|
197298
|
+
Pullfrog found nothing to review in the commits since ${from}.`
|
|
197299
|
+
};
|
|
197300
|
+
}
|
|
197301
|
+
async function latestApprovalConclusion(ctx, ref) {
|
|
197302
|
+
const result = await ctx.octokit.rest.checks.listForRef({
|
|
197303
|
+
owner: ctx.repo.owner,
|
|
197304
|
+
repo: ctx.repo.name,
|
|
197305
|
+
ref,
|
|
197306
|
+
check_name: APPROVAL_CHECK_NAME,
|
|
197307
|
+
status: "completed"
|
|
197308
|
+
});
|
|
197309
|
+
const latest = result.data.check_runs.filter((run) => run.app?.slug !== GITHUB_ACTIONS_APP_SLUG).sort((a, b) => (b.completed_at ?? "").localeCompare(a.completed_at ?? ""))[0];
|
|
197310
|
+
return latest?.conclusion ?? void 0;
|
|
197311
|
+
}
|
|
197539
197312
|
|
|
197540
197313
|
// utils/runLifecycle.ts
|
|
197541
197314
|
async function persistRunArtifacts(toolContext) {
|
|
@@ -197874,6 +197647,7 @@ async function main() {
|
|
|
197874
197647
|
octokit: initialOctokit,
|
|
197875
197648
|
token: jobToken,
|
|
197876
197649
|
runType: typeof resolvedPromptInput === "string" ? void 0 : resolvedPromptInput.type,
|
|
197650
|
+
plainPrompt: typeof resolvedPromptInput === "string",
|
|
197877
197651
|
routedTier: typeof resolvedPromptInput === "string" ? void 0 : resolvedPromptInput.routing?.tier
|
|
197878
197652
|
});
|
|
197879
197653
|
timer.checkpoint("runContextData");
|
|
@@ -197970,7 +197744,7 @@ async function main() {
|
|
|
197970
197744
|
oidc: oidcCredentials
|
|
197971
197745
|
}), true);
|
|
197972
197746
|
wipeRunnerLeakSurface();
|
|
197973
|
-
if (payload.shell === "
|
|
197747
|
+
if (payload.shell !== "disabled" && process.env.CI === "true" && getSandboxMethod() === "none") {
|
|
197974
197748
|
payload.shell = "disabled";
|
|
197975
197749
|
log.warning(
|
|
197976
197750
|
"\xBB shell commands are disabled for this run: this runner provides no PID-namespace isolation (unprivileged unshare, sudo unshare and userns-nested unshare all failed). on a self-hosted Kubernetes/ARC runner, allow user-namespace creation in the pod's seccomp profile \u2014 see https://docs.pullfrog.com/security#self-hosted-runners"
|
|
@@ -197991,6 +197765,7 @@ async function main() {
|
|
|
197991
197765
|
const octokit = createOctokit(tokenRef.mcpToken, getMcpTokenRefresh());
|
|
197992
197766
|
const runInfo = await resolveRun({ octokit });
|
|
197993
197767
|
let toolContext;
|
|
197768
|
+
let succeeded = false;
|
|
197994
197769
|
let progressCallbackDisabled = false;
|
|
197995
197770
|
let todoTracker;
|
|
197996
197771
|
let vertexCredentials;
|
|
@@ -198408,11 +198183,13 @@ ${instructions.user}` : null,
|
|
|
198408
198183
|
);
|
|
198409
198184
|
}
|
|
198410
198185
|
await finalizeSuccessRun({ toolContext, toolState, result, repo: runContext.repo });
|
|
198411
|
-
|
|
198186
|
+
const outcome = await handleAgentResult({
|
|
198412
198187
|
result,
|
|
198413
198188
|
toolContext,
|
|
198414
198189
|
silent: payload.event.silent ?? false
|
|
198415
198190
|
});
|
|
198191
|
+
succeeded = outcome.success;
|
|
198192
|
+
return outcome;
|
|
198416
198193
|
} catch (_2) {
|
|
198417
198194
|
var _error2 = _2, _hasError2 = true;
|
|
198418
198195
|
} finally {
|
|
@@ -198458,9 +198235,8 @@ ${instructions.user}` : null,
|
|
|
198458
198235
|
if (toolState.model) patch.model = toolState.model;
|
|
198459
198236
|
if (toolState.agent) patch.agent = toolState.agent;
|
|
198460
198237
|
if (toolState.credential) patch.credential = toolState.credential;
|
|
198461
|
-
|
|
198462
|
-
|
|
198463
|
-
}
|
|
198238
|
+
patch.succeeded = succeeded;
|
|
198239
|
+
await patchWorkflowRunFields(toolContext, patch);
|
|
198464
198240
|
}
|
|
198465
198241
|
cleanupVertexCredentials(vertexCredentials);
|
|
198466
198242
|
}
|