Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

@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-cli

Construct

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_typeshapeencryptionroutes to
messages{ message_draft: string }ratchet-pairDM.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.public

Writes 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