Skip to main content

Module trust

Module trust 

Source
Expand description

Project trust: whether yapi may load a project’s .yapi settings and resources.

Port of trust-manager.ts and project-trust.ts in pi v1.0.0. Decisions live in <agent>/trust.json, keyed by directory. The nearest decided ancestor wins.

Structs§

TrustOption
A choice of the trust prompt and /trust: pi’s ProjectTrustOption.
TrustStore
Stored trust decisions.

Functions§

needs_prompt
Whether startup asks whether to trust cwd: it has resources needing trust and neither an override, a stored decision nor the defaultProjectTrust setting decides. An error when the store must be read and cannot be.
prompt_title
The title of the startup trust prompt for cwd.
requires_trust
Whether cwd has project resources that need trust: anything in .yapi/ that changes behavior, a chest manifest that installs anything, or an .agents/skills directory in it or an ancestor (other than the user’s own).
resolve_trusted
Resolves trust without a UI: an explicit override, no resources needing trust, a stored decision, then the defaultProjectTrust setting. ask without a UI means untrusted. A store that must be read and cannot be is an error, as in pi, never trust.
trust_options
pi’s getProjectTrustOptions: trust the project or its parent, or not. With session_only, also trust or distrust for this session only.