claude-brain 0.9.2 → 0.9.3
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/VERSION +1 -1
- package/package.json +1 -1
- package/src/config/defaults.ts +1 -1
- package/src/config/schema.ts +1 -1
- package/src/memory/index.ts +6 -3
- package/src/routing/router.ts +8 -6
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.9.
|
|
1
|
+
0.9.3
|
package/package.json
CHANGED
package/src/config/defaults.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PartialConfig } from './schema'
|
|
|
3
3
|
/** Default configuration values for Claude Brain */
|
|
4
4
|
export const defaultConfig: PartialConfig = {
|
|
5
5
|
serverName: 'claude-brain',
|
|
6
|
-
serverVersion: '0.9.
|
|
6
|
+
serverVersion: '0.9.3',
|
|
7
7
|
logLevel: 'info',
|
|
8
8
|
logFilePath: './logs/claude-brain.log',
|
|
9
9
|
dbPath: './data/memory.db',
|
package/src/config/schema.ts
CHANGED
|
@@ -270,7 +270,7 @@ export const ConfigSchema = z.object({
|
|
|
270
270
|
serverName: z.string().default('claude-brain'),
|
|
271
271
|
|
|
272
272
|
/** Server version in semver format */
|
|
273
|
-
serverVersion: z.string().regex(/^\d+\.\d+\.\d+$/, 'Version must be semver format').default('0.9.
|
|
273
|
+
serverVersion: z.string().regex(/^\d+\.\d+\.\d+$/, 'Version must be semver format').default('0.9.3'),
|
|
274
274
|
|
|
275
275
|
/** Logging level */
|
|
276
276
|
logLevel: LogLevelSchema.default('info'),
|
package/src/memory/index.ts
CHANGED
|
@@ -389,7 +389,8 @@ export class MemoryManager {
|
|
|
389
389
|
async fetchAllDecisions(project?: string): Promise<any[]> {
|
|
390
390
|
if (this.useChromaDB) {
|
|
391
391
|
try {
|
|
392
|
-
const
|
|
392
|
+
const collection = await this.chroma.collections.getDecisions()
|
|
393
|
+
const results = await collection.get({
|
|
393
394
|
where: project ? { project } : undefined
|
|
394
395
|
})
|
|
395
396
|
if (results && results.ids) {
|
|
@@ -419,7 +420,8 @@ export class MemoryManager {
|
|
|
419
420
|
async fetchAllPatterns(project?: string): Promise<any[]> {
|
|
420
421
|
if (this.useChromaDB) {
|
|
421
422
|
try {
|
|
422
|
-
const
|
|
423
|
+
const collection = await this.chroma.collections.getPatterns()
|
|
424
|
+
const results = await collection.get({
|
|
423
425
|
where: project ? { project } : undefined
|
|
424
426
|
})
|
|
425
427
|
if (results && results.ids) {
|
|
@@ -449,7 +451,8 @@ export class MemoryManager {
|
|
|
449
451
|
async fetchAllCorrections(project?: string): Promise<any[]> {
|
|
450
452
|
if (this.useChromaDB) {
|
|
451
453
|
try {
|
|
452
|
-
const
|
|
454
|
+
const collection = await this.chroma.collections.getCorrections()
|
|
455
|
+
const results = await collection.get({
|
|
453
456
|
where: project ? { project } : undefined
|
|
454
457
|
})
|
|
455
458
|
if (results && results.ids) {
|
package/src/routing/router.ts
CHANGED
|
@@ -592,8 +592,9 @@ export class BrainRouter {
|
|
|
592
592
|
minSimilarity: 0.3
|
|
593
593
|
})
|
|
594
594
|
|
|
595
|
-
|
|
596
|
-
|
|
595
|
+
const matchId = results[0]?.memory?.id || results[0]?.decision?.id
|
|
596
|
+
if (results.length > 0 && matchId) {
|
|
597
|
+
const oldId = matchId
|
|
597
598
|
const newId = await memory.updateDecision(
|
|
598
599
|
oldId,
|
|
599
600
|
effectiveProject,
|
|
@@ -606,7 +607,7 @@ export class BrainRouter {
|
|
|
606
607
|
this.lastStoredId = newId
|
|
607
608
|
this.lastStoredProject = effectiveProject
|
|
608
609
|
|
|
609
|
-
const oldContent = results[0].decision?.decision || results[0].content?.slice(0, 100) || ''
|
|
610
|
+
const oldContent = results[0].decision?.decision || results[0].memory?.content?.slice(0, 100) || ''
|
|
610
611
|
return {
|
|
611
612
|
action: 'stored',
|
|
612
613
|
summary: `Updated decision`,
|
|
@@ -692,9 +693,10 @@ export class BrainRouter {
|
|
|
692
693
|
minSimilarity: 0.3
|
|
693
694
|
})
|
|
694
695
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
const
|
|
696
|
+
const matchId = results[0]?.memory?.id || results[0]?.decision?.id
|
|
697
|
+
if (results.length > 0 && matchId) {
|
|
698
|
+
const targetId = matchId
|
|
699
|
+
const content = results[0].decision?.decision || results[0].memory?.content?.slice(0, 100) || ''
|
|
698
700
|
|
|
699
701
|
await memory.deleteDecision(targetId)
|
|
700
702
|
if (this.lastStoredId === targetId) this.lastStoredId = null
|