platform

package
v1.0.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 26 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 platform runs an accepted offer as one kagent session and A2A turn.

Index

Constants

This section is empty.

Variables

View Source
var ErrRefused = errors.New("platform access refused")

ErrRefused identifies an explicit policy or grant refusal. A retry with another identity would change who owns the session.

Functions

func ParseGitAccess

func ParseGitAccess(s string) (executor.GitAccess, error)

ParseGitAccess reads a runner's git access for the platform executor. It refuses read: a workspace grant cannot be narrowed to read-only, so a read session would get whatever the grant allows, pushing included.

Types

type Config

type Config struct {
	Organization string
	// StateDir is private and exclusive to one runner and caller identity.
	StateDir string
	Profiles []Profile
	// Supply clients for the same caller. WorkspaceManager is required only
	// for write and can connect on its first tool call. The caller's transport
	// owns its per-service credentials, refresh and address policy.
	AgentManager, WorkspaceManager ToolCaller
	A2A                            pb.A2AServiceClient
	ResolveContext                 func(context.Context, string) (json.RawMessage, error)
	// GitAccess is the runner's git access. Under none (or empty) sessions
	// start without a workspace; write authorizes the profile's workspace and
	// passes its grant. read is refused, see ParseGitAccess.
	GitAccess executor.GitAccess
}

type Executor

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

func New

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

func (*Executor) Cancel

func (e *Executor) Cancel(ctx context.Context, task string) error

Cancel leaves the conversation in kagent. A terminal CancelTask reply or subscription event is evidence of the outcome, including a completion that raced cancellation.

func (*Executor) Pending

func (e *Executor) Pending() ([]string, error)

Pending lists durable attempts at runner startup. Resume each task that the runner still owns. A crash during delivery may replay its terminal report.

func (*Executor) Resume

func (e *Executor) Resume(ctx context.Context, task string, report func(runnerapi.SessionReport)) error

Resume reattaches an already accepted task after a restart. A recorded turn needs no new MCP call. A start whose reply was lost reuses its request ID.

func (*Executor) Start

func (e *Executor) Start(ctx context.Context, offer runnerapi.Offer, report func(runnerapi.SessionReport)) error

Start takes a session-lifetime context. Canceling that context detaches the observer for shutdown. Only Cancel requests that the remote turn stop.

type Profile

type Profile struct {
	Harness, Subscription, Provider string
	Agent, Workspace                string
}

Profile maps an advertised placement to an agent and its workspace-manager workspace.

type ToolCaller

type ToolCaller interface {
	CallTool(context.Context, mcp.CallToolRequest) (*mcp.CallToolResult, error)
}

ToolCaller calls tools on one configured MCP manager. Its transport supplies the caller's credentials for that manager's audience.

Jump to

Keyboard shortcuts

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