Skip to main content

Async Python SDK for the AI-Native VS Code Bridge — drive VS Code from agents via JSON-RPC over WebSocket.

Project description

ai-native-bridge

Async Python SDK for the AI-Native VS Code Bridge — drive VS Code from agents via JSON-RPC over WebSocket.

Install

pip install ai-native-bridge

Or for development:

pip install -e ./python-sdk

Quick Start

import asyncio
from ai_native_vscode_bridge import BridgeClient

async def main():
    client = BridgeClient.from_workspace(port=57110)

    # Check connectivity
    pong = await client.call("bridge.ping")
    print(pong)  # {"ok": true, "protocol": "v1-draft"}

    # List all diagnostics (errors & warnings)
    diags = await client.call("diagnostics.list")
    for file_entry in diags.get("files", []):
        print(f"{file_entry['uri']}: {len(file_entry['diagnostics'])} issues")

asyncio.run(main())

Features

  • One-shot async calls — each client.call() opens a fresh WebSocket (simple + robust).
  • Event streamingBridgeEventStream for real-time diagnostics, file changes, debug events.
  • Auto-generated method wrappersGeneratedBridgeClient with typed methods for every RPC endpoint.
  • Token auto-discovery — reads $BRIDGE_TOKEN, --token-file, or .vscode/bridge.token.

Event Streaming

from ai_native_vscode_bridge import BridgeEventStream

async def watch():
    async with BridgeEventStream.from_workspace(
        events=["diagnostics.changed", "doc.saved"]
    ) as stream:
        async for event in stream:
            print(event)

API Reference

Class Purpose
BridgeClient One-shot async JSON-RPC calls
GeneratedBridgeClient BridgeClient + auto-generated method wrappers
BridgeEventStream Persistent WebSocket for event subscriptions
BridgeError Structured error with .code, .message, .data

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_native_bridge-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_native_bridge-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_native_bridge-0.1.0.tar.gz.

File metadata

  • Download URL: ai_native_bridge-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_native_bridge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2dc06822f591b93933c555e1a4683771cb1e4f6b091ef9ff54e371afb559b606
MD5 97f4cd1a94c07550a1a2d7c8a87081ab
BLAKE2b-256 f6ff8b00d25b92b5b212ee6111e59433e9011ca0a10a75e81033a81937f9beed

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_native_bridge-0.1.0.tar.gz:

Publisher: publish-pypi.yml on Harkirat155/ai-native

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_native_bridge-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_native_bridge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7a1da44c8a2449fbfe1979eda849cdea9daa200b1dec005e705f3617638ddad
MD5 2f3cd34fec21da18595ff5fc656e1865
BLAKE2b-256 d5a78d28cbb5dbbb0a18b33d81313b4bd82c474b3f7da887326f5a007562c11f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_native_bridge-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Harkirat155/ai-native

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page