@debugbundle/mcp 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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 state = body._readableState;
1202
- return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null;
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 state = this.#state.reduce((a, b) => {
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, state);
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 state = request[kRequestStream]?.[kRequestStreamState];
7993
- return state?.responseReceived === true;
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 state = session[kHTTP2SessionState];
8135
- if (state.refed === false) {
8136
- state.refed = true;
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 state = session[kHTTP2SessionState];
8142
- if (state.refed === true) {
8143
- state.refed = false;
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 state = session[kHTTP2SessionState];
8170
- if (state?.noStreamsTimeout != null) {
8171
- clearTimeout(state.noStreamsTimeout);
8172
- state.noStreamsTimeout = null;
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 state = session[kHTTP2SessionState];
8177
+ const state2 = session[kHTTP2SessionState];
8178
8178
  const timeout = client[kHeadersTimeout];
8179
- if (!timeout || state.noStreamsTimeout != null) {
8179
+ if (!timeout || state2.noStreamsTimeout != null) {
8180
8180
  return;
8181
8181
  }
8182
- state.noStreamsTimeout = setTimeout(onNoStreamsTimeout, timeout, session).unref();
8182
+ state2.noStreamsTimeout = setTimeout(onNoStreamsTimeout, timeout, session).unref();
8183
8183
  }
8184
8184
  function onNoStreamsTimeout(session) {
8185
8185
  const client = session[kClient];
8186
- const state = session[kHTTP2SessionState];
8187
- state.noStreamsTimeout = null;
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 state = session[kHTTP2SessionState];
8205
- if (state?.idleTimeout != null) {
8206
- clearTimeout(state.idleTimeout);
8207
- state.idleTimeout = null;
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 state = session[kHTTP2SessionState];
8220
- if (state.idleTimeout == null) {
8221
- state.idleTimeout = setTimeout(onHttp2SessionIdleTimeout, client[kKeepAliveDefaultTimeout], session).unref();
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 state = session[kHTTP2SessionState];
8228
- state.idleTimeout = null;
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 state = session[kHTTP2SessionState];
8258
- if ((session.closed || session.destroyed) && state.ping.interval != null) {
8259
- clearInterval(state.ping.interval);
8260
- state.ping.interval = null;
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]: state, [kSocket]: socket } = this;
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 (state.ping.interval != null) {
8350
- clearInterval(state.ping.interval);
8351
- state.ping.interval = null;
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 state = this[kRequestStreamState];
8412
+ const state2 = this[kRequestStreamState];
8413
8413
  this[kRequestStreamState] = null;
8414
- failUpgradeStream(state, new InformationalError("HTTP/2: stream closed before response headers"));
8414
+ failUpgradeStream(state2, new InformationalError("HTTP/2: stream closed before response headers"));
8415
8415
  closeStreamSession(this);
8416
8416
  }
8417
8417
  function completeRequestStream() {
8418
- const state = this[kRequestStreamState];
8419
- if (state == null) {
8418
+ const state2 = this[kRequestStreamState];
8419
+ if (state2 == null) {
8420
8420
  return;
8421
8421
  }
8422
8422
  releaseRequestStream(this);
8423
- if (state.pendingEnd && !state.request.aborted && !state.request.completed) {
8424
- state.request.onResponseEnd(state.trailers || {});
8425
- } else if (!state.request.aborted && !state.request.completed) {
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
- state.client,
8428
- state.request,
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(state);
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 state = stream[kRequestStreamState];
8475
- if (state == null) {
8474
+ const state2 = stream[kRequestStreamState];
8475
+ if (state2 == null) {
8476
8476
  return;
8477
8477
  }
8478
- const { request } = state;
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(state, err) {
8488
- if (state == null) {
8487
+ function failUpgradeStream(state2, err) {
8488
+ if (state2 == null) {
8489
8489
  return;
8490
8490
  }
8491
- const { request } = state;
8492
- if (state.responseReceived || request.aborted || request.completed) {
8491
+ const { request } = state2;
8492
+ if (state2.responseReceived || request.aborted || request.completed) {
8493
8493
  return;
8494
8494
  }
8495
- releaseUpgradeStream(state.stream);
8496
- state.abort(err, true);
8495
+ releaseUpgradeStream(state2.stream);
8496
+ state2.abort(err, true);
8497
8497
  }
8498
8498
  function onUpgradeStreamError() {
8499
- const state = this[kRequestStreamState];
8499
+ const state2 = this[kRequestStreamState];
8500
8500
  if (typeof this.rstCode === "number" && this.rstCode !== 0) {
8501
- failUpgradeStream(state, new InformationalError(`HTTP/2: "stream error" received - code ${this.rstCode}`));
8501
+ failUpgradeStream(state2, new InformationalError(`HTTP/2: "stream error" received - code ${this.rstCode}`));
8502
8502
  } else {
8503
- failUpgradeStream(state, new InformationalError("HTTP/2: stream errored before response headers"));
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 state = this[kRequestStreamState];
8511
- failUpgradeStream(state, new InformationalError(`HTTP/2: "stream timeout after ${state.headersTimeout}"`));
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 state = stream[kRequestStreamState];
8516
- const { request } = state;
8517
- state.responseReceived = true;
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
- state.abort(err);
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(state);
8531
+ finalizeRequest(state2);
8532
8532
  }
8533
- function setupUpgradeStream(stream, state) {
8534
- const { request, headersTimeout, session } = state;
8533
+ function setupUpgradeStream(stream, state2) {
8534
+ const { request, headersTimeout, session } = state2;
8535
8535
  stream[kHTTP2Stream] = true;
8536
8536
  stream[kHTTP2Session] = session;
8537
- stream[kRequestStreamState] = state;
8538
- state.stream = stream;
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(state, resetPendingIdx = false) {
8550
- if (state.requestFinalized) {
8549
+ function finalizeRequest(state2, resetPendingIdx = false) {
8550
+ if (state2.requestFinalized) {
8551
8551
  return;
8552
8552
  }
8553
- state.requestFinalized = true;
8554
- completeRequest(state.client, state.request, resetPendingIdx);
8555
- state.client[kResume]();
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 state = {
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 (state.stream != null) {
8616
+ if (state2.stream != null) {
8617
8617
  clearRequestStream(request);
8618
- const stream2 = state.stream;
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(state, resetPendingIdx);
8624
+ finalizeRequest(state2, resetPendingIdx);
8625
8625
  }
8626
- util4.destroy(state.body, err);
8626
+ util4.destroy(state2.body, err);
8627
8627
  };
8628
- state.abort = abort;
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, state);
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, state);
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 = state.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
- state.body = body;
8713
- state.contentLength = contentLength;
8714
- state.expectsPayload = expectsPayload;
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] = state;
8724
- state.stream = stream;
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 state = stream[kRequestStreamState];
8769
- if (state == null) {
8768
+ const state2 = stream[kRequestStreamState];
8769
+ if (state2 == null) {
8770
8770
  return;
8771
8771
  }
8772
- const { request } = state;
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 state = stream[kRequestStreamState];
8784
- if (state == null) {
8783
+ const state2 = stream[kRequestStreamState];
8784
+ if (state2 == null) {
8785
8785
  return;
8786
8786
  }
8787
- const { request, maxResponseSize, responseContentLength } = state;
8787
+ const { request, maxResponseSize, responseContentLength } = state2;
8788
8788
  if (request.aborted || request.completed) {
8789
8789
  return;
8790
8790
  }
8791
- if (responseContentLength != null && state.bytesRead + chunk.length > responseContentLength) {
8792
- state.abort(new ResponseContentLengthMismatchError());
8791
+ if (responseContentLength != null && state2.bytesRead + chunk.length > responseContentLength) {
8792
+ state2.abort(new ResponseContentLengthMismatchError());
8793
8793
  return;
8794
8794
  }
8795
- if (maxResponseSize > -1 && state.bytesRead + chunk.length > maxResponseSize) {
8796
- state.abort(new ResponseExceededMaxSizeError());
8795
+ if (maxResponseSize > -1 && state2.bytesRead + chunk.length > maxResponseSize) {
8796
+ state2.abort(new ResponseExceededMaxSizeError());
8797
8797
  return;
8798
8798
  }
8799
- state.bytesRead += chunk.length;
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 state = stream[kRequestStreamState];
8807
- if (state == null) {
8806
+ const state2 = stream[kRequestStreamState];
8807
+ if (state2 == null) {
8808
8808
  return;
8809
8809
  }
8810
- const { request } = state;
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 state = stream[kRequestStreamState];
8821
- if (state == null) {
8820
+ const state2 = stream[kRequestStreamState];
8821
+ if (state2 == null) {
8822
8822
  return;
8823
8823
  }
8824
- const { request } = state;
8824
+ const { request } = state2;
8825
8825
  stream.off("response", onResponse);
8826
- if (state.body != null && !state.bodySent && !stream.writableEnded) {
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
- state.responseReceived = true;
8833
+ state2.responseReceived = true;
8834
8834
  if (request.method !== "HEAD" && statusCode !== 304) {
8835
8835
  const contentLength = headers[HTTP2_HEADER_CONTENT_LENGTH];
8836
- state.responseContentLength = contentLength == null ? null : Number(contentLength);
8836
+ state2.responseContentLength = contentLength == null ? null : Number(contentLength);
8837
8837
  }
8838
- if (state.headersTimeout || state.bodyTimeout) {
8839
- stream.setTimeout(state.bodyTimeout);
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 state = stream[kRequestStreamState];
8853
- if (state == null) {
8852
+ const state2 = stream[kRequestStreamState];
8853
+ if (state2 == null) {
8854
8854
  return;
8855
8855
  }
8856
- const { request } = state;
8856
+ const { request } = state2;
8857
8857
  stream.off("end", onEnd);
8858
- if (state.responseReceived) {
8858
+ if (state2.responseReceived) {
8859
8859
  if (!request.aborted && !request.completed) {
8860
- if (state.responseContentLength != null && state.bytesRead !== state.responseContentLength) {
8861
- state.abort(new ResponseContentLengthMismatchError());
8860
+ if (state2.responseContentLength != null && state2.bytesRead !== state2.responseContentLength) {
8861
+ state2.abort(new ResponseContentLengthMismatchError());
8862
8862
  return;
8863
8863
  }
8864
- state.pendingEnd = true;
8864
+ state2.pendingEnd = true;
8865
8865
  completeRequestStream.call(stream);
8866
8866
  }
8867
8867
  } else {
8868
- state.abort(new InformationalError("HTTP/2: stream half-closed (remote)"), true);
8868
+ state2.abort(new InformationalError("HTTP/2: stream half-closed (remote)"), true);
8869
8869
  }
8870
8870
  }
8871
- function retryRefusedStream(stream, state) {
8872
- const { client, request } = state;
8873
- if (state.responseReceived || request.aborted || request.completed || request[kRefusedStreamRetry] || !canReplayRequest(request)) {
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
- state.stream = null;
8879
- state.requestFinalized = true;
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 state = stream[kRequestStreamState];
8888
- if (state == null) {
8887
+ const state2 = stream[kRequestStreamState];
8888
+ if (state2 == null) {
8889
8889
  return;
8890
8890
  }
8891
8891
  stream.off("error", onError);
8892
- if (state.responseContentLength != null && state.bytesRead !== state.responseContentLength) {
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, state)) {
8898
+ if (stream.rstCode === NGHTTP2_REFUSED_STREAM && retryRefusedStream(stream, state2)) {
8899
8899
  return;
8900
8900
  }
8901
- state.abort(err);
8901
+ state2.abort(err);
8902
8902
  }
8903
8903
  function onFrameError(type, code) {
8904
8904
  const stream = this;
8905
- const state = stream[kRequestStreamState];
8906
- if (state == null) {
8905
+ const state2 = stream[kRequestStreamState];
8906
+ if (state2 == null) {
8907
8907
  return;
8908
8908
  }
8909
8909
  stream.off("frameError", onFrameError);
8910
- state.abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`));
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 state = stream[kRequestStreamState];
8918
- if (state == null) {
8917
+ const state2 = stream[kRequestStreamState];
8918
+ if (state2 == null) {
8919
8919
  return;
8920
8920
  }
8921
8921
  stream.off("timeout", onTimeout);
8922
- const err = state.responseReceived ? new BodyTimeoutError(`HTTP/2: "stream timeout after ${state.bodyTimeout}"`) : new HeadersTimeoutError(`HTTP/2: "headers timeout after ${state.headersTimeout}"`);
8923
- state.abort(err);
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 state = stream[kRequestStreamState];
8928
- if (state == null) {
8927
+ const state2 = stream[kRequestStreamState];
8928
+ if (state2 == null) {
8929
8929
  return;
8930
8930
  }
8931
- const { request } = state;
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
- state.trailers = trailers;
8937
+ state2.trailers = trailers;
8938
8938
  }
8939
8939
  function writeBodyH2() {
8940
8940
  const stream = this;
8941
- const state = stream[kRequestStreamState];
8942
- state.bodySent = true;
8943
- const { abort, body, client, contentLength, expectsPayload, request } = state;
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 } = state;
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: state } = consume2.stream;
12820
- if (state.bufferIndex) {
12821
- const start = state.bufferIndex;
12822
- const end = state.buffer.length;
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, state.buffer[n]);
12824
+ consumePush(consume2, state2.buffer[n]);
12825
12825
  }
12826
12826
  } else {
12827
- for (const chunk of state.buffer) {
12827
+ for (const chunk of state2.buffer) {
12828
12828
  consumePush(consume2, chunk);
12829
12829
  }
12830
12830
  }
12831
- const decoder2 = state.decoder;
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 (state.endEmitted) {
12836
- consumeEnd(consume2, state.encoding);
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(state, { origin, handler: handler7, dispatch, newOrigin }, opts) {
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 = 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 state = {
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 (state.aborted) {
19951
+ if (state2.aborted) {
19952
19952
  return;
19953
19953
  }
19954
- state.paused = false;
19954
+ state2.paused = false;
19955
19955
  this.#flushWaitingHandler(waitingHandler);
19956
- if (this.#completed && waitingHandler.pendingTrailers && waitingHandler.bufferedChunks.length === 0 && !state.paused && !state.aborted) {
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 (!state.aborted) {
19969
- state.paused = true;
19968
+ if (!state2.aborted) {
19969
+ state2.paused = true;
19970
19970
  }
19971
19971
  },
19972
19972
  get paused() {
19973
- return state.paused;
19973
+ return state2.paused;
19974
19974
  },
19975
19975
  get aborted() {
19976
- return state.aborted;
19976
+ return state2.aborted;
19977
19977
  },
19978
19978
  get reason() {
19979
- return state.reason;
19979
+ return state2.reason;
19980
19980
  },
19981
19981
  abort: (reason) => {
19982
- if (state.aborted) {
19982
+ if (state2.aborted) {
19983
19983
  return;
19984
19984
  }
19985
- state.aborted = true;
19986
- state.reason = reason ?? null;
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, state.reason ?? new RequestAbortedError());
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, state) {
21229
- state = {
21228
+ function makeFilteredResponse(response, state2) {
21229
+ state2 = {
21230
21230
  internalResponse: response,
21231
- ...state
21231
+ ...state2
21232
21232
  };
21233
21233
  return new Proxy(response, {
21234
21234
  get(target, p) {
21235
- return p in state ? state[p] : target[p];
21235
+ return p in state2 ? state2[p] : target[p];
21236
21236
  },
21237
21237
  set(target, p, value) {
21238
- assert6(!(p in state));
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 state;
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
- state = parts[1];
66190
+ state2 = parts[1];
66191
66191
  break;
66192
66192
  }
66193
66193
  }
66194
- if (state === "fail") {
66195
- debug3("cluster state not ok (%s)", state);
66196
- callback(null, state);
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;
@@ -75351,32 +75442,6 @@ var BundleV1Schema = external_exports.object({
75351
75442
  metadata: BundleMetadataSchema
75352
75443
  });
75353
75444
 
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
75445
  // ../../packages/retrieval-client/src/index.ts
75381
75446
  var ProjectColorTagResponseSchema = external_exports.unknown().transform((value, context) => {
75382
75447
  if (value === void 0 || value === null) {
@@ -77702,6 +77767,122 @@ function createCliHttpClient(input2, dependencies) {
77702
77767
  };
77703
77768
  }
77704
77769
 
77770
+ // ../cli/src/public-status-commands.ts
77771
+ var PublicStatusApiError = class extends Error {
77772
+ constructor(status, message3) {
77773
+ super(message3);
77774
+ this.status = status;
77775
+ }
77776
+ };
77777
+ function createPublicStatusApi(http) {
77778
+ const path = (scope3) => `/v1/projects/${encodeURIComponent(external_exports.string().uuid().parse(scope3.projectId))}/status-page`;
77779
+ async function request(input2, schema) {
77780
+ const result = await http.request(input2);
77781
+ if (result.status !== 200) {
77782
+ const error2 = external_exports.object({ error: external_exports.string() }).safeParse(result.body);
77783
+ throw new PublicStatusApiError(
77784
+ result.status,
77785
+ error2.success ? error2.data.error : "Status request failed."
77786
+ );
77787
+ }
77788
+ return schema.parse(result.body);
77789
+ }
77790
+ return {
77791
+ get: (scope3) => request(
77792
+ { method: "GET", path: path(scope3), bearerToken: scope3.bearerToken },
77793
+ PublicStatusManagementSchema
77794
+ ),
77795
+ save: (scope3) => request(
77796
+ {
77797
+ method: "PUT",
77798
+ path: path(scope3),
77799
+ bearerToken: scope3.bearerToken,
77800
+ body: PublicStatusSettingsSchema.parse(scope3.settings)
77801
+ },
77802
+ PublicStatusManagementSchema
77803
+ ),
77804
+ options: (scope3) => {
77805
+ const query = PublicStatusOptionsQuerySchema.parse({
77806
+ ...scope3.cursor ? { cursor: scope3.cursor } : {},
77807
+ ...scope3.check_project_id ? { check_project_id: scope3.check_project_id } : {},
77808
+ ...scope3.check_cursor ? { check_cursor: scope3.check_cursor } : {}
77809
+ });
77810
+ const params = new URLSearchParams(
77811
+ Object.entries(query).filter(
77812
+ (entry) => typeof entry[1] === "string"
77813
+ )
77814
+ ).toString();
77815
+ return request(
77816
+ {
77817
+ method: "GET",
77818
+ path: `${path(scope3)}/options${params ? `?${params}` : ""}`,
77819
+ bearerToken: scope3.bearerToken
77820
+ },
77821
+ PublicStatusOptionsSchema
77822
+ );
77823
+ },
77824
+ preview: (scope3) => request(
77825
+ { method: "GET", path: `${path(scope3)}/preview`, bearerToken: scope3.bearerToken },
77826
+ PublicStatusPageSchema
77827
+ )
77828
+ };
77829
+ }
77830
+
77831
+ // src/public-status-tools.ts
77832
+ var scope = external_exports.object({ bearerToken: external_exports.string().min(1), projectId: external_exports.string().uuid() }).strict();
77833
+ var PUBLIC_STATUS_MCP_TOOL_NAMES = [
77834
+ "get_public_status_page",
77835
+ "save_public_status_page",
77836
+ "list_public_status_page_options",
77837
+ "preview_public_status_page"
77838
+ ];
77839
+ var PUBLIC_STATUS_MCP_TOOL_CATALOG = [
77840
+ {
77841
+ name: PUBLIC_STATUS_MCP_TOOL_NAMES[0],
77842
+ group: "public_status",
77843
+ description: "Read a project's public status settings and share URL. Owners receive configuration; collaborators receive only the published link and title.",
77844
+ inputSchema: scope
77845
+ },
77846
+ {
77847
+ name: PUBLIC_STATUS_MCP_TOOL_NAMES[1],
77848
+ group: "public_status",
77849
+ description: "Save or publish/unpublish a public status page. Owner only. Explicit selections expose names and 30-day availability for chosen checks; other projects must share the same owner and account. Anchor project must be first. New checks remain private.",
77850
+ inputSchema: scope.extend({ settings: PublicStatusSettingsSchema })
77851
+ },
77852
+ {
77853
+ name: PUBLIC_STATUS_MCP_TOOL_NAMES[2],
77854
+ group: "public_status",
77855
+ description: "List a bounded page of same-owner/account projects and checks eligible for status publication. Owner only; continue with next_cursor.",
77856
+ inputSchema: scope.extend(PublicStatusOptionsQueryObjectSchema.shape)
77857
+ },
77858
+ {
77859
+ name: PUBLIC_STATUS_MCP_TOOL_NAMES[3],
77860
+ group: "public_status",
77861
+ description: "Preview the saved public projection, including unpublished settings. Owner only. Reads existing availability; never executes checks or exposes diagnostic details.",
77862
+ inputSchema: scope
77863
+ }
77864
+ ];
77865
+ function createPublicStatusMcpTools(api) {
77866
+ async function call(fn2) {
77867
+ try {
77868
+ return await fn2();
77869
+ } catch (error2) {
77870
+ throw new Error(
77871
+ `mcp_tool_error:${error2 instanceof PublicStatusApiError ? error2.message : error2 instanceof external_exports.ZodError ? "invalid_status_input" : "unknown_error"}`
77872
+ );
77873
+ }
77874
+ }
77875
+ return {
77876
+ get_public_status_page: (input2) => call(() => api.get(scope.parse(input2))),
77877
+ save_public_status_page: (input2) => call(() => api.save(PUBLIC_STATUS_MCP_TOOL_CATALOG[1].inputSchema.parse(input2))),
77878
+ list_public_status_page_options: (input2) => call(() => {
77879
+ const parsed = PUBLIC_STATUS_MCP_TOOL_CATALOG[2].inputSchema.parse(input2);
77880
+ return api.options(parsed);
77881
+ }),
77882
+ preview_public_status_page: (input2) => call(() => api.preview(scope.parse(input2)))
77883
+ };
77884
+ }
77885
+
77705
77886
  // ../cli/src/analytics-flow-commands.ts
77706
77887
  var AnalyticsFlowApiError = class extends Error {
77707
77888
  constructor(status, message3) {
@@ -77761,20 +77942,20 @@ function createAnalyticsFlowApi(http) {
77761
77942
  }
77762
77943
 
77763
77944
  // src/analytics-flow-tools.ts
77764
- var scope = external_exports.object({ bearerToken: external_exports.string(), projectId: external_exports.string().uuid() });
77765
- var item = scope.extend({ flowKey: AnalyticsFlowKeySchema });
77945
+ var scope2 = external_exports.object({ bearerToken: external_exports.string(), projectId: external_exports.string().uuid() });
77946
+ var item = scope2.extend({ flowKey: AnalyticsFlowKeySchema });
77766
77947
  var ANALYTICS_FLOW_MCP_TOOL_CATALOG = [
77767
77948
  {
77768
77949
  name: "list_analytics_flows",
77769
77950
  group: "analytics_flows",
77770
77951
  description: "List this project's named acquisition and activation flows, including archived definitions.",
77771
- inputSchema: scope
77952
+ inputSchema: scope2
77772
77953
  },
77773
77954
  {
77774
77955
  name: "save_analytics_flow",
77775
77956
  group: "analytics_flows",
77776
77957
  description: "Create or replace a project flow with two to eight ordered steps and exact origins. Owner/admin only. Edits start a new report version.",
77777
- inputSchema: scope.extend({ definition: AnalyticsFlowDefinitionInputSchema })
77958
+ inputSchema: scope2.extend({ definition: AnalyticsFlowDefinitionInputSchema })
77778
77959
  },
77779
77960
  {
77780
77961
  name: "archive_analytics_flow",
@@ -77800,7 +77981,7 @@ function createAnalyticsFlowMcpTools(api) {
77800
77981
  }
77801
77982
  }
77802
77983
  return {
77803
- list_analytics_flows: (input2) => call(() => api.list(scope.parse(input2))),
77984
+ list_analytics_flows: (input2) => call(() => api.list(scope2.parse(input2))),
77804
77985
  save_analytics_flow: (input2) => call(() => api.save(ANALYTICS_FLOW_MCP_TOOL_CATALOG[1].inputSchema.parse(input2))),
77805
77986
  archive_analytics_flow: (input2) => call(() => api.archive(item.parse(input2))),
77806
77987
  get_analytics_flow_report: (input2) => call(() => {
@@ -79092,76 +79273,76 @@ var BudgetExceeded = class extends Error {
79092
79273
  function byteLength(value) {
79093
79274
  return new TextEncoder().encode(value).length;
79094
79275
  }
79095
- function mask(state) {
79096
- state.redactionCount += 1;
79276
+ function mask(state2) {
79277
+ state2.redactionCount += 1;
79097
79278
  return REDACTED2;
79098
79279
  }
79099
- function sanitizeString(value, state, allowStructured) {
79100
- if (value.length > MAX_STRING_BYTES) return mask(state);
79280
+ function sanitizeString(value, state2, allowStructured) {
79281
+ if (value.length > MAX_STRING_BYTES) return mask(state2);
79101
79282
  const length = byteLength(value);
79102
- if (length > MAX_STRING_BYTES) return mask(state);
79103
- state.textBytes += length;
79104
- if (state.textBytes > state.maxTotalBytes) throw new BudgetExceeded();
79283
+ if (length > MAX_STRING_BYTES) return mask(state2);
79284
+ state2.textBytes += length;
79285
+ if (state2.textBytes > state2.maxTotalBytes) throw new BudgetExceeded();
79105
79286
  if (allowStructured && (value.startsWith("{") || value.startsWith("["))) {
79106
79287
  try {
79107
79288
  const parsed = JSON.parse(value);
79108
79289
  if (typeof parsed === "object" && parsed !== null) {
79109
- const nested = sanitizeValue(parsed, state, 0, false);
79290
+ const nested = sanitizeValue(parsed, state2, 0, false);
79110
79291
  const encoded = JSON.stringify(nested);
79111
- if (encoded !== value) state.redactionCount += 1;
79292
+ if (encoded !== value) state2.redactionCount += 1;
79112
79293
  return encoded;
79113
79294
  }
79114
79295
  } catch (error2) {
79115
79296
  if (error2 instanceof BudgetExceeded) throw error2;
79116
79297
  }
79117
79298
  }
79118
- const result = scrubCredentialText(value, state.extra);
79119
- if (result !== value) state.redactionCount += 1;
79299
+ const result = scrubCredentialText(value, state2.extra);
79300
+ if (result !== value) state2.redactionCount += 1;
79120
79301
  if ((value.startsWith("{") || value.startsWith("[")) && result === value && /(?:password|token|secret|authorization|cookie)["']?\s*[:=]/i.test(value)) {
79121
- return mask(state);
79302
+ return mask(state2);
79122
79303
  }
79123
79304
  return result;
79124
79305
  }
79125
- function sanitizeValue(value, state, depth, allowStructured) {
79126
- state.nodes += 1;
79127
- if (state.nodes > MAX_NODES) throw new BudgetExceeded();
79128
- if (depth > MAX_DEPTH) return mask(state);
79129
- if (typeof value === "string") return sanitizeString(value, state, allowStructured);
79306
+ function sanitizeValue(value, state2, depth, allowStructured) {
79307
+ state2.nodes += 1;
79308
+ if (state2.nodes > MAX_NODES) throw new BudgetExceeded();
79309
+ if (depth > MAX_DEPTH) return mask(state2);
79310
+ if (typeof value === "string") return sanitizeString(value, state2, allowStructured);
79130
79311
  if (value === null || typeof value === "boolean") return value;
79131
79312
  if (typeof value === "number" && Number.isFinite(value)) return value;
79132
79313
  if (typeof value !== "object") throw new TypeError("unsafe_input");
79133
- if (state.seen.has(value)) return "[Circular]";
79134
- state.seen.add(value);
79314
+ if (state2.seen.has(value)) return "[Circular]";
79315
+ state2.seen.add(value);
79135
79316
  try {
79136
79317
  if (Array.isArray(value)) {
79137
- if (value.length > MAX_ENTRIES) return mask(state);
79318
+ if (value.length > MAX_ENTRIES) return mask(state2);
79138
79319
  return Array.from({ length: value.length }, (_, index) => {
79139
79320
  const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
79140
79321
  if (descriptor === void 0 || !("value" in descriptor)) throw new TypeError("unsafe_input");
79141
- return sanitizeValue(descriptor.value, state, depth + 1, allowStructured);
79322
+ return sanitizeValue(descriptor.value, state2, depth + 1, allowStructured);
79142
79323
  });
79143
79324
  }
79144
79325
  if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {
79145
79326
  throw new TypeError("unsafe_input");
79146
79327
  }
79147
79328
  const keys2 = Object.keys(value);
79148
- if (keys2.length > MAX_ENTRIES) return mask(state);
79329
+ if (keys2.length > MAX_ENTRIES) return mask(state2);
79149
79330
  const result = {};
79150
79331
  for (const key of keys2) {
79151
79332
  if (key.length > 128) {
79152
- state.redactionCount += 1;
79333
+ state2.redactionCount += 1;
79153
79334
  continue;
79154
79335
  }
79155
- state.textBytes += byteLength(key);
79156
- if (state.textBytes > state.maxTotalBytes) throw new BudgetExceeded();
79157
- const safeKey = scrubCredentialText(key, state.extra);
79336
+ state2.textBytes += byteLength(key);
79337
+ if (state2.textBytes > state2.maxTotalBytes) throw new BudgetExceeded();
79338
+ const safeKey = scrubCredentialText(key, state2.extra);
79158
79339
  if (safeKey !== key) {
79159
- state.redactionCount += 1;
79340
+ state2.redactionCount += 1;
79160
79341
  continue;
79161
79342
  }
79162
79343
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
79163
79344
  if (descriptor === void 0 || !("value" in descriptor)) throw new TypeError("unsafe_input");
79164
- const safeValue = isSensitiveKey(key, state.keys) ? mask(state) : sanitizeValue(descriptor.value, state, depth + 1, allowStructured);
79345
+ const safeValue = isSensitiveKey(key, state2.keys) ? mask(state2) : sanitizeValue(descriptor.value, state2, depth + 1, allowStructured);
79165
79346
  Object.defineProperty(result, key, {
79166
79347
  value: safeValue,
79167
79348
  enumerable: true,
@@ -79171,7 +79352,7 @@ function sanitizeValue(value, state, depth, allowStructured) {
79171
79352
  }
79172
79353
  return result;
79173
79354
  } finally {
79174
- state.seen.delete(value);
79355
+ state2.seen.delete(value);
79175
79356
  }
79176
79357
  }
79177
79358
  function sanitizeTelemetry(value, options = {}) {
@@ -79184,7 +79365,7 @@ function sanitizeTelemetry(value, options = {}) {
79184
79365
  if (!Number.isInteger(maxTotalBytes) || maxTotalBytes < 1 || maxTotalBytes > 512 * 1024) {
79185
79366
  return { ok: false, reason: "unsafe_input" };
79186
79367
  }
79187
- const state = {
79368
+ const state2 = {
79188
79369
  nodes: 0,
79189
79370
  textBytes: 0,
79190
79371
  redactionCount: 0,
@@ -79193,11 +79374,11 @@ function sanitizeTelemetry(value, options = {}) {
79193
79374
  extra,
79194
79375
  maxTotalBytes
79195
79376
  };
79196
- const sanitized = sanitizeValue(value, state, 0, true);
79377
+ const sanitized = sanitizeValue(value, state2, 0, true);
79197
79378
  if (byteLength(JSON.stringify(sanitized)) > maxTotalBytes) {
79198
79379
  return { ok: false, reason: "budget_exceeded" };
79199
79380
  }
79200
- return { ok: true, value: sanitized, redactionCount: state.redactionCount };
79381
+ return { ok: true, value: sanitized, redactionCount: state2.redactionCount };
79201
79382
  } catch (error2) {
79202
79383
  return { ok: false, reason: error2 instanceof BudgetExceeded ? "budget_exceeded" : "unsafe_input" };
79203
79384
  }
@@ -91321,17 +91502,17 @@ var InvalidClientMetadata = class extends OIDCProviderError {
91321
91502
  }
91322
91503
  };
91323
91504
  var InvalidScope = class extends OIDCProviderError {
91324
- constructor(description, scope2, options) {
91505
+ constructor(description, scope3, options) {
91325
91506
  super(400, "invalid_scope", options);
91326
91507
  Error.captureStackTrace(this, this.constructor);
91327
- Object.assign(this, { scope: scope2, error_description: description, error_detail: this.error_detail });
91508
+ Object.assign(this, { scope: scope3, error_description: description, error_detail: this.error_detail });
91328
91509
  }
91329
91510
  };
91330
91511
  var InsufficientScope = class extends OIDCProviderError {
91331
- constructor(description, scope2, options) {
91512
+ constructor(description, scope3, options) {
91332
91513
  super(403, "insufficient_scope", options);
91333
91514
  Error.captureStackTrace(this, this.constructor);
91334
- Object.assign(this, { scope: scope2, error_description: description, error_detail: this.error_detail });
91515
+ Object.assign(this, { scope: scope3, error_description: description, error_detail: this.error_detail });
91335
91516
  }
91336
91517
  };
91337
91518
  var InvalidRequest = class extends OIDCProviderError {
@@ -91574,10 +91755,10 @@ var consent_default = () => new prompt_default(
91574
91755
  const { oidc } = ctx;
91575
91756
  const encounteredScopes = new Set(oidc.grant.getOIDCScopeEncountered().split(" "));
91576
91757
  let missing;
91577
- for (const scope2 of oidc.requestParamOIDCScopes) {
91578
- if (!encounteredScopes.has(scope2)) {
91758
+ for (const scope3 of oidc.requestParamOIDCScopes) {
91759
+ if (!encounteredScopes.has(scope3)) {
91579
91760
  missing ||= [];
91580
- missing.push(scope2);
91761
+ missing.push(scope3);
91581
91762
  }
91582
91763
  }
91583
91764
  if (missing?.length) {
@@ -91609,11 +91790,11 @@ var consent_default = () => new prompt_default(
91609
91790
  const encounteredScopes = new Set(oidc.grant.getResourceScopeEncountered(indicator).split(" "));
91610
91791
  const requestedScopes = ctx.oidc.requestParamScopes;
91611
91792
  const availableScopes = resourceServer.scopes;
91612
- for (const scope2 of requestedScopes) {
91613
- if (availableScopes.has(scope2) && !encounteredScopes.has(scope2)) {
91793
+ for (const scope3 of requestedScopes) {
91794
+ if (availableScopes.has(scope3) && !encounteredScopes.has(scope3)) {
91614
91795
  missing ||= {};
91615
91796
  missing[indicator] ||= [];
91616
- missing[indicator].push(scope2);
91797
+ missing[indicator].push(scope3);
91617
91798
  }
91618
91799
  }
91619
91800
  }
@@ -92037,7 +92218,7 @@ async function findAccount(ctx, sub, token) {
92037
92218
  mustChange("findAccount", "use your own account model");
92038
92219
  return {
92039
92220
  accountId: sub,
92040
- async claims(use, scope2, claims, rejected) {
92221
+ async claims(use, scope3, claims, rejected) {
92041
92222
  return { sub };
92042
92223
  }
92043
92224
  };
@@ -92974,9 +93155,9 @@ var Configuration = class {
92974
93155
  claimDefinedScopes.push(key);
92975
93156
  }
92976
93157
  });
92977
- claimDefinedScopes.forEach((scope2) => {
92978
- if (typeof scope2 === "string" && !this.scopes.has(scope2)) {
92979
- this.scopes.add(scope2);
93158
+ claimDefinedScopes.forEach((scope3) => {
93159
+ if (typeof scope3 === "string" && !this.scopes.has(scope3)) {
93160
+ this.scopes.add(scope3);
92980
93161
  }
92981
93162
  });
92982
93163
  }
@@ -92992,9 +93173,9 @@ var Configuration = class {
92992
93173
  Object.entries(this.claims).forEach(([key, value]) => {
92993
93174
  if (Array.isArray(value)) {
92994
93175
  this.claims[key] = value.reduce((accumulator, claim) => {
92995
- const scope2 = accumulator;
92996
- scope2[claim] = null;
92997
- return scope2;
93176
+ const scope3 = accumulator;
93177
+ scope3[claim] = null;
93178
+ return scope3;
92998
93179
  }, {});
92999
93180
  }
93000
93181
  });
@@ -93011,9 +93192,9 @@ var Configuration = class {
93011
93192
  }
93012
93193
  collectClaims() {
93013
93194
  const claims = /* @__PURE__ */ new Set();
93014
- this.scopes.forEach((scope2) => {
93015
- if (scope2 in this.claims) {
93016
- Object.keys(this.claims[scope2]).forEach(Set.prototype.add.bind(claims));
93195
+ this.scopes.forEach((scope3) => {
93196
+ if (scope3 in this.claims) {
93197
+ Object.keys(this.claims[scope3]).forEach(Set.prototype.add.bind(claims));
93017
93198
  }
93018
93199
  });
93019
93200
  Object.entries(this.claims).forEach(([key, value]) => {
@@ -94232,9 +94413,9 @@ function interaction(it, options) {
94232
94413
  missingOIDCScope2.delete("offline_access");
94233
94414
  if (missingOIDCScope2.size) {
94234
94415
  __eta.res += " <li>scopes:</li>\n <ul>\n ";
94235
- missingOIDCScope2.forEach((scope2) => {
94416
+ missingOIDCScope2.forEach((scope3) => {
94236
94417
  __eta.res += " <li>";
94237
- __eta.res += __eta.e(scope2);
94418
+ __eta.res += __eta.e(scope3);
94238
94419
  __eta.res += "</li>\n ";
94239
94420
  });
94240
94421
  __eta.res += " </ul>\n";
@@ -94259,9 +94440,9 @@ function interaction(it, options) {
94259
94440
  __eta.res += " <li>";
94260
94441
  __eta.res += __eta.e(indicator);
94261
94442
  __eta.res += ":</li>\n <ul>\n ";
94262
- scopes.forEach((scope2) => {
94443
+ scopes.forEach((scope3) => {
94263
94444
  __eta.res += " <li>";
94264
- __eta.res += __eta.e(scope2);
94445
+ __eta.res += __eta.e(scope3);
94265
94446
  __eta.res += "</li>\n ";
94266
94447
  });
94267
94448
  __eta.res += " </ul>\n ";
@@ -94656,8 +94837,8 @@ function devInteractions(provider) {
94656
94837
  grant.addOIDCClaims(details.missingOIDCClaims);
94657
94838
  }
94658
94839
  if (details.missingResourceScopes) {
94659
- for (const [indicator, scope2] of Object.entries(details.missingResourceScopes)) {
94660
- grant.addResourceScope(indicator, scope2.join(" "));
94840
+ for (const [indicator, scope3] of Object.entries(details.missingResourceScopes)) {
94841
+ grant.addResourceScope(indicator, scope3.join(" "));
94661
94842
  }
94662
94843
  }
94663
94844
  const result = { consent: { grantId: await grant.save() } };
@@ -97270,9 +97451,9 @@ var resolve_resource_default = async (ctx, model, config2, scopes = model.scopes
97270
97451
  };
97271
97452
 
97272
97453
  // ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/helpers/account_claims.js
97273
- async function getCtxAccountClaims(ctx, use, scope2, claims, rejected) {
97454
+ async function getCtxAccountClaims(ctx, use, scope3, claims, rejected) {
97274
97455
  return {
97275
- ...await ctx.oidc.account.claims(use, scope2, claims, rejected),
97456
+ ...await ctx.oidc.account.claims(use, scope3, claims, rejected),
97276
97457
  sub: ctx.oidc.account.accountId
97277
97458
  };
97278
97459
  }
@@ -97422,15 +97603,15 @@ async function applyDpopBinding(ctx, dPoP, at) {
97422
97603
  async function resolveAndApplyResource(ctx, source, at, grant, {
97423
97604
  userinfo,
97424
97605
  resourceIndicators
97425
- }, scope2) {
97426
- const resource = await resolve_resource_default(ctx, source, { userinfo, resourceIndicators }, scope2);
97606
+ }, scope3) {
97607
+ const resource = await resolve_resource_default(ctx, source, { userinfo, resourceIndicators }, scope3);
97427
97608
  if (resource) {
97428
97609
  const resourceServerInfo = await resourceIndicators.getResourceServerInfo(ctx, resource, ctx.oidc.client);
97429
97610
  at.resourceServer = new ctx.oidc.provider.ResourceServer(resource, resourceServerInfo);
97430
- at.scope = grant.getResourceScopeFiltered(resource, scope2 || source.scopes);
97611
+ at.scope = grant.getResourceScopeFiltered(resource, scope3 || source.scopes);
97431
97612
  } else {
97432
97613
  at.claims = source.claims;
97433
- at.scope = grant.getOIDCScopeFiltered(scope2 || source.scopes);
97614
+ at.scope = grant.getOIDCScopeFiltered(scope3 || source.scopes);
97434
97615
  }
97435
97616
  return resource;
97436
97617
  }
@@ -97688,9 +97869,9 @@ var handler2 = async function clientCredentialsHandler(ctx) {
97688
97869
  const scopes = [...new Set(ctx.oidc.params.scope?.split(" "))];
97689
97870
  if (client.scope) {
97690
97871
  const allowList = new Set(client.scope.split(" "));
97691
- for (const scope2 of scopes.filter(Set.prototype.has.bind(statics))) {
97692
- if (!allowList.has(scope2)) {
97693
- throw new InvalidScope("requested scope is not allowed", scope2);
97872
+ for (const scope3 of scopes.filter(Set.prototype.has.bind(statics))) {
97873
+ if (!allowList.has(scope3)) {
97874
+ throw new InvalidScope("requested scope is not allowed", scope3);
97694
97875
  }
97695
97876
  }
97696
97877
  }
@@ -97950,25 +98131,25 @@ var handler4 = async function refreshTokenHandler(ctx) {
97950
98131
  if (at.gty && !at.gty.endsWith(gty3)) {
97951
98132
  at.gty = `${at.gty} ${gty3}`;
97952
98133
  }
97953
- const scope2 = ctx.oidc.params.scope ? ctx.oidc.requestParamScopes : refreshToken.scopes;
98134
+ const scope3 = ctx.oidc.params.scope ? ctx.oidc.requestParamScopes : refreshToken.scopes;
97954
98135
  await checkRar(ctx, () => {
97955
98136
  });
97956
98137
  const resource = await resolve_resource_default(
97957
98138
  ctx,
97958
98139
  refreshToken,
97959
98140
  { userinfo, resourceIndicators },
97960
- scope2
98141
+ scope3
97961
98142
  );
97962
98143
  if (resource) {
97963
98144
  const resourceServerInfo = await resourceIndicators.getResourceServerInfo(ctx, resource, ctx.oidc.client);
97964
98145
  at.resourceServer = new ctx.oidc.provider.ResourceServer(resource, resourceServerInfo);
97965
98146
  at.scope = grant.getResourceScopeFiltered(
97966
98147
  resource,
97967
- [...scope2].filter(Set.prototype.has.bind(at.resourceServer.scopes))
98148
+ [...scope3].filter(Set.prototype.has.bind(at.resourceServer.scopes))
97968
98149
  );
97969
98150
  } else {
97970
98151
  at.claims = refreshToken.claims;
97971
- at.scope = grant.getOIDCScopeFiltered(scope2);
98152
+ at.scope = grant.getOIDCScopeFiltered(scope3);
97972
98153
  }
97973
98154
  if (richAuthorizationRequests.enabled && at.resourceServer) {
97974
98155
  at.rar = await richAuthorizationRequests.rarForRefreshTokenResponse(ctx, at.resourceServer);
@@ -97978,7 +98159,7 @@ var handler4 = async function refreshTokenHandler(ctx) {
97978
98159
  const idToken = await issueIdToken(ctx, refreshToken, at, grant, {
97979
98160
  conformIdTokenClaims,
97980
98161
  userinfo
97981
- }, scope2);
98162
+ }, scope3);
97982
98163
  ctx.body = buildTokenResponse(at, accessToken, {
97983
98164
  idToken,
97984
98165
  refreshToken: refreshTokenValue,
@@ -98372,20 +98553,20 @@ var err_out_default = ({
98372
98553
  expose,
98373
98554
  message: message3,
98374
98555
  error_description: description,
98375
- scope: scope2
98376
- }, state) => {
98556
+ scope: scope3
98557
+ }, state2) => {
98377
98558
  if (expose) {
98378
98559
  return {
98379
98560
  error: message3,
98380
98561
  ...description !== void 0 ? { error_description: description } : void 0,
98381
- ...scope2 !== void 0 ? { scope: scope2 } : void 0,
98382
- ...state !== void 0 ? { state } : void 0
98562
+ ...scope3 !== void 0 ? { scope: scope3 } : void 0,
98563
+ ...state2 !== void 0 ? { state: state2 } : void 0
98383
98564
  };
98384
98565
  }
98385
98566
  return {
98386
98567
  error: "server_error",
98387
98568
  error_description: "oops! something went wrong",
98388
- ...state ? { state } : void 0
98569
+ ...state2 ? { state: state2 } : void 0
98389
98570
  };
98390
98571
  };
98391
98572
 
@@ -98499,8 +98680,8 @@ var authorization_error_handler_default = (provider) => {
98499
98680
  recovery: oneRedirectUriClients
98500
98681
  }
98501
98682
  });
98502
- function getOutAndEmit(ctx, err, state) {
98503
- const out = { ...err_out_default(err, state), iss: ctx.oidc.provider.issuer };
98683
+ function getOutAndEmit(ctx, err, state2) {
98684
+ const out = { ...err_out_default(err, state2), iss: ctx.oidc.provider.issuer };
98504
98685
  if (err.expose) {
98505
98686
  provider.emit("authorization.error", ctx, err);
98506
98687
  debugError2("%o", out);
@@ -99656,8 +99837,8 @@ async function checkIdTokenHint(ctx, next) {
99656
99837
 
99657
99838
  // ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/helpers/is_valid_scope.js
99658
99839
  var SCOPE_SYNTAX = /^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$/u;
99659
- function isValidScope(scope2) {
99660
- return scope2 === void 0 || typeof scope2 === "string" && SCOPE_SYNTAX.test(scope2);
99840
+ function isValidScope(scope3) {
99841
+ return scope3 === void 0 || typeof scope3 === "string" && SCOPE_SYNTAX.test(scope3);
99661
99842
  }
99662
99843
 
99663
99844
  // ../../node_modules/.pnpm/oidc-provider@9.11.5/node_modules/oidc-provider/lib/actions/authorization/check_scope.js
@@ -99681,9 +99862,9 @@ async function checkScope(PARAM_LIST3, ctx, next) {
99681
99862
  }
99682
99863
  if (client.scope) {
99683
99864
  const allowList = new Set(client.scope.split(" "));
99684
- for (const scope2 of scopes.filter(Set.prototype.has.bind(statics))) {
99685
- if (!allowList.has(scope2)) {
99686
- throw new InvalidScope("requested scope is not allowed", scope2);
99865
+ for (const scope3 of scopes.filter(Set.prototype.has.bind(statics))) {
99866
+ if (!allowList.has(scope3)) {
99867
+ throw new InvalidScope("requested scope is not allowed", scope3);
99687
99868
  }
99688
99869
  }
99689
99870
  }
@@ -100084,9 +100265,9 @@ async function codeHandler(ctx) {
100084
100265
  async function idTokenHandler(ctx) {
100085
100266
  const claims = filter_claims_default(ctx.oidc.claims, "id_token", ctx.oidc.grant);
100086
100267
  const rejected = ctx.oidc.grant.getRejectedOIDCClaims();
100087
- const scope2 = ctx.oidc.grant.getOIDCScopeFiltered(ctx.oidc.requestParamScopes);
100268
+ const scope3 = ctx.oidc.grant.getOIDCScopeFiltered(ctx.oidc.requestParamScopes);
100088
100269
  const idToken = new ctx.oidc.provider.IdToken({
100089
- ...await getCtxAccountClaims(ctx, "id_token", scope2, claims, rejected),
100270
+ ...await getCtxAccountClaims(ctx, "id_token", scope3, claims, rejected),
100090
100271
  acr: ctx.oidc.acr,
100091
100272
  amr: ctx.oidc.amr,
100092
100273
  auth_time: ctx.oidc.session.authTime()
@@ -100098,7 +100279,7 @@ async function idTokenHandler(ctx) {
100098
100279
  if (conformIdTokenClaims && userinfo.enabled && ctx.oidc.params.response_type !== "id_token" && !ctx.oidc.params.resource) {
100099
100280
  idToken.scope = "openid";
100100
100281
  } else {
100101
- idToken.scope = scope2;
100282
+ idToken.scope = scope3;
100102
100283
  }
100103
100284
  idToken.mask = claims;
100104
100285
  idToken.rejected = rejected;
@@ -101074,12 +101255,12 @@ function getSetWWWAuthenticateHeader({ tokenProperty = "accessToken", includeSco
101074
101255
  if (!err.expose || dpop === false && err.statusCode !== 401) throw err;
101075
101256
  const conf = weak_cache_default(ctx.oidc.provider);
101076
101257
  const dpopEnabled = dpop !== false && conf.features.dPoP.enabled;
101077
- const scope2 = includeScope ? err.scope : void 0;
101258
+ const scope3 = includeScope ? err.scope : void 0;
101078
101259
  const algs = dpopEnabled ? conf.configuration.dPoPSigningAlgValues.join(" ") : void 0;
101079
101260
  if (err instanceof NoAccessTokenProvided) {
101080
- appendWWWAuthenticate(ctx, "Bearer", { realm: ctx.oidc.issuer, scope: scope2 });
101261
+ appendWWWAuthenticate(ctx, "Bearer", { realm: ctx.oidc.issuer, scope: scope3 });
101081
101262
  if (dpopEnabled) {
101082
- appendWWWAuthenticate(ctx, "DPoP", { realm: ctx.oidc.issuer, scope: scope2, algs });
101263
+ appendWWWAuthenticate(ctx, "DPoP", { realm: ctx.oidc.issuer, scope: scope3, algs });
101083
101264
  }
101084
101265
  throw err;
101085
101266
  }
@@ -101096,7 +101277,7 @@ function getSetWWWAuthenticateHeader({ tokenProperty = "accessToken", includeSco
101096
101277
  realm: ctx.oidc.issuer,
101097
101278
  error: err.error ?? err.message,
101098
101279
  error_description: err.error_description,
101099
- scope: scope2,
101280
+ scope: scope3,
101100
101281
  ...scheme === "DPoP" ? { algs } : void 0
101101
101282
  });
101102
101283
  throw err;
@@ -101213,14 +101394,14 @@ var userinfo_default = [
101213
101394
  async function respond2(ctx) {
101214
101395
  const claims = filter_claims_default(ctx.oidc.accessToken.claims, "userinfo", ctx.oidc.grant);
101215
101396
  const rejected = ctx.oidc.grant.getRejectedOIDCClaims();
101216
- const scope2 = ctx.oidc.grant.getOIDCScopeFiltered(new Set((ctx.oidc.params.scope || ctx.oidc.accessToken.scope).split(" ")));
101397
+ const scope3 = ctx.oidc.grant.getOIDCScopeFiltered(new Set((ctx.oidc.params.scope || ctx.oidc.accessToken.scope).split(" ")));
101217
101398
  const { client } = ctx.oidc;
101218
101399
  if (client.userinfoSignedResponseAlg || client.userinfoEncryptedResponseAlg) {
101219
101400
  const token = new ctx.oidc.provider.IdToken(
101220
- await getCtxAccountClaims(ctx, "userinfo", scope2, claims, rejected),
101401
+ await getCtxAccountClaims(ctx, "userinfo", scope3, claims, rejected),
101221
101402
  { ctx }
101222
101403
  );
101223
- token.scope = scope2;
101404
+ token.scope = scope3;
101224
101405
  token.mask = claims;
101225
101406
  token.rejected = rejected;
101226
101407
  ctx.body = await token.issue({
@@ -101230,10 +101411,10 @@ var userinfo_default = [
101230
101411
  ctx.type = "application/jwt; charset=utf-8";
101231
101412
  } else {
101232
101413
  const mask2 = new ctx.oidc.provider.Claims(
101233
- await getCtxAccountClaims(ctx, "userinfo", scope2, claims, rejected),
101414
+ await getCtxAccountClaims(ctx, "userinfo", scope3, claims, rejected),
101234
101415
  { ctx }
101235
101416
  );
101236
- mask2.scope(scope2);
101417
+ mask2.scope(scope3);
101237
101418
  mask2.mask(claims);
101238
101419
  mask2.rejected(rejected);
101239
101420
  ctx.body = await mask2.result();
@@ -102311,7 +102492,7 @@ var confirm2 = [
102311
102492
  checkXsrf("could not find logout details"),
102312
102493
  async function endSession(ctx) {
102313
102494
  const { oidc: { session, params } } = ctx;
102314
- const { state } = session;
102495
+ const { state: state2 } = session;
102315
102496
  const {
102316
102497
  features: { backchannelLogout },
102317
102498
  cookies: { long: opts }
@@ -102320,7 +102501,7 @@ var confirm2 = [
102320
102501
  const clientIds = Object.keys(session.authorizations || {});
102321
102502
  const back = [];
102322
102503
  for (const clientId of clientIds) {
102323
- if (params.logout || clientId === state.clientId) {
102504
+ if (params.logout || clientId === state2.clientId) {
102324
102505
  const client = await clientForLogout(ctx, clientId);
102325
102506
  if (client) {
102326
102507
  const sid = session.sidFor(client.clientId);
@@ -102337,8 +102518,8 @@ var confirm2 = [
102337
102518
  }
102338
102519
  await Promise.all(back);
102339
102520
  }
102340
- if (state.clientId) {
102341
- ctx.oidc.entity("Client", await clientForLogout(ctx, state.clientId));
102521
+ if (state2.clientId) {
102522
+ ctx.oidc.entity("Client", await clientForLogout(ctx, state2.clientId));
102342
102523
  }
102343
102524
  if (params.logout) {
102344
102525
  if (session.authorizations) {
@@ -102356,24 +102537,24 @@ var confirm2 = [
102356
102537
  null,
102357
102538
  opts
102358
102539
  );
102359
- } else if (state.clientId) {
102360
- const grantId = session.grantIdFor(state.clientId);
102361
- if (grantId && !session.authorizationFor(state.clientId).persistsLogout) {
102540
+ } else if (state2.clientId) {
102541
+ const grantId = session.grantIdFor(state2.clientId);
102542
+ if (grantId && !session.authorizationFor(state2.clientId).persistsLogout) {
102362
102543
  await revoke(ctx, grantId);
102363
102544
  }
102364
102545
  session.state = void 0;
102365
102546
  if (session.authorizations) {
102366
- delete session.authorizations[state.clientId];
102547
+ delete session.authorizations[state2.clientId];
102367
102548
  }
102368
102549
  session.resetIdentifier();
102369
102550
  }
102370
- const usePostLogoutUri = state.postLogoutRedirectUri;
102371
- const forwardClientId = !usePostLogoutUri && !params.logout && state.clientId;
102551
+ const usePostLogoutUri = state2.postLogoutRedirectUri;
102552
+ const forwardClientId = !usePostLogoutUri && !params.logout && state2.clientId;
102372
102553
  const uri = redirectUri(
102373
- usePostLogoutUri ? state.postLogoutRedirectUri : ctx.oidc.urlFor("end_session_success"),
102554
+ usePostLogoutUri ? state2.postLogoutRedirectUri : ctx.oidc.urlFor("end_session_success"),
102374
102555
  {
102375
- ...usePostLogoutUri && state.state != null ? { state: state.state } : void 0,
102376
- ...forwardClientId ? { client_id: state.clientId } : void 0
102556
+ ...usePostLogoutUri && state2.state != null ? { state: state2.state } : void 0,
102557
+ ...forwardClientId ? { client_id: state2.clientId } : void 0
102377
102558
  }
102378
102559
  );
102379
102560
  ctx.oidc.provider.emit("end_session.success", ctx);
@@ -103302,8 +103483,8 @@ function getClaims(provider) {
103302
103483
  if (Object.keys(this.filter).length) {
103303
103484
  throw new Error("scope cannot be assigned after mask has been set");
103304
103485
  }
103305
- value.split(" ").forEach((scope2) => {
103306
- this.mask(claimConfig[scope2]);
103486
+ value.split(" ").forEach((scope3) => {
103487
+ this.mask(claimConfig[scope3]);
103307
103488
  });
103308
103489
  return this;
103309
103490
  }
@@ -103518,7 +103699,7 @@ var jwt_default = (provider, { opaque }) => {
103518
103699
  jti,
103519
103700
  iat,
103520
103701
  exp,
103521
- scope: scope2,
103702
+ scope: scope3,
103522
103703
  clientId,
103523
103704
  "x5t#S256": x5t2,
103524
103705
  jkt: jkt2,
@@ -103543,7 +103724,7 @@ var jwt_default = (provider, { opaque }) => {
103543
103724
  iat,
103544
103725
  exp,
103545
103726
  authorization_details: rar,
103546
- scope: scope2 || void 0,
103727
+ scope: scope3 || void 0,
103547
103728
  client_id: clientId,
103548
103729
  iss: provider.issuer,
103549
103730
  aud,
@@ -103993,8 +104174,8 @@ function getBaseModel(provider) {
103993
104174
  }
103994
104175
  ttlPercentagePassed() {
103995
104176
  const now = epoch_time_default();
103996
- const percentage = Math.floor(100 * ((now - this.iat) / (this.exp - this.iat)));
103997
- return Math.max(Math.min(100, percentage), 0);
104177
+ const percentage2 = Math.floor(100 * ((now - this.iat) / (this.exp - this.iat)));
104178
+ return Math.max(Math.min(100, percentage2), 0);
103998
104179
  }
103999
104180
  get isValid() {
104000
104181
  return !this.isExpired;
@@ -104692,8 +104873,8 @@ function getSchema(provider) {
104692
104873
  scopes() {
104693
104874
  if (this.scope) {
104694
104875
  const parsed = new Set(this.scope.split(" "));
104695
- parsed.forEach((scope2) => {
104696
- if (!scopes.has(scope2)) {
104876
+ parsed.forEach((scope3) => {
104877
+ if (!scopes.has(scope3)) {
104697
104878
  this.invalidate("scope must only contain Authorization Server supported scope values");
104698
104879
  }
104699
104880
  });
@@ -106097,9 +106278,9 @@ var grant_default = (provider) => class Grant extends apply([
106097
106278
  if (this.rejected) {
106098
106279
  const rejected = this.getOIDCScope.call(this.rejected).split(" ");
106099
106280
  const granted = new Set(this.openid.scope.split(" "));
106100
- for (const scope2 of rejected) {
106101
- if (scope2 !== "openid") {
106102
- granted.delete(scope2);
106281
+ for (const scope3 of rejected) {
106282
+ if (scope3 !== "openid") {
106283
+ granted.delete(scope3);
106103
106284
  }
106104
106285
  }
106105
106286
  return [...granted].join(" ");
@@ -106121,19 +106302,19 @@ var grant_default = (provider) => class Grant extends apply([
106121
106302
  const granted = this.getOIDCScope().split(" ");
106122
106303
  return granted.filter(Set.prototype.has.bind(filter2)).join(" ");
106123
106304
  }
106124
- addOIDCScope(scope2) {
106125
- if (scope2 instanceof Set) {
106126
- scope2 = [...scope2].join(" ");
106127
- } else if (Array.isArray(scope2)) {
106128
- scope2 = scope2.join(" ");
106129
- } else if (typeof scope2 !== "string") {
106305
+ addOIDCScope(scope3) {
106306
+ if (scope3 instanceof Set) {
106307
+ scope3 = [...scope3].join(" ");
106308
+ } else if (Array.isArray(scope3)) {
106309
+ scope3 = scope3.join(" ");
106310
+ } else if (typeof scope3 !== "string") {
106130
106311
  throw new TypeError('"scope" must be a string');
106131
106312
  }
106132
106313
  this.openid ||= {};
106133
106314
  if (this.openid.scope) {
106134
- this.openid.scope = [.../* @__PURE__ */ new Set([...this.openid.scope.split(" "), ...scope2.split(" ")])].join(" ");
106315
+ this.openid.scope = [.../* @__PURE__ */ new Set([...this.openid.scope.split(" "), ...scope3.split(" ")])].join(" ");
106135
106316
  } else {
106136
- this.openid.scope = scope2;
106317
+ this.openid.scope = scope3;
106137
106318
  }
106138
106319
  }
106139
106320
  rejectOIDCScope(...args2) {
@@ -106153,8 +106334,8 @@ var grant_default = (provider) => class Grant extends apply([
106153
106334
  if (this.rejected) {
106154
106335
  const rejected = this.getResourceScope.call(this.rejected, resource).split(" ");
106155
106336
  const granted = new Set(this.resources[resource].split(" "));
106156
- for (const scope2 of rejected) {
106157
- granted.delete(scope2);
106337
+ for (const scope3 of rejected) {
106338
+ granted.delete(scope3);
106158
106339
  }
106159
106340
  return [...granted].join(" ");
106160
106341
  }
@@ -106178,22 +106359,22 @@ var grant_default = (provider) => class Grant extends apply([
106178
106359
  const granted = this.getResourceScope(resource).split(" ");
106179
106360
  return granted.filter(Set.prototype.has.bind(filter2)).join(" ");
106180
106361
  }
106181
- addResourceScope(resource, scope2) {
106362
+ addResourceScope(resource, scope3) {
106182
106363
  if (typeof resource !== "string") {
106183
106364
  throw new TypeError('"resource" must be a string');
106184
106365
  }
106185
- if (scope2 instanceof Set) {
106186
- scope2 = [...scope2].join(" ");
106187
- } else if (Array.isArray(scope2)) {
106188
- scope2 = scope2.join(" ");
106189
- } else if (typeof scope2 !== "string") {
106366
+ if (scope3 instanceof Set) {
106367
+ scope3 = [...scope3].join(" ");
106368
+ } else if (Array.isArray(scope3)) {
106369
+ scope3 = scope3.join(" ");
106370
+ } else if (typeof scope3 !== "string") {
106190
106371
  throw new TypeError('"scope" must be a string');
106191
106372
  }
106192
106373
  this.resources ||= {};
106193
106374
  if (this.resources[resource]) {
106194
- this.resources[resource] = [.../* @__PURE__ */ new Set([...this.resources[resource].split(" "), ...scope2.split(" ")])].join(" ");
106375
+ this.resources[resource] = [.../* @__PURE__ */ new Set([...this.resources[resource].split(" "), ...scope3.split(" ")])].join(" ");
106195
106376
  } else {
106196
- this.resources[resource] = scope2;
106377
+ this.resources[resource] = scope3;
106197
106378
  }
106198
106379
  }
106199
106380
  rejectResourceScope(...args2) {
@@ -107061,9 +107242,10 @@ function buildEligibilityCtes(organizationPredicate) {
107061
107242
  )
107062
107243
  `;
107063
107244
  }
107064
- var LIST_AVAILABILITY_CHECKS_QUERY = `
107245
+ function buildAvailabilityChecksListQuery(organizationPredicate, checkPredicate, limitSql = "$3", cursorSql = "$4") {
107246
+ return `
107065
107247
  WITH
107066
- ${buildEligibilityCtes("AND p.organization_id = $2::uuid")},
107248
+ ${buildEligibilityCtes(`AND ${organizationPredicate}`)},
107067
107249
  ranked AS (
107068
107250
  SELECT
107069
107251
  c.id::text AS check_id,
@@ -107110,8 +107292,8 @@ var LIST_AVAILABILITY_CHECKS_QUERY = `
107110
107292
  LEFT JOIN monitored_project_ranks monitored_ranks
107111
107293
  ON monitored_ranks.organization_id = p.organization_id
107112
107294
  AND monitored_ranks.project_id = c.project_id
107113
- WHERE c.project_id = $1::uuid
107114
- AND p.organization_id = $2::uuid
107295
+ WHERE ${checkPredicate}
107296
+ AND ${organizationPredicate}
107115
107297
  AND c.deleted_at IS NULL
107116
107298
  )
107117
107299
  SELECT
@@ -107122,10 +107304,15 @@ var LIST_AVAILABILITY_CHECKS_QUERY = `
107122
107304
  NOT ranked.enabled OR ranked.organization_check_rank <= ranked.plan_organization_check_limit
107123
107305
  AS within_organization_active_limit
107124
107306
  FROM ranked
107125
- WHERE ($4::text IS NULL OR ranked.check_id = $4)
107307
+ WHERE (${cursorSql}::text IS NULL OR ranked.check_id = ${cursorSql})
107126
107308
  ORDER BY ranked.created_at DESC
107127
- LIMIT $3
107309
+ LIMIT ${limitSql}
107128
107310
  `;
107311
+ }
107312
+ var LIST_AVAILABILITY_CHECKS_QUERY = buildAvailabilityChecksListQuery(
107313
+ "p.organization_id = $2::uuid",
107314
+ "c.project_id = $1::uuid"
107315
+ );
107129
107316
  var CLAIM_DUE_AVAILABILITY_CHECKS_QUERY = `
107130
107317
  WITH due_organizations AS (
107131
107318
  SELECT DISTINCT p.organization_id
@@ -108434,8 +108621,41 @@ function defineStorageSchemaMigration(input2) {
108434
108621
  };
108435
108622
  }
108436
108623
 
108437
- // ../../packages/storage/src/analytics-flow-schema.ts
108624
+ // ../../packages/storage/src/public-status-schema.ts
108438
108625
  var statements = [
108626
+ `CREATE TABLE IF NOT EXISTS public_status_pages (
108627
+ id uuid PRIMARY KEY, anchor_project_id uuid NOT NULL UNIQUE REFERENCES projects(id) ON DELETE CASCADE,
108628
+ owner_user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
108629
+ organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
108630
+ public_id text NOT NULL UNIQUE CHECK (public_id ~ '^[a-f0-9]{24}$'),
108631
+ title text NOT NULL CHECK (length(title) BETWEEN 1 AND 120), enabled boolean NOT NULL DEFAULT false,
108632
+ created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now()
108633
+ )`,
108634
+ `CREATE TABLE IF NOT EXISTS public_status_page_projects (
108635
+ page_id uuid NOT NULL REFERENCES public_status_pages(id) ON DELETE CASCADE,
108636
+ project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
108637
+ position integer NOT NULL CHECK (position BETWEEN 0 AND 49), PRIMARY KEY(page_id, project_id)
108638
+ )`,
108639
+ `CREATE TABLE IF NOT EXISTS public_status_page_checks (
108640
+ page_id uuid NOT NULL, project_id uuid NOT NULL, check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
108641
+ PRIMARY KEY(page_id, check_id), FOREIGN KEY(page_id, project_id) REFERENCES public_status_page_projects(page_id, project_id) ON DELETE CASCADE
108642
+ )`,
108643
+ "CREATE INDEX IF NOT EXISTS public_status_page_projects_project_idx ON public_status_page_projects(project_id)",
108644
+ "CREATE INDEX IF NOT EXISTS public_status_page_checks_check_idx ON public_status_page_checks(check_id)"
108645
+ ];
108646
+ var PUBLIC_STATUS_BOOTSTRAP_STATEMENTS = statements.map(
108647
+ (s) => s.replaceAll(" IF NOT EXISTS", "")
108648
+ );
108649
+ var PUBLIC_STATUS_SCHEMA_MIGRATIONS = [
108650
+ defineStorageSchemaMigration({
108651
+ id: "202610080001_add_public_status_pages",
108652
+ description: "Add opt-in, explicitly selected public availability pages.",
108653
+ statements
108654
+ })
108655
+ ];
108656
+
108657
+ // ../../packages/storage/src/analytics-flow-schema.ts
108658
+ var statements2 = [
108439
108659
  `CREATE TABLE IF NOT EXISTS analytics_flow_definitions (
108440
108660
  id uuid PRIMARY KEY, project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
108441
108661
  flow_key text NOT NULL, version integer NOT NULL DEFAULT 1, definition jsonb NOT NULL,
@@ -108468,18 +108688,18 @@ var statements = [
108468
108688
  )`,
108469
108689
  `CREATE INDEX IF NOT EXISTS analytics_flow_rollups_expiry_idx ON analytics_flow_rollups(cohort_date, flow_id)`
108470
108690
  ];
108471
- var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS = statements.map(
108691
+ var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS = statements2.map(
108472
108692
  (statement) => statement.replaceAll(" IF NOT EXISTS", "")
108473
108693
  );
108474
108694
  var migration = {
108475
108695
  id: "202610030001_add_public_analytics_flows",
108476
108696
  description: "Add customer project flow definitions, bounded continuity and aggregate reports.",
108477
- statements
108697
+ statements: statements2
108478
108698
  };
108479
108699
  var ANALYTICS_FLOW_SCHEMA_MIGRATIONS = [defineStorageSchemaMigration(migration)];
108480
108700
 
108481
108701
  // ../../packages/storage/src/browser-recovery-schema.ts
108482
- var statements2 = [
108702
+ var statements3 = [
108483
108703
  `ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS coalescing_key text`,
108484
108704
  `CREATE INDEX IF NOT EXISTS alert_deliveries_coalescing_idx ON alert_deliveries (alert_id, coalescing_key, created_at) WHERE coalescing_key IS NOT NULL`,
108485
108705
  `CREATE TABLE IF NOT EXISTS browser_recovery_events (
@@ -108501,10 +108721,10 @@ var BROWSER_RECOVERY_MIGRATIONS = [
108501
108721
  defineStorageSchemaMigration({
108502
108722
  id: "202609220001_add_browser_recovery_context",
108503
108723
  description: "Index browser recovery context and separate burst suppression from alert cooldown identity",
108504
- statements: statements2
108724
+ statements: statements3
108505
108725
  })
108506
108726
  ];
108507
- var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS = statements2.filter((statement) => !statement.startsWith("ALTER TABLE")).map((statement) => statement.replaceAll(" IF NOT EXISTS", ""));
108727
+ var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS = statements3.filter((statement) => !statement.startsWith("ALTER TABLE")).map((statement) => statement.replaceAll(" IF NOT EXISTS", ""));
108508
108728
 
108509
108729
  // ../../packages/storage/src/availability-check-bootstrap-statements.ts
108510
108730
  var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
@@ -110480,7 +110700,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS2 = [
110480
110700
  ...AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS,
110481
110701
  ...ANALYTICS_BOOTSTRAP_STATEMENTS,
110482
110702
  ...WORKER_JOB_BOOTSTRAP_STATEMENTS,
110483
- ...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS
110703
+ ...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS,
110704
+ ...PUBLIC_STATUS_BOOTSTRAP_STATEMENTS
110484
110705
  ];
110485
110706
 
110486
110707
  // ../../packages/storage/src/migrations.ts
@@ -112695,9 +112916,18 @@ var STORAGE_SCHEMA_MIGRATIONS2 = [
112695
112916
  ...ANALYTICS_STORAGE_SCHEMA_MIGRATIONS,
112696
112917
  ...OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS,
112697
112918
  ...WORKER_JOB_SCHEMA_MIGRATIONS,
112698
- ...ANALYTICS_FLOW_SCHEMA_MIGRATIONS
112919
+ ...ANALYTICS_FLOW_SCHEMA_MIGRATIONS,
112920
+ ...PUBLIC_STATUS_SCHEMA_MIGRATIONS
112699
112921
  ].sort((left, right) => left.id.localeCompare(right.id));
112700
112922
 
112923
+ // ../../packages/storage/src/public-status-store.ts
112924
+ var eligibleQuery = buildAvailabilityChecksListQuery(
112925
+ "p.organization_id IN (SELECT organization_id FROM page)",
112926
+ "c.project_id IN (SELECT project_id FROM public_status_page_projects WHERE page_id IN (SELECT id FROM page)) AND c.id IN (SELECT check_id FROM public_status_page_checks WHERE page_id IN (SELECT id FROM page))",
112927
+ "500",
112928
+ "NULL"
112929
+ );
112930
+
112701
112931
  // ../cli/src/cloud-artifact-cache.ts
112702
112932
  var import_promises6 = require("node:fs/promises");
112703
112933
  var import_node_path6 = require("node:path");
@@ -113131,15 +113361,15 @@ async function readLocalState(dependencies) {
113131
113361
  throw error2;
113132
113362
  }
113133
113363
  }
113134
- async function writeLocalState(state, dependencies) {
113364
+ async function writeLocalState(state2, dependencies) {
113135
113365
  const rootDirectory = getWorkspaceRoot2(dependencies);
113136
113366
  const writeFile = dependencies?.writeFile ?? import_promises7.writeFile;
113137
- await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(state, null, 2)}
113367
+ await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(state2, null, 2)}
113138
113368
  `, "utf8");
113139
113369
  }
113140
113370
  async function updateLocalIncidentStatus(input2, dependencies) {
113141
- const state = await readLocalState(dependencies);
113142
- const incident = state.incidents[input2.incidentId];
113371
+ const state2 = await readLocalState(dependencies);
113372
+ const incident = state2.incidents[input2.incidentId];
113143
113373
  if (incident === void 0) {
113144
113374
  throw createReadError(404, "incident_not_found");
113145
113375
  }
@@ -113148,8 +113378,8 @@ async function updateLocalIncidentStatus(input2, dependencies) {
113148
113378
  status: input2.status,
113149
113379
  ...input2.status === "resolved" ? { resolved_at: (/* @__PURE__ */ new Date()).toISOString() } : { resolved_at: null }
113150
113380
  };
113151
- state.incidents[input2.incidentId] = nextIncident;
113152
- await writeLocalState(state, dependencies);
113381
+ state2.incidents[input2.incidentId] = nextIncident;
113382
+ await writeLocalState(state2, dependencies);
113153
113383
  return projectLocalEvidence(nextIncident);
113154
113384
  }
113155
113385
  async function listLocalIncidents(input2, dependencies) {
@@ -117192,13 +117422,13 @@ function sortIncidentRecord(incident) {
117192
117422
  source_events: [...incident.source_events].sort(compareEventEnvelopes)
117193
117423
  };
117194
117424
  }
117195
- function serializeState(state) {
117425
+ function serializeState(state2) {
117196
117426
  const incidents = Object.fromEntries(
117197
- Object.entries(state.incidents).sort(([left], [right]) => left.localeCompare(right)).map(([incidentId2, incident]) => [incidentId2, sortIncidentRecord(incident)])
117427
+ Object.entries(state2.incidents).sort(([left], [right]) => left.localeCompare(right)).map(([incidentId2, incident]) => [incidentId2, sortIncidentRecord(incident)])
117198
117428
  );
117199
117429
  return `${JSON.stringify({
117200
117430
  version: 1,
117201
- last_processed_event_file: state.last_processed_event_file,
117431
+ last_processed_event_file: state2.last_processed_event_file,
117202
117432
  incidents
117203
117433
  }, null, 2)}
117204
117434
  `;
@@ -118460,7 +118690,7 @@ async function runValidateCommand(input2, dependencies = {}) {
118460
118690
  }
118461
118691
  }
118462
118692
  checks.push(...agentChecks(report).filter((check5) => check5.name !== "canonical-skill"));
118463
- autoFixAvailable ||= report.agents.some((agent) => [agent.instruction, agent.discovery].some((state) => state === "missing" || state === "stale"));
118693
+ autoFixAvailable ||= report.agents.some((agent) => [agent.instruction, agent.discovery].some((state2) => state2 === "missing" || state2 === "stale"));
118464
118694
  const ignore = await ensureGitignore(rootDirectory, buildManagedGitignoreSection(), input2.fix === true);
118465
118695
  const gitignoreCheck = { name: "gitignore", status: ignore.present ? "ok" : "missing", message: ignore.changed ? `Updated ${GITIGNORE_FILE_PATH}` : `${ignore.present ? "Found" : "Missing"} managed ${GITIGNORE_FILE_PATH} entries` };
118466
118696
  if (gitignoreCheck.status === "missing") {
@@ -119789,6 +120019,7 @@ var MCP_TOOL_CATALOG_OPERATIONS = [
119789
120019
 
119790
120020
  // src/tool-catalog.ts
119791
120021
  var MCP_TOOL_CATALOG = [
120022
+ ...PUBLIC_STATUS_MCP_TOOL_CATALOG,
119792
120023
  ...ANALYTICS_FLOW_MCP_TOOL_CATALOG,
119793
120024
  ...MCP_TOOL_CATALOG_FOUNDATION,
119794
120025
  ...MCP_TOOL_CATALOG_OPERATIONS,
@@ -120206,6 +120437,7 @@ async function createDefaultMcpTools(input2 = {}) {
120206
120437
  ...createAnalyticsJourneySampleApi(httpClient)
120207
120438
  }),
120208
120439
  ...createAnalyticsSettingsMcpTools(createAnalyticsSettingsApi(httpClient)),
120440
+ ...createPublicStatusMcpTools(createPublicStatusApi(httpClient)),
120209
120441
  ...createAnalyticsFlowMcpTools(createAnalyticsFlowApi(httpClient)),
120210
120442
  ...createAnalyticsSavedFunnelMcpTools(createAnalyticsSavedFunnelApi(httpClient)),
120211
120443
  ...createCaptureRuleMcpTools(createCaptureRuleApi(httpClient)),
@@ -120229,7 +120461,7 @@ var import_node_readline = require("node:readline");
120229
120461
  var package_default = {
120230
120462
  name: "@debugbundle/mcp",
120231
120463
  mcpName: "com.debugbundle/mcp",
120232
- version: "1.14.0",
120464
+ version: "1.15.0",
120233
120465
  private: false,
120234
120466
  description: "MCP server for runtime error reporting, incident response, health checks, debug bundles, and product analytics",
120235
120467
  license: "Apache-2.0",