Documentation
¶
Index ¶
- Constants
- type ActorSummary
- type Claude
- func (i *Claude) Actions() []core.Action
- func (i *Claude) Cleanup(ctx core.IntegrationCleanupContext) error
- func (i *Claude) Configuration() []configuration.Field
- func (i *Claude) Description() string
- func (i *Claude) HandleHook(ctx core.IntegrationHookContext) error
- func (i *Claude) HandleRequest(ctx core.HTTPRequestContext)
- func (i *Claude) Hooks() []core.Hook
- func (i *Claude) Icon() string
- func (i *Claude) Instructions() string
- func (i *Claude) Label() string
- func (i *Claude) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (i *Claude) Name() string
- func (i *Claude) Sync(ctx core.SyncContext) error
- func (i *Claude) Triggers() []core.Trigger
- type ClaudeCodeActor
- type ClaudeCodeCoreMetrics
- type ClaudeCodeEstimatedCost
- type ClaudeCodeLinesOfCode
- type ClaudeCodeModelBreakdown
- type ClaudeCodeModelTokens
- type ClaudeCodeSummary
- type ClaudeCodeToolAction
- type ClaudeCodeUsageRecord
- type ClaudeCodeUsageReportResponse
- type Client
- func (c *Client) CreateMessage(req CreateMessageRequest) (*CreateMessageResponse, error)
- func (c *Client) DeleteFile(fileID string) error
- func (c *Client) GetClaudeCodeUsageReport(startDate, endDate time.Time) ([]ClaudeCodeUsageRecord, error)
- func (c *Client) GetMessagesUsageReport(startingAt, endingAt string, days int) ([]MessagesUsageBucket, error)
- func (c *Client) ListModels() ([]Model, error)
- func (c *Client) UploadFile(content io.Reader, filename, contentType string) (string, error)
- func (c *Client) Verify() error
- type Configuration
- type ContentBlock
- type ContentBlockSource
- type CreateMessageRequest
- type CreateMessageResponse
- type DailyUsage
- type GetDailyUsage
- func (c *GetDailyUsage) Cancel(ctx core.ExecutionContext) error
- func (c *GetDailyUsage) Cleanup(ctx core.SetupContext) error
- func (c *GetDailyUsage) Color() string
- func (c *GetDailyUsage) Configuration() []configuration.Field
- func (c *GetDailyUsage) Description() string
- func (c *GetDailyUsage) Documentation() string
- func (c *GetDailyUsage) ExampleOutput() map[string]any
- func (c *GetDailyUsage) Execute(ctx core.ExecutionContext) error
- func (c *GetDailyUsage) HandleHook(ctx core.ActionHookContext) error
- func (c *GetDailyUsage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *GetDailyUsage) Hooks() []core.Hook
- func (c *GetDailyUsage) Icon() string
- func (c *GetDailyUsage) Label() string
- func (c *GetDailyUsage) Name() string
- func (c *GetDailyUsage) OutputChannels(config any) []core.OutputChannel
- func (c *GetDailyUsage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *GetDailyUsage) Setup(ctx core.SetupContext) error
- type GetDailyUsageOutput
- type GetDailyUsageSpec
- type Message
- type MessageContent
- type MessagePayload
- type MessageUsage
- type MessagesSummary
- type MessagesUsageBucket
- type MessagesUsageCacheCreation
- type MessagesUsageReportResponse
- type MessagesUsageResult
- type MessagesUsageServerTool
- type Model
- type ModelCost
- type ModelUsage
- type ModelsResponse
- type OutputConfig
- type OutputFormat
- type Period
- type TextPrompt
- func (c *TextPrompt) Cancel(ctx core.ExecutionContext) error
- func (c *TextPrompt) Cleanup(ctx core.SetupContext) error
- func (c *TextPrompt) Color() string
- func (c *TextPrompt) Configuration() []configuration.Field
- func (c *TextPrompt) Description() string
- func (c *TextPrompt) Documentation() string
- func (c *TextPrompt) ExampleOutput() map[string]any
- func (c *TextPrompt) Execute(ctx core.ExecutionContext) error
- func (c *TextPrompt) HandleHook(ctx core.ActionHookContext) error
- func (c *TextPrompt) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *TextPrompt) Hooks() []core.Hook
- func (c *TextPrompt) Icon() string
- func (c *TextPrompt) Label() string
- func (c *TextPrompt) Name() string
- func (c *TextPrompt) OutputChannels(configuration any) []core.OutputChannel
- func (c *TextPrompt) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *TextPrompt) Setup(ctx core.SetupContext) error
- type TextPromptNodeMetadata
- type TextPromptSpec
Constants ¶
const (
GetDailyUsagePayloadType = "claude.getDailyUsage.result"
)
const MessagePayloadType = "claude.message"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActorSummary ¶ added in v0.28.0
type ActorSummary struct {
Actor string `json:"actor"`
Type string `json:"type"`
Sessions int64 `json:"sessions"`
LinesAdded int64 `json:"linesAdded"`
LinesRemoved int64 `json:"linesRemoved"`
Commits int64 `json:"commits"`
PullRequests int64 `json:"pullRequests"`
}
ActorSummary is a per-user/per-API-key productivity rollup from the Claude Code usage report.
type Claude ¶
type Claude struct{}
func (*Claude) Configuration ¶
func (i *Claude) Configuration() []configuration.Field
func (*Claude) Description ¶
func (*Claude) HandleHook ¶ added in v0.18.0
func (i *Claude) HandleHook(ctx core.IntegrationHookContext) error
func (*Claude) HandleRequest ¶
func (i *Claude) HandleRequest(ctx core.HTTPRequestContext)
func (*Claude) Instructions ¶
func (*Claude) ListResources ¶
func (i *Claude) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
type ClaudeCodeActor ¶ added in v0.28.0
type ClaudeCodeActor struct {
Type string `json:"type"`
EmailAddress string `json:"email_address"`
APIKeyName string `json:"api_key_name"`
}
func (ClaudeCodeActor) Name ¶ added in v0.28.0
func (a ClaudeCodeActor) Name() string
type ClaudeCodeCoreMetrics ¶ added in v0.28.0
type ClaudeCodeCoreMetrics struct {
CommitsByClaudeCode int64 `json:"commits_by_claude_code"`
LinesOfCode ClaudeCodeLinesOfCode `json:"lines_of_code"`
NumSessions int64 `json:"num_sessions"`
PullRequestsByClaudeCode int64 `json:"pull_requests_by_claude_code"`
}
type ClaudeCodeEstimatedCost ¶ added in v0.28.0
type ClaudeCodeLinesOfCode ¶ added in v0.28.0
type ClaudeCodeModelBreakdown ¶ added in v0.28.0
type ClaudeCodeModelBreakdown struct {
Model string `json:"model"`
EstimatedCost ClaudeCodeEstimatedCost `json:"estimated_cost"`
Tokens ClaudeCodeModelTokens `json:"tokens"`
}
type ClaudeCodeModelTokens ¶ added in v0.28.0
type ClaudeCodeSummary ¶ added in v0.28.0
type ClaudeCodeSummary struct {
Sessions int64 `json:"sessions"`
LinesAdded int64 `json:"linesAdded"`
LinesRemoved int64 `json:"linesRemoved"`
Commits int64 `json:"commits"`
PullRequests int64 `json:"pullRequests"`
ToolActionsAccepted int64 `json:"toolActionsAccepted"`
ToolActionsRejected int64 `json:"toolActionsRejected"`
EstimatedCostUsd float64 `json:"estimatedCostUsd"`
ByModel []ModelCost `json:"byModel"`
ByActor []ActorSummary `json:"byActor"`
}
ClaudeCodeSummary rolls up Claude Code productivity metrics and cost.
type ClaudeCodeToolAction ¶ added in v0.28.0
type ClaudeCodeUsageRecord ¶ added in v0.28.0
type ClaudeCodeUsageRecord struct {
Actor ClaudeCodeActor `json:"actor"`
Date string `json:"date"`
CoreMetrics ClaudeCodeCoreMetrics `json:"core_metrics"`
ModelBreakdown []ClaudeCodeModelBreakdown `json:"model_breakdown"`
ToolActions map[string]ClaudeCodeToolAction `json:"tool_actions"`
}
type ClaudeCodeUsageReportResponse ¶ added in v0.28.0
type ClaudeCodeUsageReportResponse struct {
Data []ClaudeCodeUsageRecord `json:"data"`
HasMore bool `json:"has_more"`
NextPage string `json:"next_page"`
}
ClaudeCodeUsageReportResponse is the response of GET /v1/organizations/usage_report/claude_code.
type Client ¶
type Client struct {
APIKey string
AdminKey string
BaseURL string
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(req CreateMessageRequest) (*CreateMessageResponse, error)
func (*Client) DeleteFile ¶ added in v0.28.0
DeleteFile removes an uploaded file. Best-effort cleanup; no-op for empty IDs.
func (*Client) GetClaudeCodeUsageReport ¶ added in v0.28.0
func (c *Client) GetClaudeCodeUsageReport(startDate, endDate time.Time) ([]ClaudeCodeUsageRecord, error)
GetClaudeCodeUsageReport fetches per-day, per-actor Claude Code productivity metrics for every day between startDate and endDate (inclusive). The upstream endpoint only accepts a single day per call, so this issues one request (plus pagination) per day in range.
func (*Client) GetMessagesUsageReport ¶ added in v0.28.0
func (c *Client) GetMessagesUsageReport(startingAt, endingAt string, days int) ([]MessagesUsageBucket, error)
GetMessagesUsageReport fetches per-day, per-model token usage between startingAt (inclusive) and endingAt (exclusive), both RFC 3339 timestamps.
func (*Client) ListModels ¶
func (*Client) UploadFile ¶ added in v0.28.0
UploadFile uploads a file to the Anthropic Files API and returns its file_id.
type Configuration ¶
type ContentBlock ¶ added in v0.26.0
type ContentBlock struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Source *ContentBlockSource `json:"source,omitempty"`
}
ContentBlock represents a content block in a Claude message. Used for text, images, and documents.
type ContentBlockSource ¶ added in v0.26.0
type ContentBlockSource struct {
Type string `json:"type"`
MediaType string `json:"media_type,omitempty"`
Data string `json:"data,omitempty"`
FileID string `json:"file_id,omitempty"`
}
ContentBlockSource describes the source of an image/document content block. Type "text"/"base64" carry MediaType+Data inline; type "file" references a Files API file_id.
type CreateMessageRequest ¶
type CreateMessageResponse ¶
type CreateMessageResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
Content []MessageContent `json:"content"`
Model string `json:"model"`
StopReason string `json:"stop_reason"`
StopSequence string `json:"stop_sequence,omitempty"`
Usage MessageUsage `json:"usage"`
}
type DailyUsage ¶ added in v0.28.0
type DailyUsage struct {
Date string `json:"date"`
MessagesInputTokens int64 `json:"messagesInputTokens"`
MessagesOutputTokens int64 `json:"messagesOutputTokens"`
CodeSessions int64 `json:"codeSessions"`
CodeLinesAdded int64 `json:"codeLinesAdded"`
CodeLinesRemoved int64 `json:"codeLinesRemoved"`
CodeCommits int64 `json:"codeCommits"`
CodePullRequests int64 `json:"codePullRequests"`
CodeEstimatedCostUsd float64 `json:"codeEstimatedCostUsd"`
}
DailyUsage is an org-wide, per-calendar-day rollup combining both reports, for trend charts.
type GetDailyUsage ¶ added in v0.28.0
type GetDailyUsage struct{}
func (*GetDailyUsage) Cancel ¶ added in v0.28.0
func (c *GetDailyUsage) Cancel(ctx core.ExecutionContext) error
func (*GetDailyUsage) Cleanup ¶ added in v0.28.0
func (c *GetDailyUsage) Cleanup(ctx core.SetupContext) error
func (*GetDailyUsage) Color ¶ added in v0.28.0
func (c *GetDailyUsage) Color() string
func (*GetDailyUsage) Configuration ¶ added in v0.28.0
func (c *GetDailyUsage) Configuration() []configuration.Field
func (*GetDailyUsage) Description ¶ added in v0.28.0
func (c *GetDailyUsage) Description() string
func (*GetDailyUsage) Documentation ¶ added in v0.28.0
func (c *GetDailyUsage) Documentation() string
func (*GetDailyUsage) ExampleOutput ¶ added in v0.28.0
func (c *GetDailyUsage) ExampleOutput() map[string]any
func (*GetDailyUsage) Execute ¶ added in v0.28.0
func (c *GetDailyUsage) Execute(ctx core.ExecutionContext) error
func (*GetDailyUsage) HandleHook ¶ added in v0.28.0
func (c *GetDailyUsage) HandleHook(ctx core.ActionHookContext) error
func (*GetDailyUsage) HandleWebhook ¶ added in v0.28.0
func (c *GetDailyUsage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetDailyUsage) Hooks ¶ added in v0.28.0
func (c *GetDailyUsage) Hooks() []core.Hook
func (*GetDailyUsage) Icon ¶ added in v0.28.0
func (c *GetDailyUsage) Icon() string
func (*GetDailyUsage) Label ¶ added in v0.28.0
func (c *GetDailyUsage) Label() string
func (*GetDailyUsage) Name ¶ added in v0.28.0
func (c *GetDailyUsage) Name() string
func (*GetDailyUsage) OutputChannels ¶ added in v0.28.0
func (c *GetDailyUsage) OutputChannels(config any) []core.OutputChannel
func (*GetDailyUsage) ProcessQueueItem ¶ added in v0.28.0
func (c *GetDailyUsage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*GetDailyUsage) Setup ¶ added in v0.28.0
func (c *GetDailyUsage) Setup(ctx core.SetupContext) error
type GetDailyUsageOutput ¶ added in v0.28.0
type GetDailyUsageOutput struct {
Period Period `json:"period"`
Messages MessagesSummary `json:"messages"`
ClaudeCode ClaudeCodeSummary `json:"claudeCode"`
Daily []DailyUsage `json:"daily"`
}
type GetDailyUsageSpec ¶ added in v0.28.0
type Message ¶
Message represents a Claude API message. Content can be a plain string (for simple text) or []ContentBlock (for multi-part content with documents, images and text).
type MessageContent ¶
type MessagePayload ¶
type MessagePayload struct {
ID string `json:"id"`
Model string `json:"model"`
Text string `json:"text"`
Parsed any `json:"parsed,omitempty"`
Usage *MessageUsage `json:"usage,omitempty"`
StopReason string `json:"stopReason,omitempty"`
Response *CreateMessageResponse `json:"response"`
}
type MessageUsage ¶
type MessagesSummary ¶ added in v0.28.0
type MessagesSummary struct {
InputTokens int64 `json:"inputTokens"`
OutputTokens int64 `json:"outputTokens"`
CacheReadTokens int64 `json:"cacheReadTokens"`
CacheCreationTokens int64 `json:"cacheCreationTokens"`
WebSearchRequests int64 `json:"webSearchRequests"`
ByModel []ModelUsage `json:"byModel"`
}
MessagesSummary rolls up raw API/SDK usage. The Messages usage report has no cost or request-count field, only token counts.
type MessagesUsageBucket ¶ added in v0.28.0
type MessagesUsageBucket struct {
StartingAt string `json:"starting_at"`
EndingAt string `json:"ending_at"`
Results []MessagesUsageResult `json:"results"`
}
type MessagesUsageCacheCreation ¶ added in v0.28.0
type MessagesUsageReportResponse ¶ added in v0.28.0
type MessagesUsageReportResponse struct {
Data []MessagesUsageBucket `json:"data"`
HasMore bool `json:"has_more"`
NextPage string `json:"next_page"`
}
MessagesUsageReportResponse is the response of GET /v1/organizations/usage_report/messages.
type MessagesUsageResult ¶ added in v0.28.0
type MessagesUsageResult struct {
Model string `json:"model"`
UncachedInputTokens int64 `json:"uncached_input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CacheReadInputTokens int64 `json:"cache_read_input_tokens"`
CacheCreation MessagesUsageCacheCreation `json:"cache_creation"`
ServerToolUse MessagesUsageServerTool `json:"server_tool_use"`
}
type MessagesUsageServerTool ¶ added in v0.28.0
type MessagesUsageServerTool struct {
WebSearchRequests int64 `json:"web_search_requests"`
}
type ModelCost ¶ added in v0.28.0
type ModelCost struct {
Model string `json:"model"`
InputTokens int64 `json:"inputTokens"`
OutputTokens int64 `json:"outputTokens"`
EstimatedCostUsd float64 `json:"estimatedCostUsd"`
}
ModelCost is a per-model token and cost rollup from the Claude Code usage report.
type ModelUsage ¶ added in v0.28.0
type ModelUsage struct {
Model string `json:"model"`
InputTokens int64 `json:"inputTokens"`
OutputTokens int64 `json:"outputTokens"`
CacheReadTokens int64 `json:"cacheReadTokens"`
CacheCreationTokens int64 `json:"cacheCreationTokens"`
}
ModelUsage is a per-model token rollup from the Messages usage report.
type ModelsResponse ¶
type ModelsResponse struct {
Data []Model `json:"data"`
}
type OutputConfig ¶ added in v0.28.0
type OutputConfig struct {
Format *OutputFormat `json:"format,omitempty"`
}
OutputConfig configures Claude's response format (structured outputs). See https://platform.claude.com/docs/en/build-with-claude/structured-outputs
type OutputFormat ¶ added in v0.28.0
type OutputFormat struct {
Type string `json:"type"` // always "json_schema"
Schema any `json:"schema"` // the JSON Schema object
}
OutputFormat constrains the final text response to a JSON schema.
type TextPrompt ¶
type TextPrompt struct{}
func (*TextPrompt) Cancel ¶
func (c *TextPrompt) Cancel(ctx core.ExecutionContext) error
func (*TextPrompt) Cleanup ¶
func (c *TextPrompt) Cleanup(ctx core.SetupContext) error
func (*TextPrompt) Color ¶
func (c *TextPrompt) Color() string
func (*TextPrompt) Configuration ¶
func (c *TextPrompt) Configuration() []configuration.Field
func (*TextPrompt) Description ¶
func (c *TextPrompt) Description() string
func (*TextPrompt) Documentation ¶
func (c *TextPrompt) Documentation() string
func (*TextPrompt) ExampleOutput ¶
func (c *TextPrompt) ExampleOutput() map[string]any
func (*TextPrompt) Execute ¶
func (c *TextPrompt) Execute(ctx core.ExecutionContext) error
func (*TextPrompt) HandleHook ¶ added in v0.18.0
func (c *TextPrompt) HandleHook(ctx core.ActionHookContext) error
func (*TextPrompt) HandleWebhook ¶
func (c *TextPrompt) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*TextPrompt) Hooks ¶ added in v0.18.0
func (c *TextPrompt) Hooks() []core.Hook
func (*TextPrompt) Icon ¶
func (c *TextPrompt) Icon() string
func (*TextPrompt) Label ¶
func (c *TextPrompt) Label() string
func (*TextPrompt) Name ¶
func (c *TextPrompt) Name() string
func (*TextPrompt) OutputChannels ¶
func (c *TextPrompt) OutputChannels(configuration any) []core.OutputChannel
func (*TextPrompt) ProcessQueueItem ¶
func (c *TextPrompt) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*TextPrompt) Setup ¶
func (c *TextPrompt) Setup(ctx core.SetupContext) error
type TextPromptNodeMetadata ¶ added in v0.28.0
type TextPromptNodeMetadata struct {
Model string `json:"model" mapstructure:"model"`
MaxTokens int `json:"maxTokens" mapstructure:"maxTokens"`
StructuredOutput bool `json:"structuredOutput" mapstructure:"structuredOutput"`
}
TextPromptNodeMetadata is node-level metadata surfaced in the UI so the configured model and options are visible on the node without opening it.