tuna-agent 0.1.10 → 0.1.12

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.
@@ -212,7 +212,7 @@ export async function handleGenerateScript(ws, code, taskId, idea, topic, style,
212
212
  // Build style guidance section
213
213
  let styleContext = '';
214
214
  if (styleGuidance && styleGuidance.trim()) {
215
- styleContext = `\n\n## VIDEO STYLE GUIDANCE (${styleName || resolvedStyle})\n\nFollow these style-specific instructions for tone, pacing, camera work, and visual direction. The output format MUST remain exactly as specified above — only the CONTENT within each section should reflect this guidance.\n\n${styleGuidance.trim()}`;
215
+ styleContext = `\n\n## VIDEO STYLE GUIDANCE (${styleName || resolvedStyle})\n\nFollow these style-specific instructions for tone, pacing, camera work, and visual direction. The output format MUST remain exactly as specified above — only the CONTENT within each section should reflect this guidance.\n\nCRITICAL OVERRIDE: Regardless of anything in the guidance below, ALL clips are exactly 8 seconds (Veo3 constraint). Do NOT add timestamps like (0-3s) or (3-13s) to CLIP headings. Use format: ## CLIP N: NAME\n\n${styleGuidance.trim()}`;
216
216
  }
217
217
  const systemPrompt = expandedTemplate + styleContext + (characterContext
218
218
  ? `\n\n## AVAILABLE CHARACTERS\n${characterContext}`
@@ -221,7 +221,7 @@ export async function handleGenerateScript(ws, code, taskId, idea, topic, style,
221
221
  let streamChunks = 0;
222
222
  let sentTextLen = 0; // track how much text we've already streamed
223
223
  const result = await runClaude({
224
- prompt: `Viết script video theo hướng dẫn trên.\n\nIdea: ${idea}\nStyle: ${resolvedStyle}\nDuration: ${resolvedDuration}s\nLanguage: ${resolvedLanguage}`,
224
+ prompt: `Viết script video theo hướng dẫn trên.\n\nIdea: ${idea}\nStyle: ${resolvedStyle}\nClips: ${Math.round(resolvedDuration / 8)} (each exactly 8s, total ~${resolvedDuration}s)\nLanguage: ${resolvedLanguage}`,
225
225
  systemPrompt,
226
226
  cwd: CONTENT_CREATOR_DIR,
227
227
  maxTurns: 4,
package/dist/mcp/setup.js CHANGED
@@ -29,7 +29,9 @@ const MEM0_ENV_VARS = {
29
29
  function buildMem0McpConfig(agentName) {
30
30
  if (!MEM0_SSH_HOST)
31
31
  return null;
32
- const envWithUser = { ...MEM0_ENV_VARS, MEM0_USER_ID: agentName };
32
+ // Sanitize agent name for shell safety (replace non-alphanumeric with hyphens)
33
+ const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
34
+ const envWithUser = { ...MEM0_ENV_VARS, MEM0_USER_ID: safeAgentName };
33
35
  if (MEM0_SSH_HOST === 'local') {
34
36
  return {
35
37
  command: 'mem0-mcp',
@@ -37,7 +39,7 @@ function buildMem0McpConfig(agentName) {
37
39
  env: envWithUser,
38
40
  };
39
41
  }
40
- const envString = Object.entries(envWithUser).map(([k, v]) => `${k}='${String(v).replace(/'/g, "'\\''")}'`).join(' ');
42
+ const envString = Object.entries(envWithUser).map(([k, v]) => `${k}=${v}`).join(' ');
41
43
  const args = ['-p', MEM0_SSH_PORT, '-o', 'StrictHostKeyChecking=no'];
42
44
  if (MEM0_SSH_KEY) {
43
45
  args.push('-i', MEM0_SSH_KEY);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"