@mastra/core 0.9.4 → 0.10.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 (168) hide show
  1. package/README.md +3 -2
  2. package/dist/agent/index.cjs +2 -2
  3. package/dist/agent/index.d.cts +13 -14
  4. package/dist/agent/index.d.ts +13 -14
  5. package/dist/agent/index.js +1 -1
  6. package/dist/{base-BCfssGt6.d.ts → base-DttB7sJD.d.ts} +1187 -886
  7. package/dist/{base-CAEcd6q2.d.cts → base-aJ3etsh5.d.cts} +1187 -886
  8. package/dist/{base-H7siSAfu.d.cts → base-aPYtPBT2.d.cts} +3 -3
  9. package/dist/{base-4Z34GQL8.d.ts → base-tc5kgDTD.d.ts} +3 -3
  10. package/dist/base.cjs +2 -2
  11. package/dist/base.d.cts +2 -3
  12. package/dist/base.d.ts +2 -3
  13. package/dist/base.js +1 -1
  14. package/dist/bundler/index.cjs +2 -2
  15. package/dist/bundler/index.d.cts +2 -3
  16. package/dist/bundler/index.d.ts +2 -3
  17. package/dist/bundler/index.js +1 -1
  18. package/dist/{chunk-W4BSLENO.js → chunk-2NTUAUGH.js} +1 -1
  19. package/dist/{chunk-S34QVMKE.js → chunk-2PW6UJMW.js} +77 -10
  20. package/dist/{chunk-WE36CRQV.cjs → chunk-2U7ZZUFO.cjs} +2 -2
  21. package/dist/{workflows/vNext/index.js → chunk-3SQ3G2EJ.js} +19 -16
  22. package/dist/chunk-5HULBQ2W.cjs +38 -0
  23. package/dist/{chunk-XRGDVLM4.cjs → chunk-5JRD3NDP.cjs} +15 -15
  24. package/dist/{chunk-GXKODTLA.cjs → chunk-5W2G7S44.cjs} +83 -68
  25. package/dist/chunk-75Z4BZEE.js +36 -0
  26. package/dist/{chunk-66GQROSI.cjs → chunk-AOGUTJUO.cjs} +58 -51
  27. package/dist/{chunk-WIKOYZ63.js → chunk-BPTSLJHA.js} +9 -9
  28. package/dist/{chunk-JBJ7KXN5.js → chunk-C3ICEF6E.js} +1 -1
  29. package/dist/{chunk-E4FAXBUV.cjs → chunk-CWSFP2HS.cjs} +2 -2
  30. package/dist/{chunk-FW5RS6WV.js → chunk-E7CLY6SK.js} +42 -35
  31. package/dist/{chunk-235X76GC.js → chunk-FI7R232B.js} +2 -2
  32. package/dist/chunk-GQ2XQ4UN.js +321 -0
  33. package/dist/{chunk-H4CEZSRM.js → chunk-J7GDGV6F.js} +1 -1
  34. package/dist/{chunk-NLBJOFNG.js → chunk-JW5TMK2L.js} +1 -1
  35. package/dist/{chunk-NOPY74PV.js → chunk-KJQFFEEQ.js} +1 -1
  36. package/dist/{chunk-V2Q2FEVO.cjs → chunk-KSPHQSZX.cjs} +2 -2
  37. package/dist/{chunk-NZV4OA6P.js → chunk-LHRZV5VG.js} +2 -23
  38. package/dist/chunk-NMDM4IZN.cjs +78 -0
  39. package/dist/chunk-OBEALYTK.js +74 -0
  40. package/dist/{chunk-PEK4TY3P.js → chunk-OCT2762Q.js} +1 -1
  41. package/dist/{chunk-5DUFC7TV.cjs → chunk-P7BGXOQV.cjs} +2 -2
  42. package/dist/{chunk-WQKOM7XM.cjs → chunk-PIZM25KI.cjs} +3 -24
  43. package/dist/{chunk-S7J63JOG.cjs → chunk-RVS6OUJN.cjs} +2 -2
  44. package/dist/{chunk-5JUWUTPJ.cjs → chunk-SKG2NIZW.cjs} +2 -2
  45. package/dist/chunk-SWW4EBUZ.cjs +96 -0
  46. package/dist/{chunk-RGE4UF6A.cjs → chunk-TMPFLJLG.cjs} +2 -2
  47. package/dist/{workflows/vNext/index.cjs → chunk-TTKQ37ZZ.cjs} +24 -21
  48. package/dist/{chunk-EJITEVAB.cjs → chunk-U3L3NEOM.cjs} +81 -10
  49. package/dist/chunk-VHLL4AZK.js +90 -0
  50. package/dist/{chunk-EG74VBSP.cjs → chunk-YEULQPUY.cjs} +6 -6
  51. package/dist/{chunk-SOLXHDNQ.js → chunk-ZB3LEHL2.js} +81 -66
  52. package/dist/{chunk-TAFOICHR.js → chunk-ZKN6HYYQ.js} +1 -1
  53. package/dist/chunk-ZZDAC5KD.cjs +325 -0
  54. package/dist/deployer/index.cjs +2 -2
  55. package/dist/deployer/index.d.cts +2 -3
  56. package/dist/deployer/index.d.ts +2 -3
  57. package/dist/deployer/index.js +1 -1
  58. package/dist/eval/index.d.cts +13 -14
  59. package/dist/eval/index.d.ts +13 -14
  60. package/dist/hooks/index.d.cts +1 -1
  61. package/dist/hooks/index.d.ts +1 -1
  62. package/dist/index.cjs +88 -159
  63. package/dist/index.d.cts +17 -25
  64. package/dist/index.d.ts +17 -25
  65. package/dist/index.js +18 -25
  66. package/dist/integration/index.cjs +3 -3
  67. package/dist/integration/index.d.cts +12 -13
  68. package/dist/integration/index.d.ts +12 -13
  69. package/dist/integration/index.js +1 -1
  70. package/dist/llm/index.d.cts +13 -14
  71. package/dist/llm/index.d.ts +13 -14
  72. package/dist/logger/index.cjs +18 -17
  73. package/dist/logger/index.d.cts +42 -2
  74. package/dist/logger/index.d.ts +42 -2
  75. package/dist/logger/index.js +2 -1
  76. package/dist/{index-QV27jkxQ.d.ts → logger-EhZkzZOr.d.cts} +38 -52
  77. package/dist/{index-QV27jkxQ.d.cts → logger-EhZkzZOr.d.ts} +38 -52
  78. package/dist/mastra/index.cjs +2 -2
  79. package/dist/mastra/index.d.cts +11 -12
  80. package/dist/mastra/index.d.ts +11 -12
  81. package/dist/mastra/index.js +1 -1
  82. package/dist/mcp/index.cjs +75 -17
  83. package/dist/mcp/index.d.cts +14 -15
  84. package/dist/mcp/index.d.ts +14 -15
  85. package/dist/mcp/index.js +69 -15
  86. package/dist/memory/index.cjs +4 -4
  87. package/dist/memory/index.d.cts +12 -13
  88. package/dist/memory/index.d.ts +12 -13
  89. package/dist/memory/index.js +1 -1
  90. package/dist/network/index.cjs +8 -8
  91. package/dist/network/index.d.cts +12 -13
  92. package/dist/network/index.d.ts +12 -13
  93. package/dist/network/index.js +5 -5
  94. package/dist/relevance/index.cjs +4 -4
  95. package/dist/relevance/index.d.cts +15 -16
  96. package/dist/relevance/index.d.ts +15 -16
  97. package/dist/relevance/index.js +1 -1
  98. package/dist/server/index.cjs +4 -0
  99. package/dist/server/index.d.cts +13 -12
  100. package/dist/server/index.d.ts +13 -12
  101. package/dist/server/index.js +4 -1
  102. package/dist/storage/index.cjs +184 -3
  103. package/dist/storage/index.d.cts +83 -13
  104. package/dist/storage/index.d.ts +83 -13
  105. package/dist/storage/index.js +186 -1
  106. package/dist/telemetry/index.d.cts +14 -15
  107. package/dist/telemetry/index.d.ts +14 -15
  108. package/dist/telemetry/otel-vendor.cjs +2 -2
  109. package/dist/telemetry/otel-vendor.d.cts +1 -1
  110. package/dist/telemetry/otel-vendor.d.ts +1 -1
  111. package/dist/telemetry/otel-vendor.js +1 -1
  112. package/dist/tools/index.cjs +4 -4
  113. package/dist/tools/index.d.cts +12 -13
  114. package/dist/tools/index.d.ts +12 -13
  115. package/dist/tools/index.js +1 -1
  116. package/dist/tts/index.cjs +2 -2
  117. package/dist/tts/index.d.cts +2 -3
  118. package/dist/tts/index.d.ts +2 -3
  119. package/dist/tts/index.js +1 -1
  120. package/dist/{types-BtMyV38I.d.ts → types-Bo1uigWx.d.cts} +1 -1
  121. package/dist/{types-BtMyV38I.d.cts → types-Bo1uigWx.d.ts} +1 -1
  122. package/dist/utils.cjs +28 -12
  123. package/dist/utils.d.cts +59 -16
  124. package/dist/utils.d.ts +59 -16
  125. package/dist/utils.js +1 -1
  126. package/dist/vector/filter/index.cjs +189 -7
  127. package/dist/vector/filter/index.js +190 -1
  128. package/dist/vector/index.cjs +2 -2
  129. package/dist/vector/index.d.cts +28 -20
  130. package/dist/vector/index.d.ts +28 -20
  131. package/dist/vector/index.js +1 -1
  132. package/dist/voice/index.cjs +4 -4
  133. package/dist/voice/index.d.cts +12 -13
  134. package/dist/voice/index.d.ts +12 -13
  135. package/dist/voice/index.js +1 -1
  136. package/dist/workflows/index.cjs +17 -69
  137. package/dist/workflows/index.d.cts +197 -77
  138. package/dist/workflows/index.d.ts +197 -77
  139. package/dist/workflows/index.js +1 -1
  140. package/dist/workflows/legacy/index.cjs +90 -0
  141. package/dist/workflows/legacy/index.d.cts +87 -0
  142. package/dist/workflows/legacy/index.d.ts +87 -0
  143. package/dist/workflows/legacy/index.js +1 -0
  144. package/package.json +19 -40
  145. package/workflows/legacy.d.ts +1 -0
  146. package/dist/chunk-4WABQORE.js +0 -781
  147. package/dist/chunk-CIEPFV6B.js +0 -658
  148. package/dist/chunk-CMPPXW4U.js +0 -154
  149. package/dist/chunk-CTKNWYK2.js +0 -131
  150. package/dist/chunk-LGERQTJM.js +0 -190
  151. package/dist/chunk-O44MSFMZ.cjs +0 -168
  152. package/dist/chunk-QDAMIZY3.cjs +0 -783
  153. package/dist/chunk-QHDPLMHB.cjs +0 -667
  154. package/dist/chunk-RAQBTCIR.cjs +0 -134
  155. package/dist/chunk-YK3XJ52U.cjs +0 -192
  156. package/dist/storage/libsql/index.cjs +0 -581
  157. package/dist/storage/libsql/index.d.cts +0 -104
  158. package/dist/storage/libsql/index.d.ts +0 -104
  159. package/dist/storage/libsql/index.js +0 -578
  160. package/dist/vector/libsql/index.cjs +0 -14
  161. package/dist/vector/libsql/index.d.cts +0 -82
  162. package/dist/vector/libsql/index.d.ts +0 -82
  163. package/dist/vector/libsql/index.js +0 -1
  164. package/dist/workflows/vNext/index.d.cts +0 -209
  165. package/dist/workflows/vNext/index.d.ts +0 -209
  166. package/storage/libsql.d.ts +0 -1
  167. package/vector/libsql.d.ts +0 -1
  168. package/workflows/vNext.d.ts +0 -1
