agentmesh-ai 0.3.1 → 0.4.0
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/GUIDE.md +20 -24
- package/README.md +50 -0
- package/dist/cloud/cloud-conversation.js +1 -1
- package/dist/cloud/cloud-conversation.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/conversation-tools.d.ts.map +1 -1
- package/dist/mcp/conversation-tools.js +159 -7
- package/dist/mcp/conversation-tools.js.map +1 -1
- package/dist/mcp/index.js +32 -10
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-tools.d.ts.map +1 -1
- package/dist/mcp/memory-tools.js +99 -22
- package/dist/mcp/memory-tools.js.map +1 -1
- package/dist/memory/consolidator.d.ts +54 -0
- package/dist/memory/consolidator.d.ts.map +1 -0
- package/dist/memory/consolidator.js +173 -0
- package/dist/memory/consolidator.js.map +1 -0
- package/dist/memory/index.d.ts +2 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +2 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/merge-view.d.ts +6 -1
- package/dist/memory/merge-view.d.ts.map +1 -1
- package/dist/memory/merge-view.js +136 -15
- package/dist/memory/merge-view.js.map +1 -1
- package/dist/memory/schema.d.ts +32 -8
- package/dist/memory/schema.d.ts.map +1 -1
- package/dist/memory/schema.js +4 -1
- package/dist/memory/schema.js.map +1 -1
- package/dist/memory/searcher.d.ts +15 -4
- package/dist/memory/searcher.d.ts.map +1 -1
- package/dist/memory/searcher.js +80 -28
- package/dist/memory/searcher.js.map +1 -1
- package/dist/memory/types.d.ts +23 -2
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/write-utils.d.ts +5 -1
- package/dist/memory/write-utils.d.ts.map +1 -1
- package/dist/memory/write-utils.js +37 -0
- package/dist/memory/write-utils.js.map +1 -1
- package/dist/sdk.d.ts +95 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +177 -0
- package/dist/sdk.js.map +1 -0
- package/dist/utils/id.d.ts +1 -1
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +2 -2
- package/dist/utils/id.js.map +1 -1
- package/package.json +5 -1
- package/test-realtime.mjs +97 -0
- package/test-realtime2.mjs +43 -0
- package/test-realtime3.mjs +73 -0
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import { getEffectiveStatus } from './write-utils.js';
|
|
1
|
+
import { getEffectiveStatus, inferCategory, isRule } from './write-utils.js';
|
|
2
2
|
/** Merge all agent memories into a single sorted list, with optional filtering. */
|
|
3
3
|
export function mergeMemories(memories, options) {
|
|
4
4
|
let entries = [];
|
|
5
5
|
for (const memory of memories) {
|
|
6
|
-
|
|
7
|
-
if (options?.agent && memory.agent !== options.agent) {
|
|
6
|
+
if (options?.agent && memory.agent !== options.agent)
|
|
8
7
|
continue;
|
|
9
|
-
}
|
|
10
8
|
for (const entry of memory.entries) {
|
|
11
|
-
// Filter by tags
|
|
9
|
+
// Filter by tags
|
|
12
10
|
if (options?.tags && options.tags.length > 0) {
|
|
13
11
|
const hasMatchingTag = options.tags.some(tag => entry.tags.includes(tag));
|
|
14
12
|
if (!hasMatchingTag)
|
|
15
13
|
continue;
|
|
16
14
|
}
|
|
15
|
+
// Filter by topics (for drill-down read)
|
|
16
|
+
if (options?.topics && options.topics.length > 0) {
|
|
17
|
+
const matchesTopic = options.topics.some(t => t.toLowerCase() === entry.topic.toLowerCase());
|
|
18
|
+
if (!matchesTopic)
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
// Filter private entries from other agents
|
|
22
|
+
if (entry.scope === 'private' && options?.agent !== memory.agent)
|
|
23
|
+
continue;
|
|
17
24
|
entries.push({
|
|
18
25
|
...entry,
|
|
19
26
|
agent: memory.agent,
|
|
@@ -29,31 +36,106 @@ export function mergeMemories(memories, options) {
|
|
|
29
36
|
const scoreB = entryScore(b, now, sevenDaysMs);
|
|
30
37
|
return scoreB - scoreA;
|
|
31
38
|
});
|
|
32
|
-
// Apply limit
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
// Apply limit (skip for topic-specific reads)
|
|
40
|
+
if (!options?.topics) {
|
|
41
|
+
const limit = options?.limit ?? 50;
|
|
42
|
+
if (entries.length > limit) {
|
|
43
|
+
entries = entries.slice(0, limit);
|
|
44
|
+
}
|
|
36
45
|
}
|
|
37
46
|
return entries;
|
|
38
47
|
}
|
|
39
48
|
function entryScore(entry, now, recentWindow) {
|
|
40
49
|
let score = 0;
|
|
41
|
-
// Status weight: protected > proposal > auto
|
|
42
50
|
const status = getEffectiveStatus(entry);
|
|
43
51
|
if (status === 'protected')
|
|
44
52
|
score += 30;
|
|
45
53
|
else if (status === 'proposal')
|
|
46
54
|
score += 15;
|
|
47
|
-
// Recency weight: entries within last 7 days get a boost
|
|
48
55
|
const entryTime = new Date(entry.date).getTime();
|
|
49
56
|
if (now - entryTime < recentWindow) {
|
|
50
57
|
score += 30;
|
|
51
58
|
}
|
|
52
|
-
|
|
53
|
-
score += entryTime / 1e15; // tiny fractional component for ordering
|
|
59
|
+
score += entryTime / 1e15;
|
|
54
60
|
return score;
|
|
55
61
|
}
|
|
56
|
-
|
|
62
|
+
// ── Index Format ─────────────────────────────────────────────────────────────
|
|
63
|
+
/** Category display names and order. */
|
|
64
|
+
const CATEGORY_LABELS = {
|
|
65
|
+
decision: 'Decisions',
|
|
66
|
+
api: 'APIs',
|
|
67
|
+
convention: 'Conventions',
|
|
68
|
+
gotcha: 'Gotchas',
|
|
69
|
+
dependency: 'Dependencies',
|
|
70
|
+
project_fact: 'Project Facts',
|
|
71
|
+
user_pref: 'User Preferences',
|
|
72
|
+
};
|
|
73
|
+
const CATEGORY_ORDER = [
|
|
74
|
+
'convention', 'decision', 'api', 'gotcha', 'dependency', 'project_fact', 'user_pref',
|
|
75
|
+
];
|
|
76
|
+
/**
|
|
77
|
+
* Format entries as a compact index grouped by category.
|
|
78
|
+
* Rules (conventions + protected decisions) are placed at the top.
|
|
79
|
+
*/
|
|
80
|
+
export function formatMemoryIndex(entries, myAgentId, myLastActive) {
|
|
81
|
+
if (entries.length === 0) {
|
|
82
|
+
return 'No shared memories found.\n\nStart recording knowledge with write_memory after completing tasks.';
|
|
83
|
+
}
|
|
84
|
+
const lines = [];
|
|
85
|
+
// Recent changes summary
|
|
86
|
+
if (myLastActive) {
|
|
87
|
+
const changes = getRecentChanges(entries, myAgentId ?? '', myLastActive);
|
|
88
|
+
if (changes.length > 0) {
|
|
89
|
+
lines.push('📬 Recent changes:');
|
|
90
|
+
for (const c of changes) {
|
|
91
|
+
lines.push(` ${c}`);
|
|
92
|
+
}
|
|
93
|
+
lines.push('');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
lines.push(`# Shared Memory Index (${entries.length} entries)\n`);
|
|
97
|
+
// Separate rules from knowledge
|
|
98
|
+
const rules = entries.filter(e => isRule(e));
|
|
99
|
+
const knowledge = entries.filter(e => !isRule(e));
|
|
100
|
+
// Rules section
|
|
101
|
+
if (rules.length > 0) {
|
|
102
|
+
lines.push(`## ⚡ Rules (${rules.length}) — must follow`);
|
|
103
|
+
lines.push('| Topic | Agent | Date | Status |');
|
|
104
|
+
lines.push('|-------|-------|------|--------|');
|
|
105
|
+
for (const e of rules) {
|
|
106
|
+
const badge = getEffectiveStatus(e) === 'protected' ? '🔒' : '';
|
|
107
|
+
const summary = e.summary ?? e.content.slice(0, 50).replace(/\n/g, ' ');
|
|
108
|
+
lines.push(`| ${e.topic} | ${e.agent} | ${e.date.slice(0, 10)} | ${badge} |`);
|
|
109
|
+
}
|
|
110
|
+
lines.push('');
|
|
111
|
+
}
|
|
112
|
+
// Knowledge grouped by category
|
|
113
|
+
const grouped = groupByCategory(knowledge);
|
|
114
|
+
for (const cat of CATEGORY_ORDER) {
|
|
115
|
+
const group = grouped.get(cat);
|
|
116
|
+
if (!group || group.length === 0)
|
|
117
|
+
continue;
|
|
118
|
+
lines.push(`## ${CATEGORY_LABELS[cat]} (${group.length})`);
|
|
119
|
+
lines.push('| Topic | Agent | Date | Status |');
|
|
120
|
+
lines.push('|-------|-------|------|--------|');
|
|
121
|
+
for (const e of group) {
|
|
122
|
+
const status = getEffectiveStatus(e);
|
|
123
|
+
const badge = status === 'protected' ? '🔒' : status === 'proposal' ? '📋' : status === 'awaiting_votes' ? '🗳️' : '';
|
|
124
|
+
const priv = e.scope === 'private' ? ' 🔒Private' : '';
|
|
125
|
+
lines.push(`| ${e.topic} | ${e.agent} | ${e.date.slice(0, 10)} | ${badge}${priv} |`);
|
|
126
|
+
}
|
|
127
|
+
lines.push('');
|
|
128
|
+
}
|
|
129
|
+
// Usage hints
|
|
130
|
+
lines.push('---');
|
|
131
|
+
lines.push('To read full details: call read_memory with topics: ["Topic Name", ...]');
|
|
132
|
+
lines.push('To search: call search_memory with query and optional category filter');
|
|
133
|
+
lines.push('');
|
|
134
|
+
lines.push('💡 After completing your task, record important findings with write_memory.');
|
|
135
|
+
lines.push(' Focus on: API changes, decisions, gotchas, conventions.');
|
|
136
|
+
return lines.join('\n');
|
|
137
|
+
}
|
|
138
|
+
/** Format merged entries as full detail view (for topic drill-down). */
|
|
57
139
|
export function formatMergedMemories(entries, totalBeforeLimit) {
|
|
58
140
|
if (entries.length === 0) {
|
|
59
141
|
return 'No shared memories found.';
|
|
@@ -63,7 +145,8 @@ export function formatMergedMemories(entries, totalBeforeLimit) {
|
|
|
63
145
|
for (const entry of entries) {
|
|
64
146
|
const effectiveStatus = getEffectiveStatus(entry);
|
|
65
147
|
const badge = effectiveStatus === 'protected' ? ' 🔒' : effectiveStatus === 'proposal' ? ' 📋' : '';
|
|
66
|
-
|
|
148
|
+
const catLabel = entry.category ? ` [${entry.category}]` : '';
|
|
149
|
+
lines.push(`## ${entry.topic}${badge}${catLabel}`);
|
|
67
150
|
lines.push(`Agent: ${entry.agent} (${entry.agent_role})`);
|
|
68
151
|
lines.push(`Date: ${entry.date}`);
|
|
69
152
|
if (effectiveStatus !== 'auto') {
|
|
@@ -86,4 +169,42 @@ export function formatMergedMemories(entries, totalBeforeLimit) {
|
|
|
86
169
|
}
|
|
87
170
|
return lines.join('\n');
|
|
88
171
|
}
|
|
172
|
+
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
173
|
+
function groupByCategory(entries) {
|
|
174
|
+
const groups = new Map();
|
|
175
|
+
for (const entry of entries) {
|
|
176
|
+
const cat = entry.category ?? inferCategory(entry.tags, entry.topic);
|
|
177
|
+
if (!groups.has(cat))
|
|
178
|
+
groups.set(cat, []);
|
|
179
|
+
groups.get(cat).push(entry);
|
|
180
|
+
}
|
|
181
|
+
return groups;
|
|
182
|
+
}
|
|
183
|
+
function getRecentChanges(entries, myAgentId, lastActive) {
|
|
184
|
+
const lastTime = new Date(lastActive).getTime();
|
|
185
|
+
const changes = [];
|
|
186
|
+
const newEntries = entries.filter(e => e.agent !== myAgentId && new Date(e.date).getTime() > lastTime);
|
|
187
|
+
if (newEntries.length === 0)
|
|
188
|
+
return changes;
|
|
189
|
+
// Group by agent
|
|
190
|
+
const byAgent = new Map();
|
|
191
|
+
for (const e of newEntries) {
|
|
192
|
+
if (!byAgent.has(e.agent))
|
|
193
|
+
byAgent.set(e.agent, []);
|
|
194
|
+
byAgent.get(e.agent).push(e);
|
|
195
|
+
}
|
|
196
|
+
for (const [agent, agentEntries] of byAgent) {
|
|
197
|
+
const topics = agentEntries.map(e => e.topic).slice(0, 3);
|
|
198
|
+
changes.push(`+ ${agentEntries.length} new by ${agent}: ${topics.join(', ')}`);
|
|
199
|
+
}
|
|
200
|
+
// Pending proposals
|
|
201
|
+
const proposals = entries.filter(e => {
|
|
202
|
+
const s = getEffectiveStatus(e);
|
|
203
|
+
return (s === 'proposal' || s === 'awaiting_votes') && e.agent !== myAgentId;
|
|
204
|
+
});
|
|
205
|
+
if (proposals.length > 0) {
|
|
206
|
+
changes.push(`📋 ${proposals.length} proposal(s) waiting for input`);
|
|
207
|
+
}
|
|
208
|
+
return changes;
|
|
209
|
+
}
|
|
89
210
|
//# sourceMappingURL=merge-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-view.js","sourceRoot":"","sources":["../../src/memory/merge-view.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"merge-view.js","sourceRoot":"","sources":["../../src/memory/merge-view.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE7E,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAC3B,QAA2B,EAC3B,OAA2B;IAE3B,IAAI,OAAO,GAAwB,EAAE,CAAC;IAEtC,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC9B,IAAI,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK;YAAE,SAAS;QAE/D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnC,iBAAiB;YACjB,IAAI,OAAO,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7C,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC1E,IAAI,CAAC,cAAc;oBAAE,SAAS;YAChC,CAAC;YAED,yCAAyC;YACzC,IAAI,OAAO,EAAE,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACjD,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CACtC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,W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AAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,OAAO,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,MAAM,WAAW,KAAK,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,oBAAoB;IACpB,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QACnC,MAAM,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAChC,OAAO,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC;IAC/E,CAAC,CAAC,CAAC;IACH,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC,MAAM,gCAAgC,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/memory/schema.d.ts
CHANGED
|
@@ -8,27 +8,36 @@ export declare const memoryEntrySchema: z.ZodObject<{
|
|
|
8
8
|
content: z.ZodString;
|
|
9
9
|
date: z.ZodString;
|
|
10
10
|
decided_with: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
-
status: z.ZodOptional<z.ZodEnum<["auto", "proposal", "protected"]>>;
|
|
11
|
+
status: z.ZodOptional<z.ZodEnum<["auto", "proposal", "awaiting_votes", "accepted", "rejected", "protected"]>>;
|
|
12
12
|
protected: z.ZodOptional<z.ZodBoolean>;
|
|
13
13
|
owner: z.ZodOptional<z.ZodString>;
|
|
14
|
+
category: z.ZodOptional<z.ZodEnum<["decision", "api", "convention", "gotcha", "dependency", "project_fact", "user_pref"]>>;
|
|
15
|
+
scope: z.ZodOptional<z.ZodEnum<["shared", "private"]>>;
|
|
16
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
14
17
|
}, "strip", z.ZodTypeAny, {
|
|
15
18
|
topic: string;
|
|
16
19
|
tags: string[];
|
|
17
20
|
content: string;
|
|
18
21
|
date: string;
|
|
19
|
-
status?: "auto" | "proposal" | "protected" | undefined;
|
|
22
|
+
status?: "auto" | "proposal" | "awaiting_votes" | "accepted" | "rejected" | "protected" | undefined;
|
|
20
23
|
decided_with?: string[] | undefined;
|
|
21
24
|
protected?: boolean | undefined;
|
|
22
25
|
owner?: string | undefined;
|
|
26
|
+
category?: "decision" | "api" | "convention" | "gotcha" | "dependency" | "project_fact" | "user_pref" | undefined;
|
|
27
|
+
scope?: "shared" | "private" | undefined;
|
|
28
|
+
summary?: string | undefined;
|
|
23
29
|
}, {
|
|
24
30
|
topic: string;
|
|
25
31
|
content: string;
|
|
26
32
|
date: string;
|
|
27
|
-
status?: "auto" | "proposal" | "protected" | undefined;
|
|
33
|
+
status?: "auto" | "proposal" | "awaiting_votes" | "accepted" | "rejected" | "protected" | undefined;
|
|
28
34
|
tags?: string[] | undefined;
|
|
29
35
|
decided_with?: string[] | undefined;
|
|
30
36
|
protected?: boolean | undefined;
|
|
31
37
|
owner?: string | undefined;
|
|
38
|
+
category?: "decision" | "api" | "convention" | "gotcha" | "dependency" | "project_fact" | "user_pref" | undefined;
|
|
39
|
+
scope?: "shared" | "private" | undefined;
|
|
40
|
+
summary?: string | undefined;
|
|
32
41
|
}>;
|
|
33
42
|
export declare const agentMemoryFileSchema: z.ZodObject<{
|
|
34
43
|
agent: z.ZodString;
|
|
@@ -41,27 +50,36 @@ export declare const agentMemoryFileSchema: z.ZodObject<{
|
|
|
41
50
|
content: z.ZodString;
|
|
42
51
|
date: z.ZodString;
|
|
43
52
|
decided_with: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
44
|
-
status: z.ZodOptional<z.ZodEnum<["auto", "proposal", "protected"]>>;
|
|
53
|
+
status: z.ZodOptional<z.ZodEnum<["auto", "proposal", "awaiting_votes", "accepted", "rejected", "protected"]>>;
|
|
45
54
|
protected: z.ZodOptional<z.ZodBoolean>;
|
|
46
55
|
owner: z.ZodOptional<z.ZodString>;
|
|
56
|
+
category: z.ZodOptional<z.ZodEnum<["decision", "api", "convention", "gotcha", "dependency", "project_fact", "user_pref"]>>;
|
|
57
|
+
scope: z.ZodOptional<z.ZodEnum<["shared", "private"]>>;
|
|
58
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
47
59
|
}, "strip", z.ZodTypeAny, {
|
|
48
60
|
topic: string;
|
|
49
61
|
tags: string[];
|
|
50
62
|
content: string;
|
|
51
63
|
date: string;
|
|
52
|
-
status?: "auto" | "proposal" | "protected" | undefined;
|
|
64
|
+
status?: "auto" | "proposal" | "awaiting_votes" | "accepted" | "rejected" | "protected" | undefined;
|
|
53
65
|
decided_with?: string[] | undefined;
|
|
54
66
|
protected?: boolean | undefined;
|
|
55
67
|
owner?: string | undefined;
|
|
68
|
+
category?: "decision" | "api" | "convention" | "gotcha" | "dependency" | "project_fact" | "user_pref" | undefined;
|
|
69
|
+
scope?: "shared" | "private" | undefined;
|
|
70
|
+
summary?: string | undefined;
|
|
56
71
|
}, {
|
|
57
72
|
topic: string;
|
|
58
73
|
content: string;
|
|
59
74
|
date: string;
|
|
60
|
-
status?: "auto" | "proposal" | "protected" | undefined;
|
|
75
|
+
status?: "auto" | "proposal" | "awaiting_votes" | "accepted" | "rejected" | "protected" | undefined;
|
|
61
76
|
tags?: string[] | undefined;
|
|
62
77
|
decided_with?: string[] | undefined;
|
|
63
78
|
protected?: boolean | undefined;
|
|
64
79
|
owner?: string | undefined;
|
|
80
|
+
category?: "decision" | "api" | "convention" | "gotcha" | "dependency" | "project_fact" | "user_pref" | undefined;
|
|
81
|
+
scope?: "shared" | "private" | undefined;
|
|
82
|
+
summary?: string | undefined;
|
|
65
83
|
}>, "many">>;
|
|
66
84
|
}, "strip", z.ZodTypeAny, {
|
|
67
85
|
entries: {
|
|
@@ -69,10 +87,13 @@ export declare const agentMemoryFileSchema: z.ZodObject<{
|
|
|
69
87
|
tags: string[];
|
|
70
88
|
content: string;
|
|
71
89
|
date: string;
|
|
72
|
-
status?: "auto" | "proposal" | "protected" | undefined;
|
|
90
|
+
status?: "auto" | "proposal" | "awaiting_votes" | "accepted" | "rejected" | "protected" | undefined;
|
|
73
91
|
decided_with?: string[] | undefined;
|
|
74
92
|
protected?: boolean | undefined;
|
|
75
93
|
owner?: string | undefined;
|
|
94
|
+
category?: "decision" | "api" | "convention" | "gotcha" | "dependency" | "project_fact" | "user_pref" | undefined;
|
|
95
|
+
scope?: "shared" | "private" | undefined;
|
|
96
|
+
summary?: string | undefined;
|
|
76
97
|
}[];
|
|
77
98
|
agent: string;
|
|
78
99
|
role: string;
|
|
@@ -87,11 +108,14 @@ export declare const agentMemoryFileSchema: z.ZodObject<{
|
|
|
87
108
|
topic: string;
|
|
88
109
|
content: string;
|
|
89
110
|
date: string;
|
|
90
|
-
status?: "auto" | "proposal" | "protected" | undefined;
|
|
111
|
+
status?: "auto" | "proposal" | "awaiting_votes" | "accepted" | "rejected" | "protected" | undefined;
|
|
91
112
|
tags?: string[] | undefined;
|
|
92
113
|
decided_with?: string[] | undefined;
|
|
93
114
|
protected?: boolean | undefined;
|
|
94
115
|
owner?: string | undefined;
|
|
116
|
+
category?: "decision" | "api" | "convention" | "gotcha" | "dependency" | "project_fact" | "user_pref" | undefined;
|
|
117
|
+
scope?: "shared" | "private" | undefined;
|
|
118
|
+
summary?: string | undefined;
|
|
95
119
|
}[] | undefined;
|
|
96
120
|
}>;
|
|
97
121
|
export declare const agentInfoSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/memory/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/memory/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY5B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1B,CAAC"}
|
package/dist/memory/schema.js
CHANGED
|
@@ -8,9 +8,12 @@ export const memoryEntrySchema = z.object({
|
|
|
8
8
|
content: z.string().min(1),
|
|
9
9
|
date: z.string(),
|
|
10
10
|
decided_with: z.array(z.string()).optional(),
|
|
11
|
-
status: z.enum(['auto', 'proposal', 'protected']).optional(),
|
|
11
|
+
status: z.enum(['auto', 'proposal', 'awaiting_votes', 'accepted', 'rejected', 'protected']).optional(),
|
|
12
12
|
protected: z.boolean().optional(), // backward compat
|
|
13
13
|
owner: z.string().optional(),
|
|
14
|
+
category: z.enum(['decision', 'api', 'convention', 'gotcha', 'dependency', 'project_fact', 'user_pref']).optional(),
|
|
15
|
+
scope: z.enum(['shared', 'private']).optional(),
|
|
16
|
+
summary: z.string().optional(),
|
|
14
17
|
});
|
|
15
18
|
export const agentMemoryFileSchema = z.object({
|
|
16
19
|
agent: z.string().min(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/memory/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/memory/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,Q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AM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC7C,CAAC,CAAC"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Memory searcher - search across all agent memories by keyword
|
|
2
|
+
* Memory searcher - search across all agent memories by keyword.
|
|
3
|
+
*
|
|
4
|
+
* Enhanced with: word boundary matching, category filtering, multi-term bonus,
|
|
5
|
+
* protected boost, and configurable result limits.
|
|
3
6
|
*/
|
|
4
|
-
import type { AgentMemoryFile, MergedMemoryEntry } from './types.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
import type { AgentMemoryFile, MemoryCategory, MergedMemoryEntry } from './types.js';
|
|
8
|
+
export interface SearchOptions {
|
|
9
|
+
query: string;
|
|
10
|
+
category?: MemoryCategory;
|
|
11
|
+
limit?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Search all memories for entries matching the query. */
|
|
14
|
+
export declare function searchMemories(memories: AgentMemoryFile[], query: string, options?: {
|
|
15
|
+
category?: MemoryCategory;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}): MergedMemoryEntry[];
|
|
7
18
|
//# sourceMappingURL=searcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searcher.d.ts","sourceRoot":"","sources":["../../src/memory/searcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"searcher.d.ts","sourceRoot":"","sources":["../../src/memory/searcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGrF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,eAAe,EAAE,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACtD,iBAAiB,EAAE,CAiCrB"}
|
package/dist/memory/searcher.js
CHANGED
|
@@ -1,48 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { getEffectiveStatus, inferCategory } from './write-utils.js';
|
|
2
|
+
/** Search all memories for entries matching the query. */
|
|
3
|
+
export function searchMemories(memories, query, options) {
|
|
3
4
|
const terms = query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
5
|
+
if (terms.length === 0)
|
|
6
|
+
return [];
|
|
7
|
+
const limit = options?.limit ?? 10;
|
|
4
8
|
const results = [];
|
|
5
9
|
for (const memory of memories) {
|
|
6
10
|
for (const entry of memory.entries) {
|
|
7
|
-
|
|
11
|
+
// Skip private entries from other agents
|
|
12
|
+
if (entry.scope === 'private')
|
|
13
|
+
continue;
|
|
14
|
+
// Category filter
|
|
15
|
+
if (options?.category) {
|
|
16
|
+
const entryCat = entry.category ?? inferCategory(entry.tags, entry.topic);
|
|
17
|
+
if (entryCat !== options.category)
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const merged = {
|
|
21
|
+
...entry,
|
|
22
|
+
agent: memory.agent,
|
|
23
|
+
agent_role: memory.role,
|
|
24
|
+
};
|
|
25
|
+
const score = calculateRelevance(merged, terms);
|
|
8
26
|
if (score > 0) {
|
|
9
|
-
results.push({
|
|
10
|
-
entry: {
|
|
11
|
-
...entry,
|
|
12
|
-
agent: memory.agent,
|
|
13
|
-
agent_role: memory.role,
|
|
14
|
-
},
|
|
15
|
-
score,
|
|
16
|
-
});
|
|
27
|
+
results.push({ entry: merged, score });
|
|
17
28
|
}
|
|
18
29
|
}
|
|
19
30
|
}
|
|
20
|
-
// Sort by relevance score, highest first
|
|
21
31
|
results.sort((a, b) => b.score - a.score);
|
|
22
|
-
return results.map(r => r.entry);
|
|
32
|
+
return results.slice(0, limit).map(r => r.entry);
|
|
33
|
+
}
|
|
34
|
+
/** Escape regex special characters. */
|
|
35
|
+
function escapeRegex(str) {
|
|
36
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
37
|
+
}
|
|
38
|
+
/** Count non-overlapping occurrences of a substring. */
|
|
39
|
+
function countOccurrences(text, term) {
|
|
40
|
+
let count = 0;
|
|
41
|
+
let pos = 0;
|
|
42
|
+
while ((pos = text.indexOf(term, pos)) !== -1) {
|
|
43
|
+
count++;
|
|
44
|
+
pos += term.length;
|
|
45
|
+
}
|
|
46
|
+
return count;
|
|
23
47
|
}
|
|
24
|
-
function calculateRelevance(entry,
|
|
48
|
+
function calculateRelevance(entry, terms) {
|
|
25
49
|
let score = 0;
|
|
26
50
|
const topicLower = entry.topic.toLowerCase();
|
|
27
51
|
const contentLower = entry.content.toLowerCase();
|
|
28
52
|
const tagsLower = entry.tags.map(t => t.toLowerCase());
|
|
29
|
-
const agentLower =
|
|
53
|
+
const agentLower = entry.agent.toLowerCase();
|
|
54
|
+
let matchedTermCount = 0;
|
|
30
55
|
for (const term of terms) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
let termMatched = false;
|
|
57
|
+
// Topic: word boundary match (+15) or substring (+8)
|
|
58
|
+
const wordBoundary = new RegExp(`\\b${escapeRegex(term)}\\b`, 'i');
|
|
59
|
+
if (wordBoundary.test(entry.topic)) {
|
|
60
|
+
score += 15;
|
|
61
|
+
termMatched = true;
|
|
62
|
+
}
|
|
63
|
+
else if (topicLower.includes(term)) {
|
|
36
64
|
score += 8;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
65
|
+
termMatched = true;
|
|
66
|
+
}
|
|
67
|
+
// Tag exact match (+10)
|
|
68
|
+
if (tagsLower.includes(term)) {
|
|
69
|
+
score += 10;
|
|
70
|
+
termMatched = true;
|
|
71
|
+
}
|
|
72
|
+
// Tag partial match (+4)
|
|
73
|
+
else if (tagsLower.some(t => t.includes(term))) {
|
|
45
74
|
score += 4;
|
|
75
|
+
termMatched = true;
|
|
76
|
+
}
|
|
77
|
+
// Content: count occurrences, cap at 10
|
|
78
|
+
const contentHits = countOccurrences(contentLower, term);
|
|
79
|
+
if (contentHits > 0) {
|
|
80
|
+
score += Math.min(contentHits * 2, 10);
|
|
81
|
+
termMatched = true;
|
|
82
|
+
}
|
|
83
|
+
// Agent name match (+3)
|
|
84
|
+
if (agentLower.includes(term)) {
|
|
85
|
+
score += 3;
|
|
86
|
+
termMatched = true;
|
|
87
|
+
}
|
|
88
|
+
if (termMatched)
|
|
89
|
+
matchedTermCount++;
|
|
90
|
+
}
|
|
91
|
+
// Multi-term bonus: all terms present → +10
|
|
92
|
+
if (terms.length > 1 && matchedTermCount === terms.length) {
|
|
93
|
+
score += 10;
|
|
94
|
+
}
|
|
95
|
+
// Protected entries boost (+5) — settled knowledge is more reliable
|
|
96
|
+
if (getEffectiveStatus(entry) === 'protected') {
|
|
97
|
+
score += 5;
|
|
46
98
|
}
|
|
47
99
|
return score;
|
|
48
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searcher.js","sourceRoot":"","sources":["../../src/memory/searcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"searcher.js","sourceRoot":"","sources":["../../src/memory/searcher.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQrE,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAC5B,QAA2B,EAC3B,KAAa,EACb,OAAuD;IAEvD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;IACnC,MAAM,OAAO,GAAuD,EAAE,CAAC;IAEvE,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnC,yCAAyC;YACzC,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;gBAAE,SAAS;YAExC,kBAAkB;YAClB,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;gBACtB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC1E,IAAI,QAAQ,KAAK,OAAO,CAAC,QAAQ;oBAAE,SAAS;YAC9C,CAAC;YAED,MAAM,MAAM,GAAsB;gBAChC,GAAG,KAAK;gBACR,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,UAAU,EAAE,MAAM,CAAC,IAAI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AAC;YACvC,WAAW,GAAG,IAAI,CAAC;QACrB,CAAC;QAED,wBAAwB;QACxB,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,KAAK,IAAI,CAAC,CAAC;YACX,WAAW,GAAG,IAAI,CAAC;QACrB,CAAC;QAED,IAAI,WAAW;YAAE,gBAAgB,EAAE,CAAC;IACtC,CAAC;IAED,4CAA4C;IAC5C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,gBAAgB,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QAC1D,KAAK,IAAI,EAAE,CAAC;IACd,CAAC;IAED,oEAAoE;IACpE,IAAI,kBAAkB,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE,CAAC;QAC9C,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/memory/types.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core data types for AgentHub shared memory.
|
|
3
3
|
*/
|
|
4
|
-
/** Memory entry status levels */
|
|
5
|
-
export type MemoryStatus = 'auto' | 'proposal' | 'protected';
|
|
4
|
+
/** Memory entry status levels (extended lifecycle) */
|
|
5
|
+
export type MemoryStatus = 'auto' | 'proposal' | 'awaiting_votes' | 'accepted' | 'rejected' | 'protected';
|
|
6
|
+
/** Memory category — closed taxonomy for structured organization */
|
|
7
|
+
export type MemoryCategory = 'decision' | 'api' | 'convention' | 'gotcha' | 'dependency' | 'project_fact' | 'user_pref';
|
|
8
|
+
/** Memory scope — who can see this entry */
|
|
9
|
+
export type MemoryScope = 'shared' | 'private';
|
|
6
10
|
/** A single knowledge entry recorded by an agent */
|
|
7
11
|
export interface MemoryEntry {
|
|
8
12
|
topic: string;
|
|
@@ -13,6 +17,9 @@ export interface MemoryEntry {
|
|
|
13
17
|
status?: MemoryStatus;
|
|
14
18
|
protected?: boolean;
|
|
15
19
|
owner?: string;
|
|
20
|
+
category?: MemoryCategory;
|
|
21
|
+
scope?: MemoryScope;
|
|
22
|
+
summary?: string;
|
|
16
23
|
}
|
|
17
24
|
/** An agent's complete memory file */
|
|
18
25
|
export interface AgentMemoryFile {
|
|
@@ -46,6 +53,7 @@ export interface MergedMemoryEntry extends MemoryEntry {
|
|
|
46
53
|
export interface ReadMemoryOptions {
|
|
47
54
|
tags?: string[];
|
|
48
55
|
agent?: string;
|
|
56
|
+
topics?: string[];
|
|
49
57
|
limit?: number;
|
|
50
58
|
}
|
|
51
59
|
/** Options for writing memory */
|
|
@@ -57,6 +65,9 @@ export interface WriteMemoryOptions {
|
|
|
57
65
|
status?: MemoryStatus;
|
|
58
66
|
protected?: boolean;
|
|
59
67
|
owner?: string;
|
|
68
|
+
category?: MemoryCategory;
|
|
69
|
+
scope?: MemoryScope;
|
|
70
|
+
summary?: string;
|
|
60
71
|
}
|
|
61
72
|
/** Result of a write operation */
|
|
62
73
|
export interface WriteResult {
|
|
@@ -68,5 +79,15 @@ export interface WriteResult {
|
|
|
68
79
|
/** Options for searching memory */
|
|
69
80
|
export interface SearchMemoryOptions {
|
|
70
81
|
query: string;
|
|
82
|
+
category?: MemoryCategory;
|
|
83
|
+
limit?: number;
|
|
84
|
+
}
|
|
85
|
+
/** Memory event — for audit trail (protocol definition, implementation later) */
|
|
86
|
+
export interface MemoryEvent {
|
|
87
|
+
type: 'created' | 'updated' | 'status_changed';
|
|
88
|
+
agent: string;
|
|
89
|
+
topic: string;
|
|
90
|
+
timestamp: string;
|
|
91
|
+
detail?: string;
|
|
71
92
|
}
|
|
72
93
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/memory/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/memory/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH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AC/C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentMemoryFile, MemoryEntry, MemoryStatus, WriteMemoryOptions, WriteResult } from './types.js';
|
|
1
|
+
import type { AgentMemoryFile, MemoryEntry, MemoryCategory, MemoryStatus, WriteMemoryOptions, WriteResult } from './types.js';
|
|
2
2
|
/** Resolve the effective status of a memory entry (handles backward compat). */
|
|
3
3
|
export declare function getEffectiveStatus(entry: {
|
|
4
4
|
status?: MemoryStatus;
|
|
@@ -20,6 +20,10 @@ export declare function validateContent(content: string): {
|
|
|
20
20
|
blocked?: WriteResult;
|
|
21
21
|
warnings: string[];
|
|
22
22
|
};
|
|
23
|
+
/** Infer category from tags and topic when not explicitly provided. */
|
|
24
|
+
export declare function inferCategory(tags: string[], topic: string): MemoryCategory;
|
|
25
|
+
/** Check if an entry represents a rule (convention or protected decision). */
|
|
26
|
+
export declare function isRule(entry: MemoryEntry): boolean;
|
|
23
27
|
/** Build a new MemoryEntry from write options. */
|
|
24
28
|
export declare function buildMemoryEntry(options: WriteMemoryOptions, now: string): MemoryEntry;
|
|
25
29
|
/**
|