deepspace 0.22.1 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.d.ts CHANGED
@@ -143,6 +143,17 @@ type ToolResult = {
143
143
  * `actions.query`) stay unbounded.
144
144
  */
145
145
  declare const DEFAULT_QUERY_LIMIT = 50;
146
+ /**
147
+ * Page size `records.deleteWhere` uses when the caller omits `limit`, and the
148
+ * ceiling it clamps any larger `limit` to.
149
+ *
150
+ * The tool exists so a cascade costs one subrequest per *page* instead of one
151
+ * per row (see `deleteChatCascade`); the ceiling keeps a single call's SQL and
152
+ * delete broadcasts bounded, and callers page by repeating the call until it
153
+ * reports fewer deletions than the page size.
154
+ */
155
+ declare const DEFAULT_DELETE_WHERE_LIMIT = 100;
156
+ declare const MAX_DELETE_WHERE_LIMIT = 500;
146
157
  /**
147
158
  * Fill in assistant-only parameter defaults for a built-in tool call.
148
159
  *
@@ -450,6 +461,16 @@ interface CollectionSchema {
450
461
  permissions: Record<string, RolePermissions>;
451
462
  /** Default role assigned on the `users` collection. */
452
463
  defaultRole?: string;
464
+ /**
465
+ * `users` collection only: what the `user.list` roster shows a non-admin
466
+ * whose `read` policy is row-scoped (`'own'`, `'team'`, …). Default
467
+ * `'public-identity'`: every registered user's id/name/imageUrl/role — the
468
+ * row policy keeps guarding full-row reads on the records/query path.
469
+ * `'read-policy'`: the roster contains only the rows the caller's read
470
+ * policy grants (still projected to public identity) — for apps that scope
471
+ * users to a tenant/team and must not show names across it.
472
+ */
473
+ roster?: 'public-identity' | 'read-policy';
453
474
  }
