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

async

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package async provides the system/async tool service. It exposes a single method (`list`) that enumerates non-terminal async operations for the current conversation. The conversation scope is read from the request context; the LLM never provides or sees conversation ids.

Index

Constants

View Source
const Name = "system/async"

Name is the canonical tool namespace for this service.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListInput

type ListInput struct {
	// Tool narrows results to ops launched by this start-tool name,
	// e.g. "llm/agents:start" or "system/exec:execute". Empty = any.
	Tool string `json:"tool,omitempty"`
	// Mode narrows results by execution mode: "wait" or "detach".
	// Empty = any.
	Mode string `json:"mode,omitempty"`
}

ListInput is the LLM-facing input schema for system/async:list.

Intentionally minimal: no conversation id, no turn id, no state filter. The conversation scope is resolved from the request context; terminal ops are excluded by construction (they are pruned by GC and are not actionable). Both fields are optional narrowing filters.

type ListOutput

type ListOutput struct {
	Ops []asynccfg.PendingOp `json:"ops"`
}

ListOutput is the LLM-facing output schema. Each entry contains the information needed to construct a status call for the op without guessing (tool name, op id, and the arg name under which to pass the id — or, for same-tool-recall patterns, a pre-built args map).

type Service

type Service struct{}

Service implements the system/async tool surface.

It is stateless; all state lives on the async Manager retrieved from the request context (see protocol/async.ManagerFromContext).

func New

func New() *Service

New creates a new Service instance.

func (*Service) CacheableMethods

func (s *Service) CacheableMethods() map[string]bool

CacheableMethods declares which methods produce cacheable outputs. `list` is intrinsically volatile (operations change over time), so nothing is cached here.

func (*Service) List

func (s *Service) List(ctx context.Context, input *ListInput, output *ListOutput) error

List populates output with the non-terminal ops for the current conversation matching the optional filters. The conversation id is read from the request context; callers never provide it.

func (*Service) Method

func (s *Service) Method(name string) (svc.Executable, error)

Method resolves an executable by name.

func (*Service) Methods

func (s *Service) Methods() svc.Signatures

Methods returns method signatures for this service.

func (*Service) Name

func (s *Service) Name() string

Name returns the service name.

Jump to

Keyboard shortcuts

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