Skip to content

Commit 06efe27

Browse files
kevin1chunclaude
andcommitted
refactor: remove Python SDK, revert to TypeScript-only repo
- Remove entire python/ directory (SDK, tests, config) - Move typescript/ contents back to root level - Remove Python CI job, release workflow, dependabot config - Update CLAUDE.md, README.md, docs for TypeScript-only - Remove Python references from SECURITY.md, DOCKER.md, ARCHITECTURE.md - Clean .gitignore of Python patterns - Simplify release tag pattern: ts-v* → v* Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 508452b commit 06efe27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+102
-4728
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: npm
4-
directory: /typescript
5-
schedule:
6-
interval: weekly
7-
groups:
8-
minor-and-patch:
9-
update-types: [minor, patch]
10-
- package-ecosystem: pip
11-
directory: /python
4+
directory: /
125
schedule:
136
interval: weekly
147
groups:

.github/workflows/ci.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,12 @@ on:
77
branches: [main]
88

99
jobs:
10-
typescript:
10+
build:
1111
runs-on: ubuntu-latest
12-
defaults:
13-
run:
14-
working-directory: typescript
1512
steps:
1613
- uses: actions/checkout@v6
1714
- uses: oven-sh/setup-bun@v2
1815
- run: bun install --frozen-lockfile
1916
- run: bun run check
2017
- run: bun run typecheck
2118
- run: npx vitest run
22-
23-
python:
24-
runs-on: ubuntu-latest
25-
strategy:
26-
matrix:
27-
python-version: ["3.12", "3.13"]
28-
defaults:
29-
run:
30-
working-directory: python
31-
steps:
32-
- uses: actions/checkout@v6
33-
- uses: astral-sh/setup-uv@v5
34-
- uses: actions/setup-python@v5
35-
with:
36-
python-version: ${{ matrix.python-version }}
37-
- run: uv sync --all-extras
38-
- run: uv run ruff check .
39-
- run: uv run ruff format --check .
40-
- run: uv run mypy src/
41-
- run: uv run pytest

.github/workflows/release-python.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release-typescript.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
name: Release TypeScript
1+
name: Release
22
on:
33
push:
4-
tags: ["ts-v*"]
4+
tags: ["v*"]
55

66
jobs:
77
release:
88
runs-on: ubuntu-latest
99
permissions:
1010
contents: write # create GitHub Release
1111
id-token: write # npm provenance
12-
defaults:
13-
run:
14-
working-directory: typescript
1512
steps:
1613
- uses: actions/checkout@v6
1714
- uses: actions/setup-node@v4

.gitignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,3 @@ dist/
88
*~
99
coverage/
1010
.claude/
11-
12-
# Python
13-
__pycache__/
14-
*.pyc
15-
*.pyo
16-
*.egg-info/
17-
.venv/
18-
.mypy_cache/
19-
.ruff_cache/
20-
.pytest_cache/

CLAUDE.md

Lines changed: 19 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
# robinhood-for-agents
22

3-
AI-native Robinhood trading interface — polyglot monorepo with TypeScript + Python SDKs.
3+
AI-native Robinhood trading interface — MCP server + TypeScript client library.
44

5-
## Monorepo Structure
6-
- `typescript/` — TypeScript SDK: MCP server + client library (npm: `robinhood-for-agents`)
7-
- `python/` — Python SDK: async client library (PyPI: `robinhood-for-agents`)
8-
- `docs/` — Shared documentation
5+
## Project Structure
6+
- `src/client/` — Robinhood API client (~50 async methods)
7+
- `src/server/` — MCP server with 18 tools
8+
- `bin/` — CLI entry point (`robinhood-for-agents`)
9+
- `skills/` — Claude Code skills for interactive use
910

10-
## TypeScript SDK (`typescript/`)
11-
12-
### Project Structure
13-
- `typescript/src/client/` — Robinhood API client (~50 async methods)
14-
- `typescript/src/server/` — MCP server with 18 tools
15-
- `typescript/bin/` — CLI entry point (`robinhood-for-agents`)
16-
- `typescript/skills/` — Claude Code skills for interactive use
17-
18-
### Tech Stack
11+
## Tech Stack
1912
- **Runtime**: Bun
2013
- **Language**: TypeScript (strict mode, ESM-only)
2114
- **MCP SDK**: `@modelcontextprotocol/sdk` v1.12+ (McpServer + StdioServerTransport)
@@ -24,24 +17,23 @@ AI-native Robinhood trading interface — polyglot monorepo with TypeScript + Py
2417
- **Linting**: Biome v2
2518
- **Browser Auth**: playwright-core (drives system Chrome, no bundled browser)
2619

