runtimeapi

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 18 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 AddGuidanceRequest added in v0.3.9

type AddGuidanceRequest struct {
	Guidance campaign.Guidance `json:"guidance"`
}

type AddPitfallRequest added in v0.3.9

type AddPitfallRequest struct {
	Pitfall campaign.Pitfall `json:"pitfall"`
}

type AddReviewRequest added in v0.3.9

type AddReviewRequest struct {
	Review campaign.Review `json:"review"`
}

type Client

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

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) AddGuidance added in v0.3.9

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

func (*Client) AddPitfall added in v0.3.9

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

func (*Client) AddReview added in v0.3.9

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

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) 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)

func (*Client) UpsertTrial added in v0.3.9

func (c *Client) UpsertTrial(
	ctx context.Context,
	session mcpbridge.SessionContext,
	campaignID string,
	req UpsertTrialRequest,
) (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"`
	IssueIID          string              `json:"issue_iid,omitempty"`
	IssueURL          string              `json:"issue_url,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"`
	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 interface {
	SendText(ctx context.Context, receiveIDType, receiveID, text string) error
	SendImage(ctx context.Context, receiveIDType, receiveID, imageKey string) error
	SendFile(ctx context.Context, receiveIDType, receiveID, fileKey string) error
	UploadImage(ctx context.Context, localPath string) (string, error)
	UploadFile(ctx context.Context, localPath, fileName string) (string, error)
}

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) Addr

func (s *Server) Addr() string

func (*Server) BaseURL

func (s *Server) BaseURL() string

func (*Server) Run

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

func (*Server) Token

func (s *Server) Token() string

func (*Server) UpdateRuntimeConfig added in v0.3.17

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

type UpsertTrialRequest added in v0.3.9

type UpsertTrialRequest struct {
	Trial campaign.Trial `json:"trial"`
}

Jump to

Keyboard shortcuts

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