papertrail/components/ClaimInput.tsx
caelum0x 9b91a4a968 feat: connect PaperTrail to Claude Science (MCP connectors, skills) + Google auth
Make PaperTrail plug into Anthropic's Claude Science workbench four ways:
- Remote URL connector: hosted Streamable-HTTP MCP at /api/mcp (45 public tools)
- Local command connector: standalone stdio MCP package under mcp/ (47 tools,
  incl. 2 API-key tools) — @modelcontextprotocol/sdk, calls the live API
- Skills: 8 Claude Science Agent Skills under skills/ (import from GitHub / upload)
- Network: docs to allow-list the API domain for the curl path
- Public /connect page showcasing all four methods (judges can see it, no login)

Also:
- Google OAuth sign-in ("Continue with Google") on login + register, wired to
  GOOGLE_CLIENT_ID/SECRET; users.password_hash now nullable + auth_provider/
  google_sub (migration 0061); password login guards Google-only accounts
- Landing design: center + enlarge the claim input; bigger textarea

tsc clean; app build compiles 362 pages; local MCP smoke-tested end-to-end.
2026-07-10 17:06:04 +03:00

44 lines
1.4 KiB
TypeScript

"use client";
import { useState } from "react";
export function ClaimInput(props: {
onSubmit: (claim: string) => void;
loading: boolean;
}) {
const [value, setValue] = useState("");
return (
<form
onSubmit={(e) => {
e.preventDefault();
if (value.trim().length >= 10) props.onSubmit(value.trim());
}}
className="flex flex-col gap-3"
>
<label htmlFor="claim" className="text-base font-medium text-ink/70">
Paste a clinical trial or study claim
</label>
<textarea
id="claim"
value={value}
onChange={(e) => setValue(e.target.value)}
rows={6}
maxLength={2000}
placeholder='e.g. "Drug X reduced major cardiovascular events by 30% across all adult patients."'
className="w-full rounded-xl border border-ink/15 bg-white p-4 text-base leading-relaxed focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"
/>
<div className="flex items-center justify-between">
<span className="text-xs text-ink/40">{value.length}/2000</span>
<button
type="submit"
disabled={props.loading || value.trim().length < 10}
className="rounded-lg bg-accent px-6 py-3 text-base font-medium text-white disabled:opacity-40"
>
{props.loading ? "Verifying..." : "Verify claim"}
</button>
</div>
</form>
);
}