deepspace 0.33.1 → 0.34.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 +35 -0
- package/README.md +5 -1
- package/dist/build.js.map +1 -1
- package/dist/chunk-KELQ7OD5.js +1957 -0
- package/dist/chunk-KELQ7OD5.js.map +1 -0
- package/dist/{chunk-PZDVKSLI.js → chunk-SINBB5BQ.js} +1 -1
- package/dist/{chunk-PZDVKSLI.js.map → chunk-SINBB5BQ.js.map} +1 -1
- package/dist/cli.js +74 -15
- package/dist/cli.js.map +1 -1
- package/dist/documentation-client-core.js +1 -1
- package/dist/documentation-default-renderer.cjs +1 -1
- package/dist/documentation-react.js +1 -1
- package/dist/documentation-runtime.js +10 -10
- package/dist/documentation-server-core.js +1 -1
- package/dist/documentation.js +47 -22
- package/dist/documentation.js.map +1 -1
- package/dist/expo.d.ts +73 -0
- package/dist/expo.js +233 -0
- package/dist/expo.js.map +1 -0
- package/dist/index.d.ts +105 -22
- package/dist/index.js +50 -23
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +205 -37
- package/dist/server.js +290 -97
- package/dist/server.js.map +1 -1
- package/dist/worker.d.ts +312 -48
- package/dist/worker.js +499 -110
- package/dist/worker.js.map +1 -1
- package/features/documents/feature.json +15 -0
- package/features/documents/src/DocumentsListPage.tsx +22 -8
- package/features/documents/src/InviteDialog.tsx +63 -42
- package/features/documents/src/__tests__/documents-find-invitee-action.test.ts +131 -0
- package/features/documents/src/__tests__/documents-invitee-lookup.test.ts +67 -0
- package/features/documents/src/documents-find-invitee-action.ts +56 -0
- package/features/documents/src/documents-invitee-lookup.ts +38 -0
- package/features/documents/src/documents-ui.css +10 -0
- package/package.json +28 -8
package/dist/server.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { LanguageModel, ToolSet,
|
|
1
|
+
import { LanguageModel, ToolSet, streamText, Tool, FilePart, ModelMessage } from 'ai';
|
|
2
|
+
import { forwardAnthropicContainerIdFromLastStep } from '@ai-sdk/anthropic';
|
|
2
3
|
import * as Y from 'yjs';
|
|
3
4
|
import * as zod_v4_core from 'zod/v4/core';
|
|
4
5
|
import * as zod from 'zod';
|
|
5
6
|
import * as better_auth_plugins from 'better-auth/plugins';
|
|
6
7
|
import * as better_auth from 'better-auth';
|
|
7
|
-
import { betterAuth } from 'better-auth';
|
|
8
|
+
import { BetterAuthOptions, betterAuth } from 'better-auth';
|
|
9
|
+
import { getOAuthState } from 'better-auth/api';
|
|
8
10
|
import { Context } from 'hono';
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -902,6 +904,11 @@ interface DeepSpaceAIModel {
|
|
|
902
904
|
transport: 'messages' | 'chat-completions';
|
|
903
905
|
recommendation: 'frontier' | 'balanced' | 'fast' | 'available' | 'limited';
|
|
904
906
|
note?: string;
|
|
907
|
+
/**
|
|
908
|
+
* Superseded: still resolvable by id, so an app that saved it keeps working,
|
|
909
|
+
* but left out of pickers and model lists.
|
|
910
|
+
*/
|
|
911
|
+
legacy?: true;
|
|
905
912
|
}
|
|
906
913
|
interface DeepSpaceAgentProfile {
|
|
907
914
|
id: DeepSpaceAgentProfileId;
|
|
@@ -917,6 +924,21 @@ interface ResolvedDeepSpaceAgentModel {
|
|
|
917
924
|
profile: DeepSpaceAgentProfile;
|
|
918
925
|
}
|
|
919
926
|
|
|
927
|
+
/**
|
|
928
|
+
* Wire contract between the SDK's sandbox helpers (server/utils/sandbox.ts)
|
|
929
|
+
* and the api-worker proxy that records who owns each Anthropic
|
|
930
|
+
* code-execution file and container.
|
|
931
|
+
*/
|
|
932
|
+
/**
|
|
933
|
+
* Who may use a file or container the request creates:
|
|
934
|
+
* - `user` (default): only the JWT subject, inside the calling app.
|
|
935
|
+
* - `app`: any caller of the same app (shared workspaces, owner-billed
|
|
936
|
+
* background turns continuing a user's conversation).
|
|
937
|
+
* Another app can never use either.
|
|
938
|
+
*/
|
|
939
|
+
declare const SANDBOX_SCOPES: readonly ["user", "app"];
|
|
940
|
+
type SandboxScope = (typeof SANDBOX_SCOPES)[number];
|
|
941
|
+
|
|
920
942
|
/**
|
|
921
943
|
* AI provider helpers — create Vercel AI SDK providers that route through
|
|
922
944
|
* the DeepSpace API worker proxy for per-user billing.
|
|
@@ -944,7 +966,7 @@ interface ResolvedDeepSpaceAgentModel {
|
|
|
944
966
|
* // Server-side autonomous — no auth config needed
|
|
945
967
|
* import { createDeepSpaceAI } from 'deepspace/worker'
|
|
946
968
|
* const cerebras = createDeepSpaceAI(env, 'cerebras')
|
|
947
|
-
* const result = await generateText({ model: cerebras('
|
|
969
|
+
* const result = await generateText({ model: cerebras('gpt-oss-120b'), ... })
|
|
948
970
|
*
|
|
949
971
|
* // User-initiated (inside a request handler)
|
|
950
972
|
* const jwt = c.req.header('Authorization')!.slice(7)
|
|
@@ -964,6 +986,13 @@ interface DeepSpaceAIEnv extends ApiWorkerEnv {
|
|
|
964
986
|
* Bills the app owner.
|
|
965
987
|
*/
|
|
966
988
|
APP_OWNER_JWT?: string;
|
|
989
|
+
/**
|
|
990
|
+
* The app's id and deploy-time identity token. Sent with every proxied call
|
|
991
|
+
* so the proxy can tie Anthropic sandbox files and containers to this app;
|
|
992
|
+
* code execution and files are refused without them.
|
|
993
|
+
*/
|
|
994
|
+
DEEPSPACE_APP_ID?: string;
|
|
995
|
+
APP_IDENTITY_TOKEN?: string;
|
|
967
996
|
}
|
|
968
997
|
interface DeepSpaceAIOptions {
|
|
969
998
|
/**
|
|
@@ -976,6 +1005,12 @@ interface DeepSpaceAIOptions {
|
|
|
976
1005
|
* client-supplied billing override.
|
|
977
1006
|
*/
|
|
978
1007
|
authToken?: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* Who may reuse the sandbox files and containers this call creates.
|
|
1010
|
+
* Default `'user'`: only the auth token's user. `'app'`: every caller of
|
|
1011
|
+
* this app. Another app can never reach either.
|
|
1012
|
+
*/
|
|
1013
|
+
sandboxScope?: SandboxScope;
|
|
979
1014
|
}
|
|
980
1015
|
/**
|
|
981
1016
|
* Build an AI SDK provider that routes through the DeepSpace API worker.
|
|
@@ -991,10 +1026,12 @@ type DeepSpaceAgentStreamOptions<TOOLS extends ToolSet> = Omit<StreamTextOptions
|
|
|
991
1026
|
profile: DeepSpaceAgentProfileId;
|
|
992
1027
|
modelId?: unknown;
|
|
993
1028
|
authToken?: string;
|
|
1029
|
+
/** Scope for sandbox files and containers this turn creates (see `createDeepSpaceAI`). */
|
|
1030
|
+
sandboxScope?: SandboxScope;
|
|
994
1031
|
};
|
|
995
1032
|
interface DeepSpaceAgentStream<TOOLS extends ToolSet> {
|
|
996
1033
|
selection: ResolvedDeepSpaceAgentModel;
|
|
997
|
-
result:
|
|
1034
|
+
result: ReturnType<typeof streamText<TOOLS>>;
|
|
998
1035
|
}
|
|
999
1036
|
declare class DeepSpaceAgentModelError extends Error {
|
|
1000
1037
|
readonly modelId: unknown;
|
|
@@ -1018,6 +1055,118 @@ interface DeepSpaceAgentDiagnosticContext {
|
|
|
1018
1055
|
/** Preserve safe structured provider diagnostics in bounded Worker logs. */
|
|
1019
1056
|
declare function deepSpaceAgentErrorSummary(error: unknown, context?: DeepSpaceAgentDiagnosticContext): string;
|
|
1020
1057
|
|
|
1058
|
+
/**
|
|
1059
|
+
* Anthropic's hosted code-execution sandbox, through the DeepSpace proxy.
|
|
1060
|
+
*
|
|
1061
|
+
* Claude runs Python and shell in a container Anthropic hosts, so an agent can
|
|
1062
|
+
* read, edit and create real files (Word, Excel, PowerPoint, PDF, charts). The
|
|
1063
|
+
* container has no network: files go in and come out through Anthropic's
|
|
1064
|
+
* Files API, which the proxy scopes to this app (and, by default, to the
|
|
1065
|
+
* calling user — see `DeepSpaceAIOptions.sandboxScope`).
|
|
1066
|
+
*
|
|
1067
|
+
* const ai = createDeepSpaceAI(env, 'anthropic', { authToken })
|
|
1068
|
+
* const files = sandboxFiles(env, { authToken })
|
|
1069
|
+
* const sheet = await files.upload(bytes, { filename: 'leads.xlsx' })
|
|
1070
|
+
*
|
|
1071
|
+
* const result = streamText({ // stream: long jobs outlive a non-streamed call
|
|
1072
|
+
* model: ai('claude-sonnet-5'),
|
|
1073
|
+
* tools: { code_execution: codeExecutionTool(), crm_query: callableFromSandbox(crmQuery) },
|
|
1074
|
+
* prepareStep: forwardSandboxContainer, // same container across steps
|
|
1075
|
+
* providerOptions: reuseSandbox(savedContainerId), // optional: across messages
|
|
1076
|
+
* messages: [{ role: 'user', content: [{ type: 'text', text: 'Chart this' }, sandboxUpload(sheet)] }],
|
|
1077
|
+
* })
|
|
1078
|
+
*
|
|
1079
|
+
* const { containerId, fileIds } = sandboxOutputs(await result.steps)
|
|
1080
|
+
* const chart = await files.download(fileIds[0])
|
|
1081
|
+
*
|
|
1082
|
+
* Stream sandbox calls (`streamText`). A non-streamed call that runs longer
|
|
1083
|
+
* than about two minutes is cut off with a 524 on its way to Anthropic —
|
|
1084
|
+
* multi-step document jobs routinely do.
|
|
1085
|
+
*
|
|
1086
|
+
* Billing: tokens as usual, plus a flat 5 container-minutes for each request
|
|
1087
|
+
* that used the sandbox. Files API calls are free.
|
|
1088
|
+
*/
|
|
1089
|
+
|
|
1090
|
+
/** The code-execution tool. Add it to `tools`; Claude only starts a container when it uses it. */
|
|
1091
|
+
declare function codeExecutionTool(): Tool;
|
|
1092
|
+
/**
|
|
1093
|
+
* Let code running in the sandbox call this tool (programmatic tool calling),
|
|
1094
|
+
* in addition to Claude calling it directly. The call still runs in the app's
|
|
1095
|
+
* worker with the tool's own permission checks — the sandbox gets no
|
|
1096
|
+
* credentials. Anthropic waits about 4 minutes for each result.
|
|
1097
|
+
*/
|
|
1098
|
+
declare function callableFromSandbox<T extends Tool>(tool: T): T;
|
|
1099
|
+
/** `prepareStep` that keeps every step of a turn in the first step's container. */
|
|
1100
|
+
declare const forwardSandboxContainer: typeof forwardAnthropicContainerIdFromLastStep;
|
|
1101
|
+
/** `providerOptions` that continue in a container saved from an earlier turn. */
|
|
1102
|
+
declare function reuseSandbox(containerId: string | null | undefined): {
|
|
1103
|
+
anthropic: {
|
|
1104
|
+
container: {
|
|
1105
|
+
id: string;
|
|
1106
|
+
};
|
|
1107
|
+
};
|
|
1108
|
+
} | undefined;
|
|
1109
|
+
/** A message part that copies an uploaded file into the sandbox. */
|
|
1110
|
+
declare function sandboxUpload(file: Pick<SandboxFile, 'id' | 'filename' | 'mime_type'>): FilePart;
|
|
1111
|
+
interface SandboxStep {
|
|
1112
|
+
providerMetadata?: Record<string, unknown>;
|
|
1113
|
+
content: ReadonlyArray<unknown>;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* The container a turn ran in (save it to continue later) and the files the
|
|
1117
|
+
* sandbox created (download them with `sandboxFiles`).
|
|
1118
|
+
*/
|
|
1119
|
+
declare function sandboxOutputs(steps: ReadonlyArray<SandboxStep>): {
|
|
1120
|
+
containerId: string | null;
|
|
1121
|
+
fileIds: string[];
|
|
1122
|
+
};
|
|
1123
|
+
/** Anthropic's file metadata, as returned through the proxy. */
|
|
1124
|
+
interface SandboxFile {
|
|
1125
|
+
type: 'file';
|
|
1126
|
+
id: string;
|
|
1127
|
+
filename: string;
|
|
1128
|
+
mime_type: string;
|
|
1129
|
+
size_bytes: number;
|
|
1130
|
+
created_at: string;
|
|
1131
|
+
/** Only files the sandbox created are downloadable; uploads are not. */
|
|
1132
|
+
downloadable?: boolean;
|
|
1133
|
+
expires_at?: string | null;
|
|
1134
|
+
}
|
|
1135
|
+
interface SandboxFileList {
|
|
1136
|
+
data: SandboxFile[];
|
|
1137
|
+
/** Pass back as `page` for the next page; null on the last one. */
|
|
1138
|
+
next_page: string | null;
|
|
1139
|
+
}
|
|
1140
|
+
interface SandboxUploadOptions {
|
|
1141
|
+
/** Required when `file` is a Blob rather than a File. */
|
|
1142
|
+
filename?: string;
|
|
1143
|
+
/** 3,600–7,776,000. The proxy defaults uploads to 30 days. */
|
|
1144
|
+
expiresInSeconds?: number;
|
|
1145
|
+
}
|
|
1146
|
+
interface SandboxFilesOptions {
|
|
1147
|
+
/** Same meaning as in `createDeepSpaceAI`: whose file it is, and who is billed. */
|
|
1148
|
+
authToken?: string;
|
|
1149
|
+
/** Scope for files this client uploads. Must match the calls that will use them. */
|
|
1150
|
+
scope?: SandboxScope;
|
|
1151
|
+
}
|
|
1152
|
+
interface SandboxFilesClient {
|
|
1153
|
+
upload(file: Blob, options?: SandboxUploadOptions): Promise<SandboxFile>;
|
|
1154
|
+
get(fileId: string): Promise<SandboxFile>;
|
|
1155
|
+
/** The file's bytes as a streaming Response (content-type and content-disposition set). */
|
|
1156
|
+
download(fileId: string): Promise<Response>;
|
|
1157
|
+
list(options?: {
|
|
1158
|
+
limit?: number;
|
|
1159
|
+
page?: string;
|
|
1160
|
+
}): Promise<SandboxFileList>;
|
|
1161
|
+
delete(fileId: string): Promise<void>;
|
|
1162
|
+
}
|
|
1163
|
+
declare class SandboxFileError extends Error {
|
|
1164
|
+
readonly status: number;
|
|
1165
|
+
constructor(status: number, message: string);
|
|
1166
|
+
}
|
|
1167
|
+
/** Upload, read, list and delete the calling app's sandbox files. */
|
|
1168
|
+
declare function sandboxFiles(env: DeepSpaceAIEnv, options?: SandboxFilesOptions): SandboxFilesClient;
|
|
1169
|
+
|
|
1021
1170
|
/**
|
|
1022
1171
|
* Composio tools for the Vercel AI SDK.
|
|
1023
1172
|
*
|
|
@@ -2517,22 +2666,10 @@ declare function armCronRoom(ctx: {
|
|
|
2517
2666
|
}, namespace: DurableObjectNamespace, roomId: string, tasks: readonly CronTask[]): void;
|
|
2518
2667
|
|
|
2519
2668
|
/**
|
|
2520
|
-
*
|
|
2521
|
-
*
|
|
2522
|
-
*
|
|
2523
|
-
*
|
|
2524
|
-
* jobs that need minutes-to-hours live here instead: rows in SQLite,
|
|
2525
|
-
* picked up by DO alarms (15-min wall budget per tick), resumable
|
|
2526
|
-
* across ticks via `ctx.continue` for the rare longer cases.
|
|
2527
|
-
*
|
|
2528
|
-
* Lifecycle: queued → running → succeeded | failed | canceled
|
|
2529
|
-
*
|
|
2530
|
-
* Crash recovery: if an isolate is recycled mid-run, the row stays at
|
|
2531
|
-
* `running`. On next init, rows older than ~16 min are either retried
|
|
2532
|
-
* (if attempts left) or marked failed.
|
|
2533
|
-
*
|
|
2534
|
-
* See the abstract `onJob` method below for the subclass contract.
|
|
2535
|
-
* Message types: job.*
|
|
2669
|
+
* Persistent job queue with serial execution, progress, cancellation and retries.
|
|
2670
|
+
* Jobs run inside alarms unless listed in `backgroundJobTypes`.
|
|
2671
|
+
* Use `ctx.continue` to save a checkpoint for the next run.
|
|
2672
|
+
* After a restart, running jobs older than 16 minutes are retried or failed.
|
|
2536
2673
|
*/
|
|
2537
2674
|
|
|
2538
2675
|
type JobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled';
|
|
@@ -2577,6 +2714,11 @@ interface JobContext {
|
|
|
2577
2714
|
signal: AbortSignal;
|
|
2578
2715
|
}
|
|
2579
2716
|
interface JobRoomConfig {
|
|
2717
|
+
/**
|
|
2718
|
+
* Job types that run after the alarm returns. Defaults to none.
|
|
2719
|
+
* Handlers must set a deadline; restarts use existing checkpoint/retry rules.
|
|
2720
|
+
*/
|
|
2721
|
+
backgroundJobTypes?: readonly string[];
|
|
2580
2722
|
/** Default for jobs enqueued without explicit `maxAttempts`. Default 1 (no auto-retry). */
|
|
2581
2723
|
defaultMaxAttempts?: number;
|
|
2582
2724
|
/** TTL for terminal rows (succeeded/failed/canceled) in ms. Default 24h. */
|
|
@@ -2599,6 +2741,7 @@ declare abstract class JobRoom<E = Record<string, unknown>, P = unknown, R = unk
|
|
|
2599
2741
|
private readonly retentionMs;
|
|
2600
2742
|
private readonly snapshotLimit;
|
|
2601
2743
|
private readonly retryBackoffMs;
|
|
2744
|
+
private readonly backgroundJobTypes;
|
|
2602
2745
|
private readonly authorizeWrite;
|
|
2603
2746
|
private readonly authorizeRead;
|
|
2604
2747
|
private broadcastQueue;
|
|
@@ -2647,10 +2790,6 @@ declare abstract class JobRoom<E = Record<string, unknown>, P = unknown, R = unk
|
|
|
2647
2790
|
private insertJob;
|
|
2648
2791
|
private cancelJob;
|
|
2649
2792
|
private retryJob;
|
|
2650
|
-
/**
|
|
2651
|
-
* Drain due jobs in FIFO order. All due jobs share the alarm's
|
|
2652
|
-
* 15-min wall budget (a CF property, not a per-job allocation).
|
|
2653
|
-
*/
|
|
2654
2793
|
private drainDueJobs;
|
|
2655
2794
|
private executeJob;
|
|
2656
2795
|
private makeContext;
|
|
@@ -3222,18 +3361,18 @@ declare function handleUserList(ctx: UserContext, ws: WebSocket, attachment: Con
|
|
|
3222
3361
|
*/
|
|
3223
3362
|
declare function broadcastUserList(ctx: UserContext, except?: WebSocket | ReadonlySet<WebSocket>): void;
|
|
3224
3363
|
/**
|
|
3225
|
-
* Handle user
|
|
3364
|
+
* Handle the presence heartbeat (`user.update`): refresh `lastSeenAt`.
|
|
3226
3365
|
*
|
|
3227
|
-
*
|
|
3228
|
-
*
|
|
3229
|
-
*
|
|
3366
|
+
* Nothing else on the users row can be set from this frame. Its identity
|
|
3367
|
+
* fields — email, name, imageUrl — are what the auth plane verified at
|
|
3368
|
+
* connect (`registerUser` from the JWT claims) and are refreshed only there:
|
|
3369
|
+
* `email` is the key invites resolve on, and `name`/`imageUrl` are what a
|
|
3370
|
+
* share dialog shows an owner about a collaborator, so a client-chosen value
|
|
3371
|
+
* would let any member be resolved in, or pose as, another user. The SDK
|
|
3372
|
+
* client sends the frame empty (the protocol types it as `EmptyPayload`), and
|
|
3373
|
+
* the room's dispatch does not hand the payload down.
|
|
3230
3374
|
*/
|
|
3231
|
-
|
|
3232
|
-
name?: string;
|
|
3233
|
-
email?: string;
|
|
3234
|
-
imageUrl?: string;
|
|
3235
|
-
}
|
|
3236
|
-
declare function handleUserUpdate(ctx: RecordContext, _ws: WebSocket, attachment: ConnectionAttachment, payload: UserUpdatePayload): void;
|
|
3375
|
+
declare function handleUserUpdate(ctx: RecordContext, _ws: WebSocket, attachment: ConnectionAttachment): void;
|
|
3237
3376
|
/**
|
|
3238
3377
|
* Handle set role request (admin only).
|
|
3239
3378
|
* Updates the role field in the c_users table.
|
|
@@ -3487,6 +3626,17 @@ declare function isTestAccountClaims(claims: JwtClaims | Record<string, unknown>
|
|
|
3487
3626
|
/** True when a billing subscription tier marks a test account. */
|
|
3488
3627
|
declare function isTestAccountTier(tier: string | null | undefined): boolean;
|
|
3489
3628
|
|
|
3629
|
+
type BetterAuthUserCreateBeforeHook = NonNullable<NonNullable<NonNullable<NonNullable<BetterAuthOptions['databaseHooks']>['user']>['create']>['before']>;
|
|
3630
|
+
type UserCreateData = Parameters<BetterAuthUserCreateBeforeHook>[0];
|
|
3631
|
+
type UserCreateResult = Awaited<ReturnType<BetterAuthUserCreateBeforeHook>>;
|
|
3632
|
+
interface DeepSpaceUserCreateContext {
|
|
3633
|
+
request?: Request;
|
|
3634
|
+
headers?: Headers;
|
|
3635
|
+
path?: string;
|
|
3636
|
+
/** OAuth state after Better Auth has decrypted/loaded and verified it. */
|
|
3637
|
+
oauthState: Awaited<ReturnType<typeof getOAuthState>>;
|
|
3638
|
+
}
|
|
3639
|
+
type UserAdditionalFields = NonNullable<BetterAuthOptions['user']>['additionalFields'];
|
|
3490
3640
|
interface DeepSpaceAuthConfig {
|
|
3491
3641
|
/** D1 database binding */
|
|
3492
3642
|
database: D1Database;
|
|
@@ -3524,6 +3674,19 @@ interface DeepSpaceAuthConfig {
|
|
|
3524
3674
|
emailAndPassword?: boolean;
|
|
3525
3675
|
/** Trusted origins for CORS */
|
|
3526
3676
|
trustedOrigins?: string[];
|
|
3677
|
+
/**
|
|
3678
|
+
* Server-owned fields to add to Better Auth's user model. Use `input: false`
|
|
3679
|
+
* for values that may only be populated by a database hook, and
|
|
3680
|
+
* `returned: false` for values that must stay out of public auth responses.
|
|
3681
|
+
*/
|
|
3682
|
+
userAdditionalFields?: UserAdditionalFields;
|
|
3683
|
+
/**
|
|
3684
|
+
* Runs inside Better Auth's `user.create.before` lifecycle and may return
|
|
3685
|
+
* the library's `{ data }` patch. Errors intentionally abort user creation,
|
|
3686
|
+
* which lets callers fail closed when a server-validated signup promise can
|
|
3687
|
+
* no longer be attached to the new account.
|
|
3688
|
+
*/
|
|
3689
|
+
beforeUserCreate?: (user: UserCreateData, ctx: DeepSpaceUserCreateContext | null) => Promise<UserCreateResult> | UserCreateResult;
|
|
3527
3690
|
/**
|
|
3528
3691
|
* Called after a new user row is created (any flow: social OAuth callback,
|
|
3529
3692
|
* email/password, server-side `auth.api.signUpEmail`). When the signup came
|
|
@@ -4551,6 +4714,13 @@ declare function createDeepSpaceAuth(config: DeepSpaceAuthConfig): better_auth.A
|
|
|
4551
4714
|
};
|
|
4552
4715
|
};
|
|
4553
4716
|
} | undefined;
|
|
4717
|
+
socialProviders: Parameters<typeof betterAuth>[0]["socialProviders"];
|
|
4718
|
+
trustedOrigins: string[];
|
|
4719
|
+
user?: {
|
|
4720
|
+
additionalFields: {
|
|
4721
|
+
[x: string]: better_auth.DBFieldAttribute;
|
|
4722
|
+
};
|
|
4723
|
+
} | undefined;
|
|
4554
4724
|
database: D1Database;
|
|
4555
4725
|
baseURL: string;
|
|
4556
4726
|
secret: string;
|
|
@@ -4561,8 +4731,6 @@ declare function createDeepSpaceAuth(config: DeepSpaceAuthConfig): better_auth.A
|
|
|
4561
4731
|
emailAndPassword: {
|
|
4562
4732
|
enabled: boolean;
|
|
4563
4733
|
};
|
|
4564
|
-
socialProviders: Parameters<typeof betterAuth>[0]["socialProviders"];
|
|
4565
|
-
trustedOrigins: string[];
|
|
4566
4734
|
}>;
|
|
4567
4735
|
type DeepSpaceAuth = ReturnType<typeof createDeepSpaceAuth>;
|
|
4568
4736
|
|
|
@@ -4724,4 +4892,4 @@ declare class RefundError extends Error {
|
|
|
4724
4892
|
constructor(message: string, status: number);
|
|
4725
4893
|
}
|
|
4726
4894
|
|
|
4727
|
-
export { ACCOUNT_STORAGE_LIMIT_BYTES, AGENT_TOKEN_SCOPE, 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 AppMembership, type AppNameResolution, type AppNameValidation, type AuthWorkerEnv, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, BaseRoom, type BindingJsonValue, CHANNELS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, COST_RATES, CancelSubscriptionError, type CancelSubscriptionOpts, type CancelSubscriptionResult, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ComposioToolsOptions, 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, 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 DoMigrationDirective, type DoMigrationPlan, type ExistingDOBinding, type GetActionData, 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, MAX_APP_FILE_BYTES, MAX_BINDING_NAME_LENGTH, MAX_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_ENV_VAR_BYTES, MAX_UPLOAD_PARTS, MAX_UPLOAD_REQUEST_BYTES, MESSAGES_SCHEMA, type MutateActionData, type PermissionContext, type PermissionLevel, type PlanInfo, type PlatformWorkerEnv, type PrefixResult, type PresencePeer, PresenceRoom, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, REGISTRY_INSTANCE, RESERVED_BINDING_NAMES, RESOURCE_ID_RE, type RecordContext, RecordRoom, type RecordRoomConfig, RefundError, type RefundOpts, type RefundResult, RegistryClientError, type ResolvedColumn, type RolePermissions, type RunMigrationsResult, SECRET_NAME_RE, STRICT_APP_ID_RE, SYSTEM_ASSIGNED_COLUMNS, SYSTEM_COLLECTION_SCHEMAS, SYSTEM_MAINTAINED_COLUMNS, SYSTEM_MANAGED_COLUMNS, SchemaRegistry, type ScopeContext, type ScopedKnowledgeClient, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, 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, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, type YjsContext, YjsRoom, agentTokenIssuer, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, armCronRoom, 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, epochSeconds, executeQuery, folderFilter, formatBytes, getAllUsers, getChat, getOrCreateYjsDoc, getRecord, getRolePermissions, getSubscription, getUser, getYjsDocKey, handleApiRequest, handleDelete, handlePut, handleSetRole, handleSubscribe, handleToolsRequest, handleUnsubscribe, handleUserList, handleUserUpdate, handleYjsBinaryMessage, handleYjsJoin, handleYjsLeave, isAutoProvision, isFilesVerbPath, isOwner, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, knowledge, lintSchema, lintSchemaSet, lintSchemas, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, normalizeKnowledgeFolder, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, putRecord, readRecord, recordMatchesSubscription, refundInvoice, registerUser, registryErrorJson, registryStub, requireSubscription, resolveAppMembership, resolveAppName, resolveAppRole, resolveColumn, resolveSessionReadAuth, rowToData, runMigrations, saveYjsDoc, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppName, validateBindingManifest, validateDoManifest, verifyAgentToken, verifyJwt };
|
|
4895
|
+
export { ACCOUNT_STORAGE_LIMIT_BYTES, AGENT_TOKEN_SCOPE, 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 AppMembership, type AppNameResolution, type AppNameValidation, type AuthWorkerEnv, BASE_USERS_SCHEMA, BUILT_IN_TOOLS, BaseRoom, type BindingJsonValue, CHANNELS_SCHEMA, CHANNEL_MEMBERS_SCHEMA, COST_RATES, CancelSubscriptionError, type CancelSubscriptionOpts, type CancelSubscriptionResult, CanvasRoom, type CanvasShape, type ChatContextConfig, type ChatMessageRow, type ChatRow, type ChatTurn, type CollectionSchema, type ColumnDefinition, type ColumnInterpretation, type ComposioToolsOptions, 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, 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 DeepSpaceUserCreateContext, type DoMigrationDirective, type DoMigrationPlan, type ExistingDOBinding, type GetActionData, 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, MAX_APP_FILE_BYTES, MAX_BINDING_NAME_LENGTH, MAX_DELETE_WHERE_LIMIT, MAX_DEPLOY_ASSET_FILE_BYTES, MAX_ENV_VAR_BYTES, MAX_UPLOAD_PARTS, MAX_UPLOAD_REQUEST_BYTES, MESSAGES_SCHEMA, type MutateActionData, type PermissionContext, type PermissionLevel, type PlanInfo, type PlatformWorkerEnv, type PrefixResult, type PresencePeer, PresenceRoom, type QueryActionData, REACTIONS_SCHEMA, READ_RECEIPTS_SCHEMA, REGISTRY_INSTANCE, RESERVED_BINDING_NAMES, RESOURCE_ID_RE, type RecordContext, RecordRoom, type RecordRoomConfig, RefundError, type RefundOpts, type RefundResult, RegistryClientError, type ResolvedColumn, type RolePermissions, type RunMigrationsResult, SECRET_NAME_RE, STRICT_APP_ID_RE, SYSTEM_ASSIGNED_COLUMNS, SYSTEM_COLLECTION_SCHEMAS, SYSTEM_MAINTAINED_COLUMNS, SYSTEM_MANAGED_COLUMNS, type SandboxFile, SandboxFileError, type SandboxFileList, type SandboxFilesClient, type SandboxFilesOptions, type SandboxUploadOptions, SchemaRegistry, type ScopeContext, type ScopedKnowledgeClient, type ScopedR2Auth, type ScopedR2Config, type ScopedR2Handler, type ScreenshotEnv, type ScreenshotResult, 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, type ValidationError, type VerifiedAuth, type VerifyOutcome, type VerifyResult, type Viewport, type YjsContext, YjsRoom, agentTokenIssuer, apiWorkerFetch, appendMessage, applyAiToolDefaults, applySlidingWindow, armCronRoom, authWorkerFetch, bindingManifestFromOutputConfig, broadcastChange, broadcastUserList, broadcastYjsUpdate, buildCronContext, buildTableSelect, buildUiParts, callRegistry, callableFromSandbox, canCreate, canDelete, canRead, canUpdate, cancelSubscription, capToolResultSize, captureScreenshot, checkFieldPermissions, checkUnclaimedOwnerTransition, codeExecutionTool, coerceValue, collectionTableName, columnId, composioTools, computeDoMigration, computeHmacHex, createChat, createDeepSpaceAI, createDeepSpaceAuth, createScopedR2Handler, dataToColumnValues, decodeJwtPayload, deepSpaceAgentErrorSummary, deleteChatCascade, deleteRecord, enqueueJob, epochSeconds, executeQuery, folderFilter, formatBytes, forwardSandboxContainer, getAllUsers, getChat, getOrCreateYjsDoc, getRecord, getRolePermissions, getSubscription, getUser, getYjsDocKey, handleApiRequest, handleDelete, handlePut, handleSetRole, handleSubscribe, handleToolsRequest, handleUnsubscribe, handleUserList, handleUserUpdate, handleYjsBinaryMessage, handleYjsJoin, handleYjsLeave, isAutoProvision, isFilesVerbPath, isOwner, isTestAccountClaims, isTestAccountEmail, isTestAccountTier, knowledge, lintSchema, lintSchemaSet, lintSchemas, loadMessages, makeDefaultSummarizer, matchOrigin, meterAi, meterUsage, meterVectorize, mintAppId, mintUlid, noopPermissionContext, normalizeKnowledgeFolder, parseQuotaLimit, platformCorsPatterns, platformWorkerFetch, prepareMessagesWithCompaction, priceBindingUsageEvent, putRecord, readRecord, recordMatchesSubscription, refundInvoice, registerUser, registryErrorJson, registryStub, requireSubscription, resolveAppMembership, resolveAppName, resolveAppRole, resolveColumn, resolveSessionReadAuth, reuseSandbox, rowToData, runMigrations, sandboxFiles, sandboxOutputs, sandboxUpload, saveYjsDoc, storageLimitForTier, storageQuotaMessage, streamDeepSpaceAgent, timingSafeEqualHex, timingSafeEqualStrings, totalChars, truncateOldToolResults, turnsToCoreMessages, unwrapToolOutput, updateChat, validateAppName, validateBindingManifest, validateDoManifest, verifyAgentToken, verifyJwt };
|