Commit Graph

1049 Commits

Author SHA1 Message Date
shinchan-zhai
c55800ab68 feat: add multi-turn conversation memory to Agent
- Add chatHistory store (in-memory, per user, last 20 messages)
- Agent now passes full conversation context to LLM via CallWithRequest
- Records both user messages and assistant responses
- Add /clear command to reset conversation history
- Add 'Clear' quick action button in frontend
- Supports natural multi-turn conversations (follow-up questions, context)
2026-03-25 01:05:54 +08:00
shinchan-zhai
a21479a358 feat: redesign AgentChatPage - Agent-centric UI with side panels
- Rewrite AgentChatPage as primary interface with Perplexity-style layout
- Add right sidebar with Market Ticker, Positions, and Trader Status panels
- Sidebar is collapsible and responsive (auto-hides on mobile)
- Each sidebar section independently collapsible
- Chat area: centered 720px max-width with smooth streaming effect
- Simple markdown rendering (bold, code blocks, inline code)
- Quick action chips redesigned as pill buttons with hover effects
- Input upgraded to auto-resizing textarea
- New components: MarketTicker, PositionsPanel, TraderStatusPanel
- Dark theme consistent with NOFXi brand colors
- Real-time data via SWR for positions and trader status
2026-03-25 01:05:54 +08:00
shinchan-zhai
2cb8970e23 feat: real-time data for A-shares, HK stocks, and US stocks
Data source: Sina Finance API (free, no key needed)
- A股: sh/sz prefix, GBK→UTF-8, 30+ fields
- 港股: hk prefix, different field layout
- 美股: gb_ prefix, USD prices

Coverage:
- 20+ A-share stocks (拓维信息/贵州茅台/比亚迪/宁德时代...)
- 12 HK stocks (腾讯/阿里/美团/小米/京东...)
- 20 US tickers (AAPL/TSLA/NVDA/MSFT/GOOGL/AMZN...)
- Auto-detect 6-digit A-share codes, 5-digit HK codes
- US ticker symbols recognized (TSLA, AAPL, etc.)

All three markets tested:
- A股 拓维信息: ¥35.57 (-6.71%) 
- 港股 腾讯: HK$510.50 (-0.49%) 
- 美股 TSLA: $367.96 (-3.24%) 
2026-03-25 01:05:54 +08:00
shinchan-zhai
53db1c72ac feat: real-time A-share stock data via Sina Finance API
NOFXi can now fetch REAL stock prices for A-shares.

Data source: Sina Finance hq.sinajs.cn (free, no API key)
- Name, price, open, prev close, high, low, volume, turnover
- Change % calculated from prev close
- GBK → UTF-8 encoding handled

Stock resolution:
- Known stocks: 拓维信息→sz002261, 贵州茅台→sh600519, etc.
- Auto-detect 6-digit codes in user text
- Prefix detection: 6xx→sh, 0xx/3xx→sz

Context injection:
- Stock data auto-appended to LLM context when user mentions a stock
- AI sees REAL price, volume, change % — cannot fabricate

Tested: '拓维信息这只股,10万元,1个月交易计划'
→ Returns ¥35.57 (real price), -6.71% (real change), 53.94亿成交额
→ Strategy based on actual price levels, not hallucinated
2026-03-25 01:05:54 +08:00
shinchan-zhai
3ad71b025d fix: AI no longer fabricates prices for assets without real-time data
System prompt now explicitly:
- Lists which assets have real-time data (crypto) and which don't (stocks/forex)
- FORBIDS fabricating specific prices
- Requires disclosure: 'based on historical knowledge, not live data'
- Allows strategy frameworks but not fake price levels

Tested: 拓维信息 → now says '我没有A股实时数据' upfront, gives
strategy framework without fake prices. Honesty > confidence.
2026-03-25 01:05:54 +08:00
shinchan-zhai
ebd8a9c8f5 fix: bypass SSRF DNS resolver for AI API calls
SSRF protection was blocking AI API calls because Go's custom resolver
couldn't resolve external domains (DNS timeout). curl worked because it
uses the system resolver.

