@mastra/deployer 0.10.13 → 0.10.15-alpha.0

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 (56) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +844 -0
  2. package/dist/_tsup-dts-rollup.d.ts +844 -0
  3. package/dist/build/analyze.cjs +10 -0
  4. package/dist/build/analyze.d.cts +1 -0
  5. package/dist/build/analyze.d.ts +1 -0
  6. package/dist/build/analyze.js +1 -0
  7. package/dist/build/bundler.cjs +14 -0
  8. package/dist/build/bundler.d.cts +2 -0
  9. package/dist/build/bundler.d.ts +2 -0
  10. package/dist/build/bundler.js +1 -0
  11. package/dist/build/index.cjs +50 -0
  12. package/dist/build/index.d.cts +10 -0
  13. package/dist/build/index.d.ts +10 -0
  14. package/dist/build/index.js +5 -0
  15. package/dist/bundler/index.cjs +10 -0
  16. package/dist/bundler/index.d.cts +1 -0
  17. package/dist/bundler/index.d.ts +1 -0
  18. package/dist/bundler/index.js +1 -0
  19. package/dist/chunk-54KOF3NB.cjs +137 -0
  20. package/dist/chunk-6QMONK4A.cjs +2 -0
  21. package/dist/chunk-C4JT7CIH.js +1 -0
  22. package/dist/chunk-D2DCFCLH.cjs +157 -0
  23. package/dist/chunk-D6736SJL.js +209 -0
  24. package/dist/chunk-ENT5RDOI.js +99 -0
  25. package/dist/chunk-FK2WUSEN.cjs +238 -0
  26. package/dist/chunk-GPD54HBC.js +380 -0
  27. package/dist/chunk-HJGC75ZR.js +490 -0
  28. package/dist/chunk-KCP5ITLV.cjs +412 -0
  29. package/dist/chunk-M2VZQFTW.cjs +125 -0
  30. package/dist/chunk-TIC2KT3M.js +146 -0
  31. package/dist/chunk-UYQZMNZL.js +572 -0
  32. package/dist/chunk-XKH6F4NE.cjs +604 -0
  33. package/dist/chunk-YFMAWUII.cjs +502 -0
  34. package/dist/chunk-Z544XXXK.js +111 -0
  35. package/dist/index.cjs +194 -0
  36. package/dist/index.d.cts +8 -0
  37. package/dist/index.d.ts +8 -0
  38. package/dist/index.js +153 -0
  39. package/dist/server/index.cjs +8446 -0
  40. package/dist/server/index.d.cts +2 -0
  41. package/dist/server/index.d.ts +2 -0
  42. package/dist/server/index.js +8438 -0
  43. package/dist/services/index.cjs +18 -0
  44. package/dist/services/index.d.cts +3 -0
  45. package/dist/services/index.d.ts +3 -0
  46. package/dist/services/index.js +1 -0
  47. package/dist/templates/instrumentation-template.js +137 -0
  48. package/dist/validator/custom-resolver.cjs +52 -0
  49. package/dist/validator/custom-resolver.d.cts +1 -0
  50. package/dist/validator/custom-resolver.d.ts +1 -0
  51. package/dist/validator/custom-resolver.js +50 -0
  52. package/dist/validator/loader.cjs +7 -0
  53. package/dist/validator/loader.d.cts +1 -0
  54. package/dist/validator/loader.d.ts +1 -0
  55. package/dist/validator/loader.js +4 -0
  56. package/package.json +5 -5
