@decocms/runtime 0.0.1-testing-beta.1 → 0.0.1-testing-beta.3

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.
@@ -1,9 +1,9 @@
1
- export { D as DeconfigClient, i as DeconfigResource, b as DeconfigResourceOptions, E as EnhancedResourcesTools, N as NotFoundError, h as RESOURCE_WATCH_BASE_PATHNAME, R as ResourcesBinding, d as ResourcesTools, U as UserInputError, W as WatchOptions, a as createDeconfigResource } from '../../index-kMsI0ELb.js';
1
+ export { D as DeconfigClient, i as DeconfigResource, b as DeconfigResourceOptions, E as EnhancedResourcesTools, N as NotFoundError, h as RESOURCE_WATCH_BASE_PATHNAME, R as ResourcesBinding, d as ResourcesTools, U as UserInputError, W as WatchOptions, a as createDeconfigResource } from '../../index-BKzwFALy.js';
2
2
  import '@mastra/core';
3
3
  import 'zod';
4
- import '../../index-AKVjfH4b.js';
4
+ import '../../index-oudm4zaO.js';
5
5
  import '@cloudflare/workers-types';
6
6
  import '@mastra/core/di';
7
- import '../../mcp-Bv7IAgWX.js';
7
+ import '../../mcp-yTBduksO.js';
8
8
  import '../../connection-DDtQYrea.js';
9
9
  import '../../resources.js';
@@ -1,10 +1,10 @@
1
1
  import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
- export { B as BaseResourceDataSchema, D as DeconfigClient, b as DeconfigResourceOptions, E as EnhancedResourcesTools, f as ResourceBinding, g as ResourceBindingsFunction, R as ResourcesBinding, d as ResourcesTools, a as createDeconfigResource, c as createResourceBindings, e as deconfigTools } from '../index-kMsI0ELb.js';
3
+ export { B as BaseResourceDataSchema, D as DeconfigClient, b as DeconfigResourceOptions, E as EnhancedResourcesTools, f as ResourceBinding, g as ResourceBindingsFunction, R as ResourcesBinding, d as ResourcesTools, a as createDeconfigResource, c as createResourceBindings, e as deconfigTools } from '../index-BKzwFALy.js';
4
4
  import * as _mastra_core from '@mastra/core';
5
5
  import { M as MCPConnection } from '../connection-DDtQYrea.js';
6
- import { c as createPrivateTool } from '../index-AKVjfH4b.js';
7
- import { T as ToolBinder, M as MCPClientFetchStub } from '../mcp-Bv7IAgWX.js';
6
+ import { c as createPrivateTool } from '../index-oudm4zaO.js';
7
+ import { T as ToolBinder, M as MCPClientFetchStub } from '../mcp-yTBduksO.js';
8
8
  import '@cloudflare/workers-types';
9
9
  import '@mastra/core/di';
10
10
  import '../resources.js';
