browser

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package browser provides browser automation for Aha operations not available via API.

Index

Constants

This section is empty.

Variables

View Source
var PredefinedTemplates = map[string]TemplateConfig{
	"capability-stack": {
		Name:        "Capability Stack",
		Description: "Layered capability model for product/platform planning",
		Rows:        4,
		Columns:     1,
		Blocks: []TemplateBlock{
			{Name: "Experience Layer", Description: "User-facing capabilities and interfaces", Row: 0, Column: 0},
			{Name: "Application Layer", Description: "Business logic and application services", Row: 1, Column: 0},
			{Name: "Platform Layer", Description: "Shared platform capabilities and APIs", Row: 2, Column: 0},
			{Name: "Infrastructure Layer", Description: "Infrastructure and foundational services", Row: 3, Column: 0},
		},
	},
	"maturity-model": {
		Name:        "Maturity Model",
		Description: "Capability maturity assessment grid",
		Rows:        5,
		Columns:     5,
		Blocks: []TemplateBlock{

			{Name: "Domain", Description: "Capability domain", Row: 0, Column: 0},
			{Name: "M1 - Initial", Description: "Ad-hoc, reactive", Row: 0, Column: 1},
			{Name: "M2 - Managed", Description: "Documented, repeatable", Row: 0, Column: 2},
			{Name: "M3 - Defined", Description: "Standardized, proactive", Row: 0, Column: 3},
			{Name: "M4 - Measured", Description: "Quantified, controlled", Row: 0, Column: 4},
		},
	},
	"opportunity-patton": {
		Name:        "Opportunity Canvas (Patton)",
		Description: "Jeff Patton's 10-block opportunity assessment",
		Rows:        3,
		Columns:     3,
		Blocks: []TemplateBlock{

			{Name: "Problems", Description: "What problems are we solving?", Row: 0, Column: 0},
			{Name: "Users", Description: "Who has these problems?", Row: 0, Column: 1},
			{Name: "Current Solutions", Description: "How do they solve it today?", Row: 0, Column: 2},

			{Name: "Value Proposition", Description: "What's our unique solution?", Row: 1, Column: 0},
			{Name: "User Value", Description: "What value do users get?", Row: 1, Column: 1},
			{Name: "Business Value", Description: "What value does the business get?", Row: 1, Column: 2},

			{Name: "Assumptions", Description: "What must be true?", Row: 2, Column: 0},
			{Name: "Risks", Description: "What could go wrong?", Row: 2, Column: 1},
			{Name: "Budget/Timeline", Description: "What resources are needed?", Row: 2, Column: 2},
		},
	},
	"feature-canvas": {
		Name:        "Feature Canvas (Efimov)",
		Description: "Nikita Efimov's feature planning canvas",
		Rows:        4,
		Columns:     2,
		Blocks: []TemplateBlock{
			{Name: "Idea Statement", Description: "One-sentence feature description", Row: 0, Column: 0, ColSpan: 2},

			{Name: "Situations", Description: "When/where does the problem occur?", Row: 1, Column: 0},
			{Name: "Problems", Description: "What specific problems exist?", Row: 2, Column: 0},
			{Name: "Value", Description: "What value does solving this provide?", Row: 3, Column: 0},

			{Name: "Capabilities", Description: "What must the solution do?", Row: 1, Column: 1},
			{Name: "Restrictions", Description: "What constraints exist?", Row: 2, Column: 1},
			{Name: "Limitations", Description: "What's out of scope?", Row: 3, Column: 1},
		},
	},
}

PredefinedTemplates contains common canvas template configurations.

Functions

func ListPredefinedTemplates

func ListPredefinedTemplates() []string

ListPredefinedTemplates returns the names of all predefined templates.

Types

type Client

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

Client wraps rod browser for Aha automation.

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient creates a new browser automation client. It reads configuration from environment variables if not provided via options:

  • AHA_SUBDOMAIN: Aha account subdomain
  • AHA_EMAIL: Aha login email
  • AHA_PASSWORD: Aha login password

func (*Client) BaseURL

func (c *Client) BaseURL() string

BaseURL returns the Aha base URL for the configured subdomain.

func (*Client) Browser

func (c *Client) Browser() *rod.Browser

Browser returns the underlying rod browser for advanced operations.

func (*Client) Close

func (c *Client) Close() error

Close closes the browser connection.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

Connect launches the browser and establishes a connection.

func (*Client) CreatePredefinedTemplate

func (c *Client) CreatePredefinedTemplate(ctx context.Context, templateName string) error

CreatePredefinedTemplate creates one of the predefined templates.

func (*Client) CreateTemplate

func (c *Client) CreateTemplate(ctx context.Context, config TemplateConfig) error

CreateTemplate creates a new strategic model template in Aha via browser automation. This requires the user to be logged in first.

func (*Client) Login

func (c *Client) Login(ctx context.Context) error

Login authenticates with Aha using email and password.

func (*Client) Page

func (c *Client) Page() *rod.Page

Page returns the current page for advanced operations.

type Option

type Option func(*Client)

Option configures the browser client.

func WithCredentials

func WithCredentials(email, password string) Option

WithCredentials sets email and password for authentication.

func WithHeadless

func WithHeadless(headless bool) Option

WithHeadless sets whether to run browser in headless mode.

func WithSubdomain

func WithSubdomain(subdomain string) Option

WithSubdomain sets the Aha subdomain.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the default timeout for operations.

type TemplateBlock

type TemplateBlock struct {
	Name        string // Block name/label
	Description string // Block description/placeholder text
	Row         int    // Row position (0-indexed)
	Column      int    // Column position (0-indexed)
	RowSpan     int    // Number of rows to span (default 1)
	ColSpan     int    // Number of columns to span (default 1)
}

TemplateBlock defines a block in a strategic model template.

type TemplateConfig

type TemplateConfig struct {
	Name        string          // Template name
	Description string          // Template description
	Rows        int             // Number of rows in grid
	Columns     int             // Number of columns in grid
	Blocks      []TemplateBlock // Block definitions
}

TemplateConfig defines a strategic model template configuration.

Jump to

Keyboard shortcuts

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