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
- func Configure(cfg *agent.SessionRuntimeConfig, agentDir string, env []string) (bind func(*agent.SessionRuntime), err error)
- func Factory(options Options) agent.CreateAgentSessionRuntimeFactory
- func LimitsStatus(manager extensions.ReadonlySessionManager, now time.Time) string
- func Management(settings *config.SettingsManager, agentDir string, env []string) extensions.Factory
- func Model(provider, model *string, settings *config.SettingsManager) *ai.Model
- func RestoreSelection(state session.SessionContext, provider, model **string, ...)
- type Driver
- type Options
Constants ¶
const Name = "claude-sessions"
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 ¶
func Factory(options Options) agent.CreateAgentSessionRuntimeFactory
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 (*Driver) Close ¶ added in v0.10.0
func (d *Driver) Close()
Close ends the live native session, if any.
func (*Driver) Loop ¶
func (d *Driver) Loop(ctx context.Context, prompts engine.AgentMessages, _ engine.AgentContext, config engine.AgentLoopConfig, emit engine.EventSink) error
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)
}