@hemansubedi/aether-ai 1.0.0
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/.gitattributes +3 -0
- package/.github/workflows/live-stats.yml +42 -0
- package/.github/workflows/publish.yml +34 -0
- package/.github/workflows/update-preview.yml +41 -0
- package/INSTALL.md +59 -0
- package/LICENSE +21 -0
- package/README.md +397 -0
- package/assets/aether-arena.svg +72 -0
- package/assets/aether-banner.svg +62 -0
- package/assets/aether-router.svg +129 -0
- package/dist/agent.js +125 -0
- package/dist/arena.js +486 -0
- package/dist/checkpoint.js +105 -0
- package/dist/client.js +95 -0
- package/dist/combos.js +176 -0
- package/dist/commands.js +483 -0
- package/dist/config.js +104 -0
- package/dist/cost.js +176 -0
- package/dist/git.js +52 -0
- package/dist/health.js +81 -0
- package/dist/index.js +272 -0
- package/dist/keys.js +128 -0
- package/dist/memory.js +98 -0
- package/dist/modes.js +68 -0
- package/dist/providers/index.js +32 -0
- package/dist/providers/ollama.js +206 -0
- package/dist/providers/openai-compat.js +181 -0
- package/dist/providers/openrouter.js +189 -0
- package/dist/providers/registry.js +211 -0
- package/dist/router-engine.js +200 -0
- package/dist/router.js +171 -0
- package/dist/server.js +210 -0
- package/dist/session.js +97 -0
- package/dist/settings.js +97 -0
- package/dist/skills.js +100 -0
- package/dist/tokensaver.js +50 -0
- package/dist/tools/filesystem.js +243 -0
- package/dist/tools/git.js +53 -0
- package/dist/tools/glob.js +175 -0
- package/dist/tools/grep.js +193 -0
- package/dist/tools/registry.js +39 -0
- package/dist/tools/vision.js +140 -0
- package/dist/tools/websearch.js +118 -0
- package/dist/tui.js +562 -0
- package/dist/types.js +8 -0
- package/docs/preview.txt +51 -0
- package/docs/screenshots.md +110 -0
- package/docs/stats.md +5 -0
- package/install.ps1 +170 -0
- package/install.sh +196 -0
- package/package.json +34 -0
- package/scripts/generate-stats-card.ts +62 -0
- package/scripts/patch_index.ps1 +17 -0
- package/scripts/release.sh +7 -0
- package/src/agent.ts +146 -0
- package/src/arena.ts +584 -0
- package/src/checkpoint.ts +111 -0
- package/src/client.ts +172 -0
- package/src/combos.ts +199 -0
- package/src/commands.ts +973 -0
- package/src/config.ts +122 -0
- package/src/cost.ts +206 -0
- package/src/git.ts +68 -0
- package/src/health.ts +90 -0
- package/src/index.ts +281 -0
- package/src/keys.ts +135 -0
- package/src/memory.ts +101 -0
- package/src/modes.ts +84 -0
- package/src/providers/index.ts +59 -0
- package/src/providers/ollama.ts +222 -0
- package/src/providers/openai-compat.ts +188 -0
- package/src/providers/openrouter.ts +198 -0
- package/src/providers/registry.ts +223 -0
- package/src/router-engine.ts +214 -0
- package/src/router.ts +195 -0
- package/src/server.ts +242 -0
- package/src/session.ts +111 -0
- package/src/settings.ts +125 -0
- package/src/skills.ts +106 -0
- package/src/tokensaver.ts +57 -0
- package/src/tools/filesystem.ts +258 -0
- package/src/tools/git.ts +53 -0
- package/src/tools/glob.ts +180 -0
- package/src/tools/grep.ts +192 -0
- package/src/tools/registry.ts +54 -0
- package/src/tools/vision.ts +152 -0
- package/src/tools/websearch.ts +130 -0
- package/src/tui.ts +664 -0
- package/src/types.ts +77 -0
- package/tsconfig.json +16 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type Role = "system" | "user" | "assistant" | "tool";
|
|
2
|
+
|
|
3
|
+
export interface TextPart {
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ImageUrlPart {
|
|
9
|
+
type: "image_url";
|
|
10
|
+
image_url: { url: string } | string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type ContentPart = TextPart | ImageUrlPart;
|
|
14
|
+
|
|
15
|
+
export interface Message {
|
|
16
|
+
role: Role;
|
|
17
|
+
content: string | ContentPart[];
|
|
18
|
+
tool_calls?: ToolCall[];
|
|
19
|
+
tool_call_id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ToolCall {
|
|
24
|
+
id: string;
|
|
25
|
+
type: "function";
|
|
26
|
+
function: { name: string; arguments: string };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ToolDef {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
parameters: Record<string, any>; // JSON schema
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ChatChunk {
|
|
36
|
+
type: "text" | "tool_call" | "done" | "error";
|
|
37
|
+
text?: string;
|
|
38
|
+
tool_call?: ToolCall;
|
|
39
|
+
error?: string;
|
|
40
|
+
usage?: { input_tokens: number; output_tokens: number };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ProviderConfig {
|
|
44
|
+
name: string;
|
|
45
|
+
type: "ollama" | "openrouter" | "openai-compatible";
|
|
46
|
+
baseURL: string;
|
|
47
|
+
apiKey?: string;
|
|
48
|
+
models: string[];
|
|
49
|
+
priority: number; // lower = preferred
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
maxRetries: number;
|
|
52
|
+
timeoutMs: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface HealthStatus {
|
|
56
|
+
provider: string;
|
|
57
|
+
healthy: boolean;
|
|
58
|
+
failures: number;
|
|
59
|
+
lastCheck: number;
|
|
60
|
+
lastError?: string;
|
|
61
|
+
circuitOpen: boolean; // circuit breaker open = do not try
|
|
62
|
+
cooldownUntil: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface RouteDecision {
|
|
66
|
+
provider: string;
|
|
67
|
+
model: string;
|
|
68
|
+
reason: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Extract a plain-text representation of a message's content. */
|
|
72
|
+
export function messageText(m: Message): string {
|
|
73
|
+
if (typeof m.content === "string") return m.content;
|
|
74
|
+
return m.content
|
|
75
|
+
.map((p) => (p.type === "text" ? p.text : "[image]"))
|
|
76
|
+
.join("");
|
|
77
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"moduleDetection": "force",
|
|
7
|
+
"verbatimModuleSyntax": false,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"types": ["node"],
|
|
10
|
+
"outDir": "dist",
|
|
11
|
+
"rootDir": "src",
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"skipLibCheck": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["src/**/*.ts"]
|
|
16
|
+
}
|