@enc-protocol/super-sdk
v0.9.0
Published
ENC Protocol per-app SDK for the "super" app — multi-enclave composition (DM + Group + Personal).
Readme
@enc-protocol/super-sdk
Per-app SDK for the super app on ENC Protocol. Enclaves: DM, Group, Personal.
Auto-generated by
lib/codegen/readme-codegen.mjsfromapps/super/{app,schema}.json. Do not hand-edit — regenerate viaenc gen readme super.
Install
Recommended — via the enc CLI
# Install the global enc CLI once (any project)
npm install -g @enc-protocol/cli
# Install the skill into the current project (.claude/commands/super.md)
enc skill add superThe skill is the recommended consumption surface for Claude Code — adds an /enc super slash command. The skill package is published as @enc-protocol/skill-super.
Programmatic — for direct SDK use
npm install @enc-protocol/super-sdkQuick example
import { SuperSdk } from '@enc-protocol/super-sdk'
const sdk = new SuperSdk({ mode: 'cf', nodeUrl: process.env.NODE_URL })
await sdk.init()
await sdk.submitMessages({"message_draft":"example"})
const events = await sdk.queryProfiles()API reference
new SuperSdk(opts)
Constructor. Accepts:
| Option | Type | Description |
|--------|------|-------------|
| mode | 'mem' \| 'cf' | Backend: in-process mem or HTTP cf |
| identity | Identity | Required for cf mode (signing keypair) |
| nodeUrl | string | cf-mode node URL (or set NODE_URL env) |
| repoRoot | string | Path to repo root for finding apps/<id>/ and enclaves/<Name>.json (defaults to package location) |
| encHome | string | Optional state directory (defaults to ~/.enc) |
async init()
Initialize the SDK: load app definition, register all 3 enclaves (DM, Group, Personal), wire dataview, mint cf enclaves if needed.
Write methods
| Method | Data type | Resolves to | Encrypted | Ops | Operators |
|--------|-----------|-------------|-----------|-----|-----------|
| submitMessages(args) | messages | DM.message | ✓ | CDU | FRIEND | OWNER | Sender |
| submitMoments(args) | moments | Personal.public | | CDU | OWNER | dataview |
Read methods
| Method | Read | Source | Fields |
|--------|------|--------|--------|
| queryProfiles() | profiles | dataview (cross_enclave) | all |
| queryMessages() | messages | DM.message | body, outgoing |
| queryMoments() | moments | Personal.public | body, from, trailing, likes, replies |
Encryption
Data types messages are flagged encrypt in the app schema. The SDK calls this._encrypt(dataType, args) before submit. The default _encrypt is a pass-through.
To add real encryption (e.g. MLS for DM), subclass and override:
class EncryptedSuperSdk extends SuperSdk {
async _encrypt(dataType, args) {
// produce ciphertext for `args`
return { ciphertext: /* ... */ }
}
}Composition
- Enclaves:
DM,Group,Personal - tableMap:
messages→message,moments→public,invites→invite - encrypt:
messages - derived views:
conversations,requests,group_members,group_info_items
See also
cli.json— full app metadata + fuzz contractskill/SKILL.md— Claude Code skill bundle (install viaenc skill install super)@enc-protocol/app-sdk-base— base class (AppSdk,AppClient,DataView)
