Documentation
¶
Overview ¶
Package channelhttp serves the portal's channel routes: the channels the signed-in person can reach with their bots' chat channels, sharing an asset to one from the Share dialog (#2241), and sending a message to one (#1723).
Every route is a notify tool call, made over an in-memory session that authenticates as the person the portal signed in. That is the whole point of the shape: who may reach a channel, what an asset becomes when it is posted, the per-session rate limit and the audit row are the tool's, so the asset page and an agent asking for the same post cannot come to disagree about any of them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SharingFor ¶ added in v1.149.0
SharingFor answers whether a portal user's persona lets them share (#2241): the persona their roles resolve to allows it, or is the admin persona. A user whose roles resolve to no persona shares nothing. nil with no registry, which allows everyone.
Types ¶
type API ¶
type API struct {
// Server is the assembled MCP server the calls are made against. nil
// answers every route 503.
Server *mcp.Server
// SharingAllowed reports whether the signed-in person's persona lets
// them share (#2241). The channel list and the channel share refuse
// without it. nil allows everyone.
SharingAllowed func(*access.User) bool
}
API serves the routes.
type ChannelShareRequest ¶ added in v1.149.0
type ChannelShareRequest struct {
Channel string `json:"channel" example:"slack"`
// the ids the list reports under the channel's targets. Empty posts to
// the channel's own.
Target string `json:"target,omitempty" example:"C0123456789"`
// user, no expiration) or public (anyone with the link, expires_in
// required).
AccessMode string `json:"access_mode" example:"authenticated" enums:"authenticated,public"`
ExpiresIn string `json:"expires_in,omitempty" example:"168h"`
Message string `json:"message,omitempty" example:"This week's numbers"`
}
ChannelShareRequest shares an asset to a channel (#2241).
type SendRequest ¶
type SendRequest struct {
Title string `json:"title" example:"Nightly load finished late"`
// Body is markdown.
Body string `json:"body,omitempty" example:"The load finished at 06:40, forty minutes past its window."`
// Link is the absolute URL a reader follows from the message.
Link string `json:"link,omitempty" example:"https://platform.example.com/portal/automations/scr_1/runs/run_9"`
}
SendRequest posts a message.