deepspace 0.33.1 → 0.35.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +5 -1
  3. package/dist/{chunk-PZDVKSLI.js → chunk-ESEI3MMY.js} +2 -2
  4. package/dist/{chunk-PZDVKSLI.js.map → chunk-ESEI3MMY.js.map} +1 -1
  5. package/dist/chunk-ESYXTIV2.js +1957 -0
  6. package/dist/chunk-ESYXTIV2.js.map +1 -0
  7. package/dist/cli.js +151 -53
  8. package/dist/cli.js.map +1 -1
  9. package/dist/documentation-client-core.js +1 -1
  10. package/dist/documentation-default-renderer.cjs +1 -1
  11. package/dist/documentation-react.js +1 -1
  12. package/dist/documentation-runtime.js +10 -10
  13. package/dist/documentation-server-core.js +1 -1
  14. package/dist/documentation.js +47 -22
  15. package/dist/documentation.js.map +1 -1
  16. package/dist/expo.d.ts +83 -0
  17. package/dist/expo.js +242 -0
  18. package/dist/expo.js.map +1 -0
  19. package/dist/index.d.ts +110 -23
  20. package/dist/index.js +134 -53
  21. package/dist/index.js.map +1 -1
  22. package/dist/server.d.ts +205 -37
  23. package/dist/server.js +290 -97
  24. package/dist/server.js.map +1 -1
  25. package/dist/testing.js +45 -3
  26. package/dist/testing.js.map +1 -1
  27. package/dist/worker.d.ts +348 -48
  28. package/dist/worker.js +547 -110
  29. package/dist/worker.js.map +1 -1
  30. package/features/documents/feature.json +15 -0
  31. package/features/documents/src/DocumentsListPage.tsx +22 -8
  32. package/features/documents/src/InviteDialog.tsx +63 -42
  33. package/features/documents/src/__tests__/documents-find-invitee-action.test.ts +131 -0
  34. package/features/documents/src/__tests__/documents-invitee-lookup.test.ts +67 -0
  35. package/features/documents/src/documents-find-invitee-action.ts +56 -0
  36. package/features/documents/src/documents-invitee-lookup.ts +38 -0
  37. package/features/documents/src/documents-ui.css +10 -0
  38. package/package.json +29 -9
package/dist/worker.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import * as Y from 'yjs';
2
- import { LanguageModel, ToolSet, StreamTextResult, streamText, ModelMessage } from 'ai';
2
+ import { LanguageModel, ToolSet, streamText, Tool, FilePart, ModelMessage } from 'ai';
3
+ import { forwardAnthropicContainerIdFromLastStep } from '@ai-sdk/anthropic';
3
4
  import { Hono, Context, ErrorHandler } from 'hono';
4
5
  import * as zod_v4_core from 'zod/v4/core';
5
6
  import * as zod from 'zod';
6
7
  import * as better_auth_plugins from 'better-auth/plugins';
7
8
  import * as better_auth from 'better-auth';
8
- import { betterAuth } from 'better-auth';
9
+ import { BetterAuthOptions, betterAuth } from 'better-auth';
10
+ import { getOAuthState } from 'better-auth/api';
9
11
 
10
12
  /**
11
13
  * Wire protocol constants.
@@ -1567,22 +1569,10 @@ declare function armCronRoom(ctx: {
1567
1569
  }, namespace: DurableObjectNamespace, roomId: string, tasks: readonly CronTask[]): void;
1568
1570
 
1569
1571
  /**
1570
- * JobRoom — Per-app durable background-job execution Durable Object.
1571
- *
1572
- * Solves the "long job dies when the response goes out" problem on
1573
- * Cloudflare Workers. `ctx.waitUntil` only gets 30s after a response;
1574
- * jobs that need minutes-to-hours live here instead: rows in SQLite,
1575
- * picked up by DO alarms (15-min wall budget per tick), resumable
1576
- * across ticks via `ctx.continue` for the rare longer cases.
1577
- *
1578
- * Lifecycle: queued → running → succeeded | failed | canceled
1579
- *
1580
- * Crash recovery: if an isolate is recycled mid-run, the row stays at
1581
- * `running`. On next init, rows older than ~16 min are either retried
1582
- * (if attempts left) or marked failed.
1583
- *
1584
- * See the abstract `onJob` method below for the subclass contract.
1585
- * Message types: job.*
1572
+ * Persistent job queue with serial execution, progress, cancellation and retries.
1573
+ * Jobs run inside alarms unless listed in `backgroundJobTypes`.
1574
+ * Use `ctx.continue` to save a checkpoint for the next run.
1575
+ * After a restart, running jobs older than 16 minutes are retried or failed.
1586
1576
  */
1587
1577
 
1588
1578
  type JobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled';
@@ -1627,6 +1617,11 @@ interface JobContext {
1627
1617
  signal: AbortSignal;
1628
1618
  }
1629
1619
  interface JobRoomConfig {
1620
+ /**
1621
+ * Job types that run after the alarm returns. Defaults to none.
1622
+ * Handlers must set a deadline; restarts use existing checkpoint/retry rules.
1623
+ */
1624
+ backgroundJobTypes?: readonly string[];
1630
1625
  /** Default for jobs enqueued without explicit `maxAttempts`. Default 1 (no auto-retry). */
1631
1626
  defaultMaxAttempts?: number;
1632
1627
  /** TTL for terminal rows (succeeded/failed/canceled) in ms. Default 24h. */
@@ -1649,6 +1644,7 @@ declare abstract class JobRoom<E = Record<string, unknown>, P = unknown, R = unk
1649
1644
  private readonly retentionMs;
1650
1645
  private readonly snapshotLimit;
1651
1646
  private readonly retryBackoffMs;
1647
+ private readonly backgroundJobTypes;
1652
1648
  private readonly authorizeWrite;
1653
1649
  private readonly authorizeRead;
1654
1650
  private broadcastQueue;
@@ -1697,10 +1693,6 @@ declare abstract class JobRoom<E = Record<string, unknown>, P = unknown, R = unk
1697
1693
  private insertJob;
1698
1694
  private cancelJob;
1699
1695
  private retryJob;
1700
- /**
1701
- * Drain due jobs in FIFO order. All due jobs share the alarm's
1702
- * 15-min wall budget (a CF property, not a per-job allocation).
1703
- */
1704
1696
  private drainDueJobs;
1705
1697
  private executeJob;
1706
1698
  private makeContext;
@@ -2257,6 +2249,9 @@ declare const ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID = "2026-08-action-routes-b
2257
2249
  * `<audio>`, or `<video>` load) by the app-origin session cookie, so private
