@lowdefy/server-dev 0.0.0-experimental-20260714092003 → 0.0.0-experimental-20260714111912

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.
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import React, { useEffect, useReducer, useRef, useState } from 'react';
18
+ import { createPortal } from 'react-dom';
18
19
 
19
20
  import { blockAncestorChain, describeElement, nearestBlock } from './elementInspect.js';
20
21
  import {
@@ -663,7 +664,16 @@ function FeedbackOverlay({ basePath, pageId, onClose }) {
663
664
  } catch {
664
665
  content = null;
665
666
  }
666
- return content;
667
+ // Portal to document.body so the overlay is a top-level sibling of the app
668
+ // root. Rendered inline it inherits the app root's stacking context, and an
669
+ // open antd modal (portalled to body, zIndex ~1000) then paints above the
670
+ // overlay regardless of its own zIndex — making the comment textarea
671
+ // unclickable. As a body sibling its zIndex competes in the root stacking
672
+ // context and wins.
673
+ if (typeof document === 'undefined' || !document.body) {
674
+ return content;
675
+ }
676
+ return createPortal(content, document.body);
667
677
  }
668
678
 
669
679
  // Pure render function kept outside the hook-bearing component body so a
@@ -776,7 +786,11 @@ function renderOverlayContent({
776
786
  <div style={descriptorRow}>{state.draftShapes.length} shape(s) drawn</div>
777
787
  )}
778
788
  <div style={buttonRow}>
779
- <button type="button" style={secondaryButton} onClick={() => dispatch({ type: 'DISCARD_DRAFT' })}>
789
+ <button
790
+ type="button"
791
+ style={secondaryButton}
792
+ onClick={() => dispatch({ type: 'DISCARD_DRAFT' })}
793
+ >
780
794
  Cancel
781
795
  </button>
782
796
  <button type="button" style={primaryButton} onClick={handleSave}>
