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 streaming —
BridgeEventStreamfor real-time diagnostics, file changes, debug events. - Auto-generated method wrappers —
GeneratedBridgeClientwith 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dc06822f591b93933c555e1a4683771cb1e4f6b091ef9ff54e371afb559b606
|
|
| MD5 |
97f4cd1a94c07550a1a2d7c8a87081ab
|
|
| BLAKE2b-256 |
f6ff8b00d25b92b5b212ee6111e59433e9011ca0a10a75e81033a81937f9beed
|
Provenance
The following attestation bundles were made for ai_native_bridge-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on Harkirat155/ai-native
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_native_bridge-0.1.0.tar.gz -
Subject digest:
2dc06822f591b93933c555e1a4683771cb1e4f6b091ef9ff54e371afb559b606 - Sigstore transparency entry: 976419108
- Sigstore integration time:
-
Permalink:
Harkirat155/ai-native@ff1339ae503423bce4a1349e5285092d99af84f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Harkirat155
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ff1339ae503423bce4a1349e5285092d99af84f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_native_bridge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_native_bridge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7a1da44c8a2449fbfe1979eda849cdea9daa200b1dec005e705f3617638ddad
|
|
| MD5 |
2f3cd34fec21da18595ff5fc656e1865
|
|
| BLAKE2b-256 |
d5a78d28cbb5dbbb0a18b33d81313b4bd82c474b3f7da887326f5a007562c11f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_native_bridge-0.1.0-py3-none-any.whl -
Subject digest:
e7a1da44c8a2449fbfe1979eda849cdea9daa200b1dec005e705f3617638ddad - Sigstore transparency entry: 976419109
- Sigstore integration time:
-
Permalink:
Harkirat155/ai-native@ff1339ae503423bce4a1349e5285092d99af84f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Harkirat155
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ff1339ae503423bce4a1349e5285092d99af84f9 -
Trigger Event:
push
-
Statement type: