deepspace 0.27.0 → 0.27.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{chunk-SF6GNPYL.js → chunk-CRIG6LPA.js} +2 -2
  3. package/dist/{chunk-SF6GNPYL.js.map → chunk-CRIG6LPA.js.map} +1 -1
  4. package/dist/cli.js +280 -222
  5. package/dist/cli.js.map +1 -1
  6. package/dist/documentation-client-core.js +1 -1
  7. package/dist/documentation-default-renderer.cjs +1 -1
  8. package/dist/documentation-react.js +1 -1
  9. package/dist/documentation-runtime.js +1 -1
  10. package/dist/documentation-server-core.js +1 -1
  11. package/dist/documentation.d.ts +0 -1
  12. package/dist/documentation.js +41 -21
  13. package/dist/documentation.js.map +1 -1
  14. package/dist/feature-installer.js +27 -61
  15. package/dist/feature-installer.js.map +1 -1
  16. package/dist/index.d.ts +6 -55
  17. package/dist/index.js +4 -20
  18. package/dist/index.js.map +1 -1
  19. package/dist/schema.js.map +1 -1
  20. package/dist/server.d.ts +5 -38
  21. package/dist/server.js +3 -57
  22. package/dist/server.js.map +1 -1
  23. package/dist/worker.d.ts +7 -80
  24. package/dist/worker.js +4 -62
  25. package/dist/worker.js.map +1 -1
  26. package/features/admin-page/feature.json +0 -1
  27. package/features/ai-chat/feature.json +0 -1
  28. package/features/canvas/feature.json +0 -1
  29. package/features/cron/feature.json +0 -1
  30. package/features/documents/feature.json +0 -1
  31. package/features/file-attachments/feature.json +0 -1
  32. package/features/file-manager/feature.json +0 -1
  33. package/features/integration-test/feature.json +0 -1
  34. package/features/items/feature.json +0 -1
  35. package/features/kanban/feature.json +0 -1
  36. package/features/landing/feature.json +0 -1
  37. package/features/leaderboard/feature.json +0 -1
  38. package/features/messaging/feature.json +0 -1
  39. package/features/search-bar/feature.json +0 -1
  40. package/features/tasks/feature.json +0 -1
  41. package/features/testing/feature.json +0 -1
  42. package/features/topbar/feature.json +1 -4
  43. package/features/tree/feature.json +1 -4
  44. package/package.json +1 -1
  45. package/features/presence-test/feature.json +0 -22
  46. package/features/presence-test/src/PresenceTestPage.tsx +0 -120
package/dist/worker.d.ts CHANGED
@@ -69,11 +69,6 @@ declare const MSG: {
69
69
  readonly PRESENCE_JOIN: "presence.join";
70
70
  readonly PRESENCE_LEAVE: "presence.leave";
71
71
  readonly PRESENCE_UPDATE: "presence.update";
72
- readonly GW_SCOPE_CONNECT: "gateway.scope_connect";
73
- readonly GW_SCOPE_DISCONNECT: "gateway.scope_disconnect";
74
- readonly GW_SCOPE_ERROR: "gateway.scope_error";
75
- readonly GW_TOKEN_REFRESH: "gateway.token_refresh";
76
- readonly GW_USER_UPDATE: "gateway.user_update";
77
72
  };
