/** * Compute-engine capability detection + invoke envelope for the kit helpers. * Games deploy engines (mob-engine, world-engine, bwf-mobs, ...) as compute * modules; kit helpers probe once per module per session and route through * the engine when it is present, falling back to the model/automation path * when it is not — so the same client code works on model-only deployments. */ import type { ComputeAPI } from '../domains/compute.js'; /** The `{success, ...}` envelope engine invoke exports resolve with. */ export interface EngineInvokeResult> { success: boolean; /** The engine's denial reason when `success` is false. */ reason?: string; /** The parsed result body (includes any extra fields the export returns). */ body: T & Record; fuelUsed?: string; durationUs?: number; } /** * Per-session cached probe of which compute modules an app has enabled. * Obtained internally by kit helpers; share one via `kit.engines`. */ export declare class EngineDetector { private readonly appId; private readonly compute; private readonly cache; constructor(appId: string, compute: ComputeAPI | undefined); /** * Is `moduleName` deployed + enabled? Cached per module for the client's * lifetime ({@link reset} to re-probe after deploys). Resolves false when * the client has no compute domain wired. */ has(moduleName: string): Promise; /** Drop cached probes (call after deploying/enabling modules). */ reset(): void; /** * Invoke an engine export and parse the `{success, ...}` envelope. * Envelope failures (denials) resolve; every GraphQL-level error * (invoke-policy FORBIDDEN, the typed invoke-contract violation — * `BAD_REQUEST` "Invoke params violate ..." — a disabled module, ...) also * resolves as `{ success: false, reason }` so kit callers always get * gameplay-verdict semantics from compute invokes. Only non-GraphQL * (transport) errors throw. */ invoke>(moduleName: string, exportName: string, params?: Record): Promise>; private probe; } //# sourceMappingURL=engine.d.ts.map