feat(chat): add support action cards and live entitlements

This commit is contained in:
Codex
2026-07-24 17:59:57 +08:00
parent d746d04503
commit ff2759cf0f
52 changed files with 1151 additions and 40 deletions
@@ -0,0 +1,28 @@
"use client";
import { useEffect } from "react";
import { usePathname } from "next/navigation";
import {
clearPendingChatActionArrival,
readPendingChatActionArrival,
recordChatActionEventById,
} from "@/lib/chat/chat_action_events";
export function ChatActionArrivalTracker() {
const pathname = usePathname();
useEffect(() => {
const pending = readPendingChatActionArrival();
if (!pending || pathname !== pending.expectedPath) return;
void recordChatActionEventById(
pending.actionId,
pending.characterId,
"arrived",
)
.then(() => clearPendingChatActionArrival())
.catch(() => undefined);
}, [pathname]);
return null;
}