@debugbundle/mcp 1.13.1 → 1.15.0
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 +49 -14
- package/dist/main.cjs +751 -387
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/main.cjs
CHANGED
|
@@ -1198,8 +1198,8 @@ var require_util = __commonJS({
|
|
|
1198
1198
|
if (body == null) {
|
|
1199
1199
|
return 0;
|
|
1200
1200
|
} else if (isStream(body)) {
|
|
1201
|
-
const
|
|
1202
|
-
return
|
|
1201
|
+
const state2 = body._readableState;
|
|
1202
|
+
return state2 && state2.objectMode === false && state2.ended === true && Number.isFinite(state2.length) ? state2.length : null;
|
|
1203
1203
|
} else if (isBlobLike(body)) {
|
|
1204
1204
|
return body.size != null ? body.size : null;
|
|
1205
1205
|
} else if (isBuffer(body)) {
|
|
@@ -5814,7 +5814,7 @@ var require_formdata = __commonJS({
|
|
|
5814
5814
|
}
|
|
5815
5815
|
}
|
|
5816
5816
|
[nodeUtil.inspect.custom](depth, options) {
|
|
5817
|
-
const
|
|
5817
|
+
const state2 = this.#state.reduce((a, b) => {
|
|
5818
5818
|
if (a[b.name]) {
|
|
5819
5819
|
if (Array.isArray(a[b.name])) {
|
|
5820
5820
|
a[b.name].push(b.value);
|
|
@@ -5828,7 +5828,7 @@ var require_formdata = __commonJS({
|
|
|
5828
5828
|
}, { __proto__: null });
|
|
5829
5829
|
options.depth ??= depth;
|
|
5830
5830
|
options.colors ??= true;
|
|
5831
|
-
const output = nodeUtil.formatWithOptions(options,
|
|
5831
|
+
const output = nodeUtil.formatWithOptions(options, state2);
|
|
5832
5832
|
return `FormData ${output.slice(output.indexOf("]") + 2)}`;
|
|
5833
5833
|
}
|
|
5834
5834
|
static {
|
|
@@ -7989,8 +7989,8 @@ var require_client_h2 = __commonJS({
|
|
|
7989
7989
|
return body == null || util4.isBuffer(body) || util4.isBlobLike(body);
|
|
7990
7990
|
}
|
|
7991
7991
|
function hasResponseStarted(request) {
|
|
7992
|
-
const
|
|
7993
|
-
return
|
|
7992
|
+
const state2 = request[kRequestStream]?.[kRequestStreamState];
|
|
7993
|
+
return state2?.responseReceived === true;
|
|
7994
7994
|
}
|
|
7995
7995
|
function registerGoAwayRefusal(request) {
|
|
7996
7996
|
const attempts = (request[kGoAwayReplayAttempts] ?? 0) + 1;
|
|
@@ -8131,16 +8131,16 @@ var require_client_h2 = __commonJS({
|
|
|
8131
8131
|
};
|
|
8132
8132
|
}
|
|
8133
8133
|
function refH2Session(session) {
|
|
8134
|
-
const
|
|
8135
|
-
if (
|
|
8136
|
-
|
|
8134
|
+
const state2 = session[kHTTP2SessionState];
|
|
8135
|
+
if (state2.refed === false) {
|
|
8136
|
+
state2.refed = true;
|
|
8137
8137
|
session.ref();
|
|
8138
8138
|
}
|
|
8139
8139
|
}
|
|
8140
8140
|
function unrefH2Session(session) {
|
|
8141
|
-
const
|
|
8142
|
-
if (
|
|
8143
|
-
|
|
8141
|
+
const state2 = session[kHTTP2SessionState];
|
|
8142
|
+
if (state2.refed === true) {
|
|
8143
|
+
state2.refed = false;
|
|
8144
8144
|
session.unref();
|
|
8145
8145
|
}
|
|
8146
8146
|
}
|
|
@@ -8166,25 +8166,25 @@ var require_client_h2 = __commonJS({
|
|
|
8166
8166
|
}
|
|
8167
8167
|
}
|
|
8168
8168
|
function clearNoStreamsTimeout(session) {
|
|
8169
|
-
const
|
|
8170
|
-
if (
|
|
8171
|
-
clearTimeout(
|
|
8172
|
-
|
|
8169
|
+
const state2 = session[kHTTP2SessionState];
|
|
8170
|
+
if (state2?.noStreamsTimeout != null) {
|
|
8171
|
+
clearTimeout(state2.noStreamsTimeout);
|
|
8172
|
+
state2.noStreamsTimeout = null;
|
|
8173
8173
|
}
|
|
8174
8174
|
}
|
|
8175
8175
|
function setNoStreamsTimeout(session) {
|
|
8176
8176
|
const client = session[kClient];
|
|
8177
|
-
const
|
|
8177
|
+
const state2 = session[kHTTP2SessionState];
|
|
8178
8178
|
const timeout = client[kHeadersTimeout];
|
|
8179
|
-
if (!timeout ||
|
|
8179
|
+
if (!timeout || state2.noStreamsTimeout != null) {
|
|
8180
8180
|
return;
|
|
8181
8181
|
}
|
|
8182
|
-
|
|
8182
|
+
state2.noStreamsTimeout = setTimeout(onNoStreamsTimeout, timeout, session).unref();
|
|
8183
8183
|
}
|
|
8184
8184
|
function onNoStreamsTimeout(session) {
|
|
8185
8185
|
const client = session[kClient];
|
|
8186
|
-
const
|
|
8187
|
-
|
|
8186
|
+
const state2 = session[kHTTP2SessionState];
|
|
8187
|
+
state2.noStreamsTimeout = null;
|
|
8188
8188
|
if (client[kHTTP2Session] !== session || client[kMaxConcurrentStreams] !== 0 || client[kRunning] !== 0 || client[kPending] === 0) {
|
|
8189
8189
|
return;
|
|
8190
8190
|
}
|
|
@@ -8201,10 +8201,10 @@ var require_client_h2 = __commonJS({
|
|
|
8201
8201
|
resetHttp2Session(session, err);
|
|
8202
8202
|
}
|
|
8203
8203
|
function clearHttp2IdleTimeout(session) {
|
|
8204
|
-
const
|
|
8205
|
-
if (
|
|
8206
|
-
clearTimeout(
|
|
8207
|
-
|
|
8204
|
+
const state2 = session[kHTTP2SessionState];
|
|
8205
|
+
if (state2?.idleTimeout != null) {
|
|
8206
|
+
clearTimeout(state2.idleTimeout);
|
|
8207
|
+
state2.idleTimeout = null;
|
|
8208
8208
|
}
|
|
8209
8209
|
}
|
|
8210
8210
|
function setHttp2IdleTimeout(session) {
|
|
@@ -8216,16 +8216,16 @@ var require_client_h2 = __commonJS({
|
|
|
8216
8216
|
clearHttp2IdleTimeout(session);
|
|
8217
8217
|
return;
|
|
8218
8218
|
}
|
|
8219
|
-
const
|
|
8220
|
-
if (
|
|
8221
|
-
|
|
8219
|
+
const state2 = session[kHTTP2SessionState];
|
|
8220
|
+
if (state2.idleTimeout == null) {
|
|
8221
|
+
state2.idleTimeout = setTimeout(onHttp2SessionIdleTimeout, client[kKeepAliveDefaultTimeout], session).unref();
|
|
8222
8222
|
}
|
|
8223
8223
|
}
|
|
8224
8224
|
function onHttp2SessionIdleTimeout(session) {
|
|
8225
8225
|
const client = session[kClient];
|
|
8226
8226
|
const socket = session[kSocket];
|
|
8227
|
-
const
|
|
8228
|
-
|
|
8227
|
+
const state2 = session[kHTTP2SessionState];
|
|
8228
|
+
state2.idleTimeout = null;
|
|
8229
8229
|
if (client[kHTTP2Session] !== session || session[kOpenStreams] !== 0 || client[kSize] !== 0 || session.closed || session.destroyed) {
|
|
8230
8230
|
return;
|
|
8231
8231
|
}
|
|
@@ -8254,10 +8254,10 @@ var require_client_h2 = __commonJS({
|
|
|
8254
8254
|
this[kClient][kResume]();
|
|
8255
8255
|
}
|
|
8256
8256
|
function onHttp2SendPing(session) {
|
|
8257
|
-
const
|
|
8258
|
-
if ((session.closed || session.destroyed) &&
|
|
8259
|
-
clearInterval(
|
|
8260
|
-
|
|
8257
|
+
const state2 = session[kHTTP2SessionState];
|
|
8258
|
+
if ((session.closed || session.destroyed) && state2.ping.interval != null) {
|
|
8259
|
+
clearInterval(state2.ping.interval);
|
|
8260
|
+
state2.ping.interval = null;
|
|
8261
8261
|
return;
|
|
8262
8262
|
}
|
|
8263
8263
|
session.ping(onPing.bind(session));
|
|
@@ -8337,7 +8337,7 @@ var require_client_h2 = __commonJS({
|
|
|
8337
8337
|
client[kResume]();
|
|
8338
8338
|
}
|
|
8339
8339
|
function onHttp2SessionClose() {
|
|
8340
|
-
const { [kClient]: client, [kHTTP2SessionState]:
|
|
8340
|
+
const { [kClient]: client, [kHTTP2SessionState]: state2, [kSocket]: socket } = this;
|
|
8341
8341
|
const err = socket[kError] || this[kError] || new SocketError("closed", util4.getSocketInfo(socket));
|
|
8342
8342
|
if (client[kHTTP2Session] === this) {
|
|
8343
8343
|
client[kSocket] = null;
|
|
@@ -8346,9 +8346,9 @@ var require_client_h2 = __commonJS({
|
|
|
8346
8346
|
}
|
|
8347
8347
|
clearHttp2IdleTimeout(this);
|
|
8348
8348
|
clearNoStreamsTimeout(this);
|
|
8349
|
-
if (
|
|
8350
|
-
clearInterval(
|
|
8351
|
-
|
|
8349
|
+
if (state2.ping.interval != null) {
|
|
8350
|
+
clearInterval(state2.ping.interval);
|
|
8351
|
+
state2.ping.interval = null;
|
|
8352
8352
|
}
|
|
8353
8353
|
if (client.destroyed) {
|
|
8354
8354
|
assert6(client[kPending] === 0);
|
|
@@ -8409,27 +8409,27 @@ var require_client_h2 = __commonJS({
|
|
|
8409
8409
|
}
|
|
8410
8410
|
function onUpgradeStreamClose() {
|
|
8411
8411
|
this.off("error", noop);
|
|
8412
|
-
const
|
|
8412
|
+
const state2 = this[kRequestStreamState];
|
|
8413
8413
|
this[kRequestStreamState] = null;
|
|
8414
|
-
failUpgradeStream(
|
|
8414
|
+
failUpgradeStream(state2, new InformationalError("HTTP/2: stream closed before response headers"));
|
|
8415
8415
|
closeStreamSession(this);
|
|
8416
8416
|
}
|
|
8417
8417
|
function completeRequestStream() {
|
|
8418
|
-
const
|
|
8419
|
-
if (
|
|
8418
|
+
const state2 = this[kRequestStreamState];
|
|
8419
|
+
if (state2 == null) {
|
|
8420
8420
|
return;
|
|
8421
8421
|
}
|
|
8422
8422
|
releaseRequestStream(this);
|
|
8423
|
-
if (
|
|
8424
|
-
|
|
8425
|
-
} else if (!
|
|
8423
|
+
if (state2.pendingEnd && !state2.request.aborted && !state2.request.completed) {
|
|
8424
|
+
state2.request.onResponseEnd(state2.trailers || {});
|
|
8425
|
+
} else if (!state2.request.aborted && !state2.request.completed) {
|
|
8426
8426
|
util4.errorRequest(
|
|
8427
|
-
|
|
8428
|
-
|
|
8427
|
+
state2.client,
|
|
8428
|
+
state2.request,
|
|
8429
8429
|
new InformationalError("HTTP/2: stream closed before the response was complete")
|
|
8430
8430
|
);
|
|
8431
8431
|
}
|
|
8432
|
-
finalizeRequest(
|
|
8432
|
+
finalizeRequest(state2);
|
|
8433
8433
|
closeStreamSession(this);
|
|
8434
8434
|
this[kRequestStreamState] = null;
|
|
8435
8435
|
}
|
|
@@ -8471,11 +8471,11 @@ var require_client_h2 = __commonJS({
|
|
|
8471
8471
|
if (stream == null) {
|
|
8472
8472
|
return;
|
|
8473
8473
|
}
|
|
8474
|
-
const
|
|
8475
|
-
if (
|
|
8474
|
+
const state2 = stream[kRequestStreamState];
|
|
8475
|
+
if (state2 == null) {
|
|
8476
8476
|
return;
|
|
8477
8477
|
}
|
|
8478
|
-
const { request } =
|
|
8478
|
+
const { request } = state2;
|
|
8479
8479
|
if (request[kRequestStream] === stream) {
|
|
8480
8480
|
detachRequestFromStream(request);
|
|
8481
8481
|
}
|
|
@@ -8484,43 +8484,43 @@ var require_client_h2 = __commonJS({
|
|
|
8484
8484
|
stream.once("error", noop);
|
|
8485
8485
|
}
|
|
8486
8486
|
}
|
|
8487
|
-
function failUpgradeStream(
|
|
8488
|
-
if (
|
|
8487
|
+
function failUpgradeStream(state2, err) {
|
|
8488
|
+
if (state2 == null) {
|
|
8489
8489
|
return;
|
|
8490
8490
|
}
|
|
8491
|
-
const { request } =
|
|
8492
|
-
if (
|
|
8491
|
+
const { request } = state2;
|
|
8492
|
+
if (state2.responseReceived || request.aborted || request.completed) {
|
|
8493
8493
|
return;
|
|
8494
8494
|
}
|
|
8495
|
-
releaseUpgradeStream(
|
|
8496
|
-
|
|
8495
|
+
releaseUpgradeStream(state2.stream);
|
|
8496
|
+
state2.abort(err, true);
|
|
8497
8497
|
}
|
|
8498
8498
|
function onUpgradeStreamError() {
|
|
8499
|
-
const
|
|
8499
|
+
const state2 = this[kRequestStreamState];
|
|
8500
8500
|
if (typeof this.rstCode === "number" && this.rstCode !== 0) {
|
|
8501
|
-
failUpgradeStream(
|
|
8501
|
+
failUpgradeStream(state2, new InformationalError(`HTTP/2: "stream error" received - code ${this.rstCode}`));
|
|
8502
8502
|
} else {
|
|
8503
|
-
failUpgradeStream(
|
|
8503
|
+
failUpgradeStream(state2, new InformationalError("HTTP/2: stream errored before response headers"));
|
|
8504
8504
|
}
|
|
8505
8505
|
}
|
|
8506
8506
|
function onUpgradeStreamEnd() {
|
|
8507
8507
|
failUpgradeStream(this[kRequestStreamState], new InformationalError("HTTP/2: stream half-closed (remote)"));
|
|
8508
8508
|
}
|
|
8509
8509
|
function onUpgradeStreamTimeout() {
|
|
8510
|
-
const
|
|
8511
|
-
failUpgradeStream(
|
|
8510
|
+
const state2 = this[kRequestStreamState];
|
|
8511
|
+
failUpgradeStream(state2, new InformationalError(`HTTP/2: "stream timeout after ${state2.headersTimeout}"`));
|
|
8512
8512
|
}
|
|
8513
8513
|
function onUpgradeResponse(headers, _flags) {
|
|
8514
8514
|
const stream = this;
|
|
8515
|
-
const
|
|
8516
|
-
const { request } =
|
|
8517
|
-
|
|
8515
|
+
const state2 = stream[kRequestStreamState];
|
|
8516
|
+
const { request } = state2;
|
|
8517
|
+
state2.responseReceived = true;
|
|
8518
8518
|
const statusCode = headers[HTTP2_HEADER_STATUS];
|
|
8519
8519
|
delete headers[HTTP2_HEADER_STATUS];
|
|
8520
8520
|
try {
|
|
8521
8521
|
request.onRequestUpgrade(statusCode, headers, stream);
|
|
8522
8522
|
} catch (err) {
|
|
8523
|
-
|
|
8523
|
+
state2.abort(err);
|
|
8524
8524
|
return;
|
|
8525
8525
|
}
|
|
8526
8526
|
if (request.aborted) {
|
|
@@ -8528,14 +8528,14 @@ var require_client_h2 = __commonJS({
|
|
|
8528
8528
|
}
|
|
8529
8529
|
removeUpgradeStreamListeners(stream);
|
|
8530
8530
|
detachRequestFromStream(request);
|
|
8531
|
-
finalizeRequest(
|
|
8531
|
+
finalizeRequest(state2);
|
|
8532
8532
|
}
|
|
8533
|
-
function setupUpgradeStream(stream,
|
|
8534
|
-
const { request, headersTimeout, session } =
|
|
8533
|
+
function setupUpgradeStream(stream, state2) {
|
|
8534
|
+
const { request, headersTimeout, session } = state2;
|
|
8535
8535
|
stream[kHTTP2Stream] = true;
|
|
8536
8536
|
stream[kHTTP2Session] = session;
|
|
8537
|
-
stream[kRequestStreamState] =
|
|
8538
|
-
|
|
8537
|
+
stream[kRequestStreamState] = state2;
|
|
8538
|
+
state2.stream = stream;
|
|
8539
8539
|
bindRequestToStream(request, stream, releaseUpgradeStream);
|
|
8540
8540
|
stream.once("response", onUpgradeResponse);
|
|
8541
8541
|
stream.on("error", onUpgradeStreamError);
|
|
@@ -8546,13 +8546,13 @@ var require_client_h2 = __commonJS({
|
|
|
8546
8546
|
++session[kOpenStreams];
|
|
8547
8547
|
stream.setTimeout(headersTimeout);
|
|
8548
8548
|
}
|
|
8549
|
-
function finalizeRequest(
|
|
8550
|
-
if (
|
|
8549
|
+
function finalizeRequest(state2, resetPendingIdx = false) {
|
|
8550
|
+
if (state2.requestFinalized) {
|
|
8551
8551
|
return;
|
|
8552
8552
|
}
|
|
8553
|
-
|
|
8554
|
-
completeRequest(
|
|
8555
|
-
|
|
8553
|
+
state2.requestFinalized = true;
|
|
8554
|
+
completeRequest(state2.client, state2.request, resetPendingIdx);
|
|
8555
|
+
state2.client[kResume]();
|
|
8556
8556
|
}
|
|
8557
8557
|
function openStream(client, request, session, abort, headers, options) {
|
|
8558
8558
|
try {
|
|
@@ -8587,7 +8587,7 @@ var require_client_h2 = __commonJS({
|
|
|
8587
8587
|
const headers = buildRequestHeaders(reqHeaders);
|
|
8588
8588
|
headers[HTTP2_HEADER_AUTHORITY] = host || client[kHostAuthority];
|
|
8589
8589
|
headers[HTTP2_HEADER_METHOD] = method;
|
|
8590
|
-
const
|
|
8590
|
+
const state2 = {
|
|
8591
8591
|
abort: null,
|
|
8592
8592
|
body: request.body,
|
|
8593
8593
|
bytesRead: 0,
|
|
@@ -8613,19 +8613,19 @@ var require_client_h2 = __commonJS({
|
|
|
8613
8613
|
}
|
|
8614
8614
|
err = err || new RequestAbortedError();
|
|
8615
8615
|
util4.errorRequest(client, request, err);
|
|
8616
|
-
if (
|
|
8616
|
+
if (state2.stream != null) {
|
|
8617
8617
|
clearRequestStream(request);
|
|
8618
|
-
const stream2 =
|
|
8618
|
+
const stream2 = state2.stream;
|
|
8619
8619
|
stream2.close();
|
|
8620
8620
|
if (!stream2.destroyed) {
|
|
8621
8621
|
util4.destroy(stream2);
|
|
8622
8622
|
}
|
|
8623
8623
|
client[kOnError](err);
|
|
8624
|
-
finalizeRequest(
|
|
8624
|
+
finalizeRequest(state2, resetPendingIdx);
|
|
8625
8625
|
}
|
|
8626
|
-
util4.destroy(
|
|
8626
|
+
util4.destroy(state2.body, err);
|
|
8627
8627
|
};
|
|
8628
|
-
|
|
8628
|
+
state2.abort = abort;
|
|
8629
8629
|
let stream = null;
|
|
8630
8630
|
try {
|
|
8631
8631
|
request.onRequestStart(abort, null);
|
|
@@ -8656,7 +8656,7 @@ var require_client_h2 = __commonJS({
|
|
|
8656
8656
|
unrefH2Session(session);
|
|
8657
8657
|
return false;
|
|
8658
8658
|
}
|
|
8659
|
-
setupUpgradeStream(stream,
|
|
8659
|
+
setupUpgradeStream(stream, state2);
|
|
8660
8660
|
return true;
|
|
8661
8661
|
}
|
|
8662
8662
|
stream = openStream(client, request, session, abort, headers, { endStream: false, signal });
|
|
@@ -8664,13 +8664,13 @@ var require_client_h2 = __commonJS({
|
|
|
8664
8664
|
unrefH2Session(session);
|
|
8665
8665
|
return false;
|
|
8666
8666
|
}
|
|
8667
|
-
setupUpgradeStream(stream,
|
|
8667
|
+
setupUpgradeStream(stream, state2);
|
|
8668
8668
|
return true;
|
|
8669
8669
|
}
|
|
8670
8670
|
headers[HTTP2_HEADER_PATH] = path;
|
|
8671
8671
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
8672
8672
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
8673
|
-
let body =
|
|
8673
|
+
let body = state2.body;
|
|
8674
8674
|
if (body && typeof body.read === "function") {
|
|
8675
8675
|
body.read(0);
|
|
8676
8676
|
}
|
|
@@ -8709,9 +8709,9 @@ var require_client_h2 = __commonJS({
|
|
|
8709
8709
|
channels.sendHeaders.publish({ request, headers: header2, socket: session[kSocket] });
|
|
8710
8710
|
}
|
|
8711
8711
|
const shouldEndStream = body === null || contentLength === 0;
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8712
|
+
state2.body = body;
|
|
8713
|
+
state2.contentLength = contentLength;
|
|
8714
|
+
state2.expectsPayload = expectsPayload;
|
|
8715
8715
|
if (expectContinue) {
|
|
8716
8716
|
headers[HTTP2_HEADER_EXPECT] = "100-continue";
|
|
8717
8717
|
}
|
|
@@ -8720,8 +8720,8 @@ var require_client_h2 = __commonJS({
|
|
|
8720
8720
|
return false;
|
|
8721
8721
|
}
|
|
8722
8722
|
stream[kHTTP2Stream] = true;
|
|
8723
|
-
stream[kRequestStreamState] =
|
|
8724
|
-
|
|
8723
|
+
stream[kRequestStreamState] = state2;
|
|
8724
|
+
state2.stream = stream;
|
|
8725
8725
|
clearHttp2IdleTimeout(session);
|
|
8726
8726
|
++session[kOpenStreams];
|
|
8727
8727
|
if (headersTimeout) {
|
|
@@ -8765,11 +8765,11 @@ var require_client_h2 = __commonJS({
|
|
|
8765
8765
|
if (stream == null) {
|
|
8766
8766
|
return;
|
|
8767
8767
|
}
|
|
8768
|
-
const
|
|
8769
|
-
if (
|
|
8768
|
+
const state2 = stream[kRequestStreamState];
|
|
8769
|
+
if (state2 == null) {
|
|
8770
8770
|
return;
|
|
8771
8771
|
}
|
|
8772
|
-
const { request } =
|
|
8772
|
+
const { request } = state2;
|
|
8773
8773
|
if (request[kRequestStream] === stream) {
|
|
8774
8774
|
detachRequestFromStream(request);
|
|
8775
8775
|
}
|
|
@@ -8780,34 +8780,34 @@ var require_client_h2 = __commonJS({
|
|
|
8780
8780
|
}
|
|
8781
8781
|
function onData(chunk) {
|
|
8782
8782
|
const stream = this;
|
|
8783
|
-
const
|
|
8784
|
-
if (
|
|
8783
|
+
const state2 = stream[kRequestStreamState];
|
|
8784
|
+
if (state2 == null) {
|
|
8785
8785
|
return;
|
|
8786
8786
|
}
|
|
8787
|
-
const { request, maxResponseSize, responseContentLength } =
|
|
8787
|
+
const { request, maxResponseSize, responseContentLength } = state2;
|
|
8788
8788
|
if (request.aborted || request.completed) {
|
|
8789
8789
|
return;
|
|
8790
8790
|
}
|
|
8791
|
-
if (responseContentLength != null &&
|
|
8792
|
-
|
|
8791
|
+
if (responseContentLength != null && state2.bytesRead + chunk.length > responseContentLength) {
|
|
8792
|
+
state2.abort(new ResponseContentLengthMismatchError());
|
|
8793
8793
|
return;
|
|
8794
8794
|
}
|
|
8795
|
-
if (maxResponseSize > -1 &&
|
|
8796
|
-
|
|
8795
|
+
if (maxResponseSize > -1 && state2.bytesRead + chunk.length > maxResponseSize) {
|
|
8796
|
+
state2.abort(new ResponseExceededMaxSizeError());
|
|
8797
8797
|
return;
|
|
8798
8798
|
}
|
|
8799
|
-
|
|
8799
|
+
state2.bytesRead += chunk.length;
|
|
8800
8800
|
if (request.onResponseData(chunk) === false) {
|
|
8801
8801
|
stream.pause();
|
|
8802
8802
|
}
|
|
8803
8803
|
}
|
|
8804
8804
|
function onInterimResponse(headers) {
|
|
8805
8805
|
const stream = this;
|
|
8806
|
-
const
|
|
8807
|
-
if (
|
|
8806
|
+
const state2 = stream[kRequestStreamState];
|
|
8807
|
+
if (state2 == null) {
|
|
8808
8808
|
return;
|
|
8809
8809
|
}
|
|
8810
|
-
const { request } =
|
|
8810
|
+
const { request } = state2;
|
|
8811
8811
|
if (request.aborted || request.completed) {
|
|
8812
8812
|
return;
|
|
8813
8813
|
}
|
|
@@ -8817,26 +8817,26 @@ var require_client_h2 = __commonJS({
|
|
|
8817
8817
|
}
|
|
8818
8818
|
function onResponse(headers) {
|
|
8819
8819
|
const stream = this;
|
|
8820
|
-
const
|
|
8821
|
-
if (
|
|
8820
|
+
const state2 = stream[kRequestStreamState];
|
|
8821
|
+
if (state2 == null) {
|
|
8822
8822
|
return;
|
|
8823
8823
|
}
|
|
8824
|
-
const { request } =
|
|
8824
|
+
const { request } = state2;
|
|
8825
8825
|
stream.off("response", onResponse);
|
|
8826
|
-
if (
|
|
8826
|
+
if (state2.body != null && !state2.bodySent && !stream.writableEnded) {
|
|
8827
8827
|
stream.removeListener("continue", writeBodyH2);
|
|
8828
8828
|
stream.end();
|
|
8829
8829
|
}
|
|
8830
8830
|
const statusCode = Number(headers[HTTP2_HEADER_STATUS]);
|
|
8831
8831
|
delete headers[HTTP2_HEADER_STATUS];
|
|
8832
8832
|
request.onResponseStarted();
|
|
8833
|
-
|
|
8833
|
+
state2.responseReceived = true;
|
|
8834
8834
|
if (request.method !== "HEAD" && statusCode !== 304) {
|
|
8835
8835
|
const contentLength = headers[HTTP2_HEADER_CONTENT_LENGTH];
|
|
8836
|
-
|
|
8836
|
+
state2.responseContentLength = contentLength == null ? null : Number(contentLength);
|
|
8837
8837
|
}
|
|
8838
|
-
if (
|
|
8839
|
-
stream.setTimeout(
|
|
8838
|
+
if (state2.headersTimeout || state2.bodyTimeout) {
|
|
8839
|
+
stream.setTimeout(state2.bodyTimeout);
|
|
8840
8840
|
}
|
|
8841
8841
|
if (request.aborted || request.completed) {
|
|
8842
8842
|
releaseRequestStream(stream);
|
|
@@ -8849,34 +8849,34 @@ var require_client_h2 = __commonJS({
|
|
|
8849
8849
|
}
|
|
8850
8850
|
function onEnd() {
|
|
8851
8851
|
const stream = this;
|
|
8852
|
-
const
|
|
8853
|
-
if (
|
|
8852
|
+
const state2 = stream[kRequestStreamState];
|
|
8853
|
+
if (state2 == null) {
|
|
8854
8854
|
return;
|
|
8855
8855
|
}
|
|
8856
|
-
const { request } =
|
|
8856
|
+
const { request } = state2;
|
|
8857
8857
|
stream.off("end", onEnd);
|
|
8858
|
-
if (
|
|
8858
|
+
if (state2.responseReceived) {
|
|
8859
8859
|
if (!request.aborted && !request.completed) {
|
|
8860
|
-
if (
|
|
8861
|
-
|
|
8860
|
+
if (state2.responseContentLength != null && state2.bytesRead !== state2.responseContentLength) {
|
|
8861
|
+
state2.abort(new ResponseContentLengthMismatchError());
|
|
8862
8862
|
return;
|
|
8863
8863
|
}
|
|
8864
|
-
|
|
8864
|
+
state2.pendingEnd = true;
|
|
8865
8865
|
completeRequestStream.call(stream);
|
|
8866
8866
|
}
|
|
8867
8867
|
} else {
|
|
8868
|
-
|
|
8868
|
+
state2.abort(new InformationalError("HTTP/2: stream half-closed (remote)"), true);
|
|
8869
8869
|
}
|
|
8870
8870
|
}
|
|
8871
|
-
function retryRefusedStream(stream,
|
|
8872
|
-
const { client, request } =
|
|
8873
|
-
if (
|
|
8871
|
+
function retryRefusedStream(stream, state2) {
|
|
8872
|
+
const { client, request } = state2;
|
|
8873
|
+
if (state2.responseReceived || request.aborted || request.completed || request[kRefusedStreamRetry] || !canReplayRequest(request)) {
|
|
8874
8874
|
return false;
|
|
8875
8875
|
}
|
|
8876
8876
|
request[kRefusedStreamRetry] = true;
|
|
8877
8877
|
detachRequestStreamForClose(request);
|
|
8878
|
-
|
|
8879
|
-
|
|
8878
|
+
state2.stream = null;
|
|
8879
|
+
state2.requestFinalized = true;
|
|
8880
8880
|
completeRequest(client, request);
|
|
8881
8881
|
client[kQueue].splice(client[kPendingIdx], 0, request);
|
|
8882
8882
|
client[kResume]();
|
|
@@ -8884,63 +8884,63 @@ var require_client_h2 = __commonJS({
|
|
|
8884
8884
|
}
|
|
8885
8885
|
function onError(err) {
|
|
8886
8886
|
const stream = this;
|
|
8887
|
-
const
|
|
8888
|
-
if (
|
|
8887
|
+
const state2 = stream[kRequestStreamState];
|
|
8888
|
+
if (state2 == null) {
|
|
8889
8889
|
return;
|
|
8890
8890
|
}
|
|
8891
8891
|
stream.off("error", onError);
|
|
8892
|
-
if (
|
|
8892
|
+
if (state2.responseContentLength != null && state2.bytesRead !== state2.responseContentLength) {
|
|
8893
8893
|
err = new ResponseContentLengthMismatchError();
|
|
8894
8894
|
}
|
|
8895
8895
|
if (typeof stream.rstCode === "number" && stream.rstCode !== NGHTTP2_NO_ERROR) {
|
|
8896
8896
|
err.http2ErrorCode = stream.rstCode;
|
|
8897
8897
|
}
|
|
8898
|
-
if (stream.rstCode === NGHTTP2_REFUSED_STREAM && retryRefusedStream(stream,
|
|
8898
|
+
if (stream.rstCode === NGHTTP2_REFUSED_STREAM && retryRefusedStream(stream, state2)) {
|
|
8899
8899
|
return;
|
|
8900
8900
|
}
|
|
8901
|
-
|
|
8901
|
+
state2.abort(err);
|
|
8902
8902
|
}
|
|
8903
8903
|
function onFrameError(type, code) {
|
|
8904
8904
|
const stream = this;
|
|
8905
|
-
const
|
|
8906
|
-
if (
|
|
8905
|
+
const state2 = stream[kRequestStreamState];
|
|
8906
|
+
if (state2 == null) {
|
|
8907
8907
|
return;
|
|
8908
8908
|
}
|
|
8909
8909
|
stream.off("frameError", onFrameError);
|
|
8910
|
-
|
|
8910
|
+
state2.abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`));
|
|
8911
8911
|
}
|
|
8912
8912
|
function onAborted() {
|
|
8913
8913
|
this.off("data", onData);
|
|
8914
8914
|
}
|
|
8915
8915
|
function onTimeout() {
|
|
8916
8916
|
const stream = this;
|
|
8917
|
-
const
|
|
8918
|
-
if (
|
|
8917
|
+
const state2 = stream[kRequestStreamState];
|
|
8918
|
+
if (state2 == null) {
|
|
8919
8919
|
return;
|
|
8920
8920
|
}
|
|
8921
8921
|
stream.off("timeout", onTimeout);
|
|
8922
|
-
const err =
|
|
8923
|
-
|
|
8922
|
+
const err = state2.responseReceived ? new BodyTimeoutError(`HTTP/2: "stream timeout after ${state2.bodyTimeout}"`) : new HeadersTimeoutError(`HTTP/2: "headers timeout after ${state2.headersTimeout}"`);
|
|
8923
|
+
state2.abort(err);
|
|
8924
8924
|
}
|
|
8925
8925
|
function onTrailers(trailers) {
|
|
8926
8926
|
const stream = this;
|
|
8927
|
-
const
|
|
8928
|
-
if (
|
|
8927
|
+
const state2 = stream[kRequestStreamState];
|
|
8928
|
+
if (state2 == null) {
|
|
8929
8929
|
return;
|
|
8930
8930
|
}
|
|
8931
|
-
const { request } =
|
|
8931
|
+
const { request } = state2;
|
|
8932
8932
|
stream.off("trailers", onTrailers);
|
|
8933
8933
|
stream.off("data", onData);
|
|
8934
8934
|
if (request.aborted || request.completed) {
|
|
8935
8935
|
return;
|
|
8936
8936
|
}
|
|
8937
|
-
|
|
8937
|
+
state2.trailers = trailers;
|
|
8938
8938
|
}
|
|
8939
8939
|
function writeBodyH2() {
|
|
8940
8940
|
const stream = this;
|
|
8941
|
-
const
|
|
8942
|
-
|
|
8943
|
-
const { abort, body, client, contentLength, expectsPayload, request } =
|
|
8941
|
+
const state2 = stream[kRequestStreamState];
|
|
8942
|
+
state2.bodySent = true;
|
|
8943
|
+
const { abort, body, client, contentLength, expectsPayload, request } = state2;
|
|
8944
8944
|
if (!body || contentLength === 0) {
|
|
8945
8945
|
writeBuffer(
|
|
8946
8946
|
abort,
|
|
@@ -12185,7 +12185,7 @@ var require_retry_handler = __commonJS({
|
|
|
12185
12185
|
onRequestUpgrade(_controller, statusCode, headers, socket) {
|
|
12186
12186
|
this.handler.onRequestUpgrade?.(this.controllerProxy, statusCode, headers, socket);
|
|
12187
12187
|
}
|
|
12188
|
-
static [kRetryHandlerDefaultRetry](err, { state, opts }, cb) {
|
|
12188
|
+
static [kRetryHandlerDefaultRetry](err, { state: state2, opts }, cb) {
|
|
12189
12189
|
const { statusCode, code, headers } = err;
|
|
12190
12190
|
const { method, retryOptions } = opts;
|
|
12191
12191
|
const {
|
|
@@ -12198,7 +12198,7 @@ var require_retry_handler = __commonJS({
|
|
|
12198
12198
|
methods,
|
|
12199
12199
|
retryAfter
|
|
12200
12200
|
} = retryOptions;
|
|
12201
|
-
const { counter } =
|
|
12201
|
+
const { counter } = state2;
|
|
12202
12202
|
if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) {
|
|
12203
12203
|
cb(err);
|
|
12204
12204
|
return;
|
|
@@ -12816,24 +12816,24 @@ var require_readable = __commonJS({
|
|
|
12816
12816
|
if (consume2.body === null) {
|
|
12817
12817
|
return;
|
|
12818
12818
|
}
|
|
12819
|
-
const { _readableState:
|
|
12820
|
-
if (
|
|
12821
|
-
const start =
|
|
12822
|
-
const end =
|
|
12819
|
+
const { _readableState: state2 } = consume2.stream;
|
|
12820
|
+
if (state2.bufferIndex) {
|
|
12821
|
+
const start = state2.bufferIndex;
|
|
12822
|
+
const end = state2.buffer.length;
|
|
12823
12823
|
for (let n = start; n < end; n++) {
|
|
12824
|
-
consumePush(consume2,
|
|
12824
|
+
consumePush(consume2, state2.buffer[n]);
|
|
12825
12825
|
}
|
|
12826
12826
|
} else {
|
|
12827
|
-
for (const chunk of
|
|
12827
|
+
for (const chunk of state2.buffer) {
|
|
12828
12828
|
consumePush(consume2, chunk);
|
|
12829
12829
|
}
|
|
12830
12830
|
}
|
|
12831
|
-
const decoder2 =
|
|
12831
|
+
const decoder2 = state2.decoder;
|
|
12832
12832
|
if (decoder2 != null && decoder2.lastNeed > 0) {
|
|
12833
12833
|
consumePush(consume2, Buffer.from(decoder2.lastChar.subarray(0, decoder2.lastTotal - decoder2.lastNeed)));
|
|
12834
12834
|
}
|
|
12835
|
-
if (
|
|
12836
|
-
consumeEnd(consume2,
|
|
12835
|
+
if (state2.endEmitted) {
|
|
12836
|
+
consumeEnd(consume2, state2.encoding);
|
|
12837
12837
|
return;
|
|
12838
12838
|
}
|
|
12839
12839
|
consume2.stream.on("end", function() {
|
|
@@ -16736,12 +16736,12 @@ var require_dns = __commonJS({
|
|
|
16736
16736
|
#controller = null;
|
|
16737
16737
|
#newOrigin = null;
|
|
16738
16738
|
#firstTry = true;
|
|
16739
|
-
constructor(
|
|
16739
|
+
constructor(state2, { origin, handler: handler7, dispatch, newOrigin }, opts) {
|
|
16740
16740
|
super(handler7);
|
|
16741
16741
|
this.#origin = origin;
|
|
16742
16742
|
this.#newOrigin = newOrigin;
|
|
16743
16743
|
this.#opts = { ...opts };
|
|
16744
|
-
this.#state =
|
|
16744
|
+
this.#state = state2;
|
|
16745
16745
|
this.#dispatch = dispatch;
|
|
16746
16746
|
}
|
|
16747
16747
|
onResponseError(controller, err) {
|
|
@@ -19941,19 +19941,19 @@ var require_deduplication_handler = __commonJS({
|
|
|
19941
19941
|
pendingTrailers: null,
|
|
19942
19942
|
done: false
|
|
19943
19943
|
};
|
|
19944
|
-
const
|
|
19944
|
+
const state2 = {
|
|
19945
19945
|
aborted: false,
|
|
19946
19946
|
paused: false,
|
|
19947
19947
|
reason: null
|
|
19948
19948
|
};
|
|
19949
19949
|
waitingHandler.controller = {
|
|
19950
19950
|
resume: () => {
|
|
19951
|
-
if (
|
|
19951
|
+
if (state2.aborted) {
|
|
19952
19952
|
return;
|
|
19953
19953
|
}
|
|
19954
|
-
|
|
19954
|
+
state2.paused = false;
|
|
19955
19955
|
this.#flushWaitingHandler(waitingHandler);
|
|
19956
|
-
if (this.#completed && waitingHandler.pendingTrailers && waitingHandler.bufferedChunks.length === 0 && !
|
|
19956
|
+
if (this.#completed && waitingHandler.pendingTrailers && waitingHandler.bufferedChunks.length === 0 && !state2.paused && !state2.aborted) {
|
|
19957
19957
|
try {
|
|
19958
19958
|
waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, waitingHandler.pendingTrailers);
|
|
19959
19959
|
} catch (err) {
|
|
@@ -19965,31 +19965,31 @@ var require_deduplication_handler = __commonJS({
|
|
|
19965
19965
|
this.#pruneDoneWaitingHandlers();
|
|
19966
19966
|
},
|
|
19967
19967
|
pause: () => {
|
|
19968
|
-
if (!
|
|
19969
|
-
|
|
19968
|
+
if (!state2.aborted) {
|
|
19969
|
+
state2.paused = true;
|
|
19970
19970
|
}
|
|
19971
19971
|
},
|
|
19972
19972
|
get paused() {
|
|
19973
|
-
return
|
|
19973
|
+
return state2.paused;
|
|
19974
19974
|
},
|
|
19975
19975
|
get aborted() {
|
|
19976
|
-
return
|
|
19976
|
+
return state2.aborted;
|
|
19977
19977
|
},
|
|
19978
19978
|
get reason() {
|
|
19979
|
-
return
|
|
19979
|
+
return state2.reason;
|
|
19980
19980
|
},
|
|
19981
19981
|
abort: (reason) => {
|
|
19982
|
-
if (
|
|
19982
|
+
if (state2.aborted) {
|
|
19983
19983
|
return;
|
|
19984
19984
|
}
|
|
19985
|
-
|
|
19986
|
-
|
|
19985
|
+
state2.aborted = true;
|
|
19986
|
+
state2.reason = reason ?? null;
|
|
19987
19987
|
waitingHandler.done = true;
|
|
19988
19988
|
waitingHandler.pendingTrailers = null;
|
|
19989
19989
|
waitingHandler.bufferedChunks = [];
|
|
19990
19990
|
waitingHandler.bufferedBytes = 0;
|
|
19991
19991
|
try {
|
|
19992
|
-
handler7.onResponseError?.(waitingHandler.controller,
|
|
19992
|
+
handler7.onResponseError?.(waitingHandler.controller, state2.reason ?? new RequestAbortedError());
|
|
19993
19993
|
} catch {
|
|
19994
19994
|
}
|
|
19995
19995
|
}
|
|
@@ -21225,17 +21225,17 @@ var require_response = __commonJS({
|
|
|
21225
21225
|
response.status === 0
|
|
21226
21226
|
);
|
|
21227
21227
|
}
|
|
21228
|
-
function makeFilteredResponse(response,
|
|
21229
|
-
|
|
21228
|
+
function makeFilteredResponse(response, state2) {
|
|
21229
|
+
state2 = {
|
|
21230
21230
|
internalResponse: response,
|
|
21231
|
-
...
|
|
21231
|
+
...state2
|
|
21232
21232
|
};
|
|
21233
21233
|
return new Proxy(response, {
|
|
21234
21234
|
get(target, p) {
|
|
21235
|
-
return p in
|
|
21235
|
+
return p in state2 ? state2[p] : target[p];
|
|
21236
21236
|
},
|
|
21237
21237
|
set(target, p, value) {
|
|
21238
|
-
assert6(!(p in
|
|
21238
|
+
assert6(!(p in state2));
|
|
21239
21239
|
target[p] = value;
|
|
21240
21240
|
return true;
|
|
21241
21241
|
}
|
|
@@ -66182,18 +66182,18 @@ var require_cluster = __commonJS({
|
|
|
66182
66182
|
if (typeof res !== "string") {
|
|
66183
66183
|
return callback();
|
|
66184
66184
|
}
|
|
66185
|
-
let
|
|
66185
|
+
let state2;
|
|
66186
66186
|
const lines = res.split("\r\n");
|
|
66187
66187
|
for (let i = 0; i < lines.length; ++i) {
|
|
66188
66188
|
const parts = lines[i].split(":");
|
|
66189
66189
|
if (parts[0] === "cluster_state") {
|
|
66190
|
-
|
|
66190
|
+
state2 = parts[1];
|
|
66191
66191
|
break;
|
|
66192
66192
|
}
|
|
66193
66193
|
}
|
|
66194
|
-
if (
|
|
66195
|
-
debug3("cluster state not ok (%s)",
|
|
66196
|
-
callback(null,
|
|
66194
|
+
if (state2 === "fail") {
|
|
66195
|
+
debug3("cluster state not ok (%s)", state2);
|
|
66196
|
+
callback(null, state2);
|
|
66197
66197
|
} else {
|
|
66198
66198
|
callback();
|
|
66199
66199
|
}
|
|
@@ -72564,6 +72564,97 @@ var coerce = {
|
|
|
72564
72564
|
};
|
|
72565
72565
|
var NEVER = INVALID;
|
|
72566
72566
|
|
|
72567
|
+
// ../../packages/shared-types/src/public-status.ts
|
|
72568
|
+
var PublicStatusIdSchema = external_exports.string().regex(/^[a-f0-9]{24}$/);
|
|
72569
|
+
var selection = external_exports.object({ project_id: external_exports.string().uuid(), check_ids: external_exports.array(external_exports.string().uuid()).max(50) }).strict();
|
|
72570
|
+
var PublicStatusSettingsSchema = external_exports.object({
|
|
72571
|
+
title: external_exports.string().trim().min(1).max(120),
|
|
72572
|
+
enabled: external_exports.boolean(),
|
|
72573
|
+
projects: external_exports.array(selection).min(1).max(50)
|
|
72574
|
+
}).strict().superRefine((value, context) => {
|
|
72575
|
+
if (new Set(value.projects.map((p) => p.project_id)).size !== value.projects.length || new Set(value.projects.flatMap((p) => p.check_ids)).size !== value.projects.reduce((n, p) => n + p.check_ids.length, 0) || value.projects.reduce((count, p) => count + p.check_ids.length, 0) > 500) {
|
|
72576
|
+
context.addIssue({
|
|
72577
|
+
code: external_exports.ZodIssueCode.custom,
|
|
72578
|
+
message: "Choose distinct projects and checks within the publication limits."
|
|
72579
|
+
});
|
|
72580
|
+
}
|
|
72581
|
+
});
|
|
72582
|
+
var state = external_exports.enum(["unknown", "operational", "degraded", "down", "paused"]);
|
|
72583
|
+
var percentage = external_exports.number().min(0).max(100).nullable();
|
|
72584
|
+
var verifiedAt = external_exports.string().datetime({ offset: true }).nullable();
|
|
72585
|
+
var PublicStatusDaySchema = external_exports.object({
|
|
72586
|
+
day: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
72587
|
+
state,
|
|
72588
|
+
impact: external_exports.enum(["none", "minor", "elevated", "outage"]),
|
|
72589
|
+
total_checks: external_exports.number().int().nonnegative(),
|
|
72590
|
+
successful_checks: external_exports.number().int().nonnegative(),
|
|
72591
|
+
failed_checks: external_exports.number().int().nonnegative(),
|
|
72592
|
+
degraded_checks: external_exports.number().int().nonnegative(),
|
|
72593
|
+
downtime_seconds: external_exports.number().nonnegative()
|
|
72594
|
+
}).strict();
|
|
72595
|
+
var checkView = external_exports.object({
|
|
72596
|
+
key: external_exports.string().max(40),
|
|
72597
|
+
name: external_exports.string().max(120),
|
|
72598
|
+
current_state: state,
|
|
72599
|
+
uptime_percentage: percentage,
|
|
72600
|
+
last_verified_at: verifiedAt,
|
|
72601
|
+
days: external_exports.array(PublicStatusDaySchema).length(30)
|
|
72602
|
+
}).strict();
|
|
72603
|
+
var PublicStatusProjectSchema = checkView.extend({ checks: external_exports.array(checkView).max(50) }).strict();
|
|
72604
|
+
var PublicStatusPageSchema = external_exports.object({ title: external_exports.string().max(120), projects: external_exports.array(PublicStatusProjectSchema).max(50) }).strict();
|
|
72605
|
+
var PublicStatusManagementSchema = external_exports.object({
|
|
72606
|
+
settings: PublicStatusSettingsSchema,
|
|
72607
|
+
public_id: PublicStatusIdSchema.nullable(),
|
|
72608
|
+
public_url: external_exports.string().url().nullable(),
|
|
72609
|
+
access_mode: external_exports.enum(["manage", "preview"])
|
|
72610
|
+
}).strict();
|
|
72611
|
+
var PublicStatusOptionsQueryObjectSchema = external_exports.object({
|
|
72612
|
+
cursor: external_exports.string().uuid().optional(),
|
|
72613
|
+
check_project_id: external_exports.string().uuid().optional(),
|
|
72614
|
+
check_cursor: external_exports.string().uuid().optional()
|
|
72615
|
+
}).strict();
|
|
72616
|
+
var PublicStatusOptionsQuerySchema = PublicStatusOptionsQueryObjectSchema.refine(
|
|
72617
|
+
(v) => !v.check_cursor || !!v.check_project_id,
|
|
72618
|
+
"A check cursor requires a project."
|
|
72619
|
+
).refine((v) => !v.cursor || !v.check_project_id, "Project and check pagination are separate.");
|
|
72620
|
+
var PublicStatusOptionsSchema = external_exports.object({
|
|
72621
|
+
projects: external_exports.array(
|
|
72622
|
+
external_exports.object({
|
|
72623
|
+
project_id: external_exports.string().uuid(),
|
|
72624
|
+
name: external_exports.string(),
|
|
72625
|
+
checks: external_exports.array(external_exports.object({ check_id: external_exports.string().uuid(), name: external_exports.string() }).strict()).max(50),
|
|
72626
|
+
next_check_cursor: external_exports.string().uuid().nullable()
|
|
72627
|
+
}).strict()
|
|
72628
|
+
).max(50),
|
|
72629
|
+
next_cursor: external_exports.string().uuid().nullable()
|
|
72630
|
+
}).strict();
|
|
72631
|
+
|
|
72632
|
+
// ../../packages/retrieval-client/src/mutation-outcome.ts
|
|
72633
|
+
var MutationOutcomeUnconfirmedError = class extends Error {
|
|
72634
|
+
constructor(status) {
|
|
72635
|
+
super(
|
|
72636
|
+
"mutation_outcome_unconfirmed: The operation may have succeeded, but its result could not be confirmed. Check the current state before retrying; do not automatically repeat the mutation."
|
|
72637
|
+
);
|
|
72638
|
+
this.status = status;
|
|
72639
|
+
this.name = "MutationOutcomeUnconfirmedError";
|
|
72640
|
+
}
|
|
72641
|
+
code = "mutation_outcome_unconfirmed";
|
|
72642
|
+
outcome = "unknown";
|
|
72643
|
+
retrySafe = false;
|
|
72644
|
+
toJSON() {
|
|
72645
|
+
return {
|
|
72646
|
+
error: this.code,
|
|
72647
|
+
outcome: this.outcome,
|
|
72648
|
+
retry_safe: this.retrySafe,
|
|
72649
|
+
message: this.message
|
|
72650
|
+
};
|
|
72651
|
+
}
|
|
72652
|
+
};
|
|
72653
|
+
|
|
72654
|
+
// ../../packages/node-http/src/index.ts
|
|
72655
|
+
var import_undici = __toESM(require_undici(), 1);
|
|
72656
|
+
var nodeFetch = import_undici.fetch;
|
|
72657
|
+
|
|
72567
72658
|
// ../../packages/shared-types/src/event-envelope.ts
|
|
72568
72659
|
function createUuidV4() {
|
|
72569
72660
|
const cryptoSource = globalThis.crypto;
|
|
@@ -75020,6 +75111,32 @@ var AnalyticsFlowCaptureSchemas = {
|
|
|
75020
75111
|
withdraw: Context.strict()
|
|
75021
75112
|
};
|
|
75022
75113
|
|
|
75114
|
+
// ../../packages/shared-types/src/analytics-query.ts
|
|
75115
|
+
var DEFAULT_LAST_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
75116
|
+
var MAX_LAST_MS = 370 * 24 * 60 * 60 * 1e3;
|
|
75117
|
+
var AnalyticsMetricsQuerySchema = external_exports.object({
|
|
75118
|
+
project_id: external_exports.string().uuid(),
|
|
75119
|
+
from: external_exports.string().datetime().optional(),
|
|
75120
|
+
to: external_exports.string().datetime().optional(),
|
|
75121
|
+
last: external_exports.string().trim().min(2).max(16).optional(),
|
|
75122
|
+
granularity: AnalyticsMetricsGranularitySchema.optional().default("day"),
|
|
75123
|
+
service: external_exports.string().trim().min(1).max(120).optional(),
|
|
75124
|
+
environment: external_exports.string().trim().min(1).max(120).optional(),
|
|
75125
|
+
route: external_exports.string().trim().min(1).max(2048).refine((value) => !value.includes("?") && !value.includes("#")).optional(),
|
|
75126
|
+
device_type: external_exports.string().trim().min(1).max(40).optional(),
|
|
75127
|
+
browser: external_exports.string().trim().min(1).max(80).optional(),
|
|
75128
|
+
os: external_exports.string().trim().min(1).max(80).optional(),
|
|
75129
|
+
language: external_exports.string().trim().min(1).max(40).optional(),
|
|
75130
|
+
country: external_exports.string().trim().min(1).max(8).optional(),
|
|
75131
|
+
auth_state: external_exports.enum(["anonymous", "authenticated", "unknown"]).optional(),
|
|
75132
|
+
referrer: external_exports.string().trim().min(1).max(255).optional(),
|
|
75133
|
+
utm_source: external_exports.string().trim().min(1).max(128).optional(),
|
|
75134
|
+
utm_medium: external_exports.string().trim().min(1).max(128).optional(),
|
|
75135
|
+
utm_campaign: external_exports.string().trim().min(1).max(128).optional(),
|
|
75136
|
+
custom_dimensions: external_exports.record(external_exports.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,63}$/), external_exports.string().max(128)).refine((value) => Object.keys(value).length <= 8).optional(),
|
|
75137
|
+
limit: external_exports.coerce.number().int().min(1).max(100).optional().default(10)
|
|
75138
|
+
}).strict();
|
|
75139
|
+
|
|
75023
75140
|
// ../../packages/shared-types/src/index.ts
|
|
75024
75141
|
var SeveritySchema = external_exports.enum(["low", "medium", "high", "critical"]);
|
|
75025
75142
|
var BundleSdkSchema = external_exports.object({
|
|
@@ -75325,32 +75442,6 @@ var BundleV1Schema = external_exports.object({
|
|
|
75325
75442
|
metadata: BundleMetadataSchema
|
|
75326
75443
|
});
|
|
75327
75444
|
|
|
75328
|
-
// ../../packages/retrieval-client/src/mutation-outcome.ts
|
|
75329
|
-
var MutationOutcomeUnconfirmedError = class extends Error {
|
|
75330
|
-
constructor(status) {
|
|
75331
|
-
super(
|
|
75332
|
-
"mutation_outcome_unconfirmed: The operation may have succeeded, but its result could not be confirmed. Check the current state before retrying; do not automatically repeat the mutation."
|
|
75333
|
-
);
|
|
75334
|
-
this.status = status;
|
|
75335
|
-
this.name = "MutationOutcomeUnconfirmedError";
|
|
75336
|
-
}
|
|
75337
|
-
code = "mutation_outcome_unconfirmed";
|
|
75338
|
-
outcome = "unknown";
|
|
75339
|
-
retrySafe = false;
|
|
75340
|
-
toJSON() {
|
|
75341
|
-
return {
|
|
75342
|
-
error: this.code,
|
|
75343
|
-
outcome: this.outcome,
|
|
75344
|
-
retry_safe: this.retrySafe,
|
|
75345
|
-
message: this.message
|
|
75346
|
-
};
|
|
75347
|
-
}
|
|
75348
|
-
};
|
|
75349
|
-
|
|
75350
|
-
// ../../packages/node-http/src/index.ts
|
|
75351
|
-
var import_undici = __toESM(require_undici(), 1);
|
|
75352
|
-
var nodeFetch = import_undici.fetch;
|
|
75353
|
-
|
|
75354
75445
|
// ../../packages/retrieval-client/src/index.ts
|
|
75355
75446
|
var ProjectColorTagResponseSchema = external_exports.unknown().transform((value, context) => {
|
|
75356
75447
|
if (value === void 0 || value === null) {
|
|
@@ -76341,7 +76432,12 @@ var WebhookLinksSchema = external_exports.object({
|
|
|
76341
76432
|
reproduction: external_exports.string().min(1).optional()
|
|
76342
76433
|
}).strict();
|
|
76343
76434
|
var BundleLifecycleWebhookPayloadSchema = external_exports.object({
|
|
76344
|
-
event: external_exports.enum([
|
|
76435
|
+
event: external_exports.enum([
|
|
76436
|
+
"bundle.created",
|
|
76437
|
+
"bundle.updated",
|
|
76438
|
+
"bundle.resolved",
|
|
76439
|
+
"improvement_bundle.created"
|
|
76440
|
+
]),
|
|
76345
76441
|
occurred_at: external_exports.string().datetime(),
|
|
76346
76442
|
project_id: external_exports.string().min(1),
|
|
76347
76443
|
bundle_id: external_exports.string().min(1),
|
|
@@ -76381,10 +76477,15 @@ var VerificationWebhookTestPayloadSchema = external_exports.object({
|
|
|
76381
76477
|
message: external_exports.string().min(1)
|
|
76382
76478
|
}).strict()
|
|
76383
76479
|
}).strict();
|
|
76480
|
+
var SyntheticWebhookTestPayloadSchema = VerificationWebhookTestPayloadSchema.extend({
|
|
76481
|
+
event: WebhookEventTypeSchema,
|
|
76482
|
+
event_type: WebhookEventTypeSchema
|
|
76483
|
+
});
|
|
76384
76484
|
var WebhookEventPayloadSchema = external_exports.union([
|
|
76385
76485
|
BundleLifecycleWebhookPayloadSchema,
|
|
76386
76486
|
IncidentLifecycleWebhookPayloadSchema,
|
|
76387
|
-
VerificationWebhookTestPayloadSchema
|
|
76487
|
+
VerificationWebhookTestPayloadSchema,
|
|
76488
|
+
SyntheticWebhookTestPayloadSchema
|
|
76388
76489
|
]);
|
|
76389
76490
|
var WebhookFiltersSchema = external_exports.object({
|
|
76390
76491
|
environment: external_exports.array(external_exports.string()).optional(),
|
|
@@ -77319,6 +77420,15 @@ async function expectNoContent(responsePromise) {
|
|
|
77319
77420
|
}
|
|
77320
77421
|
function createGitHubManagementApi(client) {
|
|
77321
77422
|
return {
|
|
77423
|
+
async disconnectInstallation(input2) {
|
|
77424
|
+
return expectNoContent(
|
|
77425
|
+
client.request({
|
|
77426
|
+
method: "DELETE",
|
|
77427
|
+
path: "/v1/github/installation",
|
|
77428
|
+
bearerToken: input2.bearerToken
|
|
77429
|
+
})
|
|
77430
|
+
);
|
|
77431
|
+
},
|
|
77322
77432
|
async getInstallation(input2) {
|
|
77323
77433
|
const query = input2.projectId === void 0 ? "" : `?project_id=${encodeURIComponent(input2.projectId)}`;
|
|
77324
77434
|
return expectInstallation(
|
|
@@ -77657,6 +77767,122 @@ function createCliHttpClient(input2, dependencies) {
|
|
|
77657
77767
|
};
|
|
77658
77768
|
}
|
|
77659
77769
|
|
|
77770
|
+
// ../cli/src/public-status-commands.ts
|
|
77771
|
+
var PublicStatusApiError = class extends Error {
|
|
77772
|
+
constructor(status, message3) {
|
|
77773
|
+
super(message3);
|
|
77774
|
+
this.status = status;
|
|
77775
|
+
}
|
|
77776
|
+
};
|
|
77777
|
+
function createPublicStatusApi(http) {
|
|
77778
|
+
const path = (scope3) => `/v1/projects/${encodeURIComponent(external_exports.string().uuid().parse(scope3.projectId))}/status-page`;
|
|
77779
|
+
async function request(input2, schema) {
|
|
77780
|
+
const result = await http.request(input2);
|
|
77781
|
+
if (result.status !== 200) {
|
|
77782
|
+
const error2 = external_exports.object({ error: external_exports.string() }).safeParse(result.body);
|
|
77783
|
+
throw new PublicStatusApiError(
|
|
77784
|
+
result.status,
|
|
77785
|
+
error2.success ? error2.data.error : "Status request failed."
|
|
77786
|
+
);
|
|
77787
|
+
}
|
|
77788
|
+
return schema.parse(result.body);
|
|
77789
|
+
}
|
|
77790
|
+
return {
|
|
77791
|
+
get: (scope3) => request(
|
|
77792
|
+
{ method: "GET", path: path(scope3), bearerToken: scope3.bearerToken },
|
|
77793
|
+
PublicStatusManagementSchema
|
|
77794
|
+
),
|
|
77795
|
+
save: (scope3) => request(
|
|
77796
|
+
{
|
|
77797
|
+
method: "PUT",
|
|
77798
|
+
path: path(scope3),
|
|
77799
|
+
bearerToken: scope3.bearerToken,
|
|
77800
|
+
body: PublicStatusSettingsSchema.parse(scope3.settings)
|
|
77801
|
+
},
|
|
77802
|
+
PublicStatusManagementSchema
|
|
77803
|
+
),
|
|
77804
|
+
options: (scope3) => {
|
|
77805
|
+
const query = PublicStatusOptionsQuerySchema.parse({
|
|
77806
|
+
...scope3.cursor ? { cursor: scope3.cursor } : {},
|
|
77807
|
+
...scope3.check_project_id ? { check_project_id: scope3.check_project_id } : {},
|
|
77808
|
+
...scope3.check_cursor ? { check_cursor: scope3.check_cursor } : {}
|
|
77809
|
+
});
|
|
77810
|
+
const params = new URLSearchParams(
|
|
77811
|
+
Object.entries(query).filter(
|
|
77812
|
+
(entry) => typeof entry[1] === "string"
|
|
77813
|
+
)
|
|
77814
|
+
).toString();
|
|
77815
|
+
return request(
|
|
77816
|
+
{
|
|
77817
|
+
method: "GET",
|
|
77818
|
+
path: `${path(scope3)}/options${params ? `?${params}` : ""}`,
|
|
77819
|
+
bearerToken: scope3.bearerToken
|
|
77820
|
+
},
|
|
77821
|
+
PublicStatusOptionsSchema
|
|
77822
|
+
);
|
|
77823
|
+
},
|
|
77824
|
+
preview: (scope3) => request(
|
|
77825
|
+
{ method: "GET", path: `${path(scope3)}/preview`, bearerToken: scope3.bearerToken },
|
|
77826
|
+
PublicStatusPageSchema
|
|
77827
|
+
)
|
|
77828
|
+
};
|
|
77829
|
+
}
|
|
77830
|
+
|
|
77831
|
+
// src/public-status-tools.ts
|
|
77832
|
+
var scope = external_exports.object({ bearerToken: external_exports.string().min(1), projectId: external_exports.string().uuid() }).strict();
|
|
77833
|
+
var PUBLIC_STATUS_MCP_TOOL_NAMES = [
|
|
77834
|
+
"get_public_status_page",
|
|
77835
|
+
"save_public_status_page",
|
|
77836
|
+
"list_public_status_page_options",
|
|
77837
|
+
"preview_public_status_page"
|
|
77838
|
+
];
|
|
77839
|
+
var PUBLIC_STATUS_MCP_TOOL_CATALOG = [
|
|
77840
|
+
{
|
|
77841
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[0],
|
|
77842
|
+
group: "public_status",
|
|
77843
|
+
description: "Read a project's public status settings and share URL. Owners receive configuration; collaborators receive only the published link and title.",
|
|
77844
|
+
inputSchema: scope
|
|
77845
|
+
},
|
|
77846
|
+
{
|
|
77847
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[1],
|
|
77848
|
+
group: "public_status",
|
|
77849
|
+
description: "Save or publish/unpublish a public status page. Owner only. Explicit selections expose names and 30-day availability for chosen checks; other projects must share the same owner and account. Anchor project must be first. New checks remain private.",
|
|
77850
|
+
inputSchema: scope.extend({ settings: PublicStatusSettingsSchema })
|
|
77851
|
+
},
|
|
77852
|
+
{
|
|
77853
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[2],
|
|
77854
|
+
group: "public_status",
|
|
77855
|
+
description: "List a bounded page of same-owner/account projects and checks eligible for status publication. Owner only; continue with next_cursor.",
|
|
77856
|
+
inputSchema: scope.extend(PublicStatusOptionsQueryObjectSchema.shape)
|
|
77857
|
+
},
|
|
77858
|
+
{
|
|
77859
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[3],
|
|
77860
|
+
group: "public_status",
|
|
77861
|
+
description: "Preview the saved public projection, including unpublished settings. Owner only. Reads existing availability; never executes checks or exposes diagnostic details.",
|
|
77862
|
+
inputSchema: scope
|
|
77863
|
+
}
|
|
77864
|
+
];
|
|
77865
|
+
function createPublicStatusMcpTools(api) {
|
|
77866
|
+
async function call(fn2) {
|
|
77867
|
+
try {
|
|
77868
|
+
return await fn2();
|
|
77869
|
+
} catch (error2) {
|
|
77870
|
+
throw new Error(
|
|
77871
|
+
`mcp_tool_error:${error2 instanceof PublicStatusApiError ? error2.message : error2 instanceof external_exports.ZodError ? "invalid_status_input" : "unknown_error"}`
|
|
77872
|
+
);
|
|
77873
|
+
}
|
|
77874
|
+
}
|
|
77875
|
+
return {
|
|
77876
|
+
get_public_status_page: (input2) => call(() => api.get(scope.parse(input2))),
|
|
77877
|
+
save_public_status_page: (input2) => call(() => api.save(PUBLIC_STATUS_MCP_TOOL_CATALOG[1].inputSchema.parse(input2))),
|
|
77878
|
+
list_public_status_page_options: (input2) => call(() => {
|
|
77879
|
+
const parsed = PUBLIC_STATUS_MCP_TOOL_CATALOG[2].inputSchema.parse(input2);
|
|
77880
|
+
return api.options(parsed);
|
|
77881
|
+
}),
|
|
77882
|
+
preview_public_status_page: (input2) => call(() => api.preview(scope.parse(input2)))
|
|
77883
|
+
};
|
|
77884
|
+
}
|
|
77885
|
+
|
|
77660
77886
|
// ../cli/src/analytics-flow-commands.ts
|
|
77661
77887
|
var AnalyticsFlowApiError = class extends Error {
|
|
77662
77888
|
constructor(status, message3) {
|
|
@@ -77716,20 +77942,20 @@ function createAnalyticsFlowApi(http) {
|
|
|
77716
77942
|
}
|
|
77717
77943
|
|
|
77718
77944
|
// src/analytics-flow-tools.ts
|
|
77719
|
-
var
|
|
77720
|
-
var item =
|
|
77945
|
+
var scope2 = external_exports.object({ bearerToken: external_exports.string(), projectId: external_exports.string().uuid() });
|
|
77946
|
+
var item = scope2.extend({ flowKey: AnalyticsFlowKeySchema });
|
|
77721
77947
|
var ANALYTICS_FLOW_MCP_TOOL_CATALOG = [
|
|
77722
77948
|
{
|
|
77723
77949
|
name: "list_analytics_flows",
|
|
77724
77950
|
group: "analytics_flows",
|
|
77725
77951
|
description: "List this project's named acquisition and activation flows, including archived definitions.",
|
|
77726
|
-
inputSchema:
|
|
77952
|
+
inputSchema: scope2
|
|
77727
77953
|
},
|
|
77728
77954
|
{
|
|
77729
77955
|
name: "save_analytics_flow",
|
|
77730
77956
|
group: "analytics_flows",
|
|
77731
77957
|
description: "Create or replace a project flow with two to eight ordered steps and exact origins. Owner/admin only. Edits start a new report version.",
|
|
77732
|
-
inputSchema:
|
|
77958
|
+
inputSchema: scope2.extend({ definition: AnalyticsFlowDefinitionInputSchema })
|
|
77733
77959
|
},
|
|
77734
77960
|
{
|
|
77735
77961
|
name: "archive_analytics_flow",
|
|
@@ -77755,7 +77981,7 @@ function createAnalyticsFlowMcpTools(api) {
|
|
|
77755
77981
|
}
|
|
77756
77982
|
}
|
|
77757
77983
|
return {
|
|
77758
|
-
list_analytics_flows: (input2) => call(() => api.list(
|
|
77984
|
+
list_analytics_flows: (input2) => call(() => api.list(scope2.parse(input2))),
|
|
77759
77985
|
save_analytics_flow: (input2) => call(() => api.save(ANALYTICS_FLOW_MCP_TOOL_CATALOG[1].inputSchema.parse(input2))),
|
|
77760
77986
|
archive_analytics_flow: (input2) => call(() => api.archive(item.parse(input2))),
|
|
77761
77987
|
get_analytics_flow_report: (input2) => call(() => {
|
|
@@ -79047,76 +79273,76 @@ var BudgetExceeded = class extends Error {
|
|
|
79047
79273
|
function byteLength(value) {
|
|
79048
79274
|
return new TextEncoder().encode(value).length;
|
|
79049
79275
|
}
|
|
79050
|
-
function mask(
|
|
79051
|
-
|
|
79276
|
+
function mask(state2) {
|
|
79277
|
+
state2.redactionCount += 1;
|
|
79052
79278
|
return REDACTED2;
|
|
79053
79279
|
}
|
|
79054
|
-
function sanitizeString(value,
|
|
79055
|
-
if (value.length > MAX_STRING_BYTES) return mask(
|
|
79280
|
+
function sanitizeString(value, state2, allowStructured) {
|
|
79281
|
+
if (value.length > MAX_STRING_BYTES) return mask(state2);
|
|
79056
79282
|
const length = byteLength(value);
|
|
79057
|
-
if (length > MAX_STRING_BYTES) return mask(
|
|
79058
|
-
|
|
79059
|
-
if (
|
|
79283
|
+
if (length > MAX_STRING_BYTES) return mask(state2);
|
|
79284
|
+
state2.textBytes += length;
|
|
79285
|
+
if (state2.textBytes > state2.maxTotalBytes) throw new BudgetExceeded();
|
|
79060
79286
|
if (allowStructured && (value.startsWith("{") || value.startsWith("["))) {
|
|
79061
79287
|
try {
|
|
79062
79288
|
const parsed = JSON.parse(value);
|
|
79063
79289
|
if (typeof parsed === "object" && parsed !== null) {
|
|
79064
|
-
const nested = sanitizeValue(parsed,
|
|
79290
|
+
const nested = sanitizeValue(parsed, state2, 0, false);
|
|
79065
79291
|
const encoded = JSON.stringify(nested);
|
|
79066
|
-
if (encoded !== value)
|
|
79292
|
+
if (encoded !== value) state2.redactionCount += 1;
|
|
79067
79293
|
return encoded;
|
|
79068
79294
|
}
|
|
79069
79295
|
} catch (error2) {
|
|
79070
79296
|
if (error2 instanceof BudgetExceeded) throw error2;
|
|
79071
79297
|
}
|
|
79072
79298
|
}
|
|
79073
|
-
const result = scrubCredentialText(value,
|
|
79074
|
-
if (result !== value)
|
|
79299
|
+
const result = scrubCredentialText(value, state2.extra);
|
|
79300
|
+
if (result !== value) state2.redactionCount += 1;
|
|
79075
79301
|
if ((value.startsWith("{") || value.startsWith("[")) && result === value && /(?:password|token|secret|authorization|cookie)["']?\s*[:=]/i.test(value)) {
|
|
79076
|
-
return mask(
|
|
79302
|
+
return mask(state2);
|
|
79077
79303
|
}
|
|
79078
79304
|
return result;
|
|
79079
79305
|
}
|
|
79080
|
-
function sanitizeValue(value,
|
|
79081
|
-
|
|
79082
|
-
if (
|
|
79083
|
-
if (depth > MAX_DEPTH) return mask(
|
|
79084
|
-
if (typeof value === "string") return sanitizeString(value,
|
|
79306
|
+
function sanitizeValue(value, state2, depth, allowStructured) {
|
|
79307
|
+
state2.nodes += 1;
|
|
79308
|
+
if (state2.nodes > MAX_NODES) throw new BudgetExceeded();
|
|
79309
|
+
if (depth > MAX_DEPTH) return mask(state2);
|
|
79310
|
+
if (typeof value === "string") return sanitizeString(value, state2, allowStructured);
|
|
79085
79311
|
if (value === null || typeof value === "boolean") return value;
|
|
79086
79312
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
79087
79313
|
if (typeof value !== "object") throw new TypeError("unsafe_input");
|
|
79088
|
-
if (
|
|
79089
|
-
|
|
79314
|
+
if (state2.seen.has(value)) return "[Circular]";
|
|
79315
|
+
state2.seen.add(value);
|
|
79090
79316
|
try {
|
|
79091
79317
|
if (Array.isArray(value)) {
|
|
79092
|
-
if (value.length > MAX_ENTRIES) return mask(
|
|
79318
|
+
if (value.length > MAX_ENTRIES) return mask(state2);
|
|
79093
79319
|
return Array.from({ length: value.length }, (_, index) => {
|
|
79094
79320
|
const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
|
|
79095
79321
|
if (descriptor === void 0 || !("value" in descriptor)) throw new TypeError("unsafe_input");
|
|
79096
|
-
return sanitizeValue(descriptor.value,
|
|
79322
|
+
return sanitizeValue(descriptor.value, state2, depth + 1, allowStructured);
|
|
79097
79323
|
});
|
|
79098
79324
|
}
|
|
79099
79325
|
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
79100
79326
|
throw new TypeError("unsafe_input");
|
|
79101
79327
|
}
|
|
79102
79328
|
const keys2 = Object.keys(value);
|
|
79103
|
-
if (keys2.length > MAX_ENTRIES) return mask(
|
|
79329
|
+
if (keys2.length > MAX_ENTRIES) return mask(state2);
|
|
79104
79330
|
const result = {};
|
|
79105
79331
|
for (const key of keys2) {
|
|
79106
79332
|
if (key.length > 128) {
|
|
79107
|
-
|
|
79333
|
+
state2.redactionCount += 1;
|
|
79108
79334
|
continue;
|
|
79109
79335
|
}
|
|
79110
|
-
|
|
79111
|
-
if (
|
|
79112
|
-
const safeKey = scrubCredentialText(key,
|
|
79336
|
+
state2.textBytes += byteLength(key);
|
|
79337
|
+
if (state2.textBytes > state2.maxTotalBytes) throw new BudgetExceeded();
|
|
79338
|
+
const safeKey = scrubCredentialText(key, state2.extra);
|
|
79113
79339
|
if (safeKey !== key) {
|
|
79114
|
-
|
|
79340
|
+
state2.redactionCount += 1;
|
|
79115
79341
|
continue;
|
|
79116
79342
|
}
|
|
79117
79343
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
79118
79344
|
if (descriptor === void 0 || !("value" in descriptor)) throw new TypeError("unsafe_input");
|
|
79119
|
-
const safeValue = isSensitiveKey(key,
|
|
79345
|
+
const safeValue = isSensitiveKey(key, state2.keys) ? mask(state2) : sanitizeValue(descriptor.value, state2, depth + 1, allowStructured);
|
|
79120
79346
|
Object.defineProperty(result, key, {
|
|
79121
79347
|
value: safeValue,
|
|
79122
79348
|
enumerable: true,
|
|
@@ -79126,7 +79352,7 @@ function sanitizeValue(value, state, depth, allowStructured) {
|
|
|
79126
79352
|
}
|
|
79127
79353
|
return result;
|
|
79128
79354
|
} finally {
|
|
79129
|
-
|
|
79355
|
+
state2.seen.delete(value);
|
|
79130
79356
|
}
|
|
79131
79357
|
}
|
|
79132
79358
|
function sanitizeTelemetry(value, options = {}) {
|
|
@@ -79139,7 +79365,7 @@ function sanitizeTelemetry(value, options = {}) {
|
|
|
79139
79365
|
if (!Number.isInteger(maxTotalBytes) || maxTotalBytes < 1 || maxTotalBytes > 512 * 1024) {
|
|
79140
79366
|
return { ok: false, reason: "unsafe_input" };
|
|
79141
79367
|
}
|
|
79142
|
-
const
|
|
79368
|
+
const state2 = {
|
|
79143
79369
|
nodes: 0,
|
|
79144
79370
|
textBytes: 0,
|
|
79145
79371
|
redactionCount: 0,
|
|
@@ -79148,11 +79374,11 @@ function sanitizeTelemetry(value, options = {}) {
|
|
|
79148
79374
|
extra,
|
|
79149
79375
|
maxTotalBytes
|
|
79150
79376
|
};
|
|
79151
|
-
const sanitized = sanitizeValue(value,
|
|
79377
|
+
const sanitized = sanitizeValue(value, state2, 0, true);
|
|
79152
79378
|
if (byteLength(JSON.stringify(sanitized)) > maxTotalBytes) {
|
|
79153
79379
|
return { ok: false, reason: "budget_exceeded" };
|
|
79154
79380
|
}
|
|
79155
|
-
return { ok: true, value: sanitized, redactionCount:
|
|
79381
|
+
return { ok: true, value: sanitized, redactionCount: state2.redactionCount };
|
|
79156
79382
|
} catch (error2) {
|
|
79157
79383
|
return { ok: false, reason: error2 instanceof BudgetExceeded ? "budget_exceeded" : "unsafe_input" };
|
|
79158
79384
|
}
|
|
@@ -89101,6 +89327,14 @@ function mapMcpError9(error2) {
|
|
|
89101
89327
|
}
|
|
89102
89328
|
function createGitHubMcpTools(api) {
|
|
89103
89329
|
return {
|
|
89330
|
+
async disconnect_github_installation(input2) {
|
|
89331
|
+
try {
|
|
89332
|
+
await api.disconnectInstallation({ bearerToken: String(input2["bearerToken"]) });
|
|
89333
|
+
return { disconnected: true };
|
|
89334
|
+
} catch (error2) {
|
|
89335
|
+
mapMcpError9(error2);
|
|
89336
|
+
}
|
|
89337
|
+
},
|
|
89104
89338
|
async get_github_status(input2) {
|
|
89105
89339
|
try {
|
|
89106
89340
|
const bearerToken = String(input2["bearerToken"]);
|
|
@@ -89173,7 +89407,9 @@ function createGitHubMcpTools(api) {
|
|
|
89173
89407
|
...Array.isArray(input2["services"]) ? { services: input2["services"].map((value) => String(value)) } : {},
|
|
89174
89408
|
...typeof input2["severityMin"] === "string" ? { severityMin: input2["severityMin"] } : {},
|
|
89175
89409
|
...typeof input2["bundleType"] === "string" ? { bundleType: input2["bundleType"] } : {},
|
|
89176
|
-
...typeof input2["incidentStatus"] === "string" ? {
|
|
89410
|
+
...typeof input2["incidentStatus"] === "string" ? {
|
|
89411
|
+
incidentStatus: input2["incidentStatus"]
|
|
89412
|
+
} : {},
|
|
89177
89413
|
...typeof input2["cooldownSeconds"] === "number" ? { cooldownSeconds: input2["cooldownSeconds"] } : {},
|
|
89178
89414
|
...typeof input2["enabled"] === "boolean" ? { enabled: input2["enabled"] } : {}
|
|
89179
89415
|
})
|
|
@@ -89204,7 +89440,9 @@ function createGitHubMcpTools(api) {
|
|
|
89204
89440
|
deliveries: await api.listProjectDeliveries({
|
|
89205
89441
|
bearerToken: String(input2["bearerToken"]),
|
|
89206
89442
|
projectId: String(input2["projectId"]),
|
|
89207
|
-
...typeof input2["status"] === "string" ? {
|
|
89443
|
+
...typeof input2["status"] === "string" ? {
|
|
89444
|
+
status: input2["status"]
|
|
89445
|
+
} : {},
|
|
89208
89446
|
...typeof input2["limit"] === "number" ? { limit: input2["limit"] } : {}
|
|
89209
89447
|
})
|
|
89210
89448
|
};
|
|
@@ -91264,17 +91502,17 @@ var InvalidClientMetadata = class extends OIDCProviderError {
|
|
|
91264
91502
|
}
|
|
91265
91503
|
};
|
|
91266
91504
|
var InvalidScope = class extends OIDCProviderError {
|
|
91267
|
-
constructor(description,
|
|
91505
|
+
constructor(description, scope3, options) {
|
|
91268
91506
|
super(400, "invalid_scope", options);
|
|
91269
91507
|
Error.captureStackTrace(this, this.constructor);
|
|
91270
|
-
Object.assign(this, { scope:
|
|
91508
|
+
Object.assign(this, { scope: scope3, error_description: description, error_detail: this.error_detail });
|
|
91271
91509
|
}
|
|
91272
91510
|
};
|
|
91273
91511
|
var InsufficientScope = class extends OIDCProviderError {
|
|
91274
|
-
constructor(description,
|
|
91512
|
+
constructor(description, scope3, options) {
|
|
91275
91513
|
super(403, "insufficient_scope", options);
|
|
91276
91514
|
Error.captureStackTrace(this, this.constructor);
|
|
91277
|
-
Object.assign(this, { scope:
|
|
91515
|
+
Object.assign(this, { scope: scope3, error_description: description, error_detail: this.error_detail });
|
|
91278
91516
|
}
|
|
91279
91517
|
};
|
|
91280
91518
|
var InvalidRequest = class extends OIDCProviderError {
|
|
@@ -91517,10 +91755,10 @@ var consent_default = () => new prompt_default(
|
|
|
91517
91755
|
const { oidc } = ctx;
|
|
91518
91756
|
const encounteredScopes = new Set(oidc.grant.getOIDCScopeEncountered().split(" "));
|
|
91519
91757
|
let missing;
|
|
91520
|
-
for (const
|
|
91521
|
-
if (!encounteredScopes.has(
|
|
91758
|
+
for (const scope3 of oidc.requestParamOIDCScopes) {
|
|
91759
|
+
if (!encounteredScopes.has(scope3)) {
|
|
91522
91760
|
missing ||= [];
|
|
91523
|
-
missing.push(
|
|
91761
|
+
missing.push(scope3);
|
|
91524
91762
|
}
|
|
91525
91763
|
}
|
|
91526
91764
|
if (missing?.length) {
|
|
@@ -91552,11 +91790,11 @@ var consent_default = () => new prompt_default(
|
|
|
91552
91790
|
const encounteredScopes = new Set(oidc.grant.getResourceScopeEncountered(indicator).split(" "));
|
|
91553
91791
|
const requestedScopes = ctx.oidc.requestParamScopes;
|
|
91554
91792
|
const availableScopes = resourceServer.scopes;
|
|
91555
|
-
for (const
|
|
91556
|
-
if (availableScopes.has(
|
|
91793
|
+
for (const scope3 of requestedScopes) {
|
|
91794
|
+
if (availableScopes.has(scope3) && !encounteredScopes.has(scope3)) {
|
|
91557
91795
|
missing ||= {};
|
|
91558
91796
|
missing[indicator] ||= [];
|
|
91559
|
-
missing[indicator].push(
|
|
91797
|
+
missing[indicator].push(scope3);
|
|
91560
91798
|
}
|
|
91561
91799
|
}
|
|
91562
91800
|
}
|
|
@@ -91980,7 +92218,7 @@ async function findAccount(ctx, sub, token) {
|
|
|
91980
92218
|
mustChange("findAccount", "use your own account model");
|
|
91981
92219
|
return {
|
|
91982
92220
|
accountId: sub,
|
|
91983
|
-
async claims(use,
|
|
92221
|
+
async claims(use, scope3, claims, rejected) {
|
|
91984
92222
|
return { sub };
|
|
91985
92223
|
}
|
|
91986
92224
|
};
|
|
@@ -92917,9 +93155,9 @@ var Configuration = class {
|
|
|
92917
93155
|
claimDefinedScopes.push(key);
|
|
92918
93156
|
}
|
|
92919
93157
|
});
|
|
92920
|
-
claimDefinedScopes.forEach((
|
|
92921
|
-
if (typeof
|
|
92922
|
-
this.scopes.add(
|
|
93158
|
+
claimDefinedScopes.forEach((scope3) => {
|
|
93159
|
+
if (typeof scope3 === "string" && !this.scopes.has(scope3)) {
|
|
93160
|
+
this.scopes.add(scope3);
|
|
92923
93161
|
}
|
|
92924
93162
|
});
|
|
92925
93163
|
}
|
|
@@ -92935,9 +93173,9 @@ var Configuration = class {
|
|
|
92935
93173
|
Object.entries(this.claims).forEach(([key, value]) => {
|
|
92936
93174
|
if (Array.isArray(value)) {
|
|
92937
93175
|
this.claims[key] = value.reduce((accumulator, claim) => {
|
|
92938
|
-
const
|
|
92939
|
-
|
|
92940
|
-
return
|
|
93176
|
+
const scope3 = accumulator;
|
|
93177
|
+
scope3[claim] = null;
|
|
93178
|
+
return scope3;
|
|
92941
93179
|
}, {});
|
|
92942
93180
|
}
|
|
92943
93181
|
});
|
|
@@ -92954,9 +93192,9 @@ var Configuration = class {
|
|
|
92954
93192
|
}
|
|
92955
93193
|
collectClaims() {
|
|
92956
93194
|
const claims = /* @__PURE__ */ new Set();
|
|
92957
|
-
this.scopes.forEach((
|
|
92958
|
-
if (
|
|
92959
|
-
Object.keys(this.claims[
|
|
93195
|
+
this.scopes.forEach((scope3) => {
|
|
93196
|
+
if (scope3 in this.claims) {
|
|
93197
|
+
Object.keys(this.claims[scope3]).forEach(Set.prototype.add.bind(claims));
|
|
92960
93198
|
}
|
|
92961
93199
|
});
|
|
92962
93200
|
Object.entries(this.claims).forEach(([key, value]) => {
|
|
@@ -94175,9 +94413,9 @@ function interaction(it, options) {
|
|
|
94175
94413
|
missingOIDCScope2.delete("offline_access");
|
|
94176
94414
|
if (missingOIDCScope2.size) {
|
|
94177
94415
|
__eta.res += " <li>scopes:</li>\n <ul>\n ";
|
|
94178
|
-
missingOIDCScope2.forEach((
|
|
94416
|
+
missingOIDCScope2.forEach((scope3) => {
|
|
94179
94417
|
__eta.res += " <li>";
|
|
94180
|
-
__eta.res += __eta.e(
|
|
94418
|
+
__eta.res += __eta.e(scope3);
|
|
94181
94419
|
__eta.res += "</li>\n ";
|
|
94182
94420
|
});
|
|
94183
94421
|
__eta.res += " </ul>\n";
|
|
@@ -94202,9 +94440,9 @@ function interaction(it, options) {
|
|
|
94202
94440
|
__eta.res += " <li>";
|
|
94203
94441
|
__eta.res += __eta.e(indicator);
|
|
94204
94442
|
__eta.res += ":</li>\n <ul>\n ";
|
|
94205
|
-
scopes.forEach((
|
|
94443
|
+
scopes.forEach((scope3) => {
|
|
94206
94444
|
__eta.res += " <li>";
|
|
94207
|
-
__eta.res += __eta.e(
|
|
94445
|
+
__eta.res += __eta.e(scope3);
|
|
94208
94446
|
__eta.res += "</li>\n ";
|
|
94209
94447
|
});
|
|
94210
94448
|
__eta.res += " </ul>\n ";
|
|
@@ -94599,8 +94837,8 @@ function devInteractions(provider) {
|
|
|
94599
94837
|
grant.addOIDCClaims(details.missingOIDCClaims);
|
|
94600
94838
|
}
|
|
94601
94839
|
if (details.missingResourceScopes) {
|
|
94602
|
-
for (const [indicator,
|
|
94603
|
-
grant.addResourceScope(indicator,
|
|
94840
|
+
for (const [indicator, scope3] of Object.entries(details.missingResourceScopes)) {
|
|
94841
|
+
grant.addResourceScope(indicator, scope3.join(" "));
|
|
94604
94842
|
}
|
|
94605
94843
|
}
|
|
94606
94844
|
const result = { consent: { grantId: await grant.save() } };
|
|
@@ -97213,9 +97451,9 @@ var resolve_resource_default = async (ctx, model, config2, scopes = model.scopes
|
|
|
97213
97451
|
};
|
|
97214
97452
|
|
|
97215
97453
|
// ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/helpers/account_claims.js
|
|
97216
|
-
async function getCtxAccountClaims(ctx, use,
|
|
97454
|
+
async function getCtxAccountClaims(ctx, use, scope3, claims, rejected) {
|
|
97217
97455
|
return {
|
|
97218
|
-
...await ctx.oidc.account.claims(use,
|
|
97456
|
+
...await ctx.oidc.account.claims(use, scope3, claims, rejected),
|
|
97219
97457
|
sub: ctx.oidc.account.accountId
|
|
97220
97458
|
};
|
|
97221
97459
|
}
|
|
@@ -97365,15 +97603,15 @@ async function applyDpopBinding(ctx, dPoP, at) {
|
|
|
97365
97603
|
async function resolveAndApplyResource(ctx, source, at, grant, {
|
|
97366
97604
|
userinfo,
|
|
97367
97605
|
resourceIndicators
|
|
97368
|
-
},
|
|
97369
|
-
const resource = await resolve_resource_default(ctx, source, { userinfo, resourceIndicators },
|
|
97606
|
+
}, scope3) {
|
|
97607
|
+
const resource = await resolve_resource_default(ctx, source, { userinfo, resourceIndicators }, scope3);
|
|
97370
97608
|
if (resource) {
|
|
97371
97609
|
const resourceServerInfo = await resourceIndicators.getResourceServerInfo(ctx, resource, ctx.oidc.client);
|
|
97372
97610
|
at.resourceServer = new ctx.oidc.provider.ResourceServer(resource, resourceServerInfo);
|
|
97373
|
-
at.scope = grant.getResourceScopeFiltered(resource,
|
|
97611
|
+
at.scope = grant.getResourceScopeFiltered(resource, scope3 || source.scopes);
|
|
97374
97612
|
} else {
|
|
97375
97613
|
at.claims = source.claims;
|
|
97376
|
-
at.scope = grant.getOIDCScopeFiltered(
|
|
97614
|
+
at.scope = grant.getOIDCScopeFiltered(scope3 || source.scopes);
|
|
97377
97615
|
}
|
|
97378
97616
|
return resource;
|
|
97379
97617
|
}
|
|
@@ -97631,9 +97869,9 @@ var handler2 = async function clientCredentialsHandler(ctx) {
|
|
|
97631
97869
|
const scopes = [...new Set(ctx.oidc.params.scope?.split(" "))];
|
|
97632
97870
|
if (client.scope) {
|
|
97633
97871
|
const allowList = new Set(client.scope.split(" "));
|
|
97634
|
-
for (const
|
|
97635
|
-
if (!allowList.has(
|
|
97636
|
-
throw new InvalidScope("requested scope is not allowed",
|
|
97872
|
+
for (const scope3 of scopes.filter(Set.prototype.has.bind(statics))) {
|
|
97873
|
+
if (!allowList.has(scope3)) {
|
|
97874
|
+
throw new InvalidScope("requested scope is not allowed", scope3);
|
|
97637
97875
|
}
|
|
97638
97876
|
}
|
|
97639
97877
|
}
|
|
@@ -97893,25 +98131,25 @@ var handler4 = async function refreshTokenHandler(ctx) {
|
|
|
97893
98131
|
if (at.gty && !at.gty.endsWith(gty3)) {
|
|
97894
98132
|
at.gty = `${at.gty} ${gty3}`;
|
|
97895
98133
|
}
|
|
97896
|
-
const
|
|
98134
|
+
const scope3 = ctx.oidc.params.scope ? ctx.oidc.requestParamScopes : refreshToken.scopes;
|
|
97897
98135
|
await checkRar(ctx, () => {
|
|
97898
98136
|
});
|
|
97899
98137
|
const resource = await resolve_resource_default(
|
|
97900
98138
|
ctx,
|
|
97901
98139
|
refreshToken,
|
|
97902
98140
|
{ userinfo, resourceIndicators },
|
|
97903
|
-
|
|
98141
|
+
scope3
|
|
97904
98142
|
);
|
|
97905
98143
|
if (resource) {
|
|
97906
98144
|
const resourceServerInfo = await resourceIndicators.getResourceServerInfo(ctx, resource, ctx.oidc.client);
|
|
97907
98145
|
at.resourceServer = new ctx.oidc.provider.ResourceServer(resource, resourceServerInfo);
|
|
97908
98146
|
at.scope = grant.getResourceScopeFiltered(
|
|
97909
98147
|
resource,
|
|
97910
|
-
[...
|
|
98148
|
+
[...scope3].filter(Set.prototype.has.bind(at.resourceServer.scopes))
|
|
97911
98149
|
);
|
|
97912
98150
|
} else {
|
|
97913
98151
|
at.claims = refreshToken.claims;
|
|
97914
|
-
at.scope = grant.getOIDCScopeFiltered(
|
|
98152
|
+
at.scope = grant.getOIDCScopeFiltered(scope3);
|
|
97915
98153
|
}
|
|
97916
98154
|
if (richAuthorizationRequests.enabled && at.resourceServer) {
|
|
97917
98155
|
at.rar = await richAuthorizationRequests.rarForRefreshTokenResponse(ctx, at.resourceServer);
|
|
@@ -97921,7 +98159,7 @@ var handler4 = async function refreshTokenHandler(ctx) {
|
|
|
97921
98159
|
const idToken = await issueIdToken(ctx, refreshToken, at, grant, {
|
|
97922
98160
|
conformIdTokenClaims,
|
|
97923
98161
|
userinfo
|
|
97924
|
-
},
|
|
98162
|
+
}, scope3);
|
|
97925
98163
|
ctx.body = buildTokenResponse(at, accessToken, {
|
|
97926
98164
|
idToken,
|
|
97927
98165
|
refreshToken: refreshTokenValue,
|
|
@@ -98315,20 +98553,20 @@ var err_out_default = ({
|
|
|
98315
98553
|
expose,
|
|
98316
98554
|
message: message3,
|
|
98317
98555
|
error_description: description,
|
|
98318
|
-
scope:
|
|
98319
|
-
},
|
|
98556
|
+
scope: scope3
|
|
98557
|
+
}, state2) => {
|
|
98320
98558
|
if (expose) {
|
|
98321
98559
|
return {
|
|
98322
98560
|
error: message3,
|
|
98323
98561
|
...description !== void 0 ? { error_description: description } : void 0,
|
|
98324
|
-
...
|
|
98325
|
-
...
|
|
98562
|
+
...scope3 !== void 0 ? { scope: scope3 } : void 0,
|
|
98563
|
+
...state2 !== void 0 ? { state: state2 } : void 0
|
|
98326
98564
|
};
|
|
98327
98565
|
}
|
|
98328
98566
|
return {
|
|
98329
98567
|
error: "server_error",
|
|
98330
98568
|
error_description: "oops! something went wrong",
|
|
98331
|
-
...
|
|
98569
|
+
...state2 ? { state: state2 } : void 0
|
|
98332
98570
|
};
|
|
98333
98571
|
};
|
|
98334
98572
|
|
|
@@ -98442,8 +98680,8 @@ var authorization_error_handler_default = (provider) => {
|
|
|
98442
98680
|
recovery: oneRedirectUriClients
|
|
98443
98681
|
}
|
|
98444
98682
|
});
|
|
98445
|
-
function getOutAndEmit(ctx, err,
|
|
98446
|
-
const out = { ...err_out_default(err,
|
|
98683
|
+
function getOutAndEmit(ctx, err, state2) {
|
|
98684
|
+
const out = { ...err_out_default(err, state2), iss: ctx.oidc.provider.issuer };
|
|
98447
98685
|
if (err.expose) {
|
|
98448
98686
|
provider.emit("authorization.error", ctx, err);
|
|
98449
98687
|
debugError2("%o", out);
|
|
@@ -99599,8 +99837,8 @@ async function checkIdTokenHint(ctx, next) {
|
|
|
99599
99837
|
|
|
99600
99838
|
// ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/helpers/is_valid_scope.js
|
|
99601
99839
|
var SCOPE_SYNTAX = /^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$/u;
|
|
99602
|
-
function isValidScope(
|
|
99603
|
-
return
|
|
99840
|
+
function isValidScope(scope3) {
|
|
99841
|
+
return scope3 === void 0 || typeof scope3 === "string" && SCOPE_SYNTAX.test(scope3);
|
|
99604
99842
|
}
|
|
99605
99843
|
|
|
99606
99844
|
// ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/actions/authorization/check_scope.js
|
|
@@ -99624,9 +99862,9 @@ async function checkScope(PARAM_LIST3, ctx, next) {
|
|
|
99624
99862
|
}
|
|
99625
99863
|
if (client.scope) {
|
|
99626
99864
|
const allowList = new Set(client.scope.split(" "));
|
|
99627
|
-
for (const
|
|
99628
|
-
if (!allowList.has(
|
|
99629
|
-
throw new InvalidScope("requested scope is not allowed",
|
|
99865
|
+
for (const scope3 of scopes.filter(Set.prototype.has.bind(statics))) {
|
|
99866
|
+
if (!allowList.has(scope3)) {
|
|
99867
|
+
throw new InvalidScope("requested scope is not allowed", scope3);
|
|
99630
99868
|
}
|
|
99631
99869
|
}
|
|
99632
99870
|
}
|
|
@@ -100027,9 +100265,9 @@ async function codeHandler(ctx) {
|
|
|
100027
100265
|
async function idTokenHandler(ctx) {
|
|
100028
100266
|
const claims = filter_claims_default(ctx.oidc.claims, "id_token", ctx.oidc.grant);
|
|
100029
100267
|
const rejected = ctx.oidc.grant.getRejectedOIDCClaims();
|
|
100030
|
-
const
|
|
100268
|
+
const scope3 = ctx.oidc.grant.getOIDCScopeFiltered(ctx.oidc.requestParamScopes);
|
|
100031
100269
|
const idToken = new ctx.oidc.provider.IdToken({
|
|
100032
|
-
...await getCtxAccountClaims(ctx, "id_token",
|
|
100270
|
+
...await getCtxAccountClaims(ctx, "id_token", scope3, claims, rejected),
|
|
100033
100271
|
acr: ctx.oidc.acr,
|
|
100034
100272
|
amr: ctx.oidc.amr,
|
|
100035
100273
|
auth_time: ctx.oidc.session.authTime()
|
|
@@ -100041,7 +100279,7 @@ async function idTokenHandler(ctx) {
|
|
|
100041
100279
|
if (conformIdTokenClaims && userinfo.enabled && ctx.oidc.params.response_type !== "id_token" && !ctx.oidc.params.resource) {
|
|
100042
100280
|
idToken.scope = "openid";
|
|
100043
100281
|
} else {
|
|
100044
|
-
idToken.scope =
|
|
100282
|
+
idToken.scope = scope3;
|
|
100045
100283
|
}
|
|
100046
100284
|
idToken.mask = claims;
|
|
100047
100285
|
idToken.rejected = rejected;
|
|
@@ -101017,12 +101255,12 @@ function getSetWWWAuthenticateHeader({ tokenProperty = "accessToken", includeSco
|
|
|
101017
101255
|
if (!err.expose || dpop === false && err.statusCode !== 401) throw err;
|
|
101018
101256
|
const conf = weak_cache_default(ctx.oidc.provider);
|
|
101019
101257
|
const dpopEnabled = dpop !== false && conf.features.dPoP.enabled;
|
|
101020
|
-
const
|
|
101258
|
+
const scope3 = includeScope ? err.scope : void 0;
|
|
101021
101259
|
const algs = dpopEnabled ? conf.configuration.dPoPSigningAlgValues.join(" ") : void 0;
|
|
101022
101260
|
if (err instanceof NoAccessTokenProvided) {
|
|
101023
|
-
appendWWWAuthenticate(ctx, "Bearer", { realm: ctx.oidc.issuer, scope:
|
|
101261
|
+
appendWWWAuthenticate(ctx, "Bearer", { realm: ctx.oidc.issuer, scope: scope3 });
|
|
101024
101262
|
if (dpopEnabled) {
|
|
101025
|
-
appendWWWAuthenticate(ctx, "DPoP", { realm: ctx.oidc.issuer, scope:
|
|
101263
|
+
appendWWWAuthenticate(ctx, "DPoP", { realm: ctx.oidc.issuer, scope: scope3, algs });
|
|
101026
101264
|
}
|
|
101027
101265
|
throw err;
|
|
101028
101266
|
}
|
|
@@ -101039,7 +101277,7 @@ function getSetWWWAuthenticateHeader({ tokenProperty = "accessToken", includeSco
|
|
|
101039
101277
|
realm: ctx.oidc.issuer,
|
|
101040
101278
|
error: err.error ?? err.message,
|
|
101041
101279
|
error_description: err.error_description,
|
|
101042
|
-
scope:
|
|
101280
|
+
scope: scope3,
|
|
101043
101281
|
...scheme === "DPoP" ? { algs } : void 0
|
|
101044
101282
|
});
|
|
101045
101283
|
throw err;
|
|
@@ -101156,14 +101394,14 @@ var userinfo_default = [
|
|
|
101156
101394
|
async function respond2(ctx) {
|
|
101157
101395
|
const claims = filter_claims_default(ctx.oidc.accessToken.claims, "userinfo", ctx.oidc.grant);
|
|
101158
101396
|
const rejected = ctx.oidc.grant.getRejectedOIDCClaims();
|
|
101159
|
-
const
|
|
101397
|
+
const scope3 = ctx.oidc.grant.getOIDCScopeFiltered(new Set((ctx.oidc.params.scope || ctx.oidc.accessToken.scope).split(" ")));
|
|
101160
101398
|
const { client } = ctx.oidc;
|
|
101161
101399
|
if (client.userinfoSignedResponseAlg || client.userinfoEncryptedResponseAlg) {
|
|
101162
101400
|
const token = new ctx.oidc.provider.IdToken(
|
|
101163
|
-
await getCtxAccountClaims(ctx, "userinfo",
|
|
101401
|
+
await getCtxAccountClaims(ctx, "userinfo", scope3, claims, rejected),
|
|
101164
101402
|
{ ctx }
|
|
101165
101403
|
);
|
|
101166
|
-
token.scope =
|
|
101404
|
+
token.scope = scope3;
|
|
101167
101405
|
token.mask = claims;
|
|
101168
101406
|
token.rejected = rejected;
|
|
101169
101407
|
ctx.body = await token.issue({
|
|
@@ -101173,10 +101411,10 @@ var userinfo_default = [
|
|
|
101173
101411
|
ctx.type = "application/jwt; charset=utf-8";
|
|
101174
101412
|
} else {
|
|
101175
101413
|
const mask2 = new ctx.oidc.provider.Claims(
|
|
101176
|
-
await getCtxAccountClaims(ctx, "userinfo",
|
|
101414
|
+
await getCtxAccountClaims(ctx, "userinfo", scope3, claims, rejected),
|
|
101177
101415
|
{ ctx }
|
|
101178
101416
|
);
|
|
101179
|
-
mask2.scope(
|
|
101417
|
+
mask2.scope(scope3);
|
|
101180
101418
|
mask2.mask(claims);
|
|
101181
101419
|
mask2.rejected(rejected);
|
|
101182
101420
|
ctx.body = await mask2.result();
|
|
@@ -102254,7 +102492,7 @@ var confirm2 = [
|
|
|
102254
102492
|
checkXsrf("could not find logout details"),
|
|
102255
102493
|
async function endSession(ctx) {
|
|
102256
102494
|
const { oidc: { session, params } } = ctx;
|
|
102257
|
-
const { state } = session;
|
|
102495
|
+
const { state: state2 } = session;
|
|
102258
102496
|
const {
|
|
102259
102497
|
features: { backchannelLogout },
|
|
102260
102498
|
cookies: { long: opts }
|
|
@@ -102263,7 +102501,7 @@ var confirm2 = [
|
|
|
102263
102501
|
const clientIds = Object.keys(session.authorizations || {});
|
|
102264
102502
|
const back = [];
|
|
102265
102503
|
for (const clientId of clientIds) {
|
|
102266
|
-
if (params.logout || clientId ===
|
|
102504
|
+
if (params.logout || clientId === state2.clientId) {
|
|
102267
102505
|
const client = await clientForLogout(ctx, clientId);
|
|
102268
102506
|
if (client) {
|
|
102269
102507
|
const sid = session.sidFor(client.clientId);
|
|
@@ -102280,8 +102518,8 @@ var confirm2 = [
|
|
|
102280
102518
|
}
|
|
102281
102519
|
await Promise.all(back);
|
|
102282
102520
|
}
|
|
102283
|
-
if (
|
|
102284
|
-
ctx.oidc.entity("Client", await clientForLogout(ctx,
|
|
102521
|
+
if (state2.clientId) {
|
|
102522
|
+
ctx.oidc.entity("Client", await clientForLogout(ctx, state2.clientId));
|
|
102285
102523
|
}
|
|
102286
102524
|
if (params.logout) {
|
|
102287
102525
|
if (session.authorizations) {
|
|
@@ -102299,24 +102537,24 @@ var confirm2 = [
|
|
|
102299
102537
|
null,
|
|
102300
102538
|
opts
|
|
102301
102539
|
);
|
|
102302
|
-
} else if (
|
|
102303
|
-
const grantId = session.grantIdFor(
|
|
102304
|
-
if (grantId && !session.authorizationFor(
|
|
102540
|
+
} else if (state2.clientId) {
|
|
102541
|
+
const grantId = session.grantIdFor(state2.clientId);
|
|
102542
|
+
if (grantId && !session.authorizationFor(state2.clientId).persistsLogout) {
|
|
102305
102543
|
await revoke(ctx, grantId);
|
|
102306
102544
|
}
|
|
102307
102545
|
session.state = void 0;
|
|
102308
102546
|
if (session.authorizations) {
|
|
102309
|
-
delete session.authorizations[
|
|
102547
|
+
delete session.authorizations[state2.clientId];
|
|
102310
102548
|
}
|
|
102311
102549
|
session.resetIdentifier();
|
|
102312
102550
|
}
|
|
102313
|
-
const usePostLogoutUri =
|
|
102314
|
-
const forwardClientId = !usePostLogoutUri && !params.logout &&
|
|
102551
|
+
const usePostLogoutUri = state2.postLogoutRedirectUri;
|
|
102552
|
+
const forwardClientId = !usePostLogoutUri && !params.logout && state2.clientId;
|
|
102315
102553
|
const uri = redirectUri(
|
|
102316
|
-
usePostLogoutUri ?
|
|
102554
|
+
usePostLogoutUri ? state2.postLogoutRedirectUri : ctx.oidc.urlFor("end_session_success"),
|
|
102317
102555
|
{
|
|
102318
|
-
...usePostLogoutUri &&
|
|
102319
|
-
...forwardClientId ? { client_id:
|
|
102556
|
+
...usePostLogoutUri && state2.state != null ? { state: state2.state } : void 0,
|
|
102557
|
+
...forwardClientId ? { client_id: state2.clientId } : void 0
|
|
102320
102558
|
}
|
|
102321
102559
|
);
|
|
102322
102560
|
ctx.oidc.provider.emit("end_session.success", ctx);
|
|
@@ -103245,8 +103483,8 @@ function getClaims(provider) {
|
|
|
103245
103483
|
if (Object.keys(this.filter).length) {
|
|
103246
103484
|
throw new Error("scope cannot be assigned after mask has been set");
|
|
103247
103485
|
}
|
|
103248
|
-
value.split(" ").forEach((
|
|
103249
|
-
this.mask(claimConfig[
|
|
103486
|
+
value.split(" ").forEach((scope3) => {
|
|
103487
|
+
this.mask(claimConfig[scope3]);
|
|
103250
103488
|
});
|
|
103251
103489
|
return this;
|
|
103252
103490
|
}
|
|
@@ -103461,7 +103699,7 @@ var jwt_default = (provider, { opaque }) => {
|
|
|
103461
103699
|
jti,
|
|
103462
103700
|
iat,
|
|
103463
103701
|
exp,
|
|
103464
|
-
scope:
|
|
103702
|
+
scope: scope3,
|
|
103465
103703
|
clientId,
|
|
103466
103704
|
"x5t#S256": x5t2,
|
|
103467
103705
|
jkt: jkt2,
|
|
@@ -103486,7 +103724,7 @@ var jwt_default = (provider, { opaque }) => {
|
|
|
103486
103724
|
iat,
|
|
103487
103725
|
exp,
|
|
103488
103726
|
authorization_details: rar,
|
|
103489
|
-
scope:
|
|
103727
|
+
scope: scope3 || void 0,
|
|
103490
103728
|
client_id: clientId,
|
|
103491
103729
|
iss: provider.issuer,
|
|
103492
103730
|
aud,
|
|
@@ -103936,8 +104174,8 @@ function getBaseModel(provider) {
|
|
|
103936
104174
|
}
|
|
103937
104175
|
ttlPercentagePassed() {
|
|
103938
104176
|
const now = epoch_time_default();
|
|
103939
|
-
const
|
|
103940
|
-
return Math.max(Math.min(100,
|
|
104177
|
+
const percentage2 = Math.floor(100 * ((now - this.iat) / (this.exp - this.iat)));
|
|
104178
|
+
return Math.max(Math.min(100, percentage2), 0);
|
|
103941
104179
|
}
|
|
103942
104180
|
get isValid() {
|
|
103943
104181
|
return !this.isExpired;
|
|
@@ -104635,8 +104873,8 @@ function getSchema(provider) {
|
|
|
104635
104873
|
scopes() {
|
|
104636
104874
|
if (this.scope) {
|
|
104637
104875
|
const parsed = new Set(this.scope.split(" "));
|
|
104638
|
-
parsed.forEach((
|
|
104639
|
-
if (!scopes.has(
|
|
104876
|
+
parsed.forEach((scope3) => {
|
|
104877
|
+
if (!scopes.has(scope3)) {
|
|
104640
104878
|
this.invalidate("scope must only contain Authorization Server supported scope values");
|
|
104641
104879
|
}
|
|
104642
104880
|
});
|
|
@@ -106040,9 +106278,9 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106040
106278
|
if (this.rejected) {
|
|
106041
106279
|
const rejected = this.getOIDCScope.call(this.rejected).split(" ");
|
|
106042
106280
|
const granted = new Set(this.openid.scope.split(" "));
|
|
106043
|
-
for (const
|
|
106044
|
-
if (
|
|
106045
|
-
granted.delete(
|
|
106281
|
+
for (const scope3 of rejected) {
|
|
106282
|
+
if (scope3 !== "openid") {
|
|
106283
|
+
granted.delete(scope3);
|
|
106046
106284
|
}
|
|
106047
106285
|
}
|
|
106048
106286
|
return [...granted].join(" ");
|
|
@@ -106064,19 +106302,19 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106064
106302
|
const granted = this.getOIDCScope().split(" ");
|
|
106065
106303
|
return granted.filter(Set.prototype.has.bind(filter2)).join(" ");
|
|
106066
106304
|
}
|
|
106067
|
-
addOIDCScope(
|
|
106068
|
-
if (
|
|
106069
|
-
|
|
106070
|
-
} else if (Array.isArray(
|
|
106071
|
-
|
|
106072
|
-
} else if (typeof
|
|
106305
|
+
addOIDCScope(scope3) {
|
|
106306
|
+
if (scope3 instanceof Set) {
|
|
106307
|
+
scope3 = [...scope3].join(" ");
|
|
106308
|
+
} else if (Array.isArray(scope3)) {
|
|
106309
|
+
scope3 = scope3.join(" ");
|
|
106310
|
+
} else if (typeof scope3 !== "string") {
|
|
106073
106311
|
throw new TypeError('"scope" must be a string');
|
|
106074
106312
|
}
|
|
106075
106313
|
this.openid ||= {};
|
|
106076
106314
|
if (this.openid.scope) {
|
|
106077
|
-
this.openid.scope = [.../* @__PURE__ */ new Set([...this.openid.scope.split(" "), ...
|
|
106315
|
+
this.openid.scope = [.../* @__PURE__ */ new Set([...this.openid.scope.split(" "), ...scope3.split(" ")])].join(" ");
|
|
106078
106316
|
} else {
|
|
106079
|
-
this.openid.scope =
|
|
106317
|
+
this.openid.scope = scope3;
|
|
106080
106318
|
}
|
|
106081
106319
|
}
|
|
106082
106320
|
rejectOIDCScope(...args2) {
|
|
@@ -106096,8 +106334,8 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106096
106334
|
if (this.rejected) {
|
|
106097
106335
|
const rejected = this.getResourceScope.call(this.rejected, resource).split(" ");
|
|
106098
106336
|
const granted = new Set(this.resources[resource].split(" "));
|
|
106099
|
-
for (const
|
|
106100
|
-
granted.delete(
|
|
106337
|
+
for (const scope3 of rejected) {
|
|
106338
|
+
granted.delete(scope3);
|
|
106101
106339
|
}
|
|
106102
106340
|
return [...granted].join(" ");
|
|
106103
106341
|
}
|
|
@@ -106121,22 +106359,22 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106121
106359
|
const granted = this.getResourceScope(resource).split(" ");
|
|
106122
106360
|
return granted.filter(Set.prototype.has.bind(filter2)).join(" ");
|
|
106123
106361
|
}
|
|
106124
|
-
addResourceScope(resource,
|
|
106362
|
+
addResourceScope(resource, scope3) {
|
|
106125
106363
|
if (typeof resource !== "string") {
|
|
106126
106364
|
throw new TypeError('"resource" must be a string');
|
|
106127
106365
|
}
|
|
106128
|
-
if (
|
|
106129
|
-
|
|
106130
|
-
} else if (Array.isArray(
|
|
106131
|
-
|
|
106132
|
-
} else if (typeof
|
|
106366
|
+
if (scope3 instanceof Set) {
|
|
106367
|
+
scope3 = [...scope3].join(" ");
|
|
106368
|
+
} else if (Array.isArray(scope3)) {
|
|
106369
|
+
scope3 = scope3.join(" ");
|
|
106370
|
+
} else if (typeof scope3 !== "string") {
|
|
106133
106371
|
throw new TypeError('"scope" must be a string');
|
|
106134
106372
|
}
|
|
106135
106373
|
this.resources ||= {};
|
|
106136
106374
|
if (this.resources[resource]) {
|
|
106137
|
-
this.resources[resource] = [.../* @__PURE__ */ new Set([...this.resources[resource].split(" "), ...
|
|
106375
|
+
this.resources[resource] = [.../* @__PURE__ */ new Set([...this.resources[resource].split(" "), ...scope3.split(" ")])].join(" ");
|
|
106138
106376
|
} else {
|
|
106139
|
-
this.resources[resource] =
|
|
106377
|
+
this.resources[resource] = scope3;
|
|
106140
106378
|
}
|
|
106141
106379
|
}
|
|
106142
106380
|
rejectResourceScope(...args2) {
|
|
@@ -107004,9 +107242,10 @@ function buildEligibilityCtes(organizationPredicate) {
|
|
|
107004
107242
|
)
|
|
107005
107243
|
`;
|
|
107006
107244
|
}
|
|
107007
|
-
|
|
107245
|
+
function buildAvailabilityChecksListQuery(organizationPredicate, checkPredicate, limitSql = "$3", cursorSql = "$4") {
|
|
107246
|
+
return `
|
|
107008
107247
|
WITH
|
|
107009
|
-
${buildEligibilityCtes(
|
|
107248
|
+
${buildEligibilityCtes(`AND ${organizationPredicate}`)},
|
|
107010
107249
|
ranked AS (
|
|
107011
107250
|
SELECT
|
|
107012
107251
|
c.id::text AS check_id,
|
|
@@ -107053,8 +107292,8 @@ var LIST_AVAILABILITY_CHECKS_QUERY = `
|
|
|
107053
107292
|
LEFT JOIN monitored_project_ranks monitored_ranks
|
|
107054
107293
|
ON monitored_ranks.organization_id = p.organization_id
|
|
107055
107294
|
AND monitored_ranks.project_id = c.project_id
|
|
107056
|
-
WHERE
|
|
107057
|
-
AND
|
|
107295
|
+
WHERE ${checkPredicate}
|
|
107296
|
+
AND ${organizationPredicate}
|
|
107058
107297
|
AND c.deleted_at IS NULL
|
|
107059
107298
|
)
|
|
107060
107299
|
SELECT
|
|
@@ -107065,10 +107304,15 @@ var LIST_AVAILABILITY_CHECKS_QUERY = `
|
|
|
107065
107304
|
NOT ranked.enabled OR ranked.organization_check_rank <= ranked.plan_organization_check_limit
|
|
107066
107305
|
AS within_organization_active_limit
|
|
107067
107306
|
FROM ranked
|
|
107068
|
-
WHERE ($
|
|
107307
|
+
WHERE (${cursorSql}::text IS NULL OR ranked.check_id = ${cursorSql})
|
|
107069
107308
|
ORDER BY ranked.created_at DESC
|
|
107070
|
-
LIMIT $
|
|
107309
|
+
LIMIT ${limitSql}
|
|
107071
107310
|
`;
|
|
107311
|
+
}
|
|
107312
|
+
var LIST_AVAILABILITY_CHECKS_QUERY = buildAvailabilityChecksListQuery(
|
|
107313
|
+
"p.organization_id = $2::uuid",
|
|
107314
|
+
"c.project_id = $1::uuid"
|
|
107315
|
+
);
|
|
107072
107316
|
var CLAIM_DUE_AVAILABILITY_CHECKS_QUERY = `
|
|
107073
107317
|
WITH due_organizations AS (
|
|
107074
107318
|
SELECT DISTINCT p.organization_id
|
|
@@ -108377,8 +108621,41 @@ function defineStorageSchemaMigration(input2) {
|
|
|
108377
108621
|
};
|
|
108378
108622
|
}
|
|
108379
108623
|
|
|
108380
|
-
// ../../packages/storage/src/
|
|
108624
|
+
// ../../packages/storage/src/public-status-schema.ts
|
|
108381
108625
|
var statements = [
|
|
108626
|
+
`CREATE TABLE IF NOT EXISTS public_status_pages (
|
|
108627
|
+
id uuid PRIMARY KEY, anchor_project_id uuid NOT NULL UNIQUE REFERENCES projects(id) ON DELETE CASCADE,
|
|
108628
|
+
owner_user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
108629
|
+
organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
|
108630
|
+
public_id text NOT NULL UNIQUE CHECK (public_id ~ '^[a-f0-9]{24}$'),
|
|
108631
|
+
title text NOT NULL CHECK (length(title) BETWEEN 1 AND 120), enabled boolean NOT NULL DEFAULT false,
|
|
108632
|
+
created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now()
|
|
108633
|
+
)`,
|
|
108634
|
+
`CREATE TABLE IF NOT EXISTS public_status_page_projects (
|
|
108635
|
+
page_id uuid NOT NULL REFERENCES public_status_pages(id) ON DELETE CASCADE,
|
|
108636
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
108637
|
+
position integer NOT NULL CHECK (position BETWEEN 0 AND 49), PRIMARY KEY(page_id, project_id)
|
|
108638
|
+
)`,
|
|
108639
|
+
`CREATE TABLE IF NOT EXISTS public_status_page_checks (
|
|
108640
|
+
page_id uuid NOT NULL, project_id uuid NOT NULL, check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
|
|
108641
|
+
PRIMARY KEY(page_id, check_id), FOREIGN KEY(page_id, project_id) REFERENCES public_status_page_projects(page_id, project_id) ON DELETE CASCADE
|
|
108642
|
+
)`,
|
|
108643
|
+
"CREATE INDEX IF NOT EXISTS public_status_page_projects_project_idx ON public_status_page_projects(project_id)",
|
|
108644
|
+
"CREATE INDEX IF NOT EXISTS public_status_page_checks_check_idx ON public_status_page_checks(check_id)"
|
|
108645
|
+
];
|
|
108646
|
+
var PUBLIC_STATUS_BOOTSTRAP_STATEMENTS = statements.map(
|
|
108647
|
+
(s) => s.replaceAll(" IF NOT EXISTS", "")
|
|
108648
|
+
);
|
|
108649
|
+
var PUBLIC_STATUS_SCHEMA_MIGRATIONS = [
|
|
108650
|
+
defineStorageSchemaMigration({
|
|
108651
|
+
id: "202610080001_add_public_status_pages",
|
|
108652
|
+
description: "Add opt-in, explicitly selected public availability pages.",
|
|
108653
|
+
statements
|
|
108654
|
+
})
|
|
108655
|
+
];
|
|
108656
|
+
|
|
108657
|
+
// ../../packages/storage/src/analytics-flow-schema.ts
|
|
108658
|
+
var statements2 = [
|
|
108382
108659
|
`CREATE TABLE IF NOT EXISTS analytics_flow_definitions (
|
|
108383
108660
|
id uuid PRIMARY KEY, project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
108384
108661
|
flow_key text NOT NULL, version integer NOT NULL DEFAULT 1, definition jsonb NOT NULL,
|
|
@@ -108411,18 +108688,18 @@ var statements = [
|
|
|
108411
108688
|
)`,
|
|
108412
108689
|
`CREATE INDEX IF NOT EXISTS analytics_flow_rollups_expiry_idx ON analytics_flow_rollups(cohort_date, flow_id)`
|
|
108413
108690
|
];
|
|
108414
|
-
var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS =
|
|
108691
|
+
var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS = statements2.map(
|
|
108415
108692
|
(statement) => statement.replaceAll(" IF NOT EXISTS", "")
|
|
108416
108693
|
);
|
|
108417
108694
|
var migration = {
|
|
108418
108695
|
id: "202610030001_add_public_analytics_flows",
|
|
108419
108696
|
description: "Add customer project flow definitions, bounded continuity and aggregate reports.",
|
|
108420
|
-
statements
|
|
108697
|
+
statements: statements2
|
|
108421
108698
|
};
|
|
108422
108699
|
var ANALYTICS_FLOW_SCHEMA_MIGRATIONS = [defineStorageSchemaMigration(migration)];
|
|
108423
108700
|
|
|
108424
108701
|
// ../../packages/storage/src/browser-recovery-schema.ts
|
|
108425
|
-
var
|
|
108702
|
+
var statements3 = [
|
|
108426
108703
|
`ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS coalescing_key text`,
|
|
108427
108704
|
`CREATE INDEX IF NOT EXISTS alert_deliveries_coalescing_idx ON alert_deliveries (alert_id, coalescing_key, created_at) WHERE coalescing_key IS NOT NULL`,
|
|
108428
108705
|
`CREATE TABLE IF NOT EXISTS browser_recovery_events (
|
|
@@ -108444,10 +108721,10 @@ var BROWSER_RECOVERY_MIGRATIONS = [
|
|
|
108444
108721
|
defineStorageSchemaMigration({
|
|
108445
108722
|
id: "202609220001_add_browser_recovery_context",
|
|
108446
108723
|
description: "Index browser recovery context and separate burst suppression from alert cooldown identity",
|
|
108447
|
-
statements:
|
|
108724
|
+
statements: statements3
|
|
108448
108725
|
})
|
|
108449
108726
|
];
|
|
108450
|
-
var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS =
|
|
108727
|
+
var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS = statements3.filter((statement) => !statement.startsWith("ALTER TABLE")).map((statement) => statement.replaceAll(" IF NOT EXISTS", ""));
|
|
108451
108728
|
|
|
108452
108729
|
// ../../packages/storage/src/availability-check-bootstrap-statements.ts
|
|
108453
108730
|
var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
|
|
@@ -110423,7 +110700,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS2 = [
|
|
|
110423
110700
|
...AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS,
|
|
110424
110701
|
...ANALYTICS_BOOTSTRAP_STATEMENTS,
|
|
110425
110702
|
...WORKER_JOB_BOOTSTRAP_STATEMENTS,
|
|
110426
|
-
...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS
|
|
110703
|
+
...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS,
|
|
110704
|
+
...PUBLIC_STATUS_BOOTSTRAP_STATEMENTS
|
|
110427
110705
|
];
|
|
110428
110706
|
|
|
110429
110707
|
// ../../packages/storage/src/migrations.ts
|
|
@@ -112638,9 +112916,18 @@ var STORAGE_SCHEMA_MIGRATIONS2 = [
|
|
|
112638
112916
|
...ANALYTICS_STORAGE_SCHEMA_MIGRATIONS,
|
|
112639
112917
|
...OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS,
|
|
112640
112918
|
...WORKER_JOB_SCHEMA_MIGRATIONS,
|
|
112641
|
-
...ANALYTICS_FLOW_SCHEMA_MIGRATIONS
|
|
112919
|
+
...ANALYTICS_FLOW_SCHEMA_MIGRATIONS,
|
|
112920
|
+
...PUBLIC_STATUS_SCHEMA_MIGRATIONS
|
|
112642
112921
|
].sort((left, right) => left.id.localeCompare(right.id));
|
|
112643
112922
|
|
|
112923
|
+
// ../../packages/storage/src/public-status-store.ts
|
|
112924
|
+
var eligibleQuery = buildAvailabilityChecksListQuery(
|
|
112925
|
+
"p.organization_id IN (SELECT organization_id FROM page)",
|
|
112926
|
+
"c.project_id IN (SELECT project_id FROM public_status_page_projects WHERE page_id IN (SELECT id FROM page)) AND c.id IN (SELECT check_id FROM public_status_page_checks WHERE page_id IN (SELECT id FROM page))",
|
|
112927
|
+
"500",
|
|
112928
|
+
"NULL"
|
|
112929
|
+
);
|
|
112930
|
+
|
|
112644
112931
|
// ../cli/src/cloud-artifact-cache.ts
|
|
112645
112932
|
var import_promises6 = require("node:fs/promises");
|
|
112646
112933
|
var import_node_path6 = require("node:path");
|
|
@@ -113074,15 +113361,15 @@ async function readLocalState(dependencies) {
|
|
|
113074
113361
|
throw error2;
|
|
113075
113362
|
}
|
|
113076
113363
|
}
|
|
113077
|
-
async function writeLocalState(
|
|
113364
|
+
async function writeLocalState(state2, dependencies) {
|
|
113078
113365
|
const rootDirectory = getWorkspaceRoot2(dependencies);
|
|
113079
113366
|
const writeFile = dependencies?.writeFile ?? import_promises7.writeFile;
|
|
113080
|
-
await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(
|
|
113367
|
+
await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(state2, null, 2)}
|
|
113081
113368
|
`, "utf8");
|
|
113082
113369
|
}
|
|
113083
113370
|
async function updateLocalIncidentStatus(input2, dependencies) {
|
|
113084
|
-
const
|
|
113085
|
-
const incident =
|
|
113371
|
+
const state2 = await readLocalState(dependencies);
|
|
113372
|
+
const incident = state2.incidents[input2.incidentId];
|
|
113086
113373
|
if (incident === void 0) {
|
|
113087
113374
|
throw createReadError(404, "incident_not_found");
|
|
113088
113375
|
}
|
|
@@ -113091,8 +113378,8 @@ async function updateLocalIncidentStatus(input2, dependencies) {
|
|
|
113091
113378
|
status: input2.status,
|
|
113092
113379
|
...input2.status === "resolved" ? { resolved_at: (/* @__PURE__ */ new Date()).toISOString() } : { resolved_at: null }
|
|
113093
113380
|
};
|
|
113094
|
-
|
|
113095
|
-
await writeLocalState(
|
|
113381
|
+
state2.incidents[input2.incidentId] = nextIncident;
|
|
113382
|
+
await writeLocalState(state2, dependencies);
|
|
113096
113383
|
return projectLocalEvidence(nextIncident);
|
|
113097
113384
|
}
|
|
113098
113385
|
async function listLocalIncidents(input2, dependencies) {
|
|
@@ -117135,13 +117422,13 @@ function sortIncidentRecord(incident) {
|
|
|
117135
117422
|
source_events: [...incident.source_events].sort(compareEventEnvelopes)
|
|
117136
117423
|
};
|
|
117137
117424
|
}
|
|
117138
|
-
function serializeState(
|
|
117425
|
+
function serializeState(state2) {
|
|
117139
117426
|
const incidents = Object.fromEntries(
|
|
117140
|
-
Object.entries(
|
|
117427
|
+
Object.entries(state2.incidents).sort(([left], [right]) => left.localeCompare(right)).map(([incidentId2, incident]) => [incidentId2, sortIncidentRecord(incident)])
|
|
117141
117428
|
);
|
|
117142
117429
|
return `${JSON.stringify({
|
|
117143
117430
|
version: 1,
|
|
117144
|
-
last_processed_event_file:
|
|
117431
|
+
last_processed_event_file: state2.last_processed_event_file,
|
|
117145
117432
|
incidents
|
|
117146
117433
|
}, null, 2)}
|
|
117147
117434
|
`;
|
|
@@ -118403,7 +118690,7 @@ async function runValidateCommand(input2, dependencies = {}) {
|
|
|
118403
118690
|
}
|
|
118404
118691
|
}
|
|
118405
118692
|
checks.push(...agentChecks(report).filter((check5) => check5.name !== "canonical-skill"));
|
|
118406
|
-
autoFixAvailable ||= report.agents.some((agent) => [agent.instruction, agent.discovery].some((
|
|
118693
|
+
autoFixAvailable ||= report.agents.some((agent) => [agent.instruction, agent.discovery].some((state2) => state2 === "missing" || state2 === "stale"));
|
|
118407
118694
|
const ignore = await ensureGitignore(rootDirectory, buildManagedGitignoreSection(), input2.fix === true);
|
|
118408
118695
|
const gitignoreCheck = { name: "gitignore", status: ignore.present ? "ok" : "missing", message: ignore.changed ? `Updated ${GITIGNORE_FILE_PATH}` : `${ignore.present ? "Found" : "Missing"} managed ${GITIGNORE_FILE_PATH} entries` };
|
|
118409
118696
|
if (gitignoreCheck.status === "missing") {
|
|
@@ -118435,6 +118722,16 @@ function parseJsonOutput2(output) {
|
|
|
118435
118722
|
}
|
|
118436
118723
|
return parsed;
|
|
118437
118724
|
}
|
|
118725
|
+
function cloudVerificationOptions(input2) {
|
|
118726
|
+
return {
|
|
118727
|
+
projectId: String(input2["projectId"]),
|
|
118728
|
+
...typeof input2["service"] === "string" ? { service: input2["service"] } : {},
|
|
118729
|
+
...typeof input2["environment"] === "string" ? { environment: input2["environment"] } : {},
|
|
118730
|
+
...typeof input2["maxAgeMinutes"] === "number" ? { maxAgeMinutes: input2["maxAgeMinutes"] } : {},
|
|
118731
|
+
...typeof input2["authFilePath"] === "string" ? { authFilePath: input2["authFilePath"] } : {},
|
|
118732
|
+
json: true
|
|
118733
|
+
};
|
|
118734
|
+
}
|
|
118438
118735
|
async function runJsonCommand2(command) {
|
|
118439
118736
|
try {
|
|
118440
118737
|
const result = await command();
|
|
@@ -118472,14 +118769,19 @@ function createSetupMcpTools(commands) {
|
|
|
118472
118769
|
async verify_cloud(input2) {
|
|
118473
118770
|
return runJsonCommand2(
|
|
118474
118771
|
() => commands.verifyCloudCommand({
|
|
118475
|
-
|
|
118476
|
-
...typeof input2["service"] === "string" ? { service: input2["service"] } : {},
|
|
118477
|
-
...typeof input2["environment"] === "string" ? { environment: input2["environment"] } : {},
|
|
118478
|
-
...typeof input2["maxAgeMinutes"] === "number" ? { maxAgeMinutes: input2["maxAgeMinutes"] } : {},
|
|
118772
|
+
...cloudVerificationOptions(input2),
|
|
118479
118773
|
...input2["trigger5xx"] === true ? { trigger5xx: true } : {},
|
|
118480
|
-
...typeof input2["trigger4xxStatus"] === "number" ? { trigger4xxStatus: input2["trigger4xxStatus"] } : {}
|
|
118481
|
-
|
|
118482
|
-
|
|
118774
|
+
...typeof input2["trigger4xxStatus"] === "number" ? { trigger4xxStatus: input2["trigger4xxStatus"] } : {}
|
|
118775
|
+
})
|
|
118776
|
+
);
|
|
118777
|
+
},
|
|
118778
|
+
async verify_app_event(input2) {
|
|
118779
|
+
return runJsonCommand2(
|
|
118780
|
+
() => commands.verifyCloudCommand({
|
|
118781
|
+
...cloudVerificationOptions(input2),
|
|
118782
|
+
expectAppEvent: true,
|
|
118783
|
+
...typeof input2["traceId"] === "string" ? { traceId: input2["traceId"] } : {},
|
|
118784
|
+
...typeof input2["requestId"] === "string" ? { requestId: input2["requestId"] } : {}
|
|
118483
118785
|
})
|
|
118484
118786
|
);
|
|
118485
118787
|
},
|
|
@@ -118771,6 +119073,20 @@ function createWebhookMcpTools(api) {
|
|
|
118771
119073
|
mapMcpError21(error2);
|
|
118772
119074
|
}
|
|
118773
119075
|
},
|
|
119076
|
+
async test_webhook_event(input2) {
|
|
119077
|
+
try {
|
|
119078
|
+
return {
|
|
119079
|
+
delivery: await api.testWebhook({
|
|
119080
|
+
bearerToken: String(input2["bearerToken"]),
|
|
119081
|
+
projectId: String(input2["projectId"]),
|
|
119082
|
+
webhookId: String(input2["webhookId"]),
|
|
119083
|
+
eventType: WebhookEventTypeSchema.parse(input2["eventType"])
|
|
119084
|
+
})
|
|
119085
|
+
};
|
|
119086
|
+
} catch (error2) {
|
|
119087
|
+
mapMcpError21(error2);
|
|
119088
|
+
}
|
|
119089
|
+
},
|
|
118774
119090
|
async test_webhook(input2) {
|
|
118775
119091
|
try {
|
|
118776
119092
|
const requestInput = {
|
|
@@ -118890,6 +119206,7 @@ function createWeeklyReportMcpTools(api) {
|
|
|
118890
119206
|
|
|
118891
119207
|
// src/tool-catalog-foundation.ts
|
|
118892
119208
|
var optionalBearerTokenSchema = external_exports.string().optional();
|
|
119209
|
+
var appVerificationHintSchema = external_exports.string().min(1).refine((value) => value.trim().length > 0);
|
|
118893
119210
|
var sourceSchema = external_exports.enum(["local", "cloud"]).optional();
|
|
118894
119211
|
var listIncidentsInputSchema = external_exports.object({
|
|
118895
119212
|
bearerToken: optionalBearerTokenSchema,
|
|
@@ -118956,6 +119273,25 @@ var MCP_TOOL_CATALOG_FOUNDATION = [
|
|
|
118956
119273
|
authFilePath: external_exports.string().optional()
|
|
118957
119274
|
})
|
|
118958
119275
|
},
|
|
119276
|
+
{
|
|
119277
|
+
name: "verify_app_event",
|
|
119278
|
+
group: "setup",
|
|
119279
|
+
description: "Wait for a real SDK-driven hosted app incident and verify its bundle using service, traceId, or requestId. Read-only proof; does not create synthetic events. Requires local member authentication.",
|
|
119280
|
+
inputSchema: external_exports.object({
|
|
119281
|
+
projectId: external_exports.string().min(1),
|
|
119282
|
+
service: appVerificationHintSchema.optional(),
|
|
119283
|
+
environment: external_exports.string().optional(),
|
|
119284
|
+
maxAgeMinutes: external_exports.number().optional(),
|
|
119285
|
+
traceId: appVerificationHintSchema.optional(),
|
|
119286
|
+
requestId: appVerificationHintSchema.optional(),
|
|
119287
|
+
authFilePath: external_exports.string().optional()
|
|
119288
|
+
}).strict().refine(
|
|
119289
|
+
(input2) => input2.service !== void 0 || input2.traceId !== void 0 || input2.requestId !== void 0,
|
|
119290
|
+
{
|
|
119291
|
+
message: "App-event proof requires service, traceId, or requestId."
|
|
119292
|
+
}
|
|
119293
|
+
)
|
|
119294
|
+
},
|
|
118959
119295
|
{
|
|
118960
119296
|
name: "smoke",
|
|
118961
119297
|
group: "setup",
|
|
@@ -119212,6 +119548,12 @@ var MCP_TOOL_CATALOG_FOUNDATION = [
|
|
|
119212
119548
|
projectId: external_exports.string()
|
|
119213
119549
|
})
|
|
119214
119550
|
},
|
|
119551
|
+
{
|
|
119552
|
+
name: "disconnect_github_installation",
|
|
119553
|
+
group: "github",
|
|
119554
|
+
description: "Disconnect the GitHub installation for the active organization and remove repository assignments across all its projects. Owner only. This does not uninstall the App from GitHub; install/reconnect requires the dashboard browser handoff.",
|
|
119555
|
+
inputSchema: external_exports.object({ bearerToken: external_exports.string().min(1) }).strict()
|
|
119556
|
+
},
|
|
119215
119557
|
{
|
|
119216
119558
|
name: "list_project_tokens",
|
|
119217
119559
|
group: "tokens",
|
|
@@ -119253,13 +119595,22 @@ var MCP_TOOL_CATALOG_FOUNDATION = [
|
|
|
119253
119595
|
name: "create_agent_token",
|
|
119254
119596
|
group: "tokens",
|
|
119255
119597
|
description: "Create a single-project minimized read credential, returned once. Requires owner or project admin.",
|
|
119256
|
-
inputSchema: external_exports.object({
|
|
119598
|
+
inputSchema: external_exports.object({
|
|
119599
|
+
bearerToken: external_exports.string(),
|
|
119600
|
+
projectId: external_exports.string().uuid(),
|
|
119601
|
+
label: external_exports.string().min(1).max(120),
|
|
119602
|
+
expiresAt: external_exports.string().datetime().optional()
|
|
119603
|
+
})
|
|
119257
119604
|
},
|
|
119258
119605
|
{
|
|
119259
119606
|
name: "revoke_agent_token",
|
|
119260
119607
|
group: "tokens",
|
|
119261
119608
|
description: "Revoke a project-scoped agent credential. Requires owner or project admin.",
|
|
119262
|
-
inputSchema: external_exports.object({
|
|
119609
|
+
inputSchema: external_exports.object({
|
|
119610
|
+
bearerToken: external_exports.string(),
|
|
119611
|
+
projectId: external_exports.string().uuid(),
|
|
119612
|
+
tokenId: external_exports.string().uuid()
|
|
119613
|
+
})
|
|
119263
119614
|
},
|
|
119264
119615
|
{
|
|
119265
119616
|
name: "list_member_tokens",
|
|
@@ -119357,6 +119708,17 @@ var MCP_TOOL_CATALOG_OPERATIONS = [
|
|
|
119357
119708
|
eventType: verificationEventTypeSchema.optional()
|
|
119358
119709
|
})
|
|
119359
119710
|
},
|
|
119711
|
+
{
|
|
119712
|
+
name: "test_webhook_event",
|
|
119713
|
+
group: "webhooks",
|
|
119714
|
+
description: "Queue a signed synthetic webhook test for any supported lifecycle event. Requires endpoint creator or owner/admin authority; does not create a real incident or bundle. The legacy test_webhook verification contract is retained.",
|
|
119715
|
+
inputSchema: external_exports.object({
|
|
119716
|
+
bearerToken: external_exports.string(),
|
|
119717
|
+
projectId: external_exports.string().min(1),
|
|
119718
|
+
webhookId: external_exports.string().min(1),
|
|
119719
|
+
eventType: WebhookEventTypeSchema
|
|
119720
|
+
}).strict()
|
|
119721
|
+
},
|
|
119360
119722
|
{
|
|
119361
119723
|
name: "list_webhook_deliveries",
|
|
119362
119724
|
group: "webhooks",
|
|
@@ -119657,6 +120019,7 @@ var MCP_TOOL_CATALOG_OPERATIONS = [
|
|
|
119657
120019
|
|
|
119658
120020
|
// src/tool-catalog.ts
|
|
119659
120021
|
var MCP_TOOL_CATALOG = [
|
|
120022
|
+
...PUBLIC_STATUS_MCP_TOOL_CATALOG,
|
|
119660
120023
|
...ANALYTICS_FLOW_MCP_TOOL_CATALOG,
|
|
119661
120024
|
...MCP_TOOL_CATALOG_FOUNDATION,
|
|
119662
120025
|
...MCP_TOOL_CATALOG_OPERATIONS,
|
|
@@ -120074,6 +120437,7 @@ async function createDefaultMcpTools(input2 = {}) {
|
|
|
120074
120437
|
...createAnalyticsJourneySampleApi(httpClient)
|
|
120075
120438
|
}),
|
|
120076
120439
|
...createAnalyticsSettingsMcpTools(createAnalyticsSettingsApi(httpClient)),
|
|
120440
|
+
...createPublicStatusMcpTools(createPublicStatusApi(httpClient)),
|
|
120077
120441
|
...createAnalyticsFlowMcpTools(createAnalyticsFlowApi(httpClient)),
|
|
120078
120442
|
...createAnalyticsSavedFunnelMcpTools(createAnalyticsSavedFunnelApi(httpClient)),
|
|
120079
120443
|
...createCaptureRuleMcpTools(createCaptureRuleApi(httpClient)),
|
|
@@ -120097,7 +120461,7 @@ var import_node_readline = require("node:readline");
|
|
|
120097
120461
|
var package_default = {
|
|
120098
120462
|
name: "@debugbundle/mcp",
|
|
120099
120463
|
mcpName: "com.debugbundle/mcp",
|
|
120100
|
-
version: "1.
|
|
120464
|
+
version: "1.15.0",
|
|
120101
120465
|
private: false,
|
|
120102
120466
|
description: "MCP server for runtime error reporting, incident response, health checks, debug bundles, and product analytics",
|
|
120103
120467
|
license: "Apache-2.0",
|