deepspace 0.14.0 → 0.15.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/CHANGELOG.md +24 -0
- package/dist/cli.js +358 -729
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/worker.d.ts +80 -1
- package/dist/worker.js +82 -0
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/worker.d.ts
CHANGED
|
@@ -2550,6 +2550,9 @@ declare function getMessageType(data: Uint8Array): number;
|
|
|
2550
2550
|
|
|
2551
2551
|
/** First source migration required by the canonical app identity cutover. */
|
|
2552
2552
|
declare const CANONICAL_APP_IDENTITY_MIGRATION_ID = "2026-08-canonical-app-identity-wire";
|
|
2553
|
+
/** Asset-layer misses became real 404s, and the worker owns the fallback. The
|
|
2554
|
+
* config and the worker's fallback path have to move together. */
|
|
2555
|
+
declare const WORKER_OWNED_NOT_FOUND_MIGRATION_ID = "2026-08-worker-owned-not-found";
|
|
2553
2556
|
type AppMigrationIdsValidation = {
|
|
2554
2557
|
valid: true;
|
|
2555
2558
|
ids: string[];
|
|
@@ -2736,6 +2739,82 @@ interface ResolvedDeepSpaceAgentModel {
|
|
|
2736
2739
|
}
|
|
2737
2740
|
declare function resolveDeepSpaceAgentModel(modelId: unknown, profileId?: DeepSpaceAgentProfileId): ResolvedDeepSpaceAgentModel | null;
|
|
2738
2741
|
|
|
2742
|
+
/**
|
|
2743
|
+
* Routing decisions the deploy worker, the CLI, and the scaffold all depend
|
|
2744
|
+
* on. One home so they cannot drift — see docs/platform/app-platform-contract.md
|
|
2745
|
+
* for why this boundary needs one.
|
|
2746
|
+
*/
|
|
2747
|
+
/** Where every release serves its own identity. The deploy worker injects this
|
|
2748
|
+
* asset; the CLI polls it to learn which release an edge is serving. */
|
|
2749
|
+
declare const RELEASE_STAMP_PATH = "/.well-known/deepspace/release.json";
|
|
2750
|
+
/**
|
|
2751
|
+
* What the asset layer does with a path it has no file for — Cloudflare's own
|
|
2752
|
+
* `not_found_handling`, restated here because both ends of a deploy have to
|
|
2753
|
+
* agree on the legal values.
|
|
2754
|
+
*
|
|
2755
|
+
* The app declares this and the platform honors it. It is the app's to declare
|
|
2756
|
+
* because it is half of a decision whose other half lives in the app's worker:
|
|
2757
|
+
* `none` sends misses to the worker, which is the only place that can tell a
|
|
2758
|
+
* client route from a missing file, and a worker written for one setting
|
|
2759
|
+
* misbehaves under the other. Overriding it from here would silently rewrite
|
|
2760
|
+
* the behavior of code the platform did not write — see
|
|
2761
|
+
* docs/platform/app-platform-contract.md.
|
|
2762
|
+
*/
|
|
2763
|
+
declare const ASSET_NOT_FOUND_HANDLING_VALUES: readonly ["none", "single-page-application", "404-page"];
|
|
2764
|
+
type AssetNotFoundHandling = (typeof ASSET_NOT_FOUND_HANDLING_VALUES)[number];
|
|
2765
|
+
/**
|
|
2766
|
+
* Applied when a deploy declares nothing.
|
|
2767
|
+
*
|
|
2768
|
+
* This is NOT Cloudflare's default (`none`) and not the value new apps ship.
|
|
2769
|
+
* It is what the platform hardcoded for every app before it started honoring
|
|
2770
|
+
* the declaration, and a deploy carrying no declaration is a CLI too old to
|
|
2771
|
+
* send one — necessarily paired with an app written for the old behavior.
|
|
2772
|
+
* Anything else here breaks every app whose CLI has not been upgraded, which
|
|
2773
|
+
* is the failure Rule 1 exists to prevent.
|
|
2774
|
+
*/
|
|
2775
|
+
declare const UNDECLARED_ASSET_NOT_FOUND_HANDLING: AssetNotFoundHandling;
|
|
2776
|
+
declare function isAssetNotFoundHandling(value: unknown): value is AssetNotFoundHandling;
|
|
2777
|
+
/** Stated, not inherited from the compatibility date: from 2025-04-01 the
|
|
2778
|
+
* default sends navigations to the asset layer, which under
|
|
2779
|
+
* `not_found_handling: "none"` would 404 every client route before the
|
|
2780
|
+
* worker sees it. Required for every app, whatever it declares above. */
|
|
2781
|
+
declare const REQUIRED_COMPATIBILITY_FLAGS: readonly ["nodejs_compat", "assets_navigation_has_no_effect"];
|
|
2782
|
+
/** Required flags plus whatever the app added that does not contradict them. */
|
|
2783
|
+
declare function resolveCompatibilityFlags(declared: readonly string[] | undefined): string[];
|
|
2784
|
+
/** Routes Cloudflare hands to the worker before the asset layer answers. The
|
|
2785
|
+
* agent paths are here so an app publishing nothing there 404s instead of
|
|
2786
|
+
* returning its homepage. */
|
|
2787
|
+
declare const SDK_RUN_WORKER_FIRST: readonly ["/api/*", "/ws/*", "/internal/*", "/v1/*", "/_deepspace/*", "/llms.txt", "/llms-full.txt", "/.well-known/mcp", "/.well-known/mcp.json", "/.well-known/mcp/*"];
|
|
2788
|
+
/** Deny-list for an app's own `run_worker_first`. Strictly wider than what the
|
|
2789
|
+
* platform routes worker-first; expressing it as a superset keeps the
|
|
2790
|
+
* difference deliberate. */
|
|
2791
|
+
declare const RESERVED_RUN_WORKER_FIRST: readonly string[];
|
|
2792
|
+
/**
|
|
2793
|
+
* Whether the platform owns this path — so an app's worker must answer 404
|
|
2794
|
+
* rather than its shell when nothing is published there. Exported as a
|
|
2795
|
+
* predicate, not a list, because the patterns carry globs and every caller
|
|
2796
|
+
* matching them by hand is another copy that can drift.
|
|
2797
|
+
*/
|
|
2798
|
+
declare function isPlatformReservedPath(pathname: string): boolean;
|
|
2799
|
+
|
|
2800
|
+
/**
|
|
2801
|
+
* The platform endpoints this SDK's client hooks call through an app's proxy.
|
|
2802
|
+
*
|
|
2803
|
+
* The app's worker forwards these with its own identity, so the proxy is an
|
|
2804
|
+
* allow-list rather than a passthrough. That list has to match what the hooks
|
|
2805
|
+
* actually call — and only this package knows that, which is why it is stated
|
|
2806
|
+
* here instead of copied into each scaffold. A frozen copy in a customer's
|
|
2807
|
+
* repo would 404 the next hook we ship, in their browser, silently.
|
|
2808
|
+
*
|
|
2809
|
+
* The scaffold still registers the proxy itself, visibly and editably; it just
|
|
2810
|
+
* reads the routes from here.
|
|
2811
|
+
*/
|
|
2812
|
+
interface ProxyRoute {
|
|
2813
|
+
method: string;
|
|
2814
|
+
path: string;
|
|
2815
|
+
}
|
|
2816
|
+
declare const BROWSER_PROXY_ROUTES: ReadonlyArray<ProxyRoute>;
|
|
2817
|
+
|
|
2739
2818
|
/**
|
|
2740
2819
|
* Wildcard-aware CORS origin matching for the platform workers.
|
|
2741
2820
|
*
|
|
@@ -5282,4 +5361,4 @@ interface AppLogsResponse {
|
|
|
5282
5361
|
declare const APP_LOG_EVENT_KEYS: readonly ["id", "timestamp", "level", "eventType", "message", "source", "outcome", "request", "exception"];
|
|
5283
5362
|
type AppLogEventKey = (typeof APP_LOG_EVENT_KEYS)[number];
|
|
5284
5363
|
|
|
5285
|
-
export { AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, APP_ID_RE, APP_LOG_EVENT_KEYS, APP_NAME_RULES, APP_STORAGE_LIMIT_BYTES, 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 AuthWorkerEnv, Awareness, type AwarenessState, type AwarenessStates, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, type BaseMessage, BaseRoom, CANONICAL_APP_IDENTITY_MIGRATION_ID, CHANNELS_SCHEMA, CHANNEL_INVITATIONS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CLIENT_LOG_MARKER, CONVERSATION_SCHEMAS, 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 ConvMemberData, type ConvMessageData, type ConvReactionData, type ConvReadCursorData, type ConvVoteData, type ConversationStateData, 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_DO_MANIFEST, DEFAULT_QUERY_LIMIT, DEPLOYED_APPS_DEFAULTS, DIRECTORY_SCHEMAS, 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 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 Job, type JobContext, JobRoom, type JobRoomConfig, type JobStatus, type JwtClaims, type JwtVerifierConfig, LOG_LEVELS, type LogLevel, MAX_APP_FILE_BYTES, MAX_DEPLOY_ASSET_FILE_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 Player, type PrefixResult, type PresencePeer, PresenceRoom, type ProtocolMessage, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, REGISTRY_INSTANCE, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_NAMES, RESOURCE_ID_RE, ROLE_ADMIN, ROLE_ANONYMOUS, ROLE_DEFAULT, RecordRoom, type RecordRoomConfig, RegistryClientError, type ResolvedColumn, type ResolvedDeepSpaceAgentModel, type ResolvedPermission, type RolePermissions, type RunMigrationsResult, STRICT_APP_ID_RE, SYSTEM_COLLECTIONS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, type ServerMessage, type SharedConnection, type StorageAdmission, type StoredRecord, type Summarizer, type SyncResult, TEST_ACCOUNT_EMAIL_SUFFIX, type TokenDebugInfo, type ToolResult, type ToolSchema, UPLOAD_PART_BYTES, USERS_COLUMNS, type User, type UserAttachment, VOTING_SCHEMAS, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKSPACE_SCHEMAS, YjsRoom, analyzePermissions, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, authWorkerFetch, bindingManifestFromOutputConfig, buildCronContext, buildTableSelect, buildUiParts, callRegistry, canCreate, canDelete, canRead, canUpdate, capToolResultSize, captureScreenshot, checkFieldPermissions, clientBuild, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDecoder, createDeepSpaceAI, createDeepSpaceAuth, createEncoder, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, enqueueJob, formatBytes, getChat, getDeepSpaceAIModel, getGlobalDOSchemas, getGlobalDOType, getMessageType, getRolePermissions, handleAwarenessMessage, handleClientErrorReport, handleSyncMessage, hasContent, isAutoProvision, isFilesVerbPath, isOwner, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, lintSchema, listDeepSpaceAgentModels, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, noopPermissionContext, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readVarUint, readVarUint8Array, registerClientErrorRoute, registerDeepSpaceDocumentation, registryErrorJson, registryStub, resolveAppName, resolveColumn, resolveDeepSpaceAgentModel, rowToData, runMigrations, serverBuild, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, toUint8Array, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppMigrationIds, validateAppName, validateBindingManifest, validateDoManifest, verifyJwt, workspaceAccountsSchema, workspaceContentSharesSchema, workspaceEmailHandlesSchema, workspaceFormResponsesSchema, workspacePeopleSchema, workspaceProjectsSchema, workspaceTagsSchema, workspaceTasksSchema, workspaceTeamMembersSchema, workspaceTeamsSchema, workspaceTransactionsSchema, writeVarUint, writeVarUint8Array };
|
|
5364
|
+
export { AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, ALLOWED_BINDING_TYPES, APP_ID_RE, APP_LOG_EVENT_KEYS, APP_NAME_RULES, APP_STORAGE_LIMIT_BYTES, 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, BUILT_IN_TOOLS, type BaseMessage, BaseRoom, CANONICAL_APP_IDENTITY_MIGRATION_ID, CHANNELS_SCHEMA, CHANNEL_INVITATIONS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, CLIENT_LOG_MARKER, CONVERSATION_SCHEMAS, 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 ConvMemberData, type ConvMessageData, type ConvReactionData, type ConvReadCursorData, type ConvVoteData, type ConversationStateData, 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_DO_MANIFEST, DEFAULT_QUERY_LIMIT, DEPLOYED_APPS_DEFAULTS, DIRECTORY_SCHEMAS, 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 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 Job, type JobContext, JobRoom, type JobRoomConfig, type JobStatus, type JwtClaims, type JwtVerifierConfig, LOG_LEVELS, type LogLevel, MAX_APP_FILE_BYTES, MAX_DEPLOY_ASSET_FILE_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 Player, type PrefixResult, type PresencePeer, PresenceRoom, type ProtocolMessage, type ProxyRoute, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, REGISTRY_INSTANCE, RELEASE_STAMP_PATH, REQUIRED_COMPATIBILITY_FLAGS, RESERVED_BINDING_NAMES, RESERVED_COLLECTION_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, STRICT_APP_ID_RE, SYSTEM_COLLECTIONS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, type ServerMessage, type SharedConnection, 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, VOTING_SCHEMAS, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, WORKER_OWNED_NOT_FOUND_MIGRATION_ID, WORKSPACE_SCHEMAS, YjsRoom, analyzePermissions, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, authWorkerFetch, bindingManifestFromOutputConfig, buildCronContext, buildTableSelect, buildUiParts, callRegistry, canCreate, canDelete, canRead, canUpdate, capToolResultSize, captureScreenshot, checkFieldPermissions, clientBuild, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDecoder, createDeepSpaceAI, createDeepSpaceAuth, createEncoder, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, dispatch, encode, encodeAwarenessMessage, encodeSyncStep1, encodeSyncStep2, encodeUpdate, enqueueJob, formatBytes, getChat, getDeepSpaceAIModel, getGlobalDOSchemas, getGlobalDOType, getMessageType, getRolePermissions, handleAwarenessMessage, handleClientErrorReport, handleSyncMessage, hasContent, isAssetNotFoundHandling, isAutoProvision, isFilesVerbPath, isOwner, isPlatformReservedPath, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, lintSchema, listDeepSpaceAgentModels, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, noopPermissionContext, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, readVarUint, readVarUint8Array, registerClientErrorRoute, registerDeepSpaceDocumentation, registryErrorJson, registryStub, resolveAppName, resolveColumn, resolveCompatibilityFlags, resolveDeepSpaceAgentModel, rowToData, runMigrations, serverBuild, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, toUint8Array, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppMigrationIds, validateAppName, validateBindingManifest, validateDoManifest, verifyJwt, workspaceAccountsSchema, workspaceContentSharesSchema, workspaceEmailHandlesSchema, workspaceFormResponsesSchema, workspacePeopleSchema, workspaceProjectsSchema, workspaceTagsSchema, workspaceTasksSchema, workspaceTeamMembersSchema, workspaceTeamsSchema, workspaceTransactionsSchema, writeVarUint, writeVarUint8Array };
|
package/dist/worker.js
CHANGED
|
@@ -6019,6 +6019,7 @@ var RESERVED_COLLECTION_NAMES = new Set(
|
|
|
6019
6019
|
var APP_MIGRATION_ID_RE = /^[a-z0-9][a-z0-9._-]{0,127}$/;
|
|
6020
6020
|
var MAX_APP_MIGRATION_IDS = 256;
|
|
6021
6021
|
var CANONICAL_APP_IDENTITY_MIGRATION_ID = "2026-08-canonical-app-identity-wire";
|
|
6022
|
+
var WORKER_OWNED_NOT_FOUND_MIGRATION_ID = "2026-08-worker-owned-not-found";
|
|
6022
6023
|
function validateAppMigrationIds(value) {
|
|
6023
6024
|
if (!Array.isArray(value)) {
|
|
6024
6025
|
return { valid: false, reason: "app migrations must be a JSON string array" };
|
|
@@ -6170,6 +6171,76 @@ function resolveDeepSpaceAgentModel(modelId, profileId = "application") {
|
|
|
6170
6171
|
return { modelId: model.id, provider: model.provider, model, profile };
|
|
6171
6172
|
}
|
|
6172
6173
|
|
|
6174
|
+
// src/shared/app-routing.ts
|
|
6175
|
+
var RELEASE_STAMP_PATH = "/.well-known/deepspace/release.json";
|
|
6176
|
+
var ASSET_NOT_FOUND_HANDLING_VALUES = [
|
|
6177
|
+
"none",
|
|
6178
|
+
"single-page-application",
|
|
6179
|
+
"404-page"
|
|
6180
|
+
];
|
|
6181
|
+
var UNDECLARED_ASSET_NOT_FOUND_HANDLING = "single-page-application";
|
|
6182
|
+
function isAssetNotFoundHandling(value) {
|
|
6183
|
+
return ASSET_NOT_FOUND_HANDLING_VALUES.includes(value);
|
|
6184
|
+
}
|
|
6185
|
+
var REQUIRED_COMPATIBILITY_FLAGS = [
|
|
6186
|
+
"nodejs_compat",
|
|
6187
|
+
"assets_navigation_has_no_effect"
|
|
6188
|
+
];
|
|
6189
|
+
var CONTRADICTORY_COMPATIBILITY_FLAGS = /* @__PURE__ */ new Set([
|
|
6190
|
+
"no_nodejs_compat",
|
|
6191
|
+
"assets_navigation_prefers_asset_serving"
|
|
6192
|
+
]);
|
|
6193
|
+
function resolveCompatibilityFlags(declared) {
|
|
6194
|
+
const flags = new Set(REQUIRED_COMPATIBILITY_FLAGS);
|
|
6195
|
+
for (const flag of declared ?? []) {
|
|
6196
|
+
if (typeof flag !== "string") continue;
|
|
6197
|
+
const trimmed = flag.trim();
|
|
6198
|
+
if (!trimmed || CONTRADICTORY_COMPATIBILITY_FLAGS.has(trimmed)) continue;
|
|
6199
|
+
flags.add(trimmed);
|
|
6200
|
+
}
|
|
6201
|
+
return [...flags];
|
|
6202
|
+
}
|
|
6203
|
+
var SDK_RUN_WORKER_FIRST = [
|
|
6204
|
+
"/api/*",
|
|
6205
|
+
"/ws/*",
|
|
6206
|
+
"/internal/*",
|
|
6207
|
+
"/v1/*",
|
|
6208
|
+
"/_deepspace/*",
|
|
6209
|
+
"/llms.txt",
|
|
6210
|
+
"/llms-full.txt",
|
|
6211
|
+
"/.well-known/mcp",
|
|
6212
|
+
"/.well-known/mcp.json",
|
|
6213
|
+
"/.well-known/mcp/*"
|
|
6214
|
+
];
|
|
6215
|
+
var DOCUMENTATION_PATHS = [
|
|
6216
|
+
"/_documentation",
|
|
6217
|
+
"/_documentation/*",
|
|
6218
|
+
"/_documentation-root",
|
|
6219
|
+
"/_documentation-root/*"
|
|
6220
|
+
];
|
|
6221
|
+
var RESERVED_RUN_WORKER_FIRST = [
|
|
6222
|
+
...SDK_RUN_WORKER_FIRST,
|
|
6223
|
+
...DOCUMENTATION_PATHS
|
|
6224
|
+
];
|
|
6225
|
+
function isPlatformReservedPath(pathname) {
|
|
6226
|
+
return RESERVED_RUN_WORKER_FIRST.some((pattern) => {
|
|
6227
|
+
if (!pattern.endsWith("/*")) return pathname === pattern;
|
|
6228
|
+
const base = pattern.slice(0, -2);
|
|
6229
|
+
return pathname === base || pathname.startsWith(`${base}/`);
|
|
6230
|
+
});
|
|
6231
|
+
}
|
|
6232
|
+
|
|
6233
|
+
// src/shared/platform-proxy.ts
|
|
6234
|
+
var BROWSER_PROXY_ROUTES = [
|
|
6235
|
+
// useSubscription — read state, subscribe, manage billing.
|
|
6236
|
+
{ method: "GET", path: "/_deepspace/subscriptions/me" },
|
|
6237
|
+
{ method: "POST", path: "/_deepspace/subscriptions/checkout" },
|
|
6238
|
+
{ method: "POST", path: "/_deepspace/subscriptions/portal" },
|
|
6239
|
+
// useCheckout (one-time charges).
|
|
6240
|
+
{ method: "POST", path: "/_deepspace/charges/create" },
|
|
6241
|
+
{ method: "GET", path: "/_deepspace/charges/me" }
|
|
6242
|
+
];
|
|
6243
|
+
|
|
6173
6244
|
// src/server/utils/cors.ts
|
|
6174
6245
|
function matchOrigin(origin, patterns) {
|
|
6175
6246
|
if (!origin) return null;
|
|
@@ -9398,10 +9469,12 @@ export {
|
|
|
9398
9469
|
APP_LOG_EVENT_KEYS,
|
|
9399
9470
|
APP_NAME_RULES,
|
|
9400
9471
|
APP_STORAGE_LIMIT_BYTES,
|
|
9472
|
+
ASSET_NOT_FOUND_HANDLING_VALUES,
|
|
9401
9473
|
AUTO_PROVISIONABLE_TYPES,
|
|
9402
9474
|
AUTO_PROVISION_SENTINEL,
|
|
9403
9475
|
Awareness,
|
|
9404
9476
|
BASE_USERS_SCHEMA,
|
|
9477
|
+
BROWSER_PROXY_ROUTES,
|
|
9405
9478
|
BUILT_IN_TOOLS,
|
|
9406
9479
|
BaseRoom,
|
|
9407
9480
|
CANONICAL_APP_IDENTITY_MIGRATION_ID,
|
|
@@ -9446,22 +9519,28 @@ export {
|
|
|
9446
9519
|
REACTIONS_SCHEMA,
|
|
9447
9520
|
READ_RECEIPTS_SCHEMA,
|
|
9448
9521
|
REGISTRY_INSTANCE,
|
|
9522
|
+
RELEASE_STAMP_PATH,
|
|
9523
|
+
REQUIRED_COMPATIBILITY_FLAGS,
|
|
9449
9524
|
RESERVED_BINDING_NAMES,
|
|
9450
9525
|
RESERVED_COLLECTION_NAMES,
|
|
9526
|
+
RESERVED_RUN_WORKER_FIRST,
|
|
9451
9527
|
RESOURCE_ID_RE,
|
|
9452
9528
|
ROLE_ADMIN,
|
|
9453
9529
|
ROLE_ANONYMOUS,
|
|
9454
9530
|
ROLE_DEFAULT,
|
|
9455
9531
|
RecordRoom,
|
|
9456
9532
|
RegistryClientError,
|
|
9533
|
+
SDK_RUN_WORKER_FIRST,
|
|
9457
9534
|
STRICT_APP_ID_RE,
|
|
9458
9535
|
SYSTEM_COLLECTIONS,
|
|
9459
9536
|
SYSTEM_MANAGED_COLUMNS,
|
|
9460
9537
|
SchemaRegistry,
|
|
9461
9538
|
TEST_ACCOUNT_EMAIL_SUFFIX,
|
|
9539
|
+
UNDECLARED_ASSET_NOT_FOUND_HANDLING,
|
|
9462
9540
|
UPLOAD_PART_BYTES,
|
|
9463
9541
|
USERS_COLUMNS,
|
|
9464
9542
|
VOTING_SCHEMAS,
|
|
9543
|
+
WORKER_OWNED_NOT_FOUND_MIGRATION_ID,
|
|
9465
9544
|
WORKSPACE_SCHEMAS,
|
|
9466
9545
|
YjsRoom,
|
|
9467
9546
|
analyzePermissions,
|
|
@@ -9517,9 +9596,11 @@ export {
|
|
|
9517
9596
|
handleClientErrorReport,
|
|
9518
9597
|
handleSyncMessage,
|
|
9519
9598
|
hasContent,
|
|
9599
|
+
isAssetNotFoundHandling,
|
|
9520
9600
|
isAutoProvision,
|
|
9521
9601
|
isFilesVerbPath,
|
|
9522
9602
|
isOwner,
|
|
9603
|
+
isPlatformReservedPath,
|
|
9523
9604
|
isTestAccountClaims,
|
|
9524
9605
|
isTestAccountEmail,
|
|
9525
9606
|
isTestAccountTier,
|
|
@@ -9545,6 +9626,7 @@ export {
|
|
|
9545
9626
|
registryStub,
|
|
9546
9627
|
resolveAppName,
|
|
9547
9628
|
resolveColumn,
|
|
9629
|
+
resolveCompatibilityFlags,
|
|
9548
9630
|
resolveDeepSpaceAgentModel,
|
|
9549
9631
|
rowToData,
|
|
9550
9632
|
runMigrations,
|