runtimeapi

package
v0.6.37 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvBaseURL = "ALICE_RUNTIME_API_BASE_URL"
	EnvToken   = "ALICE_RUNTIME_API_TOKEN"
	EnvBin     = "ALICE_RUNTIME_BIN"

	HeaderReceiveIDType   = "X-Alice-Receive-Id-Type"
	HeaderReceiveID       = "X-Alice-Receive-Id"
	HeaderResourceRoot    = "X-Alice-Resource-Root"
	HeaderSourceMessageID = "X-Alice-Source-Message-Id"
	HeaderActorUserID     = "X-Alice-Actor-User-Id"
	HeaderActorOpenID     = "X-Alice-Actor-Open-Id"
	HeaderChatType        = "X-Alice-Chat-Type"
	HeaderSessionKey      = "X-Alice-Session-Key"
)

Variables

This section is empty.

Functions

func BaseURL

func BaseURL(addr string) string

Types

type Client

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

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) CreateCampaign added in v0.3.9

func (c *Client) CreateCampaign(
	ctx context.Context,
	session mcpbridge.SessionContext,
	req CreateCampaignRequest,
) (map[string]any, error)

func (*Client) CreateTask

func (c *Client) CreateTask(ctx context.Context, session mcpbridge.SessionContext, req CreateTaskRequest) (map[string]any, error)

func (*Client) DeleteCampaign added in v0.6.4

func (c *Client) DeleteCampaign(
	ctx context.Context,
	session mcpbridge.SessionContext,
	campaignID string,
	deleteRepo bool,
) (map[string]any, error)

func (*Client) DeleteTask

func (c *Client) DeleteTask(ctx context.Context, session mcpbridge.SessionContext, taskID string) (map[string]any, error)

func (*Client) GetCampaign added in v0.3.9

func (c *Client) GetCampaign(ctx context.Context, session mcpbridge.SessionContext, campaignID string) (map[string]any, error)

func (*Client) GetTask

func (c *Client) GetTask(ctx context.Context, session mcpbridge.SessionContext, taskID string) (map[string]any, error)

func (*Client) IsEnabled

func (c *Client) IsEnabled() bool

func (*Client) ListCampaigns added in v0.3.9

func (c *Client) ListCampaigns(
	ctx context.Context,
	session mcpbridge.SessionContext,
	status string,
	limit int,
) (map[string]any, error)

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context, session mcpbridge.SessionContext, status string, limit int) (map[string]any, error)

func (*Client) PatchCampaign added in v0.3.9

func (c *Client) PatchCampaign(
	ctx context.Context,
	session mcpbridge.SessionContext,
	campaignID string,
	contentType string,
	patchBody []byte,
) (map[string]any, error)

func (*Client) PatchTask

func (c *Client) PatchTask(
	ctx context.Context,
	session mcpbridge.SessionContext,
	taskID string,
	contentType string,
	patchBody []byte,
) (map[string]any, error)

func (*Client) SendFile

func (c *Client) SendFile(ctx context.Context, session mcpbridge.SessionContext, req FileRequest) (map[string]any, error)

func (*Client) SendImage

func (c *Client) SendImage(ctx context.Context, session mcpbridge.SessionContext, req ImageRequest) (map[string]any, error)

type CreateCampaignRequest added in v0.3.9

type CreateCampaignRequest struct {
	Title             string              `json:"title,omitempty"`
	Objective         string              `json:"objective"`
	Repo              string              `json:"repo,omitempty"`
	CampaignRepoPath  string              `json:"campaign_repo_path,omitempty"`
	ManageMode        campaign.ManageMode `json:"manage_mode,omitempty"`
	MaxParallelTrials int                 `json:"max_parallel_trials,omitempty"`
	Summary           string              `json:"summary,omitempty"`
	Baseline          []campaign.Metric   `json:"baseline,omitempty"`
	Gates             []campaign.Gate     `json:"gates,omitempty"`
	Tags              []string            `json:"tags,omitempty"`
}

type CreateTaskRequest

type CreateTaskRequest struct {
	Title      string                `json:"title,omitempty"`
	Schedule   automation.Schedule   `json:"schedule"`
	Action     automation.Action     `json:"action"`
	ManageMode automation.ManageMode `json:"manage_mode,omitempty"`
	MaxRuns    int                   `json:"max_runs,omitempty"`
	NextRunAt  time.Time             `json:"next_run_at,omitempty"`
	Enabled    *bool                 `json:"enabled,omitempty"`
}

type FileRequest

type FileRequest struct {
	FileKey  string `json:"file_key,omitempty"`
	Path     string `json:"path,omitempty"`
	FileName string `json:"file_name,omitempty"`
	Caption  string `json:"caption,omitempty"`
}

type ImageRequest

type ImageRequest struct {
	ImageKey string `json:"image_key,omitempty"`
	Path     string `json:"path,omitempty"`
	Caption  string `json:"caption,omitempty"`
}

type Sender

type Sender = messaging.RuntimeSender

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	addr, token string,
	sender Sender,
	automationStore *automation.Store,
	campaignStore *campaign.Store,
	cfg config.Config,
) *Server

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) UpdateRuntimeConfig added in v0.3.17

func (s *Server) UpdateRuntimeConfig(cfg config.Config)

Jump to

Keyboard shortcuts

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