@decocms/runtime 0.24.0

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 (61) hide show
  1. package/dist/admin.d.ts +5 -0
  2. package/dist/admin.js +21 -0
  3. package/dist/admin.js.map +1 -0
  4. package/dist/bindings/deconfig/index.d.ts +10 -0
  5. package/dist/bindings/deconfig/index.js +10 -0
  6. package/dist/bindings/deconfig/index.js.map +1 -0
  7. package/dist/bindings/index.d.ts +1054 -0
  8. package/dist/bindings/index.js +133 -0
  9. package/dist/bindings/index.js.map +1 -0
  10. package/dist/chunk-377XXI4J.js +764 -0
  11. package/dist/chunk-377XXI4J.js.map +1 -0
  12. package/dist/chunk-4UQ5U73Y.js +129 -0
  13. package/dist/chunk-4UQ5U73Y.js.map +1 -0
  14. package/dist/chunk-4XSQKJLU.js +105 -0
  15. package/dist/chunk-4XSQKJLU.js.map +1 -0
  16. package/dist/chunk-73FIKR3X.js +128 -0
  17. package/dist/chunk-73FIKR3X.js.map +1 -0
  18. package/dist/chunk-AOFOWQXY.js +27 -0
  19. package/dist/chunk-AOFOWQXY.js.map +1 -0
  20. package/dist/chunk-G3NWZG2F.js +155 -0
  21. package/dist/chunk-G3NWZG2F.js.map +1 -0
  22. package/dist/chunk-I7BWSAN6.js +49 -0
  23. package/dist/chunk-I7BWSAN6.js.map +1 -0
  24. package/dist/chunk-UHR3BLMF.js +92 -0
  25. package/dist/chunk-UHR3BLMF.js.map +1 -0
  26. package/dist/chunk-ZPUT6RN6.js +32 -0
  27. package/dist/chunk-ZPUT6RN6.js.map +1 -0
  28. package/dist/chunk-ZRJ5SGAO.js +494 -0
  29. package/dist/chunk-ZRJ5SGAO.js.map +1 -0
  30. package/dist/client.d.ts +28 -0
  31. package/dist/client.js +5 -0
  32. package/dist/client.js.map +1 -0
  33. package/dist/connection-DDtQYrea.d.ts +30 -0
  34. package/dist/d1-store.d.ts +9 -0
  35. package/dist/d1-store.js +4 -0
  36. package/dist/d1-store.js.map +1 -0
  37. package/dist/drizzle.d.ts +48 -0
  38. package/dist/drizzle.js +121 -0
  39. package/dist/drizzle.js.map +1 -0
  40. package/dist/index-BBAR4TQu.d.ts +530 -0
  41. package/dist/index-D_J_044C.d.ts +461 -0
  42. package/dist/index.d.ts +9 -0
  43. package/dist/index.js +634 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/mastra.d.ts +9 -0
  46. package/dist/mastra.js +6 -0
  47. package/dist/mastra.js.map +1 -0
  48. package/dist/mcp-Bv7IAgWX.d.ts +109 -0
  49. package/dist/mcp-client.d.ts +236 -0
  50. package/dist/mcp-client.js +4 -0
  51. package/dist/mcp-client.js.map +1 -0
  52. package/dist/proxy.d.ts +10 -0
  53. package/dist/proxy.js +5 -0
  54. package/dist/proxy.js.map +1 -0
  55. package/dist/resources.d.ts +393 -0
  56. package/dist/resources.js +4 -0
  57. package/dist/resources.js.map +1 -0
  58. package/dist/views.d.ts +72 -0
  59. package/dist/views.js +4 -0
  60. package/dist/views.js.map +1 -0
  61. package/package.json +91 -0
