app

package
v0.0.0-...-237f1dd Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgencyConstitutionView

type AgencyConstitutionView struct {
	Name          string                    `json:"name"`
	Description   string                    `json:"description"`
	Current       bool                      `json:"current"`
	Solo          bool                      `json:"solo"`
	Constitution  config.AgencyConstitution `json:"constitution"`
	Blueprint     string                    `json:"blueprint"`
	TeamTemplate  string                    `json:"teamTemplate"`
	Roles         []config.TeamRoleTemplate `json:"roles"`
	LoopStrategy  string                    `json:"loopStrategy"`
	WorkspaceMode string                    `json:"workspaceMode"`
	RequiredGates []string                  `json:"requiredGates"`
}

type AgencyDockerServiceView

type AgencyDockerServiceView struct {
	Enabled        bool   `json:"enabled"`
	ComposeProject string `json:"composeProject"`
	ComposeFile    string `json:"composeFile"`
	Image          string `json:"image"`
	SharedVolume   string `json:"sharedVolume"`
	Network        string `json:"network"`
}

type AgencyGenesisRequest

type AgencyGenesisRequest struct {
	Intent       string   `json:"intent"`
	Domain       string   `json:"domain,omitempty"`
	TimeHorizon  string   `json:"timeHorizon,omitempty"`
	WorkingStyle string   `json:"workingStyle,omitempty"`
	Governance   string   `json:"governance,omitempty"`
	GoalShape    string   `json:"goalShape,omitempty"`
	Constitution string   `json:"constitution,omitempty"`
	Roles        []string `json:"roles,omitempty"`
}

type AgencyGenesisResult

type AgencyGenesisResult struct {
	Intent               string                        `json:"intent"`
	Summary              string                        `json:"summary"`
	ConstitutionName     string                        `json:"constitutionName"`
	Constitution         config.AgencyConstitution     `json:"constitution"`
	Topology             string                        `json:"topology,omitempty"`
	OrgIntent            agencypkg.OrgIntent           `json:"orgIntent"`
	Roles                []config.TeamRoleTemplate     `json:"roles"`
	RoleBundles          []agencypkg.GenesisRoleBundle `json:"roleBundles,omitempty"`
	SocialThread         []string                      `json:"socialThread,omitempty"`
	ManufacturingSignals []string                      `json:"manufacturingSignals,omitempty"`
	Tooling              map[string]string             `json:"tooling"`
	CreatedAt            time.Time                     `json:"createdAt"`
}

type AgencyLedgerServiceView

type AgencyLedgerServiceView struct {
	Backend        string `json:"backend"`
	Path           string `json:"path"`
	SnapshotPath   string `json:"snapshotPath"`
	ConsensusMode  string `json:"consensusMode"`
	DefaultQuorum  int    `json:"defaultQuorum"`
	ProjectionFile string `json:"projectionFile"`
}

type AgencyOfficeStatus

type AgencyOfficeStatus struct {
	ProductName     string     `json:"productName"`
	Mode            string     `json:"mode"`
	Running         bool       `json:"running"`
	Constitution    string     `json:"constitution"`
	SharedWorkplace string     `json:"sharedWorkplace"`
	RedisAddress    string     `json:"redisAddress"`
	LedgerPath      string     `json:"ledgerPath"`
	ConsensusMode   string     `json:"consensusMode"`
	DefaultQuorum   int        `json:"defaultQuorum"`
	StartedAt       *time.Time `json:"startedAt,omitempty"`
	StoppedAt       *time.Time `json:"stoppedAt,omitempty"`
	LastEvent       string     `json:"lastEvent,omitempty"`
	LastUpdatedAt   time.Time  `json:"lastUpdatedAt"`
}

type AgencyOrganizationView

type AgencyOrganizationView struct {
	ProductName         string                    `json:"productName"`
	CurrentConstitution string                    `json:"currentConstitution"`
	SoloConstitution    string                    `json:"soloConstitution"`
	Constitution        config.AgencyConstitution `json:"constitution"`
	Blueprint           string                    `json:"blueprint"`
	TeamTemplate        string                    `json:"teamTemplate"`
	Governance          string                    `json:"governance"`
	Roles               []config.TeamRoleTemplate `json:"roles"`
	LoopStrategy        string                    `json:"loopStrategy"`
	WorkspaceMode       string                    `json:"workspaceMode"`
	RequiredGates       []string                  `json:"requiredGates"`
}

type AgencyRedisServiceView

type AgencyRedisServiceView struct {
	Enabled       bool   `json:"enabled"`
	Address       string `json:"address"`
	DB            int    `json:"db"`
	ChannelPrefix string `json:"channelPrefix"`
}

type AgencyRuntimeServicesView

