@mastra/inngest 0.0.0-vector-query-sources-20250516172905 → 0.0.0-vector-query-tool-provider-options-20250828222356

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": ["./tsconfig.json", "../../tsconfig.build.json"],
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*"],
8
+ "exclude": ["node_modules", "**/*.test.ts", "src/**/*.mock.ts"]
9
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "extends": "../../tsconfig.node.json",
3
- "include": ["src/**/*"],
3
+ "include": ["src/**/*", "tsup.config.ts"],
4
4
  "exclude": ["node_modules", "**/*.test.ts"]
5
5
  }
package/tsup.config.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { generateTypes } from '@internal/types-builder';
2
+ import { defineConfig } from 'tsup';
3
+
4
+ export default defineConfig({
5
+ entry: ['src/index.ts'],
6
+ format: ['esm', 'cjs'],
7
+ clean: true,
8
+ dts: false,
9
+ splitting: true,
10
+ treeshake: {
11
+ preset: 'smallest',
12
+ },
13
+ sourcemap: true,
14
+ onSuccess: async () => {
15
+ await generateTypes(process.cwd());
16
+ },
17
+ });
package/vitest.config.ts CHANGED
@@ -4,5 +4,11 @@ export default defineConfig({
4
4
  test: {
5
5
  globals: true,
6
6
  include: ['src/**/*.test.ts'],
7
+ pool: 'threads',
8
+ poolOptions: {
9
+ threads: {
10
+ singleThread: true,
11
+ },
12
+ },
7
13
  },
8
14
  });
