@blockrun/llm 4.2.1 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -657,6 +657,107 @@ interface SearchResult {
657
657
  sources_used?: number;
658
658
  model?: string;
659
659
  }
660
+ /** One value a `choice` question may answer with. */
661
+ interface DecisionChoice {
662
+ value: string;
663
+ description?: string;
664
+ }
665
+ /** One rung of a `score` rubric. Levels are listed lowest first. */
666
+ interface DecisionLevel {
667
+ label: string;
668
+ description?: string;
669
+ }
670
+ /**
671
+ * A question with a fixed answer space. `name` keys the answer; `instructions`
672
+ * is what the model judges. Extra fields are forwarded as given.
673
+ */
674
+ type DecisionQuestion = {
675
+ type: "predicate";
676
+ name: string;
677
+ instructions: string;
678
+ [k: string]: unknown;
679
+ } | {
680
+ type: "choice";
681
+ name: string;
682
+ instructions: string;
683
+ choices: DecisionChoice[];
684
+ [k: string]: unknown;
685
+ } | {
686
+ type: "score";
687
+ name: string;
688
+ instructions: string;
689
+ levels: DecisionLevel[];
690
+ [k: string]: unknown;
691
+ };
692
+ /** A message of {@link DecisionsRequest.input}: text parts and inline `data:image/*` images. */
693
+ interface DecisionInputMessage {
694
+ role: string;
695
+ content: unknown;
696
+ }
697
+ interface DecisionsRequest {
698
+ /** `"gpt-6-luna"` (the default), `"openai/gpt-6-luna"` or `"openai/gpt-6-luna-decisions"`. */
699
+ model?: string;
700
+ /** The evidence: a string, or messages whose content holds text and inline base64 images (no hosted URLs). */
701
+ input: string | DecisionInputMessage[];
702
+ /** Up to 64 questions, one typed answer each. */
703
+ questions: DecisionQuestion[];
704
+ /** Forwarded to the provider and billed as input. */
705
+ metadata?: Record<string, string>;
706
+ }
707
+ /** The answer to one question, keyed by the question's `name`. */
708
+ type DecisionAnswer = {
709
+ type: "predicate";
710
+ name: string;
711
+ probability: number;
712
+ [k: string]: unknown;
713
+ } | {
714
+ type: "choice";
715
+ name: string;
716
+ /** One of the question's `choices[].value`, always: give the question a `none` value for inputs that fit nothing. */
717
+ choice: string;
718
+ /** One entry per choice, in the order given. */
719
+ probabilities: Array<{
720
+ value: string;
721
+ probability: number;
722
+ }>;
723
+ confidence: number;
724
+ [k: string]: unknown;
725
+ } | {
726
+ type: "score";
727
+ name: string;
728
+ /** Probability-weighted position on the rubric (0 = the first level). */
729
+ score: number;
730
+ /** One entry per level, lowest first; `value` is the level's index. */
731
+ probabilities: Array<{
732
+ value: number;
733
+ label: string;
734
+ probability: number;
735
+ }>;
736
+ confidence: number;
737
+ [k: string]: unknown;
738
+ };
739
+ interface DecisionsResponse {
740
+ /** BlockRun's id for the call (`decision_<hex>`), when the gateway returns one. */
741
+ id?: string;
742
+ model: string;
743
+ [k: string]: unknown;
744
+ /** One answer per question, in the order asked. */
745
+ answers: DecisionAnswer[];
746
+ /** Only input tokens are billed; `output_tokens` is 0. */
747
+ usage?: {
748
+ input_tokens: number;
749
+ output_tokens: number;
750
+ total_tokens: number;
751
+ [k: string]: unknown;
752
+ };
753
+ /**
754
+ * What this call added to `getSpending()`: the signed quote under `exact`,
755
+ * the metered charge under Solana batch settlement. Undefined with an API key.
756
+ */
757
+ costUsd?: number;
758
+ /** Settlement details, when a wallet payment was made. */
759
+ settlement?: Settlement;
760
+ }
660
761
  interface ImageEditOptions {
661
762
  /** Model ID (default: "openai/gpt-image-2") */
662
763
  model?: string;
@@ -1094,6 +1195,10 @@ interface PricePoint {
1094
1195
  category?: string;
1095
1196
  source?: string;
1096
1197
  free?: boolean;
1198
+ /** `false` for the daily-close feeds served today. */
1199
+ realtime?: boolean;
1200
+ /** The gateway's note on the data, e.g. "Daily close, not realtime. ..." */
1201
+ note?: string;
1097
1202
  }
1098
1203
  interface PriceBar {
1099
1204
  t?: number;
@@ -1674,6 +1779,32 @@ declare class LLMClient {
1674
1779
  * @returns SearchResult with summary and citations
1675
1780
  */
1676
1781
  search(query: string, options?: SearchOptions): Promise<SearchResult>;
1782
+ /**
1783
+ * Typed judgments (OpenAI Decisions-compatible, `gpt-6-luna`): send
1784
+ * evidence and questions with a fixed answer space, get one typed answer
1785
+ * per question instead of text.
1786
+ *
1787
+ * Priced on input tokens only. With a wallet the 402 quotes an upper-bound
1788
+ * estimate of them plus the $0.001 transaction fee, and that quote settles;
1789
+ * with an API key the account is billed on the tokens the provider reports.
1790
+ * A request over the gateway's limits is refused with a 400 before payment.
1791
+ *
1792
+ * A `choice` always picks one of your values, so give it a `none` value for
1793
+ * inputs that fit nothing.
1794
+ *
1795
+ * @example
1796
+ * const { answers } = await client.decisions({
1797
+ * input: 'My card was charged twice for one order.',
1798
+ * questions: [
1799
+ * { type: 'predicate', name: 'urgent', instructions: 'Does this need a reply today?' },
1800
+ * { type: 'choice', name: 'team', instructions: 'Which team owns this?',
1801
+ * choices: [{ value: 'billing', description: 'payments and refunds' },
1802
+ * { value: 'shipping', description: 'delivery' },
1803
+ * { value: 'none', description: 'fits no team' }] },
1804
+ * ],
1805
+ * });
1806
+ */
1807
+ decisions(request: DecisionsRequest): Promise<DecisionsResponse>;
1677
1808
  /**
1678
1809
  * Generic Exa endpoint proxy (POST). Useful when you need an Exa API
1679
1810
  * surface that the typed wrappers below don't expose.
@@ -3038,6 +3169,26 @@ interface SolanaBatchOptions {
3038
3169
  onLocked?: "exact" | "wait" | "throw";
3039
3170
  /** Most time, in ms, one call waits for the lock under `onLocked: "wait"`. Default 60000. */
3040
3171
  lockWaitMs?: number;
3172
+ /**
3173
+ * What a call does when another batch call for this wallet is in flight in
3174
+ * this process (`channel_busy`). A channel carries one pending
3175
+ * authorization, and each voucher builds on the previous call's metered
3176
+ * charge, so a wallet pays one batch call at a time: from payment until
3177
+ * its answer is reconciled (for `stream()`, until its receipt is read).
3178
+ * - `"exact"` (default): the call pays with `exact`, as before.
3179
+ * - `"wait"`: the call waits up to {@link busyWaitMs} for the wallet, then
3180
+ * pays with batch from a fresh challenge, or raises
3181
+ * {@link BatchChannelBusyError} once the wait runs out. Waiting calls are
3182
+ * not served in arrival order, and a call whose payment is in doubt can
3183
+ * hold the wallet up to `inDoubt.maxWaitMs`.
3184
+ * - `"throw"`: the call raises {@link BatchChannelBusyError} at once.
3185
+ *
3186
+ * The error is raised before anything is signed, so it is `"unpaid"`.
3187
+ * While calls wait, `closeBatchChannel()` defers (`call_in_flight`).
3188
+ */
3189
+ onBusy?: "exact" | "wait" | "throw";
3190
+ /** Most time, in ms, one call waits for the wallet under `onBusy: "wait"`. Default 60000. */
3191
+ busyWaitMs?: number;
3041
3192
  /**
3042
3193
  * How a call rides out an HTTP 429 (rate limited, or channel capacity
3043
3194
  * exhausted) on a batch payment before it pays with `exact`. The call waits
@@ -3099,6 +3250,8 @@ declare const DEFAULT_BATCH_IN_DOUBT: {
3099
3250
  };
3100
3251
  /** Default {@link SolanaBatchOptions.lockWaitMs}. */
3101
3252
  declare const DEFAULT_BATCH_LOCK_WAIT_MS = 60000;
3253
+ /** Default {@link SolanaBatchOptions.busyWaitMs}. */
3254
+ declare const DEFAULT_BATCH_BUSY_WAIT_MS = 60000;
3102
3255
  /**
3103
3256
  * One observable batch-settlement event.
3104
3257
  *
@@ -3116,7 +3269,8 @@ declare const DEFAULT_BATCH_LOCK_WAIT_MS = 60000;
3116
3269
  * after a 429), with the answer's `status` and the wait in `retryAfterMs`;
3117
3270
  * or, once, when a call starts waiting up to `lockWaitMs` for another
3118
3271
  * process's channel store lock (`reason: "channel_store_locked"`,
3119
- * `onLocked: "wait"`).
3272
+ * `onLocked: "wait"`), or for another batch call of the wallet in this
3273
+ * process to finish (`reason: "channel_busy"`, `onBusy: "wait"`).
3120
3274
  * - `recovered`: a call that backed off was then paid with batch (`reason:
3121
3275
  * "in_doubt"` when the replay of a payment in doubt resolved it), or its
3122
3276
  * fresh challenge after the wait was served without a payment (`reason:
@@ -3307,6 +3461,22 @@ declare class BatchChannelLockedError extends BlockrunError {
3307
3461
  waitedMs: number;
3308
3462
  });
3309
3463
  }
3464
+ /**
3465
+ * Batch is on, another batch call for this wallet is in flight in this
3466
+ * process, and the client's `batch.onBusy` is `"wait"` (the wait ran out) or
3467
+ * `"throw"`. Raised before anything is signed: nothing was paid for the call,
3468
+ * and its {@link RetryDisposition} is `"unpaid"`.
3469
+ */
3470
+ declare class BatchChannelBusyError extends BlockrunError {
3471
+ /** The paying wallet's address. */
3472
+ readonly wallet: string;
3473
+ /** How long this call waited for the wallet, in ms (0 unless `onBusy` is `"wait"`). */
3474
+ readonly waitedMs: number;
3475
+ constructor(init: {
3476
+ wallet: string;
3477
+ waitedMs: number;
3478
+ });
3479
+ }
3310
3480
  /**
3311
3481
  * The outcome of one batch attempt.
3312
3482
  *
@@ -3412,6 +3582,8 @@ declare class SolanaBatchPayer {
3412
3582
  private readonly inDoubtMaxWaitMs;
3413
3583
  private readonly onLocked;
3414
3584
  private readonly lockWaitMs;
3585
+ private readonly onBusy;
3586
+ private readonly busyWaitMs;
3415
3587
  private readonly counters;
3416
3588
  private readonly hooks;
3417
3589
  constructor(init: SolanaBatchPayerInit);
@@ -3537,6 +3709,13 @@ declare class SolanaBatchPayer {
3537
3709
  private waitForLock;
3538
3710
  /** `onLocked` other than `"exact"`: the call's `"unpaid"` error, nothing signed. */
3539
3711
  private lockedOut;
3712
+ /**
3713
+ * `onBusy: "wait"`: look at the wallet every {@link BUSY_POLL_MS} until no
3714
+ * batch call holds it or `deadline` passes. True when it is free.
3715
+ */
3716
+ private waitWhileBusy;
3717
+ /** `onBusy` other than `"exact"`: the call's `"unpaid"` error, nothing signed. */
3718
+ private busyOut;
3540
3719
  /**
3541
3720
  * The close fence for a call about to send its first request: how many
3542
3721
  * closes this wallet has completed so far, to hand to {@link pay}.
@@ -4024,6 +4203,18 @@ declare class SolanaLLMClient {
4024
4203
  } & Record<string, unknown>): Promise<MusicResponse>;
4025
4204
  /** Standalone search (Solana payment). */
4026
4205
  search(query: string, options?: SearchOptions): Promise<SearchResult>;
4206
+ /**
4207
+ * Typed judgments (OpenAI Decisions-compatible, `gpt-6-luna`), paid on
4208
+ * Solana: one typed answer per question instead of text. See
4209
+ * {@link LLMClient.decisions} for the request shape.
4210
+ *
4211
+ * Under `exact` the 402's quote settles (an upper-bound estimate of the
4212
+ * input tokens plus the $0.001 fee). With the `batch` option the call pays
4213
+ * with a channel voucher and is charged the input tokens the provider
4214
+ * reports, with no per-call fee; `costUsd` is that metered charge. It shares
4215
+ * the wallet's channel with chat, one batch call at a time.
4216
+ */
4217
+ decisions(request: DecisionsRequest): Promise<DecisionsResponse>;
4027
4218
  pm(path: string, params?: Record<string, string>): Promise<Record<string, unknown>>;
4028
4219
  pmQuery(path: string, query: Record<string, unknown>): Promise<Record<string, unknown>>;
4029
4220
  /**
@@ -4496,6 +4687,15 @@ declare class Chat {
4496
4687
  completions: ChatCompletions;
4497
4688
  constructor(client: LLMClient, apiUrl: string, timeout: number);
4498
4689
  }
4690
+ /**
4691
+ * Decisions API namespace (OpenAI Decisions-compatible): typed judgments.
4692
+ */
4693
+ declare class Decisions {
4694
+ private client;
4695
+ constructor(client: LLMClient);
4696
+ /** Same as {@link LLMClient.decisions}. */
4697
+ create(params: DecisionsRequest): Promise<DecisionsResponse>;
4698
+ }
4499
4699
  /**
4500
4700
  * OpenAI-compatible client for BlockRun.
4501
4701
  *
@@ -4515,6 +4715,7 @@ declare class Chat {
4515
4715
  */
4516
4716
  declare class OpenAI {
4517
4717
  chat: Chat;
4718
+ decisions: Decisions;
4518
4719
  get authMode(): "api-key" | "wallet";
4519
4720
  private client;
4520
4721
  constructor(options?: OpenAIClientOptions);
@@ -4695,4 +4896,23 @@ declare function readSettlement(response: Response, quotedUsd: number, scheme: S
4695
4896
  settlement: Settlement;
4696
4897
  };
4697
4898
 
4698
- export { APIError, API_KEY_URL, ARC_CHAIN_ID, AnthropicClient, type AnyTool, type ApiKeyOptions, type AudioModel, type AudioTrack, BASE_CHAIN_ID, BLOCKRUN_SOL_OPERATOR, type BarResolution, type BatchAttempt, BatchChannelLockedError, BatchCloseDeferredError, type BatchPayloadKind, BatchPaymentUnresolvedError, type BatchUnresolvedReason, type BlockRunAnthropicOptions, BlockrunClient, type BlockrunClientOptions, BlockrunError, type CallInitiatedResponse, type CallModel, type CallOptions, type CallStatusResponse, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, DEFAULT_BATCH_IN_DOUBT, DEFAULT_BATCH_LOCK_WAIT_MS, DEFAULT_BATCH_RATE_LIMIT, EVM_NETWORKS, type EvmNetwork, type FunctionCall, type FunctionDefinition, type HistoryOptions, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type ListOptions, type MarketSession, type Model, MusicClient, type MusicClientOptions, type MusicGenerateOptions, type MusicResponse, NETWORK_ALIASES, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PAYMENT_REPLAY, PHONE_PRICES, PORTAL_URL, PORTRAIT_ENROLLMENT_PRICE_USD, PaymentError, type PaymentLinks, PaymentReplayError, type PhoneBuyOptions, type PhoneBuyResponse, PhoneClient, type PhoneClientOptions, type PhoneListResponse, type PhoneLookupResponse, type PhoneNumberRecord, type PhoneReleaseResponse, type PhoneRenewResponse, type PollOptions, PortraitClient, type PortraitClientOptions, type PortraitEnrollOptions, type PortraitEnrollResponse, type PriceBar, type PriceCategory, PriceClient, type PriceClientOptions, type PriceHistoryResponse, type PriceOptions, type PricePoint, RPC_PRICE_USD, type ReasoningEffort, type Rechallenge, type ResponseFormat, RetiredEndpointError, type RetryDisposition, type RoutingDecision, type RoutingProfile, type RoutingTaskType, type RoutingTier, type RoutingTierConfig, type RpcBatchRequest, RpcClient, type RpcClientOptions, type RpcError, type RpcNetwork, type RpcResponse, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, SUPPORTED_NETWORKS, SearchClient, type SearchClientOptions, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type Settlement, type SmartChatCompletionOptions, type SmartChatCompletionResponse, type SmartChatOptions, type SmartChatResponse, type SolanaBatchEvent, type SolanaBatchOptions, SolanaBatchPayer, type SolanaBatchPayerInit, type SolanaBatchStats, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type SoundEffectOptions, type SpeechAudio, SpeechClient, type SpeechClientOptions, type SpeechGenerateOptions, type SpeechModel, type SpeechResponse, type SpeechVoice, type Spending, type SpendingReport, type StockMarket, SurfClient, type SurfClientOptions, type SymbolListResponse, type Tool, type ToolCall, type ToolChoice, USDC_ARC, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, type UrlCitation, VideoClient, type VideoClientOptions, type VideoClip, type VideoGenerateOptions, type VideoModel, type VideoResponse, VoiceClient, type VoiceClientOptions, type VoiceInfo, type VoicePreset, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletAuthChallenge, type WalletInfo, type WebSearchSource, type WebSearchTool, type X402ClientLike, type X402HookContext, type XSearchSource, type XSearchTool, buildPaymentRejectedError, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, evmNetwork, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatSolanaWalletMigrationNotice, formatWalletCreatedMessage, formatWalletMigrationNotice, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, importSolanaWallet, importWallet, isPaymentReplay, listDiscoveredSolanaWallets, listDiscoveredWallets, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, paymentRejectedErrorFromBody, readSettlement, retryDisposition, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentClient, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, toWireSearchParameters, toWireTools, validateMaxTokens, validateModel, validateTemperature, validateTopP };
4899
+ /**
4900
+ * Decisions — typed judgments, OpenAI Decisions-compatible (`POST /v1/decisions`).
4901
+ *
4902
+ * The caller sends evidence (`input`) and questions with a fixed answer space
4903
+ * (predicate, choice or score) and gets one typed answer per question back
4904
+ * instead of text. Served on every rail: x402 `exact` on Base, Arc and Solana,
4905
+ * batch settlement on Solana (metered on the input tokens the provider
4906
+ * reports), and an account API key on api.blockrun.ai.
4907
+ *
4908
+ * The gateway owns the limits (body size, 64 questions, 255 choices or levels,
4909
+ * 120K characters, 8 inline images, no hosted image URLs) and refuses an
4910
+ * over-limit request with a 400 before any payment. This module only checks
4911
+ * the shape a typed caller can still get wrong, so a malformed request fails
4912
+ * before anything is sent.
4913
+ */
4914
+
4915
+ /** The model OpenAI serves Decisions from; the gateway also accepts our catalog ids. */
4916
+ declare const DECISIONS_DEFAULT_MODEL = "gpt-6-luna";
4917
+
4918
+ export { APIError, API_KEY_URL, ARC_CHAIN_ID, AnthropicClient, type AnyTool, type ApiKeyOptions, type AudioModel, type AudioTrack, BASE_CHAIN_ID, BLOCKRUN_SOL_OPERATOR, type BarResolution, type BatchAttempt, BatchChannelBusyError, BatchChannelLockedError, BatchCloseDeferredError, type BatchPayloadKind, BatchPaymentUnresolvedError, type BatchUnresolvedReason, type BlockRunAnthropicOptions, BlockrunClient, type BlockrunClientOptions, BlockrunError, type CallInitiatedResponse, type CallModel, type CallOptions, type CallStatusResponse, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, DECISIONS_DEFAULT_MODEL, DEFAULT_BATCH_BUSY_WAIT_MS, DEFAULT_BATCH_IN_DOUBT, DEFAULT_BATCH_LOCK_WAIT_MS, DEFAULT_BATCH_RATE_LIMIT, type DecisionAnswer, type DecisionChoice, type DecisionInputMessage, type DecisionLevel, type DecisionQuestion, type DecisionsRequest, type DecisionsResponse, EVM_NETWORKS, type EvmNetwork, type FunctionCall, type FunctionDefinition, type HistoryOptions, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type ListOptions, type MarketSession, type Model, MusicClient, type MusicClientOptions, type MusicGenerateOptions, type MusicResponse, NETWORK_ALIASES, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PAYMENT_REPLAY, PHONE_PRICES, PORTAL_URL, PORTRAIT_ENROLLMENT_PRICE_USD, PaymentError, type PaymentLinks, PaymentReplayError, type PhoneBuyOptions, type PhoneBuyResponse, PhoneClient, type PhoneClientOptions, type PhoneListResponse, type PhoneLookupResponse, type PhoneNumberRecord, type PhoneReleaseResponse, type PhoneRenewResponse, type PollOptions, PortraitClient, type PortraitClientOptions, type PortraitEnrollOptions, type PortraitEnrollResponse, type PriceBar, type PriceCategory, PriceClient, type PriceClientOptions, type PriceHistoryResponse, type PriceOptions, type PricePoint, RPC_PRICE_USD, type ReasoningEffort, type Rechallenge, type ResponseFormat, RetiredEndpointError, type RetryDisposition, type RoutingDecision, type RoutingProfile, type RoutingTaskType, type RoutingTier, type RoutingTierConfig, type RpcBatchRequest, RpcClient, type RpcClientOptions, type RpcError, type RpcNetwork, type RpcResponse, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, SUPPORTED_NETWORKS, SearchClient, type SearchClientOptions, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type Settlement, type SmartChatCompletionOptions, type SmartChatCompletionResponse, type SmartChatOptions, type SmartChatResponse, type SolanaBatchEvent, type SolanaBatchOptions, SolanaBatchPayer, type SolanaBatchPayerInit, type SolanaBatchStats, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type SoundEffectOptions, type SpeechAudio, SpeechClient, type SpeechClientOptions, type SpeechGenerateOptions, type SpeechModel, type SpeechResponse, type SpeechVoice, type Spending, type SpendingReport, type StockMarket, SurfClient, type SurfClientOptions, type SymbolListResponse, type Tool, type ToolCall, type ToolChoice, USDC_ARC, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, type UrlCitation, VideoClient, type VideoClientOptions, type VideoClip, type VideoGenerateOptions, type VideoModel, type VideoResponse, VoiceClient, type VoiceClientOptions, type VoiceInfo, type VoicePreset, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletAuthChallenge, type WalletInfo, type WebSearchSource, type WebSearchTool, type X402ClientLike, type X402HookContext, type XSearchSource, type XSearchTool, buildPaymentRejectedError, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, evmNetwork, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatSolanaWalletMigrationNotice, formatWalletCreatedMessage, formatWalletMigrationNotice, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, importSolanaWallet, importWallet, isPaymentReplay, listDiscoveredSolanaWallets, listDiscoveredWallets, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, paymentRejectedErrorFromBody, readSettlement, retryDisposition, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentClient, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, toWireSearchParameters, toWireTools, validateMaxTokens, validateModel, validateTemperature, validateTopP };
package/dist/index.d.ts CHANGED
@@ -657,6 +657,107 @@ interface SearchResult {
657
657
  sources_used?: number;
658
658
  model?: string;
659
659
  }
660
+ /** One value a `choice` question may answer with. */
661
+ interface DecisionChoice {
662
+ value: string;
663
+ description?: string;
664
+ }
665
+ /** One rung of a `score` rubric. Levels are listed lowest first. */
666
+ interface DecisionLevel {
667
+ label: string;
668
+ description?: string;
669
+ }
670
+ /**
671
+ * A question with a fixed answer space. `name` keys the answer; `instructions`
672
+ * is what the model judges. Extra fields are forwarded as given.
673
+ */
674
+ type DecisionQuestion = {
675
+ type: "predicate";
676
+ name: string;
677
+ instructions: string;
678
+ [k: string]: unknown;
679
+ } | {
680
+ type: "choice";
681
+ name: string;
682
+ instructions: string;
683
+ choices: DecisionChoice[];
684
+ [k: string]: unknown;
685
+ } | {
686
+ type: "score";
687
+ name: string;
688
+ instructions: string;
689
+ levels: DecisionLevel[];
690
+ [k: string]: unknown;
691
+ };
692
+ /** A message of {@link DecisionsRequest.input}: text parts and inline `data:image/*` images. */
693
+ interface DecisionInputMessage {
694
+ role: string;
695
+ content: unknown;
696
+ }
697
+ interface DecisionsRequest {
698
+ /** `"gpt-6-luna"` (the default), `"openai/gpt-6-luna"` or `"openai/gpt-6-luna-decisions"`. */
699
+ model?: string;
700
+ /** The evidence: a string, or messages whose content holds text and inline base64 images (no hosted URLs). */
701
+ input: string | DecisionInputMessage[];
702
+ /** Up to 64 questions, one typed answer each. */
703
+ questions: DecisionQuestion[];
704
+ /** Forwarded to the provider and billed as input. */
705
+ metadata?: Record<string, string>;
706
+ }
707
+ /** The answer to one question, keyed by the question's `name`. */
708
+ type DecisionAnswer = {
709
+ type: "predicate";
710
+ name: string;
711
+ probability: number;
712
+ [k: string]: unknown;
713
+ } | {
714
+ type: "choice";
715
+ name: string;
716
+ /** One of the question's `choices[].value`, always: give the question a `none` value for inputs that fit nothing. */
717
+ choice: string;
718
+ /** One entry per choice, in the order given. */
719
+ probabilities: Array<{
720
+ value: string;
721
+ probability: number;
722
+ }>;
723
+ confidence: number;
724
+ [k: string]: unknown;
725
+ } | {
726
+ type: "score";
727
+ name: string;
728
+ /** Probability-weighted position on the rubric (0 = the first level). */
729
+ score: number;
730
+ /** One entry per level, lowest first; `value` is the level's index. */
731
+ probabilities: Array<{
732
+ value: number;
733
+ label: string;
734
+ probability: number;
735
+ }>;
736
+ confidence: number;
737
+ [k: string]: unknown;
738
+ };
739
+ interface DecisionsResponse {
740
+ /** BlockRun's id for the call (`decision_<hex>`), when the gateway returns one. */
741
+ id?: string;
742
+ model: string;
743
+ [k: string]: unknown;
744
+ /** One answer per question, in the order asked. */
745
+ answers: DecisionAnswer[];
746
+ /** Only input tokens are billed; `output_tokens` is 0. */
747
+ usage?: {
748
+ input_tokens: number;
749
+ output_tokens: number;
750
+ total_tokens: number;
751
+ [k: string]: unknown;
752
+ };
753
+ /**
754
+ * What this call added to `getSpending()`: the signed quote under `exact`,
755
+ * the metered charge under Solana batch settlement. Undefined with an API key.
756
+ */
757
+ costUsd?: number;
758
+ /** Settlement details, when a wallet payment was made. */
759
+ settlement?: Settlement;
760
+ }
660
761
  interface ImageEditOptions {
661
762
  /** Model ID (default: "openai/gpt-image-2") */
662
763
  model?: string;
@@ -1094,6 +1195,10 @@ interface PricePoint {
1094
1195
  category?: string;
1095
1196
  source?: string;
1096
1197
  free?: boolean;
1198
+ /** `false` for the daily-close feeds served today. */
1199
+ realtime?: boolean;
1200
+ /** The gateway's note on the data, e.g. "Daily close, not realtime. ..." */
1201
+ note?: string;
1097
1202
  }
1098
1203
  interface PriceBar {
1099
1204
  t?: number;
@@ -1674,6 +1779,32 @@ declare class LLMClient {
1674
1779
  * @returns SearchResult with summary and citations
1675
1780
  */
1676
1781
  search(query: string, options?: SearchOptions): Promise<SearchResult>;
1782
+ /**
1783
+ * Typed judgments (OpenAI Decisions-compatible, `gpt-6-luna`): send
1784
+ * evidence and questions with a fixed answer space, get one typed answer
1785
+ * per question instead of text.
1786
+ *
1787
+ * Priced on input tokens only. With a wallet the 402 quotes an upper-bound
1788
+ * estimate of them plus the $0.001 transaction fee, and that quote settles;
1789
+ * with an API key the account is billed on the tokens the provider reports.
1790
+ * A request over the gateway's limits is refused with a 400 before payment.
1791
+ *
1792
+ * A `choice` always picks one of your values, so give it a `none` value for
1793
+ * inputs that fit nothing.
1794
+ *
1795
+ * @example
1796
+ * const { answers } = await client.decisions({
1797
+ * input: 'My card was charged twice for one order.',
1798
+ * questions: [
1799
+ * { type: 'predicate', name: 'urgent', instructions: 'Does this need a reply today?' },
1800
+ * { type: 'choice', name: 'team', instructions: 'Which team owns this?',
1801
+ * choices: [{ value: 'billing', description: 'payments and refunds' },
1802
+ * { value: 'shipping', description: 'delivery' },
1803
+ * { value: 'none', description: 'fits no team' }] },
1804
+ * ],
1805
+ * });
1806
+ */
1807
+ decisions(request: DecisionsRequest): Promise<DecisionsResponse>;
1677
1808
  /**
1678
1809
  * Generic Exa endpoint proxy (POST). Useful when you need an Exa API
1679
1810
  * surface that the typed wrappers below don't expose.
@@ -3038,6 +3169,26 @@ interface SolanaBatchOptions {
3038
3169
  onLocked?: "exact" | "wait" | "throw";
3039
3170
  /** Most time, in ms, one call waits for the lock under `onLocked: "wait"`. Default 60000. */
3040
3171
  lockWaitMs?: number;
3172
+ /**
3173
+ * What a call does when another batch call for this wallet is in flight in
3174
+ * this process (`channel_busy`). A channel carries one pending
3175
+ * authorization, and each voucher builds on the previous call's metered
3176
+ * charge, so a wallet pays one batch call at a time: from payment until
3177
+ * its answer is reconciled (for `stream()`, until its receipt is read).
3178
+ * - `"exact"` (default): the call pays with `exact`, as before.
3179
+ * - `"wait"`: the call waits up to {@link busyWaitMs} for the wallet, then
3180
+ * pays with batch from a fresh challenge, or raises
3181
+ * {@link BatchChannelBusyError} once the wait runs out. Waiting calls are
3182
+ * not served in arrival order, and a call whose payment is in doubt can
3183
+ * hold the wallet up to `inDoubt.maxWaitMs`.
3184
+ * - `"throw"`: the call raises {@link BatchChannelBusyError} at once.
3185
+ *
3186
+ * The error is raised before anything is signed, so it is `"unpaid"`.
3187
+ * While calls wait, `closeBatchChannel()` defers (`call_in_flight`).
3188
+ */
3189
+ onBusy?: "exact" | "wait" | "throw";
3190
+ /** Most time, in ms, one call waits for the wallet under `onBusy: "wait"`. Default 60000. */
3191
+ busyWaitMs?: number;
3041
3192
  /**
3042
3193
  * How a call rides out an HTTP 429 (rate limited, or channel capacity
3043
3194
  * exhausted) on a batch payment before it pays with `exact`. The call waits
@@ -3099,6 +3250,8 @@ declare const DEFAULT_BATCH_IN_DOUBT: {
3099
3250
  };
3100
3251
  /** Default {@link SolanaBatchOptions.lockWaitMs}. */
3101
3252
  declare const DEFAULT_BATCH_LOCK_WAIT_MS = 60000;
3253
+ /** Default {@link SolanaBatchOptions.busyWaitMs}. */
3254
+ declare const DEFAULT_BATCH_BUSY_WAIT_MS = 60000;
3102
3255
  /**
3103
3256
  * One observable batch-settlement event.
3104
3257
  *
@@ -3116,7 +3269,8 @@ declare const DEFAULT_BATCH_LOCK_WAIT_MS = 60000;
3116
3269
  * after a 429), with the answer's `status` and the wait in `retryAfterMs`;
3117
3270
  * or, once, when a call starts waiting up to `lockWaitMs` for another
3118
3271
  * process's channel store lock (`reason: "channel_store_locked"`,
3119
- * `onLocked: "wait"`).
3272
+ * `onLocked: "wait"`), or for another batch call of the wallet in this
3273
+ * process to finish (`reason: "channel_busy"`, `onBusy: "wait"`).
3120
3274
  * - `recovered`: a call that backed off was then paid with batch (`reason:
3121
3275
  * "in_doubt"` when the replay of a payment in doubt resolved it), or its
3122
3276
  * fresh challenge after the wait was served without a payment (`reason:
@@ -3307,6 +3461,22 @@ declare class BatchChannelLockedError extends BlockrunError {
3307
3461
  waitedMs: number;
3308
3462
  });
3309
3463
  }
3464
+ /**
3465
+ * Batch is on, another batch call for this wallet is in flight in this
3466
+ * process, and the client's `batch.onBusy` is `"wait"` (the wait ran out) or
3467
+ * `"throw"`. Raised before anything is signed: nothing was paid for the call,
3468
+ * and its {@link RetryDisposition} is `"unpaid"`.
3469
+ */
3470
+ declare class BatchChannelBusyError extends BlockrunError {
3471
+ /** The paying wallet's address. */
3472
+ readonly wallet: string;
3473
+ /** How long this call waited for the wallet, in ms (0 unless `onBusy` is `"wait"`). */
3474
+ readonly waitedMs: number;
3475
+ constructor(init: {
3476
+ wallet: string;
3477
+ waitedMs: number;
3478
+ });
3479
+ }
3310
3480
  /**
3311
3481
  * The outcome of one batch attempt.
3312
3482
  *
@@ -3412,6 +3582,8 @@ declare class SolanaBatchPayer {
3412
3582
  private readonly inDoubtMaxWaitMs;
3413
3583
  private readonly onLocked;
3414
3584
  private readonly lockWaitMs;
3585
+ private readonly onBusy;
3586
+ private readonly busyWaitMs;
3415
3587
  private readonly counters;
3416
3588
  private readonly hooks;
3417
3589
  constructor(init: SolanaBatchPayerInit);
@@ -3537,6 +3709,13 @@ declare class SolanaBatchPayer {
3537
3709
  private waitForLock;
3538
3710
  /** `onLocked` other than `"exact"`: the call's `"unpaid"` error, nothing signed. */
3539
3711
  private lockedOut;
3712
+ /**
3713
+ * `onBusy: "wait"`: look at the wallet every {@link BUSY_POLL_MS} until no
3714
+ * batch call holds it or `deadline` passes. True when it is free.
3715
+ */
3716
+ private waitWhileBusy;
3717
+ /** `onBusy` other than `"exact"`: the call's `"unpaid"` error, nothing signed. */
3718
+ private busyOut;
3540
3719
  /**
3541
3720
  * The close fence for a call about to send its first request: how many
3542
3721
  * closes this wallet has completed so far, to hand to {@link pay}.
@@ -4024,6 +4203,18 @@ declare class SolanaLLMClient {
4024
4203
  } & Record<string, unknown>): Promise<MusicResponse>;
4025
4204
  /** Standalone search (Solana payment). */
4026
4205
  search(query: string, options?: SearchOptions): Promise<SearchResult>;
4206
+ /**
4207
+ * Typed judgments (OpenAI Decisions-compatible, `gpt-6-luna`), paid on
4208
+ * Solana: one typed answer per question instead of text. See
4209
+ * {@link LLMClient.decisions} for the request shape.
4210
+ *
4211
+ * Under `exact` the 402's quote settles (an upper-bound estimate of the
4212
+ * input tokens plus the $0.001 fee). With the `batch` option the call pays
4213
+ * with a channel voucher and is charged the input tokens the provider
4214
+ * reports, with no per-call fee; `costUsd` is that metered charge. It shares
4215
+ * the wallet's channel with chat, one batch call at a time.
4216
+ */
4217
+ decisions(request: DecisionsRequest): Promise<DecisionsResponse>;
4027
4218
  pm(path: string, params?: Record<string, string>): Promise<Record<string, unknown>>;
4028
4219
  pmQuery(path: string, query: Record<string, unknown>): Promise<Record<string, unknown>>;
4029
4220
  /**
@@ -4496,6 +4687,15 @@ declare class Chat {
4496
4687
  completions: ChatCompletions;
4497
4688
  constructor(client: LLMClient, apiUrl: string, timeout: number);
4498
4689
  }
4690
+ /**
4691
+ * Decisions API namespace (OpenAI Decisions-compatible): typed judgments.
4692
+ */
4693
+ declare class Decisions {
4694
+ private client;
4695
+ constructor(client: LLMClient);
4696
+ /** Same as {@link LLMClient.decisions}. */
4697
+ create(params: DecisionsRequest): Promise<DecisionsResponse>;
4698
+ }
4499
4699
  /**
4500
4700
  * OpenAI-compatible client for BlockRun.
4501
4701
  *
@@ -4515,6 +4715,7 @@ declare class Chat {
4515
4715
  */
4516
4716
  declare class OpenAI {
4517
4717
  chat: Chat;
4718
+ decisions: Decisions;
4518
4719
  get authMode(): "api-key" | "wallet";
4519
4720
  private client;
4520
4721
  constructor(options?: OpenAIClientOptions);
@@ -4695,4 +4896,23 @@ declare function readSettlement(response: Response, quotedUsd: number, scheme: S
4695
4896
  settlement: Settlement;
4696
4897
  };
4697
4898
 
4698
- export { APIError, API_KEY_URL, ARC_CHAIN_ID, AnthropicClient, type AnyTool, type ApiKeyOptions, type AudioModel, type AudioTrack, BASE_CHAIN_ID, BLOCKRUN_SOL_OPERATOR, type BarResolution, type BatchAttempt, BatchChannelLockedError, BatchCloseDeferredError, type BatchPayloadKind, BatchPaymentUnresolvedError, type BatchUnresolvedReason, type BlockRunAnthropicOptions, BlockrunClient, type BlockrunClientOptions, BlockrunError, type CallInitiatedResponse, type CallModel, type CallOptions, type CallStatusResponse, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, DEFAULT_BATCH_IN_DOUBT, DEFAULT_BATCH_LOCK_WAIT_MS, DEFAULT_BATCH_RATE_LIMIT, EVM_NETWORKS, type EvmNetwork, type FunctionCall, type FunctionDefinition, type HistoryOptions, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type ListOptions, type MarketSession, type Model, MusicClient, type MusicClientOptions, type MusicGenerateOptions, type MusicResponse, NETWORK_ALIASES, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PAYMENT_REPLAY, PHONE_PRICES, PORTAL_URL, PORTRAIT_ENROLLMENT_PRICE_USD, PaymentError, type PaymentLinks, PaymentReplayError, type PhoneBuyOptions, type PhoneBuyResponse, PhoneClient, type PhoneClientOptions, type PhoneListResponse, type PhoneLookupResponse, type PhoneNumberRecord, type PhoneReleaseResponse, type PhoneRenewResponse, type PollOptions, PortraitClient, type PortraitClientOptions, type PortraitEnrollOptions, type PortraitEnrollResponse, type PriceBar, type PriceCategory, PriceClient, type PriceClientOptions, type PriceHistoryResponse, type PriceOptions, type PricePoint, RPC_PRICE_USD, type ReasoningEffort, type Rechallenge, type ResponseFormat, RetiredEndpointError, type RetryDisposition, type RoutingDecision, type RoutingProfile, type RoutingTaskType, type RoutingTier, type RoutingTierConfig, type RpcBatchRequest, RpcClient, type RpcClientOptions, type RpcError, type RpcNetwork, type RpcResponse, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, SUPPORTED_NETWORKS, SearchClient, type SearchClientOptions, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type Settlement, type SmartChatCompletionOptions, type SmartChatCompletionResponse, type SmartChatOptions, type SmartChatResponse, type SolanaBatchEvent, type SolanaBatchOptions, SolanaBatchPayer, type SolanaBatchPayerInit, type SolanaBatchStats, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type SoundEffectOptions, type SpeechAudio, SpeechClient, type SpeechClientOptions, type SpeechGenerateOptions, type SpeechModel, type SpeechResponse, type SpeechVoice, type Spending, type SpendingReport, type StockMarket, SurfClient, type SurfClientOptions, type SymbolListResponse, type Tool, type ToolCall, type ToolChoice, USDC_ARC, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, type UrlCitation, VideoClient, type VideoClientOptions, type VideoClip, type VideoGenerateOptions, type VideoModel, type VideoResponse, VoiceClient, type VoiceClientOptions, type VoiceInfo, type VoicePreset, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletAuthChallenge, type WalletInfo, type WebSearchSource, type WebSearchTool, type X402ClientLike, type X402HookContext, type XSearchSource, type XSearchTool, buildPaymentRejectedError, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, evmNetwork, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatSolanaWalletMigrationNotice, formatWalletCreatedMessage, formatWalletMigrationNotice, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, importSolanaWallet, importWallet, isPaymentReplay, listDiscoveredSolanaWallets, listDiscoveredWallets, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, paymentRejectedErrorFromBody, readSettlement, retryDisposition, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentClient, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, toWireSearchParameters, toWireTools, validateMaxTokens, validateModel, validateTemperature, validateTopP };
4899
+ /**
4900
+ * Decisions — typed judgments, OpenAI Decisions-compatible (`POST /v1/decisions`).
4901
+ *
4902
+ * The caller sends evidence (`input`) and questions with a fixed answer space
4903
+ * (predicate, choice or score) and gets one typed answer per question back
4904
+ * instead of text. Served on every rail: x402 `exact` on Base, Arc and Solana,
4905
+ * batch settlement on Solana (metered on the input tokens the provider
4906
+ * reports), and an account API key on api.blockrun.ai.
4907
+ *
4908
+ * The gateway owns the limits (body size, 64 questions, 255 choices or levels,
4909
+ * 120K characters, 8 inline images, no hosted image URLs) and refuses an
4910
+ * over-limit request with a 400 before any payment. This module only checks
4911
+ * the shape a typed caller can still get wrong, so a malformed request fails
4912
+ * before anything is sent.
4913
+ */
4914
+
4915
+ /** The model OpenAI serves Decisions from; the gateway also accepts our catalog ids. */
4916
+ declare const DECISIONS_DEFAULT_MODEL = "gpt-6-luna";
4917
+
4918
+ export { APIError, API_KEY_URL, ARC_CHAIN_ID, AnthropicClient, type AnyTool, type ApiKeyOptions, type AudioModel, type AudioTrack, BASE_CHAIN_ID, BLOCKRUN_SOL_OPERATOR, type BarResolution, type BatchAttempt, BatchChannelBusyError, BatchChannelLockedError, BatchCloseDeferredError, type BatchPayloadKind, BatchPaymentUnresolvedError, type BatchUnresolvedReason, type BlockRunAnthropicOptions, BlockrunClient, type BlockrunClientOptions, BlockrunError, type CallInitiatedResponse, type CallModel, type CallOptions, type CallStatusResponse, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, DECISIONS_DEFAULT_MODEL, DEFAULT_BATCH_BUSY_WAIT_MS, DEFAULT_BATCH_IN_DOUBT, DEFAULT_BATCH_LOCK_WAIT_MS, DEFAULT_BATCH_RATE_LIMIT, type DecisionAnswer, type DecisionChoice, type DecisionInputMessage, type DecisionLevel, type DecisionQuestion, type DecisionsRequest, type DecisionsResponse, EVM_NETWORKS, type EvmNetwork, type FunctionCall, type FunctionDefinition, type HistoryOptions, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type ListOptions, type MarketSession, type Model, MusicClient, type MusicClientOptions, type MusicGenerateOptions, type MusicResponse, NETWORK_ALIASES, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PAYMENT_REPLAY, PHONE_PRICES, PORTAL_URL, PORTRAIT_ENROLLMENT_PRICE_USD, PaymentError, type PaymentLinks, PaymentReplayError, type PhoneBuyOptions, type PhoneBuyResponse, PhoneClient, type PhoneClientOptions, type PhoneListResponse, type PhoneLookupResponse, type PhoneNumberRecord, type PhoneReleaseResponse, type PhoneRenewResponse, type PollOptions, PortraitClient, type PortraitClientOptions, type PortraitEnrollOptions, type PortraitEnrollResponse, type PriceBar, type PriceCategory, PriceClient, type PriceClientOptions, type PriceHistoryResponse, type PriceOptions, type PricePoint, RPC_PRICE_USD, type ReasoningEffort, type Rechallenge, type ResponseFormat, RetiredEndpointError, type RetryDisposition, type RoutingDecision, type RoutingProfile, type RoutingTaskType, type RoutingTier, type RoutingTierConfig, type RpcBatchRequest, RpcClient, type RpcClientOptions, type RpcError, type RpcNetwork, type RpcResponse, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, SUPPORTED_NETWORKS, SearchClient, type SearchClientOptions, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type Settlement, type SmartChatCompletionOptions, type SmartChatCompletionResponse, type SmartChatOptions, type SmartChatResponse, type SolanaBatchEvent, type SolanaBatchOptions, SolanaBatchPayer, type SolanaBatchPayerInit, type SolanaBatchStats, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type SoundEffectOptions, type SpeechAudio, SpeechClient, type SpeechClientOptions, type SpeechGenerateOptions, type SpeechModel, type SpeechResponse, type SpeechVoice, type Spending, type SpendingReport, type StockMarket, SurfClient, type SurfClientOptions, type SymbolListResponse, type Tool, type ToolCall, type ToolChoice, USDC_ARC, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, type UrlCitation, VideoClient, type VideoClientOptions, type VideoClip, type VideoGenerateOptions, type VideoModel, type VideoResponse, VoiceClient, type VoiceClientOptions, type VoiceInfo, type VoicePreset, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletAuthChallenge, type WalletInfo, type WebSearchSource, type WebSearchTool, type X402ClientLike, type X402HookContext, type XSearchSource, type XSearchTool, buildPaymentRejectedError, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, evmNetwork, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatSolanaWalletMigrationNotice, formatWalletCreatedMessage, formatWalletMigrationNotice, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, importSolanaWallet, importWallet, isPaymentReplay, listDiscoveredSolanaWallets, listDiscoveredWallets, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, paymentRejectedErrorFromBody, readSettlement, retryDisposition, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentClient, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, toWireSearchParameters, toWireTools, validateMaxTokens, validateModel, validateTemperature, validateTopP };