dev

package
v0.0.105 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRunProjectCmd

func CreateRunProjectCmd(ctx context.Context, log logger.Logger, theproject project.ProjectContext, liveDevConnection *Websocket, dir string, orgId string, port int) (*exec.Cmd, error)

func FindAvailablePort added in v0.0.74

func FindAvailablePort(p project.ProjectContext) (int, error)

func KillProjectServer added in v0.0.72

func KillProjectServer(projectServerCmd *exec.Cmd)

Types

type Agent

type Agent struct {
	Name        string   `json:"name"`
	ID          string   `json:"id"`
	Description string   `json:"description"`
	Welcome     *Welcome `json:"welcome,omitempty"`
}

type AgentsPayload

type AgentsPayload struct {
	Agents      []Agent `json:"agents"`
	ProjectID   string  `json:"projectId"`
	ProjectName string  `json:"projectName"`
}

type FileWatcher

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

func NewWatcher

func NewWatcher(logger logger.Logger, dir string, patterns []string, callback func(string)) (*FileWatcher, error)

func (*FileWatcher) Close

func (fw *FileWatcher) Close(logger logger.Logger) error

type InputMessage

type InputMessage struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	From    string `json:"from"`
	Payload struct {
		SessionID   string `json:"sessionId"`
		Trigger     string `json:"trigger"`
		AgentID     string `json:"agentId"`
		ContentType string `json:"contentType"`
		Payload     []byte `json:"payload"`
	} `json:"payload"`
}

messages send by server to CLI

type Message

type Message struct {
	ID        string         `json:"id"`
	Type      string         `json:"type"`
	Payload   map[string]any `json:"payload"`
	ProjectId string         `json:"projectId"`
}

func NewAgentsMessage

func NewAgentsMessage(id string, projectId string, payload AgentsPayload) Message

func NewCloseMessage added in v0.0.85

func NewCloseMessage(id string, projectId string) Message

func NewOutputMessage

func NewOutputMessage(id string, projectId string, payload struct {
	ContentType string `json:"contentType"`
	Payload     []byte `json:"payload"`
	Trigger     string `json:"trigger"`
}) Message

messages send by CLI to the server

type OutputPayload

type OutputPayload struct {
	ContentType string `json:"contentType"`
	Payload     []byte `json:"payload"`
	Trigger     string `json:"trigger"`
}

type Websocket added in v0.0.66

type Websocket struct {
	OtelToken string
	OtelUrl   string
	Project   project.ProjectContext
	// contains filtered or unexported fields
}

func NewWebsocket added in v0.0.66

func NewWebsocket(args WebsocketArgs) (*Websocket, error)

func (*Websocket) Close added in v0.0.66

func (c *Websocket) Close() error

func (*Websocket) Done added in v0.0.66

func (c *Websocket) Done() <-chan struct{}

func (*Websocket) SendMessage added in v0.0.66

func (c *Websocket) SendMessage(logger logger.Logger, msg Message) error

Update SendMessage to accept the MessageType interface

func (*Websocket) StartReadingMessages added in v0.0.66

func (c *Websocket) StartReadingMessages(ctx context.Context, logger logger.Logger, port int)

func (*Websocket) WebURL added in v0.0.66

func (c *Websocket) WebURL(appUrl string) string

type WebsocketArgs added in v0.0.83

type WebsocketArgs struct {
	Ctx          context.Context
	Logger       logger.Logger
	WebsocketId  string
	WebsocketUrl string
	APIKey       string
	Project      project.ProjectContext
	OrgId        string
	Version      string
}

type Welcome added in v0.0.86

type Welcome struct {
	Message string `json:"welcome"`
	Prompts []struct {
		Data        string `json:"data"`
		ContentType string `json:"contentType"`
	} `json:"prompts,omitempty"`
}

Jump to

Keyboard shortcuts

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