@mastra/core 0.1.26 → 0.1.27-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.
- package/dist/agents/agent-apis.d.ts +0 -31
- package/dist/agents/agent-apis.d.ts.map +1 -1
- package/dist/agents/file-logger.d.ts +0 -5
- package/dist/agents/file-logger.d.ts.map +1 -1
- package/dist/agents/index.d.ts +0 -49
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/openai/assistant.d.ts +0 -76
- package/dist/agents/openai/assistant.d.ts.map +1 -1
- package/dist/agents/utils.d.ts +0 -21
- package/dist/agents/utils.d.ts.map +1 -1
- package/dist/agents/vector-sync.d.ts +0 -46
- package/dist/agents/vector-sync.d.ts.map +1 -1
- package/dist/agents/vercel/index.d.ts +0 -43
- package/dist/agents/vercel/index.d.ts.map +1 -1
- package/dist/authenticator.d.ts +0 -62
- package/dist/authenticator.d.ts.map +1 -1
- package/dist/core.cjs.development.js +956 -7459
- package/dist/core.cjs.development.js.map +1 -1
- package/dist/core.cjs.production.min.js +1 -1
- package/dist/core.cjs.production.min.js.map +1 -1
- package/dist/core.esm.js +949 -7409
- package/dist/core.esm.js.map +1 -1
- package/dist/framework.d.ts +0 -254
- package/dist/framework.d.ts.map +1 -1
- package/dist/index.d.ts +1 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/integration.d.ts +0 -98
- package/dist/integration.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/utils/object.d.ts +0 -42
- package/dist/lib/utils/object.d.ts.map +1 -1
- package/dist/next/callback.d.ts +0 -3
- package/dist/next/callback.d.ts.map +1 -1
- package/dist/next/connect.d.ts +0 -3
- package/dist/next/connect.d.ts.map +1 -1
- package/dist/next/cron.d.ts +0 -12
- package/dist/next/cron.d.ts.map +1 -1
- package/dist/next/index.d.ts +0 -15
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/inngest.d.ts +0 -3
- package/dist/next/inngest.d.ts.map +1 -1
- package/dist/next/utils.d.ts +0 -9
- package/dist/next/utils.d.ts.map +1 -1
- package/dist/next/webhook.d.ts +0 -9
- package/dist/next/webhook.d.ts.map +1 -1
- package/dist/next-src/agent/index.d.ts +63 -0
- package/dist/next-src/agent/index.d.ts.map +1 -0
- package/dist/next-src/engine/index.d.ts +147 -0
- package/dist/next-src/engine/index.d.ts.map +1 -0
- package/dist/next-src/engine/schema.d.ts.map +1 -0
- package/dist/next-src/engine/types.d.ts +116 -0
- package/dist/next-src/engine/types.d.ts.map +1 -0
- package/dist/{lib/query-builder → next-src/engine}/utils.d.ts +2 -1
- package/dist/next-src/engine/utils.d.ts.map +1 -0
- package/dist/next-src/index.d.ts +54 -0
- package/dist/next-src/index.d.ts.map +1 -0
- package/dist/next-src/integration/index.d.ts +30 -0
- package/dist/next-src/integration/index.d.ts.map +1 -0
- package/dist/next-src/logger/index.d.ts +61 -0
- package/dist/next-src/logger/index.d.ts.map +1 -0
- package/dist/next-src/tools/index.d.ts +4 -0
- package/dist/next-src/tools/index.d.ts.map +1 -0
- package/dist/next-src/tools/types.d.ts +27 -0
- package/dist/next-src/tools/types.d.ts.map +1 -0
- package/dist/next-src/vector/index.d.ts +11 -0
- package/dist/next-src/vector/index.d.ts.map +1 -0
- package/dist/sync-factory.d.ts +0 -13
- package/dist/sync-factory.d.ts.map +1 -1
- package/dist/sync-fixtures/github.d.ts +6 -6
- package/dist/types.d.ts +0 -400
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/errors.d.ts +0 -3
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/index.d.ts +0 -14
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/inngest.d.ts +0 -6
- package/dist/utils/inngest.d.ts.map +1 -1
- package/dist/utils/text.d.ts +0 -1
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/vector-access/index.d.ts +0 -21
- package/dist/vector-access/index.d.ts.map +1 -1
- package/dist/vector-access/types.d.ts +0 -6
- package/dist/vector-access/types.d.ts.map +1 -1
- package/dist/workflows/apis.d.ts +0 -8
- package/dist/workflows/apis.d.ts.map +1 -1
- package/dist/workflows/conditions/constants.d.ts +0 -16
- package/dist/workflows/conditions/constants.d.ts.map +1 -1
- package/dist/workflows/conditions/types.d.ts +0 -2
- package/dist/workflows/conditions/types.d.ts.map +1 -1
- package/dist/workflows/handler.d.ts +0 -63
- package/dist/workflows/handler.d.ts.map +1 -1
- package/dist/workflows/runner.d.ts +0 -51
- package/dist/workflows/runner.d.ts.map +1 -1
- package/dist/workflows/schemas.d.ts +0 -1043
- package/dist/workflows/schemas.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +0 -96
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +0 -111
- package/dist/workflows/utils.d.ts.map +1 -1
- package/package.json +15 -17
- package/dist/data-access/index.d.ts +0 -351
- package/dist/data-access/index.d.ts.map +0 -1
- package/dist/generated-types/index.d.ts +0 -5
- package/dist/generated-types/index.d.ts.map +0 -1
- package/dist/lib/logger-utils/logger.d.ts +0 -118
- package/dist/lib/logger-utils/logger.d.ts.map +0 -1
- package/dist/lib/query-builder/constants.d.ts +0 -17
- package/dist/lib/query-builder/constants.d.ts.map +0 -1
- package/dist/lib/query-builder/filters/sql.d.ts +0 -9
- package/dist/lib/query-builder/filters/sql.d.ts.map +0 -1
- package/dist/lib/query-builder/schema.d.ts.map +0 -1
- package/dist/lib/query-builder/sorts/sql.d.ts +0 -8
- package/dist/lib/query-builder/sorts/sql.d.ts.map +0 -1
- package/dist/lib/query-builder/types.d.ts +0 -31
- package/dist/lib/query-builder/types.d.ts.map +0 -1
- package/dist/lib/query-builder/utils.d.ts.map +0 -1
- package/dist/prisma/client.d.ts +0 -3
- package/dist/prisma/client.d.ts.map +0 -1
- package/dist/prisma/client.ts +0 -31
- package/dist/prisma/gen.js +0 -140
- package/dist/prisma/schema.prisma +0 -130
- package/dist/service/service.property.d.ts +0 -25
- package/dist/service/service.property.d.ts.map +0 -1
- package/dist/service/service.record.d.ts +0 -25
- package/dist/service/service.record.d.ts.map +0 -1
- /package/dist/{lib/query-builder → next-src/engine}/schema.d.ts +0 -0
package/dist/framework.d.ts
CHANGED
|
@@ -1,255 +1 @@
|
|
|
1
|
-
import { DataLayer } from './data-access';
|
|
2
|
-
import { Integration } from './integration';
|
|
3
|
-
import { Config, EventHandlerReturnType, IntegrationApi, IntegrationApiExcutorParams, IntegrationContext, IntegrationEvent, Routes, ZodeSchemaGenerator } from './types';
|
|
4
|
-
import { Blueprint } from './workflows/types';
|
|
5
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
6
|
-
import { IntegrationMap } from './generated-types';
|
|
7
|
-
import { Prisma } from '@prisma-app/client';
|
|
8
|
-
import { z, ZodSchema } from 'zod';
|
|
9
|
-
import { VectorLayer } from './vector-access';
|
|
10
|
-
import { Logger, RegisteredLogger } from './lib/logger-utils/logger';
|
|
11
|
-
export declare class Mastra<C extends Config = Config> {
|
|
12
|
-
globalEvents: Map<string, Record<string, IntegrationEvent<any>>>;
|
|
13
|
-
globalApis: Map<string, Record<string, IntegrationApi<any>>>;
|
|
14
|
-
integrations: Map<string, Integration>;
|
|
15
|
-
dataLayer: DataLayer;
|
|
16
|
-
vectorLayer: VectorLayer;
|
|
17
|
-
agentsConfig: Config['agents'];
|
|
18
|
-
logger: Map<RegisteredLogger, Logger>;
|
|
19
|
-
config: C;
|
|
20
|
-
static init<C extends Config = Config>(config: C): Mastra<C>;
|
|
21
|
-
constructor({ dataLayer, vectorLayer, config, }: {
|
|
22
|
-
dataLayer: DataLayer;
|
|
23
|
-
vectorLayer: VectorLayer;
|
|
24
|
-
config: C;
|
|
25
|
-
});
|
|
26
|
-
attachLogger({ key, logger }: {
|
|
27
|
-
key: RegisteredLogger;
|
|
28
|
-
logger: Logger;
|
|
29
|
-
}): void;
|
|
30
|
-
connectedIntegrations({ context, }: {
|
|
31
|
-
context: {
|
|
32
|
-
connectionId: string;
|
|
33
|
-
};
|
|
34
|
-
}): Promise<Integration<unknown>[]>;
|
|
35
|
-
get routes(): Record<Routes, string>;
|
|
36
|
-
__registerIntgeration(definition: Integration): void;
|
|
37
|
-
registerApi(name: string, api: Omit<IntegrationApi<any>, 'integrationName'>): void;
|
|
38
|
-
registerEvent(name: string, event: Omit<IntegrationEvent<any>, 'integrationName'>): void;
|
|
39
|
-
__registerEvents({ events, integrationName, }: {
|
|
40
|
-
events: Record<string, IntegrationEvent<any>>;
|
|
41
|
-
integrationName?: string;
|
|
42
|
-
}): void;
|
|
43
|
-
__registerApis({ apis, integrationName, }: {
|
|
44
|
-
apis: IntegrationApi[];
|
|
45
|
-
integrationName?: string;
|
|
46
|
-
}): void;
|
|
47
|
-
availableIntegrations(): {
|
|
48
|
-
name: string;
|
|
49
|
-
integration: Integration<unknown>;
|
|
50
|
-
}[];
|
|
51
|
-
getIntegration<T extends keyof IntegrationMap>(name: T): IntegrationMap[T];
|
|
52
|
-
getGlobalEvents(): Map<string, Record<string, IntegrationEvent<any>>>;
|
|
53
|
-
getSystemEvents(): Record<string, IntegrationEvent<any>>;
|
|
54
|
-
getEventsByIntegration(name: string): Record<string, IntegrationEvent<any>> | undefined;
|
|
55
|
-
getGlobalEventHandlers(): EventHandlerReturnType[];
|
|
56
|
-
getApis(): Map<string, Record<string, IntegrationApi<any>>>;
|
|
57
|
-
getSystemApis(): Record<string, IntegrationApi<any>> | undefined;
|
|
58
|
-
getApisByIntegration(name: string, includeHidden?: boolean): Record<string, IntegrationApi<any>> | undefined;
|
|
59
|
-
authenticatableIntegrations(): {
|
|
60
|
-
name: string;
|
|
61
|
-
integration: Integration<unknown>;
|
|
62
|
-
}[];
|
|
63
|
-
authenticator(name: string): import("./authenticator").IntegrationAuth;
|
|
64
|
-
connectIntegrationByCredential({ name, connectionId, credential, }: {
|
|
65
|
-
name: string;
|
|
66
|
-
connectionId: string;
|
|
67
|
-
credential: Omit<Prisma.CredentialUncheckedCreateInput, 'k_id'>;
|
|
68
|
-
}): Promise<void>;
|
|
69
|
-
disconnectIntegration({ name, connectionId, }: {
|
|
70
|
-
name: string;
|
|
71
|
-
connectionId: string;
|
|
72
|
-
}): Promise<void>;
|
|
73
|
-
createSystemConnection(): Promise<{
|
|
74
|
-
name: string;
|
|
75
|
-
connectionId: string;
|
|
76
|
-
id: string;
|
|
77
|
-
issues: string[];
|
|
78
|
-
syncConfig: Prisma.JsonValue | null;
|
|
79
|
-
createdAt: Date;
|
|
80
|
-
updatedAt: Date | null;
|
|
81
|
-
lastSyncAt: Date | null;
|
|
82
|
-
subscriptionId: string | null;
|
|
83
|
-
}>;
|
|
84
|
-
callApi({ integrationName, api, payload, }: {
|
|
85
|
-
integrationName?: string;
|
|
86
|
-
api: string;
|
|
87
|
-
payload: IntegrationApiExcutorParams;
|
|
88
|
-
}): Promise<Record<string, any>>;
|
|
89
|
-
subscribeEvent({ id, interval, timeout, }: {
|
|
90
|
-
id: string;
|
|
91
|
-
interval?: number;
|
|
92
|
-
timeout?: number;
|
|
93
|
-
}): Promise<{
|
|
94
|
-
status: string;
|
|
95
|
-
startedAt: string;
|
|
96
|
-
endedAt: string;
|
|
97
|
-
output: any;
|
|
98
|
-
} | null>;
|
|
99
|
-
triggerEvent<KEY extends keyof C['workflows']['systemEvents'], SYSTEM_EVENT_SCHEMA extends C['workflows']['systemEvents'][KEY]['schema']>({ key, data, user, integrationName, }: {
|
|
100
|
-
integrationName?: string;
|
|
101
|
-
key: KEY;
|
|
102
|
-
data: SYSTEM_EVENT_SCHEMA extends ZodSchema ? z.infer<SYSTEM_EVENT_SCHEMA> : SYSTEM_EVENT_SCHEMA extends ZodeSchemaGenerator ? z.infer<Awaited<ReturnType<SYSTEM_EVENT_SCHEMA>>> : never;
|
|
103
|
-
user?: {
|
|
104
|
-
connectionId: string;
|
|
105
|
-
[key: string]: any;
|
|
106
|
-
};
|
|
107
|
-
}): Promise<{
|
|
108
|
-
event: any;
|
|
109
|
-
workflowEvent?: any;
|
|
110
|
-
}>;
|
|
111
|
-
triggerSystemEvent<T = Record<string, any>>({ key, data, user, }: {
|
|
112
|
-
key: string;
|
|
113
|
-
data: T;
|
|
114
|
-
user?: {
|
|
115
|
-
connectionId: string;
|
|
116
|
-
[key: string]: any;
|
|
117
|
-
};
|
|
118
|
-
}): Promise<import("inngest/types").SendEventOutput<{
|
|
119
|
-
id: string;
|
|
120
|
-
eventKey: string;
|
|
121
|
-
baseUrl: string;
|
|
122
|
-
}>>;
|
|
123
|
-
createRouter(): {
|
|
124
|
-
makeWebhookUrl: ({ event, name, }: {
|
|
125
|
-
name: string;
|
|
126
|
-
event: string;
|
|
127
|
-
}) => string;
|
|
128
|
-
makeRedirectURI: () => string;
|
|
129
|
-
makeConnectURI: (props: {
|
|
130
|
-
name: string;
|
|
131
|
-
connectionId: string;
|
|
132
|
-
clientRedirectPath: string;
|
|
133
|
-
}) => string;
|
|
134
|
-
registerRoutes: () => (req: NextRequest) => NextResponse<unknown> | Promise<Response>;
|
|
135
|
-
};
|
|
136
|
-
runBlueprint: ({ blueprint, dataCtx, ctx, }: {
|
|
137
|
-
blueprint: Blueprint;
|
|
138
|
-
dataCtx?: any;
|
|
139
|
-
ctx: IntegrationContext;
|
|
140
|
-
}) => Promise<{
|
|
141
|
-
fullCtx: null;
|
|
142
|
-
} | {
|
|
143
|
-
fullCtx: {
|
|
144
|
-
[x: string]: any;
|
|
145
|
-
};
|
|
146
|
-
}>;
|
|
147
|
-
getAgent({ connectionId, agentId, }: {
|
|
148
|
-
agentId: string;
|
|
149
|
-
connectionId: string;
|
|
150
|
-
}): Promise<{
|
|
151
|
-
agent: import("openai/resources/beta/assistants").Assistant & {
|
|
152
|
-
_request_id?: string | null;
|
|
153
|
-
};
|
|
154
|
-
initializeThread: (messages?: import("openai/resources/beta/threads/threads").ThreadCreateParams.Message[]) => Promise<import("openai/resources/beta/threads/threads").Thread & {
|
|
155
|
-
_request_id?: string | null;
|
|
156
|
-
}>;
|
|
157
|
-
listMessages: ({ threadId }: {
|
|
158
|
-
threadId: string;
|
|
159
|
-
}) => Promise<import("openai/resources/beta/threads/messages").MessagesPage>;
|
|
160
|
-
getRun: ({ threadId, runId, }: {
|
|
161
|
-
threadId: string;
|
|
162
|
-
runId: string;
|
|
163
|
-
}) => Promise<import("openai/resources/beta/threads/runs/runs").Run & {
|
|
164
|
-
_request_id?: string | null;
|
|
165
|
-
}>;
|
|
166
|
-
handleRunStatus: ({ threadId, run, callback, }: {
|
|
167
|
-
run: import("openai/resources/beta/threads/runs/runs").Run;
|
|
168
|
-
threadId: string;
|
|
169
|
-
callback?: (run: import("openai/resources/beta/threads/runs/runs").Run) => void;
|
|
170
|
-
}) => Promise<any>;
|
|
171
|
-
handleRequiresAction: ({ threadId, run, callback, }: {
|
|
172
|
-
threadId: string;
|
|
173
|
-
run: import("openai/resources/beta/threads/runs/runs").Run;
|
|
174
|
-
callback?: (run: import("openai/resources/beta/threads/runs/runs").Run) => void;
|
|
175
|
-
}) => Promise<any>;
|
|
176
|
-
createUserMessage: ({ threadId, content, }: {
|
|
177
|
-
threadId: string;
|
|
178
|
-
content: string;
|
|
179
|
-
}) => Promise<import("openai/resources/beta/threads/messages").Message & {
|
|
180
|
-
_request_id?: string | null;
|
|
181
|
-
}>;
|
|
182
|
-
watchRun: ({ runId, threadId, callback, }: {
|
|
183
|
-
runId?: string;
|
|
184
|
-
threadId: string;
|
|
185
|
-
callback?: (run: import("openai/resources/beta/threads/runs/runs").Run) => void;
|
|
186
|
-
}) => Promise<any>;
|
|
187
|
-
} | (({ prompt }: {
|
|
188
|
-
prompt: string;
|
|
189
|
-
}) => Promise<import("ai").StreamTextResult<{}>>) | (({ prompt }: {
|
|
190
|
-
prompt: string;
|
|
191
|
-
}) => Promise<import("ai").GenerateTextResult<{}>>) | undefined>;
|
|
192
|
-
get openAIAssistant(): {
|
|
193
|
-
createAssistantAgent: ({ name, instructions, model, tools, response_format, }: {
|
|
194
|
-
name: string;
|
|
195
|
-
tools: import("openai/resources/beta/assistants").AssistantTool[];
|
|
196
|
-
model: string;
|
|
197
|
-
instructions: string;
|
|
198
|
-
response_format?: import("openai/resources/beta/threads/threads").AssistantResponseFormatOption;
|
|
199
|
-
}) => Promise<import("openai/resources/beta/assistants").Assistant & {
|
|
200
|
-
_request_id?: string | null;
|
|
201
|
-
}>;
|
|
202
|
-
getAssistantAgent: ({ id, toolMap, tool_choice, }: {
|
|
203
|
-
id: string;
|
|
204
|
-
toolMap: Record<string, any>;
|
|
205
|
-
tool_choice?: "auto" | "required";
|
|
206
|
-
}) => Promise<{
|
|
207
|
-
agent: import("openai/resources/beta/assistants").Assistant & {
|
|
208
|
-
_request_id?: string | null;
|
|
209
|
-
};
|
|
210
|
-
initializeThread: (messages?: import("openai/resources/beta/threads/threads").ThreadCreateParams.Message[]) => Promise<import("openai/resources/beta/threads/threads").Thread & {
|
|
211
|
-
_request_id?: string | null;
|
|
212
|
-
}>;
|
|
213
|
-
listMessages: ({ threadId }: {
|
|
214
|
-
threadId: string;
|
|
215
|
-
}) => Promise<import("openai/resources/beta/threads/messages").MessagesPage>;
|
|
216
|
-
getRun: ({ threadId, runId, }: {
|
|
217
|
-
threadId: string;
|
|
218
|
-
runId: string;
|
|
219
|
-
}) => Promise<import("openai/resources/beta/threads/runs/runs").Run & {
|
|
220
|
-
_request_id?: string | null;
|
|
221
|
-
}>;
|
|
222
|
-
handleRunStatus: ({ threadId, run, callback, }: {
|
|
223
|
-
run: import("openai/resources/beta/threads/runs/runs").Run;
|
|
224
|
-
threadId: string;
|
|
225
|
-
callback?: (run: import("openai/resources/beta/threads/runs/runs").Run) => void;
|
|
226
|
-
}) => Promise<any>;
|
|
227
|
-
handleRequiresAction: ({ threadId, run, callback, }: {
|
|
228
|
-
threadId: string;
|
|
229
|
-
run: import("openai/resources/beta/threads/runs/runs").Run;
|
|
230
|
-
callback?: (run: import("openai/resources/beta/threads/runs/runs").Run) => void;
|
|
231
|
-
}) => Promise<any>;
|
|
232
|
-
createUserMessage: ({ threadId, content, }: {
|
|
233
|
-
threadId: string;
|
|
234
|
-
content: string;
|
|
235
|
-
}) => Promise<import("openai/resources/beta/threads/messages").Message & {
|
|
236
|
-
_request_id?: string | null;
|
|
237
|
-
}>;
|
|
238
|
-
watchRun: ({ runId, threadId, callback, }: {
|
|
239
|
-
runId?: string;
|
|
240
|
-
threadId: string;
|
|
241
|
-
callback?: (run: import("openai/resources/beta/threads/runs/runs").Run) => void;
|
|
242
|
-
}) => Promise<any>;
|
|
243
|
-
}>;
|
|
244
|
-
updateAssistantAgent: ({ assistantId, name, instructions, model, tools, response_format, }: {
|
|
245
|
-
assistantId: string;
|
|
246
|
-
name: string;
|
|
247
|
-
tools: import("openai/resources/beta/assistants").AssistantTool[];
|
|
248
|
-
model: string;
|
|
249
|
-
instructions: string;
|
|
250
|
-
response_format?: import("openai/resources/beta/threads/threads").AssistantResponseFormatOption;
|
|
251
|
-
}) => Promise<void>;
|
|
252
|
-
};
|
|
253
|
-
__backgroundTasks(): Promise<void>;
|
|
254
|
-
}
|
|
255
1
|
//# sourceMappingURL=framework.d.ts.map
|
package/dist/framework.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export { IntegrationError } from './utils/errors';
|
|
3
|
-
export { DataLayer } from './data-access';
|
|
4
|
-
export { registerRoutes } from './next';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './lib';
|
|
7
|
-
export { Integration } from './integration';
|
|
8
|
-
export { IntegrationCredentialType } from './types';
|
|
9
|
-
export { PropertyType, Connection, Credential, Entity, Property, Record, } from '@prisma-app/client';
|
|
10
|
-
export { IntegrationAuth } from './authenticator';
|
|
11
|
-
export * from './utils';
|
|
12
|
-
export * from './next/utils';
|
|
13
|
-
export * from './schemas';
|
|
14
|
-
export * from './sync-factory';
|
|
15
|
-
export { Mastra } from './framework';
|
|
16
|
-
export { getPineconeIndices } from './agents/vector-sync';
|
|
17
|
-
export * from './generated-types';
|
|
18
|
-
export { getUpstashLogs } from './agents/file-logger';
|
|
1
|
+
export * from './next-src';
|
|
19
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4BA,cAAc,YAAY,CAAA"}
|
package/dist/integration.d.ts
CHANGED
|
@@ -1,99 +1 @@
|
|
|
1
|
-
import { IntegrationApi, IntegrationCredentialType, IntegrationEvent } from './types';
|
|
2
|
-
import { ZodSchema } from 'zod';
|
|
3
|
-
import { DataLayer } from './data-access';
|
|
4
|
-
import { IntegrationAuth } from './authenticator';
|
|
5
|
-
import { Connection } from '@prisma-app/client';
|
|
6
|
-
import { FilterObject } from './lib';
|
|
7
|
-
export type IntegrationConfig = {
|
|
8
|
-
name: string;
|
|
9
|
-
logoUrl: string;
|
|
10
|
-
scopes?: string[];
|
|
11
|
-
authType?: IntegrationCredentialType;
|
|
12
|
-
authConnectionOptions?: ZodSchema;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
15
|
-
export type CoreIntegrationPresets = {
|
|
16
|
-
redirectURI: string;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* @params T - The type of the client that the integration provides
|
|
20
|
-
*/
|
|
21
|
-
export declare class Integration<T = unknown> {
|
|
22
|
-
name: string;
|
|
23
|
-
logoUrl: string;
|
|
24
|
-
categories: string[];
|
|
25
|
-
description: string;
|
|
26
|
-
dataLayer?: DataLayer;
|
|
27
|
-
config: Omit<IntegrationConfig, 'name' | 'logoUrl'> & {
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
};
|
|
30
|
-
availableScopes?: {
|
|
31
|
-
key: string;
|
|
32
|
-
description: string;
|
|
33
|
-
}[];
|
|
34
|
-
events: Record<string, IntegrationEvent<any>>;
|
|
35
|
-
apis: Record<string, IntegrationApi<any>>;
|
|
36
|
-
entityTypes: Record<string, string>;
|
|
37
|
-
corePresets: CoreIntegrationPresets;
|
|
38
|
-
constructor(config: IntegrationConfig);
|
|
39
|
-
getConfig(): Omit<IntegrationConfig, "name" | "logoUrl"> & {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
};
|
|
42
|
-
getClientZodSchema(): any;
|
|
43
|
-
getCommentsForClientApis(): Record<string, {
|
|
44
|
-
comment: string;
|
|
45
|
-
doc?: string;
|
|
46
|
-
}>;
|
|
47
|
-
getBaseClient(): any;
|
|
48
|
-
getApiClient(params: {
|
|
49
|
-
connectionId: string;
|
|
50
|
-
}): Promise<any>;
|
|
51
|
-
getApi({ connectionId }: {
|
|
52
|
-
connectionId: string;
|
|
53
|
-
}): Promise<any>;
|
|
54
|
-
_convertApiClientToSystemApis: () => Promise<void>;
|
|
55
|
-
getAuthenticator(): IntegrationAuth;
|
|
56
|
-
makeClient: (params: {
|
|
57
|
-
connectionId: string;
|
|
58
|
-
}) => Promise<T>;
|
|
59
|
-
attachDataLayer({ dataLayer }: {
|
|
60
|
-
dataLayer: DataLayer;
|
|
61
|
-
}): void;
|
|
62
|
-
registerApis(): {};
|
|
63
|
-
getApis(): Record<string, IntegrationApi<any>>;
|
|
64
|
-
registerEvents<T extends Integration>(): Record<string, IntegrationEvent<T>>;
|
|
65
|
-
getEvents<T extends Integration>(): Record<string, IntegrationEvent<T>>;
|
|
66
|
-
query<T extends string | number | symbol>(props: {
|
|
67
|
-
connectionId: string;
|
|
68
|
-
entityType: any;
|
|
69
|
-
filters?: FilterObject<T>;
|
|
70
|
-
sort?: string[];
|
|
71
|
-
}): Promise<any>;
|
|
72
|
-
getEvent(name: string): IntegrationEvent<any>;
|
|
73
|
-
processWebhookRequest(params: {
|
|
74
|
-
reqBody: any;
|
|
75
|
-
event: string;
|
|
76
|
-
connectionsBySubscriptionId: (subscriptionId: string) => Promise<Connection[]>;
|
|
77
|
-
}): Promise<void>;
|
|
78
|
-
triggerEvent<T = Record<string, any>>({ key, data, user, }: {
|
|
79
|
-
key: string;
|
|
80
|
-
data: T;
|
|
81
|
-
user?: {
|
|
82
|
-
connectionId: string;
|
|
83
|
-
[key: string]: any;
|
|
84
|
-
};
|
|
85
|
-
}): Promise<import("inngest/types").SendEventOutput<{
|
|
86
|
-
id: string;
|
|
87
|
-
eventKey: string;
|
|
88
|
-
}>>;
|
|
89
|
-
test({ connectionId, }: {
|
|
90
|
-
connectionId: string;
|
|
91
|
-
}): Promise<string | null>;
|
|
92
|
-
onConnectionCreated({ connection, }: {
|
|
93
|
-
connection: Connection;
|
|
94
|
-
}): Promise<any>;
|
|
95
|
-
onDisconnect({ connectionId, }: {
|
|
96
|
-
connectionId: string;
|
|
97
|
-
}): Promise<any>;
|
|
98
|
-
}
|
|
99
1
|
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":""}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export * from './query-builder/types';
|
|
2
|
-
export * from './query-builder/schema';
|
|
3
|
-
export * from './query-builder/constants';
|
|
4
|
-
export * from './query-builder/utils';
|
|
5
1
|
export * from './utils/object';
|
|
6
|
-
export * from './logger-utils/logger';
|
|
7
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if object is empty
|
|
3
|
-
* @param objectName
|
|
4
|
-
* @returns boolean
|
|
5
|
-
*/
|
|
6
|
-
export declare const isObjectEmpty: (objectName: Object) => boolean;
|
|
7
1
|
/**
|
|
8
2
|
* Get a value from an object by a given path. This function emulates the behavior of lodash's _.get method.
|
|
9
3
|
*
|
|
@@ -12,40 +6,4 @@ export declare const isObjectEmpty: (objectName: Object) => boolean;
|
|
|
12
6
|
* @returns {unknown} The value at the given path in the object, or undefined if the path does not exist.
|
|
13
7
|
*/
|
|
14
8
|
export declare const getPath: (object: Record<string, any>, path: string | string[]) => unknown;
|
|
15
|
-
export declare function recordHasData(record: Record<any, any>): boolean;
|
|
16
|
-
export declare function isLiteralObject(a: unknown): boolean;
|
|
17
|
-
export declare const constructObjFromStringPath: (path: string, value: any) => Record<string, any>;
|
|
18
|
-
/**
|
|
19
|
-
* Flatten a nested object, flatten from flat package works - https://www.npmjs.com/package/flat
|
|
20
|
-
* but this allows you to define where you want it to stop by passing the keys that'll exist in the object you want it to stop at
|
|
21
|
-
*
|
|
22
|
-
* @param {Record<string, any>} object - The object to flatten.
|
|
23
|
-
* @param {string[]} endKeys - The keys you want each value (which will be an object in this case) in the flattened object to possible have (e.g., ['a', 'b', 'c']).
|
|
24
|
-
* @param {boolean} flattenArrayValue - This flag indicates that any array value should be flattened to object too.
|
|
25
|
-
* @returns {Record<string, any>} Your flattened object
|
|
26
|
-
*/
|
|
27
|
-
export declare const flattenObject: (object: Record<string, any>, endKeys?: string[], flattenArrayValue?: boolean) => Record<string, unknown>;
|
|
28
|
-
type AnyObject = {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Merges two objects, ensuring that only defined properties from the second object
|
|
33
|
-
* override those in the first object.
|
|
34
|
-
*
|
|
35
|
-
* @template T - The type of the base object.
|
|
36
|
-
* @template U - The type of the overrides object.
|
|
37
|
-
* @param {T} base - The base object whose properties will be overridden.
|
|
38
|
-
* @param {U} overrides - The object containing properties to override in the base object.
|
|
39
|
-
* Only properties that are defined (not `undefined`) will override.
|
|
40
|
-
* @returns {T & U} - A new object that combines properties from both `base` and `overrides`.
|
|
41
|
-
* Properties in `base` will be overridden by defined properties in `overrides`.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* const worksheetData = { a: 1, b: 2, c: 3 };
|
|
45
|
-
* const payload = { b: undefined, c: 4 };
|
|
46
|
-
* const extendedData = mergeWithDefinedOnly(worksheetData, payload);
|
|
47
|
-
* // extendedData = { a: 1, b: 2, c: 4 }
|
|
48
|
-
*/
|
|
49
|
-
export declare function mergeWithDefinedOnly<T extends AnyObject, U extends AnyObject>(base: T, overrides: U): T & U;
|
|
50
|
-
export {};
|
|
51
9
|
//# sourceMappingURL=object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/object.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,WACV,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QACrB,MAAM,GAAG,MAAM,EAAE,KACtB,OASF,CAAC"}
|
package/dist/next/callback.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../src/next/callback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../src/next/callback.ts"],"names":[],"mappings":""}
|
package/dist/next/connect.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/next/connect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/next/connect.ts"],"names":[],"mappings":""}
|
package/dist/next/cron.d.ts
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import { Mastra } from '../framework';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
export declare const makeCron: (framework: Mastra) => (req: NextRequest) => NextResponse<{
|
|
5
|
-
error: z.ZodError<any>;
|
|
6
|
-
status: number;
|
|
7
|
-
}> | NextResponse<{
|
|
8
|
-
error: string;
|
|
9
|
-
status: number;
|
|
10
|
-
}> | NextResponse<{
|
|
11
|
-
message: string;
|
|
12
|
-
}>;
|
|
13
1
|
//# sourceMappingURL=cron.d.ts.map
|
package/dist/next/cron.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../src/next/cron.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../src/next/cron.ts"],"names":[],"mappings":""}
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import { Mastra } from '../framework';
|
|
3
|
-
import { makeConnect } from './connect';
|
|
4
|
-
import { makeCallback } from './callback';
|
|
5
|
-
import { makeInngest } from './inngest';
|
|
6
|
-
import { makeWebhook } from './webhook';
|
|
7
|
-
type PathParams = {
|
|
8
|
-
[key: string]: string[];
|
|
9
|
-
};
|
|
10
|
-
export declare const registerRoutes: ({ framework }: {
|
|
11
|
-
framework: Mastra;
|
|
12
|
-
}) => (req: NextRequest, { params }: {
|
|
13
|
-
params: PathParams;
|
|
14
|
-
}) => NextResponse<unknown> | Promise<Response>;
|
|
15
|
-
export { makeConnect, makeCallback, makeInngest, makeWebhook };
|
|
16
1
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/next/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":""}
|
package/dist/next/inngest.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inngest.d.ts","sourceRoot":"","sources":["../../src/next/inngest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inngest.d.ts","sourceRoot":"","sources":["../../src/next/inngest.ts"],"names":[],"mappings":""}
|
package/dist/next/utils.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import { headers } from 'next/headers';
|
|
2
|
-
import { NextRequest } from 'next/server';
|
|
3
|
-
import { z, ZodSchema } from 'zod';
|
|
4
|
-
export declare const parseQueryParams: <T>(req: NextRequest, schema: ZodSchema) => {
|
|
5
|
-
success: boolean;
|
|
6
|
-
data: T;
|
|
7
|
-
error: z.ZodError<any> | undefined;
|
|
8
|
-
};
|
|
9
|
-
export declare const nextHeaders: typeof headers;
|
|
10
1
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/next/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/next/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/next/utils.ts"],"names":[],"mappings":""}
|
package/dist/next/webhook.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import { Mastra } from '../framework';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
export declare const makeWebhook: (framework: Mastra) => (req: NextRequest) => NextResponse<{
|
|
5
|
-
error: z.ZodError<any>;
|
|
6
|
-
status: number;
|
|
7
|
-
}> | NextResponse<{
|
|
8
|
-
message: string;
|
|
9
|
-
}>;
|
|
10
1
|
//# sourceMappingURL=webhook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/next/webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/next/webhook.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { UserContent } from 'ai';
|
|
2
|
+
import { Integration } from '../integration';
|
|
3
|
+
import { Logger } from '../logger';
|
|
4
|
+
import { AllTools, ToolApi } from '../tools/types';
|
|
5
|
+
type OpenAIVercelModelNames = 'gpt-4' | 'gpt-4-turbo' | 'gpt-3.5-turbo';
|
|
6
|
+
type OpenAIVercelConfig = {
|
|
7
|
+
provider: 'OPEN_AI_VERCEL';
|
|
8
|
+
name: OpenAIVercelModelNames;
|
|
9
|
+
toolChoice: 'auto' | 'required';
|
|
10
|
+
};
|
|
11
|
+
type AnthropicVercelModelNames = 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-3-5-sonnet-20240620';
|
|
12
|
+
type AnthropicVercelConfig = {
|
|
13
|
+
provider: 'ANTHROPIC_VERCEL';
|
|
14
|
+
name: AnthropicVercelModelNames;
|
|
15
|
+
toolChoice: 'auto' | 'required';
|
|
16
|
+
};
|
|
17
|
+
type GroqVercelModelNames = 'llama3-groq-70b-8192-tool-use-preview' | 'llama3-groq-8b-8192-tool-use-preview' | 'gemma2-9b-it' | 'gemma-7b-it';
|
|
18
|
+
type GroqVercelConfig = {
|
|
19
|
+
provider: 'GROQ_VERCEL';
|
|
20
|
+
name: GroqVercelModelNames;
|
|
21
|
+
toolChoice: 'auto' | 'required';
|
|
22
|
+
};
|
|
23
|
+
type ModelConfig = OpenAIVercelConfig | AnthropicVercelConfig | GroqVercelConfig;
|
|
24
|
+
export declare class Agent<TIntegrations extends Integration[] | undefined = undefined, TTools extends Record<string, ToolApi<TIntegrations>> | undefined = undefined, TKeys extends keyof AllTools<TIntegrations, TTools> = keyof AllTools<TIntegrations, TTools>> {
|
|
25
|
+
#private;
|
|
26
|
+
name: string;
|
|
27
|
+
readonly instructions: string;
|
|
28
|
+
readonly model: ModelConfig;
|
|
29
|
+
readonly enabledTools: Partial<Record<TKeys, boolean>>;
|
|
30
|
+
logger: Logger;
|
|
31
|
+
constructor(config: {
|
|
32
|
+
name: string;
|
|
33
|
+
instructions: string;
|
|
34
|
+
model: ModelConfig;
|
|
35
|
+
enabledTools?: Partial<Record<TKeys, boolean>>;
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Set the concrete tools for the agent
|
|
39
|
+
* @param tools
|
|
40
|
+
*/
|
|
41
|
+
__setTools(tools: Record<TKeys, ToolApi>): void;
|
|
42
|
+
/**
|
|
43
|
+
* Set the logger for the agent
|
|
44
|
+
* @param logger
|
|
45
|
+
*/
|
|
46
|
+
__setLogger(logger: Logger): void;
|
|
47
|
+
private getModelType;
|
|
48
|
+
private convertTools;
|
|
49
|
+
private getAgentParams;
|
|
50
|
+
private createOpenAICompatibleModel;
|
|
51
|
+
text({ messages, onStepFinish, maxSteps, }: {
|
|
52
|
+
messages: UserContent[];
|
|
53
|
+
onStepFinish?: (step: string) => void;
|
|
54
|
+
maxSteps?: number;
|
|
55
|
+
}): Promise<import("ai").GenerateTextResult<{}>>;
|
|
56
|
+
stream({ messages, onStepFinish, maxSteps, }: {
|
|
57
|
+
messages: UserContent[];
|
|
58
|
+
onStepFinish?: (step: string) => void;
|
|
59
|
+
maxSteps?: number;
|
|
60
|
+
}): Promise<import("ai").StreamTextResult<{}>>;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|