node

package
v0.2.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 101 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRestoredProfile

func CheckRestoredProfile(ctx context.Context, current, restored string) error

CheckRestoredProfile reports whether the restored profile can take the place of current: it is another directory, outside current, no process owns it, and this build opens its identity and databases. The restore that made it has already decrypted and verified the archive. Nothing in either profile changes, so it runs while the Node of current does.

func LocalModelCapabilities

func LocalModelCapabilities() localmodels.Capabilities

LocalModelCapabilities are the inference runtimes of this build for Options.LocalModels. Embedding and OCR run on the onnxruntime library packaged beside the executable and are unavailable without it.

func SwapProfile

func SwapProfile(ctx context.Context, current, restored string, now time.Time) (string, error)

SwapProfile makes the restored profile the one at current. The profile that was there is kept beside it as "<name>.before-restore-<time>" and is never deleted; its path is returned. The Node of current must be stopped.

Everything is checked before either profile is touched. The stored paths of the restored profile are then pointed at its new place, and three renames follow: the restored profile next to current, which proves both are on one volume, current to its kept name, the restored profile to current. A failure undoes what was done, so current is either what it was or the restored profile, and the restored profile is back where it lay.

Types

type Node

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

Node owns one profile, admitted operations and their committed event feed.

func Start

func Start(ctx context.Context, path string) (*Node, error)

func StartWithNetwork

func StartWithNetwork(ctx context.Context, path string, scope link.NetworkScope) (*Node, error)

func StartWithOptions

func StartWithOptions(ctx context.Context, path string, options Options) (*Node, error)

func (*Node) CheckSchedules

func (node *Node) CheckSchedules()

CheckSchedules makes the runner read the wall clock now. The application calls it when the system wakes; without that signal the runner's own recheck finds a fire that became due during sleep.

func (*Node) Dispatch

func (node *Node) Dispatch(ctx context.Context, caller protocol.NodeID, request protocol.Request) (link.Admission, error)

Dispatch admits a command and observes every one that changes data.

func (*Node) ID

func (node *Node) ID() protocol.NodeID
func (node *Node) Link() *link.Link

func (*Node) Open

func (node *Node) Open(ctx context.Context, caller protocol.NodeID, id protocol.StreamID) (link.Stream, error)

func (*Node) Snapshot

func (node *Node) Snapshot(ctx context.Context) (protocol.Snapshot, error)

func (*Node) Stop

func (node *Node) Stop(ctx context.Context) error

Stop cancels every worker and waits for the Node to close. Work that ignores cancellation is abandoned at the shutdown deadline: Stop then returns core.ErrShutdownTimeout naming it, with the profile released, and the caller exits. Go cannot abort a goroutine, so the exit is what ends it.

func (*Node) Subscribe

func (node *Node) Subscribe(ctx context.Context, caller protocol.NodeID, topic protocol.Topic) (link.Subscription, error)

func (*Node) Telemetry

func (node *Node) Telemetry() *telemetry.Control

Telemetry is the process's reporting control, for the application's own interface hang and crash reports.

type Options

type Options struct {
	MCP            *mcp.Options
	Python         *python.Options
	DispatchClock  clockwork.Clock
	Network        *link.NetworkScope
	HostDeployment *host.DeploymentOptions
	Model          func(context.Context, model.Binding) (fantasy.LanguageModel, error)
	Fetch          web.FetchOptions
	Search         web.SearchOptions
	Environment    *process.Environment
	Git            workspacegit.Options
	Process        process.Options
	LocalModels    localmodels.Options
	Power          power.Backend
	Telemetry      telemetry.Options
	// contains filtered or unexported fields
}

Options injects native process and clock boundaries for deterministic owners.

type Profile

type Profile struct {
	Ownership *core.Profile
	Identity  link.Identity
	Store     *store.Store
}

Profile holds the shared Desktop and Host storage lifecycle.

func OpenProfile

func OpenProfile(ctx context.Context, path string) (*Profile, error)

func (*Profile) Abandon

func (profile *Profile) Abandon() error

Abandon releases the profile after a shutdown that passed its deadline. A database that a worker still reads or writes is left open: the process is about to exit and SQLite recovers its log at the next start.

func (*Profile) Close

func (profile *Profile) Close() error

Source Files

Directories