type AgencyRuntimeServicesView struct {
	Docker AgencyDockerServiceView `json:"docker"`
	Redis  AgencyRedisServiceView  `json:"redis"`
	Ledger AgencyLedgerServiceView `json:"ledger"`
}

type AgencyScheduleView

type AgencyScheduleView struct {
	Timezone            string                  `json:"timezone"`
	DefaultCadence      string                  `json:"defaultCadence"`
	WakeOnOfficeOpen    bool                    `json:"wakeOnOfficeOpen"`
	RequireShiftHandoff bool                    `json:"requireShiftHandoff"`
	Windows             []config.ScheduleWindow `json:"windows"`
}

type AgencyService

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

func NewAgencyService

func NewAgencyService(cfg *config.Config) *AgencyService

func (*AgencyService) BootOffice

func (s *AgencyService) BootOffice(_ context.Context, constitutionOverride string) (AgencyOfficeStatus, error)

func (*AgencyService) InspectConstitution

func (s *AgencyService) InspectConstitution(name string) (AgencyConstitutionView, error)

func (*AgencyService) InspectOffice

func (s *AgencyService) InspectOffice() (AgencyOfficeStatus, error)

func (*AgencyService) InspectOrganization

func (s *AgencyService) InspectOrganization() (AgencyOrganizationView, error)

func (*AgencyService) InspectRuntimeServices

func (s *AgencyService) InspectRuntimeServices() AgencyRuntimeServicesView

func (*AgencyService) InspectSchedules

func (s *AgencyService) InspectSchedules() AgencyScheduleView

func (*AgencyService) LatestGenesis

func (s *AgencyService) LatestGenesis() (*AgencyGenesisResult, error)

func (*AgencyService) ListConstitutions

func (s *AgencyService) ListConstitutions() []config.AgencyConstitution

func (*AgencyService) MaybeBootOnStartup

func (s *AgencyService) MaybeBootOnStartup(ctx context.Context) error

func (*AgencyService) SendApprovalVote

func (s *AgencyService) SendApprovalVote(ctx context.Context, orgID, proposalID string, approved bool) error

SendApprovalVote publishes an approve or reject signal for a pending proposal.

func (*AgencyService) StartGenesis

func (*AgencyService) StopOffice

func (s *AgencyService) StopOffice() (AgencyOfficeStatus, error)

func (*AgencyService) SubscribeApprovals

func (s *AgencyService) SubscribeApprovals(ctx context.Context, orgID string) (<-chan ProposalMsg, error)

SubscribeApprovals connects to the approval channel and returns pending action proposals. Returns nil if Redis is not configured.

func (*AgencyService) SubscribeBroadcasts

func (s *AgencyService) SubscribeBroadcasts(ctx context.Context, orgID string) (<-chan BroadcastMsg, error)

SubscribeBroadcasts connects to the agency event bus and returns a channel of broadcast messages for the given organization. The channel closes when ctx is cancelled. Returns nil if Redis is not configured (embedded mode).

func (*AgencyService) SubscribeBulletin

func (s *AgencyService) SubscribeBulletin(ctx context.Context, orgID string) (<-chan BulletinRecord, error)

SubscribeBulletin connects to the bulletin channel and returns performance records. Returns nil if Redis is not configured.

func (*AgencyService) SwitchConstitution

func (s *AgencyService) SwitchConstitution(name string) (config.AgencyConstitution, error)

type App

type App struct {
	Sessions    session.Service
	Messages    message.Service
	History     history.Service
	Permissions permission.Service
	Team        *team.Service
	Workers     *orchestration.Manager
	Agency      *AgencyService

	CoderAgent agent.Service

	LSPClients map[string]*lsp.Client
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, conn *sql.DB) (*App, error)

func (*App) RunNonInteractive

func (a *App) RunNonInteractive(ctx context.Context, prompt string, outputFormat string, quiet bool) error

RunNonInteractive handles the execution flow when a prompt is provided via CLI flag.

func (*App) Shutdown

func (app *App) Shutdown()

Shutdown performs a clean shutdown of the application

type BroadcastMsg

type BroadcastMsg struct {
	ActorID   string
	Message   string
	CreatedAt int64
}

BroadcastMsg carries an actor broadcast for TUI display.

type BulletinRecord

type BulletinRecord struct {
	ActorID   string
	Directive string
	Output    string
	Score     string
	Provider  string
	ModelID   string
	CreatedAt int64
}

BulletinRecord carries a directive→output→score performance entry for TUI display.

type ProposalMsg

type ProposalMsg struct {
	ProposalID string
	ActorID    string
	ActionType string
	Target     string
	CreatedAt  int64
}

ProposalMsg carries a pending action proposal for TUI approval display.

Jump to

Keyboard shortcuts

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