@mastra/server 1.21.0-alpha.2 → 1.22.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/dist/{chunk-FURWD3DL.cjs → chunk-2MQOYDF5.cjs} +14 -14
- package/dist/{chunk-FURWD3DL.cjs.map → chunk-2MQOYDF5.cjs.map} +1 -1
- package/dist/{chunk-7G44ZSFS.cjs → chunk-3TZN3YIC.cjs} +4 -4
- package/dist/{chunk-7G44ZSFS.cjs.map → chunk-3TZN3YIC.cjs.map} +1 -1
- package/dist/{chunk-GWPNQNXF.cjs → chunk-42ZYNYQI.cjs} +4 -4
- package/dist/{chunk-GWPNQNXF.cjs.map → chunk-42ZYNYQI.cjs.map} +1 -1
- package/dist/{chunk-VKIIGA2F.js → chunk-5ZQYFQ5P.js} +3 -3
- package/dist/{chunk-VKIIGA2F.js.map → chunk-5ZQYFQ5P.js.map} +1 -1
- package/dist/{chunk-DWXE75AZ.cjs → chunk-63O6VEOH.cjs} +2 -2
- package/dist/{chunk-DWXE75AZ.cjs.map → chunk-63O6VEOH.cjs.map} +1 -1
- package/dist/{chunk-VCA6BSYU.js → chunk-6CSJOAJM.js} +3 -3
- package/dist/{chunk-VCA6BSYU.js.map → chunk-6CSJOAJM.js.map} +1 -1
- package/dist/{chunk-ZA3NGM3L.js → chunk-6FD7UBEK.js} +5 -5
- package/dist/{chunk-ZA3NGM3L.js.map → chunk-6FD7UBEK.js.map} +1 -1
- package/dist/chunk-AXFG5JMX.js +221 -0
- package/dist/chunk-AXFG5JMX.js.map +1 -0
- package/dist/{chunk-JQMV7UUI.js → chunk-BPRE3HGQ.js} +13 -12
- package/dist/chunk-BPRE3HGQ.js.map +1 -0
- package/dist/{chunk-HPJLJQVC.cjs → chunk-C4M6VJGY.cjs} +6 -6
- package/dist/{chunk-HPJLJQVC.cjs.map → chunk-C4M6VJGY.cjs.map} +1 -1
- package/dist/{chunk-N3RNJ7AM.js → chunk-H77IQ6X3.js} +4 -2
- package/dist/chunk-H77IQ6X3.js.map +1 -0
- package/dist/{chunk-VHUB2TYN.js → chunk-LPD67DCH.js} +3 -3
- package/dist/{chunk-VHUB2TYN.js.map → chunk-LPD67DCH.js.map} +1 -1
- package/dist/{chunk-IRRJW5EA.cjs → chunk-M3CYE3JU.cjs} +5 -5
- package/dist/{chunk-IRRJW5EA.cjs.map → chunk-M3CYE3JU.cjs.map} +1 -1
- package/dist/{chunk-NCW7IFFR.js → chunk-MBZT5YVO.js} +4 -4
- package/dist/{chunk-NCW7IFFR.js.map → chunk-MBZT5YVO.js.map} +1 -1
- package/dist/{chunk-5IUEYXJ7.cjs → chunk-NAQDQGBB.cjs} +6 -6
- package/dist/{chunk-5IUEYXJ7.cjs.map → chunk-NAQDQGBB.cjs.map} +1 -1
- package/dist/{chunk-LSPBHVDD.cjs → chunk-OCU2OAMS.cjs} +16 -15
- package/dist/chunk-OCU2OAMS.cjs.map +1 -0
- package/dist/chunk-R474QJUF.cjs +229 -0
- package/dist/chunk-R474QJUF.cjs.map +1 -0
- package/dist/{chunk-QRLCHOWX.js → chunk-SKGWZXFE.js} +3 -3
- package/dist/{chunk-QRLCHOWX.js.map → chunk-SKGWZXFE.js.map} +1 -1
- package/dist/{chunk-NRKHBUH6.cjs → chunk-V3CH6G5F.cjs} +287 -79
- package/dist/chunk-V3CH6G5F.cjs.map +1 -0
- package/dist/{chunk-KXZR6QGF.cjs → chunk-WGB6F36S.cjs} +4 -2
- package/dist/chunk-WGB6F36S.cjs.map +1 -0
- package/dist/{chunk-G5IQN5ZG.cjs → chunk-XWCIHYAP.cjs} +5 -5
- package/dist/{chunk-G5IQN5ZG.cjs.map → chunk-XWCIHYAP.cjs.map} +1 -1
- package/dist/{chunk-SW6IJZFQ.js → chunk-ZMBEDBRB.js} +2 -2
- package/dist/{chunk-SW6IJZFQ.js.map → chunk-ZMBEDBRB.js.map} +1 -1
- package/dist/{chunk-H6VY6X5Y.js → chunk-ZPVDK5G4.js} +3 -3
- package/dist/{chunk-H6VY6X5Y.js.map → chunk-ZPVDK5G4.js.map} +1 -1
- package/dist/{chunk-QFX2PGOA.js → chunk-ZZQRRB35.js} +216 -8
- package/dist/chunk-ZZQRRB35.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/handlers/a2a.cjs +9 -9
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +16 -16
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agents.cjs +34 -34
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/conversations.cjs +5 -5
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/gateway-memory-client.cjs +36 -0
- package/dist/server/handlers/gateway-memory-client.cjs.map +1 -0
- package/dist/server/handlers/gateway-memory-client.d.ts +169 -0
- package/dist/server/handlers/gateway-memory-client.d.ts.map +1 -0
- package/dist/server/handlers/gateway-memory-client.js +3 -0
- package/dist/server/handlers/gateway-memory-client.js.map +1 -0
- package/dist/server/handlers/memory.cjs +27 -27
- package/dist/server/handlers/memory.d.ts +15 -0
- package/dist/server/handlers/memory.d.ts.map +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/responses.cjs +4 -4
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/scores.cjs +7 -7
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -8
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers.cjs +21 -21
- package/dist/server/handlers.js +9 -9
- package/dist/server/schemas/index.cjs +167 -167
- package/dist/server/schemas/index.js +3 -3
- package/dist/server/schemas/memory.d.ts +8 -0
- package/dist/server/schemas/memory.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +98 -98
- package/dist/server/server-adapter/index.js +10 -10
- package/dist/server/server-adapter/routes/memory.d.ts +15 -0
- package/dist/server/server-adapter/routes/memory.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/chunk-JQMV7UUI.js.map +0 -1
- package/dist/chunk-KXZR6QGF.cjs.map +0 -1
- package/dist/chunk-LSPBHVDD.cjs.map +0 -1
- package/dist/chunk-N3RNJ7AM.js.map +0 -1
- package/dist/chunk-NRKHBUH6.cjs.map +0 -1
- package/dist/chunk-QFX2PGOA.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWGB6F36S_cjs = require('./chunk-WGB6F36S.cjs');
|
|
4
|
+
var chunkR474QJUF_cjs = require('./chunk-R474QJUF.cjs');
|
|
4
5
|
var chunkZKMVCV4G_cjs = require('./chunk-ZKMVCV4G.cjs');
|
|
5
6
|
var chunkB34S64RC_cjs = require('./chunk-B34S64RC.cjs');
|
|
6
7
|
var chunkEGSCXVMR_cjs = require('./chunk-EGSCXVMR.cjs');
|
|
@@ -208,17 +209,48 @@ var GET_MEMORY_STATUS_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
208
209
|
method: "GET",
|
|
209
210
|
path: "/memory/status",
|
|
210
211
|
responseType: "json",
|
|
211
|
-
queryParamSchema:
|
|
212
|
-
responseSchema:
|
|
212
|
+
queryParamSchema: chunkWGB6F36S_cjs.getMemoryStatusQuerySchema,
|
|
213
|
+
responseSchema: chunkWGB6F36S_cjs.memoryStatusResponseSchema,
|
|
213
214
|
summary: "Get memory status",
|
|
214
215
|
description: "Returns the current status of the memory system including configuration and health information",
|
|
215
216
|
tags: ["Memory"],
|
|
216
217
|
requiresAuth: true,
|
|
217
218
|
handler: async ({ mastra, agentId, resourceId, threadId, requestContext }) => {
|
|
218
219
|
try {
|
|
220
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
221
|
+
const isGateway = agent ? await chunkR474QJUF_cjs.isGatewayAgentAsync(agent) : false;
|
|
222
|
+
if (agent && isGateway) {
|
|
223
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
224
|
+
if (gwClient) {
|
|
225
|
+
let omStatus;
|
|
226
|
+
if (resourceId && threadId) {
|
|
227
|
+
try {
|
|
228
|
+
const { record } = await gwClient.getObservationRecord(threadId, resourceId);
|
|
229
|
+
if (record) {
|
|
230
|
+
omStatus = {
|
|
231
|
+
enabled: true,
|
|
232
|
+
hasRecord: true,
|
|
233
|
+
originType: record.originType,
|
|
234
|
+
lastObservedAt: record.lastObservedAt ? new Date(record.lastObservedAt) : void 0,
|
|
235
|
+
tokenCount: record.totalTokensObserved,
|
|
236
|
+
observationTokenCount: record.observationTokenCount,
|
|
237
|
+
isObserving: record.isObserving,
|
|
238
|
+
isReflecting: record.isReflecting
|
|
239
|
+
};
|
|
240
|
+
} else {
|
|
241
|
+
omStatus = { enabled: true, hasRecord: false };
|
|
242
|
+
}
|
|
243
|
+
} catch {
|
|
244
|
+
omStatus = { enabled: true };
|
|
245
|
+
}
|
|
246
|
+
} else {
|
|
247
|
+
omStatus = { enabled: true };
|
|
248
|
+
}
|
|
249
|
+
return { result: true, memoryType: "gateway", observationalMemory: omStatus };
|
|
250
|
+
}
|
|
251
|
+
}
|
|
219
252
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
220
253
|
if (memory) {
|
|
221
|
-
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
222
254
|
let omStatus;
|
|
223
255
|
if (agent) {
|
|
224
256
|
const omConfig = await getOMConfigFromAgent(agent, requestContext);
|
|
@@ -246,7 +278,7 @@ var GET_MEMORY_STATUS_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
246
278
|
omStatus = { enabled: true };
|
|
247
279
|
}
|
|
248
280
|
}
|
|
249
|
-
return { result: true, observationalMemory: omStatus };
|
|
281
|
+
return { result: true, memoryType: "local", observationalMemory: omStatus };
|
|
250
282
|
}
|
|
251
283
|
if (!agentId) {
|
|
252
284
|
const storage = getStorageFromContext({ mastra });
|
|
@@ -264,20 +296,33 @@ var GET_MEMORY_CONFIG_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
264
296
|
method: "GET",
|
|
265
297
|
path: "/memory/config",
|
|
266
298
|
responseType: "json",
|
|
267
|
-
queryParamSchema:
|
|
268
|
-
responseSchema:
|
|
299
|
+
queryParamSchema: chunkWGB6F36S_cjs.getMemoryConfigQuerySchema,
|
|
300
|
+
responseSchema: chunkWGB6F36S_cjs.memoryConfigResponseSchema,
|
|
269
301
|
summary: "Get memory configuration",
|
|
270
302
|
description: "Returns the memory configuration for a specific agent or the system default",
|
|
271
303
|
tags: ["Memory"],
|
|
272
304
|
requiresAuth: true,
|
|
273
305
|
handler: async ({ mastra, agentId, requestContext }) => {
|
|
274
306
|
try {
|
|
307
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
308
|
+
if (agent && await chunkR474QJUF_cjs.isGatewayAgentAsync(agent) && chunkR474QJUF_cjs.getGatewayClient()) {
|
|
309
|
+
return {
|
|
310
|
+
memoryType: "gateway",
|
|
311
|
+
config: {
|
|
312
|
+
observationalMemory: {
|
|
313
|
+
enabled: true,
|
|
314
|
+
scope: "thread",
|
|
315
|
+
messageTokens: 3e4,
|
|
316
|
+
observationTokens: 4e4
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
}
|
|
275
321
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
276
322
|
if (!memory) {
|
|
277
323
|
return { config: null };
|
|
278
324
|
}
|
|
279
325
|
const config = memory.getMergedThreadConfig({});
|
|
280
|
-
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
281
326
|
let omConfig;
|
|
282
327
|
if (agent) {
|
|
283
328
|
omConfig = await getOMConfigFromAgent(agent, requestContext) ?? { enabled: false };
|
|
@@ -297,8 +342,8 @@ var GET_OBSERVATIONAL_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
297
342
|
method: "GET",
|
|
298
343
|
path: "/memory/observational-memory",
|
|
299
344
|
responseType: "json",
|
|
300
|
-
queryParamSchema:
|
|
301
|
-
responseSchema:
|
|
345
|
+
queryParamSchema: chunkWGB6F36S_cjs.getObservationalMemoryQuerySchema,
|
|
346
|
+
responseSchema: chunkWGB6F36S_cjs.getObservationalMemoryResponseSchema,
|
|
302
347
|
summary: "Get observational memory data",
|
|
303
348
|
description: "Returns the current observational memory record and optional history for a resource/thread",
|
|
304
349
|
tags: ["Memory"],
|
|
@@ -309,6 +354,20 @@ var GET_OBSERVATIONAL_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
309
354
|
if (!agent) {
|
|
310
355
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Agent not found" });
|
|
311
356
|
}
|
|
357
|
+
if (await chunkR474QJUF_cjs.isGatewayAgentAsync(agent)) {
|
|
358
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
359
|
+
if (gwClient && resourceId && threadId) {
|
|
360
|
+
const [recordResult, historyResult] = await Promise.all([
|
|
361
|
+
gwClient.getObservationRecord(threadId, resourceId),
|
|
362
|
+
gwClient.getObservationHistory(threadId, { resourceId, limit: 5 })
|
|
363
|
+
]);
|
|
364
|
+
return {
|
|
365
|
+
record: recordResult.record ? chunkR474QJUF_cjs.toLocalOMRecord(recordResult.record) : null,
|
|
366
|
+
history: historyResult.records?.length > 0 ? historyResult.records.map(chunkR474QJUF_cjs.toLocalOMRecord) : void 0
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
return { record: null, history: void 0 };
|
|
370
|
+
}
|
|
312
371
|
const omConfig = await getOMConfigFromAgent(agent, requestContext);
|
|
313
372
|
if (!omConfig?.enabled) {
|
|
314
373
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Observational Memory is not enabled for this agent" });
|
|
@@ -346,8 +405,8 @@ var AWAIT_BUFFER_STATUS_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
346
405
|
method: "POST",
|
|
347
406
|
path: "/memory/observational-memory/buffer-status",
|
|
348
407
|
responseType: "json",
|
|
349
|
-
bodySchema:
|
|
350
|
-
responseSchema:
|
|
408
|
+
bodySchema: chunkWGB6F36S_cjs.awaitBufferStatusBodySchema,
|
|
409
|
+
responseSchema: chunkWGB6F36S_cjs.awaitBufferStatusResponseSchema,
|
|
351
410
|
summary: "Await observational memory buffering completion",
|
|
352
411
|
description: "Blocks until any in-flight buffering operations complete for the given thread/resource, then returns the updated record",
|
|
353
412
|
tags: ["Memory"],
|
|
@@ -358,6 +417,25 @@ var AWAIT_BUFFER_STATUS_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
358
417
|
if (!agent) {
|
|
359
418
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Agent not found" });
|
|
360
419
|
}
|
|
420
|
+
if (await chunkR474QJUF_cjs.isGatewayAgentAsync(agent)) {
|
|
421
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
422
|
+
if (gwClient && resourceId && threadId) {
|
|
423
|
+
const maxWaitMs = 3e4;
|
|
424
|
+
const pollIntervalMs = 1e3;
|
|
425
|
+
const deadline = Date.now() + maxWaitMs;
|
|
426
|
+
let record2 = null;
|
|
427
|
+
while (Date.now() < deadline) {
|
|
428
|
+
const result = await gwClient.getObservationRecord(threadId, resourceId);
|
|
429
|
+
record2 = result.record ? chunkR474QJUF_cjs.toLocalOMRecord(result.record) : null;
|
|
430
|
+
if (!record2 || !record2.isBufferingObservation && !record2.isBufferingReflection) {
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
434
|
+
}
|
|
435
|
+
return { record: record2 };
|
|
436
|
+
}
|
|
437
|
+
return { record: null };
|
|
438
|
+
}
|
|
361
439
|
const omConfig = await getOMConfigFromAgent(agent, requestContext);
|
|
362
440
|
if (!omConfig?.enabled) {
|
|
363
441
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Observational Memory is not enabled for this agent" });
|
|
@@ -397,8 +475,8 @@ var LIST_THREADS_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
397
475
|
method: "GET",
|
|
398
476
|
path: "/memory/threads",
|
|
399
477
|
responseType: "json",
|
|
400
|
-
queryParamSchema:
|
|
401
|
-
responseSchema:
|
|
478
|
+
queryParamSchema: chunkWGB6F36S_cjs.listThreadsQuerySchema,
|
|
479
|
+
responseSchema: chunkWGB6F36S_cjs.listThreadsResponseSchema,
|
|
402
480
|
summary: "List memory threads",
|
|
403
481
|
description: "Returns a paginated list of conversation threads with optional filtering by resource ID and/or metadata",
|
|
404
482
|
tags: ["Memory"],
|
|
@@ -406,6 +484,28 @@ var LIST_THREADS_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
406
484
|
handler: async ({ mastra, agentId, resourceId, metadata, requestContext, page, perPage, orderBy }) => {
|
|
407
485
|
try {
|
|
408
486
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
487
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
488
|
+
const isGateway = agent ? await chunkR474QJUF_cjs.isGatewayAgentAsync(agent) : false;
|
|
489
|
+
if (agent && isGateway) {
|
|
490
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
491
|
+
if (gwClient) {
|
|
492
|
+
const effectivePage = page ?? 0;
|
|
493
|
+
const effectivePerPage = perPage ?? 100;
|
|
494
|
+
const offset = effectivePage * effectivePerPage;
|
|
495
|
+
const result = await gwClient.listThreads({
|
|
496
|
+
resourceId: effectiveResourceId,
|
|
497
|
+
limit: effectivePerPage,
|
|
498
|
+
offset
|
|
499
|
+
});
|
|
500
|
+
return {
|
|
501
|
+
threads: result.threads.map(chunkR474QJUF_cjs.toLocalThread),
|
|
502
|
+
page: effectivePage,
|
|
503
|
+
perPage: effectivePerPage,
|
|
504
|
+
total: result.total,
|
|
505
|
+
hasMore: offset + result.threads.length < result.total
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
}
|
|
409
509
|
const filter = effectiveResourceId || metadata ? {} : void 0;
|
|
410
510
|
if (effectiveResourceId) {
|
|
411
511
|
filter.resourceId = effectiveResourceId;
|
|
@@ -448,9 +548,9 @@ var GET_THREAD_BY_ID_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
448
548
|
method: "GET",
|
|
449
549
|
path: "/memory/threads/:threadId",
|
|
450
550
|
responseType: "json",
|
|
451
|
-
pathParamSchema:
|
|
452
|
-
queryParamSchema:
|
|
453
|
-
responseSchema:
|
|
551
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
552
|
+
queryParamSchema: chunkWGB6F36S_cjs.getThreadByIdQuerySchema,
|
|
553
|
+
responseSchema: chunkWGB6F36S_cjs.getThreadByIdResponseSchema,
|
|
454
554
|
summary: "Get thread by ID",
|
|
455
555
|
description: "Returns details for a specific conversation thread",
|
|
456
556
|
tags: ["Memory"],
|
|
@@ -460,6 +560,27 @@ var GET_THREAD_BY_ID_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
460
560
|
const effectiveThreadId = chunkZKMVCV4G_cjs.getEffectiveThreadId(requestContext, threadId);
|
|
461
561
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
462
562
|
chunkZKMVCV4G_cjs.validateBody({ threadId: effectiveThreadId });
|
|
563
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
564
|
+
const isGateway = agent ? await chunkR474QJUF_cjs.isGatewayAgentAsync(agent) : false;
|
|
565
|
+
if (agent && isGateway) {
|
|
566
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
567
|
+
if (gwClient) {
|
|
568
|
+
const result = await gwClient.getThread(effectiveThreadId);
|
|
569
|
+
if (!result) {
|
|
570
|
+
return {
|
|
571
|
+
id: effectiveThreadId,
|
|
572
|
+
resourceId: effectiveResourceId ?? "",
|
|
573
|
+
title: "",
|
|
574
|
+
metadata: {},
|
|
575
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
576
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
const thread = chunkR474QJUF_cjs.toLocalThread(result.thread);
|
|
580
|
+
await chunkZKMVCV4G_cjs.validateThreadOwnership(thread, effectiveResourceId);
|
|
581
|
+
return thread;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
463
584
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
464
585
|
if (memory) {
|
|
465
586
|
const thread = await memory.getThreadById({ threadId: effectiveThreadId });
|
|
@@ -493,9 +614,9 @@ var LIST_MESSAGES_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
493
614
|
method: "GET",
|
|
494
615
|
path: "/memory/threads/:threadId/messages",
|
|
495
616
|
responseType: "json",
|
|
496
|
-
pathParamSchema:
|
|
497
|
-
queryParamSchema:
|
|
498
|
-
responseSchema:
|
|
617
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
618
|
+
queryParamSchema: chunkWGB6F36S_cjs.listMessagesQuerySchema,
|
|
619
|
+
responseSchema: chunkWGB6F36S_cjs.listMessagesResponseSchema,
|
|
499
620
|
summary: "List thread messages",
|
|
500
621
|
description: "Returns a paginated list of messages in a conversation thread",
|
|
501
622
|
tags: ["Memory"],
|
|
@@ -519,6 +640,31 @@ var LIST_MESSAGES_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
519
640
|
if (!effectiveThreadId) {
|
|
520
641
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "No threadId found" });
|
|
521
642
|
}
|
|
643
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
644
|
+
if (agent && await chunkR474QJUF_cjs.isGatewayAgentAsync(agent)) {
|
|
645
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
646
|
+
if (gwClient) {
|
|
647
|
+
const threadResult = await gwClient.getThread(effectiveThreadId);
|
|
648
|
+
if (threadResult) {
|
|
649
|
+
await chunkZKMVCV4G_cjs.validateThreadOwnership(chunkR474QJUF_cjs.toLocalThread(threadResult.thread), effectiveResourceId);
|
|
650
|
+
}
|
|
651
|
+
const effectivePage = page ?? 0;
|
|
652
|
+
const effectivePerPage = perPage ?? 100;
|
|
653
|
+
const offset = effectivePage * effectivePerPage;
|
|
654
|
+
const result = await gwClient.listMessages(effectiveThreadId, {
|
|
655
|
+
limit: effectivePerPage,
|
|
656
|
+
offset,
|
|
657
|
+
order: orderBy?.direction?.toLowerCase()
|
|
658
|
+
});
|
|
659
|
+
if (!result) {
|
|
660
|
+
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Thread not found" });
|
|
661
|
+
}
|
|
662
|
+
return {
|
|
663
|
+
messages: result.messages.map(chunkR474QJUF_cjs.toLocalMessage),
|
|
664
|
+
uiMessages: result.messages.map(chunkR474QJUF_cjs.toLocalMessage)
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
}
|
|
522
668
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
523
669
|
if (memory) {
|
|
524
670
|
const thread = await memory.getThreadById({ threadId: effectiveThreadId });
|
|
@@ -570,9 +716,9 @@ var GET_WORKING_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
570
716
|
method: "GET",
|
|
571
717
|
path: "/memory/threads/:threadId/working-memory",
|
|
572
718
|
responseType: "json",
|
|
573
|
-
pathParamSchema:
|
|
574
|
-
queryParamSchema:
|
|
575
|
-
responseSchema:
|
|
719
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
720
|
+
queryParamSchema: chunkWGB6F36S_cjs.getWorkingMemoryQuerySchema,
|
|
721
|
+
responseSchema: chunkWGB6F36S_cjs.getWorkingMemoryResponseSchema,
|
|
576
722
|
summary: "Get working memory",
|
|
577
723
|
description: "Returns the working memory state for a thread",
|
|
578
724
|
tags: ["Memory"],
|
|
@@ -581,8 +727,12 @@ var GET_WORKING_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
581
727
|
try {
|
|
582
728
|
const effectiveThreadId = chunkZKMVCV4G_cjs.getEffectiveThreadId(requestContext, threadId);
|
|
583
729
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
584
|
-
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
585
730
|
chunkZKMVCV4G_cjs.validateBody({ threadId: effectiveThreadId });
|
|
731
|
+
const gwAgent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
732
|
+
if (gwAgent && await chunkR474QJUF_cjs.isGatewayAgentAsync(gwAgent) && chunkR474QJUF_cjs.getGatewayClient()) {
|
|
733
|
+
return { workingMemory: null, source: "thread", workingMemoryTemplate: null, threadExists: true };
|
|
734
|
+
}
|
|
735
|
+
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
586
736
|
if (!memory) {
|
|
587
737
|
return { workingMemory: null, source: "thread", workingMemoryTemplate: null, threadExists: false };
|
|
588
738
|
}
|
|
@@ -610,9 +760,9 @@ var SAVE_MESSAGES_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
610
760
|
method: "POST",
|
|
611
761
|
path: "/memory/save-messages",
|
|
612
762
|
responseType: "json",
|
|
613
|
-
queryParamSchema:
|
|
614
|
-
bodySchema:
|
|
615
|
-
responseSchema:
|
|
763
|
+
queryParamSchema: chunkWGB6F36S_cjs.agentIdQuerySchema,
|
|
764
|
+
bodySchema: chunkWGB6F36S_cjs.saveMessagesBodySchema,
|
|
765
|
+
responseSchema: chunkWGB6F36S_cjs.saveMessagesResponseSchema,
|
|
616
766
|
summary: "Save messages",
|
|
617
767
|
description: "Saves new messages to memory",
|
|
618
768
|
tags: ["Memory"],
|
|
@@ -665,9 +815,9 @@ var CREATE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
665
815
|
method: "POST",
|
|
666
816
|
path: "/memory/threads",
|
|
667
817
|
responseType: "json",
|
|
668
|
-
queryParamSchema:
|
|
669
|
-
bodySchema:
|
|
670
|
-
responseSchema:
|
|
818
|
+
queryParamSchema: chunkWGB6F36S_cjs.agentIdQuerySchema,
|
|
819
|
+
bodySchema: chunkWGB6F36S_cjs.createThreadBodySchema,
|
|
820
|
+
responseSchema: chunkWGB6F36S_cjs.getThreadByIdResponseSchema,
|
|
671
821
|
summary: "Create thread",
|
|
672
822
|
description: "Creates a new conversation thread",
|
|
673
823
|
tags: ["Memory"],
|
|
@@ -675,6 +825,20 @@ var CREATE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
675
825
|
handler: async ({ mastra, agentId, resourceId, title, metadata, threadId, requestContext }) => {
|
|
676
826
|
try {
|
|
677
827
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
828
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
829
|
+
if (agent && await chunkR474QJUF_cjs.isGatewayAgentAsync(agent)) {
|
|
830
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
831
|
+
if (gwClient) {
|
|
832
|
+
chunkZKMVCV4G_cjs.validateBody({ resourceId: effectiveResourceId });
|
|
833
|
+
const result2 = await gwClient.createThread({
|
|
834
|
+
id: threadId,
|
|
835
|
+
resourceId: effectiveResourceId,
|
|
836
|
+
title,
|
|
837
|
+
metadata
|
|
838
|
+
});
|
|
839
|
+
return chunkR474QJUF_cjs.toLocalThread(result2.thread);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
678
842
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
679
843
|
if (!memory) {
|
|
680
844
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Memory is not initialized" });
|
|
@@ -696,10 +860,10 @@ var UPDATE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
696
860
|
method: "PATCH",
|
|
697
861
|
path: "/memory/threads/:threadId",
|
|
698
862
|
responseType: "json",
|
|
699
|
-
pathParamSchema:
|
|
700
|
-
queryParamSchema:
|
|
701
|
-
bodySchema:
|
|
702
|
-
responseSchema:
|
|
863
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
864
|
+
queryParamSchema: chunkWGB6F36S_cjs.agentIdQuerySchema,
|
|
865
|
+
bodySchema: chunkWGB6F36S_cjs.updateThreadBodySchema,
|
|
866
|
+
responseSchema: chunkWGB6F36S_cjs.getThreadByIdResponseSchema,
|
|
703
867
|
summary: "Update thread",
|
|
704
868
|
description: "Updates a conversation thread",
|
|
705
869
|
tags: ["Memory"],
|
|
@@ -708,9 +872,24 @@ var UPDATE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
708
872
|
try {
|
|
709
873
|
const effectiveThreadId = chunkZKMVCV4G_cjs.getEffectiveThreadId(requestContext, threadId);
|
|
710
874
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
875
|
+
chunkZKMVCV4G_cjs.validateBody({ threadId: effectiveThreadId });
|
|
876
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
877
|
+
if (agent && await chunkR474QJUF_cjs.isGatewayAgentAsync(agent)) {
|
|
878
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
879
|
+
if (gwClient) {
|
|
880
|
+
const existing = await gwClient.getThread(effectiveThreadId);
|
|
881
|
+
if (existing) {
|
|
882
|
+
await chunkZKMVCV4G_cjs.validateThreadOwnership(chunkR474QJUF_cjs.toLocalThread(existing.thread), effectiveResourceId);
|
|
883
|
+
}
|
|
884
|
+
const result2 = await gwClient.updateThread(effectiveThreadId, { title, metadata });
|
|
885
|
+
if (!result2) {
|
|
886
|
+
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Thread not found" });
|
|
887
|
+
}
|
|
888
|
+
return chunkR474QJUF_cjs.toLocalThread(result2.thread);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
711
891
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
712
892
|
const updatedAt = /* @__PURE__ */ new Date();
|
|
713
|
-
chunkZKMVCV4G_cjs.validateBody({ threadId: effectiveThreadId });
|
|
714
893
|
if (!memory) {
|
|
715
894
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Memory is not initialized" });
|
|
716
895
|
}
|
|
@@ -742,9 +921,9 @@ var DELETE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
742
921
|
method: "DELETE",
|
|
743
922
|
path: "/memory/threads/:threadId",
|
|
744
923
|
responseType: "json",
|
|
745
|
-
pathParamSchema:
|
|
746
|
-
queryParamSchema:
|
|
747
|
-
responseSchema:
|
|
924
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
925
|
+
queryParamSchema: chunkWGB6F36S_cjs.deleteThreadQuerySchema,
|
|
926
|
+
responseSchema: chunkWGB6F36S_cjs.deleteThreadResponseSchema,
|
|
748
927
|
summary: "Delete thread",
|
|
749
928
|
description: "Deletes a conversation thread",
|
|
750
929
|
tags: ["Memory"],
|
|
@@ -754,6 +933,21 @@ var DELETE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
754
933
|
const effectiveThreadId = chunkZKMVCV4G_cjs.getEffectiveThreadId(requestContext, threadId);
|
|
755
934
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
756
935
|
chunkZKMVCV4G_cjs.validateBody({ threadId: effectiveThreadId });
|
|
936
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
937
|
+
if (agent && await chunkR474QJUF_cjs.isGatewayAgentAsync(agent)) {
|
|
938
|
+
const gwClient = chunkR474QJUF_cjs.getGatewayClient();
|
|
939
|
+
if (gwClient) {
|
|
940
|
+
const existing = await gwClient.getThread(effectiveThreadId);
|
|
941
|
+
if (existing) {
|
|
942
|
+
await chunkZKMVCV4G_cjs.validateThreadOwnership(chunkR474QJUF_cjs.toLocalThread(existing.thread), effectiveResourceId);
|
|
943
|
+
}
|
|
944
|
+
const deleteResult = await gwClient.deleteThread(effectiveThreadId);
|
|
945
|
+
if (!deleteResult.ok) {
|
|
946
|
+
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Thread not found on gateway" });
|
|
947
|
+
}
|
|
948
|
+
return { result: "Thread deleted" };
|
|
949
|
+
}
|
|
950
|
+
}
|
|
757
951
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
758
952
|
if (!memory) {
|
|
759
953
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Memory is not initialized" });
|
|
@@ -774,10 +968,10 @@ var CLONE_THREAD_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
774
968
|
method: "POST",
|
|
775
969
|
path: "/memory/threads/:threadId/clone",
|
|
776
970
|
responseType: "json",
|
|
777
|
-
pathParamSchema:
|
|
778
|
-
queryParamSchema:
|
|
779
|
-
bodySchema:
|
|
780
|
-
responseSchema:
|
|
971
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
972
|
+
queryParamSchema: chunkWGB6F36S_cjs.agentIdQuerySchema,
|
|
973
|
+
bodySchema: chunkWGB6F36S_cjs.cloneThreadBodySchema,
|
|
974
|
+
responseSchema: chunkWGB6F36S_cjs.cloneThreadResponseSchema,
|
|
781
975
|
summary: "Clone thread",
|
|
782
976
|
description: "Creates a copy of a conversation thread with all its messages",
|
|
783
977
|
tags: ["Memory"],
|
|
@@ -815,10 +1009,10 @@ var UPDATE_WORKING_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
815
1009
|
method: "POST",
|
|
816
1010
|
path: "/memory/threads/:threadId/working-memory",
|
|
817
1011
|
responseType: "json",
|
|
818
|
-
pathParamSchema:
|
|
819
|
-
queryParamSchema:
|
|
820
|
-
bodySchema:
|
|
821
|
-
responseSchema:
|
|
1012
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
1013
|
+
queryParamSchema: chunkWGB6F36S_cjs.agentIdQuerySchema,
|
|
1014
|
+
bodySchema: chunkWGB6F36S_cjs.updateWorkingMemoryBodySchema,
|
|
1015
|
+
responseSchema: chunkWGB6F36S_cjs.updateWorkingMemoryResponseSchema,
|
|
822
1016
|
summary: "Update working memory",
|
|
823
1017
|
description: "Updates the working memory state for a thread",
|
|
824
1018
|
tags: ["Memory"],
|
|
@@ -828,6 +1022,10 @@ var UPDATE_WORKING_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
828
1022
|
const effectiveThreadId = chunkZKMVCV4G_cjs.getEffectiveThreadId(requestContext, threadId);
|
|
829
1023
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
830
1024
|
chunkZKMVCV4G_cjs.validateBody({ threadId: effectiveThreadId, workingMemory });
|
|
1025
|
+
const gwAgent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
1026
|
+
if (gwAgent && await chunkR474QJUF_cjs.isGatewayAgentAsync(gwAgent) && chunkR474QJUF_cjs.getGatewayClient()) {
|
|
1027
|
+
return { success: true };
|
|
1028
|
+
}
|
|
831
1029
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
832
1030
|
if (!memory) {
|
|
833
1031
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Memory is not initialized" });
|
|
@@ -853,9 +1051,9 @@ var DELETE_MESSAGES_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
853
1051
|
method: "POST",
|
|
854
1052
|
path: "/memory/messages/delete",
|
|
855
1053
|
responseType: "json",
|
|
856
|
-
queryParamSchema:
|
|
857
|
-
bodySchema:
|
|
858
|
-
responseSchema:
|
|
1054
|
+
queryParamSchema: chunkWGB6F36S_cjs.deleteMessagesQuerySchema,
|
|
1055
|
+
bodySchema: chunkWGB6F36S_cjs.deleteMessagesBodySchema,
|
|
1056
|
+
responseSchema: chunkWGB6F36S_cjs.deleteMessagesResponseSchema,
|
|
859
1057
|
summary: "Delete messages",
|
|
860
1058
|
description: "Deletes specific messages from memory",
|
|
861
1059
|
tags: ["Memory"],
|
|
@@ -924,8 +1122,8 @@ var SEARCH_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
924
1122
|
method: "GET",
|
|
925
1123
|
path: "/memory/search",
|
|
926
1124
|
responseType: "json",
|
|
927
|
-
queryParamSchema:
|
|
928
|
-
responseSchema:
|
|
1125
|
+
queryParamSchema: chunkWGB6F36S_cjs.searchMemoryQuerySchema,
|
|
1126
|
+
responseSchema: chunkWGB6F36S_cjs.searchMemoryResponseSchema,
|
|
929
1127
|
summary: "Search memory",
|
|
930
1128
|
description: "Searches across memory using semantic or text search",
|
|
931
1129
|
tags: ["Memory"],
|
|
@@ -935,6 +1133,16 @@ var SEARCH_MEMORY_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
935
1133
|
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
936
1134
|
const effectiveThreadId = chunkZKMVCV4G_cjs.getEffectiveThreadId(requestContext, threadId);
|
|
937
1135
|
chunkZKMVCV4G_cjs.validateBody({ searchQuery, resourceId: effectiveResourceId });
|
|
1136
|
+
const agent = await getAgentFromContext({ mastra, agentId, requestContext });
|
|
1137
|
+
if (agent && await chunkR474QJUF_cjs.isGatewayAgentAsync(agent) && chunkR474QJUF_cjs.getGatewayClient()) {
|
|
1138
|
+
return {
|
|
1139
|
+
results: [],
|
|
1140
|
+
count: 0,
|
|
1141
|
+
query: searchQuery,
|
|
1142
|
+
searchScope: "resource",
|
|
1143
|
+
searchType: "semantic"
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
938
1146
|
const memory = await getMemoryFromContext({ mastra, agentId, requestContext });
|
|
939
1147
|
if (!memory) {
|
|
940
1148
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Memory is not initialized" });
|
|
@@ -1049,8 +1257,8 @@ var GET_MEMORY_STATUS_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1049
1257
|
method: "GET",
|
|
1050
1258
|
path: "/memory/network/status",
|
|
1051
1259
|
responseType: "json",
|
|
1052
|
-
queryParamSchema:
|
|
1053
|
-
responseSchema:
|
|
1260
|
+
queryParamSchema: chunkWGB6F36S_cjs.getMemoryStatusNetworkQuerySchema,
|
|
1261
|
+
responseSchema: chunkWGB6F36S_cjs.memoryStatusResponseSchema,
|
|
1054
1262
|
summary: "Get memory status (network)",
|
|
1055
1263
|
description: "Returns the current status of the memory system (network route)",
|
|
1056
1264
|
tags: ["Memory - Network"],
|
|
@@ -1061,8 +1269,8 @@ var LIST_THREADS_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1061
1269
|
method: "GET",
|
|
1062
1270
|
path: "/memory/network/threads",
|
|
1063
1271
|
responseType: "json",
|
|
1064
|
-
queryParamSchema:
|
|
1065
|
-
responseSchema:
|
|
1272
|
+
queryParamSchema: chunkWGB6F36S_cjs.listThreadsNetworkQuerySchema,
|
|
1273
|
+
responseSchema: chunkWGB6F36S_cjs.listThreadsResponseSchema,
|
|
1066
1274
|
summary: "List memory threads (network)",
|
|
1067
1275
|
description: "Returns a paginated list of conversation threads (network route)",
|
|
1068
1276
|
tags: ["Memory - Network"],
|
|
@@ -1073,9 +1281,9 @@ var GET_THREAD_BY_ID_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1073
1281
|
method: "GET",
|
|
1074
1282
|
path: "/memory/network/threads/:threadId",
|
|
1075
1283
|
responseType: "json",
|
|
1076
|
-
pathParamSchema:
|
|
1077
|
-
queryParamSchema:
|
|
1078
|
-
responseSchema:
|
|
1284
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
1285
|
+
queryParamSchema: chunkWGB6F36S_cjs.getThreadByIdNetworkQuerySchema,
|
|
1286
|
+
responseSchema: chunkWGB6F36S_cjs.getThreadByIdResponseSchema,
|
|
1079
1287
|
summary: "Get thread by ID (network)",
|
|
1080
1288
|
description: "Returns details for a specific conversation thread (network route)",
|
|
1081
1289
|
tags: ["Memory - Network"],
|
|
@@ -1086,9 +1294,9 @@ var LIST_MESSAGES_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1086
1294
|
method: "GET",
|
|
1087
1295
|
path: "/memory/network/threads/:threadId/messages",
|
|
1088
1296
|
responseType: "json",
|
|
1089
|
-
pathParamSchema:
|
|
1090
|
-
queryParamSchema:
|
|
1091
|
-
responseSchema:
|
|
1297
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
1298
|
+
queryParamSchema: chunkWGB6F36S_cjs.listMessagesNetworkQuerySchema,
|
|
1299
|
+
responseSchema: chunkWGB6F36S_cjs.listMessagesResponseSchema,
|
|
1092
1300
|
summary: "List thread messages (network)",
|
|
1093
1301
|
description: "Returns a paginated list of messages in a conversation thread (network route)",
|
|
1094
1302
|
tags: ["Memory - Network"],
|
|
@@ -1099,9 +1307,9 @@ var SAVE_MESSAGES_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1099
1307
|
method: "POST",
|
|
1100
1308
|
path: "/memory/network/save-messages",
|
|
1101
1309
|
responseType: "json",
|
|
1102
|
-
queryParamSchema:
|
|
1103
|
-
bodySchema:
|
|
1104
|
-
responseSchema:
|
|
1310
|
+
queryParamSchema: chunkWGB6F36S_cjs.saveMessagesNetworkQuerySchema,
|
|
1311
|
+
bodySchema: chunkWGB6F36S_cjs.saveMessagesBodySchema,
|
|
1312
|
+
responseSchema: chunkWGB6F36S_cjs.saveMessagesResponseSchema,
|
|
1105
1313
|
summary: "Save messages (network)",
|
|
1106
1314
|
description: "Saves new messages to memory (network route)",
|
|
1107
1315
|
tags: ["Memory - Network"],
|
|
@@ -1112,9 +1320,9 @@ var CREATE_THREAD_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1112
1320
|
method: "POST",
|
|
1113
1321
|
path: "/memory/network/threads",
|
|
1114
1322
|
responseType: "json",
|
|
1115
|
-
queryParamSchema:
|
|
1116
|
-
bodySchema:
|
|
1117
|
-
responseSchema:
|
|
1323
|
+
queryParamSchema: chunkWGB6F36S_cjs.createThreadNetworkQuerySchema,
|
|
1324
|
+
bodySchema: chunkWGB6F36S_cjs.createThreadBodySchema,
|
|
1325
|
+
responseSchema: chunkWGB6F36S_cjs.getThreadByIdResponseSchema,
|
|
1118
1326
|
summary: "Create thread (network)",
|
|
1119
1327
|
description: "Creates a new conversation thread (network route)",
|
|
1120
1328
|
tags: ["Memory - Network"],
|
|
@@ -1125,10 +1333,10 @@ var UPDATE_THREAD_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1125
1333
|
method: "PATCH",
|
|
1126
1334
|
path: "/memory/network/threads/:threadId",
|
|
1127
1335
|
responseType: "json",
|
|
1128
|
-
pathParamSchema:
|
|
1129
|
-
queryParamSchema:
|
|
1130
|
-
bodySchema:
|
|
1131
|
-
responseSchema:
|
|
1336
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
1337
|
+
queryParamSchema: chunkWGB6F36S_cjs.updateThreadNetworkQuerySchema,
|
|
1338
|
+
bodySchema: chunkWGB6F36S_cjs.updateThreadBodySchema,
|
|
1339
|
+
responseSchema: chunkWGB6F36S_cjs.getThreadByIdResponseSchema,
|
|
1132
1340
|
summary: "Update thread (network)",
|
|
1133
1341
|
description: "Updates a conversation thread (network route)",
|
|
1134
1342
|
tags: ["Memory - Network"],
|
|
@@ -1139,9 +1347,9 @@ var DELETE_THREAD_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1139
1347
|
method: "DELETE",
|
|
1140
1348
|
path: "/memory/network/threads/:threadId",
|
|
1141
1349
|
responseType: "json",
|
|
1142
|
-
pathParamSchema:
|
|
1143
|
-
queryParamSchema:
|
|
1144
|
-
responseSchema:
|
|
1350
|
+
pathParamSchema: chunkWGB6F36S_cjs.threadIdPathParams,
|
|
1351
|
+
queryParamSchema: chunkWGB6F36S_cjs.deleteThreadNetworkQuerySchema,
|
|
1352
|
+
responseSchema: chunkWGB6F36S_cjs.deleteThreadResponseSchema,
|
|
1145
1353
|
summary: "Delete thread (network)",
|
|
1146
1354
|
description: "Deletes a conversation thread (network route)",
|
|
1147
1355
|
tags: ["Memory - Network"],
|
|
@@ -1152,9 +1360,9 @@ var DELETE_MESSAGES_NETWORK_ROUTE = chunkEGSCXVMR_cjs.createRoute({
|
|
|
1152
1360
|
method: "POST",
|
|
1153
1361
|
path: "/memory/network/messages/delete",
|
|
1154
1362
|
responseType: "json",
|
|
1155
|
-
queryParamSchema:
|
|
1156
|
-
bodySchema:
|
|
1157
|
-
responseSchema:
|
|
1363
|
+
queryParamSchema: chunkWGB6F36S_cjs.deleteMessagesNetworkQuerySchema,
|
|
1364
|
+
bodySchema: chunkWGB6F36S_cjs.deleteMessagesBodySchema,
|
|
1365
|
+
responseSchema: chunkWGB6F36S_cjs.deleteMessagesResponseSchema,
|
|
1158
1366
|
summary: "Delete messages (network)",
|
|
1159
1367
|
description: "Deletes specific messages from memory (network route)",
|
|
1160
1368
|
tags: ["Memory - Network"],
|
|
@@ -1189,5 +1397,5 @@ exports.UPDATE_THREAD_ROUTE = UPDATE_THREAD_ROUTE;
|
|
|
1189
1397
|
exports.UPDATE_WORKING_MEMORY_ROUTE = UPDATE_WORKING_MEMORY_ROUTE;
|
|
1190
1398
|
exports.getTextContent = getTextContent;
|
|
1191
1399
|
exports.memory_exports = memory_exports;
|
|
1192
|
-
//# sourceMappingURL=chunk-
|
|
1193
|
-
//# sourceMappingURL=chunk-
|
|
1400
|
+
//# sourceMappingURL=chunk-V3CH6G5F.cjs.map
|
|
1401
|
+
//# sourceMappingURL=chunk-V3CH6G5F.cjs.map
|