slack

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package slack implements the Slack channel plugin for the forge channel system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

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

Plugin implements channels.ChannelPlugin for Slack using Socket Mode.

func New

func New() *Plugin

New creates an uninitialised Slack plugin.

func (*Plugin) DeliverApproval added in v0.18.1

func (p *Plugin) DeliverApproval(ctx context.Context, req channels.ApprovalRequest) error

DeliverApproval posts a Block Kit Approve/Reject message to req.Target (a Slack channel ID like "C0123ABC5" or a name like "#oncall"). The buttons carry the task id so the click can be routed back to the deferral. Delivery failure is returned to the caller (the runtime logs it, non-fatal — the approver can still POST the decision directly).

func (*Plugin) DeliverConsent added in v0.18.1

func (p *Plugin) DeliverConsent(ctx context.Context, req channels.ConsentPrompt) error

DeliverConsent presents the consent login link to the requesting user. It reaches them in the origin thread if the request came via Slack, else opens a DM resolved from their email. Delivery failure is returned (the runtime logs it, non-fatal — the parked call still resumes when the callback lands, and mcp_auth_required was already emitted as the platform-read backstop).

func (*Plugin) Init

func (p *Plugin) Init(cfg channels.ChannelConfig) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) NormalizeEvent

func (p *Plugin) NormalizeEvent(raw []byte) (*channels.ChannelEvent, error)

NormalizeEvent parses raw Slack event JSON into a ChannelEvent.

func (*Plugin) SendResponse

func (p *Plugin) SendResponse(event *channels.ChannelEvent, response *a2a.Message) error

SendResponse posts a message back to Slack via chat.postMessage. If the runtime attached file parts (large tool outputs), those are used for the file upload since the LLM text may be truncated. For large responses (>4096 chars), uploads the full report as a file with a summary message. Falls back to chunked messages on failure.

func (*Plugin) SetApprovalResolver added in v0.18.1

func (p *Plugin) SetApprovalResolver(r channels.ApprovalResolver)

SetApprovalResolver wires the callback invoked when an approver clicks a button. Called once by the runtime at startup.

func (*Plugin) SetConsentCanceler added in v0.18.1

func (p *Plugin) SetConsentCanceler(c channels.ConsentCanceler)

SetConsentCanceler wires the callback invoked when the user cancels a consent prompt. Called once by the runtime at startup; may be nil (no Cancel button).

func (*Plugin) SetLogger added in v0.18.1

func (p *Plugin) SetLogger(l channels.Logger)

SetLogger wires a structured ops logger (channels.LoggerAware). Optional.

func (*Plugin) Start

func (p *Plugin) Start(ctx context.Context, handler channels.EventHandler) error

func (*Plugin) Stop

func (p *Plugin) Stop() error

Jump to

Keyboard shortcuts

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