androidagent

package
v1.5.153 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 19 Imported by: 0 modules, 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

Package androidagent assembles the experimental in-process Android tool set. It is separate from desktop tool wiring: constructing it requires an Android host to provide the actual per-call authorization gate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	Ripgrep string
	Shell   string
	Grep    string
	Find    string
}

Capabilities describe executable paths found at construction, not a promise that a subsequent call will be authorized or that execution will succeed.

type Config

type Config struct {
	Root           string
	Permissions    *permissions.State
	BeforeToolCall agentcore.BeforeToolCallFunc
	// NoShell omits bash/write_stdin even when /system/bin/sh exists. A host
	// that has not built a command sandbox yet can still offer the file tools;
	// the prompt then says shell is unavailable instead of advertising a tool
	// the catalog does not contain.
	NoShell bool
	// NoGit omits the structured Git tool. The tool is local by default and
	// gates clone/fetch/push on the host's per-call network grant.
	NoGit          bool
	GitAuthorName  string
	GitAuthorEmail string
	GitToken       string
	// AndroidUseEndpoint is the app-private endpoint file exposed by the
	// Kotlin AccessibilityService host. Empty means AndroidUse is not authorized.
	AndroidUseEndpoint string
	// AndroidUsePhase2 enables the separate high-privilege background-display
	// surface. It must be explicitly consented to by the user.
	AndroidUsePhase2 bool
	// SearchEnv supplies web-search credentials (TAVILY_API_KEY / EXA_API_KEY).
	// Nil falls back to os.Getenv; the Android host passes its own encrypted
	// store so keys never enter the process environment.
	SearchEnv func(string) string
}

Config is supplied by the Android host, not by the model. BeforeToolCall must be the host's actual authorization gate; the tool set never manufactures an unconfined-execution grant. A nil Permissions selects auto mode.

type Toolset

type Toolset struct {
	Tools        []agentcore.AgentTool
	Batch        agenttool.BatchConfig
	Permissions  *permissions.State
	Capabilities Capabilities
	Root         string
	// contains filtered or unexported fields
}

Toolset carries one matched catalog, prompt and execution gate. A caller must pass Batch to the agent loop and Tools to the model context together.

func New

func New(cfg Config) (*Toolset, error)

New builds the Android catalog using the current app process's executable paths. It refuses other platforms rather than changing their existing wiring.

func (*Toolset) Close

func (s *Toolset) Close()

Close stops commands launched by this tool set when the host ends the run.

func (*Toolset) Prompt

func (s *Toolset) Prompt() string

Prompt is intentionally Android-specific: the desktop prompt's OS-sandbox claims are not true of a shell running under only the Android App sandbox. This is an embedding prototype; host-provided instructions may be appended.

Jump to

Keyboard shortcuts

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