FallSDK
One import for the whole AI-Native Solutions estate. Sovereign identity, WebRTC channels, content-addressed storage, CRDT sync, off-grid mesh — every library, typed, tree-shakeable, MIT.
npm install @ai-native-solutions/fallsdk
import { load } from 'https://sjgant80-hub.github.io/fallsdk/src/index.js'
Install anywhere
node / bundler
npm install @ai-native-solutions/fallsdk
# or
pnpm add @ai-native-solutions/fallsdk
browser · esm cdn
<script type="module">
import { load } from 'https://sjgant80-hub.github.io/fallsdk/src/index.js';
const estate = await load();
console.log(estate.foldkit.KAPPA);
</script>
deno · bun
import { load } from 'npm:@ai-native-solutions/fallsdk';
Quick start
Three-line sovereign identity + peer channel:
import { load } from '@ai-native-solutions/fallsdk';
const estate = await load();
const me = await estate.fallid.getOrCreate({ label: 'my node' });
const link = new estate.falllink.FallLink({ did: me.did });
link.on('message', ({ from, data }) => console.log(from, data));
await link.broadcast({ hello: 'estate' });
estate.load()
Fetches every library in parallel and returns a single object. Skip the ones you don't need with only.
import { load } from '@ai-native-solutions/fallsdk';
// full estate
const all = await load();
// subset
const mini = await load({ only: ['fallid', 'foldkit'] });
// mirror base (e.g. self-hosted)
const local = await load({ base: 'https://mirror.example.org' });
// custom error handling
const est = await load({ onError: (name, err) => log(name, err) });
| option | type | default | notes |
|---|---|---|---|
| base | string | https://sjgant80-hub.github.io | Base URL for module imports |
| only | LibraryName[] | all 14 | Load only these libraries |
| onError | (name,err)=>void | console.warn | Handler for per-library load failures |
healthCheck()
HEAD every library and report status. Useful for a status page or CI probe.
import { healthCheck } from '@ai-native-solutions/fallsdk';
const report = await healthCheck();
// [{ name:'foldkit', url:'…', ok:true, status:200 }, …]
◊ sovereign
No servers required. Every library runs on the user's device.
◊ tree-shakeable
Import one library or all fourteen. Bundle only what you use.
◊ typed
Full .d.ts coverage for every public API.
◊ mit
Do whatever. Attribution appreciated, not required.
The libraries
foldkit
foldkit/foldkit.jsFold arithmetic, SPINE, KAPPA/OMEGA constants, six OPS, Konomi band classifier.
import { foldkit } from '@ai-native-solutions/fallsdk';
const band = foldkit.classifyKappaBand('the signal survives the fall');
const probe = foldkit.probeFromKappa(band.min, 'hello');
| export | signature |
|---|---|
| SPINE, PHI, KAPPA, OMEGA, BASELINE | constants |
| foldNumber | (S:number[]) => number |
| stateSum, stateSignature | (S:number[]) => number|string |
| depthBand, isOrphanZone | (kappa:number) => KappaBand|boolean |
| OPS.{fire,water,void,thunder,echo,flower} | operators over state arrays |
| classifyKappaBand | (text:string) => KappaBand |
| probeFromKappa | (kappa:number, text?:string) => { band, op, probe } |
| signalSurvival, unclogGain, attenuationProfile | signal propagation math |
| kawasakiSum, kawasakiFlat, maekawaValid | origami validity checks |
foldshim
foldkit/foldshim.jsShape adapters — feed legacy state shapes into foldkit without hand-rolling conversion.
import { foldshim } from '@ai-native-solutions/fallsdk';
const { S } = foldshim.adopt(rawObject, { recipe: 'spine7' });
| export | signature |
|---|---|
| adopt | (input, opts?) => { S, from, ok, notes? } |
| RECIPES | spine7 | ringOf7 | fromObject | fromString | fromArray | fromKappa |
| detectShape | (input) => string |
| normalize | (S:number[]) => number[] |
fallid
fallid/fallid.jsSovereign identity — Ed25519 keypair in IndexedDB, DID strings, sign & verify.
import { fallid } from '@ai-native-solutions/fallsdk';
const me = await fallid.getOrCreate({ label: 'my node' });
const sig = await fallid.sign('hello', me);
const ok = await fallid.verify('hello', sig, me.publicKey);
| export | signature |
|---|---|
| getOrCreate, create | (opts?) => Promise<FallIdentity> |
| load, listAll, remove | identity persistence |
| sign | (payload, identity?) => Promise<Signature> |
| verify | (payload, sig, publicKey?) => Promise<boolean> |
| DID, pubFromDID | DID string encode/decode |
| exportIdentity, importIdentity | portable JSON |
falllink
falllink/falllink.jsWebRTC peer channel with optional signaling. Broadcast, direct, event-driven.
const link = new falllink.FallLink({ did: me.did });
link.on('message', ({ from, data }) => console.log(from, data));
await link.broadcast({ hi: 'peers' });
| export | signature |
|---|---|
| class FallLink | new FallLink(opts?) |
| .connect, .send, .broadcast, .disconnect, .close | channel ops |
| .on, .off, .once | events: open close message peer error signal |
| createLink | factory helper |
fallstore
fallstore/fallstore.jsContent-addressed storage — hash-derived CIDs, IndexedDB backend.
const rec = await fallstore.store('hello', { mime: 'text/plain' });
const back = await fallstore.retrieveText(rec.cid);
| export | signature |
|---|---|
| store | (data, opts?) => Promise<StoreRecord> |
| retrieve, retrieveText, retrieveJson | by CID |
| has, remove, verify | CID ops |
| list, stats | enumerate |
| CID | (data) => Promise<string> |
fallcarrier
fallcarrier/fallcarrier.jsTransport router — picks the best available channel (WebRTC / BLE / relay / local).
const car = fallcarrier.createCarrier({ transports: ['webrtc','ble'] });
await car.send(peerDID, payload);
| export | signature |
|---|---|
| class FallCarrier | .register .route .send .on .close |
| createCarrier | (opts?) => FallCarrier |
| pickTransport | (available, destination?) => TransportKind |
fallpod
fallpod/fallpod.jsSolid-style personal data pod. User-owned records, grant/revoke access by DID.
const pod = await fallpod.openPod();
await pod.put('/notes/first', { text: 'hi' });
await pod.grant('/notes/first', friendDID, 'read');
| export | signature |
|---|---|
| class FallPod | .put .get .del .list .grant .revoke |
| openPod | (opts?) => Promise<FallPod> |
fallsync
fallsync/fallsync.jsCRDT sync — LWW, GCounter, ORSet, RGA, Automerge-flavour. Merge concurrent edits.
const doc = fallsync.create('doc-1', 'lww', { title: '' });
const changed = fallsync.apply(doc, { path:['title'], value:'hello' });
| export | signature |
|---|---|
| create, apply, merge, diff, encode, decode | pure CRDT ops |
| class SyncSession | .push .pull .on |
falldns
falldns/falldns.jsSovereign name resolution. Name → DID, no ICANN root.
const rec = await falldns.resolve('simon.fall');
await falldns.register('me.fall', me.did);
| export | signature |
|---|---|
| resolve, reverse, register, release, list, verifyRecord | record CRUD + lookup |
| ROOT_ZONE | string |
falltrust
falltrust/falltrust.jsWeb-of-trust — DID attestations, scored graph queries.
await falltrust.attest(me.did, friend.did, 'vouch', { weight: 0.8 });
const score = await falltrust.trustScore(me.did, stranger.did);
| export | signature |
|---|---|
| attest, revoke | attestation CRUD |
| attestationsFor, attestationsBy | lookup |
| trustScore, findPath, neighbors | graph queries |
fallcast
fallcast/fallcast.jsFederated broadcast — pub/sub over the mesh, signed by DID.
const cast = fallcast.createCast({ did: me.did });
cast.Access('news', m => render(m));
await cast.publish('news', { headline: 'estate live' });
| export | signature |
|---|---|
| class FallCast | .publish .Access .unsubscribe .topics .peers |
| createCast | (opts?) => FallCast |
fallmail
fallmail/fallmail.jsEnd-to-end encrypted mail, addressed by DID. Offline queueable.
const mail = await fallmail.openMail({ did: me.did });
await mail.send(friend.did, 'hey', 'hello over sovereign mail');
| export | signature |
|---|---|
| class FallMail | .send .inbox .outbox .read .markRead .delete .on |
| openMail | (opts?) => Promise<FallMail> |
fallbridge
fallbridge/fallbridge.jsBLE dongle bridge — off-grid short-range mesh.
const br = fallbridge.createBridge();
const devs = await br.scan();
await br.connect(devs[0].id);
await br.send(payload);
| export | signature |
|---|---|
| class FallBridge | .scan .connect .disconnect .send .on |
| createBridge, isSupported | factory + capability probe |
fallhop
fallhop/fallhop.jsBitchat ↔ Konomi translator — cross-mesh compatibility.
const hop = fallhop.createHop({ did: me.did });
hop.onBitchat(frame => console.log(fallhop.bitchatToKonomi(frame)));
| export | signature |
|---|---|
| bitchatToKonomi, konomiToBitchat | pure frame translators |
| class FallHop | .onBitchat .onKonomi .emitBitchat .emitKonomi .close |
| createHop | (opts?) => FallHop |
Example scripts
Small end-to-end demos in the examples/ folder.
hello-world.js
Create an identity + open a FallLink channel.
send-message.js
FallID + FallMail — signed E2E mail.
konomi-classifier.js
foldkit.classifyKappaBand on live text.
mesh-connect.js
Set up FallCarrier with WebRTC + BLE fallbacks.
store-and-cast.js
Store content, publish CID via FallCast.
trust-graph.js
Attest, query trustScore.
License & lineage
MIT. Fork, remix, mint. FallSDK is Gen-1 estate — Simon Gant's build, released for the guild and the wider commons. Each wrapped library is its own repo with its own MIT license under sjgant80-hub.
SDK version 1.0.0 · wraps 14 estate libraries · pure ES modules · no runtime deps.