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/personal-cli — PersonalSdk

The Personal identity-anchor app: public posts, owner-only encrypted private documents, a KV profile, and a notice inbox for cross-enclave addressed messages (e.g. group invitations).

Extends AppSdk. Enclaves: Personal, Group. Encrypted data_type: private (identity-aead).

Install

npm config set @enc-protocol:registry https://npm-registry.ocrybit.workers.dev/
npm install @enc-protocol/personal-cli

Construct

import { PersonalSdk } from '@enc-protocol/personal-cli'
 
const sdk = new PersonalSdk({ mode: 'cf', nodeUrl: process.env.NODE_URL, identity })
await sdk.init()

Options are the standard AppSdk constructor.

Data types

data_typeshapeencryptionroutes to
public{ draft: string }Personal.public
private{ draft: string }identity-aeadPersonal.private

Methods

submitPublic(args)

await sdk.submitPublic({ draft: 'gm' })   // → Personal.public

Writes a public post to the owner's Personal enclave.

submitPrivate(args)

await sdk.submitPrivate({ draft: 'note to self' })   // → Personal.private

Encrypts args with identity-aead (owner-only, derived from the identity key — no key exchange) before writing.

queryPublic() / queryPrivate()

Read the owner's public posts / private documents. Row fields: body, from, trailing.

queryProfiles()

Cross-enclave dataview read of Personal.Shared(profile) — the latest profile per identity.

queryNotices()

Cross-enclave dataview read of Group.notice — addressed notices (e.g. group invitations) delivered to this identity's inbox.

Example

import { PersonalSdk } from '@enc-protocol/personal-cli'
 
const sdk = new PersonalSdk({ mode: 'cf', nodeUrl: process.env.NODE_URL, identity })
await sdk.init()
 
await sdk.submitPublic({ draft: 'gm' })
await sdk.submitPrivate({ draft: 'remember the milk' })   // encrypted (identity-aead)
 
const posts = await sdk.queryPublic()     // public feed
const docs  = await sdk.queryPrivate()    // owner-only, decrypted
const me    = await sdk.queryProfiles()   // cross-enclave profile rows

See also