Expand description
Typed configuration and secret-loading helpers.
Structs§
- Http
Principal - Authenticated HTTP principal. Only a SHA-256 token digest is retained.
- Read
Response Budget - Response-size policy for
ReadFiles.Nonedisables a byte budget.
Enums§
- Http
Session Affinity - How remote
Initialize(first_call)requests select a durable shell session.
Constants§
- DEFAULT_
READ_ CALL_ BUDGET_ BYTES - Default visible-content budget for one
ReadFilescall. 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 whichChatGPTwas 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 testorwinx-code-agentrun 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_policyto legacy--token/--token-file/environment authentication. - load_
secret_ file - parse_
bool - Parse common human-friendly boolean spellings.