httpapi

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package httpapi serves the AGH transport API over TCP HTTP/SSE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(router gin.IRouter, handlers *Handlers)

RegisterRoutes registers the shared AGH API routes on the supplied Gin router.

Types

type ExtensionService

type ExtensionService = core.ExtensionService

ExtensionService exposes daemon-backed extension management to the HTTP API.

type Handlers

type Handlers struct {
	*core.BaseHandlers

	Extensions ExtensionService
	// contains filtered or unexported fields
}

Handlers expose request/response and SSE endpoints for the AGH API.

type Option

type Option func(*Server)

Option customizes HTTP server construction.

func WithAgentCatalog

func WithAgentCatalog(catalog core.AgentCatalog) Option

WithAgentCatalog injects the projected resource-backed agent catalog.

func WithAgentContext

func WithAgentContext(service core.AgentContextService) Option

WithAgentContext injects the bounded agent situation context service.

func WithAgentLoader

func WithAgentLoader(loader core.AgentLoader) Option

WithAgentLoader overrides agent definition loading.

func WithAutomation

func WithAutomation(manager core.AutomationManager) Option

WithAutomation injects the daemon-owned automation manager.

func WithBridgeService

func WithBridgeService(bridges core.BridgeService) Option

WithBridgeService injects the daemon-owned bridge runtime.

func WithBundleService

func WithBundleService(service core.BundleService) Option

WithBundleService injects the daemon-owned bundle runtime.

func WithConfig

func WithConfig(cfg *aghconfig.Config) Option

WithConfig overrides the runtime configuration used by the server.

func WithCoordinatorConfig

func WithCoordinatorConfig(resolver core.CoordinatorConfigResolver) Option

WithCoordinatorConfig injects the resolved coordinator policy reader.

func WithDreamTrigger

func WithDreamTrigger(trigger core.DreamTrigger) Option

WithDreamTrigger injects the dream-consolidation trigger surfaced by the daemon.

func WithEngine

func WithEngine(engine *gin.Engine) Option

WithEngine overrides the Gin engine used by the server, mainly for tests.

func WithExtensionService

func WithExtensionService(service ExtensionService) Option

WithExtensionService injects daemon-backed extension management handlers.

func WithHeartbeatAuthoring

func WithHeartbeatAuthoring(service core.HeartbeatAuthoringService) Option

WithHeartbeatAuthoring injects the managed Heartbeat authoring surface.

func WithHeartbeatStatus

func WithHeartbeatStatus(service core.HeartbeatStatusService) Option

WithHeartbeatStatus injects the Heartbeat status/read surface.

func WithHeartbeatWake

func WithHeartbeatWake(service core.HeartbeatWakeService) Option

WithHeartbeatWake injects the manual Heartbeat wake surface.

func WithHeartbeatWakeEventReader

func WithHeartbeatWakeEventReader(reader core.HeartbeatWakeEventReader) Option

WithHeartbeatWakeEventReader injects the retained Heartbeat wake audit reader.

func WithHomePaths

func WithHomePaths(homePaths aghconfig.HomePaths) Option

WithHomePaths overrides the resolved AGH home layout.

func WithHost

func WithHost(host string) Option

WithHost overrides the HTTP bind host.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger injects the server logger.

func WithMemoryExtractorService

func WithMemoryExtractorService(service core.MemoryExtractorService) Option

WithMemoryExtractorService injects the daemon-owned Memory v2 extractor runtime.

func WithMemoryProviderService

func WithMemoryProviderService(service core.MemoryProviderService) Option

WithMemoryProviderService injects the daemon-owned MemoryProvider registry service.

func WithMemorySessionLedgerService

func WithMemorySessionLedgerService(service core.MemorySessionLedgerService) Option

WithMemorySessionLedgerService injects the daemon-owned session ledger service.

func WithMemoryStore

func WithMemoryStore(store *memory.Store) Option

WithMemoryStore injects the memory store surfaced by the daemon.

func WithModelCatalogService

func WithModelCatalogService(service core.ModelCatalogService) Option

WithModelCatalogService injects the daemon-owned provider model catalog service.

func WithNetworkService

func WithNetworkService(service core.NetworkService) Option

