Documentation
¶
Overview ¶
Package notifywiring assembles the notify tool from the stores the platform already holds (#1723).
It is a seam rather than a method on the facade for the reason every other composition seam here is one: the facade is at its size budget, and composition is not behavior it should own. What it adds over notifylayer itself is the two adapters that join the portal's storage to the two narrow contracts the tool asks for -- reading an asset, and deciding who may read it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIConnectionExists ¶ added in v1.149.0
APIConnectionExists reports whether a live api toolkit serves a connection. The admin channel form uses it to warn about a channel naming a connection nothing serves, which is otherwise a channel that looks configured and fails only when something is sent to it.
func ChannelUpstream ¶ added in v1.149.0
func ChannelUpstream(reg *registry.Registry) notifypost.UpstreamFunc
ChannelUpstream resolves the api connection a chat or webhook channel delivers through to its authorized transport (#1720).
The registry is walked per send rather than snapshotted, for the reason the api browser's locator walks it per request: a connection added or re-keyed through the admin API is reachable without a restart, and a channel holding a transport built at startup would keep posting with a credential the operator has already rotated.
Returns nil when there is no registry to walk, which leaves the three HTTP channel kinds undeliverable rather than silently failing per send.
func Wire ¶
func Wire(deps Deps)
Wire assembles the notify tool and registers it, or does nothing when this deployment cannot send at all.
The channel store and the enqueuer are built here rather than taken from the HTTP composition root's delivery handle, because the tool is registered on the MCP server during platform construction and that handle does not exist yet. Both are stateless over the same pool, so there is nothing to share: what must agree is the table, and it does.
Types ¶
type Deps ¶
type Deps struct {
// DB is the platform pool. nil registers no tool.
DB *sql.DB
// Server is the MCP server the tool is registered on. nil registers
// nothing.
Server *mcp.Server
// Enabled is the deployment's notifications setting. False registers no
// tool, so a deployment that turned notifications off does not advertise
// a way to send one.
Enabled bool
// Personas resolves which connections a persona reaches, which is what
// decides the channels a caller may send to.
Personas *persona.Registry
// Assets, Blobs, Shares and Collections are the portal stores publish
// reads an asset and its entitlement through. All nil leaves publish
// refusing and the other two actions unaffected.
Assets portal.AssetStore
Blobs portal.S3Client
Collections portal.CollectionStore
// Resources reads a managed resource a send attaches. nil leaves
// resources unattachable.
Resources resource.Store
// PortalURL is the deployment's public address, for the link a published
// document carries.
PortalURL string
// Toolkits is the live toolkit registry the chat channels' api
// connections are found in, for listing a bot's channels (#2241). nil
// lists none.
Toolkits *registry.Registry
// DigestHourUTC is the hour a daily channel's bulletin is scheduled for.
DigestHourUTC int
}
Deps are what the facade hands over. Every field is a value it already holds; nothing here reads configuration or opens a connection of its own.