@silvana-one/coordination
Version:
Silvana Coordination Client
193 lines (192 loc) • 5.27 kB
TypeScript
import { Transaction } from "@mysten/sui/transactions";
import { AppMethod } from "./app_instance.js";
type AgentChain = "ethereum:mainnet" | "ethereum:seplolia" | "ethereum:holesky" | "ethereum:hoodi" | "mina:mainnet" | "mina:devnet" | "zeko:testnet" | "zeko:alphanet" | "sui:mainnet" | "sui:testnet" | "sui:devnet" | "solana:mainnet" | "solana:testnet" | "solana:devnet" | "walrus:mainnet" | "walrus:testnet" | string;
export interface AgentMethod {
dockerImage: string;
dockerSha256?: string;
minMemoryGb: number;
minCpuCores: number;
requiresTee: boolean;
}
export interface Agent {
id: string;
name: string;
image?: string;
description?: string;
site?: string;
chains: AgentChain[];
methods: Record<string, AgentMethod>;
defaultMethod?: AgentMethod;
createdAt: number;
updatedAt: number;
version: number;
}
export interface Developer {
id: string;
name: string;
github: string;
image?: string;
description?: string;
site?: string;
owner: string;
agents: string[];
createdAt: number;
updatedAt: number;
version: number;
}
export interface DeveloperNames {
id: string;
developer_address: string;
names: string[];
version: number;
}
export interface SilvanaApp {
id: string;
name: string;
description?: string;
methods: Record<string, AppMethod>;
owner: string;
createdAt: number;
updatedAt: number;
version: number;
instances: string[];
}
export declare class AgentRegistry {
private readonly registry;
constructor(params: {
registry: string;
});
static createAgentRegistry(params: {
name: string;
transaction?: Transaction;
}): Transaction;
createDeveloper(params: {
name: string;
developerOwner: string;
github: string;
image?: string;
description?: string;
site?: string;
transaction?: Transaction;
}): Transaction;
updateDeveloper(params: {
name: string;
github: string;
image?: string;
description?: string;
site?: string;
transaction?: Transaction;
}): Transaction;
removeDeveloper(params: {
name: string;
agentNames: string[];
transaction?: Transaction;
}): Transaction;
createAgent(params: {
developer: string;
name: string;
image?: string;
description?: string;
site?: string;
chains: AgentChain[];
transaction?: Transaction;
}): Transaction;
updateAgent(params: {
developer: string;
name: string;
image?: string;
description?: string;
site?: string;
chains: AgentChain[];
transaction?: Transaction;
}): Transaction;
removeAgent(params: {
developer: string;
agent: string;
transaction?: Transaction;
}): Transaction;
addAgentMethod(params: {
developer: string;
agent: string;
method: string;
dockerImage: string;
dockerSha256?: string;
minMemoryGb: number;
minCpuCores: number;
requiresTee: boolean;
transaction?: Transaction;
}): Transaction;
updateAgentMethod(params: {
developer: string;
agent: string;
method: string;
dockerImage: string;
dockerSha256?: string;
minMemoryGb: number;
minCpuCores: number;
requiresTee: boolean;
transaction?: Transaction;
}): Transaction;
removeAgentMethod(params: {
developer: string;
agent: string;
method: string;
transaction?: Transaction;
}): Transaction;
addMethodToApp(params: {
appName: string;
methodName: string;
description?: string;
developerName: string;
agentName: string;
agentMethod: string;
transaction?: Transaction;
}): Transaction;
addMetadata(params: {
appInstanceId: string;
key: string;
value: string;
transaction?: Transaction;
}): Transaction;
setDefaultMethod(params: {
developer: string;
agent: string;
method: string;
transaction?: Transaction;
}): Transaction;
removeDefaultMethod(params: {
developer: string;
agent: string;
transaction?: Transaction;
}): Transaction;
getDeveloper(params: {
name: string;
}): Promise<Developer | undefined>;
getDeveloperNames(params: {
developerAddress: string;
}): Promise<DeveloperNames | undefined>;
getAgent(params: {
developer: string;
agent: string;
}): Promise<Agent | undefined>;
getApp(params: {
name: string;
}): Promise<SilvanaApp | undefined>;
createApp(params: {
name: string;
owner: string;
description?: string;
transaction?: Transaction;
}): Transaction;
removeApp(params: {
name: string;
transaction?: Transaction;
}): Transaction;
static getDockerImageDetails(params: {
dockerImage: string;
}): Promise<{
sha256: string;
numberOfLayers: number;
} | undefined>;
}
export {};