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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtt-connect",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
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
@@ -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 markdown = preview.markdown || `[preview_url](${url})`;
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 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.',
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
- `- Only if you need WTT to publish the preview card automatically, use: wtt-connect preview-port --port <port>${topicId ? ` --topic-id ${topicId}` : ' --topic-id <topic_id>'}. This is a convenience wrapper around the same sandbox outbound Worker, not a backend preview API.`,
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
  }