Help us shape the future of Go! Take the 2026 Go Developer Survey

lidza

package module
v0.1.106 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

README

Līdza

Līdza is a web framework with a Go control plane (HTTP routing, dev proxy, CLI, MCP server), an optional Rust compute plane (packs compiled to WASM, run by wazero in a bounded, deadlined pool, for code that must be contained), and any frontend (Vite, Astro, Svelte, HTMX, Flutter). It is built for AI agents as the primary developers: machine-readable contracts, structured diagnostics, no implicit magic.

Name

  • Līdza in prose, docs and branding.
  • lidza in every identifier: CLI binary, Go module, crate prefix, config file, npm scope.

Quick start

curl -fsSL https://raw.githubusercontent.com/agim/lidza/master/install.sh | sh -s -- --services
lidza new myapp --packs db,auth,mail --agent claude && cd myapp
lidza dev
claude        # or: codex, gemini

Releases are tags (CHANGELOG.md): the installer installs the release it was tested with, go install github.com/agim/lidza/cmd/lidza@v0.1.2 a specific one, and an app's go.mod pins the version of the CLI that created it.

The installer sets up Go, Rust with wasm targets, the helper tools and the lidza CLI, skipping what you already have. lidza new writes the agent instructions once, in AGENTS.md, with CLAUDE.md and GEMINI.md importing it, so Claude Code, Codex and Gemini CLI can start building at once. Full guide: docs/getting-started.md.

Frontend

Default template: Vite + React + TypeScript. svelte, astro (static) and htmx (Go-rendered) are selectable at lidza new --template <name>. All follow the same contract: Go owns /api, types come from the generated client, production is one binary.

Deploying

lidza build makes one binary; docs/deploy.md covers running it yourself (systemd, Docker, TLS built in or behind a proxy). For managed deploys from a portal, Līdza Deploy is a deployment agent and web control panel for Līdza apps: deploys from GitHub on push, many apps per server, each on its own domain with automatic HTTPS, health checks before traffic switches, logs, history and rollback, and team roles.

Status

Phases 1 to 9 done: lidza new with the react, svelte, astro and htmx templates, lidza dev (Go and frontend hot reload behind one port), lidza build (one binary), the agent interface (lidza check --json, lidza context, lidza mcp, /llms.txt), schema.lidza with generated Go, SQL, migrations and Rust, typed handlers, OpenAPI and the generated @lidza/client, the middleware pipeline, and packs: Rust capabilities run as WASM in a bounded pool, official db, realtime, geo and media; scale primitives: /metrics, /healthz, /readyz, rate limiting, circuit breaker, lidza check rules for unbounded state, lidza benchmark on k6; application services: auth (sessions, sign-in with email and password or with Google, GitHub, Microsoft and any OIDC issuer), jobs, cache, i18n packs and lidza test; frontend depth: prerendered routes, accessibility in lidza check, useLive, client-side validators; teams and invitations, full-text search, outbound webhooks and Stripe billing; production readiness: fuzzed parsers, migrations without downtime, OpenTelemetry tracing, a configuration reference, Kubernetes manifests. Every roadmap phase is delivered. See docs/roadmap.md; docs/features.md maps every capability to a phase.

Developing the framework

The mail pack sends through Mailgun, SendGrid, Postmark, Resend or SMTP, with To/Reply-To lists, Cc/Bcc and byte attachments. Set ContentID on an attachment and reference cid:<ID> in HTML to embed it; the ID and filename stay independent. Queued delivery and retries preserve these fields and custom headers. SendTx commits the outbox and delivery job with application writes. Default limits are 50 recipients, 10 files and 10 MiB of decoded attachment data; set MAIL_MAX_RECIPIENTS, MAIL_MAX_ATTACHMENTS and MAIL_MAX_ATTACHMENT_BYTES to change them. MAIL_SMTP_TIMEOUT bounds the entire SMTP exchange (default 30 seconds). The generated guide's Send an email recipe covers the API and safety checks.

go vet ./... && staticcheck ./... && go test ./...
(cd core && cargo test)
go build -o bin/lidza ./cmd/lidza
bin/lidza new demo --lidza-dir "$PWD"   # an app pointed at this checkout

docs/environment.md has the full check list and the host setup.

Docs

  • docs/getting-started.md: install, create an app, build it with Claude Code, Codex or Gemini CLI.
  • docs/environment.md: host inventory, toolchain plan, services, layout, naming, verification.
  • docs/roadmap.md: phases and acceptance checks.
  • docs/features.md: feature matrix, what is done, what comes when, open decisions.
  • docs/scalability.md: the scalable-by-default primitives and the rules every change follows.
  • docs/design.md: why Līdza is built the way it is.
  • docs/configuration.md: every setting an app reads, generated from the source.
  • docs/security.md: what Līdza defends against and what it leaves to the app.
  • CONTRIBUTING.md: how to propose a change, the checks, the conventions.
  • docs/versioning.md: what the public API is, how releases may change it before v1.0, and the v1.0 freeze.
  • docs/deploy.md: deploying an app; managed deploys with Līdza Deploy.