@@ -0,0 +1,461 @@
1
+ import { DurableObjectNamespace as DurableObjectNamespace$1, ExecutionContext as ExecutionContext$1 } from '@cloudflare/workers-types';
2
+ import { z } from 'zod';
3
+ import { ToolExecutionContext, ToolAction, Tool, Workflow as Workflow$1 } from '@mastra/core';
4
+ import { RuntimeContext } from '@mastra/core/di';
5
+ import { createWorkflow, Step as Step$1, ExecuteFunction, DefaultEngineType } from '@mastra/core/workflows';
6
+ import { ResourceCreateInputSchema, ResourceUpdateInputSchema, ResourceDeleteInputSchema } from './resources.js';
7
+ import { Q as QueryResult } from './mcp-Bv7IAgWX.js';
8
+ import { M as MCPConnection } from './connection-DDtQYrea.js';
9
+
10
+ declare const createRuntimeContext: (prev?: RuntimeContext<AppContext>) => RuntimeContext<AppContext<any>>;
11
+ /**
12
+ * creates a private tool that always ensure for athentication before being executed
13
+ */
14
+ declare function createPrivateTool<TSchemaIn extends z.ZodSchema = z.ZodSchema, TSchemaOut extends z.ZodSchema | undefined = undefined, TSuspendSchema extends z.ZodSchema = z.ZodSchema, TResumeSchema extends z.ZodSchema = z.ZodSchema, TContext extends ToolExecutionContext<TSchemaIn> = ToolExecutionContext<TSchemaIn>, TExecute extends ToolAction<TSchemaIn, TSchemaOut, any, any, TContext>["execute"] = ToolAction<TSchemaIn, TSchemaOut, any, any, TContext>["execute"]>(opts: ToolAction<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext> & {
15
+ execute?: TExecute;
16
+ }): [TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TExecute] extends [
17
+ z.ZodSchema,
18
+ z.ZodSchema,
19
+ z.ZodSchema,
20
+ z.ZodSchema,
21
+ Function
22
+ ] ? Tool<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext> & {
23
+ inputSchema: TSchemaIn;
24
+ outputSchema: TSchemaOut;
25
+ execute: (context: TContext) => Promise<any>;
26
+ } : Tool<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext>;
27
+ declare function createTool<TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TSuspendSchema extends z.ZodSchema = z.ZodSchema, TResumeSchema extends z.ZodSchema = z.ZodSchema, TContext extends ToolExecutionContext<TSchemaIn, TSuspendSchema, TResumeSchema> = ToolExecutionContext<TSchemaIn, TSuspendSchema, TResumeSchema>, TExecute extends ToolAction<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext>["execute"] = ToolAction<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext>["execute"]>(opts: ToolAction<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext> & {
28
+ execute?: TExecute;
29
+ }): [TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TExecute] extends [
30
+ z.ZodSchema,
31
+ z.ZodSchema,
32
+ z.ZodSchema,
33
+ z.ZodSchema,
34
+ Function
35
+ ] ? Tool<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext> & {
36
+ inputSchema: TSchemaIn;
37
+ outputSchema: TSchemaOut;
38
+ execute: (context: TContext) => Promise<any>;
39
+ } : Tool<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext>;
40
+ type ExecWithContext<TF extends (...args: any[]) => any> = (input: Omit<Parameters<TF>[0], "runtimeContext"> & {
41
+ runtimeContext: RuntimeContext<AppContext>;
42
+ }) => ReturnType<TF>;
43
+ interface Step<TStepId extends string = string, TState extends z.ZodObject<any> = z.ZodObject<any, z.$strip>, TSchemaIn extends z.ZodType<any> = z.ZodType<any>, TSchemaOut extends z.ZodType<any> = z.ZodType<any>, TResumeSchema extends z.ZodType<any> = z.ZodType<any>, TSuspendSchema extends z.ZodType<any> = z.ZodType<any>, TEngineType = any> extends Omit<Step$1<TStepId, TState, TSchemaIn, TSchemaOut, TResumeSchema, TSuspendSchema, TEngineType>, "execute"> {
44
+ execute: ExecWithContext<ExecuteFunction<z.infer<TState>, z.infer<TSchemaIn>, z.infer<TSchemaOut>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, TEngineType>>;
45
+ }
46
+ declare function createStepFromTool<TSchemaIn extends z.ZodType<any>, TSchemaOut extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TContext extends ToolExecutionContext<TSchemaIn, TSuspendSchema, TResumeSchema>>(tool: Tool<TSchemaIn, TSchemaOut, TSuspendSchema, TResumeSchema, TContext> & {
47
+ inputSchema: TSchemaIn;
48
+ outputSchema: TSchemaOut;
49
+ execute: (context: TContext) => Promise<any>;
50
+ }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>, DefaultEngineType>;
51
+ declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(opts: {
52
+ id: TStepId;
53
+ description?: string;
54
+ inputSchema: TStepInput;
55
+ outputSchema: TStepOutput;
56
+ resumeSchema?: TResumeSchema;
57
+ suspendSchema?: TSuspendSchema;
58
+ execute: ExecWithContext<ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, DefaultEngineType>>;
59
+ }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, DefaultEngineType>;
60
+ interface ViewExport {
61
+ title: string;
62
+ icon: string;
63
+ url: string;
64
+ tools?: string[];
65
+ rules?: string[];
66
+ installBehavior?: "none" | "open" | "autoPin";
67
+ }
68
+ type Resources<Env = any, TSchema extends z.ZodTypeAny = never> = Array<(env: Env & DefaultEnv<TSchema>) => {
69
+ name: string;
70
+ icon: string;
71
+ title: string;
72
+ description?: string;
73
+ tools: {
74
+ read: (args: {
75
+ uri: string;
76
+ }) => Promise<unknown>;
77
+ search: (args: {
78
+ term: string;
79
+ cursor?: string;
80
+ limit?: number;
81
+ }) => Promise<unknown>;
82
+ create?: (args: z.infer<typeof ResourceCreateInputSchema>) => Promise<unknown>;
83
+ update?: (args: z.infer<typeof ResourceUpdateInputSchema>) => Promise<unknown>;
84
+ delete?: (args: z.infer<typeof ResourceDeleteInputSchema>) => Promise<unknown>;
85
+ };
86
+ views?: {
87
+ list?: {
88
+ url?: string;
89
+ tools?: string[];
90
+ rules?: string[];
91
+ };
92
+ detail?: {
93
+ url?: string;
94
+ mimeTypePattern?: string;
95
+ resourceName?: string;
96
+ tools?: string[];
97
+ rules?: string[];
98
+ };
99
+ };
100
+ }>;
101
+ interface Integration {
102
+ id: string;
103
+ appId: string;
104
+ }
105
+ type CreatedTool = ReturnType<typeof createTool>;
106
+ interface CreateMCPServerOptions<Env = any, TSchema extends z.ZodTypeAny = never> {
107
+ before?: (env: Env & DefaultEnv<TSchema>) => Promise<void> | void;
108
+ oauth?: {
109
+ state?: TSchema;
110
+ scopes?: string[];
111
+ };
112
+ views?: (env: Env & DefaultEnv<TSchema>) => Promise<ViewExport[]> | ViewExport[];
113
+ resources?: Resources<Env, TSchema>;
114
+ tools?: Array<(env: Env & DefaultEnv<TSchema>) => Promise<CreatedTool> | CreatedTool | CreatedTool[] | Promise<CreatedTool[]>> | ((env: Env & DefaultEnv<TSchema>) => CreatedTool[] | Promise<CreatedTool[]>);
115
+ workflows?: Array<(env: Env & DefaultEnv<TSchema>) => Promise<{
116
+ workflow: ReturnType<typeof createWorkflow>;
117
+ }> | ReturnType<typeof createWorkflow>>;
118
+ }
119
+ type Fetch<TEnv = any> = (req: Request, env: TEnv, ctx: ExecutionContext) => Promise<Response> | Response;
120
+ interface AppContext<TEnv = any> {
121
+ env: TEnv;
122
+ ctx: {
123
+ waitUntil: (promise: Promise<any>) => void;
124
+ };
125
+ req?: Request;
126
+ }
127
+ type CallTool = (opts: {
128
+ toolCallId: string;
129
+ toolCallInput: any;
130
+ }) => Promise<any>;
131
+ type MCPServer<TEnv = any, TSchema extends z.ZodTypeAny = never> = {
132
+ fetch: Fetch<TEnv & DefaultEnv<TSchema>>;
133
+ callTool: CallTool;
134
+ };
135
+ declare const isWorkflow: (value: any) => value is Workflow$1;
136
+ declare const createMCPServer: <TEnv = any, TSchema extends z.ZodTypeAny = never>(options: CreateMCPServerOptions<TEnv, TSchema>) => MCPServer<TEnv, TSchema>;
137
+
138
+ interface StartWorkflowArgs {
139
+ workflowId: string;
140
+ args: unknown;
141
+ runId?: string;
142
+ ctx: RequestContext;
143
+ }
144
+ interface CancelWorkflowArgs {
145
+ workflowId: string;
146
+ runId?: string;
147
+ ctx: RequestContext;
148
+ }
149
+ interface ResumeWorkflowArgs {
150
+ workflowId: string;
151
+ runId?: string;
152
+ resumeData: unknown;
153
+ stepId: string;
154
+ ctx: RequestContext;
155
+ }
156
+ interface WorkflowDO extends Rpc.DurableObjectBranded {
157
+ start: (args: StartWorkflowArgs) => Promise<{
158
+ runId: string;
159
+ }>;
160
+ cancel: (args: CancelWorkflowArgs) => Promise<{
161
+ cancelled: boolean;
162
+ }>;
163
+ resume: (args: ResumeWorkflowArgs) => Promise<{
164
+ resumed: boolean;
165
+ }>;
166
+ }
167
+ declare const Workflow: (server: MCPServer<any, any>, workflows?: CreateMCPServerOptions["workflows"]) => {
168
+ new (ctx: DurableObjectState<{}>, env: DefaultEnv): {
169
+ ctx: DurableObjectState<{}>;
170
+ env: DefaultEnv;
171
+ bindings(ctx: RequestContext): DefaultEnv<any>;
172
+ runWithContext<T>(ctx: RequestContext, f: (ctx: DefaultEnv) => Promise<T>): Promise<T>;
173
+ "__#private@#getWorkflow"(workflowId: string, bindings: DefaultEnv): Promise<{
174
+ workflow: Workflow$1;
175
+ }>;
176
+ start({ workflowId, runId, args, ctx }: StartWorkflowArgs): Promise<{
177
+ runId: string;
178
+ }>;
179
+ cancel({ workflowId, runId, ctx }: CancelWorkflowArgs): Promise<{
180
+ cancelled: boolean;
181
+ }>;
182
+ resume({ workflowId, runId, resumeData, stepId, ctx }: ResumeWorkflowArgs): Promise<{
183
+ resumed: boolean;
184
+ }>;
185
+ fetch?(request: Request): Response | Promise<Response>;
186
+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
187
+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;
188
+ webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;
189
+ webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
190
+ __DURABLE_OBJECT_BRAND: never;
191
+ };
192
+ };
193
+
194
+ interface DeprecatedEnv<TSchema extends z.ZodTypeAny = any> {
195
+ /**
196
+ * @deprecated Use DECO_REQUEST_CONTEXT instead
197
+ */
198
+ DECO_CHAT_REQUEST_CONTEXT: RequestContext<TSchema>;
199
+ /**
200
+ * @deprecated Use DECO_APP_NAME instead
201
+ */
202
+ DECO_CHAT_APP_NAME: string;
203
+ /**
204
+ * @deprecated Use DECO_APP_SLUG instead
205
+ */
206
+ DECO_CHAT_APP_SLUG: string;
207
+ /**
208
+ * @deprecated Use DECO_APP_ENTRYPOINT instead
209
+ */
210
+ DECO_CHAT_APP_ENTRYPOINT: string;
211
+ /**
212
+ * @deprecated Use DECO_API_URL instead
213
+ */
214
+ DECO_CHAT_API_URL?: string;
215
+ /**
216
+ * @deprecated Use DECO_WORKSPACE instead
217
+ */
218
+ DECO_CHAT_WORKSPACE: string;
219
+ /**
220
+ * @deprecated Use DECO_API_JWT_PUBLIC_KEY instead
221
+ */
222
+ DECO_CHAT_API_JWT_PUBLIC_KEY: string;
223
+ /**
224
+ * @deprecated Use DECO_APP_DEPLOYMENT_ID instead
225
+ */
226
+ DECO_CHAT_APP_DEPLOYMENT_ID: string;
227
+ /**
228
+ * @deprecated Use DECO_BINDINGS instead
229
+ */
230
+ DECO_CHAT_BINDINGS: string;
231
+ /**
232
+ * @deprecated Use DECO_API_TOKEN instead
233
+ */
234
+ DECO_CHAT_API_TOKEN: string;
235
+ /**
236
+ * @deprecated Use DECO_WORKFLOW_DO instead
237
+ */
238
+ DECO_CHAT_WORKFLOW_DO: DurableObjectNamespace$1<WorkflowDO>;
239
+ /**
240
+ * @deprecated Use DECO_WORKSPACE_DB instead
241
+ */
242
+ DECO_CHAT_WORKSPACE_DB: WorkspaceDB & {
243
+ forContext: (ctx: RequestContext) => WorkspaceDB;
244
+ };
245
+ }
246
+
247
+ interface BindingBase {
248
+ name: string;
249
+ }
250
+ interface MCPIntegrationIdBinding extends BindingBase {
251
+ type: "mcp";
252
+ /**
253
+ * If not provided, will return a function that takes the integration id and return the binding implementation..
254
+ */
255
+ integration_id: string;
256
+ }
257
+ interface MCPIntegrationNameBinding extends BindingBase {
258
+ type: "mcp";
259
+ /**
260
+ * The name of the integration to bind.
261
+ */
262
+ integration_name: string;
263
+ }
264
+ interface ContractClause {
265
+ id: string;
266
+ price: string | number;
267
+ description?: string;
268
+ }
269
+ interface Contract {
270
+ body: string;
271
+ clauses: ContractClause[];
272
+ }
273
+ interface ContractBinding extends BindingBase {
274
+ type: "contract";
275
+ /**
276
+ * The clauses of this contract
277
+ */
278
+ contract: Contract;
279
+ }
280
+ type MCPBinding = MCPIntegrationIdBinding | MCPIntegrationNameBinding;
281
+ type Binding = MCPBinding | ContractBinding;
282
+ interface MigrationBase {
283
+ tag: string;
284
+ }
285
+ interface NewClassMigration extends MigrationBase {
286
+ new_classes?: string[];
287
+ new_sqlite_classes?: string[];
288
+ }
289
+ interface DeletedClassMigration extends MigrationBase {
290
+ deleted_classes: string[];
291
+ }
292
+ interface RenamedClassMigration extends MigrationBase {
293
+ renamed_classes: {
294
+ from: string;
295
+ to: string;
296
+ }[];
297
+ }
298
+ type Migration = NewClassMigration | DeletedClassMigration | RenamedClassMigration;
299
+ interface KVNamespace {
300
+ binding: string;
301
+ id: string;
302
+ }
303
+ interface Triggers {
304
+ crons: string[];
305
+ }
306
+ interface Route {
307
+ pattern: string;
308
+ custom_domain?: boolean;
309
+ }
310
+ interface WranglerConfig {
311
+ name: string;
312
+ main?: string;
313
+ scope?: string;
314
+ main_module?: string;
315
+ routes?: Route[];
316
+ compatibility_date?: string;
317
+ compatibility_flags?: string[];
318
+ vars?: Record<string, string>;
319
+ kv_namespaces?: KVNamespace[];
320
+ triggers?: Triggers;
321
+ ai?: {
322
+ binding: string;
323
+ };
324
+ browser?: {
325
+ binding: string;
326
+ };
327
+ durable_objects?: {
328
+ bindings?: {
329
+ name: string;
330
+ class_name: string;
331
+ }[];
332
+ };
333
+ hyperdrive?: {
334
+ binding: string;
335
+ id: string;
336
+ localConnectionString: string;
337
+ }[];
338
+ d1_databases?: {
339
+ database_name: string;
340
+ database_id?: string;
341
+ binding: string;
342
+ }[];
343
+ queues?: {
344
+ consumers?: {
345
+ queue: string;
346
+ max_batch_timeout: number;
347
+ }[];
348
+ producers?: {
349
+ queue: string;
350
+ binding: string;
351
+ }[];
352
+ };
353
+ workflows?: {
354
+ name: string;
355
+ binding: string;
356
+ class_name?: string;
357
+ script_name?: string;
358
+ }[];
359
+ migrations?: Migration[];
360
+ assets?: {
361
+ directory?: string;
362
+ binding?: string;
363
+ jwt?: string;
364
+ not_found_handling?: "none" | "404-page" | "single-page-application";
365
+ run_worker_first?: boolean;
366
+ };
367
+ keep_assets?: boolean;
368
+ deco?: {
369
+ enable_workflows?: boolean;
370
+ workspace?: string;
371
+ local?: boolean;
372
+ integration?: {
373
+ friendlyName?: string;
374
+ icon?: string;
375
+ description?: string;
376
+ };
377
+ bindings?: Binding[];
378
+ };
379
+ }
380
+
381
+ type WorkspaceClientContext = Omit<RequestContext, "ensureAuthenticated" | "state" | "fetchIntegrationMetadata">;
382
+ declare const proxyConnectionForId: (integrationId: string, ctx: Omit<WorkspaceClientContext, "token"> & {
383
+ token?: string;
384
+ cookie?: string;
385
+ }, decoChatApiUrl?: string, appName?: string) => MCPConnection;
386
+
387
+ interface WorkspaceDB {
388
+ query: (params: {
389
+ sql: string;
390
+ params: string[];
391
+ }) => Promise<{
392
+ result: QueryResult[];
393
+ }>;
394
+ }
395
+ interface DefaultEnv<TSchema extends z.ZodTypeAny = any> extends DeprecatedEnv<TSchema> {
396
+ DECO_REQUEST_CONTEXT: RequestContext<TSchema>;
397
+ DECO_APP_NAME: string;
398
+ DECO_APP_SLUG: string;
399
+ DECO_APP_ENTRYPOINT: string;
400
+ DECO_API_URL?: string;
401
+ DECO_WORKSPACE: string;
402
+ DECO_API_JWT_PUBLIC_KEY: string;
403
+ DECO_APP_DEPLOYMENT_ID: string;
404
+ DECO_BINDINGS: string;
405
+ DECO_API_TOKEN: string;
406
+ DECO_WORKFLOW_DO: DurableObjectNamespace<WorkflowDO>;
407
+ DECO_WORKSPACE_DB: WorkspaceDB & {
408
+ forContext: (ctx: RequestContext) => WorkspaceDB;
409
+ };
410
+ IS_LOCAL: boolean;
411
+ [key: string]: unknown;
412
+ }
413
+ interface BindingsObject {
414
+ bindings?: Binding[];
415
+ }
416
+ declare const WorkersMCPBindings: {
417
+ parse: (bindings?: string) => Binding[];
418
+ stringify: (bindings: Binding[]) => string;
419
+ };
420
+ interface UserDefaultExport<TUserEnv = Record<string, unknown>, TSchema extends z.ZodTypeAny = never, TEnv = TUserEnv & DefaultEnv<TSchema>> extends CreateMCPServerOptions<TEnv, TSchema> {
421
+ fetch?: (req: Request, env: TEnv, ctx: ExecutionContext$1) => Promise<Response> | Response;
422
+ }
423
+ interface User {
424
+ id: string;
425
+ email: string;
426
+ workspace: string;
427
+ user_metadata: {
428
+ avatar_url: string;
429
+ full_name: string;
430
+ picture: string;
431
+ [key: string]: unknown;
432
+ };
433
+ }
434
+ interface RequestContext<TSchema extends z.ZodTypeAny = any> {
435
+ state: z.infer<TSchema>;
436
+ branch?: string;
437
+ token: string;
438
+ workspace: string;
439
+ ensureAuthenticated: (options?: {
440
+ workspaceHint?: string;
441
+ }) => User | undefined;
442
+ callerApp?: string;
443
+ integrationId?: string;
444
+ }
445
+ declare class UnauthorizedError extends Error {
446
+ redirectTo: URL;
447
+ constructor(message: string, redirectTo: URL);
448
+ }
449
+ declare const withBindings: <TEnv>({ env: _env, server, tokenOrContext, origin, url, branch, }: {
450
+ env: TEnv;
451
+ server: MCPServer<TEnv, any>;
452
+ tokenOrContext?: string | RequestContext;
453
+ origin?: string | null;
454
+ url?: string;
455
+ branch?: string | null;
456
+ }) => TEnv;
457
+ declare const withRuntime: <TEnv, TSchema extends z.ZodTypeAny = never>(userFns: UserDefaultExport<TEnv, TSchema>) => ExportedHandler<TEnv & DefaultEnv<TSchema>> & {
458
+ Workflow: ReturnType<typeof Workflow>;
459
+ };
460
+
461
+ export { type AppContext as A, type BindingsObject as B, type CreatedTool as C, type DefaultEnv as D, type ExecWithContext as E, type Fetch as F, type Integration as I, type MCPServer as M, type Resources as R, type Step as S, type UserDefaultExport as U, type ViewExport as V, type WorkspaceDB as W, createRuntimeContext as a, createTool as b, createPrivateTool as c, createStepFromTool as d, createStep as e, type CreateMCPServerOptions as f, createMCPServer as g, WorkersMCPBindings as h, isWorkflow as i, type User as j, type RequestContext as k, UnauthorizedError as l, withRuntime as m, type Contract as n, type Migration as o, proxyConnectionForId as p, type WranglerConfig as q, withBindings as w };
@@ -0,0 +1,9 @@
1
+ import '@cloudflare/workers-types';
2
+ import 'zod';
3
+ export { B as BindingsObject, n as Contract, D as DefaultEnv, o as Migration, k as RequestContext, l as UnauthorizedError, j as User, U as UserDefaultExport, h as WorkersMCPBindings, W as WorkspaceDB, q as WranglerConfig, p as proxyConnectionForId, w as withBindings, m as withRuntime } from './index-D_J_044C.js';
4
+ export { C as CreateStubAPIOptions, T as ToolBinder, c as createMCPFetchStub } from './mcp-Bv7IAgWX.js';
5
+ import '@mastra/core';
6
+ import '@mastra/core/di';
7
+ import '@mastra/core/workflows';
8
+ import './resources.js';
9
+ import './connection-DDtQYrea.js';