Documentation
¶
Overview ¶
Package gateway runs an agent's chat platforms as one process: the adapters and their ingress (polling or a webhook server) feed one at-least-once processor over local sessions, beside the fronts that drive the agent themselves. Its caller reads the environment and supplies the persistence (DECISIONS.md D27, "Team agents").
Index ¶
- func Authorizer(allowed string) (func(chat.Message) error, error)
- func Run(ctx context.Context, options Options) error
- func RunFronts(ctx context.Context, fronts []func(context.Context) error, log io.Writer, ...) error
- func Webhook(platform, listen, path string, ...) func(context.Context, func(chat.Message) error) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authorizer ¶
Authorizer admits only the platform user IDs in allowed, a comma-separated list (ORB_CHAT_ALLOWED_SENDERS).
func RunFronts ¶
func RunFronts(ctx context.Context, fronts []func(context.Context) error, log io.Writer, close func(context.Context) error) error
RunFronts runs an agent's fronts until one ends or ctx does, stops the others, then closes; the ending front's error is the result, and an ended ctx is a clean stop.
Types ¶
type Options ¶
type Options struct {
// DataDir holds the gateway's sessions and, without Spool, its spool file.
DataDir string
Adapters []chat.Adapter
Ingresses []func(context.Context, func(chat.Message) error) error
// Fronts run beside the gateway (see RunFronts).
Fronts []func(context.Context) error
Authorize func(chat.Message) error
Provider []chat.LocalProviderOption
// Spool, when set, holds the queue instead of DataDir/spool.jsonl, and
// the gateway then locks DataDir for this process.
Spool chat.Spool
Log io.Writer
}
Click to show internal directories.
Click to hide internal directories.