@mastra/core 0.7.0 → 0.8.0-alpha.1

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 (69) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.d.cts +3 -1
  3. package/dist/agent/index.d.ts +3 -1
  4. package/dist/agent/index.js +1 -1
  5. package/dist/{base-Cyl73WbV.d.ts → base-B65ZjbJw.d.ts} +100 -29
  6. package/dist/{base-C0wILuA9.d.cts → base-CYeyHJtc.d.cts} +100 -29
  7. package/dist/{chunk-ZBKJDQPM.js → chunk-5U7ZB5ID.js} +7 -0
  8. package/dist/{chunk-43SD5CUE.js → chunk-6IH4PY2A.js} +60 -6
  9. package/dist/{chunk-SMBKF6K5.js → chunk-APV5PNPE.js} +9 -0
  10. package/dist/chunk-AZEVFYZU.cjs +4609 -0
  11. package/dist/{chunk-ASFUEC75.cjs → chunk-BS2HQKYH.cjs} +61 -6
  12. package/dist/{chunk-YXJQFZOW.cjs → chunk-FKP3IMFA.cjs} +7 -0
  13. package/dist/{chunk-U7ONOIBO.cjs → chunk-G3GVZCXA.cjs} +9 -0
  14. package/dist/chunk-HWCOUI5E.js +4582 -0
  15. package/dist/{chunk-QM6WIIPM.js → chunk-TKOMVZT3.js} +1 -1
  16. package/dist/{chunk-WESJ2ZY7.cjs → chunk-TKOVKRVO.cjs} +2 -2
  17. package/dist/eval/index.d.cts +3 -1
  18. package/dist/eval/index.d.ts +3 -1
  19. package/dist/index.cjs +53 -42
  20. package/dist/index.d.cts +7 -5
  21. package/dist/index.d.ts +7 -5
  22. package/dist/index.js +6 -6
  23. package/dist/integration/index.d.cts +3 -1
  24. package/dist/integration/index.d.ts +3 -1
  25. package/dist/llm/index.d.cts +3 -1
  26. package/dist/llm/index.d.ts +3 -1
  27. package/dist/mastra/index.cjs +2 -2
  28. package/dist/mastra/index.d.cts +3 -1
  29. package/dist/mastra/index.d.ts +3 -1
  30. package/dist/mastra/index.js +1 -1
  31. package/dist/memory/index.cjs +6 -2
  32. package/dist/memory/index.d.cts +3 -1
  33. package/dist/memory/index.d.ts +3 -1
  34. package/dist/memory/index.js +1 -1
  35. package/dist/network/index.cjs +2 -2
  36. package/dist/network/index.d.cts +3 -1
  37. package/dist/network/index.d.ts +3 -1
  38. package/dist/network/index.js +1 -1
  39. package/dist/relevance/index.cjs +4 -4
  40. package/dist/relevance/index.d.cts +3 -1
  41. package/dist/relevance/index.d.ts +3 -1
  42. package/dist/relevance/index.js +1 -1
  43. package/dist/server/index.cjs +17 -0
  44. package/dist/server/index.d.cts +37 -0
  45. package/dist/server/index.d.ts +37 -0
  46. package/dist/server/index.js +15 -0
  47. package/dist/storage/index.d.cts +3 -1
  48. package/dist/storage/index.d.ts +3 -1
  49. package/dist/storage/libsql/index.d.cts +3 -1
  50. package/dist/storage/libsql/index.d.ts +3 -1
  51. package/dist/telemetry/index.d.cts +3 -1
  52. package/dist/telemetry/index.d.ts +3 -1
  53. package/dist/tools/index.d.cts +3 -1
  54. package/dist/tools/index.d.ts +3 -1
  55. package/dist/utils.d.cts +5 -3
  56. package/dist/utils.d.ts +5 -3
  57. package/dist/vector/libsql/index.cjs +3 -3
  58. package/dist/vector/libsql/index.js +1 -1
  59. package/dist/voice/index.d.cts +3 -1
  60. package/dist/voice/index.d.ts +3 -1
  61. package/dist/workflows/index.cjs +28 -20
  62. package/dist/workflows/index.d.cts +14 -5
  63. package/dist/workflows/index.d.ts +14 -5
  64. package/dist/workflows/index.js +1 -1
  65. package/package.json +4 -2
  66. package/dist/chunk-C6BBAS4I.cjs +0 -1715
  67. package/dist/chunk-GG6TEAMJ.cjs +0 -2289
  68. package/dist/chunk-R2M5CZ5U.js +0 -2264
  69. package/dist/chunk-VNQRLYIA.js +0 -1715
@@ -1,4 +1,4 @@
1
- import { az as MastraLanguageModel } from '../base-Cyl73WbV.js';
1
+ import { aD as MastraLanguageModel } from '../base-B65ZjbJw.js';
2
2
  import '../base-Cmunaaxb.js';
3
3
  import 'ai';
4
4
  import '../types-CwTG2XyQ.js';
@@ -17,6 +17,8 @@ import '../tts/index.js';
17
17
  import '@opentelemetry/sdk-trace-base';
18
18
  import '../deployer/index.js';
19
19
  import '../bundler/index.js';
20
+ import 'hono';
21
+ import 'hono-openapi';
20
22
 
