@aiaiaichain/agent 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ # Commands Reference
2
+
3
+ ## CLI Commands
4
+
5
+ | Command | Description |
6
+ |---------|-------------|
7
+ | `aiaiaichain` | Start interactive TUI |
8
+ | `aiaiaichain setup` | First-time setup wizard |
9
+ | `aiaiaichain config` | Show/edit configuration |
10
+ | `aiaiaichain price` | Show $AIAIAI price |
11
+ | `aiaiaichain status` | Full status + wallets |
12
+ | `aiaiaichain wallet` | Agent wallet balances |
13
+ | `aiaiaichain deposit` | Deposit instructions |
14
+ | `aiaiaichain burn` | Burn instructions |
15
+ | `aiaiaichain actions` | Recent buy/burn actions |
16
+ | `aiaiaichain fees` | Fee tracker |
17
+ | `aiaiaichain keys` | Provider key management |
18
+ | `aiaiaichain gmgn help` | GMGN sub-commands |
19
+ | `aiaiaichain gmgn setup` | Configure GMGN key |
20
+ | `aiaiaichain gmgn status` | GMGN status |
21
+ | `aiaiaichain gmgn <cmd>` | Forward to gmgn-cli |
22
+ | `aiaiaichain update` | Check/install updates |
23
+ | `aiaiaichain --headless "q"` | Single-turn mode |
24
+ | `aiaiaichain --help` | Help |
25
+ | `aiaiaichain --version` | Version |
26
+ | `aiai-mcp` | MCP server |
27
+
28
+ ## TUI Slash Commands
29
+
30
+ | Command | Description |
31
+ |---------|-------------|
32
+ | `/help` | Show all commands |
33
+ | `/price` | $AIAIAI price |
34
+ | `/news` | Latest crypto news |
35
+ | `/models [q]` | List/search models |
36
+ | `/model [q]` | Switch AI model |
37
+ | `/cost` | Token usage cost |
38
+ | `/wallet` | Agent wallets |
39
+ | `/deposit` | Deposit instructions |
40
+ | `/burn` | Burn instructions |
41
+ | `/actions` | Recent actions |
42
+ | `/fees` | Fee tracker |
43
+ | `/keys` | Provider management |
44
+ | `/goals [add|done|list]` | Goal management |
45
+ | `/schedule` | Task scheduler |
46
+ | `/memory <q>` | Search memory |
47
+ | `/sessions` | List saved sessions |
48
+ | `/resume <n>` | Resume a session |
49
+ | `/clear` | Clear chat |
50
+ | `/exit` | Exit |
51
+
52
+ ### GMGN Commands
53
+
54
+ | Command | Description |
55
+ |---------|-------------|
56
+ | `/token info --chain <c> --address <a>` | Token info |
57
+ | `/token security --chain <c> --address <a>` | Security audit |
58
+ | `/token holders --chain <c> --address <a>` | Holder list |
59
+ | `/token traders --chain <c> --address <a>` | Trader list |
60
+ | `/track kol --chain <c>` | Top KOL buys |
61
+ | `/track smartmoney --chain <c>` | Smart money buys |
62
+ | `/track follow-wallet --chain <c>` | Followed wallet buys |
63
+ | `/market kline --chain <c> --address <a> --resolution <1h|4h|1d>` | Candlestick chart |
64
+ | `/market trending --chain <c> --interval <1h|6h|24h>` | Trending tokens |
65
+ | `/market trenches --chain <c> --type <new|near|completed>` | Launchpad trenches |
66
+ | `/market signal --chain <sol|bsc>` | Buy/sell signals |
67
+ | `/gmgn` / `/gmgnhelp` | GMGN help |
68
+ | `/gmgn status` | GMGN status |
69
+
70
+ ### Cross-Tool Commands
71
+
72
+ | Command | Description |
73
+ |---------|-------------|
74
+ | `/watch <address>` | Add token to watch list |
75
+ | `/unwatch <address>` | Remove from watch list |
76
+ | `/watchlist` | Show watched tokens |
77
+ | `/alert above <price>` | Set price alert (above) |
78
+ | `/alert below <price>` | Set price alert (below) |
79
+ | `/alerts` | List active alerts |
80
+ | `/compare <addr1> <addr2>` | Side-by-side token comparison |
81
+ | `/portfolio [address]` | Wallet portfolio analysis |
82
+
83
+ ## TUI Keyboard
84
+
85
+ | Key | Action |
86
+ |-----|--------|
87
+ | `Ctrl+C` | Exit |
88
+ | `Escape` | Abort streaming response |
89
+ | `↑` / `↓` | Command history navigation |
90
+ | `Tab` | Auto-complete commands |
91
+ | `Enter` | Submit message / command |
92
+ | `Shift+Enter` | New line (multi-line input) |
93
+ | `/` | Command prefix |
package/docs/CORE.md ADDED
@@ -0,0 +1,67 @@
1
+ # Core Modules
2
+
3
+ ## AgentDir (`src/core/AgentDir.ts`)
4
+ Manages `~/.aiaiai/` home directory. Creates subdirectories on first run.
5
+
6
+ ## ChainConfig (`src/core/ChainConfig.ts`)
7
+ Single source of truth for chain configuration. Solana is primary. EVM chains available but disabled by default.
8
+
9
+ ## EnvLoader (`src/core/EnvLoader.ts`)
10
+ Loads/writes environment variables from `~/.aiaiai/.env`. Supports `set()` for persistent key storage.
11
+
12
+ ## ModelRegistry (`src/models/ModelRegistry.ts`)
13
+ Discovers models from any configured provider. Tiered pools: orchestrator → analyst → worker → free.
14
+
15
+ ## CostTracker (`src/models/CostTracker.ts`)
16
+ Tracks token usage and cost across sessions. Persists to `~/.aiaiai/lifetime-cost.json`.
17
+
18
+ ## AgentRunner (`src/runner/AgentRunner.ts`)
19
+ Main agent loop. Handles tool calling, streaming, message processing. Supports approval gates.
20
+
21
+ ## ModelClient (`src/runner/ModelClient.ts`)
22
+ LLM API client for OpenRouter. Handles streaming SSE responses.
23
+
24
+ ## ToolDispatcher (`src/runner/ToolDispatcher.ts`)
25
+ Routes tool calls to registered handlers. Returns errors for unknown tools.
26
+
27
+ ## SwarmRouter (`src/runner/SwarmRouter.ts`)
28
+ Parallel sub-agent orchestration. Routes tasks to appropriate model tiers.
29
+
30
+ ## SessionManager (`src/session/SessionManager.ts`)
31
+ Manages conversation state. Context pressure tracking (green/yellow/red/critical).
32
+
33
+ ## MemoryStore (`src/session/MemoryStore.ts`)
34
+ Long-term conversation memory. JSONL per session. Searchable.
35
+
36
+ ## GoalManager (`src/session/GoalManager.ts`)
37
+ Persistent cross-session goals. Add, complete, note.
38
+
39
+ ## ContextStore (`src/session/ContextStore.ts`)
40
+ Task context folders for multi-step operations.
41
+
42
+ ## AgentScheduler (`src/scheduler/AgentScheduler.ts`)
43
+ Cron and price-triggered scheduled tasks. Persisted to `~/.aiaiai/memory/schedule.json`.
44
+
45
+ ## PriceFeed (`src/tools/PriceFeed.ts`)
46
+ DexScreener price data for any Solana token. 30s cache.
47
+
48
+ ## NewsSentiment (`src/tools/NewsSentiment.ts`)
49
+ Crypto news with lexicon-based sentiment scoring. CryptoPanic API with fallback.
50
+
51
+ ## TechnicalAnalysis (`src/tools/TechnicalAnalysis.ts`)
52
+ RSI, MACD, Bollinger Bands, EMA, SMA, ATR. Works with OHLCV candle data.
53
+
54
+ ## MarketSentiment (`src/tools/MarketSentiment.ts`)
55
+ Fear & Greed, Binance funding rates, BTC mempool, DeFi TVL, Solana stats.
56
+
57
+ ## GmgnIntegration (`src/tools/GmgnIntegration.ts`)
58
+ GMGN token research + smart money tracking + market data. Auto-manages `GMGN_API_KEY`.
59
+
60
+ ## AgentWallet (`src/wallet/AgentWallet.ts`)
61
+ Reads cold + action + deposit wallet balances via public Solana RPC.
62
+
63
+ ## ActionFeed (`src/wallet/ActionFeed.ts`)
64
+ Reads agent action wallet transactions. Classifies as buy/burn. Tracks fees.
65
+
66
+ ## ProviderRegistry (`src/providers/ProviderRegistry.ts`)
67
+ All 29 AI model providers with env vars, endpoints, docs URLs.
package/docs/GMGN.md ADDED
@@ -0,0 +1,116 @@
1
+ # GMGN Integration
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ # CLI
7
+ aiaiai gmgn setup
8
+
9
+ # TUI
10
+ /gmgn setup
11
+ ```
12
+
13
+ This saves `GMGN_API_KEY` to `~/.config/gmgn/.env`.
14
+
15
+ ## Token Research
16
+
17
+ ### Price + Market Cap
18
+ ```bash
19
+ aiaiai gmgn token info --chain sol --address <address>
20
+ ```
21
+
22
+ ### Security Check
23
+ ```bash
24
+ aiaiai gmgn token security --chain sol --address <address>
25
+ # Shows: honeypot, taxes, rug ratio, holder concentration
26
+ ```
27
+
28
+ ### Holders
29
+ ```bash
30
+ aiaiai gmgn token holders --chain sol --address <address> --limit 20
31
+ ```
32
+
33
+ ### Traders
34
+ ```bash
35
+ aiaiai gmgn token traders --chain sol --address <address> --limit 20
36
+ # --tag smart_degen → filter by smart money
37
+ # --tag renowned → filter by KOLs
38
+ ```
39
+
40
+ ## Market Data
41
+
42
+ ### Kline / Candlestick
43
+ ```bash
44
+ aiaiai gmgn market kline --chain sol --address <address> --resolution 1h
45
+ # --from <unix_ts> --to <unix_ts>
46
+ ```
47
+
48
+ ### Trending Tokens
49
+ ```bash
50
+ aiaiai gmgn market trending --chain sol --interval 1h
51
+ # --order-by volume --limit 20
52
+ # --platform Pump.fun --platform letsbonk
53
+ # --filter renounced --filter frozen
54
+ ```
55
+
56
+ ### Trenches (New Tokens)
57
+ ```bash
58
+ aiaiai gmgn market trenches --chain sol --type new_creation
59
+ aiaiai gmgn market trenches --chain sol --type near_completion
60
+ aiaiai gmgn market trenches --chain sol --type completed
61
+ # --filter-preset safe
62
+ # --filter-preset smart-money
63
+ # --min-smart-degen-count 1
64
+ ```
65
+
66
+ ### Signals
67
+ ```bash
68
+ aiaiai gmgn market signal --chain sol
69
+ # --signal-type 12 → smart money buys
70
+ # --signal-type 6 → price spikes
71
+ # --mc-min 50000
72
+ ```
73
+
74
+ ## Smart Money Tracking
75
+
76
+ ### KOL Activity
77
+ ```bash
78
+ aiaiai gmgn track kol --chain sol --limit 20
79
+ # --side buy
80
+ ```
81
+
82
+ ### Smart Money Activity
83
+ ```bash
84
+ aiaiai gmgn track smartmoney --chain sol --limit 20
85
+ # --side sell
86
+ ```
87
+
88
+ ### Followed Wallet Trades
89
+ ```bash
90
+ aiaiai gmgn track follow-wallet --chain sol
91
+ # --wallet <address>
92
+ # --side buy --min-amount-usd 100
93
+ ```
94
+
95
+ ### Followed Tokens
96
+ ```bash
97
+ aiaiai gmgn track follow-tokens --chain sol --wallet <address>
98
+ ```
99
+
100
+ ## Agent Tool
101
+
102
+ The agent can use GMGN via the `gmgn` tool. Examples:
103
+
104
+ ```
105
+ "Research this token" → gmgn tool with subcommand: "token info"
106
+ "Show me trending" → gmgn tool with subcommand: "market trending"
107
+ "What are KOLs buying?" → gmgn tool with subcommand: "track kol"
108
+ ```
109
+
110
+ ## Rate Limits
111
+
112
+ GMGN uses a leaky-bucket limiter (20 requests burst). The agent handles 429s gracefully.
113
+
114
+ ## IPv6 Issue
115
+
116
+ GMGN only works over IPv4. If you get 401/403, disable IPv6 on your network interface.
@@ -0,0 +1,71 @@
1
+ # Provider Registry
2
+
3
+ ## 29 AI Model Providers
4
+
5
+ | # | Provider | Env Var | Has Model API |
6
+ |---|----------|---------|---------------|
7
+ | 1 | OpenRouter | `OPENROUTER_API_KEY` | ✅ |
8
+ | 2 | Anthropic | `ANTHROPIC_API_KEY` | ✅ |
9
+ | 3 | OpenAI | `OPENAI_API_KEY` | ✅ |
10
+ | 4 | Google Gemini | `GOOGLE_API_KEY` | ✅ |
11
+ | 5 | DeepSeek | `DEEPSEEK_API_KEY` | ✅ |
12
+ | 6 | Groq | `GROQ_API_KEY` | ✅ |
13
+ | 7 | Mistral | `MISTRAL_API_KEY` | ✅ |
14
+ | 8 | Together AI | `TOGETHER_API_KEY` | ✅ |
15
+ | 9 | Fireworks | `FIREWORKS_API_KEY` | ✅ |
16
+ | 10 | Cerebras | `CEREBRAS_API_KEY` | ✅ |
17
+ | 11 | Amazon Bedrock | `AWS_ACCESS_KEY_ID` | ❌ |
18
+ | 12 | Google Vertex AI | `GOOGLE_APPLICATION_CREDENTIALS` | ❌ |
19
+ | 13 | Azure OpenAI | `AZURE_OPENAI_API_KEY` | ❌ |
20
+ | 14 | Hugging Face | `HUGGINGFACE_API_KEY` | ✅ |
21
+ | 15 | NVIDIA NIM | `NVIDIA_NIM_API_KEY` | ✅ |
22
+ | 16 | xAI | `XAI_API_KEY` | ✅ |
23
+ | 17 | Moonshot AI | `MOONSHOT_API_KEY` | ✅ |
24
+ | 18 | Moonshot AI China | `MOONSHOT_CHINA_API_KEY` | ✅ |
25
+ | 19 | MiniMax | `MINIMAX_API_KEY` | ✅ |
26
+ | 20 | MiniMax China | `MINIMAX_CHINA_API_KEY` | ✅ |
27
+ | 21 | Kimi For Coding | `KIMI_API_KEY` | ✅ |
28
+ | 22 | Ant Ling | `ANTLING_API_KEY` | ❌ |
29
+ | 23 | Cloudflare AI Gateway | `CF_API_KEY` | ❌ |
30
+ | 24 | Cloudflare Workers AI | `CF_API_KEY` | ❌ |
31
+ | 25 | Vercel AI Gateway | `VERCEL_API_KEY` | ❌ |
32
+ | 26 | OpenCode Go | `OPENCODE_API_KEY` | ❌ |
33
+ | 27 | OpenCode Zen | `OPENCODE_ZEN_API_KEY` | ❌ |
34
+ | 28 | Xiaomi MiMo | `XIAOMI_API_KEY` | ❌ |
35
+ | 29 | Xiaomi MiMo Token Plan | `XIAOMI_TOKEN_API_KEY` | ❌ |
36
+
37
+ ## Adding Keys
38
+
39
+ ### CLI
40
+ ```bash
41
+ aiaiai keys
42
+ # Select a number, paste your key
43
+ ```
44
+
45
+ ### TUI
46
+ ```
47
+ /keys
48
+ # Select a number, paste your key
49
+ ```
50
+
51
+ ### Direct
52
+ ```bash
53
+ # Edit ~/.aiaiai/.env
54
+ OPENROUTER_API_KEY=sk-or-...
55
+ ANTHROPIC_API_KEY=sk-...
56
+ ```
57
+
58
+ ## Model Tiers
59
+
60
+ Models are auto-classified into 4 tiers:
61
+
62
+ | Tier | Description | Example |
63
+ |------|-------------|---------|
64
+ | ⭐ Orchestrator | Best reasoning, highest cost | GPT-4o, Claude 3.5 Sonnet |
65
+ | 🔬 Analyst | Mid-range capable | GPT-4o-mini, Gemini 2.0 Flash |
66
+ | ⚡ Worker | Fast, cheap | Llama 3.1 8B, Mistral 7B |
67
+ | 🆓 Free | Free tier models | Various |
68
+
69
+ ## Auto-Fetch Models
70
+
71
+ When you add a provider key, the agent automatically fetches available models from that provider's API. Models appear in `/models` and the model selector (`/model`).
package/docs/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # AIAIAI Chain Agent
2
+
3
+ ## What is AIAIAI?
4
+
5
+ AIAIAI Chain Agent is a Solana-native AI agent that runs entirely in your terminal. It buys and burns `$AIAIAI` tokens, tracks on-chain activity, researches tokens via GMGN, and manages 29 AI model providers — all through a beautiful Ink TUI.
6
+
7
+ **Ticker:** `$AIAIAI`
8
+ **Contract:** `AVPJS61gZmWKtaEpb7qYPKo8Fk2xQUsayYQxPiPMpump`
9
+ **Chain:** Solana (primary)
10
+ **License:** MIT
11
+
12
+ **Links:** [X / Twitter](https://x.com/aiaiaisol) · [aiaiaichain.xyz](https://aiaiaichain.xyz)
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install -g @aiaiaichain/agent
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ```bash
23
+ # 1. Configure (requires OpenRouter API key)
24
+ aiaiaichain setup
25
+
26
+ # 2. Start the agent
27
+ aiaiaichain
28
+
29
+ # 3. Or check $AIAIAI price directly
30
+ aiaiaichain price
31
+ ```
32
+
33
+ ## Architecture
34
+
35
+ ```
36
+ Your machine
37
+ ├── aiaiaichain (CLI)
38
+ │ ├── Ink TUI ← streaming terminal UI with sidebar
39
+ │ ├── AgentRunner ← model loop + tool dispatcher
40
+ │ ├── SwarmRouter ← parallel sub-agent orchestration
41
+ │ ├── PriceFeed ← DexScreener price data
42
+ │ ├── NewsFeed ← crypto news + sentiment
43
+ │ ├── TechnicalAnalysis ← RSI, MACD, Bollinger, ATR
44
+ │ ├── MarketSentiment ← Fear & Greed, funding, TVL
45
+ │ ├── AgentWallet ← cold + action + deposit wallets
46
+ │ ├── ActionFeed ← buy/burn tracking
47
+ │ ├── GoalManager ← persistent goals
48
+ │ ├── AgentScheduler ← cron/price-triggered tasks
49
+ │ ├── ModelRegistry ← 29 AI providers, tiered pools
50
+ │ ├── GMGN Integration ← token research + smart money tracking
51
+ │ └── MCPServer ← Model Context Protocol
52
+
53
+ ├── ~/.aiaiai/
54
+ │ ├── .env ← API keys
55
+ │ ├── config/ ← settings
56
+ │ ├── memory/ ← long-term memory
57
+ │ ├── checkpoints/ ← agent state
58
+ │ └── sessions/ ← task contexts
59
+
60
+ ├── ~/.config/gmgn/
61
+ │ └── .env ← GMGN_API_KEY
62
+
63
+ └── Outbound only (no inbound):
64
+ ├── openrouter.ai ← AI models
65
+ ├── api.dexscreener.com ← prices
66
+ ├── api.binance.com ← OHLCV
67
+ ├── api.alternative.me ← Fear & Greed
68
+ ├── api.llama.fi ← DeFi TVL
69
+ ├── mempool.space ← BTC mempool
70
+ ├── cryptopanic.com ← news
71
+ └── gmgn.ai ← token research
72
+ ```
73
+
74
+ ## Wallets
75
+
76
+ | Role | Address | Purpose |
77
+ |------|---------|---------|
78
+ | Cold | `A11iZoqEt6hU7HyggqC67ee4AtYmaJjwKCvJLerJRV2J` | Treasury |
79
+ | Action | `BygDYM1ZXLQNC1HXLhnd1rHZ7E5XjioqT3vPjJFfjnU2` | Buys + Burns |
80
+ | Deposit | `FBMDYpG9WXKy4SgxuATQdB2sCyzHsJWPrEr45z3TgL2e` | User deposits (SOL/USDC) |
81
+ | Signer | `GmFrDZT2cdrqykgTikVdXbe8EtCgzUDM9VsDhQnwsUsG` | Burn authority |
82
+
83
+ ## Outbound Connections
84
+
85
+ | Service | Purpose | Required Key |
86
+ |---------|---------|-------------|
87
+ | OpenRouter | AI model access | `OPENROUTER_API_KEY` |
88
+ | DexScreener | Token prices | None (public) |
89
+ | Binance API | OHLCV candles | None (public) |
90
+ | Alternative.me | Fear & Greed | None (public) |
91
+ | DeFiLlama | TVL data | None (public) |
92
+ | Mempool.space | BTC mempool | None (public) |
93
+ | CryptoPanic | Crypto news | None (public) |
94
+ | GMGN | Token research + tracking | `GMGN_API_KEY` |
95
+
96
+ ## Inbound Connections
97
+
98
+ **None.** The agent is 100% outbound. No ports are opened, no servers listen, no inbound connections are accepted. All data is pulled via HTTP GET/POST requests.
99
+
100
+ ## Security
101
+
102
+ - All API keys stored in `~/.aiaiai/.env` (chmod 600)
103
+ - GMGN key stored in `~/.config/gmgn/.env` (chmod 600)
104
+ - No keys leave your machine
105
+ - No inbound ports
106
+ - All outbound connections use HTTPS
package/docs/TOOLS.md ADDED
@@ -0,0 +1,81 @@
1
+ # Tools Reference
2
+
3
+ ## Price & Market
4
+ | Tool | Description |
5
+ |------|-------------|
6
+ | `get_aiaiai_price` | $AIAIAI price, liquidity, MCap, volume (DexScreener) |
7
+ | `get_token_price` | Any Solana token price data (DexScreener) |
8
+ | `get_news` | Crypto news with sentiment scoring |
9
+ | `get_candles` | OHLCV candles from Binance + full TA analysis |
10
+ | `analyze_ta` | RSI, MACD, Bollinger, ATR on price array |
11
+
12
+ ## Market Sentiment
13
+ | Tool | Description |
14
+ |------|-------------|
15
+ | `get_fear_greed` | Crypto Fear & Greed Index (7-day) |
16
+ | `get_funding_rates` | Binance perpetual funding rates |
17
+ | `get_btc_mempool` | BTC mempool stats + fees |
18
+ | `get_defi_tvl` | DeFiLlama TVL by chain |
19
+ | `get_solana_stats` | Solana epoch, slot, SOL price |
20
+
21
+ ## Wallet & Actions
22
+ | Tool | Description |
23
+ |------|-------------|
24
+ | `get_agent_balance` | Cold + action wallet balances |
25
+ | `get_deposit_balance` | Deposit wallet + instructions |
26
+ | `get_actions` | Recent buy/burn actions |
27
+ | `get_fees` | Accumulated fees (0.5% per action) |
28
+
29
+ ## AI Models
30
+ | Tool | Description |
31
+ |------|-------------|
32
+ | `list_models` | Search/filter models by provider/tier |
33
+ | `pick_model` | Find cheapest model in a tier |
34
+ | `model_summary` | Provider and tier breakdown |
35
+ | `cost_report` | Session/lifetime token usage |
36
+
37
+ ## Context & Goals
38
+ | Tool | Description |
39
+ |------|-------------|
40
+ | `set_goal` | Set persistent goal |
41
+ | `complete_goal` | Mark goal done |
42
+ | `list_goals` | List all goals |
43
+ | `add_goal_note` | Progress note |
44
+ | `set_goal` | Set goal |
45
+
46
+ ## Tasks & Schedule
47
+ | Tool | Description |
48
+ |------|-------------|
49
+ | `schedule_task` | Schedule recurring task |
50
+ | `list_schedule` | List scheduled tasks |
51
+ | `remove_schedule` | Remove task |
52
+ | `read_task_context` | Read saved task context |
53
+ | `list_tasks` | List task contexts |
54
+
55
+ ## GMGN Token Research
56
+ | Tool | Description |
57
+ |------|-------------|
58
+ | `gmgn` | Full GMGN access (token info, security, holders, traders, KOL, smart money, kline, trending, trenches, signals) |
59
+
60
+ ## Built-in Commands
61
+ | Command | Description |
62
+ |---------|-------------|
63
+ | `/help` | Show all commands |
64
+ | `/price` | $AIAIAI price |
65
+ | `/news` | Latest news |
66
+ | `/models` | List models |
67
+ | `/model` | Switch model |
68
+ | `/cost` | Token usage |
69
+ | `/wallet` | Agent wallets |
70
+ | `/deposit` | Deposit instructions |
71
+ | `/burn` | Burn instructions |
72
+ | `/actions` | Recent actions |
73
+ | `/fees` | Fee tracker |
74
+ | `/keys` | Provider key management |
75
+ | `/gmgn` | GMGN token research |
76
+ | `/update` | Check for updates |
77
+ | `/goals` | Goal management |
78
+ | `/schedule` | Task scheduler |
79
+ | `/memory` | Search memory |
80
+ | `/clear` | Clear chat |
81
+ | `/exit` | Exit |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiaiaichain/agent",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "AIAIAI Chain Agent — Solana-native AI agent for decentralized AI governance. Ticker: $AIAIAI",
5
5
  "author": "AIAIAI Foundation",
6
6
  "license": "MIT",
@@ -28,7 +28,8 @@
28
28
  "start": "node dist/cli.js",
29
29
  "type-check": "tsc --noEmit --project tsconfig.json",
30
30
  "test": "echo \"no tests yet\" && exit 0",
31
- "prepublishOnly": "npm run build"
31
+ "prepublishOnly": "npm run build",
32
+ "postinstall": "node scripts/postinstall.js"
32
33
  },
33
34
  "dependencies": {
34
35
  "@sinclair/typebox": "^0.32.0",
@@ -41,7 +42,7 @@
41
42
  "devDependencies": {
42
43
  "@types/node": "^20.19.41",
43
44
  "@types/react": "^18.3.29",
44
- "typescript": "^5.9.3"
45
+ "typescript": "^5.10.0"
45
46
  },
46
47
  "engines": {
47
48
  "node": ">=20.0.0"
@@ -58,7 +59,9 @@
58
59
  "files": [
59
60
  "dist",
60
61
  "bin",
62
+ "scripts",
61
63
  "README.md",
64
+ "docs",
62
65
  "!dist/**/*.map"
63
66
  ]
64
67
  }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * postinstall.js — creates bin symlinks if npm didn't do it.
6
+ * This handles the case where `npm install -g` doesn't create
7
+ * symlinks for scoped packages.
8
+ */
9
+
10
+ import { existsSync, symlinkSync, mkdirSync, readdirSync } from 'node:fs';
11
+ import { join, dirname } from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ const PKG_ROOT = join(__dirname, '..');
16
+ const BIN_DIR = join(PKG_ROOT, 'bin');
17
+
18
+ // Only run if we're in a node_modules install (not dev)
19
+ if (!PKG_ROOT.includes('node_modules')) process.exit(0);
20
+
21
+ const NM_BIN = join(PKG_ROOT, 'node_modules', '.bin');
22
+
23
+ try {
24
+ mkdirSync(NM_BIN, { recursive: true });
25
+
26
+ const bins = readdirSync(BIN_DIR).filter(f => !f.endsWith('.map'));
27
+ for (const bin of bins) {
28
+ const src = join(BIN_DIR, bin);
29
+ const dst = join(NM_BIN, bin);
30
+ try { symlinkSync(src, dst); } catch { /* already exists */ }
31
+ }
32
+ } catch {
33
+ // Non-fatal — npm might have already created the links
34
+ }