@rungate/llmrouter 0.1.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.
@@ -0,0 +1,65 @@
1
+ export type MessageRole = 'system' | 'user' | 'assistant' | 'tool';
2
+ export type RouterContentPart = {
3
+ type: 'text' | 'input_text';
4
+ text: string;
5
+ } | {
6
+ type: 'image_url';
7
+ image_url: {
8
+ url: string;
9
+ };
10
+ } | {
11
+ type: 'input_image';
12
+ image_url?: string;
13
+ url?: string;
14
+ } | {
15
+ type: 'input_file' | 'file';
16
+ file_id?: string;
17
+ filename?: string;
18
+ } | {
19
+ type: 'video_url';
20
+ video_url: {
21
+ url: string;
22
+ };
23
+ } | {
24
+ type: string;
25
+ [key: string]: unknown;
26
+ };
27
+ export type RouterMessage = {
28
+ role: MessageRole;
29
+ content: string | RouterContentPart[];
30
+ };
31
+ export type RouterRequest = {
32
+ model: string;
33
+ messages: RouterMessage[];
34
+ tools?: Array<{
35
+ name?: string;
36
+ }>;
37
+ responseFormat?: 'json' | 'text';
38
+ maxTokens?: number;
39
+ };
40
+ export type RouteCategory = 'simple' | 'coding' | 'reasoning' | 'vision';
41
+ export type PromptClassification = {
42
+ category: RouteCategory;
43
+ reason: string;
44
+ hasTools: boolean;
45
+ wantsJson: boolean;
46
+ hasImage: boolean;
47
+ };
48
+ export type RouteDecision = {
49
+ logicalModel: string;
50
+ category: RouteCategory;
51
+ resolvedModel: string;
52
+ reason: string;
53
+ hasTools: boolean;
54
+ wantsJson: boolean;
55
+ hasImage: boolean;
56
+ };
57
+ export type WalletInfo = {
58
+ address: `0x${string}`;
59
+ walletFile: string;
60
+ network: string;
61
+ source: 'saved' | 'env' | 'generated';
62
+ nativeBalance?: string;
63
+ nativeSymbol?: string;
64
+ usdcBalance?: string;
65
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "llmrouter",
3
+ "name": "llm_router",
4
+ "description": "Minimal OpenClaw-first LLM router with x402 payment support",
5
+ "providers": ["llmrouter"],
6
+ "configSchema": {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {}
10
+ }
11
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@rungate/llmrouter",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/src/index.js",
6
+ "types": "./dist/src/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ziyincody/llm_router.git"
10
+ },
11
+ "homepage": "https://github.com/ziyincody/llm_router",
12
+ "bugs": {
13
+ "url": "https://github.com/ziyincody/llm_router/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "openclaw.plugin.json",
21
+ "README.md"
22
+ ],
23
+ "openclaw": {
24
+ "extensions": [
25
+ "./dist/src/openclaw/plugin.js"
26
+ ]
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "scripts": {
32
+ "build": "tsc -p tsconfig.json",
33
+ "dev:proxy": "node --import tsx scripts/proxy.ts",
34
+ "prepublishOnly": "npm run typecheck && npm run build",
35
+ "typecheck": "tsc -p tsconfig.json --noEmit"
36
+ },
37
+ "dependencies": {
38
+ "@x402/evm": "2.7.0",
39
+ "@x402/fetch": "2.7.0",
40
+ "viem": "2.39.3"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^24.0.0",
44
+ "tsx": "^4.20.6",
45
+ "typescript": "^5.9.3"
46
+ },
47
+ "peerDependencies": {
48
+ "openclaw": ">=2025.1.0"
49
+ },
50
+ "peerDependenciesMeta": {
51
+ "openclaw": {
52
+ "optional": true
53
+ }
54
+ }
55
+ }