tuna-agent 0.1.11 → 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.
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.11",
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"