tuna-agent 0.1.56 → 0.1.58

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.
@@ -57,6 +57,7 @@ export class ClaudeCodeAdapter {
57
57
  this.currentAgentId = savedId;
58
58
  });
59
59
  const agentMetricsMap = {};
60
+ // Include agents from metricsMap
60
61
  this.metricsMap.forEach((m, agentId) => {
61
62
  const entry = { ...m };
62
63
  const rules = this.learnedRulesMap.get(agentId);
@@ -65,6 +66,12 @@ export class ClaudeCodeAdapter {
65
66
  }
66
67
  agentMetricsMap[agentId] = entry;
67
68
  });
69
+ // Include agents that have rules but no metrics yet (no task dispatched since restart)
70
+ this.learnedRulesMap.forEach((rules, agentId) => {
71
+ if (!agentMetricsMap[agentId] && rules.length > 0) {
72
+ agentMetricsMap[agentId] = { learnedRules: rules, rulesCount: rules.length };
73
+ }
74
+ });
68
75
  return { agentMetricsMap };
69
76
  }
70
77
  /** Register an agent folder path for rules parsing (called from daemon). */
@@ -181,6 +181,19 @@ export async function startDaemon(config) {
181
181
  }
182
182
  }
183
183
  }
184
+ // Register agent folders for rules parsing from server-provided list
185
+ if (Array.isArray(msg.agentFolders) && adapter.type === 'claude-code') {
186
+ const ccAdapter = adapter;
187
+ for (const af of msg.agentFolders) {
188
+ if (af.id && af.folder_path) {
189
+ const folder = af.folder_path.startsWith('~')
190
+ ? path.join(os.homedir(), af.folder_path.slice(1))
191
+ : af.folder_path;
192
+ ccAdapter.registerAgentFolder(af.id, folder);
193
+ }
194
+ }
195
+ console.log(`[Daemon] Registered ${msg.agentFolders.length} agent folder(s) for rules sync`);
196
+ }
184
197
  // Recover orphaned tasks — pass activeTaskId so API won't fail a task we're still running
185
198
  ws.send({ action: 'recover_orphaned_tasks', activeTaskId: currentTaskId ?? undefined });
186
199
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"