@mastra/deployer-netlify 0.0.0-support-monorepos-20250415183219 → 0.0.0-support-d1-client-20250701191943
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 +4 -30
- package/dist/_tsup-dts-rollup.d.ts +4 -30
- package/dist/index.cjs +77 -112
- package/dist/index.js +74 -113
- package/package.json +17 -13
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
2
|
|
|
3
|
-
export declare function getOrCreateSite({ token, name, scope }: {
|
|
4
|
-
token: string;
|
|
5
|
-
name: string;
|
|
6
|
-
scope: string;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
id: string | undefined;
|
|
9
|
-
name: string | undefined;
|
|
10
|
-
url: string | undefined;
|
|
11
|
-
adminUrl: string | undefined;
|
|
12
|
-
} | {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
ssl_url: string;
|
|
16
|
-
url: string;
|
|
17
|
-
admin_url: string;
|
|
18
|
-
}>;
|
|
19
|
-
|
|
20
3
|
export declare class NetlifyDeployer extends Deployer {
|
|
21
|
-
|
|
22
|
-
protected projectName: string;
|
|
23
|
-
protected token: string;
|
|
24
|
-
constructor({ scope, projectName, token }: {
|
|
25
|
-
scope: string;
|
|
26
|
-
projectName: string;
|
|
27
|
-
token: string;
|
|
28
|
-
});
|
|
29
|
-
writeFiles({ dir }: {
|
|
30
|
-
dir: string;
|
|
31
|
-
}): void;
|
|
4
|
+
constructor();
|
|
32
5
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
33
|
-
deploy(
|
|
6
|
+
deploy(): Promise<void>;
|
|
34
7
|
prepare(outputDirectory: string): Promise<void>;
|
|
35
|
-
bundle(entryFile: string, outputDirectory: string): Promise<void>;
|
|
8
|
+
bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
36
9
|
private getEntry;
|
|
10
|
+
lint(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
37
11
|
}
|
|
38
12
|
|
|
39
13
|
export { }
|
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
2
|
|
|
3
|
-
export declare function getOrCreateSite({ token, name, scope }: {
|
|
4
|
-
token: string;
|
|
5
|
-
name: string;
|
|
6
|
-
scope: string;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
id: string | undefined;
|
|
9
|
-
name: string | undefined;
|
|
10
|
-
url: string | undefined;
|
|
11
|
-
adminUrl: string | undefined;
|
|
12
|
-
} | {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
ssl_url: string;
|
|
16
|
-
url: string;
|
|
17
|
-
admin_url: string;
|
|
18
|
-
}>;
|
|
19
|
-
|
|
20
3
|
export declare class NetlifyDeployer extends Deployer {
|
|
21
|
-
|
|
22
|
-
protected projectName: string;
|
|
23
|
-
protected token: string;
|
|
24
|
-
constructor({ scope, projectName, token }: {
|
|
25
|
-
scope: string;
|
|
26
|
-
projectName: string;
|
|
27
|
-
token: string;
|
|
28
|
-
});
|
|
29
|
-
writeFiles({ dir }: {
|
|
30
|
-
dir: string;
|
|
31
|
-
}): void;
|
|
4
|
+
constructor();
|
|
32
5
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
33
|
-
deploy(
|
|
6
|
+
deploy(): Promise<void>;
|
|
34
7
|
prepare(outputDirectory: string): Promise<void>;
|
|
35
|
-
bundle(entryFile: string, outputDirectory: string): Promise<void>;
|
|
8
|
+
bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
36
9
|
private getEntry;
|
|
10
|
+
lint(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
37
11
|
}
|
|
38
12
|
|
|
39
13
|
export { }
|
package/dist/index.cjs
CHANGED
|
@@ -1,96 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var fs = require('fs');
|
|
4
3
|
var path = require('path');
|
|
4
|
+
var process = require('process');
|
|
5
5
|
var deployer = require('@mastra/deployer');
|
|
6
6
|
var services = require('@mastra/deployer/services');
|
|
7
|
-
var
|
|
7
|
+
var esm = require('fs-extra/esm');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
async function createNetlifySite({ token, name, scope }) {
|
|
13
|
-
const response = await fetch("https://api.netlify.com/api/v1/sites", {
|
|
14
|
-
method: "POST",
|
|
15
|
-
headers: {
|
|
16
|
-
Authorization: `Bearer ${token}`,
|
|
17
|
-
"Content-Type": "application/json"
|
|
18
|
-
},
|
|
19
|
-
body: JSON.stringify({
|
|
20
|
-
name,
|
|
21
|
-
account_slug: scope,
|
|
22
|
-
// Optional - if not provided, creates in user's default account
|
|
23
|
-
force_ssl: true
|
|
24
|
-
// Enable HTTPS
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
const data = await response.json();
|
|
28
|
-
if (!response.ok) {
|
|
29
|
-
console.error(JSON.stringify(data));
|
|
30
|
-
throw new Error(`Failed to create site: ${data.message || "Unknown error"}`);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
id: data.id,
|
|
34
|
-
name: data.name,
|
|
35
|
-
url: data.ssl_url || data.url,
|
|
36
|
-
adminUrl: data.admin_url
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
async function findNetlifySite({ token, name, scope }) {
|
|
40
|
-
const response = await fetch(`https://api.netlify.com/api/v1/${scope}/sites?filter=all&name=${name}`, {
|
|
41
|
-
headers: {
|
|
42
|
-
Authorization: `Bearer ${token}`,
|
|
43
|
-
"Content-Type": "application/json"
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const data = await response.json();
|
|
47
|
-
if (!response.ok || !Array.isArray(data)) {
|
|
48
|
-
throw new Error(`Failed to search sites: ${data.message || "Unknown error"}`);
|
|
49
|
-
}
|
|
50
|
-
return data.find((site) => site.name === name);
|
|
51
|
-
}
|
|
52
|
-
async function getOrCreateSite({ token, name, scope }) {
|
|
53
|
-
let existingSite;
|
|
54
|
-
try {
|
|
55
|
-
existingSite = await findNetlifySite({ token, name, scope });
|
|
56
|
-
} catch {
|
|
57
|
-
}
|
|
58
|
-
if (existingSite) {
|
|
59
|
-
return existingSite;
|
|
60
|
-
}
|
|
61
|
-
return createNetlifySite({ token, name, scope });
|
|
62
|
-
}
|
|
11
|
+
var process__default = /*#__PURE__*/_interopDefault(process);
|
|
63
12
|
|
|
64
13
|
// src/index.ts
|
|
65
14
|
var NetlifyDeployer = class extends deployer.Deployer {
|
|
66
|
-
|
|
67
|
-
projectName;
|
|
68
|
-
token;
|
|
69
|
-
constructor({ scope, projectName, token }) {
|
|
15
|
+
constructor() {
|
|
70
16
|
super({ name: "NETLIFY" });
|
|
71
|
-
this.
|
|
72
|
-
this.projectName = projectName;
|
|
73
|
-
this.token = token;
|
|
17
|
+
this.outputDir = path.join(".netlify", "v1", "functions", "api");
|
|
74
18
|
}
|
|
75
|
-
|
|
76
|
-
if (!fs.existsSync(path.join(dir, "netlify/functions/api"))) {
|
|
77
|
-
fs.mkdirSync(path.join(dir, "netlify/functions/api"), { recursive: true });
|
|
78
|
-
}
|
|
79
|
-
fs.writeFileSync(
|
|
80
|
-
path.join(dir, "netlify.toml"),
|
|
81
|
-
`[functions]
|
|
82
|
-
node_bundler = "esbuild"
|
|
83
|
-
directory = "netlify/functions"
|
|
84
|
-
|
|
85
|
-
[[redirects]]
|
|
86
|
-
force = true
|
|
87
|
-
from = "/*"
|
|
88
|
-
status = 200
|
|
89
|
-
to = "/.netlify/functions/api/:splat"
|
|
90
|
-
`
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
19
|
+
async installDependencies(outputDirectory, rootDir = process__default.default.cwd()) {
|
|
94
20
|
const deps = new services.DepsService(rootDir);
|
|
95
21
|
deps.__setLogger(this.logger);
|
|
96
22
|
await deps.install({
|
|
@@ -102,52 +28,91 @@ to = "/.netlify/functions/api/:splat"
|
|
|
102
28
|
}
|
|
103
29
|
});
|
|
104
30
|
}
|
|
105
|
-
async deploy(
|
|
106
|
-
|
|
107
|
-
const p2 = execa.execa(
|
|
108
|
-
"npx",
|
|
109
|
-
[
|
|
110
|
-
"netlify-cli",
|
|
111
|
-
"deploy",
|
|
112
|
-
"--site",
|
|
113
|
-
site.id,
|
|
114
|
-
"--auth",
|
|
115
|
-
this.token,
|
|
116
|
-
"--dir",
|
|
117
|
-
".",
|
|
118
|
-
"--functions",
|
|
119
|
-
"./netlify/functions"
|
|
120
|
-
],
|
|
121
|
-
{
|
|
122
|
-
cwd: path.join(outputDirectory, this.outputDir)
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
p2.stdout.pipe(process.stdout);
|
|
126
|
-
await p2;
|
|
31
|
+
async deploy() {
|
|
32
|
+
this.logger?.info("Deploying to Netlify failed. Please use the Netlify dashboard to deploy.");
|
|
127
33
|
}
|
|
128
34
|
async prepare(outputDirectory) {
|
|
129
35
|
await super.prepare(outputDirectory);
|
|
130
|
-
this.writeFiles({ dir: path.join(outputDirectory, this.outputDir) });
|
|
131
36
|
}
|
|
132
|
-
async bundle(entryFile, outputDirectory) {
|
|
133
|
-
|
|
37
|
+
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
38
|
+
const result = await this._bundle(
|
|
134
39
|
this.getEntry(),
|
|
135
40
|
entryFile,
|
|
136
41
|
outputDirectory,
|
|
137
|
-
|
|
42
|
+
toolsPaths,
|
|
43
|
+
path.join(outputDirectory, this.outputDir)
|
|
138
44
|
);
|
|
45
|
+
await esm.writeJson(path.join(outputDirectory, ".netlify", "v1", "config.json"), {
|
|
46
|
+
redirects: [
|
|
47
|
+
{
|
|
48
|
+
force: true,
|
|
49
|
+
from: "/*",
|
|
50
|
+
to: "/.netlify/functions/api/:splat",
|
|
51
|
+
status: 200
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
await esm.move(path.join(outputDirectory, ".netlify", "v1"), path.join(process__default.default.cwd(), ".netlify", "v1"), {
|
|
56
|
+
overwrite: true
|
|
57
|
+
});
|
|
58
|
+
return result;
|
|
139
59
|
}
|
|
140
60
|
getEntry() {
|
|
141
61
|
return `
|
|
142
|
-
import { handle } from 'hono/netlify'
|
|
143
|
-
import { mastra } from '#mastra';
|
|
144
|
-
import { createHonoServer } from '#server';
|
|
62
|
+
import { handle } from 'hono/netlify'
|
|
63
|
+
import { mastra } from '#mastra';
|
|
64
|
+
import { createHonoServer } from '#server';
|
|
65
|
+
import { evaluate } from '@mastra/core/eval';
|
|
66
|
+
import { AvailableHooks, registerHook } from '@mastra/core/hooks';
|
|
67
|
+
import { TABLE_EVALS } from '@mastra/core/storage';
|
|
68
|
+
import { checkEvalStorageFields } from '@mastra/core/utils';
|
|
145
69
|
|
|
146
|
-
|
|
70
|
+
registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {
|
|
71
|
+
evaluate({
|
|
72
|
+
agentName,
|
|
73
|
+
input,
|
|
74
|
+
metric,
|
|
75
|
+
output,
|
|
76
|
+
runId,
|
|
77
|
+
globalRunId: runId,
|
|
78
|
+
instructions,
|
|
79
|
+
});
|
|
80
|
+
});
|
|
147
81
|
|
|
148
|
-
|
|
82
|
+
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
83
|
+
const storage = mastra.getStorage();
|
|
84
|
+
if (storage) {
|
|
85
|
+
// Check for required fields
|
|
86
|
+
const logger = mastra.getLogger();
|
|
87
|
+
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
88
|
+
if (!areFieldsValid) return;
|
|
89
|
+
|
|
90
|
+
await storage.insert({
|
|
91
|
+
tableName: TABLE_EVALS,
|
|
92
|
+
record: {
|
|
93
|
+
input: traceObject.input,
|
|
94
|
+
output: traceObject.output,
|
|
95
|
+
result: JSON.stringify(traceObject.result || {}),
|
|
96
|
+
agent_name: traceObject.agentName,
|
|
97
|
+
metric_name: traceObject.metricName,
|
|
98
|
+
instructions: traceObject.instructions,
|
|
99
|
+
test_info: null,
|
|
100
|
+
global_run_id: traceObject.globalRunId,
|
|
101
|
+
run_id: traceObject.runId,
|
|
102
|
+
created_at: new Date().toISOString(),
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const app = await createHonoServer(mastra);
|
|
109
|
+
|
|
110
|
+
export default handle(app)
|
|
149
111
|
`;
|
|
150
112
|
}
|
|
113
|
+
async lint(entryFile, outputDirectory, toolsPaths) {
|
|
114
|
+
await super.lint(entryFile, outputDirectory, toolsPaths);
|
|
115
|
+
}
|
|
151
116
|
};
|
|
152
117
|
|
|
153
118
|
exports.NetlifyDeployer = NetlifyDeployer;
|
package/dist/index.js
CHANGED
|
@@ -1,92 +1,14 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
2
1
|
import { join } from 'path';
|
|
2
|
+
import process from 'process';
|
|
3
3
|
import { Deployer } from '@mastra/deployer';
|
|
4
4
|
import { DepsService } from '@mastra/deployer/services';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
// src/index.ts
|
|
8
|
-
|
|
9
|
-
// src/helpers.ts
|
|
10
|
-
async function createNetlifySite({ token, name, scope }) {
|
|
11
|
-
const response = await fetch("https://api.netlify.com/api/v1/sites", {
|
|
12
|
-
method: "POST",
|
|
13
|
-
headers: {
|
|
14
|
-
Authorization: `Bearer ${token}`,
|
|
15
|
-
"Content-Type": "application/json"
|
|
16
|
-
},
|
|
17
|
-
body: JSON.stringify({
|
|
18
|
-
name,
|
|
19
|
-
account_slug: scope,
|
|
20
|
-
// Optional - if not provided, creates in user's default account
|
|
21
|
-
force_ssl: true
|
|
22
|
-
// Enable HTTPS
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
const data = await response.json();
|
|
26
|
-
if (!response.ok) {
|
|
27
|
-
console.error(JSON.stringify(data));
|
|
28
|
-
throw new Error(`Failed to create site: ${data.message || "Unknown error"}`);
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
id: data.id,
|
|
32
|
-
name: data.name,
|
|
33
|
-
url: data.ssl_url || data.url,
|
|
34
|
-
adminUrl: data.admin_url
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
async function findNetlifySite({ token, name, scope }) {
|
|
38
|
-
const response = await fetch(`https://api.netlify.com/api/v1/${scope}/sites?filter=all&name=${name}`, {
|
|
39
|
-
headers: {
|
|
40
|
-
Authorization: `Bearer ${token}`,
|
|
41
|
-
"Content-Type": "application/json"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const data = await response.json();
|
|
45
|
-
if (!response.ok || !Array.isArray(data)) {
|
|
46
|
-
throw new Error(`Failed to search sites: ${data.message || "Unknown error"}`);
|
|
47
|
-
}
|
|
48
|
-
return data.find((site) => site.name === name);
|
|
49
|
-
}
|
|
50
|
-
async function getOrCreateSite({ token, name, scope }) {
|
|
51
|
-
let existingSite;
|
|
52
|
-
try {
|
|
53
|
-
existingSite = await findNetlifySite({ token, name, scope });
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
if (existingSite) {
|
|
57
|
-
return existingSite;
|
|
58
|
-
}
|
|
59
|
-
return createNetlifySite({ token, name, scope });
|
|
60
|
-
}
|
|
5
|
+
import { writeJson, move } from 'fs-extra/esm';
|
|
61
6
|
|
|
62
7
|
// src/index.ts
|
|
63
8
|
var NetlifyDeployer = class extends Deployer {
|
|
64
|
-
|
|
65
|
-
projectName;
|
|
66
|
-
token;
|
|
67
|
-
constructor({ scope, projectName, token }) {
|
|
9
|
+
constructor() {
|
|
68
10
|
super({ name: "NETLIFY" });
|
|
69
|
-
this.
|
|
70
|
-
this.projectName = projectName;
|
|
71
|
-
this.token = token;
|
|
72
|
-
}
|
|
73
|
-
writeFiles({ dir }) {
|
|
74
|
-
if (!existsSync(join(dir, "netlify/functions/api"))) {
|
|
75
|
-
mkdirSync(join(dir, "netlify/functions/api"), { recursive: true });
|
|
76
|
-
}
|
|
77
|
-
writeFileSync(
|
|
78
|
-
join(dir, "netlify.toml"),
|
|
79
|
-
`[functions]
|
|
80
|
-
node_bundler = "esbuild"
|
|
81
|
-
directory = "netlify/functions"
|
|
82
|
-
|
|
83
|
-
[[redirects]]
|
|
84
|
-
force = true
|
|
85
|
-
from = "/*"
|
|
86
|
-
status = 200
|
|
87
|
-
to = "/.netlify/functions/api/:splat"
|
|
88
|
-
`
|
|
89
|
-
);
|
|
11
|
+
this.outputDir = join(".netlify", "v1", "functions", "api");
|
|
90
12
|
}
|
|
91
13
|
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
92
14
|
const deps = new DepsService(rootDir);
|
|
@@ -100,52 +22,91 @@ to = "/.netlify/functions/api/:splat"
|
|
|
100
22
|
}
|
|
101
23
|
});
|
|
102
24
|
}
|
|
103
|
-
async deploy(
|
|
104
|
-
|
|
105
|
-
const p2 = execa(
|
|
106
|
-
"npx",
|
|
107
|
-
[
|
|
108
|
-
"netlify-cli",
|
|
109
|
-
"deploy",
|
|
110
|
-
"--site",
|
|
111
|
-
site.id,
|
|
112
|
-
"--auth",
|
|
113
|
-
this.token,
|
|
114
|
-
"--dir",
|
|
115
|
-
".",
|
|
116
|
-
"--functions",
|
|
117
|
-
"./netlify/functions"
|
|
118
|
-
],
|
|
119
|
-
{
|
|
120
|
-
cwd: join(outputDirectory, this.outputDir)
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
p2.stdout.pipe(process.stdout);
|
|
124
|
-
await p2;
|
|
25
|
+
async deploy() {
|
|
26
|
+
this.logger?.info("Deploying to Netlify failed. Please use the Netlify dashboard to deploy.");
|
|
125
27
|
}
|
|
126
28
|
async prepare(outputDirectory) {
|
|
127
29
|
await super.prepare(outputDirectory);
|
|
128
|
-
this.writeFiles({ dir: join(outputDirectory, this.outputDir) });
|
|
129
30
|
}
|
|
130
|
-
async bundle(entryFile, outputDirectory) {
|
|
131
|
-
|
|
31
|
+
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
32
|
+
const result = await this._bundle(
|
|
132
33
|
this.getEntry(),
|
|
133
34
|
entryFile,
|
|
134
35
|
outputDirectory,
|
|
135
|
-
|
|
36
|
+
toolsPaths,
|
|
37
|
+
join(outputDirectory, this.outputDir)
|
|
136
38
|
);
|
|
39
|
+
await writeJson(join(outputDirectory, ".netlify", "v1", "config.json"), {
|
|
40
|
+
redirects: [
|
|
41
|
+
{
|
|
42
|
+
force: true,
|
|
43
|
+
from: "/*",
|
|
44
|
+
to: "/.netlify/functions/api/:splat",
|
|
45
|
+
status: 200
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
await move(join(outputDirectory, ".netlify", "v1"), join(process.cwd(), ".netlify", "v1"), {
|
|
50
|
+
overwrite: true
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
137
53
|
}
|
|
138
54
|
getEntry() {
|
|
139
55
|
return `
|
|
140
|
-
import { handle } from 'hono/netlify'
|
|
141
|
-
import { mastra } from '#mastra';
|
|
142
|
-
import { createHonoServer } from '#server';
|
|
56
|
+
import { handle } from 'hono/netlify'
|
|
57
|
+
import { mastra } from '#mastra';
|
|
58
|
+
import { createHonoServer } from '#server';
|
|
59
|
+
import { evaluate } from '@mastra/core/eval';
|
|
60
|
+
import { AvailableHooks, registerHook } from '@mastra/core/hooks';
|
|
61
|
+
import { TABLE_EVALS } from '@mastra/core/storage';
|
|
62
|
+
import { checkEvalStorageFields } from '@mastra/core/utils';
|
|
63
|
+
|
|
64
|
+
registerHook(AvailableHooks.ON_GENERATION, ({ input, output, metric, runId, agentName, instructions }) => {
|
|
65
|
+
evaluate({
|
|
66
|
+
agentName,
|
|
67
|
+
input,
|
|
68
|
+
metric,
|
|
69
|
+
output,
|
|
70
|
+
runId,
|
|
71
|
+
globalRunId: runId,
|
|
72
|
+
instructions,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
143
75
|
|
|
144
|
-
|
|
76
|
+
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
77
|
+
const storage = mastra.getStorage();
|
|
78
|
+
if (storage) {
|
|
79
|
+
// Check for required fields
|
|
80
|
+
const logger = mastra.getLogger();
|
|
81
|
+
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
82
|
+
if (!areFieldsValid) return;
|
|
145
83
|
|
|
146
|
-
|
|
84
|
+
await storage.insert({
|
|
85
|
+
tableName: TABLE_EVALS,
|
|
86
|
+
record: {
|
|
87
|
+
input: traceObject.input,
|
|
88
|
+
output: traceObject.output,
|
|
89
|
+
result: JSON.stringify(traceObject.result || {}),
|
|
90
|
+
agent_name: traceObject.agentName,
|
|
91
|
+
metric_name: traceObject.metricName,
|
|
92
|
+
instructions: traceObject.instructions,
|
|
93
|
+
test_info: null,
|
|
94
|
+
global_run_id: traceObject.globalRunId,
|
|
95
|
+
run_id: traceObject.runId,
|
|
96
|
+
created_at: new Date().toISOString(),
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const app = await createHonoServer(mastra);
|
|
103
|
+
|
|
104
|
+
export default handle(app)
|
|
147
105
|
`;
|
|
148
106
|
}
|
|
107
|
+
async lint(entryFile, outputDirectory, toolsPaths) {
|
|
108
|
+
await super.lint(entryFile, outputDirectory, toolsPaths);
|
|
109
|
+
}
|
|
149
110
|
};
|
|
150
111
|
|
|
151
112
|
export { NetlifyDeployer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-netlify",
|
|
3
|
-
"version": "0.0.0-support-
|
|
3
|
+
"version": "0.0.0-support-d1-client-20250701191943",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -27,20 +27,24 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@rollup/plugin-virtual": "^3.0.2",
|
|
29
29
|
"date-fns": "^4.1.0",
|
|
30
|
-
"execa": "^9.
|
|
31
|
-
"
|
|
32
|
-
"zod": "^3.
|
|
33
|
-
"@mastra/
|
|
34
|
-
"@mastra/deployer": "0.0.0-support-monorepos-20250415183219"
|
|
30
|
+
"execa": "^9.6.0",
|
|
31
|
+
"fs-extra": "^11.3.0",
|
|
32
|
+
"zod": "^3.25.67",
|
|
33
|
+
"@mastra/deployer": "0.0.0-support-d1-client-20250701191943"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@microsoft/api-extractor": "^7.52.
|
|
38
|
-
"@types/
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
36
|
+
"@microsoft/api-extractor": "^7.52.8",
|
|
37
|
+
"@types/fs-extra": "^11.0.4",
|
|
38
|
+
"@types/node": "^20.19.0",
|
|
39
|
+
"eslint": "^9.29.0",
|
|
40
|
+
"tsup": "^8.5.0",
|
|
41
|
+
"typescript": "^5.8.3",
|
|
42
|
+
"vitest": "^3.2.4",
|
|
43
|
+
"@internal/lint": "0.0.0-support-d1-client-20250701191943",
|
|
44
|
+
"@mastra/core": "0.0.0-support-d1-client-20250701191943"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@mastra/core": "0.0.0-support-d1-client-20250701191943"
|
|
44
48
|
},
|
|
45
49
|
"scripts": {
|
|
46
50
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|