Documentation
¶
Overview ¶
Package httpapi exposes the local browser UI and core HTTP API routes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleStopResult ¶
type ConsoleStopResult struct {
// Available reports that a motion engine or device transport received it.
Available bool
// Confirmed reports that the device acknowledged it.
Confirmed bool
}
ConsoleStopResult is the outcome of a Stop from the launch console.
type RemoteInterfaceOptions ¶
type RemoteInterfaceOptions struct {
AllowedBrowserHosts []string
NetworkPolicy *netaccess.Policy
SecureCookies bool
}
RemoteInterfaceOptions describes an independently validated socket boundary. Both interfaces borrow the same domains and Stop path; no engine or worker is duplicated. Cookies have distinct names AND server-side session audiences.
type Runtime ¶
type Runtime struct {
// OpenAI endpoints are injectable only for isolated protocol tests.
OpenAIHTTPClient *http.Client
OpenAIIssuer string
OpenAIBaseURL string
Traces *diagnostics.TraceRing
Transport transport.DiagnosticsProvider
MotionTransport transport.Transport
MotionSimulated bool
LLMProvider llm.Provider
LLMHTTPClient *http.Client
CloudBaseURL string
CloudHTTPClient *http.Client
IntifaceHTTPClient *http.Client
// IntifaceSimulatorAddress replaces the saved Intiface address in
// -simulate-motion builds, so no real device is ever reached.
IntifaceSimulatorAddress string
BrowserBluetoothBridge *transport.BrowserBluetoothBridge
// CoyoteConnector replaces the Bluetooth worker, for simulation and tests.
CoyoteConnector estim.Connector
NativeBluetoothConnector ble.Connector
// ExecutablePath makes first-party worker discovery deterministic and
// injectable in tests. Empty falls back to os.Executable.
ExecutablePath string
UpdateHTTPClient *http.Client
UpdateReleaseAPIURL string
// Accounts is the process account domain. Nil creates one over Store's
// shared datastore. AuthenticationRequired protects every route except the
// deliberately public health, login/bootstrap, and Emergency Stop edges.
Accounts *accounts.Store
AuthenticationRequired bool
SecureCookies bool
RemoteURL string
AllowedBrowserHosts []string
NetworkPolicy *netaccess.Policy
NetworkCertificates netaccess.CertificateProvider
NetworkAutomation *netaccess.Automation
}
Runtime contains app runtime collaborators exposed through HTTP diagnostics.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server owns the local HTTP routes and embedded static asset serving.
func New ¶
func New(static fs.FS, logger *slog.Logger, store *config.Store, runtime Runtime, version VersionInfo) (*Server, error)
New wires the HTTP API to the embedded static assets and structured logger.
func (*Server) Close ¶
func (s *Server) Close()
Close releases runtime and datastore resources after quiescing device work. It is idempotent so startup failures and deferred shutdown can share it.
func (*Server) ConsoleStop ¶
func (s *Server) ConsoleStop(ctx context.Context) (ConsoleStopResult, error)
ConsoleStop serves the launch console's Stop key. It shares the Stop button's emergency-stop path, admission and audit, so the device can be stopped from the console window even with no browser open.
func (*Server) Quiesce ¶
func (s *Server) Quiesce()
Quiesce rejects new controller work, drains autonomous planners, and stops device motion before HTTP shutdown waits for active handlers.
func (*Server) RemoteHandler ¶
func (s *Server) RemoteHandler(options RemoteInterfaceOptions) http.Handler
RemoteHandler exposes an explicit allowlist. Even administrator credentials cannot turn this listener into the main app, a file server or a controller.
type VersionInfo ¶
VersionInfo identifies the build served by the HTTP API.
Source Files
¶
- access_audit.go
- account_recovery.go
- account_sessions.go
- auth.go
- auth_limiter.go
- autopilot.go
- autopilot_hold.go
- autopilot_pattern_response.go
- bluetooth_gateway.go
- bluetooth_transport.go
- chat.go
- chat_content.go
- chat_failures.go
- chat_history.go
- chat_history_request.go
- chat_interruption.go
- chat_motion_dispatch.go
- chat_pattern_target.go
- chat_preparation.go
- chat_publication.go
- chat_refusal_retry.go
- chat_repair_cancellation.go
- chat_response_repair.go
- chat_sessions.go
- chat_vibration.go
- chat_vibration_resume.go
- client_chat.go
- client_media.go
- client_motion.go
- client_settings.go
- client_transport.go
- client_voice.go
- cloud_autopilot.go
- cloud_planning.go
- cloud_transport.go
- command_capture.go
- command_delivery.go
- command_motion.go
- command_state.go
- content_response.go
- controller.go
- controller_remote.go
- controller_request.go
- controller_state.go
- controller_tickets.go
- coyote_discovery.go
- coyote_transport.go
- device_connections.go
- device_options.go
- diagnostic_archive.go
- diagnostic_personalization.go
- diagnostic_report.go
- diagnostic_voice.go
- dynamic_motion.go
- edge.go
- handy_connections.go
- handy_connections_intiface.go
- handy_connections_lifecycle.go
- handy_connections_native.go
- handy_connections_runtime.go
- host_path_picker.go
- host_path_picker_other.go
- hosted_chat_guard.go
- intiface_transport.go
- lab_observations.go
- lab_test_presets.go
- lab_test_runs.go
- lab_test_storage.go
- labs_settings.go
- layered_context.go
- library.go
- llm.go
- llm_catalog.go
- llm_duplicates.go
- llm_lab.go
- llm_lab_compare.go
- llm_lab_session.go
- llm_lab_validation.go
- llm_model_check.go
- llm_models.go
- llm_prepared.go
- llm_runtime_update.go
- llm_scheduler.go
- media.go
- media_metadata.go
- media_sync.go
- media_tools.go
- model_connection_readiness.go
- model_connections.go
- model_providers.go
- modes.go
- motion.go
- motion_lab.go
- motion_review.go
- motion_review_runtime.go
- native_bluetooth_transport.go
- network.go
- network_setup.go
- notice_preferences.go
- observations.go
- output_context.go
- permissions.go
- personalization.go
- personas.go
- playback_devices.go
- production_chat_preview.go
- prompt_inspector.go
- remote.go
- remote_interface.go
- remote_session.go
- remote_views.go
- request_admission.go
- request_response.go
- response_write.go
- server.go
- session_activity.go
- session_idle.go
- session_policy.go
- setup.go
- setup_assessment.go
- setup_chat_assessment.go
- setup_diskspace_other.go
- setup_failure.go
- setup_hardware.go
- setup_local_model.go
- setup_optional_jobs.go
- setup_parakeet_download.go
- setup_persistence.go
- setup_process_unix.go
- setup_qwen_reference.go
- setup_report.go
- setup_report_redaction.go
- setup_retry.go
- setup_voice_assessment.go
- setup_voice_update.go
- stop_admission.go
- trace_archive.go
- trace_archive_writer.go
- update.go
- vibrator_transport.go
- voice.go
- voice_audio_stream.go
- voice_install_candidate.go
- voice_module_update.go