assistant

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Author: HyperparameterSI

Author: HyperparameterSI

Author: HyperparameterSI

Author: HyperparameterSI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, b *chromium.Browser, tab int, page Page, action Action) error

Apply rechecks the exact page URL and element label before performing a fixed action. It never evaluates model-provided code or accepts a model selector.

Types

type Action

type Action struct {
	Kind    string `json:"kind"`
	Element int    `json:"element"`
	Value   string `json:"value,omitempty"`
}

Action is a proposed operation. Execute only after user review of this exact action.

type Answer

type Answer struct {
	Reply   string   `json:"reply"`
	Actions []Action `json:"actions"`
}

type Element

type Element struct {
	ID    int    `json:"id"`
	Role  string `json:"role"`
	Label string `json:"label"`
}

type Extension

type Extension struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Origins     []string `json:"origins"`
	Script      string   `json:"-"`
}

Extension is a manually invoked user script with explicit exact-origin grants. It is separate from Chrome Manifest V3 extensions and has no chrome.* APIs.

func LoadExtension

func LoadExtension(dir string) (Extension, error)

func (Extension) Run

func (e Extension) Run(ctx context.Context, b *chromium.Browser, tab int) error

type Page

type Page struct {
	URL      string    `json:"url"`
	Title    string    `json:"title"`
	Text     string    `json:"text"`
	Elements []Element `json:"elements"`
}

Page is an explicit, bounded snapshot. Form values and password fields are excluded.

func Snapshot

func Snapshot(ctx context.Context, b *chromium.Browser, tab int) (Page, error)

type Provider

type Provider struct {
	Endpoint, APIKey, Model string
	Client                  *http.Client
}

Provider uses a Chat Completions compatible endpoint, including local models. Credentials remain in Go and are never returned to the assistant frontend.

func (Provider) Ask

func (p Provider) Ask(ctx context.Context, question string, page *Page) (Answer, error)

type Server

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

Server serves the local assistant with a per-launch bearer token, no CORS, and no credentials or browser bridge exposed to ordinary web pages.

func Start

func Start(assets fs.FS, p Provider, extensions []Extension) (*Server, error)

func (*Server) Bind

func (s *Server) Bind(b *chromium.Browser)

func (*Server) Close

func (s *Server) Close() error

func (*Server) URL

func (s *Server) URL() string

Jump to

Keyboard shortcuts

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