@mastra/deployer 0.11.0-alpha.0 → 0.11.0-alpha.2
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/dist/_tsup-dts-rollup.d.cts +80 -9
- package/dist/_tsup-dts-rollup.d.ts +80 -9
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +15 -15
- package/dist/build/index.js +5 -5
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-GPD54HBC.js → chunk-7HFWRNM7.js} +1 -7
- package/dist/{chunk-Z544XXXK.js → chunk-AFR3LY44.js} +45 -4
- package/dist/{chunk-LT2BJRBN.js → chunk-APPDEIPA.js} +9 -4
- package/dist/{chunk-UFVGATV6.cjs → chunk-D73JIE6N.cjs} +41 -25
- package/dist/{chunk-D57U647E.js → chunk-DB7LRMOC.js} +31 -15
- package/dist/{chunk-M2VZQFTW.cjs → chunk-E7ZSCQUV.cjs} +15 -9
- package/dist/{chunk-KCP5ITLV.cjs → chunk-F25LATVR.cjs} +3 -9
- package/dist/{chunk-TIC2KT3M.js → chunk-HZNWZQHG.js} +2 -1
- package/dist/{chunk-D2DCFCLH.cjs → chunk-MOG6ASL4.cjs} +4 -3
- package/dist/{chunk-ENT5RDOI.js → chunk-NB6XIOPQ.js} +14 -8
- package/dist/{chunk-YVPLA2GR.cjs → chunk-TK2RG7LU.cjs} +14 -9
- package/dist/{chunk-UYQZMNZL.js → chunk-TLGEPS44.js} +29 -3
- package/dist/{chunk-54KOF3NB.cjs → chunk-WKW236CI.cjs} +46 -4
- package/dist/{chunk-XKH6F4NE.cjs → chunk-WTGMSQT5.cjs} +32 -6
- package/dist/index.cjs +11 -11
- package/dist/index.js +4 -4
- package/dist/server/index.cjs +1169 -375
- package/dist/server/index.d.cts +1 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1174 -381
- package/dist/services/index.cjs +4 -4
- package/dist/services/index.js +1 -1
- package/dist/templates/instrumentation-template.js +10 -6
- package/package.json +3 -3
|
@@ -6,6 +6,7 @@ import { ContentfulStatusCode } from 'hono/utils/http-status';
|
|
|
6
6
|
import type { Context } from 'hono';
|
|
7
7
|
import type { ContextWithMastra } from '@mastra/core/server';
|
|
8
8
|
import { Hono } from 'hono';
|
|
9
|
+
import type { HonoRequest } from 'hono';
|
|
9
10
|
import type { IDeployer } from '@mastra/core/deployer';
|
|
10
11
|
import type { IMastraLogger } from '@mastra/core/logger';
|
|
11
12
|
import { InputOptions } from 'rollup';
|
|
@@ -29,6 +30,8 @@ import { RollupOutput } from 'rollup';
|
|
|
29
30
|
import { RollupWatcher } from 'rollup';
|
|
30
31
|
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
31
32
|
import { ServerType } from '@hono/node-server';
|
|
33
|
+
import type { Tool } from '@mastra/core';
|
|
34
|
+
import { Tool as Tool_2 } from '@mastra/core/tools';
|
|
32
35
|
import { Transform } from 'stream';
|
|
33
36
|
import { TypedResponse } from 'hono';
|
|
34
37
|
|
|
@@ -112,7 +115,7 @@ export declare abstract class Bundler extends MastraBundler {
|
|
|
112
115
|
}): Promise<void>;
|
|
113
116
|
protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: string[]): Promise<InputOptions>;
|
|
114
117
|
getToolsInputOptions(toolsPaths: string[]): Promise<Record<string, string>>;
|
|
115
|
-
protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string
|
|
118
|
+
protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string): Promise<void>;
|
|
116
119
|
lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
117
120
|
}
|
|
118
121
|
|
|
@@ -574,14 +577,49 @@ export declare const getMcpServerSseHandler: (c: Context) => Promise<Response |
|
|
|
574
577
|
*/
|
|
575
578
|
export declare const getMcpServerToolDetailHandler: (c: Context) => Promise<Response>;
|
|
576
579
|
|
|
580
|
+
export declare function getMemoryConfigHandler(c: Context): Promise<Response>;
|
|
581
|
+
|
|
577
582
|
export declare function getMemoryStatusHandler(c: Context): Promise<Response>;
|
|
578
583
|
|
|
579
584
|
export declare function getMessagesHandler(c: Context): Promise<Response>;
|
|
580
585
|
|
|
586
|
+
export declare function getMessagesPaginatedHandler(c: Context): Promise<Response>;
|
|
587
|
+
|
|
581
588
|
export declare function getNetworkByIdHandler(c: Context): Promise<Response>;
|
|
582
589
|
|
|
583
590
|
export declare function getNetworksHandler(c: Context): Promise<Response>;
|
|
584
591
|
|
|
592
|
+
export declare function getScorerHandler(c: Context): Promise<Response & TypedResponse< {
|
|
593
|
+
scorer: {
|
|
594
|
+
name: string;
|
|
595
|
+
description: string;
|
|
596
|
+
extract?: {} | undefined;
|
|
597
|
+
analyze: {};
|
|
598
|
+
reason?: {} | undefined;
|
|
599
|
+
metadata?: {
|
|
600
|
+
[x: string]: any;
|
|
601
|
+
} | undefined;
|
|
602
|
+
isLLMScorer?: boolean | undefined;
|
|
603
|
+
run: {};
|
|
604
|
+
};
|
|
605
|
+
sampling?: {
|
|
606
|
+
type: "none";
|
|
607
|
+
} | {
|
|
608
|
+
type: "ratio";
|
|
609
|
+
rate: number;
|
|
610
|
+
} | undefined;
|
|
611
|
+
agentIds: string[];
|
|
612
|
+
workflowIds: string[];
|
|
613
|
+
} | null, ContentfulStatusCode, "json">>;
|
|
614
|
+
|
|
615
|
+
export declare function getScorersHandler(c: Context): Promise<Response>;
|
|
616
|
+
|
|
617
|
+
export declare function getScoresByEntityIdHandler(c: Context): Promise<Response>;
|
|
618
|
+
|
|
619
|
+
export declare function getScoresByRunIdHandler(c: Context): Promise<Response>;
|
|
620
|
+
|
|
621
|
+
export declare function getScoresByScorerIdHandler(c: Context): Promise<Response>;
|
|
622
|
+
|
|
585
623
|
declare function getServerOptions(entryFile: string, outputDir: string): Promise<Config['server'] | null>;
|
|
586
624
|
export { getServerOptions }
|
|
587
625
|
export { getServerOptions as getServerOptions_alias_1 }
|
|
@@ -597,7 +635,7 @@ export declare function getSpeakersHandler(c: Context): Promise<Response>;
|
|
|
597
635
|
|
|
598
636
|
export declare function getTelemetryBundler(entryFile: string, result: {
|
|
599
637
|
hasCustomConfig: false;
|
|
600
|
-
}): Promise<RollupBuild>;
|
|
638
|
+
}, logger: IMastraLogger): Promise<RollupBuild>;
|
|
601
639
|
|
|
602
640
|
export declare function getTelemetryHandler(c: Context): Promise<Response>;
|
|
603
641
|
|
|
@@ -607,6 +645,8 @@ export declare function getThreadsHandler(c: Context): Promise<Response>;
|
|
|
607
645
|
|
|
608
646
|
export declare function getToolByIdHandler(c: Context): Promise<Response>;
|
|
609
647
|
|
|
648
|
+
export declare function getToolExports(tools: Record<string, Function>[]): Record<string, Function> | undefined;
|
|
649
|
+
|
|
610
650
|
export declare function getToolsHandler(c: Context): Promise<Response>;
|
|
611
651
|
|
|
612
652
|
export declare const getVector: (c: Context, vectorName: string) => MastraVector;
|
|
@@ -638,6 +678,8 @@ clients: number;
|
|
|
638
678
|
|
|
639
679
|
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";
|
|
640
680
|
|
|
681
|
+
export declare const isDevPlaygroundRequest: (req: HonoRequest) => boolean;
|
|
682
|
+
|
|
641
683
|
export declare function isNodeBuiltin(dep: string): boolean;
|
|
642
684
|
|
|
643
685
|
export declare const isProtectedPath: (path: string, method: string, authConfig: MastraAuthConfig) => boolean;
|
|
@@ -705,6 +747,13 @@ export declare const packWorkspaceDependencies: ({ workspaceMap, usedWorkspacePa
|
|
|
705
747
|
usedWorkspacePackages: Set<string>;
|
|
706
748
|
}) => Promise<void>;
|
|
707
749
|
|
|
750
|
+
/**
|
|
751
|
+
* Parse a limit query parameter value to a valid number
|
|
752
|
+
* @param rawLimit - The raw limit value from query parameters
|
|
753
|
+
* @returns A valid positive integer or undefined
|
|
754
|
+
*/
|
|
755
|
+
export declare function parseLimit(rawLimit: string | undefined): number | undefined;
|
|
756
|
+
|
|
708
757
|
export declare const pathMatchesPattern: (path: string, pattern: string) => boolean;
|
|
709
758
|
|
|
710
759
|
export declare const pathMatchesRule: (path: string, rulePath: string | RegExp | string[] | undefined) => boolean;
|
|
@@ -722,7 +771,9 @@ export declare function pino(): {
|
|
|
722
771
|
} | undefined;
|
|
723
772
|
};
|
|
724
773
|
|
|
725
|
-
export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'
|
|
774
|
+
export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'> & {
|
|
775
|
+
localResolve?: boolean;
|
|
776
|
+
};
|
|
726
777
|
|
|
727
778
|
export declare function queryVectors(c: Context): Promise<Response>;
|
|
728
779
|
|
|
@@ -743,11 +794,11 @@ export declare function removeAllOptionsExceptServer(result: {
|
|
|
743
794
|
|
|
744
795
|
export declare function removeAllOptionsExceptTelemetry(result: {
|
|
745
796
|
hasCustomConfig: boolean;
|
|
746
|
-
}): PluginObj<PluginPass>;
|
|
797
|
+
}, logger: IMastraLogger): PluginObj<PluginPass>;
|
|
747
798
|
|
|
748
799
|
export declare function removeAllOptionsFromMastraExcept(result: {
|
|
749
800
|
hasCustomConfig: boolean;
|
|
750
|
-
}, option: 'telemetry' | 'server' | 'bundler'): babel_2.PluginObj;
|
|
801
|
+
}, option: 'telemetry' | 'server' | 'bundler', logger?: IMastraLogger): babel_2.PluginObj;
|
|
751
802
|
|
|
752
803
|
export declare function removeDeployer(): babel_2.PluginObj;
|
|
753
804
|
|
|
@@ -773,11 +824,18 @@ export declare function rootHandler(c: Context): Promise<Response & TypedRespons
|
|
|
773
824
|
|
|
774
825
|
export declare function saveMessagesHandler(c: Context): Promise<Response>;
|
|
775
826
|
|
|
827
|
+
export declare function saveScoreHandler(c: Context): Promise<Response>;
|
|
828
|
+
|
|
829
|
+
export declare function scoresRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
|
|
830
|
+
|
|
831
|
+
export declare function searchMemoryHandler(c: Context): Promise<Response>;
|
|
832
|
+
|
|
776
833
|
export declare function sendWorkflowRunEventHandler(c: Context): Promise<Response>;
|
|
777
834
|
|
|
778
835
|
declare type ServerBundleOptions = {
|
|
779
836
|
playground?: boolean;
|
|
780
837
|
isDev?: boolean;
|
|
838
|
+
tools: Record<string, Tool>;
|
|
781
839
|
};
|
|
782
840
|
export { ServerBundleOptions }
|
|
783
841
|
export { ServerBundleOptions as ServerBundleOptions_alias_1 }
|
|
@@ -805,6 +863,10 @@ export declare function streamGenerateHandler_alias_1(c: Context): Promise<Respo
|
|
|
805
863
|
|
|
806
864
|
export declare function streamGenerateVNextNetworkHandler(c: Context): Promise<Response>;
|
|
807
865
|
|
|
866
|
+
export declare function streamVNextGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
867
|
+
|
|
868
|
+
export declare function streamVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
869
|
+
|
|
808
870
|
export declare function streamWorkflowHandler(c: Context): Promise<Response>;
|
|
809
871
|
|
|
810
872
|
export declare function telemetryRouter(): Hono<BlankEnv, BlankSchema, "/">;
|
|
@@ -816,7 +878,7 @@ declare type TransitiveDependencyResult = {
|
|
|
816
878
|
usedWorkspacePackages: Set<string>;
|
|
817
879
|
};
|
|
818
880
|
|
|
819
|
-
export declare function tsConfigPaths({ tsConfigPath, respectCoreModule }?: PluginOptions): Plugin;
|
|
881
|
+
export declare function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve }?: PluginOptions): Plugin;
|
|
820
882
|
|
|
821
883
|
export declare function updateThreadHandler(c: Context): Promise<Response>;
|
|
822
884
|
|
|
@@ -838,7 +900,7 @@ declare type Variables = {
|
|
|
838
900
|
clients: Set<{
|
|
839
901
|
controller: ReadableStreamDefaultController;
|
|
840
902
|
}>;
|
|
841
|
-
tools: Record<string,
|
|
903
|
+
tools: Record<string, Tool_2>;
|
|
842
904
|
playground: boolean;
|
|
843
905
|
isDev: boolean;
|
|
844
906
|
};
|
|
@@ -859,12 +921,21 @@ declare type WorkspacePackageInfo = {
|
|
|
859
921
|
version: string | undefined;
|
|
860
922
|
};
|
|
861
923
|
|
|
862
|
-
export declare function writeCustomInstrumentation(entryFile: string, outputDir: string
|
|
924
|
+
export declare function writeCustomInstrumentation(entryFile: string, outputDir: string, options?: {
|
|
925
|
+
sourcemap?: boolean;
|
|
926
|
+
}): Promise<{
|
|
863
927
|
hasCustomConfig: boolean;
|
|
864
928
|
externalDependencies: string[];
|
|
865
929
|
}>;
|
|
866
930
|
|
|
867
|
-
declare function writeTelemetryConfig(entryFile
|
|
931
|
+
declare function writeTelemetryConfig({ entryFile, outputDir, options, logger, }: {
|
|
932
|
+
entryFile: string;
|
|
933
|
+
outputDir: string;
|
|
934
|
+
options: {
|
|
935
|
+
sourcemap?: boolean;
|
|
936
|
+
};
|
|
937
|
+
logger: IMastraLogger;
|
|
938
|
+
}): Promise<{
|
|
868
939
|
hasCustomConfig: boolean;
|
|
869
940
|
externalDependencies: string[];
|
|
870
941
|
}>;
|
|
@@ -6,6 +6,7 @@ import { ContentfulStatusCode } from 'hono/utils/http-status';
|
|
|
6
6
|
import type { Context } from 'hono';
|
|
7
7
|
import type { ContextWithMastra } from '@mastra/core/server';
|
|
8
8
|
import { Hono } from 'hono';
|
|
9
|
+
import type { HonoRequest } from 'hono';
|
|
9
10
|
import type { IDeployer } from '@mastra/core/deployer';
|
|
10
11
|
import type { IMastraLogger } from '@mastra/core/logger';
|
|
11
12
|
import { InputOptions } from 'rollup';
|
|
@@ -29,6 +30,8 @@ import { RollupOutput } from 'rollup';
|
|
|
29
30
|
import { RollupWatcher } from 'rollup';
|
|
30
31
|
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
31
32
|
import { ServerType } from '@hono/node-server';
|
|
33
|
+
import type { Tool } from '@mastra/core';
|
|
34
|
+
import { Tool as Tool_2 } from '@mastra/core/tools';
|
|
32
35
|
import { Transform } from 'stream';
|
|
33
36
|
import { TypedResponse } from 'hono';
|
|
34
37
|
|
|
@@ -112,7 +115,7 @@ export declare abstract class Bundler extends MastraBundler {
|
|
|
112
115
|
}): Promise<void>;
|
|
113
116
|
protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: string[]): Promise<InputOptions>;
|
|
114
117
|
getToolsInputOptions(toolsPaths: string[]): Promise<Record<string, string>>;
|
|
115
|
-
protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string
|
|
118
|
+
protected _bundle(serverFile: string, mastraEntryFile: string, outputDirectory: string, toolsPaths?: string[], bundleLocation?: string): Promise<void>;
|
|
116
119
|
lint(_entryFile: string, _outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
117
120
|
}
|
|
118
121
|
|
|
@@ -574,14 +577,49 @@ export declare const getMcpServerSseHandler: (c: Context) => Promise<Response |
|
|
|
574
577
|
*/
|
|
575
578
|
export declare const getMcpServerToolDetailHandler: (c: Context) => Promise<Response>;
|
|
576
579
|
|
|
580
|
+
export declare function getMemoryConfigHandler(c: Context): Promise<Response>;
|
|
581
|
+
|
|
577
582
|
export declare function getMemoryStatusHandler(c: Context): Promise<Response>;
|
|
578
583
|
|
|
579
584
|
export declare function getMessagesHandler(c: Context): Promise<Response>;
|
|
580
585
|
|
|
586
|
+
export declare function getMessagesPaginatedHandler(c: Context): Promise<Response>;
|
|
587
|
+
|
|
581
588
|
export declare function getNetworkByIdHandler(c: Context): Promise<Response>;
|
|
582
589
|
|
|
583
590
|
export declare function getNetworksHandler(c: Context): Promise<Response>;
|
|
584
591
|
|
|
592
|
+
export declare function getScorerHandler(c: Context): Promise<Response & TypedResponse< {
|
|
593
|
+
scorer: {
|
|
594
|
+
name: string;
|
|
595
|
+
description: string;
|
|
596
|
+
extract?: {} | undefined;
|
|
597
|
+
analyze: {};
|
|
598
|
+
reason?: {} | undefined;
|
|
599
|
+
metadata?: {
|
|
600
|
+
[x: string]: any;
|
|
601
|
+
} | undefined;
|
|
602
|
+
isLLMScorer?: boolean | undefined;
|
|
603
|
+
run: {};
|
|
604
|
+
};
|
|
605
|
+
sampling?: {
|
|
606
|
+
type: "none";
|
|
607
|
+
} | {
|
|
608
|
+
type: "ratio";
|
|
609
|
+
rate: number;
|
|
610
|
+
} | undefined;
|
|
611
|
+
agentIds: string[];
|
|
612
|
+
workflowIds: string[];
|
|
613
|
+
} | null, ContentfulStatusCode, "json">>;
|
|
614
|
+
|
|
615
|
+
export declare function getScorersHandler(c: Context): Promise<Response>;
|
|
616
|
+
|
|
617
|
+
export declare function getScoresByEntityIdHandler(c: Context): Promise<Response>;
|
|
618
|
+
|
|
619
|
+
export declare function getScoresByRunIdHandler(c: Context): Promise<Response>;
|
|
620
|
+
|
|
621
|
+
export declare function getScoresByScorerIdHandler(c: Context): Promise<Response>;
|
|
622
|
+
|
|
585
623
|
declare function getServerOptions(entryFile: string, outputDir: string): Promise<Config['server'] | null>;
|
|
586
624
|
export { getServerOptions }
|
|
587
625
|
export { getServerOptions as getServerOptions_alias_1 }
|
|
@@ -597,7 +635,7 @@ export declare function getSpeakersHandler(c: Context): Promise<Response>;
|
|
|
597
635
|
|
|
598
636
|
export declare function getTelemetryBundler(entryFile: string, result: {
|
|
599
637
|
hasCustomConfig: false;
|
|
600
|
-
}): Promise<RollupBuild>;
|
|
638
|
+
}, logger: IMastraLogger): Promise<RollupBuild>;
|
|
601
639
|
|
|
602
640
|
export declare function getTelemetryHandler(c: Context): Promise<Response>;
|
|
603
641
|
|
|
@@ -607,6 +645,8 @@ export declare function getThreadsHandler(c: Context): Promise<Response>;
|
|
|
607
645
|
|
|
608
646
|
export declare function getToolByIdHandler(c: Context): Promise<Response>;
|
|
609
647
|
|
|
648
|
+
export declare function getToolExports(tools: Record<string, Function>[]): Record<string, Function> | undefined;
|
|
649
|
+
|
|
610
650
|
export declare function getToolsHandler(c: Context): Promise<Response>;
|
|
611
651
|
|
|
612
652
|
export declare const getVector: (c: Context, vectorName: string) => MastraVector;
|
|
@@ -638,6 +678,8 @@ clients: number;
|
|
|
638
678
|
|
|
639
679
|
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";
|
|
640
680
|
|
|
681
|
+
export declare const isDevPlaygroundRequest: (req: HonoRequest) => boolean;
|
|
682
|
+
|
|
641
683
|
export declare function isNodeBuiltin(dep: string): boolean;
|
|
642
684
|
|
|
643
685
|
export declare const isProtectedPath: (path: string, method: string, authConfig: MastraAuthConfig) => boolean;
|
|
@@ -705,6 +747,13 @@ export declare const packWorkspaceDependencies: ({ workspaceMap, usedWorkspacePa
|
|
|
705
747
|
usedWorkspacePackages: Set<string>;
|
|
706
748
|
}) => Promise<void>;
|
|
707
749
|
|
|
750
|
+
/**
|
|
751
|
+
* Parse a limit query parameter value to a valid number
|
|
752
|
+
* @param rawLimit - The raw limit value from query parameters
|
|
753
|
+
* @returns A valid positive integer or undefined
|
|
754
|
+
*/
|
|
755
|
+
export declare function parseLimit(rawLimit: string | undefined): number | undefined;
|
|
756
|
+
|
|
708
757
|
export declare const pathMatchesPattern: (path: string, pattern: string) => boolean;
|
|
709
758
|
|
|
710
759
|
export declare const pathMatchesRule: (path: string, rulePath: string | RegExp | string[] | undefined) => boolean;
|
|
@@ -722,7 +771,9 @@ export declare function pino(): {
|
|
|
722
771
|
} | undefined;
|
|
723
772
|
};
|
|
724
773
|
|
|
725
|
-
export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'
|
|
774
|
+
export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'> & {
|
|
775
|
+
localResolve?: boolean;
|
|
776
|
+
};
|
|
726
777
|
|
|
727
778
|
export declare function queryVectors(c: Context): Promise<Response>;
|
|
728
779
|
|
|
@@ -743,11 +794,11 @@ export declare function removeAllOptionsExceptServer(result: {
|
|
|
743
794
|
|
|
744
795
|
export declare function removeAllOptionsExceptTelemetry(result: {
|
|
745
796
|
hasCustomConfig: boolean;
|
|
746
|
-
}): PluginObj<PluginPass>;
|
|
797
|
+
}, logger: IMastraLogger): PluginObj<PluginPass>;
|
|
747
798
|
|
|
748
799
|
export declare function removeAllOptionsFromMastraExcept(result: {
|
|
749
800
|
hasCustomConfig: boolean;
|
|
750
|
-
}, option: 'telemetry' | 'server' | 'bundler'): babel_2.PluginObj;
|
|
801
|
+
}, option: 'telemetry' | 'server' | 'bundler', logger?: IMastraLogger): babel_2.PluginObj;
|
|
751
802
|
|
|
752
803
|
export declare function removeDeployer(): babel_2.PluginObj;
|
|
753
804
|
|
|
@@ -773,11 +824,18 @@ export declare function rootHandler(c: Context): Promise<Response & TypedRespons
|
|
|
773
824
|
|
|
774
825
|
export declare function saveMessagesHandler(c: Context): Promise<Response>;
|
|
775
826
|
|
|
827
|
+
export declare function saveScoreHandler(c: Context): Promise<Response>;
|
|
828
|
+
|
|
829
|
+
export declare function scoresRouter(bodyLimitOptions: BodyLimitOptions): Hono<BlankEnv, BlankSchema, "/">;
|
|
830
|
+
|
|
831
|
+
export declare function searchMemoryHandler(c: Context): Promise<Response>;
|
|
832
|
+
|
|
776
833
|
export declare function sendWorkflowRunEventHandler(c: Context): Promise<Response>;
|
|
777
834
|
|
|
778
835
|
declare type ServerBundleOptions = {
|
|
779
836
|
playground?: boolean;
|
|
780
837
|
isDev?: boolean;
|
|
838
|
+
tools: Record<string, Tool>;
|
|
781
839
|
};
|
|
782
840
|
export { ServerBundleOptions }
|
|
783
841
|
export { ServerBundleOptions as ServerBundleOptions_alias_1 }
|
|
@@ -805,6 +863,10 @@ export declare function streamGenerateHandler_alias_1(c: Context): Promise<Respo
|
|
|
805
863
|
|
|
806
864
|
export declare function streamGenerateVNextNetworkHandler(c: Context): Promise<Response>;
|
|
807
865
|
|
|
866
|
+
export declare function streamVNextGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
867
|
+
|
|
868
|
+
export declare function streamVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
869
|
+
|
|
808
870
|
export declare function streamWorkflowHandler(c: Context): Promise<Response>;
|
|
809
871
|
|
|
810
872
|
export declare function telemetryRouter(): Hono<BlankEnv, BlankSchema, "/">;
|
|
@@ -816,7 +878,7 @@ declare type TransitiveDependencyResult = {
|
|
|
816
878
|
usedWorkspacePackages: Set<string>;
|
|
817
879
|
};
|
|
818
880
|
|
|
819
|
-
export declare function tsConfigPaths({ tsConfigPath, respectCoreModule }?: PluginOptions): Plugin;
|
|
881
|
+
export declare function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve }?: PluginOptions): Plugin;
|
|
820
882
|
|
|
821
883
|
export declare function updateThreadHandler(c: Context): Promise<Response>;
|
|
822
884
|
|
|
@@ -838,7 +900,7 @@ declare type Variables = {
|
|
|
838
900
|
clients: Set<{
|
|
839
901
|
controller: ReadableStreamDefaultController;
|
|
840
902
|
}>;
|
|
841
|
-
tools: Record<string,
|
|
903
|
+
tools: Record<string, Tool_2>;
|
|
842
904
|
playground: boolean;
|
|
843
905
|
isDev: boolean;
|
|
844
906
|
};
|
|
@@ -859,12 +921,21 @@ declare type WorkspacePackageInfo = {
|
|
|
859
921
|
version: string | undefined;
|
|
860
922
|
};
|
|
861
923
|
|
|
862
|
-
export declare function writeCustomInstrumentation(entryFile: string, outputDir: string
|
|
924
|
+
export declare function writeCustomInstrumentation(entryFile: string, outputDir: string, options?: {
|
|
925
|
+
sourcemap?: boolean;
|
|
926
|
+
}): Promise<{
|
|
863
927
|
hasCustomConfig: boolean;
|
|
864
928
|
externalDependencies: string[];
|
|
865
929
|
}>;
|
|
866
930
|
|
|
867
|
-
declare function writeTelemetryConfig(entryFile
|
|
931
|
+
declare function writeTelemetryConfig({ entryFile, outputDir, options, logger, }: {
|
|
932
|
+
entryFile: string;
|
|
933
|
+
outputDir: string;
|
|
934
|
+
options: {
|
|
935
|
+
sourcemap?: boolean;
|
|
936
|
+
};
|
|
937
|
+
logger: IMastraLogger;
|
|
938
|
+
}): Promise<{
|
|
868
939
|
hasCustomConfig: boolean;
|
|
869
940
|
externalDependencies: string[];
|
|
870
941
|
}>;
|
package/dist/build/analyze.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWTGMSQT5_cjs = require('../chunk-WTGMSQT5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkWTGMSQT5_cjs.analyzeBundle; }
|
|
10
10
|
});
|
package/dist/build/analyze.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { analyzeBundle } from '../chunk-
|
|
1
|
+
export { analyzeBundle } from '../chunk-TLGEPS44.js';
|
package/dist/build/bundler.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMOG6ASL4_cjs = require('../chunk-MOG6ASL4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "createBundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkMOG6ASL4_cjs.createBundler; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "getInputOptions", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkMOG6ASL4_cjs.getInputOptions; }
|
|
14
14
|
});
|
package/dist/build/bundler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createBundler, getInputOptions } from '../chunk-
|
|
1
|
+
export { createBundler, getInputOptions } from '../chunk-HZNWZQHG.js';
|
package/dist/build/index.cjs
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkTK2RG7LU_cjs = require('../chunk-TK2RG7LU.cjs');
|
|
4
|
+
var chunkE7ZSCQUV_cjs = require('../chunk-E7ZSCQUV.cjs');
|
|
5
|
+
var chunkWTGMSQT5_cjs = require('../chunk-WTGMSQT5.cjs');
|
|
6
|
+
var chunkMOG6ASL4_cjs = require('../chunk-MOG6ASL4.cjs');
|
|
7
|
+
var chunkF25LATVR_cjs = require('../chunk-F25LATVR.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "createWatcher", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkTK2RG7LU_cjs.createWatcher; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getServerOptions", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkTK2RG7LU_cjs.getServerOptions; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getWatcherInputOptions", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkTK2RG7LU_cjs.getInputOptions; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkE7ZSCQUV_cjs.writeTelemetryConfig; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkWTGMSQT5_cjs.analyzeBundle; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "getBundlerOptions", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkWTGMSQT5_cjs.getBundlerOptions; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "createBundler", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkMOG6ASL4_cjs.createBundler; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "getBundlerInputOptions", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkMOG6ASL4_cjs.getInputOptions; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "Deps", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkF25LATVR_cjs.Deps; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "FileService", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkF25LATVR_cjs.FileService; }
|
|
50
50
|
});
|
package/dist/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-
|
|
2
|
-
export { writeTelemetryConfig } from '../chunk-
|
|
3
|
-
export { analyzeBundle, getBundlerOptions } from '../chunk-
|
|
4
|
-
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-
|
|
5
|
-
export { Deps, FileService } from '../chunk-
|
|
1
|
+
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-APPDEIPA.js';
|
|
2
|
+
export { writeTelemetryConfig } from '../chunk-NB6XIOPQ.js';
|
|
3
|
+
export { analyzeBundle, getBundlerOptions } from '../chunk-TLGEPS44.js';
|
|
4
|
+
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-HZNWZQHG.js';
|
|
5
|
+
export { Deps, FileService } from '../chunk-7HFWRNM7.js';
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkD73JIE6N_cjs = require('../chunk-D73JIE6N.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Bundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkD73JIE6N_cjs.Bundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Bundler } from '../chunk-
|
|
1
|
+
export { Bundler } from '../chunk-DB7LRMOC.js';
|
|
@@ -175,16 +175,10 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
175
175
|
logger: this.logger,
|
|
176
176
|
root: dir
|
|
177
177
|
});
|
|
178
|
-
const env = {
|
|
179
|
-
PATH: process.env.PATH
|
|
180
|
-
};
|
|
181
|
-
if (process.env.npm_config_registry) {
|
|
182
|
-
env.npm_config_registry = process.env.npm_config_registry;
|
|
183
|
-
}
|
|
184
178
|
return cpLogger({
|
|
185
179
|
cmd: runCommand,
|
|
186
180
|
args,
|
|
187
|
-
env
|
|
181
|
+
env: process.env
|
|
188
182
|
});
|
|
189
183
|
}
|
|
190
184
|
async installPackages(packages) {
|
|
@@ -2,6 +2,7 @@ import * as babel from '@babel/core';
|
|
|
2
2
|
import babel__default from '@babel/core';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path, { normalize } from 'path';
|
|
5
|
+
import resolveFrom from 'resolve-from';
|
|
5
6
|
import { createHandler } from 'typescript-paths';
|
|
6
7
|
|
|
7
8
|
// src/build/plugins/remove-deployer.ts
|
|
@@ -78,7 +79,7 @@ function removeDeployer2(mastraEntry) {
|
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
var PLUGIN_NAME = "tsconfig-paths";
|
|
81
|
-
function tsConfigPaths({ tsConfigPath, respectCoreModule } = {}) {
|
|
82
|
+
function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve } = {}) {
|
|
82
83
|
let handler;
|
|
83
84
|
return {
|
|
84
85
|
name: PLUGIN_NAME,
|
|
@@ -98,12 +99,52 @@ function tsConfigPaths({ tsConfigPath, respectCoreModule } = {}) {
|
|
|
98
99
|
}
|
|
99
100
|
const moduleName = handler?.(request, normalize(importer));
|
|
100
101
|
if (!moduleName) {
|
|
101
|
-
|
|
102
|
+
let importerMeta = {};
|
|
103
|
+
if (localResolve) {
|
|
104
|
+
const importerInfo = this.getModuleInfo(importer);
|
|
105
|
+
importerMeta = importerInfo?.meta || {};
|
|
106
|
+
if (!request.startsWith("./") && !request.startsWith("../") && importerMeta?.[PLUGIN_NAME]?.resolved) {
|
|
107
|
+
return {
|
|
108
|
+
id: resolveFrom(importer, request) ?? null,
|
|
109
|
+
external: true
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const resolved = await this.resolve(request, importer, { skipSelf: true, ...options });
|
|
114
|
+
if (!resolved) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
...resolved,
|
|
119
|
+
meta: {
|
|
120
|
+
...resolved.meta || {},
|
|
121
|
+
...importerMeta
|
|
122
|
+
}
|
|
123
|
+
};
|
|
102
124
|
}
|
|
103
125
|
if (!path.extname(moduleName)) {
|
|
104
|
-
|
|
126
|
+
const resolved = await this.resolve(moduleName, importer, { skipSelf: true, ...options });
|
|
127
|
+
if (!resolved) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
...resolved,
|
|
132
|
+
meta: {
|
|
133
|
+
...resolved.meta,
|
|
134
|
+
[PLUGIN_NAME]: {
|
|
135
|
+
resolved: true
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
105
139
|
}
|
|
106
|
-
return
|
|
140
|
+
return {
|
|
141
|
+
id: moduleName,
|
|
142
|
+
meta: {
|
|
143
|
+
[PLUGIN_NAME]: {
|
|
144
|
+
resolved: true
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
107
148
|
}
|
|
108
149
|
};
|
|
109
150
|
}
|