Files
infiplot-web/package.json
T
Kai ki 610dba78b7 feat(persistence): local-first story persistence (IndexedDB + Supabase skeleton)
Remove Cloudflare D1 entirely (4 API routes, lib/db/, Drizzle config/migrations,
drizzle-orm/drizzle-kit deps, wrangler D1/R2/KV bindings) and replace with
browser-local-first architecture:

Open-source build (IndexedDB, no auth):
- lib/persistence/ 5-file module: types, idb adapter (zero-dep, fault-tolerant,
  post-open invalidation retry), localStore (CRUD + sync-reserved metadata +
  slim/rebuild + retention-cap eviction with tombstone reap + sync-state
  protection + last-resort bounded fallback), sessionSlim (voice strip +
  styleRef absent-delete), cloudStore (Supabase skeleton, server-only)
- Autosave: persistence fingerprint (history.length:lastBeatCount:playerName),
  serial saveChain, failure rollback retry, replaySourceRef guard (prevents
  replayed shared stories from clobbering user saves)
- clientStoryPersistence.ts: thin facade (SaveResult discriminated union)
- Stories page: /[locale]/stories with 3-language i18n (zh-CN/en/ja)
- Homepage: book icon entry point in header

Commercial build (Supabase, skeleton only):
- Single table public.stories (JSONB + RLS 4 policies on auth.uid()=user_id)
- supabase/migrations/ DDL (idempotent)
- cloudStore.ts server-only repository, AUTH_ENABLED short-circuit
- Not wired to client this phase

Featured stories: pure fallback (buildFallbackCards + localizeCards), no D1

Includes fixes from 3 rounds of subagent code-review (tasks 16-30):
- CR1: autosave restructure, coerceOrientation, D1 comment cleanup
- CR2: fingerprint+serial+rollback+replay guard, idb post-open retry,
  enforceRetentionCap latent defense, sessionSlim absent invariant
- CR3: single-scene share guard (replaySourceRef), insert-beat fingerprint
  (beats.length), pass3 overflow double-count fix, detach gate unification
2026-06-25 18:19:08 +08:00

51 lines
1.4 KiB
JSON

{
"name": "infiplot",
"version": "0.1.0",
"private": true,
"type": "module",
"description": "AI 实时交互剧情游戏",
"license": "AGPL-3.0-only",
"packageManager": "pnpm@9.12.0",
"engines": {
"node": ">=22"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"typecheck": "tsc --noEmit",
"enrich:firstacts": "node scripts/enrich-firstacts-stepfun.mjs",
"build:cf": "cross-env BUILD_STANDALONE=true next build --webpack && opennextjs-cloudflare build --skipNextBuild",
"preview:cf": "opennextjs-cloudflare preview",
"deploy:cf": "opennextjs-cloudflare deploy"
},
"dependencies": {
"@fortawesome/fontawesome-free": "6.5.1",
"@supabase/ssr": "^0.12",
"@supabase/supabase-js": "^2.108",
"jsonrepair": "^3.14.0",
"jszip": "^3.10.1",
"next": "^16.0.0",
"openai": "^6.42.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"server-only": "^0.0.1"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20260607.1",
"@opennextjs/cloudflare": "^1.19.11",
"@types/node": "^22.9.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"autoprefixer": "^10.4.20",
"cross-env": "^10.1.0",
"postcss": "^8.4.49",
"sharp": "^0.33.5",
"tailwindcss": "^3.4.15",
"tsx": "^4.22.4",
"typescript": "^5.6.3",
"wrangler": "^4.96.0"
}
}