WithNetworkService injects the runtime network manager.

func WithNetworkStore

func WithNetworkStore(store core.NetworkStore) Option

WithNetworkStore injects the persisted network query store.

func WithNotificationPresetService

func WithNotificationPresetService(service core.NotificationPresetService) Option

WithNotificationPresetService injects the daemon-owned notification preset runtime.

func WithNow

func WithNow(now func() time.Time) Option

WithNow overrides the server clock, mainly for tests.

func WithObserver

func WithObserver(observer core.Observer) Option

WithObserver injects the runtime observer.

func WithOnboardingStore

func WithOnboardingStore(store core.OnboardingStore) Option

WithOnboardingStore injects the first-run onboarding completion store.

func WithPollInterval

func WithPollInterval(interval time.Duration) Option

WithPollInterval overrides the SSE poll cadence.

func WithPort

func WithPort(port int) Option

WithPort overrides the HTTP bind port.

func WithResourceOperatorAuth

func WithResourceOperatorAuth(middleware ...gin.HandlerFunc) Option

WithResourceOperatorAuth gates HTTP resource routes behind explicit operator auth middleware.

func WithResourceService

func WithResourceService(service core.ResourceService) Option

WithResourceService injects the shared operator-facing desired-state resource service.

func WithSessionCatalog

func WithSessionCatalog(catalog core.SessionCatalog) Option

WithSessionCatalog injects the daemon-owned session catalog.

func WithSessionHealthReader

func WithSessionHealthReader(reader core.SessionHealthReader) Option

WithSessionHealthReader injects the metadata-only session health reader.

func WithSessionManager

func WithSessionManager(manager core.SessionManager) Option

WithSessionManager injects the runtime session manager.

func WithSettingsRestartController

func WithSettingsRestartController(controller core.SettingsRestartController) Option

WithSettingsRestartController injects the daemon-owned restart action surface for settings handlers.

func WithSettingsService

func WithSettingsService(service core.SettingsService) Option

WithSettingsService injects the daemon-owned settings service.

func WithSettingsUpdateController

func WithSettingsUpdateController(controller core.SettingsUpdateController) Option

WithSettingsUpdateController injects the daemon-owned update status surface for settings handlers.

func WithSkillsRegistry

func WithSkillsRegistry(registry core.SkillsRegistry) Option

WithSkillsRegistry injects the skills registry surfaced by the daemon.

func WithSoulAuthoring

func WithSoulAuthoring(service core.SoulAuthoringService) Option

WithSoulAuthoring injects the managed Soul authoring surface.

func WithSoulRefresher

func WithSoulRefresher(service core.SoulRefresher) Option

WithSoulRefresher injects the session Soul refresh surface.

func WithStartedAt

func WithStartedAt(startedAt time.Time) Option

WithStartedAt overrides the daemon start time reported by the API.

func WithSupportBundleService

func WithSupportBundleService(service core.SupportBundleService) Option

WithSupportBundleService injects the daemon-owned support bundle operation service.

func WithTaskService

func WithTaskService(service core.TaskService) Option

WithTaskService injects the daemon-owned task service.

func WithToolApprovalIssuer

func WithToolApprovalIssuer(issuer core.ToolApprovalIssuer) Option

WithToolApprovalIssuer injects the local approval-token issuer.

func WithToolRegistry

func WithToolRegistry(registry core.ToolRegistry) Option

WithToolRegistry injects the executable tool registry.

func WithToolsetRegistry

func WithToolsetRegistry(registry core.ToolsetRegistry) Option

WithToolsetRegistry injects the named toolset projection registry.

func WithVaultService

func WithVaultService(service core.VaultService) Option

WithVaultService injects the daemon-owned vault control surface.

func WithWorkspaceResolver

func WithWorkspaceResolver(workspaces core.WorkspaceService) Option

WithWorkspaceResolver injects the runtime workspace resolver/service.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server exposes the daemon API over TCP HTTP.

func New

func New(opts ...Option) (*Server, error)

New constructs an HTTP API server.

func (*Server) Port

func (s *Server) Port() int

Port reports the effective HTTP port.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown stops accepting new requests and drains active ones.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start begins serving the API over the configured TCP address.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL