tuna-agent 0.1.31 → 0.1.32
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.
|
@@ -10,7 +10,11 @@ export interface AgentMetrics {
|
|
|
10
10
|
reflectionCount: number;
|
|
11
11
|
reflectionSkipCount: number;
|
|
12
12
|
patternsLearnedCount: number;
|
|
13
|
+
rulesCount: number;
|
|
13
14
|
lastTaskAt: string | null;
|
|
15
|
+
lastReflectionAt: string | null;
|
|
16
|
+
lastPatternAt: string | null;
|
|
17
|
+
latestLearnedRule: string | null;
|
|
14
18
|
upSince: string;
|
|
15
19
|
}
|
|
16
20
|
export declare class ClaudeCodeAdapter implements AgentAdapter {
|
|
@@ -24,7 +24,11 @@ export class ClaudeCodeAdapter {
|
|
|
24
24
|
reflectionCount: 0,
|
|
25
25
|
reflectionSkipCount: 0,
|
|
26
26
|
patternsLearnedCount: 0,
|
|
27
|
+
rulesCount: 0,
|
|
27
28
|
lastTaskAt: null,
|
|
29
|
+
lastReflectionAt: null,
|
|
30
|
+
lastPatternAt: null,
|
|
31
|
+
latestLearnedRule: null,
|
|
28
32
|
upSince: new Date().toISOString(),
|
|
29
33
|
};
|
|
30
34
|
constructor(config) {
|
|
@@ -723,6 +727,7 @@ export class ClaudeCodeAdapter {
|
|
|
723
727
|
console.log(`[Reflection] Storing: "${aiReflection.substring(0, 100)}..."`);
|
|
724
728
|
await callMem0AddMemory(aiReflection, this.agentConfig.name);
|
|
725
729
|
this.metrics.reflectionCount++;
|
|
730
|
+
this.metrics.lastReflectionAt = new Date().toISOString();
|
|
726
731
|
console.log(`[Reflection] Stored for task ${task.id}`);
|
|
727
732
|
}
|
|
728
733
|
catch (err) {
|
|
@@ -811,6 +816,9 @@ export class ClaudeCodeAdapter {
|
|
|
811
816
|
fs.writeFileSync(claudeMdPath, existingContent + separator + `${SECTION_HEADER}\n${rulesBlock}\n`);
|
|
812
817
|
}
|
|
813
818
|
this.metrics.patternsLearnedCount += newPatterns.length;
|
|
819
|
+
this.metrics.rulesCount += newPatterns.length;
|
|
820
|
+
this.metrics.lastPatternAt = new Date().toISOString();
|
|
821
|
+
this.metrics.latestLearnedRule = newPatterns[newPatterns.length - 1].rule.substring(0, 500);
|
|
814
822
|
console.log(`[Self-Improve] Added ${newPatterns.length} new rules to CLAUDE.md:`);
|
|
815
823
|
newPatterns.forEach(p => console.log(`[Self-Improve] - ${p.rule}`));
|
|
816
824
|
}
|