@decocms/runtime 0.0.1-testing-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/config-schema.json +553 -0
  2. package/dist/admin.d.ts +5 -0
  3. package/dist/admin.js +21 -0
  4. package/dist/admin.js.map +1 -0
  5. package/dist/bindings/deconfig/index.d.ts +9 -0
  6. package/dist/bindings/deconfig/index.js +9 -0
  7. package/dist/bindings/deconfig/index.js.map +1 -0
  8. package/dist/bindings/index.d.ts +1053 -0
  9. package/dist/bindings/index.js +132 -0
  10. package/dist/bindings/index.js.map +1 -0
  11. package/dist/chunk-4XSQKJLU.js +105 -0
  12. package/dist/chunk-4XSQKJLU.js.map +1 -0
  13. package/dist/chunk-AOFOWQXY.js +27 -0
  14. package/dist/chunk-AOFOWQXY.js.map +1 -0
  15. package/dist/chunk-F6XZPFWM.js +127 -0
  16. package/dist/chunk-F6XZPFWM.js.map +1 -0
  17. package/dist/chunk-IB3KGSMB.js +150 -0
  18. package/dist/chunk-IB3KGSMB.js.map +1 -0
  19. package/dist/chunk-NKUMVYKI.js +128 -0
  20. package/dist/chunk-NKUMVYKI.js.map +1 -0
  21. package/dist/chunk-NMXOC7PT.js +763 -0
  22. package/dist/chunk-NMXOC7PT.js.map +1 -0
  23. package/dist/chunk-OSSKGDAG.js +395 -0
  24. package/dist/chunk-OSSKGDAG.js.map +1 -0
  25. package/dist/chunk-UHR3BLMF.js +92 -0
  26. package/dist/chunk-UHR3BLMF.js.map +1 -0
  27. package/dist/client.d.ts +28 -0
  28. package/dist/client.js +4 -0
  29. package/dist/client.js.map +1 -0
  30. package/dist/connection-DDtQYrea.d.ts +30 -0
  31. package/dist/drizzle.d.ts +47 -0
  32. package/dist/drizzle.js +121 -0
  33. package/dist/drizzle.js.map +1 -0
  34. package/dist/index-AKVjfH4b.d.ts +336 -0
  35. package/dist/index-kMsI0ELb.d.ts +530 -0
  36. package/dist/index.d.ts +8 -0
  37. package/dist/index.js +507 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/mastra.d.ts +8 -0
  40. package/dist/mastra.js +5 -0
  41. package/dist/mastra.js.map +1 -0
  42. package/dist/mcp-Bv7IAgWX.d.ts +109 -0
  43. package/dist/mcp-client.d.ts +236 -0
  44. package/dist/mcp-client.js +3 -0
  45. package/dist/mcp-client.js.map +1 -0
  46. package/dist/proxy.d.ts +10 -0
  47. package/dist/proxy.js +4 -0
  48. package/dist/proxy.js.map +1 -0
  49. package/dist/resources.d.ts +362 -0
  50. package/dist/resources.js +3 -0
  51. package/dist/resources.js.map +1 -0
  52. package/dist/views.d.ts +72 -0
  53. package/dist/views.js +3 -0
  54. package/dist/views.js.map +1 -0
  55. package/package.json +98 -0
  56. package/src/admin.ts +16 -0
  57. package/src/auth.ts +233 -0
  58. package/src/bindings/README.md +132 -0
  59. package/src/bindings/binder.ts +143 -0
  60. package/src/bindings/channels.ts +54 -0
  61. package/src/bindings/deconfig/helpers.ts +107 -0
  62. package/src/bindings/deconfig/index.ts +1 -0
  63. package/src/bindings/deconfig/resources.ts +659 -0
  64. package/src/bindings/deconfig/types.ts +106 -0
  65. package/src/bindings/index.ts +61 -0
  66. package/src/bindings/resources/bindings.ts +99 -0
  67. package/src/bindings/resources/helpers.ts +95 -0
  68. package/src/bindings/resources/schemas.ts +265 -0
  69. package/src/bindings/utils.ts +22 -0
  70. package/src/bindings/views.ts +14 -0
  71. package/src/bindings.ts +179 -0
  72. package/src/client.ts +201 -0
  73. package/src/connection.ts +53 -0
  74. package/src/drizzle.ts +201 -0
  75. package/src/http-client-transport.ts +66 -0
  76. package/src/index.ts +394 -0
  77. package/src/mastra.ts +666 -0
  78. package/src/mcp-client.ts +119 -0
  79. package/src/mcp.ts +171 -0
  80. package/src/proxy.ts +204 -0
  81. package/src/resources.ts +168 -0
  82. package/src/state.ts +44 -0
  83. package/src/views.ts +26 -0
  84. package/src/well-known.ts +20 -0
  85. package/src/wrangler.ts +146 -0
