claudmax 2.0.0 → 2.0.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/claudmax-1.0.16.tgz +0 -0
- package/{packages/cli/index.js → index.js} +2 -0
- package/package.json +27 -55
- package/.claude/settings.local.json +0 -7
- package/.env.example +0 -24
- package/.github/workflows/publish.yml +0 -31
- package/README.md +0 -178
- package/claudmax-mcp-1.0.2.tgz +0 -0
- package/help +0 -0
- package/help-wal +0 -0
- package/next-env.d.ts +0 -6
- package/next.config.mjs +0 -43
- package/packages/cli/claudmax-1.0.16.tgz +0 -0
- package/packages/cli/package.json +0 -33
- package/packages/mcp/claudmax-mcp-1.0.0.tgz +0 -0
- package/packages/mcp/claudmax-mcp-1.0.1.tgz +0 -0
- package/packages/mcp/claudmax-mcp-1.0.2.tgz +0 -0
- package/packages/mcp/claudmax-mcp-1.0.3.tgz +0 -0
- package/packages/mcp/index.js +0 -129
- package/packages/mcp/package-lock.json +0 -1146
- package/packages/mcp/package.json +0 -32
- package/postcss.config.mjs +0 -6
- package/prisma/schema.prisma +0 -130
- package/prisma/seed.ts +0 -27
- package/public/favicon.svg +0 -10
- package/public/robots.txt +0 -10
- package/run_build.sh +0 -4
- package/scripts/migrate-plans.js +0 -98
- package/scripts/seed-blog.ts +0 -1014
- package/src/app/admin/dashboard/AdminDashboardClient.tsx +0 -1546
- package/src/app/admin/dashboard/page.tsx +0 -13
- package/src/app/admin/page.tsx +0 -132
- package/src/app/api/admin/auth/me/route.ts +0 -34
- package/src/app/api/admin/health/route.ts +0 -110
- package/src/app/api/admin/keys/[id]/route.ts +0 -116
- package/src/app/api/admin/keys/route.ts +0 -192
- package/src/app/api/admin/keys-list/route.ts +0 -81
- package/src/app/api/admin/login/route.ts +0 -72
- package/src/app/api/admin/logout/route.ts +0 -8
- package/src/app/api/admin/migrate/route.ts +0 -133
- package/src/app/api/admin/plans/[id]/route.ts +0 -65
- package/src/app/api/admin/plans/route.ts +0 -66
- package/src/app/api/admin/posts/[id]/route.ts +0 -81
- package/src/app/api/admin/posts/route.ts +0 -83
- package/src/app/api/admin/seed/route.ts +0 -145
- package/src/app/api/admin/settings/route.ts +0 -44
- package/src/app/api/admin/stats/route.ts +0 -74
- package/src/app/api/admin/users/[id]/route.ts +0 -166
- package/src/app/api/admin/users/plans/route.ts +0 -45
- package/src/app/api/admin/users/route.ts +0 -202
- package/src/app/api/blog/[slug]/route.ts +0 -22
- package/src/app/api/blog/route.ts +0 -40
- package/src/app/api/cron/daily-status/route.ts +0 -208
- package/src/app/api/support/chat/route.ts +0 -55
- package/src/app/api/support/chat/session/route.ts +0 -62
- package/src/app/api/support/chat/stream/route.ts +0 -44
- package/src/app/api/support/email/route.ts +0 -63
- package/src/app/api/tools/understand_image/route.ts +0 -113
- package/src/app/api/tools/upload/route.ts +0 -179
- package/src/app/api/tools/web_search/route.ts +0 -99
- package/src/app/api/v1/audio/route.ts +0 -67
- package/src/app/api/v1/audio/speech/route.ts +0 -73
- package/src/app/api/v1/chat/completions/route.ts +0 -3
- package/src/app/api/v1/chat/route.ts +0 -1079
- package/src/app/api/v1/images/generations/route.ts +0 -93
- package/src/app/api/v1/info/route.ts +0 -30
- package/src/app/api/v1/key-status/route.ts +0 -109
- package/src/app/api/v1/key-status/stream/route.ts +0 -135
- package/src/app/api/v1/messages/count_tokens/route.ts +0 -22
- package/src/app/api/v1/messages/route.ts +0 -807
- package/src/app/api/v1/models/route.ts +0 -14
- package/src/app/api/v1/route.ts +0 -18
- package/src/app/blog/BlogClient.tsx +0 -193
- package/src/app/blog/[slug]/page.tsx +0 -117
- package/src/app/blog/page.tsx +0 -20
- package/src/app/check-usage/CheckUsageClient.tsx +0 -186
- package/src/app/check-usage/layout.tsx +0 -11
- package/src/app/check-usage/page.tsx +0 -15
- package/src/app/docs/layout.tsx +0 -16
- package/src/app/docs/page.tsx +0 -1055
- package/src/app/faq/FAQClient.tsx +0 -227
- package/src/app/faq/page.tsx +0 -21
- package/src/app/globals.css +0 -75
- package/src/app/layout.tsx +0 -80
- package/src/app/page.tsx +0 -256
- package/src/app/reseller/ResellerClient.tsx +0 -435
- package/src/app/reseller/page.tsx +0 -15
- package/src/app/setup.ps1/route.ts +0 -79
- package/src/app/setup.sh/route.ts +0 -113
- package/src/app/sitemap.ts +0 -50
- package/src/app/status/StatusClient.tsx +0 -103
- package/src/app/status/layout.tsx +0 -11
- package/src/app/status/page.tsx +0 -15
- package/src/app/support/SupportClient.tsx +0 -411
- package/src/app/support/page.tsx +0 -25
- package/src/app/v1/chat/completions/route.ts +0 -3
- package/src/app/v1/chat/route.ts +0 -4
- package/src/app/v1/messages/route.ts +0 -3
- package/src/components/Footer.tsx +0 -120
- package/src/components/Header.tsx +0 -131
- package/src/components/landing/features.tsx +0 -99
- package/src/components/ui/badge.tsx +0 -32
- package/src/components/ui/button.tsx +0 -46
- package/src/components/ui/card.tsx +0 -50
- package/src/components/ui/dialog.tsx +0 -97
- package/src/components/ui/dropdown-menu.tsx +0 -156
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -15
- package/src/components/ui/separator.tsx +0 -22
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/tabs.tsx +0 -51
- package/src/components/ui/toast.tsx +0 -103
- package/src/lib/auth.ts +0 -45
- package/src/lib/prisma.ts +0 -20
- package/src/lib/providers.ts +0 -158
- package/src/lib/security.ts +0 -165
- package/src/lib/utils.ts +0 -14
- package/src/middleware.ts +0 -30
- package/tailwind.config.ts +0 -53
- package/tsconfig.json +0 -41
- package/tsconfig.tsbuildinfo +0 -1
- package/vercel.json +0 -8
- /package/{packages/cli/bin → bin}/claudmax.js +0 -0
- /package/{packages/cli/claudmax-1.0.17.tgz → claudmax-1.0.17.tgz} +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "claudmax-mcp",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"description": "ClaudMax MCP server — Claude AI tools via Model Context Protocol for Claude Code, Cursor, and other IDEs",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"claudmax-mcp": "./index.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"start": "node ./index.js"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"claudmax",
|
|
14
|
-
"claude",
|
|
15
|
-
"mcp",
|
|
16
|
-
"model-context-protocol",
|
|
17
|
-
"claude-code",
|
|
18
|
-
"cursor",
|
|
19
|
-
"ai",
|
|
20
|
-
"api",
|
|
21
|
-
"proxy",
|
|
22
|
-
"gateway"
|
|
23
|
-
],
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"engines": {
|
|
26
|
-
"node": ">=18.0.0"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
30
|
-
"zod": "^4.3.6"
|
|
31
|
-
}
|
|
32
|
-
}
|
package/postcss.config.mjs
DELETED
package/prisma/schema.prisma
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
generator client {
|
|
2
|
-
provider = "prisma-client-js"
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
datasource db {
|
|
6
|
-
provider = "sqlite"
|
|
7
|
-
url = env("DATABASE_URL")
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
model Plan {
|
|
11
|
-
id String @id @default(cuid())
|
|
12
|
-
name String // e.g. "Free", "Pro 20x", "Enterprise"
|
|
13
|
-
tier String // maps to TIER_LIMITS key: "free", "5x", "20x", "unlimited"
|
|
14
|
-
tokensPerWindow Int // token limit per 5h window
|
|
15
|
-
requestsPerWindow Int // request limit per 5h window
|
|
16
|
-
durationDays Int // default duration in days (-1 = unlimited)
|
|
17
|
-
displayMultiplier Float @default(1.0)
|
|
18
|
-
minDurationDays Int @default(0)
|
|
19
|
-
maxDurationDays Int @default(-1) // -1 = unlimited
|
|
20
|
-
isActive Boolean @default(true)
|
|
21
|
-
createdAt DateTime @default(now())
|
|
22
|
-
updatedAt DateTime @updatedAt
|
|
23
|
-
apiKeys ApiKey[]
|
|
24
|
-
createdByAdminId String?
|
|
25
|
-
adminsAllowed String @default("[]") // JSON array of admin IDs
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
model Admin {
|
|
29
|
-
id String @id @default(cuid())
|
|
30
|
-
username String @unique
|
|
31
|
-
password String
|
|
32
|
-
name String
|
|
33
|
-
role String @default("reseller") // super_admin | admin | reseller
|
|
34
|
-
isActive Boolean @default(true)
|
|
35
|
-
blockedUntil DateTime? // null = not blocked; set to future date for temporary block
|
|
36
|
-
blockReason String? // reason for the block
|
|
37
|
-
// Permissions — JSON stored as string in SQLite
|
|
38
|
-
// Super admin and admin always have all permissions (ignore these flags)
|
|
39
|
-
canCreateKey Boolean @default(true)
|
|
40
|
-
canDeleteKey Boolean @default(true)
|
|
41
|
-
canBlockKey Boolean @default(true)
|
|
42
|
-
canManageTokens Boolean @default(true)
|
|
43
|
-
canCreateReseller Boolean @default(false)
|
|
44
|
-
canManageResellers Boolean @default(false)
|
|
45
|
-
canManageUsers Boolean @default(false)
|
|
46
|
-
// Key generation limits
|
|
47
|
-
keysGenLimit Int @default(10) // max keys per window
|
|
48
|
-
keysGenResetAt DateTime? // when the window resets
|
|
49
|
-
keysGenToday Int @default(0) // keys generated today
|
|
50
|
-
// Plan access
|
|
51
|
-
allowedPlanIds String @default("[]") // JSON array of plan IDs
|
|
52
|
-
defaultPlanId String?
|
|
53
|
-
supportEnabled Boolean @default(true) // toggle support page visibility
|
|
54
|
-
createdAt DateTime @default(now())
|
|
55
|
-
updatedAt DateTime @updatedAt
|
|
56
|
-
apiKeys ApiKey[]
|
|
57
|
-
posts Post[]
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
model ApiKey {
|
|
61
|
-
id String @id @default(cuid())
|
|
62
|
-
key String @unique
|
|
63
|
-
name String @default("My API Key")
|
|
64
|
-
prefix String @default("")
|
|
65
|
-
resellerId String?
|
|
66
|
-
reseller Admin? @relation(fields: [resellerId], references: [id], onDelete: SetNull)
|
|
67
|
-
tier String @default("free")
|
|
68
|
-
isActive Boolean @default(true)
|
|
69
|
-
// Temporary block
|
|
70
|
-
blockedUntil DateTime? // null = not blocked; set to future date for temporary block
|
|
71
|
-
blockReason String? // reason for the block
|
|
72
|
-
displayMultiplier Float @default(3.0)
|
|
73
|
-
// Window tracking
|
|
74
|
-
lastUsedAt DateTime?
|
|
75
|
-
windowStartAt DateTime?
|
|
76
|
-
windowTokensUsed Int @default(0)
|
|
77
|
-
windowRequestsUsed Int @default(0)
|
|
78
|
-
totalTokensUsed Int @default(0)
|
|
79
|
-
// Token limit overrides (null = use tier default)
|
|
80
|
-
tokenLimitOverride Int?
|
|
81
|
-
// Expiration
|
|
82
|
-
expiresAt DateTime?
|
|
83
|
-
// Plan reference
|
|
84
|
-
planId String?
|
|
85
|
-
plan Plan? @relation(fields: [planId], references: [id], onDelete: SetNull)
|
|
86
|
-
createdAt DateTime @default(now())
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
model Post {
|
|
90
|
-
id String @id @default(cuid())
|
|
91
|
-
title String
|
|
92
|
-
slug String @unique
|
|
93
|
-
excerpt String?
|
|
94
|
-
content String
|
|
95
|
-
coverImage String?
|
|
96
|
-
authorId String?
|
|
97
|
-
author Admin? @relation(fields: [authorId], references: [id])
|
|
98
|
-
published Boolean @default(false)
|
|
99
|
-
publishedAt DateTime?
|
|
100
|
-
tags String @default("") // comma-separated
|
|
101
|
-
seoTitle String?
|
|
102
|
-
seoDesc String?
|
|
103
|
-
views Int @default(0)
|
|
104
|
-
createdAt DateTime @default(now())
|
|
105
|
-
updatedAt DateTime @updatedAt
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
model ChatSession {
|
|
109
|
-
id String @id @default(cuid())
|
|
110
|
-
visitorName String
|
|
111
|
-
whatsapp String?
|
|
112
|
-
email String
|
|
113
|
-
status String @default("open") // open | closed | resolved
|
|
114
|
-
unreadAdmin Int @default(0)
|
|
115
|
-
lastMessage String?
|
|
116
|
-
lastMessageAt DateTime?
|
|
117
|
-
createdAt DateTime @default(now())
|
|
118
|
-
updatedAt DateTime @updatedAt
|
|
119
|
-
messages ChatMessage[]
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
model ChatMessage {
|
|
123
|
-
id String @id @default(cuid())
|
|
124
|
-
sessionId String
|
|
125
|
-
session ChatSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
126
|
-
sender String // "visitor" | "support"
|
|
127
|
-
content String
|
|
128
|
-
isRead Boolean @default(false)
|
|
129
|
-
createdAt DateTime @default(now())
|
|
130
|
-
}
|
package/prisma/seed.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PrismaClient } from '@prisma/client';
|
|
2
|
-
import bcrypt from 'bcryptjs';
|
|
3
|
-
|
|
4
|
-
const prisma = new PrismaClient();
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
const hash = await bcrypt.hash(process.env.SUPER_ADMIN_PASSWORD ?? 'claudmax-super-2026', 12);
|
|
8
|
-
const existing = await prisma.admin.findUnique({ where: { username: 'superadmin' } });
|
|
9
|
-
if (!existing) {
|
|
10
|
-
await prisma.admin.create({
|
|
11
|
-
data: {
|
|
12
|
-
username: 'superadmin',
|
|
13
|
-
password: hash,
|
|
14
|
-
name: 'Super Admin',
|
|
15
|
-
role: 'super_admin',
|
|
16
|
-
isActive: true,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
console.log('Super admin created: superadmin / claudmax-super-2026');
|
|
20
|
-
} else {
|
|
21
|
-
console.log('Super admin already exists.');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
main()
|
|
26
|
-
.catch(console.error)
|
|
27
|
-
.finally(() => prisma.$disconnect());
|
package/public/favicon.svg
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
2
|
-
<defs>
|
|
3
|
-
<linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
-
<stop offset="0%" stop-color="#7c3aed"/>
|
|
5
|
-
<stop offset="100%" stop-color="#5244F3"/>
|
|
6
|
-
</linearGradient>
|
|
7
|
-
</defs>
|
|
8
|
-
<circle cx="16" cy="16" r="16" fill="url(#g)"/>
|
|
9
|
-
<path d="M17 6L9 18h7l-1 8 10-12h-8l1-8z" fill="white"/>
|
|
10
|
-
</svg>
|
package/public/robots.txt
DELETED
package/run_build.sh
DELETED
package/scripts/migrate-plans.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Migration script: Plan.tokensPerWindow from TEXT/BigInt to INTEGER
|
|
4
|
-
* Run with: node scripts/migrate-plans.js
|
|
5
|
-
*
|
|
6
|
-
* This handles the case where Turso stores BigInt as TEXT.
|
|
7
|
-
* Steps:
|
|
8
|
-
* 1. Back up existing Plan data
|
|
9
|
-
* 2. Drop old column and add new INTEGER column
|
|
10
|
-
* 3. Restore data with clean integers
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const { createClient } = require('@libsql/client');
|
|
14
|
-
|
|
15
|
-
const TURSO_DB_URL = process.env.TURSO_DATABASE_URL;
|
|
16
|
-
const TURSO_DB_TOKEN = process.env.TURSO_DATABASE_AUTH_TOKEN;
|
|
17
|
-
|
|
18
|
-
if (!TURSO_DB_URL || !TURSO_DB_TOKEN) {
|
|
19
|
-
console.error('Missing TURSO_DATABASE_URL or TURSO_DATABASE_AUTH_TOKEN env vars');
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const db = createClient({ url: TURSO_DB_URL, authToken: TURSO_DB_TOKEN });
|
|
24
|
-
|
|
25
|
-
async function migrate() {
|
|
26
|
-
console.log('Starting Plan.tokensPerWindow migration...');
|
|
27
|
-
|
|
28
|
-
// Step 1: Check current schema
|
|
29
|
-
const tableInfo = await db.execute("PRAGMA table_info(Plan)");
|
|
30
|
-
console.log('Current Plan schema:', JSON.stringify(tableInfo.rows, null, 2));
|
|
31
|
-
|
|
32
|
-
// Step 2: Backup existing data
|
|
33
|
-
const plans = await db.execute("SELECT id, name, tokensPerWindow FROM Plan");
|
|
34
|
-
console.log(`Found ${plans.rows.length} plan(s)`);
|
|
35
|
-
for (const row of plans.rows) {
|
|
36
|
-
const val = row.tokensPerWindow;
|
|
37
|
-
const cleaned = parseInt(String(val).replace('.0', ''));
|
|
38
|
-
console.log(` Plan: ${row.name}, tokensPerWindow: "${val}" -> ${cleaned}`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Step 3: Recreate column as INTEGER
|
|
42
|
-
console.log('\nMigrating tokensPerWindow to INTEGER...');
|
|
43
|
-
|
|
44
|
-
// Create backup table
|
|
45
|
-
await db.execute(`
|
|
46
|
-
CREATE TABLE IF NOT EXISTS _Plan_backup (
|
|
47
|
-
id TEXT PRIMARY KEY,
|
|
48
|
-
name TEXT NOT NULL,
|
|
49
|
-
tier TEXT NOT NULL,
|
|
50
|
-
tokensPerWindow INTEGER NOT NULL,
|
|
51
|
-
requestsPerWindow INTEGER NOT NULL,
|
|
52
|
-
durationDays INTEGER NOT NULL,
|
|
53
|
-
displayMultiplier REAL DEFAULT 1.0,
|
|
54
|
-
minDurationDays INTEGER DEFAULT 0,
|
|
55
|
-
maxDurationDays INTEGER DEFAULT -1,
|
|
56
|
-
isActive INTEGER DEFAULT 1,
|
|
57
|
-
createdAt TEXT NOT NULL,
|
|
58
|
-
updatedAt TEXT NOT NULL,
|
|
59
|
-
createdByAdminId TEXT,
|
|
60
|
-
adminsAllowed TEXT DEFAULT '[]'
|
|
61
|
-
)
|
|
62
|
-
`);
|
|
63
|
-
|
|
64
|
-
// Copy data with cleaned integers
|
|
65
|
-
for (const row of plans.rows) {
|
|
66
|
-
const cleaned = parseInt(String(row.tokensPerWindow).replace('.0', ''));
|
|
67
|
-
await db.execute({
|
|
68
|
-
sql: `INSERT OR REPLACE INTO _Plan_backup
|
|
69
|
-
(id, name, tier, tokensPerWindow, requestsPerWindow, durationDays,
|
|
70
|
-
displayMultiplier, minDurationDays, maxDurationDays, isActive,
|
|
71
|
-
createdAt, updatedAt, createdByAdminId, adminsAllowed)
|
|
72
|
-
SELECT
|
|
73
|
-
id, name, tier, ?, requestsPerWindow, durationDays,
|
|
74
|
-
displayMultiplier, minDurationDays, maxDurationDays, isActive,
|
|
75
|
-
createdAt, updatedAt, createdByAdminId, adminsAllowed
|
|
76
|
-
FROM Plan WHERE id = ?`,
|
|
77
|
-
args: [isNaN(cleaned) ? 500000 : cleaned, row.id]
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Drop old table and rename backup
|
|
82
|
-
await db.execute("DROP TABLE Plan");
|
|
83
|
-
await db.execute("ALTER TABLE _Plan_backup RENAME TO Plan");
|
|
84
|
-
|
|
85
|
-
// Step 4: Verify
|
|
86
|
-
const verify = await db.execute("SELECT id, name, tokensPerWindow, typeof(tokensPerWindow) as type FROM Plan");
|
|
87
|
-
console.log('\nVerification - Plan.tokensPerWindow after migration:');
|
|
88
|
-
for (const row of verify.rows) {
|
|
89
|
-
console.log(` ${row.name}: ${row.tokensPerWindow} (type: ${row.type})`);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
console.log('\nMigration complete!');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
migrate().catch(err => {
|
|
96
|
-
console.error('Migration failed:', err);
|
|
97
|
-
process.exit(1);
|
|
98
|
-
});
|