Files
PaperClipAI/packages/db/src/migrations/0319_heavy_captain_midlands.sql
T
DottaandPaperclip 2b4a1d7073 feat(dot): add guided invitations and persistent agent connections (#15581)
Add guided external-agent invitations with live Dot connection checks and ongoing access until revoked. Keep expired credentials invalid and enforce permissions for private avatar uploads. Preserve Runner recovery and remote launch boundaries.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-08 16:26:41 -05:00

16 lines
644 B
SQL

ALTER TABLE "mcp_oauth_tokens" ALTER COLUMN "expires_at" DROP NOT NULL;
--> statement-breakpoint
-- Active Dot connections keep working without another consent flow. Expired
-- or consumed credentials stay invalid, revoked grants stay revoked, and
-- personal assistant connections retain their expiry.
UPDATE "mcp_oauth_tokens" AS tokens
SET "expires_at" = NULL
FROM "mcp_oauth_grants" AS grants
WHERE tokens."grant_id" = grants."id"
AND tokens."kind" = 'refresh'
AND tokens."used_at" IS NULL
AND tokens."expires_at" > now()
AND grants."purpose" = 'agent'
AND grants."resource" LIKE '%/mcp/runner'
AND grants."revoked_at" IS NULL;