@mastra/deployer 0.1.3 → 0.1.4

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.
@@ -1,29 +1,29 @@
1
1
 
2
- > @mastra/deployer@0.1.3-alpha.1 build /home/runner/work/mastra/mastra/packages/deployer
2
+ > @mastra/deployer@0.1.4 build /home/runner/work/mastra/mastra/packages/deployer
3
3
  > tsup src/index.ts src/build/index.ts src/server/index.ts src/build/bundler.ts src/build/analyze.ts src/bundler/index.ts --format esm --clean --experimental-dts --treeshake --publicDir
4
4
 
5
5
  CLI Building entry: src/index.ts, src/build/analyze.ts, src/build/bundler.ts, src/build/index.ts, src/bundler/index.ts, src/server/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.3.6
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 17204ms
9
+ TSC ⚡️ Build success in 10930ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.7.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/packages/deployer/dist/_tsup-dts-rollup.d.ts
14
- DTS ⚡️ Build success in 7734ms
14
+ DTS ⚡️ Build success in 4842ms
15
15
  CLI Cleaning output folder
16
16
  ESM Build start
17
17
  ESM dist/index.js 3.72 KB
18
18
  ESM dist/build/analyze.js 85.00 B
19
19
  ESM dist/build/bundler.js 102.00 B
20
20
  ESM dist/build/index.js 383.00 B
21
- ESM dist/chunk-S6JYNXAW.js 4.40 KB
22
21
  ESM dist/bundler/index.js 172.00 B
22
+ ESM dist/chunk-S6JYNXAW.js 4.40 KB
23
23
  ESM dist/chunk-AXS5WSIK.js 8.23 KB
24
- ESM dist/chunk-YNXJO2XU.js 2.08 KB
25
- ESM dist/chunk-KXS4XYEJ.js 7.20 KB
26
24
  ESM dist/chunk-Z3IHWUWI.js 8.13 KB
25
+ ESM dist/chunk-YNXJO2XU.js 2.08 KB
27
26
  ESM dist/chunk-2S4LOARP.js 7.41 KB
28
- ESM dist/server/index.js 147.44 KB
29
- ESM ⚡️ Build success in 2375ms
27
+ ESM dist/chunk-KXS4XYEJ.js 7.20 KB
28
+ ESM dist/server/index.js 148.14 KB
29
+ ESM ⚡️ Build success in 1544ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 967da43: Logger, transport fixes
8
+ - Updated dependencies [ce44b9b]
9
+ - Updated dependencies [967da43]
10
+ - Updated dependencies [b405f08]
11
+ - @mastra/core@0.4.1
12
+
3
13
  ## 0.1.3
4
14
 
5
15
  ### Patch Changes
@@ -242,6 +242,8 @@ export declare function getLogsByRunIdHandler(c: Context): Promise<Response>;
242
242
 
243
243
  export declare function getLogsHandler(c: Context): Promise<Response>;
244
244
 
245
+ export declare function getLogTransports(c: Context): Promise<Response>;
246
+
245
247
  export declare function getMemoryStatusHandler(c: Context): Promise<Response>;
246
248
 
247
249
  export declare function getMessagesHandler(c: Context): Promise<Response>;
