/** * session.ts — x402 V2 session payment tools. * * Implements the x402 V2 "wallet-based access & reusable sessions" pattern: * 1. x402_session_start — pay once, receive a signed session token * 2. x402_session_fetch — make N calls within the session (no new payments) * 3. x402_session_status — inspect active sessions and TTL remaining * 4. x402_session_end — explicitly close a session * * Non-custodial design: * Agents sign session tokens locally with their private key. * No third party holds or validates keys at any point. * Session tokens are self-contained ECDSA-signed claims that any server * implementing x402 V2 can independently verify. */ import { z } from 'zod'; import { findSessionForUrl, buildSessionHeaders } from '../session/manager.js'; export declare const X402SessionStartSchema: z.ZodObject<{ endpoint: z.ZodString; scope: z.ZodDefault>>; ttl_seconds: z.ZodOptional; label: z.ZodOptional; max_payment_eth: z.ZodOptional; method: z.ZodDefault>>; headers: z.ZodOptional>; body: z.ZodOptional; timeout_ms: z.ZodDefault>; }, "strip", z.ZodTypeAny, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; endpoint: string; scope: "exact" | "prefix"; timeout_ms: number; body?: string | undefined; headers?: Record | undefined; ttl_seconds?: number | undefined; label?: string | undefined; max_payment_eth?: string | undefined; }, { endpoint: string; body?: string | undefined; headers?: Record | undefined; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined; scope?: "exact" | "prefix" | undefined; ttl_seconds?: number | undefined; label?: string | undefined; max_payment_eth?: string | undefined; timeout_ms?: number | undefined; }>; export type X402SessionStartInput = z.infer; export declare const x402SessionStartTool: { name: string; description: string; inputSchema: { type: "object"; properties: { endpoint: { type: string; description: string; }; scope: { type: string; enum: string[]; description: string; default: string; }; ttl_seconds: { type: string; description: string; }; label: { type: string; description: string; }; max_payment_eth: { type: string; description: string; }; method: { type: string; enum: string[]; description: string; default: string; }; headers: { type: string; additionalProperties: { type: string; }; description: string; }; body: { type: string; description: string; }; timeout_ms: { type: string; description: string; default: number; }; }; required: string[]; }; }; export declare function handleX402SessionStart(input: X402SessionStartInput): Promise<{ content: Array<{ type: 'text'; text: string; }>; isError?: boolean; }>; export declare const X402SessionFetchSchema: z.ZodObject<{ session_id: z.ZodString; url: z.ZodString; method: z.ZodDefault>>; headers: z.ZodOptional>; body: z.ZodOptional; timeout_ms: z.ZodDefault>; }, "strip", z.ZodTypeAny, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; timeout_ms: number; session_id: string; url: string; body?: string | undefined; headers?: Record | undefined; }, { session_id: string; url: string; body?: string | undefined; headers?: Record | undefined; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined; timeout_ms?: number | undefined; }>; export type X402SessionFetchInput = z.infer; export declare const x402SessionFetchTool: { name: string; description: string; inputSchema: { type: "object"; properties: { session_id: { type: string; description: string; }; url: { type: string; description: string; }; method: { type: string; enum: string[]; description: string; default: string; }; headers: { type: string; additionalProperties: { type: string; }; description: string; }; body: { type: string; description: string; }; timeout_ms: { type: string; description: string; default: number; }; }; required: string[]; }; }; export declare function handleX402SessionFetch(input: X402SessionFetchInput): Promise<{ content: Array<{ type: 'text'; text: string; }>; isError?: boolean; }>; export declare const X402SessionStatusSchema: z.ZodObject<{ session_id: z.ZodOptional; }, "strip", z.ZodTypeAny, { session_id?: string | undefined; }, { session_id?: string | undefined; }>; export type X402SessionStatusInput = z.infer; export declare const x402SessionStatusTool: { name: string; description: string; inputSchema: { type: "object"; properties: { session_id: { type: string; description: string; }; }; required: never[]; }; }; export declare function handleX402SessionStatus(input: X402SessionStatusInput): Promise<{ content: Array<{ type: 'text'; text: string; }>; isError?: boolean; }>; export declare const X402SessionEndSchema: z.ZodObject<{ session_id: z.ZodString; }, "strip", z.ZodTypeAny, { session_id: string; }, { session_id: string; }>; export type X402SessionEndInput = z.infer; export declare const x402SessionEndTool: { name: string; description: string; inputSchema: { type: "object"; properties: { session_id: { type: string; description: string; }; }; required: string[]; }; }; export declare function handleX402SessionEnd(input: X402SessionEndInput): Promise<{ content: Array<{ type: 'text'; text: string; }>; isError?: boolean; }>; export { findSessionForUrl, buildSessionHeaders }; //# sourceMappingURL=session.d.ts.map