studio

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Overview

Package studio composes Facet's browser workbench and embedded agent runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCatalogPath

func GetCatalogPath(rootDir ...string) string

GetCatalogPath returns the absolute path to catalog.json.

func GetDefaultProductionsRoot

func GetDefaultProductionsRoot() string

GetDefaultProductionsRoot returns the default path for new productions.

func InitializeApplication added in v1.0.2

func InitializeApplication() error

InitializeApplication is called once by the standalone composition root. Kernel config, catalogs and auth all agree on Facet's home; a separate Compa installation is neither read nor modified implicitly.

func OpenBrowser

func OpenBrowser(targetURL string)

OpenBrowser launches the user's default browser to targetURL.

func Run

func Run(addr, dir string) error

Run starts the Studio server on addr for the given root directory and auto-opens browser.

func RunWithBundleOption added in v1.1.0

func RunWithBundleOption(addr, dir, bundleDir string, autoOpen bool) error

RunWithBundleOption starts Studio with an explicit installed capability bundle. An empty path uses FACET_BUNDLE_DIR or the standard user location.

func RunWithOption

func RunWithOption(addr, dir string, autoOpen bool) error

RunWithOption starts the Studio server with optional browser opening.

func SaveCatalog

func SaveCatalog(cat *Catalog, rootDir ...string) error

SaveCatalog writes the catalog atomically to disk.

Types

type BeatItem

type BeatItem struct {
	Index     string            `json:"index,omitempty"`
	TimeRange string            `json:"time_range,omitempty"`
	Title     string            `json:"title,omitempty"`
	Visual    string            `json:"visual,omitempty"`
	Narration string            `json:"narration,omitempty"`
	Type      string            `json:"type,omitempty"`
	Raw       map[string]string `json:"raw,omitempty"`
}

BeatItem represents a single editorial or visual beat from script or composition.

type Catalog

type Catalog struct {
	Version     string           `json:"version"`
	DefaultRoot string           `json:"default_root"`
	Projects    []CatalogProject `json:"projects"`
}

Catalog tracks recent and managed Facet projects.

func LoadCatalog

func LoadCatalog(rootDir ...string) (*Catalog, error)

LoadCatalog reads the catalog from disk or initializes a default.

type CatalogProject

type CatalogProject struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Path         string    `json:"path"`
	Engine       string    `json:"engine"`
	Packs        []string  `json:"packs"`
	CreatedAt    time.Time `json:"created_at"`
	LastOpenedAt time.Time `json:"last_opened_at"`
	Exists       bool      `json:"exists"`
}

CatalogProject represents a single production entry in the catalog.

func CreateNewProject

func CreateNewProject(name, slug, baseDir, engine string, packs []string, rootDir ...string) (*CatalogProject, error)

CreateNewProject handles the backend creation and initialization of a new project.

func OpenExistingProject

func OpenExistingProject(targetPath, engine string, rootDir ...string) (*CatalogProject, error)

OpenExistingProject registers an existing folder and refreshes its projections.

func RegisterOrUpdateProject

func RegisterOrUpdateProject(name, targetPath, engine string, packs []string, rootDir ...string) (*CatalogProject, error)

RegisterOrUpdateProject adds or touches a project in the catalog.

type MediaFile

type MediaFile struct {
	Name         string    `json:"name"`
	Path         string    `json:"path"`
	RelativePath string    `json:"relative_path"`
	URL          string    `json:"url"`
	Size         int64     `json:"size"`
	LastModified time.Time `json:"last_modified"`
}

MediaFile represents an audio, image, or video file inside a project.

type PackInfo

type PackInfo struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Description string   `json:"description"`
	Skills      []string `json:"skills"`
	Installed   bool     `json:"installed"`
}

PackInfo describes an available capability pack.

func DiscoverAvailablePacks

func DiscoverAvailablePacks(rootDir string) []PackInfo

DiscoverAvailablePacks inspects both repository packs and central app data.

type ProjectDetails