License

Apache License 2.0. See LICENSE.

Documentation

Overview

Package lidza is the runtime a Līdza application links against. The app's main.go embeds its frontend build and calls Run; `lidza dev` starts the same binary in dev mode with the frontend proxied from its dev server.

Index

Constants

View Source
const (
	MetricsPath = "/metrics"
	HealthzPath = "/healthz"
	ReadyzPath  = "/readyz"
)

Paths every app serves besides /api and the frontend.

View Source
const (
	// EnvLog selects the format: "json" or "text". Default: text under
	// lidza dev and lidza test, json otherwise.
	EnvLog = "LIDZA_LOG"
	// EnvLogLevel is debug, info, warn or error; default info.
	EnvLogLevel = "LIDZA_LOG_LEVEL"
)

Logging environment.

View Source
const (
	// EnvTLSDomains lists the domains to serve, comma-separated; the first
	// is the app's public name (APP_URL when unset).
	EnvTLSDomains = "LIDZA_TLS_DOMAINS"
	// EnvTLSEmail is the ACME account contact (expiry warnings).
	EnvTLSEmail = "LIDZA_TLS_EMAIL"
	// EnvTLSAddr and EnvTLSHTTPAddr are the HTTPS and HTTP listen
	// addresses, :443 and :80 by default.
	EnvTLSAddr     = "LIDZA_TLS_ADDR"
	EnvTLSHTTPAddr = "LIDZA_TLS_HTTP_ADDR"
	// EnvTLSCacheDir stores certificates on disk instead of Postgres:
	// one node only.
	EnvTLSCacheDir = "LIDZA_TLS_CACHE_DIR"
	// EnvTLSDirectory is the ACME directory URL; Let's Encrypt by
	// default, its staging directory for rehearsals.
	EnvTLSDirectory = "LIDZA_TLS_DIRECTORY"
)

TLS from the environment: with LIDZA_TLS_DOMAINS set the binary serves HTTPS itself, with certificates from Let's Encrypt (ACME) obtained and renewed by golang.org/x/crypto/acme/autocert, and answers plain HTTP only to redirect to HTTPS and to prove domain ownership. No proxy is needed in front. The certificates live in Postgres through the db pack, so every node of the app shares them, as the stateless rule requires; a single node without the db pack names a directory in LIDZA_TLS_CACHE_DIR instead.

View Source
const (
	// EnvMCP set to "stdio" makes the binary serve its tools over stdio
	// instead of HTTP; `lidza mcp` uses it.
	EnvMCP = "LIDZA_MCP"
	// EnvMCPToken enables /mcp on the running binary for clients that
	// send it as a bearer token.
	EnvMCPToken = "LIDZA_MCP_TOKEN"
	// MCPPath is the Streamable HTTP endpoint.
	MCPPath = "/mcp"
)

Environment for app tools.

View Source
const DefaultStreamTimeout = 10 * time.Minute

DefaultStreamTimeout is the deadline for streamed operations.

View Source
const DefaultTimeout = 30 * time.Second

DefaultTimeout is the per-request deadline for API handlers.

View Source
const SecurityTxtPath = "/.well-known/security.txt"

SecurityTxtPath is where the app says how to report a vulnerability (RFC 9116), served when SECURITY_CONTACT is set.

Variables

This section is empty.

Functions

func DirFS

func DirFS(dir string) (fs.FS, error)

DirFS serves a directory on disk as an fs.FS that cannot leave it: a symlink inside pointing elsewhere, or any path that would escape, is refused (os.Root). For App.Dist from disk instead of the embedded build; os.DirFS follows symlinks out of the directory.

func HTTPClient

func HTTPClient(ctx context.Context) *http.Client

HTTPClient returns the client for outbound HTTP calls: the services' http.RoundTripper (a recorder or replayer under test) behind a 30-second timeout, or a plain client. Handlers use it for every external call so tests run offline against recorded fixtures.

func Handler

func Handler(app App) (http.Handler, error)

Handler builds the app's http.Handler: the API router under /api with the standard pipeline and, for every other path, the proxy to the frontend dev server (dev mode), the embedded build, or the app's own Frontend. Packs are not started; Serve does that.

func Log

func Log(ctx context.Context) *slog.Logger

Log returns the app logger for a request, with the request id attached so every line of one request can be found together. Outside a request it is the app logger.

func NewLogger

func NewLogger() *slog.Logger

NewLogger builds the app logger from the environment.

func Now

func Now(ctx context.Context) time.Time

