Documentation
¶
Overview ¶
Package service holds the per-domain business-logic layer that sits between HTTP handlers and the database. Handlers parse + serialize; services own authorization gating, sqlc queries, and side effects.
The sentinel errors, their Detail wrapper, and HTTPStatus live in the leaf package apperr so the authz layer can return them without an import cycle; they are re-exported here as service.ErrX for the many callers (and errors.Is checks) that reference them through service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrForbidden = apperr.ErrForbidden ErrNotFound = apperr.ErrNotFound ErrConflict = apperr.ErrConflict ErrInvalidInput = apperr.ErrInvalidInput )
Sentinel errors, re-exported from apperr. Same values, so errors.Is(err, service.ErrForbidden) matches an apperr.ErrForbidden returned by authz.
Functions ¶
func HTTPStatus ¶
HTTPStatus maps a service sentinel error to its HTTP status code; see apperr.HTTPStatus.
func ResolveAgent ¶
ResolveAgent looks up an agent by either its UUID or its slug. Used by surfaces whose route param is shaped as `{identifier}` — the MCP JSON-RPC entry point and the OAuth Authorization Server endpoints. External MCP clients can use the rename-safe UUID or a slug. Either form resolves to the same row. This is a lookup, not an authorization gate — callers gate separately via authz.Authorize / authz.Principal.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package accounts owns self-profile, session, and subscription projections.
|
Package accounts owns self-profile, session, and subscription projections. |
|
Package agentruns owns durable application task sessions, hierarchical calls, scheduling and budgets.
|
Package agentruns owns durable application task sessions, hierarchical calls, scheduling and budgets. |
|
Package agents owns the agent-lifecycle business logic: create, configure, build/upgrade/rollback, start/stop/suspend, list/get detail, and the per-agent git-remote bindings.
|
Package agents owns the agent-lifecycle business logic: create, configure, build/upgrade/rollback, start/stop/suspend, list/get detail, and the per-agent git-remote bindings. |
|
Package agentstorage owns authorization and canonical resolution for paths supplied through user, run, and MCP surfaces.
|
Package agentstorage owns authorization and canonical resolution for paths supplied through user, run, and MCP surfaces. |
|
Package appruntime implements capabilities granted to a current app credential.
|
Package appruntime implements capabilities granted to a current app credential. |
|
Package bridgeevents authorizes bridge controls against their exact persisted platform, account, conversation, and run binding.
|
Package bridgeevents authorizes bridge controls against their exact persisted platform, account, conversation, and run binding. |
|
Package bridges owns the chat-platform-integration lifecycle: create / list / update / delete a bridge row plus the corresponding poller goroutine and per-bridge driver state.
|
Package bridges owns the chat-platform-integration lifecycle: create / list / update / delete a bridge row plus the corresponding poller goroutine and per-bridge driver state. |
|
Package capabilities is the run-scoped authorization and dispatch boundary shared by direct tools and JavaScript capability callbacks.
|
Package capabilities is the run-scoped authorization and dispatch boundary shared by direct tools and JavaScript capability callbacks. |
|
Package catalog owns the read-only provider/model catalog and the per-provider capability matrix the Settings UI renders.
|
Package catalog owns the read-only provider/model catalog and the per-provider capability matrix the Settings UI renders. |
|
Package chat runs app-bound conversations in Airlock through the shared Sol runtime.
|
Package chat runs app-bound conversations in Airlock through the shared Sol runtime. |
|
Package chatruns owns durable hosted-run leases.
|
Package chatruns owns durable hosted-run leases. |
|
Package connections owns reusable connection and MCP credentials, their need-aware OAuth lifecycle, agent env vars, and aggregate setup status.
|
Package connections owns reusable connection and MCP credentials, their need-aware OAuth lifecycle, agent env vars, and aggregate setup status. |
|
Package connectorartifacts owns operator access to same-repository connector builds and the cross-replica retention sweep for their object storage.
|
Package connectorartifacts owns operator access to same-repository connector builds and the cross-replica retention sweep for their object storage. |
|
Package connectordirectories authorizes and dispatches connector directory operations and owns direct agent-storage transfer finalization.
|
Package connectordirectories authorizes and dispatches connector directory operations and owns direct agent-storage transfer finalization. |
|
Package connectorjobs owns durable connector command dispatch, delivery leases, progress, cancellation, completion, and cross-replica waiting.
|
Package connectorjobs owns durable connector command dispatch, delivery leases, progress, cancellation, completion, and cross-replica waiting. |
|
Package connectormaintenance reconciles durable connector lifecycle state.
|
Package connectormaintenance reconciles durable connector lifecycle state. |
|
Package connectororchestration owns static target groups and persisted multi-target connector command orchestration.
|
Package connectororchestration owns static target groups and persisted multi-target connector command orchestration. |
|
Package connectors owns connector interface contracts, readiness, grants, and operator-visible connector resources.
|
Package connectors owns connector interface contracts, readiness, grants, and operator-visible connector resources. |
|
Package conversations owns the read/list/delete + topic-subscription lifecycle of web conversation threads.
|
Package conversations owns the read/list/delete + topic-subscription lifecycle of web conversation threads. |
|
Package execution admits runs with immutable host-derived origin and rechecks their credential and grant state across replicas.
|
Package execution admits runs with immutable host-derived origin and rechecks their credential and grant state across replicas. |
|
Package gitcredentials owns the per-user git PAT credential surface (list / create / delete).
|
Package gitcredentials owns the per-user git PAT credential surface (list / create / delete). |
|
Package grants owns model entitlements ((provider, model) -> principal).
|
Package grants owns model entitlements ((provider, model) -> principal). |
|
Package hosts owns host enrollment, authentication, inventory, connector ownership, and durable host management work.
|
Package hosts owns host enrollment, authentication, inventory, connector ownership, and durable host management work. |
|
Package identity owns the per-user mapping from airlock users to external chat-platform user IDs (telegram).
|
Package identity owns the per-user mapping from airlock users to external chat-platform user IDs (telegram). |
|
Package inboundoauth owns external-client entitlement and authenticated grant management.
|
Package inboundoauth owns external-client entitlement and authenticated grant management. |
|
Package integrations provides authenticated development-time access to an agent's bound connections and MCP servers.
|
Package integrations provides authenticated development-time access to an agent's bound connections and MCP servers. |
|
Package jobs owns durable background-job acceptance and lifecycle access.
|
Package jobs owns durable background-job acceptance and lifecycle access. |
|
Package managedbots owns the Telegram Bot API "Managed Bots" create-flow's session correlation: airlock UI button → manager-bot deep link → user creates a bot in Telegram → the manager bridge's poll loop receives ManagedBotCreated → bridge row inserted.
|
Package managedbots owns the Telegram Bot API "Managed Bots" create-flow's session correlation: airlock UI button → manager-bot deep link → user creates a bot in Telegram → the manager bridge's poll loop receives ManagedBotCreated → bridge row inserted. |
|
Package mcpaccess owns external MCP admission, catalogue and file authorization, and durable, credential-bound request cancellation.
|
Package mcpaccess owns external MCP admission, catalogue and file authorization, and durable, credential-bound request cancellation. |
|
Package members owns add/list/remove of agent_grants rows — the per-agent sharing list.
|
Package members owns add/list/remove of agent_grants rows — the per-agent sharing list. |
|
Package models owns the per-agent model configuration: the eight capability overrides (build/exec/stt/vision/tts/image_gen/embedding/ search), each a (provider FK, bare model name) pair, plus the declared model slots and their per-slot assignments.
|
Package models owns the per-agent model configuration: the eight capability overrides (build/exec/stt/vision/tts/image_gen/embedding/ search), each a (provider FK, bare model name) pair, plus the declared model slots and their per-slot assignments. |
|
Package needs owns the agent-need → resource lifecycle for connections and MCP servers: instantiating a resource from a need's declared shape, binding an existing resource to a need, and listing the resources that could satisfy a need.
|
Package needs owns the agent-need → resource lifecycle for connections and MCP servers: instantiating a resource from a need's declared shape, binding an existing resource to a need, and listing the resources that could satisfy a need. |
|
Package passkeys owns the per-user WebAuthn surface: registering, listing, renaming, and deleting the caller's own passkeys, plus setting and removing the caller's password.
|
Package passkeys owns the per-user WebAuthn surface: registering, listing, renaming, and deleting the caller's own passkeys, plus setting and removing the caller's password. |
|
Package providers owns configured LLM provider rows, optional encrypted API keys, confirmed endpoint-specific models, and model discovery.
|
Package providers owns configured LLM provider rows, optional encrypted API keys, confirmed endpoint-specific models, and model discovery. |
|
Package resources owns the per-user inventory and management surface for reusable resources.
|
Package resources owns the per-user inventory and management surface for reusable resources. |
|
Package runs owns the list / get / log / cancel operations for the runs table.
|
Package runs owns the list / get / log / cancel operations for the runs table. |
|
Package runtime implements the backing operations used by hosted chat and the authenticated agent protocol.
|
Package runtime implements the backing operations used by hosted chat and the authenticated agent protocol. |
|
Package settings owns the single-row system_settings table: tenant-wide locale, codegen limits, and default (provider FK, bare model name) pairs.
|
Package settings owns the single-row system_settings table: tenant-wide locale, codegen limits, and default (provider FK, bare model name) pairs. |
|
Package slashcommands owns command policy and execution against a scoped conversation capability.
|
Package slashcommands owns command policy and execution against a scoped conversation capability. |
|
Package systemchat owns system conversation admission and durable execution state.
|
Package systemchat owns system conversation admission and durable execution state. |
|
Package topicroutes resolves enrolled users to live bridge destinations.
|
Package topicroutes resolves enrolled users to live bridge destinations. |
|
Package usage serves read-only rollups over the llm_usage spend ledger for the admin Usage view: a window summary plus per-agent and per-model breakdowns.
|
Package usage serves read-only rollups over the llm_usage spend ledger for the admin Usage view: a window summary plus per-agent and per-model breakdowns. |
|
Package users owns the tenant-wide user directory: reads (List / ListDetail / Get / Lookup) at TenantUserView, self-service display-name updates at TenantSelfProfileUpdate, and admin mutators (Create / UpdateRole / Delete) at TenantUserManage.
|
Package users owns the tenant-wide user directory: reads (List / ListDetail / Get / Lookup) at TenantUserView, self-service display-name updates at TenantSelfProfileUpdate, and admin mutators (Create / UpdateRole / Delete) at TenantUserManage. |