Skip to main content

Module config

Module config 

Source
Expand description

Typed configuration and secret-loading helpers.

Structs§

HttpPrincipal
Authenticated HTTP principal. Only a SHA-256 token digest is retained.
ReadResponseBudget
Response-size policy for ReadFiles. None disables a byte budget.

Enums§

HttpSessionAffinity
How remote Initialize(first_call) requests select a durable shell session.

Constants§

DEFAULT_READ_CALL_BUDGET_BYTES
Default visible-content budget for one ReadFiles call. 48 KiB of numbered source is roughly 12-16k tokens: under Claude Code’s ~25k-token tool-result cap and claude.ai’s ~150k-character cap with room for the structured receipts, and below the sizes at which ChatGPT was observed to drop content silently. It leaves the median call (~36 KB) untouched.
DEFAULT_READ_FILE_BUDGET_BYTES
Default cap for one whole-file or open-ended read. Files above ~32 KiB (~800 lines) are where an outline plus targeted ranges beats a raw dump, and the remaining 16 KiB of the call budget still serves other batch items.
DEFAULT_READ_UNCHANGED_TTL_SECS
Default window in which an unchanged repeat is compacted: off. Under workspace affinity a new chat inherits the thread of an earlier one, so it could be told a file is “unchanged” that it never saw. Opt in with WINX_READ_UNCHANGED_TTL_SECS (e.g. 900) for per-conversation threads.
MIN_HTTP_TOKEN_BYTES
Minimum accepted HTTP bearer-token length in bytes.
MIN_READ_BUDGET_BYTES
Smallest accepted non-zero byte budget; tiny budgets only produce slivers.
SERVER_ONLY_ENV
Server-process configuration that agent commands must never inherit. A Winx shell otherwise passes the server’s environment to every command, so a nested cargo test or winx-code-agent run by an agent would append synthetic events to the operator’s usage log, and any command could read the HTTP bearer token. An explicit assignment in the command itself still works.

Functions§

env_flag
Read a boolean environment variable with one consistent spelling policy.
env_text
Read and trim a non-empty environment variable.
load_http_principals
Resolve either a legacy single principal or a multi-principal TOML file.
load_http_principals_with_policy
Resolve HTTP principals and apply single_principal_policy to legacy --token/--token-file/environment authentication.
load_secret_file
parse_bool
Parse common human-friendly boolean spellings.