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

claudesessions

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package claudesessions adapts native Claude Agent SDK sessions to Orb events. Its host runs the official SDK and an unmodified Claude executable; Orb never reads, copies, refreshes or proxies Claude credentials.

Index

Constants

View Source
const Name = "claude-sessions"
View Source
const SDKVersion = "0.3.280"

Variables

This section is empty.

Functions

func Configure

func Configure(cfg *agent.SessionRuntimeConfig, agentDir string, env []string) (bind func(*agent.SessionRuntime), err error)

Configure composes a driver into the same runtime configuration used by all Orb hosts. bind must run before exposing the created runtime to controllers.

func Factory

Factory rebuilds the plugin attachment for every SDK session replacement. The caller supplies storage in AgentSessionOptions and owns runtime disposal.

func LimitsStatus added in v0.10.0

func LimitsStatus(manager extensions.ReadonlySessionManager, now time.Time) string

LimitsStatus formats the latest native subscription reading for local or remote UI.

func Management

func Management(settings *config.SettingsManager, agentDir string, env []string) extensions.Factory

Management exposes the dormant capability through a native command and palette entry. Installing dependencies and starting sessions are explicit user actions.

func Model

func Model(provider, model *string, settings *config.SettingsManager) *ai.Model

Model selects this capability only for an explicit or restored Claude session.

func RestoreSelection

func RestoreSelection(state session.SessionContext, provider, model **string, branch ...session.SessionEntry)

RestoreSelection retains the native executor even when a CLI host carries startup defaults for another provider. An executor change requires a new session.

Types

type Driver

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

func New

func New(options Options) (*Driver, error)

func (*Driver) Close added in v0.10.0

func (d *Driver) Close()

Close ends the live native session, if any.

func (*Driver) Loop

Loop owns the complete native turn. Orb queues are drained only between native turns, so no tool is executed twice by an outer Orb agent loop.

type Options

type Options struct {
	Sandbox sandbox.Mode
	// RenderText optionally supplies text components for SDK-hosted tool calls.
	RenderText        func(string) extensions.Component
	Node, SDK, Claude string
	Env               []string
	Manager           *session.SessionManager
	// Headless approves native asks that no UI can answer, as Orb runs its own tools.
	Headless bool
	// Context is Orb's instructions that Claude does not load itself.
	Context string
	Ask     func(context.Context, string, []string) (string, error)
}

Jump to

Keyboard shortcuts

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