integrations

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package integrations connects external messaging transports to the existing bot runtime. It owns delivery receipts and routing, never a second agent or transcript.

Index

Constants

View Source
const Version = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type BotRuntime

type BotRuntime interface {
	Delegate(registry.Bot, string, bots.TaskRequest) (bots.Task, error)
	Task(registry.Bot, string, string) (bots.Task, error)
	CancelTask(registry.Bot, string, string) (bots.Task, error)
}

type Connection

type Connection struct {
	ID       string `json:"id"`
	Revision int64  `json:"revision"`
	Spec
	HasCredentials bool   `json:"hasCredentials"`
	WebhookPath    string `json:"webhookPath"`
}

type Credentials

type Credentials struct {
	BotToken      string `json:"botToken,omitempty"`
	SigningSecret string `json:"signingSecret,omitempty"`
	WebhookSecret string `json:"webhookSecret,omitempty"`
	PublicKey     string `json:"publicKey,omitempty"`
	ClientSecret  string `json:"clientSecret,omitempty"`
}

type Options

type Options struct{ HTTPClient *http.Client }

Options allows a host to supply its existing HTTP transport.

type Receipt

type Receipt struct {
	ID            string `json:"id"`
	IntegrationID string `json:"integrationId"`
	ChannelID     string `json:"channelId"`
	UserID        string `json:"userId"`
	State         string `json:"state"`
	ChatID        string `json:"chatId,omitempty"`
	RunID         string `json:"runId,omitempty"`
	Error         string `json:"error,omitempty"`
	CreatedAt     string `json:"createdAt"`
}

type Service

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

func New

func New(db *registry.Store, runtime BotRuntime, hub *stream.Hub, options ...Options) *Service

func (*Service) Channels

func (s *Service) Channels() []shortcuts.Channel

func (*Service) Close

func (s *Service) Close()

func (*Service) Delete

func (s *Service) Delete(id string) error

func (*Service) Events

func (s *Service) Events(id string) ([]Receipt, error)

func (*Service) Get

func (s *Service) Get(id string) (Connection, error)

func (*Service) List

func (s *Service) List() ([]Connection, error)

func (*Service) Notify

func (s *Service) Notify(ctx context.Context, n agent.Notification) error

Notify routes bot lifecycle notifications using the same transport and credentials as chat replies. App notifications select integration:<id> explicitly instead.

func (*Service) Retry

func (s *Service) Retry(id, eventID string) (Receipt, error)

func (*Service) Save

func (s *Service) Save(id string, spec Spec) (Connection, error)

func (*Service) Send

func (s *Service) Send(ctx context.Context, id, text string) error

func (*Service) Start

func (s *Service) Start()

func (*Service) Webhook

func (s *Service) Webhook(w http.ResponseWriter, r *http.Request)

Webhook is deliberately outside daemon bearer authentication. Each provider's signature is checked against the raw body before any event is acknowledged.

type Spec

type Spec struct {
	Name             string            `json:"name"`
	Provider         string            `json:"provider"`
	BotID            string            `json:"botId"`
	Mode             string            `json:"mode"`
	Enabled          bool              `json:"enabled"`
	ChannelIDs       []string          `json:"channelIds"`
	UserIDs          []string          `json:"userIds,omitempty"`
	WorkspaceID      string            `json:"workspaceId,omitempty"` // Slack team, Discord guild, Teams tenant
	ApplicationID    string            `json:"applicationId,omitempty"`
	Command          string            `json:"command,omitempty"`
	Notify           bool              `json:"notify"`
	Conditions       []agent.Condition `json:"conditions,omitempty"`
	Destination      string            `json:"destination,omitempty"`
	ServiceURL       string            `json:"serviceUrl,omitempty"` // Teams connector, owner-configured
	ExpectedRevision int64             `json:"expectedRevision,omitempty"`
	Credentials      *Credentials      `json:"credentials,omitempty"`
}

Spec is a complete configuration. Credentials are write-only; omitted fields preserve existing credentials on update. Revision prevents concurrent overwrites.

Jump to

Keyboard shortcuts

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