Skip to content

ThirdKeyAI/symbiont-sdk-js

Repository files navigation

Symbiont JavaScript/TypeScript SDK

npm version TypeScript License: MIT

A comprehensive, type-safe JavaScript/TypeScript SDK for building and managing AI agents on the Symbiont platform. Get started quickly with full TypeScript support, intelligent caching, and enterprise-grade security.

πŸš€ Quick Start

Prerequisites

The Symbiont SDK requires a running Symbiont runtime. Choose one of these options:

Option 1: Docker (Recommended)

# Start Symbiont runtime with Docker
docker run --rm -p 8080:8080 ghcr.io/thirdkeyai/symbi:latest mcp

Option 2: Build from Source

# Clone and build the runtime
git clone https://github.com/thirdkeyai/symbiont
cd symbiont
cargo build --release
cargo run -- mcp --port 8080

Installation

npm install @symbiont/core

Hello World

import { SymbiontClient } from '@symbiont/core';

const client = new SymbiontClient({
  apiKey: process.env.SYMBIONT_API_KEY,
  environment: 'production'
});

await client.connect();

// Create and execute your first agent
const agent = await client.agents.createAgent({
  name: 'textProcessor',
  description: 'Processes and analyzes text input',
  parameters: [{ name: 'text', type: { name: 'string' }, required: true }],
  returnType: { name: 'string' },
  capabilities: ['text_processing']
});

const result = await client.agents.executeAgent(
  agent.id,
  { text: 'Hello, Symbiont!' }
);

console.log('Result:', result.result);

✨ Core Features

  • πŸ€– AI Agent Management - Create, deploy, and execute intelligent agents
  • πŸ” Security-First - Built-in policy management and secrets handling
  • πŸ›‘οΈ Type Safety - Full TypeScript support with runtime validation
  • ⚑ High Performance - Intelligent caching and optimized networking
  • πŸ”„ Auto-Authentication - Seamless token management and refresh
  • πŸ“¦ Modular Design - Use only what you need
  • 🌍 Cross-Platform - Node.js, browser, and edge runtime support

πŸ“š Documentation

🎯 Getting Started

Complete installation guide, configuration options, and your first agent

πŸ“– User Guides

πŸ” API Reference

Complete API documentation with examples and type definitions

πŸ—οΈ Architecture

πŸ“¦ SDK Packages

Package Purpose Installation
@symbiont/core Main client and authentication npm install @symbiont/core
@symbiont/agent Agent lifecycle management npm install @symbiont/agent
@symbiont/policy Policy creation and validation npm install @symbiont/policy
@symbiont/secrets Secure secrets management npm install @symbiont/secrets
@symbiont/tool-review Security review workflow npm install @symbiont/tool-review
@symbiont/mcp MCP protocol integration npm install @symbiont/mcp

πŸ› οΈ Configuration

Environment Variables

# Required
SYMBIONT_API_KEY=your_api_key_here

# Optional
SYMBIONT_API_URL=https://api.symbiont.dev
SYMBIONT_ENVIRONMENT=production

Client Configuration

const client = new SymbiontClient({
  apiKey: process.env.SYMBIONT_API_KEY,
  environment: 'production',
  validationMode: 'strict',
  timeout: 30000,
  debug: false
});

🎯 Common Use Cases

Agent Creation and Execution

// Create a data analysis agent
const agent = await client.agents.createAgent({
  name: 'dataAnalyzer',
  description: 'Analyzes datasets and generates insights',
  parameters: [
    { name: 'dataset', type: { name: 'object' }, required: true },
    { name: 'analysisType', type: { name: 'string' }, required: false }
  ],
  capabilities: ['data_processing', 'visualization'],
  policies: [dataAccessPolicy]
});

const insights = await client.agents.executeAgent(agent.id, {
  dataset: myData,
  analysisType: 'trend_analysis'
});

Policy Management

import { PolicyBuilder } from '@symbiont/policy';

// Create access control policy
const policy = new PolicyBuilder('dataAccessPolicy')
  .allow('read', 'analyze')
    .where('user.department', 'equals', 'analytics')
    .where('data.classification', 'not-equals', 'restricted')
  .require('approval')
    .where('action', 'equals', 'export')
  .build();

Secrets Management

import { SecretManager } from '@symbiont/secrets';

const secrets = new SecretManager({
  providers: [
    { name: 'environment', priority: 100 },
    { name: 'vault', priority: 200, endpoint: 'https://vault.company.com' }
  ]
});

const apiKey = await secrets.getSecret('EXTERNAL_API_KEY');

πŸ†˜ Getting Help

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for development setup and guidelines.

git clone https://github.com/thirdkeyai/symbiont-sdk-js
cd symbiont-sdk-js
npm install
npm run build
npm test

πŸ“„ License

MIT License


Ready to build the future of AI? Get started now β†’