Metadata-Version: 2.5
Name: b4pt0r-the-framework
Version: 0.3.3
Summary: Build persistent, extensible local agent applications with supervised workers and authenticated clients
Project-URL: Homepage, https://github.com/B4PT0R/the_framework
Project-URL: Documentation, https://github.com/B4PT0R/the_framework/blob/main/README.md
Project-URL: Repository, https://github.com/B4PT0R/the_framework
Project-URL: Changelog, https://github.com/B4PT0R/the_framework/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/B4PT0R/the_framework/issues
Author: B4PT0R
License-Expression: MIT
License-File: LICENSE
Keywords: agentic-applications,agents,fastapi,framework,plugins
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: codex-backend-sdk>=0.6.0
Requires-Dist: fastapi
Requires-Dist: filelock>=3.20
Requires-Dist: httpx
Requires-Dist: jsonschema>=4.26.0
Requires-Dist: modict<0.6,>=0.5.0
Requires-Dist: pillow
Requires-Dist: playwright
Requires-Dist: psutil>=7.2.2
Requires-Dist: python-multipart
Requires-Dist: pyyaml
Requires-Dist: tiktoken
Requires-Dist: uvicorn
Requires-Dist: websockets
Provides-Extra: dev
Requires-Dist: httpx2>=2.0.0; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Description-Content-Type: text/markdown

# The Framework

Python library for building agent applications: tool execution, durable
conversations, private specialists, backend services, authenticated clients and
editable interfaces. The application owns its instructions, permissions and UI;
the library owns their composition and runtime contracts.

**Python 3.12+ · alpha · distribution `b4pt0r-the-framework` · import `the_framework`**

## Call a model in Python

Install `b4pt0r-the-framework`, authenticate once with
`python -c 'from codex_backend_sdk import OpenAI; OpenAI().authenticate()'`,
and set `FRAMEWORK_MODEL` to a model supported by your Codex/ChatGPT account.
Then run:

```python
import os
from the_framework import AgentSpec

agent = AgentSpec(
    name="assistant",
    instructions="Answer clearly and briefly.",
    configuration={"model": os.environ["FRAMEWORK_MODEL"]},
).build_agent()
for event in agent.stream("What can I build with an agent framework?"):
    if event.type == "agent.text.delta" and event.channel == "output":
        print(event.delta, end="", flush=True)
print()
```

This calls the real backend and uses account quota. Continue with
[First agent](docs/guides/first-agent.md) to let the model read a file through a
Python tool and resume the conversation from disk, or host a complete app below.

## Run an editable application

With Python 3.12+, Node.js/npm and Chromium's OS dependencies installed:

```sh
python -m pip install b4pt0r-the-framework
the-framework bootstrap --code-dir /path/to/my-agent-code --data-dir /path/to/my-agent-data --run
```

Use absent or empty, separate, non-overlapping directories. Bootstrap copies the
starter, uses the CLI's current Python environment, prepares the React UI, downloads Playwright
Chromium and launches a local desktop window. Model login is a separate step;
see [First application](docs/guides/first-application.md) for credentials, a first
reply, instruction changes and resuming the same conversation.

The starter includes shell/browser tools with the configured account's real
permissions. It is **not a sandbox**. Keep its listener on loopback and private
data outside source control.

## Compose an application

This is a declaration, not a running server. It gives one recipe shell tools,
a durable registry and artifact presentation. There is no compulsory persona or UI:

```python
from the_framework import AgentSpec, Application
from the_framework.plugins.artifacts import ARTIFACTS
from the_framework.plugins.bash import BASH
from the_framework.plugins.registry import REGISTRY

application = Application(
    name="Workbench",
    version="0.1.0",
    agents=(AgentSpec(
        name="assistant",
        instructions="Inspect existing files before editing; verify changes with tests.",
        configuration={"model": "your-supported-model"},
    ),),
    plugins=(BASH, REGISTRY, ARTIFACTS),
    surfaces=(),  # explicitly headless; omit to use editable ui/ beside the app module
)
plan = application.compile()  # validates composition; starts no workers or services
```

A host calls `application.build(...)` with the importable application reference,
storage paths and access policy, then runs the returned ASGI app. Each independent
conversation has one writer worker and a canonical `Session`. Plugins may add
worker tools, scoped server services/routes and private agents.
[Application](docs/reference/application.md) specifies assembly;
[Hosting](docs/reference/hosting.md) specifies process and bridge boundaries.

## Choose a working path

| Task | Starting point |
| --- | --- |
| Run, authenticate and customize the desktop starter | [First application](docs/guides/first-application.md) |
| Run a real model/tool turn without a server | [Executable agent example](docs/reference/agents.md#execute-a-real-model-turn) |
| Build a feature with storage, HTTP, tools and live context | [Notebook tutorial](docs/guides/first-plugin.md), [complete source](examples/notebook/README.md) |
| Look up schemas, tool results, commands, state or hooks | [Tools](docs/reference/tools.md), [Extensions](docs/reference/extensions.md) |
| Build a client, integrate voice or operate deployments | [Documentation index](docs/README.md) |
| Understand data/process ownership and restart limits | [Architecture](docs/explanation/architecture.md), [Continuity](docs/explanation/continuity.md) |
| Work on the library itself | [Development](docs/guides/development.md) |

Documentation describes this checkout, not every published wheel. See
[CHANGELOG](CHANGELOG.md) for releases, [security](docs/reference/security.md)
for hosting boundaries and [MIT license](LICENSE) for reuse terms.
