api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

ABOUTME: API handlers for team analytics endpoints (usage, heatmap, tool distribution). ABOUTME: Parses date range query params and delegates to ReadStore analytics methods.

ABOUTME: HTTP handler for git link lookup by commit SHA or PR URL. ABOUTME: Queries the store for git links and returns matching results with session metadata.

ABOUTME: HTTP middleware for logging and CORS. ABOUTME: Logs method, path, status, duration for each request; adds permissive CORS headers.

ABOUTME: JSON response helpers for the HTTP API. ABOUTME: Provides writeJSON and writeError for consistent API responses.

ABOUTME: HTTP handler for the search API endpoint. ABOUTME: Maps query parameters to search filters and returns BM25-ranked results with snippets.

ABOUTME: HTTP API server for the team conversation browser. ABOUTME: Routes API requests to handlers and serves the SPA fallback for non-API paths.

ABOUTME: API handlers for session list, detail, messages, and metadata endpoints. ABOUTME: Maps HTTP query params to store filters and returns JSON responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageWithToolCalls

type MessageWithToolCalls struct {
	SessionID     string           `json:"session_id"`
	Ordinal       int              `json:"ordinal"`
	Role          string           `json:"role"`
	Content       string           `json:"content"`
	Timestamp     *time.Time       `json:"timestamp"`
	HasThinking   bool             `json:"has_thinking"`
	HasToolUse    bool             `json:"has_tool_use"`
	ContentLength int              `json:"content_length"`
	ToolCalls     []store.ToolCall `json:"tool_calls"`
}

MessageWithToolCalls combines a message with its associated tool calls for API responses.

type Server

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

Server serves the REST API and SPA frontend.

func New

func New(s store.ReadStore) *Server

New creates an API server with all routes registered.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP delegates to the middleware-wrapped handler.

Jump to

Keyboard shortcuts

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