feat(departments): register department tools in the memory entry

This commit is contained in:
newbie 2026-11-24 21:00:46 +08:00
parent 736adb4903
commit 8161fae848
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import { brainKernel } from "../kernel.js";
import { createMemoryTools } from "../memory/tools.js";
import { createDepartmentTools } from "../memory/departments-tools.js";
import { conversationIdOf, redactSecrets, textOf, turnOf } from "../reporter.js";
export const name = 'dsh-brain-memory';
/** Services required before `apply` runs. */
@ -17,6 +18,9 @@ export function apply(ctx, config) {
for (const tool of createMemoryTools(kernel.toolDeps())) {
toolsCtx.effect(() => tools.register(tool), `dsh-brain-memory: tool ${tool.name}`);
}
for (const tool of createDepartmentTools(kernel.departmentToolDeps())) {
toolsCtx.effect(() => tools.register(tool), `dsh-brain-memory: tool ${tool.name}`);
}
});
// Project the compact USER.md/MEMORY.md state into the system prompt each turn.
// The files are generated from explicit profile/rule records only.

View File

@ -11,6 +11,7 @@
import type { CloudMemoryContext, SessionEventLike, SessionLike } from '../context-types.ts'
import { brainKernel } from '../kernel.ts'
import { createMemoryTools } from '../memory/tools.ts'
import { createDepartmentTools } from '../memory/departments-tools.ts'
import { conversationIdOf, redactSecrets, textOf, turnOf } from '../reporter.ts'
export const name = 'dsh-brain-memory'
@ -31,6 +32,9 @@ export function apply(ctx: CloudMemoryContext, config: unknown): void {
for (const tool of createMemoryTools(kernel.toolDeps())) {
toolsCtx.effect(() => tools.register(tool), `dsh-brain-memory: tool ${tool.name}`)
}
for (const tool of createDepartmentTools(kernel.departmentToolDeps())) {
toolsCtx.effect(() => tools.register(tool), `dsh-brain-memory: tool ${tool.name}`)
}
})
// Project the compact USER.md/MEMORY.md state into the system prompt each turn.