type ProjectDetails struct {
	Assets           []MediaFile   `json:"assets,omitempty"`
	Artifacts        []MediaFile   `json:"artifacts,omitempty"`
	Slug             string        `json:"slug"`
	Name             string        `json:"name"`
	Path             string        `json:"path"`
	Engine           string        `json:"engine,omitempty"`
	LastModified     time.Time     `json:"last_modified"`
	Stages           StageStatuses `json:"stages"`
	Brief            string        `json:"brief,omitempty"`
	BriefPath        string        `json:"brief_path,omitempty"`
	BriefURL         string        `json:"brief_url,omitempty"`
	Script           string        `json:"script,omitempty"`
	ScriptPath       string        `json:"script_path,omitempty"`
	ScriptURL        string        `json:"script_url,omitempty"`
	Beats            []BeatItem    `json:"beats,omitempty"`
	Narration        []MediaFile   `json:"narration,omitempty"`
	ReviewFrames     []MediaFile   `json:"review_frames,omitempty"`
	QAFrames         []MediaFile   `json:"qa_frames,omitempty"`
	ReviewReport     any           `json:"review_report,omitempty"`
	ReviewReportPath string        `json:"review_report_path,omitempty"`
	ReviewReportURL  string        `json:"review_report_url,omitempty"`
	RemotionProps    any           `json:"remotion_props,omitempty"`
	CompositionPath  string        `json:"composition_path,omitempty"`
	CompositionURL   string        `json:"composition_url,omitempty"`
	VideoPath        string        `json:"video_path,omitempty"`
	VideoURL         string        `json:"video_url,omitempty"`
	PreviewVideoPath string        `json:"preview_video_path,omitempty"`
	PreviewVideoURL  string        `json:"preview_video_url,omitempty"`
	VideoVersion     string        `json:"video_version,omitempty"`
	ThumbnailPath    string        `json:"thumbnail_path,omitempty"`
	ThumbnailURL     string        `json:"thumbnail_url,omitempty"`
}

ProjectDetails provides deep inspection data for a project.

func GetProjectDetails

func GetProjectDetails(rootDir, slug string) (*ProjectDetails, error)

GetProjectDetails reads deep project artifacts and metadata.

type ProjectSummary

type ProjectSummary struct {
	Slug             string        `json:"slug"`
	Name             string        `json:"name"`
	Path             string        `json:"path"`
	Engine           string        `json:"engine,omitempty"`
	LastModified     time.Time     `json:"last_modified"`
	Stages           StageStatuses `json:"stages"`
	BriefPath        string        `json:"brief_path,omitempty"`
	BriefURL         string        `json:"brief_url,omitempty"`
	ScriptPath       string        `json:"script_path,omitempty"`
	ScriptURL        string        `json:"script_url,omitempty"`
	CompositionPath  string        `json:"composition_path,omitempty"`
	CompositionURL   string        `json:"composition_url,omitempty"`
	ThumbnailURL     string        `json:"thumbnail_url,omitempty"`
	VideoURL         string        `json:"video_url,omitempty"`
	PreviewVideoPath string        `json:"preview_video_path,omitempty"`
	PreviewVideoURL  string        `json:"preview_video_url,omitempty"`
	VideoVersion     string        `json:"video_version,omitempty"`
}

ProjectSummary provides lightweight metadata for list views.

func ListProjects

func ListProjects(rootDir string) ([]ProjectSummary, error)

ListProjects scans projects/ under rootDir and returns summaries.

func ListProjectsWithCatalog

func ListProjectsWithCatalog(rootDir string) ([]ProjectSummary, error)

ListProjectsWithCatalog scans rootDir projects and merges catalog projects.

type Server

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

Server coordinates the Studio web UI, REST API, and CLI session manager.

func NewServer

func NewServer(rootDir string) *Server

NewServer constructs a new Studio Server.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the underlying http.Handler for testing or mounting.

func (*Server) Run

func (s *Server) Run(addr string) error

Run starts the HTTP server listening on addr with auto-open.

func (*Server) RunWithOption

func (s *Server) RunWithOption(addr string, autoOpen bool) error

RunWithOption starts the HTTP server listening on addr or next open port.

type Session

type Session struct {
	ID       string
	NativeID string
	Dir      string
	Mode     string
	Engine   string
	// contains filtered or unexported fields
}

Session is a durable Studio conversation. Each turn uses a fresh CLI process or in-process native loop.

func (*Session) Close

func (s *Session) Close() error

Close invalidates the conversation, cancels its current process tree, and waits for runTurn (the sole owner of cmd.Wait) to confirm that it was reaped.

func (*Session) IsAlive

func (s *Session) IsAlive() bool

IsAlive reports whether the Studio conversation may accept and resume turns.

type StageStatuses

type StageStatuses struct {
	Brief       bool `json:"brief"`
	Script      bool `json:"script"`
	Voiceover   bool `json:"voiceover"`
	Composition bool `json:"composition"`
	Review      bool `json:"review"`
	Master      bool `json:"master"`
}

StageStatuses indicates which production stages are completed or active.

Directories

Path Synopsis
Package engine adapts EXTERNAL agentic CLIs (Claude Code, Codex, Copilot, OpenCode) into a normalized event stream.
Package engine adapts EXTERNAL agentic CLIs (Claude Code, Codex, Copilot, OpenCode) into a normalized event stream.

Jump to

Keyboard shortcuts

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