@@ -0,0 +1,844 @@
1
+ import { default as babel_2 } from '@babel/core';
2
+ import { BlankSchema } from 'hono/types';
3
+ import type { Config } from '@mastra/core';
4
+ import { ContentfulStatusCode } from 'hono/utils/http-status';
5
+ import type { Context } from 'hono';
6
+ import type { ContextWithMastra } from '@mastra/core/server';
7
+ import { Hono } from 'hono';
8
+ import type { IDeployer } from '@mastra/core/deployer';
9
+ import type { IMastraLogger } from '@mastra/core/logger';
10
+ import { InputOptions } from 'rollup';
11
+ import type { Mastra } from '@mastra/core';
12
+ import type { MastraAuthConfig } from '@mastra/core/server';
13
+ import { MastraBase } from '@mastra/core/base';
14
+ import { MastraBundler } from '@mastra/core/bundler';
15
+ import type { MastraDeployer } from '@mastra/core';
16
+ import type { MastraVector } from '@mastra/core/vector';
17
+ import type { Next } from 'hono';
18
+ import { OutputOptions } from 'rollup';
19
+ import type { Plugin } from 'rollup';
20
+ import { PluginContext } from 'rollup';
21
+ import { PluginObj } from '@babel/core';
22
+ import { PluginPass } from '@babel/core';
23
+ import type { RegisterOptions } from 'typescript-paths';
24
+ import { RenderedChunk } from 'rollup';
25
+ import type { ResolveHookContext } from 'node:module';
26
+ import { RollupBuild } from 'rollup';
27
+ import { RollupOutput } from 'rollup';
28
+ import { RollupWatcher } from 'rollup';
29
+ import { RuntimeContext } from '@mastra/core/runtime-context';
30
+ import { ServerType } from '@hono/node-server';
31
+ import { Transform } from 'stream';
32
+ import { TypedResponse } from 'hono';
33
+
34
+ export declare function aliasHono(): Plugin;
35
+
36
+ /**
37
+ * Main bundle analysis function that orchestrates the three-step process:
38
+ * 1. Analyze dependencies
39
+ * 2. Bundle dependencies modules
40
+ * 3. Validate generated bundles
41
+ *
42
+ * This helps identify which dependencies need to be externalized vs bundled.
43
+ */
44
+ declare function analyzeBundle(entries: string[], mastraEntry: string, outputDir: string, platform: 'node' | 'browser', logger: IMastraLogger): Promise<{
45
+ invalidChunks: Set<string>;
46
+ dependencies: Map<string, string>;
47
+ externalDependencies: Set<string>;
48
+ }>;
49
+ export { analyzeBundle }
50
+ export { analyzeBundle as analyzeBundle_alias_1 }
51
+
52
+ declare interface ApiError extends Error {
53
+ message: string;
54
+ status?: number;
55
+ }
56
+ export { ApiError }
57
+ export { ApiError as ApiError_alias_1 }
58
+
59
+ declare interface ArchitectureOptions {
60
+ os?: string[];
61
+ cpu?: string[];
62
+ libc?: string[];
63
+ }
64
+
65
+ export declare const authenticationMiddleware: (c: ContextWithMastra, next: Next) => Promise<void | (Response & TypedResponse< {
66
+ error: string;
67
+ }, 401, "json">)>;
68
+
69
+ export declare const authorizationMiddleware: (c: ContextWithMastra, next: Next) => Promise<void | (Response & TypedResponse< {
70
+ error: string;
71
+ }, 403, "json">) | (Response & TypedResponse< {
72
+ error: string;
73
+ }, 500, "json">)>;
74
+
75
+ declare type Bindings = {};
76
+
77
+ export declare abstract class Bundler extends MastraBundler {
78
+ protected analyzeOutputDir: string;
79
+ protected outputDir: string;
80
+ constructor(name: string, component?: 'BUNDLER' | 'DEPLOYER');
81
+ prepare(outputDirectory: string): Promise<void>;
82
+ writeInstrumentationFile(outputDirectory: string, customInstrumentationFile?: string): Promise<void>;
83
+ writePackageJson(outputDirectory: string, dependencies: Map<string, string>, resolutions?: Record<string, string>): Promise<void>;
84
+ protected createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
85
+ dir: string;
86
+ }): Promise<{
87
+ write: () => Promise<RollupOutput>;
88
+ close: () => Promise<void>;
89
+ }>;
90
+ protected analyze(entry: string | string[], mastraFile: string, outputDirectory: string): Promise<{
91
+ invalidChunks: Set<string>;
92
+ dependencies: Map<string, string>;
93
+ externalDependencies: Set<string>;
94
+ }>;
95
+ protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
96
+ protected copyPublic(mastraDir: string, outputDirectory: string): Promise<void>;
97
+ protected copyDOTNPMRC({ rootDir, outputDirectory, }: {
98
+ rootDir?: string;
99
+ outputDirectory: string;
100
+ }): Promise<void>;
101
+ protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: string[]): Promise<InputOptions>;
102
+ getToolsInputOptions(toolsPaths: string[]): Promise<Record<string, string>>;
103
+ protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string): Promise<void>;
104
+ lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
105
+ }
106
+
107
+ export declare const canAccessPublicly: (path: string, method: string, authConfig: MastraAuthConfig) => boolean;
108
+
109
+ export declare function cancelWorkflowRunHandler(c: Context): Promise<Response>;
110
+
111
+ export declare const checkRules: (rules: MastraAuthConfig["rules"], path: string, method: string, user: unknown) => Promise<boolean>;
112
+
113
+ /**
114
+ * Collects all transitive workspace dependencies and their TGZ paths
115
+ */
116
+ export declare const collectTransitiveWorkspaceDependencies: ({ workspaceMap, initialDependencies, logger, }: {
117
+ workspaceMap: Map<string, WorkspacePackageInfo>;
118
+ initialDependencies: Set<string>;
119
+ logger: IMastraLogger;
120
+ }) => TransitiveDependencyResult;
121
+
122
+ declare function createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
123
+ dir: string;
124
+ }): Promise<{
125
+ write: () => Promise<RollupOutput>;
126
+ close: () => Promise<void>;
127
+ }>;
128
+ export { createBundler }
129
+ export { createBundler as createBundler_alias_1 }
130
+
131
+ declare function createChildProcessLogger({ logger, root }: {
132
+ logger: IMastraLogger;
133
+ root: string;
134
+ }): ({ cmd, args, env }: {
135
+ cmd: string;
136
+ args: string[];
137
+ env: Record<string, string>;
138
+ }) => Promise<unknown>;
139
+ export { createChildProcessLogger }
140
+ export { createChildProcessLogger as createChildProcessLogger_alias_1 }
141
+ export { createChildProcessLogger as createChildProcessLogger_alias_2 }
142
+
143
+ export declare function createHonoServer(mastra: Mastra, options?: ServerBundleOptions): Promise<Hono<{
144
+ Bindings: Bindings;
145
+ Variables: Variables;
146
+ }, BlankSchema, "/">>;
147
+
148
+ export declare function createIndex(c: Context): Promise<Response>;
149
+
150
+ export declare function createLegacyWorkflowRunHandler(c: Context): Promise<Response>;
151
+
152
+ export declare function createNodeServer(mastra: Mastra, options?: ServerBundleOptions): Promise<ServerType>;
153
+
154
+ declare const createPinoStream: (logger: IMastraLogger) => Transform;
155
+ export { createPinoStream }
156
+ export { createPinoStream as createPinoStream_alias_1 }
157
+ export { createPinoStream as createPinoStream_alias_2 }
158
+
159
+ export declare function createThreadHandler(c: Context): Promise<Response>;
160
+
161
+ declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
162
+ export { createWatcher }
163
+ export { createWatcher as createWatcher_alias_1 }
164
+
165
+ export declare function createWorkflowRunHandler(c: Context): Promise<Response>;
166
+
167
+ /**
168
+ * Creates a map of workspace packages with their metadata for dependency resolution
169
+ * @returns Map of package names to their location, dependencies and version
170
+ */
171
+ export declare const createWorkspacePackageMap: () => Promise<Map<string, {
172
+ location: string;
173
+ dependencies: Record<string, string> | undefined;
174
+ version: string | undefined;
175
+ }>>;
176
+
177
+ export declare const defaultAuthConfig: MastraAuthConfig;
178
+
179
+ export declare function deleteIndex(c: Context): Promise<Response>;
180
+
181
+ export declare function deleteThreadHandler(c: Context): Promise<Response>;
182
+
183
+ declare abstract class Deployer extends Bundler implements IDeployer {
184
+ deps: DepsService;
185
+ constructor(args: {
186
+ name: string;
187
+ });
188
+ getEnvFiles(): Promise<string[]>;
189
+ abstract deploy(outputDirectory: string): Promise<void>;
190
+ }
191
+ export { Deployer }
192
+ export { Deployer as Deployer_alias_1 }
193
+ export { Deployer as Deployer_alias_2 }
194
+
195
+ declare class Deps extends MastraBase {
196
+ private packageManager;
197
+ private rootDir;
198
+ constructor(rootDir?: string);
199
+ private findLockFile;
200
+ private getPackageManager;
201
+ getWorkspaceDependencyPath({ pkgName, version }: {
202
+ pkgName: string;
203
+ version: string;
204
+ }): string;
205
+ pack({ dir, destination }: {
206
+ dir: string;
207
+ destination: string;
208
+ }): Promise<unknown>;
209
+ private writePnpmConfig;
210
+ private writeYarnConfig;
211
+ private getNpmArgs;
212
+ install({ dir, architecture, }?: {
213
+ dir?: string;
214
+ architecture?: ArchitectureOptions;
215
+ }): Promise<unknown>;
216
+ installPackages(packages: string[]): Promise<unknown>;
217
+ checkDependencies(dependencies: string[]): Promise<string>;
218
+ getProjectName(): Promise<any>;
219
+ getPackageVersion(): Promise<string | undefined>;
220
+ addScriptsToPackageJson(scripts: Record<string, string>): Promise<void>;
221
+ }
222
+ export { Deps }
223
+ export { Deps as Deps_alias_1 }
224
+ export { Deps as Deps_alias_2 }
225
+
226
+ declare class DepsService extends Deps {
227
+ }
228
+ export { DepsService }
229
+ export { DepsService as DepsService_alias_1 }
230
+
231
+ export declare function describeIndex(c: Context): Promise<Response>;
232
+
233
+ declare abstract class EnvService {
234
+ abstract getEnvValue(key: string): Promise<string | null>;
235
+ abstract setEnvValue(key: string, value: string): Promise<void>;
236
+ }
237
+ export { EnvService }
238
+ export { EnvService as EnvService_alias_1 }
239
+
240
+ export declare function errorHandler(err: Error, c: Context, isDev?: boolean): Response;
241
+
242
+ export declare function executeAgentToolHandler(c: Context): Promise<Response>;
243
+
244
+ /**
245
+ * Handler for POST /api/mcp/:serverId/tools/:toolId/execute - Execute a tool on an MCP Server
246
+ */
247
+ export declare const executeMcpServerToolHandler: (c: Context) => Promise<Response>;
248
+
249
+ export declare function executeToolHandler(tools: Record<string, any>): (c: Context) => Promise<Response>;
250
+
251
+ export declare class FileEnvService extends EnvService {
252
+ private filePath;
253
+ constructor(filePath: string);
254
+ private readFile;
255
+ private writeFile;
256
+ private updateEnvData;
257
+ getEnvValue(key: string): Promise<string | null>;
258
+ setEnvValue(key: string, value: string): Promise<void>;
259
+ }
260
+
261
+ declare class FileService {
262
+ /**
263
+ *
264
+ * @param inputFile the file in the starter files directory to copy
265
+ * @param outputFilePath the destination path
266
+ * @param replaceIfExists flag to replace if it exists
267
+ * @returns
268
+ */
269
+ copyStarterFile(inputFile: string, outputFilePath: string, replaceIfExists?: boolean): Promise<boolean>;
270
+ setupEnvFile({ dbUrl }: {
271
+ dbUrl: string;
272
+ }): Promise<void>;
273
+ getFirstExistingFile(files: string[]): string;
274
+ /**
275
+ * Returns the first existing file from the provided array, or undefined if none exist
276
+ * @param files array of file paths to check
277
+ * @returns the first existing file path or undefined
278
+ */
279
+ getFirstExistingFileOrUndefined(files: string[]): string | undefined;
280
+ replaceValuesInFile({ filePath, replacements, }: {
281
+ filePath: string;
282
+ replacements: {
283
+ search: string;
284
+ replace: string;
285
+ }[];
286
+ }): void;
287
+ }
288
+ export { FileService }
289
+ export { FileService as FileService_alias_1 }
290
+ export { FileService as FileService_alias_2 }
291
+ export { FileService as FileService_alias_3 }
292
+
293
+ export declare function generateHandler(c: Context): Promise<Response>;
294
+
295
+ export declare function generateHandler_alias_1(c: Context): Promise<Response>;
296
+
297
+ export declare function generateSystemPromptHandler(c: Context): Promise<Response>;
298
+
299
+ export declare function generateVNextNetworkHandler(c: Context): Promise<Response>;
300
+
301
+ export declare function getAgentByIdHandler(c: Context): Promise<Response & TypedResponse< {
302
+ name: any;
303
+ instructions: string;
304
+ tools: any;
305
+ workflows: {};
306
+ provider: string;
307
+ modelId: string;
308
+ defaultGenerateOptions: any;
309
+ defaultStreamOptions: any;
310
+ }, ContentfulStatusCode, "json">>;
311
+
312
+ export declare function getAgentCardByIdHandler(c: Context): Promise<Response & TypedResponse< {
313
+ name: string;
314
+ description?: string | null | undefined;
315
+ url: string;
316
+ provider?: {
317
+ organization: string;
318
+ url?: string | null | undefined;
319
+ } | null | undefined;
320
+ version: string;
321
+ documentationUrl?: string | null | undefined;
322
+ capabilities: {
323
+ streaming?: boolean | undefined;
324
+ pushNotifications?: boolean | undefined;
325
+ stateTransitionHistory?: boolean | undefined;
326
+ };
327
+ authentication?: {
328
+ schemes: string[];
329
+ credentials?: string | null | undefined;
330
+ } | null | undefined;
331
+ defaultInputModes?: string[] | undefined;
332
+ defaultOutputModes?: string[] | undefined;
333
+ skills: {
334
+ id: string;
335
+ name: string;
336
+ description?: string | null | undefined;
337
+ tags?: string[] | null | undefined;
338
+ examples?: string[] | null | undefined;
339
+ inputModes?: string[] | null | undefined;
340
+ outputModes?: string[] | null | undefined;
341
+ }[];
342
+ }, ContentfulStatusCode, "json">>;
343
+
344
+ export declare function getAgentExecutionHandler(c: Context): Promise<Response>;
345
+
346
+ export declare function getAgentsHandler(c: Context): Promise<Response & TypedResponse< {
347
+ [x: string]: {
348
+ name: any;
349
+ tools: any;
350
+ provider: string;
351
+ instructions: string;
352
+ workflows: {};
353
+ modelId: string;
354
+ defaultGenerateOptions: any;
355
+ defaultStreamOptions: any;
356
+ };
357
+ }, ContentfulStatusCode, "json">>;
358
+
359
+ declare function getBundlerOptions(entryFile: string, outputDir: string): Promise<Config['bundler'] | null>;
360
+ export { getBundlerOptions }
361
+ export { getBundlerOptions as getBundlerOptions_alias_1 }
362
+
363
+ export declare function getBundlerOptionsBundler(entryFile: string, result: {
364
+ hasCustomConfig: false;
365
+ }): Promise<RollupBuild>;
366
+
367
+ export declare function getCustomInstrumentationBundler(entryFile: string, result: {
368
+ hasCustomConfig: false;
369
+ }): Promise<RollupBuild>;
370
+
371
+ declare function getDeployer(entryFile: string, outputDir: string): Promise<MastraDeployer | undefined>;
372
+ export { getDeployer }
373
+ export { getDeployer as getDeployer_alias_1 }
374
+
375
+ export declare function getDeployerBundler(entryFile: string, result: {
376
+ isDeployerRemoved: boolean;
377
+ }): Promise<RollupBuild>;
378
+
379
+ export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
380
+ id: string;
381
+ name: any;
382
+ instructions: string;
383
+ evals: {
384
+ input: string;
385
+ output: string;
386
+ result: {
387
+ score: number;
388
+ info?: {
389
+ [x: string]: any;
390
+ } | undefined;
391
+ };
392
+ agentName: string;
393
+ createdAt: string;
394
+ metricName: string;
395
+ instructions: string;
396
+ runId: string;
397
+ globalRunId: string;
398
+ testInfo?: {
399
+ testName?: string | undefined;
400
+ testPath?: string | undefined;
401
+ } | undefined;
402
+ }[];
403
+ }, ContentfulStatusCode, "json">>;
404
+
405
+ declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser', env?: Record<string, string>): Promise<InputOptions>;
406
+ export { getInputOptions as getBundlerInputOptions }
407
+ export { getInputOptions }
408
+
409
+ declare function getInputOptions_2(entryFile: string, platform: 'node' | 'browser', env?: Record<string, string>): Promise<InputOptions>;
410
+ export { getInputOptions_2 as getInputOptions_alias_1 }
411
+ export { getInputOptions_2 as getWatcherInputOptions }
412
+
413
+ export declare function getLegacyWorkflowByIdHandler(c: Context): Promise<Response>;
414
+
415
+ export declare function getLegacyWorkflowRunsHandler(c: Context): Promise<Response>;
416
+
417
+ export declare function getLegacyWorkflowsHandler(c: Context): Promise<Response>;
418
+
419
+ /**
420
+ * Get available speakers for an agent
421
+ */
422
+ export declare function getListenerHandler(c: Context): Promise<Response>;
423
+
424
+ export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
425
+ id: string;
426
+ name: any;
427
+ instructions: string;
428
+ evals: {
429
+ input: string;
430
+ output: string;
431
+ result: {
432
+ score: number;
433
+ info?: {
434
+ [x: string]: any;
435
+ } | undefined;
436
+ };
437
+ agentName: string;
438
+ createdAt: string;
439
+ metricName: string;
440
+ instructions: string;
441
+ runId: string;
442
+ globalRunId: string;
443
+ testInfo?: {
444
+ testName?: string | undefined;
445
+ testPath?: string | undefined;
446
+ } | undefined;
447
+ }[];
448
+ }, ContentfulStatusCode, "json">>;
449
+
450
+ export declare function getLogsByRunIdHandler(c: Context): Promise<Response>;
451
+
452
+ export declare function getLogsHandler(c: Context): Promise<Response>;
453
+
454
+ export declare function getLogTransports(c: Context): Promise<Response>;
455
+
456
+ /**
457
+ * Handler for GET /api/mcp/v0/servers/:id - Get MCP Server Details (Registry Style)
458
+ */
459
+ export declare const getMcpRegistryServerDetailHandler: (c: Context) => Promise<(Response & TypedResponse< {
460
+ error: string;
461
+ }, 500, "json">) | (Response & TypedResponse< {
462
+ error: string;
463
+ }, 404, "json">) | (Response & TypedResponse< {
464
+ package_canonical?: string | undefined;
465
+ packages?: {
466
+ registry_name: "npm" | "docker" | "pypi" | "homebrew" | string;
467
+ name: string;
468
+ version: string;
469
+ command?: {
470
+ name: "npx" | "docker" | "pypi" | "uvx" | string;
471
+ subcommands?: {
472
+ name: string;
473
+ description: string;
474
+ is_required?: boolean | undefined;
475
+ subcommands?: /*elided*/ any[] | undefined;
476
+ positional_arguments?: {
477
+ position: number;
478
+ name: string;
479
+ description: string;
480
+ is_required: boolean;
481
+ is_repeatable?: boolean | undefined;
482
+ is_editable?: boolean | undefined;
483
+ choices?: string[] | undefined;
484
+ default_value?: string | number | boolean | undefined;
485
+ }[] | undefined;
486
+ named_arguments?: {
487
+ short_flag?: string | undefined;
488
+ long_flag?: string | undefined;
489
+ requires_value?: boolean | undefined;
490
+ name: string;
491
+ description: string;
492
+ is_required: boolean;
493
+ is_repeatable?: boolean | undefined;
494
+ is_editable?: boolean | undefined;
495
+ choices?: string[] | undefined;
496
+ default_value?: string | number | boolean | undefined;
497
+ }[] | undefined;
498
+ }[] | undefined;
499
+ positional_arguments?: {
500
+ position: number;
501
+ name: string;
502
+ description: string;
503
+ is_required: boolean;
504
+ is_repeatable?: boolean | undefined;
505
+ is_editable?: boolean | undefined;
506
+ choices?: string[] | undefined;
507
+ default_value?: string | number | boolean | undefined;
508
+ }[] | undefined;
509
+ named_arguments?: {
510
+ short_flag?: string | undefined;
511
+ long_flag?: string | undefined;
512
+ requires_value?: boolean | undefined;
513
+ name: string;
514
+ description: string;
515
+ is_required: boolean;
516
+ is_repeatable?: boolean | undefined;
517
+ is_editable?: boolean | undefined;
518
+ choices?: string[] | undefined;
519
+ default_value?: string | number | boolean | undefined;
520
+ }[] | undefined;
521
+ } | undefined;
522
+ environment_variables?: {
523
+ name: string;
524
+ description: string;
525
+ required?: boolean | undefined;
526
+ default_value?: string | undefined;
527
+ }[] | undefined;
528
+ }[] | undefined;
529
+ remotes?: {
530
+ transport_type: "streamable" | "sse" | string;
531
+ url: string;
532
+ }[] | undefined;
533
+ id: string;
534
+ name: string;
535
+ description?: string | undefined;
536
+ repository?: {
537
+ url: string;
538
+ source: "github" | "gitlab" | string;
539
+ id: string;
540
+ } | undefined;
541
+ version_detail: {
542
+ version: string;
543
+ release_date: string;
544
+ is_latest: boolean;
545
+ };
546
+ }, ContentfulStatusCode, "json">)>;
547
+
548
+ /**
549
+ * Handler for Streamable HTTP requests (POST, GET, DELETE) to /api/mcp/:serverId/mcp
550
+ */
551
+ export declare const getMcpServerMessageHandler: (c: Context) => Promise<Response | undefined>;
552
+
553
+ /**
554
+ * Handler for SSE related routes for an MCP server.
555
+ * This function will be called for both establishing the SSE connection (GET)
556
+ * and for posting messages to it (POST).
557
+ */
558
+ export declare const getMcpServerSseHandler: (c: Context) => Promise<Response | undefined>;
559
+
560
+ /**
561
+ * Handler for GET /api/mcp/:serverId/tools/:toolId - Get details for a specific tool on an MCP Server
562
+ */
563
+ export declare const getMcpServerToolDetailHandler: (c: Context) => Promise<Response>;
564
+
565
+ export declare function getMemoryStatusHandler(c: Context): Promise<Response>;
566
+
567
+ export declare function getMessagesHandler(c: Context): Promise<Response>;
568
+
569
+ export declare function getNetworkByIdHandler(c: Context): Promise<Response>;
570
+
571
+ export declare function getNetworksHandler(c: Context): Promise<Response>;
572
+
573
+ declare function getServerOptions(entryFile: string, outputDir: string): Promise<Config['server'] | null>;
574
+ export { getServerOptions }
575
+ export { getServerOptions as getServerOptions_alias_1 }
576
+
577
+ export declare function getServerOptionsBundler(entryFile: string, result: {
578
+ hasCustomConfig: false;
579
+ }): Promise<RollupBuild>;
580
+
581
+ /**
582
+ * Get available speakers for an agent
583
+ */
584
+ export declare function getSpeakersHandler(c: Context): Promise<Response>;
585
+
586
+ export declare function getTelemetryBundler(entryFile: string, result: {
587
+ hasCustomConfig: false;
588
+ }): Promise<RollupBuild>;
589
+
590
+ export declare function getTelemetryHandler(c: Context): Promise<Response>;
591
+
592
+ export declare function getThreadByIdHandler(c: Context): Promise<Response>;
593
+
594
+ export declare function getThreadsHandler(c: Context): Promise<Response>;
595
+
596
+ export declare function getToolByIdHandler(c: Context): Promise<Response>;
597
+
598
+ export declare function getToolsHandler(c: Context): Promise<Response>;
599
+
600
+ export declare const getVector: (c: Context, vectorName: string) => MastraVector;
601
+
602
+ export declare function getVNextNetworkByIdHandler(c: Context): Promise<Response>;
603
+
604
+ export declare function getVNextNetworksHandler(c: Context): Promise<Response>;
605
+
606
+ export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
607
+
608
+ export declare function getWorkflowRunByIdHandler(c: Context): Promise<Response>;
609
+
610
+ export declare function getWorkflowRunExecutionResultHandler(c: Context): Promise<Response>;
611
+
612
+ export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
613
+
614
+ export declare function getWorkflowsHandler(c: Context): Promise<Response>;
615
+
616
+ export declare function getWorkingMemoryHandler(c: Context): Promise<Response>;
617
+
618
+ export declare function handleClientsRefresh(c: Context): Response;
619
+
620
+ export declare function handleError(error: unknown, defaultMessage: string): Promise<Response>;
621
+
622
+ export declare function handleTriggerClientsRefresh(c: Context): Response & TypedResponse< {
623
+ success: true;
624
+ clients: number;
625
+ }, ContentfulStatusCode, "json">;
626
+
627
+ 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 strokeWidth=\"2\"\n >\n <path d=\"M5 12h14M12 5l7 7-7 7\" />\n </svg>\n </a>\n </main>\n </body>\n</html>\n";
628
+
629
+ export declare function isNodeBuiltin(dep: string): boolean;
630
+
631
+ export declare const isProtectedPath: (path: string, method: string, authConfig: MastraAuthConfig) => boolean;
632
+
633
+ /**
634
+ * Convert speech to text using the agent's voice provider
635
+ */
636
+ export declare function listenHandler(c: Context): Promise<Response>;
637
+
638
+ export declare function listIndexes(c: Context): Promise<Response>;
639
+
640
+ /**
641
+ * Handler for GET /api/mcp/v0/servers - List MCP Servers (Registry Style)
642
+ */
643
+ export declare const listMcpRegistryServersHandler: (c: Context) => Promise<(Response & TypedResponse< {
644
+ error: string;
645
+ }, 500, "json">) | (Response & TypedResponse< {
646
+ servers: {
647
+ id: string;
648
+ name: string;
649
+ description?: string | undefined;
650
+ repository?: {
651
+ url: string;
652
+ source: "github" | "gitlab" | string;
653
+ id: string;
654
+ } | undefined;
655
+ version_detail: {
656
+ version: string;
657
+ release_date: string;
658
+ is_latest: boolean;
659
+ };
660
+ }[];
661
+ next: string | null;
662
+ total_count: number;
663
+ }, ContentfulStatusCode, "json">)>;
664
+
665
+ /**
666
+ * Handler for GET /api/mcp/:serverId/tools - List tools for a specific MCP Server
667
+ */
668
+ export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
669
+
670
+ export declare function loopStreamVNextNetworkHandler(c: Context): Promise<Response>;
671
+
672
+ export declare function loopVNextNetworkHandler(c: Context): Promise<Response>;
673
+
674
+ export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
675
+
676
+ export declare function nodeModulesExtensionResolver(): Plugin;
677
+
678
+ /**
679
+ * Creates TGZ packages for workspace dependencies in the workspace-module directory
680
+ */
681
+ export declare const packWorkspaceDependencies: ({ workspaceMap, usedWorkspacePackages, bundleOutputDir, logger, }: {
682
+ workspaceMap: Map<string, WorkspacePackageInfo>;
683
+ bundleOutputDir: string;
684
+ logger: IMastraLogger;
685
+ usedWorkspacePackages: Set<string>;
686
+ }) => Promise<void>;
687
+
688
+ export declare const pathMatchesPattern: (path: string, pattern: string) => boolean;
689
+
690
+ export declare const pathMatchesRule: (path: string, rulePath: string | RegExp | string[] | undefined) => boolean;
691
+
692
+ export declare function pino(): {
693
+ name: string;
694
+ resolveId(this: PluginContext, id: string, importee: string | undefined): Promise<{
695
+ id: string;
696
+ external: true;
697
+ moduleSideEffects: false;
698
+ } | undefined>;
699
+ renderChunk(this: PluginContext, code: string, chunk: RenderedChunk): {
700
+ code: string;
701
+ map: null;
702
+ } | undefined;
703
+ };
704
+
705
+ export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'>;
706
+
707
+ export declare function queryVectors(c: Context): Promise<Response>;
708
+
709
+ export declare function recursiveRemoveNonReferencedNodes(code: string): Promise<{
710
+ code: string;
711
+ map: any;
712
+ }>;
713
+
714
+ export declare function removeAllExceptDeployer(): babel_2.PluginObj;
715
+
716
+ export declare function removeAllOptionsExceptBundler(result: {
717
+ hasCustomConfig: boolean;
718
+ }): PluginObj<PluginPass>;
719
+
720
+ export declare function removeAllOptionsExceptServer(result: {
721
+ hasCustomConfig: boolean;
722
+ }): PluginObj<PluginPass>;
723
+
724
+ export declare function removeAllOptionsExceptTelemetry(result: {
725
+ hasCustomConfig: boolean;
726
+ }): PluginObj<PluginPass>;
727
+
728
+ export declare function removeAllOptionsFromMastraExcept(result: {
729
+ hasCustomConfig: boolean;
730
+ }, option: 'telemetry' | 'server' | 'bundler'): babel_2.PluginObj;
731
+
732
+ export declare function removeDeployer(): babel_2.PluginObj;
733
+
734
+ export declare function removeDeployer_alias_1(mastraEntry: string): Plugin;
735
+
736
+ export declare function removeNonReferencedNodes(): babel_2.PluginObj;
737
+
738
+ export declare function resolve(specifier: string, context: ResolveHookContext, nextResolve: (specifier: string, context: ResolveHookContext) => Promise<{
739
+ url: string;
740
+ }>): Promise<{
741
+ url: string;
742
+ }>;
743
+
744
+ export declare function resumeAsyncLegacyWorkflowHandler(c: Context): Promise<Response>;
745
+
746
+ export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
747
+
748
+ export declare function resumeLegacyWorkflowHandler(c: Context): Promise<Response>;
749
+
750
+ export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
751
+
752
+ export declare function rootHandler(c: Context): Promise<Response & TypedResponse<"Hello to the Mastra API!", ContentfulStatusCode, "text">>;
753
+
754
+ export declare function saveMessagesHandler(c: Context): Promise<Response>;
755
+
756
+ export declare function sendWorkflowRunEventHandler(c: Context): Promise<Response>;
757
+
758
+ declare type ServerBundleOptions = {
759
+ playground?: boolean;
760
+ isDev?: boolean;
761
+ };
762
+ export { ServerBundleOptions }
763
+ export { ServerBundleOptions as ServerBundleOptions_alias_1 }
764
+
765
+ export declare function setAgentInstructionsHandler(c: Context): Promise<Response>;
766
+
767
+ /**
768
+ * Convert text to speech using the agent's voice provider
769
+ */
770
+ export declare function speakHandler(c: Context): Promise<Response>;
771
+
772
+ export declare function startAsyncLegacyWorkflowHandler(c: Context): Promise<Response>;
773
+
774
+ export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
775
+
776
+ export declare function startLegacyWorkflowRunHandler(c: Context): Promise<Response>;
777
+
778
+ export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
779
+
780
+ export declare function storeTelemetryHandler(c: Context): Promise<Response>;
781
+
782
+ export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
783
+
784
+ export declare function streamGenerateHandler_alias_1(c: Context): Promise<Response | undefined>;
785
+
786
+ export declare function streamGenerateVNextNetworkHandler(c: Context): Promise<Response>;
787
+
788
+ export declare function streamWorkflowHandler(c: Context): Promise<Response>;
789
+
790
+ declare type TransitiveDependencyResult = {
791
+ resolutions: Record<string, string>;
792
+ usedWorkspacePackages: Set<string>;
793
+ };
794
+
795
+ export declare function tsConfigPaths({ tsConfigPath, respectCoreModule }?: PluginOptions): Plugin;
796
+
797
+ export declare function updateThreadHandler(c: Context): Promise<Response>;
798
+
799
+ export declare function updateWorkingMemoryHandler(c: Context): Promise<Response>;
800
+
801
+ export declare function upsertMastraDir({ dir }: {
802
+ dir?: string;
803
+ }): void;
804
+
805
+ export declare function upsertVectors(c: Context): Promise<Response>;
806
+
807
+ export declare function validate(file: string): Promise<void>;
808
+
809
+ export declare function validateBody(body: Record<string, unknown>): void;
810
+
811
+ declare type Variables = {
812
+ mastra: Mastra;
813
+ runtimeContext: RuntimeContext;
814
+ clients: Set<{
815
+ controller: ReadableStreamDefaultController;
816
+ }>;
817
+ tools: Record<string, any>;
818
+ playground: boolean;
819
+ isDev: boolean;
820
+ };
821
+
822
+ export declare function watchLegacyWorkflowHandler(c: Context): Response | Promise<Response>;
823
+
824
+ export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
825
+
826
+ declare type WorkspacePackageInfo = {
827
+ location: string;
828
+ dependencies: Record<string, string> | undefined;
829
+ version: string | undefined;
830
+ };
831
+
832
+ export declare function writeCustomInstrumentation(entryFile: string, outputDir: string): Promise<{
833
+ hasCustomConfig: boolean;
834
+ externalDependencies: string[];
835
+ }>;
836
+
837
+ declare function writeTelemetryConfig(entryFile: string, outputDir: string): Promise<{
838
+ hasCustomConfig: boolean;
839
+ externalDependencies: string[];
840
+ }>;
841
+ export { writeTelemetryConfig }
842
+ export { writeTelemetryConfig as writeTelemetryConfig_alias_1 }
843
+
844
+ export { }