Versions in this module Expand all Collapse all v0 v0.704.1 Sep 8, 2026 v0.703.4 Sep 7, 2026 Changes in this version + func AutoOpenTarget(ctx context.Context, sessionID, artifactID string) (key, url string, err error) + func Brief() string + func CanvasArtboards(sessionID string) ([]preview.Artboard, error) + func CanvasPresentation(sessionID string) (string, error) + func PromptBrief() string type Service + func (s *Service) Artboards(ctx context.Context, server *preview.Server, sessionID string) ([]preview.Artboard, error) v0.700.1 Sep 1, 2026 v0.700.0 Aug 31, 2026 Changes in this version + const DefaultSlideSelector + const EventCreated + const EventCritique + const EventRender + const EventVersion + const ExportHTML + const ExportPDF + const ExportPNG + const ManifestName + const OpAddClass + const OpInsertHTML + const OpRemove + const OpRemoveAttr + const OpRemoveClass + const OpReplaceHTML + const OpSetAttr + const OpSetHTML + const OpSetStyle + const OpSetText + const PolicyNone + const PolicyStandard + const PolicyStrict + const PositionAfter + const PositionAppend + const PositionBefore + const PositionPrepend + const RuleConsoleError + const RuleContrast + const RuleControlName + const RuleDeckNoSlides + const RuleDeckPageBreak + const RuleDocumentTitle + const RuleEmptyDocument + const RuleHeadingOrder + const RuleHorizontalOverflow + const RuleImageAlt + const RuleMissingH1 + const RuleNetworkFailure + const RuleSystemHardcoded + const RuleSystemUnlinked + const RuleTapTarget + const SeverityBlocking + const SeverityError + const SeverityInfo + const SeverityWarning + const SystemContractFile + const SystemStylesheet + const SystemTokensFile + var DefaultStyleProps = []string + var DefaultViewport = Viewport + var ErrBundleInstalled = errors.New("design: template already installed") + var ErrNoBrowser = fmt.Errorf("design: no browser available") + var ErrNoIndex = errors.New("design: no structure index") + var ErrNoProvider = errors.New("design: the design subsystem is not available in this process") + var ErrNotFound = errors.New("design: not found") + var ErrSchemaOutdated = errors.New(...) + func BlendScore(audited, written float64) float64 + func BundledTemplateContent(name string) (string, bool) + func CloseDefaultProvider() + func ClosePreviewServer() + func ContrastRatio(foreground, background RGB) float64 + func CountsBySeverity(issues []Issue) map[string]int + func CraftReference(name string) (string, bool) + func CraftReferenceNames() []string + func EnsurePreviewServer() (*preview.Server, error) + func Events() *pubsub.Broker[Event] + func ExampleSystem(name string) (string, bool) + func ExampleSystemNames() []string + func ExampleSystemTitle(name string) string + func InstallBundle(name, targetDir string, force bool) ([]string, error) + func MirrorPath(name string) string + func NewArtifactID() string + func NewCritiqueID() string + func NormalizePolicy(policy string) string + func ParseSelectionURI(uri string) (string, bool) + func PreviewOptions(baseURL func() string, access func() error) preview.Options + func PreviewServer() *preview.Server + func PromptConstraints() string + func RuleCodes(issues []Issue) []string + func Scaffold(name, title string) (map[string]string, error) + func SelectionURI(nodeID string) string + func SetDefaultProvider(p *Provider) + func SetPreviewServer(s *preview.Server) + func Slugify(title string) string + func SortedTokenGroups(tokens map[string]map[string]string) []string + func SortedTokenNames(values map[string]string) []string + func ValidKind(k Kind) bool + func WriteManifest(absDir string, m Manifest) error + type ApplyResult struct + ArtifactID string + Entry string + Findings []SystemFinding + Linked bool + Scanned int + Stylesheet string + System string + Truncated bool + type Artifact struct + CreatedAt time.Time + CurrentVersion int + DesignSystemID string + Dir string + ID string + Kind Kind + ProjectID string + SessionID string + SkillID string + Slug string + Title string + UpdatedAt time.Time + type AuditInput struct + Breaks []SlideBreak + Console []ConsoleEntry + Facts []NodeFacts + Failures []NetworkFailure + Kind Kind + Nodes []Node + Rendered bool + RequiresSystem bool + Slides int + SystemFindings []SystemFinding + SystemLinked bool + Title string + Viewport Viewport + Width float64 + type AuditResult struct + Counts map[string]int + Issues []Issue + Score float64 + Summary string + func Audit(in AuditInput) AuditResult + type BrowserAutoOpener struct + func NewBrowserAutoOpener() *BrowserAutoOpener + func (o *BrowserAutoOpener) Open(artifactID, url string) error + type BrowserOptions struct + Executable string + Headless bool + IdleTimeout time.Duration + Type string + func BrowserOptionsFromConfig() BrowserOptions + type ConsoleEntry struct + Level string + Message string + type CreateParams struct + DesignSystem string + Entry string + Files map[string]string + Kind Kind + ProjectID string + SkillID string + Slug string + Title string + type Critique struct + ArtifactID string + CreatedAt time.Time + ID string + Issues []Issue + Score float64 + Summary string + Version int + type CritiqueOptions struct + Issues []Issue + Policy string + Record bool + Render RenderOptions + Round int + Score float64 + SkipRender bool + Summary string + Version int + type CritiqueReport struct + Artifact Artifact + Audit AuditResult + Critique Critique + Decision GateDecision + Recorded bool + RenderError string + Rendered bool + Settings CritiqueSettings + Version int + type CritiqueSettings struct + Enabled bool + MaxRounds int + Policy string + Threshold float64 + func DefaultCritiqueSettings() CritiqueSettings + func (s CritiqueSettings) Gate(c Critique, round int) GateDecision + func (s CritiqueSettings) WithPolicy(policy string) CritiqueSettings + type DeckSpec struct + Navigation string + Slides int + type DesignSystem struct + Fonts []string + Name string + Tokens map[string]map[string]string + func DefaultDesignSystem() DesignSystem + func LoadSystemAt(layout Layout) (DesignSystem, bool, error) + func (ds DesignSystem) CSS() string + func (ds DesignSystem) ConstraintBlock(stylesheetPath, contractPath string) string + func (ds DesignSystem) Contract() string + func (ds DesignSystem) TokenSection() string + type ErrAmbiguousRef struct + Artifacts []Artifact + Ref string + func (e *ErrAmbiguousRef) Error() string + type Event struct + ArtifactID string + ArtifactKind Kind + At time.Time + Kind string + Nodes int + Score float64 + SessionID string + Slides int + Slug string + Summary string + Title string + URL string + Version int + type ExportOptions struct + Dest string + Format string + FullPage bool + Landscape bool + Slide int + Viewport Viewport + type ExportResult struct + Bytes int + Format string + Note string + Path string + type ExtractOptions struct + MaxFiles int + Name string + Source ExtractSource + Target string + type ExtractResult struct + Notes []string + Scanned []string + Source ExtractSource + System DesignSystem + Target string + type ExtractSource string + const SourceCode + const SourceImage + const SourceText + const SourceURL + type GateDecision struct + Blocking int + Iterate bool + MaxRounds int + Pass bool + Policy string + Reason string + Round int + Score float64 + Threshold float64 + type ImageDiff struct + Changed int + Fraction float64 + Height int + MaxDelta int + SizeMismatch bool + Total int + Width int + func ComparePNG(before, after []byte, tolerance int) (ImageDiff, error) + type InspectOptions struct + Depth int + IncludeStyles bool + Limit int + MaxTextLen int + NodeID string + Offset int + Selector string + Slide int + StyleProps []string + Text string + type InspectResult struct + ArtifactID string + Limit int + NextOffset int + Nodes []Node + Offset int + Total int + Version int + func Inspect(nodes []Node, opts InspectOptions) InspectResult + func (r InspectResult) Text() string + type Issue struct + Code string + Fix string + Message string + NodeID string + Severity string + Slide int + func MergeIssues(audited, written []Issue) []Issue + type Kind string + const KindDeck + const KindWeb + type Layout struct + OutputDir string + SystemDir string + WorkingDir string + func NewLayout(workingDir, outputDir, systemDir string) Layout + func (l Layout) AbsDir(relDir string) (string, error) + func (l Layout) AvailableSlug(title string) (string, error) + func (l Layout) EnsureRoot() error + func (l Layout) RelDir(slug string) string + func (l Layout) Root() string + func (l Layout) SystemPath() string + type Manifest struct + Deck *DeckSpec + DesignSystem string + Entry string + ID string + Kind Kind + Preview PreviewSpec + Skill string + Title string + Version int + func NewManifest(id string, kind Kind, title string) Manifest + func ReadManifest(absDir string) (Manifest, error) + func (m *Manifest) Normalize() + type NetworkFailure struct + Error string + Status int + URL string + type Node struct + ArtifactID string + Box Rect + NodeID string + ParentID string + Role string + Selector string + Slide int + Styles map[string]string + Text string + Version int + type NodeFacts struct + AltPresent bool + AriaHidden bool + Background string + Box Rect + Color string + FontSize float64 + FontWeight int + HasText bool + HeadingLevel int + Interactive bool + Name string + NodeID string + Slide int + Tag string + type PatchChange struct + Detail string + Matches int + Op string + Selector string + func ApplyPatch(src []byte, ops []PatchOp) ([]byte, []PatchChange, error) + type PatchFilePlan struct + Changes []PatchChange + New string + Old string + Path string + RelPath string + func (p PatchFilePlan) Diff() (string, int, int) + type PatchOp struct + All bool + Attr string + Class string + File string + HTML string + NodeID string + Op string + Position string + Selector string + Style map[string]string + Value string + type PatchPlan struct + Artifact Artifact + Files []PatchFilePlan + func (p *PatchPlan) Empty() bool + type Presentation struct + ArtifactID string + BridgeURL string + Dir string + Entry string + FileURL string + Kind Kind + Selection string + Slide int + Slides int + Title string + URL string + Version int + func ResolveCreatedArtifactPresentation(ctx context.Context, artifactID string) (Presentation, error) + type PreviewSpec struct + Viewport Viewport + type PrintOptions struct + Landscape bool + NoBackground bool + PaperHeight float64 + PaperWidth float64 + type Provider struct + func DefaultProvider() *Provider + func NewProvider(db *sql.DB) (*Provider, error) + func NewProviderWith(db *sql.DB, snaps Snapshotter) *Provider + func (p *Provider) Close() + func (p *Provider) Service(sessionID string) *Service + func (p *Provider) SetMirror(m SystemMirror) + type RGB struct + A float64 + B float64 + G float64 + R float64 + func ParseCSSColor(value string) (RGB, bool) + type Rect struct + H float64 + W float64 + X float64 + Y float64 + type RenderOptions struct + MaxDepth int + MaxNodes int + PrintMedia bool + SlideSelector string + StyleProps []string + URL string + Viewport Viewport + Wait time.Duration + type RenderResult struct + Console []ConsoleEntry + Facts []NodeFacts + Failures []NetworkFailure + Height float64 + Nodes []Node + Slides int + Title string + Truncated bool + URL string + Viewport Viewport + Width float64 + type Renderer struct + func NewRenderer(layout Layout, opts BrowserOptions) *Renderer + func (r *Renderer) Available() bool + func (r *Renderer) Close() + func (r *Renderer) EntryURL(a Artifact) (string, error) + func (r *Renderer) PrintPDF(ctx context.Context, a Artifact, opts PrintOptions) ([]byte, error) + func (r *Renderer) Rasterize(ctx context.Context, html string, width, height int, wait time.Duration) ([]byte, error) + func (r *Renderer) Render(ctx context.Context, a Artifact, opts RenderOptions) (RenderResult, error) + func (r *Renderer) Screenshot(ctx context.Context, a Artifact, opts ScreenshotOptions) ([]byte, error) + func (r *Renderer) SlideBreaks(ctx context.Context, a Artifact, opts RenderOptions) ([]SlideBreak, error) + type ScreenshotOptions struct + FullPage bool + Quality int + Selector string + Slide int + type Service struct + func NewService(store *Store, snaps Snapshotter, layout Layout, sessionID string) *Service + func NewServiceFromConfig(db *sql.DB, snaps Snapshotter, sessionID string) *Service + func ServiceFor(sessionID string) (*Service, error) + func (s *Service) AbsDir(a Artifact) (string, error) + func (s *Service) ApplyPatchPlan(ctx context.Context, plan *PatchPlan, summary string, commit bool) (int, error) + func (s *Service) ApplySystem(ctx context.Context, artifactID string) (ApplyResult, error) + func (s *Service) Checkout(ctx context.Context, artifactID string, number int) error + func (s *Service) CommitVersion(ctx context.Context, artifactID, summary string) (Version, error) + func (s *Service) ContractPath() string + func (s *Service) Create(ctx context.Context, p CreateParams) (Artifact, error) + func (s *Service) Critique(ctx context.Context, artifactID string, opts CritiqueOptions) (CritiqueReport, error) + func (s *Service) CritiqueSettingsFor(skillID string) CritiqueSettings + func (s *Service) Delete(ctx context.Context, artifactID string) error + func (s *Service) Diff(ctx context.Context, artifactID string, from, to int) ([]snapshot.DiffEntry, error) + func (s *Service) Export(ctx context.Context, artifactID string, opts ExportOptions) (ExportResult, error) + func (s *Service) ExtractSystem(ctx context.Context, opts ExtractOptions) (ExtractResult, error) + func (s *Service) Get(ctx context.Context, id string) (Artifact, error) + func (s *Service) Inspect(ctx context.Context, artifactID string, version int, opts InspectOptions) (InspectResult, error) + func (s *Service) LatestCritique(ctx context.Context, artifactID string, version int) (Critique, error) + func (s *Service) Layout() Layout + func (s *Service) List(ctx context.Context, sessionOnly bool) ([]Artifact, error) + func (s *Service) LiveURL(ctx context.Context, artifactID string, slide int) (Presentation, error) + func (s *Service) LoadSystem() (DesignSystem, bool, error) + func (s *Service) MirrorSystem(ctx context.Context, ds DesignSystem, source ExtractSource, target string) (string, error) + func (s *Service) Node(ctx context.Context, artifactID string, version int, nodeID string) (Node, error) + func (s *Service) Patch(ctx context.Context, artifactID string, ops []PatchOp, summary string, ...) (*PatchPlan, int, error) + func (s *Service) PreparePatch(ctx context.Context, artifactID string, ops []PatchOp) (*PatchPlan, error) + func (s *Service) Presentation(ctx context.Context, artifactID string, slide int, nodeID string) (Presentation, error) + func (s *Service) PublishPreview(ctx context.Context, artifactID string) (preview.Grant, error) + func (s *Service) Render(ctx context.Context, artifactID string, opts RenderOptions) (RenderResult, error) + func (s *Service) Renderer() *Renderer + func (s *Service) Resolve(ctx context.Context, ref string) (Artifact, error) + func (s *Service) SaveSystem(ds DesignSystem) (string, string, error) + func (s *Service) SetSystemTokens(name string, updates map[string]map[string]string) (DesignSystem, error) + func (s *Service) Store() *Store + func (s *Service) SystemRelPath(file string) string + func (s *Service) Versions(ctx context.Context, artifactID string) ([]Version, error) + func (s *Service) WithMirror(m SystemMirror) *Service + func (s *Service) WithRenderer(r *Renderer) *Service + func (s *Service) WriteWorkspaceFile(rel string, data []byte) (string, error) + type SlideBreak struct + BreakAfter string + Height float64 + Index int + type Snapshotter interface + Compare func(ctx context.Context, snapshotID1, snapshotID2 string) ([]snapshot.DiffEntry, error) + CreateScoped func(ctx context.Context, sessionID, description, rootDir string) (snapshot.Snapshot, error) + RevertScoped func(ctx context.Context, snapshotID string) error + type Store struct + func NewStore(db *sql.DB) *Store + func (s *Store) AddCritique(ctx context.Context, c Critique) (Critique, error) + func (s *Store) AddVersion(ctx context.Context, v Version) error + func (s *Store) CreateArtifact(ctx context.Context, a Artifact) (Artifact, error) + func (s *Store) DeleteArtifact(ctx context.Context, id string) error + func (s *Store) GetArtifact(ctx context.Context, id string) (Artifact, error) + func (s *Store) GetArtifactByDir(ctx context.Context, dir string) (Artifact, error) + func (s *Store) GetNode(ctx context.Context, artifactID string, version int, nodeID string) (Node, error) + func (s *Store) GetVersion(ctx context.Context, artifactID string, number int) (Version, error) + func (s *Store) LatestCritique(ctx context.Context, artifactID string, version int) (Critique, error) + func (s *Store) ListArtifacts(ctx context.Context, sessionID string) ([]Artifact, error) + func (s *Store) ListNodes(ctx context.Context, artifactID string, version, slide int) ([]Node, error) + func (s *Store) ListVersions(ctx context.Context, artifactID string) ([]Version, error) + func (s *Store) ReplaceNodes(ctx context.Context, artifactID string, version int, nodes []Node) error + func (s *Store) SetCurrentVersion(ctx context.Context, artifactID string, number int) error + func (s *Store) UpdateArtifact(ctx context.Context, a Artifact) error + type SystemFinding struct + File string + Line int + Property string + Token string + Value string + type SystemMirror interface + AddDocument func(ctx context.Context, filePath, content string, metadata map[string]interface{}) error + type Template struct + Category string + Craft []string + CritiquePolicy string + Description string + ExamplePrompt string + Installed bool + Kind Kind + Mode string + Name string + Preview string + RequiresSystem bool + Scenario string + Source TemplateSource + SourcePath string + Startable bool + Viewport Viewport + func BundledTemplate(name string) (Template, bool) + func BundledTemplates() ([]Template, error) + func Gallery(discovered []Template) []Template + func TemplateFromSkill(name, description string, meta *od.Metadata) (Template, bool) + type TemplateSource string + const SourceBundled + const SourceInstalled + type Version struct + ArtifactID string + CreatedAt time.Time + Critique *Critique + Number int + SnapshotID string + Summary string + type Viewport struct + H int + W int