runagent

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey  string
	BaseURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) CreateManagedSession

func (c *Client) CreateManagedSession(req CreateManagedSessionRequest) (*ManagedSession, error)

CreateManagedSession creates a Managed Agents session.

func (*Client) DeleteManagedSession

func (c *Client) DeleteManagedSession(sessionID string) error

DeleteManagedSession removes a session (DELETE /v1/sessions/{id}). The API does not allow deleting a running session without interrupting first.

func (*Client) GetLastManagedSessionAgentMessage

func (c *Client) GetLastManagedSessionAgentMessage(sessionID string) (string, []ManagedSessionEvent, error)

func (*Client) GetLastManagedSessionAgentMessageWithRetry

func (c *Client) GetLastManagedSessionAgentMessageWithRetry(sessionID string, attempts int, delay time.Duration) (string, []ManagedSessionEvent, error)

func (*Client) GetManagedSession

func (c *Client) GetManagedSession(sessionID string) (*ManagedSession, error)

GetManagedSession retrieves a session by ID (GET /v1/sessions/{id}).

func (*Client) SendManagedSessionInterrupt

func (c *Client) SendManagedSessionInterrupt(sessionID string) error

SendManagedSessionInterrupt sends a user.interrupt event (stop agent mid-execution).

func (*Client) SendManagedSessionUserMessage

func (c *Client) SendManagedSessionUserMessage(sessionID, text string) error

SendManagedSessionUserMessage appends a user.message event to the session. The events endpoint uses ?beta=true per the Managed Agents API.

type CreateManagedSessionRequest

type CreateManagedSessionRequest struct {
	// Agent is the agent ID string, or the ID used with AgentVersion for a specific version.
	Agent         string
	AgentVersion  *int
	EnvironmentID string
	VaultIDs      []string
}

CreateManagedSessionRequest is the body for POST /v1/sessions.

type ExecutionMetadata

type ExecutionMetadata struct {
	Session *SessionMetadata `json:"session,omitempty" mapstructure:"session,omitempty"`
}

ExecutionMetadata is persisted for the run.

type ManagedSession

type ManagedSession struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

ManagedSession is a subset of the session resource returned by the API.

type ManagedSessionContentBlock

type ManagedSessionContentBlock struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

type ManagedSessionEvent

type ManagedSessionEvent struct {
	Type    string                       `json:"type"`
	Content []ManagedSessionContentBlock `json:"content"`
}

type OutputPayload

type OutputPayload struct {
	Status      string `json:"status"`
	SessionID   string `json:"sessionId"`
	LastMessage string `json:"lastMessage"`
}

OutputPayload is emitted on the default channel when the run completes.

type RunAgent

type RunAgent struct{}

func (*RunAgent) Cancel

func (a *RunAgent) Cancel(ctx core.ExecutionContext) error

func (*RunAgent) Cleanup

func (a *RunAgent) Cleanup(ctx core.SetupContext) error

func (*RunAgent) Color

func (a *RunAgent) Color() string

func (*RunAgent) Configuration

func (a *RunAgent) Configuration() []configuration.Field

func (*RunAgent) Description

func (a *RunAgent) Description() string

func (*RunAgent) Documentation

func (a *RunAgent) Documentation() string

func (*RunAgent) ExampleOutput

func (a *RunAgent) ExampleOutput() map[string]any

func (*RunAgent) Execute

func (a *RunAgent) Execute(ctx core.ExecutionContext) error

func (*RunAgent) HandleHook

func (a *RunAgent) HandleHook(ctx core.ActionHookContext) error

func (*RunAgent) HandleWebhook

HandleWebhook — Managed Agents completion is observed via polling, not webhooks.

func (*RunAgent) Hooks

func (a *RunAgent) Hooks() []core.Hook

func (*RunAgent) Icon

func (a *RunAgent) Icon() string

func (*RunAgent) Label

func (a *RunAgent) Label() string

func (*RunAgent) Name

func (a *RunAgent) Name() string

func (*RunAgent) OutputChannels

func (a *RunAgent) OutputChannels(config any) []core.OutputChannel

func (*RunAgent) ProcessQueueItem

func (a *RunAgent) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*RunAgent) Setup

func (a *RunAgent) Setup(ctx core.SetupContext) error

type SessionMetadata

type SessionMetadata struct {
	ID     string `json:"id" mapstructure:"id"`
	Status string `json:"status" mapstructure:"status"`
}

SessionMetadata tracks the Managed Agents session.

type Spec

type Spec struct {
	// Agent is the managed agent id (use latest if Version is nil, else pin to Version).
	Agent         string   `json:"agent" mapstructure:"agent"`
	Version       *int     `json:"version" mapstructure:"version"`
	EnvironmentID string   `json:"environmentId" mapstructure:"environmentId"`
	Prompt        string   `json:"prompt" mapstructure:"prompt"`
	VaultIDs      []string `json:"vaultIds" mapstructure:"vaultIds"`
}

Spec is the workflow node configuration for claude.runAgent.

Jump to

Keyboard shortcuts

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