@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.
@@ -1,29 +1,29 @@
1
1
 
2
- > @mastra/deployer@0.1.5-alpha.2 build /home/runner/work/mastra/mastra/packages/deployer
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
  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 18431ms
9
+ TSC ⚡️ Build success in 17510ms
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 7935ms
14
+ DTS ⚡️ Build success in 8595ms
15
15
  CLI Cleaning output folder
16
16
  ESM Build start
17
- ESM dist/index.js 3.70 KB
18
17
  ESM dist/build/analyze.js 85.00 B
19
- ESM dist/build/bundler.js 102.00 B
18
+ ESM dist/index.js 3.70 KB
20
19
  ESM dist/build/index.js 383.00 B
21
20
  ESM dist/chunk-BTUQ6UBB.js 7.41 KB
21
+ ESM dist/build/bundler.js 102.00 B
22
22
  ESM dist/bundler/index.js 172.00 B
23
- ESM dist/chunk-IHPQAB7O.js 4.40 KB
24
- ESM dist/chunk-KXS4XYEJ.js 7.20 KB
23
+ ESM dist/chunk-VANRMAOD.js 4.40 KB
24
+ ESM dist/chunk-AXS5WSIK.js 8.23 KB
25
25
  ESM dist/chunk-SESHBX76.js 8.25 KB
26
26
  ESM dist/chunk-YNXJO2XU.js 2.08 KB
27
- ESM dist/chunk-AXS5WSIK.js 8.23 KB
28
- ESM dist/server/index.js 148.19 KB
29
- ESM ⚡️ Build success in 2619ms
27
+ ESM dist/server/index.js 148.30 KB
28
+ ESM dist/chunk-KXS4XYEJ.js 7.20 KB
29
+ ESM ⚡️ 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
@@ -1,4 +1,4 @@
1
- export { Bundler } from '../chunk-IHPQAB7O.js';
1
+ export { Bundler } from '../chunk-VANRMAOD.js';
2
2
  import '../chunk-AXS5WSIK.js';
3
3
  import '../chunk-SESHBX76.js';
4
4
  import '../chunk-KXS4XYEJ.js';
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-IHPQAB7O.js';
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';
@@ -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
- // ../../node_modules/.pnpm/@hono+node-server@1.13.8_hono@4.7.2/node_modules/@hono/node-server/dist/index.mjs
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 { MastraStorageLibSql } from '@mastra/core/storage'
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 MastraStorageLibSql({
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-alpha.2",
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-alpha.1"
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 { MastraStorageLibSql } from '@mastra/core/storage'
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 MastraStorageLibSql({
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",
@@ -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 type { InputOptions, OutputOptions } from 'rollup';
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,6 +1,6 @@
1
- import type { Logger } from '@mastra/core/logger';
2
1
  import { spawn } from 'child_process';
3
2
  import { Transform } from 'stream';
3
+ import type { Logger } from '@mastra/core/logger';
4
4
 
5
5
  export const createPinoStream = (logger: Logger) => {
6
6
  return new Transform({
@@ -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,
@@ -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 {