@enc-protocol/super-cli — SuperSdk
A super-app composing three enclaves — DM, Group, and Personal — into one SDK: direct messages, a public moments feed, and cross-enclave profiles.
Extends AppSdk. Enclaves: DM,
Group, Personal. Encrypted
data_type: messages (ratchet-pair).
Install
npm config set @enc-protocol:registry https://npm-registry.ocrybit.workers.dev/
npm install @enc-protocol/super-cliConstruct
import { SuperSdk } from '@enc-protocol/super-cli'
const sdk = new SuperSdk({ mode: 'cf', nodeUrl: process.env.NODE_URL, identity })
await sdk.init()Options are the standard AppSdk constructor.
Data types
| data_type | shape | encryption | routes to |
|---|---|---|---|
messages | { message_draft: string } | ratchet-pair | DM.message |
moments | { moment_draft: string } | — | Personal.public |
Methods
submitMessages(args)
await sdk.submitMessages({ message_draft: 'hi' }) // → DM.message (encrypted)Encrypts with ratchet-pair and routes to the DM enclave.
submitMoments(args)
await sdk.submitMoments({ moment_draft: 'wow' }) // → Personal.publicWrites a public moment to the Personal enclave's public feed.
queryMessages()
Read decrypted DM messages. Row fields: body, outgoing.
queryMoments()
Read the public moments feed. Row fields: body, from, trailing, likes, replies.
queryProfiles()
Cross-enclave dataview read of Personal.Shared(profile) — the latest profile per identity.
Multi-enclave routing
submit<DataType> resolves through the app's tableMap to the owning enclave —
messages → DM.message, moments → Personal.public — so one SDK drives all three enclaves
transparently. See how a method routes.
Example
import { SuperSdk } from '@enc-protocol/super-cli'
const sdk = new SuperSdk({ mode: 'cf', nodeUrl: process.env.NODE_URL, identity })
await sdk.init()
await sdk.submitMessages({ message_draft: 'hi' }) // → DM.message (encrypted)
await sdk.submitMoments({ moment_draft: 'wow' }) // → Personal.public
const feed = await sdk.queryMoments()
const thread = await sdk.queryMessages()
const profiles = await sdk.queryProfiles()See also
- Enclave profiles: DM, Group, Personal
- Confidentiality plugin: ratchet-pair
- App SDK pattern ·
cli-sdk-base