Now returns the current time from the clock in ctx (the services' Clock, or the real one). Handlers use it instead of time.Now so a test can freeze or advance time.

func Optional

func Optional[T any](ctx context.Context) (T, bool)

Optional returns the T provided at start and whether there is one: for code that adapts to which packs are enabled (the admin pages).

func Provide

func Provide[T any](s *Services, v T)

Provide registers v under its static type T. Providing the same type twice replaces the first value.

func Reconfigure

func Reconfigure(ctx context.Context, s *Services) error

Reconfigure asks every service that can to read its configuration again. Every error is returned, joined.

func Run

func Run(app App)

Run serves the app until SIGINT or SIGTERM and exits the process with a non-zero status on error. Configuration comes from the environment:

LIDZA_ADDR          listen address, default 127.0.0.1:3000
LIDZA_MODE          "dev" to proxy the frontend instead of serving Dist
LIDZA_FRONTEND_URL  the frontend dev server (dev mode; set by `lidza dev`)
LIDZA_TRUSTED_PROXIES  proxies whose X-Forwarded-For counts (IPs,
                    CIDRs, loopback, private); ClientIP resolves
                    through them
LIDZA_TLS_DOMAINS   serve HTTPS on :443 for these domains with Let's
                    Encrypt certificates (stored in Postgres through the
                    db pack), redirect :80; APP_URL and AUTH_COOKIE_SECURE
                    follow unless set (see tls.go)

func Serve

func Serve(ctx context.Context, app App) error

Serve is Run without the process exit: it blocks until ctx is cancelled or a termination signal arrives, then shuts the server down.

func Service

func Service[T any](ctx context.Context) T

Service returns the T provided at start. A missing service is a wiring mistake, not a runtime condition, so it panics with the type name.

func Sub

func Sub(fsys fs.FS, dir string) fs.FS

Sub returns the subdirectory dir of fsys, for `//go:embed all:dist` followed by lidza.Sub(dist, "dist"). It panics if dir does not exist, which for an embedded FS is a build mistake, not a runtime condition.

func WithServices

func WithServices(ctx context.Context, s *Services) context.Context

WithServices attaches s to ctx; the app handler does this for every request, tests do it by hand.

Types

type App

type App struct {
	// Name is shown in logs.
	Name string
	// Dist is the built frontend, served in production. Nil for templates
	// without a static build.
	Dist fs.FS
	// Frontend serves every non-API path when there is no Dist (the htmx
	// template renders pages in Go). Ignored while the dev proxy is active.
	Frontend http.Handler
	// Routes registers the app's API handlers. May be nil.
	Routes func(r *router.Router)
	// Middleware wraps the whole app, API and frontend alike, outermost
	// first. The API router already runs request ids, logging, panic
	// recovery and the timeout; add CORS or auth here or with router.Use.
	Middleware []middleware.Middleware
	// Timeout is the deadline every API request's context gets; default
	// DefaultTimeout.
	Timeout time.Duration
	// StreamTimeout is the deadline of a streamed operation
	// (router.Stream, asked for with Accept: text/event-stream, as the
	// generated clients do); default DefaultStreamTimeout. A model's
	// answer streams for longer than a JSON reply takes.
	StreamTimeout time.Duration
	// CSP is the Content-Security-Policy sent with every response. Empty
	// sends middleware.DefaultCSP, except in dev mode (LIDZA_MODE=dev),
	// where Vite's dev server needs inline scripts and none is sent;
	// middleware.AddCSP extends it for another origin (a script CDN, an
	// image host). middleware.NoCSP sends none anywhere. A value set here
	// is sent in dev mode too.
	CSP string
	// PermissionsPolicy is the Permissions-Policy sent with every
	// response. Empty sends middleware.DefaultPermissionsPolicy (camera,
	// microphone and location off); an app that asks for the visitor's
	// location sets middleware.AllowGeolocation.
	PermissionsPolicy string
	// HSTS is the Strict-Transport-Security value. Empty sends
	// middleware.DefaultHSTS outside dev mode when APP_URL is https://
	// (as LIDZA_TLS_DOMAINS sets it), and none otherwise;
	// middleware.HSTSSubdomains covers the subdomains too, and
	// middleware.NoHSTS sends none.
	HSTS string
	// Head sets the <head> of each page served from Dist (the shell and
	// the prerendered pages, the SSR sidecar's and, under lidza dev, the
	// dev server's): title, description, canonical address, social tags
	// and JSON-LD, per request. A route with a parameter is one shell for
	// every address until Head names it. Return false to leave a page as
	// built. See Head.
	Head func(r *http.Request) (Head, bool)
	// Logger receives request and error logs. Default: NewLogger from
	// LIDZA_LOG and LIDZA_LOG_LEVEL, also installed as slog's default so
	// packs log the same way. Handlers use lidza.Log(ctx).
	Logger *slog.Logger
	// Packs are started in order before OnStart and stopped in reverse
	// after OnShutdown. packs.go, generated from lidza.json, lists them.
	Packs []Pack
	// Tools are the app's MCP tools (see Tool); tools.go lists them.
	Tools []Tool

	// OnStart runs after the packs and before the listener opens: connect
	// what the packs do not, warm caches, Provide services. An error
	// aborts the start.
	OnStart func(ctx context.Context, s *Services) error
	// OnReady runs once the app is listening.
	OnReady func()
	// OnShutdown runs after in-flight requests finished, before exit:
	// close pools, flush queues.
	OnShutdown func(ctx context.Context) error

	// TLSHosts approves a hostname beyond LIDZA_TLS_DOMAINS for a
	// certificate (a customer's own domain the app serves): nil approves
	// it, an error refuses it; a nil TLSHosts approves none. It is asked
	// during TLS handshakes, ACME challenges and before every certificate
	// order, renewals included, with the services in ctx (db.From works);
	// the verdict is cached per node, an approval 5 minutes and a refusal
	// 1 minute, so a host the app stops approving is refused within 5
	// minutes and never renewed. Certificates live in the same shared
	// cache as the listed domains'. Requests on an approved host reach the
	// whole app, as on a listed domain: a path outside /api is served
	// with r.Mount, and a middleware that checks r.Host keeps the rest
	// (the frontend, /api) to the app's own domains.
	TLSHosts func(ctx context.Context, host string) error

	// ReadyTimeout bounds the checks behind /readyz; default 3s.
	ReadyTimeout time.Duration
}

App describes one application.

type Booted

type Booted struct {
	Handler  http.Handler
	Services *Services
	// contains filtered or unexported fields
}

Booted is an app with its packs started and its handler built, not yet listening: what Serve runs and what tests drive through lidzatest.

func Boot

func Boot(ctx context.Context, app App) (*Booted, error)

Boot starts the packs in order, runs OnStart and builds the handler. Close stops everything in reverse.

func (*Booted) Close

func (b *Booted) Close(ctx context.Context) error

Close runs OnShutdown, then stops the packs in reverse order. Every error is logged; the first is returned.

type Clock

type Clock interface {
	Now() time.Time
}

Clock is where the app reads the time, so tests can set it. The real clock is the default; lidzatest provides a controllable one.

type Head = devserver.Head

Head is a page's head as the App.Head hook sets it: Title, Description, Canonical, Image, Type, SiteName, NoIndex, Meta, JSONLD and Status (devserver.Head documents each).

Head: func(r *http.Request) (lidza.Head, bool) {
	id, ok := strings.CutPrefix(r.URL.Path, "/products/")
	if !ok {
		return lidza.Head{}, false
	}
	p, err := queries.New(db.From(r.Context())).GetProduct(r.Context(), id)
	if err != nil {
		return lidza.Head{Title: "Not found", NoIndex: true, Status: http.StatusNotFound}, true
	}
	return lidza.Head{Title: p.Name, Description: p.Summary, Canonical: "https://example.com/products/" + id}, true
},

type HeadMeta

type HeadMeta = devserver.Meta

HeadMeta is one further <meta> tag of a Head.

type LocaleNegotiator

type LocaleNegotiator interface {
	NegotiateLocale(r *http.Request) string
}

LocaleNegotiator is implemented by packs that pick a request's locale, such as i18n: the embedded build serves the page prerendered in that locale (dist/.locales). It returns "" before the pack has started.

type Middlewarer

type Middlewarer interface {
	Middleware() middleware.Middleware
}

Middlewarer is implemented by packs that wrap every API request, such as i18n's locale negotiation. The middleware resolves the running pack from the request context, so it may be built before Start.

type Pack

type Pack interface {
	Name() string
	Start(ctx context.Context, s *Services) error
	Stop(ctx context.Context) error
}

Pack is a unit the app starts and stops: an official or local pack. Start registers whatever it offers (a pool, a client) with Provide.

type RealClock

type RealClock struct{}

RealClock is time.Now.

func (RealClock) Now

func (RealClock) Now() time.Time

Now implements Clock.

type Reconfigurable

type Reconfigurable interface {
	Reconfigure(ctx context.Context) error
}

Reconfigurable is a pack that can read its configuration again while the app runs: after a credential is saved from the admin pages, the mail, llm and storage packs pick up the new provider or key without a restart.

type Services

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

Services holds what packs and OnStart provide, keyed by static type, and hands it to handlers through the request context. It is filled at start and read-only afterwards.

func NewServices

func NewServices() *Services

NewServices returns an empty registry.

func ServicesFrom

func ServicesFrom(ctx context.Context) *Services

ServicesFrom returns the services in ctx, nil outside the app.

func (*Services) Each

func (s *Services) Each(f func(any))

Each calls f with every provided value, in no particular order.

func (*Services) Lookup

func (s *Services) Lookup(t reflect.Type) (any, bool)

Lookup returns the value registered for t.

type TLSHost

type TLSHost struct {
	Host     string
	Approved time.Time
	Expires  time.Time
}

TLSHost is a hostname with the certificate expiry last seen (zero before the first handshake) and, for a host the hook approved, when.

type TLSRefusal

type TLSRefusal struct {
	Host, Reason string
	At           time.Time
}

TLSRefusal is a hostname refused a certificate, and why.

type TLSReporter

type TLSReporter interface {
	Snapshot() TLSSnapshot
}

TLSReporter is what this node's TLS server knows about its hostnames, for the admin pages: the listed domains, the hosts App.TLSHosts approved, each with the expiry of the certificate last served, and the latest refusals. It is provided as a service while the binary serves TLS itself.

type TLSSnapshot

type TLSSnapshot struct {
	Domains  []TLSHost
	Approved []TLSHost
	Refused  []TLSRefusal
}

TLSSnapshot is a copy of the status.

type Tool

type Tool struct {
	Name        string
	Description string
	// Input is a value of the input type; its JSON Schema is derived from
	// the Go type. nil means no input.
	Input any
	// Handler receives the raw JSON input and returns a JSON-encodable
	// result or an error the caller sees.
	Handler func(ctx context.Context, input json.RawMessage) (any, error)
	// ReadOnly says the tool changes nothing (a lookup, a report): an
	// agent's client may run it without asking.
	ReadOnly bool
	// Destructive says the tool can lose data (a delete, an overwrite).
	// A tool marked neither counts as one that may.
	Destructive bool
}

Tool is an MCP tool the app defines: a name, a description, a JSON input and a handler that runs with the app's services (packs, clock, logger) in its context. `lidza mcp` exposes app tools next to the framework's; with LIDZA_MCP_TOKEN set, the running binary serves them at /mcp (Streamable HTTP) to agents that present the token.

func ToolFunc

func ToolFunc[In, Out any](name, description string, fn func(ctx context.Context, in In) (Out, error)) Tool

ToolFunc builds a Tool from a typed function. In is decoded from the input and validated when it implements validate.Validator.

Directories

Path Synopsis
cmd
lidza command
Command lidza is the Līdza CLI.
Command lidza is the Līdza CLI.
packs
admin
Package admin serves the app's admin pages at /admin: an overview with a setup checklist, users, the credentials of the sign-in, mail, language-model and storage providers (saved sealed with the master key and applied without a restart) plus the app's own (Options.Sections), token usage, the mail outbox, jobs and stored files.
Package admin serves the app's admin pages at /admin: an overview with a setup checklist, users, the credentials of the sign-in, mail, language-model and storage providers (saved sealed with the master key and applied without a restart) plus the app's own (Options.Sections), token usage, the mail outbox, jobs and stored files.
analytics
Package analytics is the official, opt-in error reporting and product analytics pack.
Package analytics is the official, opt-in error reporting and product analytics pack.
audit
Package audit is the official audit log pack: a durable record of who did what to which resource, when, and how it went, for an app's own routes and jobs.
Package audit is the official audit log pack: a durable record of who did what to which resource, when, and how it went, for an app's own routes and jobs.
auth
Package auth is the official authentication pack: password hashing (argon2id), signed access tokens (JWT HS256, short-lived), refresh sessions in Postgres (revocable, survive restarts), cookies for browsers and a bearer header for other clients, and the middleware that puts the user in the request context.
Package auth is the official authentication pack: password hashing (argon2id), signed access tokens (JWT HS256, short-lived), refresh sessions in Postgres (revocable, survive restarts), cookies for browsers and a bearer header for other clients, and the middleware that puts the user in the request context.
billing
Package billing is the official payments pack, on Stripe: an owner (a workspace, a user) subscribes to one of the app's plans through Stripe Checkout, manages it in Stripe's customer portal, and the app checks what the plan grants with Has.
Package billing is the official payments pack, on Stripe: an owner (a workspace, a user) subscribes to one of the app's plans through Stripe Checkout, manages it in Stripe's customer portal, and the app checks what the plan grants with Has.
cache
Package cache is the official cache pack: string keys with TTL on Valkey (or Redis), Remember for the read-through pattern and Incr for counters every node shares (a rate limit, a quota).
Package cache is the official cache pack: string keys with TTL on Valkey (or Redis), Remember for the read-through pattern and Incr for counters every node shares (a rate limit, a quota).
db
Package db is the official database pack: a bounded pgx pool from DATABASE_URL, migrations from db/migrations, and the sqlc configuration `lidza pack add db` writes so queries in db/queries become typed Go.
Package db is the official database pack: a bounded pgx pool from DATABASE_URL, migrations from db/migrations, and the sqlc configuration `lidza pack add db` writes so queries in db/queries become typed Go.
hooks
Package hooks is the official outbound webhooks pack: an app sends events to the URLs its users (or the app itself) subscribe, signed with the Standard Webhooks scheme (webhook-id, webhook-timestamp, webhook-signature; pkg/webhook.Standard verifies it), delivered in the background through the jobs pack with retries over about eleven hours, each attempt logged.
Package hooks is the official outbound webhooks pack: an app sends events to the URLs its users (or the app itself) subscribe, signed with the Standard Webhooks scheme (webhook-id, webhook-timestamp, webhook-signature; pkg/webhook.Standard verifies it), delivered in the background through the jobs pack with retries over about eleven hours, each attempt logged.
i18n
Package i18n is the official localization pack: message catalogs from locales/<lang>.json embedded in the binary, locale negotiation per request (query, cookie, Accept-Language), and formatting of numbers, currency and dates for the locale.
Package i18n is the official localization pack: message catalogs from locales/<lang>.json embedded in the binary, locale negotiation per request (query, cookie, Accept-Language), and formatting of numbers, currency and dates for the locale.
jobs
Package jobs is the official background work pack: a Postgres-backed queue (the job table from schema.lidza) with a bounded set of workers per node, retries with backoff, recurring schedules (Schedule), recovery of jobs whose worker died, and release of unfinished jobs at shutdown.
Package jobs is the official background work pack: a Postgres-backed queue (the job table from schema.lidza) with a bounded set of workers per node, retries with backoff, recurring schedules (Schedule), recovery of jobs whose worker died, and release of unfinished jobs at shutdown.
llm
Package llm is the language-model pack: one Chat, Stream, Embed, Generate and Run over Anthropic, OpenAI, Google and Ollama, spoken directly over HTTP, plus a fake provider for tests.
Package llm is the language-model pack: one Chat, Stream, Embed, Generate and Run over Anthropic, OpenAI, Google and Ollama, spoken directly over HTTP, plus a fake provider for tests.
mail
Package mail is the official transactional email pack: one Send behind which a provider delivers (Mailgun, SendGrid, Postmark, Resend, SMTP), or the message is logged or kept in the outbox for development and tests.
Package mail is the official transactional email pack: one Send behind which a provider delivers (Mailgun, SendGrid, Postmark, Resend, SMTP), or the message is logged or kept in the outbox for development and tests.
realtime
Package realtime is the official WebSocket pack: clients subscribe to topics over one connection at GET /api/v1/realtime, handlers publish JSON to topics, and a Valkey bus fans messages out across nodes so the app stays stateless.
Package realtime is the official WebSocket pack: clients subscribe to topics over one connection at GET /api/v1/realtime, handlers publish JSON to topics, and a Valkey bus fans messages out across nodes so the app stays stateless.
storage
Package storage is the file storage pack: one Put, Get, Stat, List, Delete and presigned URLs over any S3-compatible service (AWS S3, MinIO, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces) spoken directly with Signature V4 over HTTP, and a local provider that keeps files in a directory for development and tests.
Package storage is the file storage pack: one Put, Get, Stat, List, Delete and presigned URLs over any S3-compatible service (AWS S3, MinIO, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces) spoken directly with Signature V4 over HTTP, and a local provider that keeps files in a directory for development and tests.
pkg
apidoc
Package apidoc renders the framework's public Go API from its sources as the app resolves them (its go.mod, replace directives included), so an agent reads the signatures it can call instead of guessing them.
Package apidoc renders the framework's public Go API from its sources as the app resolves them (its go.mod, replace directives included), so an agent reads the signatures it can call instead of guessing them.
brief
Package brief is an app's brief: what it is for, who owns the data, how it looks, which services it uses, where it runs and how agents work on it, answered by the people who own the app.
Package brief is an app's brief: what it is for, who owns the data, how it looks, which services it uses, where it runs and how agents work on it, answered by the people who own the app.
civil
Package civil holds dates and times as people write them, with no time zone: Date is a calendar day (a schema.lidza date field, a Postgres date column), DateTime a wall-clock time as a form's date-time input sends it (a schema.lidza localtime field).
Package civil holds dates and times as people write them, with no time zone: Date is a calendar day (a schema.lidza date field, a Postgres date column), DateTime a wall-clock time as a form's date-time input sends it (a schema.lidza localtime field).
config
Package config reads lidza.json, the per-project configuration.
Package config reads lidza.json, the per-project configuration.
configref
Package configref builds docs/configuration.md, the reference of every setting a Līdza app reads, from the framework's source: the env tags of the packs' Config structs, the Env constants, and the settings read by name, each with its doc comment.
Package configref builds docs/configuration.md, the reference of every setting a Līdza app reads, from the framework's source: the env tags of the packs' Config structs, the Env constants, and the settings read by name, each with its doc comment.
configref/gen command
Command gen writes docs/configuration.md from the framework's source (go generate ./pkg/configref).
Command gen writes docs/configuration.md from the framework's source (go generate ./pkg/configref).
credentials
Package credentials keeps an app's secrets encrypted at rest: config/credentials.yml.enc holds KEY: value pairs sealed with AES-256-GCM under the master key in config/master.key (never committed) or LIDZA_MASTER_KEY (production).
Package credentials keeps an app's secrets encrypted at rest: config/credentials.yml.enc holds KEY: value pairs sealed with AES-256-GCM under the master key in config/master.key (never committed) or LIDZA_MASTER_KEY (production).
crud
Package crud generates a resource from a schema.lidza model: the sqlc queries, the Create and Update types, a handlers file with the five typed routes, and the registration in routes.go.
Package crud generates a resource from a schema.lidza model: the sqlc queries, the Create and Update types, a handlers file with the five typed routes, and the registration in routes.go.
decimal
Package decimal is the Go type of a schema.lidza decimal(p, s) field, a Postgres numeric(p, s) column: an exact decimal number kept as its text, "12.50", never as a float.
Package decimal is the Go type of a schema.lidza decimal(p, s) field, a Postgres numeric(p, s) column: an exact decimal number kept as its text, "12.50", never as a float.
decisions
Package decisions keeps an app's decision log, docs/decisions.md: why the app is built the way it is (a pack added, Rust chosen for a module, a dependency taken, a schema tradeoff), one dated entry each, written by people and agents alike and read before working in those areas.
Package decisions keeps an app's decision log, docs/decisions.md: why the app is built the way it is (a pack added, Rust chosen for a module, a dependency taken, a schema tradeoff), one dated entry each, written by people and agents alike and read before working in those areas.
devserver
Package devserver is the Līdza dev server: the reverse proxy that puts the Go control plane and the frontend dev server behind one port, the static file server used in production, and the coordinator that keeps the app binary rebuilt while `lidza dev` runs.
Package devserver is the Līdza dev server: the reverse proxy that puts the Go control plane and the frontend dev server behind one port, the static file server used in production, and the coordinator that keeps the app binary rebuilt while `lidza dev` runs.
diag
Package diag runs the checkers for every layer of a Līdza project (Go, Rust, frontend) and merges their output into one list of diagnostics with a layer, file, line and message each.
Package diag runs the checkers for every layer of a Līdza project (Go, Rust, frontend) and merges their output into one list of diagnostics with a layer, file, line and message each.
engine
Package engine runs pack WASM modules in wazero: a module compiled once, a bounded pool of pre-warmed instances, and calls with a deadline that pass JSON through linear memory (the ABI in core/src/abi.rs).
Package engine runs pack WASM modules in wazero: a module compiled once, a bounded pool of pre-warmed instances, and calls with a deadline that pass JSON through linear memory (the ABI in core/src/abi.rs).
env
Package env fills a configuration struct from the environment, so secrets and per-deployment settings never live in lidza.json or code.
Package env fills a configuration struct from the environment, so secrets and per-deployment settings never live in lidza.json or code.
inspect
Package inspect reads a Līdza project's source and produces the context an agent needs: the API routes with their handler signatures, the Rust exports, and the configuration.
Package inspect reads a Līdza project's source and produces the context an agent needs: the API routes with their handler signatures, the Rust exports, and the configuration.
jsonschema
Package jsonschema derives a JSON Schema from a Go type at runtime, for app-defined MCP tools whose input is a Go struct.
Package jsonschema derives a JSON Schema from a Go type at runtime, for app-defined MCP tools whose input is a Go struct.
lidzatest
Package lidzatest starts an app for a Go test: packs started against .env.test, the handler on an httptest server, and a JSON client.
Package lidzatest starts an app for a Go test: packs started against .env.test, the handler on an httptest server, and a JSON client.
list
Package list reads what a list route was asked for: a page (limit and offset, capped), a search, a time range, a sort among the allowed keys and equality filters, from the query string, validated, so a handler passes them to its query and nothing it did not allow reaches SQL.
Package list reads what a list route was asked for: a page (limit and offset, capped), a search, a time range, a sort among the allowed keys and equality filters, from the query string, validated, so a handler passes them to its query and nothing it did not allow reaches SQL.
mcpserver
Package mcpserver is `lidza mcp`: a Model Context Protocol server over stdio that gives an agent the project's route map, context, diagnostics, configuration and the runtime log of `lidza dev`, so it asks instead of grepping.
Package mcpserver is `lidza mcp`: a Model Context Protocol server over stdio that gives an agent the project's route map, context, diagnostics, configuration and the runtime log of `lidza dev`, so it asks instead of grepping.
middleware
Package middleware holds the request pipeline every Līdza app runs: panic recovery, request ids, request logging, per-request deadlines, body limits, CORS and secure headers.
Package middleware holds the request pipeline every Līdza app runs: panic recovery, request ids, request logging, per-request deadlines, body limits, CORS and secure headers.
pack
Package pack implements Līdza packs: a directory under packs/ with a manifest, a Rust crate compiled to WASM, and a generated Go wrapper that exposes each capability as a typed method backed by the engine.
Package pack implements Līdza packs: a directory under packs/ with a manifest, a Rust crate compiled to WASM, and a generated Go wrapper that exposes each capability as a typed method backed by the engine.
recipes
Package recipes turns the "Recipes" section of an app's guide (docs/lidza-guide.md) into task recipes: prompts served by `lidza mcp`, and skills for Claude Code (.claude/skills) and for Codex and Gemini CLI (.agents/skills, the Agent Skills layout both read; Gemini offers each as a /<name> command).
Package recipes turns the "Recipes" section of an app's guide (docs/lidza-guide.md) into task recipes: prompts served by `lidza mcp`, and skills for Claude Code (.claude/skills) and for Codex and Gemini CLI (.agents/skills, the Agent Skills layout both read; Gemini offers each as a /<name> command).
report
Package report is the seam between the places errors surface (panic recovery, typed handlers, the frontend) and whatever collects them (the analytics pack).
Package report is the seam between the places errors surface (panic recovery, typed handlers, the frontend) and whatever collects them (the analytics pack).
resilience
Package resilience holds the circuit breaker outbound calls run through, so a failing dependency sheds load fast instead of tying up every request until its timeout.
Package resilience holds the circuit breaker outbound calls run through, so a failing dependency sheds load fast instead of tying up every request until its timeout.
router
Package router is the Līdza control plane's HTTP router: the API routes an application registers, plus the built-in ones every app serves.
Package router is the Līdza control plane's HTTP router: the API routes an application registers, plus the built-in ones every app serves.
scaffold
Package scaffold implements `lidza new`: it copies a template and writes the Go entrypoint, lidza.json and the agent instruction files.
Package scaffold implements `lidza new`: it copies a template and writes the Go entrypoint, lidza.json and the agent instruction files.
schema
Package schema parses schema.lidza, the single source of truth for an application's data shapes, and generates Go structs with validation, the Postgres DDL and migrations, Rust serde structs and TypeScript types from it.
Package schema parses schema.lidza, the single source of truth for an application's data shapes, and generates Go structs with validation, the Postgres DDL and migrations, Rust serde structs and TypeScript types from it.
sdk
Package sdk generates the client SDKs from a project's operations.
Package sdk generates the client SDKs from a project's operations.
secrets
Package secrets recognises the secrets providers issue (API keys, tokens, private keys, database URLs with a password) in a string: what lidza check refuses in code (L010) and what the audit pack redacts.
Package secrets recognises the secrets providers issue (API keys, tokens, private keys, database URLs with a password) in a string: what lidza check refuses in code (L010) and what the audit pack redacts.
snippets
Package snippets embeds the files of the reference app (examples/notes) that show how the common tasks are done: an owned resource, auth routes, a page on the generated client, a handler test, a browser test, an MCP tool.
Package snippets embeds the files of the reference app (examples/notes) that show how the common tasks are done: an owned resource, auth routes, a page on the generated client, a handler test, a browser test, an MCP tool.
snippets/_files/handlers
One attachment per note through the storage pack.
One attachment per note through the storage pack.
snippets/internal/sync command
Command sync copies the reference app's files listed in the snippet index into pkg/snippets/_files, for embedding.
Command sync copies the reference app's files listed in the snippet index into pkg/snippets/_files, for embedding.
telemetry
Package telemetry gives every app /metrics (Prometheus exposition, OpenTelemetry-compatible), /healthz (liveness) and /readyz (readiness: every service that can check itself is asked).
Package telemetry gives every app /metrics (Prometheus exposition, OpenTelemetry-compatible), /healthz (liveness) and /readyz (readiness: every service that can check itself is asked).
tracing
Package tracing is Līdza's OpenTelemetry tracing: opt-in, configured by the standard OTEL_* environment variables, exported over OTLP/HTTP.
Package tracing is Līdza's OpenTelemetry tracing: opt-in, configured by the standard OTEL_* environment variables, exported over OTLP/HTTP.
validate
Package validate holds the rules generated Validate methods call and the error type they return.
Package validate holds the rules generated Validate methods call and the error type they return.
version
Package version reports the Līdza build version.
Package version reports the Līdza build version.
webhook
Package webhook receives a provider's webhooks safely: the signature is verified on the raw body before anything decodes it, deliveries outside the replay window are refused, and each delivery id is handled once.
Package webhook receives a provider's webhooks safely: the signature is verified on the raw body before anything decodes it, deliveries outside the replay window are refused, and each delivery id is handled once.
Package templates embeds the app templates that `lidza new` copies.
Package templates embeds the app templates that `lidza new` copies.

Jump to

Keyboard shortcuts

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