@mastra/deployer 0.1.5-alpha.2 → 0.1.5
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +27 -0
- package/dist/bundler/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/index.js +11 -5
- package/dist/templates/instrumentation-template.js +2 -2
- package/package.json +2 -2
- package/public/templates/instrumentation-template.js +2 -2
- package/src/bundler/index.ts +4 -5
- package/src/deploy/log.ts +1 -1
- package/src/server/handlers/agents.ts +1 -2
- package/src/server/handlers/tools.ts +9 -2
- package/src/server/index.ts +4 -4
- package/dist/{chunk-IHPQAB7O.js → chunk-VANRMAOD.js} +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/deployer@0.1.5-alpha.
|
|
2
|
+
> @mastra/deployer@0.1.5-alpha.3 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
|
[34mCLI[39m 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
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.3.6
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 17510ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.7.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/deployer/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
|
-
[32mDTS[39m ⚡️ Build success in
|
|
14
|
+
[32mDTS[39m ⚡️ Build success in 8595ms
|
|
15
15
|
[34mCLI[39m Cleaning output folder
|
|
16
16
|
[34mESM[39m Build start
|
|
17
|
-
[32mESM[39m [1mdist/index.js [22m[32m3.70 KB[39m
|
|
18
17
|
[32mESM[39m [1mdist/build/analyze.js [22m[32m85.00 B[39m
|
|
19
|
-
[32mESM[39m [1mdist/
|
|
18
|
+
[32mESM[39m [1mdist/index.js [22m[32m3.70 KB[39m
|
|
20
19
|
[32mESM[39m [1mdist/build/index.js [22m[32m383.00 B[39m
|
|
21
20
|
[32mESM[39m [1mdist/chunk-BTUQ6UBB.js [22m[32m7.41 KB[39m
|
|
21
|
+
[32mESM[39m [1mdist/build/bundler.js [22m[32m102.00 B[39m
|
|
22
22
|
[32mESM[39m [1mdist/bundler/index.js [22m[32m172.00 B[39m
|
|
23
|
-
[32mESM[39m [1mdist/chunk-
|
|
24
|
-
[32mESM[39m [1mdist/chunk-
|
|
23
|
+
[32mESM[39m [1mdist/chunk-VANRMAOD.js [22m[32m4.40 KB[39m
|
|
24
|
+
[32mESM[39m [1mdist/chunk-AXS5WSIK.js [22m[32m8.23 KB[39m
|
|
25
25
|
[32mESM[39m [1mdist/chunk-SESHBX76.js [22m[32m8.25 KB[39m
|
|
26
26
|
[32mESM[39m [1mdist/chunk-YNXJO2XU.js [22m[32m2.08 KB[39m
|
|
27
|
-
[32mESM[39m [1mdist/
|
|
28
|
-
[32mESM[39m [1mdist/
|
|
29
|
-
[32mESM[39m ⚡️ Build success in
|
|
27
|
+
[32mESM[39m [1mdist/server/index.js [22m[32m148.30 KB[39m
|
|
28
|
+
[32mESM[39m [1mdist/chunk-KXS4XYEJ.js [22m[32m7.20 KB[39m
|
|
29
|
+
[32mESM[39m ⚡️ Build success in 2594ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e4ee56c: Enable \* imports in analyze bundle
|
|
8
|
+
- 2d68431: Fix mastra server error processing
|
|
9
|
+
- e752340: Move storage/vector libSQL to own files so they do not get imported when not using bundlers.
|
|
10
|
+
- Updated dependencies [7fceae1]
|
|
11
|
+
- Updated dependencies [8d94c3e]
|
|
12
|
+
- Updated dependencies [99dcdb5]
|
|
13
|
+
- Updated dependencies [6cb63e0]
|
|
14
|
+
- Updated dependencies [f626fbb]
|
|
15
|
+
- Updated dependencies [e752340]
|
|
16
|
+
- Updated dependencies [eb91535]
|
|
17
|
+
- @mastra/core@0.4.2
|
|
18
|
+
|
|
19
|
+
## 0.1.5-alpha.3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- e752340: Move storage/vector libSQL to own files so they do not get imported when not using bundlers.
|
|
24
|
+
- Updated dependencies [8d94c3e]
|
|
25
|
+
- Updated dependencies [99dcdb5]
|
|
26
|
+
- Updated dependencies [e752340]
|
|
27
|
+
- Updated dependencies [eb91535]
|
|
28
|
+
- @mastra/core@0.4.2-alpha.2
|
|
29
|
+
|
|
3
30
|
## 0.1.5-alpha.2
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/bundler/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileService } from './chunk-BTUQ6UBB.js';
|
|
2
2
|
export { FileService } from './chunk-BTUQ6UBB.js';
|
|
3
|
-
import { Bundler } from './chunk-
|
|
3
|
+
import { Bundler } from './chunk-VANRMAOD.js';
|
|
4
4
|
import { Deps } from './chunk-AXS5WSIK.js';
|
|
5
5
|
export { Deps, createChildProcessLogger, createPinoStream } from './chunk-AXS5WSIK.js';
|
|
6
6
|
import './chunk-SESHBX76.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
1
4
|
import { createServer } from 'http';
|
|
2
5
|
import { Http2ServerRequest } from 'http2';
|
|
3
6
|
import { Readable } from 'stream';
|
|
@@ -7,17 +10,14 @@ import { getMimeType } from 'hono/utils/mime';
|
|
|
7
10
|
import { lstatSync, createReadStream } from 'fs';
|
|
8
11
|
import { html } from 'hono/html';
|
|
9
12
|
import { Hono } from 'hono';
|
|
10
|
-
import { HTTPException } from 'hono/http-exception';
|
|
11
|
-
import { join } from 'path';
|
|
12
|
-
import { pathToFileURL } from 'url';
|
|
13
|
-
import { readFile } from 'fs/promises';
|
|
14
13
|
import { bodyLimit } from 'hono/body-limit';
|
|
15
14
|
import { cors } from 'hono/cors';
|
|
16
15
|
import { logger } from 'hono/logger';
|
|
16
|
+
import { HTTPException } from 'hono/http-exception';
|
|
17
17
|
import { z, ZodFirstPartyTypeKind, ZodOptional } from 'zod';
|
|
18
18
|
import { Agent } from '@mastra/core/agent';
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// src/server/index.ts
|
|
21
21
|
var RequestError = class extends Error {
|
|
22
22
|
static name = "RequestError";
|
|
23
23
|
constructor(message, options) {
|
|
@@ -3377,6 +3377,9 @@ function executeToolHandler(tools) {
|
|
|
3377
3377
|
if (!tool) {
|
|
3378
3378
|
return c2.json({ error: "Tool not found" }, 404);
|
|
3379
3379
|
}
|
|
3380
|
+
if (!tool?.execute) {
|
|
3381
|
+
return c2.json({ error: "Tool is not executable" }, 400);
|
|
3382
|
+
}
|
|
3380
3383
|
const { data } = await c2.req.json();
|
|
3381
3384
|
const mastra = c2.get("mastra");
|
|
3382
3385
|
const result = await tool.execute({
|
|
@@ -3400,6 +3403,9 @@ async function executeAgentToolHandler(c2) {
|
|
|
3400
3403
|
if (!tool) {
|
|
3401
3404
|
throw new HTTPException(404, { message: "Tool not found" });
|
|
3402
3405
|
}
|
|
3406
|
+
if (!tool?.execute) {
|
|
3407
|
+
return c2.json({ error: "Tool is not executable" }, 400);
|
|
3408
|
+
}
|
|
3403
3409
|
const { data } = await c2.req.json();
|
|
3404
3410
|
const result = await tool.execute({
|
|
3405
3411
|
context: data,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from '@mastra/core/logger'
|
|
2
|
-
import {
|
|
2
|
+
import { LibSQLStore } from '@mastra/core/storage/libsql'
|
|
3
3
|
import { OTLPStorageExporter } from '@mastra/core/telemetry'
|
|
4
4
|
import {
|
|
5
5
|
NodeSDK, getNodeAutoInstrumentations, ATTR_SERVICE_NAME, Resource,
|
|
@@ -46,7 +46,7 @@ async function getExporter(config) {
|
|
|
46
46
|
} else if (config.export?.type === 'custom') {
|
|
47
47
|
return config.export.exporter
|
|
48
48
|
} else {
|
|
49
|
-
const storage = new
|
|
49
|
+
const storage = new LibSQLStore({
|
|
50
50
|
config: {
|
|
51
51
|
// file lives in ./.mastra/output, and we need to write to ./.mastra/mastra.db
|
|
52
52
|
url: "file:../mastra.db",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.1.5
|
|
3
|
+
"version": "0.1.5",
|
|
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.2
|
|
55
|
+
"@mastra/core": "^0.4.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@hono/node-server": "^1.13.7",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from '@mastra/core/logger'
|
|
2
|
-
import {
|
|
2
|
+
import { LibSQLStore } from '@mastra/core/storage/libsql'
|
|
3
3
|
import { OTLPStorageExporter } from '@mastra/core/telemetry'
|
|
4
4
|
import {
|
|
5
5
|
NodeSDK, getNodeAutoInstrumentations, ATTR_SERVICE_NAME, Resource,
|
|
@@ -46,7 +46,7 @@ async function getExporter(config) {
|
|
|
46
46
|
} else if (config.export?.type === 'custom') {
|
|
47
47
|
return config.export.exporter
|
|
48
48
|
} else {
|
|
49
|
-
const storage = new
|
|
49
|
+
const storage = new LibSQLStore({
|
|
50
50
|
config: {
|
|
51
51
|
// file lives in ./.mastra/output, and we need to write to ./.mastra/mastra.db
|
|
52
52
|
url: "file:../mastra.db",
|
package/src/bundler/index.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { MastraBundler } from '@mastra/core/bundler';
|
|
2
|
-
import virtual from '@rollup/plugin-virtual';
|
|
3
|
-
import { copy, ensureDir } from 'fs-extra';
|
|
4
1
|
import { existsSync } from 'node:fs';
|
|
5
2
|
import { writeFile } from 'node:fs/promises';
|
|
6
3
|
import { dirname, join } from 'node:path';
|
|
7
4
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import
|
|
9
|
-
|
|
5
|
+
import { MastraBundler } from '@mastra/core/bundler';
|
|
6
|
+
import virtual from '@rollup/plugin-virtual';
|
|
7
|
+
import { copy, ensureDir } from 'fs-extra';
|
|
10
8
|
import fsExtra from 'fs-extra/esm';
|
|
9
|
+
import type { InputOptions, OutputOptions } from 'rollup';
|
|
11
10
|
|
|
12
11
|
import { analyzeBundle } from '../build/analyze';
|
|
13
12
|
import { createBundler as createBundlerUtil, getInputOptions } from '../build/bundler';
|
package/src/deploy/log.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Mastra } from '@mastra/core';
|
|
2
2
|
import type { Context } from 'hono';
|
|
3
|
+
import { HTTPException } from 'hono/http-exception';
|
|
3
4
|
import { stringify } from 'superjson';
|
|
4
5
|
import zodToJsonSchema from 'zod-to-json-schema';
|
|
5
6
|
|
|
6
|
-
import { HTTPException } from 'hono/http-exception';
|
|
7
|
-
|
|
8
7
|
import { handleError } from './error';
|
|
9
8
|
import { validateBody } from './utils';
|
|
10
9
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
|
+
import { HTTPException } from 'hono/http-exception';
|
|
2
3
|
import { stringify } from 'superjson';
|
|
3
4
|
import zodToJsonSchema from 'zod-to-json-schema';
|
|
4
5
|
|
|
5
|
-
import { HTTPException } from 'hono/http-exception';
|
|
6
|
-
|
|
7
6
|
import { handleError } from './error';
|
|
8
7
|
|
|
9
8
|
// Tool handlers
|
|
@@ -66,6 +65,10 @@ export function executeToolHandler(tools: Record<string, any>) {
|
|
|
66
65
|
return c.json({ error: 'Tool not found' }, 404);
|
|
67
66
|
}
|
|
68
67
|
|
|
68
|
+
if (!tool?.execute) {
|
|
69
|
+
return c.json({ error: 'Tool is not executable' }, 400);
|
|
70
|
+
}
|
|
71
|
+
|
|
69
72
|
const { data } = await c.req.json();
|
|
70
73
|
const mastra = c.get('mastra');
|
|
71
74
|
const result = await tool.execute({
|
|
@@ -93,6 +96,10 @@ export async function executeAgentToolHandler(c: Context) {
|
|
|
93
96
|
throw new HTTPException(404, { message: 'Tool not found' });
|
|
94
97
|
}
|
|
95
98
|
|
|
99
|
+
if (!tool?.execute) {
|
|
100
|
+
return c.json({ error: 'Tool is not executable' }, 400);
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
const { data } = await c.req.json();
|
|
97
104
|
const result = await tool.execute({
|
|
98
105
|
context: data,
|
package/src/server/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
1
4
|
import { serve } from '@hono/node-server';
|
|
2
5
|
import { serveStatic } from '@hono/node-server/serve-static';
|
|
3
6
|
import { swaggerUI } from '@hono/swagger-ui';
|
|
4
7
|
import type { Mastra } from '@mastra/core';
|
|
5
8
|
import { Hono } from 'hono';
|
|
6
9
|
import type { Context } from 'hono';
|
|
7
|
-
import { describeRoute, openAPISpecs } from 'hono-openapi';
|
|
8
|
-
import { join } from 'path';
|
|
9
|
-
import { pathToFileURL } from 'url';
|
|
10
10
|
|
|
11
|
-
import { readFile } from 'fs/promises';
|
|
12
11
|
import { bodyLimit } from 'hono/body-limit';
|
|
13
12
|
import { cors } from 'hono/cors';
|
|
14
13
|
import { logger } from 'hono/logger';
|
|
14
|
+
import { describeRoute, openAPISpecs } from 'hono-openapi';
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
17
|
generateHandler,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Deps, writeTelemetryConfig } from './chunk-AXS5WSIK.js';
|
|
2
2
|
import { analyzeBundle } from './chunk-SESHBX76.js';
|
|
3
3
|
import { createBundler, getInputOptions } from './chunk-KXS4XYEJ.js';
|
|
4
|
-
import { MastraBundler } from '@mastra/core/bundler';
|
|
5
|
-
import virtual from '@rollup/plugin-virtual';
|
|
6
|
-
import { ensureDir, copy } from 'fs-extra';
|
|
7
4
|
import { existsSync } from 'node:fs';
|
|
8
5
|
import { writeFile } from 'node:fs/promises';
|
|
9
6
|
import { join, dirname } from 'node:path';
|
|
10
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { MastraBundler } from '@mastra/core/bundler';
|
|
9
|
+
import virtual from '@rollup/plugin-virtual';
|
|
10
|
+
import { ensureDir, copy } from 'fs-extra';
|
|
11
11
|
import fsExtra from 'fs-extra/esm';
|
|
12
12
|
|
|
13
13
|
var Bundler = class extends MastraBundler {
|