78
73
  /**
79
74
  * Type of any message type constant — the union of every string literal
@@ -121,7 +116,7 @@ declare const RECORD_NOT_FOUND = "Record not found";
121
116
  * runtime. This module pairs every constant with its payload type, so
122
117
  * that:
123
118
  *
124
- * 1. Building a message with `clientBuild.gameInput(...)` is payload-
119
+ * 1. Building a message with `clientBuild.canvasAdd(...)` is payload-
125
120
  * checked at the call site — the compiler refuses to ship a wrong
126
121
  * shape.
127
122
  *
@@ -170,7 +165,7 @@ declare const RECORD_NOT_FOUND = "Record not found";
170
165
  *
171
166
  * Where payload shapes are stable + narrow (ids, flags), we type them
172
167
  * precisely. Where they're opaque or escape the protocol layer (record
173
- * data blobs, Yjs binary frames, game-engine state), we use `unknown` and
168
+ * data blobs, Yjs binary frames, canvas shapes), we use `unknown` and
174
169
  * defer narrowing to the caller. This is intentional: over-typing opaque
175
170
  * payloads would require the protocol layer to import application types
176
171
  * and defeat the "thin wire contract" goal.
@@ -178,7 +173,7 @@ declare const RECORD_NOT_FOUND = "Record not found";
178
173
 
179
174
  /**
180
175
  * The outer shape of every wire message. `T` is the string discriminator
181
- * (e.g. `"game.input"`) — keeping it as a generic literal type lets the
176
+ * (e.g. `"canvas.add"`) — keeping it as a generic literal type lets the
182
177
  * discriminated-union narrowing in `dispatch()` pick the right payload.
183
178
  *
184
179
  * Callers extending the protocol should pass a string-literal type for
@@ -256,15 +251,7 @@ type ClientMessage = BaseMessage<typeof MSG.SUBSCRIBE, {
256
251
  jobId: string;
257
252
  }> | BaseMessage<typeof MSG.JOB_RETRY, {
258
253
  jobId: string;
259
- }> | BaseMessage<typeof MSG.PRESENCE_UPDATE, Record<string, unknown>> | BaseMessage<typeof MSG.GW_SCOPE_CONNECT, {
260
- scopeType: string;
261
- scopeId: string;
262
- }> | BaseMessage<typeof MSG.GW_SCOPE_DISCONNECT, {
263
- scopeType: string;
264
- scopeId: string;
265
- }> | BaseMessage<typeof MSG.GW_TOKEN_REFRESH, {
266
- token: string;
267
- }>;
254
+ }> | BaseMessage<typeof MSG.PRESENCE_UPDATE, Record<string, unknown>>;
268
255
  /**
269
256
  * Every message the server can send. Room and handler `send` / `broadcast`
270
257
  * signatures are tightened to this union so outbound payloads are
@@ -358,11 +345,7 @@ type ServerMessage = BaseMessage<typeof MSG.QUERY_RESULT, {
358
345
  }> | BaseMessage<typeof MSG.PRESENCE_UPDATE, {
359
346
  userId: string;
360
347
  state: Record<string, unknown>;
361
- }> | BaseMessage<typeof MSG.GW_SCOPE_ERROR, {
362
- scopeType: string;
363
- scopeId: string;
364
- error: string;
365
- }> | BaseMessage<typeof MSG.GW_USER_UPDATE, unknown>;
348
+ }>;
366
349
  /**
367
350
  * Any wire message, regardless of direction. Use this only when the code
368
351
  * path genuinely doesn't care — otherwise pick `ClientMessage` or
@@ -529,26 +512,6 @@ declare const clientBuild: {
529
512
  readonly type: "presence.update";
530
513
  readonly payload: Record<string, unknown>;
531
514
  };
532
- gwScopeConnect: (scopeType: string, scopeId: string) => {
533
- readonly type: "gateway.scope_connect";
534
- readonly payload: {
535
- readonly scopeType: string;
536
- readonly scopeId: string;
537
- };
538
- };
539
- gwScopeDisconnect: (scopeType: string, scopeId: string) => {
540
- readonly type: "gateway.scope_disconnect";
541
- readonly payload: {
542
- readonly scopeType: string;
543
- readonly scopeId: string;
544
- };
545
- };
546
- gwTokenRefresh: (token: string) => {
547
- readonly type: "gateway.token_refresh";
548
- readonly payload: {
549
- readonly token: string;
550
- };
551
- };
552
515
  };
553
516
  /** Factories for every server → client message. Used by room DOs and
554
517
  * handler modules so server broadcasts are payload-checked too. Opaque
@@ -792,18 +755,6 @@ declare const serverBuild: {
792
755
  readonly state: Record<string, unknown>;
793
756
  };
794
757
  };
795
- gwScopeError: (scopeType: string, scopeId: string, error: string) => {
796
- readonly type: "gateway.scope_error";
797
- readonly payload: {
798
- readonly scopeType: string;
799
- readonly scopeId: string;
800
- readonly error: string;
801
- };
802
- };
803
- gwUserUpdate: (user: unknown) => {
804
- readonly type: "gateway.user_update";
805
- readonly payload: unknown;
806
- };
807
758
  };
808
759
  /**
809
760
  * Handler map keyed by a message's string `type`. Every key maps to the
@@ -833,7 +784,7 @@ declare function dispatch<M extends BaseMessage<string, unknown> = ProtocolMessa
833
784
  /**
834
785
  * Serialise a typed-built message for `ws.send`. A tiny wrapper around
835
786
  * `JSON.stringify` kept around so call sites read as
836
- * `ws.send(encode(clientBuild.gameInput(...)))` rather than paying
787
+ * `ws.send(encode(clientBuild.canvasAdd(...)))` rather than paying
837
788
  * attention to stringify arguments.
838
789
  */
