Metadata-Version: 2.4
Name: zymis
Version: 0.1.4
Summary: Lightweight multi-agent orchestration framework — Boss, Manager, Coder, Critics, and Worker pipeline
Author-email: Zymis Contributors <indrohelpdesk@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/abhinav00anand/zymis
Project-URL: Documentation, https://github.com/abhinav00anand/zymis#readme
Project-URL: Repository, https://github.com/abhinav00anand/zymis.git
Project-URL: Issues, https://github.com/abhinav00anand/zymis/issues
Keywords: ai,agents,orchestration,llm,swarm,code-generation,multi-agent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Code Generators
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyio>=4.4
Requires-Dist: asyncio-throttle>=1.0.2
Requires-Dist: openai>=1.35
Requires-Dist: anthropic>=0.30
Requires-Dist: google-generativeai>=0.7
Requires-Dist: boto3>=1.34
Requires-Dist: httpx>=0.27
Requires-Dist: aiohttp>=3.9
Requires-Dist: pydantic>=2.7
Requires-Dist: pydantic-settings>=2.3
Requires-Dist: structlog>=24.2
Requires-Dist: rich>=13.7
Requires-Dist: redis[hiredis]>=5.0
Requires-Dist: chromadb>=0.5
Requires-Dist: sentence-transformers>=3.0
Requires-Dist: tiktoken>=0.7
Requires-Dist: tree-sitter>=0.22
Requires-Dist: pygments>=2.18
Requires-Dist: gitpython>=3.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: omegaconf>=2.3
Requires-Dist: fastapi>=0.111
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: click>=8.1
Requires-Dist: typer>=0.12
Requires-Dist: opentelemetry-api>=1.25
Requires-Dist: opentelemetry-sdk>=1.25
Requires-Dist: opentelemetry-exporter-otlp>=1.25
Requires-Dist: prometheus-client>=0.20
Requires-Dist: python-telegram-bot>=21.3
Requires-Dist: cryptography>=42.0
Requires-Dist: tenacity>=8.3
Requires-Dist: cachetools>=5.3
Requires-Dist: humanize>=4.9
Requires-Dist: python-dateutil>=2.9
Requires-Dist: ujson>=5.10
Requires-Dist: xxhash>=3.4
Requires-Dist: aiofiles>=23.2
Requires-Dist: psutil>=5.9
Requires-Dist: pytest>=8.2
Requires-Dist: pytest-asyncio>=0.23
Requires-Dist: pytest-cov>=5.0
Requires-Dist: pytest-mock>=3.14
Requires-Dist: hypothesis>=6.103
Provides-Extra: dev
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: black>=24.4; extra == "dev"
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: ipython>=8.25; extra == "dev"
Provides-Extra: gpu
Requires-Dist: torch>=2.3; extra == "gpu"
Requires-Dist: numpy>=1.26; extra == "gpu"
Dynamic: license-file

# ⚡ Zymis