@@ -2895,13 +2895,13 @@ async function generateHandler(c2) {
2895
2895
  if (!agent) {
2896
2896
  throw new HTTPException(404, { message: "Agent not found" });
2897
2897
  }
2898
- const { messages, threadId, resourceid, resourceId, output } = await c2.req.json();
2898
+ const { messages, threadId, resourceid, resourceId, output, runId } = await c2.req.json();
2899
2899
  validateBody({ messages });
2900
2900
  if (!Array.isArray(messages)) {
2901
2901
  throw new HTTPException(400, { message: "Messages should be an array" });
2902
2902
  }
2903
2903
  const finalResourceId = resourceId ?? resourceid;
2904
- const result = await agent.generate(messages, { threadId, resourceId: finalResourceId, output });
2904
+ const result = await agent.generate(messages, { threadId, resourceId: finalResourceId, output, runId });
2905
2905
  return c2.json(result);
2906
2906
  } catch (error) {
2907
2907
  return handleError(error, "Error generating from agent");
@@ -2915,13 +2915,13 @@ async function streamGenerateHandler(c2) {
2915
2915
  if (!agent) {
2916
2916
  throw new HTTPException(404, { message: "Agent not found" });
2917
2917
  }
2918
- const { messages, threadId, resourceid, resourceId, output } = await c2.req.json();
2918
+ const { messages, threadId, resourceid, resourceId, output, runId } = await c2.req.json();
2919
2919
  validateBody({ messages });
2920
2920
  if (!Array.isArray(messages)) {
2921
2921
  throw new HTTPException(400, { message: "Messages should be an array" });
2922
2922
  }
2923
2923
  const finalResourceId = resourceId ?? resourceid;
2924
- const streamResult = await agent.stream(messages, { threadId, resourceId: finalResourceId, output });
2924
+ const streamResult = await agent.stream(messages, { threadId, resourceId: finalResourceId, output, runId });
2925
2925
  const streamResponse = output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
2926
2926
  sendUsage: true,
2927
2927
  sendReasoning: true,
@@ -3020,6 +3020,19 @@ async function getLogsByRunIdHandler(c2) {
3020
3020
  return handleError(error, "Error getting logs by run ID");
3021
3021
  }
3022
3022
  }
3023
+ async function getLogTransports(c2) {
3024
+ console.log("here");
3025
+ try {
3026
+ const mastra = c2.get("mastra");
3027
+ const logger2 = mastra.getLogger();
3028
+ const transports = logger2.transports;
3029
+ return c2.json({
3030
+ transports: Object.keys(transports)
3031
+ });
3032
+ } catch (e2) {
3033
+ return handleError(e2, "Error getting log Transports ");
3034
+ }
3035
+ }
3023
3036
  function getMemoryFromContext(c2) {
3024
3037
  const mastra = c2.get("mastra");
3025
3038
  const agentId = c2.req.query("agentId");
@@ -3854,6 +3867,7 @@ async function createHonoServer(mastra, options = {}) {
3854
3867
  description: "The resource ID for the conversation (deprecated, use resourceId instead)",
3855
3868
  deprecated: true
3856
3869
  },
3870
+ runId: { type: "string" },
3857
3871
  output: { type: "object" }
3858
3872
  },
3859
3873
  required: ["messages"]
@@ -3904,6 +3918,7 @@ async function createHonoServer(mastra, options = {}) {
3904
3918
  description: "The resource ID for the conversation (deprecated, use resourceId instead)",
3905
3919
  deprecated: true
3906
3920
  },
3921
+ runId: { type: "string" },
3907
3922
  output: { type: "object" }
3908
3923
  },
3909
3924
  required: ["messages"]
@@ -4493,6 +4508,19 @@ async function createHonoServer(mastra, options = {}) {
4493
4508
  }),
4494
4509
  getLogsHandler
4495
4510
  );
