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.

v1.0.0 MIT 14 libs ES modules TypeScript
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) });
optiontypedefaultnotes
basestringhttps://sjgant80-hub.github.ioBase URL for module imports
onlyLibraryName[]all 14Load only these libraries
onError(name,err)=>voidconsole.warnHandler 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.js

Fold 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');
exportsignature
SPINE, PHI, KAPPA, OMEGA, BASELINEconstants
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, attenuationProfilesignal propagation math
kawasakiSum, kawasakiFlat, maekawaValidorigami validity checks

foldshim

foldkit/foldshim.js

Shape 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' });
exportsignature
adopt(input, opts?) => { S, from, ok, notes? }
RECIPESspine7 | ringOf7 | fromObject | fromString | fromArray | fromKappa
detectShape(input) => string
normalize(S:number[]) => number[]

fallid

fallid/fallid.js

Sovereign 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);
exportsignature
getOrCreate, create(opts?) => Promise<FallIdentity>
load, listAll, removeidentity persistence
sign(payload, identity?) => Promise<Signature>
verify(payload, sig, publicKey?) => Promise<boolean>
DID, pubFromDIDDID string encode/decode
exportIdentity, importIdentityportable JSON

fallstore

fallstore/fallstore.js

Content-addressed storage — hash-derived CIDs, IndexedDB backend.

const rec = await fallstore.store('hello', { mime: 'text/plain' });
const back = await fallstore.retrieveText(rec.cid);
exportsignature
store(data, opts?) => Promise<StoreRecord>
retrieve, retrieveText, retrieveJsonby CID
has, remove, verifyCID ops
list, statsenumerate
CID(data) => Promise<string>

fallcarrier

fallcarrier/fallcarrier.js

Transport router — picks the best available channel (WebRTC / BLE / relay / local).

const car = fallcarrier.createCarrier({ transports: ['webrtc','ble'] });
await car.send(peerDID, payload);
exportsignature
class FallCarrier.register .route .send .on .close
createCarrier(opts?) => FallCarrier
pickTransport(available, destination?) => TransportKind

fallpod

fallpod/fallpod.js

Solid-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');
exportsignature
class FallPod.put .get .del .list .grant .revoke
openPod(opts?) => Promise<FallPod>

fallsync

fallsync/fallsync.js

CRDT 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' });
exportsignature
create, apply, merge, diff, encode, decodepure CRDT ops
class SyncSession.push .pull .on

falldns

falldns/falldns.js

Sovereign name resolution. Name → DID, no ICANN root.

const rec = await falldns.resolve('simon.fall');
await falldns.register('me.fall', me.did);
exportsignature
resolve, reverse, register, release, list, verifyRecordrecord CRUD + lookup
ROOT_ZONEstring

falltrust

falltrust/falltrust.js

Web-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);
exportsignature
attest, revokeattestation CRUD
attestationsFor, attestationsBylookup
trustScore, findPath, neighborsgraph queries

fallcast

fallcast/fallcast.js

Federated 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' });
exportsignature
class FallCast.publish .Access .unsubscribe .topics .peers
createCast(opts?) => FallCast

fallmail

fallmail/fallmail.js

End-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');
exportsignature
class FallMail.send .inbox .outbox .read .markRead .delete .on
openMail(opts?) => Promise<FallMail>

fallbridge

fallbridge/fallbridge.js

BLE 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);
exportsignature
class FallBridge.scan .connect .disconnect .send .on
createBridge, isSupportedfactory + capability probe

fallhop

fallhop/fallhop.js

Bitchat ↔ Konomi translator — cross-mesh compatibility.

const hop = fallhop.createHop({ did: me.did });
hop.onBitchat(frame => console.log(fallhop.bitchatToKonomi(frame)));
exportsignature
bitchatToKonomi, konomiToBitchatpure 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.