Initial addition of the Arcade study feature. Add connections as the first working game.
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m4s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m4s
This commit is contained in:
parent
7b90409f2e
commit
611a585757
43 changed files with 5990 additions and 68 deletions
35
src/lib/arcade/registry.ts
Normal file
35
src/lib/arcade/registry.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { parseConnectionsImportBatch } from "@/lib/arcade/connectionsImport";
|
||||
import type { ArcadeGameKey } from "@/types/arcade";
|
||||
|
||||
const CONNECTIONS_PROMPT = `You are generating a Connections study game as strict JSON.
|
||||
Return exactly one JSON object with no Markdown fence or commentary.
|
||||
|
||||
Use this schema:
|
||||
{"schemaVersion":1,"type":"connections","name":"...","description":"...","settings":{"groupCount":4,"itemsPerGroup":4,"allowedMistakes":4},"content":[{"id":"group-1","category":"...","items":["...","...","...","..."],"explanation":"..."}]}
|
||||
|
||||
Rules:
|
||||
- Generate exactly four groups of exactly four unique items.
|
||||
- Every item must fit only its intended group within this board.
|
||||
- Use specific, distinct category names and concise tiles of one to four words.
|
||||
- Give every group a concise explanation.
|
||||
- Do not create arbitrary leftover groups or use broad categories shared by most tiles.
|
||||
- Base all content strictly on the study material below.
|
||||
|
||||
Material:
|
||||
[paste your notes or lecture content here]`;
|
||||
|
||||
export const ARCADE_SERVER_REGISTRY = {
|
||||
connections: {
|
||||
schemaVersion: 1,
|
||||
preview: parseConnectionsImportBatch,
|
||||
defaultInstructions: CONNECTIONS_PROMPT,
|
||||
},
|
||||
} satisfies Record<ArcadeGameKey, {
|
||||
schemaVersion: number;
|
||||
preview: typeof parseConnectionsImportBatch;
|
||||
defaultInstructions: string;
|
||||
}>;
|
||||
|
||||
export function getArcadeGameDefinition(gameType: ArcadeGameKey) {
|
||||
return ARCADE_SERVER_REGISTRY[gameType];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue