@aiaiaichain/agent 0.1.1
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.
- package/README.md +157 -0
- package/bin/aiai-mcp +31 -0
- package/bin/aiaiaicli +60 -0
- package/dist/api/ExtensionAPI.d.ts +68 -0
- package/dist/api/ExtensionAPI.js +9 -0
- package/dist/api/Registry.d.ts +24 -0
- package/dist/api/Registry.js +58 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +252 -0
- package/dist/core/AgentDir.d.ts +10 -0
- package/dist/core/AgentDir.js +74 -0
- package/dist/core/ChainConfig.d.ts +19 -0
- package/dist/core/ChainConfig.js +65 -0
- package/dist/core/EnvLoader.d.ts +15 -0
- package/dist/core/EnvLoader.js +58 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +42 -0
- package/dist/loader.d.ts +11 -0
- package/dist/loader.js +73 -0
- package/dist/mcp/entry.d.ts +5 -0
- package/dist/mcp/entry.js +10 -0
- package/dist/mcp/server.d.ts +14 -0
- package/dist/mcp/server.js +137 -0
- package/dist/models/CostTracker.d.ts +38 -0
- package/dist/models/CostTracker.js +75 -0
- package/dist/models/ModelRegistry.d.ts +70 -0
- package/dist/models/ModelRegistry.js +163 -0
- package/dist/runner/AgentRunner.d.ts +54 -0
- package/dist/runner/AgentRunner.js +171 -0
- package/dist/runner/ModelClient.d.ts +30 -0
- package/dist/runner/ModelClient.js +84 -0
- package/dist/runner/SwarmRouter.d.ts +23 -0
- package/dist/runner/SwarmRouter.js +24 -0
- package/dist/runner/ToolDispatcher.d.ts +13 -0
- package/dist/runner/ToolDispatcher.js +34 -0
- package/dist/scheduler/AgentScheduler.d.ts +48 -0
- package/dist/scheduler/AgentScheduler.js +111 -0
- package/dist/session/ContextStore.d.ts +28 -0
- package/dist/session/ContextStore.js +85 -0
- package/dist/session/GoalManager.d.ts +43 -0
- package/dist/session/GoalManager.js +108 -0
- package/dist/session/MemoryStore.d.ts +27 -0
- package/dist/session/MemoryStore.js +92 -0
- package/dist/session/SessionManager.d.ts +24 -0
- package/dist/session/SessionManager.js +57 -0
- package/dist/setup/SetupWizard.d.ts +13 -0
- package/dist/setup/SetupWizard.js +71 -0
- package/dist/tools/MarketSentiment.d.ts +20 -0
- package/dist/tools/MarketSentiment.js +211 -0
- package/dist/tools/NewsSentiment.d.ts +36 -0
- package/dist/tools/NewsSentiment.js +141 -0
- package/dist/tools/PriceFeed.d.ts +85 -0
- package/dist/tools/PriceFeed.js +134 -0
- package/dist/tools/TechnicalAnalysis.d.ts +50 -0
- package/dist/tools/TechnicalAnalysis.js +234 -0
- package/dist/tui/App.d.ts +20 -0
- package/dist/tui/App.js +484 -0
- package/dist/tui/ModelSelector.d.ts +18 -0
- package/dist/tui/ModelSelector.js +59 -0
- package/dist/tui/REPL.d.ts +22 -0
- package/dist/tui/REPL.js +48 -0
- package/dist/tui/StatusBar.d.ts +14 -0
- package/dist/tui/StatusBar.js +13 -0
- package/dist/tui/theme.d.ts +27 -0
- package/dist/tui/theme.js +38 -0
- package/dist/util/safeLog.d.ts +8 -0
- package/dist/util/safeLog.js +38 -0
- package/package.json +64 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { AIAIAI_COLORS } from "./theme.js";
|
|
4
|
+
export function StatusBar({ model, chain, price, toolRunning, connected, statusLine }) {
|
|
5
|
+
const chainShort = chain.slice(0, 8);
|
|
6
|
+
const modelShort = model.split("/").pop()?.slice(0, 18) ?? model.slice(0, 18);
|
|
7
|
+
return (_jsxs(Box, { borderStyle: "single", borderColor: AIAIAI_COLORS.dim, paddingX: 1, flexDirection: "row", justifyContent: "space-between", children: [_jsxs(Box, { gap: 2, children: [_jsx(Text, { color: AIAIAI_COLORS.accent, bold: true, children: "\uD83E\uDD16 AIAIAI" }), price ? _jsx(Text, { color: AIAIAI_COLORS.success, children: price }) : null, _jsx(Text, { color: AIAIAI_COLORS.muted, children: modelShort })] }), _jsx(Box, { children: toolRunning
|
|
8
|
+
? _jsxs(Text, { color: AIAIAI_COLORS.warn, children: ["\u2699 ", toolRunning] })
|
|
9
|
+
: statusLine
|
|
10
|
+
? _jsx(Text, { color: AIAIAI_COLORS.muted, children: statusLine.slice(0, 80) })
|
|
11
|
+
: _jsx(Text, { color: AIAIAI_COLORS.muted, children: connected ? "ready" : "connecting…" }) }), _jsx(Box, { gap: 2, children: _jsxs(Text, { color: AIAIAI_COLORS.header, children: ["\u26D3 ", chainShort] }) })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=StatusBar.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIAIAI colour theme — hot pink signature palette.
|
|
3
|
+
*/
|
|
4
|
+
import type { ThemeContext } from "../api/ExtensionAPI.js";
|
|
5
|
+
export declare const AIAIAI_COLORS: {
|
|
6
|
+
readonly accent: "#ff3366";
|
|
7
|
+
readonly success: "#00ff88";
|
|
8
|
+
readonly error: "#ff4444";
|
|
9
|
+
readonly warn: "#ffaa33";
|
|
10
|
+
readonly muted: "#6b7280";
|
|
11
|
+
readonly header: "#a78bfa";
|
|
12
|
+
readonly dim: "#1f2937";
|
|
13
|
+
};
|
|
14
|
+
export type AiaiaiColor = keyof typeof AIAIAI_COLORS;
|
|
15
|
+
export declare function makeTheme(): ThemeContext;
|
|
16
|
+
export declare const theme: ThemeContext;
|
|
17
|
+
export declare const T: {
|
|
18
|
+
accent: (s: string) => string;
|
|
19
|
+
success: (s: string) => string;
|
|
20
|
+
error: (s: string) => string;
|
|
21
|
+
warn: (s: string) => string;
|
|
22
|
+
muted: (s: string) => string;
|
|
23
|
+
header: (s: string) => string;
|
|
24
|
+
dim: (s: string) => string;
|
|
25
|
+
bold: (s: string) => string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIAIAI colour theme — hot pink signature palette.
|
|
3
|
+
*/
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
export const AIAIAI_COLORS = {
|
|
6
|
+
accent: "#ff3366", // hot pink — AIAIAI signature
|
|
7
|
+
success: "#00ff88", // bright green
|
|
8
|
+
error: "#ff4444", // red
|
|
9
|
+
warn: "#ffaa33", // amber
|
|
10
|
+
muted: "#6b7280", // slate grey
|
|
11
|
+
header: "#a78bfa", // purple
|
|
12
|
+
dim: "#1f2937", // dark slate
|
|
13
|
+
};
|
|
14
|
+
export function makeTheme() {
|
|
15
|
+
return {
|
|
16
|
+
fg(color, text) {
|
|
17
|
+
const hex = AIAIAI_COLORS[color] ?? color;
|
|
18
|
+
try {
|
|
19
|
+
return chalk.hex(hex)(text);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return text;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const theme = makeTheme();
|
|
28
|
+
export const T = {
|
|
29
|
+
accent: (s) => chalk.hex(AIAIAI_COLORS.accent)(s),
|
|
30
|
+
success: (s) => chalk.hex(AIAIAI_COLORS.success)(s),
|
|
31
|
+
error: (s) => chalk.hex(AIAIAI_COLORS.error)(s),
|
|
32
|
+
warn: (s) => chalk.hex(AIAIAI_COLORS.warn)(s),
|
|
33
|
+
muted: (s) => chalk.hex(AIAIAI_COLORS.muted)(s),
|
|
34
|
+
header: (s) => chalk.hex(AIAIAI_COLORS.header)(s),
|
|
35
|
+
dim: (s) => chalk.hex(AIAIAI_COLORS.dim)(s),
|
|
36
|
+
bold: (s) => chalk.bold(s),
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* safeLog — wraps console.log/error/warn to avoid corrupting Ink TUI output.
|
|
3
|
+
*/
|
|
4
|
+
export declare function wireNotify(fn: (msg: string) => void): void;
|
|
5
|
+
declare function safeLogFn(...args: unknown[]): void;
|
|
6
|
+
export declare const safeLog: typeof safeLogFn;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=safeLog.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* safeLog — wraps console.log/error/warn to avoid corrupting Ink TUI output.
|
|
3
|
+
*/
|
|
4
|
+
const queue = [];
|
|
5
|
+
let notifyFn = null;
|
|
6
|
+
let scheduled = false;
|
|
7
|
+
export function wireNotify(fn) {
|
|
8
|
+
notifyFn = fn;
|
|
9
|
+
// Drain any queued messages
|
|
10
|
+
if (queue.length > 0) {
|
|
11
|
+
for (const msg of queue)
|
|
12
|
+
fn(msg);
|
|
13
|
+
queue.length = 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function safeLogFn(...args) {
|
|
17
|
+
const msg = args.map(a => (typeof a === "string" ? a : JSON.stringify(a))).join(" ");
|
|
18
|
+
if (notifyFn) {
|
|
19
|
+
notifyFn(msg);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
queue.push(msg);
|
|
23
|
+
if (!scheduled) {
|
|
24
|
+
scheduled = true;
|
|
25
|
+
process.nextTick(() => {
|
|
26
|
+
// If no notifyFn registered by next tick, just write to stderr
|
|
27
|
+
if (!notifyFn && queue.length > 0) {
|
|
28
|
+
for (const m of queue)
|
|
29
|
+
process.stderr.write(m + "\n");
|
|
30
|
+
queue.length = 0;
|
|
31
|
+
}
|
|
32
|
+
scheduled = false;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const safeLog = safeLogFn;
|
|
38
|
+
//# sourceMappingURL=safeLog.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aiaiaichain/agent",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "AIAIAI Chain Agent — Solana-native AI agent for decentralized AI governance. Ticker: $AIAIAI",
|
|
5
|
+
"author": "AIAIAI Foundation",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"aiaiaichain": "./bin/aiaiaicli",
|
|
18
|
+
"aiai": "./bin/aiaiaicli",
|
|
19
|
+
"aiaiai-mcp": "./bin/aiai-mcp"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc --project tsconfig.json",
|
|
26
|
+
"build:watch": "tsc --watch",
|
|
27
|
+
"dev": "tsx src/cli.ts",
|
|
28
|
+
"start": "node dist/cli.js",
|
|
29
|
+
"type-check": "tsc --noEmit --project tsconfig.json",
|
|
30
|
+
"test": "echo \"no tests yet\" && exit 0",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@sinclair/typebox": "^0.32.0",
|
|
35
|
+
"chalk": "^5.3.0",
|
|
36
|
+
"dotenv": "^16.4.5",
|
|
37
|
+
"ink": "^5.0.1",
|
|
38
|
+
"ink-text-input": "^6.0.0",
|
|
39
|
+
"react": "^18.3.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^20.19.41",
|
|
43
|
+
"@types/react": "^18.3.29",
|
|
44
|
+
"typescript": "^5.9.3"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20.0.0"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"ai",
|
|
51
|
+
"agent",
|
|
52
|
+
"solana",
|
|
53
|
+
"terminal",
|
|
54
|
+
"cli",
|
|
55
|
+
"aiaiai",
|
|
56
|
+
"crypto"
|
|
57
|
+
],
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"bin",
|
|
61
|
+
"README.md",
|
|
62
|
+
"!dist/**/*.map"
|
|
63
|
+
]
|
|
64
|
+
}
|