Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
73a9323
fix: query conditional/trigger orders via { stop: true } fallback (#90)
Mar 30, 2026
85cc72e
refactor: exchange override system for CCXT order routing
Mar 31, 2026
8671977
fix: add .js extensions to ibkr ESM imports (#94)
Mar 31, 2026
2b31990
fix: heartbeat dedup test race condition on CI
Mar 31, 2026
c9241d6
Merge pull request #97 from TraderAlice/dev
luokerenx4 Mar 31, 2026
b1a4b43
refactor: align placeOrder/modifyOrder AI tool params with IBKR Order…
Apr 1, 2026
d056b9d
docs: add orderType param guide to placeOrder tool description
Apr 1, 2026
ff3c1d0
feat: add single-level TPSL (take profit / stop loss) to placeOrder
Apr 1, 2026
fd2236d
feat: expose TPSL on fetched orders (OpenOrder.tpsl)
Apr 1, 2026
1bba6af
refactor: summarize getOrders output + add groupBy contract clustering
Apr 1, 2026
df303f9
Merge pull request #98 from TraderAlice/dev
luokerenx4 Apr 1, 2026
2637843
fix: modifyOrder null-check bugs in Alpaca/CCXT + extend field forwar…
Apr 3, 2026
43e6cc4
refactor: extract shared MCP export layer with number coercion
Apr 3, 2026
3472132
chore: bump version to 0.9.0-beta.9
Apr 3, 2026
bbb679f
Merge pull request #100 from TraderAlice/dev
luokerenx4 Apr 3, 2026
9561d55
chore: disable low-usage thinking tools (think, plan, reportWarning, …
Apr 3, 2026
482d199
chore: remove equityGetEstimates tool
Apr 3, 2026
464034e
feat: register ETF, Index, Derivatives SDK clients
Apr 4, 2026
b35a488
refactor: type all market-data clients with openTypeBB standard models
Apr 4, 2026
e4a1746
build: add Turborepo for workspace build orchestration
Apr 4, 2026
9e01783
test: add bbProvider integration test framework + yfinance tests
Apr 4, 2026
988df36
test: add FMP bbProvider integration tests (33 fetchers)
Apr 4, 2026
be2d95f
fix: FMP provider schema fixes + add EquitySearch fetcher
Apr 4, 2026
6830e92
feat: add commodity to calculateIndicator + fix test isolation
Apr 4, 2026
8a0bfc1
refactor: test-provider uses SDK instead of HTTP + add bbEngine to ctx
Apr 4, 2026
55b932c
refactor: reorganize MarketData config page + add commodity
Apr 4, 2026
7b04f93
feat: add FMP CommoditySpotPrice fetcher
Apr 4, 2026
97470b8
Merge pull request #101 from TraderAlice/dev
luokerenx4 Apr 4, 2026
9ee3963
Merge remote-tracking branch 'upstream/master'
Apr 4, 2026
efdc581
chore: update @anthropic-ai/claude-agent-sdk 0.2.72 → 0.2.110
Apr 16, 2026
97329a7
Merge upstream/master (PRs #102-#124) into fork
Apr 16, 2026
0f5833c
fix: add openai dependency for upstream Codex provider
Apr 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ packages/ibkr/ref/source/cppclient/
packages/ibkr/ref/samples/Java/
packages/ibkr/ref/samples/Cpp/
packages/ibkr/ref/CMakeLists.txt

# Turborepo
.turbo/
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to Open Alice will be documented in this file.
All notable changes to OpenAlice will be documented in this file.

## [Unreleased]

Expand Down
16 changes: 15 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Open Alice
# OpenAlice

File-driven AI trading agent. All state (sessions, config, logs) stored as files — no database.

Expand All @@ -9,8 +9,20 @@ pnpm install
pnpm dev # Dev mode (tsx watch, port 3002)
pnpm build # Production build (backend + UI)
pnpm test # Vitest
pnpm test:e2e # e2e test
```

### Pre-commit Verification

Always run these checks before committing:

```bash
npx tsc --noEmit # Type check (catches errors pnpm build misses)
pnpm test # Unit tests
```

`pnpm build` uses tsup which is lenient — `tsc --noEmit` catches strict type errors that tsup ignores.

## Project Structure

```
Expand Down Expand Up @@ -138,3 +150,5 @@ Cron jobs persist in `data/cron/jobs.json`. If config and persisted state diverg
- When merging PRs, **prefer `--merge` over `--squash`** — squash destroys individual commit history. If the PR has clean, meaningful commits, merge them as-is
- If squash is needed (messy history), do it — but never combine with `--delete-branch`
- `archive/dev-pre-beta6` is a historical snapshot — do not modify or delete
- **After merging a PR**, always `git pull origin master` to sync local master. Stale local master causes confusion about what's merged and what's not.
- **Before creating a PR**, always `git fetch origin master` to check what's already merged. Use `git log --oneline origin/master..HEAD` to verify only the intended commits are ahead. Stale local refs cause PRs with wrong diff.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Open Alice
# Contributing to OpenAlice

Thanks for your interest in Open Alice!
Thanks for your interest in OpenAlice!

## Issues — Yes, Please

Expand All @@ -17,7 +17,7 @@ The more detail you provide, the faster we can act on it. Screenshots, logs, and

**We do not accept external pull requests.** This is not a reflection on the quality of contributions — it's a security decision.

Open Alice is a trading agent that executes real financial operations. Every line of code that runs has direct access to exchange accounts and API keys. Accepting external code — even well-intentioned code — introduces supply chain risk that we cannot afford. A single malicious dependency update, a subtle logic change in order execution, or a backdoor in a utility function could result in real financial loss.
OpenAlice is a trading agent that executes real financial operations. Every line of code that runs has direct access to exchange accounts and API keys. Accepting external code — even well-intentioned code — introduces supply chain risk that we cannot afford. A single malicious dependency update, a subtle logic change in order execution, or a backdoor in a utility function could result in real financial loss.

We review and implement all changes internally to maintain full control over the security surface.

Expand Down
250 changes: 75 additions & 175 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
header = """
# Changelog

All notable changes to Open Alice will be documented in this file.\n
All notable changes to OpenAlice will be documented in this file.\n
"""
body = """
{%- macro remote_url() -%}
Expand Down
90 changes: 90 additions & 0 deletions docs/project-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Project Structure

OpenAlice is a pnpm monorepo with Turborepo build orchestration.

```
packages/
├── ibkr/ # @traderalice/ibkr — IBKR TWS API TypeScript port
└── opentypebb/ # @traderalice/opentypebb — OpenBB platform TS port
ui/ # React frontend (Vite, 13 pages)
src/
├── main.ts # Composition root — wires everything together
├── core/
│ ├── agent-center.ts # Top-level AI orchestration, owns ProviderRouter
│ ├── ai-provider-manager.ts # GenerateRouter + StreamableResult + AskOptions
│ ├── tool-center.ts # Centralized tool registry (Vercel + MCP export)
│ ├── mcp-export.ts # Shared MCP export layer with type coercion
│ ├── session.ts # JSONL session store + format converters
│ ├── compaction.ts # Auto-summarize long context windows
│ ├── config.ts # Zod-validated config loader
│ ├── event-log.ts # Append-only JSONL event log
│ ├── connector-center.ts # ConnectorCenter — push delivery + last-interacted tracking
│ ├── async-channel.ts # AsyncChannel for streaming provider events to SSE
│ ├── tool-call-log.ts # Tool invocation logging
│ ├── media.ts # MediaAttachment extraction
│ ├── media-store.ts # Media file persistence
│ └── types.ts # Plugin, EngineContext interfaces
├── ai-providers/
│ ├── vercel-ai-sdk/ # Vercel AI SDK ToolLoopAgent wrapper
│ ├── agent-sdk/ # Claude backend (@anthropic-ai/claude-agent-sdk, OAuth + API key)
│ └── mock/ # Mock provider (testing)
├── domain/
│ ├── trading/ # Unified multi-account trading, guard pipeline, git-like commits
│ │ ├── account-manager.ts # UTA lifecycle (init, reconnect, enable/disable) + registry
│ │ ├── git-persistence.ts # Git state load/save
│ │ ├── brokers/
│ │ │ ├── registry.ts # Broker self-registration (configSchema + configFields + fromConfig)
│ │ │ ├── alpaca/ # Alpaca (US equities)
│ │ │ ├── ccxt/ # CCXT (100+ crypto exchanges)
│ │ │ ├── ibkr/ # Interactive Brokers (TWS/Gateway)
│ │ │ └── mock/ # In-memory test broker
│ │ ├── git/ # Trading-as-Git engine (stage → commit → push)
│ │ ├── guards/ # Pre-execution safety checks (position size, cooldown, whitelist)
│ │ └── snapshot/ # Periodic + event-driven account state capture, equity curve
│ ├── market-data/ # Structured data layer (opentypebb in-process + OpenBB API remote)
│ │ ├── equity/ # Equity data + SymbolIndex (SEC/TMX local cache)
│ │ ├── crypto/ # Crypto data layer
│ │ ├── currency/ # Currency/forex data layer
│ │ ├── commodity/ # Commodity data layer (EIA, spot prices)
│ │ ├── economy/ # Macro economy data layer
│ │ └── client/ # Data backend clients (opentypebb SDK, openbb-api)
│ ├── analysis/ # Indicators, technical analysis
│ ├── news/ # RSS collector + archive search
│ ├── brain/ # Cognitive state (memory, emotion)
│ └── thinking/ # Safe expression evaluator
├── tool/ # AI tool definitions — thin bridge from domain to ToolCenter
│ ├── trading.ts # Trading tools (delegates to domain/trading)
│ ├── equity.ts # Equity fundamental tools
│ ├── market.ts # Symbol search tools
│ ├── analysis.ts # Indicator calculation tools
│ ├── news.ts # News archive tools
│ ├── brain.ts # Cognition tools
│ ├── thinking.ts # Reasoning tools
│ ├── browser.ts # Browser automation tools (wraps openclaw)
│ └── session.ts # Session awareness tools
├── server/
│ ├── mcp.ts # MCP protocol server
│ └── opentypebb.ts # Embedded OpenBB-compatible HTTP API (optional)
├── connectors/
│ ├── web/ # Web UI (Hono, SSE streaming, sub-channels)
│ ├── telegram/ # Telegram bot (grammY, magic link auth, /trading panel)
│ ├── mcp-ask/ # MCP Ask connector (external agent conversation)
│ └── mock/ # Mock connector (testing)
├── task/
│ ├── cron/ # Cron scheduling (engine, listener, AI tools)
│ └── heartbeat/ # Periodic heartbeat with structured response protocol
└── openclaw/ # ⚠️ Frozen — DO NOT MODIFY
data/
├── config/ # JSON configuration files
├── sessions/ # JSONL conversation histories (web/, telegram/, cron/)
├── brain/ # Agent memory and emotion logs
├── cache/ # API response caches
├── trading/ # Trading commit history + snapshots (per-account)
├── news-collector/ # Persistent news archive (JSONL)
├── cron/ # Cron job definitions (jobs.json)
├── event-log/ # Persistent event log (events.jsonl)
├── tool-calls/ # Tool invocation logs
└── media/ # Uploaded attachments
default/ # Factory defaults (persona, heartbeat, skills)
docs/ # Documentation
```
Loading