839
790
  declare function encode<M extends BaseMessage<string, unknown>>(message: M): string;
@@ -1282,30 +1233,6 @@ declare class SchemaRegistry {
1282
1233
  all(): CollectionSchema[];
1283
1234
  names(): string[];
1284
1235
  }
1285
- type PermissionSource = 'explicit' | 'wildcard' | 'default-deny';
1286
- interface ResolvedPermission {
1287
- level: PermissionLevel | boolean;
1288
- source: PermissionSource;
1289
- }
1290
- interface CollectionPermissionSummary {
1291
- collection: string;
1292
- ownerField?: string;
1293
- collaboratorsField?: string;
1294
- teamField?: string;
1295
- columns: ColumnDefinition[];
1296
- permissions: Record<string, {
1297
- read: ResolvedPermission;
1298
- create: ResolvedPermission;
1299
- update: ResolvedPermission;
1300
- delete: ResolvedPermission;
1301
- writableFields?: string[];
1302
- }>;
1303
- }
1304
- interface PermissionAnalysis {
1305
- roles: string[];
1306
- collections: CollectionPermissionSummary[];
1307
- }
1308
- declare function analyzePermissions(schemas: CollectionSchema[]): PermissionAnalysis;
1309
1236
 
1310
1237
  /**
1311
1238
  * RecordRoom Durable Object
@@ -5382,4 +5309,4 @@ interface AppLogsResponse {
5382
5309
  declare const APP_LOG_EVENT_KEYS: readonly ["id", "timestamp", "level", "eventType", "message", "source", "outcome", "request", "exception"];
5383
5310
  type AppLogEventKey = (typeof APP_LOG_EVENT_KEYS)[number];
5384
5311
 
5385
- export { ACCOUNT_STORAGE_LIMIT_BYTES, ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID, ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID, 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 ApiWorkerEnv, type AppLogEvent, type AppLogEventKey, type AppLogsResponse, 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, CHANNELS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CLIENT_LOG_MARKER, COST_RATES, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type ClientErrorKind, type ClientErrorReport, type ClientMessage, type CollectionPermissionSummary, 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, 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_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_ENV_VAR_BYTES, 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 PermissionAnalysis, type PermissionContext, type PermissionLevel, type PermissionSource, 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 ResolvedPermission, type RolePermissions, type RunMigrationsResult, SDK_RUN_WORKER_FIRST, SECURE_ROOM_BOUNDARIES_MIGRATION_ID, 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 ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, YjsRoom, analyzePermissions, 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, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, enqueueJob, epochSeconds, folderFilter, formatBytes, getChat, getDeepSpaceAIModel, getMessageType, getRolePermissions, handleAwarenessMessage, handleClientErrorReport, handleSyncMessage, hasContent, isAnonymousUserId, isAssetNotFoundHandling, isAutoProvision, isFilesVerbPath, isOwner, isPlatformReservedPath, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, knowledge, lintSchema, lintSchemaSet, lintSchemas, listDeepSpaceAgentModels, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, normalizeKnowledgeFolder, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readVarUint, readVarUint8Array, registerClientErrorRoute, registerDeepSpaceDocumentation, registryErrorJson, registryStub, resolveAppName, resolveAppRole, resolveColumn, resolveCompatibilityFlags, resolveDeepSpaceAgentModel, rowToData, runMigrations, serverBuild, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, toUint8Array, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppMigrationIds, validateAppName, validateBindingManifest, validateDoManifest, verifyJwt, writeVarUint, writeVarUint8Array };
5312
+ export { ACCOUNT_STORAGE_LIMIT_BYTES, ACTION_ROUTES_BEARER_GUARD_MIGRATION_ID, ACTION_TOOLS_DELETE_WHERE_MIGRATION_ID, 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 ApiWorkerEnv, type AppLogEvent, type AppLogEventKey, type AppLogsResponse, 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, CHANNELS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CLIENT_LOG_MARKER, COST_RATES, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type ClientErrorKind, type ClientErrorReport, 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, 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_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_ENV_VAR_BYTES, 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 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, SECURE_ROOM_BOUNDARIES_MIGRATION_ID, 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 ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, YjsRoom, 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, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, enqueueJob, epochSeconds, folderFilter, formatBytes, getChat, getDeepSpaceAIModel, getMessageType, getRolePermissions, handleAwarenessMessage, handleClientErrorReport, handleSyncMessage, hasContent, isAnonymousUserId, isAssetNotFoundHandling, isAutoProvision, isFilesVerbPath, isOwner, isPlatformReservedPath, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, knowledge, lintSchema, lintSchemaSet, lintSchemas, listDeepSpaceAgentModels, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, normalizeKnowledgeFolder, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readVarUint, readVarUint8Array, registerClientErrorRoute, registerDeepSpaceDocumentation, registryErrorJson, registryStub, resolveAppName, resolveAppRole, resolveColumn, resolveCompatibilityFlags, resolveDeepSpaceAgentModel, rowToData, runMigrations, serverBuild, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, toUint8Array, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppMigrationIds, validateAppName, validateBindingManifest, validateDoManifest, verifyJwt, writeVarUint, writeVarUint8Array };
package/dist/worker.js CHANGED
@@ -15,7 +15,7 @@ var MSG = {
15
15
  USER_UPDATE: "user.update",
16
16
  // ---- Auth signal -----------------------------------------------------
17
17
  // Server → client one-shot on connect from rooms that enforce role-based
18
- // writes (Canvas, Game, Cron). Tells the client whether this connection
18
+ // writes (Canvas, Cron). Tells the client whether this connection
19
19
  // can write so its hook can disable local write APIs and the UI can
20
20
  // render controls accordingly. Without this, a viewer's click would
21
21
  // round-trip to the server and silently come back as ERROR.
@@ -59,13 +59,7 @@ var MSG = {
59
59
  PRESENCE_SYNC: "presence.sync",
60
60
  PRESENCE_JOIN: "presence.join",
61
61
  PRESENCE_LEAVE: "presence.leave",
62
- PRESENCE_UPDATE: "presence.update",
63
- // ---- Gateway multiplexing --------------------------------------------
64
- GW_SCOPE_CONNECT: "gateway.scope_connect",
65
- GW_SCOPE_DISCONNECT: "gateway.scope_disconnect",
66
- GW_SCOPE_ERROR: "gateway.scope_error",
67
- GW_TOKEN_REFRESH: "gateway.token_refresh",
68
- GW_USER_UPDATE: "gateway.user_update"
62
+ PRESENCE_UPDATE: "presence.update"
69
63
  };
70
64
  var MSG_YJS_SYNC = 22;
71
65
  var MSG_YJS_AWARENESS = 23;
@@ -695,47 +689,6 @@ var SchemaRegistry = class {
695
689
  return Array.from(this.trusted.keys());
696
690
  }
697
691
  };
698
- function analyzePermissions(schemas) {
699
- const roleSet = /* @__PURE__ */ new Set();
700
- for (const schema of schemas) {
701
- for (const role of Object.keys(schema.permissions)) roleSet.add(role);
702
- }
703
- roleSet.delete("*");
704
- const roles = Array.from(roleSet);
705
- const collections = schemas.map((schema) => {
706
- const permissions = {};
707
- for (const role of roles) {
708
- let source;
709
- let perms;
710
- if (schema.permissions[role]) {
711
- source = "explicit";
712
- perms = schema.permissions[role];
713
- } else if (schema.permissions["*"]) {
714
- source = "wildcard";
715
- perms = schema.permissions["*"];
716
- } else {
717
- source = "default-deny";
718
- perms = { read: false, create: false, update: false, delete: false };
719
- }
720
- permissions[role] = {
721
- read: { level: perms.read, source },
722
- create: { level: perms.create, source },
723
- update: { level: perms.update, source },
724
- delete: { level: perms.delete, source },
725
- writableFields: perms.writableFields
726
- };
727
- }
728
- return {
729
- collection: schema.name,
730
- ownerField: schema.ownerField,
731
- collaboratorsField: schema.collaboratorsField,
732
- teamField: schema.teamField,
733
- columns: schema.columns,
734
- permissions
735
- };
736
- });
737
- return { roles, collections };
738
- }
739
692
 
