@theokit/sdk 4.37.1 → 4.37.2
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/CHANGELOG.md +6 -0
- package/dist/{agent-GV36S2CF.js → agent-DW2J37IH.js} +3 -3
- package/dist/{agent-GV36S2CF.js.map → agent-DW2J37IH.js.map} +1 -1
- package/dist/{agent-4MHQUGO5.cjs → agent-IE6IE4NW.cjs} +4 -4
- package/dist/{agent-4MHQUGO5.cjs.map → agent-IE6IE4NW.cjs.map} +1 -1
- package/dist/{chunk-KDDL5HKQ.cjs → chunk-G6AASL5T.cjs} +5 -5
- package/dist/{chunk-KDDL5HKQ.cjs.map → chunk-G6AASL5T.cjs.map} +1 -1
- package/dist/{chunk-SSH2ZAZF.js → chunk-T4QWDOG6.js} +3 -3
- package/dist/{chunk-SSH2ZAZF.js.map → chunk-T4QWDOG6.js.map} +1 -1
- package/dist/{chunk-XJLGRJ7K.js → chunk-VYJSHGAY.js} +28 -3
- package/dist/chunk-VYJSHGAY.js.map +1 -0
- package/dist/{chunk-S3WZ7NHF.cjs → chunk-W52DKZBR.cjs} +30 -5
- package/dist/chunk-W52DKZBR.cjs.map +1 -0
- package/dist/cron.cjs +3 -3
- package/dist/cron.js +2 -2
- package/dist/eval.cjs +2 -2
- package/dist/eval.js +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-S3WZ7NHF.cjs.map +0 -1
- package/dist/chunk-XJLGRJ7K.js.map +0 -1
|
@@ -3294,7 +3294,7 @@ var HISTOGRAM_NAMES = {
|
|
|
3294
3294
|
};
|
|
3295
3295
|
function safeRequire(moduleName) {
|
|
3296
3296
|
try {
|
|
3297
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3297
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-W52DKZBR.cjs', document.baseURI).href)));
|
|
3298
3298
|
return r(moduleName);
|
|
3299
3299
|
} catch {
|
|
3300
3300
|
return void 0;
|
|
@@ -3519,7 +3519,7 @@ var cachedOtel;
|
|
|
3519
3519
|
function loadOtel() {
|
|
3520
3520
|
if (cachedOtel === void 0) {
|
|
3521
3521
|
try {
|
|
3522
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3522
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-W52DKZBR.cjs', document.baseURI).href)));
|
|
3523
3523
|
const mod = r("@opentelemetry/api");
|
|
3524
3524
|
cachedOtel = mod;
|
|
3525
3525
|
} catch {
|
|
@@ -6904,6 +6904,31 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
6904
6904
|
* Never overwritten by a later one: a server that re-issues mid-session would otherwise split
|
|
6905
6905
|
* the session in two, and the second half would not see the first half's state.
|
|
6906
6906
|
*/
|
|
6907
|
+
/**
|
|
6908
|
+
* Read one JSON-RPC response, in either encoding the server may choose.
|
|
6909
|
+
*
|
|
6910
|
+
* Streamable HTTP lets the server answer a POST with `application/json` OR `text/event-stream`,
|
|
6911
|
+
* and the client advertises both. Reading the body with `response.json()` unconditionally is what
|
|
6912
|
+
* turned a working server into `Unexpected token 'e', "event: mes"... is not valid JSON` the
|
|
6913
|
+
* moment the Accept header started asking for SSE — measured against a real server, not imagined.
|
|
6914
|
+
*
|
|
6915
|
+
* Only the `data:` payload is JSON; `event:` / `id:` / `retry:` lines and comments are framing.
|
|
6916
|
+
* A single JSON-RPC reply arrives as one event, so the FIRST parseable `data:` is the answer.
|
|
6917
|
+
*/
|
|
6918
|
+
async readBody(response) {
|
|
6919
|
+
const tipo = response.headers.get("content-type") ?? "";
|
|
6920
|
+
if (!tipo.includes("text/event-stream")) return await response.json();
|
|
6921
|
+
const texto = await response.text();
|
|
6922
|
+
for (const linha of texto.split(/\r?\n/)) {
|
|
6923
|
+
if (!linha.startsWith("data:")) continue;
|
|
6924
|
+
const carga = linha.slice(5).trim();
|
|
6925
|
+
if (carga === "") continue;
|
|
6926
|
+
return JSON.parse(carga);
|
|
6927
|
+
}
|
|
6928
|
+
throw new chunkMHCKWQR3_cjs.NetworkError(`MCP ${this.name} returned an event stream with no data payload`, {
|
|
6929
|
+
code: "mcp_http_error"
|
|
6930
|
+
});
|
|
6931
|
+
}
|
|
6907
6932
|
captureSession(response) {
|
|
6908
6933
|
if (this.sessionId !== void 0) return;
|
|
6909
6934
|
const issued = response.headers.get("mcp-session-id");
|
|
@@ -6934,7 +6959,7 @@ var HttpMcpClient = class extends BaseMcpClient {
|
|
|
6934
6959
|
}
|
|
6935
6960
|
this.captureSession(response);
|
|
6936
6961
|
try {
|
|
6937
|
-
return await
|
|
6962
|
+
return await this.readBody(response);
|
|
6938
6963
|
} catch (cause) {
|
|
6939
6964
|
if (isAbortLike(cause)) throw mcpTimeoutError(this.name, timeoutMs);
|
|
6940
6965
|
throw cause;
|
|
@@ -10480,5 +10505,5 @@ exports.generateCronId = generateCronId;
|
|
|
10480
10505
|
exports.getPricingEntry = getPricingEntry;
|
|
10481
10506
|
exports.openRouterMemoryEmbeddingProviderAdapter = openRouterMemoryEmbeddingProviderAdapter;
|
|
10482
10507
|
exports.resolveApiKey = resolveApiKey;
|
|
10483
|
-
//# sourceMappingURL=chunk-
|
|
10484
|
-
//# sourceMappingURL=chunk-
|
|
10508
|
+
//# sourceMappingURL=chunk-W52DKZBR.cjs.map
|
|
10509
|
+
//# sourceMappingURL=chunk-W52DKZBR.cjs.map
|