project

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("project not found")

ErrNotFound is returned when a project does not exist.

Functions

func CanTransition

func CanTransition(from, to ProjectStatus) bool

CanTransition returns true if transitioning from → to is allowed. Allowed: active→paused, paused→active, active→completed, paused→completed, completed→archived.

func FormatForAgent

func FormatForAgent(messages []ChatMessage) string

FormatForAgent formats the conversation history as a text block suitable for injecting into an agent's context. Each message is labeled with the sender so the agent knows who said what.

func RenderProjectMD

func RenderProjectMD(proj Project, members []TeamMember) string

RenderProjectMD generates the content of a PROJECT.md file that gives agents context about their project and team. This file is written to each project agent's workspace and refreshed when the team or project details change.

Types

type ChatMessage

type ChatMessage struct {
	ID        string     `json:"id"`
	Sender    string     `json:"sender"` // "user", agent name, or instance name
	Role      string     `json:"role"`   // "user", "commander", "captain", "talon"
	Content   string     `json:"content"`
	Timestamp time.Time  `json:"timestamp"`
	Mention   string     `json:"mention,omitempty"` // "@captain", "@commander", etc.
	Parts     []ChatPart `json:"parts,omitempty"`   // tool calls + text parts
}

ChatMessage is a single message in a project's shared conversation. Unlike adapter.ChatMessage, this includes sender attribution for multi-participant conversations.

type ChatPart

type ChatPart struct {
	Type   string         `json:"type"` // "text" or "tool_call"
	Text   string         `json:"text,omitempty"`
	ID     string         `json:"id,omitempty"`
	Name   string         `json:"name,omitempty"`
	Args   map[string]any `json:"args,omitempty"`
	Output string         `json:"output,omitempty"`
	Error  bool           `json:"error,omitempty"`
}

ChatPart is an ordered content element (text or tool call) within a message.

type ChatStore

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

func NewChatStore

func NewChatStore() (*ChatStore, error)

func (*ChatStore) Append

func (cs *ChatStore) Append(projectID string, msg ChatMessage) error

Append adds a message to the project's shared conversation.

func (*ChatStore) ClearChat

func (cs *ChatStore) ClearChat(projectID string) error

ClearChat removes the project's chat history file.

func (*ChatStore) ClearListening

func (cs *ChatStore) ClearListening(projectID string)

ClearListening removes the listening state for a project.

func (*ChatStore) Listener

func (cs *ChatStore) Listener(projectID string) string

Listener returns the agent currently listening in a project, or "".

func (*ChatStore) Messages

func (cs *ChatStore) Messages(projectID string, limit int) ([]ChatMessage, error)

Messages returns all messages in a project's conversation, optionally limited to the last N messages.

func (*ChatStore) SetListening

func (cs *ChatStore) SetListening(projectID, agentName string)

SetListening marks an agent as listening for the next message in a project.

type CreateRequest

type CreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Goal        string `json:"goal,omitempty"`
	CreatedBy   string `json:"created_by,omitempty"`
}

CreateRequest holds parameters for creating a new project.

type Project

type Project struct {
	ID             string        `json:"id"`
	Name           string        `json:"name"`
	Description    string        `json:"description"`
	Goal           string        `json:"goal,omitempty"`
	OrchestratorID string        `json:"orchestrator_id,omitempty"`
	RoleAgentIDs   []string      `json:"role_agent_ids,omitempty"`
	Status         ProjectStatus `json:"status"`
	Progress       int           `json:"progress,omitempty"` // 0-100 percentage, set by user or captain
	Deadline       *time.Time    `json:"deadline,omitempty"` // target completion date
	CreatedAt      time.Time     `json:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at"`
	CreatedBy      string        `json:"created_by"`            // "user" or coordinator instance ID
	SessionKey     string        `json:"session_key,omitempty"` // human-readable session slug, e.g. "chess-coach"
}

Project is the top-level organizational entity for a group of agents working toward a shared goal.

type ProjectStatus

type ProjectStatus string

ProjectStatus represents the lifecycle state of a project.

const (
	PStatusActive    ProjectStatus = "active"
	PStatusPaused    ProjectStatus = "paused"
	PStatusCompleted ProjectStatus = "completed"
	PStatusArchived  ProjectStatus = "archived"
)

func (ProjectStatus) Valid

func (s ProjectStatus) Valid() bool

Valid returns true if s is a recognised project status.

type Store

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

Store manages project definitions on disk at ~/.eyrie/projects/.

func NewStore

func NewStore() (*Store, error)

func (*Store) AddAgent

func (s *Store) AddAgent(projectID, instanceID string) error

AddAgent adds a role agent to a project.

func (*Store) Create

func (s *Store) Create(req CreateRequest) (*Project, error)

func (*Store) Delete

func (s *Store) Delete(id string) error

func (*Store) Get

func (s *Store) Get(id string) (*Project, error)

func (*Store) List

func (s *Store) List() ([]Project, error)

func (*Store) RemoveAgent

func (s *Store) RemoveAgent(projectID, instanceID string) error

RemoveAgent removes a role agent from a project.

func (*Store) Save

func (s *Store) Save(p Project) error

type TeamMember

type TeamMember struct {
	Name        string
	DisplayName string
	Role        string // "captain" or "talon"
	Description string // persona description (optional)
	Framework   string
}

TeamMember represents an agent participating in a project, used when rendering PROJECT.md context files for agent workspaces.

Jump to

Keyboard shortcuts

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