wtt-connect 0.2.54 → 0.2.55

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtt-connect",
3
- "version": "0.2.54",
3
+ "version": "0.2.55",
4
4
  "private": false,
5
5
  "description": "WTT-native connector daemon for Codex, Claude Code, Cursor, Gemini, ACP, and other coding agent surfaces.",
6
6
  "type": "module",
package/src/main.js CHANGED
@@ -208,7 +208,8 @@ async function previewPort(config, argv) {
208
208
  }
209
209
 
210
210
  async function assertLocalPreviewPort(port, timeoutMs = 5000) {
211
- const url = `http://127.0.0.1:${port}/`;
211
+ const host = String(process.env.WTT_CONNECT_PREVIEW_CHECK_HOST || '10.0.0.1').trim() || '10.0.0.1';
212
+ const url = `http://${host}:${port}/`;
212
213
  try {
213
214
  await fetch(url, {
214
215
  method: 'GET',
@@ -216,7 +217,7 @@ async function assertLocalPreviewPort(port, timeoutMs = 5000) {
216
217
  });
217
218
  } catch (error) {
218
219
  const message = error instanceof Error ? error.message : String(error);
219
- throw new Error(`preview-port local server is not reachable at ${url}: ${message}`);
220
+ throw new Error(`preview-port server is not reachable from the Cloudflare preview network at ${url}. Bind the dev server to 0.0.0.0 instead of 127.0.0.1 or localhost: ${message}`);
220
221
  }
221
222
  }
222
223
 
package/src/runner.js CHANGED
@@ -939,9 +939,10 @@ function renderCloudSandboxStorageInstruction(config, topicId = '') {
939
939
  '- If a generated user-facing file is stored in R2/persistent output storage and should appear in WTT chat, still publish it with `wtt-connect upload-file` or a WTT artifact marker.',
940
940
  '- If the user asks for a visual page, HTML artifact, chart, dashboard, animation, or browser preview, build it in the workspace, start a local web server, create a Cloudflare Sandbox preview URL, and return that preview URL to WTT.',
941
941
  '- The Cloud Sandbox preview URL feature is only for WTT Cloud Sandbox agents. Do not use WTT backend artifact/media preview flows for live sandbox web servers.',
942
- '- Preview servers must keep running after your command finishes. Start them in the background with `nohup ... >/tmp/<name>.log 2>&1 &` or an equivalent long-lived process, and bind to `0.0.0.0`.',
943
- '- Before publishing a preview URL, verify the server is actually listening and serving content with `curl -fsS http://127.0.0.1:<port>/ >/dev/null`.',
944
- '- If local curl fails, fix or restart the web server first. Never publish a preview URL for a dead port.',
942
+ '- Preview servers must keep running after your command finishes. Start them in the background with `nohup ... >/tmp/<name>.log 2>&1 &` or an equivalent long-lived process, and bind to `0.0.0.0`, not `127.0.0.1` or `localhost`.',
943
+ '- For Vite use `npm run dev -- --host 0.0.0.0 --port <port>`; for Next use `next dev -H 0.0.0.0 -p <port>`; for Python use `python3 -m http.server <port> --bind 0.0.0.0`.',
944
+ '- Before publishing a preview URL, verify the server is reachable from the Cloudflare preview network with `curl -fsS http://10.0.0.1:<port>/ >/dev/null`.',
945
+ '- If that curl fails, fix or restart the web server first. Never publish a preview URL for a dead or localhost-only port.',
945
946
  '- `wtt-connect preview-port` automatically keeps the most recent preview servers for this agent and stops older registered previews beyond the retention limit. Default retention is 3 live previews; use `--keep-last <n>` only when the user asks.',
946
947
  '- Do not pass `--snapshot-dir` for normal live previews. Live Cloud Sandbox previews should render as inline WTT preview cards, not as ordinary index.html/document artifacts.',
947
948
  '- If the user explicitly asks for a persistent static artifact or downloadable HTML, publish that separately with `wtt-connect upload-artifact --dir <dir> --title "Short Title"` instead of mixing it with the live preview URL.',