Skip to content

Add OpenID agent prompt dock, session mint, and Google sign-in - #5

Draft
Hewlbern wants to merge 2 commits into
mainfrom
cursor/agent-prompt-google-signin-2792
Draft

Add OpenID agent prompt dock, session mint, and Google sign-in#5
Hewlbern wants to merge 2 commits into
mainfrom
cursor/agent-prompt-google-signin-2792

Conversation

@Hewlbern

@Hewlbern Hewlbern commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Mirrors the megabot agent-prompt + Google sign-in shape on askclaw.xyz, adapted for Solid/OpenID (no robot-workshop semantics).

Agent APIs

  • GET /api/agent/prompt{ prompt, docs, mint, auth } — DingCAD-style brief with Authorization: Bearer <TOKEN>. Does not mint. CORS *.
  • POST /api/agent/session — signed-in browser only. Remints a ~30m user-scoped JWT when AGENT_JWT_SECRET (or an existing Spark/Solid HMAC) is set; otherwise embeds the session access token. Never a service-role key. Clipboard text includes the real Bearer.
  • GET /llms.txt — agent-facing docs (MCP tools, recipe, Google, yellow dock).

Auth header for private APIs: Authorization: Bearer <TOKEN>.

Copy dock

Yellow PROMPT chip (megabot LibraryPromptDock / AgentPromptDock shape) on /, /app, and /dashboard:

  • Preview always masks tokens as <TOKEN>.
  • Signed-out Copy → opens sign-in, no mint.
  • Signed-in Copy → POST /api/agent/session and writes the full prompt to the clipboard.
  • On 401, ask the human to copy a fresh prompt.

/app also keeps the in-page walk-card as a second copy surface.

Google OAuth (not Supabase)

Equivalent of megabot signInWithOAuth({ provider: 'google' }) + /auth/callback:

  • Start: GET /api/auth/google (alias /auth/google)
  • Callback: GET /auth/callback → session on /app
  • Pod link: POST /idp/google (Railway; existing email accounts need that deploy)
  • New Google emails can still register via the Vercel derived-password fallback until Railway is live

Create a new Web client in GCP dreammachina. Do not edit megabot’s Supabase client.

Redirect URIs:

  • https://askclaw.xyz/auth/callback
  • https://identity-two-plum.vercel.app/auth/callback
  • http://localhost:3000/auth/callback

Vercel identity: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, optional AGENT_JWT_SECRET, OPENID_PUBLIC_URL=https://askclaw.xyz.

Agent recipe (Codex / Cursor)

  1. Human signs in on /app and copies the prompt (remints).
  2. Agent must not call POST /api/agent/session.
  3. Authorization: Bearer <token> on /mcp and /api/spark-conversations.
  4. spark_save_conversation with full transcript + source (codex|cursor|claude|grok|gemini-spark).
  5. Sequential single-op. On 401, ask the human to remint.

Existing spark_* MCP tools and 30-day Spark connect tokens are unchanged. Handle + password login stays.

Open in Web Open in Cursor 

Mirror megabot’s prompt+session pattern for Solid/OpenID: public
GET /llms.txt and /api/agent/prompt, signed-in POST /api/agent/session
that remints a short-lived spark-mcp Bearer, and a /app copy dock so
Codex/Cursor traces can land in conversations/spark/.

Add Continue with Google beside handle login. Vercel runs the OAuth
dance; Railway POST /idp/google verifies the ID token and mints the
same WebID session. Existing Spark MCP save/list/share paths stay.

Co-authored-by: audacity <Hewlbern@users.noreply.github.com>
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
identity Ready Ready Preview Sep 10, 2026 6:30am UTC

Public GET /api/agent/prompt now returns a DingCAD-style brief with a
<TOKEN> placeholder and does not mint. Signed-in POST /api/agent/session
issues a ~30m user-scoped JWT when AGENT_JWT_SECRET (or an existing Spark
secret) is set, otherwise it embeds the session access token. The yellow
PROMPT chip copies that brief; signed-out Copy opens sign-in. Google OAuth
lands on /auth/callback.

Co-authored-by: audacity <Hewlbern@users.noreply.github.com>
@cursor cursor Bot changed the title Add OpenID agent prompt dock and Google sign-in Add OpenID agent prompt dock, session mint, and Google sign-in Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants