project.ts
grammar.ts
crystal.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { Rosetta } from '@soulsin/rosetta-sdk'
const rosetta = new Rosetta({
hemisphere: 'developer',
crystal: './data/memory.cryst',
})
// Decompose a sentence into structural atoms
const projection = await
rosetta.project("the cat sat on the mat")
// Each token carries celestial coordinates
for (const token of
projection.tokens) {
console.log(token.symbol, token.altitude, token.domain)
}
// cat → T2 BIOLOGY.FAUNA.DOMESTIC
// sat → T1 PHYSICS.STATE.REST
// mat → T1 MATERIAL.TEXTILE.FLAT
// Query the reaction between two elements
const bond = await rosetta.react("cat", "mat", { law: "geology" })
console.log(bond)
// → { type: "rest_upon", strength: 0.94, provenance: "T1.MATERIAL" }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Grammar, Modality } from '@soulsin/rosetta-sdk'
// Load a sensory grammar processor
const grammar = new Grammar(Modality.TEXT)
// Parse with full structural depth
const atoms = await grammar.parse("photosynthesis")
console.log(atoms.root.symbol)
// → "◈ PHOTO"
console.log(atoms.depth) // → 4
console.log(atoms.domain) // →
BIOLOGY.PROCESS.ENERGY
// Navigate neighbours in celestial space
const neighbours = await
grammar.navigate(atoms.coord, 0.15)
// → [chlorophyll, respiration, ATP, sunlight, …]
export default grammar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Crystal } from '@soulsin/rosetta-sdk'
// Open encrypted memory crystal
const crystal = await Crystal.open('./data/memory.cryst')
// Store knowledge by celestial coordinate
await crystal.store({
coord: 'T2.BIOLOGY.FAUNA.DOMESTIC',
value: { label: 'cat',
encounters: 14 }
})
// Query by proximity — returns all nodes within radius 0.2
const results = await
crystal.query({ coord: 'T2.BIOLOGY', radius: 0.2 })
// Export full crystal as signed provenance bundle
const bundle = await crystal.export({ sign: true })