wtt-connect 0.2.56 → 0.2.57
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 +1 -1
- package/src/runner.js +7 -9
package/package.json
CHANGED
package/src/runner.js
CHANGED
|
@@ -939,17 +939,15 @@ 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
|
|
943
|
-
'-
|
|
944
|
-
'-
|
|
945
|
-
'-
|
|
946
|
-
'-
|
|
942
|
+
'- Preview servers are managed by the Cloudflare Sandbox Worker, not by WTT backend and not by `wtt-connect preview-port`.',
|
|
943
|
+
'- Each sandbox has one fixed live preview slot on port 5173. To create or replace a preview, call the Worker outbox `/preview/start` with a command and cwd. The Worker stops the old port-5173 dev server, starts the new one, checks reachability, exposes it publicly, and returns `preview_url`.',
|
|
944
|
+
'- The preview start command must bind to `0.0.0.0`, not `127.0.0.1` or `localhost`. The Worker auto-adds common Vite/Next/Python host flags when safe, but you should still provide explicit host flags.',
|
|
945
|
+
'- For Vite use command `npm run dev -- --host 0.0.0.0 --port 5173`; for Next use `next dev -H 0.0.0.0 -p 5173`; for Python use `python3 -m http.server 5173 --bind 0.0.0.0`.',
|
|
946
|
+
'- Never start multiple preview dev servers. If you need a new preview, call `/preview/start` again and let the Worker replace the old one.',
|
|
947
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.',
|
|
948
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.',
|
|
949
|
-
'- If
|
|
950
|
-
|
|
951
|
-
`- Preview curl rule: curl -sS -X POST "\${WTT_SANDBOX_OUTBOX_URL:-http://wtt.preview}/preview-port" -H 'content-type: application/json' -d '{"agent_id":"'\${WTT_AGENT_ID:-cloud-agent}'","port":<port>}'`,
|
|
952
|
-
`- Prefer automatic WTT publishing when topic id is available: wtt-connect preview-port --port <port>${topicId ? ` --topic-id ${topicId}` : ' --topic-id <topic_id>'} --title "Short Title". This publishes one cloud_sandbox_preview live card.`,
|
|
949
|
+
'- If a live preview is requested, call the Worker outbox directly and include the returned `preview_url` in your reply as `[preview_url:Short Title](<preview_url>)`.',
|
|
950
|
+
`- Preview start command: curl -sS -X POST "\${WTT_SANDBOX_OUTBOX_URL:-http://wtt.preview}/preview/start" -H 'content-type: application/json' -d '{"agent_id":"'\${WTT_AGENT_ID:-cloud-agent}'","title":"Short Title","cwd":"'\$(pwd)'","command":"npm run dev -- --host 0.0.0.0 --port 5173"}'`,
|
|
953
951
|
);
|
|
954
952
|
return lines.join('\n');
|
|
955
953
|
}
|