@aiaiaichain/agent 0.1.7 → 0.1.8

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.
@@ -31,7 +31,6 @@ const userDelta = currentUsage.user - lastCpuUsage.user;
31
31
  const systemDelta = currentUsage.system - lastCpuUsage.system;
32
32
  lastCpuUsage = currentUsage;
33
33
 
34
-
35
34
  const totalDelta = userDelta + systemDelta;
36
35
 
37
36
  const pct = Math.min(100, Math.round((totalDelta / 10_000_000) * 100));
@@ -48,7 +47,6 @@ return Math.round((used / totalmem()) * 100);
48
47
  }
49
48
  getNetStats() {
50
49
 
51
-
52
50
  return { netUp: 'N/A', netDown: 'N/A' };
53
51
  }
54
52
  formatBytes(bytes) {
package/dist/index.d.ts CHANGED
@@ -1,60 +1,4 @@
1
- /**
2
- * aiaiaichain — public API
3
- *
4
- * Extension files import from here:
5
- * import { Type } from "aiaiaichain"
6
- * import type { ExtensionAPI } from "aiaiaichain"
7
- */
8
- export { Type, type Static } from "@sinclair/typebox";
9
- export type { ExtensionAPI, CommandDef, CommandContext, UIContext, ThemeContext, ToolDef, ToolContent, ToolResult, SkillDef, SessionEvent, SessionContext, } from "./api/ExtensionAPI.js";
10
- export { text } from "./api/ExtensionAPI.js";
11
- export { Registry } from "./api/Registry.js";
12
- export { AgentRunner } from "./runner/AgentRunner.js";
13
- export { ModelClient, resolveModelConfig } from "./runner/ModelClient.js";
14
- export { ToolDispatcher } from "./runner/ToolDispatcher.js";
15
- export { SwarmRouter } from "./runner/SwarmRouter.js";
16
- export { loadExtension } from "./loader.js";
17
- export { makeTheme, T, AIAIAI_COLORS } from "./tui/theme.js";
18
- export { ModelRegistry, modelRegistry, classifyModel } from "./models/ModelRegistry.js";
19
- export { CostTracker } from "./models/CostTracker.js";
20
- export type { ModelInfo, TieredModel, ModelTier } from "./models/ModelRegistry.js";
21
- export { fullAnalysis, rsi, macd, ema, sma, bollingerBands, atr, getCandlesTool, getCandlesParams } from "./tools/TechnicalAnalysis.js";
22
- export { PriceFeed, priceFeed } from "./tools/PriceFeed.js";
23
- export { NewsFeed, newsFeed, getNewsTool, scoreSentiment } from "./tools/NewsSentiment.js";
24
- export { getFearGreedTool, getFundingRatesTool, getBtcMempoolTool, getDefiTvlTool, getSolanaStatsTool, } from "./tools/MarketSentiment.js";
25
- export type { OHLCV, AnalysisResult } from "./tools/TechnicalAnalysis.js";
26
- export type { PriceResult, DexScreenerPair as DexScreenerData } from "./tools/PriceFeed.js";
27
- export type { NewsItem, SentimentReport } from "./tools/NewsSentiment.js";
28
- export { SessionManager } from "./session/SessionManager.js";
29
- export { MemoryStore, memoryStore } from "./session/MemoryStore.js";
30
- export { GoalManager, goalManager } from "./session/GoalManager.js";
31
- export { ContextStore, contextStore } from "./session/ContextStore.js";
32
- export type { Goal } from "./session/GoalManager.js";
33
- export type { ContextPressure } from "./session/SessionManager.js";
34
- export { AgentScheduler, agentScheduler } from "./scheduler/AgentScheduler.js";
35
- export type { ScheduledTask } from "./scheduler/AgentScheduler.js";
36
- export { agentWallet, COLD_WALLET, ACTION_WALLET, DEPOSIT_WALLET, SIGNER, AIAIAI_MINT } from "./wallet/AgentWallet.js";
37
- export { actionFeed } from "./wallet/ActionFeed.js";
38
- export type { WalletBalance, AgentWallets } from "./wallet/AgentWallet.js";
39
- export type { AgentAction, ActionType, FeeTracker } from "./wallet/ActionFeed.js";
40
- export { gmgnTool, gmgnMarketTool, gmgnHelp, gmgnStatus, hasGmgnApiKey, saveGmgnApiKey, GMGN_SUBCOMMANDS } from "./tools/GmgnIntegration.js";
41
- export { watchTokenTool, removeWatchTool, listWatchTool, addAlertTool, checkAlertsTool, compareTokensTool, portfolioTool, portfolioParams, getWatchList, checkAlerts, addAlert, getActiveAlerts, } from "./tools/CrossTools.js";
42
- export { sessionStore } from "./session/SessionStore.js";
43
- export type { Session, SessionMeta } from "./session/SessionStore.js";
44
- export { systemMonitor } from "./core/SystemMonitor.js";
45
- export type { SystemStats } from "./core/SystemMonitor.js";
46
- export { MCPServer } from "./mcp/server.js";
47
- export { AgentDir } from "./core/AgentDir.js";
48
- export { EnvLoader, env } from "./core/EnvLoader.js";
49
- export { CHAINS, getPrimaryChain, getEnabledChains, getChain, getSupportedChains } from "./core/ChainConfig.js";
50
- export type { ChainInfo } from "./core/ChainConfig.js";
51
- export { resilientFetch, isReachable } from "./util/resilientFetch.js";
52
- export { logger } from "./util/logger.js";
53
- export { getCached, setCache, getOrCompute, clearCache, cacheStats } from "./util/responseCache.js";
54
- export { addTask, removeTask, pauseTask, resumeTask, pauseAll, resumeAll, startScheduler } from "./util/scheduler.js";
55
- export { requireConfirmation, isNonInteractive } from "./util/confirmation.js";
56
- export { ProcessManager } from "./util/processManager.js";
57
- export { recordTrade, getPLSummary, getTradeHistory, exportCSV } from "./wallet/ProfitTracker.js";
58
- export type { Trade, ProfitState, PLSummary } from "./wallet/ProfitTracker.js";
59
- export { scanTokenSecurityTool } from "./tools/TokenSecurityScanner.js";
60
- export type { TokenSecurityResult } from "./tools/TokenSecurityScanner.js";
1
+ // Bundled type declarations for @aiaiaichain/agent
2
+ // Auto-generated by scripts/bundle-dts.mjs
3
+
4
+
@@ -10,7 +10,6 @@ return Promise.all(tasks.map(t => this.runSingle(t)));
10
10
  async runSingle(task) {
11
11
  try {
12
12
 
13
-
14
13
  return { taskId: task.id, output: `[${task.tier}] ${task.prompt}` };
15
14
  }
16
15
  catch (e) {
package/dist/tui/App.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /**
2
- * App — root Ink component. Multi-pane TUI with sidebar, system monitor,
3
- * session persistence, and full GMGN command access.
4
- */
5
- import React from "react";
6
1
  import { Registry } from "../api/Registry.js";
7
2
  import type { CostTracker } from "../models/CostTracker.js";
8
3
  import type { ModelRegistry as ModelRegistryType } from "../models/ModelRegistry.js";
@@ -16,4 +11,4 @@ export interface AppProps {
16
11
  onStatusReady?: (fn: (key: string, val: string) => void) => void;
17
12
  onModelSelectorReady?: (fn: (query?: string) => void) => void;
18
13
  }
19
- export declare function App({ registry, systemPrompt, chain: initialChain, modelReg, costTracker, onNotifyReady, onStatusReady, onModelSelectorReady, }: AppProps): React.JSX.Element;
14
+ export declare function App({ registry, systemPrompt, chain: initialChain, modelReg, costTracker, onNotifyReady, onStatusReady, onModelSelectorReady, }: AppProps): any;
package/dist/tui/App.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
 
3
- import { useState, useCallback, useEffect, useRef, useMemo } from "react";
3
+ import React, { useState, useCallback, useEffect, useRef, useMemo } from "react";
4
4
  import { Box, Text, useApp, useInput } from "ink";
5
5
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
6
6
  import { join } from "node:path";
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * ModelSelector — interactive model picker overlay.
3
3
  */
4
- import React from "react";
5
4
  interface ModelItem {
6
5
  id: string;
7
6
  tier: string;
@@ -13,5 +12,5 @@ export interface ModelSelectorProps {
13
12
  onCancel: () => void;
14
13
  initialQuery?: string;
15
14
  }
16
- export declare function ModelSelector({ models, currentModelId, onSelect, onCancel, initialQuery }: ModelSelectorProps): React.JSX.Element;
15
+ export declare function ModelSelector({ models, currentModelId, onSelect, onCancel, initialQuery }: ModelSelectorProps): any;
17
16
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
 
3
- import { useState, useCallback, useEffect, useMemo } from "react";
3
+ import React, { useState, useCallback, useEffect, useMemo } from "react";
4
4
  import { Box, Text, useInput } from "ink";
5
5
  import TextInput from "ink-text-input";
6
6
  import { AIAIAI_COLORS } from "./theme.js";
@@ -2,7 +2,6 @@
2
2
  * REPL — scrolling message history + feature-rich input box.
3
3
  * Supports: multi-line (Shift+Enter), command history (↑/↓), tab completion.
4
4
  */
5
- import React from "react";
6
5
  export interface ChatMessage {
7
6
  id: string;
8
7
  role: "user" | "assistant" | "tool" | "system" | "notify";
@@ -19,4 +18,4 @@ export interface REPLProps {
19
18
  onAbort?: () => void;
20
19
  disabled?: boolean;
21
20
  }
22
- export declare function REPL({ messages, streamingText, toolRunning, onSubmit, onAbort, disabled }: REPLProps): React.JSX.Element;
21
+ export declare function REPL({ messages, streamingText, toolRunning, onSubmit, onAbort, disabled }: REPLProps): any;
@@ -2,14 +2,13 @@
2
2
  * src/tui/Sparkline.tsx — Mini ASCII sparkline chart for sidebar.
3
3
  * Uses Unicode block characters: ▁ ▂ ▃ ▄ ▅ ▆ ▇ █
4
4
  */
5
- import React from "react";
6
5
  export interface SparklineProps {
7
6
  data: number[];
8
7
  width?: number;
9
8
  label?: string;
10
9
  color?: string;
11
10
  }
12
- export declare function Sparkline({ data, width, label, color }: SparklineProps): React.JSX.Element | null;
11
+ export declare function Sparkline({ data, width, label, color }: SparklineProps): any;
13
12
  /** Track a rolling price history for sparkline use */
14
13
  export declare class PriceHistory {
15
14
  private prices;
@@ -1,4 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+
3
+ import React from "react";
2
4
  import { Box, Text } from "ink";
3
5
  const CHARS = "▁▂▃▄▅▆▇█";
4
6
  export function Sparkline({ data, width = 30, label, color }) {
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * StatusBar — top line of the TUI showing agent state + live $AIAIAI price.
3
3
  */
4
- import React from "react";
5
4
  export interface StatusBarProps {
6
5
  model: string;
7
6
  chain: string;
@@ -14,4 +13,4 @@ export interface StatusBarProps {
14
13
  uptime?: string;
15
14
  apiCalls?: number;
16
15
  }
17
- export declare function StatusBar({ model, chain, price, toolRunning, connected, statusLine, cpu, ram, uptime, apiCalls }: StatusBarProps): React.JSX.Element;
16
+ export declare function StatusBar({ model, chain, price, toolRunning, connected, statusLine, cpu, ram, uptime, apiCalls }: StatusBarProps): any;
@@ -1,4 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+
3
+ import React from "react";
2
4
  import { Box, Text } from "ink";
3
5
  import { AIAIAI_COLORS } from "./theme.js";
4
6
  export function StatusBar({ model, chain, price, toolRunning, connected, statusLine, cpu, ram, uptime, apiCalls }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiaiaichain/agent",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
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",
@@ -23,8 +23,9 @@
23
23
  "access": "public"
24
24
  },
25
25
  "scripts": {
26
- "build": "tsc --project tsconfig.json",
27
- "build:prod": "tsc --project tsconfig.build.json",
26
+ "build": "node scripts/build-esbuild.mjs && node scripts/bundle-dts.mjs",
27
+ "build:prod": "node scripts/build-esbuild.mjs && node scripts/bundle-dts.mjs && npm run minify",
28
+ "build:tsc": "tsc --project tsconfig.json",
28
29
  "build:esbuild": "node scripts/build-esbuild.mjs",
29
30
  "build:esbuild:watch": "node scripts/build-esbuild.mjs --watch",
30
31
  "build:watch": "tsc --watch",
@@ -33,7 +34,7 @@
33
34
  "start": "node dist/cli.js",
34
35
  "type-check": "tsc --noEmit --project tsconfig.json",
35
36
  "test": "echo \"no tests yet\" && exit 0",
36
- "prepublishOnly": "npm run build && npm run minify",
37
+ "prepublishOnly": "npm run build:prod",
37
38
  "postinstall": "node scripts/postinstall.js"
38
39
  },
39
40
  "dependencies": {
@@ -47,7 +48,7 @@
47
48
  "@types/node": "^20.19.41",
48
49
  "@types/react": "^18.3.29",
49
50
  "esbuild": "^0.25.0",
50
- "typescript": "^5.10.0"
51
+ "typescript": "^5.9.3"
51
52
  },
52
53
  "engines": {
53
54
  "node": ">=20.0.0"
@@ -1,6 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
+ // #88: preuninstall hook — zero out .env contents before removal
5
+ if (process.env.npm_lifecycle_event === 'preuninstall') {
6
+ try {
7
+ const { existsSync, writeFileSync } = require('node:fs');
8
+ const { resolve, join } = require('node:path');
9
+ const { homedir } = require('node:os');
10
+ const envPath = resolve(process.env.AIAIAI_HOME ?? join(homedir(), '.aiaiai'), '.env');
11
+ if (existsSync(envPath)) {
12
+ writeFileSync(envPath, '# Keys removed on uninstall\n', 'utf-8');
13
+ }
14
+ } catch { /* non-fatal */ }
15
+ process.exit(0);
16
+ }
17
+
4
18
  /**
5
19
  * postinstall.js — creates bin symlinks if npm didn't do it.
6
20
  * This handles the case where `npm install -g` doesn't create