feat(intent): Add additional "thought" intent type

This commit is contained in:
2026-07-19 08:09:06 +05:30
parent 1ed1edf4cf
commit 0512be647c
12 changed files with 66 additions and 28 deletions

View File

@@ -112,7 +112,11 @@ Guidelines:
}
// --- Cognitive Buffer ---
const memorySection = this.buildMemorySection(entity, recentEntries, now);
const memorySection = this.buildCognitiveBufferSection(
entity,
recentEntries,
now,
);
if (memorySection) {
sections.push(memorySection);
}
@@ -131,7 +135,7 @@ Guidelines:
return sections.join("\n\n");
}
private buildMemorySection(
private buildCognitiveBufferSection(
entity: Entity,
entries: BufferEntry[],
now: Date,
@@ -147,9 +151,16 @@ Guidelines:
let currentGroup: string | null = null;
for (const entry of recent) {
const serialized = serializeSubjectiveBufferEntry(entry, entity);
let serialized = serializeSubjectiveBufferEntry(entry, entity);
const when = naturalizeTime(now, new Date(entry.timestamp));
if (
entry.intent.actorId === entity.id &&
entry.intent.type === "dialogue"
) {
serialized = `You said: ${serialized}`;
}
if (when !== currentGroup) {
currentGroup = when;
const header = when.charAt(0).toUpperCase() + when.slice(1);

View File

@@ -78,7 +78,7 @@ describe("ActorPromptBuilder with Memory Ledger Integration", () => {
// Check Cognitive Buffer exists
expect(userContext).toContain("=== COGNITIVE BUFFER ===");
expect(userContext).toContain("Alice greets Bob");
expect(userContext).toContain("You said: Alice greets Bob");
// Check Memory Ledger exists
expect(userContext).toContain("=== MEMORY LEDGER ===");