@lowdefy/server-dev 0.0.0-experimental-20260417102714 → 0.0.0-experimental-20260417114648

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.
@@ -20,6 +20,7 @@ import { getSecretsFromEnv } from '@lowdefy/node-utils';
20
20
  import { serializer } from '@lowdefy/helpers';
21
21
  import { v4 as uuid } from 'uuid';
22
22
 
23
+ import agents from '../../build/plugins/agents.js';
23
24
  import config from '../build/config.js';
24
25
  import connections from '../../build/plugins/connections.js';
25
26
  import createLogger from './log/createLogger.js';
@@ -65,6 +66,7 @@ function apiWrapper(handler) {
65
66
  const context = {
66
67
  // Important to give absolute path so Next can trace build files
67
68
  rid: uuid(),
69
+ agents,
68
70
  buildDirectory,
69
71
  configDirectory: process.env.LOWDEFY_DIRECTORY_CONFIG || process.cwd(),
70
72
  config,
@@ -39,6 +39,7 @@ async function getPluginDefinitions({ directories }) {
39
39
  async function createCustomPluginTypesMap({ directories, logger }) {
40
40
  const customTypesMap = {
41
41
  actions: {},
42
+ agents: {},
42
43
  auth: {
43
44
  adapters: {},
44
45
  callbacks: {},
package/next.config.js CHANGED
@@ -4,7 +4,12 @@ const blockPackages = require('./build/blockPackages.json');
4
4
  // Transpile @lowdefy/client plus all block plugin packages that may
5
5
  // contain CSS imports (e.g., AG Grid themes, loaders, markdown).
6
6
  // Built dynamically so custom user plugins are included automatically.
7
- const transpilePackages = ['@lowdefy/client', ...blockPackages];
7
+ const transpilePackages = [
8
+ '@lowdefy/client',
9
+ '@ant-design/x',
10
+ '@ant-design/x-markdown',
11
+ ...blockPackages,
12
+ ];
8
13
 
9
14
  const nextConfig = {
10
15
  basePath: lowdefyConfig.basePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20260417102714",
3
+ "version": "0.0.0-experimental-20260417114648",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -31,55 +31,57 @@
31
31
  "pages/*",
32
32
  "public_default/*",
33
33
  "next.config.js",
34
+ "postcss.config.js",
34
35
  "package.original.json",
35
36
  ".eslintrc.yaml",
36
37
  ".npmrc"
37
38
  ],
38
39
  "dependencies": {
39
- "@lowdefy/actions-core": "0.0.0-experimental-20260417102714",
40
- "@lowdefy/api": "0.0.0-experimental-20260417102714",
41
- "@lowdefy/block-utils": "0.0.0-experimental-20260417102714",
42
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260417102714",
43
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260417102714",
44
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260417102714",
45
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260417102714",
46
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260417102714",
47
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260417102714",
48
- "@lowdefy/build": "0.0.0-experimental-20260417102714",
49
- "@lowdefy/client": "0.0.0-experimental-20260417102714",
50
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260417102714",
51
- "@lowdefy/engine": "0.0.0-experimental-20260417102714",
52
- "@lowdefy/errors": "0.0.0-experimental-20260417102714",
53
- "@lowdefy/helpers": "0.0.0-experimental-20260417102714",
54
- "@lowdefy/layout": "0.0.0-experimental-20260417102714",
55
- "@lowdefy/logger": "0.0.0-experimental-20260417102714",
56
- "@lowdefy/node-utils": "0.0.0-experimental-20260417102714",
57
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260417102714",
58
- "@lowdefy/operators-dayjs": "0.0.0-experimental-20260417102714",
59
- "@lowdefy/operators-diff": "0.0.0-experimental-20260417102714",
60
- "@lowdefy/operators-js": "0.0.0-experimental-20260417102714",
61
- "@lowdefy/operators-mql": "0.0.0-experimental-20260417102714",
62
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260417102714",
63
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260417102714",
64
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260417102714",
65
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260417102714",
66
40
  "@ant-design/cssinjs": "2.1.2",
41
+ "@lowdefy/actions-core": "0.0.0-experimental-20260417114648",
42
+ "@lowdefy/api": "0.0.0-experimental-20260417114648",
43
+ "@lowdefy/block-utils": "0.0.0-experimental-20260417114648",
44
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260417114648",
45
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260417114648",
46
+ "@lowdefy/blocks-antd-x": "0.0.0-experimental-20260417114648",
47
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260417114648",
48
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260417114648",
49
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260417114648",
50
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260417114648",
51
+ "@lowdefy/build": "0.0.0-experimental-20260417114648",
52
+ "@lowdefy/client": "0.0.0-experimental-20260417114648",
53
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260417114648",
54
+ "@lowdefy/engine": "0.0.0-experimental-20260417114648",
55
+ "@lowdefy/errors": "0.0.0-experimental-20260417114648",
56
+ "@lowdefy/helpers": "0.0.0-experimental-20260417114648",
57
+ "@lowdefy/layout": "0.0.0-experimental-20260417114648",
58
+ "@lowdefy/logger": "0.0.0-experimental-20260417114648",
59
+ "@lowdefy/node-utils": "0.0.0-experimental-20260417114648",
60
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260417114648",
61
+ "@lowdefy/operators-dayjs": "0.0.0-experimental-20260417114648",
62
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260417114648",
63
+ "@lowdefy/operators-js": "0.0.0-experimental-20260417114648",
64
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260417114648",
65
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260417114648",
66
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260417114648",
67
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260417114648",
68
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260417114648",
69
+ "@tailwindcss/postcss": "4.2.1",
67
70
  "antd": "6.3.1",
68
71
  "dayjs": "1.11.19",
69
72
  "chokidar": "3.5.3",
70
73
  "dotenv": "16.3.1",
71
- "@tailwindcss/postcss": "4.2.1",
72
74
  "next": "16.1.6",
73
- "postcss": "8.5.6",
74
- "tailwindcss": "4.2.1",
75
75
  "next-auth": "4.24.10",
76
76
  "opener": "1.5.2",
77
77
  "pino": "8.16.2",
78
+ "postcss": "8.5.6",
78
79
  "process": "0.11.10",
79
80
  "react": "18.2.0",
80
81
  "react-dom": "18.2.0",
81
82
  "react-icons": "5.6.0",
82
83
  "swr": "2.2.4",
84
+ "tailwindcss": "4.2.1",
83
85
  "uuid": "13.0.0",
84
86
  "yaml": "2.3.4",
85
87
  "yargs": "17.7.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20260417102714",
3
+ "version": "0.0.0-experimental-20260417114648",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -31,6 +31,7 @@
31
31
  "pages/*",
32
32
  "public_default/*",
33
33
  "next.config.js",
34
+ "postcss.config.js",
34
35
  "package.original.json",
35
36
  ".eslintrc.yaml",
36
37
  ".npmrc"
@@ -44,50 +45,51 @@
44
45
  "prepublishOnly": "pnpm build"
45
46
  },
46
47
  "dependencies": {
47
- "@lowdefy/actions-core": "0.0.0-experimental-20260417102714",
48
- "@lowdefy/api": "0.0.0-experimental-20260417102714",
49
- "@lowdefy/block-utils": "0.0.0-experimental-20260417102714",
50
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260417102714",
51
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260417102714",
52
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260417102714",
53
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260417102714",
54
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260417102714",
55
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260417102714",
56
- "@lowdefy/build": "0.0.0-experimental-20260417102714",
57
- "@lowdefy/client": "0.0.0-experimental-20260417102714",
58
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260417102714",
59
- "@lowdefy/engine": "0.0.0-experimental-20260417102714",
60
- "@lowdefy/errors": "0.0.0-experimental-20260417102714",
61
- "@lowdefy/helpers": "0.0.0-experimental-20260417102714",
62
- "@lowdefy/layout": "0.0.0-experimental-20260417102714",
63
- "@lowdefy/logger": "0.0.0-experimental-20260417102714",
64
- "@lowdefy/node-utils": "0.0.0-experimental-20260417102714",
65
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260417102714",
66
- "@lowdefy/operators-dayjs": "0.0.0-experimental-20260417102714",
67
- "@lowdefy/operators-diff": "0.0.0-experimental-20260417102714",
68
- "@lowdefy/operators-js": "0.0.0-experimental-20260417102714",
69
- "@lowdefy/operators-mql": "0.0.0-experimental-20260417102714",
70
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260417102714",
71
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260417102714",
72
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260417102714",
73
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260417102714",
74
48
  "@ant-design/cssinjs": "2.1.2",
49
+ "@lowdefy/actions-core": "0.0.0-experimental-20260417114648",
50
+ "@lowdefy/api": "0.0.0-experimental-20260417114648",
51
+ "@lowdefy/block-utils": "0.0.0-experimental-20260417114648",
52
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260417114648",
53
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260417114648",
54
+ "@lowdefy/blocks-antd-x": "0.0.0-experimental-20260417114648",
55
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260417114648",
56
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260417114648",
57
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260417114648",
58
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260417114648",
59
+ "@lowdefy/build": "0.0.0-experimental-20260417114648",
60
+ "@lowdefy/client": "0.0.0-experimental-20260417114648",
61
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260417114648",
62
+ "@lowdefy/engine": "0.0.0-experimental-20260417114648",
63
+ "@lowdefy/errors": "0.0.0-experimental-20260417114648",
64
+ "@lowdefy/helpers": "0.0.0-experimental-20260417114648",
65
+ "@lowdefy/layout": "0.0.0-experimental-20260417114648",
66
+ "@lowdefy/logger": "0.0.0-experimental-20260417114648",
67
+ "@lowdefy/node-utils": "0.0.0-experimental-20260417114648",
68
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260417114648",
69
+ "@lowdefy/operators-dayjs": "0.0.0-experimental-20260417114648",
70
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260417114648",
71
+ "@lowdefy/operators-js": "0.0.0-experimental-20260417114648",
72
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260417114648",
73
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260417114648",
74
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260417114648",
75
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260417114648",
76
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260417114648",
77
+ "@tailwindcss/postcss": "4.2.1",
75
78
  "antd": "6.3.1",
76
79
  "dayjs": "1.11.19",
77
80
  "chokidar": "3.5.3",
78
81
  "dotenv": "16.3.1",
79
- "@tailwindcss/postcss": "4.2.1",
80
82
  "next": "16.1.6",
81
- "postcss": "8.5.6",
82
- "tailwindcss": "4.2.1",
83
83
  "next-auth": "4.24.10",
84
84
  "opener": "1.5.2",
85
85
  "pino": "8.16.2",
86
+ "postcss": "8.5.6",
86
87
  "process": "0.11.10",
87
88
  "react": "18.2.0",
88
89
  "react-dom": "18.2.0",
89
90
  "react-icons": "5.6.0",
90
91
  "swr": "2.2.4",
92
+ "tailwindcss": "4.2.1",
91
93
  "uuid": "13.0.0",
92
94
  "yaml": "2.3.4",
93
95
  "yargs": "17.7.2"
@@ -19,13 +19,8 @@ import Document, { Html, Head, Main, NextScript } from 'next/document';
19
19
 
20
20
  import appJson from '../lib/build/app.js';
21
21
  import lowdefyConfig from '../lib/build/config.js';
22
- import themeConfig from '../lib/build/theme.js';
23
22
 
24
23
  const basePath = lowdefyConfig.basePath ?? '';
25
- const VALID_COLOR_MODES = ['system', 'light', 'dark'];
26
- const configColorMode = VALID_COLOR_MODES.includes(themeConfig.darkMode)
27
- ? themeConfig.darkMode
28
- : 'system';
29
24
 
30
25
  class LowdefyDocument extends Document {
31
26
  render() {
@@ -43,14 +38,6 @@ class LowdefyDocument extends Document {
43
38
  __html: `(function(){var s=document.createElement("style");s.id="__lf-layer-order";s.textContent="@layer theme, base, antd, components, utilities;";document.head.prepend(s);new MutationObserver(function(){if(document.head.firstChild!==s)document.head.prepend(s)}).observe(document.head,{childList:true})})();`,
44
39
  }}
45
40
  />
46
- {/* Synchronous dark-mode background script — prevents white flash during
47
- page navigation when the user is in dark mode. Mirrors the logic in
48
- useDarkMode.js: configDarkMode → localStorage → prefers-color-scheme. */}
49
- <script
50
- dangerouslySetInnerHTML={{
51
- __html: `(function(){var c="${configColorMode}";if(c==="light")return;var d=false;if(c==="dark"){d=true}else{try{var p=localStorage.getItem("lowdefy_darkMode");if(p==="dark")d=true;else if(p==="light")d=false;else d=window.matchMedia("(prefers-color-scheme:dark)").matches}catch(e){d=window.matchMedia("(prefers-color-scheme:dark)").matches}}if(d)document.documentElement.style.backgroundColor="#000"})();`,
52
- }}
53
- />
54
41
  <link rel="manifest" href={`${basePath}/manifest.webmanifest`} />
55
42
  <link rel="icon" type="image/svg+xml" href={`${basePath}/icon.svg`} />
56
43
  <link rel="apple-touch-icon" href={`${basePath}/apple-touch-icon.png`} />
@@ -0,0 +1,84 @@
1
+ /*
2
+ Copyright 2020-2026 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 { callAgent } from '@lowdefy/api';
18
+
19
+ import apiWrapper from '../../../lib/server/apiWrapper.js';
20
+
21
+ async function handler({ context, req, res }) {
22
+ if (req.method !== 'POST') {
23
+ throw new Error('Only POST requests are supported.');
24
+ }
25
+ const segments = req.query.path;
26
+ if (!segments || segments.length < 2) {
27
+ res.status(400).json({ error: 'Invalid agent path' });
28
+ return;
29
+ }
30
+ const agentId = segments[segments.length - 1];
31
+ const pageId = segments.slice(0, -1).join('/');
32
+ context.logger.info({ color: 'gray' }, `Agent: ${pageId} → ${agentId}`);
33
+ const { conversationId } = req.query;
34
+ const { messages, urlQuery, pageState } = req.body;
35
+ if (!Array.isArray(messages)) {
36
+ res.status(400).json({ error: 'messages must be an array' });
37
+ return;
38
+ }
39
+ if (urlQuery != null && (typeof urlQuery !== 'object' || Array.isArray(urlQuery))) {
40
+ res.status(400).json({ error: 'urlQuery must be an object' });
41
+ return;
42
+ }
43
+ if (pageState != null && (typeof pageState !== 'object' || Array.isArray(pageState))) {
44
+ res.status(400).json({ error: 'pageState must be an object' });
45
+ return;
46
+ }
47
+ const { response: webResponse } = await callAgent(context, {
48
+ agentId,
49
+ pageId,
50
+ messages,
51
+ conversationId: conversationId ?? undefined,
52
+ pageState: pageState ?? undefined,
53
+ urlQuery: urlQuery ?? undefined,
54
+ });
55
+
56
+ // Stream the Web Response body to the Next.js response
57
+ res.setHeader('Content-Type', 'text/event-stream');
58
+ res.setHeader('Cache-Control', 'no-cache');
59
+ res.setHeader('Connection', 'keep-alive');
60
+ res.setHeader('Content-Encoding', 'none');
61
+ res.setHeader('Transfer-Encoding', 'chunked');
62
+
63
+ const reader = webResponse.body.getReader();
64
+ const decoder = new TextDecoder();
65
+ let done = false;
66
+ while (!done) {
67
+ const { value, done: readerDone } = await reader.read();
68
+ done = readerDone;
69
+ if (value) {
70
+ res.write(decoder.decode(value, { stream: true }));
71
+ }
72
+ }
73
+ res.end();
74
+ }
75
+
76
+ export const config = {
77
+ api: {
78
+ bodyParser: {
79
+ sizeLimit: '10mb',
80
+ },
81
+ },
82
+ };
83
+
84
+ export default apiWrapper(handler);
@@ -0,0 +1 @@
1
+ module.exports = { plugins: { '@tailwindcss/postcss': {} } };
@@ -1,19 +0,0 @@
1
- /*
2
- Copyright 2020-2026 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
- import { serializer } from '@lowdefy/helpers';
17
- import raw from '../../build/theme.json';
18
-
19
- export default serializer.deserialize(raw);