@mastra/deployer-netlify 0.0.0-message-ordering-20250415215612 → 0.0.0-pass-headers-for-create-mastra-client-20250529190531
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +2 -1
- package/dist/_tsup-dts-rollup.d.ts +2 -1
- package/dist/index.cjs +52 -6
- package/dist/index.js +52 -6
- package/package.json +10 -7
|
@@ -32,8 +32,9 @@ export declare class NetlifyDeployer extends Deployer {
|
|
|
32
32
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
33
33
|
deploy(outputDirectory: string): Promise<void>;
|
|
34
34
|
prepare(outputDirectory: string): Promise<void>;
|
|
35
|
-
bundle(entryFile: string, outputDirectory: string): Promise<void>;
|
|
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 { }
|
|
@@ -32,8 +32,9 @@ export declare class NetlifyDeployer extends Deployer {
|
|
|
32
32
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
33
33
|
deploy(outputDirectory: string): Promise<void>;
|
|
34
34
|
prepare(outputDirectory: string): Promise<void>;
|
|
35
|
-
bundle(entryFile: string, outputDirectory: string): Promise<void>;
|
|
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
|
@@ -129,25 +129,71 @@ to = "/.netlify/functions/api/:splat"
|
|
|
129
129
|
await super.prepare(outputDirectory);
|
|
130
130
|
this.writeFiles({ dir: path.join(outputDirectory, this.outputDir) });
|
|
131
131
|
}
|
|
132
|
-
async bundle(entryFile, outputDirectory) {
|
|
132
|
+
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
133
133
|
return this._bundle(
|
|
134
134
|
this.getEntry(),
|
|
135
135
|
entryFile,
|
|
136
136
|
outputDirectory,
|
|
137
|
+
toolsPaths,
|
|
137
138
|
path.join(outputDirectory, this.outputDir, "netlify", "functions", "api")
|
|
138
139
|
);
|
|
139
140
|
}
|
|
140
141
|
getEntry() {
|
|
141
142
|
return `
|
|
142
|
-
import { handle } from 'hono/netlify'
|
|
143
|
-
import { mastra } from '#mastra';
|
|
144
|
-
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';
|
|
145
150
|
|
|
146
|
-
|
|
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
|
+
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
164
|
+
const storage = mastra.getStorage();
|
|
165
|
+
if (storage) {
|
|
166
|
+
// Check for required fields
|
|
167
|
+
const logger = mastra.getLogger();
|
|
168
|
+
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
169
|
+
if (!areFieldsValid) return;
|
|
147
170
|
|
|
148
|
-
|
|
171
|
+
await storage.insert({
|
|
172
|
+
tableName: TABLE_EVALS,
|
|
173
|
+
record: {
|
|
174
|
+
input: traceObject.input,
|
|
175
|
+
output: traceObject.output,
|
|
176
|
+
result: JSON.stringify(traceObject.result || {}),
|
|
177
|
+
agent_name: traceObject.agentName,
|
|
178
|
+
metric_name: traceObject.metricName,
|
|
179
|
+
instructions: traceObject.instructions,
|
|
180
|
+
test_info: null,
|
|
181
|
+
global_run_id: traceObject.globalRunId,
|
|
182
|
+
run_id: traceObject.runId,
|
|
183
|
+
created_at: new Date().toISOString(),
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const app = await createHonoServer(mastra);
|
|
190
|
+
|
|
191
|
+
export default handle(app)
|
|
149
192
|
`;
|
|
150
193
|
}
|
|
194
|
+
async lint(entryFile, outputDirectory, toolsPaths) {
|
|
195
|
+
await super.lint(entryFile, outputDirectory, toolsPaths);
|
|
196
|
+
}
|
|
151
197
|
};
|
|
152
198
|
|
|
153
199
|
exports.NetlifyDeployer = NetlifyDeployer;
|
package/dist/index.js
CHANGED
|
@@ -127,25 +127,71 @@ to = "/.netlify/functions/api/:splat"
|
|
|
127
127
|
await super.prepare(outputDirectory);
|
|
128
128
|
this.writeFiles({ dir: join(outputDirectory, this.outputDir) });
|
|
129
129
|
}
|
|
130
|
-
async bundle(entryFile, outputDirectory) {
|
|
130
|
+
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
131
131
|
return this._bundle(
|
|
132
132
|
this.getEntry(),
|
|
133
133
|
entryFile,
|
|
134
134
|
outputDirectory,
|
|
135
|
+
toolsPaths,
|
|
135
136
|
join(outputDirectory, this.outputDir, "netlify", "functions", "api")
|
|
136
137
|
);
|
|
137
138
|
}
|
|
138
139
|
getEntry() {
|
|
139
140
|
return `
|
|
140
|
-
import { handle } from 'hono/netlify'
|
|
141
|
-
import { mastra } from '#mastra';
|
|
142
|
-
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';
|
|
143
148
|
|
|
144
|
-
|
|
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
|
+
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
162
|
+
const storage = mastra.getStorage();
|
|
163
|
+
if (storage) {
|
|
164
|
+
// Check for required fields
|
|
165
|
+
const logger = mastra.getLogger();
|
|
166
|
+
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
167
|
+
if (!areFieldsValid) return;
|
|
145
168
|
|
|
146
|
-
|
|
169
|
+
await storage.insert({
|
|
170
|
+
tableName: TABLE_EVALS,
|
|
171
|
+
record: {
|
|
172
|
+
input: traceObject.input,
|
|
173
|
+
output: traceObject.output,
|
|
174
|
+
result: JSON.stringify(traceObject.result || {}),
|
|
175
|
+
agent_name: traceObject.agentName,
|
|
176
|
+
metric_name: traceObject.metricName,
|
|
177
|
+
instructions: traceObject.instructions,
|
|
178
|
+
test_info: null,
|
|
179
|
+
global_run_id: traceObject.globalRunId,
|
|
180
|
+
run_id: traceObject.runId,
|
|
181
|
+
created_at: new Date().toISOString(),
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const app = await createHonoServer(mastra);
|
|
188
|
+
|
|
189
|
+
export default handle(app)
|
|
147
190
|
`;
|
|
148
191
|
}
|
|
192
|
+
async lint(entryFile, outputDirectory, toolsPaths) {
|
|
193
|
+
await super.lint(entryFile, outputDirectory, toolsPaths);
|
|
194
|
+
}
|
|
149
195
|
};
|
|
150
196
|
|
|
151
197
|
export { NetlifyDeployer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-netlify",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-pass-headers-for-create-mastra-client-20250529190531",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -29,18 +29,21 @@
|
|
|
29
29
|
"date-fns": "^4.1.0",
|
|
30
30
|
"execa": "^9.5.2",
|
|
31
31
|
"netlify-cli": "^19.0.3",
|
|
32
|
-
"zod": "^3.24.
|
|
33
|
-
"@mastra/
|
|
34
|
-
"@mastra/deployer": "0.0.0-message-ordering-20250415215612"
|
|
32
|
+
"zod": "^3.24.3",
|
|
33
|
+
"@mastra/deployer": "0.0.0-pass-headers-for-create-mastra-client-20250529190531"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@microsoft/api-extractor": "^7.52.
|
|
36
|
+
"@microsoft/api-extractor": "^7.52.5",
|
|
38
37
|
"@types/node": "^20.17.27",
|
|
39
38
|
"eslint": "^9.23.0",
|
|
40
39
|
"tsup": "^8.4.0",
|
|
41
40
|
"typescript": "^5.8.2",
|
|
42
|
-
"vitest": "^3.
|
|
43
|
-
"@internal/lint": "0.0.
|
|
41
|
+
"vitest": "^3.1.2",
|
|
42
|
+
"@internal/lint": "0.0.0-pass-headers-for-create-mastra-client-20250529190531",
|
|
43
|
+
"@mastra/core": "0.0.0-pass-headers-for-create-mastra-client-20250529190531"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@mastra/core": "^0.10.0"
|
|
44
47
|
},
|
|
45
48
|
"scripts": {
|
|
46
49
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|