@sylphx/sdk 0.8.0-rc.1 → 0.8.0

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.ts CHANGED
@@ -82,12 +82,15 @@ interface PlatformRealtimeDeleteChannelResult {
82
82
  * Implements the canonical connection string format defined in ADR-055 §5.
83
83
  * This is a self-contained copy for SDK package independence (no app imports).
84
84
  *
85
- * Format:
86
- * sylphx://{credential}@{slug}.{domain}[:port][/v{version}]
85
+ * Hosted format:
86
+ * sylphx://{credential}@{tenant-slug}.api.sylphx.com[:port][/v{version}]
87
+ *
88
+ * Custom/self-hosted domains are also accepted as long as the first DNS label
89
+ * is the tenant slug.
87
90
  *
88
91
  * Examples:
89
- * sylphx://pk_prod_f19e5cdc3cc54f7ff81bdc26ec5bfbad@bold-river-a1b2c3.sylphx.com
90
- * sylphx://sk_prod_5120bfeb5120bfeb5120bfeb5120bfeb@bold-river-a1b2c3.sylphx.com/v1
92
+ * sylphx://pk_prod_f19e5cdc3cc54f7ff81bdc26ec5bfbad@bold-river-a1b2c3.api.sylphx.com
93
+ * sylphx://sk_prod_5120bfeb5120bfeb5120bfeb5120bfeb@bold-river-a1b2c3.api.sylphx.com/v1
91
94
  * sylphx://pk_dev_abc12345abc12345abc12345abc12345@calm-peak-z9x4d5.sylphx.dev
92
95
  *
93
96
  * Invariants:
@@ -110,9 +113,9 @@ interface ParsedConnectionUrl {
110
113
  readonly env: ConnectionEnv;
111
114
  /** First DNS label of the host — the resource slug (e.g. `bold-river-a1b2c3`) */
112
115
  readonly slug: string;
113
- /** Full host including port when present (e.g. `bold-river-a1b2c3.sylphx.com`) */
116
+ /** Full host including port when present (e.g. `bold-river-a1b2c3.api.sylphx.com`) */
114
117
  readonly host: string;
115
- /** Ready-to-use SDK base URL, always HTTPS (e.g. `https://bold-river-a1b2c3.sylphx.com/v1`) */
118
+ /** Ready-to-use SDK base URL, always HTTPS (e.g. `https://bold-river-a1b2c3.api.sylphx.com/v1`) */
116
119
  readonly apiBaseUrl: string;
117
120
  }
118
121
  declare class InvalidConnectionUrlError extends Error {
@@ -132,7 +135,7 @@ declare class InvalidConnectionUrlError extends Error {
132
135
  * import { createClient } from '@sylphx/sdk'
133
136
  *
134
137
  * const sylphx = createClient(process.env.SYLPHX_URL!)
135
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.sylphx.com
138
+ * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
136
139
  * ```
137
140
  */
138
141
 
@@ -151,7 +154,7 @@ interface SylphxConfig {
151
154
  readonly env: 'dev' | 'stg' | 'prod' | 'prev';
152
155
  /** Resource slug (first DNS label), e.g. 'bold-river-a1b2c3' */
153
156
  readonly slug: string;
154
- /** Pre-computed API base URL, e.g. 'https://bold-river-a1b2c3.sylphx.com/v1' */
157
+ /** Pre-computed API base URL, e.g. 'https://bold-river-a1b2c3.api.sylphx.com/v1' */
155
158
  readonly baseUrl: string;
156
159
  /** Optional access token for authenticated requests */
157
160
  readonly accessToken?: string;
@@ -204,7 +207,7 @@ interface SylphxClientInput {
204
207
  * @example Connection URL (recommended)
205
208
  * ```typescript
206
209
  * const sylphx = createClient(process.env.NEXT_PUBLIC_SYLPHX_URL!)
207
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.sylphx.com
210
+ * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
208
211
  * ```
209
212
  *
210
213
  * @example Explicit components
@@ -225,7 +228,7 @@ declare function createClient(input: string | SylphxClientInput): SylphxConfig;
225
228
  * @example Connection URL (recommended)
226
229
  * ```typescript
227
230
  * const sylphx = createServerClient(process.env.SYLPHX_SECRET_URL!)
228
- * // Parses: sylphx://sk_prod_{hex}@bold-river-a1b2c3.sylphx.com
231
+ * // Parses: sylphx://sk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
229
232
  * ```
230
233
  *
231
234
  * @example Explicit components
@@ -1752,6 +1755,8 @@ declare function getWebhookStats(config: SylphxConfig, environmentId?: string):
1752
1755
  * exposed; those aliases now come directly from `@sylphx/contract`.
1753
1756
  */
1754
1757
 
1758
+ declare const OAUTH_PROVIDERS: readonly ["google", "github", "apple", "microsoft", "facebook", "twitter", "discord", "linkedin", "slack", "gitlab", "bitbucket", "twitch", "spotify"];
1759
+ type OAuthProviderId = (typeof OAUTH_PROVIDERS)[number];
1755
1760
  /** SDK cookie/token shape. Richer authenticated surfaces live in `./react/types` `UserProfile`. */
1756
1761
  interface User {
1757
1762
  id: string;
@@ -2634,6 +2639,28 @@ interface PlatformAccessTokenClaims {
2634
2639
  readonly org_role?: string;
2635
2640
  readonly iat?: number;
2636
2641
  readonly exp?: number;
2642
+ /**
2643
+ * RFC 7800 confirmation claim — present when the token is sender-
2644
+ * constrained. Today we emit this for DPoP-bound tokens (RFC 9449)
2645
+ * where `cnf.jkt` is the SHA-256 thumbprint of the client's DPoP
2646
+ * public key.
2647
+ *
2648
+ * Resource servers (e.g. apps/api Management plane) that want to
2649
+ * enforce DPoP MUST:
2650
+ * 1. Look up `oauth_clients.dpop_bound_access_tokens` on the
2651
+ * issuing client to know whether DPoP is required.
2652
+ * 2. If required AND `cnf.jkt` is absent, reject 401.
2653
+ * 3. If `cnf.jkt` is present, verify the inbound `DPoP` header's
2654
+ * proof JWT and assert its public-key thumbprint matches `jkt`.
2655
+ *
2656
+ * Pre-Wave-5.3 this field was stripped from `verifyAccessToken`'s
2657
+ * return value, making resource-side enforcement impossible without
2658
+ * decoding the JWT a second time. Exposing it preserves the wire
2659
+ * format and unlocks the resource-server DPoP middleware.
2660
+ */
2661
+ readonly cnf?: {
2662
+ readonly jkt?: string;
2663
+ };
2637
2664
  }
2638
2665
  /**
2639
2666
  * `verifyAccessToken` — local JWT verification against cached JWKS.
@@ -7606,9 +7633,9 @@ declare function captureMessage(config: SylphxConfig, message: string, options?:
7606
7633
  * ## Usage
7607
7634
  *
7608
7635
  * ```typescript
7609
- * import { createConfig, SandboxClient } from '@sylphx/sdk'
7636
+ * import { createServerClient, SandboxClient } from '@sylphx/sdk'
7610
7637
  *
7611
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY!, ref: 'your-ref' })
7638
+ * const config = createServerClient(process.env.SYLPHX_URL!)
7612
7639
  *
7613
7640
  * // Create sandbox (Platform waits for pod ready before returning)
7614
7641
  * const sandbox = await SandboxClient.create(config)
@@ -7634,6 +7661,12 @@ declare function captureMessage(config: SylphxConfig, message: string, options?:
7634
7661
  interface SandboxOptions {
7635
7662
  /** Docker image (must be in registry.sylphx.com). Omit to use env default. */
7636
7663
  image?: string;
7664
+ /**
7665
+ * Request timeout for the create lifecycle call.
7666
+ * Defaults to the SDK's sandbox-create budget, which matches the Runtime
7667
+ * API readiness wait plus transport margin.
7668
+ */
7669
+ createTimeoutMs?: number;
7637
7670
  /** Idle timeout in ms before auto-termination (default: 300_000 = 5 min) */
7638
7671
  idleTimeoutMs?: number;
7639
7672
  /** Storage size in GiB (enables persistent PVC; default: disabled) */
@@ -7955,9 +7988,9 @@ declare class SandboxClient {
7955
7988
  *
7956
7989
  * ### Single worker
7957
7990
  * ```typescript
7958
- * import { createConfig, RunsClient } from '@sylphx/sdk'
7991
+ * import { createServerClient, RunsClient } from '@sylphx/sdk'
7959
7992
  *
7960
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY!, ref: 'my-project' })
7993
+ * const config = createServerClient(process.env.SYLPHX_URL!)
7961
7994
  *
7962
7995
  * const run = await RunsClient.create(config, {
7963
7996
  * image: 'registry.sylphx.com/sylphx/my-trainer:abc123',
@@ -8192,7 +8225,7 @@ declare class RunHandle {
8192
8225
  *
8193
8226
  * @example
8194
8227
  * ```typescript
8195
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY!, ref: 'my-project' })
8228
+ * const config = createServerClient(process.env.SYLPHX_URL!)
8196
8229
  *
8197
8230
  * // Run a worker and wait for completion
8198
8231
  * const result = await RunsClient.create(config, { ... }).then(w => w.wait())
@@ -8336,8 +8369,8 @@ declare const WorkersClient: {
8336
8369
  *
8337
8370
  * ### Cron → Task
8338
8371
  * ```typescript
8339
- * import { createConfig, TriggersClient } from '@sylphx/sdk'
8340
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY!, ref: 'my-project' })
8372
+ * import { createServerClient, TriggersClient } from '@sylphx/sdk'
8373
+ * const config = createServerClient(process.env.SYLPHX_URL!)
8341
8374
  *
8342
8375
  * const trigger = await TriggersClient.create(config, {
8343
8376
  * name: 'daily-cleanup',
@@ -8917,7 +8950,7 @@ declare function userInfo(opts: {
8917
8950
  /** Override the discovered endpoint (e.g. when testing against a staging AS). */
8918
8951
  endpoint?: string;
8919
8952
  }): Promise<OidcUserInfoResponse>;
8920
- type OAuthProvider = 'google' | 'github' | 'microsoft' | 'apple' | 'facebook' | (string & {});
8953
+ type OAuthProvider = OAuthProviderId | (string & {});
8921
8954
  type PkceMethod = 'S256' | 'plain';
8922
8955
  interface OAuthAuthorizeInput {
8923
8956
  readonly provider: OAuthProvider;
@@ -8937,6 +8970,14 @@ interface OAuthAuthorizeResult {
8937
8970
  /** Opaque server-side state — echo on callback handler if present. */
8938
8971
  readonly state: string;
8939
8972
  }
8973
+ interface OAuthProvidersResult {
8974
+ readonly providers: readonly OAuthProvider[];
8975
+ }
8976
+ interface OAuthCodeExchangeInput {
8977
+ readonly code: string;
8978
+ readonly codeVerifier: string;
8979
+ readonly anonymousId?: string;
8980
+ }
8940
8981
  /**
8941
8982
  * Initiate an OAuth flow with the given provider. Returns the provider's
8942
8983
  * authorization URL — redirect the user to it.
@@ -8956,6 +8997,21 @@ interface OAuthAuthorizeResult {
8956
8997
  * ```
8957
8998
  */
8958
8999
  declare function authorizeOAuth(config: SylphxConfig, input: OAuthAuthorizeInput): Promise<OAuthAuthorizeResult>;
9000
+ /**
9001
+ * List OAuth providers enabled for the current customer app/environment.
9002
+ *
9003
+ * Uses the same `SylphxConfig` routing surface as every other BaaS call, so
9004
+ * customer apps do not need a second app-id or platformUrl configuration path.
9005
+ */
9006
+ declare function listOAuthProviders(config: SylphxConfig): Promise<OAuthProvidersResult>;
9007
+ /**
9008
+ * Exchange a social-login authorization code for Platform session tokens.
9009
+ *
9010
+ * This is the customer-app counterpart to {@link authorizeOAuth}. It uses the
9011
+ * app's publishable connection URL as the OAuth client id and keeps PKCE in
9012
+ * the caller's control.
9013
+ */
9014
+ declare function exchangeOAuthCode(config: SylphxConfig, input: OAuthCodeExchangeInput): Promise<TokenResponse>;
8959
9015
  /**
8960
9016
  * Parse an OAuth callback URL (e.g. `window.location.href`) into the
8961
9017
  * fields a customer app needs to complete sign-in.
@@ -9391,4 +9447,4 @@ declare const functions: {
9391
9447
  };
9392
9448
  };
9393
9449
 
9394
- export { ACHIEVEMENT_TIER_CONFIG, type AIListModelsOptions, type AIListModelsResponse, type AIMessage, type AIMessageRole, type AIModel, type AIModelInfo, type AIModelsResponse, type AIProvider, type AIRateLimitInfo, type AIRateLimitResponse, type AIRequestType, type AIStreamChunk, type AITool, type AIToolCall, type AIUsageResponse, type AIUsageStats, type AccessTokenPayload, type AchievementCategory, type AchievementCriteria, type AchievementCriterion, type AchievementDefinition, type AchievementTier, type AchievementType, type AchievementUnlockEvent, type AdminUser, type AuditQueryFilter, type AuditQueryResult, AuthenticationError, AuthorizationError, type BackupCodesResult, type BatchEvent, type BatchIndexInput, type BatchIndexResult, type Breadcrumb, type BuildLog, type BuildLogHistoryResponse, type CaptureExceptionRequest, type CaptureMessageRequest, type ChallengeMethod, type ChallengeType, type ChallengeVerifyInput, type ChallengeVerifyResult, type ChatCompletionInput, type ChatCompletionResponse, type ChatInput, type ChatMessage, type ChatResult, type ChatStreamChunk, type CircuitBreakerConfig, CircuitBreakerOpenError, type CircuitState, type CommandResult, type ConsentCategory, type ConsentHistoryEntry, type ConsentHistoryResult, type ConsentPurposeDefaults, type ConsentType, type ContentPart, type CreateOrgInput, type CreatePermissionInput, type CreatePromoInput, type CreateRoleInput, type CreateRunOptions, type CreateTriggerOptions, type CriteriaOperator, type CronInput, type CronSchedule, type CronSource, type DatabaseConnectionInfo, type DatabaseStatus, type DatabaseStatusInfo, type DebugCategory, type DeduplicationConfig, type DeleteAccountResult, type DeleteDocumentInput, type DeployHistoryResponse, type DeployInfo, type DeployStatus, type DeviceApproveInput, type DeviceApproveResult, type DeviceDenyInput, type DeviceDenyResult, type DeviceGrant, type DeviceInitInput, type DevicePollResult, type DynamicRestClient, ERROR_CODE_STATUS, type EmailChangeInput, type EmailConfirmInput, type EmbedInput, type EmbedResult, type EmbeddingInput, type EmbeddingResponse, type LeaderboardEntry as EngagementLeaderboardEntry, type LeaderboardResult as EngagementLeaderboardResult, type EnvVar, type ErrorCode, type ErrorResponse, type EventSource, type ExceptionFrame, type ExceptionValue, type ExecEvent, type ExecOptions, type ExecResult, type FacetsResponse, type FileEvent, type FileInfo, type FileUploadOptions, type FlagContext, type FlagResult, type GetConsentHistoryInput, type GetConsentsInput, type GetFacetsInput, type GetSecretInput, type GetSecretResult, type GetSecretsInput, type GetSecretsResult, type HttpTarget, type IdentifyInput, type ImpersonationActive, type ImpersonationEndResult, type ImpersonationInfo, type ImpersonationStartResult, type IndexDocumentInput, type IndexDocumentResult, type IngestLogsResult, InvalidConnectionUrlError, type InviteMemberInput, type InviteUserRequest, type InviteUserResponse, type KvExpireRequest, type KvHgetRequest, type KvHgetallRequest, type KvHsetRequest, type KvIncrRequest, type KvLpushRequest, type KvLrangeRequest, type KvMgetRequest, type KvMsetRequest, type KvRateLimitRequest, type KvRateLimitResult, type KvScanOptions, type KvScanResult, type KvSetOptions, type KvSetRequest, type KvZMember, type KvZaddRequest, type KvZrangeRequest, type LeaderboardAggregation, type LeaderboardDefinition, type LeaderboardEntry$1 as LeaderboardEntry, type LeaderboardOptions, type LeaderboardQueryOptions, type LeaderboardResetPeriod, type LeaderboardResult$1 as LeaderboardResult, type LeaderboardSortDirection, type LinkAnonymousConsentsInput, type ListPromosOptions, type ListPromosResult, type ListRedemptionsOptions, type ListRedemptionsResult, type ListRunsOptions, type ListRunsResult, type ListScheduledEmailsOptions, type ListSecretKeysInput, type ListTriggersResult, type ListUsersOptions, type ListUsersResult, type LogEntry, type LogLevel, type LoginHistoryEntry, type LoginRequest, type LoginResponse, type MeResponse, type MemberPermissionsResult, type MintAccessTokenClaims, type MintAccessTokenResult, type MonitoringResponse, type MonitoringSeverity, type NativeStepContext, type NativeTaskDefinition, type TaskRunStatus as NativeTaskRunStatus, NetworkError, NotFoundError, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthProvider, type OidcDiscoveryDocument, type OidcUserInfoResponse, type OrgRole, type OrgTokenPayload, type OrganizationInvitation, type OrganizationMember, type OrganizationMembership, type PageInput, type PaginatedResponse, type PaginationInput, type ParsedConnectionUrl, type PasskeyRegistrationInput, type PasskeyRegistrationOptions, type PasskeySummary, type PasskeysList, type PasswordSetInput, type Permission, type PkceMethod, type Plan, type PlatformAccessTokenClaims, type PlatformFunctionsDownloadBundleResult, type PlatformLogoutInput, type PlatformPasswordChangeInput, type PlatformPasswordChangeResult, type PlatformPasswordSetInput, type PlatformPasswordSetResult, type PlatformPasswordStatusResult, type PlatformRealtimeChannel, type PlatformRealtimeCreateChannelResult, type PlatformRealtimeDeleteChannelResult, type PlatformRealtimeListChannelsResult, type PlatformRealtimeStatusResult, type PlatformRefreshInput, type PlatformRefreshResult, type PlatformSessionRenameInput, type PlatformSessionRenameResult, type PlatformSessionRevokeAllResult, type PlatformSessionRevokeInput, type PlatformSessionRevokeOtherResult, type PlatformSessionRevokeResult, type PlatformSessionsListResult, type PlatformUserDeleteInput, type PlatformUserDeleteResult, type PlatformUserExportResult, type PlatformUserRecord, type PlatformUserResolution, type ProcessEvent, type ProcessInfo, type ProcessStartOptions, type ProcessSummary, type ProjectMetadata, type PromoCode, type PromoRedemption, type PromoStatus, type PromoType, type PromoValidationPreview, type PublishEventResult, type PushCampaign, type PushCampaignStats, type PushCampaignVariant, type PushNotification, type PushNotificationPayload, type PushSegment, type PushSegmentFilter, type PushServiceWorkerConfig, type PushSubscription, type QueryLogsOptions, type QueryLogsResult, RETRYABLE_CODES, RateLimitError, type RateLimitStatusFilter, type RateLimitStatusResult, type RateLimitStrategiesFilter, type RateLimitStrategiesResult, type RateLimitStrategyDeleteInput, type RateLimitStrategyDeleteResult, type RateLimitStrategyUpsertInput, type RateLimitStrategyUpsertResult, type RealtimeEmitRequest, type RealtimeEmitResponse, type RealtimeHistoryRequest, type RealtimeHistoryResponse, type RecordActivityInput, type RecordActivityResult, type RedeemPromoInput, type RedeemPromoResult, type RedeemReferralInput, type RedeemResult, type ReferralCode, type ReferralStats, type RegisterInput, type RegisterRequest, type RegisterResponse, type RestClient, type RestClientConfig, type RestDynamicConfig, type RetryConfig, type RevokeTokenOptions, type Role, type RollbackDeployRequest, type Run, RunHandle, type RunLogsResult, type RunResourceSpec, type RunResult, type RunStatus, type RunTarget, type RunVolumeMount, type CreateRunOptions as RunWorkerOptions, RunsClient, SandboxClient, type SandboxFile, SandboxFiles, type SandboxOptions, SandboxProcesses, type SandboxRecord, SandboxWatch, type ScheduleEmailOptions, type ScheduledEmail, type ScheduledEmailStats, type ScheduledEmailsResult, type SearchInput, type SearchResponse, type SearchResultItem, type SearchStatsResult, type SearchType, type SecretKeyInfo, type SecurityAlert, type SecurityAlertsList, type SecurityScoreResult, type SecuritySettings, type SendEmailOptions, type SendResult, type SendTemplatedEmailOptions, type SendToUserOptions, type SessionResult, type SetConsentsInput, type SetEnvVarRequest, type SignedUrlOptions, type SignedUrlResult, StepCompleteSignal, StepSleepSignal, type StorageFileVersion, type StoredLogEntry, type StreakDefinition, type StreakFrequency, type StreakState, type StreamMessage, type SubmitScoreInput, type SubmitScoreResult, type Subscription, type SuccessResponse, type SylphxClientInput, type SylphxConfig, type SylphxConfigInput, SylphxError, type SylphxErrorCode, type SylphxErrorOptions, type TaskInput, type TaskResult, type TaskStatus, type TaskTarget, type TextCompletionInput, type TextCompletionResponse, TimeoutError, type TokenIntrospectionResult, type TokenResponse, type Tool, type ToolCall, type TrackClickInput, type TrackInput, type Trigger, type TriggerDeployRequest, type TriggerSource, type TriggerSourceType, type TriggerStatus, type TriggerTarget, type TriggerTargetType, TriggersClient, type TwoFactorEnableResult, type TwoFactorSetupResult, type TwoFactorVerifyRequest, type UpdateOrgInput, type UpdatePromoInput, type UpdateRoleInput, type UpdateTriggerOptions, type UploadProgressEvent, type UploadResult, type UpsertDocumentInput, type UpsertDocumentResult, type User, type UserAchievement, type UserConsent, type UserDataExport, type UserFullProfile, type UserProfile, type UserSecuritySettings, type UserSession, type UserSessionsList, type UserUpdateProfileInput, type ValidatePromoInput, type ValidatePromoResult, ValidationError, type VisionInput, type WatchEntry, type WatchOptions, type WebhookConfig, type WebhookConfigUpdate, type WebhookDeliveriesResult, type WebhookDelivery, type WebhookStats, RunHandle as WorkerHandle, type RunLogsResult as WorkerLogsResult, type RunResourceSpec as WorkerResourceSpec, type RunResult as WorkerResult, type Run as WorkerRun, type RunStatus as WorkerStatus, type RunVolumeMount as WorkerVolumeMount, WorkersClient, acceptAllConsents, acceptOrganizationInvitation, assignMemberRole, audit, authorizeOAuth, batchIndex, canDeleteOrganization, canManageMembers, canManageSettings, cancelScheduledEmail, cancelTask, captureException, captureExceptionRaw, captureMessage, chat, chatStream, checkFlag, complete, confirmEmailChange, cookies, createCheckout, createClient, createConfig, createCron, createDynamicRestClient, createOrganization, createPermission, createPortalSession, createPromo, createRestClient, createRole, createServerClient, createServiceWorkerScript, createStepContext, createTasksHandler, createTracker, debugError, debugLog, debugTimer, debugWarn, declineOptionalConsents, deleteCron, deleteDocument, deleteEnvVar, deleteFile, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, downloadFileVersion, dpop, embed, enableDebug, exponentialBackoff, exportUserData, extendedSignUp, forgotPassword, functions, generateAnonymousId, generatePkce, getAchievement, getAchievementPoints, getAchievements, getAllFlags, getAllSecrets, getAllStreaks, getBackupCodes, getBillingBalance, getBillingUsage, getBuildLogHistory, getCircuitBreakerState, getConsentHistory, getConsentTypes, getDatabaseConnectionString, getDatabaseStatus, getDebugMode, getDeployHistory, getDeployStatus, getErrorCode, getErrorMessage, getFacets, getFileInfo, getFileUrl, getFlagPayload, getFlags, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, getSignedUrl, getStreak, getSubscription, getTask, getUser, getUserByEmail, getUserConsents, getUserLeaderboardRank, getUserProfile, getUserSecurity, getVariant, getWebhookConfig, getWebhookDeliveries, getWebhookDelivery, getWebhookStats, hasAllPermissions, hasAnyPermission, hasConsent, hasError, hasPermission, hasRole, hasSecret, identify, impersonation, incrementAchievementProgress, indexDocument, ingestLogs, initPushServiceWorker, installGlobalDebugHelpers, introspectToken, inviteOrganizationMember, inviteUser, isEmailConfigured, isEnabled, isRetryableError, isSylphxError, kvDelete, kvExists, kvExpire, kvGet, kvGetJSON, kvHget, kvHgetall, kvHset, kvIncr, kvLpush, kvLrange, kvMget, kvMset, kvRateLimit, kvScan, kvSet, kvSetJSON, kvZadd, kvZrange, leaveOrganization, linkAnonymousConsents, listEnvVars, listFileVersions, listPasskeys, listPermissions, listPromoRedemptions, listPromos, listRoles, listScheduledEmails, listSecretKeys, listSecurityAlerts, listTasks, listUserSessions, listUsers, markAllSecurityAlertsRead, markSecurityAlertRead, oauth, page, parseOAuthCallback, password, pauseCron, platformAuth, campaigns as pushCampaigns, segments as pushSegments, queryLogs, rateLimits, realtime, realtimeEmit, recordStreakActivity, recoverStreak, redeemPromo, redeemReferralCode, refreshToken, regenerateBackupCodes, regenerateReferralCode, registerPush, registerPushServiceWorker, removeOrganizationMember, renamePasskey, renameUserSession, replayWebhookDelivery, requestEmailChange, rescheduleEmail, resetCircuitBreaker, resetDebugModeCache, resetPassword, resetPlatformCookieCache, resetPlatformJwksCache, restoreFile, restoreFileVersion, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, scheduleEmail, scheduleTask, search, sendEmail, sendEmailToUser, sendPush, sendTemplatedEmail, sessions, setConsents, setEnvVar, setPassword, setupTwoFactor, signIn, signOut, signUp, softDeleteFile, startPasskeyRegistration, streamToString, submitScore, suspendUser, switchOrg, toSylphxError, track, trackBatch, trackClick, triggerDeploy, unlockAchievement, unregisterPush, updateOrganization, updateOrganizationMemberRole, updatePromo, updatePushPreferences, updateRole, updateUser, updateUserMetadata, updateUserProfile, updateWebhookConfig, uploadAvatar, uploadFile, upsertDocument, user, userInfo, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };
9450
+ export { ACHIEVEMENT_TIER_CONFIG, type AIListModelsOptions, type AIListModelsResponse, type AIMessage, type AIMessageRole, type AIModel, type AIModelInfo, type AIModelsResponse, type AIProvider, type AIRateLimitInfo, type AIRateLimitResponse, type AIRequestType, type AIStreamChunk, type AITool, type AIToolCall, type AIUsageResponse, type AIUsageStats, type AccessTokenPayload, type AchievementCategory, type AchievementCriteria, type AchievementCriterion, type AchievementDefinition, type AchievementTier, type AchievementType, type AchievementUnlockEvent, type AdminUser, type AuditQueryFilter, type AuditQueryResult, AuthenticationError, AuthorizationError, type BackupCodesResult, type BatchEvent, type BatchIndexInput, type BatchIndexResult, type Breadcrumb, type BuildLog, type BuildLogHistoryResponse, type CaptureExceptionRequest, type CaptureMessageRequest, type ChallengeMethod, type ChallengeType, type ChallengeVerifyInput, type ChallengeVerifyResult, type ChatCompletionInput, type ChatCompletionResponse, type ChatInput, type ChatMessage, type ChatResult, type ChatStreamChunk, type CircuitBreakerConfig, CircuitBreakerOpenError, type CircuitState, type CommandResult, type ConsentCategory, type ConsentHistoryEntry, type ConsentHistoryResult, type ConsentPurposeDefaults, type ConsentType, type ContentPart, type CreateOrgInput, type CreatePermissionInput, type CreatePromoInput, type CreateRoleInput, type CreateRunOptions, type CreateTriggerOptions, type CriteriaOperator, type CronInput, type CronSchedule, type CronSource, type DatabaseConnectionInfo, type DatabaseStatus, type DatabaseStatusInfo, type DebugCategory, type DeduplicationConfig, type DeleteAccountResult, type DeleteDocumentInput, type DeployHistoryResponse, type DeployInfo, type DeployStatus, type DeviceApproveInput, type DeviceApproveResult, type DeviceDenyInput, type DeviceDenyResult, type DeviceGrant, type DeviceInitInput, type DevicePollResult, type DynamicRestClient, ERROR_CODE_STATUS, type EmailChangeInput, type EmailConfirmInput, type EmbedInput, type EmbedResult, type EmbeddingInput, type EmbeddingResponse, type LeaderboardEntry as EngagementLeaderboardEntry, type LeaderboardResult as EngagementLeaderboardResult, type EnvVar, type ErrorCode, type ErrorResponse, type EventSource, type ExceptionFrame, type ExceptionValue, type ExecEvent, type ExecOptions, type ExecResult, type FacetsResponse, type FileEvent, type FileInfo, type FileUploadOptions, type FlagContext, type FlagResult, type GetConsentHistoryInput, type GetConsentsInput, type GetFacetsInput, type GetSecretInput, type GetSecretResult, type GetSecretsInput, type GetSecretsResult, type HttpTarget, type IdentifyInput, type ImpersonationActive, type ImpersonationEndResult, type ImpersonationInfo, type ImpersonationStartResult, type IndexDocumentInput, type IndexDocumentResult, type IngestLogsResult, InvalidConnectionUrlError, type InviteMemberInput, type InviteUserRequest, type InviteUserResponse, type KvExpireRequest, type KvHgetRequest, type KvHgetallRequest, type KvHsetRequest, type KvIncrRequest, type KvLpushRequest, type KvLrangeRequest, type KvMgetRequest, type KvMsetRequest, type KvRateLimitRequest, type KvRateLimitResult, type KvScanOptions, type KvScanResult, type KvSetOptions, type KvSetRequest, type KvZMember, type KvZaddRequest, type KvZrangeRequest, type LeaderboardAggregation, type LeaderboardDefinition, type LeaderboardEntry$1 as LeaderboardEntry, type LeaderboardOptions, type LeaderboardQueryOptions, type LeaderboardResetPeriod, type LeaderboardResult$1 as LeaderboardResult, type LeaderboardSortDirection, type LinkAnonymousConsentsInput, type ListPromosOptions, type ListPromosResult, type ListRedemptionsOptions, type ListRedemptionsResult, type ListRunsOptions, type ListRunsResult, type ListScheduledEmailsOptions, type ListSecretKeysInput, type ListTriggersResult, type ListUsersOptions, type ListUsersResult, type LogEntry, type LogLevel, type LoginHistoryEntry, type LoginRequest, type LoginResponse, type MeResponse, type MemberPermissionsResult, type MintAccessTokenClaims, type MintAccessTokenResult, type MonitoringResponse, type MonitoringSeverity, type NativeStepContext, type NativeTaskDefinition, type TaskRunStatus as NativeTaskRunStatus, NetworkError, NotFoundError, type OAuthAuthorizeInput, type OAuthAuthorizeResult, type OAuthCodeExchangeInput, type OAuthProvider, type OAuthProvidersResult, type OidcDiscoveryDocument, type OidcUserInfoResponse, type OrgRole, type OrgTokenPayload, type OrganizationInvitation, type OrganizationMember, type OrganizationMembership, type PageInput, type PaginatedResponse, type PaginationInput, type ParsedConnectionUrl, type PasskeyRegistrationInput, type PasskeyRegistrationOptions, type PasskeySummary, type PasskeysList, type PasswordSetInput, type Permission, type PkceMethod, type Plan, type PlatformAccessTokenClaims, type PlatformFunctionsDownloadBundleResult, type PlatformLogoutInput, type PlatformPasswordChangeInput, type PlatformPasswordChangeResult, type PlatformPasswordSetInput, type PlatformPasswordSetResult, type PlatformPasswordStatusResult, type PlatformRealtimeChannel, type PlatformRealtimeCreateChannelResult, type PlatformRealtimeDeleteChannelResult, type PlatformRealtimeListChannelsResult, type PlatformRealtimeStatusResult, type PlatformRefreshInput, type PlatformRefreshResult, type PlatformSessionRenameInput, type PlatformSessionRenameResult, type PlatformSessionRevokeAllResult, type PlatformSessionRevokeInput, type PlatformSessionRevokeOtherResult, type PlatformSessionRevokeResult, type PlatformSessionsListResult, type PlatformUserDeleteInput, type PlatformUserDeleteResult, type PlatformUserExportResult, type PlatformUserRecord, type PlatformUserResolution, type ProcessEvent, type ProcessInfo, type ProcessStartOptions, type ProcessSummary, type ProjectMetadata, type PromoCode, type PromoRedemption, type PromoStatus, type PromoType, type PromoValidationPreview, type PublishEventResult, type PushCampaign, type PushCampaignStats, type PushCampaignVariant, type PushNotification, type PushNotificationPayload, type PushSegment, type PushSegmentFilter, type PushServiceWorkerConfig, type PushSubscription, type QueryLogsOptions, type QueryLogsResult, RETRYABLE_CODES, RateLimitError, type RateLimitStatusFilter, type RateLimitStatusResult, type RateLimitStrategiesFilter, type RateLimitStrategiesResult, type RateLimitStrategyDeleteInput, type RateLimitStrategyDeleteResult, type RateLimitStrategyUpsertInput, type RateLimitStrategyUpsertResult, type RealtimeEmitRequest, type RealtimeEmitResponse, type RealtimeHistoryRequest, type RealtimeHistoryResponse, type RecordActivityInput, type RecordActivityResult, type RedeemPromoInput, type RedeemPromoResult, type RedeemReferralInput, type RedeemResult, type ReferralCode, type ReferralStats, type RegisterInput, type RegisterRequest, type RegisterResponse, type RestClient, type RestClientConfig, type RestDynamicConfig, type RetryConfig, type RevokeTokenOptions, type Role, type RollbackDeployRequest, type Run, RunHandle, type RunLogsResult, type RunResourceSpec, type RunResult, type RunStatus, type RunTarget, type RunVolumeMount, type CreateRunOptions as RunWorkerOptions, RunsClient, SandboxClient, type SandboxFile, SandboxFiles, type SandboxOptions, SandboxProcesses, type SandboxRecord, SandboxWatch, type ScheduleEmailOptions, type ScheduledEmail, type ScheduledEmailStats, type ScheduledEmailsResult, type SearchInput, type SearchResponse, type SearchResultItem, type SearchStatsResult, type SearchType, type SecretKeyInfo, type SecurityAlert, type SecurityAlertsList, type SecurityScoreResult, type SecuritySettings, type SendEmailOptions, type SendResult, type SendTemplatedEmailOptions, type SendToUserOptions, type SessionResult, type SetConsentsInput, type SetEnvVarRequest, type SignedUrlOptions, type SignedUrlResult, StepCompleteSignal, StepSleepSignal, type StorageFileVersion, type StoredLogEntry, type StreakDefinition, type StreakFrequency, type StreakState, type StreamMessage, type SubmitScoreInput, type SubmitScoreResult, type Subscription, type SuccessResponse, type SylphxClientInput, type SylphxConfig, type SylphxConfigInput, SylphxError, type SylphxErrorCode, type SylphxErrorOptions, type TaskInput, type TaskResult, type TaskStatus, type TaskTarget, type TextCompletionInput, type TextCompletionResponse, TimeoutError, type TokenIntrospectionResult, type TokenResponse, type Tool, type ToolCall, type TrackClickInput, type TrackInput, type Trigger, type TriggerDeployRequest, type TriggerSource, type TriggerSourceType, type TriggerStatus, type TriggerTarget, type TriggerTargetType, TriggersClient, type TwoFactorEnableResult, type TwoFactorSetupResult, type TwoFactorVerifyRequest, type UpdateOrgInput, type UpdatePromoInput, type UpdateRoleInput, type UpdateTriggerOptions, type UploadProgressEvent, type UploadResult, type UpsertDocumentInput, type UpsertDocumentResult, type User, type UserAchievement, type UserConsent, type UserDataExport, type UserFullProfile, type UserProfile, type UserSecuritySettings, type UserSession, type UserSessionsList, type UserUpdateProfileInput, type ValidatePromoInput, type ValidatePromoResult, ValidationError, type VisionInput, type WatchEntry, type WatchOptions, type WebhookConfig, type WebhookConfigUpdate, type WebhookDeliveriesResult, type WebhookDelivery, type WebhookStats, RunHandle as WorkerHandle, type RunLogsResult as WorkerLogsResult, type RunResourceSpec as WorkerResourceSpec, type RunResult as WorkerResult, type Run as WorkerRun, type RunStatus as WorkerStatus, type RunVolumeMount as WorkerVolumeMount, WorkersClient, acceptAllConsents, acceptOrganizationInvitation, assignMemberRole, audit, authorizeOAuth, batchIndex, canDeleteOrganization, canManageMembers, canManageSettings, cancelScheduledEmail, cancelTask, captureException, captureExceptionRaw, captureMessage, chat, chatStream, checkFlag, complete, confirmEmailChange, cookies, createCheckout, createClient, createConfig, createCron, createDynamicRestClient, createOrganization, createPermission, createPortalSession, createPromo, createRestClient, createRole, createServerClient, createServiceWorkerScript, createStepContext, createTasksHandler, createTracker, debugError, debugLog, debugTimer, debugWarn, declineOptionalConsents, deleteCron, deleteDocument, deleteEnvVar, deleteFile, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, downloadFileVersion, dpop, embed, enableDebug, exchangeOAuthCode, exponentialBackoff, exportUserData, extendedSignUp, forgotPassword, functions, generateAnonymousId, generatePkce, getAchievement, getAchievementPoints, getAchievements, getAllFlags, getAllSecrets, getAllStreaks, getBackupCodes, getBillingBalance, getBillingUsage, getBuildLogHistory, getCircuitBreakerState, getConsentHistory, getConsentTypes, getDatabaseConnectionString, getDatabaseStatus, getDebugMode, getDeployHistory, getDeployStatus, getErrorCode, getErrorMessage, getFacets, getFileInfo, getFileUrl, getFlagPayload, getFlags, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, getSignedUrl, getStreak, getSubscription, getTask, getUser, getUserByEmail, getUserConsents, getUserLeaderboardRank, getUserProfile, getUserSecurity, getVariant, getWebhookConfig, getWebhookDeliveries, getWebhookDelivery, getWebhookStats, hasAllPermissions, hasAnyPermission, hasConsent, hasError, hasPermission, hasRole, hasSecret, identify, impersonation, incrementAchievementProgress, indexDocument, ingestLogs, initPushServiceWorker, installGlobalDebugHelpers, introspectToken, inviteOrganizationMember, inviteUser, isEmailConfigured, isEnabled, isRetryableError, isSylphxError, kvDelete, kvExists, kvExpire, kvGet, kvGetJSON, kvHget, kvHgetall, kvHset, kvIncr, kvLpush, kvLrange, kvMget, kvMset, kvRateLimit, kvScan, kvSet, kvSetJSON, kvZadd, kvZrange, leaveOrganization, linkAnonymousConsents, listEnvVars, listFileVersions, listOAuthProviders, listPasskeys, listPermissions, listPromoRedemptions, listPromos, listRoles, listScheduledEmails, listSecretKeys, listSecurityAlerts, listTasks, listUserSessions, listUsers, markAllSecurityAlertsRead, markSecurityAlertRead, oauth, page, parseOAuthCallback, password, pauseCron, platformAuth, campaigns as pushCampaigns, segments as pushSegments, queryLogs, rateLimits, realtime, realtimeEmit, recordStreakActivity, recoverStreak, redeemPromo, redeemReferralCode, refreshToken, regenerateBackupCodes, regenerateReferralCode, registerPush, registerPushServiceWorker, removeOrganizationMember, renamePasskey, renameUserSession, replayWebhookDelivery, requestEmailChange, rescheduleEmail, resetCircuitBreaker, resetDebugModeCache, resetPassword, resetPlatformCookieCache, resetPlatformJwksCache, restoreFile, restoreFileVersion, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, scheduleEmail, scheduleTask, search, sendEmail, sendEmailToUser, sendPush, sendTemplatedEmail, sessions, setConsents, setEnvVar, setPassword, setupTwoFactor, signIn, signOut, signUp, softDeleteFile, startPasskeyRegistration, streamToString, submitScore, suspendUser, switchOrg, toSylphxError, track, trackBatch, trackClick, triggerDeploy, unlockAchievement, unregisterPush, updateOrganization, updateOrganizationMemberRole, updatePromo, updatePushPreferences, updateRole, updateUser, updateUserMetadata, updateUserProfile, updateWebhookConfig, uploadAvatar, uploadFile, upsertDocument, user, userInfo, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ var __export = (target, all) => {
9
9
  };
10
10
 
11
11
  // src/constants.ts
12
- var SDK_API_PATH, DEFAULT_SDK_API_HOST, SDK_VERSION, SDK_PLATFORM, DEFAULT_TIMEOUT_MS, SESSION_TOKEN_LIFETIME_SECONDS, SESSION_TOKEN_LIFETIME_MS, REFRESH_TOKEN_LIFETIME_SECONDS, FLAGS_CACHE_TTL_MS, FLAGS_STALE_WHILE_REVALIDATE_MS, MAX_RETRY_DELAY_MS, BASE_RETRY_DELAY_MS, ANALYTICS_SESSION_TIMEOUT_MS, WEBHOOK_MAX_AGE_MS, WEBHOOK_CLOCK_SKEW_MS, PKCE_CODE_TTL_MS, JOBS_DLQ_MAX_AGE_MS, SESSION_REPLAY_MAX_DURATION_MS, FLAGS_EXPOSURE_DEDUPE_WINDOW_MS, CLICK_ID_EXPIRY_MS, STALE_TIME_FREQUENT_MS, STALE_TIME_MODERATE_MS, STALE_TIME_STABLE_MS, STALE_TIME_STATS_MS, NEW_USER_THRESHOLD_MS, STORAGE_MULTIPART_THRESHOLD_BYTES, STORAGE_DEFAULT_MAX_SIZE_BYTES, STORAGE_AVATAR_MAX_SIZE_BYTES, STORAGE_LARGE_MAX_SIZE_BYTES, JWK_CACHE_TTL_MS, CIRCUIT_BREAKER_FAILURE_THRESHOLD, CIRCUIT_BREAKER_WINDOW_MS, CIRCUIT_BREAKER_OPEN_DURATION_MS, ETAG_CACHE_MAX_ENTRIES, ETAG_CACHE_TTL_MS;
12
+ var SDK_API_PATH, DEFAULT_SDK_API_HOST, SDK_VERSION, SDK_PLATFORM, DEFAULT_TIMEOUT_MS, SANDBOX_CREATE_TIMEOUT_MS, SESSION_TOKEN_LIFETIME_SECONDS, SESSION_TOKEN_LIFETIME_MS, REFRESH_TOKEN_LIFETIME_SECONDS, FLAGS_CACHE_TTL_MS, FLAGS_STALE_WHILE_REVALIDATE_MS, MAX_RETRY_DELAY_MS, BASE_RETRY_DELAY_MS, ANALYTICS_SESSION_TIMEOUT_MS, WEBHOOK_MAX_AGE_MS, WEBHOOK_CLOCK_SKEW_MS, PKCE_CODE_TTL_MS, JOBS_DLQ_MAX_AGE_MS, SESSION_REPLAY_MAX_DURATION_MS, FLAGS_EXPOSURE_DEDUPE_WINDOW_MS, CLICK_ID_EXPIRY_MS, STALE_TIME_FREQUENT_MS, STALE_TIME_MODERATE_MS, STALE_TIME_STABLE_MS, STALE_TIME_STATS_MS, NEW_USER_THRESHOLD_MS, STORAGE_MULTIPART_THRESHOLD_BYTES, STORAGE_DEFAULT_MAX_SIZE_BYTES, STORAGE_AVATAR_MAX_SIZE_BYTES, STORAGE_LARGE_MAX_SIZE_BYTES, JWK_CACHE_TTL_MS, CIRCUIT_BREAKER_FAILURE_THRESHOLD, CIRCUIT_BREAKER_WINDOW_MS, CIRCUIT_BREAKER_OPEN_DURATION_MS, ETAG_CACHE_MAX_ENTRIES, ETAG_CACHE_TTL_MS;
13
13
  var init_constants = __esm({
14
14
  "src/constants.ts"() {
15
15
  "use strict";
@@ -18,6 +18,7 @@ var init_constants = __esm({
18
18
  SDK_VERSION = "0.5.0";
19
19
  SDK_PLATFORM = typeof window !== "undefined" ? "browser" : typeof process !== "undefined" && process.versions?.node ? "node" : "unknown";
20
20
  DEFAULT_TIMEOUT_MS = 3e4;
21
+ SANDBOX_CREATE_TIMEOUT_MS = 15e4;
21
22
  SESSION_TOKEN_LIFETIME_SECONDS = 5 * 60;
22
23
  SESSION_TOKEN_LIFETIME_MS = SESSION_TOKEN_LIFETIME_SECONDS * 1e3;
23
24
  REFRESH_TOKEN_LIFETIME_SECONDS = 30 * 24 * 60 * 60;
@@ -4878,7 +4879,7 @@ init_constants();
4878
4879
  init_errors();
4879
4880
  var LEGACY_EMBEDDED_REF_PATTERN = /^(pk|sk)_(dev|stg|prod|prev)_[a-z0-9]{12}_[a-f0-9]+$/;
4880
4881
  var LEGACY_APP_KEY_PATTERN = /^app_(dev|stg|prod|prev)_/;
4881
- var MIGRATION_MESSAGE = "API key format has changed. Use a sylphx:// connection URL instead.\n\nNew format: sylphx://pk_prod_{hex}@your-slug.sylphx.com\n\nGenerate new credentials from the Sylphx Console \u2192 Your App \u2192 Environments.\nSee https://docs.sylphx.com/migration for details.";
4882
+ var MIGRATION_MESSAGE = "API key format has changed. Use a sylphx:// connection URL instead.\n\nNew format: sylphx://pk_prod_{hex}@your-slug.api.sylphx.com\n\nGenerate new credentials from the Sylphx Console \u2192 Your App \u2192 Environments.\nSee https://docs.sylphx.com/migration for details.";
4882
4883
  function rejectLegacyKeyFormat(input) {
4883
4884
  const trimmed = input.trim().toLowerCase();
4884
4885
  if (LEGACY_APP_KEY_PATTERN.test(trimmed)) {
@@ -4921,7 +4922,7 @@ function createServerClient(input) {
4921
4922
  function createConfigFromUrl(url) {
4922
4923
  if (!url || typeof url !== "string") {
4923
4924
  throw new SylphxError(
4924
- "[Sylphx] Connection URL is required. Set SYLPHX_URL or NEXT_PUBLIC_SYLPHX_URL environment variable.\n\nFormat: sylphx://pk_prod_{hex}@your-slug.sylphx.com",
4925
+ "[Sylphx] Connection URL is required. Set SYLPHX_URL or NEXT_PUBLIC_SYLPHX_URL environment variable.\n\nFormat: sylphx://pk_prod_{hex}@your-slug.api.sylphx.com",
4925
4926
  { code: "BAD_REQUEST" }
4926
4927
  );
4927
4928
  }
@@ -4930,7 +4931,7 @@ function createConfigFromUrl(url) {
4930
4931
  if (!trimmed.startsWith("sylphx://")) {
4931
4932
  if (CREDENTIAL_REGEX.test(trimmed)) {
4932
4933
  throw new SylphxError(
4933
- "[Sylphx] Received a bare credential instead of a connection URL.\n\nWrap it in a connection URL: sylphx://<credential>@<slug>.sylphx.com\nOr use createClient({ slug, publicKey }) for explicit components.",
4934
+ "[Sylphx] Received a bare credential instead of a connection URL.\n\nWrap it in a connection URL: sylphx://<credential>@<slug>.api.sylphx.com\nOr use createClient({ slug, publicKey }) for explicit components.",
4934
4935
  { code: "BAD_REQUEST" }
4935
4936
  );
4936
4937
  }
@@ -4975,7 +4976,7 @@ function createConfigFromComponents(input) {
4975
4976
  const credentialType = match[1];
4976
4977
  const env = match[2];
4977
4978
  const slug = resolvedSlug.trim().toLowerCase();
4978
- const domain = input.domain?.trim() || "api.sylphx.com";
4979
+ const domain = input.domain?.trim() || DEFAULT_SDK_API_HOST;
4979
4980
  const baseUrl = `https://${slug}.${domain}/v1`;
4980
4981
  return freezeConfig({
4981
4982
  credential: trimmedCred,
@@ -4998,7 +4999,7 @@ function createConfigFromComponents(input) {
4998
4999
  const platform = input.platformUrl.trim().replace(/\/$/, "");
4999
5000
  baseUrl = platform.includes("/v1") ? platform : `${platform}/v1`;
5000
5001
  } else {
5001
- const domain = input.domain?.trim() || "api.sylphx.com";
5002
+ const domain = input.domain?.trim() || DEFAULT_SDK_API_HOST;
5002
5003
  baseUrl = `https://${slug}.${domain}/v1`;
5003
5004
  }
5004
5005
  return freezeConfig({
@@ -5994,7 +5995,7 @@ async function inviteUser(config, input) {
5994
5995
  async function switchOrg(config, orgId) {
5995
5996
  return callApi(config, "/auth/switch-org", {
5996
5997
  method: "POST",
5997
- body: JSON.stringify({ orgId })
5998
+ body: { orgId }
5998
5999
  });
5999
6000
  }
6000
6001
  var device = {
@@ -6695,6 +6696,8 @@ async function verifyAccessToken(token, opts) {
6695
6696
  const { payload } = await jwtVerify2(token, jwk, {
6696
6697
  audience: opts.audience
6697
6698
  });
6699
+ const cnfRaw = payload.cnf;
6700
+ const cnf = cnfRaw && typeof cnfRaw === "object" && "jkt" in cnfRaw ? { jkt: typeof cnfRaw.jkt === "string" ? cnfRaw.jkt : void 0 } : void 0;
6698
6701
  return {
6699
6702
  sub: payload.sub,
6700
6703
  pid: payload.pid,
@@ -6708,7 +6711,8 @@ async function verifyAccessToken(token, opts) {
6708
6711
  org_slug: payload.org_slug,
6709
6712
  org_role: payload.org_role,
6710
6713
  iat: payload.iat,
6711
- exp: payload.exp
6714
+ exp: payload.exp,
6715
+ ...cnf ? { cnf } : {}
6712
6716
  };
6713
6717
  } catch (err) {
6714
6718
  lastError = err;
@@ -9692,6 +9696,7 @@ async function captureMessage(config, message2, options = {}) {
9692
9696
  }
9693
9697
 
9694
9698
  // src/sandbox.ts
9699
+ init_constants();
9695
9700
  var SandboxFiles = class {
9696
9701
  constructor(endpoint, token) {
9697
9702
  this.endpoint = endpoint;
@@ -9916,7 +9921,8 @@ var SandboxClient = class _SandboxClient {
9916
9921
  env: options?.env,
9917
9922
  storage: options?.storageGi !== void 0 ? { enabled: true, sizeGi: options.storageGi } : void 0,
9918
9923
  volumeMounts: options?.volumeMounts
9919
- }
9924
+ },
9925
+ timeout: options?.createTimeoutMs ?? SANDBOX_CREATE_TIMEOUT_MS
9920
9926
  });
9921
9927
  return new _SandboxClient(record.id, config, record.endpoint, record.token);
9922
9928
  }
@@ -10477,6 +10483,7 @@ async function markAllSecurityAlertsRead(config) {
10477
10483
  }
10478
10484
 
10479
10485
  // src/oauth.ts
10486
+ init_errors();
10480
10487
  async function getOidcDiscoveryDocument(opts) {
10481
10488
  const url = `${opts.baseUrl.replace(/\/$/, "")}/.well-known/openid-configuration`;
10482
10489
  const res = await fetch(url, { headers: { accept: "application/json" } });
@@ -10513,6 +10520,27 @@ async function authorizeOAuth(config, input) {
10513
10520
  }
10514
10521
  });
10515
10522
  }
10523
+ async function listOAuthProviders(config) {
10524
+ return callApi(config, "/auth/oauth-providers");
10525
+ }
10526
+ async function exchangeOAuthCode(config, input) {
10527
+ if (config.credentialType !== "pk" || !config.publicKey) {
10528
+ throw new SylphxError(
10529
+ "[Sylphx] exchangeOAuthCode() requires a publishable connection URL (pk_*).",
10530
+ { code: "BAD_REQUEST" }
10531
+ );
10532
+ }
10533
+ return callApi(config, "/auth/token", {
10534
+ method: "POST",
10535
+ body: {
10536
+ grant_type: "authorization_code",
10537
+ code: input.code,
10538
+ client_id: config.publicKey,
10539
+ code_verifier: input.codeVerifier,
10540
+ ...input.anonymousId ? { anonymous_id: input.anonymousId } : {}
10541
+ }
10542
+ });
10543
+ }
10516
10544
  function parseOAuthCallback(url) {
10517
10545
  const parsed = new URL(url);
10518
10546
  return {
@@ -10686,6 +10714,7 @@ export {
10686
10714
  dpop,
10687
10715
  embed,
10688
10716
  enableDebug,
10717
+ exchangeOAuthCode,
10689
10718
  exponentialBackoff,
10690
10719
  exportUserData,
10691
10720
  extendedSignUp,
@@ -10801,6 +10830,7 @@ export {
10801
10830
  linkAnonymousConsents,
10802
10831
  listEnvVars,
10803
10832
  listFileVersions,
10833
+ listOAuthProviders,
10804
10834
  listPasskeys,
10805
10835
  listPermissions,
10806
10836
  listPromoRedemptions,