27-
### Running the MCP Server
20+
## Running the MCP Server
2821
```bash
29-
cd typescript && bun install
22+
bun install
3023
bun bin/robinhood-for-agents.ts
3124
```
3225

33-
### Development
26+
## Development
3427
```bash
35-
cd typescript
3628
bun run typecheck # tsc --noEmit
3729
bun run check # biome lint + format
3830
npx vitest run # all tests (use vitest, NOT bun test)
3931
```
4032

41-
### Skills
42-
Canonical skill source is `typescript/skills/`. Local `.claude/skills/` contains symlinks for development.
33+
## Skills
34+
Canonical skill source is `skills/`. Local `.claude/skills/` contains symlinks for development.
4335

44-
Install MCP server + skills: `bun typescript/bin/robinhood-for-agents.ts install`
36+
Install MCP server + skills: `bun bin/robinhood-for-agents.ts install`
4537

4638
Skills use three-layer progressive disclosure:
4739
1. **SKILL.md** — MCP tool orchestration (default)
@@ -51,7 +43,7 @@ Skills use three-layer progressive disclosure:
5143
Available skills:
5244
- `robinhood-for-agents` - Unified skill: auth, portfolio, research, trading, options (dual-mode: MCP + client API)
5345

54-
### Client Patterns
46+
## Client Patterns
5547
```typescript
5648
import { RobinhoodClient, getClient } from "robinhood-for-agents";
5749

@@ -71,46 +63,13 @@ await rh.restoreSession();
7163
- Proper exceptions: `AuthenticationError`, `APIError`
7264
- **Do NOT use `phoenix.robinhood.com`** — it rejects TLS. Use `api.robinhood.com` endpoints only.
7365

74-
## Python SDK (`python/`)
75-
76-
### Tech Stack
77-
- **Python**: >=3.12 (PEP 695 generics, `type` statement, `@override`)
78-
- **HTTP**: httpx (async)
79-
- **Validation**: Pydantic v2
80-
- **Auth**: TokenStore adapters (keychain or encrypted file), shared with TypeScript SDK
81-
- **Testing**: pytest + pytest-asyncio + respx
82-
- **Linting**: ruff
83-
- **Type Checking**: mypy --strict
84-
85-
### Development
86-
```bash
87-
cd python
88-
uv sync --all-extras # install deps
89-
uv run ruff check . # lint
90-
uv run mypy src/ # type check
91-
uv run pytest # test
92-
```
93-
94-
### Client Patterns
95-
```python
96-
from robinhood_agents import RobinhoodClient
97-
98-
async with RobinhoodClient() as client:
99-
await client.restore_session()
100-
quotes = await client.get_quotes("AAPL")
101-
```
102-
- All methods are `async` (httpx under the hood)
103-
- Async-only — target users are AI agents
104-
- Shares token stores with TypeScript SDK — login once, use from either language
105-
10666
## Authentication
10767
- Browser login (`robinhood_browser_login`) opens a Chromium-based browser via playwright-core. On macOS, Brave and Chrome are auto-detected; otherwise use `BROWSER_PATH` or `robinhood-for-agents login --chrome /path/to/browser`.
10868
- Purely passive — Playwright intercepts `/oauth2/token` network traffic, never interacts with the DOM
10969
- Request body (JSON) → captures `device_token`; Response → captures `access_token` + `refresh_token`
11070
- Tokens stored in OS keychain (`KeychainTokenStore`, default) or encrypted file (`EncryptedFileTokenStore`, for Docker/headless)
11171
- `restoreSession()` loads tokens from the configured `TokenStore`, sets Bearer auth on the session, and registers automatic 401 token refresh
11272
- **Docker / headless:** Use `EncryptedFileTokenStore` — set `ROBINHOOD_TOKENS_FILE` and `ROBINHOOD_TOKEN_KEY` env vars. The `onboard` command can export encrypted tokens for container use.
113-
- **Python SDK:** Uses the same `TokenStore` adapters. `KeychainTokenStore` (via `keyring`) for local dev, `EncryptedFileTokenStore` (via `cryptography`) for Docker.
11473

11574
## Safety Rules
11675
- **NEVER** place bulk cancel operations
@@ -121,27 +80,19 @@ async with RobinhoodClient() as client:
12180

12281
## Testing
12382
```bash
124-
# TypeScript
125-
cd typescript && npx vitest run
126-
127-
# Python
128-
cd python && uv run pytest
83+
npx vitest run
12984
```
130-
Tests use mocking (vi.mock / respx) for HTTP layer — no real API calls.
85+
Tests use mocking (vi.mock) for HTTP layer — no real API calls.
13186

13287
### Integration Tests (local only, requires login)
13388
```bash
13489
# Login first (one-time)
13590
robinhood-for-agents onboard
13691

