Help us shape the future of Go! Take the 2026 Go Developer Survey

vscode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeClient

type BridgeClient interface {
	ExecuteTask(ctx context.Context, task models.Task) error
	ExecuteWorkspace(ctx context.Context, workspace models.Workspace) error
}

BridgeClient is the interface for sending tasks and workspaces to the VSCode bridge. *client.Client satisfies this interface.

type BridgeInfo

type BridgeInfo struct {
	Port          int       `json:"port"`
	PID           int       `json:"pid"`
	InstanceID    int64     `json:"instance_id"`
	WorkspacePath string    `json:"workspace_path"`
	WorkspaceName string    `json:"workspace_name"`
	Timestamp     time.Time `json:"timestamp"`
	AuthToken     string    `json:"auth_token"`
	Secure        bool      `json:"secure"`
}

func DiscoverBridge

func DiscoverBridge() (*BridgeInfo, error)

DiscoverBridge finds the correct bridge instance, preferring the most precise signal available: the per-window VSTR env var, then the parent VSCode process, then a scan of the bridge directory. The env path trusts the window-scoped VSTR_TOKEN directly when present; the process-tree and scan paths validate each candidate file via validateBridgeFile.

type ProcessInspector

type ProcessInspector interface {
	Getppid() int
	NewProcess(pid int32) (ProcessNode, error)
}

ProcessInspector creates a ProcessNode for a given PID and returns the parent PID.

type ProcessNode

type ProcessNode interface {
	Name() (string, error)
	Cmdline() (string, error)
	Parent() (ProcessNode, error)
	PID() int32
}

ProcessNode represents a single OS process in a traversable tree. Tests supply an in-memory fake; production uses gopsutilProcessNode.

type Runner

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

Runner orchestrates execution of tasks in VSCode terminals via the authenticated bridge

func NewRunner

func NewRunner() (*Runner, error)

NewRunner creates a new runner instance connected to the VSCode bridge. It discovers the bridge, creates a real client, and wires the production repositories.

func NewRunnerWithDeps

func NewRunnerWithDeps(deps RunnerDeps) *Runner

NewRunnerWithDeps creates a Runner with fully injected dependencies. Use this constructor in tests to supply fakes for any dependency.

func (*Runner) RunTask

func (r *Runner) RunTask(taskName string) error

RunTask executes a single task in a new VSCode terminal

func (*Runner) RunWorkspace

func (r *Runner) RunWorkspace(workspaceName string) error

RunWorkspace executes all tasks in a workspace

type RunnerDeps

type RunnerDeps struct {
	Client     BridgeClient
	Tasks      TaskRepository
	Workspaces WorkspaceRepository
}

RunnerDeps groups the injectable dependencies for NewRunnerWithDeps.

type TaskRepository

type TaskRepository interface {
	FindByName(name string) (*models.Task, error)
}

TaskRepository is the interface for looking up a single task by name.

type VSCodeInstance

type VSCodeInstance struct {
	PID           int32
	Name          string
	WorkspacePath string
}

VSCodeInstance represents a running VSCode process (minimal version)

type WorkspaceRepository

type WorkspaceRepository interface {
	FindByName(name string) (*models.Workspace, error)
}

WorkspaceRepository is the interface for looking up a single workspace by name.

Jump to

Keyboard shortcuts

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