praval.app

Explicit application ownership for Praval runtimes.

Functions

get_default_app()

Return the default app that backs compatibility shims.

reset_default_app()

Reset the default app for tests.

Classes

PravalApp(*[, reef, provider_registry, ...])

Own agents and a Reef for explicit lifecycle cleanup.

class praval.app.PravalApp(*, reef=None, provider_registry=None, use_global_reef=False)[source]

Bases: object

Own agents and a Reef for explicit lifecycle cleanup.

PravalApp does not isolate provider registries or redirect an agent’s Reef convenience methods in 0.8. Use it when explicit ownership and deterministic cleanup are useful, not as a dependency-injection boundary.

Parameters:
__init__(*, reef=None, provider_registry=None, use_global_reef=False)[source]
Parameters:
Return type:

None

create_agent(name, **kwargs)[source]

Create and retain an agent owned by this app.

Return type:

Agent

Parameters:
  • name (str)

  • kwargs (Any)

register_agent(agent)[source]

Register an externally-created agent with this app.

Return type:

Agent

Parameters:

agent (Agent)

close()[source]

Close all owned agents and the owned Reef when possible.

Return type:

None

praval.app.get_default_app()[source]

Return the default app that backs compatibility shims.

Return type:

PravalApp

praval.app.reset_default_app()[source]

Reset the default app for tests.

Return type:

PravalApp