UNPKG

@tangle-network/tcloud

Version:

TypeScript SDK and CLI for Tangle Router, Sandbox, model routing, and agent service calls

73 lines • 8.92 kB
import { $ as EmbeddingResponse, A as OperatorInfo, At as UpdateKeyOptions, B as BatchRequest, C as SystemOneResult, Ct as SearchRecency, D as formatModelNotAllowedRefusal, Dt as SpendingLimits, E as deriveChildBudgetUsd, Et as SpendAuth, F as AvatarGenerateRequest, G as ChatOptions, H as ChatCompletion, I as AvatarGenerateResponse, J as CompletionResponse, K as ChatPlugin, L as AvatarJobStatus, M as PrivateRouterConfig, Mt as VideoResponse, N as RoutingStrategy, Nt as WatchJobOptions, O as parseModelNotAllowed, Ot as TCloudConfig, P as ApiKeyInfo, Pt as WebSearchPlugin, Q as EmbeddingOptions, R as AvatarResult, S as SystemOneQuestion, St as SearchProvider, T as SystemOneState, Tt as ShieldedConfig, U as ChatCompletionChunk, V as BridgeOptions, W as ChatMessage, X as CreatedKey, Y as CreateKeyOptions, Z as CreditBalance, _ as MIN_CHILD_KEY_BUDGET_USD, _t as RetryConfig, a as RotationStats, at as ImageGenerateOptions, b as SystemOneAnswer, bt as SearchHit, c as TierConfig, ct as Model, d as DecisionQuestion, dt as RerankOptions, et as FineTuningJob, f as DecisionReceipts, ft as RerankResponse, g as KeyScopeInfo, gt as ResearchResponse, h as DecisionUsage, ht as ResearchProvider, i as RotatingRoutingConfig, it as ImageEditOptions, j as PrivateRouter, jt as VideoGenerateOptions, k as resolveModelWithinAllowList, kt as TranscriptionResponse, l as DecisionAnswer, lt as Operator, m as DecisionResult, mt as ResearchOptions, n as PricingTier, nt as GatewayOptions, o as TCloudClient, ot as ImageResponse, p as DecisionResponse, pt as ResearchHit, q as CompletionOptions, r as RotatingClientConfig, rt as ImageEditAttachment, s as TCloudError, st as JobEvent, t as BridgeSession, tt as FineTuningJobOptions, u as DecisionCreateOptions, ut as PrivacyConfig, v as ModelWithinAllowListResolution, vt as RoutingConfig, w as SystemOneResultBody, wt as SearchResponse, x as SystemOneEvaluateOptions, xt as SearchOptions, y as ParentBudgetExhaustedError, yt as SandboxChatOptions, z as BatchJobResponse } from "./client-EyknRDtd.js"; import { a as generateWallet, i as estimateCost, n as ShieldedWallet, o as signSpendAuth, r as createShieldedClient } from "./shielded-OG2IOXQC.js"; import { a as TCloudSandboxCreateOptions, c as TCloudTeeAttestationChallenge, d as TCloudTeeAttestationHeartbeatSample, g as startTeeAttestationHeartbeat, i as TCloudSandboxConfig, l as TCloudTeeAttestationHeartbeat, m as generateAttestationNonce, n as TCloudSandbox, o as TCloudSandboxCreateResult, p as createTeeAttestationChallenge, r as TCloudSandboxAttestationStatus, s as TCloudSandboxTee, u as TCloudTeeAttestationHeartbeatOptions } from "./sandbox-pIzrBKnd.js"; import { AsyncAttestationPolicy, AsyncHardwareVerifier, AttestationPolicy, AttestationVerificationResult, HardwareVerifier, HardwareVerifierResult, NitroAttestationDocument, NitroVerifierOptions, ParsedAttestation, SevSnpReport, SevSnpVerifierOptions, TeeType, assertAttestation, createNitroHardwareVerifier, createSevSnpHardwareVerifier, createTdxHardwareVerifier, normalizeTeeType, parseAttestation, parseNitroAttestationDocument, parseSevSnpReport, toHex, verifyAttestation, verifyAttestationAsync } from "@tangle-network/tcloud-attestation"; import { AgentProfile, AgentProfileCapabilities, AgentProfileFileMount, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileValidationIssue, AgentProfileValidationResult, AgentSubagentProfile } from "@tangle-network/agent-interface"; //#region src/index.d.ts export declare class TCloud extends TCloudClient { constructor(config?: TCloudConfig); /** * Create a standard client with API key authentication. * * ```ts * const client = TCloud.create({ apiKey: 'sk-tan-...' }) * ``` */ static create(config?: TCloudConfig): TCloud; /** * Create a shielded (private) client. * Generates an ephemeral wallet and signs SpendAuth automatically. * No API key needed. The operator never learns your identity. * * ```ts * const client = TCloud.shielded() * const response = await client.ask('Hello from the shadows') * console.log(client.wallet.commitment) // anonymous credit account * ``` */ static shielded(config?: TCloudConfig & { wallet?: ShieldedWallet; operatorAddress?: `0x${string}`; chainId?: number; creditsAddress?: `0x${string}`; serviceId?: bigint; }): TCloudClient & { wallet: ShieldedWallet; stopAutoReplenish: () => void; }; /** * Create a client that rotates operators per call. * See {@link TCloudClient.rotating} for semantics. * * ```ts * const client = TCloud.rotating({ * apiKey: process.env.TANGLE_API_KEY, * routing: { strategy: 'min-exposure' }, * }) * const stats = client.getRotationStats() * ``` */ static rotating(config?: RotatingClientConfig): TCloudClient; /** * Generate a new ephemeral wallet (without creating a client). * * ```ts * const wallet = TCloud.generateWallet() * console.log(wallet.address, wallet.commitment) * ``` */ static generateWallet: typeof generateWallet; /** * Create a Sandbox SDK client using this TCloud client's API key by default. * * ```ts * const tcloud = new TCloud({ apiKey }) * const sandbox = await tcloud.sandbox().create({ name: 'runner' }) * ``` */ sandbox(config?: Partial<TCloudSandboxConfig>): TCloudSandbox; /** Create a standalone Sandbox SDK client. */ static sandbox(config: TCloudSandboxConfig): TCloudSandbox; } //#endregion export { type AgentProfile, type AgentProfileCapabilities, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type ApiKeyInfo, type AsyncAttestationPolicy, type AsyncHardwareVerifier, type AttestationPolicy, type AttestationVerificationResult, type AvatarGenerateRequest, type AvatarGenerateResponse, type AvatarJobStatus, type AvatarResult, type BatchJobResponse, type BatchRequest, type BridgeOptions, BridgeSession, type ChatCompletion, type ChatCompletionChunk, type ChatMessage, type ChatOptions, type ChatPlugin, type CompletionOptions, type CompletionResponse, type CreateKeyOptions, type CreatedKey, type CreditBalance, type DecisionAnswer, type DecisionCreateOptions, type DecisionQuestion, type DecisionReceipts, type DecisionResponse, type DecisionResult, type DecisionUsage, type EmbeddingOptions, type EmbeddingResponse, type FineTuningJob, type FineTuningJobOptions, type GatewayOptions, type HardwareVerifier, type HardwareVerifierResult, type ImageEditAttachment, type ImageEditOptions, type ImageGenerateOptions, type ImageResponse, type JobEvent, type KeyScopeInfo, MIN_CHILD_KEY_BUDGET_USD, type Model, type ModelWithinAllowListResolution, type NitroAttestationDocument, type NitroVerifierOptions, type Operator, type OperatorInfo, ParentBudgetExhaustedError, type ParsedAttestation, type PricingTier, type PrivacyConfig, PrivateRouter, type PrivateRouterConfig, type RerankOptions, type RerankResponse, type ResearchHit, type ResearchOptions, type ResearchProvider, type ResearchResponse, type RetryConfig, type RotatingClientConfig, type RotatingRoutingConfig, type RotationStats, type RoutingConfig, type RoutingStrategy, type SandboxChatOptions, type SearchHit, type SearchOptions, type SearchProvider, type SearchRecency, type SearchResponse, type SevSnpReport, type SevSnpVerifierOptions, type ShieldedConfig, type ShieldedWallet, type SpendAuth, type SpendingLimits, type SystemOneAnswer, type SystemOneEvaluateOptions, type SystemOneQuestion, type SystemOneResult, type SystemOneResultBody, type SystemOneState, TCloudClient, type TCloudConfig, TCloudError, TCloudSandbox, type TCloudSandboxAttestationStatus, type TCloudSandboxConfig, type TCloudSandboxCreateOptions, type TCloudSandboxCreateResult, type TCloudSandboxTee, type TCloudTeeAttestationChallenge, type TCloudTeeAttestationHeartbeat, type TCloudTeeAttestationHeartbeatOptions, type TCloudTeeAttestationHeartbeatSample, type TeeType, type TierConfig, type TranscriptionResponse, type UpdateKeyOptions, type VideoGenerateOptions, type VideoResponse, type WatchJobOptions, type WebSearchPlugin, assertAttestation, createNitroHardwareVerifier, createSevSnpHardwareVerifier, createShieldedClient, createTdxHardwareVerifier, createTeeAttestationChallenge, deriveChildBudgetUsd, estimateCost, formatModelNotAllowedRefusal, generateAttestationNonce, generateWallet, normalizeTeeType, parseAttestation, parseModelNotAllowed, parseNitroAttestationDocument, parseSevSnpReport, resolveModelWithinAllowList, signSpendAuth, startTeeAttestationHeartbeat, toHex, verifyAttestation, verifyAttestationAsync };