@fleek-platform/agents-ui
Version:
The Fleek Platform Agents UI provides a simple interface for deploying, monitoring, and configuring your agents––making management straightforward
364 lines (363 loc) • 11.3 kB
TypeScript
import { type PersonaGenApiVersions } from '@utils/url';
import type { CharacterfileSchema } from '@base/config/schema';
import type { ChatMessage } from '@base/pages/agentDraft/useAgentDraftStore';
export type CreateAgentDraftParams = {
projectId?: string;
characterfile?: string;
accessToken?: string;
name?: string;
avatar?: string;
frameworkVersion?: string;
tee?: boolean;
managedModelName?: string;
};
export declare const createAgentDraft: import("./withSafeApi").Handler<CreateAgentDraftParams, AiAgent>;
export declare const deployAgent: import("./withSafeApi").Handler<{
projectId?: string;
characterfile?: string;
avatar?: string;
accessToken: string;
draftId?: string;
frameworkVersion?: string;
managedModelName?: string;
tee?: boolean;
withUpdate?: boolean;
}, string>;
type DeploymentStepStatus = 'true' | 'false';
export type DeploymentStatus = Record<string, DeploymentStepStatus>;
export type AiAgentStatus = 'Draft' | 'Created' | 'Pending' | 'Running' | 'Stopped' | 'Failed';
export type AiAgent = {
avatar?: string;
status: AiAgentStatus;
frameworkVersion?: string;
frameworkName?: string;
characterFile: string;
createdAt: string;
createdBy: string;
deletedAt?: string;
host: string;
id: string;
name: string;
projectId: string;
slotNumber: number;
updatedAt: string;
publicToken: string;
publicChat: boolean;
tee?: boolean;
category?: string;
};
export declare const getAgentsByProjectId: import("./withSafeApi").Handler<{
projectId?: string;
accessToken?: string;
}, AiAgent[]>;
export declare const getAgentById: import("./withSafeApi").Handler<{
projectId?: string;
accessToken?: string;
agentId?: string;
}, AiAgent>;
export type GetSubscriptionsRequestProps = {
projectId?: string;
accessToken?: string;
};
export type SubscriptionItem = {
quantity: number;
id: string;
metadata?: Record<string, string>;
productId: string;
unitAmount: number;
priceId: string;
usageType: string;
};
export type Subscription = {
id: string;
status: string;
startDate: string;
periodStartDate: string;
periodEndDate: string;
productId: string;
endDate?: string | null;
items: SubscriptionItem[];
scheduleId: string;
trialEndDate?: string;
};
export declare const getSubscriptions: import("./withSafeApi").Handler<GetSubscriptionsRequestProps, Subscription[]>;
export type CreateSubscriptionCheckoutRequestProps = {
projectId?: string;
productId?: string;
accessToken?: string;
referralId?: string;
};
export declare const createSubscriptionCheckout: import("./withSafeApi").Handler<CreateSubscriptionCheckoutRequestProps, string>;
export type Plan = {
id: string;
name: string;
description: string | null;
price: number;
createdAt: string;
updatedAt: string;
metadata: Record<string, string>;
};
export declare const getPlans: import("./withSafeApi").Handler<unknown, Plan[]>;
export interface GetAgentLogsParams {
agentId: string;
accessToken: string;
pageCursor?: string;
pageSize?: number;
}
export type AgentLog = {
id: number;
timestamp: number;
message: string;
priority: number;
};
export type PaginatedResponse<DataType> = {
data: DataType[];
next_page: string;
prev_page: string;
};
export declare const getAgentLogs: import("./withSafeApi").Handler<GetAgentLogsParams, PaginatedResponse<AgentLog>>;
export interface GetAgentAttestationParams {
agentId: string;
}
export type AgentAttestation = Uint8Array<ArrayBufferLike>;
export declare const getAgentAttestation: import("./withSafeApi").Handler<GetAgentAttestationParams, AgentAttestation>;
export declare const getAgentStatus: import("./withSafeApi").Handler<{
accessToken?: string;
agentId: string;
}, "true" | "false">;
export declare const updateAgentById: import("./withSafeApi").Handler<{
accessToken?: string;
agentId: string;
payload: string;
}, AiAgent>;
export type ChangeAgentStatusAction = 'start' | 'stop';
export declare const changeAgentStatus: import("./withSafeApi").Handler<{
agentId: string;
accessToken?: string;
action: ChangeAgentStatusAction;
}, void>;
export type DeleteAgentParams = {
id: string;
accessToken?: string;
};
export declare const deleteAgent: import("./withSafeApi").Handler<DeleteAgentParams, string>;
export type ApiTokenResponse = {
id: string;
name: string;
token_prefix: string;
created_at: string;
expires_at: string | null;
last_used_at: string | null;
token: string | null;
};
export declare const getApiTokens: import("./withSafeApi").Handler<{
accessToken?: string;
}, ApiTokenResponse[]>;
export type CreateApiTokenPayload = {
expires_in_days: string | null;
name: string;
};
export declare const createApiToken: import("./withSafeApi").Handler<{
accessToken?: string;
payload: CreateApiTokenPayload;
}, ApiTokenResponse>;
export declare const deleteApiToken: import("./withSafeApi").Handler<{
accessToken?: string;
tokenId: string;
}, void>;
export type UpdateSubscriptionParams = {
subscriptionId?: string;
projectId?: string;
productId?: string;
accessToken?: string;
quantity?: number;
};
export declare const updateSubscription: import("./withSafeApi").Handler<UpdateSubscriptionParams, Subscription>;
interface GetElizaAgentParams {
agentId?: string;
accessToken?: string;
timeout?: number;
version?: PersonaGenApiVersions;
}
export interface Agent {
id: string;
name: string;
clients: string[];
}
export interface AgentsData {
agents: Agent[];
}
export declare const getElizaAgent: import("./withSafeApi").Handler<GetElizaAgentParams, AgentsData>;
interface SendMessageParams {
agentId: string;
agentElizaId: string;
accessToken?: string;
message: string;
version?: PersonaGenApiVersions;
}
export declare const sendMessageAgent: import("./withSafeApi").Handler<SendMessageParams, {
user: string;
text: string;
action: string;
}[]>;
export type ElizaVersionResponse = {
name: string;
versions: string[];
};
export declare const getElizaOsVersions: import("./withSafeApi").Handler<{
accessToken?: string;
}, ElizaVersionResponse>;
export type Project = {
id: string;
name: string;
avatar: string | null;
};
export declare const getProjects: import("./withSafeApi").Handler<{
accessToken?: string;
}, Project[]>;
interface GetModelsParams {
accessToken?: string;
}
export declare const getModels: import("./withSafeApi").Handler<GetModelsParams, string[]>;
type GetCreditsRequestProps = {
accessToken?: string;
projectId?: string;
};
type Credits = {
balance: number;
projectId: string;
teamId: string;
};
export declare const getCredits: import("./withSafeApi").Handler<GetCreditsRequestProps, Credits>;
type CreateCreditsCheckoutProps = {
accessToken?: string;
projectId?: string;
};
type CreditsCheckoutResponse = {
url: string;
};
export declare const createCreditsCheckout: import("./withSafeApi").Handler<CreateCreditsCheckoutProps, CreditsCheckoutResponse>;
export type CreateSubscriptionRequestProps = {
projectId?: string;
productId?: string;
accessToken?: string;
referralId?: string;
};
export declare const createSubscription: import("./withSafeApi").Handler<CreateSubscriptionRequestProps, Subscription>;
export type UpdateSubscriptionQuantityProps = {
subscriptionId: string;
projectId?: string;
accessToken?: string;
updateBy: number;
};
export declare const updateSubscriptionQuantity: import("./withSafeApi").Handler<UpdateSubscriptionQuantityProps, Subscription>;
export declare const sendAssistantMessageStream: import("./withSafeApi").Handler<{
content: string;
messages: ChatMessage[];
accessToken?: string;
version?: PersonaGenApiVersions;
}, ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | undefined>;
export declare const generateCharacterfile: import("./withSafeApi").Handler<{
messages: unknown[];
accessToken?: string;
version?: PersonaGenApiVersions;
}, {
apiKey: string;
baseURL: string;
data: CharacterfileSchema;
model: string;
status: "success";
}>;
export type AdminMessageResponse = Record<'authenticatedUsers' | 'default', {
message: string;
enable: boolean;
}>;
export declare const getAdminMessages: import("./withSafeApi").Handler<unknown, AdminMessageResponse>;
export declare const improvePrompt: import("./withSafeApi").Handler<{
content: string;
}, ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | undefined>;
export type PaymentMethod = {
id: string;
brand: string;
last4: string;
country?: string;
expiryMonth: number;
expiryYear: number;
};
export interface PaymentMethodListResponse {
data: PaymentMethod[];
next_page: string;
prev_page: string;
}
export declare const getPaymentMethods: import("./withSafeApi").Handler<{
accessToken?: string;
projectId?: string;
}, PaymentMethodListResponse>;
export declare const createManagePaymentMethods: import("./withSafeApi").Handler<{
accessToken?: string;
projectId?: string;
}, string>;
export interface CreateFleekAgentThreadParams {
agentId: string;
userId: string;
projectId: string;
accessToken: string;
}
export declare const createFleekAgentThread: import("./withSafeApi").Handler<CreateFleekAgentThreadParams, FleekAgentThread>;
export type Invoice = {
id: string;
amountDue: number;
amountPaid: number;
amoundRemaining: number;
createdAt: string;
dueDate?: string;
hostedInvoiceUrl: string;
invoicePdf: string;
number: string;
periodEndDate: string;
periodStartDate: string;
status: 'Open' | 'Paid';
};
export interface InvoicesListResponse {
data: Invoice[];
next_page?: string;
prev_page?: string;
}
export declare const getInvoicesList: import("./withSafeApi").Handler<{
accessToken?: string;
projectId?: string;
pageSize?: number;
cursor?: string;
}, InvoicesListResponse>;
interface CancelSubscriptionArgs {
accessToken?: string;
subscriptionId?: string;
}
export declare const cancelSubscription: import("./withSafeApi").Handler<CancelSubscriptionArgs, void>;
export type FleekAgentThread = {
agentId: string;
id: string;
};
export interface GetFleekAgentThreadsParams {
userId: string;
projectId: string;
accessToken: string;
}
export declare const getFleekAgentThreads: import("./withSafeApi").Handler<GetFleekAgentThreadsParams, FleekAgentThread[]>;
export interface DeleteFleekAgentThreadParams {
threadId: string;
accessToken: string;
}
export declare const deleteFleekAgentThread: import("./withSafeApi").Handler<DeleteFleekAgentThreadParams, void>;
export declare const getFleekAgentThreadsByAgent: import("./withSafeApi").Handler<{
userId: string;
projectId: string;
accessToken: string;
agentId: string;
}, FleekAgentThread[]>;
export declare const getVmResources: import("./withSafeApi").Handler<{
accessToken?: string;
}, {
any_free_slot: boolean;
}>;
export {};