tuna-agent 0.1.97 → 0.1.99

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.
@@ -209,7 +209,7 @@ export class ClaudeCodeAdapter {
209
209
  // Write MCP config to agent folder .mcp.json on first round
210
210
  // Claude Code reads .mcp.json automatically for project-level MCPs
211
211
  if (round === 0) {
212
- writeAgentFolderMcpConfig(cwd, this.agentConfig);
212
+ writeAgentFolderMcpConfig(cwd, this.agentConfig, task.agentId);
213
213
  // Seed memoryCount from Mem0 so it survives daemon restarts (non-blocking)
214
214
  fetchMem0Count(localAgentName).then(count => {
215
215
  const m = this.getMetricsForAgent(localAgentId);
@@ -274,7 +274,8 @@ async function handleToolCall(config, toolName, args) {
274
274
  }
275
275
  case 'list_ideas': {
276
276
  const params = new URLSearchParams();
277
- params.set('agent_id', args.agent_id || config.agentId);
277
+ if (args.agent_id)
278
+ params.set('agent_id', args.agent_id);
278
279
  if (args.status)
279
280
  params.set('status', args.status);
280
281
  if (args.category)
@@ -284,13 +285,13 @@ async function handleToolCall(config, toolName, args) {
284
285
  if (args.page)
285
286
  params.set('page', args.page);
286
287
  if (args.limit)
287
- params.set('limit', args.limit);
288
+ params.set('limit', args.limit || '100');
288
289
  if (args.sort_by)
289
290
  params.set('sort_by', args.sort_by);
290
291
  if (args.sort_order)
291
292
  params.set('sort_order', args.sort_order);
292
293
  const data = await apiCall(config, 'GET', `/agent-idea?${params.toString()}`);
293
- const ideas = data.ideas || [];
294
+ const ideas = data.items || [];
294
295
  if (ideas.length === 0) {
295
296
  return { content: [{ type: 'text', text: 'No ideas found.' }] };
296
297
  }
@@ -318,7 +319,7 @@ async function handleToolCall(config, toolName, args) {
318
319
  if (args.limit)
319
320
  params.set('limit', args.limit);
320
321
  const data = await apiCall(config, 'GET', `/agent-idea/search?${params.toString()}`);
321
- const ideas = data.ideas || [];
322
+ const ideas = data.items || [];
322
323
  if (ideas.length === 0) {
323
324
  return { content: [{ type: 'text', text: `No ideas found matching "${args.query}".` }] };
324
325
  }
@@ -40,7 +40,7 @@ export declare function getMcpConfigPath(): string | undefined;
40
40
  * Claude Code reads .mcp.json automatically for project-level MCPs.
41
41
  * Note: .claude/settings.json mcpServers is NOT reliably read by Claude Code CLI.
42
42
  */
43
- export declare function writeAgentFolderMcpConfig(agentFolderPath: string, config: AgentConfig): void;
43
+ export declare function writeAgentFolderMcpConfig(agentFolderPath: string, config: AgentConfig, agentId?: string): void;
44
44
  /**
45
45
  * Clean up MCP config file.
46
46
  */
package/dist/mcp/setup.js CHANGED
@@ -428,13 +428,15 @@ export function getMcpConfigPath() {
428
428
  * Claude Code reads .mcp.json automatically for project-level MCPs.
429
429
  * Note: .claude/settings.json mcpServers is NOT reliably read by Claude Code CLI.
430
430
  */
431
- export function writeAgentFolderMcpConfig(agentFolderPath, config) {
431
+ export function writeAgentFolderMcpConfig(agentFolderPath, config, agentId) {
432
432
  const knowledgeServerPath = path.join(__dirname, 'knowledge-server.js');
433
433
  const ideaServerPath = path.join(__dirname, 'idea-server.js');
434
434
  const browserServerPath = path.join(__dirname, 'browser-server.js');
435
435
  // Derive agent name from folder path (e.g. ~/agents/co-founder → "co-founder")
436
436
  // config.name is the machine name, NOT the agent name
437
437
  const agentName = path.basename(agentFolderPath) || config.name;
438
+ // Use per-agent ID if provided, otherwise fall back to machine-level config
439
+ const mcpAgentId = agentId || config.agentId;
438
440
  try {
439
441
  const mcpJsonPath = path.join(agentFolderPath, '.mcp.json');
440
442
  // Read existing .mcp.json to preserve other servers (e.g. playwright)
@@ -451,7 +453,7 @@ export function writeAgentFolderMcpConfig(agentFolderPath, config) {
451
453
  knowledgeServerPath,
452
454
  '--api-url', config.apiUrl,
453
455
  '--token', config.agentToken,
454
- '--agent-id', config.agentId,
456
+ '--agent-id', mcpAgentId,
455
457
  ],
456
458
  },
457
459
  'tuna-idea': {
@@ -460,7 +462,7 @@ export function writeAgentFolderMcpConfig(agentFolderPath, config) {
460
462
  ideaServerPath,
461
463
  '--api-url', config.apiUrl,
462
464
  '--token', config.agentToken,
463
- '--agent-id', config.agentId,
465
+ '--agent-id', mcpAgentId,
464
466
  ],
465
467
  },
466
468
  'tuna-browser': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"