import type { GameModelAPI } from '../domains/gameModel.js'; import type { EngineDetector } from './engine.js'; import type { Scalars } from '../generated/graphql.js'; import { type KitInvokeResult } from './shared.js'; /** Options for {@link LootKit}. Must match the deployed loot blueprint. */ export interface LootKitOptions { /** * The big-table loot module (pity timers, audit trails). Defaults to * `'loot-engine'`; the gacha-shrine example ships this contract. */ engineModuleName?: string; /** The `typePrefix` the loot blueprint was deployed with. */ typePrefix?: string; } /** A parsed view of one loot roll. */ export interface KitLootRoll { containerId: string; displayName: string; ownerUserId: string | null; tableId: string; /** Empty until rolled. */ rolledItemId: string; rolledQty: number; claimed: boolean; } /** * Runtime helpers for the {@link lootBlueprint} conventions: create durable * `LootRoll` containers, roll them (trusted — app admins by default, or the * blueprint's event-drop automations), and claim results atomically into an * item stack. The weighted selection runs entirely server-side from a stored * seed, so clients can neither pick their loot nor claim it twice. * * Obtained via `client.kit(appId).loot`. */ export declare class LootKit { private readonly appId; private readonly gameModel; private readonly engines?; private readonly names; private readonly typePrefix; constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: LootKitOptions, engines?: EngineDetector | undefined); private readonly engineModuleName; /** * Is a big-table loot module deployed + enabled (cached per session)? * When true, {@link enginePull} routes rolls through server-held RNG with * pity timers + audit trails; the blueprint's weighted model rolls stay * for small tables (the coexistence policy — "the server picks the path"). */ engineAvailable(): Promise; /** Pull from the module's table (pity-timer path); count caps at 10. */ enginePull(count?: number): Promise>; /** Your pity counters + roll totals from the module. */ enginePity(): Promise>; /** Your rolling audit trail from the module (dispute resolution). */ engineAudit(): Promise>; /** * Create an unrolled `LootRoll` for a table, owned by `ownerUserId` (who * will claim it). Event-drop automations pick from the pool of unrolled * rolls — create a few ahead of time for tables wired to `drops`. */ createRoll(input: { ownerUserId: Scalars['BigInt']['input']; tableId: string; 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; }>; /** * Roll a table on an unrolled `LootRoll` — a **trusted** call (default * blueprint authority: app admins). Resolves with the rolled item id. * * @param tableId - The roll container's table (derives the function name); * read from the container when omitted. */ roll(rollId: string, tableId?: string): Promise>; /** * Claim a rolled loot into a caller-owned stack of the rolled item. The * claimed flag and the grant commit atomically. Resolves with the granted * quantity. */ claim(rollId: string, toStackId: string): Promise>; /** Read one roll's state. */ state(rollId: string): Promise; /** * List a player's rolls, optionally filtered to one table and/or to * unclaimed rolled loot (the "your drops" screen). */ rolls(ownerUserId: Scalars['BigInt']['input'], options?: { tableId?: string; unclaimedOnly?: boolean; }): Promise; /** * Roll/claim audit history from the model event log (each roll records its * seed, item, and quantity as applied mutations). */ history(options?: { tableId?: string; limit?: number; }): Promise<{ __typename?: "GmEvent"; eventId: string; flowId: string | null; sessionId: string | null; functionName: string; selfContainerId: string | null; callerUserId: string | null; callerKind: string; automationId: string | null; paramsJson: string; mutationsAppliedJson: string; permissionEffectsAppliedJson: string; returnValueJson: string | null; success: boolean; errorMessage: string | null; executedAt: string; }[]>; private toRoll; } //# sourceMappingURL=loot.d.ts.map