740
693
  // src/server/rooms/collection-table-migration.ts
741
694
  var NOOP_LOGGER = { warn: () => {
@@ -1222,11 +1175,7 @@ var clientBuild = {
1222
1175
  jobCancel: (jobId) => ({ type: MSG.JOB_CANCEL, payload: { jobId } }),
1223
1176
  jobRetry: (jobId) => ({ type: MSG.JOB_RETRY, payload: { jobId } }),
1224
1177
  // Presence
1225
- presenceUpdate: (state) => ({ type: MSG.PRESENCE_UPDATE, payload: state }),
1226
- // Gateway
1227
- gwScopeConnect: (scopeType, scopeId) => ({ type: MSG.GW_SCOPE_CONNECT, payload: { scopeType, scopeId } }),
1228
- gwScopeDisconnect: (scopeType, scopeId) => ({ type: MSG.GW_SCOPE_DISCONNECT, payload: { scopeType, scopeId } }),
1229
- gwTokenRefresh: (token) => ({ type: MSG.GW_TOKEN_REFRESH, payload: { token } })
1178
+ presenceUpdate: (state) => ({ type: MSG.PRESENCE_UPDATE, payload: state })
1230
1179
  };
1231
1180
  var serverBuild = {
1232
1181
  // Records / CRUD
@@ -1290,13 +1239,7 @@ var serverBuild = {
1290
1239
  presenceSync: (peers) => ({ type: MSG.PRESENCE_SYNC, payload: { peers } }),
1291
1240
  presenceJoin: (peer) => ({ type: MSG.PRESENCE_JOIN, payload: { peer } }),
1292
1241
  presenceLeave: (userId) => ({ type: MSG.PRESENCE_LEAVE, payload: { userId } }),
1293
- presenceUpdate: (userId, state) => ({ type: MSG.PRESENCE_UPDATE, payload: { userId, state } }),
1294
- // Gateway
1295
- gwScopeError: (scopeType, scopeId, error) => ({
1296
- type: MSG.GW_SCOPE_ERROR,
1297
- payload: { scopeType, scopeId, error }
1298
- }),
1299
- gwUserUpdate: (user) => ({ type: MSG.GW_USER_UPDATE, payload: user })
1242
+ presenceUpdate: (userId, state) => ({ type: MSG.PRESENCE_UPDATE, payload: { userId, state } })
1300
1243
  };
1301
1244
  function dispatch(raw, handlers) {
1302
1245
  let msg;
@@ -10355,7 +10298,6 @@ export {
10355
10298
  USERS_COLUMNS,
10356
10299
  WORKER_OWNED_NOT_FOUND_MIGRATION_ID,
10357
10300
  YjsRoom,
10358
- analyzePermissions,
10359
10301
  apiWorkerFetch,
10360
10302
  appendMessage,
10361
10303
  applyAiToolDefaults,