feat(brain): seed markdown files in memory directories
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
e5bd8ccc7e
commit
5675d4cda6
3 changed files with 8 additions and 6 deletions
|
|
@ -237,7 +237,7 @@ func brainSeedMemoryFiles(scanPath string) []string {
|
|||
walk(next)
|
||||
continue
|
||||
}
|
||||
if core.PathBase(next) == "MEMORY.md" {
|
||||
if brainSeedMemoryFile(next) {
|
||||
add(next)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ func TestBrainSeedMemory_CmdBrainSeedMemory_Good(t *testing.T) {
|
|||
require.True(t, result.OK)
|
||||
output, ok := result.Value.(BrainSeedMemoryOutput)
|
||||
require.True(t, ok)
|
||||
assert.Equal(t, 1, output.Files)
|
||||
assert.Equal(t, 2, output.Imported)
|
||||
assert.Equal(t, 2, output.Files)
|
||||
assert.Equal(t, 3, output.Imported)
|
||||
assert.Equal(t, 0, output.Skipped)
|
||||
assert.Equal(t, false, output.DryRun)
|
||||
assert.Equal(t, projectsDir, output.Path)
|
||||
require.Len(t, bodies, 2)
|
||||
require.Len(t, bodies, 3)
|
||||
|
||||
assert.Equal(t, float64(42), bodies[0]["workspace_id"])
|
||||
assert.Equal(t, "virgil", bodies[0]["agent_id"])
|
||||
|
|
@ -66,6 +66,8 @@ func TestBrainSeedMemory_CmdBrainSeedMemory_Good(t *testing.T) {
|
|||
|
||||
assert.Equal(t, "decision", bodies[1]["type"])
|
||||
assert.Equal(t, []any{"memory-import"}, bodies[1]["tags"])
|
||||
assert.Equal(t, "convention", bodies[2]["type"])
|
||||
assert.Equal(t, []any{"notes", "memory-import"}, bodies[2]["tags"])
|
||||
}
|
||||
|
||||
func TestBrainSeedMemory_CmdBrainSeedMemory_Good_GlobPath(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ func (s *PrepSubsystem) registerCommands(ctx context.Context) {
|
|||
c.Command("brain:recall", core.Command{Description: "Recall memories from OpenBrain", Action: s.cmdBrainRecall})
|
||||
c.Command("brain/remember", core.Command{Description: "Store a memory in OpenBrain", Action: s.cmdBrainRemember})
|
||||
c.Command("brain:remember", core.Command{Description: "Store a memory in OpenBrain", Action: s.cmdBrainRemember})
|
||||
c.Command("brain/seed-memory", core.Command{Description: "Import markdown memories into OpenBrain from a project memory directory", Action: s.cmdBrainSeedMemory})
|
||||
c.Command("brain:seed-memory", core.Command{Description: "Import markdown memories into OpenBrain from a project memory directory", Action: s.cmdBrainSeedMemory})
|
||||
c.Command("brain/seed-memory", core.Command{Description: "Import markdown memories into OpenBrain from a project memory file or directory", Action: s.cmdBrainSeedMemory})
|
||||
c.Command("brain:seed-memory", core.Command{Description: "Import markdown memories into OpenBrain from a project memory file or directory", Action: s.cmdBrainSeedMemory})
|
||||
c.Command("brain/list", core.Command{Description: "List memories in OpenBrain", Action: s.cmdBrainList})
|
||||
c.Command("brain:list", core.Command{Description: "List memories in OpenBrain", Action: s.cmdBrainList})
|
||||
c.Command("brain/forget", core.Command{Description: "Forget a memory in OpenBrain", Action: s.cmdBrainForget})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue