Sign In

@sovseal/sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sovseal/sdk

TypeScript SDK for sovseal — client-side zero-knowledge state continuity and replication.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

@sovseal/sdk

The official TypeScript SDK for sovseal — build applications with client-side zero-knowledge state continuity and replication.

License TypeScript npm

Installation

npm install @sovseal/sdk

Quick Start

Initialize the AgentStateClient with your endpoint URL and credentials:

import { AgentStateClient, CryptoService } from "@sovseal/sdk";

// Initialize client
const client = new AgentStateClient({
  endpoint:
    "https://ksrlmubaxzwufziwarps.supabase.co/functions/v1/v2-agent-state",
  apiKey: "sov_live_abc123...", // or project token "sov_proj_..."
});

// Generate or import an encryption key
const key = await CryptoService.generateAESKey();

// Snapshot agent state (client-side encrypted before replication)
const receipt = await client.snapshot({
  payload: {
    agent_id: "my-agent-id",
    policy_hash:
      "0000000000000000000000000000000000000000000000000000000000000000",
    active_context: {
      user_preference: "dark mode",
      recent_conversations: [{ role: "user", content: "hello" }],
    },
    parent_snapshot: null,
    sequence_number: 0,
    timestamp: new Date().toISOString(),
  },
  key,
});

// Later, restore the latest state checkpoint
const { receipt: latestReceipt, ciphertextUrl } = await client.restore({
  agentId: "my-agent-id",
});

Encryption

The SDK includes client-side cryptographic primitives via Web Crypto API:

import { CryptoService, encryptJson, decryptJson } from "@sovseal/sdk";

// Generate AES-256-GCM key
const key = await CryptoService.generateAESKey();

// Encrypt payload JSON
const encryptedBytes = await encryptJson({ secret: "data" }, key);

// Decrypt back to JSON
const decrypted = await decryptJson(encryptedBytes, key);

API Reference

AgentStateClient

MethodDescription
snapshot(params)Encrypts active_context and publishes a new snapshot
restore(params)Fetches the latest confirmed checkpoint receipt and ciphertext URL
restoreAt(params)Fetches a checkpoint at a specific sequence number
lineage(params)Walks parental snapshot lineage to retrieve historical sequence headers

Crypto Primitives (re-exported)

  • CryptoService: AES-256-GCM key generation, raw export/import, and SHA-256 helpers.
  • encryptJson(value, key): JCS-canonicalizes and encrypts value using AES-256-GCM.
  • decryptJson(bytes, key): Decrypts and parses the JSON envelope.
  • canonicalize(value): RFC 8785 JSON Canonicalization Scheme implementation.

License

Apache-2.0 — See LICENSE for details.

Keywords

sovseal

FAQs

Package last updated on 02 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts