runtimeapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 16 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) AppendDailySummary

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

func (*Client) CodeArmyStatus

func (c *Client) CodeArmyStatus(ctx context.Context, session mcpbridge.SessionContext, stateKey string) (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) 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) ListTasks

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

func (*Client) MemoryContext

func (c *Client) MemoryContext(ctx context.Context, session mcpbridge.SessionContext) (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) SendText

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

func (*Client) WriteLongTerm

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

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 DailySummaryRequest

type DailySummaryRequest struct {
	SessionKey string    `json:"session_key,omitempty"`
	Summary    string    `json:"summary"`
	At         time.Time `json:"at,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 MemoryWriteRequest

type MemoryWriteRequest struct {
	ScopeType string `json:"scope_type"`
	Content   string `json:"content"`
}

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, memoryManager *memory.Manager, store *automation.Store, inspector *codearmy.Inspector) *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

type TextRequest

type TextRequest struct {
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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