import type { GameModelAPI } from '../domains/gameModel.js'; import type { Scalars, SeedPropertyInput } from '../generated/graphql.js'; import { type KitOwnerIdKind } from './blueprints/index.js'; import { type KitInvokeResult } from './shared.js'; /** Options for {@link QuestsKit}. Must match the deployed quests blueprint. */ export interface QuestsKitOptions { /** The `typePrefix` the quests blueprint was deployed with. */ typePrefix?: string; /** Must match questsBlueprint.ownerIdKind. Defaults to `int`. */ ownerIdKind?: KitOwnerIdKind; } /** A parsed view of one quest catalog row. */ export interface KitQuestDef { containerId: string; displayName: string; questId: string; targetCount: number; rewardItemId: string; rewardQty: number; rewardGold: number; repeatable: boolean; daily: boolean; } /** A parsed view of one player's quest progress. */ export interface KitQuestProgress { containerId: string; displayName: string; ownerUserId: string | null; questId: string; count: number; target: number; completed: boolean; claimed: boolean; daily: boolean; } /** * Runtime helpers for the {@link questsBlueprint} conventions: browse the * quest catalog, accept quests into per-player progress rows, advance them * (trusted — app admins or event automations), and claim rewards atomically * into a stack + wallet. Denials resolve with `success: false`. * * Obtained via `client.kit(appId).quests`. */ export declare class QuestsKit { private readonly appId; private readonly gameModel; private readonly names; private readonly ownerIdKind; constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: QuestsKitOptions); /** List the quest catalog (admin-seeded QuestDef containers). */ catalog(): Promise; /** Define a quest (admin — the catalog type is admin-instantiable). */ defineQuest(input: { questId: string; targetCount?: number; rewardItemId?: string; rewardQty?: number; rewardGold?: number; repeatable?: boolean; daily?: boolean; 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; }>; /** * Accept a quest: creates the caller's progress row seeded from the def * (target and daily flag copied at accept time). */ accept(ownerUserId: Scalars['BigInt']['input'], questDefId: string, 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; }>; /** List a player's quest progress rows. */ mine(ownerUserId: Scalars['BigInt']['input']): Promise; /** * STUDIO (admin) — define an ordered tutorial chain as quest defs. Steps * are plain quests whose `questId` encodes the chain + index * (`":"`), so no new server surface is involved: the sequencing * is a read-side convention enforced by {@link tutorial} / * {@link acceptNextTutorialStep} (a step is `locked` until every earlier * step completes). */ defineTutorial(input: { /** Chain id (one app can ship several tutorials). Defaults to `'ftue'`. */ chain?: string; steps: Array<{ displayName: string; targetCount?: number; rewardItemId?: string; rewardQty?: number; rewardGold?: number; }>; }): Promise<{ __typename?: "GmContainer"; containerId: string; appId: string; sessionId: string | null; typeName: string; displayName: string; description: string | null; ownerUserId: string | null; metadataJson: string; }[]>; /** One tutorial step joined with the player's progress. */ /** * A player's view of a tutorial chain: steps in order, each `locked` * (an earlier step is incomplete), `active` (the first incomplete step), * or `complete`. The client shows/drives only the `active` step; the * trusted advance authority is unchanged (players still cannot complete * their own quests). */ tutorial(ownerUserId: Scalars['BigInt']['input'], chain?: string): Promise>; /** * Ensure the player's ACTIVE tutorial step has a progress row (accepting * it when missing) and return the step. Returns null when the chain is * complete. Calling this for a locked step is impossible by construction — * it always targets the first incomplete step. */ acceptNextTutorialStep(ownerUserId: Scalars['BigInt']['input'], chain?: string, options?: { sessionId?: string; }): Promise<{ stepIndex: number; def: KitQuestDef; progress: KitQuestProgress | null; status: "locked" | "active" | "complete"; } | null>; /** Read one progress row. */ state(progressId: string): Promise; /** * Advance quest progress — a **trusted** call (default blueprint * authority: app admins; or wire `advanceOn` event automations). Resolves * with the new count. */ advance(progressId: string, amount?: number): Promise>; /** * Turn in a completed quest: marks it claimed AND grants the item + * currency rewards in one transaction. Resolves with the wallet's new * balance. */ claim(input: { progressId: string; questDefId: string; toStackId: string; walletId: string; }): Promise>; } //# sourceMappingURL=quests.d.ts.map