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. A2A sibling callers pass the rename-safe UUID; external MCP clients paste a config URL that typically carries the 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 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 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 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 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 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 execendpoints owns the operator-facing CRUD + test of per-agent SSH exec endpoints (declared by the agent via RegisterExecEndpoint, configured by the operator here).
|
Package execendpoints owns the operator-facing CRUD + test of per-agent SSH exec endpoints (declared by the agent via RegisterExecEndpoint, configured by the operator here). |
|
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 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 integrations provides authenticated development-time access to an agent's bound connections, exec endpoints, and MCP servers.
|
Package integrations provides authenticated development-time access to an agent's bound connections, exec endpoints, and MCP servers. |
|
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 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 the sluggable resource types (connection, mcp_server, exec_endpoint): 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 the sluggable resource types (connection, mcp_server, exec_endpoint): 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 the tenant-wide LLM provider catalog: rows in the providers table, their encrypted API keys, and the lifecycle (create / list / update / delete).
|
Package providers owns the tenant-wide LLM provider catalog: rows in the providers table, their encrypted API keys, and the lifecycle (create / list / update / delete). |
|
Package resources owns the per-user inventory and management surface for reusable connections, MCP servers, and exec endpoints.
|
Package resources owns the per-user inventory and management surface for reusable connections, MCP servers, and exec endpoints. |
|
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 settings owns the single-row system_settings table: the tenant-wide default (provider FK, bare model name) pairs the agent-create flow prefills from.
|
Package settings owns the single-row system_settings table: the tenant-wide default (provider FK, bare model name) pairs the agent-create flow prefills from. |
|
Package siblings is the per-agent "address book" of other agents a parent agent's LLM may reach via A2A MCP.
|
Package siblings is the per-agent "address book" of other agents a parent agent's LLM may reach via A2A MCP. |
|
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. |