client

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL = defaultBaseURL
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
	// contains filtered or unexported fields
}

Client is a lightweight API client replacing the previous SQLite backend

func NewClient

func NewClient(baseURL, token string) *Client

NewClient constructs a client with explicit baseURL and token. The baseURL can be provided with or without the /v0 API prefix; if missing, /v0 is appended automatically.

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

NewClientFromEnv constructs a client using environment variables

func NewClientWithConfig added in v0.1.14

func NewClientWithConfig(baseURL, token string) (*Client, error)

NewClientWithConfig constructs a client from explicit inputs (flag/env), applies defaults, and verifies connectivity.

func (*Client) Close

func (c *Client) Close() error

Close is a no-op in API mode

func (*Client) CreateAgent added in v0.1.24

func (c *Client) CreateAgent(agent *models.AgentJSON) (*models.AgentResponse, error)

CreateAgent creates or updates an agent entry.

func (*Client) CreateMCPServer added in v0.1.24

func (c *Client) CreateMCPServer(server *v0.ServerJSON) (*v0.ServerResponse, error)

CreateMCPServer creates or updates an MCP server entry.

func (*Client) CreatePrompt added in v0.2.0

func (c *Client) CreatePrompt(prompt *models.PromptJSON) (*models.PromptResponse, error)

CreatePrompt creates a prompt in the registry (immediately visible)

func (*Client) CreateSkill added in v0.1.24

func (c *Client) CreateSkill(skill *models.SkillJSON) (*models.SkillResponse, error)

CreateSkill creates a skill in the registry (immediately visible)

func (*Client) DeleteAgent

func (c *Client) DeleteAgent(name, version string) error

DeleteAgent deletes an agent from the registry

func (*Client) DeleteMCPServer

func (c *Client) DeleteMCPServer(name, version string) error

DeleteMCPServer deletes an MCP server from the registry by setting its status to deleted

func (*Client) DeletePrompt added in v0.2.0

func (c *Client) DeletePrompt(name, version string) error

DeletePrompt deletes a prompt from the registry

func (*Client) DeleteSkill

func (c *Client) DeleteSkill(name, version string) error

DeleteSkill deletes a skill from the registry Note: This uses DELETE HTTP method. If the endpoint doesn't exist, it will return an error.

func (*Client) DeployAgent

func (c *Client) DeployAgent(name, version string, env map[string]string, providerID string) (*DeploymentResponse, error)

DeployAgent deploys an agent with deployment environment variables.

func (*Client) DeployServer

func (c *Client) DeployServer(name, version string, env map[string]string, preferRemote bool, providerID string) (*DeploymentResponse, error)

DeployServer deploys a server with deployment environment variables.

func (*Client) GetAgentByName

func (c *Client) GetAgentByName(name string) (*models.AgentResponse, error)

func (*Client) GetAgentByNameAndVersion

func (c *Client) GetAgentByNameAndVersion(name, version string) (*models.AgentResponse, error)

GetAgentByNameAndVersion returns a specific version of an agent

func (*Client) GetAgents

func (c *Client) GetAgents() ([]*models.AgentResponse, error)

GetAgents returns all agents from connected registries

func (*Client) GetDeployedServers

func (c *Client) GetDeployedServers() ([]*DeploymentResponse, error)

GetDeployedServers retrieves all deployed servers

func (*Client) GetDeploymentByID added in v0.2.0

func (c *Client) GetDeploymentByID(id string) (*DeploymentResponse, error)

GetDeploymentByID retrieves a deployment by ID.

func (*Client) GetIndexStatus added in v0.1.21

func (c *Client) GetIndexStatus(jobID string) (*internalv0.JobStatusResponse, error)

GetIndexStatus fetches indexing job status by job ID.

func (*Client) GetPromptByName added in v0.2.0

func (c *Client) GetPromptByName(name string) (*models.PromptResponse, error)

GetPromptByName returns a prompt by name (latest version)

func (*Client) GetPromptByNameAndVersion added in v0.2.0

func (c *Client) GetPromptByNameAndVersion(name, version string) (*models.PromptResponse, error)

GetPromptByNameAndVersion returns a specific version of a prompt

func (*Client) GetPrompts added in v0.2.0

func (c *Client) GetPrompts() ([]*models.PromptResponse, error)

GetPrompts returns all prompts from the registry

func (*Client) GetPublishedServers

func (c *Client) GetPublishedServers() ([]*v0.ServerResponse, error)

GetPublishedServers returns all published MCP servers

func (*Client) GetServerByName

func (c *Client) GetServerByName(name string) (*v0.ServerResponse, error)

GetServerByName returns a server by name (latest version)

func (*Client) GetServerByNameAndVersion

func (c *Client) GetServerByNameAndVersion(name, version string) (*v0.ServerResponse, error)

GetServerByNameAndVersion returns a specific version of a server

func (*Client) GetServerVersions

func (c *Client) GetServerVersions(name string) ([]v0.ServerResponse, error)

GetServerVersions returns all versions of a server by name (public endpoint - only published)

func (*Client) GetSkillByName

func (c *Client) GetSkillByName(name string) (*models.SkillResponse, error)

GetSkillByName returns a skill by name

func (*Client) GetSkillByNameAndVersion

func (c *Client) GetSkillByNameAndVersion(name, version string) (*models.SkillResponse, error)

GetSkillByNameAndVersion returns a specific version of a skill

func (*Client) GetSkillVersions

func (c *Client) GetSkillVersions(name string) ([]*models.SkillResponse, error)

GetSkillVersions returns all versions for a skill by name.

func (*Client) GetSkills

func (c *Client) GetSkills() ([]*models.SkillResponse, error)

GetSkills returns all skills from connected registries

func (*Client) GetVersion

func (c *Client) GetVersion() (*internalv0.VersionBody, error)

func (*Client) NewSSERequest added in v0.1.21

func (c *Client) NewSSERequest(ctx context.Context, reqBody internalv0.IndexRequest) (*http.Request, error)

NewSSERequest creates a request for streaming embedding indexing events.

func (*Client) Ping

func (c *Client) Ping() error

Ping checks connectivity to the API

func (*Client) RemoveDeploymentByID added in v0.2.0

func (c *Client) RemoveDeploymentByID(id string) error

RemoveDeploymentByID removes a deployment by ID.

func (*Client) SSEClient added in v0.1.21

func (c *Client) SSEClient() *http.Client

SSEClient returns the HTTP client used for SSE requests.

func (*Client) StartIndex added in v0.1.21

StartIndex starts a non-streaming indexing job.

type DeploymentResponse

type DeploymentResponse struct {
	ID             string            `json:"id"`
	ProviderID     string            `json:"providerId,omitempty"`
	ServerName     string            `json:"serverName"`
	Version        string            `json:"version"`
	Origin         string            `json:"origin"`
	DeployedAt     string            `json:"deployedAt"`
	UpdatedAt      string            `json:"updatedAt"`
	Status         string            `json:"status"`
	Env            map[string]string `json:"env"`
	ProviderConfig map[string]any    `json:"providerConfig,omitempty"`
	PreferRemote   bool              `json:"preferRemote"`
	ResourceType   string            `json:"resourceType"`
}

DeploymentResponse represents a deployment returned by the API

type DeploymentsListResponse

type DeploymentsListResponse struct {
	Deployments []DeploymentResponse `json:"deployments"`
}

DeploymentsListResponse represents the list of deployments

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL