Metadata-Version: 2.4
Name: ladyol
Version: 0.0.1.post1
Summary: Object-based prompt injection system for AI agents
Author: Morganna
Author-email: morganna@magick.ai
License: MIT
Platform: Linux
Requires-Python: >=3.10
Requires-Dist: httpx>=0.24
Requires-Dist: pydantic>=2.0,<3.0
Requires-Dist: pyyaml>=6.0,<7.0
Requires-Dist: kahndor
Requires-Dist: subtrix
Requires-Dist: goalt
Requires-Dist: squirl
Requires-Dist: thingery
Requires-Dist: mindot
Requires-Dist: pycurity
Requires-Dist: knightsort
Requires-Dist: glain
Requires-Dist: xskillaber
Requires-Dist: eaglis
Requires-Dist: metrologic
Requires-Dist: pytest>=8.0 ; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23 ; extra == "dev"
Requires-Dist: pytest-json-report>=1.5 ; extra == "dev"
Requires-Dist: pytest-cov>=4.1 ; extra == "dev"
Requires-Dist: ruff>=0.5 ; extra == "dev"
Provides-Extra: dev
Description: # LadyOl
        
        ## Project overview
        
        Object-based prompt injection system for AI agents.
        
        ## Features
        
        - **Context Injection** - Inject past experiences and project context into messages
        - **Context Closure** - Store task outcomes for continuous learning
        - **Identity Management** - Persistent agent identity documents in Glain
        - **Memory System** - Two-layer memory (MEMORY.md + Glain)
        - **Skills Loading** - Load and manage agent skills
        - **Prompt Scaling** - Automatically adjust prompt complexity based on model capability
        
        ## Installation
        
        ```bash
        pip install ladyol
        ```
        
        ## Usage
        
        ```bash
        # Run LadyOL
        ladyol run
        
        # Check status
        ladyol status
        ```
        
        ### Options
        
        | Argument | Type | Required | Default | Description |
        |----------|------|----------|---------|-------------|
        | `--verbose` / `-v` | flag | No | false | Enable verbose output |
        | `--config` / `-c` | path | No | None | Path to configuration file |
        
        ### Commands
        
        #### `run`
        Run the main operation.
        
        ```bash
        ladyol run
        ```
        
        #### `status`
        Check project status.
        
        ```bash
        ladyol status
        ```
        
        ## Quick Start
        
        ## Development
        
        See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for setup instructions, testing, and contribution guidelines.
        
        ```python
        from pathlib import Path
        from ladyol import LadyOlPromptEngine, LadyOlConfig
        
        # Initialize the engine
        config = LadyOlConfig()
        engine = LadyOlPromptEngine(
            workspace=Path("./workspace"),
            config=config,
        )
        
        # Inject context into messages
        messages = [{"role": "user", "content": "What was I working on?"}]
        updated_messages = await engine.inject_context(messages)
        
        # Get memory context
        memory_context = engine.get_memory_context()
        
        # Get skills summary
        skills = engine.get_skills_summary()
        ```
        
        ## Sophia gateway provider (2026-08-23)
        
        LadyOl routes LLM traffic through the sophia LAN gateway when the accts
        file enables it:
        
        ```yaml
        # <agent_path>/<agent>_accts.yaml
        provider_accts:
          "sophia-000.000.000":
            enabled: True
            provider: sophia
            name: "sophia-000.000.000"
        ```
        
        - Bearer key resolution: `SOPHIA_REQUESTOR_KEY` env var, then
          `<agent_path>/sophia.env` (KEY=VALUE line; chmod 600).
        - `sophia-auto` model entry → gateway picks the upstream model.
        - All other providers can be disabled per-account (`enabled: False`) —
          they never enter the pool; rotation stays upstream in sophia.
        
        ## Tool-call wire format (T-NEW-119, 2026-08-27)
        
        LadyOl preserves structured OpenAI `tool_calls` on the wire — both
        the upstream's wire format and the message history passed through
        the chat layer. This is the upstream half of the `hermes→sophia→m3`
        tool-call fix.
        
        ### `ProviderPool.chat()`
        
        ```python
        # New (T-NEW-119) — accepts a full messages history + tools:
        content, tool_calls, usage = await provider_pool.chat(
            messages=messages,           # full OpenAI-style history
            tools=tools,                 # OpenAI tool definitions
            temperature=0.7,
            strategy="best_available",
            model=None,                  # or a concrete model id
        )
        
        # Legacy — 2-message [system, user] shortcut still works:
        content, tool_calls, usage = await provider_pool.chat(
            prompt="latest user turn",
            sprompt="system prompt",
            tools=tools,
        )
        ```
        
        - Returns `(content, tool_calls, usage)`. The third slot
          (`tool_calls`) is the upstream's structured
          `choices[0].message.tool_calls` array verbatim, or `[]` when
          the model produced no tool calls. The fourth slot (`usage`) is
          the upstream's `usage` mapping (`prompt_tokens`,
          `completion_tokens`, `total_tokens`).
        - When `messages` is supplied, the wrapper routes through the
          streaming client internally so the full history + tools reach
          the upstream. When only `prompt`/`sprompt` is supplied, the
          legacy 2-message `[system, user]` path is used.
        - `tools` is forwarded so the upstream sees the available tool
          surface (the caller passes an OpenAI tool-definition array).
        
        ### `ProviderPool.stream()`
        
        Yields one of the following per event:
        
        - `{"type": "token", "content": <str>}` — content delta from the upstream.
        - `{"type": "tool_call", "tool_calls": [<OpenAI streaming delta>]}`
          — when the upstream carries `delta.tool_calls` in the SSE.
          Each entry has `index`, `id`, `function.name`,
          `function.arguments` (a JSON string per OpenAI spec).
        - `{"type": "usage", "tokens": {…}}` — token accounting.
        - `{"type": "done"}` — end-of-stream sentinel.
        
        Note: an upstream that emits **only** tool calls (no prose)
        produces zero `token` events. Consumers MUST inspect both
        `token` AND `tool_call` events.
        
        ### Migration notes
        
        The previous return shape `await provider_pool.chat(...) → str` is
        no longer the contract. Callers that destructure as a single
        string must update. The internal callers (`ladyol.py:_progress_report`,
        `ladyol.py:_run_loop` non-streaming path,
        `sandstone/summarizer.py`) were updated in T-NEW-119; downstream
        consumers (sophia + senbai) were updated as companion commits.
        
        ## Architecture
        
        ```
        ladyol/
        ├── agent/           # Core agent components
        │   ├── context_closure.py
        │   ├── context_injector.py
        │   ├── identity.py
        │   ├── memory.py
        │   ├── prompt_scaler.py
        │   └── skills.py
        ├── config/          # Configuration schemas
        ├── prompt/          # Prompt engine
        └── utils/          # Utilities
        ```
        
        ## License
        
        MIT
Description-Content-Type: text/markdown
