tuna-agent 0.1.63 → 0.1.64

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
@@ -68,7 +68,7 @@ export async function fetchMem0Count(agentName) {
68
68
  export async function callMem0AddMemory(text, agentName) {
69
69
  if (!MEM0_SSH_HOST && !MEM0_HTTP_BASE)
70
70
  throw new Error('Mem0 not configured');
71
- const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
71
+ const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
72
72
  // Try HTTP API first (OpenMemory) — stores in SQLite+Qdrant, shows up in counts
73
73
  // Falls through to SSH+curl if HTTP is not reachable (e.g. port not exposed externally)
74
74
  if (MEM0_HTTP_BASE && !MEM0_SSH_HOST) {
@@ -145,7 +145,7 @@ export async function callMem0SearchMemory(query, agentName, limit = 5) {
145
145
  if (!MEM0_SSH_HOST)
146
146
  return [];
147
147
  const { execFile } = await import('child_process');
148
- const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
148
+ const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
149
149
  return new Promise((resolve) => {
150
150
  let cmd;
151
151
  let args;
@@ -194,7 +194,7 @@ export async function callMem0Patterns(agentName, minCluster = 3) {
194
194
  if (!MEM0_SSH_HOST)
195
195
  return [];
196
196
  const { execFile } = await import('child_process');
197
- const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
197
+ const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
198
198
  const input = JSON.stringify({ user_id: safeAgentName, min_cluster: minCluster });
199
199
  return new Promise((resolve) => {
200
200
  let cmd;
@@ -318,7 +318,7 @@ function buildMem0McpConfig(agentName) {
318
318
  if (!MEM0_SSH_HOST)
319
319
  return null;
320
320
  // Sanitize agent name for shell safety (replace non-alphanumeric with hyphens)
321
- const safeAgentName = agentName.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
321
+ const safeAgentName = agentName.toLowerCase().replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '') || 'agent';
322
322
  const envWithUser = { ...MEM0_ENV_VARS, MEM0_USER_ID: safeAgentName };
323
323
  if (MEM0_SSH_HOST === 'local') {
324
324
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.63",
3
+ "version": "0.1.64",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"