@sylphx/sdk 0.15.4 → 0.17.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
@@ -8067,6 +8067,100 @@ interface FileEvent {
8067
8067
  path: string;
8068
8068
  event: 'created' | 'modified' | 'deleted';
8069
8069
  }
8070
+ type BrowserSessionStatus = 'starting' | 'ready' | 'exited';
8071
+ /** Persistent headful browser session running inside the sandbox. */
8072
+ interface BrowserSessionInfo {
8073
+ id: string;
8074
+ status: BrowserSessionStatus;
8075
+ /** OS pid of the Chrome browser process (0 if not surfaced). */
8076
+ pid: number;
8077
+ /** Remote-debugging port the headful Chrome listens on (loopback, private to the sandbox). */
8078
+ debugPort: number;
8079
+ /**
8080
+ * Sandbox-internal loopback CDP/DevTools WebSocket endpoint (ws://127.0.0.1:…).
8081
+ * NOT reachable from outside the sandbox — connect via `connectUrl()` /
8082
+ * `connect()` which route through the authenticated proxy. Surfaced for
8083
+ * introspection only.
8084
+ */
8085
+ cdpEndpoint: string | null;
8086
+ /** Persistent profile directory on the workspace volume. */
8087
+ userDataDir: string;
8088
+ /** Virtual display Chrome renders to. */
8089
+ display: string;
8090
+ startedAt: string;
8091
+ exitedAt: string | null;
8092
+ }
8093
+ interface BrowserCreateOptions {
8094
+ /**
8095
+ * Persistent profile to attach (defaults to the new session id). Pass an
8096
+ * explicit, stable value to deliberately reuse cookies/localStorage/auth
8097
+ * across sessions — the profile lives on the workspace volume and survives
8098
+ * session teardown.
8099
+ */
8100
+ profile?: string;
8101
+ }
8102
+ type ComputerSessionStatus = 'starting' | 'ready' | 'exited';
8103
+ /** Persistent desktop (computer-use) session running inside the sandbox. */
8104
+ interface ComputerSessionInfo {
8105
+ id: string;
8106
+ status: ComputerSessionStatus;
8107
+ /** OS pid of the Xvfb X-server process. */
8108
+ pid: number;
8109
+ /** The X display the desktop renders to (e.g. ":100"), private to the sandbox. */
8110
+ display: string;
8111
+ /** Screen geometry the desktop renders at (e.g. "1280x800x24"). */
8112
+ screen: string;
8113
+ /** Per-session scratch directory on the workspace volume. */
8114
+ workspaceDir: string;
8115
+ startedAt: string;
8116
+ exitedAt: string | null;
8117
+ }
8118
+ /** Image-encoding format for a desktop screenshot. */
8119
+ type ComputerScreenshotFormat = 'png' | 'jpeg';
8120
+ /**
8121
+ * A computer-use input action (mirrors Anthropic Computer Use / OpenAI CUA).
8122
+ * Coordinates are device pixels on the session display. The exec-server
8123
+ * validates every action structurally before executing it.
8124
+ */
8125
+ type ComputerInputAction = {
8126
+ action: 'mouse_move';
8127
+ x: number;
8128
+ y: number;
8129
+ } | {
8130
+ action: 'left_click';
8131
+ x?: number;
8132
+ y?: number;
8133
+ } | {
8134
+ action: 'right_click';
8135
+ x?: number;
8136
+ y?: number;
8137
+ } | {
8138
+ action: 'middle_click';
8139
+ x?: number;
8140
+ y?: number;
8141
+ } | {
8142
+ action: 'double_click';
8143
+ x?: number;
8144
+ y?: number;
8145
+ } | {
8146
+ action: 'type';
8147
+ text: string;
8148
+ } | {
8149
+ action: 'key';
8150
+ keys: string;
8151
+ } | {
8152
+ action: 'scroll';
8153
+ x: number;
8154
+ y: number;
8155
+ dx: number;
8156
+ dy: number;
8157
+ } | {
8158
+ action: 'drag';
8159
+ x: number;
8160
+ y: number;
8161
+ toX: number;
8162
+ toY: number;
8163
+ };
8070
8164
  interface SandboxRecord {
8071
8165
  id: string;
8072
8166
  status: 'starting' | 'running' | 'idle' | 'terminated' | 'error';
@@ -8138,6 +8232,131 @@ declare class SandboxWatch {
8138
8232
  /** Stop watching a path. */
8139
8233
  remove(path: string): Promise<void>;
8140
8234
  }
8235
+ /**
8236
+ * Provision and drive persistent, headful, stealth browser sessions inside the
8237
+ * sandbox. The Platform owns the connectable browser primitive; the customer
8238
+ * app owns session→task mapping, navigation, and scraping — it drives the live
8239
+ * session over the Chrome DevTools Protocol (CDP).
8240
+ *
8241
+ * Lifecycle is thin pass-through to the sandbox exec-server's `/browser` routes
8242
+ * (direct connection, per-sandbox JWT — Platform is not in the data path). The
8243
+ * browser's CDP port is bound to loopback inside the sandbox; `connectUrl()` /
8244
+ * `connect()` reach it ONLY through the exec-server's authenticated CDP proxy.
8245
+ *
8246
+ * @example
8247
+ * ```typescript
8248
+ * const session = await sandbox.browser!.create({ profile: 'acme-login' })
8249
+ * // Drive it with your CDP client of choice:
8250
+ * import { chromium } from 'playwright'
8251
+ * const browser = await chromium.connectOverCDP(sandbox.browser!.connectUrl(session.id))
8252
+ * // ... navigate / scrape ...
8253
+ * await sandbox.browser!.destroy(session.id)
8254
+ * ```
8255
+ */
8256
+ declare class SandboxBrowser {
8257
+ private readonly endpoint;
8258
+ private readonly token;
8259
+ constructor(endpoint: string, token: string);
8260
+ private authHeader;
8261
+ /**
8262
+ * Create + start a persistent headful browser session. Resolves once the
8263
+ * session's CDP endpoint is available (201 from the exec-server).
8264
+ */
8265
+ create(opts?: BrowserCreateOptions): Promise<BrowserSessionInfo>;
8266
+ /** List live browser sessions in this sandbox. */
8267
+ list(): Promise<BrowserSessionInfo[]>;
8268
+ /** Get full info for a session, or null if it does not exist. */
8269
+ get(sessionId: string): Promise<BrowserSessionInfo | null>;
8270
+ /**
8271
+ * Build the authenticated CDP connect URL for a session — a `wss://…` URL on
8272
+ * the sandbox's public endpoint that proxies to the sandbox-internal loopback CDP. Pass
8273
+ * it to any CDP client (`chromium.connectOverCDP(url)` / raw `WebSocket`).
8274
+ *
8275
+ * The token is carried as a query param because WebSocket clients cannot set
8276
+ * custom headers in browsers (equally secure over TLS). The URL is derived
8277
+ * locally from the session id, so this is synchronous and does no I/O. For a
8278
+ * not-yet-ready session the upstream proxy returns HTTP 409 at connect time.
8279
+ */
8280
+ connectUrl(sessionId: string): string;
8281
+ /**
8282
+ * Open a raw WebSocket to a session's CDP endpoint through the authenticated
8283
+ * proxy. Most callers want `connectUrl()` to hand to a higher-level CDP
8284
+ * client; use this only for a hand-rolled CDP connection.
8285
+ */
8286
+ connect(sessionId: string): WebSocket;
8287
+ /**
8288
+ * Fetch the CDP connection details from the exec-server: the sandbox-internal loopback
8289
+ * `cdpEndpoint` (introspection only), the `debugPort`, and the authenticated
8290
+ * `connectUrl`. Throws 409 if the session is not ready yet, 404 if unknown.
8291
+ */
8292
+ cdp(sessionId: string): Promise<{
8293
+ cdpEndpoint: string;
8294
+ debugPort: number;
8295
+ connectUrl: string;
8296
+ }>;
8297
+ /**
8298
+ * Destroy a session. The browser is torn down; its persistent profile on the
8299
+ * workspace volume is preserved (reuse it via `create({ profile })`).
8300
+ * Returns false if the session did not exist.
8301
+ */
8302
+ destroy(sessionId: string): Promise<boolean>;
8303
+ }
8304
+ /**
8305
+ * Provision and drive persistent desktop (computer-use) sessions inside the
8306
+ * sandbox — the full-GUI sibling of {@link SandboxBrowser} (ADR-207). The
8307
+ * Platform owns the connectable, drivable desktop primitive (Xvfb display +
8308
+ * window manager + screenshot + input); the customer app owns the agent harness
8309
+ * — the screenshot → reason → action loop — exactly the shape Anthropic Computer
8310
+ * Use / OpenAI CUA expect the developer to supply.
8311
+ *
8312
+ * Lifecycle + screenshot + input are thin pass-throughs to the sandbox
8313
+ * exec-server's `/computer` routes (direct connection, per-sandbox JWT —
8314
+ * Platform is not in the data path). The desktop display + input are
8315
+ * RCE-equivalent and stay LOCAL to the sandbox; the only external surface is the
8316
+ * exec-server's authenticated HTTP routes (screenshot/input are request/
8317
+ * response, not a socket).
8318
+ *
8319
+ * @example
8320
+ * ```typescript
8321
+ * const session = await sandbox.computer!.create()
8322
+ * const png = await sandbox.computer!.screenshot(session.id) // Uint8Array
8323
+ * await sandbox.computer!.input(session.id, { action: 'left_click', x: 100, y: 200 })
8324
+ * await sandbox.computer!.input(session.id, { action: 'type', text: 'hello' })
8325
+ * await sandbox.computer!.destroy(session.id)
8326
+ * ```
8327
+ */
8328
+ declare class SandboxComputer {
8329
+ private readonly endpoint;
8330
+ private readonly token;
8331
+ constructor(endpoint: string, token: string);
8332
+ private authHeader;
8333
+ /**
8334
+ * Create + start a persistent desktop session. Resolves once the desktop
8335
+ * (Xvfb + window manager) is up (201 from the exec-server).
8336
+ */
8337
+ create(): Promise<ComputerSessionInfo>;
8338
+ /** List live desktop sessions in this sandbox. */
8339
+ list(): Promise<ComputerSessionInfo[]>;
8340
+ /** Get full info for a session, or null if it does not exist. */
8341
+ get(sessionId: string): Promise<ComputerSessionInfo | null>;
8342
+ /**
8343
+ * Capture the desktop framebuffer as encoded image bytes. Returns the raw
8344
+ * PNG (default) or JPEG body. Pass `'jpeg'` for a smaller, lossy capture.
8345
+ */
8346
+ screenshot(sessionId: string, format?: ComputerScreenshotFormat): Promise<Uint8Array>;
8347
+ /**
8348
+ * Execute a single input action against the desktop (mouse / keyboard /
8349
+ * scroll / drag). The exec-server validates the action structurally before
8350
+ * executing it; an invalid action throws.
8351
+ */
8352
+ input(sessionId: string, action: ComputerInputAction): Promise<void>;
8353
+ /**
8354
+ * Destroy a session. The desktop is torn down; its per-session scratch dir on
8355
+ * the workspace volume is preserved. Returns false if the session did not
8356
+ * exist.
8357
+ */
8358
+ destroy(sessionId: string): Promise<boolean>;
8359
+ }
8141
8360
  declare class SandboxClient {
8142
8361
  readonly id: string;
8143
8362
  private readonly config;
@@ -8151,6 +8370,10 @@ declare class SandboxClient {
8151
8370
  readonly processes: SandboxProcesses | null;
8152
8371
  /** Filesystem watch management (direct to exec-server) */
8153
8372
  readonly watch: SandboxWatch | null;
8373
+ /** Persistent headful browser sessions (direct to exec-server — ADR-205) */
8374
+ readonly browser: SandboxBrowser | null;
8375
+ /** Persistent desktop (computer-use) sessions (direct to exec-server — ADR-207) */
8376
+ readonly computer: SandboxComputer | null;
8154
8377
  private constructor();
8155
8378
  /**
8156
8379
  * Create a new sandbox.
@@ -9700,4 +9923,4 @@ declare const functions: {
9700
9923
  };
9701
9924
  };
9702
9925
 
9703
- 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, BILLING_ALLOWED_ROLES, BUILD_MINUTES_INCLUDED, BUILD_MINUTE_PRICES, BUILD_SIZE_MULTIPLIERS, BYTES_PER_GB, type BackupCodesResult, type BatchEvent, type BatchIndexInput, type BatchIndexResult, type BillingAllowedRole, type Breadcrumb, type BuildConnectionUrlInput, type BuildLog, type BuildLogHistoryResponse, type BuildMachineTier, CI_BUILD_MINUTE_PRICE_MICRODOLLARS, CI_FREE_MINUTES_PER_MONTH, CI_MACOS_MULTIPLIER, CI_MACOS_SIZE_MULTIPLIERS, CI_SIZE_MULTIPLIERS, COMPUTE_PRICE_PER_HOUR_MICRODOLLARS, COMPUTE_RAM_RATE_MICRODOLLARS, COMPUTE_VCPU_ACTIVE_RATE_MICRODOLLARS, COMPUTE_VCPU_IDLE_RATE_MICRODOLLARS, CONSOLE_APP_SLUG, CREDENTIAL_REGEX, CREDIT_EXPIRY_MONTHS, 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 ConnectionCredentialType, type ConnectionEnv, 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, DEFAULT_MAX_INSTANCES, DEFAULT_POINTS_REWARD, DISCOUNT_DURATION_MONTHS, DISCOUNT_PERCENT, 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 ErrorDetails$1 as ExtractedErrorDetails, FREE_COMPUTE_HOURS, FREE_STORAGE_GB, type FacetsResponse, type FileEvent, type FlagContext, type FlagResult, type GetConsentHistoryInput, type GetConsentsInput, type GetFacetsInput, type GetSecretInput, type GetSecretResult, type GetSecretsInput, type GetSecretsResult, HOURS_PER_MONTH, type HttpTarget, INSTANCE_TYPES, INSTANCE_TYPE_ALIASES, INSTANCE_TYPE_ORDER, INVOICE_DUE_DAYS, type IdentifyInput, type ImpersonationActive, type ImpersonationEndResult, type ImpersonationInfo, type ImpersonationStartResult, type IndexDocumentInput, type IndexDocumentResult, type IngestLogsResult, type InstanceTypeDefinition, type InstanceTypeId, InvalidConnectionUrlError, type InviteMemberInput, type InviteUserRequest, type InviteUserResponse, KV_FREE_STORAGE_GB, type KvExpireRequest, type KvHgetRequest, type KvHgetallRequest, type KvHsetRequest, type KvIncrRequest, type KvLpushRequest, type KvLrangeRequest, type KvMetric, type KvMgetRequest, type KvMsetRequest, type KvRateLimitRequest, type KvRateLimitResult, type KvScanOptions, type KvScanResult, type KvSetOptions, type KvSetRequest, type KvZMember, type KvZaddRequest, type KvZrangeRequest, LEGACY_INSTANCE_TYPE_ORDER, 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, MAX_PASSWORD_LENGTH, MAX_PAYMENT_ATTEMPTS, MICRODOLLARS_PER_CENT, MIN_PASSWORD_LENGTH, 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 OrganizationsListResult, PASSWORD_REQUIREMENTS, PLATFORM_PLANS, PLATFORM_PLAN_ORDER, PLATFORM_PLAN_ORDER_ALL, PREMIUM_TRIAL_DAYS, type PageInput, type PaginatedResponse, type PaginationInput, type ParsedConnectionUrl, type ParsedUserAgent, 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 PlatformPlanDefinition, type PlatformPlanFeatures, type PlatformPlanId, type PlatformPlanLimits, 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 RealtimeMetric, 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 RunMachineSize, type RunResult, type RunStatus, type RunTarget, type RunVolumeMount, type CreateRunOptions as RunWorkerOptions, RunsClient, SERVICE_METRICS, STORAGE_PRICE_PER_GB_MONTH_MICRODOLLARS, SandboxClient, type SandboxFile, SandboxFiles, type SandboxMachineSize, 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 ServiceMetrics, 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, TRANSFER_PRICE_PER_GB_MICRODOLLARS, 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 TriggerRunMachineSize, 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 UserOrganization, 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 RunResult as WorkerResult, type Run as WorkerRun, type RunStatus as WorkerStatus, type RunVolumeMount as WorkerVolumeMount, WorkersClient, type WorkspaceRecord, acceptAllConsents, acceptOrganizationInvitation, assignMemberRole, audit, authorizeOAuth, batchIndex, buildConnectionUrl, calculatePercentage, canDeleteOrganization, canManageMembers, canManageSettings, cancelScheduledEmail, cancelTask, captureException, captureExceptionRaw, captureMessage, centsToDollars, chat, chatStream, checkFlag, complete, confirmEmailChange, cookies, createCheckout, createClient, createConfig, createCron, createDynamicRestClient, createOrganization, createPermission, createPortalSession, createPromo, createRestClient, createRole, createServerClient, createServiceWorkerScript, createStepContext, createTasksHandler, createTracker, createWorkspace, debugError, debugLog, debugTimer, debugWarn, declineOptionalConsents, deleteCron, deleteDocument, deleteEnvVar, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, deleteWorkspace, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, dpop, embed, enableDebug, escapeCsvField, escapeHtml, exchangeOAuthCode, exponentialBackoff, exportUserData, extendedSignUp, getErrorDetails$1 as extractErrorDetails, getErrorMessage$1 as extractErrorMessage, forgotPassword, forkWorkspace, formatBytes, formatCents, formatCurrency, formatDate, formatDateTime, formatDuration, formatMicrodollars, formatMonthYear, formatNumber, formatPercent, formatRelativeTime, formatRelativeTimeShort, formatTime, functions, generateAnonymousId, generatePkce, generateReferralCode, generateSlug, getAchievement, getAchievementPoints, getAchievements, getActivePlans, getAllFlags, getAllSecrets, getAllStreaks, getAvailableInstanceTypes, getBackupCodes, getBaseUrl, getBillingBalance, getBillingStatusVariant, getBillingUsage, getBuildLogHistory, getCircuitBreakerState, getConsentHistory, getConsentTypes, getDatabaseConnectionString, getDatabaseStatus, getDebugMode, getDefaultInstanceType, getDeployHistory, getDeployStatus, getEnvPrefix, getErrorCode, getErrorDetails, getErrorMessage, getFacets, getFlagPayload, getFlags, getInvoiceStatusVariant, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrgScopedToken, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlanMonthlyPrice, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getSafeErrorMessage, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, getStreak, getSubscription, getTask, getUser, getUserByEmail, getUserConsents, getUserLeaderboardRank, getUserProfile, getUserSecurity, getVariant, getWebhookConfig, getWebhookDeliveries, getWebhookDelivery, getWebhookStats, getWorkspace, hasAllPermissions, hasAnyPermission, hasBillingAccess, hasConsent, hasError, hasPermission, hasRole, hasSecret, identify, impersonation, incrementAchievementProgress, indexDocument, ingestLogs, initPushServiceWorker, installGlobalDebugHelpers, introspectToken, inviteOrganizationMember, inviteUser, isChallengeRequired, isEmailConfigured, isEnabled, isPlanDeprecated, isRetryableError, isSylphxError, isValidInstanceType, kvDelete, kvExists, kvExpire, kvGet, kvGetJSON, kvHget, kvHgetall, kvHset, kvIncr, kvLpush, kvLrange, kvMget, kvMset, kvRateLimit, kvScan, kvSet, kvSetJSON, kvZadd, kvZrange, leaveOrganization, linkAnonymousConsents, listEnvVars, listOAuthProviders, listOrganizations, listPasskeys, listPermissions, listPromoRedemptions, listPromos, listRoles, listScheduledEmails, listSecretKeys, listSecurityAlerts, listTasks, listUserSessions, listUsers, listWorkspaces, markAllSecurityAlertsRead, markSecurityAlertRead, microsToDollars, oauth, page, parseConnectionUrl, parseOAuthCallback, parseUserAgent, 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, resolveCanonicalInstanceType, resolveMaxInstances, resolveResources, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, safeJsonParse, 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, validateInstanceTypeForPlan, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };
9926
+ 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, BILLING_ALLOWED_ROLES, BUILD_MINUTES_INCLUDED, BUILD_MINUTE_PRICES, BUILD_SIZE_MULTIPLIERS, BYTES_PER_GB, type BackupCodesResult, type BatchEvent, type BatchIndexInput, type BatchIndexResult, type BillingAllowedRole, type Breadcrumb, type BrowserCreateOptions, type BrowserSessionInfo, type BrowserSessionStatus, type BuildConnectionUrlInput, type BuildLog, type BuildLogHistoryResponse, type BuildMachineTier, CI_BUILD_MINUTE_PRICE_MICRODOLLARS, CI_FREE_MINUTES_PER_MONTH, CI_MACOS_MULTIPLIER, CI_MACOS_SIZE_MULTIPLIERS, CI_SIZE_MULTIPLIERS, COMPUTE_PRICE_PER_HOUR_MICRODOLLARS, COMPUTE_RAM_RATE_MICRODOLLARS, COMPUTE_VCPU_ACTIVE_RATE_MICRODOLLARS, COMPUTE_VCPU_IDLE_RATE_MICRODOLLARS, CONSOLE_APP_SLUG, CREDENTIAL_REGEX, CREDIT_EXPIRY_MONTHS, 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 ComputerInputAction, type ComputerScreenshotFormat, type ComputerSessionInfo, type ComputerSessionStatus, type ConnectionCredentialType, type ConnectionEnv, 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, DEFAULT_MAX_INSTANCES, DEFAULT_POINTS_REWARD, DISCOUNT_DURATION_MONTHS, DISCOUNT_PERCENT, 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 ErrorDetails$1 as ExtractedErrorDetails, FREE_COMPUTE_HOURS, FREE_STORAGE_GB, type FacetsResponse, type FileEvent, type FlagContext, type FlagResult, type GetConsentHistoryInput, type GetConsentsInput, type GetFacetsInput, type GetSecretInput, type GetSecretResult, type GetSecretsInput, type GetSecretsResult, HOURS_PER_MONTH, type HttpTarget, INSTANCE_TYPES, INSTANCE_TYPE_ALIASES, INSTANCE_TYPE_ORDER, INVOICE_DUE_DAYS, type IdentifyInput, type ImpersonationActive, type ImpersonationEndResult, type ImpersonationInfo, type ImpersonationStartResult, type IndexDocumentInput, type IndexDocumentResult, type IngestLogsResult, type InstanceTypeDefinition, type InstanceTypeId, InvalidConnectionUrlError, type InviteMemberInput, type InviteUserRequest, type InviteUserResponse, KV_FREE_STORAGE_GB, type KvExpireRequest, type KvHgetRequest, type KvHgetallRequest, type KvHsetRequest, type KvIncrRequest, type KvLpushRequest, type KvLrangeRequest, type KvMetric, type KvMgetRequest, type KvMsetRequest, type KvRateLimitRequest, type KvRateLimitResult, type KvScanOptions, type KvScanResult, type KvSetOptions, type KvSetRequest, type KvZMember, type KvZaddRequest, type KvZrangeRequest, LEGACY_INSTANCE_TYPE_ORDER, 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, MAX_PASSWORD_LENGTH, MAX_PAYMENT_ATTEMPTS, MICRODOLLARS_PER_CENT, MIN_PASSWORD_LENGTH, 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 OrganizationsListResult, PASSWORD_REQUIREMENTS, PLATFORM_PLANS, PLATFORM_PLAN_ORDER, PLATFORM_PLAN_ORDER_ALL, PREMIUM_TRIAL_DAYS, type PageInput, type PaginatedResponse, type PaginationInput, type ParsedConnectionUrl, type ParsedUserAgent, 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 PlatformPlanDefinition, type PlatformPlanFeatures, type PlatformPlanId, type PlatformPlanLimits, 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 RealtimeMetric, 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 RunMachineSize, type RunResult, type RunStatus, type RunTarget, type RunVolumeMount, type CreateRunOptions as RunWorkerOptions, RunsClient, SERVICE_METRICS, STORAGE_PRICE_PER_GB_MONTH_MICRODOLLARS, SandboxBrowser, SandboxClient, SandboxComputer, type SandboxFile, SandboxFiles, type SandboxMachineSize, 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 ServiceMetrics, 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, TRANSFER_PRICE_PER_GB_MICRODOLLARS, 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 TriggerRunMachineSize, 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 UserOrganization, 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 RunResult as WorkerResult, type Run as WorkerRun, type RunStatus as WorkerStatus, type RunVolumeMount as WorkerVolumeMount, WorkersClient, type WorkspaceRecord, acceptAllConsents, acceptOrganizationInvitation, assignMemberRole, audit, authorizeOAuth, batchIndex, buildConnectionUrl, calculatePercentage, canDeleteOrganization, canManageMembers, canManageSettings, cancelScheduledEmail, cancelTask, captureException, captureExceptionRaw, captureMessage, centsToDollars, chat, chatStream, checkFlag, complete, confirmEmailChange, cookies, createCheckout, createClient, createConfig, createCron, createDynamicRestClient, createOrganization, createPermission, createPortalSession, createPromo, createRestClient, createRole, createServerClient, createServiceWorkerScript, createStepContext, createTasksHandler, createTracker, createWorkspace, debugError, debugLog, debugTimer, debugWarn, declineOptionalConsents, deleteCron, deleteDocument, deleteEnvVar, deleteOrganization, deletePasskey, deletePermission, deletePromo, deleteRole, deleteUser, deleteUserAccount, deleteWorkspace, device, disableDebug, disableTwoFactor, disconnectOAuthProvider, dpop, embed, enableDebug, escapeCsvField, escapeHtml, exchangeOAuthCode, exponentialBackoff, exportUserData, extendedSignUp, getErrorDetails$1 as extractErrorDetails, getErrorMessage$1 as extractErrorMessage, forgotPassword, forkWorkspace, formatBytes, formatCents, formatCurrency, formatDate, formatDateTime, formatDuration, formatMicrodollars, formatMonthYear, formatNumber, formatPercent, formatRelativeTime, formatRelativeTimeShort, formatTime, functions, generateAnonymousId, generatePkce, generateReferralCode, generateSlug, getAchievement, getAchievementPoints, getAchievements, getActivePlans, getAllFlags, getAllSecrets, getAllStreaks, getAvailableInstanceTypes, getBackupCodes, getBaseUrl, getBillingBalance, getBillingStatusVariant, getBillingUsage, getBuildLogHistory, getCircuitBreakerState, getConsentHistory, getConsentTypes, getDatabaseConnectionString, getDatabaseStatus, getDebugMode, getDefaultInstanceType, getDeployHistory, getDeployStatus, getEnvPrefix, getErrorCode, getErrorDetails, getErrorMessage, getFacets, getFlagPayload, getFlags, getInvoiceStatusVariant, getLeaderboard, getMemberPermissions, getMyReferralCode, getOidcDiscoveryDocument, getOrgScopedToken, getOrganization, getOrganizationInvitations, getOrganizationMembers, getOrganizations, getPlanMonthlyPrice, getPlans, getProjectMetadata, getPromo, getPushPreferences, getRealtimeHistory, getReferralLeaderboard, getReferralStats, getRestErrorMessage, getRole, getSafeErrorMessage, getScheduledEmail, getScheduledEmailStats, getSearchStats, getSecret, getSecrets, getSecurityScore, getSession, getStreak, getSubscription, getTask, getUser, getUserByEmail, getUserConsents, getUserLeaderboardRank, getUserProfile, getUserSecurity, getVariant, getWebhookConfig, getWebhookDeliveries, getWebhookDelivery, getWebhookStats, getWorkspace, hasAllPermissions, hasAnyPermission, hasBillingAccess, hasConsent, hasError, hasPermission, hasRole, hasSecret, identify, impersonation, incrementAchievementProgress, indexDocument, ingestLogs, initPushServiceWorker, installGlobalDebugHelpers, introspectToken, inviteOrganizationMember, inviteUser, isChallengeRequired, isEmailConfigured, isEnabled, isPlanDeprecated, isRetryableError, isSylphxError, isValidInstanceType, kvDelete, kvExists, kvExpire, kvGet, kvGetJSON, kvHget, kvHgetall, kvHset, kvIncr, kvLpush, kvLrange, kvMget, kvMset, kvRateLimit, kvScan, kvSet, kvSetJSON, kvZadd, kvZrange, leaveOrganization, linkAnonymousConsents, listEnvVars, listOAuthProviders, listOrganizations, listPasskeys, listPermissions, listPromoRedemptions, listPromos, listRoles, listScheduledEmails, listSecretKeys, listSecurityAlerts, listTasks, listUserSessions, listUsers, listWorkspaces, markAllSecurityAlertsRead, markSecurityAlertRead, microsToDollars, oauth, page, parseConnectionUrl, parseOAuthCallback, parseUserAgent, 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, resolveCanonicalInstanceType, resolveMaxInstances, resolveResources, resumeCron, revokeAllTokens, revokeOrganizationInvitation, revokeToken, revokeUserSession, rollbackDeploy, safeJsonParse, 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, validateInstanceTypeForPlan, validatePromo, verifyAccessToken, verifyChallenge, verifyEmail, verifyPasskeyRegistration, verifySignature as verifyTaskSignature, verifyTwoFactor, verifyTwoFactorEnable, withToken };
package/dist/index.mjs CHANGED
@@ -6944,6 +6944,168 @@ var SandboxWatch = class {
6944
6944
  if (!res.ok) throw new Error(`watch.remove failed: ${await res.text()}`);
6945
6945
  }
6946
6946
  };
6947
+ var SandboxBrowser = class {
6948
+ constructor(endpoint, token) {
6949
+ this.endpoint = endpoint;
6950
+ this.token = token;
6951
+ }
6952
+ authHeader() {
6953
+ return { Authorization: `Bearer ${this.token}` };
6954
+ }
6955
+ /**
6956
+ * Create + start a persistent headful browser session. Resolves once the
6957
+ * session's CDP endpoint is available (201 from the exec-server).
6958
+ */
6959
+ async create(opts = {}) {
6960
+ const res = await fetch(`${this.endpoint}/browser`, {
6961
+ method: "POST",
6962
+ headers: { ...this.authHeader(), "Content-Type": "application/json" },
6963
+ body: JSON.stringify({ profile: opts.profile })
6964
+ });
6965
+ if (!res.ok) throw new Error(`browser.create failed (${res.status}): ${await res.text()}`);
6966
+ return await res.json();
6967
+ }
6968
+ /** List live browser sessions in this sandbox. */
6969
+ async list() {
6970
+ const res = await fetch(`${this.endpoint}/browser`, { headers: this.authHeader() });
6971
+ if (!res.ok) throw new Error(`browser.list failed (${res.status}): ${await res.text()}`);
6972
+ return await res.json();
6973
+ }
6974
+ /** Get full info for a session, or null if it does not exist. */
6975
+ async get(sessionId) {
6976
+ const res = await fetch(`${this.endpoint}/browser/${encodeURIComponent(sessionId)}`, {
6977
+ headers: this.authHeader()
6978
+ });
6979
+ if (res.status === 404) return null;
6980
+ if (!res.ok) throw new Error(`browser.get failed (${res.status}): ${await res.text()}`);
6981
+ return await res.json();
6982
+ }
6983
+ /**
6984
+ * Build the authenticated CDP connect URL for a session — a `wss://…` URL on
6985
+ * the sandbox's public endpoint that proxies to the sandbox-internal loopback CDP. Pass
6986
+ * it to any CDP client (`chromium.connectOverCDP(url)` / raw `WebSocket`).
6987
+ *
6988
+ * The token is carried as a query param because WebSocket clients cannot set
6989
+ * custom headers in browsers (equally secure over TLS). The URL is derived
6990
+ * locally from the session id, so this is synchronous and does no I/O. For a
6991
+ * not-yet-ready session the upstream proxy returns HTTP 409 at connect time.
6992
+ */
6993
+ connectUrl(sessionId) {
6994
+ const wsBase = this.endpoint.replace(/^http(s?):\/\//, (_m, s) => s ? "wss://" : "ws://");
6995
+ const path = `/browser/${encodeURIComponent(sessionId)}/cdp/connect`;
6996
+ return `${wsBase}${path}?token=${encodeURIComponent(this.token)}`;
6997
+ }
6998
+ /**
6999
+ * Open a raw WebSocket to a session's CDP endpoint through the authenticated
7000
+ * proxy. Most callers want `connectUrl()` to hand to a higher-level CDP
7001
+ * client; use this only for a hand-rolled CDP connection.
7002
+ */
7003
+ connect(sessionId) {
7004
+ return new WebSocket(this.connectUrl(sessionId));
7005
+ }
7006
+ /**
7007
+ * Fetch the CDP connection details from the exec-server: the sandbox-internal loopback
7008
+ * `cdpEndpoint` (introspection only), the `debugPort`, and the authenticated
7009
+ * `connectUrl`. Throws 409 if the session is not ready yet, 404 if unknown.
7010
+ */
7011
+ async cdp(sessionId) {
7012
+ const res = await fetch(`${this.endpoint}/browser/${encodeURIComponent(sessionId)}/cdp`, {
7013
+ headers: this.authHeader()
7014
+ });
7015
+ if (!res.ok) throw new Error(`browser.cdp failed (${res.status}): ${await res.text()}`);
7016
+ const data = await res.json();
7017
+ return { ...data, connectUrl: this.connectUrl(sessionId) };
7018
+ }
7019
+ /**
7020
+ * Destroy a session. The browser is torn down; its persistent profile on the
7021
+ * workspace volume is preserved (reuse it via `create({ profile })`).
7022
+ * Returns false if the session did not exist.
7023
+ */
7024
+ async destroy(sessionId) {
7025
+ const res = await fetch(`${this.endpoint}/browser/${encodeURIComponent(sessionId)}`, {
7026
+ method: "DELETE",
7027
+ headers: this.authHeader()
7028
+ });
7029
+ if (res.status === 404) return false;
7030
+ if (!res.ok) throw new Error(`browser.destroy failed (${res.status}): ${await res.text()}`);
7031
+ return true;
7032
+ }
7033
+ };
7034
+ var SandboxComputer = class {
7035
+ constructor(endpoint, token) {
7036
+ this.endpoint = endpoint;
7037
+ this.token = token;
7038
+ }
7039
+ authHeader() {
7040
+ return { Authorization: `Bearer ${this.token}` };
7041
+ }
7042
+ /**
7043
+ * Create + start a persistent desktop session. Resolves once the desktop
7044
+ * (Xvfb + window manager) is up (201 from the exec-server).
7045
+ */
7046
+ async create() {
7047
+ const res = await fetch(`${this.endpoint}/computer`, {
7048
+ method: "POST",
7049
+ headers: this.authHeader()
7050
+ });
7051
+ if (!res.ok) throw new Error(`computer.create failed (${res.status}): ${await res.text()}`);
7052
+ return await res.json();
7053
+ }
7054
+ /** List live desktop sessions in this sandbox. */
7055
+ async list() {
7056
+ const res = await fetch(`${this.endpoint}/computer`, { headers: this.authHeader() });
7057
+ if (!res.ok) throw new Error(`computer.list failed (${res.status}): ${await res.text()}`);
7058
+ return await res.json();
7059
+ }
7060
+ /** Get full info for a session, or null if it does not exist. */
7061
+ async get(sessionId) {
7062
+ const res = await fetch(`${this.endpoint}/computer/${encodeURIComponent(sessionId)}`, {
7063
+ headers: this.authHeader()
7064
+ });
7065
+ if (res.status === 404) return null;
7066
+ if (!res.ok) throw new Error(`computer.get failed (${res.status}): ${await res.text()}`);
7067
+ return await res.json();
7068
+ }
7069
+ /**
7070
+ * Capture the desktop framebuffer as encoded image bytes. Returns the raw
7071
+ * PNG (default) or JPEG body. Pass `'jpeg'` for a smaller, lossy capture.
7072
+ */
7073
+ async screenshot(sessionId, format = "png") {
7074
+ const res = await fetch(
7075
+ `${this.endpoint}/computer/${encodeURIComponent(sessionId)}/screenshot?format=${format}`,
7076
+ { headers: this.authHeader() }
7077
+ );
7078
+ if (!res.ok) throw new Error(`computer.screenshot failed (${res.status}): ${await res.text()}`);
7079
+ return new Uint8Array(await res.arrayBuffer());
7080
+ }
7081
+ /**
7082
+ * Execute a single input action against the desktop (mouse / keyboard /
7083
+ * scroll / drag). The exec-server validates the action structurally before
7084
+ * executing it; an invalid action throws.
7085
+ */
7086
+ async input(sessionId, action) {
7087
+ const res = await fetch(`${this.endpoint}/computer/${encodeURIComponent(sessionId)}/input`, {
7088
+ method: "POST",
7089
+ headers: { ...this.authHeader(), "Content-Type": "application/json" },
7090
+ body: JSON.stringify(action)
7091
+ });
7092
+ if (!res.ok) throw new Error(`computer.input failed (${res.status}): ${await res.text()}`);
7093
+ }
7094
+ /**
7095
+ * Destroy a session. The desktop is torn down; its per-session scratch dir on
7096
+ * the workspace volume is preserved. Returns false if the session did not
7097
+ * exist.
7098
+ */
7099
+ async destroy(sessionId) {
7100
+ const res = await fetch(`${this.endpoint}/computer/${encodeURIComponent(sessionId)}`, {
7101
+ method: "DELETE",
7102
+ headers: this.authHeader()
7103
+ });
7104
+ if (res.status === 404) return false;
7105
+ if (!res.ok) throw new Error(`computer.destroy failed (${res.status}): ${await res.text()}`);
7106
+ return true;
7107
+ }
7108
+ };
6947
7109
  var SandboxClient = class _SandboxClient {
6948
7110
  id;
6949
7111
  config;
@@ -6957,6 +7119,10 @@ var SandboxClient = class _SandboxClient {
6957
7119
  processes;
6958
7120
  /** Filesystem watch management (direct to exec-server) */
6959
7121
  watch;
7122
+ /** Persistent headful browser sessions (direct to exec-server — ADR-205) */
7123
+ browser;
7124
+ /** Persistent desktop (computer-use) sessions (direct to exec-server — ADR-207) */
7125
+ computer;
6960
7126
  constructor(id, config, endpoint, token) {
6961
7127
  this.id = id;
6962
7128
  this.config = config;
@@ -6965,6 +7131,8 @@ var SandboxClient = class _SandboxClient {
6965
7131
  this.files = endpoint && token ? new SandboxFiles(endpoint, token) : null;
6966
7132
  this.processes = endpoint && token ? new SandboxProcesses(endpoint, token) : null;
6967
7133
  this.watch = endpoint && token ? new SandboxWatch(endpoint, token) : null;
7134
+ this.browser = endpoint && token ? new SandboxBrowser(endpoint, token) : null;
7135
+ this.computer = endpoint && token ? new SandboxComputer(endpoint, token) : null;
6968
7136
  }
6969
7137
  // ---------------------------------------------------------------------------
6970
7138
  // Factory
@@ -7754,7 +7922,9 @@ export {
7754
7922
  RunsClient,
7755
7923
  SERVICE_METRICS,
7756
7924
  STORAGE_PRICE_PER_GB_MONTH_MICRODOLLARS,
7925
+ SandboxBrowser,
7757
7926
  SandboxClient,
7927
+ SandboxComputer,
7758
7928
  SandboxFiles,
7759
7929
  SandboxProcesses,
7760
7930
  SandboxWatch,