21
23
  interface RelevanceScoreProvider {
22
24
  getRelevanceScore(text1: string, text2: string): Promise<number>;
@@ -1 +1 @@
1
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-QM6WIIPM.js';
1
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-TKOMVZT3.js';
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ // src/server/index.ts
4
+ function registerApiRoute(path, options) {
5
+ if (path.startsWith("/api/")) {
6
+ throw new Error(`Path must not start with "/api", it's reserved for internal API routes`);
7
+ }
8
+ return {
9
+ path,
10
+ method: options.method,
11
+ handler: options.handler,
12
+ openapi: options.openapi,
13
+ middleware: options.middleware
14
+ };
15
+ }
16
+
17
+ exports.registerApiRoute = registerApiRoute;
@@ -0,0 +1,37 @@
1
+ import { Handler, MiddlewareHandler } from 'hono';
2
+ import { DescribeRouteOptions } from 'hono-openapi';
3
+ import { g as Methods, M as Mastra, h as ApiRoute } from '../base-CYeyHJtc.cjs';
4
+ import 'ai';
5
+ import '../base-ObPJ-w8K.cjs';
6
+ import '@opentelemetry/api';
7
+ import '../index-CquI0inB.cjs';
8
+ import 'stream';
9
+ import 'pino';
10
+ import '@opentelemetry/sdk-trace-base';
11
+ import '../types-CwTG2XyQ.cjs';
12
+ import 'sift';
13
+ import 'zod';
14
+ import 'json-schema';
15
+ import 'xstate';
16
+ import 'node:events';
17
+ import '../vector/index.cjs';
18
+ import '../vector/filter/index.cjs';
19
+ import '../tts/index.cjs';
20
+ import '../deployer/index.cjs';
21
+ import '../bundler/index.cjs';
22
+
23
+ type ParamsFromPath<P extends string> = {
24
+ [K in P extends `${string}:${infer Param}/${string}` | `${string}:${infer Param}` ? Param : never]: string;
25
+ };
26
+ declare function registerApiRoute<P extends string>(path: P, options: P extends `/api/${string}` ? never : {
27
+ method: Methods;
28
+ openapi?: DescribeRouteOptions;
29
+ handler: Handler<{
30
+ Variables: {
31
+ mastra: Mastra;
32
+ };
33
+ }, P, ParamsFromPath<P>>;
34
+ middleware?: MiddlewareHandler | MiddlewareHandler[];
35
+ }): P extends `/api/${string}` ? never : ApiRoute;
36
+
37
+ export { registerApiRoute };
@@ -0,0 +1,37 @@
1
+ import { Handler, MiddlewareHandler } from 'hono';
2
+ import { DescribeRouteOptions } from 'hono-openapi';
3
+ import { g as Methods, M as Mastra, h as ApiRoute } from '../base-B65ZjbJw.js';
4
+ import 'ai';
5
+ import '../base-Cmunaaxb.js';
6
+ import '@opentelemetry/api';
7
+ import '../index-CquI0inB.js';
8
+ import 'stream';
9
+ import 'pino';
10
+ import '@opentelemetry/sdk-trace-base';
11
+ import '../types-CwTG2XyQ.js';
12
+ import 'sift';
13
+ import 'zod';
14
+ import 'json-schema';
15
+ import 'xstate';
16
+ import 'node:events';
17
+ import '../vector/index.js';
18
+ import '../vector/filter/index.js';
19
+ import '../tts/index.js';
20
+ import '../deployer/index.js';
21
+ import '../bundler/index.js';
22
+
23
+ type ParamsFromPath<P extends string> = {
24
+ [K in P extends `${string}:${infer Param}/${string}` | `${string}:${infer Param}` ? Param : never]: string;
25
+ };
26
+ declare function registerApiRoute<P extends string>(path: P, options: P extends `/api/${string}` ? never : {
27
+ method: Methods;
28
+ openapi?: DescribeRouteOptions;
29
+ handler: Handler<{
30
+ Variables: {
31
+ mastra: Mastra;
32
+ };
33
+ }, P, ParamsFromPath<P>>;
34
+ middleware?: MiddlewareHandler | MiddlewareHandler[];
35
+ }): P extends `/api/${string}` ? never : ApiRoute;
36
+
37
+ export { registerApiRoute };
@@ -0,0 +1,15 @@
1
+ // src/server/index.ts
2
+ function registerApiRoute(path, options) {
3
+ if (path.startsWith("/api/")) {
4
+ throw new Error(`Path must not start with "/api", it's reserved for internal API routes`);
5
+ }
6
+ return {
7
+ path,
8
+ method: options.method,
9
+ handler: options.handler,
10
+ openapi: options.openapi,
11
+ middleware: options.middleware
12
+ };
13
+ }
14
+
15
+ export { registerApiRoute };
@@ -1,4 +1,4 @@
1
- export { E as EvalRow, g as MastraStorage, i as StorageColumn, l as StorageGetMessagesArg, aK as TABLE_EVALS, aL as TABLE_MESSAGES, h as TABLE_NAMES, aM as TABLE_THREADS, aN as TABLE_TRACES, aJ as TABLE_WORKFLOW_SNAPSHOT, q as WorkflowRow } from '../base-C0wILuA9.cjs';
1
+ export { E as EvalRow, i as MastraStorage, k as StorageColumn, n as StorageGetMessagesArg, aO as TABLE_EVALS, aP as TABLE_MESSAGES, j as TABLE_NAMES, aQ as TABLE_THREADS, aR as TABLE_TRACES, aN as TABLE_WORKFLOW_SNAPSHOT, s as WorkflowRow } from '../base-CYeyHJtc.cjs';
2
2
  import 'ai';
3
3
  import '../base-ObPJ-w8K.cjs';
4
4
  import '@opentelemetry/api';
@@ -17,3 +17,5 @@ import '../vector/filter/index.cjs';
17
17
  import '../tts/index.cjs';
18
18
  import '../deployer/index.cjs';
19
19
  import '../bundler/index.cjs';
20
+ import 'hono';
21
+ import 'hono-openapi';
@@ -1,4 +1,4 @@
1
- export { E as EvalRow, g as MastraStorage, i as StorageColumn, l as StorageGetMessagesArg, aK as TABLE_EVALS, aL as TABLE_MESSAGES, h as TABLE_NAMES, aM as TABLE_THREADS, aN as TABLE_TRACES, aJ as TABLE_WORKFLOW_SNAPSHOT, q as WorkflowRow } from '../base-Cyl73WbV.js';
1
+ export { E as EvalRow, i as MastraStorage, k as StorageColumn, n as StorageGetMessagesArg, aO as TABLE_EVALS, aP as TABLE_MESSAGES, j as TABLE_NAMES, aQ as TABLE_THREADS, aR as TABLE_TRACES, aN as TABLE_WORKFLOW_SNAPSHOT, s as WorkflowRow } from '../base-B65ZjbJw.js';
2
2
  import 'ai';
3
3
  import '../base-Cmunaaxb.js';
4
4
  import '@opentelemetry/api';
@@ -17,3 +17,5 @@ import '../vector/filter/index.js';
17
17
  import '../tts/index.js';
18
18
  import '../deployer/index.js';
19
19
  import '../bundler/index.js';
20
+ import 'hono';
21
+ import 'hono-openapi';
@@ -1,4 +1,4 @@
1
- import { g as MastraStorage, h as TABLE_NAMES, i as StorageColumn, j as StorageThreadType, k as MessageType, l as StorageGetMessagesArg, E as EvalRow } from '../../base-C0wILuA9.cjs';
1
+ import { i as MastraStorage, j as TABLE_NAMES, k as StorageColumn, l as StorageThreadType, m as MessageType, n as StorageGetMessagesArg, E as EvalRow } from '../../base-CYeyHJtc.cjs';
2
2
  import 'ai';
3
3
  import '../../base-ObPJ-w8K.cjs';
4
4
  import '@opentelemetry/api';
@@ -17,6 +17,8 @@ import '../../vector/filter/index.cjs';
17
17
  import '../../tts/index.cjs';
18
18
  import '../../deployer/index.cjs';
19
19
  import '../../bundler/index.cjs';
20
+ import 'hono';
21
+ import 'hono-openapi';
20
22
 
21
23
  interface LibSQLConfig {
22
24
  url: string;
@@ -1,4 +1,4 @@
1
- import { g as MastraStorage, h as TABLE_NAMES, i as StorageColumn, j as StorageThreadType, k as MessageType, l as StorageGetMessagesArg, E as EvalRow } from '../../base-Cyl73WbV.js';
1
+ import { i as MastraStorage, j as TABLE_NAMES, k as StorageColumn, l as StorageThreadType, m as MessageType, n as StorageGetMessagesArg, E as EvalRow } from '../../base-B65ZjbJw.js';
2
2
  import 'ai';
3
3
  import '../../base-Cmunaaxb.js';
4
4
  import '@opentelemetry/api';
@@ -17,6 +17,8 @@ import '../../vector/filter/index.js';
17
17
  import '../../tts/index.js';
18
18
  import '../../deployer/index.js';
19
19
  import '../../bundler/index.js';
20
+ import 'hono';
21
+ import 'hono-openapi';
20
22
 
21
23
  interface LibSQLConfig {
22
24
  url: string;
@@ -3,7 +3,7 @@ import { SpanKind } from '@opentelemetry/api';
3
3
  import { ExportResult } from '@opentelemetry/core';
4
4
  import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
5
5
  import { L as Logger } from '../index-CquI0inB.cjs';
6
- import { g as MastraStorage } from '../base-C0wILuA9.cjs';
6
+ import { i as MastraStorage } from '../base-CYeyHJtc.cjs';
7
7
  import 'stream';
8
8
  import 'pino';
9
9
  import 'ai';
@@ -18,6 +18,8 @@ import '../vector/filter/index.cjs';
18
18
  import '../tts/index.cjs';
19
19
  import '../deployer/index.cjs';
20
20
  import '../bundler/index.cjs';
21
+ import 'hono';
22
+ import 'hono-openapi';
21
23
 
22
24
  declare function withSpan(options: {
23
25
  spanName?: string;
@@ -3,7 +3,7 @@ import { SpanKind } from '@opentelemetry/api';
3
3
  import { ExportResult } from '@opentelemetry/core';
4
4
  import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
5
5
  import { L as Logger } from '../index-CquI0inB.js';
6
- import { g as MastraStorage } from '../base-Cyl73WbV.js';
6
+ import { i as MastraStorage } from '../base-B65ZjbJw.js';
7
7
  import 'stream';
8
8
  import 'pino';
9
9
  import 'ai';
@@ -18,6 +18,8 @@ import '../vector/filter/index.js';
18
18
  import '../tts/index.js';
19
19
  import '../deployer/index.js';
20
20
  import '../bundler/index.js';
21
+ import 'hono';
22
+ import 'hono-openapi';
21
23
 
22
24
  declare function withSpan(options: {
23
25
  spanName?: string;
@@ -1,4 +1,4 @@
1
- export { C as CoreTool, o as Tool, T as ToolAction, n as ToolExecutionContext, V as VercelTool, $ as createTool } from '../base-C0wILuA9.cjs';
1
+ export { C as CoreTool, q as Tool, T as ToolAction, p as ToolExecutionContext, V as VercelTool, a3 as createTool } from '../base-CYeyHJtc.cjs';
2
2
  import 'ai';
3
3
  import '../base-ObPJ-w8K.cjs';
4
4
  import '@opentelemetry/api';
@@ -17,3 +17,5 @@ import '../vector/filter/index.cjs';
17
17
  import '../tts/index.cjs';
18
18
  import '../deployer/index.cjs';
19
19
  import '../bundler/index.cjs';
20
+ import 'hono';
21
+ import 'hono-openapi';
@@ -1,4 +1,4 @@
1
- export { C as CoreTool, o as Tool, T as ToolAction, n as ToolExecutionContext, V as VercelTool, $ as createTool } from '../base-Cyl73WbV.js';
1
+ export { C as CoreTool, q as Tool, T as ToolAction, p as ToolExecutionContext, V as VercelTool, a3 as createTool } from '../base-B65ZjbJw.js';
2
2
  import 'ai';
3
3
  import '../base-Cmunaaxb.js';
4
4
  import '@opentelemetry/api';
@@ -17,3 +17,5 @@ import '../vector/filter/index.js';
17
17
  import '../tts/index.js';
18
18
  import '../deployer/index.js';
19
19
  import '../bundler/index.js';
20
+ import 'hono';
21
+ import 'hono-openapi';
package/dist/utils.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { V as VercelTool, T as ToolAction, a as ToolsInput, M as Mastra, b as MastraPrimitives, c as MastraMemory, C as CoreTool, A as Agent, W as Workflow, S as Step, d as StepExecutionContext, e as WorkflowContext, f as AgentNetwork } from './base-C0wILuA9.cjs';
1
+ import { V as VercelTool, T as ToolAction, a as ToolsInput, M as Mastra, b as MastraPrimitives, c as MastraMemory, C as CoreTool, A as Agent, W as Workflow, S as Step, d as StepExecutionContext, e as WorkflowContext, f as AgentNetwork } from './base-CYeyHJtc.cjs';
2
2
  import { CoreMessage, Message } from 'ai';
3
3
  import { MastraTTS } from './tts/index.cjs';
4
4
  import { MastraVector } from './vector/index.cjs';
5
5
  import { z, ZodObject } from 'zod';
6
- import { L as Logger } from './index-CquI0inB.cjs';
7
6
  import { M as Metric } from './types-CwTG2XyQ.cjs';
7
+ import { L as Logger } from './index-CquI0inB.cjs';
8
8
  import './base-ObPJ-w8K.cjs';
9
9
  import 'sift';
10
10
  import 'json-schema';
@@ -13,6 +13,8 @@ import 'xstate';
13
13
  import 'node:events';
14
14
  import './deployer/index.cjs';
15
15
  import './bundler/index.cjs';
16
+ import 'hono';
17
+ import 'hono-openapi';
16
18
  import './vector/filter/index.cjs';
17
19
  import 'stream';
18
20
  import 'pino';
@@ -89,7 +91,7 @@ declare function makeCoreTool(tool: ToolToConvert, options: ToolOptions, logType
89
91
  declare function createMastraProxy({ mastra, logger }: {
90
92
  mastra: Mastra;
91
93
  logger: Logger;
92
- }): Mastra<Record<string, Agent<any, Record<string, Metric>>>, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger, Record<string, AgentNetwork>>;
94
+ }): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger, Record<string, AgentNetwork>>;
93
95
  declare function checkEvalStorageFields(traceObject: any, logger?: Logger): boolean;
94
96
  declare function ensureAllMessagesAreCoreMessages(messages: (CoreMessage | Message)[]): CoreMessage[];
95
97
 
package/dist/utils.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { V as VercelTool, T as ToolAction, a as ToolsInput, M as Mastra, b as MastraPrimitives, c as MastraMemory, C as CoreTool, A as Agent, W as Workflow, S as Step, d as StepExecutionContext, e as WorkflowContext, f as AgentNetwork } from './base-Cyl73WbV.js';
1
+ import { V as VercelTool, T as ToolAction, a as ToolsInput, M as Mastra, b as MastraPrimitives, c as MastraMemory, C as CoreTool, A as Agent, W as Workflow, S as Step, d as StepExecutionContext, e as WorkflowContext, f as AgentNetwork } from './base-B65ZjbJw.js';
2
2
  import { CoreMessage, Message } from 'ai';
3
3
  import { MastraTTS } from './tts/index.js';
4
4
  import { MastraVector } from './vector/index.js';
5
5
  import { z, ZodObject } from 'zod';
6
- import { L as Logger } from './index-CquI0inB.js';
7
6
  import { M as Metric } from './types-CwTG2XyQ.js';
7
+ import { L as Logger } from './index-CquI0inB.js';
8
8
  import './base-Cmunaaxb.js';
9
9
  import 'sift';
10
10
  import 'json-schema';
@@ -13,6 +13,8 @@ import 'xstate';
13
13
  import 'node:events';
14
14
  import './deployer/index.js';
15
15
  import './bundler/index.js';
16
+ import 'hono';
17
+ import 'hono-openapi';
16
18
  import './vector/filter/index.js';
17
19
  import 'stream';
18
20
  import 'pino';
@@ -89,7 +91,7 @@ declare function makeCoreTool(tool: ToolToConvert, options: ToolOptions, logType
89
91
  declare function createMastraProxy({ mastra, logger }: {
90
92
  mastra: Mastra;
91
93
  logger: Logger;
92
- }): Mastra<Record<string, Agent<any, Record<string, Metric>>>, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger, Record<string, AgentNetwork>>;
94
+ }): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger, Record<string, AgentNetwork>>;
93
95
  declare function checkEvalStorageFields(traceObject: any, logger?: Logger): boolean;
94
96
  declare function ensureAllMessagesAreCoreMessages(messages: (CoreMessage | Message)[]): CoreMessage[];
95
97
 
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkU7ONOIBO_cjs = require('../../chunk-U7ONOIBO.cjs');
3
+ var chunkG3GVZCXA_cjs = require('../../chunk-G3GVZCXA.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "DefaultVectorDB", {
8
8
  enumerable: true,
9
- get: function () { return chunkU7ONOIBO_cjs.LibSQLVector; }
9
+ get: function () { return chunkG3GVZCXA_cjs.LibSQLVector; }
10
10
  });
11
11
  Object.defineProperty(exports, "LibSQLVector", {
12
12
  enumerable: true,
13
- get: function () { return chunkU7ONOIBO_cjs.LibSQLVector; }
13
+ get: function () { return chunkG3GVZCXA_cjs.LibSQLVector; }
14
14
  });
@@ -1 +1 @@
1
- export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../../chunk-SMBKF6K5.js';
1
+ export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../../chunk-APV5PNPE.js';
@@ -1,4 +1,4 @@
1
- export { aE as CompositeVoice, aD as MastraVoice, aC as VoiceConfig, aB as VoiceEventMap, aA as VoiceEventType } from '../base-C0wILuA9.cjs';
1
+ export { aI as CompositeVoice, aH as MastraVoice, aG as VoiceConfig, aF as VoiceEventMap, aE as VoiceEventType } from '../base-CYeyHJtc.cjs';
2
2
  import 'ai';
3
3
  import '../base-ObPJ-w8K.cjs';
4
4
  import '@opentelemetry/api';
@@ -17,3 +17,5 @@ import '../vector/filter/index.cjs';
17
17
  import '../tts/index.cjs';
18
18
  import '../deployer/index.cjs';
19
19
  import '../bundler/index.cjs';
20
+ import 'hono';
21
+ import 'hono-openapi';
@@ -1,4 +1,4 @@
1
- export { aE as CompositeVoice, aD as MastraVoice, aC as VoiceConfig, aB as VoiceEventMap, aA as VoiceEventType } from '../base-Cyl73WbV.js';
1
+ export { aI as CompositeVoice, aH as MastraVoice, aG as VoiceConfig, aF as VoiceEventMap, aE as VoiceEventType } from '../base-B65ZjbJw.js';
2
2
  import 'ai';
3
3
  import '../base-Cmunaaxb.js';
4
4
  import '@opentelemetry/api';
@@ -17,3 +17,5 @@ import '../vector/filter/index.js';
17
17
  import '../tts/index.js';
18
18
  import '../deployer/index.js';
19
19
  import '../bundler/index.js';
20
+ import 'hono';
21
+ import 'hono-openapi';
@@ -1,82 +1,90 @@
1
1
  'use strict';
2
2
 
3
- var chunkGG6TEAMJ_cjs = require('../chunk-GG6TEAMJ.cjs');
3
+ var chunkAZEVFYZU_cjs = require('../chunk-AZEVFYZU.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Step", {
8
8
  enumerable: true,
9
- get: function () { return chunkGG6TEAMJ_cjs.Step; }
9
+ get: function () { return chunkAZEVFYZU_cjs.Step; }
10
10
  });
11
11
  Object.defineProperty(exports, "WhenConditionReturnValue", {
12
12
  enumerable: true,
13
- get: function () { return chunkGG6TEAMJ_cjs.WhenConditionReturnValue; }
13
+ get: function () { return chunkAZEVFYZU_cjs.WhenConditionReturnValue; }
14
14
  });
15
15
  Object.defineProperty(exports, "Workflow", {
16
16
  enumerable: true,
17
- get: function () { return chunkGG6TEAMJ_cjs.Workflow; }
17
+ get: function () { return chunkAZEVFYZU_cjs.Workflow; }
18
+ });
19
+ Object.defineProperty(exports, "agentToStep", {
20
+ enumerable: true,
21
+ get: function () { return chunkAZEVFYZU_cjs.agentToStep; }
18
22
  });
19
23
  Object.defineProperty(exports, "createStep", {
20
24
  enumerable: true,
21
- get: function () { return chunkGG6TEAMJ_cjs.createStep; }
25
+ get: function () { return chunkAZEVFYZU_cjs.createStep; }
22
26
  });
23
27
  Object.defineProperty(exports, "getActivePathsAndStatus", {
24
28
  enumerable: true,
25
- get: function () { return chunkGG6TEAMJ_cjs.getActivePathsAndStatus; }
29
+ get: function () { return chunkAZEVFYZU_cjs.getActivePathsAndStatus; }
26
30
  });
27
31
  Object.defineProperty(exports, "getResultActivePaths", {
28
32
  enumerable: true,
29
- get: function () { return chunkGG6TEAMJ_cjs.getResultActivePaths; }
33
+ get: function () { return chunkAZEVFYZU_cjs.getResultActivePaths; }
30
34
  });
31
35
  Object.defineProperty(exports, "getStepResult", {
32
36
  enumerable: true,
33
- get: function () { return chunkGG6TEAMJ_cjs.getStepResult; }
37
+ get: function () { return chunkAZEVFYZU_cjs.getStepResult; }
34
38
  });
35
39
  Object.defineProperty(exports, "getSuspendedPaths", {
36
40
  enumerable: true,
37
- get: function () { return chunkGG6TEAMJ_cjs.getSuspendedPaths; }
41
+ get: function () { return chunkAZEVFYZU_cjs.getSuspendedPaths; }
42
+ });
43
+ Object.defineProperty(exports, "isAgent", {
44
+ enumerable: true,
45
+ get: function () { return chunkAZEVFYZU_cjs.isAgent; }
38
46
  });
39
47
  Object.defineProperty(exports, "isErrorEvent", {
40
48
  enumerable: true,
41
- get: function () { return chunkGG6TEAMJ_cjs.isErrorEvent; }
49
+ get: function () { return chunkAZEVFYZU_cjs.isErrorEvent; }
42
50
  });
43
51
  Object.defineProperty(exports, "isFinalState", {
44
52
  enumerable: true,
45
- get: function () { return chunkGG6TEAMJ_cjs.isFinalState; }
53
+ get: function () { return chunkAZEVFYZU_cjs.isFinalState; }
46
54
  });
47
55
  Object.defineProperty(exports, "isLimboState", {
48
56
  enumerable: true,
49
- get: function () { return chunkGG6TEAMJ_cjs.isLimboState; }
57
+ get: function () { return chunkAZEVFYZU_cjs.isLimboState; }
50
58
  });
51
59
  Object.defineProperty(exports, "isTransitionEvent", {
52
60
  enumerable: true,
53
- get: function () { return chunkGG6TEAMJ_cjs.isTransitionEvent; }
61
+ get: function () { return chunkAZEVFYZU_cjs.isTransitionEvent; }
54
62
  });
55
63
  Object.defineProperty(exports, "isVariableReference", {
56
64
  enumerable: true,
57
- get: function () { return chunkGG6TEAMJ_cjs.isVariableReference; }
65
+ get: function () { return chunkAZEVFYZU_cjs.isVariableReference; }
58
66
  });
59
67
  Object.defineProperty(exports, "isWorkflow", {
60
68
  enumerable: true,
61
- get: function () { return chunkGG6TEAMJ_cjs.isWorkflow; }
69
+ get: function () { return chunkAZEVFYZU_cjs.isWorkflow; }
62
70
  });
63
71
  Object.defineProperty(exports, "mergeChildValue", {
64
72
  enumerable: true,
65
- get: function () { return chunkGG6TEAMJ_cjs.mergeChildValue; }
73
+ get: function () { return chunkAZEVFYZU_cjs.mergeChildValue; }
66
74
  });
67
75
  Object.defineProperty(exports, "recursivelyCheckForFinalState", {
68
76
  enumerable: true,
69
- get: function () { return chunkGG6TEAMJ_cjs.recursivelyCheckForFinalState; }
77
+ get: function () { return chunkAZEVFYZU_cjs.recursivelyCheckForFinalState; }
70
78
  });
71
79
  Object.defineProperty(exports, "resolveVariables", {
72
80
  enumerable: true,
73
- get: function () { return chunkGG6TEAMJ_cjs.resolveVariables; }
81
+ get: function () { return chunkAZEVFYZU_cjs.resolveVariables; }
74
82
  });
75
83
  Object.defineProperty(exports, "updateStepInHierarchy", {
76
84
  enumerable: true,
77
- get: function () { return chunkGG6TEAMJ_cjs.updateStepInHierarchy; }
85
+ get: function () { return chunkAZEVFYZU_cjs.updateStepInHierarchy; }
78
86
  });
79
87
  Object.defineProperty(exports, "workflowToStep", {
80
88
  enumerable: true,
81
- get: function () { return chunkGG6TEAMJ_cjs.workflowToStep; }
89
+ get: function () { return chunkAZEVFYZU_cjs.workflowToStep; }
82
90
  });
@@ -1,10 +1,10 @@
1
- import { a5 as VariableReference, ac as StepResult, S as Step, W as Workflow, e as WorkflowContext, M as Mastra, a0 as StepAction, ae as WorkflowRunResult } from '../base-C0wILuA9.cjs';
2
- export { a7 as ActionContext, a6 as BaseCondition, ak as DependencyCheckOutput, ar as ExtractSchemaFromStep, au as ExtractSchemaType, as as ExtractStepResult, av as PathsToStringProps, ah as ResolverFunctionInput, ai as ResolverFunctionOutput, a4 as RetryConfig, aa as StepCondition, ab as StepConfig, a9 as StepDef, d as StepExecutionContext, a3 as StepGraph, aq as StepId, at as StepInputType, a2 as StepNode, al as StepResolverOutput, a1 as StepVariableType, ad as StepsRecord, aj as SubscriberFunctionOutput, a8 as WhenConditionReturnValue, an as WorkflowActionParams, ao as WorkflowActions, am as WorkflowActors, ag as WorkflowEvent, af as WorkflowLogMessage, p as WorkflowOptions, ax as WorkflowResumeResult, aw as WorkflowRunState, ap as WorkflowState, ay as createStep } from '../base-C0wILuA9.cjs';
1
+ import { a9 as VariableReference, ag as StepResult, S as Step, W as Workflow, A as Agent, e as WorkflowContext, a as ToolsInput, a4 as StepAction, M as Mastra, ai as WorkflowRunResult } from '../base-CYeyHJtc.cjs';
2
+ export { ab as ActionContext, aa as BaseCondition, ao as DependencyCheckOutput, av as ExtractSchemaFromStep, ay as ExtractSchemaType, aw as ExtractStepResult, az as PathsToStringProps, al as ResolverFunctionInput, am as ResolverFunctionOutput, a8 as RetryConfig, ae as StepCondition, af as StepConfig, ad as StepDef, d as StepExecutionContext, a7 as StepGraph, au as StepId, ax as StepInputType, a6 as StepNode, ap as StepResolverOutput, a5 as StepVariableType, ah as StepsRecord, an as SubscriberFunctionOutput, ac as WhenConditionReturnValue, ar as WorkflowActionParams, as as WorkflowActions, aq as WorkflowActors, ak as WorkflowEvent, aj as WorkflowLogMessage, r as WorkflowOptions, aB as WorkflowResumeResult, aA as WorkflowRunState, at as WorkflowState, aC as createStep } from '../base-CYeyHJtc.cjs';
3
3
  import { z } from 'zod';
4
+ import { M as Metric } from '../types-CwTG2XyQ.cjs';
4
5
  import { L as Logger } from '../index-CquI0inB.cjs';
5
6
  import '../base-ObPJ-w8K.cjs';
6
7
  import 'ai';
7
- import '../types-CwTG2XyQ.cjs';
8
8
  import 'sift';
9
9
  import 'json-schema';
10
10
  import '@opentelemetry/api';
@@ -18,6 +18,8 @@ import '@opentelemetry/sdk-trace-base';
18
18
  import '../tts/index.cjs';
19
19
  import '../deployer/index.cjs';
20
20
  import '../bundler/index.cjs';
21
+ import 'hono';
22
+ import 'hono-openapi';
21
23
 
22
24
  declare function isErrorEvent(stateEvent: any): stateEvent is {
23
25
  type: `xstate.error.actor.${string}`;
@@ -56,16 +58,23 @@ declare function getResultActivePaths(state: {
56
58
  }): Map<string, {
57
59
  status: string;
58
60
  suspendPayload?: any;
61
+ stepPath: string[];
59
62
  }>;
60
- declare function isWorkflow(step: Step<any, any, any, any> | Workflow<any, any, any, any>): step is Workflow<any, any, any, any>;
63
+ declare function isWorkflow(step: Step<any, any, any, any> | Workflow<any, any, any, any> | Agent<any, any, any>): step is Workflow<any, any, any, any>;
64
+ declare function isAgent(step: Step<any, any, any, any> | Agent<any, any, any> | Workflow<any, any, any, any>): step is Agent<any, any, any>;
61
65
  declare function resolveVariables<TSteps extends Step<any, any, any>[]>({ runId, logger, variables, context, }: {
62
66
  runId: string;
63
67
  logger: Logger;
64
68
  variables: Record<string, VariableReference<any, any>>;
65
69
  context: WorkflowContext;
66
70
  }): Record<string, any>;
71
+ declare function agentToStep<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>>(agent: Agent<TAgentId, TTools, TMetrics>): StepAction<TAgentId, z.ZodObject<{
72
+ prompt: z.ZodString;
73
+ }>, z.ZodObject<{
74
+ text: z.ZodString;
75
+ }>, any>;
67
76
  declare function workflowToStep<TSteps extends Step<any, any, any, any>[], TStepId extends string = any, TTriggerSchema extends z.ZodObject<any> = any, TResultSchema extends z.ZodObject<any> = any>(workflow: Workflow<TSteps, TStepId, TTriggerSchema, TResultSchema>, { mastra }: {
68
77
  mastra?: Mastra;
69
78
  }): StepAction<TStepId, TTriggerSchema, z.ZodType<WorkflowRunResult<TTriggerSchema, TSteps, TResultSchema>>, any>;
70
79
 
71
- export { Step, StepAction, StepResult, VariableReference, Workflow, WorkflowContext, WorkflowRunResult, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep };
80
+ export { Step, StepAction, StepResult, VariableReference, Workflow, WorkflowContext, WorkflowRunResult, agentToStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isAgent, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep };
@@ -1,10 +1,10 @@
1
- import { a5 as VariableReference, ac as StepResult, S as Step, W as Workflow, e as WorkflowContext, M as Mastra, a0 as StepAction, ae as WorkflowRunResult } from '../base-Cyl73WbV.js';
2
- export { a7 as ActionContext, a6 as BaseCondition, ak as DependencyCheckOutput, ar as ExtractSchemaFromStep, au as ExtractSchemaType, as as ExtractStepResult, av as PathsToStringProps, ah as ResolverFunctionInput, ai as ResolverFunctionOutput, a4 as RetryConfig, aa as StepCondition, ab as StepConfig, a9 as StepDef, d as StepExecutionContext, a3 as StepGraph, aq as StepId, at as StepInputType, a2 as StepNode, al as StepResolverOutput, a1 as StepVariableType, ad as StepsRecord, aj as SubscriberFunctionOutput, a8 as WhenConditionReturnValue, an as WorkflowActionParams, ao as WorkflowActions, am as WorkflowActors, ag as WorkflowEvent, af as WorkflowLogMessage, p as WorkflowOptions, ax as WorkflowResumeResult, aw as WorkflowRunState, ap as WorkflowState, ay as createStep } from '../base-Cyl73WbV.js';
1
+ import { a9 as VariableReference, ag as StepResult, S as Step, W as Workflow, A as Agent, e as WorkflowContext, a as ToolsInput, a4 as StepAction, M as Mastra, ai as WorkflowRunResult } from '../base-B65ZjbJw.js';
2
+ export { ab as ActionContext, aa as BaseCondition, ao as DependencyCheckOutput, av as ExtractSchemaFromStep, ay as ExtractSchemaType, aw as ExtractStepResult, az as PathsToStringProps, al as ResolverFunctionInput, am as ResolverFunctionOutput, a8 as RetryConfig, ae as StepCondition, af as StepConfig, ad as StepDef, d as StepExecutionContext, a7 as StepGraph, au as StepId, ax as StepInputType, a6 as StepNode, ap as StepResolverOutput, a5 as StepVariableType, ah as StepsRecord, an as SubscriberFunctionOutput, ac as WhenConditionReturnValue, ar as WorkflowActionParams, as as WorkflowActions, aq as WorkflowActors, ak as WorkflowEvent, aj as WorkflowLogMessage, r as WorkflowOptions, aB as WorkflowResumeResult, aA as WorkflowRunState, at as WorkflowState, aC as createStep } from '../base-B65ZjbJw.js';
3
3
  import { z } from 'zod';
4
+ import { M as Metric } from '../types-CwTG2XyQ.js';
4
5
  import { L as Logger } from '../index-CquI0inB.js';
5
6
  import '../base-Cmunaaxb.js';
6
7
  import 'ai';
7
- import '../types-CwTG2XyQ.js';
8
8
  import 'sift';
9
9
  import 'json-schema';
10
10
  import '@opentelemetry/api';
@@ -18,6 +18,8 @@ import '@opentelemetry/sdk-trace-base';
18
18
  import '../tts/index.js';
19
19
  import '../deployer/index.js';
20
20
  import '../bundler/index.js';
21
+ import 'hono';
22
+ import 'hono-openapi';
21
23
 
22
24
  declare function isErrorEvent(stateEvent: any): stateEvent is {
23
25
  type: `xstate.error.actor.${string}`;
@@ -56,16 +58,23 @@ declare function getResultActivePaths(state: {
56
58
  }): Map<string, {
57
59
  status: string;
58
60
  suspendPayload?: any;
61
+ stepPath: string[];
59
62
  }>;
60
- declare function isWorkflow(step: Step<any, any, any, any> | Workflow<any, any, any, any>): step is Workflow<any, any, any, any>;
63
+ declare function isWorkflow(step: Step<any, any, any, any> | Workflow<any, any, any, any> | Agent<any, any, any>): step is Workflow<any, any, any, any>;
64
+ declare function isAgent(step: Step<any, any, any, any> | Agent<any, any, any> | Workflow<any, any, any, any>): step is Agent<any, any, any>;
61
65
  declare function resolveVariables<TSteps extends Step<any, any, any>[]>({ runId, logger, variables, context, }: {
62
66
  runId: string;
63
67
  logger: Logger;
64
68
  variables: Record<string, VariableReference<any, any>>;
65
69
  context: WorkflowContext;
66
70
  }): Record<string, any>;
71
+ declare function agentToStep<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>>(agent: Agent<TAgentId, TTools, TMetrics>): StepAction<TAgentId, z.ZodObject<{
72
+ prompt: z.ZodString;
73
+ }>, z.ZodObject<{
74
+ text: z.ZodString;
75
+ }>, any>;
67
76
  declare function workflowToStep<TSteps extends Step<any, any, any, any>[], TStepId extends string = any, TTriggerSchema extends z.ZodObject<any> = any, TResultSchema extends z.ZodObject<any> = any>(workflow: Workflow<TSteps, TStepId, TTriggerSchema, TResultSchema>, { mastra }: {
68
77
  mastra?: Mastra;
69
78
  }): StepAction<TStepId, TTriggerSchema, z.ZodType<WorkflowRunResult<TTriggerSchema, TSteps, TResultSchema>>, any>;
70
79
 
71
- export { Step, StepAction, StepResult, VariableReference, Workflow, WorkflowContext, WorkflowRunResult, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep };
80
+ export { Step, StepAction, StepResult, VariableReference, Workflow, WorkflowContext, WorkflowRunResult, agentToStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isAgent, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep };
@@ -1 +1 @@
1
- export { Step, WhenConditionReturnValue, Workflow, createStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep } from '../chunk-R2M5CZ5U.js';
1
+ export { Step, WhenConditionReturnValue, Workflow, agentToStep, createStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isAgent, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep } from '../chunk-HWCOUI5E.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-alpha.1",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -107,13 +107,15 @@
107
107
  "@opentelemetry/sdk-trace-base": "^1.30.1",
108
108
  "@opentelemetry/sdk-trace-node": "^1.30.1",
109
109
  "@opentelemetry/semantic-conventions": "^1.30.0",
110
- "ai": "^4.1.54",
110
+ "ai": "^4.2.2",
111
111
  "cohere-ai": "^7.16.0",
112
112
  "date-fns": "^3.6.0",
113
113
  "dotenv": "^16.4.7",
114
114
  "fastembed": "^1.14.1",
115
115
  "json-schema": "^0.4.0",
116
116
  "json-schema-to-zod": "^2.6.0",
117
+ "hono": "^4.5.1",
118
+ "hono-openapi": "^0.4.6",
117
119
  "pino": "^9.6.0",
118
120
  "pino-pretty": "^13.0.0",
119
121
  "radash": "^12.1.0",