trinity-runes-sdk
v1.0.0
Published
Trinity Runes - Semantic Analysis Framework with 11 Cognitive Lenses
Maintainers
Readme
Trinity Runes SDK
Semantic Analysis Framework with 11 Cognitive Lenses + 22 Guiding Beacons
Trinity Runes enhances AI responses by applying a structured analytical framework that ensures comprehensive, multi-perspective analysis.
Features
- 11 Runes (Cognitive Lenses): Rigor, Human, Muse, Forge, Clarity, Sync, Vital, Propensity, Converge, Identity, Authenticity
- 22+ Beacons (Guiding Questions): Assumptions, Causality, Trade-offs, Second-order effects, and more
- 3 Model Variants: Claude Opus (OP), GPT-5.2 (GPT), Gemini (PRO)
- Zero Configuration: Works out of the box with hosted proxy endpoints
- TypeScript Support: Full type definitions included
Installation
npm install trinity-runes-sdkQuick Start
import { TrinityRunes, chat } from 'trinity-runes-sdk'
// Simple one-liner (uses hosted proxy - no API keys needed!)
const response = await chat('How should I approach building a startup?')
console.log(response.content)
// Or with options
const response = await chat('What are the risks of this investment?', {
model: 'pro', // 'op' (Claude), 'gpt' (GPT-5.2), 'pro' (Gemini)
temperature: 0.8,
includeMetadata: true
})
console.log(response.metadata?.activeRunes) // ['rigor', 'propensity', 'converge']
console.log(response.metadata?.activeBeacons) // ['Trade-offs', 'Robustness', ...]Model Variants
| Model | Underlying AI | Best For |
|-------|--------------|----------|
| op | Claude Opus 4.5 | Complex reasoning, nuanced analysis |
| gpt | GPT-5.2 | General purpose, creative tasks |
| pro | Gemini 3 Pro | Long context, technical analysis |
The 11 Runes
| Rune | Purpose | |------|---------| | Rigor | Logical validity - first-principles, evidence, biases | | Human | Human elements - emotion, motivation, ethics, culture | | Muse | Creative divergence - novelty, metaphor, reframing | | Forge | Feasibility - viability, stability, execution | | Clarity | Communication - structure, audience, simplicity | | Sync | Systems thinking - feedback loops, emergent effects | | Vital | Growth - resilience, evolution, sustainability | | Propensity | Probabilistic forecasting - scenarios, risk | | Converge | Synthesis - trade-offs, priorities, action | | Identity | Core essence - values, mission, differentiation | | Authenticity | Truth - honesty, transparency, alignment |
Advanced Usage
Custom Instance
import { TrinityRunes } from 'trinity-runes-sdk'
// Using your own API keys
const trinity = new TrinityRunes({
useHostedProxy: false,
openRouterApiKey: 'sk-or-xxx',
geminiApiKey: 'AIzaSy...'
})
const response = await trinity.chat('Analyze this business model')Multi-turn Conversations
const response = await trinity.conversation([
{ role: 'user', content: 'I want to start a SaaS business' },
{ role: 'assistant', content: 'Great! What domain are you considering?' },
{ role: 'user', content: 'Developer tools for AI applications' }
], { model: 'op' })Analyze Without Calling AI
import { classifyRunes, selectBeacons, buildSystemPrompt } from 'trinity-runes-sdk'
const runes = classifyRunes('How do I scale my business?')
// ['rigor', 'vital', 'forge', 'converge']
const beacons = selectBeacons('How do I scale my business?')
// ['Scalability', 'Trade-offs', 'Constraints', ...]
const systemPrompt = buildSystemPrompt(runes, beacons)
// Full system prompt for use with any AIAPI Reference
TrinityRunes Class
new TrinityRunes(config?: TrinityConfig)
interface TrinityConfig {
useHostedProxy?: boolean // Default: true
openRouterApiKey?: string // Only if useHostedProxy: false
geminiApiKey?: string // Only if useHostedProxy: false
customProxyUrls?: { // Override proxy URLs
openRouter?: string
gemini?: string
}
}Methods
chat(message: string, options?: ChatOptions): Promise<ChatResponse>conversation(messages: ChatMessage[], options?: ChatOptions): Promise<ChatResponse>analyze(query: string): { runes: RuneKey[]; beacons: string[] }
Utility Functions
classifyRunes(query: string, maxRunes?: number): RuneKey[]selectBeacons(query: string, maxBeacons?: number): string[]buildSystemPrompt(runes: RuneKey[], beacons: string[]): stringgetAllRunes(): Record<RuneKey, Rune>getAllBeacons(): Record<string, string>
Hosted Proxy Endpoints
The SDK uses these Firebase Cloud Function endpoints by default:
- OpenRouter:
https://openrouterproxy-3gs6wmqw3q-uc.a.run.app - Gemini:
https://geminiproxy-3gs6wmqw3q-uc.a.run.app
These endpoints have API keys securely stored in GCP Secret Manager.
License
MIT