[![PyPI version](https://img.shields.io/pypi/v/zymis.svg?color=brightgreen)](https://pypi.org/project/zymis/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python Version](https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://pypi.org/project/zymis/)
[![Viento Mesh](https://img.shields.io/badge/Viento%20Core-Integrated-brightgreen.svg)](https://github.com/abhinav00anand/viento)
[![Direct Lane](https://img.shields.io/badge/Architecture-Direct%20Lane-blueviolet.svg)](https://github.com/abhinav00anand/zymis)
[![Security Gate](https://img.shields.io/badge/Security-Fail--Closed-red.svg)](https://github.com/abhinav00anand/zymis)

```text
  _____           _     
 |___  /_   _ _ __ (_)___ 
    / /| | | | '_ \| / __|
   / /_| |_| | | | | \__ \
  /____|\__, |_| |_|_|___/
        |___/             
```

> **The Autonomous, Direct-Lane AI Engineering Engine with Upstream Viento Mesh & Modular Engineering Constitutions.**
>
> Zymis is a modern, headless, CLI-first software engineering agent system. It equips AI models with **39 native repository tools**, **multi-domain model awareness constitutions**, zero-trust workspace confinement, and direct integration with the **Viento P2P mesh network**.

---

## 🎯 What Zymis Does

Traditional coding tools either run shallow single-shot edits or get bogged down in slow, bloated multi-agent consensus committees.

**Zymis runs on One Direct Lane.** The agent works directly on the target workspace using rich native tools, adhering to domain-specific engineering constitutions, validating every edit via AST diagnostics and test execution before claiming completion. When heavy delegation is required, running with `--production` authorizes the agent to spawn dedicated subagents.

### Key Pillars:
1. **One Direct Lane Execution**: No slow 12-stage consensus committee. The agent directly navigates, inspects, edits, tests, and verifies code using native tools.
2. **Upstream Viento Mesh Core**: Native integration with `viento` (`vnt_*`, `AsyncVientoClient`), featuring peer-to-peer mesh routing (`X-Viento-Mesh-Routing: p2p`) and seamless OpenAI fallbacks.
3. **Multi-Domain Model Awareness Constitutions**: Injects domain-specific rules (Operational Workflow, Security, Core Engineering, Website Generation, Architecture, Refactoring) directly into model awareness.
4. **39 Native Agent Tools**: Workspace-confined tools spanning Code Intelligence, Web & Headless Browser Automation, Git & Safety Checkpoints, Memory & Task Planning, and Isolated Python Sandboxes.
5. **Production Subagent Authority**: By default, runs single-agent. When running with `--production` (`-production`), the agent is granted the authority to spawn and delegate tasks via `spawn_subagent`.

---

## 🛠️ Native Agent Tool Suite (39 Tools)

Zymis arms models with tools modeled after Cursor, Claude Code, and Antigravity:

### 1. Code Intelligence & AST Navigation
- `codebase_search`: Queries vector embeddings and semantic intent of repository files.
- `get_file_outline`: Fast AST structural outline of classes, functions, and imports without reading full files.
- `get_symbols`: Extracts declared classes, functions, and symbols from a file.
- `go_to_definition`: Resolves exact definition locations of functions/classes across the workspace.
- `find_references`: Finds all call sites and usages of a symbol across files.
- `read_lints`: Instant in-process syntax checks and AST diagnostics without running full builds.

### 2. Browser & Visual Verification
- `browser_navigate`: Navigates headless browser to a local dev server (`localhost:3000`) or web URL.
- `browser_click`, `browser_type`, `browser_scroll`: Interacts with UI elements, forms, and pages.
- `take_screenshot`: Captures screenshots for visual layout verification.
- `read_console_logs`: Reads browser console logs and JavaScript errors.
- `inspect_network`: Inspects network requests, responses, and HTTP status codes.

### 3. Web & Documentation Retrieval
- `web_search`: Searches live internet for up-to-date APIs, library docs, and error messages.
- `fetch_url`: Scrapes web pages or indexed documentation into clean, token-efficient text.

### 4. Git & Safety Checkpoints
- `create_checkpoint` / `revert_to_checkpoint`: Creates safe workspace snapshots before edits and rolls back instant failures.
- `validate_syntax`: Fast in-process AST check immediately after modifying a file.
- `git_status_and_diff`: Clean status and unstaged diff summaries for self-review.
- `git_blame` / `git_log_file`: Line-by-line commit blame and recent history.

### 5. Background Process Management
- `start_background_process`: Launches long-running dev servers (`npm run dev`, `uvicorn`) in the background without blocking execution.
- `read_process_logs`: Reads latest stdout/stderr buffer to check for server crashes.
- `kill_process`: Cleanly terminates background processes and servers.

### 6. Agent Orchestration, Memory & Sandbox
- `todo_write`: Structured task planning and implementation checklist.
- `spawn_subagent`: Spins up isolated subagents for delegated research or testing (authorized via `--production`).
- `update_memory` / `save_artifact`: Persists user preferences, architecture decisions, and walkthrough artifacts.
- `ask_user`: Interactive multiple-choice prompts for human-in-the-loop decisions.
- `notebook_scratchpad`: Transient in-memory key-value scratchpad for long tasks.
- `compress_context`: Compacts previous tool traces to preserve context window tokens.
- `execute_python_sandbox`: Runs quick Python scripts in an isolated temporary sandbox.
- `view_image`: Loads local UI mockups and error screenshots into vision context.

---

## 📜 Model Awareness Constitutions (`aiswarm/constitution/`)

Zymis automatically detects task intent and injects mandatory constitutional mandates:

| Domain | Rules & Mandates |
| :--- | :--- |
| **Operational Workflow** | • **Navigation Hierarchy**: Prefer `get_file_outline`/`codebase_search` over `read_file`. Use `go_to_definition`/`find_references` over `grep_search`.<br>• **Edit Safety Loop**: Call `create_checkpoint` before multi-file edits; run `validate_syntax`/`read_lints` after every modification.<br>• **Server Hygiene**: Never block on dev servers; use `start_background_process`, `read_process_logs`, and `kill_process`.<br>• **Browser Verification**: Verify frontend edits by starting server and running `browser_navigate`, `read_console_logs`, `take_screenshot`. |
| **Website Generation** | • **Distinct Identity**: Bespoke visual designs, custom color palettes, intentional typography — zero generic cookie-cutter pages.<br>• **Accessibility & Responsiveness**: Mobile/tablet/desktop responsive, WCAG AA compliance, semantic HTML.<br>• **Rich Interactions**: Tactile hover effects, skeleton loaders, and interactive state feedback. |
| **Core Engineering** | • **Minimal Diffs**: Surgical modifications; no touching unrelated lines or formatting.<br>• **Verify Before Done**: Never claim completion without observing passing tests or build output.<br>• **Zero Stubs/Mocks**: Full implementation only — no `TODO`, `FIXME`, or dummy `pass` placeholders in production. |
| **Security & Hardening** | • **Zero Secret Leaks**: Automated scrubbing of tokens/passwords in logs and outputs.<br>• **Workspace Confinement**: Strict resolution within workspace root; blocks traversal (`../`) and symlink escapes.<br>• **Safe Subprocesses**: Sandboxed execution with allowlists and timeouts. |

---

## 🚀 Quickstart & CLI Usage

### Installation
```bash
git clone https://github.com/abhinav00anand/zymis.git
cd zymis
pip install -r requirements.txt
```

### Running Tasks

#### Standard Direct Lane (Single-Agent Tool Execution)
```bash
zymis run "Implement JWT authentication refresh token rotation" --provider viento
```

#### Production Mode (Authorizes Subagent Spawning)
```bash
zymis run "Redesign frontend landing page and audit security" --production --provider viento
```

#### Headless CLI Options
```text
Usage: zymis run [OPTIONS] {title}

Options:
  --desc, -d          Task description
  --file, -f          Target file(s)
  --provider          Preferred provider (viento, openai, anthropic, gemini, etc.)
  --model, -m         Target model (e.g. vnt-deepseek-r1, gpt-4o)
  --production        Authorize agent to spawn and delegate to subagents
  --no-ollama         Disable Ollama auto-provisioning
  --wait / --no-wait  Wait for task completion (default: wait)
```

---

## 📦 Viento Mesh Integration

Zymis natively routes through the **Viento P2P Mesh Network**:
- Environment variables: `VIENTO_API_KEY` (`vnt_*`), `VIENTO_API_URL`, `VIENTO_BOOTSTRAP_KEY`.
- Headers: `X-Viento-Node-Id`, `X-Viento-Mesh-Routing: p2p`, `X-Viento-Transport: stream`.
- Automatic fallbacks: If native Viento client encounters transport anomalies, requests fall back seamlessly to OpenAI-compatible endpoints without disrupting tasks.

---

## 🏛️ Legacy Swarm Archive

The original 8-critic consensus committee (`architecture`, `documentation`, `maintainability`, `performance`, `reliability`, `security`, `style`, `testing`) and legacy Host-1/Host-2 routers have been safely archived to `aiswarm/legacy/`. Their domain rubrics and prompt matrices are preserved and accessible when spawning subagents under `--production`.

---

## 🧪 Testing & Verification

Run the full test battery:
```bash
python -m pytest tests/unit/test_native_tools.py tests/unit/test_constitutions.py tests/unit/test_extended_tools.py tests/unit/test_llm_tool_calling.py tests/unit/test_viento_adapter.py -v
```

---

## 📄 License

Apache License 2.0. Copyright (c) 2026 Abhinav Anand.\n
