@mastra/deployer 0.0.0-commonjs-20250227130920

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 (86) hide show
  1. package/.turbo/turbo-build.log +41 -0
  2. package/CHANGELOG.md +897 -0
  3. package/LICENSE +44 -0
  4. package/README.md +159 -0
  5. package/dist/_tsup-dts-rollup.d.cts +360 -0
  6. package/dist/_tsup-dts-rollup.d.ts +360 -0
  7. package/dist/build/analyze.cjs +367 -0
  8. package/dist/build/analyze.d.cts +1 -0
  9. package/dist/build/analyze.d.ts +1 -0
  10. package/dist/build/analyze.js +2 -0
  11. package/dist/build/bundler.cjs +353 -0
  12. package/dist/build/bundler.d.cts +2 -0
  13. package/dist/build/bundler.d.ts +2 -0
  14. package/dist/build/bundler.js +2 -0
  15. package/dist/build/index.cjs +1146 -0
  16. package/dist/build/index.d.cts +10 -0
  17. package/dist/build/index.d.ts +10 -0
  18. package/dist/build/index.js +5 -0
  19. package/dist/bundler/index.cjs +999 -0
  20. package/dist/bundler/index.d.cts +1 -0
  21. package/dist/bundler/index.d.ts +1 -0
  22. package/dist/bundler/index.js +5 -0
  23. package/dist/chunk-3ONBKVC4.js +113 -0
  24. package/dist/chunk-AXS5WSIK.js +290 -0
  25. package/dist/chunk-DTSFVNIF.js +260 -0
  26. package/dist/chunk-JMH7HCD6.js +274 -0
  27. package/dist/chunk-SGK37ZWD.js +254 -0
  28. package/dist/chunk-YNXJO2XU.js +69 -0
  29. package/dist/index.cjs +1229 -0
  30. package/dist/index.d.cts +6 -0
  31. package/dist/index.d.ts +6 -0
  32. package/dist/index.js +131 -0
  33. package/dist/server/index.cjs +4930 -0
  34. package/dist/server/index.d.cts +2 -0
  35. package/dist/server/index.d.ts +2 -0
  36. package/dist/server/index.js +4923 -0
  37. package/dist/templates/instrumentation-template.js +86 -0
  38. package/eslint.config.js +6 -0
  39. package/global.d.ts +0 -0
  40. package/package.json +112 -0
  41. package/public/templates/instrumentation-template.js +86 -0
  42. package/src/build/analyze.ts +279 -0
  43. package/src/build/babel/fix-libsql.ts +41 -0
  44. package/src/build/babel/get-deployer.ts +54 -0
  45. package/src/build/babel/get-telemetry-config.ts +62 -0
  46. package/src/build/babel/remove-deployer.ts +43 -0
  47. package/src/build/bundle.ts +139 -0
  48. package/src/build/bundler.ts +135 -0
  49. package/src/build/deployer.ts +67 -0
  50. package/src/build/deps.ts +149 -0
  51. package/src/build/env.ts +76 -0
  52. package/src/build/fs.ts +66 -0
  53. package/src/build/index.ts +7 -0
  54. package/src/build/isNodeBuiltin.ts +7 -0
  55. package/src/build/plugins/fix-libsql.ts +69 -0
  56. package/src/build/plugins/hono-alias.ts +17 -0
  57. package/src/build/plugins/pino.ts +93 -0
  58. package/src/build/plugins/remove-deployer.ts +37 -0
  59. package/src/build/plugins/telemetry-fix.ts +54 -0
  60. package/src/build/telemetry.ts +76 -0
  61. package/src/build/utils.ts +12 -0
  62. package/src/build/watcher.ts +43 -0
  63. package/src/bundler/index.ts +144 -0
  64. package/src/deploy/base.ts +30 -0
  65. package/src/deploy/index.ts +2 -0
  66. package/src/deploy/log.ts +61 -0
  67. package/src/index.ts +3 -0
  68. package/src/server/handlers/agents.ts +209 -0
  69. package/src/server/handlers/client.ts +36 -0
  70. package/src/server/handlers/error.ts +29 -0
  71. package/src/server/handlers/logs.ts +53 -0
  72. package/src/server/handlers/memory.ts +196 -0
  73. package/src/server/handlers/prompt.ts +128 -0
  74. package/src/server/handlers/root.ts +6 -0
  75. package/src/server/handlers/telemetry.ts +48 -0
  76. package/src/server/handlers/tools.ts +114 -0
  77. package/src/server/handlers/utils.ts +15 -0
  78. package/src/server/handlers/vector.ts +149 -0
  79. package/src/server/handlers/workflows.ts +119 -0
  80. package/src/server/index.ts +1355 -0
  81. package/src/server/openapi.json +434 -0
  82. package/src/server/openapi.script.js +22 -0
  83. package/src/server/types.ts +4 -0
  84. package/src/server/welcome.ts +105 -0
  85. package/tsconfig.json +5 -0
  86. package/vitest.config.ts +8 -0
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ Elastic License 2.0 (ELv2)
2
+
3
+ **Acceptance**
4
+ By using the software, you agree to all of the terms and conditions below.
5
+
6
+ **Copyright License**
7
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
8
+
9
+ **Limitations**
10
+ You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
11
+
12
+ You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
13
+
14
+ You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
15
+
16
+ **Patents**
17
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
18
+
19
+ **Notices**
20
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
21
+
22
+ If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
23
+
24
+ **No Other Rights**
25
+ These terms do not imply any licenses other than those expressly granted in these terms.
26
+
27
+ **Termination**
28
+ If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
29
+
30
+ **No Liability**
31
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
32
+
33
+ **Definitions**
34
+ The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
35
+
36
+ _you_ refers to the individual or entity agreeing to these terms.
37
+
38
+ _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
39
+
40
+ _your licenses_ are all the licenses granted to you for the software under these terms.
41
+
42
+ _use_ means anything you do with the software requiring one of your licenses.
43
+
44
+ _trademark_ means trademarks, service marks, and similar rights.
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # @mastra/deployer
2
+
3
+ Core deployment infrastructure for Mastra applications, handling build, packaging, and deployment processes.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/deployer
9
+ ```
10
+
11
+ ## Overview
12
+
13
+ The `@mastra/deployer` package provides the foundational deployment infrastructure for Mastra applications. It handles:
14
+
15
+ - Project building and bundling
16
+ - Dependency management
17
+ - Environment configuration
18
+ - Development and production deployments
19
+
20
+ ## Usage
21
+
22
+ ```typescript
23
+ import { Deployer } from '@mastra/deployer';
24
+
25
+ // Create a deployer instance
26
+ const deployer = new Deployer({
27
+ dir: '/path/to/project',
28
+ type: 'Deploy', // or 'Dev' for development mode
29
+ });
30
+
31
+ // Install dependencies
32
+ await deployer.install();
33
+
34
+ // Write package.json
35
+ await deployer.writePackageJson();
36
+
37
+ // Get Mastra instance
38
+ const { mastra } = await deployer.getMastra();
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ ### Required Parameters
44
+
45
+ - `dir`: Project directory path
46
+ - `type`: Deployment type ('Deploy' or 'Dev')
47
+
48
+ ## Features
49
+
50
+ ### Project Structure Management
51
+
52
+ - Creates and manages `.mastra` directory
53
+ - Handles package.json generation and updates
54
+ - Manages project dependencies
55
+
56
+ ### Dependency Management
57
+
58
+ - Automatic dependency installation
59
+ - Workspace dependency resolution
60
+ - Version management for @mastra packages
61
+
62
+ ### Environment Handling
63
+
64
+ - Support for multiple environment files:
65
+ - `.env`
66
+ - `.env.development`
67
+ - `.env.local`
68
+ - Environment variable validation and processing
69
+
70
+ ### Build Process
71
+
72
+ - Project bundling
73
+ - Asset management
74
+ - Source code transformation
75
+
76
+ ### Development Support
77
+
78
+ - Development server configuration
79
+ - Hot reloading capabilities
80
+ - Debug logging
81
+
82
+ ## Project Structure
83
+
84
+ The deployer creates and manages the following structure:
85
+
86
+ ```
87
+ your-project/
88
+ ├── .mastra/
89
+ │ ├── package.json
90
+ │ ├── mastra.mjs
91
+ │ └── index.mjs
92
+ ├── .env
93
+ ├── .env.development
94
+ ├── .env.local
95
+ └── package.json
96
+ ```
97
+
98
+ ## Package.json Management
99
+
100
+ The deployer automatically manages dependencies in the `.mastra/package.json`:
101
+
102
+ ```json
103
+ {
104
+ "name": "server",
105
+ "version": "1.0.0",
106
+ "type": "module",
107
+ "dependencies": {
108
+ "@mastra/loggers": "latest",
109
+ "hono": "4.6.17",
110
+ "@hono/node-server": "^1.13.7",
111
+ "superjson": "^2.2.2",
112
+ "zod-to-json-schema": "^3.24.1"
113
+ }
114
+ }
115
+ ```
116
+
117
+ ## Methods
118
+
119
+ ### `install()`
120
+
121
+ Installs and updates project dependencies.
122
+
123
+ ### `writePackageJson()`
124
+
125
+ Generates or updates the package.json in the .mastra directory.
126
+
127
+ ### `getMastra()`
128
+
129
+ Returns the Mastra instance for the project.
130
+
131
+ ### `getMastraPath()`
132
+
133
+ Returns the path to the .mastra directory.
134
+
135
+ ## Error Handling
136
+
137
+ The deployer includes comprehensive error handling for:
138
+
139
+ - Dependency installation failures
140
+ - File system operations
141
+ - Environment configuration issues
142
+ - Build process errors
143
+
144
+ ## Logging
145
+
146
+ Built-in logging support through @mastra/core:
147
+
148
+ - Debug information
149
+ - Installation progress
150
+ - Build status
151
+ - Error reporting
152
+
153
+ ## Related Packages
154
+
155
+ - `@mastra/core`: Core Mastra functionality
156
+ - `@mastra/loggers`: Logging infrastructure
157
+ - Deployer implementations:
158
+ - `@mastra/deployer-cloudflare`
159
+ - Other platform-specific deployers
@@ -0,0 +1,360 @@
1
+ import { default as babel_2 } from '@babel/core';
2
+ import { BlankSchema } from 'hono/types';
3
+ import { ContentfulStatusCode } from 'hono/utils/http-status';
4
+ import type { Context } from 'hono';
5
+ import { Hono } from 'hono';
6
+ import type { IDeployer } from '@mastra/core/deployer';
7
+ import { InputOption } from 'rollup';
8
+ import { InputOptions } from 'rollup';
9
+ import type { Logger } from '@mastra/core/logger';
10
+ import type { Logger as Logger_2 } from '@mastra/core';
11
+ import type { Mastra } from '@mastra/core';
12
+ import { MastraBase } from '@mastra/core/base';
13
+ import { MastraBundler } from '@mastra/core/bundler';
14
+ import type { MastraDeployer } from '@mastra/core';
15
+ import type { MastraVector } from '@mastra/core/vector';
16
+ import { OutputOptions } from 'rollup';
17
+ import { Plugin } from 'rollup';
18
+ import { PluginContext } from 'rollup';
19
+ import { RenderedChunk } from 'rollup';
20
+ import { RollupBuild } from 'rollup';
21
+ import { RollupOutput } from 'rollup';
22
+ import { RollupWatcher } from 'rollup';
23
+ import { ServerType } from '@hono/node-server';
24
+ import { Transform } from 'stream';
25
+ import { TypedResponse } from 'hono';
26
+
27
+ export declare function aliasHono(): Plugin;
28
+
29
+ /**
30
+ * Main bundle analysis function that orchestrates the three-step process:
31
+ * 1. Analyze dependencies
32
+ * 2. Bundle dependencies modules
33
+ * 3. Validate generated bundles
34
+ *
35
+ * This helps identify which dependencies need to be externalized vs bundled.
36
+ */
37
+ declare function analyzeBundle(entry: string, mastraEntry: string, outputDir: string, platform: 'node' | 'browser', logger: Logger_2): Promise<{
38
+ invalidChunks: Set<string>;
39
+ dependencies: Map<string, string>;
40
+ externalDependencies: Set<string>;
41
+ }>;
42
+ export { analyzeBundle }
43
+ export { analyzeBundle as analyzeBundle_alias_1 }
44
+
45
+ export declare interface ApiError extends Error {
46
+ message: string;
47
+ status?: number;
48
+ }
49
+
50
+ declare type Bindings = {};
51
+
52
+ export declare abstract class Bundler extends MastraBundler {
53
+ protected analyzeOutputDir: string;
54
+ protected outputDir: string;
55
+ constructor(name: string, component?: 'BUNDLER' | 'DEPLOYER');
56
+ prepare(outputDirectory: string): Promise<void>;
57
+ writeInstrumentationFile(outputDirectory: string): Promise<void>;
58
+ writePackageJson(outputDirectory: string, dependencies: Map<string, string>): Promise<void>;
59
+ protected createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
60
+ dir: string;
61
+ }): Promise<{
62
+ write: () => Promise<RollupOutput>;
63
+ close: () => Promise<void>;
64
+ }>;
65
+ protected analyze(entry: string, mastraFile: string, outputDirectory: string): Promise<{
66
+ invalidChunks: Set<string>;
67
+ dependencies: Map<string, string>;
68
+ externalDependencies: Set<string>;
69
+ }>;
70
+ protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
71
+ protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, bundleLocation?: string): Promise<void>;
72
+ }
73
+
74
+ declare function createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
75
+ dir: string;
76
+ }): Promise<{
77
+ write: () => Promise<RollupOutput>;
78
+ close: () => Promise<void>;
79
+ }>;
80
+ export { createBundler }
81
+ export { createBundler as createBundler_alias_1 }
82
+
83
+ declare function createChildProcessLogger({ logger, root }: {
84
+ logger: Logger;
85
+ root: string;
86
+ }): ({ cmd, args, env }: {
87
+ cmd: string;
88
+ args: string[];
89
+ env: Record<string, string>;
90
+ }) => Promise<unknown>;
91
+ export { createChildProcessLogger }
92
+ export { createChildProcessLogger as createChildProcessLogger_alias_1 }
93
+ export { createChildProcessLogger as createChildProcessLogger_alias_2 }
94
+
95
+ export declare function createHonoServer(mastra: Mastra, options?: {
96
+ playground?: boolean;
97
+ swaggerUI?: boolean;
98
+ apiReqLogs?: boolean;
99
+ }): Promise<Hono<{
100
+ Bindings: Bindings;
101
+ Variables: Variables;
102
+ }, BlankSchema, "/">>;
103
+
104
+ export declare function createIndex(c: Context): Promise<Response>;
105
+
106
+ export declare function createNodeServer(mastra: Mastra, options?: {
107
+ playground?: boolean;
108
+ swaggerUI?: boolean;
109
+ apiReqLogs?: boolean;
110
+ }): Promise<ServerType>;
111
+
112
+ declare const createPinoStream: (logger: Logger) => Transform;
113
+ export { createPinoStream }
114
+ export { createPinoStream as createPinoStream_alias_1 }
115
+ export { createPinoStream as createPinoStream_alias_2 }
116
+
117
+ export declare function createThreadHandler(c: Context): Promise<Response>;
118
+
119
+ declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
120
+ export { createWatcher }
121
+ export { createWatcher as createWatcher_alias_1 }
122
+
123
+ export declare function deleteIndex(c: Context): Promise<Response>;
124
+
125
+ export declare function deleteThreadHandler(c: Context): Promise<Response>;
126
+
127
+ declare abstract class Deployer extends Bundler implements IDeployer {
128
+ deps: Deps;
129
+ constructor(args: {
130
+ name: string;
131
+ });
132
+ getEnvFiles(): Promise<string[]>;
133
+ abstract deploy(outputDirectory: string): Promise<void>;
134
+ }
135
+ export { Deployer }
136
+ export { Deployer as Deployer_alias_1 }
137
+ export { Deployer as Deployer_alias_2 }
138
+
139
+ declare class Deps extends MastraBase {
140
+ private packageManager;
141
+ private rootDir;
142
+ constructor(rootDir?: string);
143
+ private findLockFile;
144
+ private getPackageManager;
145
+ install({ dir, packages }: {
146
+ dir?: string;
147
+ packages?: string[];
148
+ }): Promise<unknown>;
149
+ installPackages(packages: string[]): Promise<unknown>;
150
+ checkDependencies(dependencies: string[]): Promise<string>;
151
+ getProjectName(): Promise<any>;
152
+ getPackageVersion(): Promise<string | undefined>;
153
+ addScriptsToPackageJson(scripts: Record<string, string>): Promise<void>;
154
+ }
155
+ export { Deps }
156
+ export { Deps as Deps_alias_1 }
157
+ export { Deps as Deps_alias_2 }
158
+
159
+ export declare function describeIndex(c: Context): Promise<Response>;
160
+
161
+ export declare abstract class EnvService {
162
+ abstract getEnvValue(key: string): Promise<string | null>;
163
+ abstract setEnvValue(key: string, value: string): Promise<void>;
164
+ }
165
+
166
+ export declare function errorHandler(err: Error, c: Context): Response;
167
+
168
+ export declare function executeAgentToolHandler(c: Context): Promise<Response>;
169
+
170
+ export declare function executeToolHandler(tools: Record<string, any>): (c: Context) => Promise<Response>;
171
+
172
+ export declare function executeWorkflowHandler(c: Context): Promise<Response>;
173
+
174
+ export declare class FileEnvService extends EnvService {
175
+ private filePath;
176
+ constructor(filePath: string);
177
+ private readFile;
178
+ private writeFile;
179
+ private updateEnvData;
180
+ getEnvValue(key: string): Promise<string | null>;
181
+ setEnvValue(key: string, value: string): Promise<void>;
182
+ }
183
+
184
+ declare class FileService {
185
+ /**
186
+ *
187
+ * @param inputFile the file in the starter files directory to copy
188
+ * @param outputFilePath the destination path
189
+ * @param replaceIfExists flag to replace if it exists
190
+ * @returns
191
+ */
192
+ copyStarterFile(inputFile: string, outputFilePath: string, replaceIfExists?: boolean): Promise<boolean>;
193
+ setupEnvFile({ dbUrl }: {
194
+ dbUrl: string;
195
+ }): Promise<void>;
196
+ getFirstExistingFile(files: string[]): string;
197
+ replaceValuesInFile({ filePath, replacements, }: {
198
+ filePath: string;
199
+ replacements: {
200
+ search: string;
201
+ replace: string;
202
+ }[];
203
+ }): void;
204
+ }
205
+ export { FileService }
206
+ export { FileService as FileService_alias_1 }
207
+ export { FileService as FileService_alias_2 }
208
+
209
+ export declare function generateHandler(c: Context): Promise<Response>;
210
+
211
+ export declare function generateSystemPromptHandler(c: Context): Promise<Response>;
212
+
213
+ export declare function getAgentByIdHandler(c: Context): Promise<Response>;
214
+
215
+ export declare function getAgentsHandler(c: Context): Promise<Response>;
216
+
217
+ declare function getBundler(inputOptions: NormalizedInputOptions, args?: {
218
+ platform?: 'node' | 'browser';
219
+ dir?: string;
220
+ }): Promise<RollupBuild>;
221
+ export { getBundler }
222
+ export { getBundler as getBundler_alias_1 }
223
+
224
+ declare function getDeployer(entryFile: string, outputDir: string): Promise<MastraDeployer>;
225
+ export { getDeployer }
226
+ export { getDeployer as getDeployer_alias_1 }
227
+
228
+ export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response>;
229
+
230
+ declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser'): Promise<InputOptions>;
231
+ export { getInputOptions as getBundlerInputOptions }
232
+ export { getInputOptions }
233
+
234
+ declare function getInputOptions_2(entryFile: string, platform: 'node' | 'browser'): Promise<InputOptions>;
235
+ export { getInputOptions_2 as getInputOptions_alias_1 }
236
+ export { getInputOptions_2 as getWatcherInputOptions }
237
+
238
+ export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Response>;
239
+
240
+ export declare function getLogsByRunIdHandler(c: Context): Promise<Response>;
241
+
242
+ export declare function getLogsHandler(c: Context): Promise<Response>;
243
+
244
+ export declare function getLogTransports(c: Context): Promise<Response>;
245
+
246
+ export declare function getMemoryStatusHandler(c: Context): Promise<Response>;
247
+
248
+ export declare function getMessagesHandler(c: Context): Promise<Response>;
249
+
250
+ export declare function getTelemetryHandler(c: Context): Promise<Response>;
251
+
252
+ export declare function getThreadByIdHandler(c: Context): Promise<Response>;
253
+
254
+ export declare function getThreadsHandler(c: Context): Promise<Response>;
255
+
256
+ export declare function getToolByIdHandler(c: Context): Promise<Response>;
257
+
258
+ export declare function getToolsHandler(c: Context): Promise<Response>;
259
+
260
+ export declare const getVector: (c: Context, vectorName: string) => MastraVector;
261
+
262
+ declare function getWatcher(inputOptions: NormalizedInputOptions, args?: {
263
+ platform?: 'node' | 'browser';
264
+ dir?: string;
265
+ }): Promise<RollupWatcher>;
266
+ export { getWatcher }
267
+ export { getWatcher as getWatcher_alias_1 }
268
+
269
+ export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
270
+
271
+ export declare function getWorkflowsHandler(c: Context): Promise<Response>;
272
+
273
+ export declare function handleClientsRefresh(c: Context): Response;
274
+
275
+ export declare function handleError(error: unknown, defaultMessage: string): Promise<Response>;
276
+
277
+ export declare function handleTriggerClientsRefresh(c: Context): Response & TypedResponse< {
278
+ success: true;
279
+ clients: number;
280
+ }, ContentfulStatusCode, "json">;
281
+
282
+ export declare const html = "\n<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Welcome to Mastra</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/inter-ui/3.19.3/inter.min.css\" />\n <style>\n body {\n margin: 0;\n padding: 0;\n background-color: #0d0d0d;\n color: #ffffff;\n font-family:\n 'Inter',\n -apple-system,\n BlinkMacSystemFont,\n system-ui,\n sans-serif;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n }\n\n main {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 2rem;\n text-align: center;\n }\n\n h1 {\n font-size: 4rem;\n font-weight: 600;\n margin: 0 0 1rem 0;\n background: linear-gradient(to right, #fff, #ccc);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n line-height: 1.2;\n }\n\n .subtitle {\n color: #9ca3af;\n font-size: 1.25rem;\n max-width: 600px;\n margin: 0 auto 3rem auto;\n line-height: 1.6;\n }\n\n .docs-link {\n background-color: #1a1a1a;\n padding: 1rem 2rem;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n gap: 1rem;\n font-family: monospace;\n font-size: 1rem;\n color: #ffffff;\n text-decoration: none;\n transition: background-color 0.2s;\n }\n\n .docs-link:hover {\n background-color: #252525;\n }\n\n .arrow-icon {\n transition: transform 0.2s;\n }\n\n .docs-link:hover .arrow-icon {\n transform: translateX(4px);\n }\n </style>\n </head>\n <body>\n <main>\n <h1>Welcome to Mastra</h1>\n <p class=\"subtitle\">\n From the team that brought you Gatsby: prototype and productionize AI features with a modern JS/TS stack.\n </p>\n\n <a href=\"https://mastra.ai/docs\" class=\"docs-link\">\n Browse the docs\n <svg\n class=\"arrow-icon\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M5 12h14M12 5l7 7-7 7\" />\n </svg>\n </a>\n </main>\n </body>\n</html>\n";
283
+
284
+ export declare function isNodeBuiltin(dep: string): boolean;
285
+
286
+ export declare function libSqlFix(): Plugin;
287
+
288
+ export declare function listIndexes(c: Context): Promise<Response>;
289
+
290
+ declare type NormalizedInputOptions = Omit<Partial<InputOptions>, 'plugins' | 'input' | 'external'> & {
291
+ plugins?: Plugin[];
292
+ input: InputOption;
293
+ external?: (string | RegExp)[];
294
+ };
295
+
296
+ export declare function notFoundHandler(): void;
297
+
298
+ export declare function pino(): {
299
+ name: string;
300
+ resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<void>;
301
+ renderChunk(this: PluginContext, code: string, chunk: RenderedChunk): {
302
+ code: string;
303
+ map: null;
304
+ } | undefined;
305
+ };
306
+
307
+ export declare function queryVectors(c: Context): Promise<Response>;
308
+
309
+ export declare function removeAllExceptDeployer(): babel_2.PluginObj;
310
+
311
+ export declare function removeAllExceptTelemetryConfig(result: {
312
+ hasCustomConfig: boolean;
313
+ }): babel_2.PluginObj;
314
+
315
+ export declare function removeDeployer(): babel_2.PluginObj;
316
+
317
+ export declare function removeDeployer_alias_1(mastraEntry: string): Plugin;
318
+
319
+ export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
320
+
321
+ export declare function rewriteLibsqlImport(): babel_2.PluginObj;
322
+
323
+ export declare function rootHandler(c: Context): Promise<Response & TypedResponse<"Hello to the Mastra API!", ContentfulStatusCode, "text">>;
324
+
325
+ export declare function saveMessagesHandler(c: Context): Promise<Response>;
326
+
327
+ export declare function setAgentInstructionsHandler(c: Context): Promise<Response>;
328
+
329
+ export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
330
+
331
+ export declare function telemetryFix(): Plugin;
332
+
333
+ export declare function updateThreadHandler(c: Context): Promise<Response>;
334
+
335
+ export declare function upsertMastraDir({ dir }: {
336
+ dir?: string;
337
+ }): void;
338
+
339
+ export declare function upsertVectors(c: Context): Promise<Response>;
340
+
341
+ export declare function validateBody(body: Record<string, unknown>): void;
342
+
343
+ declare type Variables = {
344
+ mastra: Mastra;
345
+ clients: Set<{
346
+ controller: ReadableStreamDefaultController;
347
+ }>;
348
+ tools: Record<string, any>;
349
+ playground: boolean;
350
+ };
351
+
352
+ export declare function watchWorkflowHandler(c: Context): Promise<Response>;
353
+
354
+ declare function writeTelemetryConfig(entryFile: string, outputDir: string): Promise<{
355
+ hasCustomConfig: boolean;
356
+ }>;
357
+ export { writeTelemetryConfig }
358
+ export { writeTelemetryConfig as writeTelemetryConfig_alias_1 }
359
+
360
+ export { }