@anteriorai/srg-types
v0.5.1
Published
TypeScript types for SRG (Symbolic Reasoning Graph) schema
Readme
@anteriorai/srg-types
TypeScript type definitions for the SRG (Symbolic Reasoning Graph) schema.
Public preview. This package is an early public release of Anterior's symbolic reasoning tooling. It is being published to support transparency, research discussion, and early experimentation while the broader open-source repository is prepared for release.
Future releases may be made available under updated licensing terms. Until then, use of this package is governed by the license included with this release.
This release should not be treated as a supported product, a stable API, or a complete reference implementation. It is provided "as is," without warranties of any kind. Users are responsible for evaluating correctness, security, compliance, and suitability for their own use case.
Installation
npm install @anteriorai/srg-typesUsage
import type { SRG, Predicate, Aggregator, Outcome } from '@anteriorai/srg-types';
// Use the types in your code
function processSRG(srg: SRG) {
console.log('Predicates:', Object.keys(srg.predicates).length);
console.log('Aggregators:', Object.keys(srg.aggregators).length);
console.log('Outcomes:', Object.keys(srg.outcomes).length);
}
// Create an SRG instance
const mySRG: SRG = {
predicates: {
is_adult: {
type: 'Predicate',
id: 'is_adult',
question: 'Is the person 18 or older?',
context: null,
},
},
aggregators: {},
outcomes: {
approved: {
type: 'Outcome',
id: 'approved',
description: 'Application approved',
},
},
nodes: {
Root: { id: 'Root', item_id: 'Root' },
SN_1: { id: 'SN_1', item_id: 'is_adult' },
SN_2: { id: 'SN_2', item_id: 'approved' },
},
edges: {
'E_Root->SN_1': { source: 'Root', target: 'SN_1', condition: true },
'E_SN_1->SN_2': { source: 'SN_1', target: 'SN_2', condition: true },
},
policy_context: null,
};Type Exports
This package exports all types defined in the SRG JSON Schema, including:
SRG- The main SRG structurePredicate- A predicate (question) definitionAggregator- An aggregator (boolean logic) definitionOutcome- An outcome definitionNode- A graph nodeEdge- A graph edgeStrategy- Aggregation strategies (AllStrategy, AtLeastStrategy, etc.)
Schema Version
These types are generated from schemas/srg-schema-v1.json.
Development
These types are automatically generated from the JSON Schema using json-schema-to-typescript.
