@lowdefy/server-dev 0.0.0-experimental-20250911081238 → 0.0.0-experimental-20250915134255

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,60 @@
1
+ /*
2
+ Copyright 2020-2024 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ import path from 'path';
18
+ import crypto from 'crypto';
19
+ import { createApiContext } from '@lowdefy/api';
20
+ import { getSecretsFromEnv } from '@lowdefy/node-utils';
21
+
22
+ import config from '../../../../../build/config.json';
23
+ import connections from '../../../../../build/plugins/connections.js';
24
+ import createLogger from '../../../../../lib/server/log/createLogger.js';
25
+ import fileCache from '../../../../../lib/server/fileCache.js';
26
+ import logError from '../../../../../lib/server/log/logError.js';
27
+ import logRequest from '../../../../../lib/server/log/logRequest.js';
28
+ import operators from '../../../../../build/plugins/operators/server.js';
29
+ import jsMap from '../../../../../build/plugins/operators/serverJsMap.js';
30
+ import getAuthOptions from '../../../../../lib/server/auth/getAuthOptions.js';
31
+
32
+ const secrets = getSecretsFromEnv();
33
+
34
+ async function createContext() {
35
+ const context = {
36
+ rid: crypto.randomUUID(),
37
+ buildDirectory: path.join(process.cwd(), 'build'),
38
+ config,
39
+ connections,
40
+ fileCache,
41
+ jsMap,
42
+ logger: console,
43
+ operators,
44
+ secrets,
45
+ };
46
+
47
+ try {
48
+ context.logger = createLogger({ rid: context.rid });
49
+ context.authOptions = getAuthOptions(context);
50
+
51
+ createApiContext(context);
52
+ logRequest({ context });
53
+ } catch (error) {
54
+ logError({ error, context });
55
+ }
56
+
57
+ return context;
58
+ }
59
+
60
+ export default createContext;
@@ -25,6 +25,7 @@ import listBlocks from './tools/listBlocks.js';
25
25
  import listConnections from './tools/listConnections.js';
26
26
  import listOperators from './tools/listOperators.js';
27
27
  import listRequests from './tools/listRequests.js';
28
+ import executeRequest from './tools/executeRequest.js';
28
29
 
29
30
  const handler = createMcpHandler(
30
31
  async (server) => {
@@ -47,6 +48,7 @@ const handler = createMcpHandler(
47
48
  // Requests
48
49
  server.tool(...listRequests);
49
50
  server.tool(...getRequest);
51
+ server.tool(...executeRequest);
50
52
  },
51
53
  {
52
54
  // Optional server options
@@ -0,0 +1,63 @@
1
+ /*
2
+ Copyright 2020-2024 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ import { z } from 'zod';
18
+ import { callRequest } from '@lowdefy/api';
19
+
20
+ import createContext from '../helpers/createContext.js';
21
+
22
+ export default [
23
+ 'execute_request',
24
+ 'Execute a request with specified blockId, pageId, payload and requestId',
25
+ {
26
+ blockId: z.string().describe('The block ID to test against'),
27
+ pageId: z.string().describe('The page ID to test against'),
28
+ payload: z.record(z.any()).optional().describe('Additional payload for the request'),
29
+ requestId: z.string().optional().describe('The request ID to test against'),
30
+ },
31
+ async ({ blockId, pageId, payload = {}, requestId }) => {
32
+ const requestConfig = {
33
+ blockId,
34
+ pageId,
35
+ payload,
36
+ requestId,
37
+ };
38
+
39
+ let responseText = `Executing Request:\n${JSON.stringify(requestConfig, null, 2)}`;
40
+
41
+ try {
42
+ const context = await createContext();
43
+ const response = await callRequest(context, requestConfig);
44
+
45
+ responseText += `\n\nExecution Result:\n${JSON.stringify(response, null, 2)}`;
46
+ } catch (error) {
47
+ responseText += `\n\nExecution Error:\n${error.message || 'Unknown error occurred'}`;
48
+
49
+ if (error.stack) {
50
+ responseText += `\n\nStack Trace:\n${error.stack}`;
51
+ }
52
+ }
53
+
54
+ return {
55
+ content: [
56
+ {
57
+ type: 'text',
58
+ text: responseText,
59
+ },
60
+ ],
61
+ };
62
+ },
63
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20250911081238",
3
+ "version": "0.0.0-experimental-20250915134255",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -37,33 +37,33 @@
37
37
  ".npmrc"
38
38
  ],
39
39
  "dependencies": {
40
- "@lowdefy/actions-core": "0.0.0-experimental-20250911081238",
41
- "@lowdefy/api": "0.0.0-experimental-20250911081238",
42
- "@lowdefy/block-utils": "0.0.0-experimental-20250911081238",
43
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20250911081238",
44
- "@lowdefy/blocks-antd": "0.0.0-experimental-20250911081238",
45
- "@lowdefy/blocks-basic": "0.0.0-experimental-20250911081238",
46
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20250911081238",
47
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20250911081238",
48
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20250911081238",
49
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20250911081238",
50
- "@lowdefy/blocks-qr": "0.0.0-experimental-20250911081238",
51
- "@lowdefy/build": "0.0.0-experimental-20250911081238",
52
- "@lowdefy/client": "0.0.0-experimental-20250911081238",
53
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20250911081238",
54
- "@lowdefy/engine": "0.0.0-experimental-20250911081238",
55
- "@lowdefy/helpers": "0.0.0-experimental-20250911081238",
56
- "@lowdefy/layout": "0.0.0-experimental-20250911081238",
57
- "@lowdefy/node-utils": "0.0.0-experimental-20250911081238",
58
- "@lowdefy/operators-change-case": "0.0.0-experimental-20250911081238",
59
- "@lowdefy/operators-diff": "0.0.0-experimental-20250911081238",
60
- "@lowdefy/operators-js": "0.0.0-experimental-20250911081238",
61
- "@lowdefy/operators-moment": "0.0.0-experimental-20250911081238",
62
- "@lowdefy/operators-mql": "0.0.0-experimental-20250911081238",
63
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20250911081238",
64
- "@lowdefy/operators-uuid": "0.0.0-experimental-20250911081238",
65
- "@lowdefy/operators-yaml": "0.0.0-experimental-20250911081238",
66
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20250911081238",
40
+ "@lowdefy/actions-core": "0.0.0-experimental-20250915134255",
41
+ "@lowdefy/api": "0.0.0-experimental-20250915134255",
42
+ "@lowdefy/block-utils": "0.0.0-experimental-20250915134255",
43
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20250915134255",
44
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20250915134255",
45
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20250915134255",
46
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20250915134255",
47
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20250915134255",
48
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20250915134255",
49
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20250915134255",
50
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20250915134255",
51
+ "@lowdefy/build": "0.0.0-experimental-20250915134255",
52
+ "@lowdefy/client": "0.0.0-experimental-20250915134255",
53
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20250915134255",
54
+ "@lowdefy/engine": "0.0.0-experimental-20250915134255",
55
+ "@lowdefy/helpers": "0.0.0-experimental-20250915134255",
56
+ "@lowdefy/layout": "0.0.0-experimental-20250915134255",
57
+ "@lowdefy/node-utils": "0.0.0-experimental-20250915134255",
58
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20250915134255",
59
+ "@lowdefy/operators-diff": "0.0.0-experimental-20250915134255",
60
+ "@lowdefy/operators-js": "0.0.0-experimental-20250915134255",
61
+ "@lowdefy/operators-moment": "0.0.0-experimental-20250915134255",
62
+ "@lowdefy/operators-mql": "0.0.0-experimental-20250915134255",
63
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20250915134255",
64
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20250915134255",
65
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20250915134255",
66
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20250915134255",
67
67
  "@modelcontextprotocol/sdk": "1.17.4",
68
68
  "chokidar": "3.5.3",
69
69
  "dotenv": "16.3.1",
@@ -79,7 +79,7 @@
79
79
  "swr": "2.2.4",
80
80
  "yaml": "2.3.4",
81
81
  "yargs": "17.7.2",
82
- "zod": "^3"
82
+ "zod": "3.25.76"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@next/eslint-plugin-next": "13.5.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20250911081238",
3
+ "version": "0.0.0-experimental-20250915134255",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -44,33 +44,33 @@
44
44
  "prepublishOnly": "pnpm build"
45
45
  },
46
46
  "dependencies": {
47
- "@lowdefy/actions-core": "0.0.0-experimental-20250911081238",
48
- "@lowdefy/api": "0.0.0-experimental-20250911081238",
49
- "@lowdefy/block-utils": "0.0.0-experimental-20250911081238",
50
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20250911081238",
51
- "@lowdefy/blocks-antd": "0.0.0-experimental-20250911081238",
52
- "@lowdefy/blocks-basic": "0.0.0-experimental-20250911081238",
53
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20250911081238",
54
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20250911081238",
55
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20250911081238",
56
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20250911081238",
57
- "@lowdefy/blocks-qr": "0.0.0-experimental-20250911081238",
58
- "@lowdefy/build": "0.0.0-experimental-20250911081238",
59
- "@lowdefy/client": "0.0.0-experimental-20250911081238",
60
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20250911081238",
61
- "@lowdefy/engine": "0.0.0-experimental-20250911081238",
62
- "@lowdefy/helpers": "0.0.0-experimental-20250911081238",
63
- "@lowdefy/layout": "0.0.0-experimental-20250911081238",
64
- "@lowdefy/node-utils": "0.0.0-experimental-20250911081238",
65
- "@lowdefy/operators-change-case": "0.0.0-experimental-20250911081238",
66
- "@lowdefy/operators-diff": "0.0.0-experimental-20250911081238",
67
- "@lowdefy/operators-js": "0.0.0-experimental-20250911081238",
68
- "@lowdefy/operators-moment": "0.0.0-experimental-20250911081238",
69
- "@lowdefy/operators-mql": "0.0.0-experimental-20250911081238",
70
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20250911081238",
71
- "@lowdefy/operators-uuid": "0.0.0-experimental-20250911081238",
72
- "@lowdefy/operators-yaml": "0.0.0-experimental-20250911081238",
73
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20250911081238",
47
+ "@lowdefy/actions-core": "0.0.0-experimental-20250915134255",
48
+ "@lowdefy/api": "0.0.0-experimental-20250915134255",
49
+ "@lowdefy/block-utils": "0.0.0-experimental-20250915134255",
50
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20250915134255",
51
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20250915134255",
52
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20250915134255",
53
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20250915134255",
54
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20250915134255",
55
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20250915134255",
56
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20250915134255",
57
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20250915134255",
58
+ "@lowdefy/build": "0.0.0-experimental-20250915134255",
59
+ "@lowdefy/client": "0.0.0-experimental-20250915134255",
60
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20250915134255",
61
+ "@lowdefy/engine": "0.0.0-experimental-20250915134255",
62
+ "@lowdefy/helpers": "0.0.0-experimental-20250915134255",
63
+ "@lowdefy/layout": "0.0.0-experimental-20250915134255",
64
+ "@lowdefy/node-utils": "0.0.0-experimental-20250915134255",
65
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20250915134255",
66
+ "@lowdefy/operators-diff": "0.0.0-experimental-20250915134255",
67
+ "@lowdefy/operators-js": "0.0.0-experimental-20250915134255",
68
+ "@lowdefy/operators-moment": "0.0.0-experimental-20250915134255",
69
+ "@lowdefy/operators-mql": "0.0.0-experimental-20250915134255",
70
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20250915134255",
71
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20250915134255",
72
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20250915134255",
73
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20250915134255",
74
74
  "@modelcontextprotocol/sdk": "1.17.4",
75
75
  "chokidar": "3.5.3",
76
76
  "dotenv": "16.3.1",
@@ -86,7 +86,7 @@
86
86
  "swr": "2.2.4",
87
87
  "yaml": "2.3.4",
88
88
  "yargs": "17.7.2",
89
- "zod": "^3"
89
+ "zod": "3.25.76"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@next/eslint-plugin-next": "13.5.4",