@@ -1,82 +0,0 @@
1
- import { VectorFilter } from '../filter/index.cjs';
2
- import { MastraVector, ParamsToArgs, QueryVectorParams, QueryVectorArgs, QueryResult, UpsertVectorParams, CreateIndexParams, IndexStats } from '../index.cjs';
3
- import '../../base-H7siSAfu.cjs';
4
- import '@opentelemetry/api';
5
- import '../../index-QV27jkxQ.cjs';
6
- import 'stream';
7
- import 'pino';
8
- import '@opentelemetry/sdk-trace-base';
9
-
10
- interface LibSQLQueryParams extends QueryVectorParams {
11
- minScore?: number;
12
- }
13
- type LibSQLQueryArgs = [...QueryVectorArgs, number?];
14
- declare class LibSQLVector extends MastraVector {
15
- private turso;
16
- constructor({ connectionUrl, authToken, syncUrl, syncInterval, }: {
17
- connectionUrl: string;
18
- authToken?: string;
19
- syncUrl?: string;
20
- syncInterval?: number;
21
- });
22
- protected rewriteDbUrl(url: string): string;
23
- transformFilter(filter?: VectorFilter): VectorFilter;
24
- query(...args: ParamsToArgs<LibSQLQueryParams> | LibSQLQueryArgs): Promise<QueryResult[]>;
25
- upsert(...args: ParamsToArgs<UpsertVectorParams>): Promise<string[]>;
26
- createIndex(...args: ParamsToArgs<CreateIndexParams>): Promise<void>;
27
- deleteIndex(indexName: string): Promise<void>;
28
- listIndexes(): Promise<string[]>;
29
- describeIndex(indexName: string): Promise<IndexStats>;
30
- /**
31
- * @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
32
- *
33
- * Updates a vector by its ID with the provided vector and/or metadata.
34
- * @param indexName - The name of the index containing the vector.
35
- * @param id - The ID of the vector to update.
36
- * @param update - An object containing the vector and/or metadata to update.
37
- * @param update.vector - An optional array of numbers representing the new vector.
38
- * @param update.metadata - An optional record containing the new metadata.
39
- * @returns A promise that resolves when the update is complete.
40
- * @throws Will throw an error if no updates are provided or if the update operation fails.
41
- */
42
- updateIndexById(indexName: string, id: string, update: {
43
- vector?: number[];
44
- metadata?: Record<string, any>;
45
- }): Promise<void>;
46
- /**
47
- * Updates a vector by its ID with the provided vector and/or metadata.
48
- *
49
- * @param indexName - The name of the index containing the vector.
50
- * @param id - The ID of the vector to update.
51
- * @param update - An object containing the vector and/or metadata to update.
52
- * @param update.vector - An optional array of numbers representing the new vector.
53
- * @param update.metadata - An optional record containing the new metadata.
54
- * @returns A promise that resolves when the update is complete.
55
- * @throws Will throw an error if no updates are provided or if the update operation fails.
56
- */
57
- updateVector(indexName: string, id: string, update: {
58
- vector?: number[];
59
- metadata?: Record<string, any>;
60
- }): Promise<void>;
61
- /**
62
- * @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
63
- *
64
- * Deletes a vector by its ID.
65
- * @param indexName - The name of the index containing the vector.
66
- * @param id - The ID of the vector to delete.
67
- * @returns A promise that resolves when the deletion is complete.
68
- * @throws Will throw an error if the deletion operation fails.
69
- */
70
- deleteIndexById(indexName: string, id: string): Promise<void>;
71
- /**
72
- * Deletes a vector by its ID.
73
- * @param indexName - The name of the index containing the vector.
74
- * @param id - The ID of the vector to delete.
75
- * @returns A promise that resolves when the deletion is complete.
76
- * @throws Will throw an error if the deletion operation fails.
77
- */
78
- deleteVector(indexName: string, id: string): Promise<void>;
79
- truncateIndex(indexName: string): Promise<void>;
80
- }
81
-
82
- export { LibSQLVector as DefaultVectorDB, LibSQLVector };
@@ -1,82 +0,0 @@
1
- import { VectorFilter } from '../filter/index.js';
2
- import { MastraVector, ParamsToArgs, QueryVectorParams, QueryVectorArgs, QueryResult, UpsertVectorParams, CreateIndexParams, IndexStats } from '../index.js';
3
- import '../../base-4Z34GQL8.js';
4
- import '@opentelemetry/api';
5
- import '../../index-QV27jkxQ.js';
6
- import 'stream';
7
- import 'pino';
8
- import '@opentelemetry/sdk-trace-base';
9
-
10
- interface LibSQLQueryParams extends QueryVectorParams {
11
- minScore?: number;
12
- }
13
- type LibSQLQueryArgs = [...QueryVectorArgs, number?];
14
- declare class LibSQLVector extends MastraVector {
15
- private turso;
16
- constructor({ connectionUrl, authToken, syncUrl, syncInterval, }: {
17
- connectionUrl: string;
18
- authToken?: string;
19
- syncUrl?: string;
20
- syncInterval?: number;
21
- });
22
- protected rewriteDbUrl(url: string): string;
23
- transformFilter(filter?: VectorFilter): VectorFilter;
24
- query(...args: ParamsToArgs<LibSQLQueryParams> | LibSQLQueryArgs): Promise<QueryResult[]>;
25
- upsert(...args: ParamsToArgs<UpsertVectorParams>): Promise<string[]>;
26
- createIndex(...args: ParamsToArgs<CreateIndexParams>): Promise<void>;
27
- deleteIndex(indexName: string): Promise<void>;
28
- listIndexes(): Promise<string[]>;
29
- describeIndex(indexName: string): Promise<IndexStats>;
30
- /**
31
- * @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
32
- *
33
- * Updates a vector by its ID with the provided vector and/or metadata.
34
- * @param indexName - The name of the index containing the vector.
35
- * @param id - The ID of the vector to update.
36
- * @param update - An object containing the vector and/or metadata to update.
37
- * @param update.vector - An optional array of numbers representing the new vector.
38
- * @param update.metadata - An optional record containing the new metadata.
39
- * @returns A promise that resolves when the update is complete.
40
- * @throws Will throw an error if no updates are provided or if the update operation fails.
41
- */
42
- updateIndexById(indexName: string, id: string, update: {
43
- vector?: number[];
44
- metadata?: Record<string, any>;
45
- }): Promise<void>;
46
- /**
47
- * Updates a vector by its ID with the provided vector and/or metadata.
48
- *
49
- * @param indexName - The name of the index containing the vector.
50
- * @param id - The ID of the vector to update.
51
- * @param update - An object containing the vector and/or metadata to update.
52
- * @param update.vector - An optional array of numbers representing the new vector.
53
- * @param update.metadata - An optional record containing the new metadata.
54
- * @returns A promise that resolves when the update is complete.
55
- * @throws Will throw an error if no updates are provided or if the update operation fails.
56
- */
57
- updateVector(indexName: string, id: string, update: {
58
- vector?: number[];
59
- metadata?: Record<string, any>;
60
- }): Promise<void>;
61
- /**
62
- * @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
63
- *
64
- * Deletes a vector by its ID.
65
- * @param indexName - The name of the index containing the vector.
66
- * @param id - The ID of the vector to delete.
67
- * @returns A promise that resolves when the deletion is complete.
68
- * @throws Will throw an error if the deletion operation fails.
69
- */
70
- deleteIndexById(indexName: string, id: string): Promise<void>;
71
- /**
72
- * Deletes a vector by its ID.
73
- * @param indexName - The name of the index containing the vector.
74
- * @param id - The ID of the vector to delete.
75
- * @returns A promise that resolves when the deletion is complete.
76
- * @throws Will throw an error if the deletion operation fails.
77
- */
78
- deleteVector(indexName: string, id: string): Promise<void>;
79
- truncateIndex(indexName: string): Promise<void>;
80
- }
81
-
82
- export { LibSQLVector as DefaultVectorDB, LibSQLVector };
@@ -1 +0,0 @@
1
- export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../../chunk-4WABQORE.js';
@@ -1,209 +0,0 @@
1
- import { g as ExecutionEngine, h as StepResult, i as ExecutionGraph, j as StepFlowEntry, N as NewStep, k as ExecuteFunction } from '../../base-CAEcd6q2.cjs';
2
- export { D as DynamicMapping, z as ExtractSchemaFromStep, y as ExtractSchemaType, t as NewWorkflow, s as NewWorkflowConfig, P as PathsToStringProps, R as Run, l as SerializedStep, m as SerializedStepFlowEntry, v as StepFailure, u as StepSuccess, w as StepSuspended, x as StepsRecord, V as VariableReference, B as WatchEvent, r as WorkflowResult, Z as ZodPathType, o as cloneStep, q as cloneWorkflow, n as createStep, p as createWorkflow } from '../../base-CAEcd6q2.cjs';
3
- import { Span } from '@opentelemetry/api';
4
- import { RuntimeContext } from '../../runtime-context/index.cjs';
5
- import 'ai';
6
- import '../../base-H7siSAfu.cjs';
7
- import '../../index-QV27jkxQ.cjs';
8
- import 'stream';
9
- import 'pino';
10
- import '@opentelemetry/sdk-trace-base';
11
- import '../../types-BtMyV38I.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 'node:http';
21
- import 'hono';
22
- import 'events';
23
- import '../../deployer/index.cjs';
24
- import '../../bundler/index.cjs';
25
- import 'hono/cors';
26
- import 'hono-openapi';
27
- import 'ai/test';
28
-
29
- type ExecutionContext = {
30
- workflowId: string;
31
- runId: string;
32
- executionPath: number[];
33
- suspendedPaths: Record<string, number[]>;
34
- retryConfig: {
35
- attempts: number;
36
- delay: number;
37
- };
38
- executionSpan: Span;
39
- };
40
- /**
41
- * Default implementation of the ExecutionEngine using XState
42
- */
43
- declare class DefaultExecutionEngine extends ExecutionEngine {
44
- protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: {
45
- emit: (event: string, data: any) => Promise<void>;
46
- }, stepResults: Record<string, StepResult<any>>, lastOutput: StepResult<any>, error?: Error | string): Promise<TOutput>;
47
- /**
48
- * Executes a workflow run with the provided execution graph and input
49
- * @param graph The execution graph to execute
50
- * @param input The input data for the workflow
51
- * @returns A promise that resolves to the workflow output
52
- */
53
- execute<TInput, TOutput>(params: {
54
- workflowId: string;
55
- runId: string;
56
- graph: ExecutionGraph;
57
- input?: TInput;
58
- resume?: {
59
- steps: string[];
60
- stepResults: Record<string, StepResult<any>>;
61
- resumePayload: any;
62
- resumePath: number[];
63
- };
64
- emitter: {
65
- emit: (event: string, data: any) => Promise<void>;
66
- };
67
- retryConfig?: {
68
- attempts?: number;
69
- delay?: number;
70
- };
71
- runtimeContext: RuntimeContext;
72
- }): Promise<TOutput>;
73
- getStepOutput(stepResults: Record<string, any>, step?: StepFlowEntry): any;
74
- executeStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
75
- workflowId: string;
76
- runId: string;
77
- step: NewStep<string, any, any>;
78
- stepResults: Record<string, StepResult<any>>;
79
- executionContext: ExecutionContext;
80
- resume?: {
81
- steps: string[];
82
- resumePayload: any;
83
- };
84
- prevOutput: any;
85
- emitter: {
86
- emit: (event: string, data: any) => Promise<void>;
87
- };
88
- runtimeContext: RuntimeContext;
89
- }): Promise<StepResult<any>>;
90
- executeParallel({ workflowId, runId, entry, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
91
- workflowId: string;
92
- runId: string;
93
- entry: {
94
- type: 'parallel';
95
- steps: StepFlowEntry[];
96
- };
97
- prevStep: StepFlowEntry;
98
- stepResults: Record<string, StepResult<any>>;
99
- resume?: {
100
- steps: string[];
101
- stepResults: Record<string, StepResult<any>>;
102
- resumePayload: any;
103
- resumePath: number[];
104
- };
105
- executionContext: ExecutionContext;
106
- emitter: {
107
- emit: (event: string, data: any) => Promise<void>;
108
- };
109
- runtimeContext: RuntimeContext;
110
- }): Promise<StepResult<any>>;
111
- executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
112
- workflowId: string;
113
- runId: string;
114
- entry: {
115
- type: 'conditional';
116
- steps: StepFlowEntry[];
117
- conditions: ExecuteFunction<any, any, any, any>[];
118
- };
119
- prevStep: StepFlowEntry;
120
- prevOutput: any;
121
- stepResults: Record<string, StepResult<any>>;
122
- resume?: {
123
- steps: string[];
124
- stepResults: Record<string, StepResult<any>>;
125
- resumePayload: any;
126
- resumePath: number[];
127
- };
128
- executionContext: ExecutionContext;
129
- emitter: {
130
- emit: (event: string, data: any) => Promise<void>;
131
- };
132
- runtimeContext: RuntimeContext;
133
- }): Promise<StepResult<any>>;
134
- executeLoop({ workflowId, runId, entry, prevOutput, stepResults, resume, executionContext, emitter, runtimeContext, }: {
135
- workflowId: string;
136
- runId: string;
137
- entry: {
138
- type: 'loop';
139
- step: NewStep;
140
- condition: ExecuteFunction<any, any, any, any>;
141
- loopType: 'dowhile' | 'dountil';
142
- };
143
- prevStep: StepFlowEntry;
144
- prevOutput: any;
145
- stepResults: Record<string, StepResult<any>>;
146
- resume?: {
147
- steps: string[];
148
- stepResults: Record<string, StepResult<any>>;
149
- resumePayload: any;
150
- resumePath: number[];
151
- };
152
- executionContext: ExecutionContext;
153
- emitter: {
154
- emit: (event: string, data: any) => Promise<void>;
155
- };
156
- runtimeContext: RuntimeContext;
157
- }): Promise<StepResult<any>>;
158
- executeForeach({ workflowId, runId, entry, prevOutput, stepResults, resume, executionContext, emitter, runtimeContext, }: {
159
- workflowId: string;
160
- runId: string;
161
- entry: {
162
- type: 'foreach';
163
- step: NewStep;
164
- opts: {
165
- concurrency: number;
166
- };
167
- };
168
- prevStep: StepFlowEntry;
169
- prevOutput: any;
170
- stepResults: Record<string, StepResult<any>>;
171
- resume?: {
172
- steps: string[];
173
- stepResults: Record<string, StepResult<any>>;
174
- resumePayload: any;
175
- resumePath: number[];
176
- };
177
- executionContext: ExecutionContext;
178
- emitter: {
179
- emit: (event: string, data: any) => Promise<void>;
180
- };
181
- runtimeContext: RuntimeContext;
182
- }): Promise<StepResult<any>>;
183
- protected persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
184
- workflowId: string;
185
- runId: string;
186
- stepResults: Record<string, StepResult<any>>;
187
- executionContext: ExecutionContext;
188
- }): Promise<void>;
189
- executeEntry({ workflowId, runId, entry, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
190
- workflowId: string;
191
- runId: string;
192
- entry: StepFlowEntry;
193
- prevStep: StepFlowEntry;
194
- stepResults: Record<string, StepResult<any>>;
195
- resume?: {
196
- steps: string[];
197
- stepResults: Record<string, StepResult<any>>;
198
- resumePayload: any;
199
- resumePath: number[];
200
- };
201
- executionContext: ExecutionContext;
202
- emitter: {
203
- emit: (event: string, data: any) => Promise<void>;
204
- };
205
- runtimeContext: RuntimeContext;
206
- }): Promise<StepResult<any>>;
207
- }
208
-
209
- export { DefaultExecutionEngine, ExecuteFunction, type ExecutionContext, ExecutionEngine, ExecutionGraph, NewStep, StepFlowEntry, StepResult };
@@ -1,209 +0,0 @@
1
- import { g as ExecutionEngine, h as StepResult, i as ExecutionGraph, j as StepFlowEntry, N as NewStep, k as ExecuteFunction } from '../../base-BCfssGt6.js';
2
- export { D as DynamicMapping, z as ExtractSchemaFromStep, y as ExtractSchemaType, t as NewWorkflow, s as NewWorkflowConfig, P as PathsToStringProps, R as Run, l as SerializedStep, m as SerializedStepFlowEntry, v as StepFailure, u as StepSuccess, w as StepSuspended, x as StepsRecord, V as VariableReference, B as WatchEvent, r as WorkflowResult, Z as ZodPathType, o as cloneStep, q as cloneWorkflow, n as createStep, p as createWorkflow } from '../../base-BCfssGt6.js';
3
- import { Span } from '@opentelemetry/api';
4
- import { RuntimeContext } from '../../runtime-context/index.js';
5
- import 'ai';
6
- import '../../base-4Z34GQL8.js';
7
- import '../../index-QV27jkxQ.js';
8
- import 'stream';
9
- import 'pino';
10
- import '@opentelemetry/sdk-trace-base';
11
- import '../../types-BtMyV38I.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 'node:http';
21
- import 'hono';
22
- import 'events';
23
- import '../../deployer/index.js';
24
- import '../../bundler/index.js';
25
- import 'hono/cors';
26
- import 'hono-openapi';
27
- import 'ai/test';
28
-
29
- type ExecutionContext = {
30
- workflowId: string;
31
- runId: string;
32
- executionPath: number[];
33
- suspendedPaths: Record<string, number[]>;
34
- retryConfig: {
35
- attempts: number;
36
- delay: number;
37
- };
38
- executionSpan: Span;
39
- };
40
- /**
41
- * Default implementation of the ExecutionEngine using XState
42
- */
43
- declare class DefaultExecutionEngine extends ExecutionEngine {
44
- protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: {
45
- emit: (event: string, data: any) => Promise<void>;
46
- }, stepResults: Record<string, StepResult<any>>, lastOutput: StepResult<any>, error?: Error | string): Promise<TOutput>;
47
- /**
48
- * Executes a workflow run with the provided execution graph and input
49
- * @param graph The execution graph to execute
50
- * @param input The input data for the workflow
51
- * @returns A promise that resolves to the workflow output
52
- */
53
- execute<TInput, TOutput>(params: {
54
- workflowId: string;
55
- runId: string;
56
- graph: ExecutionGraph;
57
- input?: TInput;
58
- resume?: {
59
- steps: string[];
60
- stepResults: Record<string, StepResult<any>>;
61
- resumePayload: any;
62
- resumePath: number[];
63
- };
64
- emitter: {
65
- emit: (event: string, data: any) => Promise<void>;
66
- };
67
- retryConfig?: {
68
- attempts?: number;
69
- delay?: number;
70
- };
71
- runtimeContext: RuntimeContext;
72
- }): Promise<TOutput>;
73
- getStepOutput(stepResults: Record<string, any>, step?: StepFlowEntry): any;
74
- executeStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
75
- workflowId: string;
76
- runId: string;
77
- step: NewStep<string, any, any>;
78
- stepResults: Record<string, StepResult<any>>;
79
- executionContext: ExecutionContext;
80
- resume?: {
81
- steps: string[];
82
- resumePayload: any;
83
- };
84
- prevOutput: any;
85
- emitter: {
86
- emit: (event: string, data: any) => Promise<void>;
87
- };
88
- runtimeContext: RuntimeContext;
89
- }): Promise<StepResult<any>>;
90
- executeParallel({ workflowId, runId, entry, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
91
- workflowId: string;
92
- runId: string;
93
- entry: {
94
- type: 'parallel';
95
- steps: StepFlowEntry[];
96
- };
97
- prevStep: StepFlowEntry;
98
- stepResults: Record<string, StepResult<any>>;
99
- resume?: {
100
- steps: string[];
101
- stepResults: Record<string, StepResult<any>>;
102
- resumePayload: any;
103
- resumePath: number[];
104
- };
105
- executionContext: ExecutionContext;
106
- emitter: {
107
- emit: (event: string, data: any) => Promise<void>;
108
- };
109
- runtimeContext: RuntimeContext;
110
- }): Promise<StepResult<any>>;
111
- executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
112
- workflowId: string;
113
- runId: string;
114
- entry: {
115
- type: 'conditional';
116
- steps: StepFlowEntry[];
117
- conditions: ExecuteFunction<any, any, any, any>[];
118
- };
119
- prevStep: StepFlowEntry;
120
- prevOutput: any;
121
- stepResults: Record<string, StepResult<any>>;
122
- resume?: {
123
- steps: string[];
124
- stepResults: Record<string, StepResult<any>>;
125
- resumePayload: any;
126
- resumePath: number[];
127
- };
128
- executionContext: ExecutionContext;
129
- emitter: {
130
- emit: (event: string, data: any) => Promise<void>;
131
- };
132
- runtimeContext: RuntimeContext;
133
- }): Promise<StepResult<any>>;
134
- executeLoop({ workflowId, runId, entry, prevOutput, stepResults, resume, executionContext, emitter, runtimeContext, }: {
135
- workflowId: string;
136
- runId: string;
137
- entry: {
138
- type: 'loop';
139
- step: NewStep;
140
- condition: ExecuteFunction<any, any, any, any>;
141
- loopType: 'dowhile' | 'dountil';
142
- };
143
- prevStep: StepFlowEntry;
144
- prevOutput: any;
145
- stepResults: Record<string, StepResult<any>>;
146
- resume?: {
147
- steps: string[];
148
- stepResults: Record<string, StepResult<any>>;
149
- resumePayload: any;
150
- resumePath: number[];
151
- };
152
- executionContext: ExecutionContext;
153
- emitter: {
154
- emit: (event: string, data: any) => Promise<void>;
155
- };
156
- runtimeContext: RuntimeContext;
157
- }): Promise<StepResult<any>>;
158
- executeForeach({ workflowId, runId, entry, prevOutput, stepResults, resume, executionContext, emitter, runtimeContext, }: {
159
- workflowId: string;
160
- runId: string;
161
- entry: {
162
- type: 'foreach';
163
- step: NewStep;
164
- opts: {
165
- concurrency: number;
166
- };
167
- };
168
- prevStep: StepFlowEntry;
169
- prevOutput: any;
170
- stepResults: Record<string, StepResult<any>>;
171
- resume?: {
172
- steps: string[];
173
- stepResults: Record<string, StepResult<any>>;
174
- resumePayload: any;
175
- resumePath: number[];
176
- };
177
- executionContext: ExecutionContext;
178
- emitter: {
179
- emit: (event: string, data: any) => Promise<void>;
180
- };
181
- runtimeContext: RuntimeContext;
182
- }): Promise<StepResult<any>>;
183
- protected persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
184
- workflowId: string;
185
- runId: string;
186
- stepResults: Record<string, StepResult<any>>;
187
- executionContext: ExecutionContext;
188
- }): Promise<void>;
189
- executeEntry({ workflowId, runId, entry, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
190
- workflowId: string;
191
- runId: string;
192
- entry: StepFlowEntry;
193
- prevStep: StepFlowEntry;
194
- stepResults: Record<string, StepResult<any>>;
195
- resume?: {
196
- steps: string[];
197
- stepResults: Record<string, StepResult<any>>;
198
- resumePayload: any;
199
- resumePath: number[];
200
- };
201
- executionContext: ExecutionContext;
202
- emitter: {
203
- emit: (event: string, data: any) => Promise<void>;
204
- };
205
- runtimeContext: RuntimeContext;
206
- }): Promise<StepResult<any>>;
207
- }
208
-
209
- export { DefaultExecutionEngine, ExecuteFunction, type ExecutionContext, ExecutionEngine, ExecutionGraph, NewStep, StepFlowEntry, StepResult };
@@ -1 +0,0 @@
1
- export * from './../dist/storage/libsql';
@@ -1 +0,0 @@
1
- export * from './../dist/vector/libsql';
@@ -1 +0,0 @@
1
- export * from './../dist/workflows/vNext';