@@ -1,194 +0,0 @@
1
- import type { BaseContext } from 'inngest';
2
- import { ClientOptions } from 'inngest';
3
- import { cloneStep } from '@mastra/core/workflows/vNext';
4
- import { createStep } from '@mastra/core/workflows/vNext';
5
- import { DefaultExecutionEngine } from '@mastra/core/workflows/vNext';
6
- import type { ExecuteFunction } from '@mastra/core/workflows/vNext';
7
- import type { ExecutionContext } from '@mastra/core/workflows/vNext';
8
- import type { ExecutionEngine } from '@mastra/core/workflows/vNext';
9
- import type { ExecutionGraph } from '@mastra/core/workflows/vNext';
10
- import { Handler } from 'inngest';
11
- import type { Inngest } from 'inngest';
12
- import { InngestFunction } from 'inngest';
13
- import { InngestMiddleware } from 'inngest';
14
- import type { Mastra } from '@mastra/core';
15
- import type { NewStep } from '@mastra/core/workflows/vNext';
16
- import { NewWorkflow } from '@mastra/core/workflows/vNext';
17
- import type { NewWorkflowConfig } from '@mastra/core/workflows/vNext';
18
- import { Run } from '@mastra/core/workflows/vNext';
19
- import { RuntimeContext } from '@mastra/core/di';
20
- import { serve as serve_2 } from 'inngest/hono';
21
- import type { Span } from '@opentelemetry/api';
22
- import type { StepFlowEntry } from '@mastra/core/workflows/vNext';
23
- import type { StepResult } from '@mastra/core/workflows/vNext';
24
- import type { VNextWorkflowRun } from '@mastra/core';
25
- import type { VNextWorkflowRuns } from '@mastra/core';
26
- import type { WorkflowResult } from '@mastra/core/workflows/vNext';
27
- import type { z } from 'zod';
28
-
29
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends NewStep<string, any, any, any, any>[] = NewStep<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
30
- id: TWorkflowId;
31
- }): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
32
-
33
- export declare function init(inngest: Inngest): {
34
- createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
35
- createStep: typeof createStep;
36
- cloneStep: typeof cloneStep;
37
- cloneWorkflow: typeof cloneWorkflow;
38
- };
39
-
40
- export declare class InngestExecutionEngine extends DefaultExecutionEngine {
41
- private inngestStep;
42
- private inngestAttempts;
43
- constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
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
- superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
48
- workflowId: string;
49
- runId: string;
50
- step: NewStep<string, any, any>;
51
- stepResults: Record<string, StepResult<any>>;
52
- executionContext: ExecutionContext;
53
- resume?: {
54
- steps: string[];
55
- resumePayload: any;
56
- };
57
- prevOutput: any;
58
- emitter: {
59
- emit: (event: string, data: any) => Promise<void>;
60
- };
61
- runtimeContext: RuntimeContext;
62
- }): Promise<StepResult<any>>;
63
- executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
64
- step: NewStep<string, any, any>;
65
- stepResults: Record<string, StepResult<any>>;
66
- executionContext: {
67
- workflowId: string;
68
- runId: string;
69
- executionPath: number[];
70
- suspendedPaths: Record<string, number[]>;
71
- retryConfig: {
72
- attempts: number;
73
- delay: number;
74
- };
75
- };
76
- resume?: {
77
- steps: string[];
78
- resumePayload: any;
79
- runId?: string;
80
- };
81
- prevOutput: any;
82
- emitter: {
83
- emit: (event: string, data: any) => Promise<void>;
84
- };
85
- runtimeContext: RuntimeContext;
86
- }): Promise<StepResult<any>>;
87
- persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
88
- workflowId: string;
89
- runId: string;
90
- stepResults: Record<string, StepResult<any>>;
91
- executionContext: ExecutionContext;
92
- }): Promise<void>;
93
- executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
94
- workflowId: string;
95
- runId: string;
96
- entry: {
97
- type: 'conditional';
98
- steps: StepFlowEntry[];
99
- conditions: ExecuteFunction<any, any, any, any>[];
100
- };
101
- prevStep: StepFlowEntry;
102
- prevOutput: any;
103
- stepResults: Record<string, StepResult<any>>;
104
- resume?: {
105
- steps: string[];
106
- stepResults: Record<string, StepResult<any>>;
107
- resumePayload: any;
108
- resumePath: number[];
109
- };
110
- executionContext: ExecutionContext;
111
- emitter: {
112
- emit: (event: string, data: any) => Promise<void>;
113
- };
114
- runtimeContext: RuntimeContext;
115
- }): Promise<StepResult<any>>;
116
- }
117
-
118
- export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
119
- #private;
120
- private inngest;
121
- constructor(params: {
122
- workflowId: string;
123
- runId: string;
124
- executionEngine: ExecutionEngine;
125
- executionGraph: ExecutionGraph;
126
- mastra?: Mastra;
127
- retryConfig?: {
128
- attempts?: number;
129
- delay?: number;
130
- };
131
- cleanup?: () => void;
132
- }, inngest: Inngest);
133
- getRuns(eventId: string): Promise<any>;
134
- getRunOutput(eventId: string): Promise<any>;
135
- start({ inputData, }: {
136
- inputData?: z.infer<TInput>;
137
- runtimeContext?: RuntimeContext;
138
- }): Promise<WorkflowResult<TOutput, TSteps>>;
139
- resume<TResumeSchema extends z.ZodType<any>>(params: {
140
- resumeData?: z.infer<TResumeSchema>;
141
- step: NewStep<string, any, any, TResumeSchema, any> | [...NewStep<string, any, any, any, any>[], NewStep<string, any, any, TResumeSchema, any>] | string | string[];
142
- runtimeContext?: RuntimeContext;
143
- }): Promise<WorkflowResult<TOutput, TSteps>>;
144
- watch(cb: (event: any) => void): () => void;
145
- }
146
-
147
- export declare class InngestWorkflow<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends NewWorkflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
148
- #private;
149
- inngest: Inngest;
150
- private function;
151
- constructor(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
152
- getWorkflowRuns(args?: {
153
- fromDate?: Date;
154
- toDate?: Date;
155
- limit?: number;
156
- offset?: number;
157
- resourceId?: string;
158
- }): Promise<VNextWorkflowRuns>;
159
- getWorkflowRunById(runId: string): Promise<VNextWorkflowRun | null>;
160
- __registerMastra(mastra: Mastra): void;
161
- createRun(options?: {
162
- runId?: string;
163
- }): Run<TSteps, TInput, TOutput>;
164
- getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
165
- cron: string;
166
- } & Partial<Record<"event" | "if", never>>] | [{
167
- event: string;
168
- if?: string;
169
- } & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
170
- cron: string;
171
- } & Partial<Record<"event" | "if", never>>] | [{
172
- event: string;
173
- if?: string;
174
- } & Partial<Record<"cron", never>>]>;
175
- getNestedFunctions(steps: StepFlowEntry[]): ReturnType<Inngest['createFunction']>[];
176
- getFunctions(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
177
- cron: string;
178
- } & Partial<Record<"event" | "if", never>>] | [{
179
- event: string;
180
- if?: string;
181
- } & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
182
- cron: string;
183
- } & Partial<Record<"event" | "if", never>>] | [{
184
- event: string;
185
- if?: string;
186
- } & Partial<Record<"cron", never>>]>[];
187
- }
188
-
189
- export declare function serve({ mastra, inngest }: {
190
- mastra: Mastra;
191
- inngest: Inngest;
192
- }): ReturnType<typeof serve_2>;
193
-
194
- export { }
@@ -1,194 +0,0 @@
1
- import type { BaseContext } from 'inngest';
2
- import { ClientOptions } from 'inngest';
3
- import { cloneStep } from '@mastra/core/workflows/vNext';
4
- import { createStep } from '@mastra/core/workflows/vNext';
5
- import { DefaultExecutionEngine } from '@mastra/core/workflows/vNext';
6
- import type { ExecuteFunction } from '@mastra/core/workflows/vNext';
7
- import type { ExecutionContext } from '@mastra/core/workflows/vNext';
8
- import type { ExecutionEngine } from '@mastra/core/workflows/vNext';
9
- import type { ExecutionGraph } from '@mastra/core/workflows/vNext';
10
- import { Handler } from 'inngest';
11
- import type { Inngest } from 'inngest';
12
- import { InngestFunction } from 'inngest';
13
- import { InngestMiddleware } from 'inngest';
14
- import type { Mastra } from '@mastra/core';
15
- import type { NewStep } from '@mastra/core/workflows/vNext';
16
- import { NewWorkflow } from '@mastra/core/workflows/vNext';
17
- import type { NewWorkflowConfig } from '@mastra/core/workflows/vNext';
18
- import { Run } from '@mastra/core/workflows/vNext';
19
- import { RuntimeContext } from '@mastra/core/di';
20
- import { serve as serve_2 } from 'inngest/hono';
21
- import type { Span } from '@opentelemetry/api';
22
- import type { StepFlowEntry } from '@mastra/core/workflows/vNext';
23
- import type { StepResult } from '@mastra/core/workflows/vNext';
24
- import type { VNextWorkflowRun } from '@mastra/core';
25
- import type { VNextWorkflowRuns } from '@mastra/core';
26
- import type { WorkflowResult } from '@mastra/core/workflows/vNext';
27
- import type { z } from 'zod';
28
-
29
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends NewStep<string, any, any, any, any>[] = NewStep<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
30
- id: TWorkflowId;
31
- }): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
32
-
33
- export declare function init(inngest: Inngest): {
34
- createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
35
- createStep: typeof createStep;
36
- cloneStep: typeof cloneStep;
37
- cloneWorkflow: typeof cloneWorkflow;
38
- };
39
-
40
- export declare class InngestExecutionEngine extends DefaultExecutionEngine {
41
- private inngestStep;
42
- private inngestAttempts;
43
- constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
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
- superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
48
- workflowId: string;
49
- runId: string;
50
- step: NewStep<string, any, any>;
51
- stepResults: Record<string, StepResult<any>>;
52
- executionContext: ExecutionContext;
53
- resume?: {
54
- steps: string[];
55
- resumePayload: any;
56
- };
57
- prevOutput: any;
58
- emitter: {
59
- emit: (event: string, data: any) => Promise<void>;
60
- };
61
- runtimeContext: RuntimeContext;
62
- }): Promise<StepResult<any>>;
63
- executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
64
- step: NewStep<string, any, any>;
65
- stepResults: Record<string, StepResult<any>>;
66
- executionContext: {
67
- workflowId: string;
68
- runId: string;
69
- executionPath: number[];
70
- suspendedPaths: Record<string, number[]>;
71
- retryConfig: {
72
- attempts: number;
73
- delay: number;
74
- };
75
- };
76
- resume?: {
77
- steps: string[];
78
- resumePayload: any;
79
- runId?: string;
80
- };
81
- prevOutput: any;
82
- emitter: {
83
- emit: (event: string, data: any) => Promise<void>;
84
- };
85
- runtimeContext: RuntimeContext;
86
- }): Promise<StepResult<any>>;
87
- persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
88
- workflowId: string;
89
- runId: string;
90
- stepResults: Record<string, StepResult<any>>;
91
- executionContext: ExecutionContext;
92
- }): Promise<void>;
93
- executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
94
- workflowId: string;
95
- runId: string;
96
- entry: {
97
- type: 'conditional';
98
- steps: StepFlowEntry[];
99
- conditions: ExecuteFunction<any, any, any, any>[];
100
- };
101
- prevStep: StepFlowEntry;
102
- prevOutput: any;
103
- stepResults: Record<string, StepResult<any>>;
104
- resume?: {
105
- steps: string[];
106
- stepResults: Record<string, StepResult<any>>;
107
- resumePayload: any;
108
- resumePath: number[];
109
- };
110
- executionContext: ExecutionContext;
111
- emitter: {
112
- emit: (event: string, data: any) => Promise<void>;
113
- };
114
- runtimeContext: RuntimeContext;
115
- }): Promise<StepResult<any>>;
116
- }
117
-
118
- export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
119
- #private;
120
- private inngest;
121
- constructor(params: {
122
- workflowId: string;
123
- runId: string;
124
- executionEngine: ExecutionEngine;
125
- executionGraph: ExecutionGraph;
126
- mastra?: Mastra;
127
- retryConfig?: {
128
- attempts?: number;
129
- delay?: number;
130
- };
131
- cleanup?: () => void;
132
- }, inngest: Inngest);
133
- getRuns(eventId: string): Promise<any>;
134
- getRunOutput(eventId: string): Promise<any>;
135
- start({ inputData, }: {
136
- inputData?: z.infer<TInput>;
137
- runtimeContext?: RuntimeContext;
138
- }): Promise<WorkflowResult<TOutput, TSteps>>;
139
- resume<TResumeSchema extends z.ZodType<any>>(params: {
140
- resumeData?: z.infer<TResumeSchema>;
141
- step: NewStep<string, any, any, TResumeSchema, any> | [...NewStep<string, any, any, any, any>[], NewStep<string, any, any, TResumeSchema, any>] | string | string[];
142
- runtimeContext?: RuntimeContext;
143
- }): Promise<WorkflowResult<TOutput, TSteps>>;
144
- watch(cb: (event: any) => void): () => void;
145
- }
146
-
147
- export declare class InngestWorkflow<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends NewWorkflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
148
- #private;
149
- inngest: Inngest;
150
- private function;
151
- constructor(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
152
- getWorkflowRuns(args?: {
153
- fromDate?: Date;
154
- toDate?: Date;
155
- limit?: number;
156
- offset?: number;
157
- resourceId?: string;
158
- }): Promise<VNextWorkflowRuns>;
159
- getWorkflowRunById(runId: string): Promise<VNextWorkflowRun | null>;
160
- __registerMastra(mastra: Mastra): void;
161
- createRun(options?: {
162
- runId?: string;
163
- }): Run<TSteps, TInput, TOutput>;
164
- getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
165
- cron: string;
166
- } & Partial<Record<"event" | "if", never>>] | [{
167
- event: string;
168
- if?: string;
169
- } & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
170
- cron: string;
171
- } & Partial<Record<"event" | "if", never>>] | [{
172
- event: string;
173
- if?: string;
174
- } & Partial<Record<"cron", never>>]>;
175
- getNestedFunctions(steps: StepFlowEntry[]): ReturnType<Inngest['createFunction']>[];
176
- getFunctions(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
177
- cron: string;
178
- } & Partial<Record<"event" | "if", never>>] | [{
179
- event: string;
180
- if?: string;
181
- } & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
182
- cron: string;
183
- } & Partial<Record<"event" | "if", never>>] | [{
184
- event: string;
185
- if?: string;
186
- } & Partial<Record<"cron", never>>]>[];
187
- }
188
-
189
- export declare function serve({ mastra, inngest }: {
190
- mastra: Mastra;
191
- inngest: Inngest;
192
- }): ReturnType<typeof serve_2>;
193
-
194
- export { }
package/dist/index.d.cts DELETED
@@ -1,5 +0,0 @@
1
- export { serve } from './_tsup-dts-rollup.cjs';
2
- export { init } from './_tsup-dts-rollup.cjs';
3
- export { InngestRun } from './_tsup-dts-rollup.cjs';
4
- export { InngestWorkflow } from './_tsup-dts-rollup.cjs';
5
- export { InngestExecutionEngine } from './_tsup-dts-rollup.cjs';