@mastra/tanstack-start 0.2.22-alpha.6 → 0.2.22-alpha.7

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.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +6 -6
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @mastra/tanstack-start
2
+
3
+ `@mastra/tanstack-start` exposes a Mastra instance through TanStack Start server route handlers. Use it to serve Mastra's REST, streaming, custom API, MCP, and A2A endpoints from the same TanStack Start application.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/tanstack-start
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Create a catch-all server route at `src/routes/api/$.ts`:
14
+
15
+ ```typescript title="src/routes/api/$.ts"
16
+ import { createFileRoute } from '@tanstack/react-router';
17
+ import { createStartRouteHandler } from '@mastra/tanstack-start';
18
+ import { mastra } from '../../mastra';
19
+
20
+ export const Route = createFileRoute('/api/$')({
21
+ server: {
22
+ handlers: createStartRouteHandler({ mastra }),
23
+ },
24
+ });
25
+ ```
26
+
27
+ The route prefix and splat location must match. For a route mounted below `/api/mastra`, pass the same prefix:
28
+
29
+ ```typescript
30
+ createStartRouteHandler({
31
+ mastra,
32
+ prefix: '/api/mastra',
33
+ tools: { customTool },
34
+ });
35
+ ```
36
+
37
+ ## Documentation
38
+
39
+ `createStartRouteHandler()` returns GET, POST, PUT, DELETE, PATCH, OPTIONS, and HEAD handlers compatible with TanStack Start's server route API. It lazily initializes the underlying Hono adapter on the first request and forwards the standard Web `Request` to the Mastra server.
40
+
41
+ The adapter reads custom API routes, per-route authentication, MCP settings, and `bodySizeLimit` from the Mastra server configuration. Request bodies default to a 4.5 MB limit when no application-specific value is configured.
42
+
43
+ Use `tools` to register additional server tools. The `prefix` defaults to `/api` and must match the path before the `$` splat route. Authentication and each custom route's `requiresAuth` value are passed to the common Mastra server adapter.
44
+
45
+ A2A operations use an in-memory task store. Keep the target TanStack Start deployment's process lifecycle in mind when relying on task state across separate requests or replicas.
46
+
47
+ ## Changelog
48
+
49
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/server-adapters/tanstack-start/CHANGELOG.md) for version history and release notes.
50
+
51
+ ## Support
52
+
53
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/tanstack-start",
3
- "version": "0.2.22-alpha.6",
3
+ "version": "0.2.22-alpha.7",
4
4
  "description": "Mastra TanStack Start server adapter — drop your Mastra instance into a TanStack Start app",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@mastra/server": "1.64.0-alpha.6",
24
- "@mastra/hono": "1.7.6-alpha.6"
23
+ "@mastra/server": "1.64.0-alpha.7",
24
+ "@mastra/hono": "1.7.6-alpha.7"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "22.20.1",
@@ -30,9 +30,9 @@
30
30
  "tsdown": "0.22.9",
31
31
  "typescript": "^7.0.2",
32
32
  "vitest": "4.1.10",
33
- "@internal/lint": "0.0.129",
34
- "@mastra/core": "1.64.0-alpha.6",
35
- "@internal/types-builder": "0.0.104"
33
+ "@internal/types-builder": "0.0.104",
34
+ "@mastra/core": "1.64.0-alpha.7",
35
+ "@internal/lint": "0.0.129"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@mastra/core": ">=1.50.0-0 <2.0.0-0",