deepspace 0.23.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -103,7 +103,8 @@ interface CollectionSchema {
103
103
  /**
104
104
  * `users` collection only: what the `user.list` roster shows a non-admin
105
105
  * whose `read` policy is row-scoped (`'own'`, `'team'`, …). Default
106
- * `'public-identity'`: every registered user's id/name/imageUrl/role — the
106
+ * `'public-identity'`: every registered user's id/name/imageUrl/role/lastSeenAt
107
+ * (`lastSeenAt` is what `usePresence` reads) — the
107
108
  * row policy keeps guarding full-row reads on the records/query path.
108
109
  * `'read-policy'`: the roster contains only the rows the caller's read
109
110
  * policy grants (still projected to public identity) — for apps that scope
@@ -1481,6 +1482,16 @@ interface HandlerContext {
1481
1482
  declare const WORKER_OWNED_NOT_FOUND_MIGRATION_ID = "2026-08-worker-owned-not-found";
1482
1483
  /** Room identity moved to internal headers and privileged room routes gained app-role checks. */
1483
1484
  declare const SECURE_ROOM_BOUNDARIES_MIGRATION_ID = "2026-08-secure-room-boundaries";
1485
+ /** `ActionTools` gained `deleteWhere`, so the app's own tools factory — which
1486
+ * declares that interface as its return type — has to supply it. */
1487
+ declare const ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID = "2026-08-action-tools-delete-where";
1488
+ /** The browser's app id moved off a scaffold-time literal onto a build-time
1489
+ * define that `deepspace/build` reads from the wrangler config being built. */
1490
+ declare const BUILD_INJECTED_APP_ID_MIGRATION_ID = "2026-08-build-injected-app-id";
1491
+ /** The action route refuses a call without a bearer token as 401 (a cookie
1492
+ * session has none) instead of crashing on a non-null assertion, and the
1493
+ * file states the trust model actions run under. */
1494
+ declare const ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID = "2026-08-action-routes-bearer-guard";
1484
1495
  type AppMigrationIdsValidation = {
1485
1496
  valid: true;
1486
1497
  ids: string[];
@@ -2842,7 +2853,7 @@ interface RoomUser {
2842
2853
  role: string;
2843
2854
  /** Present only in the admin user-management view. */
2844
2855
  createdAt?: string;
2845
- /** Present only in the admin user-management view. */
2856
+ /** In every roster projection: `usePresence` derives online state from it. */
2846
2857
  lastSeenAt?: string;
2847
2858
  }
2848
2859
  type RoomConnectionState = 'connecting' | 'connected' | 'disconnected';
@@ -5031,13 +5042,28 @@ interface AppLogEvent {
5031
5042
  * branch on `source === 'client'`, never on a truthy/other check.
5032
5043
  */
5033
5044
  source?: 'client';
5034
- /** Invocation outcome (`ok`, `exception`, `exceededCpu`, …) when present. */
5045
+ /**
5046
+ * The runtime's verdict on the invocation (`ok`, `exception`, `exceededCpu`,
5047
+ * `canceled`, …) — present on `request` and other invocation-summary events
5048
+ * only, never on a `log` line. It says whether the Worker RETURNED, not
5049
+ * whether the app succeeded: an action that throws inside the app's own
5050
+ * error handling and answers 500 is `ok` here. Triage failures on
5051
+ * `request.status`, `level`, and `eventType === 'exception'` (an exception
5052
+ * that escaped the Worker), not on `outcome !== 'ok'` alone.
5053
+ */
5035
5054
  outcome?: string;
5036
5055
  request?: {
5037
5056
  method: string;
5038
5057
  path: string;
5039
5058
  status?: number;
5040
5059
  };
5060
+ /**
5061
+ * The exception that ESCAPED the Worker (`eventType: 'exception'`), or a
5062
+ * browser-reported one (`source: 'client'`). An error the app catches and
5063
+ * `console.error`s is a plain `log` line — and the Workers runtime renders a
5064
+ * logged Error object as its stack frames without the message, so log the
5065
+ * message text yourself (`console.error(\`… ${err.message}\`, err.stack)`).
5066
+ */
5041
5067
  exception?: {
5042
5068
  name: string;
5043
5069
  message: string;
@@ -5091,4 +5117,4 @@ declare const ACCOUNT_STORAGE_LIMIT_BYTES: {
5091
5117
  declare function storageLimitForTier(tier: string | null | undefined): number;
5092
5118
  declare function formatBytes(bytes: number): string;
5093
5119
 
5094
- export { ACCOUNT_STORAGE_LIMIT_BYTES, ANONYMOUS_USER_ID_PREFIX, APP_LOG_EVENT_KEYS, ASYNC_RESOURCE_DEFAULTS, type AdHocChargeOpts, type AiStreamAction, type AiStreamChunk, type ApiErrorIssue, type AppLogEvent, type AppLogEventKey, type AppLogsResponse, type AppMigrationIdsValidation, type AsyncResourceDefaults, type AsyncResourceState, type AsyncResourceStatus, AuthGate, type AuthGateProps, AuthOverlay, Awareness, type AwarenessState, type AwarenessStates, type BaseMessage, type CanvasShapeClient, type Channel, type ChannelInvitation, type ChannelMember, type ChargeOnceOpts, type ChargeOnceResult, type ClientErrorKind, type ClientErrorReport, type ClientErrorReporterOptions, type ClientMessage, type CollectionSchema, type ConnectionAttachment, type ConnectionStatus, type ContentSegment, type ConversationObject, type CronHistoryEntry, type CronMutationResult, type CronTaskState, DEEPSPACE_AGENT_PROFILES, DEEPSPACE_AI_DEFAULTS, DEEPSPACE_AI_MODELS, DEEPSPACE_MODEL_CATALOG_PROVENANCE, DEEPSPACE_THEME_PROPERTIES, DEFAULT_USER_COLORS, type DeepSpaceAIModel, type DeepSpaceAIModelId, type DeepSpaceAIProvider, type DeepSpaceAgentProfile, type DeepSpaceAgentProfileId, type DeepSpaceAgentSupport, DeepSpaceAuthProvider, type DeepSpaceThemeConfig, DeepSpaceThemeProvider, type DeepSpaceThemeProviderProps, type DeriveLoadStateInput, ENV, type Environment, type FileAttachment, type GroupedReaction, GuestBanner, type HandlerContext, type InboxEntry, type IntegrationResponse, type JobStatusView, type JobView, LOG_LEVELS, type LinkPreviewData, type LoadState, type LoadStateAuthInput, type LoadStateStatusInput, type LogLevel, MSG, MSG_AWARENESS, MSG_SYNC, MSG_SYNC_STEP1, MSG_SYNC_STEP2, MSG_SYNC_UPDATE, MSG_YJS_AWARENESS, MSG_YJS_SYNC, type MemberRecord, type Message, type MessageHandlers, type MessageRecord, type MsgType, type NormalizedApiError, type PagedResourceFetchArgs, type PagedResourcePage, type PagedResourceState, type PagedResourceStatus, type PlanInfo, PlatformApiError, PlatformContext, type PlatformContextValue, PlatformProvider, type PlatformWSOptions, type PlatformWSResult, type PresencePeerClient, PricingTable, type PricingTablePlan, type PricingTablePrice, type ProductChargeOpts, type ProtocolMessage, type Purchase, type Query, type R2FileInfo, type R2FileListPage, type R2Scope, type R2UploadResult, RECORD_NOT_FOUND, ROLES, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_CONFIG, ROLE_DEFAULT, type Reaction, type ReactionRecord, type ReadCursorRecord, type ReadReceipt, type RecordData, RecordProvider, type RecordProviderProps, RecordRoomNotReadyError, RecordScope, type RequestOptions, type ResolvedDeepSpaceAgentModel, type Role, type RoomUser, SECURE_ROOM_BOUNDARIES_MIGRATION_ID, type ScopeEntry, ScopeRegistryProvider, type ServerMessage, SignedIn, SignedOut, type SubscribeOpts, type SubscribeResult, type SubscriptionState, type SubscriptionStatus, type SyncResult, type UseAsyncResourceOptions, type UseAuthProfileReadyOptions, type UseAuthStatusOptions, type UseCanvasResult, type UseCheckoutOpts, type UseCronMonitorResult, type UseJobsResult, type UsePagedResourceOptions, type UsePresenceRoomResult, type UseR2FilesReturn, type UseVoiceAgentOptions, type UseVoiceAgentResult, type UseYjsFieldResult, type UseYjsRoomResult, type UseYjsTextResult, type User, type UserCredits, type UserInfo, type UserKarma, type UserProfile, type ViewportClient, type VoiceStatus, type VoiceTranscriptEntry, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, type WriteError, applyDeepSpaceTheme, applyUIThemeTokens, authClient, canAutoLoadPagedResource, clampPagedResourceItems, clearAuthToken, clearDeepSpaceTheme, clientBuild, createDecoder, createEncoder, decodeAiStreamChunk, deriveLoadState, detectEnvironment, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, formatBytes, formatFileSize, formatFullTimestamp, formatMessageTime, getApiUrl, getAuthToken, getAuthUrl, getConversationDisplayName, getConversationParticipantIds, getDeepSpaceAIModel, getEnvironmentConfig, getMessageType, getPagedResourceCooldownMs, getPlatformWorkerUrl, getThreadCounts, getUserColor, groupReactionsForMessage, handleAwarenessMessage, handleSyncMessage, hasContent, installClientErrorReporter, integration, isAnonymousUserId, isAsyncResourceSlow, isDMConversation, isDarkColor, isImageFile, isLocalDev, isProduction, listDeepSpaceAgentModels, parseMessageMetadata, parseSseLine, readThemeFromDOM, readVarUint, readVarUint8Array, reportClientError, resetEnvironmentCache, resolveDeepSpaceAgentModel, serverBuild, shouldGroupMessages, signIn, signOut, storageLimitForTier, toConnectionStatus, toUint8Array, useAsyncResource, useAuth, useAuthProfileReady, useAuthStatus, useAuthUser, useCanvas, useChannelMembers, useChannels, useCheckout, useCommunities, useConversation, useConversations, useCronMonitor, useDisplayName, useInbox, useIsDarkTheme, useJobs, useMessages, useMutations, usePagedResource, usePlatform, usePlatformWS, usePosts, usePresence, usePresenceRoom, useQuery, useR2Files, useReactions, useReadReceipts, useRecordContext, useSession, useSubscription, useUser, useUserLookup, useUsers, useVoiceAgent, useYjsField, useYjsRoom, useYjsText, validateAppMigrationIds, writeVarUint, writeVarUint8Array };
5120
+ export { ACCOUNT_STORAGE_LIMIT_BYTES, ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID, ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID, ANONYMOUS_USER_ID_PREFIX, APP_LOG_EVENT_KEYS, ASYNC_RESOURCE_DEFAULTS, type AdHocChargeOpts, type AiStreamAction, type AiStreamChunk, type ApiErrorIssue, type AppLogEvent, type AppLogEventKey, type AppLogsResponse, type AppMigrationIdsValidation, type AsyncResourceDefaults, type AsyncResourceState, type AsyncResourceStatus, AuthGate, type AuthGateProps, AuthOverlay, Awareness, type AwarenessState, type AwarenessStates, BUILD_INJECTED_APP_ID_MIGRATION_ID, type BaseMessage, type CanvasShapeClient, type Channel, type ChannelInvitation, type ChannelMember, type ChargeOnceOpts, type ChargeOnceResult, type ClientErrorKind, type ClientErrorReport, type ClientErrorReporterOptions, type ClientMessage, type CollectionSchema, type ConnectionAttachment, type ConnectionStatus, type ContentSegment, type ConversationObject, type CronHistoryEntry, type CronMutationResult, type CronTaskState, DEEPSPACE_AGENT_PROFILES, DEEPSPACE_AI_DEFAULTS, DEEPSPACE_AI_MODELS, DEEPSPACE_MODEL_CATALOG_PROVENANCE, DEEPSPACE_THEME_PROPERTIES, DEFAULT_USER_COLORS, type DeepSpaceAIModel, type DeepSpaceAIModelId, type DeepSpaceAIProvider, type DeepSpaceAgentProfile, type DeepSpaceAgentProfileId, type DeepSpaceAgentSupport, DeepSpaceAuthProvider, type DeepSpaceThemeConfig, DeepSpaceThemeProvider, type DeepSpaceThemeProviderProps, type DeriveLoadStateInput, ENV, type Environment, type FileAttachment, type GroupedReaction, GuestBanner, type HandlerContext, type InboxEntry, type IntegrationResponse, type JobStatusView, type JobView, LOG_LEVELS, type LinkPreviewData, type LoadState, type LoadStateAuthInput, type LoadStateStatusInput, type LogLevel, MSG, MSG_AWARENESS, MSG_SYNC, MSG_SYNC_STEP1, MSG_SYNC_STEP2, MSG_SYNC_UPDATE, MSG_YJS_AWARENESS, MSG_YJS_SYNC, type MemberRecord, type Message, type MessageHandlers, type MessageRecord, type MsgType, type NormalizedApiError, type PagedResourceFetchArgs, type PagedResourcePage, type PagedResourceState, type PagedResourceStatus, type PlanInfo, PlatformApiError, PlatformContext, type PlatformContextValue, PlatformProvider, type PlatformWSOptions, type PlatformWSResult, type PresencePeerClient, PricingTable, type PricingTablePlan, type PricingTablePrice, type ProductChargeOpts, type ProtocolMessage, type Purchase, type Query, type R2FileInfo, type R2FileListPage, type R2Scope, type R2UploadResult, RECORD_NOT_FOUND, ROLES, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_CONFIG, ROLE_DEFAULT, type Reaction, type ReactionRecord, type ReadCursorRecord, type ReadReceipt, type RecordData, RecordProvider, type RecordProviderProps, RecordRoomNotReadyError, RecordScope, type RequestOptions, type ResolvedDeepSpaceAgentModel, type Role, type RoomUser, SECURE_ROOM_BOUNDARIES_MIGRATION_ID, type ScopeEntry, ScopeRegistryProvider, type ServerMessage, SignedIn, SignedOut, type SubscribeOpts, type SubscribeResult, type SubscriptionState, type SubscriptionStatus, type SyncResult, type UseAsyncResourceOptions, type UseAuthProfileReadyOptions, type UseAuthStatusOptions, type UseCanvasResult, type UseCheckoutOpts, type UseCronMonitorResult, type UseJobsResult, type UsePagedResourceOptions, type UsePresenceRoomResult, type UseR2FilesReturn, type UseVoiceAgentOptions, type UseVoiceAgentResult, type UseYjsFieldResult, type UseYjsRoomResult, type UseYjsTextResult, type User, type UserCredits, type UserInfo, type UserKarma, type UserProfile, type ViewportClient, type VoiceStatus, type VoiceTranscriptEntry, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, type WriteError, applyDeepSpaceTheme, applyUIThemeTokens, authClient, canAutoLoadPagedResource, clampPagedResourceItems, clearAuthToken, clearDeepSpaceTheme, clientBuild, createDecoder, createEncoder, decodeAiStreamChunk, deriveLoadState, detectEnvironment, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, formatBytes, formatFileSize, formatFullTimestamp, formatMessageTime, getApiUrl, getAuthToken, getAuthUrl, getConversationDisplayName, getConversationParticipantIds, getDeepSpaceAIModel, getEnvironmentConfig, getMessageType, getPagedResourceCooldownMs, getPlatformWorkerUrl, getThreadCounts, getUserColor, groupReactionsForMessage, handleAwarenessMessage, handleSyncMessage, hasContent, installClientErrorReporter, integration, isAnonymousUserId, isAsyncResourceSlow, isDMConversation, isDarkColor, isImageFile, isLocalDev, isProduction, listDeepSpaceAgentModels, parseMessageMetadata, parseSseLine, readThemeFromDOM, readVarUint, readVarUint8Array, reportClientError, resetEnvironmentCache, resolveDeepSpaceAgentModel, serverBuild, shouldGroupMessages, signIn, signOut, storageLimitForTier, toConnectionStatus, toUint8Array, useAsyncResource, useAuth, useAuthProfileReady, useAuthStatus, useAuthUser, useCanvas, useChannelMembers, useChannels, useCheckout, useCommunities, useConversation, useConversations, useCronMonitor, useDisplayName, useInbox, useIsDarkTheme, useJobs, useMessages, useMutations, usePagedResource, usePlatform, usePlatformWS, usePosts, usePresence, usePresenceRoom, useQuery, useR2Files, useReactions, useReadReceipts, useRecordContext, useSession, useSubscription, useUser, useUserLookup, useUsers, useVoiceAgent, useYjsField, useYjsRoom, useYjsText, validateAppMigrationIds, writeVarUint, writeVarUint8Array };
package/dist/index.js CHANGED
@@ -766,6 +766,9 @@ var APP_MIGRATION_ID_RE = /^[a-z0-9][a-z0-9._-]{0,127}$/;
766
766
  var MAX_APP_MIGRATION_IDS = 256;
767
767
  var WORKER_OWNED_NOT_FOUND_MIGRATION_ID = "2026-08-worker-owned-not-found";
768
768
  var SECURE_ROOM_BOUNDARIES_MIGRATION_ID = "2026-08-secure-room-boundaries";
769
+ var ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID = "2026-08-action-tools-delete-where";
770
+ var BUILD_INJECTED_APP_ID_MIGRATION_ID = "2026-08-build-injected-app-id";
771
+ var ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID = "2026-08-action-routes-bearer-guard";
769
772
  function validateAppMigrationIds(value) {
770
773
  if (!Array.isArray(value)) {
771
774
  return { valid: false, reason: "app migrations must be a JSON string array" };
@@ -1749,10 +1752,10 @@ function parseServerError(error) {
1749
1752
  isPermissionError: true
1750
1753
  };
1751
1754
  }
1752
- const fieldMatch = error.match(/^FIELD ERROR: Cannot update field '(\w+)'.*role '(\w+)'/);
1755
+ const fieldMatch = error.match(/^FIELD ERROR: Role '(\w+)' cannot modify field '(\w+)'/);
1753
1756
  if (fieldMatch) {
1754
1757
  return {
1755
- title: `${humanizeRole(fieldMatch[2])}s can't edit "${fieldMatch[1]}"`,
1758
+ title: `${humanizeRole(fieldMatch[1])}s can't edit "${fieldMatch[2]}"`,
1756
1759
  detail: "",
1757
1760
  isPermissionError: true
1758
1761
  };
@@ -6473,12 +6476,15 @@ var APP_LOG_EVENT_KEYS = [
6473
6476
  ];
6474
6477
  export {
6475
6478
  ACCOUNT_STORAGE_LIMIT_BYTES,
6479
+ ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID,
6480
+ ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID,
6476
6481
  ANONYMOUS_USER_ID_PREFIX,
6477
6482
  APP_LOG_EVENT_KEYS,
6478
6483
  ASYNC_RESOURCE_DEFAULTS,
6479
6484
  AuthGate,
6480
6485
  AuthOverlay,
6481
6486
  Awareness,
6487
+ BUILD_INJECTED_APP_ID_MIGRATION_ID,
6482
6488
  DEEPSPACE_AGENT_PROFILES,
6483
6489
  DEEPSPACE_AI_DEFAULTS,
6484
6490
  DEEPSPACE_AI_MODELS,