@@ -823,10 +837,18 @@ function renderOverlayContent({
823
837
  </label>
824
838
  {state.sendError && <div style={errorRow}>{state.sendError}</div>}
825
839
  <div style={buttonRow}>
826
- <button type="button" style={dangerButton} onClick={() => dispatch({ type: 'DISCARD_ALL' })}>
840
+ <button
841
+ type="button"
842
+ style={dangerButton}
843
+ onClick={() => dispatch({ type: 'DISCARD_ALL' })}
844
+ >
827
845
  Discard all
828
846
  </button>
829
- <button type="button" style={secondaryButton} onClick={() => dispatch({ type: 'ADD_ANOTHER' })}>
847
+ <button
848
+ type="button"
849
+ style={secondaryButton}
850
+ onClick={() => dispatch({ type: 'ADD_ANOTHER' })}
851
+ >
830
852
  Add another
831
853
  </button>
832
854
  <button
@@ -18,6 +18,7 @@ import { chromium } from 'playwright-core';
18
18
  import { type } from '@lowdefy/helpers';
19
19
 
20
20
  import lowdefyConfig from '../build/config.js';
21
+ import { HEADLESS_USER_COOKIE, headlessUser } from '../server/auth/headlessUser.js';
21
22
 
22
23
  // playwright-core does not bundle a browser (unlike @playwright/test) — it
23
24
  // only drives one that is already installed. `channel: 'chrome'` picks up a
@@ -73,6 +74,16 @@ function buildPageUrl({ origin, pageId }) {
73
74
  async function openPage({ browser, origin, pageId, width = 1280, height = 800, timeout = 15000 }) {
74
75
  const url = buildPageUrl({ origin, pageId });
75
76
  const context = await browser.newContext({ viewport: { width, height } });
77
+ // Inject an authenticated user so auth-protected pages don't 404 for the
78
+ // cookieless headless context. Mirrors the e2e user-cookie pattern; scoped to
79
+ // `origin` so it rides along on the same-origin /api/* fetches.
80
+ await context.addCookies([
81
+ {
82
+ name: HEADLESS_USER_COOKIE,
83
+ value: Buffer.from(JSON.stringify(headlessUser)).toString('base64'),
84
+ url: origin,
85
+ },
86
+ ]);
76
87
  const page = await context.newPage();
77
88
  try {
78
89
  await page.goto(url, { waitUntil: 'networkidle', timeout });
@@ -0,0 +1,39 @@
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 { HEADLESS_USER_COOKIE } from './headlessUser.js';
18
+
19
+ // Mirrors the e2e user-injection pattern (server-e2e/lib/server/auth/session.js):
20
+ // the headless renderer sets a base64-JSON user cookie on its own browser
21
+ // context, so its /api/* fetches carry a session while the developer's real
22
+ // browser (no cookie) is unaffected.
23
+ function getHeadlessSession(c) {
24
+ const cookieHeader = c.req.header('cookie') ?? '';
25
+ const match = cookieHeader.match(new RegExp(`${HEADLESS_USER_COOKIE}=([^;]+)`));
26
+ if (!match) {
27
+ return undefined;
28
+ }
29
+
30
+ try {
31
+ const decoded = Buffer.from(decodeURIComponent(match[1]), 'base64').toString();
32
+ const user = JSON.parse(decoded);
33
+ return { user };
34
+ } catch {
35
+ return undefined;
36
+ }
37
+ }
38
+
39
+ export default getHeadlessSession;
@@ -0,0 +1,29 @@
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
+ // Shared between the headless renderer (getBrowser.js, which sets the cookie on
18
+ // its browser context) and the dev getSession (getHeadlessSession.js, which
19
+ // decodes it) so the cookie name and injected user shape live in one place.
20
+ const HEADLESS_USER_COOKIE = 'lowdefy_headless_user';
21
+
22
+ const headlessUser = {
23
+ sub: 'lowdefy-headless',
24
+ id: 'lowdefy-headless',
25
+ name: 'Lowdefy Headless',
26
+ roles: [],
27
+ };
28
+
29
+ export { HEADLESS_USER_COOKIE, headlessUser };
@@ -17,15 +17,21 @@
17
17
  import { getAuthUser } from '@hono/auth-js';
18
18
 
19
19
  import authJson from '../../build/auth.js';
20
+ import getHeadlessSession from './getHeadlessSession.js';
20
21
  import getMockSession from './getMockSession.js';
21
22
 
22
- // Replaces getServerSession.js — mock user first (dev only), then the
23
- // session from the Hono context populated by initAuthConfig.
23
+ // Replaces getServerSession.js — mock user first (dev only), then the headless
24
+ // renderer's injected user cookie, then the session from the Hono context
25
+ // populated by initAuthConfig.
24
26
  async function getSession(c) {
25
27
  const mockSession = await getMockSession();
26
28
  if (mockSession) {
27
29
  return mockSession;
28
30
  }
31
+ const headlessSession = getHeadlessSession(c);
32
+ if (headlessSession) {
33
+ return headlessSession;
34
+ }
29
35
  if (authJson.configured !== true) {
30
36
  return undefined;
31
37
  }
package/manager/run.mjs CHANGED
@@ -109,6 +109,9 @@ try {
109
109
 
110
110
  startServer(context);
111
111
  await wait(800);
112
+ context.logger.info(
113
+ `Dev server ready at http://localhost:${context.options.port} — press Cmd/Ctrl+/ in the browser to annotate the page and copy feedback for your coding agent.`
114
+ );
112
115
  if (process.env.LOWDEFY_SERVER_DEV_OPEN_BROWSER === 'true') {
113
116
  // TODO: Wait 1 sec for a ping and don't open if a ping is seen
114
117
  opener(`http://localhost:${context.options.port}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20260714092003",
3
+ "version": "0.0.0-experimental-20260714111912",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -45,37 +45,37 @@
45
45
  "@hono/mcp": "0.3.0",
46
46
  "@hono/node-server": "2.0.4",
47
47
  "@hono/vite-dev-server": "0.26.0",
48
- "@lowdefy/actions-core": "0.0.0-experimental-20260714092003",
49
- "@lowdefy/api": "0.0.0-experimental-20260714092003",
50
- "@lowdefy/block-utils": "0.0.0-experimental-20260714092003",
51
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260714092003",
52
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260714092003",
53
- "@lowdefy/blocks-antd-x": "0.0.0-experimental-20260714092003",
54
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260714092003",
55
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260714092003",
56
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260714092003",
57
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260714092003",
58
- "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260714092003",
59
- "@lowdefy/build": "0.0.0-experimental-20260714092003",
60
- "@lowdefy/client": "0.0.0-experimental-20260714092003",
61
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260714092003",
62
- "@lowdefy/docs-content": "0.0.0-experimental-20260714092003",
63
- "@lowdefy/engine": "0.0.0-experimental-20260714092003",
64
- "@lowdefy/errors": "0.0.0-experimental-20260714092003",
65
- "@lowdefy/helpers": "0.0.0-experimental-20260714092003",
66
- "@lowdefy/layout": "0.0.0-experimental-20260714092003",
67
- "@lowdefy/logger": "0.0.0-experimental-20260714092003",
68
- "@lowdefy/node-utils": "0.0.0-experimental-20260714092003",
69
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260714092003",
70
- "@lowdefy/operators-dayjs": "0.0.0-experimental-20260714092003",
71
- "@lowdefy/operators-diff": "0.0.0-experimental-20260714092003",
72
- "@lowdefy/operators-js": "0.0.0-experimental-20260714092003",
73
- "@lowdefy/operators-mql": "0.0.0-experimental-20260714092003",
74
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260714092003",
75
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260714092003",
76
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260714092003",
77
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260714092003",
78
- "@lowdefy/websockets-core": "0.0.0-experimental-20260714092003",
48
+ "@lowdefy/actions-core": "0.0.0-experimental-20260714111912",
49
+ "@lowdefy/api": "0.0.0-experimental-20260714111912",
50
+ "@lowdefy/block-utils": "0.0.0-experimental-20260714111912",
51
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260714111912",
52
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260714111912",
53
+ "@lowdefy/blocks-antd-x": "0.0.0-experimental-20260714111912",
54
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260714111912",
55
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260714111912",
56
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260714111912",
57
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260714111912",
58
+ "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260714111912",
59
+ "@lowdefy/build": "0.0.0-experimental-20260714111912",
60
+ "@lowdefy/client": "0.0.0-experimental-20260714111912",
61
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260714111912",
62
+ "@lowdefy/docs-content": "0.0.0-experimental-20260714111912",
63
+ "@lowdefy/engine": "0.0.0-experimental-20260714111912",
64
+ "@lowdefy/errors": "0.0.0-experimental-20260714111912",
65
+ "@lowdefy/helpers": "0.0.0-experimental-20260714111912",
66
+ "@lowdefy/layout": "0.0.0-experimental-20260714111912",
67
+ "@lowdefy/logger": "0.0.0-experimental-20260714111912",
68
+ "@lowdefy/node-utils": "0.0.0-experimental-20260714111912",
69
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260714111912",
70
+ "@lowdefy/operators-dayjs": "0.0.0-experimental-20260714111912",
71
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260714111912",
72
+ "@lowdefy/operators-js": "0.0.0-experimental-20260714111912",
73
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260714111912",
74
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260714111912",
75
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260714111912",
76
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260714111912",
77
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260714111912",
78
+ "@lowdefy/websockets-core": "0.0.0-experimental-20260714111912",
79
79
  "@modelcontextprotocol/sdk": "1.29.0",
80
80
  "@tailwindcss/postcss": "4.3.1",
81
81
  "@vitejs/plugin-react": "6.0.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20260714092003",
3
+ "version": "0.0.0-experimental-20260714111912",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -51,37 +51,37 @@
51
51
  "@hono/mcp": "0.3.0",
52
52
  "@hono/node-server": "2.0.4",
53
53
  "@hono/vite-dev-server": "0.26.0",
54
- "@lowdefy/actions-core": "0.0.0-experimental-20260714092003",
55
- "@lowdefy/api": "0.0.0-experimental-20260714092003",
56
- "@lowdefy/block-utils": "0.0.0-experimental-20260714092003",
57
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260714092003",
58
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260714092003",
59
- "@lowdefy/blocks-antd-x": "0.0.0-experimental-20260714092003",
60
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260714092003",
61
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260714092003",
62
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260714092003",
63
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260714092003",
64
- "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260714092003",
65
- "@lowdefy/build": "0.0.0-experimental-20260714092003",
66
- "@lowdefy/client": "0.0.0-experimental-20260714092003",
67
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260714092003",
68
- "@lowdefy/docs-content": "0.0.0-experimental-20260714092003",
69
- "@lowdefy/engine": "0.0.0-experimental-20260714092003",
70
- "@lowdefy/errors": "0.0.0-experimental-20260714092003",
71
- "@lowdefy/helpers": "0.0.0-experimental-20260714092003",
72
- "@lowdefy/layout": "0.0.0-experimental-20260714092003",
73
- "@lowdefy/logger": "0.0.0-experimental-20260714092003",
74
- "@lowdefy/node-utils": "0.0.0-experimental-20260714092003",
75
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260714092003",
76
- "@lowdefy/operators-dayjs": "0.0.0-experimental-20260714092003",
77
- "@lowdefy/operators-diff": "0.0.0-experimental-20260714092003",
78
- "@lowdefy/operators-js": "0.0.0-experimental-20260714092003",
79
- "@lowdefy/operators-mql": "0.0.0-experimental-20260714092003",
80
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260714092003",
81
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260714092003",
82
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260714092003",
83
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260714092003",
84
- "@lowdefy/websockets-core": "0.0.0-experimental-20260714092003",
54
+ "@lowdefy/actions-core": "0.0.0-experimental-20260714111912",
55
+ "@lowdefy/api": "0.0.0-experimental-20260714111912",
56
+ "@lowdefy/block-utils": "0.0.0-experimental-20260714111912",
57
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260714111912",
58
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260714111912",
59
+ "@lowdefy/blocks-antd-x": "0.0.0-experimental-20260714111912",
60
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260714111912",
61
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260714111912",
62
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260714111912",
63
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260714111912",
64
+ "@lowdefy/blocks-tiptap": "0.0.0-experimental-20260714111912",
65
+ "@lowdefy/build": "0.0.0-experimental-20260714111912",
66
+ "@lowdefy/client": "0.0.0-experimental-20260714111912",
67
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260714111912",
68
+ "@lowdefy/docs-content": "0.0.0-experimental-20260714111912",
69
+ "@lowdefy/engine": "0.0.0-experimental-20260714111912",
70
+ "@lowdefy/errors": "0.0.0-experimental-20260714111912",
71
+ "@lowdefy/helpers": "0.0.0-experimental-20260714111912",
72
+ "@lowdefy/layout": "0.0.0-experimental-20260714111912",
73
+ "@lowdefy/logger": "0.0.0-experimental-20260714111912",
74
+ "@lowdefy/node-utils": "0.0.0-experimental-20260714111912",
75
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260714111912",
76
+ "@lowdefy/operators-dayjs": "0.0.0-experimental-20260714111912",
77
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260714111912",
78
+ "@lowdefy/operators-js": "0.0.0-experimental-20260714111912",
79
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260714111912",
80
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260714111912",
81
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260714111912",
82
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260714111912",
83
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260714111912",
84
+ "@lowdefy/websockets-core": "0.0.0-experimental-20260714111912",
85
85
  "@modelcontextprotocol/sdk": "1.29.0",
86
86
  "@tailwindcss/postcss": "4.3.1",
87
87
  "@vitejs/plugin-react": "6.0.2",