foley.requirements#
Onboarding — check what foley needs, tell the user how to get it (accompy-style, #12).
Generalizes WEAVE’s binary-only foley.weave.requirements into a single
capability audit across everything foley can optionally use: system binaries
(ffmpeg / rubberband — reused verbatim from the WEAVE SSOT), API keys
(derived from each source adapter’s declared config['auth'] — one SSOT for the env
var + sign-up URL), and importable extras (py2mcp for the MCP server, the CLAP /
index / provenance stacks). A Requirement carries a
probe discriminator (binary / env / importable) so one dispatch handles
all three. Nothing here runs an installer — it surfaces the exact per-platform command
or sign-up URL so the user (or agent) can opt in. Stdlib-only; keeps import foley
dol-only.
Functions
Assemble the full requirement set: system binaries + API keys + importable extras. |
|
|
A JSON-safe capability + posture snapshot for the CLI, docs, and the MCP tool. |
|
Report which optional foley capabilities are available ( |
The credentials foley reads, one row per key, for a setup tool to list. |
|
Every env var that holds a credential foley reads (the sources' keys, Anthropic's, and foley's own: the LLM endpoint's key and the MCP server's bearer tokens). |
|
|
Return a per-requirement status + guidance report (never runs an installer). |
- foley.requirements.build_requirements()[source]#
Assemble the full requirement set: system binaries + API keys + importable extras.
- Return type:
- foley.requirements.capability_report(*, runtime=None)[source]#
A JSON-safe capability + posture snapshot for the CLI, docs, and the MCP tool.
Groups requirements into
keys(env),extras(importable),system(binary), adds the current offline posture and the available source list, and listsdegraded_tools— capabilities whose requirement is unmet.- Parameters:
runtime – A
foley.runtime.RuntimeConfig(default: the active one).- Return type:
- Returns:
{keys, extras, system, offline, sources, backends, llm, degraded_tools}— all JSON-safe.llmis the provider the SELECT rungs resolve to right now (seefoley.agent.llm.resolve_llm()), or the reason it cannot resolve.backendsisfoley.ledger()(per-source capabilities + planned targets).
- foley.requirements.check_requirements(*, names=None, verbose=False)[source]#
Report which optional foley capabilities are available (
{name: is_available}).- Parameters:
- Return type:
- Returns:
{requirement_name: available}. Everything-absent is fine — foley degrades (deterministic fakes, offline mode, in-process DSP); the report just shows what each capability would unlock.
- foley.requirements.declared_keys()[source]#
The credentials foley reads, one row per key, for a setup tool to list.
Exposed under the facade kit’s
ocracy.credentials.v1entry-point group (ocracy.kit.credentials.CREDENTIALS_ENTRY_POINT_GROUP) and built with the kit’s owncredential_rows():provider(the account),env_vars(the canonical name first, then every other name foley reads it under),unlocksandget_key_url. Derived from the same SSOT ascheck_requirements()(each source’sconfig['auth']), so a newly added paid source is declared with no edit here. Reads no key.>>> rows = {r["env_vars"][0]: r for r in declared_keys()} >>> rows["ELEVENLABS_API_KEY"]["env_vars"] ['ELEVENLABS_API_KEY', 'ELEVEN_API_KEY'] >>> rows["FAL_KEY"]["env_vars"] ['FAL_KEY', 'FAL_API_KEY'] >>> rows["ANTHROPIC_API_KEY"]["provider"], rows["FAL_KEY"]["provider"] ('anthropic', 'fal') >>> rows["FOLEY_LLM_API_KEY"]["provider"], rows["FOLEY_MCP_TOKEN"]["provider"] ('foley-llm', 'foley-mcp')
- foley.requirements.provider_key_env_vars()[source]#
Every env var that holds a credential foley reads (the sources’ keys, Anthropic’s, and foley’s own: the LLM endpoint’s key and the MCP server’s bearer tokens).
The union of
declared_keys()’ rows, which derive from the same SSOT ascheck_requirements()(each source’sconfig['auth']), so a newly added paid source is covered automatically: the test suite scrubs exactly these so no test can spend money by accident.