/** * `vana app requests list|show ` - what this machine asked for, and * what came back. * * `list` reads the local index, so it works offline and is the way an * agent recovers a request id it did not keep. `show` merges the local * entry with the live status and writes back what changed, which is how a * `--no-input` request eventually learns its grant id. * * An approval is not forever: the owner can revoke the grant, and a later * approval for the same app replaces its scopes (one grant per owner and * app). Both commands check every grant id against the gateway, and say * when it no longer holds, or that it could not be checked. */ import { type GatewayClient } from "@opendatalabs/vana-sdk"; import { createDirectDataController } from "@opendatalabs/vana-sdk/server"; import { resolveAppKey } from "../../core/app-key.js"; import { type RequestsStore } from "../../core/requests-store.js"; import { type AppCommandOptions } from "./outcome.js"; export interface RequestsDeps { resolveKey?: typeof resolveAppKey; createController?: typeof createDirectDataController; requests?: RequestsStore; createClient?: (gatewayUrl: string) => Pick; } /** Whether a request's grant still gives the app what it asked for. */ export type GrantCheck = { state: "active"; } | { state: "revoked" | "replaced" | "expired" | "missing"; reason: string; revokedAt?: string; grantScopes?: string[]; } | { state: "unverified"; reason: string; }; /** * Ask the gateway (public, no key needed) whether `grantId` still covers * `scopes`. Never throws: a gateway that cannot be reached is "unverified". */ export declare function checkGrant(client: Pick, grantId: string, scopes: string[]): Promise; export declare function runAppRequestsList(options: AppCommandOptions, deps?: RequestsDeps): Promise; export declare function runAppRequestsShow(requestId: string, options: AppCommandOptions, deps?: RequestsDeps): Promise; //# sourceMappingURL=requests.d.ts.map