browserinstance

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package browserinstance manages persistent Chromium browser profiles for web-mode panes. Profiles live in the project-local <workDir>/.rysh/browser-instances/ directory (sibling to rysh.config.yaml), alongside .rysh/mcp.json and .rysh/forge/. Unlike the rest of .rysh, this directory is exempt from session-delete cleanup so logged-in browser sessions survive workspace/session deletion.

rysh-cli does not render a browser; it only owns the on-disk profile directory and a small registry. The desktop app (rysh-cli-app) points its Chromium session storage at <workDir>/.rysh/browser-instances/ and uses the profile name as a persistent partition.

Index

Constants

View Source
const DefaultProfile = "default"

DefaultProfile is the profile name used when none is given to ##mode new web.

Variables

This section is empty.

Functions

func EnsureProfile

func EnsureProfile(workDir, profile string) (string, error)

EnsureProfile creates <workDir>/.rysh/browser-instances/<profile>/ (if absent) and records it in the registry. It returns the absolute profile directory.

func ProfileDir

func ProfileDir(workDir, profile string) string

ProfileDir returns the on-disk directory for a single (sanitized) profile.

func RootDir

func RootDir(workDir string) string

RootDir returns the browser-instances root for a project rooted at workDir: <workDir>/.rysh/browser-instances.

func SanitizeProfile

func SanitizeProfile(name string) string

SanitizeProfile reduces a user-supplied profile name to a single safe path segment: path separators, "..", and surrounding dots/spaces are stripped so a profile can never escape RootDir. An empty result falls back to DefaultProfile.

Types

type Profile

type Profile struct {
	Name      string `json:"name"`
	CreatedMs int64  `json:"created_ms"`
}

Profile is a persisted browser-profile record (the on-disk session data lives in the sibling directory of the same name).

func LoadRegistry

func LoadRegistry(workDir string) ([]Profile, error)

LoadRegistry reads the known-profiles registry. A missing file yields an empty slice with no error.

Jump to

Keyboard shortcuts

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