claude

package
v0.1.21 Latest Latest
Warning

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

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

Documentation

Overview

Package claude 将 Claude Code 适配到 Leros 外部 CLI 引擎接口。

Package claude provides the Claude Code Runtime.

Index

Constants

View Source
const (
	// Kind is the canonical runtime kind for Claude Code.
	Kind = "claude"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter 通过 Claude Code 执行提示。

func NewAdapter

func NewAdapter(binary string, extraEnv map[string]string) *Adapter

NewAdapter 创建 Claude Code 引擎适配器。

func (*Adapter) GetSkillDir

func (a *Adapter) GetSkillDir() string

GetSkillDir returns the skill directory path for Claude Code.

func (*Adapter) Invoke

Invoke starts Claude Code and returns its process activity stream.

func (*Adapter) Prepare

func (a *Adapter) Prepare(_ context.Context, _ string) error

Prepare performs provider-specific workspace setup.

type Invoker

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

Invoker 启动外部 CLI 进程。

func NewInvoker

func NewInvoker(binary string, extraEnv map[string]string) *Invoker

NewInvoker 创建 CLI 调用器。

func (*Invoker) Invoke

Invoke starts the CLI process and converts stdout/stderr into provider events.

type Runtime

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

Runtime executes requests through Claude Code.

func New

func New(binary string, options externalcli.DriverOptions) (*Runtime, error)

New creates a Claude Runtime backed by the configured CLI binary.

func NewWithInvoker

func NewWithInvoker(invoker externalcli.Invoker, options externalcli.DriverOptions) (*Runtime, error)

NewWithInvoker creates a Claude Runtime with an injected process invoker.

func (*Runtime) Execute

func (r *Runtime) Execute(
	ctx context.Context,
	request agent.ExecutionRequest,
	observer agent.Observer,
) (agent.ExecutionResult, error)

func (*Runtime) Name

func (r *Runtime) Name() string

Jump to

Keyboard shortcuts

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