Path Synopsis
Package admission owns the caller-scoped durable request ledger.
Package admission owns the caller-scoped durable request ledger.
agent
canonical
Package canonical owns the durable conversation representation independently of the execution engine and provider transport.
Package canonical owns the durable conversation representation independently of the execution engine and provider transport.
clock
Package clock provides the injected time boundary for agent policy deadlines.
Package clock provides the injected time boundary for agent policy deadlines.
compact
Package compact owns bounded structured handoffs, never canonical history.
Package compact owns bounded structured handoffs, never canonical history.
engine
Adapted from Goose ee8500d5 and 14741e9a (Apache-2.0).
Adapted from Goose ee8500d5 and 14741e9a (Apache-2.0).
feed
Package feed owns bounded ephemeral conversation frames, never durable history.
Package feed owns bounded ephemeral conversation frames, never durable history.
model
Package model captures provider requests and owns per-attempt model transport.
Package model captures provider requests and owns per-attempt model transport.
observation
Package observation classifies adapted model requests without retaining bodies.
Package observation classifies adapted model requests without retaining bodies.
operations
Package operations binds declared native host operations without running package scripts.
Package operations binds declared native host operations without running package scripts.
output
Package output projects tool results only in outgoing model records.
Package output projects tool results only in outgoing model records.
prompt
Package prompt separates stable instructions from persisted turn context.
Package prompt separates stable instructions from persisted turn context.
tokens
Package tokens retains the source's offline o200k token accounting.
Package tokens retains the source's offline o200k token accounting.
Package backup builds, encrypts, publishes and restores profile archives.
Package backup builds, encrypts, publishes and restores profile archives.
Package codeindex extracts declarations and references with the pinned gotreesitter grammars and serves bounded queries over a rebuildable index.
Package codeindex extracts declarations and references with the pinned gotreesitter grammars and serves bounded queries over a rebuildable index.
Package computer locates the bundled computer-use helper, reads the execution device's helper grants and owns the helper's cursor-overlay sessions.
Package computer locates the bundled computer-use helper, reads the execution device's helper grants and owns the helper's cursor-overlay sessions.
Package externalbrowser owns the managed Chromium sessions of one Node.
Package externalbrowser owns the managed Chromium sessions of one Node.
Text edits derive from the reviewed confined file service (Apache-2.0).
Text edits derive from the reviewed confined file service (Apache-2.0).
Package fswatch reports file changes below directories without holding a descriptor per watched file.
Package fswatch reports file changes below directories without holding a descriptor per watched file.
Package git owns bounded repository reads and native Git mutations on Node.
Package git owns bounded repository reads and native Git mutations on Node.
Package hooks runs captured workspace scripts around Node-owned tool execution.
Package hooks runs captured workspace scripts around Node-owned tool execution.
service
Package service indexes knowledge collections and answers queries and citation reads.
Package service indexes knowledge collections and answers queries and citation reads.
source
Package source reads the files of a knowledge collection.
Package source reads the files of a knowledge collection.
Package logging owns the process's rotating diagnostics.
Package logging owns the process's rotating diagnostics.
Package power holds one serialized native idle-sleep request while the Node's power setting is on and the Node has running work.
Package power holds one serialized native idle-sleep request while the Node's power setting is on and the Node has running work.
Adapted from sailry-code 67ae9fa0.
Adapted from sailry-code 67ae9fa0.
Package program starts and owns the executables a package declares.
Package program starts and owns the executables a package declares.
Package providers owns provider metadata and explicitly requested HTTP work.
Package providers owns provider metadata and explicitly requested HTTP work.
Package telemetry owns the process's reporting consent, its anonymous identity, the diagnostics report a controller asks for, automatic error reports (failed operations, interface hangs and crashes) and anonymous usage counters.
Package telemetry owns the process's reporting consent, its anonymous identity, the diagnostics report a controller asks for, automatic error reports (failed operations, interface hangs and crashes) and anonymous usage counters.
Package web supplies Node-owned public web reads and configured search.
Package web supplies Node-owned public web reads and configured search.
Package wsl owns installed WSL distribution discovery and independent Linux Host deployment into a WSL2 distribution for the execution Node.
Package wsl owns installed WSL distribution discovery and independent Linux Host deployment into a WSL2 distribution for the execution Node.

Jump to

Keyboard shortcuts

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