@mastra/deployer 0.10.3 → 0.10.4-alpha.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/dist/build/analyze.js +1 -1
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.js +4 -4
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-TDWDSZWX.js → chunk-77XOUHT3.js} +17 -9
- package/dist/{chunk-KWJ2766I.js → chunk-EXHFPVZH.js} +1 -1
- package/dist/{chunk-AOSWYZKN.js → chunk-HHOCIHND.js} +2 -2
- package/dist/{chunk-2LZRVR53.js → chunk-WGJTOVLL.js} +7 -7
- package/dist/{chunk-UJR423U5.js → chunk-WM2GT75J.js} +3 -3
- package/dist/{chunk-WVBUOQT6.js → chunk-Z544XXXK.js} +2 -2
- package/dist/{chunk-3W43JESU.cjs → chunk-ZEUV45KC.cjs} +11 -3
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +378 -280
- package/dist/server/index.js +382 -285
- package/dist/templates/instrumentation-template.js +52 -8
- package/dist/validator/custom-resolver.js +4 -4
- package/dist/validator/loader.js +1 -1
- package/package.json +20 -20
package/dist/server/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFile } from 'fs/promises';
|
|
|
3
3
|
import { join } from 'path/posix';
|
|
4
4
|
import { createServer } from 'http';
|
|
5
5
|
import { Http2ServerRequest } from 'http2';
|
|
6
|
-
import { Readable } from 'stream';
|
|
6
|
+
import { Writable, Readable } from 'stream';
|
|
7
7
|
import { getFilePathWithoutDefaultDocument, getFilePath } from 'hono/utils/filepath';
|
|
8
8
|
import { getMimeType } from 'hono/utils/mime';
|
|
9
9
|
import { createReadStream, lstatSync } from 'fs';
|
|
@@ -21,9 +21,8 @@ import { stream } from 'hono/streaming';
|
|
|
21
21
|
import { getAgentsHandler as getAgentsHandler$1, getAgentByIdHandler as getAgentByIdHandler$1, getEvalsByAgentIdHandler as getEvalsByAgentIdHandler$1, getLiveEvalsByAgentIdHandler as getLiveEvalsByAgentIdHandler$1, generateHandler as generateHandler$2, streamGenerateHandler as streamGenerateHandler$2 } from '@mastra/server/handlers/agents';
|
|
22
22
|
import { getLegacyWorkflowsHandler as getLegacyWorkflowsHandler$1, getLegacyWorkflowByIdHandler as getLegacyWorkflowByIdHandler$1, getLegacyWorkflowRunsHandler as getLegacyWorkflowRunsHandler$1, resumeLegacyWorkflowHandler as resumeLegacyWorkflowHandler$1, resumeAsyncLegacyWorkflowHandler as resumeAsyncLegacyWorkflowHandler$1, createLegacyWorkflowRunHandler as createLegacyWorkflowRunHandler$1, startAsyncLegacyWorkflowHandler as startAsyncLegacyWorkflowHandler$1, startLegacyWorkflowRunHandler as startLegacyWorkflowRunHandler$1, watchLegacyWorkflowHandler as watchLegacyWorkflowHandler$1 } from '@mastra/server/handlers/legacyWorkflows';
|
|
23
23
|
import { getLogsHandler as getLogsHandler$1, getLogTransports as getLogTransports$1, getLogsByRunIdHandler as getLogsByRunIdHandler$1 } from '@mastra/server/handlers/logs';
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
24
|
+
import util from 'util';
|
|
25
|
+
import { Buffer as Buffer$1 } from 'buffer';
|
|
27
26
|
import { getMemoryStatusHandler as getMemoryStatusHandler$1, getThreadsHandler as getThreadsHandler$1, getThreadByIdHandler as getThreadByIdHandler$1, getMessagesHandler as getMessagesHandler$1, createThreadHandler as createThreadHandler$1, updateThreadHandler as updateThreadHandler$1, deleteThreadHandler as deleteThreadHandler$1, saveMessagesHandler as saveMessagesHandler$1 } from '@mastra/server/handlers/memory';
|
|
28
27
|
import { getNetworksHandler as getNetworksHandler$1, getNetworkByIdHandler as getNetworkByIdHandler$1, generateHandler as generateHandler$1, streamGenerateHandler as streamGenerateHandler$1 } from '@mastra/server/handlers/network';
|
|
29
28
|
import { Agent } from '@mastra/core/agent';
|
|
@@ -36,9 +35,9 @@ import { streamWorkflowHandler as streamWorkflowHandler$1, getWorkflowsHandler a
|
|
|
36
35
|
|
|
37
36
|
// src/server/index.ts
|
|
38
37
|
var RequestError = class extends Error {
|
|
39
|
-
static name = "RequestError";
|
|
40
38
|
constructor(message, options) {
|
|
41
39
|
super(message, options);
|
|
40
|
+
this.name = "RequestError";
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
43
|
var toRequestError = (e2) => {
|
|
@@ -191,6 +190,72 @@ var newRequest = (incoming, defaultHostname) => {
|
|
|
191
190
|
req[urlKey] = url.href;
|
|
192
191
|
return req;
|
|
193
192
|
};
|
|
193
|
+
var responseCache = Symbol("responseCache");
|
|
194
|
+
var getResponseCache = Symbol("getResponseCache");
|
|
195
|
+
var cacheKey = Symbol("cache");
|
|
196
|
+
var GlobalResponse = global.Response;
|
|
197
|
+
var Response2 = class _Response {
|
|
198
|
+
#body;
|
|
199
|
+
#init;
|
|
200
|
+
[getResponseCache]() {
|
|
201
|
+
delete this[cacheKey];
|
|
202
|
+
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
|
|
203
|
+
}
|
|
204
|
+
constructor(body, init) {
|
|
205
|
+
let headers;
|
|
206
|
+
this.#body = body;
|
|
207
|
+
if (init instanceof _Response) {
|
|
208
|
+
const cachedGlobalResponse = init[responseCache];
|
|
209
|
+
if (cachedGlobalResponse) {
|
|
210
|
+
this.#init = cachedGlobalResponse;
|
|
211
|
+
this[getResponseCache]();
|
|
212
|
+
return;
|
|
213
|
+
} else {
|
|
214
|
+
this.#init = init.#init;
|
|
215
|
+
headers = new Headers(init.#init.headers);
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
this.#init = init;
|
|
219
|
+
}
|
|
220
|
+
if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
|
|
221
|
+
headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" };
|
|
222
|
+
this[cacheKey] = [init?.status || 200, body, headers];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
get headers() {
|
|
226
|
+
const cache = this[cacheKey];
|
|
227
|
+
if (cache) {
|
|
228
|
+
if (!(cache[2] instanceof Headers)) {
|
|
229
|
+
cache[2] = new Headers(cache[2]);
|
|
230
|
+
}
|
|
231
|
+
return cache[2];
|
|
232
|
+
}
|
|
233
|
+
return this[getResponseCache]().headers;
|
|
234
|
+
}
|
|
235
|
+
get status() {
|
|
236
|
+
return this[cacheKey]?.[0] ?? this[getResponseCache]().status;
|
|
237
|
+
}
|
|
238
|
+
get ok() {
|
|
239
|
+
const status = this.status;
|
|
240
|
+
return status >= 200 && status < 300;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => {
|
|
244
|
+
Object.defineProperty(Response2.prototype, k, {
|
|
245
|
+
get() {
|
|
246
|
+
return this[getResponseCache]()[k];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
|
|
251
|
+
Object.defineProperty(Response2.prototype, k, {
|
|
252
|
+
value: function() {
|
|
253
|
+
return this[getResponseCache]()[k]();
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
Object.setPrototypeOf(Response2, GlobalResponse);
|
|
258
|
+
Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
|
|
194
259
|
function writeFromReadableStream(stream4, writable) {
|
|
195
260
|
if (stream4.locked) {
|
|
196
261
|
throw new TypeError("ReadableStream is locked.");
|
|
@@ -249,83 +314,6 @@ var buildOutgoingHttpHeaders = (headers) => {
|
|
|
249
314
|
res["content-type"] ??= "text/plain; charset=UTF-8";
|
|
250
315
|
return res;
|
|
251
316
|
};
|
|
252
|
-
var responseCache = Symbol("responseCache");
|
|
253
|
-
var getResponseCache = Symbol("getResponseCache");
|
|
254
|
-
var cacheKey = Symbol("cache");
|
|
255
|
-
var GlobalResponse = global.Response;
|
|
256
|
-
var Response2 = class _Response {
|
|
257
|
-
#body;
|
|
258
|
-
#init;
|
|
259
|
-
[getResponseCache]() {
|
|
260
|
-
delete this[cacheKey];
|
|
261
|
-
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
|
|
262
|
-
}
|
|
263
|
-
constructor(body, init) {
|
|
264
|
-
this.#body = body;
|
|
265
|
-
if (init instanceof _Response) {
|
|
266
|
-
const cachedGlobalResponse = init[responseCache];
|
|
267
|
-
if (cachedGlobalResponse) {
|
|
268
|
-
this.#init = cachedGlobalResponse;
|
|
269
|
-
this[getResponseCache]();
|
|
270
|
-
return;
|
|
271
|
-
} else {
|
|
272
|
-
this.#init = init.#init;
|
|
273
|
-
}
|
|
274
|
-
} else {
|
|
275
|
-
this.#init = init;
|
|
276
|
-
}
|
|
277
|
-
if (typeof body === "string" || typeof body?.getReader !== "undefined") {
|
|
278
|
-
let headers = init?.headers || { "content-type": "text/plain; charset=UTF-8" };
|
|
279
|
-
if (headers instanceof Headers) {
|
|
280
|
-
headers = buildOutgoingHttpHeaders(headers);
|
|
281
|
-
}
|
|
282
|
-
this[cacheKey] = [init?.status || 200, body, headers];
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
[
|
|
287
|
-
"body",
|
|
288
|
-
"bodyUsed",
|
|
289
|
-
"headers",
|
|
290
|
-
"ok",
|
|
291
|
-
"redirected",
|
|
292
|
-
"status",
|
|
293
|
-
"statusText",
|
|
294
|
-
"trailers",
|
|
295
|
-
"type",
|
|
296
|
-
"url"
|
|
297
|
-
].forEach((k) => {
|
|
298
|
-
Object.defineProperty(Response2.prototype, k, {
|
|
299
|
-
get() {
|
|
300
|
-
return this[getResponseCache]()[k];
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
|
|
305
|
-
Object.defineProperty(Response2.prototype, k, {
|
|
306
|
-
value: function() {
|
|
307
|
-
return this[getResponseCache]()[k]();
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
Object.setPrototypeOf(Response2, GlobalResponse);
|
|
312
|
-
Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
|
|
313
|
-
var stateKey = Reflect.ownKeys(new GlobalResponse()).find(
|
|
314
|
-
(k) => typeof k === "symbol" && k.toString() === "Symbol(state)"
|
|
315
|
-
);
|
|
316
|
-
if (!stateKey) {
|
|
317
|
-
console.warn("Failed to find Response internal state key");
|
|
318
|
-
}
|
|
319
|
-
function getInternalBody(response) {
|
|
320
|
-
if (!stateKey) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
if (response instanceof Response2) {
|
|
324
|
-
response = response[getResponseCache]();
|
|
325
|
-
}
|
|
326
|
-
const state = response[stateKey];
|
|
327
|
-
return state && state.body || void 0;
|
|
328
|
-
}
|
|
329
317
|
var X_ALREADY_SENT = "x-hono-already-sent";
|
|
330
318
|
var webFetch = global.fetch;
|
|
331
319
|
if (typeof global.crypto === "undefined") {
|
|
@@ -361,14 +349,24 @@ var handleResponseError = (e2, outgoing) => {
|
|
|
361
349
|
outgoing.destroy(err);
|
|
362
350
|
}
|
|
363
351
|
};
|
|
364
|
-
var responseViaCache = (res, outgoing) => {
|
|
365
|
-
|
|
352
|
+
var responseViaCache = async (res, outgoing) => {
|
|
353
|
+
let [status, body, header] = res[cacheKey];
|
|
354
|
+
if (header instanceof Headers) {
|
|
355
|
+
header = buildOutgoingHttpHeaders(header);
|
|
356
|
+
}
|
|
366
357
|
if (typeof body === "string") {
|
|
367
358
|
header["Content-Length"] = Buffer.byteLength(body);
|
|
368
|
-
|
|
359
|
+
} else if (body instanceof Uint8Array) {
|
|
360
|
+
header["Content-Length"] = body.byteLength;
|
|
361
|
+
} else if (body instanceof Blob) {
|
|
362
|
+
header["Content-Length"] = body.size;
|
|
363
|
+
}
|
|
364
|
+
outgoing.writeHead(status, header);
|
|
365
|
+
if (typeof body === "string" || body instanceof Uint8Array) {
|
|
369
366
|
outgoing.end(body);
|
|
367
|
+
} else if (body instanceof Blob) {
|
|
368
|
+
outgoing.end(new Uint8Array(await body.arrayBuffer()));
|
|
370
369
|
} else {
|
|
371
|
-
outgoing.writeHead(status, header);
|
|
372
370
|
return writeFromReadableStream(body, outgoing)?.catch(
|
|
373
371
|
(e2) => handleResponseError(e2, outgoing)
|
|
374
372
|
);
|
|
@@ -394,24 +392,6 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
394
392
|
return responseViaCache(res, outgoing);
|
|
395
393
|
}
|
|
396
394
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
397
|
-
const internalBody = getInternalBody(res);
|
|
398
|
-
if (internalBody) {
|
|
399
|
-
const { length, source, stream: stream4 } = internalBody;
|
|
400
|
-
if (source instanceof Uint8Array && source.byteLength !== length) ; else {
|
|
401
|
-
if (length) {
|
|
402
|
-
resHeaderRecord["content-length"] = length;
|
|
403
|
-
}
|
|
404
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
405
|
-
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
406
|
-
outgoing.end(source);
|
|
407
|
-
} else if (source instanceof Blob) {
|
|
408
|
-
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
409
|
-
} else {
|
|
410
|
-
await writeFromReadableStream(stream4, outgoing);
|
|
411
|
-
}
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
395
|
if (res.body) {
|
|
416
396
|
const {
|
|
417
397
|
"transfer-encoding": transferEncoding,
|
|
@@ -742,131 +722,148 @@ var middleware = (options) => async (c2) => {
|
|
|
742
722
|
);
|
|
743
723
|
};
|
|
744
724
|
|
|
745
|
-
// ../../node_modules/.pnpm/hono-openapi@0.4.
|
|
725
|
+
// ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.7.11_openapi-types@12.1.3_zod@3.25.56/node_modules/hono-openapi/utils.js
|
|
746
726
|
var e = Symbol("openapi");
|
|
747
|
-
var
|
|
748
|
-
var
|
|
727
|
+
var n = ["GET", "PUT", "POST", "DELETE", "OPTIONS", "HEAD", "PATCH", "TRACE"];
|
|
728
|
+
var s2 = (e2) => e2.charAt(0).toUpperCase() + e2.slice(1);
|
|
749
729
|
var o = /* @__PURE__ */ new Map();
|
|
750
730
|
var a = (e2, t2) => {
|
|
751
|
-
const
|
|
752
|
-
if (o.has(
|
|
731
|
+
const n2 = `${e2}:${t2}`;
|
|
732
|
+
if (o.has(n2)) return o.get(n2);
|
|
753
733
|
let a2 = e2;
|
|
754
734
|
if ("/" === t2) return `${a2}Index`;
|
|
755
|
-
for (const e3 of t2.split("/")) 123 === e3.charCodeAt(0) ? a2 += `By${
|
|
756
|
-
return o.set(
|
|
735
|
+
for (const e3 of t2.split("/")) 123 === e3.charCodeAt(0) ? a2 += `By${s2(e3.slice(1, -1))}` : a2 += s2(e3);
|
|
736
|
+
return o.set(n2, a2), a2;
|
|
757
737
|
};
|
|
758
738
|
var r = /* @__PURE__ */ new Map();
|
|
759
|
-
function c(e2, t2,
|
|
760
|
-
return e2 && t2 in e2 ? e2[t2] ??
|
|
739
|
+
function c(e2, t2, n2) {
|
|
740
|
+
return e2 && t2 in e2 ? e2[t2] ?? n2 : n2;
|
|
761
741
|
}
|
|
762
742
|
function i(...e2) {
|
|
763
743
|
return e2.reduce((e3, t2) => {
|
|
764
744
|
if (!t2) return e3;
|
|
765
|
-
let
|
|
766
|
-
return ("tags" in e3 && e3.tags || "tags" in t2 && t2.tags) && (
|
|
745
|
+
let n2;
|
|
746
|
+
return ("tags" in e3 && e3.tags || "tags" in t2 && t2.tags) && (n2 = Array.from(/* @__PURE__ */ new Set([...c(e3, "tags", []), ...c(t2, "tags", [])]))), { ...e3, ...t2, tags: n2, responses: { ...c(e3, "responses", {}), ...c(t2, "responses", {}) }, parameters: m(e3.parameters, t2.parameters) };
|
|
767
747
|
}, {});
|
|
768
748
|
}
|
|
769
|
-
function p({ path: e2, method: t2, data:
|
|
749
|
+
function p({ path: e2, method: t2, data: n2, schema: s3 }) {
|
|
770
750
|
e2 = ((e3) => e3.split("/").map((e4) => {
|
|
771
751
|
let t3 = e4;
|
|
772
|
-
|
|
752
|
+
if (t3.startsWith(":")) {
|
|
753
|
+
const e5 = t3.match(/^:([^{?]+)(?:{(.+)})?(\?)?$/);
|
|
754
|
+
e5 ? t3 = `{${e5[1]}}` : (t3 = t3.slice(1, t3.length), t3.endsWith("?") && (t3 = t3.slice(0, -1)), t3 = `{${t3}}`);
|
|
755
|
+
}
|
|
756
|
+
return t3;
|
|
773
757
|
}).join("/"))(e2);
|
|
774
758
|
const o2 = t2.toLowerCase();
|
|
775
|
-
if ("all" === o2)
|
|
776
|
-
|
|
777
|
-
r.
|
|
778
|
-
|
|
779
|
-
|
|
759
|
+
if ("all" === o2) {
|
|
760
|
+
if (!n2) return;
|
|
761
|
+
if (r.has(e2)) {
|
|
762
|
+
const t3 = r.get(e2) ?? {};
|
|
763
|
+
r.set(e2, { ...t3, ...n2, parameters: m(t3.parameters, n2.parameters) });
|
|
764
|
+
} else r.set(e2, n2);
|
|
765
|
+
} else {
|
|
780
766
|
const t3 = function(e3) {
|
|
781
767
|
const t4 = Array.from(r.keys());
|
|
782
|
-
let
|
|
783
|
-
for (const
|
|
784
|
-
return
|
|
768
|
+
let n3 = {};
|
|
769
|
+
for (const s4 of t4) e3.match(s4) && (n3 = i(n3, r.get(s4) ?? {}));
|
|
770
|
+
return n3;
|
|
785
771
|
}(e2);
|
|
786
|
-
|
|
772
|
+
s3[e2] = { ...s3[e2] ? s3[e2] : {}, [o2]: { responses: {}, operationId: a(o2, e2), ...i(t3, s3[e2]?.[o2], n2) } };
|
|
787
773
|
}
|
|
788
774
|
}
|
|
789
|
-
var
|
|
775
|
+
var f = (e2) => "$ref" in e2 ? e2.$ref : `${e2.in} ${e2.name}`;
|
|
790
776
|
function m(...e2) {
|
|
791
|
-
const t2 = e2.flatMap((e3) => e3 ?? []).reduce((e3, t3) => (e3.set(
|
|
777
|
+
const t2 = e2.flatMap((e3) => e3 ?? []).reduce((e3, t3) => (e3.set(f(t3), t3), e3), /* @__PURE__ */ new Map());
|
|
792
778
|
return Array.from(t2.values());
|
|
793
779
|
}
|
|
794
|
-
function
|
|
795
|
-
const
|
|
796
|
-
for (const [
|
|
780
|
+
function l(e2, { excludeStaticFile: t2 = true, exclude: n2 = [] }) {
|
|
781
|
+
const s3 = {}, o2 = Array.isArray(n2) ? n2 : [n2];
|
|
782
|
+
for (const [n3, a2] of Object.entries(e2)) if (!o2.some((e3) => "string" == typeof e3 ? n3 === e3 : e3.test(n3)) && (!n3.includes("*") || n3.includes("{")) && (!t2 || (!n3.includes(".") || n3.includes("{")))) {
|
|
797
783
|
for (const e3 of Object.keys(a2)) {
|
|
798
784
|
const t3 = a2[e3];
|
|
799
|
-
if (
|
|
785
|
+
if (n3.includes("{")) {
|
|
800
786
|
t3.parameters || (t3.parameters = []);
|
|
801
|
-
const e4 =
|
|
802
|
-
for (const
|
|
803
|
-
const e5 =
|
|
804
|
-
-1 !==
|
|
787
|
+
const e4 = n3.split("/").filter((e5) => e5.startsWith("{") && !t3.parameters.find((t4) => "path" === t4.in && t4.name === e5.slice(1, e5.length - 1)));
|
|
788
|
+
for (const n4 of e4) {
|
|
789
|
+
const e5 = n4.slice(1, n4.length - 1), s4 = t3.parameters.findIndex((t4) => "param" === t4.in && t4.name === e5);
|
|
790
|
+
-1 !== s4 ? t3.parameters[s4].in = "path" : t3.parameters.push({ schema: { type: "string" }, in: "path", name: e5, required: true });
|
|
805
791
|
}
|
|
806
792
|
}
|
|
807
793
|
t3.responses || (t3.responses = { 200: {} });
|
|
808
794
|
}
|
|
809
|
-
|
|
795
|
+
s3[n3] = a2;
|
|
810
796
|
}
|
|
811
|
-
return
|
|
797
|
+
return s3;
|
|
812
798
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
799
|
+
var u = { documentation: {}, excludeStaticFile: true, exclude: [], excludeMethods: ["OPTIONS"], excludeTags: [] };
|
|
800
|
+
var d = { version: "3.1.0", components: {} };
|
|
801
|
+
function h(e2, t2) {
|
|
802
|
+
const n2 = { version: "3.1.0", components: {} };
|
|
803
|
+
let s3;
|
|
804
|
+
return async (o2) => (s3 || (s3 = await y(e2, t2, n2, o2)), o2.json(s3));
|
|
817
805
|
}
|
|
818
|
-
async function
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
806
|
+
async function y(t2, s3 = u, o2 = d, a2) {
|
|
807
|
+
const r2 = { ...u, ...s3 }, c2 = { ...d, ...o2 }, i2 = r2.documentation ?? {}, f2 = await async function(t3, s4, o3) {
|
|
808
|
+
const a3 = {};
|
|
809
|
+
for (const r3 of t3.routes) {
|
|
810
|
+
if (!(e in r3.handler)) {
|
|
811
|
+
s4.includeEmptyPaths && p({ method: r3.method, path: r3.path, schema: a3 });
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
if (s4.excludeMethods.includes(r3.method)) continue;
|
|
815
|
+
if (false === n.includes(r3.method) && "ALL" !== r3.method) continue;
|
|
816
|
+
const { resolver: t4, metadata: c3 = {} } = r3.handler[e], i3 = s4.defaultOptions?.[r3.method], { docs: f3, components: m2 } = await t4({ ...o3, ...c3 }, i3);
|
|
817
|
+
o3.components = { ...o3.components, ...m2 ?? {} }, p({ method: r3.method, path: r3.path, data: f3, schema: a3 });
|
|
818
|
+
}
|
|
819
|
+
return a3;
|
|
820
|
+
}(t2, r2, c2);
|
|
821
|
+
for (const e2 in f2) for (const t3 in f2[e2]) {
|
|
822
|
+
const n2 = f2[e2][t3]?.hide;
|
|
823
|
+
if (n2) {
|
|
824
|
+
let s4 = false;
|
|
825
|
+
"boolean" == typeof n2 ? s4 = n2 : "function" == typeof n2 && (a2 ? s4 = n2(a2) : console.warn(`'c' is not defined, cannot evaluate hide function for ${t3} ${e2}`)), s4 && delete f2[e2][t3];
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return { openapi: c2.version, ...{ ...i2, tags: i2.tags?.filter((e2) => !r2.excludeTags?.includes(e2?.name)), info: { title: "Hono Documentation", description: "Development documentation", version: "0.0.0", ...i2.info }, paths: { ...l(f2, r2), ...i2.paths }, components: { ...i2.components, schemas: { ...c2.components, ...i2.components?.schemas } } } };
|
|
832
829
|
}
|
|
833
|
-
function
|
|
834
|
-
const { validateResponse:
|
|
830
|
+
function w(n2) {
|
|
831
|
+
const { validateResponse: s3, ...o2 } = n2;
|
|
835
832
|
return Object.assign(async (e2, o3) => {
|
|
836
|
-
if (await o3(),
|
|
833
|
+
if (await o3(), s3 && n2.responses) {
|
|
837
834
|
const o4 = e2.res.status, a2 = e2.res.headers.get("content-type");
|
|
838
835
|
if (o4 && a2) {
|
|
839
|
-
const r2 =
|
|
836
|
+
const r2 = n2.responses[o4];
|
|
840
837
|
if (r2 && "content" in r2 && r2.content) {
|
|
841
|
-
const
|
|
838
|
+
const n3 = a2.split(";")[0], o5 = r2.content[n3];
|
|
842
839
|
if (o5?.schema && "validator" in o5.schema) try {
|
|
843
840
|
let t2;
|
|
844
|
-
const
|
|
845
|
-
if ("application/json" ===
|
|
841
|
+
const s4 = e2.res.clone();
|
|
842
|
+
if ("application/json" === n3 ? t2 = await s4.json() : "text/plain" === n3 && (t2 = await s4.text()), !t2) throw new Error("No data to validate!");
|
|
846
843
|
await o5.schema.validator(t2);
|
|
847
844
|
} catch (e3) {
|
|
848
|
-
let
|
|
849
|
-
throw "object" == typeof
|
|
845
|
+
let n4 = { status: 500, message: "Response validation failed!" };
|
|
846
|
+
throw "object" == typeof s3 && (n4 = { ...n4, ...s3 }), new HTTPException(n4.status, { message: n4.message, cause: e3 });
|
|
850
847
|
}
|
|
851
848
|
}
|
|
852
849
|
}
|
|
853
850
|
}
|
|
854
851
|
}, { [e]: { resolver: (e2, t2) => x(e2, o2, t2) } });
|
|
855
852
|
}
|
|
856
|
-
async function x(e2, t2,
|
|
857
|
-
let
|
|
858
|
-
const o2 = { ...
|
|
853
|
+
async function x(e2, t2, n2 = {}) {
|
|
854
|
+
let s3 = {};
|
|
855
|
+
const o2 = { ...n2, ...t2, responses: { ...n2?.responses, ...t2.responses } };
|
|
859
856
|
if (o2.responses) for (const t3 of Object.keys(o2.responses)) {
|
|
860
|
-
const
|
|
861
|
-
if (
|
|
862
|
-
const o3 =
|
|
857
|
+
const n3 = o2.responses[t3];
|
|
858
|
+
if (n3 && "content" in n3) for (const t4 of Object.keys(n3.content ?? {})) {
|
|
859
|
+
const o3 = n3.content?.[t4];
|
|
863
860
|
if (o3 && (o3.schema && "builder" in o3.schema)) {
|
|
864
861
|
const t5 = await o3.schema.builder(e2);
|
|
865
|
-
o3.schema = t5.schema, t5.components && (
|
|
862
|
+
o3.schema = t5.schema, t5.components && (s3 = { ...s3, ...t5.components });
|
|
866
863
|
}
|
|
867
864
|
}
|
|
868
865
|
}
|
|
869
|
-
return { docs: o2, components:
|
|
866
|
+
return { docs: o2, components: s3 };
|
|
870
867
|
}
|
|
871
868
|
async function getAgentCardByIdHandler(c2) {
|
|
872
869
|
const mastra = c2.get("mastra");
|
|
@@ -947,10 +944,12 @@ async function getAgentByIdHandler(c2) {
|
|
|
947
944
|
const mastra = c2.get("mastra");
|
|
948
945
|
const agentId = c2.req.param("agentId");
|
|
949
946
|
const runtimeContext = c2.get("runtimeContext");
|
|
947
|
+
const isPlayground = c2.req.header("x-mastra-dev-playground") === "true";
|
|
950
948
|
const result = await getAgentByIdHandler$1({
|
|
951
949
|
mastra,
|
|
952
950
|
agentId,
|
|
953
|
-
runtimeContext
|
|
951
|
+
runtimeContext,
|
|
952
|
+
isPlayground
|
|
954
953
|
});
|
|
955
954
|
return c2.json(result);
|
|
956
955
|
}
|
|
@@ -1446,10 +1445,19 @@ async function getLegacyWorkflowRunsHandler(c2) {
|
|
|
1446
1445
|
async function getLogsHandler(c2) {
|
|
1447
1446
|
try {
|
|
1448
1447
|
const mastra = c2.get("mastra");
|
|
1449
|
-
const transportId = c2.req.query(
|
|
1448
|
+
const { transportId, fromDate, toDate, logLevel, page, perPage } = c2.req.query();
|
|
1449
|
+
const filters = c2.req.queries("filters");
|
|
1450
1450
|
const logs = await getLogsHandler$1({
|
|
1451
1451
|
mastra,
|
|
1452
|
-
transportId
|
|
1452
|
+
transportId,
|
|
1453
|
+
params: {
|
|
1454
|
+
fromDate: fromDate ? new Date(fromDate) : void 0,
|
|
1455
|
+
toDate: toDate ? new Date(toDate) : void 0,
|
|
1456
|
+
logLevel: logLevel ? logLevel : void 0,
|
|
1457
|
+
filters,
|
|
1458
|
+
page: page ? Number(page) : void 0,
|
|
1459
|
+
perPage: perPage ? Number(perPage) : void 0
|
|
1460
|
+
}
|
|
1453
1461
|
});
|
|
1454
1462
|
return c2.json(logs);
|
|
1455
1463
|
} catch (error) {
|
|
@@ -1460,11 +1468,20 @@ async function getLogsByRunIdHandler(c2) {
|
|
|
1460
1468
|
try {
|
|
1461
1469
|
const mastra = c2.get("mastra");
|
|
1462
1470
|
const runId = c2.req.param("runId");
|
|
1463
|
-
const transportId = c2.req.query(
|
|
1471
|
+
const { transportId, fromDate, toDate, logLevel, page, perPage } = c2.req.query();
|
|
1472
|
+
const filters = c2.req.queries("filters");
|
|
1464
1473
|
const logs = await getLogsByRunIdHandler$1({
|
|
1465
1474
|
mastra,
|
|
1466
1475
|
runId,
|
|
1467
|
-
transportId
|
|
1476
|
+
transportId,
|
|
1477
|
+
params: {
|
|
1478
|
+
fromDate: fromDate ? new Date(fromDate) : void 0,
|
|
1479
|
+
toDate: toDate ? new Date(toDate) : void 0,
|
|
1480
|
+
logLevel: logLevel ? logLevel : void 0,
|
|
1481
|
+
filters,
|
|
1482
|
+
page: page ? Number(page) : void 0,
|
|
1483
|
+
perPage: perPage ? Number(perPage) : void 0
|
|
1484
|
+
}
|
|
1468
1485
|
});
|
|
1469
1486
|
return c2.json(logs);
|
|
1470
1487
|
} catch (error) {
|
|
@@ -1681,7 +1698,7 @@ var kHeadersCount = Symbol("kHeadersCount");
|
|
|
1681
1698
|
var kTrailers = Symbol("kTrailers");
|
|
1682
1699
|
var kTrailersDistinct = Symbol("kTrailersDistinct");
|
|
1683
1700
|
var kTrailersCount = Symbol("kTrailersCount");
|
|
1684
|
-
var FetchIncomingMessage = class extends Readable
|
|
1701
|
+
var FetchIncomingMessage = class extends Readable {
|
|
1685
1702
|
get socket() {
|
|
1686
1703
|
return null;
|
|
1687
1704
|
}
|
|
@@ -3900,14 +3917,13 @@ function executeToolHandler(tools) {
|
|
|
3900
3917
|
const runtimeContext = c2.get("runtimeContext");
|
|
3901
3918
|
const toolId = decodeURIComponent(c2.req.param("toolId"));
|
|
3902
3919
|
const runId = c2.req.query("runId");
|
|
3903
|
-
const { data
|
|
3920
|
+
const { data } = await c2.req.json();
|
|
3904
3921
|
const result = await executeToolHandler$1(tools)({
|
|
3905
3922
|
mastra,
|
|
3906
3923
|
toolId,
|
|
3907
3924
|
data,
|
|
3908
3925
|
runtimeContext,
|
|
3909
|
-
runId
|
|
3910
|
-
runtimeContextFromRequest
|
|
3926
|
+
runId
|
|
3911
3927
|
});
|
|
3912
3928
|
return c2.json(result);
|
|
3913
3929
|
} catch (error) {
|
|
@@ -3921,14 +3937,13 @@ async function executeAgentToolHandler(c2) {
|
|
|
3921
3937
|
const runtimeContext = c2.get("runtimeContext");
|
|
3922
3938
|
const agentId = c2.req.param("agentId");
|
|
3923
3939
|
const toolId = c2.req.param("toolId");
|
|
3924
|
-
const { data
|
|
3940
|
+
const { data } = await c2.req.json();
|
|
3925
3941
|
const result = await executeAgentToolHandler$1({
|
|
3926
3942
|
mastra,
|
|
3927
3943
|
agentId,
|
|
3928
3944
|
toolId,
|
|
3929
3945
|
data,
|
|
3930
|
-
runtimeContext
|
|
3931
|
-
runtimeContextFromRequest
|
|
3946
|
+
runtimeContext
|
|
3932
3947
|
});
|
|
3933
3948
|
return c2.json(result);
|
|
3934
3949
|
} catch (error) {
|
|
@@ -4149,12 +4164,11 @@ async function startAsyncWorkflowHandler(c2) {
|
|
|
4149
4164
|
const mastra = c2.get("mastra");
|
|
4150
4165
|
const workflowId = c2.req.param("workflowId");
|
|
4151
4166
|
const runtimeContext = c2.get("runtimeContext");
|
|
4152
|
-
const { inputData
|
|
4167
|
+
const { inputData } = await c2.req.json();
|
|
4153
4168
|
const runId = c2.req.query("runId");
|
|
4154
4169
|
const result = await startAsyncWorkflowHandler$1({
|
|
4155
4170
|
mastra,
|
|
4156
4171
|
runtimeContext,
|
|
4157
|
-
runtimeContextFromRequest,
|
|
4158
4172
|
workflowId,
|
|
4159
4173
|
runId,
|
|
4160
4174
|
inputData
|
|
@@ -4169,12 +4183,11 @@ async function startWorkflowRunHandler(c2) {
|
|
|
4169
4183
|
const mastra = c2.get("mastra");
|
|
4170
4184
|
const workflowId = c2.req.param("workflowId");
|
|
4171
4185
|
const runtimeContext = c2.get("runtimeContext");
|
|
4172
|
-
const { inputData
|
|
4186
|
+
const { inputData } = await c2.req.json();
|
|
4173
4187
|
const runId = c2.req.query("runId");
|
|
4174
4188
|
await startWorkflowRunHandler$1({
|
|
4175
4189
|
mastra,
|
|
4176
4190
|
runtimeContext,
|
|
4177
|
-
runtimeContextFromRequest,
|
|
4178
4191
|
workflowId,
|
|
4179
4192
|
runId,
|
|
4180
4193
|
inputData
|
|
@@ -4228,7 +4241,7 @@ async function streamWorkflowHandler(c2) {
|
|
|
4228
4241
|
const logger2 = mastra.getLogger();
|
|
4229
4242
|
const workflowId = c2.req.param("workflowId");
|
|
4230
4243
|
const runtimeContext = c2.get("runtimeContext");
|
|
4231
|
-
const { inputData
|
|
4244
|
+
const { inputData } = await c2.req.json();
|
|
4232
4245
|
const runId = c2.req.query("runId");
|
|
4233
4246
|
return stream(
|
|
4234
4247
|
c2,
|
|
@@ -4239,8 +4252,7 @@ async function streamWorkflowHandler(c2) {
|
|
|
4239
4252
|
workflowId,
|
|
4240
4253
|
runId,
|
|
4241
4254
|
inputData,
|
|
4242
|
-
runtimeContext
|
|
4243
|
-
runtimeContextFromRequest
|
|
4255
|
+
runtimeContext
|
|
4244
4256
|
});
|
|
4245
4257
|
const reader = result.stream.getReader();
|
|
4246
4258
|
stream4.onAbort(() => {
|
|
@@ -4268,14 +4280,13 @@ async function resumeAsyncWorkflowHandler(c2) {
|
|
|
4268
4280
|
const workflowId = c2.req.param("workflowId");
|
|
4269
4281
|
const runId = c2.req.query("runId");
|
|
4270
4282
|
const runtimeContext = c2.get("runtimeContext");
|
|
4271
|
-
const { step, resumeData
|
|
4283
|
+
const { step, resumeData } = await c2.req.json();
|
|
4272
4284
|
if (!runId) {
|
|
4273
4285
|
throw new HTTPException(400, { message: "runId required to resume workflow" });
|
|
4274
4286
|
}
|
|
4275
4287
|
const result = await resumeAsyncWorkflowHandler$1({
|
|
4276
4288
|
mastra,
|
|
4277
4289
|
runtimeContext,
|
|
4278
|
-
runtimeContextFromRequest,
|
|
4279
4290
|
workflowId,
|
|
4280
4291
|
runId,
|
|
4281
4292
|
body: { step, resumeData }
|
|
@@ -4453,8 +4464,14 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4453
4464
|
});
|
|
4454
4465
|
return acc;
|
|
4455
4466
|
}, {});
|
|
4456
|
-
} catch {
|
|
4457
|
-
console.error(
|
|
4467
|
+
} catch (err) {
|
|
4468
|
+
console.error(
|
|
4469
|
+
`Failed to import tools
|
|
4470
|
+
reason: ${err.message}
|
|
4471
|
+
${err.stack.split("\n").slice(1).join("\n")}
|
|
4472
|
+
`,
|
|
4473
|
+
err
|
|
4474
|
+
);
|
|
4458
4475
|
}
|
|
4459
4476
|
app.use("*", async function setTelemetryInfo(c2, next) {
|
|
4460
4477
|
const requestId = c2.req.header("x-request-id") ?? randomUUID();
|
|
@@ -4476,20 +4493,21 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4476
4493
|
}
|
|
4477
4494
|
});
|
|
4478
4495
|
app.onError(errorHandler);
|
|
4479
|
-
app.use("*", function setContext(c2, next) {
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4496
|
+
app.use("*", async function setContext(c2, next) {
|
|
4497
|
+
let runtimeContext = new RuntimeContext();
|
|
4498
|
+
if (c2.req.method === "POST" || c2.req.method === "PUT") {
|
|
4499
|
+
const contentType = c2.req.header("content-type");
|
|
4500
|
+
if (contentType?.includes("application/json")) {
|
|
4501
|
+
try {
|
|
4502
|
+
const body = await c2.req.json();
|
|
4503
|
+
if (body.runtimeContext) {
|
|
4504
|
+
runtimeContext = new RuntimeContext(Object.entries(body.runtimeContext));
|
|
4505
|
+
}
|
|
4506
|
+
} catch {
|
|
4507
|
+
}
|
|
4490
4508
|
}
|
|
4491
|
-
}
|
|
4492
|
-
c2.set("runtimeContext",
|
|
4509
|
+
}
|
|
4510
|
+
c2.set("runtimeContext", runtimeContext);
|
|
4493
4511
|
c2.set("mastra", mastra);
|
|
4494
4512
|
c2.set("tools", tools);
|
|
4495
4513
|
c2.set("playground", options.playground === true);
|
|
@@ -4546,7 +4564,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4546
4564
|
middlewares.push(...Array.isArray(route.middleware) ? route.middleware : [route.middleware]);
|
|
4547
4565
|
}
|
|
4548
4566
|
if (route.openapi) {
|
|
4549
|
-
middlewares.push(
|
|
4567
|
+
middlewares.push(w(route.openapi));
|
|
4550
4568
|
}
|
|
4551
4569
|
const handler = "handler" in route ? route.handler : await route.createHandler({ mastra });
|
|
4552
4570
|
if (route.method === "GET") {
|
|
@@ -4567,7 +4585,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4567
4585
|
}
|
|
4568
4586
|
app.get(
|
|
4569
4587
|
"/.well-known/:agentId/agent.json",
|
|
4570
|
-
|
|
4588
|
+
w({
|
|
4571
4589
|
description: "Get agent configuration",
|
|
4572
4590
|
tags: ["agents"],
|
|
4573
4591
|
parameters: [
|
|
@@ -4588,7 +4606,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4588
4606
|
);
|
|
4589
4607
|
app.post(
|
|
4590
4608
|
"/a2a/:agentId",
|
|
4591
|
-
|
|
4609
|
+
w({
|
|
4592
4610
|
description: "Execute agent via A2A protocol",
|
|
4593
4611
|
tags: ["agents"],
|
|
4594
4612
|
parameters: [
|
|
@@ -4703,7 +4721,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4703
4721
|
);
|
|
4704
4722
|
app.get(
|
|
4705
4723
|
"/api",
|
|
4706
|
-
|
|
4724
|
+
w({
|
|
4707
4725
|
description: "Get API status",
|
|
4708
4726
|
tags: ["system"],
|
|
4709
4727
|
responses: {
|
|
@@ -4716,7 +4734,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4716
4734
|
);
|
|
4717
4735
|
app.get(
|
|
4718
4736
|
"/api/agents",
|
|
4719
|
-
|
|
4737
|
+
w({
|
|
4720
4738
|
description: "Get all available agents",
|
|
4721
4739
|
tags: ["agents"],
|
|
4722
4740
|
responses: {
|
|
@@ -4729,7 +4747,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4729
4747
|
);
|
|
4730
4748
|
app.get(
|
|
4731
4749
|
"/api/networks",
|
|
4732
|
-
|
|
4750
|
+
w({
|
|
4733
4751
|
description: "Get all available networks",
|
|
4734
4752
|
tags: ["networks"],
|
|
4735
4753
|
responses: {
|
|
@@ -4742,7 +4760,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4742
4760
|
);
|
|
4743
4761
|
app.get(
|
|
4744
4762
|
"/api/networks/:networkId",
|
|
4745
|
-
|
|
4763
|
+
w({
|
|
4746
4764
|
description: "Get network by ID",
|
|
4747
4765
|
tags: ["networks"],
|
|
4748
4766
|
parameters: [
|
|
@@ -4767,7 +4785,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4767
4785
|
app.post(
|
|
4768
4786
|
"/api/networks/:networkId/generate",
|
|
4769
4787
|
bodyLimit(bodyLimitOptions),
|
|
4770
|
-
|
|
4788
|
+
w({
|
|
4771
4789
|
description: "Generate a response from a network",
|
|
4772
4790
|
tags: ["networks"],
|
|
4773
4791
|
parameters: [
|
|
@@ -4815,7 +4833,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4815
4833
|
app.post(
|
|
4816
4834
|
"/api/networks/:networkId/stream",
|
|
4817
4835
|
bodyLimit(bodyLimitOptions),
|
|
4818
|
-
|
|
4836
|
+
w({
|
|
4819
4837
|
description: "Generate a response from a network",
|
|
4820
4838
|
tags: ["networks"],
|
|
4821
4839
|
parameters: [
|
|
@@ -4862,7 +4880,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4862
4880
|
);
|
|
4863
4881
|
app.get(
|
|
4864
4882
|
"/api/agents/:agentId",
|
|
4865
|
-
|
|
4883
|
+
w({
|
|
4866
4884
|
description: "Get agent by ID",
|
|
4867
4885
|
tags: ["agents"],
|
|
4868
4886
|
parameters: [
|
|
@@ -4886,7 +4904,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4886
4904
|
);
|
|
4887
4905
|
app.get(
|
|
4888
4906
|
"/api/agents/:agentId/evals/ci",
|
|
4889
|
-
|
|
4907
|
+
w({
|
|
4890
4908
|
description: "Get CI evals by agent ID",
|
|
4891
4909
|
tags: ["agents"],
|
|
4892
4910
|
parameters: [
|
|
@@ -4907,7 +4925,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4907
4925
|
);
|
|
4908
4926
|
app.get(
|
|
4909
4927
|
"/api/agents/:agentId/evals/live",
|
|
4910
|
-
|
|
4928
|
+
w({
|
|
4911
4929
|
description: "Get live evals by agent ID",
|
|
4912
4930
|
tags: ["agents"],
|
|
4913
4931
|
parameters: [
|
|
@@ -4929,7 +4947,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4929
4947
|
app.post(
|
|
4930
4948
|
"/api/agents/:agentId/generate",
|
|
4931
4949
|
bodyLimit(bodyLimitOptions),
|
|
4932
|
-
|
|
4950
|
+
w({
|
|
4933
4951
|
description: "Generate a response from an agent",
|
|
4934
4952
|
tags: ["agents"],
|
|
4935
4953
|
parameters: [
|
|
@@ -4980,7 +4998,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
4980
4998
|
app.post(
|
|
4981
4999
|
"/api/agents/:agentId/stream",
|
|
4982
5000
|
bodyLimit(bodyLimitOptions),
|
|
4983
|
-
|
|
5001
|
+
w({
|
|
4984
5002
|
description: "Stream a response from an agent",
|
|
4985
5003
|
tags: ["agents"],
|
|
4986
5004
|
parameters: [
|
|
@@ -5032,7 +5050,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5032
5050
|
app.post(
|
|
5033
5051
|
"/api/agents/:agentId/instructions",
|
|
5034
5052
|
bodyLimit(bodyLimitOptions),
|
|
5035
|
-
|
|
5053
|
+
w({
|
|
5036
5054
|
description: "Update an agent's instructions",
|
|
5037
5055
|
tags: ["agents"],
|
|
5038
5056
|
parameters: [
|
|
@@ -5077,7 +5095,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5077
5095
|
app.post(
|
|
5078
5096
|
"/api/agents/:agentId/instructions/enhance",
|
|
5079
5097
|
bodyLimit(bodyLimitOptions),
|
|
5080
|
-
|
|
5098
|
+
w({
|
|
5081
5099
|
description: "Generate an improved system prompt from instructions",
|
|
5082
5100
|
tags: ["agents"],
|
|
5083
5101
|
parameters: [
|
|
@@ -5153,7 +5171,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5153
5171
|
c2.header("Link", '</api/agents/:agentId/voice/speakers>; rel="successor-version"');
|
|
5154
5172
|
return next();
|
|
5155
5173
|
},
|
|
5156
|
-
|
|
5174
|
+
w({
|
|
5157
5175
|
description: "[DEPRECATED] Use /api/agents/:agentId/voice/speakers instead. Get available speakers for an agent",
|
|
5158
5176
|
tags: ["agents"],
|
|
5159
5177
|
parameters: [
|
|
@@ -5195,7 +5213,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5195
5213
|
);
|
|
5196
5214
|
app.get(
|
|
5197
5215
|
"/api/agents/:agentId/voice/speakers",
|
|
5198
|
-
|
|
5216
|
+
w({
|
|
5199
5217
|
description: "Get available speakers for an agent",
|
|
5200
5218
|
tags: ["agents"],
|
|
5201
5219
|
parameters: [
|
|
@@ -5244,7 +5262,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5244
5262
|
c2.header("Link", '</api/agents/:agentId/voice/speak>; rel="successor-version"');
|
|
5245
5263
|
return next();
|
|
5246
5264
|
},
|
|
5247
|
-
|
|
5265
|
+
w({
|
|
5248
5266
|
description: "[DEPRECATED] Use /api/agents/:agentId/voice/speak instead. Convert text to speech using the agent's voice provider",
|
|
5249
5267
|
tags: ["agents"],
|
|
5250
5268
|
parameters: [
|
|
@@ -5314,7 +5332,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5314
5332
|
app.post(
|
|
5315
5333
|
"/api/agents/:agentId/voice/speak",
|
|
5316
5334
|
bodyLimit(bodyLimitOptions),
|
|
5317
|
-
|
|
5335
|
+
w({
|
|
5318
5336
|
description: "Convert text to speech using the agent's voice provider",
|
|
5319
5337
|
tags: ["agents"],
|
|
5320
5338
|
parameters: [
|
|
@@ -5388,7 +5406,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5388
5406
|
);
|
|
5389
5407
|
app.get(
|
|
5390
5408
|
"/api/agents/:agentId/voice/listener",
|
|
5391
|
-
|
|
5409
|
+
w({
|
|
5392
5410
|
description: "Get available listener for an agent",
|
|
5393
5411
|
tags: ["agents"],
|
|
5394
5412
|
parameters: [
|
|
@@ -5438,7 +5456,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5438
5456
|
c2.header("Link", '</api/agents/:agentId/voice/listen>; rel="successor-version"');
|
|
5439
5457
|
return next();
|
|
5440
5458
|
},
|
|
5441
|
-
|
|
5459
|
+
w({
|
|
5442
5460
|
description: "[DEPRECATED] Use /api/agents/:agentId/voice/listen instead. Convert speech to text using the agent's voice provider. Additional provider-specific options can be passed as query parameters.",
|
|
5443
5461
|
tags: ["agents"],
|
|
5444
5462
|
parameters: [
|
|
@@ -5494,7 +5512,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5494
5512
|
maxSize: 10 * 1024 * 1024
|
|
5495
5513
|
// 10 MB for audio files
|
|
5496
5514
|
}),
|
|
5497
|
-
|
|
5515
|
+
w({
|
|
5498
5516
|
description: "Convert speech to text using the agent's voice provider. Additional provider-specific options can be passed as query parameters.",
|
|
5499
5517
|
tags: ["agents"],
|
|
5500
5518
|
parameters: [
|
|
@@ -5558,7 +5576,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5558
5576
|
app.post(
|
|
5559
5577
|
"/api/agents/:agentId/tools/:toolId/execute",
|
|
5560
5578
|
bodyLimit(bodyLimitOptions),
|
|
5561
|
-
|
|
5579
|
+
w({
|
|
5562
5580
|
description: "Execute a tool through an agent",
|
|
5563
5581
|
tags: ["agents"],
|
|
5564
5582
|
parameters: [
|
|
@@ -5604,7 +5622,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5604
5622
|
app.post(
|
|
5605
5623
|
"/api/mcp/:serverId/mcp",
|
|
5606
5624
|
bodyLimit(bodyLimitOptions),
|
|
5607
|
-
|
|
5625
|
+
w({
|
|
5608
5626
|
description: "Send a message to an MCP server using Streamable HTTP",
|
|
5609
5627
|
tags: ["mcp"],
|
|
5610
5628
|
parameters: [
|
|
@@ -5633,7 +5651,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5633
5651
|
const mcpSseMessagePath = "/api/mcp/:serverId/messages";
|
|
5634
5652
|
app.get(
|
|
5635
5653
|
mcpSseBasePath,
|
|
5636
|
-
|
|
5654
|
+
w({
|
|
5637
5655
|
description: "Establish an MCP Server-Sent Events (SSE) connection with a server instance.",
|
|
5638
5656
|
tags: ["mcp"],
|
|
5639
5657
|
parameters: [
|
|
@@ -5659,7 +5677,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5659
5677
|
mcpSseMessagePath,
|
|
5660
5678
|
bodyLimit(bodyLimitOptions),
|
|
5661
5679
|
// Apply body limit for messages
|
|
5662
|
-
|
|
5680
|
+
w({
|
|
5663
5681
|
description: "Send a message to an MCP server over an established SSE connection.",
|
|
5664
5682
|
tags: ["mcp"],
|
|
5665
5683
|
parameters: [
|
|
@@ -5690,7 +5708,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5690
5708
|
);
|
|
5691
5709
|
app.get(
|
|
5692
5710
|
"/api/mcp/v0/servers",
|
|
5693
|
-
|
|
5711
|
+
w({
|
|
5694
5712
|
description: "List all available MCP server instances with basic information.",
|
|
5695
5713
|
tags: ["mcp"],
|
|
5696
5714
|
parameters: [
|
|
@@ -5767,7 +5785,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5767
5785
|
);
|
|
5768
5786
|
app.get(
|
|
5769
5787
|
"/api/mcp/v0/servers/:id",
|
|
5770
|
-
|
|
5788
|
+
w({
|
|
5771
5789
|
description: "Get detailed information about a specific MCP server instance.",
|
|
5772
5790
|
tags: ["mcp"],
|
|
5773
5791
|
parameters: [
|
|
@@ -5908,7 +5926,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5908
5926
|
);
|
|
5909
5927
|
app.get(
|
|
5910
5928
|
"/api/mcp/:serverId/tools",
|
|
5911
|
-
|
|
5929
|
+
w({
|
|
5912
5930
|
description: "List all tools available on a specific MCP server instance.",
|
|
5913
5931
|
tags: ["mcp"],
|
|
5914
5932
|
parameters: [
|
|
@@ -5931,7 +5949,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5931
5949
|
);
|
|
5932
5950
|
app.get(
|
|
5933
5951
|
"/api/mcp/:serverId/tools/:toolId",
|
|
5934
|
-
|
|
5952
|
+
w({
|
|
5935
5953
|
description: "Get details for a specific tool on an MCP server.",
|
|
5936
5954
|
tags: ["mcp"],
|
|
5937
5955
|
parameters: [
|
|
@@ -5950,7 +5968,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5950
5968
|
app.post(
|
|
5951
5969
|
"/api/mcp/:serverId/tools/:toolId/execute",
|
|
5952
5970
|
bodyLimit(bodyLimitOptions),
|
|
5953
|
-
|
|
5971
|
+
w({
|
|
5954
5972
|
description: "Execute a specific tool on an MCP server.",
|
|
5955
5973
|
tags: ["mcp"],
|
|
5956
5974
|
parameters: [
|
|
@@ -5983,7 +6001,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5983
6001
|
);
|
|
5984
6002
|
app.get(
|
|
5985
6003
|
"/api/memory/status",
|
|
5986
|
-
|
|
6004
|
+
w({
|
|
5987
6005
|
description: "Get memory status",
|
|
5988
6006
|
tags: ["memory"],
|
|
5989
6007
|
parameters: [
|
|
@@ -6004,7 +6022,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6004
6022
|
);
|
|
6005
6023
|
app.get(
|
|
6006
6024
|
"/api/memory/threads",
|
|
6007
|
-
|
|
6025
|
+
w({
|
|
6008
6026
|
description: "Get all threads",
|
|
6009
6027
|
tags: ["memory"],
|
|
6010
6028
|
parameters: [
|
|
@@ -6031,7 +6049,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6031
6049
|
);
|
|
6032
6050
|
app.get(
|
|
6033
6051
|
"/api/memory/threads/:threadId",
|
|
6034
|
-
|
|
6052
|
+
w({
|
|
6035
6053
|
description: "Get thread by ID",
|
|
6036
6054
|
tags: ["memory"],
|
|
6037
6055
|
parameters: [
|
|
@@ -6061,7 +6079,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6061
6079
|
);
|
|
6062
6080
|
app.get(
|
|
6063
6081
|
"/api/memory/threads/:threadId/messages",
|
|
6064
|
-
|
|
6082
|
+
w({
|
|
6065
6083
|
description: "Get messages for a thread",
|
|
6066
6084
|
tags: ["memory"],
|
|
6067
6085
|
parameters: [
|
|
@@ -6096,7 +6114,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6096
6114
|
app.post(
|
|
6097
6115
|
"/api/memory/threads",
|
|
6098
6116
|
bodyLimit(bodyLimitOptions),
|
|
6099
|
-
|
|
6117
|
+
w({
|
|
6100
6118
|
description: "Create a new thread",
|
|
6101
6119
|
tags: ["memory"],
|
|
6102
6120
|
parameters: [
|
|
@@ -6133,7 +6151,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6133
6151
|
);
|
|
6134
6152
|
app.patch(
|
|
6135
6153
|
"/api/memory/threads/:threadId",
|
|
6136
|
-
|
|
6154
|
+
w({
|
|
6137
6155
|
description: "Update a thread",
|
|
6138
6156
|
tags: ["memory"],
|
|
6139
6157
|
parameters: [
|
|
@@ -6171,7 +6189,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6171
6189
|
);
|
|
6172
6190
|
app.delete(
|
|
6173
6191
|
"/api/memory/threads/:threadId",
|
|
6174
|
-
|
|
6192
|
+
w({
|
|
6175
6193
|
description: "Delete a thread",
|
|
6176
6194
|
tags: ["memory"],
|
|
6177
6195
|
parameters: [
|
|
@@ -6202,7 +6220,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6202
6220
|
app.post(
|
|
6203
6221
|
"/api/memory/save-messages",
|
|
6204
6222
|
bodyLimit(bodyLimitOptions),
|
|
6205
|
-
|
|
6223
|
+
w({
|
|
6206
6224
|
description: "Save messages",
|
|
6207
6225
|
tags: ["memory"],
|
|
6208
6226
|
parameters: [
|
|
@@ -6240,7 +6258,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6240
6258
|
);
|
|
6241
6259
|
app.get(
|
|
6242
6260
|
"/api/telemetry",
|
|
6243
|
-
|
|
6261
|
+
w({
|
|
6244
6262
|
description: "Get all traces",
|
|
6245
6263
|
tags: ["telemetry"],
|
|
6246
6264
|
responses: {
|
|
@@ -6253,7 +6271,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6253
6271
|
);
|
|
6254
6272
|
app.post(
|
|
6255
6273
|
"/api/telemetry",
|
|
6256
|
-
|
|
6274
|
+
w({
|
|
6257
6275
|
description: "Store telemetry",
|
|
6258
6276
|
tags: ["telemetry"],
|
|
6259
6277
|
responses: {
|
|
@@ -6266,7 +6284,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6266
6284
|
);
|
|
6267
6285
|
app.get(
|
|
6268
6286
|
"/api/workflows/legacy",
|
|
6269
|
-
|
|
6287
|
+
w({
|
|
6270
6288
|
description: "Get all legacy workflows",
|
|
6271
6289
|
tags: ["legacyWorkflows"],
|
|
6272
6290
|
responses: {
|
|
@@ -6279,7 +6297,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6279
6297
|
);
|
|
6280
6298
|
app.get(
|
|
6281
6299
|
"/api/workflows/legacy/:workflowId",
|
|
6282
|
-
|
|
6300
|
+
w({
|
|
6283
6301
|
description: "Get legacy workflow by ID",
|
|
6284
6302
|
tags: ["legacyWorkflows"],
|
|
6285
6303
|
parameters: [
|
|
@@ -6303,7 +6321,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6303
6321
|
);
|
|
6304
6322
|
app.get(
|
|
6305
6323
|
"/api/workflows/legacy/:workflowId/runs",
|
|
6306
|
-
|
|
6324
|
+
w({
|
|
6307
6325
|
description: "Get all runs for a legacy workflow",
|
|
6308
6326
|
tags: ["legacyWorkflows"],
|
|
6309
6327
|
parameters: [
|
|
@@ -6329,7 +6347,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6329
6347
|
);
|
|
6330
6348
|
app.post(
|
|
6331
6349
|
"/api/workflows/legacy/:workflowId/resume",
|
|
6332
|
-
|
|
6350
|
+
w({
|
|
6333
6351
|
description: "Resume a suspended legacy workflow step",
|
|
6334
6352
|
tags: ["legacyWorkflows"],
|
|
6335
6353
|
parameters: [
|
|
@@ -6366,7 +6384,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6366
6384
|
app.post(
|
|
6367
6385
|
"/api/workflows/legacy/:workflowId/resume-async",
|
|
6368
6386
|
bodyLimit(bodyLimitOptions),
|
|
6369
|
-
|
|
6387
|
+
w({
|
|
6370
6388
|
description: "Resume a suspended legacy workflow step",
|
|
6371
6389
|
tags: ["legacyWorkflows"],
|
|
6372
6390
|
parameters: [
|
|
@@ -6402,7 +6420,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6402
6420
|
);
|
|
6403
6421
|
app.post(
|
|
6404
6422
|
"/api/workflows/legacy/:workflowId/create-run",
|
|
6405
|
-
|
|
6423
|
+
w({
|
|
6406
6424
|
description: "Create a new legacy workflow run",
|
|
6407
6425
|
tags: ["legacyWorkflows"],
|
|
6408
6426
|
parameters: [
|
|
@@ -6430,7 +6448,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6430
6448
|
app.post(
|
|
6431
6449
|
"/api/workflows/legacy/:workflowId/start-async",
|
|
6432
6450
|
bodyLimit(bodyLimitOptions),
|
|
6433
|
-
|
|
6451
|
+
w({
|
|
6434
6452
|
description: "Execute/Start a legacy workflow",
|
|
6435
6453
|
tags: ["legacyWorkflows"],
|
|
6436
6454
|
parameters: [
|
|
@@ -6473,7 +6491,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6473
6491
|
);
|
|
6474
6492
|
app.post(
|
|
6475
6493
|
"/api/workflows/legacy/:workflowId/start",
|
|
6476
|
-
|
|
6494
|
+
w({
|
|
6477
6495
|
description: "Create and start a new legacy workflow run",
|
|
6478
6496
|
tags: ["legacyWorkflows"],
|
|
6479
6497
|
parameters: [
|
|
@@ -6516,7 +6534,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6516
6534
|
);
|
|
6517
6535
|
app.get(
|
|
6518
6536
|
"/api/workflows/legacy/:workflowId/watch",
|
|
6519
|
-
|
|
6537
|
+
w({
|
|
6520
6538
|
description: "Watch legacy workflow transitions in real-time",
|
|
6521
6539
|
parameters: [
|
|
6522
6540
|
{
|
|
@@ -6543,7 +6561,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6543
6561
|
);
|
|
6544
6562
|
app.post(
|
|
6545
6563
|
"/api/workflows/:workflowId/stream",
|
|
6546
|
-
|
|
6564
|
+
w({
|
|
6547
6565
|
description: "Stream workflow in real-time",
|
|
6548
6566
|
parameters: [
|
|
6549
6567
|
{
|
|
@@ -6590,7 +6608,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6590
6608
|
);
|
|
6591
6609
|
app.get(
|
|
6592
6610
|
"/api/workflows",
|
|
6593
|
-
|
|
6611
|
+
w({
|
|
6594
6612
|
description: "Get all workflows",
|
|
6595
6613
|
tags: ["workflows"],
|
|
6596
6614
|
responses: {
|
|
@@ -6603,7 +6621,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6603
6621
|
);
|
|
6604
6622
|
app.get(
|
|
6605
6623
|
"/api/workflows/:workflowId",
|
|
6606
|
-
|
|
6624
|
+
w({
|
|
6607
6625
|
description: "Get workflow by ID",
|
|
6608
6626
|
tags: ["workflows"],
|
|
6609
6627
|
parameters: [
|
|
@@ -6627,7 +6645,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6627
6645
|
);
|
|
6628
6646
|
app.get(
|
|
6629
6647
|
"/api/workflows/:workflowId/runs",
|
|
6630
|
-
|
|
6648
|
+
w({
|
|
6631
6649
|
description: "Get all runs for a workflow",
|
|
6632
6650
|
tags: ["workflows"],
|
|
6633
6651
|
parameters: [
|
|
@@ -6653,7 +6671,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6653
6671
|
);
|
|
6654
6672
|
app.post(
|
|
6655
6673
|
"/api/workflows/:workflowId/resume",
|
|
6656
|
-
|
|
6674
|
+
w({
|
|
6657
6675
|
description: "Resume a suspended workflow step",
|
|
6658
6676
|
tags: ["workflows"],
|
|
6659
6677
|
parameters: [
|
|
@@ -6697,7 +6715,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6697
6715
|
app.post(
|
|
6698
6716
|
"/api/workflows/:workflowId/resume-async",
|
|
6699
6717
|
bodyLimit(bodyLimitOptions),
|
|
6700
|
-
|
|
6718
|
+
w({
|
|
6701
6719
|
description: "Resume a suspended workflow step",
|
|
6702
6720
|
tags: ["workflows"],
|
|
6703
6721
|
parameters: [
|
|
@@ -6741,7 +6759,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6741
6759
|
app.post(
|
|
6742
6760
|
"/api/workflows/:workflowId/create-run",
|
|
6743
6761
|
bodyLimit(bodyLimitOptions),
|
|
6744
|
-
|
|
6762
|
+
w({
|
|
6745
6763
|
description: "Create a new workflow run",
|
|
6746
6764
|
tags: ["workflows"],
|
|
6747
6765
|
parameters: [
|
|
@@ -6769,7 +6787,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6769
6787
|
app.post(
|
|
6770
6788
|
"/api/workflows/:workflowId/start-async",
|
|
6771
6789
|
bodyLimit(bodyLimitOptions),
|
|
6772
|
-
|
|
6790
|
+
w({
|
|
6773
6791
|
description: "Execute/Start a workflow",
|
|
6774
6792
|
tags: ["workflows"],
|
|
6775
6793
|
parameters: [
|
|
@@ -6816,7 +6834,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6816
6834
|
);
|
|
6817
6835
|
app.post(
|
|
6818
6836
|
"/api/workflows/:workflowId/start",
|
|
6819
|
-
|
|
6837
|
+
w({
|
|
6820
6838
|
description: "Create and start a new workflow run",
|
|
6821
6839
|
tags: ["workflows"],
|
|
6822
6840
|
parameters: [
|
|
@@ -6863,7 +6881,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6863
6881
|
);
|
|
6864
6882
|
app.get(
|
|
6865
6883
|
"/api/workflows/:workflowId/watch",
|
|
6866
|
-
|
|
6884
|
+
w({
|
|
6867
6885
|
description: "Watch workflow transitions in real-time",
|
|
6868
6886
|
parameters: [
|
|
6869
6887
|
{
|
|
@@ -6890,7 +6908,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6890
6908
|
);
|
|
6891
6909
|
app.get(
|
|
6892
6910
|
"/api/logs",
|
|
6893
|
-
|
|
6911
|
+
w({
|
|
6894
6912
|
description: "Get all logs",
|
|
6895
6913
|
tags: ["logs"],
|
|
6896
6914
|
parameters: [
|
|
@@ -6899,11 +6917,47 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6899
6917
|
in: "query",
|
|
6900
6918
|
required: true,
|
|
6901
6919
|
schema: { type: "string" }
|
|
6920
|
+
},
|
|
6921
|
+
{
|
|
6922
|
+
name: "fromDate",
|
|
6923
|
+
in: "query",
|
|
6924
|
+
required: false,
|
|
6925
|
+
schema: { type: "string" }
|
|
6926
|
+
},
|
|
6927
|
+
{
|
|
6928
|
+
name: "toDate",
|
|
6929
|
+
in: "query",
|
|
6930
|
+
required: false,
|
|
6931
|
+
schema: { type: "string" }
|
|
6932
|
+
},
|
|
6933
|
+
{
|
|
6934
|
+
name: "logLevel",
|
|
6935
|
+
in: "query",
|
|
6936
|
+
required: false,
|
|
6937
|
+
schema: { type: "string" }
|
|
6938
|
+
},
|
|
6939
|
+
{
|
|
6940
|
+
name: "filters",
|
|
6941
|
+
in: "query",
|
|
6942
|
+
required: false,
|
|
6943
|
+
schema: { type: "string" }
|
|
6944
|
+
},
|
|
6945
|
+
{
|
|
6946
|
+
name: "page",
|
|
6947
|
+
in: "query",
|
|
6948
|
+
required: false,
|
|
6949
|
+
schema: { type: "number" }
|
|
6950
|
+
},
|
|
6951
|
+
{
|
|
6952
|
+
name: "perPage",
|
|
6953
|
+
in: "query",
|
|
6954
|
+
required: false,
|
|
6955
|
+
schema: { type: "number" }
|
|
6902
6956
|
}
|
|
6903
6957
|
],
|
|
6904
6958
|
responses: {
|
|
6905
6959
|
200: {
|
|
6906
|
-
description: "
|
|
6960
|
+
description: "Paginated list of all logs"
|
|
6907
6961
|
}
|
|
6908
6962
|
}
|
|
6909
6963
|
}),
|
|
@@ -6911,7 +6965,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6911
6965
|
);
|
|
6912
6966
|
app.get(
|
|
6913
6967
|
"/api/logs/transports",
|
|
6914
|
-
|
|
6968
|
+
w({
|
|
6915
6969
|
description: "List of all log transports",
|
|
6916
6970
|
tags: ["logs"],
|
|
6917
6971
|
responses: {
|
|
@@ -6924,7 +6978,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6924
6978
|
);
|
|
6925
6979
|
app.get(
|
|
6926
6980
|
"/api/logs/:runId",
|
|
6927
|
-
|
|
6981
|
+
w({
|
|
6928
6982
|
description: "Get logs by run ID",
|
|
6929
6983
|
tags: ["logs"],
|
|
6930
6984
|
parameters: [
|
|
@@ -6939,11 +6993,47 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6939
6993
|
in: "query",
|
|
6940
6994
|
required: true,
|
|
6941
6995
|
schema: { type: "string" }
|
|
6996
|
+
},
|
|
6997
|
+
{
|
|
6998
|
+
name: "fromDate",
|
|
6999
|
+
in: "query",
|
|
7000
|
+
required: false,
|
|
7001
|
+
schema: { type: "string" }
|
|
7002
|
+
},
|
|
7003
|
+
{
|
|
7004
|
+
name: "toDate",
|
|
7005
|
+
in: "query",
|
|
7006
|
+
required: false,
|
|
7007
|
+
schema: { type: "string" }
|
|
7008
|
+
},
|
|
7009
|
+
{
|
|
7010
|
+
name: "logLevel",
|
|
7011
|
+
in: "query",
|
|
7012
|
+
required: false,
|
|
7013
|
+
schema: { type: "string" }
|
|
7014
|
+
},
|
|
7015
|
+
{
|
|
7016
|
+
name: "filters",
|
|
7017
|
+
in: "query",
|
|
7018
|
+
required: false,
|
|
7019
|
+
schema: { type: "string" }
|
|
7020
|
+
},
|
|
7021
|
+
{
|
|
7022
|
+
name: "page",
|
|
7023
|
+
in: "query",
|
|
7024
|
+
required: false,
|
|
7025
|
+
schema: { type: "number" }
|
|
7026
|
+
},
|
|
7027
|
+
{
|
|
7028
|
+
name: "perPage",
|
|
7029
|
+
in: "query",
|
|
7030
|
+
required: false,
|
|
7031
|
+
schema: { type: "number" }
|
|
6942
7032
|
}
|
|
6943
7033
|
],
|
|
6944
7034
|
responses: {
|
|
6945
7035
|
200: {
|
|
6946
|
-
description: "
|
|
7036
|
+
description: "Paginated list of logs for run ID"
|
|
6947
7037
|
}
|
|
6948
7038
|
}
|
|
6949
7039
|
}),
|
|
@@ -6951,7 +7041,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6951
7041
|
);
|
|
6952
7042
|
app.get(
|
|
6953
7043
|
"/api/tools",
|
|
6954
|
-
|
|
7044
|
+
w({
|
|
6955
7045
|
description: "Get all tools",
|
|
6956
7046
|
tags: ["tools"],
|
|
6957
7047
|
responses: {
|
|
@@ -6964,7 +7054,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6964
7054
|
);
|
|
6965
7055
|
app.get(
|
|
6966
7056
|
"/api/tools/:toolId",
|
|
6967
|
-
|
|
7057
|
+
w({
|
|
6968
7058
|
description: "Get tool by ID",
|
|
6969
7059
|
tags: ["tools"],
|
|
6970
7060
|
parameters: [
|
|
@@ -6989,7 +7079,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
6989
7079
|
app.post(
|
|
6990
7080
|
"/api/tools/:toolId/execute",
|
|
6991
7081
|
bodyLimit(bodyLimitOptions),
|
|
6992
|
-
|
|
7082
|
+
w({
|
|
6993
7083
|
description: "Execute a tool",
|
|
6994
7084
|
tags: ["tools"],
|
|
6995
7085
|
parameters: [
|
|
@@ -7035,7 +7125,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7035
7125
|
app.post(
|
|
7036
7126
|
"/api/vector/:vectorName/upsert",
|
|
7037
7127
|
bodyLimit(bodyLimitOptions),
|
|
7038
|
-
|
|
7128
|
+
w({
|
|
7039
7129
|
description: "Upsert vectors into an index",
|
|
7040
7130
|
tags: ["vector"],
|
|
7041
7131
|
parameters: [
|
|
@@ -7086,7 +7176,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7086
7176
|
app.post(
|
|
7087
7177
|
"/api/vector/:vectorName/create-index",
|
|
7088
7178
|
bodyLimit(bodyLimitOptions),
|
|
7089
|
-
|
|
7179
|
+
w({
|
|
7090
7180
|
description: "Create a new vector index",
|
|
7091
7181
|
tags: ["vector"],
|
|
7092
7182
|
parameters: [
|
|
@@ -7127,7 +7217,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7127
7217
|
app.post(
|
|
7128
7218
|
"/api/vector/:vectorName/query",
|
|
7129
7219
|
bodyLimit(bodyLimitOptions),
|
|
7130
|
-
|
|
7220
|
+
w({
|
|
7131
7221
|
description: "Query vectors from an index",
|
|
7132
7222
|
tags: ["vector"],
|
|
7133
7223
|
parameters: [
|
|
@@ -7169,7 +7259,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7169
7259
|
);
|
|
7170
7260
|
app.get(
|
|
7171
7261
|
"/api/vector/:vectorName/indexes",
|
|
7172
|
-
|
|
7262
|
+
w({
|
|
7173
7263
|
description: "List all indexes for a vector store",
|
|
7174
7264
|
tags: ["vector"],
|
|
7175
7265
|
parameters: [
|
|
@@ -7190,7 +7280,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7190
7280
|
);
|
|
7191
7281
|
app.get(
|
|
7192
7282
|
"/api/vector/:vectorName/indexes/:indexName",
|
|
7193
|
-
|
|
7283
|
+
w({
|
|
7194
7284
|
description: "Get details about a specific index",
|
|
7195
7285
|
tags: ["vector"],
|
|
7196
7286
|
parameters: [
|
|
@@ -7217,7 +7307,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7217
7307
|
);
|
|
7218
7308
|
app.delete(
|
|
7219
7309
|
"/api/vector/:vectorName/indexes/:indexName",
|
|
7220
|
-
|
|
7310
|
+
w({
|
|
7221
7311
|
description: "Delete a specific index",
|
|
7222
7312
|
tags: ["vector"],
|
|
7223
7313
|
parameters: [
|
|
@@ -7245,7 +7335,7 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7245
7335
|
if (options?.isDev || server?.build?.openAPIDocs || server?.build?.swaggerUI) {
|
|
7246
7336
|
app.get(
|
|
7247
7337
|
"/openapi.json",
|
|
7248
|
-
|
|
7338
|
+
h(app, {
|
|
7249
7339
|
documentation: {
|
|
7250
7340
|
info: { title: "Mastra API", version: "1.0.0", description: "Mastra API" }
|
|
7251
7341
|
}
|
|
@@ -7319,6 +7409,13 @@ async function createNodeServer(mastra, options = {}) {
|
|
|
7319
7409
|
if (options?.playground) {
|
|
7320
7410
|
logger2.info(`\u{1F468}\u200D\u{1F4BB} Playground available at http://${host}:${port}/`);
|
|
7321
7411
|
}
|
|
7412
|
+
if (process.send) {
|
|
7413
|
+
process.send({
|
|
7414
|
+
type: "server-ready",
|
|
7415
|
+
port,
|
|
7416
|
+
host
|
|
7417
|
+
});
|
|
7418
|
+
}
|
|
7322
7419
|
}
|
|
7323
7420
|
);
|
|
7324
7421
|
return server;
|