4511
+ app.get(
4512
+ "/api/logs/transports",
4513
+ p({
4514
+ description: "List of all log transports",
4515
+ tags: ["logs"],
4516
+ responses: {
4517
+ 200: {
4518
+ description: "List of all log transports"
4519
+ }
4520
+ }
4521
+ }),
4522
+ getLogTransports
4523
+ );
4496
4524
  app.get(
4497
4525
  "/api/logs/:runId",
4498
4526
  p({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "rollup-plugin-esbuild": "^6.1.1",
53
53
  "rollup-plugin-node-externals": "^8.0.0",
54
54
  "zod": "^3.24.1",
55
- "@mastra/core": "^0.4.0"
55
+ "@mastra/core": "^0.4.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@hono/node-server": "^1.13.7",
@@ -118,7 +118,7 @@ export async function generateHandler(c: Context) {
118
118
  throw new HTTPException(404, { message: 'Agent not found' });
119
119
  }
120
120
 
121
- const { messages, threadId, resourceid, resourceId, output } = await c.req.json();
121
+ const { messages, threadId, resourceid, resourceId, output, runId } = await c.req.json();
122
122
  validateBody({ messages });
123
123
 
124
124
  if (!Array.isArray(messages)) {
@@ -128,7 +128,7 @@ export async function generateHandler(c: Context) {
128
128
  // Use resourceId if provided, fall back to resourceid (deprecated)
129
129
  const finalResourceId = resourceId ?? resourceid;
130
130
 
131
- const result = await agent.generate(messages, { threadId, resourceId: finalResourceId, output });
131
+ const result = await agent.generate(messages, { threadId, resourceId: finalResourceId, output, runId });
132
132
 
133
133
  return c.json(result);
134
134
  } catch (error) {
@@ -146,7 +146,7 @@ export async function streamGenerateHandler(c: Context): Promise<Response | unde
146
146
  throw new HTTPException(404, { message: 'Agent not found' });
147
147
  }
148
148
 
149
- const { messages, threadId, resourceid, resourceId, output } = await c.req.json();
149
+ const { messages, threadId, resourceid, resourceId, output, runId } = await c.req.json();
150
150
 
151
151
  validateBody({ messages });
152
152
 
@@ -157,17 +157,17 @@ export async function streamGenerateHandler(c: Context): Promise<Response | unde
157
157
  // Use resourceId if provided, fall back to resourceid (deprecated)
158
158
  const finalResourceId = resourceId ?? resourceid;
159
159
 
160
- const streamResult = await agent.stream(messages, { threadId, resourceId: finalResourceId, output });
160
+ const streamResult = await agent.stream(messages, { threadId, resourceId: finalResourceId, output, runId });
161
161
 
162
162
  const streamResponse = output
163
163
  ? streamResult.toTextStreamResponse()
164
164
  : streamResult.toDataStreamResponse({
165
- sendUsage: true,
166
- sendReasoning: true,
167
- getErrorMessage: (error: any) => {
168
- return `An error occurred while processing your request. ${error}`;
169
- },
170
- });
165
+ sendUsage: true,
166
+ sendReasoning: true,
167
+ getErrorMessage: (error: any) => {
168
+ return `An error occurred while processing your request. ${error}`;
169
+ },
170
+ });
171
171
 
172
172
  return streamResponse;
173
173
  } catch (error) {
@@ -37,3 +37,17 @@ export async function getLogsByRunIdHandler(c: Context) {
37
37
  return handleError(error, 'Error getting logs by run ID');
38
38
  }
39
39
  }
40
+
41
+ export async function getLogTransports(c: Context) {
42
+ console.log('here');
43
+ try {
44
+ const mastra: Mastra = c.get('mastra');
45
+ const logger = mastra.getLogger();
46
+ const transports = logger.transports;
47
+ return c.json({
48
+ transports: Object.keys(transports),
49
+ });
50
+ } catch (e) {
51
+ return handleError(e, 'Error getting log Transports ');
52
+ }
53
+ }
@@ -24,7 +24,7 @@ import {
24
24
  } from './handlers/agents.js';
25
25
  import { handleClientsRefresh, handleTriggerClientsRefresh } from './handlers/client.js';
26
26
  import { errorHandler } from './handlers/error.js';
27
- import { getLogsByRunIdHandler, getLogsHandler } from './handlers/logs.js';
27
+ import { getLogsByRunIdHandler, getLogsHandler, getLogTransports } from './handlers/logs.js';
28
28
  import {
29
29
  createThreadHandler,
30
30
  deleteThreadHandler,
@@ -252,6 +252,7 @@ export async function createHonoServer(
252
252
  description: 'The resource ID for the conversation (deprecated, use resourceId instead)',
253
253
  deprecated: true,
254
254
  },
255
+ runId: { type: 'string' },
255
256
  output: { type: 'object' },
256
257
  },
257
258
  required: ['messages'],
@@ -303,6 +304,7 @@ export async function createHonoServer(
303
304
  description: 'The resource ID for the conversation (deprecated, use resourceId instead)',
304
305
  deprecated: true,
305
306
  },
307
+ runId: { type: 'string' },
306
308
  output: { type: 'object' },
307
309
  },
308
310
  required: ['messages'],
@@ -916,6 +918,20 @@ export async function createHonoServer(
916
918
  getLogsHandler,
917
919
  );
918
920
 
921
+ app.get(
922
+ '/api/logs/transports',
923
+ describeRoute({
924
+ description: 'List of all log transports',
925
+ tags: ['logs'],
926
+ responses: {
927
+ 200: {
928
+ description: 'List of all log transports',
929
+ },
930
+ },
931
+ }),
932
+ getLogTransports,
933
+ );
934
+
919
935
  app.get(
920
936
  '/api/logs/:runId',
921
937
  describeRoute({