@flame0510/project-aether 1.1.9
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 +150 -0
- package/agent-templates/README.md +37 -0
- package/agent-templates/argus/AGENTS.md +52 -0
- package/agent-templates/argus/IDENTITY.md +7 -0
- package/agent-templates/argus/MEMORY.md +9 -0
- package/agent-templates/argus/SOUL.md +24 -0
- package/agent-templates/argus/TOOLS.md +8 -0
- package/agent-templates/atlas/AGENTS.md +47 -0
- package/agent-templates/atlas/HEARTBEAT.md +10 -0
- package/agent-templates/atlas/IDENTITY.md +6 -0
- package/agent-templates/atlas/MEMORY.md +9 -0
- package/agent-templates/atlas/SOUL.md +21 -0
- package/agent-templates/atlas/TOOLS.md +4 -0
- package/agent-templates/base-image/.trigger +0 -0
- package/agent-templates/base-image/Dockerfile +90 -0
- package/agent-templates/base-image/entrypoint.sh +37 -0
- package/agent-templates/custom/AGENTS.md +29 -0
- package/agent-templates/custom/BOOTSTRAP.md +56 -0
- package/agent-templates/custom/MEMORY.md +8 -0
- package/agent-templates/prometheus/AGENTS.md +37 -0
- package/agent-templates/prometheus/IDENTITY.md +6 -0
- package/agent-templates/prometheus/MEMORY.md +9 -0
- package/agent-templates/prometheus/SOUL.md +21 -0
- package/agent-templates/prometheus/TOOLS.md +4 -0
- package/app/agents/ChannelManager.tsx +465 -0
- package/app/agents/ImageDownloadBanner.tsx +159 -0
- package/app/agents/PageClient.tsx +1285 -0
- package/app/agents/create/PageClient.tsx +437 -0
- package/app/agents/create/page.tsx +126 -0
- package/app/agents/loading.tsx +14 -0
- package/app/agents/page.tsx +5 -0
- package/app/api/agents/[id]/backup/route.ts +169 -0
- package/app/api/agents/[id]/channels/pairing/route.ts +69 -0
- package/app/api/agents/[id]/channels/route.ts +14 -0
- package/app/api/agents/[id]/channels/telegram/route.ts +50 -0
- package/app/api/agents/[id]/lifecycle/route.ts +94 -0
- package/app/api/agents/[id]/recreate/route.ts +199 -0
- package/app/api/agents/[id]/restart/route.ts +33 -0
- package/app/api/agents/[id]/restore/route.ts +81 -0
- package/app/api/agents/[id]/route.ts +280 -0
- package/app/api/agents/channels-summary/route.ts +39 -0
- package/app/api/agents/config-json/route.ts +58 -0
- package/app/api/agents/create/route.ts +488 -0
- package/app/api/agents/download-image/route.ts +32 -0
- package/app/api/agents/image-status/route.ts +126 -0
- package/app/api/agents/route.ts +213 -0
- package/app/api/agents/token/route.ts +94 -0
- package/app/api/agents-active/route.ts +190 -0
- package/app/api/agents-config/route.ts +629 -0
- package/app/api/alerts/smoke/route.ts +26 -0
- package/app/api/aliases/add/route.ts +28 -0
- package/app/api/aliases/remove/route.ts +27 -0
- package/app/api/assistant/route.ts +204 -0
- package/app/api/auth/check/route.ts +38 -0
- package/app/api/auth/login/route.ts +85 -0
- package/app/api/auth/logout/route.ts +7 -0
- package/app/api/auth/status/route.ts +33 -0
- package/app/api/config/env/route.ts +132 -0
- package/app/api/config/restart/route.ts +26 -0
- package/app/api/containers/route.ts +75 -0
- package/app/api/cost-override/route.ts +46 -0
- package/app/api/costs/route.ts +84 -0
- package/app/api/credentials/[id]/reveal/route.ts +21 -0
- package/app/api/credentials/[id]/route.ts +52 -0
- package/app/api/credentials/[id]/sync/route.ts +58 -0
- package/app/api/credentials/detect/route.ts +246 -0
- package/app/api/credentials/route.ts +33 -0
- package/app/api/crons/[id]/route.ts +69 -0
- package/app/api/crons/route.ts +12 -0
- package/app/api/crons/runs/route.ts +31 -0
- package/app/api/debug/route.ts +11 -0
- package/app/api/envcheck/route.ts +18 -0
- package/app/api/events/route.ts +24 -0
- package/app/api/gateway/agent/route.ts +154 -0
- package/app/api/gateway/provider/balance/route.ts +38 -0
- package/app/api/gateway/provider/keys.ts +38 -0
- package/app/api/gateway/provider/oauth/route.ts +304 -0
- package/app/api/gateway/provider/route.ts +209 -0
- package/app/api/gateway/route.ts +223 -0
- package/app/api/gateway/sync.ts +189 -0
- package/app/api/lineage/route.ts +54 -0
- package/app/api/memory-context/route.ts +15 -0
- package/app/api/metrics/route.ts +35 -0
- package/app/api/models/route.ts +77 -0
- package/app/api/plugins/route.js +37 -0
- package/app/api/provider/upstream.ts +142 -0
- package/app/api/provider/v1/chat/completions/route.ts +146 -0
- package/app/api/provider/v1/models/route.ts +167 -0
- package/app/api/provider-usage/route.ts +629 -0
- package/app/api/session/route.ts +39 -0
- package/app/api/sessions/[id]/route.ts +38 -0
- package/app/api/sessions/route.ts +23 -0
- package/app/api/setup/agent-image/route.ts +102 -0
- package/app/api/setup/password/route.ts +111 -0
- package/app/api/setup/restart/route.ts +76 -0
- package/app/api/skills/delete/route.js +105 -0
- package/app/api/skills/promote/route.js +129 -0
- package/app/api/skills/route.js +203 -0
- package/app/api/skills/save/route.js +142 -0
- package/app/api/stats/route.ts +34 -0
- package/app/api/stats-since/route.ts +20 -0
- package/app/api/stream/route.ts +70 -0
- package/app/api/system-health/route.ts +233 -0
- package/app/api/tool-calls/route.ts +24 -0
- package/app/api/tools-config/route.ts +163 -0
- package/app/api/update-check/route.ts +127 -0
- package/app/api/version/route.ts +25 -0
- package/app/api/wizard/complete/route.ts +32 -0
- package/app/api/wizard/reset/route.ts +28 -0
- package/app/api/wizard/status/route.ts +28 -0
- package/app/api/workspace/route.ts +392 -0
- package/app/api/workspace/stream/route.ts +136 -0
- package/app/components/AppShell.tsx +33 -0
- package/app/components/AuthGuard.tsx +91 -0
- package/app/components/CostBreakdown.tsx +37 -0
- package/app/components/DashboardHeader.tsx +73 -0
- package/app/components/DashboardLayout.tsx +76 -0
- package/app/components/DashboardToolbar.tsx +61 -0
- package/app/components/FloatingActions.tsx +33 -0
- package/app/components/Icons.tsx +78 -0
- package/app/components/LineageGraphPage.tsx +142 -0
- package/app/components/LiveFeed.tsx +48 -0
- package/app/components/MobileBottomNav.tsx +84 -0
- package/app/components/ModelPickerModal.tsx +94 -0
- package/app/components/PasswordInput.tsx +86 -0
- package/app/components/PulseChat.tsx +362 -0
- package/app/components/Rev4aLoader.tsx +48 -0
- package/app/components/SessionDrawer.tsx +263 -0
- package/app/components/SessionTopology.tsx +289 -0
- package/app/components/Sidebar.tsx +294 -0
- package/app/components/Skeleton.tsx +133 -0
- package/app/components/SystemCockpit.tsx +169 -0
- package/app/components/VersionBanner.tsx +105 -0
- package/app/components/WizardButton.tsx +30 -0
- package/app/components/ui/Badge.tsx +30 -0
- package/app/components/ui/Button.tsx +59 -0
- package/app/components/ui/ConfirmModal.tsx +46 -0
- package/app/components/ui/FilterBar.tsx +33 -0
- package/app/components/ui/Input.tsx +25 -0
- package/app/components/ui/ItemList.tsx +83 -0
- package/app/components/ui/LoadingSpinner.tsx +30 -0
- package/app/components/ui/Metric.tsx +22 -0
- package/app/components/ui/Modal.tsx +42 -0
- package/app/components/ui/Page.tsx +18 -0
- package/app/components/ui/Pill.tsx +6 -0
- package/app/components/ui/PropertyList.tsx +24 -0
- package/app/components/ui/Select.tsx +26 -0
- package/app/components/ui/StatusCard.tsx +32 -0
- package/app/components/ui/Surface.tsx +14 -0
- package/app/components/ui/Tabs.tsx +55 -0
- package/app/components/ui/TemplateOption.tsx +59 -0
- package/app/components/ui/Toast.tsx +44 -0
- package/app/components/ui/index.ts +19 -0
- package/app/components/ui/tokens.ts +18 -0
- package/app/config/PageClient.tsx +293 -0
- package/app/config/loading.tsx +10 -0
- package/app/config/page.tsx +7 -0
- package/app/containers/ContainersClient.tsx +129 -0
- package/app/containers/loading.tsx +21 -0
- package/app/containers/page.tsx +5 -0
- package/app/containers/terminal/[id]/TerminalClient.tsx +313 -0
- package/app/containers/terminal/[id]/page.tsx +6 -0
- package/app/credentials/PageClient.tsx +598 -0
- package/app/credentials/loading.tsx +10 -0
- package/app/credentials/page.tsx +7 -0
- package/app/crons/PageClient.tsx +538 -0
- package/app/crons/loading.tsx +10 -0
- package/app/crons/page.tsx +5 -0
- package/app/design-system.ts +57 -0
- package/app/gateway/PageClient.tsx +1048 -0
- package/app/gateway/loading.tsx +24 -0
- package/app/gateway/page.tsx +5 -0
- package/app/globals.css +1474 -0
- package/app/layout.tsx +45 -0
- package/app/lib/models-context.tsx +41 -0
- package/app/lineage/loading.tsx +10 -0
- package/app/lineage/page.tsx +13 -0
- package/app/loading.tsx +16 -0
- package/app/login/page.tsx +160 -0
- package/app/memory/MemoryContextPageClient.tsx +196 -0
- package/app/memory/loading.tsx +10 -0
- package/app/memory/page.tsx +8 -0
- package/app/page.tsx +31 -0
- package/app/plugins/PageClient.tsx +296 -0
- package/app/plugins/loading.tsx +10 -0
- package/app/plugins/page.tsx +5 -0
- package/app/setup/PageClient.tsx +227 -0
- package/app/setup/loading.tsx +21 -0
- package/app/setup/page.tsx +7 -0
- package/app/skills/PageClient.tsx +499 -0
- package/app/skills/loading.tsx +10 -0
- package/app/skills/page.tsx +5 -0
- package/app/tools/ToolsPageClient.tsx +308 -0
- package/app/tools/loading.tsx +10 -0
- package/app/tools/page.tsx +62 -0
- package/app/tools/tools-catalog.ts +141 -0
- package/app/wizard/PageClient.tsx +485 -0
- package/app/wizard/icons.tsx +89 -0
- package/app/wizard/loading.tsx +24 -0
- package/app/wizard/page.tsx +7 -0
- package/app/wizard/storage.ts +33 -0
- package/app/wizard/useWizard.ts +101 -0
- package/app/workspace/WorkspaceClient.tsx +633 -0
- package/app/workspace/loading.tsx +36 -0
- package/app/workspace/page.tsx +8 -0
- package/bin/docker-entrypoint.sh +21 -0
- package/bin/postinstall.js +20 -0
- package/bin/rev4a.js +696 -0
- package/daemon.js +783 -0
- package/docs/ARCHITECTURE.md +557 -0
- package/docs/CONTAINER-TERMINAL.md +280 -0
- package/docs/DESIGN-SYSTEM.md +99 -0
- package/docs/FRONTEND-ARCHITECTURE.md +119 -0
- package/docs/REV4A.md +504 -0
- package/docs/dev/API-REFERENCE.md +1835 -0
- package/docs/dev/DATABASE.md +224 -0
- package/docs/dev/GATEWAY.md +300 -0
- package/docs/dev/PROVIDERS.md +229 -0
- package/docs/dev/SESSION-MAINTENANCE-PLAN.md +607 -0
- package/docs/dev/WORKSPACE.md +199 -0
- package/docs/rag/DATA-FRESHNESS.md +109 -0
- package/docs/rag/GLOSSARY.md +125 -0
- package/docs/rag/REV4A-OVERVIEW.md +135 -0
- package/docs/rag/WHAT-I-CAN-ANSWER.md +124 -0
- package/lib/agent-setup.ts +130 -0
- package/lib/alerts.ts +115 -0
- package/lib/apiFetch.ts +7 -0
- package/lib/auth.ts +28 -0
- package/lib/billing.ts +100 -0
- package/lib/buildAgentImage.ts +346 -0
- package/lib/channelManager.ts +386 -0
- package/lib/container.ts +60 -0
- package/lib/credentials/db.ts +86 -0
- package/lib/credentials/delivery.ts +448 -0
- package/lib/credentials/detect.ts +149 -0
- package/lib/credentials/hash.ts +9 -0
- package/lib/credentials/providers.ts +110 -0
- package/lib/credentials/vault.ts +195 -0
- package/lib/db-bootstrap.d.ts +3 -0
- package/lib/db-bootstrap.mjs +144 -0
- package/lib/db.ts +25 -0
- package/lib/docker-utils.ts +60 -0
- package/lib/hooks/useDashboard.ts +264 -0
- package/lib/hooks/useRev4aTimezone.ts +28 -0
- package/lib/hooks/useScreenshot.ts +30 -0
- package/lib/memory-context.ts +385 -0
- package/lib/model-catalogue.ts +131 -0
- package/lib/model-pricing.ts +63 -0
- package/lib/openclaw-cron.ts +350 -0
- package/lib/patterns/ApiAdapter.ts +73 -0
- package/lib/patterns/ApiClient.ts +65 -0
- package/lib/patterns/EventBus.ts +113 -0
- package/lib/patterns/FilterStrategy.ts +79 -0
- package/lib/patterns/SessionFactory.ts +117 -0
- package/lib/patterns/sessionPresentation.ts +117 -0
- package/lib/provider-balance.ts +163 -0
- package/lib/requireAuth.tsx +38 -0
- package/lib/rev4a-auth.d.ts +3 -0
- package/lib/rev4a-auth.js +36 -0
- package/lib/rev4a-paths.ts +145 -0
- package/lib/timezone.ts +46 -0
- package/lib/types/index.ts +96 -0
- package/lib/utils/format.ts +82 -0
- package/lineage.js +56 -0
- package/model-pricing.json +482 -0
- package/models.config.json +844 -0
- package/next-env.d.ts +6 -0
- package/next.config.mjs +7 -0
- package/package.json +82 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-64.png +0 -0
- package/public/favicon.svg +58 -0
- package/public/icon-192-maskable.png +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512-maskable.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/manifest.json +38 -0
- package/public/rev4a-logo.png +0 -0
- package/public/rev4a-logo.svg +58 -0
- package/rev4a-rules/AGENTS.md +37 -0
- package/scripts/add-auth.cjs +185 -0
- package/scripts/backup.sh +66 -0
- package/scripts/check-providers.mjs +143 -0
- package/scripts/docker/traefik/docker-compose.yml +32 -0
- package/scripts/docker/traefik/dynamic/.gitkeep +18 -0
- package/scripts/docker/traefik/traefik.yml +37 -0
- package/scripts/remove-auth-profile.js +56 -0
- package/scripts/restore.sh +82 -0
- package/terminal-ws-server.js +139 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
4
|
+
import { useResponsive } from '../design-system';
|
|
5
|
+
import { Button, Pill, LoadingSpinner } from '../components/ui';
|
|
6
|
+
|
|
7
|
+
type BadgeColor = 'green' | 'red' | 'gray' | 'violet' | 'blue';
|
|
8
|
+
|
|
9
|
+
function Badge({ children, color }: { children: React.ReactNode; color: BadgeColor }) {
|
|
10
|
+
const toneMap: Record<BadgeColor, 'success' | 'danger' | 'neutral' | 'accent' | 'info'> = {
|
|
11
|
+
green: 'success', red: 'danger', gray: 'neutral', violet: 'accent', blue: 'info',
|
|
12
|
+
};
|
|
13
|
+
return <Pill tone={toneMap[color]}>{children}</Pill>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function PanelTitle({ children }: { children: React.ReactNode }) {
|
|
17
|
+
return (
|
|
18
|
+
<div style={{
|
|
19
|
+
padding: '10px 20px',
|
|
20
|
+
fontSize: 10,
|
|
21
|
+
letterSpacing: 2,
|
|
22
|
+
color: 'var(--violet)',
|
|
23
|
+
borderBottom: '1px solid var(--border)',
|
|
24
|
+
background: 'var(--bg2)',
|
|
25
|
+
textTransform: 'uppercase',
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
fontFamily: 'var(--font-mono-stack)',
|
|
28
|
+
}}>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function EmptyState({ message }: { message: string }) {
|
|
35
|
+
return <div className="empty-state">{message}</div>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function ErrorState({ message }: { message: string }) {
|
|
39
|
+
return <div className="error-state">⚠ {message}</div>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function LoadingState() {
|
|
43
|
+
return <LoadingSpinner label="LOADING" compact />;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ─── Plugin type ──────────────────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
interface Plugin {
|
|
49
|
+
id: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
status?: string;
|
|
53
|
+
version?: string;
|
|
54
|
+
origin?: string;
|
|
55
|
+
format?: string;
|
|
56
|
+
source?: string;
|
|
57
|
+
toolNames?: string[];
|
|
58
|
+
channelIds?: string[];
|
|
59
|
+
providerIds?: string[];
|
|
60
|
+
cliBackendIds?: string[];
|
|
61
|
+
hookNames?: string[];
|
|
62
|
+
services?: string[];
|
|
63
|
+
compat?: string[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface RowProps { label: string; value: string; mono?: boolean; small?: boolean; }
|
|
67
|
+
function Row({ label, value, mono, small }: RowProps) {
|
|
68
|
+
return (
|
|
69
|
+
<div style={{ marginBottom: 10 }}>
|
|
70
|
+
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: 'var(--text-dim)', letterSpacing: '0.1em', marginBottom: 2 }}>{label.toUpperCase()}</div>
|
|
71
|
+
<div style={{
|
|
72
|
+
fontFamily: "'JetBrains Mono', monospace",
|
|
73
|
+
fontSize: small ? 10 : 12,
|
|
74
|
+
color: 'var(--text)',
|
|
75
|
+
wordBreak: 'break-all',
|
|
76
|
+
...(mono ? { background: 'var(--bg3)', padding: '4px 8px', borderRadius: 0, border: '1px solid #222228' } : {}),
|
|
77
|
+
}}>
|
|
78
|
+
{value}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default function PluginsPage() {
|
|
85
|
+
const [plugins, setPlugins] = useState<Plugin[]>([]);
|
|
86
|
+
const [loading, setLoading] = useState(true);
|
|
87
|
+
const [error, setError] = useState<string | null>(null);
|
|
88
|
+
const [selected, setSelected] = useState<Plugin | null>(null);
|
|
89
|
+
const [filter, setFilter] = useState('all');
|
|
90
|
+
const [toggling, setToggling] = useState<string | null>(null);
|
|
91
|
+
const [toastMsg, setToastMsg] = useState<string | null>(null);
|
|
92
|
+
const isMobile = useResponsive('lg');
|
|
93
|
+
|
|
94
|
+
const load = useCallback(async (signal?: AbortSignal) => {
|
|
95
|
+
setLoading(true);
|
|
96
|
+
setError(null);
|
|
97
|
+
try {
|
|
98
|
+
const res = await fetch('/api/plugins', { credentials: 'same-origin', signal });
|
|
99
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
100
|
+
const data = await res.json();
|
|
101
|
+
if (!signal?.aborted) setPlugins(data.plugins || []);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
if ((e as Error)?.name === 'AbortError') return;
|
|
104
|
+
if (!signal?.aborted) setError((e as Error).message);
|
|
105
|
+
} finally {
|
|
106
|
+
if (!signal?.aborted) setLoading(false);
|
|
107
|
+
}
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
const controller = new AbortController();
|
|
112
|
+
load(controller.signal);
|
|
113
|
+
return () => controller.abort();
|
|
114
|
+
}, [load]);
|
|
115
|
+
|
|
116
|
+
const filtered = plugins.filter(p => {
|
|
117
|
+
if (filter === 'enabled') return p.enabled;
|
|
118
|
+
if (filter === 'disabled') return !p.enabled;
|
|
119
|
+
return true;
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const showToast = (msg: string) => {
|
|
123
|
+
setToastMsg(msg);
|
|
124
|
+
setTimeout(() => setToastMsg(null), 3000);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const handleToggle = async (plugin: Plugin) => {
|
|
128
|
+
const action = plugin.enabled ? 'disable' : 'enable';
|
|
129
|
+
setToggling(plugin.id);
|
|
130
|
+
try {
|
|
131
|
+
const res = await fetch('/api/plugins', {
|
|
132
|
+
method: 'POST',
|
|
133
|
+
headers: { 'Content-Type': 'application/json' },
|
|
134
|
+
credentials: 'same-origin',
|
|
135
|
+
body: JSON.stringify({ action, pluginId: plugin.id }),
|
|
136
|
+
});
|
|
137
|
+
const data = await res.json();
|
|
138
|
+
if (data.ok) {
|
|
139
|
+
showToast(`Plugin ${plugin.id} ${action}d`);
|
|
140
|
+
await load();
|
|
141
|
+
if (selected?.id === plugin.id) setSelected(p => p ? { ...p, enabled: !p.enabled } : p);
|
|
142
|
+
} else {
|
|
143
|
+
showToast(`Error: ${data.error}`);
|
|
144
|
+
}
|
|
145
|
+
} catch (e) {
|
|
146
|
+
showToast(`Error: ${(e as Error).message}`);
|
|
147
|
+
} finally {
|
|
148
|
+
setToggling(null);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div style={{
|
|
154
|
+
display: 'flex',
|
|
155
|
+
flexDirection: 'column',
|
|
156
|
+
flex: 1,
|
|
157
|
+
background: 'var(--bg)',
|
|
158
|
+
color: 'var(--text)',
|
|
159
|
+
overflow: 'hidden',
|
|
160
|
+
}}>
|
|
161
|
+
<div style={{
|
|
162
|
+
display: 'flex',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
padding: '0 14px',
|
|
165
|
+
height: 48,
|
|
166
|
+
borderBottom: '1px solid var(--border)',
|
|
167
|
+
background: 'var(--bg)',
|
|
168
|
+
flexShrink: 0,
|
|
169
|
+
boxSizing: 'border-box',
|
|
170
|
+
}}>
|
|
171
|
+
<span style={{ fontFamily: 'var(--font-serif-stack)', fontSize: '20px', letterSpacing: '4px', color: 'var(--violet)' }}>PLUGINS</span>
|
|
172
|
+
</div>
|
|
173
|
+
<div style={{ flex: 1, display: 'flex', flexDirection: isMobile ? 'column' : 'row', overflow: 'hidden' }}>
|
|
174
|
+
{/* List */}
|
|
175
|
+
<div style={{ width: isMobile ? '100%' : 340, maxHeight: isMobile ? '45%' : '100%', borderRight: isMobile ? 'none' : '1px solid #222228', borderBottom: isMobile ? '1px solid #222228' : 'none', display: 'flex', flexDirection: 'column', overflow: 'hidden' }}>
|
|
176
|
+
{/* Filter bar */}
|
|
177
|
+
<div style={{ padding: '8px 12px', borderBottom: '1px solid #222228', background: 'var(--bg2)', display: 'flex', gap: 6 }}>
|
|
178
|
+
{(['all', 'enabled', 'disabled'] as const).map(f => (
|
|
179
|
+
<Button key={f} variant={filter === f ? 'primary' : 'ghost'} size="sm" onClick={() => setFilter(f)}>
|
|
180
|
+
{f.toUpperCase()}
|
|
181
|
+
</Button>
|
|
182
|
+
))}
|
|
183
|
+
<Button variant="ghost" size="sm" onClick={() => load()} style={{ marginLeft: 'auto' }}>
|
|
184
|
+
⟳
|
|
185
|
+
</Button>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
{/* List body */}
|
|
189
|
+
<div style={{ flex: 1, overflowY: 'auto' }}>
|
|
190
|
+
{loading && <LoadingState />}
|
|
191
|
+
{!loading && error && <ErrorState message={error} />}
|
|
192
|
+
{!loading && !error && filtered.length === 0 && <EmptyState message="no plugins match" />}
|
|
193
|
+
{!loading && !error && filtered.map(p => (
|
|
194
|
+
<div
|
|
195
|
+
key={p.id}
|
|
196
|
+
onClick={() => setSelected(p)}
|
|
197
|
+
style={{
|
|
198
|
+
padding: '10px 14px',
|
|
199
|
+
borderBottom: '1px solid #18181c',
|
|
200
|
+
cursor: 'pointer',
|
|
201
|
+
background: selected?.id === p.id ? 'var(--bg3)' : 'transparent',
|
|
202
|
+
borderLeft: selected?.id === p.id ? '2px solid #925BFC' : '2px solid transparent',
|
|
203
|
+
transition: 'all 0.1s',
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 4 }}>
|
|
207
|
+
<span style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
|
208
|
+
{p.name || p.id}
|
|
209
|
+
</span>
|
|
210
|
+
<Badge color={p.enabled ? 'green' : 'gray'}>{p.status || (p.enabled ? 'enabled' : 'disabled')}</Badge>
|
|
211
|
+
</div>
|
|
212
|
+
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 10, color: 'var(--text-dim)' }}>
|
|
213
|
+
{p.id} {p.version ? `· v${p.version}` : ''}
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
))}
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
{/* Detail */}
|
|
221
|
+
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', overflow: 'hidden' }}>
|
|
222
|
+
{!selected ? (
|
|
223
|
+
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#333', fontFamily: "'JetBrains Mono', monospace", fontSize: 12 }}>
|
|
224
|
+
← select a plugin
|
|
225
|
+
</div>
|
|
226
|
+
) : (
|
|
227
|
+
<>
|
|
228
|
+
<PanelTitle>PLUGIN — {selected.id}</PanelTitle>
|
|
229
|
+
<div style={{ flex: 1, overflowY: 'auto', padding: 20 }}>
|
|
230
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 20 }}>
|
|
231
|
+
<h2 style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 14, color: 'var(--text)', margin: 0 }}>{selected.name || selected.id}</h2>
|
|
232
|
+
<Badge color={selected.enabled ? 'green' : 'gray'}>{selected.status || (selected.enabled ? 'enabled' : 'disabled')}</Badge>
|
|
233
|
+
<Badge color={selected.origin === 'bundled' ? 'blue' : 'violet'}>{selected.origin || 'unknown'}</Badge>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
{selected.version && <Row label="Version" value={selected.version} />}
|
|
237
|
+
<Row label="ID" value={selected.id} />
|
|
238
|
+
<Row label="Format" value={selected.format || '—'} />
|
|
239
|
+
{selected.source && <Row label="Source" value={selected.source} mono small />}
|
|
240
|
+
|
|
241
|
+
{([
|
|
242
|
+
['Tools', selected.toolNames],
|
|
243
|
+
['Channels', selected.channelIds],
|
|
244
|
+
['Providers', selected.providerIds],
|
|
245
|
+
['CLI Backends', selected.cliBackendIds],
|
|
246
|
+
['Hooks', selected.hookNames],
|
|
247
|
+
['Services', selected.services],
|
|
248
|
+
] as [string, string[] | undefined][]).map(([label, arr]) => arr && arr.length > 0 && (
|
|
249
|
+
<div key={label} style={{ marginBottom: 12 }}>
|
|
250
|
+
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: 'var(--text-dim)', letterSpacing: '0.1em', marginBottom: 4 }}>{label.toUpperCase()}</div>
|
|
251
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
|
|
252
|
+
{arr.map(s => <Badge key={s} color="gray">{s}</Badge>)}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
))}
|
|
256
|
+
|
|
257
|
+
{selected.compat && selected.compat.length > 0 && (
|
|
258
|
+
<div style={{ marginBottom: 12 }}>
|
|
259
|
+
<div style={{ fontFamily: "'JetBrains Mono', monospace", fontSize: 9, color: 'var(--text-dim)', letterSpacing: '0.1em', marginBottom: 4 }}>COMPAT</div>
|
|
260
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
|
|
261
|
+
{selected.compat.map(c => <Badge key={c} color="violet">{c}</Badge>)}
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
)}
|
|
265
|
+
|
|
266
|
+
<div style={{ marginTop: 24 }}>
|
|
267
|
+
<Button
|
|
268
|
+
variant={selected.enabled ? 'danger' : 'success'}
|
|
269
|
+
size="sm"
|
|
270
|
+
onClick={() => handleToggle(selected)}
|
|
271
|
+
disabled={toggling === selected.id}
|
|
272
|
+
loading={toggling === selected.id}
|
|
273
|
+
>
|
|
274
|
+
{selected.enabled ? 'DISABLE' : 'ENABLE'}
|
|
275
|
+
</Button>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</>
|
|
279
|
+
)}
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
{toastMsg && (
|
|
283
|
+
<div style={{
|
|
284
|
+
position: 'fixed', bottom: 24, right: 24,
|
|
285
|
+
background: 'var(--bg2)', border: '1px solid #925BFC',
|
|
286
|
+
color: 'var(--text)', fontFamily: "'JetBrains Mono', monospace",
|
|
287
|
+
fontSize: 12, padding: '10px 18px', borderRadius: 0,
|
|
288
|
+
zIndex: 1000,
|
|
289
|
+
}}>
|
|
290
|
+
{toastMsg}
|
|
291
|
+
</div>
|
|
292
|
+
)}
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
);
|
|
296
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Skeleton, CardRowSkeleton } from '../components/Skeleton';
|
|
2
|
+
|
|
3
|
+
const PageSkeleton = () => (
|
|
4
|
+
<div style={{ padding: '24px 20px', maxWidth: 1080, margin: '0 auto' }}>
|
|
5
|
+
<Skeleton width={120} height={20} accent style={{ marginBottom: 20 }} />
|
|
6
|
+
<CardRowSkeleton count={5} height={48} />
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export default PageSkeleton;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { Button } from '../components/ui';
|
|
6
|
+
import { ArrowRightIcon, CheckCircleIcon } from '../wizard/icons';
|
|
7
|
+
|
|
8
|
+
type Step = 'password' | 'done';
|
|
9
|
+
|
|
10
|
+
const STEPS = [
|
|
11
|
+
{ key: 'password' as const, label: 'Password' },
|
|
12
|
+
{ key: 'done' as const, label: 'Done' },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export default function SetupPageClient() {
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
const [step, setStep] = useState<Step>('password');
|
|
18
|
+
const [password, setPassword] = useState('');
|
|
19
|
+
const [passwordError, setPasswordError] = useState('');
|
|
20
|
+
const [saving, setSaving] = useState(false);
|
|
21
|
+
|
|
22
|
+
const stepIndex = STEPS.findIndex((s) => s.key === step);
|
|
23
|
+
|
|
24
|
+
// Redirect if already configured
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
fetch('/api/auth/status')
|
|
27
|
+
.then((r) => r.json())
|
|
28
|
+
.then((d: { configured: boolean }) => {
|
|
29
|
+
if (d.configured) router.replace('/login');
|
|
30
|
+
})
|
|
31
|
+
.catch(() => {});
|
|
32
|
+
}, [router]);
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// ─── Password ─────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
const handleSetPassword = useCallback(async () => {
|
|
39
|
+
if (password.length < 8) {
|
|
40
|
+
setPasswordError('Password must be at least 8 characters');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
setSaving(true);
|
|
44
|
+
setPasswordError('');
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const res = await fetch('/api/setup/password', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
headers: { 'Content-Type': 'application/json' },
|
|
50
|
+
body: JSON.stringify({ password }),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
if (res.ok) {
|
|
54
|
+
// Password saved to .env — login route reads it from file.
|
|
55
|
+
// No restart needed: JWT_SECRET was inlined at build time.
|
|
56
|
+
setSaving(false);
|
|
57
|
+
setStep('done');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const err = await res.json().catch(() => ({ error: 'Unknown error' }));
|
|
62
|
+
setPasswordError(err.error || 'Failed to set password');
|
|
63
|
+
} catch {
|
|
64
|
+
setPasswordError('Network error — please try again');
|
|
65
|
+
}
|
|
66
|
+
setSaving(false);
|
|
67
|
+
}, [password]);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// ─── Done — go straight to login ───────────────────────────────────
|
|
72
|
+
|
|
73
|
+
const handleDone = useCallback(async () => {
|
|
74
|
+
router.push('/login');
|
|
75
|
+
}, [router]);
|
|
76
|
+
|
|
77
|
+
// ─── Render ────────────────────────────────────────────────────────
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div className="setup-outer">
|
|
81
|
+
<div className="setup-card">
|
|
82
|
+
<div className="setup-header">
|
|
83
|
+
<div className="setup-logo">REV4A</div>
|
|
84
|
+
<div className="setup-stepper">
|
|
85
|
+
{STEPS.map((s, i) => (
|
|
86
|
+
<div
|
|
87
|
+
key={s.key}
|
|
88
|
+
className={`setup-step${i < stepIndex ? ' done' : ''}${i === stepIndex ? ' active' : ''}`}
|
|
89
|
+
/>
|
|
90
|
+
))}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div className="setup-body">
|
|
95
|
+
{step === 'password' && (
|
|
96
|
+
<div style={{ display: 'grid', gap: 14 }}>
|
|
97
|
+
<h2 style={{
|
|
98
|
+
fontFamily: 'var(--font-serif-stack)', fontSize: 22, letterSpacing: 1.5,
|
|
99
|
+
color: 'var(--violet)', margin: 0,
|
|
100
|
+
}}>
|
|
101
|
+
Set Admin Password
|
|
102
|
+
</h2>
|
|
103
|
+
<p style={{ fontSize: 12, color: 'var(--text-dim)', lineHeight: 1.6, margin: 0 }}>
|
|
104
|
+
Choose a password to protect your Rev4a dashboard.
|
|
105
|
+
You'll use this to log in as admin.
|
|
106
|
+
</p>
|
|
107
|
+
<input
|
|
108
|
+
type="password"
|
|
109
|
+
placeholder="Minimum 8 characters"
|
|
110
|
+
value={password}
|
|
111
|
+
onChange={(e) => { setPassword(e.target.value); setPasswordError(''); }}
|
|
112
|
+
onKeyDown={(e) => e.key === 'Enter' && handleSetPassword()}
|
|
113
|
+
className="setup-input"
|
|
114
|
+
autoFocus
|
|
115
|
+
/>
|
|
116
|
+
{passwordError && (
|
|
117
|
+
<div style={{
|
|
118
|
+
fontSize: 11, color: '#ef4444', padding: '4px 8px',
|
|
119
|
+
background: 'rgba(239,68,68,0.08)', border: '1px solid rgba(239,68,68,0.2)',
|
|
120
|
+
}}>
|
|
121
|
+
{passwordError}
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: 4 }}>
|
|
125
|
+
<Button variant="primary" size="md" onClick={handleSetPassword} loading={saving}>
|
|
126
|
+
Set Password <ArrowRightIcon />
|
|
127
|
+
</Button>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
)}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
{step === 'done' && (
|
|
135
|
+
<div style={{ display: 'grid', gap: 14, textAlign: 'center' }}>
|
|
136
|
+
<div style={{ margin: '0 auto', display: 'flex', justifyContent: 'center' }}>
|
|
137
|
+
<CheckCircleIcon size={48} color="var(--violet)" />
|
|
138
|
+
</div>
|
|
139
|
+
<h2 style={{
|
|
140
|
+
fontFamily: 'var(--font-serif-stack)', fontSize: 22, letterSpacing: 1.5,
|
|
141
|
+
color: 'var(--violet)', margin: 0,
|
|
142
|
+
}}>
|
|
143
|
+
Ready to Go
|
|
144
|
+
</h2>
|
|
145
|
+
<p style={{ fontSize: 12, color: 'var(--text-dim)', lineHeight: 1.6, margin: 0 }}>
|
|
146
|
+
The essentials are done. After logging in, the setup wizard
|
|
147
|
+
will help you add your first provider and create your first agent.
|
|
148
|
+
</p>
|
|
149
|
+
<div style={{ display: 'grid', gap: 6, textAlign: 'left', padding: '10px 12px', background: 'rgba(52,211,153,0.06)', border: '1px solid rgba(52,211,153,0.15)' }}>
|
|
150
|
+
{[
|
|
151
|
+
'Set admin password',
|
|
152
|
+
'Agent base image is built by the setup script',
|
|
153
|
+
'Next: add providers & agents in the wizard',
|
|
154
|
+
].map((t) => (
|
|
155
|
+
<div key={t} style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 12, color: 'var(--text)' }}>
|
|
156
|
+
<span style={{ color: 'var(--violet)' }}>•</span> {t}
|
|
157
|
+
</div>
|
|
158
|
+
))}
|
|
159
|
+
</div>
|
|
160
|
+
<Button variant="primary" size="md" onClick={handleDone}>
|
|
161
|
+
Start Using Rev4a <ArrowRightIcon />
|
|
162
|
+
</Button>
|
|
163
|
+
</div>
|
|
164
|
+
)}
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<style>{`
|
|
169
|
+
.setup-outer {
|
|
170
|
+
min-height: 100vh; min-height: 100dvh;
|
|
171
|
+
display: flex; align-items: flex-start; justify-content: center;
|
|
172
|
+
background: radial-gradient(circle at top, rgba(146,91,252,0.12), transparent 40%), var(--bg);
|
|
173
|
+
font-family: var(--font-mono-stack);
|
|
174
|
+
padding: 0;
|
|
175
|
+
}
|
|
176
|
+
.setup-card {
|
|
177
|
+
width: 100%;
|
|
178
|
+
background: var(--bg);
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
}
|
|
181
|
+
.setup-header {
|
|
182
|
+
padding: 14px 16px 10px;
|
|
183
|
+
border-bottom: 1px solid var(--border);
|
|
184
|
+
display: flex; flex-direction: column; align-items: center; gap: 8px;
|
|
185
|
+
}
|
|
186
|
+
.setup-logo {
|
|
187
|
+
font-family: var(--font-serif-stack);
|
|
188
|
+
font-size: 20px; letter-spacing: 3px;
|
|
189
|
+
color: var(--violet);
|
|
190
|
+
}
|
|
191
|
+
.setup-stepper {
|
|
192
|
+
display: flex; gap: 6px; align-items: center;
|
|
193
|
+
}
|
|
194
|
+
.setup-step {
|
|
195
|
+
width: 8px; height: 8px;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
background: var(--border);
|
|
198
|
+
opacity: 0.3;
|
|
199
|
+
transition: all 0.2s;
|
|
200
|
+
flex-shrink: 0;
|
|
201
|
+
}
|
|
202
|
+
.setup-step.done { background: var(--violet); opacity: 0.7; }
|
|
203
|
+
.setup-step.active { background: var(--violet); opacity: 1; box-shadow: 0 0 6px rgba(146,91,252,0.5); }
|
|
204
|
+
.setup-body { padding: 16px; }
|
|
205
|
+
.setup-input {
|
|
206
|
+
background: var(--bg); border: 1px solid var(--border);
|
|
207
|
+
color: var(--text); padding: 8px 10px;
|
|
208
|
+
font-size: 12px; font-family: var(--font-mono-stack);
|
|
209
|
+
outline: none; width: 100%; box-sizing: border-box;
|
|
210
|
+
}
|
|
211
|
+
.setup-input:focus { border-color: var(--violet); }
|
|
212
|
+
|
|
213
|
+
@media (min-width: 481px) {
|
|
214
|
+
.setup-outer { align-items: center; padding: 24px; }
|
|
215
|
+
.setup-card {
|
|
216
|
+
width: min(92vw, 480px);
|
|
217
|
+
background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(12,12,12,0.98));
|
|
218
|
+
border: 1px solid var(--border);
|
|
219
|
+
box-shadow: 0 24px 64px rgba(0,0,0,0.42);
|
|
220
|
+
}
|
|
221
|
+
.setup-header { padding: 18px 24px 14px; }
|
|
222
|
+
.setup-body { padding: 20px 24px 24px; }
|
|
223
|
+
}
|
|
224
|
+
`}</style>
|
|
225
|
+
</div>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Skeleton } from '../components/Skeleton';
|
|
2
|
+
|
|
3
|
+
export default function SetupLoading() {
|
|
4
|
+
return (
|
|
5
|
+
<div style={{
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
minHeight: '100vh',
|
|
10
|
+
background: 'var(--bg)',
|
|
11
|
+
}}>
|
|
12
|
+
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 20, maxWidth: 340, width: '100%' }}>
|
|
13
|
+
<Skeleton width={80} height={80} accent variant="circle" />
|
|
14
|
+
<Skeleton width={200} height={28} accent />
|
|
15
|
+
<Skeleton width={300} height={16} />
|
|
16
|
+
<Skeleton width="100%" height={48} style={{ border: '1px solid rgba(255,255,255,0.06)' }} />
|
|
17
|
+
<Skeleton width="100%" height={48} style={{ border: '1px solid rgba(255,255,255,0.06)' }} />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|