@ai-sdk/sandbox-vercel 1.0.133 → 1.0.135
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 +19 -0
- package/dist/index.d.ts +42 -42
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +823 -1112
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @ai-sdk/sandbox-vercel
|
|
2
2
|
|
|
3
|
+
## 1.0.135
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8c65988]
|
|
8
|
+
- Updated dependencies [8182916]
|
|
9
|
+
- Updated dependencies [527a163]
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.53
|
|
11
|
+
- @ai-sdk/harness@1.0.135
|
|
12
|
+
|
|
13
|
+
## 1.0.134
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- ede5b89: chore: migrate package builds from tsup to tsdown
|
|
18
|
+
- Updated dependencies [ede5b89]
|
|
19
|
+
- @ai-sdk/harness@1.0.134
|
|
20
|
+
- @ai-sdk/provider-utils@5.0.52
|
|
21
|
+
|
|
3
22
|
## 1.0.133
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { Sandbox } from "@vercel/sandbox";
|
|
2
|
+
import { HarnessV1NetworkSandboxSession, HarnessV1SandboxProvider, HarnessV1SandboxSessionCreateOptions, HarnessV1SandboxSessionResumeOptions } from "@ai-sdk/harness";
|
|
3
|
+
import { Experimental_SandboxSession } from "@ai-sdk/provider-utils";
|
|
4
|
+
//#region src/vercel-legacy-sandbox-provider.d.ts
|
|
5
5
|
type VercelSandboxCreateParams$1 = NonNullable<Parameters<typeof Sandbox.create>[0]>;
|
|
6
6
|
type DistributiveOmit$1<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never;
|
|
7
7
|
type VercelSandboxCreationSettings$1 = DistributiveOmit$1<VercelSandboxCreateParams$1, 'onResume'> & {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
sandbox?: never;
|
|
9
|
+
name?: string;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Settings for `createVercelSandbox`. Two mutually-exclusive shapes:
|
|
@@ -23,10 +23,10 @@ type VercelSandboxCreationSettings$1 = DistributiveOmit$1<VercelSandboxCreatePar
|
|
|
23
23
|
* @deprecated Use `VercelNetworkSandboxSessionCreateOptions` for new sessions.
|
|
24
24
|
*/
|
|
25
25
|
type VercelSandboxSettings = {
|
|
26
|
-
|
|
26
|
+
sandbox: Sandbox;
|
|
27
27
|
} | VercelSandboxCreationSettings$1;
|
|
28
28
|
/** @deprecated Use `createVercelNetworkSandboxSession` instead. */
|
|
29
|
-
declare function createVercelSandbox(settings?: VercelSandboxSettings): HarnessV1SandboxProvider;
|
|
29
|
+
export declare function createVercelSandbox(settings?: VercelSandboxSettings): HarnessV1SandboxProvider;
|
|
30
30
|
/**
|
|
31
31
|
* `HarnessV1SandboxProvider` implementation backed by `@vercel/sandbox`.
|
|
32
32
|
* Construct one via {@link createVercelSandbox} at module scope and pass it
|
|
@@ -34,33 +34,32 @@ declare function createVercelSandbox(settings?: VercelSandboxSettings): HarnessV
|
|
|
34
34
|
* access to a network sandbox session).
|
|
35
35
|
*/
|
|
36
36
|
/** @deprecated Use `createVercelNetworkSandboxSession` instead. */
|
|
37
|
-
declare class VercelSandboxProvider implements HarnessV1SandboxProvider {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
export declare class VercelSandboxProvider implements HarnessV1SandboxProvider {
|
|
38
|
+
private readonly settings;
|
|
39
|
+
readonly specificationVersion: "harness-sandbox-v1";
|
|
40
|
+
readonly providerId = "vercel-sandbox";
|
|
41
|
+
constructor(settings: VercelSandboxSettings);
|
|
42
|
+
createSession: (options?: {
|
|
43
|
+
sessionId?: string;
|
|
44
|
+
abortSignal?: AbortSignal;
|
|
45
|
+
identity?: string;
|
|
46
|
+
onFirstCreate?: (session: Experimental_SandboxSession, opts: {
|
|
47
|
+
abortSignal?: AbortSignal;
|
|
48
|
+
}) => Promise<void>;
|
|
49
|
+
}) => Promise<HarnessV1NetworkSandboxSession>;
|
|
50
|
+
resumeSession: (options: {
|
|
51
|
+
sessionId: string;
|
|
52
|
+
abortSignal?: AbortSignal;
|
|
53
|
+
}) => Promise<HarnessV1NetworkSandboxSession>;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/utils.d.ts
|
|
56
57
|
/**
|
|
57
58
|
* Flattens an intersection of object types into a single object type so the
|
|
58
59
|
* resolved shape displays as its named properties rather than a chain of
|
|
59
60
|
* `A & B & C`.
|
|
60
61
|
*/
|
|
61
|
-
type Prettify<T> = {
|
|
62
|
-
[K in keyof T]: T[K];
|
|
63
|
-
} & {};
|
|
62
|
+
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
64
63
|
/**
|
|
65
64
|
* Distributes `Omit` across each member of a union instead of collapsing the
|
|
66
65
|
* union to its common keys. `Sandbox.create`'s parameter is a union (a
|
|
@@ -78,25 +77,26 @@ type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Prettify<Omi
|
|
|
78
77
|
* `NetworkPolicy` — is available without us re-declaring it.
|
|
79
78
|
*/
|
|
80
79
|
type VercelSandboxCreateParams = DistributiveOmit<NonNullable<Parameters<typeof Sandbox.create>[0]>, 'onResume'>;
|
|
81
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/vercel-sandbox.d.ts
|
|
82
82
|
type VercelNativeSandboxSession = Sandbox;
|
|
83
83
|
type VercelSandboxCreationSettings = VercelSandboxCreateParams & {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
sandbox?: never;
|
|
85
|
+
name?: string;
|
|
86
86
|
};
|
|
87
87
|
type VercelCreationSettings = DistributiveOmit<VercelSandboxCreationSettings, 'sandbox'>;
|
|
88
88
|
type VercelNetworkSandboxSessionCreateOptions = Prettify<HarnessV1SandboxSessionCreateOptions<VercelCreationSettings> & {
|
|
89
|
-
|
|
89
|
+
sandbox?: never;
|
|
90
90
|
}>;
|
|
91
91
|
type VercelLookupSettings = DistributiveOmit<NonNullable<Parameters<typeof Sandbox.get>[0]>, 'name' | 'resume'> & {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
name?: never;
|
|
93
|
+
resume?: never;
|
|
94
94
|
};
|
|
95
95
|
type VercelNetworkSandboxSessionResumeOptions = Prettify<HarnessV1SandboxSessionResumeOptions<VercelLookupSettings>>;
|
|
96
|
-
|
|
97
|
-
declare function
|
|
98
|
-
declare function
|
|
99
|
-
declare function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
export declare function createVercelNetworkSandboxSession(options?: VercelNetworkSandboxSessionCreateOptions): Promise<HarnessV1NetworkSandboxSession>;
|
|
97
|
+
export declare function resumeVercelNetworkSandboxSession(options: VercelNetworkSandboxSessionResumeOptions): Promise<HarnessV1NetworkSandboxSession>;
|
|
98
|
+
export declare function createVercelSandboxSessionFromNativeSandbox(nativeSandbox: VercelNativeSandboxSession): Experimental_SandboxSession;
|
|
99
|
+
export declare function createVercelNetworkSandboxSessionFromNativeSandbox(nativeSandbox: VercelNativeSandboxSession): HarnessV1NetworkSandboxSession;
|
|
100
|
+
//#endregion
|
|
101
|
+
export type { VercelNativeSandboxSession, VercelNetworkSandboxSessionCreateOptions, VercelNetworkSandboxSessionResumeOptions, VercelSandboxSettings };
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["VercelSandboxCreateParams","DistributiveOmit","VercelSandboxCreationSettings","SandboxSession","SandboxSession"],"sources":["../src/vercel-legacy-sandbox-provider.ts","../src/utils.ts","../src/vercel-sandbox.ts"],"mappings":";;;;KAkBKA,8BAA4B,YAC/B,kBAAkB,QAAQ;KAGvBC,mBAAiB,GAAG,uBAAuB,oBAC5C,KAAK,GAAG;KAGPC,kCAAgCD,mBACnCD;EAGA;EACA;;;;;;;;;;;;;;;;KAiBU;EACN,SAAS;IACXE;;wBASY,oBACd,WAAU,wBACT;;;;;;;;qBAcU,iCAAiC;mBAIf;WAHpB;WACA;EAEoB,YAAA,UAAU;EAMvC,gBAAuB;IACrB;IACA,cAAc;IACd;IACA,iBACE,SAASC,6BACT;MAAQ,cAAc;UACnB;QACH,QAAQ;EAqFZ,gBAAuB;IACrB;IACA,cAAc;QACZ,QAAQ;;;;;;;;;KC7KF,SAAS,QAAQ,WAAW,IAAI,EAAE;;;;;;;;;;KAWlC,iBAAiB,GAAG,uBAAuB,oBACnD,SAAS,KAAK,GAAG;;;;;;;KAST,4BAA4B,iBACtC,YAAY,kBAAkB,QAAQ;;;KCT5B,6BAA6B;KAEpC,gCAAgC;EACnC;EACA;;KAGG,yBAAyB,iBAC5B;KAGU,2CAA2C,SACrD,qCAAqC;EACnC;;KAIC,uBAAuB,iBAC1B,YAAY,kBAAkB,QAAQ;EAGtC;EACA;;KAGU,2CAA2C,SACrD,qCAAqC;wBAcjB,kCACpB,UAAS,2CACR,QAAQ;wBA8EW,kCACpB,SAAS,2CACR,QAAQ;wBAwBK,4CACd,eAAe,6BACdC;wBAIa,mDACd,eAAe,6BACd"}
|