@sylphx/sdk 0.10.0 → 0.10.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/README.md CHANGED
@@ -26,20 +26,21 @@ bun add @sylphx/sdk
26
26
 
27
27
  ### 1. Environment Variables
28
28
 
29
- Your server connection URL and environment app ID from your
30
- [Platform Console](https://sylphx.com/console):
29
+ Your server and browser connection URLs from your
30
+ [Platform Console](https://sylphx.com/console). Sylphx deploys inject these
31
+ automatically; local development can pull the same values into `.env.local`.
31
32
 
32
33
  ```bash
33
34
  # .env.local
34
- SYLPHX_URL=sylphx://sk_dev_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@bold-river-a1b2c3.api.sylphx.com
35
- NEXT_PUBLIC_SYLPHX_APP_ID=app_dev_xxxxxxxxxxxx
35
+ SYLPHX_SECRET_URL=sylphx://sk_dev_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@bold-river-a1b2c3.api.sylphx.com
36
+ NEXT_PUBLIC_SYLPHX_URL=sylphx://pk_dev_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@bold-river-a1b2c3.api.sylphx.com
36
37
  ```
37
38
 
38
39
  That's it. No other config needed.
39
40
 
40
41
  > **Key formats**
41
42
  > - `sylphx://sk_*@<tenant-slug>.api.sylphx.com` — Server connection URL (server only, never expose)
42
- > - `app_dev_*` / `app_stg_*` / `app_prod_*` App ID (safe for client-side)
43
+ > - `sylphx://pk_*@<tenant-slug>.api.sylphx.com` Browser connection URL (publishable)
43
44
  >
44
45
  > Get both from **Console → Your App → API Keys**. The hosted BaaS API is always
45
46
  > addressed as `<tenant-slug>.api.sylphx.com`.
@@ -78,7 +79,7 @@ import { SylphxProvider } from '@sylphx/sdk/react'
78
79
  import { createServerClient } from '@sylphx/sdk'
79
80
 
80
81
  export default async function RootLayout({ children }: { children: React.ReactNode }) {
81
- const sylphx = createServerClient(process.env.SYLPHX_URL!)
82
+ const sylphx = createServerClient(process.env.SYLPHX_SECRET_URL!)
82
83
  const apiUrl = sylphx.baseUrl.replace(/\/v[0-9]+$/, '')
83
84
 
84
85
  const config = await getAppConfig({
@@ -169,7 +170,7 @@ const userId = await currentUserId()
169
170
  ```ts
170
171
  import { createServerClient, getPlans, track } from '@sylphx/sdk'
171
172
 
172
- const sylphx = createServerClient(process.env.SYLPHX_URL!)
173
+ const sylphx = createServerClient(process.env.SYLPHX_SECRET_URL!)
173
174
 
174
175
  // Billing
175
176
  const plans = await getPlans(sylphx)
@@ -189,7 +190,7 @@ import {
189
190
  } from '@sylphx/sdk/server'
190
191
  import { createServerClient } from '@sylphx/sdk'
191
192
 
192
- const sylphx = createServerClient(process.env.SYLPHX_URL!)
193
+ const sylphx = createServerClient(process.env.SYLPHX_SECRET_URL!)
193
194
 
194
195
  const config = await getAppConfig({
195
196
  secretKey: sylphx.secretKey!,
@@ -210,7 +211,7 @@ export async function POST(request: Request) {
210
211
  const result = await verifyWebhook({
211
212
  payload: body,
212
213
  signatureHeader: request.headers.get('x-webhook-signature'),
213
- secret: process.env.SYLPHX_SECRET_KEY!,
214
+ secret: process.env.SYLPHX_WEBHOOK_SECRET!,
214
215
  })
215
216
 
216
217
  if (!result.valid) {
@@ -229,7 +230,7 @@ Or use the handler factory:
229
230
  import { createWebhookHandler } from '@sylphx/sdk/server'
230
231
 
231
232
  export const POST = createWebhookHandler({
232
- secret: process.env.SYLPHX_SECRET_KEY!,
233
+ secret: process.env.SYLPHX_WEBHOOK_SECRET!,
233
234
  handlers: {
234
235
  'user.created': async (data) => { /* ... */ },
235
236
  'subscription.updated': async (data) => { /* ... */ },
@@ -243,7 +244,7 @@ export const POST = createWebhookHandler({
243
244
  import { verifyAccessToken } from '@sylphx/sdk/server'
244
245
 
245
246
  const payload = await verifyAccessToken(token, {
246
- secretKey: process.env.SYLPHX_SECRET_KEY!,
247
+ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
247
248
  })
248
249
  // payload.sub, payload.email, payload.role, payload.app_id
249
250
  ```
@@ -378,7 +379,7 @@ For non-React environments or maximum control:
378
379
  ```ts
379
380
  import { createClient, signIn, track, getPlans } from '@sylphx/sdk'
380
381
 
381
- const config = createClient(process.env.SYLPHX_URL!)
382
+ const config = createClient(process.env.NEXT_PUBLIC_SYLPHX_URL!)
382
383
 
383
384
  // Auth
384
385
  const tokens = await signIn(config, { email, password })
package/dist/index.d.ts CHANGED
@@ -95,7 +95,7 @@ interface PlatformRealtimeDeleteChannelResult {
95
95
  *
96
96
  * Invariants:
97
97
  * - Protocol is always `sylphx:` (no exceptions)
98
- * - Credential matches `(pk|sk)_(dev|stg|prod|prev)_[a-f0-9]{32,64}`
98
+ * - Credential matches `(pk|sk)_(dev|stg|prod|prev)(_{ref})?_{hex}`
99
99
  * - Host's first DNS label is the resource slug (validated by slug regex)
100
100
  * - `apiBaseUrl` is always HTTPS, with `/v{version}` appended (default `v1`)
101
101
  *
@@ -135,7 +135,7 @@ declare class InvalidConnectionUrlError extends Error {
135
135
  * import { createClient } from '@sylphx/sdk'
136
136
  *
137
137
  * const sylphx = createClient(process.env.SYLPHX_URL!)
138
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
138
+ * // Parses: sylphx://pk_prod_{ref?}_{hex}@bold-river-a1b2c3.api.sylphx.com
139
139
  * ```
140
140
  */
141
141
 
@@ -207,7 +207,7 @@ interface SylphxClientInput {
207
207
  * @example Connection URL (recommended)
208
208
  * ```typescript
209
209
  * const sylphx = createClient(process.env.NEXT_PUBLIC_SYLPHX_URL!)
210
- * // Parses: sylphx://pk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
210
+ * // Parses: sylphx://pk_prod_{ref?}_{hex}@bold-river-a1b2c3.api.sylphx.com
211
211
  * ```
212
212
  *
213
213
  * @example Explicit components
@@ -228,7 +228,7 @@ declare function createClient(input: string | SylphxClientInput): SylphxConfig;
228
228
  * @example Connection URL (recommended)
229
229
  * ```typescript
230
230
  * const sylphx = createServerClient(process.env.SYLPHX_SECRET_URL!)
231
- * // Parses: sylphx://sk_prod_{hex}@bold-river-a1b2c3.api.sylphx.com
231
+ * // Parses: sylphx://sk_prod_{ref?}_{hex}@bold-river-a1b2c3.api.sylphx.com
232
232
  * ```
233
233
  *
234
234
  * @example Explicit components
@@ -354,7 +354,7 @@ declare function installGlobalDebugHelpers(): void;
354
354
  * import { createRestClient } from '@sylphx/sdk'
355
355
  *
356
356
  * const client = createRestClient({
357
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
357
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
358
358
  * })
359
359
  *
360
360
  * const { data: user, error } = await client.GET('/auth/me')
@@ -488,6 +488,10 @@ interface Middleware {
488
488
  onRequest?: (ctx: {
489
489
  request: Request;
490
490
  }) => Promise<Request | undefined> | Request | undefined;
491
+ onFetch?: (ctx: {
492
+ request: Request;
493
+ next: (request: Request) => Promise<Response>;
494
+ }) => Promise<Response | undefined> | Response | undefined;
491
495
  onResponse?: (ctx: {
492
496
  request: Request;
493
497
  response: Response;
@@ -573,7 +577,7 @@ declare function getCircuitBreakerState(): {
573
577
  * @example
574
578
  * ```typescript
575
579
  * const client = createRestClient({
576
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
580
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
577
581
  * })
578
582
  *
579
583
  * const { data: user } = await client.GET('/auth/me')
@@ -594,7 +598,7 @@ declare function createRestClient(config: RestClientConfig): RestClient;
594
598
  * @example
595
599
  * ```typescript
596
600
  * const client = createDynamicRestClient({
597
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
601
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
598
602
  * getAccessToken: async () => (await cookies()).get('session')?.value,
599
603
  * })
600
604
  * ```
@@ -1912,6 +1916,18 @@ interface OrgTokenPayload {
1912
1916
  /** RBAC role key (e.g. "hr_manager", "admin"). Permissions resolved server-side. */
1913
1917
  org_role: string;
1914
1918
  }
1919
+ interface OrgScopedTokenResponse {
1920
+ /** Org-scoped access token. */
1921
+ token: string;
1922
+ /** Org-scoped access token, matching the SDK's token naming convention. */
1923
+ accessToken: string;
1924
+ /** Token lifetime in seconds, when provided by the runtime. */
1925
+ expiresIn?: number;
1926
+ /** Bearer token type, when provided by the runtime. */
1927
+ tokenType?: string;
1928
+ /** User envelope returned by the runtime for session hydration. */
1929
+ user?: User;
1930
+ }
1915
1931
  /**
1916
1932
  * Invite a user request payload.
1917
1933
  */
@@ -2129,9 +2145,14 @@ declare function inviteUser(config: SylphxConfig, input: InviteUserRequest): Pro
2129
2145
  * The returned access_token JWT includes org_id, org_slug, org_role claims.
2130
2146
  *
2131
2147
  * @example
2132
- * const tokens = await switchOrg(withToken(config, currentToken), 'org_xxx')
2148
+ * const { token } = await getOrgScopedToken(withToken(config, currentToken), 'org_xxx')
2149
+ */
2150
+ declare function getOrgScopedToken(config: SylphxConfig, orgId: string): Promise<OrgScopedTokenResponse>;
2151
+ /**
2152
+ * @deprecated Use getOrgScopedToken(config, orgId). Kept as the shorter
2153
+ * organization switch alias for existing SDK callers.
2133
2154
  */
2134
- declare function switchOrg(config: SylphxConfig, orgId: string): Promise<TokenResponse>;
2155
+ declare function switchOrg(config: SylphxConfig, orgId: string): Promise<OrgScopedTokenResponse>;
2135
2156
  type DeviceInitInput = DeviceInitRequest;
2136
2157
  type DeviceGrant = DeviceInitResponse;
2137
2158
  type DevicePollResult = DevicePollResponse;
@@ -3371,7 +3392,7 @@ interface StreamMessage<T = unknown> {
3371
3392
  * import { createConfig, realtimeEmit } from '@sylphx/sdk'
3372
3393
  *
3373
3394
  * // Server: emit events to connected clients
3374
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
3395
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
3375
3396
  * await realtimeEmit(config, {
3376
3397
  * channel: 'orders',
3377
3398
  * event: 'order.created',
@@ -3694,9 +3715,8 @@ declare function createTracker(config: SylphxConfig, defaultAnonymousId?: string
3694
3715
  * Features (built-in defaults, ADR-100 §2.8):
3695
3716
  * - Idempotency-Key auto-generated (UUIDv7) on every POST
3696
3717
  * - Single-part PUT or multipart, picked server-side from `size`
3697
- * - Streaming SHA-256 (browser `crypto.subtle.digest` / node `crypto.createHash`)
3698
- * - Resumable: persists `(uploadId, completedParts[])` to localStorage
3699
- * (browser) or `~/.sylphx/uploads.json` (node)
3718
+ * - Streaming SHA-256 via the Web Crypto API
3719
+ * - Resumable: persists `(uploadId, completedParts[])` to localStorage when available
3700
3720
  * - AbortSignal cancellation; auto-DELETE upload session on abort
3701
3721
  * - Exponential backoff with full jitter (5 retries, 1s base, 30s cap)
3702
3722
  * - Progress: byte-accurate via XHR (browser) or stream sampling (node)
@@ -6075,7 +6095,7 @@ declare function assignMemberRole(config: SylphxConfig, orgIdOrSlug: string, mem
6075
6095
  * import { createConfig, getSecret, getSecrets, listSecretKeys } from '@sylphx/sdk'
6076
6096
  *
6077
6097
  * const config = createConfig({
6078
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
6098
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
6079
6099
  * })
6080
6100
  *
6081
6101
  * // Get a single secret
@@ -6226,7 +6246,7 @@ declare function getAllSecrets(config: SylphxConfig, environmentId?: string): Pr
6226
6246
  * import { createConfig, indexDocument, search, batchIndex } from '@sylphx/sdk'
6227
6247
  *
6228
6248
  * const config = createConfig({
6229
- * secretKey: process.env.SYLPHX_SECRET_KEY!,
6249
+ * secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey!,
6230
6250
  * })
6231
6251
  *
6232
6252
  * // Index a document
@@ -6642,7 +6662,7 @@ declare function trackClick(config: SylphxConfig, input: TrackClickInput): Promi
6642
6662
  * ```ts
6643
6663
  * import { createConfig, getDatabaseConnectionString } from '@sylphx/sdk'
6644
6664
  *
6645
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
6665
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
6646
6666
  * const { connectionString } = await getDatabaseConnectionString(config)
6647
6667
  *
6648
6668
  * const pool = new Pool({ connectionString })
@@ -6757,7 +6777,7 @@ interface KvZMember {
6757
6777
  * ```ts
6758
6778
  * import { createConfig, kvSet, kvGet, kvDelete } from '@sylphx/sdk'
6759
6779
  *
6760
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
6780
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
6761
6781
  *
6762
6782
  * // Basic key-value operations
6763
6783
  * await kvSet(config, { key: 'user:123', value: { name: 'Alice' }, ex: 3600 })
@@ -7103,7 +7123,7 @@ declare function kvSetJSON<T>(config: SylphxConfig, key: string, value: T, optio
7103
7123
  * ```ts
7104
7124
  * import { createConfig, triggerDeploy, getDeployStatus } from '@sylphx/sdk'
7105
7125
  *
7106
- * const config = createConfig({ secretKey: process.env.SYLPHX_SECRET_KEY! })
7126
+ * const config = createConfig({ secretKey: createServerClient(process.env.SYLPHX_SECRET_URL!).secretKey! })
7107
7127
  *
7108
7128
  * // Trigger a deployment
7109
7129
  * const deploy = await triggerDeploy(config, { envId: 'env_prod_xxx' })
@@ -7462,7 +7482,7 @@ declare function captureMessage(config: SylphxConfig, message: string, options?:
7462
7482
  * ```typescript
7463
7483
  * import { createServerClient, SandboxClient } from '@sylphx/sdk'
7464
7484
  *
7465
- * const config = createServerClient(process.env.SYLPHX_URL!)
7485
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
7466
7486
  *
7467
7487
  * // Create sandbox (Platform waits for pod ready before returning)
7468
7488
  * const sandbox = await SandboxClient.create(config)
@@ -7817,7 +7837,7 @@ declare class SandboxClient {
7817
7837
  * ```typescript
7818
7838
  * import { createServerClient, RunsClient } from '@sylphx/sdk'
7819
7839
  *
7820
- * const config = createServerClient(process.env.SYLPHX_URL!)
7840
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
7821
7841
  *
7822
7842
  * const run = await RunsClient.create(config, {
7823
7843
  * image: 'registry.sylphx.com/sylphx/my-trainer:abc123',
@@ -8052,7 +8072,7 @@ declare class RunHandle {
8052
8072
  *
8053
8073
  * @example
8054
8074
  * ```typescript
8055
- * const config = createServerClient(process.env.SYLPHX_URL!)
8075
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
8056
8076
  *
8057
8077
  * // Run a worker and wait for completion
8058
8078
  * const result = await RunsClient.create(config, { ... }).then(w => w.wait())
@@ -8197,7 +8217,7 @@ declare const WorkersClient: {
8197
8217
  * ### Cron → Task
8198
8218
  * ```typescript
8199
8219
  * import { createServerClient, TriggersClient } from '@sylphx/sdk'
8200
- * const config = createServerClient(process.env.SYLPHX_URL!)
8220
+ * const config = createServerClient(process.env.SYLPHX_SECRET_URL!)
8201
8221
  *
8202
8222
  * const trigger = await TriggersClient.create(config, {
8203
8223
  * name: 'daily-cleanup',
@@ -9274,4 +9294,4 @@ declare const functions: {
9274
9294
  };
9275
9295
  };
9276
9296
 
9277
- 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 CopyFileOptions, 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 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 ListFilesOptions, 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 ResendEmailVerificationRequest, type ResendEmailVerificationResponse, 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, StepCompleteSignal, StepSleepSignal, 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 UploadCreateOptions, type UploadProgressEvent, 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, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, 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, 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, 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, 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, resendVerificationEmail, resetCircuitBreaker, resetDebugModeCache, resetPassword, resetPlatformCookieCache, resetPlatformJwksCache, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, scheduleEmail, scheduleTask, search, sendEmail, sendEmailToUser, sendPush, sendTemplatedEmail, sessions, setConsents, setEnvVar, setPassword, setupTwoFactor, signIn, signOut, signUp, startPasskeyRegistration, storage, streamToString, submitScore, suspendUser, switchOrg, toSylphxError, track, trackBatch, trackClick, triggerDeploy, unlockAchievement, unregisterPush, updateOrganization, updateOrganizationMemberRole, updatePromo, updatePushPreferences, updateRole, updateUser, updateUserMetadata, updateUserProfile, updateWebhookConfig, upsertDocument, user, userInfo, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };
9297
+ 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 CopyFileOptions, 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 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 ListFilesOptions, 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 OrgScopedTokenResponse, 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 ResendEmailVerificationRequest, type ResendEmailVerificationResponse, 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, StepCompleteSignal, StepSleepSignal, 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 UploadCreateOptions, type UploadProgressEvent, 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, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, 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, getFlagPayload, getFlags, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrgScopedToken, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, 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, 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, resendVerificationEmail, resetCircuitBreaker, resetDebugModeCache, resetPassword, resetPlatformCookieCache, resetPlatformJwksCache, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, scheduleEmail, scheduleTask, search, sendEmail, sendEmailToUser, sendPush, sendTemplatedEmail, sessions, setConsents, setEnvVar, setPassword, setupTwoFactor, signIn, signOut, signUp, startPasskeyRegistration, storage, streamToString, submitScore, suspendUser, switchOrg, toSylphxError, track, trackBatch, trackClick, triggerDeploy, unlockAchievement, unregisterPush, updateOrganization, updateOrganizationMemberRole, updatePromo, updatePushPreferences, updateRole, updateUser, updateUserMetadata, updateUserProfile, updateWebhookConfig, upsertDocument, user, userInfo, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };