@mastra/server 1.0.0-beta.15 → 1.0.0-beta.17
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 +62 -0
- package/dist/{chunk-ER232COB.js → chunk-IRLQEU63.js} +36 -55
- package/dist/chunk-IRLQEU63.js.map +1 -0
- package/dist/{chunk-CTOZHWSD.js → chunk-JXPRNYUC.js} +12 -27
- package/dist/chunk-JXPRNYUC.js.map +1 -0
- package/dist/{chunk-SKVOSYY5.js → chunk-K3LMK4KU.js} +5 -3
- package/dist/chunk-K3LMK4KU.js.map +1 -0
- package/dist/{chunk-QD5JZUZR.cjs → chunk-T5QRQJCY.cjs} +36 -55
- package/dist/chunk-T5QRQJCY.cjs.map +1 -0
- package/dist/{chunk-XWNPRPEW.cjs → chunk-V3RILBZM.cjs} +5 -3
- package/dist/chunk-V3RILBZM.cjs.map +1 -0
- package/dist/{chunk-Q43HGWK7.cjs → chunk-VJNZJAIO.cjs} +12 -27
- package/dist/chunk-VJNZJAIO.cjs.map +1 -0
- package/dist/server/handlers/agent-builder.cjs +19 -19
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/observability.cjs +5 -5
- package/dist/server/handlers/observability.d.ts.map +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/stored-agents.cjs +6 -6
- package/dist/server/handlers/stored-agents.d.ts.map +1 -1
- package/dist/server/handlers/stored-agents.js +1 -1
- package/dist/server/handlers.cjs +4 -4
- package/dist/server/handlers.js +2 -2
- package/dist/server/server-adapter/index.cjs +30 -30
- package/dist/server/server-adapter/index.js +3 -3
- package/package.json +3 -3
- package/dist/chunk-CTOZHWSD.js.map +0 -1
- package/dist/chunk-ER232COB.js.map +0 -1
- package/dist/chunk-Q43HGWK7.cjs.map +0 -1
- package/dist/chunk-QD5JZUZR.cjs.map +0 -1
- package/dist/chunk-SKVOSYY5.js.map +0 -1
- package/dist/chunk-XWNPRPEW.cjs.map +0 -1
|
@@ -70,14 +70,11 @@ var LIST_STORED_AGENTS_ROUTE = createRoute({
|
|
|
70
70
|
try {
|
|
71
71
|
const storage = mastra.getStorage();
|
|
72
72
|
if (!storage) {
|
|
73
|
-
throw new HTTPException(
|
|
74
|
-
}
|
|
75
|
-
if (!storage.supports.agents) {
|
|
76
|
-
throw new HTTPException(400, { message: "Storage does not support agents" });
|
|
73
|
+
throw new HTTPException(500, { message: "Storage is not configured" });
|
|
77
74
|
}
|
|
78
75
|
const agentsStore = await storage.getStore("agents");
|
|
79
76
|
if (!agentsStore) {
|
|
80
|
-
throw new HTTPException(
|
|
77
|
+
throw new HTTPException(500, { message: "Agents storage domain is not available" });
|
|
81
78
|
}
|
|
82
79
|
const result = await agentsStore.listAgents({
|
|
83
80
|
page,
|
|
@@ -103,14 +100,11 @@ var GET_STORED_AGENT_ROUTE = createRoute({
|
|
|
103
100
|
try {
|
|
104
101
|
const storage = mastra.getStorage();
|
|
105
102
|
if (!storage) {
|
|
106
|
-
throw new HTTPException(
|
|
107
|
-
}
|
|
108
|
-
if (!storage.supports.agents) {
|
|
109
|
-
throw new HTTPException(400, { message: "Storage does not support agents" });
|
|
103
|
+
throw new HTTPException(500, { message: "Storage is not configured" });
|
|
110
104
|
}
|
|
111
105
|
const agentsStore = await storage.getStore("agents");
|
|
112
106
|
if (!agentsStore) {
|
|
113
|
-
throw new HTTPException(
|
|
107
|
+
throw new HTTPException(500, { message: "Agents storage domain is not available" });
|
|
114
108
|
}
|
|
115
109
|
const agent = await agentsStore.getAgentById({ id: storedAgentId });
|
|
116
110
|
if (!agent) {
|
|
@@ -151,14 +145,11 @@ var CREATE_STORED_AGENT_ROUTE = createRoute({
|
|
|
151
145
|
try {
|
|
152
146
|
const storage = mastra.getStorage();
|
|
153
147
|
if (!storage) {
|
|
154
|
-
throw new HTTPException(
|
|
155
|
-
}
|
|
156
|
-
if (!storage.supports.agents) {
|
|
157
|
-
throw new HTTPException(400, { message: "Storage does not support agents" });
|
|
148
|
+
throw new HTTPException(500, { message: "Storage is not configured" });
|
|
158
149
|
}
|
|
159
150
|
const agentsStore = await storage.getStore("agents");
|
|
160
151
|
if (!agentsStore) {
|
|
161
|
-
throw new HTTPException(
|
|
152
|
+
throw new HTTPException(500, { message: "Agents storage domain is not available" });
|
|
162
153
|
}
|
|
163
154
|
const existing = await agentsStore.getAgentById({ id });
|
|
164
155
|
if (existing) {
|
|
@@ -219,14 +210,11 @@ var UPDATE_STORED_AGENT_ROUTE = createRoute({
|
|
|
219
210
|
try {
|
|
220
211
|
const storage = mastra.getStorage();
|
|
221
212
|
if (!storage) {
|
|
222
|
-
throw new HTTPException(
|
|
223
|
-
}
|
|
224
|
-
if (!storage.supports.agents) {
|
|
225
|
-
throw new HTTPException(400, { message: "Storage does not support agents" });
|
|
213
|
+
throw new HTTPException(500, { message: "Storage is not configured" });
|
|
226
214
|
}
|
|
227
215
|
const agentsStore = await storage.getStore("agents");
|
|
228
216
|
if (!agentsStore) {
|
|
229
|
-
throw new HTTPException(
|
|
217
|
+
throw new HTTPException(500, { message: "Agents storage domain is not available" });
|
|
230
218
|
}
|
|
231
219
|
const existing = await agentsStore.getAgentById({ id: storedAgentId });
|
|
232
220
|
if (!existing) {
|
|
@@ -268,14 +256,11 @@ var DELETE_STORED_AGENT_ROUTE = createRoute({
|
|
|
268
256
|
try {
|
|
269
257
|
const storage = mastra.getStorage();
|
|
270
258
|
if (!storage) {
|
|
271
|
-
throw new HTTPException(
|
|
272
|
-
}
|
|
273
|
-
if (!storage.supports.agents) {
|
|
274
|
-
throw new HTTPException(400, { message: "Storage does not support agents" });
|
|
259
|
+
throw new HTTPException(500, { message: "Storage is not configured" });
|
|
275
260
|
}
|
|
276
261
|
const agentsStore = await storage.getStore("agents");
|
|
277
262
|
if (!agentsStore) {
|
|
278
|
-
throw new HTTPException(
|
|
263
|
+
throw new HTTPException(500, { message: "Agents storage domain is not available" });
|
|
279
264
|
}
|
|
280
265
|
const existing = await agentsStore.getAgentById({ id: storedAgentId });
|
|
281
266
|
if (!existing) {
|
|
@@ -290,5 +275,5 @@ var DELETE_STORED_AGENT_ROUTE = createRoute({
|
|
|
290
275
|
});
|
|
291
276
|
|
|
292
277
|
export { CREATE_STORED_AGENT_ROUTE, DELETE_STORED_AGENT_ROUTE, GET_STORED_AGENT_ROUTE, LIST_STORED_AGENTS_ROUTE, UPDATE_STORED_AGENT_ROUTE };
|
|
293
|
-
//# sourceMappingURL=chunk-
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
278
|
+
//# sourceMappingURL=chunk-JXPRNYUC.js.map
|
|
279
|
+
//# sourceMappingURL=chunk-JXPRNYUC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/schemas/stored-agents.ts","../src/server/handlers/stored-agents.ts"],"names":[],"mappings":";;;;;;AAUO,IAAM,uBAAA,GAA0B,EAAE,MAAA,CAAO;AAAA,EAC9C,aAAA,EAAe,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,wCAAwC;AAC7E,CAAC,CAAA;AASD,IAAM,oBAAA,GAAuB,EAAE,MAAA,CAAO;AAAA,EACpC,KAAA,EAAO,EAAE,IAAA,CAAK,CAAC,aAAa,WAAW,CAAC,EAAE,QAAA,EAAS;AAAA,EACnD,SAAA,EAAW,EAAE,IAAA,CAAK,CAAC,OAAO,MAAM,CAAC,EAAE,QAAA;AACrC,CAAC,CAAA;AAKM,IAAM,2BAAA,GAA8B,0BAAA,CAA2B,GAAG,CAAA,CAAE,MAAA,CAAO;AAAA,EAChF,OAAA,EAAS,qBAAqB,QAAA;AAChC,CAAC,CAAA;AASD,IAAM,kBAAA,GAAqB,EAAE,MAAA,CAAO;AAAA,EAClC,QAAA,EAAU,EACP,MAAA,CAAO;AAAA,IACN,MAAM,CAAA,CAAE,IAAA,CAAK,CAAC,OAAA,EAAS,OAAO,CAAC,CAAA;AAAA,IAC/B,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAA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AAElC,MAAA,IAAI,CAAC,OAAA,EAAS;AACZ,QAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,6BAA6B,CAAA;AAAA,MACvE;AAEA,MAAA,MAAM,WAAA,GAAc,MAAM,OAAA,CAAQ,QAAA,CAAS,QAAQ,CAAA;AACnD,MAAA,IAAI,CAAC,WAAA,EAAa;AAChB,QAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,0CAA0C,CAAA;AAAA,MACpF;AAGA,MAAA,MAAM,WAAW,MAAM,WAAA,CAAY,aAAa,EAAE,EAAA,EAAI,eAAe,CAAA;AACrE,MAAA,IAAI,CAAC,QAAA,EAAU;AACb,QAAA,MAAM,IAAI,cAAc,GAAA,EAAK,EAAE,SAAS,CAAA,qBAAA,EAAwB,aAAa,cAAc,CAAA;AAAA,MAC7F;AAEA,MAAA,MAAM,WAAA,CAAY,WAAA,CAAY,EAAE,EAAA,EAAI,eAAe,CAAA;AAEnD,MAAA,OAAO,EAAE,OAAA,EAAS,IAAA,EAAM,OAAA,EAAS,CAAA,MAAA,EAAS,aAAa,CAAA,qBAAA,CAAA,EAAwB;AAAA,IACjF,SAAS,KAAA,EAAO;AACd,MAAA,OAAO,WAAA,CAAY,OAAO,6BAA6B,CAAA;AAAA,IACzD;AAAA,EACF;AACF,CAAC","file":"chunk-JXPRNYUC.js","sourcesContent":["import z from 'zod';\nimport { paginationInfoSchema, createPagePaginationSchema } from './common';\n\n// ============================================================================\n// Path Parameter Schemas\n// ============================================================================\n\n/**\n * Path parameter for stored agent ID\n */\nexport const storedAgentIdPathParams = z.object({\n storedAgentId: z.string().describe('Unique identifier for the stored agent'),\n});\n\n// ============================================================================\n// Query Parameter Schemas\n// ============================================================================\n\n/**\n * Storage order by configuration\n */\nconst storageOrderBySchema = z.object({\n field: z.enum(['createdAt', 'updatedAt']).optional(),\n direction: z.enum(['ASC', 'DESC']).optional(),\n});\n\n/**\n * GET /api/storage/agents - List stored agents\n */\nexport const listStoredAgentsQuerySchema = createPagePaginationSchema(100).extend({\n orderBy: storageOrderBySchema.optional(),\n});\n\n// ============================================================================\n// Body Parameter Schemas\n// ============================================================================\n\n/**\n * Scorer config schema with optional sampling\n */\nconst scorerConfigSchema = z.object({\n sampling: z\n .object({\n type: z.enum(['ratio', 'count']),\n rate: z.number().optional(),\n count: z.number().optional(),\n })\n .optional(),\n});\n\n/**\n * Base stored agent schema (shared fields)\n */\nconst storedAgentBaseSchema = z.object({\n name: z.string().describe('Name of the agent'),\n description: z.string().optional().describe('Description of the agent'),\n instructions: z.string().describe('System instructions for the agent'),\n model: z.record(z.string(), z.unknown()).describe('Model configuration (provider, name, etc.)'),\n tools: z.array(z.string()).optional().describe('Array of tool keys to resolve from Mastra registry'),\n defaultOptions: z.record(z.string(), z.unknown()).optional().describe('Default options for generate/stream calls'),\n workflows: z.array(z.string()).optional().describe('Array of workflow keys to resolve from Mastra registry'),\n agents: z.array(z.string()).optional().describe('Array of agent keys to resolve from Mastra registry'),\n inputProcessors: z.array(z.record(z.string(), z.unknown())).optional().describe('Input processor configurations'),\n outputProcessors: z.array(z.record(z.string(), z.unknown())).optional().describe('Output processor configurations'),\n memory: z.string().optional().describe('Memory key to resolve from Mastra registry'),\n scorers: z.record(z.string(), scorerConfigSchema).optional().describe('Scorer keys with optional sampling config'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata for the agent'),\n});\n\n/**\n * POST /api/storage/agents - Create stored agent body\n */\nexport const createStoredAgentBodySchema = storedAgentBaseSchema.extend({\n id: z.string().describe('Unique identifier for the agent'),\n});\n\n/**\n * PATCH /api/storage/agents/:storedAgentId - Update stored agent body\n */\nexport const updateStoredAgentBodySchema = storedAgentBaseSchema.partial();\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/**\n * Stored agent object schema (full response)\n */\nexport const storedAgentSchema = storedAgentBaseSchema.extend({\n id: z.string(),\n createdAt: z.date(),\n updatedAt: z.date(),\n});\n\n/**\n * Response for GET /api/storage/agents\n */\nexport const listStoredAgentsResponseSchema = paginationInfoSchema.extend({\n agents: z.array(storedAgentSchema),\n});\n\n/**\n * Response for GET /api/storage/agents/:storedAgentId\n */\nexport const getStoredAgentResponseSchema = storedAgentSchema;\n\n/**\n * Response for POST /api/storage/agents\n */\nexport const createStoredAgentResponseSchema = storedAgentSchema;\n\n/**\n * Response for PATCH /api/storage/agents/:storedAgentId\n */\nexport const updateStoredAgentResponseSchema = storedAgentSchema;\n\n/**\n * Response for DELETE /api/storage/agents/:storedAgentId\n */\nexport const deleteStoredAgentResponseSchema = z.object({\n success: z.boolean(),\n message: z.string(),\n});\n","import { HTTPException } from '../http-exception';\nimport {\n storedAgentIdPathParams,\n listStoredAgentsQuerySchema,\n createStoredAgentBodySchema,\n updateStoredAgentBodySchema,\n listStoredAgentsResponseSchema,\n getStoredAgentResponseSchema,\n createStoredAgentResponseSchema,\n updateStoredAgentResponseSchema,\n deleteStoredAgentResponseSchema,\n} from '../schemas/stored-agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\n\nimport { handleError } from './error';\n\n// ============================================================================\n// Route Definitions\n// ============================================================================\n\n/**\n * GET /api/stored/agents - List all stored agents\n */\nexport const LIST_STORED_AGENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/stored/agents',\n responseType: 'json',\n queryParamSchema: listStoredAgentsQuerySchema,\n responseSchema: listStoredAgentsResponseSchema,\n summary: 'List stored agents',\n description: 'Returns a paginated list of all agents stored in the database',\n tags: ['Stored Agents'],\n handler: async ({ mastra, page, perPage, orderBy }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n const result = await agentsStore.listAgents({\n page,\n perPage,\n orderBy,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error listing stored agents');\n }\n },\n});\n\n/**\n * GET /api/stored/agents/:storedAgentId - Get a stored agent by ID\n */\nexport const GET_STORED_AGENT_ROUTE = createRoute({\n method: 'GET',\n path: '/api/stored/agents/:storedAgentId',\n responseType: 'json',\n pathParamSchema: storedAgentIdPathParams,\n responseSchema: getStoredAgentResponseSchema,\n summary: 'Get stored agent by ID',\n description: 'Returns a specific agent from storage by its unique identifier',\n tags: ['Stored Agents'],\n handler: async ({ mastra, storedAgentId }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n const agent = await agentsStore.getAgentById({ id: storedAgentId });\n\n if (!agent) {\n throw new HTTPException(404, { message: `Stored agent with id ${storedAgentId} not found` });\n }\n\n return agent;\n } catch (error) {\n return handleError(error, 'Error getting stored agent');\n }\n },\n});\n\n/**\n * POST /api/stored/agents - Create a new stored agent\n */\nexport const CREATE_STORED_AGENT_ROUTE = createRoute({\n method: 'POST',\n path: '/api/stored/agents',\n responseType: 'json',\n bodySchema: createStoredAgentBodySchema,\n responseSchema: createStoredAgentResponseSchema,\n summary: 'Create stored agent',\n description: 'Creates a new agent in storage with the provided configuration',\n tags: ['Stored Agents'],\n handler: async ({\n mastra,\n id,\n name,\n description,\n instructions,\n model,\n tools,\n defaultOptions,\n workflows,\n agents,\n inputProcessors,\n outputProcessors,\n memory,\n scorers,\n metadata,\n }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Check if agent with this ID already exists\n const existing = await agentsStore.getAgentById({ id });\n if (existing) {\n throw new HTTPException(409, { message: `Agent with id ${id} already exists` });\n }\n\n // Only include tools if it's actually an array from the body (not {} from adapter)\n const toolsFromBody = Array.isArray(tools) ? tools : undefined;\n\n const agent = await agentsStore.createAgent({\n agent: {\n id,\n name,\n description,\n instructions,\n model,\n tools: toolsFromBody,\n defaultOptions,\n workflows,\n agents,\n inputProcessors,\n outputProcessors,\n memory,\n scorers,\n metadata,\n },\n });\n\n return agent;\n } catch (error) {\n return handleError(error, 'Error creating stored agent');\n }\n },\n});\n\n/**\n * PATCH /api/stored/agents/:storedAgentId - Update a stored agent\n */\nexport const UPDATE_STORED_AGENT_ROUTE = createRoute({\n method: 'PATCH',\n path: '/api/stored/agents/:storedAgentId',\n responseType: 'json',\n pathParamSchema: storedAgentIdPathParams,\n bodySchema: updateStoredAgentBodySchema,\n responseSchema: updateStoredAgentResponseSchema,\n summary: 'Update stored agent',\n description: 'Updates an existing agent in storage with the provided fields',\n tags: ['Stored Agents'],\n handler: async ({\n mastra,\n storedAgentId,\n name,\n description,\n instructions,\n model,\n tools,\n defaultOptions,\n workflows,\n agents,\n inputProcessors,\n outputProcessors,\n memory,\n scorers,\n metadata,\n }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Check if agent exists\n const existing = await agentsStore.getAgentById({ id: storedAgentId });\n if (!existing) {\n throw new HTTPException(404, { message: `Stored agent with id ${storedAgentId} not found` });\n }\n\n // Only include tools if it's actually an array from the body (not {} from adapter)\n const toolsFromBody = Array.isArray(tools) ? tools : undefined;\n\n const agent = await agentsStore.updateAgent({\n id: storedAgentId,\n name,\n description,\n instructions,\n model,\n tools: toolsFromBody,\n defaultOptions,\n workflows,\n agents,\n inputProcessors,\n outputProcessors,\n memory,\n scorers,\n metadata,\n });\n\n return agent;\n } catch (error) {\n return handleError(error, 'Error updating stored agent');\n }\n },\n});\n\n/**\n * DELETE /api/stored/agents/:storedAgentId - Delete a stored agent\n */\nexport const DELETE_STORED_AGENT_ROUTE = createRoute({\n method: 'DELETE',\n path: '/api/stored/agents/:storedAgentId',\n responseType: 'json',\n pathParamSchema: storedAgentIdPathParams,\n responseSchema: deleteStoredAgentResponseSchema,\n summary: 'Delete stored agent',\n description: 'Deletes an agent from storage by its unique identifier',\n tags: ['Stored Agents'],\n handler: async ({ mastra, storedAgentId }) => {\n try {\n const storage = mastra.getStorage();\n\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not configured' });\n }\n\n const agentsStore = await storage.getStore('agents');\n if (!agentsStore) {\n throw new HTTPException(500, { message: 'Agents storage domain is not available' });\n }\n\n // Check if agent exists\n const existing = await agentsStore.getAgentById({ id: storedAgentId });\n if (!existing) {\n throw new HTTPException(404, { message: `Stored agent with id ${storedAgentId} not found` });\n }\n\n await agentsStore.deleteAgent({ id: storedAgentId });\n\n return { success: true, message: `Agent ${storedAgentId} deleted successfully` };\n } catch (error) {\n return handleError(error, 'Error deleting stored agent');\n }\n },\n});\n"]}
|
|
@@ -19,7 +19,9 @@ var legacyQueryParamsSchema = z.object({
|
|
|
19
19
|
// Old: dateRange was in pagination, now it's startedAt in filters
|
|
20
20
|
dateRange: dateRangeSchema.optional(),
|
|
21
21
|
// Old: name matched span names like "agent run: 'myAgent'"
|
|
22
|
-
name: z.string().optional()
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
// entityType needs preprocessing to handle legacy 'workflow' value
|
|
24
|
+
entityType: z.preprocess((val) => val === "workflow" ? "workflow_run" : val, z.string().optional())
|
|
23
25
|
});
|
|
24
26
|
function transformLegacyParams(params) {
|
|
25
27
|
const result = { ...params };
|
|
@@ -174,5 +176,5 @@ var LIST_SCORES_BY_SPAN_ROUTE = createRoute({
|
|
|
174
176
|
});
|
|
175
177
|
|
|
176
178
|
export { GET_TRACE_ROUTE, LIST_SCORES_BY_SPAN_ROUTE, LIST_TRACES_ROUTE, SCORE_TRACES_ROUTE, observability_exports };
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-K3LMK4KU.js.map
|
|
180
|
+
//# sourceMappingURL=chunk-K3LMK4KU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/handlers/observability.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,IAAA,qBAAA,GAAA;AAAA,QAAA,CAAA,qBAAA,EAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,yBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,iBAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AA6BA,IAAM,uBAAA,GAA0B,EAAE,MAAA,CAAO;AAAA;AAAA,EAEvC,SAAA,EAAW,gBAAgB,QAAA,EAAS;AAAA;AAAA,EAEpC,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAE1B,UAAA,EAAY,CAAA,CAAE,UAAA,CAAW,CAAA,GAAA,KAAQ,GAAA,KAAQ,UAAA,GAAa,cAAA,GAAiB,GAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAU;AACpG,CAAC,CAAA;AASD,SAAS,sBAAsB,MAAA,EAA0D;AACvF,EAAA,MAAM,MAAA,GAAS,EAAE,GAAG,MAAA,EAAO;AAG3B,EAAA,IAAI,MAAA,CAAO,eAAe,UAAA,EAAY;AACpC,IAAA,MAAA,CAAO,UAAA,GAAa,cAAA;AAAA,EACtB;AAGA,EAAA,IAAI,MAAA,CAAO,SAAA,IAAa,CAAC,MAAA,CAAO,SAAA,EAAW;AACzC,IAAA,MAAA,CAAO,YAAY,MAAA,CAAO,SAAA;AAC1B,IAAA,OAAO,MAAA,CAAO,SAAA;AAAA,EAChB;AAIA,EAAA,IAAI,OAAO,MAAA,CAAO,IAAA,KAAS,QAAA,IAAY,CAAC,OAAO,QAAA,EAAU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AAM;AACxC,IAAA,IAAI;AACF,MAAA,MAAM,UAAA,GAAa,UAAA,CAAW,oBAAA,EAAsB,MAAM,CAAA;AAC1D,MAAA,MAAM,OAAA,GAAU,UAAA,CAAW,aAAA,EAAe,MAAM,CAAA;AAEhD,MAAA,MAAM,WAAA,GAAc,MAAM,cAAA,CAAe,MAAM,CAAA;AAE/C,MAAA,OAAO,MAAM,YAAY,gBAAA,CAAiB;AAAA,QACxC,GAAG,OAAA;AAAA,QACH;AAAA,OACD,CAAA;AAAA,IACH,SAAS,KAAA,EAAO;AACd,MAAA,WAAA,CAAY,OAAO,8BAA8B,CAAA;AAAA,IACnD;AAAA,EACF;AACF,CAAC","file":"chunk-K3LMK4KU.js","sourcesContent":["import type { Mastra } from '@mastra/core';\nimport { listScoresResponseSchema } from '@mastra/core/evals';\nimport { scoreTraces } from '@mastra/core/evals/scoreTraces';\nimport type { MastraStorage, ScoresStorage, ObservabilityStorage } from '@mastra/core/storage';\nimport {\n tracesFilterSchema,\n tracesOrderBySchema,\n paginationArgsSchema,\n spanIdsSchema,\n listTracesResponseSchema,\n scoreTracesRequestSchema,\n scoreTracesResponseSchema,\n getTraceArgsSchema,\n getTraceResponseSchema,\n dateRangeSchema,\n} from '@mastra/core/storage';\nimport { z } from 'zod';\nimport { HTTPException } from '../http-exception';\nimport { createRoute, pickParams, wrapSchemaForQueryParams } from '../server-adapter/routes/route-builder';\nimport { handleError } from './error';\n\n// ============================================================================\n// Legacy Parameter Support (backward compatibility with main branch API)\n// ============================================================================\n\n/**\n * Legacy query parameters from the old API (main branch).\n * These are accepted for backward compatibility and transformed to new format.\n */\nconst legacyQueryParamsSchema = z.object({\n // Old: dateRange was in pagination, now it's startedAt in filters\n dateRange: dateRangeSchema.optional(),\n // Old: name matched span names like \"agent run: 'myAgent'\"\n name: z.string().optional(),\n // entityType needs preprocessing to handle legacy 'workflow' value\n entityType: z.preprocess(val => (val === 'workflow' ? 'workflow_run' : val), z.string().optional()),\n});\n\n/**\n * Transforms legacy query parameters to the new format.\n * - dateRange -> startedAt (if startedAt not already set)\n * - name=\"agent run: 'x'\" -> entityId='x', entityType='agent'\n * - name=\"workflow run: 'x'\" -> entityId='x', entityType='workflow_run'\n * - entityType='workflow' -> entityType='workflow_run' (enum value fix)\n */\nfunction transformLegacyParams(params: Record<string, unknown>): Record<string, unknown> {\n const result = { ...params };\n\n // Transform old entityType='workflow' -> 'workflow_run' (the Zod validation would have already transformed this)\n if (result.entityType === 'workflow') {\n result.entityType = 'workflow_run';\n }\n\n // Transform old dateRange -> new startedAt\n if (params.dateRange && !params.startedAt) {\n result.startedAt = params.dateRange;\n delete result.dateRange;\n }\n\n // Transform old name -> entityId + entityType\n // Old format: name matched span names like \"agent run: 'myAgent'\" or \"workflow run: 'myWorkflow'\"\n if (typeof params.name === 'string' && !params.entityId) {\n const agentMatch = params.name.match(/^agent run: '([^']+)'$/);\n const workflowMatch = params.name.match(/^workflow run: '([^']+)'$/);\n\n if (agentMatch) {\n result.entityId = agentMatch[1];\n result.entityType = 'agent';\n } else if (workflowMatch) {\n result.entityId = workflowMatch[1];\n result.entityType = 'workflow_run';\n }\n delete result.name;\n }\n\n return result;\n}\n\n// ============================================================================\n// Route Definitions (new pattern - handlers defined inline with createRoute)\n// ============================================================================\n\nfunction getStorage(mastra: Mastra): MastraStorage {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n return storage;\n}\n\nasync function getObservabilityStore(mastra: Mastra): Promise<ObservabilityStorage> {\n const storage = getStorage(mastra);\n const observability = await storage.getStore('observability');\n if (!observability) {\n throw new HTTPException(500, { message: 'Observability storage domain is not available' });\n }\n return observability;\n}\n\nasync function getScoresStore(mastra: Mastra): Promise<ScoresStorage> {\n const storage = getStorage(mastra);\n const scores = await storage.getStore('scores');\n if (!scores) {\n throw new HTTPException(500, { message: 'Scores storage domain is not available' });\n }\n return scores;\n}\n\nexport const LIST_TRACES_ROUTE = createRoute({\n method: 'GET',\n path: '/api/observability/traces',\n responseType: 'json',\n queryParamSchema: wrapSchemaForQueryParams(\n tracesFilterSchema\n .merge(paginationArgsSchema)\n .merge(tracesOrderBySchema)\n .merge(legacyQueryParamsSchema) // Accept legacy params for backward compatibility\n .partial(),\n ),\n responseSchema: listTracesResponseSchema,\n summary: 'List traces',\n description: 'Returns a paginated list of traces with optional filtering and sorting',\n tags: ['Observability'],\n handler: async ({ mastra, ...params }) => {\n try {\n // Transform legacy params to new format before processing\n const transformedParams = transformLegacyParams(params);\n\n const filters = pickParams(tracesFilterSchema, transformedParams);\n const pagination = pickParams(paginationArgsSchema, transformedParams);\n const orderBy = pickParams(tracesOrderBySchema, transformedParams);\n\n const observabilityStore = await getObservabilityStore(mastra);\n return await observabilityStore.listTraces({ filters, pagination, orderBy });\n } catch (error) {\n handleError(error, 'Error listing traces');\n }\n },\n});\n\nexport const GET_TRACE_ROUTE = createRoute({\n method: 'GET',\n path: '/api/observability/traces/:traceId',\n responseType: 'json',\n pathParamSchema: getTraceArgsSchema,\n responseSchema: getTraceResponseSchema,\n summary: 'Get AI trace by ID',\n description: 'Returns a complete AI trace with all spans by trace ID',\n tags: ['Observability'],\n handler: async ({ mastra, traceId }) => {\n try {\n const observabilityStore = await getObservabilityStore(mastra);\n const trace = await observabilityStore.getTrace({ traceId });\n\n if (!trace) {\n throw new HTTPException(404, { message: `Trace with ID '${traceId}' not found` });\n }\n\n return trace;\n } catch (error) {\n handleError(error, 'Error getting trace');\n }\n },\n});\n\nexport const SCORE_TRACES_ROUTE = createRoute({\n method: 'POST',\n path: '/api/observability/traces/score',\n responseType: 'json',\n bodySchema: scoreTracesRequestSchema,\n responseSchema: scoreTracesResponseSchema,\n summary: 'Score traces',\n description: 'Scores one or more traces using a specified scorer (fire-and-forget)',\n tags: ['Observability'],\n handler: async ({ mastra, ...params }) => {\n try {\n // Validate storage exists before starting background task\n getStorage(mastra);\n\n const { scorerName, targets } = params;\n\n const scorer = mastra.getScorerById(scorerName);\n if (!scorer) {\n throw new HTTPException(404, { message: `Scorer '${scorerName}' not found` });\n }\n\n scoreTraces({\n scorerId: scorer.config.id || scorer.config.name,\n targets,\n mastra,\n }).catch(error => {\n const logger = mastra.getLogger();\n logger?.error(`Background trace scoring failed: ${error.message}`, error);\n });\n\n return {\n status: 'success',\n message: `Scoring started for ${targets.length} ${targets.length === 1 ? 'trace' : 'traces'}`,\n traceCount: targets.length,\n };\n } catch (error) {\n handleError(error, 'Error processing trace scoring');\n }\n },\n});\n\nexport const LIST_SCORES_BY_SPAN_ROUTE = createRoute({\n method: 'GET',\n path: '/api/observability/traces/:traceId/:spanId/scores',\n responseType: 'json',\n pathParamSchema: spanIdsSchema,\n queryParamSchema: paginationArgsSchema,\n responseSchema: listScoresResponseSchema,\n summary: 'List scores by span',\n description: 'Returns all scores for a specific span within a trace',\n tags: ['Observability'],\n handler: async ({ mastra, ...params }) => {\n try {\n const pagination = pickParams(paginationArgsSchema, params);\n const spanIds = pickParams(spanIdsSchema, params);\n\n const scoresStore = await getScoresStore(mastra);\n\n return await scoresStore.listScoresBySpan({\n ...spanIds,\n pagination,\n });\n } catch (error) {\n handleError(error, 'Error getting scores by span');\n }\n },\n});\n"]}
|
|
@@ -21263,20 +21263,6 @@ var Memory = class extends memory.MastraMemory {
|
|
|
21263
21263
|
);
|
|
21264
21264
|
}
|
|
21265
21265
|
}
|
|
21266
|
-
checkStorageFeatureSupport(config) {
|
|
21267
|
-
const resourceScope = typeof config.semanticRecall === "object" && config.semanticRecall.scope !== "thread" || // resource scope is now default
|
|
21268
|
-
config.semanticRecall === true;
|
|
21269
|
-
if (resourceScope && !this.storage.supports.selectByIncludeResourceScope) {
|
|
21270
|
-
throw new Error(
|
|
21271
|
-
`Memory error: Attached storage adapter "${this.storage.name || "unknown"}" doesn't support semanticRecall: { scope: "resource" } yet and currently only supports per-thread semantic recall.`
|
|
21272
|
-
);
|
|
21273
|
-
}
|
|
21274
|
-
if (config.workingMemory?.enabled && config.workingMemory.scope === `resource` && !this.storage.supports.resourceWorkingMemory) {
|
|
21275
|
-
throw new Error(
|
|
21276
|
-
`Memory error: Attached storage adapter "${this.storage.name || "unknown"}" doesn't support workingMemory: { scope: "resource" } yet and currently only supports per-thread working memory. Supported adapters: LibSQL, PostgreSQL, Upstash.`
|
|
21277
|
-
);
|
|
21278
|
-
}
|
|
21279
|
-
}
|
|
21280
21266
|
async recall(args) {
|
|
21281
21267
|
const { threadId, resourceId, perPage: perPageArg, page, orderBy, threadConfig, vectorSearchString, filter: filter32 } = args;
|
|
21282
21268
|
const config = this.getMergedThreadConfig(threadConfig || {});
|
|
@@ -21294,7 +21280,6 @@ var Memory = class extends memory.MastraMemory {
|
|
|
21294
21280
|
workingMemoryEnabled: config.workingMemory?.enabled,
|
|
21295
21281
|
semanticRecallEnabled: Boolean(config.semanticRecall)
|
|
21296
21282
|
});
|
|
21297
|
-
this.checkStorageFeatureSupport(config);
|
|
21298
21283
|
const defaultRange = DEFAULT_MESSAGE_RANGE;
|
|
21299
21284
|
const defaultTopK = DEFAULT_TOP_K;
|
|
21300
21285
|
const vectorConfig = typeof config?.semanticRecall === `boolean` ? {
|
|
@@ -21372,7 +21357,6 @@ var Memory = class extends memory.MastraMemory {
|
|
|
21372
21357
|
}) {
|
|
21373
21358
|
const config = this.getMergedThreadConfig(memoryConfig || {});
|
|
21374
21359
|
if (config.workingMemory?.enabled) {
|
|
21375
|
-
this.checkStorageFeatureSupport(config);
|
|
21376
21360
|
const scope = config.workingMemory.scope || "resource";
|
|
21377
21361
|
if (scope === "resource" && resourceId) {
|
|
21378
21362
|
const memoryStore = await this.getMemoryStore();
|
|
@@ -21433,7 +21417,6 @@ var Memory = class extends memory.MastraMemory {
|
|
|
21433
21417
|
if (!config.workingMemory?.enabled) {
|
|
21434
21418
|
throw new Error("Working memory is not enabled for this memory instance");
|
|
21435
21419
|
}
|
|
21436
|
-
this.checkStorageFeatureSupport(config);
|
|
21437
21420
|
const scope = config.workingMemory.scope || "resource";
|
|
21438
21421
|
if (scope === "resource" && !resourceId) {
|
|
21439
21422
|
throw new Error(
|
|
@@ -21476,7 +21459,6 @@ var Memory = class extends memory.MastraMemory {
|
|
|
21476
21459
|
if (!config.workingMemory?.enabled) {
|
|
21477
21460
|
throw new Error("Working memory is not enabled for this memory instance");
|
|
21478
21461
|
}
|
|
21479
|
-
this.checkStorageFeatureSupport(config);
|
|
21480
21462
|
const mutexKey = memoryConfig?.workingMemory?.scope === `resource` ? `resource-${resourceId}` : `thread-${threadId}`;
|
|
21481
21463
|
const mutex = this.updateWorkingMemoryMutexes.has(mutexKey) ? this.updateWorkingMemoryMutexes.get(mutexKey) : new Mutex();
|
|
21482
21464
|
this.updateWorkingMemoryMutexes.set(mutexKey, mutex);
|
|
@@ -21718,7 +21700,6 @@ ${workingMemory}`;
|
|
|
21718
21700
|
if (!config.workingMemory?.enabled) {
|
|
21719
21701
|
return null;
|
|
21720
21702
|
}
|
|
21721
|
-
this.checkStorageFeatureSupport(config);
|
|
21722
21703
|
const scope = config.workingMemory.scope || "resource";
|
|
21723
21704
|
let workingMemoryData = null;
|
|
21724
21705
|
if (scope === "resource" && !resourceId) {
|
|
@@ -23026,7 +23007,7 @@ export const mastra = new Mastra({
|
|
|
23026
23007
|
encoding: z18.z.string(),
|
|
23027
23008
|
lastModified: z18.z.string()
|
|
23028
23009
|
}).optional(),
|
|
23029
|
-
|
|
23010
|
+
errorMessage: z18.z.string().optional()
|
|
23030
23011
|
}),
|
|
23031
23012
|
execute: async (inputData) => {
|
|
23032
23013
|
return await _AgentBuilderDefaults.readFile({ ...inputData, projectPath });
|
|
@@ -23046,7 +23027,7 @@ export const mastra = new Mastra({
|
|
|
23046
23027
|
filePath: z18.z.string(),
|
|
23047
23028
|
bytesWritten: z18.z.number().optional(),
|
|
23048
23029
|
message: z18.z.string(),
|
|
23049
|
-
|
|
23030
|
+
errorMessage: z18.z.string().optional()
|
|
23050
23031
|
}),
|
|
23051
23032
|
execute: async (inputData) => {
|
|
23052
23033
|
return await _AgentBuilderDefaults.writeFile({ ...inputData, projectPath });
|
|
@@ -23078,7 +23059,7 @@ export const mastra = new Mastra({
|
|
|
23078
23059
|
totalItems: z18.z.number(),
|
|
23079
23060
|
path: z18.z.string(),
|
|
23080
23061
|
message: z18.z.string(),
|
|
23081
|
-
|
|
23062
|
+
errorMessage: z18.z.string().optional()
|
|
23082
23063
|
}),
|
|
23083
23064
|
execute: async (inputData) => {
|
|
23084
23065
|
return await _AgentBuilderDefaults.listDirectory({ ...inputData, projectPath });
|
|
@@ -23103,7 +23084,7 @@ export const mastra = new Mastra({
|
|
|
23103
23084
|
command: z18.z.string(),
|
|
23104
23085
|
workingDirectory: z18.z.string().optional(),
|
|
23105
23086
|
executionTime: z18.z.number().optional(),
|
|
23106
|
-
|
|
23087
|
+
errorMessage: z18.z.string().optional()
|
|
23107
23088
|
}),
|
|
23108
23089
|
execute: async (inputData) => {
|
|
23109
23090
|
return await _AgentBuilderDefaults.executeCommand({
|
|
@@ -23204,7 +23185,7 @@ export const mastra = new Mastra({
|
|
|
23204
23185
|
message: z18.z.string(),
|
|
23205
23186
|
linesReplaced: z18.z.number().optional(),
|
|
23206
23187
|
backup: z18.z.string().optional(),
|
|
23207
|
-
|
|
23188
|
+
errorMessage: z18.z.string().optional()
|
|
23208
23189
|
}),
|
|
23209
23190
|
execute: async (inputData) => {
|
|
23210
23191
|
return await _AgentBuilderDefaults.replaceLines({ ...inputData, projectPath });
|
|
@@ -23233,7 +23214,7 @@ export const mastra = new Mastra({
|
|
|
23233
23214
|
),
|
|
23234
23215
|
totalLines: z18.z.number(),
|
|
23235
23216
|
message: z18.z.string(),
|
|
23236
|
-
|
|
23217
|
+
errorMessage: z18.z.string().optional()
|
|
23237
23218
|
}),
|
|
23238
23219
|
execute: async (inputData) => {
|
|
23239
23220
|
return await _AgentBuilderDefaults.showFileLines({ ...inputData, projectPath });
|
|
@@ -23351,7 +23332,7 @@ export const mastra = new Mastra({
|
|
|
23351
23332
|
totalResults: z18.z.number(),
|
|
23352
23333
|
searchTime: z18.z.number(),
|
|
23353
23334
|
suggestions: z18.z.array(z18.z.string()).optional(),
|
|
23354
|
-
|
|
23335
|
+
errorMessage: z18.z.string().optional()
|
|
23355
23336
|
}),
|
|
23356
23337
|
execute: async (inputData) => {
|
|
23357
23338
|
return await _AgentBuilderDefaults.webSearch(inputData);
|
|
@@ -23407,7 +23388,7 @@ export const mastra = new Mastra({
|
|
|
23407
23388
|
warnings: z18.z.array(z18.z.string()).optional(),
|
|
23408
23389
|
message: z18.z.string().optional(),
|
|
23409
23390
|
details: z18.z.string().optional(),
|
|
23410
|
-
|
|
23391
|
+
errorMessage: z18.z.string().optional()
|
|
23411
23392
|
}),
|
|
23412
23393
|
execute: async (inputData) => {
|
|
23413
23394
|
const { action, features, packages } = inputData;
|
|
@@ -23469,7 +23450,7 @@ export const mastra = new Mastra({
|
|
|
23469
23450
|
url: z18.z.string().optional(),
|
|
23470
23451
|
message: z18.z.string().optional(),
|
|
23471
23452
|
stdout: z18.z.array(z18.z.string()).optional().describe("Server output lines captured during startup"),
|
|
23472
|
-
|
|
23453
|
+
errorMessage: z18.z.string().optional()
|
|
23473
23454
|
}),
|
|
23474
23455
|
execute: async (inputData) => {
|
|
23475
23456
|
const { action, port } = inputData;
|
|
@@ -23495,7 +23476,7 @@ export const mastra = new Mastra({
|
|
|
23495
23476
|
success: false,
|
|
23496
23477
|
status: "unknown",
|
|
23497
23478
|
message: `Failed to restart: could not stop server on port ${port}`,
|
|
23498
|
-
|
|
23479
|
+
errorMessage: stopResult.errorMessage || "Unknown stop error"
|
|
23499
23480
|
};
|
|
23500
23481
|
}
|
|
23501
23482
|
await new Promise((resolve5) => setTimeout(resolve5, 500));
|
|
@@ -23508,7 +23489,7 @@ export const mastra = new Mastra({
|
|
|
23508
23489
|
success: false,
|
|
23509
23490
|
status: "stopped",
|
|
23510
23491
|
message: `Failed to restart: server stopped successfully but failed to start on port ${port}`,
|
|
23511
|
-
|
|
23492
|
+
errorMessage: startResult.errorMessage || "Unknown start error"
|
|
23512
23493
|
};
|
|
23513
23494
|
}
|
|
23514
23495
|
return {
|
|
@@ -23553,7 +23534,7 @@ export const mastra = new Mastra({
|
|
|
23553
23534
|
statusText: z18.z.string().optional(),
|
|
23554
23535
|
headers: z18.z.record(z18.z.string()).optional(),
|
|
23555
23536
|
data: z18.z.any().optional(),
|
|
23556
|
-
|
|
23537
|
+
errorMessage: z18.z.string().optional(),
|
|
23557
23538
|
url: z18.z.string(),
|
|
23558
23539
|
method: z18.z.string()
|
|
23559
23540
|
}),
|
|
@@ -23573,7 +23554,7 @@ export const mastra = new Mastra({
|
|
|
23573
23554
|
success: false,
|
|
23574
23555
|
url: baseUrl ? `${baseUrl}${url}` : url,
|
|
23575
23556
|
method,
|
|
23576
|
-
|
|
23557
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
23577
23558
|
};
|
|
23578
23559
|
}
|
|
23579
23560
|
}
|
|
@@ -23637,7 +23618,7 @@ export const mastra = new Mastra({
|
|
|
23637
23618
|
projectPath: `./${projectName}`,
|
|
23638
23619
|
message: `Successfully created Mastra project: ${projectName}.`,
|
|
23639
23620
|
details: stdout,
|
|
23640
|
-
|
|
23621
|
+
errorMessage: stderr
|
|
23641
23622
|
};
|
|
23642
23623
|
} catch (error) {
|
|
23643
23624
|
console.error(error);
|
|
@@ -23765,7 +23746,7 @@ export const mastra = new Mastra({
|
|
|
23765
23746
|
return {
|
|
23766
23747
|
success: false,
|
|
23767
23748
|
status: "stopped",
|
|
23768
|
-
|
|
23749
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
23769
23750
|
};
|
|
23770
23751
|
}
|
|
23771
23752
|
}
|
|
@@ -23777,7 +23758,7 @@ export const mastra = new Mastra({
|
|
|
23777
23758
|
return {
|
|
23778
23759
|
success: false,
|
|
23779
23760
|
status: "error",
|
|
23780
|
-
|
|
23761
|
+
errorMessage: `Invalid port value: ${String(port)}`
|
|
23781
23762
|
};
|
|
23782
23763
|
}
|
|
23783
23764
|
try {
|
|
@@ -23809,7 +23790,7 @@ export const mastra = new Mastra({
|
|
|
23809
23790
|
success: false,
|
|
23810
23791
|
status: "unknown",
|
|
23811
23792
|
message: `Failed to stop any processes on port ${port}`,
|
|
23812
|
-
|
|
23793
|
+
errorMessage: `Could not kill PIDs: ${failedPids.join(", ")}`
|
|
23813
23794
|
};
|
|
23814
23795
|
}
|
|
23815
23796
|
if (failedPids.length > 0) {
|
|
@@ -23840,7 +23821,7 @@ export const mastra = new Mastra({
|
|
|
23840
23821
|
success: false,
|
|
23841
23822
|
status: "unknown",
|
|
23842
23823
|
message: `Server processes still running on port ${port} after stop attempts`,
|
|
23843
|
-
|
|
23824
|
+
errorMessage: `Remaining PIDs: ${finalCheck.trim()}`
|
|
23844
23825
|
};
|
|
23845
23826
|
}
|
|
23846
23827
|
}
|
|
@@ -23856,7 +23837,7 @@ export const mastra = new Mastra({
|
|
|
23856
23837
|
return {
|
|
23857
23838
|
success: false,
|
|
23858
23839
|
status: "unknown",
|
|
23859
|
-
|
|
23840
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
23860
23841
|
};
|
|
23861
23842
|
}
|
|
23862
23843
|
}
|
|
@@ -24339,7 +24320,7 @@ export const mastra = new Mastra({
|
|
|
24339
24320
|
success: false,
|
|
24340
24321
|
url: baseUrl ? `${baseUrl}${url}` : url,
|
|
24341
24322
|
method,
|
|
24342
|
-
|
|
24323
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24343
24324
|
};
|
|
24344
24325
|
}
|
|
24345
24326
|
}
|
|
@@ -24522,21 +24503,21 @@ export const mastra = new Mastra({
|
|
|
24522
24503
|
return {
|
|
24523
24504
|
success: false,
|
|
24524
24505
|
message: `Line numbers must be 1 or greater. Got startLine: ${startLine}, endLine: ${endLine}`,
|
|
24525
|
-
|
|
24506
|
+
errorMessage: "Invalid line range"
|
|
24526
24507
|
};
|
|
24527
24508
|
}
|
|
24528
24509
|
if (startLine > lines.length || endLine > lines.length) {
|
|
24529
24510
|
return {
|
|
24530
24511
|
success: false,
|
|
24531
24512
|
message: `Line range ${startLine}-${endLine} is out of bounds. File has ${lines.length} lines. Remember: lines are 1-indexed, so valid range is 1-${lines.length}.`,
|
|
24532
|
-
|
|
24513
|
+
errorMessage: "Invalid line range"
|
|
24533
24514
|
};
|
|
24534
24515
|
}
|
|
24535
24516
|
if (startLine > endLine) {
|
|
24536
24517
|
return {
|
|
24537
24518
|
success: false,
|
|
24538
24519
|
message: `Start line (${startLine}) cannot be greater than end line (${endLine}).`,
|
|
24539
|
-
|
|
24520
|
+
errorMessage: "Invalid line range"
|
|
24540
24521
|
};
|
|
24541
24522
|
}
|
|
24542
24523
|
let backup;
|
|
@@ -24563,7 +24544,7 @@ export const mastra = new Mastra({
|
|
|
24563
24544
|
return {
|
|
24564
24545
|
success: false,
|
|
24565
24546
|
message: `Failed to replace lines: ${error instanceof Error ? error.message : String(error)}`,
|
|
24566
|
-
|
|
24547
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24567
24548
|
};
|
|
24568
24549
|
}
|
|
24569
24550
|
}
|
|
@@ -24608,7 +24589,7 @@ export const mastra = new Mastra({
|
|
|
24608
24589
|
lines: [],
|
|
24609
24590
|
totalLines: 0,
|
|
24610
24591
|
message: `Failed to read file: ${error instanceof Error ? error.message : String(error)}`,
|
|
24611
|
-
|
|
24592
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24612
24593
|
};
|
|
24613
24594
|
}
|
|
24614
24595
|
}
|
|
@@ -24758,7 +24739,7 @@ export const mastra = new Mastra({
|
|
|
24758
24739
|
} catch (error) {
|
|
24759
24740
|
return {
|
|
24760
24741
|
success: false,
|
|
24761
|
-
|
|
24742
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24762
24743
|
};
|
|
24763
24744
|
}
|
|
24764
24745
|
}
|
|
@@ -24785,7 +24766,7 @@ export const mastra = new Mastra({
|
|
|
24785
24766
|
success: false,
|
|
24786
24767
|
filePath: context.filePath,
|
|
24787
24768
|
message: `Failed to write file: ${error instanceof Error ? error.message : String(error)}`,
|
|
24788
|
-
|
|
24769
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24789
24770
|
};
|
|
24790
24771
|
}
|
|
24791
24772
|
}
|
|
@@ -24876,7 +24857,7 @@ export const mastra = new Mastra({
|
|
|
24876
24857
|
totalItems: 0,
|
|
24877
24858
|
path: context.path,
|
|
24878
24859
|
message: `Failed to list directory: ${error instanceof Error ? error.message : String(error)}`,
|
|
24879
|
-
|
|
24860
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24880
24861
|
};
|
|
24881
24862
|
}
|
|
24882
24863
|
}
|
|
@@ -24918,7 +24899,7 @@ export const mastra = new Mastra({
|
|
|
24918
24899
|
command: context.command,
|
|
24919
24900
|
workingDirectory: context.workingDirectory,
|
|
24920
24901
|
executionTime,
|
|
24921
|
-
|
|
24902
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24922
24903
|
};
|
|
24923
24904
|
}
|
|
24924
24905
|
}
|
|
@@ -24981,7 +24962,7 @@ export const mastra = new Mastra({
|
|
|
24981
24962
|
results: [],
|
|
24982
24963
|
totalResults: 0,
|
|
24983
24964
|
searchTime: 0,
|
|
24984
|
-
|
|
24965
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
24985
24966
|
};
|
|
24986
24967
|
}
|
|
24987
24968
|
}
|
|
@@ -25975,7 +25956,7 @@ var intelligentMergeStep = workflows.createStep({
|
|
|
25975
25956
|
outputSchema: z18.z.object({
|
|
25976
25957
|
success: z18.z.boolean(),
|
|
25977
25958
|
message: z18.z.string(),
|
|
25978
|
-
|
|
25959
|
+
errorMessage: z18.z.string().optional()
|
|
25979
25960
|
}),
|
|
25980
25961
|
execute: async (input) => {
|
|
25981
25962
|
try {
|
|
@@ -25990,11 +25971,11 @@ var intelligentMergeStep = workflows.createStep({
|
|
|
25990
25971
|
success: true,
|
|
25991
25972
|
message: `Successfully copied file from ${sourcePath} to ${destinationPath}`
|
|
25992
25973
|
};
|
|
25993
|
-
} catch (
|
|
25974
|
+
} catch (err) {
|
|
25994
25975
|
return {
|
|
25995
25976
|
success: false,
|
|
25996
|
-
message: `Failed to copy file: ${
|
|
25997
|
-
|
|
25977
|
+
message: `Failed to copy file: ${err instanceof Error ? err.message : String(err)}`,
|
|
25978
|
+
errorMessage: err instanceof Error ? err.message : String(err)
|
|
25998
25979
|
};
|
|
25999
25980
|
}
|
|
26000
25981
|
}
|
|
@@ -32906,5 +32887,5 @@ exports.STREAM_AGENT_BUILDER_ACTION_ROUTE = STREAM_AGENT_BUILDER_ACTION_ROUTE;
|
|
|
32906
32887
|
exports.STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
|
|
32907
32888
|
exports.STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE;
|
|
32908
32889
|
exports.agent_builder_exports = agent_builder_exports;
|
|
32909
|
-
//# sourceMappingURL=chunk-
|
|
32910
|
-
//# sourceMappingURL=chunk-
|
|
32890
|
+
//# sourceMappingURL=chunk-T5QRQJCY.cjs.map
|
|
32891
|
+
//# sourceMappingURL=chunk-T5QRQJCY.cjs.map
|