Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- run: bun run typecheck
- run: bun run check
- run: bun test
- run: bun audit
- run: bun audit --ignore GHSA-gcqx-w48m-w2h4 # deepmerge: no patched release yet, build-time only
- run: bun run build
env:
DATABASE_URL: postgres://hcai:hcai@localhost:55432/hcai
Expand Down
43 changes: 23 additions & 20 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions migrations/postgres/0014_show_agent_notice_again.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- migrate:up
-- The agent notice is now a full-screen one; show it to everyone again.
UPDATE users SET agent_banner_dismissed_at = NULL;

-- migrate:down
-- A dismissal cannot be restored.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,8 @@
"type": "module",
"imports": {
"#lib/*": "./src/lib/*"
},
"overrides": {
"postcss-selector-parser": "^6.1.5"
}
}
61 changes: 45 additions & 16 deletions src/routes/dashboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
let agentBannerDismissed = $state(false);
const showAgentBanner = $derived(!user.agentBannerDismissed && !agentBannerDismissed);

const AGENT_NOTICE_SECONDS = 5;
let secondsLeft = $state(AGENT_NOTICE_SECONDS);
$effect(() => {
if (!showAgentBanner) return;
const timer = setInterval(() => {
secondsLeft -= 1;
if (secondsLeft <= 0) clearInterval(timer);
}, 1000);
return () => clearInterval(timer);
});

let playerTwoBannerDismissed = $state(false);
const showPlayerTwoBanner = $derived(!data.playerTwoBannerDismissed && !playerTwoBannerDismissed);

Expand All @@ -27,6 +38,7 @@
};

const dismissAgentBanner = async () => {
if (secondsLeft > 0) return;
agentBannerDismissed = true;
await fetch("/api/dismiss-agent-banner", { method: "POST" });
};
Expand Down Expand Up @@ -65,22 +77,6 @@
</div>
{/if}

{#if showAgentBanner}
<div class="mt-8 flex gap-3 rounded-lg border border-amber-500/40 bg-amber-500/10 p-4" role="status">
<AlertIcon class="size-5 shrink-0 text-amber-600 dark:text-amber-400" />
<div class="min-w-0 flex-1">
<h3 class="text-sm font-semibold">Not for AI coding agents</h3>
<p class="text-muted-foreground mt-1 text-sm text-pretty">
Hack Club AI cannot be used with AI coding agents like OpenClaw, Claude Code, Cursor, Cline, or any other coding agent.
Requests from these tools will be blocked. Join <code class="font-mono">#hackclub-ai</code> on the Hack Club Slack for updates.
</p>
</div>
<Button variant="ghost" size="icon-sm" class="-m-1 shrink-0" aria-label="Dismiss banner" onclick={dismissAgentBanner}>
<CloseIcon class="size-4" />
</Button>
</div>
{/if}

<div class={showIdvBanner ? "pointer-events-none select-none opacity-30 grayscale" : ""}>
<section class="mt-5" aria-labelledby="usage-heading">
<h2 id="usage-heading" class="sr-only">Usage</h2>
Expand Down Expand Up @@ -167,3 +163,36 @@
</section>
</div>
</div>

{#if showAgentBanner}
<div
class="bg-background/95 fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-6 backdrop-blur-sm"
role="alertdialog"
aria-modal="true"
aria-labelledby="agent-notice-title"
aria-describedby="agent-notice-body"
>
<div class="w-full max-w-2xl rounded-2xl border-2 border-red-500/60 bg-red-500/10 p-8 sm:p-12">
<AlertIcon class="size-16 text-red-600 dark:text-red-400" />
<h2 id="agent-notice-title" class="mt-6 text-4xl font-bold tracking-tight text-balance sm:text-5xl">
AI coding agents are NOT allowed
</h2>
<div id="agent-notice-body" class="mt-6 space-y-4 text-lg text-pretty">
<p>
Do <strong>not</strong> use Hack Club AI with coding agents like OpenClaw, Claude Code, Cursor, Cline, Codex, OpenCode or any
other coding agent. Requests from these tools are blocked, and your account can be banned.
</p>
<p class="text-muted-foreground">
General agents are fine, as long as <strong>you code them yourself</strong>: your own bot, your own tools, your own loop.
Just don't point a ready-made coding agent at this API.
</p>
<p class="text-muted-foreground">
Questions? Join <code class="font-mono">#hackclub-ai</code> on the Hack Club Slack.
</p>
</div>
<Button size="lg" class="mt-8 w-full sm:w-auto" disabled={secondsLeft > 0} onclick={dismissAgentBanner}>
{secondsLeft > 0 ? `I understand (${secondsLeft})` : "I understand"}
</Button>
</div>
</div>
{/if}
Loading