Documentation
¶
Overview ¶
Package config manages CSX_HOME and $CSX_HOME/config.json (goal.md §5.4 — every setting has a working default; the only choice the user ever has to make is the mode).
Index ¶
Constants ¶
const ( ModeUninitialized = "" ModeCommunity = "community" ModeLocalOnly = "local-only" )
Mode values. Empty means uninitialized: csx init has not run yet.
Variables ¶
This section is empty.
Functions ¶
func EnsureHome ¶
EnsureHome creates the home directory tree (cas, samples, logs). It is idempotent.
func MayContactRegistries ¶ added in v0.1.4
MayContactRegistries reports whether this mode is allowed to ask a public registry whether a package exists.
LOCAL ONLY says "nothing about your projects ever leaves this machine", and the README says it in nine languages: local-only mode transmits nothing at all. A publicness probe is a transmission — it hands npm, PyPI, crates.io or the Go proxy the name of every dependency in the lockfile, one request each, from a user who chose the mode that promised exactly this would not happen. The daemon already refused to name packages to the server for this reason; the scan path, the run path, sample creation and the MCP server all did it anyway, on every build.
Uninitialized is excluded too: before csx init, no mode has been chosen, so no permission has been given.
Types ¶
type Config ¶
type Config struct {
SchemaVersion int `json:"schemaVersion"`
Mode string `json:"mode"` // "" | "community" | "local-only"
ServerURL string `json:"serverUrl"`
PeerListen bool `json:"peerListen"`
PeerPort int `json:"peerPort"`
DaemonPort int `json:"daemonPort"`
IdleVerification string `json:"idleVerification"`
LLMCommand string `json:"llmCommand"`
ExcludedPackages []string `json:"excludedPackages"`
PinnedPackages []string `json:"pinnedPackages"`
CacheBudgetMB int `json:"cacheBudgetMB"`
GithubLogin string `json:"githubLogin"`
APIToken string `json:"apiToken"`
}
Config is the persisted local client configuration.
func Load ¶
Load reads home/config.json. A missing file yields the defaults; fields absent from the file keep their default values.
func (*Config) IsExcluded ¶ added in v0.1.4
IsExcluded reports whether the user asked for this package to be left out of everything that leaves the machine.
The setting was accepted, saved, echoed back by `csx config get` and consulted by nothing at all: excluded packages were still recorded as observations, still uploaded, and still named in the shard warm list — which asks the server about them by name, so the exclusion leaked the very interest it was meant to hide.
Matching is deliberately generous, because a person typing this setting is stating an intent, not writing a query. Any of these excludes pkg:npm/@acme/widgets@1.2.3:
pkg:npm/@acme/widgets@1.2.3 the exact purl pkg:npm/@acme/widgets the purl without a version npm/@acme/widgets ecosystem and name @acme/widgets the name alone, every ecosystem
A privacy setting that silently matches less than the user meant is worse than one that matches a little more, so ambiguity resolves toward excluding.