@fruggr/zendesk-mcp-server 3.4.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/{http-DU1dSrPe.js → http-CWM14zJp.js} +88 -62
- package/dist/index.js +2856 -816
- package/dist/pkce-DE_v9NQy.js +60 -0
- package/dist/sbom.cdx.json +10 -10
- package/dist/{token-store-DyO12sbo.js → token-store-CQx_KFe2.js} +16 -7
- package/package.json +4 -4
- package/dist/token-persistence-r0v9RO3q.js +0 -147
package/README.md
CHANGED
|
@@ -224,13 +224,16 @@ clients, MCP client wiring, CORS and what stays the operator's job:
|
|
|
224
224
|
## Tool surface
|
|
225
225
|
|
|
226
226
|
Tools are grouped into namespaces: **Tickets**, **Help Center**, **Users &
|
|
227
|
-
Organizations**, **Search**,
|
|
228
|
-
|
|
227
|
+
Organizations**, **Search**, **Connector preferences** — this server's own
|
|
228
|
+
per-user settings, such as SLA alert thresholds, never written to Zendesk — and
|
|
229
|
+
**Requests** — the end-user surface, which is opt-in and covered under
|
|
230
|
+
[End-user mode](#end-user-mode). The server registers
|
|
229
231
|
them in one of three modes, so you can trade granularity against context budget:
|
|
230
232
|
|
|
231
233
|
- **`all`**: every operation as its own tool, for clients with good tool selection;
|
|
232
234
|
- **`namespace`** (default): one proxy tool per namespace, a balanced middle ground;
|
|
233
|
-
- **`single`**: a single `zendesk` tool, for models with limited tool slots
|
|
235
|
+
- **`single`**: a single `zendesk` tool, for models with limited tool slots (the
|
|
236
|
+
connector's own preferences keep their `connector_preferences` proxy beside it).
|
|
234
237
|
|
|
235
238
|
Proxies take `{ "operation": "<tool_name>", "params": { … } }` and validate
|
|
236
239
|
`params` through the original schema. `--namespace`, `--tool` and `--read-only`
|
|
@@ -4780,7 +4780,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
4780
4780
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
4781
4781
|
```
|
|
4782
4782
|
|
|
4783
|
-
## undici@7.30.
|
|
4783
|
+
## undici@7.30.1
|
|
4784
4784
|
|
|
4785
4785
|
License: MIT
|
|
4786
4786
|
|
|
@@ -5198,7 +5198,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
5198
5198
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
5199
5199
|
```
|
|
5200
5200
|
|
|
5201
|
-
## zod@4.6.
|
|
5201
|
+
## zod@4.6.7
|
|
5202
5202
|
|
|
5203
5203
|
License: MIT
|
|
5204
5204
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import * as util
|
|
2
|
+
import { A as __commonJSMin, C as isLegacyRequest, D as STARTUP_DOCS, E as OAuthErrorCode, M as __require, N as __toESM, O as createStartupError, S as createMcpHandler, T as OAuthError, _ as deadlineSignal, a as watchGrantAlerts, b as DEFAULT_MAX_REQUEST_BODY_SIZE, c as configDir, g as REQUEST_TIMEOUT_MS, h as zendeskGet, i as defaultServerFactory, j as __exportAll, k as errnoCode, m as silentLogger, n as listenedUris, o as startSlaRuntime, p as createRequestStateCodec, r as createServerCaches, t as createListenFeed, w as verifyBearerToken, x as WebStandardStreamableHTTPServerTransport, y as getOAuthUrls } from "./index.js";
|
|
3
|
+
import { a as supportedScopes, i as requestedScope, n as generateCodeVerifier, o as escapeHtml, t as generateCodeChallenge } from "./pkce-DE_v9NQy.js";
|
|
4
|
+
import * as util from "node:util";
|
|
5
5
|
import { format, inspect } from "node:util";
|
|
6
6
|
import * as crypto$2 from "node:crypto";
|
|
7
7
|
import { createHash, createPrivateKey, createSecretKey, hkdfSync, randomBytes, randomFillSync, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -3565,7 +3565,7 @@ var require_depd$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3565
3565
|
/**
|
|
3566
3566
|
* Module dependencies.
|
|
3567
3567
|
*/
|
|
3568
|
-
var relative
|
|
3568
|
+
var relative = __require("path").relative;
|
|
3569
3569
|
/**
|
|
3570
3570
|
* Module exports.
|
|
3571
3571
|
*/
|
|
@@ -3768,7 +3768,7 @@ var require_depd$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3768
3768
|
* Format call site location.
|
|
3769
3769
|
*/
|
|
3770
3770
|
function formatLocation(callSite) {
|
|
3771
|
-
return relative
|
|
3771
|
+
return relative(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
3772
3772
|
}
|
|
3773
3773
|
/**
|
|
3774
3774
|
* Get the stack as array of call sites.
|
|
@@ -3905,10 +3905,10 @@ var require_inherits_browser = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
3905
3905
|
//#region node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js
|
|
3906
3906
|
var require_inherits = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3907
3907
|
try {
|
|
3908
|
-
var util
|
|
3908
|
+
var util = __require("util");
|
|
3909
3909
|
/* istanbul ignore next */
|
|
3910
|
-
if (typeof util
|
|
3911
|
-
module.exports = util
|
|
3910
|
+
if (typeof util.inherits !== "function") throw "";
|
|
3911
|
+
module.exports = util.inherits;
|
|
3912
3912
|
} catch (e) {
|
|
3913
3913
|
/* istanbul ignore next */
|
|
3914
3914
|
module.exports = require_inherits_browser();
|
|
@@ -4110,7 +4110,7 @@ var require_http_errors$1 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
4110
4110
|
* Populate the exports object with constructors for every error class.
|
|
4111
4111
|
* @private
|
|
4112
4112
|
*/
|
|
4113
|
-
function populateConstructorExports(exports
|
|
4113
|
+
function populateConstructorExports(exports, codes, HttpError) {
|
|
4114
4114
|
codes.forEach(function forEachCode(code) {
|
|
4115
4115
|
var CodeError;
|
|
4116
4116
|
var name = toIdentifier(statuses.message[code]);
|
|
@@ -4121,8 +4121,8 @@ var require_http_errors$1 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
4121
4121
|
case 500: CodeError = createServerErrorConstructor(HttpError, name, code);
|
|
4122
4122
|
}
|
|
4123
4123
|
if (CodeError) {
|
|
4124
|
-
exports
|
|
4125
|
-
exports
|
|
4124
|
+
exports[code] = CodeError;
|
|
4125
|
+
exports[name] = CodeError;
|
|
4126
4126
|
}
|
|
4127
4127
|
});
|
|
4128
4128
|
}
|
|
@@ -11867,7 +11867,7 @@ var require_mime_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11867
11867
|
* @private
|
|
11868
11868
|
*/
|
|
11869
11869
|
var db = require_mime_db$1();
|
|
11870
|
-
var extname
|
|
11870
|
+
var extname = __require("path").extname;
|
|
11871
11871
|
/**
|
|
11872
11872
|
* Module variables.
|
|
11873
11873
|
* @private
|
|
@@ -11937,7 +11937,7 @@ var require_mime_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11937
11937
|
*/
|
|
11938
11938
|
function lookup(path) {
|
|
11939
11939
|
if (!path || typeof path !== "string") return false;
|
|
11940
|
-
var extension = extname
|
|
11940
|
+
var extension = extname("x." + path).toLowerCase().substr(1);
|
|
11941
11941
|
if (!extension) return false;
|
|
11942
11942
|
return exports.types[extension] || false;
|
|
11943
11943
|
}
|
|
@@ -12389,10 +12389,10 @@ var require_parseurl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
12389
12389
|
//#endregion
|
|
12390
12390
|
//#region node_modules/.pnpm/koa@3.2.1/node_modules/koa/lib/search-params.js
|
|
12391
12391
|
var require_search_params = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12392
|
-
const URLSearchParams
|
|
12392
|
+
const URLSearchParams = __require("url").URLSearchParams;
|
|
12393
12393
|
module.exports = {
|
|
12394
12394
|
stringify: (obj) => {
|
|
12395
|
-
const searchParams = new URLSearchParams
|
|
12395
|
+
const searchParams = new URLSearchParams();
|
|
12396
12396
|
const addKey = (k, v, params) => {
|
|
12397
12397
|
const val = typeof v === "string" || typeof v === "number" ? v : "";
|
|
12398
12398
|
params.append(k, val);
|
|
@@ -12404,7 +12404,7 @@ var require_search_params = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
12404
12404
|
return searchParams.toString();
|
|
12405
12405
|
},
|
|
12406
12406
|
parse: (str) => {
|
|
12407
|
-
const searchParams = new URLSearchParams
|
|
12407
|
+
const searchParams = new URLSearchParams(str);
|
|
12408
12408
|
const obj = {};
|
|
12409
12409
|
for (const key of searchParams.keys()) {
|
|
12410
12410
|
const values = searchParams.getAll(key);
|
|
@@ -20271,7 +20271,7 @@ var require_mime_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20271
20271
|
* @private
|
|
20272
20272
|
*/
|
|
20273
20273
|
var db = require_mime_db();
|
|
20274
|
-
var extname
|
|
20274
|
+
var extname = __require("path").extname;
|
|
20275
20275
|
var mimeScore = require_mimeScore();
|
|
20276
20276
|
/**
|
|
20277
20277
|
* Module variables.
|
|
@@ -20343,7 +20343,7 @@ var require_mime_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20343
20343
|
*/
|
|
20344
20344
|
function lookup(path) {
|
|
20345
20345
|
if (!path || typeof path !== "string") return false;
|
|
20346
|
-
var extension = extname
|
|
20346
|
+
var extension = extname("x." + path).toLowerCase().slice(1);
|
|
20347
20347
|
if (!extension) return false;
|
|
20348
20348
|
return exports.types[extension] || false;
|
|
20349
20349
|
}
|
|
@@ -20743,7 +20743,7 @@ var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
20743
20743
|
/**
|
|
20744
20744
|
* Module dependencies.
|
|
20745
20745
|
*/
|
|
20746
|
-
const URL
|
|
20746
|
+
const URL = __require("url").URL;
|
|
20747
20747
|
const net = __require("net");
|
|
20748
20748
|
const accepts = require_accepts();
|
|
20749
20749
|
const contentType = require_content_type();
|
|
@@ -20753,7 +20753,7 @@ var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
20753
20753
|
const typeis = require_type_is();
|
|
20754
20754
|
const fresh = require_fresh();
|
|
20755
20755
|
const only = require_only();
|
|
20756
|
-
const util
|
|
20756
|
+
const util = __require("util");
|
|
20757
20757
|
const IP = Symbol("context#ip");
|
|
20758
20758
|
/**
|
|
20759
20759
|
* Prototype.
|
|
@@ -20950,7 +20950,7 @@ var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
20950
20950
|
if (!host) return "";
|
|
20951
20951
|
host = splitCommaSeparatedValues(host, 1)[0];
|
|
20952
20952
|
if (host.includes("@")) try {
|
|
20953
|
-
host = new URL
|
|
20953
|
+
host = new URL(`http://${host}`).host;
|
|
20954
20954
|
} catch (e) {
|
|
20955
20955
|
return "";
|
|
20956
20956
|
}
|
|
@@ -20982,7 +20982,7 @@ var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
20982
20982
|
if (!this.memoizedURL) {
|
|
20983
20983
|
const originalUrl = this.originalUrl || "";
|
|
20984
20984
|
try {
|
|
20985
|
-
this.memoizedURL = new URL
|
|
20985
|
+
this.memoizedURL = new URL(`${this.protocol}://${this.host}${originalUrl}`);
|
|
20986
20986
|
} catch (err) {
|
|
20987
20987
|
this.memoizedURL = Object.create(null);
|
|
20988
20988
|
}
|
|
@@ -21356,7 +21356,7 @@ var require_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
21356
21356
|
* @api public
|
|
21357
21357
|
*/
|
|
21358
21358
|
/* istanbul ignore else */
|
|
21359
|
-
if (util
|
|
21359
|
+
if (util.inspect.custom) module.exports[util.inspect.custom] = module.exports.inspect;
|
|
21360
21360
|
/**
|
|
21361
21361
|
* Split a comma-separated value string into an array of values, with an optional limit.
|
|
21362
21362
|
* All the values are trimmed of whitespace.
|
|
@@ -21744,9 +21744,9 @@ var require_destroy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
21744
21744
|
* Module dependencies.
|
|
21745
21745
|
* @private
|
|
21746
21746
|
*/
|
|
21747
|
-
var EventEmitter
|
|
21747
|
+
var EventEmitter = __require("events").EventEmitter;
|
|
21748
21748
|
var ReadStream = __require("fs").ReadStream;
|
|
21749
|
-
var Stream
|
|
21749
|
+
var Stream = __require("stream");
|
|
21750
21750
|
var Zlib = __require("zlib");
|
|
21751
21751
|
/**
|
|
21752
21752
|
* Module exports.
|
|
@@ -21822,7 +21822,7 @@ var require_destroy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
21822
21822
|
stream._needDrain = true;
|
|
21823
21823
|
stream.once("drain", onDrainClearBinding);
|
|
21824
21824
|
} else stream._binding.clear();
|
|
21825
|
-
} else if (stream._destroy && stream._destroy !== Stream
|
|
21825
|
+
} else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) stream.destroy();
|
|
21826
21826
|
else if (stream._destroy && typeof stream.close === "function") {
|
|
21827
21827
|
stream.destroyed = true;
|
|
21828
21828
|
stream.close();
|
|
@@ -21836,14 +21836,14 @@ var require_destroy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
21836
21836
|
* @private
|
|
21837
21837
|
*/
|
|
21838
21838
|
function hasDestroy(stream) {
|
|
21839
|
-
return stream instanceof Stream
|
|
21839
|
+
return stream instanceof Stream && typeof stream.destroy === "function";
|
|
21840
21840
|
}
|
|
21841
21841
|
/**
|
|
21842
21842
|
* Determine if val is EventEmitter.
|
|
21843
21843
|
* @private
|
|
21844
21844
|
*/
|
|
21845
21845
|
function isEventEmitter(val) {
|
|
21846
|
-
return val instanceof EventEmitter
|
|
21846
|
+
return val instanceof EventEmitter;
|
|
21847
21847
|
}
|
|
21848
21848
|
/**
|
|
21849
21849
|
* Determine if stream is fs.ReadStream stream.
|
|
@@ -22020,9 +22020,9 @@ var require_vary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
22020
22020
|
//#endregion
|
|
22021
22021
|
//#region node_modules/.pnpm/koa@3.2.1/node_modules/koa/lib/is-stream.js
|
|
22022
22022
|
var require_is_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
22023
|
-
const Stream
|
|
22023
|
+
const Stream = __require("stream");
|
|
22024
22024
|
module.exports = (stream) => {
|
|
22025
|
-
return stream instanceof Stream
|
|
22025
|
+
return stream instanceof Stream || stream !== null && typeof stream === "object" && !!stream.readable && typeof stream.pipe === "function" && typeof stream.read === "function" && typeof stream.readable === "boolean" && typeof stream.readableObjectMode === "boolean" && typeof stream.destroy === "function" && typeof stream.destroyed === "boolean";
|
|
22026
22026
|
};
|
|
22027
22027
|
}));
|
|
22028
22028
|
//#endregion
|
|
@@ -22033,7 +22033,7 @@ var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
22033
22033
|
*/
|
|
22034
22034
|
const assert = __require("node:assert");
|
|
22035
22035
|
const extname = __require("node:path").extname;
|
|
22036
|
-
const util
|
|
22036
|
+
const util = __require("node:util");
|
|
22037
22037
|
const contentDisposition = require_content_disposition();
|
|
22038
22038
|
const onFinish = require_on_finished();
|
|
22039
22039
|
const escape = require_escape_html();
|
|
@@ -22535,7 +22535,7 @@ var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
22535
22535
|
* @api public
|
|
22536
22536
|
*/
|
|
22537
22537
|
/* istanbul ignore else */
|
|
22538
|
-
if (util
|
|
22538
|
+
if (util.inspect.custom) module.exports[util.inspect.custom] = module.exports.inspect;
|
|
22539
22539
|
}));
|
|
22540
22540
|
//#endregion
|
|
22541
22541
|
//#region node_modules/.pnpm/depd@1.1.2/node_modules/depd/lib/compat/callsite-tostring.js
|
|
@@ -23322,7 +23322,7 @@ var require_http_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23322
23322
|
* Populate the exports object with constructors for every error class.
|
|
23323
23323
|
* @private
|
|
23324
23324
|
*/
|
|
23325
|
-
function populateConstructorExports(exports
|
|
23325
|
+
function populateConstructorExports(exports, codes, HttpError) {
|
|
23326
23326
|
codes.forEach(function forEachCode(code) {
|
|
23327
23327
|
var CodeError;
|
|
23328
23328
|
var name = toIdentifier(statuses[code]);
|
|
@@ -23333,11 +23333,11 @@ var require_http_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23333
23333
|
case 500: CodeError = createServerErrorConstructor(HttpError, name, code);
|
|
23334
23334
|
}
|
|
23335
23335
|
if (CodeError) {
|
|
23336
|
-
exports
|
|
23337
|
-
exports
|
|
23336
|
+
exports[code] = CodeError;
|
|
23337
|
+
exports[name] = CodeError;
|
|
23338
23338
|
}
|
|
23339
23339
|
});
|
|
23340
|
-
exports
|
|
23340
|
+
exports["I'mateapot"] = deprecate.function(exports.ImATeapot, "\"I'mateapot\"; use \"ImATeapot\" instead");
|
|
23341
23341
|
}
|
|
23342
23342
|
/**
|
|
23343
23343
|
* Get a class name from a name identifier.
|
|
@@ -23566,18 +23566,18 @@ var require_delegates = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23566
23566
|
//#endregion
|
|
23567
23567
|
//#region node_modules/.pnpm/tsscmp@1.0.6/node_modules/tsscmp/lib/index.js
|
|
23568
23568
|
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
23569
|
-
var crypto
|
|
23569
|
+
var crypto = __require("crypto");
|
|
23570
23570
|
function bufferEqual(a, b) {
|
|
23571
23571
|
if (a.length !== b.length) return false;
|
|
23572
|
-
if (crypto
|
|
23572
|
+
if (crypto.timingSafeEqual) return crypto.timingSafeEqual(a, b);
|
|
23573
23573
|
for (var i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
|
|
23574
23574
|
return true;
|
|
23575
23575
|
}
|
|
23576
23576
|
function timeSafeCompare(a, b) {
|
|
23577
23577
|
var sa = String(a);
|
|
23578
23578
|
var sb = String(b);
|
|
23579
|
-
var key = crypto
|
|
23580
|
-
return bufferEqual(crypto
|
|
23579
|
+
var key = crypto.pseudoRandomBytes(32);
|
|
23580
|
+
return bufferEqual(crypto.createHmac("sha256", key).update(sa).digest(), crypto.createHmac("sha256", key).update(sb).digest()) && a === b;
|
|
23581
23581
|
}
|
|
23582
23582
|
module.exports = timeSafeCompare;
|
|
23583
23583
|
}));
|
|
@@ -23590,14 +23590,14 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23590
23590
|
*/
|
|
23591
23591
|
var require_keygrip = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
23592
23592
|
var compare = require_lib();
|
|
23593
|
-
var crypto
|
|
23593
|
+
var crypto = __require("crypto");
|
|
23594
23594
|
function Keygrip(keys, algorithm, encoding) {
|
|
23595
23595
|
if (!algorithm) algorithm = "sha1";
|
|
23596
23596
|
if (!encoding) encoding = "base64";
|
|
23597
23597
|
if (!(this instanceof Keygrip)) return new Keygrip(keys, algorithm, encoding);
|
|
23598
23598
|
if (!keys || !(0 in keys)) throw new Error("Keys must be provided.");
|
|
23599
23599
|
function sign(data, key) {
|
|
23600
|
-
return crypto
|
|
23600
|
+
return crypto.createHmac(algorithm, key).update(data).digest(encoding).replace(/\/|\+|=/g, function(x) {
|
|
23601
23601
|
return {
|
|
23602
23602
|
"/": "_",
|
|
23603
23603
|
"+": "-",
|
|
@@ -23632,7 +23632,7 @@ var require_keygrip = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23632
23632
|
var require_cookies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
23633
23633
|
var deprecate = require_depd$1()("cookies");
|
|
23634
23634
|
var Keygrip = require_keygrip();
|
|
23635
|
-
var http
|
|
23635
|
+
var http = __require("http");
|
|
23636
23636
|
/**
|
|
23637
23637
|
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
23638
23638
|
*
|
|
@@ -23739,7 +23739,7 @@ var require_cookies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23739
23739
|
cookie.name += ".sig";
|
|
23740
23740
|
pushCookie(headers, cookie);
|
|
23741
23741
|
}
|
|
23742
|
-
(res.set ? http
|
|
23742
|
+
(res.set ? http.OutgoingMessage.prototype.setHeader : res.setHeader).call(res, "Set-Cookie", headers);
|
|
23743
23743
|
return this;
|
|
23744
23744
|
};
|
|
23745
23745
|
function Cookie(name, value, attrs) {
|
|
@@ -23834,7 +23834,7 @@ var require_context = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23834
23834
|
/**
|
|
23835
23835
|
* Module dependencies.
|
|
23836
23836
|
*/
|
|
23837
|
-
const util
|
|
23837
|
+
const util = __require("util");
|
|
23838
23838
|
const createError = require_http_errors$1();
|
|
23839
23839
|
const httpAssert = require_http_assert();
|
|
23840
23840
|
const delegate = require_delegates();
|
|
@@ -23922,7 +23922,7 @@ var require_context = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23922
23922
|
*/
|
|
23923
23923
|
onerror(err) {
|
|
23924
23924
|
if (err == null) return;
|
|
23925
|
-
if (!(Object.prototype.toString.call(err) === "[object Error]" || err instanceof Error)) err = new Error(util
|
|
23925
|
+
if (!(Object.prototype.toString.call(err) === "[object Error]" || err instanceof Error)) err = new Error(util.format("non-error thrown: %j", err));
|
|
23926
23926
|
let headerSent = false;
|
|
23927
23927
|
if (this.headerSent || !this.writable) headerSent = err.headerSent = true;
|
|
23928
23928
|
this.app.emit("error", err, this);
|
|
@@ -23959,7 +23959,7 @@ var require_context = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23959
23959
|
* @api public
|
|
23960
23960
|
*/
|
|
23961
23961
|
/* istanbul ignore else */
|
|
23962
|
-
if (util
|
|
23962
|
+
if (util.inspect.custom) module.exports[util.inspect.custom] = module.exports.inspect;
|
|
23963
23963
|
/**
|
|
23964
23964
|
* Response delegation.
|
|
23965
23965
|
*/
|
|
@@ -23975,13 +23975,13 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
23975
23975
|
/**
|
|
23976
23976
|
* Module dependencies.
|
|
23977
23977
|
*/
|
|
23978
|
-
const util
|
|
23978
|
+
const util = __require("node:util");
|
|
23979
23979
|
const v8 = __require("node:v8");
|
|
23980
|
-
const debug = util
|
|
23980
|
+
const debug = util.debuglog("koa:application");
|
|
23981
23981
|
const Emitter = __require("node:events");
|
|
23982
23982
|
const Stream = __require("node:stream");
|
|
23983
23983
|
const http = __require("node:http");
|
|
23984
|
-
const { AsyncLocalStorage
|
|
23984
|
+
const { AsyncLocalStorage } = __require("node:async_hooks");
|
|
23985
23985
|
const onFinished = require_on_finished();
|
|
23986
23986
|
const compose = require_koa_compose();
|
|
23987
23987
|
const statuses = require_statuses$1();
|
|
@@ -24007,8 +24007,8 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
24007
24007
|
* Inherits from `Emitter.prototype`.
|
|
24008
24008
|
*/
|
|
24009
24009
|
function getAsyncLocalStorage(options) {
|
|
24010
|
-
if (options.asyncLocalStorage instanceof AsyncLocalStorage
|
|
24011
|
-
return new AsyncLocalStorage
|
|
24010
|
+
if (options.asyncLocalStorage instanceof AsyncLocalStorage) return options.asyncLocalStorage;
|
|
24011
|
+
return new AsyncLocalStorage();
|
|
24012
24012
|
}
|
|
24013
24013
|
module.exports = class Application extends Emitter {
|
|
24014
24014
|
/**
|
|
@@ -24044,7 +24044,7 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
24044
24044
|
this.request = Object.create(request);
|
|
24045
24045
|
this.response = Object.create(response);
|
|
24046
24046
|
/* istanbul ignore else */
|
|
24047
|
-
if (util
|
|
24047
|
+
if (util.inspect.custom) this[util.inspect.custom] = this.inspect;
|
|
24048
24048
|
if (options.asyncLocalStorage) {
|
|
24049
24049
|
if (v8.startupSnapshot?.isBuildingSnapshot?.()) {
|
|
24050
24050
|
this.ctxStorage = null;
|
|
@@ -24175,7 +24175,7 @@ var require_application = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
24175
24175
|
* @api private
|
|
24176
24176
|
*/
|
|
24177
24177
|
onerror(err) {
|
|
24178
|
-
if (!(Object.prototype.toString.call(err) === "[object Error]" || err instanceof Error)) throw new TypeError(util
|
|
24178
|
+
if (!(Object.prototype.toString.call(err) === "[object Error]" || err instanceof Error)) throw new TypeError(util.format("non-error thrown: %j", err));
|
|
24179
24179
|
if (err.status === 404 || err.expose) return;
|
|
24180
24180
|
if (this.silent) return;
|
|
24181
24181
|
const msg = err.stack || err.toString();
|
|
@@ -26955,7 +26955,7 @@ function initializeAdapter(adapter = MemoryAdapter) {
|
|
|
26955
26955
|
Adapter = createMemoryAdapter(get$2(this).configuration.clockTolerance);
|
|
26956
26956
|
} else {
|
|
26957
26957
|
const constructable = type_validators_default(adapter);
|
|
26958
|
-
const executable = typeof adapter === "function" && !util
|
|
26958
|
+
const executable = typeof adapter === "function" && !util.types.isAsyncFunction(adapter);
|
|
26959
26959
|
if (!constructable && !executable) throw new Error("Expected \"adapter\" to be a constructor or a factory function, provide a valid adapter in Provider config.");
|
|
26960
26960
|
}
|
|
26961
26961
|
get$2(this).Adapter = Adapter;
|
|
@@ -28992,7 +28992,7 @@ var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
28992
28992
|
//#region node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
28993
28993
|
var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28994
28994
|
const os = __require("os");
|
|
28995
|
-
const tty
|
|
28995
|
+
const tty = __require("tty");
|
|
28996
28996
|
const hasFlag = require_has_flag();
|
|
28997
28997
|
const { env } = process;
|
|
28998
28998
|
let forceColor;
|
|
@@ -29054,8 +29054,8 @@ var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
29054
29054
|
}
|
|
29055
29055
|
module.exports = {
|
|
29056
29056
|
supportsColor: getSupportLevel,
|
|
29057
|
-
stdout: translateLevel(supportsColor(true, tty
|
|
29058
|
-
stderr: translateLevel(supportsColor(true, tty
|
|
29057
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
29058
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
29059
29059
|
};
|
|
29060
29060
|
}));
|
|
29061
29061
|
//#endregion
|
|
@@ -35898,7 +35898,7 @@ var Provider = class extends koa_default {
|
|
|
35898
35898
|
return als_default.getStore();
|
|
35899
35899
|
}
|
|
35900
35900
|
};
|
|
35901
|
-
Object.defineProperty(Provider.prototype, "app", { get: util
|
|
35901
|
+
Object.defineProperty(Provider.prototype, "app", { get: util.deprecate(function app() {
|
|
35902
35902
|
return this;
|
|
35903
35903
|
}, ".app getter is deprecated. The Provider instance is now the Koa app itself") });
|
|
35904
35904
|
//#endregion
|
|
@@ -36703,7 +36703,6 @@ const sendUnauthorized = (res, issuer) => {
|
|
|
36703
36703
|
sendJsonRpcError(res, 401, -32e3, MISSING_BEARER_MESSAGE, { "WWW-Authenticate": wwwAuthenticate });
|
|
36704
36704
|
};
|
|
36705
36705
|
const asNodeRequest = (req) => req;
|
|
36706
|
-
const isListenRequest = (body) => typeof body === "object" && body !== null && body.method === "subscriptions/listen";
|
|
36707
36706
|
const MAX_BODY_BYTES = 4194304;
|
|
36708
36707
|
const readJsonBody = (req, maxBodyBytes) => new Promise((resolve) => {
|
|
36709
36708
|
const chunks = [];
|
|
@@ -36772,6 +36771,7 @@ const startHttpTransport = async (config, logger = silentLogger, options = {}) =
|
|
|
36772
36771
|
const buildAuthorizationServer = await prepareAuthorizationServer(config, logger);
|
|
36773
36772
|
let authorizationServer;
|
|
36774
36773
|
const sessions = /* @__PURE__ */ new Map();
|
|
36774
|
+
const sla = startSlaRuntime(config);
|
|
36775
36775
|
const idleTimeoutMs = options.sessionIdleTimeoutMs ?? SESSION_IDLE_TIMEOUT_MS;
|
|
36776
36776
|
const maxBodyBytes = options.maxBodyBytes ?? 4194304;
|
|
36777
36777
|
const serverFactory = options.serverFactory ?? defaultServerFactory;
|
|
@@ -36807,6 +36807,7 @@ const startHttpTransport = async (config, logger = silentLogger, options = {}) =
|
|
|
36807
36807
|
getToken: () => auth.zendeskToken,
|
|
36808
36808
|
logger,
|
|
36809
36809
|
onUnauthorized: () => void as.revokeGrant(auth.grantId),
|
|
36810
|
+
slaRuntime: sla.runtime,
|
|
36810
36811
|
requestStateCodec: createRequestStateCodec({
|
|
36811
36812
|
key: as.requestStateKey,
|
|
36812
36813
|
principal: () => auth.grantId
|
|
@@ -36860,18 +36861,36 @@ const startHttpTransport = async (config, logger = silentLogger, options = {}) =
|
|
|
36860
36861
|
onUnauthorized,
|
|
36861
36862
|
caches,
|
|
36862
36863
|
requestStateCodec,
|
|
36864
|
+
slaRuntime: sla.runtime,
|
|
36865
|
+
alertPolling: "grant",
|
|
36863
36866
|
notifyResourceUpdated: (uri) => handler.notify.resourceUpdated(uri)
|
|
36864
36867
|
});
|
|
36865
36868
|
}, {
|
|
36866
36869
|
legacy: "reject",
|
|
36867
36870
|
onerror: (err) => logger.debug("mcp_request_rejected", { error: err.message })
|
|
36868
36871
|
});
|
|
36872
|
+
const listens = createListenFeed();
|
|
36873
|
+
const stopAlerts = watchGrantAlerts({
|
|
36874
|
+
config,
|
|
36875
|
+
getToken,
|
|
36876
|
+
caches,
|
|
36877
|
+
slaRuntime: sla.runtime,
|
|
36878
|
+
logger,
|
|
36879
|
+
listens,
|
|
36880
|
+
notify: (uri) => handler.notify.resourceUpdated(uri),
|
|
36881
|
+
onUnauthorized
|
|
36882
|
+
});
|
|
36869
36883
|
const entry = {
|
|
36870
36884
|
auth,
|
|
36871
36885
|
revoked: false,
|
|
36872
36886
|
inFlight: 0,
|
|
36887
|
+
listens,
|
|
36873
36888
|
handle: toNodeHandler(handler),
|
|
36874
|
-
close: () =>
|
|
36889
|
+
close: () => {
|
|
36890
|
+
stopAlerts();
|
|
36891
|
+
listens.closeAll();
|
|
36892
|
+
return handler.close();
|
|
36893
|
+
}
|
|
36875
36894
|
};
|
|
36876
36895
|
return entry;
|
|
36877
36896
|
};
|
|
@@ -36890,7 +36909,13 @@ const startHttpTransport = async (config, logger = silentLogger, options = {}) =
|
|
|
36890
36909
|
expiresAt: token.expiresAt,
|
|
36891
36910
|
extra: { verified: token }
|
|
36892
36911
|
};
|
|
36893
|
-
const
|
|
36912
|
+
const listened = listenedUris(body);
|
|
36913
|
+
const counted = listened === void 0;
|
|
36914
|
+
if (listened) {
|
|
36915
|
+
const stream = Symbol("listen");
|
|
36916
|
+
res.once("close", () => entry.listens.close(stream));
|
|
36917
|
+
entry.listens.open(stream, listened);
|
|
36918
|
+
}
|
|
36894
36919
|
if (counted) entry.inFlight += 1;
|
|
36895
36920
|
try {
|
|
36896
36921
|
await entry.handle(request, res, body);
|
|
@@ -37004,6 +37029,7 @@ const startHttpTransport = async (config, logger = silentLogger, options = {}) =
|
|
|
37004
37029
|
port: boundPort,
|
|
37005
37030
|
close: async () => {
|
|
37006
37031
|
clearInterval(sweeper);
|
|
37032
|
+
sla.stop();
|
|
37007
37033
|
await Promise.all([...sessions.values()].map((session) => session.close()));
|
|
37008
37034
|
sessions.clear();
|
|
37009
37035
|
await grants.closeAll();
|