Fix: Agent creates MCP client with standard http.Client (no SSRF filter)
since we control the API URLs.

Tested: '帮我看看拓维信息这只股,我有10万元,帮我制定1个月交易计划'
→ Returns professional A-share analysis with entry/exit strategy in 5.8s
2026-03-25 01:05:54 +08:00
shinchan-zhai
75f271ad65 refactor: delete router.go — LLM is the brain, not regex
DELETED: agent/router.go (regex-based intent routing)

The fundamental architecture was wrong. A real AI Agent doesn't use
pattern matching to understand users. It uses AI.

New flow:
1. User says anything
2. /help and /status → instant response (no AI needed)
3. Setup keywords → onboard flow
4. EVERYTHING else → LLM with full context

The LLM receives:
- System prompt with NOFXi's capabilities and behavior rules
- Real-time market data (auto-detected from mentioned symbols)
- Live trader positions and status
- User's message

The LLM decides what to do. Not regex. Not if-else. The AI.

This is what makes it an Agent, not a chatbot.
2026-03-25 01:05:54 +08:00
shinchan-zhai
d69dad5c1a fix: smart routing + auto AI client from store
1. Complex natural language → AI chat (not regex analyze)
   '拓维信息这个股怎么样帮我写策略' now goes to AI, not broken regex

2. Agent auto-loads AI client from store on startup
   - Scans AIModel configs, creates MCP client from first available
   - No manual injection needed

3. Added start.sh for one-command startup (backend + frontend)

Routing logic:
- /analyze BTC (simple, ≤3 words) → structured analyze
- Complex sentences → AI chat with full context
- This is the key insight: regex can't parse natural language, AI can
2026-03-25 01:05:54 +08:00
shinchan-zhai
58ea77be6b feat: AI-powered analysis for ANY asset (stocks, forex, crypto)
- Crypto: real-time data (market.Get) + AI analysis
- Stocks/Forex: AI answers with its own knowledge (A股/港股/美股/外汇)
- No more 'coming soon' — if AI is configured, it can analyze anything
- Graceful fallback: no AI → guide user to configure
- AI prompt asks for: asset type, fundamentals, trend, key levels, risks
2026-03-25 01:05:54 +08:00
shinchan-zhai
6ab410e50b fix: Agent answers questions first, setup only when asked
Core behavior change:
- Agent NO LONGER auto-prompts setup on first message
- Setup only triggers on explicit: '开始配置' / 'setup' / '绑定交易所'
- Normal questions answered normally, even without trader configured
- AI analysis works without AI model (shows raw data + guidance)
- Stock analysis shows 'coming soon' instead of error

Intent routing improved:
- '你能分析拓维信息吗' → correctly routes to analyze
- Chinese suffixes cleaned (吗/呢/这只股票)
- More natural language patterns matched

Philosophy: Agent should be helpful from minute one.
Configuration is optional, not a gate.
2026-03-25 01:05:54 +08:00
shinchan-zhai
3f94f0b11c fix: prevent panic on empty trader ID 2026-03-25 01:05:54 +08:00
shinchan-zhai
2583ef6aa4 fix: setup flow doesn't hijack normal conversation
- Detects when user sends Chinese text, short text, or text with spaces
  during key-input steps → auto-pauses setup and answers the question
