@flame0510/project-aether 1.1.12 → 1.1.14
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 +4 -1
- package/app/agents/PageClient.tsx +140 -34
- package/app/agents/create/PageClient.tsx +11 -4
- package/app/api/agents/[id]/recreate/route.ts +3 -3
- package/app/api/agents/[id]/route.ts +3 -1
- package/app/api/agents/channels-summary/route.ts +48 -17
- package/app/api/agents/create/route.ts +32 -13
- package/app/api/agents/download-image/route.ts +2 -0
- package/app/api/agents/image-status/route.ts +94 -85
- package/app/api/agents/route.ts +10 -53
- package/app/api/agents/token/route.ts +4 -1
- package/app/api/auth/check/route.ts +2 -23
- package/app/api/auth/login/route.ts +3 -35
- package/app/api/auth/logout/route.ts +1 -1
- package/app/api/auth/status/route.ts +2 -21
- package/app/api/config/env/route.ts +7 -3
- package/app/api/config/restart/route.ts +2 -0
- package/app/api/containers/route.ts +3 -34
- package/app/api/crons/route.ts +2 -0
- package/app/api/debug/route.ts +2 -0
- package/app/api/envcheck/route.ts +3 -1
- package/app/api/gateway/agent/route.ts +8 -6
- package/app/api/gateway/provider/route.ts +43 -5
- package/app/api/gateway/route.ts +104 -136
- package/app/api/gateway/sync.ts +12 -15
- package/app/api/models/route.ts +2 -0
- package/app/api/provider/upstream.ts +12 -3
- package/app/api/setup/agent-image/route.ts +8 -3
- package/app/api/setup/password/route.ts +32 -37
- package/app/api/setup/restart/route.ts +8 -2
- package/app/api/skills/delete/route.js +1 -1
- package/app/api/skills/promote/route.js +1 -1
- package/app/api/skills/route.js +89 -97
- package/app/api/skills/save/route.js +18 -5
- package/app/api/update-check/route.ts +4 -23
- package/app/api/wizard/complete/route.ts +7 -3
- package/app/api/wizard/reset/route.ts +8 -3
- package/app/api/wizard/status/route.ts +8 -5
- package/app/components/AuthGuard.tsx +29 -8
- package/app/components/Skeleton.tsx +71 -0
- package/app/components/ui/ModalityIcons.tsx +157 -0
- package/app/components/ui/index.ts +1 -0
- package/app/crons/PageClient.tsx +32 -7
- package/app/gateway/PageClient.tsx +104 -16
- package/bin/rev4a.js +35 -24
- package/docs/ARCHITECTURE.md +31 -14
- package/docs/FRONTEND-ARCHITECTURE.md +1 -0
- package/docs/REV4A.md +36 -6
- package/docs/dev/API-REFERENCE.md +13 -8
- package/docs/dev/GATEWAY.md +42 -1
- package/docs/dev/PROVIDERS.md +4 -3
- package/docs/rag/REV4A-OVERVIEW.md +1 -1
- package/instrumentation.ts +18 -0
- package/lib/agent-setup.ts +8 -9
- package/lib/buildAgentImage.ts +5 -1
- package/lib/channelManager.ts +23 -16
- package/lib/db.ts +0 -10
- package/lib/docker-exec.ts +195 -0
- package/lib/docker-socket.ts +121 -0
- package/lib/docker-utils.ts +22 -48
- package/lib/openclaw-cron.ts +81 -48
- package/lib/openrouter-pricing.ts +184 -0
- package/lib/rev4a-auth.d.ts +4 -1
- package/lib/rev4a-auth.js +68 -20
- package/lib/rev4a-paths.ts +19 -0
- package/model-pricing.json +50 -50
- package/models.config.json +2 -2
- package/package.json +4 -1
- package/proxy.ts +68 -0
- package/scripts/refresh-model-pricing.mjs +171 -0
- package/lib/auth.ts +0 -28
- package/lib/requireAuth.tsx +0 -38
package/lib/requireAuth.tsx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { cookies } from 'next/headers';
|
|
2
|
-
import { redirect } from 'next/navigation';
|
|
3
|
-
import { jwtVerify } from 'jose';
|
|
4
|
-
import * as fs from 'fs';
|
|
5
|
-
import { ENV_FILE } from './rev4a-paths';
|
|
6
|
-
|
|
7
|
-
function getJwtSecret(): Uint8Array {
|
|
8
|
-
const fromEnv = process.env.REV4A_JWT_SECRET;
|
|
9
|
-
if (typeof fromEnv === 'string' && fromEnv.length > 0) {
|
|
10
|
-
return new TextEncoder().encode(fromEnv);
|
|
11
|
-
}
|
|
12
|
-
// Fallback: read from persistent .env
|
|
13
|
-
try {
|
|
14
|
-
if (fs.existsSync(ENV_FILE)) {
|
|
15
|
-
const content = fs.readFileSync(ENV_FILE, 'utf-8');
|
|
16
|
-
const match = content.match(/^REV4A_JWT_SECRET=(.*)$/m);
|
|
17
|
-
if (match && match[1].trim()) {
|
|
18
|
-
return new TextEncoder().encode(match[1].trim());
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
} catch { /* ignore */ }
|
|
22
|
-
return new TextEncoder().encode('');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export async function requireAuth(): Promise<void> {
|
|
26
|
-
const cookieStore = await cookies();
|
|
27
|
-
const token = cookieStore.get('rev4a_token')?.value;
|
|
28
|
-
|
|
29
|
-
if (token) {
|
|
30
|
-
try {
|
|
31
|
-
await jwtVerify(token, getJwtSecret());
|
|
32
|
-
return;
|
|
33
|
-
} catch {
|
|
34
|
-
// Invalid — redirect
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
redirect('/login');
|
|
38
|
-
}
|