@debugbundle/mcp 1.14.0 → 1.16.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 +31 -15
- package/dist/main.cjs +743 -388
- 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;
|
|
@@ -73892,6 +73983,136 @@ var CaptureRulesFileSchema = external_exports.object({
|
|
|
73892
73983
|
rules: external_exports.array(CaptureRuleSchema)
|
|
73893
73984
|
});
|
|
73894
73985
|
|
|
73986
|
+
// ../../packages/shared-types/src/browser-resource-providers.ts
|
|
73987
|
+
var PROVIDERS = [
|
|
73988
|
+
{
|
|
73989
|
+
name: "Google Tag Manager",
|
|
73990
|
+
role: "tag_manager",
|
|
73991
|
+
hosts: ["www.googletagmanager.com"],
|
|
73992
|
+
paths: ["/gtm.js"]
|
|
73993
|
+
},
|
|
73994
|
+
{
|
|
73995
|
+
name: "Google tag (Analytics / Ads)",
|
|
73996
|
+
role: "analytics",
|
|
73997
|
+
hosts: ["www.googletagmanager.com"],
|
|
73998
|
+
paths: ["/gtag/js"]
|
|
73999
|
+
},
|
|
74000
|
+
{
|
|
74001
|
+
name: "Google Analytics",
|
|
74002
|
+
role: "analytics",
|
|
74003
|
+
hosts: ["www.google-analytics.com", "ssl.google-analytics.com"],
|
|
74004
|
+
paths: ["/analytics.js", "/ga.js"]
|
|
74005
|
+
},
|
|
74006
|
+
{
|
|
74007
|
+
name: "Meta Pixel",
|
|
74008
|
+
role: "advertising",
|
|
74009
|
+
hosts: ["connect.facebook.net"],
|
|
74010
|
+
paths: [/^\/[a-z]{2}_[A-Z]{2}\/fbevents\.js$/]
|
|
74011
|
+
},
|
|
74012
|
+
{
|
|
74013
|
+
name: "Microsoft Clarity",
|
|
74014
|
+
role: "analytics",
|
|
74015
|
+
hosts: ["www.clarity.ms"],
|
|
74016
|
+
paths: [/^\/tag\/[A-Za-z0-9]+$/]
|
|
74017
|
+
},
|
|
74018
|
+
{
|
|
74019
|
+
name: "Hotjar",
|
|
74020
|
+
role: "analytics",
|
|
74021
|
+
hosts: ["static.hotjar.com"],
|
|
74022
|
+
paths: [/^\/c\/hotjar-[0-9]+\.js$/]
|
|
74023
|
+
},
|
|
74024
|
+
{
|
|
74025
|
+
name: "Cloudflare Web Analytics",
|
|
74026
|
+
role: "analytics",
|
|
74027
|
+
hosts: ["static.cloudflareinsights.com"],
|
|
74028
|
+
paths: ["/beacon.min.js"]
|
|
74029
|
+
},
|
|
74030
|
+
{
|
|
74031
|
+
name: "Yandex Metrica",
|
|
74032
|
+
role: "analytics",
|
|
74033
|
+
hosts: ["mc.yandex.ru", "mc.yandex.com"],
|
|
74034
|
+
paths: ["/metrika/tag.js"]
|
|
74035
|
+
},
|
|
74036
|
+
{
|
|
74037
|
+
name: "WordPress.com / Jetpack Stats",
|
|
74038
|
+
role: "analytics",
|
|
74039
|
+
hosts: ["stats.wp.com"],
|
|
74040
|
+
paths: [/^\/e-[0-9]{6}\.js$/]
|
|
74041
|
+
},
|
|
74042
|
+
{
|
|
74043
|
+
name: "Microsoft Advertising UET",
|
|
74044
|
+
role: "advertising",
|
|
74045
|
+
hosts: ["bat.bing.com"],
|
|
74046
|
+
paths: ["/bat.js"]
|
|
74047
|
+
},
|
|
74048
|
+
{
|
|
74049
|
+
name: "LinkedIn Insight",
|
|
74050
|
+
role: "advertising",
|
|
74051
|
+
hosts: ["snap.licdn.com"],
|
|
74052
|
+
paths: ["/li.lms-analytics/insight.min.js"]
|
|
74053
|
+
},
|
|
74054
|
+
{
|
|
74055
|
+
name: "TikTok Pixel",
|
|
74056
|
+
role: "advertising",
|
|
74057
|
+
hosts: ["analytics.tiktok.com"],
|
|
74058
|
+
paths: ["/i18n/pixel/events.js"]
|
|
74059
|
+
},
|
|
74060
|
+
{ name: "Pinterest Tag", role: "advertising", hosts: ["s.pinimg.com"], paths: ["/ct/core.js"] },
|
|
74061
|
+
{
|
|
74062
|
+
name: "X Pixel",
|
|
74063
|
+
role: "advertising",
|
|
74064
|
+
hosts: ["static.ads-twitter.com", "platform.twitter.com"],
|
|
74065
|
+
paths: ["/uwt.js", "/oct.js"]
|
|
74066
|
+
},
|
|
74067
|
+
{
|
|
74068
|
+
name: "Segment",
|
|
74069
|
+
role: "analytics",
|
|
74070
|
+
hosts: ["cdn.segment.com"],
|
|
74071
|
+
paths: [/^\/analytics\.js\/v1\/[A-Za-z0-9_-]+\/analytics\.min\.js$/]
|
|
74072
|
+
},
|
|
74073
|
+
{
|
|
74074
|
+
name: "Mixpanel",
|
|
74075
|
+
role: "analytics",
|
|
74076
|
+
hosts: ["cdn.mxpnl.com"],
|
|
74077
|
+
paths: ["/libs/mixpanel-2-latest.min.js", "/libs/mixpanel-js/dist/mixpanel.module.js"]
|
|
74078
|
+
},
|
|
74079
|
+
{
|
|
74080
|
+
name: "Amplitude",
|
|
74081
|
+
role: "analytics",
|
|
74082
|
+
hosts: ["cdn.amplitude.com"],
|
|
74083
|
+
paths: [
|
|
74084
|
+
/^\/libs\/analytics-browser-[0-9]+\.[0-9]+\.[0-9]+-min\.js(?:\.gz)?$/,
|
|
74085
|
+
/^\/script\/[A-Za-z0-9_-]+\.js$/
|
|
74086
|
+
]
|
|
74087
|
+
},
|
|
74088
|
+
{
|
|
74089
|
+
name: "PostHog",
|
|
74090
|
+
role: "analytics",
|
|
74091
|
+
hosts: ["us-assets.i.posthog.com", "eu-assets.i.posthog.com", "app.posthog.com"],
|
|
74092
|
+
paths: ["/static/array.js"]
|
|
74093
|
+
},
|
|
74094
|
+
{
|
|
74095
|
+
name: "Plausible",
|
|
74096
|
+
role: "analytics",
|
|
74097
|
+
hosts: ["plausible.io"],
|
|
74098
|
+
paths: [/^\/js\/pa-[A-Za-z0-9_-]+\.js$/, /^\/js\/script(?:\.[a-z-]+)*\.js$/]
|
|
74099
|
+
},
|
|
74100
|
+
{
|
|
74101
|
+
name: "Google sign-in",
|
|
74102
|
+
role: "authentication",
|
|
74103
|
+
hosts: ["accounts.google.com"],
|
|
74104
|
+
paths: ["/gsi/client"]
|
|
74105
|
+
}
|
|
74106
|
+
];
|
|
74107
|
+
function identifyBrowserResourceProvider(host, path) {
|
|
74108
|
+
if (host === null) return null;
|
|
74109
|
+
return PROVIDERS.find(
|
|
74110
|
+
(provider) => provider.hosts.includes(host) && provider.paths.some(
|
|
74111
|
+
(pattern) => typeof pattern === "string" ? path === pattern : pattern.test(path)
|
|
74112
|
+
)
|
|
74113
|
+
) ?? null;
|
|
74114
|
+
}
|
|
74115
|
+
|
|
73895
74116
|
// ../../packages/shared-types/src/browser-resource.ts
|
|
73896
74117
|
function record(value) {
|
|
73897
74118
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -73950,18 +74171,10 @@ function describeBrowserResource(value) {
|
|
|
73950
74171
|
let role = location.first_party === true ? "application_asset" : "unknown";
|
|
73951
74172
|
let provider = null;
|
|
73952
74173
|
if (type === "script") {
|
|
73953
|
-
|
|
73954
|
-
|
|
73955
|
-
|
|
73956
|
-
|
|
73957
|
-
provider = "Meta Pixel";
|
|
73958
|
-
role = "advertising";
|
|
73959
|
-
} else if (location.host === "www.clarity.ms" && /^\/tag\/[A-Za-z0-9]+$/.test(location.path)) {
|
|
73960
|
-
provider = "Microsoft Clarity";
|
|
73961
|
-
role = "analytics";
|
|
73962
|
-
} else if (location.host === "accounts.google.com" && location.path === "/gsi/client") {
|
|
73963
|
-
provider = "Google sign-in";
|
|
73964
|
-
role = "authentication";
|
|
74174
|
+
const recognized = identifyBrowserResourceProvider(location.host, location.path);
|
|
74175
|
+
if (recognized !== null) {
|
|
74176
|
+
provider = recognized.name;
|
|
74177
|
+
role = recognized.role;
|
|
73965
74178
|
}
|
|
73966
74179
|
}
|
|
73967
74180
|
const file = location.path.split("/").filter(Boolean).at(-1) ?? location.path;
|
|
@@ -73985,7 +74198,8 @@ function describeBrowserResourceInterruption(value) {
|
|
|
73985
74198
|
const readyState = page?.["ready_state"];
|
|
73986
74199
|
const tag2 = typeof target?.["tag_name"] === "string" ? target["tag_name"].toLowerCase() : null;
|
|
73987
74200
|
const rel = typeof attributes?.["rel"] === "string" ? attributes["rel"].trim().toLowerCase() : null;
|
|
73988
|
-
if (visibility !== "hidden" && visibility !== "prerender" && visibility !== "unloaded" || readyState !== "loading" && readyState !== "interactive" || tag2 !== "link" || rel !== "preload" && rel !== "modulepreload" && rel !== "prefetch")
|
|
74201
|
+
if (visibility !== "hidden" && visibility !== "prerender" && visibility !== "unloaded" || readyState !== "loading" && readyState !== "interactive" || tag2 !== "link" || rel !== "preload" && rel !== "modulepreload" && rel !== "prefetch")
|
|
74202
|
+
return null;
|
|
73989
74203
|
return {
|
|
73990
74204
|
visibility_state: visibility,
|
|
73991
74205
|
ready_state: readyState,
|
|
@@ -75351,32 +75565,6 @@ var BundleV1Schema = external_exports.object({
|
|
|
75351
75565
|
metadata: BundleMetadataSchema
|
|
75352
75566
|
});
|
|
75353
75567
|
|
|
75354
|
-
// ../../packages/retrieval-client/src/mutation-outcome.ts
|
|
75355
|
-
var MutationOutcomeUnconfirmedError = class extends Error {
|
|
75356
|
-
constructor(status) {
|
|
75357
|
-
super(
|
|
75358
|
-
"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."
|
|
75359
|
-
);
|
|
75360
|
-
this.status = status;
|
|
75361
|
-
this.name = "MutationOutcomeUnconfirmedError";
|
|
75362
|
-
}
|
|
75363
|
-
code = "mutation_outcome_unconfirmed";
|
|
75364
|
-
outcome = "unknown";
|
|
75365
|
-
retrySafe = false;
|
|
75366
|
-
toJSON() {
|
|
75367
|
-
return {
|
|
75368
|
-
error: this.code,
|
|
75369
|
-
outcome: this.outcome,
|
|
75370
|
-
retry_safe: this.retrySafe,
|
|
75371
|
-
message: this.message
|
|
75372
|
-
};
|
|
75373
|
-
}
|
|
75374
|
-
};
|
|
75375
|
-
|
|
75376
|
-
// ../../packages/node-http/src/index.ts
|
|
75377
|
-
var import_undici = __toESM(require_undici(), 1);
|
|
75378
|
-
var nodeFetch = import_undici.fetch;
|
|
75379
|
-
|
|
75380
75568
|
// ../../packages/retrieval-client/src/index.ts
|
|
75381
75569
|
var ProjectColorTagResponseSchema = external_exports.unknown().transform((value, context) => {
|
|
75382
75570
|
if (value === void 0 || value === null) {
|
|
@@ -77702,6 +77890,122 @@ function createCliHttpClient(input2, dependencies) {
|
|
|
77702
77890
|
};
|
|
77703
77891
|
}
|
|
77704
77892
|
|
|
77893
|
+
// ../cli/src/public-status-commands.ts
|
|
77894
|
+
var PublicStatusApiError = class extends Error {
|
|
77895
|
+
constructor(status, message3) {
|
|
77896
|
+
super(message3);
|
|
77897
|
+
this.status = status;
|
|
77898
|
+
}
|
|
77899
|
+
};
|
|
77900
|
+
function createPublicStatusApi(http) {
|
|
77901
|
+
const path = (scope3) => `/v1/projects/${encodeURIComponent(external_exports.string().uuid().parse(scope3.projectId))}/status-page`;
|
|
77902
|
+
async function request(input2, schema) {
|
|
77903
|
+
const result = await http.request(input2);
|
|
77904
|
+
if (result.status !== 200) {
|
|
77905
|
+
const error2 = external_exports.object({ error: external_exports.string() }).safeParse(result.body);
|
|
77906
|
+
throw new PublicStatusApiError(
|
|
77907
|
+
result.status,
|
|
77908
|
+
error2.success ? error2.data.error : "Status request failed."
|
|
77909
|
+
);
|
|
77910
|
+
}
|
|
77911
|
+
return schema.parse(result.body);
|
|
77912
|
+
}
|
|
77913
|
+
return {
|
|
77914
|
+
get: (scope3) => request(
|
|
77915
|
+
{ method: "GET", path: path(scope3), bearerToken: scope3.bearerToken },
|
|
77916
|
+
PublicStatusManagementSchema
|
|
77917
|
+
),
|
|
77918
|
+
save: (scope3) => request(
|
|
77919
|
+
{
|
|
77920
|
+
method: "PUT",
|
|
77921
|
+
path: path(scope3),
|
|
77922
|
+
bearerToken: scope3.bearerToken,
|
|
77923
|
+
body: PublicStatusSettingsSchema.parse(scope3.settings)
|
|
77924
|
+
},
|
|
77925
|
+
PublicStatusManagementSchema
|
|
77926
|
+
),
|
|
77927
|
+
options: (scope3) => {
|
|
77928
|
+
const query = PublicStatusOptionsQuerySchema.parse({
|
|
77929
|
+
...scope3.cursor ? { cursor: scope3.cursor } : {},
|
|
77930
|
+
...scope3.check_project_id ? { check_project_id: scope3.check_project_id } : {},
|
|
77931
|
+
...scope3.check_cursor ? { check_cursor: scope3.check_cursor } : {}
|
|
77932
|
+
});
|
|
77933
|
+
const params = new URLSearchParams(
|
|
77934
|
+
Object.entries(query).filter(
|
|
77935
|
+
(entry) => typeof entry[1] === "string"
|
|
77936
|
+
)
|
|
77937
|
+
).toString();
|
|
77938
|
+
return request(
|
|
77939
|
+
{
|
|
77940
|
+
method: "GET",
|
|
77941
|
+
path: `${path(scope3)}/options${params ? `?${params}` : ""}`,
|
|
77942
|
+
bearerToken: scope3.bearerToken
|
|
77943
|
+
},
|
|
77944
|
+
PublicStatusOptionsSchema
|
|
77945
|
+
);
|
|
77946
|
+
},
|
|
77947
|
+
preview: (scope3) => request(
|
|
77948
|
+
{ method: "GET", path: `${path(scope3)}/preview`, bearerToken: scope3.bearerToken },
|
|
77949
|
+
PublicStatusPageSchema
|
|
77950
|
+
)
|
|
77951
|
+
};
|
|
77952
|
+
}
|
|
77953
|
+
|
|
77954
|
+
// src/public-status-tools.ts
|
|
77955
|
+
var scope = external_exports.object({ bearerToken: external_exports.string().min(1), projectId: external_exports.string().uuid() }).strict();
|
|
77956
|
+
var PUBLIC_STATUS_MCP_TOOL_NAMES = [
|
|
77957
|
+
"get_public_status_page",
|
|
77958
|
+
"save_public_status_page",
|
|
77959
|
+
"list_public_status_page_options",
|
|
77960
|
+
"preview_public_status_page"
|
|
77961
|
+
];
|
|
77962
|
+
var PUBLIC_STATUS_MCP_TOOL_CATALOG = [
|
|
77963
|
+
{
|
|
77964
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[0],
|
|
77965
|
+
group: "public_status",
|
|
77966
|
+
description: "Read a project's public status settings and share URL. Owners receive configuration; collaborators receive only the published link and title.",
|
|
77967
|
+
inputSchema: scope
|
|
77968
|
+
},
|
|
77969
|
+
{
|
|
77970
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[1],
|
|
77971
|
+
group: "public_status",
|
|
77972
|
+
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.",
|
|
77973
|
+
inputSchema: scope.extend({ settings: PublicStatusSettingsSchema })
|
|
77974
|
+
},
|
|
77975
|
+
{
|
|
77976
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[2],
|
|
77977
|
+
group: "public_status",
|
|
77978
|
+
description: "List a bounded page of same-owner/account projects and checks eligible for status publication. Owner only; continue with next_cursor.",
|
|
77979
|
+
inputSchema: scope.extend(PublicStatusOptionsQueryObjectSchema.shape)
|
|
77980
|
+
},
|
|
77981
|
+
{
|
|
77982
|
+
name: PUBLIC_STATUS_MCP_TOOL_NAMES[3],
|
|
77983
|
+
group: "public_status",
|
|
77984
|
+
description: "Preview the saved public projection, including unpublished settings. Owner only. Reads existing availability; never executes checks or exposes diagnostic details.",
|
|
77985
|
+
inputSchema: scope
|
|
77986
|
+
}
|
|
77987
|
+
];
|
|
77988
|
+
function createPublicStatusMcpTools(api) {
|
|
77989
|
+
async function call(fn2) {
|
|
77990
|
+
try {
|
|
77991
|
+
return await fn2();
|
|
77992
|
+
} catch (error2) {
|
|
77993
|
+
throw new Error(
|
|
77994
|
+
`mcp_tool_error:${error2 instanceof PublicStatusApiError ? error2.message : error2 instanceof external_exports.ZodError ? "invalid_status_input" : "unknown_error"}`
|
|
77995
|
+
);
|
|
77996
|
+
}
|
|
77997
|
+
}
|
|
77998
|
+
return {
|
|
77999
|
+
get_public_status_page: (input2) => call(() => api.get(scope.parse(input2))),
|
|
78000
|
+
save_public_status_page: (input2) => call(() => api.save(PUBLIC_STATUS_MCP_TOOL_CATALOG[1].inputSchema.parse(input2))),
|
|
78001
|
+
list_public_status_page_options: (input2) => call(() => {
|
|
78002
|
+
const parsed = PUBLIC_STATUS_MCP_TOOL_CATALOG[2].inputSchema.parse(input2);
|
|
78003
|
+
return api.options(parsed);
|
|
78004
|
+
}),
|
|
78005
|
+
preview_public_status_page: (input2) => call(() => api.preview(scope.parse(input2)))
|
|
78006
|
+
};
|
|
78007
|
+
}
|
|
78008
|
+
|
|
77705
78009
|
// ../cli/src/analytics-flow-commands.ts
|
|
77706
78010
|
var AnalyticsFlowApiError = class extends Error {
|
|
77707
78011
|
constructor(status, message3) {
|
|
@@ -77761,20 +78065,20 @@ function createAnalyticsFlowApi(http) {
|
|
|
77761
78065
|
}
|
|
77762
78066
|
|
|
77763
78067
|
// src/analytics-flow-tools.ts
|
|
77764
|
-
var
|
|
77765
|
-
var item =
|
|
78068
|
+
var scope2 = external_exports.object({ bearerToken: external_exports.string(), projectId: external_exports.string().uuid() });
|
|
78069
|
+
var item = scope2.extend({ flowKey: AnalyticsFlowKeySchema });
|
|
77766
78070
|
var ANALYTICS_FLOW_MCP_TOOL_CATALOG = [
|
|
77767
78071
|
{
|
|
77768
78072
|
name: "list_analytics_flows",
|
|
77769
78073
|
group: "analytics_flows",
|
|
77770
78074
|
description: "List this project's named acquisition and activation flows, including archived definitions.",
|
|
77771
|
-
inputSchema:
|
|
78075
|
+
inputSchema: scope2
|
|
77772
78076
|
},
|
|
77773
78077
|
{
|
|
77774
78078
|
name: "save_analytics_flow",
|
|
77775
78079
|
group: "analytics_flows",
|
|
77776
78080
|
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.",
|
|
77777
|
-
inputSchema:
|
|
78081
|
+
inputSchema: scope2.extend({ definition: AnalyticsFlowDefinitionInputSchema })
|
|
77778
78082
|
},
|
|
77779
78083
|
{
|
|
77780
78084
|
name: "archive_analytics_flow",
|
|
@@ -77800,7 +78104,7 @@ function createAnalyticsFlowMcpTools(api) {
|
|
|
77800
78104
|
}
|
|
77801
78105
|
}
|
|
77802
78106
|
return {
|
|
77803
|
-
list_analytics_flows: (input2) => call(() => api.list(
|
|
78107
|
+
list_analytics_flows: (input2) => call(() => api.list(scope2.parse(input2))),
|
|
77804
78108
|
save_analytics_flow: (input2) => call(() => api.save(ANALYTICS_FLOW_MCP_TOOL_CATALOG[1].inputSchema.parse(input2))),
|
|
77805
78109
|
archive_analytics_flow: (input2) => call(() => api.archive(item.parse(input2))),
|
|
77806
78110
|
get_analytics_flow_report: (input2) => call(() => {
|
|
@@ -77964,7 +78268,7 @@ function buildSkill() {
|
|
|
77964
78268
|
"",
|
|
77965
78269
|
"- Inspect the primary failure and routes: one resource can span pages, route coverage may be incomplete, and historical incidents stay separate. Related tracker evidence does not explain an application exception.",
|
|
77966
78270
|
'- If the cause is unknown, say "possibly blocked by privacy tools." Network/CSP/provider failures remain possible; provider recognition proves neither Pi-hole blocking nor optionality.',
|
|
77967
|
-
"- Review exact host/path, service, environment and
|
|
78271
|
+
"- Review exact resource host/path/type, service, environment and opacity, or the returned exact fingerprint when evidence is incomplete; never widen to a whole host. All resource incidents can offer explicit controls. Provider recognition does not establish that a dependency is optional; do not suppress authentication, app assets or unknown dependencies automatically.",
|
|
77968
78272
|
"- For confirmed optional dependencies, context (demote) retains diagnostics without new incidents/alerts/automation and may remain billable. Drop discards future matches; choose it only when evidence has no diagnostic value. Explain the tradeoff; neither deletes history. Use the returned suggestion ID.",
|
|
77969
78273
|
"- Check existing/disabled rules. Empty suggestions or pending/failed bundles do not justify broader rules. Applying requires user authorization and owner/admin access; preview is read-only. Verify subsequent matching and protected captures before claiming improvement; live tests need authorization.",
|
|
77970
78274
|
"- The official OpenAI connection cannot suggest or apply rules. When it is the only connection, review returned evidence and hand off through a returned safe dashboard URL; never invent tools or switch credentials.",
|
|
@@ -79092,76 +79396,76 @@ var BudgetExceeded = class extends Error {
|
|
|
79092
79396
|
function byteLength(value) {
|
|
79093
79397
|
return new TextEncoder().encode(value).length;
|
|
79094
79398
|
}
|
|
79095
|
-
function mask(
|
|
79096
|
-
|
|
79399
|
+
function mask(state2) {
|
|
79400
|
+
state2.redactionCount += 1;
|
|
79097
79401
|
return REDACTED2;
|
|
79098
79402
|
}
|
|
79099
|
-
function sanitizeString(value,
|
|
79100
|
-
if (value.length > MAX_STRING_BYTES) return mask(
|
|
79403
|
+
function sanitizeString(value, state2, allowStructured) {
|
|
79404
|
+
if (value.length > MAX_STRING_BYTES) return mask(state2);
|
|
79101
79405
|
const length = byteLength(value);
|
|
79102
|
-
if (length > MAX_STRING_BYTES) return mask(
|
|
79103
|
-
|
|
79104
|
-
if (
|
|
79406
|
+
if (length > MAX_STRING_BYTES) return mask(state2);
|
|
79407
|
+
state2.textBytes += length;
|
|
79408
|
+
if (state2.textBytes > state2.maxTotalBytes) throw new BudgetExceeded();
|
|
79105
79409
|
if (allowStructured && (value.startsWith("{") || value.startsWith("["))) {
|
|
79106
79410
|
try {
|
|
79107
79411
|
const parsed = JSON.parse(value);
|
|
79108
79412
|
if (typeof parsed === "object" && parsed !== null) {
|
|
79109
|
-
const nested = sanitizeValue(parsed,
|
|
79413
|
+
const nested = sanitizeValue(parsed, state2, 0, false);
|
|
79110
79414
|
const encoded = JSON.stringify(nested);
|
|
79111
|
-
if (encoded !== value)
|
|
79415
|
+
if (encoded !== value) state2.redactionCount += 1;
|
|
79112
79416
|
return encoded;
|
|
79113
79417
|
}
|
|
79114
79418
|
} catch (error2) {
|
|
79115
79419
|
if (error2 instanceof BudgetExceeded) throw error2;
|
|
79116
79420
|
}
|
|
79117
79421
|
}
|
|
79118
|
-
const result = scrubCredentialText(value,
|
|
79119
|
-
if (result !== value)
|
|
79422
|
+
const result = scrubCredentialText(value, state2.extra);
|
|
79423
|
+
if (result !== value) state2.redactionCount += 1;
|
|
79120
79424
|
if ((value.startsWith("{") || value.startsWith("[")) && result === value && /(?:password|token|secret|authorization|cookie)["']?\s*[:=]/i.test(value)) {
|
|
79121
|
-
return mask(
|
|
79425
|
+
return mask(state2);
|
|
79122
79426
|
}
|
|
79123
79427
|
return result;
|
|
79124
79428
|
}
|
|
79125
|
-
function sanitizeValue(value,
|
|
79126
|
-
|
|
79127
|
-
if (
|
|
79128
|
-
if (depth > MAX_DEPTH) return mask(
|
|
79129
|
-
if (typeof value === "string") return sanitizeString(value,
|
|
79429
|
+
function sanitizeValue(value, state2, depth, allowStructured) {
|
|
79430
|
+
state2.nodes += 1;
|
|
79431
|
+
if (state2.nodes > MAX_NODES) throw new BudgetExceeded();
|
|
79432
|
+
if (depth > MAX_DEPTH) return mask(state2);
|
|
79433
|
+
if (typeof value === "string") return sanitizeString(value, state2, allowStructured);
|
|
79130
79434
|
if (value === null || typeof value === "boolean") return value;
|
|
79131
79435
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
79132
79436
|
if (typeof value !== "object") throw new TypeError("unsafe_input");
|
|
79133
|
-
if (
|
|
79134
|
-
|
|
79437
|
+
if (state2.seen.has(value)) return "[Circular]";
|
|
79438
|
+
state2.seen.add(value);
|
|
79135
79439
|
try {
|
|
79136
79440
|
if (Array.isArray(value)) {
|
|
79137
|
-
if (value.length > MAX_ENTRIES) return mask(
|
|
79441
|
+
if (value.length > MAX_ENTRIES) return mask(state2);
|
|
79138
79442
|
return Array.from({ length: value.length }, (_, index) => {
|
|
79139
79443
|
const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
|
|
79140
79444
|
if (descriptor === void 0 || !("value" in descriptor)) throw new TypeError("unsafe_input");
|
|
79141
|
-
return sanitizeValue(descriptor.value,
|
|
79445
|
+
return sanitizeValue(descriptor.value, state2, depth + 1, allowStructured);
|
|
79142
79446
|
});
|
|
79143
79447
|
}
|
|
79144
79448
|
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
|
|
79145
79449
|
throw new TypeError("unsafe_input");
|
|
79146
79450
|
}
|
|
79147
79451
|
const keys2 = Object.keys(value);
|
|
79148
|
-
if (keys2.length > MAX_ENTRIES) return mask(
|
|
79452
|
+
if (keys2.length > MAX_ENTRIES) return mask(state2);
|
|
79149
79453
|
const result = {};
|
|
79150
79454
|
for (const key of keys2) {
|
|
79151
79455
|
if (key.length > 128) {
|
|
79152
|
-
|
|
79456
|
+
state2.redactionCount += 1;
|
|
79153
79457
|
continue;
|
|
79154
79458
|
}
|
|
79155
|
-
|
|
79156
|
-
if (
|
|
79157
|
-
const safeKey = scrubCredentialText(key,
|
|
79459
|
+
state2.textBytes += byteLength(key);
|
|
79460
|
+
if (state2.textBytes > state2.maxTotalBytes) throw new BudgetExceeded();
|
|
79461
|
+
const safeKey = scrubCredentialText(key, state2.extra);
|
|
79158
79462
|
if (safeKey !== key) {
|
|
79159
|
-
|
|
79463
|
+
state2.redactionCount += 1;
|
|
79160
79464
|
continue;
|
|
79161
79465
|
}
|
|
79162
79466
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
79163
79467
|
if (descriptor === void 0 || !("value" in descriptor)) throw new TypeError("unsafe_input");
|
|
79164
|
-
const safeValue = isSensitiveKey(key,
|
|
79468
|
+
const safeValue = isSensitiveKey(key, state2.keys) ? mask(state2) : sanitizeValue(descriptor.value, state2, depth + 1, allowStructured);
|
|
79165
79469
|
Object.defineProperty(result, key, {
|
|
79166
79470
|
value: safeValue,
|
|
79167
79471
|
enumerable: true,
|
|
@@ -79171,7 +79475,7 @@ function sanitizeValue(value, state, depth, allowStructured) {
|
|
|
79171
79475
|
}
|
|
79172
79476
|
return result;
|
|
79173
79477
|
} finally {
|
|
79174
|
-
|
|
79478
|
+
state2.seen.delete(value);
|
|
79175
79479
|
}
|
|
79176
79480
|
}
|
|
79177
79481
|
function sanitizeTelemetry(value, options = {}) {
|
|
@@ -79184,7 +79488,7 @@ function sanitizeTelemetry(value, options = {}) {
|
|
|
79184
79488
|
if (!Number.isInteger(maxTotalBytes) || maxTotalBytes < 1 || maxTotalBytes > 512 * 1024) {
|
|
79185
79489
|
return { ok: false, reason: "unsafe_input" };
|
|
79186
79490
|
}
|
|
79187
|
-
const
|
|
79491
|
+
const state2 = {
|
|
79188
79492
|
nodes: 0,
|
|
79189
79493
|
textBytes: 0,
|
|
79190
79494
|
redactionCount: 0,
|
|
@@ -79193,11 +79497,11 @@ function sanitizeTelemetry(value, options = {}) {
|
|
|
79193
79497
|
extra,
|
|
79194
79498
|
maxTotalBytes
|
|
79195
79499
|
};
|
|
79196
|
-
const sanitized = sanitizeValue(value,
|
|
79500
|
+
const sanitized = sanitizeValue(value, state2, 0, true);
|
|
79197
79501
|
if (byteLength(JSON.stringify(sanitized)) > maxTotalBytes) {
|
|
79198
79502
|
return { ok: false, reason: "budget_exceeded" };
|
|
79199
79503
|
}
|
|
79200
|
-
return { ok: true, value: sanitized, redactionCount:
|
|
79504
|
+
return { ok: true, value: sanitized, redactionCount: state2.redactionCount };
|
|
79201
79505
|
} catch (error2) {
|
|
79202
79506
|
return { ok: false, reason: error2 instanceof BudgetExceeded ? "budget_exceeded" : "unsafe_input" };
|
|
79203
79507
|
}
|
|
@@ -91321,17 +91625,17 @@ var InvalidClientMetadata = class extends OIDCProviderError {
|
|
|
91321
91625
|
}
|
|
91322
91626
|
};
|
|
91323
91627
|
var InvalidScope = class extends OIDCProviderError {
|
|
91324
|
-
constructor(description,
|
|
91628
|
+
constructor(description, scope3, options) {
|
|
91325
91629
|
super(400, "invalid_scope", options);
|
|
91326
91630
|
Error.captureStackTrace(this, this.constructor);
|
|
91327
|
-
Object.assign(this, { scope:
|
|
91631
|
+
Object.assign(this, { scope: scope3, error_description: description, error_detail: this.error_detail });
|
|
91328
91632
|
}
|
|
91329
91633
|
};
|
|
91330
91634
|
var InsufficientScope = class extends OIDCProviderError {
|
|
91331
|
-
constructor(description,
|
|
91635
|
+
constructor(description, scope3, options) {
|
|
91332
91636
|
super(403, "insufficient_scope", options);
|
|
91333
91637
|
Error.captureStackTrace(this, this.constructor);
|
|
91334
|
-
Object.assign(this, { scope:
|
|
91638
|
+
Object.assign(this, { scope: scope3, error_description: description, error_detail: this.error_detail });
|
|
91335
91639
|
}
|
|
91336
91640
|
};
|
|
91337
91641
|
var InvalidRequest = class extends OIDCProviderError {
|
|
@@ -91574,10 +91878,10 @@ var consent_default = () => new prompt_default(
|
|
|
91574
91878
|
const { oidc } = ctx;
|
|
91575
91879
|
const encounteredScopes = new Set(oidc.grant.getOIDCScopeEncountered().split(" "));
|
|
91576
91880
|
let missing;
|
|
91577
|
-
for (const
|
|
91578
|
-
if (!encounteredScopes.has(
|
|
91881
|
+
for (const scope3 of oidc.requestParamOIDCScopes) {
|
|
91882
|
+
if (!encounteredScopes.has(scope3)) {
|
|
91579
91883
|
missing ||= [];
|
|
91580
|
-
missing.push(
|
|
91884
|
+
missing.push(scope3);
|
|
91581
91885
|
}
|
|
91582
91886
|
}
|
|
91583
91887
|
if (missing?.length) {
|
|
@@ -91609,11 +91913,11 @@ var consent_default = () => new prompt_default(
|
|
|
91609
91913
|
const encounteredScopes = new Set(oidc.grant.getResourceScopeEncountered(indicator).split(" "));
|
|
91610
91914
|
const requestedScopes = ctx.oidc.requestParamScopes;
|
|
91611
91915
|
const availableScopes = resourceServer.scopes;
|
|
91612
|
-
for (const
|
|
91613
|
-
if (availableScopes.has(
|
|
91916
|
+
for (const scope3 of requestedScopes) {
|
|
91917
|
+
if (availableScopes.has(scope3) && !encounteredScopes.has(scope3)) {
|
|
91614
91918
|
missing ||= {};
|
|
91615
91919
|
missing[indicator] ||= [];
|
|
91616
|
-
missing[indicator].push(
|
|
91920
|
+
missing[indicator].push(scope3);
|
|
91617
91921
|
}
|
|
91618
91922
|
}
|
|
91619
91923
|
}
|
|
@@ -92037,7 +92341,7 @@ async function findAccount(ctx, sub, token) {
|
|
|
92037
92341
|
mustChange("findAccount", "use your own account model");
|
|
92038
92342
|
return {
|
|
92039
92343
|
accountId: sub,
|
|
92040
|
-
async claims(use,
|
|
92344
|
+
async claims(use, scope3, claims, rejected) {
|
|
92041
92345
|
return { sub };
|
|
92042
92346
|
}
|
|
92043
92347
|
};
|
|
@@ -92974,9 +93278,9 @@ var Configuration = class {
|
|
|
92974
93278
|
claimDefinedScopes.push(key);
|
|
92975
93279
|
}
|
|
92976
93280
|
});
|
|
92977
|
-
claimDefinedScopes.forEach((
|
|
92978
|
-
if (typeof
|
|
92979
|
-
this.scopes.add(
|
|
93281
|
+
claimDefinedScopes.forEach((scope3) => {
|
|
93282
|
+
if (typeof scope3 === "string" && !this.scopes.has(scope3)) {
|
|
93283
|
+
this.scopes.add(scope3);
|
|
92980
93284
|
}
|
|
92981
93285
|
});
|
|
92982
93286
|
}
|
|
@@ -92992,9 +93296,9 @@ var Configuration = class {
|
|
|
92992
93296
|
Object.entries(this.claims).forEach(([key, value]) => {
|
|
92993
93297
|
if (Array.isArray(value)) {
|
|
92994
93298
|
this.claims[key] = value.reduce((accumulator, claim) => {
|
|
92995
|
-
const
|
|
92996
|
-
|
|
92997
|
-
return
|
|
93299
|
+
const scope3 = accumulator;
|
|
93300
|
+
scope3[claim] = null;
|
|
93301
|
+
return scope3;
|
|
92998
93302
|
}, {});
|
|
92999
93303
|
}
|
|
93000
93304
|
});
|
|
@@ -93011,9 +93315,9 @@ var Configuration = class {
|
|
|
93011
93315
|
}
|
|
93012
93316
|
collectClaims() {
|
|
93013
93317
|
const claims = /* @__PURE__ */ new Set();
|
|
93014
|
-
this.scopes.forEach((
|
|
93015
|
-
if (
|
|
93016
|
-
Object.keys(this.claims[
|
|
93318
|
+
this.scopes.forEach((scope3) => {
|
|
93319
|
+
if (scope3 in this.claims) {
|
|
93320
|
+
Object.keys(this.claims[scope3]).forEach(Set.prototype.add.bind(claims));
|
|
93017
93321
|
}
|
|
93018
93322
|
});
|
|
93019
93323
|
Object.entries(this.claims).forEach(([key, value]) => {
|
|
@@ -94232,9 +94536,9 @@ function interaction(it, options) {
|
|
|
94232
94536
|
missingOIDCScope2.delete("offline_access");
|
|
94233
94537
|
if (missingOIDCScope2.size) {
|
|
94234
94538
|
__eta.res += " <li>scopes:</li>\n <ul>\n ";
|
|
94235
|
-
missingOIDCScope2.forEach((
|
|
94539
|
+
missingOIDCScope2.forEach((scope3) => {
|
|
94236
94540
|
__eta.res += " <li>";
|
|
94237
|
-
__eta.res += __eta.e(
|
|
94541
|
+
__eta.res += __eta.e(scope3);
|
|
94238
94542
|
__eta.res += "</li>\n ";
|
|
94239
94543
|
});
|
|
94240
94544
|
__eta.res += " </ul>\n";
|
|
@@ -94259,9 +94563,9 @@ function interaction(it, options) {
|
|
|
94259
94563
|
__eta.res += " <li>";
|
|
94260
94564
|
__eta.res += __eta.e(indicator);
|
|
94261
94565
|
__eta.res += ":</li>\n <ul>\n ";
|
|
94262
|
-
scopes.forEach((
|
|
94566
|
+
scopes.forEach((scope3) => {
|
|
94263
94567
|
__eta.res += " <li>";
|
|
94264
|
-
__eta.res += __eta.e(
|
|
94568
|
+
__eta.res += __eta.e(scope3);
|
|
94265
94569
|
__eta.res += "</li>\n ";
|
|
94266
94570
|
});
|
|
94267
94571
|
__eta.res += " </ul>\n ";
|
|
@@ -94656,8 +94960,8 @@ function devInteractions(provider) {
|
|
|
94656
94960
|
grant.addOIDCClaims(details.missingOIDCClaims);
|
|
94657
94961
|
}
|
|
94658
94962
|
if (details.missingResourceScopes) {
|
|
94659
|
-
for (const [indicator,
|
|
94660
|
-
grant.addResourceScope(indicator,
|
|
94963
|
+
for (const [indicator, scope3] of Object.entries(details.missingResourceScopes)) {
|
|
94964
|
+
grant.addResourceScope(indicator, scope3.join(" "));
|
|
94661
94965
|
}
|
|
94662
94966
|
}
|
|
94663
94967
|
const result = { consent: { grantId: await grant.save() } };
|
|
@@ -97270,9 +97574,9 @@ var resolve_resource_default = async (ctx, model, config2, scopes = model.scopes
|
|
|
97270
97574
|
};
|
|
97271
97575
|
|
|
97272
97576
|
// ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/helpers/account_claims.js
|
|
97273
|
-
async function getCtxAccountClaims(ctx, use,
|
|
97577
|
+
async function getCtxAccountClaims(ctx, use, scope3, claims, rejected) {
|
|
97274
97578
|
return {
|
|
97275
|
-
...await ctx.oidc.account.claims(use,
|
|
97579
|
+
...await ctx.oidc.account.claims(use, scope3, claims, rejected),
|
|
97276
97580
|
sub: ctx.oidc.account.accountId
|
|
97277
97581
|
};
|
|
97278
97582
|
}
|
|
@@ -97422,15 +97726,15 @@ async function applyDpopBinding(ctx, dPoP, at) {
|
|
|
97422
97726
|
async function resolveAndApplyResource(ctx, source, at, grant, {
|
|
97423
97727
|
userinfo,
|
|
97424
97728
|
resourceIndicators
|
|
97425
|
-
},
|
|
97426
|
-
const resource = await resolve_resource_default(ctx, source, { userinfo, resourceIndicators },
|
|
97729
|
+
}, scope3) {
|
|
97730
|
+
const resource = await resolve_resource_default(ctx, source, { userinfo, resourceIndicators }, scope3);
|
|
97427
97731
|
if (resource) {
|
|
97428
97732
|
const resourceServerInfo = await resourceIndicators.getResourceServerInfo(ctx, resource, ctx.oidc.client);
|
|
97429
97733
|
at.resourceServer = new ctx.oidc.provider.ResourceServer(resource, resourceServerInfo);
|
|
97430
|
-
at.scope = grant.getResourceScopeFiltered(resource,
|
|
97734
|
+
at.scope = grant.getResourceScopeFiltered(resource, scope3 || source.scopes);
|
|
97431
97735
|
} else {
|
|
97432
97736
|
at.claims = source.claims;
|
|
97433
|
-
at.scope = grant.getOIDCScopeFiltered(
|
|
97737
|
+
at.scope = grant.getOIDCScopeFiltered(scope3 || source.scopes);
|
|
97434
97738
|
}
|
|
97435
97739
|
return resource;
|
|
97436
97740
|
}
|
|
@@ -97688,9 +97992,9 @@ var handler2 = async function clientCredentialsHandler(ctx) {
|
|
|
97688
97992
|
const scopes = [...new Set(ctx.oidc.params.scope?.split(" "))];
|
|
97689
97993
|
if (client.scope) {
|
|
97690
97994
|
const allowList = new Set(client.scope.split(" "));
|
|
97691
|
-
for (const
|
|
97692
|
-
if (!allowList.has(
|
|
97693
|
-
throw new InvalidScope("requested scope is not allowed",
|
|
97995
|
+
for (const scope3 of scopes.filter(Set.prototype.has.bind(statics))) {
|
|
97996
|
+
if (!allowList.has(scope3)) {
|
|
97997
|
+
throw new InvalidScope("requested scope is not allowed", scope3);
|
|
97694
97998
|
}
|
|
97695
97999
|
}
|
|
97696
98000
|
}
|
|
@@ -97950,25 +98254,25 @@ var handler4 = async function refreshTokenHandler(ctx) {
|
|
|
97950
98254
|
if (at.gty && !at.gty.endsWith(gty3)) {
|
|
97951
98255
|
at.gty = `${at.gty} ${gty3}`;
|
|
97952
98256
|
}
|
|
97953
|
-
const
|
|
98257
|
+
const scope3 = ctx.oidc.params.scope ? ctx.oidc.requestParamScopes : refreshToken.scopes;
|
|
97954
98258
|
await checkRar(ctx, () => {
|
|
97955
98259
|
});
|
|
97956
98260
|
const resource = await resolve_resource_default(
|
|
97957
98261
|
ctx,
|
|
97958
98262
|
refreshToken,
|
|
97959
98263
|
{ userinfo, resourceIndicators },
|
|
97960
|
-
|
|
98264
|
+
scope3
|
|
97961
98265
|
);
|
|
97962
98266
|
if (resource) {
|
|
97963
98267
|
const resourceServerInfo = await resourceIndicators.getResourceServerInfo(ctx, resource, ctx.oidc.client);
|
|
97964
98268
|
at.resourceServer = new ctx.oidc.provider.ResourceServer(resource, resourceServerInfo);
|
|
97965
98269
|
at.scope = grant.getResourceScopeFiltered(
|
|
97966
98270
|
resource,
|
|
97967
|
-
[...
|
|
98271
|
+
[...scope3].filter(Set.prototype.has.bind(at.resourceServer.scopes))
|
|
97968
98272
|
);
|
|
97969
98273
|
} else {
|
|
97970
98274
|
at.claims = refreshToken.claims;
|
|
97971
|
-
at.scope = grant.getOIDCScopeFiltered(
|
|
98275
|
+
at.scope = grant.getOIDCScopeFiltered(scope3);
|
|
97972
98276
|
}
|
|
97973
98277
|
if (richAuthorizationRequests.enabled && at.resourceServer) {
|
|
97974
98278
|
at.rar = await richAuthorizationRequests.rarForRefreshTokenResponse(ctx, at.resourceServer);
|
|
@@ -97978,7 +98282,7 @@ var handler4 = async function refreshTokenHandler(ctx) {
|
|
|
97978
98282
|
const idToken = await issueIdToken(ctx, refreshToken, at, grant, {
|
|
97979
98283
|
conformIdTokenClaims,
|
|
97980
98284
|
userinfo
|
|
97981
|
-
},
|
|
98285
|
+
}, scope3);
|
|
97982
98286
|
ctx.body = buildTokenResponse(at, accessToken, {
|
|
97983
98287
|
idToken,
|
|
97984
98288
|
refreshToken: refreshTokenValue,
|
|
@@ -98372,20 +98676,20 @@ var err_out_default = ({
|
|
|
98372
98676
|
expose,
|
|
98373
98677
|
message: message3,
|
|
98374
98678
|
error_description: description,
|
|
98375
|
-
scope:
|
|
98376
|
-
},
|
|
98679
|
+
scope: scope3
|
|
98680
|
+
}, state2) => {
|
|
98377
98681
|
if (expose) {
|
|
98378
98682
|
return {
|
|
98379
98683
|
error: message3,
|
|
98380
98684
|
...description !== void 0 ? { error_description: description } : void 0,
|
|
98381
|
-
...
|
|
98382
|
-
...
|
|
98685
|
+
...scope3 !== void 0 ? { scope: scope3 } : void 0,
|
|
98686
|
+
...state2 !== void 0 ? { state: state2 } : void 0
|
|
98383
98687
|
};
|
|
98384
98688
|
}
|
|
98385
98689
|
return {
|
|
98386
98690
|
error: "server_error",
|
|
98387
98691
|
error_description: "oops! something went wrong",
|
|
98388
|
-
...
|
|
98692
|
+
...state2 ? { state: state2 } : void 0
|
|
98389
98693
|
};
|
|
98390
98694
|
};
|
|
98391
98695
|
|
|
@@ -98499,8 +98803,8 @@ var authorization_error_handler_default = (provider) => {
|
|
|
98499
98803
|
recovery: oneRedirectUriClients
|
|
98500
98804
|
}
|
|
98501
98805
|
});
|
|
98502
|
-
function getOutAndEmit(ctx, err,
|
|
98503
|
-
const out = { ...err_out_default(err,
|
|
98806
|
+
function getOutAndEmit(ctx, err, state2) {
|
|
98807
|
+
const out = { ...err_out_default(err, state2), iss: ctx.oidc.provider.issuer };
|
|
98504
98808
|
if (err.expose) {
|
|
98505
98809
|
provider.emit("authorization.error", ctx, err);
|
|
98506
98810
|
debugError2("%o", out);
|
|
@@ -99656,8 +99960,8 @@ async function checkIdTokenHint(ctx, next) {
|
|
|
99656
99960
|
|
|
99657
99961
|
// ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/helpers/is_valid_scope.js
|
|
99658
99962
|
var SCOPE_SYNTAX = /^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$/u;
|
|
99659
|
-
function isValidScope(
|
|
99660
|
-
return
|
|
99963
|
+
function isValidScope(scope3) {
|
|
99964
|
+
return scope3 === void 0 || typeof scope3 === "string" && SCOPE_SYNTAX.test(scope3);
|
|
99661
99965
|
}
|
|
99662
99966
|
|
|
99663
99967
|
// ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/actions/authorization/check_scope.js
|
|
@@ -99681,9 +99985,9 @@ async function checkScope(PARAM_LIST3, ctx, next) {
|
|
|
99681
99985
|
}
|
|
99682
99986
|
if (client.scope) {
|
|
99683
99987
|
const allowList = new Set(client.scope.split(" "));
|
|
99684
|
-
for (const
|
|
99685
|
-
if (!allowList.has(
|
|
99686
|
-
throw new InvalidScope("requested scope is not allowed",
|
|
99988
|
+
for (const scope3 of scopes.filter(Set.prototype.has.bind(statics))) {
|
|
99989
|
+
if (!allowList.has(scope3)) {
|
|
99990
|
+
throw new InvalidScope("requested scope is not allowed", scope3);
|
|
99687
99991
|
}
|
|
99688
99992
|
}
|
|
99689
99993
|
}
|
|
@@ -100084,9 +100388,9 @@ async function codeHandler(ctx) {
|
|
|
100084
100388
|
async function idTokenHandler(ctx) {
|
|
100085
100389
|
const claims = filter_claims_default(ctx.oidc.claims, "id_token", ctx.oidc.grant);
|
|
100086
100390
|
const rejected = ctx.oidc.grant.getRejectedOIDCClaims();
|
|
100087
|
-
const
|
|
100391
|
+
const scope3 = ctx.oidc.grant.getOIDCScopeFiltered(ctx.oidc.requestParamScopes);
|
|
100088
100392
|
const idToken = new ctx.oidc.provider.IdToken({
|
|
100089
|
-
...await getCtxAccountClaims(ctx, "id_token",
|
|
100393
|
+
...await getCtxAccountClaims(ctx, "id_token", scope3, claims, rejected),
|
|
100090
100394
|
acr: ctx.oidc.acr,
|
|
100091
100395
|
amr: ctx.oidc.amr,
|
|
100092
100396
|
auth_time: ctx.oidc.session.authTime()
|
|
@@ -100098,7 +100402,7 @@ async function idTokenHandler(ctx) {
|
|
|
100098
100402
|
if (conformIdTokenClaims && userinfo.enabled && ctx.oidc.params.response_type !== "id_token" && !ctx.oidc.params.resource) {
|
|
100099
100403
|
idToken.scope = "openid";
|
|
100100
100404
|
} else {
|
|
100101
|
-
idToken.scope =
|
|
100405
|
+
idToken.scope = scope3;
|
|
100102
100406
|
}
|
|
100103
100407
|
idToken.mask = claims;
|
|
100104
100408
|
idToken.rejected = rejected;
|
|
@@ -101074,12 +101378,12 @@ function getSetWWWAuthenticateHeader({ tokenProperty = "accessToken", includeSco
|
|
|
101074
101378
|
if (!err.expose || dpop === false && err.statusCode !== 401) throw err;
|
|
101075
101379
|
const conf = weak_cache_default(ctx.oidc.provider);
|
|
101076
101380
|
const dpopEnabled = dpop !== false && conf.features.dPoP.enabled;
|
|
101077
|
-
const
|
|
101381
|
+
const scope3 = includeScope ? err.scope : void 0;
|
|
101078
101382
|
const algs = dpopEnabled ? conf.configuration.dPoPSigningAlgValues.join(" ") : void 0;
|
|
101079
101383
|
if (err instanceof NoAccessTokenProvided) {
|
|
101080
|
-
appendWWWAuthenticate(ctx, "Bearer", { realm: ctx.oidc.issuer, scope:
|
|
101384
|
+
appendWWWAuthenticate(ctx, "Bearer", { realm: ctx.oidc.issuer, scope: scope3 });
|
|
101081
101385
|
if (dpopEnabled) {
|
|
101082
|
-
appendWWWAuthenticate(ctx, "DPoP", { realm: ctx.oidc.issuer, scope:
|
|
101386
|
+
appendWWWAuthenticate(ctx, "DPoP", { realm: ctx.oidc.issuer, scope: scope3, algs });
|
|
101083
101387
|
}
|
|
101084
101388
|
throw err;
|
|
101085
101389
|
}
|
|
@@ -101096,7 +101400,7 @@ function getSetWWWAuthenticateHeader({ tokenProperty = "accessToken", includeSco
|
|
|
101096
101400
|
realm: ctx.oidc.issuer,
|
|
101097
101401
|
error: err.error ?? err.message,
|
|
101098
101402
|
error_description: err.error_description,
|
|
101099
|
-
scope:
|
|
101403
|
+
scope: scope3,
|
|
101100
101404
|
...scheme === "DPoP" ? { algs } : void 0
|
|
101101
101405
|
});
|
|
101102
101406
|
throw err;
|
|
@@ -101213,14 +101517,14 @@ var userinfo_default = [
|
|
|
101213
101517
|
async function respond2(ctx) {
|
|
101214
101518
|
const claims = filter_claims_default(ctx.oidc.accessToken.claims, "userinfo", ctx.oidc.grant);
|
|
101215
101519
|
const rejected = ctx.oidc.grant.getRejectedOIDCClaims();
|
|
101216
|
-
const
|
|
101520
|
+
const scope3 = ctx.oidc.grant.getOIDCScopeFiltered(new Set((ctx.oidc.params.scope || ctx.oidc.accessToken.scope).split(" ")));
|
|
101217
101521
|
const { client } = ctx.oidc;
|
|
101218
101522
|
if (client.userinfoSignedResponseAlg || client.userinfoEncryptedResponseAlg) {
|
|
101219
101523
|
const token = new ctx.oidc.provider.IdToken(
|
|
101220
|
-
await getCtxAccountClaims(ctx, "userinfo",
|
|
101524
|
+
await getCtxAccountClaims(ctx, "userinfo", scope3, claims, rejected),
|
|
101221
101525
|
{ ctx }
|
|
101222
101526
|
);
|
|
101223
|
-
token.scope =
|
|
101527
|
+
token.scope = scope3;
|
|
101224
101528
|
token.mask = claims;
|
|
101225
101529
|
token.rejected = rejected;
|
|
101226
101530
|
ctx.body = await token.issue({
|
|
@@ -101230,10 +101534,10 @@ var userinfo_default = [
|
|
|
101230
101534
|
ctx.type = "application/jwt; charset=utf-8";
|
|
101231
101535
|
} else {
|
|
101232
101536
|
const mask2 = new ctx.oidc.provider.Claims(
|
|
101233
|
-
await getCtxAccountClaims(ctx, "userinfo",
|
|
101537
|
+
await getCtxAccountClaims(ctx, "userinfo", scope3, claims, rejected),
|
|
101234
101538
|
{ ctx }
|
|
101235
101539
|
);
|
|
101236
|
-
mask2.scope(
|
|
101540
|
+
mask2.scope(scope3);
|
|
101237
101541
|
mask2.mask(claims);
|
|
101238
101542
|
mask2.rejected(rejected);
|
|
101239
101543
|
ctx.body = await mask2.result();
|
|
@@ -102311,7 +102615,7 @@ var confirm2 = [
|
|
|
102311
102615
|
checkXsrf("could not find logout details"),
|
|
102312
102616
|
async function endSession(ctx) {
|
|
102313
102617
|
const { oidc: { session, params } } = ctx;
|
|
102314
|
-
const { state } = session;
|
|
102618
|
+
const { state: state2 } = session;
|
|
102315
102619
|
const {
|
|
102316
102620
|
features: { backchannelLogout },
|
|
102317
102621
|
cookies: { long: opts }
|
|
@@ -102320,7 +102624,7 @@ var confirm2 = [
|
|
|
102320
102624
|
const clientIds = Object.keys(session.authorizations || {});
|
|
102321
102625
|
const back = [];
|
|
102322
102626
|
for (const clientId of clientIds) {
|
|
102323
|
-
if (params.logout || clientId ===
|
|
102627
|
+
if (params.logout || clientId === state2.clientId) {
|
|
102324
102628
|
const client = await clientForLogout(ctx, clientId);
|
|
102325
102629
|
if (client) {
|
|
102326
102630
|
const sid = session.sidFor(client.clientId);
|
|
@@ -102337,8 +102641,8 @@ var confirm2 = [
|
|
|
102337
102641
|
}
|
|
102338
102642
|
await Promise.all(back);
|
|
102339
102643
|
}
|
|
102340
|
-
if (
|
|
102341
|
-
ctx.oidc.entity("Client", await clientForLogout(ctx,
|
|
102644
|
+
if (state2.clientId) {
|
|
102645
|
+
ctx.oidc.entity("Client", await clientForLogout(ctx, state2.clientId));
|
|
102342
102646
|
}
|
|
102343
102647
|
if (params.logout) {
|
|
102344
102648
|
if (session.authorizations) {
|
|
@@ -102356,24 +102660,24 @@ var confirm2 = [
|
|
|
102356
102660
|
null,
|
|
102357
102661
|
opts
|
|
102358
102662
|
);
|
|
102359
|
-
} else if (
|
|
102360
|
-
const grantId = session.grantIdFor(
|
|
102361
|
-
if (grantId && !session.authorizationFor(
|
|
102663
|
+
} else if (state2.clientId) {
|
|
102664
|
+
const grantId = session.grantIdFor(state2.clientId);
|
|
102665
|
+
if (grantId && !session.authorizationFor(state2.clientId).persistsLogout) {
|
|
102362
102666
|
await revoke(ctx, grantId);
|
|
102363
102667
|
}
|
|
102364
102668
|
session.state = void 0;
|
|
102365
102669
|
if (session.authorizations) {
|
|
102366
|
-
delete session.authorizations[
|
|
102670
|
+
delete session.authorizations[state2.clientId];
|
|
102367
102671
|
}
|
|
102368
102672
|
session.resetIdentifier();
|
|
102369
102673
|
}
|
|
102370
|
-
const usePostLogoutUri =
|
|
102371
|
-
const forwardClientId = !usePostLogoutUri && !params.logout &&
|
|
102674
|
+
const usePostLogoutUri = state2.postLogoutRedirectUri;
|
|
102675
|
+
const forwardClientId = !usePostLogoutUri && !params.logout && state2.clientId;
|
|
102372
102676
|
const uri = redirectUri(
|
|
102373
|
-
usePostLogoutUri ?
|
|
102677
|
+
usePostLogoutUri ? state2.postLogoutRedirectUri : ctx.oidc.urlFor("end_session_success"),
|
|
102374
102678
|
{
|
|
102375
|
-
...usePostLogoutUri &&
|
|
102376
|
-
...forwardClientId ? { client_id:
|
|
102679
|
+
...usePostLogoutUri && state2.state != null ? { state: state2.state } : void 0,
|
|
102680
|
+
...forwardClientId ? { client_id: state2.clientId } : void 0
|
|
102377
102681
|
}
|
|
102378
102682
|
);
|
|
102379
102683
|
ctx.oidc.provider.emit("end_session.success", ctx);
|
|
@@ -103302,8 +103606,8 @@ function getClaims(provider) {
|
|
|
103302
103606
|
if (Object.keys(this.filter).length) {
|
|
103303
103607
|
throw new Error("scope cannot be assigned after mask has been set");
|
|
103304
103608
|
}
|
|
103305
|
-
value.split(" ").forEach((
|
|
103306
|
-
this.mask(claimConfig[
|
|
103609
|
+
value.split(" ").forEach((scope3) => {
|
|
103610
|
+
this.mask(claimConfig[scope3]);
|
|
103307
103611
|
});
|
|
103308
103612
|
return this;
|
|
103309
103613
|
}
|
|
@@ -103518,7 +103822,7 @@ var jwt_default = (provider, { opaque }) => {
|
|
|
103518
103822
|
jti,
|
|
103519
103823
|
iat,
|
|
103520
103824
|
exp,
|
|
103521
|
-
scope:
|
|
103825
|
+
scope: scope3,
|
|
103522
103826
|
clientId,
|
|
103523
103827
|
"x5t#S256": x5t2,
|
|
103524
103828
|
jkt: jkt2,
|
|
@@ -103543,7 +103847,7 @@ var jwt_default = (provider, { opaque }) => {
|
|
|
103543
103847
|
iat,
|
|
103544
103848
|
exp,
|
|
103545
103849
|
authorization_details: rar,
|
|
103546
|
-
scope:
|
|
103850
|
+
scope: scope3 || void 0,
|
|
103547
103851
|
client_id: clientId,
|
|
103548
103852
|
iss: provider.issuer,
|
|
103549
103853
|
aud,
|
|
@@ -103993,8 +104297,8 @@ function getBaseModel(provider) {
|
|
|
103993
104297
|
}
|
|
103994
104298
|
ttlPercentagePassed() {
|
|
103995
104299
|
const now = epoch_time_default();
|
|
103996
|
-
const
|
|
103997
|
-
return Math.max(Math.min(100,
|
|
104300
|
+
const percentage2 = Math.floor(100 * ((now - this.iat) / (this.exp - this.iat)));
|
|
104301
|
+
return Math.max(Math.min(100, percentage2), 0);
|
|
103998
104302
|
}
|
|
103999
104303
|
get isValid() {
|
|
104000
104304
|
return !this.isExpired;
|
|
@@ -104692,8 +104996,8 @@ function getSchema(provider) {
|
|
|
104692
104996
|
scopes() {
|
|
104693
104997
|
if (this.scope) {
|
|
104694
104998
|
const parsed = new Set(this.scope.split(" "));
|
|
104695
|
-
parsed.forEach((
|
|
104696
|
-
if (!scopes.has(
|
|
104999
|
+
parsed.forEach((scope3) => {
|
|
105000
|
+
if (!scopes.has(scope3)) {
|
|
104697
105001
|
this.invalidate("scope must only contain Authorization Server supported scope values");
|
|
104698
105002
|
}
|
|
104699
105003
|
});
|
|
@@ -106097,9 +106401,9 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106097
106401
|
if (this.rejected) {
|
|
106098
106402
|
const rejected = this.getOIDCScope.call(this.rejected).split(" ");
|
|
106099
106403
|
const granted = new Set(this.openid.scope.split(" "));
|
|
106100
|
-
for (const
|
|
106101
|
-
if (
|
|
106102
|
-
granted.delete(
|
|
106404
|
+
for (const scope3 of rejected) {
|
|
106405
|
+
if (scope3 !== "openid") {
|
|
106406
|
+
granted.delete(scope3);
|
|
106103
106407
|
}
|
|
106104
106408
|
}
|
|
106105
106409
|
return [...granted].join(" ");
|
|
@@ -106121,19 +106425,19 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106121
106425
|
const granted = this.getOIDCScope().split(" ");
|
|
106122
106426
|
return granted.filter(Set.prototype.has.bind(filter2)).join(" ");
|
|
106123
106427
|
}
|
|
106124
|
-
addOIDCScope(
|
|
106125
|
-
if (
|
|
106126
|
-
|
|
106127
|
-
} else if (Array.isArray(
|
|
106128
|
-
|
|
106129
|
-
} else if (typeof
|
|
106428
|
+
addOIDCScope(scope3) {
|
|
106429
|
+
if (scope3 instanceof Set) {
|
|
106430
|
+
scope3 = [...scope3].join(" ");
|
|
106431
|
+
} else if (Array.isArray(scope3)) {
|
|
106432
|
+
scope3 = scope3.join(" ");
|
|
106433
|
+
} else if (typeof scope3 !== "string") {
|
|
106130
106434
|
throw new TypeError('"scope" must be a string');
|
|
106131
106435
|
}
|
|
106132
106436
|
this.openid ||= {};
|
|
106133
106437
|
if (this.openid.scope) {
|
|
106134
|
-
this.openid.scope = [.../* @__PURE__ */ new Set([...this.openid.scope.split(" "), ...
|
|
106438
|
+
this.openid.scope = [.../* @__PURE__ */ new Set([...this.openid.scope.split(" "), ...scope3.split(" ")])].join(" ");
|
|
106135
106439
|
} else {
|
|
106136
|
-
this.openid.scope =
|
|
106440
|
+
this.openid.scope = scope3;
|
|
106137
106441
|
}
|
|
106138
106442
|
}
|
|
106139
106443
|
rejectOIDCScope(...args2) {
|
|
@@ -106153,8 +106457,8 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106153
106457
|
if (this.rejected) {
|
|
106154
106458
|
const rejected = this.getResourceScope.call(this.rejected, resource).split(" ");
|
|
106155
106459
|
const granted = new Set(this.resources[resource].split(" "));
|
|
106156
|
-
for (const
|
|
106157
|
-
granted.delete(
|
|
106460
|
+
for (const scope3 of rejected) {
|
|
106461
|
+
granted.delete(scope3);
|
|
106158
106462
|
}
|
|
106159
106463
|
return [...granted].join(" ");
|
|
106160
106464
|
}
|
|
@@ -106178,22 +106482,22 @@ var grant_default = (provider) => class Grant extends apply([
|
|
|
106178
106482
|
const granted = this.getResourceScope(resource).split(" ");
|
|
106179
106483
|
return granted.filter(Set.prototype.has.bind(filter2)).join(" ");
|
|
106180
106484
|
}
|
|
106181
|
-
addResourceScope(resource,
|
|
106485
|
+
addResourceScope(resource, scope3) {
|
|
106182
106486
|
if (typeof resource !== "string") {
|
|
106183
106487
|
throw new TypeError('"resource" must be a string');
|
|
106184
106488
|
}
|
|
106185
|
-
if (
|
|
106186
|
-
|
|
106187
|
-
} else if (Array.isArray(
|
|
106188
|
-
|
|
106189
|
-
} else if (typeof
|
|
106489
|
+
if (scope3 instanceof Set) {
|
|
106490
|
+
scope3 = [...scope3].join(" ");
|
|
106491
|
+
} else if (Array.isArray(scope3)) {
|
|
106492
|
+
scope3 = scope3.join(" ");
|
|
106493
|
+
} else if (typeof scope3 !== "string") {
|
|
106190
106494
|
throw new TypeError('"scope" must be a string');
|
|
106191
106495
|
}
|
|
106192
106496
|
this.resources ||= {};
|
|
106193
106497
|
if (this.resources[resource]) {
|
|
106194
|
-
this.resources[resource] = [.../* @__PURE__ */ new Set([...this.resources[resource].split(" "), ...
|
|
106498
|
+
this.resources[resource] = [.../* @__PURE__ */ new Set([...this.resources[resource].split(" "), ...scope3.split(" ")])].join(" ");
|
|
106195
106499
|
} else {
|
|
106196
|
-
this.resources[resource] =
|
|
106500
|
+
this.resources[resource] = scope3;
|
|
106197
106501
|
}
|
|
106198
106502
|
}
|
|
106199
106503
|
rejectResourceScope(...args2) {
|
|
@@ -107061,9 +107365,10 @@ function buildEligibilityCtes(organizationPredicate) {
|
|
|
107061
107365
|
)
|
|
107062
107366
|
`;
|
|
107063
107367
|
}
|
|
107064
|
-
|
|
107368
|
+
function buildAvailabilityChecksListQuery(organizationPredicate, checkPredicate, limitSql = "$3", cursorSql = "$4") {
|
|
107369
|
+
return `
|
|
107065
107370
|
WITH
|
|
107066
|
-
${buildEligibilityCtes(
|
|
107371
|
+
${buildEligibilityCtes(`AND ${organizationPredicate}`)},
|
|
107067
107372
|
ranked AS (
|
|
107068
107373
|
SELECT
|
|
107069
107374
|
c.id::text AS check_id,
|
|
@@ -107110,8 +107415,8 @@ var LIST_AVAILABILITY_CHECKS_QUERY = `
|
|
|
107110
107415
|
LEFT JOIN monitored_project_ranks monitored_ranks
|
|
107111
107416
|
ON monitored_ranks.organization_id = p.organization_id
|
|
107112
107417
|
AND monitored_ranks.project_id = c.project_id
|
|
107113
|
-
WHERE
|
|
107114
|
-
AND
|
|
107418
|
+
WHERE ${checkPredicate}
|
|
107419
|
+
AND ${organizationPredicate}
|
|
107115
107420
|
AND c.deleted_at IS NULL
|
|
107116
107421
|
)
|
|
107117
107422
|
SELECT
|
|
@@ -107122,10 +107427,15 @@ var LIST_AVAILABILITY_CHECKS_QUERY = `
|
|
|
107122
107427
|
NOT ranked.enabled OR ranked.organization_check_rank <= ranked.plan_organization_check_limit
|
|
107123
107428
|
AS within_organization_active_limit
|
|
107124
107429
|
FROM ranked
|
|
107125
|
-
WHERE ($
|
|
107430
|
+
WHERE (${cursorSql}::text IS NULL OR ranked.check_id = ${cursorSql})
|
|
107126
107431
|
ORDER BY ranked.created_at DESC
|
|
107127
|
-
LIMIT $
|
|
107432
|
+
LIMIT ${limitSql}
|
|
107128
107433
|
`;
|
|
107434
|
+
}
|
|
107435
|
+
var LIST_AVAILABILITY_CHECKS_QUERY = buildAvailabilityChecksListQuery(
|
|
107436
|
+
"p.organization_id = $2::uuid",
|
|
107437
|
+
"c.project_id = $1::uuid"
|
|
107438
|
+
);
|
|
107129
107439
|
var CLAIM_DUE_AVAILABILITY_CHECKS_QUERY = `
|
|
107130
107440
|
WITH due_organizations AS (
|
|
107131
107441
|
SELECT DISTINCT p.organization_id
|
|
@@ -108434,8 +108744,41 @@ function defineStorageSchemaMigration(input2) {
|
|
|
108434
108744
|
};
|
|
108435
108745
|
}
|
|
108436
108746
|
|
|
108437
|
-
// ../../packages/storage/src/
|
|
108747
|
+
// ../../packages/storage/src/public-status-schema.ts
|
|
108438
108748
|
var statements = [
|
|
108749
|
+
`CREATE TABLE IF NOT EXISTS public_status_pages (
|
|
108750
|
+
id uuid PRIMARY KEY, anchor_project_id uuid NOT NULL UNIQUE REFERENCES projects(id) ON DELETE CASCADE,
|
|
108751
|
+
owner_user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
108752
|
+
organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
|
108753
|
+
public_id text NOT NULL UNIQUE CHECK (public_id ~ '^[a-f0-9]{24}$'),
|
|
108754
|
+
title text NOT NULL CHECK (length(title) BETWEEN 1 AND 120), enabled boolean NOT NULL DEFAULT false,
|
|
108755
|
+
created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now()
|
|
108756
|
+
)`,
|
|
108757
|
+
`CREATE TABLE IF NOT EXISTS public_status_page_projects (
|
|
108758
|
+
page_id uuid NOT NULL REFERENCES public_status_pages(id) ON DELETE CASCADE,
|
|
108759
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
108760
|
+
position integer NOT NULL CHECK (position BETWEEN 0 AND 49), PRIMARY KEY(page_id, project_id)
|
|
108761
|
+
)`,
|
|
108762
|
+
`CREATE TABLE IF NOT EXISTS public_status_page_checks (
|
|
108763
|
+
page_id uuid NOT NULL, project_id uuid NOT NULL, check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
|
|
108764
|
+
PRIMARY KEY(page_id, check_id), FOREIGN KEY(page_id, project_id) REFERENCES public_status_page_projects(page_id, project_id) ON DELETE CASCADE
|
|
108765
|
+
)`,
|
|
108766
|
+
"CREATE INDEX IF NOT EXISTS public_status_page_projects_project_idx ON public_status_page_projects(project_id)",
|
|
108767
|
+
"CREATE INDEX IF NOT EXISTS public_status_page_checks_check_idx ON public_status_page_checks(check_id)"
|
|
108768
|
+
];
|
|
108769
|
+
var PUBLIC_STATUS_BOOTSTRAP_STATEMENTS = statements.map(
|
|
108770
|
+
(s) => s.replaceAll(" IF NOT EXISTS", "")
|
|
108771
|
+
);
|
|
108772
|
+
var PUBLIC_STATUS_SCHEMA_MIGRATIONS = [
|
|
108773
|
+
defineStorageSchemaMigration({
|
|
108774
|
+
id: "202610080001_add_public_status_pages",
|
|
108775
|
+
description: "Add opt-in, explicitly selected public availability pages.",
|
|
108776
|
+
statements
|
|
108777
|
+
})
|
|
108778
|
+
];
|
|
108779
|
+
|
|
108780
|
+
// ../../packages/storage/src/analytics-flow-schema.ts
|
|
108781
|
+
var statements2 = [
|
|
108439
108782
|
`CREATE TABLE IF NOT EXISTS analytics_flow_definitions (
|
|
108440
108783
|
id uuid PRIMARY KEY, project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
108441
108784
|
flow_key text NOT NULL, version integer NOT NULL DEFAULT 1, definition jsonb NOT NULL,
|
|
@@ -108468,18 +108811,18 @@ var statements = [
|
|
|
108468
108811
|
)`,
|
|
108469
108812
|
`CREATE INDEX IF NOT EXISTS analytics_flow_rollups_expiry_idx ON analytics_flow_rollups(cohort_date, flow_id)`
|
|
108470
108813
|
];
|
|
108471
|
-
var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS =
|
|
108814
|
+
var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS = statements2.map(
|
|
108472
108815
|
(statement) => statement.replaceAll(" IF NOT EXISTS", "")
|
|
108473
108816
|
);
|
|
108474
108817
|
var migration = {
|
|
108475
108818
|
id: "202610030001_add_public_analytics_flows",
|
|
108476
108819
|
description: "Add customer project flow definitions, bounded continuity and aggregate reports.",
|
|
108477
|
-
statements
|
|
108820
|
+
statements: statements2
|
|
108478
108821
|
};
|
|
108479
108822
|
var ANALYTICS_FLOW_SCHEMA_MIGRATIONS = [defineStorageSchemaMigration(migration)];
|
|
108480
108823
|
|
|
108481
108824
|
// ../../packages/storage/src/browser-recovery-schema.ts
|
|
108482
|
-
var
|
|
108825
|
+
var statements3 = [
|
|
108483
108826
|
`ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS coalescing_key text`,
|
|
108484
108827
|
`CREATE INDEX IF NOT EXISTS alert_deliveries_coalescing_idx ON alert_deliveries (alert_id, coalescing_key, created_at) WHERE coalescing_key IS NOT NULL`,
|
|
108485
108828
|
`CREATE TABLE IF NOT EXISTS browser_recovery_events (
|
|
@@ -108501,10 +108844,10 @@ var BROWSER_RECOVERY_MIGRATIONS = [
|
|
|
108501
108844
|
defineStorageSchemaMigration({
|
|
108502
108845
|
id: "202609220001_add_browser_recovery_context",
|
|
108503
108846
|
description: "Index browser recovery context and separate burst suppression from alert cooldown identity",
|
|
108504
|
-
statements:
|
|
108847
|
+
statements: statements3
|
|
108505
108848
|
})
|
|
108506
108849
|
];
|
|
108507
|
-
var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS =
|
|
108850
|
+
var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS = statements3.filter((statement) => !statement.startsWith("ALTER TABLE")).map((statement) => statement.replaceAll(" IF NOT EXISTS", ""));
|
|
108508
108851
|
|
|
108509
108852
|
// ../../packages/storage/src/availability-check-bootstrap-statements.ts
|
|
108510
108853
|
var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
|
|
@@ -110480,7 +110823,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS2 = [
|
|
|
110480
110823
|
...AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS,
|
|
110481
110824
|
...ANALYTICS_BOOTSTRAP_STATEMENTS,
|
|
110482
110825
|
...WORKER_JOB_BOOTSTRAP_STATEMENTS,
|
|
110483
|
-
...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS
|
|
110826
|
+
...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS,
|
|
110827
|
+
...PUBLIC_STATUS_BOOTSTRAP_STATEMENTS
|
|
110484
110828
|
];
|
|
110485
110829
|
|
|
110486
110830
|
// ../../packages/storage/src/migrations.ts
|
|
@@ -112695,9 +113039,18 @@ var STORAGE_SCHEMA_MIGRATIONS2 = [
|
|
|
112695
113039
|
...ANALYTICS_STORAGE_SCHEMA_MIGRATIONS,
|
|
112696
113040
|
...OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS,
|
|
112697
113041
|
...WORKER_JOB_SCHEMA_MIGRATIONS,
|
|
112698
|
-
...ANALYTICS_FLOW_SCHEMA_MIGRATIONS
|
|
113042
|
+
...ANALYTICS_FLOW_SCHEMA_MIGRATIONS,
|
|
113043
|
+
...PUBLIC_STATUS_SCHEMA_MIGRATIONS
|
|
112699
113044
|
].sort((left, right) => left.id.localeCompare(right.id));
|
|
112700
113045
|
|
|
113046
|
+
// ../../packages/storage/src/public-status-store.ts
|
|
113047
|
+
var eligibleQuery = buildAvailabilityChecksListQuery(
|
|
113048
|
+
"p.organization_id IN (SELECT organization_id FROM page)",
|
|
113049
|
+
"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))",
|
|
113050
|
+
"500",
|
|
113051
|
+
"NULL"
|
|
113052
|
+
);
|
|
113053
|
+
|
|
112701
113054
|
// ../cli/src/cloud-artifact-cache.ts
|
|
112702
113055
|
var import_promises6 = require("node:fs/promises");
|
|
112703
113056
|
var import_node_path6 = require("node:path");
|
|
@@ -113131,15 +113484,15 @@ async function readLocalState(dependencies) {
|
|
|
113131
113484
|
throw error2;
|
|
113132
113485
|
}
|
|
113133
113486
|
}
|
|
113134
|
-
async function writeLocalState(
|
|
113487
|
+
async function writeLocalState(state2, dependencies) {
|
|
113135
113488
|
const rootDirectory = getWorkspaceRoot2(dependencies);
|
|
113136
113489
|
const writeFile = dependencies?.writeFile ?? import_promises7.writeFile;
|
|
113137
|
-
await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(
|
|
113490
|
+
await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(state2, null, 2)}
|
|
113138
113491
|
`, "utf8");
|
|
113139
113492
|
}
|
|
113140
113493
|
async function updateLocalIncidentStatus(input2, dependencies) {
|
|
113141
|
-
const
|
|
113142
|
-
const incident =
|
|
113494
|
+
const state2 = await readLocalState(dependencies);
|
|
113495
|
+
const incident = state2.incidents[input2.incidentId];
|
|
113143
113496
|
if (incident === void 0) {
|
|
113144
113497
|
throw createReadError(404, "incident_not_found");
|
|
113145
113498
|
}
|
|
@@ -113148,8 +113501,8 @@ async function updateLocalIncidentStatus(input2, dependencies) {
|
|
|
113148
113501
|
status: input2.status,
|
|
113149
113502
|
...input2.status === "resolved" ? { resolved_at: (/* @__PURE__ */ new Date()).toISOString() } : { resolved_at: null }
|
|
113150
113503
|
};
|
|
113151
|
-
|
|
113152
|
-
await writeLocalState(
|
|
113504
|
+
state2.incidents[input2.incidentId] = nextIncident;
|
|
113505
|
+
await writeLocalState(state2, dependencies);
|
|
113153
113506
|
return projectLocalEvidence(nextIncident);
|
|
113154
113507
|
}
|
|
113155
113508
|
async function listLocalIncidents(input2, dependencies) {
|
|
@@ -117192,13 +117545,13 @@ function sortIncidentRecord(incident) {
|
|
|
117192
117545
|
source_events: [...incident.source_events].sort(compareEventEnvelopes)
|
|
117193
117546
|
};
|
|
117194
117547
|
}
|
|
117195
|
-
function serializeState(
|
|
117548
|
+
function serializeState(state2) {
|
|
117196
117549
|
const incidents = Object.fromEntries(
|
|
117197
|
-
Object.entries(
|
|
117550
|
+
Object.entries(state2.incidents).sort(([left], [right]) => left.localeCompare(right)).map(([incidentId2, incident]) => [incidentId2, sortIncidentRecord(incident)])
|
|
117198
117551
|
);
|
|
117199
117552
|
return `${JSON.stringify({
|
|
117200
117553
|
version: 1,
|
|
117201
|
-
last_processed_event_file:
|
|
117554
|
+
last_processed_event_file: state2.last_processed_event_file,
|
|
117202
117555
|
incidents
|
|
117203
117556
|
}, null, 2)}
|
|
117204
117557
|
`;
|
|
@@ -118460,7 +118813,7 @@ async function runValidateCommand(input2, dependencies = {}) {
|
|
|
118460
118813
|
}
|
|
118461
118814
|
}
|
|
118462
118815
|
checks.push(...agentChecks(report).filter((check5) => check5.name !== "canonical-skill"));
|
|
118463
|
-
autoFixAvailable ||= report.agents.some((agent) => [agent.instruction, agent.discovery].some((
|
|
118816
|
+
autoFixAvailable ||= report.agents.some((agent) => [agent.instruction, agent.discovery].some((state2) => state2 === "missing" || state2 === "stale"));
|
|
118464
118817
|
const ignore = await ensureGitignore(rootDirectory, buildManagedGitignoreSection(), input2.fix === true);
|
|
118465
118818
|
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` };
|
|
118466
118819
|
if (gitignoreCheck.status === "missing") {
|
|
@@ -119789,6 +120142,7 @@ var MCP_TOOL_CATALOG_OPERATIONS = [
|
|
|
119789
120142
|
|
|
119790
120143
|
// src/tool-catalog.ts
|
|
119791
120144
|
var MCP_TOOL_CATALOG = [
|
|
120145
|
+
...PUBLIC_STATUS_MCP_TOOL_CATALOG,
|
|
119792
120146
|
...ANALYTICS_FLOW_MCP_TOOL_CATALOG,
|
|
119793
120147
|
...MCP_TOOL_CATALOG_FOUNDATION,
|
|
119794
120148
|
...MCP_TOOL_CATALOG_OPERATIONS,
|
|
@@ -120206,6 +120560,7 @@ async function createDefaultMcpTools(input2 = {}) {
|
|
|
120206
120560
|
...createAnalyticsJourneySampleApi(httpClient)
|
|
120207
120561
|
}),
|
|
120208
120562
|
...createAnalyticsSettingsMcpTools(createAnalyticsSettingsApi(httpClient)),
|
|
120563
|
+
...createPublicStatusMcpTools(createPublicStatusApi(httpClient)),
|
|
120209
120564
|
...createAnalyticsFlowMcpTools(createAnalyticsFlowApi(httpClient)),
|
|
120210
120565
|
...createAnalyticsSavedFunnelMcpTools(createAnalyticsSavedFunnelApi(httpClient)),
|
|
120211
120566
|
...createCaptureRuleMcpTools(createCaptureRuleApi(httpClient)),
|
|
@@ -120229,7 +120584,7 @@ var import_node_readline = require("node:readline");
|
|
|
120229
120584
|
var package_default = {
|
|
120230
120585
|
name: "@debugbundle/mcp",
|
|
120231
120586
|
mcpName: "com.debugbundle/mcp",
|
|
120232
|
-
version: "1.
|
|
120587
|
+
version: "1.16.0",
|
|
120233
120588
|
private: false,
|
|
120234
120589
|
description: "MCP server for runtime error reporting, incident response, health checks, debug bundles, and product analytics",
|
|
120235
120590
|
license: "Apache-2.0",
|