Documentation
¶
Overview ¶
Package slack implements the Slack channel plugin for the forge channel system.
Index ¶
- type Plugin
- func (p *Plugin) DeliverApproval(ctx context.Context, req channels.ApprovalRequest) error
- func (p *Plugin) DeliverConsent(ctx context.Context, req channels.ConsentPrompt) error
- func (p *Plugin) Init(cfg channels.ChannelConfig) error
- func (p *Plugin) Name() string
- func (p *Plugin) NormalizeEvent(raw []byte) (*channels.ChannelEvent, error)
- func (p *Plugin) SendResponse(event *channels.ChannelEvent, response *a2a.Message) error
- func (p *Plugin) SetApprovalResolver(r channels.ApprovalResolver)
- func (p *Plugin) SetConsentCanceler(c channels.ConsentCanceler)
- func (p *Plugin) SetLogger(l channels.Logger)
- func (p *Plugin) Start(ctx context.Context, handler channels.EventHandler) error
- func (p *Plugin) Stop() error
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 (*Plugin) DeliverApproval ¶ added in v0.18.1
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
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) NormalizeEvent ¶
func (p *Plugin) NormalizeEvent(raw []byte) (*channels.ChannelEvent, error)
NormalizeEvent parses raw Slack event JSON into a ChannelEvent.
func (*Plugin) SendResponse ¶
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
SetLogger wires a structured ops logger (channels.LoggerAware). Optional.