Skip to main content

Module connectors

Module connectors 

Source
Expand description

Managed Connectors for the hosted team server (#281).

A connector is a scheduled, in-process sync from an external source (GitLab / GitHub) into a team workspace’s long-term stores (BM25 + graph + knowledge). Once a connector has run, ctx_semantic_search and ctx_knowledge surface the source’s issues / PRs / pipelines to every seat — no per-call credential transport, no manual ctx_provider invocation.

Where credentials live. A connector’s credential is only ever present in the injected team.json (a private Coolify env var, LEAN_CTX_TEAM_CONFIG). The control plane keeps the secret encrypted at rest and decrypts it solely to render that env var; it is never written to disk by the server and never returned by v1_connectors.

Local-Free Invariant. Connectors are a hosted convenience: they only add context to a hosted workspace and gate nothing locally.

Structs§

ConnectorConfig
One configured connector, deserialized from team.json (connectors[]).
ConnectorRunState
Persisted outcome of a connector’s most recent sync (one file per connector under <state_dir>/<id>.json). Never contains the credential.

Functions§

is_due
Pure scheduler decision: is a connector due to run now?
spawn_scheduler
Spawn the background scheduler. Ticks every tick, runs each due connector once (blocking work on the blocking pool), and records its outcome. A no-op when no connectors are configured.
usage_rollup
Aggregate connector activity for the usage snapshot (#283). Reads each connector’s persisted run state only; never touches credentials.
v1_connectors
GET /v1/connectors — secret-free roster + per-connector sync status. Gated on the audit scope (read by the control plane via its audit-only token, the same path the savings roll-up uses).