Documentation
¶
Overview ¶
Package chat runs app-bound conversations in Airlock through the shared Sol runtime. Apps execute capabilities, never model prompt loops.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrShuttingDown = errors.New("hosted chat is shutting down")
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
PrepareChat(context.Context, capabilities.Scope, wire.PromptInput) (chatruntime.Input, error)
SettleChat(context.Context, *dbq.Queries, uuid.UUID, string) error
}
Backend supplies service-owned runtime operations. Start and the capability broker authorize callers before passing host-derived scope to these methods; SettleChat runs inside the lease owner's completion or recovery transaction.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(database *db.DB, broker *capabilities.Service, backend Backend, executors container.JSExecutorManager, logger *zap.Logger) *Service
func (*Service) Shutdown ¶
Shutdown rejects admission, interrupts hosted chat, and waits for runtime, executor, lease-heartbeat and settlement work. It does not cancel durable jobs or persist user cancellation. Interrupted owners stop renewing their DB leases; Recover settles those leases after expiry. A deadline error means dependencies must remain open until Shutdown succeeds or the process exits.