feat: modernize API architecture and deprecation handling
- Modernize BrainyInterface to only contain current API methods (add, relate, find, get) - Update all interface consumers to use modern API patterns - Make Brainy class implement clean modernized interface - Update CLI commands to use add() and relate() instead of deprecated methods - Update all source code components to use modern API consistently - Update examples and integration tests to modern patterns - Improve architectural consistency across the entire codebase BREAKING: BrainyInterface no longer contains deprecated methods Migration: Use add() instead of addNoun(), relate() instead of addVerb()
This commit is contained in:
parent
2128ef5607
commit
1b32870e43
11 changed files with 89 additions and 84 deletions
|
|
@ -204,18 +204,18 @@ export class WebSocketConduitAugmentation extends BaseConduitAugmentation {
|
|||
try {
|
||||
switch (operation) {
|
||||
case 'addNoun':
|
||||
await this.context?.brain.addNoun(params.content, params.metadata)
|
||||
await this.context?.brain.add({ data: params.content, type: 'content', metadata: params.metadata })
|
||||
break
|
||||
case 'deleteNoun':
|
||||
await this.context?.brain.deleteNoun(params.id)
|
||||
break
|
||||
case 'addVerb':
|
||||
await this.context?.brain.addVerb(
|
||||
params.source,
|
||||
params.target,
|
||||
params.verb,
|
||||
params.metadata
|
||||
)
|
||||
await this.context?.brain.relate({
|
||||
from: params.source,
|
||||
to: params.target,
|
||||
type: params.verb,
|
||||
metadata: params.metadata
|
||||
})
|
||||
break
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
@ -269,6 +269,6 @@ export class WebSocketConduitAugmentation extends BaseConduitAugmentation {
|
|||
* await conduit.establishConnection('ws://localhost:3000/ws')
|
||||
*
|
||||
* // Now operations sync automatically!
|
||||
* await clientBrain.addNoun('synced data', { source: 'client' })
|
||||
* await clientBrain.add({ data: 'synced data', type: 'content', metadata: { source: 'client' } })
|
||||
* // This will automatically sync to the server
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue