Claude/yassir shariah finance agent cta mu#197
Open
goww7 wants to merge 19 commits intovirattt:mainfrom
Open
Conversation
- Document 5-phase agent architecture (Understand → Plan → Execute → Reflect → Answer) - Explain directory structure and module organization - Detail tech stack (Bun, LangChain.js, React/Ink, Zod) - Provide code conventions and TypeScript patterns - Include development workflows and common tasks - Add tool development guide and best practices - Document context management and caching system - Include troubleshooting guide and anti-patterns - Add API integration details and performance considerations
Introduces a new `get_shariah` tool that enables Dexter to answer Islamic
finance and Shariah compliance questions. The tool is conditionally registered
when `HALAL_TERMINAL_API_KEY` is present in the environment.
New files:
- src/tools/finance/shariah.ts — Halal Terminal API client + 6 individual tools:
screen_stock_shariah, screen_etf_shariah, compare_etf_shariah,
calculate_zakat, calculate_purification, get_dividends_shariah,
search_halal_database
- src/tools/finance/get-shariah.ts — NL-routing meta-tool (mirrors get-market-data
pattern) that maps natural language queries to the right sub-tool(s)
Updated files:
- src/tools/finance/index.ts — exports createGetShariah + GET_SHARIAH_DESCRIPTION
- src/tools/registry.ts — registers get_shariah when HALAL_TERMINAL_API_KEY set
- env.example — documents the new HALAL_TERMINAL_API_KEY variable
https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
After receiving the full OpenAPI spec, corrected all request/response shapes
and expanded the tool set to cover the actual endpoints.
Key fixes:
- calculateZakat: body now uses {symbol, market_value} not {symbol, shares, price}
- calculatePurification: body now uses {holdings:[{symbol, dividend_income}]}
targeting POST /api/purification/calculate
- screenStockShariah: POST /api/screen/{symbol} (no request body)
- screenEtfShariah: POST /api/etf/{symbol}/screen with force_refresh query param
- getDividendsShariah → getDividendPurification: GET /api/dividends/{symbol}/purification
New tools added:
- scanPortfolioShariah: POST /api/portfolio/scan (screen list of tickers at once)
- compareShariah: POST /api/compare (side-by-side stock comparison incl. quote)
- getIslamicNews: GET /api/news or /api/news/{symbol} (Islamic finance news)
Router prompt updated with correct tool selection logic, nisab context,
and portfolio vs single-stock routing guidance.
https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
When HALAL_TERMINAL_API_KEY is not set, the app shows a short setup wizard on startup before the main interface: 1. Confirm screen — "Set up Halal Terminal (free)? Yes/No" 2. Email input — enter email to generate a key 3. Generating — calls POST /api/keys/generate (no auth needed) 4. Done — key saved to .env, press any key to continue 5. Error — shows error with Enter to retry / Esc to skip The wizard is skipped automatically if the key is already present. Users can press Esc at any point to skip and proceed without the key. New file: src/controllers/halal-key-controller.ts https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
…ovider - Add src/tools/finance/halal-market.ts with Halal Terminal market data tools: get_stock_quote, get_stock_ohlc, get_stock_quotes_batch, get_trending_stocks, get_market_news - Rewrite get-market-data.ts to route exclusively through Halal Terminal tools - Update finance/index.ts exports - Remove FINANCIAL_DATASETS_API_KEY from env.example; add HALAL_TERMINAL_API_KEY comment - Update CLAUDE.md, AGENTS.md, README.md to reference only Halal Terminal https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
…tKeybindings Update keybinding IDs to use namespaced format required by pi-tui 0.62.0: - getEditorKeybindings() → getKeybindings() - 'selectCancel' → 'tui.select.cancel' - 'submit' → 'tui.input.submit' https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
Adds a full-screen key manager accessible via /keys: - Shows all LLM provider keys (OpenAI, Anthropic, Google, xAI, Moonshot, DeepSeek, OpenRouter) and data keys (Halal Terminal, Exa, Perplexity, Tavily, X/Twitter) - Each entry shows ✓ (configured) or ✗ (missing) status - Select any key to add or update it; value is masked during input - Saves immediately to .env and reloads env vars - Esc/Ctrl+C closes the manager at any step New files: - src/controllers/api-key-manager-controller.ts - createKeyManagerSelector in select-list.ts https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
Replace getKeybindings()/getEditorKeybindings() calls with direct key code checks so select-list.ts works on both pi-tui 0.52.x (Mac) and 0.62.x (server): - Escape: \u001b, Ctrl+C: \u0003 → cancel - Enter: \r or \n → submit https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
- Add ModelSelectionController.startKeySetupIfNeeded() — checks if current provider has a key and jumps straight to api_key_input if not - On startup: show LLM key prompt first, then Halal Terminal wizard after - After LLM key is saved, automatically start Halal wizard if needed https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
emitChange() fires the onChange callback which calls tui.requestRender() before tui.start() has initialized the terminal. This caused the TUI to render at an incorrect width (matching the HalalKeyController pattern where startIfNeeded() also doesn't call its onUpdate callback). https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
The masked display was '*'.repeat(keyLength) with no width limit. OpenAI keys are ~164 chars, exceeding the terminal width of 92. Clamp the displayed characters to (width - 2) to stay within bounds. https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
- Package name: dexter-ts → yassir, bin command: dexter → yassir - Runtime dir: .dexter/ → .yassir/ - Utility functions: dexterPath() → yassirPath(), getDexterDir() → getYassirDir() - Environment variables: DEXTER_* → YASSIR_* - User-facing strings: "Dexter" → "Yassir" across UI, prompts, docs - Updated README.md, CLAUDE.md, SOUL.md, AGENTS.md, WhatsApp README - Eval experiment names and LangSmith project name updated https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
- Replace cyan accent and blue info with emerald green variants - Pin success color to #10b981 for consistency - Update tagline from "assistant" to "agent" - Remove virattt Twitter badge from README - Update clone URL to goww7/dexter https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
LangChain's ChatPromptTemplate parses {…} in strings as template
variables, causing crashes when system prompts contain curly braces
(tool descriptions, JSON examples, etc.). Pass messages directly
instead, mirroring the existing Anthropic path.
https://claude.ai/code/session_017cf6DjixRqxFNbsMqkrMqe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.