Documentation
¶
Index ¶
- Variables
- func CanTransition(from, to ProjectStatus) bool
- func FormatForAgent(messages []ChatMessage) string
- func RenderProjectMD(proj Project, members []TeamMember) string
- type ChatMessage
- type ChatPart
- type ChatStore
- func (cs *ChatStore) Append(projectID string, msg ChatMessage) error
- func (cs *ChatStore) ClearChat(projectID string) error
- func (cs *ChatStore) ClearListening(projectID string)
- func (cs *ChatStore) Compact(projectID string) error
- func (cs *ChatStore) Listener(projectID string) string
- func (cs *ChatStore) Messages(projectID string, limit int) ([]ChatMessage, error)
- func (cs *ChatStore) SetListening(projectID, agentName string)
- type CreateRequest
- type Project
- type ProjectStatus
- type Store
- func (s *Store) AddAgent(projectID, instanceID string) error
- func (s *Store) Create(req CreateRequest) (*Project, error)
- func (s *Store) Delete(id string) error
- func (s *Store) Get(id string) (*Project, error)
- func (s *Store) List() ([]Project, error)
- func (s *Store) RemoveAgent(projectID, instanceID string) error
- func (s *Store) Save(p Project) error
- type TeamMember
Constants ¶
This section is empty.
Variables ¶
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 = adapter.ChatMessage
ChatMessage is now a unified type defined in adapter package. Type alias preserves backward compatibility — existing code that references project.ChatMessage or project.ChatPart continues to work.
type ChatStore ¶
type ChatStore struct {
// contains filtered or unexported fields
}
func NewChatStore ¶
func (*ChatStore) Append ¶
func (cs *ChatStore) Append(projectID string, msg ChatMessage) error
Append adds a message to the project's shared conversation.
func (*ChatStore) ClearListening ¶
ClearListening removes the listening state for a project.
func (*ChatStore) Compact ¶
Compact rewrites the chat JSONL file without duplicate IDs. WHY: Incremental persistence appends partial snapshots during streaming (same ID, growing content) for crash recovery. After the final message is written, compaction removes the partials so the file stays clean and Messages() doesn't need to dedup on every read.
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 ¶
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 (*Store) RemoveAgent ¶
RemoveAgent removes a role agent from a project.
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.