137-
# TypeScript
138-
cd typescript && bun run test:integration
139-
140-
# Python
141-
cd python && uv run pytest -m integration
92+
# Run integration tests
93+
bun run test:integration
14294
```
14395
Integration tests hit the real Robinhood API (read-only). They are excluded from CI and default test runs.
14496

14597
## Releases
146-
- TypeScript: tag `ts-v*` → publishes to npm
147-
- Python: tag `py-v*` → publishes to PyPI
98+
Tag `v*` → publishes to npm

README.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
[![ClawHub](https://img.shields.io/badge/ClawHub-robinhood--for--agents-blue)](https://clawhub.ai/kevin1chun/robinhood-for-agents)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
77

8-
Robinhood for AI agents — polyglot monorepo with TypeScript + Python SDKs and an MCP server with 18 tools.
8+
Robinhood for AI agents — MCP server with 18 tools + TypeScript client library.
99

1010
- **18 MCP tools** for any MCP-compatible AI agent
1111
- **Unified trading skill** for guided workflows (Claude Code, OpenClaw, [ClawHub](https://clawhub.ai/kevin1chun/robinhood-for-agents))
12-
- **TypeScript + Python client libraries** (~50 async methods each) for programmatic use
12+
- **TypeScript client library** (~50 async methods) for programmatic use
1313
- **Pluggable token storage** — OS keychain (default) or encrypted file (Docker/headless)
1414

1515
Compatible with **Claude Code**, **Codex**, **OpenClaw**, and any MCP-compatible agent.
1616

1717
## Prerequisites
1818

19-
- [Bun](https://bun.sh/) v1.0+ (TypeScript SDK)
20-
- [Python](https://www.python.org/) 3.12+ and [uv](https://docs.astral.sh/uv/) (Python SDK — optional)
19+
- [Bun](https://bun.sh/) v1.0+
2120
- Google Chrome (used by `playwright-core` for browser-based login — no bundled browser)
2221
- A Robinhood account
2322

@@ -44,9 +43,9 @@ robinhood-for-agents onboard --agent openclaw
4443

4544
```bash
4645
git clone https://github.com/kevin1chun/robinhood-for-agents.git
47-
cd robinhood-for-agents/typescript
46+
cd robinhood-for-agents
4847
bun install
49-
bun bin/robinhood-for-agents.ts onboard
48+
bun run onboard
5049
```
5150

5251
### Manual setup
@@ -272,26 +271,13 @@ See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full auth flow and [doc
272271

273272
## Development
274273

275-
### TypeScript
276-
277274
```bash
278-
cd typescript
279275
bun install # Install deps
280276
bun run typecheck # tsc --noEmit
281277
bun run check # Biome lint + format
282278
npx vitest run # Run all tests
283279
```
284280

285-
### Python
286-
287-
```bash
288-
cd python
289-
uv sync --all-extras # Install deps
290-
uv run ruff check . # Lint
291-
uv run mypy src/ # Type check
292-
uv run pytest # Run all tests
293-
```
294-
295281
### Integration tests (verify local setup)
296282

297283
Integration tests hit the real Robinhood API (read-only). Use them to confirm your local dev environment is working end-to-end.
@@ -301,8 +287,7 @@ Integration tests hit the real Robinhood API (read-only). Use them to confirm yo
301287
robinhood-for-agents onboard
302288
303289
# 2. Run integration tests
304-
cd typescript && bun run test:integration
305-
cd python && uv run pytest -m integration
290+
bun run test:integration
306291
```
307292

308293
These are excluded from CI and the default test commands since they require real credentials.

typescript/__tests__/client/client.test.ts renamed to __tests__/client/client.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ describe("RobinhoodClient", () => {
359359
expect.objectContaining({
360360
payload: expect.objectContaining({
361361
account: "https://api.robinhood.com/accounts/123/",
362+
order_form_version: 7,
362363
}),
363364
}),
364365
);
File renamed without changes.

0 commit comments

Comments
 (0)