This page details the programmatic API for Node.js/TypeScript users, primarily focusing on the @juliaos/framework, @juliaos/bridges, and @juliaos/wallets packages.
(Note: Assumes hypothetical package names like @juliaos/framework. Replace with actual package names and refer to source code for definitive signatures and types.)
import { AgentManager } from '@juliaos/framework/agents'; // Path might vary
const agentManager = new AgentManager(juliaBridge);
// --- Methods ---
// Creates an agent via the backend.
// config: { name: string; type: string; config: Record<string, any>; capabilities?: string[]; networks?: string[]; ... }
async createAgent(config: AgentConfig): Promise<AgentInfo>;
// Lists agents known to the backend.
async listAgents(): Promise<AgentInfo[]>;
// Gets status details for a specific agent.
async getAgentStatus(agentId: string): Promise<AgentStatus>;
// Starts the agent's main loop on the backend.
async startAgent(agentId: string): Promise<void>;
// Stops the agent's main loop.
async stopAgent(agentId: string): Promise<void>;
// Deletes the agent from the backend.
async deleteAgent(agentId: string): Promise<void>;
(Types like AgentConfig, AgentInfo, AgentStatus would be defined within the package)
SwarmManager
import { SwarmManager } from '@juliaos/framework/swarms'; // Path might vary
const swarmManager = new SwarmManager(juliaBridge);
// --- Methods ---
// Creates a swarm.
// config: { name: string; algorithm: { type: string; params: any }; config: Record<string, any>; ... }
async createSwarm(config: SwarmConfig): Promise<SwarmInfo>;
// Lists swarms.
async listSwarms(): Promise<SwarmInfo[]>;
// Gets status for a specific swarm.
async getSwarmStatus(swarmId: string): Promise<SwarmStatus>;
// Starts the swarm's operation/optimization loop.
async startSwarm(swarmId: string): Promise<void>;
// Stops the swarm's loop.
async stopSwarm(swarmId: string): Promise<void>;
// Deletes the swarm.
async deleteSwarm(swarmId: string): Promise<void>;
// Adds a registered agent to a swarm.
async addAgentToSwarm(swarmId: string, agentId: string): Promise<void>;
// Removes an agent from a swarm.
async removeAgentFromSwarm(swarmId: string, agentId: string): Promise<void>;
(Types like SwarmConfig, SwarmInfo, SwarmStatus would be defined within the package)