Skip to main content

Module settings

Module settings 

Source
Expand description

Settings: global settings.json merged with the trusted project’s.

Port of packages/coding-agent/src/core/settings-manager.ts in pi v1.0.0. Each scope is an order-preserving document. Edits re-read its file under the file’s lock, change it and write it back the way pi does. Readers use the typed view of the merged document.

Structs§

SettingsManager
Both scopes and their merged view.

Enums§

Scope
Which file a setting lives in.
SettingsError
Settings errors.

Constants§

TOML_FILE
The TOML form of a folder’s settings file, which yapi reads and writes in place of settings.json.

Functions§

apply_http_proxy
pi’s applyHttpProxySettings: the global httpProxy setting stands in for unset proxy variables, for yapi and for chest alike.
http_proxy
The global httpProxy setting in agent_dir, when its settings file reads and sets one.
js_string
JavaScript’s String(value) for a JSON value.
read_settings
The settings document in the settings.json or settings.toml at path, read as yapi reads it. A missing file is an empty document.
settings_file
The settings file of folder dir: settings.toml when it holds one, else settings.json, which a first write creates. A folder that holds both is a SettingsError::Conflict.