Skip to main content

Module setup_gen

Module setup_gen 

Source
Expand description

Auto-derive the credential setup form (assets/setup.yaml) and assets/secret-requirements.json for an application pack from its agents[].llm and the secret requirements of the tool extensions the agents use. Pure logic; all I/O (resolving describe.json) lives in the caller (cli::ext_resolver).

Structs§

GeneratedSetup
The two generated asset bodies, ready to write into the pack.
ProviderOverlay
Display metadata for an LLM provider’s API-key question. Keyed by the provider id used in pack.yaml agents[].llm.provider (matches greentic_llm::ProviderKind::as_str()).
SecretRequirementOut
One entry of secret-requirements.json. required is omitted when true (the reader defaults it to true), matching hand-authored files.
SetupQuestionOut
One credential question. Field set/names match greentic-setup’s SetupQuestion reader; None optionals are omitted (the reader defaults them), so output stays close to a hand-authored file.
SetupSpecOut
ToolSecretReq
One secret a tool needs, as declared in the extension’s describe.json contributions.tools[].secret_requirements.

Functions§

extract_tool_secret_requirements
Collect the secret requirements of the named tools from a describe.json body, deduped by key (first occurrence wins), preserving discovery order.
generate
Build setup.yaml + secret-requirements.json from a pack’s agents and the resolved tool secret requirements. Returns None when there is nothing to emit. Component requirements are merged into secret-requirements.json.
llm_overlay
Polished display metadata for the popular providers. Returns None for providers without a curated entry (the caller emits a minimal question). Task 5’s drift-test asserts every greentic_llm::ProviderKind is either covered here or in that test’s explicit minimal allow-list.