[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74806":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},74806,"OpenAlice","TraderAlice\u002FOpenAlice","TraderAlice","Your one-person Wall Street. An AI trading agent covering equities, crypto, commodities, forex, and macro — from research through position entry, ongoing management, to exit.","https:\u002F\u002Fopenalice.ai",null,"TypeScript",5063,784,32,17,0,144,428,1035,432,39.68,"GNU Affero General Public License v3.0",false,"master",[],"2026-06-12 02:03:28","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Falice-full.png\" alt=\"OpenAlice\" width=\"140\">\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">OpenAlice\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Your one-person Wall Street.\u003C\u002Fstrong>\u003Cbr>\n  An AI trading agent covering equities, crypto, commodities, forex, and macro — from research through position entry, ongoing management, to exit.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fopenalice.ai\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWebsite-blue\" alt=\"Website\">\u003C\u002Fa> · \u003Ca href=\"https:\u002F\u002Fopenalice.ai\u002Fdocs\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocs-green\" alt=\"Docs\">\u003C\u002Fa> · \u003Ca href=\"https:\u002F\u002Fx.com\u002FOpenAliceAI\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FX-000000?logo=x&logoColor=white\" alt=\"X (Twitter)\">\u003C\u002Fa> · \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fzf4STmrQd8\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-5865F2?logo=discord&logoColor=white\" alt=\"Discord\">\u003C\u002Fa> · \u003Ca href=\"https:\u002F\u002Fqm.qq.com\u002Fq\u002FiSg6O4FmrC\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQQ-12B7F5\" alt=\"QQ\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fpreview.png\" alt=\"OpenAlice Preview\" width=\"720\">\n\u003C\u002Fp>\n\n- **Full-spectrum** — analyze and trade across asset classes. Multiple brokers combine into one unified workspace so you're never stuck with \"I can see it but can't trade it.\"\n- **Full-lifecycle** — not just entry signals. Research, position sizing, ongoing monitoring, risk management, and exit decisions — Alice covers the entire trading lifecycle, 24\u002F7.\n- **Full-control** — every trade goes through version history and safety checks, and requires your explicit approval before execution. You see every step, you can stop every step.\n\nAlice runs on your own machine, because trading involves private keys and real money — that trust can't be outsourced.\n\n> [!CAUTION]\n> **OpenAlice is experimental software in active development.** Many features and interfaces are incomplete and subject to breaking changes. Do not use this software for live trading with real funds unless you fully understand and accept the risks involved. The authors provide no guarantees of correctness, reliability, or profitability, and accept no liability for financial losses.\n\n## Features\n\n### Trading\n\n- **Unified Trading Account (UTA)** — multiple brokers (CCXT, Alpaca, Interactive Brokers) combine into unified workspaces. AI interacts with UTAs, never with brokers directly\n- **Trading-as-Git** — stage orders, commit with a message, push to execute. Full history reviewable with commit hashes\n- **Guard pipeline** — pre-execution safety checks (max position size, cooldown, symbol whitelist) per account\n- **Account snapshots** — periodic and event-driven state capture with equity curve visualization\n\n### Research & Analysis\n\n- **Market data** — equity, crypto, commodity, currency, and macro data via TypeScript-native OpenBB engine. Unified cross-asset symbol search and technical indicator calculator\n- **Fundamental research** — company profiles, financial statements, ratios, analyst estimates, earnings calendar, insider trading, and market movers. Currently deepest for equities, expanding to other asset classes\n- **News** — background RSS collection with archive search\n\n### Automation\n\nAutomation has two layers in OpenAlice. They're worth separating because each evolves on its own track:\n\n**Scheduling — *what* fires an AI call.** A typed append-only event log + cron engine that emits events on a schedule. Stable, reusable across both old and new execution models.\n\n- **Cron scheduling** — cron expressions, intervals, or one-shot timestamps\n- **Heartbeat** — a periodic timer with active-hours filtering and a dedup window\n- **Webhooks** — inbound event triggers from external systems (planned)\n\n**Execution — *how* the trigger lands.** Today's heartbeat and cron jobs still use the pre-Workspace wiring: event → AgentCenter (the global chat) → AI run → optional `notify_user` → NotificationsStore → Connectors. That path is fine for \"one-in, one-out\" pings — heartbeat updates, scheduled market checks — and remains in production. The direction we're moving in: workspace-resident executions, where a scheduled event either fires a one-shot task inside a Workspace OR drives continued dialog on a Workspace's persistent Session. The scheduling layer above is shared either way.\n\n### Interface\n\n- **Web UI** — chat with SSE streaming, sub-channels, portfolio dashboard with equity curve, and full config management\n- **Workspace** — a per-task directory + git repo + persistent terminal session running your chosen agent CLI (`claude` \u002F `codex` \u002F `shell`) with OpenAlice's MCP tools plumbed in. The recommended path for any non-trivial AI work — native prompt cache, native rendering, no protocol shim\n- **Inbox** — workspace-to-user push channel. Agents call `inbox_push` from inside a workspace to surface a document (rendered live) plus a markdown comment in a dedicated tab; click the reply bar to jump back into the workspace and continue\n- **Telegram** — mobile access with trading panel\n- **MCP server** — tool exposure for external agents\n\n### And More!\n\n- **Multi-provider AI** — Claude (Agent SDK with OAuth or API key) or Vercel AI SDK (Anthropic, OpenAI, Google), switchable at runtime\n- **Evolution mode** — permission escalation that gives Alice full project access including Bash, enabling self-modification\n\n\n## Architecture\n\n```mermaid\ngraph TB\n  subgraph Surfaces[\"Surfaces — where users interact\"]\n    WEB[Web UI]\n    INB[Inbox tab]\n    TG[Telegram]\n    MCPS[MCP Server]\n  end\n\n  subgraph Workspace[\"Workspace — agent's home\u003Cbr\u002F>(dir + git + native CLI)\"]\n    WCLI[claude \u002F codex \u002F shell session]\n  end\n\n  subgraph Core[\"Core — orchestration\"]\n    AC[AgentCenter\u003Cbr\u002F>+ ProviderRouter]\n    TC[ToolCenter\u003Cbr\u002F>+ Workspace ToolCenter]\n    IS[InboxStore]\n    CCR[ConnectorCenter]\n  end\n\n  subgraph Domain[\"Domain — business logic\"]\n    subgraph UTA[\"UTA (Trading)\"]\n      TG2[Trading Git]\n      GD[Guards]\n      BK[Brokers]\n    end\n    MD[Market Data]\n    AN[Analysis]\n    NC[News]\n  end\n\n  subgraph Sched[\"Scheduling — what fires\"]\n    CRON[Cron \u002F Heartbeat \u002F Webhook]\n  end\n\n  Sched -. legacy execution .-> AC\n  Sched -. workspace-resident .-> Workspace\n\n  WEB --> AC\n  TG --> AC\n  AC --> Domain\n\n  Workspace -->|.mcp.json| MCPS\n  MCPS --> TC\n  TC --> Domain\n  Workspace -.inbox_push.-> IS\n  IS --> INB\n\n  CCR --> Surfaces\n```\n\n**Surfaces** — external places where users interact with Alice: Web UI (chat, Inbox tab, portfolio dashboards), Telegram, MCP Server. ConnectorCenter tracks the last-used channel for delivery routing.\n\n**Workspace** — A per-task directory + git repo + persistent terminal session running a native agent CLI. The recommended substrate for non-trivial AI work. Wired to OpenAlice via two MCP servers in `.mcp.json`: a global one (full tool catalog) and a per-workspace one (workspace-scoped tools like `inbox_push`, with the wsId carried in the URL path so the agent never traffics its own identity).\n\n**Core** — AgentCenter + ProviderRouter route AI calls to the active provider. ToolCenter is the shared registry for global tools; WorkspaceToolCenter holds per-workspace tool factories. InboxStore is an append-only JSONL behind the Inbox tab; ConnectorCenter routes outbound messages on the legacy path.\n\n**Domain** — UTA is the trading workspace (broker connection + git history + guards). Market Data, Analysis, and News are independent modules, each exposed to AI through tool registrations.\n\n**Scheduling** — Cron, the heartbeat timer, and webhook ingest fire events on a schedule. *What* the event drives is the execution layer: today's heartbeat and cron still take the legacy path through AgentCenter (dotted line — the \"one-in, one-out\" AI call pattern); the direction we're moving in is workspace-resident execution where a scheduled event either fires a one-shot task inside a Workspace or drives continued dialog on a persistent Session.\n\n## Key Concepts\n\n**UTA (Unified Trading Account)** — The core abstraction. Each UTA wraps a broker connection, operation history, guard pipeline, and snapshot scheduler into a single self-contained workspace. AI and the frontend interact with UTAs exclusively — brokers are internal implementation details. Multiple UTAs work like independent repositories: one for Alpaca US equities, one for Bybit crypto, each with its own history and guards.\n\n**Trading-as-Git** — The workflow inside each UTA. Stage orders, commit with a message, then push to execute. Push runs guards, dispatches to the broker, snapshots account state, and records a commit with an 8-char hash. Full history is reviewable like `git log` \u002F `git show`.\n\n**Guard** — A pre-execution safety check that runs inside a UTA before orders reach the broker. Guards enforce limits (max position size, cooldown between trades, symbol whitelist) and are configured per-account. Think of it as ESLint for trading — automated rules that catch problems before they go live.\n\n**Heartbeat** — A scheduling pattern: a recurring timer with an active-hours filter and a dedup window for the message body. The pattern is general; today its execution wiring routes through the pre-Workspace path (AgentCenter → `notify_user` → NotificationsStore → connectors), so a heartbeat tick currently delivers as a message in your last-used channel. As Workspace-resident autonomous work matures, the same scheduling primitive will be wired into workspace executions too.\n\n**Connector** — An external interface through which users interact with Alice. Built-in: Web UI, Telegram, MCP Ask. Delivery always goes to the channel you last spoke through.\n\n**AI Provider** — The AI backend that powers Alice. Claude (via Agent SDK, supports OAuth login or API key) or Vercel AI SDK (Anthropic, OpenAI, Google). Switchable at runtime — no restart needed.\n\n**Workspace** — A directory + git repo + persistent terminal session running a native agent CLI (`claude`, `codex`, or `shell`) of your choice. OpenAlice plumbs its MCP servers into the workspace via `.mcp.json`, so the agent inside sees the workspace's local files plus OpenAlice's full tool surface (trading, market data, news, analysis). Workspaces live under `~\u002F.openalice\u002Fworkspaces\u002F\u003CwsId>\u002F` — each is its own self-contained scratch directory the agent can read, write, and `git commit` inside. This is the recommended substrate for any non-trivial AI work: native prompt cache, native CLI rendering, no protocol shim between you and the model. Capability extensions (browser automation, third-party CLIs, custom scrapers) ship as new workspace **templates** rather than `src\u002F` dependencies, keeping the main repo small.\n\n**Templates & satellite repos** — A workspace template is a bootstrap script + initial file set that materializes a workspace of a particular shape (today: `chat`, `auto-quant`). Templates are how OpenAlice's ecosystem grows without bloating the main repo: when a new capability (a research toolkit, a backtest harness, a custom MCP server) is worth packaging, it lives in its own **satellite repo** that a template clones at bootstrap time. The main repo deliberately doesn't accept ecosystem PRs — it owns the Trading domain and the workspace launcher; everything else routes through satellite repos referenced by templates. Means template authors can ship on their own cadence, and OpenAlice's `src\u002F` stays small.\n\n**Inbox** — Workspace-to-user push channel. Agents working inside a workspace call the `inbox_push` MCP tool to surface docs (rendered live from workspace files) plus markdown commentary in a dedicated Inbox tab. The user reads, then clicks the reply bar at the bottom of the entry to jump back into the workspace's session and continue the conversation there. Inbox is distinct from the legacy **Notifications** surface (now demoted into the Chat sidebar's Traditional section) — that one is reserved for pre-Workspace Automation flows (heartbeat \u002F cron pushes).\n\n## Two kinds of chat\n\nOpenAlice ships two paths for chatting with Alice. They have very different performance characteristics, and picking the right one matters more than it looks.\n\n### Workspace chat (recommended when available)\n\nA chat-type **workspace** is a directory + git repo + a persistent terminal session running the native CLI of your chosen agent (`claude`, `codex`, or `shell`). The CLI process handles all model interaction, prompt caching, and rendering — OpenAlice's job is to plumb its MCP server into the workspace and surface the terminal in the UI.\n\n- **Native prompt cache.** Claude Code, Codex, and the other agent CLIs implement vendor-specific cache control we can't replicate. On a long conversation this is often a 10× cost reduction.\n- **Native frontend.** TUI rendering, syntax highlighting, diff display — the CLI vendor has already tuned these for their model.\n- **Full tool surface.** The CLI sees the workspace's local files plus OpenAlice's MCP tools. No \"greatest-common-denominator\" trimming.\n- **Stable.** No `ChatHook` protocol layer between you and the model.\n\nThe only requirement: the CLI binary has to be installed on the host running OpenAlice.\n\n### Traditional chat\n\nThe original `\u002Fchat` page. OpenAlice's `ChatHook` calls the agent SDK (Vercel AI SDK or Anthropic Agent SDK) directly, normalizes events through its own layer, and renders them.\n\n- **No shell required.** Works in any environment OpenAlice runs in.\n- **Reachable by connectors.** Telegram, MCP Ask, and webhook-pushed messages all land here because those surfaces have no terminal to host a CLI in.\n\nThe cost: token usage is high (cache control is OpenAlice's responsibility and still incomplete), capability is constrained (each new CLI feature has to be re-implemented at the `ChatHook` layer), and `ChatHook` itself is still maturing.\n\n### Which one should I use?\n\n| Scenario | Use |\n| --- | --- |\n| Interactive UI chats with Alice on this machine | **Workspace chat** |\n| Connector-pushed messages (Telegram bot, webhook callbacks) | Traditional chat |\n| Long sessions where token cost matters | **Workspace chat** |\n| Environment with no shell \u002F no CLI installed | Traditional chat |\n\nToday the connectors are wired to traditional chat. Workspace chat is the recommended path going forward; Traditional remains in place specifically because connector-driven flows (Telegram, MCP Ask, webhook callbacks) have no terminal to host a CLI in. If shell-bridged connectors arrive later, they can opt into workspace chat too.\n\n## Quick Start\n\nPrerequisites: Node.js 22+, pnpm 10+, [Claude Code CLI](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) installed and authenticated.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FTraderAlice\u002FOpenAlice.git\ncd OpenAlice\npnpm install && pnpm build\npnpm dev\n```\n\nOpen [localhost:3002](http:\u002F\u002Flocalhost:3002) and start chatting. No API keys or config needed — the default setup uses your local Claude Code login (Claude Pro\u002FMax subscription).\n\n### Windows\n\nOpenAlice's Workspace feature spawns bash-based bootstrap scripts to materialize new workspaces, so a POSIX shell environment is required:\n\n- **Recommended:** install [Git for Windows](https:\u002F\u002Fgitforwindows.org\u002F) and accept the default *\"Use Git from the Windows Command Prompt\"* option during setup — this puts `bash` plus the POSIX utilities the scripts depend on (`sed`, `cp`, `mkdir`, `basename`, `printf`, etc.) on your PATH.\n- **Alternative:** run OpenAlice from inside [WSL2](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall) — the Linux env handles everything natively.\n\nNative `cmd.exe` \u002F PowerShell alone are not supported (no `bash`, no POSIX utilities). If `bash` isn't on PATH when you create a workspace, the bootstrap fails with an inline hint pointing back here.\n\nNote: we don't currently dogfood OpenAlice on Windows, so the broader experience (PTY rendering, file watching, paths with spaces) may have rough edges. Bug reports very welcome.\n\n## Configuration\n\nAll config lives in `data\u002Fconfig\u002F` as JSON files with Zod validation. Missing files fall back to sensible defaults. You can edit these files directly or use the Web UI.\n\n**AI Provider** — The default provider is Claude (Agent SDK), which uses your local Claude Code login — no API key needed. To use the [Vercel AI SDK](https:\u002F\u002Fsdk.vercel.ai\u002Fdocs) instead (Anthropic, OpenAI, Google, etc.), switch `ai-provider.json` to `vercel-ai-sdk` and add your API key. Both can be switched at runtime via the Web UI.\n\n**Trading** — Unified Trading Account (UTA) architecture. Each account in `accounts.json` becomes a UTA with its own broker connection, git history, and guard config. Broker-specific settings live in the `brokerConfig` field — each broker type declares its own schema and validates it internally.\n\n| File | Purpose |\n|------|---------|\n| `engine.json` | Trading pairs, tick interval, timeframe |\n| `agent.json` | Max agent steps, evolution mode toggle, Claude Code tool permissions |\n| `ai-provider.json` | Active AI provider (`agent-sdk` or `vercel-ai-sdk`), login method, switchable at runtime |\n| `accounts.json` | Trading accounts with `type`, `enabled`, `guards`, and `brokerConfig` (broker-specific settings) |\n| `connectors.json` | Web\u002FMCP server ports, MCP Ask enable |\n| `telegram.json` | Telegram bot credentials + enable |\n| `web-subchannels.json` | Web UI sub-channel definitions with per-channel AI provider overrides |\n| `tools.json` | Tool enable\u002Fdisable configuration |\n| `market-data.json` | Data backend (`typebb-sdk` \u002F `openbb-api`), per-asset-class providers, provider API keys, embedded HTTP server config |\n| `news.json` | RSS feeds, fetch interval, retention period |\n| `snapshot.json` | Account snapshot interval and retention |\n| `compaction.json` | Context window limits, auto-compaction thresholds |\n| `heartbeat.json` | Heartbeat enable\u002Fdisable, interval, active hours |\n\nPersona and heartbeat prompts use a **default + user override** pattern:\n\n| Default (git-tracked) | User override (gitignored) |\n|------------------------|---------------------------|\n| `default\u002Fpersona.default.md` | `data\u002Fbrain\u002Fpersona.md` |\n| `default\u002Fheartbeat.default.md` | `data\u002Fbrain\u002Fheartbeat.md` |\n\nOn first run, defaults are auto-copied to the user override path. Edit the user files to customize without touching version control.\n\n## Project Structure\n\nOpenAlice is a pnpm monorepo with Turborepo build orchestration. See [docs\u002Fproject-structure.md](docs\u002Fproject-structure.md) for the full file tree.\n\n## Getting Help\n\nStuck? Here's the recommended path, roughly in order:\n\n1. **Let an AI agent fix it** — Claude Code, Cursor, or any other coding agent can read the codebase and patch most issues directly. Fastest path for bugs and \"how do I do X\" questions\n2. **[Ask DeepWiki](https:\u002F\u002Fdeepwiki.com\u002FTraderAlice\u002FOpenAlice)** — natural-language Q&A over the entire codebase, good for architectural questions and figuring out where to look\n3. **Community** — [Discord](https:\u002F\u002Fdiscord.gg\u002Fzf4STmrQd8) for English speakers, [QQ 群](https:\u002F\u002Fqm.qq.com\u002Fq\u002FiSg6O4FmrC) for 中文开发者. For things AI can't answer — design discussions, edge cases, or just hanging out\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=TraderAlice\u002FOpenAlice&type=Date)](https:\u002F\u002Fstar-history.com\u002F#TraderAlice\u002FOpenAlice&Date)\n\n## License\n\n[AGPL-3.0](LICENSE)","OpenAlice 是一个面向个人的全方位AI交易助手，覆盖股票、加密货币、商品、外汇和宏观经济分析，从研究到建仓、持续管理直至平仓。其核心功能包括全谱系资产分析与交易、全生命周期交易管理和全控制流程，确保每一步操作都经过版本历史记录和安全检查，并需要用户明确批准后执行。技术上，OpenAlice 采用 TypeScript 编写，支持多经纪商账户统一管理（如CCXT、Alpaca、Interactive Brokers），并以类似于Git的工作流来处理订单提交和执行。该项目适合对金融市场有深入理解且希望利用AI辅助进行复杂资产管理的个人投资者或小型团队使用。",2,"2026-06-11 03:50:56","high_star"]