paneauto

package
v0.16.521 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 8 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 paneauto opens in the right pane what the agent of a conversation works on, without being asked: a design of the machine's library whose files it writes, a document it publishes or a board it draws on the workspace's portal. It reads the conversation's finished tool calls and keeps a pane intent for the thing (the same intents `open` keeps), once per conversation: the next edit of a design changes nothing (its board updates by itself), the next publication of a document asks a tab that shows it to reload. Conservative on purpose: only the pane's own apps, only what a successful call names.

What opens the pane by itself (docs/pane-opening.md); the intents this package keeps are Auto, and the page places an Auto intent behind, with a dot, without bringing the pane out:

trigger                                        intent             the page
the agent's `open` (layoutapi cliPanel)        open               in front, the pane comes out (not on a phone)
the same `open` within RepeatWindow            none (Repeated)    nothing
a design file the agent writes                 open, auto         behind, the pane stays as it is
a document or board it publishes               open, auto         behind, the pane stays as it is
the same document published again              open, auto, reload the tab that shows it reloads
its browser tool (chrome_*)                    open, auto         behind, the pane stays as it is
a file it hands over (OpenOnce)                open, auto         behind, the pane stays as it is
an address in its answer                       none               a chip in the text; opens on its click

Index

Constants

View Source
const (
	// Fresh: a call older than this is history read again (a restart, a transcript found late), not work going on.
	Fresh = 10 * time.Minute
	// ReloadEvery: a document published again within this of the last reload asks no other.
	ReloadEvery = 15 * time.Second
)
View Source
const RepeatWindow = 10 * time.Minute

RepeatWindow: the agent's `open` of the very thing it asked for within this is not asked again. Each address opens once: an agent that names the same document in every reply, or runs `open` for it twice, does not throw the pane at the person again. After it, an `open` acts again: the person may have asked to see it once more.

Variables

This section is empty.

Functions

func AskedFile

func AskedFile(intents *paneintents.Store, tabID, path string) bool

AskedFile: the conversation's pane was asked to show the file at this absolute path, as a file (`open files`, a hand-over, file_show) or as the design it is a board of. Only what the agent itself pointed at counts: a file it showed opens to read although it lies outside the chat's folder.

func IsBrowserTool added in v0.16.154

func IsBrowserTool(tool string, servers ...string) bool

IsBrowserTool recognizes runtime browser tools in Claude MCP names and Codex's normalized code-mode names. Optional server names follow RUNTIME_MCP_SERVER.

func OpenOnce added in v0.16.5

func OpenOnce(intents *paneintents.Store, tabID, tab, target string) bool

OpenOnce asks the conversation's pane to open a tab on a target, unless the conversation was asked for the very thing already (within the intents' lifetime): the way a handed-over file opens, once, as `open` does. It returns whether it kept an intent, which the caller tells the pages of.

func Repeated

func Repeated(intents *paneintents.Store, tabID string, c panel.Command, now time.Time) string

Repeated is the id of an earlier `open` of the same tab, target and place the conversation's pane was asked for within RepeatWindow, "" for none. Reloads and `show` are never repeats.

Types

type Env

type Env struct {
	// Browser enables the managed browser pane; BrowserServer names the runtime MCP server.
	Browser       bool
	BrowserServer string
	// Targets classifies the links a call names, by the rules of `open`.
	Targets panel.Targets
	// ObjectLink recognizes a published address declared by an installed pane view.
	ObjectLink func(address string) bool
	// DesignOf is the design of the library an absolute path lies in, "" for none; nil: the machine has no library.
	DesignOf func(path string) string
	// Intents keeps what the pane is asked; TabOf is the layout tab of a conversation, whose pane it is ("" for none).
	Intents *paneintents.Store
	TabOf   func(conv string) string
	// Changed is told of a tab whose intents changed (the sync socket's "pane-intents").
	Changed func(tabID string)
	Now     func() time.Time
}

Env is what the watcher reads and writes.

type Found

type Found struct {
	Tab, Target string
	// Reloadable: a later call on it reloads the tab that shows it (a document published again).
	Reloadable bool
}

Found is a thing of the pane a call worked on.

func Detect

func Detect(e wire.Entry, env Env) []Found

Detect opens the browser as soon as its tool starts, including calls waiting for a login. Other panes require a successful result because their target may not exist before completion.

type Watcher

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

Watcher keeps the intents of what the conversations' agents work on.

func New

func New(env Env) *Watcher

New is a watcher over env.

func (*Watcher) Entry

func (w *Watcher) Entry(conv string, e wire.Entry) bool

Entry looks at an entry of a conversation as it is published; it returns whether it kept an intent.

Jump to

Keyboard shortcuts

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