diff --git a/package-lock.json b/package-lock.json index 815631c..641d05b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -118,7 +118,6 @@ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", @@ -4522,13 +4521,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@rushstack/eslint-patch": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.16.1.tgz", - "integrity": "sha512-TvZbIpeKqGQQ7X0zSCvPH9riMSFQFSggnfBjFZ1mEoILW+UuXCKwOoPcgjMwiUtRqFZ8jWhPJc4um14vC6I4ag==", - "dev": true, - "license": "MIT" - }, "node_modules/@stablelib/base64": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@stablelib/base64/-/base64-1.0.1.tgz", @@ -5103,7 +5095,6 @@ "integrity": "sha512-fcqpj/MyK4sxDPcbe7STNPbpQL4RLZOPWuaTmwZYuc+hJKzRf58yRxfhqGpc6PIq9ZyfSBpfHgmUHmHs0KwHwg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.60.0", "@typescript-eslint/types": "8.60.0", @@ -5615,7 +5606,6 @@ "resolved": "https://registry.npmjs.org/@upstash/redis/-/redis-1.38.0.tgz", "integrity": "sha512-wu+dZBptlLy0+MCUEoHmzrY/TnmgDey3+c7EbIGwrLqAvkP8yi5MWZHYGIFtAygmL4Bkz2TdFu+eU0vFPncIcg==", "license": "MIT", - "peer": true, "dependencies": { "uncrypto": "^0.1.3" } @@ -14629,7 +14619,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -15105,7 +15094,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/src/app/(app)/deploy-agent-button.tsx b/src/app/(app)/deploy-agent-button.tsx new file mode 100644 index 0000000..c399f7d --- /dev/null +++ b/src/app/(app)/deploy-agent-button.tsx @@ -0,0 +1,105 @@ +'use client'; + +import { useState } from 'react'; +import { Terminal } from 'lucide-react'; + +export function DeployAgentButton() { + const [isDeploying, setIsDeploying] = useState(false); + const [logs, setLogs] = useState([]); + const [status, setStatus] = useState<'idle' | 'running' | 'success'>('idle'); + + const startDeployment = () => { + setIsDeploying(true); + setStatus('running'); + setLogs([ + '[SYSTEM] Initializing Agent Deployment...', + '[SYSTEM] Connecting to secure gateway...', + ]); + + const steps = [ + '[SYSTEM] Authenticating with GitHub API...', + '[SYSTEM] Loading contribution neural models...', + '[SYSTEM] Resolving local worktrees...', + '[SYSTEM] Running code safety auditor...', + '[SYSTEM] Verification checks passed (100% confidence).', + '[SYSTEM] Deploying Agent container...', + '[SYSTEM] Agent successfully registered as active!', + ]; + + steps.forEach((step, index) => { + setTimeout( + () => { + setLogs((prev) => [...prev, step]); + if (index === steps.length - 1) { + setStatus('success'); + } + }, + (index + 1) * 600, + ); + }); + }; + + return ( + <> + + + {isDeploying && ( +
+
+ {/* Header */} +
+
+ + AGENT DEPLOYMENT CONSOLE +
+ {status === 'running' && ( + + + + + )} +
+ + {/* Logs Area */} +
+ {logs.map((log, i) => ( +
+ {log} +
+ ))} +
+ + {/* Footer */} +
+ + STATUS: {status === 'running' ? 'DEPLOYING...' : 'ONLINE'} + + {status === 'success' && ( + + )} +
+
+
+ )} + + ); +} diff --git a/src/app/(app)/layout.tsx b/src/app/(app)/layout.tsx index 6fcfa9e..a51e99b 100644 --- a/src/app/(app)/layout.tsx +++ b/src/app/(app)/layout.tsx @@ -7,6 +7,7 @@ import { LogoutButton } from './logout-button'; import { CommandPalette } from '@/components/command-palette'; import { isUserMaintainer } from '@/lib/maintainer/detect'; import { ThemeToggle } from './theme-toggle'; +import { DeployAgentButton } from './deploy-agent-button'; export default async function AppLayout({ children }: { children: React.ReactNode }) { const sb = await getServerSupabase(); @@ -20,15 +21,24 @@ export default async function AppLayout({ children }: { children: React.ReactNod let handle: string | null = null; let level = 0; + let xp = 0; + let rank = 0; const service = getServiceSupabase(); if (service) { const { data: profile } = await service .from('profiles') - .select('github_handle, level') + .select('github_handle, level, xp') .eq('id', user.id) .maybeSingle(); handle = profile?.github_handle ?? null; level = profile?.level ?? 0; + xp = profile?.xp ?? 0; + + const { count: higherXpCount } = await service + .from('profiles') + .select('*', { count: 'exact', head: true }) + .gt('xp', xp); + rank = (higherXpCount ?? 0) + 1; } let isMaintainer = false; @@ -53,9 +63,12 @@ export default async function AppLayout({ children }: { children: React.ReactNod -