import type { GameModelAPI } from '../domains/gameModel.js'; import type { Scalars, SeedPropertyInput } from '../generated/graphql.js'; import { type KitInvokeResult } from './shared.js'; /** Options for {@link ProgressionKit}. Must match the deployed blueprint. */ export interface ProgressionKitOptions { /** The `typePrefix` the progression blueprint was deployed with. */ typePrefix?: string; } /** A parsed view of one player's progression. */ export interface KitProgress { containerId: string; displayName: string; ownerUserId: string | null; xp: number; level: number; skillPoints: number; rating: number; } /** A parsed view of one skill catalog row. */ export interface KitSkillDef { containerId: string; displayName: string; skillId: string; cost: number; requiresSkillId: string; maxRank: number; } /** A parsed view of one player skill rank. */ export interface KitSkillRank { containerId: string; displayName: string; ownerUserId: string | null; skillId: string; rank: number; } /** A parsed view of one achievement definition. */ export interface KitAchievementDef { containerId: string; displayName: string; achievementId: string; threshold: number; } /** A parsed view of one player achievement unlock. */ export interface KitAchievementUnlock { containerId: string; displayName: string; ownerUserId: string | null; achievementId: string; unlocked: boolean; } /** * Runtime helpers for the {@link progressionBlueprint} conventions: ensure a * player's `Progress`, grant XP (trusted — app admins by default), buy * skills against the catalog's costs and prerequisites, unlock threshold * achievements, and apply match rating results. Everything is * authority-checked server-side; denials resolve with `success: false`. * * Obtained via `client.kit(appId).progression`. */ export declare class ProgressionKit { private readonly appId; private readonly gameModel; private readonly names; constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: ProgressionKitOptions); /** * Find the player's Progress container, creating it when absent (with the * `owner_user_id` mirror the guards read). */ ensure(ownerUserId: Scalars['BigInt']['input'], options?: { displayName?: string; sessionId?: string; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** Read one player's progression state. */ state(progressId: string): Promise; /** * Grant XP — a **trusted** call (default blueprint authority: app admins * via server scope; or drive it from an event automation). Awards skill * points and levels up when the curve is crossed. Resolves with the new * level. */ grantXp(progressId: string, amount: number): Promise>; /** List the skill catalog (admin-seeded SkillDef containers). */ skillCatalog(): Promise; /** Define a skill (admin — the catalog type is admin-instantiable). */ defineSkill(input: { skillId: string; cost?: number; requiresSkillId?: string; maxRank?: number; displayName?: string; properties?: SeedPropertyInput[]; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** * Find-or-create the caller's SkillRank row for a skill (rank 0 until * bought). */ ensureSkillRank(ownerUserId: Scalars['BigInt']['input'], skillId: string, options?: { displayName?: string; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** * Buy one rank of a skill. `prereqRankId` is the caller's SkillRank for * the prerequisite skill; omit it for skills without one (the rank row * itself is passed to satisfy the required param — the condition ignores * it when the def declares no prerequisite). */ buySkill(input: { skillRankId: string; progressId: string; skillDefId: string; prereqRankId?: string; }): Promise>; /** List a player's skill ranks. */ skills(ownerUserId: Scalars['BigInt']['input']): Promise; /** List the achievement catalog (admin-seeded AchievementDef containers). */ achievementCatalog(): Promise; /** Define an achievement (admin). */ defineAchievement(input: { achievementId: string; threshold: number; displayName?: string; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }>; /** List a player's achievement unlocks. */ achievements(ownerUserId: Scalars['BigInt']['input']): Promise; /** * Unlock an achievement once its xp threshold is met. Creates the caller's * unlock row when absent, then invokes the gated function (idempotent). */ unlockAchievement(input: { ownerUserId: Scalars['BigInt']['input']; progressId: string; achievementDefId: string; achievementId: string; }): Promise>; /** * Apply a match result as a rating delta (trusted — host-gated by * default; `kit.matches` computes the delta). Resolves with the new * rating. */ applyMatchResult(progressId: string, delta: number): Promise>; } //# sourceMappingURL=progression.d.ts.map