nativesessions

package
v0.1.60 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 10 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 nativesessions shares on-demand native attachments between viewers. It owns no harness processes or transcript files, and does no idle scanning.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ConnectionID string `json:"connectionId"`
	Sequence     int64  `json:"sequence"`
	agent.NativeSessionUpdate
}

type Frame

type Frame struct {
	Type     string    `json:"type"` // snapshot | resume | update
	Snapshot *Snapshot `json:"snapshot,omitempty"`
	Update   *Event    `json:"update,omitempty"`
}

Frame is the SDK/SSE envelope. A resume frame acknowledges a replay cursor; unlike a snapshot, it must not replace the client's existing projection.

type Service

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

func New

func New() *Service

func (*Service) Activity

func (*Service) Close

func (s *Service) Close()

func (*Service) RunTurn

func (s *Service) RunTurn(ctx context.Context, ad agent.Adapter, in agent.TurnInput, emit agent.Emit) (agent.TurnResult, error)

RunTurn lets existing /turns callers use an already-running owner. The same attachment serves the live-session API, so opening another viewer adds no CLI process. The supervisor still owns the request receipt and its detached run.

func (*Service) Subscribe

func (s *Service) Subscribe(ctx context.Context, ad agent.Adapter, q agent.NativeSessionQuery, connectionID string, after int64) (Snapshot, []Event, <-chan Event, func(), error)

Subscribe registers the viewer and reads its baseline under the same lock as publication. A stale/evicted cursor gets a replacement snapshot, never a gap.

type Snapshot

type Snapshot struct {
	ConnectionID    string                `json:"connectionId"`
	Sequence        int64                 `json:"sequence"`
	TurnID          string                `json:"turnId,omitempty"`
	Activity        agent.SessionActivity `json:"activity"`
	Parts           []agent.Part          `json:"parts"`
	Inputs          []agent.UserInput     `json:"inputs"`
	HistoryRequired bool                  `json:"historyRequired,omitempty"`
	Partial         bool                  `json:"partial,omitempty"`
	Replay          bool                  `json:"replay,omitempty"` // retain the previous projection and apply replay events
}

Jump to

Keyboard shortcuts

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