@@ -310,13 +310,13 @@ declare const ViewBinding: {
310
310
  prompt: z.ZodOptional<z.ZodString>;
311
311
  installBehavior: z.ZodOptional<z.ZodEnum<["none", "open", "autoPin"]>>;
312
312
  }, "strip", z.ZodTypeAny, {
313
- tools: string[];
314
313
  title: string;
314
+ tools: string[];
315
315
  icon: string;
316
- id?: string | undefined;
317
- name?: string | undefined;
318
316
  url?: string | undefined;
317
+ name?: string | undefined;
319
318
  description?: string | undefined;
319
+ id?: string | undefined;
320
320
  resourceName?: string | undefined;
321
321
  mimeTypePattern?: string | undefined;
322
322
  prompt?: string | undefined;
@@ -324,25 +324,25 @@ declare const ViewBinding: {
324
324
  }, {
325
325
  title: string;
326
326
  icon: string;
327
- id?: string | undefined;
328
- name?: string | undefined;
329
327
  url?: string | undefined;
328
+ name?: string | undefined;
330
329
  description?: string | undefined;
331
- resourceName?: string | undefined;
332
330
  tools?: string[] | undefined;
331
+ id?: string | undefined;
332
+ resourceName?: string | undefined;
333
333
  mimeTypePattern?: string | undefined;
334
334
  prompt?: string | undefined;
335
335
  installBehavior?: "open" | "none" | "autoPin" | undefined;
336
336
  }>, "many">;
337
337
  }, "strip", z.ZodTypeAny, {
338
338
  views: {
339
- tools: string[];
340
339
  title: string;
340
+ tools: string[];
341
341
  icon: string;
342
- id?: string | undefined;
343
- name?: string | undefined;
344
342
  url?: string | undefined;
343
+ name?: string | undefined;
345
344
  description?: string | undefined;
345
+ id?: string | undefined;
346
346
  resourceName?: string | undefined;
347
347
  mimeTypePattern?: string | undefined;
348
348
  prompt?: string | undefined;
@@ -352,12 +352,12 @@ declare const ViewBinding: {
352
352
  views: {
353
353
  title: string;
354
354
  icon: string;
355
- id?: string | undefined;
356
- name?: string | undefined;
357
355
  url?: string | undefined;
356
+ name?: string | undefined;
358
357
  description?: string | undefined;
359
- resourceName?: string | undefined;
360
358
  tools?: string[] | undefined;
359
+ id?: string | undefined;
360
+ resourceName?: string | undefined;
361
361
  mimeTypePattern?: string | undefined;
362
362
  prompt?: string | undefined;
363
363
  installBehavior?: "open" | "none" | "autoPin" | undefined;
@@ -389,13 +389,13 @@ declare const VIEW_BINDING_SCHEMA: readonly [{
389
389
  prompt: z.ZodOptional<z.ZodString>;
390
390
  installBehavior: z.ZodOptional<z.ZodEnum<["none", "open", "autoPin"]>>;
391
391
  }, "strip", z.ZodTypeAny, {
392
- tools: string[];
393
392
  title: string;
393
+ tools: string[];
394
394
  icon: string;
395
- id?: string | undefined;
396
- name?: string | undefined;
397
395
  url?: string | undefined;
396
+ name?: string | undefined;
398
397
  description?: string | undefined;
398
+ id?: string | undefined;
399
399
  resourceName?: string | undefined;
400
400
  mimeTypePattern?: string | undefined;
401
401
  prompt?: string | undefined;
@@ -403,25 +403,25 @@ declare const VIEW_BINDING_SCHEMA: readonly [{
403
403
  }, {
404
404
  title: string;
405
405
  icon: string;
406
- id?: string | undefined;
407
- name?: string | undefined;
408
406
  url?: string | undefined;
407
+ name?: string | undefined;
409
408
  description?: string | undefined;
410
- resourceName?: string | undefined;
411
409
  tools?: string[] | undefined;
410
+ id?: string | undefined;
411
+ resourceName?: string | undefined;
412
412
  mimeTypePattern?: string | undefined;
413
413
  prompt?: string | undefined;
414
414
  installBehavior?: "open" | "none" | "autoPin" | undefined;
415
415
  }>, "many">;
416
416
  }, "strip", z.ZodTypeAny, {
417
417
  views: {
418
- tools: string[];
419
418
  title: string;
419
+ tools: string[];
420
420
  icon: string;
421
- id?: string | undefined;
422
- name?: string | undefined;
423
421
  url?: string | undefined;
422
+ name?: string | undefined;
424
423
  description?: string | undefined;
424
+ id?: string | undefined;
425
425
  resourceName?: string | undefined;
426
426
  mimeTypePattern?: string | undefined;
427
427
  prompt?: string | undefined;
@@ -431,12 +431,12 @@ declare const VIEW_BINDING_SCHEMA: readonly [{
431
431
  views: {
432
432
  title: string;
433
433
  icon: string;
434
- id?: string | undefined;
435
- name?: string | undefined;
436
434
  url?: string | undefined;
435
+ name?: string | undefined;
437
436
  description?: string | undefined;
438
- resourceName?: string | undefined;
439
437
  tools?: string[] | undefined;
438
+ id?: string | undefined;
439
+ resourceName?: string | undefined;
440
440
  mimeTypePattern?: string | undefined;
441
441
  prompt?: string | undefined;
442
442
  installBehavior?: "open" | "none" | "autoPin" | undefined;
@@ -457,13 +457,13 @@ declare const listViewsSchema: z.ZodObject<{
457
457
  prompt: z.ZodOptional<z.ZodString>;
458
458
  installBehavior: z.ZodOptional<z.ZodEnum<["none", "open", "autoPin"]>>;
459
459
  }, "strip", z.ZodTypeAny, {
460
- tools: string[];
461
460
  title: string;
461
+ tools: string[];
462
462
  icon: string;
463
- id?: string | undefined;
464
- name?: string | undefined;
465
463
  url?: string | undefined;
464
+ name?: string | undefined;
466
465
  description?: string | undefined;
466
+ id?: string | undefined;
467
467
  resourceName?: string | undefined;
468
468
  mimeTypePattern?: string | undefined;
469
469
  prompt?: string | undefined;
@@ -471,25 +471,25 @@ declare const listViewsSchema: z.ZodObject<{
471
471
  }, {
472
472
  title: string;
473
473
  icon: string;
474
- id?: string | undefined;
475
- name?: string | undefined;
476
474
  url?: string | undefined;
475
+ name?: string | undefined;
477
476
  description?: string | undefined;
478
- resourceName?: string | undefined;
479
477
  tools?: string[] | undefined;
478
+ id?: string | undefined;
479
+ resourceName?: string | undefined;
480
480
  mimeTypePattern?: string | undefined;
481
481
  prompt?: string | undefined;
482
482
  installBehavior?: "open" | "none" | "autoPin" | undefined;
483
483
  }>, "many">;
484
484
  }, "strip", z.ZodTypeAny, {
485
485
  views: {
486
- tools: string[];
487
486
  title: string;
487
+ tools: string[];
488
488
  icon: string;
489
- id?: string | undefined;
490
- name?: string | undefined;
491
489
  url?: string | undefined;
490
+ name?: string | undefined;
492
491
  description?: string | undefined;
492
+ id?: string | undefined;
493
493
  resourceName?: string | undefined;
494
494
  mimeTypePattern?: string | undefined;
495
495
  prompt?: string | undefined;
@@ -499,12 +499,12 @@ declare const listViewsSchema: z.ZodObject<{
499
499
  views: {
500
500
  title: string;
501
501
  icon: string;
502
- id?: string | undefined;
503
- name?: string | undefined;
504
502
  url?: string | undefined;
503
+ name?: string | undefined;
505
504
  description?: string | undefined;
506
- resourceName?: string | undefined;
507
505
  tools?: string[] | undefined;
506
+ id?: string | undefined;
507
+ resourceName?: string | undefined;
508
508
  mimeTypePattern?: string | undefined;
509
509
  prompt?: string | undefined;
510
510
  installBehavior?: "open" | "none" | "autoPin" | undefined;
@@ -749,11 +749,11 @@ declare const DeleteOutputSchema: z.ZodObject<{
749
749
  success: z.ZodBoolean;
750
750
  uri: z.ZodString;
751
751
  }, "strip", z.ZodTypeAny, {
752
- success: boolean;
753
752
  uri: string;
754
- }, {
755
753
  success: boolean;
754
+ }, {
756
755
  uri: string;
756
+ success: boolean;
757
757
  }>;
758
758
  /**
759
759
  * Factory function to create item schema for a specific resource type
@@ -0,0 +1,14 @@
1
+ import * as hono from 'hono';
2
+ import { Hono } from 'hono';
3
+ import * as hono_types from 'hono/types';
4
+
5
+ interface AssetServerConfig {
6
+ env: "development" | "production" | "test";
7
+ localDevProxyUrl?: string | URL;
8
+ assetsDirectory?: string;
9
+ }
10
+ declare const applyAssetServerRoutes: (app: Hono, config: AssetServerConfig) => void;
11
+ declare const createAssetServer: (config: AssetServerConfig) => Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
12
+ declare const createAssetServerFetcher: (config: AssetServerConfig) => (request: Request, Env?: unknown, executionCtx?: hono.ExecutionContext) => Response | Promise<Response>;
13
+
14
+ export { applyAssetServerRoutes, createAssetServer, createAssetServerFetcher };
@@ -0,0 +1,46 @@
1
+ import { serveStatic } from 'hono/bun';
2
+ import { Hono } from 'hono';
3
+ import { proxy } from 'hono/proxy';
4
+
5
+ // src/bun-asset-server/index.ts
6
+ var devServerProxy = (url) => (c) => {
7
+ const incomingUrl = new URL(c.req.raw.url);
8
+ const target = new URL(url);
9
+ target.pathname = incomingUrl.pathname;
10
+ target.search = incomingUrl.search;
11
+ return proxy(target, {
12
+ raw: c.req.raw,
13
+ headers: {
14
+ ...c.req.raw.headers
15
+ }
16
+ });
17
+ };
18
+
19
+ // src/bun-asset-server/index.ts
20
+ var DEFAULT_LOCAL_DEV_PROXY_URL = "http://localhost:4000";
21
+ var DEFAULT_ASSETS_DIRECTORY = "./dist";
22
+ var applyAssetServerRoutes = (app, config) => {
23
+ const environment = config.env;
24
+ const localDevProxyUrl = config.localDevProxyUrl ?? DEFAULT_LOCAL_DEV_PROXY_URL;
25
+ const assetsDirectory = config.assetsDirectory ?? DEFAULT_ASSETS_DIRECTORY;
26
+ if (environment === "development") {
27
+ app.use("*", devServerProxy(localDevProxyUrl));
28
+ } else if (environment === "production") {
29
+ app.use("/assets/*", serveStatic({ root: assetsDirectory }));
30
+ app.get("*", serveStatic({ path: `${assetsDirectory}/index.html` }));
31
+ }
32
+ };
33
+ var createAssetServer = (config) => {
34
+ const app = new Hono();
35
+ applyAssetServerRoutes(app, config);
36
+ return app;
37
+ };
38
+ var createAssetServerFetcher = (config) => {
39
+ const app = new Hono();
40
+ applyAssetServerRoutes(app, config);
41
+ return app.fetch;
42
+ };
43
+
44
+ export { applyAssetServerRoutes, createAssetServer, createAssetServerFetcher };
45
+ //# sourceMappingURL=bun-asset-server.js.map
46
+ //# sourceMappingURL=bun-asset-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bun-asset-server/dev-server-proxy.ts","../src/bun-asset-server/index.ts"],"names":[],"mappings":";;;;;AAGO,IAAM,cAAA,GAAiB,CAAC,GAAA,KAAsB,CAAC,CAAA,KAAe;AACnE,EAAA,MAAM,cAAc,IAAI,GAAA,CAAI,CAAA,CAAE,GAAA,CAAI,IAAI,GAAG,CAAA;AACzC,EAAA,MAAM,MAAA,GAAS,IAAI,GAAA,CAAI,GAAG,CAAA;AAC1B,EAAA,MAAA,CAAO,WAAW,WAAA,CAAY,QAAA;AAC9B,EAAA,MAAA,CAAO,SAAS,WAAA,CAAY,MAAA;AAE5B,EAAA,OAAO,MAAM,MAAA,EAAQ;AAAA,IACnB,GAAA,EAAK,EAAE,GAAA,CAAI,GAAA;AAAA,IACX,OAAA,EAAS;AAAA,MACP,GAAG,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI;AAAA;AACf,GACD,CAAA;AACH,CAAA;;;ACLA,IAAM,2BAAA,GAA8B,uBAAA;AACpC,IAAM,wBAAA,GAA2B,QAAA;AAE1B,IAAM,sBAAA,GAAyB,CAAC,GAAA,EAAW,MAAA,KAA8B;AAC9E,EAAA,MAAM,cAAc,MAAA,CAAO,GAAA;AAC3B,EAAA,MAAM,gBAAA,GAAmB,OAAO,gBAAA,IAAoB,2BAAA;AACpD,EAAA,MAAM,eAAA,GAAkB,OAAO,eAAA,IAAmB,wBAAA;AAElD,EAAA,IAAI,gBAAgB,aAAA,EAAe;AACjC,IAAA,GAAA,CAAI,GAAA,CAAI,GAAA,EAAK,cAAA,CAAe,gBAAgB,CAAC,CAAA;AAAA,EAC/C,CAAA,MAAA,IAAW,gBAAgB,YAAA,EAAc;AACvC,IAAA,GAAA,CAAI,IAAI,WAAA,EAAa,WAAA,CAAY,EAAE,IAAA,EAAM,eAAA,EAAiB,CAAC,CAAA;AAC3D,IAAA,GAAA,CAAI,GAAA,CAAI,KAAK,WAAA,CAAY,EAAE,MAAM,CAAA,EAAG,eAAe,CAAA,WAAA,CAAA,EAAe,CAAC,CAAA;AAAA,EACrE;AACF;AAEO,IAAM,iBAAA,GAAoB,CAAC,MAAA,KAA8B;AAC9D,EAAA,MAAM,GAAA,GAAM,IAAI,IAAA,EAAK;AACrB,EAAA,sBAAA,CAAuB,KAAK,MAAM,CAAA;AAClC,EAAA,OAAO,GAAA;AACT;AAEO,IAAM,wBAAA,GAA2B,CAAC,MAAA,KAA8B;AACrE,EAAA,MAAM,GAAA,GAAM,IAAI,IAAA,EAAK;AACrB,EAAA,sBAAA,CAAuB,KAAK,MAAM,CAAA;AAClC,EAAA,OAAO,GAAA,CAAI,KAAA;AACb","file":"bun-asset-server.js","sourcesContent":["import { proxy } from \"hono/proxy\";\nimport { Context } from \"hono\";\n\nexport const devServerProxy = (url: string | URL) => (c: Context) => {\n const incomingUrl = new URL(c.req.raw.url);\n const target = new URL(url);\n target.pathname = incomingUrl.pathname;\n target.search = incomingUrl.search;\n\n return proxy(target, {\n raw: c.req.raw,\n headers: {\n ...c.req.raw.headers,\n },\n });\n};\n","import { serveStatic } from \"hono/bun\";\nimport { Hono } from \"hono\";\nimport { devServerProxy } from \"./dev-server-proxy\";\n\ninterface AssetServerConfig {\n env: \"development\" | \"production\" | \"test\";\n localDevProxyUrl?: string | URL;\n assetsDirectory?: string;\n}\n\nconst DEFAULT_LOCAL_DEV_PROXY_URL = \"http://localhost:4000\";\nconst DEFAULT_ASSETS_DIRECTORY = \"./dist\";\n\nexport const applyAssetServerRoutes = (app: Hono, config: AssetServerConfig) => {\n const environment = config.env;\n const localDevProxyUrl = config.localDevProxyUrl ?? DEFAULT_LOCAL_DEV_PROXY_URL;\n const assetsDirectory = config.assetsDirectory ?? DEFAULT_ASSETS_DIRECTORY;\n\n if (environment === \"development\") {\n app.use(\"*\", devServerProxy(localDevProxyUrl));\n } else if (environment === \"production\") {\n app.use(\"/assets/*\", serveStatic({ root: assetsDirectory }));\n app.get(\"*\", serveStatic({ path: `${assetsDirectory}/index.html` }));\n }\n}\n\nexport const createAssetServer = (config: AssetServerConfig) => {\n const app = new Hono();\n applyAssetServerRoutes(app, config);\n return app;\n}\n\nexport const createAssetServerFetcher = (config: AssetServerConfig) => {\n const app = new Hono();\n applyAssetServerRoutes(app, config);\n return app.fetch;\n}"]}
package/dist/drizzle.d.ts CHANGED
@@ -3,12 +3,12 @@ import * as drizzleOrm from 'drizzle-orm';
3
3
  export { drizzleOrm as orm };
4
4
  import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
5
5
  export * from 'drizzle-orm/sqlite-core';
6
- import { D as DefaultEnv } from './index-AKVjfH4b.js';
6
+ import { D as DefaultEnv } from './index-oudm4zaO.js';
7
7
  import '@cloudflare/workers-types';
8
8
  import 'zod';
9
9
  import '@mastra/core';
10
10
  import '@mastra/core/di';
11
- import './mcp-Bv7IAgWX.js';
11
+ import './mcp-yTBduksO.js';
12
12
  import './connection-DDtQYrea.js';
13
13
  import './resources.js';
14
14
 
@@ -1,8 +1,8 @@
1
1
  import * as _mastra_core from '@mastra/core';
2
2
  import * as zod from 'zod';
3
3
  import { z } from 'zod';
4
- import { D as DefaultEnv } from './index-AKVjfH4b.js';
5
- import { M as MCPClientFetchStub } from './mcp-Bv7IAgWX.js';
4
+ import { D as DefaultEnv } from './index-oudm4zaO.js';
5
+ import { M as MCPClientFetchStub } from './mcp-yTBduksO.js';
6
6
 
7
7
  type BaseResourceDataSchema = z.ZodObject<{
8
8
  name: z.ZodString;
@@ -277,11 +277,11 @@ declare function createResourceBindings<TDataSchema extends BaseResourceDataSche
277
277
  success: z.ZodBoolean;
278
278
  uri: z.ZodString;
279
279
  }, "strip", z.ZodTypeAny, {
280
- success: boolean;
281
280
  uri: string;
282
- }, {
283
281
  success: boolean;
282
+ }, {
284
283
  uri: string;
284
+ success: boolean;
285
285
  }>;
286
286
  readonly opt: true;
287
287
  }, {
@@ -402,12 +402,12 @@ declare const deconfigTools: readonly [{
402
402
  format: z.ZodOptional<z.ZodEnum<["base64", "byteArray", "plainString", "json"]>>;
403
403
  }, "strip", z.ZodTypeAny, {
404
404
  path: string;
405
- branch?: string | undefined;
406
405
  format?: "json" | "base64" | "byteArray" | "plainString" | undefined;
406
+ branch?: string | undefined;
407
407
  }, {
408
408
  path: string;
409
- branch?: string | undefined;
410
409
  format?: "json" | "base64" | "byteArray" | "plainString" | undefined;
410
+ branch?: string | undefined;
411
411
  }>;
412
412
  readonly outputSchema: z.ZodObject<{
413
413
  content: z.ZodAny;
@@ -447,16 +447,16 @@ declare const deconfigTools: readonly [{
447
447
  content: string | number[] | {
448
448
  base64: string;
449
449
  };
450
- branch?: string | undefined;
451
450
  metadata?: Record<string, any> | undefined;
451
+ branch?: string | undefined;
452
452
  expectedCtime?: number | undefined;
453
453
  }, {
454
454
  path: string;
455
455
  content: string | number[] | {
456
456
  base64: string;
457
457
  };
458
- branch?: string | undefined;
459
458
  metadata?: Record<string, any> | undefined;
459
+ branch?: string | undefined;
460
460
  expectedCtime?: number | undefined;
461
461
  }>;
462
462
  readonly outputSchema: z.ZodObject<{
@@ -2,7 +2,7 @@ import { ExecutionContext as ExecutionContext$1 } from '@cloudflare/workers-type
2
2
  import { z } from 'zod';
3
3
  import { ToolExecutionContext, ToolAction, Tool } from '@mastra/core';
4
4
  import { RuntimeContext } from '@mastra/core/di';
5
- import { Q as QueryResult } from './mcp-Bv7IAgWX.js';
5
+ import { Q as QueryResult } from './mcp-yTBduksO.js';
6
6
  import { M as MCPConnection } from './connection-DDtQYrea.js';
7
7
  import { ResourceCreateInputSchema, ResourceUpdateInputSchema, ResourceDeleteInputSchema } from './resources.js';
8
8
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import '@cloudflare/workers-types';
2
2
  import 'zod';
3
- export { B as BindingsObject, m as Contract, D as DefaultEnv, n as Migration, j as RequestContext, k as UnauthorizedError, h as User, U as UserDefaultExport, g as WorkersMCPBindings, W as WorkspaceDB, o as WranglerConfig, p as proxyConnectionForId, w as withBindings, l as withRuntime } from './index-AKVjfH4b.js';
4
- export { C as CreateStubAPIOptions, T as ToolBinder, c as createMCPFetchStub } from './mcp-Bv7IAgWX.js';
3
+ export { B as BindingsObject, m as Contract, D as DefaultEnv, n as Migration, j as RequestContext, k as UnauthorizedError, h as User, U as UserDefaultExport, g as WorkersMCPBindings, W as WorkspaceDB, o as WranglerConfig, p as proxyConnectionForId, w as withBindings, l as withRuntime } from './index-oudm4zaO.js';
4
+ export { C as CreateStubAPIOptions, T as ToolBinder, c as createMCPFetchStub } from './mcp-yTBduksO.js';
5
5
  import '@mastra/core';
6
6
  import '@mastra/core/di';
7
7
  import './connection-DDtQYrea.js';
package/dist/mastra.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import '@mastra/core';
2
2
  import '@mastra/core/di';
3
3
  import 'zod';
4
- export { A as AppContext, e as CreateMCPServerOptions, C as CreatedTool, E as ExecWithContext, F as Fetch, I as Integration, M as MCPServer, R as Resources, S as StreamableTool, V as ViewExport, f as createMCPServer, c as createPrivateTool, a as createRuntimeContext, b as createStreamableTool, d as createTool, i as isStreamableTool } from './index-AKVjfH4b.js';
4
+ export { A as AppContext, e as CreateMCPServerOptions, C as CreatedTool, E as ExecWithContext, F as Fetch, I as Integration, M as MCPServer, R as Resources, S as StreamableTool, V as ViewExport, f as createMCPServer, c as createPrivateTool, a as createRuntimeContext, b as createStreamableTool, d as createTool, i as isStreamableTool } from './index-oudm4zaO.js';
5
5
  import './resources.js';
6
6
  import '@cloudflare/workers-types';
7
- import './mcp-Bv7IAgWX.js';
7
+ import './mcp-yTBduksO.js';
8
8
  import './connection-DDtQYrea.js';
@@ -27,7 +27,7 @@ declare const QueryResult: z.ZodObject<{
27
27
  rows_read?: number | undefined;
28
28
  rows_written?: number | undefined;
29
29
  served_by_primary?: boolean | undefined;
30
- served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
30
+ served_by_region?: "OC" | "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | undefined;
31
31
  size_after?: number | undefined;
32
32
  timings?: {
33
33
  sql_duration_ms?: number | undefined;
@@ -40,7 +40,7 @@ declare const QueryResult: z.ZodObject<{
40
40
  rows_read?: number | undefined;
41
41
  rows_written?: number | undefined;
42
42
  served_by_primary?: boolean | undefined;
43
- served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
43
+ served_by_region?: "OC" | "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | undefined;
44
44
  size_after?: number | undefined;
45
45
  timings?: {
46
46
  sql_duration_ms?: number | undefined;
@@ -57,7 +57,7 @@ declare const QueryResult: z.ZodObject<{
57
57
  rows_read?: number | undefined;
58
58
  rows_written?: number | undefined;
59
59
  served_by_primary?: boolean | undefined;
60
- served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
60
+ served_by_region?: "OC" | "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | undefined;
61
61
  size_after?: number | undefined;
62
62
  timings?: {
63
63
  sql_duration_ms?: number | undefined;
@@ -74,7 +74,7 @@ declare const QueryResult: z.ZodObject<{
74
74
  rows_read?: number | undefined;
75
75
  rows_written?: number | undefined;
76
76
  served_by_primary?: boolean | undefined;
77
- served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
77
+ served_by_region?: "OC" | "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | undefined;
78
78
  size_after?: number | undefined;
79
79
  timings?: {
80
80
  sql_duration_ms?: number | undefined;
package/dist/proxy.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CreateStubAPIOptions } from './mcp-Bv7IAgWX.js';
1
+ import { C as CreateStubAPIOptions } from './mcp-yTBduksO.js';
2
2
  import 'zod';
3
3
  import './connection-DDtQYrea.js';
4
4
 
@@ -4,11 +4,11 @@ declare const ResourcesReadInputSchema: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  uri: z.ZodString;
6
6
  }, "strip", z.ZodTypeAny, {
7
- name: string;
8
7
  uri: string;
9
- }, {
10
8
  name: string;
9
+ }, {
11
10
  uri: string;
11
+ name: string;
12
12
  }>;
13
13
  declare const ResourcesReadOutputSchema: z.ZodObject<{
14
14
  name: z.ZodString;
@@ -25,24 +25,24 @@ declare const ResourcesReadOutputSchema: z.ZodObject<{
25
25
  type: z.ZodEnum<["text", "blob"]>;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  type: "text" | "blob";
28
- name: string;
29
28
  data: string;
30
29
  uri: string;
31
- description?: string | undefined;
30
+ name: string;
32
31
  mimeType?: string | undefined;
33
32
  title?: string | undefined;
33
+ description?: string | undefined;
34
34
  annotations?: Record<string, string> | undefined;
35
35
  thumbnail?: string | undefined;
36
36
  timestamp?: string | undefined;
37
37
  size?: number | undefined;
38
38
  }, {
39
39
  type: "text" | "blob";
40
- name: string;
41
40
  data: string;
42
41
  uri: string;
43
- description?: string | undefined;
42
+ name: string;
44
43
  mimeType?: string | undefined;
45
44
  title?: string | undefined;
45
+ description?: string | undefined;
46
46
  annotations?: Record<string, string> | undefined;
47
47
  thumbnail?: string | undefined;
48
48
  timestamp?: string | undefined;
@@ -76,21 +76,21 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
76
76
  size: z.ZodOptional<z.ZodNumber>;
77
77
  annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
78
78
  }, "strip", z.ZodTypeAny, {
79
- name: string;
80
79
  uri: string;
81
- description?: string | undefined;
80
+ name: string;
82
81
  mimeType?: string | undefined;
83
82
  title?: string | undefined;
83
+ description?: string | undefined;
84
84
  annotations?: Record<string, string> | undefined;
85
85
  thumbnail?: string | undefined;
86
86
  timestamp?: string | undefined;
87
87
  size?: number | undefined;
88
88
  }, {
89
- name: string;
90
89
  uri: string;
91
- description?: string | undefined;
90
+ name: string;
92
91
  mimeType?: string | undefined;
93
92
  title?: string | undefined;
93
+ description?: string | undefined;
94
94
  annotations?: Record<string, string> | undefined;
95
95
  thumbnail?: string | undefined;
96
96
  timestamp?: string | undefined;
@@ -100,11 +100,11 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
100
100
  nextCursor: z.ZodOptional<z.ZodString>;
101
101
  }, "strip", z.ZodTypeAny, {
102
102
  items: {
103
- name: string;
104
103
  uri: string;
105
- description?: string | undefined;
104
+ name: string;
106
105
  mimeType?: string | undefined;
107
106
  title?: string | undefined;
107
+ description?: string | undefined;
108
108
  annotations?: Record<string, string> | undefined;
109
109
  thumbnail?: string | undefined;
110
110
  timestamp?: string | undefined;
@@ -114,11 +114,11 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
114
114
  nextCursor?: string | undefined;
115
115
  }, {
116
116
  items: {
117
- name: string;
118
117
  uri: string;
119
- description?: string | undefined;
118
+ name: string;
120
119
  mimeType?: string | undefined;
121
120
  title?: string | undefined;
121
+ description?: string | undefined;
122
122
  annotations?: Record<string, string> | undefined;
123
123
  thumbnail?: string | undefined;
124
124
  timestamp?: string | undefined;
@@ -147,27 +147,27 @@ declare const ResourceCreateInputSchema: z.ZodObject<{
147
147
  }>;
148
148
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
149
149
  }, "strip", z.ZodTypeAny, {
150
- name: string;
151
- resourceName: string;
152
150
  content: {
153
151
  type: "text" | "blob";
154
152
  data: string;
155
153
  mimeType?: string | undefined;
156
154
  };
155
+ name: string;
156
+ resourceName: string;
157
+ title?: string | undefined;
157
158
  description?: string | undefined;
158
159
  metadata?: Record<string, any> | undefined;
159
- title?: string | undefined;
160
160
  }, {
161
- name: string;
162
- resourceName: string;
163
161
  content: {
164
162
  type: "text" | "blob";
165
163
  data: string;
166
164
  mimeType?: string | undefined;
167
165
  };
166
+ name: string;
167
+ resourceName: string;
168
+ title?: string | undefined;
168
169
  description?: string | undefined;
169
170
  metadata?: Record<string, any> | undefined;
170
- title?: string | undefined;
171
171
  }>;
172
172
  declare const ResourceCreateOutputSchema: z.ZodObject<{
173
173
  name: z.ZodString;
@@ -180,21 +180,21 @@ declare const ResourceCreateOutputSchema: z.ZodObject<{
180
180
  size: z.ZodOptional<z.ZodNumber>;
181
181
  annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
182
182
  }, "strip", z.ZodTypeAny, {
183
- name: string;
184
183
  uri: string;
185
- description?: string | undefined;
184
+ name: string;
186
185
  mimeType?: string | undefined;
187
186
  title?: string | undefined;
187
+ description?: string | undefined;
188
188
  annotations?: Record<string, string> | undefined;
189
189
  thumbnail?: string | undefined;
190
190
  timestamp?: string | undefined;
191
191
  size?: number | undefined;
192
192
  }, {
193
- name: string;
194
193
  uri: string;
195
- description?: string | undefined;
194
+ name: string;
196
195
  mimeType?: string | undefined;
197
196
  title?: string | undefined;
197
+ description?: string | undefined;
198
198
  annotations?: Record<string, string> | undefined;
199
199
  thumbnail?: string | undefined;
200
200
  timestamp?: string | undefined;
@@ -221,29 +221,29 @@ declare const ResourceUpdateInputSchema: z.ZodObject<{
221
221
  }>>;
222
222
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
223
223
  }, "strip", z.ZodTypeAny, {
224
- name: string;
225
224
  uri: string;
226
- description?: string | undefined;
227
- resourceName?: string | undefined;
228
- metadata?: Record<string, any> | undefined;
225
+ name: string;
229
226
  content?: {
230
227
  type: "text" | "blob";
231
228
  data: string;
232
229
  mimeType?: string | undefined;
233
230
  } | undefined;
234
231
  title?: string | undefined;
235
- }, {
236
- name: string;
237
- uri: string;
238
232
  description?: string | undefined;
239
- resourceName?: string | undefined;
240
233
  metadata?: Record<string, any> | undefined;
234
+ resourceName?: string | undefined;
235
+ }, {
236
+ uri: string;
237
+ name: string;
241
238
  content?: {
242
239
  type: "text" | "blob";
243
240
  data: string;
244
241
  mimeType?: string | undefined;
245
242
  } | undefined;
246
243
  title?: string | undefined;
244
+ description?: string | undefined;
245
+ metadata?: Record<string, any> | undefined;
246
+ resourceName?: string | undefined;
247
247
  }>;
248
248
  declare const ResourceUpdateOutputSchema: z.ZodObject<{
249
249
  name: z.ZodString;
@@ -256,21 +256,21 @@ declare const ResourceUpdateOutputSchema: z.ZodObject<{
256
256
  size: z.ZodOptional<z.ZodNumber>;
257
257
  annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
258
258
  }, "strip", z.ZodTypeAny, {
259
- name: string;
260
259
  uri: string;
261
- description?: string | undefined;
260
+ name: string;
262
261
  mimeType?: string | undefined;
263
262
  title?: string | undefined;
263
+ description?: string | undefined;
264
264
  annotations?: Record<string, string> | undefined;
265
265
  thumbnail?: string | undefined;
266
266
  timestamp?: string | undefined;
267
267
  size?: number | undefined;
268
268
  }, {
269
- name: string;
270
269
  uri: string;
271
- description?: string | undefined;
270
+ name: string;
272
271
  mimeType?: string | undefined;
273
272
  title?: string | undefined;
273
+ description?: string | undefined;
274
274
  annotations?: Record<string, string> | undefined;
275
275
  thumbnail?: string | undefined;
276
276
  timestamp?: string | undefined;
@@ -281,12 +281,12 @@ declare const ResourceDeleteInputSchema: z.ZodObject<{
281
281
  uri: z.ZodString;
282
282
  force: z.ZodOptional<z.ZodBoolean>;
283
283
  }, "strip", z.ZodTypeAny, {
284
- name: string;
285
284
  uri: string;
285
+ name: string;
286
286
  force?: boolean | undefined;
287
287
  }, {
288
- name: string;
289
288
  uri: string;
289
+ name: string;
290
290
  force?: boolean | undefined;
291
291
  }>;
292
292
  declare const ResourceDeleteOutputSchema: z.ZodObject<{
@@ -308,16 +308,16 @@ declare const ResourcesListOutputSchema: z.ZodObject<{
308
308
  hasDelete: z.ZodOptional<z.ZodBoolean>;
309
309
  }, "strip", z.ZodTypeAny, {
310
310
  name: string;
311
- description: string;
312
311
  title: string;
312
+ description: string;
313
313
  icon: string;
314
314
  hasCreate?: boolean | undefined;
315
315
  hasUpdate?: boolean | undefined;
316
316
  hasDelete?: boolean | undefined;
317
317
  }, {
318
318
  name: string;
319
- description: string;
320
319
  title: string;
320
+ description: string;
321
321
  icon: string;
322
322
  hasCreate?: boolean | undefined;
323
323
  hasUpdate?: boolean | undefined;
@@ -326,8 +326,8 @@ declare const ResourcesListOutputSchema: z.ZodObject<{
326
326
  }, "strip", z.ZodTypeAny, {
327
327
  resources: {
328
328
  name: string;
329
- description: string;
330
329
  title: string;
330
+ description: string;
331
331
  icon: string;
332
332
  hasCreate?: boolean | undefined;
333
333
  hasUpdate?: boolean | undefined;
@@ -336,8 +336,8 @@ declare const ResourcesListOutputSchema: z.ZodObject<{
336
336
  }, {
337
337
  resources: {
338
338
  name: string;
339
- description: string;
340
339
  title: string;
340
+ description: string;
341
341
  icon: string;
342
342
  hasCreate?: boolean | undefined;
343
343
  hasUpdate?: boolean | undefined;
package/dist/views.d.ts CHANGED
@@ -14,13 +14,13 @@ declare const ViewsListOutputSchema: z.ZodObject<{
14
14
  prompt: z.ZodOptional<z.ZodString>;
15
15
  installBehavior: z.ZodOptional<z.ZodEnum<["none", "open", "autoPin"]>>;
16
16
  }, "strip", z.ZodTypeAny, {
17
- tools: string[];
18
17
  title: string;
18
+ tools: string[];
19
19
  icon: string;
20
- id?: string | undefined;
21
- name?: string | undefined;
22
20
  url?: string | undefined;
21
+ name?: string | undefined;
23
22
  description?: string | undefined;
23
+ id?: string | undefined;
24
24
  resourceName?: string | undefined;
25
25
  mimeTypePattern?: string | undefined;
26
26
  prompt?: string | undefined;
@@ -28,25 +28,25 @@ declare const ViewsListOutputSchema: z.ZodObject<{
28
28
  }, {
29
29
  title: string;
30
30
  icon: string;
31
- id?: string | undefined;
32
- name?: string | undefined;
33
31
  url?: string | undefined;
32
+ name?: string | undefined;
34
33
  description?: string | undefined;
35
- resourceName?: string | undefined;
36
34
  tools?: string[] | undefined;
35
+ id?: string | undefined;
36
+ resourceName?: string | undefined;
37
37
  mimeTypePattern?: string | undefined;
38
38
  prompt?: string | undefined;
39
39
  installBehavior?: "open" | "none" | "autoPin" | undefined;
40
40
  }>, "many">;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  views: {
43
- tools: string[];
44
43
  title: string;
44
+ tools: string[];
45
45
  icon: string;
46
- id?: string | undefined;
47
- name?: string | undefined;
48
46
  url?: string | undefined;
47
+ name?: string | undefined;
49
48
  description?: string | undefined;
49
+ id?: string | undefined;
50
50
  resourceName?: string | undefined;
51
51
  mimeTypePattern?: string | undefined;
52
52
  prompt?: string | undefined;
@@ -56,12 +56,12 @@ declare const ViewsListOutputSchema: z.ZodObject<{
56
56
  views: {
57
57
  title: string;
58
58
  icon: string;
59
- id?: string | undefined;
60
- name?: string | undefined;
61
59
  url?: string | undefined;
60
+ name?: string | undefined;
62
61
  description?: string | undefined;
63
- resourceName?: string | undefined;
64
62
  tools?: string[] | undefined;
63
+ id?: string | undefined;
64
+ resourceName?: string | undefined;
65
65
  mimeTypePattern?: string | undefined;
66
66
  prompt?: string | undefined;
67
67
  installBehavior?: "open" | "none" | "autoPin" | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/runtime",
3
- "version": "0.0.1-testing-beta.1",
3
+ "version": "0.0.1-testing-beta.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -13,6 +13,7 @@
13
13
  "@modelcontextprotocol/sdk": "^1.19.1",
14
14
  "bidc": "0.0.3",
15
15
  "drizzle-orm": "^0.44.5",
16
+ "hono": "^4.10.7",
16
17
  "jose": "^6.0.11",
17
18
  "mime-db": "1.52.0",
18
19
  "zod": "^3.25.76",
@@ -81,6 +82,11 @@
81
82
  "source": "./src/bindings/deconfig/index.ts",
82
83
  "types": "./dist/bindings/deconfig/index.d.ts",
83
84
  "default": "./dist/bindings/deconfig/index.js"
85
+ },
86
+ "./bun-asset-server": {
87
+ "source": "./src/bun-asset-server/index.ts",
88
+ "types": "./dist/bun-asset-server.d.ts",
89
+ "default": "./dist/bun-asset-server.js"
84
90
  }
85
91
  },
86
92
  "devDependencies": {
@@ -0,0 +1,16 @@
1
+ import { proxy } from "hono/proxy";
2
+ import { Context } from "hono";
3
+
4
+ export const devServerProxy = (url: string | URL) => (c: Context) => {
5
+ const incomingUrl = new URL(c.req.raw.url);
6
+ const target = new URL(url);
7
+ target.pathname = incomingUrl.pathname;
8
+ target.search = incomingUrl.search;
9
+
10
+ return proxy(target, {
11
+ raw: c.req.raw,
12
+ headers: {
13
+ ...c.req.raw.headers,
14
+ },
15
+ });
16
+ };
@@ -0,0 +1,37 @@
1
+ import { serveStatic } from "hono/bun";
2
+ import { Hono } from "hono";
3
+ import { devServerProxy } from "./dev-server-proxy";
4
+
5
+ interface AssetServerConfig {
6
+ env: "development" | "production" | "test";
7
+ localDevProxyUrl?: string | URL;
8
+ assetsDirectory?: string;
9
+ }
10
+
11
+ const DEFAULT_LOCAL_DEV_PROXY_URL = "http://localhost:4000";
12
+ const DEFAULT_ASSETS_DIRECTORY = "./dist";
13
+
14
+ export const applyAssetServerRoutes = (app: Hono, config: AssetServerConfig) => {
15
+ const environment = config.env;
16
+ const localDevProxyUrl = config.localDevProxyUrl ?? DEFAULT_LOCAL_DEV_PROXY_URL;
17
+ const assetsDirectory = config.assetsDirectory ?? DEFAULT_ASSETS_DIRECTORY;
18
+
19
+ if (environment === "development") {
20
+ app.use("*", devServerProxy(localDevProxyUrl));
21
+ } else if (environment === "production") {
22
+ app.use("/assets/*", serveStatic({ root: assetsDirectory }));
23
+ app.get("*", serveStatic({ path: `${assetsDirectory}/index.html` }));
24
+ }
25
+ }
26
+
27
+ export const createAssetServer = (config: AssetServerConfig) => {
28
+ const app = new Hono();
29
+ applyAssetServerRoutes(app, config);
30
+ return app;
31
+ }
32
+
33
+ export const createAssetServerFetcher = (config: AssetServerConfig) => {
34
+ const app = new Hono();
35
+ applyAssetServerRoutes(app, config);
36
+ return app.fetch;
37
+ }