Skip to content

feat(sdk): Python SDK — Extract from JarvisCore, Publish to PyPI #64

@sangalo20

Description

@sangalo20

Overview

The current Go SDK (nexus-sdk) is solid infrastructure but the majority of AI agent developers work in Python. A standalone, pip-installable Python SDK is critical for adoption.

Problem

  • A Python SDK exists inside jarviscore as jarviscore.nexus.NexusClient but is not standalone
  • Every Python agent developer must write their own HTTP client against the Gateway REST API
  • No PyPI package exists, so usage is limited to teams with direct access to JarvisCore

Proposed Solution

Extract, extend, and publish the Python SDK to PyPI as nexus-sdk.

Target interface

from nexus import NexusClient

nexus = NexusClient(gateway_url="https://nexus-gateway.acme.com")

# Standard agent session
session = nexus.request_agent_session(
    agent_id="crm-agent",
    provider="salesforce",
    scopes=["crm:contacts:read"],
    ttl=900
)
# session.access_token  → ready to use
# session.expires_at    → datetime
# session.scopes_granted → list

# OBO session
obo = nexus.request_obo_session(
    agent_id="ops-agent",
    provider="internal-ops",
    scopes=["acme:gliding"],
    user_context_token=request.headers["X-User-Token"]
)
# obo.acting_for, obo.tenant_id, obo.clearance_level

# Close when done
nexus.close_agent_session(session.session_id)

Installation

pip install nexus-sdk

Tasks

  • Create nexus-sdk-python/ directory in the monorepo (or separate repo)
  • Extract core HTTP client from JarvisCore
  • Add request_agent_session(), request_obo_session(), close_agent_session(), get_agent_session() methods
  • Add retry + backoff logic matching Go SDK behavior
  • Add WaitForActive() polling helper
  • Publish to PyPI as nexus-sdk
  • Add README and usage examples

Priority

P3 — Small effort (core extraction; session methods depend on P1/P2)

Reference

AGENT_AUTH_PROPOSAL.md — Proposal 5 (Python)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions