@ghl-ai/aw 0.1.37-beta.32 → 0.1.37-beta.34
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/commands/memory.mjs +23 -10
- package/package.json +1 -1
package/commands/memory.mjs
CHANGED
|
@@ -41,15 +41,22 @@ async function memoryStore(args) {
|
|
|
41
41
|
s.stop('Memory stored');
|
|
42
42
|
|
|
43
43
|
const data = result?.result ?? result;
|
|
44
|
+
const curation = data.curation || {};
|
|
45
|
+
const cls = data.classification || {};
|
|
46
|
+
const mem = data.memory || {};
|
|
47
|
+
const action = curation.action || 'STORED';
|
|
44
48
|
const lines = [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
`${chalk.dim('action:')} ${chalk.cyan(action)}`,
|
|
50
|
+
curation.reason ? `${chalk.dim('reason:')} ${curation.reason}` : null,
|
|
51
|
+
mem.id ? `${chalk.dim('id:')} ${mem.id}` : null,
|
|
52
|
+
cls.layer ? `${chalk.dim('layer:')} ${chalk.cyan(cls.layer)}` : null,
|
|
53
|
+
cls.overlay?.length ? `${chalk.dim('overlay:')} ${cls.overlay.join(', ')}` : null,
|
|
54
|
+
cls.angle?.length ? `${chalk.dim('angle:')} ${cls.angle.join(', ')}` : null,
|
|
55
|
+
cls.classification_confidence != null ? `${chalk.dim('conf:')} ${cls.classification_confidence}` : null,
|
|
49
56
|
].filter(Boolean).join('\n');
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
fmt.outro(
|
|
58
|
+
fmt.note(lines, 'Result');
|
|
59
|
+
fmt.outro(`Memory ${action.toLowerCase()}d`);
|
|
53
60
|
} catch (err) {
|
|
54
61
|
s.stop(chalk.red('Failed'));
|
|
55
62
|
fmt.cancel(`Store failed: ${err.message}`);
|
|
@@ -80,7 +87,7 @@ async function memorySearch(args) {
|
|
|
80
87
|
const result = await callMemoryTool('memory_search', params);
|
|
81
88
|
s.stop('Search complete');
|
|
82
89
|
|
|
83
|
-
const memories = result?.memories ?? result?.results ?? [];
|
|
90
|
+
const memories = Array.isArray(result) ? result : (result?.memories ?? result?.results ?? []);
|
|
84
91
|
if (memories.length === 0) {
|
|
85
92
|
fmt.logInfo('No memories found.');
|
|
86
93
|
fmt.outro('Search complete');
|
|
@@ -88,10 +95,16 @@ async function memorySearch(args) {
|
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
for (const mem of memories) {
|
|
98
|
+
const score = mem.rrf_score ?? mem.score;
|
|
99
|
+
const overlays = Array.isArray(mem.overlay) ? mem.overlay.join(',') : null;
|
|
100
|
+
const angles = Array.isArray(mem.angle) ? mem.angle.join(',') : null;
|
|
91
101
|
const meta = [
|
|
92
102
|
mem.layer ? chalk.cyan(mem.layer) : null,
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
overlays ? chalk.magenta(overlays) : null,
|
|
104
|
+
angles ? chalk.yellow(angles) : null,
|
|
105
|
+
score != null ? chalk.dim(`score:${Number(score).toFixed(4)}`) : null,
|
|
106
|
+
mem.type ? chalk.dim(mem.type) : null,
|
|
107
|
+
mem.id ? chalk.dim(mem.id.slice(0, 8)) : null,
|
|
95
108
|
].filter(Boolean).join(chalk.dim(' | '));
|
|
96
109
|
|
|
97
110
|
const header = meta || 'Memory';
|
|
@@ -160,7 +173,7 @@ async function memoryStats(args) {
|
|
|
160
173
|
const result = await callMemoryTool('memory_search', { query: '*', limit: 200, ...params });
|
|
161
174
|
s.stop('Stats loaded');
|
|
162
175
|
|
|
163
|
-
const memories = result?.memories ?? result?.results ?? [];
|
|
176
|
+
const memories = Array.isArray(result) ? result : (result?.memories ?? result?.results ?? []);
|
|
164
177
|
const total = memories.length;
|
|
165
178
|
|
|
166
179
|
// Aggregate by layer, overlay, angle
|