@soulcraft/brainy 0.30.0 → 0.31.0
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/README.md +39 -0
- package/dist/index.d.ts +2 -1
- package/dist/unified.js +40 -1
- package/dist/unified.min.js +747 -747
- package/dist/utils/typeUtils.d.ts +30 -0
- package/dist/utils/typeUtils.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -399,6 +399,45 @@ Connections between nouns (edges in the graph):
|
|
|
399
399
|
- Verbs have types that define the relationship (RelatedTo, Controls, Contains, etc.)
|
|
400
400
|
- Verbs can have their own metadata to describe the relationship
|
|
401
401
|
|
|
402
|
+
### Type Utilities
|
|
403
|
+
|
|
404
|
+
Brainy provides utility functions to access lists of noun and verb types:
|
|
405
|
+
|
|
406
|
+
```typescript
|
|
407
|
+
import {
|
|
408
|
+
NounType,
|
|
409
|
+
VerbType,
|
|
410
|
+
getNounTypes,
|
|
411
|
+
getVerbTypes,
|
|
412
|
+
getNounTypeMap,
|
|
413
|
+
getVerbTypeMap
|
|
414
|
+
} from '@soulcraft/brainy'
|
|
415
|
+
|
|
416
|
+
// At development time:
|
|
417
|
+
// Access specific types directly from the NounType and VerbType objects
|
|
418
|
+
console.log(NounType.Person) // 'person'
|
|
419
|
+
console.log(VerbType.Contains) // 'contains'
|
|
420
|
+
|
|
421
|
+
// At runtime:
|
|
422
|
+
// Get a list of all noun types
|
|
423
|
+
const nounTypes = getNounTypes() // ['person', 'organization', 'location', ...]
|
|
424
|
+
|
|
425
|
+
// Get a list of all verb types
|
|
426
|
+
const verbTypes = getVerbTypes() // ['relatedTo', 'contains', 'partOf', ...]
|
|
427
|
+
|
|
428
|
+
// Get a map of noun type keys to values
|
|
429
|
+
const nounTypeMap = getNounTypeMap() // { Person: 'person', Organization: 'organization', ... }
|
|
430
|
+
|
|
431
|
+
// Get a map of verb type keys to values
|
|
432
|
+
const verbTypeMap = getVerbTypeMap() // { RelatedTo: 'relatedTo', Contains: 'contains', ... }
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
These utility functions make it easy to:
|
|
436
|
+
- Get a complete list of available noun and verb types
|
|
437
|
+
- Validate user input against valid types
|
|
438
|
+
- Create dynamic UI components that display or select from available types
|
|
439
|
+
- Map between type keys and their string values
|
|
440
|
+
|
|
402
441
|
## Command Line Interface
|
|
403
442
|
|
|
404
443
|
Brainy includes a powerful CLI for managing your data. The CLI is available as a separate package
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,8 @@ export type { IWebSocketCognitionAugmentation, IWebSocketSenseAugmentation, IWeb
|
|
|
42
42
|
import type { GraphNoun, GraphVerb, EmbeddedGraphVerb, Person, Location, Thing, Event, Concept, Content, Collection, Organization, Document, Media, File, Message, Dataset, Product, Service, User, Task, Project, Process, State, Role, Topic, Language, Currency, Measurement } from './types/graphTypes.js';
|
|
43
43
|
import { NounType, VerbType } from './types/graphTypes.js';
|
|
44
44
|
export type { GraphNoun, GraphVerb, EmbeddedGraphVerb, Person, Location, Thing, Event, Concept, Content, Collection, Organization, Document, Media, File, Message, Dataset, Product, Service, User, Task, Project, Process, State, Role, Topic, Language, Currency, Measurement };
|
|
45
|
-
|
|
45
|
+
import { getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap } from './utils/typeUtils.js';
|
|
46
|
+
export { NounType, VerbType, getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap };
|
|
46
47
|
import { BrainyMCPAdapter, MCPAugmentationToolset, BrainyMCPService } from './mcp/index.js';
|
|
47
48
|
import { MCPRequest, MCPResponse, MCPDataAccessRequest, MCPToolExecutionRequest, MCPSystemInfoRequest, MCPAuthenticationRequest, MCPRequestType, MCPServiceOptions, MCPTool, MCP_VERSION } from './types/mcpTypes.js';
|
|
48
49
|
export { BrainyMCPAdapter, MCPAugmentationToolset, BrainyMCPService, MCPRequestType, MCP_VERSION };
|
package/dist/unified.js
CHANGED
|
@@ -17499,6 +17499,45 @@ async function createMemoryAugmentation(name, options = {}) {
|
|
|
17499
17499
|
}
|
|
17500
17500
|
}
|
|
17501
17501
|
|
|
17502
|
+
/**
|
|
17503
|
+
* Type Utilities
|
|
17504
|
+
*
|
|
17505
|
+
* This module provides utility functions for working with the Brainy type system,
|
|
17506
|
+
* particularly for accessing lists of noun and verb types.
|
|
17507
|
+
*/
|
|
17508
|
+
/**
|
|
17509
|
+
* Returns an array of all available noun types
|
|
17510
|
+
*
|
|
17511
|
+
* @returns {string[]} Array of all noun type values
|
|
17512
|
+
*/
|
|
17513
|
+
function getNounTypes() {
|
|
17514
|
+
return Object.values(NounType);
|
|
17515
|
+
}
|
|
17516
|
+
/**
|
|
17517
|
+
* Returns an array of all available verb types
|
|
17518
|
+
*
|
|
17519
|
+
* @returns {string[]} Array of all verb type values
|
|
17520
|
+
*/
|
|
17521
|
+
function getVerbTypes() {
|
|
17522
|
+
return Object.values(VerbType);
|
|
17523
|
+
}
|
|
17524
|
+
/**
|
|
17525
|
+
* Returns a map of noun type keys to their string values
|
|
17526
|
+
*
|
|
17527
|
+
* @returns {Record<string, string>} Map of noun type keys to values
|
|
17528
|
+
*/
|
|
17529
|
+
function getNounTypeMap() {
|
|
17530
|
+
return { ...NounType };
|
|
17531
|
+
}
|
|
17532
|
+
/**
|
|
17533
|
+
* Returns a map of verb type keys to their string values
|
|
17534
|
+
*
|
|
17535
|
+
* @returns {Record<string, string>} Map of verb type keys to values
|
|
17536
|
+
*/
|
|
17537
|
+
function getVerbTypeMap() {
|
|
17538
|
+
return { ...VerbType };
|
|
17539
|
+
}
|
|
17540
|
+
|
|
17502
17541
|
/**
|
|
17503
17542
|
* Model Control Protocol (MCP) Types
|
|
17504
17543
|
*
|
|
@@ -91446,5 +91485,5 @@ var universalSentenceEncoder_esm = /*#__PURE__*/Object.freeze({
|
|
|
91446
91485
|
version: version
|
|
91447
91486
|
});
|
|
91448
91487
|
|
|
91449
|
-
export { AugmentationType, BrainyData, BrainyMCPAdapter, BrainyMCPService, ExecutionMode, FileSystemStorage, FileSystemStorageAugmentation, HNSWIndex, HNSWIndexOptimized, MCPAugmentationToolset, MCPRequestType, MCP_VERSION, MemoryStorage, MemoryStorageAugmentation, NounType, OPFSStorage, OPFSStorageAugmentation, Pipeline, S3CompatibleStorage as R2Storage, S3CompatibleStorage, SequentialPipeline, ServerSearchActivationAugmentation, ServerSearchConduitAugmentation, StreamlinedExecutionMode, UniversalSentenceEncoder$1 as UniversalSentenceEncoder, VerbType, WebRTCConduitAugmentation, WebSocketConduitAugmentation, addWebSocketSupport, applyTensorFlowPatch, areWebWorkersAvailable, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync, augmentationPipeline, availableAugmentations, cleanupWorkerPools, cosineDistance$1 as cosineDistance, createAugmentationRegistryPlugin, createAugmentationRegistryRollupPlugin, createConduitAugmentation, createEmbeddingFunction, createMemoryAugmentation, createPipeline, createSenseAugmentation, createServerSearchAugmentations, createStorage, createStreamingPipeline, createTensorFlowEmbeddingFunction, createThreadedEmbeddingFunction, defaultEmbeddingFunction, dotProductDistance, environment, euclideanDistance, executeAugmentation, executeByType, executeInThread, executeSingle, executeStreamlined, getAugmentationsByType, getStatistics, initializeAugmentationPipeline, isBrowser$1 as isBrowser, isNode, isThreadingAvailable, isThreadingAvailableAsync, isWebWorker, loadAugmentationModule, loadAugmentationsFromModules, manhattanDistance, pipeline, processStaticData, processStreamingData, registerAugmentation, sequentialPipeline, setAugmentationEnabled };
|
|
91488
|
+
export { AugmentationType, BrainyData, BrainyMCPAdapter, BrainyMCPService, ExecutionMode, FileSystemStorage, FileSystemStorageAugmentation, HNSWIndex, HNSWIndexOptimized, MCPAugmentationToolset, MCPRequestType, MCP_VERSION, MemoryStorage, MemoryStorageAugmentation, NounType, OPFSStorage, OPFSStorageAugmentation, Pipeline, S3CompatibleStorage as R2Storage, S3CompatibleStorage, SequentialPipeline, ServerSearchActivationAugmentation, ServerSearchConduitAugmentation, StreamlinedExecutionMode, UniversalSentenceEncoder$1 as UniversalSentenceEncoder, VerbType, WebRTCConduitAugmentation, WebSocketConduitAugmentation, addWebSocketSupport, applyTensorFlowPatch, areWebWorkersAvailable, areWorkerThreadsAvailable, areWorkerThreadsAvailableSync, augmentationPipeline, availableAugmentations, cleanupWorkerPools, cosineDistance$1 as cosineDistance, createAugmentationRegistryPlugin, createAugmentationRegistryRollupPlugin, createConduitAugmentation, createEmbeddingFunction, createMemoryAugmentation, createPipeline, createSenseAugmentation, createServerSearchAugmentations, createStorage, createStreamingPipeline, createTensorFlowEmbeddingFunction, createThreadedEmbeddingFunction, defaultEmbeddingFunction, dotProductDistance, environment, euclideanDistance, executeAugmentation, executeByType, executeInThread, executeSingle, executeStreamlined, getAugmentationsByType, getNounTypeMap, getNounTypes, getStatistics, getVerbTypeMap, getVerbTypes, initializeAugmentationPipeline, isBrowser$1 as isBrowser, isNode, isThreadingAvailable, isThreadingAvailableAsync, isWebWorker, loadAugmentationModule, loadAugmentationsFromModules, manhattanDistance, pipeline, processStaticData, processStreamingData, registerAugmentation, sequentialPipeline, setAugmentationEnabled };
|
|
91450
91489
|
//# sourceMappingURL=unified.js.map
|