Documentation
¶
Index ¶
- type Client
- func (c *Client) AddSessionResource(sessionID string, resource FileResource) error
- func (c *Client) CleanupFiles(fileIDs []string, logWarn func(string, ...any))
- func (c *Client) CreateEnvVarCredential(vaultID, displayName, envName, secretValue string, allowedHosts []string) error
- func (c *Client) CreateManagedSession(req CreateManagedSessionRequest) (*ManagedSession, error)
- func (c *Client) CreateVault(displayName string, metadata map[string]string) (string, error)
- func (c *Client) DeleteFile(fileID string) error
- func (c *Client) DeleteManagedSession(sessionID string) error
- func (c *Client) DeleteVault(vaultID string) error
- func (c *Client) GetLastManagedSessionAgentMessage(sessionID string) (string, []ManagedSessionEvent, error)deprecated
- func (c *Client) GetLastManagedSessionAgentMessageWithRetry(sessionID string, attempts int, delay time.Duration) (string, []ManagedSessionEvent, error)
- func (c *Client) GetManagedSession(sessionID string) (*ManagedSession, error)
- func (c *Client) GetSessionMessages(sessionID string) (*SessionMessages, error)
- func (c *Client) GetSessionMessagesWithRetry(sessionID string, attempts int, delay time.Duration) (*SessionMessages, error)
- func (c *Client) SendManagedSessionInterrupt(sessionID string) error
- func (c *Client) SendManagedSessionUserMessage(sessionID, text string) error
- func (c *Client) UploadFile(content io.Reader, filename string) (string, error)
- type CreateManagedSessionRequest
- type ExecutionMetadata
- type FileResource
- type ManagedSession
- type ManagedSessionContentBlock
- type ManagedSessionEvent
- type OutputPayload
- type RunAgent
- func (a *RunAgent) Cancel(ctx core.ExecutionContext) error
- func (a *RunAgent) Cleanup(ctx core.SetupContext) error
- func (a *RunAgent) Color() string
- func (a *RunAgent) Configuration() []configuration.Field
- func (a *RunAgent) Description() string
- func (a *RunAgent) Documentation() string
- func (a *RunAgent) ExampleOutput() map[string]any
- func (a *RunAgent) Execute(ctx core.ExecutionContext) error
- func (a *RunAgent) HandleHook(ctx core.ActionHookContext) error
- func (a *RunAgent) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (a *RunAgent) Hooks() []core.Hook
- func (a *RunAgent) Icon() string
- func (a *RunAgent) Label() string
- func (a *RunAgent) Name() string
- func (a *RunAgent) OutputChannels(config any) []core.OutputChannel
- func (a *RunAgent) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (a *RunAgent) Setup(ctx core.SetupContext) error
- type SecretBinding
- type SecretRef
- type SessionMessages
- type SessionMetadata
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) AddSessionResource ¶ added in v0.26.0
func (c *Client) AddSessionResource(sessionID string, resource FileResource) error
UploadFile uploads a file to the Anthropic Files API and returns its ID. The file can then be mounted into a session via CreateManagedSessionRequest.Resources. AddSessionResource attaches a file resource to an existing session. POST /v1/sessions/{id}/resources
func (*Client) CleanupFiles ¶ added in v0.26.0
CleanupFiles deletes a list of uploaded files, logging failures.
func (*Client) CreateEnvVarCredential ¶ added in v0.26.0
func (c *Client) CreateEnvVarCredential(vaultID, displayName, envName, secretValue string, allowedHosts []string) error
CreateEnvVarCredential adds an environment_variable credential to a vault. The secret is injected at the network egress layer; the agent never sees the raw value.
func (*Client) CreateManagedSession ¶
func (c *Client) CreateManagedSession(req CreateManagedSessionRequest) (*ManagedSession, error)
CreateManagedSession creates a Managed Agents session.
func (*Client) CreateVault ¶ added in v0.26.0
CreateVault creates a temporary vault and returns its ID.
func (*Client) DeleteFile ¶ added in v0.26.0
DeleteFile removes an uploaded file (DELETE /v1/files/{id}).
func (*Client) DeleteManagedSession ¶
DeleteManagedSession removes a session (DELETE /v1/sessions/{id}). The API does not allow deleting a running session without interrupting first.
func (*Client) DeleteVault ¶ added in v0.26.0
DeleteVault removes a vault and its credentials.
func (*Client) GetLastManagedSessionAgentMessage
deprecated
func (c *Client) GetLastManagedSessionAgentMessage(sessionID string) (string, []ManagedSessionEvent, error)
Deprecated: use GetSessionMessages instead.
func (*Client) GetLastManagedSessionAgentMessageWithRetry ¶
func (*Client) GetManagedSession ¶
func (c *Client) GetManagedSession(sessionID string) (*ManagedSession, error)
GetManagedSession retrieves a session by ID (GET /v1/sessions/{id}).
func (*Client) GetSessionMessages ¶ added in v0.26.0
func (c *Client) GetSessionMessages(sessionID string) (*SessionMessages, error)
func (*Client) GetSessionMessagesWithRetry ¶ added in v0.26.0
func (c *Client) GetSessionMessagesWithRetry(sessionID string, attempts int, delay time.Duration) (*SessionMessages, error)
GetSessionMessagesWithRetry polls until events are fully written (session.status_idle present) or retries are exhausted.
func (*Client) SendManagedSessionInterrupt ¶
SendManagedSessionInterrupt sends a user.interrupt event (stop agent mid-execution).
func (*Client) SendManagedSessionUserMessage ¶
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
Resources []FileResource
}
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 FileResource ¶ added in v0.26.0
FileResource is a file uploaded via the Files API to mount into the session.
type ManagedSession ¶
ManagedSession is a subset of the session resource returned by the API.
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"`
Messages []string `json:"messages"`
}
OutputPayload is emitted on the default channel when the run completes.
type RunAgent ¶
type RunAgent struct{}
func (*RunAgent) Configuration ¶
func (a *RunAgent) Configuration() []configuration.Field
func (*RunAgent) Description ¶
func (*RunAgent) Documentation ¶
func (*RunAgent) ExampleOutput ¶
func (*RunAgent) HandleHook ¶
func (a *RunAgent) HandleHook(ctx core.ActionHookContext) error
func (*RunAgent) HandleWebhook ¶
func (a *RunAgent) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
HandleWebhook — Managed Agents completion is observed via polling, not webhooks.
func (*RunAgent) OutputChannels ¶
func (a *RunAgent) OutputChannels(config any) []core.OutputChannel
func (*RunAgent) ProcessQueueItem ¶
type SecretBinding ¶ added in v0.26.0
type SecretBinding struct {
EnvName string `json:"envName" mapstructure:"envName"`
Value SecretRef `json:"value" mapstructure:"value"`
AllowedHosts []string `json:"allowedHosts" mapstructure:"allowedHosts"`
}
SecretBinding maps a SuperPlane secret to an environment variable in the agent session.
type SecretRef ¶ added in v0.26.0
type SecretRef struct {
Secret string `json:"secret" mapstructure:"secret"`
Key string `json:"key" mapstructure:"key"`
}
SecretRef references a SuperPlane secret by name and key.
type SessionMessages ¶ added in v0.26.0
type SessionMessages struct {
Messages []string // all agent.message texts in chronological order
LastMessage string // the final agent.message text
Complete bool // true if session.status_idle or session.status_terminated is in the events
}
SessionMessages holds all agent messages and completion status from a session's events.
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"`
Files []string `json:"files" mapstructure:"files"`
Secrets []SecretBinding `json:"secrets" mapstructure:"secrets"`
}
Spec is the workflow node configuration for claude.runAgent.