deepspace 0.3.8 → 0.3.9

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/worker.d.ts CHANGED
@@ -1208,6 +1208,20 @@ declare const SYSTEM_MANAGED_COLUMNS: Set<string>;
1208
1208
  /** Standard user columns. Apps spread these into their users schema. */
1209
1209
  declare const USERS_COLUMNS: ColumnDefinition[];
1210
1210
  declare const BASE_USERS_SCHEMA: CollectionSchema;
1211
+ /**
1212
+ * Lint a CollectionSchema for declarations that look like they should
1213
+ * enforce something but don't, due to interactions between top-level
1214
+ * fields (visibilityField, ownerField) and per-role permission levels.
1215
+ *
1216
+ * The SDK has historically silently accepted schemas that imply more
1217
+ * enforcement than they actually deliver — e.g., `visibilityField` set
1218
+ * but every role's `read: true` means "anyone can read everything"
1219
+ * regardless of `visibility`. Warn loudly at registration so app
1220
+ * authors notice before shipping a privacy bug.
1221
+ *
1222
+ * Returns an array of warning messages. Empty = clean.
1223
+ */
1224
+ declare function lintSchema(schema: CollectionSchema): string[];
1211
1225
  declare class SchemaRegistry {
1212
1226
  private trusted;
1213
1227
  constructor(schemas?: CollectionSchema[]);
@@ -1341,6 +1355,7 @@ interface YjsAttachment extends UserAttachment {
1341
1355
  declare class YjsRoom<E = Record<string, unknown>> extends BaseRoom<E> {
1342
1356
  private doc;
1343
1357
  private initialized;
1358
+ private awarenessStates;
1344
1359
  constructor(state: DurableObjectState, env: unknown);
1345
1360
  private ensureInitialized;
1346
1361
  private getDoc;
@@ -1354,6 +1369,9 @@ declare class YjsRoom<E = Record<string, unknown>> extends BaseRoom<E> {
1354
1369
  protected onDisconnect(ws: WebSocket, user: UserAttachment): void;
1355
1370
  private handleSync;
1356
1371
  private handleAwareness;
1372
+ private readAwarenessUpdates;
1373
+ private encodeAwarenessMessage;
1374
+ private sendAwarenessSnapshot;
1357
1375
  private broadcastRaw;
1358
1376
  }
1359
1377
 
@@ -1550,6 +1568,12 @@ declare class PresenceRoom<E = Record<string, unknown>> extends BaseRoom<E> {
1550
1568
  private peers;
1551
1569
  private peerSockets;
1552
1570
  constructor(state: DurableObjectState, env: unknown);
1571
+ /**
1572
+ * Durable Objects can hibernate and clear heap while Cloudflare keeps
1573
+ * WebSocket connections. Deserialize attachments from already-connected
1574
+ * sockets so `peers` matches reality before we send PRESENCE_SYNC.
1575
+ */
1576
+ private hydratePeersFromLiveSockets;
1553
1577
  protected onConnect(ws: WebSocket, user: UserAttachment): PresenceAttachment;
1554
1578
  protected onMessage(ws: WebSocket, user: UserAttachment, message: {
1555
1579
  type: string;
@@ -2326,15 +2350,14 @@ interface GetActionData<T = Record<string, unknown>> {
2326
2350
  interface MutateActionData {
2327
2351
  recordId: string;
2328
2352
  }
2329
- /** Shape of the data field for `tools.integration`. */
2330
- interface IntegrationActionData<T = unknown> {
2331
- /** The integration endpoint's response body, parsed as JSON when possible. */
2332
- response: T;
2333
- /** HTTP status the api-worker forwarded back. */
2334
- status?: number;
2335
- }
2336
2353
  interface ActionTools {
2337
- create<T extends Record<string, unknown> = Record<string, unknown>>(collection: string, data: T): Promise<ActionResult<MutateActionData>>;
2354
+ /**
2355
+ * Insert a new record. When `recordId` is omitted the DO generates one
2356
+ * (typical). Pass `recordId` to upsert against a known key — useful
2357
+ * for `users` where the row id must equal the auth user's id so
2358
+ * `tools.get('users', userId)` resolves.
2359
+ */
2360
+ create<T extends Record<string, unknown> = Record<string, unknown>>(collection: string, data: T, recordId?: string): Promise<ActionResult<MutateActionData>>;
2338
2361
  update<T extends Record<string, unknown> = Record<string, unknown>>(collection: string, recordId: string, data: Partial<T>): Promise<ActionResult<MutateActionData>>;
2339
2362
  remove(collection: string, recordId: string): Promise<ActionResult<MutateActionData>>;
2340
2363
  get<T extends Record<string, unknown> = Record<string, unknown>>(collection: string, recordId: string): Promise<ActionResult<GetActionData<T>>>;
@@ -2344,8 +2367,41 @@ interface ActionTools {
2344
2367
  orderDir?: 'asc' | 'desc';
2345
2368
  limit?: number;
2346
2369
  }): Promise<ActionResult<QueryActionData<T>>>;
2347
- /** Call an integration endpoint (e.g. 'openai/completions') via the API worker */
2348
- integration<T = unknown>(endpoint: string, data?: unknown): Promise<ActionResult<IntegrationActionData<T>>>;
2370
+ /**
2371
+ * Call an integration endpoint (e.g. 'openai/chat-completion') via the
2372
+ * api-worker. On success, `result.data` is the integration's response
2373
+ * body directly — there is no `.response` wrapper. So an OpenAI call
2374
+ * yields `result.data.choices`, a Freepik image call yields
2375
+ * `result.data.images`, etc.
2376
+ */
2377
+ integration<T = unknown>(endpoint: string, data?: unknown): Promise<ActionResult<T>>;
2378
+ /**
2379
+ * Insert or refresh the `users` row for an authenticated caller.
2380
+ * Mirrors the WS-connect registerUser flow — useful for CLI-only
2381
+ * actions (e.g. publishing via `deepspace foo publish`) where the
2382
+ * caller may never have opened the web app and has no `users` row
2383
+ * yet. Bypasses SYSTEM_MANAGED column stripping so name/email/
2384
+ * imageUrl are actually written.
2385
+ *
2386
+ * Defaults `userId` to the action's caller. Pass `isAdmin: true` only
2387
+ * if the caller's platform-tier role is admin (worker.ts should
2388
+ * derive this from the verified JWT — never trust client input).
2389
+ */
2390
+ registerUser(opts: {
2391
+ userId?: string;
2392
+ name?: string;
2393
+ email?: string;
2394
+ imageUrl?: string;
2395
+ isAdmin?: boolean;
2396
+ }): Promise<ActionResult<{
2397
+ user: {
2398
+ id: string;
2399
+ name: string;
2400
+ email: string;
2401
+ imageUrl?: string;
2402
+ role: string;
2403
+ };
2404
+ }>>;
2349
2405
  }
2350
2406
  /**
2351
2407
  * `TEnv` lets apps type the worker-scoped env object passed to the
@@ -2364,6 +2420,13 @@ interface ActionContext<TEnv = Record<string, unknown>> {
2364
2420
  * (e.g. for owner-only action gating).
2365
2421
  */
2366
2422
  env: TEnv;
2423
+ /**
2424
+ * The caller's raw JWT. Forward this on outbound requests that need to
2425
+ * impersonate the user (e.g. checking `/api/apps` ownership on the
2426
+ * deploy worker, where the user — not the app owner — should be billed
2427
+ * / authorized).
2428
+ */
2429
+ callerJwt: string;
2367
2430
  }
2368
2431
  type ActionHandler<TEnv = Record<string, unknown>> = (ctx: ActionContext<TEnv>) => Promise<ActionResult>;
2369
2432
 
@@ -2401,7 +2464,7 @@ interface CronContext {
2401
2464
  interface CronEnv {
2402
2465
  RECORD_ROOMS: DurableObjectNamespace;
2403
2466
  INTERNAL_STORAGE_HMAC_SECRET?: string;
2404
- /** Override API base URL for local dev (defaults to https://api.deep.space) */
2467
+ /** Override API base URL for local dev or custom platform deployments. */
2405
2468
  API_BASE_URL?: string;
2406
2469
  }
2407
2470
  /**
@@ -2570,6 +2633,56 @@ interface DeepSpaceAIOptions {
2570
2633
  */
2571
2634
  declare function createDeepSpaceAI(env: DeepSpaceAIEnv, provider: Provider, options?: DeepSpaceAIOptions): DeepSpaceModelFactory;
2572
2635
 
2636
+ /**
2637
+ * captureScreenshot — call platform-worker /internal/screenshot.
2638
+ *
2639
+ * Apps don't ship CF Browser Rendering bindings or puppeteer in their
2640
+ * own bundle. The platform holds the binding; consumers call this
2641
+ * helper to get PNG bytes for a URL.
2642
+ *
2643
+ * The platform enforces: a host allowlist (*.app.space / *.deep.space),
2644
+ * a per-app sliding rate limit, and viewport/timeout clamping. Returns
2645
+ * `null` on any non-2xx — callers should treat as "no preview available"
2646
+ * and surface their own fallback UX.
2647
+ *
2648
+ * Auth is the same HMAC-of-appName pattern `/internal/files` uses:
2649
+ * x-app-identity-token = hmac(PLATFORM_IDENTITY_SECRET, APP_NAME)
2650
+ * x-app-name = APP_NAME
2651
+ *
2652
+ * Apps already have both as bindings (APP_IDENTITY_TOKEN + APP_NAME),
2653
+ * so this helper is a thin wrapper — no extra secrets to manage.
2654
+ */
2655
+
2656
+ interface ScreenshotOptions {
2657
+ url: string;
2658
+ viewport?: {
2659
+ width: number;
2660
+ height: number;
2661
+ };
2662
+ waitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
2663
+ timeoutMs?: number;
2664
+ fullPage?: boolean;
2665
+ }
2666
+ interface ScreenshotEnv extends PlatformWorkerEnv {
2667
+ APP_NAME: string;
2668
+ APP_IDENTITY_TOKEN: string;
2669
+ }
2670
+ interface ScreenshotResult {
2671
+ /** PNG bytes. */
2672
+ body: ArrayBuffer;
2673
+ /** `image/png`. */
2674
+ contentType: string;
2675
+ }
2676
+ /**
2677
+ * Capture a screenshot of `opts.url` and return the PNG bytes.
2678
+ *
2679
+ * Returns null on capture failure (target unreachable, timeout, BR
2680
+ * binding misconfigured platform-side). The platform endpoint logs the
2681
+ * underlying error; callers should treat null as "no preview available"
2682
+ * and surface their own UX fallback.
2683
+ */
2684
+ declare function captureScreenshot(env: ScreenshotEnv, opts: ScreenshotOptions): Promise<ScreenshotResult | null>;
2685
+
2573
2686
  /**
2574
2687
  * Chat context pipeline — keeps the per-request payload to the LLM bounded.
2575
2688
  *
@@ -2810,7 +2923,12 @@ declare function meterUsage(env: MeteringEnv, kind: string, fields?: {
2810
2923
  *
2811
2924
  * For a pure embedding call (outputChars=0), only the input event fires.
2812
2925
  * Pass `inputChars` and `outputChars` raw — the rough chars-to-token
2813
- * conversion happens at price time using `COST_RATES.ai.embedPerChar`.
2926
+ * conversion happens at price time using `COST_RATES.ai.embedInputPerChar`.
2927
+ *
2928
+ * Note: only embedding-input has an authoritative rate today. LLM-output
2929
+ * pricing varies wildly per model so `priceBindingUsageEvent` returns 0
2930
+ * for `op='output'` until per-model rates are wired. The events are still
2931
+ * recorded so the dashboard can show that the calls happened.
2814
2932
  */
2815
2933
  declare function meterAi(env: MeteringEnv, model: string, fields?: {
2816
2934
  inputChars?: number;
@@ -2859,8 +2977,12 @@ declare function meterVectorize(env: MeteringEnv, indexName: string, op: 'query'
2859
2977
  */
2860
2978
  declare const COST_RATES: {
2861
2979
  readonly ai: {
2862
- /** USD per character (input or output). */
2863
- readonly perChar: number;
2980
+ /**
2981
+ * USD per character of *embedding input* (bge-m3 / qwen3-embedding tier).
2982
+ * Renamed from `perChar` to make explicit that this rate does NOT
2983
+ * apply to LLM-generation output — see `priceBindingUsageEvent`.
2984
+ */
2985
+ readonly embedInputPerChar: number;
2864
2986
  };
2865
2987
  readonly vectorize: {
2866
2988
  /** USD per queried dimension (per query, per stored vector compared). */
@@ -2869,6 +2991,20 @@ declare const COST_RATES: {
2869
2991
  readonly storedPerDimPerMonth: number;
2870
2992
  };
2871
2993
  };
2994
+ /**
2995
+ * Price a single rolled-up `deepspace_binding_usage` row. Lives next to
2996
+ * `COST_RATES` so the (kind, op) → rate mapping stays paired with the schema
2997
+ * the meter helpers write.
2998
+ *
2999
+ * Returns 0 for combinations without an authoritative per-unit rate; the row
3000
+ * still surfaces in dashboards for observability. Notable zeros:
3001
+ * - `ai/output`: LLM-output prices vary per model and `meterAi` doesn't
3002
+ * carry a model-family signal. Pricing it at the embedding rate would
3003
+ * silently under-bill chat-LLM use.
3004
+ * - `vectorize.storedPerDimPerMonth`: events are per-call deltas, not
3005
+ * monthly snapshots, so a windowed SUM isn't meaningful here.
3006
+ */
3007
+ declare function priceBindingUsageEvent(kind: string, op: string, units: number): number;
2872
3008
 
2873
3009
  /**
2874
3010
  * Lightweight D1 schema bootstrapping for apps that use auto-provisioned
@@ -2949,7 +3085,7 @@ interface JwtVerifierConfig {
2949
3085
  publicKey: string;
2950
3086
  /** Expected issuer (e.g. "https://auth.deep.space") */
2951
3087
  issuer: string;
2952
- /** Expected audience (e.g. "https://api.deep.space") */
3088
+ /** Expected audience (usually the configured platform API URL) */
2953
3089
  audience?: string | string[];
2954
3090
  /** Allowed origins / authorized parties (supports wildcards like "https://*.app.space") */
2955
3091
  authorizedParties?: string[];
@@ -3890,4 +4026,4 @@ type DeepSpaceAuth = ReturnType<typeof createDeepSpaceAuth>;
3890
4026
  /** Collections that bypass schema checks (permissive access) */
3891
4027
  declare const SYSTEM_COLLECTIONS: Set<string>;
3892
4028
 
3893
- export { AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, APP_NAME_RULES, AUTO_PROVISIONABLE_TYPES, AUTO_PROVISION_SENTINEL, type ActionContext, type ActionHandler, type ActionResult, type ActionTools, type ApiWorkerEnv, type AppNameResolution, type AppNameValidation, type AuthWorkerEnv, Awareness, type AwarenessState, type AwarenessStates, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, type BaseMessage, BaseRoom, CHANNELS_SCHEMA, CHANNEL_INVITATIONS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CONVERSATION_SCHEMAS, COST_RATES, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type ClientMessage, type CollectionPermissionSummary, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ConnectionAttachment, type ConvMemberData, type ConvMessageData, type ConvReactionData, type ConvReadCursorData, type ConvVoteData, type ConversationStateData, type CronContext, type CronExecution, CronRoom, type CronRoomConfig, type CronTask, type CustomBinding, type CustomBindingManifest, DEFAULT_CONTEXT_CONFIG, DEFAULT_DO_MANIFEST, DEFAULT_MAX_SKEW_MS, DIRECTORY_SCHEMAS, type DOBindings, type DOManifest, type DOManifestEntry, type DeepSpaceAIEnv, type DeepSpaceAIOptions, type DeepSpaceAuth, type DeepSpaceAuthConfig, type DirectoryCommunityData, type DirectoryConversationData, type DirectoryMembershipData, type DirectoryPostData, type DoMigrationDirective, type DoMigrationPlan, type ExistingDOBinding, GLOBAL_DO_TYPES, GLOBAL_DO_TYPE_NAMES, type GameInput, GameRoom, type GameRoomConfig, type GetActionData, type GlobalDOType, type HandlerContext, type IntegrationActionData, type InternalSignature, type JwtClaims, type JwtVerifierConfig, 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 PermissionAnalysis, type PermissionContext, type PermissionLevel, type PermissionSource, type PlatformWorkerEnv, type Player, type PrefixResult, type PresencePeer, PresenceRoom, type ProtocolMessage, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_NAMES, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_DEFAULT, RecordRoom, type RecordRoomConfig, type ResolvedColumn, type ResolvedPermission, type RolePermissions, type RunMigrationsResult, SYSTEM_COLLECTIONS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ServerMessage, type SharedConnection, type SignInternalPayloadInput, type StoredRecord, type Summarizer, type SyncResult, type TokenDebugInfo, type ToolResult, type ToolSchema, USERS_COLUMNS, type User, type UserAttachment, VOTING_SCHEMAS, type ValidationError, type VerifiedAuth, type VerifyInternalSignatureInput, type VerifyOutcome, type VerifyResult, type Viewport, WORKSPACE_SCHEMAS, YjsRoom, analyzePermissions, apiWorkerFetch, appendMessage, applySlidingWindow, authWorkerFetch, bindingManifestFromOutputConfig, buildCronContext, buildInternalPayload, buildTableSelect, buildUiParts, canCreate, canDelete, canRead, canUpdate, capToolResultSize, checkFieldPermissions, clientBuild, coerceValue, collectionTableName, columnId, computeDoMigration, computeHmacHex, createChat, createDecoder, createDeepSpaceAI, createDeepSpaceAuth, createEncoder, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, getChat, getGlobalDOSchemas, getGlobalDOType, getMessageType, getRolePermissions, handleAwarenessMessage, handleSyncMessage, hasContent, isAutoProvision, isOwner, loadMessages, makeDefaultSummarizer, meterAi, meterUsage, meterVectorize, noopPermissionContext, platformWorkerFetch, prepareMessagesWithCompaction, readVarUint, readVarUint8Array, resolveAppName, resolveColumn, rowToData, runMigrations, serverBuild, signInternalPayload, timingSafeEqualHex, toUint8Array, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppName, validateBindingManifest, validateDoManifest, verifyInternalSignature, verifyJwt, workspaceAccountsSchema, workspaceContentSharesSchema, workspaceEmailHandlesSchema, workspaceFormResponsesSchema, workspacePeopleSchema, workspaceProjectsSchema, workspaceTagsSchema, workspaceTasksSchema, workspaceTeamMembersSchema, workspaceTeamsSchema, workspaceTransactionsSchema, writeVarUint, writeVarUint8Array };
4029
+ export { AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, APP_NAME_RULES, AUTO_PROVISIONABLE_TYPES, AUTO_PROVISION_SENTINEL, type ActionContext, type ActionHandler, type ActionResult, type ActionTools, type ApiWorkerEnv, type AppNameResolution, type AppNameValidation, type AuthWorkerEnv, Awareness, type AwarenessState, type AwarenessStates, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, type BaseMessage, BaseRoom, CHANNELS_SCHEMA, CHANNEL_INVITATIONS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CONVERSATION_SCHEMAS, COST_RATES, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type ClientMessage, type CollectionPermissionSummary, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ConnectionAttachment, type ConvMemberData, type ConvMessageData, type ConvReactionData, type ConvReadCursorData, type ConvVoteData, type ConversationStateData, type CronContext, type CronExecution, CronRoom, type CronRoomConfig, type CronTask, type CustomBinding, type CustomBindingManifest, DEFAULT_CONTEXT_CONFIG, DEFAULT_DO_MANIFEST, DEFAULT_MAX_SKEW_MS, DIRECTORY_SCHEMAS, type DOBindings, type DOManifest, type DOManifestEntry, type DeepSpaceAIEnv, type DeepSpaceAIOptions, type DeepSpaceAuth, type DeepSpaceAuthConfig, type DirectoryCommunityData, type DirectoryConversationData, type DirectoryMembershipData, type DirectoryPostData, type DoMigrationDirective, type DoMigrationPlan, type ExistingDOBinding, GLOBAL_DO_TYPES, GLOBAL_DO_TYPE_NAMES, type GameInput, GameRoom, type GameRoomConfig, type GetActionData, type GlobalDOType, type HandlerContext, type InternalSignature, type JwtClaims, type JwtVerifierConfig, 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 PermissionAnalysis, type PermissionContext, type PermissionLevel, type PermissionSource, type PlatformWorkerEnv, type Player, type PrefixResult, type PresencePeer, PresenceRoom, type ProtocolMessage, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_NAMES, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_DEFAULT, RecordRoom, type RecordRoomConfig, type ResolvedColumn, type ResolvedPermission, type RolePermissions, type RunMigrationsResult, SYSTEM_COLLECTIONS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotOptions, type ScreenshotResult, type ServerMessage, type SharedConnection, type SignInternalPayloadInput, type StoredRecord, type Summarizer, type SyncResult, type TokenDebugInfo, type ToolResult, type ToolSchema, USERS_COLUMNS, type User, type UserAttachment, VOTING_SCHEMAS, type ValidationError, type VerifiedAuth, type VerifyInternalSignatureInput, type VerifyOutcome, type VerifyResult, type Viewport, WORKSPACE_SCHEMAS, YjsRoom, analyzePermissions, apiWorkerFetch, appendMessage, applySlidingWindow, authWorkerFetch, bindingManifestFromOutputConfig, buildCronContext, buildInternalPayload, buildTableSelect, buildUiParts, canCreate, canDelete, canRead, canUpdate, capToolResultSize, captureScreenshot, checkFieldPermissions, clientBuild, coerceValue, collectionTableName, columnId, computeDoMigration, computeHmacHex, createChat, createDecoder, createDeepSpaceAI, createDeepSpaceAuth, createEncoder, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, getChat, getGlobalDOSchemas, getGlobalDOType, getMessageType, getRolePermissions, handleAwarenessMessage, handleSyncMessage, hasContent, isAutoProvision, isOwner, lintSchema, loadMessages, makeDefaultSummarizer, meterAi, meterUsage, meterVectorize, noopPermissionContext, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readVarUint, readVarUint8Array, resolveAppName, resolveColumn, rowToData, runMigrations, serverBuild, signInternalPayload, timingSafeEqualHex, toUint8Array, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppName, validateBindingManifest, validateDoManifest, verifyInternalSignature, verifyJwt, workspaceAccountsSchema, workspaceContentSharesSchema, workspaceEmailHandlesSchema, workspaceFormResponsesSchema, workspacePeopleSchema, workspaceProjectsSchema, workspaceTagsSchema, workspaceTasksSchema, workspaceTeamMembersSchema, workspaceTeamsSchema, workspaceTransactionsSchema, writeVarUint, writeVarUint8Array };