@mastra/deployer-netlify 0.0.0-mastra-3123-mcp-server-20250419180157 → 0.0.0-mastra-2452-core-tracing-sentry-20250507205331

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.
@@ -34,6 +34,7 @@ export declare class NetlifyDeployer extends Deployer {
34
34
  prepare(outputDirectory: string): Promise<void>;
35
35
  bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
36
36
  private getEntry;
37
+ lint(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
37
38
  }
38
39
 
39
40
  export { }
@@ -34,6 +34,7 @@ export declare class NetlifyDeployer extends Deployer {
34
34
  prepare(outputDirectory: string): Promise<void>;
35
35
  bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
36
36
  private getEntry;
37
+ lint(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
37
38
  }
38
39
 
39
40
  export { }
package/dist/index.cjs CHANGED
@@ -140,15 +140,65 @@ to = "/.netlify/functions/api/:splat"
140
140
  }
141
141
  getEntry() {
142
142
  return `
143
- import { handle } from 'hono/netlify'
144
- import { mastra } from '#mastra';
145
- import { createHonoServer } from '#server';
143
+ import { handle } from 'hono/netlify'
144
+ import { mastra } from '#mastra';
145
+ import { createHonoServer } from '#server';
146
+ import { evaluate } from '@mastra/core/eval';
147
+ import { AvailableHooks, registerHook } from '@mastra/core/hooks';
148
+ import { TABLE_EVALS } from '@mastra/core/storage';
149
+ import { checkEvalStorageFields } from '@mastra/core/utils';
146
150
 
147
- const app = await createHonoServer(mastra);
151
+ registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {
152
+ evaluate({
153
+ agentName,
154
+ input,
155
+ metric,
156
+ output,
157
+ runId,
158
+ globalRunId: runId,
159
+ instructions,
160
+ });
161
+ });
162
+
163
+ if (mastra.getStorage()) {
164
+ // start storage init in the background
165
+ mastra.getStorage().init();
166
+ }
148
167
 
149
- export default handle(app)
168
+ registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
169
+ const storage = mastra.getStorage();
170
+ if (storage) {
171
+ // Check for required fields
172
+ const logger = mastra?.getLogger();
173
+ const areFieldsValid = checkEvalStorageFields(traceObject, logger);
174
+ if (!areFieldsValid) return;
175
+
176
+ await storage.insert({
177
+ tableName: TABLE_EVALS,
178
+ record: {
179
+ input: traceObject.input,
180
+ output: traceObject.output,
181
+ result: JSON.stringify(traceObject.result || {}),
182
+ agent_name: traceObject.agentName,
183
+ metric_name: traceObject.metricName,
184
+ instructions: traceObject.instructions,
185
+ test_info: null,
186
+ global_run_id: traceObject.globalRunId,
187
+ run_id: traceObject.runId,
188
+ created_at: new Date().toISOString(),
189
+ },
190
+ });
191
+ }
192
+ });
193
+
194
+ const app = await createHonoServer(mastra);
195
+
196
+ export default handle(app)
150
197
  `;
151
198
  }
199
+ async lint(entryFile, outputDirectory, toolsPaths) {
200
+ await super.lint(entryFile, outputDirectory, toolsPaths);
201
+ }
152
202
  };
153
203
 
154
204
  exports.NetlifyDeployer = NetlifyDeployer;
package/dist/index.js CHANGED
@@ -138,15 +138,65 @@ to = "/.netlify/functions/api/:splat"
138
138
  }
139
139
  getEntry() {
140
140
  return `
141
- import { handle } from 'hono/netlify'
142
- import { mastra } from '#mastra';
143
- import { createHonoServer } from '#server';
141
+ import { handle } from 'hono/netlify'
142
+ import { mastra } from '#mastra';
143
+ import { createHonoServer } from '#server';
144
+ import { evaluate } from '@mastra/core/eval';
145
+ import { AvailableHooks, registerHook } from '@mastra/core/hooks';
146
+ import { TABLE_EVALS } from '@mastra/core/storage';
147
+ import { checkEvalStorageFields } from '@mastra/core/utils';
144
148
 
145
- const app = await createHonoServer(mastra);
149
+ registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {
150
+ evaluate({
151
+ agentName,
152
+ input,
153
+ metric,
154
+ output,
155
+ runId,
156
+ globalRunId: runId,
157
+ instructions,
158
+ });
159
+ });
160
+
161
+ if (mastra.getStorage()) {
162
+ // start storage init in the background
163
+ mastra.getStorage().init();
164
+ }
146
165
 
147
- export default handle(app)
166
+ registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
167
+ const storage = mastra.getStorage();
168
+ if (storage) {
169
+ // Check for required fields
170
+ const logger = mastra?.getLogger();
171
+ const areFieldsValid = checkEvalStorageFields(traceObject, logger);
172
+ if (!areFieldsValid) return;
173
+
174
+ await storage.insert({
175
+ tableName: TABLE_EVALS,
176
+ record: {
177
+ input: traceObject.input,
178
+ output: traceObject.output,
179
+ result: JSON.stringify(traceObject.result || {}),
180
+ agent_name: traceObject.agentName,
181
+ metric_name: traceObject.metricName,
182
+ instructions: traceObject.instructions,
183
+ test_info: null,
184
+ global_run_id: traceObject.globalRunId,
185
+ run_id: traceObject.runId,
186
+ created_at: new Date().toISOString(),
187
+ },
188
+ });
189
+ }
190
+ });
191
+
192
+ const app = await createHonoServer(mastra);
193
+
194
+ export default handle(app)
148
195
  `;
149
196
  }
197
+ async lint(entryFile, outputDirectory, toolsPaths) {
198
+ await super.lint(entryFile, outputDirectory, toolsPaths);
199
+ }
150
200
  };
151
201
 
152
202
  export { NetlifyDeployer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer-netlify",
3
- "version": "0.0.0-mastra-3123-mcp-server-20250419180157",
3
+ "version": "0.0.0-mastra-2452-core-tracing-sentry-20250507205331",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -29,18 +29,18 @@
29
29
  "date-fns": "^4.1.0",
30
30
  "execa": "^9.5.2",
31
31
  "netlify-cli": "^19.0.3",
32
- "zod": "^3.24.2",
33
- "@mastra/deployer": "0.0.0-mastra-3123-mcp-server-20250419180157",
34
- "@mastra/core": "0.0.0-mastra-3123-mcp-server-20250419180157"
32
+ "zod": "^3.24.3",
33
+ "@mastra/core": "0.0.0-mastra-2452-core-tracing-sentry-20250507205331",
34
+ "@mastra/deployer": "0.0.0-mastra-2452-core-tracing-sentry-20250507205331"
35
35
  },
36
36
  "devDependencies": {
37
- "@microsoft/api-extractor": "^7.52.1",
37
+ "@microsoft/api-extractor": "^7.52.5",
38
38
  "@types/node": "^20.17.27",
39
39
  "eslint": "^9.23.0",
40
40
  "tsup": "^8.4.0",
41
41
  "typescript": "^5.8.2",
42
- "vitest": "^3.0.9",
43
- "@internal/lint": "0.0.2"
42
+ "vitest": "^3.1.2",
43
+ "@internal/lint": "0.0.0-mastra-2452-core-tracing-sentry-20250507205331"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",