454
475
  interface Query {
455
476
  collection: string;
@@ -1231,16 +1252,27 @@ declare function makeDefaultSummarizer(env: DeepSpaceAIEnv, options?: {
1231
1252
  /**
1232
1253
  * Chat history helpers — wrap RecordRoom's tools API for ai-chats / ai-messages.
1233
1254
  *
1234
- * Trust model: every helper sends `X-App-Action: 'true'`, which bypasses
1235
- * RecordRoom's per-record RBAC. The worker is the trust boundary, not
1236
- * RecordRoom. Callers MUST verify ownership before invoking write helpers
1237
- * (`updateChat`, `appendMessage`, `deleteChatCascade`); the worker's
1238
- * `/api/ai/chat`, `PATCH /api/ai/chats/:id`, and `DELETE /api/ai/chats/:id`
1239
- * routes do this via a `getChat()` precheck that 404s when the row is
1240
- * missing or owned by another user. Read helpers (`getChat`, `loadMessages`)
1241
- * filter by `chatId` against userBound rows, so cross-user reads return
1242
- * empty — but new consumers should still consider an explicit ownership
1243
- * check before exposing data.
1255
+ * Trust model: every helper here runs through `executeToolAsApp`, which sends
1256
+ * `X-App-Action: 'true'` and therefore **bypasses RecordRoom's per-record
1257
+ * RBAC entirely**. The `userId` argument these helpers take is the identity
1258
+ * they act *as* — it is NOT an authorization boundary, and RecordRoom will
1259
+ * not check it. The worker is the only trust boundary.
1260
+ *
1261
+ * `getChat` is that boundary for this module: it compares the stored
1262
+ * `userId` against the caller and returns null on a mismatch, so the
1263
+ * worker's `/api/ai/chat`, `PATCH /api/ai/chats/:id`, and
1264
+ * `DELETE /api/ai/chats/:id` routes 404 when a row is missing *or* owned by
1265
+ * someone else. Every write helper (`updateChat`, `appendMessage`,
1266
+ * `deleteChatCascade`) is reachable only behind that precheck; a new caller
1267
+ * that skips it is writing across users, so route new consumers through
1268
+ * `getChat` first.
1269
+ *
1270
+ * `updateChat` and `appendMessage` re-run that precheck themselves and report
1271
+ * `false` instead of writing when the chat is gone: `records.update` /
1272
+ * `records.create` are upserts, so a write racing the user's delete would
1273
+ * resurrect the chat as a ghost row or orphan messages under a chat that no
1274
+ * longer exists. The guard lives in the helpers, not the routes, so every copy
1275
+ * of the scaffolded chat routes gets it.
1244
1276
  *
1245
1277
  * The tools API returns records as `{ recordId, data, createdAt, updatedAt }`
1246
1278
  * envelopes; helpers below flatten them into ChatRow / ChatMessageRow.
@@ -1264,14 +1296,47 @@ type ChatMessageRow = {
1264
1296
  parts?: unknown[];
1265
1297
  createdAt: string;
1266
1298
  };
1299
+ /**
1300
+ * Fetch a chat the caller owns, or null.
1301
+ *
1302
+ * This is the module's authorization boundary. `records.get` runs with
1303
+ * `X-App-Action`, so RecordRoom applies no per-record RBAC and will happily
1304
+ * return another user's row — the ownership comparison below is the only
1305
+ * thing standing between a caller and someone else's chat. A miss and a
1306
+ * cross-user hit deliberately look identical to the caller (both null, both
1307
+ * 404 at the route) so chat ids stay unenumerable.
1308
+ */
1267
1309
  declare function getChat(stub: DurableObjectStub, chatId: string, userId: string): Promise<ChatRow | null>;
1268
1310
  declare function createChat(stub: DurableObjectStub, userId: string, opts?: {
1269
1311
  title?: string;
1270
1312
  model?: string;
1271
1313
  }): Promise<ChatRow>;
1272
- declare function updateChat(stub: DurableObjectStub, chatId: string, userId: string, patch: Partial<Pick<ChatRow, 'title' | 'model' | 'compactedSummary' | 'compactedThroughId'>>): Promise<void>;
1314
+ /**
1315
+ * Patch a chat the caller owns. Returns true if the row was written, false if
1316
+ * the chat no longer exists (or never belonged to the caller).
1317
+ *
1318
+ * The `getChat` precheck is not redundant with the route's own: `records.update`
1319
+ * is an upsert on the DO — same code path as create — so an unguarded patch of
1320
+ * a chat the user deleted mid-stream *recreates* it as a title-less ghost whose
1321
+ * messages are already cascaded away. Writing only over a row that still exists
1322
+ * is the one place that can be prevented for every caller, so the guard lives
1323
+ * here rather than at each call site. A tiny TOCTOU window remains between the
1324
+ * read and the write (closing it needs a compare-and-set on the DO); a delete
1325
+ * landing inside that window is the same rare race as before, not the routine
1326
+ * "user deleted the chat while the stream ran" case this closes.
1327
+ */
1328
+ declare function updateChat(stub: DurableObjectStub, chatId: string, userId: string, patch: Partial<Pick<ChatRow, 'title' | 'model' | 'compactedSummary' | 'compactedThroughId'>>): Promise<boolean>;
1273
1329
  declare function deleteChatCascade(stub: DurableObjectStub, chatId: string, userId: string): Promise<void>;
1274
1330
  declare function loadMessages(stub: DurableObjectStub, chatId: string, userId: string): Promise<ChatMessageRow[]>;
1331
+ /**
1332
+ * Append one message to a chat the caller owns. Returns true if the row was
1333
+ * written, false if the chat is gone (or never belonged to the caller).
1334
+ *
1335
+ * Same write-after-delete guard as `updateChat`, for the same reason: a turn
1336
+ * that finishes after the user deleted the chat would otherwise write messages
1337
+ * whose parent row no longer exists — invisible in every listing and never
1338
+ * cascaded again.
1339
+ */
1275
1340
  declare function appendMessage(stub: DurableObjectStub, msg: {
1276
1341
  id: string;
1277
1342
  chatId: string;
@@ -1279,7 +1344,7 @@ declare function appendMessage(stub: DurableObjectStub, msg: {
1279
1344
  role: 'user' | 'assistant' | 'system';
1280
1345
  content: string;
1281
1346
  parts?: unknown[];
1282
- }): Promise<void>;
1347
+ }): Promise<boolean>;
1283
1348
 
1284
1349
  /**
1285
1350
  * Per-binding usage metering — record Vectorize / Workers AI / etc. costs
@@ -1983,7 +2048,24 @@ declare function checkFieldPermissions(schema: CollectionSchema, role: string, n
1983
2048
  * covers both creation and updates while still allowing an owner to unclaim.
1984
2049
  */
1985
2050
  declare function checkUnclaimedOwnerTransition(schema: CollectionSchema, role: string, nextData: Record<string, unknown>, userId: string): string | null;
1986
- /** Names of columns managed by the system (registerUser), not client mutations. */
2051
+ /**
2052
+ * Columns the system *assigns* — from the identity provider at registration,
2053
+ * or from an admin action. A caller who sends one of these has chosen a value
2054
+ * and means it, so a record write that would change one is refused loudly
2055
+ * rather than silently dropped.
2056
+ */
2057
+ declare const SYSTEM_ASSIGNED_COLUMNS: Set<string>;
2058
+ /**
2059
+ * Columns the system *maintains* on its own schedule, without telling anyone.
2060
+ * `registerUser` bumps `lastSeenAt` on every WS connect and `handleUserUpdate`
2061
+ * rewrites it on every 60s presence heartbeat; neither broadcasts, so every
2062
+ * client's copy goes stale silently and there is no heal path short of a
2063
+ * refetch. Read-modify-write echo (`put(id, { ...rec.data, field })`) is the
2064
+ * SDK's own house style, so refusing these would refuse writes over a value the
2065
+ * caller never chose and cannot keep current. They are preserved silently.
2066
+ */
2067
+ declare const SYSTEM_MAINTAINED_COLUMNS: Set<string>;
2068
+ /** Every `users` column owned by the system rather than by record writes. */
1987
2069
  declare const SYSTEM_MANAGED_COLUMNS: Set<string>;
1988
2070
  /** Standard user columns. Apps spread these into their users schema. */
1989
2071
  declare const USERS_COLUMNS: ColumnDefinition[];
@@ -2002,6 +2084,17 @@ declare const BASE_USERS_SCHEMA: CollectionSchema;
2002
2084
  * Returns an array of warning messages. Empty = clean.
2003
2085
  */
2004
2086
  declare function lintSchema(schema: CollectionSchema): string[];
2087
+ /**
2088
+ * Lint a whole schema set: every per-schema warning, plus the rules that
2089
+ * need to see the set. The `'team'` permission level resolves membership from
2090
+ * a `team_members` collection (`teamId`, `userId`, `status`); without one it
2091
+ * denies everything, silently — a mistake that presents as a sync bug, not
2092
+ * as a schema error, so name it here.
2093
+ */
2094
+ declare function lintSchemas(schemas: CollectionSchema[]): string[];
2095
+ /** The rules that need to see the whole schema set (per-schema rules live in
2096
+ * `lintSchema`; `lintSchemas` composes both). */
2097
+ declare function lintSchemaSet(schemas: CollectionSchema[]): string[];
2005
2098
  declare class SchemaRegistry {
2006
2099
  private trusted;
2007
2100
  constructor(schemas?: CollectionSchema[]);
@@ -2985,6 +3078,14 @@ interface SubscriptionContext {
2985
3078
  sql: SqlStorage;
2986
3079
  schemaRegistry: SchemaRegistry;
2987
3080
  state: DurableObjectState;
3081
+ /**
3082
+ * The scope this room was addressed by — `app:{appId}`, `chat:{channelId}`,
3083
+ * `conv:{convId}`, `workspace:default`, … Records are sharded across rooms
3084
+ * by scope, so the scope is what names the room in an unknown-collection
3085
+ * failure. Undefined only for rooms addressed by a unique id rather than a
3086
+ * name (`idFromName` populates `DurableObjectId.name`).
3087
+ */
3088
+ scopeId?: string;
2988
3089
  getPermissionContext(): PermissionContext;
2989
3090
  /** Typed against `ServerMessage` so outbound broadcasts are
2990
3091
  * compile-checked against the wire contract. */
@@ -3004,15 +3105,14 @@ declare function handleSubscribe(ctx: SubscriptionContext, ws: WebSocket, attach
3004
3105
  * The client handles unsubscription locally.
3005
3106
  */
3006
3107
  declare function handleUnsubscribe(_ctx: SubscriptionContext, _ws: WebSocket, _attachment: ConnectionAttachment, _payload: UnsubscribePayload): void;
3007
- /**
3008
- * Execute a query and return matching records.
3009
- * All collections use table-mode (c_* tables).
3010
- *
3011
- * `skipUserRbac` lets a server-action caller (i.e. the app itself, via
3012
- * `X-App-Action`) bypass the per-user read filter for parity with the other
3013
- * `tools.*` operations (`get`, `create`, `update`, `remove`).
3014
- */
3015
- declare function executeQuery(ctx: SubscriptionContext, query: Query, userId: string, userRole: string, skipUserRbac?: boolean): RecordResult[];
3108
+ /** Out-param for {@link executeQuery}: `capped` is set when a limited,
3109
+ * row-filtered scan stopped on {@link MAX_FILTERED_SCAN_ROWS} rather than on
3110
+ * exhausting the rows — the one case a short result does NOT mean "no more
3111
+ * matches". */
3112
+ interface QueryScanState {
3113
+ capped: boolean;
3114
+ }
3115
+ declare function executeQuery(ctx: SubscriptionContext, query: Query, userId: string, userRole: string, skipUserRbac?: boolean, scanState?: QueryScanState): RecordResult[];
3016
3116
  /**
3017
3117
  * Check if a record matches a subscription's query and permissions
3018
3118
  */
@@ -3124,12 +3224,21 @@ declare function getAllUsers(sql: SqlStorage, schemaRegistry?: SchemaRegistry):
3124
3224
  declare function registerUser(sql: SqlStorage, userId: string, name: string, email: string, imageUrl: string | undefined, isAdmin: boolean, defaultRole?: string, schemaRegistry?: SchemaRegistry): Promise<User>;
3125
3225
  /** Handle user list requests without bypassing the users collection's privacy boundary. */
3126
3226
  declare function handleUserList(ctx: UserContext, ws: WebSocket, attachment: ConnectionAttachment): void;
3227
+ /**
3228
+ * Push the current roster to every connected socket (except `except`). The
3229
+ * client asks for `user.list` once per connection and never again, so anything
3230
+ * that changes what the roster shows — a user registering, a rename, a new
3231
+ * avatar, a role change — must push, or every open tab keeps rendering the
3232
+ * peer it has never seen as "Unknown" until it reconnects. The roster is read
3233
+ * and projected once; each socket then gets its own view of it.
3234
+ */
3235
+ declare function broadcastUserList(ctx: UserContext, except?: WebSocket | ReadonlySet<WebSocket>): void;
3127
3236
  /**
3128
3237
  * Handle user profile update.
3129
3238
  *
3130
3239
  * Called when the client's profile loads after the initial WS connection.
3131
- * Updates the user's name/email/imageUrl in c_users and broadcasts the
3132
- * updated user list to all connected clients so names refresh in real time.
3240
+ * Updates the user's name/email/imageUrl in c_users and pushes the updated
3241
+ * roster to every connected client so names refresh in real time.
3133
3242
  */
3134
3243
  interface UserUpdatePayload {
3135
3244
  name?: string;
@@ -4593,4 +4702,4 @@ declare class RefundError extends Error {
4593
4702
  constructor(message: string, status: number);
4594
4703
  }
4595
4704
 
4596
- export { ACCOUNT_STORAGE_LIMIT_BYTES, AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, APP_ID_RE, 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, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, BaseRoom, CHANNELS_SCHEMA, CHANNEL_INVITATIONS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CONVERSATION_SCHEMAS, COST_RATES, CancelSubscriptionError, type CancelSubscriptionOpts, type CancelSubscriptionResult, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type CollectionPermissionSummary, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ComposioToolsOptions, 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_QUERY_LIMIT, DEPLOYED_APPS_DEFAULTS, DIRECTORY_SCHEMAS, type DOBindings, type DOManifest, type DOManifestEntry, type DebugApiContext, type DeepSpaceAIEnv, type DeepSpaceAIOptions, type DeepSpaceAgentDiagnosticContext, DeepSpaceAgentModelError, DeepSpaceAgentProfileError, type DeepSpaceAgentStream, type DeepSpaceAgentStreamOptions, 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 GetActionData, type GlobalDOType, type Job, type JobContext, JobRoom, type JobRoomConfig, type JobStatus, type JwtClaims, type JwtVerifierConfig, MAX_APP_FILE_BYTES, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_UPLOAD_PARTS, MAX_UPLOAD_REQUEST_BYTES, MESSAGES_SCHEMA, type MutateActionData, type PermissionAnalysis, type PermissionContext, type PermissionLevel, type PermissionSource, type PlanInfo, type PlatformWorkerEnv, type PrefixResult, type PresencePeer, PresenceRoom, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, REGISTRY_INSTANCE, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_NAMES, RESOURCE_ID_RE, type RecordContext, RecordRoom, type RecordRoomConfig, RefundError, type RefundOpts, type RefundResult, RegistryClientError, type ResolvedColumn, type ResolvedPermission, type RolePermissions, type RunMigrationsResult, STRICT_APP_ID_RE, SYSTEM_COLLECTION_SCHEMAS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, type SharedConnection, type StorageAdmission, type StoredRecord, SubscriptionAuthError, type SubscriptionContext, type SubscriptionRead, SubscriptionRequiredError, type SubscriptionStatus, type Summarizer, TEST_ACCOUNT_EMAIL_SUFFIX, type TokenDebugInfo, type ToolResult, type ToolSchema, type ToolsApiContext, UPLOAD_PART_BYTES, USERS_COLUMNS, type User, type UserAttachment, type UserContext, VOTING_SCHEMAS, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKSPACE_SCHEMAS, type YjsContext, YjsRoom, analyzePermissions, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, authWorkerFetch, bindingManifestFromOutputConfig, broadcastChange, broadcastYjsUpdate, buildCronContext, buildTableSelect, buildUiParts, callRegistry, canCreate, canDelete, canRead, canUpdate, cancelSubscription, capToolResultSize, captureScreenshot, checkFieldPermissions, checkUnclaimedOwnerTransition, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDeepSpaceAI, createDeepSpaceAuth, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, deleteRecord, enqueueJob, executeQuery, formatBytes, getAllUsers, getChat, getGlobalDOSchemas, getGlobalDOType, getOrCreateYjsDoc, getRecord, getRolePermissions, getSubscription, getUser, getYjsDocKey, handleApiRequest, handleDelete, handlePut, handleSetRole, handleSubscribe, handleToolsRequest, handleUnsubscribe, handleUserList, handleUserUpdate, handleYjsBinaryMessage, handleYjsJoin, handleYjsLeave, isAutoProvision, isFilesVerbPath, isOwner, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, lintSchema, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, putRecord, readRecord, recordMatchesSubscription, refundInvoice, registerUser, registryErrorJson, registryStub, requireSubscription, resolveAppName, resolveAppRole, resolveColumn, rowToData, runMigrations, saveYjsDoc, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppName, validateBindingManifest, validateDoManifest, verifyJwt, workspaceAccountsSchema, workspaceContentSharesSchema, workspaceEmailHandlesSchema, workspaceFormResponsesSchema, workspacePeopleSchema, workspaceProjectsSchema, workspaceTagsSchema, workspaceTasksSchema, workspaceTeamMembersSchema, workspaceTeamsSchema, workspaceTransactionsSchema };
4705
+ export { ACCOUNT_STORAGE_LIMIT_BYTES, AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, APP_ID_RE, 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, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, BaseRoom, CHANNELS_SCHEMA, CHANNEL_INVITATIONS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CONVERSATION_SCHEMAS, COST_RATES, CancelSubscriptionError, type CancelSubscriptionOpts, type CancelSubscriptionResult, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type CollectionPermissionSummary, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ComposioToolsOptions, 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_DELETE_WHERE_LIMIT, DEFAULT_DO_MANIFEST, DEFAULT_QUERY_LIMIT, DEPLOYED_APPS_DEFAULTS, DIRECTORY_SCHEMAS, type DOBindings, type DOManifest, type DOManifestEntry, type DebugApiContext, type DeepSpaceAIEnv, type DeepSpaceAIOptions, type DeepSpaceAgentDiagnosticContext, DeepSpaceAgentModelError, DeepSpaceAgentProfileError, type DeepSpaceAgentStream, type DeepSpaceAgentStreamOptions, 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 GetActionData, type GlobalDOType, type Job, type JobContext, JobRoom, type JobRoomConfig, type JobStatus, type JwtClaims, type JwtVerifierConfig, MAX_APP_FILE_BYTES, MAX_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_UPLOAD_PARTS, MAX_UPLOAD_REQUEST_BYTES, MESSAGES_SCHEMA, type MutateActionData, type PermissionAnalysis, type PermissionContext, type PermissionLevel, type PermissionSource, type PlanInfo, type PlatformWorkerEnv, type PrefixResult, type PresencePeer, PresenceRoom, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, REGISTRY_INSTANCE, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_NAMES, RESOURCE_ID_RE, type RecordContext, RecordRoom, type RecordRoomConfig, RefundError, type RefundOpts, type RefundResult, RegistryClientError, type ResolvedColumn, type ResolvedPermission, type RolePermissions, type RunMigrationsResult, STRICT_APP_ID_RE, SYSTEM_ASSIGNED_COLUMNS, SYSTEM_COLLECTION_SCHEMAS, SYSTEM_MAINTAINED_COLUMNS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, type SharedConnection, type StorageAdmission, type StoredRecord, SubscriptionAuthError, type SubscriptionContext, type SubscriptionRead, SubscriptionRequiredError, type SubscriptionStatus, type Summarizer, TEST_ACCOUNT_EMAIL_SUFFIX, type TokenDebugInfo, type ToolResult, type ToolSchema, type ToolsApiContext, UPLOAD_PART_BYTES, USERS_COLUMNS, type User, type UserAttachment, type UserContext, VOTING_SCHEMAS, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKSPACE_SCHEMAS, type YjsContext, YjsRoom, analyzePermissions, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, authWorkerFetch, bindingManifestFromOutputConfig, broadcastChange, broadcastUserList, broadcastYjsUpdate, buildCronContext, buildTableSelect, buildUiParts, callRegistry, canCreate, canDelete, canRead, canUpdate, cancelSubscription, capToolResultSize, captureScreenshot, checkFieldPermissions, checkUnclaimedOwnerTransition, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDeepSpaceAI, createDeepSpaceAuth, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, deleteRecord, enqueueJob, executeQuery, formatBytes, getAllUsers, getChat, getGlobalDOSchemas, getGlobalDOType, getOrCreateYjsDoc, getRecord, getRolePermissions, getSubscription, getUser, getYjsDocKey, handleApiRequest, handleDelete, handlePut, handleSetRole, handleSubscribe, handleToolsRequest, handleUnsubscribe, handleUserList, handleUserUpdate, handleYjsBinaryMessage, handleYjsJoin, handleYjsLeave, isAutoProvision, isFilesVerbPath, isOwner, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, lintSchema, lintSchemaSet, lintSchemas, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, putRecord, readRecord, recordMatchesSubscription, refundInvoice, registerUser, registryErrorJson, registryStub, requireSubscription, resolveAppName, resolveAppRole, resolveColumn, rowToData, runMigrations, saveYjsDoc, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppName, validateBindingManifest, validateDoManifest, verifyJwt, workspaceAccountsSchema, workspaceContentSharesSchema, workspaceEmailHandlesSchema, workspaceFormResponsesSchema, workspacePeopleSchema, workspaceProjectsSchema, workspaceTagsSchema, workspaceTasksSchema, workspaceTeamMembersSchema, workspaceTeamsSchema, workspaceTransactionsSchema };