package/src/views.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+
3
+ const installBehavior = z.enum(["none", "open", "autoPin"]);
4
+
5
+ // New, richer schema with backward-compat fields kept optional
6
+ export const ViewsListOutputSchema = z.object({
7
+ views: z.array(
8
+ z.object({
9
+ id: z.string().optional(),
10
+ name: z.string().optional(),
11
+ title: z.string(),
12
+ description: z.string().optional(),
13
+ icon: z.string(),
14
+ url: z.string().optional(),
15
+ // New acceptance rules
16
+ mimeTypePattern: z.string().optional(),
17
+ resourceName: z.string().optional(),
18
+ // Legacy/compat fields
19
+ tools: z.array(z.string()).optional().default([]),
20
+ prompt: z.string().optional(),
21
+ installBehavior: installBehavior.optional(),
22
+ }),
23
+ ),
24
+ });
25
+
26
+ export type ViewsListOutput = z.infer<typeof ViewsListOutputSchema>;
@@ -0,0 +1,20 @@
1
+ const Hosts = {
2
+ API: "api.decocms.com",
3
+ WEB_APP: "admin.decocms.com",
4
+ APPS: "deco.page",
5
+ LOCALHOST: "localhost:3000",
6
+ API_LEGACY: "api.deco.chat",
7
+ WEB_APP_LEGACY: "deco.chat",
8
+ } as const;
9
+
10
+ export const WELL_KNOWN_API_HOSTNAMES = [
11
+ Hosts.API,
12
+ Hosts.API_LEGACY,
13
+ Hosts.LOCALHOST.split(":")[0],
14
+ ] as const;
15
+
16
+ export const WELL_KNOWN_ORIGINS = [
17
+ `http://${Hosts.LOCALHOST}`,
18
+ `https://${Hosts.WEB_APP}`,
19
+ `https://${Hosts.WEB_APP_LEGACY}`,
20
+ ] as const;
@@ -0,0 +1,146 @@
1
+ export interface BindingBase {
2
+ name: string;
3
+ }
4
+
5
+ export interface MCPIntegrationIdBinding extends BindingBase {
6
+ type: "mcp";
7
+ /**
8
+ * If not provided, will return a function that takes the integration id and return the binding implementation..
9
+ */
10
+ integration_id: string;
11
+ }
12
+
13
+ export interface MCPIntegrationNameBinding extends BindingBase {
14
+ type: "mcp";
15
+ /**
16
+ * The name of the integration to bind.
17
+ */
18
+ integration_name: string;
19
+ }
20
+ export interface ContractClause {
21
+ id: string;
22
+ price: string | number; // can be microdollar or dollars
23
+ description?: string;
24
+ }
25
+
26
+ export interface Contract {
27
+ body: string;
28
+ clauses: ContractClause[];
29
+ }
30
+
31
+ export interface ContractBinding extends BindingBase {
32
+ type: "contract";
33
+ /**
34
+ * The clauses of this contract
35
+ */
36
+ contract: Contract;
37
+ }
38
+
39
+ export type MCPBinding = MCPIntegrationIdBinding | MCPIntegrationNameBinding;
40
+
41
+ export type Binding = MCPBinding | ContractBinding;
42
+
43
+ export interface MigrationBase {
44
+ tag: string;
45
+ }
46
+
47
+ export interface NewClassMigration extends MigrationBase {
48
+ new_classes?: string[];
49
+ new_sqlite_classes?: string[];
50
+ }
51
+
52
+ export interface DeletedClassMigration extends MigrationBase {
53
+ deleted_classes: string[];
54
+ }
55
+
56
+ export interface RenamedClassMigration extends MigrationBase {
57
+ renamed_classes: {
58
+ from: string;
59
+ to: string;
60
+ }[];
61
+ }
62
+
63
+ export type Migration =
64
+ | NewClassMigration
65
+ | DeletedClassMigration
66
+ | RenamedClassMigration;
67
+
68
+ export interface KVNamespace {
69
+ binding: string;
70
+ id: string;
71
+ }
72
+
73
+ export interface Triggers {
74
+ crons: string[];
75
+ }
76
+
77
+ export interface Route {
78
+ pattern: string;
79
+ custom_domain?: boolean;
80
+ }
81
+
82
+ export interface WranglerConfig {
83
+ name: string;
84
+ main?: string;
85
+ scope?: string;
86
+ main_module?: string;
87
+ routes?: Route[];
88
+ compatibility_date?: string;
89
+ compatibility_flags?: string[];
90
+ vars?: Record<string, string>;
91
+ kv_namespaces?: KVNamespace[];
92
+ triggers?: Triggers;
93
+ //
94
+ ai?: {
95
+ binding: string;
96
+ };
97
+ browser?: {
98
+ binding: string;
99
+ };
100
+ durable_objects?: {
101
+ bindings?: { name: string; class_name: string }[];
102
+ };
103
+ hyperdrive?: { binding: string; id: string; localConnectionString: string }[];
104
+ d1_databases?: {
105
+ database_name: string;
106
+ database_id?: string;
107
+ binding: string;
108
+ }[];
109
+ queues?: {
110
+ consumers?: {
111
+ queue: string;
112
+ max_batch_timeout: number;
113
+ }[];
114
+ producers?: {
115
+ queue: string;
116
+ binding: string;
117
+ }[];
118
+ };
119
+ workflows?: {
120
+ name: string;
121
+ binding: string;
122
+ class_name?: string;
123
+ script_name?: string;
124
+ }[];
125
+ migrations?: Migration[];
126
+ assets?: {
127
+ directory?: string;
128
+ binding?: string;
129
+ jwt?: string;
130
+ not_found_handling?: "none" | "404-page" | "single-page-application";
131
+ run_worker_first?: boolean;
132
+ };
133
+ keep_assets?: boolean;
134
+ //
135
+ deco?: {
136
+ enable_workflows?: boolean;
137
+ workspace?: string;
138
+ local?: boolean;
139
+ integration?: {
140
+ friendlyName?: string;
141
+ icon?: string;
142
+ description?: string;
143
+ };
144
+ bindings?: Binding[];
145
+ };
146
+ }