2258
2250
  * file URLs render for the signed-in user without tokens or signed URLs. */
2259
2251
  declare const FILES_SESSION_COOKIE_READS_MIGRATION_ID = "2026-09-files-session-cookie-reads";
2252
+ /** The SDK moved to AI SDK 7 (`ai` 7, `@ai-sdk/anthropic` 4). Apps pin their
2253
+ * own `ai`, and their chat route persists and streams through its API. */
2254
+ declare const AI_SDK_7_MIGRATION_ID = "2026-09-ai-sdk-7";
2260
2255
  type AppMigrationIdsValidation = {
2261
2256
  valid: true;
2262
2257
  ids: string[];
@@ -2292,6 +2287,11 @@ interface DeepSpaceAIModel {
2292
2287
  transport: 'messages' | 'chat-completions';
2293
2288
  recommendation: 'frontier' | 'balanced' | 'fast' | 'available' | 'limited';
2294
2289
  note?: string;
2290
+ /**
2291
+ * Superseded: still resolvable by id, so an app that saved it keeps working,
2292
+ * but left out of pickers and model lists.
2293
+ */
2294
+ legacy?: true;
2295
2295
  }
2296
2296
  interface DeepSpaceAgentProfile {
2297
2297
  id: DeepSpaceAgentProfileId;
@@ -2307,8 +2307,8 @@ interface DeepSpaceAgentProfile {
2307
2307
  * deployed app underneath a commit.
2308
2308
  */
2309
2309
  declare const DEEPSPACE_MODEL_CATALOG_PROVENANCE: {
2310
- readonly version: "2026-08-04";
2311
- readonly verifiedAt: "2026-08-04";
2310
+ readonly version: "2026-09-24";
2311
+ readonly verifiedAt: "2026-09-24";
2312
2312
  readonly sources: {
2313
2313
  readonly anthropic: "https://platform.claude.com/docs/en/api/beta/models/list";
2314
2314
  readonly openai: "https://developers.openai.com/api/docs/models/all";
@@ -2316,8 +2316,8 @@ declare const DEEPSPACE_MODEL_CATALOG_PROVENANCE: {
2316
2316
  };
2317
2317
  };
2318
2318
  declare const DEEPSPACE_AI_MODELS: readonly [{
2319
- readonly id: "claude-fable-5";
2320
- readonly label: "Claude Fable 5";
2319
+ readonly id: "claude-opus-5-5";
2320
+ readonly label: "Claude Opus 5.5";
2321
2321
  readonly family: "Claude 5";
2322
2322
  readonly recommendation: "frontier";
2323
2323
  } & {
@@ -2328,8 +2328,8 @@ declare const DEEPSPACE_AI_MODELS: readonly [{
2328
2328
  agentSupport: "multi-step";
2329
2329
  agentProfiles: readonly ["application", "documentation"];
2330
2330
  }, {
2331
- readonly id: "claude-opus-5";
2332
- readonly label: "Claude Opus 5";
2331
+ readonly id: "claude-fable-5-1";
2332
+ readonly label: "Claude Fable 5.1";
2333
2333
  readonly family: "Claude 5";
2334
2334
  readonly recommendation: "frontier";
2335
2335
  } & {
@@ -2363,11 +2363,95 @@ declare const DEEPSPACE_AI_MODELS: readonly [{
2363
2363
  } & {
2364
2364
  agentSupport: "multi-step";
2365
2365
  agentProfiles: readonly ["application", "documentation"];
2366
+ }, {
2367
+ readonly id: "gpt-6-sol";
2368
+ readonly label: "GPT-6 Sol";
2369
+ readonly family: "GPT-6";
2370
+ readonly recommendation: "balanced";
2371
+ } & {
2372
+ readonly provider: "openai";
2373
+ readonly providerLabel: "OpenAI";
2374
+ readonly transport: "chat-completions";
2375
+ } & {
2376
+ agentSupport: "multi-step";
2377
+ agentProfiles: readonly ["application", "documentation"];
2378
+ }, {
2379
+ readonly id: "gpt-6-luna";
2380
+ readonly label: "GPT-6 Luna";
2381
+ readonly family: "GPT-6";
2382
+ readonly recommendation: "fast";
2383
+ } & {
2384
+ readonly provider: "openai";
2385
+ readonly providerLabel: "OpenAI";
2386
+ readonly transport: "chat-completions";
2387
+ } & {
2388
+ agentSupport: "multi-step";
2389
+ agentProfiles: readonly ["application", "documentation"];
2390
+ }, {
2391
+ readonly id: "gpt-6-astra";
2392
+ readonly label: "GPT-6 Astra";
2393
+ readonly provider: "openai";
2394
+ readonly providerLabel: "OpenAI";
2395
+ readonly family: "GPT-6";
2396
+ readonly agentSupport: "none";
2397
+ readonly agentProfiles: readonly [];
2398
+ readonly transport: "chat-completions";
2399
+ readonly recommendation: "limited";
2400
+ readonly note: "Available for direct generation; its tool calling requires the Responses API, which the DeepSpace proxy does not serve.";
2401
+ }, {
2402
+ readonly id: "gpt-oss-120b";
2403
+ readonly label: "GPT-OSS 120B";
2404
+ readonly provider: "cerebras";
2405
+ readonly providerLabel: "Cerebras";
2406
+ readonly family: "GPT-OSS";
2407
+ readonly agentSupport: "single-step";
2408
+ readonly agentProfiles: readonly [];
2409
+ readonly transport: "chat-completions";
2410
+ readonly recommendation: "limited";
2411
+ readonly note: "Available for direct generation; the current proxy adapter has not passed multi-step tool-result continuation.";
2412
+ }, {
2413
+ readonly id: "qwen-3.8-27b";
2414
+ readonly label: "Qwen 3.8 27B";
2415
+ readonly provider: "cerebras";
2416
+ readonly providerLabel: "Cerebras";
2417
+ readonly family: "Qwen 3.8";
2418
+ readonly agentSupport: "single-step";
2419
+ readonly agentProfiles: readonly [];
2420
+ readonly transport: "chat-completions";
2421
+ readonly recommendation: "limited";
2422
+ readonly note: "Available for direct generation; the current proxy adapter has not passed multi-step tool-result continuation.";
2423
+ }, {
2424
+ readonly id: "claude-opus-5";
2425
+ readonly label: "Claude Opus 5";
2426
+ readonly family: "Claude 5";
2427
+ readonly recommendation: "frontier";
2428
+ readonly legacy: true;
2429
+ } & {
2430
+ readonly provider: "anthropic";
2431
+ readonly providerLabel: "Anthropic";
2432
+ readonly transport: "messages";
2433
+ } & {
2434
+ agentSupport: "multi-step";
2435
+ agentProfiles: readonly ["application", "documentation"];
2436
+ }, {
2437
+ readonly id: "claude-fable-5";
2438
+ readonly label: "Claude Fable 5";
2439
+ readonly family: "Claude 5";
2440
+ readonly recommendation: "frontier";
2441
+ readonly legacy: true;
2442
+ } & {
2443
+ readonly provider: "anthropic";
2444
+ readonly providerLabel: "Anthropic";
2445
+ readonly transport: "messages";
2446
+ } & {
2447
+ agentSupport: "multi-step";
2448
+ agentProfiles: readonly ["application", "documentation"];
2366
2449
  }, {
2367
2450
  readonly id: "gpt-5.6-sol";
2368
2451
  readonly label: "GPT-5.6 Sol";
2369
2452
  readonly family: "GPT-5.6";
2370
2453
  readonly recommendation: "frontier";
2454
+ readonly legacy: true;
2371
2455
  } & {
2372
2456
  readonly provider: "openai";
2373
2457
  readonly providerLabel: "OpenAI";
@@ -2380,6 +2464,7 @@ declare const DEEPSPACE_AI_MODELS: readonly [{
2380
2464
  readonly label: "GPT-5.6 Terra";
2381
2465
  readonly family: "GPT-5.6";
2382
2466
  readonly recommendation: "balanced";
2467
+ readonly legacy: true;
2383
2468
  } & {
2384
2469
  readonly provider: "openai";
2385
2470
  readonly providerLabel: "OpenAI";
@@ -2392,6 +2477,7 @@ declare const DEEPSPACE_AI_MODELS: readonly [{
2392
2477
  readonly label: "GPT-5.6 Luna";
2393
2478
  readonly family: "GPT-5.6";
2394
2479
  readonly recommendation: "fast";
2480
+ readonly legacy: true;
2395
2481
  } & {
2396
2482
  readonly provider: "openai";
2397
2483
  readonly providerLabel: "OpenAI";
@@ -2399,34 +2485,23 @@ declare const DEEPSPACE_AI_MODELS: readonly [{
2399
2485
  } & {
2400
2486
  agentSupport: "multi-step";
2401
2487
  agentProfiles: readonly ["application", "documentation"];
2402
- }, {
2403
- readonly id: "gpt-oss-120b";
2404
- readonly label: "GPT-OSS 120B";
2405
- readonly provider: "cerebras";
2406
- readonly providerLabel: "Cerebras";
2407
- readonly family: "GPT-OSS";
2408
- readonly agentSupport: "single-step";
2409
- readonly agentProfiles: readonly [];
2410
- readonly transport: "chat-completions";
2411
- readonly recommendation: "limited";
2412
- readonly note: "Available for direct generation; the current proxy adapter has not passed multi-step tool-result continuation.";
2413
2488
  }];
2414
2489
  declare const DEEPSPACE_AI_DEFAULTS: {
2415
- readonly agent: "claude-sonnet-5";
2416
- readonly directGeneration: "claude-sonnet-5";
2490
+ readonly agent: "claude-opus-5-5";
2491
+ readonly directGeneration: "claude-opus-5-5";
2417
2492
  readonly summarization: "claude-haiku-4-5";
2418
2493
  };
2419
2494
  declare const DEEPSPACE_AGENT_PROFILES: {
2420
2495
  readonly application: {
2421
2496
  readonly id: "application";
2422
- readonly defaultModel: "claude-sonnet-5";
2497
+ readonly defaultModel: "claude-opus-5-5";
2423
2498
  readonly maxSteps: 21;
2424
2499
  readonly maxToolCalls: 20;
2425
2500
  readonly allowedTools: "application-defined";
2426
2501
  };
2427
2502
  readonly documentation: {
2428
2503
  readonly id: "documentation";
2429
- readonly defaultModel: "claude-sonnet-5";
2504
+ readonly defaultModel: "claude-opus-5-5";
2430
2505
  readonly maxSteps: 21;
2431
2506
  readonly maxToolCalls: 20;
2432
2507
  readonly allowedTools: readonly ["documentation_search", "documentation_read"];
@@ -2519,6 +2594,23 @@ interface ProxyRoute {
2519
2594
  }
2520
2595
  declare const BROWSER_PROXY_ROUTES: ReadonlyArray<ProxyRoute>;
2521
2596
 
2597
+ /**
2598
+ * Wire contract between the SDK's sandbox helpers (server/utils/sandbox.ts)
2599
+ * and the api-worker proxy that records who owns each Anthropic
2600
+ * code-execution file and container.
2601
+ */
2602
+ /**
2603
+ * Who may use a file or container the request creates:
2604
+ * - `user` (default): only the JWT subject, inside the calling app.
2605
+ * - `app`: any caller of the same app (shared workspaces, owner-billed
2606
+ * background turns continuing a user's conversation).
2607
+ * Another app can never use either.
2608
+ */
2609
+ declare const SANDBOX_SCOPES: readonly ["user", "app"];
2610
+ type SandboxScope = (typeof SANDBOX_SCOPES)[number];
2611
+ /** Request header carrying the {@link SandboxScope} for resources a request creates. */
2612
+ declare const SANDBOX_SCOPE_HEADER = "x-deepspace-sandbox-scope";
2613
+
2522
2614
  /**
2523
2615
  * Identity claims cross from an app Worker to its private room Durable Object
2524
2616
  * in headers. Header values are ByteStrings, while verified profile claims may
@@ -2538,6 +2630,42 @@ declare function authenticatedRoomRequest(request: Request, auth: RoomAuth | nul
2538
2630
  role?: string;
2539
2631
  }): Request;
2540
2632
 
2633
+ /**
2634
+ * DeepSpace's deployment planes, in one place: production, staging and
2635
+ * DeepSpace Medical, the BAA-covered plane for healthcare apps
2636
+ * (docs/proposals/deepspace-medical.md).
2637
+ *
2638
+ * Side-effect free. The CLI, the browser client, the test-account helpers and
2639
+ * the platform workers all read it, so a plane's hosts and its restricted-plane
2640
+ * rule cannot drift between them.
2641
+ */
2642
+ type PlaneName = 'production' | 'staging' | 'medical';
2643
+ interface PlaneUrls {
2644
+ auth: string;
2645
+ api: string;
2646
+ platform: string;
2647
+ deploy: string;
2648
+ /** Deployed apps live on `<name>.<appDomain>`. */
2649
+ appDomain: string;
2650
+ /** The zone the platform services live on. */
2651
+ platformDomain: string;
2652
+ /** The plane's public home page. */
2653
+ home: string;
2654
+ /** The builder dashboard; null where the plane has none. */
2655
+ dashboard: string | null;
2656
+ /** The privacy policy sign-in screens link to. */
2657
+ privacyPolicy: string;
2658
+ }
2659
+ declare const PLANES: Readonly<Record<PlaneName, PlaneUrls>>;
2660
+ /**
2661
+ * Whether a platform worker runs on a restricted plane (DeepSpace Medical
2662
+ * sets `DEEPSPACE_PLANE = "medical"`). Unset means production. Any value other
2663
+ * than `production` or `staging` restricts, so a typo fails closed.
2664
+ */
2665
+ declare function isRestrictedPlane(env: {
2666
+ DEEPSPACE_PLANE?: string;
2667
+ }): boolean;
2668
+
2541
2669
  /**
2542
2670
  * Wildcard-aware CORS origin matching for the platform workers.
2543
2671
  *
@@ -3314,7 +3442,7 @@ declare function resolveAppRole(env: AppRoleEnv, userId: string): Promise<Role>;
3314
3442
  * // Server-side autonomous — no auth config needed
3315
3443
  * import { createDeepSpaceAI } from 'deepspace/worker'
3316
3444
  * const cerebras = createDeepSpaceAI(env, 'cerebras')
3317
- * const result = await generateText({ model: cerebras('llama-3.3-70b'), ... })
3445
+ * const result = await generateText({ model: cerebras('gpt-oss-120b'), ... })
3318
3446
  *
3319
3447
  * // User-initiated (inside a request handler)
3320
3448
  * const jwt = c.req.header('Authorization')!.slice(7)
@@ -3334,6 +3462,13 @@ interface DeepSpaceAIEnv extends ApiWorkerEnv {
3334
3462
  * Bills the app owner.
3335
3463
  */
3336
3464
  APP_OWNER_JWT?: string;
3465
+ /**
3466
+ * The app's id and deploy-time identity token. Sent with every proxied call
3467
+ * so the proxy can tie Anthropic sandbox files and containers to this app;
3468
+ * code execution and files are refused without them.
3469
+ */
3470
+ DEEPSPACE_APP_ID?: string;
3471
+ APP_IDENTITY_TOKEN?: string;
3337
3472
  }
3338
3473
  interface DeepSpaceAIOptions {
3339
3474
  /**
@@ -3346,6 +3481,12 @@ interface DeepSpaceAIOptions {
3346
3481
  * client-supplied billing override.
3347
3482
  */
3348
3483
  authToken?: string;
3484
+ /**
3485
+ * Who may reuse the sandbox files and containers this call creates.
3486
+ * Default `'user'`: only the auth token's user. `'app'`: every caller of
3487
+ * this app. Another app can never reach either.
3488
+ */
3489
+ sandboxScope?: SandboxScope;
3349
3490
  }
3350
3491
  /**
3351
3492
  * Build an AI SDK provider that routes through the DeepSpace API worker.
@@ -3361,10 +3502,12 @@ type DeepSpaceAgentStreamOptions<TOOLS extends ToolSet> = Omit<StreamTextOptions
3361
3502
  profile: DeepSpaceAgentProfileId;
3362
3503
  modelId?: unknown;
3363
3504
  authToken?: string;
3505
+ /** Scope for sandbox files and containers this turn creates (see `createDeepSpaceAI`). */
3506
+ sandboxScope?: SandboxScope;
3364
3507
  };
3365
3508
  interface DeepSpaceAgentStream<TOOLS extends ToolSet> {
3366
3509
  selection: ResolvedDeepSpaceAgentModel;
3367
- result: StreamTextResult<TOOLS, never>;
3510
+ result: ReturnType<typeof streamText<TOOLS>>;
3368
3511
  }
3369
3512
  declare class DeepSpaceAgentModelError extends Error {
3370
3513
  readonly modelId: unknown;
@@ -3388,6 +3531,118 @@ interface DeepSpaceAgentDiagnosticContext {
3388
3531
  /** Preserve safe structured provider diagnostics in bounded Worker logs. */
3389
3532
  declare function deepSpaceAgentErrorSummary(error: unknown, context?: DeepSpaceAgentDiagnosticContext): string;
3390
3533
 
3534
+ /**
3535
+ * Anthropic's hosted code-execution sandbox, through the DeepSpace proxy.
3536
+ *
3537
+ * Claude runs Python and shell in a container Anthropic hosts, so an agent can
3538
+ * read, edit and create real files (Word, Excel, PowerPoint, PDF, charts). The
3539
+ * container has no network: files go in and come out through Anthropic's
3540
+ * Files API, which the proxy scopes to this app (and, by default, to the
3541
+ * calling user — see `DeepSpaceAIOptions.sandboxScope`).
3542
+ *
3543
+ * const ai = createDeepSpaceAI(env, 'anthropic', { authToken })
3544
+ * const files = sandboxFiles(env, { authToken })
3545
+ * const sheet = await files.upload(bytes, { filename: 'leads.xlsx' })
3546
+ *
3547
+ * const result = streamText({ // stream: long jobs outlive a non-streamed call
3548
+ * model: ai('claude-sonnet-5'),
3549
+ * tools: { code_execution: codeExecutionTool(), crm_query: callableFromSandbox(crmQuery) },
3550
+ * prepareStep: forwardSandboxContainer, // same container across steps
3551
+ * providerOptions: reuseSandbox(savedContainerId), // optional: across messages
3552
+ * messages: [{ role: 'user', content: [{ type: 'text', text: 'Chart this' }, sandboxUpload(sheet)] }],
3553
+ * })
3554
+ *
3555
+ * const { containerId, fileIds } = sandboxOutputs(await result.steps)
3556
+ * const chart = await files.download(fileIds[0])
3557
+ *
3558
+ * Stream sandbox calls (`streamText`). A non-streamed call that runs longer
3559
+ * than about two minutes is cut off with a 524 on its way to Anthropic —
3560
+ * multi-step document jobs routinely do.
3561
+ *
3562
+ * Billing: tokens as usual, plus a flat 5 container-minutes for each request
3563
+ * that used the sandbox. Files API calls are free.
3564
+ */
3565
+
3566
+ /** The code-execution tool. Add it to `tools`; Claude only starts a container when it uses it. */
3567
+ declare function codeExecutionTool(): Tool;
3568
+ /**
3569
+ * Let code running in the sandbox call this tool (programmatic tool calling),
3570
+ * in addition to Claude calling it directly. The call still runs in the app's
3571
+ * worker with the tool's own permission checks — the sandbox gets no
3572
+ * credentials. Anthropic waits about 4 minutes for each result.
3573
+ */
3574
+ declare function callableFromSandbox<T extends Tool>(tool: T): T;
3575
+ /** `prepareStep` that keeps every step of a turn in the first step's container. */
3576
+ declare const forwardSandboxContainer: typeof forwardAnthropicContainerIdFromLastStep;
3577
+ /** `providerOptions` that continue in a container saved from an earlier turn. */
3578
+ declare function reuseSandbox(containerId: string | null | undefined): {
3579
+ anthropic: {
3580
+ container: {
3581
+ id: string;
3582
+ };
3583
+ };
3584
+ } | undefined;
3585
+ /** A message part that copies an uploaded file into the sandbox. */
3586
+ declare function sandboxUpload(file: Pick<SandboxFile, 'id' | 'filename' | 'mime_type'>): FilePart;
3587
+ interface SandboxStep {
3588
+ providerMetadata?: Record<string, unknown>;
3589
+ content: ReadonlyArray<unknown>;
3590
+ }
3591
+ /**
3592
+ * The container a turn ran in (save it to continue later) and the files the
3593
+ * sandbox created (download them with `sandboxFiles`).
3594
+ */
3595
+ declare function sandboxOutputs(steps: ReadonlyArray<SandboxStep>): {
3596
+ containerId: string | null;
3597
+ fileIds: string[];
3598
+ };
3599
+ /** Anthropic's file metadata, as returned through the proxy. */
3600
+ interface SandboxFile {
3601
+ type: 'file';
3602
+ id: string;
3603
+ filename: string;
3604
+ mime_type: string;
3605
+ size_bytes: number;
3606
+ created_at: string;
3607
+ /** Only files the sandbox created are downloadable; uploads are not. */
3608
+ downloadable?: boolean;
3609
+ expires_at?: string | null;
3610
+ }
3611
+ interface SandboxFileList {
3612
+ data: SandboxFile[];
3613
+ /** Pass back as `page` for the next page; null on the last one. */
3614
+ next_page: string | null;
3615
+ }
3616
+ interface SandboxUploadOptions {
3617
+ /** Required when `file` is a Blob rather than a File. */
3618
+ filename?: string;
3619
+ /** 3,600–7,776,000. The proxy defaults uploads to 30 days. */
3620
+ expiresInSeconds?: number;
3621
+ }
3622
+ interface SandboxFilesOptions {
3623
+ /** Same meaning as in `createDeepSpaceAI`: whose file it is, and who is billed. */
3624
+ authToken?: string;
3625
+ /** Scope for files this client uploads. Must match the calls that will use them. */
3626
+ scope?: SandboxScope;
3627
+ }
3628
+ interface SandboxFilesClient {
3629
+ upload(file: Blob, options?: SandboxUploadOptions): Promise<SandboxFile>;
3630
+ get(fileId: string): Promise<SandboxFile>;
3631
+ /** The file's bytes as a streaming Response (content-type and content-disposition set). */
3632
+ download(fileId: string): Promise<Response>;
3633
+ list(options?: {
3634
+ limit?: number;
3635
+ page?: string;
3636
+ }): Promise<SandboxFileList>;
3637
+ delete(fileId: string): Promise<void>;
3638
+ }
3639
+ declare class SandboxFileError extends Error {
3640
+ readonly status: number;
3641
+ constructor(status: number, message: string);
3642
+ }
3643
+ /** Upload, read, list and delete the calling app's sandbox files. */
3644
+ declare function sandboxFiles(env: DeepSpaceAIEnv, options?: SandboxFilesOptions): SandboxFilesClient;
3645
+
3391
3646
  /**
3392
3647
  * Composio tools for the Vercel AI SDK.
3393
3648
  *
@@ -4180,6 +4435,17 @@ declare function isTestAccountClaims(claims: JwtClaims | Record<string, unknown>
4180
4435
  /** True when a billing subscription tier marks a test account. */
4181
4436
  declare function isTestAccountTier(tier: string | null | undefined): boolean;
4182
4437
 
4438
+ type BetterAuthUserCreateBeforeHook = NonNullable<NonNullable<NonNullable<NonNullable<BetterAuthOptions['databaseHooks']>['user']>['create']>['before']>;
4439
+ type UserCreateData = Parameters<BetterAuthUserCreateBeforeHook>[0];
4440
+ type UserCreateResult = Awaited<ReturnType<BetterAuthUserCreateBeforeHook>>;
4441
+ interface DeepSpaceUserCreateContext {
4442
+ request?: Request;
4443
+ headers?: Headers;
4444
+ path?: string;
4445
+ /** OAuth state after Better Auth has decrypted/loaded and verified it. */
4446
+ oauthState: Awaited<ReturnType<typeof getOAuthState>>;
4447
+ }
4448
+ type UserAdditionalFields = NonNullable<BetterAuthOptions['user']>['additionalFields'];
4183
4449
  interface DeepSpaceAuthConfig {
4184
4450
  /** D1 database binding */
4185
4451
  database: D1Database;
@@ -4217,6 +4483,19 @@ interface DeepSpaceAuthConfig {
4217
4483
  emailAndPassword?: boolean;
4218
4484
  /** Trusted origins for CORS */
4219
4485
  trustedOrigins?: string[];
4486
+ /**
4487
+ * Server-owned fields to add to Better Auth's user model. Use `input: false`
4488
+ * for values that may only be populated by a database hook, and
4489
+ * `returned: false` for values that must stay out of public auth responses.
4490
+ */
4491
+ userAdditionalFields?: UserAdditionalFields;
4492
+ /**
4493
+ * Runs inside Better Auth's `user.create.before` lifecycle and may return
4494
+ * the library's `{ data }` patch. Errors intentionally abort user creation,
4495
+ * which lets callers fail closed when a server-validated signup promise can
4496
+ * no longer be attached to the new account.
4497
+ */
4498
+ beforeUserCreate?: (user: UserCreateData, ctx: DeepSpaceUserCreateContext | null) => Promise<UserCreateResult> | UserCreateResult;
4220
4499
  /**
4221
4500
  * Called after a new user row is created (any flow: social OAuth callback,
4222
4501
  * email/password, server-side `auth.api.signUpEmail`). When the signup came
@@ -5244,6 +5523,13 @@ declare function createDeepSpaceAuth(config: DeepSpaceAuthConfig): better_auth.A
5244
5523
  };
5245
5524
  };
5246
5525
  } | undefined;
5526
+ socialProviders: Parameters<typeof betterAuth>[0]["socialProviders"];
5527
+ trustedOrigins: string[];
5528
+ user?: {
5529
+ additionalFields: {
5530
+ [x: string]: better_auth.DBFieldAttribute;
5531
+ };
5532
+ } | undefined;
5247
5533
  database: D1Database;
5248
5534
  baseURL: string;
5249
5535
  secret: string;
@@ -5254,8 +5540,6 @@ declare function createDeepSpaceAuth(config: DeepSpaceAuthConfig): better_auth.A
5254
5540
  emailAndPassword: {
5255
5541
  enabled: boolean;
5256
5542
  };
5257
- socialProviders: Parameters<typeof betterAuth>[0]["socialProviders"];
5258
- trustedOrigins: string[];
5259
5543
  }>;
5260
5544
  type DeepSpaceAuth = ReturnType<typeof createDeepSpaceAuth>;
5261
5545
 
@@ -5340,6 +5624,22 @@ declare function normalizeAgentTargetOrigin(value: unknown, policy: AgentTargetP
5340
5624
  */
5341
5625
  declare const SESSION_COOKIE = "__Secure-better-auth.session_token";
5342
5626
 
5627
+ interface ExpoAuthWorkerEnv extends AuthWorkerEnv {
5628
+ AUTH_WORKER_URL?: string;
5629
+ AUTH_JWT_PUBLIC_KEY?: string;
5630
+ AUTH_JWT_ISSUER?: string;
5631
+ }
5632
+ interface ExpoAuthBridgeOptions {
5633
+ /** Exact native callback URIs registered by the app. */
5634
+ allowedRedirectUris?: readonly string[];
5635
+ }
5636
+ declare function nativeAuthStart(request: Request, env: ExpoAuthWorkerEnv, options?: ExpoAuthBridgeOptions): Response;
5637
+ declare function nativeAuthCallback(request: Request, _env: ExpoAuthWorkerEnv, options?: ExpoAuthBridgeOptions): Response;
5638
+ declare function nativeAuthExchange(request: Request, env: ExpoAuthWorkerEnv): Promise<Response>;
5639
+ declare function nativeAuthToken(request: Request, env: ExpoAuthWorkerEnv): Promise<Response>;
5640
+ declare function nativeAuthMe(request: Request, env: ExpoAuthWorkerEnv): Promise<Response>;
5641
+ declare function nativeAuthSignOut(request: Request, env: ExpoAuthWorkerEnv): Promise<Response>;
5642
+
5343
5643
  declare class BodyTooLargeError extends Error {
5344
5644
  readonly maxBytes: number;
5345
5645
  constructor(maxBytes: number);
@@ -5496,4 +5796,4 @@ declare const MAX_LOG_TEXT_LENGTH: number;
5496
5796
  */
5497
5797
  declare function workerErrorHandler(prefix: string, respond?: (c: Context) => Response): ErrorHandler;
5498
5798
 
5499
- export { ACCOUNT_STORAGE_LIMIT_BYTES, ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID, ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID, AGENT_TOKEN_SCOPE, AGENT_TOOL_REQUEST_BODY_CAP, AGENT_TOOL_RESPONSE_BODY_CAP, AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, ANONYMOUS_USER_ID_PREFIX, APP_ID_RE, APP_LOG_EVENT_KEYS, APP_NAME_RULES, ASSET_NOT_FOUND_HANDLING_VALUES, AUTO_PROVISIONABLE_TYPES, AUTO_PROVISION_SENTINEL, type ActionContext, type ActionHandler, type ActionResult, type ActionTools, type AgentTargetPolicy, type AgentToolAccessResult, type AgentToolRouteEnv, type AgentToolRouteOptions, type ApiErrorIssue, type ApiWorkerEnv, type AppLogEvent, type AppLogEventKey, type AppLogsResponse, type AppMembership, type AppMigrationIdsValidation, type AppNameResolution, type AppNameValidation, type AssetNotFoundHandling, type AuthWorkerEnv, Awareness, type AwarenessState, type AwarenessStates, BASE_USERS_SCHEMA, BROWSER_PROXY_ROUTES, BUILD_INJECTED_APP_ID_MIGRATION_ID, BUILT_IN_TOOLS, type BaseMessage, BaseRoom, type BindingJsonValue, BodyTooLargeError, CHANNELS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, COST_RATES, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type ClientMessage, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ComposioToolsOptions, type ConnectionAttachment, type CronContext, type CronExecution, CronRoom, type CronRoomConfig, type CronTask, type CustomBinding, type CustomBindingManifest, DEEPSPACE_AGENT_PROFILES, DEEPSPACE_AI_DEFAULTS, DEEPSPACE_AI_MODELS, DEEPSPACE_MODEL_CATALOG_PROVENANCE, DEFAULT_CONTEXT_CONFIG, DEFAULT_DELETE_WHERE_LIMIT, DEFAULT_DO_MANIFEST, DEFAULT_QUERY_LIMIT, DEPLOYED_APPS_DEFAULTS, type DOBindings, type DOManifest, type DOManifestEntry, type DeepSpaceAIEnv, type DeepSpaceAIModel, type DeepSpaceAIModelId, type DeepSpaceAIOptions, type DeepSpaceAIProvider, type DeepSpaceAgentDiagnosticContext, DeepSpaceAgentModelError, type DeepSpaceAgentProfile, DeepSpaceAgentProfileError, type DeepSpaceAgentProfileId, type DeepSpaceAgentStream, type DeepSpaceAgentStreamOptions, type DeepSpaceAgentSupport, type DeepSpaceAuth, type DeepSpaceAuthConfig, type DeepSpaceDocumentationRouteEnv, type DeepSpaceDocumentationRouteOptions, type DoMigrationDirective, type DoMigrationPlan, type ExistingDOBinding, FILES_SESSION_COOKIE_READS_MIGRATION_ID, type GetActionData, type HandlerContext, type Job, type JobContext, JobRoom, type JobRoomConfig, type JobStatus, type JwtClaims, type JwtVerifierConfig, type KnowledgeAddOptions, type KnowledgeAddResult, type KnowledgeClient, type KnowledgeEnv, KnowledgeError, type KnowledgeItem, type KnowledgeListOptions, type KnowledgeListResult, type KnowledgeSearchChunk, type KnowledgeSearchOptions, type KnowledgeSearchResult, type KnowledgeStatus, LOG_LEVELS, type LogLevel, MAX_APP_FILE_BYTES, MAX_BINDING_NAME_LENGTH, MAX_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_ENV_VAR_BYTES, MAX_LOG_TEXT_LENGTH, MAX_UPLOAD_PARTS, MAX_UPLOAD_REQUEST_BYTES, MESSAGES_SCHEMA, MSG, MSG_AWARENESS, MSG_SYNC, MSG_SYNC_STEP1, MSG_SYNC_STEP2, MSG_SYNC_UPDATE, MSG_YJS_AWARENESS, MSG_YJS_SYNC, type MessageHandlers, type MsgType, type MutateActionData, type NormalizedApiError, PRODUCTION_OFFICIAL_AGENT_ORIGINS, type PermissionContext, type PermissionLevel, type PlatformWorkerEnv, type PrefixResult, type PresencePeer, PresenceRoom, type ProtocolMessage, type ProxyRoute, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, RECORD_NOT_FOUND, REGISTRY_INSTANCE, RELEASE_STAMP_PATH, REPO_STORE_LIMIT_BYTES, REQUIRED_COMPATIBILITY_FLAGS, RESERVED_BINDING_NAMES, RESERVED_RUN_WORKER_FIRST, RESOURCE_ID_RE, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_DEFAULT, RecordRoom, type RecordRoomConfig, RegistryClientError, type ResolvedColumn, type ResolvedDeepSpaceAgentModel, type RolePermissions, type RunMigrationsResult, SDK_RUN_WORKER_FIRST, SECRET_NAME_RE, SECURE_ROOM_BOUNDARIES_MIGRATION_ID, SESSION_COOKIE, STRICT_APP_ID_RE, SYSTEM_ASSIGNED_COLUMNS, SYSTEM_COLLECTIONS, SYSTEM_MAINTAINED_COLUMNS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedKnowledgeClient, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, type ServerMessage, type StorageAdmission, type StoredRecord, type Summarizer, type SyncResult, TEST_ACCOUNT_EMAIL_SUFFIX, type TokenDebugInfo, type ToolResult, type ToolSchema, UNDECLARED_ASSET_NOT_FOUND_HANDLING, UPLOAD_PART_BYTES, USERS_COLUMNS, type User, type UserAttachment, type UserToolExecutorEnv, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, YjsRoom, agentTokenIssuer, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, armCronRoom, authWorkerFetch, authenticatedRoomRequest, bindingManifestFromOutputConfig, buildCronContext, buildTableSelect, buildUiParts, callRegistry, canCreate, canDelete, canRead, canUpdate, capToolResultSize, captureScreenshot, checkFieldPermissions, checkUnclaimedOwnerTransition, clientBuild, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDecoder, createDeepSpaceAI, createDeepSpaceAuth, createEncoder, createScopedR2Handler, createUserToolExecutor, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, enqueueJob, epochSeconds, folderFilter, formatBytes, getChat, getDeepSpaceAIModel, getMessageType, getRolePermissions, handleAwarenessMessage, handleSyncMessage, hasContent, isAnonymousUserId, isAssetNotFoundHandling, isAutoProvision, isFilesVerbPath, isOwner, isPlatformReservedPath, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, knowledge, lintSchema, lintSchemaSet, lintSchemas, listDeepSpaceAgentModels, loadMessages, logEventText, loggableError, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, normalizeAgentTargetOrigin, normalizeApiError, normalizeKnowledgeFolder, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readBoundedBodyText, readVarUint, readVarUint8Array, registerAgentToolRoutes, registerDeepSpaceDocumentation, registryErrorJson, registryStub, resolveAppMembership, resolveAppName, resolveAppRole, resolveColumn, resolveCompatibilityFlags, resolveDeepSpaceAgentModel, resolveSessionReadAuth, rowToData, runMigrations, serverBuild, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, toUint8Array, totalChars, truncateLogText, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppMigrationIds, validateAppName, validateBindingManifest, validateDoManifest, verifyAgentToken, verifyJwt, workerErrorHandler, writeVarUint, writeVarUint8Array };
5799
+ export { ACCOUNT_STORAGE_LIMIT_BYTES, ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID, ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID, AGENT_TOKEN_SCOPE, AGENT_TOOL_REQUEST_BODY_CAP, AGENT_TOOL_RESPONSE_BODY_CAP, AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, AI_SDK_7_MIGRATION_ID, ALLOWED_BINDING_TYPES, ANONYMOUS_USER_ID_PREFIX, APP_ID_RE, APP_LOG_EVENT_KEYS, APP_NAME_RULES, ASSET_NOT_FOUND_HANDLING_VALUES, AUTO_PROVISIONABLE_TYPES, AUTO_PROVISION_SENTINEL, type ActionContext, type ActionHandler, type ActionResult, type ActionTools, type AgentTargetPolicy, type AgentToolAccessResult, type AgentToolRouteEnv, type AgentToolRouteOptions, type ApiErrorIssue, type ApiWorkerEnv, type AppLogEvent, type AppLogEventKey, type AppLogsResponse, type AppMembership, type AppMigrationIdsValidation, type AppNameResolution, type AppNameValidation, type AssetNotFoundHandling, type AuthWorkerEnv, Awareness, type AwarenessState, type AwarenessStates, BASE_USERS_SCHEMA, BROWSER_PROXY_ROUTES, BUILD_INJECTED_APP_ID_MIGRATION_ID, BUILT_IN_TOOLS, type BaseMessage, BaseRoom, type BindingJsonValue, BodyTooLargeError, CHANNELS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, COST_RATES, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type ClientMessage, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ComposioToolsOptions, type ConnectionAttachment, type CronContext, type CronExecution, CronRoom, type CronRoomConfig, type CronTask, type CustomBinding, type CustomBindingManifest, DEEPSPACE_AGENT_PROFILES, DEEPSPACE_AI_DEFAULTS, DEEPSPACE_AI_MODELS, DEEPSPACE_MODEL_CATALOG_PROVENANCE, DEFAULT_CONTEXT_CONFIG, DEFAULT_DELETE_WHERE_LIMIT, DEFAULT_DO_MANIFEST, DEFAULT_QUERY_LIMIT, DEPLOYED_APPS_DEFAULTS, type DOBindings, type DOManifest, type DOManifestEntry, type DeepSpaceAIEnv, type DeepSpaceAIModel, type DeepSpaceAIModelId, type DeepSpaceAIOptions, type DeepSpaceAIProvider, type DeepSpaceAgentDiagnosticContext, DeepSpaceAgentModelError, type DeepSpaceAgentProfile, DeepSpaceAgentProfileError, type DeepSpaceAgentProfileId, type DeepSpaceAgentStream, type DeepSpaceAgentStreamOptions, type DeepSpaceAgentSupport, type DeepSpaceAuth, type DeepSpaceAuthConfig, type DeepSpaceDocumentationRouteEnv, type DeepSpaceDocumentationRouteOptions, type DeepSpaceUserCreateContext, type DoMigrationDirective, type DoMigrationPlan, type ExistingDOBinding, type ExpoAuthBridgeOptions, type ExpoAuthWorkerEnv, FILES_SESSION_COOKIE_READS_MIGRATION_ID, type GetActionData, type HandlerContext, type Job, type JobContext, JobRoom, type JobRoomConfig, type JobStatus, type JwtClaims, type JwtVerifierConfig, type KnowledgeAddOptions, type KnowledgeAddResult, type KnowledgeClient, type KnowledgeEnv, KnowledgeError, type KnowledgeItem, type KnowledgeListOptions, type KnowledgeListResult, type KnowledgeSearchChunk, type KnowledgeSearchOptions, type KnowledgeSearchResult, type KnowledgeStatus, LOG_LEVELS, type LogLevel, MAX_APP_FILE_BYTES, MAX_BINDING_NAME_LENGTH, MAX_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_ENV_VAR_BYTES, MAX_LOG_TEXT_LENGTH, MAX_UPLOAD_PARTS, MAX_UPLOAD_REQUEST_BYTES, MESSAGES_SCHEMA, MSG, MSG_AWARENESS, MSG_SYNC, MSG_SYNC_STEP1, MSG_SYNC_STEP2, MSG_SYNC_UPDATE, MSG_YJS_AWARENESS, MSG_YJS_SYNC, type MessageHandlers, type MsgType, type MutateActionData, type NormalizedApiError, PLANES, PRODUCTION_OFFICIAL_AGENT_ORIGINS, type PermissionContext, type PermissionLevel, type PlaneName, type PlaneUrls, type PlatformWorkerEnv, type PrefixResult, type PresencePeer, PresenceRoom, type ProtocolMessage, type ProxyRoute, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, RECORD_NOT_FOUND, REGISTRY_INSTANCE, RELEASE_STAMP_PATH, REPO_STORE_LIMIT_BYTES, REQUIRED_COMPATIBILITY_FLAGS, RESERVED_BINDING_NAMES, RESERVED_RUN_WORKER_FIRST, RESOURCE_ID_RE, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_DEFAULT, RecordRoom, type RecordRoomConfig, RegistryClientError, type ResolvedColumn, type ResolvedDeepSpaceAgentModel, type RolePermissions, type RunMigrationsResult, SANDBOX_SCOPES, SANDBOX_SCOPE_HEADER, SDK_RUN_WORKER_FIRST, SECRET_NAME_RE, SECURE_ROOM_BOUNDARIES_MIGRATION_ID, SESSION_COOKIE, STRICT_APP_ID_RE, SYSTEM_ASSIGNED_COLUMNS, SYSTEM_COLLECTIONS, SYSTEM_MAINTAINED_COLUMNS, SYSTEM_MANAGED_COLUMNS, type SandboxFile, SandboxFileError, type SandboxFileList, type SandboxFilesClient, type SandboxFilesOptions, type SandboxScope, type SandboxUploadOptions, SchemaRegistry, type ScopeContext, type ScopedKnowledgeClient, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, type ServerMessage, type StorageAdmission, type StoredRecord, type Summarizer, type SyncResult, TEST_ACCOUNT_EMAIL_SUFFIX, type TokenDebugInfo, type ToolResult, type ToolSchema, UNDECLARED_ASSET_NOT_FOUND_HANDLING, UPLOAD_PART_BYTES, USERS_COLUMNS, type User, type UserAttachment, type UserToolExecutorEnv, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, YjsRoom, agentTokenIssuer, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, armCronRoom, authWorkerFetch, authenticatedRoomRequest, bindingManifestFromOutputConfig, buildCronContext, buildTableSelect, buildUiParts, callRegistry, callableFromSandbox, canCreate, canDelete, canRead, canUpdate, capToolResultSize, captureScreenshot, checkFieldPermissions, checkUnclaimedOwnerTransition, clientBuild, codeExecutionTool, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDecoder, createDeepSpaceAI, createDeepSpaceAuth, createEncoder, createScopedR2Handler, createUserToolExecutor, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, enqueueJob, epochSeconds, folderFilter, formatBytes, forwardSandboxContainer, getChat, getDeepSpaceAIModel, getMessageType, getRolePermissions, handleAwarenessMessage, handleSyncMessage, hasContent, isAnonymousUserId, isAssetNotFoundHandling, isAutoProvision, isFilesVerbPath, isOwner, isPlatformReservedPath, isRestrictedPlane, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, knowledge, lintSchema, lintSchemaSet, lintSchemas, listDeepSpaceAgentModels, loadMessages, logEventText, loggableError, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, nativeAuthCallback, nativeAuthExchange, nativeAuthMe, nativeAuthSignOut, nativeAuthStart, nativeAuthToken, noopPermissionContext, normalizeAgentTargetOrigin, normalizeApiError, normalizeKnowledgeFolder, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readBoundedBodyText, readVarUint, readVarUint8Array, registerAgentToolRoutes, registerDeepSpaceDocumentation, registryErrorJson, registryStub, resolveAppMembership, resolveAppName, resolveAppRole, resolveColumn, resolveCompatibilityFlags, resolveDeepSpaceAgentModel, resolveSessionReadAuth, reuseSandbox, rowToData, runMigrations, sandboxFiles, sandboxOutputs, sandboxUpload, serverBuild, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, toUint8Array, totalChars, truncateLogText, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppMigrationIds, validateAppName, validateBindingManifest, validateDoManifest, verifyAgentToken, verifyJwt, workerErrorHandler, writeVarUint, writeVarUint8Array };