- API key masking fixed (no more garbled display)
- User can resume setup with '开始配置' anytime
2026-03-25 01:05:54 +08:00
shinchan-zhai
9945e4e10d feat: unified NOFXi — one system, one port, one UI
Key changes:
- Agent API routes (/api/agent/*) registered directly on NOFX's :8080 server
- No more separate :8900 port — everything on :8080
- AgentChatPage.tsx added to React frontend
- Agent tab (🤖 Agent) added to navigation bar, set as DEFAULT page
- Branding: NOFX → NOFXi everywhere (title, header, branding.ts, i18n)
- Default landing page is now Agent chat, not competition

This is THE change: there is no more 'NOFX' vs 'NOFXi'.
Users open localhost:8080, they see NOFXi.
Agent chat is the first thing they see.
All other pages (Traders, Dashboard, Strategy, Data) are still there.

One binary. One port. One product. NOFXi.
2026-03-25 01:05:54 +08:00
shinchan-zhai
0f086e5ebc feat: conversational onboarding — setup exchange & AI via chat
Users no longer need Web UI to configure NOFXi. The agent guides them
through setup via natural language:

1. First message → agent detects no traders → shows welcome
2. User says '开始配置' or 'setup'
3. Agent asks: which exchange? (1-7, name, or Chinese name)
4. Agent asks: API Key → API Secret → Passphrase (if needed)
5. Agent asks: which AI model? (DeepSeek/Qwen/GPT/Claude/Skip)
6. Agent asks: AI API Key
7. Agent creates Exchange + AIModel + Trader in NOFX store
8. Done. User can immediately start using /analyze, /positions, etc.

Features:
- Full Chinese/English bilingual flow
- Cancel anytime with '取消' or 'cancel'
- State persisted in SystemConfig (survives restarts)
- Supports all 7 exchanges + 4 AI providers
- OKX/Bitget/KuCoin auto-asks for Passphrase
- API keys stored encrypted via NOFX crypto service
2026-03-25 01:05:54 +08:00
shinchan-zhai
fb456a3537 fix: NOFXi Agent real AI integration + quality improvements
Critical fixes:
1. Agent now uses NOFX's MCP client for AI calls (real models, not placeholder)
   - Gets AI client from first configured trader's MCP config
   - Added AutoTrader.GetMCPClient() export
2. /analyze uses REAL market data (market.Get → EMA/MACD/RSI/BB/OI/funding)
   then sends to AI — no more hallucinated prices
3. AI chat enriches prompts with live market data when user mentions a coin
4. Fallback: if AI unavailable, shows raw formatted market data (still useful)

Router improvements:
- Better natural language detection for Chinese
- '该不该买' '走势' '趋势' '行情' → analyze intent
- '多少钱' '赚了' '亏了' → query intent
- Fewer messages falling through to generic chat

Web UI:
- Endpoints updated to /api/agent/* namespace
- nofxi.html served at agent root (localhost:8900)

Result: AI analysis now shows real BTC price, real RSI, real EMA — not fiction.
2026-03-25 01:05:54 +08:00
shinchan-zhai
f095b6655b feat: NOFXi Agent integrated into NOFX core
This is the key architectural change: NOFXi is no longer a separate
sub-project in nofxi/, but a first-class module in agent/ that sits
on top of NOFX's existing engine.

agent/ package:
- agent.go: Core orchestrator, directly uses NOFX's TraderManager,
  Store, and Market packages. No wrapper/bridge needed.
- brain.go: Proactive intelligence (news scan, market briefs, signal handling)
- sentinel.go: Market anomaly detection (price breakout, volume spike, funding rate)
- scheduler.go: Daily reports, position risk checks
- router.go: Intent routing for natural language (中/英 bilingual)
- i18n.go: Full Chinese/English message catalog
- web.go: Agent REST API on :8900 (chat, klines, ticker)

main.go changes:
- Banner: NOFX → NOFXi
- Agent auto-starts with NOFX (sentinel + brain + scheduler + web)
- Zero breaking changes to existing NOFX functionality

Key difference from old nofxi/:
- Agent reads LIVE data from TraderManager (positions, balances, status)
- Uses market.Get() for full technical indicators (EMA/MACD/RSI/BB)
- No duplicate code — kernel, trader, store all used directly
- Old nofxi/ sub-project will be removed once migration is verified

Architecture:
  NOFX (engine) → kernel + trader + market + store + mcp + telegram
  NOFXi (brain) → agent/ package → uses all of the above
2026-03-25 01:05:54 +08:00
shinchan-zhai
4c5f69984c docs(nofxi): NOFX integration audit + plan
Full audit of NOFX's capabilities vs NOFXi's current integration status.
Priority roadmap: P0 (kernel+trader+market+mcp) → P1 (store+risk) → P2 (grid+web)
2026-03-25 01:05:54 +08:00
shinchan-zhai
656016c5a8 feat(nofxi): proactive intelligence - Sentinel, Brain, Learner
🧠 Brain (proactive intelligence):
- Receives signals from Sentinel and decides when to notify
- Signal debouncing (same type+symbol within 10min)
- Morning brief at 08:30, evening brief at 20:30 (AI-generated)
- Crypto news scanning every 5 minutes
- Auto-filters high-impact news by sentiment + relevance

👁️ Sentinel (market anomaly detection):
- Watches BTC/ETH/SOL by default (expandable)
- Price breakout detection (>3% in 5 minutes)
- Volume spike detection (>3x average)
- Funding rate anomaly detection (>0.1%)
- 60-second scan interval, 1-hour price history buffer

📰 News Monitor:
- CryptoCompare API (free, no auth)
- Keyword-based sentiment classification (bullish/bearish/neutral)
- Symbol extraction from headlines
- Deduplication via seen URLs

📚 Learner (trading memory):
- User profile analysis (win rate, preferred side, risk tolerance)
- Trading lessons storage (win/loss patterns, strategy notes)
- AI prediction tracking (log predictions → resolve with actual P/L)
- Prediction accuracy metrics per model

NOFXi is no longer a passive chatbot. It watches, thinks, learns, and acts.
2026-03-25 01:05:54 +08:00
shinchan-zhai
7cbdb4e6e0 fix(nofxi): prevent IME composition enter from sending message 2026-03-25 01:05:54 +08:00
shinchan-zhai
4996db81d4 feat(nofxi): full i18n bilingual support (zh/en)
Agent i18n:
- All command responses bilingual (help, status, positions, balance, trades, analysis, settings, errors)
- Language auto-detected from web UI lang toggle
- Stored per-user in SQLite preferences
- AI chat system prompt switches to Chinese/English based on user lang
- Trade confirmation prompts bilingual

Web UI:
- Sends lang parameter with every API request
- Agent extracts [lang:xx] prefix and persists preference

i18n message catalog: nofxi/internal/agent/i18n.go
2026-03-25 01:05:54 +08:00
shinchan-zhai
7cd6a6f7b3 feat(nofxi): i18n bilingual UI + professional trading terminal redesign
i18n:
- Full Chinese/English support (localStorage persisted)
- Toggle button in header (EN ↔ 中文)
- All UI elements translated: tabs, sidebar, hints, welcome message

UI improvements:
- Compact header (48px), tighter spacing throughout
- BTC/USDT info ticker bar (price, 24h vol, high/low, trades)
- Auto-refreshing market data (15s)
- Refined color scheme with lower contrast grid
- Smaller fonts, denser layout (pro terminal feel)
- Chart: added 5m timeframe, removed less common pairs

Backend:
- /api/klines endpoint (Binance futures, no auth)
- /api/ticker endpoint (24h stats)
2026-03-25 01:05:54 +08:00
shinchan-zhai
945c054663 feat(nofxi): K-line chart with TradingView lightweight-charts
- Candlestick chart + volume histogram
- 8 trading pairs: BTC/ETH/SOL/BNB/XRP/DOGE/ADA/AVAX
- 5 timeframes: 15m/1H/4H/1D/1W
- Real-time price & 24h change display
- Auto-refresh every 30s
- Backend: /api/klines + /api/ticker (Binance futures API)
- Dark trading terminal theme, responsive resize
- Tab switching: Chat ↔ Chart
2026-03-25 01:05:54 +08:00
shinchan-zhai
c82fa93d6d feat(nofxi): redesign Web UI - professional trading platform style
- Dark trading terminal aesthetic (deep black + green/purple accents)
- Gradient logo, nav pills, status badge
- Sidebar: Quick Trade grid, Portfolio list, Monitor, Strategy
- Chat: card bubbles with avatars, timestamps, fade-in animation
- Typing indicator with bouncing dots
- Glowing input focus, keyboard hints
- Inter + JetBrains Mono fonts
- Mobile responsive
2026-03-25 01:05:54 +08:00
shinchan-zhai
753989ee99 chore: gitignore secrets, db, binary 2026-03-25 01:05:54 +08:00
shinchan-zhai
832f4be4e8 feat(nofxi): Phase 3 complete - Exchange factory, Web UI, Strategy runner, Docker
Exchange Factory:
- CreateTrader() supports Binance/OKX/Bybit/Bitget/KuCoin/Gate
- Auto-registers traders from config on startup
- Direct import of nofx/trader packages (merged into main module)

Web UI:
- Dark theme chat interface at :8900
- Quick action sidebar (analyze, watch, positions, balance)
- Real-time health check indicator
- Mobile responsive

Strategy Runner:
- /strategy start BTC 1h - AI auto-analyzes on interval
- /strategy stop <id> - stop strategy
- /strategy list - view active strategies
- Notifications pushed to Telegram on signals
- Configurable intervals: 15m/30m/1h/4h

Docker:
- Multi-stage Dockerfile (alpine, ~20MB)
- docker-compose.yml with volume persistence

Bug fixes:
- Fixed panic on empty exchanges config
- Fixed thinking mode response parsing (qwen3 content:null)
- Added request timeout (55s) in Telegram handler
- Better error logging
2026-03-25 01:05:54 +08:00
shinchan-zhai
6e19ada7fc feat: init nofxi - AI Trading Agent module
NOFXi — Your AI Trading Agent, built on NOFX.

Architecture:
- Agent Core: intent routing, conversation memory, trade confirmation
- Memory: SQLite (trades, conversations, preferences, strategies)
- Thinking: LLM client (OpenAI/claw402/DeepSeek compatible)
- Execution: Bridge to NOFX trader engine (9 exchanges)
- Perception: Market monitor, price alerts, anomaly detection
- Interaction: Telegram bot + REST API + OpenAI-compatible endpoint

Features:
- Natural language trading (中英文)
- /buy /sell /analyze /watch /alert /positions /balance
- Daily P/L reports, portfolio risk checks
- Trade confirmation flow (safety first)
- Price polling and alert notifications
2026-03-25 01:05:54 +08:00
Hansen1018
9b14c5c84d feat: update default MiniMax model to M2.7 (#1428) 2026-03-24 08:37:00 +08:00
tinkle-community
966995fb88 refactor: remove BlockRun provider, retain Claw402 as sole x402 payment provider
Remove all BlockRun (Base + Solana wallet) references from codebase:
- Delete blockrun_base.go, blockrun_sol.go, wallet setup docs, icon
- Move shared EIP-712 signing code to x402.go for Claw402 reuse
- Clean up provider constants, model lists, UI components, translations
- Update all README files (EN + 6 i18n) and getting-started docs
2026-03-24 01:44:54 +08:00
tinkle-community
bbf96fe4b4 Merge remote-tracking branch 'origin/main' into dev 2026-03-22 18:42:09 +08:00
shinchan-zhai
4e4b4ceed7 feat: safe mode — auto-protect positions when AI fails 3+ times
- Track consecutive AI failures
- After 3 failures: activate safe mode (no new positions, close/hold only)
- Auto-deactivate when AI recovers
- Keep loop running in safe mode (retry each cycle)
- Log clearly: 🛡️ SAFE MODE ACTIVATED/DEACTIVATED
2026-03-21 19:59:00 +08:00
shinchan-zhai
fd77f2df3e feat: AI cost tracking, pre-launch balance check, low balance alerts
- store/ai_charge.go: local AI cost tracking per call (SQLite)
- wallet/usdc.go: shared USDC balance query (Base chain RPC)
- Pre-launch: estimate daily cost + runway days
- Low balance: warn <$1, error at $0 (every 10 cycles)
- API: GET /api/ai-costs for cost history
- Frontend: model cards show price per call
- Frontend: wallet create + QR deposit + balance display
2026-03-21 12:31:20 +08:00
shinchan-zhai
79a513470b feat: real-time wallet validation — key check, address display, USDC balance, claw402 health
- POST /api/wallet/validate: validate key, derive address, query Base USDC, check claw402
- Claw402ConfigForm: debounced validation, balance display, connection test button
- i18n: 11 new keys (en/zh/id)
- Private key never logged or stored
2026-03-21 01:08:29 +08:00
shinchan-zhai
53ac52562f fix: replace toast.promise with await to ensure state refresh after API calls
sonner's toast.promise() returns a toast ID (not a Promise), so
await resolves immediately and subsequent data refresh fetches stale
data. Users had to manually reload to see changes.

Fixed across AITradersPage, SettingsPage, and TraderConfigModal.
2026-03-21 00:54:36 +08:00
shinchan-zhai
58236ba8b5 Merge branch 'dev' of https://github.com/NoFxAiOS/nofx into dev 2026-03-21 00:27:20 +08:00
shinchan-zhai
16ebe0a64c feat(mcp): add context length guard to prevent oversized requests
* feat: add X-Client-ID header for claw402 monitoring

* feat(mcp): add context length guard to prevent oversized requests

- Add MaxContext field to Config (default 0 = no limit)
- Add WithMaxContext() option for setting model context limits
- Add context_guard.go: token estimation + message truncation
- Integrate guard into both BuildMCPRequestBody and BuildRequestBodyFromRequest
- Support both map[string]string and map[string]any message formats
- Truncates oldest non-system messages when estimated tokens exceed limit
- Always preserves system messages and keeps at least 1 non-system message
- Logs warning when truncation occurs for debugging

Usage: mcp.NewDeepSeekClient(mcp.WithMaxContext(131072))
2026-03-18 11:10:22 +08:00
shinchan-zhai
2cdc3d0cd8 fix: set temperature=1 for kimi provider (k2.5 model restriction)
* feat: add X-Client-ID header for claw402 monitoring

* fix: set temperature=1 for kimi provider (k2.5 model restriction)
2026-03-18 11:10:20 +08:00
tinkle-community
d5fbe445e1 feat: add channel dimension to GA4 AI usage tracking
Distinguish claw402, blockrun, and native direct API calls in telemetry.
2026-03-16 15:19:49 +08:00
tinkle-community
b8bc91f7a0 docs: add x402 streaming payment architecture documentation 2026-03-16 13:53:27 +08:00
tinkle-community
0f06f9b2a2 feat: add streaming support for x402 payment flow to bypass Cloudflare timeout
- Extract ParseSSEStream as shared function from CallWithRequestStream
- Add DoX402RequestStream and X402CallStream for streaming x402 payments
- Switch Claw402Client.Call to use streaming (X402CallStream)
- TeeReader fallback: SSE parsing with JSON fallback for non-SSE responses
- Idle timeout watchdog (90s) protects against stalled streams
2026-03-16 12:41:30 +08:00
tinkle-community
780bb39a92 fix: strategy studio crash due to mismatched translation key oiTopDesc→oi_topDesc
CoinSourceEditor constructs keys as `${value}Desc` where value='oi_top',
expecting 'oi_topDesc' but the translation key was 'oiTopDesc' (camelCase).
This caused ts(undefined, lang) → "Cannot read properties of undefined".
2026-03-16 08:01:56 +08:00
tinkle-community
7203655ae7 fix: strategy studio black screen on create and remove stale benefit3 ref
- Add missing configResponse.ok check in handleCreateStrategy to prevent
  rendering with invalid config data when API fails
- Remove deleted benefit3 translation key reference from LoginRequiredOverlay
2026-03-16 07:55:47 +08:00
tinkle-community
21a15f98eb refactor: remove all backtest module code and references
Delete backtest/ engine (19 files), api/backtest.go, store/backtest.go,
web backtest components (7 files), API client, types, docs, screenshot.
Clean all backtest references from main.go, api/server.go, store/store.go,
App.tsx, HeaderBar.tsx, LandingPage.tsx, translations, README and docs.
2026-03-16 07:38:01 +08:00
shinchan-zhai
1a6b88d77f feat: add X-Client-ID header for claw402 monitoring (#1414) 2026-03-16 07:33:05 +08:00
shinchan-zhai
ff8a4300c6 feat: add X-Client-ID header for claw402 monitoring 2026-03-15 11:50:08 +08:00
tinkle-community
736d2d385d refactor: optimize codebase encoding 2026-03-12 16:14:56 +08:00
tinkle-community
2314ece9d1 fix: disable outer retry for x402 payment providers to prevent duplicate charges
The outer retry loop in client.go re-initiates the entire x402 payment
flow on each attempt, causing duplicate USDC charges. The inner x402
retry loop (5 attempts with re-signing) already handles all retryable
scenarios. Set MaxRetries=1 for Claw402, BlockRunBase, and BlockRunSol
to ensure only one payment per AI decision.
2026-03-12 14:29:42 +08:00
tinkle-community
b5061d1b8f fix: increase x402 payment timeout to 5min and add 402 re-sign logic
AI inference (especially DeepSeek) often exceeds the default 120s HTTP
timeout, causing the client to disconnect while the server completes
successfully — resulting in repeated payments on each retry.

Changes:
- Set X402Timeout = 5min for all x402 providers (Claw402, BlockRunBase, BlockRunSol)
- Handle 402 during payment retry by re-extracting Payment-Required
  header and re-signing instead of failing immediately
- Increase payment retry attempts from 3 to 5 for unstable gateways
2026-03-12 14:06:28 +08:00
tinkle-community
fcda921d41 fix: add web/src/lib/api/ split files and fix .gitignore
The .gitignore had a Python-inherited `lib/` rule that blocked the
entire web/src/lib/api/ directory from being tracked. The original
api.ts was a file (not matched), but the split created a directory
inside lib/ which was ignored. Remove the `lib/` gitignore rule and
add the api module split files that were missing from the previous commit.
2026-03-12 13:38:32 +08:00
tinkle-community
cb31782be4 refactor: split large files and clean up project structure
- Rename experience/ to telemetry/ for clarity
- Split 15+ large Go files (800-2200 lines) into focused modules:
  kernel/engine.go, backtest/runner.go, market/data.go, store/position.go,
  api/handler_trader.go, trader/auto_trader_grid.go, and 9 exchange traders
- Split frontend monoliths: types.ts, api.ts, AITradersPage.tsx, BacktestPage.tsx
  into domain-specific modules with barrel re-exports
- Remove stale files: screenshots, .yml.old, pyproject.toml
- Remove unused scripts/ and cmd/ directories
- Remove broken/outdated test files (network-dependent, stale expectations)
2026-03-12 12:53:57 +08:00
tinkle-community
8e294a5eed refactor: restructure project directories for better modularity
- Delete llm/ dead code (3 files, zero references)
- Split mcp/ into sub-packages: mcp/provider/ (8 providers) and
  mcp/payment/ (4 payment clients) with registry pattern
- Export Client internal fields and ClientHooks interface for
  sub-package access
- Split api/server.go (3892 lines) into 8 domain-specific handler files
- Split trader/auto_trader.go (2296 lines) into 5 focused files
- Reorganize web/src/components/ flat files into auth/, charts/,
  trader/, common/, modals/, backtest/ subdirectories
- Update all consumer imports to use registry-based provider creation
2026-03-11 23:58:13 +08:00