Metadata-Version: 2.4
Name: nodus-sdk
Version: 0.1.0
Summary: Unified platform SDK for Nodus — factory, bridges, and integration layer
Author: Shawn Knight
License: MIT License
        
        Copyright (c) 2026 Shawn Knight
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Masterplanner25/nodus-sdk
Project-URL: Repository, https://github.com/Masterplanner25/nodus-sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: nodus-lang>=4.0.0
Requires-Dist: nodus-schema>=0.1.0
Requires-Dist: nodus-protocol>=0.1.0
Requires-Dist: nodus-retry>=0.1.0
Provides-Extra: agent
Requires-Dist: nodus-agent>=0.1.0; extra == "agent"
Requires-Dist: nodus-state>=0.1.0; extra == "agent"
Requires-Dist: nodus-circuit-breaker>=0.1.0; extra == "agent"
Provides-Extra: workflow
Requires-Dist: nodus-workflow>=0.1.0; extra == "workflow"
Requires-Dist: nodus-state>=0.1.0; extra == "workflow"
Requires-Dist: nodus-events>=0.1.0; extra == "workflow"
Provides-Extra: memory
Requires-Dist: nodus-memory>=0.1.0; extra == "memory"
Provides-Extra: memory-ai
Requires-Dist: nodus-memory[openai]>=0.1.0; extra == "memory-ai"
Provides-Extra: auth
Requires-Dist: nodus-auth>=0.1.0; extra == "auth"
Provides-Extra: llm
Requires-Dist: nodus-llm>=0.1.0; extra == "llm"
Requires-Dist: nodus-circuit-breaker>=0.1.0; extra == "llm"
Provides-Extra: http
Requires-Dist: nodus-http>=0.1.0; extra == "http"
Provides-Extra: redis
Requires-Dist: nodus-queue[redis]>=0.1.0; extra == "redis"
Requires-Dist: nodus-events[redis]>=0.1.0; extra == "redis"
Provides-Extra: sql
Requires-Dist: sqlalchemy>=2.0; extra == "sql"
Provides-Extra: vector
Requires-Dist: pgvector>=0.2; extra == "vector"
Requires-Dist: sqlalchemy>=2.0; extra == "vector"
Provides-Extra: scheduler
Requires-Dist: apscheduler>=3.10; extra == "scheduler"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100; extra == "fastapi"
Requires-Dist: httpx>=0.27; extra == "fastapi"
Provides-Extra: webhooks
Requires-Dist: httpx>=0.27; extra == "webhooks"
Provides-Extra: observability
Requires-Dist: nodus-observability>=0.1.0; extra == "observability"
Requires-Dist: nodus-observability-framework>=0.1.0; extra == "observability"
Provides-Extra: extensions
Requires-Dist: nodus-extension>=0.1.0; extra == "extensions"
Provides-Extra: full
Requires-Dist: nodus-sdk[agent,auth,extensions,fastapi,http,llm,memory,observability,redis,scheduler,sql,vector,webhooks,workflow]; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: respx; extra == "dev"
Requires-Dist: fastapi[all]; extra == "dev"
Requires-Dist: sqlalchemy>=2.0; extra == "dev"
Requires-Dist: apscheduler>=3.10; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Dynamic: license-file

# nodus-sdk

**Unified platform SDK for Nodus AI systems.**

Single-package installation story for the Nodus ecosystem. Auto-wires
available packages via `create_runtime(**kwargs)`, provides 9 bridge modules
for external integrations, and exposes a FastAPI control-plane router.

> **Status:** v0.1.0 — prepared, not yet published.

---

## Install

```bash
pip install nodus-sdk                            # core only
pip install "nodus-sdk[agent,sql,fastapi]"       # agent + SQLAlchemy + FastAPI
pip install "nodus-sdk[full]"                    # everything
```

---

## Quick start

```python
from nodus_sdk import create_runtime

rt = create_runtime(memory=True, trace_id="req-001", timeout_ms=None)
result = rt.run_source('print("hello from sdk")')
```

---

## create_runtime()

```python
from nodus_sdk import create_runtime, NodusSDKRuntime

rt = create_runtime(
    memory=True,          # True = auto-configure; or pass a store object
    events=True,          # True = auto-configure; or pass EventBusConfig
    extensions=True,      # attach ExtensionRegistry
    auth=True,            # attach KeyRing
    observability=True,   # or pass service name string
    trace_id="tid-001",   # injected into every emitted event
    timeout_ms=None,      # None = unlimited (required for long-lived services)
    max_steps=None,
    allowed_paths=None,
    project_root=None,
)
```

`create_runtime` returns a `NodusSDKRuntime` — a `NodusRuntime` subclass with
fluent `attach_*` bridge methods. All capability kwargs accept `True` (default
config) or a config/store object.

---

## NodusSDKRuntime fluent API

```python
from nodus_sdk import NodusSDKRuntime
from nodus_sdk.bridges.sql import SqlBridge
from nodus_sdk.bridges.webhook import WebhookBridge

rt = (
    NodusSDKRuntime(timeout_ms=None)
    .attach_sql(SqlBridge("postgresql://..."))
    .attach_webhook(WebhookBridge(secret="my-secret"))
)
```

All `attach_*` methods are idempotent and return `self`.

---

## Bridges

| Bridge | Install extra | Key class |
|---|---|---|
| `bridges/redis.py` | `[redis]` | `RedisBridge(url)` → queue_backend, event_bus |
| `bridges/http.py` | `[http]` | `HttpBridge()` → NodusHttpClient |
| `bridges/llm.py` | `[llm]` | `LLMBridge(credentials)` → FailoverClient |
| `bridges/observability.py` | `[observability]` | `init_observability(name, otel=, prometheus=)` |
| `bridges/sql.py` | `[sql]` | `SqlBridge(url)` → sql_query/sql_execute host fns |
| `bridges/vector.py` | `[vector]` | `VectorBridge(url, table, dimensions)` → vector_search/upsert/delete |
| `bridges/scheduler.py` | `[scheduler]` | `SchedulerBridge()` → scheduler_add_interval/cron/cancel |
| `bridges/webhook.py` | `[webhooks]` | `WebhookBridge(secret=)` → webhook_send |
| `bridges/api.py` | `[fastapi]` | `create_nodus_router(rt)` + `NodusTraceMiddleware` |

**Bridge return type note:** Bridge host functions return Python maps (dicts),
not Records. Use index access in `.nd` code: `r["status"]`, not `r.status`.

---

## FastAPI integration

```python
from fastapi import FastAPI
from nodus_sdk import create_runtime
from nodus_sdk.bridges.api import create_nodus_router, NodusTraceMiddleware

rt = create_runtime(timeout_ms=None)
app = FastAPI()
app.add_middleware(NodusTraceMiddleware, runtime=rt)
app.include_router(create_nodus_router(rt))
# Routes: POST /run, GET /health, GET /syscalls, GET|POST|DELETE /memory/{key}
```

---

## detect_available()

```python
from nodus_sdk import detect_available

avail = detect_available()
# {"memory": True, "extension": False, "events": True, ...}
```

---

## Development

```bash
pip install -e ".[dev]"
PYTHONPATH="C:/dev/Coding Language/src" pytest tests/ -q
```

Tests require nodus-lang source on `PYTHONPATH`.

---

## License

MIT — see [LICENSE](LICENSE).
