diff --git a/README.md b/README.md index 5462afbd..b65ca118 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,67 @@ console.log(`Available noun types:`, Object.values(NounType)); This approach allows you to use just the type definitions without pulling in the entire library, which is useful for applications that only need to work with the data model. +### Importing Augmentation Types Separately + +If you need to use the augmentation interfaces in a client application without importing the entire library, you can import them directly: + +```typescript +// Import the BrainyAugmentations namespace and related types +import { BrainyAugmentations, AugmentationType, AugmentationResponse } from '@soulcraft/brainy/types/augmentations'; + +// Example usage of augmentation interfaces +class MyCustomCognitionAugmentation implements BrainyAugmentations.ICognitionAugmentation { + readonly name = 'my-custom-reasoner'; + readonly description = 'A custom reasoning augmentation'; + + async initialize(): Promise { + console.log('Initializing custom cognition augmentation'); + } + + async shutDown(): Promise { + console.log('Shutting down custom cognition augmentation'); + } + + async getStatus(): Promise<'active' | 'inactive' | 'error'> { + return 'active'; + } + + reason(query: string, context?: Record): AugmentationResponse<{ + inference: string; + confidence: number; + }> { + return { + success: true, + data: { + inference: `Reasoning about: ${query}`, + confidence: 0.85 + } + }; + } + + infer(dataSubset: Record): AugmentationResponse> { + return { + success: true, + data: { + inferredRelationship: 'example' + } + }; + } + + executeLogic(ruleId: string, input: Record): AugmentationResponse { + return { + success: true, + data: true + }; + } +} + +// Check the augmentation type +console.log(`Available augmentation types:`, Object.values(AugmentationType)); +``` + +This approach allows you to use the augmentation interfaces in client applications that need to implement or interact with Brainy's augmentation system. + ## Publishing and Using as a Private NPM Package Soulcraft Brainy is configured as a private NPM package with restricted access. This section provides information on how to publish and use it within your organization. diff --git a/package.json b/package.json index 4a09357b..51cd7baa 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,10 @@ "./types/graphTypes": { "import": "./dist/types/graphTypes.js", "types": "./dist/types/graphTypes.d.ts" + }, + "./types/augmentations": { + "import": "./dist/types/augmentations.js", + "types": "./dist/types/augmentations.d.ts" } }, "engines": {