wtt-connect 0.2.38 → 0.2.39
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/main.js +2 -1
- package/src/runner.js +4 -2
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -150,7 +150,8 @@ async function previewPort(config, argv) {
|
|
|
150
150
|
});
|
|
151
151
|
const url = preview.preview_url || preview.url;
|
|
152
152
|
if (!url) throw new Error('Cloud Sandbox preview API returned no URL');
|
|
153
|
-
const
|
|
153
|
+
const title = String(argv.title || argv.previewName || preview.name || 'Cloud Sandbox Preview').trim();
|
|
154
|
+
const markdown = preview.markdown || `[preview_url:${title}](${url})`;
|
|
154
155
|
const topicId = String(argv.topicId || argv.sourceId || '').trim();
|
|
155
156
|
let published = null;
|
|
156
157
|
if (topicId) {
|
package/src/runner.js
CHANGED
|
@@ -937,10 +937,12 @@ function renderCloudSandboxStorageInstruction(config, topicId = '') {
|
|
|
937
937
|
'- Do not install large dependencies, clone large repositories, download datasets, or write bulky generated files into the workspace unless the user explicitly asks for local temporary storage.',
|
|
938
938
|
'- Keep only source edits, small manifests, notes, and temporary scratch files in the workspace.',
|
|
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
|
-
'- If
|
|
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
|
+
'- 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
|
+
'- If you start a web server in the sandbox and the user should preview it, call the Cloudflare Sandbox outbound Worker directly with curl and include the returned `preview_url` in your reply as `[preview_url:Short Title](<preview_url>)`.',
|
|
941
943
|
'- Preview ports must be 1024-65535 and cannot be 3000. For Vite/Next-style dev servers prefer 5173, 4173, or 8080.',
|
|
942
944
|
`- 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>}'`,
|
|
943
|
-
`-
|
|
945
|
+
`- 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 a cloud_sandbox_preview card and is a convenience wrapper around the same sandbox outbound Worker.`,
|
|
944
946
|
);
|
|
945
947
|
return lines.join('\n');
|
|
946
948
|
}
|